set b = (EmptyBag X) +* (S --> n);

A1: EmptyBag X = X --> 0 by PBOOLE:def 3;

A2: dom (S --> n) = S by FUNCOP_1:13;

.= X \/ (dom (S --> n)) by A1, FUNCOP_1:13

.= X \/ S by FUNCOP_1:13

.= X by XBOOLE_1:12 ;

then (EmptyBag X) +* (S --> n) is bag of X by A6, PARTFUN1:def 2, PRE_POLY:def 8, RELAT_1:def 18;

hence (EmptyBag X) +* (S --> n) is Element of Bags X by PRE_POLY:def 12; :: thesis: verum

A1: EmptyBag X = X --> 0 by PBOOLE:def 3;

A2: dom (S --> n) = S by FUNCOP_1:13;

A3: now :: thesis: for i being object st not i in S holds

((EmptyBag X) +* (S --> n)) . i = 0

((EmptyBag X) +* (S --> n)) . i = 0

let i be object ; :: thesis: ( not i in S implies ((EmptyBag X) +* (S --> n)) . i = 0 )

assume not i in S ; :: thesis: ((EmptyBag X) +* (S --> n)) . i = 0

hence ((EmptyBag X) +* (S --> n)) . i = (EmptyBag X) . i by A2, FUNCT_4:11

.= 0 by PBOOLE:5 ;

:: thesis: verum

end;assume not i in S ; :: thesis: ((EmptyBag X) +* (S --> n)) . i = 0

hence ((EmptyBag X) +* (S --> n)) . i = (EmptyBag X) . i by A2, FUNCT_4:11

.= 0 by PBOOLE:5 ;

:: thesis: verum

A4: now :: thesis: for i being set st i in S holds

((EmptyBag X) +* (S --> n)) . i = n

A6:
support ((EmptyBag X) +* (S --> n)) is finite
((EmptyBag X) +* (S --> n)) . i = n

let i be set ; :: thesis: ( i in S implies ((EmptyBag X) +* (S --> n)) . i = n )

assume A5: i in S ; :: thesis: ((EmptyBag X) +* (S --> n)) . i = n

thus ((EmptyBag X) +* (S --> n)) . i = (S --> n) . i by A2, A5, FUNCT_4:13

.= n by A5, FUNCOP_1:7 ; :: thesis: verum

end;assume A5: i in S ; :: thesis: ((EmptyBag X) +* (S --> n)) . i = n

thus ((EmptyBag X) +* (S --> n)) . i = (S --> n) . i by A2, A5, FUNCT_4:13

.= n by A5, FUNCOP_1:7 ; :: thesis: verum

proof
end;

dom ((EmptyBag X) +* (S --> n)) =
(dom (EmptyBag X)) \/ (dom (S --> n))
by FUNCT_4:def 1
per cases
( S is empty or ( not S is empty & n = 0 ) or ( not S is empty & n <> 0 ) )
;

end;

suppose A7:
S is empty
; :: thesis: support ((EmptyBag X) +* (S --> n)) is finite

end;

now :: thesis: support ((EmptyBag X) +* (S --> n)) is empty

hence
support ((EmptyBag X) +* (S --> n)) is finite
; :: thesis: verumassume
not support ((EmptyBag X) +* (S --> n)) is empty
; :: thesis: contradiction

then consider x being object such that

A8: x in support ((EmptyBag X) +* (S --> n)) by XBOOLE_0:def 1;

((EmptyBag X) +* (S --> n)) . x <> 0 by A8, PRE_POLY:def 7;

hence contradiction by A3, A7; :: thesis: verum

end;then consider x being object such that

A8: x in support ((EmptyBag X) +* (S --> n)) by XBOOLE_0:def 1;

((EmptyBag X) +* (S --> n)) . x <> 0 by A8, PRE_POLY:def 7;

hence contradiction by A3, A7; :: thesis: verum

suppose A9:
( not S is empty & n = 0 )
; :: thesis: support ((EmptyBag X) +* (S --> n)) is finite

end;

now :: thesis: support ((EmptyBag X) +* (S --> n)) is empty

hence
support ((EmptyBag X) +* (S --> n)) is finite
; :: thesis: verumassume
not support ((EmptyBag X) +* (S --> n)) is empty
; :: thesis: contradiction

then consider x being object such that

A10: x in support ((EmptyBag X) +* (S --> n)) by XBOOLE_0:def 1;

A11: ((EmptyBag X) +* (S --> n)) . x <> 0 by A10, PRE_POLY:def 7;

then ((EmptyBag X) +* (S --> n)) . x = (S --> n) . x by A2, A3, FUNCT_4:13

.= 0 by A3, A9, A11, FUNCOP_1:7 ;

hence contradiction by A10, PRE_POLY:def 7; :: thesis: verum

end;then consider x being object such that

A10: x in support ((EmptyBag X) +* (S --> n)) by XBOOLE_0:def 1;

A11: ((EmptyBag X) +* (S --> n)) . x <> 0 by A10, PRE_POLY:def 7;

then ((EmptyBag X) +* (S --> n)) . x = (S --> n) . x by A2, A3, FUNCT_4:13

.= 0 by A3, A9, A11, FUNCOP_1:7 ;

hence contradiction by A10, PRE_POLY:def 7; :: thesis: verum

.= X \/ (dom (S --> n)) by A1, FUNCOP_1:13

.= X \/ S by FUNCOP_1:13

.= X by XBOOLE_1:12 ;

then (EmptyBag X) +* (S --> n) is bag of X by A6, PARTFUN1:def 2, PRE_POLY:def 8, RELAT_1:def 18;

hence (EmptyBag X) +* (S --> n) is Element of Bags X by PRE_POLY:def 12; :: thesis: verum