:: Partial Functions
:: by Czes{\l}aw Byli\'nski
::
:: Received September 18, 1989
:: Copyright (c) 1990-2011 Association of Mizar Users


begin

theorem :: PARTFUN1:1
canceled;

theorem Th2: :: PARTFUN1:2
for f, g being Function st ( for x being set st x in (dom f) /\ (dom g) holds
f . x = g . x ) holds
ex h being Function st f \/ g = h
proof end;

theorem Th3: :: PARTFUN1:3
for f, g, h being Function st f \/ g = h holds
for x being set st x in (dom f) /\ (dom g) holds
f . x = g . x
proof end;

scheme :: PARTFUN1:sch 1
LambdaC{ F1() -> set , P1[ set ], F2( set ) -> set , F3( set ) -> set } :
ex f being Function st
( dom f = F1() & ( for x being set st x in F1() holds
( ( P1[x] implies f . x = F2(x) ) & ( P1[x] implies f . x = F3(x) ) ) ) )
proof end;

Lm1: dom {} = {}
;

Lm2: now
let X, Y be set ; :: thesis: ex E being set st
( dom E c= X & rng E c= Y )

take E = {} ; :: thesis: ( dom E c= X & rng E c= Y )
thus ( dom E c= X & rng E c= Y ) by XBOOLE_1:2; :: thesis: verum
end;

registration
let X, Y be set ;
cluster Relation-like X -defined Y -valued Function-like Element of bool [:X,Y:];
existence
ex b1 being Relation of X,Y st b1 is Function-like
proof end;
end;

definition
let X, Y be set ;
mode PartFunc of X,Y is Function-like Relation of X,Y;
end;

theorem :: PARTFUN1:4
canceled;

theorem :: PARTFUN1:5
canceled;

theorem :: PARTFUN1:6
canceled;

theorem :: PARTFUN1:7
canceled;

theorem :: PARTFUN1:8
canceled;

theorem :: PARTFUN1:9
canceled;

theorem :: PARTFUN1:10
canceled;

theorem :: PARTFUN1:11
canceled;

theorem :: PARTFUN1:12
canceled;

theorem :: PARTFUN1:13
canceled;

theorem :: PARTFUN1:14
canceled;

theorem :: PARTFUN1:15
canceled;

theorem :: PARTFUN1:16
canceled;

theorem :: PARTFUN1:17
canceled;

theorem :: PARTFUN1:18
canceled;

theorem :: PARTFUN1:19
canceled;

theorem :: PARTFUN1:20
canceled;

theorem :: PARTFUN1:21
canceled;

theorem :: PARTFUN1:22
canceled;

theorem :: PARTFUN1:23
canceled;

theorem :: PARTFUN1:24
canceled;

theorem :: PARTFUN1:25
canceled;

theorem :: PARTFUN1:26
for X, Y, y being set
for f being PartFunc of X,Y st y in rng f holds
ex x being Element of X st
( x in dom f & y = f . x )
proof end;

theorem Th27: :: PARTFUN1:27
for Y, x being set
for f being b1 -valued Function st x in dom f holds
f . x in Y
proof end;

theorem :: PARTFUN1:28
canceled;

theorem :: PARTFUN1:29
canceled;

theorem :: PARTFUN1:30
canceled;

theorem :: PARTFUN1:31
canceled;

theorem :: PARTFUN1:32
canceled;

theorem :: PARTFUN1:33
canceled;

theorem :: PARTFUN1:34
for X, Y being set
for f1, f2 being PartFunc of X,Y st dom f1 = dom f2 & ( for x being Element of X st x in dom f1 holds
f1 . x = f2 . x ) holds
f1 = f2
proof end;

