:: FUNCT_4 semantic presentation

Lemma1: for b1, b2, b3 being set st [b1,b2] in b3 holds
( b1 in union (union b3) & b2 in union (union b3) )
proof end;

Lemma2: for b1, b2, b3, b4, b5, b6, b7, b8 being set st [[b1,b2],[b3,b4]] = [[b5,b6],[b7,b8]] holds
( b1 = b5 & b3 = b7 & b2 = b6 & b4 = b8 )
proof end;

theorem Th1: :: FUNCT_4:1
for b1 being set st ( for b2 being set st b2 in b1 holds
ex b3, b4 being set st b2 = [b3,b4] ) holds
ex b2, b3 being set st b1 c= [:b2,b3:]
proof end;

theorem Th2: :: FUNCT_4:2
for b1, b2 being Function holds b1 * b2 = (b1 | (rng b2)) * b2
proof end;

theorem Th3: :: FUNCT_4:3
canceled;

theorem Th4: :: FUNCT_4:4
for b1, b2 being set holds
( id b1 c= id b2 iff b1 c= b2 )
proof end;

theorem Th5: :: FUNCT_4:5
for b1, b2, b3 being set st b1 c= b2 holds
b1 --> b3 c= b2 --> b3
proof end;

theorem Th6: :: FUNCT_4:6
for b1, b2, b3, b4 being set st b1 --> b2 c= b3 --> b4 holds
b1 c= b3
proof end;

theorem Th7: :: FUNCT_4:7
for b1, b2, b3, b4 being set st b1 <> {} & b1 --> b2 c= b3 --> b4 holds
b2 = b4
proof end;

theorem Th8: :: FUNCT_4:8
for b1 being set
for b2 being Function st b1 in dom b2 holds
{b1} --> (b2 . b1) c= b2
proof end;

notation
let c1, c2 be Function;
synonym c1 <= c2 for c1 c= c2;
end;

theorem Th9: :: FUNCT_4:9
for b1, b2 being set
for b3 being Function holds (b1 | b3) | b2 <= b3
proof end;

theorem Th10: :: FUNCT_4:10
for b1, b2 being set
for b3, b4 being Function st b3 <= b4 holds
(b1 | b3) | b2 <= (b1 | b4) | b2
proof end;

