reserve n for Nat;

theorem bb3:
for X being non empty set,
    b being bag of X,
    a being Element of X holds (b \ a) + ({a},b.a)-bag = b
proof
let X be non empty set, b be bag of X, a be Element of X;
set c = (b \ a) + ({a},b.a)-bag;
now let o be object;
  assume o in X;
  X: c.o = (b \ a).o + (({a},b.a)-bag).o by PRE_POLY:def 5;
  per cases;
  suppose A: o = a;
    then B: o in {a} by TARSKI:def 1;
    thus c.o = 0 + (({a},b.a)-bag).o by A,X,bb1
            .= b.o by A,B,UPROOTS:7;
    end;
  suppose A: o <> a;
    then not o in {a} by TARSKI:def 1;
    hence c.o = (b \ a).o + 0 by X,UPROOTS:6
             .= b.o by A,FUNCT_7:32;
    end;
  end;
hence thesis by PBOOLE:3;
end;
