
theorem Th4:
  for n,i being Nat, a,b being ManySortedSet of n holds
  a = b iff (0,i+1)-cut a = (0,i+1)-cut b & (i+1,n)-cut a = (i+1,n)-cut b
proof
  let n, i be Nat, a, b be ManySortedSet of n;
  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;
  thus a = b implies CUTA1 = CUTB1 & CUTA2 = CUTB2;
  assume that
A1: CUTA1 = CUTB1 and
A2: CUTA2 = CUTB2;
A3: now
    let k be Element of NAT such that
A4: k in i+1;
    (i+1)-'0 = i+1+(0 qua Nat)-'0;
    then
A5: k in ((i+1)-'0) by A4,NAT_D:34;
    then CUTB1.k = b.(0 qua Nat+k) by Def1;
    hence a.k = b.k by A1,A5,Def1;
  end;
A6: now
    let x be Element of NAT such that
A7: x >= i+1 and
A8: x < n;
    set k = x-'(i+1);
    x - (i+1) >= (i+1) - (i+1) by A7,XREAL_1:9;
    then
A9: k = x-(i+1) by XREAL_0:def 2;
    n >= i+1 by A7,A8,XXREAL_0:2;
    then n - (i+1) >= (i+1)-(i+1) by XREAL_1:9;
    then
A10: (n-'(i+1)) = n - (i+1) by XREAL_0:def 2;
    x-(i+1) < n - (i+1) by A8,XREAL_1:14;
    then
A11: k in Segm(n-'(i+1)) by A9,A10,NAT_1:44;
    then CUTB2.k = b.((i+1)+k) by Def1;
    hence a.x = b.x by A2,A9,A11,Def1;
  end;
  now
    let x9 be object such that
A12: x9 in n;
    n = {k where k is Nat : k < n} by AXIOMS:4;
    then
A13: ex k being Nat st ( k = x9)&( k < n) by A12;
    then reconsider x = x9 as Element of NAT by ORDINAL1:def 12;
    per cases;
    suppose x in i+1;
      hence a.x9 = b.x9 by A3;
    end;
    suppose not x in Segm(i+1);
      then x >= i+1 by NAT_1:44;
      hence a.x9 = b.x9 by A6,A13;
    end;
  end;
  hence thesis by PBOOLE:3;
end;