scheme :: PARTFUN1:sch 2
PartFuncEx{ F1() -> set , F2() -> set , P1[ set , set ] } :
ex f being PartFunc of F1(),F2() st
( ( for x being set holds
( x in dom f iff ( x in F1() & ex y being set st P1[x,y] ) ) ) & ( for x being set st x in dom f holds
P1[x,f . x] ) )
provided
A1: for x, y being set st x in F1() & P1[x,y] holds
y in F2() and
A2: for x, y1, y2 being set st x in F1() & P1[x,y1] & P1[x,y2] holds
y1 = y2
proof end;

scheme :: PARTFUN1:sch 3
LambdaR{ F1() -> set , F2() -> set , F3( set ) -> set , P1[ set ] } :
ex f being PartFunc of F1(),F2() st
( ( for x being set holds
( x in dom f iff ( x in F1() & P1[x] ) ) ) & ( for x being set st x in dom f holds
f . x = F3(x) ) )
provided
A1: for x being set st P1[x] holds
F3(x) in F2()
proof end;

definition
let X, Y, V, Z be set ;
let f be PartFunc of X,Y;
let g be PartFunc of V,Z;
:: original: *
redefine func g * f -> PartFunc of X,Z;
coherence
f * g is PartFunc of X,Z
proof end;
end;

theorem :: PARTFUN1:35
canceled;

theorem :: PARTFUN1:36
for X, Y being set
for f being Relation of X,Y holds (id X) * f = f
proof end;

theorem :: PARTFUN1:37
for X, Y being set
for f being Relation of X,Y holds f * (id Y) = f
proof end;

theorem :: PARTFUN1:38
for X, Y being set
for f being PartFunc of X,Y st ( for x1, x2 being Element of X st x1 in dom f & x2 in dom f & f . x1 = f . x2 holds
x1 = x2 ) holds
f is one-to-one
proof end;

theorem :: PARTFUN1:39
for X, Y being set
for f being PartFunc of X,Y st f is one-to-one holds
f " is PartFunc of Y,X
proof end;

theorem :: PARTFUN1:40
canceled;

theorem :: PARTFUN1:41
canceled;

theorem :: PARTFUN1:42
canceled;

theorem :: PARTFUN1:43
for X, Y, Z being set
for f being PartFunc of X,Y holds f | Z is PartFunc of Z,Y
proof end;

theorem Th44: :: PARTFUN1:44
for X, Y, Z being set
for f being PartFunc of X,Y holds f | Z is PartFunc of X,Y ;

definition
let X, Y be set ;
let f be PartFunc of X,Y;
let Z be set ;
:: original: |
redefine func f | Z -> PartFunc of X,Y;
coherence
f | Z is PartFunc of X,Y
by Th44;
end;

theorem :: PARTFUN1:45
for X, Y, Z being set
for f being PartFunc of X,Y holds Z | f is PartFunc of X,Z
proof end;

theorem :: PARTFUN1:46
for X, Y, Z being set
for f being PartFunc of X,Y holds Z | f is PartFunc of X,Y ;

theorem Th47: :: PARTFUN1:47
for Y, X being set
for f being Function holds (Y | f) | X is PartFunc of X,Y
proof end;

theorem :: PARTFUN1:48
canceled;

theorem :: PARTFUN1:49
for X, Y, y being set
for f being PartFunc of X,Y st y in f .: X holds
ex x being Element of X st
( x in dom f & y = f . x )
proof end;

theorem :: PARTFUN1:50
canceled;

theorem :: PARTFUN1:51
canceled;

theorem :: PARTFUN1:52
canceled;

theorem :: PARTFUN1:53
canceled;

theorem :: PARTFUN1:54
canceled;

theorem :: PARTFUN1:55
canceled;

theorem :: PARTFUN1:56
canceled;

theorem :: PARTFUN1:57
canceled;

theorem :: PARTFUN1:58
canceled;

theorem :: PARTFUN1:59
canceled;

theorem :: PARTFUN1:60
canceled;

theorem :: PARTFUN1:61
canceled;

theorem :: PARTFUN1:62
canceled;

theorem :: PARTFUN1:63
canceled;

theorem :: PARTFUN1:64
canceled;

theorem :: PARTFUN1:65
canceled;

