defpred S1[ object , object ] means ( ( $1 = a implies $2 = 1. R ) & ( not $1 = a implies $2 = 0. R ) );
A1: for x being object st x in X holds
ex y being object st
( y in [#] R & S1[x,y] )
proof
let x be object ; :: thesis: ( x in X implies ex y being object st
( y in [#] R & S1[x,y] ) )

assume x in X ; :: thesis: ex y being object st
( y in [#] R & S1[x,y] )

per cases ( x = a or x <> a ) ;
suppose A2: x = a ; :: thesis: ex y being object st
( y in [#] R & S1[x,y] )

take y = 1. R; :: thesis: ( y in [#] R & S1[x,y] )
thus ( y in [#] R & S1[x,y] ) by A2; :: thesis: verum
end;
suppose A3: x <> a ; :: thesis: ex y being object st
( y in [#] R & S1[x,y] )

take y = 0. R; :: thesis: ( y in [#] R & S1[x,y] )
thus ( y in [#] R & S1[x,y] ) by A3; :: thesis: verum
end;
end;
end;
consider f being Function of X,([#] R) such that
A4: for x being object st x in X holds
S1[x,f . x] from FUNCT_2:sch 1(A1);
take f ; :: thesis: for x being object st x in X holds
( ( x = a implies f . x = 1. R ) & ( x <> a implies f . x = 0. R ) )

thus for x being object st x in X holds
( ( x = a implies f . x = 1. R ) & ( x <> a implies f . x = 0. R ) ) by A4; :: thesis: verum