reserve i,j,k,n,m for Nat,
        b,b1,b2 for bag of n;

theorem Th3:
  for b being ManySortedSet of n st k <= n holds (0,k)-cut b = b|k
proof
  let b be ManySortedSet of n;
  assume k <=n;
  then
A1: Segm k c= Segm n by NAT_1:39;
A2: dom (b|k)=k by A1,PARTFUN1:def 2;
A3: dom ((0,k)-cut b) = k-'0 & k-'0 =k by NAT_D:40,PARTFUN1:def 2;
  for x be object st x in k holds ((0,k)-cut b).x = (b|k).x
  proof
    let x be object;
    assume
A4:   x in k;
    then x in Segm k;
    then reconsider n=x as Element of NAT;
    thus ((0,k)-cut b).x = b.(0+n) by A4,A3,BAGORDER:def 1
      .= (b|k).x by A4,FUNCT_1:49;
  end;
  hence thesis by FUNCT_1:2,A2,A3;
end;