theorem :: PARTFUN1:66
canceled;

theorem :: PARTFUN1:67
canceled;

theorem :: PARTFUN1:68
canceled;

theorem Th69: :: PARTFUN1:69
for x, Y being set
for f being PartFunc of {x},Y holds rng f c= {(f . x)}
proof end;

theorem :: PARTFUN1:70
for x, Y being set
for f being PartFunc of {x},Y holds f is one-to-one
proof end;

theorem :: PARTFUN1:71
for x, Y, P being set
for f being PartFunc of {x},Y holds f .: P c= {(f . x)}
proof end;

theorem :: PARTFUN1:72
for x, X, Y being set
for f being Function st dom f = {x} & x in X & f . x in Y holds
f is PartFunc of X,Y
proof end;

theorem Th73: :: PARTFUN1:73
for X, y, x being set
for f being PartFunc of X,{y} st x in dom f holds
f . x = y
proof end;

theorem :: PARTFUN1:74
for X, y being set
for f1, f2 being PartFunc of X,{y} st dom f1 = dom f2 holds
f1 = f2
proof end;

definition
let f be Function;
let X, Y be set ;
canceled;
canceled;
func <:f,X,Y:> -> PartFunc of X,Y equals :: PARTFUN1:def 3
(Y | f) | X;
coherence
(Y | f) | X is PartFunc of X,Y
by Th47;
end;

:: deftheorem PARTFUN1:def 1 :
canceled;

:: deftheorem PARTFUN1:def 2 :
canceled;

:: deftheorem defines <: PARTFUN1:def 3 :
for f being Function
for X, Y being set holds <:f,X,Y:> = (Y | f) | X;

theorem :: PARTFUN1:75
canceled;

theorem Th76: :: PARTFUN1:76
for X, Y being set
for f being Function holds <:f,X,Y:> c= f
proof end;

theorem Th77: :: PARTFUN1:77
for X, Y being set
for f being Function holds
( dom <:f,X,Y:> c= dom f & rng <:f,X,Y:> c= rng f )
proof end;

theorem Th78: :: PARTFUN1:78
for x, X, Y being set
for f being Function holds
( x in dom <:f,X,Y:> iff ( x in dom f & x in X & f . x in Y ) )
proof end;

theorem Th79: :: PARTFUN1:79
for x, X, Y being set
for f being Function st x in dom f & x in X & f . x in Y holds
<:f,X,Y:> . x = f . x
proof end;

theorem Th80: :: PARTFUN1:80
for x, X, Y being set
for f being Function st x in dom <:f,X,Y:> holds
<:f,X,Y:> . x = f . x
proof end;

theorem :: PARTFUN1:81
for X, Y being set
for f, g being Function st f c= g holds
<:f,X,Y:> c= <:g,X,Y:>
proof end;

theorem Th82: :: PARTFUN1:82
for Z, X, Y being set
for f being Function st Z c= X holds
<:f,Z,Y:> c= <:f,X,Y:>
proof end;

theorem Th83: :: PARTFUN1:83
for Z, Y, X being set
for f being Function st Z c= Y holds
<:f,X,Z:> c= <:f,X,Y:>
proof end;

theorem :: PARTFUN1:84
for X1, X2, Y1, Y2 being set
for f being Function st X1 c= X2 & Y1 c= Y2 holds
<:f,X1,Y1:> c= <:f,X2,Y2:>
proof end;

theorem Th85: :: PARTFUN1:85
for X, Y being set
for f being Function st dom f c= X & rng f c= Y holds
f = <:f,X,Y:>
proof end;

theorem :: PARTFUN1:86
for f being Function holds f = <:f,(dom f),(rng f):> by Th85;

theorem :: PARTFUN1:87
for X, Y being set
for f being PartFunc of X,Y holds <:f,X,Y:> = f
proof end;

theorem :: PARTFUN1:88
canceled;

theorem :: PARTFUN1:89
canceled;

theorem :: PARTFUN1:90
canceled;

