
theorem ::E_4_61_iv:  :: Exercise 4.61: iv
  for i,n being Nat, o1 being TermOrder of (i+1),
  o2 being TermOrder of (n-'(i+1)) st o1 is admissible & o2 is admissible
  holds BlockOrder(i,n,o1,o2) is admissible
proof
  let i, n be Nat, o1 be TermOrder of (i+1),
  o2 be TermOrder of (n-'(i+1)) such that
A1: o1 is admissible and
A2: o2 is admissible;
A3: i+1 = (i+1)-'0 by NAT_D:40;
  then
A4: o1 is_strongly_connected_in Bags ((i+1)-'0) by A1;
A5: o2 is_strongly_connected_in Bags (n-'(i+1)) by A2;
  set BO = BlockOrder(i,n,o1,o2);
  now
    now
      let x,y be object such that
A6:   x in Bags n and
A7:   y in Bags n;
      reconsider p=x, q=y as bag of n by A6,A7;
      set CUTP1 = (0,i+1)-cut p, CUTP2 = (i+1, n)-cut p;
      set CUTQ1 = (0,i+1)-cut q, CUTQ2 = (i+1, n)-cut q;
A8:   CUTP1 in Bags((i+1)-'0) by PRE_POLY:def 12;
A9:   CUTQ1 in Bags((i+1)-'0) by PRE_POLY:def 12;
A10:  CUTP2 in Bags(n-'(i+1)) by PRE_POLY:def 12;
A11:  CUTQ2 in Bags(n-'(i+1)) by PRE_POLY:def 12;
      assume
A12:  not [x,y] in BO;
      per cases by A12,Def10;
      suppose
A13:    CUTP1 = CUTQ1;
        now per cases by A12,Def10;
          suppose CUTP1 <> CUTQ1;
            hence [y,x] in BO by A13;
          end;
          suppose not [CUTP2, CUTQ2] in o2;
            then [CUTQ2, CUTP2] in o2 by A5,A10,A11;
            hence [y,x] in BO by A13,Def10;
          end;
        end;
        hence [y,x] in BO;
      end;
      suppose not [CUTP1, CUTQ1] in o1;
        then
A14:    [CUTQ1, CUTP1] in o1 by A4,A8,A9;
        now per cases by A12,Def10;
          suppose CUTP1 <> CUTQ1;
            hence [y,x] in BO by A14,Def10;
          end;
          suppose not [CUTP2, CUTQ2] in o2;
            then
A15:        [CUTQ2, CUTP2] in o2 by A5,A10,A11;
             per cases;
              suppose CUTP1 = CUTQ1;
                hence [y,x] in BO by A15,Def10;
              end;
              suppose CUTP1 <> CUTQ1;
                hence [y,x] in BO by A14,Def10;
              end;
            end;
        end;
        hence [y,x] in BO;
      end;
    end;
    hence BO is_strongly_connected_in Bags n;
    let a be bag of n;
    set CUTE1 = (0, i+1)-cut EmptyBag n, CUTA1 = (0, i+1)-cut a;
    set CUTE2 = (i+1, n)-cut EmptyBag n, CUTA2 = (i+1, n)-cut a;
    now per cases;
      suppose
A16:    CUTE1 <> CUTA1;
        CUTE1 = EmptyBag ((i+1)-'0) by Th15;
        then [CUTE1, CUTA1] in o1 by A1,A3;
        hence [EmptyBag n, a] in BO by A16,Def10;
      end;
      suppose
A17:    CUTE1 = CUTA1;
        CUTE2 = EmptyBag (n-'(i+1)) by Th15;
        then [CUTE2, CUTA2] in o2 by A2;
        hence [EmptyBag n, a] in BO by A17,Def10;
      end;
    end;
    hence [EmptyBag n, a] in BO;
    let a,b,c be bag of n such that
A18: [a,b] in BO;
    set CUTA1 = (0, i+1)-cut a, CUTA2 = (i+1, n)-cut a;
    set CUTB1 = (0, i+1)-cut b, CUTB2 = (i+1, n)-cut b;
    set CUTC1 = (0, i+1)-cut c, CUTC2 = (i+1, n)-cut c;
    set CUTAC1 = (0,i+1)-cut(a+c), CUTBC1 = (0,i+1)-cut(b+c);
    set CUTAC2 = (i+1,n)-cut(a+c), CUTBC2 = (i+1,n)-cut(b+c);
    per cases by A18,Def10;
    suppose
A19:  CUTA1 <> CUTB1 & [CUTA1, CUTB1] in o1;
      then [CUTA1 + CUTC1, CUTB1+CUTC1] in o1 by A1,A3;
      then [CUTAC1, CUTB1+CUTC1] in o1 by Th16;
      then
A20:  [CUTAC1, CUTBC1] in o1 by Th16;
      now
        assume
A21:    CUTA1 + CUTC1 = CUTB1 + CUTC1;
        CUTA1 + CUTC1 -' CUTC1 = CUTA1 by PRE_POLY:48;
        hence contradiction by A19,A21,PRE_POLY:48;
      end;
      then CUTAC1 <> CUTB1 + CUTC1 by Th16;
      then CUTAC1 <> CUTBC1 by Th16;
      hence [a+c, b+c] in BO by A20,Def10;
    end;
    suppose
A22:  CUTA1 = CUTB1 & [CUTA2, CUTB2] in o2;
      then [CUTA2 + CUTC2, CUTB2 + CUTC2] in o2 by A2;
      then [CUTAC2, CUTB2 + CUTC2] in o2 by Th16;
      then
A23:  [CUTAC2, CUTBC2] in o2 by Th16;
      CUTAC1 = CUTB1 + CUTC1 by A22,Th16;
      then CUTAC1 = CUTBC1 by Th16;
      hence [a+c, b+c] in BO by A23,Def10;
    end;
  end;
  hence thesis;
end;