definition
let c1, c2 be Function;
func c1 +* c2 -> Function means :Def1: :: FUNCT_4:def 1
( dom a3 = (dom a1) \/ (dom a2) & ( for b1 being set st b1 in (dom a1) \/ (dom a2) holds
( ( b1 in dom a2 implies a3 . b1 = a2 . b1 ) & ( not b1 in dom a2 implies a3 . b1 = a1 . b1 ) ) ) );
existence
ex b1 being Function st
( dom b1 = (dom c1) \/ (dom c2) & ( for b2 being set st b2 in (dom c1) \/ (dom c2) holds
( ( b2 in dom c2 implies b1 . b2 = c2 . b2 ) & ( not b2 in dom c2 implies b1 . b2 = c1 . b2 ) ) ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = (dom c1) \/ (dom c2) & ( for b3 being set st b3 in (dom c1) \/ (dom c2) holds
( ( b3 in dom c2 implies b1 . b3 = c2 . b3 ) & ( not b3 in dom c2 implies b1 . b3 = c1 . b3 ) ) ) & dom b2 = (dom c1) \/ (dom c2) & ( for b3 being set st b3 in (dom c1) \/ (dom c2) holds
( ( b3 in dom c2 implies b2 . b3 = c2 . b3 ) & ( not b3 in dom c2 implies b2 . b3 = c1 . b3 ) ) ) holds
b1 = b2
proof end;
idempotence
for b1 being Function holds
( dom b1 = (dom b1) \/ (dom b1) & ( for b2 being set st b2 in (dom b1) \/ (dom b1) holds
( ( b2 in dom b1 implies b1 . b2 = b1 . b2 ) & ( not b2 in dom b1 implies b1 . b2 = b1 . b2 ) ) ) )
;
end;

:: deftheorem Def1 defines +* FUNCT_4:def 1 :
for b1, b2, b3 being Function holds
( b3 = b1 +* b2 iff ( dom b3 = (dom b1) \/ (dom b2) & ( for b4 being set st b4 in (dom b1) \/ (dom b2) holds
( ( b4 in dom b2 implies b3 . b4 = b2 . b4 ) & ( not b4 in dom b2 implies b3 . b4 = b1 . b4 ) ) ) ) );

theorem Th11: :: FUNCT_4:11
for b1, b2 being Function holds
( dom b1 c= dom (b1 +* b2) & dom b2 c= dom (b1 +* b2) )
proof end;

theorem Th12: :: FUNCT_4:12
for b1 being set
for b2, b3 being Function st not b1 in dom b2 holds
(b3 +* b2) . b1 = b3 . b1
proof end;

theorem Th13: :: FUNCT_4:13
for b1 being set
for b2, b3 being Function holds
( b1 in dom (b2 +* b3) iff ( b1 in dom b2 or b1 in dom b3 ) )
proof end;

theorem Th14: :: FUNCT_4:14
for b1 being set
for b2, b3 being Function st b1 in dom b2 holds
(b3 +* b2) . b1 = b2 . b1
proof end;

theorem Th15: :: FUNCT_4:15
for b1, b2, b3 being Function holds (b1 +* b2) +* b3 = b1 +* (b2 +* b3)
proof end;

theorem Th16: :: FUNCT_4:16
for b1 being set
for b2, b3 being Function st b2 tolerates b3 & b1 in dom b2 holds
(b2 +* b3) . b1 = b2 . b1
proof end;

theorem Th17: :: FUNCT_4:17
for b1 being set
for b2, b3 being Function st dom b2 misses dom b3 & b1 in dom b2 holds
(b2 +* b3) . b1 = b2 . b1
proof end;

theorem Th18: :: FUNCT_4:18
for b1, b2 being Function holds rng (b1 +* b2) c= (rng b1) \/ (rng b2)
proof end;

theorem Th19: :: FUNCT_4:19
for b1, b2 being Function holds rng b1 c= rng (b2 +* b1)
proof end;

theorem Th20: :: FUNCT_4:20
for b1, b2 being Function st dom b1 c= dom b2 holds
b1 +* b2 = b2
proof end;

theorem Th21: :: FUNCT_4:21
for b1 being Function holds {} +* b1 = b1
proof end;

theorem Th22: :: FUNCT_4:22
for b1 being Function holds b1 +* {} = b1
proof end;

theorem Th23: :: FUNCT_4:23
for b1, b2 being set holds (id b1) +* (id b2) = id (b1 \/ b2)
proof end;

theorem Th24: :: FUNCT_4:24
for b1, b2 being Function holds (b1 +* b2) | (dom b2) = b2
proof end;

theorem Th25: :: FUNCT_4:25
for b1, b2 being Function holds (b1 +* b2) | ((dom b1) \ (dom b2)) c= b1
proof end;

theorem Th26: :: FUNCT_4:26
for b1, b2 being Function holds b1 c= b2 +* b1
proof end;

theorem Th27: :: FUNCT_4:27
for b1, b2, b3 being Function st b1 tolerates b2 +* b3 holds
b1 | ((dom b1) \ (dom b3)) tolerates b2
proof end;

theorem Th28: :: FUNCT_4:28
for b1, b2, b3 being Function st b1 tolerates b2 +* b3 holds
b1 tolerates b3
proof end;

theorem Th29: :: FUNCT_4:29
for b1, b2 being Function holds
( b1 tolerates b2 iff b1 c= b1 +* b2 )
proof end;

theorem Th30: :: FUNCT_4:30
for b1, b2 being Function holds b1 +* b2 c= b1 \/ b2
proof end;

theorem Th31: :: FUNCT_4:31
for b1, b2 being Function holds
( b1 tolerates b2 iff b1 \/ b2 = b1 +* b2 )
proof end;

theorem Th32: :: FUNCT_4:32
for b1, b2 being Function st dom b1 misses dom b2 holds
b1 \/ b2 = b1 +* b2
proof end;

theorem Th33: :: FUNCT_4:33
for b1, b2 being Function st dom b1 misses dom b2 holds
b1 c= b1 +* b2
proof end;

theorem Th34: :: FUNCT_4:34
for b1, b2 being Function st dom b1 misses dom b2 holds
(b1 +* b2) | (dom b1) = b1
proof end;

theorem Th35: :: FUNCT_4:35
for b1, b2 being Function holds
( b1 tolerates b2 iff b1 +* b2 = b2 +* b1 )
proof end;

theorem Th36: :: FUNCT_4:36
for b1, b2 being Function st dom b1 misses dom b2 holds
b1 +* b2 = b2 +* b1
proof end;

theorem Th37: :: FUNCT_4:37
for b1, b2 being set
for b3, b4 being PartFunc of b1,b2 st b4 is total holds
b3 +* b4 = b4
proof end;

theorem Th38: :: FUNCT_4:38
for b1, b2 being set
for b3, b4 being Function of b1,b2 st ( b2 = {} implies b1 = {} ) holds
b3 +* b4 = b4
proof end;

theorem Th39: :: FUNCT_4:39
for b1 being set
for b2, b3 being Function of b1,b1 holds b2 +* b3 = b3
proof end;

theorem Th40: :: FUNCT_4:40
for b1 being set
for b2 being non empty set
for b3, b4 being Function of b1,b2 holds b3 +* b4 = b4 by Th38;

theorem Th41: :: FUNCT_4:41
for b1, b2 being set
for b3, b4 being PartFunc of b1,b2 holds b3 +* b4 is PartFunc of b1,b2
proof end;

definition
let c1 be Function;
func ~ c1 -> Function means :Def2: :: FUNCT_4:def 2
( ( for b1 being set holds
( b1 in dom a2 iff ex b2, b3 being set st
( b1 = [b3,b2] & [b2,b3] in dom a1 ) ) ) & ( for b1, b2 being set st [b1,b2] in dom a1 holds
a2 . [b2,b1] = a1 . [b1,b2] ) );
existence
ex b1 being Function st
( ( for b2 being set holds
( b2 in dom b1 iff ex b3, b4 being set st
( b2 = [b4,b3] & [b3,b4] in dom c1 ) ) ) & ( for b2, b3 being set st [b2,b3] in dom c1 holds
b1 . [b3,b2] = c1 . [b2,b3] ) )
proof end;
uniqueness
for b1, b2 being Function st ( for b3 being set holds
( b3 in dom b1 iff ex b4, b5 being set st
( b3 = [b5,b4] & [b4,b5] in dom c1 ) ) ) & ( for b3, b4 being set st [b3,b4] in dom c1 holds
b1 . [b4,b3] = c1 . [b3,b4] ) & ( for b3 being set holds
( b3 in dom b2 iff ex b4, b5 being set st
( b3 = [b5,b4] & [b4,b5] in dom c1 ) ) ) & ( for b3, b4 being set st [b3,b4] in dom c1 holds
b2 . [b4,b3] = c1 . [b3,b4] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines ~ FUNCT_4:def 2 :
for b1, b2 being Function holds
( b2 = ~ b1 iff ( ( for b3 being set holds
( b3 in dom b2 iff ex b4, b5 being set st
( b3 = [b5,b4] & [b4,b5] in dom b1 ) ) ) & ( for b3, b4 being set st [b3,b4] in dom b1 holds
b2 . [b4,b3] = b1 . [b3,b4] ) ) );

theorem Th42: :: FUNCT_4:42
for b1 being Function holds rng (~ b1) c= rng b1
proof end;

theorem Th43: :: FUNCT_4:43
for b1, b2 being set
for b3 being Function holds
( [b1,b2] in dom b3 iff [b2,b1] in dom (~ b3) )
proof end;

theorem Th44: :: FUNCT_4:44
for b1, b2 being set
for b3 being Function st [b1,b2] in dom (~ b3) holds
(~ b3) . [b1,b2] = b3 . [b2,b1]
proof end;

theorem Th45: :: FUNCT_4:45
for b1 being Function ex b2, b3 being set st dom (~ b1) c= [:b2,b3:]
proof end;

theorem Th46: :: FUNCT_4:46
for b1, b2 being set
for b3 being Function st dom b3 c= [:b1,b2:] holds
dom (~ b3) c= [:b2,b1:]
proof end;

theorem Th47: :: FUNCT_4:47
for b1, b2 being set
for b3 being Function st dom b3 = [:b1,b2:] holds
dom (~ b3) = [:b2,b1:]
proof end;

theorem Th48: :: FUNCT_4:48
for b1, b2 being set
for b3 being Function st dom b3 c= [:b1,b2:] holds
rng (~ b3) = rng b3
proof end;

theorem Th49: :: FUNCT_4:49
for b1, b2, b3 being set
for b4 being PartFunc of [:b1,b2:],b3 holds ~ b4 is PartFunc of [:b2,b1:],b3
proof end;

theorem Th50: :: FUNCT_4:50
for b1, b2, b3 being set
for b4 being Function of [:b1,b2:],b3 st b3 <> {} holds
~ b4 is Function of [:b2,b1:],b3
proof end;

theorem Th51: :: FUNCT_4:51
for b1, b2 being set
for b3 being non empty set
for b4 being Function of [:b1,b2:],b3 holds ~ b4 is Function of [:b2,b1:],b3 by Th50;

theorem Th52: :: FUNCT_4:52
for b1 being Function holds ~ (~ b1) c= b1
proof end;

theorem Th53: :: FUNCT_4:53
for b1, b2 being set
for b3 being Function st dom b3 c= [:b1,b2:] holds
~ (~ b3) = b3
proof end;

theorem Th54: :: FUNCT_4:54
for b1, b2, b3 being set
for b4 being PartFunc of [:b1,b2:],b3 holds ~ (~ b4) = b4
proof end;

theorem Th55: :: FUNCT_4:55
for b1, b2, b3 being set
for b4 being Function of [:b1,b2:],b3 st b3 <> {} holds
~ (~ b4) = b4
proof end;

theorem Th56: :: FUNCT_4:56
for b1, b2 being set
for b3 being non empty set
for b4 being Function of [:b1,b2:],b3 holds ~ (~ b4) = b4 by Th55;

definition
let c1, c2 be Function;
func |:c1,c2:| -> Function means :Def3: :: FUNCT_4:def 3
( ( for b1 being set holds
( b1 in dom a3 iff ex b2, b3, b4, b5 being set st
( b1 = [[b2,b4],[b3,b5]] & [b2,b3] in dom a1 & [b4,b5] in dom a2 ) ) ) & ( for b1, b2, b3, b4 being set st [b1,b2] in dom a1 & [b3,b4] in dom a2 holds
a3 . [[b1,b3],[b2,b4]] = [(a1 . [b1,b2]),(a2 . [b3,b4])] ) );
existence
ex b1 being Function st
( ( for b2 being set holds
( b2 in dom b1 iff ex b3, b4, b5, b6 being set st
( b2 = [[b3,b5],[b4,b6]] & [b3,b4] in dom c1 & [b5,b6] in dom c2 ) ) ) & ( for b2, b3, b4, b5 being set st [b2,b3] in dom c1 & [b4,b5] in dom c2 holds
b1 . [[b2,b4],[b3,b5]] = [(c1 . [b2,b3]),(c2 . [b4,b5])] ) )
proof end;
uniqueness
for b1, b2 being Function st ( for b3 being set holds
( b3 in dom b1 iff ex b4, b5, b6, b7 being set st
( b3 = [[b4,b6],[b5,b7]] & [b4,b5] in dom c1 & [b6,b7] in dom c2 ) ) ) & ( for b3, b4, b5, b6 being set st [b3,b4] in dom c1 & [b5,b6] in dom c2 holds
b1 . [[b3,b5],[b4,b6]] = [(c1 . [b3,b4]),(c2 . [b5,b6])] ) & ( for b3 being set holds
( b3 in dom b2 iff ex b4, b5, b6, b7 being set st
( b3 = [[b4,b6],[b5,b7]] & [b4,b5] in dom c1 & [b6,b7] in dom c2 ) ) ) & ( for b3, b4, b5, b6 being set st [b3,b4] in dom c1 & [b5,b6] in dom c2 holds
b2 . [[b3,b5],[b4,b6]] = [(c1 . [b3,b4]),(c2 . [b5,b6])] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines |: FUNCT_4:def 3 :
for b1, b2, b3 being Function holds
( b3 = |:b1,b2:| iff ( ( for b4 being set holds
( b4 in dom b3 iff ex b5, b6, b7, b8 being set st
( b4 = [[b5,b7],[b6,b8]] & [b5,b6] in dom b1 & [b7,b8] in dom b2 ) ) ) & ( for b4, b5, b6, b7 being set st [b4,b5] in dom b1 & [b6,b7] in dom b2 holds
b3 . [[b4,b6],[b5,b7]] = [(b1 . [b4,b5]),(b2 . [b6,b7])] ) ) );

theorem Th57: :: FUNCT_4:57
for b1, b2, b3, b4 being set
for b5, b6 being Function holds
( [[b1,b2],[b3,b4]] in dom |:b5,b6:| iff ( [b1,b3] in dom b5 & [b2,b4] in dom b6 ) )
proof end;

theorem Th58: :: FUNCT_4:58
for b1, b2, b3, b4 being set
for b5, b6 being Function st [[b1,b2],[b3,b4]] in dom |:b5,b6:| holds
|:b5,b6:| . [[b1,b2],[b3,b4]] = [(b5 . [b1,b3]),(b6 . [b2,b4])]
proof end;

theorem Th59: :: FUNCT_4:59
for b1, b2 being Function holds rng |:b1,b2:| c= [:(rng b1),(rng b2):]
proof end;

theorem Th60: :: FUNCT_4:60
for b1, b2, b3, b4 being set
for b5, b6 being Function st dom b5 c= [:b1,b2:] & dom b6 c= [:b3,b4:] holds
dom |:b5,b6:| c= [:[:b1,b3:],[:b2,b4:]:]
proof end;

theorem Th61: :: FUNCT_4:61
for b1, b2, b3, b4 being set
for b5, b6 being Function st dom b5 = [:b1,b2:] & dom b6 = [:b3,b4:] holds
dom |:b5,b6:| = [:[:b1,b3:],[:b2,b4:]:]
proof end;

theorem Th62: :: FUNCT_4:62
for b1, b2, b3, b4, b5, b6 being set
for b7 being PartFunc of [:b1,b2:],b3
for b8 being PartFunc of [:b4,b5:],b6 holds |:b7,b8:| is PartFunc of [:[:b1,b4:],[:b2,b5:]:],[:b3,b6:]
proof end;

theorem Th63: :: FUNCT_4:63
for b1, b2, b3, b4, b5, b6 being set
for b7 being Function of [:b1,b2:],b3
for b8 being Function of [:b4,b5:],b6 st b3 <> {} & b6 <> {} holds
|:b7,b8:| is Function of [:[:b1,b4:],[:b2,b5:]:],[:b3,b6:]
proof end;

theorem Th64: :: FUNCT_4:64
for b1, b2, b3, b4 being set
for b5, b6 being non empty set
for b7 being Function of [:b1,b2:],b5
for b8 being Function of [:b3,b4:],b6 holds |:b7,b8:| is Function of [:[:b1,b3:],[:b2,b4:]:],[:b5,b6:] by Th63;

definition
let c1, c2, c3, c4 be set ;
func c1,c2 --> c3,c4 -> set equals :: FUNCT_4:def 4
({a1} --> a3) +* ({a2} --> a4);
correctness
coherence
({c1} --> c3) +* ({c2} --> c4) is set
;
;
end;

:: deftheorem Def4 defines --> FUNCT_4:def 4 :
for b1, b2, b3, b4 being set holds b1,b2 --> b3,b4 = ({b1} --> b3) +* ({b2} --> b4);

registration
let c1, c2, c3, c4 be set ;
cluster a1,a2 --> a3,a4 -> Relation-like Function-like ;
coherence
( c1,c2 --> c3,c4 is Function-like & c1,c2 --> c3,c4 is Relation-like )
;
end;

theorem Th65: :: FUNCT_4:65
for b1, b2, b3, b4 being set holds
( dom (b1,b2 --> b3,b4) = {b1,b2} & rng (b1,b2 --> b3,b4) c= {b3,b4} )
proof end;

theorem Th66: :: FUNCT_4:66
for b1, b2, b3, b4 being set st b1 <> b2 holds
( (b1,b2 --> b3,b4) . b1 = b3 & (b1,b2 --> b3,b4) . b2 = b4 )
proof end;

theorem Th67: :: FUNCT_4:67
for b1, b2, b3, b4 being set st b1 <> b2 holds
rng (b1,b2 --> b3,b4) = {b3,b4}
proof end;

theorem Th68: :: FUNCT_4:68
for b1, b2, b3 being set holds b1,b2 --> b3,b3 = {b1,b2} --> b3
proof end;

definition
let c1 be non empty set ;
let c2, c3 be set ;
let c4, c5 be Element of c1;
redefine func --> as c2,c3 --> c4,c5 -> Function of {a2,a3},a1;
coherence
c2,c3 --> c4,c5 is Function of {c2,c3},c1
proof end;
end;

theorem Th69: :: FUNCT_4:69
for b1, b2, b3, b4 being set
for b5 being Function st dom b5 = {b1,b2} & b5 . b1 = b3 & b5 . b2 = b4 holds
b5 = b1,b2 --> b3,b4
proof end;

theorem Th70: :: FUNCT_4:70
for b1, b2 being set holds {b1} --> b2 = {[b1,b2]}
proof end;

theorem Th71: :: FUNCT_4:71
for b1, b2, b3, b4 being set st b1 <> b3 holds
b1,b3 --> b2,b4 = {[b1,b2],[b3,b4]}
proof end;

theorem Th72: :: FUNCT_4:72
for b1, b2, b3, b4, b5, b6 being set st b1 <> b2 & b1,b2 --> b3,b4 = b1,b2 --> b5,b6 holds
( b3 = b5 & b4 = b6 )
proof end;

theorem Th73: :: FUNCT_4:73
for b1, b2, b3, b4 being Function st rng b3 c= dom b1 & rng b4 c= dom b2 & b1 tolerates b2 holds
(b1 +* b2) * (b3 +* b4) = (b1 * b3) +* (b2 * b4)
proof end;

theorem Th74: :: FUNCT_4:74
for b1 being Function
for b2, b3 being set st dom b1 c= b2 \/ b3 holds
(b1 | b2) +* (b1 | b3) = b1
proof end;

theorem Th75: :: FUNCT_4:75
for b1, b2 being Function
for b3 being set holds (b1 +* b2) | b3 = (b1 | b3) +* (b2 | b3)
proof end;

theorem Th76: :: FUNCT_4:76
for b1, b2 being Function
for b3 being set st b3 misses dom b2 holds
(b1 +* b2) | b3 = b1 | b3
proof end;

theorem Th77: :: FUNCT_4:77
for b1, b2 being Function
for b3 being set st dom b1 misses b3 holds
(b1 +* b2) | b3 = b2 | b3
proof end;

theorem Th78: :: FUNCT_4:78
for b1, b2, b3 being Function st dom b2 = dom b3 holds
(b1 +* b2) +* b3 = b1 +* b3
proof end;

theorem Th79: :: FUNCT_4:79
for b1, b2 being Function st b1 c= b2 holds
( b1 +* b2 = b2 & b2 +* b1 = b2 )
proof end;

theorem Th80: :: FUNCT_4:80
for b1 being Function
for b2 being set holds b1 +* (b1 | b2) = b1
proof end;

theorem Th81: :: FUNCT_4:81
for b1, b2 being Function
for b3, b4 being set st dom b1 c= b3 & dom b2 c= b4 & b3 misses b4 holds
( (b1 +* b2) | b3 = b1 & (b1 +* b2) | b4 = b2 )
proof end;

theorem Th82: :: FUNCT_4:82
for b1, b2 being Function
for b3 being set st dom b1 c= b3 & dom b2 misses b3 holds
(b1 +* b2) | b3 = b1
proof end;

theorem Th83: :: FUNCT_4:83
for b1 being Function
for b2, b3 being set holds b1 | (b2 \/ b3) = (b1 | b2) +* (b1 | b3)
proof end;