:: STIRL2_1 semantic presentation

theorem Th1: :: STIRL2_1:1
for b1 being non empty Subset of NAT holds min b1 = min* b1
proof end;

theorem Th2: :: STIRL2_1:2
for b1, b2 being non empty Subset of NAT holds min (min b1),(min b2) = min (b1 \/ b2)
proof end;

theorem Th3: :: STIRL2_1:3
for b1, b2 being Subset of NAT holds min (min* b1),(min* b2) <= min* (b1 \/ b2)
proof end;

theorem Th4: :: STIRL2_1:4
for b1, b2 being Subset of NAT holds
( not min* b1 in b1 /\ b2 implies min* b1 = min* (b1 \ b2) )
proof end;

theorem Th5: :: STIRL2_1:5
for b1 being Nat holds
( min* {b1} = b1 & min {b1} = b1 )
proof end;

theorem Th6: :: STIRL2_1:6
for b1, b2 being Nat holds
( min* {b1,b2} = min b1,b2 & min {b1,b2} = min b1,b2 )
proof end;

theorem Th7: :: STIRL2_1:7
for b1, b2, b3 being Nat holds min* {b1,b2,b3} = min b1,(min b2,b3)
proof end;

theorem Th8: :: STIRL2_1:8
for b1 being Nat holds
b1 is Subset of NAT
proof end;

registration
let c1 be Nat;
cluster -> natural Element of a1;
coherence
for b1 being Element of c1 holds b1 is natural
proof end;
end;

theorem Th9: :: STIRL2_1:9
for b1 being Nat
for b2 being non empty Subset of NAT holds
( b2 c= b1 implies b1 - 1 is Nat )
proof end;

theorem Th10: :: STIRL2_1:10
for b1, b2 being Nat holds
( b1 in b2 implies ( b1 <= b2 - 1 & b2 - 1 is Nat ) )
proof end;

theorem Th11: :: STIRL2_1:11
for b1 being Nat holds min* b1 = 0
proof end;

theorem Th12: :: STIRL2_1:12
for b1 being Nat
for b2 being non empty Subset of NAT holds
( b2 c= b1 implies min* b2 <= b1 - 1 )
proof end;

theorem Th13: :: STIRL2_1:13
for b1 being Nat
for b2 being non empty Subset of NAT holds
not ( b2 c= b1 & b2 <> {(b1 - 1)} & not min* b2 < b1 - 1 )
proof end;

theorem Th14: :: STIRL2_1:14
for b1 being Nat
for b2 being Subset of NAT holds
( b2 c= b1 & b1 > 0 implies min* b2 <= b1 - 1 )
proof end;

definition
let c1 be Nat;
let c2 be set ;
let c3 be Function of c1,c2;
let c4 be set ;
redefine func " as c3 " c4 -> Subset of NAT ;
coherence
c3 " c4 is Subset of NAT
proof end;
end;

definition
let c1 be set ;
let c2 be Nat;
let c3 be Function of c1,c2;
let c4 be set ;
redefine func . as c3 . c4 -> Element of a2;
coherence
c3 . c4 is Element of c2
proof end;
end;

registration
let c1 be set ;
let c2 be Subset of NAT ;
let c3 be Function of c1,c2;
let c4 be set ;
cluster a3 . a4 -> natural ;
coherence
c3 . c4 is natural
proof end;
end;

definition
let c1, c2 be Nat;
let c3 be Function of c1,c2;
attr a3 is "increasing means :Def1: :: STIRL2_1:def 1
( ( a1 = 0 implies a2 = 0 ) & ( a2 = 0 implies a1 = 0 ) & ( for b1, b2 being Nat holds
not ( b1 in rng a3 & b2 in rng a3 & b1 < b2 & not min* (a3 " {b1}) < min* (a3 " {b2}) ) ) );
end;

:: deftheorem Def1 defines "increasing STIRL2_1:def 1 :
for b1, b2 being Nat
for b3 being Function of b1,b2 holds
( b3 is "increasing iff ( ( b1 = 0 implies b2 = 0 ) & ( b2 = 0 implies b1 = 0 ) & ( for b4, b5 being Nat holds
not ( b4 in rng b3 & b5 in rng b3 & b4 < b5 & not min* (b3 " {b4}) < min* (b3 " {b5}) ) ) ) );

