begin definition mode set; end; definition let x,y be set; pred x = y; reflexivity; symmetry; end; notation let x,y be set; antonym x <> y for x = y; end; definition let x,X be set; pred x in X; asymmetry; end; begin reserve x,y,z,u,N,M,X,Y,Z for set; theorem (for x holds x in X iff x in Y) implies X = Y; definition let y; func { y } -> set means x in it iff x = y; let z; func { y, z } -> set means x in it iff x = y or x = z; commutativity; end; definition let X,Y; pred X c= Y means x in X implies x in Y; reflexivity; end; definition let X; func union X -> set means x in it iff ex Y st x in Y & Y in X; end; theorem x in X implies ex Y st Y in X & not ex x st x in X & x in Y; scheme Fraenkel { A()-> set, P[set, set] }: ex X st for x holds x in X iff ex y st y in A() & P[y,x] provided for x,y,z st P[x,y] & P[x,z] holds y = z; definition let x,y; func [x,y] equals { { x,y }, { x } }; end; definition let X,Y; pred X,Y are_equipotent means ex Z st (for x st x in X ex y st y in Y & [x,y] in Z) & (for y st y in Y ex x st x in X & [x,y] in Z) & for x,y,z,u st [x,y] in Z & [z,u] in Z holds x = z iff y = u; end; theorem ex M st N in M & (for X,Y holds X in M & Y c= X implies Y in M) & (for X st X in M ex Z st Z in M & for Y st Y c= X holds Y in Z) & (for X holds X c= M implies X,M are_equipotent or X in M); begin reserve X, Y, Z, x, y, z for set; scheme Separation { A()-> set, P[set] } : ex X being set st for x being set holds x in X iff x in A() & P[x]; definition let X be set; attr X is empty means not ex x being set st x in X; end; registration cluster empty for set; end; definition func {} -> set equals the empty set; let X,Y be set; func X \/ Y -> set means x in it iff x in X or x in Y; commutativity; idempotence; func X /\ Y -> set means x in it iff x in X & x in Y; commutativity; idempotence; func X \ Y -> set means x in it iff x in X & not x in Y; end; definition let X, Y be set; func X \+\ Y -> set equals (X \ Y) \/ (Y \ X); commutativity; pred X misses Y means X /\ Y = {}; symmetry; pred X c< Y means X c= Y & X <> Y; irreflexivity; asymmetry; pred X,Y are_c=-comparable means X c= Y or Y c= X; reflexivity; symmetry; redefine pred X = Y means X c= Y & Y c= X; end; notation let X, Y be set; antonym X meets Y for X misses Y; end; theorem x in X \+\ Y iff not (x in X iff x in Y); theorem (for x holds not x in X iff (x in Y iff x in Z)) implies X = Y \+\ Z; registration cluster {} -> empty; end; registration let x1 be set; cluster { x1 } -> non empty; let x2 be set; cluster { x1, x2 } -> non empty; end; registration cluster non empty for set; end; registration let D be non empty set, X be set; cluster D \/ X -> non empty; cluster X \/ D -> non empty; end; theorem X meets Y iff ex x st x in X & x in Y; theorem X meets Y iff ex x st x in X /\ Y; theorem X misses Y & x in X \/ Y implies x in X & not x in Y or x in Y & not x in X; scheme Extensionality { X,Y() -> set, P[set] } : X() = Y() provided for x holds x in X() iff P[x] and for x holds x in Y() iff P[x]; scheme SetEq { P[set] } : for X1,X2 being set st (for x being set holds x in X1 iff P[x]) & (for x being set holds x in X2 iff P[x]) holds X1 = X2; begin theorem X c< Y implies ex x st x in Y & not x in X; theorem X <> {} implies ex x st x in X; begin theorem for X being set holds X \/ {} = X; theorem for X being set holds X /\ {} = {}; theorem for X being set holds X \ {} = X; theorem for X being set holds {} \ X = {}; theorem for X being set holds X \+\ {} = X; reserve x,X for set; theorem for X being set st X is empty holds X = {}; theorem for x, X being set st x in X holds X is non empty; theorem for X, Y being set st X is empty & X <> Y holds Y is non empty; begin reserve x,A,B,X,X9,Y,Y9,Z,V for set; theorem X c= Y & Y c= Z implies X c= Z; theorem {} c= X; theorem X c= {} implies X = {}; theorem (X \/ Y) \/ Z = X \/ (Y \/ Z); theorem (X \/ Y) \/ Z = (X \/ Z) \/ (Y \/ Z); theorem X \/ (X \/ Y) = X \/ Y; theorem X c= X \/ Y; theorem X c= Z & Y c= Z implies X \/ Y c= Z; theorem X c= Y implies X \/ Z c= Y \/ Z; theorem X c= Y implies X c= Z \/ Y; theorem X \/ Y c= Z implies X c= Z; theorem X c= Y implies X \/ Y = Y; theorem X c= Y & Z c= V implies X \/ Z c= Y \/ V; theorem (Y c= X & Z c= X & for V st Y c= V & Z c= V holds X c= V) implies X = Y \/ Z; theorem X \/ Y = {} implies X = {}; theorem (X /\ Y) /\ Z = X /\ (Y /\ Z); theorem X /\ Y c= X; theorem X c= Y /\ Z implies X c= Y; theorem Z c= X & Z c= Y implies Z c= X /\ Y; theorem (X c= Y & X c= Z & for V st V c= Y & V c= Z holds V c= X) implies X = Y /\ Z; theorem X /\ (X \/ Y) = X; theorem X \/ (X /\ Y) = X; theorem X /\ (Y \/ Z) = X /\ Y \/ X /\ Z; theorem X \/ Y /\ Z = (X \/ Y) /\ (X \/ Z); theorem (X /\ Y) \/ (Y /\ Z) \/ (Z /\ X) = (X \/ Y) /\ (Y \/ Z) /\ (Z \/ X); theorem X c= Y implies X /\ Z c= Y /\ Z; theorem X c= Y & Z c= V implies X /\ Z c= Y /\ V; theorem X c= Y implies X /\ Y = X; theorem X /\ Y c= X \/ Z; theorem X c= Z implies X \/ Y /\ Z = (X \/ Y) /\ Z; theorem (X /\ Y) \/ (X /\ Z) c= Y \/ Z; theorem X \ Y = Y \ X implies X = Y; theorem X c= Y implies X \ Z c= Y \ Z; theorem X c= Y implies Z \ Y c= Z \ X; theorem X c= Y & Z c= V implies X \ V c= Y \ Z; theorem X \ Y c= X; theorem X \ Y = {} iff X c= Y; theorem X c= Y \ X implies X = {}; theorem X \/ (Y \ X) = X \/ Y; theorem (X \/ Y) \ Y = X \ Y; theorem (X \ Y) \ Z = X \ (Y \/ Z); theorem (X \/ Y) \ Z = (X \ Z) \/ (Y \ Z); theorem X c= Y \/ Z implies X \ Y c= Z; theorem X \ Y c= Z implies X c= Y \/ Z; theorem X c= Y implies Y = X \/ (Y \ X); theorem X \ (X \/ Y) = {}; theorem X \ X /\ Y = X \ Y; theorem X \ (X \ Y) = X /\ Y; theorem X /\ (Y \ Z) = (X /\ Y) \ Z; theorem X /\ (Y \ Z) = X /\ Y \ X /\ Z; theorem X /\ Y \/ (X \ Y) = X; theorem X \ (Y \ Z) = (X \ Y) \/ X /\ Z; theorem X \ (Y \/ Z) = (X \ Y) /\ (X \ Z); theorem X \ (Y /\ Z) = (X \ Y) \/ (X \ Z); theorem (X \/ Y) \ (X /\ Y) = (X \ Y) \/ (Y \ X); theorem X c< Y & Y c< Z implies X c< Z; theorem not (X c< Y & Y c< X); theorem X c< Y & Y c= Z implies X c< Z; theorem X c= Y & Y c< Z implies X c< Z; theorem X c= Y implies not Y c< X; theorem X <> {} implies {} c< X; theorem not X c< {}; theorem X c= Y & Y misses Z implies X misses Z; theorem A c= X & B c= Y & X misses Y implies A misses B; theorem X misses {}; theorem X meets X iff X <> {}; theorem X c= Y & X c= Z & Y misses Z implies X = {}; theorem for A being non empty set st A c= Y & A c= Z holds Y meets Z; theorem for A being non empty set st A c= Y holds A meets Y; theorem X meets Y \/ Z iff X meets Y or X meets Z; theorem X \/ Y = Z \/ Y & X misses Y & Z misses Y implies X = Z; theorem X9 \/ Y9 = X \/ Y & X misses X9 & Y misses Y9 implies X = Y9; theorem X c= Y \/ Z & X misses Z implies X c= Y; theorem X meets Y /\ Z implies X meets Y; theorem X meets Y implies X /\ Y meets Y; theorem Y misses Z implies X /\ Y misses X /\ Z; theorem X meets Y & X c= Z implies X meets Y /\ Z; theorem X misses Y implies X /\ (Y \/ Z) = X /\ Z; theorem X \ Y misses Y; theorem X misses Y implies X misses Y \ Z; theorem X misses Y \ Z implies Y misses X \ Z; theorem X \ Y misses Y \ X; theorem X misses Y iff X \ Y = X; theorem X meets Y & X misses Z implies X meets Y \ Z; theorem X c= Y implies X misses Z \ Y; theorem X c= Y & X misses Z implies X c= Y \ Z; theorem Y misses Z implies (X \ Y) \/ Z = (X \/ Z) \ Y; theorem X misses Y implies (X \/ Y) \ Y = X; theorem X /\ Y misses X \ Y; theorem X \ (X /\ Y) misses Y; theorem (X \+\ Y) \+\ Z = X \+\ (Y \+\ Z); theorem X \+\ X = {}; theorem X \/ Y = (X \+\ Y) \/ X /\ Y; theorem X \/ Y = X \+\ Y \+\ X /\ Y; theorem X /\ Y = X \+\ Y \+\ (X \/ Y); theorem X \ Y c= X \+\ Y; theorem X \ Y c= Z & Y \ X c= Z implies X \+\ Y c= Z; theorem X \/ Y = X \+\ (Y \ X); theorem (X \+\ Y) \ Z = (X \ (Y \/ Z)) \/ (Y \ (X \/ Z)); theorem X \ Y = X \+\ (X /\ Y); theorem X \+\ Y = (X \/ Y) \ X /\ Y; theorem X \ (Y \+\ Z) = X \ (Y \/ Z) \/ X /\ Y /\ Z; theorem X /\ Y misses X \+\ Y; theorem X c< Y or X = Y or Y c< X iff X,Y are_c=-comparable; begin theorem for X, Y being set st X c< Y holds Y \ X <> {}; theorem X c= A \ B implies X c= A & X misses B; theorem X c= A \+\ B iff X c= A \/ B & X misses A /\ B; theorem X c= A implies X /\ Y c= A; theorem X c= A implies X \ Y c= A; theorem X c= A & Y c= A implies X \+\ Y c= A; theorem (X /\ Z) \ (Y /\ Z) = (X \ Y) /\ Z; theorem (X /\ Z) \+\ (Y /\ Z) = (X \+\ Y) /\ Z; theorem X \/ Y \/ Z \/ V = X \/ (Y \/ Z \/ V); theorem for A,B,C,D being set st A misses D & B misses D & C misses D holds A \/ B \/ C misses D; theorem not A c< {}; theorem X /\ (Y /\ Z) = (X /\ Y) /\ (X /\ Z); theorem for P,G,C being set st C c= G holds P \ C = (P \ G) \/ (P /\ (G \ C)); begin reserve x,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,y,X,Z for set; definition let x1,x2,x3; func { x1,x2,x3 } -> set means x in it iff x=x1 or x=x2 or x=x3; end; definition let x1,x2,x3,x4; func { x1,x2,x3,x4 } -> set means x in it iff x=x1 or x=x2 or x=x3 or x=x4; end; definition let x1,x2,x3,x4,x5; func { x1,x2,x3,x4,x5 } -> set means x in it iff x=x1 or x=x2 or x=x3 or x=x4 or x=x5; end; definition let x1,x2,x3,x4,x5,x6; func { x1,x2,x3,x4,x5,x6 } -> set means x in it iff x=x1 or x=x2 or x =x3 or x=x4 or x=x5 or x=x6; end; definition let x1,x2,x3,x4,x5,x6,x7; func { x1,x2,x3,x4,x5,x6,x7 } -> set means x in it iff x=x1 or x=x2 or x=x3 or x=x4 or x=x5 or x=x6 or x=x7; end; definition let x1,x2,x3,x4,x5,x6,x7,x8; func { x1,x2,x3,x4,x5,x6,x7,x8 } -> set means x in it iff x=x1 or x= x2 or x=x3 or x=x4 or x=x5 or x=x6 or x=x7 or x=x8; end; definition let x1,x2,x3,x4,x5,x6,x7,x8,x9; func { x1,x2,x3,x4,x5,x6,x7,x8,x9 } -> set means x in it iff x=x1 or x=x2 or x=x3 or x=x4 or x=x5 or x=x6 or x=x7 or x=x8 or x=x9; end; definition let x1,x2,x3,x4,x5,x6,x7,x8,x9,x10; func { x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 } -> set means x in it iff x=x1 or x=x2 or x=x3 or x=x4 or x=x5 or x=x6 or x=x7 or x=x8 or x=x9 or x=x10; end; theorem { x1,x2 } = { x1 } \/ { x2 }; theorem { x1,x2,x3 } = { x1 } \/ { x2,x3 }; theorem { x1,x2,x3 } = { x1,x2 } \/ { x3 }; theorem { x1,x2,x3,x4 } = { x1 } \/ { x2,x3,x4 }; theorem { x1,x2,x3,x4 } = { x1,x2 } \/ { x3,x4 }; theorem { x1,x2,x3,x4 } = { x1,x2,x3 } \/ { x4 }; theorem { x1,x2,x3,x4,x5 } = { x1 } \/ { x2,x3,x4,x5 }; theorem { x1,x2,x3,x4,x5 } = { x1,x2 } \/ { x3,x4,x5 }; theorem { x1,x2,x3,x4,x5 } = { x1,x2,x3 } \/ { x4,x5 }; theorem { x1,x2,x3,x4,x5 } = { x1,x2,x3,x4 } \/ { x5 }; theorem { x1,x2,x3,x4,x5,x6 } = { x1 } \/ { x2,x3,x4,x5,x6 }; theorem { x1,x2,x3,x4,x5,x6 } = { x1,x2 } \/ { x3,x4,x5,x6 }; theorem { x1,x2,x3,x4,x5,x6 } = { x1,x2,x3 } \/ { x4,x5,x6 }; theorem { x1,x2,x3,x4,x5,x6 } = { x1,x2,x3,x4 } \/ { x5,x6 }; theorem { x1,x2,x3,x4,x5,x6 } = { x1,x2,x3,x4,x5 } \/ { x6 }; theorem { x1,x2,x3,x4,x5,x6,x7 } = { x1 } \/ { x2,x3,x4,x5,x6,x7 }; theorem { x1,x2,x3,x4,x5,x6,x7 } = { x1,x2 } \/ { x3,x4,x5,x6,x7 }; theorem { x1,x2,x3,x4,x5,x6,x7 } = { x1,x2,x3 } \/ { x4,x5,x6,x7 }; theorem { x1,x2,x3,x4,x5,x6,x7 } = { x1,x2,x3,x4 } \/ { x5,x6,x7 }; theorem { x1,x2,x3,x4,x5,x6,x7 } = { x1,x2,x3,x4,x5 } \/ { x6,x7 }; theorem { x1,x2,x3,x4,x5,x6,x7 } = { x1,x2,x3,x4,x5,x6 } \/ { x7 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1 } \/ { x2,x3,x4,x5,x6,x7,x8 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1,x2 } \/ { x3,x4,x5,x6,x7,x8 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1,x2,x3 } \/ { x4,x5,x6,x7,x8 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1,x2,x3,x4 } \/ { x5,x6,x7,x8 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1,x2,x3,x4,x5 } \/ { x6,x7,x8 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1,x2,x3,x4,x5,x6 } \/ { x7,x8 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8 } = { x1,x2,x3,x4,x5,x6,x7 } \/ { x8 }; theorem { x1,x1 } = { x1 }; theorem { x1,x1,x2 } = { x1,x2 }; theorem { x1,x1,x2,x3 } = { x1,x2,x3 }; theorem { x1,x1,x2,x3,x4 } = { x1,x2,x3,x4 }; theorem { x1,x1,x2,x3,x4,x5 } = { x1,x2,x3,x4,x5 }; theorem { x1,x1,x2,x3,x4,x5,x6 } = { x1,x2,x3,x4,x5,x6 }; theorem { x1,x1,x2,x3,x4,x5,x6,x7 } = { x1,x2,x3,x4,x5,x6,x7 }; theorem { x1,x1,x1 } = { x1 }; theorem { x1,x1,x1,x2 } = { x1,x2 }; theorem { x1,x1,x1,x2,x3 } = { x1,x2,x3 }; theorem { x1,x1,x1,x2,x3,x4 } = { x1,x2,x3,x4 }; theorem { x1,x1,x1,x2,x3,x4,x5 } = { x1,x2,x3,x4,x5 }; theorem { x1,x1,x1,x2,x3,x4,x5,x6 } = { x1,x2,x3,x4,x5,x6 }; theorem { x1,x1,x1,x1 } = { x1 }; theorem { x1,x1,x1,x1,x2 } = { x1,x2 }; theorem { x1,x1,x1,x1,x2,x3 } = { x1,x2,x3 }; theorem { x1,x1,x1,x1,x2,x3,x4 } = { x1,x2,x3,x4 }; theorem { x1,x1,x1,x1,x2,x3,x4,x5 } = { x1,x2,x3,x4,x5 }; theorem { x1,x1,x1,x1,x1 } = { x1 }; theorem { x1,x1,x1,x1,x1,x2 } = { x1,x2 }; theorem { x1,x1,x1,x1,x1,x2,x3 } = { x1,x2,x3 }; theorem { x1,x1,x1,x1,x1,x2,x3,x4 } = { x1,x2,x3,x4 }; theorem { x1,x1,x1,x1,x1,x1 } = { x1 }; theorem { x1,x1,x1,x1,x1,x1,x2 } = { x1,x2 }; theorem { x1,x1,x1,x1,x1,x1,x2,x3 } = { x1,x2,x3 }; theorem { x1,x1,x1,x1,x1,x1,x1 } = { x1 }; theorem { x1,x1,x1,x1,x1,x1,x1,x2 } = { x1,x2 }; theorem { x1,x1,x1,x1,x1,x1,x1,x1 } = { x1 }; theorem { x1,x2,x3 } = { x1,x3,x2 }; theorem { x1,x2,x3 } = { x2,x1,x3 }; theorem { x1,x2,x3 } = { x2,x3,x1 }; theorem { x1,x2,x3 } = { x3,x2,x1 }; theorem { x1,x2,x3,x4 } = { x1,x2,x4,x3 }; theorem { x1,x2,x3,x4 } = { x1,x3,x2,x4 }; theorem { x1,x2,x3,x4 } = { x1,x3,x4,x2 }; theorem { x1,x2,x3,x4 } = { x1,x4,x3,x2 }; theorem { x1,x2,x3,x4 } = { x2,x1,x3,x4 }; theorem { x1,x2,x3,x4 } = { x2,x1,x4,x3 }; theorem { x1,x2,x3,x4 } = { x2,x3,x1,x4 }; theorem { x1,x2,x3,x4 } = { x2,x3,x4,x1 }; theorem { x1,x2,x3,x4 } = { x2,x4,x1,x3 }; theorem { x1,x2,x3,x4 } = { x2,x4,x3,x1 }; theorem { x1,x2,x3,x4 } = { x3,x2,x1,x4 }; theorem { x1,x2,x3,x4 } = { x3,x2,x4,x1 }; theorem { x1,x2,x3,x4 } = { x3,x4,x1,x2 }; theorem { x1,x2,x3,x4 } = { x3,x4,x2,x1 }; theorem { x1,x2,x3,x4 } = { x4,x2,x3,x1 }; theorem { x1,x2,x3,x4 } = { x4,x3,x2,x1 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1 } \/ { x2,x3,x4,x5,x6,x7,x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2 } \/ { x3,x4,x5,x6,x7,x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2,x3 } \/ { x4,x5,x6,x7,x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2,x3,x4 } \/ { x5,x6,x7,x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2,x3,x4,x5 } \/ { x6,x7,x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2,x3,x4,x5,x6 } \/ { x7,x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2,x3,x4,x5,x6,x7 } \/ { x8,x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9 } = { x1,x2,x3,x4,x5,x6,x7,x8 } \/ { x9 }; theorem { x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 } = { x1,x2,x3,x4,x5,x6,x7,x8,x9 } \/ { x10 }; begin theorem for x, y, z being set st x <> y & x <> z holds {x, y, z} \ {x} = {y, z }; theorem for x1,x2,x3 being set holds {x2,x1} \/ {x3,x1} = {x1,x2,x3}; begin reserve x,x1,x2,x3,x4,y,y1,y2,y3,y4,z,z1,z2,z2,z4 for set; definition let x; attr x is pair means ex x1,x2 st x = [x1,x2]; end; registration let x1,x2; cluster [x1,x2] -> pair; end; reserve X,Y for set; theorem [x1,x2] = [y1,y2] implies x1 = y1 & x2 = y2; definition let x; assume x is pair; func x`1 means x = [y1,y2] implies it = y1; func x`2 means x = [y1,y2] implies it = y2; end; registration let x1,x2; reduce [x1,x2]`1 to x1; reduce [x1,x2]`2 to x2; end; registration cluster pair for set; end; registration let x be pair set; reduce [x`1,x`2] to x; end; theorem for a,b being pair set st a`1 = b`1 & a`2 = b`2 holds a = b; begin definition let x1,x2,x3; func [x1,x2,x3] equals [[x1,x2],x3]; end; definition let x; attr x is triple means ex x1,x2,x3 st x = [x1,x2,x3]; end; registration let x1,x2,x3; cluster [x1,x2,x3] -> triple; end; theorem [x1,x2,x3] = [y1,y2,y3] implies x1 = y1 & x2 = y2 & x3 = y3; registration cluster triple for set; cluster triple -> pair for set; end; definition let x be set; func x`1_3 equals x`1`1; func x`2_3 equals x`1`2; end; notation let x be set; synonym x`3_3 for x`2; end; registration let x1,x2,x3; reduce [x1,x2,x3]`1_3 to x1; reduce [x1,x2,x3]`2_3 to x2; reduce [x1,x2,x3]`3_3 to x3; end; registration let x be triple set; reduce [x`1_3,x`2_3,x`3_3] to x; end; theorem for a,b being triple set st a`1_3 = b`1_3 & a`2_3 = b`2_3 & a`3_3 = b`3_3 holds a = b; begin definition let x1,x2,x3,x4; func [x1,x2,x3,x4] equals [[x1,x2,x3],x4]; end; definition let x; attr x is quadruple means ex x1,x2,x3,x4 st x = [x1,x2,x3,x4]; end; registration let x1,x2,x3,x4; cluster [x1,x2,x3,x4] -> quadruple; end; theorem [x1,x2,x3,x4] = [y1,y2,y3,y4] implies x1 = y1 & x2 = y2 & x3 = y3 & x4 = y4; registration cluster quadruple for set; cluster quadruple -> triple for set; end; definition let x be set; func x`1_4 equals x`1`1`1; func x`2_4 equals x`1`1`2; end; notation let x be set; synonym x`3_4 for x`2_3; synonym x`4_4 for x`2; end; registration let x1,x2,x3,x4; reduce [x1,x2,x3,x4]`1_4 to x1; reduce [x1,x2,x3,x4]`2_4 to x2; reduce [x1,x2,x3,x4]`3_4 to x3; reduce [x1,x2,x3,x4]`4_4 to x4; end; registration let x be quadruple set; reduce [x`1_4,x`2_4,x`3_4,x`4_4] to x; end; reserve X,X1,X2,X3,X4,Y for set; theorem [x,y] in X implies x in union union X; theorem [x,y] in X implies y in union union X; definition let X be set; func proj1 X -> set means x in it iff ex y st [x,y] in X; func proj2 X -> set means x in it iff ex y st [y,x] in X; end; theorem X c= Y implies proj1 X c= proj1 Y; theorem X c= Y implies proj2 X c= proj2 Y; definition let X be set; func proj1_3 X -> set equals proj1 proj1 X; func proj2_3 X -> set equals proj2 proj1 X; end; notation let X be set; synonym proj3_3 X for proj2 X; end; theorem X c= Y implies proj1_3 X c= proj1_3 Y; theorem X c= Y implies proj2_3 X c= proj2_3 Y; theorem x in proj1_3 X implies ex y,z st [x,y,z] in X; theorem [x,y,z] in X implies x in proj1_3 X; theorem x in proj2_3 X implies ex y,z st [y,x,z] in X; theorem [x,y,z] in X implies y in proj2_3 X; definition let X be set; func proj1_4 X -> set equals proj1 proj1_3 X; func proj2_4 X -> set equals proj2 proj1_3 X; end; notation let X be set; synonym proj3_4 X for proj2_3 X; synonym proj4_4 X for proj2 X; end; theorem X c= Y implies proj1_4 X c= proj1_4 Y; theorem X c= Y implies proj2_4 X c= proj2_4 Y; theorem x in proj1_4 X implies ex x1,x2,x3 st [x,x1,x2,x3] in X; theorem [x,x1,x2,x3] in X implies x in proj1_4 X; theorem x in proj2_4 X implies ex x1,x2,x3 st [x1,x,x2,x3] in X; theorem [x1,x,x2,x3] in X implies x in proj2_4 X; theorem for a,b being quadruple set st a`1_4 = b`1_4 & a`2_4 = b`2_4 & a`3_4 = b`3_4 & a`4_4 = b`4_4 holds a = b; begin registration let X be empty set; cluster proj1 X -> empty; end; registration let X be empty set; cluster proj2 X -> empty; end; registration let X be empty set; cluster proj1_3 X -> empty; end; registration let X be empty set; cluster proj2_3 X -> empty; end; registration let X be empty set; cluster proj1_4 X -> empty; end; registration let X be empty set; cluster proj2_4 X -> empty; end; theorem proj1(X \/ Y) = proj1 X \/ proj1 Y; theorem proj1(X /\ Y) c= proj1 X /\ proj1 Y; theorem proj1 X \ proj1 Y c= proj1(X \ Y); theorem proj1 X \+\ proj1 Y c= proj1(X \+\ Y); theorem proj2(X \/ Y) = proj2 X \/ proj2 Y; theorem proj2(X /\ Y) c= proj2 X /\ proj2 Y; theorem proj2 X \ proj2 Y c= proj2(X \ Y); theorem proj2 X \+\ proj2 Y c= proj2(X \+\ Y); theorem proj1_3(X \/ Y) = proj1_3 X \/ proj1_3 Y; theorem proj1_3(X /\ Y) c= proj1_3 X /\ proj1_3 Y; theorem proj1_3 X \ proj1_3 Y c= proj1_3(X \ Y); theorem proj1_3 X \+\ proj1_3 Y c= proj1_3(X \+\ Y); theorem proj2_3(X \/ Y) = proj2_3 X \/ proj2_3 Y; theorem proj2_3(X /\ Y) c= proj2_3 X /\ proj2_3 Y; theorem proj2_3 X \ proj2_3 Y c= proj2_3(X \ Y); theorem proj2_3 X \+\ proj2_3 Y c= proj2_3(X \+\ Y); theorem proj1_4(X \/ Y) = proj1_4 X \/ proj1_4 Y; theorem proj1_4(X /\ Y) c= proj1_4 X /\ proj1_4 Y; theorem proj1_4 X \ proj1_4 Y c= proj1_4(X \ Y); theorem proj1_4 X \+\ proj1_4 Y c= proj1_4(X \+\ Y); theorem proj2_4(X \/ Y) = proj2_4 X \/ proj2_4 Y; theorem proj2_4(X /\ Y) c= proj2_4 X /\ proj2_4 Y; theorem proj2_4 X \ proj2_4 Y c= proj2_4(X \ Y); theorem proj2_4 X \+\ proj2_4 Y c= proj2_4(X \+\ Y); begin reserve x,y,X1,X2,X3,X4,X5,X6,Y,Y1,Y2,Y3,Y4,Y5,Z,Z1,Z2,Z3,Z4,Z5 for set; reserve X for non empty set; theorem ex Y st Y in X & Y misses X; theorem ex Y st Y in X & for Y1 st Y1 in Y holds Y1 misses X; theorem ex Y st Y in X & for Y1,Y2 st Y1 in Y2 & Y2 in Y holds Y1 misses X; theorem ex Y st Y in X & for Y1,Y2,Y3 st Y1 in Y2 & Y2 in Y3 & Y3 in Y holds Y1 misses X; theorem ex Y st Y in X & for Y1,Y2,Y3,Y4 st Y1 in Y2 & Y2 in Y3 & Y3 in Y4 & Y4 in Y holds Y1 misses X; theorem ex Y st Y in X & for Y1,Y2,Y3,Y4,Y5 st Y1 in Y2 & Y2 in Y3 & Y3 in Y4 & Y4 in Y5 & Y5 in Y holds Y1 misses X; theorem not ( X1 in X2 & X2 in X3 & X3 in X1); theorem not ( X1 in X2 & X2 in X3 & X3 in X4 & X4 in X1); theorem not ( X1 in X2 & X2 in X3 & X3 in X4 & X4 in X5 & X5 in X1); theorem not ( X1 in X2 & X2 in X3 & X3 in X4 & X4 in X5 & X5 in X6 & X6 in X1); begin reserve v,x,x1,x2,y,y1,y2,z,A,B,X,X1,X2,X3,X4,Y,Y1,Y2,Z,N,M for set; registration let x, y be set; cluster [x,y] -> non empty; end; definition let X; func bool X means Z in it iff Z c= X; end; definition let X1,X2; func [: X1,X2 :] means z in it iff ex x,y st x in X1 & y in X2 & z = [x,y]; end; definition let X1,X2,X3; func [: X1,X2,X3 :] equals [:[:X1,X2:],X3:]; end; definition let X1,X2,X3,X4; func [: X1,X2,X3,X4 :] equals [:[:X1,X2,X3:],X4:]; end; begin theorem bool {} = { {} }; theorem union {} = {}; theorem {x} c= {y} implies x = y; theorem {x} = {y1,y2} implies x = y1; theorem {x} = {y1,y2} implies y1 = y2; theorem { x1,x2 } = { y1,y2 } implies x1 = y1 or x1 = y2; theorem {x} c= {x,y}; theorem {x} \/ {y} = {x} implies x = y; theorem {x} \/ {x,y} = {x,y}; theorem {x} misses {y} implies x <> y; theorem x <> y implies {x} misses {y}; theorem {x} /\ {y} = {x} implies x = y; theorem {x} /\ {x,y} = {x}; theorem {x} \ {y} = {x} iff x <> y; theorem {x} \ {y} = {} implies x = y; theorem {x} \ {x,y} = {}; theorem x <> y implies { x,y } \ { y } = { x }; theorem {x} c= {y} implies x = y; theorem {z} c= {x,y} implies z = x or z = y; theorem {x,y} c= {z} implies x = z; theorem {x,y} c= {z} implies {x,y} = {z}; theorem {x1,x2} c= {y1,y2} implies x1 = y1 or x1 = y2; theorem x <> y implies { x } \+\ { y } = { x,y }; theorem bool { x } = { {} , { x }}; theorem union { x } = x; theorem union {{x},{y}} = {x,y}; canceled; theorem [x,y] in [:{x1},{y1}:] iff x = x1 & y = y1; theorem [:{x},{y}:] = {[x,y]}; theorem [:{x},{y,z}:] = {[x,y],[x,z]} & [:{x,y},{z}:] = {[x,z],[y,z]}; theorem {x} c= X iff x in X; theorem {x1,x2} c= Z iff x1 in Z & x2 in Z; theorem Y c= { x } iff Y = {} or Y = { x }; theorem Y c= X & not x in Y implies Y c= X \ { x }; theorem X <> {x} & X <> {} implies ex y st y in X & y <> x; theorem Z c= {x1,x2} iff Z = {} or Z = {x1} or Z = {x2} or Z = {x1,x2}; theorem {z} = X \/ Y implies X = {z} & Y = {z} or X = {} & Y = {z} or X = {z} & Y = {}; theorem {z} = X \/ Y & X <> Y implies X = {} or Y = {}; theorem {x} \/ X c= X implies x in X; theorem x in X implies {x} \/ X = X; theorem {x,y} \/ Z c= Z implies x in Z; theorem x in Z & y in Z implies {x,y} \/ Z = Z; theorem {x} \/ X <> {}; theorem {x,y} \/ X <> {}; theorem X /\ {x} = {x} implies x in X; theorem x in X implies X /\ {x} = {x}; theorem x in Z & y in Z implies {x,y} /\ Z = {x,y}; theorem {x} misses X implies not x in X; theorem {x,y} misses Z implies not x in Z; theorem not x in X implies {x} misses X; theorem not x in Z & not y in Z implies {x,y} misses Z; theorem {x} misses X or {x} /\ X = {x}; theorem {x,y} /\ X = {x} implies not y in X or x = y; theorem x in X & (not y in X or x = y) implies {x,y} /\ X = {x}; theorem {x,y} /\ X = {x,y} implies x in X; theorem z in X \ {x} iff z in X & z <> x; theorem X \ {x} = X iff not x in X; theorem X \ {x} = {} implies X = {} or X = {x}; theorem {x} \ X = {x} iff not x in X; theorem {x} \ X = {} iff x in X; theorem {x} \ X = {} or {x} \ X = {x}; theorem {x,y} \ X = {x} iff not x in X & (y in X or x = y); theorem {x,y} \ X = {x,y} iff not x in X & not y in X; theorem {x,y} \ X = {} iff x in X & y in X; theorem {x,y} \ X = {} or {x,y} \ X = {x} or {x,y} \ X = {y} or {x,y} \ X = {x ,y}; theorem X \ {x,y} = {} iff X = {} or X = {x} or X = {y} or X = {x,y}; theorem A c= B implies bool A c= bool B; theorem { A } c= bool A; theorem bool A \/ bool B c= bool (A \/ B); theorem bool A \/ bool B = bool (A \/ B) implies A,B are_c=-comparable; theorem bool (A /\ B) = bool A /\ bool B; theorem bool (A \ B) c= { {} } \/ (bool A \ bool B); theorem bool (A \ B) \/ bool (B \ A) c= bool (A \+\ B); theorem X in A implies X c= union A; theorem union { X,Y } = X \/ Y; theorem (for X st X in A holds X c= Z) implies union A c= Z; theorem A c= B implies union A c= union B; theorem union (A \/ B) = union A \/ union B; theorem union (A /\ B) c= union A /\ union B; theorem (for X st X in A holds X misses B) implies union A misses B; theorem union bool A = A; theorem A c= bool union A; theorem (for X,Y st X<>Y & X in A \/ B & Y in A \/ B holds X misses Y) implies union(A /\ B) = union A /\ union B; theorem A c= [:X,Y:] & z in A implies ex x,y st x in X & y in Y & z = [ x,y]; theorem z in [:X1, Y1:] /\ [:X2, Y2:] implies ex x,y st z = [x,y] & x in X1 /\ X2 & y in Y1 /\ Y2; theorem [:X,Y:] c= bool bool (X \/ Y); theorem [x,y] in [:X,Y:] iff x in X & y in Y; theorem [x,y] in [:X,Y:] implies [y,x] in [:Y,X:]; theorem (for x,y holds [x,y] in [:X1,Y1:] iff [x,y] in [:X2,Y2:]) implies [:X1 ,Y1:]=[:X2,Y2:]; theorem [:X,Y:] = {} iff X = {} or Y = {}; theorem X <> {} & Y <> {} & [:X,Y:] = [:Y,X:] implies X = Y; theorem [:X,X:] = [:Y,Y:] implies X = Y; theorem X c= [:X,X:] implies X = {}; theorem Z <> {} & ([:X,Z:] c= [:Y,Z:] or [:Z,X:] c= [:Z,Y:]) implies X c= Y; theorem X c= Y implies [:X,Z:] c= [:Y,Z:] & [:Z,X:] c= [:Z,Y:]; theorem X1 c= Y1 & X2 c= Y2 implies [:X1,X2:] c= [:Y1,Y2:]; theorem [:X \/ Y, Z:] = [:X, Z:] \/ [:Y, Z:] & [:Z, X \/ Y:] = [:Z, X:] \/ [:Z, Y:]; theorem [:X1 \/ X2, Y1 \/ Y2:] = [:X1,Y1:] \/ [:X1,Y2:] \/ [:X2,Y1:] \/ [:X2, Y2:]; theorem [:X /\ Y, Z:] = [:X, Z:] /\ [:Y, Z:] & [:Z, X /\ Y:] = [:Z, X:] /\ [:Z , Y :] ; theorem [:X1 /\ X2, Y1 /\ Y2:] = [:X1,Y1:] /\ [:X2, Y2:]; theorem A c= X & B c= Y implies [:A,Y:] /\ [:X,B:] = [:A,B:]; theorem [:X \ Y, Z:] = [:X, Z:] \ [:Y, Z:] & [:Z, X \ Y:] = [:Z, X:] \ [:Z, Y:]; theorem [:X1,X2:] \ [:Y1,Y2:] = [:X1\Y1,X2:] \/ [:X1,X2\Y2:]; theorem X1 misses X2 or Y1 misses Y2 implies [:X1,Y1:] misses [:X2,Y2:]; theorem [x,y] in [:{z},Y:] iff x = z & y in Y; theorem [x,y] in [:X,{z}:] iff x in X & y = z; theorem X <> {} implies [:{x},X:] <> {} & [:X,{x}:] <> {}; theorem x <> y implies [:{x},X:] misses [:{y},Y:] & [:X,{x}:] misses [:Y,{y}:]; theorem [:{x,y},X:] = [:{x},X:] \/ [:{y},X:] & [:X,{x,y}:] = [:X,{x}:] \/ [:X, {y} :] ; theorem X1 <> {} & Y1 <> {} & [:X1,Y1:] = [:X2,Y2:] implies X1 = X2 & Y1 = Y2; theorem X c= [:X,Y:] or X c= [:Y,X:] implies X = {}; theorem ex M st N in M & (for X,Y holds X in M & Y c= X implies Y in M) & (for X holds X in M implies bool X in M) & for X holds X c= M implies X,M are_equipotent or X in M; reserve e,X,X1,X2,Y1,Y2 for set; theorem e in [:X1,Y1:] & e in [:X2,Y2:] implies e in [:X1 /\ X2, Y1 /\ Y2:]; begin theorem [:X1,X2:] c= [:Y1,Y2:] & [:X1,X2:] <> {} implies X1 c= Y1 & X2 c= Y2; theorem for A being non empty set, B,C,D being set st [:A,B:] c= [:C,D:] or [: B,A:] c= [:D,C:] holds B c= D; theorem x in X implies (X\{x})\/{x}=X; theorem not x in X implies (X\/{x})\{x}=X; theorem for x,y,z,Z being set holds Z c= {x,y,z} iff Z = {} or Z = {x} or Z = {y} or Z = {z} or Z = {x,y} or Z = {y,z} or Z = {x,z} or Z = {x,y,z}; theorem N c= [:X1,Y1:] & M c= [:X2,Y2:] implies N \/ M c= [:X1 \/ X2,Y1 \/ Y2 :]; theorem not x in X & not y in X implies X = X \ {x,y}; theorem not x in X & not y in X implies X = X \/ {x,y} \ {x,y}; definition let x1, x2, x3 be set; pred x1, x2, x3 are_mutually_different means x1 <> x2 & x1 <> x3 & x2 <> x3; end; definition let x1, x2, x3, x4 be set; pred x1, x2, x3, x4 are_mutually_different means x1 <> x2 & x1 <> x3 & x1 <> x4 & x2 <> x3 & x2 <> x4 & x3 <> x4; end; definition let x1, x2, x3, x4, x5 be set; pred x1, x2, x3, x4, x5 are_mutually_different means x1 <> x2 & x1 <> x3 & x1 <> x4 & x1 <> x5 & x2 <> x3 & x2 <> x4 & x2 <> x5 & x3 <> x4 & x3 <> x5 & x4 <> x5; end; definition let x1, x2, x3, x4, x5, x6 be set; pred x1, x2, x3, x4, x5, x6 are_mutually_different means x1 <> x2 & x1 <> x3 & x1 <> x4 & x1 <> x5 & x1 <> x6 & x2 <> x3 & x2 <> x4 & x2 <> x5 & x2 <> x6 & x3 <> x4 & x3 <> x5 & x3 <> x6 & x4 <> x5 & x4 <> x6 & x5 <> x6; end; definition let x1, x2, x3, x4, x5, x6, x7 be set; pred x1, x2, x3, x4, x5, x6, x7 are_mutually_different means x1 <> x2 & x1 <> x3 & x1 <> x4 & x1 <> x5 & x1 <> x6 & x1 <> x7 & x2 <> x3 & x2 <> x4 & x2 <> x5 & x2 <> x6 & x2 <> x7 & x3 <> x4 & x3 <> x5 & x3 <> x6 & x3 <> x7 & x4 <> x5 & x4 <> x6 & x4 <> x7 & x5 <> x6 & x5 <> x7 & x6 <> x7; end; theorem [:{x1,x2},{y1,y2}:] = {[x1,y1],[x1,y2],[x2,y1],[x2,y2]}; theorem x <> y implies A \/ {x} \ {y} = A \ {y} \/ {x}; definition let X; attr X is trivial means x in X & y in X implies x = y; end; registration cluster empty -> trivial for set; end; registration cluster non trivial -> non empty for set; end; registration let x be set; cluster {x} -> trivial; end; registration cluster trivial non empty for set; end; theorem for A,B,C,p being set st A c= B & B /\ C = {p} & p in A holds A /\ C = {p}; theorem for A,B,C,p being set st A /\ B c= {p} & p in C & C misses B holds A \/ C misses B; theorem for A,B being set st for x,y being set st x in A & y in B holds x misses y holds union A misses union B; registration let X be set, Y be empty set; cluster [:X, Y:] -> empty; end; registration let X be empty set, Y be set; cluster [:X, Y:] -> empty; end; theorem not A in [:A,B:]; theorem [x,{x}] in [:{x},[x,{x}]:]; theorem B in [:A,B:] implies ex x st x in A & B = [x,{x}]; theorem B c= A & A is trivial implies B is trivial; registration cluster non trivial for set; end; theorem X is non empty trivial implies ex x st X = {x}; theorem for x being set, X being trivial set st x in X holds X = {x}; theorem for a,b,c,X being set st a in X & b in X & c in X holds {a,b,c} c= X; theorem [x,y] in X implies x in union union X & y in union union X; theorem X c= Y \/ {x} implies x in X or X c= Y; theorem x in X \/ {y} iff x in X or x = y; theorem X \/ {x} c= Y iff x in Y & X c= Y; theorem for A, B, a being set st A c= B & B c= A \/ {a} holds A \/ {a} = B or A = B; begin reserve E,X,x,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 for set; registration let X be set; cluster bool X -> non empty; end; registration let x1, x2, x3; cluster { x1, x2, x3 } -> non empty; let x4; cluster { x1, x2, x3, x4 } -> non empty; let x5; cluster { x1, x2, x3, x4, x5 } -> non empty; let x6; cluster { x1, x2, x3, x4, x5, x6 } -> non empty; let x7; cluster { x1, x2, x3, x4, x5, x6, x7 } -> non empty; let x8; cluster { x1, x2, x3, x4, x5, x6, x7, x8 } -> non empty; let x9; cluster { x1, x2, x3, x4, x5, x6, x7, x8, x9 } -> non empty; let x10; cluster { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 } -> non empty; end; definition let X; mode Element of X means it in X if X is non empty otherwise it is empty; sethood; end; definition let X; mode Subset of X is Element of bool X; end; registration let X be non empty set; cluster non empty for Subset of X; end; registration let X1,X2 be non empty set; cluster [: X1,X2 :] -> non empty; end; registration let X1,X2,X3 be non empty set; cluster [: X1,X2,X3 :] -> non empty; end; registration let X1,X2,X3,X4 be non empty set; cluster [: X1,X2,X3,X4 :] -> non empty; end; definition let D be non empty set, X be non empty Subset of D; redefine mode Element of X -> Element of D; end; registration let E; cluster empty for Subset of E; end; definition let E; func {}E -> Subset of E equals {}; func [#] E -> Subset of E equals E; end; registration let E; cluster {}E -> empty; end; theorem {} is Subset of X; reserve A,B,C for Subset of E; theorem (for x being Element of E holds x in A implies x in B) implies A c= B; theorem (for x being Element of E holds x in A iff x in B) implies A = B; theorem A <> {} implies ex x being Element of E st x in A; definition let E,A; func A` -> Subset of E equals E \ A; involutiveness; let B; redefine func A \/ B -> Subset of E; redefine func A \+\ B -> Subset of E; end; definition let X,Y be set; redefine func X \ Y -> Subset of X; end; definition let E,A,X; redefine func A \ X -> Subset of E; end; definition let E,A,X; redefine func A /\ X -> Subset of E; end; definition let E,X,A; redefine func X /\ A -> Subset of E; end; theorem (for x being Element of E holds x in A iff x in B or x in C) implies A = B \/ C; theorem (for x being Element of E holds x in A iff x in B & x in C) implies A = B /\ C; theorem (for x being Element of E holds x in A iff x in B & not x in C) implies A = B \ C; theorem (for x being Element of E holds x in A iff not(x in B iff x in C)) implies A = B \+\ C; theorem [#] E = ({} E)`; theorem A \/ A` = [#]E; theorem A \/ [#]E = [#]E; theorem A c= B iff B` c= A`; theorem A \ B = A /\ B`; theorem (A \ B)` = A` \/ B; theorem (A \+\ B)` = A /\ B \/ A` /\ B`; theorem A c= B` implies B c= A`; theorem A` c= B implies B` c= A; theorem A c= A` iff A = {}E; theorem A` c= A iff A = [#]E; theorem X c= A & X c= A` implies X = {}; theorem (A \/ B)` c= A`; theorem A` c= (A /\ B)`; theorem A misses B iff A c= B`; theorem A misses B` iff A c= B; theorem A misses B & A` misses B` implies A = B`; theorem A c= B & C misses B implies A c= C`; theorem (for a being Element of A holds a in B) implies A c= B; theorem (for x being Element of E holds x in A) implies E = A; theorem E <> {} implies for B for x being Element of E st not x in B holds x in B`; theorem for A,B st for x being Element of E holds x in A iff not x in B holds A = B`; theorem for A,B st for x being Element of E holds not x in A iff x in B holds A = B`; theorem for A,B st for x being Element of E holds not(x in A iff x in B) holds A = B` ; reserve x1,x2,x3,x4,x5,x6,x7,x8 for Element of X; theorem X <> {} implies {x1} is Subset of X; theorem X <> {} implies {x1,x2} is Subset of X; theorem X <> {} implies {x1,x2,x3} is Subset of X; theorem X <> {} implies {x1,x2,x3,x4} is Subset of X; theorem X <> {} implies {x1,x2,x3,x4,x5} is Subset of X; theorem X <> {} implies {x1,x2,x3,x4,x5,x6} is Subset of X; theorem X <> {} implies {x1,x2,x3,x4,x5,x6,x7} is Subset of X; theorem X <> {} implies {x1,x2,x3,x4,x5,x6,x7,x8} is Subset of X; theorem x in X implies {x} is Subset of X; scheme SubsetEx { A()-> set, P[set] } : ex X being Subset of A() st for x holds x in X iff x in A() & P[x]; scheme SubsetEq {X() -> set, X1,X2()-> Subset of X(), P[set]}: X1() = X2() provided for y being Element of X() holds y in X1() iff P[y] and for y being Element of X() holds y in X2() iff P[y]; definition let X, Y be non empty set; redefine pred X misses Y; irreflexivity; end; definition let X, Y be non empty set; redefine pred X meets Y; reflexivity; end; definition let S be set; func choose S -> Element of S equals the Element of S; end; begin reserve Y for set; scheme SubsetEx { A() -> non empty set, P[set] } : ex B being Subset of A() st for x being Element of A() holds x in B iff P[x]; scheme SubComp{A() -> set, F1,F2() -> Subset of A(), P[set]}: F1() = F2() provided for X being Element of A() holds X in F1() iff P[X] and for X being Element of A() holds X in F2() iff P[X]; theorem A` = B` implies A = B; registration let X be empty set; cluster -> empty for Subset of X; end; definition let E be set; let A be Subset of E; attr A is proper means A <> E; end; registration let E be set; cluster [#]E -> non proper; end; registration let E be set; cluster non proper for Subset of E; end; registration let E be non empty set; cluster non proper -> non empty for Subset of E; cluster empty -> proper for Subset of E; end; registration let E be non empty set; cluster proper for Subset of E; end; registration let E be empty set; cluster -> non proper for Subset of E; end; theorem for X,Y,A being set, z being set st z in A & A c= [:X,Y:] ex x being Element of X, y being Element of Y st z = [x,y]; theorem for X being non empty set, A, B being non empty Subset of X st A c< B ex p being Element of X st p in B & A c= B \ {p}; definition let X be non empty set; redefine attr X is trivial means for x,y being Element of X holds x = y; end; registration let X be non empty set; cluster non empty trivial for Subset of X; end; registration let X be trivial set; cluster -> trivial for Subset of X; end; registration let X be non trivial set; cluster non trivial for Subset of X; end; theorem for D being set, A being Subset of D st A is non trivial ex d1,d2 being Element of D st d1 in A & d2 in A & d1 <> d2; theorem for X being trivial non empty set ex x being Element of X st X = {x}; theorem for X being non empty set, A being non empty Subset of X holds A is trivial implies ex x being Element of X st A = {x}; theorem for X be non trivial set, x being Element of X ex y be set st y in X & x <> y; begin theorem for a, b being set st a in b holds a is Element of b; theorem for a, b being set st a is Element of b & b is non empty holds a in b; theorem for a, b being set holds a is Subset of b iff a c= b; theorem for a, b, c being set st a in b & b is Subset of c holds a is Element of c; theorem for a, b, c being set st a in b & b is Subset of c holds c is non empty; begin reserve X,Y,Z,Z1,Z2,D,x,y for set; definition let X; func meet X means for x holds x in it iff for Y holds Y in X implies x in Y if X <> {} otherwise it = {}; end; theorem meet {} = {}; theorem meet X c= union X; theorem Z in X implies meet X c= Z; theorem {} in X implies meet X = {}; theorem X <> {} & (for Z1 st Z1 in X holds Z c= Z1) implies Z c= meet X; theorem X <> {} & X c= Y implies meet Y c= meet X; theorem X in Y & X c= Z implies meet Y c= Z; theorem X in Y & X misses Z implies meet Y misses Z; theorem X <> {} & Y <> {} implies meet (X \/ Y) = meet X /\ meet Y; theorem meet {x} = x; theorem meet {X,Y} = X /\ Y; reserve SFX,SFY,SFZ for set; definition let SFX,SFY; pred SFX is_finer_than SFY means for X st X in SFX ex Y st Y in SFY & X c= Y; reflexivity; pred SFY is_coarser_than SFX means for Y st Y in SFY ex X st X in SFX & X c= Y; reflexivity; end; theorem SFX c= SFY implies SFX is_finer_than SFY; theorem SFX is_finer_than SFY implies union SFX c= union SFY; theorem SFY <> {} & SFY is_coarser_than SFX implies meet SFX c= meet SFY; theorem {} is_finer_than SFX; theorem SFX is_finer_than {} implies SFX = {}; theorem SFX is_finer_than SFY & SFY is_finer_than SFZ implies SFX is_finer_than SFZ; theorem SFX is_finer_than {Y} implies for X st X in SFX holds X c= Y; theorem SFX is_finer_than {X,Y} implies for Z st Z in SFX holds Z c= X or Z c= Y; definition let SFX,SFY; func UNION (SFX,SFY) means Z in it iff ex X,Y st X in SFX & Y in SFY & Z = X \/ Y; commutativity; func INTERSECTION (SFX,SFY) means Z in it iff ex X,Y st X in SFX & Y in SFY & Z = X /\ Y; commutativity; func DIFFERENCE (SFX,SFY) means Z in it iff ex X,Y st X in SFX & Y in SFY & Z = X \ Y; end; theorem SFX is_finer_than UNION(SFX,SFX); theorem INTERSECTION(SFX,SFX) is_finer_than SFX; theorem DIFFERENCE(SFX,SFX) is_finer_than SFX; theorem SFX meets SFY implies meet SFX /\ meet SFY = meet INTERSECTION(SFX,SFY ); theorem SFY <> {} implies X \/ meet SFY = meet UNION({X},SFY); theorem X /\ union SFY = union INTERSECTION({X},SFY); theorem SFY <> {} implies X \ union SFY = meet DIFFERENCE({X},SFY); theorem SFY <> {} implies X \ meet SFY = union DIFFERENCE ({X},SFY); theorem union INTERSECTION (SFX,SFY) = union SFX /\ union SFY; theorem SFX <> {} & SFY <> {} implies meet SFX \/ meet SFY c= meet UNION (SFX, SFY); theorem meet DIFFERENCE (SFX,SFY) c= meet SFX \ meet SFY; definition let D be set; mode Subset-Family of D is Subset of bool D; end; reserve F,G for Subset-Family of D; reserve P for Subset of D; definition let D,F; redefine func union F -> Subset of D; end; definition let D,F; redefine func meet F -> Subset of D; end; theorem (for P holds P in F iff P in G) implies F=G; definition let D,F; func COMPLEMENT(F) -> Subset-Family of D means for P being Subset of D holds P in it iff P` in F; involutiveness; end; theorem F <> {} implies COMPLEMENT(F) <> {}; theorem F <> {} implies [#] D \ union F = meet (COMPLEMENT(F)); theorem F <> {} implies union COMPLEMENT(F) = [#] D \ meet F; begin theorem for X being set, F being Subset-Family of X for P being Subset of X holds P` in COMPLEMENT F iff P in F; theorem for X being set, F,G being Subset-Family of X st COMPLEMENT F c= COMPLEMENT G holds F c= G; theorem for X being set, F,G being Subset-Family of X holds COMPLEMENT F c= G iff F c= COMPLEMENT G; theorem for X being set, F,G being Subset-Family of X st COMPLEMENT F = COMPLEMENT G holds F = G; theorem for X being set, F,G being Subset-Family of X holds COMPLEMENT(F \/ G) = COMPLEMENT F \/ COMPLEMENT G; theorem for X being set, F being Subset-Family of X st F = {X} holds COMPLEMENT F = {{}}; registration let X be set, F be empty Subset-Family of X; cluster COMPLEMENT F -> empty; end; definition let IT be set; attr IT is with_non-empty_elements means not {} in IT; end; registration cluster non empty with_non-empty_elements for set; end; registration let A be non empty set; cluster { A } -> with_non-empty_elements; let B be non empty set; cluster { A, B } -> with_non-empty_elements; let C be non empty set; cluster { A, B, C } -> with_non-empty_elements; let D be non empty set; cluster { A, B, C, D } -> with_non-empty_elements; let E be non empty set; cluster { A, B, C, D, E } -> with_non-empty_elements; let F be non empty set; cluster { A, B, C, D, E, F } -> with_non-empty_elements; let G be non empty set; cluster { A, B, C, D, E, F, G } -> with_non-empty_elements; let H be non empty set; cluster { A, B, C, D, E, F, G, H } -> with_non-empty_elements; let I be non empty set; cluster { A, B, C, D, E, F, G, H, I } -> with_non-empty_elements; let J be non empty set; cluster { A, B, C, D, E, F, G, H, I, J } -> with_non-empty_elements; end; registration let A,B be with_non-empty_elements set; cluster A \/ B -> with_non-empty_elements; end; theorem union Y c= Z & X in Y implies X c= Z; theorem for A,B,X being set holds ( X c= union (A \/ B) & for Y being set st Y in B holds Y misses X ) implies X c= union A; definition let M be set; let B be Subset-Family of M; func Intersect B -> Subset of M equals meet B if B <> {} otherwise M; end; theorem for X, x being set, R being Subset-Family of X st x in X holds x in Intersect R iff for Y being set st Y in R holds x in Y; theorem for X being set for H, J being Subset-Family of X st H c= J holds Intersect J c= Intersect H; registration let X be non empty with_non-empty_elements set; cluster -> non empty for Element of X; end; reserve E for set; definition let E; attr E is empty-membered means not ex x being non empty set st x in E; end; notation let E; antonym E is with_non-empty_element for E is empty-membered; end; registration cluster with_non-empty_element for set; end; registration cluster with_non-empty_element -> non empty for set; end; registration let X be with_non-empty_element set; cluster non empty for Element of X; end; registration let D be non empty with_non-empty_elements set; cluster union D -> non empty; end; registration cluster non empty with_non-empty_elements -> with_non-empty_element for set; end; definition let X be set; mode Cover of X means X c= union it; end; theorem for X being set, F being Subset-Family of X holds F is Cover of X iff union F = X; theorem {{}} is Subset-Family of X; definition let X be set; let F be Subset-Family of X; attr F is with_proper_subsets means not X in F; end; theorem for TS being set, F, G being Subset-Family of TS st F is with_proper_subsets & G c= F holds G is with_proper_subsets; registration let TS be non empty set; cluster with_proper_subsets for Subset-Family of TS; end; theorem for TS being non empty set, A, B being with_proper_subsets Subset-Family of TS holds A \/ B is with_proper_subsets; registration cluster non trivial -> with_non-empty_element for set; end; definition let X be set; redefine func bool X -> Subset-Family of X; end; theorem for A being non empty set, b being set st A <> {b} ex a being Element of A st a <> b; begin reserve A,X,X1,X2,Y,Y1,Y2,a,b,c,d,x,y,z for set; definition let IT be set; attr IT is Relation-like means x in IT implies ex y,z st x = [y,z]; end; registration cluster empty -> Relation-like for set; end; definition mode Relation is Relation-like set; end; reserve P,P1,P2,Q,R,S for Relation; registration let R be Relation; cluster -> Relation-like for Subset of R; end; scheme RelExistence{A,B() -> set, P[set,set]}: ex R being Relation st for x,y holds [x,y] in R iff x in A() & y in B() & P[x,y]; definition let P,R; redefine pred P = R means for a,b holds [a,b] in P iff [a,b] in R; end; registration let P,X; cluster P /\ X -> Relation-like; cluster P \ X -> Relation-like; end; registration let P,R; cluster P \/ R -> Relation-like; end; registration let R,S be Relation; cluster R \+\ S -> Relation-like; end; registration let a, b be set; cluster {[a,b]} -> Relation-like; cluster [:a,b:] -> Relation-like; end; registration let a, b, c, d be set; cluster {[a,b],[c,d]} -> Relation-like; end; definition let P,A; redefine pred P c= A means for a,b holds [a,b] in P implies [a,b] in A; end; notation let R be Relation; synonym dom R for proj1 R; end; theorem dom(P \/ R) = dom P \/ dom R; theorem dom(P /\ R) c= dom P /\ dom R; theorem dom P \ dom R c= dom(P \ R); notation let R be Relation; synonym rng R for proj2 R; end; canceled 3; theorem R c= [:dom R, rng R:]; theorem R /\ [:dom R, rng R:] = R; theorem R = {[x,y]} implies dom R = {x} & rng R = {y}; theorem R = {[a,b],[x,y]} implies dom R = {a,x} & rng R = {b,y}; theorem P c= R implies dom P c= dom R & rng P c= rng R; theorem rng(P \/ R) = rng P \/ rng R; theorem rng(P /\ R) c= rng P /\ rng R; theorem rng P \ rng R c= rng(P \ R); definition canceled 2; let R; func field R -> set equals dom R \/ rng R; end; theorem [a,b] in R implies a in field R & b in field R; theorem P c= R implies field P c= field R; theorem field {[x,y]} = {x,y}; theorem field(P \/ R) = field P \/ field R; theorem field(P /\ R) c= field P /\ field R; definition let R; func R~ -> Relation means [x,y] in it iff [y,x] in R; involutiveness; end; theorem rng R = dom(R~) & dom R = rng(R~); theorem field R = field(R~); theorem (P /\ R)~ = P~ /\ R~; theorem (P \/ R)~ = P~ \/ R~; theorem (P \ R)~ = P~ \ R~; definition let P,R be set; func P(#)R -> Relation means [x,y] in it iff ex z st [x,z] in P & [z,y] in R; end; notation let P,R; synonym P*R for P(#)R; end; theorem dom(P*R) c= dom P; theorem rng(P*R) c= rng R; theorem rng R c= dom P implies dom(R*P) = dom R; theorem dom P c= rng R implies rng(R*P) = rng P; theorem P c= R implies Q*P c= Q*R; theorem P c= Q implies P*R c= Q*R; theorem P c= R & Q c= S implies P*Q c= R*S; theorem P*(R \/ Q) = (P*R) \/ (P*Q); theorem P*(R /\ Q) c= (P*R) /\ (P*Q); theorem (P*R) \ (P*Q) c= P*(R \ Q); theorem (P*R)~ = R~*P~; theorem (P*R)*Q = P*(R*Q); registration cluster non empty for Relation; end; registration let f be non empty Relation; cluster dom f -> non empty; cluster rng f -> non empty; end; theorem (for x,y holds not [x,y] in R) implies R = {}; theorem dom {} = {} & rng {} = {}; theorem {}*R = {} & R*{} = {}; registration let X be empty set; cluster dom X -> empty; cluster rng X -> empty; let R; cluster X*R -> empty; cluster R*X -> empty; end; theorem field {} = {}; theorem dom R = {} or rng R = {} implies R = {}; theorem dom R = {} iff rng R = {}; registration let X be empty set; cluster X~ -> empty; end; theorem {}~ = {}; theorem rng R misses dom P implies R*P = {}; definition let R be Relation; attr R is non-empty means not {} in rng R; end; registration cluster non-empty for Relation; end; registration let R be Relation, S be non-empty Relation; cluster R*S -> non-empty; end; definition let X; func id X -> Relation means [x,y] in it iff x in X & x = y; end; registration let X; reduce dom id X to X; reduce rng id X to X; end; theorem dom id X = X & rng id X = X; registration let X; reduce (id X)~ to id X; end; theorem (id X)~ = id X; theorem (for x st x in X holds [x,x] in R) implies id X c= R; theorem [x,y] in (id X)*R iff x in X & [x,y] in R; theorem [x,y] in R*id Y iff y in Y & [x,y] in R; theorem R*(id X) c= R & (id X)*R c= R; theorem dom R c= X implies (id X)*R = R; theorem (id dom R)*R = R; theorem rng R c= Y implies R*(id Y) = R; theorem R*(id rng R) = R; theorem id {} = {}; theorem rng P2 c= X & P2*R = id dom P1 & R*P1 = id X implies P1 = P2; definition let R,X; func R|X -> Relation means [x,y] in it iff x in X & [x,y] in R; end; registration let R be Relation, X be empty set; cluster R|X -> empty; end; theorem x in dom(R|X) iff x in X & x in dom R; theorem dom(R|X) c= X; theorem R|X c= R; theorem dom(R|X) c= dom R; theorem dom(R|X) = dom R /\ X; theorem X c= dom R implies dom(R|X) = X; theorem (R|X)*P c= R*P; theorem P*(R|X) c= P*R; theorem R|X = (id X)*R; theorem R|X = {} iff dom R misses X; theorem R|X = R /\ [:X,rng R:]; theorem dom R c= X implies R|X = R; registration let R; reduce R|dom R to R; end; theorem R|dom R = R; theorem rng(R|X) c= rng R; theorem (R|X)|Y = R|(X /\ Y); registration let R,X; reduce R|X|X to R|X; end; theorem (R|X)|X = R|X; theorem X c= Y implies (R|X)|Y = R|X; theorem Y c= X implies (R|X)|Y = R|Y; theorem X c= Y implies R|X c= R|Y; theorem P c= R implies P|X c= R|X; theorem P c= R & X c= Y implies P|X c= R|Y; theorem R|(X \/ Y) = (R|X) \/ (R|Y); theorem R|(X /\ Y) = (R|X) /\ (R|Y); theorem R|(X \ Y) = R|X \ R|Y; registration let R be empty Relation, X be set; cluster R|X -> empty; end; theorem R|{} = {}; theorem {}|X = {}; theorem (P*R)|X = (P|X)*R; definition let Y,R; func Y|`R -> Relation means [x,y] in it iff y in Y & [x,y] in R; end; registration let R be Relation, X be empty set; cluster X|`R -> empty; end; theorem y in rng(Y|`R) iff y in Y & y in rng R; theorem rng(Y|`R) c= Y; theorem Y|`R c= R; theorem rng(Y|`R) c= rng R; theorem rng(Y|`R) = rng R /\ Y; theorem Y c= rng R implies rng(Y|`R) = Y; theorem (Y|`R)*P c= R*P; theorem P*(Y|`R) c= P*R; theorem Y|`R = R*(id Y); theorem Y|`R = R /\ [:dom R,Y:]; theorem rng R c= Y implies Y|`R = R; registration let R; reduce rng R|`R to R; end; theorem rng R|`R=R; theorem Y|`(X|`R) = (Y /\ X)|`R; registration let Y,R; reduce Y|`(Y|`R) to Y|`R; end; theorem Y|`(Y|`R) = Y|`R; theorem X c= Y implies Y|`(X|`R) = X|`R; theorem Y c= X implies Y|`(X|`R) = Y|`R; theorem X c= Y implies X|`R c= Y|`R; theorem P1 c= P2 implies Y|`P1 c= Y|`P2; theorem P1 c= P2 & Y1 c= Y2 implies Y1|`P1 c= Y2|`P2; theorem (X \/ Y)|`R = (X|`R) \/ (Y|`R); theorem (X /\ Y)|`R = X|`R /\ Y|`R; theorem (X \ Y)|`R = X|`R \ Y|`R; theorem {}|`R = {}; theorem Y|`{} = {}; theorem Y|`(P*R) = P*(Y|`R); theorem (Y|`R)|X = Y|`(R|X); definition let R,X; func R.:X -> set means y in it iff ex x st [x,y] in R & x in X; end; theorem y in R.:X iff ex x st x in dom R & [x,y] in R & x in X; theorem R.:X c= rng R; theorem R.:X = R.:(dom R /\ X); theorem R.:dom R = rng R; theorem R.:X c= R.:(dom R); theorem rng(R|X) = R.:X; registration let R; let X be empty set; cluster R.:X -> empty; end; registration let R be empty Relation; let X; cluster R.:X -> empty; end; canceled 2; theorem R.:X = {} iff dom R misses X; theorem X <> {} & X c= dom R implies R.:X <> {}; theorem R.:(X \/ Y) = R.:X \/ R.:Y; theorem R.:(X /\ Y) c= R.:X /\ R.:Y; theorem R.:X \ R.:Y c= R.:(X \ Y); theorem X c= Y implies R.:X c= R.:Y; theorem P c= R implies P.:X c= R.:X; theorem P c= R & X c= Y implies P.:X c= R.:Y; theorem (P*R).:X = R.:(P.:X); theorem rng(P*R) = R.:(rng P); theorem (R|X).:Y c= R.:Y; theorem for R be Relation, X, Y be set st X c= Y holds (R|Y).:X = R.:X; theorem (dom R) /\ X c= (R~).:(R.:X); definition let R,Y; func R"Y -> set means x in it iff ex y st [x,y] in R & y in Y; end; theorem x in R"Y iff ex y st y in rng R & [x,y] in R & y in Y; theorem R"Y c= dom R; theorem R"Y = R"(rng R /\ Y); theorem R"rng R = dom R; theorem R"Y c= R"rng R; registration let R; let Y be empty set; cluster R"Y -> empty; end; registration let R be empty Relation; let Y; cluster R"Y -> empty; end; canceled 2; theorem R"Y = {} iff rng R misses Y; theorem Y <> {} & Y c= rng R implies R"Y <> {}; theorem R"(X \/ Y) = R"X \/ R"Y; theorem R"(X /\ Y) c= R"X /\ R"Y; theorem R"X \ R"Y c= R"(X \ Y); theorem X c= Y implies R"X c= R"Y; theorem P c= R implies P"Y c= R"Y; theorem P c= R & X c= Y implies P"X c= R"Y; theorem (P*R)"Y = P"(R"Y); theorem dom(P*R) = P"(dom R); theorem (rng R) /\ Y c= (R~)"(R"Y); begin definition let R; attr R is empty-yielding means rng R c= {{}}; end; theorem R is empty-yielding iff for X st X in rng R holds X = {}; theorem for f,g being Relation, A,B being set st f|A = g|A & f|B = g|B holds f|(A \/ B) = g|(A \/ B); theorem for X being set, f,g being Relation st dom g c= X & g c= f holds g c= f|X; theorem for f being Relation, X being set st X misses dom f holds f|X = {}; theorem for f,g being Relation, A,B being set st A c= B & f|B = g|B holds f|A = g|A; theorem R|dom S = R|dom(S|dom R); registration cluster empty -> empty-yielding for Relation; end; registration let R be empty-yielding Relation; let X be set; cluster R|X -> empty-yielding; end; theorem R|X is non empty-yielding implies R is non empty-yielding; definition let R be Relation, x be set; func Im(R,x) equals R.:{x}; end; scheme ExtensionalityR { A, B() -> Relation, P[set,set] }: A() = B() provided for a, b being set holds [a,b] in A() iff P[a,b] and for a, b being set holds [a,b] in B() iff P[a,b]; theorem dom (R | (dom R \ X)) = dom R \ X; theorem R | X = R | (dom R /\ X); theorem dom [:X,Y:] c= X; theorem rng [:X,Y:] c= Y; theorem X <> {} & Y <> {} implies dom [:X,Y:] = X & rng [:X,Y:] = Y; theorem dom R = {} & dom Q = {} implies R = Q; theorem rng R = {} & rng Q = {} implies R = Q; theorem dom R = dom Q implies dom(S*R) = dom (S*Q); theorem rng R = rng Q implies rng(R*S) = rng (Q*S); definition let R be Relation, x be set; func Coim(R,x) equals R"{x}; end; registration let R be trivial Relation; cluster dom R -> trivial; end; registration let R be trivial Relation; cluster rng R -> trivial; end; theorem rng R c= dom (S|X) implies R*(S|X) = R*S; theorem Q|A = R|A implies Q.:A = R.:A; definition let X,R; attr R is X-defined means dom R c= X; attr R is X-valued means rng R c= X; end; registration let X,Y; cluster X-defined Y-valued for Relation; end; theorem for D being set, R being D-valued Relation for y being set st y in rng R holds y in D; registration let X,A; let R be A-valued Relation; cluster R|X -> A-valued; end; registration let X,A; let R be A-defined Relation; cluster R|X -> A-defined X-defined; end; registration let X; cluster id X -> X-defined X-valued; end; registration let A be set; let R be A-valued Relation, S be Relation; cluster S*R -> A-valued; end; registration let A be set; let R be A-defined Relation, S be Relation; cluster R*S -> A-defined; end; theorem x in X implies Im([:X,Y:],x) = Y; theorem [x,y] in R iff y in Im(R,x); theorem x in dom R iff Im(R,x) <> {}; theorem {} is X-defined Y-valued; registration cluster empty -> non-empty for Relation; end; registration let X be set, R be X-defined Relation; cluster -> X-defined for Subset of R; end; registration let X be set, R be X-valued Relation; cluster -> X-valued for Subset of R; end; theorem X misses Y implies R|X|Y = {}; theorem field {[x,x]} = {x}; registration let X; let R be X-defined Relation; reduce R|X to R; end; registration let Y; let R be Y-valued Relation; reduce Y|`R to R; end; theorem for R being X-defined Relation holds R = R|X; theorem for S being Relation, R being X-defined Relation st R c= S holds R c= S|X; theorem dom R c= X implies R \ (R|A) = R|(X\A); theorem dom(R \ (R|A)) = dom R \ A; theorem dom R \ dom(R|A) = dom(R \ (R|A)); theorem dom R misses dom S implies R misses S; theorem rng R misses rng S implies R misses S; theorem X c= Y implies (R \ R|Y)|X = {}; theorem X c= Y implies for R being X-defined Relation holds R is Y-defined; theorem X c= Y implies for R being X-valued Relation holds R is Y-valued; theorem R c= S iff R c= S|dom R; theorem for R being X-defined Y-valued Relation holds R c= [:X,Y:]; theorem dom(X|`R) c= dom R; registration let A,X; let R be A-defined Relation; cluster X|`R -> A-defined; end; registration let X,A; let R be A-valued Relation; cluster X|`R -> A-valued X-valued; end; registration let X be empty set; cluster -> empty for X-defined Relation; cluster -> empty for X-valued Relation; end; begin reserve X,X1,X2,Y,Y1,Y2,p,x,x1,x2,y,y1,y2,z,z1,z2 for set; definition let X be set; attr X is Function-like means for x,y1,y2 st [x,y1] in X & [x,y2] in X holds y1 = y2; end; registration cluster empty -> Function-like for set; end; registration cluster Function-like for Relation; end; definition mode Function is Function-like Relation; end; registration let a, b be set; cluster {[a,b]} -> Function-like; end; reserve f,g,g1,g2,h for Function, R,S for Relation; scheme GraphFunc { A()->set,P[set,set] } : ex f st for x,y holds [x,y] in f iff x in A() & P[x,y] provided for x,y1,y2 st P[x,y1] & P[x,y2] holds y1 = y2; definition let f,x; func f.x -> set means [x,it] in f if x in dom f otherwise it = {}; end; theorem [x,y] in f iff x in dom f & y = f.x; theorem dom f = dom g & (for x st x in dom f holds f.x = g.x) implies f = g; definition let f; redefine func rng f means for y holds y in it iff ex x st x in dom f & y = f.x; end; theorem x in dom f implies f.x in rng f; theorem dom f = {x} implies rng f = {f.x}; scheme FuncEx { A()->set,P[set,set] } : ex f st dom f = A() & for x st x in A() holds P[x,f.x] provided for x,y1,y2 st x in A() & P[x,y1] & P[x,y2] holds y1 = y2 and for x st x in A() ex y st P[x,y]; scheme Lambda { A() -> set,F(set) -> set } : ex f being Function st dom f = A() & for x st x in A() holds f.x = F(x); theorem X <> {} implies for y ex f st dom f = X & rng f = {y}; theorem (for f,g st dom f = X & dom g = X holds f = g) implies X = {}; theorem dom f = dom g & rng f = {y} & rng g = {y} implies f = g; theorem Y <> {} or X = {} implies ex f st X = dom f & rng f c= Y; theorem (for y st y in Y ex x st x in dom f & y = f.x) implies Y c= rng f; notation let f,g; synonym g*f for f*g; end; registration let f,g; cluster g*f -> Function-like; end; theorem for h st (for x holds x in dom h iff x in dom f & f.x in dom g) & (for x st x in dom h holds h.x = g.(f.x)) holds h = g*f; theorem x in dom(g*f) iff x in dom f & f.x in dom g; theorem x in dom(g*f) implies (g*f).x = g.(f.x); theorem x in dom f implies (g*f).x = g.(f.x); theorem z in rng(g*f) implies z in rng g; theorem dom(g*f) = dom f implies rng f c= dom g; theorem rng f c= Y & (for g,h st dom g = Y & dom h = Y & g*f = h*f holds g = h ) implies Y = rng f; registration let X; cluster id X -> Function-like; end; theorem f = id X iff dom f = X & for x st x in X holds f.x = x; theorem x in X implies (id X).x = x; theorem dom(f*(id X)) = dom f /\ X; theorem x in dom f /\ X implies f.x = (f*(id X)).x; theorem x in dom((id Y)*f) iff x in dom f & f.x in Y; theorem (id X)*(id Y) = id(X /\ Y); theorem rng f = dom g & g*f = f implies g = id dom g; definition let f; attr f is one-to-one means for x1,x2 st x1 in dom f & x2 in dom f & f.x1 = f.x2 holds x1 = x2; end; theorem f is one-to-one & g is one-to-one implies g*f is one-to-one; theorem g*f is one-to-one & rng f c= dom g implies f is one-to-one; theorem g*f is one-to-one & rng f = dom g implies f is one-to-one & g is one-to-one; theorem f is one-to-one iff for g,h st rng g c= dom f & rng h c= dom f & dom g = dom h & f*g = f*h holds g = h; theorem dom f = X & dom g = X & rng g c= X & f is one-to-one & f*g = f implies g = id X; theorem rng(g*f) = rng g & g is one-to-one implies dom g c= rng f; registration let X be set; cluster id X -> one-to-one; end; canceled; theorem (ex g st g*f = id dom f) implies f is one-to-one; registration cluster empty -> one-to-one for Function; end; registration cluster one-to-one for Function; end; registration let f be one-to-one Function; cluster f~ -> Function-like; end; definition let f; assume f is one-to-one; func f" -> Function equals f~; end; theorem f is one-to-one implies for g being Function holds g=f" iff dom g = rng f & for y,x holds y in rng f & x = g.y iff x in dom f & y = f.x; theorem f is one-to-one implies rng f = dom(f") & dom f = rng(f"); theorem f is one-to-one & x in dom f implies x = (f").(f.x) & x = (f"*f) .x; theorem f is one-to-one & y in rng f implies y = f.((f").y) & y = (f*f") .y; theorem f is one-to-one implies dom(f"*f) = dom f & rng(f"*f) = dom f; theorem f is one-to-one implies dom(f*f") = rng f & rng(f*f") = rng f; theorem f is one-to-one & dom f = rng g & rng f = dom g & (for x,y st x in dom f & y in dom g holds f.x = y iff g.y = x) implies g = f"; theorem f is one-to-one implies f"*f = id dom f & f*f" = id rng f; theorem f is one-to-one implies f" is one-to-one; registration let f be one-to-one Function; cluster f" -> one-to-one; let g be one-to-one Function; cluster g*f -> one-to-one; end; theorem f is one-to-one & rng f = dom g & g*f = id dom f implies g = f"; theorem f is one-to-one & rng g = dom f & f*g = id rng f implies g = f"; theorem f is one-to-one implies (f")" = f; theorem f is one-to-one & g is one-to-one implies (g*f)" = f"*g"; theorem (id X)" = id X; registration let f,X; cluster f|X -> Function-like; end; theorem dom g = dom f /\ X & (for x st x in dom g holds g.x = f.x) implies g = f|X; theorem x in dom(f|X) implies (f|X).x = f.x; theorem x in dom f /\ X implies (f|X).x = f.x; theorem x in X implies (f|X).x = f.x; theorem x in dom f & x in X implies f.x in rng(f|X); theorem X c= Y implies (f|X)|Y = f|X & (f|Y)|X = f|X; theorem f is one-to-one implies f|X is one-to-one; registration let Y,f; cluster Y|`f -> Function-like; end; theorem g = Y|`f iff (for x holds x in dom g iff x in dom f & f.x in Y) & for x st x in dom g holds g.x = f.x; theorem x in dom(Y|`f) iff x in dom f & f.x in Y; theorem x in dom(Y|`f) implies (Y|`f).x = f.x; theorem dom(Y|`f) c= dom f; theorem X c= Y implies Y|`(X|`f) = X|`f & X|`(Y|`f) = X|`f; theorem f is one-to-one implies Y|`f is one-to-one; definition let f,X; redefine func f.:X means for y holds y in it iff ex x st x in dom f & x in X & y = f.x; end; theorem x in dom f implies Im(f,x) = {f.x}; theorem x1 in dom f & x2 in dom f implies f.:{x1,x2} = {f.x1,f.x2}; theorem (Y|`f).:X c= f.:X; theorem f is one-to-one implies f.:(X1 /\ X2) = f.:X1 /\ f.:X2; theorem (for X1,X2 holds f.:(X1 /\ X2) = f.:X1 /\ f.:X2) implies f is one-to-one; theorem f is one-to-one implies f.:(X1 \ X2) = f.:X1 \ f.:X2; theorem (for X1,X2 holds f.:(X1 \ X2) = f.:X1 \ f.:X2) implies f is one-to-one; theorem X misses Y & f is one-to-one implies f.:X misses f.:Y; theorem (Y|`f).:X = Y /\ f.:X; definition let f,Y; redefine func f"Y means for x holds x in it iff x in dom f & f.x in Y; end; theorem f"(Y1 /\ Y2) = f"Y1 /\ f"Y2; theorem f"(Y1 \ Y2) = f"Y1 \ f"Y2; theorem (R|X)"Y = X /\ (R"Y); theorem for f being Function, A,B being set st A misses B holds f"A misses f"B; theorem y in rng R iff R"{y} <> {}; theorem (for y st y in Y holds R"{y} <> {}) implies Y c= rng R; theorem (for y st y in rng f ex x st f"{y} = {x}) iff f is one-to-one; theorem f.:(f"Y) c= Y; theorem X c= dom R implies X c= R"(R.:X); theorem Y c= rng f implies f.:(f"Y) = Y; theorem f.:(f"Y) = Y /\ f.:(dom f); theorem f.:(X /\ f"Y) c= (f.:X) /\ Y; theorem f.:(X /\ f"Y) = (f.:X) /\ Y; theorem X /\ R"Y c= R"(R.:X /\ Y); theorem f is one-to-one implies f"(f.:X) c= X; theorem (for X holds f"(f.:X) c= X) implies f is one-to-one; theorem f is one-to-one implies f.:X = (f")"X; theorem f is one-to-one implies f"Y = (f").:Y; theorem Y = rng f & dom g = Y & dom h = Y & g*f = h*f implies g = h; theorem f.:X1 c= f.:X2 & X1 c= dom f & f is one-to-one implies X1 c= X2; theorem f"Y1 c= f"Y2 & Y1 c= rng f implies Y1 c= Y2; theorem f is one-to-one iff for y ex x st f"{y} c= {x}; theorem rng R c= dom S implies R"X c= (R*S)"(S.:X); theorem for f being Function st f " X = f " Y & X c= rng f & Y c= rng f holds X = Y; begin reserve e,u for set, A for Subset of X; theorem (id X).:A = A; definition let f be Function; redefine attr f is empty-yielding means for x st x in dom f holds f.x is empty; end; definition let F be Function; redefine attr F is non-empty means for n being set st n in dom F holds F.n is non empty; end; registration cluster non-empty for Function; end; scheme LambdaB { D()->non empty set, F(set)->set } : ex f be Function st dom f = D() & for d be Element of D() holds f.d = F(d); registration let f be non-empty Function; cluster rng f -> with_non-empty_elements; end; definition let f be Function; attr f is constant means x in dom f & y in dom f implies f.x = f.y; end; theorem for A,B being set, f being Function st A c= dom f & f.:A c= B holds A c= f"B; theorem for f being Function st X c= dom f & f is one-to-one holds f"(f.:X) = X; definition let f,g; redefine pred f = g means dom f = dom g & for x st x in dom f holds f.x = g.x; end; registration cluster non-empty non empty for Function; end; registration let a be non-empty non empty Function; let i be Element of dom a; cluster a.i -> non empty; end; registration let f be Function; cluster -> Function-like for Subset of f; end; theorem for f,g being Function, D being set st D c= dom f & D c= dom g holds f | D = g | D iff for x being set st x in D holds f.x = g.x; theorem for f,g being Function, X being set st dom f = dom g & (for x being set st x in X holds f.x = g.x) holds f|X = g|X; theorem rng(f|{X}) c= {f.X}; theorem X in dom f implies rng(f|{X}) ={f.X}; registration cluster empty -> constant for Function; end; registration let f be constant Function; cluster rng f -> trivial; end; registration cluster non constant for Function; end; registration let f be non constant Function; cluster rng f -> non trivial; end; registration cluster non constant -> non trivial for Function; end; registration cluster trivial -> constant for Function; end; theorem for F,G be Function, X holds (G|(F.:X))*(F|X) = (G*F)|X; theorem for F,G be Function, X,X1 holds (G|X1)*(F|X) = (G*F)|(X /\ (F"X1)); theorem for F,G be Function,X holds X c= dom (G*F) iff X c= dom F & F.:X c= dom G; definition let f be Function; assume f is non empty constant; func the_value_of f means ex x being set st x in dom f & it = f.x; end; registration let X,Y; cluster X-defined Y-valued for Function; end; theorem for X being set, f being X-valued Function for x being set st x in dom f holds f.x in X; definition let IT be set; attr IT is functional means for x being set st x in IT holds x is Function; end; registration cluster empty -> functional for set; let f be Function; cluster { f } -> functional; let g be Function; cluster { f,g } -> functional; end; registration cluster non empty functional for set; end; registration let P be functional set; cluster -> Function-like Relation-like for Element of P; end; registration let A be functional set; cluster -> functional for Subset of A; end; definition let g,f be Function; attr f is g-compatible means x in dom f implies f.x in g.x; end; theorem f is g-compatible & dom f = dom g implies g is non-empty; theorem {} is f-compatible; registration let I be set, f be Function; cluster empty I-defined f-compatible for Function; end; registration let X be set; let f be Function, g be f-compatible Function; cluster g|X -> f-compatible; end; registration let I be set; cluster non-empty I-defined for Function; end; theorem for g being f-compatible Function holds dom g c= dom f; registration let X; let f be X-defined Function; cluster f-compatible -> X-defined for Function; end; theorem for f being X-valued Function st x in dom f holds f.x is Element of X; theorem for f being Function,A being set st f is one-to-one & A c= dom f holds f".:(f.:A)=A; registration let A be functional set, x be set; let F be A-valued Function; cluster F.x -> Function-like Relation-like; end; theorem x in X & x in dom f implies f.x in f.:X; theorem X <> {} & X c= dom f implies f.:X <> {}; registration let f be non trivial Function; cluster dom f -> non trivial; end; theorem for B being non empty functional set, f being Function st f = union B holds dom f = union { dom g where g is Element of B: not contradiction} & rng f = union { rng g where g is Element of B: not contradiction }; theorem for M being set st for X st X in M holds X <> {} ex f being Function st dom f = M & for X st X in M holds f.X in X; scheme NonUniqBoundFuncEx { X() -> set, Y() -> set, P[set,set] }: ex f being Function st dom f = X() & rng f c= Y() & for x st x in X() holds P[x,f.x] provided for x st x in X() ex y st y in Y() & P[x,y]; registration let f be empty-yielding Function; let x; cluster f.x -> empty; end; begin reserve X,Y,p,x,x1,x2,y,y1,y2,z,z1,z2 for set; reserve f,g,h for Function; theorem for G being set st G c= f holds G is Function; theorem f c= g iff dom f c= dom g & for x st x in dom f holds f.x = g.x; theorem dom f = dom g & f c= g implies f = g; theorem [x,z] in (g*f) implies [x,f.x] in f & [f.x,z] in g; theorem {[x,y]} is Function; theorem f = {[x,y]} implies f.x = y; theorem dom f = {x} implies f = {[x,f.x]}; theorem {[x1,y1],[x2,y2]} is Function iff (x1 = x2 implies y1 = y2); theorem f is one-to-one iff for x1,x2,y st [x1,y] in f & [x2,y] in f holds x1 = x2; theorem g c= f & f is one-to-one implies g is one-to-one; registration let f,X; cluster f /\ X -> Function-like; end; theorem x in dom(f /\ g) implies (f /\ g).x = f.x; theorem f is one-to-one implies f /\ g is one-to-one; theorem dom f misses dom g implies f \/ g is Function; theorem f c= h & g c= h implies f \/ g is Function; theorem x in dom g & h = f \/ g implies h.x = g.x; theorem x in dom h & h = f \/ g implies h.x = f.x or h.x = g.x; theorem f is one-to-one & g is one-to-one & h = f \/ g & rng f misses rng g implies h is one-to-one; canceled 2; theorem f is one-to-one implies for x,y holds [y,x] in f" iff [x,y] in f; theorem f = {} implies f" = {}; theorem x in dom f & x in X iff [x,f.x] in f|X; theorem g c= f implies f|dom g = g; theorem x in dom f & f.x in Y iff [x,f.x] in Y|`f; theorem g c= f & f is one-to-one implies rng g|`f = g; theorem x in f"Y iff [x,f.x] in f & f.x in Y; begin theorem for X being set, f,g being Function st X c= dom f & f c= g holds f|X = g|X; theorem for f being Function, x being set st x in dom f holds f|{x} = {[ x,f.x]}; theorem for f,g being Function, x being set st dom f = dom g & f.x = g.x holds f|{x} = g|{x}; theorem for f,g being Function, x,y being set st dom f = dom g & f.x = g .x & f.y = g.y holds f|{x,y} = g|{x,y}; theorem for f,g being Function, x,y,z being set st dom f = dom g & f.x = g.x & f.y = g.y & f.z = g.z holds f|{x,y,z} = g|{x,y,z}; registration let f be Function, A be set; cluster f \ A -> Function-like; end; theorem for f, g being Function st x in dom f \ dom g holds (f \ g).x = f.x; theorem f c= g & f c= h implies g|dom f = h|dom f; registration let f be Function, g be Subset of f; cluster g-compatible -> f-compatible for Function; end; theorem g c= f implies g = f|dom g; registration let f be Function, g be f-compatible Function; cluster -> f-compatible for Subset of g; end; theorem g c= f & x in X & X /\ dom f c= dom g implies f.x = g.x; begin reserve X,a,b,c,x,y,z for set; reserve P,R for Relation; definition let R,X; pred R is_reflexive_in X means x in X implies [x,x] in R; pred R is_irreflexive_in X means x in X implies not [x,x] in R; pred R is_symmetric_in X means x in X & y in X & [x,y] in R implies [ y,x] in R; pred R is_antisymmetric_in X means x in X & y in X & [x,y] in R & [y, x] in R implies x = y; pred R is_asymmetric_in X means x in X & y in X & [x,y] in R implies not [y,x] in R; pred R is_connected_in X means x in X & y in X & x <>y implies [x,y] in R or [y,x] in R; pred R is_strongly_connected_in X means x in X & y in X implies [x,y] in R or [y,x] in R; pred R is_transitive_in X means x in X & y in X & z in X & [x,y] in R & [y,z] in R implies [x,z] in R; end; definition let R; attr R is reflexive means R is_reflexive_in field R; attr R is irreflexive means R is_irreflexive_in field R; attr R is symmetric means R is_symmetric_in field R; attr R is antisymmetric means R is_antisymmetric_in field R; attr R is asymmetric means R is_asymmetric_in field R; attr R is connected means R is_connected_in field R; attr R is strongly_connected means R is_strongly_connected_in field R; attr R is transitive means R is_transitive_in field R; end; registration cluster empty -> reflexive irreflexive symmetric antisymmetric asymmetric connected strongly_connected transitive for Relation; end; theorem R is reflexive iff id field R c= R; theorem R is irreflexive iff id field R misses R; theorem R is_antisymmetric_in X iff R \ id X is_asymmetric_in X; theorem R is_asymmetric_in X implies R \/ id X is_antisymmetric_in X; canceled 7; registration cluster symmetric transitive -> reflexive for Relation; end; registration let X; cluster id X -> symmetric transitive antisymmetric; end; registration cluster irreflexive transitive -> asymmetric for Relation; cluster asymmetric -> irreflexive antisymmetric for Relation; end; registration let R be reflexive Relation; cluster R~ -> reflexive; end; registration let R be irreflexive Relation; cluster R~ -> irreflexive; end; theorem R is reflexive implies dom R = dom(R~) & rng R = rng(R~); theorem R is symmetric iff R = R~; registration let P,R be reflexive Relation; cluster P \/ R -> reflexive; cluster P /\ R -> reflexive; end; registration let P,R be irreflexive Relation; cluster P \/ R -> irreflexive; cluster P /\ R -> irreflexive; end; registration let P be irreflexive Relation; let R be Relation; cluster P \ R -> irreflexive; end; registration let R be symmetric Relation; cluster R~ -> symmetric; end; registration let P,R be symmetric Relation; cluster P \/ R -> symmetric; cluster P /\ R -> symmetric; cluster P \ R -> symmetric; end; registration let R be asymmetric Relation; cluster R~ -> asymmetric; end; registration let P be Relation; let R be asymmetric Relation; cluster P /\ R -> asymmetric; cluster R /\ P -> asymmetric; end; registration let P be asymmetric Relation; let R be Relation; cluster P \ R -> asymmetric; end; canceled 8; theorem R is antisymmetric iff R /\ (R~) c= id (dom R); registration let R be antisymmetric Relation; cluster R~ -> antisymmetric; end; registration let P be antisymmetric Relation; let R be Relation; cluster P /\ R -> antisymmetric; cluster R /\ P -> antisymmetric; cluster P \ R -> antisymmetric; end; registration let R be transitive Relation; cluster R~ -> transitive; end; registration let P,R be transitive Relation; cluster P /\ R -> transitive; end; canceled 4; theorem R is transitive iff R*R c= R; theorem R is connected iff [:field R,field R:] \ id (field R) c= R \/ R~; registration cluster strongly_connected -> connected reflexive for Relation; end; canceled; theorem R is strongly_connected iff [:field R, field R:] = R \/ R~; theorem R is transitive iff for x,y,z st [x,y] in R & [y,z] in R holds [x,z] in R; begin reserve X,Y,Z,X1,X2,X3,X4,X5,X6,x,y for set; canceled 4; theorem Y in X implies not X c= Y; definition let X; func succ X -> set equals X \/ { X }; end; registration let X; cluster succ X -> non empty; end; theorem X in succ X; theorem succ X = succ Y implies X = Y; theorem x in succ X iff x in X or x = X; theorem X <> succ X; reserve a,b,c,X,Y,Z,x,y,z for set; definition let X; attr X is epsilon-transitive means for x st x in X holds x c= X; attr X is epsilon-connected means for x,y st x in X & y in X holds x in y or x = y or y in x; end; definition let IT be set; attr IT is ordinal means IT is epsilon-transitive epsilon-connected; end; registration cluster ordinal -> epsilon-transitive epsilon-connected for set; cluster epsilon-transitive epsilon-connected -> ordinal for set; end; notation synonym number for set; end; registration cluster ordinal for number; end; definition mode Ordinal is ordinal number; end; reserve A,B,C,D for Ordinal; theorem for A,B being set, C being epsilon-transitive set st A in B & B in C holds A in C; theorem for x being epsilon-transitive set, A being Ordinal st x c< A holds x in A; theorem for A being epsilon-transitive set, B, C being Ordinal st A c= B & B in C holds A in C; theorem a in A implies a is Ordinal; theorem A in B or A = B or B in A; definition let A,B; redefine pred A c= B means for C st C in A holds C in B; connectedness; end; theorem A,B are_c=-comparable; theorem A c= B or B in A; registration cluster empty -> ordinal for number; end; theorem x is Ordinal implies succ x is Ordinal; theorem x is ordinal implies union x is ordinal; registration cluster non empty for Ordinal; end; registration let A; cluster succ A -> non empty ordinal; cluster union A -> ordinal; end; theorem (for x st x in X holds x is Ordinal & x c= X) implies X is ordinal; theorem X c= A & X <> {} implies ex C st C in X & for B st B in X holds C c= B; theorem A in B iff succ A c= B; theorem A in succ C iff A c= C; scheme OrdinalMin { P[Ordinal] } : ex A st P[A] & for B st P[B] holds A c= B provided ex A st P[A];:$N Transfinite induction scheme TransfiniteInd { P[Ordinal] } : for A holds P[A] provided for A st for C st C in A holds P[C] holds P[A]; theorem for X st for a st a in X holds a is Ordinal holds union X is ordinal; theorem for X st for a st a in X holds a is Ordinal ex A st X c= A; theorem not ex X st for x holds x in X iff x is Ordinal; theorem not ex X st for A holds A in X; theorem for X ex A st not A in X & for B st not B in X holds A c= B; definition let A be set; attr A is limit_ordinal means A = union A; end; theorem for A holds A is limit_ordinal iff for C st C in A holds succ C in A; theorem not A is limit_ordinal iff ex B st A = succ B; reserve F,G for Function; definition let IT be set; attr IT is T-Sequence-like means proj1 IT is ordinal; end; registration cluster empty -> T-Sequence-like for set; end; definition mode T-Sequence is T-Sequence-like Function; end; registration let Z; cluster Z-valued for T-Sequence; end; definition let Z; mode T-Sequence of Z is Z-valued T-Sequence; end; theorem {} is T-Sequence of Z; reserve L,L1 for T-Sequence; theorem dom F is Ordinal implies F is T-Sequence of rng F; registration let L; cluster dom L -> ordinal; end; theorem X c= Y implies for L being T-Sequence of X holds L is T-Sequence of Y; registration let L,A; cluster L|A -> rng L-valued T-Sequence-like; end; theorem for L being T-Sequence of X for A holds L|A is T-Sequence of X; definition let IT be set; attr IT is c=-linear means for x,y being set st x in IT & y in IT holds x,y are_c=-comparable; end; theorem (for a st a in X holds a is T-Sequence) & X is c=-linear implies union X is T-Sequence; scheme TSUniq { A()->Ordinal, H(T-Sequence)->set, L1, L2() -> T-Sequence } : L1() = L2() provided dom L1() = A() & for B,L st B in A() & L = L1()|B holds L1().B = H(L ) and dom L2() = A() & for B,L st B in A() & L = L2()|B holds L2().B = H(L ); scheme TSExist { A()->Ordinal,H(T-Sequence)->set } : ex L st dom L = A() & for B,L1 st B in A() & L1 = L|B holds L.B = H(L1); scheme FuncTS { L() -> T-Sequence, F(Ordinal)->set, H(T-Sequence)->set } : for B st B in dom L() holds L().B = H(L()|B) provided for A,a holds a = F(A) iff ex L st a = H(L) & dom L = A & for B st B in A holds L.B = H(L|B) and for A st A in dom L() holds L().A = F(A); theorem A c< B or A = B or B c< A; begin definition let X; func On X -> set means x in it iff x in X & x is Ordinal; func Lim X -> set means x in it iff x in X & ex A st x = A & A is limit_ordinal; end; theorem for D ex A st D in A & A is limit_ordinal; definition func omega -> set means {} in it & it is limit_ordinal & it is ordinal & for A st {} in A & A is limit_ordinal holds it c= A; end; registration cluster omega -> non empty ordinal; end; definition let A be set; attr A is natural means A in omega; end; registration cluster natural for number; end; definition mode Nat is natural number; end; registration sethood of natural number; end; registration let A be Ordinal; cluster -> ordinal for Element of A; end; registration cluster natural -> ordinal for number; end; scheme ALFA { D() -> non empty set, P[set,set] }: ex F st dom F = D() & for d being Element of D() ex A st A = F.d & P[d,A] & for B st P[d,B] holds A c= B provided for d being Element of D() ex A st P[d,A]; theorem succ X \ {X} = X; registration cluster empty -> natural for number; cluster -> natural for Element of omega; end; registration cluster non empty natural for number; end; registration let a be natural Ordinal; cluster succ a -> natural; end; registration cluster empty -> c=-linear for set; end; registration let X be c=-linear set; cluster -> c=-linear for Subset of X; end; begin reserve a,b,c,d,x,y,z,X,Y,Z for set; reserve R,S,T for Relation; definition let R,a; func R-Seg(a) equals Coim(R,a) \ {a}; end; theorem x in R-Seg a iff x <> a & [x,a] in R; theorem x in field R or R-Seg(x) = {}; definition let R; attr R is well_founded means for Y st Y c= field R & Y <> {} ex a st a in Y & R-Seg a misses Y; let X; pred R is_well_founded_in X means for Y st Y c= X & Y <> {} ex a st a in Y & R-Seg a misses Y; end; theorem R is well_founded iff R is_well_founded_in field R; definition let R; attr R is well-ordering means R is reflexive & R is transitive & R is antisymmetric & R is connected & R is well_founded; let X; pred R well_orders X means R is_reflexive_in X & R is_transitive_in X & R is_antisymmetric_in X & R is_connected_in X & R is_well_founded_in X; end; registration cluster well-ordering -> reflexive transitive antisymmetric connected well_founded for Relation; cluster reflexive transitive antisymmetric connected well_founded -> well-ordering for Relation; end; theorem R well_orders field R iff R is well-ordering; theorem R well_orders X implies for Y st Y c= X & Y <> {} ex a st a in Y & for b st b in Y holds [a,b] in R; theorem R is well-ordering implies for Y st Y c= field R & Y <> {} ex a st a in Y & for b st b in Y holds [a,b] in R; theorem for R st R is well-ordering & field R <> {} ex a st a in field R & for b st b in field R holds [a,b] in R; theorem for R st R is well-ordering for a st a in field R holds (for b st b in field R holds [b,a] in R) or ex b st b in field R & [a,b] in R & for c st c in field R & [a,c] in R holds c = a or [b,c] in R; reserve F,G for Function; theorem R-Seg(a) c= field R; definition let R,Y; func R |_2 Y -> Relation equals R /\ [:Y,Y:]; end; theorem R |_2 X = X|`R|X; theorem R |_2 X = X|`(R|X); theorem x in field(R |_2 X) implies x in field R & x in X; theorem field(R |_2 X) c= field R & field(R |_2 X) c= X; theorem (R |_2 X)-Seg(a) c= R-Seg(a); theorem R is reflexive implies R |_2 X is reflexive; theorem R is connected implies R |_2 Y is connected; theorem R is transitive implies R |_2 Y is transitive; theorem R is antisymmetric implies R |_2 Y is antisymmetric; theorem (R |_2 X) |_2 Y = R |_2 (X /\ Y); theorem (R |_2 X) |_2 Y = (R |_2 Y) |_2 X; theorem (R |_2 Y) |_2 Y = R |_2 Y; theorem Z c= Y implies (R |_2 Y) |_2 Z = R |_2 Z; theorem R |_2 field R = R; theorem R is well_founded implies R |_2 X is well_founded; theorem R is well-ordering implies R |_2 Y is well-ordering; theorem R is well-ordering implies R-Seg(a),R-Seg(b) are_c=-comparable; theorem R is well-ordering & b in R-Seg(a) implies (R |_2 (R-Seg(a))) -Seg(b) = R-Seg(b); theorem R is well-ordering & Y c= field R implies (Y = field R or (ex a st a in field R & Y = R-Seg(a) ) iff for a st a in Y for b st [b,a] in R holds b in Y ); theorem R is well-ordering & a in field R & b in field R implies ( [a,b] in R iff R-Seg(a) c= R-Seg(b) ); theorem R is well-ordering & a in field R & b in field R implies ( R-Seg (a) c= R-Seg(b) iff a = b or a in R-Seg(b) ); theorem R is well-ordering & X c= field R implies field(R |_2 X) = X; theorem R is well-ordering implies field(R |_2 R-Seg(a)) = R-Seg(a); theorem R is well-ordering implies for Z st for a st a in field R & R -Seg(a) c= Z holds a in Z holds field R c= Z; theorem R is well-ordering & a in field R & b in field R & (for c st c in R-Seg(a) holds [c,b] in R & c <> b) implies [a,b] in R; theorem R is well-ordering & dom F = field R & rng F c= field R & (for a ,b st [a,b] in R & a <> b holds [F.a,F.b] in R & F.a <> F.b) implies for a st a in field R holds [a,F.a] in R; definition let R,S,F; pred F is_isomorphism_of R,S means dom F = field R & rng F = field S & F is one-to-one & for a,b holds [a,b] in R iff a in field R & b in field R & [F.a,F.b] in S; end; theorem F is_isomorphism_of R,S implies for a,b st [a,b] in R & a <> b holds [F.a,F.b] in S & F.a <> F.b; definition let R,S; pred R,S are_isomorphic means ex F st F is_isomorphism_of R,S; end; theorem id(field R) is_isomorphism_of R,R; theorem R,R are_isomorphic; theorem F is_isomorphism_of R,S implies F" is_isomorphism_of S,R; theorem R,S are_isomorphic implies S,R are_isomorphic; theorem F is_isomorphism_of R,S & G is_isomorphism_of S,T implies G*F is_isomorphism_of R,T; theorem R,S are_isomorphic & S,T are_isomorphic implies R,T are_isomorphic; theorem F is_isomorphism_of R,S implies ( R is reflexive implies S is reflexive ) & ( R is transitive implies S is transitive ) & ( R is connected implies S is connected ) & ( R is antisymmetric implies S is antisymmetric ) & ( R is well_founded implies S is well_founded ); theorem R is well-ordering & F is_isomorphism_of R,S implies S is well-ordering; theorem R is well-ordering implies for F,G st F is_isomorphism_of R,S & G is_isomorphism_of R,S holds F = G; definition let R,S; assume that R is well-ordering and R,S are_isomorphic; func canonical_isomorphism_of(R,S) -> Function means it is_isomorphism_of R,S; end; theorem R is well-ordering implies for a st a in field R holds not R,R |_2 (R-Seg(a)) are_isomorphic; theorem R is well-ordering & a in field R & b in field R & a <> b implies not R |_2 (R-Seg(a)),R |_2 (R-Seg(b)) are_isomorphic; theorem R is well-ordering & Z c= field R & F is_isomorphism_of R,S implies F|Z is_isomorphism_of R |_2 Z,S |_2 (F.:Z) & R |_2 Z,S |_2 (F.:Z) are_isomorphic; theorem F is_isomorphism_of R,S implies for a st a in field R ex b st b in field S & F.:(R-Seg(a)) = S-Seg(b); theorem R is well-ordering & F is_isomorphism_of R,S implies for a st a in field R ex b st b in field S & R |_2 (R-Seg(a)),S |_2 (S-Seg(b)) are_isomorphic; theorem R is well-ordering & S is well-ordering & a in field R & b in field S & c in field S & R,S |_2 (S-Seg(b)) are_isomorphic & R |_2 (R-Seg(a)),S |_2 (S-Seg(c)) are_isomorphic implies S-Seg(c) c= S-Seg(b) & [c,b] in S; theorem R is well-ordering & S is well-ordering implies R,S are_isomorphic or (ex a st a in field R & R |_2 (R-Seg(a)),S are_isomorphic ) or ex a st a in field S & R,S |_2 (S-Seg(a)) are_isomorphic; theorem Y c= field R & R is well-ordering implies R,R |_2 Y are_isomorphic or ex a st a in field R & R |_2 (R-Seg(a)),R |_2 Y are_isomorphic; theorem R,S are_isomorphic & R is well-ordering implies S is well-ordering; begin reserve A,B,X,X1,Y,Y1,Y2,Z,a,x,y,z for set; definition let X,Y; mode Relation of X,Y is Subset of [:X,Y:]; end; registration let X,Y; cluster -> Relation-like for Subset of [:X,Y:]; end; registration let X,Y; cluster -> X-defined Y-valued for Relation of X,Y; end; reserve P,R for Relation of X,Y; definition let X,Y,R,Z; redefine pred R c= Z means for x being Element of X, y being Element of Y holds [x,y] in R implies [x,y] in Z; end; definition let X,Y,P,R; redefine pred P = R means for x being Element of X, y being Element of Y holds [x,y] in P iff [x,y] in R; end; theorem A c= R implies A is Relation of X,Y; theorem a in R implies ex x,y st a = [x,y] & x in X & y in Y; theorem x in X & y in Y implies {[x,y]} is Relation of X,Y; theorem for R being Relation st dom R c= X & rng R c= Y holds R is Relation of X,Y; theorem dom R c= X1 implies R is Relation of X1,Y; theorem rng R c= Y1 implies R is Relation of X,Y1; theorem X c= X1 & Y c= Y1 implies R is Relation of X1,Y1; registration let X; let R,S be X-defined Relation; cluster R \/ S -> X-defined; end; registration let X; let R be X-defined Relation, S be Relation; cluster R /\ S -> X-defined; cluster R \ S -> X-defined; end; registration let X; let R,S be X-valued Relation; cluster R \/ S -> X-valued; end; registration let X; let R be X-valued Relation, S be Relation; cluster R /\ S -> X-valued; cluster R \ S -> X-valued; end; definition let X; let R be X-defined Relation; redefine func dom R -> Subset of X; end; definition let X; let R be X-valued Relation; redefine func rng R -> Subset of X; end; theorem field R c= X \/ Y; theorem (for x st x in X ex y st [x,y] in R) iff dom R = X; theorem (for y st y in Y ex x st [x,y] in R) iff rng R = Y; definition let X,Y,R; redefine func R~ -> Relation of Y,X; end; definition let X,Y1,Y2,Z; let P be Relation of X,Y1; let R be Relation of Y2,Z; redefine func P*R -> Relation of X,Z; end; theorem dom (R~) = rng R & rng (R~) = dom R; theorem {} is Relation of X,Y; registration let A be empty set, B be set; cluster -> empty for Relation of A,B; cluster -> empty for Relation of B,A; end; theorem id X c= [:X,X:]; theorem id X is Relation of X,X; theorem id A c= R implies A c= dom R & A c= rng R; theorem id X c= R implies X = dom R & X c= rng R; theorem id Y c= R implies Y c= dom R & Y = rng R; definition let X,Y,R,A; redefine func R|A -> Relation of X,Y; end; definition let X,Y,B,R; redefine func B|`R -> Relation of X,Y; end; theorem R|X1 is Relation of X1,Y; theorem X c= X1 implies R|X1 = R; theorem Y1|`R is Relation of X,Y1; theorem Y c= Y1 implies Y1|`R = R; definition let X,Y,R,A; redefine func R.:A -> Subset of Y; redefine func R"A -> Subset of X; end; theorem R.:X = rng R & R"Y = dom R; theorem R.:(R"Y) = rng R & R"(R.:X) = dom R; scheme RelOnSetEx{A() -> set,B() -> set,P[set,set]}: ex R being Relation of A(),B() st for x,y holds [x,y] in R iff x in A() & y in B() & P[x,y]; definition let X; mode Relation of X is Relation of X,X; end; reserve D,D1,D2,E,F for non empty set; reserve R for Relation of D,E; reserve x for Element of D; reserve y for Element of E; registration let D be non empty set; cluster id D -> non empty; end; theorem for x being Element of D holds x in dom R iff ex y being Element of E st [x,y] in R; theorem for y being set holds y in rng R iff ex x being Element of D st [x,y] in R; theorem dom R <> {} implies ex y being Element of E st y in rng R; theorem rng R <> {} implies ex x being Element of D st x in dom R; theorem for P being (Relation of D,E), R being Relation of E,F for x, z being set holds [x,z] in P*R iff ex y being Element of E st [x,y] in P & [y,z] in R ; theorem y in R.:D1 iff ex x being Element of D st [x,y] in R & x in D1; theorem x in R"D2 iff ex y being Element of E st [x,y] in R & y in D2; scheme RelOnDomEx{A,B() -> non empty set, P[set,set]}: ex R being Relation of A(),B () st for x being Element of A(), y being Element of B() holds [x,y] in R iff P [x,y]; begin scheme { N()-> set, M() -> Subset of N(), F(set)->set }: ex R being Relation of M() st for i being Element of N() st i in M() holds Im(R,i) = F(i) provided for i being Element of N() st i in M() holds F(i) c= M(); theorem for N being set, R,S being Relation of N st for i being set st i in N holds Im(R,i) = Im(S,i) holds R = S; scheme {A,B() -> set, P[set,set], P,R()->Relation of A(), B()}: P() = R() provided for p being Element of A(), q being Element of B() holds [p,q] in P( ) iff P[p,q] and for p being Element of A(), q being Element of B() holds [p,q] in R( ) iff P[p,q]; registration let X,Y,Z; let f be Relation of [:X,Y:], Z; cluster dom f -> Relation-like; end; registration let X,Y,Z; let f be Relation of X, [:Y, Z:]; cluster rng f -> Relation-like; end; theorem A misses X implies P|A = {}; registration let R be non empty Relation, Y be non empty Subset of dom R; cluster R|Y -> non empty; end; registration let R be non empty Relation; let Y be non empty Subset of dom R; cluster R.:Y -> non empty; end; registration let X,Y be set; cluster empty for Relation of X,Y; end; begin reserve x,x1,x2,y,y9,y1,y2,z,z1,z2,P,X,X1,X2,Y,Y1,Y2,V,Z for set; theorem for f,g being Function st for x st x in dom f /\ dom g holds f.x = g.x ex h being Function st f \/ g = h; theorem for f,g,h being Function st f \/ g = h for x st x in dom f /\ dom g holds f.x = g.x; scheme LambdaC{A()->set,C[set],F(set)->set,G(set)->set}: ex f being Function st dom f = A() & for x st x in A() holds (C[x] implies f.x = F(x)) & (not C[x] implies f.x = G(x)); registration let X,Y; cluster Function-like for Relation of X,Y; end; definition let X,Y; mode PartFunc of X,Y is Function-like Relation of X,Y; end; theorem for f being PartFunc of X,Y st y in rng f ex x being Element of X st x in dom f & y = f.x; theorem for f being Y-valued Function st x in dom f holds f.x in Y; theorem 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; scheme PartFuncEx{X,Y()->set,P[set,set]}: ex f being PartFunc of X(),Y() st (for x holds x in dom f iff x in X() & ex y st P[x,y]) & for x st x in dom f holds P[x ,f.x] provided for x,y st x in X() & P[x,y] holds y in Y() and for x,y1,y2 st x in X() & P[x,y1] & P[x,y2] holds y1 = y2; scheme LambdaR{X,Y()->set,F(set)->set,P[set]}: ex f being PartFunc of X(),Y() st ( for x holds x in dom f iff x in X() & P[x]) & for x st x in dom f holds f.x = F (x) provided for x st P[x] holds F(x) in Y(); definition let X,Y,V,Z; let f be PartFunc of X,Y; let g be PartFunc of V,Z; redefine func g*f -> PartFunc of X,Z; end; theorem for f being Relation of X,Y holds (id X)*f = f; theorem for f being Relation of X,Y holds f*(id Y) = f; theorem 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; theorem for f being PartFunc of X,Y st f is one-to-one holds f" is PartFunc of Y,X; theorem for f being PartFunc of X,Y holds f|Z is PartFunc of Z,Y; theorem for f being PartFunc of X,Y holds f|Z is PartFunc of X,Y; definition let X,Y; let f be PartFunc of X,Y; let Z be set; redefine func f|Z -> PartFunc of X,Y; end; theorem for f being PartFunc of X,Y holds Z|`f is PartFunc of X,Z; theorem for f being PartFunc of X,Y holds Z|`f is PartFunc of X,Y; theorem for f being Function holds Y|`f|X is PartFunc of X,Y; theorem for f being PartFunc of X,Y st y in f.:X ex x being Element of X st x in dom f & y = f.x; theorem for f being PartFunc of {x},Y holds rng f c= {f.x}; theorem for f being PartFunc of {x},Y holds f is one-to-one; theorem for f being PartFunc of {x},Y holds f.:P c= {f.x}; theorem for f being Function st dom f = {x} & x in X & f.x in Y holds f is PartFunc of X,Y; theorem for f being PartFunc of X,{y} st x in dom f holds f.x = y; theorem for f1,f2 being PartFunc of X,{y} st dom f1 = dom f2 holds f1 = f2; definition let f be Function; let X,Y be set; func <:f,X,Y:> -> PartFunc of X,Y equals Y|`f|X; end; theorem for f being Function holds <:f,X,Y:> c= f; theorem for f being Function holds dom <:f,X,Y:> c= dom f & rng <:f,X,Y :> c= rng f; theorem for f being Function holds x in dom <:f,X,Y:> iff x in dom f & x in X & f.x in Y; theorem for f being Function st x in dom f & x in X & f.x in Y holds <:f ,X,Y:>.x = f.x; theorem for f being Function st x in dom <:f,X,Y:> holds <:f,X,Y:>.x = f .x; theorem for f,g being Function st f c= g holds <:f,X,Y:> c= <:g,X,Y:>; theorem for f being Function st Z c= X holds <:f,Z,Y:> c= <:f,X,Y:>; theorem for f being Function st Z c= Y holds <:f,X,Z:> c= <:f,X,Y:>; theorem for f being Function st X1 c= X2 & Y1 c= Y2 holds <:f,X1,Y1:> c= <:f, X2,Y2:> ; theorem for f being Function st dom f c= X & rng f c= Y holds f = <:f,X, Y:>; theorem for f being Function holds f = <:f,dom f,rng f:>; theorem for f being PartFunc of X,Y holds <:f,X,Y:> = f; theorem <:{},X,Y:> = {}; theorem for f,g being Function holds (<:g,Y,Z:>*<:f,X,Y:>) c= <:g*f,X,Z :>; theorem for f,g being Function st rng f /\ dom g c= Y holds <:g,Y,Z:>*<:f,X,Y :> = <:g*f,X,Z:>; theorem for f being Function st f is one-to-one holds <:f,X,Y:> is one-to-one; theorem for f being Function st f is one-to-one holds <:f,X,Y:>" = <:f",Y,X:>; theorem for f being Function holds Z|`<:f,X,Y:> = <:f,X,Z /\ Y:>; definition let X; let f be X-defined Relation; attr f is total means dom f = X; end; registration let X be empty set, Y be set; cluster -> total for Relation of X,Y; end; registration let X be non empty set, Y be empty set; cluster -> non total for Relation of X,Y; end; theorem for f being Function st <:f,X,Y:> is total holds X c= dom f; theorem <:{},X,Y:> is total implies X = {}; theorem for f being Function st X c= dom f & rng f c= Y holds <:f,X,Y:> is total; theorem for f being Function st <:f,X,Y:> is total holds f.:X c= Y; theorem for f being Function st X c= dom f & f.:X c= Y holds <:f,X,Y:> is total; definition let X,Y; func PFuncs(X,Y) -> set means x in it iff ex f being Function st x = f & dom f c= X & rng f c= Y; end; registration let X,Y; cluster PFuncs(X,Y) -> non empty; end; theorem for f being PartFunc of X,Y holds f in PFuncs(X,Y); theorem for f being set st f in PFuncs(X,Y) holds f is PartFunc of X,Y; theorem for f being Element of PFuncs(X,Y) holds f is PartFunc of X,Y; theorem PFuncs({},Y) = { {} }; theorem PFuncs(X,{}) = { {} }; theorem X1 c= X2 & Y1 c= Y2 implies PFuncs(X1,Y1) c= PFuncs(X2,Y2); definition let f,g be Function; pred f tolerates g means for x st x in dom f /\ dom g holds f.x = g.x; reflexivity; symmetry; end; theorem for f,g being Function holds f tolerates g iff ex h being Function st f \/ g = h; theorem for f,g being Function holds f tolerates g iff ex h being Function st f c= h & g c= h; theorem for f,g being Function st dom f c= dom g holds f tolerates g iff for x st x in dom f holds f.x = g.x; theorem for f,g being Function st f c= g holds f tolerates g; theorem for f,g being Function st dom f = dom g & f tolerates g holds f = g; theorem for f,g being Function st dom f misses dom g holds f tolerates g; theorem for f,g,h being Function st f c= h & g c= h holds f tolerates g; theorem for f,g being PartFunc of X,Y for h being Function st f tolerates h & g c= f holds g tolerates h; theorem for f being Function holds {} tolerates f; theorem for f being Function holds <:{},X,Y:> tolerates f; theorem for f,g being PartFunc of X,{y} holds f tolerates g; theorem for f being Function holds f|X tolerates f; theorem for f being Function holds Y|`f tolerates f; theorem for f being Function holds Y|`f|X tolerates f; theorem for f being Function holds <:f,X,Y:> tolerates f; theorem for f,g being PartFunc of X,Y st f is total & g is total & f tolerates g holds f = g; theorem for f,g,h being PartFunc of X,Y st f tolerates h & g tolerates h & h is total holds f tolerates g; theorem for f,g being PartFunc of X,Y st (Y = {} implies X = {}) & f tolerates g ex h being PartFunc of X,Y st h is total & f tolerates h & g tolerates h; definition let X,Y; let f be PartFunc of X,Y; func TotFuncs f -> set means x in it iff ex g being PartFunc of X,Y st g = x & g is total & f tolerates g; end; theorem for f being PartFunc of X,Y for g being set st g in TotFuncs(f) holds g is PartFunc of X,Y; theorem for f,g being PartFunc of X,Y st g in TotFuncs(f) holds g is total; theorem for f being PartFunc of X,Y for g being Function st g in TotFuncs(f) holds f tolerates g; registration let X be non empty set, Y be empty set; let f be PartFunc of X,Y; cluster TotFuncs f -> empty; end; theorem for f being PartFunc of X,Y holds f is total iff TotFuncs f = { f}; theorem for f being PartFunc of {},Y holds TotFuncs f = {f}; theorem for f being PartFunc of {},Y holds TotFuncs f = {{}}; theorem for f,g being PartFunc of X,Y st TotFuncs f meets TotFuncs g holds f tolerates g; theorem for f,g being PartFunc of X,Y st (Y = {} implies X = {}) & f tolerates g holds TotFuncs f meets TotFuncs g; begin registration let X; cluster total reflexive symmetric antisymmetric transitive for Relation of X; end; registration cluster symmetric transitive -> reflexive for Relation; end; registration let X; cluster id X -> symmetric antisymmetric transitive; end; definition let X; redefine func id X -> total Relation of X; end; scheme LambdaC9{ A() -> non empty set, C[set], F,G(set) -> set } : ex f being Function st dom f = A() & for x be Element of A() holds (C[x] implies f.x = F(x)) & (not C[x] implies f.x = G(x)); begin reserve A for set, f,g,h for Function; theorem f tolerates g & [x,y] in f & [x,z] in g implies y = z; theorem A is functional & (for f,g being Function st f in A & g in A holds f tolerates g) implies union A is Function; definition let D be set, p be D-valued Function, i be set; assume i in dom p; func p/.i -> Element of D equals p.i; end; registration let X,Y be non empty set; cluster non empty for PartFunc of X,Y; end; registration let A, B be set; cluster PFuncs(A,B) -> functional; end; theorem for f1,f2, g being Function st rng g c= dom f1 & rng g c= dom f2 & f1 tolerates f2 holds f1*g = f2*g; theorem for f being Y-valued Function st x in dom(f|X) holds (f|X)/.x = f/.x; begin reserve v,x,x1,x2,x3,x4,y,y1,y2,y3,y4,z,z1,z2, X,X1,X2,X3,X4,Y,Y1,Y2,Y3,Y4,Y5, Z,Z1,Z2,Z3,Z4,Z5 for set; reserve p for pair set; canceled 6; theorem [x,y]`1=x & [x,y]`2=y; theorem [p`1,p`2] = p; theorem X <> {} implies ex v st v in X & not ex x,y st (x in X or y in X) & v = [x,y]; theorem z in [:X,Y:] implies z`1 in X & z`2 in Y; theorem (ex x,y st z=[x,y]) & z`1 in X & z`2 in Y implies z in [:X,Y:]; theorem z in [:{x},Y:] implies z`1=x & z`2 in Y; theorem z in [:X,{y}:] implies z`1 in X & z`2 = y; theorem z in [:{x},{y}:] implies z`1 = x & z`2 = y; theorem z in [:{x1,x2},Y:] implies (z`1=x1 or z`1=x2) & z`2 in Y; theorem z in [:X,{y1,y2}:] implies z`1 in X & (z`2 = y1 or z`2 = y2); theorem z in [:{x1,x2},{y}:] implies (z`1=x1 or z`1=x2) & z`2 = y; theorem z in [:{x},{y1,y2}:] implies z`1 = x & (z`2 = y1 or z`2 = y2); theorem z in [:{x1,x2},{y1,y2}:] implies (z`1 = x1 or z`1 = x2) & (z`2 = y1 or z`2 = y2); theorem (ex y,z st x = [y,z]) implies x <> x`1 & x <> x`2; reserve R for Relation; theorem x in R implies x = [x`1,x`2]; theorem X <> {} & Y <> {} implies for x being Element of [:X,Y:] holds x = [x`1,x`2]; theorem [:{x1,x2},{y1,y2}:] = {[x1,y1],[x1,y2],[x2,y1],[x2,y2]}; theorem X <> {} & Y <> {} implies for x being Element of [:X,Y:] holds x <> x`1 & x <> x`2; canceled; theorem X <> {} implies ex v st v in X & not ex x,y,z st (x in X or y in X) & v = [x,y,z]; canceled 3; theorem X <> {} implies ex v st v in X & not ex x1,x2,x3,x4 st (x1 in X or x2 in X) & v = [x1,x2,x3,x4]; theorem X1 <> {} & X2 <> {} & X3 <> {} iff [:X1,X2,X3:] <> {}; reserve xx1 for Element of X1, xx2 for Element of X2, xx3 for Element of X3; theorem X1<>{} & X2<>{} & X3<>{} implies ( [:X1,X2,X3:] = [:Y1,Y2,Y3:] implies X1=Y1 & X2=Y2 & X3=Y3); theorem [:X1,X2,X3:]<>{} & [:X1,X2,X3:] = [:Y1,Y2,Y3:] implies X1=Y1 & X2=Y2 & X3=Y3; theorem [:X,X,X:] = [:Y,Y,Y:] implies X = Y; theorem [:{x1},{x2},{x3}:] = { [x1,x2,x3] }; theorem [:{x1,y1},{x2},{x3}:] = { [x1,x2,x3],[y1,x2,x3] }; theorem [:{x1},{x2,y2},{x3}:] = { [x1,x2,x3],[x1,y2,x3] }; theorem [:{x1},{x2},{x3,y3}:] = { [x1,x2,x3],[x1,x2,y3] }; theorem [:{x1,y1},{x2,y2},{x3}:] = { [x1,x2,x3],[y1,x2,x3],[x1,y2,x3],[y1,y2, x3] }; theorem [:{x1,y1},{x2},{x3,y3}:] = { [x1,x2,x3],[y1,x2,x3],[x1,x2,y3],[y1,x2, y3] }; theorem [:{x1},{x2,y2},{x3,y3}:] = { [x1,x2,x3],[x1,y2,x3],[x1,x2,y3],[x1,y2, y3] }; theorem [:{x1,y1},{x2,y2},{x3,y3}:] = { [x1,x2,x3],[x1,y2,x3],[x1,x2,y3],[x1, y2,y3], [y1,x2,x3],[y1,y2,x3],[y1,x2,y3],[y1,y2,y3] }; registration let X1,X2,X3 be non empty set; cluster -> triple for Element of [:X1,X2,X3:]; end; definition canceled 4; let X1,X2,X3 be non empty set; let x be Element of [:X1,X2,X3:]; redefine func x`1_3 -> Element of X1 means x = [x1,x2,x3] implies it = x1; redefine func x`2_3 -> Element of X2 means x = [x1,x2,x3] implies it = x2; redefine func x`3_3 -> Element of X3 means x = [x1,x2,x3] implies it = x3; end; canceled; theorem for X1,X2,X3 being non empty set for x being Element of [:X1,X2, X3:] holds x = [x`1_3,x`2_3,x`3_3]; theorem X c= [:X,Y,Z:] or X c= [:Y,Z,X:] or X c= [:Z,X,Y:] implies X = {}; canceled; theorem for X1,X2,X3 being non empty set for x being Element of [:X1,X2,X3:] holds x <> x`1_3 & x <> x`2_3 & x <> x`3_3; theorem [:X1,X2,X3:] meets [:Y1,Y2,Y3:] implies X1 meets Y1 & X2 meets Y2 & X3 meets Y3; theorem [:X1,X2,X3,X4:] = [:[:[:X1,X2:],X3:],X4:]; theorem [:[:X1,X2:],X3,X4:] = [:X1,X2,X3,X4:]; theorem X1 <> {} & X2 <> {} & X3 <> {} & X4 <> {} iff [:X1,X2,X3,X4:] <> {}; theorem X1<>{} & X2<>{} & X3<>{} & X4<>{} & [:X1,X2,X3,X4:] = [:Y1,Y2,Y3 ,Y4:] implies X1=Y1 & X2=Y2 & X3=Y3 & X4=Y4; theorem [:X1,X2,X3,X4:]<>{} & [:X1,X2,X3,X4:] = [:Y1,Y2,Y3,Y4:] implies X1=Y1 & X2=Y2 & X3=Y3 & X4=Y4; theorem [:X,X,X,X:] = [:Y,Y,Y,Y:] implies X = Y; reserve xx4 for Element of X4; registration let X1,X2,X3,X4 be non empty set; cluster -> quadruple for Element of [:X1,X2,X3,X4:]; end; definition let X1,X2,X3,X4 be non empty set; let x be Element of [:X1,X2,X3,X4:]; redefine func x`1_4 -> Element of X1 means x = [x1,x2,x3,x4] implies it = x1; redefine func x`2_4 -> Element of X2 means x = [x1,x2,x3,x4] implies it = x2; redefine func x`3_4 -> Element of X3 means x = [x1,x2,x3,x4] implies it = x3; redefine func x`4_4 -> Element of X4 means x = [x1,x2,x3,x4] implies it = x4; end; canceled; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] holds x = [x`1_4,x`2_4,x`3_4,x`4_4]; canceled; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] holds x <> x`1_4 & x <> x`2_4 & x <> x`3_4 & x <> x`4_4; theorem X1 c= [:X1,X2,X3,X4:] or X1 c= [:X2,X3,X4,X1:] or X1 c= [:X3,X4,X1,X2 :] or X1 c= [:X4,X1,X2,X3:] implies X1 = {}; theorem [:X1,X2,X3,X4:] meets [:Y1,Y2,Y3,Y4:] implies X1 meets Y1 & X2 meets Y2 & X3 meets Y3 & X4 meets Y4; theorem [:{x1},{x2},{x3},{x4}:] = { [x1,x2,x3,x4] }; theorem [:X,Y:] <> {} implies for x being Element of [:X,Y:] holds x <> x`1 & x <> x`2; theorem x in [:X,Y:] implies x <> x`1 & x <> x`2; reserve A1 for Subset of X1, A2 for Subset of X2, A3 for Subset of X3, A4 for Subset of X4; reserve x for Element of [:X1,X2,X3:]; theorem for X1,X2,X3 being non empty set for x being Element of [:X1,X2,X3:] for x1,x2,x3 st x = [x1,x2,x3] holds x`1_3 = x1 & x`2_3 = x2 & x`3_3 = x3; theorem for X1,X2,X3 being non empty set for x being Element of [:X1,X2,X3:] st for xx1 being Element of X1,xx2 being Element of X2, xx3 being Element of X3 st x = [xx1,xx2,xx3] holds y1 = xx1 holds y1 =x`1_3; theorem for X1,X2,X3 being non empty set for x being Element of [:X1,X2,X3:] st for xx1 being Element of X1,xx2 being Element of X2, xx3 being Element of X3 st x = [xx1,xx2,xx3] holds y2 = xx2 holds y2 =x`2_3; theorem for X1,X2,X3 being non empty set for x being Element of [:X1,X2,X3:] st for xx1 being Element of X1,xx2 being Element of X2, xx3 being Element of X3 st x = [xx1,xx2,xx3] holds y3 = xx3 holds y3 =x`3_3; theorem z in [: X1,X2,X3 :] implies ex x1,x2,x3 st x1 in X1 & x2 in X2 & x3 in X3 & z = [x1,x2,x3]; theorem [x1,x2,x3] in [: X1,X2,X3 :] iff x1 in X1 & x2 in X2 & x3 in X3; theorem (for z holds z in Z iff ex x1,x2,x3 st x1 in X1 & x2 in X2 & x3 in X3 & z = [x1,x2,x3]) implies Z = [: X1,X2,X3 :]; canceled; theorem for X1,X2,X3 being non empty set for A1 being non empty Subset of X1, A2 being non empty Subset of X2, A3 being non empty Subset of X3 for x being Element of [:X1,X2,X3:] st x in [:A1,A2,A3:] holds x`1_3 in A1 & x`2_3 in A2 & x`3_3 in A3; theorem X1 c= Y1 & X2 c= Y2 & X3 c= Y3 implies [:X1,X2,X3:] c= [:Y1,Y2, Y3:]; reserve x for Element of [:X1,X2,X3,X4:]; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] for x1,x2,x3,x4 being set st x = [x1, x2,x3,x4] holds x`1_4 = x1 & x`2_4 = x2 & x`3_4 = x3 & x`4_4 = x4; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] st for xx1 being Element of X1, xx2 being Element of X2, xx3 being Element of X3, xx4 being Element of X4 st x = [xx1,xx2,xx3,xx4] holds y1 = xx1 holds y1 =x`1_4; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] st for xx1 being Element of X1, xx2 being Element of X2, xx3 being Element of X3, xx4 being Element of X4 st x = [xx1, xx2,xx3,xx4] holds y2 = xx2 holds y2 =x`2_4; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] st for xx1 being Element of X1, xx2 being Element of X2, xx3 being Element of X3, xx4 being Element of X4 st x = [xx1, xx2,xx3,xx4] holds y3 = xx3 holds y3 =x`3_4; theorem for X1,X2,X3,X4 being non empty set for x being Element of [:X1,X2,X3,X4:] st for xx1 being Element of X1, xx2 being Element of X2, xx3 being Element of X3, xx4 being Element of X4 st x = [xx1, xx2,xx3,xx4] holds y4 = xx4 holds y4 =x`4_4; theorem z in [: X1,X2,X3,X4 :] implies ex x1,x2,x3,x4 st x1 in X1 & x2 in X2 & x3 in X3 & x4 in X4 & z = [x1,x2,x3,x4]; theorem [x1,x2,x3,x4] in [: X1,X2,X3,X4 :] iff x1 in X1 & x2 in X2 & x3 in X3 & x4 in X4; theorem (for z holds z in Z iff ex x1,x2,x3,x4 st x1 in X1 & x2 in X2 & x3 in X3 & x4 in X4 & z = [x1,x2,x3,x4]) implies Z = [: X1,X2,X3,X4 :]; canceled; theorem for X1,X2,X3,X4 being non empty set, A1 being non empty Subset of X1, A2 being non empty Subset of X2, A3 being non empty Subset of X3, A4 being non empty Subset of X4 for x being Element of [:X1,X2,X3,X4:] st x in [:A1,A2,A3,A4:] holds x`1_4 in A1 & x`2_4 in A2 & x`3_4 in A3 & x`4_4 in A4; theorem X1 c= Y1 & X2 c= Y2 & X3 c= Y3 & X4 c= Y4 implies [:X1,X2,X3,X4:] c= [:Y1,Y2,Y3,Y4:]; definition let X1,X2,A1,A2; redefine func [:A1,A2:] -> Subset of [:X1,X2:]; end; definition let X1,X2,X3,A1,A2,A3; redefine func [:A1,A2,A3:] -> Subset of [:X1,X2,X3:]; end; definition let X1,X2,X3,X4,A1,A2,A3,A4; redefine func [:A1,A2,A3,A4:] -> Subset of [:X1,X2,X3,X4:]; end; begin definition let f be Function; func pr1 f -> Function means dom it = dom f & for x being set st x in dom f holds it.x = (f.x)`1; func pr2 f -> Function means dom it = dom f & for x being set st x in dom f holds it.x = (f.x)`2; end; definition let x be set; func x`11 equals x`1`1; func x`12 equals x`1`2; func x`21 equals x`2`1; func x`22 equals x`2`2; end; reserve x for set; theorem [[x1,x2],y]`11 = x1 & [[x1,x2],y]`12 = x2 & [x,[y1,y2]]`21 = y1 & [x,[ y1,y2]]`22 = y2; theorem x in R implies x`1 in dom R & x`2 in rng R; theorem for R being non empty Relation, x being set holds Im(R,x) = { I`2 where I is Element of R: I`1 = x }; theorem x in R implies x`2 in Im(R,x`1); theorem x in R & y in R & x`1 = y`1 & x`2 = y`2 implies x = y; theorem for R being non empty Relation, x,y being Element of R st x`1 = y`1 & x`2 = y`2 holds x = y; theorem proj1 proj1 {[x1,x2,x3],[y1,y2,y3]} = {x1,y1}; theorem proj1 proj1 {[x1,x2,x3]} = {x1}; scheme BiFuncEx{A()->set,B()->set,C()->set,P[set,set,set]}: ex f,g being Function st dom f = A() & dom g = A() & for x st x in A() holds P[x,f.x,g.x] provided x in A() implies ex y,z st y in B() & z in C() & P[x,y,z]; begin reserve X,Y,Z for set, a,b,c,d,x,y,z,u for set, R for Relation, A,B,C for Ordinal; definition let X; func RelIncl X -> Relation means field it = X & for Y,Z st Y in X & Z in X holds [Y,Z] in it iff Y c= Z; end; canceled 6; registration let X; cluster RelIncl X -> reflexive; cluster RelIncl X -> transitive; cluster RelIncl X -> antisymmetric; end; registration let A; cluster RelIncl A -> connected; cluster RelIncl A -> well_founded; end; theorem Y c= X implies (RelIncl X) |_2 Y = RelIncl Y; theorem for A,X st X c= A holds RelIncl X is well-ordering; reserve H for Function; theorem A in B implies A = (RelIncl B)-Seg(A); theorem RelIncl A,RelIncl B are_isomorphic implies A = B; theorem R,RelIncl A are_isomorphic & R,RelIncl B are_isomorphic implies A = B; theorem for R st R is well-ordering & for a st a in field R ex A st R |_2 (R-Seg(a)),RelIncl A are_isomorphic ex A st R,RelIncl A are_isomorphic; theorem for R st R is well-ordering ex A st R,RelIncl A are_isomorphic; definition let R; assume R is well-ordering; func order_type_of R -> Ordinal means R,RelIncl it are_isomorphic; end; definition let A,R; pred A is_order_type_of R means A = order_type_of R; end; theorem X c= A implies order_type_of RelIncl X c= A; reserve f,g for Function; definition let X,Y; redefine pred X,Y are_equipotent means ex f st f is one-to-one & dom f = X & rng f = Y; reflexivity; symmetry; end; theorem X,Y are_equipotent & Y,Z are_equipotent implies X,Z are_equipotent; theorem R well_orders X implies field(R|_2 X) = X & R|_2 X is well-ordering; :$N Zermelo Theorem theorem for X ex R st R well_orders X; reserve M for non empty set; theorem (for X st X in M holds X <> {}) & (for X,Y st X in M & Y in M & X <> Y holds X misses Y) implies ex Choice being set st for X st X in M ex x st Choice /\ X = { x }; begin theorem for X being set holds RelIncl X is_reflexive_in X; theorem for X being set holds RelIncl X is_transitive_in X; theorem for X being set holds RelIncl X is_antisymmetric_in X; registration cluster RelIncl {} -> empty; end; registration let X be non empty set; cluster RelIncl X -> non empty; end; theorem RelIncl {x} = {[x,x]}; theorem RelIncl X c= [:X,X:]; begin reserve P,Q,X,Y,Z,p,x,x9,x1,x2,y,z for set; definition let X,Y; let R be Relation of X,Y; attr R is quasi_total means X = dom R if Y <> {} otherwise R = {}; end; registration let X,Y; cluster quasi_total for PartFunc of X,Y; end; registration let X,Y; cluster total -> quasi_total for Relation of X,Y; end; definition let X,Y; mode Function of X,Y is quasi_total PartFunc of X,Y; end; registration let X be empty set, Y be set; cluster quasi_total -> total for Relation of X,Y; end; registration let X be set, Y be non empty set; cluster quasi_total -> total for Relation of X,Y; end; registration let X be set; cluster quasi_total -> total for Relation of X,X; end; theorem for f being Function holds f is Function of dom f, rng f; theorem for f being Function st rng f c= Y holds f is Function of dom f, Y; theorem for f being Function st dom f = X & for x st x in X holds f.x in Y holds f is Function of X,Y; theorem for f being Function of X,Y st Y <> {} & x in X holds f.x in rng f; theorem for f being Function of X,Y st Y <> {} & x in X holds f.x in Y; theorem for f being Function of X,Y st (Y = {} implies X = {}) & rng f c= Z holds f is Function of X,Z; theorem for f being Function of X,Y st (Y = {} implies X = {}) & Y c= Z holds f is Function of X,Z; scheme FuncEx1{X, Y() -> set, P[set,set]}: ex f being Function of X(),Y() st for x st x in X() holds P[x,f.x] provided for x st x in X() ex y st y in Y() & P[x,y]; scheme Lambda1{X, Y() -> set, F(set)->set}: ex f being Function of X(),Y() st for x st x in X() holds f.x = F(x) provided for x st x in X() holds F(x) in Y(); definition let X,Y; func Funcs(X,Y) -> set means x in it iff ex f being Function st x = f & dom f = X & rng f c= Y; end; theorem for f being Function of X,Y st Y = {} implies X = {} holds f in Funcs(X,Y); theorem for f being Function of X,X holds f in Funcs(X,X); registration let X be set, Y be non empty set; cluster Funcs(X,Y) -> non empty; end; registration let X be set; cluster Funcs(X,X) -> non empty; end; registration let X be non empty set, Y be empty set; cluster Funcs(X,Y) -> empty; end; theorem for f being Function of X,Y st for y st y in Y ex x st x in X & y = f.x holds rng f = Y; theorem for f being Function of X,Y st y in rng f ex x st x in X & f.x = y; theorem for f1,f2 being Function of X,Y st for x st x in X holds f1.x = f2.x holds f1 = f2; theorem for f being quasi_total Relation of X,Y for g being quasi_total Relation of Y,Z st Y = {} implies Z = {} or X = {} holds f*g is quasi_total; theorem for f being Function of X,Y for g being Function of Y,Z st Z <> {} & rng f = Y & rng g = Z holds rng(g*f) = Z; theorem for f being Function of X,Y, g being Function st Y <> {} & x in X holds (g*f).x = g.(f.x); theorem for f being Function of X,Y st Y <> {} holds rng f = Y iff for Z st Z <> {} for g,h being Function of Y,Z st g*f = h*f holds g = h; theorem for f being Relation of X,Y holds (id X)*f = f & f*(id Y) = f; theorem for f being Function of X,Y for g being Function of Y,X st f*g = id Y holds rng f = Y; theorem for f being Function of X,Y st Y = {} implies X = {} holds f is one-to-one iff for x1,x2 st x1 in X & x2 in X & f.x1 = f.x2 holds x1 = x2; theorem for f being Function of X,Y for g being Function of Y,Z st (Z = {} implies Y = {}) & g*f is one-to-one holds f is one-to-one; theorem for f being Function of X,Y st X <> {} & Y <> {} holds f is one-to-one iff for Z for g,h being Function of Z,X st f*g = f*h holds g = h; theorem for f being Function of X,Y for g being Function of Y,Z st Z <> {} & rng(g*f) = Z & g is one-to-one holds rng f = Y; definition let Y be set; let f be Y-valued Relation; attr f is onto means rng f = Y; end; theorem for f being Function of X,Y for g being Function of Y,X st g*f = id X holds f is one-to-one & g is onto; theorem for f being Function of X,Y for g being Function of Y,Z st (Z = {} implies Y = {}) & g*f is one-to-one & rng f = Y holds f is one-to-one & g is one-to-one; theorem for f being Function of X,Y st f is one-to-one & rng f = Y holds f" is Function of Y,X; theorem for f being Function of X,Y st Y <> {} & f is one-to-one & x in X holds (f").(f.x) = x; theorem for X be set, Y,Z be non empty set for f be Function of X,Y for g be Function of Y,Z holds f is onto & g is onto implies g*f is onto; theorem for f being Function of X,Y for g being Function of Y,X st X <> {} & Y <> {} & rng f = Y & f is one-to-one & for y,x holds y in Y & g.y = x iff x in X & f.x = y holds g = f"; theorem for f being Function of X,Y st Y <> {} & rng f = Y & f is one-to-one holds f"*f = id X & f*f" = id Y; theorem for f being Function of X,Y for g being Function of Y,X st X <> {} & Y <> {} & rng f = Y & g*f = id X & f is one-to-one holds g = f"; theorem for f being Function of X,Y st Y <> {} & ex g being Function of Y,X st g*f = id X holds f is one-to-one; theorem for f being Function of X,Y st (Y = {} implies X = {}) & Z c= X holds f|Z is Function of Z,Y; theorem for f being Function of X,Y st X c= Z holds f|Z = f; theorem for f being Function of X,Y st Y <> {} & x in X & f.x in Z holds (Z|`f) .x = f.x; theorem for f being Function of X,Y st Y <> {} for y holds (ex x st x in X & x in P & y = f.x) implies y in f.:P; theorem for f being Function of X,Y holds f.:P c= Y; canceled; theorem for f being Function of X,Y st Y <> {} for x holds x in f"Q iff x in X & f.x in Q; theorem for f being PartFunc of X,Y holds f"Q c= X; theorem for f being Function of X,Y st Y = {} implies X = {} holds f"Y = X; theorem for f being Function of X,Y holds (for y st y in Y holds f"{y} <> {}) iff rng f = Y; theorem for f being Function of X,Y st (Y = {} implies X = {}) & P c= X holds P c= f"(f.:P); theorem for f being Function of X,Y st Y = {} implies X = {} holds f"(f.:X) = X; theorem for f being Function of X,Y for g being Function of Y,Z st (Z = {} implies Y = {}) holds f"Q c= (g*f)"(g.:Q); theorem for f being Function of {},Y holds f.:P = {}; theorem for f being Function of {},Y holds f"Q = {}; theorem for f being Function of {x},Y st Y <> {} holds f.x in Y; theorem for f being Function of {x},Y st Y <> {} holds rng f = {f.x}; theorem for f being Function of {x},Y st Y <> {} holds f.:P c= {f.x}; theorem for f being Function of X,{y} st x in X holds f.x = y; theorem for f1,f2 being Function of X,{y} holds f1 = f2; theorem for f being Function of X,X holds dom f = X; registration let X,Y be set; let f be quasi_total PartFunc of X,Y; let g be quasi_total PartFunc of X,X; cluster f*g -> quasi_total for PartFunc of X,Y; end; registration let X,Y be set; let f be quasi_total PartFunc of Y,Y; let g be quasi_total PartFunc of X,Y; cluster f*g -> quasi_total for PartFunc of X,Y; end; theorem for f,g being Relation of X,X st rng f = X & rng g = X holds rng (g*f) = X; theorem for f,g being Function of X,X st g*f = f & rng f = X holds g = id X; theorem for f,g being Function of X,X st f*g = f & f is one-to-one holds g = id X; theorem for f being Function of X,X holds f is one-to-one iff for x1,x2 st x1 in X & x2 in X & f.x1 = f.x2 holds x1 = x2; definition let X, Y; let f be X-defined Y-valued Function; attr f is bijective means f is one-to-one onto; end; registration let X, Y be set; cluster bijective -> one-to-one onto for PartFunc of X,Y; cluster one-to-one onto -> bijective for PartFunc of X,Y; end; registration let X; cluster bijective for Function of X,X; end; definition let X; mode Permutation of X is bijective Function of X,X; end; theorem for f being Function of X, X st f is one-to-one & rng f = X holds f is Permutation of X; theorem for f being Function of X,X st f is one-to-one holds for x1,x2 st x1 in X & x2 in X & f.x1 = f.x2 holds x1 = x2; registration let X; let f,g be onto PartFunc of X,X; cluster f*g -> onto for PartFunc of X,X; end; registration let X; let f,g be bijective Function of X,X; cluster g*f -> bijective for Function of X,X; end; registration let X; cluster reflexive total -> bijective for Function of X,X; end; definition let X; let f be Permutation of X; redefine func f" -> Permutation of X; end; theorem for f,g being Permutation of X st g*f = g holds f = id X; theorem for f,g being Permutation of X st g*f = id X holds g = f"; theorem for f being Permutation of X holds (f")*f =id X & f*(f") = id X; theorem for f being Permutation of X st P c= X holds f.:(f"P) = P & f"(f .:P) = P; reserve D for non empty set; registration let X,D,Z; let f be Function of X,D; let g be Function of D,Z; cluster g*f -> quasi_total for PartFunc of X,Z; end; definition let C be non empty set, D be set; let f be Function of C,D; let c be Element of C; redefine func f.c -> Element of D; end; scheme FuncExD{C, D() -> non empty set, P[set,set]}: ex f being Function of C(),D() st for x being Element of C() holds P[x,f.x] provided for x being Element of C() ex y being Element of D() st P[x,y]; scheme LambdaD{C, D() -> non empty set, F(Element of C()) -> Element of D()}: ex f being Function of C(),D() st for x being Element of C() holds f.x = F(x); theorem for f1,f2 being Function of X,Y st for x being Element of X holds f1.x = f2.x holds f1 = f2; theorem for P being set for f being Function of X,Y for y holds y in f .:P implies ex x st x in X & x in P & y = f.x; theorem for f being Function of X,Y for y st y in f.:P ex c being Element of X st c in P & y = f.c; begin theorem for f being set st f in Funcs(X,Y) holds f is Function of X,Y; scheme Lambda1C{A, B() -> set, C[set], F(set)->set, G(set)->set}: ex f being Function of A(),B() st for x st x in A() holds (C[ x] implies f.x = F(x)) & ( not C[ x] implies f.x = G(x)) provided for x st x in A() holds (C[ x] implies F(x) in B()) & (not C[ x] implies G(x) in B()); theorem for f being PartFunc of X,Y st dom f = X holds f is Function of X,Y; theorem for f being PartFunc of X,Y st f is total holds f is Function of X,Y; theorem for f being PartFunc of X,Y st (Y = {} implies X = {}) & f is Function of X,Y holds f is total; theorem for f being Function of X,Y st (Y = {} implies X = {}) holds <:f,X,Y:> is total; registration let X; let f be Function of X,X; cluster <:f,X,X:> -> total; end; theorem for f being PartFunc of X,Y st Y = {} implies X = {} ex g being Function of X,Y st for x st x in dom f holds g.x = f.x; theorem Funcs(X,Y) c= PFuncs(X,Y); theorem for f,g being Function of X,Y st (Y = {} implies X = {}) & f tolerates g holds f = g; theorem for f,g being Function of X,X st f tolerates g holds f = g; theorem for f being PartFunc of X,Y for g being Function of X,Y st Y = {} implies X = {} holds f tolerates g iff for x st x in dom f holds f.x = g.x ; theorem for f being PartFunc of X,X for g being Function of X,X holds f tolerates g iff for x st x in dom f holds f.x = g.x; theorem for f being PartFunc of X,Y st Y = {} implies X = {} ex g being Function of X,Y st f tolerates g; theorem for f,g being PartFunc of X,X for h being Function of X,X st f tolerates h & g tolerates h holds f tolerates g; theorem for f,g being PartFunc of X,Y st (Y = {} implies X = {}) & f tolerates g ex h being Function of X,Y st f tolerates h & g tolerates h; theorem for f being PartFunc of X,Y for g being Function of X,Y st (Y = {} implies X = {}) & f tolerates g holds g in TotFuncs f; theorem for f being PartFunc of X,X for g being Function of X,X st f tolerates g holds g in TotFuncs f; theorem for f being PartFunc of X,Y for g being set st g in TotFuncs(f) holds g is Function of X,Y; theorem for f being PartFunc of X,Y holds TotFuncs f c= Funcs(X,Y); theorem TotFuncs <:{},X,Y:> = Funcs(X,Y); theorem for f being Function of X,Y st Y = {} implies X = {} holds TotFuncs <:f,X,Y:> = {f}; theorem for f being Function of X,X holds TotFuncs <:f,X,X:> = {f}; theorem for f being PartFunc of X,{y} for g being Function of X,{y} holds TotFuncs f = {g}; theorem for f,g being PartFunc of X,Y st g c= f holds TotFuncs f c= TotFuncs g; theorem for f,g being PartFunc of X,Y st dom g c= dom f & TotFuncs f c= TotFuncs g holds g c= f; theorem for f,g being PartFunc of X,Y st TotFuncs f c= TotFuncs g & ( for y holds Y <> {y}) holds g c= f; theorem for f,g being PartFunc of X,Y st (for y holds Y <> {y}) & TotFuncs f = TotFuncs g holds f = g; registration let A,B be non empty set; cluster -> non empty for Function of A,B; end; begin scheme LambdaSep1{D, R() -> non empty set, A() -> Element of D(), B() -> Element of R(), F(set) -> Element of R()}: ex f being Function of D(),R() st f.A() = B() & for x being Element of D() st x <> A() holds f.x = F(x); scheme LambdaSep2{D, R() -> non empty set, A1, A2() -> Element of D(), B1, B2() -> Element of R(), F(set) -> Element of R()}: ex f being Function of D(),R() st f. A1() = B1() & f.A2() = B2() & for x being Element of D() st x <> A1() & x <> A2 () holds f.x = F(x) provided A1() <> A2(); theorem for A,B being set for f being Function st f in Funcs(A,B) holds dom f = A & rng f c= B; scheme FunctRealEx{X()->non empty set,Y()->set,F(set)->set}: ex f being Function of X(),Y() st for x being Element of X() holds f.x = F(x) provided for x being Element of X() holds F(x) in Y(); scheme KappaMD{X, Y() -> non empty set, F(set) -> set}: ex f being Function of X(), Y() st for x being Element of X() holds f.x = F(x) provided for x being Element of X() holds F(x) is Element of Y(); definition let A,B,C be non empty set; let f be Function of A, [:B,C:]; redefine func pr1 f -> Function of A,B means for x being Element of A holds it.x = (f.x)`1; redefine func pr2 f -> Function of A,C means for x being Element of A holds it .x = (f.x)`2; end; definition let A1 be set, B1 be non empty set, A2 be set, B2 be non empty set, f1 be Function of A1,B1, f2 be Function of A2,B2; redefine pred f1 = f2 means A1 = A2 & for a being Element of A1 holds f1.a = f2.a; end; definition let A,B be set, f1,f2 be Function of A,B; redefine pred f1 = f2 means for a being Element of A holds f1.a = f2.a; end; theorem for N being set, f being Function of N, bool N ex R being Relation of N st for i being set st i in N holds Im(R,i) = f.i; theorem for A being Subset of X holds (id X)"A = A; reserve A,B for non empty set; theorem for f being Function of A,B, A0 being Subset of A, B0 being Subset of B holds f.:A0 c= B0 iff A0 c= f"B0; theorem for f being Function of A,B, A0 being non empty Subset of A, f0 being Function of A0,B st for c being Element of A st c in A0 holds f.c = f0.c holds f|A0 = f0; theorem for f being Function, A0, C being set st C c= A0 holds f.:C = (f|A0).: C; theorem for f being Function, A0, D being set st f"D c= A0 holds f"D = (f|A0)" D; scheme MChoice{A()-> non empty set, B()-> non empty set, F(set) -> set}: ex t being Function of A(),B() st for a being Element of A() holds t.a in F(a) provided for a being Element of A() holds B() meets F(a); theorem for X, D be non empty set, p be Function of X,D, i be Element of X holds p/.i = p.i; registration let X, D be non empty set, p be Function of X,D, i be Element of X; identify p/.i with p.i; end; theorem for S,X being set, f being Function of S,X, A being Subset of X st X = {} implies S = {} holds (f"A)` = f"(A`); theorem for X,Y,Z being set, D being non empty set, f being Function of X,D st Y c= X & f.:Y c= Z holds f|Y is Function of Y,Z; definition let T,S be non empty set; let f be Function of T,S; let G be Subset-Family of S; func f"G -> Subset-Family of T means for A being Subset of T holds A in it iff ex B being Subset of S st B in G & A = f"B; end; theorem for T,S being non empty set, f being Function of T,S, A,B being Subset-Family of S st A c= B holds f"A c= f"B; definition let T,S be non empty set; let f be Function of T,S; let G be Subset-Family of T; func f.:G -> Subset-Family of S means for A being Subset of S holds A in it iff ex B being Subset of T st B in G & A = f.:B; end; theorem for T,S being non empty set, f being Function of T,S, A,B being Subset-Family of T holds A c= B implies f.:A c= f.:B; theorem for T,S being non empty set, f being Function of T,S, B being Subset-Family of S, P being Subset of S st f.:(f"B) is Cover of P holds B is Cover of P; theorem for T,S being non empty set, f being Function of T,S, B being Subset-Family of T, P being Subset of T st B is Cover of P holds f"(f.:B) is Cover of P; theorem for T,S being non empty set, f being Function of T,S, Q being Subset-Family of S holds union(f.:(f"(Q))) c= union Q; theorem for T,S being non empty set, f being Function of T,S, P being Subset-Family of T holds union P c= union(f"(f.:P)); definition let X,Z be set, Y be non empty set; let f be Function of X,Y; let p be Z-valued Function; assume rng f c= dom p; func p/*f -> Function of X,Z equals p*f; end; reserve Y for non empty set, f for Function of X,Y, p for PartFunc of Y,Z, x for Element of X; theorem X <> {} & rng f c= dom p implies (p/*f).x = p.(f.x); theorem X <> {} & rng f c= dom p implies (p/*f).x = p/.(f.x); reserve g for Function of X,X; theorem rng f c= dom p implies (p/*f)*g = p/*(f*g); theorem for X,Y being non empty set, f being Function of X,Y holds f is constant iff ex y being Element of Y st rng f = {y}; theorem for A,B being non empty set, x being Element of A, f being Function of A,B holds f.x in rng f; theorem for A,B being set, f being Function of A,B st y in rng f ex x being Element of A st y = f.x; theorem for A,B being non empty set, f being Function of A,B st for x being Element of A holds f.x in Z holds rng f c= Z; reserve X,Y for non empty set, Z,S,T for set, f for Function of X,Y, g for PartFunc of Y,Z, x for Element of X; theorem g is total implies (g/*f).x = g.(f.x); theorem g is total implies (g/*f).x = g/.(f.x); theorem rng f c= dom (g|S) implies (g|S)/*f = g/*f; theorem rng f c= dom (g|S) & S c= T implies (g|S)/*f = (g|T)/*f; theorem for H being Function of D, [:A,B:], d being Element of D holds H.d = [ pr1 H.d,pr2 H.d]; theorem for A1,A2, B1,B2 being set for f being Function of A1,A2, g being Function of B1,B2 st f tolerates g holds f /\ g is Function of A1 /\ B1, A2 /\ B2; registration let A, B be set; cluster Funcs(A,B) -> functional; end; definition let A, B be set; mode FUNCTION_DOMAIN of A,B -> non empty set means for x being Element of it holds x is Function of A,B; end; registration let A, B be set; cluster -> functional for FUNCTION_DOMAIN of A,B; end; theorem for f being Function of P,Q holds { f } is FUNCTION_DOMAIN of P,Q; theorem Funcs(P,B) is FUNCTION_DOMAIN of P,B; definition let A be set, B be non empty set; redefine func Funcs(A,B) -> FUNCTION_DOMAIN of A,B; let F be FUNCTION_DOMAIN of A,B; redefine mode Element of F -> Function of A,B; end; registration let I be set; cluster id I -> total for I-defined Function; end; definition let X,A; let F be Function of X,A; let x be set; assume x in X; redefine func F/.x equals F.x; end; theorem for f being Function of X, X, g being X-valued Function holds dom(f*g) = dom g; theorem for X being non empty set, f being Function of X,X st for x being Element of X holds f.x = x holds f = id X; definition let O,E be set; mode Action of O,E is Function of O, Funcs(E,E); end; theorem for x being set, A being set for f,g being Function of {x}, A st f.x = g.x holds f = g; begin definition let f be Function; let a,b be set; func f.(a,b) -> set equals f.[a,b]; end; reserve A for set; definition let A,B be non empty set, C be set, f be Function of [:A,B:],C; let a be Element of A; let b be Element of B; redefine func f.(a,b) -> Element of C; end; reserve X,Y,Z,x,x1,x2,y,y1,y2,z,z1,z2 for set; theorem for X,Y,Z being set for f1,f2 being Function of [:X,Y:],Z st for x,y being set st x in X & y in Y holds f1.(x,y) = f2.(x,y) holds f1 = f2; theorem for f1,f2 being Function of [:X,Y:],Z st for a being Element of X for b being Element of Y holds f1.(a,b) = f2.(a,b) holds f1 = f2; definition let A be set; mode UnOp of A is Function of A,A; mode BinOp of A is Function of [:A,A:],A; end; definition let A be set, f be BinOp of A; let a,b be Element of A; redefine func f.(a,b) -> Element of A; end; reserve u for UnOp of A, o,o9 for BinOp of A, a,b,c,e,e1,e2 for Element of A; scheme FuncEx2{X, Y, Z() -> set, P[set,set,set]}: ex f being Function of [:X(),Y() :],Z() st for x,y st x in X() & y in Y() holds P[x,y,f.(x,y)] provided for x,y st x in X() & y in Y() ex z st z in Z() & P[x,y,z]; scheme Lambda2{X, Y, Z() -> set, F(set,set)->set}: ex f being Function of [:X(),Y() :],Z() st for x,y st x in X() & y in Y() holds f.(x,y) = F(x,y) provided for x,y st x in X() & y in Y() holds F(x,y) in Z(); scheme FuncEx2D{X, Y, Z() -> non empty set, P[set,set,set]}: ex f being Function of [:X(),Y():],Z() st for x being Element of X() for y being Element of Y() holds P[x,y,f.(x,y)] provided for x being Element of X() for y being Element of Y() ex z being Element of Z() st P[x,y,z]; scheme Lambda2D{X, Y, Z() -> non empty set, F(Element of X(),Element of Y()) -> Element of Z()}: ex f being Function of [:X(),Y():],Z() st for x being Element of X() for y being Element of Y() holds f.(x,y)=F(x,y); definition let A,o; attr o is commutative means for a,b holds o.(a,b) = o.(b,a); attr o is associative means for a,b,c holds o.(a,o.(b,c)) = o.(o.(a,b ),c); attr o is idempotent means for a holds o.(a,a) = a; end; registration cluster -> empty associative commutative for BinOp of {}; end; definition let A,e,o; pred e is_a_left_unity_wrt o means for a holds o.(e,a) = a; pred e is_a_right_unity_wrt o means for a holds o.(a,e) = a; end; definition let A,e,o; pred e is_a_unity_wrt o means e is_a_left_unity_wrt o & e is_a_right_unity_wrt o; end; theorem e is_a_unity_wrt o iff for a holds o.(e,a) = a & o.(a,e) = a; theorem o is commutative implies (e is_a_unity_wrt o iff for a holds o.( e,a) = a); theorem o is commutative implies (e is_a_unity_wrt o iff for a holds o.( a,e) = a); theorem o is commutative implies (e is_a_unity_wrt o iff e is_a_left_unity_wrt o); theorem o is commutative implies (e is_a_unity_wrt o iff e is_a_right_unity_wrt o); theorem o is commutative implies (e is_a_left_unity_wrt o iff e is_a_right_unity_wrt o); theorem e1 is_a_left_unity_wrt o & e2 is_a_right_unity_wrt o implies e1 = e2; theorem e1 is_a_unity_wrt o & e2 is_a_unity_wrt o implies e1 = e2; definition let A,o; assume ex e st e is_a_unity_wrt o; func the_unity_wrt o -> Element of A means it is_a_unity_wrt o; end; definition let A,o9,o; pred o9 is_left_distributive_wrt o means for a,b,c holds o9.(a,o.(b,c )) = o.(o9.(a,b),o9.(a,c)); pred o9 is_right_distributive_wrt o means for a,b,c holds o9.(o.(a,b ),c) = o.(o9.(a,c),o9.(b,c)); end; definition let A,o9,o; pred o9 is_distributive_wrt o means o9 is_left_distributive_wrt o & o9 is_right_distributive_wrt o; end; theorem o9 is_distributive_wrt o iff for a,b,c holds o9.(a,o.(b,c)) = o. (o9.(a,b),o9.(a,c)) & o9.(o.(a,b),c) = o.(o9.(a,c),o9.(b,c)); theorem for A being non empty set, o,o9 being BinOp of A holds o9 is commutative implies (o9 is_distributive_wrt o iff for a,b,c being Element of A holds o9.(a,o.(b,c)) = o.(o9.(a,b),o9.(a,c))); theorem for A being non empty set, o,o9 being BinOp of A holds o9 is commutative implies (o9 is_distributive_wrt o iff for a,b,c being Element of A holds o9.(o.(a,b),c) = o.(o9.(a,c),o9.(b,c))); theorem for A being non empty set, o,o9 being BinOp of A holds o9 is commutative implies (o9 is_distributive_wrt o iff o9 is_left_distributive_wrt o ); theorem for A being non empty set, o,o9 being BinOp of A holds o9 is commutative implies (o9 is_distributive_wrt o iff o9 is_right_distributive_wrt o); theorem for A being non empty set, o,o9 being BinOp of A holds o9 is commutative implies (o9 is_right_distributive_wrt o iff o9 is_left_distributive_wrt o); definition let A,u,o; pred u is_distributive_wrt o means for a,b holds u.(o.(a,b)) = o.((u .a),(u.b)); end; definition canceled 3; let A be non empty set, e be Element of A, o be BinOp of A; redefine pred e is_a_left_unity_wrt o means for a being Element of A holds o .(e,a) = a; redefine pred e is_a_right_unity_wrt o means for a being Element of A holds o.(a,e) = a; end; definition let A be non empty set, o9,o be BinOp of A; redefine pred o9 is_left_distributive_wrt o means for a,b,c being Element of A holds o9.(a,o.(b,c)) = o.(o9.(a,b),o9.(a,c)); redefine pred o9 is_right_distributive_wrt o means for a,b,c being Element of A holds o9.(o.(a,b),c) = o.(o9.(a,c),o9.(b,c)); end; definition let A be non empty set, u be UnOp of A, o be BinOp of A; redefine pred u is_distributive_wrt o means for a,b being Element of A holds u.(o.(a,b)) = o.((u.a),(u.b)); end; theorem for f being Function of [:X,Y:],Z st x in X & y in Y & Z <> {} holds f .(x,y) in Z; theorem for x, y, X, Y, Z being set, f being Function of [:X,Y:],Z, g being Function st Z <> {} & x in X & y in Y holds (g*f).(x,y) = g.(f.(x,y)); theorem for f being Function st dom f = [:X,Y:] holds f is constant iff for x1 ,x2,y1,y2 st x1 in X & x2 in X & y1 in Y & y2 in Y holds f.(x1,y1)=f.(x2,y2); theorem for f1,f2 being PartFunc of [:X,Y:],Z st dom f1 = dom f2 & for x,y st [x,y] in dom f1 holds f1.(x,y)=f2.(x,y) holds f1 = f2; scheme PartFuncEx2{X,Y,Z()->set,P[set,set,set]}: ex f being PartFunc of [:X(),Y():] ,Z() st (for x,y holds [x,y] in dom f iff x in X() & y in Y() & ex z st P[x,y,z ]) & for x,y st [x,y] in dom f holds P[x,y,f.(x,y)] provided for x,y,z st x in X() & y in Y() & P[x,y,z] holds z in Z() and for x,y,z1,z2 st x in X() & y in Y() & P[x,y,z1] & P[x,y,z2] holds z1 = z2; scheme LambdaR2{X,Y,Z()->set,F(set,set)->set,P[set,set]}: ex f being PartFunc of [: X(),Y():],Z() st (for x,y holds [x,y] in dom f iff x in X() & y in Y() & P[x,y] ) & for x,y st [x,y] in dom f holds f.(x,y) = F(x,y) provided for x,y st P[x,y] holds F(x,y) in Z(); scheme PartLambda2{X,Y,Z()->set,F(set,set)->set,P[set,set]}: ex f being PartFunc of [:X(),Y():],Z() st (for x,y holds [x,y] in dom f iff x in X() & y in Y() & P[x, y]) & for x,y st [x,y] in dom f holds f.(x,y) = F(x,y) provided for x,y st x in X() & y in Y() & P[x,y] holds F(x,y) in Z(); scheme {X,Y()->non empty set,Z()->set,F(set,set)->set, P[set,set]}: ex f being PartFunc of [:X(),Y():],Z() st (for x being Element of X(), y being Element of Y() holds [x,y] in dom f iff P[x,y]) & for x being Element of X(), y being Element of Y() st [x,y] in dom f holds f.(x,y) = F(x,y) provided for x being Element of X(), y being Element of Y() st P[x,y] holds F (x,y) in Z(); definition let A be set, f be BinOp of A, x,y be Element of A; redefine func f.(x,y) -> Element of A; end; definition let X,Y,Z be set; let f1,f2 being Function of [:X,Y:],Z; redefine pred f1 = f2 means for x,y being set st x in X & y in Y holds f1.(x,y) = f2.(x,y); end; begin reserve a,b,c,d for set, D,X1,X2,X3,X4 for non empty set, x1,y1,z1 for Element of X1, x2 for Element of X2, x3 for Element of X3, x4 for Element of X4, A1,B1 for Subset of X1; theorem a in [:X1,X2:] implies ex x1,x2 st a=[x1,x2]; theorem for x,y being Element of [:X1,X2:] st x`1=y`1 & x`2=y`2 holds x=y; definition let X1,X2,x1,x2; redefine func [x1,x2] -> Element of [:X1,X2:]; end; definition let X1,X2; let x be Element of [:X1,X2:]; redefine func x`1 -> Element of X1; redefine func x`2 -> Element of X2; end; theorem a in [: X1,X2,X3 :] iff ex x1,x2,x3 st a = [x1,x2,x3]; theorem (for a holds a in D iff ex x1,x2,x3 st a = [x1,x2,x3]) implies D = [: X1,X2,X3 :]; theorem D = [: X1,X2,X3 :] iff for a holds a in D iff ex x1,x2,x3 st a = [x1, x2,x3]; reserve x,y for Element of [:X1,X2,X3:]; definition let X1,X2,X3,x1,x2,x3; redefine func [x1,x2,x3] -> Element of [:X1,X2,X3:]; end; theorem a =x`1_3 iff for x1,x2,x3 st x = [x1,x2,x3] holds a = x1; theorem b =x`2_3 iff for x1,x2,x3 st x = [x1,x2,x3] holds b = x2; theorem c =x`3_3 iff for x1,x2,x3 st x = [x1,x2,x3] holds c = x3; theorem x`1_3=y`1_3 & x`2_3=y`2_3 & x`3_3=y`3_3 implies x=y; theorem a in [: X1,X2,X3,X4 :] iff ex x1,x2,x3,x4 st a = [x1,x2,x3,x4]; theorem (for a holds a in D iff ex x1,x2,x3,x4 st a = [x1,x2,x3,x4]) implies D = [: X1,X2,X3,X4 :]; theorem D = [: X1,X2,X3,X4 :] iff for a holds a in D iff ex x1,x2,x3,x4 st a = [x1,x2,x3,x4]; reserve x for Element of [:X1,X2,X3,X4:]; definition let X1,X2,X3,X4,x1,x2,x3,x4; redefine func [x1,x2,x3,x4] -> Element of [:X1,X2,X3,X4:]; end; theorem a=x`1_4 iff for x1,x2,x3,x4 st x = [x1,x2,x3,x4] holds a = x1; theorem b=x`2_4 iff for x1,x2,x3,x4 st x = [x1,x2,x3,x4] holds b = x2; theorem c = x`3_4 iff for x1,x2,x3,x4 st x = [x1,x2,x3,x4] holds c = x3; theorem d=x`4_4 iff for x1,x2,x3,x4 st x = [x1,x2,x3,x4] holds d = x4; theorem for x,y being Element of [:X1,X2,X3,X4:] st x`1_4=y`1_4 & x`2_4=y`2_4 & x`3_4=y `3_4 & x`4_4=y`4_4 holds x=y; reserve A2 for Subset of X2, A3 for Subset of X3, A4 for Subset of X4; scheme Fraenkel1 {P[set]}: for X1 holds { x1 : P[x1] } is Subset of X1; scheme Fraenkel2 {P[set,set]}: for X1,X2 holds { [x1,x2] : P[x1,x2] } is Subset of [:X1,X2:]; scheme Fraenkel3 {P[set,set,set]}: for X1,X2,X3 holds { [x1,x2,x3] : P[x1,x2,x3] } is Subset of [:X1,X2,X3:]; scheme Fraenkel4 {P[set,set,set,set]}: for X1,X2,X3,X4 holds { [x1,x2,x3,x4] : P[x1 ,x2,x3,x4] } is Subset of [:X1,X2,X3,X4:]; scheme Fraenkel5 {P[set],Q[set]}: for X1 st for x1 holds P[x1] implies Q[x1] holds { y1 : P[y1] } c= { z1 : Q[z1] }; scheme Fraenkel6 {P[set],Q[set]}: for X1 st for x1 holds P[x1] iff Q[x1] holds { y1 : P[y1] } = { z1 : Q[z1] }; scheme SubsetD{D() -> non empty set,P[set]}: {d where d is Element of D() : P[d]} is Subset of D(); theorem X1 = { x1 : not contradiction }; theorem [:X1,X2:] = { [x1,x2] : not contradiction }; theorem [:X1,X2,X3:] = { [x1,x2,x3] : not contradiction }; theorem [:X1,X2,X3,X4:] = { [x1,x2,x3,x4] : not contradiction }; theorem A1 = { x1 : x1 in A1 }; theorem [:A1,A2:] = { [x1,x2] : x1 in A1 & x2 in A2 }; theorem [:A1,A2,A3:] = { [x1,x2,x3] : x1 in A1 & x2 in A2 & x3 in A3 }; theorem [:A1,A2,A3,A4:] = { [x1,x2,x3,x4] : x1 in A1 & x2 in A2 & x3 in A3 & x4 in A4 }; theorem {} X1 = { x1 : contradiction }; theorem A1` = { x1 : not x1 in A1 }; theorem A1 /\ B1 = { x1 : x1 in A1 & x1 in B1 }; theorem A1 \/ B1 = { x1 : x1 in A1 or x1 in B1 }; theorem A1 \ B1 = { x1 : x1 in A1 & not x1 in B1 }; theorem A1 \+\ B1 = { x1 : x1 in A1 & not x1 in B1 or not x1 in A1 & x1 in B1 }; theorem A1 \+\ B1 = { x1 : not x1 in A1 iff x1 in B1 }; theorem A1 \+\ B1 = { x1 : x1 in A1 iff not x1 in B1 }; theorem A1 \+\ B1 = { x1 : not(x1 in A1 iff x1 in B1) }; definition let D be non empty set; let x1 be Element of D; redefine func {x1} -> Subset of D; let x2 be Element of D; redefine func {x1,x2} -> Subset of D; let x3 be Element of D; redefine func {x1,x2,x3} -> Subset of D; let x4 be Element of D; redefine func {x1,x2,x3,x4} -> Subset of D; let x5 be Element of D; redefine func {x1,x2,x3,x4,x5} -> Subset of D; let x6 be Element of D; redefine func {x1,x2,x3,x4,x5,x6} -> Subset of D; let x7 be Element of D; redefine func {x1,x2,x3,x4,x5,x6,x7} -> Subset of D; let x8 be Element of D; redefine func {x1,x2,x3,x4,x5,x6,x7,x8} -> Subset of D; end; begin scheme SubsetFD { A, D() -> non empty set, F(set) -> Element of D(), P[set] }: { F( x) where x is Element of A(): P[x]} is Subset of D(); scheme SubsetFD2 { A, B, D() -> non empty set, F(set,set) -> Element of D(), P[set, set] }: { F(x,y) where x is Element of A(), y is Element of B(): P[x,y]} is Subset of D(); definition let D1,D2,D3 be non empty set, x be Element of [:[:D1,D2:],D3:]; redefine func x`11 -> Element of D1; redefine func x`12 -> Element of D2; end; definition let D1,D2,D3 be non empty set, x be Element of [:D1,[:D2,D3:]:]; redefine func x`21 -> Element of D2; redefine func x`22 -> Element of D3; end; scheme AndScheme{A()-> non empty set, P,Q[set]}: { a where a is Element of A(): P[a ] & Q[a] } = { a1 where a1 is Element of A(): P[a1] } /\ { a2 where a2 is Element of A(): Q[a2] }; registration let A be non empty set; cluster c=-linear non empty for Subset of A; end; begin reserve p,q,x,x1,x2,y,y1,y2,z,z1,z2 for set; reserve A,B,V,X,X1,X2,Y,Y1,Y2,Z for set; reserve C,C1,C2,D,D1,D2 for non empty set; theorem A c= Y implies id A = (id Y)|A; theorem for f,g being Function st X c= dom(g*f) holds f.:X c= dom g; theorem for f,g being Function st X c= dom f & f.:X c= dom g holds X c= dom(g*f); theorem for f,g being Function st Y c= rng(g*f) & g is one-to-one holds g "Y c= rng f ; theorem for f,g being Function st Y c= rng g & g"Y c= rng f holds Y c= rng(g*f); scheme FuncEx3{A()->set,B()-> set,P[set,set,set]}: ex f being Function st dom f = [:A(),B():] & for x,y st x in A() & y in B() holds P[x,y,f.(x,y)] provided for x,y,z1,z2 st x in A() & y in B() & P[x,y,z1] & P[x,y,z2] holds z1 = z2 and for x,y st x in A() & y in B() ex z st P[x,y,z]; scheme Lambda3{A()->set,B()->set,F(set,set)->set}: ex f being Function st dom f = [:A(),B():] & for x,y st x in A() & y in B() holds f.(x,y) = F(x,y); theorem for f,g being Function st dom f = [:X,Y:] & dom g = [:X,Y:] & for x,y st x in X & y in Y holds f.(x,y) = g.(x,y) holds f = g; definition let f be Function; func .:f -> Function means dom it = bool dom f & for X st X c= dom f holds it.X = f.:X; end; theorem for f being Function st X in dom(.:f) holds (.:f).X = f.:X; theorem for f being Function holds (.:f).{} = {}; theorem for f being Function holds rng(.:f) c= bool rng f; theorem for f being Function holds (.:f).:A c= bool rng f; theorem for f being Function holds (.:f)"B c= bool dom f; theorem for f being Function of X,D holds (.:f)"B c= bool X; theorem for f being Function holds union((.:f).:A) c= f.:(union A); theorem for f being Function st A c= bool dom f holds f.:(union A) = union((.:f).:A); theorem for f being Function of X,D st A c= bool X holds f.:(union A) = union( (.:f).:A); theorem for f being Function holds union((.:f)"B) c= f"(union B); theorem for f being Function st B c= bool rng f holds f"(union B) = union((.:f ) " B ); theorem for f,g being Function holds .:(g*f) = .:g*.:f; theorem for f being Function holds .:f is Function of bool dom f, bool rng f; theorem for f being Function of X,Y st Y = {} implies X = {} holds .:f is Function of bool X, bool Y; definition let X,D; let f be Function of X,D; redefine func .:f -> Function of bool X, bool D; end; definition let f be Function; func "f -> Function means dom it = bool rng f & for Y st Y c= rng f holds it.Y = f"Y; end; theorem for f being Function st Y in dom("f) holds ("f).Y = f"Y; theorem for f being Function holds rng("f) c= bool dom f; theorem for f being Function holds ("f).:B c= bool dom f; theorem for f being Function holds ("f)"A c= bool rng f; theorem for f being Function holds union(("f).:B) c= f"(union B); theorem for f being Function st B c= bool rng f holds union(("f).:B) = f"( union B ); theorem for f being Function holds union(("f)"A) c= f.:(union A); theorem for f being Function st A c= bool dom f & f is one-to-one holds union( ("f)"A) = f.:(union A); theorem for f being Function holds ("f).:B c= (.:f)"B; theorem for f being Function st f is one-to-one holds ("f).:B = (.:f)"B; theorem for f being Function,A be set st A c= bool dom f holds ("f)"A c= (.:f).:A; theorem for f being Function,A be set st f is one-to-one holds (.:f).:A c= ("f)"A; theorem for f being Function,A be set st f is one-to-one & A c= bool dom f holds ("f)"A = (.:f).:A; theorem for f,g being Function st g is one-to-one holds "(g*f) = "f*"g; theorem for f being Function holds "f is Function of bool rng f, bool dom f; definition let A,X; func chi(A,X) -> Function means dom it = X & for x st x in X holds (x in A implies it.x = 1) & (not x in A implies it.x = {}); end; theorem chi(A,X).x = 1 implies x in A; theorem x in X \ A implies chi(A,X).x = {}; theorem A c= X & B c= X & chi(A,X) = chi(B,X) implies A = B; theorem rng chi(A,X) c= {{},1}; theorem for f being Function of X,{{},1} holds f = chi(f"{1},X); definition let A,X; redefine func chi(A,X) -> Function of X,{{},1}; end; notation let Y; let A be Subset of Y; synonym incl A for id A; end; definition let Y; let A be Subset of Y; redefine func incl A -> Function of A,Y; end; theorem for A being Subset of Y holds incl A = (id Y)|A; theorem for A being Subset of Y st x in A holds incl(A).x in Y; definition let X,Y; func pr1(X,Y) -> Function means dom it = [:X,Y:] & for x,y st x in X & y in Y holds it.(x,y) = x; func pr2(X,Y) -> Function means dom it = [:X,Y:] & for x,y st x in X & y in Y holds it.(x,y) = y; end; theorem rng pr1(X,Y) c= X; theorem Y <> {} implies rng pr1(X,Y) = X; theorem rng pr2(X,Y) c= Y; theorem X <> {} implies rng pr2(X,Y) = Y; definition let X,Y; redefine func pr1(X,Y) -> Function of [:X,Y:],X; redefine func pr2(X,Y) -> Function of [:X,Y:],Y; end; definition let X; func delta(X) -> Function means dom it = X & for x st x in X holds it .x = [x,x]; end; theorem rng delta X c= [:X,X:]; definition let X; redefine func delta(X) -> Function of X,[:X,X:]; end; definition let f,g be Function; func <:f,g:> -> Function means dom it = dom f /\ dom g & for x st x in dom it holds it.x = [f.x,g.x]; end; registration let f be empty Function, g be Function; cluster <:f,g:> -> empty; cluster <:g,f:> -> empty; end; theorem for f,g being Function st x in dom f /\ dom g holds <:f,g:>.x = [f.x,g.x]; theorem for f,g being Function st dom f = X & dom g = X & x in X holds <:f,g:>.x = [f.x,g.x]; theorem for f,g being Function st dom f = X & dom g = X holds dom <:f,g :> = X; theorem for f,g being Function holds rng <:f,g:> c= [:rng f,rng g:]; theorem for f,g being Function st dom f = dom g & rng f c= Y & rng g c= Z holds pr1(Y,Z)*<:f,g:> = f & pr2(Y,Z)*<:f,g:> = g; theorem <:pr1(X,Y),pr2(X,Y):> = id [:X,Y:]; theorem for f,g,h,k being Function st dom f = dom g & dom k = dom h & <: f,g:> = <:k,h:> holds f = k & g = h; theorem for f,g,h being Function holds <:f*h,g*h:> = <:f,g:>*h; theorem for f,g being Function holds <:f,g:>.:A c= [:f.:A,g.:A:]; theorem for f,g being Function holds <:f,g:>"[:B,C:] = f"B /\ g"C; theorem for f being Function of X,Y for g being Function of X,Z st (Y = {} implies X = {}) & (Z = {} implies X = {}) holds <:f,g:> is Function of X,[:Y ,Z:]; definition let X,D1,D2; let f1 be Function of X,D1; let f2 be Function of X,D2; redefine func <:f1,f2:> -> Function of X,[:D1,D2:]; end; theorem for f1 being Function of C,D1 for f2 being Function of C,D2 for c being Element of C holds <:f1,f2:>.c = [f1.c,f2.c]; theorem for f being Function of X,Y for g being Function of X,Z holds rng <:f, g:> c= [:Y,Z:]; theorem for f being Function of X,Y for g being Function of X,Z st (Y = {} implies X = {}) & (Z = {} implies X = {}) holds pr1(Y,Z)*<:f,g:> = f & pr2(Y ,Z)*<:f,g:> = g; theorem for f being Function of X,D1 for g being Function of X,D2 holds pr1(D1 ,D2)*<:f,g:> = f & pr2(D1,D2)*<:f,g:> = g; theorem for f1,f2 being Function of X,Y for g1,g2 being Function of X,Z st (Y = {} implies X = {}) & (Z = {} implies X = {}) & <:f1,g1:> = <:f2,g2:> holds f1 = f2 & g1 = g2; theorem for f1,f2 being Function of X,D1 for g1,g2 being Function of X,D2 st <:f1,g1:> = <:f2,g2:> holds f1 = f2 & g1 = g2; definition let f,g be Function; func [:f,g:] -> Function means dom it = [:dom f, dom g:] & for x,y st x in dom f & y in dom g holds it.(x,y) = [f.x,g.y]; end; theorem for f,g being Function, x,y st [x,y] in [:dom f,dom g:] holds [: f,g:].(x,y) = [f.x,g.y]; theorem for f,g being Function holds [:f,g:] = <:f*pr1(dom f,dom g),g* pr2(dom f,dom g):>; theorem for f,g being Function holds rng [:f,g:] = [:rng f,rng g:]; theorem for f,g being Function st dom f = X & dom g = X holds <:f,g:> = [:f,g:]*(delta X); theorem [:id X, id Y:] = id [:X,Y:]; theorem for f,g,h,k being Function holds [:f,h:]*<:g,k:> = <:f*g,h*k:>; theorem for f,g,h,k being Function holds [:f,h:]*[:g,k:] = [:f*g,h*k:]; theorem for f,g being Function holds [:f,g:].:[:B,A:] = [:f.:B,g.:A:]; theorem for f,g being Function holds [:f,g:]"[:B,A:] = [:f"B,g"A:]; theorem for f being Function of X,Y for g being Function of V,Z holds [: f,g:] is Function of [:X,V:],[:Y,Z:]; definition let X1,X2,Y1,Y2; let f1 be Function of X1,Y1; let f2 be Function of X2,Y2; redefine func [:f1,f2:] -> Function of [:X1,X2:],[:Y1,Y2:]; end; theorem for f1 being Function of C1,D1 for f2 being Function of C2,D2 for c1 being Element of C1 for c2 being Element of C2 holds [:f1,f2:].(c1,c2) = [f1.c1 ,f2.c2]; theorem for f1 being Function of X1,Y1 for f2 being Function of X2,Y2 st (Y1 = {} implies X1 = {}) & (Y2 = {} implies X2 = {}) holds [:f1,f2:] = <:f1*pr1(X1, X2),f2*pr2(X1,X2):>; theorem for f1 being Function of X1,D1 for f2 being Function of X2,D2 holds [: f1,f2:] = <:f1*pr1(X1,X2),f2*pr2(X1,X2):>; theorem for f1 being Function of X,Y1 for f2 being Function of X,Y2 holds <:f1 ,f2:> = [:f1,f2:]*(delta X); begin theorem for f being Function holds pr1(dom f,rng f).:f = dom f; theorem for A,B,C being non empty set, f,g being Function of A,[:B,C:] st pr1(B,C)*f = pr1(B,C)*g & pr2(B,C)*f = pr2(B,C)*g holds f = g; registration let F,G be one-to-one Function; cluster [:F,G:] -> one-to-one; end; registration let A be set; cluster idempotent for BinOp of A; end; registration let A be set, b be idempotent BinOp of A; let a be Element of A; reduce b.(a,a) to a; end; begin reserve f,g,h for Function, A for set; theorem delta A = <:id A, id A:>; reserve F for Function, B,x,y,y1,y2,z for set; definition let f; func f~ -> Function means dom it = dom f & for x st x in dom f holds (for y,z st f.x = [y,z] holds it.x = [z,y]) & (f.x = it.x or ex y,z st f.x =[y, z]); involutiveness; end; theorem <:f,g:> = <:g,f:>~; theorem (f|A)~ = f~|A; theorem (delta A)~ = delta A; theorem <:f,g:>|A = <:f|A,g:>; theorem <:f,g:>|A = <:f,g|A:>; definition let A, z be set; func A --> z -> set equals [:A, {z}:]; end; registration let A, z be set; cluster A --> z -> Function-like Relation-like; end; theorem x in A implies (A --> z).x = z; theorem A <> {} implies rng (A --> x) = {x}; theorem rng f = {x} implies f = (dom f) --> x; registration let x; cluster {} --> x -> empty; end; registration let x; let A be empty set; cluster A --> x -> empty; end; registration let x; let A be non empty set; cluster A --> x -> non empty; end; theorem dom ({} --> x) = {} & rng ({} --> x) = {}; theorem (for z st z in dom f holds f.z = x) implies f = dom f --> x; theorem (A --> x)|B = A /\ B --> x; theorem dom (A --> x) = A & rng (A --> x) c= {x}; theorem x in B implies (A --> x)"B = A; theorem (A --> x)"{x} = A; theorem not x in B implies (A --> x)"B = {}; theorem x in dom h implies h*(A --> x) = A --> h.x; theorem A <> {} & x in dom h implies dom(h*(A --> x)) <> {}; theorem (A --> x)*h = h"A --> x; theorem (A --> [x,y])~ = A --> [y,x]; definition let F,f,g; func F.:(f,g) -> set equals F * <:f,g:>; end; registration let F,f,g; cluster F.:(f,g) -> Function-like Relation-like; end; theorem for h st dom h = dom(F.:(f,g)) & for z being set st z in dom (F.:(f,g) ) holds h.z = F.(f.z,g.z) holds h = F.:(f,g); theorem x in dom (F.:(f,g)) implies (F.:(f,g)).x = F.(f.x,g.x); theorem f|A = g|A implies (F.:(f,h))|A = (F.:(g,h))|A; theorem f|A = g|A implies (F.:(h,f))|A = (F.:(h,g))|A; theorem F.:(f,g)*h = F.:(f*h, g*h); definition let F,f,x; func F[:](f,x) -> set equals F * <:f, dom f --> x:>; end; registration let F,f,x; cluster F[:](f,x) -> Function-like Relation-like; end; theorem F[:](f,x) = F.:(f, dom f --> x); theorem x in dom (F[:](f,z)) implies (F[:](f,z)).x = F.(f.x,z); theorem f|A = g|A implies (F[:](f,x))|A = (F[:](g,x))|A; theorem F[:](f,x)*h = F[:](f*h,x); theorem F[:](f,x)*id A = F[:](f|A,x); definition let F,x,g; func F[;](x,g) -> set equals F * <:dom g --> x, g:>; end; registration let F,x,g; cluster F[;](x,g) -> Function-like Relation-like; end; theorem F[;](x,g) = F.:(dom g --> x, g); theorem x in dom (F[;](z,f)) implies (F[;](z,f)).x = F.(z,f.x); theorem f|A = g|A implies (F[;](x,f))|A = (F[;](x,g))|A; theorem F[;](x,f)*h = F[;](x,f*h); theorem F[;](x,f)*id A = F[;](x,f|A); reserve X for non empty set, Y for set, F for BinOp of X, f,g,h for Function of Y,X, x,x1,x2 for Element of X; theorem F.:(f,g) is Function of Y,X; definition let X be non empty set, Z be set; let F be BinOp of X, f,g be Function of Z,X; redefine func F.:(f,g) -> Function of Z,X; end; reserve Y for non empty set, F for BinOp of X, f,g,h for Function of Y,X, x, x1,x2 for Element of X; theorem for z being Element of Y holds (F.:(f,g)).z = F.(f.z,g.z); theorem for h being Function of Y,X holds (for z being Element of Y holds h.z = F.(f.z,g.z)) implies h = F.:(f,g); theorem for g being Function of X,X holds F.:(id X, g)*f = F.:(f,g*f); theorem for g being Function of X,X holds F.:(g, id X)*f = F.:(g*f,f); theorem F.:(id X, id X)*f = F.:(f,f); theorem for g being Function of X,X holds F.:(id X, g).x = F.(x,g.x); theorem for g being Function of X,X holds F.:(g, id X).x = F.(g.x,x); theorem F.:(id X, id X).x = F.(x,x); theorem for A,B for x being set st x in B holds A --> x is Function of A , B; definition let I,i be set; redefine func I --> i -> Function of I,{i}; end; definition let B be non empty set, A be set, b be Element of B; redefine func A --> b -> Function of A,B; end; theorem for A,X,x holds A --> x is Function of A, X; reserve Y for set, F for BinOp of X, f,g,h for Function of Y,X, x,x1,x2 for Element of X; theorem F[:](f,x) is Function of Y,X; definition let X be non empty set, Z be set; let F be BinOp of X, f be Function of Z,X, x be Element of X; redefine func F[:](f,x) -> Function of Z,X; end; reserve Y for non empty set, F for BinOp of X, f,g,h for Function of Y,X, x, x1,x2 for Element of X; theorem for y being Element of Y holds (F[:](f,x)).y = F.(f.y,x); theorem (for y being Element of Y holds g.y = F.(f.y,x)) implies g = F [:](f,x); theorem F[:](id X, x)*f = F[:](f,x); theorem F[:](id X, x).x = F.(x,x); reserve Y for set, F for BinOp of X, f,g,h for Function of Y,X, x,x1,x2 for Element of X; theorem F[;](x,g) is Function of Y,X; definition let X be non empty set, Z be set; let F be BinOp of X, x be Element of X; let g be Function of Z,X; redefine func F[;](x,g) -> Function of Z,X; end; reserve Y for non empty set, F for BinOp of X, f,g,h for Function of Y,X, x, x1,x2 for Element of X; theorem for y being Element of Y holds (F[;](x,f)).y = F.(x,f.y); theorem (for y being Element of Y holds g.y = F.(x,f.y)) implies g = F [;](x,f); reserve Y for set, F for BinOp of X, f,g,h for Function of Y,X, x,x1,x2 for Element of X; theorem F[;](x, id X)*f = F[;](x,f); theorem F[;](x, id X).x = F.(x,x); theorem for X,Y,Z being non empty set for f being Function of X, [:Y,Z:] for x being Element of X holds f~.x =[(f.x)`2,(f.x)`1]; definition let X,Y,Z be non empty set; let f be Function of X, [:Y,Z:]; redefine func rng f -> Relation of Y,Z; end; definition let X,Y,Z be non empty set; let f be Function of X, [:Y,Z:]; redefine func f~ -> Function of X, [:Z,Y:]; end; theorem for X,Y,Z being non empty set for f being Function of X, [:Y,Z:] holds rng (f~) = (rng f)~; reserve y for Element of Y; theorem F is associative implies F[:](F[;](x1,f),x2) = F[;](x1,F[:](f,x2)); theorem F is associative implies F.:(F[:](f,x),g) = F.:(f,F[;](x,g)); theorem F is associative implies F.:(F.:(f,g),h) = F.:(f,F.:(g,h)); theorem F is associative implies F[;](F.(x1,x2),f) = F[;](x1,F[;](x2,f)); theorem F is associative implies F[:](f, F.(x1,x2)) = F[:](F[:](f,x1),x2); theorem F is commutative implies F[;](x,f) = F[:](f,x); theorem F is commutative implies F.:(f,g) = F.:(g,f); theorem F is idempotent implies F.:(f,f) = f; reserve Y for non empty set, F for BinOp of X, f for Function of Y,X, x for Element of X, y for Element of Y; theorem F is idempotent implies F[;](f.y,f).y = f.y; theorem F is idempotent implies F[:](f,f.y).y = f.y; theorem for F,f,g being Function st [:rng f, rng g:] c= dom F holds dom(F.:(f, g)) = dom f /\ dom g; definition let IT be Function; attr IT is Function-yielding means for x being set st x in dom IT holds IT.x is Function; end; registration cluster Function-yielding for Function; end; registration let B be Function-yielding Function, j be set; cluster B.j -> Function-like Relation-like; end; registration let F be Function-yielding Function, f be Function; cluster F * f -> Function-yielding; end; registration let B; let c be non empty set; cluster B --> c -> non-empty; end; theorem ([:X,Y:] --> z).(x,y) = z; reserve a,b,c for set; definition let a,b,c; func (a,b).-->c -> Function equals {[a,b]} --> c; end; theorem ((a,b).-->c).(a,b) = c; definition let x,y,a,b be set; func IFEQ(x,y,a,b) -> set equals a if x = y otherwise b; end; definition let D be set; let x,y be set, a,b be Element of D; redefine func IFEQ(x,y,a,b) -> Element of D; end; definition let x,y be set; func x .--> y -> set equals {x} --> y; end; registration let x,y be set; cluster x .--> y -> Function-like Relation-like; end; registration let x,y be set; cluster x .--> y -> one-to-one; end; theorem for x,y be set holds (x .--> y).x = y; theorem for a,b being set, f being Function holds a.-->b c= f iff a in dom f & f.a = b; notation let o,m,r be set; synonym (o,m) :-> r for (o,m) .--> r; end; definition let o,m,r be set; redefine func (o,m) :-> r -> Function of [:{o},{m}:],{r} means not contradiction; end; reserve x,y,z for set; theorem x in dom(x .--> y); theorem z in dom(x .--> y) implies z = x; theorem not x in A implies (x .--> y)|A = {}; notation let x,y; synonym x :-> y for x .--> y; end; definition let m,o be set; redefine func m :-> o -> Function of {m}, {o}; end; theorem for x being Element of {a} for y being Element of {b} holds ((a,b):->c ).(x,y) = c; registration let f be Function-yielding Function, C be set; cluster f|C -> Function-yielding; end; registration let A be set; let f be Function; cluster A --> f -> Function-yielding; end; registration let X,a be set; cluster X --> a -> constant; end; registration cluster non empty constant for Function; end; registration let f be constant Function, X be set; cluster f|X -> constant; end; theorem for f being non empty constant Function ex y st for x st x in dom f holds f.x = y; theorem for X being non empty set, x being set holds the_value_of (X --> x) = x; theorem for f being constant Function holds f = (dom f) --> the_value_of f; registration let X be set, Y be non empty set; cluster total for PartFunc of X,Y; end; registration let I, A be set; cluster I --> A -> I-defined; end; registration let I, A be set; cluster I .--> A -> {I}-defined; end; theorem (A --> x).:B c= {x}; registration let I be set, f be Function; cluster I .--> f -> Function-yielding; end; registration let I be set; cluster total for I-defined non-empty Function; end; theorem x .--> y is_isomorphism_of {[x,x]},{[y,y]}; theorem {[x,x]}, {[y,y]} are_isomorphic; registration let I, A be set; cluster I --> A -> total for I-defined Function; end; theorem for f being Function st x in dom f holds x .--> f.x c= f; registration let A be non empty set; let x be set, i be Element of A; cluster x .--> i -> A-valued; end; reserve Y for set, f,g for Function of Y,X, x for Element of X, y for Element of Y; theorem F is associative implies F.:(F[;](x,f),g) = F[;](x,F.:(f,g)); registration let A be set, B be non empty set, x be Element of B; cluster A --> x -> B-valued; end; registration let A be non empty set, x be Element of A, y be set; cluster x .--> y -> A-defined; end; theorem for x,y,A being set st x in A holds (x .--> y)|A = x .--> y; registration let Y be functional set; cluster Y-valued -> Function-yielding for Function; end; definition let IT be Function; attr IT is Relation-yielding means for x be set st x in dom IT holds IT.x is Relation; end; registration cluster Function-yielding -> Relation-yielding for Function; end; registration cluster empty -> Function-yielding for Function; end; theorem for X,Y,x,y being set holds X --> x tolerates Y --> y iff x = y or X misses Y ; reserve x,y,z,A for set; theorem rng(x .--> y) = {y}; theorem z in A implies (A --> x)*(y .--> z) = y .--> x; begin reserve a,b,p,x,x9,x1,x19,x2,y,y9,y1,y19,y2,z,z9,z1,z2,X,X9,Y,Y9,Z,Z9 for set; reserve A,D,D9 for non empty set; reserve f,g,h for Function; theorem (for z st z in Z holds ex x,y st z = [x,y]) implies ex X,Y st Z c= [:X,Y:]; theorem g*f = (g|rng f)*f; theorem id X c= id Y iff X c= Y; theorem X c= Y implies X --> a c= Y --> a; theorem X --> a c= Y --> b implies X c= Y; theorem X <> {} & X --> a c= Y --> b implies a = b; theorem x in dom f implies x .--> f.x c= f; theorem Y|`f|X c= f; theorem f c= g implies Y|`f|X c= Y|`g|X; definition let f,g; func f +* g -> Function means dom it = dom f \/ dom g & for x st x in dom f \/ dom g holds (x in dom g implies it.x = g.x) & (not x in dom g implies it.x = f.x); idempotence; end; theorem dom f c= dom(f+*g) & dom g c= dom(f+*g); theorem not x in dom g implies (f +* g).x = f.x; theorem x in dom(f +* g) iff x in dom f or x in dom g; theorem x in dom g implies (f+*g).x = g.x; theorem f +* g +* h = f +* (g +* h); theorem f tolerates g & x in dom f implies (f+*g).x = f.x; theorem dom f misses dom g & x in dom f implies (f +* g).x = f.x; theorem rng(f +* g) c= rng f \/ rng g; theorem rng g c= rng(f +* g); theorem dom f c= dom g implies f +* g = g; registration let f; let g be empty Function; reduce g +* f to f; reduce f +* g to f; end; theorem {} +* f = f; theorem f +* {} = f; theorem id(X) +* id(Y) = id(X \/ Y); theorem (f +* g)|(dom g) = g; theorem ((f +* g)|(dom f \ dom g)) c= f; theorem g c= f +* g; theorem f tolerates g +* h implies f|(dom f \ dom h) tolerates g; theorem f tolerates g +* h implies f tolerates h; theorem f tolerates g iff f c= f +* g; theorem f +* g c= f \/ g; theorem f tolerates g iff f \/ g = f +* g; theorem dom f misses dom g implies f \/ g = f +* g; theorem dom f misses dom g implies f c= f +* g; theorem dom f misses dom g implies (f +* g)|(dom f) = f; theorem f tolerates g iff f +* g = g +* f; theorem dom f misses dom g implies f +* g = g +* f; theorem for f,g being PartFunc of X,Y st g is total holds f +* g = g; theorem for f,g being Function of X,Y st Y = {} implies X = {} holds f +* g = g; theorem for f,g being Function of X,X holds f +* g = g; theorem for f,g being Function of X,D holds f +* g = g; theorem for f,g being PartFunc of X,Y holds f +* g is PartFunc of X,Y; definition let f; func ~f -> Function means (for x holds x in dom it iff ex y,z st x = [z,y] & [y,z] in dom f) & for y,z st [y,z] in dom f holds it.(z,y) = f.(y,z); end; theorem rng ~f c= rng f; theorem [x,y] in dom f iff [y,x] in dom ~f; theorem [y,x] in dom ~f implies (~f).(y,x) = f.(x,y); theorem ex X,Y st dom ~f c= [:X,Y:]; theorem dom f c= [:X,Y:] implies dom ~f c= [:Y,X:]; theorem dom f = [:X,Y:] implies dom ~f = [:Y,X:]; theorem dom f c= [:X,Y:] implies rng ~f = rng f; theorem for f being PartFunc of [:X,Y:],Z holds ~f is PartFunc of [:Y,X:],Z; theorem for f being Function of [:X,Y:],Z st Z<>{} holds ~f is Function of [:Y,X:],Z; theorem for f being Function of [:X,Y:],D holds ~f is Function of [:Y,X:],D; theorem ~~f c= f; theorem dom f c= [:X,Y:] implies ~~f = f; theorem for f being PartFunc of [:X,Y:],Z holds ~~f = f; definition let f,g; func |:f,g:| -> Function means (for z holds z in dom it iff ex x,y,x9 ,y9 st z = [[x,x9],[y,y9]] & [x,y] in dom f & [x9,y9] in dom g) & for x,y,x9,y9 st [x,y] in dom f & [x9,y9] in dom g holds it.([x,x9],[y,y9]) = [f.(x,y),g.(x9, y9)]; end; theorem [[x,x9],[y,y9]] in dom |:f,g:| iff [x,y] in dom f & [x9,y9] in dom g; theorem [[x,x9],[y,y9]] in dom |:f,g:| implies |:f,g:|.([x,x9],[y,y9]) = [f.(x ,y),g.(x9,y9)]; theorem rng |:f,g:| c= [:rng f,rng g:]; theorem dom f c= [:X,Y:] & dom g c= [:X9,Y9:] implies dom|:f,g:| c= [:[: X,X9:],[:Y,Y9:]:]; theorem dom f = [:X,Y:] & dom g = [:X9,Y9:] implies dom|:f,g:| = [:[:X,X9:],[:Y,Y9:]:]; theorem for f being PartFunc of [:X,Y:],Z for g being PartFunc of [:X9,Y9:],Z9 holds |:f,g:| is PartFunc of [:[:X,X9:],[:Y,Y9:]:],[:Z,Z9:]; theorem for f being Function of [:X,Y:],Z for g being Function of [:X9, Y9:],Z9 st Z <> {} & Z9 <> {} holds |:f,g:| is Function of [:[:X,X9:],[:Y,Y9:] :],[:Z,Z9:]; theorem for f being Function of [:X,Y:],D for g being Function of [:X9,Y9:],D9 holds |:f,g:| is Function of [:[:X,X9:],[:Y,Y9:]:],[:D,D9:]; definition let x,y,a,b be set; func (x,y) --> (a,b) -> set equals (x .--> a) +* (y .--> b); end; registration let x,y,a,b be set; cluster (x,y) --> (a,b) -> Function-like Relation-like; end; theorem dom((x1,x2) --> (y1,y2)) = {x1,x2} & rng((x1,x2) --> (y1,y2)) c= {y1,y2}; theorem (x1 <> x2 implies ((x1,x2) --> (y1,y2)).x1 = y1) & ((x1,x2) --> (y1,y2)).x2 = y2; theorem x1 <> x2 implies rng((x1,x2) --> (y1,y2)) = {y1,y2}; theorem (x1,x2) --> (y,y) = {x1,x2} --> y; definition let A,x1,x2; let y1,y2 be Element of A; redefine func (x1,x2) --> (y1,y2) -> Function of {x1,x2},A; end; theorem for a,b,c,d being set, g being Function st dom g = {a,b} & g.a = c & g .b = d holds g = (a,b) --> (c,d); theorem for a,b,c,d being set st a <> c holds (a,c) --> (b,d) = { [a,b], [c,d] }; theorem for a,b,x,y,x9,y9 being set st a <> b & (a,b) --> (x,y) = (a,b) --> ( x9,y9) holds x = x9 & y = y9; begin theorem for f1,f2, g1,g2 being Function st rng g1 c= dom f1 & rng g2 c= dom f2 & f1 tolerates f2 holds (f1+*f2)*(g1+*g2) = (f1*g1)+*(f2*g2); reserve A,B for set; theorem dom f c= A \/ B implies f|A +* f|B = f; theorem for p,q being Function , A being set holds (p +* q)|A = p|A +* q|A; theorem for f,g being Function, A being set st A misses dom g holds (f +* g)|A = f|A; theorem for f,g being Function , A being set holds dom f misses A implies (f +* g)|A = g|A; theorem for f,g,h being Function st dom g = dom h holds f +* g +* h = f +* h; theorem for f being Function, A being set holds f +* f|A = f; theorem for f,g being Function, B,C being set st dom f c= B & dom g c= C & B misses C holds (f +* g)|B = f & (f +* g)|C = g; theorem for p,q being Function, A being set holds dom p c= A & dom q misses A implies (p +* q)|A = p; theorem for f being Function, A,B being set holds f|(A \/ B) = f|A +* f|B; reserve x,y,i,j,k for set; theorem (i,j):->k = [i,j].-->k; theorem ((i,j):->k).(i,j) = k; theorem for a,b,c being set holds (a,a) --> (b,c) = a .--> c; theorem for x,y holds x .--> y = {[x,y]}; theorem for f being Function, a,b,c being set st a <> c holds (f +* (a .-->b)) .c = f.c; theorem for f being Function, a,b,c,d being set st a <> b holds (f +* ((a,b)-->(c,d))) .a = c & (f +* ((a,b)-->(c,d))) .b = d; theorem for a,b being set, f being Function st a in dom f & f.a = b holds a .--> b c= f; theorem for a,b,c,d being set, f being Function st a in dom f & c in dom f & f.a = b & f.c = d holds (a,c) --> (b,d) c= f; theorem for f,g,h being Function st f c= h & g c= h holds f +* g c= h; theorem for f, g being Function, A being set st A /\ dom f c= A /\ dom g holds (f+*g|A)|A = g|A; theorem for f be Function, a,b,n,m be set holds (f +* (a .--> b) +* (m .--> n)).m = n; theorem for f be Function, n,m be set holds (f +* (n .--> m) +* (m .--> n)).n= m; theorem for f be Function, a,b,n,m,x be set st x <> m & x <> a holds (f +* (a .--> b) +* (m .--> n)).x=f.x; theorem f is one-to-one & g is one-to-one & rng f misses rng g implies f+*g is one-to-one; registration let f,g be Function; reduce f +* g +* g to f +* g; end; theorem for f,g being Function holds f +* g +* g = f +* g; theorem for f,g,h being Function, D being set holds (f +* g)|D =h | D implies (h +* g) | D = (f +* g) | D; theorem for f,g,h being Function, D being set holds f | D =h | D implies (h +* g) | D = (f +* g) | D; theorem x .--> x = id{x}; theorem f c= g implies f+*g = g; theorem f c= g implies g+*f = g; begin definition let f,x,y; func f+~(x,y) equals f+*((x .--> y)*f); end; registration let f,x,y; cluster f+~(x,y) -> Relation-like Function-like; end; theorem dom(f+~(x,y)) = dom f; theorem x <> y implies not x in rng(f+~(x,y)); theorem x in rng f implies y in rng(f+~(x,y)); theorem f+~(x,x) = f; theorem not x in rng f implies f+~(x,y) = f; theorem rng(f+~(x,y)) c= rng f \ {x} \/ {y}; theorem f.z <> x implies (f+~(x,y)).z = f.z; theorem z in dom f & f.z = x implies (f+~(x,y)).z = y; theorem not x in dom f implies f c= f +*(x .--> y); theorem for f being PartFunc of X,Y, x,y st x in X & y in Y holds f+*(x .--> y ) is PartFunc of X,Y; registration let f be Function, g be non empty Function; cluster f +* g -> non empty; cluster g +* f -> non empty; end; registration let f,g be non-empty Function; cluster f+*g -> non-empty; end; definition let X,Y be set; let f,g be PartFunc of X,Y; redefine func f+* g -> PartFunc of X,Y; end; theorem dom ((x --> y)+*(x .-->z)) = succ x; theorem dom ((x --> y)+*(x .-->z)+*(succ x .-->z)) = succ succ x; registration let f,g be Function-yielding Function; cluster f+*g -> Function-yielding; end; registration let I be set; let f,g be I-defined Function; cluster f+*g -> I-defined; end; registration let I be set; let f be total I-defined Function; let g be I-defined Function; cluster f+*g -> total for I-defined Function; cluster g+*f -> total for I-defined Function; end; registration let I be set; let g,h be I-valued Function; cluster g+*h -> I-valued; end; registration let f be Function; let g,h be f-compatible Function; cluster g+*h -> f-compatible; end; theorem f|A +* f = f; theorem for R being Relation st dom R = {x} & rng R = {y} holds R = x .--> y; theorem (f +* (x .-->y)).x = y; theorem f +* (x .--> z1) +* (x .--> z2) = f +* (x .--> z2); registration let A be non empty set, a,b be Element of A, x,y be set; cluster (a,b) --> (x,y) -> A-defined; end; theorem dom g misses dom h implies f +* g +* h +* g = f +* g +* h; theorem dom f misses dom h & f c= g +* h implies f c= g; theorem dom f misses dom h & f c= g implies f c= g +* h; theorem dom g misses dom h implies f +* g +* h = f +* h +* g; theorem dom f misses dom g implies (f +* g) \ g = f; theorem dom f misses dom g implies f \ g = f; theorem dom g misses dom h implies (f \ g) +* h = (f +* h) \ g; theorem for f1,f2,g1,g2 being Function st f1 c= g1 & f2 c= g2 & dom f1 misses dom g2 holds f1 +* f2 c= g1 +* g2; theorem for f, g, h being Function st f c= g holds f +* h c= g +* h; theorem for f, g, h being Function st f c= g & dom f misses dom h holds f c= g +* h; registration let x, y be set; cluster x .--> y -> trivial; end; theorem for f,g,h being Function st f tolerates g & g tolerates h & h tolerates f holds f+*g tolerates h; begin theorem {} is Element of omega; begin reserve A,A1,A2,B,C,D for Ordinal, X,Y for set, x,y,a,b,c for set, L,L1,L2,L3 for T-Sequence, f for Function; scheme OrdinalInd { P[Ordinal] } : for A holds P[A] provided P[{}] and for A st P[A] holds P[succ A] and for A st A <> {} & A is limit_ordinal & for B st B in A holds P[B] holds P[A]; theorem A c= B iff succ A c= succ B; theorem union succ A = A; theorem succ A c= bool A; theorem {} is limit_ordinal; theorem union A c= A; definition let L; func last L -> set equals L.(union dom L); end; theorem dom L = succ A implies last L = L.A; theorem On X c= X; theorem On A = A; theorem X c= Y implies On X c= On Y; theorem Lim X c= X; theorem X c= Y implies Lim X c= Lim Y; theorem Lim X c= On X; theorem (for x st x in X holds x is Ordinal) implies meet X is Ordinal; registration cluster limit_ordinal for Ordinal; end; definition let X; func inf X -> Ordinal equals meet On X; func sup X -> Ordinal means On X c= it & for A st On X c= A holds it c= A; end; theorem A in X implies inf X c= A; theorem On X <> {} & (for A st A in X holds D c= A) implies D c= inf X; theorem A in X & X c= Y implies inf Y c= inf X; theorem A in X implies inf X in X; theorem sup A = A; theorem A in X implies A in sup X; theorem (for A st A in X holds A in D) implies sup X c= D; theorem A in sup X implies ex B st B in X & A c= B; theorem X c= Y implies sup X c= sup Y; theorem sup { A } = succ A; theorem inf X c= sup X; scheme TSLambda { A()->Ordinal, F(Ordinal)->set } : ex L st dom L = A() & for A st A in A() holds L.A = F(A); definition let f; attr f is Ordinal-yielding means ex A st rng f c= A; end; registration cluster Ordinal-yielding for T-Sequence; end; definition mode Ordinal-Sequence is Ordinal-yielding T-Sequence; end; registration let A; cluster -> Ordinal-yielding for T-Sequence of A; end; registration let L be Ordinal-Sequence; let A; cluster L|A -> Ordinal-yielding; end; reserve fi,psi for Ordinal-Sequence; theorem A in dom fi implies fi.A is Ordinal; registration let f be Ordinal-Sequence, a be Ordinal; cluster f.a -> ordinal; end; scheme OSLambda { A()->Ordinal, F(Ordinal)->Ordinal } : ex fi st dom fi = A() & for A st A in A() holds fi.A = F(A); scheme TSUniq1 { A()->Ordinal, B()->set, C(Ordinal,set)->set, D(Ordinal,T-Sequence) ->set, L1()->T-Sequence, L2()->T-Sequence } : L1() = L2() provided dom L1() = A() and {} in A() implies L1().{} = B() and for A st succ A in A() holds L1().(succ A) = C(A,L1().A) and for A st A in A() & A <> {} & A is limit_ordinal holds L1().A = D(A, L1()|A) and dom L2() = A() and {} in A() implies L2().{} = B() and for A st succ A in A() holds L2().(succ A) = C(A,L2().A) and for A st A in A() & A <> {} & A is limit_ordinal holds L2().A = D(A, L2()|A); scheme TSExist1 { A()->Ordinal, B()->set, C(Ordinal,set)->set, D(Ordinal,T-Sequence )->set } : ex L st dom L = A() & ({} in A() implies L.{} = B() ) & (for A st succ A in A() holds L.(succ A) = C(A,L.A) ) & for A st A in A() & A <> {} & A is limit_ordinal holds L.A = D(A,L|A); scheme TSResult { L()->T-Sequence, F(Ordinal)->set, A()->Ordinal, B()->set, C( Ordinal,set)->set, D(Ordinal,T-Sequence)->set } : for A st A in dom L() holds L ().A = F(A) provided for A,x holds x = F(A) iff ex L st x = last L & dom L = succ A & L. {} = B() & (for C st succ C in succ A holds L.succ C = C(C,L.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = D(C,L|C) and dom L() = A() and {} in A() implies L().{} = B() and for A st succ A in A() holds L().(succ A) = C(A,L().A) and for A st A in A() & A <> {} & A is limit_ordinal holds L().A = D(A,L ()|A); scheme TSDef { A()->Ordinal, B()->set, C(Ordinal,set)->set, D(Ordinal,T-Sequence)-> set } : (ex x,L st x = last L & dom L = succ A() & L.{} = B() & (for C st succ C in succ A() holds L.succ C = C(C,L.C)) & for C st C in succ A() & C <> {} & C is limit_ordinal holds L.C = D(C,L|C) ) & for x1,x2 being set st (ex L st x1 = last L & dom L = succ A() & L.{} = B() & (for C st succ C in succ A() holds L. succ C = C(C,L.C)) & for C st C in succ A() & C <> {} & C is limit_ordinal holds L.C = D(C,L|C) ) & (ex L st x2 = last L & dom L = succ A() & L.{} = B() & (for C st succ C in succ A() holds L.succ C = C(C,L.C)) & for C st C in succ A( ) & C <> {} & C is limit_ordinal holds L.C = D(C,L|C) ) holds x1 = x2; scheme TSResult0 { F(Ordinal)->set, B()->set, C(Ordinal,set)->set, D(Ordinal, T-Sequence)->set } : F({}) = B() provided for A,x holds x = F(A) iff ex L st x = last L & dom L = succ A & L. {} = B() & (for C st succ C in succ A holds L.succ C = C(C,L.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = D(C,L|C); scheme TSResultS { B()->set, C(Ordinal,set)->set, D(Ordinal,T-Sequence)->set, F( Ordinal)->set } : for A holds F(succ A) = C(A,F(A)) provided for A,x holds x = F(A) iff ex L st x = last L & dom L = succ A & L. {} = B() & (for C st succ C in succ A holds L.succ C = C(C,L.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = D(C,L|C); scheme TSResultL { L()->T-Sequence, A()->Ordinal, F(Ordinal)->set, B()->set, C( Ordinal,set)->set, D(Ordinal,T-Sequence)->set } : F(A()) = D(A(),L()) provided for A,x holds x = F(A) iff ex L st x = last L & dom L = succ A & L. {} = B() & (for C st succ C in succ A holds L.succ C = C(C,L.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = D(C,L|C) and A() <> {} & A() is limit_ordinal and dom L() = A() and for A st A in A() holds L().A = F(A); scheme OSExist { A()->Ordinal, B()->Ordinal, C(Ordinal,Ordinal)->Ordinal, D(Ordinal ,T-Sequence)->Ordinal } : ex fi st dom fi = A() & ({} in A() implies fi.{} = B( ) ) & (for A st succ A in A() holds fi.(succ A) = C(A,fi.A) ) & for A st A in A () & A <> {} & A is limit_ordinal holds fi.A = D(A,fi|A); scheme OSResult { fi()->Ordinal-Sequence, F(Ordinal)->Ordinal, A()->Ordinal, B()-> Ordinal, C(Ordinal,Ordinal)->Ordinal, D(Ordinal,T-Sequence)->Ordinal } : for A st A in dom fi() holds fi().A = F(A) provided for A,B holds B = F(A) iff ex fi st B = last fi & dom fi = succ A & fi.{} = B() & (for C st succ C in succ A holds fi.succ C = C(C,fi.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C) and dom fi() = A() and {} in A() implies fi().{} = B() and for A st succ A in A() holds fi().(succ A) = C(A,fi().A) and for A st A in A() & A <> {} & A is limit_ordinal holds fi().A = D(A, fi()|A); scheme OSDef { A()->Ordinal, B()->Ordinal, C(Ordinal,Ordinal)->Ordinal, D(Ordinal, T-Sequence)->Ordinal } : (ex A,fi st A = last fi & dom fi = succ A() & fi.{} = B() & (for C st succ C in succ A() holds fi.succ C = C(C,fi.C)) & for C st C in succ A() & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C) ) & for A1,A2 st (ex fi st A1 = last fi & dom fi = succ A() & fi.{} = B() & (for C st succ C in succ A() holds fi.succ C = C(C,fi.C)) & for C st C in succ A() & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C) ) & (ex fi st A2 = last fi & dom fi = succ A() & fi.{} = B() & (for C st succ C in succ A() holds fi.succ C = C(C,fi.C)) & for C st C in succ A() & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C) ) holds A1 = A2; scheme OSResult0 { F(Ordinal)->Ordinal, B()->Ordinal, C(Ordinal,Ordinal)->Ordinal, D(Ordinal,T-Sequence)->Ordinal } : F({}) = B() provided for A,B holds B = F(A) iff ex fi st B = last fi & dom fi = succ A & fi.{} = B() & (for C st succ C in succ A holds fi.succ C = C(C,fi.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C); scheme OSResultS { B()->Ordinal, C(Ordinal,Ordinal)->Ordinal, D(Ordinal,T-Sequence) ->Ordinal, F(Ordinal)->Ordinal } : for A holds F(succ A) = C(A,F(A)) provided for A,B holds B = F(A) iff ex fi st B = last fi & dom fi = succ A & fi.{} = B() & (for C st succ C in succ A holds fi.succ C = C(C,fi.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C); scheme OSResultL { fi()->Ordinal-Sequence, A()->Ordinal, F(Ordinal)->Ordinal, B()-> Ordinal, C(Ordinal,Ordinal)->Ordinal, D(Ordinal,T-Sequence)->Ordinal } : F(A()) = D(A(),fi()) provided for A,B holds B = F(A) iff ex fi st B = last fi & dom fi = succ A & fi.{} = B() & (for C st succ C in succ A holds fi.succ C = C(C,fi.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds fi.C = D(C,fi|C) and A() <> {} & A() is limit_ordinal and dom fi() = A() and for A st A in A() holds fi().A = F(A); definition let L; func sup L -> Ordinal equals sup rng L; func inf L -> Ordinal equals inf rng L; end; theorem sup L = sup rng L & inf L = inf rng L; definition let L; func lim_sup L -> Ordinal means ex fi st it = inf fi & dom fi = dom L & for A st A in dom L holds fi.A = sup rng (L|(dom L \ A)); func lim_inf L -> Ordinal means ex fi st it = sup fi & dom fi = dom L & for A st A in dom L holds fi.A = inf rng (L|(dom L \ A)); end; definition let A,fi; pred A is_limes_of fi means ex B st B in dom fi & for C st B c= C & C in dom fi holds fi.C = {} if A = {} otherwise for B,C st B in A & A in C ex D st D in dom fi & for E being Ordinal st D c= E & E in dom fi holds B in fi.E & fi.E in C; end; definition let fi; given A such that A is_limes_of fi; func lim fi -> Ordinal means it is_limes_of fi; end; definition let A,fi; func lim(A,fi) -> Ordinal equals lim(fi|A); end; definition let L be Ordinal-Sequence; attr L is increasing means for A,B st A in B & B in dom L holds L.A in L.B; attr L is continuous means for A,B st A in dom L & A <> {} & A is limit_ordinal & B = L.A holds B is_limes_of L|A; end; definition let A,B; func A +^ B -> Ordinal means ex fi st it = last fi & dom fi = succ B & fi.{} = A & (for C st succ C in succ B holds fi.succ C = succ(fi.C)) & for C st C in succ B & C <> {} & C is limit_ordinal holds fi.C = sup(fi|C); end; definition let A,B; func A *^ B -> Ordinal means ex fi st it = last fi & dom fi = succ A & fi.{} = {} & (for C st succ C in succ A holds fi.succ C = (fi.C)+^B) & for C st C in succ A & C <> {} & C is limit_ordinal holds fi.C = union sup(fi|C); end; registration let O be Ordinal; cluster -> ordinal for Element of O; end; definition let A,B; func exp(A,B) -> Ordinal means ex fi st it = last fi & dom fi = succ B & fi.{} = 1 & (for C st succ C in succ B holds fi.succ C = A*^(fi.C)) & for C st C in succ B & C <> {} & C is limit_ordinal holds fi.C = lim(fi|C); end; theorem A+^{} = A; theorem A+^succ B = succ(A+^B); theorem B <> {} & B is limit_ordinal implies for fi st dom fi = B & for C st C in B holds fi.C = A+^C holds A+^B = sup fi; theorem {}+^A = A; theorem A+^1 = succ A; theorem A in B implies C +^ A in C +^ B; theorem A c= B implies C +^ A c= C +^ B; theorem A c= B implies A +^ C c= B +^ C; theorem {}*^A = {}; theorem (succ B)*^A = B*^A +^ A; theorem B <> {} & B is limit_ordinal implies for fi st dom fi = B & for C st C in B holds fi.C = C*^A holds B*^A = union sup fi; theorem A*^{} = {}; theorem 1*^A = A & A*^1 = A; theorem C <> {} & A in B implies A*^C in B*^C; theorem A c= B implies A*^C c= B*^C; theorem A c= B implies C*^A c= C*^B; theorem exp(A,{}) = 1; theorem exp(A,succ B) = A*^exp(A,B); theorem B <> {} & B is limit_ordinal implies for fi st dom fi = B & for C st C in B holds fi.C = exp(A,C) holds exp(A,B) = lim fi; theorem exp(A,1) = A & exp(1,A) = 1; theorem for A ex B,C st B is limit_ordinal & C is natural & A = B +^ C; registration let X be set, o be Ordinal; cluster X --> o -> Ordinal-yielding; end; registration let O be Ordinal, x be set; cluster O --> x -> T-Sequence-like; end; definition let A,B be Ordinal; pred A is_cofinal_with B means ex xi being Ordinal-Sequence st dom xi = B & rng xi c= A & xi is increasing & A = sup xi; reflexivity; end; reserve e,u for set; theorem e in rng psi implies e is Ordinal; theorem rng psi c= sup psi; theorem A is_cofinal_with {} implies A = {}; scheme OmegaInd {a()-> Nat, P[set]}: P[a()] provided P[{}] and for a being Nat st P[a] holds P[succ a]; registration let a, b be Nat; cluster a +^ b -> natural; end; registration let x,y be set, a,b be Nat; cluster IFEQ(x,y,a,b) -> natural; end; scheme LambdaRecEx{A() -> set,G(set,set) -> set}: ex f being Function st dom f = omega & f.{} = A() & for n being Nat holds f.succ n = G(n,f.n); reserve n for Nat; scheme RecUn{A() -> set, F, G() -> Function, P[set,set,set]}: F() = G() provided dom F() = omega and F().{} = A() and for n holds P[n,F().n,F().(succ n)] and dom G() = omega and G().{} = A() and for n holds P[n,G().n,G().(succ n)] and for n for x,y1,y2 being set st P[n,x,y1] & P[n,x,y2] holds y1 = y2; scheme LambdaRecUn{A() -> set, F(set,set) -> set, F, G() -> Function}: F() = G() provided dom F() = omega and F().{} = A() and for n holds F().(succ n) = F(n,F().n) and dom G() = omega and G().{} = A() and for n holds G().(succ n) = F(n,G().n); begin reserve fi,psi for Ordinal-Sequence, A,B,C,D for Ordinal, X,Y for set, x,y for set; theorem X c= succ X; theorem succ X c= Y implies X c= Y; theorem A in B iff succ A in succ B; theorem X c= A implies union X is Ordinal; theorem union On X is Ordinal; theorem X c= A implies On X = X; theorem On {A} = {A}; theorem A <> {} implies {} in A; theorem inf A = {}; theorem inf {A} = A; theorem X c= A implies meet X is Ordinal; registration let A,B; cluster A \/ B -> ordinal; cluster A /\ B -> ordinal; end; theorem A \/ B = A or A \/ B = B; theorem A /\ B = A or A /\ B = B; theorem A in 1 implies A = {}; theorem 1 = {{}}; theorem A c= 1 implies A = {} or A = 1; theorem (A c= B or A in B) & C in D implies A+^C in B+^D; theorem A c= B & C c= D implies A+^C c= B+^D; theorem A in B & (C c= D & D <> {} or C in D) implies A*^C in B*^D; theorem A c= B & C c= D implies A*^C c= B*^D; theorem B+^C = B+^D implies C = D; theorem B+^C in B+^D implies C in D; theorem B+^C c= B+^D implies C c= D; theorem A c= A+^B & B c= A+^B; theorem A in B implies A in B+^C & A in C+^B; theorem A+^B = {} implies A = {} & B = {}; theorem A c= B implies ex C st B = A+^C; theorem A in B implies ex C st B = A+^C & C <> {}; theorem A <> {} & A is limit_ordinal implies B+^A is limit_ordinal; theorem A+^B+^C = A+^(B+^C); theorem A*^B = {} implies A = {} or B = {}; theorem A in B & C <> {} implies A in B*^C & A in C*^B; theorem B*^A = C*^A & A <> {} implies B = C; theorem B*^A in C*^A implies B in C; theorem B*^A c= C*^A & A <> {} implies B c= C; theorem B <> {} implies A c= A*^B & A c= B*^A; theorem A*^B = 1 implies A = 1 & B = 1; theorem A in B+^C implies A in B or ex D st D in C & A = B+^D; definition let C,fi; func C+^fi -> Ordinal-Sequence means dom it = dom fi & for A st A in dom fi holds it.A = C+^(fi.A); func fi+^C -> Ordinal-Sequence means dom it = dom fi & for A st A in dom fi holds it.A = (fi.A)+^C; func C*^fi -> Ordinal-Sequence means dom it = dom fi & for A st A in dom fi holds it.A = C*^(fi.A); func fi*^C -> Ordinal-Sequence means dom it = dom fi & for A st A in dom fi holds it.A = (fi.A)*^C; end; theorem {} <> dom fi & dom fi = dom psi & (for A,B st A in dom fi & B = fi.A holds psi.A = C+^B) implies sup psi = C+^sup fi; theorem A is limit_ordinal implies A*^B is limit_ordinal; theorem A in B*^C & B is limit_ordinal implies ex D st D in B & A in D*^ C; theorem dom fi = dom psi & C <> {} & sup fi is limit_ordinal & (for A,B st A in dom fi & B = fi.A holds psi.A = B*^C) implies sup psi = (sup fi)*^C; theorem {} <> dom fi implies sup (C+^fi) = C+^sup fi; theorem {} <> dom fi & C <> {} & sup fi is limit_ordinal implies sup (fi *^C) = (sup fi)*^C; theorem B <> {} implies union(A+^B) = A+^union B; theorem (A+^B)*^C = A*^C +^ B*^C; theorem A <> {} implies ex C,D st B = C*^A+^D & D in A; theorem for C1,D1,C2,D2 being Ordinal st C1*^A+^D1 = C2*^A+^D2 & D1 in A & D2 in A holds C1 = C2 & D1 = D2; theorem 1 in B & A <> {} & A is limit_ordinal implies for fi st dom fi = A & for C st C in A holds fi.C = C*^B holds A*^B = sup fi; theorem (A*^B)*^C = A*^(B*^C); definition let A,B; func A -^ B -> Ordinal means A = B+^it if B c= A otherwise it = {}; func A div^ B -> Ordinal means ex C st A = it*^B+^C & C in B if B <> {} otherwise it = {}; end; definition let A,B; func A mod^ B -> Ordinal equals A-^(A div^ B)*^B; end; theorem A in B implies B = A+^(B-^A); theorem A+^B-^A = B; theorem A in B & (C c= A or C in A) implies A-^C in B-^C; theorem A-^A = {}; theorem A in B implies B-^A <> {} & {} in B-^A; theorem A-^{} = A & {}-^A = {}; theorem A-^(B+^C) = (A-^B)-^C; theorem A c= B implies C-^B c= C-^A; theorem A c= B implies A-^C c= B-^C; theorem C <> {} & A in B+^C implies A-^B in C; theorem A+^B in C implies B in C-^A; theorem A c= B+^(A-^B); theorem A*^C -^ B*^C = (A-^B)*^C; theorem (A div^ B)*^B c= A; theorem A = (A div^ B)*^B+^(A mod^ B); theorem A = B*^C+^D & D in C implies B = A div^ C & D = A mod^ C; theorem A in B*^C implies A div^ C in B & A mod^ C in C; theorem B <> {} implies A*^B div^ B = A; theorem A*^B mod^ B = {}; theorem {} div^ A = {} & {} mod^ A = {} & A mod^ {} = A; theorem A div^ 1 = A & A mod^ 1 = {}; begin theorem sup X c= succ union On X; reserve e,u for set; theorem succ A is_cofinal_with 1; theorem for a,b being Ordinal st a+^b is natural holds a in omega & b in omega; registration let a, b be natural Ordinal; cluster a -^ b -> natural; cluster a *^ b -> natural; end; theorem for a,b being Ordinal st a*^b is natural non empty holds a in omega & b in omega; definition let a,b be natural Ordinal; redefine func a+^b; commutativity; end; definition let a,b be natural Ordinal; redefine func a*^b; commutativity; end; begin reserve a,b,x,y,z,z1,z2,z3,y1,y3,y4,A,B,C,D,G,M,N,X,Y,Z,W0,W00 for set, R,S,T, W,W1,W2 for Relation, F,H,H1 for Function; theorem x in field R iff ex y st ([x,y] in R or [y,x] in R); theorem X <> {} & Y <> {} & W = [: X,Y :] implies field W = X \/ Y; scheme RSeparation { A()-> set, P[Relation] } : ex B st for R being Relation holds R in B iff R in A() & P[R]; theorem for x,y,W st x in field W & y in field W & W is well-ordering holds not x in W-Seg(y) implies [y,x] in W; theorem for x,y,W st x in field W & y in field W & W is well-ordering holds x in W-Seg(y) implies not [y,x] in W; theorem for F,D st (for X st X in D holds not F.X in X & F.X in union D) ex R st field R c= union D & R is well-ordering & not field R in D & for y st y in field R holds R-Seg(y) in D & F.(R-Seg(y)) = y; theorem for N ex R st R is well-ordering & field R = N; begin definition let f be Function; let a,b,c be set; func f.(a,b,c) -> set equals f.[a,b,c]; end; reserve A,B,C,D,E for non empty set, a for Element of A, b for Element of B, c for Element of C, d for Element of D, X,Y,Z,S,x,y,z,s,t for set; definition let A,B,C,D; let f be Function of [:A,B,C:],D; let a,b,c; redefine func f.(a,b,c) -> Element of D; end; theorem for f1,f2 being Function of [:X,Y,Z:],D st for x,y,z st x in X & y in Y & z in Z holds f1.[x,y,z] = f2.[x,y,z] holds f1 = f2; theorem for f1,f2 being Function of [:A,B,C:],D st for a,b,c holds f1.[a, b,c] = f2.[a,b,c] holds f1 = f2; theorem for f1,f2 being Function of [:A,B,C:],D st for a being Element of A for b being Element of B for c being Element of C holds f1.(a,b,c) = f2.(a,b,c) holds f1 = f2; definition let A be set; mode TriOp of A is Function of [:A,A,A:],A; end; scheme FuncEx3D { X,Y,Z,T() -> non empty set, P[set,set,set,set] } : ex f being Function of [:X(),Y(),Z():],T() st for x being Element of X() for y being Element of Y() for z being Element of Z() holds P[x,y,z,f.[x,y,z]] provided for x being Element of X() for y being Element of Y() for z being Element of Z() ex t being Element of T() st P[x,y,z,t]; scheme TriOpEx { A()->non empty set, P[ Element of A(), Element of A(), Element of A(), Element of A()] }: ex o being TriOp of A() st for a,b,c being Element of A () holds P[a,b,c,o.(a,b,c)] provided for x,y,z being Element of A() ex t being Element of A() st P[x,y,z, t]; scheme Lambda3D { X, Y, Z, T()->non empty set, F( Element of X(), Element of Y(), Element of Z()) -> Element of T() }: ex f being Function of [:X(),Y(),Z():],T() st for x being Element of X() for y being Element of Y() for z being Element of Z() holds f.[x,y,z]=F(x,y,z); scheme TriOpLambda { A,B,C,D()->non empty set, O( Element of A(), Element of B(), Element of C()) -> Element of D() }: ex o being Function of [:A(),B(),C():],D() st for a being Element of A(), b being Element of B(), c being Element of C() holds o.(a,b,c) = O(a,b,c); definition let f be Function; let a,b,c,d be set; func f.(a,b,c,d) -> set equals f.[a,b,c,d]; end; definition let A,B,C,D,E; let f be Function of [:A,B,C,D:],E; let a,b,c,d; redefine func f.(a,b,c,d) -> Element of E; end; theorem for f1,f2 being Function of [:X,Y,Z,S:],D st for x,y,z,s st x in X & y in Y & z in Z & s in S holds f1.[x,y,z,s] = f2.[x,y,z,s] holds f1 = f2; theorem for f1,f2 being Function of [:A,B,C,D:],E st for a,b,c,d holds f1 .[a,b,c,d] = f2.[a,b,c,d] holds f1 = f2; theorem for f1,f2 being Function of [:A,B,C,D:],E st for a,b,c,d holds f1.(a,b ,c,d) = f2.(a,b,c,d) holds f1 = f2; definition let A; mode QuaOp of A is Function of [:A,A,A,A:],A; end; scheme FuncEx4D { X, Y, Z, S, T() -> non empty set, P[set,set,set,set,set] }: ex f being Function of [:X(),Y(),Z(),S():],T() st for x being Element of X() for y being Element of Y() for z being Element of Z() for s being Element of S() holds P[x,y,z,s,f.[x,y,z,s]] provided for x being Element of X() for y being Element of Y() for z being Element of Z() for s being Element of S() ex t being Element of T() st P[x,y,z, s,t]; scheme QuaOpEx { A()->non empty set, P[ Element of A(), Element of A(), Element of A(), Element of A(), Element of A()] }: ex o being QuaOp of A() st for a,b,c,d being Element of A() holds P[a,b,c,d,o.(a,b,c,d)] provided for x,y,z,s being Element of A() ex t being Element of A() st P[x,y, z,s,t]; scheme Lambda4D { X, Y, Z, S, T() -> non empty set, F( Element of X(), Element of Y (), Element of Z(), Element of S()) -> Element of T() }: ex f being Function of [:X(),Y(),Z(),S():],T() st for x being Element of X() for y being Element of Y( ) for z being Element of Z() for s being Element of S() holds f.[x,y,z,s]=F(x,y ,z,s); scheme QuaOpLambda { A()->non empty set, O( Element of A(), Element of A(), Element of A(), Element of A()) -> Element of A() }: ex o being QuaOp of A() st for a,b ,c,d being Element of A() holds o.(a,b,c,d) = O(a,b,c,d); begin reserve a,b,d for set; scheme Schemat0 {P[set]} : ex a st P[a] provided for a holds P[a]; scheme Schemat3 {S[set,set]} : for b ex a st S[a,b] provided ex a st for b holds S[a,b]; scheme Schemat8 {P[set],Q[set]} : (for a holds P[a]) implies for a holds Q[a] provided for a holds P[a] implies Q[a]; scheme Schemat9 {P[set],Q[set]} : (for a holds P[a]) iff for a holds Q[a] provided for a holds P[a] iff Q[a]; scheme Schemat17 {P[set],T[]} : (for a holds P[a]) implies T[] provided for a holds P[a] implies T[]; scheme Schemat18a {P[set],Q[set]} : ex a st for b holds P[a] or Q[b] provided (ex a st P[a]) or for b holds Q[b]; scheme Schemat18b {P[set],Q[set]} : (ex a st P[a]) or for b holds Q[b] provided ex a st for b holds P[a] or Q[b]; scheme Schemat20b {P[set],Q[set]} : ex a st for b holds P[a] or Q[b] provided for b ex a st P[a] or Q[b]; scheme Schemat22a {P[set],Q[set]} : for b ex a st P[a] & Q[b] provided (ex a st P[a]) & for b holds Q[b]; scheme Schemat22b {P[set],Q[set]} : (ex a st P[a]) & for b holds Q[b] provided for b ex a st P[a] & Q[b]; scheme Schemat23b {P[set],Q[set]} : ex a st for b holds P[a] & Q[b] provided for b ex a st P[a] & Q[b]; scheme Schemat28 {S[set,set]} : ex b st for a holds S[a,b] provided for a,b holds S[a,b]; scheme Schemat30 {S[set,set]} : ex a st S[a,a] provided ex a st for b holds S[a,b]; scheme Schemat31 {S[set,set]} : for a ex b st S[b,a] provided for a holds S[a,a]; scheme Schemat33 {S[set,set]} : for a ex b st S[a,b] provided for a holds S[a,a]; scheme Schemat36 {S[set,set]} : ex a,b st S[a,b] provided for b ex a st S[a,b]; begin reserve x,y,z,t,X,Y,Z,W for set; reserve R,S,T for Relation; theorem dom (R /\ [:X,Y:]) c= X & rng (R /\ [:X,Y:]) c= Y; theorem X misses Y implies dom (R /\ [:X,Y:]) misses rng (R /\ [:X,Y:]); theorem R c= [:X,Y:] implies dom R c= X & rng R c= Y; theorem R c= [:X,Y:] implies R~ c= [:Y,X:]; theorem [:X,Y:]~ = [:Y,X:]; theorem (R \/ S) * T = (R * T) \/ (S * T); theorem (X misses Y & R c= [:X,Y:] \/ [:Y,X:] & [x,y] in R & x in X implies not x in Y & not y in X & y in Y) & (X misses Y & R c= [:X,Y:] \/ [:Y,X:] & [x,y] in R & y in Y implies not y in X & not x in Y & x in X) & (X misses Y & R c= [:X,Y:] \/ [:Y,X:] & [x,y] in R & x in Y implies not x in X & not y in Y & y in X) & (X misses Y & R c= [:X,Y:] \/ [:Y,X:] & [x,y] in R & y in X implies not x in X & not y in Y & x in Y); theorem R c= [:X,Y:] implies R|Z = R /\ [:Z,Y:] & (Z|`R) = R /\ [:X,Z:]; theorem R c= [:X,Y:] & X = Z \/ W implies R = (R|Z) \/ (R|W); theorem X misses Y & R c= [:X,Y:] \/ [:Y,X:] implies R|X c= [:X,Y:]; theorem R c= S implies R~ c= S~; theorem id(X) * id(X) = id X; theorem id({x}) = {[x,x]}; theorem id(X \/ Y) = id(X) \/ id(Y) & id(X /\ Y) = id(X) /\ id(Y) & id(X \ Y) = id(X) \ id(Y); theorem X c= Y implies id X c= id Y; theorem id(X \ Y) \ id X = {}; theorem R c= id dom R implies R = id dom R; theorem id X c= R \/ R~ implies id X c= R & id X c= R~; theorem id X c= R implies id X c= R~; theorem R c= [:X,X:] implies R \ id dom R = R \ id X & R \ id rng R = R \ id X; theorem (id(X) * (R \ id X) = {} implies dom (R \ id X) = dom R \ X) & ((R \ id X) * id X = {} implies rng (R \ id X) = rng R \ X); theorem (R c= R * R & R * (R \ id rng R) = {} implies id rng R c= R) & (R c= R * R & (R \ id dom R) * R = {} implies id dom R c= R); theorem (R c= R * R & R * (R \ id rng R) = {} implies R /\ (id rng R) = id rng R) & (R c= R * R & (R \ id dom R) * R = {} implies R /\ (id dom R) = id dom R); theorem (R * (R \ id X) = {} implies R * (R \ id rng R) = {}) & ((R \ id X) * R = {} implies (R \ id dom R) * R = {}); definition let R; func CL R -> Relation equals R /\ id dom R; end; theorem [x,y] in CL R implies x in dom CL R & x = y; theorem dom CL R = rng CL R; theorem (x in dom CL R iff x in dom R & [x,x] in R) & (x in rng CL R iff x in dom R & [x,x] in R) & (x in rng CL R iff x in rng R & [x,x] in R) & (x in dom CL R iff x in rng R & [x,x] in R); theorem CL R = id dom CL R; theorem (R * R = R & R * (R \ CL R) = {} & [x,y] in R & x <> y implies x in (dom R \ dom CL R) & y in dom CL R) & (R * R = R & (R \ CL R) * R = {} & [x,y] in R & x <> y implies y in (rng R \ dom CL R) & x in dom CL R); theorem (R * R = R & R * (R \ id dom R) = {} & [x,y] in R & x <> y implies x in ((dom R) \ dom CL R) & y in dom CL R) & (R * R = R & (R \ id dom R) * R = {} & [x,y] in R & x <> y implies y in ((rng R) \ dom CL R) & x in dom CL R); theorem (R * R = R & R * (R \ id dom R) = {} implies dom CL R = rng R & rng CL R = rng R) & (R * R = R & (R \ id dom R) * R = {} implies dom CL R = dom R & rng CL R = dom R); theorem dom CL R c= dom R & rng CL R c= rng R & rng CL R c= dom R & dom CL R c= rng R ; theorem id dom CL R c= id dom R & id rng CL R c= id dom R; theorem id dom CL R c= R & id rng CL R c= R; theorem (id X c= R & id(X) * (R \ id X) = {} implies R|X = id X) & (id X c= R & (R \ id X) * id X = {} implies X|`R = id X); theorem (id(dom CL R) * (R \ id(dom CL R)) = {} implies R|(dom CL R) = id dom CL R & R|(rng CL R) = id dom CL R) & ((R \ id rng CL R) * id(rng CL R) = {} implies (dom CL R)|`R = id dom CL R & (rng CL R)|`R = id rng CL R); theorem (R * (R \ id dom R) = {} implies id(dom CL R) * (R \ id dom CL R) = {}) & ((R \ id dom R) * R = {} implies (R \ id dom CL R) * id dom CL R = {}); theorem (S * R = S & R * (R \ id dom R) = {} implies S * (R \ id dom R) = {}) & (R * S = S & (R \ id dom R) * R = {} implies (R \ id dom R) * S = {}); theorem (S * R = S & R * (R \ id dom R) = {} implies CL(S) c= CL(R)) & (R * S = S & (R \ id dom R) * R = {} implies CL(S) c= CL(R)); theorem (S * R = S & R * (R \ id dom R) = {} & R * S = R & S * (S \ id dom S) = {} implies CL S = CL R) & (R * S = S & (R \ id dom R) * R = {} & S * R = R & (S \ id dom S) * S = {} implies CL S = CL R); begin definition let a be set; func NOT1 a equals {} if a is non empty otherwise {{}}; end; registration let a be empty set; cluster NOT1 a -> non empty; end; registration let a be non empty set; cluster NOT1 a -> empty; end; theorem NOT1 {{}} = {} & NOT1 {} = {{}}; theorem for a being set holds NOT1 a is non empty iff not a is non empty; reserve a,b,c,d,e,f,g,h for set; theorem NOT1 {} is non empty; definition let a,b be set; func AND2(a,b) equals NOT1 {} if a is non empty & b is non empty otherwise {}; commutativity; end; registration let a,b be non empty set; cluster AND2(a,b) -> non empty; end; registration let a be empty set, b be set; cluster AND2(a,b) -> empty; end; theorem AND2(a,b) is non empty iff a is non empty & b is non empty; definition let a,b be set; func OR2(a, b) equals NOT1 {} if a is non empty or b is non empty otherwise {}; commutativity; end; registration let a be set,b be non empty set; cluster OR2(a,b) -> non empty; end; registration let a,b be empty set; cluster OR2(a,b) -> empty; end; theorem OR2(a,b) is non empty iff (a is non empty or b is non empty); definition let a,b be set; func XOR2(a,b) equals NOT1 {} if a is non empty & not b is non empty or not a is non empty & b is non empty otherwise {}; commutativity; end; registration let a be empty set,b be non empty set; cluster XOR2(a,b) -> non empty; end; registration let a,b be empty set; cluster XOR2(a,b) -> empty; end; registration let a,b be non empty set; cluster XOR2(a,b) -> empty; end; theorem XOR2(a, b) is non empty iff a is non empty & not b is non empty or not a is non empty & b is non empty; theorem not XOR2(a,a) is non empty; theorem XOR2(a,{}) is non empty iff a is non empty; theorem XOR2(a,b) is non empty iff XOR2(b,a) is non empty; definition let a,b be set; func EQV2(a, b) equals NOT1 {} if a is non empty iff b is non empty otherwise {}; commutativity; end; registration let a be empty set,b be non empty set; cluster EQV2(a,b) -> empty; end; registration let a,b be empty set; cluster EQV2(a,b) -> non empty; end; registration let a,b be non empty set; cluster EQV2(a,b) -> non empty; end; theorem EQV2(a, b) is non empty iff (a is non empty iff b is non empty); theorem EQV2(a,b) is non empty iff not XOR2(a,b) is non empty; definition let a,b be set; func NAND2(a, b) equals NOT1 {} if not (a is non empty & b is non empty) otherwise {}; commutativity; end; registration let a be empty set, b be set; cluster NAND2(a,b) -> non empty; end; registration let a,b be non empty set; cluster NAND2(a,b) -> empty; end; theorem NAND2(a, b) is non empty iff not (a is non empty & b is non empty); definition let a,b be set; func NOR2(a, b) equals NOT1 {} if not (a is non empty or b is non empty) otherwise {}; commutativity; end; registration let a,b be empty set; cluster NOR2(a,b) -> non empty; end; registration let a be non empty set, b be set; cluster NOR2(a,b) -> empty; end; theorem NOR2(a,b) is non empty iff not (a is non empty or b is non empty); definition let a,b,c be set; func AND3(a,b,c) equals NOT1 {} if a is non empty & b is non empty & c is non empty otherwise {}; end; registration let a,b,c be non empty set; cluster AND3(a,b,c) -> non empty; end; registration let a be empty set, b,c be set; cluster AND3(a,b,c) -> empty; cluster AND3(b,a,c) -> empty; cluster AND3(b,c,a) -> empty; end; theorem AND3(a,b,c) is non empty iff a is non empty & b is non empty & c is non empty; definition let a,b,c be set; func OR3(a,b,c) equals NOT1 {} if a is non empty or b is non empty or c is non empty otherwise {}; end; registration let a,b,c be empty set; cluster OR3(a,b,c) -> empty; end; registration let a be non empty set, b,c be set; cluster OR3(a,b,c) -> non empty; cluster OR3(b,a,c) -> non empty; cluster OR3(b,c,a) -> non empty; end; theorem OR3(a,b,c) is non empty iff a is non empty or b is non empty or c is non empty; definition let a,b,c be set; func XOR3(a,b,c) equals NOT1 {} if ( a is non empty & not b is non empty or not a is non empty & b is non empty ) & not c is non empty or not ( a is non empty & not b is non empty or not a is non empty & b is non empty ) & c is non empty otherwise {}; end; registration let a,b,c be empty set; cluster XOR3(a,b,c) -> empty; end; registration let a,b be empty set, c be non empty set; cluster XOR3(a,b,c) -> non empty; cluster XOR3(a,c,b) -> non empty; cluster XOR3(c,a,b) -> non empty; end; registration let a,b be non empty set, c be empty set; cluster XOR3(a,b,c) -> empty; cluster XOR3(a,c,b) -> empty; cluster XOR3(c,a,b) -> empty; end; registration let a,b,c be non empty set; cluster XOR3(a,b,c) -> non empty; end; theorem XOR3(a,b,c) is non empty iff ( a is non empty & not b is non empty or not a is non empty & b is non empty ) & not c is non empty or not ( a is non empty & not b is non empty or not a is non empty & b is non empty ) & c is non empty; definition let a,b,c be set; func MAJ3(a,b,c) equals NOT1 {} if a is non empty & b is non empty or b is non empty & c is non empty or c is non empty & a is non empty otherwise {}; end; registration let a,b be non empty set, c be set; cluster MAJ3(a,b,c) -> non empty; cluster MAJ3(a,c,b) -> non empty; cluster MAJ3(c,a,b) -> non empty; end; registration let a,b be empty set, c be set; cluster MAJ3(a,b,c) -> empty; cluster MAJ3(a,c,b) -> empty; cluster MAJ3(c,a,b) -> empty; end; theorem MAJ3(a,b,c) is non empty iff a is non empty & b is non empty or b is non empty & c is non empty or c is non empty & a is non empty; definition let a,b,c be set; func NAND3(a,b,c) equals NOT1 {} if not (a is non empty & b is non empty & c is non empty) otherwise {}; end; theorem NAND3(a,b,c) is non empty iff not (a is non empty & b is non empty & c is non empty); definition let a,b,c be set; func NOR3(a,b,c) equals NOT1 {} if not (a is non empty or b is non empty or c is non empty) otherwise {}; end; theorem NOR3(a,b,c) is non empty iff not (a is non empty or b is non empty or c is non empty); definition let a,b,c,d be set; func AND4(a,b,c,d) equals NOT1 {} if a is non empty & b is non empty & c is non empty & d is non empty otherwise {}; end; theorem AND4(a,b,c,d) is non empty iff a is non empty & b is non empty & c is non empty & d is non empty; definition let a,b,c,d be set; func OR4(a,b,c,d) equals NOT1 {} if a is non empty or b is non empty or c is non empty or d is non empty otherwise {}; end; theorem OR4(a,b,c,d) is non empty iff a is non empty or b is non empty or c is non empty or d is non empty; definition let a,b,c,d be set; func NAND4(a,b,c,d) equals NOT1 {} if not (a is non empty & b is non empty & c is non empty & d is non empty) otherwise {}; end; theorem NAND4(a,b,c,d) is non empty iff not (a is non empty & b is non empty & c is non empty & d is non empty); definition let a,b,c,d be set; func NOR4(a,b,c,d) equals NOT1 {} if not (a is non empty or b is non empty or c is non empty or d is non empty) otherwise {}; end; theorem NOR4(a,b,c,d) is non empty iff not (a is non empty or b is non empty or c is non empty or d is non empty); definition let a,b,c,d,e be set; func AND5(a,b,c,d,e) equals NOT1 {} if a is non empty & b is non empty & c is non empty & d is non empty & e is non empty otherwise {}; end; theorem AND5(a,b,c,d,e) is non empty iff a is non empty & b is non empty & c is non empty & d is non empty & e is non empty; definition let a,b,c,d,e be set; func OR5(a,b,c,d,e) equals NOT1 {} if a is non empty or b is non empty or c is non empty or d is non empty or e is non empty otherwise {}; end; theorem OR5(a,b,c,d,e) is non empty iff a is non empty or b is non empty or c is non empty or d is non empty or e is non empty; definition let a,b,c,d,e be set; func NAND5(a,b,c,d,e) equals NOT1 {} if not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty) otherwise {}; end; theorem NAND5(a,b,c,d,e) is non empty iff not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty); definition let a,b,c,d,e be set; func NOR5(a,b,c,d,e) equals NOT1 {} if not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty) otherwise {}; end; theorem NOR5(a,b,c,d,e) is non empty iff not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty); definition let a,b,c,d,e,f be set; func AND6(a,b,c,d,e,f) equals NOT1 {} if a is non empty & b is non empty & c is non empty & d is non empty & e is non empty &f is non empty otherwise {}; end; theorem AND6(a,b,c,d,e,f) is non empty iff a is non empty & b is non empty & c is non empty & d is non empty & e is non empty &f is non empty; definition let a,b,c,d,e,f be set; func OR6(a,b,c,d,e,f) equals NOT1 {} if a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty otherwise {}; end; theorem OR6(a,b,c,d,e,f) is non empty iff a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty; definition let a,b,c,d,e,f be set; func NAND6(a,b,c,d,e,f) equals NOT1 {} if not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty &f is non empty) otherwise {}; end; theorem NAND6(a,b,c,d,e,f) is non empty iff not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty &f is non empty); definition let a,b,c,d,e,f be set; func NOR6(a,b,c,d,e,f) equals NOT1 {} if not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty) otherwise {}; end; theorem NOR6(a,b,c,d,e,f) is non empty iff not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty); definition let a,b,c,d,e,f,g be set; func AND7(a,b,c,d,e,f,g) equals NOT1 {} if a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty otherwise {}; end; theorem AND7(a,b,c,d,e,f,g) is non empty iff a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty; definition let a,b,c,d,e,f,g be set; func OR7(a,b,c,d,e,f,g) equals NOT1 {} if a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty otherwise {}; end; theorem OR7(a,b,c,d,e,f,g) is non empty iff a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty; definition let a,b,c,d,e,f,g be set; func NAND7(a,b,c,d,e,f,g) equals NOT1 {} if not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty) otherwise {}; end; theorem NAND7(a,b,c,d,e,f,g) is non empty iff not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty); definition let a,b,c,d,e,f,g be set; func NOR7(a,b,c,d,e,f,g) equals NOT1 {} if not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty) otherwise {}; end; theorem NOR7(a,b,c,d,e,f,g) is non empty iff not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty); definition let a,b,c,d,e,f,g,h be set; func AND8(a,b,c,d,e,f,g,h) equals NOT1 {} if a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty & h is non empty otherwise {}; end; theorem AND8(a,b,c,d,e,f,g,h) is non empty iff a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty & h is non empty; definition let a,b,c,d,e,f,g,h be set; func OR8(a,b,c,d,e,f,g,h) equals NOT1 {} if a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty or h is non empty otherwise {}; end; theorem OR8(a,b,c,d,e,f,g,h) is non empty iff a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty or h is non empty; definition let a,b,c,d,e,f,g,h be set; func NAND8(a,b,c,d,e,f,g,h) equals NOT1 {} if not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty & h is non empty) otherwise {}; end; theorem NAND8(a,b,c,d,e,f,g,h) is non empty iff not (a is non empty & b is non empty & c is non empty & d is non empty & e is non empty & f is non empty & g is non empty & h is non empty); definition let a,b,c,d,e,f,g,h be set; func NOR8(a,b,c,d,e,f,g,h) equals NOT1 {} if not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty or h is non empty) otherwise {}; end; theorem NOR8(a,b,c,d,e,f,g,h) is non empty iff not (a is non empty or b is non empty or c is non empty or d is non empty or e is non empty or f is non empty or g is non empty or h is non empty); begin theorem for c1,x1,x2,x3,x4,y1,y2,y3,y4,c2,c3,c4,c5,n1,n2,n3,n4,n,c5b being set holds (MAJ3(x1,y1,c1) is non empty implies c2 is non empty) & (MAJ3(x2,y2,c2) is non empty implies c3 is non empty) & (MAJ3(x3,y3,c3) is non empty implies c4 is non empty) & (MAJ3(x4,y4,c4) is non empty implies c5 is non empty) & (n1 is non empty implies OR2(x1,y1) is non empty)& (n2 is non empty implies OR2(x2,y2) is non empty)& (n3 is non empty implies OR2(x3,y3) is non empty)& (n4 is non empty implies OR2(x4,y4) is non empty)& (n is non empty implies AND5(c1,n1,n2, n3,n4) is non empty)& (c5b is non empty iff OR2(c5,n) is non empty) implies (c5 is non empty iff c5b is non empty); definition let a,b be set; func MODADD2(a,b) equals NOT1 {} if (a is non empty or b is non empty) & not(a is non empty & b is non empty) otherwise {}; commutativity; end; theorem MODADD2(a,b) is non empty iff (a is non empty or b is non empty) & not (a is non empty & b is non empty); notation let a,b,c be set; synonym ADD1(a,b,c) for XOR3(a,b,c); synonym CARR1(a,b,c) for MAJ3(a,b,c); end; definition let a1,b1,a2,b2,c be set; func ADD2(a2,b2,a1,b1,c) equals XOR3(a2,b2,CARR1(a1,b1,c)); end; definition let a1,b1,a2,b2,c be set; func CARR2(a2,b2,a1,b1,c) equals MAJ3(a2,b2,CARR1(a1,b1,c)); end; definition let a1,b1,a2,b2,a3,b3,c be set; func ADD3(a3,b3,a2,b2,a1,b1,c) equals XOR3(a3,b3,CARR2(a2,b2,a1,b1,c)); end; definition let a1,b1,a2,b2,a3,b3,c be set; func CARR3(a3,b3,a2,b2,a1,b1,c) equals MAJ3(a3,b3,CARR2(a2,b2,a1,b1,c)); end; definition let a1,b1,a2,b2,a3,b3,a4,b4,c be set; func ADD4(a4,b4,a3,b3,a2,b2,a1,b1,c) equals XOR3(a4,b4,CARR3(a3,b3,a2,b2,a1, b1,c)); end; definition let a1,b1,a2,b2,a3,b3,a4,b4,c be set; func CARR4(a4,b4,a3,b3,a2,b2,a1,b1,c) equals MAJ3(a4,b4,CARR3(a3,b3,a2,b2,a1 ,b1,c)); end; theorem for c1,x1,y1,x2,y2,x3,y3,x4,y4,c4, q1,p1,sd1,q2,p2,sd2,q3,p3,sd3,q4,p4 ,sd4,cb1,cb2,l2,t2,l3,m3, t3,l4,m4,n4,t4,l5,m5,n5,o5,s1,s2,s3,s4 being set holds (q1 is non empty iff NOR2(x1,y1) is non empty)& (p1 is non empty iff NAND2(x1,y1) is non empty)& (sd1 is non empty iff MODADD2(x1,y1) is non empty)& (q2 is non empty iff NOR2(x2,y2) is non empty)& (p2 is non empty iff NAND2(x2, y2) is non empty)& (sd2 is non empty iff MODADD2(x2,y2) is non empty)& (q3 is non empty iff NOR2(x3,y3) is non empty)& (p3 is non empty iff NAND2(x3,y3) is non empty)& (sd3 is non empty iff MODADD2(x3,y3) is non empty)& (q4 is non empty iff NOR2(x4,y4) is non empty)& (p4 is non empty iff NAND2(x4,y4) is non empty)& (sd4 is non empty iff MODADD2(x4,y4) is non empty)& (cb1 is non empty iff NOT1 c1 is non empty)& (cb2 is non empty iff NOT1 cb1 is non empty)& (s1 is non empty iff XOR2(cb2,sd1) is non empty)& (l2 is non empty iff AND2(cb1,p1) is non empty)& (t2 is non empty iff NOR2(l2,q1) is non empty)& (s2 is non empty iff XOR2(t2,sd2) is non empty)& (l3 is non empty iff AND2(q1,p2) is non empty)& (m3 is non empty iff AND3(p2,p1,cb1) is non empty)& (t3 is non empty iff NOR3( l3,m3,q2) is non empty)& (s3 is non empty iff XOR2(t3,sd3) is non empty)& (l4 is non empty iff AND2(q2,p3) is non empty)& (m4 is non empty iff AND3(q1,p3,p2) is non empty)& (n4 is non empty iff AND4(p3,p2,p1,cb1) is non empty)& (t4 is non empty iff NOR4(l4,m4,n4,q3) is non empty)& (s4 is non empty iff XOR2(t4,sd4 ) is non empty)& (l5 is non empty iff AND2(q3,p4) is non empty)& (m5 is non empty iff AND3(q2,p4,p3) is non empty)& (n5 is non empty iff AND4(q1,p4,p3,p2) is non empty)& (o5 is non empty iff AND5(p4,p3,p2,p1,cb1) is non empty)& (c4 is non empty iff NOR5(q4,l5,m5,n5,o5) is non empty) implies (s1 is non empty iff ADD1(x1,y1,c1) is non empty)& (s2 is non empty iff ADD2(x2,y2,x1,y1,c1) is non empty)& (s3 is non empty iff ADD3(x3,y3,x2,y2,x1,y1,c1) is non empty)& (s4 is non empty iff ADD4(x4,y4,x3,y3,x2,y2,x1,y1,c1) is non empty)& (c4 is non empty iff CARR4(x4,y4,x3,y3,x2,y2,x1,y1,c1) is non empty); begin reserve a,b,c,d for set; theorem for s0,s1,s2,s3,s4,s5,s6,s7,ns0,ns1,ns2,ns3,ns4,ns5,ns6,ns7,q1,q2,q3, nq1, nq2,nq3 being set holds (s0 is non empty iff AND3(NOT1 q3,NOT1 q2,NOT1 q1) is not empty)& (s1 is non empty iff AND3(NOT1 q3,NOT1 q2,q1) is not empty)& (s2 is non empty iff AND3(NOT1 q3,q2,NOT1 q1) is not empty)& (s3 is non empty iff AND3(NOT1 q3,q2,q1) is not empty)& (s4 is non empty iff AND3(q3,NOT1 q2,NOT1 q1 ) is not empty)& (s5 is non empty iff AND3(q3,NOT1 q2,q1) is not empty)& (s6 is non empty iff AND3(q3,q2,NOT1 q1) is not empty)& (s7 is non empty iff AND3(q3, q2,q1) is not empty)& (ns0 is non empty iff AND3(NOT1 nq3,NOT1 nq2,NOT1 nq1) is not empty)& (ns1 is non empty iff AND3(NOT1 nq3,NOT1 nq2,nq1) is not empty)& ( ns2 is non empty iff AND3(NOT1 nq3,nq2,NOT1 nq1) is not empty)& (ns3 is non empty iff AND3(NOT1 nq3,nq2,nq1) is not empty)& (ns4 is non empty iff AND3(nq3, NOT1 nq2,NOT1 nq1) is not empty)& (ns5 is non empty iff AND3(nq3,NOT1 nq2,nq1) is not empty)& (ns6 is non empty iff AND3(nq3,nq2,NOT1 nq1) is not empty)& (ns7 is non empty iff AND3(nq3,nq2,nq1) is not empty)& (nq1 is non empty iff (NOT1 q1) is not empty)& (nq2 is non empty iff XOR2(q1,q2) is not empty)& (nq3 is non empty iff OR2(AND2(q3, NOT1 q1), AND2(q1, XOR2(q2,q3))) is not empty) implies ( ns1 is non empty iff s0 is non empty)& (ns2 is non empty iff s1 is non empty)& (ns3 is non empty iff s2 is non empty)& (ns4 is non empty iff s3 is non empty)& (ns5 is non empty iff s4 is non empty)& (ns6 is non empty iff s5 is non empty)& (ns7 is non empty iff s6 is non empty)& (ns0 is non empty iff s7 is non empty); theorem AND3(AND2(a,d),AND2(b,d),AND2(c,d)) is non empty iff AND2(AND3(a,b,c), d) is non empty; theorem (not AND2(a,b) is non empty iff OR2(NOT1 a, NOT1 b) is non empty)& ( OR2(a,b) is non empty & OR2(c,b) is non empty iff OR2(AND2(a,c),b) is non empty ) & (OR2(a,b) is non empty & OR2(c,b) is non empty & OR2(d,b) is non empty iff OR2(AND3(a,c,d),b) is non empty)& (OR2(a,b) is non empty & (a is non empty iff c is non empty) implies OR2(c,b) is non empty ); theorem for s0,s1,s2,s3,s4,s5,s6,s7,ns0,ns1,ns2,ns3,ns4,ns5,ns6,ns7,q1,q2,q3, nq1, nq2,nq3,R being set holds (s0 is non empty iff AND3(NOT1 q3,NOT1 q2,NOT1 q1) is non empty)& (s1 is non empty iff AND3(NOT1 q3,NOT1 q2,q1) is non empty)& (s2 is non empty iff AND3(NOT1 q3,q2,NOT1 q1) is non empty)& (s3 is non empty iff AND3(NOT1 q3,q2,q1) is non empty)& (s4 is non empty iff AND3(q3,NOT1 q2, NOT1 q1) is non empty)& (s5 is non empty iff AND3(q3,NOT1 q2,q1) is non empty)& (s6 is non empty iff AND3(q3,q2,NOT1 q1) is non empty)& (s7 is non empty iff AND3(q3,q2,q1) is non empty)& (ns0 is non empty iff AND3(NOT1 nq3,NOT1 nq2,NOT1 nq1) is non empty)& (ns1 is non empty iff AND3(NOT1 nq3,NOT1 nq2,nq1) is non empty)& (ns2 is non empty iff AND3(NOT1 nq3,nq2,NOT1 nq1) is non empty)& (ns3 is non empty iff AND3(NOT1 nq3,nq2,nq1) is non empty)& (ns4 is non empty iff AND3(nq3,NOT1 nq2,NOT1 nq1) is non empty)& (ns5 is non empty iff AND3(nq3,NOT1 nq2,nq1) is non empty)& (ns6 is non empty iff AND3(nq3,nq2,NOT1 nq1) is non empty)& (ns7 is non empty iff AND3(nq3,nq2,nq1) is non empty)& (nq1 is non empty iff AND2(NOT1 q1,R) is non empty)& (nq2 is non empty iff AND2(XOR2(q1,q2) ,R) is non empty)& (nq3 is non empty iff AND2(OR2(AND2(q3, NOT1 q1), AND2(q1, XOR2(q2,q3))),R) is non empty) implies (ns1 is non empty iff AND2(s0,R) is non empty)& (ns2 is non empty iff AND2(s1,R) is non empty)& (ns3 is non empty iff AND2(s2,R) is non empty)& (ns4 is non empty iff AND2(s3,R) is non empty)& (ns5 is non empty iff AND2(s4,R) is non empty)& (ns6 is non empty iff AND2(s5,R) is non empty)& (ns7 is non empty iff AND2(s6,R) is non empty)& (ns0 is non empty iff OR2(s7,NOT1 R) is non empty); begin theorem for s0,s1,s2,s3,ns0,ns1,ns2,ns3,q1,q2,nq1,nq2 being set holds (s0 is not empty iff AND2(NOT1 q2, NOT1 q1) is not empty)& (s1 is not empty iff AND2( NOT1 q2, q1) is not empty)& (s2 is not empty iff AND2( q2, NOT1 q1) is not empty)& (s3 is not empty iff AND2( q2, q1) is not empty) & (ns0 is not empty iff AND2(NOT1 nq2,NOT1 nq1) is not empty)& (ns1 is not empty iff AND2(NOT1 nq2, nq1) is not empty)& (ns2 is not empty iff AND2( nq2,NOT1 nq1) is not empty)& ( ns3 is not empty iff AND2( nq2, nq1) is not empty) & (nq1 is not empty iff NOT1 q2 is not empty)& (nq2 is not empty iff q1 is not empty) implies (ns1 is not empty iff s0 is not empty)& (ns3 is not empty iff s1 is not empty)& (ns2 is not empty iff s3 is not empty)& (ns0 is not empty iff s2 is not empty); theorem for s0,s1,s2,s3,ns0,ns1,ns2,ns3,q1,q2,nq1,nq2,R being set holds (s0 is not empty iff AND2(NOT1 q2, NOT1 q1) is not empty)& (s1 is not empty iff AND2( NOT1 q2, q1) is not empty)& (s2 is not empty iff AND2( q2, NOT1 q1) is not empty)& (s3 is not empty iff AND2( q2, q1) is not empty) & (ns0 is not empty iff AND2(NOT1 nq2,NOT1 nq1) is not empty)& (ns1 is not empty iff AND2(NOT1 nq2, nq1) is not empty)& (ns2 is not empty iff AND2( nq2,NOT1 nq1) is not empty)& ( ns3 is not empty iff AND2( nq2, nq1) is not empty) & (nq1 is not empty iff AND2 (NOT1 q2, R) is not empty)& (nq2 is not empty iff AND2( q1, R) is not empty) implies (ns1 is not empty iff AND2(s0, R) is not empty)& (ns3 is not empty iff AND2(s1, R) is not empty)& (ns2 is not empty iff AND2(s3, R) is not empty)& ( ns0 is not empty iff OR2(AND2(s2, R),NOT1 R) is not empty); theorem for s0,s1,s2,s3,s4,s5,s6,s7,ns0,ns1,ns2,ns3,ns4,ns5,ns6,ns7, q1,q2,q3, nq1,nq2,nq3 being set holds (s0 is not empty iff AND3(NOT1 q3, NOT1 q2, NOT1 q1 ) is not empty)& (s1 is not empty iff AND3(NOT1 q3, NOT1 q2, q1) is not empty)& (s2 is not empty iff AND3(NOT1 q3, q2, NOT1 q1) is not empty)& (s3 is not empty iff AND3(NOT1 q3, q2, q1) is not empty)& (s4 is not empty iff AND3( q3, NOT1 q2 , NOT1 q1) is not empty)& (s5 is not empty iff AND3( q3, NOT1 q2, q1) is not empty)& (s6 is not empty iff AND3( q3, q2, NOT1 q1) is not empty)& (s7 is not empty iff AND3( q3, q2, q1) is not empty) & (ns0 is not empty iff AND3(NOT1 nq3 ,NOT1 nq2,NOT1 nq1) is not empty)& (ns1 is not empty iff AND3(NOT1 nq3,NOT1 nq2 , nq1) is not empty)& (ns2 is not empty iff AND3(NOT1 nq3, nq2,NOT1 nq1) is not empty)& (ns3 is not empty iff AND3(NOT1 nq3, nq2, nq1) is not empty)& (ns4 is not empty iff AND3( nq3,NOT1 nq2,NOT1 nq1) is not empty)& (ns5 is not empty iff AND3( nq3,NOT1 nq2, nq1) is not empty)& (ns6 is not empty iff AND3( nq3, nq2, NOT1 nq1) is not empty)& (ns7 is not empty iff AND3( nq3, nq2, nq1) is not empty) & (nq1 is not empty iff NOT1 q3 is not empty)& (nq2 is not empty iff q1 is not empty)& (nq3 is not empty iff q2 is not empty) implies (ns1 is not empty iff s0 is not empty)& (ns3 is not empty iff s1 is not empty)& (ns7 is not empty iff s3 is not empty)& (ns6 is not empty iff s7 is not empty)& (ns4 is not empty iff s6 is not empty)& (ns0 is not empty iff s4 is not empty) & (ns2 is not empty iff s5 is not empty)& (ns5 is not empty iff s2 is not empty); theorem for s0,s1,s2,s3,s4,s5,s6,s7,ns0,ns1,ns2,ns3,ns4,ns5,ns6,ns7, q1,q2,q3, nq1,nq2,nq3,R being set holds (s0 is not empty iff AND3(NOT1 q3, NOT1 q2, NOT1 q1) is not empty)& (s1 is not empty iff AND3(NOT1 q3, NOT1 q2, q1) is not empty )& (s2 is not empty iff AND3(NOT1 q3, q2, NOT1 q1) is not empty)& (s3 is not empty iff AND3(NOT1 q3, q2, q1) is not empty)& (s4 is not empty iff AND3( q3, NOT1 q2, NOT1 q1) is not empty)& (s5 is not empty iff AND3( q3, NOT1 q2, q1) is not empty)& (s6 is not empty iff AND3( q3, q2, NOT1 q1) is not empty)& (s7 is not empty iff AND3( q3, q2, q1) is not empty) & (ns0 is not empty iff AND3(NOT1 nq3,NOT1 nq2,NOT1 nq1) is not empty)& (ns1 is not empty iff AND3(NOT1 nq3,NOT1 nq2, nq1) is not empty)& (ns2 is not empty iff AND3(NOT1 nq3, nq2,NOT1 nq1) is not empty)& (ns3 is not empty iff AND3(NOT1 nq3, nq2, nq1) is not empty)& (ns4 is not empty iff AND3( nq3,NOT1 nq2,NOT1 nq1) is not empty)& (ns5 is not empty iff AND3( nq3,NOT1 nq2, nq1) is not empty)& (ns6 is not empty iff AND3( nq3, nq2,NOT1 nq1) is not empty)& (ns7 is not empty iff AND3( nq3, nq2, nq1) is not empty) & (nq1 is not empty iff AND2(NOT1 q3, R) is not empty)& (nq2 is not empty iff AND2( q1, R) is not empty)& (nq3 is not empty iff AND2( q2, R) is not empty) implies (ns1 is not empty iff AND2(s0, R) is not empty)& (ns3 is not empty iff AND2(s1, R) is not empty)& (ns7 is not empty iff AND2(s3, R) is not empty)& (ns6 is not empty iff AND2(s7, R) is not empty)& (ns4 is not empty iff AND2(s6, R) is not empty)& (ns0 is not empty iff OR2(AND2(s4, R),NOT1 R) is not empty) & (ns2 is not empty iff AND2(s5, R) is not empty)& (ns5 is not empty iff AND2(s2, R) is not empty); theorem for s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15, ns0,ns1,ns2 ,ns3,ns4,ns5,ns6,ns7,ns8,ns9,ns10,ns11,ns12,ns13,ns14,ns15, q1,q2,q3,q4,nq1,nq2 ,nq3,nq4 being set holds (s0 is not empty iff AND4(NOT1 q4, NOT1 q3, NOT1 q2, NOT1 q1) is not empty)& (s1 is not empty iff AND4(NOT1 q4, NOT1 q3, NOT1 q2, q1 ) is not empty)& (s2 is not empty iff AND4(NOT1 q4, NOT1 q3, q2, NOT1 q1) is not empty)& (s3 is not empty iff AND4(NOT1 q4, NOT1 q3, q2, q1) is not empty)& (s4 is not empty iff AND4(NOT1 q4, q3, NOT1 q2, NOT1 q1) is not empty)& (s5 is not empty iff AND4(NOT1 q4, q3, NOT1 q2, q1) is not empty)& (s6 is not empty iff AND4(NOT1 q4, q3, q2, NOT1 q1) is not empty)& (s7 is not empty iff AND4( NOT1 q4, q3, q2, q1) is not empty)& (s8 is not empty iff AND4( q4, NOT1 q3, NOT1 q2, NOT1 q1) is not empty)& (s9 is not empty iff AND4( q4, NOT1 q3, NOT1 q2, q1) is not empty)& (s10 is not empty iff AND4( q4, NOT1 q3, q2, NOT1 q1) is not empty)& (s11 is not empty iff AND4( q4, NOT1 q3, q2, q1) is not empty)& ( s12 is not empty iff AND4( q4, q3, NOT1 q2, NOT1 q1) is not empty)& (s13 is not empty iff AND4( q4, q3, NOT1 q2, q1) is not empty)& (s14 is not empty iff AND4( q4, q3, q2, NOT1 q1) is not empty)& (s15 is not empty iff AND4( q4, q3, q2, q1) is not empty) & (ns0 is not empty iff AND4(NOT1 nq4, NOT1 nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns1 is not empty iff AND4(NOT1 nq4, NOT1 nq3, NOT1 nq2, nq1) is not empty)& (ns2 is not empty iff AND4(NOT1 nq4, NOT1 nq3, nq2, NOT1 nq1) is not empty)& (ns3 is not empty iff AND4(NOT1 nq4, NOT1 nq3, nq2, nq1) is not empty)& (ns4 is not empty iff AND4(NOT1 nq4, nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns5 is not empty iff AND4(NOT1 nq4, nq3, NOT1 nq2, nq1) is not empty)& (ns6 is not empty iff AND4(NOT1 nq4, nq3, nq2, NOT1 nq1) is not empty)& (ns7 is not empty iff AND4(NOT1 nq4, nq3, nq2, nq1) is not empty)& (ns8 is not empty iff AND4( nq4, NOT1 nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns9 is not empty iff AND4( nq4, NOT1 nq3, NOT1 nq2, nq1) is not empty)& (ns10 is not empty iff AND4( nq4, NOT1 nq3, nq2, NOT1 nq1) is not empty)& (ns11 is not empty iff AND4( nq4, NOT1 nq3, nq2, nq1) is not empty)& (ns12 is not empty iff AND4( nq4, nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns13 is not empty iff AND4( nq4, nq3, NOT1 nq2, nq1) is not empty)& (ns14 is not empty iff AND4( nq4, nq3, nq2, NOT1 nq1) is not empty)& (ns15 is not empty iff AND4( nq4, nq3, nq2, nq1) is not empty) & (nq1 is not empty iff NOT1 q4 is not empty)& (nq2 is not empty iff q1 is not empty)& (nq3 is not empty iff q2 is not empty)& (nq4 is not empty iff q3 is not empty) implies (ns1 is not empty iff s0 is not empty )& (ns3 is not empty iff s1 is not empty )& (ns7 is not empty iff s3 is not empty )& (ns15 is not empty iff s7 is not empty )& (ns14 is not empty iff s15 is not empty)& ( ns12 is not empty iff s14 is not empty)& (ns8 is not empty iff s12 is not empty )& (ns0 is not empty iff s8 is not empty ) & (ns5 is not empty iff s2 is not empty )& (ns11 is not empty iff s5 is not empty )& (ns6 is not empty iff s11 is not empty)& (ns13 is not empty iff s6 is not empty )& (ns10 is not empty iff s13 is not empty)& (ns4 is not empty iff s10 is not empty)& (ns9 is not empty iff s4 is not empty)& (ns2 is not empty iff s9 is not empty); theorem for s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15, ns0,ns1,ns2 ,ns3,ns4,ns5,ns6,ns7,ns8,ns9,ns10,ns11,ns12,ns13,ns14,ns15, q1,q2,q3,q4,nq1,nq2 ,nq3,nq4,R being set holds (s0 is not empty iff AND4(NOT1 q4, NOT1 q3, NOT1 q2, NOT1 q1) is not empty)& (s1 is not empty iff AND4(NOT1 q4, NOT1 q3, NOT1 q2, q1 ) is not empty)& (s2 is not empty iff AND4(NOT1 q4, NOT1 q3, q2, NOT1 q1) is not empty)& (s3 is not empty iff AND4(NOT1 q4, NOT1 q3, q2, q1) is not empty)& (s4 is not empty iff AND4(NOT1 q4, q3, NOT1 q2, NOT1 q1) is not empty)& (s5 is not empty iff AND4(NOT1 q4, q3, NOT1 q2, q1) is not empty)& (s6 is not empty iff AND4(NOT1 q4, q3, q2, NOT1 q1) is not empty)& (s7 is not empty iff AND4( NOT1 q4, q3, q2, q1) is not empty)& (s8 is not empty iff AND4( q4, NOT1 q3, NOT1 q2, NOT1 q1) is not empty)& (s9 is not empty iff AND4( q4, NOT1 q3, NOT1 q2, q1) is not empty)& (s10 is not empty iff AND4( q4, NOT1 q3, q2, NOT1 q1) is not empty)& (s11 is not empty iff AND4( q4, NOT1 q3, q2, q1) is not empty)& ( s12 is not empty iff AND4( q4, q3, NOT1 q2, NOT1 q1) is not empty)& (s13 is not empty iff AND4( q4, q3, NOT1 q2, q1) is not empty)& (s14 is not empty iff AND4( q4, q3, q2, NOT1 q1) is not empty)& (s15 is not empty iff AND4( q4, q3, q2, q1) is not empty) & (ns0 is not empty iff AND4(NOT1 nq4, NOT1 nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns1 is not empty iff AND4(NOT1 nq4, NOT1 nq3, NOT1 nq2, nq1) is not empty)& (ns2 is not empty iff AND4(NOT1 nq4, NOT1 nq3, nq2, NOT1 nq1) is not empty)& (ns3 is not empty iff AND4(NOT1 nq4, NOT1 nq3, nq2, nq1) is not empty)& (ns4 is not empty iff AND4(NOT1 nq4, nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns5 is not empty iff AND4(NOT1 nq4, nq3, NOT1 nq2, nq1) is not empty)& (ns6 is not empty iff AND4(NOT1 nq4, nq3, nq2, NOT1 nq1) is not empty)& (ns7 is not empty iff AND4(NOT1 nq4, nq3, nq2, nq1) is not empty)& (ns8 is not empty iff AND4( nq4, NOT1 nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns9 is not empty iff AND4( nq4, NOT1 nq3, NOT1 nq2, nq1) is not empty)& (ns10 is not empty iff AND4( nq4, NOT1 nq3, nq2, NOT1 nq1) is not empty)& (ns11 is not empty iff AND4( nq4, NOT1 nq3, nq2, nq1) is not empty)& (ns12 is not empty iff AND4( nq4, nq3, NOT1 nq2, NOT1 nq1) is not empty)& (ns13 is not empty iff AND4( nq4, nq3, NOT1 nq2, nq1) is not empty)& (ns14 is not empty iff AND4( nq4, nq3, nq2, NOT1 nq1) is not empty)& (ns15 is not empty iff AND4( nq4, nq3, nq2, nq1) is not empty) & (nq1 is not empty iff AND2(NOT1 q4,R) is not empty)& (nq2 is not empty iff AND2( q1,R) is not empty)& (nq3 is not empty iff AND2( q2,R) is not empty)& (nq4 is not empty iff AND2( q3,R) is not empty) implies (ns1 is not empty iff AND2(s0,R) is not empty)& (ns3 is not empty iff AND2(s1,R) is not empty)& (ns7 is not empty iff AND2(s3,R) is not empty)& (ns15 is not empty iff AND2(s7,R) is not empty)& (ns14 is not empty iff AND2(s15,R) is not empty)& (ns12 is not empty iff AND2(s14,R) is not empty)& (ns8 is not empty iff AND2(s12,R) is not empty)& (ns0 is not empty iff OR2(AND2(s8,R),NOT1 R) is not empty) & (ns5 is not empty iff AND2(s2,R) is not empty)& (ns11 is not empty iff AND2(s5,R) is not empty)& (ns6 is not empty iff AND2(s11,R) is not empty)& (ns13 is not empty iff AND2(s6,R) is not empty)& (ns10 is not empty iff AND2(s13,R) is not empty)& (ns4 is not empty iff AND2(s10,R) is not empty)& (ns9 is not empty iff AND2(s4, R) is not empty)& (ns2 is not empty iff AND2(s9,R) is not empty); begin theorem for g0,g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12, a0,a1,a2,a3,a4,a5,a6,a7 ,a8,a9,a10,a11, b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11, p being set holds g12 is not empty & (b0 is not empty iff XOR2(p,AND2(g0,a11)) is not empty)& (b1 is not empty iff XOR2(a0,AND2(g1,a11)) is not empty)& (b2 is not empty iff XOR2(a1, AND2(g2,a11)) is not empty)& (b3 is not empty iff XOR2(a2,AND2(g3,a11)) is not empty)& (b4 is not empty iff XOR2(a3,AND2(g4,a11)) is not empty)& (b5 is not empty iff XOR2(a4,AND2(g5,a11)) is not empty)& (b6 is not empty iff XOR2(a5, AND2(g6,a11)) is not empty)& (b7 is not empty iff XOR2(a6,AND2(g7,a11)) is not empty)& (b8 is not empty iff XOR2(a7,AND2(g8,a11)) is not empty)& (b9 is not empty iff XOR2(a8,AND2(g9,a11)) is not empty)& (b10 is not empty iff XOR2(a9, AND2(g10,a11)) is not empty)& (b11 is not empty iff XOR2(a10,AND2(g11,a11)) is not empty) implies (a11 is not empty iff AND2(g12,a11) is not empty) & (a10 is not empty iff XOR2(b11,AND2(g11,a11)) is not empty)& (a9 is not empty iff XOR2( b10,AND2(g10,a11)) is not empty)& (a8 is not empty iff XOR2(b9,AND2(g9,a11)) is not empty)& (a7 is not empty iff XOR2(b8,AND2(g8,a11)) is not empty)& (a6 is not empty iff XOR2(b7,AND2(g7,a11)) is not empty)& (a5 is not empty iff XOR2(b6 ,AND2(g6,a11)) is not empty)& (a4 is not empty iff XOR2(b5,AND2(g5,a11)) is not empty)& (a3 is not empty iff XOR2(b4,AND2(g4,a11)) is not empty)& (a2 is not empty iff XOR2(b3,AND2(g3,a11)) is not empty)& (a1 is not empty iff XOR2(b2, AND2(g2,a11)) is not empty)& (a0 is not empty iff XOR2(b1,AND2(g1,a11)) is not empty)& (p is not empty iff XOR2(b0,AND2(g0,a11)) is not empty); theorem for g0,g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12,g13,g14,g15,g16, a0,a1, a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15, b0,b1,b2,b3,b4,b5,b6,b7,b8,b9, b10,b11,b12,b13,b14,b15, p being set holds g16 is not empty & (b0 is not empty iff XOR2(p,AND2(g0,a15)) is not empty)& (b1 is not empty iff XOR2(a0,AND2(g1, a15)) is not empty)& (b2 is not empty iff XOR2(a1,AND2(g2,a15)) is not empty)& (b3 is not empty iff XOR2(a2,AND2(g3,a15)) is not empty)& (b4 is not empty iff XOR2(a3,AND2(g4,a15)) is not empty)& (b5 is not empty iff XOR2(a4,AND2(g5,a15)) is not empty)& (b6 is not empty iff XOR2(a5,AND2(g6,a15)) is not empty)& (b7 is not empty iff XOR2(a6,AND2(g7,a15)) is not empty)& (b8 is not empty iff XOR2(a7 ,AND2(g8,a15)) is not empty)& (b9 is not empty iff XOR2(a8,AND2(g9,a15)) is not empty)& (b10 is not empty iff XOR2(a9,AND2(g10,a15)) is not empty)& (b11 is not empty iff XOR2(a10,AND2(g11,a15)) is not empty)& (b12 is not empty iff XOR2(a11 ,AND2(g12,a15)) is not empty)& (b13 is not empty iff XOR2(a12,AND2(g13,a15)) is not empty)& (b14 is not empty iff XOR2(a13,AND2(g14,a15)) is not empty)& (b15 is not empty iff XOR2(a14,AND2(g15,a15)) is not empty) implies (a15 is not empty iff AND2(g16,a15) is not empty) & (a14 is not empty iff XOR2(b15,AND2(g15 ,a15)) is not empty)& (a13 is not empty iff XOR2(b14,AND2(g14,a15)) is not empty)& (a12 is not empty iff XOR2(b13,AND2(g13,a15)) is not empty)& (a11 is not empty iff XOR2(b12,AND2(g12,a15)) is not empty)& (a10 is not empty iff XOR2 (b11,AND2(g11,a15)) is not empty)& (a9 is not empty iff XOR2(b10,AND2(g10,a15)) is not empty)& (a8 is not empty iff XOR2(b9,AND2(g9,a15)) is not empty)& (a7 is not empty iff XOR2(b8,AND2(g8,a15)) is not empty)& (a6 is not empty iff XOR2(b7 ,AND2(g7,a15)) is not empty)& (a5 is not empty iff XOR2(b6,AND2(g6,a15)) is not empty)& (a4 is not empty iff XOR2(b5,AND2(g5,a15)) is not empty)& (a3 is not empty iff XOR2(b4,AND2(g4,a15)) is not empty)& (a2 is not empty iff XOR2(b3, AND2(g3,a15)) is not empty)& (a1 is not empty iff XOR2(b2,AND2(g2,a15)) is not empty)& (a0 is not empty iff XOR2(b1,AND2(g1,a15)) is not empty)& (p is not empty iff XOR2(b0,AND2(g0,a15)) is not empty); begin theorem for g0,g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12, a0,a1,a2,a3,a4,a5,a6,a7 ,a8,a9,a10,a11, b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11, z,p being set holds g0 is not empty & not z is not empty & (b0 is not empty iff XOR2(p,a11) is not empty)& (b1 is not empty iff XOR2(a0,AND2(g1,b0)) is not empty)& (b2 is not empty iff XOR2(a1,AND2(g2,b0)) is not empty)& (b3 is not empty iff XOR2(a2,AND2 (g3,b0)) is not empty)& (b4 is not empty iff XOR2(a3,AND2(g4,b0)) is not empty) & (b5 is not empty iff XOR2(a4,AND2(g5,b0)) is not empty)& (b6 is not empty iff XOR2(a5,AND2(g6,b0)) is not empty)& (b7 is not empty iff XOR2(a6,AND2(g7,b0)) is not empty)& (b8 is not empty iff XOR2(a7,AND2(g8,b0)) is not empty)& (b9 is not empty iff XOR2(a8,AND2(g9,b0)) is not empty)& (b10 is not empty iff XOR2(a9 ,AND2(g10,b0)) is not empty)& (b11 is not empty iff XOR2(a10,AND2(g11,b0)) is not empty) implies (b11 is not empty iff XOR2(XOR2(a10,AND2(g11,a11)),XOR2(z, AND2(g11,p))) is not empty) & (b10 is not empty iff XOR2(XOR2(a9,AND2(g10,a11)) ,XOR2(z,AND2(g10,p))) is not empty) & (b9 is not empty iff XOR2(XOR2(a8,AND2(g9 ,a11)),XOR2(z,AND2(g9,p))) is not empty) & (b8 is not empty iff XOR2(XOR2(a7, AND2(g8,a11)),XOR2(z,AND2(g8,p))) is not empty) & (b7 is not empty iff XOR2( XOR2(a6,AND2(g7,a11)),XOR2(z,AND2(g7,p))) is not empty) & (b6 is not empty iff XOR2(XOR2(a5,AND2(g6,a11)),XOR2(z,AND2(g6,p))) is not empty) & (b5 is not empty iff XOR2(XOR2(a4,AND2(g5,a11)),XOR2(z,AND2(g5,p))) is not empty) & (b4 is not empty iff XOR2(XOR2(a3,AND2(g4,a11)),XOR2(z,AND2(g4,p))) is not empty) & (b3 is not empty iff XOR2(XOR2(a2,AND2(g3,a11)),XOR2(z,AND2(g3,p))) is not empty) & ( b2 is not empty iff XOR2(XOR2(a1,AND2(g2,a11)),XOR2(z,AND2(g2,p))) is not empty ) & (b1 is not empty iff XOR2(XOR2(a0,AND2(g1,a11)),XOR2(z,AND2(g1,p))) is not empty) & (b0 is not empty iff XOR2(XOR2(z, AND2(g0,a11)),XOR2(z,AND2(g0,p))) is not empty); theorem for g0,g1,g2,g3,g4,g5,g6,g7,g8,g9,g10,g11,g12,g13,g14,g15,g16, a0,a1, a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15, b0,b1,b2,b3,b4,b5,b6,b7,b8,b9, b10,b11,b12,b13,b14,b15, z,p being set holds g0 is not empty & not z is not empty & (b0 is not empty iff XOR2(p,a15) is not empty)& (b1 is not empty iff XOR2(a0,AND2(g1,b0)) is not empty)& (b2 is not empty iff XOR2(a1,AND2(g2,b0)) is not empty)& (b3 is not empty iff XOR2(a2,AND2(g3,b0)) is not empty)& (b4 is not empty iff XOR2(a3,AND2(g4,b0)) is not empty)& (b5 is not empty iff XOR2(a4, AND2(g5,b0)) is not empty)& (b6 is not empty iff XOR2(a5,AND2(g6,b0)) is not empty)& (b7 is not empty iff XOR2(a6,AND2(g7,b0)) is not empty)& (b8 is not empty iff XOR2(a7,AND2(g8,b0)) is not empty)& (b9 is not empty iff XOR2(a8,AND2 (g9,b0)) is not empty)& (b10 is not empty iff XOR2(a9,AND2(g10,b0)) is not empty)& (b11 is not empty iff XOR2(a10,AND2(g11,b0)) is not empty)& (b12 is not empty iff XOR2(a11,AND2(g12,b0)) is not empty)& (b13 is not empty iff XOR2(a12, AND2(g13,b0)) is not empty)& (b14 is not empty iff XOR2(a13,AND2(g14,b0)) is not empty)& (b15 is not empty iff XOR2(a14,AND2(g15,b0)) is not empty) implies (b15 is not empty iff XOR2(XOR2(a14,AND2(g15,a15)),XOR2(z,AND2(g15,p))) is not empty) & (b14 is not empty iff XOR2(XOR2(a13,AND2(g14,a15)),XOR2(z,AND2(g14,p)) ) is not empty) & (b13 is not empty iff XOR2(XOR2(a12,AND2(g13,a15)),XOR2(z, AND2(g13,p))) is not empty) & (b12 is not empty iff XOR2(XOR2(a11,AND2(g12,a15) ),XOR2(z,AND2(g12,p))) is not empty) & (b11 is not empty iff XOR2(XOR2(a10,AND2 (g11,a15)),XOR2(z,AND2(g11,p))) is not empty) & (b10 is not empty iff XOR2(XOR2 (a9,AND2(g10,a15)),XOR2(z,AND2(g10,p))) is not empty) & (b9 is not empty iff XOR2(XOR2(a8,AND2(g9,a15)),XOR2(z,AND2(g9,p))) is not empty) & (b8 is not empty iff XOR2(XOR2(a7,AND2(g8,a15)),XOR2(z,AND2(g8,p))) is not empty) & (b7 is not empty iff XOR2(XOR2(a6,AND2(g7,a15)),XOR2(z,AND2(g7,p))) is not empty) & (b6 is not empty iff XOR2(XOR2(a5,AND2(g6,a15)),XOR2(z,AND2(g6,p))) is not empty) & ( b5 is not empty iff XOR2(XOR2(a4,AND2(g5,a15)),XOR2(z,AND2(g5,p))) is not empty ) & (b4 is not empty iff XOR2(XOR2(a3,AND2(g4,a15)),XOR2(z,AND2(g4,p))) is not empty) & (b3 is not empty iff XOR2(XOR2(a2,AND2(g3,a15)),XOR2(z,AND2(g3,p))) is not empty) & (b2 is not empty iff XOR2(XOR2(a1,AND2(g2,a15)),XOR2(z,AND2(g2,p)) ) is not empty) & (b1 is not empty iff XOR2(XOR2(a0,AND2(g1,a15)),XOR2(z,AND2( g1,p))) is not empty) & (b0 is not empty iff XOR2(XOR2(z, AND2(g0,a15)),XOR2(z, AND2(g0,p))) is not empty); begin definition let x0,x1,y0,y1 be set; func MULT210(x1,y1,x0,y0) -> set equals AND2(x0,y0); func MULT211(x1,y1,x0,y0) -> set equals ADD1(AND2(x1,y0),AND2(x0,y1),{}); func MULT212(x1,y1,x0,y0) -> set equals ADD2({},AND2(x1,y1),AND2(x1,y0),AND2 (x0,y1),{}); func MULT213(x1,y1,x0,y0) -> set equals CARR2({},AND2(x1,y1),AND2(x1,y0), AND2(x0,y1),{}); end; theorem for x0,x1,y0,y1,z0,z1,z2,z3,q00,q01,c01,q11,c11 being set holds (q00 is not empty iff AND2(x0,y0) is not empty)& (q01 is not empty iff XOR3(AND2(x1, y0),AND2(x0,y1),{} ) is not empty)& (c01 is not empty iff MAJ3(AND2(x1,y0),AND2 (x0,y1),{} ) is not empty)& (q11 is not empty iff XOR3(AND2(x1,y1),{} ,c01) is not empty)& (c11 is not empty iff MAJ3(AND2(x1,y1),{} ,c01) is not empty)& (z0 is not empty iff q00 is not empty)& (z1 is not empty iff q01 is not empty)& (z2 is not empty iff q11 is not empty)& (z3 is not empty iff c11 is not empty) implies (z0 is not empty iff MULT210(x1,y1,x0,y0) is not empty)& (z1 is not empty iff MULT211(x1,y1,x0,y0) is not empty)& (z2 is not empty iff MULT212(x1, y1,x0,y0) is not empty)& (z3 is not empty iff MULT213(x1,y1,x0,y0) is not empty ); definition let x0,x1,x2,y0,y1 be set; func MULT310(x2,x1,y1,x0,y0) -> set equals AND2(x0,y0); func MULT311(x2,x1,y1,x0,y0) -> set equals ADD1(AND2(x1,y0),AND2(x0,y1),{}); func MULT312(x2,x1,y1,x0,y0) -> set equals ADD2(AND2(x2,y0),AND2(x1,y1), AND2(x1,y0),AND2(x0,y1),{}); func MULT313(x2,x1,y1,x0,y0) -> set equals ADD3({} ,AND2(x2,y1), AND2(x2,y0) ,AND2(x1,y1), AND2(x1,y0),AND2(x0,y1),{}); func MULT314(x2,x1,y1,x0,y0) -> set equals CARR3({} ,AND2(x2,y1), AND2(x2,y0 ),AND2(x1,y1), AND2(x1,y0),AND2(x0,y1),{}); end; definition let x0,x1,x2,y0,y1,y2 be set; func MULT321(x2,y2,x1,y1,x0,y0) -> set equals ADD1(MULT312(x2,x1,y1,x0,y0), AND2(x0,y2),{}); func MULT322(x2,y2,x1,y1,x0,y0) -> set equals ADD2(MULT313(x2,x1,y1,x0,y0), AND2(x1,y2), MULT312(x2,x1,y1,x0,y0),AND2(x0,y2),{}); func MULT323(x2,y2,x1,y1,x0,y0) -> set equals ADD3(MULT314(x2,x1,y1,x0,y0), AND2(x2,y2), MULT313(x2,x1,y1,x0,y0),AND2(x1,y2), MULT312(x2,x1,y1,x0,y0),AND2( x0,y2),{}); func MULT324(x2,y2,x1,y1,x0,y0) -> set equals CARR3(MULT314(x2,x1,y1,x0,y0), AND2(x2,y2), MULT313(x2,x1,y1,x0,y0),AND2(x1,y2), MULT312(x2,x1,y1,x0,y0),AND2( x0,y2),{}); end; theorem for x0,x1,x2,y0,y1,y2,z0,z1,z2,z3,z4,z5, q00,q01,q02,c01,c02,q11,q12, c11,c12,q21,q22,c21,c22 being set holds (q00 is not empty iff AND2(x0,y0) is not empty)& (q01 is not empty iff XOR3(AND2(x1,y0),AND2(x0,y1),{} ) is not empty)& (c01 is not empty iff MAJ3(AND2(x1,y0),AND2(x0,y1),{} ) is not empty)& (q02 is not empty iff XOR3(AND2(x2,y0),AND2(x1,y1),{} ) is not empty)& (c02 is not empty iff MAJ3(AND2(x2,y0),AND2(x1,y1),{} ) is not empty)& (q11 is not empty iff XOR3(q02,AND2(x0,y2),c01) is not empty)& (c11 is not empty iff MAJ3( q02,AND2(x0,y2),c01) is not empty)& (q12 is not empty iff XOR3(AND2(x2,y1),AND2 (x1,y2),c02) is not empty)& (c12 is not empty iff MAJ3(AND2(x2,y1),AND2(x1,y2), c02) is not empty)& (q21 is not empty iff XOR3(q12,{} ,c11) is not empty)& (c21 is not empty iff MAJ3(q12,{} ,c11) is not empty)& (q22 is not empty iff XOR3( AND2(x2,y2),c21,c12) is not empty)& (c22 is not empty iff MAJ3(AND2(x2,y2),c21, c12) is not empty)& (z0 is not empty iff q00 is not empty)& (z1 is not empty iff q01 is not empty)& (z2 is not empty iff q11 is not empty)& (z3 is not empty iff q21 is not empty)& (z4 is not empty iff q22 is not empty)& (z5 is not empty iff c22 is not empty) implies (z0 is not empty iff MULT310(x2, x1,y1,x0,y0) is not empty)& (z1 is not empty iff MULT311(x2, x1,y1,x0,y0) is not empty)& (z2 is not empty iff MULT321(x2,y2,x1,y1,x0,y0) is not empty)& (z3 is not empty iff MULT322(x2,y2,x1,y1,x0,y0) is not empty)& (z4 is not empty iff MULT323(x2,y2,x1 ,y1,x0,y0) is not empty)& (z5 is not empty iff MULT324(x2,y2,x1,y1,x0,y0) is not empty); begin theorem for x0,x1,x2,y0,y1,y2,z0,z1,z2,z3,z4,z5, q00,q01,q02,q03,c01,c02,c03, q11,q12,q13,c11,c12,c13 being set holds (q00 is not empty iff AND2(x0,y0) is not empty)& (q01 is not empty iff XOR3(AND2(x1,y0),AND2(x0,y1),{}) is not empty )& (c01 is not empty iff MAJ3(AND2(x1,y0),AND2(x0,y1),{}) is not empty)& (q02 is not empty iff XOR3(AND2(x2,y0),AND2(x1,y1),AND2(x0,y2)) is not empty)& (c02 is not empty iff MAJ3(AND2(x2,y0),AND2(x1,y1),AND2(x0,y2)) is not empty)& (q03 is not empty iff XOR3(AND2(x2,y1),AND2(x1,y2),{}) is not empty)& (c03 is not empty iff MAJ3(AND2(x2,y1),AND2(x1,y2),{}) is not empty)& (q11 is not empty iff XOR3(q02,c01,{}) is not empty)& (c11 is not empty iff MAJ3(q02,c01,{}) is not empty)& (q12 is not empty iff XOR3(q03,c02,c11) is not empty)& (c12 is not empty iff MAJ3(q03,c02,c11) is not empty)& (q13 is not empty iff XOR3(AND2(x2, y2),c03,c12) is not empty)& (c13 is not empty iff MAJ3(AND2(x2,y2),c03,c12) is not empty)& (z0 is not empty iff q00 is not empty)& (z1 is not empty iff q01 is not empty)& (z2 is not empty iff q11 is not empty)& (z3 is not empty iff q12 is not empty)& (z4 is not empty iff q13 is not empty)& (z5 is not empty iff c13 is not empty) implies (z0 is not empty iff MULT310(x2, x1,y1,x0,y0) is not empty)& (z1 is not empty iff MULT311(x2, x1,y1,x0,y0) is not empty)& (z2 is not empty iff MULT321(x2,y2,x1,y1,x0,y0) is not empty)& (z3 is not empty iff MULT322(x2, y2,x1,y1,x0,y0) is not empty)& (z4 is not empty iff MULT323(x2,y2,x1,y1,x0,y0) is not empty)& (z5 is not empty iff MULT324(x2,y2,x1,y1,x0,y0) is not empty); notation let a1,b1,c be set; synonym CLAADD1(a1,b1,c) for XOR3(a1,b1,c); synonym CLACARR1(a1,b1,c) for MAJ3(a1,b1,c); end; definition let a1,b1,a2,b2,c be set; func CLAADD2(a2,b2,a1,b1,c) -> set equals XOR3(a2,b2,MAJ3(a1,b1,c)); func CLACARR2(a2,b2,a1,b1,c) -> set equals OR2(AND2(a2,b2),AND2(OR2(a2,b2), MAJ3(a1,b1,c))); end; definition let a1,b1,a2,b2,a3,b3,c be set; func CLAADD3(a3,b3,a2,b2,a1,b1,c) -> set equals XOR3(a3,b3,CLACARR2(a2,b2,a1 ,b1,c)); func CLACARR3(a3,b3,a2,b2,a1,b1,c) -> set equals OR3(AND2(a3,b3),AND2(OR2(a3 ,b3),AND2(a2,b2)), AND3(OR2(a3,b3),OR2(a2,b2),MAJ3(a1,b1,c))); end; definition let a1,b1,a2,b2,a3,b3,a4,b4,c be set; func CLAADD4(a4,b4,a3,b3,a2,b2,a1,b1,c) -> set equals XOR3(a4,b4,CLACARR3(a3 ,b3,a2,b2,a1,b1,c)); func CLACARR4(a4,b4,a3,b3,a2,b2,a1,b1,c) -> set equals OR4(AND2(a4,b4),AND2( OR2(a4,b4),AND2(a3,b3)), AND3(OR2(a4,b4),OR2(a3,b3),AND2(a2,b2)), AND4(OR2(a4, b4),OR2(a3,b3),OR2(a2,b2),MAJ3(a1,b1,c))); end; theorem for x0,x1,x2,y0,y1,y2,z0,z1,z2,z3,z4,z5, q00,q01,q02,q03,c01,c02,c03 being set holds (q00 is not empty iff AND2(x0,y0) is not empty)& (q01 is not empty iff XOR3(AND2(x1,y0),AND2(x0,y1),{}) is not empty)& (c01 is not empty iff MAJ3(AND2(x1,y0),AND2(x0,y1),{}) is not empty)& (q02 is not empty iff XOR3(AND2 (x2,y0),AND2(x1,y1),AND2(x0,y2)) is not empty)& (c02 is not empty iff MAJ3(AND2 (x2,y0),AND2(x1,y1),AND2(x0,y2)) is not empty)& (q03 is not empty iff XOR3(AND2 (x2,y1),AND2(x1,y2),{}) is not empty)& (c03 is not empty iff MAJ3(AND2(x2,y1), AND2(x1,y2),{}) is not empty)& (z0 is not empty iff q00 is not empty)& (z1 is not empty iff q01 is not empty)& (z2 is not empty iff CLAADD1( q02,c01,{}) is not empty)& (z3 is not empty iff CLAADD2( q03,c02,q02,c01,{}) is not empty)& ( z4 is not empty iff CLAADD3(AND2(x2,y2),c03,q03,c02,q02,c01,{}) is not empty)& (z5 is not empty iff CLACARR3(AND2(x2,y2),c03,q03,c02,q02,c01,{}) is not empty) implies (z0 is not empty iff MULT310(x2, x1,y1,x0,y0) is not empty)& (z1 is not empty iff MULT311(x2, x1,y1,x0,y0) is not empty)& (z2 is not empty iff MULT321( x2,y2,x1,y1,x0,y0) is not empty)& (z3 is not empty iff MULT322(x2,y2,x1,y1,x0, y0) is not empty)& (z4 is not empty iff MULT323(x2,y2,x1,y1,x0,y0) is not empty )& (z5 is not empty iff MULT324(x2,y2,x1,y1,x0,y0) is not empty); begin definition let IT be set; attr IT is finite means ex p being Function st rng p = IT & dom p in omega; end; notation let IT be set; antonym IT is infinite for IT is finite; end; reserve A, B, X, Y, Z, x, y for set; reserve f for Function; registration cluster non empty finite for set; end; registration cluster empty -> finite for set; end; scheme OLambdaC{A()->set,C[set],F(set)->set,G(set)->set}: ex f being Function st dom f = A() & for x being Ordinal st x in A() holds (C[x] implies f.x = F(x)) & (not C[x] implies f.x = G(x)); registration let x be set; cluster {x} -> finite; end; registration let x,y be set; cluster {x,y} -> finite; end; registration let x,y,z be set; cluster {x,y,z} -> finite; end; registration let x1,x2,x3,x4 be set; cluster {x1,x2,x3,x4} -> finite; end; registration let x1,x2,x3,x4,x5 be set; cluster {x1,x2,x3,x4,x5} -> finite; end; registration let x1,x2,x3,x4,x5,x6 be set; cluster {x1,x2,x3,x4,x5,x6} -> finite; end; registration let x1,x2,x3,x4,x5,x6,x7 be set; cluster {x1,x2,x3,x4,x5,x6,x7} -> finite; end; registration let x1,x2,x3,x4,x5,x6,x7,x8 be set; cluster {x1,x2,x3,x4,x5,x6,x7,x8} -> finite; end; registration let B be finite set; cluster -> finite for Subset of B; end; registration let X,Y be finite set; cluster X \/ Y -> finite; end; theorem A c= B & B is finite implies A is finite; theorem A is finite & B is finite implies A \/ B is finite; registration let A be set, B be finite set; cluster A /\ B -> finite; end; registration let A be finite set, B be set; cluster A /\ B -> finite; cluster A \ B -> finite; end; theorem A is finite implies A /\ B is finite; theorem A is finite implies A \ B is finite; registration let f be Function, A be finite set; cluster f.:A -> finite; end; theorem A is finite implies f.:A is finite; reserve O for Ordinal; theorem A is finite implies for X being Subset-Family of A st X <> {} ex x being set st x in X & for B being set st B in X holds x c= B implies B = x; scheme Finite{A()->set,P[set]} : P[A()] provided A() is finite and P[{}] and for x,B being set st x in A() & B c= A() & P[B] holds P[B \/ {x}]; registration let A,B be finite set; cluster [:A,B:] -> finite; end; registration let A,B,C be finite set; cluster [:A,B,C:] -> finite; end; registration let A,B,C,D be finite set; cluster [:A,B,C,D:] -> finite; end; registration let A be finite set; cluster bool A -> finite; end; theorem A is finite & (for X st X in A holds X is finite) iff union A is finite; theorem dom f is finite implies rng f is finite; theorem Y c= rng f & f"Y is finite implies Y is finite; registration let X, Y be finite set; cluster X \+\ Y -> finite; end; registration let X be non empty set; cluster finite non empty for Subset of X; end; begin theorem for f being Function holds dom f is finite iff f is finite; theorem for F being set st F is finite & F <> {} & F is c=-linear ex m being set st m in F & for C being set st C in F holds m c= C; theorem for F being set st F is finite & F <> {} & F is c=-linear ex m being set st m in F & for C being set st C in F holds C c= m; definition let R be Relation; attr R is finite-yielding means for x st x in rng R holds x is finite; end; reserve a for set; theorem X is finite & X c= [:Y,Z:] implies ex A,B being set st A is finite & A c= Y & B is finite & B c= Z & X c= [:A,B:]; theorem X is finite & X c= [:Y,Z:] implies ex A being set st A is finite & A c= Y & X c= [:A,Z:]; registration cluster finite non empty for Function; end; registration let R be finite Relation; cluster dom R -> finite; end; registration let f be Function, g be finite Function; cluster f*g -> finite; end; registration let A be finite set, B be set; cluster -> finite for Function of A, B; end; registration let x,y be set; cluster x .--> y -> finite; end; registration let R be finite Relation; cluster rng R -> finite; end; registration let f be finite Function, x be set; cluster f"x -> finite; end; registration let f, g be finite Function; cluster f +* g -> finite; end; definition let F be set; attr F is centered means F <> {} & for G being set st G <> {} & G c= F & G is finite holds meet G <> {}; end; definition let f be Function; redefine attr f is finite-yielding means for i being set st i in dom f holds f.i is finite; end; definition let I be set; let IT be I-defined Function; redefine attr IT is finite-yielding means for i being set st i in I holds IT.i is finite; end; theorem B is infinite implies not B in [:A,B:]; registration let I be set, f be I-defined Function; cluster finite I-defined f-compatible for Function; end; registration let X,Y be set; cluster finite X-defined Y-valued for Function; end; registration let X,Y be non empty set; cluster X-defined Y-valued non empty finite for Function; end; registration let A be set, F be finite Relation; cluster A|`F -> finite; end; registration let A be set, F be finite Relation; cluster F|A -> finite; end; registration let A be finite set, F be Function; cluster F|A -> finite; end; registration let R be finite Relation; cluster field R -> finite; end; registration cluster trivial -> finite for set; end; registration cluster infinite -> non trivial for set; end; registration let X be non trivial set; cluster finite non trivial for Subset of X; end; registration let x,y,a,b be set; cluster (x,y) --> (a,b) -> finite; end; definition let A be set; attr A is finite-membered means for B being set st B in A holds B is finite; end; registration cluster empty -> finite-membered for set; end; registration let A be finite-membered set; cluster -> finite for Element of A; end; registration cluster non empty finite finite-membered for set; end; registration let X be finite set; cluster {X} -> finite-membered; cluster bool X -> finite-membered; let Y be finite set; cluster {X,Y} -> finite-membered; end; registration let X be finite-membered set; cluster -> finite-membered for Subset of X; let Y be finite-membered set; cluster X \/ Y -> finite-membered; end; registration let X be finite finite-membered set; cluster union X -> finite; end; registration cluster non empty finite-yielding for Function; cluster empty -> finite-yielding for Relation; end; registration let F be finite-yielding Function, x be set; cluster F.x -> finite; end; registration let F be finite-yielding Relation; cluster rng F -> finite-membered; end; begin reserve X,Y,x for set; definition let IT be set; attr IT is cup-closed means for X,Y being set st X in IT & Y in IT holds X \/ Y in IT; attr IT is cap-closed means for X,Y being set st X in IT & Y in IT holds X /\ Y in IT; attr IT is diff-closed means for X,Y being set st X in IT & Y in IT holds X \ Y in IT; end; definition let IT be set; attr IT is preBoolean means IT is cup-closed diff-closed; end; registration cluster preBoolean -> cup-closed diff-closed for set; cluster cup-closed diff-closed -> preBoolean for set; end; registration cluster non empty cup-closed cap-closed diff-closed for set; end; theorem for A being set holds A is preBoolean iff for X,Y being set st X in A & Y in A holds X \/ Y in A & X \ Y in A; reserve A for non empty preBoolean set; definition let A; let X,Y be Element of A; redefine func X \/ Y -> Element of A; redefine func X \ Y -> Element of A; end; theorem X is Element of A & Y is Element of A implies X /\ Y is Element of A; theorem X is Element of A & Y is Element of A implies X \+\ Y is Element of A; theorem for A being non empty set st for X,Y being Element of A holds X \+\ Y in A & X \ Y in A holds A is preBoolean; theorem for A being non empty set st for X,Y being Element of A holds X \+\ Y in A & X /\ Y in A holds A is preBoolean; theorem for A being non empty set st for X,Y being Element of A holds X \+\ Y in A & X \/ Y in A holds A is preBoolean; definition let A; let X,Y be Element of A; redefine func X /\ Y -> Element of A; redefine func X \+\ Y -> Element of A; end; theorem {} in A; theorem for A being set holds bool A is preBoolean; registration let A be set; cluster bool A -> preBoolean; end; theorem for A,B being non empty preBoolean set holds A /\ B is non empty preBoolean; definition let A be set; func Fin A -> preBoolean set means for X being set holds X in it iff X c= A & X is finite; end; registration let A be set; cluster Fin A -> non empty; end; registration let A be set; cluster -> finite for Element of Fin A; end; theorem for A, B being set st A c= B holds Fin A c= Fin B; theorem for A, B being set holds Fin (A /\ B) = Fin A /\ Fin B; theorem for A, B being set holds Fin A \/ Fin B c= Fin (A \/ B); theorem for A being set holds Fin A c= bool A; theorem for A being set st A is finite holds Fin A = bool A; theorem Fin {} = { {} }; definition let A be set; mode Finite_Subset of A is Element of Fin A; end; theorem for A being set, X being Finite_Subset of A holds X is finite; theorem for A being set, X being Finite_Subset of A holds X is Subset of A; theorem for A being set, X being Subset of A st A is finite holds X is Finite_Subset of A; begin reserve X,Y for set, x,x1,x2,y,y1,y2,z for set, f,g,h for Function; reserve M for non empty set; definition let M; assume not {} in M; mode Choice_Function of M -> Function of M, union M means for X st X in M holds it.X in X; end; reserve D for non empty set; definition let D be set; func BOOL D -> set equals bool D \ {{}}; end; registration let D; cluster BOOL D -> non empty; end; theorem not {} in BOOL D; theorem D c= X iff D in BOOL X; reserve P for Relation; definition let X; mode Order of X is total reflexive antisymmetric transitive Relation of X; end; reserve O for Order of X; theorem x in X implies [x,x] in O; theorem x in X & y in X & [x,y] in O & [y,x] in O implies x = y; theorem x in X & y in X & z in X & [x,y] in O & [y,z] in O implies [x,z] in O; theorem (ex X st X <> {} & X in Y) iff union Y <> {}; theorem P is_strongly_connected_in X iff P is_reflexive_in X & P is_connected_in X; theorem P is_reflexive_in X & Y c= X implies P is_reflexive_in Y; theorem P is_antisymmetric_in X & Y c= X implies P is_antisymmetric_in Y; theorem P is_transitive_in X & Y c= X implies P is_transitive_in Y; theorem P is_strongly_connected_in X & Y c= X implies P is_strongly_connected_in Y; theorem for R being total Relation of X holds field R = X; theorem for A being set, R being Relation of A st R is_reflexive_in A holds dom R = A & field R = A; begin reserve R,P for Relation, X,X1,X2,Y,Z,x,y,z,u for set, g,h for Function, O for Order of X, D for non empty set, d,d1,d2 for Element of D, A1,A2,B for Ordinal, L,L1,L2 for T-Sequence; theorem dom O = X & rng O = X; theorem field O = X; definition let R; attr R is being_quasi-order means R is reflexive transitive; attr R is being_partial-order means R is reflexive transitive antisymmetric; attr R is being_linear-order means R is reflexive transitive antisymmetric connected; end; theorem R is being_quasi-order implies R~ is being_quasi-order; theorem R is being_partial-order implies R~ is being_partial-order; theorem R is being_linear-order implies R~ is being_linear-order; theorem R is well-ordering implies R is being_quasi-order & R is being_partial-order & R is being_linear-order; theorem R is being_linear-order implies R is being_quasi-order & R is being_partial-order; theorem R is being_partial-order implies R is being_quasi-order; theorem O is being_partial-order; theorem O is being_quasi-order; theorem O is connected implies O is being_linear-order; theorem R is being_quasi-order implies R|_2 X is being_quasi-order; theorem R is being_partial-order implies R|_2 X is being_partial-order; theorem R is being_linear-order implies R|_2 X is being_linear-order; registration let R be empty Relation; cluster field R -> empty; end; registration cluster empty -> being_quasi-order being_partial-order being_linear-order well-ordering for Relation; end; registration let X; cluster id X -> being_quasi-order being_partial-order; end; definition let R,X; pred R quasi_orders X means R is_reflexive_in X & R is_transitive_in X; pred R partially_orders X means R is_reflexive_in X & R is_transitive_in X & R is_antisymmetric_in X; pred R linearly_orders X means R is_reflexive_in X & R is_transitive_in X & R is_antisymmetric_in X & R is_connected_in X; end; theorem R well_orders X implies R quasi_orders X & R partially_orders X & R linearly_orders X; theorem R linearly_orders X implies R quasi_orders X & R partially_orders X; theorem R partially_orders X implies R quasi_orders X; theorem R is being_quasi-order implies R quasi_orders field R; theorem R quasi_orders Y & X c= Y implies R quasi_orders X; theorem R quasi_orders X implies R|_2 X is being_quasi-order; theorem R is being_partial-order implies R partially_orders field R; theorem R partially_orders Y & X c= Y implies R partially_orders X; theorem R partially_orders X implies R|_2 X is being_partial-order; theorem R is being_linear-order implies R linearly_orders field R; theorem R linearly_orders Y & X c= Y implies R linearly_orders X; theorem R linearly_orders X implies R|_2 X is being_linear-order; theorem R quasi_orders X implies R~ quasi_orders X; theorem R partially_orders X implies R~ partially_orders X; theorem R linearly_orders X implies R~ linearly_orders X; theorem O quasi_orders X; theorem O partially_orders X; theorem R partially_orders X implies R |_2 X is Order of X; theorem R linearly_orders X implies R |_2 X is Order of X; theorem R well_orders X implies R |_2 X is Order of X; theorem id X quasi_orders X & id X partially_orders X; definition let R,X; pred X has_upper_Zorn_property_wrt R means for Y st Y c= X & R|_2 Y is being_linear-order ex x st x in X & for y st y in Y holds [y,x] in R; pred X has_lower_Zorn_property_wrt R means for Y st Y c= X & R|_2 Y is being_linear-order ex x st x in X & for y st y in Y holds [x,y] in R; end; theorem X has_upper_Zorn_property_wrt R implies X <> {}; theorem X has_lower_Zorn_property_wrt R implies X <> {}; theorem X has_upper_Zorn_property_wrt R iff X has_lower_Zorn_property_wrt R~; theorem X has_upper_Zorn_property_wrt R~ iff X has_lower_Zorn_property_wrt R; definition let R,x; pred x is_maximal_in R means x in field R & not ex y st y in field R & y <> x & [x,y] in R; pred x is_minimal_in R means x in field R & not ex y st y in field R & y <> x & [y,x] in R; pred x is_superior_of R means x in field R & for y st y in field R & y <> x holds [y,x] in R; pred x is_inferior_of R means x in field R & for y st y in field R & y <> x holds [x,y] in R; end; theorem x is_inferior_of R & R is antisymmetric implies x is_minimal_in R; theorem x is_superior_of R & R is antisymmetric implies x is_maximal_in R; theorem x is_minimal_in R & R is connected implies x is_inferior_of R; theorem x is_maximal_in R & R is connected implies x is_superior_of R; theorem x in X & x is_superior_of R & X c= field R & R is reflexive implies X has_upper_Zorn_property_wrt R; theorem x in X & x is_inferior_of R & X c= field R & R is reflexive implies X has_lower_Zorn_property_wrt R; theorem x is_minimal_in R iff x is_maximal_in R~; theorem x is_minimal_in R~ iff x is_maximal_in R; theorem x is_inferior_of R iff x is_superior_of R~; theorem x is_inferior_of R~ iff x is_superior_of R; reserve A,C for Ordinal; theorem for R,X st R partially_orders X & field R = X & X has_upper_Zorn_property_wrt R ex x st x is_maximal_in R; theorem for R,X st R partially_orders X & field R = X & X has_lower_Zorn_property_wrt R ex x st x is_minimal_in R; theorem for X st X <> {} & for Z st Z c= X & Z is c=-linear ex Y st Y in X & for X1 st X1 in Z holds X1 c= Y ex Y st Y in X & for Z st Z in X & Z <> Y holds not Y c= Z; theorem for X st X <> {} & for Z st Z c= X & Z is c=-linear ex Y st Y in X & for X1 st X1 in Z holds Y c= X1 ex Y st Y in X & for Z st Z in X & Z <> Y holds not Z c= Y; theorem for X st X <> {} & for Z st Z <> {} & Z c= X & Z is c=-linear holds union Z in X ex Y st Y in X & for Z st Z in X & Z <> Y holds not Y c= Z ; theorem for X st X <> {} & for Z st Z <> {} & Z c= X & Z is c=-linear holds meet Z in X ex Y st Y in X & for Z st Z in X & Z <> Y holds not Z c= Y; scheme ZornMax{A() -> non empty set, P[set,set]}: ex x being Element of A() st for y being Element of A() st x <> y holds not P[x,y] provided for x being Element of A() holds P[x,x] and for x,y being Element of A() st P[x,y] & P[y,x] holds x = y and for x,y,z being Element of A() st P[x,y] & P[y,z] holds P[x,z] and for X st X c= A() & (for x,y being Element of A() st x in X & y in X holds P[x,y] or P[y,x]) holds ex y being Element of A() st for x being Element of A() st x in X holds P[x,y]; scheme ZornMin{A() -> non empty set, P[set,set]}: ex x being Element of A() st for y being Element of A() st x <> y holds not P[y,x] provided for x being Element of A() holds P[x,x] and for x,y being Element of A() st P[x,y] & P[y,x] holds x = y and for x,y,z being Element of A() st P[x,y] & P[y,z] holds P[x,z] and for X st X c= A() & (for x,y being Element of A() st x in X & y in X holds P[x,y] or P[y,x]) holds ex y being Element of A() st for x being Element of A() st x in X holds P[y,x]; theorem R partially_orders X & field R = X implies ex P st R c= P & P linearly_orders X & field P = X; theorem R c= [:field R,field R:]; theorem R is reflexive & X c= field R implies field(R|_2 X) = X; theorem R is_reflexive_in X implies R|_2 X is reflexive; theorem R is_transitive_in X implies R|_2 X is transitive; theorem R is_antisymmetric_in X implies R|_2 X is antisymmetric; theorem R is_connected_in X implies R|_2 X is connected; theorem R is_connected_in X & Y c= X implies R is_connected_in Y; theorem R well_orders X & Y c= X implies R well_orders Y; theorem R is connected implies R~ is connected; theorem R is_reflexive_in X implies R~ is_reflexive_in X; theorem R is_transitive_in X implies R~ is_transitive_in X; theorem R is_antisymmetric_in X implies R~ is_antisymmetric_in X; theorem R is_connected_in X implies R~ is_connected_in X; theorem (R|_2 X)~ = R~|_2 X; theorem R|_2 {} = {}; begin theorem Z is finite & Z c= rng f implies ex Y st Y c= dom f & Y is finite & f .:Y = Z ; theorem field R is finite implies R is finite; theorem dom R is finite & rng R is finite implies R is finite; registration cluster order_type_of {} -> empty; end; theorem for O being Ordinal holds order_type_of RelIncl O = O; begin reserve x,y,z,X,Y for set; theorem {x} c= {x,y,z}; theorem {x,y} c= {x,y,z}; canceled 3; theorem for X,Y for f being Function holds f.:(Y \ f"X) = f.:Y \ X; reserve X,Y for non empty set, f for Function of X,Y; theorem for x being Element of X holds x in f"{f.x}; theorem for x being Element of X holds Im(f,x) = {f.x}; theorem for B being Element of Fin X for x st x in B holds x is Element of X; theorem for A being (Element of Fin X), B being set for f being Function of X, Y st for x being Element of X holds x in A implies f.x in B holds f.:A c= B; theorem for X being set for B being Element of Fin X for A being set st A c= B holds A is Element of Fin X; theorem for B being Element of Fin X st B <> {} ex x being Element of X st x in B; theorem for A being Element of Fin X holds f.:A = {} implies A = {}; registration let X be set; cluster empty for Element of Fin X; end; definition let X be set; func {}.X -> empty Element of Fin X equals {}; end; scheme FinSubFuncEx{ A()->non empty set, B()->(Element of Fin A()), P[set,set] } : ex f being Function of A(), Fin A() st for b,a being Element of A() holds a in f.b iff a in B() & P[a,b]; definition let X be non empty set, F be BinOp of X; attr F is having_a_unity means ex x being Element of X st x is_a_unity_wrt F; end; theorem for X being non empty set, F being BinOp of X holds F is having_a_unity iff the_unity_wrt F is_a_unity_wrt F; theorem for X being non empty set, F being BinOp of X st F is having_a_unity for x being Element of X holds F.(the_unity_wrt F, x) = x & F.(x , the_unity_wrt F) = x; registration let X be non empty set; cluster non empty for Element of Fin X; end; notation let X be non empty set, x be Element of X; synonym {.x.} for {x}; let y be Element of X; synonym {.x,y.} for {x,y}; let z be Element of X; synonym {.x,y,z.} for {x,y,z}; end; definition let X be non empty set, x be Element of X; redefine func {.x.} -> Element of Fin X; let y be Element of X; redefine func {.x,y.} -> Element of Fin X; let z be Element of X; redefine func {.x,y,z.} -> Element of Fin X; end; definition let X be set; let A,B be Element of Fin X; redefine func A \/ B -> Element of Fin X; end; definition let X be set; let A,B be Element of Fin X; redefine func A \ B -> Element of Fin X; end; scheme FinSubInd1{ X() -> non empty set, P[set] } : for B being Element of Fin X() holds P[B] provided P[{}.X()] and for B9 being (Element of Fin X()), b being Element of X() holds P[B9 ] & not b in B9 implies P[B9 \/ {b}]; scheme FinSubInd2{ X() -> non empty set, P[Element of Fin X()] } : for B being non empty Element of Fin X() holds P[B] provided for x being Element of X() holds P[{.x.}] and for B1,B2 being non empty Element of Fin X() st P[B1] & P[B2] holds P[B1 \/ B2]; scheme FinSubInd3{ X() -> non empty set, P[set] } : for B being Element of Fin X() holds P[B] provided P[{}.X()] and for B9 being (Element of Fin X()), b being Element of X() holds P[B9 ] implies P[B9 \/ {b}]; definition let X, Y be non empty set; let F be BinOp of Y; let B be Element of Fin X; let f be Function of X,Y; assume that B <> {} or F is having_a_unity and F is commutative and F is associative; func F $$ (B,f) -> Element of Y means ex G being Function of Fin X, Y st it = G.B & (for e being Element of Y st e is_a_unity_wrt F holds G.{} = e) & (for x being Element of X holds G.{x} = f.x) & for B9 being Element of Fin X st B9 c= B & B9 <> {} for x being Element of X st x in B \ B9 holds G.(B9 \/ {x}) = F.(G.B9,f.x); end; theorem for X, Y being non empty set for F being BinOp of Y for B being Element of Fin X for f being Function of X,Y st (B <> {} or F is having_a_unity ) & F is idempotent & F is commutative & F is associative for IT being Element of Y holds IT = F $$ (B,f) iff ex G being Function of Fin X, Y st IT = G.B & ( for e being Element of Y st e is_a_unity_wrt F holds G.{} = e) & (for x being Element of X holds G.{x} = f.x) & for B9 being Element of Fin X st B9 c= B & B9 <> {} for x being Element of X st x in B holds G.(B9 \/ {x}) = F.(G.B9,f.x); reserve X, Y for non empty set, F for (BinOp of Y), B for (Element of Fin X), f for Function of X,Y; theorem F is commutative & F is associative implies for b being Element of X holds F $$ ({.b.},f) = f.b; theorem F is idempotent & F is commutative & F is associative implies for a,b being Element of X holds F $$ ({.a,b.},f) = F.(f.a, f.b); theorem F is idempotent & F is commutative & F is associative implies for a,b,c being Element of X holds F $$ ({.a,b,c.},f) = F.(F.(f.a, f.b), f.c) ; theorem F is idempotent & F is commutative & F is associative & B <> {} implies for x being Element of X holds F $$(B \/ {.x.}, f) = F.(F $$(B,f),f.x); theorem F is idempotent & F is commutative & F is associative implies for B1,B2 being Element of Fin X st B1 <> {} & B2 <> {} holds F $$ (B1 \/ B2,f) = F.(F $$ (B1,f),F $$ (B2,f)); theorem F is commutative & F is associative & F is idempotent implies for x being Element of X st x in B holds F.(f.x,F$$(B,f)) = F$$(B,f); theorem F is commutative & F is associative & F is idempotent implies for B,C being Element of Fin X st B <> {} & B c= C holds F.(F$$(B,f),F$$(C,f)) = F$$(C, f); theorem B <> {} & F is commutative & F is associative & F is idempotent implies for a being Element of Y st for b being Element of X st b in B holds f. b = a holds F$$(B,f) = a; theorem F is commutative & F is associative & F is idempotent implies for a being Element of Y st f.:B = {a} holds F$$(B,f) = a; theorem F is commutative & F is associative & F is idempotent implies for f,g being Function of X,Y for A,B being Element of Fin X st A <> {} & f.:A = g.:B holds F$$(A,f) = F$$(B,g); theorem for F,G being BinOp of Y st F is idempotent & F is commutative & F is associative & G is_distributive_wrt F for B being Element of Fin X st B <> {} for f being Function of X,Y for a being Element of Y holds G.(a,F$$(B,f)) = F$$ (B,G[;](a,f)); theorem for F,G being BinOp of Y st F is idempotent & F is commutative & F is associative & G is_distributive_wrt F for B being Element of Fin X st B <> {} for f being Function of X,Y for a being Element of Y holds G.(F$$(B,f),a) = F$$ (B,G[:](f,a)); definition let X, Y be non empty set; let f be Function of X,Y; let A be Element of Fin X; redefine func f.:A -> Element of Fin Y; end; theorem for A, X, Y being non empty set for F being BinOp of A st F is idempotent & F is commutative & F is associative for B being Element of Fin X st B <> {} for f being Function of X,Y holds for g being Function of Y,A holds F$$(f.:B,g) = F$$(B,g*f); theorem F is commutative & F is associative & F is idempotent implies for Z being non empty set for G being BinOp of Z st G is commutative & G is associative & G is idempotent for f being Function of X, Y for g being Function of Y,Z st for x,y being Element of Y holds g.(F.(x,y)) = G.(g.x,g.y) for B being Element of Fin X st B <> {} holds g.(F$$(B,f)) = G$$(B,g*f); theorem F is commutative & F is associative & F is having_a_unity implies for f holds F$$({}.X,f) = the_unity_wrt F; theorem F is idempotent & F is commutative & F is associative & F is having_a_unity implies for x being Element of X holds F $$(B \/ {.x.}, f) = F.( F $$(B,f),f.x); theorem F is idempotent & F is commutative & F is associative & F is having_a_unity implies for B1,B2 being Element of Fin X holds F $$ (B1 \/ B2,f) = F.(F $$ (B1,f),F $$ (B2,f)); theorem F is commutative & F is associative & F is idempotent & F is having_a_unity implies for f,g being Function of X,Y for A,B being Element of Fin X st f.:A = g.:B holds F$$(A,f) = F$$(B,g); theorem for A, X, Y being non empty set for F being BinOp of A st F is idempotent & F is commutative & F is associative & F is having_a_unity for B being Element of Fin X for f being Function of X,Y holds for g being Function of Y,A holds F$$(f.:B,g) = F$$(B,g*f); theorem F is commutative & F is associative & F is idempotent & F is having_a_unity implies for Z being non empty set for G being BinOp of Z st G is commutative & G is associative & G is idempotent & G is having_a_unity for f being Function of X, Y for g being Function of Y,Z st g.the_unity_wrt F = the_unity_wrt G & for x,y being Element of Y holds g.(F.(x,y)) = G.(g.x,g.y) for B being Element of Fin X holds g.(F$$(B,f)) = G$$(B,g*f); definition let A be set; func FinUnion A -> BinOp of Fin A means for x,y being Element of Fin A holds it.(x,y) = (x \/ y); end; reserve A for set, x,y,z for Element of Fin A; theorem FinUnion A is idempotent; theorem FinUnion A is commutative; theorem FinUnion A is associative; theorem {}.A is_a_unity_wrt FinUnion A; theorem FinUnion A is having_a_unity; theorem the_unity_wrt FinUnion A is_a_unity_wrt FinUnion A; theorem the_unity_wrt FinUnion A = {}; reserve X,Y for non empty set, A for set, f for (Function of X, Fin A), i,j,k for (Element of X); definition let X be non empty set, A be set; let B be Element of Fin X; let f be Function of X, Fin A; func FinUnion(B,f) -> Element of Fin A equals FinUnion A $$(B,f); end; theorem FinUnion({.i.},f) = f.i; theorem FinUnion({.i,j.},f) = f.i \/ f.j; theorem FinUnion({.i,j,k.},f) = f.i \/ f.j \/ f.k; theorem FinUnion({}.X,f) = {}; theorem for B being Element of Fin X holds FinUnion(B \/ {.i.}, f) = FinUnion(B,f) \/ f.i; theorem for B being Element of Fin X holds FinUnion(B,f) = union (f.:B); theorem for B1,B2 being Element of Fin X holds FinUnion(B1 \/ B2, f) = FinUnion(B1,f) \/ FinUnion(B2,f); theorem for B being Element of Fin X for f being Function of X,Y holds for g being Function of Y,Fin A holds FinUnion(f.:B,g) = FinUnion(B,g*f); theorem for A,X being non empty set, Y being set for G being BinOp of A st G is commutative & G is associative & G is idempotent for B being Element of Fin X st B <> {} for f being (Function of X,Fin Y), g being Function of Fin Y,A st for x,y being Element of Fin Y holds g.(x \/ y) = G.(g.x,g.y) holds g.( FinUnion(B,f)) = G$$(B,g*f); theorem for Z being non empty set, Y being set for G being BinOp of Z st G is commutative & G is associative & G is idempotent & G is having_a_unity for f being Function of X, Fin Y for g being Function of Fin Y,Z st g.{}.Y = the_unity_wrt G & for x,y being Element of Fin Y holds g.(x \/ y) = G.(g.x,g.y) for B being Element of Fin X holds g.(FinUnion(B,f)) = G$$(B,g*f); definition let A be set; func singleton A -> Function of A, Fin A means for x being set st x in A holds it.x = {x}; end; theorem for A being non empty set for f being Function of A, Fin A holds f = singleton A iff for x being Element of A holds f.x = {x}; theorem for x being set, y being Element of X holds x in singleton X.y iff x = y; theorem for x,y,z being Element of X st x in singleton X.z & y in singleton X. z holds x = y; theorem for B being Element of Fin X, x being set holds x in FinUnion(B, f) iff ex i being Element of X st i in B & x in f.i; theorem for B being Element of Fin X holds FinUnion(B, singleton X) = B; theorem for Y,Z being set for f being Function of X, Fin Y for g being Function of Fin Y, Fin Z st g.{}.Y = {}.Z & for x,y being Element of Fin Y holds g.(x \/ y) = g.x \/ g.y for B being Element of Fin X holds g.(FinUnion(B, f)) = FinUnion(B,g*f); begin reserve B for non empty set, A,X,x for set; scheme Fraenkel59{ A() -> set, F(set) -> set, P,Q[set] } : { F(v) where v is Element of A() : P[v] } c= { F(u) where u is Element of A() : Q[u] } provided for v being Element of A() holds P[v] implies Q[v]; scheme Fraenkel599 { A,B() -> set, F(set,set) -> set, P,Q[set,set] } : { F(u1,v1) where u1 is Element of A(), v1 is Element of B() : P[u1,v1] } c= { F(u2,v2) where u2 is Element of A(), v2 is Element of B() : Q[u2,v2] } provided for u being (Element of A()), v being Element of B() holds P[u,v] implies Q[u,v]; scheme Fraenkel69{ B() -> set, F(set) -> set, P, Q[set] } : { F(v1) where v1 is Element of B() : P[v1] } = { F(v2) where v2 is Element of B() : Q[v2] } provided for v being Element of B() holds P[v] iff Q[v]; scheme Fraenkel699 { A,B() -> set, F(set,set) -> set, P,Q[set,set] } : { F(u1,v1) where u1 is Element of A(), v1 is Element of B() : P[u1,v1] } = { F(u2,v2) where u2 is Element of A(), v2 is Element of B() : Q[u2,v2] } provided for u being Element of A(), v being Element of B() holds P[u,v] iff Q[u,v]; scheme FraenkelF9{ B() -> set, F,G(set) -> set, P[set] } : { F(v1) where v1 is Element of B() : P[v1] } = { G(v2) where v2 is Element of B() : P[v2] } provided for v being Element of B() holds F(v) = G(v); scheme FraenkelF9R{ B() -> set, F,G(set) -> set, P[set] } : { F(v1) where v1 is Element of B() : P[v1] } = { G(v2) where v2 is Element of B() : P[v2] } provided for v being Element of B() st P[v] holds F(v) = G(v); scheme FraenkelF99 { A,B() -> set, F(set,set) -> set, G(set,set) -> set, P[set,set] } : { F(u1,v1) where u1 is Element of A(), v1 is Element of B() : P[u1,v1] } = { G(u2,v2) where u2 is Element of A(), v2 is Element of B() : P[u2,v2] } provided for u being Element of A(), v being Element of B() holds F(u,v) = G(u,v); scheme FraenkelF699 { A,B() -> set, F(set,set) -> set, P,Q[set,set] } : { F(u1,v1) where u1 is Element of A(), v1 is Element of B() : P[u1,v1] } = { F(v2,u2) where u2 is Element of A(), v2 is Element of B() : Q[u2,v2] } provided for u being Element of A(), v being Element of B() holds P[u,v] iff Q[u,v] and for u being Element of A(), v being Element of B() holds F(u,v) = F(v,u); theorem for A,B being set, F,G being Function of A,B for X being set st F|X = G|X for x being Element of A st x in X holds F.x = G.x; theorem for A,B being set holds Funcs(A,B) c= bool [:A,B:]; theorem for X,Y being set st Funcs(X,Y) <> {} & X c= A & Y c= B for f being Element of Funcs(X,Y) holds f is PartFunc of A,B; scheme RelevantArgs { A,B,X() -> set, f,g() -> Function of A(),B(), P[set], Q[set] } : { f().u9 where u9 is Element of A() : P[u9] & u9 in X() } = { g().v9 where v9 is Element of A() : Q[v9] & v9 in X() } provided f()|X() = g()|X() and for u being Element of A() st u in X() holds P[u] iff Q[u]; scheme FrSet0{ A() -> non empty set, P[set] }: { x where x is Element of A(): P[x] } c= A(); scheme Gen199{A,B() -> set, F(set,set) -> set, P[set,set], Q[set] } : for s being Element of A(), t being Element of B() st P[s,t] holds Q[F(s,t)] provided for st1 being set st st1 in { F(s1,t1) where s1 is (Element of A()), t1 is Element of B(): P[s1,t1] } holds Q[st1]; scheme Gen199A{A,B() -> set, F(set,set) -> set, P[set,set], Q[set] } : for st1 being set st st1 in { F(s1,t1) where s1 is Element of A(), t1 is Element of B(): P[s1,t1] } holds Q[st1] provided for s being Element of A(), t being Element of B() st P[s,t] holds Q[F(s,t)]; scheme Gen299{A,B,C() -> set, F(set,set) -> Element of C(), P[set, set], Q[set] } : { st1 where st1 is Element of C() : st1 in { F(s1,t1) where s1 is Element of A(), t1 is Element of B() : P[s1,t1] } & Q[st1] } = { F(s2,t2) where s2 is Element of A(), t2 is Element of B() : P[s2,t2] & Q[F(s2,t2)]}; scheme Gen39{A() -> set, F(set) -> set, P[set], Q[set] } : { F(s) where s is Element of A() : s in { s1 where s1 is Element of A(): Q[s1] } & P[s] } = { F(s2) where s2 is Element of A() : Q[s2] & P[s2] }; scheme Gen399{A,B() -> set, F(set,set) -> set, P[set, set], Q[set] } : { F(s,t) where s is (Element of A()), t is Element of B() : s in { s1 where s1 is Element of A(): Q[s1] } & P[s,t] } = { F(s2,t2) where s2 is (Element of A()), t2 is Element of B() : Q[s2] & P[s2,t2] }; scheme Gen499{A,B() -> set, F(set,set) -> set, P[set, set], Q[set,set] } : { F(s,t) where s is (Element of A()), t is Element of B() : P[s,t] } c= { F(s1,t1) where s1 is (Element of A()), t1 is Element of B() : Q [s1,t1] } provided for s being (Element of A()), t being Element of B() st P[s,t] ex s9 being Element of A() st Q[s9,t] & F(s,t) = F(s9,t); scheme FrSet1{ D,A() -> set, P[set], F(set) -> set }: { F(y) where y is Element of D() : F(y) in A() & P[y] } c= A(); scheme FrSet2{ D,A() -> set, Q[set], F(set) -> set }: { F(y) where y is Element of D() : Q[y] & not F(y) in A() } misses A(); scheme FrEqua1{ A,B() -> set, F(set,set) -> set, x() -> (Element of B()), P[set,set], Q[set,set] }: { F(s,t) where s is (Element of A()), t is Element of B(): Q[s,t] } = { F(s9,x()) where s9 is Element of A(): P [s9,x()] } provided for s being Element of A() for t being Element of B() holds Q[s,t] iff t = x() & P[s,t]; scheme FrEqua2{ A,B() -> set, F(set,set) -> set, x() -> (Element of B()), P[set,set] }: { F(s,t) where s is (Element of A()), t is Element of B(): t = x() & P[s,t] } = { F(s9,x()) where s9 is Element of A(): P[ s9,x()] }; reserve phi for Element of Funcs(A,B); theorem for X,Y being set st Funcs(X,Y) <> {} & X c= A & Y c= B for f being Element of Funcs(X,Y) ex phi being Element of Funcs(A,B) st phi|X = f; theorem phi|X = phi|(A /\ X); scheme FraenkelFin { A() -> set, X() -> set, F(set) -> set }: { F(w) where w is Element of A(): w in X() } is finite provided X() is finite; scheme CartFin { A, B() -> non empty set, X, Y() -> set, F(set, set) -> set }: { F(u,v) where u is Element of A(), v is Element of B() : u in X() & v in Y () } is finite provided X() is finite and Y() is finite; scheme Finiteness { A()->non empty set, B()->(Element of Fin A()), P[(Element of A( )), Element of A()] } : for x being Element of A() st x in B() ex y being Element of A() st y in B() & P[y,x] & for z being Element of A() st z in B() & P[z,y] holds P[y,z] provided for x being Element of A() holds P[x,x] and for x,y,z being Element of A() st P[x,y] & P[y,z] holds P[x,z]; scheme FinIm{A,B()->non empty set, x()-> (Element of Fin B()), F (set)->(Element of A()), P[set,set]}: ex c1 being Element of Fin A() st for t being Element of A() holds t in c1 iff ex t9 being Element of B() st t9 in x() & t = F(t9) & P[t,t9]; registration let A, B be finite set; cluster Funcs(A,B) -> finite; end; theorem for A,B being set st A is finite & B is finite holds Funcs(A,B) is finite; scheme ImFin { A() -> set, B() -> non empty set, X() -> set, Y() -> set, F(set) -> set } : { F(phi9) where phi9 is Element of Funcs(A(),B()): phi9.:X() c= Y() } is finite provided X() is finite and Y() is finite and for phi,psi being Element of Funcs(A(),B()) holds phi|X() = psi|X() implies F(phi) = F(psi); scheme FunctChoice { A()->non empty set, B()->non empty set, P[(Element of A()), Element of B()], x()->Element of Fin A() }: ex ff being Function of A(), B() st for t being Element of A() st t in x() holds P[t,ff.t] provided for t being Element of A() st t in x() ex ff being Element of B() st P[t,ff]; scheme FuncsChoice { A()->non empty set, B()->non empty set, P[Element of A(), Element of B()], x()->Element of Fin A() }: ex ff being Element of Funcs(A(),B( )) st for t being Element of A() st t in x() holds P[t,ff.t] provided for t being Element of A() st t in x() ex ff being Element of B() st P[t,ff]; scheme FraenkelFin9 { A,B() -> non empty set, X() -> set, P[set,set] }: { x where x is Element of B(): ex w being Element of A() st P[w,x] & w in X() } is finite provided X() is finite and for w being Element of A(), x,y being Element of B() st P[w,x] & P[w ,y] holds x = y; begin reserve A,B,C for Ordinal, X,X1,Y,Y1,Z,a,b,b1,b2,x,y,z for set, R for Relation, f,g,h for Function, k,m,n for Nat; notation synonym 0 for {}; end; definition let IT be set; attr IT is cardinal means ex B st IT = B & for A st A,B are_equipotent holds B c= A; end; registration cluster cardinal for set; end; definition mode Cardinal is cardinal set; end; registration cluster cardinal -> ordinal for set; end; reserve M,N for Cardinal; theorem for X ex A st X,A are_equipotent; theorem M = N iff M,N are_equipotent; theorem M in N iff M c= N & M <> N; theorem M in N iff not N c= M; definition let X; func card X -> Cardinal means X,it are_equipotent; projectivity; end; registration cluster empty -> cardinal for set; end; registration let X be empty set; cluster card X -> empty; end; registration let X be non empty set; cluster card X -> non empty; end; theorem X,Y are_equipotent iff card X = card Y; theorem R is well-ordering implies field R,order_type_of R are_equipotent; theorem X c= M implies card X c= M; theorem card A c= A; theorem X in M implies card X in M; theorem card X c= card Y iff ex f st f is one-to-one & dom f = X & rng f c= Y; theorem X c= Y implies card X c= card Y; theorem card X c= card Y iff ex f st dom f = Y & X c= rng f; theorem not X,bool X are_equipotent; theorem card X in card bool X; definition let X; func nextcard X -> Cardinal means card X in it & for M st card X in M holds it c= M; end; theorem {} in nextcard X; theorem card X = card Y implies nextcard X = nextcard Y; theorem X,Y are_equipotent implies nextcard X = nextcard Y; theorem A in nextcard A; reserve S for T-Sequence; definition let M; attr M is limit_cardinal means not ex N st M = nextcard N; end; definition let A; func alef A -> set means ex S st it = last S & dom S = succ A & S.{} = card omega & (for B st succ B in succ A holds S.succ B = nextcard union { S.B }) & for B st B in succ A & B <> {} & B is limit_ordinal holds S.B = card sup(S |B); end; registration let A; cluster alef A -> cardinal; end; theorem alef succ A = nextcard alef A; theorem A <> {} & A is limit_ordinal implies for S st dom S = A & for B st B in A holds S.B = alef B holds alef A = card sup S; theorem A in B iff alef A in alef B; theorem alef A = alef B implies A = B; theorem A c= B iff alef A c= alef B; theorem X c= Y & Y c= Z & X,Z are_equipotent implies X,Y are_equipotent & Y,Z are_equipotent; theorem bool Y c= X implies card Y in card X & not Y,X are_equipotent; theorem X,{} are_equipotent implies X = {}; theorem card {} = {}; theorem X,{x} are_equipotent iff ex x st X = { x }; theorem card X = card { x } iff ex x st X = { x }; theorem card { x } = 1; theorem X misses X1 & Y misses Y1 & X,Y are_equipotent & X1,Y1 are_equipotent implies X \/ X1,Y \/ Y1 are_equipotent; theorem x in X & y in X implies X \ { x },X \ { y } are_equipotent; theorem X c= dom f & f is one-to-one implies X,f.:X are_equipotent; theorem X,Y are_equipotent & x in X & y in Y implies X \ { x },Y \ { y } are_equipotent; theorem succ X, succ Y are_equipotent implies X, Y are_equipotent; theorem n = {} or ex m st n = succ m; theorem x in omega implies x is cardinal; registration cluster natural -> cardinal for number; end; theorem X,Y are_equipotent & X is finite implies Y is finite; theorem n is finite & card n is finite; theorem card n = card m implies n = m; theorem card n c= card m iff n c= m; theorem card n in card m iff n in m; theorem X is finite implies ex n st X,n are_equipotent; theorem nextcard card n = card succ n; definition let n be Nat; redefine func succ n -> Element of omega; end; definition let X be finite set; redefine func card X -> Element of omega; end; theorem X is finite implies nextcard X is finite; scheme CardinalInd { Sigma[set] }: for M holds Sigma[M] provided Sigma[{}] and for M st Sigma[M] holds Sigma[nextcard M] and for M st M <> {} & M is limit_cardinal & for N st N in M holds Sigma [N] holds Sigma[M]; scheme CardinalCompInd { Sigma[set] }: for M holds Sigma[M] provided for M st for N st N in M holds Sigma[N] holds Sigma[M]; theorem alef 0 = omega; registration cluster omega -> cardinal for number; end; theorem card omega = omega; registration cluster omega -> limit_cardinal; end; registration cluster -> finite for Element of omega; end; registration cluster finite for Cardinal; end; theorem for M being finite Cardinal ex n st M = card n; registration let X be finite set; cluster card X -> finite; end; registration cluster omega -> infinite; end; registration cluster infinite for set; end; registration let X be infinite set; cluster card X -> infinite; end; begin theorem 1 = { 0 }; theorem 2 = { 0,1 }; theorem 3 = { 0,1,2 }; theorem 4 = { 0,1,2,3 }; theorem 5 = { 0,1,2,3,4 }; theorem 6 = { 0,1,2,3,4,5 }; theorem 7 = { 0,1,2,3,4,5,6 }; theorem 8 = { 0,1,2,3,4,5,6,7 }; theorem 9 = { 0,1,2,3,4,5,6,7,8 }; theorem 10 = { 0,1,2,3,4,5,6,7,8,9 }; theorem for f being Function st dom f is infinite & f is one-to-one holds rng f is infinite; reserve k,n,m for Nat; definition let n; func Segm n -> set equals n; end; reserve l for Element of omega; definition let n; redefine func Segm n -> Subset of omega; end; theorem A,n are_equipotent implies A = n; theorem A is finite iff A in omega; registration cluster natural -> finite for set; end; registration let A be infinite set; cluster bool A -> infinite; let B be non empty set; cluster [:A,B:] ->infinite; cluster [:B,A:] ->infinite; end; registration let X be infinite set; cluster infinite for Subset of X; end; registration cluster finite ordinal -> natural for number; end; theorem for f being Function holds card f = card dom f; registration let X be finite set; cluster RelIncl X -> finite; end; theorem RelIncl X is finite implies X is finite; theorem card(k -->x) = k; begin definition let N,X be set; attr X is N-element means card X = N; end; registration let N be Cardinal; cluster N-element for set; end; registration cluster 0-element -> empty for set; cluster empty -> 0-element for set; end; registration let x be set; cluster {x} -> 1-element; end; registration let N be Cardinal; cluster N-element for Function; end; registration let N be Cardinal; let f be N-element Function; cluster dom f -> N-element; end; registration cluster 1-element -> trivial non empty for set; cluster trivial non empty -> 1-element for set; end; registration let X be non empty set; cluster 1-element for Subset of X; end; definition let X be non empty set; mode Singleton of X is 1-element Subset of X; end; theorem for X being non empty set, A being Singleton of X ex x being Element of X st A = {x}; theorem card X c= card Y iff ex f st X c= f.:Y; theorem card (f.:X) c= card X; theorem card X in card Y implies Y \ X <> {}; theorem X,[:X,{x}:] are_equipotent & card X = card [:X,{x}:]; theorem for f being Function st f is one-to-one holds card dom f = card rng f; begin reserve X,Y,Z,X1,X2,Y1,Y2,x,y,z,t,x1,x2 for set, f,g,h,f1,f2,g1,g2 for Function; scheme LambdaFS { FS()->set, f(set)->set }: ex f st dom f = FS() & for g st g in FS () holds f.g = f(g); theorem ~{} = {}; canceled 6; theorem proj1 {} = {} & proj2 {} = {}; theorem Y <> {} or [:X,Y:] <> {} or [:Y,X:] <> {} implies proj1 [:X,Y:] = X & proj2 [:Y,X:] = X; theorem proj1 [:X,Y:] c= X & proj2 [:X,Y:] c= Y; theorem Z c= [:X,Y:] implies proj1 Z c= X & proj2 Z c= Y; theorem proj1 {[x,y]} = {x} & proj2 {[x,y]} = {y}; theorem proj1 {[x,y],[z,t]} = {x,z} & proj2 {[x,y],[z,t]} = {y,t}; theorem not (ex x,y st [x,y] in X) implies proj1 X = {} & proj2 X = {}; theorem proj1 X = {} or proj2 X = {} implies not ex x,y st [x,y] in X; theorem proj1 X = {} iff proj2 X = {}; theorem proj1 dom f = proj2 dom ~f & proj2 dom f = proj1 dom ~f; theorem for f being Relation holds proj1 f = dom f & proj2 f = rng f; definition let f; func curry f -> Function means dom it = proj1 dom f & for x st x in proj1 dom f ex g st it.x = g & dom g = proj2 (dom f /\ [:{x},proj2 dom f:]) & for y st y in dom g holds g.y = f.(x,y); func uncurry f -> Function means (for t holds t in dom it iff ex x,g ,y st t = [x,y] & x in dom f & g = f.x & y in dom g) & for x,g st x in dom it & g = f.x`1 holds it.x = g.x`2; end; definition let f; func curry' f -> Function equals curry ~f; func uncurry' f -> Function equals ~(uncurry f); end; theorem [x,y] in dom f implies x in dom curry f & (curry f).x is Function; theorem [x,y] in dom f & g = (curry f).x implies y in dom g & g.y = f.(x ,y); theorem [x,y] in dom f implies y in dom curry' f & (curry' f).y is Function; theorem [x,y] in dom f & g = (curry' f).y implies x in dom g & g.x = f.(x,y); theorem dom curry' f = proj2 dom f; theorem [:X,Y:] <> {} & dom f = [:X,Y:] implies dom curry f = X & dom curry' f = Y; theorem dom f c= [:X,Y:] implies dom curry f c= X & dom curry' f c= Y; theorem rng f c= Funcs(X,Y) implies dom uncurry f = [:dom f,X:] & dom uncurry' f = [:X,dom f:]; theorem not (ex x,y st [x,y] in dom f) implies curry f = {} & curry' f = {}; theorem not (ex x st x in dom f & f.x is Function) implies uncurry f = {} & uncurry' f = {}; theorem [:X,Y:] <> {} & dom f = [:X,Y:] & x in X implies ex g st (curry f).x = g & dom g = Y & rng g c= rng f & for y st y in Y holds g.y = f.(x,y); theorem x in dom curry f implies (curry f).x is Function; theorem x in dom curry f & g = (curry f).x implies dom g = proj2 (dom f /\ [:{x},proj2 dom f:]) & dom g c= proj2 dom f & rng g c= rng f & for y st y in dom g holds g.y = f.(x,y) & [x,y] in dom f; theorem [:X,Y:] <> {} & dom f = [:X,Y:] & y in Y implies ex g st (curry' f).y = g & dom g = X & rng g c= rng f & for x st x in X holds g.x = f.(x,y); theorem x in dom curry' f implies (curry' f).x is Function; theorem x in dom curry' f & g = (curry' f).x implies dom g = proj1 (dom f /\ [:proj1 dom f,{x}:]) & dom g c= proj1 dom f & rng g c= rng f & for y st y in dom g holds g.y = f.(y,x) & [y,x] in dom f; theorem dom f = [:X,Y:] implies rng curry f c= Funcs(Y,rng f) & rng curry' f c= Funcs(X,rng f); theorem rng curry f c= PFuncs(proj2 dom f,rng f) & rng curry' f c= PFuncs( proj1 dom f,rng f); theorem rng f c= PFuncs(X,Y) implies dom uncurry f c= [:dom f,X:] & dom uncurry' f c= [:X,dom f:]; theorem x in dom f & g = f.x & y in dom g implies [x,y] in dom uncurry f & (uncurry f).(x,y) = g.y & g.y in rng uncurry f; theorem x in dom f & g = f.x & y in dom g implies [y,x] in dom uncurry' f & ( uncurry' f).(y,x) = g.y & g.y in rng uncurry' f; theorem rng f c= PFuncs(X,Y) implies rng uncurry f c= Y & rng uncurry' f c= Y; theorem rng f c= Funcs(X,Y) implies rng uncurry f c= Y & rng uncurry' f c= Y; theorem curry {} = {} & curry' {} = {}; theorem uncurry {} = {} & uncurry' {} = {}; theorem dom f1 = [:X,Y:] & dom f2 = [:X,Y:] & curry f1 = curry f2 implies f1 = f2; theorem dom f1 = [:X,Y:] & dom f2 = [:X,Y:] & curry' f1 = curry' f2 implies f1 = f2; theorem rng f1 c= Funcs(X,Y) & rng f2 c= Funcs(X,Y) & X <> {} & uncurry f1 = uncurry f2 implies f1 = f2; theorem rng f1 c= Funcs(X,Y) & rng f2 c= Funcs(X,Y) & X <> {} & uncurry' f1 = uncurry' f2 implies f1 = f2; theorem rng f c= Funcs(X,Y) & X <> {} implies curry uncurry f = f & curry' uncurry' f = f; theorem dom f = [:X,Y:] implies uncurry curry f = f & uncurry' curry' f = f; theorem dom f c= [:X,Y:] implies uncurry curry f = f & uncurry' curry' f = f; theorem rng f c= PFuncs(X,Y) & not {} in rng f implies curry uncurry f = f & curry' uncurry' f = f; theorem dom f1 c= [:X,Y:] & dom f2 c= [:X,Y:] & curry f1 = curry f2 implies f1 = f2; theorem dom f1 c= [:X,Y:] & dom f2 c= [:X,Y:] & curry' f1 = curry' f2 implies f1 = f2 ; theorem rng f1 c= PFuncs(X,Y) & rng f2 c= PFuncs(X,Y) & not {} in rng f1 & not {} in rng f2 & uncurry f1 = uncurry f2 implies f1 = f2; theorem rng f1 c= PFuncs(X,Y) & rng f2 c= PFuncs(X,Y) & not {} in rng f1 & not {} in rng f2 & uncurry' f1 = uncurry' f2 implies f1 = f2; theorem X c= Y implies Funcs(Z,X) c= Funcs(Z,Y); theorem Funcs({},X) = {{}}; theorem X,Funcs({x},X) are_equipotent & card X = card Funcs({x},X); theorem Funcs(X,{x}) = {X --> x}; theorem X1,Y1 are_equipotent & X2,Y2 are_equipotent implies Funcs(X1,X2) ,Funcs(Y1,Y2) are_equipotent & card Funcs(X1,X2) = card Funcs(Y1,Y2); theorem card X1 = card Y1 & card X2 = card Y2 implies card Funcs(X1,X2) = card Funcs(Y1,Y2); theorem X1 misses X2 implies Funcs(X1 \/ X2,X),[:Funcs(X1,X),Funcs(X2,X):] are_equipotent & card Funcs(X1 \/ X2,X) = card [:Funcs(X1,X),Funcs(X2,X):]; theorem Funcs([:X,Y:],Z),Funcs(X,Funcs(Y,Z)) are_equipotent & card Funcs([:X,Y :],Z) = card Funcs(X,Funcs(Y,Z)); theorem Funcs(Z,[:X,Y:]),[:Funcs(Z,X),Funcs(Z,Y):] are_equipotent & card Funcs (Z,[:X,Y:]) = card [:Funcs(Z,X),Funcs(Z,Y):]; theorem x <> y implies Funcs(X,{x,y}),bool X are_equipotent & card Funcs(X,{x, y}) = card bool X; theorem x <> y implies Funcs({x,y},X),[:X,X:] are_equipotent & card Funcs({x,y },X) = card [:X,X:]; begin notation synonym op0 for 0; end; definition redefine func op0 -> Element of 1; end; definition func op1 equals 0 .--> 0; func op2 equals (0,0) :-> 0; end; definition redefine func op1 -> UnOp of 1; redefine func op2 -> BinOp of 1; end; reserve C,D,E for non empty set; reserve c for Element of C, d for Element of D; definition let D,X,E; let F be FUNCTION_DOMAIN of X,E; let f be Function of D,F; let d be Element of D; redefine func f.d -> Element of F; end; reserve f for Function of [:C,D:],E; theorem curry f is Function of C,Funcs(D,E); theorem curry' f is Function of D,Funcs(C,E); definition let C,D,E,f; redefine func curry f -> Function of C,Funcs(D,E); redefine func curry' f -> Function of D,Funcs(C,E); end; theorem f.(c,d) = ((curry f).c).d; theorem f.(c,d) = ((curry' f).d).c; definition let A,B,C be non empty set; let f be Function of A, Funcs(B,C); redefine func uncurry f -> Function of [:A,B:],C; end; theorem for A,B,C being non empty set, f being Function of A,Funcs(B,C) holds curry uncurry f = f; theorem for A,B,C being non empty set, f being Function of A, Funcs(B,C) for a being Element of A, b being Element of B holds (uncurry f).(a,b) = f.a.b; begin reserve x,y,X,Y for set; reserve C,D,E for non empty set; reserve SC for Subset of C; reserve SD for Subset of D; reserve SE for Subset of E; reserve c,c1,c2 for Element of C; reserve d,d1,d2 for Element of D; reserve e for Element of E; reserve f,f1,g for PartFunc of C,D; reserve t for PartFunc of D,C; reserve s for PartFunc of D,E; reserve h for PartFunc of C,E; reserve F for PartFunc of D,D; theorem dom f = dom g & (for c st c in dom f holds f/.c = g/.c) implies f = g; theorem y in rng f iff ex c st c in dom f & y = f/.c; theorem h = s*f iff (for c holds c in dom h iff c in dom f & f/.c in dom s) & for c st c in dom h holds h/.c = s/.(f/.c); theorem c in dom f & f/.c in dom s implies (s*f)/.c = s/.(f/.c); theorem rng f c= dom s & c in dom f implies (s*f)/.c = s/.(f/.c); definition let D; let SD; redefine func id SD -> PartFunc of D,D; end; theorem F = id SD iff dom F = SD & for d st d in SD holds F/.d = d; theorem d in dom F /\ SD implies F/.d = (F*id SD)/.d; theorem d in dom((id SD)*F) iff d in dom F & F/.d in SD; theorem (for c1,c2 st c1 in dom f & c2 in dom f & f/.c1 = f/.c2 holds c1 = c2) implies f is one-to-one; theorem f is one-to-one & x in dom f & y in dom f & f/.x = f/.y implies x = y; definition let X,Y; let f be one-to-one PartFunc of X,Y; redefine func f" -> PartFunc of Y,X; end; theorem for f being one-to-one PartFunc of C,D holds for g be PartFunc of D,C holds g = f" iff dom g = rng f & for d,c holds d in rng f & c = g/.d iff c in dom f & d = f/.c; theorem for f being one-to-one PartFunc of C,D st c in dom f holds c = f"/.(f /.c) & c = (f"*f)/.c; theorem for f being one-to-one PartFunc of C,D st d in rng f holds d = f/.(f" /.d) & d = (f*(f"))/.d; theorem f is one-to-one & dom f = rng t & rng f = dom t & (for c,d st c in dom f & d in dom t holds f/.c = d iff t/.d = c) implies t = f"; theorem g = f|X iff dom g = dom f /\ X & for c st c in dom g holds g/.c = f/.c; theorem c in dom f /\ X implies f|X/.c = f/.c; theorem c in dom f & c in X implies f|X/.c = f/.c; theorem c in dom f & c in X implies f/.c in rng (f|X); definition let C,D; let X,f; redefine func X|`f -> PartFunc of C,D; end; theorem g = X|`f iff (for c holds c in dom g iff c in dom f & f/.c in X) & for c st c in dom g holds g/.c = f/.c; theorem c in dom (X|`f) iff c in dom f & f/.c in X; theorem c in dom (X|`f) implies X|`f/.c = f/.c; theorem SD = f.: X iff for d holds d in SD iff ex c st c in dom f & c in X & d = f/.c ; theorem d in (f qua Relation of C,D).:X iff ex c st c in dom f & c in X & d = f/.c; theorem c in dom f implies Im(f,c) = {f/.c}; theorem c1 in dom f & c2 in dom f implies f.:{c1,c2} = {f/.c1,f/.c2}; theorem SC = f"X iff for c holds c in SC iff c in dom f & f/.c in X; theorem for f ex g being Function of C,D st for c st c in dom f holds g.c = f /.c; theorem f tolerates g iff for c st c in dom f /\ dom g holds f/.c = g/.c; scheme PartFuncExD{D,C()->non empty set, P[set,set]}: ex f being PartFunc of D(),C( ) st (for d be Element of D() holds d in dom f iff (ex c be Element of C() st P [d,c])) & for d be Element of D() st d in dom f holds P[d,f/.d]; scheme LambdaPFD{D,C()->non empty set, F(set)->Element of C(), P[set]}: ex f being PartFunc of D(),C() st (for d be Element of D() holds d in dom f iff P[d]) & for d be Element of D() st d in dom f holds f/.d = F(d); scheme UnPartFuncD{C,D()->non empty set, X()->set, F(set)->Element of D()}: for f,g being PartFunc of C(),D() st (dom f=X() & for c be Element of C() st c in dom f holds f/.c = F(c)) & (dom g=X() & for c be Element of C() st c in dom g holds g /.c = F(c)) holds f = g; definition let C,D; let SC,d; redefine func SC --> d -> PartFunc of C,D; end; theorem c in SC implies (SC --> d)/.c = d; theorem (for c st c in dom f holds f/.c = d) implies f = dom f --> d; theorem c in dom f implies f*(SE --> c) = SE --> f/.c; theorem (id SC) is total iff SC = C; theorem (SC --> d) is total implies SC <> {}; theorem (SC --> d) is total iff SC = C; definition let C,D,f; redefine attr f is constant means ex d st for c st c in dom f holds f.c = d; end; theorem f|X is constant iff ex d st for c st c in X /\ dom f holds f/.c = d; theorem f|X is constant iff for c1,c2 st c1 in X /\ dom f & c2 in X /\ dom f holds f/.c1=f/.c2; theorem X meets dom f implies (f|X is constant iff ex d st rng (f|X) = {d}); theorem f|X is constant & Y c= X implies f|Y is constant; theorem X misses dom f implies f|X is constant; theorem f|SC = dom (f|SC) --> d implies f|SC is constant; theorem f|{x} is constant; theorem f|X is constant & f|Y is constant & X /\ Y meets dom f implies f|(X \/ Y) is constant; theorem f|Y is constant implies f|X|Y is constant; theorem (SC --> d)|SC is constant; theorem dom f c= dom g & (for c st c in dom f holds f/.c = g/.c) implies f c= g; theorem c in dom f & d = f/.c iff [c,d] in f; theorem [c,e] in (s*f) implies [c,f/.c] in f & [f/.c,e] in s; theorem f = {[c,d]} implies f/.c = d; theorem dom f = {c} implies f = {[c,f/.c]}; theorem f1 = f /\ g & c in dom f1 implies f1/.c = f/.c & f1/.c = g/.c; theorem c in dom f & f1 = f \/ g implies f1/.c = f/.c; theorem c in dom g & f1 = f \/ g implies f1/.c = g/.c; theorem c in dom f1 & f1 = f \/ g implies f1/.c = f/.c or f1/.c = g/.c; theorem c in dom f & c in SC iff [c,f/.c] in (f|SC); theorem c in dom f & f/.c in SD iff [c,f/.c] in (SD|`f); theorem c in f"SD iff [c,f/.c] in f & f/.c in SD; theorem f|X is constant iff ex d st for c st c in X /\ dom f holds f.c = d; theorem f|X is constant iff for c1,c2 st c1 in X /\ dom f & c2 in X /\ dom f holds f.c1=f.c2; theorem d in f.:X implies ex c st c in dom f & c in X & d = f.c; theorem f is one-to-one implies (d in rng f & c = (f").d iff c in dom f & d = f.c); theorem for Y for f,g be Y-valued Function st f c= g for x st x in dom f holds f/.x = g/.x; begin reserve W,X,Y,Z for set, f,g for Function, a,x,y,z for set; definition let B be set; attr B is subset-closed means for X,Y holds X in B & Y c= X implies Y in B; end; definition let B be set; attr B is Tarski means B is subset-closed & (for X holds X in B implies bool X in B) & for X holds X c= B implies X,B are_equipotent or X in B; end; definition let A,B be set; pred B is_Tarski-Class_of A means A in B & B is Tarski; end; definition let A be set; func Tarski-Class A -> set means it is_Tarski-Class_of A & for D being set st D is_Tarski-Class_of A holds it c= D; end; registration let A be set; cluster Tarski-Class A -> non empty; end; theorem W is Tarski iff W is subset-closed & (for X st X in W holds bool X in W) & for X st X c= W & card X in card W holds X in W; theorem X in Tarski-Class X; theorem Y in Tarski-Class X & Z c= Y implies Z in Tarski-Class X; theorem Y in Tarski-Class X implies bool Y in Tarski-Class X; theorem Y c= Tarski-Class X implies Y,Tarski-Class X are_equipotent or Y in Tarski-Class X; theorem Y c= Tarski-Class X & card Y in card Tarski-Class X implies Y in Tarski-Class X; reserve u,v for Element of Tarski-Class(X), A,B,C for Ordinal, L for T-Sequence; definition let X,A; func Tarski-Class(X,A) means ex L st it = last L & dom L = succ A & L.{} = { X } & (for C st succ C in succ A holds L.succ C = { u : ex v st v in L.C & u c= v } \/ { bool v : v in L.C } \/ bool(L.C) /\ Tarski-Class X) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = (union rng(L|C)) /\ Tarski-Class X; end; definition let X,A; redefine func Tarski-Class(X,A) -> Subset of Tarski-Class X; end; theorem Tarski-Class(X,{}) = { X }; theorem Tarski-Class(X,succ A) = { u : ex v st v in Tarski-Class(X,A) & u c= v } \/ { bool v : v in Tarski-Class(X,A) } \/ bool Tarski-Class(X,A) /\ Tarski-Class X; theorem A <> {} & A is limit_ordinal implies Tarski-Class(X,A) = { u : ex B st B in A & u in Tarski-Class(X,B) }; theorem Y in Tarski-Class(X,succ A) iff Y c= Tarski-Class(X,A) & Y in Tarski-Class X or ex Z st Z in Tarski-Class(X,A) & (Y c= Z or Y = bool Z); theorem Y c= Z & Z in Tarski-Class(X,A) implies Y in Tarski-Class(X,succ A); theorem Y in Tarski-Class(X,A) implies bool Y in Tarski-Class(X,succ A); theorem A <> {} & A is limit_ordinal implies (x in Tarski-Class(X,A) iff ex B st B in A & x in Tarski-Class(X,B)); theorem A <> {} & A is limit_ordinal & Y in Tarski-Class(X,A) & (Z c= Y or Z = bool Y) implies Z in Tarski-Class(X,A); theorem Tarski-Class(X,A) c= Tarski-Class(X,succ A); theorem A c= B implies Tarski-Class(X,A) c= Tarski-Class(X,B); theorem ex A st Tarski-Class(X,A) = Tarski-Class(X,succ A); theorem Tarski-Class(X,A) = Tarski-Class(X,succ A) implies Tarski-Class(X,A) = Tarski-Class X; theorem ex A st Tarski-Class(X,A) = Tarski-Class X; theorem ex A st Tarski-Class(X,A) = Tarski-Class X & for B st B in A holds Tarski-Class(X,B) <> Tarski-Class X; theorem Y <> X & Y in Tarski-Class X implies ex A st not Y in Tarski-Class(X,A) & Y in Tarski-Class(X,succ A); theorem X is epsilon-transitive implies for A st A <> {} holds Tarski-Class(X,A) is epsilon-transitive; theorem X is epsilon-transitive implies Tarski-Class X is epsilon-transitive; theorem Y in Tarski-Class X implies card Y in card Tarski-Class X; theorem Y in Tarski-Class X implies not Y,Tarski-Class X are_equipotent; theorem x in Tarski-Class X & y in Tarski-Class X implies {x} in Tarski-Class X & {x,y} in Tarski-Class X; theorem x in Tarski-Class X & y in Tarski-Class X implies [x,y] in Tarski-Class X; theorem Y c= Tarski-Class X & Z c= Tarski-Class X implies [:Y,Z:] c= Tarski-Class X; definition let A; func Rank(A) means ex L st it = last L & dom L = succ A & L.{} = {} & (for C st succ C in succ A holds L.succ C = bool(L.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = union rng(L|C); end; theorem Rank {} = {}; theorem Rank succ A = bool Rank A; theorem A <> {} & A is limit_ordinal implies for x holds x in Rank A iff ex B st B in A & x in Rank B; theorem X c= Rank A iff X in Rank succ A; registration let A; cluster Rank A -> epsilon-transitive; end; theorem Rank A c= Rank succ A; theorem union Rank A c= Rank A; theorem X in Rank A implies union X in Rank A; theorem A in B iff Rank A in Rank B; theorem A c= B iff Rank A c= Rank B; theorem A c= Rank A; theorem for A,X st X in Rank A holds not X,Rank A are_equipotent & card X in card Rank A; theorem X c= Rank A iff bool X c= Rank succ A; theorem X c= Y & Y in Rank A implies X in Rank A; theorem X in Rank A iff bool X in Rank succ A; theorem x in Rank A iff {x} in Rank succ A; theorem x in Rank A & y in Rank A iff {x,y} in Rank succ A; theorem x in Rank A & y in Rank A iff [x,y] in Rank succ succ A; theorem X is epsilon-transitive & Rank A /\ Tarski-Class X = Rank succ A /\ Tarski-Class X implies Tarski-Class X c= Rank A; theorem X is epsilon-transitive implies ex A st Tarski-Class X c= Rank A; theorem X is epsilon-transitive implies union X c= X; theorem X is epsilon-transitive & Y is epsilon-transitive implies X \/ Y is epsilon-transitive; theorem X is epsilon-transitive & Y is epsilon-transitive implies X /\ Y is epsilon-transitive; reserve n for Element of omega; definition let X; func the_transitive-closure_of X -> set means x in it iff ex f,n st x in f.n & dom f = omega & f.0 = X & for k being Nat holds f.(succ k) = union(f.k); end; theorem the_transitive-closure_of X is epsilon-transitive; theorem X c= the_transitive-closure_of X; theorem X c= Y & Y is epsilon-transitive implies the_transitive-closure_of X c= Y; theorem (for Z st X c= Z & Z is epsilon-transitive holds Y c= Z) & X c= Y & Y is epsilon-transitive implies the_transitive-closure_of X = Y; theorem X is epsilon-transitive implies the_transitive-closure_of X = X; theorem the_transitive-closure_of {} = {}; theorem the_transitive-closure_of A = A; theorem X c= Y implies the_transitive-closure_of X c= the_transitive-closure_of Y; theorem the_transitive-closure_of the_transitive-closure_of X = the_transitive-closure_of X; theorem the_transitive-closure_of (X \/ Y) = the_transitive-closure_of X \/ the_transitive-closure_of Y; theorem the_transitive-closure_of (X /\ Y) c= the_transitive-closure_of X /\ the_transitive-closure_of Y; theorem ex A st X c= Rank A; definition let X; func the_rank_of X -> Ordinal means X c= Rank it & for B st X c= Rank B holds it c= B; end; theorem the_rank_of bool X = succ the_rank_of X; theorem the_rank_of Rank A = A; theorem X c= Rank A iff the_rank_of X c= A; theorem X in Rank A iff the_rank_of X in A; theorem X c= Y implies the_rank_of X c= the_rank_of Y; theorem X in Y implies the_rank_of X in the_rank_of Y; theorem the_rank_of X c= A iff for Y st Y in X holds the_rank_of Y in A; theorem A c= the_rank_of X iff for B st B in A ex Y st Y in X & B c= the_rank_of Y; theorem the_rank_of X = {} iff X = {}; theorem the_rank_of X = succ A implies ex Y st Y in X & the_rank_of Y = A; theorem the_rank_of A = A; theorem the_rank_of Tarski-Class X <> {} & the_rank_of Tarski-Class X is limit_ordinal; begin reserve e,u for set; scheme NonUniqFuncEx { X() -> set, P[set,set] }: ex f being Function st dom f = X() & for e st e in X() holds P[e,f.e] provided for e st e in X() ex u st P[e,u]; definition let F,G be Relation; pred F,G are_fiberwise_equipotent means for x be set holds card Coim(F,x) = card Coim(G,x); reflexivity; symmetry; end; theorem for F,G be Function st F,G are_fiberwise_equipotent holds rng F = rng G; theorem for F,G,H be Function st F,G are_fiberwise_equipotent & F,H are_fiberwise_equipotent holds G,H are_fiberwise_equipotent; theorem for F,G be Function holds F,G are_fiberwise_equipotent iff ex H be Function st dom H = dom F & rng H = dom G & H is one-to-one & F = G*H ; theorem for F,G be Function holds F,G are_fiberwise_equipotent iff for X be set holds card (F"X) = card (G"X); theorem for D be non empty set, F,G be Function st rng F c= D & rng G c= D & for d be Element of D holds card Coim(F,d) = card Coim(G,d) holds F,G are_fiberwise_equipotent; theorem for F,G be Function st dom F = dom G holds F,G are_fiberwise_equipotent iff ex P be Permutation of dom F st F = G*P; theorem for F,G be Function st F,G are_fiberwise_equipotent holds card dom F = card dom G; theorem for f being set, p being Relation for x being set st x in rng p holds the_rank_of x in the_rank_of [p,f]; theorem for f, g, h being Function st dom f = dom g & rng f c= dom h & rng g c= dom h & f, g are_fiberwise_equipotent holds h*f, h*g are_fiberwise_equipotent; begin reserve i,j,e,u for set; theorem for f being Function st f is non-empty holds rng f is with_non-empty_elements; theorem for f being Function holds f is empty-yielding iff f = {} or rng f = { {} }; reserve I for set; registration let I; cluster total for I-defined Function; end; definition let I; mode ManySortedSet of I is total I-defined Function; end; reserve x,X,Y,Z,V for ManySortedSet of I; scheme KuratowskiFunction{A()-> set, F(set) -> set}: ex f being ManySortedSet of A() st for e st e in A() holds f.e in F(e) provided for e st e in A() holds F(e) <> {}; definition let I,X,Y; pred X in Y means for i st i in I holds X.i in Y.i; pred X c= Y means for i st i in I holds X.i c= Y.i; reflexivity; end; definition let I be non empty set,X,Y be ManySortedSet of I; redefine pred X in Y; asymmetry; end; scheme PSeparation { I()-> set, A() -> ManySortedSet of I(), P[set,set] } : ex X being ManySortedSet of I() st for i being set st i in I() for e holds e in X.i iff e in A().i & P[i,e]; theorem (for i st i in I holds X.i = Y.i) implies X = Y; definition let I; func [[0]]I -> ManySortedSet of I equals I --> {}; let X,Y; func X \/ Y -> ManySortedSet of I means for i st i in I holds it.i = X.i \/ Y.i; commutativity; idempotence; func X /\ Y -> ManySortedSet of I means for i st i in I holds it.i = X.i /\ Y.i; commutativity; idempotence; func X \ Y -> ManySortedSet of I means for i st i in I holds it.i = X.i \ Y.i; pred X overlaps Y means for i st i in I holds X.i meets Y.i; symmetry; pred X misses Y means for i st i in I holds X.i misses Y.i; symmetry; end; notation let I; let X,Y; antonym X meets Y for X misses Y; end; definition let I,X,Y; func X \+\ Y -> ManySortedSet of I equals (X \ Y) \/ (Y \ X); commutativity; end; theorem for i st i in I holds (X \+\ Y).i = X.i \+\ Y.i; theorem [[0]]I.i = {}; theorem (for i st i in I holds X.i = {}) implies X = [[0]]I; theorem x in X or x in Y implies x in X \/ Y; theorem x in X /\ Y iff x in X & x in Y; theorem x in X & X c= Y implies x in Y; theorem x in X & x in Y implies X overlaps Y; theorem X overlaps Y implies ex x st x in X & x in Y; theorem x in X \ Y implies x in X; begin definition let I,X,Y; redefine pred X = Y means for i st i in I holds X.i = Y.i; end; theorem X c= Y & Y c= Z implies X c= Z; theorem X c= X \/ Y; theorem X /\ Y c= X; theorem X c= Z & Y c= Z implies X \/ Y c= Z; theorem Z c= X & Z c= Y implies Z c= X /\ Y; theorem X c= Y implies X \/ Z c= Y \/ Z; theorem X c= Y implies X /\ Z c= Y /\ Z; theorem X c= Y & Z c= V implies X \/ Z c= Y \/ V; theorem X c= Y & Z c= V implies X /\ Z c= Y /\ V; theorem X c= Y implies X \/ Y = Y; theorem X c= Y implies X /\ Y = X; theorem X /\ Y c= X \/ Z; theorem X c= Z implies X \/ Y /\ Z = (X \/ Y) /\ Z; theorem X = Y \/ Z iff Y c= X & Z c= X & for V st Y c= V & Z c= V holds X c= V; theorem X = Y /\ Z iff X c= Y & X c= Z & for V st V c= Y & V c= Z holds V c= X; theorem (X \/ Y) \/ Z = X \/ (Y \/ Z); theorem (X /\ Y) /\ Z = X /\ (Y /\ Z); theorem X /\ (X \/ Y) = X; theorem X \/ (X /\ Y) = X; theorem X /\ (Y \/ Z) = X /\ Y \/ X /\ Z; theorem X \/ Y /\ Z = (X \/ Y) /\ (X \/ Z); theorem (X /\ Y) \/ (X /\ Z) = X implies X c= Y \/ Z; theorem (X \/ Y) /\ (X \/ Z) = X implies Y /\ Z c= X; theorem (X /\ Y) \/ (Y /\ Z) \/ (Z /\ X) = (X \/ Y) /\ (Y \/ Z) /\ (Z \/ X); theorem X \/ Y c= Z implies X c= Z; theorem X c= Y /\ Z implies X c= Y; theorem X \/ Y \/ Z = (X \/ Z) \/ (Y \/ Z); theorem X /\ Y /\ Z = (X /\ Z) /\ (Y /\ Z); theorem X \/ (X \/ Y) = X \/ Y; theorem X /\ (X /\ Y) = X /\ Y; begin theorem [[0]]I c= X; theorem X c= [[0]]I implies X = [[0]]I; theorem X c= Y & X c= Z & Y /\ Z = [[0]]I implies X = [[0]]I; theorem X c= Y & Y /\ Z = [[0]]I implies X /\ Z = [[0]]I; theorem X \/ [[0]]I = X & [[0]]I \/ X = X; theorem X \/ Y = [[0]]I implies X = [[0]]I; theorem X /\ [[0]]I = [[0]]I; theorem X c= (Y \/ Z) & X /\ Z = [[0]]I implies X c= Y; theorem Y c= X & X /\ Y = [[0]]I implies Y = [[0]]I; begin theorem X \ Y = [[0]]I iff X c= Y; theorem X c= Y implies X \ Z c= Y \ Z; theorem X c= Y implies Z \ Y c= Z \ X; theorem X c= Y & Z c= V implies X \ V c= Y \ Z; theorem X \ Y c= X; theorem X c= Y \ X implies X = [[0]]I; theorem X \ X = [[0]]I; theorem X \ [[0]]I = X; theorem [[0]]I \ X = [[0]]I; theorem X \ (X \/ Y) = [[0]]I; theorem X /\ (Y \ Z) = (X /\ Y) \ Z; theorem (X \ Y) /\ Y = [[0]]I; theorem X \ (Y \ Z) = (X \ Y) \/ X /\ Z; theorem (X \ Y) \/ X /\ Y = X; theorem X c= Y implies Y = X \/ (Y \ X); theorem X \/ (Y \ X) = X \/ Y; theorem X \ (X \ Y) = X /\ Y; theorem X \ (Y /\ Z) = (X \ Y) \/ (X \ Z); theorem X \ X /\ Y = X \ Y; theorem X /\ Y = [[0]]I iff X \ Y = X; theorem (X \/ Y) \ Z = (X \ Z) \/ (Y \ Z); theorem (X \ Y) \ Z = X \ (Y \/ Z); theorem (X /\ Y) \ Z = (X \ Z) /\ (Y \ Z); theorem (X \/ Y) \ Y = X \ Y; theorem X c= Y \/ Z implies X \ Y c= Z & X \ Z c= Y; theorem (X \/ Y) \ (X /\ Y) = (X \ Y) \/ (Y \ X); theorem (X \ Y) \ Y = X \ Y; theorem X \ (Y \/ Z) = (X \ Y) /\ (X \ Z); theorem X \ Y = Y \ X implies X = Y; theorem X /\ (Y \ Z) = X /\ Y \ X /\ Z; theorem X \ Y c= Z implies X c= Y \/ Z; theorem X \ Y c= X \+\ Y; theorem X \+\ [[0]]I = X; theorem X \+\ X = [[0]]I; theorem X \/ Y = (X \+\ Y) \/ X /\ Y; theorem X \+\ Y = (X \/ Y) \ X /\ Y; theorem (X \+\ Y) \ Z = (X \ (Y \/ Z)) \/ (Y \ (X \/ Z)); theorem X \ (Y \+\ Z) = X \ (Y \/ Z) \/ X /\ Y /\ Z; theorem (X \+\ Y) \+\ Z = X \+\ (Y \+\ Z); theorem X \ Y c= Z & Y \ X c= Z implies X \+\ Y c= Z; theorem X \/ Y = X \+\ (Y \ X); theorem X /\ Y = X \+\ (X \ Y); theorem X \ Y = X \+\ (X /\ Y); theorem Y \ X = X \+\ (X \/ Y); theorem X \/ Y = X \+\ Y \+\ X /\ Y; theorem X /\ Y = X \+\ Y \+\ (X \/ Y); begin theorem X overlaps Y or X overlaps Z implies X overlaps Y \/ Z; theorem X overlaps Y & Y c= Z implies X overlaps Z; theorem X overlaps Y & X c= Z implies Z overlaps Y; theorem X c= Y & Z c= V & X overlaps Z implies Y overlaps V; theorem X overlaps Y /\ Z implies X overlaps Y & X overlaps Z; theorem X overlaps Z & X c= V implies X overlaps Z /\ V; theorem X overlaps Y \ Z implies X overlaps Y; theorem Y does not overlap Z implies X /\ Y does not overlap X /\ Z; theorem X overlaps Y \ Z implies Y overlaps X \ Z; theorem X meets Y & Y c= Z implies X meets Z; theorem Y misses X \ Y; theorem X /\ Y misses X \ Y; theorem X /\ Y misses X \+\ Y; theorem X misses Y implies X /\ Y = [[0]]I; theorem X <> [[0]]I implies X meets X; theorem X c= Y & X c= Z & Y misses Z implies X = [[0]]I; theorem Z \/ V = X \/ Y & X misses Z & Y misses V implies X = V & Y = Z; theorem X misses Y implies X \ Y = X; theorem X misses Y implies (X \/ Y) \ Y = X; theorem X \ Y = X implies X misses Y; theorem X \ Y misses Y \ X; begin definition let I,X,Y; pred X [= Y means for x st x in X holds x in Y; reflexivity; end; theorem X c= Y implies X [= Y; theorem X [= Y & Y [= Z implies X [= Z; begin theorem [[0]]{} in [[0]]{}; theorem for X being ManySortedSet of {} holds X = {}; reserve I for non empty set, x,X,Y for ManySortedSet of I; theorem X overlaps Y implies X meets Y; theorem not ex x st x in [[0]]I; theorem x in X & x in Y implies X /\ Y <> [[0]]I; theorem X does not overlap [[0]]I; theorem X /\ Y = [[0]]I implies X does not overlap Y; theorem X overlaps X implies X <> [[0]]I; begin reserve I for set, x,X,Y,Z for ManySortedSet of I; definition let I be set; let X be ManySortedSet of I; redefine attr X is empty-yielding means for i st i in I holds X.i is empty; redefine attr X is non-empty means for i st i in I holds X.i is non empty; end; registration let I be set; cluster empty-yielding for ManySortedSet of I; cluster non-empty for ManySortedSet of I; end; registration let I be non empty set; cluster non-empty -> non empty-yielding for ManySortedSet of I; cluster empty-yielding -> non non-empty for ManySortedSet of I; end; theorem X is empty-yielding iff X = [[0]]I; theorem Y is empty-yielding & X c= Y implies X is empty-yielding; theorem X is non-empty & X c= Y implies Y is non-empty; theorem X is non-empty & X [= Y implies X c= Y; theorem X is non-empty & X [= Y implies Y is non-empty; reserve X for non-empty ManySortedSet of I; theorem ex x st x in X; theorem (for x holds x in X iff x in Y) implies X = Y; theorem (for x holds x in X iff x in Y & x in Z) implies X = Y /\ Z; begin scheme MSSEx { I() -> set, P[set,set] }: ex f being ManySortedSet of I() st for i st i in I() holds P[i,f.i] provided for i st i in I() ex j st P[i,j]; scheme MSSLambda { I() -> set, F(set) -> set }: ex f being ManySortedSet of I() st for i st i in I() holds f.i = F(i); registration let I be set; cluster Function-yielding for ManySortedSet of I; end; definition let I be set; mode ManySortedFunction of I is Function-yielding ManySortedSet of I; end; theorem not ex M being non-empty ManySortedSet of I st {} in rng M; definition let I be set; let M be ManySortedSet of I; mode Component of M is Element of rng M; end; theorem for I being non empty set for M being ManySortedSet of I, A being Component of M ex i st i in I & A = M.i; theorem for M being ManySortedSet of I, i st i in I holds M.i is Component of M; definition let I; let B be ManySortedSet of I; mode Element of B -> ManySortedSet of I means for i st i in I holds it.i is Element of B.i; end; begin definition let I; let A be ManySortedSet of I, B be ManySortedSet of I; mode ManySortedFunction of A,B -> ManySortedSet of I means for i st i in I holds it.i is Function of A.i, B.i; end; registration let I; let A be ManySortedSet of I, B be ManySortedSet of I; cluster ->Function-yielding for ManySortedFunction of A,B; end; registration let I be set; let J be non empty set; let O be Function of I,J; let F be ManySortedSet of J; cluster F*O -> total for I-defined Function; end; reserve D for non empty set, n for Nat; scheme LambdaDMS {D()->non empty set, F(set)->set}: ex X be ManySortedSet of D() st for d be Element of D() holds X.d = F(d); registration let J be non empty set, B be non-empty ManySortedSet of J, j be Element of J; cluster B.j -> non empty; end; reserve X,Y for ManySortedSet of I; definition let I, X,Y; func [|X,Y|] -> ManySortedSet of I means for i st i in I holds it.i = [:X.i,Y.i:]; end; definition let I, X, Y; func (Funcs) (X,Y) -> ManySortedSet of I means for i be set st i in I holds it.i = Funcs(X.i,Y.i); end; definition let I be set, M be ManySortedSet of I; mode ManySortedSubset of M -> ManySortedSet of I means it c= M; end; registration let I be set, M be non-empty ManySortedSet of I; cluster non-empty for ManySortedSubset of M; end; definition let F,G be Function-yielding Function; func G**F -> Function means dom it = (dom F) /\ (dom G) & for i be set st i in dom it holds it.i = (G.i)*(F.i); end; registration let F,G be Function-yielding Function; cluster G**F -> Function-yielding; end; definition let I be set, A be ManySortedSet of I, F be ManySortedFunction of I; func F.:.:A -> ManySortedSet of I means for i be set st i in I holds it.i = (F.i).:(A.i); end; registration let I; cluster [[0]]I -> empty-yielding; end; scheme MSSExD { I() -> non empty set, P[set,set] }: ex f being ManySortedSet of I() st for i being Element of I() holds P[i,f.i] provided for i being Element of I() ex j being set st P[i,j]; registration let A be non empty set; cluster non-empty -> non empty-yielding for ManySortedSet of A; end; registration let X be non empty set; cluster -> non empty for ManySortedSet of X; end; theorem for F, G, H be Function-yielding Function holds (H ** G) ** F = H ** (G ** F); registration let I be set, f be non-empty ManySortedSet of I; cluster total for I-defined f-compatible Function; end; theorem for I being set, f being non-empty ManySortedSet of I for p being f-compatible I-defined Function ex s being f-compatible ManySortedSet of I st p c= s; theorem for I,A be set for s,ss being ManySortedSet of I holds (ss +* s | A) | A = s | A; registration let X be non empty set, Y be set; cluster X-valued for ManySortedSet of Y; end; theorem for I,Y being non empty set, M be Y-valued ManySortedSet of I, x be Element of I holds M.x = M/.x; theorem for f being Function, M being ManySortedSet of I holds (f+*M)|I = M; theorem for I being set, Y being non empty set for p being Y-valued I-defined Function ex s being Y-valued ManySortedSet of I st p c= s; theorem X c= Y & Y c= X implies X = Y; definition let I be non empty set, A,B be ManySortedSet of I; redefine pred A = B means for i being Element of I holds A.i = B.i; end; begin reserve A,B,C for Ordinal, K,L,M,N for Cardinal, x,y,y1,y2,z,u,X,Y,Z,Z1,Z2 for set, n for Nat, f,f1,g,h for Function, Q,R for Relation; definition let IT be Function; attr IT is Cardinal-yielding means for x st x in dom IT holds IT.x is Cardinal; end; registration cluster empty -> Cardinal-yielding for Function; end; registration cluster Cardinal-yielding for Function; end; definition mode Cardinal-Function is Cardinal-yielding Function; end; reserve ff for Cardinal-Function; registration let ff,X; cluster ff|X -> Cardinal-yielding; end; registration let X,K; cluster X --> K -> Cardinal-yielding; end; registration let X,K; cluster X .--> K -> Cardinal-yielding; end; scheme CFLambda { A()->set, F(set)->Cardinal } : ex ff st dom ff = A() & for x st x in A() holds ff.x = F(x); definition let f; func Card f -> Cardinal-Function means dom it = dom f & for x st x in dom f holds it.x = card(f.x); func disjoin f -> Function means dom it = dom f & for x st x in dom f holds it.x = [:f.x,{x}:]; func Union f -> set equals union rng f; func product f -> set means x in it iff ex g st x = g & dom g = dom f & for y st y in dom f holds g.y in f.y; end; theorem Card ff = ff; theorem Card (X --> Y) = X --> card Y; theorem disjoin {} = {}; theorem disjoin (x .--> X) = x .--> [:X,{x}:]; theorem x in dom f & y in dom f & x <> y implies (disjoin f).x misses (disjoin f).y; theorem Union (X --> Y) c= Y; theorem X <> {} implies Union (X --> Y) = Y; theorem Union (x .--> Y) = Y; theorem g in product f iff dom g = dom f & for x st x in dom f holds g.x in f.x; theorem product {} = {{}}; theorem Funcs(X,Y) = product (X --> Y); definition let x,X; func pi(X,x) -> set means y in it iff ex f st f in X & y = f.x; end; theorem x in dom f & product f <> {} implies pi(product f,x) = f.x; theorem pi({},x) = {}; theorem pi({g},x) = {g.x}; theorem pi({f,g},x) = {f.x,g.x}; theorem pi(X \/ Y,x) = pi(X,x) \/ pi(Y,x); theorem pi(X /\ Y,x) c= pi(X,x) /\ pi(Y,x); theorem pi(X,x) \ pi(Y,x) c= pi(X \ Y,x); theorem pi(X,x) \+\ pi(Y,x) c= pi(X \+\ Y,x); theorem card pi(X,x) c= card X; theorem x in Union disjoin f implies ex y,z st x = [y,z]; theorem x in Union disjoin f iff x`2 in dom f & x`1 in f.(x`2) & x = [x`1,x`2]; theorem f c= g implies disjoin f c= disjoin g; theorem f c= g implies Union f c= Union g; theorem Union disjoin (Y --> X) = [:X,Y:]; theorem product f = {} iff {} in rng f; theorem dom f = dom g & (for x st x in dom f holds f.x c= g.x) implies product f c= product g; reserve F,G for Cardinal-Function; theorem for x st x in dom F holds card (F.x) = F.x; theorem for x st x in dom F holds card ((disjoin F).x) = F.x; definition let F; func Sum F -> Cardinal equals card Union disjoin F; func Product F -> Cardinal equals card product F; end; theorem dom F = dom G & (for x st x in dom F holds F.x c= G.x) implies Sum F c= Sum G; theorem {} in rng F iff Product F = 0; theorem dom F = dom G & (for x st x in dom F holds F.x c= G.x) implies Product F c= Product G; theorem F c= G implies Sum F c= Sum G; theorem F c= G & not 0 in rng G implies Product F c= Product G; theorem Sum({} --> K) = 0; theorem Product ({} --> K) = 1; theorem Sum(x .--> K) = K; theorem Product(x .--> K) = K; theorem card Union f c= Sum Card f; theorem card Union F c= Sum F; theorem dom F = dom G & (for x st x in dom F holds F.x in G.x) implies Sum F in Product G; scheme FuncSeparation { X()->set, F(set)->set, P[set,set] }: ex f st dom f = X() & for x st x in X() for y holds y in f.x iff y in F(x) & P[x,y]; theorem X is finite implies card X in card omega; theorem card A in card B implies A in B; theorem card A in M implies A in M; theorem X is c=-linear implies ex Y st Y c= X & union Y = union X & for Z st Z c= Y & Z <> {} ex Z1 st Z1 in Z & for Z2 st Z2 in Z holds Z1 c= Z2; theorem (for Z st Z in X holds card Z in M) & X is c=-linear implies card union X c= M; begin registration let f be Function; cluster product f -> functional; end; registration let A be set; let B be with_non-empty_elements set; cluster -> non-empty for Function of A,B; end; registration let f be non-empty Function; cluster product f -> non empty; end; theorem for a,b,c,d being set st a <> b holds product (a,b) --> ({c},{d}) = { (a,b) --> (c,d) }; theorem x in product f implies x is Function; begin reserve A,B for set; definition let f be Function; func sproduct f -> set means x in it iff ex g st x = g & dom g c= dom f & for x st x in dom g holds g.x in f.x; end; registration let f be Function; cluster sproduct f -> functional non empty; end; theorem g in sproduct f implies dom g c= dom f & for x st x in dom g holds g.x in f.x; theorem {} in sproduct f; registration let f; cluster empty for Element of sproduct f; end; theorem product f c= sproduct f; theorem x in sproduct f implies x is PartFunc of dom f, union rng f; theorem g in product f & h in sproduct f implies g +* h in product f; theorem product f <> {} implies (g in sproduct f iff ex h st h in product f & g c= h); theorem sproduct f c= PFuncs(dom f,union rng f); theorem f c= g implies sproduct f c= sproduct g; theorem sproduct {} = {{}}; theorem PFuncs(A,B) = sproduct (A --> B); theorem for A, B being non empty set for f being Function of A,B holds sproduct f = sproduct(f|{x where x is Element of A: f.x <> {} }); theorem x in dom f & y in f.x implies x .--> y in sproduct f; theorem sproduct f = {{}} iff for x st x in dom f holds f.x = {}; theorem A c= sproduct f & (for h1,h2 being Function st h1 in A & h2 in A holds h1 tolerates h2) implies union A in sproduct f; theorem g tolerates h & g in sproduct f & h in sproduct f implies g \/ h in sproduct f; theorem x c= h & h in sproduct f implies x in sproduct f; theorem g in sproduct f implies g|A in sproduct f; theorem g in sproduct f implies g|A in sproduct f|A; theorem h in sproduct(f+*g) implies ex f9,g9 being Function st f9 in sproduct f & g9 in sproduct g & h = f9+*g9; theorem for f9,g9 being Function st dom g misses dom f9 \ dom g9 & f9 in sproduct f & g9 in sproduct g holds f9+*g9 in sproduct(f+*g); theorem for f9,g9 being Function st dom f9 misses dom g \ dom g9 & f9 in sproduct f & g9 in sproduct g holds f9+*g9 in sproduct(f+*g); theorem g in sproduct f & h in sproduct f implies g +* h in sproduct f; theorem for x1,x2,y1,y2 being set holds x1 in dom f & y1 in f.x1 & x2 in dom f & y2 in f.x2 implies (x1,x2)-->(y1,y2) in sproduct f; begin definition let IT be set; attr IT is with_common_domain means for f,g be Function st f in IT & g in IT holds dom f = dom g; end; registration cluster with_common_domain functional non empty for set; end; registration let f; cluster {f} -> with_common_domain; end; definition let X be functional set; func DOM X -> set equals meet { dom f where f is Element of X: not contradiction }; end; theorem for X be with_common_domain functional set st X = {{}} holds DOM X = {}; registration let X be empty set; cluster DOM X -> empty; end; begin definition let S be functional set; func product" S -> Function means dom it = DOM S & for i being set st i in dom it holds it.i = pi(S,i); end; canceled; theorem for S being non empty functional set, i being set st i in dom product" S holds (product" S).i = {f.i where f is Element of S: not contradiction}; definition let S be set; attr S is product-like means ex f being Function st S = product f; end; registration let f be Function; cluster product f -> product-like; end; registration cluster product-like -> functional with_common_domain for set; end; registration cluster product-like non empty for set; end; canceled 2; theorem for S being functional with_common_domain set holds S c= product product" S; theorem for S being non empty product-like set holds S = product product" S; theorem for f being Function for s, t being Element of product f, A be set holds s +* t|A is Element of product f; theorem for f being non-empty Function for p being Element of sproduct f ex s being Element of product f st p c= s; theorem g in product f implies g|A in sproduct f; definition let f be non-empty Function; let g be Element of product f; let X; redefine func g|X -> Element of sproduct f; end; theorem for f being non-empty Function for s,ss being Element of product f, A being set holds (ss +* s | A) | A = s | A; theorem for M,x, g being Function st x in product M holds x * g in product (M * g); theorem X is finite iff card X in omega; reserve A,B for Ordinal; theorem A is infinite iff omega c= A; theorem N is finite & not M is finite implies N in M & N c= M; theorem not X is finite iff ex Y st Y c= X & card Y = omega; theorem card X = card Y iff nextcard X = nextcard Y; theorem nextcard N = nextcard M implies M = N; theorem N in M iff nextcard N c= M; theorem N in nextcard M iff N c= M; theorem M is finite & (N c= M or N in M) implies N is finite; reserve n,k for Nat; definition let X; attr X is countable means card X c= omega; attr X is denumerable means card X = omega; end; registration cluster denumerable -> countable infinite for set; cluster countable infinite -> denumerable for set; end; registration cluster finite -> countable for set; end; registration cluster omega -> denumerable; end; registration cluster denumerable for set; end; theorem X is countable iff ex f st dom f = omega & X c= rng f; registration let X be countable set; cluster -> countable for Subset of X; end; theorem X is countable implies X /\ Y is countable; theorem X is countable implies X \ Y is countable; theorem for A being non empty countable set ex f being Function of omega, A st rng f = A; theorem for f,g being non-empty Function, x being Element of product f, y being Element of product g holds x+*y in product (f+*g); theorem for f,g being non-empty Function for x being Element of product (f+*g) holds x|dom g in product g; theorem for f,g being non-empty Function st f tolerates g for x being Element of product (f+*g) holds x|dom f in product f; theorem for S being with_common_domain functional set, f be Function st f in S holds dom f = dom product" S; theorem for S being functional set, f be Function, i be set st f in S & i in dom product" S holds f.i in (product" S).i; theorem for S being with_common_domain functional set, f be Function, i be set st f in S & i in dom f holds f.i in (product" S).i; registration let X be with_common_domain set; cluster -> with_common_domain for Subset of X; end; definition let f be Function, x be set; func proj(f,x) -> Function means dom it = product f & for y being Function st y in dom it holds it.y = y.x; end; registration let f be Function, x be set; cluster proj(f,x) -> (product f)-defined; end; registration let f be Function, x be set; cluster proj(f,x) -> total; end; registration let f be non-empty Function; cluster -> f-compatible for Element of product f; end; registration let I be set; let f be I-defined non-empty Function; cluster -> I-defined for Element of product f; end; registration let f be Function; cluster -> f-compatible for Element of sproduct f; end; registration let I be set; let f be I-defined Function; cluster -> I-defined for Element of sproduct f; end; registration let I be set; let f be total I-defined non-empty Function; cluster -> total for Element of product f; end; theorem for I being set, f being non-empty I-defined Function for p being f-compatible I-defined Function holds p in sproduct f; theorem for I being set, f being non-empty I-defined Function for p being f-compatible I-defined Function ex s being Element of product f st p c= s; registration let X be infinite set, a be set; cluster X --> a -> infinite; end; registration cluster infinite for Function; end; registration let R be infinite Relation; cluster field R -> infinite; end; registration let X be infinite set; cluster RelIncl X -> infinite; end; theorem for R,S being Relation st R,S are_isomorphic & R is finite holds S is finite; theorem product" {{}} = {}; theorem for I being set, f being non-empty ManySortedSet of I for s being f-compatible ManySortedSet of I holds s in product f; registration let I be set, f be non-empty ManySortedSet of I; cluster -> total for Element of product f; end; definition let I be set, f be non-empty ManySortedSet of I; let M be f-compatible ManySortedSet of I; func down M -> Element of product f equals M; end; theorem for X being functional with_common_domain set for f being Function st f in X holds dom f = DOM X; theorem for X being non empty functional set st for f being Function st f in X holds x in dom f holds x in DOM X; begin reserve x,y,y1,y2,z,a,b,X,Y,Z,V1,V2 for set, f,g,h,h9,f1,f2 for Function, i for Nat, P for Permutation of X, D,D1,D2,D3 for non empty set, d1 for Element of D1, d2 for Element of D2, d3 for Element of D3; theorem product f c= Funcs(dom f, Union f); begin theorem x in dom ~f implies ex y,z st x = [y,z]; theorem ~([:X,Y:] --> z) = [:Y,X:] --> z; theorem curry f = curry' ~f & uncurry f = ~uncurry' f; theorem [:X,Y:] <> {} implies curry ([:X,Y:] --> z) = X --> (Y --> z) & curry' ([:X,Y:] --> z) = Y --> (X --> z); theorem uncurry (X --> (Y --> z)) = [:X,Y:] --> z & uncurry' (X --> (Y --> z)) = [:Y,X:] --> z; theorem x in dom f & g = f.x implies rng g c= rng uncurry f & rng g c= rng uncurry' f ; theorem dom uncurry (X --> f) = [:X,dom f:] & rng uncurry (X --> f) c= rng f & dom uncurry' (X --> f) = [:dom f,X:] & rng uncurry' (X --> f) c= rng f; theorem X <> {} implies rng uncurry (X --> f) = rng f & rng uncurry' (X --> f) = rng f; theorem [:X,Y:] <> {} & f in Funcs([:X,Y:],Z) implies curry f in Funcs(X ,Funcs(Y,Z)) & curry' f in Funcs(Y,Funcs(X,Z)); theorem f in Funcs(X,Funcs(Y,Z)) implies uncurry f in Funcs([:X,Y:],Z) & uncurry' f in Funcs([:Y,X:],Z); theorem (curry f in Funcs(X,Funcs(Y,Z)) or curry' f in Funcs(Y,Funcs(X,Z))) & dom f c= [:V1,V2:] implies f in Funcs([:X,Y:],Z); theorem (uncurry f in Funcs([:X,Y:],Z) or uncurry' f in Funcs([:Y,X:],Z)) & rng f c= PFuncs(V1,V2) & dom f = X implies f in Funcs(X,Funcs(Y,Z)); theorem f in PFuncs([:X,Y:],Z) implies curry f in PFuncs(X,PFuncs(Y,Z)) & curry' f in PFuncs(Y,PFuncs(X,Z)); theorem f in PFuncs(X,PFuncs(Y,Z)) implies uncurry f in PFuncs([:X,Y:],Z ) & uncurry' f in PFuncs([:Y,X:],Z); theorem (curry f in PFuncs(X,PFuncs(Y,Z)) or curry' f in PFuncs(Y,PFuncs(X,Z)) ) & dom f c= [:V1,V2:] implies f in PFuncs([:X,Y:],Z); theorem (uncurry f in PFuncs([:X,Y:],Z) or uncurry' f in PFuncs([:Y,X:],Z)) & rng f c= PFuncs(V1,V2) & dom f c= X implies f in PFuncs(X,PFuncs(Y,Z)); begin definition let X be set; func SubFuncs X means x in it iff x in X & x is Function; end; theorem SubFuncs X c= X; theorem x in f"SubFuncs rng f iff x in dom f & f.x is Function; theorem SubFuncs {} = {} & SubFuncs {f} = {f} & SubFuncs {f,g} = {f,g} & SubFuncs {f,g,h} = {f,g,h}; theorem Y c= SubFuncs X implies SubFuncs Y = Y; definition let f be Function; func doms f -> Function means dom it = f"SubFuncs rng f & for x st x in f"SubFuncs rng f holds it.x = proj1 (f.x); func rngs f -> Function means dom it = f"SubFuncs rng f & for x st x in f"SubFuncs rng f holds it.x = proj2 (f.x); func meet f equals meet rng f; end; theorem x in dom f & g = f.x implies x in dom doms f & (doms f).x = dom g & x in dom rngs f & (rngs f).x = rng g; theorem doms {} = {} & rngs {} = {}; theorem doms (X --> f) = X --> dom f & rngs (X --> f) = X --> rng f; theorem f <> {} implies (x in meet f iff for y st y in dom f holds x in f.y); theorem Union ({} --> Y) = {} & meet ({} --> Y) = {}; theorem X <> {} implies Union (X --> Y) = Y & meet (X --> Y) = Y; definition let f be Function, x, y be set; func f..(x,y) -> set equals (uncurry f).(x,y); end; theorem x in X & y in dom f implies (X --> f)..(x,y) = f.y; begin definition let f be Function; func <:f:> -> Function equals curry ((uncurry' f)|([:meet doms f, dom f:] qua set)); end; theorem dom <:f:> = meet doms f & rng <:f:> c= product rngs f; theorem x in dom <:f:> implies <:f:>.x is Function; theorem x in dom <:f:> & g = <:f:>.x implies dom g = f"SubFuncs rng f & for y st y in dom g holds [y,x] in dom uncurry f & g.y = (uncurry f).(y,x); theorem x in dom <:f:> implies for g st g in rng f holds x in dom g; theorem g in rng f & (for g st g in rng f holds x in dom g) implies x in dom <:f :>; theorem x in dom f & g = f.x & y in dom <:f:> & h = <:f:>.y implies g.y = h.x; theorem x in dom f & f.x is Function & y in dom <:f:> implies f..(x,y) = <:f:> ..( y, x ); definition let f be Function; func Frege f -> Function means dom it = product doms f & for g st g in product doms f ex h st it.g = h & dom h = f"SubFuncs rng f & for x st x in dom h holds h.x = (uncurry f).(x,g.x); end; theorem g in product doms f & x in dom g implies (Frege f)..(g,x) = f..(x,g.x); theorem x in dom f & g = f.x & h in product doms f & h9 = (Frege f).h implies h.x in dom g & h9.x = g.(h.x) & h9 in product rngs f; theorem rng Frege f = product rngs f; theorem not {} in rng f implies (Frege f is one-to-one iff for g st g in rng f holds g is one-to-one); begin theorem <:{}:> = {} & Frege{} = {} .--> {}; theorem X <> {} implies dom <:X --> f:> = dom f & for x st x in dom f holds <: X --> f:>.x = X --> f.x; theorem dom Frege(X-->f) = Funcs(X,dom f) & rng Frege(X-->f) = Funcs(X,rng f) & for g st g in Funcs(X,dom f) holds (Frege(X-->f)).g = f*g; theorem dom f = X & dom g = X & (for x st x in X holds f.x,g.x are_equipotent) implies product f,product g are_equipotent; theorem dom f = dom h & dom g = rng h & h is one-to-one & (for x st x in dom h holds f.x, g.(h.x) are_equipotent) implies product f,product g are_equipotent; theorem dom f = X implies product f,product (f*P) are_equipotent; begin definition let f,X; func Funcs(f,X) -> Function means dom it = dom f & for x st x in dom f holds it.x = Funcs(f.x,X); end; theorem not {} in rng f implies Funcs(f,{}) = dom f --> {}; theorem Funcs({},X) = {}; theorem Funcs(X --> Y, Z) = X --> Funcs(Y,Z); theorem Funcs(Union disjoin f,X),product Funcs(f,X) are_equipotent; definition let X,f; func Funcs(X,f) -> Function means dom it = dom f & for x st x in dom f holds it.x = Funcs(X,f.x); end; theorem Funcs({},f) = dom f --> {{}}; theorem Funcs(X,{}) = {}; theorem Funcs(X, Y --> Z) = Y --> Funcs(X,Z); theorem product Funcs(X,f),Funcs(X, product f) are_equipotent; begin definition let f be Function; func commute f -> Function-yielding Function equals curry' uncurry f; end; theorem for f be Function, x be set st x in dom (commute f) holds (commute f). x is Function; theorem for A,B,C be set, f be Function st A <> {} & B <> {} & f in Funcs(A,Funcs(B,C)) holds commute f in Funcs(B,Funcs(A,C)); theorem for A,B,C be set, f be Function st A <> {} & B <> {} & f in Funcs(A, Funcs(B,C)) for g,h be Function, x,y be set st x in A & y in B & f.x = g & ( commute f).y = h holds h.x = g.y & dom h = A & dom g = B & rng h c= C & rng g c= C; theorem for A,B,C be set, f be Function st A <> {} & B <> {} & f in Funcs(A, Funcs(B,C)) holds commute commute f = f; theorem commute {} = {}; theorem for f be Function-yielding Function holds dom doms f = dom f; theorem for f be Function-yielding Function holds dom rngs f = dom f; begin reserve A,B,C for Ordinal; definition func one equals 1; end; begin definition let a,b be Ordinal; pred a,b are_relative_prime means for c,d1,d2 being Ordinal st a = c *^ d1 & b = c *^ d2 holds c = 1; symmetry; end; theorem not {},{} are_relative_prime; theorem 1,A are_relative_prime; theorem {},A are_relative_prime implies A = 1; reserve a,b,c,d for natural Ordinal; theorem a <> {} or b <> {} implies ex c,d1,d2 being natural Ordinal st d1,d2 are_relative_prime & a = c *^ d1 & b = c *^ d2; reserve l,m,n for natural Ordinal; registration let m,n; cluster m div^ n -> natural; cluster m mod^ n -> natural; end; definition let k,n be Ordinal; pred k divides n means ex a being Ordinal st n = k*^a; reflexivity; end; theorem a divides b iff ex c st b = a*^c; theorem for m,n st {} in m holds n mod^ m in m; theorem for n,m holds m divides n iff n = m *^ (n div^ m); theorem for n,m st n divides m & m divides n holds n = m; theorem n divides {} & 1 divides n; theorem for n,m st {} in m & n divides m holds n c= m; theorem for n,m,l st n divides m & n divides m +^ l holds n divides l; definition let k,n be natural Ordinal; func k lcm n -> Element of omega means k divides it & n divides it & for m st k divides m & n divides m holds it divides m; commutativity; end; theorem m lcm n divides m*^n; theorem n <> {} implies (m*^n) div^ (m lcm n) divides m; definition let k,n be natural Ordinal; func k hcf n -> Element of omega means it divides k & it divides n & for m st m divides k & m divides n holds m divides it; commutativity; end; theorem a hcf {} = a & a lcm {} = {}; theorem a hcf b = {} implies a = {}; theorem a hcf a = a & a lcm a = a; theorem (a*^c) hcf (b*^c) = (a hcf b)*^c; theorem b <> {} implies a hcf b <> {} & b div^ (a hcf b) <> {}; theorem a <> {} or b <> {} implies a div^ (a hcf b), b div^ (a hcf b) are_relative_prime; theorem a,b are_relative_prime iff a hcf b = 1; definition let a,b be natural Ordinal; func RED(a,b) -> Element of omega equals a div^ (a hcf b); end; theorem RED(a,b)*^(a hcf b) = a; theorem a <> {} or b <> {} implies RED(a,b), RED(b,a) are_relative_prime; theorem a,b are_relative_prime implies RED(a,b) = a; theorem RED(a,1) = a & RED(1,a) = 1; theorem b <> {} implies RED(b,a) <> {}; theorem RED({},a) = {} & (a <> {} implies RED(a,{}) = 1); theorem a <> {} implies RED(a,a) = 1; theorem c <> {} implies RED(a*^c, b*^c) = RED(a, b); begin reserve i,j,k for Element of omega; definition func RAT+ equals ({[i,j]: i,j are_relative_prime & j <> {}} \ {[k,1]: not contradiction}) \/ omega; end; reserve x,y,z for Element of RAT+; registration cluster RAT+ -> non empty; end; registration cluster non empty ordinal for Element of RAT+; end; theorem x in omega or ex i,j st x = [i,j] & i,j are_relative_prime & j <> {} & j <> 1 ; theorem not ex i,j being set st [i,j] is Ordinal; theorem A in RAT+ implies A in omega; registration cluster -> natural for ordinal Element of RAT+; end; theorem not ex i,j being set st [i,j] in omega; theorem [i,j] in RAT+ iff i,j are_relative_prime & j <> {} & j <> 1; definition let x be Element of RAT+; func numerator x -> Element of omega means it = x if x in omega otherwise ex a st x = [it,a]; func denominator x -> Element of omega means it = 1 if x in omega otherwise ex a st x = [a,it]; end; theorem numerator x, denominator x are_relative_prime; theorem denominator x <> {}; theorem not x in omega implies x = [numerator x, denominator x] & denominator x <> 1; theorem x <> {} iff numerator x <> {}; theorem x in omega iff denominator x = 1; definition let i,j be natural Ordinal; func i/j -> Element of RAT+ equals {} if j = {}, RED(i,j) if RED(j,i ) = 1 otherwise [RED(i,j), RED(j,i)]; end; notation let i,j be natural Ordinal; synonym quotient(i,j) for i/j; end; theorem (numerator x)/(denominator x) = x; theorem {}/b = {} & a/1 = a; theorem a <> {} implies a/a = 1; theorem b <> {} implies numerator (a/b) = RED(a,b) & denominator (a/b) = RED(b,a); theorem i,j are_relative_prime & j <> {} implies numerator (i/j) = i & denominator (i/j) = j; theorem c <> {} implies (a*^c)/(b*^c) = a/b; reserve i,j,k for natural Ordinal; theorem j <> {} & l <> {} implies (i/j = k/l iff i*^l = j*^k); definition let x,y be Element of RAT+; func x+y -> Element of RAT+ equals ((numerator x)*^(denominator y)+^( numerator y)*^(denominator x)) / ((denominator x)*^(denominator y)); commutativity; func x*'y -> Element of RAT+ equals ((numerator x)*^(numerator y)) / (( denominator x)*^(denominator y)); commutativity; end; theorem j <> {} & l <> {} implies (i/j)+(k/l) = (i*^l+^j*^k)/(j*^l); theorem k <> {} implies (i/k)+(j/k) = (i+^j)/k; registration cluster empty for Element of RAT+; end; definition redefine func {} -> Element of RAT+; redefine func one -> non empty ordinal Element of RAT+; end; theorem x*'{} = {}; theorem (i/j)*'(k/l) = (i*^k)/(j*^l); theorem x+{} = x; theorem (x+y)+z = x+(y+z); theorem (x*'y)*'z = x*'(y*'z); theorem x*'one = x; theorem x <> {} implies ex y st x*'y = 1; theorem x <> {} implies ex z st y = x*'z; theorem x <> {} & x*'y = x*'z implies y = z; theorem x*'(y+z) = x*'y+x*'z; theorem for i,j being ordinal Element of RAT+ holds i+j = i+^j; theorem for i,j being ordinal Element of RAT+ holds i*'j = i*^j; theorem ex y st x = y+y; definition let x,y be Element of RAT+; pred x <=' y means ex z being Element of RAT+ st y = x+z; connectedness; end; notation let x,y be Element of RAT+; antonym y < x for x <=' y; end; reserve r,s,t for Element of RAT+; theorem not ex y being set st [{},y] in RAT+; theorem s + t = r + t implies s = r; theorem r+s = {} implies r = {}; theorem {} <=' s; theorem s <=' {} implies s = {}; theorem r <=' s & s <=' r implies r = s; theorem r <=' s & s <=' t implies r <=' t; theorem r < s iff r <=' s & r <> s; theorem r < s & s <=' t or r <=' s & s < t implies r < t; theorem r < s & s < t implies r < t; theorem x in omega & x+y in omega implies y in omega; theorem for i being ordinal Element of RAT+ st i < x & x < i+one holds not x in omega ; theorem t <> {} implies ex r st r < t & not r in omega; theorem {s: s < t} in RAT+ iff t = {}; theorem for A being Subset of RAT+ st (ex t st t in A & t <> {}) & for r,s st r in A & s <=' r holds s in A ex r1,r2,r3 being Element of RAT+ st r1 in A & r2 in A & r3 in A & r1 <> r2 & r2 <> r3 & r3 <> r1; theorem s + t <=' r + t iff s <=' r; theorem s <=' s + t; theorem r*'s = {} implies r = {} or s = {}; theorem r <=' s *' t implies ex t0 being Element of RAT+ st r = s *' t0 & t0 <=' t; theorem t <> {} & s *' t <=' r *' t implies s <=' r; theorem for r1,r2,s1,s2 being Element of RAT+ st r1+r2 = s1+s2 holds r1 <=' s1 or r2 <=' s2; theorem s <=' r implies s *' t <=' r *' t; theorem for r1,r2,s1,s2 being Element of RAT+ st r1*'r2 = s1*'s2 holds r1 <=' s1 or r2 <=' s2; theorem r = {} iff r + s = s; theorem for s1,t1,s2,t2 being Element of RAT+ st s1 + t1 = s2 + t2 & s1 <=' s2 holds t2 <=' t1; theorem r <=' s & s <=' r + t implies ex t0 being Element of RAT+ st s = r + t0 & t0 <=' t; theorem r <=' s + t implies ex s0,t0 being Element of RAT+ st r = s0 + t0 & s0 <=' s & t0 <=' t; theorem r < s & r < t implies ex t0 being Element of RAT+ st t0 <=' s & t0 <=' t & r < t0; theorem r <=' s & s <=' t & s <> t implies r <> t; theorem s < r + t & t <> {} implies ex r0,t0 being Element of RAT+ st s = r0 + t0 & r0 <=' r & t0 <=' t & t0 <> t; theorem for A being non empty Subset of RAT+ st A in RAT+ ex s st s in A & for r st r in A holds r <=' s; theorem ex t st r + t = s or s + t = r; theorem r < s implies ex t st r < t & t < s; theorem ex s st r < s; theorem t <> {} implies ex s st s in omega & r <=' s *' t; scheme DisNat { n0,n1,n2() -> Element of RAT+, P[set] }: ex s st s in omega & P[s] & not P[s + n1()] provided n1() = 1 and n0() = {} and n2() in omega and P[n0()] and not P[n2()]; begin reserve r,s,t,x9,y9,z9,p,q for Element of RAT+; definition func DEDEKIND_CUTS -> Subset-Family of RAT+ equals { A where A is Subset of RAT+: r in A implies (for s st s <=' r holds s in A) & ex s st s in A & r < s } \ { RAT+}; end; registration cluster DEDEKIND_CUTS -> non empty; end; definition func REAL+ equals RAT+ \/ DEDEKIND_CUTS \ {{ s: s < t}: t <> {}}; end; reserve x,y,z for Element of REAL+; theorem RAT+ c= REAL+; theorem omega c= REAL+; registration cluster REAL+ -> non empty; end; definition let x; func DEDEKIND_CUT x -> Element of DEDEKIND_CUTS means ex r st x = r & it = { s : s < r } if x in RAT+ otherwise it = x; end; theorem not ex y being set st [{},y] in REAL+; definition let x be Element of DEDEKIND_CUTS; func GLUED x -> Element of REAL+ means ex r st it = r & for s holds s in x iff s < r if ex r st for s holds s in x iff s < r otherwise it = x; end; definition let x,y be Element of REAL+; pred x <=' y means ex x9,y9 st x = x9 & y = y9 & x9 <=' y9 if x in RAT+ & y in RAT+, x in y if x in RAT+ & not y in RAT+, not y in x if not x in RAT+ & y in RAT+ otherwise x c= y; connectedness; end; notation let x,y be Element of REAL+; antonym y < x for x <=' y; end; definition let A,B be Element of DEDEKIND_CUTS; func A + B -> Element of DEDEKIND_CUTS equals { r + s : r in A & s in B}; commutativity; end; definition let A,B be Element of DEDEKIND_CUTS; func A *' B -> Element of DEDEKIND_CUTS equals { r *' s : r in A & s in B}; commutativity; end; definition let x,y be Element of REAL+; func x + y -> Element of REAL+ equals x if y = {}, y if x = {} otherwise GLUED(DEDEKIND_CUT x + DEDEKIND_CUT y); commutativity; func x *' y -> Element of REAL+ equals GLUED(DEDEKIND_CUT x *' DEDEKIND_CUT y); commutativity; end; theorem x = {} implies x *' y = {}; theorem x + y = {} implies x = {}; theorem x + (y + z) = (x + y) + z; theorem { A where A is Subset of RAT+: r in A implies (for s st s <=' r holds s in A) & ex s st s in A & r < s} is c=-linear; theorem for X,Y being Subset of REAL+ st (ex x st x in Y) & for x,y st x in X & y in Y holds x <=' y ex z st for x,y st x in X & y in Y holds x <=' z & z <=' y; theorem x <=' y implies ex z st x + z = y; theorem ex z st x + z = y or y + z = x; theorem x + y = x + z implies y = z; theorem x *' (y *' z) = x *' y *' z; theorem x *' (y + z) = (x *' y) + (x *' z); theorem x <> {} implies ex y st x *' y = one; theorem x = one implies x *' y = y; theorem x in omega & y in omega implies y + x in omega; theorem for A being Subset of REAL+ st {} in A & for x,y st x in A & y = one holds x + y in A holds omega c= A; theorem for x st x in omega holds for y holds y in x iff y in omega & y <> x & y <=' x; theorem x = y + z implies z <=' x; theorem {} in REAL+ & one in REAL+; theorem x in RAT+ & y in RAT+ implies ex x9,y9 st x = x9 & y = y9 & x *' y = x9 *' y9 ; begin reserve x,y,z for Element of REAL+; theorem x + y = y implies x = {}; theorem x *' y = {} implies x = {} or y = {}; theorem x <=' y & y <=' z implies x <=' z; theorem x <=' y & y <=' x implies x = y; theorem x <=' y & y = {} implies x = {}; theorem x = {} implies x <=' y; theorem x <=' y iff x + z <=' y + z; theorem x <=' y implies x *' z <=' y *' z; definition let x,y be Element of REAL+; func x -' y -> Element of REAL+ means it + y = x if y <=' x otherwise it = {}; end; theorem x <=' y or x -' y <> {}; theorem x <=' y & y -' x = {} implies x = y; theorem x -' y <=' x; theorem y <=' x & y <=' z implies x + (z -' y) = x -' y + z; theorem z <=' y implies x + (y -' z) = x + y -' z; theorem z <=' x & y <=' z implies x -' z + y = x -' (z -' y); theorem y <=' x & y <=' z implies z -' y + x = x -' y + z; theorem x <=' y implies z -' y <=' z -' x; theorem x <=' y implies x -' z <=' y -' z; definition let x,y be Element of REAL+; func x - y equals x -' y if y <=' x otherwise [{},y -' x]; end; theorem x - x = {}; theorem x = {} & y <> {} implies x - y = [{},y]; theorem z <=' y implies x + (y -' z) = x + y - z; theorem not z <=' y implies x - (z -' y) = x + y - z; theorem y <=' x & not y <=' z implies x - (y -' z) = x -' y + z; theorem not y <=' x & not y <=' z implies x - (y -' z) = z - (y -' x); theorem y <=' x implies x - (y + z) = x -' y - z; theorem x <=' y & z <=' y implies y -' z - x = y -' x - z; theorem z <=' y implies x *' (y -' z) = (x *' y) - (x *' z); theorem not z <=' y & x <> {} implies [{},x *' (z -' y)] = (x *' y) - (x *' z); theorem y -' z <> {} & z <=' y & x <> {} implies (x *' z) - (x *' y) = [{},x *' (y -' z)]; begin notation synonym NAT for omega; synonym 0 for {}; end; definition func REAL equals REAL+ \/ [:{0},REAL+:] \ {[0,0]}; end; registration cluster REAL -> non empty; end; definition func COMPLEX equals Funcs({0,1},REAL) \ { x where x is Element of Funcs({0,1 },REAL): x.1 = 0} \/ REAL; func RAT equals RAT+ \/ [:{0},RAT+:] \ {[0,0]}; func INT equals NAT \/ [:{0},NAT:] \ {[0,0]}; redefine func NAT -> Subset of REAL; end; registration cluster COMPLEX -> non empty; cluster RAT -> non empty; cluster INT -> non empty; end; reserve i,j,k for Element of NAT; reserve a,b for Element of REAL; definition redefine func 0 -> Element of NAT; end; theorem REAL c< COMPLEX; reserve r,s,t for Element of RAT+; reserve i,j,k for Element of omega; theorem RAT c< REAL; theorem RAT c< COMPLEX; theorem INT c< RAT; theorem INT c< REAL; theorem INT c< COMPLEX; theorem NAT c< INT; theorem NAT c< RAT; theorem NAT c< REAL; theorem NAT c< COMPLEX; begin theorem REAL c= COMPLEX; theorem RAT c= REAL; theorem RAT c= COMPLEX; theorem INT c= RAT; theorem INT c= REAL; theorem INT c= COMPLEX; theorem NAT c= INT; theorem NAT c= RAT; theorem NAT c= REAL; theorem NAT c= COMPLEX; theorem REAL <> COMPLEX; theorem RAT <> REAL; theorem RAT <> COMPLEX; theorem INT <> RAT; theorem INT <> REAL; theorem INT <> COMPLEX; theorem NAT <> INT; theorem NAT <> RAT; theorem NAT <> REAL; theorem NAT <> COMPLEX; definition func ExtREAL equals REAL \/ { REAL, [0,REAL] }; end; registration cluster ExtREAL -> non empty; end; theorem REAL c= ExtREAL; theorem REAL <> ExtREAL; theorem REAL c< ExtREAL; registration cluster INT -> infinite; cluster RAT -> infinite; cluster REAL -> infinite; cluster COMPLEX -> infinite; end; begin theorem REAL+ c= REAL; theorem for x being Element of REAL+ st x <> {} holds [{},x] in REAL; theorem for y being set st [{},y] in REAL holds y <> {}; theorem for x,y being Element of REAL+ holds x - y in REAL; theorem REAL+ misses [:{{}},REAL+:]; begin theorem for x,y being Element of REAL+ st x - y = {} holds x = y; theorem for x,y,z being Element of REAL+ st x <> {} & x *' y = x *' z holds y = z; begin definition let x,y be Element of REAL; func +(x,y) -> Element of REAL means ex x9,y9 being Element of REAL+ st x = x9 & y = y9 & it = x9 + y9 if x in REAL+ & y in REAL+, ex x9,y9 being Element of REAL+ st x = x9 & y = [0,y9] & it = x9 - y9 if x in REAL+ & y in [:{ 0},REAL+:], ex x9,y9 being Element of REAL+ st x = [0,x9] & y = y9 & it = y9 - x9 if y in REAL+ & x in [:{0},REAL+:] otherwise ex x9,y9 being Element of REAL+ st x = [0,x9] & y = [0,y9] & it = [0,x9+y9]; commutativity; func *(x,y) -> Element of REAL means ex x9,y9 being Element of REAL+ st x = x9 & y = y9 & it = x9 *' y9 if x in REAL+ & y in REAL+, ex x9,y9 being Element of REAL+ st x = x9 & y = [0,y9] & it = [0,x9 *' y9] if x in REAL+ & y in [:{0},REAL+:] & x <> 0, ex x9,y9 being Element of REAL+ st x = [0,x9] & y = y9 & it = [0,y9 *' x9] if y in REAL+ & x in [:{0},REAL+:] & y <> 0, ex x9,y9 being Element of REAL+ st x = [0,x9] & y = [0,y9] & it = y9 *' x9 if x in [:{0} ,REAL+:] & y in [:{0},REAL+:] otherwise it = 0; commutativity; end; reserve x,y for Element of REAL; definition let x be Element of REAL; func opp x -> Element of REAL means +(x,it) = 0; involutiveness; func inv x -> Element of REAL means *(x,it) = 1 if x <> 0 otherwise it = 0; involutiveness; end; begin reserve i,j,k for Element of NAT; reserve a,b for Element of REAL; theorem not (0,1)-->(a,b) in REAL; definition let x,y be Element of REAL; func [*x,y*] -> Element of COMPLEX equals x if y = 0 otherwise (0,1) --> (x,y); end; theorem for c being Element of COMPLEX ex r,s being Element of REAL st c = [*r ,s*]; theorem for x1,x2,y1,y2 being Element of REAL st [*x1,x2*] = [*y1,y2*] holds x1 = y1 & x2 = y2; theorem for x,o being Element of REAL st o = 0 holds +(x,o) = x; theorem for x,o being Element of REAL st o = 0 holds *(x,o) = 0; theorem for x,y,z being Element of REAL holds *(x,*(y,z)) = *(*(x,y),z); theorem for x,y,z being Element of REAL holds *(x,+(y,z)) = +(*(x,y),*(x ,z)); theorem for x,y being Element of REAL holds *(opp x,y) = opp *(x,y); theorem for x being Element of REAL holds *(x,x) in REAL+; theorem for x,y st +(*(x,x),*(y,y)) = 0 holds x = 0; theorem for x,y,z being Element of REAL st x <> 0 & *(x,y) = 1 & *(x,z) = 1 holds y = z; theorem for x,y st y = 1 holds *(x,y) = x; theorem for x,y st y <> 0 holds *(*(x,y),inv y) = x; theorem for x,y st *(x,y) = 0 holds x = 0 or y = 0; theorem for x,y holds inv *(x,y) = *(inv x, inv y); theorem for x,y,z being Element of REAL holds +(x,+(y,z)) = +(+(x,y),z); theorem [*x,y*] in REAL implies y = 0; theorem for x,y being Element of REAL holds opp +(x,y) = +(opp x, opp y); begin definition func equals (0,1) --> (0,1); let c be number; attr c is complex means c in COMPLEX; end; registration cluster -> complex; end; registration cluster complex for number; end; registration sethood of complex number; end; notation let x be complex number; synonym x is zero for x is empty; end; definition let x be complex number; redefine attr x is zero means x = 0; end; definition let x,y be complex number; func x+y means ex x1,x2,y1,y2 being Element of REAL st x = [*x1,x2*] & y = [*y1,y2*] & it = [*+(x1,y1),+(x2,y2)*]; commutativity; func x*y means ex x1,x2,y1,y2 being Element of REAL st x = [*x1,x2*] & y = [*y1,y2*] & it = [* +(*(x1,y1),opp*(x2,y2)), +(*(x1,y2),*(x2,y1)) *]; commutativity; end; registration let z,z9 be complex number; cluster z+z9 -> complex; cluster z*z9 -> complex; end; definition let z be complex number; func -z -> complex number means z + it = 0; involutiveness; func z" -> complex number means z*it = 1 if z <> 0 otherwise it = 0; involutiveness; end; definition let x,y be complex number; func x-y equals x+(-y); func x/y equals x * y"; end; registration let x,y be complex number; cluster x-y -> complex; cluster x/y -> complex; end; registration cluster non zero for complex number; end; registration let x be non zero complex number; cluster -x -> non zero; cluster x" -> non zero; let y be non zero complex number; cluster x*y -> non zero; end; registration let x,y be non zero complex number; cluster x/y -> non zero; end; registration cluster -> complex for Element of REAL; end; registration cluster natural -> complex for number; end; registration cluster -> complex for Element of COMPLEX; end; begin reserve x for complex number; theorem x + 0 = x; theorem x * 0 = 0; theorem 1 * x = x; theorem x - 0 = x; theorem 0 / x = 0; theorem x / 1 = x; begin reserve x for set; definition let x; attr x is ext-real means x in ExtREAL; end; registration cluster ext-real for number; cluster -> ext-real for Element of ExtREAL; end; registration sethood of ext-real number; end; definition func +infty equals REAL; func -infty equals [0,REAL]; end; definition redefine func ExtREAL equals REAL \/ {+infty,-infty}; end; registration cluster +infty -> ext-real; cluster -infty -> ext-real; end; definition let x,y be ext-real number; pred x <= y means ex x9,y9 being Element of REAL+ st x = x9 & y = y9 & x9 <=' y9 if x in REAL+ & y in REAL+, ex x9,y9 being Element of REAL+ st x = [0,x9] & y = [0,y9] & y9 <=' x9 if x in [:{0},REAL+:] & y in [:{0},REAL+:] otherwise y in REAL+ & x in [:{0},REAL+:] or x = -infty or y = +infty; reflexivity; connectedness; end; reserve a,b,c,d for ext-real number; notation let a,b; synonym b >= a for a <= b; antonym b < a for a <= b; antonym a > b for a <= b; end; theorem a <= b & b <= a implies a = b; theorem a <= b & b <= c implies a <= c; theorem a <= +infty; theorem +infty <= a implies a = +infty; theorem a >= -infty; theorem -infty >= a implies a = -infty; theorem -infty < +infty; theorem not +infty in REAL; theorem a in REAL implies +infty > a; theorem a in REAL & b >= a implies b in REAL or b = +infty; theorem not -infty in REAL; theorem a in REAL implies -infty < a; theorem a in REAL & b <= a implies b in REAL or b = -infty; theorem a in REAL or a = +infty or a = -infty; begin registration cluster natural -> ext-real for number; end; notation let a be number; synonym a is zero for a is empty; end; definition let a be ext-real number; attr a is positive means a > 0; attr a is negative means a < 0; redefine attr a is zero means a = 0; end; registration cluster positive -> non negative non zero for ext-real number; cluster non negative non zero -> positive for ext-real number; cluster negative -> non positive non zero for ext-real number; cluster non positive non zero -> negative for ext-real number; cluster zero -> non negative non positive for ext-real number; cluster non negative non positive -> zero for ext-real number; end; registration cluster +infty -> positive; cluster -infty -> negative; end; registration cluster positive for ext-real number; cluster negative for ext-real number; cluster zero for ext-real number; end; begin definition let a,b; func min(a,b) equals a if a <= b otherwise b; commutativity; idempotence; func max(a,b) equals a if b <= a otherwise b; commutativity; idempotence; end; theorem min(a,b) = a or min(a,b) = b; theorem max(a,b) = a or max(a,b) = b; registration let a,b; cluster min(a,b) -> ext-real; cluster max(a,b) -> ext-real; end; theorem min(a,b) <= a; theorem a <= b & c <= d implies min(a,c) <= min(b,d); theorem a < b & c < d implies min(a,c) < min(b,d); theorem a <= b & a <= c implies a <= min(b,c); theorem a < b & a < c implies a < min(b,c); theorem a <= min(b,c) implies a <= b; theorem a < min(b,c) implies a < b; theorem c <= a & c <= b & (for d st d <= a & d <= b holds d <= c) implies c = min(a,b); theorem a <= max(a,b); theorem a <= b & c <= d implies max(a,c) <= max(b,d); theorem a < b & c < d implies max(a,c) < max(b,d); theorem b <= a & c <= a implies max(b,c) <= a; theorem b < a & c < a implies max(b,c) < a; theorem max(b,c) <= a implies b <= a; theorem max(b,c) < a implies b < a; theorem a <= c & b <= c & (for d st a <= d & b <= d holds c <= d) implies c = max(a,b); theorem min(min(a,b),c) = min(a,min(b,c)); theorem max(max(a,b),c) = max(a,max(b,c)); theorem min(max(a,b),b) = b; theorem max(min(a,b),b) = b; theorem a <= c implies max(a,min(b,c)) = min(max(a,b),c); theorem min(a,max(b,c)) = max(min(a,b),min(a,c)); theorem max(a,min(b,c)) = min(max(a,b),max(a,c)); theorem max(max(min(a,b),min(b,c)),min(c,a)) = min(min(max(a,b),max(b,c)),max( c,a)); theorem max(a,+infty) = +infty; theorem min(a,+infty) = a; theorem max(a,-infty) = a; theorem min(a,-infty) = -infty; begin theorem a in REAL & c in REAL & a <= b & b <= c implies b in REAL; theorem a in REAL & a <= b & b < c implies b in REAL; theorem c in REAL & a < b & b <= c implies b in REAL; theorem a < b & b < c implies b in REAL; definition let x,y be ext-real number, a,b be set; func IFGT(x,y,a,b) equals a if x > y otherwise b; end; registration let x,y be ext-real number, a,b be Nat; cluster IFGT(x,y,a,b) -> natural; end; theorem max(a,b) <= a implies max(a,b) = a; theorem a <= min(a,b) implies min(a,b) = a; begin definition let r be number; attr r is real means r in REAL; end; registration cluster -> real for Element of REAL; end; registration cluster -infty -> non real; cluster +infty -> non real; end; registration cluster natural -> real for number; cluster real -> complex for number; end; registration cluster real for number; cluster real -> ext-real for number; end; registration let x be real number; cluster -x -> real; cluster x" -> real; let y be real number; cluster x + y -> real; cluster x * y -> real; end; registration let x,y be real number; cluster x-y -> real; cluster x/y -> real; end; begin reserve r,s,t for real number; registration cluster positive for real number; cluster negative for real number; cluster zero for real number; end; registration let r,s be non negative real number; cluster r + s -> non negative; end; registration let r,s be non positive real number; cluster r + s -> non positive; end; registration let r be positive real number; let s be non negative real number; cluster r + s -> positive; cluster s + r -> positive; end; registration let r be negative real number; let s be non positive real number; cluster r + s -> negative; cluster s + r -> negative; end; registration let r be non positive real number; cluster -r -> non negative; end; registration let r be non negative real number; cluster -r -> non positive; end; registration let r be non negative real number, s be non positive real number; cluster r - s -> non negative; cluster s - r -> non positive; end; registration let r be positive real number; let s be non positive real number; cluster r - s -> positive; cluster s - r -> negative; end; registration let r be negative real number; let s be non negative real number; cluster r - s -> negative; cluster s - r -> positive; end; registration let r be non positive real number, s be non negative real number; cluster r*s -> non positive; cluster s*r -> non positive; end; registration let r,s be non positive real number; cluster r*s -> non negative; end; registration let r,s be non negative real number; cluster r*s -> non negative; end; registration let r be positive real number; cluster r" -> positive; end; registration let r be non positive real number; cluster r" -> non positive; end; registration let r be negative real number; cluster r" -> negative; end; registration let r be non negative real number; cluster r" -> non negative; end; registration let r be non negative real number, s be non positive real number; cluster r/s -> non positive; cluster s/r -> non positive; end; registration let r,s be non negative real number; cluster r/s -> non negative; end; registration let r,s be non positive real number; cluster r/s -> non negative; end; begin registration let r,s; cluster min(r,s) -> real; cluster max(r,s) -> real; end; definition let r,s be real number; func r -' s equals r - s if r -s >= 0 otherwise 0; end; registration let r,s be real number; cluster r -' s -> real; end; registration let r,s be real number; cluster r -' s -> non negative for real number; end; begin reserve x, y, z for real number; theorem x <= y & x is positive implies y is positive; theorem x <= y & y is negative implies x is negative; theorem x <= y & x is non negative implies y is non negative; theorem x <= y & y is non positive implies x is non positive; theorem x <= y & y is non zero & x is non negative implies y is positive; theorem x <= y & x is non zero & y is non positive implies x is negative; theorem not x <= y & x is non positive implies y is negative; theorem not x <= y & y is non negative implies x is positive; begin reserve a, b, c, d, e for complex number; theorem a + (b + c) = (a + b) + c; theorem a + c = b + c implies a = b; theorem a = a + b implies b = 0; theorem a * (b * c) = (a * b) * c; theorem c <> 0 & a * c = b * c implies a = b; theorem a*b=0 implies a=0 or b=0; theorem b <> 0 & a * b = b implies a = 1; theorem a * (b + c) = a * b + a * c; theorem (a + b + c) * d = a * d + b * d + c * d; theorem (a + b) * (c + d) = a * c + a * d + b * c + b * d; theorem 2 * a = a + a; theorem 3 * a = a + a + a; theorem 4 * a = a + a + a + a; theorem a - a = 0; theorem a - b = 0 implies a = b; theorem b - a = b implies a = 0; theorem a = a - (b - b); theorem a - (a - b) = b; theorem a - c = b - c implies a = b; theorem c - a = c - b implies a = b; theorem a - b - c = a - c - b; theorem a - c = (a - b) - (c - b); theorem (c - a) - (c - b) = b - a; theorem a - b = c - d implies a - c = b - d; theorem a = a + (b - b); theorem a = a + b - b; theorem a = a - b + b; theorem a + c = a + b + (c - b); theorem a + b - c = a - c + b; theorem a - b + c = c - b + a; theorem a + c = a + b - (b - c); theorem a - c = a + b - (c + b); theorem a + b = c + d implies a - c = d - b; theorem a - c = d - b implies a + b = c + d; theorem a + b = c - d implies a + d = c - b; theorem a - (b + c) = a - b - c; theorem a - (b - c) = a - b + c; theorem a - (b - c) = a + (c - b); theorem a - c = (a - b) + (b - c); theorem a * (b - c) = a * b - a * c; theorem (a - b) * (c - d) = (b - a) * (d - c); theorem (a - b - c) * d = a * d - b * d - c * d; theorem (a + b - c) * d = a * d + b * d - c * d; theorem (a - b + c) * d = a * d - b * d + c * d; theorem (a + b) * (c - d) = a * c - a * d + b * c - b * d; theorem (a - b) * (c + d) = a * c + a * d - b * c - b * d; theorem (a - b) * (e - d) = a * e - a * d - b * e + b * d; theorem a / b / c = a / c / b; theorem a / 0 = 0; theorem a <> 0 & b <> 0 implies a / b <> 0; theorem b <> 0 implies a = a / (b / b); theorem a <> 0 implies a / (a / b) = b; theorem c <> 0 & a / c = b / c implies a = b; theorem a / b <> 0 implies b = a / (a / b); theorem c <> 0 implies a / b = (a / c) / (b / c); theorem 1 / (1 / a) = a; theorem 1 / (a / b) = b / a; theorem a / b = 1 implies a = b; theorem 1 / a = 1 / b implies a = b; theorem a <> 0 implies a / a = 1; theorem b <> 0 & b / a = b implies a = 1; theorem a / c + b / c = (a + b) / c; theorem (a + b + e) / d = a / d + b / d + e / d; theorem (a + a) / 2 = a; theorem a/2 + a/2 = a; theorem a = (a + b) / 2 implies a = b; theorem (a + a + a)/3 = a; theorem a/3 + a/3 + a/3 = a; theorem (a + a + a + a) / 4 = a; theorem a/4 + a/4 + a/4 + a/4 = a; theorem a / 4 + a / 4 = a / 2; theorem (a + a) / 4 = a / 2; theorem a * b = 1 implies a = 1 / b; theorem a * (b / c) = (a * b) / c; theorem a / b * e = e / b * a; theorem (a / b) * (c / d) = (a * c) / (b * d); theorem a / (b / c) = (a * c) / b; theorem a / (b * c) = a / b / c; theorem a / (b / c) = a * (c / b); theorem a / (b / c) = c / b * a; theorem a / (b / e) = e * (a / b); theorem a / (b / c) = a / b * c; theorem (a * b) / (c * d) = (a / c * b) / d; theorem (a / b) / (c / d) = (a * d) / (b * c); theorem (a / c) * (b / d) = (a / d) * (b / c); theorem a / (b * c * (d / e)) = (e / c) * (a / (b * d)); theorem b <> 0 implies a / b * b = a; theorem b <> 0 implies a = a * (b / b); theorem b <> 0 implies a = a * b / b; theorem b <> 0 implies a * c = a * b * (c / b); theorem c <> 0 implies a / b = (a * c) / (b * c); theorem c <> 0 implies a / b = a / (b * c) * c; theorem b <> 0 implies a * c = a * b / (b / c); theorem c <> 0 & d <> 0 & a * c = b * d implies a / d = b / c; theorem c <> 0 & d<>0 & a/d=b/c implies a*c = b*d; theorem c <> 0 & d <> 0 & a * c = b / d implies a * d = b / c; theorem c <> 0 implies a / b = c * (a / c / b); theorem c <> 0 implies a / b = a / c * (c / b); theorem a * (1 / b) = a / b; theorem a / (1 / b) = a * b; theorem a / b * c = 1 / b * c * a; theorem (1 / a) * (1 / b) = 1 / (a * b); theorem 1 / c * (a / b) = a / (b * c); theorem a / b / c = 1 / b * (a / c); theorem a / b / c = 1 / c * (a / b); theorem a <> 0 implies a * (1 / a) = 1; theorem b <> 0 implies a = a * b * (1 / b); theorem b <> 0 implies a = a * (1 / b * b); theorem b <> 0 implies a = a * (1 / b) * b; theorem b <> 0 implies a = a / (b * (1 / b)); theorem a <> 0 & b <> 0 implies 1 / (a * b) <> 0; theorem a <> 0 & b <> 0 implies (a / b) * (b / a) = 1; theorem b <> 0 implies a / b + c = (a + b * c) / b; theorem c <> 0 implies a + b = c * (a / c + b / c); theorem c <> 0 implies a + b = (a * c + b * c) / c; theorem b <> 0 & d <> 0 implies a / b + c / d =(a * d + c * b) / (b * d ); theorem a <> 0 implies a + b = a * (1 + b / a); theorem a / (2 * b) + a / (2 * b) = a / b; theorem a / (3 * b) + a / (3 * b) + a / (3 * b) = a / b; theorem a / c - b / c = (a - b) / c; theorem a - a / 2 = a / 2; theorem (a - b - c) / d = a / d - b / d - c / d; theorem b <> 0 & d <> 0 & b <> d & a / b = e / d implies a / b = (a - e) / (b - d ); theorem (a + b - e) / d = a / d + b / d - e / d; theorem (a - b + e) / d = a / d - b / d + e / d; theorem b <> 0 implies a / b - e = (a - e * b) / b; theorem b <> 0 implies c - a / b = (c * b - a) / b; theorem c <> 0 implies a - b = c * (a / c - b / c); theorem c <> 0 implies a - b = (a * c - b * c) / c; theorem b <> 0 & d <> 0 implies a / b - c / d = (a * d - c * b) / (b * d); theorem a <> 0 implies a - b = a * (1 - b / a); theorem a <> 0 implies c = (a * c + b - b) / a; theorem -a = -b implies a = b; theorem -a = 0 implies a = 0; theorem a + -b = 0 implies a = b; theorem a = a + b + -b; theorem a = a + (b + -b); theorem a = (- b + a) + b; theorem - (a + b) = -a + -b; theorem - (-a + b) = a + -b; theorem a+b=-(-a+-b); theorem -(a - b) = b - a; theorem - a - b = - b - a; theorem a = - b - (- a - b); theorem - a - b - c = - a - c - b; theorem - a - b - c = - b - c - a; theorem - a - b - c = - c - b - a; theorem (c - a) - (c - b) = - (a - b); theorem 0 - a = - a; theorem a + b = a - - b; theorem a = a - (b + -b); theorem a - c = b + - c implies a = b; theorem c - a = c + - b implies a = b; theorem a + b - c = - c + a + b; theorem a - b + c = - b + c + a; theorem a - (- b - c) = a + b + c; theorem a - b - c = - b - c + a; theorem a - b - c = - c + a - b; theorem a - b - c = - c - b + a; theorem - (a + b) = - b - a; theorem - (a - b) = - a + b; theorem -(-a+b)=a-b; theorem a + b = -(- a - b); theorem - a + b - c = - c + b - a; theorem - a + b - c = - c - a + b; theorem - (a + b + c) = - a - b - c; theorem - (a + b - c) = - a - b + c; theorem - (a - b + c) = - a + b - c; theorem - (a - b - c) = - a + b + c; theorem - (- a + b + c) = a - b - c; theorem - (- a + b - c) = a - b + c; theorem - (- a - b + c) = a + b - c; theorem - (- a - b - c) = a + b + c; theorem (- a) * b = -(a * b); theorem (- a) * b = a * (- b); theorem (- a) * (- b) = a * b; theorem - a * (- b) = a * b; theorem -(-a) * b = a * b; theorem (-1) * a = -a; theorem (- a) * (- 1) = a; theorem b<>0 & a*b=-b implies a=-1; theorem a * a = 1 implies a = 1 or a = -1; theorem -a + 2 * a = a; theorem (a - b) * c = (b - a) * (- c); theorem (a - b) * c = - (b - a) * c; theorem a - 2 * a = -a; theorem -a / b = (-a) / b; theorem a / (- b) = -a / b; theorem - a / (- b) = a / b; theorem -(- a) / b = a / b; theorem (- a) / (- b) = a / b; theorem (-a) / b = a / (-b); theorem -a = a / (-1); theorem a = (- a) / (-1); theorem a / b = - 1 implies a = - b & b = - a; theorem b <> 0 & b / a = - b implies a = -1; theorem a <> 0 implies (-a) / a = -1; theorem a <> 0 implies a / (- a) = -1; theorem a <> 0 & a = 1 / a implies a = 1 or a = -1; theorem b <> 0 & d <> 0 & b <> -d & a / b = e / d implies a / b = (a + e) / (b + d ); theorem a" = b" implies a = b; theorem 0" = 0; theorem b <> 0 implies a = a*b*b"; theorem a" * b" = (a * b)"; theorem (a * b")" = a" * b; theorem (a" * b")" = a * b; theorem a <> 0 & b <> 0 implies a * b" <> 0; theorem a <> 0 & b <> 0 implies a" * b" <> 0; theorem a * b" = 1 implies a = b; theorem a * b = 1 implies a = b"; theorem a <> 0 & b <> 0 implies a" + b" = (a + b)*(a*b)"; theorem a <> 0 & b <> 0 implies a" - b" = (b - a)*(a*b)"; theorem (a / b)" = b / a; theorem (a"/b") = b/a; theorem 1 / a = a"; theorem 1 / a" = a; theorem (1 / a)" = a; theorem 1 / a = b" implies a = b; theorem a/b" = a*b; theorem a"*(c/b) = c/(a*b); theorem a"/b = (a*b)"; theorem (- a)" = -a"; theorem a <> 0 & a = a" implies a = 1 or a = -1; begin theorem a+b+c-b=a+c; theorem a-b+c+b=a+c; theorem a+b-c-b=a-c; theorem a-b-c+b=a-c; theorem a-a-b=-b; theorem -a+a-b=-b; theorem a-b-a=-b; theorem -a-b+a=-b; begin theorem for a,b st b<>0 ex e st a=b/e; theorem a/(b*c*(d/e))=(e/c)*(a/(b*d)); theorem ((d - c)/b) * a + c = (1 - a/b)*c + (a/b) * d; theorem a <> 0 implies a * b + c = a * (b + (c/a)); begin reserve a,b,c,d for real number; reserve r,s for real number; theorem ex b st a < b; theorem ex b st b < a; theorem ex c st a < c & b < c; theorem ex c st c < a & c < b; theorem a < b implies ex c st a < c & c < b; begin theorem a <= b iff a + c <= b + c; theorem a <= b & c <= d implies a+c <= b+d; theorem a < b & c <= d implies a+c < b+d; begin theorem a <= b iff a-c <= b-c; theorem a <= b iff c-b <= c-a; theorem a <= b-c implies c <= b-a; theorem a-b <= c implies a-c <= b; theorem a <= b & c <= d implies a-d <= b-c; theorem a < b & c <= d implies a-d < b-c; theorem a <= b & c < d implies a-d < b-c; theorem a-b <= c-d implies a-c <= b-d; theorem a-b <= c-d implies d-b <= c-a; theorem a-b <= c-d implies d-c <= b-a; begin theorem a+b <= c iff a <= c-b; theorem a <= b+c iff a-b <= c; theorem a+b<=c+d iff a-c <= d-b; theorem a+b<=c-d implies a+d<=c-b; theorem a-b<=c+d implies a-d<=c+b; begin theorem a<=b iff -b<=-a; theorem a<=-b implies b<=-a; theorem -b<=a implies -a<=b; begin theorem 0 <= a & 0 <= b & a+b = 0 implies a = 0; theorem a <= 0 & b <= 0 & a+b = 0 implies a = 0; begin theorem 0 < a implies b < b+a; theorem a < 0 implies a+b < b; theorem 0 <= a implies b <= a+b; theorem a <= 0 implies a+b <= b; begin theorem 0 <= a & 0 <= b implies 0 <= a+b; theorem 0 <= a & 0 < b implies 0 < a+b; theorem a <= 0 & c <= b implies c+a <= b; theorem a <= 0 & c < b implies c+a < b; theorem a < 0 & c <= b implies c+a < b; theorem 0 <= a & b <= c implies b <= a+c; theorem 0 < a & b <= c implies b < a+c; theorem 0 <= a & b < c implies b < a+c; begin theorem (for a being real number st a>0 holds c <= b+a) implies c <= b; theorem (for a being real number st a<0 holds b+a <= c) implies b <= c; begin theorem 0 <= a implies b-a <= b; theorem 0 < a implies b-a < b; theorem a <= 0 implies b <= b-a; theorem a < 0 implies b < b-a; theorem a <= b implies a-b <= 0; theorem a <= b implies 0 <= b-a; theorem a < b implies a-b < 0; theorem a < b implies 0 < b-a; theorem 0 <= a & b < c implies b-a < c; theorem a <= 0 & b <= c implies b <= c-a; theorem a <= 0 & b < c implies b < c-a; theorem a < 0 & b <= c implies b < c-a; theorem a <> b implies 0 < a-b or 0 < b-a; begin theorem (for a being real number st a<0 holds c <= b-a) implies b>=c; theorem (for a being real number st a>0 holds b-a <= c) implies b<=c; begin theorem a < 0 iff 0 < -a; theorem a <= -b implies a+b <= 0; theorem -a <= b implies 0 <= a+b; theorem a < -b implies a+b < 0; theorem -b < a implies 0 < a+b; begin theorem 0 <= a*a; theorem a <= b & 0 <= c implies a*c <= b*c; theorem a <= b & c <= 0 implies b*c <= a*c; theorem 0 <= a & a <= b & 0 <= c & c <= d implies a*c <= b*d; theorem a <= 0 & b <= a & c <= 0 & d <= c implies a*c <= b*d; theorem 0 < c & a < b implies a*c < b*c; theorem c < 0 & a < b implies b*c < a*c; theorem a < 0 & b <= a & c < 0 & d < c implies a*c < b*d; begin theorem 0 <= a & 0 <= b & 0 <= c & 0 <= d & a*c+b*d = 0 implies a = 0 or c = 0; begin theorem 0 <= c & b <= a implies b/c <= a/c; theorem c <= 0 & a <= b implies b/c <= a/c; theorem 0 < c & a < b implies a/c < b/c; theorem c < 0 & a < b implies b/c < a/c; theorem 0 < c & 0 < a & a < b implies c/b < c/a; begin theorem 0 < b & a*b <= c implies a <= c/b; theorem b < 0 & a*b <= c implies c/b <= a; theorem 0 < b & c <= a*b implies c/b <= a; theorem b < 0 & c <= a*b implies a <= c/b; theorem 0 < b & a*b < c implies a< c/b; theorem b < 0 & a*b < c implies c/b < a; theorem 0 < b & c < a*b implies c/b < a; theorem b < 0 & c < a*b implies a < c/b; begin theorem 0 < a & a <= b implies b" <= a"; theorem b < 0 & a <= b implies b" <= a"; theorem b < 0 & a < b implies b" < a"; theorem 0 < a & a < b implies b" < a"; theorem 0 < b" & b" <= a" implies a <= b; theorem a" < 0 & b" <= a" implies a <= b; theorem 0 < b" & b" < a" implies a < b; theorem a" < 0 & b" < a" implies a < b; begin theorem 0 <= a & (b-a)*(b+a) <= 0 implies -a <= b & b <= a; theorem 0 <= a & (b-a)*(b+a) < 0 implies -a < b & b < a; theorem 0 <= (b-a)*(b+a) implies b <= -a or a <= b; theorem 0 <= a & 0 <= c & a < b & c < d implies a*c < b*d; theorem 0 <= a & 0 < c & a < b & c <= d implies a*c < b*d; theorem 0 < a & 0 < c & a <= b & c < d implies a*c < b*d; theorem 0 < c & b < 0 & a < b implies c/b < c/a; theorem c < 0 & 0 < a & a < b implies c/a < c/b; theorem c < 0 & b < 0 & a < b implies c/a < c/b; theorem 0 < b & 0 < d & a*d <= c*b implies a/b <= c/d; theorem b < 0 & d < 0 & a*d <= c*b implies a/b <= c/d; theorem 0 < b & d < 0 & a*d <= c*b implies c/d <= a/b; theorem b < 0 & 0 < d & a*d <= c*b implies c/d <= a/b; theorem 0 < b & 0 < d & a*d < c*b implies a/b < c/d; theorem b < 0 & d < 0 & a*d < c*b implies a/b < c/d; theorem 0 < b & d < 0 & a*d < c*b implies c/d < a/b; theorem b < 0 & 0 < d & a*d < c*b implies c/d < a/b; theorem b < 0 & d < 0 & a*b < c/d implies a*d < c/b; theorem 0 < b & 0 < d & a*b < c/d implies a*d < c/b; theorem b < 0 & d < 0 & c/d < a*b implies c/b < a*d; theorem 0 < b & 0 < d & c/d < a*b implies c/b < a*d; theorem b < 0 & 0 < d & a*b < c/d implies c/b < a*d; theorem 0 < b & d < 0 & a*b < c/d implies c/b < a*d; theorem b < 0 & 0 < d & c/d < a*b implies a*d < c/b; theorem 0 < b & d < 0 & c/d < a*b implies a*d < c/b; theorem 0 < a & 0 <= c & a <= b implies c/b <= c/a; theorem 0 <= c & b < 0 & a <= b implies c/b <= c/a; theorem c <= 0 & 0 < a & a <= b implies c/a <= c/b; theorem c <= 0 & b < 0 & a <= b implies c/a <= c/b; theorem 0 < a iff 0 < a"; theorem a < 0 iff a" < 0; theorem a < 0 & 0 < b implies a" < b"; theorem a" < 0 & 0 < b" implies a < b; begin theorem a <= 0 & 0 <= a implies 0 = a*b; theorem 0 <= a & 0 <= b implies 0 <= a*b; theorem a <= 0 & b <= 0 implies 0 <= a*b; theorem 0 < a & 0 < b implies 0 < a*b; theorem a < 0 & b < 0 implies 0 < a*b; theorem 0 <= a & b <= 0 implies a*b <= 0; theorem 0 < a & b < 0 implies a*b < 0; theorem a*b<0 implies a>0 & b<0 or a<0 & b>0; theorem a*b>0 implies a>0 & b>0 or a<0 & b<0; theorem a <= 0 & b <= 0 implies 0 <= a/b; theorem 0 <= a & 0 <= b implies 0 <= a/b; theorem 0 <= a & b <= 0 implies a/b <= 0; theorem a <= 0 & 0 <= b implies a/b <= 0; theorem 0 < a & 0 < b implies 0 < a/b; theorem a < 0 & b < 0 implies 0 < a/b; theorem a < 0 & 0 < b implies a/b < 0; theorem a < 0 & 0 < b implies b/a < 0; theorem a/b<0 implies b<0 & a>0 or b>0 & a<0; theorem a/b>0 implies b>0 & a>0 or b<0 & a<0; begin theorem a <= b implies a < b+1; theorem a - 1 < a; theorem a <= b implies a-1 < b; theorem -1 < a implies 0 < 1+a; theorem a<1 implies 1-a>0; begin theorem a <= 1 & 0 <= b & b <= 1 & a*b = 1 implies a=1; theorem 0 <= a & 1 <= b implies a <= a*b; theorem a <= 0 & b <= 1 implies a <= a*b; theorem 0 <= a & b <= 1 implies a*b <= a; theorem a <= 0 & 1 <= b implies a*b <= a; theorem 0 < a & 1 < b implies a < a*b; theorem a < 0 & b < 1 implies a < a*b; theorem 0 < a & b < 1 implies a*b < a; theorem a < 0 & 1 < b implies a*b < a; theorem 1 <= a & 1 <= b implies 1 <= a*b; theorem 0 <= a & a <= 1 & b <= 1 implies a*b <= 1; theorem 1 < a & 1 <= b implies 1 < a*b; theorem 0 <= a & a < 1 & b <= 1 implies a*b < 1; theorem a <= -1 & b <= -1 implies 1 <= a*b; theorem a < -1 & b <= -1 implies 1 < a*b; theorem a <= 0 & -1 <= a & -1 <= b implies a*b <= 1; theorem a <= 0 & -1 < a & -1 <= b implies a*b < 1; begin theorem (for a st 1 < a holds c <= b*a) implies c <= b; theorem (for a st 0 < a & a < 1 holds b*a <= c) implies b <= c; theorem (for a st 0 < a & a < 1 holds b <= a*c) implies b <= 0; theorem 0 <= d & d <= 1 & 0 <= a & 0 <= b & d*a+(1-d)*b=0 implies d=0 & b=0 or d=1 & a=0 or a=0 & b=0; theorem 0 <= d & a <= b implies a <= (1-d)*a+d*b; theorem d <= 1 & a <= b implies (1-d)*a+d*b <= b; theorem 0 <= d & d <= 1 & a <= b & a <= c implies a <= (1-d)*b+d*c; theorem 0 <= d & d <= 1 & b <= a & c <= a implies (1-d)*b+d*c <= a; theorem 0 <= d & d <= 1 & a < b & a < c implies a < (1-d)*b+d*c; theorem 0 <= d & d <= 1 & b < a & c < a implies (1-d)*b+d*c < a; theorem 0 < d & d < 1 & a <= b & a < c implies a < (1-d)*b+d*c; theorem 0 < d & d < 1 & b < a & c <= a implies (1-d)*b+d*c < a; theorem 0 <= d & d <= 1 & a <= (1-d)*a+d*b & b < (1-d)*a+d*b implies d = 0; theorem 0 <= d & d <= 1 & (1-d)*a+d*b <= a & (1-d)*a+d*b < b implies d = 0; begin theorem 0 < a & a <= b implies 1 <= b/a; theorem a < 0 & b <= a implies 1 <= b/a; theorem 0 <= a & a <= b implies a/b <= 1; theorem b <= a & a <= 0 implies a/b <= 1; theorem 0 <= a & b <= a implies b/a <= 1; theorem a <= 0 & a <= b implies b/a <= 1; theorem 0 < a & a < b implies 1 < b/a; theorem a < 0 & b < a implies 1 < b/a; theorem 0 <= a & a < b implies a/b < 1; theorem a <= 0 & b < a implies a/b < 1; theorem 0 < a & b < a implies b/a < 1; theorem a < 0 & a < b implies b/a < 1; begin theorem 0 <= b & -b <= a implies -1 <= a/b; theorem 0 <= b & -a <= b implies -1 <= a/b; theorem b <= 0 & a <= -b implies -1 <= a/b; theorem b <= 0 & b <= -a implies -1 <= a/b; theorem 0 < b & -b < a implies -1 < a/b; theorem 0 < b & -a < b implies -1 < a/b; theorem b < 0 & a < -b implies -1 < a/b; theorem b < 0 & b < -a implies -1 < a/b; theorem 0 < b & a <= -b implies a/b <= -1; theorem 0 < b & b <= -a implies a/b <= -1; theorem b < 0 & -b <= a implies a/b <= -1; theorem b < 0 & -a <= b implies a/b <= -1; theorem 0 < b & a < -b implies a/b < -1; theorem 0 < b & b < -a implies a/b < -1; theorem b < 0 & -b < a implies a/b < -1; theorem b < 0 & -a < b implies a/b < -1; begin theorem (for a being real number st 0 < a & a < 1 holds c <= b/a) implies c <= b; theorem (for a being real number st 1 < a holds b/a <= c) implies b <= c; theorem 1 <= a implies a" <= 1; theorem 1 < a implies a" < 1; theorem a <= -1 implies -1 <= a"; theorem a < -1 implies -1 < a"; begin theorem 0 < a implies 0 < a/2; theorem 0 < a implies a/2 < a; theorem a <= 1/2 implies 2 * a - 1 <= 0; theorem a <= 1/2 implies 0 <= 1 - 2 * a; theorem a >= 1/2 implies 2 * a - 1 >= 0; theorem a >= 1/2 implies 0 >= 1 - 2 * a; begin theorem 0 < a implies a/3 < a; theorem 0 < a implies 0 < a/3; begin theorem 0 < a implies a/4 < a; theorem 0 < a implies 0 < a/4; theorem for a,b st b<>0 ex c st a=b/c; begin theorem r ext-real for Element of REAL; end; reserve p,q,r,s,t for ext-real number; theorem r < t implies ex s st r < s & s < t; theorem r < s & (for q st r < q & q < s holds t <= q) implies t <= r; theorem r < s & (for q st r < q & q < s holds q <= t) implies s <= t; theorem 0 <= a & b <= c implies b-a <= c; theorem 0 < a & b <= c implies b-a < c; begin theorem a -' a = 0; theorem b <= a implies a -' b = a - b; theorem c <= a & c <= b & a -' c = b -' c implies a = b; theorem a >= b implies a -' b + b = a; theorem a <= b & c < a implies b -' a < b -' c; theorem 1 <= a implies a -' 1 < a; begin reserve r,s for real number; reserve x,y,z for real number, k for Nat, i for Element of NAT; reserve r,r1,r2 for Element of REAL+; theorem for X,Y being Subset of REAL st for x,y st x in X & y in Y holds x <= y ex z st for x,y st x in X & y in Y holds x <= z & z <= y; theorem x in NAT & y in NAT implies x + y in NAT; theorem for A being Subset of REAL st 0 in A & for x st x in A holds x + 1 in A holds NAT c= A; theorem k = { i: i < k }; begin registration cluster -> real for Element of REAL; end; definition mode Real is Element of REAL; end; registration cluster positive for Real; end; definition let x be Real; redefine func -x -> Real; redefine func x" -> Real; end; definition let x be real number, y be Real; redefine func x+y -> Real; redefine func x*y -> Real; redefine func x-y -> Real; redefine func x/y -> Real; end; definition let x be Real, y be real number; redefine func x+y -> Real; redefine func x*y -> Real; redefine func x-y -> Real; redefine func x/y -> Real; end; reserve s,t for Element of RAT+; theorem REAL+ = { r where r is Real: 0 <= r}; begin reserve a,b,c,x,y,z for real number; scheme RealContinuity { P[set], Q[set] } : ex z st for x,y st P[x] & Q[y] holds x <= z & z <= y provided for x,y st P[x] & Q[y] holds x <= y; definition let x,y be Element of REAL; redefine func min(x,y) -> Element of REAL; redefine func max(x,y) -> Element of REAL; end; theorem min(x,y) + max(x,y) = x + y; theorem for x,y being real number st 0 <= x & 0 <= y holds max(x,y) <= x + y; definition let x be complex number; func x^2 equals x * x; end; registration let x be complex number; cluster x^2 -> complex; end; registration let x; cluster x^2 -> real; end; definition let x be Element of COMPLEX; redefine func x^2 -> Element of COMPLEX; end; definition let x be Element of REAL; redefine func x^2 -> Element of REAL; end; theorem for a being complex number holds a^2 = (-a)^2; theorem for a, b being complex number holds (a + b)^2 = a^2 + 2*a*b + b^2; theorem for a, b being complex number holds (a - b)^2 = a^2 - 2*a*b + b^2; theorem for a being complex number holds (a + 1)^2 = a^2 + 2*a + 1; theorem for a being complex number holds (a - 1)^2 = a^2 - 2*a + 1; theorem for a, b being complex number holds (a - b)*(a + b) = a^2 - b^2; theorem for a, b being complex number holds (a*b)^2 = a^2*b^2; theorem for a, b being complex number st a^2 - b^2 <> 0 holds 1/(a+b) = (a-b)/(a^2-b^2); theorem for a, b being complex number st a^2-b^2 <> 0 holds 1/(a-b) = (a+b)/(a^2-b^2) ; theorem 0 <> a implies 0 < a^2; theorem 0 < a & a < 1 implies a^2 < a; theorem 1 < a implies a < a^2; theorem 0 <= x & x <= y implies x^2 <= y^2; theorem 0 <= x & x < y implies x^2 < y^2; definition let a; assume 0 <= a; func sqrt a -> real number means 0 <= it & it^2 = a; end; definition let a be Element of REAL; redefine func sqrt a -> Element of REAL; end; theorem sqrt 0 = 0; theorem sqrt 1 = 1; theorem 1 < sqrt 2; theorem sqrt 4 = 2; theorem sqrt 2 < 2; theorem 0 <= a implies sqrt a^2 = a; theorem a <= 0 implies sqrt a^2 = -a; theorem 0 <= a & sqrt a = 0 implies a = 0; theorem 0 < a implies 0 < sqrt a; theorem 0 <= x & x <= y implies sqrt x <= sqrt y; theorem 0 <= x & x < y implies sqrt x < sqrt y; theorem 0 <= x & 0 <= y & sqrt x = sqrt y implies x = y; theorem 0 <= a & 0 <= b implies sqrt (a*b) = sqrt a * sqrt b; theorem 0 <= a & 0 <= b implies sqrt (a/b) = sqrt a/sqrt b; theorem for a,b being real number st 0 <= a & 0 <= b holds sqrt(a + b) = 0 iff a = 0 & b = 0; theorem 0 < a implies sqrt (1/a) = 1/sqrt a; theorem 0 < a implies sqrt a/a = 1/sqrt a; theorem 0 < a implies a / sqrt a = sqrt a; theorem 0 <= a & 0 <= b implies (sqrt a - sqrt b)*(sqrt a + sqrt b) = a - b; theorem 0 <= a & 0 <= b & a <>b implies 1/(sqrt a+sqrt b) = (sqrt a - sqrt b)/ (a-b); theorem 0 <= b & b < a implies 1/(sqrt a+sqrt b) = (sqrt a - sqrt b)/(a-b); theorem 0 <= a & 0 <= b implies 1/(sqrt a-sqrt b) = (sqrt a + sqrt b)/(a-b); theorem 0 <= b & b < a implies 1/(sqrt a-sqrt b) = (sqrt a + sqrt b)/(a-b); theorem for x,y being complex number st x^2=y^2 holds x=y or x=-y; theorem for x being complex number st x^2=1 holds x=1 or x=-1; theorem 0<=x & x<=1 implies x^2<=x; theorem x^2-1<=0 implies -1<=x & x<=1; begin theorem a <= 0 & x < a implies x^2 > a^2; theorem -1 >= a implies -a <= a^2; theorem -1 > a implies -a < a^2; theorem b^2 <= a^2 & a >= 0 implies -a <= b & b <= a; theorem b^2 < a^2 & a >= 0 implies -a < b & b < a; theorem -a <= b & b <= a implies b^2 <= a^2; theorem -a < b & b < a implies b^2 < a^2; theorem a^2 <= 1 implies -1 <= a & a <= 1; theorem a^2 < 1 implies -1 < a & a < 1; theorem -1 <= a & a <= 1 & -1 <= b & b <= 1 implies a^2*b^2 <= 1; theorem a >= 0 & b >= 0 implies a*sqrt(b) = sqrt(a^2*b); theorem -1 <= a & a <= 1 & -1 <= b & b <= 1 implies (-b)*sqrt(1+a^2) <= sqrt(1+b^2) & -sqrt(1+b^2) <= b*sqrt(1+a^2); theorem -1 <= a & a <= 1 & -1 <= b & b <= 1 implies b*sqrt(1+a^2) <= sqrt(1+b^2); theorem a >= b implies a*sqrt(1+b^2) >= b*sqrt(1+a^2); theorem a >= 0 implies sqrt(a+b^2) >= b; theorem 0 <= a & 0 <= b implies sqrt(a+b) <= sqrt a + sqrt b; begin reserve x for Real, p,k,l,m,n,s,h,i,j,k1,t,t1 for Nat, X for Subset of REAL; theorem for X st 0 in X & for x st x in X holds x + 1 in X for n holds n in X; registration let n,k be Nat; cluster n + k -> natural; end; definition let n be Nat, k be Element of NAT; redefine func n + k -> Element of NAT; end; definition let n be Element of NAT, k be Nat; redefine func n + k -> Element of NAT; end; scheme Ind { P[Nat] } : for k being Element of NAT holds P[k] provided P[0] and for k being Element of NAT st P[k] holds P[k + 1]; scheme NatInd { P[Nat] } : for k being Nat holds P[k] provided P[0] and for k be Nat st P[k] holds P[k + 1]; registration let n,k be Nat; cluster n * k -> natural; end; definition let n be Nat, k be Element of NAT; redefine func n * k -> Element of NAT; end; definition let n be Element of NAT, k be Nat; redefine func n * k -> Element of NAT; end; theorem 0 <= i; theorem 0 <> i implies 0 < i; theorem i <= j implies i * h <= j * h; theorem 0 < i + 1; theorem i = 0 or ex k st i = k + 1; theorem i + j = 0 implies i = 0 & j = 0; registration cluster non zero for Nat; end; registration let m be Nat, n be non zero Nat; cluster m + n -> non zero; cluster n + m -> non zero; end; scheme DefbyInd { N()->Nat, F(Nat,Nat)->Nat, P[Nat,Nat] } : (for k being Nat ex n being Nat st P[k,n]) & for k,n,m being Nat st P[k,n] & P[k,m] holds n = m provided for k,n being Nat holds P[k,n] iff k = 0 & n = N() or ex m,l being Nat st k = m + 1 & P[m,l] & n = F(k,l); theorem i <= j + 1 implies i <= j or i = j + 1; theorem i <= j & j <= i + 1 implies i = j or j = i + 1; theorem i <= j implies ex k st j = i + k; theorem i <= i + j; scheme CompInd { P[Nat] } : for k being Nat holds P[k] provided for k being Nat st for n being Nat st n < k holds P[n] holds P[k]; scheme Min { P[Nat] } : ex k being Nat st P[k] & for n being Nat st P[n] holds k <= n provided ex k being Nat st P[k]; scheme Max { P[Nat], N()->Nat } : ex k being Nat st P[k] & for n being Nat st P[n] holds n <= k provided for k being Nat st P[k] holds k <= N() and ex k being Nat st P[k]; theorem i <= j implies i <= j + h; theorem i < j + 1 iff i <= j; theorem j < 1 implies j = 0; theorem i * j = 1 implies i = 1; theorem k <> 0 implies n < n + k; scheme Regr { P[Nat] } : P[0] provided ex k being Nat st P[k] and for k being Nat st k <> 0 & P[k] ex n being Nat st n < k & P[n]; theorem 0 < m implies for n ex k,t st n = (m*k)+t & t < m; theorem n = m*k+t & t < m & n = m*k1+t1 & t1 < m implies k = k1 & t = t1; registration cluster -> ordinal for Nat; end; registration cluster non empty ordinal for Subset of REAL; end; theorem k < k + n iff 1 <= n; theorem k < n implies n - 1 is Element of NAT; theorem k <= n implies n - k is Element of NAT; begin theorem m < n+1 implies m < n or m = n; theorem k < 2 implies k = 0 or k = 1; registration cluster non zero for Element of NAT; end; registration cluster -> non negative for Element of NAT; end; registration cluster -> non negative for Nat; end; theorem i <> 0 & h = j*i implies j <= h; scheme Ind1{M() -> Nat, P[Nat]} : for i being Nat st M() <= i holds P[i] provided P[M()] and for j being Nat st M() <= j holds P[j] implies P[j+1]; scheme CompInd1 { a() -> Nat, P[Nat] } : for k being Nat st k >= a() holds P[k] provided for k being Nat st k>=a() & (for n being Nat st n>=a() & n Element of NAT means it in A & for k st k in A holds it <= k if A is non empty Subset of NAT otherwise it = 0; end; reserve x,X,Y,Z for set; theorem for n being Nat holds succ n = n + 1; theorem n <= m iff n c= m; theorem card n c= card m iff n <= m; theorem card n in card m iff n < m; reserve M,N for Cardinal; theorem nextcard card n = card(n+1); definition let n be Nat; redefine func succ n equals n+1; end; theorem for X,Y being finite set holds X c= Y implies card X <= card Y; reserve l for Element of NAT; theorem k in n iff k < n; theorem n in n+1; theorem k <= n implies k = k /\ n; scheme LambdaRecEx{A() -> set,G(set,set) -> set}: ex f being Function st dom f = NAT & f.0 = A() & for n being Nat holds f.(n+1) = G(n,f.n); scheme LambdaRecExD{D() -> non empty set, A() -> Element of D(), G(set,set) -> Element of D()}: ex f being Function of NAT,D() st f.0 = A() & for n being Nat holds f.(n+1) = G(n,f.n); scheme RecUn{A() -> set, F, G() -> Function, P[set,set,set]}: F() = G() provided dom F() = NAT and F().0 = A() and for n holds P[n,F().n,F().(n+1)] and dom G() = NAT and G().0 = A() and for n holds P[n,G().n,G().(n+1)] and for n for x,y1,y2 being set st P[n,x,y1] & P[n,x,y2] holds y1 = y2; scheme RecUnD{D() -> non empty set,A() -> Element of D(), P[set,set,set], F, G() -> Function of NAT,D()} : F() = G() provided F().0 = A() and for n holds P[n,F().n,F().(n+1)] and G().0 = A() and for n holds P[n,G().n,G().(n+1)] and for n being Nat,x,y1,y2 being Element of D() st P[n,x,y1] & P[n,x,y2 ] holds y1=y2; scheme LambdaRecUn{A() -> set, RecFun(set,set) -> set, F, G() -> Function}: F() = G () provided dom F() = NAT and F().0 = A() and for n holds F().(n+1) = RecFun(n,F().n) and dom G() = NAT and G().0 = A() and for n holds G().(n+1) = RecFun(n,G().n); scheme LambdaRecUnD{D() -> non empty set,A() -> Element of D(), RecFun(set,set) -> Element of D(), F, G() -> Function of NAT,D()}: F() = G() provided F().0 = A() and for n holds F().(n+1) = RecFun(n,F().n) and G().0 = A() and for n holds G().(n+1) = RecFun(n,G().n); registration let x,y be Nat; cluster min(x,y) -> natural; cluster max(x,y) -> natural; end; definition let x,y be Element of NAT; redefine func min(x,y) -> Element of NAT; redefine func max(x,y) -> Element of NAT; end; scheme MinIndex { F(Nat)->Nat} : ex k st F(k)=0 & for n st F(n)=0 holds k <= n provided for k holds (F(k+1) < F(k) or F(k) = 0); definition let D be set, f be Function of NAT,D; let n be Nat; redefine func f.n -> Element of D; end; definition let X be set; mode sequence of X is Function of NAT, X; end; definition let s be ManySortedSet of NAT, k be Nat; func s ^\ k -> ManySortedSet of NAT means for n being Nat holds it.n=s.(n+k); end; registration let X be non empty set, s be X-valued ManySortedSet of NAT, k be Nat; cluster s ^\ k -> X-valued; end; definition let X be non empty set, s be sequence of X, k be Nat; redefine func s ^\ k -> sequence of X; end; reserve X for non empty set, s for sequence of X, k,m for Nat; theorem s^\0 =s; theorem s ^\k^\m = s^\(k+m); theorem s^\k^\m = s^\m^\k; registration let N be sequence of NAT; let X,s; cluster s * N -> Function-like NAT-defined X-valued; end; registration let N be sequence of NAT; let X,s; cluster s * N -> total; end; theorem for N being sequence of NAT holds (s * N) ^\k = s * (N ^\k); theorem s.n in rng s; theorem (for n holds s.n in Y) implies rng s c= Y; theorem for n being Nat holds n is non zero implies n = 1 or n > 1; theorem succ n = {l : l <= n}; scheme MinPred { F(Element of NAT) -> Element of NAT, P[set]} : ex k be Element of NAT st P[k] & for n be Element of NAT st P[n] holds k <= n provided for k be Element of NAT holds F(k+1) < F(k) or P[k]; registration let k be Ordinal, x be set; cluster k --> x -> T-Sequence-like; end; theorem for s be ManySortedSet of NAT, k be Nat holds rng(s ^\ k) c= rng s; theorem for n,m st n<=m & m<=n+2 holds m=n or m=n+1 or m=n+2; theorem for n,m st n<=m & m<=n+3 holds m=n or m=n+1 or m=n+2 or m=n+3; theorem for n,m st n<=m & m<=n+4 holds m=n or m=n+1 or m=n+2 or m=n+3 or m=n+4; theorem for X being finite set st 1 < card X holds ex x1,x2 being set st x1 in X & x2 in X & x1 <> x2; theorem n <= 14 implies n = 0 or n = 1 or n = 2 or n = 3 or n = 4 or n = 5 or n = 6 or n = 7 or n = 8 or n = 9 or n = 10 or n = 11 or n = 12 or n = 13 or n = 14; begin reserve X,x,y,z for set, k,l,n for Element of NAT, r for real number; definition redefine func INT means x in it iff ex k st x = k or x = - k; end; definition let i be number; attr i is integer means i in INT; end; registration cluster integer for Real; cluster integer for number; cluster -> integer for Element of INT; end; definition mode Integer is integer number; end; theorem for k being Nat st r = k or r = -k holds r is Integer; theorem r is Integer implies ex k st r = k or r = - k; registration cluster natural -> integer for number; end; registration cluster integer -> real for number; end; reserve i,i0,i1,i2,i3,i4,i5,i8,i9,j for Integer; registration let i1,i2 be Integer; cluster i1 + i2 -> integer; cluster i1 * i2 -> integer; end; registration let i0 be Integer; cluster - i0 -> integer; end; registration let i1,i2 be Integer; cluster i1 - i2 -> integer; end; theorem 0 <= i0 implies i0 in NAT; theorem r is Integer implies r + 1 is Integer & r - 1 is Integer; theorem i2 <= i1 implies i1 - i2 in NAT; theorem i1 + k = i2 implies i1 <= i2; theorem i0 < i1 implies i0 + 1 <= i1; theorem i1 < 0 implies i1 <= - 1; theorem i1 * i2 = 1 iff i1 = 1 & i2 = 1 or i1 = - 1 & i2 = - 1; theorem i1 * i2 = - 1 iff i1 = - 1 & i2 = 1 or i1 = 1 & i2 = - 1; scheme SepInt { P[Integer] } : ex X being Subset of INT st for x being Integer holds x in X iff P[x]; scheme IntIndUp { F() -> Integer, P[Integer] } : for i0 st F() <= i0 holds P[i0] provided P[F()] and for i2 st F() <= i2 holds P[i2] implies P[i2 + 1]; scheme IntIndDown { F() -> Integer, P[Integer] } : for i0 st i0 <= F() holds P[i0] provided P[F()] and for i2 st i2 <= F() holds P[i2] implies P[i2 - 1]; scheme IntIndFull { F() -> Integer, P[Integer] } : for i0 holds P[i0] provided P[F()] and for i2 holds P[i2] implies P[i2 - 1] & P[i2 + 1]; scheme IntMin { F() -> Integer, P[Integer] } : ex i0 st P[i0] & for i1 st P[i1] holds i0 <= i1 provided for i1 st P[i1] holds F() <= i1 and ex i1 st P[i1]; scheme IntMax { F() -> Integer, P[Integer] } : ex i0 st P[i0] & for i1 st P[i1] holds i1 <= i0 provided for i1 st P[i1] holds i1 <= F() and ex i1 st P[i1]; definition let i1,i2 be Integer; pred i1 divides i2 means ex i3 st i2 = i1 * i3; reflexivity; end; definition let i1,i2,i3 be Integer; pred i1,i2 are_congruent_mod i3 means i3 divides i1 - i2; end; definition let i1,i2,i3 be Integer; redefine pred i1,i2 are_congruent_mod i3 means ex i4 st i3 * i4 = i1 - i2; end; theorem i1,i1 are_congruent_mod i2; theorem i1,0 are_congruent_mod i1 & 0,i1 are_congruent_mod i1; theorem i1,i2 are_congruent_mod 1; theorem i1,i2 are_congruent_mod i3 implies i2,i1 are_congruent_mod i3; theorem i1,i2 are_congruent_mod i5 & i2,i3 are_congruent_mod i5 implies i1,i3 are_congruent_mod i5; theorem i1,i2 are_congruent_mod i5 & i3,i4 are_congruent_mod i5 implies (i1 + i3),(i2 + i4) are_congruent_mod i5; theorem i1,i2 are_congruent_mod i5 & i3,i4 are_congruent_mod i5 implies (i1 - i3),(i2 - i4) are_congruent_mod i5; theorem i1,i2 are_congruent_mod i5 & i3,i4 are_congruent_mod i5 implies (i1 * i3),(i2 * i4) are_congruent_mod i5; theorem (i1 + i2),i3 are_congruent_mod i5 iff i1, (i3 - i2) are_congruent_mod i5; theorem i4 * i5 = i3 implies (i1,i2 are_congruent_mod i3 implies i1,i2 are_congruent_mod i4); theorem i1,i2 are_congruent_mod i5 iff (i1 + i5),i2 are_congruent_mod i5; theorem i1,i2 are_congruent_mod i5 iff (i1 - i5),i2 are_congruent_mod i5; theorem i1 <= r & r - 1 < i1 & i2 <= r & r - 1 < i2 implies i1 = i2; theorem r <= i1 & i1 < r + 1 & r <= i2 & i2 < r + 1 implies i1 = i2; reserve r1,p,p1,g,g1,g2 for real number, Y for Subset of REAL; definition let r be real number; func [\ r /] -> Integer means it <= r & r - 1 < it; projectivity; end; theorem [\ r /] = r iff r is integer; theorem [\ r /] < r iff r is not integer; theorem [\ r /] - 1 < r & [\ r /] < r + 1; theorem [\ r /] + i0 = [\ r + i0 /]; theorem r < [\ r /] + 1; definition let r be real number; func [/ r \] -> Integer means r <= it & it < r + 1; projectivity; end; theorem [/ r \] = r iff r is integer; theorem r < [/ r \] iff r is not integer; theorem r - 1 < [/ r \] & r < [/ r \] + 1; theorem [/ r \] + i0 = [/ r + i0 \]; theorem [\ r /] = [/ r \] iff r is integer; theorem [\ r /] < [/ r \] iff r is not integer; theorem [\ r /] <= [/ r \]; theorem [\ ([/ r \]) /] = [/ r \]; canceled 2; theorem [/ ([\ r /]) \] = [\ r /]; theorem [\ r /] = [/ r \] iff not [\ r /] + 1 = [/ r \]; definition let r be real number; func frac r equals r - [\ r /]; end; registration let r be real number; cluster frac r -> real; end; definition let r be real number; redefine func frac r -> Real; end; theorem r = [\ r /] + frac r; theorem frac r < 1 & 0 <= frac r; theorem [\ frac r /] = 0; theorem frac r = 0 iff r is integer; theorem 0 < frac r iff r is not integer; definition let i1,i2 be Integer; func i1 div i2 -> Integer equals [\ i1 / i2 /]; end; definition let i1,i2 be Integer; func i1 mod i2 -> Integer equals i1 - (i1 div i2) * i2 if i2 <> 0 otherwise 0; end; theorem for r being real number st r <> 0 holds [\ r / r /] = 1; theorem for i being Integer holds i div 0 = 0; theorem for i being Integer st i <> 0 holds i div i = 1; theorem for i being Integer holds i mod i = 0; begin theorem for k, i being Integer holds k < i implies ex j being Element of NAT st j = i-k & 1 <= j; theorem for a,b being Integer st a < b holds a <= b - 1; theorem for r being real number st r>=0 holds [/ r \]>=0 & [\ r /]>=0 & [/ r \] is Element of NAT & [\ r /] is Element of NAT; theorem for i being Integer, r being real number st i <= r holds i <= [\ r /]; theorem for m,n being Nat holds 0 <= m qua Integer div n; theorem 0 < i & 1 < j implies i div j < i; theorem i2 >= 0 implies i1 mod i2 >= 0; theorem i2 > 0 implies i1 mod i2 < i2; theorem i2 <> 0 implies i1 = (i1 div i2) * i2 + (i1 mod i2); theorem for m,j being Integer holds m*j, 0 are_congruent_mod m; theorem i >= 0 & j >= 0 implies i div j >= 0; theorem for n being Nat st n > 0 for a being Integer holds a mod n = 0 iff n divides a; reserve r, s for real number; theorem r/s is not Integer implies - [\ r/s /] = [\ (-r) / s /] + 1; theorem r/s is Integer implies - [\ r/s /] = [\ (-r) / s /]; theorem r <= i implies [/ r \] <= i; scheme FinInd{M, N() -> Element of NAT, P[Nat]} : for i being Element of NAT st M() <= i & i <= N() holds P[i] provided P[M()] and for j being Element of NAT st M() <= j & j < N() holds P[j] implies P[j+1]; scheme FinInd2{M,N() -> Element of NAT, P[Nat]} : for i being Element of NAT st M() <= i & i <= N() holds P[i] provided P[M()] and for j being Element of NAT st M() <= j & j < N() holds (for j9 being Element of NAT st M() <= j9 & j9 <= j holds P[j9]) implies P[j+1]; reserve i for Integer, a, b, r, s for real number; theorem frac(r+i) = frac r; theorem r <= a & a < [\r/]+1 implies [\a/] = [\r/]; theorem r <= a & a < [\r/]+1 implies frac r <= frac a; theorem r < a & a < [\r/]+1 implies frac r < frac a; theorem a >= [\r/]+1 & a <= r+1 implies [\a/] = [\r/]+1; theorem a >= [\r/]+1 & a < r+1 implies frac a < frac r; theorem r <= a & a < r+1 & r <= b & b < r+1 & frac a = frac b implies a = b; begin reserve x for set, a,b for real number, k,k1,l,l1 for Element of NAT, m,m1,n, n1 for Integer; reserve i1,j1 for Element of NAT; definition redefine func RAT means x in it iff ex m,n st x = m/n; end; definition let r be number; attr r is rational means r in RAT; end; registration cluster rational for Real; end; registration cluster rational for number; end; definition mode Rational is rational number; end; theorem x in RAT implies ex m,n st n<>0 & x = m/n; theorem x is Rational implies ex m,n st n<>0 & x = m/n; registration cluster rational -> real for number; end; theorem m/n is rational; registration cluster integer -> rational for number; end; reserve p,q for Rational; registration let p,q; cluster p*q -> rational; cluster p+q -> rational; cluster p-q -> rational; cluster p/q -> rational; end; registration let p; cluster -p -> rational; cluster p" -> rational; end; canceled 3; theorem a0 & p=m/k; theorem ex m,k st k<>0 & p=m/k & for n,l st l<>0 & p=n/l holds k<=l; definition let p; func denominator(p) -> Element of NAT means it<>0 & (ex m st p=m/it) & for n,k st k<>0 & p=n/k holds it<=k; end; definition let p; func numerator(p) -> Integer equals denominator(p)*p; end; theorem 0=denominator(p)"; theorem numerator(p)=0 iff p=0; theorem p=numerator(p)/denominator(p) & p=numerator(p)*denominator(p)" & p=denominator(p)"*numerator(p); theorem p<>0 implies denominator(p)=numerator(p)/p; theorem p is Integer implies denominator(p)=1 & numerator(p)=p; theorem (numerator(p)=p or denominator(p)=1) implies p is Integer; theorem numerator(p)=p iff denominator(p)=1; theorem (numerator(p)=p or denominator(p)=1) & 0<=p implies p is Element of NAT; theorem 1denominator(p)" iff p is not integer; theorem numerator(p)=denominator(p) iff p=1; theorem numerator(p)=-denominator(p) iff p=-1; theorem -numerator(p)=denominator(p) iff p=-1; theorem m<>0 implies p=(numerator(p)*m)/(denominator(p)*m); theorem k<>0 & p=m/k implies ex l st m=numerator(p)*l & k=denominator(p) *l; theorem p=m/n & n<>0 implies ex m1 st m=numerator(p)*m1 & n=denominator(p)*m1; theorem not ex l st 10 & not ex l st 1 integer-membered for set; cluster integer-membered -> rational-membered for set; cluster rational-membered -> real-membered for set; cluster real-membered -> ext-real-membered for set; cluster real-membered -> complex-membered for set; end; registration cluster non empty natural-membered for set; end; registration cluster -> complex-membered for Subset of COMPLEX; cluster -> ext-real-membered for Subset of ExtREAL; cluster -> real-membered for Subset of REAL; cluster -> rational-membered for Subset of RAT; cluster -> integer-membered for Subset of INT; cluster -> natural-membered for Subset of NAT; end; registration cluster COMPLEX -> complex-membered; cluster ExtREAL -> ext-real-membered; cluster REAL -> real-membered; cluster RAT -> rational-membered; cluster INT -> integer-membered; cluster NAT -> natural-membered; end; theorem X is complex-membered implies X c= COMPLEX; theorem X is ext-real-membered implies X c= ExtREAL; theorem X is real-membered implies X c= REAL; theorem X is rational-membered implies X c= RAT; theorem X is integer-membered implies X c= INT; theorem X is natural-membered implies X c= NAT; registration let X be complex-membered set; cluster -> complex for Element of X; end; registration let X be ext-real-membered set; cluster -> ext-real for Element of X; end; registration let X be real-membered set; cluster -> real for Element of X; end; registration let X be rational-membered set; cluster -> rational for Element of X; end; registration let X be integer-membered set; cluster -> integer for Element of X; end; registration let X be natural-membered set; cluster -> natural for Element of X; end; reserve c, c1, c2, c3 for complex number, e, e1, e2, e3 for ext-real number, r , r1, r2, r3 for real number, w, w1, w2, w3 for rational number, i, i1, i2, i3 for integer number, n, n1, n2, n3 for Nat; theorem for X being non empty complex-membered set ex c st c in X; theorem for X being non empty ext-real-membered set ex e st e in X; theorem for X being non empty real-membered set ex r st r in X; theorem for X being non empty rational-membered set ex w st w in X; theorem for X being non empty integer-membered set ex i st i in X; theorem for X being non empty natural-membered set ex n st n in X; theorem for X being complex-membered set st for c holds c in X holds X = COMPLEX; theorem for X being ext-real-membered set st for e holds e in X holds X = ExtREAL; theorem for X being real-membered set st for r holds r in X holds X = REAL; theorem for X being rational-membered set st for w holds w in X holds X = RAT; theorem for X being integer-membered set st for i holds i in X holds X = INT; theorem for X being natural-membered set st for n holds n in X holds X = NAT; theorem for Y being complex-membered set st X c= Y holds X is complex-membered; theorem for Y being ext-real-membered set st X c= Y holds X is ext-real-membered; theorem for Y being real-membered set st X c= Y holds X is real-membered; theorem for Y being rational-membered set st X c= Y holds X is rational-membered; theorem for Y being integer-membered set st X c= Y holds X is integer-membered; theorem for Y being natural-membered set st X c= Y holds X is natural-membered; registration cluster empty -> natural-membered for set; end; registration let c; cluster {c} -> complex-membered; end; registration let e; cluster {e} -> ext-real-membered; end; registration let r; cluster {r} -> real-membered; end; registration let w; cluster {w} -> rational-membered; end; registration let i; cluster {i} -> integer-membered; end; registration let n; cluster {n} -> natural-membered; end; registration let c1,c2; cluster {c1,c2} -> complex-membered; end; registration let e1,e2; cluster {e1,e2} -> ext-real-membered; end; registration let r1,r2; cluster {r1,r2} -> real-membered; end; registration let w1,w2; cluster {w1,w2} -> rational-membered; end; registration let i1,i2; cluster {i1,i2} -> integer-membered; end; registration let n1,n2; cluster {n1,n2} -> natural-membered; end; registration let c1,c2,c3; cluster {c1,c2,c3} -> complex-membered; end; registration let e1,e2,e3; cluster {e1,e2,e3} -> ext-real-membered; end; registration let r1,r2,r3; cluster {r1,r2,r3} -> real-membered; end; registration let w1,w2,w3; cluster {w1,w2,w3} -> rational-membered; end; registration let i1,i2,i3; cluster {i1,i2,i3} -> integer-membered; end; registration let n1,n2,n3; cluster {n1,n2,n3} -> natural-membered; end; registration let X be complex-membered set; cluster -> complex-membered for Subset of X; end; registration let X be ext-real-membered set; cluster -> ext-real-membered for Subset of X; end; registration let X be real-membered set; cluster -> real-membered for Subset of X; end; registration let X be rational-membered set; cluster -> rational-membered for Subset of X; end; registration let X be integer-membered set; cluster -> integer-membered for Subset of X; end; registration let X be natural-membered set; cluster -> natural-membered for Subset of X; end; registration let X,Y be complex-membered set; cluster X \/ Y -> complex-membered; end; registration let X,Y be ext-real-membered set; cluster X \/ Y -> ext-real-membered; end; registration let X,Y be real-membered set; cluster X \/ Y -> real-membered; end; registration let X,Y be rational-membered set; cluster X \/ Y -> rational-membered; end; registration let X,Y be integer-membered set; cluster X \/ Y -> integer-membered; end; registration let X,Y be natural-membered set; cluster X \/ Y -> natural-membered; end; registration let X be complex-membered set, Y be set; cluster X /\ Y -> complex-membered; cluster Y /\ X -> complex-membered; end; registration let X be ext-real-membered set, Y be set; cluster X /\ Y -> ext-real-membered; cluster Y /\ X -> ext-real-membered; end; registration let X be real-membered set, Y be set; cluster X /\ Y -> real-membered; cluster Y /\ X -> real-membered; end; registration let X be rational-membered set, Y be set; cluster X /\ Y -> rational-membered; cluster Y /\ X -> rational-membered; end; registration let X be integer-membered set, Y be set; cluster X /\ Y -> integer-membered; cluster Y /\ X -> integer-membered; end; registration let X be natural-membered set, Y be set; cluster X /\ Y -> natural-membered; cluster Y /\ X -> natural-membered; end; registration let X be complex-membered set, Y be set; cluster X \ Y -> complex-membered; end; registration let X be ext-real-membered set, Y be set; cluster X \ Y -> ext-real-membered; end; registration let X be real-membered set, Y be set; cluster X \ Y -> real-membered; end; registration let X be rational-membered set, Y be set; cluster X \ Y -> rational-membered; end; registration let X be integer-membered set, Y be set; cluster X \ Y -> integer-membered; end; registration let X be natural-membered set, Y be set; cluster X \ Y -> natural-membered; end; registration let X,Y be complex-membered set; cluster X \+\ Y -> complex-membered; end; registration let X,Y be ext-real-membered set; cluster X \+\ Y -> ext-real-membered; end; registration let X,Y be real-membered set; cluster X \+\ Y -> real-membered; end; registration let X,Y be rational-membered set; cluster X \+\ Y -> rational-membered; end; registration let X,Y be integer-membered set; cluster X \+\ Y -> integer-membered; end; registration let X,Y be natural-membered set; cluster X \+\ Y -> natural-membered; end; definition let X be complex-membered set, Y be set; redefine pred X c= Y means c in X implies c in Y; end; definition let X be ext-real-membered set, Y be set; redefine pred X c= Y means e in X implies e in Y; end; definition let X be real-membered set, Y be set; redefine pred X c= Y means r in X implies r in Y; end; definition let X be rational-membered set, Y be set; redefine pred X c= Y means w in X implies w in Y; end; definition let X be integer-membered set, Y be set; redefine pred X c= Y means i in X implies i in Y; end; definition let X be natural-membered set, Y be set; redefine pred X c= Y means n in X implies n in Y; end; definition let X,Y be complex-membered set; redefine pred X = Y means c in X iff c in Y; end; definition let X,Y be ext-real-membered set; redefine pred X = Y means e in X iff e in Y; end; definition let X,Y be real-membered set; redefine pred X = Y means r in X iff r in Y; end; definition let X,Y be rational-membered set; redefine pred X = Y means w in X iff w in Y; end; definition let X,Y be integer-membered set; redefine pred X = Y means i in X iff i in Y; end; definition let X,Y be natural-membered set; redefine pred X = Y means n in X iff n in Y; end; definition let X,Y be complex-membered set; redefine pred X meets Y means ex c st c in X & c in Y; end; definition let X,Y be ext-real-membered set; redefine pred X meets Y means ex e st e in X & e in Y; end; definition let X,Y be real-membered set; redefine pred X meets Y means ex r st r in X & r in Y; end; definition let X,Y be rational-membered set; redefine pred X meets Y means ex w st w in X & w in Y; end; definition let X,Y be integer-membered set; redefine pred X meets Y means ex i st i in X & i in Y; end; definition let X,Y be natural-membered set; redefine pred X meets Y means ex n st n in X & n in Y; end; theorem (for X st X in F holds X is complex-membered) implies union F is complex-membered; theorem (for X st X in F holds X is ext-real-membered) implies union F is ext-real-membered; theorem (for X st X in F holds X is real-membered) implies union F is real-membered; theorem (for X st X in F holds X is rational-membered) implies union F is rational-membered; theorem (for X st X in F holds X is integer-membered) implies union F is integer-membered; theorem (for X st X in F holds X is natural-membered) implies union F is natural-membered; theorem for X st X in F & X is complex-membered holds meet F is complex-membered; theorem for X st X in F & X is ext-real-membered holds meet F is ext-real-membered; theorem for X st X in F & X is real-membered holds meet F is real-membered; theorem for X st X in F & X is rational-membered holds meet F is rational-membered; theorem for X st X in F & X is integer-membered holds meet F is integer-membered; theorem for X st X in F & X is natural-membered holds meet F is natural-membered; scheme CMSeparation {P[set]}: ex X being complex-membered set st for c holds c in X iff P[c]; scheme EMSeparation {P[set]}: ex X being ext-real-membered set st for e holds e in X iff P[e]; scheme RMSeparation {P[set]}: ex X being real-membered set st for r holds r in X iff P[r]; scheme WMSeparation {P[set]}: ex X being rational-membered set st for w holds w in X iff P[w]; scheme IMSeparation {P[set]}: ex X being integer-membered set st for i holds i in X iff P[i]; scheme NMSeparation {P[set]}: ex X being natural-membered set st for n holds n in X iff P[n]; registration cluster non empty natural-membered for set; end; registration cluster -> natural-membered for Element of NAT; end; reserve a,b,d for real number; theorem for X,Y being real-membered set st X<>{} & Y<>{} & for a,b st a in X & b in Y holds a<=b holds ex d st (for a st a in X holds a<=d) & for b st b in Y holds d<=b; definition let X be set; attr X is add-closed means for x, y being complex number st x in X & y in X holds x+y in X; end; registration cluster empty -> add-closed for set; cluster COMPLEX -> add-closed; cluster REAL -> add-closed; cluster RAT -> add-closed; cluster INT -> add-closed; cluster NAT -> add-closed; cluster non empty add-closed natural-membered for set; end; begin definition let f be Relation; attr f is complex-valued means rng f c= COMPLEX; attr f is ext-real-valued means rng f c= ExtREAL; attr f is real-valued means rng f c= REAL; canceled 2; attr f is natural-valued means rng f c= NAT; end; registration cluster natural-valued -> INT-valued for Relation; cluster INT-valued -> RAT-valued for Relation; cluster INT-valued -> real-valued for Relation; cluster RAT-valued -> real-valued for Relation; cluster real-valued -> ext-real-valued for Relation; cluster real-valued -> complex-valued for Relation; cluster natural-valued -> RAT-valued for Relation; cluster natural-valued -> real-valued for Relation; end; registration cluster empty -> natural-valued for Relation; end; registration cluster natural-valued for Function; end; registration let R be complex-valued Relation; cluster rng R -> complex-membered; end; registration let R be ext-real-valued Relation; cluster rng R -> ext-real-membered; end; registration let R be real-valued Relation; cluster rng R -> real-membered; end; registration let R be RAT-valued Relation; cluster rng R -> rational-membered; end; registration let R be INT-valued Relation; cluster rng R -> integer-membered; end; registration let R be natural-valued Relation; cluster rng R -> natural-membered; end; reserve x,y,X for set, f for Function, R,S for Relation; theorem for S being complex-valued Relation st R c= S holds R is complex-valued; theorem for S being ext-real-valued Relation st R c= S holds R is ext-real-valued; theorem for S being real-valued Relation st R c= S holds R is real-valued; theorem for S being RAT-valued Relation st R c= S holds R is RAT-valued; theorem for S being INT-valued Relation st R c= S holds R is INT-valued; theorem for S being natural-valued Relation st R c= S holds R is natural-valued; registration let R be complex-valued Relation; cluster -> complex-valued for Subset of R; end; registration let R be ext-real-valued Relation; cluster -> ext-real-valued for Subset of R; end; registration let R be real-valued Relation; cluster -> real-valued for Subset of R; end; registration let R be RAT-valued Relation; cluster -> RAT-valued for Subset of R; end; registration let R be INT-valued Relation; cluster -> INT-valued for Subset of R; end; registration let R be natural-valued Relation; cluster -> natural-valued for Subset of R; end; registration let R,S be complex-valued Relation; cluster R \/ S -> complex-valued; end; registration let R,S be ext-real-valued Relation; cluster R \/ S -> ext-real-valued; end; registration let R,S be real-valued Relation; cluster R \/ S -> real-valued; end; registration let R,S be RAT-valued Relation; cluster R \/ S -> RAT-valued; end; registration let R,S be INT-valued Relation; cluster R \/ S -> INT-valued; end; registration let R,S be natural-valued Relation; cluster R \/ S -> natural-valued; end; registration let R be complex-valued Relation; let S; cluster R /\ S -> complex-valued; cluster R \ S -> complex-valued; end; registration let R be ext-real-valued Relation; let S; cluster R /\ S -> ext-real-valued; cluster R \ S -> ext-real-valued; end; registration let R be real-valued Relation; let S; cluster R /\ S -> real-valued; cluster R \ S -> real-valued; end; registration let R be RAT-valued Relation; let S; cluster R /\ S -> RAT-valued; cluster R \ S -> RAT-valued; end; registration let R be INT-valued Relation; let S; cluster R /\ S -> INT-valued; cluster R \ S -> INT-valued; end; registration let R be natural-valued Relation; let S; cluster R /\ S -> natural-valued; cluster R \ S -> natural-valued; end; registration let R,S be complex-valued Relation; cluster R \+\ S -> complex-valued; end; registration let R,S be ext-real-valued Relation; cluster R \+\ S -> ext-real-valued; end; registration let R,S be real-valued Relation; cluster R \+\ S -> real-valued; end; registration let R,S be RAT-valued Relation; cluster R \+\ S -> RAT-valued; end; registration let R,S be INT-valued Relation; cluster R \+\ S -> INT-valued; end; registration let R,S be natural-valued Relation; cluster R \+\ S -> natural-valued; end; registration let R be complex-valued Relation; let X; cluster R.:X -> complex-membered; end; registration let R be ext-real-valued Relation; let X; cluster R.:X -> ext-real-membered; end; registration let R be real-valued Relation; let X; cluster R.:X -> real-membered; end; registration let R be RAT-valued Relation; let X; cluster R.:X -> rational-membered; end; registration let R be INT-valued Relation; let X; cluster R.:X -> integer-membered; end; registration let R be natural-valued Relation; let X; cluster R.:X -> natural-membered; end; registration let R be complex-valued Relation; let x; cluster Im(R,x) -> complex-membered; end; registration let R be ext-real-valued Relation; let x; cluster Im(R,x) -> ext-real-membered; end; registration let R be real-valued Relation; let x; cluster Im(R,x) -> real-membered; end; registration let R be RAT-valued Relation; let x; cluster Im(R,x) -> rational-membered; end; registration let R be INT-valued Relation; let x; cluster Im(R,x) -> integer-membered; end; registration let R be natural-valued Relation; let x; cluster Im(R,x) -> natural-membered; end; registration let R be complex-valued Relation; let X; cluster R|X -> complex-valued; end; registration let R be ext-real-valued Relation; let X; cluster R|X -> ext-real-valued; end; registration let R be real-valued Relation; let X; cluster R|X -> real-valued; end; registration let R be RAT-valued Relation; let X; cluster R|X -> RAT-valued; end; registration let R be INT-valued Relation; let X; cluster R|X -> INT-valued; end; registration let R be natural-valued Relation; let X; cluster R|X -> natural-valued; end; registration let X be complex-membered set; cluster id X -> complex-valued; end; registration let X be ext-real-membered set; cluster id X -> ext-real-valued; end; registration let X be real-membered set; cluster id X -> real-valued; end; registration let X be rational-membered set; cluster id X -> RAT-valued; end; registration let X be integer-membered set; cluster id X -> INT-valued; end; registration let X be natural-membered set; cluster id X -> natural-valued; end; registration let R; let S be complex-valued Relation; cluster R*S -> complex-valued; end; registration let R; let S be ext-real-valued Relation; cluster R*S -> ext-real-valued; end; registration let R; let S be real-valued Relation; cluster R*S -> real-valued; end; registration let R; let S be RAT-valued Relation; cluster R*S -> RAT-valued; end; registration let R; let S be INT-valued Relation; cluster R*S -> INT-valued; end; registration let R; let S be natural-valued Relation; cluster R*S -> natural-valued; end; definition let f be Function; redefine attr f is complex-valued means for x st x in dom f holds f.x is complex; redefine attr f is ext-real-valued means for x st x in dom f holds f.x is ext-real; redefine attr f is real-valued means for x st x in dom f holds f.x is real; canceled 2; redefine attr f is natural-valued means for x st x in dom f holds f.x is natural; end; theorem f is complex-valued iff for x holds f.x is complex; theorem f is ext-real-valued iff for x holds f.x is ext-real; theorem f is real-valued iff for x holds f.x is real; theorem f is RAT-valued iff for x holds f.x is rational; theorem f is INT-valued iff for x holds f.x is integer; theorem f is natural-valued iff for x holds f.x is natural; registration let f be complex-valued Function; let x; cluster f.x -> complex; end; registration let f be ext-real-valued Function; let x; cluster f.x -> ext-real; end; registration let f be real-valued Function; let x; cluster f.x -> real; end; registration let f be RAT-valued Function; let x; cluster f.x -> rational; end; registration let f be INT-valued Function; let x; cluster f.x -> integer; end; registration let f be natural-valued Function; let x; cluster f.x -> natural; end; registration let X; let x be complex number; cluster X --> x -> complex-valued; end; registration let X; let x be ext-real number; cluster X --> x -> ext-real-valued; end; registration let X; let x be real number; cluster X --> x -> real-valued; end; registration let X; let x be rational number; cluster X --> x -> RAT-valued; end; registration let X; let x be integer number; cluster X --> x -> INT-valued; end; registration let X; let x be Nat; cluster X --> x -> natural-valued; end; registration let f,g be complex-valued Function; cluster f +* g -> complex-valued; end; registration let f,g be ext-real-valued Function; cluster f +* g -> ext-real-valued; end; registration let f,g be real-valued Function; cluster f +* g -> real-valued; end; registration let f,g be RAT-valued Function; cluster f +* g -> RAT-valued; end; registration let f,g be INT-valued Function; cluster f +* g -> INT-valued; end; registration let f,g be natural-valued Function; cluster f +* g -> natural-valued; end; registration let x; let y be complex number; cluster x .--> y -> complex-valued; end; registration let x; let y be ext-real number; cluster x .--> y -> ext-real-valued; end; registration let x; let y be real number; cluster x .--> y -> real-valued; end; registration let x; let y be rational number; cluster x .--> y -> RAT-valued; end; registration let x; let y be integer number; cluster x .--> y -> INT-valued; end; registration let x; let y be Nat; cluster x .--> y -> natural-valued; end; registration let X; let Y be complex-membered set; cluster -> complex-valued for Relation of X,Y; end; registration let X; let Y be ext-real-membered set; cluster -> ext-real-valued for Relation of X,Y; end; registration let X; let Y be real-membered set; cluster -> real-valued for Relation of X,Y; end; registration let X; let Y be rational-membered set; cluster -> RAT-valued for Relation of X,Y; end; registration let X; let Y be integer-membered set; cluster -> INT-valued for Relation of X,Y; end; registration let X; let Y be natural-membered set; cluster -> natural-valued for Relation of X,Y; end; registration let X; let Y be complex-membered set; cluster [:X,Y:] -> complex-valued; end; registration let X; let Y be ext-real-membered set; cluster [:X,Y:] -> ext-real-valued; end; registration let X; let Y be real-membered set; cluster [:X,Y:] -> real-valued; end; registration let X; let Y be rational-membered set; cluster [:X,Y:] -> RAT-valued; end; registration let X; let Y be integer-membered set; cluster [:X,Y:] -> INT-valued; end; registration let X; let Y be natural-membered set; cluster [:X,Y:] -> natural-valued; end; notation let f be ext-real-valued Relation; synonym f is non-zero for f is non-empty; end; registration cluster non empty constant natural-valued INT-valued RAT-valued for Function; end; theorem for f being non empty constant complex-valued Function ex r being complex number st for x st x in dom f holds f.x = r; theorem for f being non empty constant ext-real-valued Function ex r being ext-real number st for x st x in dom f holds f.x = r; theorem for f being non empty constant real-valued Function ex r being real number st for x st x in dom f holds f.x = r; theorem for f being non empty constant RAT-valued Function ex r being rational number st for x st x in dom f holds f.x = r; theorem for f being non empty constant INT-valued Function ex r being integer number st for x st x in dom f holds f.x = r; theorem for f being non empty constant natural-valued Function ex r being Nat st for x st x in dom f holds f.x = r; begin reserve e1,e2 for ext-real number; definition let f be ext-real-valued Function; attr f is increasing means for e1,e2 st e1 in dom f & e2 in dom f & e1 < e2 holds f.e1 < f.e2; attr f is decreasing means for e1,e2 st e1 in dom f & e2 in dom f & e1 < e2 holds f.e1 > f.e2; attr f is non-decreasing means for e1,e2 st e1 in dom f & e2 in dom f & e1 <= e2 holds f.e1 <= f.e2; attr f is non-increasing means for e1,e2 st e1 in dom f & e2 in dom f & e1 <= e2 holds f.e1 >= f.e2; end; registration cluster trivial -> increasing decreasing for ext-real-valued Function; end; registration cluster increasing -> non-decreasing for ext-real-valued Function; cluster decreasing -> non-increasing for ext-real-valued Function; end; registration let f,g be increasing ext-real-valued Function; cluster g*f -> increasing; end; registration let f,g be non-decreasing ext-real-valued Function; cluster g*f -> non-decreasing; end; registration let f,g be decreasing ext-real-valued Function; cluster g*f -> increasing; end; registration let f,g be non-increasing ext-real-valued Function; cluster g*f -> non-decreasing; end; registration let f be decreasing ext-real-valued Function; let g be increasing ext-real-valued Function; cluster g*f -> decreasing; cluster f*g -> decreasing; end; registration let f be non-increasing ext-real-valued Function; let g be non-decreasing ext-real-valued Function; cluster g*f -> non-increasing; cluster f*g -> non-increasing; end; registration let X be ext-real-membered set; cluster id X -> increasing for Function of X,X; end; registration cluster increasing for sequence of NAT; end; definition let s be ManySortedSet of NAT; mode subsequence of s -> ManySortedSet of NAT means ex N being increasing sequence of NAT st it = s * N; end; registration let X be non empty set, s be X-valued ManySortedSet of NAT; cluster -> X-valued for subsequence of s; end; definition let X be non empty set, s be sequence of X; redefine mode subsequence of s -> sequence of X; end; definition let X be non empty set, s be sequence of X, k be Nat; redefine func s ^\ k -> subsequence of s; end; reserve s,s1,s2,s3 for sequence of X; reserve XX for non empty set, ss,ss1,ss2,ss3 for sequence of XX; theorem ss is subsequence of ss; theorem ss1 is subsequence of ss2 & ss2 is subsequence of ss3 implies ss1 is subsequence of ss3; registration let X; cluster constant for sequence of X; end; theorem for ss1 being subsequence of ss holds rng ss1 c= rng ss; registration let X be non empty set; let s be constant sequence of X; cluster -> constant for subsequence of s; end; definition let X be non empty set, N be increasing sequence of NAT, s be sequence of X; redefine func s*N -> subsequence of s; end; reserve X,Y for non empty set, Z for set; reserve s,s1 for sequence of X, h,h1 for PartFunc of X,Y, h2 for PartFunc of Y ,Z, x for Element of X, N for increasing sequence of NAT; theorem rng s c= dom h & s1 is subsequence of s implies h/*s1 is subsequence of h/*s; registration let X be with_non-empty_element set; cluster non-empty for sequence of X; end; registration let X be with_non-empty_element set, s be non-empty sequence of X; cluster -> non-empty for subsequence of s; end; reserve i,j for Nat; definition let X be non empty set, s be sequence of X; redefine attr s is constant means ex x being Element of X st for n being Nat holds s.n=x; end; theorem for X being set for s being constant sequence of X holds s.i = s.j; theorem (for i,j holds s.i = s.j) implies s is constant; theorem (for i holds s.i = s.(i+1)) implies s is constant; theorem s is constant & s1 is subsequence of s implies s = s1; reserve n for Nat; theorem rng s c= dom h implies (h/*s)^\n=h/*(s^\n); theorem s.n in rng s; theorem h is total implies h/*(s^\n) = (h/*s)^\n; theorem rng s c= dom h implies h.:(rng s) = rng (h/*s); theorem rng s c= dom (h2*h1) implies h2/*(h1/*s) = (h2*h1)/*s; definition let f be ext-real-valued Function; attr f is zeroed means f.{} = 0; end; registration cluster COMPLEX-valued -> complex-valued for Relation; cluster ExtREAL-valued -> ext-real-valued for Relation; cluster REAL-valued -> real-valued for Relation; cluster NAT-valued -> natural-valued for Relation; end; definition let s be ManySortedSet of NAT; redefine attr s is constant means ex x being set st for n being Nat holds s.n=x; end; theorem for x being non empty set, M be ManySortedSet of NAT, s be subsequence of M holds rng s c= rng M; registration let X be set; cluster natural-valued for ManySortedSet of X; end; begin reserve a,b,c,d for real number; theorem a^2 + b^2 = 0 implies a = 0; definition let z be complex number; func Re z means it = z if z in REAL otherwise ex f being Function of 2,REAL st z = f & it = f.0; func Im z means it = 0 if z in REAL otherwise ex f being Function of 2,REAL st z = f & it = f.1; end; registration let z be complex number; cluster Re z -> real; cluster Im z -> real; end; definition let z be complex number; redefine func Re z -> Real; redefine func Im z -> Real; end; theorem for f being Function of 2,REAL ex a,b being Element of REAL st f = (0,1)-->(a,b); reserve z,z1,z2 for complex number; theorem Re z1 = Re z2 & Im z1 = Im z2 implies z1 = z2; definition let z1,z2 be complex number; redefine pred z1 = z2 means Re z1 = Re z2 & Im z1 = Im z2; end; notation synonym 0c for 0; end; definition redefine func 0c -> Element of COMPLEX; end; definition func 1r -> Element of COMPLEX equals 1; redefine func -> Element of COMPLEX; end; theorem Re 0 = 0 & Im 0 = 0; theorem z = 0 iff (Re z)^2 + (Im z)^2 = 0; theorem Re(1r) = 1 & Im(1r) = 0; theorem Re() = 0 & Im() = 1; definition let z1,z2 be Element of COMPLEX; redefine func z1 + z2 -> Element of COMPLEX equals Re z1 + Re z2 + (Im z1 + Im z2)*; end; theorem Re(z1 + z2) = Re z1 + Re z2 & Im(z1 + z2) = Im z1 + Im z2; definition let z1,z2 be Element of COMPLEX; redefine func z1 * z2 -> Element of COMPLEX equals Re z1 * Re z2 - Im z1 * Im z2+(Re z1 * Im z2 + Re z2 * Im z1)*; end; theorem Re(z1 * z2) = Re z1 * Re z2 - Im z1 * Im z2 & Im(z1 * z2) = Re z1 * Im z2 + Re z2 * Im z1; theorem Re (a*) = 0; theorem Im (a*) = a; theorem Re(a+b*) = a & Im(a+b*) = b; theorem Re z+(Im z)* = z; theorem Im z1 = 0 & Im z2 = 0 implies Re(z1*z2) = Re z1 * Re z2 & Im(z1*z2) = 0; theorem Re z1 = 0 & Re z2 = 0 implies Re(z1*z2) = - Im z1 * Im z2 & Im(z1*z2) = 0; theorem Re(z*z) = (Re z)^2 - (Im z)^2 & Im(z*z) = 2*(Re z *Im z); definition let z be Element of COMPLEX; redefine func -z -> Element of COMPLEX equals -Re z+(-Im z)*; end; theorem Re(-z) = -(Re z) & Im(-z) = -(Im z); theorem * = -1r; definition let z1,z2 be Element of COMPLEX; redefine func z1 - z2 -> Element of COMPLEX equals Re z1 - Re z2 + (Im z1 - Im z2)*; end; theorem Re(z1 - z2) = Re z1 - Re z2 & Im(z1 - z2) = Im z1 - Im z2; definition let z be Element of COMPLEX; redefine func z" -> Element of COMPLEX equals Re z / ((Re z)^2+(Im z )^2)+((- Im z) / ((Re z)^2+(Im z)^2))*; end; theorem Re(z") = Re z / ((Re z)^2+(Im z)^2) & Im(z") = (- Im z) / ((Re z)^2+(Im z)^2) ; theorem " = -; theorem Re z <> 0 & Im z = 0 implies Re(z") = (Re z)" & Im(z") = 0; theorem Re z = 0 & Im z <> 0 implies Re(z") = 0 & Im(z") = -(Im z)"; definition let z1,z2 be complex number; redefine func z1 / z2 -> Element of COMPLEX equals (Re z1 * Re z2 + Im z1 * Im z2) / ((Re z2)^2 + (Im z2)^2) + ((Re z2 * Im z1 - Re z1 * Im z2) / ((Re z2)^2 + (Im z2)^2))*; end; theorem Re(z1 / z2) = (Re z1 * Re z2 + Im z1 * Im z2) / ((Re z2)^2 + (Im z2)^2) & Im(z1 / z2) = (Re z2 * Im z1 - Re z1 * Im z2) / ((Re z2)^2 + (Im z2)^2); theorem Im z1 = 0 & Im z2 = 0 & Re z2 <> 0 implies Re(z1/z2) = (Re z1)/(Re z2) & Im(z1/z2) = 0; theorem Re z1 = 0 & Re z2 = 0 & Im z2 <> 0 implies Re(z1/z2) = (Im z1)/(Im z2) & Im(z1/z2) = 0; definition let z be complex number; func z*' -> complex number equals Re z-(Im z)*; involutiveness; end; definition let z be complex number; redefine func z*' -> Element of COMPLEX; end; theorem Re (z*') = Re z & Im (z*') = -Im z; theorem 0*' = 0; theorem z*' = 0 implies z = 0; theorem 1r*' = 1r; theorem *' = -; theorem (z1 + z2)*' = z1*' + z2*'; theorem (-z)*' = -(z*'); theorem (z1 - z2)*' = z1*' - z2*'; theorem (z1*z2)*' = z1*'*z2*'; theorem z"*' = z*'"; theorem (z1/z2)*' = (z1*')/(z2*'); theorem Im z = 0 implies z*' = z; theorem Re z = 0 implies z*' = -z; theorem Re(z*z*') = (Re z)^2 + (Im z)^2 & Im(z*z*') = 0; theorem Re(z + z*') = 2*Re z & Im(z + z*') = 0; theorem Re(z - z*') = 0 & Im(z - z*') = 2*Im z; definition let z be complex number; func |.z.| -> real number equals sqrt ((Re z)^2 + (Im z)^2); projectivity; end; definition let z; redefine func |.z.| -> Real; end; theorem a >= 0 implies |.a.| = a; registration cluster |.0.| -> zero; end; theorem |.0.| = 0; registration let z be non zero complex number; cluster |.z.| -> non zero; end; theorem |.z.| = 0 implies z = 0; registration let z; cluster |.z.| -> non negative; end; theorem 0 <= |.z.|; theorem z <> 0 iff 0 < |.z.|; theorem |.1r.| = 1; theorem |..| = 1; theorem Im z = 0 implies |.z.| = |.Re z.|; theorem Re z = 0 implies |.z.| = |.Im z.|; theorem |.-z.| = |.z.|; theorem |.z*'.| = |.z.|; theorem Re z <= |.z.|; theorem Im z <= |.z.|; theorem |.z1 + z2.| <= |.z1.| + |.z2.|; theorem |.z1 - z2.| <= |.z1.| + |.z2.|; theorem |.z1.| - |.z2.| <= |.z1 + z2.|; theorem |.z1.| - |.z2.| <= |.z1 - z2.|; theorem |.z1 - z2.| = |.z2 - z1.|; theorem |.z1 - z2.| = 0 iff z1 = z2; theorem z1 <> z2 iff 0 < |.z1 - z2.|; theorem |.z1 - z2.| <= |.z1 - z.| + |.z - z2.|; theorem |.|.z1.| - |.z2.|.| <= |.z1 - z2.|; theorem |.z1*z2.| = |.z1.|*|.z2.|; theorem |.z".| = |.z.|"; theorem |.z1.| / |.z2.| = |.z1/z2.|; theorem |.z*z.| = (Re z)^2 + (Im z)^2; theorem |.z*z.| = |.z*z*'.|; theorem a <= 0 implies |.a.| = -a; theorem |.a.| = a or |.a.| = -a; theorem sqrt a^2 = |.a.|; theorem min(a,b) = (a + b - |.a - b.|) / 2; theorem max(a,b) = (a + b + |.a - b.|) / 2; theorem |.a.|^2 = a^2; theorem -|.a.| <= a & a <= |.a.|; notation let z be complex number; synonym abs z for |.z.|; end; definition let z be complex number; redefine func abs z -> Real; end; theorem a+b* = c+d* implies a = c & b = d; theorem sqrt(a^2+b^2) <= abs(a)+abs(b); theorem abs(a) <= sqrt(a^2+b^2); theorem |. 1/z1 .| = 1 / |.z1.|; begin reserve x, y, z, s, t for real number; definition let x be real number; redefine func |.x.| equals x if 0 <= x otherwise -x; end; theorem abs x = x or abs x = -x; theorem x = 0 iff abs x = 0; theorem abs x = -x & x <> 0 implies x < 0; theorem -abs x <= x & x <= abs x; theorem -y <= x & x <= y iff abs x <= y; theorem x <> 0 implies abs(x) * abs(1/x) = 1; theorem abs(1/x) = 1/abs(x); theorem 0 <= x*y implies sqrt (x*y) = sqrt abs(x)*sqrt abs(y); theorem abs x <= z & abs y <= t implies abs(x+y) <= z + t; theorem 0 < x/y implies sqrt (x/y) = sqrt abs(x) / sqrt abs(y); theorem 0 <= x * y implies abs (x+y) = abs(x) + abs(y); theorem abs(x+y) = abs(x) + abs(y) implies 0 <= x * y; theorem abs(x + y)/(1 + abs(x+y)) <= abs(x)/(1 + abs(x)) + abs(y)/(1 + abs(y)); definition let x; func sgn x -> real number equals 1 if 0 < x, -1 if x < 0 otherwise 0; projectivity; end; registration let x; cluster sgn x -> integer; end; definition let x be Real; redefine func sgn x -> Real; end; theorem sgn x = 1 implies 0 < x; theorem sgn x = -1 implies x < 0; theorem sgn x = 0 implies x = 0; theorem x = abs(x) * sgn x; theorem sgn (x * y) = sgn x * sgn y; canceled; theorem sgn (x + y) <= sgn x + sgn y + 1; theorem x <> 0 implies sgn x * sgn (1/x) = 1; theorem 1/(sgn x) = sgn (1/x); theorem sgn x + sgn y - 1 <= sgn ( x + y ); theorem sgn x = sgn (1/x); theorem sgn (x/y) = (sgn x)/(sgn y); reserve r, s for real number; theorem 0 <= r + abs(r); theorem 0 <= -r + abs(r); theorem abs(r) = abs(s) implies r = s or r = -s; theorem for m being Nat holds m = abs m; theorem r<=0 implies abs(r)=-r; begin definition let a be integer number; redefine func abs a -> Element of NAT; end; reserve a,b,c for Integer; theorem a divides b & a divides b + c implies a divides c; theorem a divides b implies a divides b * c; theorem 0 divides a iff a = 0; reserve i,j,k,l for Nat; definition let a,b be Integer; func a lcm b -> Nat means a divides it & b divides it & for m being Integer st a divides m & b divides m holds it divides m; commutativity; end; theorem a = 0 or b = 0 iff a lcm b = 0; definition let a,b be Integer; func a gcd b -> Nat means it divides a & it divides b & for m being Integer st m divides a & m divides b holds m divides it; commutativity; end; theorem a = 0 & b = 0 iff a gcd b = 0; reserve n for Nat; reserve a,b,c,d,a1,b1,a2,b2,k,l for Integer; theorem -n is Element of NAT iff n = 0; registration let n be non zero Nat; cluster -n -> non natural; end; theorem not -1 is Element of NAT; theorem a divides -a & -a divides a; theorem a divides b & b divides c implies a divides c; theorem (a divides b iff a divides -b) & (a divides b iff -a divides b) & (a divides b iff -a divides -b) & (a divides -b iff -a divides b); theorem a divides b & b divides a implies a = b or a = -b; theorem a divides 0 & 1 divides a & -1 divides a; theorem a divides 1 or a divides -1 implies a = 1 or a = -1; theorem a = 1 or a = -1 implies a divides 1 & a divides -1; theorem a,b are_congruent_mod c iff c divides (a-b); theorem a divides b iff (abs a) divides (abs b); theorem a lcm b is Element of NAT; theorem a divides a lcm b; theorem for c st a divides c & b divides c holds a lcm b divides c; theorem a gcd b is Element of NAT; theorem a gcd b divides a; theorem for c st c divides a & c divides b holds c divides (a gcd b); definition let a,b; pred a,b are_relative_prime means a gcd b = 1; symmetry; end; theorem a<>0 or b<>0 implies ex a1,b1 st a = (a gcd b)*a1 & b = (a gcd b)*b1 & a1,b1 are_relative_prime; theorem a,b are_relative_prime implies (c*a gcd c*b) = abs(c) & c*a gcd b*c = abs(c) & a*c gcd c*b = abs(c) & a*c gcd b*c = abs(c); theorem c divides a*b & a,c are_relative_prime implies c divides b; theorem a,c are_relative_prime & b,c are_relative_prime implies a*b,c are_relative_prime; reserve p,p1,q,l for Nat; definition let p be Nat; attr p is prime means p > 1 & for n being Nat st n divides p holds n = 1 or n = p; end; theorem 0 < b & a divides b implies a <= b; theorem 2 is prime; theorem not 4 is prime; registration cluster prime for Nat; cluster non zero non prime for Nat; end; theorem p is prime & q is prime implies p,q are_relative_prime or p = q; theorem l>=2 implies ex p being Element of NAT st p is prime & p divides l; begin theorem for i,j being Integer st i >= 0 & j >= 0 holds abs(i) mod abs(j) = i mod j & abs(i) div abs(j) = i div j; theorem a lcm b = abs(a) lcm abs(b); theorem a gcd b = abs(a) gcd abs(b); begin reserve p,k,l,m,n,s,h,i,j,t for Nat; definition let k,l be Nat; redefine func k div l -> Nat means ( ex t being Nat st k = l * it + t & t < l ) or it = 0 & l = 0; end; definition let k,l be Nat; redefine func k mod l -> Nat means ( ex t being Nat st k = l * t + it & it < l ) or it = 0 & l = 0; end; definition let k,l be Nat; redefine func k div l -> Element of NAT; redefine func k mod l -> Element of NAT; end; theorem 0 < i implies j mod i < i; theorem 0 < i implies j = i * (j div i) + (j mod i); definition let k,l be Nat; redefine pred k divides l means ex t being Nat st l = k * t; reflexivity; end; theorem j divides i iff i = j * (i div j); theorem i divides j & j divides h implies i divides h; theorem i divides j & j divides i implies i = j; theorem i divides 0 & 1 divides i; theorem 0 < j & i divides j implies i <= j; theorem i divides j & i divides h implies i divides j+h; theorem i divides j implies i divides j * h; theorem i divides j & i divides j + h implies i divides h; theorem i divides j & i divides h implies i divides j mod h; definition let k,n be Nat; redefine func k lcm n means k divides it & n divides it & for m being Nat st k divides m & n divides m holds it divides m; end; definition let k,n be Nat; redefine func k lcm n -> Element of NAT; end; definition let k,n be Nat; redefine func k gcd n means it divides k & it divides n & for m being Nat st m divides k & m divides n holds m divides it; end; definition let k,n be Nat; redefine func k gcd n -> Element of NAT; end; scheme Euklides { Q(Nat)->Nat, a,b()->Nat } : ex n being Element of NAT st Q(n) = a() gcd b() & Q(n + 1) = 0 provided 0 < b() & b() < a() and Q(0) = a() & Q(1) = b() and for n being Element of NAT holds Q(n + 2) = Q(n) mod Q(n + 1); theorem n mod 2 = 0 or n mod 2 = 1; theorem (k * n) mod k = 0; theorem k > 1 implies 1 mod k = 1; theorem k mod n = 0 & l = k - m * n implies l mod n = 0; theorem n <> 0 & k mod n = 0 & l < n implies k + l mod n = l; theorem k mod n = 0 implies k + l mod n = l mod n; theorem k <> 0 implies (k * n) div k = n; theorem k mod n = 0 implies (k + l) div n = (k div n) + (l div n); begin theorem k <> 0 implies m * k div k = m; theorem m mod n = (n*k + m) mod n; theorem (p+s) mod n = ((p mod n)+s) mod n; theorem (p+s) mod n = (p + ( s mod n)) mod n; theorem k < n implies k mod n = k; theorem n mod n = 0; theorem 0 = 0 mod n; theorem i < j implies i div j = 0; theorem m > 0 implies n gcd m = m gcd (n mod m); scheme INDI{ k,n() -> Element of NAT, P[set] }: P[n()] provided P[0] and k() > 0 and for i,j st P[k()*i] & j <> 0 & j <= k() holds P[k()*i+j]; theorem i*j = (i lcm j)*(i gcd j); theorem for i,j being Integer st i>=0 & j>0 holds i gcd j= j gcd (i mod j); theorem i lcm i = i; theorem i gcd i = i; theorem for i, j being Nat st i < j & i <> 0 holds i/j is not integer; definition let i,j be Nat; redefine func i -' j -> Element of NAT; end; theorem for i,j being Nat holds i + j -' j = i; reserve a,b for Nat; theorem a -' b <= a; reserve n,i,j,k for Nat; theorem n-'i=0 implies n<=i; theorem i<=j implies j+k-'i=j+k-i; theorem i<=j implies j+k-'i=j-'i+k; reserve i,j,k,i1,i2,n for Nat; theorem i-'i1>=1 or i-i1>=1 implies i-'i1=i-i1; theorem n-'0=n; theorem i1<=i2 implies n-'i2<=n-'i1; theorem i1<=i2 implies i1-'n<=i2-'n; theorem i-'i1>=1 or i-i1>=1 implies i-'i1+i1=i; theorem i1<=i2 implies i1-'1<=i2; theorem i-'2=i-'1-'1; theorem i1+1<=i2 implies i1-'1=i1 implies i>=i1-'i2; theorem 1<=i & 1<=i1-'i implies i1-'i 0 implies (a + n * k) div n = (a div n) + k) & (a + n * k) mod n = a mod n; theorem for n being Nat st n > 0 for a being Integer holds a mod n >= 0 & a mod n < n; theorem for n,a being Integer holds (0 <= a & a < n implies a mod n = a) & (0 > a & a >= -n implies a mod n = n + a); theorem for n,a,b being Integer holds (n <> 0 & a mod n = b mod n implies a,b are_congruent_mod n) & (a,b are_congruent_mod n implies a mod n = b mod n); theorem for n being Nat for a being Integer holds (a mod n) mod n = a mod n; theorem for n,a,b being Integer holds (a + b) mod n = ((a mod n) + (b mod n)) mod n; theorem for n,a,b being Integer holds (a * b) mod n = ((a mod n) * (b mod n)) mod n; theorem for a,b being Integer ex s,t being Integer st a gcd b = s * a + t * b; theorem n mod k = k - 1 implies (n+1) mod k = 0; theorem n mod k < k - 1 implies (n+1) mod k = (n mod k) + 1; begin scheme FuncDefUniq{C, D()->non empty set, F(Element of C())->set}: for f1,f2 being Function of C(),D() st (for x being Element of C() holds f1.x = F(x)) & (for x being Element of C() holds f2.x = F(x)) holds f1 = f2; scheme BinOpDefuniq{A()->non empty set, O(Element of A(),Element of A())->set}: for o1,o2 being BinOp of A() st (for a,b being Element of A() holds o1.(a,b) = O(a, b)) & (for a,b being Element of A() holds o2.(a,b) = O(a,b)) holds o1 = o2; scheme CFuncDefUniq{F(complex number)->set}: for f1,f2 being Function of COMPLEX,COMPLEX st (for x being complex number holds f1.x = F(x)) & (for x being complex number holds f2.x = F(x)) holds f1 = f2; scheme RFuncDefUniq{F(real number)->set}: for f1,f2 being Function of REAL,REAL st (for x being real number holds f1.x = F(x)) & (for x being real number holds f2.x = F(x)) holds f1 = f2; registration cluster -> rational for Element of RAT; end; scheme WFuncDefUniq{F(rational number)->set}: for f1,f2 being Function of RAT,RAT st (for x being rational number holds f1.x = F(x)) & (for x being rational number holds f2.x = F(x)) holds f1 = f2; scheme IFuncDefUniq{F(integer number)->set}: for f1,f2 being Function of INT,INT st (for x being integer number holds f1.x = F(x)) & (for x being integer number holds f2.x = F(x)) holds f1 = f2; scheme NFuncDefUniq{F(Nat)->set}: for f1,f2 being Function of NAT,NAT st (for x being Nat holds f1.x = F(x)) & (for x being Nat holds f2.x = F(x)) holds f1 = f2; scheme CBinOpDefuniq{O(complex number,complex number)->set}: for o1,o2 being BinOp of COMPLEX st (for a,b being complex number holds o1.(a,b) = O(a,b)) & (for a,b being complex number holds o2.(a,b) = O(a,b)) holds o1 = o2; scheme RBinOpDefuniq{O(real number,real number)->set}: for o1,o2 being BinOp of REAL st (for a,b being real number holds o1.(a,b) = O(a,b)) & (for a,b being real number holds o2.(a,b) = O(a,b)) holds o1 = o2; scheme WBinOpDefuniq{O(rational number,rational number)->set}: for o1,o2 being BinOp of RAT st (for a,b being rational number holds o1.(a,b) = O(a,b)) & (for a,b being rational number holds o2.(a,b) = O(a,b)) holds o1 = o2; scheme IBinOpDefuniq{O(integer number,integer number)->set}: for o1,o2 being BinOp of INT st (for a,b being integer number holds o1.(a,b) = O(a,b)) & (for a,b being integer number holds o2.(a,b) = O(a,b)) holds o1 = o2; scheme NBinOpDefuniq{O(Nat,Nat)->set}: for o1,o2 being BinOp of NAT st (for a,b being Nat holds o1.(a,b) = O(a,b)) & (for a,b being Nat holds o2.(a,b) = O(a,b)) holds o1 = o2; scheme CLambda2D{F(complex number,complex number) -> complex number}: ex f being Function of [:COMPLEX,COMPLEX:],COMPLEX st for x,y being complex number holds f.(x,y)=F(x,y); scheme RLambda2D{F(real number,real number) -> real number}: ex f being Function of [:REAL,REAL:],REAL st for x,y being real number holds f.(x,y)=F(x,y); scheme WLambda2D{F(rational number,rational number) -> rational number}: ex f being Function of [:RAT,RAT:],RAT st for x,y being rational number holds f.(x,y)=F(x,y); scheme ILambda2D{F(integer number,integer number) -> integer number}: ex f being Function of [:INT,INT:],INT st for x,y being integer number holds f.(x,y)=F(x,y); scheme NLambda2D{F(Nat,Nat) -> Nat}: ex f being Function of [:NAT,NAT:],NAT st for x,y being Nat holds f.(x,y)=F(x,y); scheme CLambdaD{F(complex number) -> complex number }: ex f being Function of COMPLEX,COMPLEX st for x being complex number holds f.x = F(x); scheme RLambdaD{F(real number) -> real number }: ex f being Function of REAL,REAL st for x being real number holds f.x = F(x); scheme WLambdaD{F(rational number) -> rational number }: ex f being Function of RAT,RAT st for x being rational number holds f.x = F(x); scheme ILambdaD{F(integer number) -> integer number }: ex f being Function of INT,INT st for x being integer number holds f.x = F(x); scheme NLambdaD{F(Nat) -> Nat }: ex f being Function of NAT,NAT st for x being Nat holds f.x = F(x); reserve c,c1,c2 for complex number; definition let c1; redefine func -c1 -> Element of COMPLEX; redefine func c1" -> Element of COMPLEX; let c2; redefine func c1+c2 -> Element of COMPLEX; redefine func c1-c2 -> Element of COMPLEX; redefine func c1*c2 -> Element of COMPLEX; redefine func c1/c2 -> Element of COMPLEX; end; reserve r,r1,r2 for real number; definition let r1; redefine func -r1 -> Element of REAL; redefine func r1" -> Element of REAL; let r2; redefine func r1+r2 -> Element of REAL; redefine func r1-r2 -> Element of REAL; redefine func r1*r2 -> Element of REAL; redefine func r1/r2 -> Element of REAL; end; reserve w,w1,w2 for rational number; definition let w1; redefine func -w1 -> Element of RAT; redefine func w1" -> Element of RAT; let w2; redefine func w1+w2 -> Element of RAT; redefine func w1-w2 -> Element of RAT; redefine func w1*w2 -> Element of RAT; redefine func w1/w2 -> Element of RAT; end; reserve i,i1,i2 for integer number; definition let i1; redefine func -i1 -> Element of INT; let i2; redefine func i1+i2 -> Element of INT; redefine func i1-i2 -> Element of INT; redefine func i1*i2 -> Element of INT; end; reserve n1,n2 for Nat; definition let n1,n2; redefine func n1+n2 -> Element of NAT; redefine func n1*n2 -> Element of NAT; end; definition func compcomplex -> UnOp of COMPLEX means for c holds it.c = -c; func invcomplex -> UnOp of COMPLEX means for c holds it.c = c"; func addcomplex -> BinOp of COMPLEX means for c1,c2 holds it.(c1,c2) = c1 + c2; func diffcomplex -> BinOp of COMPLEX means for c1,c2 holds it.(c1,c2) = c1 - c2; func multcomplex -> BinOp of COMPLEX means for c1,c2 holds it.(c1,c2) = c1 * c2; func divcomplex -> BinOp of COMPLEX means for c1,c2 holds it.(c1,c2) = c1 / c2; end; definition func compreal -> UnOp of REAL means for r holds it.r = -r; func invreal -> UnOp of REAL means for r holds it.r = r"; func addreal -> BinOp of REAL means for r1,r2 holds it.(r1,r2) = r1 + r2; func diffreal -> BinOp of REAL means for r1,r2 holds it.(r1,r2) = r1 - r2; func multreal -> BinOp of REAL means for r1,r2 holds it.(r1,r2) = r1 * r2; func divreal -> BinOp of REAL means for r1,r2 holds it.(r1,r2) = r1 / r2; end; definition func comprat -> UnOp of RAT means for w holds it.w = -w; func invrat -> UnOp of RAT means for w holds it.w = w"; func addrat -> BinOp of RAT means for w1,w2 holds it.(w1,w2) = w1 + w2; func diffrat -> BinOp of RAT means for w1,w2 holds it.(w1,w2) = w1 - w2; func multrat -> BinOp of RAT means for w1,w2 holds it.(w1,w2) = w1 * w2; func divrat -> BinOp of RAT means for w1,w2 holds it.(w1,w2) = w1 / w2; end; definition func compint -> UnOp of INT means for i holds it.i = -i; func addint -> BinOp of INT means for i1,i2 holds it.(i1,i2) = i1 + i2; func diffint -> BinOp of INT means for i1,i2 holds it.(i1,i2) = i1 - i2; func multint -> BinOp of INT means for i1,i2 holds it.(i1,i2) = i1 * i2; end; definition func addnat -> BinOp of NAT means for n1,n2 holds it.(n1,n2) = n1 + n2; func multnat -> BinOp of NAT means for n1,n2 holds it.(n1,n2) = n1 * n2; end; registration cluster addcomplex -> commutative associative; cluster multcomplex -> commutative associative; cluster addreal -> commutative associative; cluster multreal -> commutative associative; cluster addrat -> commutative associative; cluster multrat -> commutative associative; cluster addint -> commutative associative; cluster multint -> commutative associative; cluster addnat -> commutative associative; cluster multnat -> commutative associative; end; registration cluster addcomplex -> having_a_unity; cluster addreal -> having_a_unity; cluster addrat -> having_a_unity; cluster addint -> having_a_unity; cluster addnat -> having_a_unity; cluster multcomplex -> having_a_unity; cluster multreal -> having_a_unity; cluster multrat -> having_a_unity; cluster multint -> having_a_unity; cluster multnat -> having_a_unity; end; theorem the_unity_wrt addcomplex = 0; theorem the_unity_wrt addreal = 0; theorem the_unity_wrt addrat = 0; theorem the_unity_wrt addint = 0; theorem the_unity_wrt addnat = 0; theorem the_unity_wrt multcomplex = 1; theorem the_unity_wrt multreal = 1; theorem the_unity_wrt multrat = 1; theorem the_unity_wrt multint = 1; theorem the_unity_wrt multnat = 1; begin reserve x for set, p,q,r,s,t,u for ext-real number, a for Element of ExtREAL; scheme Conti { P,Q[set] }: ex s st (for r st P[r] holds r <= s) & for r st Q[r] holds s <= r provided for r,s st P[r] & Q[s] holds r <= s; begin definition let r,s; func [.r,s.] equals { a : r <= a & a <= s }; func [.r,s.[ equals { a : r <= a & a < s }; func ].r,s.] equals { a : r < a & a <= s }; func ].r,s.[ equals { a : r < a & a < s }; end; theorem t in [.r,s.] iff r <= t & t <= s; theorem t in ].r,s.] iff r < t & t <= s; theorem t in [.r,s.[ iff r <= t & t < s; theorem t in ].r,s.[ iff r < t & t < s; registration let r,s; cluster [.r,s.] -> ext-real-membered; cluster [.r,s.[ -> ext-real-membered; cluster ].r,s.] -> ext-real-membered; cluster ].r,s.[ -> ext-real-membered; end; theorem x in [.p,q.] implies x in ].p,q.[ or x = p or x = q; theorem x in [.p,q.] implies x in ].p,q.] or x = p; theorem x in [.p,q.] implies x in [.p,q.[ or x = q; theorem x in [.p,q.[ implies x in ].p,q.[ or x = p; theorem x in ].p,q.] implies x in ].p,q.[ or x = q; theorem x in [.p,q.[ implies x in ].p,q.] & x <> q or x = p; theorem x in ].p,q.] implies x in [.p,q.[ & x <> p or x = q; theorem x in ].p,q.] implies x in [.p,q.] & x <> p; theorem x in [.p,q.[ implies x in [.p,q.] & x <> q; theorem x in ].p,q.[ implies x in [.p,q.[ & x <> p; theorem x in ].p,q.[ implies x in ].p,q.] & x <> q; theorem x in ].p,q.[ implies x in [.p,q.] & x <> p & x <> q; theorem [.r,r.] = {r}; theorem [.r,r.[ = {}; theorem ].r,r.] = {}; theorem ].r,r.[ = {}; registration let r; cluster [.r,r.] -> non empty; cluster [.r,r.[ -> empty; cluster ].r,r.] -> empty; cluster ].r,r.[ -> empty; end; theorem ].p,q.[ c= ].p,q.]; theorem ].p,q.[ c= [.p,q.[; theorem ].p,q.] c= [.p,q.]; theorem [.p,q.[ c= [.p,q.]; theorem ].p,q.[ c= [.p,q.]; theorem p <= q implies ].q,p.] = {}; theorem p <= q implies [.q,p.[ = {}; theorem p <= q implies ].q,p.[ = {}; theorem p < q implies [.q,p.] = {}; theorem r <= s implies [.r,s.] is non empty; theorem p < q implies [.p,q.[ is non empty; theorem p < q implies ].p,q.] is non empty; theorem p < q implies ].p,q.[ is non empty; theorem p <= r & s <= q implies [.r,s.] c= [.p,q.]; theorem p <= r & s <= q implies [.r,s.[ c= [.p,q.]; theorem p <= r & s <= q implies ].r,s.] c= [.p,q.]; theorem p <= r & s <= q implies ].r,s.[ c= [.p,q.]; theorem p <= r & s <= q implies [.r,s.[ c= [.p,q.[; theorem p < r & s <= q implies [.r,s.] c= ].p,q.]; theorem p < r & s <= q implies [.r,s.[ c= ].p,q.]; theorem p <= r & s <= q implies ].r,s.[ c= ].p,q.]; theorem p <= r & s <= q implies ].r,s.] c= ].p,q.]; theorem p <= r & s < q implies [.r,s.] c= [.p,q.[; theorem p <= r & s < q implies ].r,s.] c= [.p,q.[; theorem p <= r & s <= q implies ].r,s.[ c= [.p,q.[; theorem p <= r & s <= q implies ].r,s.[ c= ].p,q.[; theorem p < r & s < q implies [.r,s.] c= ].p,q.[; theorem p < r & s <= q implies [.r,s.[ c= ].p,q.[; theorem p <= r & s < q implies ].r,s.] c= ].p,q.[; theorem r <= s & [.r,s.] c= [.p,q.] implies p <= r & s <= q; theorem r < s & ].r,s.[ c= [.p,q.] implies p <= r & s <= q; theorem r < s & [.r,s.[ c= [.p,q.] implies p <= r & s <= q; theorem r < s & ].r,s.] c= [.p,q.] implies p <= r & s <= q; theorem r <= s & [.r,s.] c= [.p,q.[ implies p <= r & s < q; theorem r < s & [.r,s.[ c= [.p,q.[ implies p <= r & s <= q; theorem r < s & ].r,s.[ c= [.p,q.[ implies p <= r & s <= q; theorem r < s & ].r,s.] c= [.p,q.[ implies p <= r & s < q; theorem r <= s & [.r,s.] c= ].p,q.] implies p < r & s <= q; theorem r < s & ].r,s.[ c= ].p,q.] implies p <= r & s <= q; theorem r < s & [.r,s.[ c= ].p,q.] implies p < r & s <= q; theorem r < s & ].r,s.] c= ].p,q.] implies p <= r & s <= q; theorem r <= s & [.r,s.] c= ].p,q.[ implies p < r & s < q; theorem r < s & ].r,s.[ c= ].p,q.[ implies p <= r & s <= q; theorem r < s & [.r,s.[ c= ].p,q.[ implies p < r & s <= q; theorem r < s & ].r,s.] c= ].p,q.[ implies p <= r & s < q; theorem p <= q & [.p,q.] = [.r,s.] implies p = r & q = s; theorem p < q & ].p,q.[ = ].r,s.[ implies p = r & q = s; theorem p < q & ].p,q.] = ].r,s.] implies p = r & q = s; theorem p < q & [.p,q.[ = [.r,s.[ implies p = r & q = s; theorem r <= s implies [.r,s.] <> ].p,q.]; theorem r <= s implies [.r,s.] <> [.p,q.[; theorem r <= s implies [.r,s.] <> ].p,q.[; theorem r < s implies [.r,s.[ <> [.p,q.]; theorem r < s implies [.r,s.[ <> ].p,q.]; theorem r < s implies [.r,s.[ <> ].p,q.[; theorem r < s implies ].r,s.] <> [.p,q.]; theorem r < s implies ].r,s.] <> [.p,q.[; theorem r < s implies ].r,s.] <> ].p,q.[; theorem r < s implies ].r,s.[ <> [.p,q.]; theorem r < s implies ].r,s.[ <> ].p,q.]; theorem r < s implies ].r,s.[ <> [.p,q.[; theorem r <= s & [.r,s.] c< [.p,q.] implies p < r or s < q; theorem r < s & ].r,s.[ c= [.p,q.] implies [.r,s.] c= [.p,q.]; theorem r < s implies [.s,p.[ c= ].r,p.[; theorem s <= r implies [.r,s.] c= {r} & [.r,s.] c= {s}; theorem ].r,s.[ misses {r,s}; theorem [.r,s.[ misses {s}; theorem ].r,s.] misses {r}; theorem s <= p implies [.r,s.] misses ].p,q.[; theorem s <= p implies [.r,s.] misses ].p,q.]; theorem s <= p implies ].r,s.] misses ].p,q.[; theorem s <= p implies ].r,s.] misses ].p,q.]; theorem s <= p implies ].r,s.[ misses [.p,q.]; theorem s <= p implies ].r,s.[ misses [.p,q.[; theorem s <= p implies [.r,s.[ misses [.p,q.]; theorem s <= p implies [.r,s.[ misses [.p,q.[; theorem r < p & r < s implies not ].r,s.[ c= [.p,q.]; theorem r < p & r < s implies not [.r,s.[ c= [.p,q.]; theorem r < p & r < s implies not ].r,s.] c= [.p,q.]; theorem r < p & r <= s implies not [.r,s.] c= [.p,q.]; theorem r < p & r < s implies not ].r,s.[ c= [.p,q.[; theorem r < p & r < s implies not ].r,s.] c= [.p,q.[; theorem r < p & r < s implies not [.r,s.[ c= [.p,q.[; theorem r < p & r <= s implies not [.r,s.] c= [.p,q.[; theorem r < p & r < s implies not ].r,s.[ c= ].p,q.]; theorem r <= p & r < s implies not [.r,s.[ c= ].p,q.]; theorem r < p & r < s implies not ].r,s.] c= ].p,q.]; theorem r <= p & r <= s implies not [.r,s.] c= ].p,q.]; theorem r <= p & r <= s implies not [.r,s.] c= ].p,q.[; theorem r <= p & r < s implies not [.r,s.[ c= ].p,q.[; theorem r < p & r < s implies not ].r,s.] c= ].p,q.[; theorem r < p & r < s implies not ].r,s.[ c= ].p,q.[; theorem q < s & r < s implies not ].r,s.[ c= [.p,q.]; theorem q < s & r < s implies not [.r,s.[ c= [.p,q.]; theorem q < s & r < s implies not ].r,s.] c= [.p,q.]; theorem q < s & r <= s implies not [.r,s.] c= [.p,q.]; theorem q < s & r < s implies not ].r,s.[ c= [.p,q.[; theorem q <= s & r < s implies not ].r,s.] c= [.p,q.[; theorem q < s & r < s implies not [.r,s.[ c= [.p,q.[; theorem q < s & r < s implies not ].r,s.[ c= ].p,q.]; theorem q < s & r <= s implies not [.r,s.] c= ].p,q.]; theorem q < s & r < s implies not [.r,s.[ c= ].p,q.]; theorem q < s & r < s implies not ].r,s.] c= ].p,q.]; theorem q <= s & r <= s implies not [.r,s.] c= ].p,q.[; theorem q < s & r < s implies not [.r,s.[ c= ].p,q.[; theorem q <= s & r < s implies not ].r,s.] c= ].p,q.[; theorem q < s & r < s implies not ].r,s.[ c= ].p,q.[; begin theorem r <= s implies [.r,s.] = ].r,s.[ \/ {r,s}; theorem r <= s implies [.r,s.] = [.r,s.[ \/ {s}; theorem r <= s implies [.r,s.] = {r} \/ ].r,s.]; theorem r < s implies [.r,s.[ = {r} \/ ].r,s.[; theorem r < s implies ].r,s.] = ].r,s.[ \/ {s}; theorem r <= s implies [.r,s.] \ {r,s} = ].r,s.[; theorem r <= s implies [.r,s.] \ {r} = ].r,s.]; theorem r <= s implies [.r,s.] \ {s} = [.r,s.[; theorem r < s implies [.r,s.[ \ {r} = ].r,s.[; theorem r < s implies ].r,s.] \ {s} = ].r,s.[; theorem r < s & s < t implies ].r,s.] /\ [.s,t.[ = {s}; theorem [.r,s.[ /\ [.p,q.[ = [.max(r,p),min(s,q).[; theorem [.r,s.] /\ [.p,q.] = [.max(r,p),min(s,q).]; theorem ].r,s.] /\ ].p,q.] = ].max(r,p),min(s,q).]; theorem ].r,s.[ /\ ].p,q.[ = ].max(r,p),min(s,q).[; theorem r <= p & s <= q implies [.r,s.] /\ [.p,q.] = [.p,s.]; theorem r <= p & s <= q implies [.r,s.[ /\ [.p,q.] = [.p,s.[; theorem r >= p & s > q implies [.r,s.[ /\ [.p,q.] = [.r,q.]; theorem r < p & s <= q implies ].r,s.] /\ [.p,q.] = [.p,s.]; theorem r >= p & s >= q implies ].r,s.] /\ [.p,q.] = ].r,q.]; theorem r < p & s <= q implies ].r,s.[ /\ [.p,q.] = [.p,s.[; theorem r >= p & s > q implies ].r,s.[ /\ [.p,q.] = ].r,q.]; theorem r <= p & s <= q implies [.r,s.[ /\ [.p,q.[ = [.p,s.[; theorem r >= p & s >= q implies [.r,s.[ /\ [.p,q.[ = [.r,q.[; theorem r < p & s < q implies ].r,s.] /\ [.p,q.[ = [.p,s.]; theorem r >= p & s >= q implies ].r,s.] /\ [.p,q.[ = ].r,q.[; theorem r < p & s <= q implies ].r,s.[ /\ [.p,q.[ = [.p,s.[; theorem r >= p & s >= q implies ].r,s.[ /\ [.p,q.[ = ].r,q.[; theorem r <= p & s <= q implies ].r,s.] /\ ].p,q.] = ].p,s.]; theorem r >= p & s >= q implies ].r,s.] /\ ].p,q.] = ].r,q.]; theorem r <= p & s <= q implies ].r,s.[ /\ ].p,q.] = ].p,s.[; theorem r >= p & s > q implies ].r,s.[ /\ ].p,q.] = ].r,q.]; theorem r <= p & s <= q implies ].r,s.[ /\ ].p,q.[ = ].p,s.[; theorem [.r,s.[ \/ [.p,q.[ c= [.min(r,p),max(s,q).[; theorem [.r,s.[ meets [.p,q.[ implies [.r,s.[ \/ [.p,q.[ = [.min(r,p),max(s,q).[; theorem ].r,s.] \/ ].p,q.] c= ].min(r,p),max(s,q).]; theorem ].r,s.] meets ].p,q.] implies ].r,s.] \/ ].p,q.] = ].min(r,p),max(s,q).]; theorem r <= s & s <= t implies [.r,s.] \/ [.s,t.] = [.r,t.]; theorem r <= s & s <= t implies [.r,s.[ \/ [.s,t.] = [.r,t.]; theorem r <= s & s <= t implies [.r,s.] \/ ].s,t.] = [.r,t.]; theorem r <= s & s <= t implies [.r,s.[ \/ [.s,t.[ = [.r,t.[; theorem r <= s & s < t implies [.r,s.] \/ ].s,t.[ = [.r,t.[; theorem r <= s & s <= t implies ].r,s.] \/ ].s,t.] = ].r,t.]; theorem r <= s & s < t implies ].r,s.] \/ ].s,t.[ = ].r,t.[; theorem r < s & s < t implies ].r,s.] \/ [.s,t.[ = ].r,t.[; theorem r < s & s < t implies ].r,s.[ \/ [.s,t.[ = ].r,t.[; theorem p <= s & r <= q & s <= r implies [.p,r.] \/ [.s,q.] = [.p,q.]; theorem p <= s & r <= q & s < r implies [.p,r.[ \/ ].s,q.] = [.p,q.]; theorem p <= s & s <= r & r < q implies [.p,r.] \/ [.s,q.[ = [.p,q.[; theorem p < s & r <= q & s <= r implies ].p,r.] \/ [.s,q.] = ].p,q.]; theorem p < s & r < q & s <= r implies ].p,r.] \/ [.s,q.[ = ].p,q.[; theorem p<=r & p<=s & r<=q & s<=q implies [.p,r.[ \/ [.r,s.] \/ ].s,q.] = [.p,q.]; theorem p -infty implies [.p,-infty.] = {}; theorem ].+infty,p.[ = {}; theorem [.+infty,p.[ = {}; theorem ].+infty,p.] = {}; theorem p <> +infty implies [.+infty,p.] = {}; theorem p > q implies p in ].q, +infty.]; theorem q <= p implies p in [.q, +infty.]; theorem p <= q implies p in [.-infty,q.]; theorem p < q implies p in [.-infty, q.[; begin theorem p <= q implies [.p,q.] = [.p,q.] \/ [.q,p.]; theorem r <= s & s <= t implies not r in ].s,t.[ \/ ].t,p.[; theorem REAL = ].-infty,+infty.[; theorem ].p,q.[ c= REAL; theorem p in REAL implies [.p,q.[ c= REAL; theorem q in REAL implies ].p,q.] c= REAL; theorem p in REAL & q in REAL implies [.p,q.] c= REAL; registration let p,q; cluster ].p,q.[ -> real-membered; end; registration let p be real number, q; cluster [.p,q.[ -> real-membered; end; registration let q be real number, p; cluster ].p,q.] -> real-membered; end; registration let p,q be real number; cluster [.p,q.] -> real-membered; end; theorem ].-infty,s.[ = {g where g is Real : g {} & ex x st x in Y; theorem bool X,bool card X are_equipotent & card bool X = card bool card X; theorem Z in Funcs(X,Y) implies Z,X are_equipotent & card Z = card X; definition let M,N; func M +` N -> Cardinal equals card( M +^ N); commutativity; func M *` N -> Cardinal equals card [:M,N:]; commutativity; func exp(M,N) -> Cardinal equals card Funcs(N,M); end; theorem [:X,Y:],[:Y,X:] are_equipotent & card [:X,Y:] = card [:Y,X:]; theorem [:[:X,Y:],Z:],[:X,[:Y,Z:]:] are_equipotent & card [:[:X,Y:],Z:] = card [:X,[:Y,Z:]:]; theorem X,[:X,{x}:] are_equipotent & card X = card [:X,{x}:]; theorem [:X,Y:],[:card X,Y:] are_equipotent & [:X,Y:],[:X,card Y:] are_equipotent & [:X,Y:],[:card X,card Y:] are_equipotent & card [:X,Y:] = card [:card X,Y:] & card [:X,Y:] = card [:X,card Y:] & card [:X,Y:] = card [:card X, card Y:]; theorem X1,Y1 are_equipotent & X2,Y2 are_equipotent implies [:X1,X2:],[: Y1,Y2:] are_equipotent & card [:X1,X2:] = card [:Y1,Y2:]; theorem x1 <> x2 implies A+^B,[:A,{x1}:] \/ [:B,{x2}:] are_equipotent & card(A +^B) = card([:A,{x1}:] \/ [:B,{x2}:]); theorem x1 <> x2 implies K+`M,[:K,{x1}:] \/ [:M,{x2}:] are_equipotent & K+`M = card([:K,{x1}:] \/ [:M,{x2}:]); theorem A*^B,[:A,B:] are_equipotent & card(A*^B) = card [:A,B:]; theorem X1,Y1 are_equipotent & X2,Y2 are_equipotent & x1 <> x2 & y1 <> y2 implies [:X1,{x1}:] \/ [:X2,{x2}:],[:Y1,{y1}:] \/ [:Y2,{y2}:] are_equipotent & card ([:X1,{x1}:] \/ [:X2,{x2}:]) = card ([:Y1,{y1}:] \/ [:Y2,{y2}:]); theorem card(A+^B) = card A +` card B; theorem card(A*^B) = card A *` card B; theorem [:X,{0}:] \/ [:Y,{1}:],[:Y,{0}:] \/ [:X,{1}:] are_equipotent & card([: X,{0}:] \/ [:Y,{1}:]) = card([:Y,{0}:] \/ [:X,{1}:]); theorem [:X1,X2:] \/ [:Y1,Y2:],[:X2,X1:] \/ [:Y2,Y1:] are_equipotent & card ([:X1,X2:] \/ [:Y1,Y2:]) = card ([:X2,X1:] \/ [:Y2,Y1:]); theorem x <> y implies card X +` card Y = card([:X,{x}:] \/ [:Y,{y}:]); theorem M+`0 = M; theorem (K+`M)+`N = K+`(M+`N); theorem K*`0 = 0; theorem K*`1 = K; theorem (K*`M)*`N = K*`(M*`N); theorem 2*`K = K+`K; theorem K*`(M+`N) = K*`M +` K*`N; theorem exp(K,0) = 1; theorem K <> 0 implies exp(0,K) = 0; theorem exp(K,1) = K & exp(1,K) = 1; theorem exp(K,M+`N) = exp(K,M)*`exp(K,N); theorem exp(K*`M,N) = exp(K,N)*`exp(M,N); theorem exp(K,M*`N) = exp(exp(K,M),N); theorem exp(2,card X) = card bool X; theorem exp(K,2) = K*`K; theorem exp(K+`M,2) = K*`K +` 2*`K*`M +` M*`M; theorem card(X \/ Y) c= card X +` card Y; theorem X misses Y implies card (X \/ Y) = card X +` card Y; reserve m,n for Element of NAT; theorem n+m = n +^ m; theorem n*m = n *^ m; theorem card(n+m) = card n +` card m; theorem card(n*m) = card n *` card m; theorem for X,Y being finite set st X misses Y holds card (X \/ Y) = card X + card Y; theorem for X being finite set st not x in X holds card (X \/ {x}) = card X + 1; theorem for X being set holds card X = 1 iff ex x st X = {x}; theorem for X,Y being finite set holds card(X \/ Y) <= card X + card Y; theorem for X,Y being finite set st Y c= X holds card (X \ Y) = card X - card Y; theorem for X,Y being finite set holds card (X \/ Y) = card X + card Y - card (X /\ Y); theorem for X,Y being finite set holds card [:X,Y:] = card X * card Y; theorem for f being finite Function holds card rng f <= card dom f; theorem for X,Y being finite set st X c< Y holds card X < card Y & card X in card Y; theorem (card X c= card Y or card X in card Y) & Y is finite implies X is finite; reserve x1,x2,x3,x4,x5,x6,x7,x8 for set; theorem card {x1,x2} <= 2; theorem card {x1,x2,x3} <= 3; theorem card {x1,x2,x3,x4} <= 4; theorem card {x1,x2,x3,x4,x5} <= 5; theorem card {x1,x2,x3,x4,x5,x6} <= 6; theorem card {x1,x2,x3,x4,x5,x6,x7} <= 7; theorem card {x1,x2,x3,x4,x5,x6,x7,x8} <= 8; theorem x1 <> x2 implies card {x1,x2} = 2; theorem x1 <> x2 & x1 <> x3 & x2 <> x3 implies card {x1,x2,x3} = 3; theorem x1 <> x2 & x1 <> x3 & x1 <> x4 & x2 <> x3 & x2 <> x4 & x3 <> x4 implies card {x1,x2,x3,x4} = 4; begin theorem for X being set st card X = 2 ex x,y st x <> y & X = {x,y}; theorem for f being Function holds card rng f c= card dom f; theorem Z <> {} & Z is finite & (for X,Y st X in Z & Y in Z holds X c= Y or Y c= X) implies union Z in Z; theorem x1,x2,x3,x4,x5 are_mutually_different implies card {x1,x2,x3,x4,x5} = 5; theorem for M1, M2 being set st card M1 = 0 & card M2 = 0 holds M1 = M2; registration let x,y; cluster [x,y] -> non natural; end; begin reserve A,B,C for Ordinal, K,L,M,N for Cardinal, x,y,y1,y2,z,u,X,Y,Z,Z1,Z2 for set, n for Nat, f,f1,g,h for Function, Q,R for Relation; theorem Sum(M --> N) = M*`N; theorem Product(N --> M) = exp(M,N); scheme FinRegularity { X()->finite set, P[set,set] }: ex x st x in X() & for y st y in X() & y <> x holds not P[y,x] provided X() <> {} and for x,y st P[x,y] & P[y,x] holds x = y and for x,y,z st P[x,y] & P[y,z] holds P[x,z]; scheme MaxFinSetElem { X()->finite set, P[set,set] }: ex x st x in X() & for y st y in X() holds P[x,y] provided X() <> {} and for x,y holds P[x,y] or P[y,x] and for x,y,z st P[x,y] & P[y,z] holds P[x,z]; theorem Rank n is finite; theorem 0 in M iff 1 c= M; theorem 1 in M iff 2 c= M; reserve n,k for Nat; theorem A is limit_ordinal iff for B,n st B in A holds B+^ n in A; theorem A+^succ n = succ A +^ n & A +^ (n+1) = succ A +^ n; theorem ex n st A*^succ 1 = A +^ n; theorem A is limit_ordinal implies A *^ succ 1 = A; theorem omega c= A implies 1+^A = A; registration cluster infinite -> limit_ordinal for Cardinal; end; theorem not M is finite implies M+`M = M; theorem not M is finite & (N c= M or N in M) implies M+`N = M & N+`M = M; theorem not X is finite & (X,Y are_equipotent or Y,X are_equipotent) implies X \/ Y,X are_equipotent & card (X \/ Y) = card X; theorem not X is finite & Y is finite implies X \/ Y,X are_equipotent & card (X \/ Y) = card X; theorem not X is finite & (card Y in card X or card Y c= card X) implies X \/ Y,X are_equipotent & card (X \/ Y) = card X; theorem for M,N being finite Cardinal holds M+`N is finite; theorem not M is finite implies not M+`N is finite & not N+`M is finite; theorem for M,N being finite Cardinal holds M*`N is finite; theorem K in L & M in N or K c= L & M in N or K in L & M c= N or K c= L & M c= N implies K+`M c= L+`N & M+`K c= L+`N; theorem M in N or M c= N implies K+`M c= K+`N & K+`M c= N+`K & M+`K c= K+`N & M+`K c= N+`K; theorem X is countable & Y is countable implies X \/ Y is countable; theorem (card dom f c= M & for x st x in dom f holds card (f.x) c= N) implies card Union f c= M*`N; theorem (card X c= M & for Y st Y in X holds card Y c= N) implies card union X c= M*`N; theorem for f st dom f is finite & for x st x in dom f holds f.x is finite holds Union f is finite; theorem (omega)*`(card n) c= omega & (card n)*`(omega) c= omega; theorem K in L & M in N or K c= L & M in N or K in L & M c= N or K c= L & M c= N implies K*`M c= L*`N & M*`K c= L*`N; theorem M in N or M c= N implies K*`M c= K*`N & K*`M c= N*`K & M*`K c= K*`N & M*`K c= N*`K; theorem K in L & M in N or K c= L & M in N or K in L & M c= N or K c= L & M c= N implies K = 0 or exp(K,M) c= exp(L,N); theorem M in N or M c= N implies K = 0 or exp(K,M) c= exp(K,N) & exp(M,K) c= exp(N,K); theorem M c= M+`N & N c= M+`N; theorem N <> 0 implies M c= M*`N & M c= N*`M; theorem K in L & M in N implies K+`M in L+`N & M+`K in L+`N; theorem K+`M in K+`N implies M in N; theorem card X +` card Y = card X & card Y in card X implies card (X \ Y) = card X; theorem K*`M in K*`N implies M in N; theorem X is countable & Y is countable implies X \+\ Y is countable; registration let A be finite set, B be set, f be Function of A, Fin B; cluster Union f -> finite; end; registration let f be finite finite-yielding Function; cluster product f -> finite; end; theorem for F be Function st dom F is infinite & rng F is finite ex x st x in rng F & F"{x} is infinite; begin scheme FinInter{m, n() -> Integer, F(set)->set, P[set]}: {F(i) where i is Element of INT: m()<=i & i<=n() & P[i]} is finite; reserve x,y,z,r,s for ext-real number; definition let X be ext-real-membered set; mode UpperBound of X -> ext-real number means x in X implies x <= it; mode LowerBound of X -> ext-real number means x in X implies it <= x; end; definition let X be ext-real-membered set; func sup X -> ext-real number means it is UpperBound of X & for x being UpperBound of X holds it <= x; func inf X -> ext-real number means it is LowerBound of X & for x being LowerBound of X holds x <= it; end; definition let X be ext-real-membered set; attr X is left_end means inf X in X; attr X is right_end means sup X in X; end; theorem y is UpperBound of {x} iff x <= y; theorem y is LowerBound of {x} iff y <= x; registration cluster -> ext-real-membered for Element of Fin ExtREAL; end; reserve A,B for ext-real-membered set; theorem x in A implies inf A <= x; theorem x in A implies x <= sup A; theorem B c= A implies for x being LowerBound of A holds x is LowerBound of B; theorem B c= A implies for x being UpperBound of A holds x is UpperBound of B; theorem for x being LowerBound of A, y being LowerBound of B holds min(x, y) is LowerBound of A\/ B; theorem for x being UpperBound of A, y being UpperBound of B holds max(x, y) is UpperBound of A\/ B; theorem inf(A \/ B) = min(inf A,inf B); theorem sup(A \/ B) = max(sup A,sup B); registration cluster finite -> left_end right_end for non empty ext-real-membered set; end; registration cluster -> left_end for non empty natural-membered set; end; registration cluster right_end for non empty natural-membered set; end; notation let X be left_end ext-real-membered set; synonym min X for inf X; end; notation let X be right_end ext-real-membered set; synonym max X for sup X; end; definition let X be left_end ext-real-membered set; redefine func min X means it in X & for x st x in X holds it <= x; end; definition let X be right_end ext-real-membered set; redefine func max X means it in X & for x st x in X holds x <= it; end; theorem max{x} = x; theorem max(x,y) = max{x,y}; theorem min{x} = x; theorem min{x,y} = min(x,y); definition let X be ext-real-membered set; attr X is bounded_below means ex r being real number st r is LowerBound of X; attr X is bounded_above means ex r being real number st r is UpperBound of X; end; registration cluster non empty finite natural-membered for set; end; definition let X be ext-real-membered set; attr X is real-bounded means X is bounded_below bounded_above; end; registration cluster real-bounded -> bounded_above bounded_below for ext-real-membered set; cluster bounded_above bounded_below -> real-bounded for ext-real-membered set; end; registration cluster finite -> real-bounded for real-membered set; end; registration cluster real-bounded for non empty natural-membered set; end; theorem for X being non empty real-membered set st X is bounded_below holds inf X in REAL; theorem for X being non empty real-membered set st X is bounded_above holds sup X in REAL; registration let X be bounded_above non empty real-membered set; cluster sup X -> real; end; registration let X be bounded_below non empty real-membered set; cluster inf X -> real; end; registration cluster bounded_above -> right_end for non empty integer-membered set; end; registration cluster bounded_below -> left_end for non empty integer-membered set; end; registration cluster -> bounded_below for natural-membered set; end; registration let X be left_end real-membered set; cluster min X -> real; end; registration let X be left_end rational-membered set; cluster min X -> rational; end; registration let X be left_end integer-membered set; cluster min X -> integer; end; registration let X be left_end natural-membered set; cluster min X -> natural; end; registration let X be right_end real-membered set; cluster max X -> real; end; registration let X be right_end rational-membered set; cluster max X -> rational; end; registration let X be right_end integer-membered set; cluster max X -> integer; end; registration let X be right_end natural-membered set; cluster max X -> natural; end; registration cluster left_end -> bounded_below for real-membered set; cluster right_end -> bounded_above for real-membered set; end; theorem x is LowerBound of [.x,y.]; theorem x is LowerBound of ].x,y.]; theorem x is LowerBound of [.x,y.[; theorem x is LowerBound of ].x,y.[; theorem y is UpperBound of [.x,y.]; theorem y is UpperBound of ].x,y.]; theorem y is UpperBound of [.x,y.[; theorem y is UpperBound of ].x,y.[; theorem x <= y implies inf [.x,y.] = x; theorem x < y implies inf [.x,y.[ = x; theorem x < y implies inf ].x,y.] = x; theorem x < y implies inf ].x,y.[ = x; theorem x <= y implies sup [.x,y.] = y; theorem x < y implies sup ].x,y.] = y; theorem x < y implies sup [.x,y.[ = y; theorem x < y implies sup ].x,y.[ = y; theorem x <= y implies [.x,y.] is left_end right_end; theorem x < y implies [.x,y.[ is left_end; theorem x < y implies ].x,y.] is right_end; theorem x is LowerBound of {}; theorem x is UpperBound of {}; theorem inf {} = +infty; theorem sup {} = -infty; theorem for X being ext-real-membered set holds X is non empty iff inf X <= sup X; registration cluster real-bounded -> finite for integer-membered set; end; registration cluster -> finite for bounded_above natural-membered set; end; theorem for X being ext-real-membered set holds +infty is UpperBound of X; theorem for X being ext-real-membered set holds -infty is LowerBound of X; theorem for X,Y being ext-real-membered set st X c= Y & Y is bounded_above holds X is bounded_above; theorem for X,Y being ext-real-membered set st X c= Y & Y is bounded_below holds X is bounded_below; theorem for X,Y being ext-real-membered set st X c= Y & Y is real-bounded holds X is real-bounded; theorem REAL is non bounded_below non bounded_above; registration cluster REAL -> non bounded_below non bounded_above; end; theorem {+infty} is bounded_below; theorem {-infty} is bounded_above; theorem for X being bounded_above non empty ext-real-membered set st X <> {-infty} holds ex x being Element of REAL st x in X; theorem for X being bounded_below non empty ext-real-membered set st X <> {+infty} holds ex x being Element of REAL st x in X; theorem for X being ext-real-membered set st -infty is UpperBound of X holds X c= {-infty}; theorem for X being ext-real-membered set st +infty is LowerBound of X holds X c= {+infty}; theorem for X being non empty ext-real-membered set st ex y being UpperBound of X st y <> +infty holds X is bounded_above; theorem for X being non empty ext-real-membered set st ex y being LowerBound of X st y <> -infty holds X is bounded_below; theorem for X being non empty ext-real-membered set, x being UpperBound of X st x in X holds x = sup X; theorem for X being non empty ext-real-membered set, x being LowerBound of X st x in X holds x = inf X; theorem for X being non empty ext-real-membered set st X is bounded_above & X <> {-infty} holds sup X in REAL; theorem for X being non empty ext-real-membered set st X is bounded_below & X <> {+infty} holds inf X in REAL; theorem for X,Y being ext-real-membered set st X c= Y holds sup X <= sup Y; theorem for X,Y being ext-real-membered set st X c= Y holds inf Y <= inf X; theorem for X being ext-real-membered set, x being ext-real number st (ex y being ext-real number st y in X & x <= y) holds x <= sup X; theorem for X being ext-real-membered set, x being ext-real number st (ex y being ext-real number st y in X & y <= x) holds inf X <= x; theorem for X,Y being ext-real-membered set st for x being ext-real number st x in X ex y being ext-real number st y in Y & x <= y holds sup X <= sup Y; theorem for X,Y being ext-real-membered set st for y being ext-real number st y in Y ex x being ext-real number st x in X & x <= y holds inf X <= inf Y; theorem for X,Y being ext-real-membered set, x being UpperBound of X, y being UpperBound of Y holds min(x,y) is UpperBound of X /\ Y; theorem for X,Y being ext-real-membered set, x being LowerBound of X, y being LowerBound of Y holds max(x,y) is LowerBound of X /\ Y; theorem for X,Y being ext-real-membered set holds sup(X /\ Y) <= min(sup X,sup Y); theorem for X,Y being ext-real-membered set holds max(inf X,inf Y) <= inf(X /\ Y); registration cluster real-bounded -> real-membered for ext-real-membered set; end; theorem A c= [.inf A, sup A.]; theorem sup A = inf A implies A = {inf A}; theorem x <= y & x is UpperBound of A implies y is UpperBound of A; theorem y <= x & x is LowerBound of A implies y is LowerBound of A; theorem A is bounded_above iff sup A <> +infty; theorem A is bounded_below iff inf A <> -infty; begin definition let A be ext-real-membered set; attr A is interval means for r,s being ext-real number st r in A & s in A holds [.r,s.] c= A; end; registration cluster ExtREAL -> interval; cluster empty -> interval for ext-real-membered set; let r,s; cluster [.r,s.] -> interval; cluster ].r,s.] -> interval; cluster [.r,s.[ -> interval; cluster ].r,s.[ -> interval; end; registration cluster REAL -> interval; end; registration cluster interval for non empty ext-real-membered set; end; registration let A,B be interval ext-real-membered set; cluster A /\ B -> interval; end; reserve A,B for ext-real-membered set; registration let r,s; cluster ].r,s.] -> non left_end; cluster [.r,s.[ -> non right_end; cluster ].r,s.[ -> non left_end non right_end; end; registration cluster left_end right_end interval for ext-real-membered set; cluster non left_end right_end interval for ext-real-membered set; cluster left_end non right_end interval for ext-real-membered set; cluster non left_end non right_end interval non empty for ext-real-membered set; end; theorem for A being left_end right_end interval ext-real-membered set holds A = [.min A, max A.]; theorem for A being non left_end right_end interval ext-real-membered set holds A = ].inf A, max A.]; theorem for A being left_end non right_end interval ext-real-membered set holds A = [.min A, sup A.[; theorem for A being non left_end non right_end non empty interval ext-real-membered set holds A =].inf A,sup A.[; theorem for A being non left_end non right_end interval ext-real-membered set ex r,s st r <= s & A =].r,s.[; theorem A is interval implies for x,y,r st x in A & y in A & x <= r & r <= y holds r in A; theorem A is interval implies for x,r st x in A & x <= r & r < sup A holds r in A; theorem A is interval implies for x,r st x in A & inf A < r & r <= x holds r in A; theorem A is interval implies for r st inf A < r & r < sup A holds r in A; theorem (for x,y,r st x in A & y in A & x < r & r < y holds r in A) implies A is interval; theorem (for x,r st x in A & x < r & r < sup A holds r in A) implies A is interval; theorem (for y,r st y in A & inf A < r & r < y holds r in A) implies A is interval; theorem (for r st inf A < r & r < sup A holds r in A) implies A is interval; theorem (for x,y,r st x in A & y in A & x <= r & r <= y holds r in A) implies A is interval; theorem A is interval & B is interval & A meets B implies A \/ B is interval; theorem A is interval & B is left_end interval & sup A = inf B implies A \/ B is interval; theorem A is right_end interval & B is interval & sup A = inf B implies A \/ B is interval; registration cluster left_end -> non empty for ext-real-membered set; cluster right_end -> non empty for ext-real-membered set; end; theorem for A being non empty Subset of ExtREAL st for r being Element of ExtREAL st r in A holds r <= -infty holds A = {-infty}; theorem for A being non empty Subset of ExtREAL st for r being Element of ExtREAL st r in A holds +infty <= r holds A = {+infty}; theorem for A being non empty Subset of ExtREAL, r being ext-real number st r < sup A ex s being Element of ExtREAL st s in A & r < s; theorem for A being non empty Subset of ExtREAL, r being Element of ExtREAL st inf A < r ex s being Element of ExtREAL st s in A & s < r; theorem for A,B being non empty Subset of ExtREAL st for r,s being Element of ExtREAL st r in A & s in B holds r <= s holds sup A <= inf B; begin reserve x,y,z,w for ext-real number, r for real number; definition let x,y; redefine pred x <= y means ex p,q being Element of REAL st p = x & q = y & p <= q if x in REAL & y in REAL otherwise x = -infty or y = +infty; end; registration cluster non real positive for ext-real number; cluster non real negative for ext-real number; end; theorem for x being non real positive ext-real number holds x = +infty; theorem for x being non real negative ext-real number holds x = -infty; registration cluster non real non negative -> positive for ext-real number; cluster non real non positive -> negative for ext-real number; end; theorem x < z implies ex y being real number st x < y & y < z; begin definition let x,y; func x + y -> ext-real number means ex a,b being complex number st x = a & y = b & it = a + b if x is real & y is real, it = +infty if x = +infty & y <> -infty or y = +infty & x <> -infty, it = -infty if x = -infty & y <> +infty or y = -infty & x <> +infty otherwise it = 0; commutativity; end; definition let x; func -x -> ext-real number means ex a being complex number st x = a & it = -a if x is real, it = -infty if x = +infty otherwise it = +infty; involutiveness; end; definition let x,y; func x - y -> ext-real number equals x + -y; end; registration let x,y be real number, a,b be complex number; identify x+y with a+b when x = a, y = b; end; registration let x be real number, a be complex number; identify -x with -a when x = a; end; registration let r be real number; cluster -r -> real; end; registration let r,s be real number; cluster r+s -> real; cluster r-s -> real; end; registration let x be real number, y be non real ext-real number; cluster x+y -> non real for number; end; registration let x,y be non real positive ext-real number; cluster x+y -> non real; end; registration let x,y be non real negative ext-real number; cluster x+y -> non real; end; registration let x be non real negative ext-real number, y be non real positive ext-real number; cluster x+y -> zero; end; registration let x,y be real number, a,b be complex number; identify x-y with a-b when x = a, y = b; end; theorem x + 0 = x; theorem --infty = +infty; theorem -+infty = -infty; theorem x + -x = 0; theorem x+y = 0 implies x = -y; theorem -(x+y) = -x + -y; reserve f,g for ext-real number; theorem -f = -g implies f = g; theorem r+f = r+g implies f = g; theorem r-f = r-g implies f = g; theorem x <> +infty implies +infty - x = +infty & x - +infty = -infty; theorem x <> -infty implies -infty - x = -infty & x - -infty = +infty; theorem x - 0 = x; theorem x + y = +infty implies x = +infty or y = +infty; theorem x + y = -infty implies (x = -infty or y = -infty); theorem x - y = +infty implies (x = +infty or y = -infty); theorem x - y = -infty implies (x = -infty or y = +infty); theorem not ( x = +infty & y = -infty or x = -infty & y = +infty ) & x + y in REAL implies x in REAL & y in REAL; theorem not ( x = +infty & y = +infty or x = -infty & y = -infty ) & x - y in REAL implies x in REAL & y in REAL; theorem x is real implies y - x + x = y & y + x - x = y; theorem (x = +infty iff -x = -infty) & (x = -infty iff -x = +infty); theorem z is real implies x = x + z - z; theorem -(x + y) = -y - x; theorem -(x - y) = -x + y & -(x - y) = y - x; theorem -(-x + y) = x - y & -(-x + y) = x + -y; theorem 0 <= y & y < +infty implies z = z + y - y; theorem not (x = +infty & y = -infty) & not (x = -infty & y = +infty) & not ( y = +infty & z = -infty or y = -infty & z = +infty ) & not ( x = +infty & z = -infty or x = -infty & z = +infty ) implies x + y + z = x + (y + z); theorem not (x = +infty & y = -infty) & not (x = -infty & y = +infty) & not (y = +infty & z = +infty) & not (y = -infty & z = -infty) & not (x = +infty & z = +infty) & not (x = -infty & z = -infty) implies x + y - z = x + (y - z) ; theorem not (x = +infty & y = +infty) & not (x = -infty & y = -infty) & not (y = +infty & z = -infty) & not (y = -infty & z = +infty) & not (x = +infty & z = +infty) & not (x = -infty & z = -infty) implies x - y - z = x - (y + z); theorem not (x = +infty & y = +infty) & not (x = -infty & y = -infty) & not (y = +infty & z = +infty) & not (y = -infty & z = -infty) & not (x = +infty & z = -infty) & not (x = -infty & z = +infty) implies x - y + z = x - (y - z) ; theorem z is real implies (z + x) - (z + y) = x - y; theorem y is real implies (z - y) + (y - x) = z - x; begin registration let x,y be non negative ext-real number; cluster x + y -> non negative; end; registration let x,y be non positive ext-real number; cluster x + y -> non positive; end; registration let x be positive ext-real number; let y be non negative ext-real number; cluster x + y -> positive; cluster y + x -> positive; end; registration let x be negative ext-real number; let y be non positive ext-real number; cluster x + y -> negative; cluster y + x -> negative; end; registration let x be non positive ext-real number; cluster -x -> non negative; end; registration let x be non negative ext-real number; cluster -x -> non positive; end; registration let x be positive ext-real number; cluster -x -> negative; end; registration let x be negative ext-real number; cluster -x -> positive; end; registration let x be non negative ext-real number, y be non positive ext-real number; cluster x - y -> non negative; cluster y - x -> non positive; end; registration let x be positive ext-real number; let y be non positive ext-real number; cluster x - y -> positive; cluster y - x -> negative; end; registration let x be negative ext-real number; let y be non negative ext-real number; cluster x - y -> negative; cluster y - x -> positive; end; theorem x <= y implies x + z <= y + z; theorem x <= y & z <= w implies x + z <= y + w; theorem x <= y & z <= w implies x - w <= y - z; theorem x <= y iff - y <= - x; theorem 0 <= z implies x <= x + z; theorem x <= y implies y-x >= 0; theorem (z = -infty & y = +infty implies x <= 0) & (z = +infty & y = -infty implies x <= 0) implies (x - y <= z implies x <= z + y); theorem (x = +infty & y = +infty implies 0 <= z) & (x = -infty & y = -infty implies 0 <= z) implies (x <= z + y implies x - y <= z); theorem z in REAL & x < y implies x + z < y + z & x - z < y - z; theorem 0<= x & 0<= y & 0<= z implies (x + y) + z = x + (y + z); theorem x is real implies (y + x <= z iff y <= z - x); theorem 0 < x & x < y implies 0 < y - x; theorem 0 <= x & 0 <= z & z + x < y implies z < y - x; theorem 0 <= x & 0 <= z & z + x < y implies z <= y; theorem 0 <= x & x < z implies ex y being real number st 0 < y & x + y < z; theorem 0 < x implies ex y being real number st 0 < y & y + y < x; theorem x < y & x < +infty & -infty < y implies 0 < y- x; theorem not ( x = +infty & y = -infty or x = -infty & y = +infty ) & x + y < z implies x <> +infty & y <> +infty & z <> -infty & x < z - y; theorem not ( z = +infty & y = +infty or z = -infty & y = -infty ) & x < z - y implies x <> +infty & y <> +infty & z <> -infty & x + y < z; theorem not ( x = +infty & y = +infty or x = -infty & y = -infty ) & x - y < z implies x <> +infty & y <> -infty & z <> -infty & x < z + y; theorem not ( z = +infty & y = -infty or z = -infty & y = +infty ) & x < z + y implies x <> +infty & y <> -infty & z <> -infty & x - y < z; theorem not ( x = +infty & y = -infty or x = -infty & y = +infty or y = +infty & z = +infty or y = -infty & z = -infty ) & x + y <= z implies y <> +infty & x <= z - y; theorem not (x = +infty & y = -infty) & not (x = -infty & y = +infty) & not (y = +infty & z = +infty) & x <= z - y implies y <> +infty & x + y <= z; theorem not ( x = +infty & y = +infty or x = -infty & y = -infty or y = +infty & z = -infty or y = -infty & z = +infty ) & x - y <= z implies y <> -infty; theorem not (x = -infty & y = -infty) & not (y = -infty & z = +infty) & x <= z + y implies y <> -infty; theorem (x <= -y implies y <= -x) & (-x <= y implies -y <= x); theorem (for e be real number st 0 < e holds x < y + e) implies x <= y; reserve t for ext-real number; theorem t <> -infty & t <> +infty & x < y implies x + t < y + t; theorem t <> -infty & t <> +infty & x < y implies x - t < y - t; theorem x < y & w < z implies x + w < y + z; theorem 0 <= x & z + x <= y implies z <= y; begin definition let x,y be ext-real number; func x * y -> ext-real number means ex a,b being complex number st x = a & y = b & it = a * b if x is real & y is real, it = +infty if (x is not real or y is not real) & (x is positive & y is positive or x is negative & y is negative), it = -infty if (x is not real or y is not real) & (x is positive & y is negative or x is negative & y is positive) otherwise it = 0; commutativity; end; registration let x,y be real number, a,b be complex number; identify x*y with a*b when x = a, y = b; end; definition let x be ext-real number; func x" -> ext-real number means ex a being complex number st x = a & it = a" if x is real otherwise it = 0; end; registration let x be real number, a be complex number; identify x" with a" when x = a; end; definition let x,y be ext-real number; func x / y -> ext-real number equals x * y"; end; registration let x,y be real number, a,b be complex number; identify x/y with a/b when x = a, y = b; end; registration let x be positive ext-real number, y be negative ext-real number; cluster x*y -> negative; end; registration let x,y be negative ext-real number; cluster x*y -> positive; end; registration let x,y be positive ext-real number; cluster x*y -> positive; end; registration let x be non positive ext-real number, y be non negative ext-real number; cluster x*y -> non positive; end; registration let x,y be non positive ext-real number; cluster x*y -> non negative; end; registration let x,y be non negative ext-real number; cluster x*y -> non negative; end; registration let x be non positive ext-real number; cluster x" -> non positive; end; registration let x be non negative ext-real number; cluster x" -> non negative; end; registration let x be non negative ext-real number, y be non positive ext-real number; cluster x/y -> non positive; cluster y/x -> non positive; end; registration let x,y be non negative ext-real number; cluster x/y -> non negative; end; registration let x,y be non positive ext-real number; cluster x/y -> non negative; end; registration let x,y be non zero ext-real number; cluster x*y -> non zero; end; registration let x be zero ext-real number, y be ext-real number; cluster x*y -> zero for ext-real number; end; theorem x*(y*z) = (x*y)*z; registration let r be real number; cluster r" -> real; end; registration let r,s be real number; cluster r*s -> real; cluster r/s -> real; end; registration cluster -infty" -> zero; cluster +infty" -> zero; end; theorem (f*g)" = f"*g"; theorem r <> 0 & r*f = r*g implies f = g; theorem x <> +infty & x <> -infty & x * y = +infty implies y = +infty or y = -infty; theorem x <> +infty & x <> -infty & x * y = -infty implies y = +infty or y = -infty; theorem x <= y & 0 <= z implies x*z <= y*z; theorem x < y & 0 < z & z <> +infty implies x*z < y*z; theorem x*y in REAL implies x in REAL & y in REAL or x*y = 0; theorem +infty" = 0; theorem -infty" = 0; theorem x/+infty = 0; theorem x/-infty = 0; theorem x <> -infty & x <> +infty & x <> 0 implies x / x = 1; theorem x <= y & 0 < z implies x/z <= y/z; theorem x < y & 0 < z & z <> +infty implies x/z < y/z; theorem 1*x = x; theorem y" = 0 implies y = +infty or y = -infty or y = 0; theorem 0 < y & y <> +infty implies +infty / y = +infty; theorem y < 0 & -infty <> y implies -infty / y = +infty; theorem y < 0 & -infty <> y implies +infty / y = -infty; theorem 0 < y & y <> +infty implies -infty / y = -infty; theorem x <> +infty & x <> -infty & x <> 0 implies x*(1/x) = 1 & (1/x)*x = 1; theorem -infty <> y & y <> +infty & y <> 0 implies x * y / y = x & x * (y / y) = x; theorem +infty * y <> 1 & -infty * y <> 1; theorem x * y <> +infty & x * y <> -infty implies x in REAL or y in REAL; begin theorem (-1)*x = -x; theorem - x*y = (-x)*y; theorem y = -z implies x*(y+z) = x*y +x*z; theorem 2*x = x+x; theorem x is real implies x*(y+z) = x*y +x*z; theorem y>=0 & z>=0 implies x*(y+z) = x*y +x*z; theorem y<=0 & z<=0 implies x*(y+z) = x*y +x*z; theorem x*(0+z) = x*0 +x*z; theorem (-f)" = -f"; theorem x is real implies x * (y - z) = x * y - x * z; theorem x <= y & z <= 0 implies y*z <= x*z; theorem x < y & z < 0 & z <> -infty implies y*z < x*z; theorem x <= y & z < 0 implies y/z <= x/z; theorem x < y & z < 0 & z <> -infty implies y/z < x/z; theorem x/2 + x/2 = x; begin reserve w, w1, w2 for Element of ExtREAL; reserve c, c1, c2 for Element of COMPLEX; reserve A, B, C, D for complex-membered set; reserve F, G, H, I for ext-real-membered set; reserve a, b, s, t, z for complex number; reserve f, g, h, i, j for ext-real number; reserve r for real number; reserve e for set; definition let w; redefine func -w -> Element of ExtREAL; redefine func w" -> Element of ExtREAL; let w1; redefine func w*w1 -> Element of ExtREAL; end; registration let a, b, c, d be complex number; cluster {a,b,c,d} -> complex-membered; end; registration let a, b, c, d be ext-real number; cluster {a,b,c,d} -> ext-real-membered; end; definition let F be ext-real-membered set; func --F -> ext-real-membered set equals {-w: w in F}; involutiveness; end; theorem f in F iff -f in --F; theorem -f in F iff f in --F; registration let F be empty set; cluster --F -> empty; end; registration let F be ext-real-membered non empty set; cluster --F -> non empty; end; theorem F c= G iff --F c= --G; theorem --F = --G implies F = G; theorem -- (F \/ G) = (--F) \/ (--G); theorem -- (F /\ G) = (--F) /\ (--G); theorem -- (F \ G) = (--F) \ (--G); theorem -- (F \+\ G) = (--F) \+\ (--G); theorem --{f} = {-f}; theorem --{f,g} = {-f,-g}; definition let A be complex-membered set; func --A -> complex-membered set equals {-c: c in A}; involutiveness; end; theorem a in A iff -a in --A; theorem -a in A iff a in --A; registration let A be empty set; cluster --A -> empty; end; registration let A be complex-membered non empty set; cluster --A -> non empty; end; registration let A be real-membered set; cluster --A -> real-membered; end; registration let A be rational-membered set; cluster --A -> rational-membered; end; registration let A be integer-membered set; cluster --A -> integer-membered; end; registration let A be real-membered set, F be ext-real-membered set; identify --A with --F when A = F; end; theorem A c= B iff --A c= --B; theorem --A = --B implies A = B; theorem -- (A \/ B) = (--A) \/ (--B); theorem -- (A /\ B) = (--A) /\ (--B); theorem -- (A \ B) = (--A) \ (--B); theorem -- (A \+\ B) = (--A) \+\ (--B); theorem --{a} = {-a}; theorem --{a,b} = {-a,-b}; definition let F be ext-real-membered set; func F"" -> ext-real-membered set equals {w": w in F}; end; theorem f in F implies f" in F""; registration let F be empty set; cluster F"" -> empty; end; registration let F be ext-real-membered non empty set; cluster F"" -> non empty; end; theorem F c= G implies F"" c= G""; theorem (F \/ G)"" = (F"") \/ (G""); theorem (F /\ G)"" c= (F"") /\ (G""); theorem --(F"") = (--F)""; theorem {f}"" = {f"}; theorem {f,g}"" = {f",g"}; definition let A be complex-membered set; func A"" -> complex-membered set equals {c": c in A}; involutiveness; end; theorem a in A iff a" in A""; theorem a" in A iff a in A""; registration let A be empty set; cluster A"" -> empty; end; registration let A be complex-membered non empty set; cluster A"" -> non empty; end; registration let A be real-membered set; cluster A"" -> real-membered; end; registration let A be rational-membered set; cluster A"" -> rational-membered; end; registration let A be real-membered set, F be ext-real-membered set; identify A"" with F"" when A = F; end; theorem A c= B iff A"" c= B""; theorem A"" = B"" implies A = B; theorem (A \/ B)"" = (A"") \/ (B""); theorem (A /\ B)"" = (A"") /\ (B""); theorem (A \ B)"" = (A"") \ (B""); theorem (A \+\ B)"" = (A"") \+\ (B""); theorem --(A"") = (--A)""; theorem {a}"" = {a"}; theorem {a,b}"" = {a",b"}; definition let F, G be ext-real-membered set; func F++G equals {w1+w2: w1 in F & w2 in G}; commutativity; end; theorem f in F & g in G implies f+g in F++G; registration let F be empty set; let G be ext-real-membered set; cluster F++G -> empty; cluster G++F -> empty; end; registration let F, G be ext-real-membered non empty set; cluster F++G -> non empty; end; registration let F, G be ext-real-membered set; cluster F++G -> ext-real-membered; end; theorem F c= G & H c= I implies F++H c= G++I; theorem F ++ (G \/ H) = (F++G) \/ (F++H); theorem F ++ (G /\ H) c= (F++G) /\ (F++H); theorem {f}++{g} = {f+g}; theorem {f}++{g,h} = {f+g,f+h}; theorem {f,g}++{h,i} = {f+h,f+i,g+h,g+i}; definition let A, B be complex-membered set; func A++B equals {c1+c2: c1 in A & c2 in B}; commutativity; end; theorem a in A & b in B implies a+b in A++B; registration let A be empty set; let B be complex-membered set; cluster A++B -> empty; cluster B++A -> empty; end; registration let A, B be complex-membered non empty set; cluster A++B -> non empty; end; registration let A, B be complex-membered set; cluster A++B -> complex-membered; end; registration let A, B be real-membered set; cluster A++B -> real-membered; end; registration let A, B be rational-membered set; cluster A++B -> rational-membered; end; registration let A, B be integer-membered set; cluster A++B -> integer-membered; end; registration let A, B be natural-membered set; cluster A++B -> natural-membered; end; registration let A, B be real-membered set, F, G be ext-real-membered set; identify A++B with F++G when A = F, B = G; end; theorem A c= B & C c= D implies A++C c= B++D; theorem A ++ (B \/ C) = (A++B) \/ (A++C); theorem A ++ (B /\ C) c= (A++B) /\ (A++C); theorem (A++B)++C = A++(B++C); theorem {a}++{b} = {a+b}; theorem {a}++{s,t} = {a+s,a+t}; theorem {a,b}++{s,t} = {a+s,a+t,b+s,b+t}; definition let F, G be ext-real-membered set; func F--G equals F ++ --G; end; theorem F--G = {w1-w2: w1 in F & w2 in G}; theorem f in F & g in G implies f-g in F--G; registration let F be empty set; let G be ext-real-membered set; cluster F--G -> empty; cluster G--F -> empty; end; registration let F, G be ext-real-membered non empty set; cluster F--G -> non empty; end; registration let F, G be ext-real-membered set; cluster F--G -> ext-real-membered; end; theorem F c= G & H c= I implies F--H c= G--I; theorem F -- (G \/ H) = (F--G) \/ (F--H); theorem F -- (G /\ H) c= (F--G) /\ (F--H); theorem --(F++G) = (--F) -- G; theorem --(F--G) = (--F) ++ G; theorem {f}--{g} = {f-g}; theorem {f}--{h,i} = {f-h,f-i}; theorem {f,g}--{h} = {f-h,g-h}; theorem {f,g}--{h,i} = {f-h,f-i,g-h,g-i}; definition let A, B be complex-membered set; func A--B equals A ++ --B; end; theorem A--B = {c1-c2: c1 in A & c2 in B}; theorem a in A & b in B implies a-b in A--B; registration let A be empty set; let B be complex-membered set; cluster A--B -> empty; cluster B--A -> empty; end; registration let A, B be complex-membered non empty set; cluster A--B -> non empty; end; registration let A, B be complex-membered set; cluster A--B -> complex-membered; end; registration let A, B be real-membered set; cluster A--B -> real-membered; end; registration let A, B be rational-membered set; cluster A--B -> rational-membered; end; registration let A, B be integer-membered set; cluster A--B -> integer-membered; end; registration let A, B be real-membered set, F, G be ext-real-membered set; identify A--B with F--G when A = F, B = G; end; theorem A c= B & C c= D implies A--C c= B--D; theorem A -- (B \/ C) = (A--B) \/ (A--C); theorem A -- (B /\ C) c= (A--B) /\ (A--C); theorem --(A++B) = (--A) -- B; theorem --(A--B) = (--A) ++ B; theorem A++(B--C) = A++B--C; theorem A--(B++C) = A--B--C; theorem A--(B--C) = A--B++C; theorem {a}--{b} = {a-b}; theorem {a}--{s,t} = {a-s,a-t}; theorem {a,b}--{s} = {a-s,b-s}; theorem {a,b}--{s,t} = {a-s,a-t,b-s,b-t}; definition let F, G be ext-real-membered set; func F**G equals {w1*w2: w1 in F & w2 in G}; commutativity; end; registration let F be empty set; let G be ext-real-membered set; cluster F**G -> empty; cluster G**F -> empty; end; registration let F, G be ext-real-membered set; cluster F**G -> ext-real-membered; end; theorem f in F & g in G implies f*g in F**G; registration let F, G be ext-real-membered non empty set; cluster F**G -> non empty; end; theorem (F**G)**H = F**(G**H); theorem F c= G & H c= I implies F**H c= G**I; theorem F ** (G \/ H) = (F**G) \/ (F**H); theorem F ** (G /\ H) c= (F**G) /\ (F**H); theorem F**--G = --(F**G); theorem (F**G)"" = (F"") ** (G""); theorem {f}**{g} = {f*g}; theorem {f}**{h,i} = {f*h,f*i}; theorem {f,g}**{h,i} = {f*h,f*i,g*h,g*i}; definition let A, B be complex-membered set; func A**B equals {c1*c2: c1 in A & c2 in B}; commutativity; end; theorem a in A & b in B implies a*b in A**B; registration let A be empty set; let B be complex-membered set; cluster A**B -> empty; cluster B**A -> empty; end; registration let A, B be complex-membered non empty set; cluster A**B -> non empty; end; registration let A, B be complex-membered set; cluster A**B -> complex-membered; end; registration let A, B be real-membered set; cluster A**B -> real-membered; end; registration let A, B be rational-membered set; cluster A**B -> rational-membered; end; registration let A, B be integer-membered set; cluster A**B -> integer-membered; end; registration let A, B be natural-membered set; cluster A**B -> natural-membered; end; registration let A, B be real-membered set, F, G be ext-real-membered set; identify A**B with F**G when A = F, B = G; end; theorem (A**B)**C = A**(B**C); theorem A c= B & C c= D implies A**C c= B**D; theorem A ** (B \/ C) = (A**B) \/ (A**C); theorem A ** (B /\ C) c= (A**B) /\ (A**C); theorem A**--B = --(A**B); theorem A**(B++C) c= A**B ++ A**C; theorem A**(B--C) c= A**B -- A**C; theorem (A**B)"" = (A"") ** (B""); theorem {a}**{b} = {a*b}; theorem {a}**{s,t} = {a*s,a*t}; theorem {a,b}**{s,t} = {a*s,a*t,b*s,b*t}; definition let F, G be ext-real-membered set; func F///G equals F**(G""); end; theorem F///G = {w1/w2: w1 in F & w2 in G}; theorem f in F & g in G implies f/g in F///G; registration let F be empty set; let G be ext-real-membered set; cluster F///G -> empty; cluster G///F -> empty; end; registration let F, G be ext-real-membered non empty set; cluster F///G -> non empty; end; registration let F, G be ext-real-membered set; cluster F///G -> ext-real-membered; end; theorem F c= G & H c= I implies F///H c= G///I; theorem (F \/ G) /// H = (F///H) \/ (G///H); theorem (F /\ G) /// H c= (F///H) /\ (G///H); theorem F /// (G \/ H) = (F///G) \/ (F///H); theorem F /// (G /\ H) c= (F///G) /\ (F///H); theorem (F**G)///H = F**(G///H); theorem (F///G)**H = (F**H)///G; theorem (F///G)///H = F///(G**H); theorem {f}///{g} = {f/g}; theorem {f}///{h,i} = {f/h,f/i}; theorem {f,g}///{h} = {f/h,g/h}; theorem {f,g}///{h,i} = {f/h,f/i,g/h,g/i}; definition let A, B be complex-membered set; func A///B equals A**(B""); end; theorem A///B = {c1/c2: c1 in A & c2 in B}; theorem a in A & b in B implies a/b in A///B; registration let A be empty set; let B be complex-membered set; cluster A///B -> empty; cluster B///A -> empty; end; registration let A, B be complex-membered non empty set; cluster A///B -> non empty; end; registration let A, B be complex-membered set; cluster A///B -> complex-membered; end; registration let A, B be real-membered set; cluster A///B -> real-membered; end; registration let A, B be rational-membered set; cluster A///B -> rational-membered; end; registration let A, B be real-membered set, F, G be ext-real-membered set; identify A///B with F///G when A = F, B = G; end; theorem A c= B & C c= D implies A///C c= B///D; theorem A /// (B \/ C) = (A///B) \/ (A///C); theorem A /// (B /\ C) c= (A///B) /\ (A///C); theorem A///--B = --(A///B); theorem (--A)///B = --(A///B); theorem (A++B)///C c= A///C ++ B///C; theorem (A--B)///C c= A///C -- B///C; theorem (A**B)///C = A**(B///C); theorem (A///B)**C = (A**C)///B; theorem (A///B)///C = A///(B**C); theorem A///(B///C) = (A**C)///B; theorem {a}///{b} = {a/b}; theorem {a}///{s,t} = {a/s,a/t}; theorem {a,b}///{s} = {a/s,b/s}; theorem {a,b}///{s,t} = {a/s,a/t,b/s,b/t}; definition let F be ext-real-membered set; let f be ext-real number; func f++F equals {f}++F; end; theorem g in G implies f+g in f++G; theorem f++F = {f+w: w in F}; theorem e in f++F implies ex w st e = f+w & w in F; registration let F be empty set; let f be ext-real number; cluster f++F -> empty; end; registration let F be ext-real-membered non empty set; let f be ext-real number; cluster f++F -> non empty; end; registration let F be ext-real-membered set; let f be ext-real number; cluster f++F -> ext-real-membered; end; theorem r++F c= r++G implies F c= G; theorem r++F = r++G implies F = G; theorem r ++ (F /\ G) = (r++F) /\ (r++G); theorem (f++F) \ (f++G) c= f ++ (F \ G); theorem r ++ (F \ G) = (r++F) \ (r++G); theorem r ++ (F \+\ G) = (r++F) \+\ (r++G); definition let A be complex-membered set; let a be complex number; func a++A equals {a}++A; end; theorem b in A implies a+b in a++A; theorem a++A = {a+c: c in A}; theorem e in a++A implies ex c st e = a+c & c in A; registration let A be empty set; let a be complex number; cluster a++A -> empty; end; registration let A be complex-membered non empty set; let a be complex number; cluster a++A -> non empty; end; registration let A be complex-membered set; let a be complex number; cluster a++A -> complex-membered; end; registration let A be real-membered set; let a be real number; cluster a++A -> real-membered; end; registration let A be rational-membered set; let a be rational number; cluster a++A -> rational-membered; end; registration let A be integer-membered set; let a be integer number; cluster a++A -> integer-membered; end; registration let A be natural-membered set; let a be Nat; cluster a++A -> natural-membered; end; registration let A be real-membered set, F be ext-real-membered set; let a be real number, f be ext-real number; identify a++A with f++F when a = f, A = F; end; theorem A c= B iff a++A c= a++B; theorem a++A = a++B implies A = B; theorem 0++A = A; theorem (a+b)++A = a++(b++A); theorem a++(A++B) = (a++A)++B; theorem a ++ (A /\ B) = (a++A) /\ (a++B); theorem a ++ (A \ B) = (a++A) \ (a++B); theorem a ++ (A \+\ B) = (a++A) \+\ (a++B); definition let F be ext-real-membered set; let f be ext-real number; func f--F equals {f}--F; end; theorem g in G implies f-g in f--G; theorem f--F = {f-w: w in F}; theorem e in f--F implies ex w st e = f-w & w in F; registration let F be empty set; let f be ext-real number; cluster f--F -> empty; end; registration let F be ext-real-membered non empty set; let f be ext-real number; cluster f--F -> non empty; end; registration let F be ext-real-membered set; let f be ext-real number; cluster f--F -> ext-real-membered; end; theorem r--F c= r--G implies F c= G; theorem r--F = r--G implies F = G; theorem r -- (F/\G) = (r--F) /\ (r--G); theorem r -- (F\G) = (r--F) \ (r--G); theorem r -- (F\+\G) = (r--F) \+\ (r--G); definition let A be complex-membered set; let a be complex number; func a--A equals {a}--A; end; theorem b in A implies a-b in a--A; theorem a--A = {a-c: c in A}; theorem e in a--A implies ex c st e = a-c & c in A; registration let A be empty set; let a be complex number; cluster a--A -> empty; end; registration let A be complex-membered non empty set; let a be complex number; cluster a--A -> non empty; end; registration let A be complex-membered set; let a be complex number; cluster a--A -> complex-membered; end; registration let A be real-membered set; let a be real number; cluster a--A -> real-membered; end; registration let A be rational-membered set; let a be rational number; cluster a--A -> rational-membered; end; registration let A be integer-membered set; let a be integer number; cluster a--A -> integer-membered; end; registration let A be real-membered set, F be ext-real-membered set; let a be real number, f be ext-real number; identify a--A with f--F when a = f, A = F; end; theorem A c= B iff a--A c= a--B; theorem a--A = a--B implies A = B; theorem a -- (A/\B) = (a--A) /\ (a--B); theorem a -- (A\B) = (a--A) \ (a--B); theorem a -- (A\+\B) = (a--A) \+\ (a--B); definition let F be ext-real-membered set; let f be ext-real number; func F--f equals F--{f}; end; theorem g in G implies g-f in G--f; theorem F--f = {w-f: w in F}; theorem e in F--f implies ex w st e = w-f & w in F; registration let F be empty set; let f be ext-real number; cluster F--f -> empty; end; registration let F be ext-real-membered non empty set; let f be ext-real number; cluster F--f -> non empty; end; registration let F be ext-real-membered set; let f be ext-real number; cluster F--f -> ext-real-membered; end; theorem F -- f = -- (f -- F); theorem f -- F = -- (F -- f); theorem (F/\G) -- r = (F--r) /\ (G--r); theorem (F\G) -- r = (F--r) \ (G--r); theorem (F\+\G) -- r = (F--r) \+\ (G--r); definition let A be complex-membered set; let a be complex number; func A--a equals A--{a}; end; theorem b in A implies b-a in A--a; theorem A--a = {c-a: c in A}; theorem e in A--a implies ex c st e = c-a & c in A; registration let A be empty set; let a be complex number; cluster A--a -> empty; end; registration let A be complex-membered non empty set; let a be complex number; cluster A--a -> non empty; end; registration let A be complex-membered set; let a be complex number; cluster A--a -> complex-membered; end; registration let A be real-membered set; let a be real number; cluster A--a -> real-membered; end; registration let A be rational-membered set; let a be rational number; cluster A--a -> rational-membered; end; registration let A be integer-membered set; let a be integer number; cluster A--a -> integer-membered; end; registration let A be real-membered set, F be ext-real-membered set; let a be real number, f be ext-real number; identify A--a with F--f when a = f, A = F; end; theorem A c= B iff A--a c= B--a; theorem A--a = B--a implies A = B; theorem A -- a = -- (a -- A); theorem a -- A = -- (A -- a); theorem (A/\B) -- a = (A--a) /\ (B--a); theorem (A\B) -- a = (A--a) \ (B--a); theorem (A\+\B) -- a = (A--a) \+\ (B--a); definition let F be ext-real-membered set; let f be ext-real number; func f**F equals {f}**F; end; theorem g in G implies f*g in f**G; theorem f**F = {f*w: w in F}; theorem e in f**F implies ex w st e = f*w & w in F; registration let F be empty set; let f be ext-real number; cluster f**F -> empty; end; registration let F be ext-real-membered non empty set; let f be ext-real number; cluster f**F -> non empty; end; registration let F be ext-real-membered set; let f be ext-real number; cluster f**F -> ext-real-membered; end; theorem r <> 0 implies r ** (F/\G) = (r**F) /\ (r**G); theorem (f**F) \ (f**G) c= f ** (F \ G); theorem r <> 0 implies r ** (F\G) = (r**F) \ (r**G); theorem r <> 0 implies r ** (F\+\G) = (r**F) \+\ (r**G); definition let A be complex-membered set; let a be complex number; func a**A equals {a}**A; end; theorem b in A implies a*b in a**A; theorem a**A = {a*c: c in A}; theorem e in a**A implies ex c st e = a*c & c in A; registration let A be empty set; let a be complex number; cluster a**A -> empty; end; registration let A be complex-membered non empty set; let a be complex number; cluster a**A -> non empty; end; registration let A be complex-membered set; let a be complex number; cluster a**A -> complex-membered; end; registration let A be real-membered set; let a be real number; cluster a**A -> real-membered; end; registration let A be rational-membered set; let a be rational number; cluster a**A -> rational-membered; end; registration let A be integer-membered set; let a be integer number; cluster a**A -> integer-membered; end; registration let A be natural-membered set; let a be Nat; cluster a**A -> natural-membered; end; registration let A be real-membered set, F be ext-real-membered set; let a be real number, f be ext-real number; identify a**A with f**F when a = f, A = F; end; theorem a <> 0 & a**A c= a**B implies A c= B; theorem a <> 0 & a**A = a**B implies A = B; theorem a <> 0 implies a ** (A/\B) = (a**A) /\ (a**B); theorem a <> 0 implies a ** (A\B) = (a**A) \ (a**B); theorem a <> 0 implies a ** (A\+\B) = (a**A) \+\ (a**B); theorem 0**A c= {0}; theorem A <> {} implies 0**A = {0}; theorem 1**A = A; theorem (a*b)**A = a**(b**A); theorem a**(A**B) = (a**A)**B; theorem (a+b)**A c= a**A ++ b**A; theorem (a-b)**A c= a**A -- b**A; theorem a**(B++C) = a**B++a**C; theorem a**(B--C) = a**B--a**C; definition let F be ext-real-membered set; let f be ext-real number; func f///F equals {f}///F; end; theorem g in G implies f/g in f///G; theorem f///F = {f/w: w in F}; theorem e in f///F implies ex w st e = f/w & w in F; registration let F be empty set; let f be ext-real number; cluster f///F -> empty; end; registration let F be ext-real-membered non empty set; let f be ext-real number; cluster f///F -> non empty; end; registration let F be ext-real-membered set; let f be ext-real number; cluster f///F -> ext-real-membered; end; definition let A be complex-membered set; let a be complex number; func a///A equals {a}///A; end; theorem b in A implies a/b in a///A; theorem a///A = {a/c: c in A}; theorem e in a///A implies ex c st e = a/c & c in A; registration let A be empty set; let a be complex number; cluster a///A -> empty; end; registration let A be complex-membered non empty set; let a be complex number; cluster a///A -> non empty; end; registration let A be complex-membered set; let a be complex number; cluster a///A -> complex-membered; end; registration let A be real-membered set; let a be real number; cluster a///A -> real-membered; end; registration let A be rational-membered set; let a be rational number; cluster a///A -> rational-membered; end; registration let A be real-membered set, F be ext-real-membered set; let a be real number, f be ext-real number; identify a///A with f///F when a = f, A = F; end; theorem a <> 0 & a///A c= a///B implies A c= B; theorem a <> 0 & a///A = a///B implies A = B; theorem a <> 0 implies a /// (A/\B) = (a///A) /\ (a///B); theorem a <> 0 implies a /// (A\B) = (a///A) \ (a///B); theorem a <> 0 implies a /// (A\+\B) = (a///A) \+\ (a///B); theorem (a+b)///A c= a///A ++ b///A; theorem (a-b)///A c= a///A -- b///A; definition let F be ext-real-membered set; let f be ext-real number; func F///f equals F///{f}; end; theorem g in G implies g/f in G///f; theorem F///f = {w/f: w in F}; theorem e in F///f implies ex w st e = w/f & w in F; registration let F be empty set; let f be ext-real number; cluster F///f -> empty; end; registration let F be ext-real-membered non empty set; let f be ext-real number; cluster F///f -> non empty; end; registration let F be ext-real-membered set; let f be ext-real number; cluster F///f -> ext-real-membered; end; definition let A be complex-membered set; let a be complex number; func A///a equals A///{a}; end; theorem b in A implies b/a in A///a; theorem A///a = {c/a: c in A}; theorem e in A///a implies ex c st e = c/a & c in A; registration let A be empty set; let a be complex number; cluster A///a -> empty; end; registration let A be complex-membered non empty set; let a be complex number; cluster A///a -> non empty; end; registration let A be complex-membered set; let a be complex number; cluster A///a -> complex-membered; end; registration let A be real-membered set; let a be real number; cluster A///a -> real-membered; end; registration let A be rational-membered set; let a be rational number; cluster A///a -> rational-membered; end; registration let A be real-membered set, F be ext-real-membered set; let a be real number, f be ext-real number; identify A///a with F///f when a = f, A = F; end; theorem a <> 0 & A///a c= B///a implies A c= B; theorem a <> 0 & A///a = B///a implies A = B; theorem a <> 0 implies (A/\B) /// a = (A///a) /\ (B///a); theorem a <> 0 implies (A\B) /// a = (A///a) \ (B///a); theorem a <> 0 implies (A\+\B) /// a = (A///a) \+\ (B///a); theorem (A++B)///a = A///a ++ B///a; theorem (A--B)///a = A///a -- B///a; begin definition mode R_eal is Element of ExtREAL; end; definition redefine func +infty -> R_eal; redefine func -infty -> R_eal; end; definition let X be ext-real-membered set; func SetMajorant(X) -> ext-real-membered set means for x being ext-real number holds x in it iff x is UpperBound of X; end; registration let X be ext-real-membered set; cluster SetMajorant(X) -> non empty; end; theorem for X,Y being ext-real-membered set st X c= Y holds for x being ext-real number holds x in SetMajorant Y implies x in SetMajorant(X); definition let X be ext-real-membered set; func SetMinorant(X) -> ext-real-membered set means for x being ext-real number holds x in it iff x is LowerBound of X; end; registration let X be ext-real-membered set; cluster SetMinorant(X) -> non empty; end; theorem for X,Y being ext-real-membered set st X c= Y holds for x being ext-real number holds x in SetMinorant(Y) implies x in SetMinorant(X); theorem for X being non empty ext-real-membered set holds sup X = inf SetMajorant(X) & inf X = sup SetMinorant(X); registration let X be non empty set; cluster non empty with_non-empty_elements for Subset-Family of X; end; definition let X be non empty set; mode bool_DOMAIN of X is non empty with_non-empty_elements Subset-Family of X; end; definition let F be bool_DOMAIN of ExtREAL; func SUP(F) -> ext-real-membered set means for a being ext-real number holds a in it iff ex A being non empty ext-real-membered set st A in F & a = sup A; end; registration let F be bool_DOMAIN of ExtREAL; cluster SUP(F) -> non empty; end; theorem for F being bool_DOMAIN of ExtREAL, S being non empty ext-real-membered number st S = union F holds sup S is UpperBound of SUP(F); theorem for F being bool_DOMAIN of ExtREAL, S being ext-real-membered set st S = union F holds sup SUP(F) is UpperBound of S; theorem for F being bool_DOMAIN of ExtREAL, S being non empty ext-real-membered set st S = union F holds sup S = sup SUP(F); definition let F be bool_DOMAIN of ExtREAL; func INF F -> ext-real-membered set means for a being ext-real number holds a in it iff ex A being non empty ext-real-membered set st A in F & a = inf A; end; registration let F be bool_DOMAIN of ExtREAL; cluster INF(F) -> non empty; end; theorem for F being bool_DOMAIN of ExtREAL, S being non empty ext-real-membered set st S = union F holds inf S is LowerBound of INF(F); theorem for F being bool_DOMAIN of ExtREAL, S being ext-real-membered set st S = union F holds inf INF(F) is LowerBound of S; theorem for F being bool_DOMAIN of ExtREAL, S being non empty ext-real-membered set st S = union F holds inf S = inf INF(F); begin reserve x, a, b, c for real number; definition let a,b,c be complex number; func delta(a,b,c) equals b^2 - 4 * a * c; end; registration let a,b,c be complex number; cluster delta(a,b,c) -> complex; end; registration let a,b,c; cluster delta(a,b,c) -> real; end; definition let a,b,c be Real; redefine func delta(a,b,c) -> Real; end; theorem for a, b, c, x being complex number holds a <> 0 implies a * x^2 + b * x + c = a * (x + b/(2 * a))^2 - delta(a,b,c)/(4 * a); theorem a > 0 & delta(a,b,c) <= 0 implies a * x^2 + b * x + c >= 0; theorem a > 0 & delta(a,b,c) < 0 implies a * x^2 + b * x + c > 0; theorem a < 0 & delta(a,b,c) <= 0 implies a * x^2 + b * x + c <= 0; theorem a < 0 & delta(a,b,c) < 0 implies a * x^2 + b * x + c < 0; theorem a > 0 & a * x^2 + b * x + c >= 0 implies (2 * a * x + b)^2 - delta(a,b,c) >= 0; theorem a > 0 & a * x^2 + b * x + c > 0 implies (2 * a * x + b)^2 - delta (a,b,c) > 0 ; theorem a < 0 & a * x^2 + b * x + c <= 0 implies (2 * a * x + b)^2 - delta(a,b,c) >= 0; theorem a < 0 & a * x^2 + b * x + c < 0 implies (2 * a * x + b)^2 - delta (a,b,c) > 0 ; theorem ( for x holds a * x^2 + b * x + c >= 0 ) & a > 0 implies delta(a,b,c) <= 0; theorem ( for x holds a * x^2 + b * x + c <= 0 ) & a < 0 implies delta(a,b,c) <= 0; theorem ( for x holds a * x^2 + b * x + c > 0 ) & a > 0 implies delta(a,b,c) < 0; theorem ( for x holds a * x^2 + b * x + c < 0 ) & a < 0 implies delta(a,b,c) < 0; theorem for a, b, c, x being complex number holds a <> 0 & a * x^2 + b * x + c = 0 implies (2 * a * x + b)^2 - delta(a,b,c) = 0; theorem a <> 0 & delta(a,b,c) >= 0 & a * x^2 + b * x + c = 0 implies x = (- b - sqrt delta(a,b,c))/(2 * a) or x = (- b + sqrt delta(a,b,c))/(2 * a); theorem a <> 0 & delta(a,b,c) >= 0 implies a * x^2 + b * x + c = a * (x - (- b - sqrt delta(a,b,c))/(2 * a)) * (x - (- b + sqrt delta(a,b,c))/(2 * a)); theorem a < 0 & delta(a,b,c) > 0 implies (- b + sqrt delta(a,b,c))/(2 * a) < (- b - sqrt delta(a,b,c))/(2 * a); theorem a < 0 & delta(a,b,c) > 0 implies ( a * x^2 + b * x + c > 0 iff (- b + sqrt delta(a,b,c))/(2 * a) < x & x < (- b - sqrt delta(a,b,c))/(2 * a) ); theorem a < 0 & delta(a,b,c) > 0 implies ( a * x^2 + b * x + c < 0 iff x < (- b + sqrt delta(a,b,c))/(2 * a) or x > (- b - sqrt delta(a,b,c))/(2 * a) ); theorem for a, b, c, x being complex number holds a <> 0 & delta(a,b,c) = 0 & a * x^2 + b * x + c = 0 implies x = - b/(2 * a); theorem a > 0 & (2 * a * x + b)^2 - delta(a,b,c) > 0 implies a * x^2 + b * x + c > 0; theorem a > 0 & delta(a,b,c) = 0 implies ( a * x^2 + b * x + c > 0 iff x <> - b/(2 * a) ); theorem a < 0 & (2 * a * x + b)^2 - delta(a,b,c) > 0 implies a * x^2 + b * x + c < 0; theorem a < 0 & delta(a,b,c) = 0 implies ( a * x^2 + b * x + c < 0 iff x <> - b/(2 * a) ); theorem a > 0 & delta(a,b,c) > 0 implies (- b + sqrt delta(a,b,c))/(2 * a) > (- b - sqrt delta(a,b,c))/(2 * a); theorem a > 0 & delta(a,b,c) > 0 implies ( a * x^2 + b * x + c < 0 iff (- b - sqrt delta(a,b,c))/(2 * a) < x & x < (- b + sqrt delta(a,b,c))/(2 * a) ); theorem a > 0 & delta(a,b,c) > 0 implies ( a * x^2 + b * x + c > 0 iff x < (- b - sqrt delta(a,b,c))/(2 * a) or x > (- b + sqrt delta(a,b,c))/(2 * a) ); begin theorem for X,x being set holds for F being Function of [:X,X:],X holds x in [:X,X:] implies F.x in X; definition let X be set; let F be BinOp of X; mode Preserv of F -> Subset of X means for x being set holds x in [: it,it:] implies F.x in it; end; definition let R be Relation; let A be set; func R||A equals R | [:A,A:]; end; registration let R be Relation; let A be set; cluster R||A -> Relation-like; end; registration let R be Function; let A be set; cluster R||A -> Function-like; end; theorem for X being set, F being BinOp of X, A being Preserv of F holds F ||A is BinOp of A; definition let X be set; let F be BinOp of X; let A be Preserv of F; redefine func F||A -> BinOp of A; end; theorem for X being set holds X is non trivial iff for x being set holds X\{x} is non empty set; theorem ex A being non empty set st for z being Element of A holds A \ {z} is non empty set; definition let X be non trivial set; let F be BinOp of X; let x be Element of X; pred F is_Bin_Op_Preserv x means X\{x} is Preserv of F & F||X\{x} is BinOp of X\{x}; end; theorem for X being set holds for A being Subset of X holds ex F being BinOp of X st for x being set holds x in [:A,A:] implies F.x in A; definition let X be set; let A be Subset of X; mode Presv of X,A -> BinOp of X means for x being set holds x in [:A, A:] implies it.x in A; end; theorem for X being set, A being Subset of X, F being Presv of X,A holds F||A is BinOp of A; definition let X be set; let A be Subset of X; let F be Presv of X,A; func F|||A -> BinOp of A equals F||A; end; definition let A be set; let x be Element of A; mode DnT of x,A -> BinOp of A means for y being set holds y in [:A\{x },A\{x}:] implies it.y in A\{x}; end; theorem for A being non trivial set holds for x being Element of A holds for F being DnT of x,A holds F||(A\{x}) is BinOp of A\{x}; definition let A be non trivial set; let x be Element of A; let F be DnT of x,A; func F!(A,x) -> BinOp of A\{x} equals F||(A\{x}); end; theorem for F being non trivial set holds for A being Singleton of F holds F\A is non empty set; registration let F be non trivial set; let A be Singleton of F; cluster F\A -> non empty; end; begin reserve m for Cardinal, A,B,C for Ordinal, x,y,z,X,Y,Z,W for set, f for Function; registration cluster Tarski -> subset-closed for set; end; registration let X be set; cluster Tarski-Class X -> Tarski; end; theorem W is subset-closed & X in W implies not X,W are_equipotent & card X in card W ; theorem W is Tarski & x in W & y in W implies {x} in W & {x,y} in W; theorem W is Tarski & x in W & y in W implies [x,y] in W; theorem W is Tarski & X in W implies Tarski-Class X c= W; theorem W is Tarski & A in W implies succ A in W & A c= W; theorem A in Tarski-Class W implies succ A in Tarski-Class W & A c= Tarski-Class W; theorem W is subset-closed & X is epsilon-transitive & X in W implies X c= W; theorem X is epsilon-transitive & X in Tarski-Class W implies X c= Tarski-Class W; theorem W is Tarski implies On W = card W; theorem On Tarski-Class W = card Tarski-Class W; theorem W is Tarski & X in W implies card X in W; theorem X in Tarski-Class W implies card X in Tarski-Class W; theorem W is Tarski & x in card W implies x in W; theorem x in card Tarski-Class W implies x in Tarski-Class W; theorem W is Tarski & m in card W implies m in W; theorem m in card Tarski-Class W implies m in Tarski-Class W; theorem W is Tarski & m in W implies m c= W; theorem m in Tarski-Class W implies m c= Tarski-Class W; theorem W is Tarski implies card W is limit_ordinal; theorem W is Tarski & W <> {} implies card W <> 0 & card W <> {} & card W is limit_ordinal; theorem card Tarski-Class W <> 0 & card Tarski-Class W <> {} & card Tarski-Class W is limit_ordinal; reserve f,g for Function, L for T-Sequence, F for Cardinal-Function; theorem W is Tarski & (X in W & W is epsilon-transitive or X in W & X c= W or card X in card W & X c= W) implies Funcs(X,W) c= W; theorem X in Tarski-Class W & W is epsilon-transitive or X in Tarski-Class W & X c= Tarski-Class W or card X in card Tarski-Class W & X c= Tarski-Class W implies Funcs(X,Tarski-Class W) c= Tarski-Class W; theorem dom L is limit_ordinal & (for A st A in dom L holds L.A = Rank A ) implies Rank dom L = Union L; theorem W is Tarski & A in On W implies card Rank A in card W & Rank A in W; theorem A in On Tarski-Class W implies card Rank A in card Tarski-Class W & Rank A in Tarski-Class W; theorem W is Tarski implies Rank card W c= W; theorem Rank card Tarski-Class W c= Tarski-Class W; theorem W is Tarski & W is epsilon-transitive & X in W implies the_rank_of X in W; theorem W is Tarski & W is epsilon-transitive implies W c= Rank card W; theorem W is Tarski & W is epsilon-transitive implies Rank card W = W; theorem W is Tarski & A in On W implies card Rank A c= card W; theorem A in On Tarski-Class W implies card Rank A c= card Tarski-Class W; theorem W is Tarski implies card W = card Rank card W; theorem card Tarski-Class W = card Rank card Tarski-Class W; theorem W is Tarski & X c= Rank card W implies X,Rank card W are_equipotent or X in Rank card W; theorem X c= Rank card Tarski-Class W implies X,Rank card Tarski-Class W are_equipotent or X in Rank card Tarski-Class W; theorem W is Tarski implies Rank card W is Tarski; theorem Rank card Tarski-Class W is Tarski; theorem X is epsilon-transitive & A in the_rank_of X implies ex Y st Y in X & the_rank_of Y = A; theorem X is epsilon-transitive implies card the_rank_of X c= card X; theorem W is Tarski & X is epsilon-transitive & X in W implies X in Rank card W; theorem X is epsilon-transitive & X in Tarski-Class W implies X in Rank card Tarski-Class W; theorem W is epsilon-transitive implies Rank card Tarski-Class W is_Tarski-Class_of W ; theorem W is epsilon-transitive implies Rank card Tarski-Class W = Tarski-Class W; definition let IT be set; attr IT is universal means IT is epsilon-transitive & IT is Tarski; end; registration cluster universal -> epsilon-transitive Tarski for set; cluster epsilon-transitive Tarski -> universal for set; end; registration cluster universal non empty for set; end; definition mode Universe is universal non empty set; end; reserve U1,U2,U for Universe; theorem On U is Ordinal; theorem X is epsilon-transitive implies Tarski-Class X is universal; theorem Tarski-Class U is Universe; registration let U; cluster On U -> ordinal; cluster Tarski-Class U -> universal; end; theorem Tarski-Class A is universal; registration let A; cluster Tarski-Class A -> universal; end; theorem U = Rank On U; theorem On U <> {} & On U is limit_ordinal; theorem U1 in U2 or U1 = U2 or U2 in U1; theorem U1 c= U2 or U2 in U1; theorem U1,U2 are_c=-comparable; theorem U1 \/ U2 is Universe & U1 /\ U2 is Universe; theorem {} in U; theorem x in U implies {x} in U; theorem x in U & y in U implies {x,y} in U & [x,y] in U; theorem X in U implies bool X in U & union X in U & meet X in U; theorem X in U & Y in U implies X \/ Y in U & X /\ Y in U & X \ Y in U & X \+\ Y in U ; theorem X in U & Y in U implies [:X,Y:] in U & Funcs(X,Y) in U; reserve u,v for Element of U; registration let U1; cluster non empty for Element of U1; end; definition let U,u; redefine func {u} -> Element of U; redefine func bool u -> Element of U; redefine func union u -> Element of U; redefine func meet u -> Element of U; let v; redefine func {u,v} -> Element of U; redefine func [u,v] -> Element of U; redefine func u \/ v -> Element of U; redefine func u /\ v -> Element of U; redefine func u \ v -> Element of U; redefine func u \+\ v -> Element of U; redefine func [:u,v:] -> Element of U; redefine func Funcs(u,v) -> Element of U; end; definition func FinSETS -> Universe equals Tarski-Class {}; end; theorem card Rank omega = card omega; theorem Rank omega is Tarski; theorem FinSETS = Rank omega; definition func SETS -> Universe equals Tarski-Class FinSETS; end; registration let X be set; cluster the_transitive-closure_of X -> epsilon-transitive; end; registration let X be epsilon-transitive set; cluster Tarski-Class X -> epsilon-transitive; end; definition let X be set; func Universe_closure X -> Universe means X c= it & for Y being Universe st X c= Y holds it c= Y; end; definition mode FinSet is Element of FinSETS; mode Set is Element of SETS; let A; func UNIVERSE A means ex L st it = last L & dom L = succ A & L.{} = FinSETS & (for C st succ C in succ A holds L.succ C = Tarski-Class(L.C)) & for C st C in succ A & C <> {} & C is limit_ordinal holds L.C = Universe_closure Union(L|C); end; registration let A; cluster UNIVERSE A -> universal non empty; end; theorem UNIVERSE {} = FinSETS; theorem UNIVERSE succ A = Tarski-Class UNIVERSE A; theorem UNIVERSE 1 = SETS; theorem A <> {} & A is limit_ordinal & dom L = A & (for B st B in A holds L.B = UNIVERSE B) implies UNIVERSE A = Universe_closure Union L; theorem FinSETS c= U & Tarski-Class {} c= U & UNIVERSE {} c= U; theorem A in B iff UNIVERSE A in UNIVERSE B; theorem UNIVERSE A = UNIVERSE B implies A = B; theorem A c= B iff UNIVERSE A c= UNIVERSE B; reserve u,v for Element of Tarski-Class(X); theorem Tarski-Class(X,{}) in Tarski-Class(X,1) & Tarski-Class(X,{}) <> Tarski-Class(X,1); begin reserve phi,fi,psi for Ordinal-Sequence, A,A1,B,C,D for Ordinal, f,g for Function, X for set, x,y,z for set; registration let L be Ordinal-Sequence; cluster last L -> ordinal; end; theorem dom fi = succ A implies last fi is_limes_of fi & lim fi = last fi; definition let fi,psi be T-Sequence; func fi^psi -> T-Sequence means dom it = (dom fi)+^(dom psi) & (for A st A in dom fi holds it.A = fi.A) & for A st A in dom psi holds it.((dom fi) +^A) = psi.A; end; theorem rng(fi^psi) c= rng fi \/ rng psi; registration let fi,psi; cluster fi^psi -> Ordinal-yielding; end; theorem A is_limes_of psi implies A is_limes_of fi^psi; theorem A is_limes_of fi implies B+^A is_limes_of B+^fi; theorem A is_limes_of fi implies A*^B is_limes_of fi*^B; theorem dom fi = dom psi & B is_limes_of fi & C is_limes_of psi & ((for A st A in dom fi holds fi.A c= psi.A) or for A st A in dom fi holds fi.A in psi.A ) implies B c= C; reserve f1,f2 for Ordinal-Sequence; theorem dom f1 = dom fi & dom fi = dom f2 & A is_limes_of f1 & A is_limes_of f2 & (for A st A in dom fi holds f1.A c= fi.A & fi.A c= f2.A) implies A is_limes_of fi; theorem dom fi <> {} & dom fi is limit_ordinal & fi is increasing implies sup fi is_limes_of fi & lim fi = sup fi; theorem fi is increasing & A c= B & B in dom fi implies fi.A c= fi.B; theorem fi is increasing & A in dom fi implies A c= fi.A; theorem phi is increasing implies phi"A is Ordinal; theorem f1 is increasing implies f2*f1 is Ordinal-Sequence; theorem f1 is increasing & f2 is increasing implies ex phi st phi = f1* f2 & phi is increasing; theorem f1 is increasing & A is_limes_of f2 & sup rng f1 = dom f2 & fi = f2*f1 implies A is_limes_of fi; theorem phi is increasing implies phi|A is increasing; theorem phi is increasing & dom phi is limit_ordinal implies sup phi is limit_ordinal ; theorem fi is increasing & fi is continuous & psi is continuous & phi = psi*fi implies phi is continuous; theorem (for A st A in dom fi holds fi.A = C+^A) implies fi is increasing; theorem C <> {} & (for A st A in dom fi holds fi.A = A*^C) implies fi is increasing; theorem A <> {} implies exp({},A) = {}; theorem A <> {} & A is limit_ordinal implies for fi st dom fi = A & for B st B in A holds fi.B = exp(C,B) holds exp(C,A) is_limes_of fi; theorem C <> {} implies exp(C,A) <> {}; theorem 1 in C implies exp(C,A) in exp(C,succ A); theorem 1 in C & A in B implies exp(C,A) in exp(C,B); theorem 1 in C & (for A st A in dom fi holds fi.A = exp(C,A)) implies fi is increasing; theorem 1 in C & A <> {} & A is limit_ordinal implies for fi st dom fi = A & for B st B in A holds fi.B = exp(C,B) holds exp(C,A) = sup fi; theorem C <> {} & A c= B implies exp(C,A) c= exp(C,B); theorem A c= B implies exp(A,C) c= exp(B,C); theorem 1 in C & A <> {} implies 1 in exp(C,A); theorem exp(C,A+^B) = exp(C,B)*^exp(C,A); theorem exp(exp(C,A),B) = exp(C,B*^A); theorem 1 in C implies A c= exp(C,A); scheme CriticalNumber { phi(Ordinal) -> Ordinal } : ex A st phi(A) = A provided for A,B st A in B holds phi(A) in phi(B) and for A st A <> {} & A is limit_ordinal for phi st dom phi = A & for B st B in A holds phi.B = phi(B) holds phi(A) is_limes_of phi; reserve W for Universe; registration let W; cluster ordinal for Element of W; end; definition let W; mode Ordinal of W is ordinal Element of W; mode Ordinal-Sequence of W is Function of On W, On W; end; registration let W; cluster non empty for Ordinal of W; end; registration let W; cluster On W -> non empty; end; registration let W; cluster -> T-Sequence-like Ordinal-yielding for Ordinal-Sequence of W; end; reserve A1,B1 for Ordinal of W, phi for Ordinal-Sequence of W; scheme UOSLambda { W() -> Universe, F(set) -> Ordinal of W() } : ex phi being Ordinal-Sequence of W() st for a being Ordinal of W() holds phi.a = F(a); definition let W; func 0-element_of W -> Ordinal of W equals {}; func 1-element_of W -> non empty Ordinal of W equals 1; let phi,A1; redefine func phi.A1 -> Ordinal of W; end; definition let W; let p2,p1 be Ordinal-Sequence of W; redefine func p1*p2 -> Ordinal-Sequence of W; end; theorem 0-element_of W = {} & 1-element_of W = 1; definition let W,A1; redefine func succ A1 -> non empty Ordinal of W; let B1; redefine func A1 +^ B1 -> Ordinal of W; end; definition let W,A1,B1; redefine func A1 *^ B1 -> Ordinal of W; end; theorem A1 in dom phi; theorem dom fi in W & rng fi c= W implies sup fi in W; reserve L for T-Sequence; theorem phi is increasing & phi is continuous & omega in W implies ex A st A in dom phi & phi.A = A; begin reserve e,u for set; theorem A is_cofinal_with B & B is_cofinal_with C implies A is_cofinal_with C; theorem A is_cofinal_with B implies (A is limit_ordinal iff B is limit_ordinal ); registration let D; let f,g be T-Sequence of D; cluster f^g -> D-valued; end; begin reserve k,l,m,n,k1,a,b,c,i for Nat, x,y,z,y1,y2,X,Y for set, f,g for Function; definition let n be Nat; func Seg n -> set equals { k where k is Element of NAT: 1 <= k & k <= n }; end; definition let n be Nat; redefine func Seg n -> Subset of NAT; end; theorem a in Seg b iff 1 <= a & a <= b; registration let n be zero Nat; cluster Seg n -> empty; end; theorem Seg 1 = { 1 } & Seg 2 = { 1,2 }; theorem a = 0 or a in Seg a; registration let n be non zero Nat; cluster Seg n -> non empty; end; theorem a+1 in Seg(a+1); theorem a <= b iff Seg a c= Seg b; theorem Seg a = Seg b implies a = b; theorem c <= a implies Seg c = Seg a /\ Seg c; theorem Seg c = Seg c /\ Seg a implies c <= a; theorem Seg a \/ { a+1 } = Seg (a+1); theorem for k being Nat holds Seg k = Seg(k + 1) \ {k + 1}; definition let IT be Relation; attr IT is FinSequence-like means ex n st dom IT = Seg n; end; registration cluster empty -> FinSequence-like for Relation; end; definition mode FinSequence is FinSequence-like Function; end; reserve p,q,r,s,t for FinSequence; registration let n be Nat; cluster Seg n -> finite; end; registration cluster FinSequence-like -> finite for Function; end; registration let n; cluster Seg n -> n-element; end; notation let p; synonym len p for card p; end; definition let p; redefine func len p -> Element of NAT means Seg it = dom p; end; definition let p; redefine func dom p -> Subset of NAT; end; theorem (ex k st dom f c= Seg k) implies ex p st f c= p; scheme SeqEx{A()->Nat,P[set,set]}: ex p st dom p = Seg A() & for k st k in Seg A() holds P[k,p.k] provided for k st k in Seg A() ex x st P[k,x]; scheme SeqLambda{A()->Nat,F(set) -> set}: ex p being FinSequence st len p = A() & for k st k in dom p holds p.k=F(k); theorem z in p implies ex k st k in dom p & z=[k,p.k]; theorem dom p = dom q & (for k st k in dom p holds p.k = q.k) implies p=q; theorem len p = len q & (for k st 1 <= k & k <= len p holds p.k = q.k) implies p=q; theorem p|(Seg a) is FinSequence; theorem rng p c= dom f implies f*p is FinSequence; theorem a <= len p & q = p|(Seg a) implies len q = a & dom q = Seg a; definition let D be set; mode FinSequence of D -> FinSequence means rng it c= D; end; registration let D be set; cluster -> D-valued for FinSequence of D; end; registration cluster empty -> FinSequence-like for Relation; end; registration let D be set; cluster FinSequence-like for PartFunc of NAT,D; end; definition let D be set; redefine mode FinSequence of D -> FinSequence-like PartFunc of NAT,D; end; reserve D for set; theorem for p being FinSequence of D holds p|(Seg a) is FinSequence of D; theorem for D being non empty set ex p being FinSequence of D st len p = a; theorem p <> {} iff len p >= 1; definition let x; func <*x*> -> set equals { [1,x] }; end; definition let D be set; func <*>D -> FinSequence of D equals {}; end; registration let D be set; cluster <*>D -> empty; end; registration let D be set; cluster empty for FinSequence of D; end; definition let p,q; func p^q -> FinSequence means dom it = Seg (len p + len q) & (for k st k in dom p holds it.k=p.k) & for k st k in dom q holds it.(len p + k) = q.k; end; theorem p = (p ^ q) | (dom p); theorem len(p^q) = len p + len q; theorem for k being Nat st len p + 1 <= k & k <= len p + len q holds (p^q).k=q.(k-len p); theorem for k being Nat st len p < k & k <= len(p^q) holds (p^q).k = q.(k - len p); theorem for k being Nat st k in dom (p^q) holds (k in dom p or ex n st n in dom q & k=len p + n ); theorem dom p c= dom(p^q); theorem x in dom q implies ex k st k=x & len p + k in dom(p^q); theorem k in dom q implies len p + k in dom(p^q); theorem rng p c= rng(p^q); theorem rng q c= rng(p^q); theorem rng(p^q) = rng p \/ rng q; theorem p^q^r = p^(q^r); theorem p^r = q^r or r^p = r^q implies p = q; theorem p^{} = p & {}^p = p; theorem p^q = {} implies p={} & q={}; definition let D be set; let p,q be FinSequence of D; redefine func p^q -> FinSequence of D; end; definition let x; redefine func <*x*> -> Function means dom it = Seg 1 & it.1 = x; end; registration let x; cluster <*x*> -> Function-like Relation-like; end; registration let x; cluster <*x*> -> FinSequence-like; end; theorem p^q is FinSequence of D implies p is FinSequence of D & q is FinSequence of D ; definition let x,y; func <*x,y*> -> set equals <*x*>^<*y*>; let z; func <*x,y,z*> -> set equals <*x*>^<*y*>^<*z*>; end; registration let x,y; cluster <*x,y*> -> Function-like Relation-like; let z; cluster <*x,y,z*> -> Function-like Relation-like; end; registration let x,y; cluster <*x,y*> -> FinSequence-like; let z; cluster <*x,y,z*> -> FinSequence-like; end; theorem <*x*> = { [1,x] }; theorem p=<*x*> iff dom p = Seg 1 & rng p = {x}; theorem p=<*x*> iff len p = 1 & rng p = {x}; theorem p = <*x*> iff len p = 1 & p.1 = x; theorem (<*x*>^p).1 = x; theorem (p^<*x*>).(len p + 1)=x; theorem <*x,y,z*>=<*x*>^<*y,z*> & <*x,y,z*>=<*x,y*>^<*z*>; theorem p = <*x,y*> iff len p = 2 & p.1=x & p.2=y; theorem p = <*x,y,z*> iff len p = 3 & p.1 = x & p.2 = y & p.3 = z; theorem p <> {} implies ex q,x st p=q^<*x*>; definition let D be non empty set; let x be Element of D; redefine func <*x*> -> FinSequence of D; end; scheme IndSeq{P[FinSequence]}: for p holds P[p] provided P[{}] and for p,x st P[p] holds P[p^<*x*>]; theorem for p,q,r,s being FinSequence st p^q = r^s & len p <= len r ex t being FinSequence st p^t = r; registration cluster -> NAT-defined for FinSequence; end; definition let D be set; func D* -> set means x in it iff x is FinSequence of D; end; registration let D be set; cluster D* -> non empty; end; theorem rng p = rng q & p is one-to-one & q is one-to-one implies len p = len q; theorem {} in D*; scheme SepSeq{D()->non empty set, P[FinSequence]}: ex X st for x holds x in X iff ex p st p in D()* & P[p] & x=p; definition let IT be Function; attr IT is FinSubsequence-like means ex k st dom IT c= Seg k; end; registration cluster FinSubsequence-like for Function; end; definition mode FinSubsequence is FinSubsequence-like Function; end; registration cluster FinSequence-like -> FinSubsequence-like for Function; let p be FinSubsequence, X be set; cluster p|X -> FinSubsequence-like; cluster X|`p -> FinSubsequence-like; end; registration cluster -> NAT-defined for FinSubsequence; end; reserve p9 for FinSubsequence; definition let X; given k being Nat such that X c= Seg k; func Sgm X -> FinSequence of NAT means rng it = X & for l,m,k1,k2 being Nat st 1 <= l & l < m & m <= len it & k1=it.l & k2=it.m holds k1 < k2; end; theorem rng Sgm dom p9 = dom p9; definition let p9; func Seq p9 -> Function equals p9* Sgm(dom p9); end; registration let p9; cluster Seq p9 -> FinSequence-like; end; theorem for X st ex k st X c= Seg k holds Sgm X = {} iff X = {}; begin theorem D is finite iff ex p st D = rng p; begin theorem Seg n,Seg m are_equipotent implies n = m; theorem Seg n,n are_equipotent; theorem card Seg n = card n; theorem X is finite implies ex n st X,Seg n are_equipotent; theorem for n being Nat holds card Seg n = n; begin registration let x be set; cluster <*x*> -> non empty; end; registration cluster non empty for FinSequence; end; registration let f1 be FinSequence, f2 be non empty FinSequence; cluster f1^f2 -> non empty; cluster f2^f1 -> non empty; end; registration let x,y be set; cluster <*x,y*> -> non empty; let z be set; cluster <*x,y,z*> -> non empty; end; scheme SeqDEx{D()->non empty set,A()->Nat,P[set,set]}: ex p being FinSequence of D() st dom p = Seg A() & for k st k in Seg A() holds P[k,p.k] provided for k st k in Seg A() ex x being Element of D() st P[k,x]; reserve D for set, p for FinSequence of D, m for Nat; definition let m; let p be FinSequence; func p|m -> FinSequence equals p|Seg m; end; definition let D,m,p; redefine func p|m -> FinSequence of D; end; registration let f be FinSequence; cluster f|0 -> empty; end; theorem len q <= i implies q|i = q; theorem i <= len q implies len(q|i) = i; theorem i in Seg n implies i+m in Seg (n+m); theorem i>0 & i+m in Seg (n+m) implies i in Seg n & i in Seg (n+m); definition let R be Relation; func R[*] -> Relation means for x,y being set holds [x,y] in it iff x in field R & y in field R & ex p being FinSequence st len p >= 1 & p.1 = x & p.(len p) = y & for i being Nat st i >= 1 & i < len p holds [p.i,p.(i+1)] in R; end; theorem for D1,D2 being set st D1 c= D2 holds D1* c= D2*; registration let D be set; cluster D* -> functional; end; theorem for p,q being FinSequence st p c= q holds len p <= len q; theorem for p,q being FinSequence, i being Nat st 1 <= i & i <= len p holds (p ^ q).i = p.i; theorem for p,q being FinSequence, i being Nat st 1 <= i & i <= len q holds (p ^ q).(len p + i) = q.i; scheme FinSegRng{m, n() -> Nat, F(set)->set, P[set]}: {F(i) where i is Element of NAT: m()<=i & i<=n() & P[i]} is finite; theorem for x1, x2, x3, x4 being set, p being FinSequence st p = <*x1*>^<*x2*>^<*x3*>^<*x4*> holds len p = 4 & p.1 = x1 & p.2 = x2 & p.3 = x3 & p.4 = x4; theorem for x1, x2, x3, x4, x5 being set, p being FinSequence st p = <*x1*>^<*x2*>^<*x3*>^<*x4*>^<*x5*> holds len p = 5 & p.1 = x1 & p.2 = x2 & p.3 = x3 & p.4 = x4 & p.5 = x5; theorem for x1, x2, x3, x4, x5, x6 being set, p being FinSequence st p = <*x1*>^<*x2*>^<*x3*>^<*x4*>^<*x5*>^<*x6*> holds len p = 6 & p.1 = x1 & p.2 = x2 & p.3 = x3 & p.4 = x4 & p.5 = x5 & p.6 = x6; theorem for x1, x2, x3, x4, x5, x6, x7 being set, p being FinSequence st p = <*x1*>^<*x2*>^<*x3*>^<*x4*>^<*x5*>^<*x6*>^<*x7*> holds len p = 7 & p.1 = x1 & p.2 = x2 & p.3 = x3 & p.4 = x4 & p.5 = x5 & p.6 = x6 & p.7 = x7; theorem for x1,x2,x3,x4, x5, x6, x7, x8 being set, p being FinSequence st p = <*x1*>^<*x2*>^<*x3*>^<*x4*>^<*x5*>^<*x6*>^<*x7*>^<*x8*> holds len p = 8 & p.1 = x1 & p.2 = x2 & p.3 = x3 & p.4 = x4 & p.5 = x5 & p.6 = x6 & p.7 = x7 & p.8 = x8; theorem for x1,x2,x3,x4,x5,x6,x7, x8, x9 being set, p being FinSequence st p = <*x1*>^<*x2*>^<*x3*>^<*x4*>^<*x5*>^<*x6*>^<*x7*>^<*x8*>^<*x9*> holds len p = 9 & p.1 = x1 & p.2 = x2 & p.3 = x3 & p.4 = x4 & p.5 = x5 & p.6 = x6 & p.7 = x7 & p.8 = x8 & p.9 = x9; theorem for p being FinSequence holds p | Seg 0 = {}; theorem for f,g being FinSequence holds f | Seg 0 = g | Seg 0; theorem for D being non empty set, x being Element of D holds <* x *> is FinSequence of D; theorem for D being set, p,q being FinSequence of D holds p ^ q is FinSequence of D; reserve a, b, c, d, e, f for set; theorem <*a*> = <*b*> implies a = b; theorem <*a,b*> = <*c,d*> implies a = c & b = d; theorem <*a,b,c*> = <*d,e,f*> implies a = d & b = e & c = f; registration cluster non empty non-empty for FinSequence; end; theorem for p,q being FinSequence st q = p|Seg n holds len q <= len p; theorem for p,r being FinSequence st r = p|Seg n ex q being FinSequence st p = r^q; registration let D be non empty set; cluster non empty for FinSequence of D; end; definition let p,q be FinSequence; redefine pred p = q means len p = len q & for k st 1 <= k & k <= len p holds p.k = q.k; end; theorem for M1, M2 being set st card M1 = 0 & card M2 = 0 holds M1 = M2; registration let n be non zero Nat; cluster Seg n -> non empty; end; theorem for p being FinSequence, n,m being Nat st m <= n holds p|n|m = p|m; reserve m for Element of NAT; theorem Seg n = (n+1) \ {0}; registration let n be Nat; cluster n-element for FinSequence; end; registration let x be set; cluster <*x*> -> 1-element; let y be set; cluster <*x,y*> -> 2-element; let z be set; cluster <*x,y,z*> -> 3-element; end; definition let X be set; attr X is FinSequence-membered means x in X implies x is FinSequence; end; registration cluster empty -> FinSequence-membered for set; end; registration cluster non empty FinSequence-membered for set; end; registration let X be set; cluster X* -> FinSequence-membered; end; theorem for f being Function st f in D* & x in dom f holds f.x in D; registration cluster FinSequence-membered -> functional for set; end; theorem for X being FinSequence-membered set ex Y being non empty set st X c= Y*; registration let X be FinSequence-membered set; cluster -> FinSequence-like for Element of X; end; registration let X be FinSequence-membered set; cluster -> FinSequence-membered for Subset of X; end; theorem for p,q being FinSequence st q = p|Seg n holds len q <= n; theorem for p,q being FinSequence st p = p^q or p = q^p holds q = {}; theorem for p,q being FinSequence st p^q = <*x*> holds p = <*x*> & q = {} or p = {} & q = <*x*>; theorem for f being n-element FinSequence holds dom f = Seg n; registration let n,m; let f be n-element FinSequence, g be m-element FinSequence; cluster f^g -> (n+m)-element; end; registration cluster increasing -> one-to-one for real-valued FinSequence; end; theorem for x, y being set st x in dom <*y*> holds x = 1; registration let X; cluster X-valued for FinSequence; end; registration let D be FinSequence-membered set; let f be D-valued Function; let x be set; cluster f.x -> FinSequence-like; end; begin reserve n,m,k for Element of NAT, D for non empty set, Z,x,y,z,y1,y2 for set, p,q for FinSequence; definition let p be natural-valued Function; let n be set; redefine func p.n -> Element of NAT; end; scheme RecEx{A() -> set,P[set,set,set]}: ex f being Function st dom f = NAT & f.0 = A() & for n being Element of NAT holds P[n,f.n,f.(n+1)] provided for n being Element of NAT for x being set ex y being set st P[n,x,y ]; scheme RecExD{D()->non empty set,A() -> Element of D(), P[set,set,set]}: ex f being Function of NAT,D() st f.0 = A() & for n being Element of NAT holds P[n,f.n,f.( n+1)] provided for n being Element of NAT for x being Element of D() ex y being Element of D() st P[n,x,y]; scheme FinRecEx{A() -> set,N() -> Nat,P[set,set,set]}: ex p being FinSequence st len p = N() & (p.1 = A() or N() = 0) & for n st 1 <= n & n < N() holds P[n,p.n, p.(n+1)] provided for n being Element of NAT st 1 <= n & n < N() for x being set ex y being set st P[n,x,y]; scheme FinRecExD{D() -> non empty set,A() -> Element of D(), N() -> Nat, P[set,set, set]}: ex p being FinSequence of D() st len p = N() & (p.1 = A() or N() = 0) & for n st 1 <= n & n < N() holds P[n,p.n,p.(n+1)] provided for n being Element of NAT st 1 <= n & n < N() for x being Element of D() ex y being Element of D() st P[n,x,y]; scheme SeqBinOpEx{S() -> FinSequence,P[set,set,set]}: ex x st ex p being FinSequence st x = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds P[S().(k+1),p.k,p.(k+1)] provided for k,x st 1 <= k & k < len S() ex y st P[S().(k+1),x,y]; scheme LambdaSeqBinOpEx{S() -> FinSequence,F(set,set) -> set}: ex x st ex p being FinSequence st x = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds p.(k+1) = F(S().(k+1),p.k); scheme FinRecUn{A() -> set,N() -> Nat, F, G() -> FinSequence, P[set,set,set]}: F() = G() provided for n st 1 <= n & n < N() for x,y1,y2 being set st P[n,x,y1] & P[n,x ,y2] holds y1 = y2 and len F() = N() & (F().1 = A() or N() = 0) & for n st 1 <= n & n < N() holds P[n,F().n,F().(n+1)] and len G() = N() & (G().1 = A() or N() = 0) & for n st 1 <= n & n < N() holds P[n,G().n,G().(n+1)]; scheme FinRecUnD{D() -> non empty set, A() -> Element of D(), N() -> Nat, F, G() -> FinSequence of D(), P[set,set,set]}: F() = G() provided for n st 1 <= n & n < N() for x,y1,y2 being Element of D() st P[n,x, y1] & P[n,x,y2] holds y1 = y2 and len F() = N() & (F().1 = A() or N() = 0) & for n st 1 <= n & n < N() holds P[n,F().n,F().(n+1)] and len G() = N() & (G().1 = A() or N() = 0) & for n st 1 <= n & n < N() holds P[n,G().n,G().(n+1)]; scheme SeqBinOpUn{S() -> FinSequence,P[set,set,set],x, y() -> set}: x() = y() provided for k,x,y1,y2,z st 1 <= k & k < len S() & z = S().(k+1) & P[z,x,y1] & P[z,x,y2] holds y1 = y2 and ex p being FinSequence st x() = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds P[S().(k+1),p.k,p.(k+1)] and ex p being FinSequence st y() = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds P[S().(k+1),p.k,p.(k+1)]; scheme LambdaSeqBinOpUn{S() -> FinSequence, F(set,set) -> set, x, y() -> set}: x() = y() provided ex p being FinSequence st x() = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds p.(k+1) = F(S().(k+1),p.k) and ex p being FinSequence st y() = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds p.(k+1) = F(S().(k+1),p.k); scheme DefRec{A() -> set,n() -> Nat,P[set,set,set]}: (ex y being set st ex f being Function st y = f.n() & dom f = NAT & f.0 = A() & for n holds P[n,f.n,f.(n+1)]) & for y1,y2 being set st (ex f being Function st y1 = f.n() & dom f = NAT & f.0 = A() & for n holds P[n,f.n,f.(n+1)]) & (ex f being Function st y2 = f.n() & dom f = NAT & f.0 = A() & for n holds P[n,f.n,f.(n+1)]) holds y1 = y2 provided for n,x ex y st P[n,x,y] and for n,x,y1,y2 st P[n,x,y1] & P[n,x,y2] holds y1 = y2; scheme LambdaDefRec{A() -> set,n() -> Nat,RecFun(set,set) -> set}: (ex y being set st ex f being Function st y = f.n() & dom f = NAT & f.0 = A() & for n holds f.( n+1) = RecFun(n,f.n)) & for y1,y2 being set st (ex f being Function st y1 = f.n () & dom f = NAT & f.0 = A() & for n holds f.(n+1) = RecFun(n,f.n)) & (ex f being Function st y2 = f.n() & dom f = NAT & f.0 = A() & for n holds f.(n+1) = RecFun(n,f.n)) holds y1 = y2; scheme DefRecD{D() -> non empty set,A() -> (Element of D()), n() -> Nat,P[set,set, set]}: (ex y being Element of D() st ex f being Function of NAT,D() st y = f.n( ) & f.0 = A() & for n holds P[n,f.n,f.(n+1)]) & for y1,y2 being Element of D() st (ex f being Function of NAT,D() st y1 = f.n() & f.0 = A() & for n holds P[n, f.n,f.(n+1)]) & (ex f being Function of NAT,D() st y2 = f.n() & f.0 = A() & for n holds P[n,f.n,f.(n+1)]) holds y1 = y2 provided for n being Element of NAT,x being Element of D() ex y being Element of D() st P[n,x,y] and for n being Element of NAT, x,y1,y2 being Element of D() st P[n,x,y1 ] & P[n,x,y2] holds y1 = y2; scheme LambdaDefRecD{D() -> non empty set, A() -> Element of D(), n() -> Nat, RecFun(set,set) -> Element of D()}: (ex y being Element of D() st ex f being Function of NAT,D() st y = f.n() & f.0 = A() & for n being Nat holds f.(n+1) = RecFun(n,f.n)) & for y1,y2 being Element of D() st (ex f being Function of NAT, D() st y1 = f.n() & f.0 = A() & for n being Nat holds f.(n+1) = RecFun(n,f.n)) & (ex f being Function of NAT,D() st y2 = f.n() & f.0 = A() & for n being Nat holds f.(n+1) = RecFun(n,f.n)) holds y1 = y2; scheme SeqBinOpDef{S() -> FinSequence,P[set,set,set]}: (ex x st ex p being FinSequence st x = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds P[S().(k+1),p.k,p.(k+1)]) & for x,y st (ex p being FinSequence st x = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds P[S().(k+1),p.k,p.(k+1)]) & (ex p being FinSequence st y = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds P[S().(k+1),p.k,p.(k+1)]) holds x = y provided for k,y st 1 <= k & k < len S() ex z st P[S().(k+1),y,z] and for k,x,y1,y2,z st 1 <= k & k < len S() & z = S().(k+1) & P[z,x,y1] & P[z,x,y2] holds y1 = y2; scheme LambdaSeqBinOpDef{S() -> FinSequence,F(set,set) -> set}: (ex x st ex p being FinSequence st x = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds p.(k+1) = F(S().(k+1),p.k)) & for x,y st (ex p being FinSequence st x = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds p.(k+1) = F(S().(k+1),p.k)) & (ex p being FinSequence st y = p.(len p) & len p = len S() & p.1 = S().1 & for k st 1 <= k & k < len S() holds p.(k+1) = F(S().(k+1),p.k)) holds x = y; scheme SeqExD{D() -> non empty set, N() -> Element of NAT, P[set,set]}: ex p being FinSequence of D() st dom p = Seg N() & for k being Element of NAT st k in Seg N() holds P[k,p/.k] provided for k being Element of NAT st k in Seg N() ex x being Element of D() st P[k,x]; scheme FinRecExD2{D() -> non empty set,A() -> (Element of D()), N() -> Element of NAT, P[set,set,set]}: ex p being FinSequence of D() st len p = N() & (p/.1 = A( ) or N() = 0) & for n being Element of NAT st 1 <= n & n <= N()-1 holds P[n,p/. n,p/.(n+1)] provided for n being Element of NAT st 1 <= n & n <= N()-1 holds for x being Element of D() ex y being Element of D() st P[n,x,y]; begin registration cluster complex-valued for FinSequence; end; registration let r be rational number; cluster |. r .| -> rational; end; definition let f1,f2 be complex-valued Function; func f1 + f2 -> Function means dom it = dom f1 /\ dom f2 & for c being set st c in dom it holds it.c = f1.c + f2.c; commutativity; end; registration let f1,f2 be complex-valued Function; cluster f1+f2 -> complex-valued; end; registration let f1,f2 be real-valued Function; cluster f1+f2 -> real-valued; end; registration let f1,f2 be RAT-valued Function; cluster f1+f2 -> RAT-valued; end; registration let f1,f2 be INT-valued Function; cluster f1+f2 -> INT-valued; end; registration let f1,f2 be natural-valued Function; cluster f1+f2 -> natural-valued; end; definition let C be set; let D1,D2 be complex-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1+f2 -> PartFunc of C,COMPLEX; end; definition let C be set; let D1,D2 be real-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1+f2 -> PartFunc of C,REAL; end; definition let C be set; let D1,D2 be rational-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1+f2 -> PartFunc of C,RAT; end; definition let C be set; let D1,D2 be integer-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1+f2 -> PartFunc of C,INT; end; definition let C be set; let D1,D2 be natural-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1+f2 -> PartFunc of C,NAT; end; registration let C be set; let D1,D2 be complex-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1+f2 -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D1,D2 be real-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1+f2 -> total for PartFunc of C,REAL; end; registration let C be set; let D1,D2 be rational-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1+f2 -> total for PartFunc of C,RAT; end; registration let C be set; let D1,D2 be integer-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1+f2 -> total for PartFunc of C,INT; end; registration let C be set; let D1,D2 be natural-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1+f2 -> total for PartFunc of C,NAT; end; theorem for C being set, D1,D2 being complex-membered non empty set for f1 being Function of C,D1, f2 being Function of C,D2 for c being Element of C holds (f1+f2).c = f1.c + f2.c; registration let f1, f2 be complex-valued FinSequence; cluster f1+f2 -> FinSequence-like; end; begin definition let f be complex-valued Function, r be complex number; func r + f -> Function means dom it = dom f & for c being set st c in dom it holds it.c = r + f.c; end; notation let f be complex-valued Function, r be complex number; synonym f + r for r + f; end; registration let f be complex-valued Function, r be complex number; cluster r+f -> complex-valued; end; registration let f be real-valued Function, r be real number; cluster r+f -> real-valued; end; registration let f be RAT-valued Function, r be rational number; cluster r+f -> RAT-valued; end; registration let f be INT-valued Function, r be integer number; cluster r+f -> INT-valued; end; registration let f be natural-valued Function, r be Nat; cluster r+f -> natural-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; let r be complex number; redefine func r+f -> PartFunc of C,COMPLEX; end; definition let C be set; let D be real-membered set; let f be PartFunc of C,D; let r be real number; redefine func r+f -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; let r be rational number; redefine func r+f -> PartFunc of C,RAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; let r be integer number; redefine func r+f -> PartFunc of C,INT; end; definition let C be set; let D be natural-membered set; let f be PartFunc of C,D; let r be Nat; redefine func r+f -> PartFunc of C,NAT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; let r be complex number; cluster r+f -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D be real-membered non empty set; let f be Function of C,D; let r be real number; cluster r+f -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; let r be rational number; cluster r+f -> total for PartFunc of C,RAT; end; registration let C be set; let D be integer-membered non empty set; let f be Function of C,D; let r be integer number; cluster r+f -> total for PartFunc of C,INT; end; registration let C be set; let D be natural-membered non empty set; let f be Function of C,D; let r be Nat; cluster r+f -> total for PartFunc of C,NAT; end; theorem for C being non empty set, D being complex-membered non empty set for f being Function of C,D, r being complex number for c being Element of C holds (r+f).c = r + f.c; registration let f be complex-valued FinSequence, r be complex number; cluster r+f -> FinSequence-like; end; begin definition let f be complex-valued Function, r be complex number; func f - r -> Function equals -r + f; end; theorem for f being complex-valued Function, r being complex number holds dom (f-r) = dom f & for c being set st c in dom f holds (f-r).c = f.c - r; registration let f be complex-valued Function, r be complex number; cluster f-r -> complex-valued; end; registration let f be real-valued Function, r be real number; cluster f-r -> real-valued; end; registration let f be RAT-valued Function, r be rational number; cluster f-r -> RAT-valued; end; registration let f be INT-valued Function, r be integer number; cluster f-r -> INT-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; let r be complex number; redefine func f-r -> PartFunc of C,COMPLEX; end; definition let C be set; let D be real-membered set; let f be PartFunc of C,D; let r be real number; redefine func f-r -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; let r be rational number; redefine func f-r -> PartFunc of C,RAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; let r be integer number; redefine func f-r -> PartFunc of C,INT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; let r be complex number; cluster f-r -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D be real-membered non empty set; let f be Function of C,D; let r be real number; cluster f-r -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; let r be rational number; cluster f-r -> total for PartFunc of C,RAT; end; registration let C be set; let D be integer-membered non empty set; let f be Function of C,D; let r be integer number; cluster f-r -> total for PartFunc of C,INT; end; theorem for C being non empty set, D being complex-membered non empty set for f being Function of C,D, r being complex number for c being Element of C holds (f-r).c = f.c - r; registration let f be complex-valued FinSequence, r be complex number; cluster f-r -> FinSequence-like; end; begin definition let f1,f2 be complex-valued Function; func f1 (#) f2 -> Function means dom it = dom f1 /\ dom f2 & for c being set st c in dom it holds it.c = f1.c * f2.c; commutativity; end; theorem for f1,f2 being complex-valued Function for c being set holds (f1(#)f2 ).c = f1.c * f2.c; registration let f1,f2 be complex-valued Function; cluster f1(#)f2 -> complex-valued; end; registration let f1,f2 be real-valued Function; cluster f1(#)f2 -> real-valued; end; registration let f1,f2 be RAT-valued Function; cluster f1(#)f2 -> RAT-valued; end; registration let f1,f2 be INT-valued Function; cluster f1(#)f2 -> INT-valued; end; registration let f1,f2 be natural-valued Function; cluster f1(#)f2 -> natural-valued; end; definition let C be set; let D1,D2 be complex-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1(#)f2 -> PartFunc of C,COMPLEX; end; definition let C be set; let D1,D2 be real-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1(#)f2 -> PartFunc of C,REAL; end; definition let C be set; let D1,D2 be rational-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1(#)f2 -> PartFunc of C,RAT; end; definition let C be set; let D1,D2 be integer-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1(#)f2 -> PartFunc of C,INT; end; definition let C be set; let D1,D2 be natural-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1(#)f2 -> PartFunc of C,NAT; end; registration let C be set; let D1,D2 be complex-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1(#)f2 -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D1,D2 be real-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1(#)f2 -> total for PartFunc of C,REAL; end; registration let C be set; let D1,D2 be rational-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1(#)f2 -> total for PartFunc of C,RAT; end; registration let C be set; let D1,D2 be integer-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1(#)f2 -> total for PartFunc of C,INT; end; registration let C be set; let D1,D2 be natural-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1(#)f2 -> total for PartFunc of C,NAT; end; registration let f1, f2 be complex-valued FinSequence; cluster f1(#)f2 -> FinSequence-like; end; begin definition let f be complex-valued Function, r be complex number; func r (#) f -> Function means dom it = dom f & for c being set st c in dom it holds it.c = r * f.c; end; notation let f be complex-valued Function, r be complex number; synonym f (#) r for r (#) f; end; theorem for f being complex-valued Function, r being complex number for c being set holds (r(#)f).c = r * f.c; registration let f be complex-valued Function, r be complex number; cluster r(#)f -> complex-valued; end; registration let f be real-valued Function, r be real number; cluster r(#)f -> real-valued; end; registration let f be RAT-valued Function, r be rational number; cluster r(#)f -> RAT-valued; end; registration let f be INT-valued Function, r be integer number; cluster r(#)f -> INT-valued; end; registration let f be natural-valued Function, r be Nat; cluster r(#)f -> natural-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; let r be complex number; redefine func r(#)f -> PartFunc of C,COMPLEX; end; definition let C be set; let D be real-membered set; let f be PartFunc of C,D; let r be real number; redefine func r(#)f -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; let r be rational number; redefine func r(#)f -> PartFunc of C,RAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; let r be integer number; redefine func r(#)f -> PartFunc of C,INT; end; definition let C be set; let D be natural-membered set; let f be PartFunc of C,D; let r be Nat; redefine func r(#)f -> PartFunc of C,NAT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; let r be complex number; cluster r(#)f -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D be real-membered non empty set; let f be Function of C,D; let r be real number; cluster r(#)f -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; let r be rational number; cluster r(#)f -> total for PartFunc of C,RAT; end; registration let C be set; let D be integer-membered non empty set; let f be Function of C,D; let r be integer number; cluster r(#)f -> total for PartFunc of C,INT; end; registration let C be set; let D be natural-membered non empty set; let f be Function of C,D; let r be Nat; cluster r(#)f -> total for PartFunc of C,NAT; end; theorem for C being non empty set, D being complex-membered non empty set for f being Function of C,D, r being complex number for g being Function of C, COMPLEX st for c being Element of C holds g.c = r * f.c holds g = r(#)f; registration let f be complex-valued FinSequence, r be complex number; cluster r(#)f -> FinSequence-like; end; begin definition let f be complex-valued Function; func -f -> complex-valued Function equals (-1) (#) f; involutiveness; end; theorem for f being complex-valued Function holds dom -f = dom f & for c being set holds (-f).c = -(f.c); theorem for f being complex-valued Function, g being Function st dom f = dom g & for c being set st c in dom f holds g.c = -(f.c) holds g = -f; registration let f be complex-valued Function; cluster -f -> complex-valued; end; registration let f be real-valued Function; cluster -f -> real-valued; end; registration let f be RAT-valued Function; cluster -f -> RAT-valued; end; registration let f be INT-valued Function; cluster -f -> INT-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; redefine func -f -> PartFunc of C,COMPLEX; end; definition let C be set; let D be real-membered set; let f be PartFunc of C,D; redefine func -f -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; redefine func -f -> PartFunc of C,RAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; redefine func -f -> PartFunc of C,INT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; cluster -f -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D be real-membered non empty set; let f be Function of C,D; cluster -f -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; cluster -f -> total for PartFunc of C,RAT; end; registration let C be set; let D be integer-membered non empty set; let f be Function of C,D; cluster -f -> total for PartFunc of C,INT; end; registration let f be complex-valued FinSequence; cluster -f -> FinSequence-like; end; begin definition let f be complex-valued Function; func f" -> complex-valued Function means dom it = dom f & for c being set st c in dom it holds it.c = (f.c)"; involutiveness; end; theorem for f being complex-valued Function holds for c being set holds f".c = (f.c)"; registration let f be real-valued Function; cluster f" -> real-valued; end; registration let f be RAT-valued Function; cluster f" -> RAT-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; redefine func f" -> PartFunc of C,COMPLEX; end; definition let C be set; let D be real-membered set; let f be PartFunc of C,D; redefine func f" -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; redefine func f" -> PartFunc of C,RAT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; cluster f" -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D be real-membered non empty set; let f be Function of C,D; cluster f" -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; cluster f" -> total for PartFunc of C,RAT; end; registration let f be complex-valued FinSequence; cluster f" -> FinSequence-like; end; begin definition let f be complex-valued Function; func f^2 -> Function equals f (#) f; end; theorem for f being complex-valued Function holds dom (f^2) = dom f & for c being set holds f^2.c = (f.c)^2; registration let f be complex-valued Function; cluster f^2 -> complex-valued; end; registration let f be real-valued Function; cluster f^2 -> real-valued; end; registration let f be RAT-valued Function; cluster f^2 -> RAT-valued; end; registration let f be INT-valued Function; cluster f^2 -> INT-valued; end; registration let f be natural-valued Function; cluster f^2 -> natural-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; redefine func f^2 -> PartFunc of C,COMPLEX; end; definition let C be set; let D be real-membered set; let f be PartFunc of C,D; redefine func f^2 -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; redefine func f^2 -> PartFunc of C,RAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; redefine func f^2 -> PartFunc of C,INT; end; definition let C be set; let D be natural-membered set; let f be PartFunc of C,D; redefine func f^2 -> PartFunc of C,NAT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; cluster f^2 -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D be real-membered non empty set; let f be Function of C,D; cluster f^2 -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; cluster f^2 -> total for PartFunc of C,RAT; end; registration let C be set; let D be integer-membered non empty set; let f be Function of C,D; cluster f^2 -> total for PartFunc of C,INT; end; registration let C be set; let D be natural-membered non empty set; let f be Function of C,D; cluster f^2 -> total for PartFunc of C,NAT; end; registration let f be complex-valued FinSequence; cluster f^2 -> FinSequence-like; end; begin definition let f1,f2 be complex-valued Function; func f1 - f2 -> Function equals f1 + - f2; end; registration let f1,f2 be complex-valued Function; cluster f1-f2 -> complex-valued; end; registration let f1,f2 be real-valued Function; cluster f1-f2 -> real-valued; end; registration let f1,f2 be RAT-valued Function; cluster f1-f2 -> RAT-valued; end; registration let f1,f2 be INT-valued Function; cluster f1-f2 -> INT-valued; end; theorem for f1,f2 being complex-valued Function holds dom (f1-f2) = dom f1 /\ dom f2; theorem for f1,f2 being complex-valued Function for c being set st c in dom ( f1-f2) holds (f1-f2).c = f1.c - f2.c; theorem for f1,f2 being complex-valued Function, f being Function st dom f = dom (f1-f2) & for c being set st c in dom f holds f.c = f1.c - f2.c holds f = f1-f2; definition let C be set; let D1,D2 be complex-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1-f2 -> PartFunc of C,COMPLEX; end; definition let C be set; let D1,D2 be real-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1-f2 -> PartFunc of C,REAL; end; definition let C be set; let D1,D2 be rational-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1-f2 -> PartFunc of C,RAT; end; definition let C be set; let D1,D2 be integer-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1-f2 -> PartFunc of C,INT; end; registration let C be set; let D1,D2 be complex-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1-f2 -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D1,D2 be real-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1-f2 -> total for PartFunc of C,REAL; end; registration let C be set; let D1,D2 be rational-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1-f2 -> total for PartFunc of C,RAT; end; registration let C be set; let D1,D2 be integer-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1-f2 -> total for PartFunc of C,INT; end; theorem for C being set, D1,D2 being complex-membered non empty set for f1 being Function of C,D1, f2 being Function of C,D2 for c being Element of C holds (f1-f2).c = f1.c - f2.c; registration let f1, f2 be complex-valued FinSequence; cluster f1-f2 -> FinSequence-like; end; begin definition let f1,f2 be complex-valued Function; func f1 /" f2 -> Function equals f1 (#) (f2"); end; theorem for f1,f2 being complex-valued Function holds dom (f1/"f2) = dom f1 /\ dom f2; theorem for f1,f2 being complex-valued Function for c being set holds (f1/"f2) .c = f1.c / f2.c; registration let f1,f2 be complex-valued Function; cluster f1/"f2 -> complex-valued; end; registration let f1,f2 be real-valued Function; cluster f1/"f2 -> real-valued; end; registration let f1,f2 be RAT-valued Function; cluster f1/"f2 -> RAT-valued; end; definition let C be set; let D1,D2 be complex-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1/"f2 -> PartFunc of C,COMPLEX; end; definition let C be set; let D1,D2 be real-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1/"f2 -> PartFunc of C,REAL; end; definition let C be set; let D1,D2 be rational-membered set; let f1 be PartFunc of C,D1; let f2 be PartFunc of C,D2; redefine func f1/"f2 -> PartFunc of C,RAT; end; registration let C be set; let D1,D2 be complex-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1/"f2 -> total for PartFunc of C,COMPLEX; end; registration let C be set; let D1,D2 be real-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1/"f2 -> total for PartFunc of C,REAL; end; registration let C be set; let D1,D2 be rational-membered non empty set; let f1 be Function of C,D1; let f2 be Function of C,D2; cluster f1/"f2 -> total for PartFunc of C,RAT; end; registration let f1, f2 be complex-valued FinSequence; cluster f1/"f2 -> FinSequence-like; end; begin definition let f be complex-valued Function; func |. f .| -> real-valued Function means dom it = dom f & for c being set st c in dom it holds it.c = |. f.c .|; projectivity; end; notation let f be complex-valued Function; synonym abs f for |. f .|; end; theorem for f being complex-valued Function holds for c being set holds |.f.|. c = |.f.c.|; registration let f be RAT-valued Function; cluster |.f.| -> RAT-valued; end; registration let f be INT-valued Function; cluster |.f.| -> natural-valued; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; redefine func |.f.| -> PartFunc of C,REAL; end; definition let C be set; let D be complex-membered set; let f be PartFunc of C,D; redefine func abs(f) -> PartFunc of C,REAL; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; redefine func |.f.| -> PartFunc of C,RAT; end; definition let C be set; let D be rational-membered set; let f be PartFunc of C,D; redefine func abs(f) -> PartFunc of C,RAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; redefine func |.f.| -> PartFunc of C,NAT; end; definition let C be set; let D be integer-membered set; let f be PartFunc of C,D; redefine func abs(f) -> PartFunc of C,NAT; end; registration let C be set; let D be complex-membered non empty set; let f be Function of C,D; cluster |.f.| -> total for PartFunc of C,REAL; end; registration let C be set; let D be rational-membered non empty set; let f be Function of C,D; cluster |.f.| -> total for PartFunc of C,RAT; end; registration let C be set; let D be integer-membered non empty set; let f be Function of C,D; cluster |.f.| -> total for PartFunc of C,NAT; end; registration let f be complex-valued FinSequence; cluster |.f.| -> FinSequence-like; end; theorem for f, g being FinSequence, h being Function st dom h = dom f /\ dom g holds h is FinSequence; begin reserve m,j,p,q,n,l for Element of NAT; definition let p be Function, k be Nat; func Shift(p,k) -> Function means dom it = { m+k:m in dom p } & for m st m in dom p holds it.(m+k) = p.m; end; registration let p be Function, k be Nat; cluster Shift(p,k) -> NAT-defined; end; theorem for P,Q being Function, k being Nat st P c= Q holds Shift(P ,k) c= Shift(Q,k); theorem for n,m being Nat for I being Function holds Shift(Shift(I,m),n) = Shift(I,m+n); theorem for s,f be Function for n being Nat holds Shift(f*s,n) = f*Shift(s,n); theorem for I,J being Function, n being Nat holds Shift(I +* J, n) = Shift(I,n) +* Shift(J,n); theorem for p being Function,k,il being Nat st il in dom p holds il+k in dom Shift(p,k); theorem for p being Function, k being Nat holds rng Shift(p,k) c= rng p; theorem for p being Function st dom p c= NAT for k being Nat holds rng Shift(p,k) = rng p; registration let p be finite Function, k be Nat; cluster Shift(p,k) -> finite; end; reserve e1,e2 for ext-real number; definition let X be non empty ext-real-membered set, s be sequence of X; redefine attr s is increasing means for n being Nat holds s.n < s.(n+1); redefine attr s is decreasing means for n being Nat holds s.n > s.(n+1); redefine attr s is non-decreasing means for n being Nat holds s.n <= s.(n+1); redefine attr s is non-increasing means for n being Nat holds s.n >= s.(n+1); end; scheme SubSeqChoice { X() -> non empty set, S() -> sequence of X(), P[set]} : ex S1 being subsequence of S() st for n being Element of NAT holds P[S1.n] provided for n being Element of NAT ex m being Element of NAT st n <= m & P[S ().m]; theorem for k being Nat for F being NAT-defined Function holds dom F,dom Shift(F,k) are_equipotent; registration let F be NAT-defined Function; reduce Shift(F,0) to F; end; theorem for F being NAT-defined Function holds Shift(F,0) = F; registration let X be non empty set; let F be X-valued Function, k be Nat; cluster Shift(F,k) -> X-valued; end; registration cluster non empty NAT-defined for Function; end; registration let F be empty Function, k be Nat; cluster Shift(F,k) -> empty; end; registration let F be non empty NAT-defined Function, k be Nat; cluster Shift(F,k) -> non empty; end; theorem for F being Function, k being Nat st k > 0 holds not 0 in dom Shift(F,k); registration cluster NAT-defined finite non empty for Function; end; registration let F be NAT-defined Relation; cluster dom F -> natural-membered; end; definition let F be non empty NAT-defined finite Function; func LastLoc F -> Element of NAT equals max dom F; end; definition let F be non empty NAT-defined finite Function; func CutLastLoc F -> Function equals F \ ( LastLoc F .--> F.LastLoc F ); end; registration let F be non empty NAT-defined finite Function; cluster CutLastLoc F -> NAT-defined finite; end; theorem for F being non empty NAT-defined finite Function holds LastLoc F in dom F; theorem for F, G being non empty NAT-defined finite Function st F c= G holds LastLoc F <= LastLoc G; theorem for F being non empty NAT-defined finite Function, l being Element of NAT st l in dom F holds l <= LastLoc F; definition let F be non empty NAT-defined Function; func FirstLoc F -> Element of NAT equals min dom F; end; theorem for F being non empty NAT-defined finite Function holds FirstLoc F in dom F; theorem for F, G being non empty NAT-defined finite Function st F c= G holds FirstLoc G <= FirstLoc F; theorem for l1 being Element of NAT for F being non empty NAT-defined finite Function st l1 in dom F holds FirstLoc F <= l1; theorem for F being non empty NAT-defined finite Function holds dom CutLastLoc F = (dom F) \ {LastLoc F}; theorem for F being non empty NAT-defined finite Function holds dom F = dom CutLastLoc F \/ {LastLoc F}; registration cluster 1-element NAT-defined finite for Function; end; registration let F be 1-element NAT-defined finite Function; cluster CutLastLoc F -> empty; end; theorem for F being non empty NAT-defined finite Function holds card CutLastLoc F = card F - 1; begin registration let X be set, f be X-defined complex-valued Function; cluster -f -> X-defined; cluster f" -> X-defined; cluster f^2 -> X-defined; cluster |.f.| -> X-defined; end; registration let X be set; cluster total for X-defined natural-valued Function; end; registration let X be set, f be total X-defined complex-valued Function; cluster -f -> total; cluster f" -> total; cluster f^2 -> total; cluster |.f.| -> total; end; registration let X be set, f be X-defined complex-valued Function, r be complex number; cluster r+f -> X-defined; cluster f-r -> X-defined; cluster r(#)f -> X-defined; end; registration let X be set, f be total X-defined complex-valued Function, r be complex number; cluster r+f -> total; cluster f-r -> total; cluster r(#)f -> total; end; registration let X be set, f1 be complex-valued Function; let f2 be X-defined complex-valued Function; cluster f1 + f2 -> X-defined; cluster f1 - f2 -> X-defined; cluster f1(#)f2 -> X-defined; cluster f1/"f2 -> X-defined; end; registration let X be set; let f1,f2 be total X-defined complex-valued Function; cluster f1 + f2 -> total; cluster f1 - f2 -> total; cluster f1(#)f2 -> total; cluster f1/"f2 -> total; end; registration let X be non empty set; let F be X-valued non empty NAT-defined finite Function; cluster CutLastLoc F -> X-valued; end; theorem for f being Function for i,n being Nat st i in dom Shift(f,n) ex j being Nat st j in dom f & i = j + n; begin reserve i,j,k,l for Nat; reserve A,a,b,x,x1,x2,x3 for set; reserve D,D9,E for non empty set; reserve d,d1,d2,d3 for Element of D; reserve d9,d19,d29,d39 for Element of D9; reserve p,q,r for FinSequence; theorem min(i,j) is Element of NAT & max(i,j) is Element of NAT; theorem l = min(i,j) implies Seg i /\ Seg j = Seg l; theorem i <= j implies max(0,i-j) = 0; theorem j <= i implies max(0,i-j) = i-j; theorem max(0,i-j) is Element of NAT; theorem min(0,i) = 0 & min(i,0) = 0 & max(0,i) = i & max(i,0) = i; theorem i in Seg (l+1) implies i in Seg l or i = l+1; theorem i in Seg l implies i in Seg(l+j); theorem len p = len q & (for j st j in dom p holds p.j = q.j) implies p = q; theorem b in rng p implies ex i st i in dom p & p.i = b; theorem for D being set for p being FinSequence of D st i in dom p holds p.i in D; theorem for D being set holds (for i st i in dom p holds p.i in D) implies p is FinSequence of D; theorem <*d1,d2*> is FinSequence of D; theorem <*d1,d2,d3*> is FinSequence of D; theorem i in dom p implies i in dom(p^q); theorem len(p^<*a*>) = len p + 1; theorem p^<*a*> = q^<*b*> implies p = q & a = b; theorem len p = i + 1 implies ex q,a st p = q^<*a*>; theorem for p being FinSequence of A st len p <> 0 ex q being FinSequence of A, d being Element of A st p = q^<*d*>; theorem q = p|(Seg i) & len p <= i implies p = q; theorem q = p|(Seg i) implies len q = min(i,len p); theorem len r = i+j implies ex p,q st len p = i & len q = j & r = p^q; theorem for r being FinSequence of D st len r = i+j ex p,q being FinSequence of D st len p = i & len q = j & r = p^q; scheme SeqLambdaD{i()->Nat,D()->non empty set,F(set)->Element of D()}: ex z being FinSequence of D() st len z = i() & for j being Nat st j in dom z holds z.j = F (j); scheme IndSeqD{D()->set, P[set]}: for p being FinSequence of D() holds P[p] provided P[<*> D()] and for p being FinSequence of D() for x being Element of D() st P[p] holds P[p^<*x*>]; theorem for D being set, D1 being Subset of D for p being FinSequence of D1 holds p is FinSequence of D; theorem for f being Function of Seg i, D holds f is FinSequence of D; theorem for p being FinSequence of D holds p is Function of dom p, D; theorem for f being Function of NAT,D holds f|(Seg i) is FinSequence of D; theorem for f being Function of NAT,D st q = f|(Seg i) holds len q = i; theorem for f being Function st rng p c= dom f & q = f*p holds len q = len p; theorem D = Seg i implies for p being FinSequence for q being FinSequence of D st i <= len p holds p*q is FinSequence; theorem D = Seg i implies for p being FinSequence of D9 for q being FinSequence of D st i <= len p holds p*q is FinSequence of D9; theorem for A,D being set for p being FinSequence of A for f being Function of A,D holds f*p is FinSequence of D; theorem for p being FinSequence of A for f being Function of A,D9 st q = f*p holds len q = len p; theorem for x being set, f being Function st x in dom f holds f*<*x*> = <*f.x*>; theorem for p being FinSequence of D for f being Function of D,D9 st p = <*x1*> holds f*p = <*f.x1*>; theorem for p being FinSequence of D for f being Function of D,D9 st p = <*x1,x2*> holds f*p = <*f.x1,f.x2*>; theorem for p being FinSequence of D for f being Function of D,D9 st p = <*x1,x2,x3*> holds f*p = <*f.x1,f.x2,f.x3*>; theorem for f being Function of Seg i,Seg j st (j = 0 implies i = 0) & j <= len p holds p*f is FinSequence; theorem for f being Function of Seg i,Seg i st i <= len p holds p*f is FinSequence; theorem for f being Function of dom p,dom p holds p*f is FinSequence; theorem for f being Function of Seg i,Seg i st rng f = Seg i & i <= len p & q = p*f holds len q = i; theorem for f being Function of dom p,dom p st rng f = dom p & q = p*f holds len q = len p; theorem for f being Permutation of Seg i st i <= len p & q = p*f holds len q = i; theorem for f being Permutation of dom p st q = p*f holds len q = len p; theorem for p being FinSequence of D for f being Function of Seg i,Seg j st (j = 0 implies i = 0) & j <= len p holds p*f is FinSequence of D; theorem for p being FinSequence of D for f being Function of Seg i,Seg i st i <= len p holds p*f is FinSequence of D; theorem for p being FinSequence of D for f being Function of dom p,dom p holds p*f is FinSequence of D; theorem id Seg k is FinSequence of NAT; definition let i be Nat; func idseq i -> FinSequence equals id Seg i; end; registration let k; cluster idseq k -> k-element; end; registration cluster idseq 0 -> empty; end; theorem for k being Element of Seg i holds (idseq i).k = k; theorem idseq 1 = <*1*>; theorem idseq (i+1) = (idseq i) ^ <*i+1*>; theorem idseq 2 = <*1,2*>; theorem idseq 3 = <*1,2,3*>; theorem len p <= k implies p*(idseq k) = p; theorem idseq k is Permutation of Seg k; theorem (Seg k) --> a is FinSequence; registration let k, a; cluster (Seg k) --> a -> FinSequence-like; end; definition let i be Nat, a be set; func i |-> a -> FinSequence equals Seg i --> a; end; registration let k be Nat, a be set; cluster k |-> a -> k-element; end; theorem for d being set, w being set st w in Seg k holds (k |-> d).w = d; theorem 0 |-> a = {}; theorem 1 |-> a = <*a*>; theorem (i+1) |-> a = (i |-> a) ^ <*a*>; theorem 2 |-> a = <*a,a*>; theorem 3 |-> a = <*a,a,a*>; theorem k |-> d is FinSequence of D; theorem for F being Function st [:rng p,rng q:] c= dom F holds F.:(p,q) is FinSequence; theorem for F being Function st [:rng p,rng q:] c= dom F & r = F.:(p,q) holds len r = min(len p,len q); theorem for F being Function st [:{a},rng p:] c= dom F holds F[;](a,p) is FinSequence ; theorem for F being Function st [:{a},rng p:] c= dom F & r = F[;](a,p) holds len r = len p; theorem for F being Function st [:rng p,{a}:] c= dom F holds F[:](p,a) is FinSequence ; theorem for F being Function st [:rng p,{a}:] c= dom F & r = F[:](p,a) holds len r = len p; theorem for F being Function of [:D,D9:],E for p being FinSequence of D for q being FinSequence of D9 holds F.:(p,q) is FinSequence of E; theorem for F being Function of [:D,D9:],E for p being FinSequence of D for q being FinSequence of D9 st r = F.:(p,q) holds len r = min(len p,len q); theorem for F being Function of [:D,D9:],E for p being FinSequence of D for q being FinSequence of D9 st len p = len q & r = F.:(p,q) holds len r = len p & len r = len q; theorem for F being Function of [:D,D9:],E for p being FinSequence of D for p9 being FinSequence of D9 holds F.:(<*>D,p9) = <*>E & F.:(p,<*>D9) = <*>E; theorem for F being Function of [:D,D9:],E for p being FinSequence of D for q being FinSequence of D9 st p = <*d1*> & q = <*d19*> holds F.:(p,q) = <*F.(d1, d19)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D for q being FinSequence of D9 st p = <*d1,d2*> & q = <*d19,d29*> holds F.:(p,q) = <*F .(d1,d19),F.(d2,d29)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D for q being FinSequence of D9 st p = <*d1,d2,d3*> & q = <*d19,d29,d39*> holds F.:(p,q ) = <*F.(d1,d19),F.(d2,d29),F.(d3,d39)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D9 holds F[;](d,p) is FinSequence of E; theorem for F being Function of [:D,D9:],E for p being FinSequence of D9 st r = F[;](d,p) holds len r = len p; theorem for F being Function of [:D,D9:],E holds F[;](d,<*>D9) = <*>E; theorem for F being Function of [:D,D9:],E for p being FinSequence of D9 st p = <*d19*> holds F[;](d,p) = <*F.(d,d19)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D9 st p = <*d19,d29*> holds F[;](d,p) = <*F.(d,d19),F.(d,d29)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D9 st p = <*d19,d29,d39*> holds F[;](d,p) = <*F.(d,d19),F.(d,d29),F.(d,d39)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D holds F[:](p,d9) is FinSequence of E; theorem for F being Function of [:D,D9:],E for p being FinSequence of D st r = F[:](p,d9) holds len r = len p; theorem for F being Function of [:D,D9:],E holds F[:](<*>D,d9) = <*>E; theorem for F being Function of [:D,D9:],E for p being FinSequence of D st p = <*d1*> holds F[:](p,d9) = <*F.(d1,d9)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D st p = <*d1,d2*> holds F[:](p,d9) = <*F.(d1,d9),F.(d2,d9)*>; theorem for F being Function of [:D,D9:],E for p being FinSequence of D st p = <*d1,d2,d3*> holds F[:](p,d9) = <*F.(d1,d9),F.(d2,d9),F.(d3,d9)*>; definition let D be set; mode FinSequenceSet of D -> set means a in it implies a is FinSequence of D; end; definition let D be set, S be FinSequenceSet of D; redefine mode Element of S -> FinSequence of D; end; registration let D be set; cluster non empty for FinSequenceSet of D; end; theorem for D being set holds D* is FinSequenceSet of D; definition let D be set; redefine func D* -> FinSequenceSet of D; end; theorem for D being set, D9 being FinSequenceSet of D holds D9 c= D*; theorem for D9 being Subset of D, S being FinSequenceSet of D9 holds S is FinSequenceSet of D; reserve s for Element of D*; registration let i be Nat, D; cluster i-element for FinSequence of D; end; definition let i be Nat, D be non empty set; mode Tuple of i,D is i-element FinSequence of D; end; definition let i be Nat; let D be set; func i-tuples_on D -> FinSequenceSet of D equals { s where s is Element of D*: len s = i }; end; registration let i be Nat, D; cluster i-tuples_on D -> non empty; end; registration let D; let i be Nat; cluster -> i-element for Element of i-tuples_on D; end; theorem for D be set, z being FinSequence of D holds z is Element of ( len z)-tuples_on D; theorem for D being set holds i-tuples_on D = Funcs(Seg i,D); theorem for D being set holds 0-tuples_on D = { <*>D }; theorem for z being Tuple of 0,D for t being Tuple of i, D holds z^t = t & t^z = t; theorem 1-tuples_on D = { <*d*>: not contradiction }; theorem for z being Tuple of 1,D ex d st z = <*d*>; theorem <*d*> in 1-tuples_on D; theorem 2-tuples_on D = { <*d1,d2*>: not contradiction }; theorem for z being Tuple of 2,D ex d1,d2 st z = <*d1,d2*>; theorem <*d1,d2*> in 2-tuples_on D; theorem 3-tuples_on D = { <*d1,d2,d3*>: not contradiction }; theorem for z being Tuple of 3,D ex d1,d2,d3 st z = <*d1,d2,d3*>; theorem <*d1,d2,d3*> in 3-tuples_on D; theorem (i+j)-tuples_on D = {z^t where z is Tuple of i,D, t is Tuple of j,D: not contradiction}; theorem for s being Tuple of i+j,D ex z being Element of i-tuples_on D, t being Element of j-tuples_on D st s = z^t; theorem for z being Tuple of i,D for t being Tuple of j,D holds z^t is Tuple of i+j,D ; theorem D* = union {i-tuples_on D where i is Element of NAT: not contradiction}; theorem for D9 being non empty Subset of D for z being Tuple of i,D9 holds z is Element of i-tuples_on D; theorem i-tuples_on D = j-tuples_on A implies i = j; theorem idseq i is Element of i-tuples_on NAT; theorem i |-> d is Element of i-tuples_on D; theorem for z being Tuple of i,D for f being Function of D,D9 holds f*z is Element of i-tuples_on D9; theorem for z being Tuple of i,D for f being Function of Seg i,Seg i st rng f = Seg i holds z*f is Element of i-tuples_on D; theorem for z being Tuple of i,D for f being Permutation of Seg i holds z*f is Tuple of i,D; theorem for z being Tuple of i,D for d holds (z^<*d*>).(i+1) = d; theorem for z being Tuple of i+1,D ex t being Element of i-tuples_on D, d st z = t^<*d*>; theorem for z being Tuple of i,D holds z*(idseq i) = z; theorem for z1,z2 being Tuple of i,D st for j st j in Seg i holds z1.j = z2.j holds z1 = z2; theorem for F being Function of [:D,D9:],E for z1 being Tuple of i,D for z2 being Tuple of i,D9 holds F.:(z1,z2) is Element of i -tuples_on E; theorem for F being Function of [:D,D9:],E for z being Tuple of i,D9 holds F[;](d,z) is Element of i-tuples_on E; theorem for F being Function of [:D,D9:],E for z being Tuple of i,D holds F[:](z,d9) is Element of i-tuples_on E; theorem (i+j)|->x = (i|->x)^(j|->x); theorem for i, D for x being Tuple of i,D holds dom x = Seg i; theorem for f being Function, x, y being set st x in dom f & y in dom f holds f*<*x,y*> = <*f.x,f.y*>; theorem for f being Function, x, y, z being set st x in dom f & y in dom f & z in dom f holds f*<*x,y,z*> = <*f.x,f.y,f.z*>; theorem rng <*x1,x2*> = {x1,x2}; theorem rng <*x1,x2,x3*> = {x1,x2,x3}; begin theorem for p1,p2,q being FinSequence st p1 c= q & p2 c= q & len p1 = len p2 holds p1 = p2; reserve m,n for Nat, s,w for FinSequence of NAT; theorem for D being non empty set, s being FinSequence of D st s <> {} ex w being FinSequence of D, n being Element of D st s = <*n*>^w; registration let D be set; cluster -> functional for FinSequenceSet of D; end; definition let D,n,d; redefine func n |-> d -> Element of n-tuples_on D; end; theorem for z being set holds z is Tuple of i,D iff z in i-tuples_on D; theorem for A being set, i being (Element of NAT), p being FinSequence holds p in i-tuples_on A iff len p = i & rng p c= A; theorem for A being set, i being (Element of NAT), p being FinSequence of A holds p in i-tuples_on A iff len p = i; theorem for A being set, i being Element of NAT holds i-tuples_on A c= A*; theorem for A,x being set holds x in 1-tuples_on A iff ex a being set st a in A & x = <*a*>; theorem for A,a being set st <*a*> in 1-tuples_on A holds a in A; theorem for A,x being set holds x in 2-tuples_on A iff ex a,b being set st a in A & b in A & x = <*a,b*>; theorem for A,a,b being set st <*a,b*> in 2-tuples_on A holds a in A & b in A; theorem for A,x being set holds x in 3-tuples_on A iff ex a,b,c being set st a in A & b in A & c in A & x = <*a,b,c*>; theorem for A,a,b,c being set st <*a,b,c*> in 3-tuples_on A holds a in A & b in A & c in A; theorem x in i-tuples_on A implies x is i-element FinSequence; theorem for A being non empty set, n holds n-tuples_on A c= A*; theorem n |-> x = m |-> x implies n = m; reserve i,j,e,u for set, n for Element of NAT; definition let I be set; let M be ManySortedSet of I; func M# -> ManySortedSet of I* means for i being Element of I* holds it.i = product(M*i); end; registration let I be set; let M be non-empty ManySortedSet of I; cluster M# -> non-empty; end; definition let a be set; func *-->a -> Function of NAT,{a}* means for n being Element of NAT holds it.n = n |-> a; end; theorem for a,b being set holds (a .--> b)*(n|->a) = n |-> b; theorem for a being set for M being ManySortedSet of {a} st M = a .--> D holds (M#* *-->a).n = Funcs(Seg n, D); theorem for F being total NAT-defined Function, p be NAT-defined Function, n be Element of NAT st Shift(p,n) c= F for i being Element of NAT st i in dom p holds F.(n+i) = p.i; registration let i be Nat; cluster i |-> 0 -> empty-yielding; end; registration let D be set; cluster -> FinSequence-membered for FinSequenceSet of D; end; begin reserve f for Function; reserve n,k,n1 for Element of NAT; reserve r,p for real number; reserve x,y,z for set; definition mode Real_Sequence is sequence of REAL; end; reserve seq,seq1,seq2,seq3,seq9,seq19 for Real_Sequence; theorem f is Real_Sequence iff (dom f=NAT & for x st x in NAT holds f.x is real); theorem f is Real_Sequence iff (dom f=NAT & for n holds f.n is real); definition let f be real-valued Function, x be set; redefine func f.x -> Real; end; registration cluster non-zero for PartFunc of NAT,REAL; end; theorem for f being non-zero PartFunc of NAT,REAL holds rng f c= REAL \ {0}; theorem seq is non-zero iff for x st x in NAT holds seq.x<>0; theorem seq is non-zero iff for n holds seq.n<>0; theorem for r ex seq st rng seq={r}; scheme ExRealSeq{F(set)->real number}: ex seq st for n holds seq.n=F(n); scheme PartFuncExD9{D,C()->non empty set, P[set,set]}: ex f being PartFunc of D(),C () st (for d be Element of D() holds d in dom f iff (ex c be Element of C() st P[d,c])) & for d be Element of D() st d in dom f holds P[d,f.d]; scheme LambdaPFD9{D,C()->non empty set, F(set)->Element of C(), P[set]}: ex f being PartFunc of D(),C() st (for d be Element of D() holds d in dom f iff P[d]) & for d be Element of D() st d in dom f holds f.d = F(d); scheme UnPartFuncD9{C,D,X() -> set, F(set)->set}: for f,g being PartFunc of C(),D() st (dom f=X() & for c be Element of C() st c in dom f holds f.c = F(c)) & (dom g=X() & for c be Element of C() st c in dom g holds g.c = F(c)) holds f = g; theorem seq = seq1 + seq2 iff for n holds seq.n =seq1.n + seq2.n; theorem seq = seq1 (#) seq2 iff for n holds seq.n =seq1.n * seq2.n; theorem seq1 = r(#)seq2 iff for n holds seq1.n=r*seq2.n; theorem seq1 = -seq2 iff for n holds seq1.n= -seq2.n; theorem seq1 - seq2 = seq1 +- seq2; theorem seq1 = abs seq iff for n holds seq1.n= abs(seq.n); theorem (seq1 + seq2) + seq3 = seq1 + (seq2 + seq3); theorem (seq1 (#) seq2) (#) seq3 = seq1 (#) (seq2 (#) seq3); theorem (seq1 + seq2) (#) seq3 = seq1 (#) seq3 + seq2 (#) seq3; theorem seq3 (#) (seq1 + seq2) = seq3 (#) seq1 + seq3 (#) seq2; theorem -seq = (-1) (#) seq; theorem r(#)(seq1(#)seq2)=r(#)seq1(#)seq2; theorem r (#) (seq1 (#) seq2) = seq1 (#) (r (#) seq2); theorem (seq1 - seq2) (#) seq3 = seq1 (#) seq3 - seq2 (#) seq3; theorem seq3(#)seq1-seq3(#)seq2=seq3(#)(seq1-seq2); theorem r(#)(seq1+seq2)=r(#)seq1+r(#)seq2; theorem (r*p)(#)seq=r(#)(p(#)seq); theorem r(#)(seq1-seq2)=r(#)seq1-r(#)seq2; theorem r(#)(seq1/"seq)=(r(#)seq1)/"seq; theorem seq1-(seq2+seq3)=seq1-seq2-seq3; theorem 1(#)seq=seq; canceled; theorem seq1 - (-seq2) = seq1 + seq2; theorem seq1-(seq2-seq3)=seq1-seq2+seq3; theorem seq1+(seq2-seq3)=seq1+seq2-seq3; theorem (-seq1)(#)seq2=-(seq1(#)seq2) & seq1(#)(-seq2)=-(seq1(#)seq2); theorem seq is non-zero implies seq" is non-zero; canceled; theorem seq is non-zero & seq1 is non-zero iff seq(#)seq1 is non-zero; theorem seq"(#)seq1"=(seq(#)seq1)"; theorem seq is non-zero implies (seq1/"seq)(#)seq=seq1; theorem (seq9/"seq)(#)(seq19/"seq1)=(seq9(#)seq19)/"(seq(#)seq1); theorem seq is non-zero & seq1 is non-zero implies seq/"seq1 is non-zero; theorem (seq/"seq1)"=seq1/"seq; theorem seq2(#)(seq1/"seq)=(seq2(#)seq1)/"seq; theorem seq2/"(seq/"seq1)=(seq2(#)seq1)/"seq; theorem seq1 is non-zero implies seq2/"seq=(seq2(#)seq1)/"(seq(#)seq1); theorem r<>0 & seq is non-zero implies r(#)seq is non-zero; theorem seq is non-zero implies -seq is non-zero; theorem (r(#)seq)"=r"(#)seq"; theorem (-seq)" = (-1)(#)seq"; theorem -seq1/"seq=(-seq1)/"seq & seq1/"(-seq)=-seq1/"seq; theorem seq1/"seq + seq19/"seq = (seq1 + seq19) /" seq & seq1/"seq - seq19/" seq = (seq1 - seq19) /" seq; theorem seq is non-zero & seq9 is non-zero implies seq1/"seq + seq19/"seq9=( seq1(#)seq9+seq19(#)seq)/"(seq(#)seq9) & seq1/"seq - seq19/"seq9=(seq1(#)seq9- seq19(#)seq)/"(seq(#)seq9); theorem (seq19/"seq)/"(seq9/"seq1)=(seq19(#)seq1)/"(seq(#)seq9); theorem abs(seq(#)seq9)=abs(seq)(#)abs(seq9); theorem seq is non-zero implies abs(seq) is non-zero; theorem abs(seq)"=abs(seq"); theorem abs(seq9/"seq)=abs(seq9)/"abs(seq); theorem abs(r(#)seq)=abs(r)(#)abs(seq); begin reserve f for Function; reserve n,k,n1 for Element of NAT; reserve r,p for Element of COMPLEX; reserve x,y for set; definition mode Complex_Sequence is sequence of COMPLEX; end; reserve seq,seq1,seq2,seq3,seq9,seq19 for Complex_Sequence; theorem f is Complex_Sequence iff (dom f=NAT & for x st x in NAT holds f. x is Element of COMPLEX); theorem f is Complex_Sequence iff (dom f=NAT & for n holds f.n is Element of COMPLEX) ; scheme ExComplexSeq{F(set) -> complex number}: ex seq st for n holds seq.n=F(n); notation let f be complex-valued Relation; synonym f is non-zero for f is non-empty; end; registration cluster non-zero for Complex_Sequence; end; theorem seq is non-zero iff for x st x in NAT holds seq.x<>0c; theorem seq is non-zero iff for n holds seq.n<>0c; theorem for IT being non-zero Complex_Sequence holds rng IT c= COMPLEX \ {0c}; theorem for r ex seq st rng seq={r}; theorem (seq1+seq2)+seq3=seq1+(seq2+seq3); theorem (seq1(#)seq2)(#)seq3=seq1(#)(seq2(#)seq3); theorem (seq1+seq2)(#)seq3=seq1(#)seq3+seq2(#)seq3; theorem seq3(#)(seq1+seq2)=seq3(#)seq1+seq3(#)seq2; theorem -seq=(-1r)(#)seq; theorem r(#)(seq1(#)seq2)=r(#)seq1(#)seq2; theorem r(#)(seq1(#)seq2)=seq1(#)(r(#)seq2); theorem (seq1-seq2)(#)seq3=seq1(#)seq3-seq2(#)seq3; theorem seq3(#)seq1-seq3(#)seq2=seq3(#)(seq1-seq2); theorem r(#)(seq1+seq2)=r(#)seq1+r(#)seq2; theorem (r*p)(#)seq=r(#)(p(#)seq); theorem r(#)(seq1-seq2)=r(#)seq1-r(#)seq2; theorem r(#)(seq1/"seq)=(r(#)seq1)/"seq; theorem seq1-(seq2+seq3)=seq1-seq2-seq3; theorem 1r(#)seq=seq; theorem --seq = seq; theorem seq1 - (-seq2) = seq1 + seq2; theorem seq1 - (seq2 - seq3) = seq1 - seq2 + seq3; theorem seq1 + (seq2 - seq3) = seq1 + seq2 - seq3; theorem (-seq1)(#)seq2=-(seq1(#)seq2) & seq1(#)(-seq2)=-(seq1(#)seq2); theorem seq is non-zero implies seq" is non-zero; canceled; theorem seq is non-zero & seq1 is non-zero iff seq(#)seq1 is non-zero; theorem seq"(#)seq1"=(seq(#)seq1)"; theorem seq is non-zero implies (seq1/"seq)(#)seq=seq1; theorem (seq9/"seq)(#)(seq19/"seq1)=(seq9(#)seq19)/"(seq(#)seq1); theorem seq is non-zero & seq1 is non-zero implies seq/"seq1 is non-zero; theorem (seq/"seq1)"=seq1/"seq; theorem seq2 (#) (seq1 /" seq) = (seq2 (#) seq1) /" seq; theorem seq2/"(seq/"seq1)=(seq2(#)seq1)/"seq; theorem seq1 is non-zero implies seq2/"seq=(seq2(#)seq1)/"(seq(#)seq1); theorem r<>0c & seq is non-zero implies r(#)seq is non-zero; theorem seq is non-zero implies -seq is non-zero; theorem (r(#)seq)"=r"(#)seq"; theorem seq is non-zero implies (-seq)"=(-1r)(#)seq"; theorem seq is non-zero implies -seq1/"seq=(-seq1)/"seq & seq1/"(-seq)=-seq1/" seq; theorem seq1/"seq + seq19/"seq = (seq1+seq19) /" seq & seq1/"seq - seq19/"seq = (seq1-seq19) /" seq; theorem seq is non-zero & seq9 is non-zero implies seq1/"seq + seq19/"seq9=( seq1(#)seq9+seq19(#)seq)/"(seq(#)seq9) & seq1/"seq - seq19/"seq9=(seq1(#)seq9- seq19(#)seq)/"(seq(#)seq9); theorem (seq19/"seq)/"(seq9/"seq1)=(seq19(#)seq1)/"(seq(#)seq9); theorem |.seq(#)seq9.|=|.seq.|(#)|.seq9.|; theorem seq is non-zero implies |.seq.| is non-zero; theorem |. seq .| " = |. seq" .|; theorem |.seq9/"seq.|=|.seq9.|/"|.seq.|; theorem |.r(#)seq.|=|.r.|(#)|.seq.|; begin definition func FALSE equals 0; func TRUE equals 1; end; definition let p be set; attr p is boolean means p = FALSE or p = TRUE; end; registration cluster FALSE -> boolean; cluster TRUE -> boolean; cluster boolean for number; cluster boolean -> natural for number; end; reserve p,q,r,s for boolean number; definition let p; func 'not' p -> boolean number equals 1 - p; involutiveness; let q; func p '&' q equals p*q; commutativity; idempotence; end; registration let p,q; cluster p '&' q -> boolean; end; definition let p,q; func p 'or' q equals 'not' ('not' p '&' 'not' q); commutativity; idempotence; end; definition let p,q; func p => q equals 'not' p 'or' q; end; registration let p,q; cluster p 'or' q -> boolean; cluster p => q -> boolean; end; definition let p,q; func p <=> q equals (p => q) '&' (q => p); commutativity; end; registration let p,q; cluster p <=> q -> boolean; end; definition let p,q; func p 'nand' q equals 'not'(p '&' q); commutativity; func p 'nor' q equals 'not'(p 'or' q); commutativity; func p 'xor' q equals 'not'(p <=> q); commutativity; func p '\' q equals p '&' 'not' q; end; registration let p,q; cluster p 'nand' q -> boolean; cluster p 'nor' q -> boolean; cluster p 'xor' q -> boolean; cluster p '\' q -> boolean; end; begin theorem p '&' p = p; theorem p '&' (p '&' q) = p '&' q; theorem p 'or' p = p; theorem p 'or' (p 'or' q) = p 'or' q; theorem p 'or' p '&' q = p; theorem p '&' (p 'or' q) = p; theorem p '&' (p 'or' q) = p 'or' (p '&' q); theorem p '&' (q 'or' r) = p '&' q 'or' p '&' r; theorem p 'or' q '&' r = (p 'or' q) '&' (p 'or' r); theorem p '&' q 'or' q '&' r 'or' r '&' p = (p 'or' q) '&' (q 'or' r) '&' (r 'or' p); theorem p '&' ('not' p 'or' q) = p '&' q; theorem p 'or' 'not' p '&' q = p 'or' q; theorem p => (p => q) = p => q; theorem p '&' (p => q) = p '&' q; theorem p => (p '&' q) = p => q; theorem p '&' 'not' (p => q) = p '&' 'not' q; theorem 'not' p 'or' (p => q) = p => q; theorem 'not' p '&' (p => q) = 'not' p 'or' 'not' p '&' q; theorem p <=> q <=> r = p <=> (q <=> r); theorem p '&' (p <=> q) = p '&' q; theorem 'not' p '&' (p <=> q) ='not' p '&' 'not' q; theorem p '&' (q <=> r) = p '&' ('not' q 'or' r) '&' ('not' r 'or' q); theorem p 'or' (q <=> r) = (p 'or' 'not' q 'or' r) '&' (p 'or' 'not' r 'or' q); theorem 'not' p '&' (p <=> q) =('not' p '&' 'not' q) '&' ('not' p 'or' q); theorem 'not' p '&' (q <=> r) = 'not' p '&' ('not' q 'or' r) '&' ('not' r 'or' q); theorem p => (p <=> q) = p => q; theorem p => (p <=> q) = p => (p => q); theorem p 'or' (p <=> q) = q => p; theorem 'not' p 'or' (p <=> q) = p => q; theorem p => (q <=> r) = ('not' p 'or' 'not' q 'or' r) '&' ('not' p 'or' q 'or' 'not' r); theorem p 'nor' p = 'not' p; theorem p 'nor' (p '&' q) = 'not' p; theorem p 'nor' (p 'or' q) = 'not' p '&' 'not' q; theorem p 'nor' (p 'nor' q) = 'not' p '&' q; theorem p 'nor' (p '&' q) = 'not' p; theorem p 'nor' (p 'or' q) = p 'nor' q; theorem 'not' p '&' (p 'nor' q) = p 'nor' q; theorem p 'or' (q 'nor' r) = (p 'or' 'not' q) '&' (p 'or' 'not' r); theorem p 'nor' (q 'nor' r) = 'not' p '&' q 'or' 'not' p '&' r; theorem p 'nor' (q '&' r) = 'not' (p 'or' q) 'or' 'not' (p 'or' r); theorem p '&' (q 'nor' r) = p '&' 'not' q '&' 'not' r; theorem p => (p 'nor' q) = 'not' p; theorem p => (q 'nor' r) = (p => 'not' q) '&' (p => 'not' r); theorem p 'or' (p 'nor' q) = q => p; theorem p 'or' (q 'nor' r) = (q => p) '&' (r => p); theorem p => (q 'nor' r) = ('not' p 'or' 'not' q) '&' ('not' p 'or' 'not' r); theorem p 'nor' (p <=> q) = 'not' p '&' q; theorem 'not' p '&' (p <=> q) = p 'nor' q; theorem p 'nor' (q <=> r) = 'not' ((p 'or' 'not' q 'or' r) '&' (p 'or' 'not' r 'or' q)); theorem p <=> q = p '&' q 'or' (p 'nor' q); theorem p 'nand' p = 'not' p; theorem p '&' (p 'nand' q) = p '&' 'not' q; theorem p 'nand' (p '&' q) = 'not' (p '&' q); theorem p 'nand' (q 'nand' r) = ('not' p 'or' q) '&' ('not' p 'or' r); theorem p 'nand' (q 'or' r) = 'not' (p '&' q) '&' 'not' (p '&' r); theorem p => (p 'nand' q) = p 'nand' q; theorem p 'nand' (p 'nand' q) = p => q; theorem p 'nand' (q 'nand' r) = (p => q) '&' (p => r); theorem p 'nand' (p => q) = 'not' (p '&' q); theorem p 'nand' (q => r) = (p => q) '&' (p => 'not' r); theorem 'not' p 'or' (p 'nand' q) = p 'nand' q; theorem p 'nand' (q => r) = ('not' p 'or' q) '&' ('not' p 'or' 'not' r); theorem 'not' p '&' (p 'nand' q) = 'not' p 'or' 'not' p '&' 'not' q; theorem p '&' (q 'nand' r) = p '&' 'not' q 'or' p '&' 'not' r; theorem p 'nand' (p <=> q) = 'not' (p '&' q); theorem p 'nand' (q <=> r) = 'not' (p '&' ('not' q 'or' r) '&' ('not' r 'or' q )); theorem p 'nand' (q 'nor' r) = 'not' p 'or' q 'or' r; theorem p '\' q '\' q = p '\' q; theorem p '&' (p '\' q) = p '\' q; theorem p 'nor' (p <=> q) = q '\' p; theorem p 'nor' (p 'nor' q) = q '\' p; theorem p 'xor' (p 'xor' q) = q; theorem (p 'xor' q) 'xor' r = p 'xor' (q 'xor' r); theorem 'not' (p 'xor' q) = 'not' p 'xor' q; theorem p '&' (q 'xor' r) = (p '&' q) 'xor' (p '&' r); theorem p '&' (p 'xor' q) = p '&' 'not' q; theorem p 'xor' (p '&' q) = p '&' 'not' q; theorem 'not' p '&' (p 'xor' q) ='not' p '&' q; theorem p 'or' (p 'xor' q) = p 'or' q; theorem p 'or' ('not' p 'xor' q) =p 'or' 'not' q; theorem p 'xor' ('not' p '&' q) = p 'or' q; theorem p 'xor' (p 'or' q) = 'not' p '&' q; theorem p 'xor' (q '&' r) = (p 'or' (q '&' r)) '&' ('not' p 'or' 'not' (q '&' r)); theorem 'not' p 'xor' (p => q) = p '&' q; theorem p => (p 'xor' q) = 'not' p 'or' 'not' q; theorem p 'xor' (p => q) = 'not' p 'or' 'not' q; theorem 'not' p 'xor' (q => p) = (p '&' (p 'or' 'not' q)) 'or' ('not' p '&' q); theorem p 'xor' (p <=> q) = 'not' q; theorem 'not' p 'xor' (p <=> q) = q; theorem p 'nor' (p 'xor' q) = 'not' p '&' 'not' q; theorem p 'nor' (p 'xor' q) = p 'nor' q; theorem p 'xor' (p 'nor' q) = q => p; theorem p 'nand' (p 'xor' q) = p => q; theorem p 'xor' (p 'nand' q) = p => q; theorem p 'xor' (p => q) = p 'nand' q; theorem p 'nand' (q 'xor' r) = (p '&' q) <=> (p '&' r); theorem p 'xor' (p '&' q) = p '\' q; theorem p '&' (p 'xor' q) = p '\' q; theorem 'not' p '&' (p 'xor' q) = q '\' p; theorem p 'xor' (p 'or' q) = q '\' p; begin theorem p '&' q = TRUE implies p = TRUE & q = TRUE; theorem 'not'(p '&' 'not' p) = TRUE; theorem p => p = TRUE; theorem p => (q => p) = TRUE; theorem p => ((p => q) => q) = TRUE; theorem (p => q) => ((q => r) => (p => r)) = TRUE; theorem (p => q) => ((r => p) => (r => q)) = TRUE; theorem (p => (p => q)) => (p => q) = TRUE; theorem (p => (q => r)) => ((p => q) => (p => r)) = TRUE; theorem (p => (q => r)) => (q => (p => r)) = TRUE; theorem ((p => q) => r) => (q => r) = TRUE; theorem (TRUE => p) => p = TRUE; theorem p => q = TRUE implies (q => r) => (p => r) = TRUE; theorem p => (p => q) = TRUE implies p => q = TRUE; theorem p => (q => r) = TRUE implies (p => q) => (p =>r) = TRUE; theorem p => q = TRUE & q => p = TRUE implies p = q; theorem p => q = TRUE & q => r = TRUE implies p => r = TRUE; theorem ('not' p => p) => p = TRUE; theorem 'not' p = TRUE implies p => q = TRUE; theorem p => q = TRUE & p => 'not' q = TRUE implies 'not' p = TRUE; theorem (p => q) => ('not' (q '&' r) => 'not' (p '&' r)) = TRUE; theorem p 'or' (p => q) = TRUE; theorem p => (p 'or' q) = TRUE; theorem 'not' q 'or' (q => p => p) = TRUE; theorem p <=> p = TRUE; theorem p <=> q <=> r <=> p <=> (q <=> r) = TRUE; theorem p <=> q = TRUE & q <=> r = TRUE implies p <=> r = TRUE; theorem p <=> q = TRUE & r <=> s = TRUE implies (p <=> r) <=> (q <=> s) = TRUE; theorem 'not' (p <=> 'not' p) = TRUE; theorem p <=> q = TRUE & r <=> s = TRUE implies (p '&' r) <=> (q '&' s) = TRUE; theorem p <=> q = TRUE & r <=> s = TRUE implies (p 'or' r) <=> (q 'or' s) = TRUE; theorem p <=> q = TRUE iff p => q = TRUE & q => p = TRUE; theorem p <=> q = TRUE & r <=> s = TRUE implies (p => r) <=> (q => s) = TRUE; theorem 'not' (p 'nor' 'not' p) = TRUE; theorem p 'nand' 'not' p = TRUE; theorem p 'or' (p 'nand' q) = TRUE; theorem p 'nand' (p 'nor' q) = TRUE; theorem p '&' 'not' p = FALSE; theorem p '&' p = FALSE implies p = FALSE; theorem p '&' q = FALSE implies p = FALSE or q = FALSE; theorem 'not' (p => p) = FALSE; theorem p <=> 'not' p = FALSE; theorem 'not'(p <=> p) = FALSE; theorem p '&' (p 'nor' q) = FALSE; theorem p 'nor' (p => q) = FALSE; theorem p 'nor' (p 'nand' q) = FALSE; theorem p 'xor' p = FALSE; begin reserve X,Y,Z,x,y,z for set; reserve i,j for Element of NAT; reserve A,B,C for Subset of X; reserve R,R1,R2 for Relation of X; reserve AX for Subset of [:X,X:]; reserve SFXX for Subset-Family of [:X,X:]; definition let X; func nabla X -> Relation of X equals [:X,X:]; end; registration let X; cluster nabla X -> total reflexive; end; definition let X; let R1,R2; redefine func R1 /\ R2 -> Relation of X; redefine func R1 \/ R2 -> Relation of X; end; theorem nabla X \/ R1 = nabla X; theorem id X is_reflexive_in X & id X is_symmetric_in X & id X is_transitive_in X; definition let X; mode Tolerance of X is total reflexive symmetric Relation of X; mode Equivalence_Relation of X is total symmetric transitive Relation of X; end; theorem id X is Equivalence_Relation of X; theorem nabla X is Equivalence_Relation of X; registration let X; cluster nabla X -> total symmetric transitive; end; reserve EqR,EqR1,EqR2,EqR3 for Equivalence_Relation of X; theorem for R being total reflexive Relation of X holds x in X implies [ x,x] in R; theorem for R being total symmetric Relation of X holds [x,y] in R implies [y,x] in R ; theorem for R being total transitive Relation of X holds [x,y] in R & [y ,z] in R implies [x,z] in R; theorem for R being total reflexive Relation of X holds (ex x being set st x in X) implies R <> {}; theorem R is Equivalence_Relation of X iff R is reflexive symmetric transitive & field R = X; definition let X; let EqR1,EqR2; redefine func EqR1 /\ EqR2 -> Equivalence_Relation of X; end; theorem id X /\ EqR = id X; theorem for SFXX st (SFXX <> {} & for Y st Y in SFXX holds Y is Equivalence_Relation of X) holds meet SFXX is Equivalence_Relation of X; theorem for R holds ex EqR st R c= EqR & for EqR2 st R c= EqR2 holds EqR c= EqR2; definition let X; let EqR1,EqR2; func EqR1 "\/" EqR2 -> Equivalence_Relation of X means EqR1 \/ EqR2 c= it & for EqR st EqR1 \/ EqR2 c= EqR holds it c= EqR; commutativity; idempotence; end; theorem (EqR1 "\/" EqR2) "\/" EqR3 = EqR1 "\/" (EqR2 "\/" EqR3); theorem EqR "\/" EqR = EqR; theorem EqR1 "\/" EqR2 = EqR2 "\/" EqR1; theorem EqR1 /\ (EqR1 "\/" EqR2) = EqR1; theorem EqR1 "\/" (EqR1 /\ EqR2) = EqR1; scheme ExEqRel {X() -> set,P[set,set]}: ex EqR being Equivalence_Relation of X() st for x,y holds [x,y] in EqR iff x in X() & y in X() & P[x,y] provided for x st x in X() holds P[x,x] and for x,y st P[x,y] holds P[y,x] and for x,y,z st P[x,y] & P[y,z] holds P[x,z]; notation let R be Relation, x be set; synonym Class(R,x) for Im(R,x); end; definition let X, Y be set, R be Relation of X, Y, x be set; redefine func Class(R,x) -> Subset of Y; end; theorem for R being Relation holds y in Class (R,x) iff [x,y] in R; theorem for R being total symmetric Relation of X holds y in Class (R,x) iff [y,x] in R; theorem for R being Tolerance of X holds for x st x in X holds x in Class (R,x); theorem for R being Tolerance of X holds for x st x in X holds ex y st x in Class(R,y); theorem for R being transitive Tolerance of X holds y in Class(R,x) & z in Class(R,x) implies [y,z] in R; theorem for x st x in X holds y in Class(EqR,x) iff Class(EqR,x) = Class (EqR,y); theorem for x,y st y in X holds Class(EqR,x) = Class(EqR,y) or Class(EqR ,x) misses Class(EqR,y); theorem for x st x in X holds Class(id X,x) = {x}; theorem for x st x in X holds Class(nabla X,x) = X; theorem (ex x st Class(EqR,x) = X) implies EqR = nabla X; theorem x in X implies ([x,y] in EqR1 "\/" EqR2 iff ex f being FinSequence st 1 <= len f & x = f.1 & y = f.(len f) & for i st 1 <= i & i < len f holds [f.i,f .(i+1)] in EqR1 \/ EqR2); theorem for E being Equivalence_Relation of X st E = EqR1 \/ EqR2 holds for x st x in X holds Class(E,x) = Class(EqR1,x) or Class(E,x) = Class(EqR2,x); theorem EqR1 \/ EqR2 = nabla X implies EqR1 = nabla X or EqR2 = nabla X; definition let X; let EqR; func Class EqR -> Subset-Family of X means A in it iff ex x st x in X & A = Class(EqR,x); end; theorem X = {} implies Class EqR = {}; definition let X; mode a_partition of X -> Subset-Family of X means union it = X & for A st A in it holds A<>{} & for B st B in it holds A = B or A misses B; end; theorem for P being a_partition of {} holds P = {}; theorem Class EqR is a_partition of X; theorem for P being a_partition of X holds ex EqR st P = Class EqR; theorem for x st x in X holds [x,y] in EqR iff Class(EqR,x) = Class(EqR,y); theorem x in Class EqR implies ex y being Element of X st x = Class(EqR,y); begin registration let X be non empty set; cluster -> non empty for a_partition of X; end; registration let X be set; cluster -> with_non-empty_elements for a_partition of X; end; definition let X be set, R be Equivalence_Relation of X; redefine func Class R -> a_partition of X; end; registration let I be non empty set, R be Equivalence_Relation of I; cluster Class R -> non empty; end; registration let I be non empty set, R be Equivalence_Relation of I; cluster Class R -> with_non-empty_elements; end; notation let I be non empty set, R be Equivalence_Relation of I; let x be Element of I; synonym EqClass(R,x) for Class(R,x); end; definition let I be non empty set, R be Equivalence_Relation of I; let x be Element of I; redefine func EqClass(R,x) -> Element of Class R; end; definition let X be set; func SmallestPartition X -> a_partition of X equals Class id X; end; theorem for X being non empty set holds SmallestPartition X = {{x} where x is Element of X: not contradiction}; reserve X for non empty set, x for Element of X; definition let X be non empty set,x be Element of X,S1 be a_partition of X; func EqClass(x,S1) -> Subset of X means x in it & it in S1; end; theorem for S1,S2 being a_partition of X st (for x being Element of X holds EqClass(x,S1) = EqClass(x,S2)) holds S1=S2; theorem for X being non empty set holds {X} is a_partition of X; definition let X be set; mode Family-Class of X is Subset-Family of bool X; end; definition let X be set; let F be Family-Class of X; attr F is partition-membered means for S being set st S in F holds S is a_partition of X; end; registration let X be set; cluster partition-membered for Family-Class of X; end; definition let X be set; mode Part-Family of X is partition-membered Family-Class of X; end; reserve F for Part-Family of X; registration let X be non empty set; cluster non empty for a_partition of X; end; theorem for X being set, p being a_partition of X holds {p} is Part-Family of X; registration let X be set; cluster non empty for Part-Family of X; end; theorem for S1 being a_partition of X, x,y being Element of X holds EqClass(x,S1) meets EqClass(y,S1) implies EqClass(x,S1) = EqClass(y,S1); theorem for A being set,X being non empty set,S being a_partition of X holds A in S implies ex x being Element of X st A = EqClass(x,S); definition let X be non empty set,F be non empty Part-Family of X; func Intersection F -> non empty a_partition of X means for x being Element of X holds EqClass(x,it) = meet{EqClass(x,S) where S is a_partition of X : S in F}; end; theorem for X being non empty set, S being a_partition of X, A being Subset of S holds (union S) \ (union A) = union (S \ A); theorem for X being non empty set,A being Subset of X, S being a_partition of X holds A in S implies union(S \ {A}) = X \ A; theorem {} is a_partition of {}; begin reserve e,u,v,X,Y,X1 for set; theorem for F being Function st X c= F"X1 holds F.:X c= X1; theorem e c= [:X,Y:] implies (.:pr1(X,Y)).e = pr1(X,Y).:e; theorem e c= [:X,Y:] implies (.:pr2(X,Y)).e = pr2(X,Y).:e; theorem for X1 being Subset of X, Y1 being Subset of Y st [:X1,Y1:] <> {} holds pr1(X,Y).:[:X1,Y1:] = X1 & pr2(X,Y).:[:X1,Y1:] = Y1; theorem for X1 being Subset of X, Y1 being Subset of Y st [:X1,Y1:] <> {} holds .:pr1(X,Y). [:X1,Y1:] = X1 & .:pr2(X,Y). [:X1,Y1:] = Y1; theorem for A being Subset of [:X,Y:], H being Subset-Family of [:X,Y:] st for e st e in H holds e c= A & ex X1 being Subset of X, Y1 being Subset of Y st e =[:X1,Y1:] holds [:union(.:pr1(X,Y).:H), meet(.:pr2(X,Y).:H):] c= A; theorem for A being Subset of [:X,Y:], H being Subset-Family of [:X,Y:] st for e st e in H holds e c= A & ex X1 being Subset of X, Y1 being Subset of Y st e = [:X1,Y1:] holds [:meet(.:pr1(X,Y).:H), union(.:pr2(X,Y).:H):] c= A; theorem for X being set, Y being non empty set, f being Function of X,Y for H being Subset-Family of X holds union(.:f.:H) = f.: union H; reserve X,Y,Z for non empty set; theorem for X being set, a being Subset-Family of X holds union union a = union { union A where A is Subset of X: A in a }; theorem for X being set for D being Subset-Family of X st union D = X for A being Subset of D, B being Subset of X st B = union A holds B` c= union A `; theorem for F being Function of X,Y, G being Function of X,Z st for x,x9 being Element of X st F.x=F.x9 holds G.x=G.x9 ex H being Function of Y,Z st H*F =G; theorem for X,Y,Z for y being Element of Y, F being (Function of X,Y), G being Function of Y,Z holds F"{y} c= (G*F)"{G.y}; theorem for F being Function of X,Y, x being Element of X, z being Element of Z holds [:F,id Z:].(x,z) = [F.x,z]; theorem for F being Function of X,Y, A being Subset of X, B being Subset of Z holds [:F,id Z:].:[:A,B:] = [:F.:A,B:]; theorem for F being Function of X,Y, y being Element of Y, z being Element of Z holds [:F,id Z:]"{[y,z]} = [:F"{y},{z}:]; theorem for D being Subset-Family of X, A being Subset of D holds union A is Subset of X; theorem for X being set, D being a_partition of X, A,B being Subset of D holds union(A /\ B) = union A /\ union B; theorem for D being a_partition of X, A being Subset of D, B being Subset of X st B = union A holds B` = union A`; theorem for E being Equivalence_Relation of X holds Class(E) is non empty; registration let X be non empty set; cluster non empty for a_partition of X; end; definition let X; let D be non empty a_partition of X; func proj D -> Function of X, D means for p being Element of X holds p in it.p; end; theorem for D being non empty a_partition of X, p being Element of X, A being Element of D st p in A holds A = (proj D).p; theorem for D being non empty a_partition of X, p being Element of D holds p = proj D " {p}; theorem for D being non empty a_partition of X, A being Subset of D holds (proj D)"A = union A; theorem for D being non empty a_partition of X, W being Element of D ex W9 being Element of X st proj(D).W9=W; theorem for D being non empty a_partition of X, W being Subset of X st for B being Subset of X st B in D & B meets W holds B c= W holds W = proj D " ( proj D .: W); theorem for X being set, P being a_partition of X, x, a, b being set st x in a & a in P & x in b & b in P holds a = b; begin reserve n,n1,n2,m for Element of NAT; reserve r,g1,g2,g,g9 for Element of COMPLEX; reserve R,R2 for Real; reserve s,s9,s1 for Complex_Sequence; theorem g<>0c & r<>0c implies |.g"-r".|=|.g-r.|/(|.g.|*|.r.|); theorem for n ex r being Real st 0 complex-valued Function means dom it = dom f & for c being set st c in dom it holds it.c = (f.c)*'; involutiveness; end; definition let C be non empty set; let f be Function of C,COMPLEX; redefine func f*' -> Function of C,COMPLEX means dom it = C & for n being Element of C holds it.n=(f.n)*'; end; registration let C be non empty set; let s be complex-valued ManySortedSet of C; cluster s*' -> C-defined; end; registration let C be non empty set; let seq be complex-valued ManySortedSet of C; cluster seq*' -> total for C-defined Function; end; theorem s is non-zero implies s*' is non-zero; theorem (r(#)s)*' = (r*')(#)(s*'); theorem (s (#) s9)*' = (s*') (#) (s9*'); theorem (s*')" = (s")*'; theorem (s9/"s)*' = (s9*') /" (s*'); begin definition let f be complex-valued Function; attr f is bounded means ex r being real number st for y being set st y in dom f holds abs(f.y) Element of COMPLEX means for p be Real st 0

convergent for Complex_Sequence; end; canceled; theorem s is convergent implies lim(s*') = (lim s)*'; begin registration let s1,s2 be convergent Complex_Sequence; cluster s1 + s2 -> convergent for Complex_Sequence; end; canceled; theorem for s,s9 being convergent Complex_Sequence holds lim (s + s9)=(lim s)+ (lim s9); canceled; theorem for s,s9 being convergent Complex_Sequence holds lim (s + s9)*' = (lim s)*' + (lim s9)*'; registration let s be convergent Complex_Sequence, c be complex number; cluster c(#)s -> convergent for Complex_Sequence; end; canceled; theorem for s being convergent Complex_Sequence, r being complex number holds lim(r(#)s)=r*(lim s); canceled; theorem for s being convergent Complex_Sequence holds lim (r(#)s)*' = (r*')*(lim s)*'; registration let s be convergent Complex_Sequence; cluster -s -> convergent for Complex_Sequence; end; canceled; theorem for s being convergent Complex_Sequence holds lim(-s)=-(lim s); canceled; theorem for s being convergent Complex_Sequence holds lim (-s)*' = -(lim s)*'; registration let s1,s2 be convergent Complex_Sequence; cluster s1 - s2 -> convergent for Complex_Sequence; end; canceled; theorem for s,s9 being convergent Complex_Sequence holds lim(s - s9)=(lim s)-( lim s9); canceled; theorem for s,s9 being convergent Complex_Sequence holds lim (s - s9)*' = (lim s)*' - (lim s9)*'; registration cluster convergent -> bounded for Complex_Sequence; end; registration cluster non bounded -> non convergent for Complex_Sequence; end; registration let s1,s2 be convergent Complex_Sequence; cluster s1 (#) s2 -> convergent for Complex_Sequence; end; canceled; theorem for s,s9 being convergent Complex_Sequence holds lim(s(#)s9)=(lim s)*(lim s9); canceled; theorem for s,s9 being convergent Complex_Sequence holds lim (s(#)s9)*' = (lim s)*' * (lim s9)*'; theorem for s being convergent Complex_Sequence st lim s <> 0c ex n st for m st n <=m holds |.(lim s).|/2<|.s.m.|; theorem for s being convergent Complex_Sequence st lim s <> 0c & s is non-zero holds s" is convergent; theorem s is convergent & (lim s)<>0c & s is non-zero implies lim s"=( lim s)"; canceled; theorem s is convergent & (lim s)<>0c & s is non-zero implies lim (s")*' = (( lim s)*')"; theorem s9 is convergent & s is convergent & (lim s)<>0c & s is non-zero implies s9/"s is convergent; theorem s9 is convergent & s is convergent & (lim s)<>0c & s is non-zero implies lim(s9/"s)=(lim s9)/(lim s); canceled; theorem s9 is convergent & s is convergent & (lim s)<>0c & s is non-zero implies lim (s9/"s)*' = ((lim s9)*')/((lim s)*'); theorem s is convergent & s1 is bounded & (lim s)=0c implies s(#)s1 is convergent; theorem s is convergent & s1 is bounded & (lim s)=0c implies lim(s(#)s1) =0c; canceled; theorem s is convergent & s1 is bounded & (lim s)=0c implies lim (s(#)s1)*' = 0c; begin reserve n,n1,n2,m for Element of NAT, r,r1,r2,p,g1,g2,g for real number, seq,seq9,seq1 for Real_Sequence, y for set; theorem -g0 & r<>0 implies abs(g"-r")=abs(g-r)/(abs(g)*abs(r)); definition let f be real-valued Function; attr f is bounded_above means ex r st for y st y in dom f holds f.y bounded_above bounded_below for real-valued Function; cluster bounded_above bounded_below -> bounded for real-valued Function; end; theorem seq is bounded iff ex r st (0 real number means for p st 0

Real; end; registration cluster constant -> convergent for Real_Sequence; end; registration cluster constant for Real_Sequence; end; theorem seq is convergent & seq9 is convergent implies seq + seq9 is convergent; registration let seq1,seq2 be convergent Real_Sequence; cluster seq1 + seq2 -> convergent for Real_Sequence; end; theorem seq is convergent & seq9 is convergent implies lim (seq + seq9)=(lim seq)+(lim seq9); theorem seq is convergent implies r(#)seq is convergent; registration let r be real number; let seq be convergent Real_Sequence; cluster r(#)seq -> convergent for Real_Sequence; end; theorem seq is convergent implies lim(r(#)seq)=r*(lim seq); theorem seq is convergent implies -seq is convergent; registration let seq be convergent Real_Sequence; cluster -seq -> convergent for Real_Sequence; end; theorem seq is convergent implies lim(-seq) = -(lim seq); theorem seq is convergent & seq9 is convergent implies seq - seq9 is convergent; registration let seq1,seq2 be convergent Real_Sequence; cluster seq1 - seq2 -> convergent for Real_Sequence; end; theorem seq is convergent & seq9 is convergent implies lim(seq - seq9)=(lim seq)-(lim seq9); theorem seq is convergent implies seq is bounded; registration cluster convergent -> bounded for Real_Sequence; end; theorem seq is convergent & seq9 is convergent implies seq (#) seq9 is convergent; registration let seq1,seq2 be convergent Real_Sequence; cluster seq1 (#) seq2 -> convergent for Real_Sequence; end; theorem seq is convergent & seq9 is convergent implies lim(seq(#)seq9)=(lim seq)*(lim seq9); theorem seq is convergent implies (lim seq<>0 implies ex n st for m st n<=m holds abs(lim seq)/2 0 & seq is non-zero implies seq" is convergent ; theorem seq is convergent & lim seq <> 0 & seq is non-zero implies lim seq"=(lim seq)"; theorem seq9 is convergent & seq is convergent & lim seq <> 0 & seq is non-zero implies seq9/"seq is convergent; theorem seq9 is convergent & seq is convergent & lim seq <> 0 & seq is non-zero implies lim(seq9/"seq)=(lim seq9)/(lim seq); theorem seq is convergent & seq1 is bounded & lim seq=0 implies seq(#)seq1 is convergent; theorem seq is convergent & seq1 is bounded & lim seq=0 implies lim(seq(#)seq1)=0; reserve g for Element of COMPLEX; registration let s be convergent Complex_Sequence; cluster |.s.| -> convergent for Real_Sequence; end; reserve s,s1,s9 for Complex_Sequence; theorem s is convergent implies lim |.s.| = |.lim s.|; theorem for s,s9 being convergent Complex_Sequence holds lim |.(s + s9).| = |.(lim s)+(lim s9).|; theorem for s being convergent Complex_Sequence holds lim |.(r(#)s).| = |.r.|*|.(lim s).|; theorem for s being convergent Complex_Sequence holds lim |.-s.| = |.lim s.|; theorem for s,s9 being convergent Complex_Sequence holds lim |.s - s9.| = |.(lim s) - (lim s9).|; theorem for s,s9 being convergent Complex_Sequence holds lim |.s(#)s9.| = |.lim s.|*|.lim s9.|; theorem s is convergent & (lim s)<>0c & s is non-zero implies lim |.s".| = (|. lim s.|)"; theorem s9 is convergent & s is convergent & (lim s)<>0c & s is non-zero implies lim |.(s9/"s).|=|.(lim s9).|/|.(lim s).|; theorem s is convergent & s1 is bounded & (lim s)=0c implies lim |.s(#)s1.| = 0; begin reserve x,y for set; reserve C,C9,D,D9,E for non empty set; reserve c for Element of C; reserve c9 for Element of C9; reserve d,d1,d2,d3,d4,e for Element of D; reserve d9 for Element of D9; theorem for f being Function holds <:{},f:> = {} & <:f,{}:> = {}; theorem for f being Function holds [:{},f:] = {} & [:f,{}:] = {}; theorem for F,f being Function holds F.:({},f) = {} & F.:(f,{}) = {}; theorem for F being Function holds F[:]({},x) = {}; theorem for F being Function holds F[;](x,{}) = {}; theorem for X being set, x1,x2 being set holds <:X-->x1,X-->x2:> = X -->[ x1,x2]; theorem for F being Function,X being set, x1,x2 being set st [x1,x2] in dom F holds F.:(X-->x1,X-->x2) = X --> F.(x1,x2); reserve i,j for Nat; reserve F for Function of [:D,D9:],E; reserve p,q for FinSequence of D, p9,q9 for FinSequence of D9; definition let D,D9,E,F,p,p9; redefine func F.:(p,p9) -> FinSequence of E; end; definition let D,D9,E,F,p,d9; redefine func F[:](p,d9) -> FinSequence of E; end; definition let D,D9,E,F,d,p9; redefine func F[;](d,p9) -> FinSequence of E; end; reserve f,f9 for Function of C,D, h for Function of D,E; definition let D,E be set, p be FinSequence of D, h be Function of D,E; redefine func h*p -> FinSequence of E; end; theorem h*(p^<*d*>) = (h*p)^<*h.d*>; theorem h*(p^q) = (h*p)^(h*q); reserve T,T1,T2,T3 for Tuple of i,D; reserve T9 for Tuple of i, D9; reserve S for Tuple of j, D; reserve S9 for Tuple of j, D9; theorem F.:(T^<*d*>,T9^<*d9*>) = (F.:(T,T9))^<*F.(d,d9)*>; theorem F.:(T^S,T9^S9) = (F.:(T,T9))^(F.:(S,S9)); theorem F[;](d,p9^<*d9*>) = (F[;](d,p9))^<*F.(d,d9)*>; theorem F[;](d,p9^q9) = (F[;](d,p9))^(F[;](d,q9)); theorem F[:](p^<*d*>,d9) = (F[:](p,d9))^<*F.(d,d9)*>; theorem F[:](p^q,d9) = (F[:](p,d9))^(F[:](q,d9)); theorem for h being Function of D,E holds h*(i|->d) = i|->(h.d); theorem F.:(i|->d,i|->d9) = i |-> (F.(d,d9)); theorem F[;](d,i|->d9) = i |-> (F.(d,d9)); theorem F[:](i|->d,d9) = i |-> (F.(d,d9)); theorem F.:(i|->d,T9) = F[;](d,T9); theorem F.:(T,i|->d) = F[:](T,d); theorem F[;](d,T9) = F[;](d,id D9)*T9; theorem F[:](T,d) = F[:](id D,d)*T; reserve F,G for BinOp of D; reserve u for UnOp of D; reserve H for BinOp of E; theorem F is associative implies F[;](d,id D)*(F.:(f,f9)) = F.:(F[;](d, id D)*f,f9); theorem F is associative implies F[:](id D,d)*(F.:(f,f9)) = F.:(f,F[:]( id D,d)*f9); theorem F is associative implies F[;](d,id D)*(F.:(T1,T2)) = F.:(F[;](d,id D)* T1,T2 ); theorem F is associative implies F[:](id D,d)*(F.:(T1,T2)) = F.:(T1,F[:](id D, d)*T2 ); theorem F is associative implies F.:(F.:(T1,T2),T3) = F.:(T1,F.:(T2,T3)); theorem F is associative implies F[:](F[;](d1,T),d2) = F[;](d1,F[:](T,d2)); theorem F is associative implies F.:(F[:](T1,d),T2) = F.:(T1,F[;](d,T2)); theorem F is associative implies F[;](F.(d1,d2),T) = F[;](d1,F[;](d2,T)); theorem F is associative implies F[:](T,F.(d1,d2)) = F[:](F[:](T,d1),d2); theorem F is commutative implies F.:(T1,T2) = F.:(T2,T1); theorem F is commutative implies F[;](d,T) = F[:](T,d); theorem F is_distributive_wrt G implies F[;](G.(d1,d2),f) = G.:(F[;](d1, f),F[;] (d2,f)); theorem F is_distributive_wrt G implies F[:](f,G.(d1,d2)) = G.:(F[:](f, d1),F[:] (f,d2)); theorem (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h*(F.:(f ,f9)) = H.:(h*f,h*f9); theorem (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h*(F[;]( d,f)) = H[;](h.d,h*f); theorem (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h*(F[:]( f,d)) = H[:](h*f,h.d); theorem u is_distributive_wrt F implies u*(F.:(f,f9)) = F.:(u*f,u*f9); theorem u is_distributive_wrt F implies u*(F[;](d,f)) = F[;](u.d,u*f); theorem u is_distributive_wrt F implies u*(F[:](f,d)) = F[:](u*f,u.d); theorem F is having_a_unity implies F.:(C-->the_unity_wrt F,f) = f & F.: (f,C-->the_unity_wrt F) = f; theorem F is having_a_unity implies F[;](the_unity_wrt F,f) = f; theorem F is having_a_unity implies F[:](f,the_unity_wrt F) = f; theorem F is_distributive_wrt G implies F[;](G.(d1,d2),T) = G.:(F[;](d1,T),F [;] (d2,T)); theorem F is_distributive_wrt G implies F[:](T,G.(d1,d2)) = G.:(F[:](T,d1),F [:] (T,d2)); theorem (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h*(F.:( T1,T2)) = H.:(h*T1,h*T2); theorem (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h*(F[;]( d,T)) = H[;](h.d,h*T); theorem (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h*(F[:]( T,d)) = H[:](h*T,h.d); theorem u is_distributive_wrt F implies u*(F.:(T1,T2)) = F.:(u*T1,u*T2); theorem u is_distributive_wrt F implies u*(F[;](d,T)) = F[;](u.d,u*T); theorem u is_distributive_wrt F implies u*(F[:](T,d)) = F[:](u*T,u.d); theorem G is_distributive_wrt F & u = G[;](d,id D) implies u is_distributive_wrt F; theorem G is_distributive_wrt F & u = G[:](id D,d) implies u is_distributive_wrt F; theorem F is having_a_unity implies F.:(i|->the_unity_wrt F,T) = T & F.:(T,i |->the_unity_wrt F) = T; theorem F is having_a_unity implies F[;](the_unity_wrt F,T) = T; theorem F is having_a_unity implies F[:](T,the_unity_wrt F) = T; definition let D,u,F; pred u is_an_inverseOp_wrt F means for d holds F.(d,u.d) = the_unity_wrt F & F.(u.d,d) = the_unity_wrt F; end; definition let D,F; attr F is having_an_inverseOp means ex u st u is_an_inverseOp_wrt F; end; definition let D,F; assume that F is having_a_unity and F is associative and F is having_an_inverseOp; func the_inverseOp_wrt F -> UnOp of D means it is_an_inverseOp_wrt F; end; theorem F is having_a_unity & F is associative & F is having_an_inverseOp implies F.((the_inverseOp_wrt F).d,d) = the_unity_wrt F & F .(d,(the_inverseOp_wrt F).d) = the_unity_wrt F; theorem F is having_a_unity & F is associative & F is having_an_inverseOp & F.(d1,d2) = the_unity_wrt F implies d1 = ( the_inverseOp_wrt F).d2 & (the_inverseOp_wrt F).d1 = d2; theorem F is having_a_unity & F is associative & F is having_an_inverseOp implies (the_inverseOp_wrt F).(the_unity_wrt F) = the_unity_wrt F; theorem F is having_a_unity & F is associative & F is having_an_inverseOp implies (the_inverseOp_wrt F).((the_inverseOp_wrt F).d) = d ; theorem F is having_a_unity & F is associative & F is commutative & F is having_an_inverseOp implies (the_inverseOp_wrt F) is_distributive_wrt F; theorem F is having_a_unity & F is associative & F is having_an_inverseOp & (F.(d,d1) = F.(d,d2) or F.(d1,d) = F.(d2,d)) implies d1 = d2; theorem F is having_a_unity & F is associative & F is having_an_inverseOp & (F.(d1,d2) = d2 or F.(d2,d1) = d2) implies d1 = the_unity_wrt F; theorem F is associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F & e = the_unity_wrt F implies for d holds G.(e,d) = e & G.(d,e) = e; theorem F is having_a_unity & F is associative & F is having_an_inverseOp & u = the_inverseOp_wrt F & G is_distributive_wrt F implies u.(G.(d1,d2)) = G.(u.d1,d2) & u.(G.(d1,d2)) = G.(d1,u.d2); theorem F is having_a_unity & F is associative & F is having_an_inverseOp & u = the_inverseOp_wrt F & G is_distributive_wrt F & G is having_a_unity implies G [;](u.(the_unity_wrt G),id D) = u; theorem F is associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G[;](d,id D).the_unity_wrt F = the_unity_wrt F; theorem F is associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G[:](id D,d).the_unity_wrt F = the_unity_wrt F; theorem F is having_a_unity & F is associative & F is having_an_inverseOp implies F.:(f,(the_inverseOp_wrt F)*f) = C-->the_unity_wrt F & F.:((the_inverseOp_wrt F)*f,f) = C-->the_unity_wrt F; theorem F is associative & F is having_an_inverseOp & F is having_a_unity & F.:(f,f9) = C-->the_unity_wrt F implies f = (the_inverseOp_wrt F)*f9 & (the_inverseOp_wrt F)*f = f9; theorem F is having_a_unity & F is associative & F is having_an_inverseOp implies F.:(T,(the_inverseOp_wrt F)*T) = i|->the_unity_wrt F & F.:(( the_inverseOp_wrt F)*T,T) = i|->the_unity_wrt F; theorem F is associative & F is having_an_inverseOp & F is having_a_unity & F .:(T1,T2) = i|->the_unity_wrt F implies T1 = (the_inverseOp_wrt F)*T2 & ( the_inverseOp_wrt F)*T1 = T2; theorem F is associative & F is having_a_unity & e = the_unity_wrt F & F is having_an_inverseOp & G is_distributive_wrt F implies G[;](e,f) = C-->e; theorem F is associative & F is having_a_unity & e = the_unity_wrt F & F is having_an_inverseOp & G is_distributive_wrt F implies G[;](e,T) = i|->e; definition let F,f,g be Function; func F*(f,g) -> Function equals F*[:f,g:]; end; theorem for F,f,g being Function st [x,y] in dom(F*(f,g)) holds (F*(f,g) ).(x,y) = F.(f.x,g.y); theorem for F,f,g being Function st [x,y] in dom(F*(f,g)) holds (F*(f,g)).(x,y ) = F.(f.x,g.y); theorem for F being Function of [:D,D9:],E, f being Function of C,D, g being Function of C9,D9 holds F*(f,g) is Function of [:C,C9:],E; theorem for u,u9 being Function of D,D holds F*(u,u9) is BinOp of D; definition let D,F; let f,f9 be Function of D,D; redefine func F*(f,f9) -> BinOp of D; end; theorem for F being Function of [:D,D9:],E, f being Function of C,D, g being Function of C9,D9 holds (F*(f,g)).(c,c9) = F.(f.c,g.c9); theorem for u being Function of D,D holds (F*(id D,u)).(d1,d2) = F.(d1,u .d2) & (F*(u,id D)).(d1,d2) = F.(u.d1,d2); theorem (F*(id D,u)).:(f,f9) = F.:(f,u*f9); theorem (F*(id D,u)).:(T1,T2) = F.:(T1,u*T2); theorem F is associative & F is having_a_unity & F is commutative & F is having_an_inverseOp & u = the_inverseOp_wrt F implies u.(F*(id D,u).(d1,d2)) = F*(u,id D).(d1,d2) & F*(id D,u).(d1,d2) = u.(F*(u,id D).(d1,d2)); theorem F is associative & F is having_a_unity & F is having_an_inverseOp implies (F*(id D,the_inverseOp_wrt F)).(d,d) = the_unity_wrt F; theorem F is associative & F is having_a_unity & F is having_an_inverseOp implies (F*(id D,the_inverseOp_wrt F)).(d,the_unity_wrt F) = d; theorem F is having_a_unity implies (F*(id D,u)).(the_unity_wrt F,d) = u.d; theorem F is commutative & F is associative & F is having_a_unity & F is having_an_inverseOp & G = F*(id D,the_inverseOp_wrt F) implies for d1,d2,d3,d4 holds F.(G.(d1,d2),G.(d3,d4))= G.(F.(d1,d3),F.(d2,d4)); begin reserve p,q,r for FinSequence; reserve u,v,x,y,y1,y2,z,A,D,X,Y for set; reserve i,j,k,l,m,n for Nat; theorem Seg 3 = {1,2,3}; theorem Seg 4 = {1,2,3,4}; theorem Seg 5 = {1,2,3,4,5}; theorem Seg 6 = {1,2,3,4,5,6}; theorem Seg 7 = {1,2,3,4,5,6,7}; theorem Seg 8 = {1,2,3,4,5,6,7,8}; theorem Seg k = {} iff not k in Seg k; theorem not k + 1 in Seg k; theorem k <> 0 implies k in Seg(k + n); theorem k + n in Seg k implies n = 0; theorem k < n implies k + 1 in Seg n; theorem k in Seg n & m < k implies k - m in Seg n; theorem k - n in Seg k iff n < k; theorem Seg k misses {k + 1}; theorem Seg(k + 1) \ Seg k = {k + 1}; theorem Seg k <> Seg(k + 1); theorem Seg k = Seg(k + n) implies n = 0; theorem Seg k c= Seg(k + n); theorem Seg k, Seg n are_c=-comparable; theorem Seg k = {y} implies k = 1 & y = 1; theorem Seg k = {x,y} & x <> y implies k = 2 & {x,y} = {1,2}; theorem x in dom p implies x in dom(p ^ q); theorem x in dom p implies x is Element of NAT; theorem x in dom p implies x <> 0; theorem n in dom p iff 1 <= n & n <= len p; theorem n in dom p iff n - 1 is Element of NAT & len p - n is Element of NAT; canceled 2; theorem len p = len q iff dom p = dom q; theorem len p <= len q iff dom p c= dom q; theorem x in rng p implies 1 in dom p; theorem rng p <> {} implies 1 in dom p; theorem {} <> <* x,y *>; theorem {} <> <* x,y,z *>; theorem <* x *> <> <* y,z *>; theorem <* u *> <> <* x,y,z *>; theorem <* u,v *> <> <* x,y,z *>; theorem len r = len p + len q & (for k being Element of NAT st k in dom p holds r.k = p.k) & (for k being Element of NAT st k in dom q holds r.(len p + k) = q.k) implies r = p ^ q; theorem for A being finite set st A c= Seg k holds len(Sgm A) = card A; theorem for A being finite set st A c= Seg k holds dom(Sgm A) = Seg(card A); theorem X c= Seg i & k < l & 1 <= n & m <= len(Sgm X) & Sgm(X).m = k & Sgm(X).n = l implies m < n; theorem X c= Seg i & Y c= Seg j implies ((for m,n being Element of NAT st m in X & n in Y holds m < n) iff Sgm(X \/ Y) = Sgm(X) ^ Sgm(Y)); theorem Sgm {} = {}; theorem 0 <> n implies Sgm{n} = <* n *>; theorem 0 < n & n < m implies Sgm{n,m} = <* n,m *>; theorem len(Sgm(Seg k)) = k; theorem Sgm(Seg(k + n)) | Seg k = Sgm(Seg k); theorem Sgm(Seg k) = idseq k; theorem p | Seg n = p iff len p <= n; theorem idseq(n + k) | Seg n = idseq n; theorem idseq n | Seg m = idseq m iff m <= n; theorem idseq n | Seg m = idseq n iff n <= m; theorem len p = k + l & q = p | Seg k implies len q = k; theorem len p = k + l & q = p | Seg k implies dom q = Seg k; theorem len p = k + 1 & q = p | Seg k implies p = q ^ <* p.(k + 1) *>; theorem p | X is FinSequence iff ex k being Element of NAT st X /\ dom p = Seg k; theorem card((p ^ q) " A) = card(p " A) + card(q " A); theorem p " A c= (p ^ q) " A; definition let p,A; func p - A -> FinSequence equals p * Sgm ((dom p) \ p " A); end; theorem len(p - A) = len p - card(p " A); theorem len(p - A) <= len p; theorem len(p - A) = len p implies A misses rng p; theorem n = len p - card(p " A) implies dom(p - A) = Seg n; theorem dom(p - A) c= dom p; theorem dom(p - A) = dom p implies A misses rng p; theorem rng(p - A) = rng p \ A; theorem rng(p - A) c= rng p; theorem rng(p - A) = rng p implies A misses rng p; theorem p - A = {} iff rng p c= A; theorem p - A = p iff A misses rng p; theorem p - {x} = p iff not x in rng p; theorem p - {} = p; theorem p - rng p = {}; theorem (p ^ q) - A = (p - A) ^ (q - A); theorem {} - A = {}; theorem <* x *> - A = <* x *> iff not x in A; theorem <* x *> - A = {} iff x in A; theorem <* x,y *> - A = {} iff x in A & y in A; theorem x in A & not y in A implies <* x,y *> - A = <* y *>; theorem <* x,y *> - A = <* y *> & x <> y implies x in A & not y in A; theorem not x in A & y in A implies <* x,y *> - A = <* x *>; theorem <* x,y *> - A = <* x *> & x <> y implies not x in A & y in A; theorem <* x,y *> - A = <* x,y *> iff not x in A & not y in A; theorem len p = k + 1 & q = p | Seg k implies (p.(k + 1) in A iff p - A = q - A); theorem len p = k + 1 & q = p | Seg k implies (not p.(k + 1) in A iff p - A = (q - A) ^ <* p.(k + 1) *>); theorem n in dom p implies for B being finite set st B = {k where k is Element of NAT : k in dom p & k <= n & p.k in A} holds p.n in A or (p - A).(n - card B) = p.n; theorem p is FinSequence of D implies p - A is FinSequence of D; theorem p is one-to-one implies p - A is one-to-one; theorem p is one-to-one implies len(p - A) = len p - card(A /\ rng p); theorem for A being finite set st p is one-to-one & A c= rng p holds len (p - A) = len p - card A; theorem p is one-to-one & x in rng p implies len(p - {x}) = len p - 1; theorem rng p misses rng q & p is one-to-one & q is one-to-one iff p ^ q is one-to-one; theorem A c= Seg k implies Sgm A is one-to-one; theorem <* x *> is one-to-one; theorem x <> y iff <* x,y *> is one-to-one; theorem x <> y & y <> z & z <> x iff <* x,y,z *> is one-to-one; theorem p is one-to-one & rng p = {x} implies len p = 1; theorem p is one-to-one & rng p = {x} implies p = <* x *>; theorem p is one-to-one & rng p = {x,y} & x <> y implies len p = 2; theorem p is one-to-one & rng p = {x,y} & x <> y implies p = <* x,y *> or p = <* y,x *>; theorem p is one-to-one & rng p = {x,y,z} & <* x,y,z *> is one-to-one implies len p = 3; theorem p is one-to-one & rng p = {x,y,z} & x <> y & y <> z & x <> z implies len p = 3; begin theorem for D being non empty set, df being FinSequence of D holds df is non empty implies ex d being Element of D, df1 being FinSequence of D st d = df.1 & df = <*d*>^df1; theorem for df being FinSequence, d being set holds i in dom df implies (<*d*> ^df).(i+1) = df.i; definition let i; let p be FinSequence; func Del(p,i) -> FinSequence equals p * Sgm ((dom p) \ {i}); end; theorem for p being FinSequence holds (i in dom p implies ex m being Nat st len p = m + 1 & len Del(p,i) = m) & (not i in dom p implies Del(p,i) = p); theorem for D being non empty set for p being FinSequence of D holds Del(p,i) is FinSequence of D; theorem for p be FinSequence holds rng Del(p,i) c= rng p; theorem n = m + 1 & i in Seg n implies len Sgm(Seg n \ {i}) = m; reserve J for Element of NAT; theorem for i,k,m,n being Nat st n=m+1 & k in Seg n & i in Seg m holds (1<=i & i 0 & A = {} iff i-tuples_on A = {}; registration let i be Nat, D be set; cluster i-tuples_on D -> with_common_domain; end; registration let i be Nat, D be set; cluster i-tuples_on D -> product-like; end; begin reserve n for Element of NAT; theorem for D1,D2 be non empty set, p be FinSequence of D1, f be Function of D1,D2 holds dom(f*p) = dom p & len (f*p) = len p & for n being Nat st n in dom (f*p) holds (f*p).n = f.(p.n); definition let D be non empty set, R be Relation of D; func ExtendRel(R) -> Relation of D* means for x,y be FinSequence of D holds [x,y] in it iff len x = len y & for n st n in dom x holds [x.n,y.n] in R; end; theorem for D be non empty set holds ExtendRel(id D) = id (D*); definition let D be non empty set, R be Equivalence_Relation of D; let y be FinSequence of Class(R), x be FinSequence of D; pred x is_representatives_FS y means len x = len y & for n st n in dom x holds Class(R,x.n) = y.n; end; theorem for D be non empty set, R be Equivalence_Relation of D, y be FinSequence of Class(R) ex x be FinSequence of D st x is_representatives_FS y ; reserve x,y,y1,y2,z,a,b,X,Y,Z,V1,V2 for set, f,g,h,h9,f1,f2 for Function, i for Nat, P for Permutation of X, D,D1,D2,D3 for non empty set, d1 for Element of D1, d2 for Element of D2, d3 for Element of D3; theorem x in product <*X*> iff ex y st y in X & x = <*y*>; theorem z in product <*X,Y*> iff ex x,y st x in X & y in Y & z = <*x,y*>; theorem a in product <*X,Y,Z*> iff ex x,y,z st x in X & y in Y & z in Z & a = <*x,y,z*>; theorem product <*D*> = 1-tuples_on D; theorem product <*D1,D2*> = { <*d1,d2*>: not contradiction }; theorem product <*D,D*> = 2-tuples_on D; theorem product <*D1,D2,D3*> = { <*d1,d2,d3*>: not contradiction }; theorem product <*D,D,D*> = 3-tuples_on D; theorem for D being set holds product (i |-> D) = i-tuples_on D; theorem doms <*f*> = <*dom f*> & rngs <*f*> = <*rng f*>; theorem doms <*f,g*> = <*dom f, dom g*> & rngs <*f,g*> = <*rng f, rng g *>; theorem doms <*f,g,h*> = <*dom f, dom g, dom h*> & rngs <*f,g,h*> = <*rng f, rng g, rng h*>; theorem Union <*X*> = X & meet <*X*> = X; theorem Union <*X,Y*> = X \/ Y & meet <*X,Y*> = X /\ Y; theorem Union <*X,Y,Z*> = X \/ Y \/ Z & meet <*X,Y,Z*> = X /\ Y /\ Z; theorem x in dom f implies <*f*>..(1,x) = f.x & <*f,g*>..(1,x) = f.x & <*f,g,h *>..(1,x) = f.x; theorem x in dom g implies <*f,g*>..(2,x) = g.x & <*f,g,h*>..(2,x) = g.x; theorem x in dom h implies <*f,g,h*>..(3,x) = h.x; theorem dom <:<*h*>:> = dom h & for x st x in dom h holds <:<*h*>:>.x = <*h.x *>; theorem dom <:<*f1,f2*>:> = dom f1 /\ dom f2 & for x st x in dom f1 /\ dom f2 holds <:<*f1,f2*>:>.x = <*f1.x,f2.x*>; theorem dom Frege<*h*> = product <*dom h*> & rng Frege<*h*> = product <*rng h *> & for x st x in dom h holds (Frege<*h*>).<*x*> = <*h.x*>; theorem dom Frege<*f1,f2*> = product <*dom f1, dom f2*> & rng Frege<*f1, f2*> = product <*rng f1, rng f2*> & for x,y st x in dom f1 & y in dom f2 holds (Frege<*f1,f2*>).<*x,y*> = <*f1.x, f2.y*>; theorem x in dom f1 & x in dom f2 implies for y1,y2 holds <:f1,f2:>.x = [y1,y2 ] iff <:<*f1,f2*>:>.x = <*y1,y2*>; theorem x in dom f1 & y in dom f2 implies for y1,y2 holds [:f1,f2:].(x,y) = [ y1,y2] iff (Frege<*f1,f2*>).<*x,y*> = <*y1,y2*>; theorem Funcs(<*X*>,Y) = <*Funcs(X,Y)*>; theorem Funcs(<*X,Y*>,Z) = <*Funcs(X,Z), Funcs(Y,Z)*>; theorem Funcs(X,<*Y*>) = <*Funcs(X,Y)*>; theorem Funcs(X,<*Y,Z*>) = <*Funcs(X,Y), Funcs(X,Z)*>; theorem for f being FinSequence st rng f={x,y} & len f=2 holds f.1=x & f. 2=y or f.1=y & f.2=x; theorem for X being set, k being Element of NAT st X c= Seg k holds for m ,n being Element of NAT st m in dom (Sgm X) & n = (Sgm X).m holds m <= n; registration let i be Nat; let D be finite set; cluster i-tuples_on D -> finite; end; begin reserve x,z for set; reserve k for Element of NAT; reserve D for non empty set; definition let B be non empty set, A be set, b be Element of B; redefine func A --> b -> Function of A,B; end; definition let IT be FinSequence-membered set; redefine attr IT is with_common_domain means for a,b being FinSequence st a in IT & b in IT holds len a = len b; end; registration cluster FinSequence-membered with_common_domain for set; end; definition mode relation is FinSequence-membered with_common_domain set; end; reserve X for set; reserve p,r for relation; reserve a,a1,a2,b for FinSequence; theorem X c= p implies X is relation; theorem {a} is relation; scheme relexist{A() -> set, P[FinSequence]}: ex r st for a holds a in r iff a in A( ) & P[a] provided for a,b st P[a] & P[b] holds len a = len b; definition let p,r; redefine pred p = r means for a holds a in p iff a in r; end; registration cluster empty -> with_common_domain for set; end; theorem for p st for a holds not a in p holds p = {}; definition let p; assume p <> {}; func the_arity_of p -> Element of NAT means for a st a in p holds it = len a; end; definition let k; mode relation_length of k -> relation means for a st a in it holds len a = k; end; definition let X be set; mode relation of X -> relation means for a st a in it holds rng a c= X; end; theorem {} is relation of X; theorem {} is relation_length of k; definition let X, k; mode relation of X,k -> relation means it is relation of X & it is relation_length of k; end; definition let D; func relations_on D -> set means for X holds X in it iff X c= D* & for a,b being FinSequence of D st a in X & b in X holds len a = len b; end; registration let D; cluster relations_on D -> non empty; end; definition let D be non empty set; mode relation of D is Element of relations_on D; end; reserve a,b for FinSequence of D; reserve p,r for Element of relations_on D; theorem X c= r implies X is Element of relations_on D; theorem {a} is Element of relations_on D; theorem for x,y being Element of D holds {<*x,y*>} is Element of relations_on D; definition let D,p,r; redefine pred p = r means for a holds a in p iff a in r; end; scheme relDexist{D() -> non empty set, P[FinSequence of D()]}: ex r being Element of relations_on D() st for a being FinSequence of D() holds a in r iff P[a] provided for a,b being FinSequence of D() st P[a] & P[b] holds len a = len b; definition let D; func empty_rel(D) -> Element of relations_on D means not a in it; end; theorem empty_rel(D) = {}; definition let D,p; assume p <> empty_rel(D); func the_arity_of p -> Element of NAT means a in p implies it = len a; end; scheme relDexist2{D() -> non empty set, k() -> Element of NAT, P[FinSequence of D() ]}: ex r being Element of relations_on D() st for a being FinSequence of D() st len a = k() holds a in r iff P[a]; definition func BOOLEAN -> set equals {0,1}; end; registration cluster BOOLEAN -> non empty; end; definition redefine func FALSE -> Element of BOOLEAN; redefine func TRUE -> Element of BOOLEAN; end; definition let x be set; redefine attr x is boolean means x in BOOLEAN; end; registration cluster -> boolean for Element of BOOLEAN; end; reserve u,v,w for boolean set; definition let v be boolean set; redefine func 'not' v equals TRUE if v = FALSE otherwise FALSE; let w be boolean set; redefine func v '&' w equals TRUE if v = TRUE & w =TRUE otherwise FALSE; end; definition let v be Element of BOOLEAN; redefine func 'not' v -> Element of BOOLEAN; let w be Element of BOOLEAN; redefine func v '&' w -> Element of BOOLEAN; end; canceled; theorem (v = FALSE iff 'not' v = TRUE) & (v = TRUE iff 'not' v = FALSE); theorem (v '&' w = TRUE iff v = TRUE & w = TRUE) & (v '&' w = FALSE iff v = FALSE or w = FALSE); theorem FALSE '&' v = FALSE; theorem TRUE '&' v = v; theorem v '&' v = FALSE implies v = FALSE; theorem v '&' (w '&' u) = (v '&' w) '&' u; definition let X; func ALL(X) equals TRUE if not FALSE in X otherwise FALSE; end; registration let X; cluster ALL X -> boolean; end; definition let X; redefine func ALL X -> Element of BOOLEAN; end; theorem (not FALSE in X iff ALL(X) = TRUE) & (FALSE in X iff ALL(X) = FALSE); begin definition let f be Relation; attr f is boolean-valued means rng f c= BOOLEAN; end; registration cluster boolean-valued for Function; end; registration let f be boolean-valued Function, x be set; cluster f.x -> boolean; end; definition let p be boolean-valued Function; func 'not' p -> boolean-valued Function means dom it = dom p & for x being set st x in dom p holds it.x = 'not'(p.x); involutiveness; let q be boolean-valued Function; func p '&' q -> boolean-valued Function means dom it = dom p /\ dom q & for x being set st x in dom it holds it.x = (p.x) '&' (q.x); commutativity; idempotence; end; registration let A be set; cluster -> boolean-valued for Function of A,BOOLEAN; end; definition let A be non empty set; let p be Function of A,BOOLEAN; redefine func 'not' p -> Function of A,BOOLEAN means for x being Element of A holds it.x = 'not'(p.x); let q be Function of A,BOOLEAN; redefine func p '&' q -> Function of A,BOOLEAN means for x being Element of A holds it.x = (p.x) '&' (q.x); end; begin reserve A,z for set, x,y for FinSequence of A, h for PartFunc of A*,A, n,m for Nat; definition let IT be Relation; attr IT is homogeneous means dom IT is with_common_domain; end; definition let A; let IT be PartFunc of A*,A; attr IT is quasi_total means for x,y st len x = len y & x in dom IT holds y in dom IT; end; registration let f be Relation; let X be with_common_domain set; cluster f|X -> homogeneous; end; registration let A be non empty set, f be PartFunc of A*,A; cluster dom f -> FinSequence-membered; end; registration let A be non empty set; cluster homogeneous quasi_total non empty for PartFunc of A*,A; end; registration cluster homogeneous non empty for Function; end; registration let R be homogeneous Relation; cluster dom R -> with_common_domain; end; theorem for A being non empty set, a being Element of A holds <*>A .-->a is homogeneous quasi_total non empty PartFunc of A*,A; theorem for A being non empty set, a being Element of A holds <*>A .-->a is Element of PFuncs(A*,A); definition let A; mode PFuncFinSequence of A is FinSequence of PFuncs(A*,A); end; definition let A; let IT be PFuncFinSequence of A; attr IT is homogeneous means for n,h st n in dom IT & h = IT.n holds h is homogeneous; end; definition let A; let IT be PFuncFinSequence of A; attr IT is quasi_total means for n,h st n in dom IT & h = IT.n holds h is quasi_total; end; definition let A be non empty set; let x be Element of PFuncs(A*,A); redefine func <*x*> -> PFuncFinSequence of A; end; registration let A be non empty set; cluster homogeneous quasi_total non-empty for PFuncFinSequence of A; end; registration let A be non empty set; let f be homogeneous PFuncFinSequence of A; let i be set; cluster f.i -> homogeneous; end; reserve A for non empty set, h for PartFunc of A*,A, a for Element of A; theorem for x be Element of PFuncs(A*,A) st x = <*>A .--> a holds <*x*> is homogeneous quasi_total non-empty; definition let f be homogeneous Relation; func arity(f) -> Nat means for x being FinSequence st x in dom f holds it = len x if ex x being FinSequence st x in dom f otherwise it = 0; end; definition let f be homogeneous Function; redefine func arity(f) -> Element of NAT; end; begin theorem for n be Nat, D be non empty set, D1 be non empty Subset of D holds n-tuples_on D /\ n-tuples_on D1 = n-tuples_on D1; theorem for D being non empty set for h being homogeneous quasi_total non empty PartFunc of D*,D holds dom h = (arity(h))-tuples_on D; definition let D be non empty set; mode PFuncsDomHQN of D -> non empty set means for x be Element of it holds x is homogeneous quasi_total non empty PartFunc of D*,D; end; definition let D be non empty set, P be PFuncsDomHQN of D; redefine mode Element of P -> homogeneous quasi_total non empty PartFunc of D*,D; end; begin reserve X,Y,Z,x,y,z for set; registration cluster empty -> reflexive irreflexive symmetric antisymmetric asymmetric connected strongly_connected transitive for Relation; end; notation let X; synonym Total X for nabla X; end; definition let R be Relation, Y be set; redefine func R |_2 Y -> Relation of Y,Y; end; theorem rng Total X = X; theorem for x,y st x in X & y in X holds [x,y] in Total X; theorem for x,y st x in field Total X & y in field Total X holds [x,y] in Total X; theorem Total X is strongly_connected; theorem Total X is connected; reserve T,R for Tolerance of X; theorem for T being Tolerance of X holds rng T = X; theorem for T being total reflexive Relation of X holds x in X iff [x,x] in T; theorem for T being Tolerance of X holds T is_reflexive_in X; theorem for T being Tolerance of X holds T is_symmetric_in X; theorem for R be Relation of X,Y st R is symmetric holds R |_2 Z is symmetric; definition let X,T; let Y be Subset of X; redefine func T |_2 Y -> Tolerance of Y; end; theorem Y c= X implies T|_2 Y is Tolerance of Y; definition let X; let T be Tolerance of X; mode TolSet of T -> set means for x,y st x in it & y in it holds [x,y ] in T; end; theorem {} is TolSet of T; definition let X; let T be Tolerance of X; let IT be TolSet of T; attr IT is TolClass-like means for x st not x in IT & x in X ex y st y in IT & not [x,y] in T; end; registration let X; let T be Tolerance of X; cluster TolClass-like for TolSet of T; end; definition let X; let T be Tolerance of X; mode TolClass of T is TolClass-like TolSet of T; end; theorem for T being Tolerance of X st {} is TolClass of T holds T={}; theorem {} is Tolerance of {}; theorem for x,y st [x,y] in T holds {x,y} is TolSet of T; theorem for x st x in X holds {x} is TolSet of T; theorem for Y,Z st Y is TolSet of T holds Y /\ Z is TolSet of T; theorem Y is TolSet of T implies Y c= X; theorem for Y being TolSet of T ex Z being TolClass of T st Y c= Z; theorem for x,y st [x,y] in T ex Z being TolClass of T st x in Z & y in Z; theorem for x st x in X ex Z being TolClass of T st x in Z; theorem T c= Total X; theorem id X c= T; scheme ToleranceEx{A() -> set,P[set,set]}: ex T being Tolerance of A() st for x,y st x in A() & y in A() holds [x,y] in T iff P[x,y] provided for x st x in A() holds P[x,x] and for x,y st x in A() & y in A() & P[x,y] holds P[y,x]; theorem for Y ex T being Tolerance of union Y st for Z st Z in Y holds Z is TolSet of T; theorem for Y being set for T,R being Tolerance of union Y st (for x,y holds [ x,y] in T iff ex Z st Z in Y & x in Z & y in Z) & (for x,y holds [x,y] in R iff ex Z st Z in Y & x in Z & y in Z) holds T = R; theorem for T,R being Tolerance of X st for Z holds Z is TolClass of T iff Z is TolClass of R holds T = R; notation let X, Y; let T be Relation of X, Y; let x; synonym neighbourhood (x, T) for Class (T,x); end; theorem for y being set holds y in neighbourhood(x,T) iff [x,y] in T; theorem for Y st for Z being set holds Z in Y iff x in Z & Z is TolClass of T holds neighbourhood(x,T) = union Y; theorem for Y st for Z holds Z in Y iff x in Z & Z is TolSet of T holds neighbourhood(x,T) = union Y; definition let X; let T be Tolerance of X; func TolSets T -> set means for Y holds Y in it iff Y is TolSet of T; func TolClasses T -> set means for Y holds Y in it iff Y is TolClass of T; end; theorem TolClasses R c= TolClasses T implies R c= T; theorem for T,R being Tolerance of X st TolClasses T = TolClasses R holds T = R; theorem union TolClasses T = X; theorem union TolSets T = X; theorem (for x st x in X holds neighbourhood(x,T) is TolSet of T) implies T is transitive; theorem T is transitive implies for x st x in X holds neighbourhood(x,T) is TolClass of T; theorem for x for Y being TolClass of T st x in Y holds Y c= neighbourhood(x,T ); theorem TolSets R c= TolSets T iff R c= T; theorem TolClasses T c= TolSets T; theorem (for x st x in X holds neighbourhood(x,R) c= neighbourhood(x,T)) implies R c= T; theorem T c= T*T; begin reserve X,x,y,z for set, k,n,m for Element of NAT, f for Function, p,q,r for FinSequence of NAT; notation let p,q be FinSequence; synonym p is_a_prefix_of q for p c= q; end; definition let p,q be FinSequence; redefine pred p is_a_prefix_of q means ex n st p = q|Seg n; end; theorem for p,q being FinSequence holds p is_a_prefix_of q iff ex r being FinSequence st q = p^r; theorem for p,q being FinSequence st p is_a_prefix_of q & len p = len q holds p = q; theorem <*x*> is_a_prefix_of <*y*> iff x = y; notation let p,q be FinSequence; synonym p is_a_proper_prefix_of q for p c< q; end; theorem for p,q being finite set st p,q are_c=-comparable & card p = card q holds p = q; reserve p1,p2,p3 for FinSequence; theorem <*x*>,<*y*> are_c=-comparable implies x = y; theorem for p,q being finite set st p c< q holds card p < card q; theorem p1^<*x*> is_a_prefix_of p2 implies p1 is_a_proper_prefix_of p2; theorem p1 is_a_prefix_of p2 implies p1 is_a_proper_prefix_of p2^<*x*>; theorem p1 is_a_proper_prefix_of p2^<*x*> implies p1 is_a_prefix_of p2; theorem {} is_a_proper_prefix_of p2 or {} <> p2 implies p1 is_a_proper_prefix_of p1^p2; definition let p be FinSequence; func ProperPrefixes p -> set means x in it iff ex q being FinSequence st x = q & q is_a_proper_prefix_of p; end; theorem for p being FinSequence st x in ProperPrefixes p holds x is FinSequence; theorem for p,q being FinSequence holds p in ProperPrefixes q iff p is_a_proper_prefix_of q; theorem for p,q being FinSequence st p in ProperPrefixes q holds len p < len q; theorem for p,q,r being FinSequence st q^r in ProperPrefixes p holds q in ProperPrefixes p; theorem ProperPrefixes {} = {}; theorem ProperPrefixes <*x*> = { {} }; theorem for p,q being FinSequence st p is_a_prefix_of q holds ProperPrefixes p c= ProperPrefixes q; theorem for p,q,r being FinSequence st q in ProperPrefixes p & r in ProperPrefixes p holds q,r are_c=-comparable; definition let X; attr X is Tree-like means X c= NAT* & (for p st p in X holds ProperPrefixes p c= X) & for p,k,n st p^<*k*> in X & n <= k holds p^<*n*> in X; end; registration cluster { {} } -> Tree-like; end; registration cluster non empty Tree-like for set; end; definition mode Tree is Tree-like non empty set; end; reserve T,T1 for Tree; theorem x in T implies x is FinSequence of NAT; definition let T; redefine mode Element of T -> FinSequence of NAT; end; theorem for p,q being FinSequence st p in T & q is_a_prefix_of p holds q in T; theorem for r being FinSequence st q^r in T holds q in T; theorem {} in T & <*> NAT in T; theorem { {} } is Tree; registration let T,T1; cluster T \/ T1 -> Tree-like; cluster T /\ T1 -> Tree-like non empty; end; theorem T \/ T1 is Tree; theorem T /\ T1 is Tree; registration cluster finite for Tree; end; reserve fT,fT1 for finite Tree; theorem fT \/ fT1 is finite Tree; theorem fT /\ T is finite Tree; definition let n; func elementary_tree n -> Tree equals { <*k*> : k < n } \/ { {} }; end; registration let n; cluster elementary_tree n -> finite; end; theorem k < n implies <*k*> in elementary_tree n; theorem elementary_tree 0 = { {} }; theorem p in elementary_tree n implies p = {} or ex k st k < n & p = <*k*>; definition let T; func Leaves T -> Subset of T means p in it iff p in T & not ex q st q in T & p is_a_proper_prefix_of q; let p such that p in T; func T|p -> Tree means q in it iff p^q in T; end; theorem T|(<*> NAT) = T; registration let T be finite Tree; let p be Element of T; cluster T|p -> finite; end; definition let T; assume Leaves T <> {}; mode Leaf of T -> Element of T means it in Leaves T; end; definition let T; mode Subtree of T -> Tree means ex p being Element of T st it = T|p; end; reserve t for Element of T; definition let T,p,T1; assume p in T; func T with-replacement (p,T1) -> Tree means q in it iff q in T & not p is_a_proper_prefix_of q or ex r st r in T1 & q = p^r; end; theorem p in T implies T with-replacement (p,T1) = { t1 where t1 is Element of T : not p is_a_proper_prefix_of t1 } \/ { p^s where s is Element of T1 : s = s }; theorem p in T implies T1 = T with-replacement (p,T1)|p; registration let T be finite Tree, t be Element of T; let T1 be finite Tree; cluster T with-replacement (t,T1) -> finite; end; reserve w for FinSequence; theorem for p being FinSequence holds ProperPrefixes p,dom p are_equipotent; registration let p be FinSequence; cluster ProperPrefixes p -> finite; end; theorem for p being FinSequence holds card ProperPrefixes p = len p; definition let IT be set; attr IT is AntiChain_of_Prefixes-like means (for x st x in IT holds x is FinSequence) & for p1,p2 st p1 in IT & p2 in IT & p1 <> p2 holds not p1,p2 are_c=-comparable; end; registration cluster AntiChain_of_Prefixes-like for set; end; definition mode AntiChain_of_Prefixes is AntiChain_of_Prefixes-like set; end; theorem { w } is AntiChain_of_Prefixes-like; theorem not p1,p2 are_c=-comparable implies { p1,p2 } is AntiChain_of_Prefixes-like; definition let T; mode AntiChain_of_Prefixes of T -> AntiChain_of_Prefixes means it c= T; end; reserve t1,t2 for Element of T; theorem {} is AntiChain_of_Prefixes of T & { {} } is AntiChain_of_Prefixes of T; theorem { t } is AntiChain_of_Prefixes of T; theorem not t1,t2 are_c=-comparable implies { t1,t2 } is AntiChain_of_Prefixes of T; registration let T be finite Tree; cluster -> finite for AntiChain_of_Prefixes of T; end; definition let T be finite Tree; func height T -> Element of NAT means (ex p st p in T & len p = it) & for p st p in T holds len p <= it; func width T -> Element of NAT means ex X being AntiChain_of_Prefixes of T st it = card X & for Y being AntiChain_of_Prefixes of T holds card Y <= card X; end; theorem 1 <= width fT; theorem height elementary_tree 0 = 0; theorem height fT = 0 implies fT = elementary_tree 0; theorem height elementary_tree(n+1) = 1; theorem width elementary_tree 0 = 1; theorem width elementary_tree(n+1) = n+1; theorem for t being Element of fT holds height(fT|t) <= height fT; theorem for t being Element of fT st t <> {} holds height(fT|t) < height fT; scheme TreeInd { P[Tree] }: for fT holds P[fT] provided for fT st for n st <*n*> in fT holds P[fT|<*n*>] holds P[fT]; begin reserve s,t for FinSequence; theorem w^t is_a_proper_prefix_of w^s implies t is_a_proper_prefix_of s; theorem n <> m implies not <*n*> is_a_prefix_of <*m*>^s; theorem elementary_tree 1 = {{},<*0*>}; theorem not <*n*> is_a_proper_prefix_of <*m*>; theorem elementary_tree 2 = {{},<*0*>,<*1*>}; theorem for T being Tree, t being Element of T holds t in Leaves T iff not t^<*0*> in T; theorem for T being Tree, t being Element of T holds t in Leaves T iff not ex n being Element of NAT st t^<*n*> in T; definition func TrivialInfiniteTree equals { k |-> 0 where k is Element of NAT: not contradiction }; end; registration cluster TrivialInfiniteTree -> non empty Tree-like; end; theorem NAT,TrivialInfiniteTree are_equipotent; registration cluster TrivialInfiniteTree -> infinite; end; begin reserve f for Function; reserve p,q for FinSequence; reserve A,B,C,x,x1,x2,y,z for set; reserve k,l,m,n for Nat; reserve a for Nat; definition let f,x; pred f is_one-to-one_at x means f"Im(f,x) = {x}; end; theorem f is_one-to-one_at x implies x in dom f; theorem f is_one-to-one_at x iff x in dom f & f " {f.x} = {x}; theorem f is_one-to-one_at x iff x in dom f & for z st z in dom f & x <> z holds f.x <> f.z; theorem (for x st x in dom f holds f is_one-to-one_at x) iff f is one-to-one; definition let R be Relation, y be set; pred R just_once_values y means card Coim(R,y) = 1; end; theorem f just_once_values y implies y in rng f; theorem f just_once_values y iff ex x st {x} = f " {y}; theorem f just_once_values y iff ex x st x in dom f & y = f.x & for z st z in dom f & z <> x holds f.z <> y; theorem f is one-to-one iff for y st y in rng f holds f just_once_values y; theorem f is_one-to-one_at x iff x in dom f & f just_once_values f.x; definition let f,y; assume f just_once_values y; func f <- y -> set means it in dom f & f.it = y; end; theorem f just_once_values y implies Im(f, f<-y) = {y}; theorem f just_once_values y implies f " {y} = {f <- y}; theorem f is one-to-one & y in rng f implies (f").y = f <- y; theorem f is_one-to-one_at x implies f <- (f.x) = x; theorem f just_once_values y implies f is_one-to-one_at f <- y; reserve D for non empty set; reserve d,d1,d2,d3 for Element of D; definition let D; let d1,d2; redefine func <* d1,d2 *> -> FinSequence of D; end; definition let D; let d1,d2,d3; redefine func <* d1,d2,d3 *> -> FinSequence of D; end; theorem for i being Nat for D being set, P being FinSequence of D st 1 <= i & i <= len P holds P/.i = P.i; theorem <* d *>/.1 = d; theorem <* d1,d2 *>/.1 = d1 & <* d1,d2 *>/.2 = d2; theorem <* d1,d2,d3 *>/.1 = d1 & <* d1,d2,d3 *>/.2 = d2 & <* d1,d2,d3 *>/.3 = d3; definition let p,x; func x..p -> Element of NAT equals Sgm(p " {x}).1; end; theorem x in rng p implies p.(x..p) = x; theorem x in rng p implies x..p in dom p; theorem x in rng p implies 1 <= x..p & x..p <= len p; theorem x in rng p implies x..p - 1 is Element of NAT & len p - x..p is Element of NAT; theorem x in rng p implies x..p in p " {x}; theorem for k st k in dom p & k < x..p holds p.k <> x; theorem p just_once_values x implies p <- x = x..p; theorem p just_once_values x implies for k st k in dom p & k <> x..p holds p.k <> x; theorem x in rng p & (for k st k in dom p & k <> x..p holds p.k <> x) implies p just_once_values x; theorem p just_once_values x iff x in rng p & {x..p} = p " {x}; theorem p is one-to-one & x in rng p implies {x..p} = p " {x}; theorem p just_once_values x iff len(p - {x}) = len p - 1; reserve L,M for Element of NAT; theorem p just_once_values x implies for k st k in dom(p - {x}) holds (k < x..p implies (p - {x}).k = p.k) & (x..p <= k implies (p - {x}).k = p.(k + 1)) ; theorem p is one-to-one & x in rng p implies for k st k in dom(p - {x}) holds ((p - {x}).k = p.k iff k < x..p) & ((p - {x}).k = p.(k + 1) iff x..p <= k); definition let p; let x; assume x in rng p; func p -| x -> FinSequence means ex n st n = x..p - 1 & it = p | Seg n; end; theorem x in rng p & n = x..p - 1 implies p | Seg n = p -| x; theorem x in rng p implies len(p -| x) = x..p - 1; theorem x in rng p & n = x..p - 1 implies dom(p -| x) = Seg n; theorem x in rng p & k in dom(p -| x) implies p.k = (p -| x).k; theorem x in rng p implies not x in rng(p -| x); theorem x in rng p implies rng(p -| x) misses {x}; theorem x in rng p implies rng(p -| x) c= rng p; theorem x in rng p implies (x..p = 1 iff p -| x = {}); theorem x in rng p & p is FinSequence of D implies p -| x is FinSequence of D; definition let p; let x; assume x in rng p; func p |-- x -> FinSequence means len it = len p - x..p & for k st k in dom it holds it.k = p.(k + x..p); end; theorem x in rng p & n = len p - x..p implies dom(p |-- x) = Seg n; theorem x in rng p & n in dom(p |-- x) implies n + x..p in dom p; theorem x in rng p implies rng(p |-- x) c= rng p; theorem p just_once_values x iff x in rng p & not x in rng(p |-- x); theorem x in rng p & p is one-to-one implies not x in rng(p |-- x); theorem p just_once_values x iff x in rng p & rng(p |-- x) misses {x}; theorem x in rng p & p is one-to-one implies rng(p |-- x) misses {x}; theorem x in rng p implies (x..p = len p iff p |-- x = {}); theorem x in rng p & p is FinSequence of D implies p |-- x is FinSequence of D; theorem x in rng p implies p = (p -| x) ^ <* x *> ^ (p |-- x); theorem x in rng p & p is one-to-one implies p -| x is one-to-one; theorem x in rng p & p is one-to-one implies p |-- x is one-to-one; theorem p just_once_values x iff x in rng p & p - {x} = (p -| x) ^ (p |-- x); theorem x in rng p & p is one-to-one implies p - {x} = (p -| x) ^ (p |-- x); theorem x in rng p & p - {x} is one-to-one & p - {x} = (p -| x) ^ (p |-- x) implies p is one-to-one; theorem x in rng p & p is one-to-one implies rng(p -| x) misses rng(p |-- x); theorem A is finite implies ex p st rng p = A & p is one-to-one; theorem rng p c= dom p & p is one-to-one implies rng p = dom p; theorem rng p = dom p implies p is one-to-one; theorem rng p = rng q & len p = len q & q is one-to-one implies p is one-to-one; theorem p is one-to-one iff card(rng p) = len p; reserve f for Function of A,B; theorem for A,B being finite set, f being Function of A,B holds card A = card B & f is one-to-one implies rng f = B; theorem for A,B being finite set, f being Function of A,B st card A = card B & rng f = B holds f is one-to-one; theorem card B in card A & B <> {} implies ex x,y st x in A & y in A & x <> y & f.x = f.y; theorem card A in card B implies ex x st x in B & for y st y in A holds f.y <> x; begin theorem for D being non empty set, f being FinSequence of D, p being Element of D holds (f^<*p*>)/.(len f + 1) = p; theorem for E being non empty set, p,q being FinSequence of E st k in dom p holds (p ^ q)/.k = p/.k; theorem for E being non empty set, p,q being FinSequence of E st k in dom q holds (p ^ q)/.(len p + k) = q/.k; theorem for m being Nat for D being set, p being FinSequence of D st a in dom( p|m) holds (p|m qua FinSequence of D)/.a = p/.a; theorem for D being set, f being FinSequence of D, n,m st n in dom f & m in Seg n holds m in dom f & (f|n)/.m = f/.m; theorem for X being finite set st n <= card X holds ex A being finite Subset of X st card A = n; reserve f for Function; theorem f is one-to-one & x in rng f implies card Coim (f,x) = 1; definition let x1,x2,x3,x4 be set; func <*x1,x2,x3,x4*> -> set equals <*x1,x2,x3*>^<*x4*>; let x5 be set; func <*x1,x2,x3,x4,x5*> -> set equals <*x1,x2,x3*>^<*x4,x5*>; end; registration let x1,x2,x3,x4 be set; cluster <*x1,x2,x3,x4*> -> non empty Function-like Relation-like; let x5 be set; cluster <*x1,x2,x3,x4,x5*> -> non empty Function-like Relation-like; end; registration let x1,x2,x3,x4 be set; cluster <*x1,x2,x3,x4*> -> FinSequence-like; let x5 be set; cluster <*x1,x2,x3,x4,x5*> -> FinSequence-like; end; definition let D be non empty set,x1,x2,x3,x4 be Element of D; redefine func <* x1,x2,x3,x4*> -> FinSequence of D; end; definition let D be non empty set,x1,x2,x3,x4,x5 be Element of D; redefine func <*x1,x2,x3,x4,x5*> -> FinSequence of D; end; reserve x1,x2,x3,x4,x5 for set; theorem <*x1,x2,x3,x4*>=<*x1,x2,x3*>^<*x4*> & <*x1,x2,x3,x4*>=<*x1,x2*>^ <*x3,x4*> & <*x1,x2,x3,x4*>=<*x1*>^<*x2,x3,x4*> & <*x1,x2,x3,x4*>=<*x1*>^<*x2*> ^<*x3*>^<*x4*>; theorem <*x1,x2,x3,x4,x5*>=<*x1,x2,x3*>^<*x4,x5*> & <*x1,x2,x3,x4,x5*>= <*x1,x2,x3,x4*>^<*x5*> & <*x1,x2,x3,x4,x5*>=<*x1*>^<*x2*>^<*x3*>^<*x4*>^<*x5*> & <*x1,x2,x3,x4,x5*>=<*x1,x2*>^<*x3,x4,x5*> & <*x1,x2,x3,x4,x5*>=<*x1*>^<*x2,x3 ,x4,x5*>; reserve p for FinSequence; theorem p = <*x1,x2,x3,x4*> iff len p = 4 & p.1 = x1 & p.2 = x2 & p.3=x3 & p.4= x4; canceled; theorem p = <*x1,x2,x3,x4,x5*> iff len p = 5 & p.1 = x1 & p.2 = x2 & p.3 =x3 & p.4= x4 & p.5= x5; reserve ND for non empty set; reserve y1,y2,y3,y4,y5 for Element of ND; canceled; theorem <*y1,y2,y3,y4*>/.1 = y1 & <*y1,y2,y3,y4*>/.2 = y2 & <*y1,y2,y3,y4*>/.3 = y3 & <*y1,y2,y3,y4*>/.4=y4; theorem <*y1,y2,y3,y4,y5*>/.1 = y1 & <*y1,y2,y3,y4,y5*>/.2 = y2 & <*y1,y2,y3, y4,y5*>/.3 = y3 & <*y1,y2,y3,y4,y5*>/.4=y4 & <*y1,y2,y3,y4,y5*>/.5=y5; scheme Sch1{D()->non empty set, N()->Nat, P[set,set]}: ex f being FinSequence of D( ) st len f = N() & for n st n in Seg N() holds P[n,f/.n] provided for n st n in Seg N() ex d being Element of D() st P[n,d]; theorem for D being non empty set, p,q being FinSequence of D st p c= q holds ex p9 being FinSequence of D st p ^ p9 = q; theorem for D being non empty set, p,q being FinSequence of D, i being Element of NAT st p c= q & 1 <= i & i <= len p holds q.i = p.i; scheme PiLambdaD{D()-> non empty set, l()->Nat, F(set)-> Element of D()}: ex g being FinSequence of D() st len g=l() & for n being Nat st n in dom g holds g/. n=F(n); registration let x1,x2,x3,x4 be set; cluster <*x1,x2,x3,x4*> -> 4-element; let x5 be set; cluster <*x1,x2,x3,x4,x5*> -> 5-element; end; begin theorem for m, n being Nat holds m < n implies ex p being Element of NAT st n = m+p & 1 <= p; theorem for S being set, D1, D2 being non empty set, f1 being Function of S, D1, f2 being Function of D1, D2 holds f1 is bijective & f2 is bijective implies f2*f1 is bijective; theorem for Y being set, E1, E2 being Equivalence_Relation of Y holds Class E1 = Class E2 implies E1 = E2; registration let Z be finite set; cluster -> finite for a_partition of Z; end; registration let X be non empty finite set; cluster non empty finite for a_partition of X; end; reserve X, A for non empty finite set, PX for a_partition of X, PA1, PA2 for a_partition of A; theorem for X being non empty set, PX being a_partition of X for Pi being set st Pi in PX ex x being Element of X st x in Pi; theorem card PX <= card X; theorem PA1 is_finer_than PA2 implies card PA2 <= card PA1; theorem PA1 is_finer_than PA2 implies for p2 being Element of PA2 ex p1 being Element of PA1 st p1 c=p2; theorem PA1 is_finer_than PA2 & card PA1 = card PA2 implies PA1 = PA2; registration let D be set, M be FinSequence of D*; let k; cluster M/.k -> Function-like Relation-like; end; registration let D be set, M be FinSequence of D*; let k; cluster M/.k -> FinSequence-like D-valued for Function; end; begin reserve x,y,y1,y2 for set, D for non empty set, d,d1,d2,d3 for Element of D, F ,G,H,H1,H2 for FinSequence of D, f,f1,f2 for Function of NAT,D, g for BinOp of D, k,n,i,l for Element of NAT, P for Permutation of dom F; definition let D,F,g; assume g is having_a_unity or len F >= 1; func g "**" F -> Element of D means it = the_unity_wrt g if g is having_a_unity & len F = 0 otherwise ex f st f.1 = F.1 & (for n st 0 <> n & n < len F holds f.(n + 1) = g.(f.n,F.(n + 1))) & it = f.(len F); end; theorem len F >= 1 implies ex f st f.1 = F.1 & (for n st 0 <> n & n < len F holds f.(n + 1) = g.(f.n,F.(n + 1))) & g "**" F = f.(len F); theorem len F >= 1 & (ex f st f.1 = F.1 & (for n st 0 <> n & n < len F holds f .(n + 1) = g.(f.n,F.(n + 1))) & d = f.(len F)) implies d = g "**" F; definition let A be non empty set, F be Function of NAT,A, p be FinSequence of A; redefine func F +* p -> Function of NAT,A; end; notation let f be FinSequence; synonym findom f for dom f; end; definition let f be FinSequence; redefine func findom f -> Element of Fin NAT; end; theorem (g is having_a_unity or len F >= 1) & g is associative & g is commutative implies g "**" F = g $$(findom F,(NAT-->the_unity_wrt g)+*F); theorem g is having_a_unity or len F >= 1 implies g "**" (F ^ <* d *>) = g.(g "**" F,d); theorem g is associative & (g is having_a_unity or len F >= 1 & len G >= 1) implies g "**" (F ^ G) = g.(g "**" F,g "**" G); theorem g is associative & (g is having_a_unity or len F >= 1) implies g "**" (<* d *> ^ F) = g.(d,g "**" F); theorem g is commutative associative & (g is having_a_unity or len F >= 1 ) & G = F * P implies g "**" F = g "**" G; theorem (g is having_a_unity or len F >= 1) & g is associative commutative & F is one-to-one & G is one-to-one & rng F = rng G implies g "**" F = g "**" G; theorem g is associative commutative & (g is having_a_unity or len F >= 1) & len F = len G & len F = len H & (for k st k in dom F holds F.k = g.(G.k,H.k)) implies g "**" F = g.(g "**" G,g "**" H); theorem g is having_a_unity implies g "**" <*>D = the_unity_wrt g; theorem g "**" <* d *> = d; theorem g "**" <* d1,d2 *> = g.(d1,d2); theorem g is commutative implies g "**" <* d1,d2 *> = g "**" <* d2,d1 *>; theorem g "**" <* d1,d2,d3 *> = g.(g.(d1,d2),d3); theorem g is commutative implies g "**" <* d1,d2,d3 *> = g "**" <* d2,d1,d3 *>; theorem g "**" (1 |-> d) = d; theorem g "**" (2 |-> d) = g.(d,d); theorem g is associative & (g is having_a_unity or k <> 0 & l <> 0) implies g "**" ((k + l) |-> d) = g.(g "**" (k |-> d),g "**" (l |-> d)); theorem g is associative & (g is having_a_unity or k <> 0 & l <> 0) implies g "**" (k * l |-> d) = g "**" (l |-> (g "**" (k |-> d))); theorem len F = 1 implies g "**" F = F.1; theorem len F = 2 implies g "**" F = g.(F.1,F.2); begin reserve x,y for set; reserve C,C9,D,E for non empty set; reserve c,c9,c1,c2,c3 for Element of C; reserve B,B9,B1,B2 for Element of Fin C; reserve A for Element of Fin C9; reserve d,d1,d2,d3,d4,e for Element of D; reserve F,G for BinOp of D; reserve u for UnOp of D; reserve f,f9 for Function of C,D; reserve g for Function of C9,D; reserve H for BinOp of E; reserve h for Function of D,E; reserve i,j for Nat; reserve s for Function; reserve p,q for FinSequence of D; reserve T1,T2 for Element of i-tuples_on D; theorem F is commutative associative & c1 <> c2 implies F $$ ({.c1,c2.},f ) = F.(f.c1, f.c2); theorem F is commutative associative & (B <> {} or F is having_a_unity) & not c in B implies F $$(B \/ {.c.}, f) = F.(F $$(B,f),f.c); theorem F is commutative associative & c1 <> c2 & c1 <> c3 & c2 <> c3 implies F $$ ({.c1,c2,c3.},f) = F.(F.(f.c1, f.c2),f.c3); theorem F is commutative associative & (B1 <> {} & B2 <> {} or F is having_a_unity) & B1 misses B2 implies F $$(B1 \/ B2, f) = F.(F $$(B1,f),F $$( B2,f)); theorem F is commutative associative & (A <> {} or F is having_a_unity) & (ex s st dom s = A & rng s = B & s is one-to-one & g|A = f*s) implies F $$(A,g) = F $$(B,f); theorem H is commutative associative & (B <> {} or H is having_a_unity) & f is one-to-one implies H $$(f.:B,h) = H $$(B,h*f); theorem F is commutative associative & (B <> {} or F is having_a_unity) & f|B = f9|B implies F $$(B,f) = F $$(B,f9); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & f.:B = {e} implies F$$(B,f) = e; theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G.(e,e) = e & (for d1,d2,d3,d4 holds F.(G.(d1,d2),G.(d3,d4))= G.(F.(d1,d3),F.(d2,d4))) implies G.(F$$(B,f),F$$(B,f9)) = F $$(B,G.:(f,f9)); theorem F is commutative associative & F is having_a_unity implies F.(F$$(B,f) ,F$$(B,f9)) = F $$(B,F.:(f,f9)); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G = F*(id D,the_inverseOp_wrt F) implies G.(F$$(B,f),F$$( B,f9)) = F $$(B,G.:(f,f9)); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G is_distributive_wrt F & G.(d,e) = e implies G.(d,F$$(B,f)) = F $$(B,G[;](d,f)); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G is_distributive_wrt F & G.(e,d) = e implies G.(F$$(B,f),d) = F $$(B,G[:](f,d)); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G.(d,F$$(B,f)) = F $$(B,G [;](d,f)); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G.(F$$(B,f),d) = F $$(B,G [:](f,d)); theorem F is commutative associative & F is having_a_unity & H is commutative associative & H is having_a_unity & h.the_unity_wrt F = the_unity_wrt H & (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h.(F $$(B,f)) = H $$(B,h*f); theorem F is commutative associative & F is having_a_unity & u.the_unity_wrt F = the_unity_wrt F & u is_distributive_wrt F implies u.(F$$(B,f)) = F $$(B,u*f); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G[;](d,id D).(F$$(B,f)) = F $$(B,G[;](d,id D)*f); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp implies (the_inverseOp_wrt F).(F$$(B,f)) = F $$(B,( the_inverseOp_wrt F)*f); definition let D,p,d; func [#](p,d) -> Function of NAT,D equals (NAT --> d) +* p; end; theorem (i in dom p implies [#](p,d).i = p.i) & (not i in dom p implies [#](p,d).i = d); theorem [#](p,d)|(dom p) = p; theorem [#](p^q,d)|(dom p) = p; theorem rng [#](p,d) = rng p \/ {d}; theorem h*[#](p,d) = [#](h*p,h.d); notation let i be Nat; synonym finSeg i for Seg i; end; definition let i be Nat; redefine func finSeg i -> Element of Fin NAT; end; notation let D,p,F; synonym F $$ p for F "**" p; end; definition let D,p,F; assume ( F is having_a_unity or len p >= 1)& F is associative commutative; redefine func F $$ p equals F $$(findom p,[#](p,the_unity_wrt F)); end; theorem F is having_a_unity implies F"**"(i|->the_unity_wrt F) = the_unity_wrt F; theorem F is associative & (i>=1 & j>=1 or F is having_a_unity) implies F"**"((i+j)|->d) = F.(F"**"(i|->d),F"**"(j|->d)); theorem F is commutative associative & (i>=1 & j>=1 or F is having_a_unity) implies F"**"((i*j)|->d) = F"**"(j|->(F"**"(i|->d))); theorem F is having_a_unity & H is having_a_unity & h.the_unity_wrt F = the_unity_wrt H & (for d1,d2 holds h.(F.(d1,d2)) = H.(h.d1,h.d2)) implies h.(F "**"p) = H "**"(h*p); theorem F is having_a_unity & u.the_unity_wrt F = the_unity_wrt F & u is_distributive_wrt F implies u.(F"**"p) = F "**"(u*p); theorem F is associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G[;](d,id D).(F"**"p) = F "**"(G[;](d,id D)*p); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp implies (the_inverseOp_wrt F).(F"**"p) = F "**"(( the_inverseOp_wrt F)*p); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G.(e,e) = e & (for d1,d2,d3,d4 holds F.(G.(d1,d2),G.(d3,d4))= G.(F.(d1,d3),F.(d2,d4))) & len p = len q implies G.(F"**"p,F"**"q) = F "**"(G.: (p,q)); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G.(e,e) = e & (for d1,d2,d3,d4 holds F.(G.(d1,d2),G.(d3,d4))= G.(F.(d1,d3),F.(d2,d4))) implies G.(F"**"T1,F"**"T2) = F "**"(G.:(T1,T2)); theorem F is commutative associative & F is having_a_unity & len p = len q implies F.(F"**"p,F"**"q) = F "**"(F.:(p,q)); theorem F is commutative associative & F is having_a_unity implies F.(F"**"T1,F"**"T2) = F "**"(F.:(T1,T2)); theorem F is commutative associative & F is having_a_unity implies F"**"(i|->(F.(d1,d2))) = F.(F"**"(i|->d1),F"**"(i|->d2)); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G = F*(id D,the_inverseOp_wrt F) implies G.(F"**"T1,F"**" T2) = F "**"(G.:(T1,T2)); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G is_distributive_wrt F & G.(d,e) = e implies G.(d,F"**"p) = F "**"(G[;](d,p)); theorem F is commutative associative & F is having_a_unity & e = the_unity_wrt F & G is_distributive_wrt F & G.(e,d) = e implies G.(F"**"p,d) = F "**"(G[:](p,d)); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G.(d,F"**"p) = F "**"(G [;](d,p)); theorem F is commutative associative & F is having_a_unity & F is having_an_inverseOp & G is_distributive_wrt F implies G.(F"**"p,d) = F "**"(G [:](p,d)); begin reserve x,X,Y for set; reserve C for non empty set; reserve c for Element of C; reserve f,f1,f2,f3,g,g1 for complex-valued Function; reserve r,p for complex number; definition let f1,f2 be complex-valued Function; func f1/f2 -> Function means dom it = dom f1 /\ (dom f2 \ f2"{0}) & for c being set st c in dom it holds it.c = f1.c * (f2.c)"; end; registration let f1, f2 be complex-valued Function; cluster f1/f2 -> complex-valued; end; registration let f1, f2 be real-valued Function; cluster f1/f2 -> real-valued; end; definition let C be set, D be complex-membered set; let f1, f2 be PartFunc of C,D; redefine func f1/f2 -> PartFunc of C,COMPLEX; end; definition let C be set, D be real-membered set; let f1, f2 be PartFunc of C,D; redefine func f1/f2 -> PartFunc of C,REAL; end; definition let f be complex-valued Function; func f^ -> Function means dom it = dom f \ f"{0} & for c being set st c in dom it holds it.c = (f.c)"; end; registration let f be complex-valued Function; cluster f^ -> complex-valued; end; registration let f be real-valued Function; cluster f^ -> real-valued; end; definition let C be set, D be complex-membered set, f be PartFunc of C,D; redefine func f^ -> PartFunc of C,COMPLEX; end; definition let C be set, D be real-membered set, f be PartFunc of C,D; redefine func f^ -> PartFunc of C,REAL; end; theorem dom (g^) c= dom g & dom g /\ (dom g \ g"{0}) = dom g \ g"{0}; theorem dom (f1(#)f2) \ (f1(#)f2)"{0} = (dom f1 \ f1"{0}) /\ (dom f2 \ f2"{0}); theorem c in dom (f^) implies f.c <> 0; theorem (f^)"{0} = {}; theorem (abs(f))"{0} = f"{0} & (-f)"{0} = f"{0}; theorem dom (f^^) = dom (f|(dom (f^))); theorem r<>0 implies (r(#)f)"{0} = f"{0}; theorem (f1 + f2) + f3 = f1 + (f2 + f3); theorem (f1 (#) f2) (#) f3 = f1 (#) (f2 (#) f3); theorem (f1 + f2) (#) f3=f1 (#) f3 + f2 (#) f3; theorem f3 (#) (f1 + f2)=f3(#)f1 + f3(#)f2; theorem r(#)(f1(#)f2)=r(#)f1(#)f2; theorem r(#)(f1(#)f2)=f1(#)(r(#)f2); theorem (f1 - f2)(#)f3=f1(#)f3 - f2(#)f3; theorem f3(#)f1 - f3(#)f2 = f3(#)(f1 - f2); theorem r(#)(f1 + f2) = r(#)f1 + r(#)f2; theorem (r*p)(#)f = r(#)(p(#)f); theorem r(#)(f1 - f2) = r(#)f1 - r(#)f2; theorem f1-f2 = (-1)(#)(f2-f1); theorem f1 - (f2 + f3) = f1 - f2 - f3; theorem 1(#)f = f; theorem f1 - (f2 - f3) = f1 - f2 + f3; theorem f1 + (f2 - f3) = f1 + f2 - f3; theorem abs(f1(#)f2) = abs(f1)(#)abs(f2); theorem abs(r(#)f) = abs(r)(#)abs(f); theorem f^^ = f|(dom (f^)); theorem (f1(#)f2)^ = (f1^)(#)(f2^); theorem r<>0 implies (r(#)f)^ = r" (#) (f^); theorem (-f)^ = (-1)(#)(f^); theorem (abs(f))^ = abs(f^); theorem f/g = f(#) (g^); theorem r(#)(g/f) = (r(#)g)/f; theorem (f/g)(#)g = (f|dom(g^)); theorem (f/g)(#)(f1/g1) = (f(#)f1)/(g(#)g1); theorem (f1/f2)^ = (f2|dom(f2^))/f1; theorem g (#) (f1/f2) = (g (#) f1)/f2; theorem g/(f1/f2) = (g(#)(f2|dom(f2^)))/f1; theorem -f/g = (-f)/g & f/(-g) = -f/g; theorem f1/f + f2/f = (f1 + f2)/f & f1/f - f2/f = (f1 - f2)/f; theorem f1/f + g1/g = (f1(#)g + g1(#)f)/(f(#)g); theorem (f/g)/(f1/g1) = (f(#)(g1|dom(g1^)))/(g(#)f1); theorem f1/f - g1/g = (f1(#)g - g1(#)f)/(f(#)g); theorem abs(f1/f2) = abs(f1)/abs(f2); theorem (f1+f2)|X = f1|X + f2|X & (f1+f2)|X = f1|X + f2 & (f1+f2)|X = f1 + f2|X; theorem (f1(#)f2)|X = f1|X (#) f2|X & (f1(#)f2)|X = f1|X (#) f2 & (f1(#) f2)|X = f1 (#) f2|X; theorem (-f)|X = -(f|X) & (f^)|X = (f|X)^ & (abs(f))|X = abs((f|X)); theorem (f1-f2)|X = f1|X - f2|X & (f1-f2)|X = f1|X - f2 & (f1-f2)|X = f1 - f2| X; theorem (f1/f2)|X = f1|X / f2|X & (f1/f2)|X = f1|X / f2 &(f1/f2)|X = f1 / f2|X; theorem (r(#)f)|X = r(#)(f|X); reserve r,r1,r2,p for real number; reserve f,f1,f2 for PartFunc of C,REAL; theorem (f1 is total & f2 is total iff f1+f2 is total) & (f1 is total & f2 is total iff f1-f2 is total) & (f1 is total & f2 is total iff f1(#)f2 is total); theorem f is total iff r(#)f is total; theorem f is total iff -f is total; theorem f is total iff abs(f) is total; theorem f^ is total iff f"{0} = {} & f is total; theorem f1 is total & f2"{0} = {} & f2 is total iff f1/f2 is total; theorem f1 is total & f2 is total implies (f1+f2).c = f1.c + f2.c & (f1-f2).c = f1.c - f2.c & (f1(#)f2).c = f1.c * f2.c; theorem f is total implies (r(#)f).c = r * (f.c); theorem f is total implies (-f).c = - f.c & (abs(f)).c = abs( f.c ); theorem f^ is total implies (f^).c = (f.c)"; theorem f1 is total & f2^ is total implies (f1/f2).c = f1.c *(f2.c)"; definition let X,C be set; redefine func chi(X,C) -> PartFunc of C,REAL; end; registration let X,C be set; cluster chi(X,C) -> total for PartFunc of C,REAL; end; theorem f= chi(X,C) iff ( dom f = C & for c holds (c in X implies f.c = 1) & (not c in X implies f.c = 0)); theorem chi(X,C) is total; theorem c in X iff chi(X,C).c = 1; theorem not c in X iff chi(X,C).c = 0; theorem c in C \ X iff chi(X,C).c = 0; theorem chi(C,C).c = 1; theorem chi(X,C).c <> 1 iff chi(X,C).c = 0; theorem X misses Y implies chi(X,C) + chi(Y,C) = chi(X \/ Y,C); theorem chi(X,C) (#) chi(Y,C) = chi(X /\ Y,C); reserve f for real-valued Function; theorem f|Y is bounded_above iff ex r st for c being set st c in Y /\ dom f holds f.c <= r; theorem f|Y is bounded_below iff ex r st for c being set st c in Y /\ dom f holds r <= f.c; theorem f is bounded iff ex r st for c being set st c in dom f holds abs (f.c)<=r; theorem f|Y is bounded iff ex r st for c being set st c in Y /\ dom f holds abs(f.c)<=r; theorem (Y c= X & f|X is bounded_above implies f|Y is bounded_above) & (Y c= X & f|X is bounded_below implies f|Y is bounded_below) & (Y c= X & f|X is bounded implies f|Y is bounded); theorem f|X is bounded_above & f|Y is bounded_below implies f|(X /\ Y) is bounded; registration cluster constant -> bounded for real-valued Function; end; theorem X misses dom f implies f|X is bounded; theorem (0(#)f)|Y is bounded; registration let f be bounded_above real-valued Function, X be set; cluster f|X -> bounded_above for real-valued Function; end; registration let f be bounded_below real-valued Function, X be set; cluster f|X -> bounded_below for real-valued Function; end; registration let f be bounded_above real-valued Function; let r be non negative real number; cluster r(#)f -> bounded_above for real-valued Function; end; registration let f be bounded_below real-valued Function; let r be non negative real number; cluster r(#)f -> bounded_below for real-valued Function; end; registration let f be bounded_above real-valued Function; let r be non positive real number; cluster r(#)f -> bounded_below for real-valued Function; end; registration let f be bounded_below real-valued Function; let r be non positive real number; cluster r(#)f -> bounded_above for real-valued Function; end; theorem (f|Y is bounded_above & 0<=r implies (r(#)f)|Y is bounded_above) & (f|Y is bounded_above & r<=0 implies (r(#)f)|Y is bounded_below); theorem (f|Y is bounded_below & 0<=r implies (r(#)f)|Y is bounded_below) & (f|Y is bounded_below & r<=0 implies (r(#)f)|Y is bounded_above); theorem f|Y is bounded implies (r(#)f)|Y is bounded; registration let f; cluster abs f -> bounded_below; end; theorem (abs f)|X is bounded_below; registration let f be bounded real-valued Function; cluster abs f -> bounded for real-valued Function; end; registration let f be bounded_above real-valued Function; cluster -f -> bounded_below for real-valued Function; end; theorem f|Y is bounded implies (abs f)|Y is bounded & (-f)|Y is bounded; reserve f1,f2 for real-valued Function; registration let f1,f2 be bounded_above real-valued Function; cluster f1+f2 -> bounded_above for real-valued Function; end; registration let f1,f2 be bounded_below real-valued Function; cluster f1+f2 -> bounded_below for real-valued Function; end; theorem (f1|X is bounded_above & f2|Y is bounded_above implies (f1+f2)| (X /\ Y) is bounded_above) & (f1|X is bounded_below & f2|Y is bounded_below implies (f1+f2)|(X /\ Y) is bounded_below) & (f1|X is bounded & f2|Y is bounded implies (f1+f2)|(X /\ Y) is bounded); registration let f1,f2 be bounded real-valued Function; cluster f1(#)f2 -> bounded for real-valued Function; end; theorem f1|X is bounded & f2|Y is bounded implies (f1(#)f2)|(X /\ Y) is bounded & (f1-f2)|(X /\ Y) is bounded; theorem f|X is bounded_above & f|Y is bounded_above implies f|(X \/ Y) is bounded_above; theorem f|X is bounded_below & f|Y is bounded_below implies f|(X \/ Y) is bounded_below; theorem f|X is bounded & f|Y is bounded implies f|(X \/ Y) is bounded; reserve f,f1,f2 for PartFunc of C,REAL; registration let C; let f1,f2 be constant PartFunc of C,REAL; cluster f1+f2 -> constant; cluster f1-f2 -> constant; cluster f1(#)f2 -> constant; end; theorem f1|X is constant & f2|Y is constant implies (f1+f2)|(X /\ Y) is constant & (f1-f2)|(X /\ Y) is constant & (f1(#)f2)|(X /\ Y) is constant; registration let C; let f be constant PartFunc of C,REAL; cluster -f -> constant; cluster abs f -> constant; let p; cluster p(#)f -> constant; end; theorem f|Y is constant implies (p(#)f)|Y is constant; theorem f|Y is constant implies (-f)|Y is constant; theorem f|Y is constant implies (abs f)|Y is constant; theorem f|Y is constant implies (for r holds (r(#)f)|Y is bounded) & (-f)|Y is bounded & (abs f)|Y is bounded; theorem (f1|X is bounded_above & f2|Y is constant implies (f1+f2)|(X /\ Y) is bounded_above) & (f1|X is bounded_below & f2|Y is constant implies (f1+f2)|(X /\ Y) is bounded_below) & (f1|X is bounded & f2|Y is constant implies (f1+f2)|( X /\ Y) is bounded); theorem (f1|X is bounded_above & f2|Y is constant implies (f1-f2)|(X /\ Y) is bounded_above) & (f1|X is bounded_below & f2|Y is constant implies (f1-f2)|(X /\ Y) is bounded_below) & (f1|X is bounded & f2|Y is constant implies (f1-f2)|( X /\ Y) is bounded & (f2-f1)|(X /\ Y) is bounded& (f1(#)f2)|(X /\ Y) is bounded ); begin registration let n be Nat; cluster n-element natural-valued for FinSequence; end; registration cluster real-valued for FinSequence; end; definition let F be real-valued Relation; redefine func rng F -> Subset of REAL; end; registration let D be non empty set; let F be Function of REAL,D; let F1 be real-valued FinSequence; cluster F*F1 -> FinSequence-like; end; registration let r be real number; cluster <*r*> -> real-valued; end; registration let r1, r2 be real number; cluster <*r1, r2*> -> real-valued; end; registration let r1, r2, r3 be real number; cluster <*r1, r2, r3*> -> real-valued; end; registration let r1, r2, r3, r4 be real number; cluster <*r1, r2, r3, r4*> -> real-valued; end; registration let j be Nat, r be real number; cluster j |-> r -> real-valued; end; registration let f, g be real-valued FinSequence; cluster f ^ g -> real-valued; end; reserve s for set, i,j,k for Nat, x,x1,x2,x3 for Element of REAL, r,r1,r2,r3,r4 for real number, F,F1,F2,F3 for real-valued FinSequence, R,R1,R2 for Element of i-tuples_on REAL; theorem 0 is_a_unity_wrt addreal; definition redefine func diffreal equals addreal*(id REAL,compreal); end; definition func sqrreal -> UnOp of REAL means for r holds it.r = r^2; end; theorem 1 is_a_unity_wrt multreal; theorem multreal is_distributive_wrt addreal; theorem sqrreal is_distributive_wrt multreal; definition let x be real number; func x multreal -> UnOp of REAL equals multreal[;](x,id REAL); end; theorem (r multreal).r1 = r*r1; theorem r multreal is_distributive_wrt addreal; theorem compreal is_an_inverseOp_wrt addreal; theorem addreal is having_an_inverseOp; theorem the_inverseOp_wrt addreal = compreal; theorem compreal is_distributive_wrt addreal; definition let F1,F2; redefine func F1 + F2 -> FinSequence of REAL equals addreal.:(F1,F2); commutativity; end; definition let i,R1,R2; redefine func R1 + R2 -> Element of i-tuples_on REAL; end; theorem (R1+R2).s = R1.s + R2.s; theorem <*>REAL + F = <*>REAL; theorem <*r1*> + <*r2*> = <*r1+r2*>; theorem (i|->r1) + (i|->r2) = i|->(r1+r2); theorem F1 + (F2 + F3) = F1 + F2 + F3; theorem R + (i|->(0 qua Real)) = R; theorem (-F).s = -F.s; definition let F; redefine func -F -> FinSequence of REAL equals compreal*F; end; definition let i,R; redefine func -R -> Element of i-tuples_on REAL; end; theorem (-F).s = -(F.s); theorem -(<*>REAL) = <*>REAL; theorem -<*r*> = <*-r*>; theorem -(i|->r) = i|->-r; theorem R + -R = i|->0; theorem R1 + R2 = i|->0 implies R1 = -R2; theorem for R1, R2 being complex-valued Function st -R1 = -R2 holds R1 = R2; theorem R1 + R = R2 + R implies R1 = R2; theorem -(F1 + F2) = -F1 + -F2; definition let F1,F2; redefine func F1 - F2 -> FinSequence of REAL equals diffreal.:(F1,F2); end; definition let i,R1,R2; redefine func R1 - R2 -> Element of i-tuples_on REAL; end; theorem (R1-R2).s = R1.s - R2.s; theorem <*>REAL - F = <*>REAL & F - <*>REAL = <*>REAL; theorem <*r1*> - <*r2*> = <*r1-r2*>; theorem (i|->r1) - (i|->r2) = i|->(r1-r2); theorem F1 - F2 = F1 + - F2; theorem R - (i|->(0 qua Real)) = R; theorem (i|->(0 qua Real)) - R = -R; theorem F1 - -F2 = F1 + F2; theorem -(F1 - F2) = F2 - F1; theorem -(F1 - F2) = -F1 + F2; theorem R - R = i|->0; theorem R1 - R2 = i|->0 implies R1 = R2; theorem F1 - F2 - F3 = F1 - (F2 + F3); theorem F1 + (F2 - F3) = F1 + F2 - F3; theorem F1 - (F2 - F3) = F1 - F2 + F3; theorem R1 = R1 + R - R; theorem R1 = R1 - R + R; notation let F,r; synonym r*F for r(#)F; end; theorem (r*F).s = r*(F.s); definition let F,r; redefine func r*F -> FinSequence of REAL equals (r multreal)*F; end; definition let i,R,r; redefine func r*R -> Element of i-tuples_on REAL; end; theorem (r*F).s = r*(F.s); theorem r*(<*>REAL) = <*>REAL; theorem r*<*r1*> = <*r*r1*>; theorem r1*(i|->r2) = i|->(r1*r2); theorem (r1*r2)*F = r1*(r2*F); theorem (r1 + r2)*F = r1*F + r2*F; theorem r*(F1+F2) = r*F1 + r*F2; theorem 1*F = F; theorem 0*R = i|->0; theorem (-1)*F = -F; notation let F; synonym sqr F for F^2; end; definition let F; redefine func sqr F -> FinSequence of REAL equals sqrreal*F; end; definition let i,R; redefine func sqr R -> Element of i-tuples_on REAL; end; theorem sqr <*r*> = <*r^2*>; theorem sqr(i |-> r) = i |-> r^2; theorem sqr -F = sqr F; theorem sqr (r*F) = r^2 * sqr F; notation let F1,F2; synonym mlt(F1,F2) for F1(#)F2; end; definition let F1,F2; redefine func mlt(F1,F2) -> FinSequence of REAL equals multreal.:(F1,F2); commutativity; end; theorem mlt(F1,F2).s = F1.s * F2.s; definition let i,R1,R2; redefine func mlt(R1,R2) -> Element of i-tuples_on REAL; end; theorem mlt(F1,F2).s = F1.s * F2.s; theorem mlt(<*>REAL,F) = <*>REAL; theorem mlt(<*r1*>,<*r2*>) = <*r1*r2*>; theorem mlt(i|->r,R) = r*R; theorem mlt(i|->r1,i|->r2) = i|->(r1*r2); theorem r*mlt(F1,F2) = mlt(r*F1,F2); theorem r*R = mlt(i|->r,R); theorem sqr(F) = mlt(F,F); theorem sqr(F1 + F2) = sqr F1 + 2*mlt(F1,F2) + sqr F2; theorem sqr(F1 - F2) = sqr F1 - 2*mlt(F1,F2) + sqr F2; theorem sqr mlt(F1,F2) = mlt(sqr F1,sqr F2); notation let F be Relation; synonym F is complex-yielding for F is complex-valued; end; registration cluster -> complex-valued for FinSequence of COMPLEX; cluster real-valued complex-valued for FinSequence; end; definition let F be complex-valued FinSequence; func Sum F -> complex number means ex f being FinSequence of COMPLEX st f = F & it = addcomplex $$ f; end; registration let F be real-valued FinSequence; cluster Sum F -> real; end; theorem for F being FinSequence of REAL holds Sum F = addreal $$ F; definition let F be FinSequence of COMPLEX; redefine func Sum F -> Element of COMPLEX equals addcomplex $$ F; end; definition let F be FinSequence of REAL; redefine func Sum F -> Element of REAL equals addreal $$ F; end; theorem Sum(<*> REAL) = 0; theorem Sum <*r*> = r; theorem Sum(F^<*r*>) = Sum F + r; theorem Sum(F1^F2) = Sum F1 + Sum F2; theorem Sum(<*r*>^F) = r + Sum F; theorem Sum<*r1,r2*> = r1 + r2; theorem Sum<*r1,r2,r3*> = r1 + r2 + r3; theorem for R being Element of 0-tuples_on REAL holds Sum R = 0; theorem Sum(i |-> r) = i*r; theorem Sum(i |-> (0 qua Real)) = 0; theorem (for j st j in Seg i holds R1.j <= R2.j) implies Sum R1 <= Sum R2; theorem (for j st j in Seg i holds R1.j <= R2.j) & (ex j st j in Seg i & R1.j < R2.j) implies Sum R1 < Sum R2; theorem (for i st i in dom F holds 0 <= F.i) implies 0 <= Sum F; theorem (for i st i in dom F holds 0 <= F.i) & (ex i st i in dom F & 0 < F.i) implies 0 < Sum F; theorem 0 <= Sum sqr F; theorem Sum(r*F) = r*(Sum F); theorem Sum -F = -(Sum F); theorem Sum(R1 + R2) = Sum R1 + Sum R2; theorem Sum(R1 - R2) = Sum R1 - Sum R2; theorem Sum sqr R = 0 implies R = i |-> 0; theorem (Sum mlt(R1,R2))^2 <= (Sum sqr R1)*(Sum sqr R2); definition let F be complex-valued FinSequence; func Product F -> complex number means ex f being FinSequence of COMPLEX st f = F & it = multcomplex $$ f; end; registration let F be real-valued FinSequence; cluster Product F -> real; end; theorem for F being FinSequence of REAL holds Product F = multreal $$ F; definition let F be FinSequence of COMPLEX; redefine func Product F -> Element of COMPLEX equals multcomplex $$ F; end; definition let F be FinSequence of REAL; redefine func Product F -> Element of REAL equals multreal $$ F; end; theorem Product <*>REAL = 1; registration let r be complex number; cluster <*r*> -> complex-valued; end; registration let r1, r2 be complex number; cluster <*r1, r2*> -> complex-valued; end; registration let r1, r2, r3 be complex number; cluster <*r1, r2, r3*> -> complex-valued; end; theorem for r being complex number holds Product <*r*> = r; registration let f, g be complex-valued FinSequence; cluster f ^ g -> complex-valued; end; theorem for F being complex-valued FinSequence, r being complex number holds Product (F^<*r*>) = Product F * r; theorem for F1, F2 being complex-valued FinSequence holds Product (F1^F2) = Product F1 * Product F2; theorem Product (<*r*>^F) = r * Product F; theorem for r1, r2 being complex number holds Product <*r1,r2*> = r1 * r2; theorem for r1, r2, r3 being complex number holds Product <*r1,r2,r3*> = r1 * r2 * r3 ; theorem for R being Element of 0-tuples_on REAL holds Product R = 1; theorem Product (i|->1) = 1; theorem for F being complex-valued FinSequence holds (ex k st k in dom F & F.k = 0) iff Product F = 0; theorem Product ((i+j) |->r ) = (Product (i|->r))*(Product (j|->r)); theorem Product ((i*j) |->r) = Product (j |-> (Product (i|->r))); theorem Product (i|->(r1*r2)) = (Product (i|->r1))*(Product (i|->r2)); theorem Product mlt(R1,R2) = Product R1 * Product R2; theorem Product (r*R) = Product (i|->r) * Product R; theorem Product sqr R = (Product R)^2; begin reserve z,z1,z2 for Element of COMPLEX; theorem for F being FinSequence of COMPLEX holds Product F = multcomplex $$ F; theorem Product ((i+j) |->z) = (Product (i|->z))*(Product (j|->z)); theorem Product ((i*j) |->z) = Product (j |-> (Product (i|->z))); theorem Product (i|->(z1*z2)) = (Product (i|->z1))*(Product (i|->z2)); begin reserve n for Nat, x, y, a for real number, p, p1, p2, p3, q, q1, q2 for Element of n-tuples_on REAL; theorem for x being real-valued FinSequence holds len (-x)=len x; theorem for x1,x2 being real-valued FinSequence st len x1=len x2 holds len (x1+x2)=len x1; theorem for x1,x2 being real-valued FinSequence st len x1=len x2 holds len (x1-x2)=len x1; theorem for a being real number, x being real-valued FinSequence holds len (a*x)=len x; theorem for x,y,z being real-valued FinSequence st len x=len y & len y=len z holds mlt(x+y,z) = mlt(x,z)+mlt(y,z); begin definition let x1,x2 be real-valued FinSequence; func |( x1,x2 )| -> real number equals Sum mlt(x1,x2); commutativity; end; definition let x1,x2 be real-valued FinSequence; redefine func |( x1,x2 )| -> Element of REAL; commutativity; end; theorem for x being real-valued FinSequence holds |(x,x)| >= 0; theorem for x,y,z being real-valued FinSequence st len x=len y & len y=len z holds |((x+y),z)| = |(x,z)| + |(y,z)|; theorem for x,y being real-valued FinSequence,a being real number st len x= len y holds |(a*x,y)| = a*|(x,y)|; theorem for x1,x2 being real-valued FinSequence st len x1=len x2 holds |(-x1, x2)| = -|(x1, x2)|; theorem for x1,x2 being real-valued FinSequence st len x1=len x2 holds |(-x1, -x2)| = |(x1, x2)|; theorem for x1,x2,x3 being real-valued FinSequence st len x1=len x2 & len x2 =len x3 holds |(x1-x2, x3)| = |(x1, x3)| - |(x2, x3)|; theorem for x,y being real number,x1,x2,x3 being real-valued FinSequence st len x1 =len x2 & len x2=len x3 holds |((x*x1+y*x2), x3)| = x*|(x1,x3)| + y*|(x2,x3)| ; theorem for x1,x2,y1,y2 being real-valued FinSequence st len x1=len x2 & len x2=len y1 & len y1=len y2 holds |(x1+x2, y1+y2)| = |(x1, y1)| + |(x1, y2)| + |( x2, y1)| + |(x2, y2)|; theorem for x1,x2,y1,y2 being real-valued FinSequence st len x1=len x2 & len x2=len y1 & len y1=len y2 holds |(x1-x2, y1-y2)| = |(x1, y1)| - |(x1, y2)| - |( x2, y1)| + |(x2, y2)|; theorem for x,y being real-valued FinSequence st len x=len y holds |(x+y, x+ y)| = |(x, x)| + 2*|(x, y)| + |(y, y)|; theorem for x,y being real-valued FinSequence st len x=len y holds |(x-y, x- y)| = |(x, x)| - 2*|(x, y)| + |(y, y)|; theorem |(p1 + p2, p3)| = |(p1, p3)| + |(p2, p3)|; theorem for x being real number holds |(x*p1, p2)| = x*|(p1, p2)|; theorem |(-p1, p2)| = -|(p1, p2)|; theorem |(-p1, -p2)| = |(p1, p2)|; theorem |(p1-p2, p3)| = |(p1, p3)| - |(p2, p3)|; theorem |((x*p1+y*p2), p3)| = x*|(p1,p3)| + y*|(p2,p3)|; theorem |(p1+p2, q1+q2)| = |(p1, q1)| + |(p1, q2)| + |(p2, q1)| + |(p2, q2)|; theorem |(p1-p2, q1-q2)| = |(p1, q1)| - |(p1, q2)| - |(p2, q1)| + |(p2, q2)|; theorem |(p+q, p+q)| = |(p, p)| + 2*|(p, q)| + |(q, q)|; theorem |(p-q, p-q)| = |(p, p)| - 2*|(p, q)| + |(q, q)|; theorem |(p,q)| <= |(p,p)| + |(q,q)|; definition let p, q be real-valued FinSequence; pred p,q are_orthogonal means |(p,q)| = 0; symmetry; end; theorem p, q are_orthogonal implies a*p,q are_orthogonal; theorem Sum<*r1,r2,r3,r4*> = r1 + r2 + r3 + r4; reserve f,g for FinSequence of REAL; theorem len f = len sqr f & dom f = dom sqr f; theorem sqr (f^g) = sqr f ^ sqr g; theorem for F being real-valued FinSequence holds F is FinSequence of REAL; begin reserve i,j,k,n,m,l,s,t,r for Nat; reserve a,b for real number; reserve F,G,H for FinSequence of REAL; theorem n>=1 implies Seg n = {1} \/ {k where k is Element of NAT: 1 x -> complex-yielding; end; definition let x be complex number, n be Nat; func x |^ n equals Product (n |-> x); end; registration let x be real number, n be Nat; cluster x |^ n -> real; end; definition let x be Real, n be Nat; redefine func x |^ n -> Real; end; reserve z for complex number; registration let z be complex number, n be Nat; cluster z|^n -> complex; end; theorem z|^0 = 1; theorem z|^1 = z; theorem z|^(s+1) = z|^s * z; registration let x, n be Nat; cluster x|^n -> natural; end; reserve x,y for complex number; theorem (x*y) |^ s = x|^s * y|^s; theorem x|^(s+t) = x|^s * x|^t; theorem (x|^s) |^ t = x|^(s*t); theorem 1|^s = 1; theorem s >= 1 implies 0|^s = 0; registration let n be Nat; cluster idseq n -> natural-valued; end; definition let n be Nat; func n! -> Element of REAL equals Product idseq n; end; registration let n be Nat; cluster n! -> real; end; theorem 0! = 1; theorem 1! = 1; theorem 2! = 2; theorem (s+1)! = (s!) * (s+1); theorem s! is Element of NAT; registration let n; cluster n! -> natural; end; theorem s! > 0; registration let n; cluster n! -> positive; end; theorem (s!) * (t!) <> 0; definition let k,n be Nat; func n choose k means for l be Nat st l = n-k holds it = (n!)/((k!) * (l!)) if n >= k otherwise it = 0; end; registration let k,n be Nat; cluster n choose k -> real; end; definition let k,n be Nat; redefine func n choose k -> Real; end; theorem s choose 0 = 1; theorem s >= t & r = s-t implies s choose t = s choose r; theorem s choose s = 1; theorem (t+1) choose (s+1) = (t choose (s+1)) + (t choose s); theorem s >= 1 implies s choose 1 = s; theorem s>=1 & t = s-1 implies s choose t = s; theorem s choose r is Element of NAT; theorem for m,F st m <> 0 & len F = m & (for i,l st i in dom F & l = n+i-1 holds F.i = l choose n) holds Sum F = (n+m) choose (n+1); registration let k,n be Nat; cluster n choose k -> natural; end; definition let k,n be Nat; redefine func n choose k -> Element of NAT; end; definition let a,b be real number; let n be Nat; func (a,b) In_Power n -> FinSequence of REAL means len it = n+1 & for i,l,m being Nat st i in dom it & m = i - 1 & l = n-m holds it.i = (n choose m) * a|^l * b|^m; end; theorem (a,b) In_Power 0 = <*1*>; theorem ((a,b) In_Power s).1 = a|^s; theorem ((a,b) In_Power s).(s+1) = b|^s; theorem (a+b) |^ s = Sum((a,b) In_Power s); definition let n be Nat; func Newton_Coeff n -> FinSequence of REAL means len it = n+1 & for i,k be Nat st i in dom it & k = i-1 holds it.i = n choose k; end; theorem Newton_Coeff s = (1,1) In_Power s; theorem 2|^s = Sum(Newton_Coeff s); begin theorem l >= 1 implies k*l >= k; theorem l >= 1 & n >= k*l implies n >= k; definition let n; redefine func n! -> Element of NAT; end; theorem l <> 0 implies l divides l!; theorem n <> 0 implies (n+1)/n > 1; theorem k/(k+1) < 1; theorem l! >= l; theorem m<>1 & m divides n implies not m divides (n+1); theorem j<>0 implies j divides (j+k)!; theorem j<=l & j<>0 implies j divides l!; theorem j<>1 & j<>0 & j divides (l!+1) implies j>l; theorem m lcm (n lcm k) = (m lcm n) lcm k; theorem m divides n iff m lcm n = n; theorem n divides m & k divides m iff n lcm k divides m; theorem m lcm 1 = m; theorem m lcm n divides m*n; theorem m gcd (n gcd k) = (m gcd n) gcd k; theorem n divides m implies n gcd m = n; theorem m divides n & m divides k iff m divides n gcd k; theorem m gcd 1 = 1; theorem m gcd 0 = m; theorem (m gcd n) lcm n = n; theorem m gcd (m lcm n) = m; theorem m gcd (m lcm n) = (n gcd m) lcm m; theorem m divides n implies m gcd k divides n gcd k; theorem m divides n implies k gcd m divides k gcd n; theorem n > 0 implies n gcd m > 0; theorem m > 0 & n > 0 implies m lcm n > 0; theorem (n gcd m) lcm (n gcd k) divides n gcd (m lcm k); theorem m divides l implies m lcm (n gcd l) divides (m lcm n) gcd l; theorem n gcd m divides n lcm m; reserve p,q for Nat; reserve i0,i,i1,i2,i4 for Integer; theorem 0 < m implies n mod m = n - m * (n div m); theorem i2 >= 0 implies i1 mod i2 >= 0; theorem i2 > 0 implies i1 mod i2 < i2; theorem i2 <> 0 implies i1 = (i1 div i2) * i2 + (i1 mod i2); theorem m>0 or n>0 implies ex i,i1 st i*m + i1*n = m gcd n; definition func SetPrimes -> Subset of NAT means for n being Nat holds n in it iff n is prime; end; registration cluster prime for Element of NAT; cluster prime for Nat; end; definition mode Prime is prime Nat; end; reserve x for set; definition let p be Nat; func SetPrimenumber p -> Subset of NAT means for q being Nat holds q in it iff q < p & q is prime; end; theorem SetPrimenumber p c= SetPrimes; theorem p <= q implies SetPrimenumber p c= SetPrimenumber q; theorem SetPrimenumber p c= Seg p; theorem SetPrimenumber p is finite; registration let n be Nat; cluster SetPrimenumber n -> finite; end; reserve p for Prime; theorem ex p st p is prime & p>l; registration cluster SetPrimes -> non empty; end; registration cluster SetPrimenumber 2 -> empty; end; theorem SetPrimenumber m c= Seg m; theorem k>=m implies not k in SetPrimenumber m; theorem SetPrimenumber n \/ {n} is finite; theorem for f being Prime, g being Nat st f < g holds SetPrimenumber f \/ {f} c= SetPrimenumber g; theorem k>=m implies not k in SetPrimenumber m; definition let n be Nat; func primenumber n -> prime Element of NAT means n = card SetPrimenumber it; end; theorem SetPrimenumber n = {k where k is Element of NAT: k non empty infinite; end; reserve i for Nat; theorem i is prime implies for m,n being Nat holds i divides m * n implies i divides m or i divides n; theorem for x being complex number holds x |^ 2 = x * x & x^2 = x |^ 2; theorem m qua Integer div n = m div n & m qua Integer mod n = m mod n; reserve x for real number; theorem x > 0 implies x|^k > 0; theorem n > 0 implies 0 |^ n = 0; definition let m,n be Element of NAT; redefine func m|^n -> Element of NAT; end; theorem 2|^n >= n + 1; theorem 2|^n > n; reserve k for Element of NAT; scheme Euklides9 { F(Nat) -> Element of NAT, G(Nat) -> Element of NAT, a() -> Element of NAT, b() -> Element of NAT } : ex k st F(k) = a() gcd b() & G(k) = 0 provided 0 < b() and b() < a() and F(0) = a() and G(0) = b() and for k st G(k) > 0 holds F(k+1) = G(k) & G(k+1) = F(k) mod G(k); reserve k,n,n1,n2,m1,m2 for Nat; theorem r <> 0 or n = 0 iff r|^n <> 0; theorem (2|^n1)*(2*m1+1) = (2|^n2)*(2*m2+1) implies n1 = n2 & m1 = m2; theorem k <= n implies m |^ k divides m |^ n; begin reserve X,Y,Z,x,y,y1,y2 for set, D for non empty set, k,n,n1,n2,m2,m1 for Nat, L,K,M,N for Cardinal, f,g for Function; theorem X is finite implies X is countable; theorem omega is countable; reserve r for Real; theorem r <> 0 or n = 0 iff r|^n <> 0; theorem (2|^n1)*(2*m1+1) = (2|^n2)*(2*m2+1) implies n1 = n2 & m1 = m2; theorem [:NAT,NAT:],NAT are_equipotent & card NAT = card [:NAT,NAT:]; theorem (omega)*`(omega) = omega; theorem X is countable & Y is countable implies [:X,Y:] is countable; theorem 1-tuples_on D,D are_equipotent & card (1-tuples_on D) = card D; reserve p,q for FinSequence, k,m,n,n1,n2,n3 for Element of NAT; theorem [:n-tuples_on D, m-tuples_on D:],(n+m)-tuples_on D are_equipotent & card [:n-tuples_on D, m-tuples_on D:] = card ((n+m)-tuples_on D); theorem D is countable implies n-tuples_on D is countable; theorem for f st dom f is countable & for x st x in dom f holds f.x is countable holds Union f is countable; theorem (X is countable & for Y st Y in X holds Y is countable) implies union X is countable; theorem D is countable implies D* is countable; theorem omega c= card (D*); scheme FraenCoun1 { f(set)->set, P[set] } : { f(n) : P[n] } is countable; scheme FraenCoun2 { f(set,set)->set, P[set,set] } : { f(n1,n2) : P[n1,n2] } is countable; scheme FraenCoun3 { f(set,set,set)->set, P[set,set,set] } : { f(n1,n2,n3) : P[n1,n2 ,n3] } is countable; reserve f,f1,f2 for Function, X1,X2 for set; theorem not M is finite implies M*`M = M; theorem not M is finite & 0 in N & (N c= M or N in M) implies M*`N = M & N*`M = M; theorem not M is finite & (N c= M or N in M) implies M*`N c= M & N*`M c= M; theorem not X is finite implies [:X,X:],X are_equipotent & card [:X,X:] = card X; theorem not X is finite & Y is finite & Y <> {} implies [:X,Y:],X are_equipotent & card [:X,Y:] = card X; theorem K in L & M in N implies K*`M in L*`N & M*`K in L*`N; theorem not X is finite implies card X = (omega)*`card X; theorem X <> {} & X is finite & not Y is finite implies card Y *` card X = card Y; theorem not D is finite & n <> 0 implies n-tuples_on D,D are_equipotent & card (n-tuples_on D) = card D; theorem not D is finite implies card D = card (D*); begin reserve k,n,m for Element of NAT, A,B,C for Ordinal, X for set, x,y,z for set; begin reserve f,g,h,fx for Function, K,M,N for Cardinal, phi,psi for Ordinal-Sequence; theorem nextcard card X = nextcard X; theorem y in Union f iff ex x st x in dom f & y in f.x; theorem alef A is infinite; theorem M is infinite implies ex A st M = alef A; registration let phi; cluster Union phi -> ordinal; end; theorem X c= A implies ex phi st phi = canonical_isomorphism_of(RelIncl order_type_of RelIncl X, RelIncl X) & phi is increasing & dom phi = order_type_of RelIncl X & rng phi = X; theorem X c= A implies sup X is_cofinal_with order_type_of RelIncl X; theorem X c= A implies card X = card order_type_of RelIncl X; theorem ex B st B c= card A & A is_cofinal_with B; theorem ex M st M c= card A & A is_cofinal_with M & for B st A is_cofinal_with B holds M c= B; theorem rng phi = rng psi & phi is increasing & psi is increasing implies phi = psi; theorem phi is increasing implies phi is one-to-one; theorem (phi^psi)|(dom phi) = phi; theorem X <> {} implies card { Y where Y is Subset of X: card Y in M } c= M*` exp(card X,M); theorem M in exp(2,M); registration cluster infinite for Cardinal; end; registration cluster infinite -> non empty for set; end; definition mode Aleph is infinite Cardinal; let M; func cf M -> Cardinal means M is_cofinal_with it & for N st M is_cofinal_with N holds it c= N; let N; func N-powerfunc_of M -> Cardinal-Function means (for x holds x in dom it iff x in M & x is Cardinal) & for K st K in M holds it.K = exp(K,N); end; registration let A; cluster alef A -> infinite; end; begin reserve a,b for Aleph; theorem ex A st a = alef A; theorem a <> 0 & a <> 1 & a <> 2 & a <> card n & card n in a & omega c= a; theorem a c= M or a in M implies M is Aleph; theorem a c= M or a in M implies a +` M = M & M +` a = M & a *` M = M & M *` a = M; theorem a +` a = a & a *` a = a; theorem M c= exp(M,a); theorem union a = a; registration let a,M; cluster a +` M -> infinite; end; registration let M,a; cluster M +` a -> infinite; end; registration let a,b; cluster a *` b -> infinite; cluster exp(a,b) -> infinite; end; begin definition let IT be Aleph; attr IT is regular means cf IT = IT; end; notation let IT be Aleph; antonym IT is irregular for IT is regular; end; registration let a; cluster nextcard a -> infinite; end; theorem cf omega = omega; theorem cf nextcard a = nextcard a; theorem omega c= cf a; theorem cf 0 = 0 & cf card (n+1) = 1; theorem X c= M & card X in cf M implies sup X in M & union X in M; theorem dom phi = M & rng phi c= N & M in cf N implies sup phi in N & Union phi in N; registration let a; cluster cf a -> infinite; end; theorem cf a in a implies a is limit_cardinal; theorem cf a in a implies ex xi being Ordinal-Sequence st dom xi = cf a & rng xi c= a & xi is increasing & a = sup xi & xi is Cardinal-Function & not 0 in rng xi; theorem omega is regular & nextcard a is regular; begin reserve a,b for Aleph; theorem a c= b implies exp(a,b) = exp(2,b); theorem exp(nextcard a,b) = exp(a,b) *` nextcard a; theorem Sum (b-powerfunc_of a) c= exp(a,b); theorem a is limit_cardinal & b in cf a implies exp(a,b) = Sum (b-powerfunc_of a); theorem cf a c= b & b in a implies exp(a,b) = exp(Sum (b-powerfunc_of a), cf a ); reserve O for Ordinal, F for Subset of omega; theorem for X being finite set st X c= O holds order_type_of RelIncl X = card X; theorem {x} c= O implies order_type_of RelIncl {x} = 1; theorem {x} c= O implies canonical_isomorphism_of (RelIncl order_type_of RelIncl {x}, RelIncl {x}) = 0 .--> x; registration let O be Ordinal, X be Subset of O, n be set; cluster canonical_isomorphism_of (RelIncl order_type_of RelIncl X,RelIncl X) .n -> ordinal; end; registration let X be natural-membered set, n be set; cluster canonical_isomorphism_of (RelIncl order_type_of RelIncl X,RelIncl X).n -> natural; end; theorem card F c= order_type_of RelIncl F; begin reserve x,y,z,a,b,c,X,X1,X2,Y,Z for set, W,W1,W2 for Tree, w,w9 for Element of W, f for Function, D,D9 for non empty set, i,k,k1,k2,l,m,n for Element of NAT, v,v1,v2 for FinSequence, p,q,r,r1,r2 for FinSequence of NAT; theorem for v1,v2,v st v1 is_a_prefix_of v & v2 is_a_prefix_of v holds v1,v2 are_c=-comparable; theorem for v1,v2,v st v1 is_a_proper_prefix_of v & v2 is_a_prefix_of v holds v1,v2 are_c=-comparable; theorem len v1 = k+1 implies ex v2,x st v1 = v2^<*x*> & len v2 = k; theorem ProperPrefixes (v^<*x*>) = ProperPrefixes v \/ {v}; scheme TreeStructInd { T()->Tree, P[set] }: for t being Element of T() holds P[t] provided P[{}] and for t being Element of T(), n st P[t] & t^<*n*> in T() holds P[t^<*n*>]; theorem (for p holds p in W1 iff p in W2) implies W1 = W2; definition let W1,W2; redefine pred W1 = W2 means for p holds p in W1 iff p in W2; end; theorem p in W implies W = W with-replacement (p,W|p); theorem p in W & q in W & not p is_a_prefix_of q implies q in W with-replacement (p,W1); theorem p in W & q in W & not p,q are_c=-comparable implies (W with-replacement (p,W1)) with-replacement (q,W2) = (W with-replacement (q,W2)) with-replacement (p,W1); definition let IT be Tree; attr IT is finite-order means ex n st for t being Element of IT holds not t^<*n*> in IT; end; registration cluster finite-order for Tree; end; definition let W; mode Chain of W -> Subset of W means for p,q st p in it & q in it holds p,q are_c=-comparable; mode Level of W -> Subset of W means ex n being Nat st it = { w: len w = n}; let w; func succ w -> Subset of W equals { w^<*n*>: w^<*n*> in W }; end; theorem for L being Level of W holds L is AntiChain_of_Prefixes of W; theorem succ w is AntiChain_of_Prefixes of W; theorem for A being AntiChain_of_Prefixes of W, C being Chain of W ex w st A /\ C c= {w}; definition let W; let n be Nat; func W-level n -> Level of W equals { w: len w = n }; end; theorem w^<*n*> in succ w iff w^<*n*> in W; theorem w = {} implies W-level 1 = succ w; theorem W = union { W-level n: not contradiction }; theorem for W being finite Tree holds W = union { W-level n: n <= height W }; theorem for L being Level of W ex n st L = W-level n; scheme FraenkelCard { A() ->non empty set, X() -> set, F(set) -> set }: card { F(w) where w is Element of A(): w in X() } c= card X(); scheme FraenkelFinCard { A() ->non empty set, X,Y() -> finite set, F(set) -> set }: card Y() <= card X() provided Y() = { F(w) where w is Element of A(): w in X() }; theorem W is finite-order implies ex n st for w holds ex B being finite set st B = succ w & card B <= n; theorem W is finite-order implies succ w is finite; registration let W be finite-order Tree; let w be Element of W; cluster succ w -> finite; end; theorem {} is Chain of W; theorem {{}} is Chain of W; registration let W; cluster non empty for Chain of W; end; definition let W; let IT be Chain of W; attr IT is Branch-like means (for p st p in IT holds ProperPrefixes p c= IT) & not ex p st p in W & for q st q in IT holds q is_a_proper_prefix_of p; end; registration let W; cluster Branch-like for Chain of W; end; definition let W; mode Branch of W is Branch-like Chain of W; end; registration let W; cluster Branch-like -> non empty for Chain of W; end; reserve C for Chain of W, B for Branch of W; theorem v1 in C & v2 in C implies v1 in ProperPrefixes v2 or v2 is_a_prefix_of v1; theorem v1 in C & v2 in C & v is_a_prefix_of v2 implies v1 in ProperPrefixes v or v is_a_prefix_of v1; registration let W; cluster finite for Chain of W; end; theorem for C being finite Chain of W st card C > n ex p st p in C & len p >= n; theorem for C holds { w: ex p st p in C & w is_a_prefix_of p } is Chain of W; theorem p is_a_prefix_of q & q in B implies p in B; theorem {} in B; theorem p in C & q in C & len p <= len q implies p is_a_prefix_of q; theorem ex B st C c= B; scheme FuncExOfMinNat { P[set,Nat], X()->set }: ex f st dom f = X() & for x st x in X() ex n st f.x = n & P[x,n] & for m st P[x,m] holds n <= m provided for x st x in X() ex n st P[x,n]; scheme InfiniteChain { X()->set, a()->set, Q[set], P[set,set] }: ex f st dom f = NAT & rng f c= X() & f.0 = a() & for k holds P[f.k,f.(k+1)] & Q[f.k] provided a() in X() & Q[a()] and for x st x in X() & Q[x] ex y st y in X() & P[x,y] & Q[y]; theorem for T being Tree st (for n ex C being finite Chain of T st card C = n) & for t being Element of T holds succ t is finite ex B being Chain of T st not B is finite; theorem for T being finite-order Tree st for n ex C being finite Chain of T st card C = n ex B being Chain of T st not B is finite; definition let IT be Relation; attr IT is DecoratedTree-like means dom IT is Tree; end; registration cluster DecoratedTree-like for Function; end; definition mode DecoratedTree is DecoratedTree-like Function; end; reserve T,T1,T2 for DecoratedTree; registration let T; cluster dom T -> non empty Tree-like; end; registration let D; cluster DecoratedTree-like D-valued for Function; end; definition let D; mode DecoratedTree of D is D-valued DecoratedTree; end; definition let D be non empty set, T be DecoratedTree of D, t be Element of dom T; redefine func T.t -> Element of D; end; theorem dom T1 = dom T2 & (for p st p in dom T1 holds T1.p = T2.p) implies T1 = T2; scheme DTreeEx { T() -> Tree, P[set,set] }: ex T st dom T = T() & for p st p in T() holds P[p,T.p] provided for p st p in T() ex x st P[p,x]; scheme DTreeLambda { T() -> Tree, f(set) -> set }: ex T st dom T = T() & for p st p in T() holds T.p = f(p); definition let T; func Leaves T -> set equals T.:Leaves dom T; let p; func T|p -> DecoratedTree means dom it = (dom T)|p & for q st q in (dom T)|p holds it.q = T.(p^q); end; theorem p in dom T implies rng (T|p) c= rng T; definition let D; let T be DecoratedTree of D; redefine func Leaves T -> Subset of D; end; registration let D; let T be DecoratedTree of D; let p be Element of dom T; cluster T|p -> D-valued; end; definition let T,p,T1; assume p in dom T; func T with-replacement (p,T1) -> DecoratedTree means dom it = dom T with-replacement (p,dom T1) & for q st q in dom T with-replacement (p,dom T1) holds not p is_a_prefix_of q & it.q = T.q or ex r st r in dom T1 & q = p^r & it.q = T1.r; end; registration let W,x; cluster W --> x -> DecoratedTree-like; end; theorem (for x st x in D holds x is Tree) implies union D is Tree; theorem (for x st x in X holds x is Function) & X is c=-linear implies union X is Relation-like Function-like; theorem (for x st x in D holds x is DecoratedTree) & D is c=-linear implies union D is DecoratedTree; theorem (for x st x in D9 holds x is DecoratedTree of D) & D9 is c=-linear implies union D9 is DecoratedTree of D; scheme DTreeStructEx { D() -> non empty set, d() -> Element of D(), F(set) -> set, S() -> Function of [:D(),NAT:],D()}: ex T being DecoratedTree of D() st T.{} = d() & for t being Element of dom T holds succ t = { t^<*k*>: k in F(T.t)} & for n st n in F(T.t) holds T.(t^<*n*>) = S().(T.t,n) provided for d being Element of D(), k1,k2 st k1 <= k2 & k2 in F(d) holds k1 in F(d); scheme DTreeStructFinEx { D() -> non empty set, d() -> Element of D(), F(set) -> Element of NAT, S() -> Function of [:D(),NAT:],D()}: ex T being DecoratedTree of D() st T.{} = d() & for t being Element of dom T holds succ t = { t^<*k*>: k < F(T.t)} & for n st n < F(T.t) holds T.(t^<*n*>) = S().(T.t,n); begin registration let Tr be finite Tree, v be Element of Tr; cluster succ v -> finite; end; definition let Tr be finite Tree, v be Element of Tr; func branchdeg v equals card succ v; end; registration cluster finite for DecoratedTree; end; registration let D be non empty set; cluster finite for DecoratedTree of D; end; registration let a,b be non empty set; cluster non empty for Relation of a,b; end; reserve x1,x2 for set, w for FinSequence of NAT; theorem for Z1,Z2 being Tree,p being FinSequence of NAT st p in Z1 holds for v being Element of Z1 with-replacement (p,Z2),w being Element of Z2 st v = p^w holds succ v,succ w are_equipotent; scheme DTreeStructEx { D() -> non empty set, d() -> Element of D(), Q[set,set], S() -> Function of [:D(),NAT:],D()}: ex T being DecoratedTree of D() st T.{} = d() & for t being Element of dom T holds succ t = { t^<*k*>: Q[k,T.t]} & for n st Q[n,T.t] holds T.(t^<*n*>) = S().(T.t,n) provided for d being Element of D(), k1,k2 st k1 <= k2 & Q[k2,d] holds Q[k1,d]; theorem for T1, T2 being Tree st for n being Element of NAT holds T1-level n = T2-level n holds T1 = T2; theorem for n being Element of NAT holds TrivialInfiniteTree-level n = { n |-> 0 }; theorem for X,Y being set for B being c=-linear Subset of PFuncs(X,Y) holds union B in PFuncs(X,Y); begin reserve x, X, X1, X2 for set; definition let Y be functional set; func DOMS(Y) equals union {dom f where f is Element of Y: not contradiction}; end; definition let X; attr X is complex-functions-membered means x in X implies x is complex-valued Function; end; definition let X; attr X is ext-real-functions-membered means x in X implies x is ext-real-valued Function; end; definition let X; attr X is real-functions-membered means x in X implies x is real-valued Function; end; definition let X; attr X is rational-functions-membered means x in X implies x is RAT-valued Function; end; definition let X; attr X is integer-functions-membered means x in X implies x is INT-valued Function; end; definition let X; attr X is natural-functions-membered means x in X implies x is natural-valued Function; end; registration cluster natural-functions-membered -> integer-functions-membered for set; cluster integer-functions-membered -> rational-functions-membered for set; cluster rational-functions-membered -> real-functions-membered for set; cluster real-functions-membered -> complex-functions-membered for set; cluster real-functions-membered -> ext-real-functions-membered for set; end; registration cluster empty -> natural-functions-membered for set; end; registration let f be complex-valued Function; cluster {f} -> complex-functions-membered; end; registration cluster complex-functions-membered -> functional for set; cluster ext-real-functions-membered -> functional for set; end; registration cluster natural-functions-membered non empty for set; end; registration let X be complex-functions-membered set; cluster -> complex-functions-membered for Subset of X; end; registration let X be ext-real-functions-membered set; cluster -> ext-real-functions-membered for Subset of X; end; registration let X be real-functions-membered set; cluster -> real-functions-membered for Subset of X; end; registration let X be rational-functions-membered set; cluster -> rational-functions-membered for Subset of X; end; registration let X be integer-functions-membered set; cluster -> integer-functions-membered for Subset of X; end; registration let X be natural-functions-membered set; cluster -> natural-functions-membered for Subset of X; end; definition let D be set; func C_PFuncs(D) -> set means for f being set holds f in it iff f is PartFunc of D,COMPLEX; end; definition let D be set; func C_Funcs(D) -> set means for f being set holds f in it iff f is Function of D,COMPLEX; end; definition let D be set; func E_PFuncs(D) -> set means for f being set holds f in it iff f is PartFunc of D,ExtREAL; end; definition let D be set; func E_Funcs(D) -> set means for f being set holds f in it iff f is Function of D,ExtREAL; end; definition let D be set; func R_PFuncs(D) -> set means for f being set holds f in it iff f is PartFunc of D,REAL; end; definition let D be set; func R_Funcs(D) -> set means for f being set holds f in it iff f is Function of D,REAL; end; definition let D be set; func Q_PFuncs(D) -> set means for f being set holds f in it iff f is PartFunc of D,RAT; end; definition let D be set; func Q_Funcs(D) -> set means for f being set holds f in it iff f is Function of D,RAT; end; definition let D be set; func I_PFuncs(D) -> set means for f being set holds f in it iff f is PartFunc of D,INT; end; definition let D be set; func I_Funcs(D) -> set means for f being set holds f in it iff f is Function of D,INT; end; definition let D be set; func N_PFuncs(D) -> set means for f being set holds f in it iff f is PartFunc of D,NAT; end; definition let D be set; func N_Funcs(D) -> set means for f being set holds f in it iff f is Function of D,NAT; end; theorem C_Funcs(X) is Subset of C_PFuncs(X); theorem E_Funcs(X) is Subset of E_PFuncs(X); theorem R_Funcs(X) is Subset of R_PFuncs(X); theorem Q_Funcs(X) is Subset of Q_PFuncs(X); theorem I_Funcs(X) is Subset of I_PFuncs(X); theorem N_Funcs(X) is Subset of N_PFuncs(X); registration let X; cluster C_PFuncs(X) -> complex-functions-membered; cluster C_Funcs(X) -> complex-functions-membered; cluster E_PFuncs(X) -> ext-real-functions-membered; cluster E_Funcs(X) -> ext-real-functions-membered; cluster R_PFuncs(X) -> real-functions-membered; cluster R_Funcs(X) -> real-functions-membered; cluster Q_PFuncs(X) -> rational-functions-membered; cluster Q_Funcs(X) -> rational-functions-membered; cluster I_PFuncs(X) -> integer-functions-membered; cluster I_Funcs(X) -> integer-functions-membered; cluster N_PFuncs(X) -> natural-functions-membered; cluster N_Funcs(X) -> natural-functions-membered; end; registration let X be complex-functions-membered set; cluster -> complex-valued for Element of X; end; registration let X be ext-real-functions-membered set; cluster -> ext-real-valued for Element of X; end; registration let X be real-functions-membered set; cluster -> real-valued for Element of X; end; registration let X be rational-functions-membered set; cluster -> RAT-valued for Element of X; end; registration let X be integer-functions-membered set; cluster -> INT-valued for Element of X; end; registration let X be natural-functions-membered set; cluster -> natural-valued for Element of X; end; registration let X, x be set; let Y be complex-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> Function-like Relation-like; end; registration let X, x be set; let Y be ext-real-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> Function-like Relation-like; end; registration let X, x; let Y be complex-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> complex-valued; end; registration let X, x; let Y be ext-real-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> ext-real-valued; end; registration let X, x; let Y be real-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> real-valued; end; registration let X, x; let Y be rational-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> RAT-valued; end; registration let X, x; let Y be integer-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> INT-valued; end; registration let X, x; let Y be natural-functions-membered set; let f be PartFunc of X,Y; cluster f.x -> natural-valued; end; registration let X; let Y be complex-membered set; cluster PFuncs(X,Y) -> complex-functions-membered; end; registration let X; let Y be ext-real-membered set; cluster PFuncs(X,Y) -> ext-real-functions-membered; end; registration let X; let Y be real-membered set; cluster PFuncs(X,Y) -> real-functions-membered; end; registration let X; let Y be rational-membered set; cluster PFuncs(X,Y) -> rational-functions-membered; end; registration let X; let Y be integer-membered set; cluster PFuncs(X,Y) -> integer-functions-membered; end; registration let X; let Y be natural-membered set; cluster PFuncs(X,Y) -> natural-functions-membered; end; registration let X; let Y be complex-membered set; cluster Funcs(X,Y) -> complex-functions-membered; end; registration let X; let Y be ext-real-membered set; cluster Funcs(X,Y) -> ext-real-functions-membered; end; registration let X; let Y be real-membered set; cluster Funcs(X,Y) -> real-functions-membered; end; registration let X; let Y be rational-membered set; cluster Funcs(X,Y) -> rational-functions-membered; end; registration let X; let Y be integer-membered set; cluster Funcs(X,Y) -> integer-functions-membered; end; registration let X; let Y be natural-membered set; cluster Funcs(X,Y) -> natural-functions-membered; end; definition let R be Relation; attr R is complex-functions-valued means rng R is complex-functions-membered; attr R is ext-real-functions-valued means rng R is ext-real-functions-membered; attr R is real-functions-valued means rng R is real-functions-membered; attr R is rational-functions-valued means rng R is rational-functions-membered; attr R is integer-functions-valued means rng R is integer-functions-membered; attr R is natural-functions-valued means rng R is natural-functions-membered; end; registration let Y be complex-functions-membered set; cluster -> complex-functions-valued for Y-valued Function; end; definition let f be Function; redefine attr f is complex-functions-valued means for x being set st x in dom f holds f.x is complex-valued Function; redefine attr f is ext-real-functions-valued means for x being set st x in dom f holds f.x is ext-real-valued Function; redefine attr f is real-functions-valued means for x being set st x in dom f holds f.x is real-valued Function; redefine attr f is rational-functions-valued means for x being set st x in dom f holds f.x is RAT-valued Function; redefine attr f is integer-functions-valued means for x being set st x in dom f holds f.x is INT-valued Function; redefine attr f is natural-functions-valued means for x being set st x in dom f holds f.x is natural-valued Function; end; registration cluster natural-functions-valued -> integer-functions-valued for Relation; cluster integer-functions-valued -> rational-functions-valued for Relation; cluster rational-functions-valued -> real-functions-valued for Relation; cluster real-functions-valued -> ext-real-functions-valued for Relation; cluster real-functions-valued -> complex-functions-valued for Relation; end; registration cluster empty -> natural-functions-valued for Relation; end; registration cluster natural-functions-valued for Function; end; registration let R be complex-functions-valued Relation; cluster rng R -> complex-functions-membered; end; registration let R be ext-real-functions-valued Relation; cluster rng R -> ext-real-functions-membered; end; registration let R be real-functions-valued Relation; cluster rng R -> real-functions-membered; end; registration let R be rational-functions-valued Relation; cluster rng R -> rational-functions-membered; end; registration let R be integer-functions-valued Relation; cluster rng R -> integer-functions-membered; end; registration let R be natural-functions-valued Relation; cluster rng R -> natural-functions-membered; end; registration let X; let Y be complex-functions-membered set; cluster -> complex-functions-valued for PartFunc of X,Y; end; registration let X; let Y be ext-real-functions-membered set; cluster -> ext-real-functions-valued for PartFunc of X,Y; end; registration let X; let Y be real-functions-membered set; cluster -> real-functions-valued for PartFunc of X,Y; end; registration let X; let Y be rational-functions-membered set; cluster -> rational-functions-valued for PartFunc of X,Y; end; registration let X; let Y be integer-functions-membered set; cluster -> integer-functions-valued for PartFunc of X,Y; end; registration let X; let Y be natural-functions-membered set; cluster -> natural-functions-valued for PartFunc of X,Y; end; registration let f be complex-functions-valued Function; let x; cluster f.x -> Function-like Relation-like; end; registration let f be ext-real-functions-valued Function; let x; cluster f.x -> Function-like Relation-like; end; registration let f be complex-functions-valued Function; let x; cluster f.x -> complex-valued; end; registration let f be ext-real-functions-valued Function; let x; cluster f.x -> ext-real-valued; end; registration let f be real-functions-valued Function; let x; cluster f.x -> real-valued; end; registration let f be rational-functions-valued Function; let x; cluster f.x -> RAT-valued; end; registration let f be integer-functions-valued Function; let x; cluster f.x -> INT-valued; end; registration let f be natural-functions-valued Function; let x; cluster f.x -> natural-valued; end; begin reserve Y, Y1, Y2 for complex-functions-membered set, c, c1, c2 for complex number, f for PartFunc of X,Y, f1 for PartFunc of X1,Y1, f2 for PartFunc of X2, Y2, g, h, k for complex-valued Function; theorem g <> {} & g + c1 = g + c2 implies c1 = c2; theorem g <> {} & g - c1 = g - c2 implies c1 = c2; theorem g <> {} & g is non-empty & g (#) c1 = g (#) c2 implies c1 = c2; theorem - (g + c) = -g - c; theorem - (g - c) = -g + c; theorem (g + c1) + c2 = g + (c1 + c2); theorem (g + c1) - c2 = g + (c1 - c2); theorem (g - c1) + c2 = g - (c1 - c2); theorem (g - c1) - c2 = g - (c1 + c2); theorem g (#) c1 (#) c2 = g (#) (c1 * c2); theorem - (g + h) = (-g) - h; theorem g - h = - (h - g); theorem g (#) h /" k = g (#) (h /" k); theorem g /" h (#) k = g (#) k /" h; theorem g /" h /" k = g /" (h (#) k); theorem c(#)-g = (-c)(#)g; theorem c(#)-g = -(c(#)g); theorem (-c)(#)g = -(c(#)g); theorem - (g (#) h) = (-g) (#) h; theorem - (g /" h) = (-g) /" h; theorem - (g /" h) = g /" -h; definition let f be complex-valued Function, c be complex number; func f (/) c -> Function equals (1/c) (#) f; end; registration let f be complex-valued Function, c be complex number; cluster f (/) c -> complex-valued; end; registration let f be real-valued Function, r be real number; cluster f (/) r -> real-valued; end; registration let f be RAT-valued Function, r be rational number; cluster f (/) r -> RAT-valued; end; registration let f be complex-valued FinSequence, c be complex number; cluster f (/) c -> FinSequence-like; end; theorem dom(g(/)c) = dom g; theorem (g(/)c).x = g.x / c; theorem (-g) (/) c = -(g(/)c); theorem g (/) -c = -(g(/)c); theorem g (/) -c = (-g) (/) c; theorem g <> {} & g is non-empty & g (/) c1 = g (/) c2 implies c1 = c2; theorem g (#) c1 (/) c2 = g (#) (c1 / c2); theorem g (/) c1 (#) c2 = g (#) c2 (/) c1; theorem g (/) c1 (/) c2 = g (/) (c1*c2); theorem (g+h) (/) c = g(/)c + h(/)c; theorem (g-h) (/) c = g(/)c - h(/)c; theorem (g(#)h) (/) c = g (#) (h(/)c); theorem (g/"h) (/) c = g /" (h(#)c); definition let f be complex-functions-valued Function; func <->f -> Function means dom it = dom f & for x being set st x in dom it holds it.x = -f.x; end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; redefine func <->f -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; redefine func <->f -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; redefine func <->f -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; redefine func <->f -> PartFunc of X, I_PFuncs(DOMS(Y)); end; registration let Y be complex-functions-membered set; let f be FinSequence of Y; cluster <->f -> FinSequence-like; end; theorem <-><->f = f; theorem <->f1 = <->f2 implies f1 = f2; definition let X be complex-functions-membered set; let Y be set; let f be PartFunc of X,Y; func f(-) -> Function means dom it = dom f & for x being complex-valued Function st x in dom it holds it.x = f.-x; end; definition let f be complex-functions-valued Function; func f -> Function means dom it = dom f & for x being set st x in dom it holds it.x = (f.x)"; end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; redefine func f -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; redefine func f -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; redefine func f -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; registration let Y be complex-functions-membered set; let f be FinSequence of Y; cluster f -> FinSequence-like; end; theorem f = f; definition let f be complex-functions-valued Function; func abs(f) -> Function means dom it = dom f & for x being set st x in dom it holds it.x = abs(f.x); end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; redefine func abs(f) -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; redefine func abs(f) -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; redefine func abs(f) -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; redefine func abs(f) -> PartFunc of X, N_PFuncs(DOMS(Y)); end; registration let Y be complex-functions-membered set; let f be FinSequence of Y; cluster abs(f) -> FinSequence-like; end; theorem abs abs f = abs f; definition let Y be complex-functions-membered set; let f be Y-valued Function; let c be complex number; func f[+]c -> Function means dom it = dom f & for x being set st x in dom it holds it.x = c + f.x; end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let c be complex number; redefine func f[+]c -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let c be real number; redefine func f[+]c -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let c be rational number; redefine func f[+]c -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; let c be integer number; redefine func f[+]c -> PartFunc of X, I_PFuncs(DOMS(Y)); end; definition let X; let Y be natural-functions-membered set; let f be PartFunc of X,Y; let c be Nat; redefine func f[+]c -> PartFunc of X, N_PFuncs(DOMS(Y)); end; theorem f [+] c1 [+] c2 = f [+] (c1+c2); theorem f <> {} & f is non-empty & f [+] c1 = f [+] c2 implies c1 = c2; definition let Y be complex-functions-membered set; let f be Y-valued Function; let c be complex number; func f[-]c -> Function equals f [+] -c; end; theorem dom(f[-]c) = dom f; theorem x in dom(f[-]c) implies (f[-]c).x = f.x - c; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let c be complex number; redefine func f[-]c -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let c be real number; redefine func f[-]c -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let c be rational number; redefine func f[-]c -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; let c be integer number; redefine func f[-]c -> PartFunc of X, I_PFuncs(DOMS(Y)); end; theorem f <> {} & f is non-empty & f [-] c1 = f [-] c2 implies c1 = c2; theorem f [+] c1 [-] c2 = f [+] (c1-c2); theorem f [-] c1 [+] c2 = f [-] (c1-c2); theorem f [-] c1 [-] c2 = f [-] (c1+c2); definition let Y be complex-functions-membered set; let f be Y-valued Function; let c be complex number; func f[#]c -> Function means dom it = dom f & for x being set st x in dom it holds it.x = c (#) (f.x); end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let c be complex number; redefine func f[#]c -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let c be real number; redefine func f[#]c -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let c be rational number; redefine func f[#]c -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; let c be integer number; redefine func f[#]c -> PartFunc of X, I_PFuncs(DOMS(Y)); end; definition let X; let Y be natural-functions-membered set; let f be PartFunc of X,Y; let c be Nat; redefine func f[#]c -> PartFunc of X, N_PFuncs(DOMS(Y)); end; theorem f [#] c1 [#] c2 = f [#] (c1*c2); theorem f <> {} & f is non-empty & (for x st x in dom f holds f.x is non-empty ) & f [#] c1 = f [#] c2 implies c1 = c2; definition let Y be complex-functions-membered set; let f be Y-valued Function; let c be complex number; func f[/]c -> Function equals f [#] (c"); end; theorem dom(f[/]c) = dom f; theorem x in dom(f[/]c) implies (f[/]c).x = c" (#) f.x; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let c be complex number; redefine func f[/]c -> PartFunc of X, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let c be real number; redefine func f[/]c -> PartFunc of X, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let c be rational number; redefine func f[/]c -> PartFunc of X, Q_PFuncs(DOMS(Y)); end; theorem f [/] c1 [/] c2 = f [/] (c1*c2); theorem f <> {} & f is non-empty & (for x st x in dom f holds f.x is non-empty ) & f [/] c1 = f [/] c2 implies c1 = c2; definition let Y be complex-functions-membered set; let f be Y-valued Function; let g be complex-valued Function; func f<+>g -> Function means dom it = dom f /\ dom g & for x being set st x in dom it holds it.x = f.x + g.x; end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let g be complex-valued Function; redefine func f<+>g -> PartFunc of X /\ dom g, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let g be real-valued Function; redefine func f<+>g -> PartFunc of X /\ dom g, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let g be RAT-valued Function; redefine func f<+>g -> PartFunc of X /\ dom g, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; let g be INT-valued Function; redefine func f<+>g -> PartFunc of X /\ dom g, I_PFuncs(DOMS(Y)); end; definition let X; let Y be natural-functions-membered set; let f be PartFunc of X,Y; let g be natural-valued Function; redefine func f<+>g -> PartFunc of X /\ dom g, N_PFuncs(DOMS(Y)); end; theorem f <+> g <+> h = f <+> (g+h); theorem <->(f<+>g) = (<->f) <+> -g; definition let Y be complex-functions-membered set; let f be Y-valued Function; let g be complex-valued Function; func f<->g -> Function equals f <+> -g; end; theorem dom(f<->g) = dom f /\ dom g; theorem x in dom(f<->g) implies (f<->g).x = f.x - g.x; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let g be complex-valued Function; redefine func f<->g -> PartFunc of X /\ dom g, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let g be real-valued Function; redefine func f<->g -> PartFunc of X /\ dom g, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let g be RAT-valued Function; redefine func f<->g -> PartFunc of X /\ dom g, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; let g be INT-valued Function; redefine func f<->g -> PartFunc of X /\ dom g, I_PFuncs(DOMS(Y)); end; theorem f <-> -g = f <+> g; theorem <->(f<->g) = (<->f) <+> g; theorem f <+> g <-> h = f <+> (g-h); theorem f <-> g <+> h = f <-> (g-h); theorem f <-> g <-> h = f <-> (g+h); definition let Y be complex-functions-membered set; let f be Y-valued Function; let g be complex-valued Function; func f<#>g -> Function means dom it = dom f /\ dom g & for x being set st x in dom it holds it.x = f.x (#) g.x; end; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let g be complex-valued Function; redefine func f<#>g -> PartFunc of X /\ dom g, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let g be real-valued Function; redefine func f<#>g -> PartFunc of X /\ dom g, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let g be RAT-valued Function; redefine func f<#>g -> PartFunc of X /\ dom g, Q_PFuncs(DOMS(Y)); end; definition let X; let Y be integer-functions-membered set; let f be PartFunc of X,Y; let g be INT-valued Function; redefine func f<#>g -> PartFunc of X /\ dom g, I_PFuncs(DOMS(Y)); end; definition let X; let Y be natural-functions-membered set; let f be PartFunc of X,Y; let g be natural-valued Function; redefine func f<#>g -> PartFunc of X /\ dom g, N_PFuncs(DOMS(Y)); end; theorem f <#> -g = (<->f) <#> g; theorem f <#> -g = <-> (f <#> g); theorem f <#> g <#> h = f <#> (g(#)h); definition let Y be complex-functions-membered set; let f be Y-valued Function; let g be complex-valued Function; func fg -> Function equals f <#> (g"); end; theorem dom(fg) = dom f /\ dom g; theorem x in dom(fg) implies (fg).x = f.x (/) g.x; definition let X; let Y be complex-functions-membered set; let f be PartFunc of X,Y; let g be complex-valued Function; redefine func fg -> PartFunc of X /\ dom g, C_PFuncs(DOMS(Y)); end; definition let X; let Y be real-functions-membered set; let f be PartFunc of X,Y; let g be real-valued Function; redefine func fg -> PartFunc of X /\ dom g, R_PFuncs(DOMS(Y)); end; definition let X; let Y be rational-functions-membered set; let f be PartFunc of X,Y; let g be RAT-valued Function; redefine func fg -> PartFunc of X /\ dom g, Q_PFuncs(DOMS(Y)); end; theorem f <#> g h = f <#> (g/"h); definition let Y1, Y2 be complex-functions-membered set; let f be Y1-valued Function; let g be Y2-valued Function; func f<++>g -> Function means dom it = dom f /\ dom g & for x being set st x in dom it holds it.x = f.x + g.x; end; definition let X1, X2 be set; let Y1, Y2 be complex-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<++>g -> PartFunc of X1 /\ X2, C_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be real-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<++>g -> PartFunc of X1 /\ X2, R_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be rational-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<++>g -> PartFunc of X1 /\ X2, Q_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be integer-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<++>g -> PartFunc of X1 /\ X2, I_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be natural-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<++>g -> PartFunc of X1 /\ X2, N_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; theorem f1 <++> f2 = f2 <++> f1; theorem f <++> f1 <++> f2 = f <++> (f1 <++> f2); theorem <-> (f1 <++> f2) = (<->f1) <++> (<->f2); definition let Y1, Y2 be complex-functions-membered set; let f be Y1-valued Function; let g be Y2-valued Function; func f<-->g -> Function means dom it = dom f /\ dom g & for x being set st x in dom it holds it.x = f.x - g.x; end; definition let X1, X2 be set; let Y1, Y2 be complex-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<-->g -> PartFunc of X1 /\ X2, C_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be real-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<-->g -> PartFunc of X1 /\ X2, R_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be rational-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<-->g -> PartFunc of X1 /\ X2, Q_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be integer-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<-->g -> PartFunc of X1 /\ X2, I_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; theorem f1 <--> f2 = <-> (f2 <--> f1); theorem <-> (f1 <--> f2) = (<->f1) <++> f2; theorem f <++> f1 <--> f2 = f <++> (f1<-->f2); theorem f <--> f1 <++> f2 = f <--> (f1 <--> f2); theorem f <--> f1 <--> f2 = f <--> (f1 <++> f2); theorem f <--> f1 <--> f2 = f <--> f2 <--> f1; definition let Y1, Y2 be complex-functions-membered set; let f be Y1-valued Function; let g be Y2-valued Function; func f<##>g -> Function means dom it = dom f /\ dom g & for x being set st x in dom it holds it.x = f.x (#) g.x; end; definition let X1, X2 be set; let Y1, Y2 be complex-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<##>g -> PartFunc of X1 /\ X2, C_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be real-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<##>g -> PartFunc of X1 /\ X2, R_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be rational-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<##>g -> PartFunc of X1 /\ X2, Q_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be integer-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<##>g -> PartFunc of X1 /\ X2, I_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be natural-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func f<##>g -> PartFunc of X1 /\ X2, N_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; theorem f1 <##> f2 = f2 <##> f1; theorem (f <##> f1) <##> f2 = f <##> (f1 <##> f2); theorem (<->f1) <##> f2 = <-> (f1<##>f2); theorem f1 <##> <->f2 = <-> (f1<##>f2); theorem f <##> (f1<++>f2) = (f<##>f1) <++> (f<##>f2); theorem (f1<++>f2) <##> f = (f1<##>f) <++> (f2<##>f); theorem f <##> (f1<-->f2) = (f<##>f1) <--> (f<##>f2); theorem (f1<-->f2) <##> f = (f1<##>f) <--> (f2<##>f); definition let Y1, Y2 be complex-functions-membered set; let f be Y1-valued Function; let g be Y2-valued Function; func fg -> Function means dom it = dom f /\ dom g & for x being set st x in dom it holds it.x = f.x /" g.x; end; definition let X1, X2 be set; let Y1, Y2 be complex-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func fg -> PartFunc of X1 /\ X2, C_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be real-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func fg -> PartFunc of X1 /\ X2, R_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; definition let X1, X2 be set; let Y1, Y2 be rational-functions-membered set; let f be PartFunc of X1,Y1; let g be PartFunc of X2,Y2; redefine func fg -> PartFunc of X1 /\ X2, Q_PFuncs(DOMS(Y1)/\DOMS(Y2)); end; theorem (<->f1) f2 = <-> (f1f2); theorem f1 <->f2 = <-> (f1f2); theorem f <##> f1 f2 = f <##> (f1f2); theorem f f1 <##> f2 = f <##> f2 f1; theorem f f1 f2 = f (f1 <##> f2); theorem (f1<++>f2) f = (f1f) <++> (f2f); theorem (f1<-->f2) f = (f1f) <--> (f2f); begin reserve n,m,k for Element of NAT; reserve r,r1 for real number; reserve f,seq,seq1 for Real_Sequence; reserve x,y for set; reserve e1,e2 for ext-real number; definition let f be NAT-defined REAL-valued Function; redefine attr f is increasing means for m,n st m in dom f & n in dom f & m < n holds f.m < f.n; redefine attr f is decreasing means for m,n st m in dom f & n in dom f & m < n holds f.m > f.n; redefine attr f is non-decreasing means for m,n st m in dom f & n in dom f & m <= n holds f.m <= f.n; redefine attr f is non-increasing means for m,n st m in dom f & n in dom f & m <= n holds f.m >= f.n; end; definition let seq; attr seq is monotone means seq is non-decreasing or seq is non-increasing; end; theorem seq is increasing iff for n,m st n non-decreasing non-increasing for PartFunc of NAT, REAL; cluster non-decreasing non-increasing -> constant for PartFunc of NAT, REAL; end; registration cluster increasing natural-valued for Real_Sequence; end; registration cluster increasing for sequence of NAT; end; reserve Nseq for increasing sequence of NAT; theorem seq is sequence of NAT iff for n holds seq.n is Element of NAT; registration let Nseq,k; cluster Nseq ^\ k -> increasing natural-valued for ext-real-valued Function; end; definition let f be Real_Sequence; redefine attr f is increasing means for n being Element of NAT holds f.n < f.(n+1); redefine attr f is decreasing means for n being Element of NAT holds f.n > f.(n+1); redefine attr f is non-decreasing means for n being Element of NAT holds f.n <= f.(n+1); redefine attr f is non-increasing means for n being Element of NAT holds f.n >= f.(n+1); end; theorem for n holds n<=Nseq.n; registration let s be Real_Sequence, k be Nat; cluster s^\k ->real-valued; end; theorem (seq+seq1) ^\k=(seq ^\k) + (seq1 ^\k); theorem (-seq) ^\k=-(seq ^\k); theorem (seq-seq1) ^\k=(seq ^\k)-(seq1 ^\k); theorem (seq") ^\k=(seq ^\k)"; theorem (seq(#)seq1) ^\k=(seq ^\k)(#)(seq1 ^\k); theorem (seq/"seq1) ^\k=(seq ^\k)/"(seq1 ^\k); theorem (r(#)seq) ^\k=r(#)(seq ^\k); theorem seq is increasing & seq1 is subsequence of seq implies seq1 is increasing; theorem seq is decreasing & seq1 is subsequence of seq implies seq1 is decreasing; theorem seq is non-decreasing & seq1 is subsequence of seq implies seq1 is non-decreasing; theorem seq is non-increasing & seq1 is subsequence of seq implies seq1 is non-increasing; theorem seq is monotone & seq1 is subsequence of seq implies seq1 is monotone; theorem seq is bounded_above & seq1 is subsequence of seq implies seq1 is bounded_above; theorem seq is bounded_below & seq1 is subsequence of seq implies seq1 is bounded_below; theorem seq is bounded & seq1 is subsequence of seq implies seq1 is bounded; theorem (seq is increasing & 0 natural-valued for FinSequence of NAT; end; begin reserve v for FinSequence of REAL, r,s for Real, n,m,i,j,k for Element of NAT; theorem abs(r-s)=1 iff r>s & r=s+1 or r1 iff ex m st n=m+1 & m>0; theorem for f being FinSequence,n,m,k st len f = m+1 & n in dom f & k in Seg m holds Del(f,n).k = f.k or Del(f,n).k = f.(k+1); definition let f be FinSequence; redefine attr f is constant means for n,m st n in dom f & m in dom f holds f.n=f.m; end; registration cluster -> real-valued for FinSequence of REAL; end; registration cluster non empty increasing for FinSequence of REAL; end; registration cluster constant for FinSequence of REAL; end; theorem v<>{} & rng v c= Seg n & v.(len v) = n & (for k st 1<=k & k<=len v - 1 holds for r,s st r = v.k & s = v.(k+1) holds abs(r-s) = 1 or r=s) & i in Seg n & i+1 in Seg n & m in dom v & v.m = i & (for k st k in dom v & v.k = i holds k<=m) implies m+1 in dom v & v.(m+1)=i+1; theorem v<>{} & rng v c= Seg n & v.1 = 1 & v.(len v) = n & (for k st 1<=k & k <=len v - 1 holds for r,s st r = v.k & s = v.(k+1) holds abs(r-s) = 1 or r=s) implies (for i st i in Seg n ex k st k in dom v & v.k = i) & for m,k,i,r st m in dom v & v.m = i & (for j st j in dom v & v.j = i holds j<=m) & m finite; end; theorem for f,g,h be FinSequence holds f,g are_fiberwise_equipotent iff f^h, g^h are_fiberwise_equipotent; theorem for f,g be FinSequence holds f^g, g^f are_fiberwise_equipotent; theorem for f,g be FinSequence st f,g are_fiberwise_equipotent holds len f = len g & dom f = dom g; theorem for f,g be FinSequence holds f,g are_fiberwise_equipotent iff ex P be Permutation of dom g st f = g*P; theorem for F be Function, X be finite set ex f be FinSequence st F|X, f are_fiberwise_equipotent; definition let n be Nat, f be FinSequence; func f /^ n -> FinSequence means len it = len f - n & for m be Nat st m in dom it holds it.m = f.(m+n) if n<=len f otherwise it = {}; end; definition let D be set, n be Nat, f be FinSequence of D; redefine func f /^ n -> FinSequence of D; end; theorem for D be non empty set, f be FinSequence of D, n,m be Nat holds n in dom f & m in Seg n implies (f|n).m = f.m & m in dom f; theorem for D be non empty set, f be FinSequence of D, n be Nat, x be set st len f = n+1 & x = f.(n+1) holds f = (f|n) ^ <*x*>; theorem for D be non empty set, f be FinSequence of D, n be Nat holds (f|n)^(f/^n) = f; theorem for R1,R2 be FinSequence of REAL st R1,R2 are_fiberwise_equipotent holds Sum R1 = Sum R2; definition let R be FinSequence of REAL; func MIM(R) -> FinSequence of REAL means len it = len R & it.(len it) = R.(len R) & for n be Nat st 1 <= n & n <= len it - 1 holds it.n = (R.n) - (R.(n+1)); end; theorem for R be FinSequence of REAL, r be Real, n be Element of NAT st len R = n+2 & R.(n+1) = r holds MIM(R|(n+1)) = MIM(R)|n ^ <* r *>; theorem for R be FinSequence of REAL, r,s be Real, n be Element of NAT st len R = n+2 & R.(n+1) = r & R.(n+2) = s holds MIM(R) = MIM(R)|n ^ <* r-s,s *>; theorem MIM( <*>REAL ) = <*>REAL; theorem for r be Real holds MIM(<*r*>) = <*r*>; theorem for r,s be Real holds MIM(<*r,s*>) = <*r-s,s*>; theorem for R be FinSequence of REAL, n be Element of NAT holds MIM(R) /^ n = MIM(R/^n); theorem for R be FinSequence of REAL st len R <> 0 holds Sum MIM(R) = R. 1; theorem for R be FinSequence of REAL, n be Element of NAT st n= IT.(n+1); end; registration cluster non-increasing for FinSequence of REAL; end; theorem for R be FinSequence of REAL st len R = 0 or len R = 1 holds R is non-increasing; theorem for R be FinSequence of REAL holds R is non-increasing iff for n ,m be Element of NAT st n in dom R & m in dom R & n=R.m; theorem for R be non-increasing FinSequence of REAL, n be Element of NAT holds R|n is non-increasing FinSequence of REAL; theorem for R be non-increasing FinSequence of REAL, n be Element of NAT holds R /^ n is non-increasing; theorem for R be FinSequence of REAL ex R1 be non-increasing FinSequence of REAL st R,R1 are_fiberwise_equipotent; theorem for R1,R2 be non-increasing FinSequence of REAL st R1,R2 are_fiberwise_equipotent holds R1 = R2; theorem for R be FinSequence of REAL, r,s be Real st r <> 0 holds R"{s/r} = (r *R)"{ s }; theorem for R be FinSequence of REAL holds (0*R)"{0} = dom R; begin reserve f, g for Function; theorem for f, g st rng f = rng g & f is one-to-one & g is one-to-one holds f,g are_fiberwise_equipotent; theorem for D being set, f being FinSequence of D holds f /^ len f = {}; theorem for f,g be Function,m,n be set st f.m=g.n & f.n=g.m & m in dom f & n in dom f & dom f = dom g & (for k be set st k<>m & k<>n & k in dom f holds f.k= g.k) holds f,g are_fiberwise_equipotent; theorem for D being non empty set, f being FinSequence of D, k being Nat holds len (f/^k)=len f-'k; theorem for f,g be FinSequence,x be set st x in dom g & f,g are_fiberwise_equipotent holds ex y be set st y in dom g & f.x=g.y; theorem for f,g,h be FinSequence holds f,g are_fiberwise_equipotent iff h^f, h^g are_fiberwise_equipotent; theorem for f,g be FinSequence,m,n,j be Element of NAT st f,g are_fiberwise_equipotent & m<=n & n <= len f & (for i be Element of NAT st 1<=i & i<=m holds f.i=g.i) & (for i be Element of NAT st n Subset of REAL; end; theorem for X being real-membered set holds X is non empty bounded_above implies ex g st (for r st r in X holds r<=g) & for s st 0 real number means (for r st r in X holds r<=it) & for s st 0 real number means (for r st r in X holds it<=r) & for s st 0 Real; redefine func lower_bound X -> Real; end; theorem lower_bound {r} = r & upper_bound {r} = r; theorem lower_bound {r} = upper_bound {r}; theorem X is real-bounded non empty implies lower_bound X <= upper_bound X; theorem X is real-bounded non empty implies ((ex r,p st r in X & p in X & p<>r) iff lower_bound X < upper_bound X); theorem seq is convergent implies abs seq is convergent; registration let seq be convergent Real_Sequence; cluster abs seq -> convergent for Real_Sequence; end; theorem seq is convergent implies lim abs seq = abs lim seq; theorem abs seq is convergent & lim abs seq=0 implies seq is convergent & lim seq=0; theorem seq1 is subsequence of seq & seq is convergent implies seq1 is convergent; theorem seq1 is subsequence of seq & seq is convergent implies lim seq1= lim seq; theorem seq is convergent & (ex k st for n st k<=n holds seq1.n=seq.n) implies seq1 is convergent; theorem seq is convergent & (ex k st for n st k<=n holds seq1.n=seq.n) implies lim seq=lim seq1; registration cluster constant -> convergent for Real_Sequence; end; registration cluster constant for Real_Sequence; end; registration let seq be convergent Real_Sequence; let k; cluster seq ^\ k -> convergent for Real_Sequence; end; theorem seq is convergent implies lim (seq^\k)=lim seq; theorem seq^\k is convergent implies seq is convergent; theorem seq^\k is convergent implies lim seq = lim (seq^\k); theorem seq is convergent & lim seq<>0 implies ex k st (seq ^\k) is non-zero; theorem seq is convergent & lim seq<>0 implies ex seq1 st seq1 is subsequence of seq & seq1 is non-zero; theorem seq is constant & (r in rng seq or ex n st seq.n=r ) implies lim seq=r; theorem seq is constant implies for n holds lim seq=seq.n; theorem seq is convergent & lim seq<>0 implies for seq1 st seq1 is subsequence of seq & seq1 is non-zero holds lim (seq1")=(lim seq)"; theorem 0<=r & (for n holds seq.n=1/(n+r)) implies seq is convergent; theorem 0<=r & (for n holds seq.n=1/(n+r)) implies lim seq=0; theorem (for n holds seq.n=1/(n+1)) implies seq is convergent & lim seq=0; theorem 0<=r & (for n holds seq.n=g/(n+r)) implies seq is convergent & lim seq =0; theorem 0<=r & (for n holds seq.n=1/(n*n+r)) implies seq is convergent; theorem 0<=r & (for n holds seq.n=1/(n*n+r)) implies lim seq=0; theorem (for n holds seq.n=1/(n*n+1)) implies seq is convergent & lim seq=0; theorem 0<=r & (for n holds seq.n=g/(n*n+r)) implies seq is convergent & lim seq=0; registration cluster non-decreasing bounded_above -> convergent for Real_Sequence; end; registration cluster non-increasing bounded_below -> convergent for Real_Sequence; end; registration cluster monotone bounded -> convergent for Real_Sequence; end; theorem seq is monotone & seq is bounded implies seq is convergent; theorem seq is bounded_above & seq is non-decreasing implies for n holds seq.n <=lim seq; theorem seq is bounded_below & seq is non-increasing implies for n holds lim seq <= seq.n; theorem for seq ex Nseq st seq*Nseq is monotone; theorem seq is bounded implies ex seq1 st seq1 is subsequence of seq & seq1 is convergent; theorem seq is convergent iff for s st 0= t holds lower_bound X >= t; theorem for X being non empty real-membered set st (for s st s in X holds s >= r) & for t st for s st s in X holds s >= t holds r >= t holds r = lower_bound X ; theorem for X being non empty real-membered set, r for t st for s st s in X holds s <= t holds upper_bound X <= t; theorem for X being non empty real-membered set, r st (for s st s in X holds s <= r) & for t st for s st s in X holds s <= t holds r <= t holds r = upper_bound X; theorem for X being non empty real-membered set, Y being real-membered set st X c= Y & Y is bounded_below holds lower_bound Y <= lower_bound X; theorem for X being non empty real-membered set, Y being real-membered set st X c= Y & Y is bounded_above holds upper_bound X <= upper_bound Y; definition let A be non empty natural-membered set; redefine func min A -> Element of NAT; end; begin reserve k,n for Element of NAT, r,r9,r1,r2 for Real, c,c9,c1,c2,c3 for Element of COMPLEX; theorem 0c is_a_unity_wrt addcomplex; theorem compcomplex is_an_inverseOp_wrt addcomplex; theorem addcomplex is having_an_inverseOp; theorem the_inverseOp_wrt addcomplex = compcomplex; definition redefine func diffcomplex equals addcomplex*(id COMPLEX,compcomplex); end; theorem 1r is_a_unity_wrt multcomplex; theorem multcomplex is_distributive_wrt addcomplex; definition let c be complex number; func c multcomplex -> UnOp of COMPLEX equals multcomplex[;](c,id COMPLEX); end; theorem (c multcomplex).c9 = c*c9; theorem c multcomplex is_distributive_wrt addcomplex; definition func abscomplex -> Function of COMPLEX,REAL means for c holds it.c = |.c.|; end; reserve z,z1,z2 for FinSequence of COMPLEX; definition let z1,z2; redefine func z1 + z2 -> FinSequence of COMPLEX equals addcomplex.:(z1,z2); redefine func z1 - z2 -> FinSequence of COMPLEX equals diffcomplex.:(z1,z2); end; definition let z; redefine func -z -> FinSequence of COMPLEX equals compcomplex*z; end; notation let z; let c be complex number; synonym c*z for c(#)z; end; definition let z; let c be complex number; redefine func c*z -> FinSequence of COMPLEX equals (c multcomplex)*z; end; definition let z; redefine func abs z -> FinSequence of REAL equals abscomplex*z; end; definition let n; func COMPLEX n -> FinSequenceSet of COMPLEX equals n-tuples_on COMPLEX; end; registration let n; cluster COMPLEX n -> non empty; end; reserve x,z,z1,z2,z3 for Element of COMPLEX n, A,B for Subset of COMPLEX n; theorem k in Seg n implies z.k in COMPLEX; definition let n,z1,z2; redefine func z1 + z2 -> Element of COMPLEX n; end; theorem k in Seg n & c1 = z1.k & c2 = z2.k implies (z1 + z2).k = c1 + c2; definition let n; func 0c n -> FinSequence of COMPLEX equals n |-> 0c; end; definition let n; redefine func 0c n -> Element of COMPLEX n; end; theorem z + 0c n = z & z = 0c n + z; definition let n,z; redefine func -z -> Element of COMPLEX n; end; theorem k in Seg n & c = z.k implies (-z).k = -c; theorem z + -z = 0c n & -z + z = 0c n; theorem z1 + z2 = 0c n implies z1 = -z2 & z2 = -z1 ; canceled; theorem -z1 = -z2 implies z1 = z2; theorem z1 + z = z2 + z or z1 + z = z + z2 implies z1 = z2; theorem -(z1 + z2) = -z1 + -z2; definition let n,z1,z2; redefine func z1 - z2 -> Element of COMPLEX n; end; theorem k in Seg n implies (z1 - z2).k = z1.k - z2.k; theorem z - 0c n = z; theorem 0c n - z = -z; theorem z1 - -z2 = z1 + z2; theorem -(z1 - z2) = z2 - z1; theorem -(z1 - z2) = -z1 + z2; theorem z - z = 0c n; theorem z1 - z2 = 0c n implies z1 = z2; theorem z1 - z2 - z3 = z1 - (z2 + z3); theorem z1 + (z2 - z3) = z1 + z2 - z3; theorem z1 - (z2 - z3) = z1 - z2 + z3; theorem z1 - z2 + z3 = z1 + z3 - z2; theorem z1 = z1 + z - z; theorem z1 + (z2 - z1) = z2; theorem z1 = z1 - z + z; definition let n,z,c; redefine func c*z -> Element of COMPLEX n; end; theorem k in Seg n & c9 = z.k implies (c*z).k = c*c9; theorem c1*(c2*z) = (c1*c2)*z; theorem (c1 + c2)*z = c1*z + c2*z; theorem c*(z1+z2) = c*z1 + c*z2; theorem 1r*z = z; theorem 0c*z = 0c n; theorem (-1r)*z = -z; definition let n,z; redefine func abs z -> Element of n-tuples_on REAL; end; theorem k in Seg n & c = z.k implies (abs z).k = |.c.|; theorem abs 0c n = n |-> 0; theorem abs -z = abs z; theorem abs(c*z) = |.c.|*(abs z); definition let z be FinSequence of COMPLEX; func |.z.| -> Real equals sqrt Sum sqr abs z; end; theorem |.0c n.| = 0; theorem |.z.| = 0 implies z = 0c n; theorem 0 <= |.z.|; theorem |.-z.| = |.z.|; theorem |.c*z.| = |.c.|*|.z.|; theorem |.z1 + z2.| <= |.z1.| + |.z2.|; theorem |.z1 - z2.| <= |.z1.| + |.z2.|; theorem |.z1.| - |.z2.| <= |.z1 + z2.|; theorem |.z1.| - |.z2.| <= |.z1 - z2.|; theorem |.z1 - z2.| = 0 iff z1 = z2; theorem z1 <> z2 implies 0 < |.z1 - z2.|; theorem |.z1 - z2.| = |.z2 - z1.|; theorem |.z1 - z2.| <= |.z1 - z.| + |.z - z2.|; definition let n; let A be Subset of COMPLEX n; attr A is open means for x st x in A ex r st 0 < r & for z st |.z.| < r holds x + z in A; end; definition let n; let A be Subset of COMPLEX n; attr A is closed means for x st for r st r > 0 ex z st |.z.| < r & x + z in A holds x in A; end; theorem for A being Subset of COMPLEX n st A = {} holds A is open; theorem for A being Subset of COMPLEX n st A = COMPLEX n holds A is open; theorem for AA being Subset-Family of COMPLEX n st for A being Subset of COMPLEX n st A in AA holds A is open for A being Subset of COMPLEX n st A = union AA holds A is open; theorem for A,B being Subset of COMPLEX n st A is open & B is open for C being Subset of COMPLEX n st C = A /\ B holds C is open; definition let n,x,r; func Ball(x,r) -> Subset of COMPLEX n equals { z : |.z - x.| < r }; end; theorem z in Ball(x,r) iff |.x - z.| < r; theorem 0 < r implies x in Ball(x,r); theorem Ball(z1,r1) is open; definition let n,x,A; func dist(x,A) -> Real means for X being Subset of REAL st X = {|.x - z.| : z in A} holds it = lower_bound X; end; definition let n,A,r; func Ball(A,r) -> Subset of COMPLEX n equals { z : dist(z,A) < r }; end; theorem for X being Subset of REAL, r st X <> {} & for r9 st r9 in X holds r <= r9 holds lower_bound X >= r; theorem A <> {} implies dist(x,A) >= 0; theorem A <> {} implies dist(x + z,A) <= dist(x,A) + |.z.|; theorem x in A implies dist(x,A) = 0; theorem not x in A & A <> {} & A is closed implies dist(x,A) > 0; theorem A <> {} implies |.z1 - x.| + dist(x,A) >= dist(z1,A); theorem z in Ball(A,r) iff dist(z,A) < r; theorem 0 < r & x in A implies x in Ball(A,r); theorem 0 < r implies A c= Ball(A,r); theorem A <> {} implies Ball(A,r1) is open; definition let n,A,B; func dist(A,B) -> Real means for X being Subset of REAL st X = {|.x - z.| : x in A & z in B} holds it = lower_bound X; end; theorem for X,Y being Subset of REAL holds X <> {} & Y <> {} implies X ++ Y <> {}; theorem for X,Y being Subset of REAL holds X is bounded_below & Y is bounded_below implies X++Y is bounded_below; theorem for X,Y being Subset of REAL st X <> {} & X is bounded_below & Y <> {} & Y is bounded_below holds lower_bound (X ++ Y) = lower_bound X + lower_bound Y; theorem for X,Y being Subset of REAL st Y is bounded_below & X <> {} & for r st r in X ex r1 st r1 in Y & r1 <= r holds lower_bound X >= lower_bound Y; theorem A <> {} & B <> {} implies dist(A,B) >= 0; theorem dist(A,B) = dist(B,A); theorem A <> {} & B <> {} implies dist(x,A) + dist(x,B) >= dist(A,B); theorem A meets B implies dist(A,B) = 0; definition let n; func ComplexOpenSets(n) -> Subset-Family of COMPLEX n equals {A where A is Subset of COMPLEX n: A is open}; end; theorem for A being Subset of COMPLEX n holds A in ComplexOpenSets n iff A is open; theorem for A being Subset of COMPLEX n holds A is closed iff A` is open; begin reserve v,v1,v2 for FinSequence of REAL, n,m,k for Element of NAT, x for set; theorem for R being finite Subset of REAL holds R <> {} implies R is bounded_above & upper_bound(R) in R & R is bounded_below & lower_bound(R) in R; theorem for n being Nat for f being FinSequence holds 1 <= n & n+1 <= len f iff n in dom f & n+1 in dom f; theorem for n being Nat for f being FinSequence holds 1 <= n & n+2 <= len f iff n in dom f & n+1 in dom f & n+2 in dom f; theorem for D being non empty set, f1,f2 being FinSequence of D, n st 1 <= n & n <= len f2 holds (f1^f2)/.(n + len f1) = f2/.n; theorem v is increasing implies for n,m st n in dom v & m in dom v & n<=m holds v.n <= v.m; theorem v is increasing implies for n,m st n in dom v & m in dom v & n<> m holds v.n<>v.m; theorem v is increasing & v1 = v|Seg n implies v1 is increasing; theorem for v holds ex v1 st rng v1 = rng v & len v1 = card rng v & v1 is increasing; theorem for v1,v2 st len v1 = len v2 & rng v1 = rng v2 & v1 is increasing & v2 is increasing holds v1 = v2; definition let v; func Incr(v) ->increasing FinSequence of REAL means rng it = rng v & len it = card rng v; end; registration let v be non empty FinSequence of REAL; cluster Incr v -> non empty; end; registration cluster non empty bounded_above bounded_below for Subset of REAL; end; theorem for A,B being non empty bounded_below Subset of REAL holds lower_bound(A \/ B) = min(lower_bound A,lower_bound B); theorem for A,B being non empty bounded_above Subset of REAL holds upper_bound(A \/ B) = max(upper_bound A,upper_bound B); theorem for R being non empty Subset of REAL,r0 being real number st for r being real number st r in R holds r <= r0 holds upper_bound R <= r0; begin reserve n,n1,m,k for Element of NAT; reserve x,y for set; reserve s,g,g1,g2,r,p,q,t for real number; reserve s1,s2,s3 for Real_Sequence; reserve Nseq for increasing sequence of NAT; reserve X for Subset of REAL; definition let g,s be real number; redefine func [. g,s .] -> Subset of REAL equals {r where r is Real: g<=r & r<=s }; end; definition let g,s be ext-real number; redefine func ]. g,s .[ -> Subset of REAL equals {r where r is Real : g open for Subset of REAL; cluster [.p,q.] -> closed for Subset of REAL; end; theorem X is compact implies X is closed; registration cluster compact -> closed for Subset of REAL; end; theorem (for p st p in X ex r,n st 0{} & X is closed & X is bounded_above holds upper_bound X in X; theorem for X st X<>{} & X is closed & X is bounded_below holds lower_bound X in X; theorem for X st X<>{} & X is compact holds upper_bound X in X & lower_bound X in X; theorem X is compact & (for g1,g2 st g1 in X & g2 in X holds [.g1,g2.] c= X) implies ex p,g st X = [.p,g.]; registration cluster open for Subset of REAL; end; definition let r be real number; mode Neighbourhood of r -> Subset of REAL means ex g st 0 open for Neighbourhood of r; end; theorem for N being Neighbourhood of r holds r in N; theorem for r for N1,N2 being Neighbourhood of r ex N being Neighbourhood of r st N c= N1 & N c= N2; theorem for X being open Subset of REAL, r st r in X ex N being Neighbourhood of r st N c= X; theorem for X being open Subset of REAL, r st r in X ex g st 0 Subset of REAL equals { r where r is Real : g<=r & r Subset of REAL equals { r where r is Real : g one-to-one; end; theorem for h being one-to-one Function holds (h|X)" = (h")|(h.:X); theorem for h being PartFunc of W,REAL holds rng h is real-bounded & upper_bound (rng h) = lower_bound (rng h) implies h is constant; theorem for h being PartFunc of W,REAL holds h.:Y is real-bounded & upper_bound(h.:Y) = lower_bound(h.:Y) implies h|Y is constant; reserve e1,e2 for ext-real number; reserve h,h1,h2 for PartFunc of REAL,REAL; definition let h; redefine attr h is increasing means for r1,r2 st r1 in dom h & r2 in dom h & r1 monotone for PartFunc of REAL,REAL; cluster non-increasing -> monotone for PartFunc of REAL,REAL; cluster non monotone -> non non-decreasing non non-increasing for PartFunc of REAL,REAL; end; theorem h|Y is non-decreasing iff for r1,r2 st r1 in Y /\ dom h & r2 in Y /\ dom h & r1<=r2 holds h.r1 <= h.r2; theorem h|Y is non-increasing iff for r1,r2 st r1 in Y /\ dom h & r2 in Y /\ dom h & r1<=r2 holds h.r2 <= h.r1; registration cluster non-decreasing non-increasing -> constant for PartFunc of REAL,REAL; end; registration cluster constant -> non-increasing non-decreasing for PartFunc of REAL,REAL; end; registration cluster trivial for PartFunc of REAL,REAL; end; registration let h be increasing PartFunc of REAL,REAL, X be set; cluster h|X -> increasing for PartFunc of REAL,REAL; end; registration let h be decreasing PartFunc of REAL,REAL, X be set; cluster h|X -> decreasing for PartFunc of REAL,REAL; end; registration let h be non-decreasing PartFunc of REAL,REAL, X be set; cluster h|X -> non-decreasing for PartFunc of REAL,REAL; end; theorem Y misses dom h implies h|Y is increasing & h|Y is decreasing & h|Y is non-decreasing & h|Y is non-increasing & h|Y is monotone; theorem h|Y is non-decreasing & h|X is non-increasing implies h|(Y /\ X) is constant; theorem X c= Y & h|Y is increasing implies h|X is increasing; theorem X c= Y & h|Y is decreasing implies h|X is decreasing; theorem X c= Y & h|Y is non-decreasing implies h|X is non-decreasing; theorem X c= Y & h|Y is non-increasing implies h|X is non-increasing; theorem (h|Y is increasing & 0 PartFunc of C,COMPLEX means dom it = dom f1 /\ (dom f2 \ f2"{0}) & for c st c in dom it holds it/.c = f1/.c * (f2/.c)"; end; definition let C,f; func f^ -> PartFunc of C,COMPLEX means dom it = dom f \ f"{0} & for c st c in dom it holds it/.c = (f/.c)"; end; theorem dom (f1+f2) = dom f1 /\ dom f2 & for c st c in dom(f1+f2) holds ( f1+f2)/.c = (f1/.c) + (f2/.c); theorem dom (f1-f2) = dom f1 /\ dom f2 & for c st c in dom(f1-f2) holds ( f1-f2)/.c = (f1/.c) - (f2/.c); theorem dom(f1(#)f2)=dom f1 /\ dom f2 & for c st c in dom(f1(#)f2) holds (f1(#)f2)/.c =(f1/.c) * (f2/.c); theorem dom (r(#)f) = dom f & for c st c in dom (r(#)f) holds (r(#)f)/.c = r * (f/.c) ; theorem dom (-f) = dom f & for c st c in dom (-f) holds (-f)/.c = -f/.c; theorem dom (g^) c= dom g & dom g /\ (dom g \ g"{0}) = dom g \ g"{0}; theorem dom (f1(#)f2) \ (f1(#)f2)"{0} = (dom f1 \ (f1)"{0}) /\ (dom f2 \ (f2)"{0}); theorem c in dom (f^) implies (f/.c) <> 0; theorem (f^)"{0} = {}; theorem |.f.|"{0} = f"{0} & (-f)"{0} = f"{0}; theorem dom (f^^) = dom (f|(dom (f^))); theorem r<>0 implies (r(#)f)"{0} = f"{0}; begin theorem (f1 + f2) + f3 = f1 + (f2 + f3); theorem (f1 (#) f2) (#) f3 = f1 (#) (f2 (#) f3); theorem (f1 + f2) (#) f3=f1 (#) f3 + f2 (#) f3; theorem f3 (#) (f1 + f2)=f3(#)f1 + f3(#)f2; theorem r(#)(f1(#)f2)=r(#)f1(#)f2; theorem r(#)(f1(#)f2)=f1(#)(r(#)f2); theorem (f1 - f2)(#)f3=f1(#)f3 - f2(#)f3; theorem f3(#)f1 - f3(#)f2 = f3(#)(f1 - f2); theorem r(#)(f1 + f2) = r(#)f1 + r(#)f2; theorem (r*q)(#)f = r(#)(q(#)f); theorem r(#)(f1 - f2) = r(#)f1 - r(#)f2; theorem f1-f2 = (-1r)(#)(f2-f1); theorem f1 - (f2 + f3) = f1 - f2 - f3; theorem 1r(#)f = f; theorem f1 - (f2 - f3) = f1 - f2 + f3; theorem f1 + (f2 - f3) =f1 + f2 - f3; theorem |.f1(#)f2.| = |.f1.|(#)|.f2.|; theorem |.r(#)f.| = |.r.|(#)|.f.|; theorem -f = (-1r)(#)f; canceled; theorem f1 - (-f2) = f1 + f2; theorem f^^ = f|(dom (f^)); theorem (f1(#)f2)^ = (f1^)(#)(f2^); theorem r<>0 implies (r(#)f)^ = r" (#) (f^); theorem (-f)^ = (-1r)(#)(f^); theorem |.f.|^ = |. f^ .|; theorem f/g = f(#) (g^); theorem r(#)(g/f) = (r(#)g)/f; theorem (f/g)(#)g = (f|dom(g^)); theorem (f/g)(#)(f1/g1) = (f(#)f1)/(g(#)g1); theorem (f1/f2)^ = (f2|dom(f2^))/f1; theorem g (#) (f1/f2) = (g (#) f1)/f2; theorem g/(f1/f2) = (g(#)(f2|dom(f2^)))/f1; theorem -f/g = (-f)/g & f/(-g) = -f/g; theorem f1/f + f2/f = (f1 + f2)/f & f1/f - f2/f = (f1 - f2)/f; theorem f1/f + g1/g = (f1(#)g + g1(#)f)/(f(#)g); theorem (f/g)/(f1/g1) = (f(#)(g1|dom(g1^)))/(g(#)f1); theorem f1/f - g1/g = (f1(#)g - g1(#)f)/(f(#)g); theorem |.f1/f2.| = |.f1.|/|.f2.|; theorem (f1+f2)|X = f1|X + f2|X & (f1+f2)|X = f1|X + f2 & (f1+f2)|X = f1 + f2|X; theorem (f1(#)f2)|X = f1|X (#) f2|X & (f1(#)f2)|X = f1|X (#) f2 & (f1(#) f2)|X = f1 (#) f2|X; theorem (-f)|X = -(f|X) & (f^)|X = (f|X)^ & (|.f.|)|X = |.(f|X).|; theorem (f1-f2)|X = f1|X - f2|X & (f1-f2)|X = f1|X - f2 &(f1-f2)|X = f1 - f2|X; theorem (f1/f2)|X = f1|X / f2|X & (f1/f2)|X = f1|X / f2 &(f1/f2)|X = f1 / f2|X; theorem (r(#)f)|X = r(#)(f|X); begin theorem (f1 is total & f2 is total iff f1+f2 is total) & (f1 is total & f2 is total iff f1-f2 is total) & (f1 is total & f2 is total iff f1(#)f2 is total); theorem f is total iff r(#)f is total; theorem f is total iff -f is total; theorem f is total iff |.f.| is total; theorem f^ is total iff f"{0} = {} & f is total; theorem f1 is total & f2"{0} = {} & f2 is total iff f1/f2 is total; theorem f1 is total & f2 is total implies (f1+f2)/.c = ((f1/.c)) + ((f2/.c)) & (f1-f2)/.c = ((f1/.c)) - ((f2/.c)) & (f1(#) f2)/.c = ((f1/.c)) * ((f2/.c)); theorem f is total implies (r(#)f)/.c = r * ((f/.c)); theorem f is total implies (-f)/.c = - (f/.c) & (|.f.|).c = |. (f/.c) .|; theorem f^ is total implies (f^)/.c = ((f/.c))"; theorem f1 is total & f2^ is total implies (f1/f2)/.c = ((f1/.c)) *(((f2/.c))) "; begin theorem f|Y is bounded iff ex p be real number st for c st c in Y /\ dom f holds |.(f/.c).|<= p; theorem Y c= X & f|X is bounded implies f|Y is bounded; theorem X misses dom f implies f|X is bounded; theorem f|Y is bounded implies (r(#)f)|Y is bounded; theorem |.f.||X is bounded_below; theorem f|Y is bounded implies |.f.||Y is bounded & (-f)|Y is bounded; theorem f1|X is bounded & f2|Y is bounded implies (f1+f2)|(X /\ Y) is bounded; theorem f1|X is bounded & f2|Y is bounded implies (f1(#)f2)|(X /\ Y) is bounded & (f1-f2)|(X /\ Y) is bounded; theorem f|X is bounded & f|Y is bounded implies f|(X \/ Y) is bounded; theorem f1|X is constant & f2|Y is constant implies (f1+f2)|(X /\ Y) is constant & (f1-f2)|(X /\ Y) is constant & (f1(#)f2)|(X /\ Y) is constant; theorem f|Y is constant implies (q(#)f)|Y is constant; theorem f|Y is constant implies |.f.||Y is constant & (-f)|Y is constant; theorem f|Y is constant implies f|Y is bounded; theorem f|Y is constant implies (for r holds (r(#)f)|Y is bounded) & (-f)|Y is bounded & |.f.||Y is bounded; theorem f1|X is bounded & f2|Y is constant implies (f1+f2)|(X /\ Y) is bounded; theorem f1|X is bounded & f2|Y is constant implies (f1-f2)|(X /\ Y) is bounded & (f2-f1)|(X /\ Y) is bounded & (f1(#)f2)|(X /\ Y) is bounded; theorem |.f.| is bounded iff f is bounded; begin reserve n,m,k for Element of NAT; reserve x, X,X1,Z,Z1 for set; reserve s,g,r,p,x0,x1,x2 for real number; reserve s1,s2,q1 for Real_Sequence; reserve Y for Subset of REAL; reserve f,f1,f2 for PartFunc of REAL,REAL; definition let f,x0; pred f is_continuous_in x0 means for s1 st rng s1 c= dom f & s1 is convergent & lim s1 = x0 holds f/*s1 is convergent & f.x0 = lim (f/*s1); end; theorem x0 in X & f is_continuous_in x0 implies f|X is_continuous_in x0; theorem f is_continuous_in x0 iff for s1 st rng s1 c= dom f & s1 is convergent & lim s1=x0 & (for n holds s1.n<>x0) holds f/*s1 is convergent & f.x0=lim(f/*s1 ); theorem f is_continuous_in x0 iff for r st 00 implies f^ is_continuous_in x0; theorem x0 in dom f2 & f1 is_continuous_in x0 & f1.x0<>0 & f2 is_continuous_in x0 implies f2/f1 is_continuous_in x0; theorem x0 in dom (f2*f1) & f1 is_continuous_in x0 & f2 is_continuous_in f1.x0 implies f2*f1 is_continuous_in x0; definition let f; attr f is continuous means for x0 st x0 in dom f holds f is_continuous_in x0; end; theorem for X,f st X c= dom f holds f|X is continuous iff for s1 st rng s1 c= X & s1 is convergent & lim s1 in X holds f/*s1 is convergent & f.(lim s1) = lim (f/*s1); theorem X c= dom f implies (f|X is continuous iff for x0,r st x0 in X & 0 continuous for PartFunc of REAL,REAL; end; registration cluster continuous for PartFunc of REAL,REAL; end; registration let f be continuous PartFunc of REAL,REAL, X be set; cluster f|X -> continuous for PartFunc of REAL,REAL; end; theorem f|X is continuous iff f|X|X is continuous; theorem f|X is continuous & X1 c= X implies f|X1 is continuous; registration cluster empty -> continuous for PartFunc of REAL,REAL; end; registration let f; let X be trivial set; cluster f|X -> continuous for PartFunc of REAL,REAL; end; theorem f|{x0} is continuous; registration let f1,f2 be continuous PartFunc of REAL,REAL; cluster f1+f2 -> continuous for PartFunc of REAL,REAL; cluster f1-f2 -> continuous for PartFunc of REAL,REAL; cluster f1(#)f2 -> continuous for PartFunc of REAL,REAL; end; theorem for X,f1,f2 st X c= dom f1 /\ dom f2 & f1|X is continuous & f2|X is continuous holds (f1+f2)|X is continuous & (f1-f2)|X is continuous & (f1(#) f2)|X is continuous; theorem for X,X1,f1,f2 st X c= dom f1 & X1 c= dom f2 & f1|X is continuous & f2 |X1 is continuous holds (f1+f2)|(X /\ X1) is continuous & (f1-f2)|(X /\ X1) is continuous & (f1(#)f2)|(X /\ X1) is continuous; registration let f be continuous PartFunc of REAL,REAL; let r; cluster r(#)f -> continuous for PartFunc of REAL,REAL; end; theorem for r,X,f st X c= dom f & f|X is continuous holds (r(#)f)|X is continuous; theorem X c= dom f & f|X is continuous implies (abs f)|X is continuous & (-f)| X is continuous; theorem f|X is continuous & f"{0} = {} implies f^|X is continuous; theorem f|X is continuous & (f|X)"{0} = {} implies f^|X is continuous; theorem X c= dom f1 /\ dom f2 & f1|X is continuous & f1"{0} = {} & f2|X is continuous implies (f2/f1)|X is continuous; registration let f1,f2 be continuous PartFunc of REAL,REAL; cluster f2*f1 -> continuous for PartFunc of REAL,REAL; end; theorem f1|X is continuous & f2|(f1.:X) is continuous implies (f2*f1)|X is continuous ; theorem f1|X is continuous & f2|X1 is continuous implies (f2*f1)|(X /\ (f1"X1) ) is continuous; theorem f is total & (for x1,x2 holds f.(x1+x2) = f.x1 + f.x2) & (ex x0 st f is_continuous_in x0) implies f|REAL is continuous; theorem for f st dom f is compact & f|dom f is continuous holds rng f is compact; theorem Y c= dom f & Y is compact & f|Y is continuous implies (f.:Y) is compact; theorem for f st dom f<>{} & (dom f) is compact & f|dom f is continuous ex x1,x2 st x1 in dom f & x2 in dom f & f.x1 = upper_bound (rng f) & f.x2 = lower_bound (rng f); theorem for f,Y st Y<>{} & Y c= dom f & Y is compact & f|Y is continuous ex x1 ,x2 st x1 in Y & x2 in Y & f.x1 = upper_bound (f.:Y) & f.x2 = lower_bound (f.:Y ); definition let f; attr f is Lipschitzian means ex r st 0 Lipschitzian for PartFunc of REAL,REAL; end; registration cluster empty for PartFunc of REAL,REAL; end; registration let f be Lipschitzian PartFunc of REAL,REAL, X be set; cluster f|X -> Lipschitzian for PartFunc of REAL,REAL; end; theorem f|X is Lipschitzian & X1 c= X implies f|X1 is Lipschitzian; registration let f1,f2 be Lipschitzian PartFunc of REAL,REAL; cluster f1+f2 -> Lipschitzian for PartFunc of REAL,REAL; cluster f1-f2 -> Lipschitzian for PartFunc of REAL,REAL; end; theorem f1|X is Lipschitzian & f2|X1 is Lipschitzian implies (f1+f2)|(X /\ X1) is Lipschitzian; theorem f1|X is Lipschitzian & f2|X1 is Lipschitzian implies (f1-f2)|(X /\ X1) is Lipschitzian; registration let f1,f2 be bounded Lipschitzian PartFunc of REAL,REAL; cluster f1 (#) f2 -> Lipschitzian for PartFunc of REAL,REAL; end; theorem f1|X is Lipschitzian & f2|X1 is Lipschitzian & f1|Z is bounded & f2|Z1 is bounded implies (f1(#)f2)|(X /\ Z /\ X1 /\ Z1) is Lipschitzian; registration let f be Lipschitzian PartFunc of REAL, REAL; let p; cluster p(#)f -> Lipschitzian for PartFunc of REAL, REAL; end; theorem f|X is Lipschitzian & X c= dom f implies (p(#)f)|X is Lipschitzian; registration let f be Lipschitzian PartFunc of REAL, REAL; cluster abs f -> Lipschitzian for PartFunc of REAL, REAL; end; theorem f|X is Lipschitzian implies -f|X is Lipschitzian & (abs f)|X is Lipschitzian; registration cluster constant -> Lipschitzian for PartFunc of REAL, REAL; end; registration let Y; cluster id Y -> Lipschitzian for PartFunc of REAL,REAL; end; registration cluster Lipschitzian -> continuous for PartFunc of REAL, REAL; end; theorem for f st (ex r st rng f = {r}) holds f is continuous; theorem for f st (for x0 st x0 in dom f holds f.x0 = x0) holds f is continuous; theorem (for x0 st x0 in X holds f.x0 = r*x0+p) implies f|X is continuous; theorem (for x0 st x0 in dom f holds f.x0 = x0^2) implies f|dom f is continuous; theorem X c= dom f & (for x0 st x0 in X holds f.x0 = x0^2) implies f|X is continuous; theorem (for x0 st x0 in dom f holds f.x0 = abs(x0)) implies f is continuous; theorem (for x0 st x0 in X holds f.x0 = abs(x0)) implies f|X is continuous; theorem f|X is monotone & (ex p,g st p<=g & f.:X=[.p,g.]) implies f|X is continuous; theorem for f being one-to-one PartFunc of REAL,REAL st p<=g & [.p,g.] c= dom f & (f|[.p,g.] is increasing or f|[.p,g.] is decreasing) holds (f|[.p,g.])"|(f .:[.p,g.]) is continuous; definition let a,b be real number; func AffineMap(a,b) -> Function of REAL, REAL means for x being real number holds it.x = a*x + b; end; registration let a,b be real number; cluster AffineMap(a,b) -> continuous; end; registration cluster continuous for Function of REAL, REAL; end; theorem for a,b being real number holds AffineMap(a,b).0 = b; theorem for a,b being real number holds AffineMap(a,b).1 = a+b; theorem for a,b being real number st a<> 0 holds AffineMap(a,b) is one-to-one; theorem for a,b,x,y being real number st a > 0 & x < y holds AffineMap(a,b).x < AffineMap(a,b).y; theorem for a,b,x,y being real number st a < 0 & x < y holds AffineMap(a,b).x > AffineMap(a,b).y; theorem for a,b,x,y being real number st a >= 0 & x <= y holds AffineMap (a,b).x <= AffineMap(a,b).y; theorem for a,b,x,y being real number st a <= 0 & x <= y holds AffineMap(a,b). x >= AffineMap(a,b).y; theorem for a,b being real number st a <> 0 holds rng AffineMap(a,b) = REAL; theorem for a,b being real number st a <> 0 holds (AffineMap(a,b) qua Function)" = AffineMap(a",-b/a); theorem for a,b being real number st a > 0 holds AffineMap(a,b).:[.0,1.] = [.b,a+b.]; begin reserve n,m for Element of NAT; reserve x, X,X1,Z,Z1 for set; reserve s,g,r,t,p,x0,x1,x2 for Real; reserve s1,s2,q1 for Real_Sequence; reserve Y for Subset of REAL; reserve f,f1,f2 for PartFunc of REAL,REAL; definition let f; attr f is uniformly_continuous means for r st 0 {} & Y c= dom f & Y is compact & f|Y is uniformly_continuous ex x1,x2 st x1 in Y & x2 in Y & f.x1 = upper_bound (f.:Y) & f.x2 = lower_bound (f.:Y); theorem X c= dom f & f|X is constant implies f|X is uniformly_continuous; theorem p<= g & [.p,g.] c= dom f & f|[.p,g.] is continuous implies for r st r in [.f.p,f.g.] \/ [.f.g,f.p.] ex s st s in [.p,g.] & r = f.s; theorem p<=g & [.p,g.] c= dom f & f|[.p,g.] is continuous implies for r st r in [.(lower_bound (f.:[.p,g.])),(upper_bound (f.:[.p,g.])).] ex s st s in [.p,g.] & r = f.s; theorem f is one-to-one & [.p,g.] c= dom f & p<=g & f|[.p,g.] is continuous implies f|[.p,g.] is increasing or f|[.p,g.] is decreasing; theorem f is one-to-one & p<=g & [.p,g.] c= dom f & f|[.p,g.] is continuous implies lower_bound (f.:[.p,g.])=f.p & upper_bound (f.:[.p,g.])=f.g or lower_bound (f.:[.p,g.])=f.g & upper_bound (f.:[.p,g.])=f.p; theorem p<=g & [.p,g.] c= dom f & f|[.p,g.] is continuous implies f.:[.p ,g.]=[.lower_bound (f.:[.p,g.]),upper_bound (f.:[.p,g.]).]; theorem for f be one-to-one PartFunc of REAL,REAL st p<=g & [.p,g.] c= dom f & f|[.p,g.] is continuous holds f"|[.lower_bound (f.:[.p,g.]),upper_bound (f.:[.p ,g.]).] is continuous; begin reserve y,X for set; reserve x,x0,x1,x2,g,g1,g2,r,r1,s,p,p1 for Real; reserve n,m,k for Element of NAT; reserve Y for Subset of REAL; reserve Z for open Subset of REAL; reserve s1,s3 for Real_Sequence; reserve f,f1,f2 for PartFunc of REAL,REAL; theorem (for r holds r in Y iff r in REAL) iff Y = REAL; definition let x be real number; let IT be Real_Sequence; attr IT is x-convergent means IT is convergent & lim IT = x; end; registration cluster 0-convergent non-zero for Real_Sequence; end; registration let f be 0-convergent Real_Sequence; cluster lim f -> empty; end; registration cluster 0-convergent -> convergent for Real_Sequence; end; reserve h for non-zero 0-convergent Real_Sequence; reserve c for constant Real_Sequence; definition let IT be PartFunc of REAL,REAL; attr IT is RestFunc-like means IT is total & for h holds (h")(#)(IT/*h) is convergent & lim ((h")(#)(IT/*h)) = 0; end; registration cluster RestFunc-like for PartFunc of REAL,REAL; end; definition mode RestFunc is RestFunc-like PartFunc of REAL,REAL; end; definition let IT be PartFunc of REAL,REAL; attr IT is linear means IT is total & ex r st for p holds IT.p = r*p; end; registration cluster linear for PartFunc of REAL,REAL; end; definition mode LinearFunc is linear PartFunc of REAL,REAL; end; reserve R,R1,R2 for RestFunc; reserve L,L1,L2 for LinearFunc; theorem L1+L2 is LinearFunc & L1-L2 is LinearFunc; theorem r(#)L is LinearFunc; theorem R1+R2 is RestFunc & R1-R2 is RestFunc & R1(#)R2 is RestFunc; theorem r(#)R is RestFunc; theorem L1(#)L2 is RestFunc-like; theorem R(#)L is RestFunc & L(#)R is RestFunc; definition let f; let x0 be real number; pred f is_differentiable_in x0 means ex N being Neighbourhood of x0 st N c= dom f & ex L,R st for x st x in N holds f.x - f.x0 = L.(x-x0) + R.(x-x0 ); end; definition let f; let x0 be real number; assume f is_differentiable_in x0; func diff(f,x0) -> Real means ex N being Neighbourhood of x0 st N c= dom f & ex L,R st it=L.1 & for x st x in N holds f.x-f.x0 = L.(x-x0) + R.(x-x0); end; definition let f,X; pred f is_differentiable_on X means X c= dom f & for x st x in X holds f|X is_differentiable_in x; end; theorem f is_differentiable_on X implies X is Subset of REAL; theorem f is_differentiable_on Z iff Z c= dom f & for x st x in Z holds f is_differentiable_in x; theorem f is_differentiable_on Y implies Y is open; definition let f,X; assume f is_differentiable_on X; func f`|X -> PartFunc of REAL,REAL means dom it = X & for x st x in X holds it.x = diff(f,x); end; theorem (Z c= dom f & ex r st rng f = {r}) implies f is_differentiable_on Z & for x st x in Z holds (f`|Z).x = 0; registration let h,n; cluster h^\n -> non-zero 0-convergent for Real_Sequence; end; theorem for x0 being real number for N being Neighbourhood of x0 st f is_differentiable_in x0 & N c= dom f holds for h,c st rng c = {x0} & rng (h+c) c= N holds h"(#)(f/*(h+c) - f/*c) is convergent & diff(f,x0) = lim (h"(#)(f/*(h +c) - f/*c)); theorem f1 is_differentiable_in x0 & f2 is_differentiable_in x0 implies f1+f2 is_differentiable_in x0 & diff(f1+f2,x0)=diff(f1,x0)+diff(f2,x0); theorem f1 is_differentiable_in x0 & f2 is_differentiable_in x0 implies f1-f2 is_differentiable_in x0 & diff(f1-f2,x0)=diff(f1,x0)-diff(f2,x0); theorem f is_differentiable_in x0 implies r(#)f is_differentiable_in x0 & diff((r(#)f),x0) = r*diff(f,x0); theorem f1 is_differentiable_in x0 & f2 is_differentiable_in x0 implies f1(#)f2 is_differentiable_in x0 & diff(f1(#)f2,x0)=(f2.x0)*diff(f1,x0)+(f1.x0)* diff(f2,x0); theorem Z c= dom f & f|Z = id Z implies f is_differentiable_on Z & for x st x in Z holds (f`|Z).x = 1; theorem Z c= dom (f1+f2) & f1 is_differentiable_on Z & f2 is_differentiable_on Z implies f1+f2 is_differentiable_on Z & for x st x in Z holds ((f1+f2)`|Z).x = diff(f1,x) + diff(f2,x); theorem Z c= dom (f1-f2) & f1 is_differentiable_on Z & f2 is_differentiable_on Z implies f1-f2 is_differentiable_on Z & for x st x in Z holds ((f1-f2)`|Z).x = diff(f1,x) - diff(f2,x); theorem Z c= dom (r(#)f) & f is_differentiable_on Z implies r(#)f is_differentiable_on Z & for x st x in Z holds ((r(#) f)`|Z).x =r*diff(f,x); theorem Z c= dom (f1(#)f2) & f1 is_differentiable_on Z & f2 is_differentiable_on Z implies f1(#)f2 is_differentiable_on Z & for x st x in Z holds ((f1(#)f2)`|Z).x = (f2.x)*diff(f1,x) + (f1.x)*diff(f2,x); theorem Z c= dom f & f|Z is constant implies f is_differentiable_on Z & for x st x in Z holds (f`|Z).x = 0; theorem Z c= dom f & (for x st x in Z holds f.x = r*x + p) implies f is_differentiable_on Z & for x st x in Z holds (f`|Z).x = r; theorem for x0 being real number holds f is_differentiable_in x0 implies f is_continuous_in x0; theorem f is_differentiable_on X implies f|X is continuous; theorem f is_differentiable_on X & Z c= X implies f is_differentiable_on Z; theorem ex R st R.0=0 & R is_continuous_in 0; definition let f be PartFunc of REAL, REAL; attr f is differentiable means f is_differentiable_on dom f; end; registration cluster differentiable for Function of REAL, REAL; end; theorem for f being differentiable PartFunc of REAL, REAL st Z c= dom f holds f is_differentiable_on Z; begin reserve y for set; reserve g,r,s,p,t,x,x0,x1,x2 for Real; reserve n,n1 for Element of NAT; reserve s1,s2,s3 for Real_Sequence; reserve f,f1,f2 for PartFunc of REAL,REAL; theorem for p,g st p0) ex s st 0 natural; end; reserve x for set; reserve a, b, c for real number; reserve m, n, m1, m2 for Element of NAT; reserve k, l for Integer; reserve p, q for Rational; reserve s1, s2 for Real_Sequence; theorem s1 is convergent & (for n holds s1.n>=a) implies lim s1 >= a; theorem s1 is convergent & (for n holds s1.n<=a) implies lim s1 <= a; definition let a be real number; func a GeoSeq -> Real_Sequence means for m holds it.m = a|^m; end; theorem s1 = a GeoSeq iff s1.0 = 1 & for m holds s1.(m+1) = s1.m * a; theorem for a st a <> 0 holds for m holds a GeoSeq.m <> 0; theorem for n being Nat holds 0 <> a implies 0 <> a |^ n; theorem for n being Nat holds 0 < a implies 0 < a |^ n; theorem for n being Nat holds (1/a) |^ n = 1 / a |^ n; theorem for n being Nat holds (b/a) |^ n = b |^ n / a |^ n; theorem for n being Nat st 0 < a & a <= b holds a |^ n <= b |^ n; theorem for n being Nat st 0 <= a & a < b & 1 <= n holds a |^ n < b |^ n; theorem for n being Nat holds a>=1 implies a |^ n >= 1; theorem for n being Nat st 1 <= a & 1 <= n holds a <= a |^ n; theorem for n being Nat st 1 < a & 2 <= n holds a < a |^ n; theorem for n being Nat st 0 < a & a <= 1 & 1 <= n holds a |^ n <= a; theorem for n being Nat st 0 < a & a < 1 & 2 <= n holds a |^ n < a; theorem for n being Nat holds -1 < a implies (1 + a) |^ n >= 1 + n * a; theorem for n being Nat st 0 < a & a < 1 holds (1 + a) |^ n <= 1 + 3 |^ n * a; theorem s1 is convergent & (for n holds s2.n = (s1.n) |^ m) implies s2 is convergent & lim s2 = (lim s1) |^ m; definition let n be Nat; let a be real number; assume 1 <= n; func n -Root a -> real number means it |^ n = a & it > 0 if a>0, it = 0 if a=0; end; definition let n; let a be Real; redefine func n -Root a -> Real; end; theorem for n being Nat st a>=0 & n>=1 holds (n -Root a) |^ n = a & n -Root (a |^ n) = a; theorem n>=1 implies n -Root 1 = 1; theorem a>=0 implies 1 -Root a = a; theorem a>=0 & b>=0 & n>=1 implies n -Root (a*b) = n -Root a * n -Root b; theorem a>0 & n>=1 implies n -Root (1/a) = 1/(n -Root a); theorem a>=0 & b>0 & n>=1 implies n -Root (a/b) = n -Root a / n -Root b; theorem a>=0 & n>=1 & m>=1 implies n -Root (m -Root a) = (n*m) -Root a; theorem a>=0 & n>=1 & m>=1 implies n -Root a * m -Root a = (n*m) -Root ( a |^ (n+m)); theorem 0<=a & a<=b & n>=1 implies n -Root a <= n -Root b; theorem a>=0 & a=1 implies n -Root a < n -Root b; theorem a>=1 & n>=1 implies n -Root a >= 1 & a >= n -Root a; theorem 0<=a & a<1 & n>=1 implies a <= n -Root a & n -Root a < 1; theorem a>0 & n>=1 implies n -Root a - 1 <= (a-1)/n; theorem a>=0 implies 2-Root a = sqrt a; theorem for s being Real_Sequence st a > 0 & (for n st n>=1 holds s.n = n -Root a) holds s is convergent & lim s = 1; definition let a be real number; let k; func a #Z k equals a |^ abs k if k >= 0, (a |^ abs k)" if k < 0; end; registration let a be real number; let k; cluster a #Z k -> real; end; definition let a be Real; let k; redefine func a #Z k -> Real; end; theorem a #Z 0 = 1; theorem a #Z 1 = a; theorem for n being Nat holds a #Z n = a |^ n; theorem 1 #Z k = 1; theorem a<>0 implies a #Z k <> 0; theorem a>0 implies a #Z k > 0; theorem (a*b) #Z k = a #Z k * b #Z k; theorem a #Z (-k) = 1/a #Z k; theorem (1/a) #Z k = 1/a #Z k; theorem for m,n being Nat holds a<>0 implies a #Z (m-n) = a |^ m / a |^ n; theorem a<>0 implies a #Z (k+l) = a #Z k * a #Z l; theorem a #Z k #Z l = a #Z (k*l); theorem a>0 & n>=1 implies (n -Root a) #Z k = n -Root (a #Z k); definition let a be real number; let p; func a #Q p equals (denominator p) -Root (a #Z numerator p); end; registration let a be real number; let p; cluster a #Q p -> real; end; definition let a be Real; let p; redefine func a #Q p -> Real; end; theorem p = 0 implies a #Q p = 1; theorem a > 0 & p = 1 implies a #Q p = a; theorem for n be Nat st 0 <= a holds a #Q n = a |^ n; theorem for n be Nat holds n>=1 & p = n" implies a #Q p = n -Root a; theorem 1 #Q p = 1; theorem a>0 implies a #Q p > 0; theorem a>0 implies a #Q p * a #Q q = a #Q (p+q); theorem a>0 implies 1 / a #Q p = a #Q (-p); theorem a>0 implies a #Q p / a #Q q = a #Q (p-q); theorem a>0 & b>0 implies (a*b) #Q p = a #Q p * b #Q p; theorem a>0 implies (1/a) #Q p = 1/a #Q p; theorem a>0 & b>0 implies (a/b) #Q p = a #Q p / b #Q p; theorem a > 0 implies a #Q p #Q q = a #Q (p*q); theorem a>=1 & p >= 0 implies a #Q p >= 1; theorem a>=1 & p<=0 implies a #Q p <= 1; theorem a>1 & p>0 implies a #Q p > 1; theorem a>=1 & p>=q implies a #Q p >= a #Q q; theorem a>1 & p>q implies a #Q p > a #Q q; theorem a>0 & a<1 & p>0 implies a #Q p < 1; theorem a>0 & a<=1 & p<=0 implies a #Q p >= 1; registration cluster RAT-valued for Real_Sequence; end; definition canceled; mode Rational_Sequence is RAT-valued Real_Sequence; end; theorem for a be real number ex s being Rational_Sequence st s is convergent & lim s = a & for n holds s.n<=a; theorem ex s being Rational_Sequence st s is convergent & lim s = a & for n holds s.n>=a; definition let a be real number; let s be Rational_Sequence; func a #Q s -> Real_Sequence means for n holds it.n = a #Q (s.n); end; theorem for s being Rational_Sequence st s is convergent & a>0 holds a #Q s is convergent; theorem for s1,s2 being Rational_Sequence, a st s1 is convergent & s2 is convergent & lim s1 = lim s2 & a>0 holds a #Q s1 is convergent & a #Q s2 is convergent & lim a #Q s1 = lim a #Q s2; definition let a,b be real number; assume a > 0; func a #R b -> real number means ex s being Rational_Sequence st s is convergent & lim s = b & a #Q s is convergent & lim a #Q s = it; end; definition let a,b be Real; redefine func a #R b -> Real; end; theorem a > 0 implies a #R 0 = 1; theorem a > 0 implies a #R 1 = a; theorem 1 #R a = 1; theorem a>0 implies a #R p = a #Q p; theorem a > 0 implies a #R (b+c) = a #R b * a #R c; theorem a > 0 implies a #R (-c) = 1 / a #R c; theorem a > 0 implies a #R (b-c) = a #R b / a #R c; theorem a > 0 & b > 0 implies (a * b) #R c = a #R c * b #R c; theorem a>0 implies (1/a) #R c = 1 / a #R c; theorem a > 0 & b > 0 implies (a/b) #R c = a #R c / b #R c; theorem a > 0 implies a #R b > 0; theorem a>=1 & c>=b implies a #R c >= a #R b; theorem a>1 & c>b implies a #R c > a #R b; theorem a>0 & a<=1 & c>=b implies a #R c <= a #R b; theorem a >= 1 & b >= 0 implies a #R b >= 1; theorem a > 1 & b > 0 implies a #R b > 1; theorem a >= 1 & b <= 0 implies a #R b <= 1; theorem a > 1 & b < 0 implies a #R b < 1; theorem s1 is convergent & s2 is convergent & lim s1 > 0 & (for n holds s1.n>0 & s2.n = (s1.n) #Q p) implies lim s2 = (lim s1) #Q p; theorem a>0 & s1 is convergent & s2 is convergent & (for n holds s2.n = a #R (s1.n)) implies lim s2 = a #R (lim s1); theorem a > 0 implies a #R b #R c = a #R (b * c); begin reserve r, u for real number, k for Nat; theorem r>0 & u > 0 implies ex k be Element of NAT st u/(2 |^ k) <= r; theorem k>=n & r >= 1 implies r |^ k >= r |^ n; theorem for n,m,l be Element of NAT st n divides m & n divides l holds n divides m-l; theorem m divides n iff m divides (n qua Integer); theorem m gcd n= m gcd abs(n-m); theorem for a,b be Integer st a>=0 & b>=0 holds a gcd b = a gcd (b-a); theorem a>=0 implies a #Z l >= 0; theorem a > 0 implies a #Q l = a #Z l; theorem l <> 0 implies 0 #Z l = 0; begin reserve i,j,k,n for Nat; theorem for i, n being Nat holds i <= n implies n - i + 1 is Element of NAT; theorem for i,n being Nat holds i in Seg n implies n - i + 1 in Seg n; theorem for f being Function, x,y being set st f"{y} = {x} holds x in dom f & y in rng f & f.x = y; theorem for f being Function holds f is one-to-one iff for x being set st x in dom f holds f"{f.x} = {x}; theorem for f being Function, y1,y2 being set st f is one-to-one & y1 in rng f & f"{y1} = f"{y2} holds y1 = y2; registration let x be set; cluster <*x*> -> trivial; let y be set; cluster <*x,y*> -> non trivial; end; registration cluster one-to-one non empty for FinSequence; end; theorem for f being non empty FinSequence holds 1 in dom f & len f in dom f; theorem for f being non empty FinSequence ex i being Nat st i+1 = len f; theorem for x being set, f being FinSequence holds len(<*x*>^f) = 1 + len f; theorem for f being FinSequence, p,q being set st p in rng f & q in rng f & p ..f = q..f holds p = q; theorem for f,g being FinSequence st n+1 in dom f & g = f|Seg n holds f| Seg(n+1) = g^<*f.(n+1)*>; theorem for f being one-to-one FinSequence st i in dom f holds (f.i)..f = i; reserve D for non empty set, p for Element of D, f,g for FinSequence of D; registration let D be non empty set; cluster one-to-one non empty for FinSequence of D; end; theorem dom f = dom g & (for i st i in dom f holds f/.i = g/.i) implies f = g; theorem len f = len g & (for k st 1 <= k & k <= len f holds f/.k = g/.k) implies f = g; theorem len f = 1 implies f = <*f/.1*>; theorem for D being non empty set, p being Element of D, f being FinSequence of D holds (<*p*>^f)/.1 = p; theorem for f being FinSequence, i being Nat holds len(f|i) <= len f; theorem for f being FinSequence, i being Nat holds len(f|i) <= i; theorem for f being FinSequence, i being Nat holds dom(f|i) c= dom f; theorem for f being FinSequence, i being Nat holds rng(f|i) c= rng f; theorem for D being set, f being FinSequence of D st f is non empty holds f|1 = <*f/.1*>; theorem i+1 = len f implies f = (f|i)^<*f/.len f*>; registration let i,D; let f be one-to-one FinSequence of D; cluster f|i -> one-to-one; end; theorem for D being set, f, g being FinSequence of D st i <= len f holds (f^g)|i = f|i; theorem for D being set, f, g being FinSequence of D holds (f^g)|(len f) = f; theorem for D being set, f being FinSequence of D st p in rng f holds (f-|p)^ <*p*> = f|(p..f); theorem len(f/^i) <= len f; reserve D for set, f for FinSequence of D; theorem i in dom(f/^n) implies n+i in dom f; theorem i in dom(f/^n) implies (f/^n)/.i = f/.(n+i); theorem f/^0 = f; reserve D for non empty set, p for Element of D, f,g for FinSequence of D; theorem f is non empty implies f = <*f/.1*>^(f/^1); theorem i+1 = len f implies f/^i = <*f/.len f*>; theorem j+1 = i & i in dom f implies <*f/.i*>^(f/^i) = f/^j; theorem for D being set, f being FinSequence of D holds len f <= i implies f/^i is empty; theorem rng(f/^n) c= rng f; registration let i,D; let f be one-to-one FinSequence of D; cluster f/^i -> one-to-one; end; theorem f is one-to-one implies rng(f|n) misses rng(f/^n); theorem p in rng f implies f |-- p = f/^(p..f); theorem (f^g)/^(len f + i) = g/^i; theorem (f^g)/^(len f) = g; theorem p in rng f implies f/.(p..f) = p; theorem i in dom f implies f/.i..f <= i; theorem p in rng(f|i) implies p..(f|i) = p..f; theorem i in dom f & f is one-to-one implies f/.i..f = i; definition let D, f; let p be set; func f-:p -> FinSequence of D equals f|(p..f); end; theorem p in rng f implies len(f-:p) = p..f; theorem p in rng f & i in Seg(p..f) implies (f-:p)/.i = f/.i; theorem p in rng f implies (f-:p)/.1 = f/.1; theorem p in rng f implies (f-:p)/.(p..f) = p; theorem for x being set holds x in rng f & p in rng f & x..f<=p..f implies x in rng(f-:p); theorem p in rng f implies f-:p is non empty; theorem rng(f-:p) c= rng f; registration let D,p; let f be one-to-one FinSequence of D; cluster f-:p -> one-to-one; end; definition let D, f, p; func f:-p -> FinSequence of D equals <*p*>^(f/^p..f); end; theorem p in rng f implies ex i being Element of NAT st i+1 = p..f & f:- p = f/^i; theorem p in rng f implies len (f:-p) = len f - p..f + 1; theorem p in rng f & j+1 in dom(f:-p) implies j+p..f in dom f; registration let D,p,f; cluster f:-p -> non empty; end; theorem p in rng f & j+1 in dom(f:-p) implies (f:-p)/.(j+1) = f/.(j+p..f ); theorem (f:-p)/.1 = p; theorem p in rng f implies (f:-p)/.(len(f:-p)) = f/.len f; theorem p in rng f implies rng(f:-p) c= rng f; theorem p in rng f & f is one-to-one implies f:-p is one-to-one; reserve i for Nat; definition let f be FinSequence; func Rev f -> FinSequence means len it = len f & for i st i in dom it holds it.i = f.(len f - i + 1); involutiveness; end; theorem for f being FinSequence holds dom f = dom Rev f & rng f = rng Rev f; theorem for f being FinSequence st i in dom f holds (Rev f).i = f.(len f - i + 1); theorem for f being FinSequence, i,j being Nat st i in dom f & i+j = len f + 1 holds j in dom Rev f; registration let f be empty FinSequence; cluster Rev f -> empty; end; theorem for x being set holds Rev <*x*> = <*x*>; theorem for x1,x2 being set holds Rev <*x1,x2*> = <*x2,x1*>; theorem for f being FinSequence holds f.1 = (Rev f).(len f) & f.(len f) = (Rev f).1; registration let f be one-to-one FinSequence; cluster Rev f -> one-to-one; end; theorem for f being FinSequence, x being set holds Rev(f^<*x*>) = <*x*>^ (Rev f); theorem for f,g being FinSequence holds Rev(f^g) = (Rev g)^(Rev f); definition let D be set, f be FinSequence of D; redefine func Rev f -> FinSequence of D; end; theorem f is non empty implies f/.1 = (Rev f)/.len f & f/.len f = (Rev f)/.1; theorem i in dom f & i+j = len f + 1 implies f/.i = (Rev f)/.j; definition let D,f,p; let n be Nat; func Ins(f,n,p) -> FinSequence of D equals (f|n)^<*p*>^(f/^n); end; theorem Ins(f,0,p) = <*p*>^f; theorem len f <= n implies Ins(f,n,p) = f^<*p*>; theorem len(Ins(f,n,p)) = len f + 1; theorem rng Ins(f,n,p) = {p} \/ rng f; registration let D,f,n,p; cluster Ins(f,n,p) -> non empty; end; theorem p in rng Ins(f,n,p); theorem i in dom(f|n) implies (Ins(f,n,p))/.i = f/.i; theorem n <= len f implies (Ins(f,n,p))/.(n+1) = p; theorem n+1 <= i & i <= len f implies (Ins(f,n,p))/.(i+1) = f/.i; theorem 1 <= n & f is non empty implies (Ins(f,n,p))/.1 = f/.1; theorem f is one-to-one & not p in rng f implies Ins(f,n,p) is one-to-one; begin theorem for i1,i2 be Nat st i1<=i2 holds (f|i1)|i2=f|i1 & (f|i2)|i1=f|i1; theorem for i be Nat holds (<*>D)|i=<*>D; theorem Rev <*>D = <*>D; registration cluster non trivial for FinSequence; end; theorem for f being FinSequence of D,l1,l2 being Nat holds (f/^l1)|(l2-'l1)=(f |l2)/^l1; reserve D for set, f for FinSequence of D; theorem len f >= 2 implies f|2 = <*f/.1,f/.2*>; theorem k+1 <= len f implies f|(k+1) = f|k^<*f/.(k+1)*>; theorem for D being set, p be FinSequence of D for i be Nat st i < len p holds p|(i+1) = p|i ^ <*p.(i+1)*>; theorem for D be non empty set for p be FinSequence of D for n be Nat st 1 <= n & n <= len p holds p = (p|(n-'1))^<*p.n*>^(p/^n); begin definition let p,q be FinSequence; func p$^q -> FinSequence means it = p^q if p = {} or q = {} otherwise ex i being Element of NAT, r being FinSequence st len p = i+1 & r = p|Seg i & it = r^q; end; reserve p,q,r for FinSequence, x,y for set; theorem {}$^p = p & p$^{} = p; theorem q <> {} implies (p^<*x*>)$^q = p^q; theorem (p^<*x*>)$^(<*y*>^q) = p^<*y*>^q; theorem q <> {} implies <*x*>$^q = q; theorem p <> {} implies ex x,q st p = <*x*>^q & len p = len q+1; scheme PathCatenation {P[set,set], p,q() -> FinSequence}: for i being Element of NAT st i in dom (p()$^q()) & i+1 in dom (p()$^q()) for x,y being set st x = (p( )$^q()).i & y = (p()$^q()).(i+1) holds P[x,y] provided for i being Element of NAT st i in dom p() & i+1 in dom p() holds P[ p().i, p().(i+1)] and for i being Element of NAT st i in dom q() & i+1 in dom q() holds P[ q().i, q().(i+1)] and len p() > 0 & len q() > 0 & p().len p() = q().1; definition let R be Relation; mode RedSequence of R -> FinSequence means len it > 0 & for i being Element of NAT st i in dom it & i+1 in dom it holds [it.i, it.(i+1)] in R; end; registration let R be Relation; cluster -> non empty for RedSequence of R; end; theorem for R being Relation, a being set holds <*a*> is RedSequence of R; theorem for R being Relation, a,b being set st [a,b] in R holds <*a,b*> is RedSequence of R; theorem for R being Relation, p,q being RedSequence of R st p.len p = q.1 holds p$^q is RedSequence of R; theorem for R being Relation, p being RedSequence of R holds Rev p is RedSequence of R~; theorem for R,Q being Relation st R c= Q for p being RedSequence of R holds p is RedSequence of Q; begin definition let R be Relation; let a,b be set; pred R reduces a,b means ex p being RedSequence of R st p.1 = a & p. len p = b; end; definition let R be Relation; let a,b be set; pred a,b are_convertible_wrt R means R \/ R~ reduces a,b; end; theorem for R being Relation, a,b being set holds R reduces a,b iff ex p being FinSequence st len p > 0 & p.1 = a & p.len p = b & for i being Element of NAT st i in dom p & i+1 in dom p holds [p.i, p.(i+1)] in R; theorem for R being Relation, a being set holds R reduces a,a; theorem for a,b being set st {} reduces a,b holds a = b; theorem for R being Relation, a,b being set st R reduces a,b & not a in field R holds a = b; theorem for R being Relation, a,b being set st [a,b] in R holds R reduces a,b; theorem for R being Relation, a,b,c being set st R reduces a,b & R reduces b,c holds R reduces a,c; theorem for R being Relation, p being RedSequence of R, i,j being Element of NAT st i in dom p & j in dom p & i <= j holds R reduces p.i,p.j; theorem for R being Relation, a,b being set st R reduces a,b & a <> b holds a in field R & b in field R; theorem for R being Relation, a,b being set st R reduces a,b holds a in field R iff b in field R; theorem for R being Relation, a,b being set holds R reduces a,b iff a = b or [a,b] in R[*]; theorem for R being Relation, a,b being set holds R reduces a,b iff R[*] reduces a,b; theorem for R,Q being Relation st R c= Q for a,b being set st R reduces a,b holds Q reduces a,b; theorem for R being Relation, X being set, a,b being set holds R reduces a,b iff R \/ id X reduces a,b; theorem for R being Relation, a,b being set st R reduces a,b holds R~ reduces b,a; theorem for R being Relation, a,b being set st R reduces a,b holds a,b are_convertible_wrt R & b,a are_convertible_wrt R; theorem for R being Relation, a being set holds a,a are_convertible_wrt R; theorem for a,b being set st a,b are_convertible_wrt {} holds a = b; theorem for R being Relation, a,b being set st a,b are_convertible_wrt R & not a in field R holds a = b; theorem for R being Relation, a,b being set st [a,b] in R holds a,b are_convertible_wrt R; theorem for R being Relation, a,b,c being set st a,b are_convertible_wrt R & b,c are_convertible_wrt R holds a,c are_convertible_wrt R; theorem for R being Relation, a,b being set st a,b are_convertible_wrt R holds b,a are_convertible_wrt R; theorem for R being Relation, a,b being set st a,b are_convertible_wrt R & a <> b holds a in field R & b in field R; definition let R be Relation; let a be set; pred a is_a_normal_form_wrt R means not ex b being set st [a,b] in R; end; theorem for R being Relation, a,b being set st a is_a_normal_form_wrt R & R reduces a,b holds a = b; theorem for R being Relation, a being set st not a in field R holds a is_a_normal_form_wrt R; definition let R be Relation; let a,b be set; pred b is_a_normal_form_of a,R means b is_a_normal_form_wrt R & R reduces a,b; pred a,b are_convergent_wrt R means ex c being set st R reduces a,c & R reduces b,c; pred a,b are_divergent_wrt R means ex c being set st R reduces c,a & R reduces c,b; pred a,b are_convergent<=1_wrt R means ex c being set st ([a,c] in R or a = c) & ([b,c] in R or b = c); pred a,b are_divergent<=1_wrt R means ex c being set st ([c,a] in R or a = c) & ([c,b] in R or b = c); end; theorem for R being Relation, a being set st not a in field R holds a is_a_normal_form_of a,R; theorem for R being Relation, a,b being set st R reduces a,b holds a,b are_convergent_wrt R & a,b are_divergent_wrt R & b,a are_convergent_wrt R & b,a are_divergent_wrt R; theorem for R being Relation, a,b being set st a,b are_convergent_wrt R or a,b are_divergent_wrt R holds a,b are_convertible_wrt R; theorem for R being Relation, a being set holds a,a are_convergent_wrt R & a,a are_divergent_wrt R; theorem for a,b being set st a,b are_convergent_wrt {} or a,b are_divergent_wrt {} holds a = b; theorem for R being Relation, a,b being set st a,b are_convergent_wrt R holds b,a are_convergent_wrt R; theorem for R being Relation, a,b being set st a,b are_divergent_wrt R holds b ,a are_divergent_wrt R; theorem for R being Relation, a,b,c being set st R reduces a,b & b,c are_convergent_wrt R or a,b are_convergent_wrt R & R reduces c,b holds a,c are_convergent_wrt R; theorem for R being Relation, a,b,c being set st R reduces b,a & b,c are_divergent_wrt R or a,b are_divergent_wrt R & R reduces b,c holds a,c are_divergent_wrt R; theorem for R being Relation, a,b being set st a,b are_convergent<=1_wrt R holds a,b are_convergent_wrt R; theorem for R being Relation, a,b being set st a,b are_divergent<=1_wrt R holds a,b are_divergent_wrt R; definition let R be Relation; let a be set; pred a has_a_normal_form_wrt R means ex b being set st b is_a_normal_form_of a,R; end; theorem for R being Relation, a being set st not a in field R holds a has_a_normal_form_wrt R; definition let R be Relation, a be set; assume that a has_a_normal_form_wrt R and for b,c being set st b is_a_normal_form_of a,R & c is_a_normal_form_of a,R holds b = c; func nf(a,R) means it is_a_normal_form_of a,R; end; begin definition let R be Relation; attr R is co-well_founded means R~ is well_founded; attr R is weakly-normalizing means for a being set st a in field R holds a has_a_normal_form_wrt R; attr R is strongly-normalizing means for f being ManySortedSet of NAT ex i being Element of NAT st not [f.i,f.(i+1)] in R; end; definition let R be Relation; redefine attr R is co-well_founded means for Y being set st Y c= field R & Y <> {} ex a being set st a in Y & for b being set st b in Y & a <> b holds not [a,b] in R; end; scheme coNoetherianInduction{R() -> Relation, P[set]}: for a being set st a in field R() holds P[a] provided R() is co-well_founded and for a being set st for b being set st [a,b] in R() & a <> b holds P[ b] holds P[a]; registration cluster strongly-normalizing -> irreflexive co-well_founded for Relation; cluster co-well_founded irreflexive -> strongly-normalizing for Relation; end; registration cluster empty -> weakly-normalizing strongly-normalizing for Relation; end; theorem for Q being co-well_founded Relation, R being Relation st R c= Q holds R is co-well_founded; registration cluster strongly-normalizing -> weakly-normalizing for Relation; end; begin definition let R,Q be Relation; pred R commutes-weakly_with Q means for a,b,c being set st [a,b] in R & [a,c ] in Q ex d being set st Q reduces b,d & R reduces c,d; symmetry; pred R commutes_with Q means for a,b,c being set st R reduces a,b & Q reduces a,c ex d being set st Q reduces b,d & R reduces c,d; symmetry; end; theorem for R,Q being Relation st R commutes_with Q holds R commutes-weakly_with Q; definition let R be Relation; attr R is with_UN_property means for a,b being set st a is_a_normal_form_wrt R & b is_a_normal_form_wrt R & a,b are_convertible_wrt R holds a = b; attr R is with_NF_property means for a,b being set st a is_a_normal_form_wrt R & a,b are_convertible_wrt R holds R reduces b,a; attr R is subcommutative means for a,b,c being set st [a,b] in R & [a,c] in R holds b,c are_convergent<=1_wrt R; attr R is confluent means for a,b being set st a,b are_divergent_wrt R holds a,b are_convergent_wrt R; attr R is with_Church-Rosser_property means for a,b being set st a, b are_convertible_wrt R holds a,b are_convergent_wrt R; attr R is locally-confluent means for a,b,c being set st [a,b] in R & [a,c] in R holds b,c are_convergent_wrt R; end; theorem for R being Relation st R is subcommutative for a,b,c being set st R reduces a,b & [a,c] in R holds b,c are_convergent_wrt R; theorem for R being Relation holds R is confluent iff R commutes_with R; theorem for R being Relation holds R is confluent iff for a,b,c being set st R reduces a,b & [a,c] in R holds b,c are_convergent_wrt R; theorem for R being Relation holds R is locally-confluent iff R commutes-weakly_with R; registration cluster with_Church-Rosser_property -> confluent for Relation; cluster confluent -> locally-confluent with_Church-Rosser_property for Relation; cluster subcommutative -> confluent for Relation; cluster with_Church-Rosser_property -> with_NF_property for Relation; cluster with_NF_property -> with_UN_property for Relation; cluster with_UN_property weakly-normalizing -> with_Church-Rosser_property for Relation; end; registration cluster empty -> subcommutative for Relation; end; theorem for R being with_UN_property Relation for a,b,c being set st b is_a_normal_form_of a,R & c is_a_normal_form_of a,R holds b = c; theorem for R being with_UN_property weakly-normalizing Relation for a being set holds nf(a,R) is_a_normal_form_of a,R; theorem for R being with_UN_property weakly-normalizing Relation for a,b being set st a,b are_convertible_wrt R holds nf(a,R) = nf(b,R); registration cluster strongly-normalizing locally-confluent -> confluent for Relation; end; definition let R be Relation; attr R is complete means R is confluent strongly-normalizing; end; registration cluster complete -> confluent strongly-normalizing for Relation; cluster confluent strongly-normalizing -> complete for Relation; end; registration cluster complete for non empty Relation; end; theorem for R,Q being with_Church-Rosser_property Relation st R commutes_with Q holds R \/ Q is with_Church-Rosser_property; theorem for R being Relation holds R is confluent iff R[*] is locally-confluent; theorem for R being Relation holds R is confluent iff R[*] is subcommutative; begin definition let R,Q be Relation; pred R,Q are_equivalent means for a,b being set holds a,b are_convertible_wrt R iff a,b are_convertible_wrt Q; symmetry; end; definition let R be Relation; let a,b be set; pred a,b are_critical_wrt R means a,b are_divergent<=1_wrt R & not a,b are_convergent_wrt R; end; theorem for R being Relation, a,b being set st a,b are_critical_wrt R holds a,b are_convertible_wrt R; theorem for R being Relation st not ex a,b being set st a,b are_critical_wrt R holds R is locally-confluent; theorem for R,Q being Relation st for a,b being set st [a,b] in Q holds a,b are_critical_wrt R holds R, R \/ Q are_equivalent; theorem for R being Relation ex Q being complete Relation st field Q c= field R & for a,b being set holds a,b are_convertible_wrt R iff a,b are_convergent_wrt Q; definition let R be Relation; mode Completion of R -> complete Relation means for a,b being set holds a,b are_convertible_wrt R iff a,b are_convergent_wrt it; end; theorem for R being Relation, C being Completion of R holds R,C are_equivalent; theorem for R being Relation, Q being complete Relation st R,Q are_equivalent holds Q is Completion of R; theorem for R being Relation, C being Completion of R, a,b being set holds a,b are_convertible_wrt R iff nf(a,C) = nf(b,C); begin reserve a,x,y,A,B for set, l,m,n for Element of NAT; theorem for f being Function, X being set st rng f c= X holds (id X)*f = f; theorem for X being set, Y being non empty set, f being Function of X,Y st f is one-to-one for B being Subset of X, C being Subset of Y st C c= f.:B holds f "C c= B; theorem for X,Y be non empty set, f being Function of X,Y st f is one-to-one for x being Element of X, A being Subset of X st f.x in f.:A holds x in A; theorem for X,Y be non empty set, f being Function of X,Y st f is one-to-one for x being Element of X, A being Subset of X, B being Subset of Y st f.x in f.:A \ B holds x in A \ f"B; theorem for X,Y be non empty set, f being Function of X,Y st f is one-to-one for y being Element of Y, A being Subset of X, B being Subset of Y st y in f.:A \ B holds f".y in A \ f"B; theorem for f being Function, a being set st a in dom f holds f|{a} = a .--> f.a; registration let x,y be set; cluster x .--> y -> non empty; end; registration let x,y,a,b be set; cluster (x,y) --> (a,b) -> non empty; end; theorem for I being set, M being ManySortedSet of I for i being set st i in I holds i.--> (M.i) = M|{i}; theorem for I,J being set, M being ManySortedSet of [:I,J:] for i,j being set st i in I & j in J holds (i,j):-> (M.(i,j)) = M|([:{i},{j}:] qua set); theorem for f,g,h being Function st rng h c= dom f holds f*(g +* h) = (f *g) +* (f*h); theorem for f,g,h being Function holds (g +* h)*f = (g*f) +* (h*f); theorem for f,g,h being Function st rng f misses dom g holds (h +* g)*f = h*f; theorem for A,B be set, y be set st A meets rng(id B +* (A --> y)) holds y in A; theorem for x,y be set, A be set st x <> y holds not x in rng(id A +* (x .--> y)); theorem for X being set, a being set, f being Function st dom f = X \/ {a} holds f = f|X +* (a .--> f.a); theorem for f being Function, X,y,z being set holds (f+*(X-->y))+*(X-->z) = f +*(X-->z); theorem INT <> INT*; theorem {}* = {{}}; theorem <*x*> in A* iff x in A; theorem A* c= B* implies A c= B; theorem for A being Subset of NAT st for n,m st n in A & m < n holds m in A holds A is Cardinal; theorem for A being finite set, X being non empty Subset-Family of A ex C being Element of X st for B being Element of X holds B c= C implies B = C; theorem for p,q being FinSequence st len p = len q+1 for i being Element of NAT holds i in dom q iff i in dom p & i+1 in dom p; registration cluster Function-yielding non empty non-empty for FinSequence; end; registration cluster empty -> Function-yielding for Function; let f be Function; cluster <*f*> -> Function-yielding; let g be Function; cluster <*f,g*> -> Function-yielding; let h be Function; cluster <*f,g,h*> -> Function-yielding; end; registration let n be Element of NAT, f be Function; cluster n |-> f -> Function-yielding; end; registration let p,q be Function-yielding FinSequence; cluster p^q -> Function-yielding; end; theorem for p,q being FinSequence st p^q is Function-yielding holds p is Function-yielding & q is Function-yielding; begin scheme Kappa2D{ X,Y,Z()->non empty set,F(Element of X(),Element of Y())->set}: ex f being Function of [:X(),Y():], Z() st for x being Element of X(), y being Element of Y() holds f.(x,y)=F(x,y) provided for x being Element of X(), y being Element of Y() holds F(x,y) in Z (); scheme FinMono{ A() -> set, D() -> non empty set, F,G(set) -> set }: { F(d) where d is Element of D() : G(d) in A() } is finite provided A() is finite and for d1,d2 being Element of D() st G(d1) = G(d2) holds d1 = d2; scheme CardMono{ A() -> set, D() -> non empty set, G(set) -> set }: A(),{ d where d is Element of D() : G(d) in A() } are_equipotent provided for x being set st x in A() ex d being Element of D() st x = G(d) and for d1,d2 being Element of D() st G(d1) = G(d2) holds d1 = d2; scheme CardMono9{ A() -> set, D() -> non empty set, G(set) -> set }: A(),{ G(d) where d is Element of D() : d in A() } are_equipotent provided A() c= D() and for d1,d2 being Element of D() st G(d1) = G(d2) holds d1 = d2; scheme FuncSeqInd {P[set]}: for p being Function-yielding FinSequence holds P[p] provided P[ {} ] and for p being Function-yielding FinSequence st P[p] for f being Function holds P[p^<*f*>]; begin definition let x, y be set; assume x in y; func In (x, y) -> Element of y equals x; end; theorem x in A /\ B implies In (x,A) = In (x,B); definition let f,g be Function; let A be set; pred f,g equal_outside A means f|(dom f \ A) = g|(dom g \ A); end; theorem for f be Function, A be set holds f,f equal_outside A; theorem for f,g be Function, A be set st f,g equal_outside A holds g,f equal_outside A; theorem for f,g,h be Function, A be set st f,g equal_outside A & g,h equal_outside A holds f,h equal_outside A; theorem for f,g be Function, A be set st f,g equal_outside A holds dom f \ A = dom g \ A; theorem for f,g being Function, A be set st dom g c= A holds f, f +* g equal_outside A; definition let f be Function, i, x be set; func f+*(i,x) -> Function equals f+*(i.-->x) if i in dom f otherwise f; end; theorem for f be Function, d,i be set holds dom(f+*(i,d)) = dom f; theorem for f be Function, d,i be set st i in dom f holds (f+*(i,d)).i = d; theorem for f be Function, d,i,j be set st i <> j holds (f+*(i,d)).j = f.j; theorem for f be Function, d,e,i,j be set st i <> j holds f+*(i,d)+*(j,e) = f +*(j,e)+*(i,d); theorem for f be Function, d,e,i be set holds f+*(i,d)+*(i,e) = f+*(i,e); theorem for f be Function, i be set holds f+*(i,f.i) = f; registration let f be FinSequence, i,x be set; cluster f+*(i,x) -> FinSequence-like; end; definition let D be set, f be FinSequence of D, i be Element of NAT, d be Element of D; redefine func f+*(i,d) -> FinSequence of D; end; theorem for D be non empty set, f be FinSequence of D, d be Element of D, i be Element of NAT st i in dom f holds (f+*(i,d))/.i = d; theorem for D be non empty set, f be FinSequence of D, d be Element of D, i,j be Element of NAT st i <> j & j in dom f holds (f+*(i,d))/.j = f/.j; theorem for D be non empty set, f be FinSequence of D, d,e be Element of D, i be Element of NAT holds f+*(i,f/.i) = f; begin definition let X be set; let p be Function-yielding FinSequence; func compose(p,X) -> Function means ex f being ManySortedFunction of NAT st it = f.len p & f.0 = id X & for i being Element of NAT st i+1 in dom p for g,h being Function st g = f.i & h = p.(i+1) holds f.(i+1) = h*g; end; definition let p be Function-yielding FinSequence; let x be set; func apply(p,x) -> FinSequence means len it = len p+1 & it.1 = x & for i being Element of NAT, f being Function st i in dom p & f = p.i holds it.( i+1) = f.(it.i); end; reserve X,Y,x for set, p,q for Function-yielding FinSequence, f,g,h for Function; theorem compose({},X) = id X; theorem apply({},x) = <*x*>; theorem compose(p^<*f*>,X) = f*compose(p,X); theorem apply(p^<*f*>,x) = apply(p,x)^<*f.(apply(p,x).(len p+1))*>; theorem compose(<*f*>^p,X) = compose(p,f.:X)*(f|X); theorem apply(<*f*>^p,x) = <*x*>^apply(p,f.x); theorem compose(<*f*>,X) = f*id X; theorem dom f c= X implies compose(<*f*>,X) = f; theorem apply(<*f*>,x) = <*x,f.x*>; theorem rng compose(p,X) c= Y implies compose(p^q,X) = compose(q,Y)*compose(p, X ); theorem apply(p^q,x).(len (p^q)+1) = apply(q,apply(p,x).(len p+1)).(len q+1); theorem apply(p^q,x) = apply(p,x)$^apply(q,apply(p,x).(len p+1)); theorem compose(<*f,g*>,X) = g*f*id X; theorem dom f c= X or dom(g*f) c= X implies compose(<*f,g*>,X) = g*f; theorem apply(<*f,g*>,x) = <*x,f.x,g.(f.x)*>; theorem compose(<*f,g,h*>,X) = h*g*f*id X; theorem dom f c= X or dom(g*f) c= X or dom(h*g*f) c= X implies compose(<*f,g,h *>,X) = h*g*f; theorem apply(<*f,g,h*>,x) = <*x*>^<*f.x,g.(f.x),h.(g.(f.x))*>; definition let F be FinSequence; func firstdom F means it is empty if F is empty otherwise it = proj1 (F.1); func lastrng F means it is empty if F is empty otherwise it = proj2 (F.len F); end; theorem firstdom {} = {} & lastrng {} = {}; theorem for p being FinSequence holds firstdom (<*f*>^p) = dom f & lastrng (p^<*f*>) = rng f; theorem for p being Function-yielding FinSequence st p <> {} holds rng compose(p,X) c= lastrng p; definition let IT be FinSequence; attr IT is FuncSeq-like means ex p being FinSequence st len p = len IT+1 & for i being Element of NAT st i in dom IT holds IT.i in Funcs(p.i, p.(i+ 1)); end; theorem for p,q being FinSequence st p^q is FuncSeq-like holds p is FuncSeq-like & q is FuncSeq-like; registration cluster FuncSeq-like -> Function-yielding for FinSequence; end; registration cluster empty -> FuncSeq-like for FinSequence; end; registration let f be Function; cluster <*f*> -> FuncSeq-like; end; registration cluster FuncSeq-like non empty non-empty for FinSequence; end; definition mode FuncSequence is FuncSeq-like FinSequence; end; theorem for p being FuncSequence st p <> {} holds dom compose(p,X) = ( firstdom p) /\ X; theorem for p being FuncSequence holds dom compose(p,firstdom p) = firstdom p; theorem for p being FuncSequence, f being Function st rng f c= firstdom p holds <*f*>^p is FuncSequence; theorem for p being FuncSequence, f being Function st lastrng p c= dom f holds p^<*f*> is FuncSequence; theorem for p being FuncSequence st x in firstdom p & x in X holds apply(p,x). (len p+1) = compose(p,X).x; definition let X,Y be set such that Y is empty implies X is empty; mode FuncSequence of X,Y -> FuncSequence means firstdom it = X & lastrng it c= Y; end; definition let Y be non empty set, X be set; let F be FuncSequence of X,Y; redefine func compose(F,X) -> Function of X,Y; end; definition let q be non-empty non empty FinSequence; mode FuncSequence of q -> FinSequence means len it+1 = len q & for i being Element of NAT st i in dom it holds it.i in Funcs(q.i,q.(i+1)); end; registration let q be non-empty non empty FinSequence; cluster -> FuncSeq-like non-empty for FuncSequence of q; end; theorem for q being non-empty non empty FinSequence, p being FuncSequence of q st p <> {} holds firstdom p = q.1 & lastrng p c= q.len q; theorem for q being non-empty non empty FinSequence, p being FuncSequence of q holds dom compose(p,q.1) = q.1 & rng compose(p,q.1) c= q.len q; registration let X be set; let f be Function of NAT, bool [:X,X:]; let n be Nat; cluster f.n -> Relation-like; end; definition let f be Relation; let n be Nat; func iter (f,n) -> Relation means ex p being Function of NAT, bool [:field f,field f:] st it = p.n & p.0 = id(field f) & for k being Nat holds p.(k+1) = f*(p.k); end; registration let f be Function; let n be Nat; cluster iter (f,n) -> Function-like; end; reserve m,n,k for Element of NAT, R for Relation; theorem iter (R,0) = id(field R); theorem for n be Nat holds iter(R,n+1) = R*iter(R,n); theorem iter(R,1) = R; theorem for n being Nat holds iter(R,n+1) = iter(R,n)*R; theorem dom iter(R,n) c= field R & rng iter(R,n) c= field R; theorem n <> 0 implies dom iter(R,n) c= dom R & rng iter(R,n) c= rng R; theorem for n being Nat st rng R c= dom R holds dom iter(R,n) = dom R & rng iter(R,n) c= dom R; theorem id(field R)*iter(R,n) = iter(R,n); theorem iter(R,n)*id(field R) = iter(R,n); theorem iter(R,m)*iter(R,n) = iter(R,n+m); theorem n <> 0 implies iter(iter(R,m),n) = iter(R,m*n); theorem rng R c= dom R implies iter(iter(R,m),n) = iter(R,m*n); theorem iter({},n) = {}; theorem iter(id(X),n) = id(X); theorem rng R misses dom R implies iter(R,2) = {}; theorem for n being Nat for f being Function of X,X holds iter(f,n) is Function of X,X; theorem for f being Function of X,X holds iter(f,0) = id X; theorem for f being Function of X,X holds iter(iter(f,m),n) = iter(f,m*n); theorem for f being PartFunc of X,X holds iter(f,n) is PartFunc of X,X; theorem n <> 0 & a in X & f = X --> a implies iter(f,n) = f; theorem for f being Function, n being Element of NAT holds iter(f,n) = compose (n|->f,field f); begin theorem for f,g being Function, x,y being set st g c= f & not x in dom g holds g c= f+*(x,y); theorem for f,g being Function, A being set st f|A = g|A & f,g equal_outside A holds f = g; theorem for f being Function, a,b,A being set st a in A holds f,f+*(a,b) equal_outside A; theorem for f being Function, a,b,A being set holds a in A or (f+*(a,b)) |A = f|A; theorem for f,g being Function, a,b,A being set st f|A = g|A holds (f+*(a,b))| A = (g+*(a,b))|A; theorem for f being Function, a, b being set holds (f +* (a .--> b)).a = b; theorem for a, b being set holds <*a*> +* (1,b) = <*b*>; theorem for f be Function, x be set st x in dom f holds f +* (x .--> f.x) = f; reserve i for Nat; reserve j for Element of NAT; theorem for w being FinSequence,r being set,i holds len (w+*(i,r))=len w; theorem for D being non empty set, w being FinSequence of D, r being Element of D st i in dom w holds w+*(i,r)=(w|(i-'1))^<*r*>^(w/^i); reserve F for Function, e,x,y,z for set; definition let F; let x,y; func Swap(F,x,y) equals F+*(x,F.y)+*(y,F.x) if x in dom F & y in dom F otherwise F; end; registration let F; let x,y; cluster Swap(F,x,y) -> Relation-like Function-like; end; theorem dom Swap(F,x,y) = dom F; theorem rng(F+*(x,y)) c= rng F \/ {y}; theorem rng F c= rng(F+*(x,y)) \/ {F.x}; theorem x in dom F implies y in rng(F+*(x,y)); theorem rng Swap(F,x,y) = rng F; scheme { A() -> set, D() -> non empty set, G(set) -> set }: A(),{ G(d) where d is Element of D() : d in A() } are_equipotent provided A() c= D() and for d1,d2 being Element of D() st d1 in A() & d2 in A() & G(d1) = G( d2) holds d1 = d2; theorem for f,g,h being Function, A being set holds f, g equal_outside A implies f +* h, g +* h equal_outside A; theorem for f,g,h being Function, A being set holds f, g equal_outside A implies h +* f, h +* g equal_outside A; theorem for f,g,h being Function holds f +* h = g +* h iff f,g equal_outside dom h; theorem for x, y, a being set, f being Function st f.x = f.y holds f.a = (f*((id dom f)+*(x,y))).a; theorem for x, y being set, f being Function st x in dom f implies y in dom f & f.x = f.y holds f = f*((id dom f)+*(x,y)); theorem for f be Function, x be set st x in dom f holds f +* (x .--> f.x) = f; theorem for X being set, p being Permutation of X, x, y being Element of X holds p+*(x, p.y)+*(y, p.x) is Permutation of X; theorem for f being Function, x, y being set st x in dom f & y in dom f ex p being Permutation of dom f st f+*(x, f.y)+*(y, f.x) = f*p; theorem for f be Function,d,r be set st d in dom f holds dom f=dom (f+*(d.-->r )); theorem for f,g be FinSequence of INT,m,n be Element of NAT st 1<=n & n <= len f & 1<=m & m <= len f & g=f+*(m,f/.n) +*(n,f/.m) holds f.m=g.n & f.n=g.m & (for k be set st k<>m & k<>n & k in dom f holds f.k=g.k) & f,g are_fiberwise_equipotent; theorem for f being Function, a, A, b, B, c, C being set st a <> b & a <> c holds ( f +* (a .--> A) +* (b .--> B) +* (c .--> C) ).a = A; theorem for A, B, a, b being set, f being Function of A,B st b in B holds f +* (a,b) is Function of A,B; theorem rng f c= A implies f+~(x,y) = (id A+*(x,y))*f; theorem (f+*g)+~(x,y) = f+~(x,y)+*(g+~(x,y)); definition let a,b be set; func a followed_by b equals (NAT --> b) +* (0,a); end; registration let a,b be set; cluster a followed_by b -> Function-like Relation-like; end; reserve a,b,c for set, n for Nat; theorem dom(a followed_by b) = NAT; definition let X be non empty set; let a,b be Element of X; redefine func a followed_by b -> sequence of X; end; theorem (a followed_by b).0 = a; theorem for n st n > 0 holds (a followed_by b).n = b; definition let a,b,c be set; func (a,b) followed_by c equals (NAT --> c) +* ((0,1) --> (a,b)); end; registration let a,b,c be set; cluster (a,b) followed_by c -> Function-like Relation-like; end; theorem dom (a,b) followed_by c = NAT; theorem ((a,b) followed_by c).0 = a; theorem ((a,b) followed_by c).1 = b; theorem for n st n > 1 holds ((a,b) followed_by c).n = c; theorem (a,b) followed_by c = (a followed_by c) +* (1,b); definition let X be non empty set; let a,b,c be Element of X; redefine func (a,b) followed_by c -> sequence of X; end; theorem rng(a followed_by b) = {a,b}; theorem rng (a,b) followed_by c = {a,b,c}; definition let A, B be set, f be Function of A, B, x be set, y be Element of B; redefine func f+*(x,y) -> Function of A, B; end; theorem for A, B being non empty set, f being Function of A, B, x being Element of A, y being set holds f+*(x,y).x = y; theorem for A, B being non empty set, f,g being Function of A, B, x being Element of A st for y being Element of A st f.y <> g.y holds y = x holds f = g +*(x,f.x); theorem for g being A-defined Function holds f,f+*g equal_outside A; theorem for f,g being A-defined Function holds f,g equal_outside A; theorem for f,g being A-defined Function, h being Function holds h+*f, h+*g equal_outside A; reserve n for Element of NAT; theorem for I being NAT-defined Function holds card Shift(I,m) = card I; theorem dom f = dom g & dom f c= A \/ B & f|B = g|B implies f,g equal_outside A; theorem dom f = dom g & B c= dom f & A misses B & f,g equal_outside A implies f|B = g|B; reserve A,B,I for set, X,Y for ManySortedSet of I; theorem I c= A \/ B & X|B = Y|B implies X,Y equal_outside A; theorem B c= I & A misses B & X,Y equal_outside A implies X|B = Y|B; registration let V be non empty set; let f be V-valued Function, x be set, y be Element of V; cluster f+*(x,y) -> V-valued; end; theorem f c= g & not x in dom f implies f c= g+*(x,y); theorem for I being non empty set, X being ManySortedSet of I, l1,l2 being Element of I, i1,i2 being set holds X +*((l1,l2) --> (i1, i2)) = X +* (l1,i1) +* (l2,i2); begin reserve x,y,z for set; reserve n,m,k for Element of NAT; reserve r for Real; theorem for n ex m st n = 2*m or n = 2*m+1; theorem for n ex m st n = 3*m or n = 3*m+1 or n = 3*m+2; theorem for n ex m st n = 4*m or n = 4*m+1 or n = 4*m+2 or n = 4*m+3; theorem for n ex m st n = 5*m or n = 5*m+1 or n = 5*m+2 or n = 5*m+3 or n = 5*m+4; scheme ExRealSubseq{s()->Real_Sequence,P[set]}: ex q being Real_Sequence st q is subsequence of s() & (for n holds P[q.n]) & for n st (for r st r = s().n holds P[r]) ex m st s().n = q.m provided for n ex m st n <= m & P[s().m]; scheme ExRealSeq2{F,G(set)->Real}: ex s being Real_Sequence st for n holds s.(2*n) = F(n) & s.(2*n+1) = G(n); scheme ExRealSeq3{F,G,H(set)->Real}: ex s being Real_Sequence st for n holds s.(3*n ) = F(n) & s.(3*n+1) = G(n) & s.(3*n+2) = H(n); scheme ExRealSeq4{F,G,H,I(set)->Real}: ex s being Real_Sequence st for n holds s.(4 *n) = F(n) & s.(4*n+1) = G(n) & s.(4*n+2) = H(n) & s.(4*n+3) = I(n); scheme ExRealSeq5{F,G,H,I,J(set)->Real}: ex s being Real_Sequence st for n holds s. (5*n) = F(n) & s.(5*n+1) = G(n) & s.(5*n+2) = H(n) & s.(5*n+3) = I(n) & s.(5*n+ 4) = J(n); scheme PartFuncExD2{C, D()->non empty set, P,Q[set], F,G(set)->Element of D()}: ex f being PartFunc of C(),D() st (for c be Element of C() holds c in dom f iff P[ c] or Q[c]) & for c be Element of C() st c in dom f holds (P[c] implies f.c = F (c)) & (Q[c] implies f.c = G(c)) provided for c be Element of C() st P[c] holds not Q[c]; scheme PartFuncExD29{C, D()->non empty set,P,Q[set], F,G(set)->Element of D()}: ex f being PartFunc of C(),D() st (for c be Element of C() holds c in dom f iff P[ c] or Q[c]) & for c be Element of C() st c in dom f holds (P[c] implies f.c = F (c)) & (Q[c] implies f.c = G(c)) provided for c be Element of C() st P[c] & Q[c] holds F(c)=G(c); scheme PartFuncExD299{C, D()->non empty set,P[set], F,G(set)->Element of D()}: ex f being PartFunc of C(),D() st f is total & for c be Element of C() st c in dom f holds (P[c] implies f.c = F(c)) & (not P[c] implies f.c = G(c)); scheme PartFuncExD3{C, D()->non empty set,P,Q,R[set], F,G,H(set)->Element of D()}: ex f being PartFunc of C(),D() st (for c be Element of C() holds c in dom f iff P[c] or Q[c] or R[c]) & for c be Element of C() st c in dom f holds (P[c] implies f.c = F(c)) & (Q[c] implies f.c = G(c)) & (R[c] implies f.c = H(c)) provided for c be Element of C() holds (P[c] implies not Q[c]) & (P[c] implies not R[c]) & (Q[c] implies not R[c]); scheme PartFuncExD39{C, D()->non empty set,P,Q,R[set], F,G,H(set)->Element of D()}: ex f being PartFunc of C(),D() st (for c be Element of C() holds c in dom f iff P[c] or Q[c] or R[c]) & for c be Element of C() st c in dom f holds (P[c] implies f.c = F(c)) & (Q[c] implies f.c = G(c)) & (R[c] implies f.c = H(c)) provided for c be Element of C() holds (P[c] & Q[c] implies F(c)=G(c)) & (P[c ] & R[c] implies F(c)=H(c)) & (Q[c] & R[c] implies G(c)=H(c)); scheme PartFuncExD4{C, D()->non empty set,P,Q,R,S[set], F,G,H,I(set)->Element of D( )}: ex f being PartFunc of C(),D() st (for c be Element of C() holds c in dom f iff P[c] or Q[c] or R[c] or S[c]) & for c be Element of C() st c in dom f holds (P[c] implies f.c = F(c)) & (Q[c] implies f.c = G(c)) & (R[c] implies f.c = H(c )) & (S[c] implies f.c = I(c)) provided for c be Element of C() holds (P[c] implies not Q[c]) & (P[c] implies not R[c]) & (P[c] implies not S[c]) & (Q[c] implies not R[c]) & (Q[c] implies not S[c]) & (R[c] implies not S[c]); scheme PartFuncExS2{X, Y()->set,P,Q[set],F,G(set)->set}: ex f being PartFunc of X() ,Y() st (for x holds x in dom f iff x in X() & (P[x] or Q[x])) & for x st x in dom f holds (P[x] implies f.x=F(x)) & (Q[x] implies f.x=G(x)) provided for x st x in X() holds P[x] implies not Q[x] and for x st x in X() & P[x] holds F(x) in Y() and for x st x in X() & Q[x] holds G(x) in Y(); scheme PartFuncExS3{X, Y()->set,P,Q,R[set], F,G,H(set)->set}: ex f being PartFunc of X(),Y() st (for x holds x in dom f iff x in X() & (P[x] or Q[x] or R[x])) & for x st x in dom f holds (P[x] implies f.x=F(x)) & (Q[x] implies f.x=G(x)) & ( R[x] implies f.x=H(x)) provided for x st x in X() holds (P[x] implies not Q[x]) & (P[x] implies not R[x]) & (Q[x] implies not R[x]) and for x st x in X() & P[x] holds F(x) in Y() and for x st x in X() & Q[x] holds G(x) in Y() and for x st x in X() & R[x] holds H(x) in Y(); scheme PartFuncExS4{X, Y()->set,P,Q,R,S[set], F,G,H,I(set)->set}: ex f being PartFunc of X(),Y() st (for x holds x in dom f iff x in X() & (P[x] or Q[x] or R[x] or S[x])) & for x st x in dom f holds (P[x] implies f.x=F(x)) & (Q[x] implies f.x=G(x)) & (R[x] implies f.x=H(x)) & (S[x] implies f.x=I(x)) provided for x st x in X() holds (P[x] implies not Q[x]) & (P[x] implies not R[x]) & (P[x] implies not S[x]) & (Q[x] implies not R[x]) & (Q[x] implies not S [x]) & (R[x] implies not S[x]) and for x st x in X() & P[x] holds F(x) in Y() and for x st x in X() & Q[x] holds G(x) in Y() and for x st x in X() & R[x] holds H(x) in Y() and for x st x in X() & S[x] holds I(x) in Y(); scheme PartFuncExCD2{C, D, E()->non empty set, P,Q[set,set], F,G(set,set)->Element of E()}: ex f being PartFunc of [:C(),D():],E() st (for c be Element of C() ,d be Element of D() holds [c,d] in dom f iff P[c,d] or Q[c,d]) & for c be Element of C() ,d be Element of D() st [c,d] in dom f holds (P[c,d] implies f.[c,d]=F(c ,d)) & (Q[c,d] implies f.[c,d]=G(c,d)) provided for c be Element of C() ,d be Element of D() st P[c,d] holds not Q[c ,d]; scheme PartFuncExCD3{C, D, E()->non empty set, P,Q,R[set,set], F,G,H(set,set)-> Element of E()}: ex f being PartFunc of [:C(),D():],E() st (for c be Element of C() ,d be Element of D() holds [c,d] in dom f iff P[c,d] or Q[c,d] or R[c,d]) & for c be Element of C() ,r be Element of D() st [c,r] in dom f holds (P[c,r] implies f.[c,r]=F(c,r)) & (Q[c,r] implies f.[c,r]=G(c,r)) & (R[c,r] implies f.[ c,r]=H(c,r)) provided for c be Element of C() ,s be Element of D() holds (P[c,s] implies not Q[c,s]) & (P[c,s] implies not R[c,s]) & (Q[c,s] implies not R[c,s]); scheme PartFuncExCS2{X, Y, Z()->set,P,Q[set,set], F,G(set,set)->set}: ex f being PartFunc of [:X(),Y():],Z() st (for x,y holds [x,y] in dom f iff x in X() & y in Y() & (P[x,y] or Q[x,y])) & for x,y st [x,y] in dom f holds (P[x,y] implies f.[x,y]=F(x,y)) & (Q[x,y] implies f.[x,y]=G(x,y)) provided for x,y st x in X() & y in Y() holds P[x,y] implies not Q[x,y] and for x,y st x in X() & y in Y() & P[x,y] holds F(x,y) in Z() and for x,y st x in X() & y in Y() & Q[x,y] holds G(x,y) in Z(); scheme PartFuncExCS3{X, Y, Z()->set, P,Q,R[set,set], F,G,H(set,set)->set}: ex f being PartFunc of [:X(),Y():],Z() st (for x,y holds [x,y] in dom f iff x in X() & y in Y() & (P[x,y] or Q[x,y] or R[x,y])) & for x,y st [x,y] in dom f holds (P [x,y] implies f.[x,y]=F(x,y)) & (Q[x,y] implies f.[x,y]=G(x,y)) & (R[x,y] implies f.[x,y]=H(x,y)) provided for x,y st x in X() & y in Y() holds (P[x,y] implies not Q[x,y]) & ( P[x,y] implies not R[x,y]) & (Q[x,y] implies not R[x,y]) and for x,y st x in X() & y in Y() holds P[x,y] implies F(x,y) in Z() and for x,y st x in X() & y in Y() holds Q[x,y] implies G(x,y) in Z() and for x,y st x in X() & y in Y() holds R[x,y] implies H(x,y) in Z(); scheme ExFuncD3{C, D()->non empty set,P,Q,R[set], F,G,H(set)->Element of D()}: ex f being Function of C(),D() st for c be Element of C() holds (P[c] implies f.c = F(c)) & (Q[c] implies f.c = G(c)) & (R[c] implies f.c = H(c)) provided for c be Element of C() holds (P[c] implies not Q[c]) & (P[c] implies not R[c]) & (Q[c] implies not R[c]) and for c be Element of C() holds P[c] or Q[c] or R[c]; scheme ExFuncD4{C, D()->non empty set, P,Q,R,S[set], F,G,H,I(set)->Element of D()}: ex f being Function of C(),D() st for c be Element of C() holds (P[c] implies f .c = F(c)) & (Q[c] implies f.c = G(c)) & (R[c] implies f.c = H(c)) & (S[c] implies f.c = I(c)) provided for c be Element of C() holds (P[c] implies not Q[c]) & (P[c] implies not R[c]) & (P[c] implies not S[c]) & (Q[c] implies not R[c]) & (Q[c] implies not S[c]) & (R[c] implies not S[c]) and for c be Element of C() holds P[c] or Q[c] or R[c] or S[c]; scheme FuncExCD2{C, D, E()->non empty set,P[set,set], F,G(set,set)->Element of E()} : ex f being Function of [:C(),D():],E() st for c be Element of C() ,d be Element of D() st [c,d] in dom f holds (P[c,d] implies f.[c,d]=F(c,d)) & (not P [c,d] implies f.[c,d]=G(c,d)); scheme FuncExCD3{C, D, E()->non empty set, P,Q,R[set,set], F,G,H(set,set)->Element of E()}: ex f being Function of [:C(),D():],E() st (for c be Element of C() ,d be Element of D() holds [c,d] in dom f iff P[c,d] or Q[c,d] or R[c,d]) & for c be Element of C() ,d be Element of D() st [c,d] in dom f holds (P[c,d] implies f.[c,d]=F(c,d)) & (Q[c,d] implies f.[c,d]=G(c,d)) & (R[c,d] implies f.[c,d]=H(c ,d)) provided for c be Element of C() ,d be Element of D() holds (P[c,d] implies not Q[c,d]) & (P[c,d] implies not R[c,d]) & (Q[c,d] implies not R[c,d]) and for c be Element of C() ,d be Element of D() holds P[c,d] or Q[c,d] or R[c,d]; begin reserve x, y, z, E, E1, E2, E3 for set, sE for Subset-Family of E, f for Function of E, E, k, l, m, n for Element of NAT; definition let i be Integer; attr i is even means 2 divides i; end; notation let i be Integer; antonym i is odd for i is even; end; definition let n be Element of NAT; redefine attr n is even means ex k st n = 2*k; end; registration cluster even for Element of NAT; cluster odd for Element of NAT; cluster even for Integer; cluster odd for Integer; end; theorem for i being Integer holds i is odd iff ex j being Integer st i = 2*j+1; registration let i be Integer; cluster 2*i -> even; end; registration let i be even Integer; cluster i+1 -> odd; end; registration let i be odd Integer; cluster i+1 -> even; end; registration let i be even Integer; cluster i-1 -> odd; end; registration let i be odd Integer; cluster i-1 -> even; end; registration let i be even Integer, j be Integer; cluster i*j -> even; cluster j*i -> even; end; registration let i, j be odd Integer; cluster i*j -> odd; end; registration let i, j be even Integer; cluster i+j -> even; end; registration let i be even Integer, j be odd Integer; cluster i+j -> odd; cluster j+i -> odd; end; registration let i, j be odd Integer; cluster i+j -> even; end; registration let i be even Integer, j be odd Integer; cluster i-j -> odd; cluster j-i -> odd; end; registration let i, j be odd Integer; cluster i-j -> even; end; registration let m be even Integer; cluster m + 2 -> even; end; registration let m be odd Integer; cluster m + 2 -> odd; end; definition let E, f, n; redefine func iter(f, n) -> Function of E, E; end; theorem for S being non empty Subset of NAT st 0 in S holds min S = 0; theorem for E being non empty set, f being Function of E, E, x being Element of E holds iter(f,0).x = x; definition let x be set, f be Function; pred x is_a_fixpoint_of f means x in dom f & x = f.x; end; definition let A be non empty set, a be Element of A, f be Function of A, A; redefine pred a is_a_fixpoint_of f means a = f.a; end; definition let f be Function; attr f is with_fixpoint means ex x st x is_a_fixpoint_of f; end; notation let f be Function; antonym f is without_fixpoints for f is with_fixpoint; end; definition let X be set, x be Element of X; attr x is covering means union x = union union X; end; theorem sE is covering iff union sE = E; registration let E; cluster non empty finite covering for Subset-Family of E; end; theorem for E being set, f being Function of E, E, sE being non empty covering Subset-Family of E st for X being Element of sE holds X misses f.:X holds f is without_fixpoints; definition let E, f; func =_f -> Equivalence_Relation of E means for x, y st x in E & y in E holds [x,y] in it iff ex k, l st iter(f,k).x = iter(f,l).y; end; theorem for E being non empty set, f being Function of E, E, c being Element of Class =_f, e being Element of c holds f.e in c; theorem for E being non empty set, f being Function of E, E, c being Element of Class =_f, e being Element of c, n holds iter(f, n).e in c; registration cluster empty-membered -> trivial for set; end; registration let A be set, B be with_non-empty_element set; cluster non-empty for Function of A, B; end; registration let A be non empty set, B be with_non-empty_element set, f be non-empty Function of A, B, a be Element of A; cluster f.a -> non empty; end; registration let X be non empty set; cluster bool X -> with_non-empty_element; end; theorem for E being non empty set, f being Function of E, E st f is without_fixpoints ex E1, E2, E3 st E1 \/ E2 \/ E3 = E & f.:E1 misses E1 & f.:E2 misses E2 & f.:E3 misses E3; begin theorem for n being Nat holds n is odd iff ex k being Element of NAT st n = 2*k+1; theorem for A being non empty set, f being Function of A,A, x being Element of A holds iter(f,n+1).x = f.(iter(f,n).x); theorem for i being Integer holds i is even iff ex j being Integer st i = 2*j; registration cluster odd for Nat; cluster even for Nat; end; theorem for n being odd Nat holds 1 <= n; registration cluster odd -> non zero for Integer; end; begin reserve x for set; reserve a, b, c, d, e for real number; reserve m, n, m1, m2 for Element of NAT; reserve k, l for Integer; reserve p for Rational; theorem n is even implies (-a) |^ n = a |^ n; theorem n is odd implies (-a) |^ n = - a |^ n; theorem a>=0 or n is even implies a |^ n >= 0; definition let n be Nat; let a be real number; func n-root a -> real number equals n -Root a if a>=0 & n>=1, -n -Root (-a) if a<0 & n is odd; end; definition let n be Nat; let a be Real; redefine func n-root a -> Real; end; theorem for n being Nat st n>=1 & a>=0 or n is odd holds (n-root a) |^ n = a & n-root (a |^ n) = a; theorem for n being Nat st n>=1 holds n-root 0 = 0; theorem n>=1 implies n-root 1 = 1; theorem a>=0 & n>=1 implies n-root a >= 0; theorem n is odd implies n-root (-1) = -1; theorem 1-root a = a; theorem n is odd implies n-root a = - n-root (-a); theorem n>=1 & a>=0 & b>=0 or n is odd implies n-root (a*b) = n-root a * n-root b; theorem a>0 & n>=1 or a<>0 & n is odd implies n-root (1/a) = 1/(n-root a); theorem a>=0 & b>0 & n>=1 or b<>0 & n is odd implies n-root (a/b) = n-root a / n-root b; theorem a>=0 & n>=1 & m>=1 or n is odd & m is odd implies n-root (m-root a) = (n*m)-root a; theorem a>=0 & n>=1 & m>=1 or n is odd & m is odd implies n-root a * m-root a = (n*m)-root (a |^ (n+m)); theorem a<=b & (0<=a & n>=1 or n is odd) implies n-root a <= n-root b; theorem a=0 & n>=1 or n is odd) implies n-root a < n-root b; theorem a>=1 & n>=1 implies n-root a >= 1 & a >= n-root a; theorem a<=-1 & n is odd implies n-root a <= -1 & a <= n-root a; theorem a>=0 & a<1 & n>=1 implies a <= n-root a & n-root a < 1; theorem a>-1 & a<=0 & n is odd implies a >= n-root a & n-root a > -1; theorem a>0 & n>=1 implies n-root a - 1 <= (a-1)/n; theorem for s being Real_Sequence, a st a > 0 & (for n st n>=1 holds s.n = n-root a) holds s is convergent & lim s = 1; definition let a,b be real number; func a to_power b -> real number means it = a #R b if a > 0, it = 0 if a = 0 & b > 0, ex k st k = b & it = a #Z k if b is Integer; end; definition let a,b be Real; redefine func a to_power b -> Real; end; theorem a to_power 0 = 1; theorem a to_power 1 = a; theorem 1 to_power a = 1; theorem a > 0 implies a to_power (b+c) = a to_power b * a to_power c; theorem a > 0 implies a to_power (-c) = 1 / a to_power c; theorem a > 0 implies a to_power (b-c) = a to_power b / a to_power c; theorem a>0 & b>0 implies (a*b) to_power c = a to_power c*b to_power c; theorem a>0 & b>0 implies (a/b) to_power c = a to_power c/b to_power c; theorem a>0 implies (1/a) to_power b = a to_power (-b); theorem a > 0 implies a to_power b to_power c = a to_power (b * c); theorem a > 0 implies a to_power b > 0; theorem a > 1 & b > 0 implies a to_power b > 1; theorem a > 1 & b < 0 implies a to_power b < 1; theorem a > 0 & a < b & c > 0 implies a to_power c < b to_power c; theorem a > 0 & a < b & c < 0 implies a to_power c > b to_power c; theorem a < b & c > 1 implies c to_power a < c to_power b; theorem a < b & c > 0 & c < 1 implies c to_power a > c to_power b; registration let a be real number, n be Nat; identify a to_power n with a |^ n; end; theorem for n be Nat holds a to_power n = a |^ n; theorem k <> 0 implies 0 to_power k = 0; theorem a to_power k = a #Z k; theorem a>0 implies a to_power p = a #Q p; theorem a>=0 & n>=1 implies a to_power (1/n) = n-root a; theorem a to_power 2 = a^2; theorem k is even implies (-a) to_power k = a to_power k; theorem k is odd implies (-a) to_power k = -(a to_power k); theorem -1 < a implies (1 + a) to_power n >= 1 + n * a; theorem a>0 & a<>1 & c <>d implies a to_power c <> a to_power d; definition let a,b be real number; assume that a>0 and a<>1 and b>0; func log(a,b) -> real number means a to_power it = b; end; definition let a,b be Real; redefine func log(a,b) -> Real; end; theorem a>0 & a<>1 implies log(a,1) = 0; theorem a>0 & a<>1 implies log(a,a) = 1; theorem a>0 & a<>1 & b>0 & c>0 implies log(a,b) + log(a,c) = log(a,b*c); theorem a>0 & a<>1 & b>0 & c>0 implies log(a,b) - log(a,c) = log(a,b/c); theorem a>0 & a<>1 & b>0 implies log(a,b to_power c) = c * log(a,b); theorem a>0 & a<>1 & b>0 & b<>1 & c>0 implies log(a,c) = log(a,b)*log(b,c); theorem a>1 & b>0 & c>b implies log(a,c) > log(a,b); theorem a>0 & a<1 & b>0 & c>b implies log(a,c) < log(a,b); theorem for s being Real_Sequence st for n holds s.n = (1 + 1/(n+1)) to_power (n+1 ) holds s is convergent; definition func number_e -> real number means for s being Real_Sequence st for n holds s.n = (1 + 1/(n+1)) to_power (n+1) holds it = lim s; end; definition redefine func number_e -> Real; end; theorem 2 to_power 2 = 4; theorem 2 to_power 3 = 8; theorem 2 to_power 4 = 16; theorem 2 to_power 5 = 32; theorem 2 to_power 6 = 64; begin reserve a, a9, a1, a2, a3, b, b9, c, c9, d, d9, h, p, q, x, x1, x2, x3, u, v, y, z for real number; definition let a, b, x be complex number; func Polynom (a,b,x) equals a*x+b; end; registration let a, b, x be complex number; cluster Polynom(a,b,x) -> complex; end; registration let a, b, x be real number; cluster Polynom(a,b,x) -> real; end; definition let a, b, x be Real; redefine func Polynom(a,b,x) -> Real; end; theorem for a, b, x being complex number holds a <> 0 & Polynom(a,b,x) = 0 implies x = -(b/a); theorem for x being complex number holds Polynom(0,0,x) = 0; theorem for b being complex number holds b <> 0 implies not ex x being complex number st Polynom(0,b,x) = 0; definition let a,b,c,x be complex number; func Polynom(a,b,c,x) equals a*x^2+b*x+c; end; registration let a,b,c,x be real number; cluster Polynom(a,b,c,x) -> real; end; registration let a,b,c,x be complex number; cluster Polynom(a,b,c,x) -> complex; end; definition let a,b,c,x be Real; redefine func Polynom(a,b,c,x) -> Real; end; theorem for a, b, c, a9, b9, c9 being complex number holds (for x being real number holds Polynom(a,b,c,x) = Polynom(a9,b9,c9,x)) implies a = a9& b = b9& c = c9; theorem a <> 0 & delta(a,b,c) >= 0 implies for x holds Polynom(a,b,c,x) = 0 implies x = (-b+sqrt delta(a,b,c))/(2*a) or x = (-b-sqrt delta(a,b,c))/(2*a); theorem for a, b, c, x being complex number holds a <> 0 & delta(a,b,c) = 0 & Polynom(a,b,c,x) = 0 implies x = -(b/(2*a)); theorem delta(a,b,c) < 0 implies not ex x st Polynom(a,b,c,x) = 0; theorem for b, c being complex number holds b <> 0 & (for x being real number holds Polynom(0,b,c,x) = 0) implies x = -(c/b); theorem for x being complex number holds Polynom(0,0,0,x) = 0; theorem for c being complex number holds c <> 0 implies not ex x being complex number st Polynom(0,0,c,x) = 0; definition let a,x,x1,x2 be complex number; func Quard(a,x1,x2,x) equals a*((x-x1)*(x-x2)); end; registration let a,x,x1,x2 be real number; cluster Quard(a,x1,x2,x) -> real; end; definition let a,x,x1,x2 be Real; redefine func Quard(a,x1,x2,x) -> Real; end; theorem for a, b, c being complex number holds a <> 0 & (for x being real number holds Polynom(a,b,c,x) = Quard(a,x1,x2,x)) implies b/a = -(x1+x2) & c/a = x1*x2; begin definition let a,b,c,d,x be complex number; func Polynom(a,b,c,d,x) equals a*(x |^ 3)+ b*x^2 +c*x +d; end; registration let a,b,c,d,x be complex number; cluster Polynom(a,b,c,d,x) -> complex; end; registration let a,b,c,d,x be real number; cluster Polynom(a,b,c,d,x) -> real; end; definition let a,b,c,d,x be Real; redefine func Polynom(a,b,c,d,x) -> Real; end; theorem (for x holds Polynom(a,b,c,d,x) = Polynom(a9,b9,c9,d9,x)) implies a = a9 & b = b9 & c = c9 & d = d9; definition let a,x,x1,x2,x3 be real number; func Tri(a,x1,x2,x3,x) equals a*((x-x1)*(x-x2)*(x-x3)); end; registration let a,x,x1,x2,x3 be real number; cluster Tri(a,x1,x2,x3,x) -> real; end; definition let a,x,x1,x2,x3 be Real; redefine func Tri(a,x1,x2,x3,x) -> Real; end; theorem a <> 0 & (for x holds Polynom(a,b,c,d,x) = Tri(a,x1,x2,x3,x)) implies b/a = -(x1+x2+x3) & c/a = x1*x2 +x2*x3 +x1*x3 & d/a = -x1*x2*x3; theorem (y+h) |^ 3 = y |^ 3+((3*h)*y^2+(3*h^2)*y)+h |^ 3; theorem a <> 0 & Polynom(a,b,c,d,x) = 0 implies for a1,a2,a3,h,y st y = (x+b/(3*a)) & h = -b/(3*a) & a1 = b/a & a2 = c/a & a3 = d/a holds y |^ 3 + ((3* h+a1)*y^2+(3*h^2+2*(a1*h)+a2)*y) + ((h |^ 3+a1*h^2)+(a2*h+a3)) = 0; theorem a <> 0 & Polynom(a,b,c,d,x) = 0 implies for a1,a2,a3,h,y st y = (x+b/( 3*a)) & h = -b/(3*a) & a1 = b/a & a2 = c/a & a3 = d/a holds y |^ 3 + 0*y^2 + (( 3*a*c-b^2)/(3*a^2))*y + (2*((b/(3*a)) |^ 3)+(3*a*d-b*c)/(3*a^2)) = 0; theorem (y |^ 3)+0*y^2+((3*a*c-b^2)/(3*a^2))*y + (2*((b/(3*a)) |^ 3)+(3*a*d-b* c)/(3*a^2)) = 0 implies for p,q st p = (3*a*c-b^2)/(3*a^2) & q = 2*((b/(3*a)) |^ 3)+(3*a*d-b*c)/(3*a^2) holds Polynom(1,0,p,q,y) = 0; theorem Polynom(1,0,p,q,y) = 0 implies for u,v st y = u+v & 3*v*u+p = 0 holds u |^ 3 + v |^ 3 = -q & (u |^ 3)*(v |^ 3) = (-p/3) |^ 3; theorem Polynom(1,0,p,q,y) = 0 implies for u,v st y = u+v & 3*v*u+p = 0 holds y = 3-root(-q/2+sqrt(q^2/4+(p/3) |^ 3)) + 3-root(-q/2-sqrt(q^2/4+(p/3) |^ 3)) or y = 3-root(-q/2+sqrt(q^2/4+(p/3) |^ 3)) + 3-root(-q/2+sqrt(q^2/4+(p/3) |^ 3)) or y = 3-root(-q/2-sqrt(q^2/4+(p/3) |^ 3)) + 3-root(-q/2-sqrt(q^2/4+(p/3 ) |^ 3)); theorem b <> 0 & delta(b,c,d) > 0 & Polynom(0,b,c,d,x) = 0 implies x = (-c+ sqrt delta(b,c,d))/(2*b) or x = (-c-sqrt delta(b,c,d))/(2*b); theorem a <> 0 & p = c/a & q = d/a & Polynom(a,0,c,d,x) = 0 implies for u,v st x = u+v & 3*v*u+p = 0 holds x = 3-root(-d/(2*a)+sqrt((d^2/(4*a^2))+(c/(3*a)) |^ 3)) +3-root(-d/(2*a)-sqrt((d^2/(4*a^2))+(c/(3*a)) |^ 3)) or x = 3-root(-d/(2*a) +sqrt((d^2/(4*a^2))+(c/(3*a)) |^ 3)) +3-root(-d/(2*a)+sqrt((d^2/(4*a^2))+(c/(3* a)) |^ 3)) or x = 3-root(-d/(2*a)-sqrt((d^2/(4*a^2))+(c/(3*a)) |^ 3)) +3-root(- d/(2*a)-sqrt((d^2/(4*a^2))+(c/(3*a)) |^ 3)); theorem a <> 0 & delta(a,b,c) >= 0 & Polynom(a,b,c,0,x) = 0 implies x = 0 or x = (-b+sqrt delta(a,b,c))/(2*a) or x = (-b-sqrt delta(a,b,c))/(2*a); theorem a <> 0 & c/a < 0 & Polynom(a,0,c,0,x) = 0 implies x = 0 or x = sqrt -c /a or x = -sqrt(-c/a); begin reserve n,m,k for Element of NAT; reserve a,p,r for real number; reserve s,s1,s2,s3 for Real_Sequence; theorem 0 sequence of X; end; definition let s be complex-valued ManySortedSet of NAT; func Partial_Sums(s) -> complex-valued ManySortedSet of NAT means it.0 = s.0 & for n holds it.(n+1) = it.n + s.(n+1); end; registration let s be real-valued ManySortedSet of NAT; cluster Partial_Sums s -> real-valued; end; definition let s be Real_Sequence; redefine func Partial_Sums s -> Real_Sequence; end; definition let s; attr s is summable means Partial_Sums(s) is convergent; func Sum(s) -> Real equals lim Partial_Sums(s); end; theorem s is summable implies s is convergent & lim s = 0; theorem for X being non empty add-closed complex-membered set for s1,s2 being sequence of X holds Partial_Sums(s1) + Partial_Sums(s2) = Partial_Sums(s1+s2); theorem Partial_Sums(s1) - Partial_Sums(s2) = Partial_Sums(s1-s2); theorem s1 is summable & s2 is summable implies s1+s2 is summable & Sum(s1+s2) = Sum(s1) + Sum(s2); theorem s1 is summable & s2 is summable implies s1-s2 is summable & Sum(s1-s2) = Sum(s1) - Sum(s2); theorem Partial_Sums(r(#)s) = r(#)Partial_Sums(s); theorem s is summable implies r(#)s is summable & Sum(r(#)s) =r*Sum(s); theorem for s,s1 st for n holds s1.n=s.0 holds Partial_Sums(s^\1) = ( Partial_Sums(s)^\1) - s1; theorem s is summable implies for n holds s^\n is summable; theorem (ex n st s^\n is summable) implies s is summable; theorem (for n holds s1.n<=s2.n) implies for n holds Partial_Sums(s1).n <=Partial_Sums(s2).n; theorem s is summable implies for n holds Sum(s) = Partial_Sums(s).n + Sum(s^\(n+1)); theorem (for n holds 0<=s.n) implies Partial_Sums(s) is non-decreasing; theorem (for n holds 0<=s.n) implies (Partial_Sums(s) is bounded_above iff s is summable); theorem s is summable & (for n holds 0<=s.n) implies 0<=Sum(s); theorem (for n holds 0<=s2.n) & s1 is summable & (ex m st for n st m<=n holds s2.n<=s1.n) implies s2 is summable; theorem (for n holds 0<=s1.n & s1.n<=s2.n) & s2 is summable implies s1 is summable & Sum(s1)<=Sum(s2); theorem s is summable iff for r st 0 1 implies Partial_Sums(a GeoSeq).n = (1 - a to_power (n+1)) /(1-a); theorem a <> 1 & (for n holds s.(n+1) = a * s.n) implies for n holds Partial_Sums(s).n = s.0 * (1 - a to_power (n+1))/(1-a); theorem abs(a)<1 implies a GeoSeq is summable & Sum(a GeoSeq) = 1/(1-a); theorem abs(a) < 1 & (for n holds s.(n+1) = a * s.n) implies s is summable & Sum(s) = s.0/(1-a); theorem (for n holds s.n>0 & s1.n=s.(n+1)/s.n) & s1 is convergent & lim s1 < 1 implies s is summable; theorem (for n holds s.n>0) & (ex m st for n st n>=m holds s.(n+1)/s.n >= 1) implies s is not summable; theorem (for n holds s.n>=0 & s1.n = n-root (s.n)) & s1 is convergent & lim s1 < 1 implies s is summable; theorem (for n holds s.n>=0 & s1.n = n-root (s.n)) & (ex m st for n st m <=n holds s1.n>=1) implies s is not summable; theorem (for n holds s.n>=0 & s1.n = n-root (s.n)) & s1 is convergent & lim s1 > 1 implies s is not summable; registration let k, n be Nat; cluster k to_power n -> natural; end; definition let k, n be Nat; redefine func k to_power n -> Element of NAT; end; theorem s is non-increasing & (for n holds s.n>=0 & s1.n = 2 to_power n * s.(2 to_power n)) implies (s is summable iff s1 is summable); theorem p>1 & (for n st n>=1 holds s.n = 1/n to_power p) implies s is summable; theorem p<=1 & (for n st n>=1 holds s.n=1/n to_power p) implies s is not summable; definition let s; attr s is absolutely_summable means abs s is summable; end; theorem for n,m st n<=m holds abs(Partial_Sums(s).m - Partial_Sums(s).n) <= abs(Partial_Sums(abs(s)).m - Partial_Sums(abs(s)).n); registration cluster absolutely_summable -> summable for Real_Sequence; end; theorem s is absolutely_summable implies s is summable; theorem (for n holds 0<=s.n) & s is summable implies s is absolutely_summable; theorem (for n holds s.n<>0 & s1.n=abs(s).(n+1)/abs(s).n) & s1 is convergent & lim s1 < 1 implies s is absolutely_summable; theorem r>0 & (ex m st for n st n>=m holds abs(s.n)>=r) implies s is not convergent or lim s <> 0; theorem (for n holds s.n<>0) & (ex m st for n st n>=m holds abs(s).(n+1)/abs(s ).n >= 1) implies s is not summable; theorem (for n holds s1.n = n-root (abs(s).n)) & s1 is convergent & lim s1 < 1 implies s is absolutely_summable; theorem (for n holds s1.n = n-root(abs(s).n)) & (ex m st for n st m<=n holds s1.n >= 1 ) implies s is not summable; theorem (for n holds s1.n = n-root (abs(s).n)) & s1 is convergent & lim s1 > 1 implies s is not summable; begin definition let s; let n be Nat; func Sum(s, n) -> Real equals Partial_Sums(s).n; end; definition let s; let n,m be Nat; func Sum(s, n, m) -> Real equals Sum(s, n) - Sum(s, m); end; begin reserve rseq, rseq1, rseq2 for Real_Sequence; reserve seq, seq1, seq2 for Complex_Sequence; reserve k, n, n1, n2, m for Element of NAT; reserve p, r for Real; theorem n+1 <> 0c & (n+1)* <> 0c; theorem (for n holds rseq.n = 0) implies for m holds (Partial_Sums abs( rseq)).m = 0; theorem (for n holds rseq.n = 0) implies rseq is absolutely_summable; registration cluster summable -> convergent for Real_Sequence; end; registration cluster absolutely_summable -> summable for Real_Sequence; end; registration cluster absolutely_summable for Real_Sequence; end; theorem rseq is convergent implies for p st 0

Complex_Sequence means it.0 = 1r & for n holds it.(n+1) = it.n * z; end; notation let z be complex number, n be natural number; synonym z #N n for z|^n; end; definition let z be complex number, n be natural number; redefine func z #N n -> Element of COMPLEX equals z GeoSeq.n; end; theorem z #N 0 = 1r; definition let f be complex-valued Function; func Re f -> Function means dom it = dom f & for x be set st x in dom it holds it.x = Re(f.x); func Im f -> Function means dom it = dom f & for x be set st x in dom it holds it.x = Im(f.x); end; registration let f be complex-valued Function; cluster Re f -> real-valued; cluster Im f -> real-valued; end; definition let X be set, f be PartFunc of X,COMPLEX; redefine func Re f -> PartFunc of X,REAL; redefine func Im f -> PartFunc of X,REAL; end; definition let c be Complex_Sequence; redefine func Re c -> Real_Sequence means for n holds it.n = Re(c.n); redefine func Im c -> Real_Sequence means for n holds it.n = Im(c.n); end; theorem |.z.| <= abs Re z + abs Im z; theorem abs Re z <= |.z.| & abs Im z <= |.z.|; theorem Re seq1=Re seq2 & Im seq1=Im seq2 implies seq1=seq2; theorem Re seq1 + Re seq2 = Re (seq1+seq2) & Im seq1 + Im seq2 = Im ( seq1+seq2 qua Complex_Sequence); theorem -(Re seq) = Re (-seq) & -(Im seq) = Im -seq; theorem r*Re(z)=Re(r*z) & r*Im(z)=Im(r*z); theorem Re seq1-Re seq2=Re (seq1-seq2) & Im seq1-Im seq2=Im(seq1-seq2); theorem r(#)Re seq = Re (r (#) seq) & r(#)Im seq = Im (r (#) seq); theorem Re (z (#) seq) = Re z (#) Re seq - Im z (#) Im seq & Im (z (#) seq) = Re z (#) Im seq + Im z (#) Re seq; theorem Re (seq1 (#) seq2) = Re seq1(#)Re seq2-Im seq1(#)Im seq2 & Im (seq1 (#) seq2) = Re seq1(#)Im seq2+Im seq1(#)Re seq2; definition let Nseq be increasing sequence of NAT, seq be Complex_Sequence; redefine func seq * Nseq -> Complex_Sequence; end; theorem Re (seq*Nseq)=(Re seq)*Nseq & Im (seq*Nseq)=(Im seq)*Nseq; theorem (Re seq)^\k =Re (seq^\k) & (Im seq)^\k =Im (seq^\k); definition let s be Complex_Sequence; redefine func Partial_Sums s -> Complex_Sequence; end; definition let seq be Complex_Sequence; func Sum seq -> Element of COMPLEX equals lim Partial_Sums seq; end; theorem (for n holds seq.n = 0c) implies for m holds (Partial_Sums seq). m = 0c; theorem (for n holds seq.n = 0c) implies for m holds (Partial_Sums |.seq .|).m = 0; theorem Partial_Sums Re seq = Re (Partial_Sums seq) & Partial_Sums Im seq = Im (Partial_Sums seq); theorem Partial_Sums(seq1)+Partial_Sums(seq2) = Partial_Sums(seq1+seq2); theorem Partial_Sums(seq1)-Partial_Sums(seq2) = Partial_Sums(seq1-seq2); theorem for z being complex number holds Partial_Sums(z (#) seq) = z (#) Partial_Sums(seq); theorem |.Partial_Sums(seq).k.| <= (Partial_Sums |.seq.|).k; theorem |.Partial_Sums(seq).m- Partial_Sums(seq).n.| <= abs( Partial_Sums(|.seq.|).m- Partial_Sums(|.seq.|).n ); theorem Partial_Sums(Re seq)^\k =Re (Partial_Sums(seq)^\k) & Partial_Sums(Im seq)^\k =Im (Partial_Sums(seq)^\k); theorem (for n holds seq1.n=seq.0) implies Partial_Sums(seq^\1) = ( Partial_Sums(seq)^\1) - seq1; theorem Partial_Sums |.seq.| is non-decreasing; registration let seq be Complex_Sequence; cluster Partial_Sums |.seq.| -> non-decreasing for Real_Sequence; end; theorem (for n st n <= m holds seq1.n = seq2.n) implies Partial_Sums(seq1).m = Partial_Sums(seq2).m; theorem 1r <> z implies for n holds Partial_Sums(z GeoSeq).n = (1r - z #N (n+1))/(1r-z); theorem z <> 1r & (for n holds seq.(n+1) = z * seq.n) implies for n holds Partial_Sums(seq).n = seq.0 * ((1r - z #N (n+1))/(1r-z)); begin theorem for a, b being Real_Sequence, c being Complex_Sequence st (for n holds Re (c.n) = a.n & Im (c.n) = b.n) holds a is convergent & b is convergent iff c is convergent; theorem for a, b being convergent Real_Sequence, c being Complex_Sequence st (for n holds Re (c.n) = a.n & Im (c.n) = b.n) holds c is convergent & lim(c)= lim(a) + lim(b)*; theorem for a, b being Real_Sequence, c being convergent Complex_Sequence st (for n holds Re (c.n) = a.n & Im (c.n) = b.n) holds a is convergent & b is convergent & lim a=Re lim c & lim b=Im lim c; theorem for c being convergent Complex_Sequence holds Re c is convergent & Im c is convergent & lim Re c = Re lim c & lim Im c = Im lim c; registration let c be convergent Complex_Sequence; cluster Re c -> convergent for Real_Sequence; cluster Im c -> convergent for Real_Sequence; end; theorem for c being Complex_Sequence st Re c is convergent & Im c is convergent holds c is convergent & Re(lim(c))=lim(Re c) & Im (lim(c))=lim(Im c) ; theorem (0 < |.z.| & |.z.| < 1 & seq.0 = z & for n holds seq.(n+1) = seq .n * z) implies seq is convergent & lim(seq)=0c; theorem |.z.| < 1 & (for n holds seq.n=z #N (n+1)) implies seq is convergent & lim(seq)=0c; theorem r>0 & (ex m st for n st n>=m holds |.seq.n.| >= r) implies not |.seq.| is convergent or lim |.seq.| <> 0; theorem seq is convergent iff for p st 0

convergent for Complex_Sequence; end; definition let seq be Complex_Sequence; attr seq is absolutely_summable means |.seq.| is summable; end; theorem (for n holds seq.n = 0c) implies seq is absolutely_summable; registration cluster absolutely_summable for Complex_Sequence; end; registration let seq be absolutely_summable Complex_Sequence; cluster |.seq.| -> summable for Real_Sequence; end; theorem seq is summable implies seq is convergent & lim seq = 0c; registration cluster summable -> convergent for Complex_Sequence; end; theorem seq is summable implies Re seq is summable & Im seq is summable & Sum(seq)= Sum(Re seq)+Sum(Im seq)*; registration let seq be summable Complex_Sequence; cluster Re seq -> summable for Real_Sequence; cluster Im seq -> summable for Real_Sequence; end; theorem seq1 is summable & seq2 is summable implies seq1+seq2 is summable & Sum(seq1+seq2)= Sum(seq1)+Sum(seq2); theorem seq1 is summable & seq2 is summable implies seq1-seq2 is summable & Sum(seq1-seq2)= Sum(seq1)-Sum(seq2); registration let seq1, seq2 be summable Complex_Sequence; cluster seq1 + seq2 -> summable for Complex_Sequence; cluster seq1 - seq2 -> summable for Complex_Sequence; end; theorem seq is summable implies for z being complex number holds z (#) seq is summable & Sum(z (#) seq)= z * Sum(seq); registration let z be Element of COMPLEX, seq be summable Complex_Sequence; cluster z (#) seq -> summable for Complex_Sequence; end; theorem Re seq is summable & Im seq is summable implies seq is summable & Sum(seq)=Sum(Re seq)+Sum(Im seq)*; theorem seq is summable implies for n holds seq^\n is summable; registration let seq be summable Complex_Sequence, n be Element of NAT; cluster seq^\n -> summable for Complex_Sequence; end; theorem (ex n st seq^\n is summable) implies seq is summable; theorem seq is summable implies for n holds Sum(seq) = Partial_Sums(seq).n + Sum(seq^\(n+1)); theorem Partial_Sums |.seq.| is bounded_above iff seq is absolutely_summable; registration let seq be absolutely_summable Complex_Sequence; cluster Partial_Sums |.seq.| -> bounded_above for Real_Sequence; end; theorem seq is summable iff for p st 0

summable for Complex_Sequence; end; registration cluster absolutely_summable for Complex_Sequence; end; theorem |.z.| < 1 implies z GeoSeq is summable & Sum(z GeoSeq) = 1r/(1r- z); theorem |.z.| < 1 & (for n holds seq.(n+1) = z * seq.n) implies seq is summable & Sum(seq) = seq.0/(1r-z); theorem rseq1 is summable & (ex m st for n st m<=n holds |.seq2.n.| <= rseq1.n ) implies seq2 is absolutely_summable; theorem (for n holds 0 <= |.seq1.|.n & |.seq1.|.n <= |.seq2.|.n) & seq2 is absolutely_summable implies seq1 is absolutely_summable & Sum |.seq1.| <= Sum |.seq2.|; theorem (for n holds |.seq.|.n>0) & (ex m st for n st n>=m holds |.seq.|.(n+1) /|.seq.|.n >= 1) implies not seq is absolutely_summable; theorem (for n holds rseq1.n = n-root (|.seq.|.n)) & rseq1 is convergent & lim rseq1 < 1 implies seq is absolutely_summable; theorem (for n holds rseq1.n = n-root (|.seq.|.n)) & (ex m st for n st m<=n holds rseq1.n>= 1) implies |.seq.| is not summable; theorem (for n holds rseq1.n = n-root (|.seq.|.n)) & rseq1 is convergent & lim rseq1 > 1 implies seq is not absolutely_summable; theorem |.seq .| is non-increasing & (for n holds rseq1.n = 2 to_power n * |. seq.|.(2 to_power n)) implies (seq is absolutely_summable iff rseq1 is summable ); theorem p>1 & (for n st n>=1 holds |.seq.|.n = 1/n to_power p) implies seq is absolutely_summable; theorem p<=1 & (for n st n>=1 holds |.seq.|.n=1/n to_power p) implies not seq is absolutely_summable; theorem (for n holds seq.n<>0c & rseq1.n=|.seq.|.(n+1)/|.seq.|.n) & rseq1 is convergent & lim rseq1 < 1 implies seq is absolutely_summable; theorem (for n holds seq.n<>0c) & (ex m st for n st n>=m holds |.seq.|.(n+1)/ |.seq.|.n >= 1) implies seq is not absolutely_summable; begin reserve n,n1,m,m1,k for Element of NAT; reserve x,X,X1 for set; reserve g,g1,g2,t,x0,x1,x2 for Element of COMPLEX; reserve s1,s2,q1,seq,seq1,seq2,seq3 for Complex_Sequence; reserve Y for Subset of COMPLEX; reserve f,f1,f2,h,h1,h2 for PartFunc of COMPLEX,COMPLEX; reserve p,r,s for Real; reserve Ns,Nseq for increasing sequence of NAT; definition let f,x0; pred f is_continuous_in x0 means x0 in dom f & for s1 st rng s1 c= dom f & s1 is convergent & lim s1 = x0 holds f/*s1 is convergent & f/.x0 = lim (f/*s1); end; theorem seq1=seq2-seq3 iff for n holds seq1.n=seq2.n-seq3.n; theorem (seq1 + seq2)*Ns = (seq1*Ns) + (seq2*Ns) & (seq1 - seq2)*Ns = ( seq1*Ns) - (seq2*Ns) & (seq1 (#) seq2)*Ns = (seq1*Ns) (#) (seq2*Ns); theorem (g(#)seq)*Ns = g(#)(seq*Ns); theorem (-seq)*Ns = -(seq*Ns) & (|.seq.|)*Ns = |.(seq*Ns).|; theorem (seq*Ns)" = (seq")*Ns; theorem (seq1/"seq)*Ns = (seq1*Ns)/"(seq*Ns); theorem rng seq c= dom h1 /\ dom h2 implies (h1+h2)/*seq=h1/*seq+h2/*seq & (h1-h2)/*seq=h1/*seq-h2/*seq & (h1(#)h2)/*seq=(h1/*seq)(#)(h2/*seq); theorem rng seq c= dom h implies (g(#)h)/*seq = g(#)(h/*seq); theorem rng seq c= dom h implies -(h/*seq) = (-h)/*seq; theorem rng seq c= dom (h^) implies h/*seq is non-zero; theorem rng seq c= dom (h^) implies (h^)/*seq =(h/*seq)"; theorem rng seq c= dom h implies Re ( (h/*seq)*Ns ) = Re (h/*(seq*Ns)); theorem rng seq c= dom h implies Im ( (h/*seq)*Ns ) = Im (h/*(seq*Ns)); theorem h1 is total & h2 is total implies (h1+h2)/*seq = h1/*seq + h2/*seq & ( h1-h2)/*seq = h1/*seq - h2/*seq & (h1(#)h2)/*seq = (h1/*seq) (#) (h2/*seq); theorem h is total implies (g(#)h)/*seq = g(#)(h/*seq); theorem rng seq c= dom (h|X) & h"{0}={} implies ((h^)|X)/*seq = ((h|X)/*seq)"; theorem seq1 is subsequence of seq & seq is convergent implies seq1 is convergent; theorem seq1 is subsequence of seq & seq is convergent implies lim seq1= lim seq; theorem seq is convergent & (ex k st for n st k<=n holds seq1.n=seq.n) implies seq1 is convergent; theorem seq is convergent & (ex k st for n st k<=n holds seq1.n=seq.n) implies lim seq=lim seq1; theorem seq is convergent implies (seq ^\k) is convergent & lim (seq ^\k)=lim seq; theorem seq is convergent & (ex k st seq=seq1 ^\k) implies seq1 is convergent; theorem seq is convergent & (ex k st seq=seq1 ^\k) implies lim seq1 =lim seq; theorem seq is convergent & lim seq<>0 implies ex k st (seq ^\k) is non-zero; theorem seq is convergent & lim seq<>0 implies ex seq1 st seq1 is subsequence of seq & seq1 is non-zero; theorem seq is constant implies seq is convergent; theorem (seq is constant & g in rng seq or seq is constant & ex n st seq .n=g ) implies lim seq=g; theorem seq is constant implies for n holds lim seq=seq.n; theorem seq is convergent & lim seq<>0 implies for seq1 st seq1 is subsequence of seq & seq1 is non-zero holds lim (seq1")=(lim seq)"; theorem seq is constant & seq1 is convergent implies lim (seq+seq1) =(seq.0) + lim seq1 & lim (seq-seq1) =(seq.0) - lim seq1 & lim (seq1-seq) =(lim seq1) -seq .0 & lim (seq(#)seq1) =(seq.0) * (lim seq1); scheme CompSeqChoice { P[set,set] }: ex s1 st for n holds P[n,s1.n] provided for n ex g st P[n,g]; begin theorem f is_continuous_in x0 iff x0 in dom f & for s1 st rng s1 c= dom f & s1 is convergent & lim s1=x0 & (for n holds s1.n<>x0) holds f/*s1 is convergent & f/.x0=lim(f/*s1); theorem f is_continuous_in x0 iff x0 in dom f & for r st 00 implies f^ is_continuous_in x0; theorem f1 is_continuous_in x0 & f1/.x0<>0 & f2 is_continuous_in x0 implies f2 /f1 is_continuous_in x0; definition let f,X; pred f is_continuous_on X means X c= dom f & for x0 st x0 in X holds f|X is_continuous_in x0; end; theorem for X,f holds f is_continuous_on X iff X c= dom f & for s1 st rng s1 c= X & s1 is convergent & lim s1 in X holds f/*s1 is convergent & f/.( lim s1) = lim (f/*s1); theorem f is_continuous_on X iff X c= dom f & for x0,r st x0 in X & 0 Complex_Sequence means for n holds it.n = 1/(n+r); end; theorem 0 < r implies InvShift(r) is convergent; registration let r be positive real number; cluster InvShift(r) -> convergent; end; theorem 0 < r implies lim InvShift(r) = 0; registration let r be positive real number; cluster InvShift(r) -> non-zero 0-convergent; end; registration cluster 0-convergent non-zero for Complex_Sequence; end; registration cluster 0-convergent non-zero -> convergent for Complex_Sequence; end; registration cluster constant for Complex_Sequence; end; theorem seq is constant iff for n,m holds seq.n = seq.m; theorem for n holds (seq*Nseq).n = seq.(Nseq.n); reserve h for 0-convergent non-zero Complex_Sequence; reserve c for constant Complex_Sequence; definition let IT be PartFunc of COMPLEX,COMPLEX; attr IT is RestFunc-like means for h holds (h")(#)(IT/*h) is convergent & lim ((h")(#)(IT/*h)) = 0; end; registration cluster total RestFunc-like for PartFunc of COMPLEX,COMPLEX; end; definition mode C_RestFunc is total RestFunc-like PartFunc of COMPLEX,COMPLEX; end; definition let IT be PartFunc of COMPLEX,COMPLEX; attr IT is linear means ex a st for z holds IT/.z = a*z; end; registration cluster total linear for PartFunc of COMPLEX,COMPLEX; end; definition mode C_LinearFunc is total linear PartFunc of COMPLEX,COMPLEX; end; reserve R, R1, R2 for C_RestFunc; reserve L, L1, L2 for C_LinearFunc; registration let L1,L2; cluster L1+L2 -> total linear for PartFunc of COMPLEX,COMPLEX; cluster L1-L2 -> total linear for PartFunc of COMPLEX,COMPLEX; end; registration let a,L; cluster a(#)L -> total linear for PartFunc of COMPLEX,COMPLEX; end; registration let R1,R2; cluster R1+R2 -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; cluster R1-R2 -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; cluster R1(#)R2 -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; end; registration let a,R; cluster a(#)R -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; end; registration let L1,L2; cluster L1(#)L2 -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; end; registration let R,L; cluster R(#)L -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; cluster L(#)R -> total RestFunc-like for PartFunc of COMPLEX,COMPLEX; end; definition let z0 be Complex; mode Neighbourhood of z0 -> Subset of COMPLEX means ex g be Real st 0 < g & {y where y is Complex : |.y-z0.| < g} c= it; end; theorem for g be real number st 0 < g holds {y where y is Complex : |.y-z0.| < g} is Neighbourhood of z0; theorem for N being Neighbourhood of z0 holds z0 in N; definition let f; let z0 be Complex; pred f is_differentiable_in z0 means ex N being Neighbourhood of z0 st N c= dom f & ex L,R st for z st z in N holds f/.z-f/.z0 = L/.(z-z0)+R/.(z-z0); end; definition let f; let z0 be Complex; assume f is_differentiable_in z0; func diff(f,z0) -> Element of COMPLEX means ex N being Neighbourhood of z0 st N c= dom f & ex L,R st it = L/.1r & for z st z in N holds f/.z-f/.z0 = L/.(z-z0)+R/.(z-z0); end; definition let f; attr f is differentiable means for x st x in dom f holds f is_differentiable_in x; end; definition let f,X; pred f is_differentiable_on X means X c= dom f & f|X is differentiable; end; theorem f is_differentiable_on X implies X is Subset of COMPLEX; definition let X be Subset of COMPLEX; attr X is closed means for s1 be Complex_Sequence st rng s1 c= X & s1 is convergent holds lim s1 in X; end; definition let X be Subset of COMPLEX; attr X is open means X` is closed; end; theorem for X being Subset of COMPLEX st X is open for z0 be Complex st z0 in X ex N being Neighbourhood of z0 st N c= X; theorem for X being Subset of COMPLEX st X is open for z0 be Complex st z0 in X holds ex g be Real st {y where y is Complex : |.y-z0.| < g} c= X; theorem for X being Subset of COMPLEX holds ((for z0 be Complex st z0 in X holds ex N be Neighbourhood of z0 st N c= X) implies X is open); theorem for X be Subset of COMPLEX holds X is open iff for x be Complex st x in X ex N be Neighbourhood of x st N c= X; theorem for X be Subset of COMPLEX, z0 be Element of COMPLEX, r be Element of REAL st X = {y where y is Complex : |.y-z0.| < r} holds X is open; theorem for X be Subset of COMPLEX, z0 be Element of COMPLEX, r be Element of REAL st X = {y where y is Complex : |.y-z0.| <= r} holds X is closed; registration cluster open for Subset of COMPLEX; end; reserve Z for open Subset of COMPLEX; theorem f is_differentiable_on Z iff Z c= dom f & for x st x in Z holds f is_differentiable_in x; theorem f is_differentiable_on Y implies Y is open; definition let f, X; assume f is_differentiable_on X; func f`|X -> PartFunc of COMPLEX,COMPLEX means dom it = X & for x st x in X holds it/.x = diff(f,x); end; theorem for f,Z st Z c= dom f & ex a1 st rng f = {a1} holds f is_differentiable_on Z & for x st x in Z holds (f`|Z)/.x = 0c; registration let seq be non-zero Complex_Sequence, k be Nat; cluster seq ^\k -> non-zero; end; registration let h,n; cluster h^\n -> 0-convergent for Complex_Sequence; end; theorem (seq+seq1)^\k = (seq^\k)+(seq1^\k); theorem (seq-seq1)^\k = (seq^\k)-(seq1^\k); theorem (seq")^\k = (seq^\k)"; theorem (seq(#)seq1)^\k = (seq^\k)(#)(seq1^\k); theorem for x0 be Complex for N being Neighbourhood of x0 st f is_differentiable_in x0 & N c= dom f holds for h,c st rng c = {x0} & rng (h+c) c= N holds h"(#)(f/*(h+c)-f/*c) is convergent & diff(f,x0) = lim (h"(#)(f/*(h+c )-f/*c)); theorem for f1,f2,x0 st f1 is_differentiable_in x0 & f2 is_differentiable_in x0 holds f1+f2 is_differentiable_in x0 & diff(f1+f2,x0) = diff(f1,x0)+diff(f2,x0); theorem for f1,f2,x0 st f1 is_differentiable_in x0 & f2 is_differentiable_in x0 holds f1-f2 is_differentiable_in x0 & diff(f1-f2,x0) = diff(f1,x0)-diff(f2,x0); theorem for a,f,x0 st f is_differentiable_in x0 holds a(#)f is_differentiable_in x0 & diff((a(#)f),x0) = a*diff(f,x0); theorem for f1,f2,x0 st f1 is_differentiable_in x0 & f2 is_differentiable_in x0 holds f1(#)f2 is_differentiable_in x0 & diff(f1(#)f2,x0 ) = (f2/.x0)*diff(f1,x0)+(f1/.x0)*diff(f2,x0); theorem for f,Z st Z c= dom f & f|Z = id Z holds f is_differentiable_on Z & for x st x in Z holds (f`|Z)/.x = 1r; theorem for f1,f2,Z st Z c= dom (f1+f2) & f1 is_differentiable_on Z & f2 is_differentiable_on Z holds f1+f2 is_differentiable_on Z & for x st x in Z holds ((f1+f2)`|Z)/.x = diff(f1,x)+diff(f2,x); theorem for f1,f2,Z st Z c= dom (f1-f2) & f1 is_differentiable_on Z & f2 is_differentiable_on Z holds f1-f2 is_differentiable_on Z & for x st x in Z holds ((f1-f2)`|Z)/.x = diff(f1,x)-diff(f2,x); theorem for a,f,Z st Z c= dom (a(#)f) & f is_differentiable_on Z holds a(#)f is_differentiable_on Z & for x st x in Z holds ((a(#)f)`|Z)/.x = a*diff(f,x); theorem for f1,f2,Z st Z c= dom (f1(#)f2) & f1 is_differentiable_on Z & f2 is_differentiable_on Z holds f1(#)f2 is_differentiable_on Z & for x st x in Z holds ((f1(#)f2)`|Z)/.x = (f2/.x)*diff(f1,x)+(f1/.x)*diff(f2,x); theorem Z c= dom f & f|Z is constant implies f is_differentiable_on Z & for x st x in Z holds (f`|Z)/.x = 0c; theorem Z c= dom f & (for x st x in Z holds f/.x = a*x+b) implies f is_differentiable_on Z & for x st x in Z holds (f`|Z)/.x = a; theorem for x0 be Element of COMPLEX holds f is_differentiable_in x0 implies f is_continuous_in x0; theorem f is_differentiable_on X implies f is_continuous_on X; theorem f is_differentiable_on X & Z c= X implies f is_differentiable_on Z; canceled; theorem f is_differentiable_in x0 implies ex R st R/.0c = 0c & R is_continuous_in 0c; begin reserve E for non empty set; reserve a for Element of E; reserve A, B for Subset of E; reserve Y for set; reserve p for FinSequence; theorem for e being non empty Subset of E holds e is Singleton of E iff for Y holds (Y c= e iff Y = {} or Y = e); registration let E; cluster -> finite for Singleton of E; end; reserve e, e1, e2 for Singleton of E; theorem e = A \/ B & A <> B implies A = {} & B = e or A = e & B = {}; theorem e = A \/ B implies A = e & B = e or A = e & B = {} or A = {} & B = e; theorem {a} is Singleton of E; theorem e1 c= e2 implies e1 = e2; theorem ex a st a in E & e = {a}; theorem ex e st e is Singleton of E; theorem ex p st p is FinSequence of E & rng p = e & len p = 1; definition let E be set; mode Event of E is Subset of E; end; theorem for E being non empty set, e being Singleton of E, A being Event of E holds e misses A or e /\ A = e; theorem for E being non empty set, A being Event of E st A <> {} ex e being Singleton of E st e c= A; theorem for E being non empty set, e being Singleton of E, A being Event of E st e c= A \/ A` holds e c= A or e c= A`; theorem e1 = e2 or e1 misses e2; theorem A /\ B misses A /\ B`; definition let E be finite set; let A be Event of E; func prob(A) -> Real equals card A / card E; end; theorem for E being finite non empty set, e being Singleton of E holds prob(e) = 1 / card E; theorem for E being finite non empty set holds prob([#] E) = 1; theorem for E being finite non empty set, A,B being Event of E st A misses B holds prob(A /\ B) = 0; theorem for E being finite non empty set, A being Event of E holds prob(A) <= 1; theorem for E being finite non empty set, A being Event of E holds 0 <= prob(A); theorem for E being finite non empty set, A,B being Event of E st A c= B holds prob(A) <= prob(B); theorem for E being finite non empty set, A,B being Event of E holds prob(A \/ B) = prob(A) + prob(B) - prob(A /\ B); theorem for E being finite non empty set, A,B being Event of E st A misses B holds prob(A \/ B) = prob(A) + prob(B); theorem for E being finite non empty set, A being Event of E holds prob( A) = 1 - prob(A`) & prob(A`) = 1 - prob(A); theorem for E being finite non empty set, A,B being Event of E holds prob(A \ B) = prob(A) - prob(A /\ B); theorem for E being finite non empty set, A,B being Event of E st B c= A holds prob(A \ B) = prob(A) - prob(B); theorem for E being finite non empty set, A,B being Event of E holds prob(A \/ B) <= prob(A) + prob(B); theorem for E being finite non empty set, A,B being Event of E holds prob(A) = prob(A /\ B) + prob(A /\ B`); theorem for E being finite non empty set, A,B being Event of E holds prob(A) = prob(A \/ B) - prob(B \ A); theorem for E being finite non empty set, A,B being Event of E holds prob(A) + prob(A` /\ B) = prob(B) + prob(B` /\ A); theorem for E being finite non empty set, A,B,C being Event of E holds prob(A \/ B \/ C) = ( prob(A) + prob(B) + prob(C) ) - ( prob(A /\ B) + prob(A /\ C) + prob(B /\ C) ) + prob(A /\ B /\ C); theorem for E being finite non empty set, A,B,C being Event of E st A misses B & A misses C & B misses C holds prob(A \/ B \/ C) = prob(A) + prob(B) + prob(C) ; theorem for E being finite non empty set, A,B being Event of E holds prob(A) - prob(B) <= prob(A \ B); definition let E be finite set; let B,A be Event of E; func prob(A, B) -> Real equals prob(A /\ B) / prob(B); end; theorem for E being finite non empty set, A being Event of E holds prob(A, [#]E ) = prob(A); theorem for E being finite non empty set holds prob([#] E, [#] E) = 1; theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) holds prob(A, B) <= 1; theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) holds 0 <= prob(A, B); theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) holds prob(A, B) = 1 - prob(B \ A) / prob(B); theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) & A c= B holds prob(A, B) = prob(A) / prob(B); theorem for E being finite non empty set, A,B being Event of E st A misses B holds prob(A, B) = 0; theorem for E being finite non empty set, A,B being Event of E st 0 < prob(A) & 0 < prob(B) holds prob(A) * prob(B, A) = prob(B) * prob(A, B); theorem for E being finite non empty set, A,B being Event of E st 0 < prob B holds prob(A, B) = 1 - prob(A`, B) & prob(A`, B) = 1 - prob(A, B); theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) & B c= A holds prob(A, B) = 1; theorem for E being finite non empty set, B being Event of E st 0 < prob(B) holds prob([#] E, B) = 1; theorem for E being finite non empty set, A being Event of E holds prob(A`, A) = 0; theorem for E being finite non empty set, A being Event of E holds prob(A, A`) = 0; theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) & A misses B holds prob(A`, B) = 1; theorem for E being finite non empty set, A,B being Event of E st 0 < prob(A) & prob(B) < 1 & A misses B holds prob(A, B`) = prob(A) / (1 - prob(B)); theorem for E being finite non empty set, A,B being Event of E st 0 < prob(A) & prob(B) < 1 & A misses B holds prob(A`, B`) = 1 - prob(A) / (1 - prob(B)); theorem for E being finite non empty set, A,B,C being Event of E st 0 < prob(B /\ C) & 0 < prob(C) holds prob(A /\ B /\ C) = prob(A, B /\ C) * prob(B, C) * prob(C); theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) & prob(B) < 1 holds prob(A) = prob(A, B) * prob(B) + prob(A, B`) * prob (B`); theorem for E being finite non empty set, A,B1,B2 being Event of E st 0 < prob(B1) & 0 < prob(B2) & B1 \/ B2 = E & B1 misses B2 holds prob(A) = prob(A, B1) * prob(B1) + prob(A, B2) * prob(B2); theorem for E being finite non empty set, A,B1,B2,B3 being Event of E st 0 < prob(B1) & 0 < prob(B2) & 0 < prob(B3) & B1 \/ B2 \/ B3 = E & B1 misses B2 & B1 misses B3 & B2 misses B3 holds prob(A) = ( prob(A, B1) * prob(B1) + prob(A , B2) * prob(B2) ) + prob(A, B3) * prob(B3); theorem for E being finite non empty set, A,B1,B2 being Event of E st 0 < prob (B1) & 0 < prob(B2) & B1 \/ B2 = E & B1 misses B2 holds prob(B1, A) = ( prob(A, B1) * prob(B1) ) / ( prob(A, B1) * prob(B1) + prob(A, B2) * prob(B2) ); theorem for E being finite non empty set, A,B1,B2,B3 being Event of E st 0 < prob(B1) & 0 < prob(B2) & 0 < prob(B3) & B1 \/ B2 \/ B3 = E & B1 misses B2 & B1 misses B3 & B2 misses B3 holds prob(B1, A) = ( prob(A, B1) * prob(B1) ) / ( ( prob(A, B1) * prob(B1) + prob(A, B2) * prob(B2) ) + prob(A, B3) * prob(B3) ); definition let E be finite set; let A, B be Event of E; pred A, B are_independent means prob(A /\ B) = prob(A) * prob(B); symmetry; end; theorem for E being finite non empty set, A,B being Event of E st 0 < prob(B) & A, B are_independent holds prob(A, B) = prob(A); theorem for E being finite non empty set, A,B being Event of E st prob(B) = 0 holds A, B are_independent; theorem for E being finite non empty set, A,B being Event of E st A, B are_independent holds A`, B are_independent; theorem for E being finite non empty set, A,B being Event of E st A misses B & A, B are_independent holds prob(A) = 0 or prob(B) = 0; begin notation synonym 0. for 0; end; definition redefine func 0. -> R_eal; let x be R_eal; redefine func - x -> R_eal; let y be R_eal; redefine func x + y -> R_eal; redefine func x - y -> R_eal; end; theorem for x,y being R_eal, a,b being Real st x = a & y = b holds x + y = a + b; theorem for x being R_eal, a being Real st x = a holds - x = - a; theorem for x,y being R_eal, a,b being Real st x = a & y = b holds x - y = a - b; notation let X,Y be Subset of ExtREAL; synonym X + Y for X ++ Y; end; definition let X,Y be Subset of ExtREAL; redefine func X + Y -> Subset of ExtREAL; end; notation let X be Subset of ExtREAL; synonym -X for --X; end; definition let X be Subset of ExtREAL; redefine func - X -> Subset of ExtREAL; end; canceled; theorem for X being non empty Subset of ExtREAL, z being R_eal holds z in X iff - z in - X; theorem for X,Y being non empty Subset of ExtREAL holds X c= Y iff - X c= - Y; theorem for z being R_eal holds z in REAL iff - z in REAL; definition let X be ext-real-membered set; redefine func inf X -> R_eal; redefine func sup X -> R_eal; end; theorem for X,Y being non empty Subset of ExtREAL holds sup (X + Y) <= sup X + sup Y; theorem for X,Y being non empty Subset of ExtREAL holds inf X + inf Y <= inf (X + Y); theorem for X,Y being non empty Subset of ExtREAL holds X is bounded_above & Y is bounded_above implies sup (X + Y) <= sup X + sup Y; theorem for X,Y being non empty Subset of ExtREAL st X is bounded_below & Y is bounded_below holds inf X + inf Y <= inf (X + Y); theorem for X being non empty Subset of ExtREAL, a being R_eal holds a is UpperBound of X iff - a is LowerBound of - X; theorem for X being non empty Subset of ExtREAL holds for a being R_eal holds a is LowerBound of X iff - a is UpperBound of - X; theorem for X being non empty Subset of ExtREAL holds inf(- X) = - sup X; theorem for X be non empty Subset of ExtREAL holds sup(- X) = - inf X; definition let X be non empty set; let Y be non empty Subset of ExtREAL; let F be Function of X,Y; redefine func rng F -> non empty Subset of ExtREAL; end; definition let D be ext-real-membered set; let X be set; let Y be Subset of D; let F be PartFunc of X,Y; func sup F -> Element of ExtREAL equals sup rng F; func inf F -> Element of ExtREAL equals inf rng F; end; definition let F be ext-real-valued Function; let x be set; redefine func F.x -> R_eal; end; definition let X be non empty set; let Y,Z be non empty Subset of ExtREAL; let F be Function of X,Y; let G be Function of X,Z; func F + G -> Function of X,Y + Z means for x being Element of X holds it.x = F.x + G.x; end; theorem for X being non empty set, Y,Z being non empty Subset of ExtREAL, F being Function of X,Y, G being Function of X,Z holds rng(F + G) c= rng F + rng G; theorem for X being non empty set, Y,Z being non empty Subset of ExtREAL for F being Function of X,Y for G being Function of X,Z holds sup(F + G) <= sup F + sup G; theorem for X being non empty set holds for Y,Z being non empty Subset of ExtREAL for F being Function of X,Y for G being Function of X,Z holds inf F + inf G <= inf(F + G); definition let X be non empty set; let Y be non empty Subset of ExtREAL; let F be Function of X,Y; func - F -> Function of X,- Y means for x being Element of X holds it.x = - F.x; end; theorem for X being non empty set, Y being non empty Subset of ExtREAL, F being Function of X,Y holds rng(- F) = - rng F; theorem for X being non empty set, Y being non empty Subset of ExtREAL for F being Function of X,Y holds inf(- F) = - sup F & sup(- F) = - inf F; definition let X be set; let Y be Subset of ExtREAL; let F be Function of X,Y; attr F is bounded_above means sup F < +infty; attr F is bounded_below means -infty < inf F; end; definition let X be set, Y be Subset of ExtREAL, F be Function of X,Y; attr F is bounded means F is bounded_above bounded_below; end; registration let X be set; let Y be Subset of ExtREAL; cluster bounded -> bounded_above bounded_below for Function of X, Y; cluster bounded_above bounded_below -> bounded for Function of X, Y; end; theorem for X being non empty set, Y being non empty Subset of ExtREAL, F being Function of X,Y holds F is bounded iff sup F <+infty & -infty Function of NAT,ExtREAL means D = rng it; end; definition let D be Denum_Set_of_R_EAL; let N be Num of D; func Ser(D,N) -> Function of NAT,ExtREAL means it.0 = N.0 & for n being Element of NAT for y being R_eal st y = it.n holds it.(n + 1) = y + N.(n + 1); end; theorem for D being Pos_Denum_Set_of_R_EAL, N being Num of D, n being Element of NAT holds 0. <= N.n; theorem for D being Pos_Denum_Set_of_R_EAL, N being Num of D, n being Element of NAT holds Ser(D,N).n <= Ser(D,N).(n + 1) & 0. <= Ser(D,N).n; theorem for D being Pos_Denum_Set_of_R_EAL, N being Num of D, n,m being Element of NAT holds Ser(D,N).n <= Ser(D,N).(n + m); definition let D be Denum_Set_of_R_EAL; mode Set_of_Series of D -> non empty Subset of ExtREAL means ex N being Num of D st it = rng Ser(D,N); end; definition let D be Pos_Denum_Set_of_R_EAL; let N be Num of D; func SUM(D,N) -> R_eal equals sup(rng Ser(D,N)); end; definition let D be Pos_Denum_Set_of_R_EAL; let N be Num of D; pred D is_sumable N means SUM(D,N) in REAL; end; theorem for F being Function of NAT,ExtREAL holds rng F is Denum_Set_of_R_EAL; definition let F be Function of NAT,ExtREAL; redefine func rng F -> Denum_Set_of_R_EAL; end; definition let F be Function of NAT,ExtREAL; func Ser(F) -> Function of NAT,ExtREAL means for N being Num of rng F st N = F holds it = Ser(rng F,N); end; definition let R be Relation; attr R is nonnegative means rng R is nonnegative; end; definition let F be Function of NAT,ExtREAL; func SUM(F) -> R_eal equals sup rng Ser(F); end; theorem for X being set, F being PartFunc of X,ExtREAL holds F is nonnegative iff for n being Element of X holds 0. <= F.n; theorem for F being Function of NAT,ExtREAL, n being Element of NAT st F is nonnegative holds (Ser F).n <= (Ser F).(n + 1) & 0. <= (Ser F).n; theorem for F being Function of NAT,ExtREAL st F is nonnegative holds for n,m being Element of NAT holds Ser(F).n <= Ser(F).(n + m); theorem for F1,F2 being Function of NAT,ExtREAL st (for n being Element of NAT holds F1.n <= F2.n) holds for n being Element of NAT holds Ser(F1).n <= Ser(F2).n; theorem for F1,F2 being Function of NAT,ExtREAL st (for n being Element of NAT holds F1.n <= F2.n) holds SUM(F1) <= SUM(F2); theorem for F being Function of NAT,E