theorem Th91: :: PARTFUN1:91
for X, Y being set holds <:{},X,Y:> = {}
proof end;

theorem Th92: :: PARTFUN1:92
for Y, Z, X being set
for f, g being Function holds <:g,Y,Z:> * <:f,X,Y:> c= <:(g * f),X,Z:>
proof end;

theorem :: PARTFUN1:93
for Y, Z, X being set
for f, g being Function st (rng f) /\ (dom g) c= Y holds
<:g,Y,Z:> * <:f,X,Y:> = <:(g * f),X,Z:>
proof end;

theorem Th94: :: PARTFUN1:94
for X, Y being set
for f being Function st f is one-to-one holds
<:f,X,Y:> is one-to-one
proof end;

theorem :: PARTFUN1:95
for X, Y being set
for f being Function st f is one-to-one holds
<:f,X,Y:> " = <:(f "),Y,X:>
proof end;

theorem :: PARTFUN1:96
canceled;

theorem :: PARTFUN1:97
for Z, X, Y being set
for f being Function holds Z | <:f,X,Y:> = <:f,X,(Z /\ Y):>
proof end;

definition
let X be set ;
let f be X -defined Relation;
attr f is total means :Def4: :: PARTFUN1:def 4
dom f = X;
end;

:: deftheorem Def4 defines total PARTFUN1:def 4 :
for X being set
for f being b1 -defined Relation holds
( f is total iff dom f = X );

registration
let X be empty set ;
let Y be set ;
cluster -> total Element of bool [:X,Y:];
coherence
for b1 being Relation of X,Y holds b1 is total
proof end;
end;

registration
let X be non empty set ;
let Y be empty set ;
cluster -> non total Element of bool [:X,Y:];
coherence
for b1 being Relation of X,Y holds not b1 is total
proof end;
end;

theorem :: PARTFUN1:98
canceled;

theorem :: PARTFUN1:99
canceled;

theorem :: PARTFUN1:100
canceled;

theorem :: PARTFUN1:101
canceled;

theorem :: PARTFUN1:102
canceled;

theorem :: PARTFUN1:103
canceled;

theorem :: PARTFUN1:104
canceled;

theorem :: PARTFUN1:105
canceled;

theorem :: PARTFUN1:106
canceled;

theorem :: PARTFUN1:107
canceled;

theorem :: PARTFUN1:108
canceled;

theorem :: PARTFUN1:109
canceled;

theorem :: PARTFUN1:110
canceled;

theorem :: PARTFUN1:111
canceled;

theorem :: PARTFUN1:112
canceled;

theorem Th113: :: PARTFUN1:113
for X, Y being set
for f being Function st <:f,X,Y:> is total holds
X c= dom f
proof end;

theorem :: PARTFUN1:114
for X, Y being set st <:{},X,Y:> is total holds
X = {} by Lm1, Th113, XBOOLE_1:3;

theorem :: PARTFUN1:115
for X, Y being set
for f being Function st X c= dom f & rng f c= Y holds
<:f,X,Y:> is total
proof end;

theorem :: PARTFUN1:116
for X, Y being set
for f being Function st <:f,X,Y:> is total holds
f .: X c= Y
proof end;

theorem :: PARTFUN1:117
for X, Y being set
for f being Function st X c= dom f & f .: X c= Y holds
<:f,X,Y:> is total
proof end;