theorem Th15: :: STIRL2_1:15
for b1, b2 being Nat
for b3 being Function of b1,b2 holds
( b1 = 0 & b2 = 0 implies ( b3 is onto & b3 is "increasing ) )
proof end;

theorem Th16: :: STIRL2_1:16
for b1, b2, b3 being Nat
for b4 being Function of b2,b1 holds
( b2 > 0 implies min* (b4 " {b3}) <= b2 - 1 )
proof end;

theorem Th17: :: STIRL2_1:17
for b1, b2 being Nat
for b3 being Function of b1,b2 holds
( b3 is onto implies b1 >= b2 )
proof end;

theorem Th18: :: STIRL2_1:18
for b1, b2 being Nat
for b3 being Function of b1,b2 holds
( b3 is onto & b3 is "increasing implies for b4 being Nat holds
( b4 < b2 implies b4 <= min* (b3 " {b4}) ) )
proof end;

theorem Th19: :: STIRL2_1:19
for b1, b2 being Nat
for b3 being Function of b2,b1 holds
( b3 is onto & b3 is "increasing implies for b4 being Nat holds
( b4 < b1 implies min* (b3 " {b4}) <= (b2 - b1) + b4 ) )
proof end;

theorem Th20: :: STIRL2_1:20
for b1, b2 being Nat
for b3 being Function of b1,b2 holds
( b3 is onto & b3 is "increasing & b1 = b2 implies b3 = id b1 )
proof end;

theorem Th21: :: STIRL2_1:21
for b1, b2 being Nat
for b3 being Function of b2,b1 holds
( b3 = id b2 & b2 > 0 implies b3 is "increasing )
proof end;

theorem Th22: :: STIRL2_1:22
for b1, b2 being Nat holds
not ( ( b1 = 0 implies b2 = 0 ) & ( b2 = 0 implies b1 = 0 ) & ( for b3 being Function of b1,b2 holds
not b3 is "increasing ) )
proof end;

theorem Th23: :: STIRL2_1:23
for b1, b2 being Nat holds
not ( ( b1 = 0 implies b2 = 0 ) & ( b2 = 0 implies b1 = 0 ) & b1 >= b2 & ( for b3 being Function of b1,b2 holds
not ( b3 is onto & b3 is "increasing ) ) )
proof end;

scheme :: STIRL2_1:sch 1
s1{ F1() -> Nat, F2() -> Nat, P1[ set ] } :
{ b1 where B is Function of F1(),F2() : P1[b1] } is finite
proof end;

theorem Th24: :: STIRL2_1:24
for b1, b2 being Nat holds { b3 where B is Function of b1,b2 : ( b3 is onto & b3 is "increasing ) } is finite
proof end;

theorem Th25: :: STIRL2_1:25
for b1, b2 being Nat holds
Card { b3 where B is Function of b1,b2 : ( b3 is onto & b3 is "increasing ) } is Nat
proof end;

definition
let c1, c2 be Nat;
func c1 block c2 -> Nat equals :: STIRL2_1:def 2
Card { b1 where B is Function of a1,a2 : ( b1 is onto & b1 is "increasing ) } ;
coherence
Card { b1 where B is Function of c1,c2 : ( b1 is onto & b1 is "increasing ) } is Nat
by Th25;
end;

:: deftheorem Def2 defines block STIRL2_1:def 2 :
for b1, b2 being Nat holds b1 block b2 = Card { b3 where B is Function of b1,b2 : ( b3 is onto & b3 is "increasing ) } ;

theorem Th26: :: STIRL2_1:26
for b1 being Nat holds b1 block b1 = 1
proof end;

theorem Th27: :: STIRL2_1:27
for b1 being Nat holds
( b1 <> 0 implies 0 block b1 = 0 )
proof end;

theorem Th28: :: STIRL2_1:28
for b1 being Nat holds
( 0 block b1 = 1 iff b1 = 0 ) by Th26, Th27;

theorem Th29: :: STIRL2_1:29
for b1, b2 being Nat holds
( b1 < b2 implies b1 block b2 = 0 )
proof end;

theorem Th30: :: STIRL2_1:30
for b1 being Nat holds
( b1 block 0 = 1 iff b1 = 0 )
proof end;

theorem Th31: :: STIRL2_1:31
for b1 being Nat holds
( b1 <> 0 implies b1 block 0 = 0 )
proof end;

theorem Th32: :: STIRL2_1:32
for b1 being Nat holds
( b1 <> 0 implies b1 block 1 = 1 )
proof end;

Lemma24: for b1 being set holds
( Card b1 = 0 iff b1 is empty )
by CARD_2:59, CARD_1:47;

theorem Th33: :: STIRL2_1:33
for b1, b2 being Nat holds
( not ( ( ( 1 <= b1 & b1 <= b2 ) or b1 = b2 ) & not b2 block b1 > 0 ) & not ( b2 block b1 > 0 & not ( 1 <= b1 & b1 <= b2 ) & not b1 = b2 ) )
proof end;

scheme :: STIRL2_1:sch 2
s2{ F1() -> set , F2() -> set , F3() -> set , F4() -> set , F5() -> Function of F1(),F2(), F6( set ) -> set } :
ex b1 being Function of F3(),F4() st
( b1 | F1() = F5() & ( for b2 being set holds
( b2 in F3() \ F1() implies b1 . b2 = F6(b2) ) ) )
provided
E25: for b1 being set holds
( b1 in F3() \ F1() implies F6(b1) in F4() ) and E26: ( F1() c= F3() & F2() c= F4() ) and E27: ( F2() is empty implies F1() is empty )
proof end;

scheme :: STIRL2_1:sch 3
s3{ F1() -> set , F2() -> set , F3() -> set , F4() -> set , F5( set ) -> set , P1[ set , set , set ] } :
Card { b1 where B is Function of F1(),F2() : P1[b1,F1(),F2()] } = Card { b1 where B is Function of F3(),F4() : ( P1[b1,F3(),F4()] & rng (b1 | F1()) c= F2() & ( for b1 being set holds
( b2 in F3() \ F1() implies b1 . b2 = F5(b2) ) ) )
}
provided
E25: for b1 being set holds
( b1 in F3() \ F1() implies F5(b1) in F4() ) and E26: ( F1() c= F3() & F2() c= F4() ) and E27: ( F2() is empty implies F1() is empty ) and E28: for b1 being Function of F3(),F4() holds
( ( for b2 being set holds
( b2 in F3() \ F1() implies F5(b2) = b1 . b2 ) ) implies ( P1[b1,F3(),F4()] iff P1[b1 | F1(),F1(),F2()] ) )
proof end;

scheme :: STIRL2_1:sch 4
s4{ F1() -> set , F2() -> set , F3() -> set , F4() -> set , P1[ set , set , set ] } :
Card { b1 where B is Function of F1(),F2() : P1[b1,F1(),F2()] } = Card { b1 where B is Function of F1() \/ {F3()},F2() \/ {F4()} : ( P1[b1,F1() \/ {F3()},F2() \/ {F4()}] & rng (b1 | F1()) c= F2() & b1 . F3() = F4() ) }
provided
E25: ( F2() is empty implies F1() is empty ) and E26: not F3() in F1() and E27: for b1 being Function of F1() \/ {F3()},F2() \/ {F4()} holds
( b1 . F3() = F4() implies ( P1[b1,F1() \/ {F3()},F2() \/ {F4()}] iff P1[b1 | F1(),F1(),F2()] ) )
proof end;

theorem Th34: :: STIRL2_1:34
for b1, b2 being Nat
for b3 being Function of b1 + 1,b2 + 1 holds
( b3 is onto & b3 is "increasing & b3 " {(b3 . b1)} = {b1} implies b3 . b1 = b2 )
proof end;

theorem Th35: :: STIRL2_1:35
for b1, b2 being Nat
for b3 being Function of b1 + 1,b2 holds
not ( b2 <> 0 & b3 " {(b3 . b1)} <> {b1} & ( for b4 being Nat holds
not ( b4 in b3 " {(b3 . b1)} & b4 <> b1 ) ) )
proof end;

theorem Th36: :: STIRL2_1:36
for b1, b2, b3, b4 being Nat
for b5 being Function of b1,b2
for b6 being Function of b1 + b3,b2 + b4 holds
( b6 is "increasing & b5 = b6 | b1 implies for b7, b8 being Nat holds
not ( b7 in rng b5 & b8 in rng b5 & b7 < b8 & not min* (b5 " {b7}) < min* (b5 " {b8}) ) )
proof end;

theorem Th37: :: STIRL2_1:37
for b1, b2 being Nat
for b3 being Function of b1 + 1,b2 + 1 holds
( b3 is onto & b3 is "increasing & b3 " {(b3 . b1)} = {b1} implies ( rng (b3 | b1) c= b2 & ( for b4 being Function of b1,b2 holds
( b4 = b3 | b1 implies ( b4 is onto & b4 is "increasing ) ) ) ) )
proof end;

theorem Th38: :: STIRL2_1:38
for b1, b2 being Nat
for b3 being Function of b1 + 1,b2
for b4 being Function of b1,b2 holds
( b3 is onto & b3 is "increasing & b3 " {(b3 . b1)} <> {b1} & b3 | b1 = b4 implies ( b4 is onto & b4 is "increasing ) )
proof end;

theorem Th39: :: STIRL2_1:39
for b1, b2, b3 being Nat
for b4 being Function of b1,b2
for b5 being Function of b1 + 1,b2 + b3 holds
( b4 is onto & b4 is "increasing & b4 = b5 | b1 implies for b6, b7 being Nat holds
not ( b6 in rng b5 & b7 in rng b5 & b6 < b7 & not min* (b5 " {b6}) < min* (b5 " {b7}) ) )
proof end;

theorem Th40: :: STIRL2_1:40
for b1, b2 being Nat
for b3 being Function of b1,b2
for b4 being Function of b1 + 1,b2 + 1 holds
( b3 is onto & b3 is "increasing & b3 = b4 | b1 & b4 . b1 = b2 implies ( b4 is onto & b4 is "increasing & b4 " {(b4 . b1)} = {b1} ) )
proof end;

theorem Th41: :: STIRL2_1:41
for b1, b2 being Nat
for b3 being Function of b1,b2
for b4 being Function of b1 + 1,b2 holds
( b3 is onto & b3 is "increasing & b3 = b4 | b1 & b4 . b1 < b2 implies ( b4 is onto & b4 is "increasing & b4 " {(b4 . b1)} <> {b1} ) )
proof end;

Lemma33: for b1 being Nat holds b1 + 1 = b1 \/ {b1}
by AFINSQ_1:4;

Lemma34: for b1, b2 being Nat holds
( b1 < b2 implies b2 \/ {b1} = b2 )
proof end;

theorem Th42: :: STIRL2_1:42
for b1, b2 being Nat holds Card { b3 where B is Function of b1 + 1,b2 + 1 : ( b3 is onto & b3 is "increasing & b3 " {(b3 . b1)} = {b1} ) } = Card { b3 where B is Function of b1,b2 : ( b3 is onto & b3 is "increasing ) }
proof end;

theorem Th43: :: STIRL2_1:43
for b1, b2, b3 being Nat holds
( b3 < b1 implies Card { b4 where B is Function of b2 + 1,b1 : ( b4 is onto & b4 is "increasing & b4 " {(b4 . b2)} <> {b2} & b4 . b2 = b3 ) } = Card { b4 where B is Function of b2,b1 : ( b4 is onto & b4 is "increasing ) } )
proof end;

definition
let c1 be non empty set ;
let c2 be XFinSequence of c1;
let c3 be BinOp of c1;
assume E37: ( c3 has_a_unity or len c2 >= 1 ) ;
func c3 "**" c2 -> Element of a1 means :Def3: :: STIRL2_1:def 3
a4 = the_unity_wrt a3 if ( a3 has_a_unity & len a2 = 0 )
otherwise ex b1 being Function of NAT ,a1 st
( b1 . 0 = a2 . 0 & ( for b2 being Nat holds
( b2 + 1 < len a2 implies b1 . (b2 + 1) = a3 . (b1 . b2),(a2 . (b2 + 1)) ) ) & a4 = b1 . ((len a2) - 1) );
existence
( not ( c3 has_a_unity & len c2 = 0 & ( for b1 being Element of c1 holds
not b1 = the_unity_wrt c3 ) ) & not ( not ( c3 has_a_unity & len c2 = 0 ) & ( for b1 being Element of c1
for b2 being Function of NAT ,c1 holds
not ( b2 . 0 = c2 . 0 & ( for b3 being Nat holds
( b3 + 1 < len c2 implies b2 . (b3 + 1) = c3 . (b2 . b3),(c2 . (b3 + 1)) ) ) & b1 = b2 . ((len c2) - 1) ) ) ) )
proof end;
uniqueness
for b1, b2 being Element of c1 holds
( ( c3 has_a_unity & len c2 = 0 & b1 = the_unity_wrt c3 & b2 = the_unity_wrt c3 implies b1 = b2 ) & ( not ( c3 has_a_unity & len c2 = 0 ) & ex b3 being Function of NAT ,c1 st
( b3 . 0 = c2 . 0 & ( for b4 being Nat holds
( b4 + 1 < len c2 implies b3 . (b4 + 1) = c3 . (b3 . b4),(c2 . (b4 + 1)) ) ) & b1 = b3 . ((len c2) - 1) ) & ex b3 being Function of NAT ,c1 st
( b3 . 0 = c2 . 0 & ( for b4 being Nat holds
( b4 + 1 < len c2 implies b3 . (b4 + 1) = c3 . (b3 . b4),(c2 . (b4 + 1)) ) ) & b2 = b3 . ((len c2) - 1) ) implies b1 = b2 ) )
proof end;
consistency
for b1 being Element of c1 holds
verum
;
end;

:: deftheorem Def3 defines "**" STIRL2_1:def 3 :
for b1 being non empty set
for b2 being XFinSequence of b1
for b3 being BinOp of b1 holds
( ( b3 has_a_unity or len b2 >= 1 ) implies for b4 being Element of b1 holds
( ( b3 has_a_unity & len b2 = 0 implies ( b4 = b3 "**" b2 iff b4 = the_unity_wrt b3 ) ) & ( not ( b3 has_a_unity & len b2 = 0 ) implies ( b4 = b3 "**" b2 iff ex b5 being Function of NAT ,b1 st
( b5 . 0 = b2 . 0 & ( for b6 being Nat holds
( b6 + 1 < len b2 implies b5 . (b6 + 1) = b3 . (b5 . b6),(b2 . (b6 + 1)) ) ) & b4 = b5 . ((len b2) - 1) ) ) ) ) );

theorem Th44: :: STIRL2_1:44
for b1 being non empty set
for b2 being BinOp of b1
for b3 being Element of b1 holds b2 "**" <%b3%> = b3
proof end;

theorem Th45: :: STIRL2_1:45
for b1 being non empty set
for b2 being XFinSequence of b1
for b3 being BinOp of b1
for b4 being Element of b1 holds
( not ( not b3 has_a_unity & not len b2 > 0 ) implies b3 "**" (b2 ^ <%b4%>) = b3 . (b3 "**" b2),b4 )
proof end;

theorem Th46: :: STIRL2_1:46
for b1 being non empty set
for b2 being XFinSequence of b1 holds
not ( b2 <> <%> b1 & ( for b3 being XFinSequence of b1
for b4 being Element of b1 holds
not b2 = b3 ^ <%b4%> ) )
proof end;

scheme :: STIRL2_1:sch 5
s5{ F1() -> non empty set , P1[ set ] } :
for b1 being XFinSequence of F1() holds P1[b1]
provided
E41: P1[ <%> F1()] and E42: for b1 being XFinSequence of F1()
for b2 being Element of F1() holds
( P1[b1] implies P1[b1 ^ <%b2%>] )
proof end;

theorem Th47: :: STIRL2_1:47
for b1 being non empty set
for b2, b3 being XFinSequence of b1
for b4 being BinOp of b1 holds
( b4 is associative & ( b4 has_a_unity or ( len b2 >= 1 & len b3 >= 1 ) ) implies b4 "**" (b2 ^ b3) = b4 . (b4 "**" b2),(b4 "**" b3) )
proof end;

definition
let c1 be non empty set ;
let c2, c3 be Element of c1;
redefine func <% as <%c2,c3%> -> XFinSequence of a1;
coherence
<%c2,c3%> is XFinSequence of c1
proof end;
let c4 be Element of c1;
redefine func <% as <%c2,c3,c4%> -> XFinSequence of a1;
coherence
<%c2,c3,c4%> is XFinSequence of c1
proof end;
end;

theorem Th48: :: STIRL2_1:48
for b1 being non empty set
for b2 being BinOp of b1
for b3, b4 being Element of b1 holds b2 "**" <%b3,b4%> = b2 . b3,b4
proof end;

theorem Th49: :: STIRL2_1:49
for b1 being non empty set
for b2 being BinOp of b1
for b3, b4, b5 being Element of b1 holds b2 "**" <%b3,b4,b5%> = b2 . (b2 . b3,b4),b5
proof end;

definition
let c1 be XFinSequence of NAT ;
func Sum c1 -> Nat equals :: STIRL2_1:def 4
addnat "**" a1;
coherence
addnat "**" c1 is Nat
;
end;

:: deftheorem Def4 defines Sum STIRL2_1:def 4 :
for b1 being XFinSequence of NAT holds Sum b1 = addnat "**" b1;

definition
let c1 be XFinSequence of NAT ;
let c2 be set ;
redefine func . as c1 . c2 -> Nat;
coherence
c1 . c2 is Nat
proof end;
end;

theorem Th50: :: STIRL2_1:50
for b1 being Nat
for b2 being XFinSequence of NAT holds
( ( for b3 being Nat holds
( b3 in dom b2 implies b2 . b3 <= b1 ) ) implies Sum b2 <= (len b2) * b1 )
proof end;

theorem Th51: :: STIRL2_1:51
for b1 being Nat
for b2 being XFinSequence of NAT holds
( ( for b3 being Nat holds
( b3 in dom b2 implies b2 . b3 >= b1 ) ) implies Sum b2 >= (len b2) * b1 )
proof end;

theorem Th52: :: STIRL2_1:52
for b1 being Nat
for b2 being XFinSequence of NAT holds
( len b2 > 0 & ex b3 being set st
( b3 in dom b2 & b2 . b3 = b1 ) implies Sum b2 >= b1 )
proof end;

theorem Th53: :: STIRL2_1:53
for b1 being XFinSequence of NAT holds
( Sum b1 = 0 iff ( len b1 = 0 or for b2 being Nat holds
( b2 in dom b1 implies b1 . b2 = 0 ) ) )
proof end;

theorem Th54: :: STIRL2_1:54
for b1 being Function
for b2 being Nat holds (union (rng (b1 | b2))) \/ (b1 . b2) = union (rng (b1 | (b2 + 1)))
proof end;

scheme :: STIRL2_1:sch 6
s6{ F1() -> non empty set , F2() -> Nat, P1[ set , set ] } :
ex b1 being XFinSequence of F1() st
( dom b1 = F2() & ( for b2 being Nat holds
( b2 in F2() implies P1[b2,b1 . b2] ) ) )
provided
E45: for b1 being Nat holds
not ( b1 in F2() & ( for b2 being Element of F1() holds
not P1[b1,b2] ) )
proof end;

scheme :: STIRL2_1:sch 7
s7{ F1() -> non empty set , F2() -> XFinSequence of F1() } :
ex b1 being XFinSequence of NAT st
( dom b1 = dom F2() & ( for b2 being Nat holds
( b2 in dom b1 implies b1 . b2 = Card (F2() . b2) ) ) & Card (union (rng F2())) = Sum b1 )
provided
E45: for b1 being Nat holds
( b1 in dom F2() implies F2() . b1 is finite ) and E46: for b1, b2 being Nat holds
( b1 in dom F2() & b2 in dom F2() & b1 <> b2 implies F2() . b1 misses F2() . b2 )
proof end;

scheme :: STIRL2_1:sch 8
s8{ F1() -> finite set , F2() -> finite set , F3() -> set , P1[ set ], F4() -> Function of card F2(),F2() } :
ex b1 being XFinSequence of NAT st
( dom b1 = card F2() & Card { b2 where B is Function of F1(),F2() : P1[b2] } = Sum b1 & ( for b2 being Nat holds
( b2 in dom b1 implies b1 . b2 = Card { b3 where B is Function of F1(),F2() : ( P1[b3] & b3 . F3() = F4() . b2 ) } ) ) )
provided
E45: ( F4() is onto & F4() is one-to-one ) and E46: not F2() is empty and E47: F3() in F1()
proof end;

theorem Th55: :: STIRL2_1:55
for b1, b2 being Nat holds b1 * (b2 block b1) = Card { b3 where B is Function of b2 + 1,b1 : ( b3 is onto & b3 is "increasing & b3 " {(b3 . b2)} <> {b2} ) }
proof end;

theorem Th56: :: STIRL2_1:56
for b1, b2 being Nat holds (b1 + 1) block (b2 + 1) = ((b2 + 1) * (b1 block (b2 + 1))) + (b1 block b2)
proof end;

theorem Th57: :: STIRL2_1:57
for b1 being Nat holds
( b1 >= 1 implies b1 block 2 = (1 / 2) * ((2 |^ b1) - 2) )
proof end;

theorem Th58: :: STIRL2_1:58
for b1 being Nat holds
( b1 >= 2 implies b1 block 3 = (1 / 6) * (((3 |^ b1) - (3 * (2 |^ b1))) + 3) )
proof end;

Lemma49: for b1 being Nat holds b1 |^ 3 = (b1 * b1) * b1
proof end;

theorem Th59: :: STIRL2_1:59
for b1 being Nat holds
( b1 >= 3 implies b1 block 4 = (1 / 24) * ((((4 |^ b1) - (4 * (3 |^ b1))) + (6 * (2 |^ b1))) - 4) )
proof end;

theorem Th60: :: STIRL2_1:60
( 3 ! = 6 & 4 ! = 24 )
proof end;

theorem Th61: :: STIRL2_1:61
for b1 being Nat holds
( b1 choose 1 = b1 & b1 choose 2 = (b1 * (b1 - 1)) / 2 & b1 choose 3 = ((b1 * (b1 - 1)) * (b1 - 2)) / 6 & b1 choose 4 = (((b1 * (b1 - 1)) * (b1 - 2)) * (b1 - 3)) / 24 )
proof end;

theorem Th62: :: STIRL2_1:62
for b1 being Nat holds (b1 + 1) block b1 = (b1 + 1) choose 2
proof end;

theorem Th63: :: STIRL2_1:63
for b1 being Nat holds (b1 + 2) block b1 = (3 * ((b1 + 2) choose 4)) + ((b1 + 2) choose 3)
proof end;

theorem Th64: :: STIRL2_1:64
for b1 being Function
for b2 being set holds
( rng (b1 | ((dom b1) \ (b1 " {b2}))) = (rng b1) \ {b2} & ( for b3 being set holds
( b3 <> b2 implies (b1 | ((dom b1) \ (b1 " {b2}))) " {b3} = b1 " {b3} ) ) )
proof end;

theorem Th65: :: STIRL2_1:65
for b1 being Nat
for b2, b3 being set holds
( Card b2 = b1 + 1 & b3 in b2 implies Card (b2 \ {b3}) = b1 )
proof end;

scheme :: STIRL2_1:sch 9
s9{ P1[ set ], P2[ set , Function] } :
for b1 being Function holds
( rng b1 is finite implies P1[b1] )
provided
E55: P1[ {} ] and E56: for b1 being Function holds
( ( for b2 being set holds
( b2 in rng b1 & P2[b2,b1] implies P1[b1 | ((dom b1) \ (b1 " {b2}))] ) ) implies P1[b1] )
proof end;

theorem Th66: :: STIRL2_1:66
for b1 being Subset of NAT holds
not ( b1 is finite & ( for b2 being Nat holds
ex b3 being Nat st
( b3 in b1 & not b3 <= b2 ) ) )
proof end;

theorem Th67: :: STIRL2_1:67
for b1, b2, b3, b4 being set holds
( ( b2 is empty implies b1 is empty ) & not b3 in b1 implies for b5 being Function of b1,b2 holds
ex b6 being Function of b1 \/ {b3},b2 \/ {b4} st
( b6 | b1 = b5 & b6 . b3 = b4 ) )
proof end;

theorem Th68: :: STIRL2_1:68
for b1, b2, b3, b4 being set holds
( ( b2 is empty implies b1 is empty ) implies for b5 being Function of b1,b2
for b6 being Function of b1 \/ {b3},b2 \/ {b4} holds
( b6 | b1 = b5 & b6 . b3 = b4 implies ( ( b5 is onto implies b6 is onto ) & ( not b4 in b2 & b5 is one-to-one implies b6 is one-to-one ) ) ) )
proof end;

Lemma58: for b1, b2 being set holds
( b2 in b1 implies (b1 \ {b2}) \/ {b2} = b1 )
by ZFMISC_1:140;

theorem Th69: :: STIRL2_1:69
for b1 being finite Subset of NAT holds
ex b2 being Function of b1, card b1 st
( b2 is bijective & ( for b3, b4 being Nat holds
not ( b3 in dom b2 & b4 in dom b2 & b3 < b4 & not b2 . b3 < b2 . b4 ) ) )
proof end;

Lemma60: for b1 being finite set
for b2 being set holds
not ( b2 in b1 & not card (b1 \ {b2}) < card b1 )
proof end;

theorem Th70: :: STIRL2_1:70
for b1, b2 being finite set
for b3 being Function of b1,b2 holds
( card b1 = card b2 implies ( b3 is onto iff b3 is one-to-one ) )
proof end;

Lemma62: for b1 being Nat
for b2 being finite Subset of NAT
for b3 being Function of b2, card b2 holds
not ( b1 in b2 & b3 is bijective & ( for b4, b5 being Nat holds
not ( b4 in dom b3 & b5 in dom b3 & b4 < b5 & not b3 . b4 < b3 . b5 ) ) & ( for b4 being Permutation of b2 holds
ex b5 being Nat st
( b5 in b2 & not ( ( b5 < b1 implies b4 . b5 = (b3 " ) . ((b3 . b5) + 1) ) & ( b5 = b1 implies b4 . b5 = (b3 " ) . 0 ) & ( b5 > b1 implies b4 . b5 = b5 ) ) ) ) )
proof end;

theorem Th71: :: STIRL2_1:71
for b1, b2 being Function
for b3 being set holds
not ( b3 in rng (b2 * b1) & b2 is one-to-one & ( for b4 being set holds
not ( b4 in dom b2 & b4 in rng b1 & b2 " {b3} = {b4} & b1 " {b4} = (b2 * b1) " {b3} ) ) )
proof end;

definition
let c1, c2 be Subset of NAT ;
let c3 be Function of c1,c2;
attr a3 is "increasing means :Def5: :: STIRL2_1:def 5
for b1, b2 being Nat holds
not ( b1 in rng a3 & b2 in rng a3 & b1 < b2 & not min* (a3 " {b1}) < min* (a3 " {b2}) );
end;

:: deftheorem Def5 defines "increasing STIRL2_1:def 5 :
for b1, b2 being Subset of NAT
for b3 being Function of b1,b2 holds
( b3 is "increasing iff for b4, b5 being Nat holds
not ( b4 in rng b3 & b5 in rng b3 & b4 < b5 & not min* (b3 " {b4}) < min* (b3 " {b5}) ) );

theorem Th72: :: STIRL2_1:72
for b1, b2 being Subset of NAT
for b3 being Function of b1,b2 holds
( b3 is "increasing implies min* (rng b3) = b3 . (min* (dom b3)) )
proof end;

theorem Th73: :: STIRL2_1:73
for b1, b2 being Subset of NAT
for b3 being Function of b1,b2 holds
not ( rng b3 is finite & ( for b4 being Function of b1,b2
for b5 being Permutation of rng b3 holds
not ( b3 = b5 * b4 & rng b3 = rng b4 & b4 is "increasing ) ) )
proof end;

theorem Th74: :: STIRL2_1:74
for b1, b2, b3 being Subset of NAT
for b4 being Function of b1,b2 holds
( rng b4 is finite implies for b5, b6 being Function of b1,b3
for b7, b8 being Function holds
( b7 is one-to-one & b8 is one-to-one & rng b5 = rng b6 & rng b5 = dom b7 & dom b7 = dom b8 & b4 = b7 * b5 & b4 = b8 * b6 & b5 is "increasing & b6 is "increasing implies ( b7 = b8 & b5 = b6 ) ) )
proof end;

theorem Th75: :: STIRL2_1:75
for b1, b2 being Subset of NAT
for b3 being Function of b1,b2 holds
( rng b3 is finite implies for b4, b5 being Function of b1,b2
for b6, b7 being Permutation of rng b3 holds
( b3 = b6 * b4 & b3 = b7 * b5 & rng b3 = rng b4 & rng b3 = rng b5 & b4 is "increasing & b5 is "increasing implies ( b6 = b7 & b4 = b5 ) ) )
proof end;