# Proofs

proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand local_joinability_triangle?)
   (skeep 2)
   (expand "reduction?" (-2 -3))
   (skosimp*)
   (case "parallel(p!1, p!2)")
   (("1"
     (hide 1)
     (inst 1 "replaceTerm(t1, ext(sigma!2)(rhs(e!2)), p!2)")
     (("1"
       (lemma "replace_persistence")
       (inst -1 "p!1" "p!2" "t" "ext(sigma!1)(rhs(e!1))")
       (assert)
       (lemma "replace_preserv_parallel_pos")
       (inst?)
       (inst -1 "p!2")
       (assert)
       (expand RC)
       (expand union)
       (expand member)
       (split)
       (("1"
         (flatten)
         (hide 2)
         (expand reduction?)
         (inst 1 "e!2" "sigma!2" "p!2")
         (replace -6 1)
         (replace -2 1)
         (propax))
        ("2"
         (flatten)
         (hide 2)
         (expand reduction?)
         (inst 1 "e!1" "sigma!1" "p!1")
         (("1"
           (lemma "replace_persistence")
           (inst -1 "p!2" "p!1" "t" "ext(sigma!2)(rhs(e!2))")
           (assert)
           (rewrite parallel_comm)
           (replace -9 1)
           (replace -1 1)
           (assert)
           (replace -7 1)
           (lemma "replace_commutativity")
           (inst -1 "p!1" "p!2" "ext(sigma!2)(rhs(e!2))" "t"
            "ext(sigma!1)(rhs(e!1))")
           (assert))
          ("2"
           (lemma "replace_preserv_parallel_pos")
           (inst -1 "p!2" "p!1" "t" "ext(sigma!2)(rhs(e!2))")
           (replace -9 1)
           (rewrite parallel_comm)
           (assert))))))
      ("2"
       (lemma "replace_preserv_parallel_pos")
       (inst?)
       (inst -1 "p!2")
       (assert))))
    ("2"
     (expand "parallel")
     (expand "<=")
     (prop)
     (("1"
       (skosimp*)
       (lemma Orth_lemma_aux)
       (inst -1 "E" "e!1" "e!2" "p!1" "p1!1" "p!2" "_" "_" "_" "_" t t1
        t2)
       (assert)
       (lemma exists_renaming)
       (copy -1)
       (inst -1 "Vars(lhs(e!1))" "Vars(t)")
       (("1"
         (skeep -1)
         (assert)
         (inst -3 "Vars(lhs(e!2))" "Vars(t)")
         (("1"
           (skolem -3 rho2)
           (flatten)
           (lemma inverse_renaming)
           (copy -1)
           (inst -1 rho)
           (inst -2 rho2)
           (skolem -1 rhoi)
           (skolem -2 rho2i)
           (inst -7 rho rho2 "comp(sigma!1,rhoi)" "comp(sigma!2,rho2i)")
           (("1"
             (prop)
             (("1"
               (hide 2 3)
               (replace -9 1)
               (hide-all-but (-1 -3 1))
               (rewrite ext_o)
               (expand o)
               (lemma ext_o)
               (inst -1 rhoi rho)
               (expand o)
               (decompose-equality)
               (inst -1 "lhs(e!1)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (expand subset?)
               (skeep)
               (expand member)
               (replace -4 1)
               (propax))
              ("2"
               (hide-all-but (-1 -3 -10 1))
               (replaces -3 1)
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rhoi rho)
               (expand o)
               (decompose-equality)
               (inst -1 "rhs(e!1)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (replace -3 1)
               (hide-all-but 1)
               (typepred e!1)
               (expand rewrite_rule?)
               (flatten)
               (expand rhs)
               (expand lhs)
               (propax))
              ("3"
               (hide-all-but (-5 -6 -11 1))
               (replaces -3 1)
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rho2i rho2)
               (expand o)
               (decompose-equality)
               (inst -1 "lhs(e!2)")
               (replace -1 1 rl)
               (reveal -5)
               (rewrite inverse_rename_identity)
               (replace -3 1)
               (hide-all-but 1)
               (grind))
              ("4"
               (hide-all-but (-2 -5 -6 -12 1))
               (replaces -4 1)
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rho2i rho2)
               (expand o)
               (decompose-equality)
               (inst -1 "rhs(e!2)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (hide 2)
               (replaces -3 1)
               (hide-all-but 1)
               (typepred e!2)
               (expand rewrite_rule?)
               (flatten)
               (expand rhs)
               (expand lhs)
               (propax))
              ("5"
               (hide-all-but (-3 -4 1))
               (expand disjoint?)
               (expand empty?)
               (skeep)
               (expand member)
               (expand intersection)
               (expand member)
               (flatten)
               (inst -4 x)
               (prop)
               (expand restrict)
               (expand Ran)
               (expand member)
               (expand Vars -1)
               (skolem -1 pi)
               (rewrite subterm_ext_commute)
               (("1"
                 (inst 1 "subtermOF(lhs(e!1), pi)")
                 (("1"
                   (split)
                   (("1"
                     (replace -3 1)
                     (lemma term_is_a_var)
                     (inst -1 rho "subtermOF(lhs(e!1), pi)" x)
                     (assert)
                     (expand Vars 1)
                     (inst 1 pi))
                    ("2"
                     (lemma term_is_a_var)
                     (inst -1 rho "subtermOF(lhs(e!1), pi)" x)
                     (assert)
                     (expand ext -2)
                     (assert))))
                  ("2"
                   (expand V 1)
                   (lemma term_is_a_var)
                   (inst -1 rho "subtermOF(lhs(e!1), pi)" x)
                   (assert))))
                ("2" (typepred pi) (rewrite rename_preserv_pos))))
              ("6"
               (hide-all-but (-5 -6 1))
               (expand disjoint?)
               (expand empty?)
               (skeep)
               (inst -3 x)
               (expand intersection)
               (expand member)
               (expand restrict)
               (flatten)
               (prop)
               (expand Ran)
               (expand Vars -1)
               (skolem -1 pi)
               (rewrite subterm_ext_commute)
               (("1"
                 (inst 1 "subtermOF(lhs(e!2), pi)")
                 (("1"
                   (expand member)
                   (split)
                   (("1" (replace -3 1) (expand Vars 1) (inst 1 pi))
                    ("2"
                     (lemma term_is_a_var)
                     (inst -1 rho2 "subtermOF(lhs(e!2), pi)" x)
                     (assert)
                     (expand ext -2)
                     (assert))))
                  ("2"
                   (expand V 1)
                   (lemma term_is_a_var)
                   (inst -1 rho2 "subtermOF(lhs(e!2), pi)" x)
                   (assert))))
                ("2"
                 (typepred pi)
                 (lemma rename_preserv_pos)
                 (inst -1 rho2 "lhs(e!2)")
                 (assert))))))
            ("2" (hide-all-but 1) (rewrite subs_o))
            ("3" (hide-all-but 1) (rewrite subs_o))))
          ("2" (hide-all-but 1) (rewrite vars_of_term_finite))
          ("3" (hide-all-but 1) (rewrite vars_of_term_finite))))
        ("2" (hide-all-but 1) (rewrite vars_of_term_finite))
        ("3" (hide-all-but 1) (rewrite vars_of_term_finite))))
      ("2"
       (skosimp)
       (lemma Orth_lemma_aux)
       (inst -1 E e!2 e!1 p!2 p1!1 p!1 "_" "_" "_" "_" t t2 t1)
       (assert)
       (lemma exists_renaming)
       (copy -1)
       (inst -1 "Vars(lhs(e!1))" "Vars(t)")
       (("1"
         (skeep -1)
         (inst -3 "Vars(lhs(e!2))" "Vars(t)")
         (("1"
           (skolem -3 rho2)
           (flatten)
           (lemma inverse_renaming)
           (copy -1)
           (inst -1 rho)
           (skolem -1 rhoi)
           (inst -2 rho2)
           (skolem -2 rho2i)
           (inst -7 "rho2" "rho" "comp(sigma!2,rho2i)"
            "comp(sigma!1,rhoi)")
           (("1"
             (prop)
             (("1" (hide-all-but (-1 2)) (skosimp) (inst 1 s!1) (prop))
              ("2"
               (replace -11 1)
               (hide-all-but (-2 1))
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rho2i rho2)
               (expand o)
               (decompose-equality)
               (inst -1 "lhs(e!2)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (expand subset?)
               (skeep)
               (reveal -6)
               (replace -1)
               (propax))
              ("3"
               (replace -12 1)
               (hide-all-but (-2 -5 1))
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rho2i rho2)
               (expand o)
               (decompose-equality)
               (inst -1 "rhs(e!2)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (expand subset?)
               (skeep)
               (expand member)
               (replace -4)
               (hide-all-but (-1 1))
               (typepred e!2)
               (expand rewrite_rule?)
               (flatten)
               (expand subset?)
               (inst -1 x)
               (expand member)
               (expand rhs)
               (expand lhs)
               (assert))
              ("4"
               (replace -9 1)
               (hide-all-but (-1 -3 1))
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rhoi rho)
               (expand o)
               (decompose-equality)
               (inst -1 "lhs(e!1)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (expand subset?)
               (skeep)
               (expand member)
               (replace -4)
               (propax))
              ("5"
               (replace -10 1)
               (hide-all-but (-1 -3 1))
               (rewrite ext_o)
               (lemma ext_o)
               (inst -1 rhoi rho)
               (expand o)
               (decompose-equality)
               (inst -1 "rhs(e!1)")
               (replace -1 1 rl)
               (rewrite inverse_rename_identity)
               (replace -3)
               (hide-all-but 1)
               (typepred e!1)
               (expand rewrite_rule?)
               (flatten)
               (expand rhs)
               (expand lhs)
               (propax))
              ("6"
               (hide-all-but (-5 -6 1))
               (expand disjoint?)
               (expand empty?)
               (skeep)
               (inst -3 x)
               (expand member)
               (expand intersection)
               (expand member)
               (flatten)
               (prop)
               (expand restrict)
               (expand Ran)
               (expand Vars -1)
               (skolem -1 pi)
               (rewrite subterm_ext_commute)
               (("1"
                 (inst 1 "subtermOF(lhs(e!2), pi)")
                 (("1"
                   (expand member)
                   (split)
                   (("1" (replace -3) (expand Vars 1) (inst 1 pi))
                    ("2"
                     (lemma term_is_a_var)
                     (inst -1 rho2 "subtermOF(lhs(e!2), pi)" x)
                     (assert)
                     (expand ext -2)
                     (assert))))
                  ("2"
                   (expand V)
                   (lemma term_is_a_var)
                   (inst -1 rho2 "subtermOF(lhs(e!2), pi)" x)
                   (assert))))
                ("2" (typepred pi) (rewrite rename_preserv_pos))))
              ("7"
               (hide-all-but (-3 -4 1))
               (expand disjoint?)
               (expand empty?)
               (skeep)
               (inst -3 x)
               (expand intersection)
               (expand member)
               (flatten)
               (split)
               (("1" (propax))
                ("2"
                 (expand restrict)
                 (expand Ran)
                 (expand Vars -1)
                 (skolem -1 pi)
                 (rewrite subterm_ext_commute)
                 (("1"
                   (lemma term_is_a_var)
                   (inst -1 rho "subtermOF(lhs(e!1), pi)" x)
                   (assert)
                   (inst 1 "subtermOF(lhs(e!1), pi)")
                   (("1"
                     (expand member)
                     (split)
                     (("1" (replace -4) (expand Vars 1) (inst 1 pi))
                      ("2" (expand ext -2) (assert))))
                    ("2" (expand V) (propax))))
                  ("2" (typepred pi) (rewrite rename_preserv_pos))))))))
            ("2" (hide-all-but 1) (rewrite subs_o))
            ("3" (hide-all-but 1) (rewrite subs_o))))
          ("2" (hide-all-but 1) (rewrite vars_of_term_finite))
          ("3" (hide-all-but 1) (rewrite vars_of_term_finite))))
        ("2" (hide-all-but 1) (rewrite vars_of_term_finite))
        ("3" (hide-all-but 1) (rewrite vars_of_term_finite))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand local_joinability_triangle?)
   (skeep)
   (lemma Semi_implies_CR)
   (lemma CR_iff_Confluent)
   (inst -1 R)
   (inst -2 R)
   (assert)
   (hide 1 3)
   (expand semi_confluent?)
   (assert)
   (skeep)
   (expand RTC)
   (expand IUnion)
   (skolem -2 i)
   (case "FORALL (i : nat, t, t1, t2): R(t, t1) & iterate(R, i)(t, t2)
                                                      IMPLIES joinable?(R)(t1, t2)")
   (("1" (assert) (inst -1 i x y z) (assert))
    ("2"
     (hide -1 -2 2)
     (induct i)
     (("1"
       (skeep)
       (expand joinable?)
       (inst 1 t1)
       (expand iterate)
       (replaces -2)
       (prop)
       (("1" (expand* RTC IUnion) (inst 1 0) (grind))
        ("2" (expand* RTC IUnion) (inst 1 1) (grind))))
      ("2"
       (skeep)
       (skeep)
       (rewrite iterate_add_one)
       (expand o)
       (skolem -3 u)
       (inst -4 t t1 u)
       (assert)
       (flatten)
       (assert)
       (skolem -5 s)
       (flatten)
       (expand* RC union member)
       (prop)
       (("1"
         (inst -3 u s t2)
         (assert)
         (expand joinable? -3)
         (skolem -3 r)
         (flatten)
         (expand joinable?)
         (inst 1 r)
         (assert)
         (hide -4)
         (expand* RTC IUnion)
         (skosimp*)
         (lemma iterate_add)
         (inst -1 R 1 i!1)
         (inst 1 "i!1+1")
         (replace -1 1)
         (expand o 1)
         (inst 1 s)
         (assert)
         (hide-all-but (-3 1))
         (grind))
        ("2"
         (replaces -1)
         (hide -2 -3 -4)
         (expand joinable?)
         (inst 1 t2)
         (expand* RTC IUnion)
         (prop)
         (("1"
           (lemma iterate_add_one)
           (inst -1 R j)
           (inst 1 "j+1")
           (replaces -1)
           (expand o)
           (inst 1 s)
           (assert))
          ("2" (hide-all-but 1) (inst 1 0) (grind))))
        ("3" (inst -3 u s t2) (assert))
        ("4"
         (hide -3)
         (replaces -1)
         (replaces -1)
         (hide -1)
         (expand joinable?)
         (inst 1 t2)
         (assert)
         (expand* RTC IUnion)
         (prop)
         (("1" (inst 1 j)) ("2" (inst 1 0) (hide -2) (grind))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (name-replace RRE "reduction?(E)")
   (lemma Linear_and_Non_ambiguous_implies_triangle)
   (inst -1 E)
   (assert)
   (reveal -2)
   (replace -1 -2 lr)
   (hide -1 1 -3)
   (lemma Triangle_implies_conflent)
   (inst -1 RRE)
   (assert))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand o)
   (expand* SPP? SP? PP? finseq_appl)
   (lift-if)
   (assert)
   (prop)
   (("1"
     (skeep)
     (typepred i)
     (prop)
     (("1" (inst -5 "fsp1`length + i") (("1" (assert)) ("2" (assert))))
      ("2" (inst -4 "i-fsp2`length") (("1" (assert)) ("2" (assert))))))
    ("2"
     (hide -2)
     (skeep)
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (prop)
     (("1"
       (inst -3 "fsp1`length+i" "fsp1`length+j")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("2"
       (inst -2 "fsp1`length+i" "j-fsp2`length")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("3"
       (inst -2 "i-fsp2`length" "fsp1`length+j")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))
      ("4"
       (inst -1 "i-fsp2`length" "j-fsp2`length")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))))
    ("3"
     (skeep)
     (assert)
     (prop)
     (("1" (inst -3 "fsp1`length+i") (("1" (assert)) ("2" (assert))))
      ("2" (inst -2 "i-fsp2`length") (("1" (assert)) ("2" (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (skeep)
   (skeep)
   (case "x`length = 0")
   (("1"
     (hide -2)
     (hide 2)
     (expand* member_seq finseq_appl)
     (skosimp)
     (typepred i!1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 p1 p2)
     (rewrite rest_of_PP_is_PP)
     (expand member_seq -3)
     (expand finseq_appl)
     (skosimp)
     (case "i!1=0")
     (("1"
       (replaces -1)
       (prop)
       (("1"
         (expand sub_pos -1)
         (expand* add_first insert?)
         (lift-if)
         (prop)
         (assert))
        ("2"
         (expand sub_pos 1)
         (lift-if)
         (prop)
         (expand* add_first insert? finseq_appl)
         (expand* member_seq finseq_appl)
         (skosimp)
         (inst 2 "i!2+1")
         (assert))
        ("3"
         (expand sub_pos -1)
         (expand* add_first insert? finseq_appl)
         (lift-if)
         (prop)
         (("1" (assert)) ("2" (expand <=) (inst 1 p2) (assert))
          ("3"
           (replace -1 -4 rl)
           (lemma equal_prefix[posnat])
           (inst -1 p1 p2 empty_seq)
           (rewrite seq_o_empty)
           (assert)
           (rewrite empty_0 3))))
        ("4"
         (expand member_seq 1)
         (expand finseq_appl)
         (inst 1 0)
         (("1"
           (expand* sub_pos add_first insert? finseq_appl)
           (lift-if)
           (prop)
           (("1" (expand <=) (inst 1 p2) (assert))
            ("2"
             (lemma equal_prefix[posnat])
             (inst -1 p1 p2 empty_seq)
             (rewrite seq_o_empty)
             (assert)
             (rewrite empty_0 4))))
          ("2"
           (expand* sub_pos add_first insert?)
           (lift-if)
           (prop)
           (("1" (assert)) ("2" (expand <=) (inst 1 p2) (assert))
            ("3"
             (lemma equal_prefix[posnat])
             (inst -1 p1 p2 empty_seq)
             (rewrite seq_o_empty)
             (assert)
             (rewrite empty_0 4))))))))
      ("2"
       (assert)
       (prop)
       (("1"
         (expand sub_pos -1)
         (lift-if)
         (expand* add_first insert?)
         (assert))
        ("2"
         (expand sub_pos 1)
         (lift-if)
         (expand* add_first insert? finseq_appl)
         (prop)
         (expand* member_seq finseq_appl)
         (skosimp)
         (inst 2 "i!2+1")
         (lift-if)
         (assert))
        ("3"
         (expand* member_seq finseq_appl)
         (inst 1 "i!1-1")
         (("1" (expand rest 1) (expand* ^))
          ("2" (expand* rest ^ min empty_seq) (assert))))
        ("4"
         (hide 1)
         (expand* rest ^ min)
         (expand* member_seq finseq_appl)
         (inst 1 "i!1-1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (expand finseq_appl)
   (expand PP?)
   (expand finseq_appl)
   (prop)
   (("1" (typepred i) (typepred j) (assert))
    ("2"
     (inst -1 i j)
     (assert)
     (expand parallel)
     (flatten)
     (expand <=)
     (inst 2 empty_seq)
     (rewrite seq_o_empty)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (skeep)
   (skeep)
   (case "x`length = 0")
   (("1"
     (hide -2 -4 -6 1)
     (expand* member_seq finseq_appl)
     (skosimp)
     (typepred i!1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2 p)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (prop)
     (("1"
       (expand Pos_Equal 2)
       (lift-if)
       (prop)
       (expand* add_first insert? finseq_appl)
       (expand member_seq (-2 1))
       (expand finseq_appl)
       (skosimp)
       (inst 1 i!1+1)
       (lift-if)
       (assert))
      ("2"
       (expand member_seq -3)
       (skosimp)
       (case "i!1=0")
       (("1"
         (replaces -1)
         (expand finseq_appl)
         (expand Pos_Equal)
         (assert)
         (expand* add_first insert? finseq_appl)
         (expand member_seq 3)
         (expand finseq_appl)
         (inst 3 0)
         (assert))
        ("2"
         (expand rest 2)
         (expand* ^ min)
         (expand member_seq 2)
         (inst 2 i!1-1)
         (("1" (lift-if) (expand finseq_appl) (assert))
          ("2" (assert))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" fsp1)
   (skeep)
   (skeep)
   (case "x`length = 0")
   (("1"
     (hide -2)
     (expand Pos_Over)
     (assert)
     (expand empty_seq)
     (expand subseq)
     (skeep))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (expand Pos_Over 2)
     (lift-if)
     (prop)
     (("1"
       (expand* add_first insert? finseq_appl)
       (expand subseq 1)
       (expand finseq_appl)
       (skosimp)
       (lift-if)
       (prop)
       (("1"
         (expand member_seq)
         (inst 1 0)
         (expand finseq_appl)
         (propax))
        ("2"
         (lemma subseq_rest[position])
         (inst -1 "Pos_Over(rest(x), fsp2)" x)
         (assert)
         (expand subseq -1)
         (inst -1 "i!1 - 1")
         (expand finseq_appl)
         (propax))))
      ("2"
       (expand add_first 1)
       (expand* insert? finseq_appl)
       (expand subseq 1)
       (skosimp)
       (expand finseq_appl)
       (lift-if)
       (prop)
       (("1"
         (expand member_seq)
         (inst 1 0)
         (expand finseq_appl)
         (propax))
        ("2"
         (lemma subseq_rest[position])
         (inst -1 "Pos_Over(rest(x), fsp2)" x)
         (assert)
         (expand subseq -1)
         (inst -1 "i!1 - 1")
         (expand finseq_appl)
         (propax))))
      ("3" (rewrite subseq_rest 3))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (skeep)
   (skeep)
   (case "x`length = 0")
   (("1"
     (hide -2)
     (expand Pos_Equal)
     (expand empty_seq)
     (lift-if)
     (assert)
     (expand subseq)
     (skeep))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (expand Pos_Equal 2)
     (lift-if)
     (prop)
     (("1"
       (expand* add_first insert? finseq_appl)
       (expand subseq 1)
       (skosimp)
       (expand finseq_appl)
       (lift-if)
       (prop)
       (("1" (expand member_seq 1) (expand finseq_appl) (inst 1 0))
        ("2"
         (lemma subseq_rest[position])
         (inst -1 "Pos_Equal(rest(x), fsp2)" x)
         (assert)
         (expand subseq -1)
         (expand finseq_appl)
         (inst -1 "i!1-1"))))
      ("2" (rewrite subseq_rest 2))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (expand sub_pos)
     (expand empty_seq)
     (assert)
     (expand subseq)
     (skeep))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 p)
     (rewrite rest_of_PP_is_PP)
     (expand sub_pos 2)
     (assert)
     (lift-if)
     (prop)
     (("1"
       (expand* add_first insert? finseq_appl)
       (expand subseq 2)
       (expand finseq_appl)
       (skosimp)
       (lift-if)
       (prop)
       (("1" (expand* member_seq finseq_appl) (inst 1 0))
        ("2"
         (lemma subseq_rest[position])
         (inst -1 "sub_pos(rest(x), p)" x)
         (assert)
         (expand subseq -1)
         (expand finseq_appl)
         (inst -1 "i!1-1"))))
      ("2" (rewrite subseq_rest 2)) ("3" (rewrite subseq_rest 1))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp2`length" "fsp2")
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (expand Pos_Under 1)
     (expand empty_seq)
     (assert)
     (expand subseq)
     (skeep))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp1)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (expand Pos_Under 2)
     (expand o)
     (expand subseq 2)
     (expand finseq_appl)
     (skeep)
     (lift-if)
     (prop)
     (("1"
       (lemma sub_pos_is_sub_seq)
       (inst -1 fsp1 "x`seq(0)")
       (assert)
       (expand subseq -1)
       (expand finseq_appl)
       (inst -1 i))
      ("2"
       (expand subseq -1)
       (expand finseq_appl)
       (inst -1 "i - sub_pos(fsp1, x`seq(0))`length")
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (skeep)
   (skeep)
   (case "x`length = 0")
   (("1"
     (expand Pos_Over 1)
     (expand empty_seq)
     (expand PP? 1 1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (expand Pos_Over 2)
     (prop)
     (("1"
       (rewrite add_first_parallel_pos_to_PP_is_PP)
       (skeep)
       (expand finseq_appl)
       (lemma Pos_Over_is_sub_seq)
       (inst -1 "rest(x)" fsp2)
       (rewrite rest_of_PP_is_PP)
       (assert)
       (expand* subseq finseq_appl)
       (inst -1 i)
       (expand* member_seq finseq_appl)
       (skosimp)
       (typepred i!1)
       (expand rest -2 2)
       (expand rest -1)
       (expand* ^ min)
       (expand empty_seq -1)
       (lift-if)
       (assert)
       (prop)
       (expand PP? -5)
       (assert)
       (inst -5 "1+i!1" 0)
       (expand finseq_appl)
       (propax))
      ("2"
       (rewrite add_first_parallel_pos_to_PP_is_PP 1)
       (skeep)
       (expand finseq_appl)
       (lemma Pos_Over_is_sub_seq)
       (inst -1 "rest(x)" fsp2)
       (rewrite rest_of_PP_is_PP)
       (assert)
       (expand* subseq member_seq finseq_appl)
       (inst -1 i)
       (skosimp)
       (typepred i!1)
       (expand rest -2 2)
       (expand rest -1)
       (expand* ^ min)
       (expand empty_seq -1)
       (lift-if)
       (assert)
       (prop)
       (expand PP? -5)
       (expand finseq_appl)
       (assert)
       (inst -5 1+i!1 0)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (("1"
     (skeep)
     (skeep)
     (expand SPP?)
     (flatten)
     (rewrite Pos_Over_is_PP)
     (case "x`length = 0")
     (("1"
       (expand Pos_Over 1)
       (assert)
       (expand SP? 1)
       (skeep)
       (typepred i)
       (expand empty_seq -1)
       (assert))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 fsp2 s)
       (rewrite rest_of_PP_is_PP)
       (rewrite rest_of_SP_is_SP)
       (assert)
       (flatten)
       (expand Pos_Over 2)
       (rewrite add_first_parallel_pos_to_SP_is_SP)
       (("1" (prop))
        ("2"
         (hide 3)
         (expand SP? -4)
         (inst -4 0)
         (expand finseq_appl)
         (propax))))))
    ("2" (skeep) (expand SPP? -2) (flatten))
    ("3" (skeep) (expand SPP? -1) (flatten))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (skeep)
   (skeep)
   (case "x`length = 0")
   (("1"
     (hide-all-but (-1 -5))
     (expand* member_seq)
     (skosimp)
     (typepred i!1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2 p1 p2)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (prop)
     (("1"
       (expand Pos_Over 3)
       (lift-if)
       (assert)
       (prop)
       (("1"
         (expand* add_first insert?)
         (expand member_seq (-2 1))
         (expand finseq_appl)
         (skosimp)
         (inst 1 "i!1+1")
         (assert))
        ("2"
         (expand add_first 1)
         (expand insert?)
         (expand member_seq (-2 1))
         (expand finseq_appl)
         (skosimp)
         (inst 1 "i!1+1")
         (assert))))
      ("2"
       (expand member_seq -3)
       (skosimp)
       (case "i!1=0")
       (("1"
         (replaces -1)
         (expand Pos_Over)
         (lift-if)
         (prop)
         (("1"
           (expand* add_first insert?)
           (expand member_seq 1)
           (expand finseq_appl)
           (inst 1 0)
           (assert))
          ("2"
           (expand add_first 1)
           (expand insert?)
           (expand member_seq 1)
           (expand finseq_appl)
           (inst 1 0)
           (assert))
          ("3"
           (expand finseq_appl)
           (lemma sub_pos_element)
           (inst -1 fsp2 p1 p2)
           (assert))))
        ("2"
         (expand* rest ^ min empty_seq)
         (lift-if)
         (assert)
         (expand member_seq 2)
         (expand finseq_appl)
         (inst 2 i!1-1)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (expand member_seq -4)
     (skosimp)
     (typepred i!1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2 p)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (prop)
     (("1"
       (expand Pos_Over 2)
       (lift-if)
       (expand add_first 2 2)
       (expand* insert? finseq_appl)
       (assert)
       (prop)
       (("1"
         (expand member_seq (-2 1))
         (expand finseq_appl)
         (skosimp)
         (inst 1 i!1+1)
         (assert))
        ("2"
         (expand member_seq (-2 1))
         (expand finseq_appl)
         (skosimp)
         (inst 1 i!1+1)
         (assert))))
      ("2"
       (expand member_seq -3)
       (expand finseq_appl)
       (skosimp)
       (case "i!1=0")
       (("1"
         (replaces -1)
         (expand Pos_Over)
         (expand add_first 3 2)
         (expand insert?)
         (lift-if)
         (assert)
         (expand member_seq 3)
         (expand finseq_appl)
         (inst 3 0))
        ("2"
         (expand* rest ^ min empty_seq)
         (assert)
         (expand member_seq 2)
         (expand finseq_appl)
         (inst 2 i!1-1)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (expand member_seq -3)
     (skosimp)
     (typepred i!1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 p1 p2)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (prop)
     (("1"
       (expand sub_pos 3)
       (lift-if)
       (prop)
       (expand* add_first insert?)
       (expand member_seq (-2 2))
       (expand finseq_appl)
       (skosimp)
       (inst 2 i!1+1)
       (assert))
      ("2"
       (expand member_seq -2)
       (skosimp)
       (expand finseq_appl)
       (case "i!1=0")
       (("1"
         (replaces -1)
         (expand sub_pos)
         (lift-if)
         (assert)
         (expand* add_first insert?)
         (expand member_seq 4)
         (expand finseq_appl)
         (inst 4 0)
         (assert))
        ("2"
         (expand* rest ^ min empty_seq)
         (assert)
         (expand member_seq 2)
         (expand finseq_appl)
         (inst 2 i!1-1)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp2`length" "fsp2")
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide-all-but (-1 -6))
     (expand member_seq)
     (skosimp)
     (typepred i!1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp1 p1 p2)
     (rewrite rest_of_PP_is_PP)
     (prop)
     (("1"
       (expand Pos_Under 3)
       (lift-if)
       (assert)
       (rewrite member_seq_in_seq2set 3)
       (rewrite seq2set_comp)
       (flatten)
       (rewrite member_seq_in_seq2set -1))
      ("2"
       (expand member_seq -4)
       (skosimp)
       (expand finseq_appl)
       (case "i!1=0")
       (("1"
         (replaces -1)
         (expand Pos_Under 4)
         (rewrite member_seq_in_seq2set 4)
         (rewrite seq2set_comp)
         (flatten)
         (hide 5)
         (lemma member_seq_in_seq2set[position])
         (inst -1 "sub_pos(fsp1, x`seq(0))" p1)
         (assert)
         (rewrite sub_pos_in_Pos_Under_aux))
        ("2"
         (expand* rest ^ min empty_seq)
         (assert)
         (expand member_seq 2)
         (expand finseq_appl)
         (inst 2 "i!1-1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (expand sub_pos -3)
     (expand empty_seq)
     (assert)
     (expand member_seq)
     (skosimp))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 p p1)
     (rewrite rest_of_PP_is_PP)
     (prop)
     (("1"
       (expand sub_pos -2)
       (lift-if)
       (assert)
       (prop)
       (expand* add_first insert?)
       (expand member_seq -2)
       (expand finseq_appl)
       (skosimp)
       (lift-if)
       (prop)
       (("1" (assert))
        ("2"
         (expand* member_seq finseq_appl)
         (inst 4 "i!1-1")
         (assert))))
      ("2"
       (expand sub_pos -3)
       (lift-if)
       (assert)
       (prop)
       (expand* add_first insert?)
       (expand member_seq -2)
       (expand finseq_appl)
       (skosimp)
       (lift-if)
       (prop)
       (("1" (assert))
        ("2"
         (expand* member_seq finseq_appl)
         (inst 3 "i!1-1")
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (expand sub_pos 1)
     (expand PP? 1)
     (expand finseq_appl)
     (expand empty_seq 1 1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 p)
     (rewrite rest_of_PP_is_PP)
     (expand sub_pos 2)
     (assert)
     (prop)
     (rewrite add_first_parallel_pos_to_PP_is_PP)
     (skeep)
     (expand finseq_appl)
     (lemma sub_pos_is_sub_seq)
     (inst -1 "rest(x)" p)
     (rewrite rest_of_PP_is_PP)
     (expand* subseq member_seq finseq_appl)
     (inst -1 i)
     (skosimp)
     (typepred i!1)
     (expand rest -2 2)
     (expand rest -1)
     (expand* ^ min)
     (expand empty_seq -1)
     (lift-if)
     (assert)
     (prop)
     (expand PP? -5)
     (expand finseq_appl)
     (assert)
     (inst -5 1+i!1 0)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (expand SPP?)
     (flatten)
     (split)
     (("1" (rewrite sub_pos_is_PP))
      ("2"
       (case "x`length=0")
       (("1"
         (expand* SP? finseq_appl)
         (skeep)
         (typepred i)
         (expand sub_pos -1)
         (lift-if)
         (expand empty_seq -1)
         (assert))
        ("2"
         (inst -1 "rest(x)")
         (rewrite length_rest)
         (inst -1 p s)
         (rewrite rest_of_PP_is_PP)
         (rewrite rest_of_SP_is_SP)
         (expand sub_pos 2)
         (assert)
         (prop)
         (rewrite add_first_parallel_pos_to_SP_is_SP)
         (expand SP? -5)
         (inst -5 0)
         (expand finseq_appl)
         (propax))))))
    ("2" (expand SPP?) (skeep))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand finseq_appl)
   (measure-induct "fsp2`length" fsp2)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2 -3 -4 1)
     (expand Pos_Under)
     (assert)
     (expand empty_seq)
     (expand member_seq)
     (skosimp))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (expand Pos_Under -4)
     (assert)
     (lemma member_seq_in_seq2set[position])
     (inst -1 "sub_pos(fsp1, x`seq(0)) o Pos_Under(fsp1, rest(x))" p)
     (assert)
     (rewrite seq2set_comp)
     (split)
     (("1" (inst 2 0) (rewrite member_seq_in_seq2set 2))
      ("2"
       (inst -2 fsp1 p)
       (rewrite rest_of_PP_is_PP)
       (assert)
       (rewrite member_seq_in_seq2set -2)
       (skolem -2 j)
       (typepred j)
       (expand rest (-1 -3))
       (expand* ^ min)
       (expand empty_seq -1)
       (lift-if)
       (assert)
       (prop)
       (inst 6 1+j))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality)
   (iff)
   (prop)
   (("1"
     (case "fsp1`length = 0")
     (("1" (expand seq2set -2) (skosimp) (typepred kk!1) (assert))
      ("2"
       (rewrite seq2set_comp)
       (rewrite seq2set_comp)
       (flatten)
       (case "PP?(add_first(x!1, fsp2))")
       (("1"
         (hide 3 4)
         (lemma parallel_pos_in_Pos_Over)
         (inst -1 fsp1 fsp2 x!1)
         (prop)
         (("1" (rewrite member_seq_in_seq2set))
          ("2" (rewrite member_seq_in_seq2set))))
        ("2"
         (rewrite add_first_parallel_pos_to_PP_is_PP)
         (hide 2)
         (expand finseq_appl)
         (skeep)
         (expand parallel)
         (case "fsp2`seq(i) = x!1")
         (("1"
           (lemma member_seq_in_seq2set[position])
           (inst-cp -1 fsp1 x!1)
           (inst -1 "Pos_Equal(fsp1, fsp2)" x!1)
           (assert)
           (rewrite same_pos_in_Pos_Equal)
           (expand member_seq 1)
           (expand finseq_appl)
           (inst 1 i)
           (assert))
          ("2"
           (split)
           (("1"
             (hide 3 4)
             (lemma sub_pos_in_Pos_Under)
             (inst -1 fsp1 fsp2 x!1 "fsp2`seq(i)")
             (assert)
             (rewrite member_seq_in_seq2set)
             (rewrite member_seq_in_seq2set)
             (rewrite member_seq_in_seq2set)
             (expand seq2set 1)
             (expand finseq_appl)
             (inst 1 i))
            ("2"
             (hide 4 5)
             (lemma pos_up_in_Pos_Over)
             (expand <=)
             (skolem -2 p2)
             (inst -1 fsp1 fsp2 x!1 p2)
             (assert)
             (prop)
             (("1" (rewrite member_seq_in_seq2set))
              ("2"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty))
              ("3" (rewrite member_seq_in_seq2set))
              ("4"
               (expand* member_seq finseq_appl)
               (inst 1 i)
               (assert))))))))))))
    ("2"
     (rewrite seq2set_comp)
     (rewrite seq2set_comp)
     (split)
     (("1"
       (lemma Pos_Over_is_sub_seq)
       (inst -1 fsp1 fsp2)
       (assert)
       (expand* subseq finseq_appl)
       (expand seq2set -2)
       (expand finseq_appl)
       (skosimp)
       (inst -1 kk!1)
       (rewrite member_seq_in_seq2set)
       (assert))
      ("2"
       (lemma Pos_Equal_is_sub_seq)
       (inst -1 fsp1 fsp2)
       (assert)
       (expand seq2set -2)
       (expand* subseq finseq_appl)
       (skosimp)
       (inst -1 kk!1)
       (rewrite member_seq_in_seq2set)
       (assert))
      ("3"
       (lemma Pos_Under_is_sub_seq)
       (inst -1 fsp1 fsp2)
       (assert)
       (expand seq2set -2)
       (expand* subseq finseq_appl)
       (skosimp)
       (inst -1 kk!1)
       (rewrite member_seq_in_seq2set)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp*)
   (expand "rest" 1 1)
   (lift-if)
   (prop)
   (("1" (grind))
    ("2"
     (decompose-equality 2)
     (("1" (grind))
      ("2"
       (decompose-equality 1)
       (expand "^")
       (lift-if)
       (prop)
       (("1"
         (expand "sigma_rhs" -1)
         (lift-if)
         (prop)
         (("1" (hide (-2 2)) (grind))
          ("2"
           (lemma "seq_extras[Sub].length_rest_0")
           (inst?)
           (assert)
           (expand "sigma_rhs" 2)
           (propax))))
        ("2" (grind)) ("3" (grind))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (case "fss1!1`length = 0")
   (("1"
     (replace -1 -2)
     (expand "sigma_rhs" 1 2)
     (lift-if)
     (assert)
     (rewrite "empty_0")
     (rewrite "empty_0")
     (replaces -1)
     (replaces -1)
     (rewrite "empty_o_seq")
     (rewrite "empty_o_seq")
     (rewrite "empty_o_seq"))
    ("2"
     (case "fss2!1`length = 0")
     (("1"
       (replace -1 -3)
       (expand "sigma_rhs" 2 3)
       (lift-if)
       (assert)
       (rewrite "empty_0")
       (rewrite "empty_0")
       (replaces -1)
       (replaces -2)
       (rewrite "seq_o_empty")
       (rewrite "seq_o_empty")
       (rewrite "seq_o_empty"))
      ("2"
       (decompose-equality 3)
       (("1" (grind))
        ("2"
         (decompose-equality 1)
         (expand "sigma_rhs")
         (lift-if)
         (expand "finseq_appl")
         (prop)
         (("1" (hide 1) (grind)) ("2" (grind))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality 1)
   (("1"
     (expand rest 1 2)
     (expand subtermsOF 1 1)
     (lift-if)
     (prop)
     (("1" (expand* rest ^ min empty_seq) (expand subtermsOF) (assert))
      ("2"
       (expand* ^ min empty_seq finseq_appl)
       (lift-if)
       (assert)
       (prop)
       (("1" (expand* rest ^ min empty_seq subtermsOF) (assert))
        ("2" (expand* rest ^ min empty_seq subtermsOF) (assert))
        ("3" (expand* rest ^ min empty_seq subtermsOF) (assert))))))
    ("2"
     (decompose-equality)
     (expand* rest ^ min subtermsOF finseq_appl)
     (lift-if)
     (prop)
     (("1"
       (typepred x!1)
       (expand* rest ^ min subtermsOF finseq_appl)
       (expand empty_seq -1)
       (lift-if)
       (assert))
      ("2"
       (typepred x!1)
       (expand* rest ^ min subtermsOF finseq_appl)
       (expand empty_seq -1)
       (lift-if)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand* subset? member)
   (split)
   (("1"
     (skeep)
     (expand* reduction? parallel_reduction?)
     (skosimp -1)
     (inst 1 "(# length := 1, seq := (LAMBDA (n: below[1]): p!1) #)")
     (("1"
       (expand parallel_reduction_fix?)
       (inst 1 "(# length := 1, seq := (LAMBDA (n: below[1]): e!1) #) "
        "(# length := 1, seq := (LAMBDA (n: below[1]): sigma!1) #)")
       (("1" (prop) (("1" (hide -2) (grind)) ("2" (hide -1) (grind))))
        ("2" (hide -) (typepred e!1) (grind))))
      ("2" (hide -) (grind))))
    ("2"
     (skeep)
     (case "FORALL (t1,t2,(fsp: SPP(t1)), (fse: finseq[rewrite_rule] | member(fse, E)), fss):
                                                                 (fsp`length = fse`length & fsp`length = fss`length &
                                                                  subtermsOF(t1, fsp) = sigma_lhs(fss, fse) &
                                                                  t2 = replace_par_pos(t1, fsp, sigma_rhs(fss, fse)))
                                                                           => RTC(reduction?(E))(t1, t2)")
     (("1"
       (expand* parallel_reduction? finseq_appl)
       (skosimp -2)
       (expand parallel_reduction_fix?)
       (skosimp)
       (inst -1 "x`1" "x`2" fsp!1 fse!1 fss!1)
       (assert))
      ("2"
       (hide -1 2)
       (measure-induct "fss`length" fss)
       (("1"
         (skeep)
         (skosimp)
         (case "x!1`length=0")
         (("1"
           (hide -2)
           (expand replace_par_pos)
           (assert)
           (expand* RTC IUnion)
           (inst 1 0)
           (expand iterate)
           (assert))
          ("2"
           (inst -1 "rest(x!1)")
           (rewrite length_rest)
           (expand replace_par_pos -5)
           (assert)
           (expand finseq_appl)
           (rewrite sigma_rhs_rest)
           (expand sigma_rhs -5 1)
           (expand finseq_appl)
           (inst -1
            "replaceTerm(t1!1,ext(x!1`seq(0))(rhs(fse!1`seq(0))),fsp!1`seq(0))"
            t2!1 "rest(fsp!1)" "rest(fse!1)")
           (("1"
             (assert)
             (prop)
             (("1"
               (case "reduction?(E)(t1!1, replaceTerm(t1!1, ext(x!1`seq(0))(rhs(fse!1`seq(0))),fsp!1`seq(0)))")
               (("1"
                 (typepred "RTC(reduction?(E))")
                 (expand reflexive_transitive?)
                 (flatten)
                 (expand transitive?)
                 (lemma R_subset_RTC)
                 (inst -1 "reduction?(E)")
                 (expand* subset? member)
                 (inst -1
                  "(t1!1,
                                   replaceTerm(t1!1, ext(x!1`seq(0))(rhs(fse!1`seq(0))),
                                               fsp!1`seq(0)))")
                 (assert)
                 (inst -3 t1!1
                  "replaceTerm(t1!1, ext(x!1`seq(0))(rhs(fse!1`seq(0))),fsp!1`seq(0))"
                  t2!1)
                 (assert))
                ("2"
                 (expand reduction? 1)
                 (inst 1 "fse!1`seq(0)" "x!1`seq(0)" "fsp!1`seq(0)")
                 (("1"
                   (expand* subtermsOF finseq_appl)
                   (expand* sigma_lhs finseq_appl)
                   (decompose-equality -4)
                   (("1" (inst -1 0))
                    ("2"
                     (typepred fsp!1)
                     (hide-all-but (-1 1))
                     (expand* SPP? SP? finseq_appl)
                     (flatten)
                     (inst -2 x!2))))
                  ("2"
                   (typepred fse!1)
                   (expand member -1)
                   (inst -1 0))))))
              ("2" (hide -2 -3 -4 3) (grind))
              ("3" (hide -1 -3 -4 3) (grind))
              ("4"
               (expand* subtermsOF sigma_lhs finseq_appl)
               (lift-if)
               (prop)
               (("1"
                 (expand empty_seq)
                 (split)
                 (("1" (hide-all-but (-1 -3 1)) (grind))
                  ("2"
                   (decompose-equality)
                   (("1"
                     (typepred x!2)
                     (hide-all-but (-1 -2 -4))
                     (grind))
                    ("2" (skosimp) (hide-all-but (-1 -2 -4)) (grind))
                    ("3"
                     (skeep)
                     (typepred i)
                     (hide-all-but (-1 -2 -4))
                     (grind))))))
                ("2"
                 (decompose-equality 2)
                 (("1" (hide-all-but (-2 1)) (grind))
                  ("2"
                   (decompose-equality)
                   (("1"
                     (decompose-equality -3)
                     (("1"
                       (expand rest (1 2))
                       (expand* ^ min)
                       (expand empty_seq 2)
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (prop)
                       (("1" (assert)) ("2" (assert))
                        ("3"
                         (inst -1 1+x!2)
                         (typepred fsp!1)
                         (expand* SPP? SP? PP? finseq_appl)
                         (flatten)
                         (assert)
                         (rewrite replace_persistence)
                         (("1" (inst -2 0)) ("2" (inst -2 1+x!2))
                          ("3" (inst -1 0 1+x!2) (assert))))))
                      ("2"
                       (typepred fsp!1)
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -2 x!3))))
                    ("2" (skosimp) (hide-all-but (-2 1)) (grind))
                    ("3"
                     (skeep)
                     (hide-all-but (-2 1))
                     (typepred i)
                     (grind))
                    ("4"
                     (skeep)
                     (typepred i)
                     (expand rest (-1 1))
                     (expand* ^ min)
                     (expand empty_seq -1)
                     (lift-if)
                     (assert)
                     (prop)
                     (typepred fsp!1)
                     (expand* SPP? SP? PP? finseq_appl)
                     (flatten)
                     (assert)
                     (rewrite replace_preserv_parallel_pos)
                     (("1" (inst -2 1+i)) ("2" (inst -2 0))
                      ("3" (inst -1 0 1+i) (assert))))))
                  ("3" (hide-all-but (-2 1)) (skosimp) (grind))
                  ("4"
                   (hide-all-but (-1 -2 1))
                   (skeep)
                   (typepred i)
                   (grind))
                  ("5"
                   (hide-all-but (-1 -2 1 2))
                   (skeep)
                   (typepred i)
                   (expand* rest ^ min)
                   (expand empty_seq (-1 2))
                   (lift-if)
                   (assert)
                   (prop)
                   (typepred fsp!1)
                   (expand* SPP? SP? PP? finseq_appl)
                   (assert)
                   (flatten)
                   (rewrite replace_preserv_parallel_pos)
                   (("1" (inst -2 1+i)) ("2" (inst -2 0))
                    ("3" (inst -1 0 1+i) (assert))))))))))
            ("2"
             (hide-all-but 1)
             (typepred fse!1)
             (expand* rest ^ min empty_seq)
             (lift-if)
             (assert)
             (prop)
             (("1" (expand member 1) (skeep))
              ("2" (expand member 1) (skeep))
              ("3" (expand member) (skeep 3) (inst -1 "1+i"))))))))
        ("2"
         (skeep)
         (expand sigma_rhs 1)
         (expand empty_seq)
         (lift-if)
         (assert))
        ("3" (skeep) (assert)) ("4" (skeep) (assert))
        ("5" (skeep) (typepred fsp) (expand SPP?) (flatten))))
      ("3" (skeep) (expand* sigma_rhs empty_seq) (lift-if) (assert))
      ("4" (skeep) (assert)) ("5" (skeep) (assert))
      ("6" (skeep) (typepred fsp) (expand SPP?) (flatten))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skosimp)
   (decompose-equality)
   (iff)
   (lemma parallel_reduction_inclusion)
   (inst -1 E!1)
   (split)
   (("1"
     (flatten)
     (hide -3)
     (expand RTC -1)
     (expand* IUnion member)
     (case "FORALL (t1, t2: term, i: nat): iterate(reduction?(E!1), i)(t1, t2) => RTC(parallel_reduction?(E!1))(t1, t2)")
     (("1" (skosimp) (inst -1 x!1 x!2 i!1) (assert))
      ("2"
       (hide -1 2)
       (induct i)
       (("1"
         (skeep)
         (expand* RTC IUnion member)
         (inst 1 0)
         (expand iterate)
         (propax))
        ("2"
         (skeep)
         (skeep)
         (lemma iterate_add_one)
         (inst -1 "reduction?(E!1)" j)
         (replaces -1)
         (expand o)
         (skosimp)
         (inst -1 y!1 t2)
         (assert)
         (expand* subset? member)
         (inst -4 "(t1, y!1)")
         (lemma RC_o_RTC_is_RTC)
         (inst -1 "parallel_reduction?(E!1)" t1 y!1 t2)
         (expand* RC union member)
         (assert))))))
    ("2"
     (flatten)
     (hide -2)
     (expand RTC -1)
     (expand* IUnion member)
     (case "FORALL (t1, t2: term, i: nat): iterate(parallel_reduction?(E!1), i)(t1, t2) => RTC(reduction?(E!1))(t1, t2)")
     (("1" (skosimp) (inst -1 x!1 x!2 i!1) (assert))
      ("2"
       (hide -1 2)
       (induct i)
       (("1"
         (skeep)
         (expand* RTC IUnion member)
         (inst 1 0)
         (expand iterate)
         (propax))
        ("2"
         (skeep)
         (skeep)
         (lemma iterate_add_one)
         (inst -1 "parallel_reduction?(E!1)" j)
         (replaces -1)
         (expand o)
         (skosimp)
         (inst -1 y!1 t2)
         (assert)
         (expand* subset? member)
         (inst -4 "(t1, y!1)")
         (assert)
         (lemma RTC_o_RTC_is_RTC)
         (inst -1 "reduction?(E!1)" t1 y!1 t2)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (("1"
     (skeep)
     (skeep)
     (case "x`length = 0")
     (("1"
       (hide -2)
       (expand replace_par_pos 1)
       (assert)
       (expand* SPP? SP?)
       (flatten)
       (inst -3 0)
       (("1"
         (expand finseq_appl)
         (expand add_first -3)
         (expand insert?)
         (propax))
        ("2" (hide-all-but 1) (expand* add_first insert?) (assert))))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 "rest(fst)" "p" "replaceTerm(t, fst`seq(0), x`seq(0))")
       (("1"
         (prop)
         (("1" (expand replace_par_pos 2) (expand finseq_appl) (prop))
          ("2"
           (expand SPP?)
           (flatten)
           (rewrite add_first_parallel_pos_to_PP_is_PP)
           (("1"
             (rewrite add_first_parallel_pos_to_SP_is_SP)
             (("1"
               (rewrite replace_preserv_parallel_pos)
               (("1"
                 (expand SP? -2)
                 (inst -2 0)
                 (("1"
                   (hide-all-but (-2 1))
                   (expand* finseq_appl add_first insert?))
                  ("2"
                   (hide-all-but 1)
                   (expand* add_first insert?)
                   (assert))))
                ("2"
                 (hide-all-but (-2 1 4))
                 (expand* SP? add_first insert? finseq_appl)
                 (inst -1 1)
                 (("1" (assert))
                  ("2" (expand* add_first insert?) (assert))))
                ("3"
                 (hide -3 -4 2 3 5)
                 (expand PP? -1)
                 (prop)
                 (("1" (hide -2) (expand* add_first insert?) (assert))
                  ("2"
                   (inst -1 1 0)
                   (("1"
                     (assert)
                     (hide -2)
                     (expand* add_first insert? finseq_appl))
                    ("2"
                     (hide-all-but 1)
                     (expand* add_first insert?)
                     (assert))
                    ("3"
                     (hide-all-but 1)
                     (expand* add_first insert?)
                     (assert))))))))
              ("2"
               (hide -3 -4 2 4)
               (expand* SP? finseq_appl)
               (case "rest(x)`length=0")
               (("1" (hide -2 -3 2) (grind))
                ("2"
                 (skeep 2)
                 (rewrite replace_preserv_parallel_pos)
                 (("1"
                   (hide -1 3)
                   (inst -1 "i+2")
                   (("1"
                     (expand* add_first insert? finseq_appl rest ^ min)
                     (lift-if)
                     (prop)
                     (("1" (expand empty_seq 1) (propax))
                      ("2" (expand empty_seq 1) (propax))
                      ("3" (expand empty_seq 1) (propax))
                      ("4" (expand empty_seq 1) (propax))))
                    ("2"
                     (hide 2)
                     (typepred i)
                     (expand* add_first insert?)
                     (lemma length_rest[position])
                     (inst -1 x)
                     (assert))))
                  ("2"
                   (hide -1 3)
                   (inst -1 1)
                   (("1" (expand* add_first insert? finseq_appl))
                    ("2"
                     (hide-all-but 1)
                     (expand* add_first insert?)
                     (assert))))
                  ("3"
                   (hide -2 3)
                   (expand* PP? finseq_appl)
                   (prop)
                   (("1" (expand* add_first insert?) (assert))
                    ("2"
                     (inst -1 1 "i+2")
                     (("1"
                       (assert)
                       (expand* add_first insert? finseq_appl rest ^ min)
                       (expand empty_seq 3)
                       (lift-if)
                       (prop))
                      ("2"
                       (hide 2 3)
                       (expand* add_first insert?)
                       (typepred i)
                       (expand* rest ^ min empty_seq)
                       (lift-if)
                       (assert))
                      ("3"
                       (hide-all-but 1)
                       (expand* add_first insert?)
                       (assert))))))))))))
            ("2"
             (hide -2 -3 -4 2 4)
             (case "rest(x)`length=0")
             (("1" (hide -2 2) (grind))
              ("2"
               (skeep 2)
               (expand* PP? finseq_appl)
               (prop)
               (("1" (expand* add_first insert?) (assert))
                ("2"
                 (inst -1 "i+2" 0)
                 (("1"
                   (assert)
                   (hide 1)
                   (expand* add_first insert? finseq_appl rest ^ min)
                   (expand empty_seq 1)
                   (lift-if)
                   (prop))
                  ("2"
                   (hide-all-but 1)
                   (expand* add_first insert?)
                   (assert))
                  ("3"
                   (hide 2 4)
                   (typepred i)
                   (expand* add_first insert? rest ^ min empty_seq)
                   (lift-if)
                   (assert))))))))
            ("3"
             (rewrite rest_of_PP_is_PP)
             (case "rest(add_first(p,x))=x")
             (("1" (replace -1 1 rl) (rewrite rest_of_PP_is_PP))
              ("2" (rewrite rest_add_first))))))
          ("3"
           (hide-all-but (-2 1))
           (expand* rest ^ min empty_seq)
           (lift-if)
           (lift-if)
           (assert)
           (prop)
           (("1" (assert)) ("2" (assert))))))
        ("2"
         (expand SPP? -1)
         (flatten)
         (hide-all-but (-2 1 2))
         (expand* SP? finseq_appl)
         (inst -1 1)
         (("1" (expand* add_first insert? finseq_appl))
          ("2" (hide 2) (expand* add_first insert?) (assert))))
        ("3" (assert)) ("4" (assert))))))
    ("2"
     (skeep)
     (hide 2)
     (case "fsp=rest(add_first(p,fsp))")
     (("1"
       (replace -1 1)
       (expand SPP?)
       (rewrite rest_of_PP_is_PP)
       (rewrite rest_of_SP_is_SP))
      ("2" (rewrite rest_add_first))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (skeep)
   (skeep)
   (skeep)
   (expand finseq_appl)
   (case "x`length = 0")
   (("1" (hide -2) (expand replace_par_pos 1) (assert))
    ("2"
     (case "x`length = 1")
     (("1"
       (lemma "length_rest_0[position]")
       (inst?)
       (assert)
       (expand replace_par_pos 2)
       (expand replace_par_pos 2)
       (expand finseq_appl)
       (hide -3)
       (typepred "i")
       (replace -3 -1)
       (case-replace "i=0")
       (("1"
         (expand "SPP?")
         (flatten)
         (expand "SP?")
         (inst -6 "0")
         (expand finseq_appl)
         (rewrite "replace_preserv_pos"))
        ("2" (assert))))
      ("2"
       (expand replace_par_pos 3)
       (assert)
       (expand finseq_appl)
       (case-replace "i=0")
       (("1"
         (lemma "replace_par_pos_preservs_pos")
         (inst -1 "rest(x)" "rest(fst)" "x`seq(0)"
          "replaceTerm(t, fst`seq(0), x`seq(0))")
         (assert)
         (hide (-2 4))
         (lemma "seq_first_rest[position]")
         (inst?)
         (assert)
         (expand "first")
         (expand "finseq_appl")
         (replace -1 1 rl)
         (hide -1)
         (expand "SPP?")
         (prop)
         (("1"
           (expand "SP?")
           (skosimp*)
           (expand "finseq_appl")
           (case-replace "i!1 = 0")
           (("1" (inst -4 "i!1") (rewrite "replace_preserv_pos"))
            ("2"
             (copy -3)
             (inst -1 "0")
             (inst -4 "i!1")
             (expand "PP?")
             (inst -3 "0" "i!1")
             (assert)
             (expand "finseq_appl")
             (rewrite "replace_preserv_parallel_pos"))))
          ("2" (hide-all-but (-4 1)) (grind))))
        ("2"
         (case "rest(x)`length = 0")
         (("1"
           (hide-all-but (-1 2 3))
           (lemma "length_rest_0[position]")
           (inst?)
           (assert))
          ("2"
           (inst -1 "rest(x)")
           (prop)
           (("1"
             (inst -1 "rest(fst)" "replaceTerm(t, fst`seq(0), x`seq(0))")
             (prop)
             (("1"
               (inst -1 "i - 1")
               (("1"
                 (lemma "rest_pos[position]")
                 (inst?)
                 (assert)
                 (inst -1 "i-1")
                 (expand finseq_appl)
                 (replaces -1))
                ("2" (hide-all-but (1 3)) (grind))))
              ("2"
               (hide 6)
               (expand "SPP?")
               (prop)
               (("1" (rewrite "rest_of_PP_is_PP"))
                ("2"
                 (expand "SP?")
                 (expand* "SP?" "finseq_appl")
                 (skosimp*)
                 (copy -2)
                 (inst -1 "0")
                 (inst -3 "i!1 + 1")
                 (("1"
                   (expand* "PP?" "finseq_appl")
                   (inst -2 "0" "i!1 + 1")
                   (assert)
                   (lemma "rest_pos[position]")
                   (inst?)
                   (assert)
                   (inst -1 "i!1")
                   (("1"
                     (expand "finseq_appl")
                     (replaces -1)
                     (rewrite "replace_preserv_parallel_pos"))
                    ("2" (hide-all-but 1) (typepred "i!1") (grind))))
                  ("2" (hide-all-but 1) (typepred "i!1") (grind))))))
              ("3" (hide-all-but (-2 -3 1)) (grind))))
            ("2" (hide-all-but (-2 -3 1)) (grind))))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (("1"
     (skeep)
     (skeep)
     (skeep)
     (expand "finseq_appl")
     (case "length(x) = 0")
     (("1"
       (hide -2)
       (expand "replace_par_pos")
       (assert)
       (expand* "SPP?" "SP?" "finseq_appl")
       (flatten)
       (inst -3 "x`length + i")
       (("1" (expand "o") (propax))
        ("2" (hide-all-but 1) (typepred "i") (grind))))
      ("2"
       (expand "replace_par_pos" 2)
       (assert)
       (expand "finseq_appl")
       (case "x`length = 1")
       (("1"
         (lemma "length_rest_0[position]")
         (inst?)
         (assert)
         (hide -3)
         (expand replace_par_pos 2)
         (expand* "SPP?" "PP?" "SP?" "finseq_appl")
         (prop)
         (("1" (grind))
          ("2"
           (inst -1 "0" "i + x`length")
           (("1"
             (assert)
             (copy -4)
             (inst -1 "0")
             (inst -5 "i + x`length")
             (("1"
               (hide 1)
               (expand "o")
               (rewrite "replace_preserv_parallel_pos"))
              ("2" (hide-all-but 1) (typepred "i") (grind))))
            ("2" (hide-all-but 1) (typepred "i") (grind))
            ("3" (hide-all-but 1) (grind))))))
        ("2"
         (inst -1 "rest(x)")
         (prop)
         (("1"
           (inst -1 "fsq" "rest(fst)"
            "replaceTerm(t, fst`seq(0), x`seq(0))")
           (prop)
           (("1" (inst -1 "i"))
            ("2"
             (hide 4)
             (expand "SPP?")
             (flatten)
             (lemma "rest_of_PP_is_PP")
             (inst -1 "x o fsq")
             (lemma "rest_of_SP_is_SP")
             (inst -1 "t" "x o fsq")
             (prop)
             (("1"
               (hide (-1 -3 -4))
               (lemma "rest_compo[position]")
               (inst?)
               (assert))
              ("2"
               (expand* "PP?" "SP?" "finseq_appl")
               (prop)
               (("1" (grind))
                ("2"
                 (skosimp*)
                 (case "i!1 < x`length")
                 (("1"
                   (case "fsq`length = 0")
                   (("1"
                     (rewrite "empty_0")
                     (lemma "seq_o_empty[position]")
                     (inst -1 "rest(x)")
                     (replace -2)
                     (lemma "rest_compo[position]")
                     (inst?)
                     (assert)
                     (replaces -1)
                     (replaces -1)
                     (lemma "seq_o_empty[position]")
                     (inst -1 "x")
                     (replaces -1)
                     (inst -3 "0" "i!1 + 1")
                     (assert)
                     (inst -5 "i!1")
                     (inst -6 "0")
                     (case "i!1 = x`length -1")
                     (("1" (grind))
                      ("2"
                       (lemma "rest_pos[position]")
                       (inst -1 "x")
                       (assert)
                       (inst -1 "i!1")
                       (expand "finseq_appl")
                       (replaces -1)
                       (rewrite "replace_preserv_parallel_pos"))))
                    ("2"
                     (inst -4 "i!1")
                     (("1"
                       (lemma "rest_compo[position]")
                       (inst?)
                       (assert)
                       (replaces -1)
                       (inst -2 "0" "i!1 + 1")
                       (assert)
                       (lemma "rest_pos[position]")
                       (inst -1 "x o fsq")
                       (assert)
                       (inst -1 "i!1")
                       (expand "finseq_appl")
                       (replaces -1)
                       (lemma "rest_compo[position]")
                       (inst?)
                       (reveal -5)
                       (replaces -1)
                       (expand "o" -2 1)
                       (inst -5 "0")
                       (expand "o" -5)
                       (rewrite "replace_preserv_parallel_pos"))
                      ("2"
                       (hide-all-but (-1 1 2 5 6))
                       (expand "o")
                       (expand "rest")
                       (expand "^")
                       (expand "min")
                       (assert))))))
                  ("2"
                   (inst -1 "0" "i!1 + 1")
                   (("1"
                     (assert)
                     (expand "o" -1 1)
                     (lemma "rest_pos[position]")
                     (inst -1 "x o fsq")
                     (prop)
                     (("1"
                       (inst -1 "i!1")
                       (("1"
                         (expand "finseq_appl")
                         (lemma "rest_compo[position]")
                         (inst?)
                         (assert))
                        ("2" (grind))))
                      ("2" (grind))))
                    ("2" (grind)) ("3" (grind))))))
                ("3" (grind))
                ("4"
                 (skosimp*)
                 (inst -1 "0" "i!1 + 1")
                 (("1"
                   (assert)
                   (inst -3 "i!1")
                   (("1"
                     (inst -4 "0")
                     (hide -2)
                     (expand "o" -1 1)
                     (expand "o" -3)
                     (lemma "rest_pos[position]")
                     (inst?)
                     (assert)
                     (inst -1 "i!1")
                     (("1"
                       (expand "finseq_appl")
                       (lemma "rest_compo[position]")
                       (inst?)
                       (assert)
                       (replaces -1)
                       (replaces -1)
                       (rewrite "replace_preserv_parallel_pos"))
                      ("2" (hide-all-but 1) (typepred "i!1") (grind))))
                    ("2" (hide-all-but 1) (typepred "i!1") (grind))))
                  ("2" (hide-all-but 1) (typepred "i!1") (grind))
                  ("3" (assert))))))))
            ("3" (hide (-1 4)) (grind))))
          ("2" (hide (-1 4)) (grind))))))))
    ("2"
     (hide 2)
     (skeep)
     (skeep)
     (expand* "SPP?" "SP?" "PP?" "finseq_appl")
     (prop)
     (("1" (hide-all-but (-1 1)) (grind))
      ("2"
       (skosimp*)
       (inst -2 "i!1 + fsp`length")
       (("1" (expand "o") (assert)) ("2" (grind))))
      ("3"
       (skosimp*)
       (inst -1 "i!1" "j!1")
       (("1" (assert) (expand "o") (propax)) ("2" (grind))
        ("3" (grind))))
      ("4"
       (skosimp*)
       (inst -2 "i!1")
       (("1" (expand "o" -2) (propax)) ("2" (grind))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand finseq_appl)
   (measure-induct "fsp`length" "fsp")
   (("1"
     (skeep)
     (skeep)
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 "rest(fst)" "replaceTerm(s,fst`seq(0),x`seq(0))")
     (case "rest(x)`length=0")
     (("1" (expand replace_par_pos 2) (lift-if) (prop))
      ("2"
       (prop)
       (("1"
         (expand replace_par_pos 3 1)
         (lift-if)
         (prop)
         (expand replace_par_pos 2 2)
         (expand finseq_appl)
         (lift-if)
         (prop)
         (replaces -1)
         (reveal (-2 -3))
         (inst -1 "rest(fst)" "replaceTerm(s, fst`seq(0), x`seq(0))")
         (inst -2 "delete(x, 1)")
         (("1"
           (prop)
           (("1"
             (inst -1 "delete(fst,1)"
              "replaceTerm(s,rest(fst)`seq(0),rest(x)`seq(0))")
             (("1"
               (prop)
               (("1"
                 (replace -2 2 rl)
                 (hide -2 1 4)
                 (name-replace "REPL_REST"
                  "replaceTerm(s,rest(fst)`seq(0),rest(x)`seq(0))")
                 (lemma delete_rest[position])
                 (copy -1)
                 (inst -2 x 1)
                 (assert)
                 (replace -2 -3 rl)
                 (inst -1 "rest(x)" 0)
                 (replaces -1)
                 (hide -1)
                 (lemma delete_rest[term])
                 (copy -1)
                 (inst -2 fst 1)
                 (assert)
                 (replace -2 -3 rl)
                 (inst -1 "rest(fst)" 0)
                 (replaces -1)
                 (hide -1)
                 (expand delete -1)
                 (expand finseq_appl)
                 (replace -1 1 rl)
                 (hide -1)
                 (expand REPL_REST)
                 (expand SPP?)
                 (flatten)
                 (rewrite replace_commutativity)
                 (("1"
                   (hide-all-but (-2 1))
                   (expand SP?)
                   (inst -1 0)
                   (expand finseq_appl)
                   (propax))
                  ("2"
                   (hide-all-but (-2 1 3 4))
                   (lemma rest_pos[position])
                   (inst -1 x)
                   (assert)
                   (inst -1 0)
                   (("1"
                     (expand finseq_appl)
                     (replace -1 1 rl)
                     (expand SP? -2)
                     (inst -2 1)
                     (expand finseq_appl)
                     (propax))
                    ("2"
                     (expand rest 3)
                     (expand* ^ min empty_seq)
                     (lift-if)
                     (prop)
                     (assert))))
                  ("3"
                   (hide -2 -3 -4 2)
                   (lemma rest_pos[position])
                   (inst -1 x)
                   (assert)
                   (inst -1 0)
                   (("1"
                     (expand PP?)
                     (prop)
                     (("1"
                       (hide-all-but (-1 2))
                       (expand* rest ^ min empty_seq)
                       (lift-if)
                       (prop)
                       (assert))
                      ("2"
                       (inst -1 0 1)
                       (("1" (assert) (expand finseq_appl) (assert))
                        ("2" (assert))))))
                    ("2"
                     (hide-all-but (1 3))
                     (expand* rest ^ min empty_seq)
                     (lift-if)
                     (prop)
                     (assert))))))
                ("2"
                 (hide-all-but (-2 1 2 6))
                 (expand SPP?)
                 (flatten)
                 (split)
                 (("1" (hide -2) (rewrite delete_of_PP_is_PP))
                  ("2"
                   (rewrite delete_of_SP_is_SP)
                   (hide -1 2)
                   (expand SP?)
                   (expand finseq_appl)
                   (skeep)
                   (inst -1 i)
                   (rewrite replace_preserv_parallel_pos)
                   (("1"
                     (hide -1 2)
                     (lemma rest_pos[position])
                     (inst -1 x)
                     (assert)
                     (inst -1 0)
                     (("1"
                       (reveal -4)
                       (inst -1 1)
                       (("1" (expand finseq_appl) (assert))
                        ("2"
                         (hide -1 2 4)
                         (expand* rest ^ min empty_seq)
                         (lift-if)
                         (prop)
                         (assert))))
                      ("2"
                       (hide 2 4)
                       (expand* rest ^ min empty_seq)
                       (lift-if)
                       (prop)
                       (assert))))
                    ("2"
                     (hide -1 2)
                     (lemma rest_pos[position])
                     (inst -1 x)
                     (assert)
                     (inst -1 0)
                     (("1"
                       (reveal -5)
                       (expand PP?)
                       (prop)
                       (("1"
                         (hide -2 1 3)
                         (expand* rest ^ min empty_seq)
                         (lift-if)
                         (prop)
                         (assert))
                        ("2"
                         (expand finseq_appl)
                         (inst -1 1 i)
                         (prop)
                         (("1" (assert))
                          ("2"
                           (typepred i)
                           (reveal 1)
                           (replace -2 1 rl)
                           (replace -3)
                           (rewrite replace_preserv_pos))))))
                      ("2"
                       (hide 2 4)
                       (expand* rest ^ min empty_seq)
                       (lift-if)
                       (prop)
                       (assert))))))))
                ("3"
                 (hide-all-but (-1 1))
                 (expand* delete rest ^ min empty_seq)
                 (lift-if)
                 (prop))
                ("4"
                 (hide-all-but (-3 1))
                 (expand delete)
                 (lift-if)
                 (lift-if)
                 (prop)
                 (("1" (assert)) ("2" (assert))))))
              ("2"
               (hide-all-but (-3 1 2))
               (expand* rest ^ min empty_seq)
               (lift-if)
               (prop)
               (assert))))
            ("2"
             (hide-all-but (1 5))
             (expand delete)
             (lift-if)
             (prop)
             (("1"
               (hide 1)
               (expand* rest ^ min empty_seq)
               (lift-if)
               (prop))
              ("2"
               (expand* rest ^ min empty_seq)
               (lift-if)
               (prop)
               (assert))))
            ("3"
             (hide -1 -3 3 4)
             (expand SPP?)
             (flatten)
             (rewrite rest_of_PP_is_PP)
             (expand SP?)
             (skeep)
             (inst -2 "i+1")
             (("1"
               (lemma rest_pos[position])
               (inst -1 x)
               (assert)
               (inst -1 i)
               (("1"
                 (expand finseq_appl)
                 (rewrite replace_preserv_parallel_pos)
                 (("1"
                   (reveal -3)
                   (inst -1 0)
                   (expand finseq_appl)
                   (propax))
                  ("2"
                   (expand PP?)
                   (prop)
                   (("1"
                     (hide-all-but (-1 3))
                     (expand* rest ^ min empty_seq)
                     (lift-if)
                     (prop)
                     (assert))
                    ("2"
                     (expand finseq_appl)
                     (inst -1 0 "i+1")
                     (("1" (assert))
                      ("2"
                       (hide-all-but 1)
                       (typepred i)
                       (expand* rest ^ min empty_seq)
                       (lift-if)
                       (prop)
                       (("1" (assert)) ("2" (assert))
                        ("3" (assert))))))))))
                ("2"
                 (hide-all-but 1)
                 (typepred i)
                 (expand* rest ^ min empty_seq)
                 (lift-if)
                 (prop)
                 (("1" (assert)) ("2" (assert))))))
              ("2"
               (hide-all-but 1)
               (typepred i)
               (expand* rest ^ min empty_seq)
               (lift-if)
               (prop)
               (("1" (assert)) ("2" (assert)) ("3" (assert))
                ("4" (assert))))))
            ("4"
             (hide-all-but (1 6))
             (expand delete)
             (lift-if)
             (prop)
             (("1" (expand* rest ^ min empty_seq) (lift-if) (prop))
              ("2" (assert))))
            ("5"
             (hide-all-but (-3 1))
             (expand* rest ^ min empty_seq)
             (lift-if)
             (lift-if)
             (prop)
             (("1" (assert)) ("2" (assert)) ("3" (assert))
              ("4" (assert))))
            ("6"
             (hide-all-but (1 6))
             (expand delete)
             (lift-if)
             (prop)
             (("1" (expand* rest ^ min empty_seq) (lift-if) (prop))
              ("2" (assert))))))
          ("2"
           (hide-all-but (1 2))
           (expand* rest ^ min empty_seq)
           (lift-if)
           (prop)
           (assert))))
        ("2"
         (expand SPP?)
         (flatten)
         (rewrite rest_of_PP_is_PP)
         (expand SP?)
         (skeep)
         (rewrite replace_preserv_parallel_pos)
         (("1"
           (lemma rest_pos[position])
           (inst -1 x)
           (assert)
           (inst -1 i)
           (("1"
             (inst -3 "i+1")
             (("1" (assert))
              ("2"
               (hide-all-but 1)
               (typepred i)
               (expand* rest ^ min empty_seq)
               (lift-if)
               (prop)
               (("1" (assert)) ("2" (assert)) ("3" (assert))))))
            ("2"
             (hide-all-but 1)
             (typepred i)
             (expand* rest ^ min empty_seq)
             (lift-if)
             (prop)
             (("1" (assert)) ("2" (assert))))))
          ("2" (inst -2 0) (expand finseq_appl) (propax))
          ("3"
           (lemma rest_pos[position])
           (inst -1 x)
           (assert)
           (inst -1 i)
           (("1"
             (expand PP?)
             (prop)
             (("1"
               (hide-all-but (-1 3))
               (expand* rest ^ min empty_seq)
               (lift-if)
               (prop)
               (assert))
              ("2"
               (inst -1 0 "i+1")
               (("1"
                 (assert)
                 (expand finseq_appl)
                 (replace -2 2 rl)
                 (propax))
                ("2"
                 (hide-all-but 1)
                 (typepred i)
                 (expand* rest ^ min empty_seq)
                 (lift-if)
                 (assert))))))
            ("2"
             (hide-all-but 1)
             (typepred i)
             (expand* rest ^ min empty_seq)
             (lift-if)
             (assert))))))
        ("3"
         (hide-all-but (-2 1))
         (expand* rest ^ min empty_seq)
         (lift-if)
         (lift-if)
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert))))))))
    ("2"
     (hide 2)
     (skeep)
     (rewrite replace_par_pos_preservs_pos)
     (("1"
       (hide -2 -3 3)
       (lemma seq_first_rest[position])
       (inst -1 fsp)
       (assert)
       (expand* first finseq_appl)
       (assert))
      ("2"
       (hide-all-but (-2 1))
       (expand* rest ^ min empty_seq)
       (lift-if)
       (lift-if)
       (assert)
       (prop)
       (("1" (assert)) ("2" (assert))))))
    ("3"
     (hide 2)
     (skeep)
     (expand SPP?)
     (rewrite rest_of_PP_is_PP)
     (rewrite rest_of_SP_is_SP))
    ("4"
     (hide 2)
     (skeep)
     (hide-all-but (-2 2))
     (expand* rest ^ min empty_seq)
     (lift-if)
     (lift-if)
     (assert)
     (prop)
     (("1" (assert)) ("2" (assert))))
    ("5"
     (hide 2)
     (skeep)
     (case "rest(fsp)`length=0")
     (("1"
       (hide-all-but (-1 2))
       (expand* SPP? PP? SP? finseq_appl)
       (split)
       (("1" (propax)) ("2" (assert)) ("3" (grind))))
      ("2"
       (hide -2)
       (expand* SPP? SP? finseq_appl)
       (flatten)
       (rewrite rest_of_PP_is_PP)
       (skeep 3)
       (rewrite replace_preserv_parallel_pos)
       (("1"
         (hide -1 4)
         (inst -1 "i+1")
         (("1"
           (expand* rest ^ min)
           (expand empty_seq 2)
           (lift-if)
           (assert)
           (prop))
          ("2"
           (hide 2 3)
           (typepred i)
           (expand* rest ^ min empty_seq)
           (lift-if)
           (assert))))
        ("2" (inst -2 0))
        ("3"
         (hide -2 4)
         (expand* PP? finseq_appl)
         (prop)
         (("1"
           (hide 1 3)
           (expand* rest ^ min empty_seq)
           (lift-if)
           (assert))
          ("2"
           (inst -1 0 "i+1")
           (("1" (assert) (expand* rest ^ min))
            ("2"
             (hide 2 3 4)
             (typepred i)
             (expand* rest ^ min empty_seq)
             (lift-if)
             (assert))))))))))
    ("6"
     (hide 2)
     (skeep)
     (expand* SPP? SP?)
     (expand finseq_appl)
     (flatten)
     (inst -2 0))
    ("7" (hide 2) (skeep) (assert)) ("8" (hide 2) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (auto-rewrite finseq_appl)
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (assert)
     (expand replace_par_pos 2 2)
     (assert)
     (case n=0)
     (("1"
       (case "delete(x, n)=rest(x) & delete(fst, n)=rest(fst)")
       (("1" (flatten) (assert))
        ("2"
         (expand rest 1)
         (expand delete 1)
         (expand* ^ min empty_seq)
         (lift-if)
         (assert)
         (prop)
         (("1" (assert)) ("2" (decompose-equality))
          ("3" (lift-if) (assert) (decompose-equality) (skosimp))
          ("4" (hide-all-but (-1 1 2)) (assert))
          ("5" (decompose-equality))
          ("6" (lift-if) (assert) (decompose-equality) (skosimp))
          ("7"
           (decompose-equality)
           (("1" (skeep) (expand min) (propax))
            ("2" (skeep) (assert) (typepred x_1) (expand min) (assert))
            ("3" (expand min) (assert))))
          ("8"
           (decompose-equality)
           (("1" (skosimp) (expand min) (propax))
            ("2" (skosimp) (typepred x!1) (expand min) (assert))
            ("3" (expand min) (assert))))))))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 "rest(fst)" "n-1" "replaceTerm(s, fst`seq(0), x`seq(0))")
       (("1"
         (prop)
         (("1"
           (expand replace_par_pos 3 1)
           (expand delete 3 1)
           (assert)
           (rewrite replace_commutativity 3)
           (("1"
             (case "rest(x)`seq(n - 1)=x`seq(n) & rest(fst)`seq(n - 1)=fst`seq(n)")
             (("1"
               (case "fst`seq(0)=delete(fst, n)`seq(0) & x`seq(0)=delete(x, n)`seq(0)")
               (("1"
                 (case "delete(rest(x), n - 1)=rest(delete(x, n)) & delete(rest(fst), n - 1)=rest(delete(fst, n))")
                 (("1" (flatten) (assert))
                  ("2"
                   (hide (-1 -2 -3 -4 4))
                   (expand delete 1)
                   (expand rest 1)
                   (expand* ^ min)
                   (lift-if)
                   (prop)
                   (("1"
                     (assert)
                     (decompose-equality)
                     (("1" (expand empty_seq) (assert))
                      ("2"
                       (decompose-equality)
                       (("1"
                         (typepred x!1)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("2"
                         (skeep)
                         (typepred i)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("3"
                         (expand rest 1)
                         (expand* ^ min empty_seq)
                         (assert))))
                      ("3"
                       (expand empty_seq)
                       (skeep)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("4"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("5"
                       (expand rest 1)
                       (expand* ^ min empty_seq)
                       (assert))))
                    ("2"
                     (assert)
                     (decompose-equality)
                     (("1" (expand empty_seq) (assert))
                      ("2"
                       (decompose-equality)
                       (("1"
                         (typepred x!1)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("2"
                         (skeep)
                         (typepred i)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("3"
                         (expand rest 1)
                         (expand* ^ min empty_seq)
                         (assert))))
                      ("3"
                       (expand empty_seq)
                       (skosimp)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("4"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("5"
                       (expand rest 1)
                       (expand* ^ min empty_seq)
                       (assert))))
                    ("3"
                     (assert)
                     (decompose-equality)
                     (("1" (expand empty_seq) (assert))
                      ("2"
                       (decompose-equality)
                       (("1"
                         (typepred x!1)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("2"
                         (skeep)
                         (typepred i)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("3"
                         (expand rest 1)
                         (expand* ^ min empty_seq)
                         (assert))))
                      ("3"
                       (expand empty_seq)
                       (skosimp)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("4"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("5"
                       (expand rest 1)
                       (expand* ^ min empty_seq)
                       (assert))))
                    ("4"
                     (assert)
                     (decompose-equality)
                     (("1" (expand empty_seq) (assert))
                      ("2"
                       (decompose-equality)
                       (("1"
                         (typepred x!1)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("2"
                         (skeep)
                         (typepred i)
                         (expand rest -1)
                         (expand* ^ min empty_seq)
                         (assert))
                        ("3"
                         (expand rest 1)
                         (expand* ^ min empty_seq)
                         (assert))))
                      ("3"
                       (expand empty_seq)
                       (skosimp)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("4"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("5"
                       (expand rest 1)
                       (expand* ^ min empty_seq)
                       (assert))))
                    ("5"
                     (assert)
                     (decompose-equality)
                     (("1" (lift-if) (lift-if) (lift-if) (assert))
                      ("2"
                       (expand min)
                       (skeep)
                       (expand rest 1)
                       (expand* ^ min empty_seq))
                      ("3"
                       (skosimp)
                       (typepred x!1)
                       (expand min)
                       (assert))
                      ("4" (skosimp) (assert))
                      ("5" (expand min) (assert))
                      ("6"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("7"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("8"
                       (expand rest 1)
                       (expand* ^ min empty_seq)
                       (assert))))
                    ("6"
                     (assert)
                     (decompose-equality)
                     (("1" (lift-if) (lift-if) (lift-if) (assert))
                      ("2"
                       (expand min)
                       (skosimp)
                       (expand rest 1)
                       (expand* ^ min empty_seq))
                      ("3"
                       (skosimp)
                       (typepred x!1)
                       (expand min)
                       (assert))
                      ("4" (skosimp) (assert))
                      ("5" (expand min) (assert))
                      ("6"
                       (skeep)
                       (typepred i)
                       (expand rest -1)
                       (expand* ^ min empty_seq)
                       (assert))
                      ("7" (skeep) (assert))
                      ("8"
                       (expand rest 1)
                       (expand* ^ min empty_seq)
                       (assert))))))))
                ("2" (hide (-1 -2 -3 4)) (expand "delete") (assert))))
              ("2" (expand rest 1) (expand ^) (propax))))
            ("2" (expand* SPP? SP?) (flatten) (inst -3 n) (assert))
            ("3"
             (expand delete 1)
             (expand* SPP? SP?)
             (flatten)
             (inst -3 0))
            ("4"
             (expand delete 1)
             (expand* SPP? PP?)
             (flatten)
             (inst -2 n 0)
             (assert))))
          ("2"
           (expand SPP?)
           (flatten)
           (rewrite rest_of_PP_is_PP)
           (lemma rest_of_SP_is_SP)
           (inst -1 s x)
           (expand SP? (-1 1))
           (assert)
           (skeep)
           (inst -1 i)
           (rewrite replace_preserv_parallel_pos)
           (("1" (expand SP?) (inst -3 0) (assert))
            ("2"
             (expand PP?)
             (inst -2 0 1+i)
             (("1" (assert) (expand rest 1) (expand ^) (propax))
              ("2"
               (typepred i)
               (expand rest -1)
               (expand* ^ min empty_seq)
               (assert))))))
          ("3" (expand rest -1) (expand* ^ min empty_seq) (assert))
          ("4"
           (expand rest 1)
           (expand* ^ min empty_seq)
           (lift-if)
           (lift-if)
           (lift-if)
           (assert))
          ("5"
           (expand rest 1)
           (expand* ^ min empty_seq)
           (lift-if)
           (assert))))
        ("2" (assert))))))
    ("2" (assert) (hide 2) (skeep) (expand delete) (lift-if) (assert))
    ("3"
     (hide 2)
     (skeep)
     (expand SPP?)
     (flatten)
     (rewrite delete_of_PP_is_PP)
     (lemma delete_of_SP_is_SP)
     (inst -1 s fsp n)
     (expand SP?)
     (assert)
     (skeep 2)
     (rewrite replace_preserv_parallel_pos)
     (("1" (inst -1 i)) ("2" (inst -3 n))
      ("3"
       (expand PP?)
       (typepred i)
       (expand delete -1)
       (assert)
       (expand delete 1)
       (lift-if)
       (assert)
       (prop)
       (("1" (inst -4 n i) (assert)) ("2" (inst -3 n 1+i) (assert))))))
    ("4"
     (hide 2)
     (skeep)
     (expand* SPP? SP?)
     (flatten)
     (inst -2 n)
     (assert))
    ("5" (hide 2) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" "fsp")
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1"
       (hide -2)
       (expand* replace_par_pos finseq_appl)
       (lift-if)
       (assert))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (expand replace_par_pos 2)
       (lift-if)
       (assert)
       (lemma replace_par_pos_equivalence)
       (expand finseq_appl)
       (inst -1 x fst t)
       (assert)
       (prop)
       (("1"
         (replaces -1)
         (rewrite replace_persistence)
         (("1"
           (inst -1 "rest(fst)" "p" "t")
           (prop)
           (("1"
             (expand SPP?)
             (flatten)
             (case "rest(x)`length=0")
             (("1"
               (split)
               (("1"
                 (hide-all-but (-1 1))
                 (expand* PP? finseq_appl)
                 (prop)
                 (hide 2)
                 (expand* add_first insert? rest ^ min empty_seq)
                 (lift-if)
                 (assert))
                ("2"
                 (hide -2 -4 -5 3)
                 (expand* SP? finseq_appl)
                 (skeep)
                 (case "i=0")
                 (("1"
                   (replaces -1)
                   (inst -2 0)
                   (("1" (expand* add_first insert? finseq_appl))
                    ("2"
                     (hide-all-but 1)
                     (expand* add_first insert?)
                     (assert))))
                  ("2"
                   (hide-all-but (-1 1))
                   (typepred i)
                   (expand* add_first insert?)
                   (assert))))))
              ("2"
               (split)
               (("1"
                 (rewrite add_first_parallel_pos_to_PP_is_PP)
                 (("1"
                   (skeep)
                   (expand finseq_appl)
                   (hide -2 -3 -4 2 5)
                   (expand* PP? finseq_appl)
                   (prop)
                   (("1" (expand* add_first insert?) (assert))
                    ("2"
                     (inst -1 "i+2" 0)
                     (("1"
                       (assert)
                       (hide 1)
                       (expand* add_first insert? finseq_appl rest ^ min)
                       (expand empty_seq 2)
                       (lift-if)
                       (assert)
                       (prop))
                      ("2"
                       (hide-all-but 1)
                       (expand* add_first insert?)
                       (assert))
                      ("3"
                       (hide 2 3)
                       (typepred i)
                       (expand* add_first insert? rest ^ min empty_seq)
                       (lift-if)
                       (assert))))))
                  ("2"
                   (case "x=rest(add_first(p,x))")
                   (("1"
                     (rewrite rest_of_PP_is_PP)
                     (replace -1 1)
                     (rewrite rest_of_PP_is_PP))
                    ("2" (rewrite rest_add_first))))))
                ("2"
                 (rewrite add_first_parallel_pos_to_SP_is_SP)
                 (case "x=rest(add_first(p,x))")
                 (("1"
                   (rewrite rest_of_SP_is_SP)
                   (replace -1 1)
                   (rewrite rest_of_SP_is_SP))
                  ("2" (rewrite rest_add_first))))))))
            ("2"
             (hide-all-but (-2 1))
             (expand* rest ^ min empty_seq)
             (lift-if)
             (lift-if)
             (assert)
             (prop)
             (("1" (assert)) ("2" (assert))))))
          ("2"
           (hide -1 3)
           (rewrite replace_par_pos_preservs_pos)
           (("1"
             (expand SPP?)
             (flatten)
             (split)
             (("1"
               (rewrite add_first_parallel_pos_to_PP_is_PP)
               (("1"
                 (skeep)
                 (case "rest(x)`length=0")
                 (("1"
                   (expand PP? 2)
                   (prop)
                   (hide-all-but (-1 1))
                   (expand* add_first insert?)
                   (assert))
                  ("2"
                   (hide -2 -3 -4 3 4)
                   (expand* PP? finseq_appl)
                   (prop)
                   (("1" (hide 1 2) (expand* add_first insert?) (assert))
                    ("2"
                     (inst -1 "i+2" 1)
                     (("1"
                       (assert)
                       (hide 1)
                       (expand* add_first insert? finseq_appl rest ^ min)
                       (expand empty_seq 1)
                       (lift-if)
                       (assert)
                       (prop))
                      ("2"
                       (hide-all-but (1 5))
                       (expand* add_first insert?)
                       (assert))
                      ("3"
                       (hide 2 4)
                       (typepred i)
                       (expand* add_first insert? rest ^ min empty_seq)
                       (lift-if)
                       (assert))))))))
                ("2"
                 (rewrite rest_of_PP_is_PP)
                 (case "x=rest(add_first(p,x))")
                 (("1" (replace -1 1) (rewrite rest_of_PP_is_PP))
                  ("2" (rewrite rest_add_first))))))
              ("2"
               (rewrite add_first_parallel_pos_to_SP_is_SP)
               (("1"
                 (hide-all-but (-2 1 4))
                 (expand* SP? finseq_appl)
                 (inst -1 1)
                 (("1" (expand* add_first insert? finseq_appl))
                  ("2" (expand* add_first insert?) (assert))))
                ("2"
                 (rewrite rest_of_SP_is_SP)
                 (case "x=rest(add_first(p,x))")
                 (("1" (replace -1 1) (rewrite rest_of_SP_is_SP))
                  ("2" (rewrite rest_add_first))))))))
            ("2"
             (hide-all-but (-2 1))
             (expand* rest ^ min empty_seq)
             (lift-if)
             (lift-if)
             (assert)
             (prop)
             (("1" (assert)) ("2" (assert))))))
          ("3"
           (hide -1 3)
           (rewrite replace_par_pos_preservs_pos)
           (("1"
             (hide -2 -3 2)
             (expand SPP?)
             (flatten)
             (case "rest(x)`length=0")
             (("1"
               (split)
               (("1" (hide -2 -3 2) (expand* PP? finseq_appl) (grind))
                ("2"
                 (hide -2 2)
                 (rewrite empty_0)
                 (replaces -1)
                 (rewrite add_first_empty_seq)
                 (expand* SP? finseq_appl)
                 (skeep)
                 (case "i=0")
                 (("1"
                   (inst -2 0)
                   (("1"
                     (expand* add_first insert? finseq_appl)
                     (replaces -1)
                     (grind))
                    ("2"
                     (hide-all-but 1)
                     (expand* add_first insert?)
                     (assert))))
                  ("2" (hide-all-but 1) (typepred i) (grind))))))
              ("2"
               (split)
               (("1"
                 (rewrite add_first_parallel_pos_to_PP_is_PP)
                 (("1"
                   (skeep)
                   (hide -2 2)
                   (expand* PP? finseq_appl)
                   (prop)
                   (("1"
                     (hide 1)
                     (expand* add_first insert? rest ^ min empty_seq)
                     (lift-if)
                     (assert))
                    ("2"
                     (inst -1 "i+2" 0)
                     (("1"
                       (assert)
                       (hide 1)
                       (expand* add_first insert? finseq_appl rest ^ min)
                       (expand empty_seq 2)
                       (lift-if)
                       (assert)
                       (prop))
                      ("2"
                       (hide-all-but 1)
                       (expand* add_first insert?)
                       (assert))
                      ("3"
                       (hide 2 3 5)
                       (typepred i)
                       (expand* add_first insert? rest ^ min empty_seq)
                       (lift-if)
                       (assert))))))
                  ("2"
                   (rewrite rest_of_PP_is_PP)
                   (case "x=rest(add_first(p,x))")
                   (("1" (replace -1 1) (rewrite rest_of_PP_is_PP))
                    ("2" (rewrite rest_add_first))))))
                ("2"
                 (rewrite add_first_parallel_pos_to_SP_is_SP)
                 (("1"
                   (hide-all-but (-2 1))
                   (expand* SP? finseq_appl)
                   (inst -1 0)
                   (("1" (expand* add_first insert? finseq_appl))
                    ("2" (expand* add_first insert?) (assert))))
                  ("2"
                   (rewrite rest_of_SP_is_SP)
                   (case "x=rest(add_first(p,x))")
                   (("1" (replace -1 1) (rewrite rest_of_SP_is_SP))
                    ("2" (rewrite rest_add_first))))))))))
            ("2"
             (hide-all-but (-2 1))
             (expand* rest ^ min empty_seq)
             (lift-if)
             (lift-if)
             (assert)
             (prop)
             (("1" (assert)) ("2" (assert))))))
          ("4"
           (expand SPP? -2)
           (flatten)
           (hide-all-but (-2 1 2))
           (expand* PP? add_first insert? finseq_appl)
           (inst -1 1 0)
           (("1" (assert)) ("2" (expand* add_first insert?) (assert))
            ("3" (expand* add_first insert?) (assert))))))
        ("2"
         (expand SPP?)
         (flatten)
         (hide-all-but (-2 -3 1))
         (case "x=rest(add_first(p,x))")
         (("1"
           (replace -1 1)
           (rewrite rest_of_PP_is_PP)
           (rewrite rest_of_SP_is_SP))
          ("2" (rewrite rest_add_first))))))))
    ("2"
     (hide 2)
     (skeep)
     (expand* SPP? SP? finseq_appl)
     (flatten)
     (hide -1 -3 -4)
     (inst -1 0)
     (("1" (expand* add_first insert? finseq_appl))
      ("2" (expand* add_first insert?) (assert))))
    ("3" (hide 2) (skeep) (rewrite replace_par_pos_preservs_pos))
    ("4"
     (hide 2)
     (skeep)
     (case "fsp=rest(add_first(p,fsp))")
     (("1"
       (replace -1 1)
       (expand SPP?)
       (rewrite rest_of_PP_is_PP)
       (rewrite rest_of_SP_is_SP))
      ("2" (rewrite rest_add_first))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (expand "finseq_appl")
   (measure-induct+ "length(fsp)" "fsp")
   (("1"
     (skosimp*)
     (case "x!1`length = 0")
     (("1" (hide-all-but -1) (typepred "i!1") (assert))
      ("2"
       (expand "replace_par_pos" 2)
       (expand "finseq_appl")
       (inst -1 "rest(x!1)" "rest(fst!1)" "t!1")
       (rewrite "length_rest")
       (prop)
       (("1"
         (lemma "replace_par_pos_equivalence")
         (expand "finseq_appl")
         (inst?)
         (assert)
         (replaces -1)
         (lemma "replace_par_pos_preservs_pos")
         (inst -1 "rest(x!1)" "rest(fst!1)" "x!1`seq(0)" "t!1")
         (lemma "seq_first_rest[position]")
         (inst?)
         (expand "first")
         (expand "finseq_appl")
         (replace -1 -2 rl)
         (prop)
         (("1"
           (case-replace "i!1 = 0" :hide? T)
           (("1"
             (hide-all-but (-1 2))
             (lemma "subterm_of_replace")
             (inst?)
             (assert))
            ("2"
             (lemma "replace_par_pos_preservs_PP")
             (expand "finseq_appl")
             (inst?)
             (prop)
             (("1"
               (inst -1 "i!1 - 1")
               (("1"
                 (inst -4 "i!1 - 1")
                 (("1"
                   (lemma "rest_pos[position]")
                   (expand "finseq_appl")
                   (inst?)
                   (prop)
                   (("1"
                     (inst -1 "i!1 - 1")
                     (("1"
                       (lemma "rest_pos[term]")
                       (expand "finseq_appl")
                       (inst?)
                       (prop)
                       (("1"
                         (inst -1 "i!1 - 1")
                         (("1"
                           (assert)
                           (replace -1 -6 rl)
                           (replace -2 -6 rl)
                           (hide (-1 -2 -5))
                           (expand "SPP?")
                           (flatten)
                           (hide -5)
                           (expand "PP?")
                           (expand "finseq_appl")
                           (inst -4 "0" "i!1")
                           (assert)
                           (lemma "replace_persistence")
                           (inst?)
                           (assert))
                          ("2" (hide-all-but (1 2)) (assert))))
                        ("2" (hide-all-but (-1 -8 1 2)) (grind))))
                      ("2" (hide-all-but (1 2)) (assert))))
                    ("2" (hide-all-but (-1 -7 1 2)) (grind))))
                  ("2" (hide-all-but (1 2)) (assert))))
                ("2"
                 (prop)
                 (("1" (hide-all-but (1 2)) (assert))
                  ("2" (hide-all-but (1 2)) (typepred "i!1") (grind))))))
              ("2"
               (hide-all-but (-4 1 3))
               (expand "SPP?")
               (rewrite "rest_of_PP_is_PP")
               (rewrite "rest_of_SP_is_SP"))
              ("3" (hide-all-but (-5 1 3)) (grind))))))
          ("2" (hide-all-but (-4 1 2)) (grind))))
        ("2"
         (hide (-2 3))
         (expand "SPP?")
         (rewrite "rest_of_PP_is_PP")
         (rewrite "rest_of_SP_is_SP"))
        ("3" (hide (-1 3)) (grind))))))
    ("2" (hide-all-but (-2 1)) (skosimp) (grind))
    ("3"
     (hide-all-but (-1 -2 1))
     (skosimp)
     (lemma "replace_par_pos_preservs_PP")
     (expand "finseq_appl")
     (inst?)
     (assert)
     (inst?))
    ("4" (hide (-1 2)) (skosimp) (assert))
    ("5"
     (hide 2)
     (skosimp)
     (lemma "replace_par_pos_preservs_PP")
     (expand "finseq_appl")
     (inst?)
     (assert)
     (inst?))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" "fsp1")
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1"
       (hide -2)
       (expand replace_par_pos 1 3)
       (lift-if)
       (prop)
       (replace -1)
       (rewrite empty_0)
       (rewrite empty_0)
       (replaces -1)
       (replaces -2)
       (replaces -2)
       (rewrite empty_o_seq)
       (rewrite empty_o_seq))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (expand replace_par_pos 2 (1 3))
       (lift-if)
       (lift-if)
       (expand finseq_appl)
       (prop)
       (("1"
         (hide-all-but (-1 3))
         (rewrite "empty_0")
         (lemma "seq_empty[position]")
         (inst?)
         (assert))
        ("2"
         (inst -1 "fsp2" "rest(fst1)" "fst2" "t")
         (assert)
         (prop)
         (("1"
           (lemma replace_par_pos_equivalence)
           (expand finseq_appl)
           (copy -1)
           (inst -1 "x o fsp2" "fst1 o fst2" "t")
           (prop)
           (("1"
             (replaces -1)
             (copy -1)
             (inst -1 "x" "fst1" "t")
             (prop)
             (("1"
               (replaces -1)
               (inst -1 "add_first(x`seq(0),fsp2)"
                "add_first(fst1`seq(0),fst2)"
                "replace_par_pos(t,rest(x),rest(fst1))")
               (prop)
               (("1"
                 (rewrite rest_add_first)
                 (rewrite rest_add_first)
                 (expand add_first -1)
                 (expand* insert? finseq_appl)
                 (replaces -1)
                 (rewrite rest_compo)
                 (rewrite rest_compo)
                 (replaces -1)
                 (expand o 2)
                 (propax))
                ("2"
                 (hide-all-but (-2 1 4))
                 (expand SPP?)
                 (flatten)
                 (prop)
                 (("1"
                   (expand* PP? finseq_appl)
                   (prop)
                   (("1"
                     (hide 2)
                     (expand* add_first insert?)
                     (expand o -1)
                     (assert))
                    ("2"
                     (skeep 3)
                     (case "i=0")
                     (("1"
                       (case "j=0")
                       (("1" (assert))
                        ("2"
                         (replaces -1)
                         (inst -1 0 "x`length + j -1")
                         (("1"
                           (assert)
                           (expand o -1)
                           (expand add_first 5)
                           (expand* insert? finseq_appl))
                          ("2"
                           (hide-all-but 1)
                           (typepred j)
                           (expand* add_first insert? o)
                           (assert))))))
                      ("2"
                       (case "j=0")
                       (("1"
                         (replaces -1)
                         (inst -1 "x`length + i -1" 0)
                         (("1"
                           (assert)
                           (hide-all-but (-1 5 6))
                           (expand* add_first insert? finseq_appl o))
                          ("2"
                           (hide-all-but 1)
                           (typepred i)
                           (expand* add_first insert? o)
                           (assert))))
                        ("2"
                         (inst -1 "x`length + i -1" "x`length + j -1")
                         (("1"
                           (assert)
                           (hide-all-but (-1 6 7))
                           (expand* o add_first insert? finseq_appl))
                          ("2"
                           (hide-all-but 1)
                           (typepred j)
                           (expand* add_first insert? o)
                           (assert))
                          ("3"
                           (hide-all-but 1)
                           (typepred i)
                           (expand* add_first insert? o)
                           (assert))))))))))
                  ("2"
                   (expand* SP? finseq_appl)
                   (skeep)
                   (case "i=0")
                   (("1"
                     (replaces -1)
                     (expand* add_first insert?)
                     (inst -2 0)
                     (expand o -2)
                     (rewrite replace_par_pos_preservs_pos)
                     (("1"
                       (lemma seq_first_rest[position])
                       (inst -1 x)
                       (assert)
                       (expand* first finseq_appl)
                       (replace -1 1 rl)
                       (expand SPP?)
                       (hide -1)
                       (split)
                       (("1"
                         (expand* PP? finseq_appl)
                         (prop)
                         (("1" (expand o -1) (assert))
                          ("2"
                           (skosimp)
                           (inst -1 i!1 j!1)
                           (("1"
                             (assert)
                             (typepred (i!1 j!1))
                             (expand o -3)
                             (propax))
                            ("2" (typepred j!1) (expand o 1) (assert))
                            ("3"
                             (typepred i!1)
                             (expand o 1)
                             (assert))))))
                        ("2"
                         (expand* SP? finseq_appl)
                         (skosimp)
                         (reveal -3)
                         (typepred i!1)
                         (inst -2 i!1)
                         (("1" (expand o -2) (propax))
                          ("2" (expand o 1) (assert))))))
                      ("2"
                       (reveal -4)
                       (hide-all-but (-1 1))
                       (expand* rest ^ min empty_seq)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (prop)
                       (("1" (assert)) ("2" (assert))))))
                    ("2"
                     (inst -2 "x`length + i -1")
                     (("1"
                       (expand* add_first insert? finseq_appl)
                       (expand o -2)
                       (assert)
                       (rewrite replace_par_pos_preservs_pos)
                       (("1"
                         (expand* SPP? PP? finseq_appl)
                         (split)
                         (("1" (propax))
                          ("2"
                           (prop)
                           (("1"
                             (hide -2 2 4)
                             (expand* o add_first insert? rest ^ min
                              empty_seq)
                             (lift-if)
                             (assert))
                            ("2"
                             (skosimp)
                             (case "i!1=0")
                             (("1"
                               (replaces -1)
                               (case "j!1=0")
                               (("1" (assert))
                                ("2"
                                 (typepred i j!1)
                                 (inst -3 "x`length + i-1" j!1)
                                 (("1"
                                   (prop)
                                   (("1"
                                     (hide -4 2 3 4 7)
                                     (expand*
                                      add_first
                                      insert?
                                      finseq_appl
                                      o
                                      rest
                                      ^
                                      min)
                                     (expand empty_seq -3)
                                     (lift-if)
                                     (assert)
                                     (prop))
                                    ("2"
                                     (hide-all-but (-1 -3))
                                     (expand*
                                      add_first
                                      insert?
                                      rest
                                      ^
                                      min
                                      empty_seq)
                                     (lift-if)
                                     (assert))))
                                  ("2"
                                   (hide-all-but (-2 1))
                                   (expand*
                                    add_first
                                    insert?
                                    rest
                                    ^
                                    min
                                    empty_seq
                                    o)
                                   (lift-if)
                                   (assert))
                                  ("3"
                                   (hide-all-but (-1 1))
                                   (expand* add_first insert? o)
                                   (assert))))))
                              ("2"
                               (case "j!1 = 0")
                               (("1"
                                 (replaces -1)
                                 (hide -2 2 3 4 7)
                                 (typepred i!1 i)
                                 (inst -3 i!1 "x`length+i-1")
                                 (("1"
                                   (prop)
                                   (("1"
                                     (expand*
                                      o
                                      add_first
                                      insert?
                                      finseq_appl
                                      rest
                                      ^
                                      min)
                                     (expand empty_seq -2)
                                     (lift-if)
                                     (assert)
                                     (prop))
                                    ("2"
                                     (hide-all-but (-1 -2))
                                     (expand*
                                      add_first
                                      insert?
                                      rest
                                      ^
                                      min
                                      empty_seq)
                                     (lift-if)
                                     (assert))))
                                  ("2"
                                   (hide-all-but (-2 1))
                                   (expand* add_first insert? o)
                                   (assert))
                                  ("3"
                                   (hide-all-but (-1 1))
                                   (expand*
                                    add_first
                                    insert?
                                    o
                                    rest
                                    ^
                                    min
                                    empty_seq)
                                   (lift-if)
                                   (assert))))
                                ("2"
                                 (hide -2 3 4 7 8)
                                 (typepred i!1 j!1)
                                 (inst -3 i!1 j!1)
                                 (("1"
                                   (assert)
                                   (expand*
                                    o
                                    add_first
                                    insert?
                                    finseq_appl
                                    rest
                                    ^
                                    min)
                                   (expand empty_seq (-1 -2))
                                   (lift-if)
                                   (lift-if)
                                   (assert)
                                   (prop))
                                  ("2"
                                   (hide-all-but (-2 1))
                                   (expand*
                                    o
                                    add_first
                                    insert?
                                    rest
                                    ^
                                    min
                                    empty_seq)
                                   (lift-if)
                                   (assert))
                                  ("3"
                                   (hide-all-but (-1 1))
                                   (expand*
                                    o
                                    add_first
                                    insert?
                                    rest
                                    ^
                                    min
                                    empty_seq)
                                   (lift-if)
                                   (assert))))))))))
                          ("3"
                           (hide -1 3)
                           (expand* SP? finseq_appl)
                           (skosimp)
                           (reveal -2)
                           (case "i!1 = 0")
                           (("1"
                             (replaces -1)
                             (inst -1 "x`length+i-1")
                             (("1"
                               (expand* o add_first insert? finseq_appl))
                              ("2"
                               (hide-all-but 1)
                               (typepred i)
                               (expand* o add_first insert?)
                               (assert))))
                            ("2"
                             (typepred i!1)
                             (inst -2 i!1)
                             (("1"
                               (expand* o add_first insert? finseq_appl
                                rest ^ min)
                               (expand empty_seq -1)
                               (lift-if)
                               (assert)
                               (prop))
                              ("2"
                               (hide-all-but (-1 1))
                               (expand* o add_first insert? rest ^ min
                                empty_seq)
                               (lift-if)
                               (assert))))))))
                        ("2"
                         (hide-all-but 1)
                         (reveal -5)
                         (expand* rest ^ min empty_seq)
                         (lift-if)
                         (lift-if)
                         (assert)
                         (prop)
                         (("1" (assert)) ("2" (assert))))))
                      ("2"
                       (hide-all-but 1)
                       (typepred i)
                       (expand* o add_first insert?)
                       (assert))))))))
                ("3"
                 (hide-all-but -1)
                 (expand* add_first insert?)
                 (assert))
                ("4" (hide-all-but (-4 1)) (expand* add_first insert?))))
              ("2"
               (hide-all-but (-3 1 4))
               (expand* SPP? PP? SP? finseq_appl)
               (lift-if)
               (assert)
               (prop)
               (("1"
                 (skeep)
                 (typepred i)
                 (inst -3 i)
                 (("1" (expand o -3) (propax))
                  ("2" (expand o 1) (assert))))
                ("2"
                 (skeep 2)
                 (typepred i)
                 (inst -3 i)
                 (("1" (expand o -3) (propax))
                  ("2" (expand o 1) (assert))))
                ("3" (skeep) (typepred i j) (expand o -3) (assert))
                ("4"
                 (skeep 2)
                 (typepred i j)
                 (inst -3 i j)
                 (("1" (assert) (expand o -3) (propax))
                  ("2" (expand o 1) (assert))
                  ("3" (expand o 1) (assert))))
                ("5" (expand o -1) (assert))
                ("6"
                 (skeep 2)
                 (typepred i)
                 (inst -3 i)
                 (("1" (expand o -3) (propax))
                  ("2" (expand o 1) (assert))))))))
            ("2" (hide-all-but (-4 -6 1)) (expand o) (assert))))
          ("2"
           (hide-all-but (-1 1 4))
           (expand SPP?)
           (flatten)
           (split)
           (("1"
             (lemma rest_of_PP_is_PP)
             (inst -1 "x o fsp2")
             (rewrite rest_compo))
            ("2"
             (lemma rest_of_SP_is_SP)
             (inst -1 t "x o fsp2")
             (rewrite rest_compo))))
          ("3"
           (hide-all-but (-2 1))
           (expand* rest ^ min empty_seq)
           (lift-if)
           (lift-if)
           (assert)
           (prop)
           (("1" (assert)) ("2" (assert))))))))))
    ("2"
     (hide 2)
     (skeep)
     (expand SPP?)
     (flatten)
     (split)
     (("1"
       (expand* PP? finseq_appl)
       (prop)
       (("1" (expand o -1) (assert))
        ("2"
         (skeep 3)
         (inst -1 "fsp1`length+i" "fsp1`length+j")
         (("1" (assert) (expand o -1) (propax))
          ("2" (expand o 1) (assert)) ("3" (expand o 1) (assert))))))
      ("2"
       (expand SP? 1)
       (skeep)
       (expand finseq_appl)
       (rewrite replace_par_pos_preservs_pos)
       (expand* SPP? SP? PP? finseq_appl)
       (split)
       (("1" (propax))
        ("2"
         (prop)
         (("1"
           (hide-all-but (-1 1))
           (expand* o add_first insert?)
           (assert))
          ("2"
           (skosimp)
           (case "i!1=0 & j!1=0")
           (("1" (flatten) (assert))
            ("2"
             (prop)
             (("1"
               (case "j!1 = 0")
               (("1"
                 (replaces -1)
                 (typepred i!1 i)
                 (inst -3 "i!1-1" "fsp1`length+i")
                 (("1"
                   (prop)
                   (("1"
                     (hide-all-but (-1 -2 1 5))
                     (expand* o add_first insert? finseq_appl)
                     (lift-if)
                     (assert))
                    ("2"
                     (hide-all-but (-1 -2))
                     (expand* add_first insert?)
                     (assert))))
                  ("2" (expand o 1) (assert))
                  ("3"
                   (expand o 1)
                   (assert)
                   (hide-all-but (-1 1))
                   (expand* add_first insert?)
                   (assert))))
                ("2"
                 (typepred i!1 j!1)
                 (inst -3 "i!1-1" "j!1-1")
                 (("1"
                   (assert)
                   (hide-all-but (-1 -2 -3 1 2 6))
                   (expand* o add_first insert? finseq_appl)
                   (lift-if)
                   (lift-if)
                   (assert))
                  ("2"
                   (expand o 1)
                   (assert)
                   (hide-all-but (-2 1))
                   (expand* add_first insert?)
                   (assert))
                  ("3"
                   (hide-all-but (-1 1 3))
                   (expand* o add_first insert?)
                   (assert))))))
              ("2"
               (case "i!1=0")
               (("1"
                 (replaces -1)
                 (typepred j!1 i)
                 (inst -3 "fsp1`length+i" "j!1-1")
                 (("1"
                   (prop)
                   (("1"
                     (hide-all-but (-1 -2 1 5))
                     (expand* add_first insert? finseq_appl o)
                     (lift-if)
                     (assert))
                    ("2"
                     (hide-all-but (-1 -2))
                     (expand* add_first insert?)
                     (assert))))
                  ("2"
                   (hide-all-but (-1 1 2))
                   (expand* add_first insert? o)
                   (assert))
                  ("3" (hide-all-but (-2 1)) (expand o) (assert))))
                ("2"
                 (typepred i!1 j!1)
                 (inst -3 "i!1-1" "j!1-1")
                 (("1"
                   (assert)
                   (hide-all-but (-1 -2 -3 1 2 6))
                   (expand* add_first insert? finseq_appl o)
                   (lift-if)
                   (lift-if)
                   (assert))
                  ("2"
                   (hide-all-but (-2 1 3))
                   (expand* add_first insert? o)
                   (assert))
                  ("3"
                   (hide-all-but (-1 1 2))
                   (expand* add_first insert? o)
                   (assert))))))))))))
        ("3"
         (skosimp)
         (hide-all-but (-2 1))
         (case "i!1=0")
         (("1"
           (replaces -1)
           (inst -1 "fsp1`length+i")
           (("1" (expand* add_first insert? o))
            ("2" (typepred i) (expand o) (assert))))
          ("2"
           (inst -1 "i!1-1")
           (("1"
             (expand* add_first insert? finseq_appl o)
             (assert)
             (prop)
             (hide-all-but 1)
             (typepred i!1)
             (expand* add_first insert?)
             (assert))
            ("2"
             (hide 3)
             (typepred i!1)
             (expand* add_first insert? o)
             (assert))))))))))
    ("3"
     (hide 2)
     (skeep)
     (expand* SPP? PP? SP? finseq_appl)
     (flatten)
     (split)
     (("1"
       (prop)
       (("1" (expand o -1) (assert))
        ("2"
         (skeep)
         (typepred i)
         (inst -3 i)
         (("1" (expand o -3) (propax)) ("2" (expand o 1) (assert))))))
      ("2"
       (prop)
       (("1"
         (skeep 2)
         (typepred i j)
         (inst -3 i j)
         (("1" (assert) (expand o -3) (propax))
          ("2" (expand o 1) (assert)) ("3" (expand o 1) (assert))))
        ("2"
         (skeep)
         (typepred i)
         (inst -3 i)
         (("1" (expand o -3) (propax)) ("2" (expand o 1) (assert))))))))
    ("4" (hide 2) (skeep) (hide -1) (expand o) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(fsp1)" "fsp1")
   (("1"
     (case "x!1`length = 0")
     (("1"
       (skosimp)
       (hide (-2 -3))
       (replace -1 -2)
       (rewrite "empty_0")
       (rewrite "empty_0")
       (replaces -1)
       (replaces -1)
       (rewrite "empty_o_seq")
       (rewrite "empty_o_seq")
       (rewrite "seq_o_empty")
       (rewrite "seq_o_empty"))
      ("2"
       (skosimp)
       (expand "replace_par_pos" 2 1)
       (expand "finseq_appl")
       (lift-if)
       (prop)
       (("1"
         (hide-all-but (-1 1))
         (expand "replace_par_pos")
         (expand "finseq_appl")
         (lift-if)
         (prop)
         (hide 2)
         (grind))
        ("2"
         (inst -1 "rest(x!1)" "fsp2!1" "rest(fst1!1)" "fst2!1"
          "replaceTerm(t!1, (fst1!1 o fst2!1)`seq(0), (x!1 o fsp2!1)`seq(0))")
         (rewrite "length_rest")
         (prop)
         (("1"
           (lemma "rest_compo[position]")
           (inst -1 "x!1" "fsp2!1")
           (assert)
           (replace -1 -2 rl)
           (hide -1)
           (lemma "rest_compo[term]")
           (inst -1 "fst1!1" "fst2!1")
           (assert)
           (replace -1 -2 rl)
           (hide -1)
           (replaces -1)
           (expand "o" 2 (1 2))
           (lemma "replace_par_pos_equivalence1")
           (expand "finseq_appl")
           (inst -1 "fsp2!1 o x!1" "fst2!1 o fst1!1" "fst2!1`length"
            "t!1")
           (prop)
           (("1"
             (case-replace
              "(fst2!1 o fst1!1)`seq(fst2!1`length) = fst1!1`seq(0)"
              :hide? T)
             (("1"
               (case-replace
                "(fsp2!1 o x!1)`seq(fst2!1`length) = x!1`seq(0)" :hide?
                T)
               (("1"
                 (case-replace
                  "delete(fsp2!1 o x!1, fst2!1`length) = fsp2!1 o rest(x!1)"
                  :hide? T)
                 (("1"
                   (case-replace
                    "delete(fst2!1 o fst1!1, fst2!1`length) = fst2!1 o rest(fst1!1)"
                    :hide? T)
                   (hide (-1 -2 3))
                   (decompose-equality 1)
                   (("1" (grind))
                    ("2"
                     (decompose-equality 1)
                     (expand "delete")
                     (expand "finseq_appl")
                     (lift-if)
                     (prop)
                     (("1" (hide 1) (grind))
                      ("2" (expand "o" 1) (assert))
                      ("3"
                       (expand "o" 2)
                       (assert)
                       (lemma "rest_pos[term]")
                       (expand "finseq_appl")
                       (inst -1 "fst1!1")
                       (prop)
                       (("1"
                         (inst -1 "x!2 - fst2!1`length")
                         (("1" (assert))
                          ("2" (hide 3) (typepred "x!2") (grind))))
                        ("2" (hide 2) (typepred "x!2") (grind))))))))
                  ("2"
                   (hide (-1 -2 3))
                   (decompose-equality 1)
                   (("1" (grind))
                    ("2"
                     (decompose-equality 1)
                     (expand "delete")
                     (expand "finseq_appl")
                     (lift-if)
                     (prop)
                     (("1" (hide 1) (grind))
                      ("2" (expand "o" 1) (assert))
                      ("3"
                       (expand "o" 2)
                       (assert)
                       (lemma "rest_pos[position]")
                       (expand "finseq_appl")
                       (inst -1 "x!1")
                       (prop)
                       (("1"
                         (inst -1 "x!2 - fst2!1`length")
                         (("1" (assert))
                          ("2" (hide 3) (typepred "x!2") (grind))))
                        ("2" (hide 2) (typepred "x!2") (grind))))))))))
                ("2" (hide (-1 -2 3)) (expand "o" 1) (assert))))
              ("2" (hide (-1 -2 3)) (expand "o" 1) (propax))))
            ("2" (hide 3) (rewrite comp_SPP_commute))
            ("3" (hide-all-but (-1 1)) (expand o) (propax))
            ("4" (hide-all-but (-2 -3 1)) (expand o) (assert))
            ("5" (hide-all-but (-3 1 4)) (expand o) (assert))))
          ("2"
           (hide 3)
           (expand "o" 1 (1 2))
           (lift-if)
           (lift-if)
           (lift-if)
           (assert)
           (lemma "rest_compo[position]")
           (inst -1 "x!1" "fsp2!1")
           (assert)
           (replace -1 1 rl)
           (hide -1)
           (expand "SPP?")
           (prop)
           (("1" (hide-all-but (-1 1)) (rewrite "rest_of_PP_is_PP"))
            ("2"
             (rewrite "rest_of_SP_is_SP")
             (hide 2)
             (expand "SP?")
             (expand "finseq_appl")
             (skosimp)
             (expand "o" 1)
             (prop)
             (("1"
               (case-replace "i!1 = 0" :hide? T)
               (("1"
                 (hide-all-but (-3 1))
                 (inst -1 "0")
                 (expand "o")
                 (lemma "replace_preserv_pos")
                 (inst?)
                 (assert))
                ("2"
                 (expand "PP?")
                 (expand "finseq_appl")
                 (prop)
                 (("1" (grind))
                  ("2"
                   (inst -1 "0" "i!1")
                   (assert)
                   (inst-cp -3 "0")
                   (inst -3 "i!1")
                   (expand "o" (-1 -3 -4))
                   (lemma "replace_preserv_parallel_pos")
                   (inst?)
                   (assert))))))
              ("2"
               (expand "PP?")
               (expand "finseq_appl")
               (assert)
               (inst -1 "0" "i!1")
               (assert)
               (inst-cp -2 "0")
               (inst -2 "i!1")
               (expand "o" (-1 -2 -3))
               (lemma "replace_preserv_parallel_pos")
               (inst?)
               (assert))))))
          ("3" (hide (-1 3)) (grind))))))))
    ("2" (hide (-1 -5 2)) (grind))
    ("3"
     (hide-all-but (-1 1))
     (lemma comp_SPP_commute)
     (inst -1 y!1 fsp2!1 t!1)
     (assert))
    ("4" (hide (-1 -5 2)) (grind)) ("5" (hide (-1 2)) (grind))
    ("6"
     (hide 2)
     (lemma comp_SPP_commute)
     (inst -1 fsp1!1 fsp2!1 t!1)
     (assert))
    ("7" (hide (-1 2)) (grind))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "p`length" p)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (rewrite empty_0)
     (replaces -1)
     (rewrite empty_o_seq)
     (rewrite empty_o_seq)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 "rest(p1)" "rest(p2)" q1 q2)
     (rewrite rest_parallel)
     (("1"
       (replaces -3 -1)
       (replaces -3 -1)
       (rewrite rest_compo)
       (rewrite rest_compo))
      ("2" (replaces -2) (expand o 1) (assert))
      ("3" (replaces -3) (expand o 1) (assert))
      ("4"
       (replaces -2)
       (replaces -2)
       (rewrite first_compo)
       (rewrite first_compo))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (expand complement_pos)
     (assert)
     (expand empty_seq)
     (expand member_seq)
     (skosimp))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (expand member_seq -3)
     (expand finseq_appl)
     (skosimp)
     (expand complement_pos -3)
     (assert)
     (lift-if)
     (prop)
     (("1"
       (case "i!1=0")
       (("1"
         (replaces -1)
         (expand* add_first insert?)
         (inst 2 0)
         (expand complement_pos_set -2)
         (lift-if)
         (prop)
         (("1" (assert))
          ("2"
           (expand* nonempty? empty?)
           (skosimp 2)
           (expand emptyset)
           (assert))
          ("3" (expand emptyset) (assert))))
        ("2"
         (expand* add_first insert? finseq_appl)
         (lift-if)
         (assert)
         (inst -3 p p1)
         (rewrite rest_of_PP_is_PP)
         (prop)
         (("1"
           (skosimp)
           (typepred i!2)
           (expand rest (-1 -2))
           (expand* ^ min)
           (expand empty_seq -1)
           (lift-if)
           (assert)
           (prop)
           (inst 7 "1+i!2"))
          ("2" (expand* member_seq finseq_appl) (inst 1 "i!1-1"))))))
      ("2"
       (inst -2 p p1)
       (rewrite rest_of_PP_is_PP)
       (prop)
       (("1"
         (skosimp)
         (typepred i!2)
         (expand rest (-1 -2))
         (expand* ^ min)
         (expand empty_seq -1)
         (lift-if)
         (assert)
         (prop)
         (inst 7 "1+i!2"))
        ("2" (expand* member_seq finseq_appl) (inst 1 i!1))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (expand complement_pos 1)
     (expand PP? 1 1)
     (expand empty_seq 1 1)
     (assert))
    ("2"
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 p)
     (rewrite rest_of_PP_is_PP)
     (expand complement_pos 2)
     (assert)
     (prop)
     (rewrite add_first_parallel_pos_to_PP_is_PP)
     (expand finseq_appl)
     (skeep)
     (typepred "choose(complement_pos_set(p, x`seq(0)))")
     (lemma complement_pos_character)
     (inst -1 "rest(x)" p "complement_pos(p, rest(x))`seq(i)")
     (rewrite rest_of_PP_is_PP)
     (prop)
     (("1"
       (skolem -1 k)
       (expand complement_pos_set -2 1)
       (expand emptyset)
       (prop)
       (typepred k)
       (expand rest -1)
       (expand rest -4 1)
       (expand* ^ min)
       (expand empty_seq -1)
       (lift-if)
       (assert)
       (prop)
       (expand PP? -7)
       (expand finseq_appl)
       (assert)
       (inst -7 1+k 0)
       (assert)
       (lemma parallel_pos_same_prefix)
       (inst -1 p "x`seq(1+k)" "x`seq(0)"
        "complement_pos(p, rest(x))`seq(i)"
        "choose(complement_pos_set(p, x`seq(0)))")
       (assert))
      ("2" (expand* member_seq finseq_appl) (inst 1 i))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (expand complement_pos 1)
   (expand sub_pos 1)
   (lift-if)
   (lift-if)
   (expand* add_first insert?)
   (prop)
   (("1"
     (inst -3 "rest(x)")
     (rewrite length_rest)
     (inst -3 p)
     (rewrite rest_of_PP_is_PP))
    ("2"
     (expand* nonempty? empty? member complement_pos_set)
     (skosimp)
     (assert)
     (expand emptyset)
     (propax))
    ("3"
     (expand* nonempty? empty? member complement_pos_set emptyset)
     (skosimp)
     (assert))
    ("4"
     (lift-if)
     (prop)
     (("1"
       (expand* nonempty? empty? member complement_pos_set emptyset)
       (copy -1)
       (expand <= -1)
       (skolem -1 p2)
       (inst -3 p2)
       (assert))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 p)
       (rewrite rest_of_PP_is_PP))
      ("3"
       (inst -2 "rest(x)")
       (rewrite length_rest)
       (inst -2 p)
       (rewrite rest_of_PP_is_PP))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1" (expand complement_pos 1) (expand empty_seq) (assert))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (expand complement_pos 2)
       (assert)
       (lift-if)
       (expand add_first 2)
       (expand insert?)
       (inst -1 p)
       (prop)
       (("1"
         (expand* add_first insert? PP? nonempty? empty? member
          complement_pos_set emptyset finseq_appl)
         (skosimp)
         (prop)
         (inst -4 0 1)
         (expand parallel)
         (flatten))
        ("2"
         (expand rest 2)
         (expand* ^ min empty_seq add_first insert? PP? finseq_appl)
         (assert)
         (prop)
         (lift-if)
         (assert)
         (prop)
         (skosimp)
         (lift-if)
         (prop)
         (("1"
           (lift-if)
           (prop)
           (("1" (assert))
            ("2"
             (inst -3 0 j!1+1)
             (("1" (assert)) ("2" (typepred j!1) (assert))))))
          ("2"
           (lift-if)
           (prop)
           (("1"
             (inst -3 i!1+1 0)
             (("1" (assert)) ("2" (typepred i!1) (assert))))
            ("2"
             (inst -2 i!1+1 j!1+1)
             (("1" (assert)) ("2" (typepred j!1) (assert))
              ("3" (typepred i!1) (assert))))))))
        ("3"
         (hide 1 2)
         (expand* rest ^ min empty_seq add_first insert? PP? finseq_appl)
         (prop)
         (lift-if)
         (assert)
         (prop)
         (skosimp)
         (lift-if)
         (prop)
         (("1"
           (lift-if)
           (prop)
           (("1" (assert))
            ("2"
             (typepred j!1)
             (inst -3 0 j!1+1)
             (("1" (assert)) ("2" (assert))))))
          ("2"
           (lift-if)
           (prop)
           (("1" (typepred i!1) (assert) (inst -3 i!1+1 0) (assert))
            ("2"
             (typepred (i!1 j!1))
             (assert)
             (inst -3 i!1+1 j!1+1)
             (assert))))))))))
    ("2"
     (skeep)
     (hide 2)
     (lemma rest_of_PP_is_PP)
     (inst -1 "add_first(p, fsp)")
     (rewrite rest_add_first))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand* parallel <=)
   (flatten)
   (split)
   (("1"
     (hide 2)
     (skolem -1 p3)
     (inst 1 p3)
     (expand o)
     (flatten)
     (decompose-equality)
     (decompose-equality)
     (("1"
       (decompose-equality)
       (("1"
         (inst -1 "p`length+x!1")
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert))))
        ("2" (skeep) (replaces -2) (assert)) ("3" (skeep) (assert))))
      ("2" (skeep) (assert))))
    ("2"
     (hide 1)
     (skolem -1 p3)
     (inst 1 p3)
     (expand o)
     (flatten)
     (decompose-equality)
     (decompose-equality)
     (("1"
       (decompose-equality)
       (("1"
         (inst -1 "p`length+x!1")
         (lift-if)
         (lift-if)
         (lift-if)
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert))))
        ("2" (skeep) (replaces -2) (assert)) ("3" (skeep) (assert))))
      ("2" (skeep) (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "q1`length" q1)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1" (rewrite empty_0) (replaces -1) (rewrite seq_o_empty))
    ("2"
     (inst -1 "delete(x,x`length-1)")
     (("1"
       (expand delete -1 1)
       (lift-if)
       (assert)
       (inst -1 p1 p2)
       (assert)
       (expand parallel (-1 2))
       (expand <=)
       (flatten)
       (split)
       (("1"
         (skolem -1 p3)
         (inst 2 "#(x`seq(x`length-1)) o p3")
         (lemma add_last_delete_is_o[posnat])
         (inst -1 x)
         (assert)
         (expand finseq_appl)
         (rewrite o_assoc 2)
         (lemma o_assoc[posnat])
         (inst -1 p1 "delete(x, x`length - 1)" "#(x`seq(x`length - 1))")
         (replace -1 2 rl)
         (replace -2 2 rl)
         (lemma add_last_delete[posnat])
         (inst -1 x)
         (assert))
        ("2"
         (skolem -1 p3)
         (case "p3`length=0")
         (("1"
           (rewrite empty_0)
           (replaces -1)
           (rewrite seq_o_empty)
           (inst 2 "#(x`seq(x`length-1))")
           (lemma o_assoc[posnat])
           (inst -1 p1 "delete(x, x`length - 1)"
            "#(x`seq(x`length - 1))")
           (replace -1 2 rl)
           (lemma add_last_delete_is_o[posnat])
           (inst -1 x)
           (assert)
           (expand finseq_appl)
           (replace -1 2 rl)
           (lemma add_last_delete[posnat])
           (inst -1 x)
           (assert))
          ("2"
           (inst 4 "delete(p3,p3`length-1)")
           (("1"
             (expand o (-1 4))
             (flatten)
             (split)
             (("1" (expand delete 1) (lift-if) (assert))
              ("2"
               (decompose-equality)
               (("1"
                 (decompose-equality)
                 (lift-if)
                 (lift-if)
                 (lift-if)
                 (assert)
                 (inst -1 x!1)
                 (("1"
                   (lift-if)
                   (lift-if)
                   (prop)
                   (("1" (expand delete 2) (expand finseq_appl) (propax))
                    ("2"
                     (lift-if)
                     (assert)
                     (expand delete 1)
                     (expand finseq_appl)
                     (propax))
                    ("3"
                     (lift-if)
                     (assert)
                     (expand delete 2)
                     (expand finseq_appl)
                     (propax))))
                  ("2"
                   (assert)
                   (typepred x!1)
                   (expand delete -1)
                   (assert))))
                ("2" (skeep) (expand delete 1) (replaces -1) (assert))
                ("3" (skeep) (assert)) ("4" (skeep) (assert))))))
            ("2" (assert))))))))
      ("2" (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma comp_preservs_parallel_pos2)
   (inst -1 p1 p2 q1)
   (assert)
   (lemma parallel_comm)
   (inst -1 "p1 o q1" p2)
   (assert)
   (rewrite parallel_comm 1)
   (lemma comp_preservs_parallel_pos2)
   (inst -1 p2 "p1 o q1" q2)
   (assert))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (decompose-equality)
   (("1" (expand comp_pos 1 1) (grind))
    ("2"
     (decompose-equality)
     (typepred x!1)
     (expand comp_pos)
     (expand* rest ^ min finseq_appl)
     (expand empty_seq -1)
     (lift-if)
     (assert)
     (prop))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1" (expand comp_pos 1) (propax))
    ("2" (expand comp_pos 2) (propax))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand* comp_pos PP? finseq_appl)
   (prop)
   (skosimp)
   (inst -1 i!1 j!1)
   (assert)
   (rewrite comp_preservs_parallel_pos))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct+ "length(fsp)" "fsp")
   (("1"
     (skosimp)
     (expand "replace_par_pos" 1)
     (expand "finseq_appl")
     (lift-if)
     (lift-if)
     (lift-if)
     (prop)
     (("1" (hide-all-but (-1 1)) (expand "comp_pos") (propax))
      ("2" (hide-all-but (-1 2)) (expand "comp_pos") (propax))
      ("3"
       (inst -1 "rest(x!1)" "rest(fst!1)" "q!1"
        "replaceTerm(s!1, fst!1`seq(0), x!1`seq(0))" "t!1")
       (rewrite "length_rest")
       (prop)
       (("1"
         (replaces -1)
         (lemma "replace_associativity")
         (inst?)
         (prop)
         (("1"
           (replace -1 2 rl)
           (expand "comp_pos" 2 2)
           (expand "finseq_appl")
           (rewrite "comp_pos_rest"))
          ("2"
           (expand "SPP?")
           (flatten)
           (hide-all-but (-3 1 4))
           (expand "SP?")
           (expand "finseq_appl")
           (inst?))))
        ("2"
         (hide-all-but (-2 1 4))
         (expand "SPP?")
         (prop)
         (("1"
           (hide (-2 2))
           (expand "PP?")
           (prop)
           (("1" (hide 2) (grind))
            ("2"
             (skosimp)
             (expand "finseq_appl")
             (inst -1 "i!1 + 1" "j!1 + 1")
             (("1"
               (assert)
               (lemma "rest_pos[position]")
               (inst?)
               (assert)
               (expand "finseq_appl")
               (inst-cp -1 "i!1")
               (("1"
                 (inst -1 "j!1")
                 (("1" (assert))
                  ("2" (hide-all-but 1) (typepred "j!1") (grind))))
                ("2" (hide-all-but 1) (typepred "i!1") (grind))))
              ("2" (hide-all-but 1) (typepred "j!1") (grind))
              ("3" (hide-all-but 1) (typepred "i!1") (grind))))))
          ("2"
           (expand* "PP?" "SP?")
           (expand "finseq_appl")
           (prop)
           (("1" (skosimp) (typepred "i!1") (hide (-3 1)) (grind))
            ("2"
             (skosimp)
             (inst -1 "0" "i!1 + 1")
             (("1"
               (assert)
               (lemma "rest_pos[position]")
               (inst?)
               (assert)
               (expand "finseq_appl")
               (inst -1 "i!1")
               (("1"
                 (replace -1 2 rl)
                 (inst-cp -3 "0")
                 (inst -3 "i!1 + 1")
                 (("1"
                   (lemma "replace_preserv_parallel_pos")
                   (inst?)
                   (assert))
                  ("2" (hide-all-but 1) (typepred "i!1") (grind))))
                ("2" (hide-all-but 1) (typepred "i!1") (grind))))
              ("2" (hide-all-but 1) (typepred "i!1") (grind))))))))
        ("3" (hide-all-but (-3 1)) (grind))))))
    ("2" (hide-all-but (-3 1)) (expand "comp_pos") (propax))
    ("3"
     (hide-all-but (-1 -2 1))
     (expand "SPP?")
     (prop)
     (("1"
       (hide -3)
       (expand "PP?")
       (prop)
       (("1" (hide (-2 2)) (expand "comp_pos") (propax))
        ("2"
         (expand "finseq_appl")
         (skosimp)
         (inst -1 "i!1" "j!1")
         (("1"
           (assert)
           (hide (-2 1 2 3))
           (expand* "parallel" "comp_pos")
           (expand "finseq_appl")
           (prop)
           (("1"
             (hide 2)
             (expand "<=")
             (skosimp)
             (inst 1 "p1!1")
             (lemma "o_assoc[posnat]")
             (inst?)
             (replace -1 -2 rl)
             (hide -1)
             (lemma "equal_prefix[posnat]")
             (inst?)
             (assert))
            ("2"
             (hide 1)
             (expand "<=")
             (skosimp)
             (inst 1 "p1!1")
             (lemma "o_assoc[posnat]")
             (inst?)
             (replace -1 -2 rl)
             (hide -1)
             (lemma "equal_prefix[posnat]")
             (inst?)
             (assert))))
          ("2"
           (hide-all-but 1)
           (typepred "j!1")
           (expand "comp_pos")
           (propax))
          ("3"
           (hide-all-but 1)
           (typepred "i!1")
           (expand "comp_pos")
           (propax))))))
      ("2"
       (hide -2)
       (expand "SP?")
       (skosimp)
       (expand "comp_pos")
       (expand "finseq_appl")
       (inst?)
       (lemma "replace_compose_pos")
       (inst?)
       (assert))))
    ("4" (hide-all-but (-3 1)) (expand "comp_pos") (propax))
    ("5"
     (hide (-3 2))
     (expand "SPP?")
     (prop)
     (("1"
       (hide -3)
       (expand "PP?")
       (prop)
       (("1" (hide (-2 2)) (expand "comp_pos") (propax))
        ("2"
         (expand "finseq_appl")
         (skosimp)
         (inst -1 "i!1" "j!1")
         (("1"
           (assert)
           (hide (-2 1 2 3))
           (expand* "parallel" "comp_pos")
           (expand "finseq_appl")
           (prop)
           (("1"
             (hide 2)
             (expand "<=")
             (skosimp)
             (inst 1 "p1!1")
             (lemma "o_assoc[posnat]")
             (inst?)
             (replace -1 -2 rl)
             (hide -1)
             (lemma "equal_prefix[posnat]")
             (inst?)
             (assert))
            ("2"
             (hide 1)
             (expand "<=")
             (skosimp)
             (inst 1 "p1!1")
             (lemma "o_assoc[posnat]")
             (inst?)
             (replace -1 -2 rl)
             (hide -1)
             (lemma "equal_prefix[posnat]")
             (inst?)
             (assert))))
          ("2"
           (hide-all-but 1)
           (typepred "j!1")
           (expand "comp_pos")
           (propax))
          ("3"
           (hide-all-but 1)
           (typepred "i!1")
           (expand "comp_pos")
           (propax))))))
      ("2"
       (hide -2)
       (expand "SP?")
       (skosimp)
       (expand "comp_pos")
       (expand "finseq_appl")
       (inst?)
       (lemma "replace_compose_pos")
       (inst?)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1"
       (hide -2)
       (expand* complement_pos sub_pos)
       (lift-if)
       (lift-if)
       (assert)
       (expand empty_seq)
       (propax))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 p p1)
       (rewrite rest_of_PP_is_PP)
       (expand complement_pos 2)
       (expand sub_pos 2)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (expand add_first 2 (1 2 3 4 5 7 8 12 14 15 16 17 18))
       (expand insert?)
       (expand empty_seq 2)
       (rewrite rest_add_first)
       (("1"
         (assert)
         (prop)
         (("1" (assert)) ("2" (assert)) ("3" (assert))
          ("4"
           (expand nonempty? -1)
           (expand* empty? member)
           (skosimp)
           (expand complement_pos_set -1 1)
           (expand emptyset)
           (prop)
           (typepred "choose(complement_pos_set(p, x`seq(0)))")
           (expand complement_pos_set -1 1)
           (expand emptyset)
           (prop)
           (replaces -4)
           (expand <= 3)
           (inst 3 x!1)
           (rewrite o_assoc))
          ("5"
           (expand nonempty? -2)
           (expand* empty? member)
           (skosimp)
           (expand complement_pos_set -2 1)
           (expand emptyset)
           (prop)
           (typepred "choose(complement_pos_set(p, x`seq(0)))")
           (expand complement_pos_set -1 1)
           (expand emptyset)
           (prop)
           (replace -5 -2 rl)
           (lemma equal_prefix[posnat])
           (inst -1 p "choose(complement_pos_set(p, x`seq(0)))" p1)
           (assert))
          ("6"
           (expand nonempty? 2)
           (expand* empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -2 p3)
           (expand complement_pos_set 2 1)
           (expand emptyset)
           (prop)
           (("1"
             (typepred "choose(complement_pos_set(p, x`seq(0)))")
             (expand complement_pos_set -1 1)
             (expand emptyset)
             (prop)
             (replace -2 -4)
             (lemma o_assoc[posnat])
             (inst -1 p p1 p3)
             (replace -1 -5 rl)
             (lemma equal_prefix[posnat])
             (inst -1 p "choose(complement_pos_set(p, x`seq(0)))"
              "p1 o p3")
             (assert))
            ("2"
             (typepred "choose(complement_pos_set(p, x`seq(0)))")
             (expand complement_pos_set -1 1)
             (expand emptyset)
             (prop)
             (expand <= 2)
             (inst 2 p3)
             (lemma o_assoc[posnat])
             (inst -1 p p1 p3)
             (replace -1 -4 rl)
             (lemma equal_prefix[posnat])
             (inst -1 p "choose(complement_pos_set(p, x`seq(0)))"
              "p1 o p3")
             (assert))
            ("3"
             (typepred "choose(complement_pos_set(p, x`seq(0)))")
             (expand complement_pos_set -1 1)
             (expand emptyset)
             (prop)
             (assert))))
          ("7"
           (expand* nonempty? empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -3 "p1 o p3")
           (expand complement_pos_set 2)
           (expand emptyset)
           (prop)
           (("1" (rewrite o_assoc))
            ("2" (expand <= 1) (inst 1 "p1 o p3") (rewrite o_assoc))
            ("3"
             (case "p1`length=0")
             (("1"
               (rewrite empty_0 -1)
               (replaces -1)
               (case "p3`length=0")
               (("1"
                 (rewrite empty_0 -1)
                 (replaces -1)
                 (rewrite seq_o_empty))
                ("2" (rewrite seq_o_empty))))
              ("2" (expand o -2) (decompose-equality -2) (assert))))))
          ("8"
           (expand complement_pos -2 1)
           (lift-if)
           (expand empty_seq)
           (assert))
          ("9"
           (expand complement_pos -3 1)
           (lift-if)
           (expand empty_seq)
           (assert))
          ("10"
           (expand nonempty? 4)
           (expand* empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -3 "p1 o p3")
           (expand complement_pos_set 4)
           (expand emptyset)
           (rewrite o_assoc)
           (prop)
           (("1" (expand <= 1) (inst 1 "p1 o p3") (rewrite o_assoc))
            ("2"
             (case "p1`length=0")
             (("1"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty))
              ("2" (expand o -2) (decompose-equality -2) (assert))))))
          ("11"
           (expand complement_pos -2 1)
           (assert)
           (expand add_first -2)
           (expand insert?)
           (propax))
          ("12"
           (expand complement_pos -3 1)
           (assert)
           (expand* add_first insert?))
          ("13"
           (expand nonempty? 5)
           (expand* empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -2 "p1 o p3")
           (expand complement_pos_set 5)
           (expand emptyset)
           (rewrite o_assoc)
           (prop)
           (("1" (expand <= 1) (inst 1 "p1 o p3") (rewrite o_assoc))
            ("2"
             (case "p1`length=0")
             (("1"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty))
              ("2" (expand o -2) (decompose-equality -2) (assert))))))
          ("14" (expand complement_pos -1 1) (assert))
          ("15" (expand complement_pos -2 1) (assert))))
        ("2"
         (prop)
         (("1"
           (expand* nonempty? empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -3 "p1 o p3")
           (expand complement_pos_set 2)
           (expand emptyset)
           (prop)
           (("1" (rewrite o_assoc))
            ("2" (expand <= 1) (inst 1 "p1 o p3") (rewrite o_assoc))
            ("3"
             (case "p1`length=0")
             (("1"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty))
              ("2" (expand o -2) (decompose-equality -2) (assert))))))
          ("2"
           (expand complement_pos -2 1)
           (assert)
           (expand empty_seq)
           (propax))
          ("3"
           (expand complement_pos -3 1)
           (assert)
           (expand empty_seq)
           (propax))
          ("4"
           (expand nonempty? 4)
           (expand* empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -3 "p1 o p3")
           (expand complement_pos_set 4)
           (expand emptyset)
           (prop)
           (("1" (rewrite o_assoc))
            ("2" (expand <= 1) (inst 1 "p1 o p3") (rewrite o_assoc))
            ("3"
             (case "p1`length=0")
             (("1"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty))
              ("2" (expand o -2) (decompose-equality -2) (assert))))))
          ("5"
           (expand complement_pos -2 1)
           (assert)
           (expand* add_first insert?))
          ("6"
           (expand complement_pos -3 1)
           (assert)
           (expand* add_first insert?))
          ("7"
           (expand nonempty? 5)
           (expand* empty? member)
           (expand <= -1)
           (skolem -1 p3)
           (inst -2 "p1 o p3")
           (expand complement_pos_set 5)
           (expand emptyset)
           (rewrite o_assoc)
           (prop)
           (("1" (expand <= 1) (inst 1 "p1 o p3") (rewrite o_assoc))
            ("2"
             (case "p1`length=0")
             (("1"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty))
              ("2" (expand o -2) (decompose-equality -2) (assert))))))
          ("8" (expand complement_pos -1 1) (assert))
          ("9" (expand complement_pos -2 1) (assert))))))))
    ("2" (skeep) (rewrite complement_pos_is_PP))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" fsp1)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (hide -2)
     (skeep)
     (typepred i)
     (expand Pos_Over -1)
     (lift-if)
     (assert)
     (expand empty_seq -1)
     (assert))
    ("2"
     (skeep 2)
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 fsp2)
     (rewrite rest_of_PP_is_PP)
     (assert)
     (case i=0)
     (("1"
       (replaces -1)
       (expand Pos_Over 2)
       (expand add_first 2 3)
       (expand insert?)
       (lift-if)
       (prop)
       (("1"
         (expand Pos_Over 3)
         (assert)
         (expand add_first 3)
         (expand insert?)
         (lemma sub_pos_is_under)
         (inst -1 fsp2 "x`seq(0)" "sub_pos(fsp2, x`seq(0))`seq(0)")
         (prop)
         (("1"
           (lemma sub_pos_is_sub_seq)
           (inst -1 fsp2 "x`seq(0)")
           (assert)
           (expand* subseq finseq_appl)
           (inst -1 0)
           (expand* member_seq finseq_appl)
           (skosimp)
           (inst 4 i!1)
           (assert))
          ("2" (expand* member_seq finseq_appl) (inst 1 0))))
        ("2"
         (expand Pos_Over 5)
         (assert)
         (inst -1 0)
         (split)
         (("1" (propax)) ("2" (skosimp) (inst 6 j!1) (assert))))))
      ("2"
       (expand Pos_Over (3 4))
       (lift-if)
       (prop)
       (("1"
         (assert)
         (expand add_first 1 2)
         (expand add_first 4)
         (expand insert?)
         (expand finseq_appl)
         (inst -2 i-1)
         (split)
         (("1" (propax)) ("2" (skosimp) (inst 5 j!1) (assert))))
        ("2"
         (assert)
         (expand add_first 1 2)
         (expand add_first 4)
         (expand* insert? finseq_appl)
         (inst -2 i-1)
         (split)
         (("1" (propax)) ("2" (skosimp) (inst 5 j!1) (assert))))
        ("3"
         (assert)
         (inst -1 i)
         (split)
         (("1" (propax)) ("2" (skosimp) (inst 7 j!1) (assert))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" fsp1)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1"
     (skeep)
     (typepred i)
     (expand Pos_Equal -1)
     (expand empty_seq)
     (assert))
    ("2"
     (skeep 2)
     (expand Pos_Equal 2)
     (assert)
     (case "member_seq(x`seq(0), fsp2)")
     (("1"
       (copy -1)
       (expand member_seq -2)
       (expand finseq_appl)
       (skosimp)
       (case "i=0")
       (("1"
         (inst 2 i!1)
         (assert)
         (expand* add_first insert? finseq_appl))
        ("2"
         (typepred i)
         (expand Pos_Equal -1)
         (assert)
         (expand* add_first insert?)
         (inst -4 "rest(x)")
         (rewrite length_rest)
         (inst -4 fsp2)
         (rewrite rest_of_PP_is_PP)
         (assert)
         (inst -4 i-1)
         (skosimp)
         (expand finseq_appl)
         (inst 3 j!1))))
      ("2"
       (assert)
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 fsp2)
       (rewrite rest_of_PP_is_PP)
       (assert)
       (typepred i)
       (expand Pos_Equal -1)
       (inst -2 i))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" fsp1)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1" (hide -2) (expand* Pos_Equal empty_seq) (expand PP? 1) (assert))
    ("2"
     (expand Pos_Equal 2)
     (assert)
     (prop)
     (("1"
       (rewrite add_first_parallel_pos_to_PP_is_PP)
       (("1"
         (hide 2)
         (skeep)
         (expand finseq_appl)
         (lemma Pos_Equal_is_sub_seq)
         (inst -1 "rest(x)" fsp2)
         (rewrite rest_of_PP_is_PP)
         (assert)
         (expand* subseq finseq_appl)
         (inst -1 i)
         (expand member_seq -1)
         (skosimp)
         (expand finseq_appl)
         (typepred i!1)
         (expand rest -1)
         (expand rest -2 2)
         (expand* ^ min)
         (expand empty_seq -1)
         (lift-if)
         (assert)
         (prop)
         (expand PP? -5)
         (expand finseq_appl)
         (assert)
         (inst -5 1+i!1 0)
         (assert))
        ("2"
         (inst -2 "rest(x)")
         (rewrite length_rest)
         (inst -2 fsp2)
         (rewrite rest_of_PP_is_PP)
         (assert))))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 fsp2)
       (rewrite rest_of_PP_is_PP)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand o)
   (expand PP? 1)
   (expand finseq_appl)
   (prop)
   (skeep 2)
   (lift-if)
   (lift-if)
   (lift-if)
   (lift-if)
   (assert)
   (prop)
   (("1"
     (lemma Pos_Over_is_PP)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand PP? -1)
     (expand finseq_appl)
     (inst -1 i j)
     (assert))
    ("2"
     (lemma Pos_Over_is_sub_seq)
     (inst-cp -1 fsp2 fsp1)
     (inst -1 fsp1 fsp2)
     (assert)
     (lemma Pos_Over_character)
     (inst-cp -1 fsp2 fsp1)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1 i)
     (inst -3 i)
     (inst -2 "j - Pos_Over(fsp1, fsp2)`length")
     (inst -4 "j - Pos_Over(fsp1, fsp2)`length")
     (assert)
     (expand* member_seq finseq_appl)
     (skosimp*)
     (split -1)
     (("1"
       (hide -2)
       (expand* add_first insert?)
       (expand PP? -1)
       (expand finseq_appl)
       (inst -1 0 i!2+1)
       (assert))
      ("2"
       (split -2)
       (("1"
         (expand* add_first insert?)
         (expand PP? -1)
         (expand finseq_appl)
         (inst -1 i!1+1 0)
         (assert))
        ("2"
         (skosimp*)
         (expand parallel 4)
         (split)
         (("1"
           (replaces -4)
           (replaces -4)
           (expand PP? -7)
           (prop)
           (("1"
             (expand <=)
             (skosimp*)
             (replaces -2)
             (case "p1!1`length=0")
             (("1"
               (rewrite empty_0)
               (replaces -1)
               (rewrite seq_o_empty)
               (assert))
              ("2" (expand o -2) (decompose-equality) (assert))))
            ("2"
             (expand finseq_appl)
             (inst -1 i!1 j!1)
             (prop)
             (("1"
               (expand parallel)
               (flatten)
               (expand <= (-1 -2 1))
               (skosimp*)
               (replaces -1)
               (inst 1 "p1!1 o p1!2")
               (rewrite o_assoc))
              ("2"
               (expand <=)
               (skosimp*)
               (replaces -2)
               (case "p1!1`length=0")
               (("1"
                 (rewrite empty_0)
                 (replaces -1)
                 (rewrite seq_o_empty)
                 (assert))
                ("2"
                 (expand o -2)
                 (decompose-equality -2)
                 (assert))))))))
          ("2"
           (replaces -4)
           (replaces -4)
           (case "i!2 = j!2")
           (("1"
             (expand <=)
             (skosimp*)
             (replaces -2)
             (case " p1!1`length=0")
             (("1"
               (rewrite empty_0)
               (replaces -1)
               (rewrite seq_o_empty)
               (assert))
              ("2" (expand o -3) (decompose-equality -3) (assert))))
            ("2"
             (expand PP? -8)
             (expand finseq_appl)
             (assert)
             (inst -8 i!2 j!2)
             (assert)
             (expand parallel)
             (flatten)
             (expand <= (-1 -3 7))
             (skosimp*)
             (replaces -1)
             (inst 7 "p1!1 o p1!2")
             (rewrite o_assoc))))))))))
    ("3"
     (lemma Pos_Equal_is_sub_seq)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length -
                           Pos_Over(fsp2, fsp1)`length
                           + j")
     (lemma Pos_Over_is_sub_seq)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1 i)
     (expand* member_seq finseq_appl)
     (skosimp*)
     (lemma Pos_Over_character)
     (inst -1 fsp1 fsp2)
     (lemma Pos_Equal_character)
     (inst -1 fsp1 fsp2)
     (assert)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length -
                           Pos_Over(fsp2, fsp1)`length
                           + j")
     (inst -2 i)
     (split)
     (("1"
       (expand* add_first insert?)
       (expand PP? -1)
       (expand finseq_appl)
       (skosimp)
       (assert)
       (inst -1 0 j!1+1)
       (assert))
      ("2"
       (skosimp*)
       (expand parallel)
       (split)
       (("1"
         (replaces -4)
         (replaces -4)
         (case i!1=i!2)
         (("1"
           (replaces -1)
           (replaces -3)
           (case j!2=j!1)
           (("1" (assert))
            ("2"
             (expand PP? -6)
             (assert)
             (inst -6 j!2 j!1)
             (expand finseq_appl)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -6)
           (assert)
           (expand finseq_appl)
           (inst -6 i!1 i!2)
           (assert))))
        ("2"
         (replaces -4)
         (replaces -4)
         (case i!2=i!1)
         (("1"
           (replaces -1)
           (replaces -3)
           (case j!2=j!1)
           (("1" (assert))
            ("2"
             (expand PP? -6)
             (expand finseq_appl)
             (assert)
             (inst -6 j!2 j!1)
             (assert)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -6)
           (expand finseq_appl)
           (assert)
           (inst -6 i!2 i!1)
           (assert)
           (expand parallel)
           (propax))))))))
    ("4"
     (lemma Pos_Over_is_sub_seq)
     (inst-cp -1 fsp2 fsp1)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1 j)
     (inst -2 "i - Pos_Over(fsp1, fsp2)`length")
     (expand* member_seq finseq_appl)
     (skosimp*)
     (lemma Pos_Over_character)
     (inst-cp -1 fsp2 fsp1)
     (inst -1 fsp1 fsp2)
     (assert)
     (inst -1 j)
     (inst -2 "i - Pos_Over(fsp1, fsp2)`length")
     (split -1)
     (("1"
       (hide -2)
       (expand* add_first insert?)
       (expand PP? -1)
       (expand finseq_appl)
       (inst -1 i!2+1 0)
       (assert))
      ("2"
       (split)
       (("1"
         (expand* add_first insert?)
         (expand PP? -1)
         (expand finseq_appl)
         (inst -1 0 i!1+1)
         (assert))
        ("2"
         (skosimp*)
         (replaces -3)
         (replaces -3)
         (expand parallel)
         (split)
         (("1"
           (case "i!2=j!2")
           (("1"
             (replaces -1)
             (expand <=)
             (skosimp*)
             (replaces -3)
             (case "p1!3`length=0")
             (("1" (rewrite empty_0) (replaces -1) (rewrite seq_o_empty))
              ("2" (expand o -1) (decompose-equality -1) (assert))))
            ("2"
             (expand PP? -8)
             (assert)
             (inst -8 i!2 j!2)
             (expand finseq_appl)
             (expand parallel)
             (flatten)
             (expand <= (-1 -3 7))
             (skosimp*)
             (replaces -1)
             (inst 7 "p1!1 o p1!2")
             (rewrite o_assoc))))
          ("2"
           (case "i!1=j!1")
           (("1"
             (replaces -1)
             (expand <=)
             (skosimp*)
             (replaces -2)
             (case "p1!2`length=0")
             (("1" (rewrite empty_0) (replaces -1) (rewrite seq_o_empty))
              ("2" (expand o -1) (decompose-equality -1) (assert))))
            ("2"
             (expand PP? -7)
             (assert)
             (inst -7 i!1 j!1)
             (expand finseq_appl)
             (expand parallel)
             (flatten)
             (expand <= (-1 -2 7))
             (skosimp*)
             (replaces -1)
             (inst 7 "p1!1 o p1!2")
             (rewrite o_assoc))))))))))
    ("5"
     (lemma Pos_Over_is_PP)
     (inst -1 fsp2 fsp1)
     (assert)
     (expand PP? -1)
     (expand finseq_appl)
     (inst -1 "i - Pos_Over(fsp1, fsp2)`length"
      "j - Pos_Over(fsp1, fsp2)`length")
     (assert))
    ("6"
     (lemma Pos_Equal_is_sub_seq)
     (inst -1 fsp1 fsp2)
     (lemma Pos_Over_is_sub_seq)
     (inst -1 fsp2 fsp1)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1 "i - Pos_Over(fsp1, fsp2)`length")
     (inst -2
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + j")
     (expand* member_seq finseq_appl)
     (skosimp*)
     (lemma Pos_Equal_character)
     (lemma Pos_Over_character)
     (inst -1 fsp2 fsp1)
     (inst -2 fsp1 fsp2)
     (assert)
     (inst -1 "i - Pos_Over(fsp1, fsp2)`length")
     (inst -2
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + j")
     (skosimp)
     (split)
     (("1"
       (expand* add_first insert?)
       (expand PP? -1)
       (expand finseq_appl)
       (inst -1 0 i!2+1)
       (assert))
      ("2"
       (skosimp)
       (replaces -3)
       (replaces -3)
       (expand parallel)
       (split)
       (("1"
         (case "i!1=j!1")
         (("1"
           (replaces -1)
           (expand <=)
           (skosimp*)
           (case "i!2=j!2")
           (("1" (replaces -1) (replaces -3))
            ("2"
             (expand PP? -5)
             (assert)
             (inst -5 i!2 j!2)
             (expand finseq_appl)
             (expand parallel -5)
             (flatten)
             (expand <= 7)
             (replace -3 -2 rl)
             (inst 7 p1!2))))
          ("2"
           (expand PP? -6)
           (assert)
           (inst -6 i!1 j!1)
           (expand finseq_appl)
           (propax))))
        ("2"
         (case "i!1=j!1")
         (("1"
           (replaces -1)
           (case "i!2=j!2")
           (("1"
             (replaces -1)
             (expand <=)
             (skosimp*)
             (replaces -1)
             (case "p1!1`length=0")
             (("1" (rewrite empty_0) (replaces -1) (rewrite seq_o_empty))
              ("2" (expand o -1) (decompose-equality -1) (assert))))
            ("2"
             (expand PP? -5)
             (assert)
             (inst -5 i!2 j!2)
             (expand finseq_appl)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -6)
           (assert)
           (inst -6 i!1 j!1)
           (expand finseq_appl)
           (propax))))))))
    ("7"
     (lemma Pos_Over_is_sub_seq)
     (inst -1 fsp1 fsp2)
     (lemma Pos_Equal_is_sub_seq)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + i")
     (inst -2 j)
     (expand* member_seq finseq_appl)
     (skosimp*)
     (lemma Pos_Over_character)
     (inst -1 fsp1 fsp2)
     (lemma Pos_Equal_character)
     (inst -1 fsp1 fsp2)
     (assert)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + i")
     (inst -2 j)
     (skosimp)
     (split)
     (("1"
       (expand* add_first insert?)
       (expand PP? -1)
       (expand finseq_appl)
       (inst -1 j!1+1 0)
       (assert))
      ("2"
       (skosimp)
       (replaces -3)
       (replaces -3)
       (expand parallel)
       (split)
       (("1"
         (case "i!1=i!2")
         (("1"
           (replaces -1)
           (case "j!1=j!2")
           (("1" (replaces -1))
            ("2"
             (replaces -3)
             (expand PP? -6)
             (assert)
             (inst -6 j!1 j!2)
             (expand finseq_appl)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -6)
           (assert)
           (inst -6 i!1 i!2)
           (expand finseq_appl)
           (propax))))
        ("2"
         (case "i!1=i!2")
         (("1"
           (case "j!1=j!2")
           (("1" (assert))
            ("2"
             (expand PP? -8)
             (assert)
             (inst -8 j!1 j!2)
             (expand finseq_appl)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -6)
           (assert)
           (inst -6 i!1 i!2)
           (expand finseq_appl)
           (propax))))))))
    ("8"
     (lemma Pos_Over_is_sub_seq)
     (lemma Pos_Equal_is_sub_seq)
     (inst -1 fsp1 fsp2)
     (inst -2 fsp2 fsp1)
     (assert)
     (expand* subseq finseq_appl)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + i")
     (inst -2 "j - Pos_Over(fsp1, fsp2)`length")
     (expand* member_seq finseq_appl)
     (skosimp*)
     (lemma Pos_Over_character)
     (lemma Pos_Equal_character)
     (inst -1 fsp1 fsp2)
     (inst -2 fsp2 fsp1)
     (assert)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + i")
     (inst -2 "j - Pos_Over(fsp1, fsp2)`length")
     (skosimp)
     (split)
     (("1"
       (expand* add_first insert?)
       (expand PP? -1)
       (expand finseq_appl)
       (inst -1 i!1+1 0)
       (assert))
      ("2"
       (skosimp)
       (replaces -3)
       (replaces -3)
       (expand parallel)
       (split)
       (("1"
         (case i!1=j!2)
         (("1"
           (case "i!2=j!1")
           (("1" (assert))
            ("2"
             (expand PP? -7)
             (assert)
             (inst -7 i!2 j!1)
             (expand finseq_appl)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -5)
           (assert)
           (inst -5 i!1 j!2)
           (expand finseq_appl)
           (expand parallel)
           (flatten)
           (expand <= (-1 -2 7))
           (skosimp*)
           (replaces -1)
           (inst 7 "p1!1 o p1!2")
           (rewrite o_assoc))))
        ("2"
         (case i!2=j!1)
         (("1"
           (case "j!2=i!1")
           (("1" (assert))
            ("2"
             (expand PP? -6)
             (assert)
             (inst -6 j!2 i!1)
             (expand finseq_appl)
             (expand parallel)
             (propax))))
          ("2"
           (expand PP? -6)
           (assert)
           (inst -6 i!2 j!1)
           (expand finseq_appl)
           (expand parallel)
           (propax))))))))
    ("9"
     (lemma Pos_Equal_is_PP)
     (inst -1 fsp1 fsp2)
     (assert)
     (expand PP? -1)
     (expand finseq_appl)
     (inst -1
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + i"
      "-1 * Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length + j")
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand* SPP? SP? finseq_appl)
   (flatten)
   (skeep)
   (expand o 1)
   (expand* comp_pos finseq_appl)
   (prop)
   (("1" (inst -3 0) (inst -4 i) (rewrite replace_compose_pos))
    ("2"
     (typepred i)
     (expand* o comp_pos finseq_appl rest ^ min)
     (expand empty_seq -1)
     (lift-if)
     (assert)
     (prop)
     (inst-cp -3 "1 - fsp1`length + i")
     (inst -3 0)
     (rewrite replace_preserv_parallel_pos)
     (expand* PP? finseq_appl)
     (inst -2 0 "1 - fsp1`length + i")
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand* rest ^ min)
   (expand empty_seq)
   (expand* o comp_pos finseq_appl)
   (expand* PP? finseq_appl)
   (lift-if)
   (assert)
   (prop)
   (("1" (skeep 2) (lift-if) (assert))
    ("2"
     (skeep 2)
     (typepred (i j))
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (inst -4 i j)
     (assert)
     (rewrite comp_preservs_parallel_pos))
    ("3"
     (skeep 2)
     (typepred (i j))
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (inst -4 i j)
     (assert)
     (rewrite comp_preservs_parallel_pos))
    ("4"
     (skeep 2)
     (typepred (i j))
     (lift-if)
     (lift-if)
     (lift-if)
     (assert))
    ("5"
     (skeep 2)
     (typepred (i j))
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (prop)
     (("1"
       (assert)
       (inst -5 0 "1 - fsp1`length + j")
       (assert)
       (rewrite comp_preservs_parallel_pos2))
      ("2"
       (rewrite parallel_comm)
       (inst -5 0 "1 - fsp1`length + i")
       (assert)
       (rewrite comp_preservs_parallel_pos2))
      ("3"
       (inst -4 "1 - fsp1`length + i" "1 - fsp1`length + j")
       (assert))))
    ("6" (skeep 2) (lift-if) (lift-if) (lift-if) (assert))
    ("7" (skeep 2) (lift-if) (lift-if) (lift-if) (assert))
    ("8"
     (skeep 2)
     (typepred (i j))
     (lift-if)
     (lift-if)
     (lift-if)
     (assert)
     (prop)
     (("1" (inst -5 i j) (assert) (rewrite comp_preservs_parallel_pos))
      ("2"
       (inst -5 0 "1 - fsp1`length + j")
       (("1" (rewrite comp_preservs_parallel_pos2)) ("2" (assert))))
      ("3"
       (rewrite parallel_comm)
       (inst -5 0 "1 - fsp1`length + i")
       (assert)
       (rewrite comp_preservs_parallel_pos2))
      ("4"
       (inst -4 "1 - fsp1`length + i" "1 - fsp1`length + j")
       (("1" (assert)) ("2" (assert)) ("3" (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand SPP?)
   (flatten)
   (rewrite comp_pos_in_PP_preservs_PP)
   (rewrite comp_pos_in_SP_preservs_SP_in_replace)
   (expand SPP?)
   (propax))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand SPP?)
   (flatten)
   (split)
   (("1"
     (hide -1 -2 -5 -7)
     (expand* add_first insert? o comp_pos finseq_appl)
     (expand* PP? finseq_appl)
     (assert)
     (prop)
     (("1" (skeep 2) (typepred (i j)) (assert))
      ("2"
       (skeep 3)
       (typepred (i j))
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (prop)
       (("1"
         (inst -4 0 "j - fsp1`length + 1")
         (assert)
         (rewrite comp_preservs_parallel_pos2))
        ("2"
         (rewrite parallel_comm)
         (inst -3 0 "i - fsp1`length + 1")
         (assert)
         (rewrite comp_preservs_parallel_pos2))))
      ("3" (assert))
      ("4"
       (skeep 4)
       (typepred (i j))
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (prop)
       (("1"
         (inst -4 0 "j - fsp1`length + 1")
         (assert)
         (rewrite comp_preservs_parallel_pos2))
        ("2"
         (rewrite parallel_comm)
         (inst -4 0 "i - fsp1`length + 1")
         (assert)
         (rewrite comp_preservs_parallel_pos2))
        ("3"
         (inst -4 "i - fsp1`length" "j - fsp1`length")
         (("1" (assert)) ("2" (assert)) ("3" (assert))))))
      ("5"
       (skeep 3)
       (typepred (i j))
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (inst -5 i j)
       (assert)
       (rewrite comp_preservs_parallel_pos))
      ("6"
       (skeep 4)
       (typepred (i j))
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (prop)
       (("1" (inst -7 i j) (rewrite comp_preservs_parallel_pos))
        ("2"
         (inst -4 0 "j - fsp1`length + 1")
         (("1" (assert) (rewrite comp_preservs_parallel_pos2))
          ("2" (assert))))
        ("3"
         (rewrite parallel_comm)
         (inst -3 0 "i - fsp1`length + 1")
         (assert)
         (rewrite comp_preservs_parallel_pos2))))
      ("7" (assert))
      ("8"
       (skeep 5)
       (typepred (i j))
       (lift-if)
       (lift-if)
       (lift-if)
       (assert)
       (prop)
       (("1" (inst -7 i j) (assert) (rewrite comp_preservs_parallel_pos))
        ("2"
         (inst -4 0 "j - fsp1`length + 1")
         (("1" (assert) (rewrite comp_preservs_parallel_pos2))
          ("2" (assert))))
        ("3"
         (rewrite parallel_comm)
         (inst -4 0 "i - fsp1`length + 1")
         (assert)
         (rewrite comp_preservs_parallel_pos2))
        ("4"
         (inst -4 "i - fsp1`length" "j - fsp1`length")
         (("1" (assert)) ("2" (assert)) ("3" (assert))))))))
    ("2"
     (hide -4 -6)
     (expand* SP? finseq_appl)
     (skeep)
     (typepred i)
     (expand* o comp_pos finseq_appl)
     (prop)
     (("1"
       (lemma replace_par_pos_preservs_PP)
       (inst -1 fsp fst t)
       (expand* SPP? SP? finseq_appl)
       (assert)
       (prop)
       (inst -1 0)
       (lemma replace_par_pos_subterm)
       (inst -1 fsp fst t)
       (expand* SPP? SP? finseq_appl)
       (prop)
       (inst -1 0)
       (inst -8 i)
       (rewrite pos_o_term))
      ("2" (inst -6 "i - fsp1`length") (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand reflexive?)
   (skeep)
   (expand* parallel_reduction? parallel_reduction_fix?)
   (inst 1 "empty_seq" "empty_seq" "empty_seq")
   (("1"
     (expand empty_seq)
     (split)
     (("1"
       (expand* subtermsOF sigma_lhs)
       (expand empty_seq)
       (decompose-equality)
       (skeep))
      ("2" (expand replace_par_pos) (propax))))
    ("2" (expand empty_seq) (expand member) (skeep))
    ("3" (expand empty_seq) (expand* SPP? SP? PP?) (skeep))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand reduction_fix?)
   (skosimp*)
   (lemma ntCP_lemma_aux1)
   (inst -1 sigma!1 sigma!2 E empty_seq e!1 e!2)
   (expand empty_seq -1)
   (expand subtermOF -1)
   (expand replaceTerm -1)
   (prop)
   (("1" (skosimp) (expand Ambiguous?) (inst 1 t1!1 t2!1))
    ("2"
     (expand positionsOF 1)
     (expand only_empty_seq)
     (lift-if)
     (assert)
     (expand empty_seq 1)
     (expand union)
     (expand member)
     (propax))
    ("3" (typepred e!1) (expand rewrite_rule?) (expand lhs -3) (assert))
    ("4" (assert))
    ("5"
     (assert)
     (lemma same_substitution)
     (inst -1 sigma!1 sigma!2 "lhs(e!2)")
     (assert)
     (replaces -2)
     (lemma same_term)
     (inst -1 sigma!1 sigma!2 "rhs(e!2)")
     (prop)
     (("1" (assert))
      ("2"
       (typepred e!2)
       (expand rewrite_rule?)
       (flatten)
       (expand subset?)
       (expand* rhs lhs)
       (skeep)
       (inst -1 x)
       (inst -4 x)
       (assert))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1"
       (expand finseq_appl)
       (inst 1 empty_seq)
       (("1"
         (split)
         (("1"
           (expand replace_par_pos 1)
           (assert)
           (expand parallel_reduction_fix? 1)
           (inst 1 empty_seq empty_seq)
           (("1"
             (expand empty_seq)
             (split)
             (("1"
               (expand* subtermsOF sigma_lhs)
               (expand empty_seq)
               (decompose-equality)
               (skeep))
              ("2" (expand replace_par_pos 1) (propax))))
            ("2" (expand empty_seq) (expand member) (skeep))))
          ("2"
           (skeep)
           (expand empty_seq 1)
           (expand add_first 1)
           (expand insert?)
           (expand PP? 1)
           (propax))))
        ("2"
         (expand empty_seq 1)
         (expand SPP? 1)
         (expand PP? 1)
         (expand* SP? finseq_appl)
         (skeep))))
      ("2"
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (expand replace_par_pos 2)
       (assert)
       (expand finseq_appl)
       (inst -1 E "rest(fst1)" "rest(fst2)"
        "replaceTerm(t, fst1`seq(0), x`seq(0))")
       (("1"
         (prop)
         (("1"
           (skosimp)
           (inst -6 0)
           (expand parallel_reduction? -6)
           (skosimp)
           (inst 2 "comp_pos(x`seq(0),fsp!1) o fsq!1")
           (("1"
             (split)
             (("1"
               (expand parallel_reduction_fix?)
               (skosimp*)
               (inst 1 "fse!2 o fse!1" "fss!2 o fss!1")
               (("1"
                 (expand o 1 (1 2 3 4))
                 (rewrite comp_pos_preservs_length)
                 (assert)
                 (prop)
                 (("1"
                   (decompose-equality 1)
                   (("1"
                     (expand subtermsOF 1)
                     (expand sigma_lhs 1)
                     (expand o 1)
                     (expand empty_seq)
                     (expand comp_pos 1)
                     (lift-if)
                     (prop)
                     (("1" (assert)) ("2" (assert))))
                    ("2"
                     (decompose-equality 1)
                     (expand subtermsOF 1)
                     (expand sigma_lhs 1)
                     (expand finseq_appl)
                     (lift-if)
                     (expand empty_seq)
                     (typepred x!1)
                     (expand subtermsOF -1)
                     (expand o -1)
                     (expand comp_pos -1)
                     (expand o 1 1)
                     (assert)
                     (expand o 1)
                     (lift-if)
                     (lift-if)
                     (lift-if)
                     (expand comp_pos 1)
                     (expand finseq_appl)
                     (prop)
                     (("1"
                       (expand subtermsOF -13)
                       (expand sigma_lhs -13)
                       (expand empty_seq)
                       (assert)
                       (decompose-equality -13)
                       (("1"
                         (inst -1 x!1)
                         (expand finseq_appl)
                         (rewrite replace_par_pos_preservs_subterm)
                         (("1"
                           (rewrite replace_embedding)
                           (("1"
                             (hide-all-but (-9 1))
                             (expand* SPP? SP? finseq_appl)
                             (flatten)
                             (inst -2 0))
                            ("2"
                             (hide-all-but 1)
                             (typepred fsp!1)
                             (expand* SPP? SP? finseq_appl)
                             (flatten)
                             (inst -2 x!1))))
                          ("2"
                           (expand SPP? 1)
                           (split)
                           (("1"
                             (rewrite add_first_parallel_pos_to_PP_is_PP
                              1)
                             (("1"
                               (expand finseq_appl)
                               (skosimp)
                               (typepred i!1)
                               (expand rest (-1 1))
                               (expand* ^ min)
                               (expand empty_seq -1)
                               (lift-if)
                               (assert)
                               (prop)
                               (hide -7 -8)
                               (expand SPP? -8)
                               (expand PP? -8)
                               (expand finseq_appl)
                               (assert)
                               (flatten)
                               (inst -8 0 1+i!1)
                               (assert)
                               (rewrite parallel_comm 3)
                               (rewrite comp_preservs_parallel_pos2))
                              ("2"
                               (rewrite rest_of_PP_is_PP)
                               (expand SPP? -9)
                               (propax))))
                            ("2"
                             (hide -6 -7)
                             (rewrite add_first_parallel_pos_to_SP_is_SP)
                             (("1"
                               (typepred fsp!1)
                               (expand SPP? (-1 -8))
                               (flatten)
                               (hide 2)
                               (expand* SP? finseq_appl)
                               (inst -2 x!1)
                               (inst -10 0)
                               (rewrite replace_compose_pos))
                              ("2"
                               (hide 2)
                               (expand SPP? -7)
                               (flatten)
                               (expand* SP? finseq_appl)
                               (skosimp)
                               (typepred i!1)
                               (expand rest (-1 1))
                               (expand* ^ min)
                               (expand empty_seq -1)
                               (lift-if)
                               (assert)
                               (prop)
                               (inst-cp -9 1+i!1)
                               (inst -9 0)
                               (expand PP? -8)
                               (expand finseq_appl)
                               (assert)
                               (rewrite replace_preserv_parallel_pos 3)
                               (inst -8 0 1+i!1)
                               (assert))))))
                          ("3" (hide-all-but (-10 1 3)) (grind))))
                        ("2"
                         (hide-all-but 1)
                         (typepred fsp!1)
                         (expand* SPP? SP? finseq_appl)
                         (flatten)
                         (inst -2 x!2))))
                      ("2"
                       (hide -5)
                       (expand subtermsOF -4)
                       (expand sigma_lhs -4)
                       (expand empty_seq)
                       (expand finseq_appl)
                       (lift-if)
                       (assert)
                       (decompose-equality -4)
                       (("1" (inst -1 "x!1 - fss!2`length") (assert))
                        ("2"
                         (hide-all-but 1)
                         (typepred fsq!1)
                         (expand* SPP? SP? finseq_appl)
                         (flatten)
                         (inst -2 x1!1))))))))
                  ("2"
                   (rewrite sigma_rhs_o 1)
                   (rewrite replace_par_pos_comp_commute 1)
                   (("1"
                     (replaces -12)
                     (rewrite replace_replace_par_pos 1)
                     (("1"
                       (rewrite replace_par_pos_comp 1)
                       (("1"
                         (lemma replace_par_pos_comp)
                         (inst -1 "comp_pos(x`seq(0), fsp!1)" "rest(x)"
                          "sigma_rhs(fss!2, fse!2)" "rest(fst2)"
                          "replaceTerm(t, fst1`seq(0), x`seq(0))")
                         (prop)
                         (("1"
                           (replace -1 1 rl)
                           (hide -1)
                           (rewrite replace_par_pos_comp_commute 1)
                           (("1"
                             (rewrite replace_par_pos_comp 1)
                             (("1" (assert))
                              ("2"
                               (hide -4 2)
                               (rewrite comp_SPP_commute)
                               (rewrite
                                comp_pos_in_SPP_preservs_SPP_in_replace))
                              ("3" (hide-all-but (-8 1)) (grind))
                              ("4"
                               (hide-all-but (-9 -10 1))
                               (expand sigma_rhs)
                               (expand comp_pos)
                               (lift-if)
                               (expand empty_seq)
                               (propax))))
                            ("2"
                             (rewrite
                              comp_pos_in_SPP_preservs_SPP_in_replace))
                            ("3"
                             (hide-all-but (-9 -10 1))
                             (expand* sigma_rhs empty_seq comp_pos)
                             (lift-if)
                             (assert))
                            ("4" (hide-all-but (-8 1)) (grind))))
                          ("2"
                           (rewrite
                            comp_pos_in_SPP_preservs_SPP_in_replace))
                          ("3"
                           (hide-all-but (-9 -10 1))
                           (expand* sigma_rhs empty_seq comp_pos)
                           (lift-if)
                           (assert))
                          ("4" (hide-all-but (-8 1)) (grind))))
                        ("2"
                         (rewrite comp_SPP_commute)
                         (hide -3 -4 2 3)
                         (lemma
                          comp_pos_in_SPP_preservs_SPP_in_replace_par_pos)
                         (inst -1 x fsp!1 fsq!1 fst1 t)
                         (assert)
                         (inst -4 "x`seq(0)")
                         (("1"
                           (expand replace_par_pos -1)
                           (expand finseq_appl)
                           (lemma seq_first_rest[position])
                           (prop)
                           (inst -1 x)
                           (expand* first finseq_appl)
                           (expand SPP?)
                           (flatten)
                           (assert))
                          ("2"
                           (hide-all-but (-4 1 3))
                           (expand* SPP? SP? finseq_appl)
                           (flatten)
                           (inst -2 0)
                           (rewrite replace_preserv_pos))))
                        ("3"
                         (hide-all-but (-1 -2 1))
                         (expand* sigma_rhs empty_seq)
                         (lift-if)
                         (assert))
                        ("4"
                         (hide-all-but (-9 -10 1))
                         (expand* sigma_rhs empty_seq comp_pos)
                         (lift-if)
                         (assert))))
                      ("2"
                       (hide-all-but (-6 1))
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -2 0))
                      ("3"
                       (hide-all-but (-9 -10 1))
                       (expand* sigma_rhs empty_seq)
                       (lift-if)
                       (assert))))
                    ("2"
                     (hide -3 -4 -11 2)
                     (lemma
                      comp_pos_in_SPP_preservs_SPP_in_replace_par_pos)
                     (inst -1 x fsp!1 fsq!1 fst1 t)
                     (expand replace_par_pos -1)
                     (expand finseq_appl)
                     (inst -3 "x`seq(0)")
                     (("1"
                       (prop)
                       (lemma seq_first_rest[position])
                       (inst -1 x)
                       (assert)
                       (expand* first finseq_appl)
                       (expand SPP? -4)
                       (flatten)
                       (assert))
                      ("2"
                       (hide-all-but (-3 1))
                       (rewrite replace_preserv_pos)
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -2 0))))
                    ("3"
                     (hide-all-but (-9 -10 1))
                     (expand* sigma_rhs empty_seq comp_pos)
                     (lift-if)
                     (assert))
                    ("4"
                     (hide-all-but (-1 -2 1))
                     (expand* sigma_rhs empty_seq)
                     (lift-if)
                     (assert))))))
                ("2"
                 (hide-all-but 1)
                 (typepred (fse!1 fse!2))
                 (expand member)
                 (skeep)
                 (expand o)
                 (lift-if)
                 (prop)
                 (("1" (inst -3 i))
                  ("2"
                   (inst -1 "i - fse!2`length")
                   (typepred i)
                   (expand o)
                   (assert))))))
              ("2"
               (skosimp)
               (lemma comp_pos_in_SPP_preservs_SPP_in_replace_par_pos)
               (inst -1 x fsp!1 fsq!1 fst1 t)
               (assert)
               (expand replace_par_pos -1 1)
               (expand finseq_appl)
               (prop)
               (("1"
                 (expand SPP? -1)
                 (flatten)
                 (hide -2 -4 -7 -8 -9)
                 (expand* add_first comp_pos rest ^ min empty_seq
                  finseq_appl)
                 (expand o -1 2)
                 (expand o 1 2)
                 (expand* insert? finseq_appl)
                 (expand* PP? finseq_appl)
                 (assert)
                 (prop)
                 (("1"
                   (skosimp)
                   (typepred (i!1 j!1))
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (prop)
                   (("1"
                     (hide -7)
                     (rewrite parallel_comm)
                     (inst -6 1 0)
                     (assert)
                     (rewrite comp_preservs_parallel_pos2))
                    ("2"
                     (inst -6 p!1)
                     (("1"
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (prop)
                       (("1" (inst -2 0 "j!1-fsp!1`length") (assert))
                        ("2" (inst -2 0 "j!1-fsp!1`length") (assert))
                        ("3" (inst -1 0 "j!1-fsp!1`length") (assert))
                        ("4"
                         (skosimp)
                         (lift-if)
                         (assert)
                         (prop)
                         (("1"
                           (inst -6 0 j!2+1)
                           (("1" (assert))
                            ("2" (typepred j!2) (assert))))
                          ("2"
                           (lift-if)
                           (prop)
                           (("1"
                             (inst -6 1+i!2 0)
                             (("1" (assert))
                              ("2" (typepred i!2) (assert))))
                            ("2"
                             (inst -5 1+i!2 1+j!2)
                             (("1" (assert))
                              ("2" (typepred j!2) (assert))
                              ("3" (typepred i!2) (assert))))))))))
                      ("2"
                       (typepred p!1)
                       (inst -6 1 0)
                       (assert)
                       (rewrite replace_preserv_parallel_pos 1)
                       (hide-all-but (-7 1))
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -2 0))))
                    ("3"
                     (hide -7)
                     (inst -6 1 0)
                     (assert)
                     (rewrite comp_preservs_parallel_pos2))
                    ("4" (hide -6 -7) (assert)) ("5" (assert))
                    ("6"
                     (inst -6 p!1)
                     (("1"
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (prop)
                       (("1" (inst -2 "i!1-fsp!1`length" 0) (assert))
                        ("2" (inst -2 "i!1-fsp!1`length" 0) (assert))
                        ("3" (inst -1 "i!1-fsp!1`length" 0) (assert))
                        ("4"
                         (skosimp)
                         (typepred (i!2 j!2))
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (assert)
                         (prop)
                         (("1" (inst -8 0 1+j!2) (assert))
                          ("2" (inst -8 1+i!2 0) (assert))
                          ("3" (inst -7 1+i!2 1+j!2) (assert))))))
                      ("2"
                       (inst -5 1 0)
                       (assert)
                       (typepred p!1)
                       (rewrite replace_preserv_parallel_pos)
                       (hide-all-but (-7 1))
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -2 0))))
                    ("7" (assert)) ("8" (assert))))
                  ("2"
                   (skosimp)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (lift-if)
                   (assert)
                   (prop)
                   (("1"
                     (rewrite parallel_comm)
                     (inst -4 1 0)
                     (assert)
                     (rewrite comp_preservs_parallel_pos2))
                    ("2"
                     (inst -4 p!1)
                     (("1"
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (prop)
                       (("1" (inst -2 0 "j!1-fsp!1`length") (assert))
                        ("2" (inst -2 0 "j!1-fsp!1`length") (assert))
                        ("3" (inst -1 0 "j!1-fsp!1`length") (assert))
                        ("4"
                         (skosimp)
                         (typepred (i!2 j!2))
                         (lift-if)
                         (assert)
                         (prop)
                         (("1" (inst -6 0 j!2+1) (assert))
                          ("2"
                           (lift-if)
                           (prop)
                           (("1" (inst -6 1+i!2 0) (assert))
                            ("2" (inst -5 1+i!2 1+j!2) (assert))))))))
                      ("2"
                       (typepred p!1)
                       (inst -4 1 0)
                       (assert)
                       (rewrite replace_preserv_parallel_pos 1)
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -6 0))))
                    ("3"
                     (hide -5)
                     (inst -4 1 0)
                     (assert)
                     (rewrite comp_preservs_parallel_pos2))
                    ("4"
                     (hide -3 -4 -5)
                     (typepred fsp!1)
                     (expand* SPP? PP? finseq_appl)
                     (assert)
                     (flatten)
                     (inst -1 i!1-1 j!1-1)
                     (assert)
                     (rewrite comp_preservs_parallel_pos))
                    ("5"
                     (hide -3 -4)
                     (typepred (i!1 j!1))
                     (inst -4 i!1-1 "j!1-1")
                     (("1" (assert)) ("2" (assert)) ("3" (assert))))
                    ("6"
                     (inst -4 p!1)
                     (("1"
                       (lift-if)
                       (lift-if)
                       (lift-if)
                       (assert)
                       (prop)
                       (("1" (inst -2 "i!1-fsp!1`length" 0) (assert))
                        ("2" (inst -2 "i!1-fsp!1`length" 0) (assert))
                        ("3" (inst -1 "i!1-fsp!1`length" 0) (assert))
                        ("4"
                         (skosimp)
                         (typepred (i!2 j!2))
                         (lift-if)
                         (lift-if)
                         (lift-if)
                         (assert)
                         (prop)
                         (("1" (inst -6 0 1+j!2) (assert))
                          ("2" (inst -6 1+i!2 0) (assert))
                          ("3" (inst -5 1+i!2 1+j!2) (assert))))))
                      ("2"
                       (inst -3 1 0)
                       (assert)
                       (typepred p!1)
                       (rewrite replace_preserv_parallel_pos)
                       (hide-all-but (-5 1))
                       (expand* SPP? SP? finseq_appl)
                       (flatten)
                       (inst -2 0))))
                    ("7"
                     (hide -3 -4)
                     (inst -2 i!1-1 j!1-1)
                     (("1" (assert)) ("2" (assert)) ("3" (assert))))
                    ("8"
                     (hide -1 -2 -3)
                     (typepred fsq!1)
                     (expand SPP? -1)
                     (flatten)
                     (expand* PP? finseq_appl)
                     (assert)
                     (typepred (i!1 j!1))
                     (inst -3 "i!1-1-fsp!1`length" "j!1-1-fsp!1`length")
                     (assert))))))
                ("2"
                 (inst -3 "x`seq(0)")
                 (("1"
                   (prop)
                   (lemma seq_first_rest[position])
                   (inst -1 x)
                   (expand* first finseq_appl)
                   (expand SPP?)
                   (flatten)
                   (assert))
                  ("2"
                   (rewrite replace_preserv_pos)
                   (expand* SPP? SP? finseq_appl)
                   (flatten)
                   (inst -4 0))))))))
            ("2"
             (lemma comp_pos_in_SPP_preservs_SPP_in_replace_par_pos)
             (inst -1 x fsp!1 fsq!1 fst1 t)
             (assert)
             (expand replace_par_pos 1)
             (expand finseq_appl)
             (inst -2 "x`seq(0)")
             (("1"
               (prop)
               (lemma seq_first_rest[position])
               (inst -1 x)
               (expand* first finseq_appl)
               (expand SPP? -3)
               (flatten)
               (assert))
              ("2"
               (rewrite replace_preserv_pos)
               (expand SPP? -2)
               (flatten)
               (expand* SP? finseq_appl)
               (inst -3 0))))))
          ("2"
           (expand SPP?)
           (hide 3)
           (flatten)
           (rewrite rest_of_PP_is_PP)
           (expand* SP? finseq_appl)
           (skeep)
           (typepred i)
           (expand rest (-1 1))
           (expand* ^ min)
           (expand empty_seq -1)
           (lift-if)
           (assert)
           (prop)
           (expand* PP? finseq_appl)
           (rewrite replace_preserv_parallel_pos)
           (("1" (inst -3 1+i)) ("2" (inst -3 0))
            ("3" (inst -2 0 1+i) (assert))))
          ("3" (hide-all-but (-2 1 2)) (grind))
          ("4" (hide-all-but (-3 1 2)) (grind))
          ("5"
           (hide 3)
           (skeep)
           (typepred i)
           (expand rest (-1 1))
           (expand* ^ min)
           (expand empty_seq -1)
           (lift-if)
           (lift-if)
           (lift-if)
           (assert)
           (prop)
           (("1" (assert)) ("2" (assert)) ("3" (assert)) ("4" (assert))
            ("5" (assert)) ("6" (assert))
            ("7" (inst -5 1+i) (assert))))))
        ("2"
         (hide-all-but (-1 1))
         (expand* SPP? SP? finseq_appl)
         (flatten)
         (inst -2 0))))))
    ("2" (skeep) (skeep) (assert)) ("3" (skeep) (skeep) (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (lemma parallel_reduction_context_aux2)
   (expand finseq_appl)
   (inst -1 E fsp fst1 fst2 t)
   (assert)
   (prop)
   (skolem -1 fsq)
   (flatten)
   (expand parallel_reduction? 1)
   (inst 1 fsq))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skeep)
   (skeep)
   (case "x`length=0")
   (("1" (hide -2) (expand replace_par_pos) (assert))
    ("2"
     (expand "#" 2)
     (expand replace_par_pos 3)
     (assert)
     (expand finseq_appl)
     (inst -1 "rest(x)")
     (rewrite length_rest)
     (inst -1 "rest(fst)" "replaceTerm(t, fst`seq(0), x`seq(0))")
     (prop)
     (("1"
       (expand "#" -1)
       (decompose-equality -1)
       (decompose-equality -2)
       (hide 2 3)
       (inst -1 0)
       (("1"
         (expand rest (-1 -2))
         (expand* ^ min)
         (expand empty_seq -2)
         (lift-if)
         (assert)
         (prop)
         (expand* SPP? PP? finseq_appl)
         (flatten)
         (assert)
         (inst -4 0 1)
         (assert)
         (expand parallel)
         (flatten)
         (expand <= 7)
         (inst 7 "x`seq(0)")
         (replaces -2)
         (rewrite empty_o_seq))
        ("2" (expand* rest ^ min empty_seq) (lift-if) (assert) (prop))))
      ("2"
       (hide 4)
       (decompose-equality 3)
       (("1"
         (expand* SPP? PP? finseq_appl)
         (flatten)
         (inst -2 0 1)
         (assert)
         (case "x`seq(0)=empty_seq")
         (("1"
           (replaces -1)
           (expand parallel)
           (flatten)
           (expand <= 4)
           (inst 4 "x`seq(1)")
           (rewrite empty_o_seq))
          ("2"
           (expand replaceTerm 3)
           (expand empty_seq 1)
           (lift-if)
           (assert)
           (decompose-equality 1)
           (decompose-equality 1)
           (skeep)
           (assert))))
        ("2"
         (expand replaceTerm 2)
         (expand finseq_appl)
         (lift-if)
         (prop)
         (("1"
           (case "x`length=1")
           (("1"
             (decompose-equality 2)
             (("1" (typepred x!1) (rewrite empty_0 -3))
              ("2" (skeep) (prop) (("1" (assert)) ("2" (assert))))))
            ("2"
             (expand* SPP? PP? finseq_appl)
             (flatten)
             (assert)
             (inst -3 0 1)
             (expand parallel)
             (flatten)
             (rewrite empty_0 -1)
             (replaces -1)
             (expand <= 5)
             (inst 5 "x`seq(1)")
             (rewrite empty_o_seq))))
          ("2" (assert))))))
      ("3"
       (expand SPP?)
       (rewrite rest_of_PP_is_PP)
       (hide 3 4)
       (flatten)
       (expand* rest ^ min empty_seq SP? finseq_appl)
       (assert)
       (prop)
       (("1" (skeep)) ("2" (skeep))
        ("3"
         (skeep)
         (expand* PP? finseq_appl)
         (inst -2 0 1+i)
         (rewrite replace_preserv_parallel_pos)
         (("1" (inst -3 1+i)) ("2" (inst -3 0))))))
      ("4" (hide-all-but (-3 1)) (grind))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1" (hide -2) (expand replace_par_pos) (assert))
      ("2"
       (expand replace_par_pos 3)
       (expand finseq_appl)
       (assert)
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 "rest(fst)" "replaceTerm(t, fst`seq(0), x`seq(0))")
       (prop)
       (("1"
         (hide 2 3)
         (expand* "#" rest ^ min)
         (lift-if)
         (expand empty_seq -1 1)
         (prop)
         (decompose-equality -2)
         (inst -1 0)
         (("1"
           (assert)
           (expand* SPP? PP? finseq_appl parallel <=)
           (flatten)
           (inst -4 0 1)
           (assert)
           (flatten)
           (replaces -1)
           (inst 5 "x`seq(0)")
           (rewrite empty_o_seq))
          ("2" (expand min) (assert))))
        ("2"
         (replace -1 3 rl)
         (hide -1)
         (expand replaceTerm)
         (lift-if)
         (prop)
         (case "x`length=1")
         (("1"
           (expand "#")
           (decompose-equality 3)
           (rewrite empty_0 -2)
           (decompose-equality 1)
           (skeep)
           (replaces -1)
           (prop))
          ("2"
           (expand* SPP? PP? finseq_appl parallel)
           (assert)
           (flatten)
           (inst -3 0 1)
           (assert)
           (flatten)
           (rewrite empty_0 -1)
           (expand <= 4)
           (inst 4 "x`seq(1)")
           (replaces -1)
           (rewrite empty_o_seq))))
        ("3"
         (hide 4)
         (expand replaceTerm 1)
         (lift-if)
         (prop)
         (("1"
           (rewrite empty_0 -1)
           (case "x`length=1")
           (("1"
             (expand "#")
             (decompose-equality 3)
             (decompose-equality 1)
             (skeep)
             (replace -1)
             (prop))
            ("2"
             (expand* SPP? PP? finseq_appl parallel)
             (assert)
             (flatten)
             (inst -3 0 1)
             (assert)
             (flatten)
             (replaces -1)
             (expand <= 4)
             (inst 4 "x`seq(1)")
             (rewrite empty_o_seq))))
          ("2" (assert))))
        ("4"
         (hide -1 -3 3 4)
         (expand SPP?)
         (rewrite rest_of_PP_is_PP)
         (expand* rest ^ min empty_seq)
         (expand* SP? finseq_appl)
         (assert)
         (prop)
         (("1" (skeep)) ("2" (skeep))
          ("3"
           (skeep)
           (inst -2 1+i)
           (expand* PP? finseq_appl)
           (inst -1 0 1+i)
           (assert)
           (rewrite replace_preserv_parallel_pos)
           (reveal -2)
           (inst -1 0))))
        ("5" (hide-all-but (-3 1)) (grind))))))
    ("2"
     (hide 2)
     (skeep)
     (lemma replace_par_pos_of_app_is_app)
     (inst -1 fsp fst t)
     (assert))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (induct t)
   (("1"
     (skosimp)
     (skeep)
     (inst -1 "vars(vars1_var!1)")
     (expand V)
     (inst 1 empty_seq)
     (("1" (expand empty_seq) (expand subtermOF) (propax))
      ("2" (expand positionsOF) (expand* only_empty_seq empty_seq))))
    ("2"
     (skeep)
     (skeep)
     (case "app2_var`length=0")
     (("1"
       (expand parallel_reduction? 1)
       (inst 1 empty_seq)
       (("1"
         (expand parallel_reduction_fix?)
         (inst 1 empty_seq empty_seq)
         (("1"
           (expand empty_seq)
           (assert)
           (expand* subtermsOF sigma_lhs empty_seq)
           (expand replace_par_pos)
           (split)
           (("1" (decompose-equality 1) (skeep))
            ("2" (expand ext 1) (propax))))
          ("2" (expand empty_seq) (expand member) (skeep))))
        ("2"
         (expand empty_seq)
         (expand* SPP? SP? PP? finseq_appl)
         (skeep))))
      ("2"
       (lemma parallel_reduction_context)
       (expand finseq_appl)
       (inst -1 E
        "(# length := app2_var`length,
                                      seq := (LAMBDA (i:below[app2_var`length]): #(i + 1)) #)"
        "(# length := app2_var`length,
                           seq := (LAMBDA (i:below[app2_var`length]): ext(sigma)(app2_var`seq(i))) #)"
        "(# length := app2_var`length,
                           seq := (LAMBDA (i:below[app2_var`length]): ext(theta)(app2_var`seq(i))) #)"
        "ext(sigma)(app(app1_var, app2_var))")
       (assert)
       (prop)
       (("1"
         (case "ext(sigma)(app(app1_var, app2_var)) =
                                         replace_par_pos(ext
                                                                      (sigma)(app(app1_var, app2_var)),
                                                                      (# length := app2_var`length,
                                                                         seq
                                                                         := (LAMBDA
                                                                             (i:
                                                                              below[app2_var`length]):
                                                                              #(1 + i)) #),
                                                                      (# length := app2_var`length,
                                                                         seq
                                                                         := (LAMBDA
                                                                             (i:
                                                                              below[app2_var`length]):
                                                                             ext
                                                                             (sigma)
                                                                             (app2_var`seq(i))) #))
                                      AND ext(theta)(app(app1_var, app2_var)) =
                                          replace_par_pos(ext
                                                                      (sigma)(app(app1_var, app2_var)),
                                                                      (# length := app2_var`length,
                                                                         seq
                                                                         := (LAMBDA
                                                                             (i:
                                                                              below[app2_var`length]):
                                                                              #(1 + i)) #),
                                                                      (# length := app2_var`length,
                                                                         seq
                                                                         := (LAMBDA
                                                                             (i:
                                                                              below[app2_var`length]):
                                                                             ext
                                                                             (theta)
                                                                             (app2_var`seq(i))) #))")
         (("1" (flatten) (assert))
          ("2"
           (hide-all-but (1 2))
           (split)
           (("1"
             (expand ext 1 (1 2))
             (expand finseq_appl)
             (case "SPP?(app(app1_var, (# length := app2_var`length,
                                seq
                                  := LAMBDA (n: below[app2_var`length]):
                                       ext(sigma)(app2_var`seq(n)) #)))
                                              ((# length := app2_var`length,
                                                  seq := (LAMBDA (i: below[app2_var`length]):  #(1 + i)) #))")
             (("1"
               (lemma replace_par_pos_preservs_f)
               (inst -1
                "(# length := app2_var`length,
                                         seq := (LAMBDA (i: below[app2_var`length]):  #(1 + i)) #)"
                "(# length := app2_var`length,
                                         seq := (LAMBDA (i: below[app2_var`length]):
                                                ext(sigma)(app2_var`seq(i))) #)"
                "app(app1_var, (# length := app2_var`length,
                                         seq := (LAMBDA (i: below[app2_var`length]):
                                                ext(sigma)(app2_var`seq(i))) #))")
               (assert)
               (split)
               (("1"
                 (hide -2 1)
                 (expand "#" -1 2)
                 (flatten)
                 (decompose-equality -2)
                 (inst -1 0)
                 (expand* "#" empty_seq))
                ("2"
                 (decompose-equality 1)
                 (decompose-equality 1)
                 (("1"
                   (decompose-equality 1)
                   (case "args(replace_par_pos(app(app1_var,
                                                                                (# length := app2_var`length,
                                                                                   seq
                                                                                     := LAMBDA
                                                                                        (n: below[app2_var`length]):
                                                                                        ext(sigma)(app2_var`seq(n)) #)),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                      #(1 + i)) #),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                     ext(sigma)(app2_var`seq(i))) #)))`seq(x!1) =
                                                             subtermOF(replace_par_pos(app(app1_var,
                                                                                (# length := app2_var`length,
                                                                                   seq
                                                                                     := LAMBDA
                                                                                        (n: below[app2_var`length]):
                                                                                        ext(sigma)(app2_var`seq(n)) #)),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                      #(1 + i)) #),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                     ext(sigma)(app2_var`seq(i))) #)), #(1 + x!1))")
                   (("1"
                     (replaces -1)
                     (hide -1)
                     (lemma replace_par_pos_subterm)
                     (inst -1
                      "(# length := app2_var`length,
                                                                  seq := (LAMBDA (i: below[app2_var`length]): #(1 + i)) #)"
                      "(# length := app2_var`length,
                                                                    seq
                                                                      := (LAMBDA (i: below[app2_var`length]):
                                                                            ext(sigma)(app2_var`seq(i))) #)"
                      "app(app1_var, (# length := app2_var`length,
                                                                     seq := LAMBDA (n: below[app2_var`length]): ext(sigma)(app2_var`seq(n)) #))")
                     (expand finseq_appl)
                     (inst -1 x!1)
                     (replaces -1))
                    ("2"
                     (hide -1 -2 2)
                     (expand* subtermOF finseq_appl)
                     (expand "#" 1 2)
                     (expand subtermOF)
                     (expand "#" 1 (2 4))
                     (expand rest 1 1)
                     (expand* ^ min empty_seq first finseq_appl))
                    ("3"
                     (hide -1 2)
                     (lemma replace_par_pos_preservs_PP)
                     (inst -1
                      "(# length := app2_var`length,
                                                                  seq := (LAMBDA (i: below[app2_var`length]): #(1 + i)) #)"
                      "(# length := app2_var`length,
                                                                    seq
                                                                      := (LAMBDA (i: below[app2_var`length]):
                                                                            ext(sigma)(app2_var`seq(i))) #)"
                      "app(app1_var, (# length := app2_var`length,
                                                                     seq := LAMBDA (n: below[app2_var`length]): ext(sigma)(app2_var`seq(n)) #))")
                     (assert)
                     (inst -1 x!1)
                     (expand finseq_appl)
                     (propax))))
                  ("2"
                   (skeep)
                   (prop)
                   (("1" (assert)) ("2" (assert))))))))
              ("2"
               (hide 2)
               (expand* SPP? PP? SP? finseq_appl)
               (split)
               (("1" (propax))
                ("2"
                 (prop)
                 (skeep)
                 (expand parallel)
                 (expand <=)
                 (split)
                 (("1"
                   (skosimp)
                   (expand* "#" o)
                   (flatten)
                   (decompose-equality)
                   (inst -1 0)
                   (assert))
                  ("2"
                   (skosimp)
                   (expand* "#" o)
                   (flatten)
                   (decompose-equality)
                   (inst -1 0))))
                ("3" (skosimp) (rewrite subterm_if_le_arity))))))
            ("2"
             (expand ext 1 (1 2))
             (expand finseq_appl)
             (case "SPP?(app(app1_var,
                                                          (# length := app2_var`length,
                                                                seq := LAMBDA (n: below[app2_var`length]): ext(sigma)(app2_var`seq(n)) #)))
                                                     ((# length := app2_var`length,
                                                            seq := (LAMBDA (i: below[app2_var`length]): #(1 + i)) #))")
             (("1"
               (lemma replace_par_pos_preservs_f)
               (inst -1
                "(# length := app2_var`length,
                                                      seq := (LAMBDA (i: below[app2_var`length]): #(1 + i)) #)"
                "(# length := app2_var`length,
                                                        seq
                                                          := (LAMBDA (i: below[app2_var`length]):
                                                                ext(theta)(app2_var`seq(i))) #)"
                "app(app1_var, (# length := app2_var`length,
                                                         seq := LAMBDA (n: below[app2_var`length]): ext(sigma)(app2_var`seq(n)) #))")
               (assert)
               (split)
               (("1"
                 (hide -2 1)
                 (expand "#" -1 2)
                 (flatten)
                 (decompose-equality -2)
                 (inst -1 0)
                 (expand* "#" empty_seq))
                ("2"
                 (decompose-equality 1)
                 (decompose-equality 1)
                 (("1"
                   (decompose-equality 1)
                   (case "args(replace_par_pos(app(app1_var,
                                                                                (# length := app2_var`length,
                                                                                   seq
                                                                                     := LAMBDA
                                                                                        (n: below[app2_var`length]):
                                                                                        ext(sigma)(app2_var`seq(n)) #)),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                      #(1 + i)) #),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                     ext(theta)(app2_var`seq(i))) #)))`seq(x!1) =
                                                             subtermOF(replace_par_pos(app(app1_var,
                                                                                (# length := app2_var`length,
                                                                                   seq
                                                                                     := LAMBDA
                                                                                        (n: below[app2_var`length]):
                                                                                        ext(sigma)(app2_var`seq(n)) #)),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                      #(1 + i)) #),
                                                                            (# length := app2_var`length,
                                                                               seq
                                                                                 := (LAMBDA
                                                                                     (i: below[app2_var`length]):
                                                                                     ext(theta)(app2_var`seq(i))) #)), #(1 + x!1))")
                   (("1"
                     (replaces -1)
                     (hide -1)
                     (lemma replace_par_pos_subterm)
                     (inst -1
                      "(# length := app2_var`length,
                                                                  seq := (LAMBDA (i: below[app2_var`length]): #(1 + i)) #)"
                      "(# length := app2_var`length,
                                                                    seq
                                                                      := (LAMBDA (i: below[app2_var`length]):
                                                                            ext(theta)(app2_var`seq(i))) #)"
                      "app(app1_var, (# length := app2_var`length,
                                                                     seq := LAMBDA (n: below[app2_var`length]): ext(sigma)(app2_var`seq(n)) #))")
                     (expand finseq_appl)
                     (inst -1 x!1)
                     (replaces -1))
                    ("2"
                     (hide -1 -2 2)
                     (expand* subtermOF finseq_appl)
                     (expand "#" 1 2)
                     (expand subtermOF)
                     (expand "#" 1 (2 4))
                     (expand rest 1 1)
                     (expand* ^ min empty_seq first finseq_appl))
                    ("3"
                     (hide -1 2)
                     (lemma replace_par_pos_preservs_PP)
                     (inst -1
                      "(# length := app2_var`length,
                                                                  seq := (LAMBDA (i: below[app2_var`length]): #(1 + i)) #)"
                      "(# length := app2_var`length,
                                                                    seq
                                                                      := (LAMBDA (i: below[app2_var`length]):
                                                                            ext(theta)(app2_var`seq(i))) #)"
                      "app(app1_var, (# length := app2_var`length,
                                                                     seq := LAMBDA (n: below[app2_var`length]): ext(sigma)(app2_var`seq(n)) #))")
                     (assert)
                     (inst -1 x!1)
                     (expand finseq_appl)
                     (propax))))
                  ("2"
                   (skeep)
                   (prop)
                   (("1" (assert)) ("2" (assert))))))))
              ("2"
               (hide 2)
               (expand* SPP? PP? SP? finseq_appl)
               (split)
               (("1" (propax))
                ("2"
                 (prop)
                 (skeep)
                 (expand parallel)
                 (expand <=)
                 (split)
                 (("1"
                   (skosimp)
                   (expand* "#" o)
                   (flatten)
                   (decompose-equality)
                   (inst -1 0)
                   (assert))
                  ("2"
                   (skosimp)
                   (expand* "#" o)
                   (flatten)
                   (decompose-equality)
                   (inst -1 0))))
                ("3" (skosimp) (rewrite subterm_if_le_arity))))))))))
        ("2"
         (hide-all-but (1 2))
         (expand* ext finseq_appl)
         (expand* SPP? SP? PP? finseq_appl)
         (split)
         (("1" (propax))
          ("2"
           (prop)
           (skosimp 2)
           (expand parallel)
           (split)
           (("1"
             (expand "#")
             (expand <= -1)
             (skosimp)
             (expand o -1)
             (flatten)
             (decompose-equality)
             (inst -1 0)
             (assert))
            ("2"
             (expand "#")
             (expand <=)
             (skosimp)
             (expand o -1)
             (flatten)
             (decompose-equality -2)
             (inst -1 0))))
          ("3"
           (skosimp)
           (lemma subterm_if_le_arity)
           (typepred i!1)
           (inst -2 "1+i!1"
            "app(app1_var,
                                            (# length := app2_var`length,
                                               seq
                                                 := LAMBDA (n: below[app2_var`length]):
                                                      ext(sigma)(app2_var`seq(n)) #))")
           (assert))))
        ("3"
         (skosimp)
         (inst -1 i!1)
         (inst -1 E sigma theta)
         (assert)
         (skosimp)
         (inst -1 x!1)
         (typepred x!1)
         (skosimp)
         (inst 1 "add_first(1 + i!1, p!1)")
         (("1"
           (expand subtermOF 1)
           (rewrite rest_add_first)
           (expand* add_first insert? first finseq_appl)
           (lift-if)
           (assert)
           (assert))
          ("2"
           (expand positionsOF 1)
           (expand* only_empty_seq union IUnion member)
           (flatten)
           (hide 1)
           (inst 1 "1+i!1")
           (expand finseq_appl)
           (expand catenate)
           (inst 1 p!1)
           (expand member)
           (propax))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (skosimp)
   (skeep)
   (case " x!1`length=0")
   (("1"
     (hide -2)
     (expand parallel_reduction_fix?)
     (skosimp)
     (expand replace_par_pos -8)
     (assert)
     (inst 2 sigma))
    ("2"
     (inst -1 "rest(x!1)")
     (rewrite length_rest)
     (expand parallel_reduction_fix? -5)
     (skosimp)
     (expand replace_par_pos -8)
     (expand finseq_appl)
     (assert)
     (lemma replace_par_pos_equivalence)
     (expand finseq_appl)
     (inst -1 x!1 "sigma_rhs(fss!1, fse!1)" "ext(sigma)(lhs(e))")
     (assert)
     (expand sigma_rhs -1 1)
     (replaces -1)
     (expand sigma_rhs -8 2)
     (expand finseq_appl)
     (rewrite sigma_rhs_rest)
     (lemma positions_of_ext)
     (inst -1 sigma "lhs(e)")
     (decompose-equality -1)
     (inst -1 "x!1`seq(0)")
     (expand* union member)
     (iff)
     (flatten)
     (hide -2)
     (expand SPP? -5)
     (expand* SP? finseq_appl)
     (flatten)
     (inst-cp -6 0)
     (assert)
     (expand subtermsOF -10)
     (expand sigma_lhs -10)
     (expand finseq_appl)
     (decompose-equality -10)
     (("1"
       (prop)
       (("1"
         (expand* Orthogonal? Ambiguous?)
         (flatten)
         (lemma ntCP_lemma_aux1)
         (inst -1 sigma "fss!1`seq(0)" E "x!1`seq(0)" e "fse!1`seq(0)")
         (("1"
           (inst -3 0)
           (assert)
           (rewrite subterm_ext_commute -3)
           (assert)
           (prop)
           (("1" (skosimp) (inst 3 t1!1 t2!1))
            ("2"
             (hide-all-but (-2 -8 2 4))
             (expand* PP? finseq_appl)
             (case "x!1`length=1")
             (("1"
               (assert)
               (prop)
               (("1"
                 (expand "#")
                 (decompose-equality)
                 (decompose-equality 2)
                 (decompose-equality 1)
                 (skeep)
                 (prop)
                 (("1" (assert)) ("2" (assert))))
                ("2" (assert))))
              ("2"
               (assert)
               (inst -2 0 1)
               (expand parallel)
               (flatten)
               (expand <= 3)
               (inst 3 "x!1`seq(1)")
               (replaces -1)
               (rewrite empty_o_seq))))))
          ("2"
           (hide-all-but 1)
           (typepred fse!1)
           (expand member -1)
           (inst -1 0))
          ("3" (expand member 1) (propax))))
        ("2"
         (skosimp)
         (inst -6 E e sigma
          "replace_par_pos(ext(sigma)(lhs(e)), rest(x!1),
                                                                         sigma_rhs(rest(fss!1), rest(fse!1)))")
         (assert)
         (prop)
         (("1"
           (hide-all-but (-1 -9 1 2))
           (expand* rest ^ min)
           (expand empty_seq -1 1)
           (expand "#")
           (decompose-equality -1)
           (lift-if)
           (assert)
           (prop)
           (decompose-equality -1)
           (hide 6)
           (inst -1 0)
           (("1"
             (expand* PP? finseq_appl)
             (assert)
             (inst -3 0 1)
             (expand* parallel <=)
             (flatten)
             (replaces -1)
             (inst 7 "x!1`seq(0)")
             (rewrite empty_o_seq))
            ("2" (expand min) (assert))))
          ("2"
           (skosimp)
           (inst 3
            "SigmaP(theta!1, ext(fss!1`seq(0))(rhs(fse!1`seq(0))), subtermOF(lhs(e), p1!1), p2!1)")
           (("1"
             (lemma SigmaP_vs_replaceTerm_linearR)
             (inst -1 p1!1 p2!1 "lhs(e)" theta!1
              "ext(fss!1`seq(0))(rhs(fse!1`seq(0)))"
              "subtermOF(lhs(e), p1!1)")
             (assert)
             (split)
             (("1"
               (lemma seq_first_rest[position])
               (inst -1 x!1)
               (assert)
               (lemma replace_par_pos_preservs_pos)
               (inst -1 "rest(x!1)" "sigma_rhs(rest(fss!1), rest(fse!1))"
                "x!1`seq(0)" "ext(sigma)(lhs(e))")
               (assert)
               (prop)
               (("1"
                 (replaces -3)
                 (replaces -3)
                 (lemma pos_subterm_ax)
                 (inst -1 p1!1 p2!1 "ext(theta!1)(lhs(e))")
                 (assert)
                 (rewrite subterm_ext_commute -1))
                ("2"
                 (hide-all-but (-1 -10 -11 1 3))
                 (expand* SPP? SP? finseq_appl)
                 (expand* first finseq_appl)
                 (assert)
                 (skeep)
                 (inst -3 i)
                 (assert))
                ("3" (hide-all-but (-13 -14 1 3)) (grind))))
              ("2"
               (hide-all-but (-3 -4 -7 -8 1))
               (expand* Orthogonal? Left_Linear? linear?)
               (flatten)
               (inst -3 e)
               (("1"
                 (inst -3 "subtermOF(lhs(e), p1!1)")
                 (expand* member Vars)
                 (inst 1 p1!1))
                ("2" (expand member) (propax))))))
            ("2"
             (rewrite SigmaP_Subs)
             (hide 2)
             (lemma replace_par_pos_preservs_pos)
             (inst -1 "rest(x!1)" "sigma_rhs(rest(fss!1), rest(fse!1))"
              "x!1`seq(0)" "ext(sigma)(lhs(e))")
             (prop)
             (("1"
               (replaces -2)
               (replaces -2)
               (lemma pos_subterm_ax)
               (inst -1 p1!1 p2!1 "ext(theta!1)(lhs(e))")
               (assert)
               (rewrite subterm_ext_commute -1)
               (expand ext -1)
               (propax))
              ("2"
               (hide-all-but (-9 -10 1 3))
               (lemma seq_first_rest[position])
               (inst -1 x!1)
               (assert)
               (expand* first finseq_appl)
               (replace -1 1 rl)
               (expand* SPP? SP? finseq_appl))
              ("3" (hide-all-but (-12 -13 1 3)) (grind))))
            ("3"
             (hide -14)
             (lemma replace_par_pos_preservs_pos)
             (inst -1 "rest(x!1)" "sigma_rhs(rest(fss!1), rest(fse!1))"
              "x!1`seq(0)" "ext(sigma)(lhs(e))")
             (prop)
             (("1"
               (replaces -2)
               (lemma pos_subterm_ax)
               (inst -1 p1!1 p2!1 "ext(theta!1)(lhs(e))")
               (assert)
               (rewrite subterm_ext_commute -1)
               (expand ext -1)
               (propax))
              ("2"
               (hide-all-but (-9 -10 1 3))
               (lemma seq_first_rest[position])
               (inst -1 x!1)
               (expand* first finseq_appl)
               (replace -1 1 rl)
               (expand* SPP? SP? finseq_appl))
              ("3" (hide-all-but (-12 -13 1 3)) (grind))))
            ("4" (expand V) (propax))))
          ("3"
           (expand SPP?)
           (rewrite rest_of_PP_is_PP)
           (lemma rest_of_SP_is_SP)
           (inst -1 "ext(sigma)(lhs(e))" x!1)
           (expand SP? 1)
           (expand finseq_appl)
           (propax))
          ("4"
           (hide -13 4)
           (expand* parallel_reduction_fix?)
           (inst 1 "rest(fse!1)" "rest(fss!1)")
           (("1"
             (prop)
             (("1" (hide-all-but (-11 1 2)) (grind))
              ("2" (hide-all-but (-12 1 2)) (grind))
              ("3"
               (hide 3)
               (expand* rest ^ min empty_seq)
               (lift-if)
               (assert)
               (lift-if)
               (assert)
               (lift-if)
               (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
               (prop)
               (("1" (decompose-equality 1) (skeep))
                ("2" (decompose-equality 1) (skeep)) ("3" (assert))
                ("4" (decompose-equality 1) (skeep))
                ("5" (decompose-equality 1) (skeep)) ("6" (assert))
                ("7"
                 (decompose-equality 3)
                 (("1" (inst -5 1+x!2))
                  ("2" (skeep) (prop) (("1" (assert)) ("2" (assert))))
                  ("3" (skeep) (inst -9 1+i))))))))
            ("2"
             (hide-all-but (1 2))
             (typepred fse!1)
             (expand* rest ^ min empty_seq)
             (lift-if)
             (expand member)
             (prop)
             (("1" (skeep)) ("2" (skeep))
              ("3" (skeep) (inst -1 1+i))))))))))
      ("2" (inst -11 x!2)) ("3" (inst -8 x!2))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp`length" fsp)
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1"
       (hide -2)
       (expand* member_seq finseq_appl)
       (skosimp)
       (typepred i!1)
       (assert))
      ("2"
       (expand member_seq -3)
       (skolem -3 i)
       (expand finseq_appl)
       (case "x`length=1")
       (("1"
         (hide -2)
         (inst 3 fst)
         (split)
         (("1"
           (expand complement_pos)
           (lift-if)
           (prop)
           (("1"
             (expand* add_first insert?)
             (expand* rest ^ min empty_seq)
             (lift-if)
             (assert)
             (expand complement_pos)
             (expand empty_seq)
             (assert))
            ("2"
             (hide 2)
             (expand* nonempty? empty? member)
             (copy -5)
             (expand <= -1)
             (skosimp)
             (inst -2 p1!1)
             (expand* complement_pos_set emptyset)
             (assert))))
          ("2"
           (expand complement_pos)
           (expand* replace_par_pos finseq_appl)
           (lift-if)
           (lift-if)
           (lift-if)
           (expand add_first 1 (1 2))
           (expand insert?)
           (copy -4)
           (expand <= -1)
           (skosimp)
           (case "choose(complement_pos_set(p, x`seq(0))) = p1!1")
           (("1"
             (replaces -1)
             (prop)
             (("1" (assert))
              ("2"
               (hide 1)
               (rewrite rest_add_first)
               (expand rest 1 (1 3))
               (expand* ^ min empty_seq)
               (lift-if)
               (assert)
               (expand complement_pos)
               (expand empty_seq)
               (expand replace_par_pos)
               (case "i=0")
               (("1"
                 (replace -1)
                 (replace -6 1 rl)
                 (replace -3 1)
                 (rewrite replace_distributivity)
                 (expand* SPP? SP? finseq_appl)
                 (flatten)
                 (inst -6 0))
                ("2" (assert))))
              ("3"
               (hide -1 1)
               (expand* nonempty? empty? member)
               (inst -1 p1!1)
               (expand* complement_pos_set emptyset)
               (assert))
              ("4"
               (hide 1 2)
               (expand* nonempty? empty? member)
               (inst -1 p1!1)
               (expand* complement_pos_set emptyset)
               (assert))))
            ("2"
             (hide 2)
             (typepred "choose(complement_pos_set(p, x`seq(0)))")
             (expand complement_pos_set -1 1)
             (expand emptyset)
             (assert)
             (case i=0)
             (("1"
               (replace -1)
               (replace -6 -3)
               (lemma equal_prefix[posnat])
               (inst -1 p "choose(complement_pos_set(p, x`seq(0)))" p1!1)
               (assert))
              ("2" (assert))))
            ("3"
             (hide 2)
             (expand* nonempty? empty? member)
             (inst -1 p1!1)
             (expand* complement_pos_set emptyset)
             (assert))))))
        ("2"
         (case "i=0")
         (("1"
           (replace -1)
           (inst -2 "delete(x, 1)")
           (("1"
             (expand delete -2 1)
             (inst -2 "delete(fst, 1)" p p1 s)
             (("1"
               (expand delete -2 (3 4))
               (assert)
               (prop)
               (("1"
                 (skosimp)
                 (expand complement_pos)
                 (expand delete -1 1)
                 (expand delete -2 3)
                 (expand delete -1 (1 2))
                 (expand delete -2 (3 4))
                 (expand finseq_appl)
                 (copy -6)
                 (expand <= -1)
                 (skosimp)
                 (case "nonempty?(complement_pos_set(p, x`seq(0)))")
                 (("1"
                   (assert)
                   (expand add_first -3)
                   (expand insert?)
                   (expand complement_pos 4)
                   (expand rest 4 (1 2 3 8 9 10))
                   (expand* ^ min empty_seq)
                   (case "rest(delete(x, 1)) = rest(rest(x))")
                   (("1"
                     (replace -1)
                     (case "choose(complement_pos_set(p, x`seq(0))) = p1!1")
                     (("1"
                       (replaces -1)
                       (case "nonempty?(complement_pos_set(p, x`seq(1)))")
                       (("1"
                         (assert)
                         (inst 4
                          "add_first(fst1!1`seq(0), add_first(fst`seq(1), rest(fst1!1)))")
                         (expand add_first 4 (1 2 3 4))
                         (expand insert?)
                         (expand rest 4 3)
                         (expand* ^ min empty_seq)
                         (lift-if)
                         (case "fst1!1`length = 1")
                         (("1"
                           (assert)
                           (expand replace_par_pos 4)
                           (expand finseq_appl)
                           (rewrite rest_add_first)
                           (rewrite rest_add_first)
                           (expand add_first 4 (1 2 3 5))
                           (expand insert?)
                           (expand replace_par_pos 4)
                           (expand finseq_appl)
                           (lift-if)
                           (rewrite rest_add_first)
                           (rewrite rest_add_first)
                           (expand add_first 4)
                           (expand insert?)
                           (expand rest 4 1)
                           (expand* ^ min empty_seq)
                           (expand replace_par_pos -7)
                           (expand finseq_appl)
                           (lift-if)
                           (expand delete -7 (1 2 3))
                           (lift-if)
                           (rewrite rest_add_first)
                           (expand finseq_appl)
                           (expand add_first -7)
                           (expand insert?)
                           (case "rest(delete(fst, 1)) = rest(rest(fst))")
                           (("1"
                             (replace -1)
                             (replace -4)
                             (typepred
                              "choose(complement_pos_set(p, x`seq(1)))")
                             (expand complement_pos_set -1 1)
                             (expand emptyset)
                             (prop)
                             (expand replace_par_pos -10 2)
                             (expand replace_par_pos 5 2)
                             (lemma replace_par_pos_equivalence)
                             (expand finseq_appl)
                             (inst -1 "rest(x)" "rest(fst)"
                              "replaceTerm
                                                                                                                                                                  (s, fst`seq(0), x`seq(0))")
                             (prop)
                             (("1"
                               (replaces -1)
                               (lemma replace_distributivity)
                               (inst -1 p
                                "choose(complement_pos_set(p, x`seq(1)))"
                                "replace_par_pos(replaceTerm(s, fst`seq(0), x`seq(0)),
                                                                                                                                                                          rest(rest(x)),
                                                                                                                                                                          rest(rest(fst)))"
                                "fst`seq(1)")
                               (prop)
                               (("1"
                                 (replace -11 -1)
                                 (expand rest 5 (5 6))
                                 (expand ^)
                                 (assert))
                                ("2"
                                 (replace -2 1 rl)
                                 (lemma replace_par_pos_preservs_pos)
                                 (inst
                                  -1
                                  "add_first(x`seq(0),rest(rest(x)))"
                                  "add_first(fst`seq(0),rest(rest(fst)))"
                                  "x`seq(1)"
                                  s)
                                 (hide-all-but (-1 -13 -16 1 3 4))
                                 (prop)
                                 (("1"
                                   (expand replace_par_pos -1)
                                   (expand finseq_appl)
                                   (rewrite rest_add_first)
                                   (rewrite rest_add_first)
                                   (expand add_first)
                                   (expand insert?)
                                   (assert)
                                   (prop)
                                   (assert))
                                  ("2"
                                   (hide 2)
                                   (expand SPP?)
                                   (flatten)
                                   (expand* rest ^ min empty_seq)
                                   (lift-if)
                                   (expand*
                                    add_first
                                    insert?
                                    finseq_appl)
                                   (assert)
                                   (case "x`length<3")
                                   (("1"
                                     (assert)
                                     (split)
                                     (("1"
                                       (expand* PP? finseq_appl)
                                       (skeep)
                                       (lift-if)
                                       (lift-if)
                                       (lift-if)
                                       (assert)
                                       (prop)
                                       (("1" (inst -3 1 0) (assert))
                                        ("2" (inst -3 0 1) (assert))
                                        ("3" (assert))))
                                      ("2"
                                       (expand* SP? finseq_appl)
                                       (skeep)
                                       (prop)
                                       (("1" (inst -4 1))
                                        ("2" (inst -3 0))))))
                                    ("2"
                                     (assert)
                                     (split)
                                     (("1"
                                       (expand* PP? finseq_appl)
                                       (skeep)
                                       (lift-if)
                                       (lift-if)
                                       (lift-if)
                                       (lift-if)
                                       (assert)
                                       (prop)
                                       (("1" (inst -3 1 0) (assert))
                                        ("2" (inst -2 1 j) (assert))
                                        ("3" (inst -3 0 1) (assert))
                                        ("4" (inst -2 0 j) (assert))
                                        ("5" (inst -2 i!1 1) (assert))
                                        ("6" (inst -2 i!1 0) (assert))
                                        ("7" (inst -1 i!1 j) (assert))))
                                      ("2"
                                       (expand* SP? finseq_appl)
                                       (skeep)
                                       (prop)
                                       (("1" (inst -3 1))
                                        ("2" (inst -3 0))
                                        ("3" (inst -2 i!1))))))))
                                  ("3" (hide -1 2) (grind))))))
                              ("2"
                               (hide-all-but (-12 1 3 4))
                               (expand SPP?)
                               (rewrite rest_of_PP_is_PP)
                               (flatten)
                               (expand* SP? PP? finseq_appl)
                               (skeep)
                               (typepred i!1)
                               (expand rest (-1 1))
                               (expand* ^ min empty_seq)
                               (rewrite replace_preserv_parallel_pos)
                               (("1" (inst -3 1+i!1)) ("2" (inst -3 0))
                                ("3" (inst -2 0 1+i!1) (assert))))
                              ("3" (hide-all-but (-1 2 3)) (grind))
                              ("4" (hide-all-but (-15 1 3 4)) (grind))))
                            ("2" (hide-all-but (-12 1 2 3)) (grind))))
                          ("2"
                           (assert)
                           (expand replace_par_pos 5)
                           (expand finseq_appl)
                           (expand add_first 5 (1 2 3 5))
                           (expand insert?)
                           (rewrite rest_add_first)
                           (rewrite rest_add_first)
                           (expand replace_par_pos 5)
                           (expand finseq_appl)
                           (expand rest 5 (1 2 3))
                           (expand* ^ min empty_seq)
                           (expand add_first 5 (1 2 3))
                           (expand insert?)
                           (rewrite rest_add_first)
                           (rewrite rest_add_first)
                           (expand replace_par_pos -6)
                           (expand finseq_appl)
                           (expand delete -6 (1 2 3))
                           (expand finseq_appl)
                           (expand add_first -6 (1 2))
                           (expand insert?)
                           (rewrite rest_add_first)
                           (case "rest(delete(fst, 1)) = rest(rest(fst))")
                           (("1"
                             (replace -1)
                             (replace -3)
                             (lemma replace_par_pos_equivalence)
                             (inst -1
                              "add_first(choose(complement_pos_set(p, x`seq(1))) ,complement_pos(p, rest(rest(x))))"
                              "add_first(fst`seq(1), rest(fst1!1))"
                              "replaceTerm(subtermOF(s, p),fst1!1`seq(0),p1!1)")
                             (expand finseq_appl)
                             (expand add_first -1 (2 3 4 5 6 11 12))
                             (expand insert?)
                             (rewrite rest_add_first)
                             (rewrite rest_add_first)
                             (prop)
                             (("1"
                               (replaces -1)
                               (replace -7 5 rl)
                               (lemma replace_distributivity)
                               (typepred
                                "choose(complement_pos_set(p, x`seq(1)))")
                               (expand complement_pos_set -1 1)
                               (expand emptyset)
                               (prop)
                               (inst -3 p
                                "choose(complement_pos_set(p, x`seq(1)))"
                                "replace_par_pos(replaceTerm
                                                                                                                                           (s, fst`seq(0), x`seq(0)), rest(rest(x)),
                                                                                                                                           rest(rest(fst)))"
                                "fst`seq(1)")
                               (prop)
                               (("1"
                                 (replace -1 6 rl)
                                 (replace -3 6 rl)
                                 (hide -1)
                                 (lemma replace_par_pos_equivalence)
                                 (expand finseq_appl)
                                 (inst
                                  -1
                                  "add_first(x`seq(1), delete(x, 1))"
                                  "add_first(fst`seq(1), delete(fst,1))"
                                  s)
                                 (rewrite rest_add_first)
                                 (rewrite rest_add_first)
                                 (expand add_first -1 (2 3 4 5 6 7 8))
                                 (expand insert?)
                                 (expand delete -1 (2 3 4))
                                 (prop)
                                 (("1"
                                   (expand replace_par_pos -1)
                                   (expand finseq_appl)
                                   (lift-if)
                                   (expand delete -1 (1 2 3 6 7))
                                   (expand finseq_appl)
                                   (replace -4)
                                   (replace -6)
                                   (lemma replace_commutativity)
                                   (inst
                                    -1
                                    "x`seq(0)"
                                    "x`seq(1)"
                                    "fst`seq(1)"
                                    s
                                    "fst`seq(0)")
                                   (expand* SPP? SP? PP? finseq_appl)
                                   (assert)
                                   (hide-all-but (-12 1))
                                   (flatten)
                                   (prop)
                                   (("1" (inst -2 0))
                                    ("2" (inst -2 1))
                                    ("3" (inst -1 0 1) (assert))))
                                  ("2"
                                   (hide-all-but (-11 1 4 5))
                                   (expand SPP?)
                                   (flatten)
                                   (split)
                                   (("1"
                                     (rewrite
                                      add_first_parallel_pos_to_PP_is_PP)
                                     (("1"
                                       (expand finseq_appl)
                                       (hide 2)
                                       (skeep)
                                       (typepred i!1)
                                       (expand delete)
                                       (expand finseq_appl)
                                       (lift-if)
                                       (expand* PP? finseq_appl)
                                       (prop)
                                       (("1" (inst -3 i!1 1) (assert))
                                        ("2"
                                         (inst -2 1+i!1 1)
                                         (assert))))
                                      ("2"
                                       (rewrite delete_of_PP_is_PP))))
                                    ("2"
                                     (rewrite
                                      add_first_parallel_pos_to_SP_is_SP)
                                     (("1"
                                       (hide 2)
                                       (expand* SP? finseq_appl)
                                       (inst -2 1))
                                      ("2"
                                       (rewrite
                                        delete_of_SP_is_SP))))))))
                                ("2"
                                 (replace -2 1 rl)
                                 (hide-all-but (-3 -5 -10 -11 1 4 5))
                                 (lemma replace_par_pos_preservs_pos)
                                 (inst
                                  -1
                                  "delete(x, 1)"
                                  "delete(fst, 1)"
                                  "x`seq(1)"
                                  s)
                                 (expand delete -1 (2 3))
                                 (expand replace_par_pos -1)
                                 (expand finseq_appl)
                                 (expand delete -1 (2 3 4))
                                 (expand finseq_appl)
                                 (assert)
                                 (hide -1 -2 2)
                                 (expand SPP?)
                                 (flatten)
                                 (split)
                                 (("1"
                                   (rewrite
                                    add_first_parallel_pos_to_PP_is_PP)
                                   (("1"
                                     (expand finseq_appl)
                                     (hide 2)
                                     (skeep)
                                     (typepred i!1)
                                     (expand delete)
                                     (expand* PP? finseq_appl)
                                     (lift-if)
                                     (prop)
                                     (("1" (inst -4 i!1 1) (assert))
                                      ("2" (inst -3 1+i!1 1) (assert))))
                                    ("2" (rewrite delete_of_PP_is_PP))))
                                  ("2"
                                   (rewrite
                                    add_first_parallel_pos_to_SP_is_SP)
                                   (("1"
                                     (hide 2)
                                     (expand* SP? finseq_appl)
                                     (inst -3 1))
                                    ("2"
                                     (rewrite delete_of_SP_is_SP))))))))
                              ("2"
                               (hide -7 6)
                               (expand SPP?)
                               (flatten)
                               (lemma rest_of_PP_is_PP)
                               (inst -1 x)
                               (lemma complement_pos_is_PP)
                               (inst -1 "rest(x)" p)
                               (assert)
                               (expand complement_pos -1)
                               (expand rest -1 (1 2 3))
                               (expand* ^ min empty_seq)
                               (assert)
                               (rewrite
                                add_first_parallel_pos_to_SP_is_SP)
                               (("1"
                                 (hide 2)
                                 (rewrite replace_preserv_parallel_pos 1)
                                 (("1"
                                   (hide 2)
                                   (typepred
                                    "choose(complement_pos_set(p, x`seq(1)))")
                                   (expand complement_pos_set -1 1)
                                   (expand emptyset)
                                   (prop)
                                   (lemma pos_subterm_ax)
                                   (inst
                                    -1
                                    p
                                    "choose(complement_pos_set(p, x`seq(1)))"
                                    s)
                                   (assert)
                                   (expand* SP? finseq_appl)
                                   (inst -13 1)
                                   (assert))
                                  ("2"
                                   (hide 2)
                                   (expand* SP? finseq_appl)
                                   (lemma pos_subterm_ax)
                                   (inst -1 p p1!1 s)
                                   (inst -12 0)
                                   (assert))
                                  ("3"
                                   (typepred
                                    "choose(complement_pos_set(p, x`seq(1)))")
                                   (expand complement_pos_set -1 1)
                                   (expand emptyset)
                                   (prop)
                                   (expand PP? -12)
                                   (expand finseq_appl)
                                   (inst -12 0 1)
                                   (lemma parallel_pos_same_prefix)
                                   (inst
                                    -1
                                    p
                                    "x`seq(0)"
                                    "x`seq(1)"
                                    p1!1
                                    "choose(complement_pos_set(p, x`seq(1)))")
                                   (assert))))
                                ("2"
                                 (hide 2)
                                 (expand* SP? finseq_appl)
                                 (skeep)
                                 (lemma complement_pos_character)
                                 (inst
                                  -1
                                  "rest(rest(x))"
                                  p
                                  "complement_pos(p,
                                                                                                                                                                       rest[position[variable, symbol, arity]]
                                                                                                                                                                           (rest
                                                                                                                                                                            [position[variable, symbol, arity]]
                                                                                                                                                                            (x)))`seq
                                                                                                                                                            (i!1)")
                                 (rewrite rest_of_PP_is_PP)
                                 (prop)
                                 (("1"
                                   (skosimp)
                                   (expand rest -1 (1 2))
                                   (typepred i!2)
                                   (expand rest -1)
                                   (expand* ^ min empty_seq)
                                   (lift-if)
                                   (assert)
                                   (prop)
                                   (rewrite
                                    replace_preserv_parallel_pos
                                    5)
                                   (("1"
                                     (hide 6)
                                     (inst -13 2+i!2)
                                     (lemma pos_subterm_ax)
                                     (inst
                                      -1
                                      p
                                      "complement_pos(p,
                                                                                                                                                                             rest[position[variable, symbol, arity]]
                                                                                                                                                                                 (rest[position[variable, symbol, arity]](x)))`seq
                                                                                                                                                                  (i!1)"
                                      s)
                                     (assert))
                                    ("2"
                                     (hide 6)
                                     (lemma pos_subterm_ax)
                                     (inst -14 0)
                                     (inst -1 p p1!1 s)
                                     (assert))
                                    ("3"
                                     (expand PP? -12)
                                     (expand finseq_appl)
                                     (hide 6)
                                     (inst -12 0 2+i!2)
                                     (assert)
                                     (lemma parallel_pos_same_prefix)
                                     (inst
                                      -1
                                      p
                                      "x`seq(0)"
                                      "x`seq(2+i!2)"
                                      p1!1
                                      "complement_pos(p,
                                                                                                                                                                             rest[position[variable, symbol, arity]]
                                                                                                                                                                                 (rest[position[variable, symbol, arity]](x)))`seq
                                                                                                                                                                  (i!1)")
                                     (assert))))
                                  ("2"
                                   (hide 2)
                                   (expand* member_seq finseq_appl)
                                   (inst 1 i!1))))))
                              ("3"
                               (hide-all-but (-6 1 3 4 5))
                               (expand rest 1 1)
                               (expand* ^ min empty_seq)
                               (assert))))
                            ("2" (hide-all-but (-11 1 3 4)) (grind))))))
                        ("2"
                         (assert)
                         (inst 5 fst1!1)
                         (expand add_first 5 1)
                         (expand insert?)
                         (expand replace_par_pos 5)
                         (expand finseq_appl)
                         (rewrite rest_add_first)
                         (expand add_first 5)
                         (expand insert?)
                         (expand replace_par_pos -5)
                         (expand delete -5 (1 2 3))
                         (expand finseq_appl)
                         (rewrite rest_add_first -5)
                         (expand* add_first insert?)
                         (replace -5 5 rl)
                         (hide -5)
                         (expand replace_par_pos 5 1)
                         (expand finseq_appl)
                         (expand rest 5 (1 2 3))
                         (expand* ^ min empty_seq)
                         (lemma replace_par_pos_equivalence)
                         (inst -1 "rest(x)" "rest(fst)"
                          "replaceTerm
                                                                                                                        (s, fst`seq(0), x`seq(0))")
                         (expand finseq_appl)
                         (expand rest -1 (2 3 4 5 6 15 16))
                         (expand* ^ min)
                         (prop)
                         (("1"
                           (case "rest(delete(fst, 1)) = rest(rest(fst))")
                           (("1"
                             (replaces -2 5)
                             (rewrite replace_persistence 5)
                             (("1" (assert))
                              ("2"
                               (hide 6)
                               (lemma replace_par_pos_preservs_pos)
                               (inst -1 "rest(rest(x))" "rest(rest(fst))"
                                "x`seq(1)"
                                "replaceTerm(s, fst`seq(0), x`seq(0))")
                               (expand rest -1 (3 4 5 6))
                               (expand* ^ min empty_seq)
                               (prop)
                               (("1"
                                 (hide 2)
                                 (lemma seq_first_rest[position])
                                 (inst -1 "rest(x)")
                                 (expand* first finseq_appl)
                                 (expand rest -1 (1 3))
                                 (expand* ^ min)
                                 (replace -1 1 rl)
                                 (expand SPP?)
                                 (flatten)
                                 (rewrite rest_of_PP_is_PP)
                                 (hide -1)
                                 (expand rest 1)
                                 (expand* ^ min empty_seq)
                                 (expand* SP? PP? finseq_appl)
                                 (skeep)
                                 (rewrite replace_preserv_parallel_pos 1)
                                 (("1" (inst -8 1+i!1))
                                  ("2" (inst -8 0))
                                  ("3" (inst -7 0 1+i!1) (assert))))
                                ("2"
                                 (lift-if)
                                 (lift-if)
                                 (assert)
                                 (prop)
                                 (("1" (assert)) ("2" (assert))))))
                              ("3"
                               (hide 6)
                               (lemma replace_par_pos_preservs_pos)
                               (inst -1 "rest(rest(x))" "rest(rest(fst))"
                                "x`seq(0)"
                                "replaceTerm(s, fst`seq(0), x`seq(0))")
                               (prop)
                               (("1"
                                 (lemma closed_positions)
                                 (inst
                                  -1
                                  p
                                  p1
                                  "replace_par_pos(replaceTerm(s, fst`seq(0), x`seq(0)),
                                                                                                                                      rest(rest(x)), rest(rest(fst)))")
                                 (assert))
                                ("2"
                                 (hide 2)
                                 (expand SPP?)
                                 (flatten)
                                 (split)
                                 (("1"
                                   (rewrite
                                    add_first_parallel_pos_to_PP_is_PP)
                                   (hide 2)
                                   (skeep)
                                   (typepred i!1)
                                   (expand rest (-1 1))
                                   (expand* ^ min empty_seq finseq_appl)
                                   (lift-if)
                                   (assert)
                                   (prop)
                                   (expand* PP? finseq_appl)
                                   (inst -8 2+i!1 0)
                                   (assert))
                                  ("2"
                                   (rewrite
                                    add_first_parallel_pos_to_SP_is_SP)
                                   (("1"
                                     (hide 2)
                                     (lemma replace_preserv_pos)
                                     (inst -1 "x`seq(0)" s "fst`seq(0)")
                                     (assert)
                                     (expand* SP? finseq_appl)
                                     (inst -8 0))
                                    ("2"
                                     (hide 2)
                                     (expand rest 1)
                                     (expand* ^ min empty_seq)
                                     (assert)
                                     (expand* SP? PP? finseq_appl)
                                     (prop)
                                     (("1" (skeep))
                                      ("2" (skeep))
                                      ("3"
                                       (skeep)
                                       (rewrite
                                        replace_preserv_parallel_pos)
                                       (("1" (inst -8 2+i!1))
                                        ("2" (inst -8 0))
                                        ("3"
                                         (inst -7 0 2+i!1)
                                         (assert))))))))))
                                ("3"
                                 (hide-all-but (-10 1 4 5))
                                 (grind))))
                              ("4"
                               (hide 6)
                               (expand parallel)
                               (split)
                               (("1"
                                 (expand* SPP? PP? finseq_appl)
                                 (flatten)
                                 (inst -8 0 1)
                                 (expand parallel)
                                 (flatten)
                                 (expand <= (-1 5))
                                 (skosimp)
                                 (replace -1 -5)
                                 (inst 5 "p1!2 o p1!1")
                                 (rewrite o_assoc)
                                 (assert))
                                ("2"
                                 (expand* SPP? PP? finseq_appl)
                                 (flatten)
                                 (hide -4)
                                 (expand*
                                  nonempty?
                                  empty?
                                  member
                                  complement_pos_set
                                  emptyset)
                                 (copy -1)
                                 (expand <= -1)
                                 (skosimp)
                                 (inst -4 p1!2)
                                 (prop)
                                 (inst -9 0 1)
                                 (assert)
                                 (expand parallel)
                                 (propax))))))
                            ("2" (hide-all-but (-10 1 3 4)) (grind))))
                          ("2"
                           (hide 6)
                           (expand SPP?)
                           (flatten)
                           (rewrite rest_of_PP_is_PP)
                           (expand rest 1)
                           (expand* ^ min empty_seq)
                           (expand* SP? finseq_appl)
                           (skeep)
                           (expand* PP? finseq_appl)
                           (rewrite replace_preserv_parallel_pos)
                           (("1" (inst -7 1+i!1)) ("2" (inst -7 0))
                            ("3" (inst -6 0 1+i!1) (assert))))))))
                      ("2"
                       (hide-all-but (-2 -3 -8 -9 1 2 3))
                       (typepred
                        "choose(complement_pos_set(p, x`seq(0)))")
                       (expand complement_pos_set -1 1)
                       (lemma equal_prefix[posnat])
                       (inst -1 p
                        "choose(complement_pos_set(p, x`seq(0)))" p1!1)
                       (assert))))
                    ("2" (hide-all-but (1 2 3)) (grind))))
                  ("2"
                   (hide-all-but (-1 -6 -7 1 3 4))
                   (expand* nonempty? empty? member complement_pos_set
                    emptyset)
                   (inst -1 p1!1)
                   (assert))))
                ("2"
                 (hide-all-but (-2 1 2 3))
                 (expand SPP?)
                 (flatten)
                 (rewrite delete_of_PP_is_PP)
                 (rewrite delete_of_SP_is_SP))
                ("3"
                 (hide-all-but (-3 1 2 3))
                 (expand* delete member_seq finseq_appl)
                 (inst 1 0)
                 (assert))))
              ("2" (assert))))
            ("2" (assert))))
          ("2"
           (inst -1 "rest(x)")
           (rewrite length_rest)
           (inst -1 "rest(fst)" p p1
            "replaceTerm(s, fst`seq(0), x`seq(0))")
           (("1"
             (assert)
             (prop)
             (("1"
               (skosimp)
               (expand complement_pos 5)
               (case "nonempty?(complement_pos_set(p, x`seq(0)))")
               (("1"
                 (assert)
                 (inst 5 "add_first(fst`seq(0), fst1!1)")
                 (expand add_first 5 (1 2))
                 (expand insert?)
                 (expand replace_par_pos 5)
                 (expand finseq_appl)
                 (expand add_first 5 (1 2 3))
                 (expand insert?)
                 (rewrite rest_add_first)
                 (rewrite rest_add_first)
                 (replaces -3)
                 (typepred "choose(complement_pos_set(p, x`seq(0)))")
                 (expand complement_pos_set -1 1)
                 (expand emptyset)
                 (prop)
                 (name-replace "B"
                  "choose(complement_pos_set(p, x`seq(0)))")
                 (replace -2 6)
                 (rewrite replace_distributivity 6)
                 (expand* SPP? SP? finseq_appl)
                 (flatten)
                 (inst -6 0)
                 (assert))
                ("2"
                 (assert)
                 (inst 6 fst1!1)
                 (assert)
                 (expand replace_par_pos 6 1)
                 (expand finseq_appl)
                 (replaces -2)
                 (expand* SPP? SP? PP? finseq_appl)
                 (flatten)
                 (rewrite replace_persistence 6)
                 (("1" (inst -3 0))
                  ("2"
                   (inst -3 i)
                   (lemma closed_positions)
                   (inst -1 p p1 s)
                   (assert))
                  ("3"
                   (hide -1 7)
                   (expand parallel)
                   (split)
                   (("1"
                     (inst -2 0 i)
                     (assert)
                     (flatten)
                     (expand <= (-1 -4 5))
                     (skosimp*)
                     (inst 5 "p1!1 o p1!2")
                     (rewrite o_assoc)
                     (assert))
                    ("2"
                     (expand* nonempty? empty? member complement_pos_set
                      emptyset)
                     (copy -1)
                     (expand <= -1)
                     (skosimp)
                     (inst -3 p1!1)
                     (prop)
                     (inst -4 0 i)
                     (assert))))))))
              ("2"
               (hide 6)
               (expand SPP?)
               (flatten)
               (rewrite rest_of_PP_is_PP)
               (expand* rest ^ min empty_seq)
               (expand* SP? PP? finseq_appl)
               (skeep)
               (rewrite replace_preserv_parallel_pos)
               (("1" (inst -2 1+i!1)) ("2" (inst -2 0))
                ("3" (inst -1 0 1+i!1) (assert))))
              ("3"
               (hide 6)
               (expand* rest ^ min empty_seq member_seq finseq_appl)
               (inst 1 i-1)
               (assert))
              ("4" (hide -1 6) (grind))))
            ("2"
             (hide 6)
             (expand* SPP? SP? finseq_appl)
             (flatten)
             (inst -2 0))
            ("3" (assert))))))))))
    ("2" (hide 2) (skeep) (skeep) (assert))
    ("3"
     (hide 2)
     (skeep)
     (skeep)
     (expand SPP?)
     (rewrite complement_pos_is_PP)
     (expand* SP? finseq_appl)
     (flatten)
     (skeep)
     (lemma complement_pos_character)
     (inst -1 fsp p "complement_pos(p, fsp)`seq(i)")
     (assert)
     (prop)
     (("1"
       (skosimp)
       (inst -3 i!1)
       (lemma pos_subterm_ax)
       (inst -1 p "complement_pos(p, fsp)`seq(i)" s)
       (assert))
      ("2" (expand* member_seq finseq_appl) (inst 1 i))))
    ("4" (hide 2) (skeep) (skeep) (expand SPP?) (flatten))
    ("5"
     (hide 2)
     (skeep)
     (skeep)
     (expand* member_seq finseq_appl)
     (skosimp)
     (expand* SPP? SP? finseq_appl)
     (flatten)
     (inst -2 i!1)
     (lemma closed_positions)
     (inst -1 p p1 s)
     (assert))
    ("6"
     (hide 2)
     (skeep)
     (skeep)
     (lemma replace_par_pos_preservs_PP)
     (inst -1 fsp fst s)
     (assert)
     (expand* member_seq finseq_appl)
     (skosimp)
     (inst -1 i!1)
     (lemma closed_positions)
     (inst -1 p p1 "replace_par_pos(s, fsp, fst)")
     (assert))
    ("7" (hide 2) (skeep) (skeep) (assert))
    ("8" (hide 2) (skeep) (expand SPP?) (flatten))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (expand parallel_reduction_fix?)
   (skosimp)
   (typepred x)
   (skosimp)
   (expand V)
   (typepred p!1)
   (hide -5 2)
   (case "PP?(add_first(p!1, fsp))")
   (("1"
     (lemma replace_par_pos_preservs_subterm)
     (lemma replace_par_pos_preservs_pos)
     (inst -1 fsp "sigma_rhs(fss!1, fse!1)" p!1 "ext(sigma)(lhs(e))")
     (inst -2 fsp "sigma_rhs(fss!1, fse!1)" p!1 "ext(sigma)(lhs(e))")
     (expand SPP?)
     (assert)
     (case "SP?(ext(sigma)(lhs(e)))(add_first(p!1, fsp))")
     (("1"
       (case "sigma_rhs(fss!1, fse!1)`length = fsp`length")
       (("1"
         (assert)
         (replace -13 -3 rl)
         (replace -13 -4 rl)
         (expand* parallel_reduction? parallel_reduction_fix?)
         (inst 2 empty_seq)
         (("1"
           (inst 2 empty_seq empty_seq)
           (("1"
             (expand empty_seq 2)
             (expand replace_par_pos 2)
             (expand subtermsOF 2)
             (expand sigma_lhs 2)
             (expand empty_seq)
             (split)
             (("1" (decompose-equality 1) (skeep))
              ("2"
               (rewrite subterm_ext_commute -4)
               (rewrite subterm_ext_commute -4)
               (assert))))
            ("2" (hide-all-but 1) (expand* empty_seq member) (skeep))))
          ("2"
           (hide-all-but 1)
           (expand* empty_seq SPP? PP? SP? finseq_appl)
           (skeep))))
        ("2"
         (hide-all-but (-10 1))
         (expand sigma_rhs 1)
         (expand empty_seq)
         (lift-if)
         (assert))))
      ("2"
       (hide-all-but (-4 1))
       (reveal -13)
       (expand SPP?)
       (flatten)
       (rewrite add_first_parallel_pos_to_SP_is_SP)
       (hide 2)
       (rewrite ext_preserv_pos))))
    ("2"
     (rewrite add_first_parallel_pos_to_PP_is_PP)
     (("1"
       (hide 2)
       (expand finseq_appl)
       (skeep)
       (case "fsp`seq(i) = p!1")
       (("1"
         (lemma replace_par_pos_preservs_PP)
         (lemma replace_par_pos_subterm)
         (expand finseq_appl)
         (inst -1 fsp "sigma_rhs(fss!1, fse!1)" "ext(sigma)(lhs(e))")
         (assert)
         (inst -2 fsp "sigma_rhs(fss!1, fse!1)" "ext(sigma)(lhs(e))")
         (expand sigma_rhs -1 (1 3))
         (expand sigma_rhs -2 1)
         (expand finseq_appl)
         (expand* parallel_reduction? parallel_reduction_fix?)
         (inst 3 "#(empty_seq)")
         (("1"
           (inst 3 "#(fse!1`seq(i))" "#(fss!1`seq(i))")
           (("1"
             (expand "#" 3 (1 2 3 4))
             (prop)
             (("1"
               (expand "#")
               (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
               (decompose-equality 1)
               (("1"
                 (decompose-equality -10)
                 (("1"
                   (inst -1 i)
                   (expand subtermOF 1)
                   (rewrite subterm_ext_commute -1)
                   (assert))
                  ("2"
                   (hide-all-but 1)
                   (reveal -17)
                   (expand* SPP? SP? finseq_appl)
                   (flatten)
                   (inst -2 x!2))))
                ("2"
                 (hide-all-but 1)
                 (skeep)
                 (expand* positionsOF only_empty_seq catenate union
                  IUnion member empty_seq)
                 (lift-if)
                 (assert))))
              ("2"
               (expand "#")
               (expand replace_par_pos 1)
               (expand finseq_appl)
               (expand rest 1 1)
               (expand* ^ min)
               (expand empty_seq)
               (expand replace_par_pos 1)
               (expand replaceTerm 1)
               (expand sigma_rhs 1)
               (expand finseq_appl)
               (replace -11 -1 rl)
               (replace -11 -2 rl)
               (inst -1 i)
               (inst -2 i)
               (rewrite subterm_ext_commute -2)
               (assert))
              ("3" (reveal -3) (propax)) ("4" (reveal -3) (propax))
              ("5" (reveal -3) (propax)) ("6" (reveal -3) (propax))
              ("7" (reveal -3) (propax)) ("8" (reveal -3) (propax))))
            ("2"
             (hide-all-but 1)
             (typepred fse!1)
             (expand* "#" member)
             (skeep)
             (inst -1 i))))
          ("2"
           (hide-all-but 1)
           (expand* "#" SPP? PP? SP? finseq_appl)
           (skeep)
           (expand* positionsOF only_empty_seq catenate union IUnion
            member empty_seq)
           (lift-if)
           (assert))))
        ("2"
         (expand parallel)
         (split)
         (("1"
           (copy -1)
           (expand <= -1)
           (skosimp)
           (lemma ntCP_lemma_aux1)
           (inst -1 sigma "fss!1`seq(i)" E "fsp`seq(i)" e "fse!1`seq(i)")
           (("1"
             (prop)
             (("1" (skosimp) (expand Ambiguous?) (inst 2 t1!1 t2!1))
              ("2"
               (lemma pos_ax)
               (inst -1 "fsp`seq(i)" p1!1 "lhs(e)")
               (assert))
              ("3"
               (lemma variable_positions_parallel)
               (inst -1 "lhs(e)" "subtermOF(lhs(e), fsp`seq(i))" x
                "fsp`seq(i)" p!1)
               (("1"
                 (expand parallel)
                 (assert)
                 (prop)
                 (lemma variable_positions)
                 (inst -1 "lhs(e)" x "fsp`seq(i)" p!1)
                 (assert)
                 (expand* member Pos_var extend parallel)
                 (prop)
                 (lemma pos_ax)
                 (inst -1 "fsp`seq(i)" p1!1 "lhs(e)")
                 (assert))
                ("2" (expand V) (propax))))
              ("4"
               (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
               (decompose-equality -9)
               (("1"
                 (inst -1 i)
                 (rewrite subterm_ext_commute -1)
                 (lemma pos_ax)
                 (inst -1 "fsp`seq(i)" p1!1 "lhs(e)")
                 (assert))
                ("2"
                 (hide-all-but 1)
                 (reveal -14)
                 (expand* SPP? SP? finseq_appl)
                 (flatten)
                 (inst -2 x!1))))
              ("5"
               (reveal (-2 2))
               (expand "#" 1)
               (case "fsp`length=1")
               (("1"
                 (decompose-equality 1)
                 (decompose-equality 1)
                 (skeep)
                 (prop)
                 (("1" (assert)) ("2" (assert))))
                ("2"
                 (expand* SPP? PP? finseq_appl)
                 (flatten)
                 (assert)
                 (case "i=0")
                 (("1"
                   (replaces -1)
                   (inst -1 0 1)
                   (expand parallel)
                   (flatten)
                   (expand <= 2)
                   (inst 2 "fsp`seq(1)")
                   (replaces -3)
                   (rewrite empty_o_seq))
                  ("2"
                   (inst -1 0 i)
                   (expand parallel)
                   (assert)
                   (flatten)
                   (expand <= 4)
                   (inst 4 "fsp`seq(0)")
                   (replaces -3)
                   (rewrite empty_o_seq))))))))
            ("2"
             (hide-all-but 1)
             (typepred fse!1)
             (expand member -1)
             (inst -1 i))
            ("3" (expand member) (propax))))
          ("2"
           (expand parallel_reduction?)
           (reveal -1)
           (case "SPP?(ext(sigma)(x))(complement_pos(p!1, fsp))")
           (("1"
             (inst 3 "complement_pos(p!1, fsp)")
             (lemma replace_par_pos_subterm)
             (lemma replace_par_pos_preservs_PP)
             (expand finseq_appl)
             (inst -1 fsp "sigma_rhs(fss!1, fse!1)" "ext(sigma)(lhs(e))")
             (inst -2 fsp "sigma_rhs(fss!1, fse!1)" "ext(sigma)(lhs(e))")
             (assert)
             (expand sigma_rhs -1 1)
             (expand sigma_rhs -2 (1 3))
             (expand finseq_appl)
             (case "SPP?(ext(theta)(x))(complement_pos(p!1, fsp))")
             (("1"
               (case "FORALL(i:below[complement_pos(p!1, fsp)`length]):
                                                                                              EXISTS((e1|member(e1, E)), sg1): C(e1, sg1, ext(sigma)(x), ext(theta)(x), complement_pos(p!1, fsp)`seq(i))")
               (("1"
                 (lemma seq_construct2[rewrite_rule])
                 (inst -1
                  "D(ext(sigma)(x), ext(theta)(x), complement_pos(p!1, fsp), E)"
                  "complement_pos(p!1, fsp)`length")
                 (prop)
                 (("1"
                   (lemma seq_construct2[Sub])
                   (inst -1
                    "G(ext(sigma)(x), ext(theta)(x), complement_pos(p!1, fsp), E)"
                    "complement_pos(p!1, fsp)`length")
                   (prop)
                   (("1"
                     (skosimp*)
                     (expand parallel_reduction_fix?)
                     (inst 3 seq!2 seq!1)
                     (("1"
                       (assert)
                       (split)
                       (("1"
                         (expand subtermsOF 1)
                         (expand sigma_lhs 1)
                         (lift-if)
                         (prop)
                         (("1"
                           (expand empty_seq)
                           (assert)
                           (decompose-equality 1)
                           (expand finseq_appl)
                           (skeep))
                          ("2"
                           (expand finseq_appl)
                           (decompose-equality 2)
                           (("1"
                             (inst -2 x!1)
                             (inst -4 x!1)
                             (expand extend)
                             (expand* G D)
                             (flatten)
                             (skosimp*)
                             (hide -6)
                             (expand C)
                             (flatten)
                             (replace -2 -6)
                             (case "e!1 = seq!2`seq(x!1)")
                             (("1" (assert))
                              ("2"
                               (hide-all-but (-5 -6 1 5))
                               (lemma ntCP_lemma_aux1)
                               (inst -1 "seq!1`seq(x!1)" sigma!1 E
                                empty_seq e!1 "seq!2`seq(x!1)")
                               (assert)
                               (prop)
                               (("1"
                                 (skosimp)
                                 (expand Ambiguous?)
                                 (inst 2 t1!1 t2!1))
                                ("2"
                                 (hide-all-but 1)
                                 (expand*
                                  positionsOF
                                  only_empty_seq
                                  catenate
                                  union
                                  IUnion
                                  member
                                  empty_seq)
                                 (lift-if)
                                 (assert))
                                ("3"
                                 (hide-all-but -1)
                                 (expand* empty_seq subtermOF)
                                 (typepred e!1)
                                 (expand rewrite_rule?)
                                 (flatten)
                                 (expand lhs)
                                 (propax))
                                ("4" (expand* empty_seq subtermOF))))))
                            ("2"
                             (hide-all-but (-1 1))
                             (skeep)
                             (prop)
                             (("1" (assert)) ("2" (assert))))
                            ("3"
                             (hide-all-but (-9 1))
                             (skeep)
                             (expand* SPP? SP? finseq_appl)
                             (flatten)
                             (inst -2 i!1))))))
                        ("2"
                         (lemma replace_par_pos_subterm2)
                         (inst -1 fsp "sigma_rhs(fss!1, fse!1)" p!1
                          "fsp`seq(i)" "ext(sigma)(lhs(e))")
                         (assert)
                         (expand sigma_rhs -1 1)
                         (prop)
                         (("1"
                           (skosimp)
                           (expand extend)
                           (hide -7)
                           (replace -20 -2 rl)
                           (rewrite subterm_ext_commute -2)
                           (rewrite subterm_ext_commute -2)
                           (replace -15 -2)
                           (replace -2 1)
                           (case "fst1!1= sigma_rhs(seq!1, seq!2)")
                           (("1" (assert))
                            ("2"
                             (hide 2)
                             (expand sigma_rhs 1)
                             (expand empty_seq)
                             (lift-if)
                             (assert)
                             (prop)
                             (("1"
                               (decompose-equality 1)
                               (decompose-equality 1))
                              ("2"
                               (expand finseq_appl)
                               (decompose-equality 2)
                               (decompose-equality 1)
                               (("1"
                                 (inst -4 x!1)
                                 (inst -6 x!1)
                                 (expand* G D)
                                 (flatten)
                                 (skosimp*)
                                 (expand C)
                                 (flatten)
                                 (case "e!1 = seq!2`seq(x!1)")
                                 (("1"
                                   (replaces -1)
                                   (lemma complement_pos_character)
                                   (inst
                                    -1
                                    fsp
                                    p!1
                                    "complement_pos(p!1, fsp)`seq(x!1)")
                                   (prop)
                                   (("1"
                                     (skosimp)
                                     (inst -13 i!1)
                                     (inst -12 i!1)
                                     (replace -24 -13 rl)
                                     (replace -1 -13)
                                     (rewrite pos_subterm -13)
                                     (rewrite subterm_ext_commute -13)
                                     (replace -19 -13)
                                     (replace -13 -6)
                                     (replace -13 -10)
                                     (replace -6 -10)
                                     (lemma replace_par_pos_subterm)
                                     (inst
                                      -1
                                      "complement_pos(p!1, fsp)"
                                      fst1!1
                                      "ext(sigma)(x)")
                                     (expand finseq_appl)
                                     (inst -1 x!1)
                                     (assert))
                                    ("2"
                                     (hide-all-but (1 -14))
                                     (expand SPP?)
                                     (flatten))
                                    ("3"
                                     (hide-all-but 1)
                                     (expand* member_seq finseq_appl)
                                     (inst 1 x!1))))
                                  ("2"
                                   (hide-all-but (-4 -7 -8 1 5))
                                   (replaces -3)
                                   (lemma ntCP_lemma_aux1)
                                   (inst
                                    -1
                                    sigma!1
                                    "seq!1`seq(x!1)"
                                    E
                                    empty_seq
                                    "seq!2`seq(x!1)"
                                    e!1)
                                   (prop)
                                   (("1"
                                     (skosimp)
                                     (expand Ambiguous?)
                                     (inst 2 t1!1 t2!1))
                                    ("2"
                                     (hide-all-but 1)
                                     (expand*
                                      positionsOF
                                      only_empty_seq
                                      catenate
                                      union
                                      IUnion
                                      member
                                      empty_seq)
                                     (lift-if)
                                     (assert))
                                    ("3"
                                     (hide-all-but -1)
                                     (expand* empty_seq subtermOF)
                                     (typepred "seq!2`seq(x!1)")
                                     (expand rewrite_rule?)
                                     (flatten)
                                     (expand lhs)
                                     (propax))
                                    ("4" (expand* empty_seq subtermOF))
                                    ("5"
                                     (hide-all-but (-1 -3 1))
                                     (assert))))))
                                ("2"
                                 (hide-all-but (-1 -3 1))
                                 (skeep)
                                 (prop)
                                 (("1" (assert)) ("2" (assert))))))))))
                          ("2"
                           (hide-all-but 1)
                           (expand* member_seq finseq_appl)
                           (inst 1 i))))))
                      ("2"
                       (hide-all-but (-3 -4 1))
                       (expand member)
                       (skeep)
                       (inst -2 i!1)
                       (("1" (expand* extend D) (assert))
                        ("2" (assert))))))
                    ("2"
                     (expand extend)
                     (hide-all-but (-2 1))
                     (skeep)
                     (inst -1 i!1)
                     (skosimp)
                     (inst 1 sg1!1)
                     (expand G)
                     (inst 1 e1!1))))
                  ("2"
                   (hide-all-but (-1 1))
                   (expand extend)
                   (skeep)
                   (inst -1 i!1)
                   (skosimp)
                   (inst 1 e1!1)
                   (expand D)
                   (inst 1 sg1!1))))
                ("2"
                 (hide 4)
                 (skeep)
                 (lemma complement_pos_character)
                 (inst -1 fsp p!1 "complement_pos(p!1, fsp)`seq(i!1)")
                 (prop)
                 (("1"
                   (skosimp)
                   (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
                   (decompose-equality -14)
                   (("1"
                     (inst -1 i!2)
                     (replace -2 -1)
                     (rewrite pos_subterm -1)
                     (("1"
                       (rewrite subterm_ext_commute -1)
                       (inst 1 "fse!1`seq(i!2)" "fss!1`seq(i!2)")
                       (("1"
                         (expand C 1)
                         (assert)
                         (inst -5 i!2)
                         (replace -15 -5 rl)
                         (replace -2 -5)
                         (rewrite pos_subterm -5)
                         (("1" (rewrite subterm_ext_commute -5) (assert))
                          ("2"
                           (lemma complement_pos_character)
                           (inst -1 fsp p!1
                            "complement_pos(p!1, fsp)`seq(i!1)")
                           (prop)
                           (("1"
                             (skosimp)
                             (replace -1 1 rl)
                             (inst -5 i!3)
                             (assert))
                            ("2" (expand SPP? -7) (flatten))
                            ("3"
                             (hide-all-but 1)
                             (expand* member_seq finseq_appl)
                             (inst 1 i!1))))))
                        ("2"
                         (hide-all-but 1)
                         (typepred fse!1)
                         (expand member -1)
                         (inst -1 i!2))))
                      ("2"
                       (hide 2)
                       (lemma complement_pos_character)
                       (inst -1 fsp p!1
                        "complement_pos(p!1, fsp)`seq(i!1)")
                       (prop)
                       (("1"
                         (skosimp)
                         (replace -1 1 rl)
                         (hide-all-but (-8 1))
                         (expand* SPP? SP? finseq_appl)
                         (flatten)
                         (inst -2 i!3))
                        ("2"
                         (hide-all-but (-7 1))
                         (expand SPP?)
                         (flatten))
                        ("3"
                         (hide-all-but 1)
                         (expand* member_seq finseq_appl)
                         (inst 1 i!1))))))
                    ("2"
                     (hide-all-but (-8 1))
                     (expand* SPP? SP? finseq_appl)
                     (flatten)
                     (inst -2 x!1))))
                  ("2" (hide-all-but (-5 1)) (expand SPP?) (flatten))
                  ("3"
                   (hide-all-but 1)
                   (expand* member_seq finseq_appl)
                   (inst 1 i!1))))
                ("3"
                 (skeep)
                 (hide-all-but (-1 -4 1))
                 (expand* SPP? SP? finseq_appl)
                 (flatten)
                 (inst -2 i!1)
                 (inst -4 i!1)
                 (assert))))
              ("2"
               (expand SPP? (-4 1))
               (flatten)
               (rewrite complement_pos_is_PP)
               (expand SP? 1)
               (expand finseq_appl)
               (skeep)
               (lemma complement_pos_character)
               (inst -1 fsp p!1 "complement_pos(p!1, fsp)`seq(i!1)")
               (assert)
               (prop)
               (("1"
                 (skosimp)
                 (replace -15 -2 rl)
                 (inst -2 i!2)
                 (replace -1 -2)
                 (lemma pos_subterm_ax)
                 (inst -1 p!1 "complement_pos(p!1, fsp)`seq(i!1)"
                  "ext(theta)(lhs(e))")
                 (assert)
                 (rewrite subterm_ext_commute -1)
                 (assert))
                ("2"
                 (hide-all-but 1)
                 (expand* member_seq finseq_appl)
                 (inst 1 i!1))))))
            ("2"
             (hide 4)
             (expand SPP?)
             (flatten)
             (rewrite complement_pos_is_PP)
             (expand* SP? finseq_appl)
             (lemma complement_pos_character)
             (skeep)
             (inst -1 fsp p!1 "complement_pos(p!1, fsp)`seq(i!1)")
             (prop)
             (("1"
               (skosimp)
               (inst -3 i!2)
               (lemma pos_subterm_ax)
               (inst -1 p!1 "complement_pos(p!1, fsp)`seq(i!1)"
                "ext(sigma)(lhs(e))")
               (assert)
               (rewrite subterm_ext_commute -1)
               (assert))
              ("2"
               (hide-all-but 1)
               (expand* member_seq finseq_appl)
               (inst 1 i!1))))
            ("3" (expand SPP?) (flatten))))))))
      ("2" (reveal -1) (expand SPP?) (propax))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand parallel_reduction? -3)
   (skosimp)
   (lemma parallel_reduction_result)
   (inst -1 E e fsp!1 sigma t)
   (expand member)
   (assert)
   (case "fsp!1 = #(empty_seq)")
   (("1"
     (hide -2)
     (inst 1 t)
     (expand parallel_reduction_fix? -4)
     (skosimp)
     (replaces -1)
     (expand* "#")
     (expand* replace_par_pos finseq_appl)
     (expand* rest ^ min empty_seq)
     (lift-if)
     (assert)
     (expand* replace_par_pos finseq_appl)
     (expand replaceTerm)
     (expand sigma_rhs)
     (expand finseq_appl)
     (lemma non_ambiguous_implies_same_term)
     (inst -1 E empty_seq "ext(sigma)(lhs(e))" "ext(sigma)(rhs(e))" t)
     (expand Orthogonal?)
     (flatten)
     (assert)
     (lemma parallel_reduction_reflexive)
     (inst -1 E)
     (expand reflexive?)
     (inst -1 t)
     (assert)
     (prop)
     (("1" (assert))
      ("2"
       (hide-all-but 1)
       (expand* positionsOF only_empty_seq union IUnion member catenate
        empty_seq)
       (lift-if)
       (assert))
      ("3"
       (expand* empty_seq reduction_fix?)
       (inst 1 e sigma)
       (("1"
         (prop)
         (("1" (expand subtermOF) (propax))
          ("2" (expand replaceTerm) (propax))))
        ("2" (expand member) (propax))))
      ("4"
       (expand* empty_seq reduction_fix?)
       (inst 1 "fse!1`seq(0)" "fss!1`seq(0)")
       (("1"
         (split)
         (("1"
           (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
           (expand* subtermOF)
           (decompose-equality -6)
           (inst -1 0))
          ("2" (expand replaceTerm) (propax))))
        ("2" (typepred fse!1) (expand member -1) (inst -1 0))))))
    ("2"
     (assert)
     (skosimp)
     (lemma parallel_reduction_closed_subs)
     (inst -1 E sigma "rhs(e)" theta!1)
     (inst 2 "ext(theta!1)(rhs(e))")
     (split 2)
     (("1"
       (assert)
       (typepred e)
       (expand rewrite_rule?)
       (flatten)
       (skeep)
       (expand* subset? member)
       (inst -1 x)
       (lemma parallel_reduction_variables)
       (expand Orthogonal?)
       (inst -1 E e fsp!1 sigma theta!1)
       (flatten)
       (assert)
       (expand parallel_reduction? -1)
       (prop)
       (("1"
         (inst -2 x)
         (("1" (skosimp) (expand parallel_reduction? 3) (inst 3 fsp!2))
          ("2"
           (expand Vars)
           (skosimp)
           (inst 1 p!1)
           (("1" (expand lhs 1) (propax))
            ("2" (typepred p!1) (expand lhs 1) (propax))))))
        ("2"
         (typepred x)
         (expand Vars)
         (expand rhs -2)
         (skosimp)
         (inst 1 p!1))))
      ("2"
       (hide -1)
       (expand parallel_reduction? 1)
       (inst 1 "#(empty_seq)")
       (("1"
         (expand parallel_reduction_fix? 1)
         (inst 1 "#(e)" "#(theta!1)")
         (("1"
           (expand "#")
           (expand empty_seq)
           (split)
           (("1"
             (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
             (expand subtermOF 1)
             (decompose-equality 1))
            ("2"
             (expand* replace_par_pos finseq_appl)
             (expand replaceTerm)
             (expand rest 1 1)
             (expand* ^ min empty_seq)
             (expand* replace_par_pos finseq_appl)
             (expand sigma_rhs 1)
             (expand finseq_appl)
             (propax))))
          ("2"
           (expand member)
           (skeep)
           (typepred i)
           (expand* "#" member))))
        ("2"
         (expand* "#" SPP? SP? PP? finseq_appl)
         (skeep)
         (hide-all-but 1)
         (expand* positionsOF only_empty_seq union member IUnion catenate
          empty_seq)
         (lift-if)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp1`length" fsp1)
   (("1"
     (skeep)
     (case "x`length=0")
     (("1"
       (measure-induct "fsp`length" fsp)
       (("1"
         (hide -2)
         (skosimp)
         (skeep)
         (case "x!1`length=0")
         (("1"
           (hide -2)
           (expand parallel_reduction_fix?)
           (skosimp)
           (expand replace_par_pos)
           (assert))
          ("2"
           (expand parallel_reduction_fix?)
           (assert)
           (skosimp)
           (expand replace_par_pos -1 1)
           (expand replace_par_pos (-7 2))
           (expand finseq_appl)
           (inst -1 "rest(x!1)")
           (rewrite length_rest)
           (inst -1 E s
            "replaceTerm(t, subtermsOF(s, x!1)`seq(0),
                                               x!1`seq(0))")
           (assert)
           (prop)
           (("1" (rewrite subtermsOF_rest 2) (expand SPP? -2) (propax))
            ("2"
             (expand SPP? (-1 1))
             (flatten)
             (rewrite rest_of_PP_is_PP)
             (expand* SP? finseq_appl)
             (skeep)
             (typepred i)
             (expand rest (-1 1))
             (expand* ^ min)
             (expand empty_seq -1)
             (lift-if)
             (assert)
             (prop)
             (inst-cp -3 1+i)
             (inst -3 0)
             (expand* PP? finseq_appl)
             (assert)
             (inst -2 0 1+i)
             (rewrite replace_preserv_parallel_pos))
            ("3"
             (expand SPP? (-2 1))
             (flatten)
             (assert)
             (expand* SP? PP? finseq_appl)
             (skeep))
            ("4"
             (replaces -6)
             (expand subtermsOF 1 (2 3))
             (expand finseq_appl)
             (rewrite replace_subterm_of_term)
             (("1" (inst 1 fse!1 fss!1) (assert))
              ("2"
               (expand SPP? -1)
               (flatten)
               (expand* SP? finseq_appl)
               (inst -2 0))))
            ("5" (skeep))))))
        ("2" (skeep) (hide-all-but 1) (expand subtermsOF) (propax))
        ("3"
         (skeep)
         (hide-all-but (-1 -3 -5 1))
         (expand SPP?)
         (flatten)
         (expand* parallel_reduction_fix? replace_par_pos finseq_appl)
         (skosimp)
         (assert))))
      ("2"
       (skeep 2)
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (expand parallel_reduction_fix? -4)
       (skosimp)
       (expand replace_par_pos -7)
       (expand finseq_appl)
       (assert)
       (expand sigma_rhs -7 1)
       (expand finseq_appl)
       (rewrite sigma_rhs_rest -7)
       (inst -1 E fsp s
        "replaceTerm(t, ext(fss!1`seq(0))(rhs(fse!1`seq(0))),
                                           x`seq(0))")
       (assert)
       (prop)
       (("1"
         (inst -8 0)
         (skosimp)
         (lemma replace_par_pos_equivalence1)
         (inst -1 fsp "subtermsOF(s, fsp)" j!1 t)
         (assert)
         (expand finseq_appl)
         (expand subtermsOF -1 1)
         (replace -1 2 rl)
         (lemma replace_par_pos_equivalence1)
         (inst -1 fsp "subtermsOF(s, fsp)" j!1
          "replaceTerm(t, ext(fss!1`seq(0))(rhs(fse!1`seq(0))),
                                             x`seq(0))")
         (assert)
         (expand subtermsOF -1 1)
         (prop)
         (("1"
           (expand finseq_appl)
           (replace -1 -3 rl)
           (hide -1 -2)
           (case "replaceTerm(replaceTerm(t,ext(fss!1`seq(0))(rhs(fse!1`seq(0))),x`seq(0)),
                                                    subtermsOF(s, fsp)`seq(j!1),
                                                    fsp`seq(j!1)) =
                              replaceTerm(t, subtermsOF(s, fsp)`seq(j!1),fsp`seq(j!1))")
           (("1" (assert))
            ("2"
             (hide -1 -7 3)
             (expand subtermsOF 1)
             (expand finseq_appl)
             (expand <=)
             (skosimp)
             (replace -6)
             (rewrite replace_dominance 1)
             (expand SPP? -2)
             (flatten)
             (expand* SP? finseq_appl)
             (inst -3 0)
             (assert))))
          ("2"
           (hide -1 -2 -8 3)
           (expand SPP?)
           (flatten)
           (assert)
           (expand* SP? finseq_appl)
           (skeep)
           (case i=j!1)
           (("1"
             (replaces -1)
             (lemma replace_preserv_pos)
             (inst -1 "x`seq(0)" t
              "ext(fss!1`seq(0))(rhs(fse!1`seq(0)))")
             (inst -5 0)
             (assert)
             (inst -3 j!1)
             (lemma closed_positions)
             (inst -1 "fsp`seq(j!1)" "x`seq(0)"
              "replaceTerm(t, ext(fss!1`seq(0))(rhs(fse!1`seq(0))),
                                            x`seq(0))")
             (assert))
            ("2"
             (lemma replace_preserv_parallel_pos)
             (inst -1 "x`seq(0)" "fsp`seq(i)" t
              "ext(fss!1`seq(0))(rhs(fse!1`seq(0)))")
             (inst -3 i)
             (inst -5 0)
             (assert)
             (expand PP? -1)
             (inst -1 j!1 i)
             (expand finseq_appl)
             (expand <=)
             (skosimp)
             (replace -8)
             (rewrite comp_preservs_parallel_pos2))))))
        ("2"
         (expand SPP?)
         (flatten)
         (assert)
         (expand* SP? finseq_appl)
         (skeep)
         (inst -9 0)
         (skosimp)
         (case j!1=i)
         (("1"
           (replaces -1)
           (lemma replace_preserv_pos)
           (inst -1 "x`seq(0)" t "ext(fss!1`seq(0))(rhs(fse!1`seq(0)))")
           (inst -5 0)
           (assert)
           (lemma closed_positions)
           (inst -1 "fsp`seq(i)" "x`seq(0)"
            "replaceTerm(t, ext(fss!1`seq(0))(rhs(fse!1`seq(0))),
                                          x`seq(0))")
           (assert))
          ("2"
           (rewrite replace_preserv_parallel_pos)
           (("1" (inst -2 i)) ("2" (inst -4 0))
            ("3"
             (expand PP? -1)
             (inst -1 j!1 i)
             (expand finseq_appl)
             (expand <=)
             (skosimp)
             (replace -9)
             (rewrite comp_preservs_parallel_pos2))))))
        ("3"
         (expand SPP? (-2 1))
         (flatten)
         (rewrite rest_of_PP_is_PP)
         (expand rest 1)
         (expand* ^ min)
         (expand empty_seq)
         (expand SP?)
         (prop)
         (("1" (skeep)) ("2" (skeep))
          ("3"
           (skeep 3)
           (expand finseq_appl)
           (inst-cp -3 1+i)
           (inst -3 0)
           (expand* PP? finseq_appl)
           (inst -2 0 1+i)
           (assert)
           (rewrite replace_preserv_parallel_pos))))
        ("4"
         (expand parallel_reduction_fix?)
         (inst 1 "rest(fse!1)" "rest(fss!1)")
         (("1"
           (prop)
           (("1" (hide-all-but (-3 1)) (grind))
            ("2" (hide-all-but (-4 1)) (grind))
            ("3"
             (hide-all-but (-3 -4 -5 1))
             (expand* rest ^ min empty_seq)
             (lift-if)
             (prop)
             (("1"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand finseq_appl)
               (expand empty_seq)
               (lift-if)
               (lift-if)
               (assert)
               (decompose-equality 1)
               (("1" (skeep)) ("2" (skeep))))
              ("2"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand finseq_appl)
               (expand empty_seq)
               (lift-if)
               (assert)
               (decompose-equality 1)
               (("1" (skeep)) ("2" (skeep))))
              ("3"
               (expand subtermsOF 3)
               (expand sigma_lhs 3)
               (expand finseq_appl)
               (expand empty_seq)
               (lift-if)
               (assert)
               (decompose-equality 3)
               (("1"
                 (expand subtermsOF -3)
                 (expand sigma_lhs -3)
                 (expand finseq_appl)
                 (decompose-equality -3)
                 (("1"
                   (inst -1 1+x!1)
                   (replace -1 1 rl)
                   (rewrite replace_persistence)
                   (("1"
                     (reveal -4)
                     (expand* SPP? SP? finseq_appl)
                     (flatten)
                     (inst -2 0))
                    ("2"
                     (reveal -4)
                     (expand* SPP? SP? finseq_appl)
                     (flatten)
                     (inst -2 1+x!1))
                    ("3"
                     (reveal -4)
                     (expand* SPP? PP? finseq_appl)
                     (flatten)
                     (inst -1 0 1+x!1)
                     (assert))))
                  ("2"
                   (reveal -3)
                   (expand* SPP? SP? finseq_appl)
                   (flatten)
                   (inst -2 x1!1))))
                ("2" (skeep) (hide -3) (grind))
                ("3" (skeep) (hide -3) (typepred i) (lift-if) (assert))
                ("4" (skeep) (typepred i) (lift-if) (assert))
                ("5"
                 (skeep)
                 (reveal -3)
                 (expand* SPP? SP? PP? finseq_appl)
                 (flatten)
                 (rewrite replace_preserv_parallel_pos)
                 (("1" (inst -2 1+i)) ("2" (inst -2 0))
                  ("3" (inst -1 0 1+i) (assert))))
                ("6"
                 (reveal -3)
                 (expand* SPP? SP? finseq_appl)
                 (flatten)
                 (inst -2 0)
                 (skeep))))))))
          ("2"
           (hide-all-but 1)
           (expand* rest ^ min empty_seq)
           (typepred fse!1)
           (expand member)
           (skeep)
           (typepred i)
           (lift-if)
           (assert)
           (prop)
           (inst -2 1+i))))
        ("5"
         (hide-all-but (-7 1 2))
         (skeep)
         (typepred i)
         (expand* rest ^ min empty_seq)
         (lift-if)
         (assert)
         (prop)
         (inst -2 1+i)
         (("1" (skosimp) (inst 3 j!1) (assert)) ("2" (assert))))))))
    ("2" (skeep) (expand subtermsOF 1) (propax))
    ("3"
     (skeep)
     (hide 2)
     (expand* SPP? finseq_appl)
     (flatten)
     (expand SP? 1)
     (expand finseq_appl)
     (skeep)
     (expand parallel_reduction_fix?)
     (skosimp)
     (case "PP?(add_first(fsp`seq(i),fsp1))")
     (("1"
       (lemma replace_par_pos_preservs_pos)
       (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" "fsp`seq(i)" t)
       (expand SPP?)
       (expand sigma_rhs -1 1)
       (rewrite add_first_parallel_pos_to_SP_is_SP)
       (("1" (assert) (lift-if) (expand empty_seq) (propax))
        ("2" (expand SP? -3) (expand finseq_appl) (inst -3 i))))
      ("2"
       (rewrite add_first_parallel_pos_to_PP_is_PP)
       (expand finseq_appl)
       (hide 2)
       (skosimp)
       (expand parallel)
       (split)
       (("1"
         (inst -10 i!1)
         (skosimp)
         (expand PP? -2)
         (expand finseq_appl)
         (case j!1=i)
         (("1"
           (replaces -1)
           (lemma replace_par_pos_preservs_PP)
           (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" t)
           (expand SPP?)
           (expand sigma_rhs -1 1)
           (expand finseq_appl)
           (inst -1 i!1)
           (replace -10 -1 rl)
           (expand <=)
           (skosimp*)
           (replaces -2)
           (case "p1!1`length=0")
           (("1"
             (rewrite empty_0 -1)
             (replaces -1)
             (rewrite seq_o_empty))
            ("2" (expand o -10) (decompose-equality -10) (assert))))
          ("2"
           (assert)
           (inst -2 j!1 i)
           (expand parallel)
           (flatten)
           (expand <=)
           (skosimp*)
           (replaces -9)
           (inst 2 "p1!2 o p1!1")
           (rewrite o_assoc))))
        ("2"
         (lemma replace_par_pos_preservs_PP)
         (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" t)
         (expand* SPP? finseq_appl)
         (expand sigma_rhs -1 1)
         (inst -1 i!1)
         (replace -10 -1 rl)
         (lemma closed_positions)
         (inst -1 "fsp`seq(i)" "fsp1`seq(i!1)" s)
         (assert))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (typepred i)
   (lemma union_positions)
   (inst -1 fsp1 fsp2)
   (expand SPP?)
   (flatten)
   (assert)
   (case "seq2set(fsp1)(fsp1`seq(i))")
   (("1"
     (replaces -2)
     (rewrite seq2set_comp)
     (split)
     (("1"
       (rewrite seq2set_comp)
       (split)
       (("1"
         (lemma member_seq_in_seq2set[position])
         (inst -1 "Pos_Over(fsp1, fsp2)" "fsp1`seq(i)")
         (assert)
         (expand* member_seq finseq_appl)
         (skosimp)
         (typepred i!1)
         (inst 1 i!1)
         (("1"
           (expand <=)
           (inst 1 empty_seq)
           (rewrite seq_o_empty)
           (expand o)
           (lift-if)
           (prop)
           (assert))
          ("2" (expand o) (assert))))
        ("2"
         (lemma member_seq_in_seq2set[position])
         (inst -1 "Pos_Equal(fsp1, fsp2)" "fsp1`seq(i)")
         (assert)
         (expand* member_seq finseq_appl)
         (skosimp)
         (typepred i!1)
         (inst 1
          "Pos_Over(fsp1, fsp2)`length + Pos_Over(fsp2, fsp1)`length + i!1")
         (("1"
           (expand o)
           (expand <=)
           (inst 1 empty_seq)
           (rewrite seq_o_empty))
          ("2" (expand o) (assert))))))
      ("2"
       (lemma member_seq_in_seq2set[position])
       (inst -1 "Pos_Under(fsp1, fsp2)" "fsp1`seq(i)")
       (assert)
       (lemma Pos_Under_character)
       (inst -1 fsp1 fsp2 "fsp1`seq(i)")
       (expand finseq_appl)
       (skolem -1 j)
       (lemma sub_pos_is_under)
       (inst -1 fsp1 "fsp2`seq(j)" "fsp1`seq(i)")
       (assert)
       (flatten)
       (expand <= -1)
       (skosimp)
       (lemma pos_up_in_Pos_Over)
       (inst -1 fsp2 fsp1 "fsp2`seq(j)" "p1!1")
       (assert)
       (prop)
       (("1"
         (expand member_seq -1)
         (expand finseq_appl)
         (skosimp)
         (inst 2 "Pos_Over(fsp1,fsp2)`length + i!1")
         (("1" (expand o 2) (expand <= 2) (inst 2 p1!1) (assert))
          ("2" (expand o 1) (assert))))
        ("2"
         (rewrite empty_0)
         (replaces -1)
         (rewrite seq_o_empty)
         (assert))
        ("3" (expand member_seq 1) (expand finseq_appl) (inst 1 j))
        ("4"
         (expand member_seq 1)
         (expand finseq_appl)
         (inst 1 i)
         (assert))))))
    ("2" (expand seq2set 1) (expand finseq_appl) (inst 1 i))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (measure-induct "fsp2`length" fsp2)
   (("1"
     (skeep)
     (skeep)
     (case "x`length=0")
     (("1"
       (hide -2)
       (expand complement_pos)
       (expand empty_seq)
       (assert)
       (expand parallel_reduction_fix?)
       (inst 1 empty_seq empty_seq)
       (("1"
         (expand empty_seq)
         (skosimp)
         (expand replace_par_pos)
         (assert)
         (expand subtermsOF 1)
         (expand sigma_lhs 1)
         (expand empty_seq)
         (decompose-equality 1)
         (skeep))
        ("2" (skeep) (expand empty_seq) (expand member) (skeep))))
      ("2"
       (expand parallel_reduction_fix? -3)
       (skosimp)
       (expand* replace_par_pos finseq_appl)
       (assert)
       (inst -1 "rest(x)")
       (rewrite length_rest)
       (inst -1 E p
        "replaceTerm(t, sigma_rhs(fss!1, fse!1)`seq(0),
                                                       x`seq(0))"
        t2)
       (expand SPP?)
       (rewrite rest_of_PP_is_PP)
       (flatten)
       (prop)
       (("1"
         (expand complement_pos 2)
         (lift-if)
         (prop)
         (("1"
           (expand parallel_reduction_fix?)
           (skosimp)
           (inst 1 "add_first(fse!1`seq(0), fse!2)"
            "add_first(fss!1`seq(0), fss!2)")
           (("1"
             (expand add_first 1 (1 2 3 4))
             (expand insert?)
             (assert)
             (prop)
             (("1"
               (expand* add_first insert? finseq_appl)
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand finseq_appl)
               (decompose-equality)
               (("1"
                 (lift-if)
                 (prop)
                 (("1"
                   (expand subtermsOF -11)
                   (expand sigma_lhs -11)
                   (expand finseq_appl)
                   (decompose-equality -11)
                   (("1"
                     (inst -1 0)
                     (typepred "choose(complement_pos_set(p, x`seq(0)))")
                     (expand complement_pos_set -1 1)
                     (expand emptyset)
                     (prop)
                     (replace -3 2 rl)
                     (lemma pos_subterm)
                     (inst -1 p "choose(complement_pos_set(p, x`seq(0)))"
                      t)
                     (expand* SP? finseq_appl)
                     (inst -12 0)
                     (assert))
                    ("2" (expand* SP? finseq_appl) (inst -10 x1!1))))
                  ("2"
                   (lemma complement_pos_character)
                   (inst -1 "rest(x)" p
                    "complement_pos(p, rest(x))`seq(x!1 - 1)")
                   (("1"
                     (rewrite rest_of_PP_is_PP)
                     (prop)
                     (("1"
                       (skosimp)
                       (typepred i!1)
                       (expand rest -1)
                       (expand rest -2 1)
                       (expand* ^ min empty_seq)
                       (lift-if)
                       (assert)
                       (prop)
                       (expand subtermsOF -6)
                       (expand sigma_lhs -6)
                       (expand finseq_appl)
                       (decompose-equality -6)
                       (("1"
                         (inst -1 "x!1 - 1")
                         (replace -1 6 rl)
                         (hide -1 -7)
                         (lemma pos_subterm)
                         (inst-cp -1 p
                          "complement_pos(p, rest(x))`seq(x!1 - 1)"
                          "replaceTerm(t,
                                                                                         sigma_rhs(fss!1, fse!1)`seq(0),
                                                                                         x`seq(0))")
                         (prop)
                         (("1"
                           (inst -2 p
                            "complement_pos(p, rest(x))`seq(x!1 - 1)" t)
                           (prop)
                           (("1"
                             (replace -1 6 rl)
                             (replace -2 6 rl)
                             (hide -1 -2)
                             (replace -1 6 rl)
                             (lemma replace_persistence)
                             (inst -1 "x`seq(0)" "x`seq(1+i!1)" t
                              "sigma_rhs(fss!1, fse!1)`seq(0)")
                             (expand* SP? PP? finseq_appl)
                             (inst-cp -8 1+i!1)
                             (inst -8 0)
                             (assert)
                             (inst -6 0 1+i!1)
                             (assert))
                            ("2"
                             (expand* SP? finseq_appl)
                             (inst -8 1+i!1)
                             (assert))))
                          ("2"
                           (lemma replace_preserv_parallel_pos)
                           (inst -1 "x`seq(0)" "x`seq(1+i!1)" t
                            "sigma_rhs(fss!1, fse!1)`seq(0)")
                           (expand* SP? PP? finseq_appl)
                           (inst-cp -9 1+i!1)
                           (inst -9 0)
                           (assert)
                           (inst -7 0 1+i!1)
                           (assert))))
                        ("2"
                         (hide -8 -9 -15)
                         (rewrite pos_subterm_ax)
                         (hide 2)
                         (lemma complement_pos_character)
                         (inst -1 "rest(x)" p
                          "complement_pos(p, rest(x))`seq(x1!1)")
                         (rewrite rest_of_PP_is_PP)
                         (prop)
                         (("1"
                           (skosimp)
                           (typepred i!3)
                           (expand rest -1)
                           (expand rest -2 1)
                           (expand* ^ min empty_seq)
                           (replace -2 1 rl)
                           (expand* SP? PP? finseq_appl)
                           (rewrite replace_preserv_parallel_pos)
                           (("1" (inst -11 1+i!3)) ("2" (inst -11 0))
                            ("3" (inst -10 0 1+i!3) (assert))))
                          ("2"
                           (expand member_seq 1)
                           (expand finseq_appl)
                           (inst 1 x1!1))))))
                      ("2"
                       (expand member_seq 1)
                       (expand finseq_appl)
                       (inst 1 x!1-1)
                       (assert))))
                    ("2" (assert))))))
                ("2"
                 (skeep)
                 (hide-all-but (-2 -3 1))
                 (prop)
                 (("1" (assert)) ("2" (assert))))
                ("3" (skeep) (assert)) ("4" (skeep) (assert))
                ("5" (skeep)) ("6" (skeep))
                ("7"
                 (skeep)
                 (hide -4 -5 3)
                 (lemma complement_pos_character)
                 (inst -1 "rest(x)" p
                  "complement_pos(p, rest(x))`seq(i_1 - 1)")
                 (("1"
                   (rewrite rest_of_PP_is_PP)
                   (prop)
                   (("1"
                     (skosimp)
                     (typepred i!1)
                     (expand rest -1)
                     (expand rest -2 1)
                     (expand* ^ min empty_seq)
                     (lift-if)
                     (assert)
                     (prop)
                     (expand* SP? finseq_appl)
                     (inst -7 1+i!1)
                     (rewrite pos_subterm_ax))
                    ("2"
                     (expand member_seq 1)
                     (expand finseq_appl)
                     (inst 1 i_1-1)
                     (assert))))
                  ("2" (assert))))
                ("8" (skeep) (assert))
                ("9"
                 (skosimp)
                 (typepred "choose(complement_pos_set(p, x`seq(0)))")
                 (expand complement_pos_set -1 1)
                 (expand emptyset)
                 (prop)
                 (hide -7 -8 3)
                 (expand* SP? finseq_appl)
                 (inst -8 0)
                 (rewrite pos_subterm_ax))))
              ("2"
               (expand replace_par_pos 1)
               (rewrite sigma_rhs_rest)
               (("1"
                 (rewrite rest_add_first)
                 (rewrite rest_add_first)
                 (rewrite rest_add_first)
                 (expand finseq_appl)
                 (expand* add_first insert? finseq_appl)
                 (expand sigma_rhs 1 1)
                 (expand finseq_appl)
                 (expand sigma_rhs -5 1)
                 (expand finseq_appl)
                 (typepred
                  "choose(complement_pos_set
                                                                            (p, x`seq(0)))")
                 (expand complement_pos_set -1 1)
                 (expand emptyset)
                 (prop)
                 (replace -2 -7)
                 (rewrite replace_distributivity -7)
                 (expand* SP? finseq_appl)
                 (inst -9 0)
                 (assert))
                ("2" (expand add_first 1) (expand insert?) (assert))))))
            ("2"
             (typepred (fse!1 fse!2))
             (expand* add_first insert? finseq_appl)
             (expand member)
             (skosimp)
             (lift-if)
             (prop)
             (("1" (inst -2 0)) ("2" (inst -2 "i!1 - 1") (assert))))))
          ("2"
           (expand parallel_reduction_fix?)
           (skosimp)
           (inst 2 fse!2 fss!2)
           (assert)
           (split)
           (("1"
             (hide -4 -10)
             (expand* nonempty? empty? member)
             (expand subtermsOF (-4 1))
             (expand sigma_lhs (-4 1))
             (expand* empty_seq finseq_appl)
             (lift-if 1)
             (prop)
             (("1"
               (decompose-equality 1)
               (("1" (decompose-equality 1) (skeep)) ("2" (skeep))))
              ("2"
               (lift-if)
               (assert)
               (decompose-equality 2)
               (("1"
                 (lemma complement_pos_character)
                 (inst -1 "rest(x)" p
                  "complement_pos(p, rest(x))`seq(x!1)")
                 (rewrite rest_of_PP_is_PP)
                 (prop)
                 (("1"
                   (skosimp)
                   (typepred i!1)
                   (expand rest -1)
                   (expand rest -2 1)
                   (expand* ^ min empty_seq)
                   (lift-if)
                   (assert)
                   (prop)
                   (decompose-equality -6)
                   (("1"
                     (inst -1 x!1)
                     (replace -1 5 rl)
                     (hide -1)
                     (expand* SP? PP? finseq_appl)
                     (rewrite replace_persistence)
                     (("1" (inst -7 0))
                      ("2"
                       (hide -6)
                       (expand* member_seq finseq_appl)
                       (skosimp)
                       (lemma Pos_Over_character)
                       (inst -1 " #(p)" x)
                       (expand "#" -1 1)
                       (expand PP? -1 1)
                       (inst -1 i!2)
                       (split)
                       (("1"
                         (expand* add_first insert?)
                         (expand PP? -1)
                         (expand finseq_appl)
                         (inst -1 1 0)
                         (assert))
                        ("2"
                         (skosimp)
                         (reveal -3)
                         (expand parallel)
                         (split)
                         (("1"
                           (case j!1=0)
                           (("1"
                             (replaces -1)
                             (hide-all-but (-1 -3 -14 1))
                             (replace -3 -2 rl)
                             (replace -3 1 rl)
                             (expand <=)
                             (skosimp*)
                             (replaces -2)
                             (case "p1!2`length=0")
                             (("1"
                               (rewrite empty_0)
                               (replaces -1)
                               (rewrite seq_o_empty))
                              ("2"
                               (expand o -1)
                               (decompose-equality -1)
                               (assert))))
                            ("2"
                             (inst -2 0 j!1)
                             (assert)
                             (flatten)
                             (expand <= (-1 -2 2))
                             (skosimp*)
                             (replaces -1)
                             (inst 2 "p1!1 o p1!2")
                             (rewrite o_assoc)
                             (assert))))
                          ("2"
                           (replace -14 -3 rl)
                           (replace -14 1 rl)
                           (expand <= -1)
                           (skosimp)
                           (inst -6 p1!1)
                           (expand complement_pos_set 8)
                           (expand emptyset)
                           (prop)
                           (("1" (expand <= 1) (inst 1 p1!1))
                            ("2"
                             (lemma complement_pos_empty)
                             (inst -1 "rest(x)" p)
                             (assert)
                             (hide-all-but (-1 -3 1))
                             (lemma seq_first_rest[position])
                             (inst -1 x)
                             (assert)
                             (expand* first finseq_appl)
                             (replaces -2)
                             (replace -1 1 rl)
                             (expand* PP? finseq_appl parallel))))))))))
                    ("2"
                     (expand* SP? PP? finseq_appl)
                     (inst-cp -10 1+i!1)
                     (lemma replace_persistence)
                     (inst -1 "x`seq(0)" p t
                      "sigma_rhs(fss!1, fse!1)`seq(0)")
                     (inst -11 0)
                     (assert)
                     (hide -8 -14 2 5)
                     (expand* member_seq finseq_appl)
                     (skosimp)
                     (lemma Pos_Over_character)
                     (inst -1 "#(p)" x)
                     (expand "#" -1 1)
                     (expand PP? -1 1)
                     (inst -1 i!3)
                     (split)
                     (("1"
                       (expand* add_first insert? PP? finseq_appl)
                       (inst -1 1 0)
                       (assert))
                      ("2"
                       (skosimp)
                       (replace -15 -1 rl)
                       (replace -15 1 rl)
                       (hide -15)
                       (expand parallel 2)
                       (split)
                       (("1"
                         (case "j!1 = 0")
                         (("1"
                           (replaces -1)
                           (hide-all-but (-1 -2 1))
                           (expand <=)
                           (skosimp*)
                           (replaces -2)
                           (case "p1!2`length=0")
                           (("1"
                             (rewrite empty_0)
                             (replaces -1)
                             (rewrite seq_o_empty))
                            ("2"
                             (expand o -1)
                             (decompose-equality -1)
                             (assert))))
                          ("2"
                           (inst -10 0 j!1)
                           (assert)
                           (expand parallel)
                           (flatten)
                           (expand <= (-1 -2 7))
                           (skosimp*)
                           (replaces -1)
                           (inst 7 "p1!1 o p1!2")
                           (rewrite o_assoc))))
                        ("2"
                         (expand <= -1)
                         (skosimp)
                         (inst -7 p1!1)
                         (expand complement_pos_set 5)
                         (expand emptyset)
                         (prop)
                         (("1" (expand <= 1) (inst 1 p1!1))
                          ("2"
                           (lemma complement_pos_empty)
                           (inst -1 "rest(x)" p)
                           (assert)
                           (hide-all-but (-1 -10 1))
                           (lemma seq_first_rest[position])
                           (inst -1 x)
                           (assert)
                           (expand* first finseq_appl)
                           (replaces -2)
                           (replace -1 1 rl)
                           (expand* PP? finseq_appl))))))))
                    ("3"
                     (expand* SP? PP? finseq_appl)
                     (hide -8 4)
                     (rewrite replace_preserv_parallel_pos)
                     (("1" (inst -9 0))
                      ("2"
                       (hide 2)
                       (expand* member_seq finseq_appl)
                       (skosimp*)
                       (lemma Pos_Over_character)
                       (inst -1 "#(p)" x)
                       (expand "#" -1 1)
                       (expand PP? -1 1)
                       (inst -1 i!3)
                       (split)
                       (("1"
                         (expand* add_first insert? PP? finseq_appl)
                         (inst -1 1 0)
                         (assert))
                        ("2"
                         (skosimp)
                         (replace -15 -1 rl)
                         (replace -15 1 rl)
                         (hide -15)
                         (expand parallel)
                         (split)
                         (("1"
                           (case "j!1=0")
                           (("1"
                             (replaces -1)
                             (hide-all-but (-1 -2 1))
                             (expand <=)
                             (skosimp*)
                             (replaces -2)
                             (case "p1!2`length=0")
                             (("1"
                               (rewrite empty_0)
                               (replaces -1)
                               (rewrite seq_o_empty))
                              ("2"
                               (expand o -1)
                               (decompose-equality -1)
                               (assert))))
                            ("2"
                             (hide-all-but (-1 -2 -10 1))
                             (inst -3 0 j!1)
                             (assert)
                             (flatten)
                             (expand <=)
                             (skosimp*)
                             (replaces -1)
                             (inst 2 "p1!1 o p1!2")
                             (rewrite o_assoc))))
                          ("2"
                           (expand <= -1)
                           (skosimp)
                           (inst -7 p1!1)
                           (expand* complement_pos_set emptyset)
                           (prop)
                           (("1" (expand <= 1) (inst 1 p1!1))
                            ("2"
                             (lemma complement_pos_empty)
                             (inst -1 "rest(x)" p)
                             (assert)
                             (hide-all-but (-1 -10 1))
                             (replaces -1)
                             (lemma seq_first_rest[position])
                             (inst -1 x)
                             (assert)
                             (expand* first finseq_appl)
                             (replace -1 1 rl)
                             (expand* PP? finseq_appl)
                             (expand parallel)
                             (propax))))))))))
                    ("4" (expand* SP? finseq_appl) (inst -10 0))
                    ("5" (expand sigma_rhs 1) (assert))))
                  ("2"
                   (expand member_seq 1)
                   (expand finseq_appl)
                   (inst 1 x!1))))
                ("2"
                 (skeep)
                 (hide-all-but (-3 1))
                 (prop)
                 (("1" (assert)) ("2" (assert))))
                ("3"
                 (skeep)
                 (lemma complement_pos_character)
                 (inst -1 "rest(x)" p
                  "complement_pos(p, rest(x))`seq(i)")
                 (rewrite rest_of_PP_is_PP)
                 (prop)
                 (("1"
                   (skosimp)
                   (typepred i!1)
                   (expand rest -1)
                   (expand rest -2 1)
                   (expand* ^ min empty_seq)
                   (lift-if)
                   (assert)
                   (prop)
                   (expand* SP? finseq_appl)
                   (inst -8 1+i!1)
                   (hide-all-but (-1 -8 5))
                   (replaces -1)
                   (rewrite pos_subterm_ax))
                  ("2"
                   (expand member_seq 1)
                   (expand finseq_appl)
                   (inst 1 i))))))))
            ("2"
             (rewrite replace_persistence -4)
             (("1" (expand* SP? finseq_appl) (inst -6 0))
              ("2"
               (hide -3 -4 -10 2)
               (expand* member_seq finseq_appl)
               (skosimp)
               (lemma Pos_Over_character)
               (inst -1 "#(p)" x)
               (expand "#" -1 1)
               (expand PP? -1 1)
               (inst -1 i!1)
               (split)
               (("1"
                 (expand* add_first insert? PP? finseq_appl)
                 (inst -1 1 0)
                 (assert))
                ("2"
                 (skosimp)
                 (replace -10 -1 rl)
                 (replace -10 1 rl)
                 (hide -10)
                 (expand parallel)
                 (split)
                 (("1"
                   (case j!1=0)
                   (("1"
                     (replaces -1)
                     (hide-all-but (-1 -2 1))
                     (expand <=)
                     (skosimp*)
                     (replaces -2)
                     (case "p1!2`length=0")
                     (("1"
                       (rewrite empty_0)
                       (replaces -1)
                       (rewrite seq_o_empty))
                      ("2"
                       (expand o -1)
                       (decompose-equality -1)
                       (assert))))
                    ("2"
                     (expand* PP? finseq_appl)
                     (assert)
                     (inst -5 0 j!1)
                     (expand parallel)
                     (flatten)
                     (expand <= (-1 -2 5))
                     (skosimp*)
                     (replaces -1)
                     (inst 5 "p1!1 o p1!2")
                     (rewrite o_assoc))))
                  ("2"
                   (expand* nonempty? empty? member complement_pos_set
                    emptyset)
                   (expand <= -1)
                   (skosimp)
                   (inst -3 p1!1)
                   (prop)
                   (("1" (expand <= 1) (inst 1 p1!1))
                    ("2"
                     (case "j!1=0")
                     (("1" (assert))
                      ("2"
                       (expand* PP? finseq_appl)
                       (assert)
                       (inst -6 0 j!1)
                       (assert)
                       (expand parallel)
                       (propax))))))))))))))))
        ("2"
         (expand rest 1)
         (expand* ^ min empty_seq)
         (assert)
         (prop)
         (("1" (expand SP?) (skeep)) ("2" (expand SP?) (skeep))
          ("3"
           (expand* SP? PP? finseq_appl)
           (assert)
           (skosimp)
           (rewrite replace_preserv_parallel_pos)
           (("1" (inst -2 1+i!1)) ("2" (inst -2 0))
            ("3" (inst -1 0 1+i!1) (assert))))))
        ("3"
         (hide 3)
         (expand parallel_reduction_fix?)
         (inst 1 "rest(fse!1)" "rest(fss!1)")
         (("1"
           (prop)
           (("1" (hide-all-but (-3 1)) (grind))
            ("2" (hide-all-but (-4 1)) (grind))
            ("3"
             (expand rest 1)
             (expand* ^ min empty_seq)
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (lift-if)
             (assert)
             (prop)
             (("1"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("2"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("3"
               (expand subtermsOF 3)
               (expand sigma_lhs 3)
               (expand empty_seq)
               (decompose-equality 3))
              ("4"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("5"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("6"
               (expand subtermsOF 3)
               (expand sigma_lhs 3)
               (expand empty_seq)
               (decompose-equality 3))
              ("7" (assert))
              ("8"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("9"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("10"
               (expand subtermsOF 3)
               (expand sigma_lhs 3)
               (expand empty_seq)
               (decompose-equality 3))
              ("11"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("12"
               (expand subtermsOF 1)
               (expand sigma_lhs 1)
               (expand empty_seq)
               (decompose-equality 1)
               (skeep))
              ("13" (assert)) ("14" (assert))
              ("15"
               (expand* subtermsOF sigma_lhs)
               (expand* empty_seq finseq_appl)
               (decompose-equality 3)
               (("1"
                 (decompose-equality 1)
                 (("1"
                   (decompose-equality -5)
                   (("1"
                     (inst -1 "1+x!1")
                     (expand* SP? PP? finseq_appl)
                     (rewrite replace_persistence)
                     (("1" (inst -3 0)) ("2" (inst -3 "1+x!1"))
                      ("3" (inst -2 0 "1+x!1") (assert))))
                    ("2" (expand* SP? finseq_appl) (inst -4 x1!1))))
                  ("2" (skeep) (prop) (("1" (assert)) ("2" (assert))))
                  ("3"
                   (skeep)
                   (expand* SP? PP? finseq_appl)
                   (rewrite replace_preserv_parallel_pos)
                   (("1" (inst -2 "1+i")) ("2" (inst -2 0))
                    ("3" (inst -1 0 "1+i") (assert))))))
                ("2" (skeep) (prop) (("1" (assert)) ("2" (assert))))
                ("3"
                 (skeep)
                 (expand* SP? PP? finseq_appl)
                 (rewrite replace_preserv_parallel_pos)
                 (("1" (inst -2 "1+i")) ("2" (inst -2 0))
                  ("3" (inst -1 0 "1+i") (assert))))))))
            ("4" (rewrite sigma_rhs_rest))))
          ("2"
           (typepred fse!1)
           (expand rest 1)
           (expand* ^ min empty_seq)
           (lift-if)
           (prop)
           (("1" (expand member) (skeep)) ("2" (expand member) (skeep))
            ("3" (expand member) (skeep 3) (inst -1 1+i))))))
        ("4"
         (expand* member_seq finseq_appl)
         (skosimp)
         (lemma Pos_Over_character)
         (inst -1 "#(p)" x)
         (expand "#" -1 1)
         (expand PP? -1 1)
         (assert)
         (inst -1 i!1)
         (split)
         (("1"
           (expand* add_first insert? PP? finseq_appl)
           (hide -2)
           (inst -1 1 0)
           (assert)
           (rewrite replace_preserv_parallel_pos)
           (expand* SP? finseq_appl)
           (inst -2 0))
          ("2"
           (skosimp)
           (replace -9 -1 rl)
           (replace -9 1 rl)
           (hide -9)
           (lemma replace_preserv_parallel_pos)
           (inst -1 "x`seq(0)" "x`seq(j!1)" t
            "sigma_rhs(fss!1, fse!1)`seq(0)")
           (expand* SP? PP? finseq_appl)
           (inst-cp -4 j!1)
           (inst -4 0)
           (case "j!1=0")
           (("1"
             (assert)
             (hide -2 -4)
             (replaces -1)
             (lemma replace_preserv_pos)
             (inst -1 "x`seq(0)" t "sigma_rhs(fss!1, fse!1)`seq(0)")
             (assert)
             (lemma pos_ax)
             (expand <= -3)
             (skosimp)
             (inst -1 p p1!1
              "replaceTerm(t, sigma_rhs(fss!1, fse!1)`seq(0), x`seq(0))")
             (assert))
            ("2"
             (assert)
             (prop)
             (("1"
               (expand <= -2)
               (skosimp)
               (lemma pos_ax)
               (inst -1 p p1!1
                "replaceTerm(t, sigma_rhs(fss!1, fse!1)`seq(0), x`seq(0))")
               (assert))
              ("2" (inst -2 0 j!1) (assert))))))))
        ("5"
         (expand* member_seq finseq_appl)
         (skosimp)
         (lemma Pos_Over_character)
         (inst -1 "#(p)" x)
         (expand "#" -1 1)
         (expand PP? -1 1)
         (assert)
         (inst -1 i!1)
         (split)
         (("1"
           (lemma parallel_pos_in_Pos_Over)
           (inst -1 "#(p)" "rest(x)" p)
           (expand "#" -1 1)
           (expand PP? -1 1)
           (rewrite rest_of_PP_is_PP)
           (replace -10 -2 rl)
           (prop)
           (("1" (expand* member_seq finseq_appl))
            ("2"
             (expand "#" 1)
             (expand* member_seq finseq_appl)
             (inst 1 0))
            ("3"
             (rewrite add_first_parallel_pos_to_PP_is_PP)
             (("1"
               (expand finseq_appl)
               (skeep)
               (typepred i)
               (expand rest (-1 1))
               (expand* ^ min empty_seq)
               (lift-if)
               (assert)
               (prop)
               (expand* add_first insert?)
               (expand PP? -2)
               (expand finseq_appl)
               (inst -2 2+i 0)
               (("1" (assert)) ("2" (assert))))
              ("2" (rewrite rest_of_PP_is_PP))))))
          ("2"
           (skosimp)
           (case j!1=0)
           (("1"
             (replaces -1)
             (replace -9 -1 rl)
             (replace -9 1 rl)
             (hide -9)
             (lemma parallel_pos_in_Pos_Over)
             (inst -1 "#(p)" "rest(x)" p)
             (expand "#" -1 1)
             (expand PP? -1 1)
             (rewrite rest_of_PP_is_PP)
             (prop)
             (("1" (expand* member_seq finseq_appl))
              ("2"
               (expand "#" 1)
               (expand* member_seq finseq_appl)
               (inst 1 0))
              ("3"
               (rewrite add_first_parallel_pos_to_PP_is_PP)
               (("1"
                 (expand finseq_appl)
                 (skeep)
                 (typepred i)
                 (expand rest (-1 1))
                 (expand* ^ min empty_seq)
                 (lift-if)
                 (assert)
                 (prop)
                 (hide 6)
                 (expand parallel)
                 (split)
                 (("1"
                   (expand* PP? finseq_appl)
                   (assert)
                   (inst -4 0 1+i)
                   (assert)
                   (expand parallel)
                   (flatten)
                   (expand <= (-1 -3 9))
                   (skosimp*)
                   (replaces -1)
                   (inst 9 "p1!1 o p1!2")
                   (rewrite o_assoc))
                  ("2"
                   (lemma pos_up_in_Pos_Over)
                   (expand <= -2)
                   (skosimp)
                   (inst -1 "#(p)" "rest(x)" p p1!1)
                   (expand "#" -1 1)
                   (expand PP? -1 1)
                   (rewrite rest_of_PP_is_PP)
                   (prop)
                   (("1" (expand* member_seq finseq_appl))
                    ("2"
                     (rewrite empty_0 -1)
                     (replaces -1)
                     (rewrite seq_o_empty -1)
                     (replace -1 -3 rl)
                     (expand* PP? finseq_appl parallel)
                     (assert)
                     (inst -4 0 1+i)
                     (assert))
                    ("3"
                     (expand "#" 1)
                     (expand* member_seq finseq_appl)
                     (inst 1 0))
                    ("4"
                     (expand rest 1)
                     (expand* ^ min empty_seq)
                     (lift-if)
                     (assert)
                     (expand* member_seq finseq_appl)
                     (inst 1 i)
                     (assert))))))
                ("2" (rewrite rest_of_PP_is_PP))))))
            ("2"
             (hide -7 5)
             (lemma pos_up_in_Pos_Over)
             (replace -9 -2 rl)
             (replace -9 2 rl)
             (hide -9)
             (expand <= -2)
             (skosimp)
             (inst -1 "#(p)" "rest(x)" p p1!1)
             (expand "#" -1 1)
             (expand PP? -1 1)
             (rewrite rest_of_PP_is_PP)
             (prop)
             (("1" (expand* member_seq finseq_appl))
              ("2"
               (rewrite empty_0 -1)
               (replaces -1)
               (rewrite seq_o_empty -1)
               (assert))
              ("3"
               (expand "#" 1)
               (expand* member_seq finseq_appl)
               (inst 1 0))
              ("4"
               (expand rest 1)
               (expand* ^ min empty_seq)
               (lift-if)
               (assert)
               (expand* member_seq finseq_appl)
               (inst 1 j!1-1)
               (assert))))))))))))
    ("2"
     (skeep)
     (hide 2)
     (expand SPP?)
     (flatten)
     (rewrite complement_pos_is_PP)
     (expand* SP? finseq_appl)
     (skeep)
     (lemma complement_pos_character)
     (inst -1 fsp2 p "complement_pos(p, fsp2)`seq(i)")
     (assert)
     (prop)
     (("1" (skosimp) (inst -3 i!1) (rewrite pos_subterm_ax))
      ("2" (expand member_seq 1) (expand finseq_appl) (inst 1 i))))
    ("3" (hide 2) (skeep) (expand* SPP?) (flatten))
    ("4"
     (hide 2)
     (skeep)
     (lemma Pos_Over_character)
     (inst -1 "#(p)" fsp2)
     (expand "#" -1 1)
     (expand PP? -1 1)
     (expand SPP?)
     (flatten)
     (assert)
     (expand* member_seq finseq_appl)
     (skosimp)
     (inst -1 i!1)
     (replace -6 -1 rl)
     (hide -6)
     (split)
     (("1"
       (expand parallel_reduction_fix?)
       (skosimp)
       (replaces -7)
       (rewrite replace_par_pos_preservs_pos)
       (("1" (expand SPP?) (rewrite add_first_parallel_pos_to_SP_is_SP))
        ("2"
         (expand sigma_rhs 1)
         (expand empty_seq)
         (assert)
         (lift-if)
         (assert))))
      ("2"
       (skosimp)
       (lemma replace_par_pos_preservs_PP)
       (expand finseq_appl)
       (expand* parallel_reduction_fix?)
       (skosimp)
       (replaces -8)
       (inst -1 fsp2 "sigma_rhs(fss!1, fse!1)" t)
       (expand SPP?)
       (expand sigma_rhs -1 1)
       (expand empty_seq)
       (lift-if)
       (assert)
       (inst -1 j!1)
       (lemma closed_positions)
       (inst -1 p "fsp2`seq(j!1)"
        "replace_par_pos(t, fsp2, sigma_rhs(fss!1, fse!1))")
       (assert))))
    ("5" (hide 2) (skeep) (expand SPP?) (flatten))
    ("6" (hide 2) (skeep) (expand* "#" PP? finseq_appl))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (expand* member_seq finseq_appl)
   (skosimp)
   (lemma Pos_Over_is_sub_seq)
   (inst -1 fsp1 fsp2)
   (expand SPP?)
   (flatten)
   (assert)
   (expand* subseq finseq_appl)
   (inst -1 i!1)
   (expand* member_seq finseq_appl)
   (skosimp)
   (lemma divergence_in_Pos_Over_aux)
   (inst -1 E fsp2 p t t2)
   (expand SPP?)
   (prop)
   (("1"
     (expand parallel_reduction_fix? -7)
     (skosimp -7)
     (inst 1 "fse!1`seq(i!2)" "fss!1`seq(i!2)")
     (("1"
       (split)
       (("1"
         (expand subtermsOF -9)
         (expand sigma_lhs -9)
         (lift-if)
         (expand* empty_seq finseq_appl)
         (prop)
         (hide -3)
         (decompose-equality -2)
         (("1" (inst -1 i!2) (assert))
          ("2" (expand SP? -7) (expand finseq_appl) (inst -7 x!1))))
        ("2"
         (lemma replace_par_pos_subterm)
         (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" t)
         (expand SPP?)
         (expand sigma_rhs -1 1)
         (expand empty_seq)
         (assert)
         (expand finseq_appl)
         (inst -1 i!2)
         (replace -11 -1 rl)
         (expand sigma_rhs -1)
         (expand finseq_appl)
         (assert))
        ("3"
         (expand parallel_reduction? 1)
         (inst 1 "complement_pos(p, fsp2)"))))
      ("2" (assert))
      ("3" (typepred fse!1) (expand member -1) (inst -1 i!2))
      ("4" (assert))))
    ("2"
     (hide 2)
     (expand SP? -3)
     (expand finseq_appl)
     (inst -3 i!2)
     (assert))
    ("3"
     (hide 2)
     (lemma Pos_Over_character)
     (inst -1 fsp1 fsp2)
     (assert)
     (inst -1 i!1)
     (replace -9 -1 rl)
     (replace -9 -2 rl)
     (hide -9)
     (split)
     (("1"
       (expand* member_seq finseq_appl)
       (inst 1 0)
       (("1"
         (expand "#")
         (expand Pos_Over 1)
         (assert)
         (expand* add_first 1)
         (expand insert?)
         (propax))
        ("2"
         (expand "#")
         (expand Pos_Over 1)
         (assert)
         (expand add_first 1)
         (expand insert?)
         (assert))))
      ("2"
       (skosimp)
       (expand* "#" Pos_Over)
       (lift-if)
       (prop)
       (("1"
         (expand* add_first insert? member_seq finseq_appl)
         (inst 1 0)
         (assert))
        ("2"
         (hide 1)
         (expand* add_first insert?)
         (expand PP? -1)
         (expand finseq_appl)
         (inst -1 0 1+j!1)
         (assert)
         (expand parallel)
         (propax))
        ("3"
         (lemma sub_pos_element)
         (expand <= -2)
         (skosimp)
         (inst -1 fsp2 p p1!1)
         (assert)
         (split)
         (("1"
           (expand member_seq 1)
           (expand finseq_appl)
           (inst 1 j!1)
           (assert))
          ("2"
           (prop)
           (rewrite empty_0 -1)
           (replaces -1)
           (rewrite seq_o_empty)
           (assert))))))))))


proof_type: f_proof
decl_type: formula
library: TRS
theory: orthogonality
signature: nil
run_date: Unknown date
run_time: ----
status: proved-complete
description: nil
script:
  (""
   (skeep)
   (skeep)
   (expand finseq_appl)
   (typepred i)
   (replace -7 -1)
   (expand o -1)
   (case "i<Pos_Over(fsp1, fsp2)`length")
   (("1"
     (lemma "divergence_in_Pos_Over")
     (inst -1 E fsp1 fsp2 "fsp`seq(i)" t t1 t2)
     (assert)
     (prop)
     (("1"
       (skosimp)
       (lemma Parallel_Moves_Lemma)
       (inst -1 E e!1 sigma!1 "subtermOF(t2, fsp`seq(i))")
       (assert)
       (skosimp)
       (inst 1 s!1)
       (assert))
      ("2"
       (expand* member_seq finseq_appl)
       (inst 1 i)
       (replace -8 1)
       (expand o 1)
       (propax))))
    ("2"
     (case "i<Pos_Over(fsp1, fsp2)`length + Pos_Over(fsp2, fsp1)`length")
     (("1"
       (lemma divergence_in_Pos_Over)
       (inst -1 E fsp2 fsp1 "fsp`seq(i)" t t2 t1)
       (assert)
       (prop)
       (("1"
         (skosimp)
         (lemma Parallel_Moves_Lemma)
         (inst -1 E e!1 sigma!1 "subtermOF(t1, fsp`seq(i))")
         (assert)
         (skosimp)
         (inst 2 s!1)
         (assert))
        ("2"
         (expand* member_seq finseq_appl)
         (inst 1 "i - Pos_Over(fsp1, fsp2)`length")
         (replace -8 1)
         (expand o 1)
         (propax))))
      ("2"
       (lemma non_ambiguous_implies_same_term)
       (lemma Pos_Equal_is_sub_seq)
       (lemma Pos_Equal_character)
       (inst -1 fsp1 fsp2)
       (inst -2 fsp1 fsp2)
       (expand SPP?)
       (flatten)
       (assert)
       (expand* subseq finseq_appl)
       (inst -2
        "i - Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length")
       (expand* member_seq finseq_appl)
       (skosimp)
       (inst -1
        "i - Pos_Over(fsp1, fsp2)`length - Pos_Over(fsp2, fsp1)`length")
       (skosimp)
       (inst -3 E empty_seq "subtermOF(t, fsp`seq(i))"
        "subtermOF(t1, fsp`seq(i))" "subtermOF(t2, fsp`seq(i))")
       (("1"
         (expand Orthogonal?)
         (flatten)
         (assert)
         (prop)
         (("1"
           (inst 4 "subtermOF(t1, fsp`seq(i))")
           (replace -1 4 rl)
           (assert)
           (lemma parallel_reduction_reflexive)
           (inst -1 E)
           (expand reflexive?)
           (inst -1 "subtermOF(t1, fsp`seq(i))")
           (assert))
          ("2"
           (hide-all-but 1)
           (expand positionsOF)
           (expand* only_empty_seq union empty_seq member)
           (lift-if)
           (prop)
           (("1" (grind)) ("2" (hide -1 2) (grind))
            ("3" (hide 1 3) (grind))))
          ("3"
           (hide -1 -7 -8 -10 5)
           (expand reduction_fix?)
           (expand parallel_reduction_fix?)
           (skosimp)
           (inst 1 "fse!1`seq(i!1)" "fss!1`seq(i!1)")
           (("1"
             (expand empty_seq)
             (expand subtermOF 1 1)
             (expand replaceTerm 1)
             (replace -10 1)
             (expand o 1)
             (replace -1 1)
             (split)
             (("1"
               (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
               (assert)
               (decompose-equality -8)
               (("1" (inst -1 i!1))
                ("2" (expand* SP? finseq_appl) (inst -7 x!1))))
              ("2"
               (lemma replace_par_pos_subterm)
               (expand finseq_appl)
               (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" t)
               (expand SPP? -1)
               (expand sigma_rhs -1 1)
               (expand empty_seq)
               (lift-if)
               (assert)
               (inst -1 i!1)
               (expand sigma_rhs -1 2)
               (expand finseq_appl)
               (assert))))
            ("2" (assert))
            ("3" (typepred fse!1) (expand member -1) (inst -1 i!1))
            ("4" (assert))))
          ("4"
           (hide -2 -5 -6 -9 5)
           (expand empty_seq)
           (expand reduction_fix?)
           (expand parallel_reduction_fix?)
           (skosimp)
           (inst 1 "fse!1`seq(j!1)" "fss!1`seq(j!1)")
           (("1"
             (expand subtermOF 1 1)
             (expand replaceTerm 1)
             (replace -10 1)
             (expand o 1)
             (replace -1 1)
             (split)
             (("1"
               (expand* subtermsOF sigma_lhs empty_seq finseq_appl)
               (assert)
               (decompose-equality -8)
               (("1" (inst -1 j!1))
                ("2" (expand* SP? finseq_appl) (inst -7 x!1))))
              ("2"
               (lemma replace_par_pos_subterm)
               (expand finseq_appl)
               (inst -1 fsp2 "sigma_rhs(fss!1, fse!1)" t)
               (expand sigma_rhs -1 (1 3))
               (expand* SPP? empty_seq finseq_appl)
               (lift-if)
               (assert)
               (inst -1 j!1)
               (assert))))
            ("2" (assert))
            ("3" (typepred fse!1) (expand member -1) (inst -1 j!1))
            ("4" (assert))))))
        ("2"
         (replace -11 1)
         (expand o 1)
         (expand SP? -8)
         (expand finseq_appl)
         (inst -8 j!1)
         (replace -1 1)
         (lemma replace_par_pos_preservs_PP)
         (expand parallel_reduction_fix? -11)
         (skosimp)
         (inst -1 fsp2 "sigma_rhs(fss!1, fse!1)" t)
         (expand sigma_rhs -1 1)
         (expand* SPP? empty_seq finseq_appl)
         (lift-if)
         (assert)
         (inst -1 j!1)
         (assert))
        ("3"
         (hide -1 -7 -8 -10 4)
         (replace -7 1)
         (expand o 1)
         (replace -1 1)
         (expand parallel_reduction_fix?)
         (skosimp)
         (lemma replace_par_pos_preservs_PP)
         (expand finseq_appl)
         (inst -1 fsp1 "sigma_rhs(fss!1, fse!1)" t)
         (expand sigma_rhs -1 1)
         (expand* SPP? empty_seq finseq_appl)
         (lift-if)
         (assert)
         (inst -1 i!1)
         (assert))
        ("4"
         (replace -11 1)
         (expand o 1)
         (replace -1 1)
         (expand SP? -8)
         (expand finseq_appl)
         (inst -8 j!1))))))))