definition
let X, Y be set ;
func PFuncs (X,Y) -> set means :Def5: :: PARTFUN1:def 5
for x being set holds
( x in it iff ex f being Function st
( x = f & dom f c= X & rng f c= Y ) );
existence
ex b1 being set st
for x being set holds
( x in b1 iff ex f being Function st
( x = f & dom f c= X & rng f c= Y ) )
proof end;
uniqueness
for b1, b2 being set st ( for x being set holds
( x in b1 iff ex f being Function st
( x = f & dom f c= X & rng f c= Y ) ) ) & ( for x being set holds
( x in b2 iff ex f being Function st
( x = f & dom f c= X & rng f c= Y ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines PFuncs PARTFUN1:def 5 :
for X, Y, b3 being set holds
( b3 = PFuncs (X,Y) iff for x being set holds
( x in b3 iff ex f being Function st
( x = f & dom f c= X & rng f c= Y ) ) );

registration
let X, Y be set ;
cluster PFuncs (X,Y) -> non empty ;
coherence
not PFuncs (X,Y) is empty
proof end;
end;

theorem :: PARTFUN1:118
canceled;

theorem Th119: :: PARTFUN1:119
for X, Y being set
for f being PartFunc of X,Y holds f in PFuncs (X,Y)
proof end;

theorem Th120: :: PARTFUN1:120
for X, Y, f being set st f in PFuncs (X,Y) holds
f is PartFunc of X,Y
proof end;

theorem :: PARTFUN1:121
for X, Y being set
for f being Element of PFuncs (X,Y) holds f is PartFunc of X,Y by Th120;

theorem :: PARTFUN1:122
for Y being set holds PFuncs ({},Y) = {{}}
proof end;

theorem :: PARTFUN1:123
for X being set holds PFuncs (X,{}) = {{}}
proof end;

theorem :: PARTFUN1:124
canceled;

theorem :: PARTFUN1:125
canceled;

theorem :: PARTFUN1:126
canceled;

theorem :: PARTFUN1:127
canceled;

theorem :: PARTFUN1:128
for X1, X2, Y1, Y2 being set st X1 c= X2 & Y1 c= Y2 holds
PFuncs (X1,Y1) c= PFuncs (X2,Y2)
proof end;

definition
let f, g be Function;
pred f tolerates g means :Def6: :: PARTFUN1:def 6
for x being set st x in (dom f) /\ (dom g) holds
f . x = g . x;
reflexivity
for f being Function
for x being set st x in (dom f) /\ (dom f) holds
f . x = f . x
;
symmetry
for f, g being Function st ( for x being set st x in (dom f) /\ (dom g) holds
f . x = g . x ) holds
for x being set st x in (dom g) /\ (dom f) holds
g . x = f . x
;
end;

:: deftheorem Def6 defines tolerates PARTFUN1:def 6 :
for f, g being Function holds
( f tolerates g iff for x being set st x in (dom f) /\ (dom g) holds
f . x = g . x );

theorem :: PARTFUN1:129
canceled;

theorem Th130: :: PARTFUN1:130
for f, g being Function holds
( f tolerates g iff ex h being Function st f \/ g = h )
proof end;

theorem Th131: :: PARTFUN1:131
for f, g being Function holds
( f tolerates g iff ex h being Function st
( f c= h & g c= h ) )
proof end;

theorem Th132: :: PARTFUN1:132
for f, g being Function st dom f c= dom g holds
( f tolerates g iff for x being set st x in dom f holds
f . x = g . x )
proof end;

theorem :: PARTFUN1:133
canceled;

theorem :: PARTFUN1:134
canceled;

theorem :: PARTFUN1:135
for f, g being Function st f c= g holds
f tolerates g by Th131;

theorem Th136: :: PARTFUN1:136
for f, g being Function st dom f = dom g & f tolerates g holds
f = g
proof end;

theorem :: PARTFUN1:137
canceled;

theorem :: PARTFUN1:138
for f, g being Function st dom f misses dom g holds
f tolerates g
proof end;

theorem :: PARTFUN1:139
for f, g, h being Function st f c= h & g c= h holds
f tolerates g by Th131;

theorem :: PARTFUN1:140
for X, Y being set
for f, g being PartFunc of X,Y
for h being Function st f tolerates h & g c= f holds
g tolerates h
proof end;

theorem Th141: :: PARTFUN1:141
for f being Function holds {} tolerates f
proof end;

theorem :: PARTFUN1:142
for X, Y being set
for f being Function holds <:{},X,Y:> tolerates f
proof end;

theorem :: PARTFUN1:143
for X, y being set
for f, g being PartFunc of X,{y} holds f tolerates g
proof end;

theorem :: PARTFUN1:144
for X being set
for f being Function holds f | X tolerates f
proof end;

theorem :: PARTFUN1:145
for Y being set
for f being Function holds Y | f tolerates f
proof end;

theorem Th146: :: PARTFUN1:146
for Y, X being set
for f being Function holds (Y | f) | X tolerates f
proof end;

theorem :: PARTFUN1:147
for X, Y being set
for f being Function holds <:f,X,Y:> tolerates f by Th146;

theorem Th148: :: PARTFUN1:148
for X, Y being set
for f, g being PartFunc of X,Y st f is total & g is total & f tolerates g holds
f = g
proof end;

theorem :: PARTFUN1:149
canceled;

theorem :: PARTFUN1:150
canceled;

theorem :: PARTFUN1:151
canceled;

theorem :: PARTFUN1:152
canceled;

theorem :: PARTFUN1:153
canceled;

theorem :: PARTFUN1:154
canceled;

theorem :: PARTFUN1:155
canceled;

theorem :: PARTFUN1:156
canceled;

theorem :: PARTFUN1:157
canceled;

theorem Th158: :: PARTFUN1:158
for X, Y being set
for f, g, h being PartFunc of X,Y st f tolerates h & g tolerates h & h is total holds
f tolerates g
proof end;

theorem :: PARTFUN1:159
canceled;

theorem :: PARTFUN1:160
canceled;

theorem :: PARTFUN1:161
canceled;

theorem Th162: :: PARTFUN1:162
for X, Y being set
for f, g being PartFunc of X,Y st ( Y = {} implies X = {} ) & f tolerates g holds
ex h being PartFunc of X,Y st
( h is total & f tolerates h & g tolerates h )
proof end;

definition
let X, Y be set ;
let f be PartFunc of X,Y;
func TotFuncs f -> set means :Def7: :: PARTFUN1:def 7
for x being set holds
( x in it iff ex g being PartFunc of X,Y st
( g = x & g is total & f tolerates g ) );
existence
ex b1 being set st
for x being set holds
( x in b1 iff ex g being PartFunc of X,Y st
( g = x & g is total & f tolerates g ) )
proof end;
uniqueness
for b1, b2 being set st ( for x being set holds
( x in b1 iff ex g being PartFunc of X,Y st
( g = x & g is total & f tolerates g ) ) ) & ( for x being set holds
( x in b2 iff ex g being PartFunc of X,Y st
( g = x & g is total & f tolerates g ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines TotFuncs PARTFUN1:def 7 :
for X, Y being set
for f being PartFunc of X,Y
for b4 being set holds
( b4 = TotFuncs f iff for x being set holds
( x in b4 iff ex g being PartFunc of X,Y st
( g = x & g is total & f tolerates g ) ) );

theorem :: PARTFUN1:163
canceled;

theorem :: PARTFUN1:164
canceled;

theorem :: PARTFUN1:165
canceled;

theorem :: PARTFUN1:166
canceled;

theorem :: PARTFUN1:167
canceled;

theorem Th168: :: PARTFUN1:168
for X, Y being set
for f being PartFunc of X,Y
for g being set st g in TotFuncs f holds
g is PartFunc of X,Y
proof end;

theorem Th169: :: PARTFUN1:169
for X, Y being set
for f, g being PartFunc of X,Y st g in TotFuncs f holds
g is total
proof end;

theorem :: PARTFUN1:170
canceled;

theorem Th171: :: PARTFUN1:171
for X, Y being set
for f being PartFunc of X,Y
for g being Function st g in TotFuncs f holds
f tolerates g
proof end;

registration
let X be non empty set ;
let Y be empty set ;
let f be PartFunc of X,Y;
cluster TotFuncs f -> empty ;
coherence
TotFuncs f is empty
proof end;
end;

theorem :: PARTFUN1:172
canceled;

theorem :: PARTFUN1:173
canceled;

theorem Th174: :: PARTFUN1:174
for X, Y being set
for f being PartFunc of X,Y holds
( f is total iff TotFuncs f = {f} )
proof end;

theorem :: PARTFUN1:175
for Y being set
for f being PartFunc of {},Y holds TotFuncs f = {f} by Th174;

theorem :: PARTFUN1:176
for Y being set
for f being PartFunc of {},Y holds TotFuncs f = {{}} by Th174;

theorem :: PARTFUN1:177
canceled;

theorem :: PARTFUN1:178
canceled;

theorem :: PARTFUN1:179
canceled;

theorem :: PARTFUN1:180
canceled;

theorem :: PARTFUN1:181
canceled;

theorem :: PARTFUN1:182
canceled;

theorem :: PARTFUN1:183
canceled;

theorem :: PARTFUN1:184
canceled;

theorem :: PARTFUN1:185
for X, Y being set
for f, g being PartFunc of X,Y st TotFuncs f meets TotFuncs g holds
f tolerates g
proof end;

theorem :: PARTFUN1:186
for X, Y being set
for f, g being PartFunc of X,Y st ( Y = {} implies X = {} ) & f tolerates g holds
TotFuncs f meets TotFuncs g
proof end;

begin

Lm3: for X being set
for R being Relation of X st R = id X holds
R is total
proof end;

Lm4: for X being set
for R being Relation st R = id X holds
( R is reflexive & R is symmetric & R is antisymmetric & R is transitive )
proof end;

Lm5: for X being set holds id X is Relation of X
proof end;

registration
let X be set ;
cluster Relation-like X -defined X -valued reflexive symmetric antisymmetric transitive total Element of bool [:X,X:];
existence
ex b1 being Relation of X st
( b1 is total & b1 is reflexive & b1 is symmetric & b1 is antisymmetric & b1 is transitive )
proof end;
end;

registration
cluster Relation-like symmetric transitive -> reflexive set ;
coherence
for b1 being Relation st b1 is symmetric & b1 is transitive holds
b1 is reflexive
proof end;
end;

registration
let X be set ;
cluster id X -> symmetric antisymmetric transitive ;
coherence
( id X is symmetric & id X is antisymmetric & id X is transitive )
by Lm4;
end;

definition
let X be set ;
:: original: id
redefine func id X -> total Relation of X;
coherence
id X is total Relation of X
by Lm3, Lm5;
end;

scheme :: PARTFUN1:sch 4
LambdaC9{ F1() -> non empty set , P1[ set ], F2( set ) -> set , F3( set ) -> set } :
ex f being Function st
( dom f = F1() & ( for x being Element of F1() holds
( ( P1[x] implies f . x = F2(x) ) & ( P1[x] implies f . x = F3(x) ) ) ) )
proof end;

begin

theorem Th187: :: PARTFUN1:187
for x, y, z being set
for f, g being Function st f tolerates g & [x,y] in f & [x,z] in g holds
y = z
proof end;

theorem :: PARTFUN1:188
for A being set st A is functional & ( for f, g being Function st f in A & g in A holds
f tolerates g ) holds
union A is Function
proof end;

definition
let D be set ;
let p be D -valued Function;
let i be set ;
assume A1: i in dom p ;
func p /. i -> Element of D equals :: PARTFUN1:def 8
p . i;
coherence
p . i is Element of D
by A1, Th27;
end;

:: deftheorem defines /. PARTFUN1:def 8 :
for D being set
for p being b1 -valued Function
for i being set st i in dom p holds
p /. i = p . i;

registration
let X, Y be non empty set ;
cluster Relation-like X -defined Y -valued Function-like non empty Element of bool [:X,Y:];
existence
not for b1 being PartFunc of X,Y holds b1 is empty
proof end;
end;

registration
let A, B be set ;
cluster PFuncs (A,B) -> functional ;
coherence
PFuncs (A,B) is functional
proof end;
end;