begin
theorem OM1:
defpred S1[ set , set , set , set ] means ( $3 <> $1 & $3 <> $2 & $4 <> $1 & $4 <> $2 );
defpred S2[ set , set , set , set ] means ( $3 in $1 & $4 = $1 );
defpred S3[ set , set , set , set ] means ( $3 in $1 & $4 = $2 );
defpred S4[ set , set , set , set ] means ( $3 = $1 & $4 in $2 );
defpred S5[ set , set , set , set ] means ( $3 = $1 & $4 = $2 );
defpred S6[ set , set , set , set ] means ( $3 = $1 & $2 in $4 );
defpred S7[ set , set , set , set ] means ( $1 in $3 & $4 = $2 );
defpred S8[ set , set , set , set ] means ( $3 = $2 & $2 in $4 );
theorem Eight:
for
a,
b,
c,
d being
ordinal number st
a in b &
c in d & not (
c <> a &
c <> b &
d <> a &
d <> b ) & not (
c in a &
d = a ) & not (
c in a &
d = b ) & not (
c = a &
d in b ) & not (
c = a &
d = b ) & not (
c = a &
b in d ) & not (
a in c &
d = b ) holds
(
c = b &
b in d )
theorem
theorem Lem2:
theorem Lem3:
theorem Th008:
theorem Th009:
begin
:: deftheorem SEG defines segmental EXCHSORT:def 1 :
for f being set holds
( f is segmental iff ex a, b being ordinal number st proj1 f = a \ b );
theorem
theorem OM2:
:: deftheorem AB defines -based EXCHSORT:def 2 :
for a being ordinal number
for s being set holds
( s is a -based iff for b being ordinal number st b in proj1 s holds
( a in proj1 s & a c= b ) );
:: deftheorem LI defines -limited EXCHSORT:def 3 :
for a being ordinal number
for s being set holds
( s is a -limited iff a = sup (proj1 s) );
theorem
theorem
theorem Th003:
theorem
theorem
:: deftheorem BA defines base- EXCHSORT:def 4 :
for f being Function
for b2 being ordinal number holds
( ( ex a being ordinal number st a in dom f implies ( b2 = base- f iff f is b2 -based ) ) & ( ( for a being ordinal number holds not a in dom f ) implies ( b2 = base- f iff b2 = 0 ) ) );
:: deftheorem LIM defines limit- EXCHSORT:def 5 :
for f being Function
for b2 being ordinal number holds
( ( ex a being ordinal number st a in dom f implies ( b2 = limit- f iff f is b2 -limited ) ) & ( ( for a being ordinal number holds not a in dom f ) implies ( b2 = limit- f iff b2 = 0 ) ) );
:: deftheorem defines len- EXCHSORT:def 6 :
for f being Function holds len- f = (limit- f) -^ (base- f);
theorem EE:
theorem Th005:
theorem
theorem Th002:
theorem
theorem Th007:
theorem
theorem
theorem Th011:
theorem TT0:
:: deftheorem defines last EXCHSORT:def 7 :
for A being array holds last A = A . (union (dom A));
begin
:: deftheorem DSC defines descending EXCHSORT:def 8 :
for f being Function holds
( f is descending iff for a, b being ordinal number st a in dom f & b in dom f & a in b holds
f . b c< f . a );
theorem
theorem DSC2:
theorem TD1:
theorem
begin
theorem TSa:
theorem TSa2:
theorem TSb:
theorem TSb2:
theorem TSc:
theorem TSc2:
theorem
theorem
begin
:: deftheorem PERM defines permutation EXCHSORT:def 9 :
for A, b2 being array holds
( b2 is permutation of A iff ex f being Permutation of (dom A) st b2 = A * f );
theorem ThDom:
theorem ThRef:
theorem ThSym:
theorem ThTr:
theorem Th11:
theorem Th12:
theorem Th13:
theorem
begin
:: deftheorem defines ascending EXCHSORT:def 10 :
for O being RelStr
for A being array of O holds
( A is ascending iff for a, b being ordinal number st a in dom A & b in dom A & a in b holds
A /. a <= A /. b );
:: deftheorem defines inversions EXCHSORT:def 11 :
for O being RelStr
for A being array of O holds inversions A = { [a,b] where a, b is Element of dom A : ( a in b & not A /. a <= A /. b ) } ;
theorem LemO:
:: deftheorem defines inversions EXCHSORT:def 12 :
for O being non empty connected Poset
for R being array of O holds inversions R = { [a,b] where a, b is Element of dom R : ( a in b & R /. a > R /. b ) } ;
theorem TW0:
theorem TW1:
theorem SORT:
theorem TW2:
theorem TW3:
theorem TC5:
theorem TC1:
theorem TC2:
theorem TC3:
theorem TC4:
theorem TC8:
theorem TC6:
theorem TC7:
definition
let O be non
empty connected Poset;
let R be
array of
O;
let x,
y be
set ;
func (
R,
x,
y)
incl -> Function equals
[:(Swap ((id (dom R)),x,y)),(Swap ((id (dom R)),x,y)):] +* (id ([:{x},((succ y) \ x):] \/ [:((succ y) \ x),{y}:]));
coherence
[:(Swap ((id (dom R)),x,y)),(Swap ((id (dom R)),x,y)):] +* (id ([:{x},((succ y) \ x):] \/ [:((succ y) \ x),{y}:])) is Function
;
end;
:: deftheorem defines incl EXCHSORT:def 13 :
for O being non empty connected Poset
for R being array of O
for x, y being set holds (R,x,y) incl = [:(Swap ((id (dom R)),x,y)),(Swap ((id (dom R)),x,y)):] +* (id ([:{x},((succ y) \ x):] \/ [:((succ y) \ x),{y}:]));
theorem TT:
theorem FF1:
theorem FF2:
theorem FF3:
for
O being non
empty connected Poset for
T being non
empty array of
O for
p,
r,
q being
Element of
dom T st
p c= r &
r c= q holds
(
((T,p,q) incl) . (
p,
r)
= [p,r] &
((T,p,q) incl) . (
r,
q)
= [r,q] )
theorem FF5:
theorem FF6:
for
f being
Function for
O being non
empty connected Poset for
T being non
empty array of
O for
r,
p,
q being
Element of
dom T st
r in p &
f = Swap (
(id (dom T)),
p,
q) holds
(
((T,p,q) incl) . (
r,
q)
= [(f . r),(f . q)] &
((T,p,q) incl) . (
r,
p)
= [(f . r),(f . p)] )
theorem FF7:
for
f being
Function for
O being non
empty connected Poset for
T being non
empty array of
O for
q,
r,
p being
Element of
dom T st
q in r &
f = Swap (
(id (dom T)),
p,
q) holds
(
((T,p,q) incl) . (
p,
r)
= [(f . p),(f . r)] &
((T,p,q) incl) . (
q,
r)
= [(f . q),(f . r)] )
theorem Case5:
theorem Case1:
theorem Case23:
for
O being non
empty connected Poset for
T being non
empty array of
O for
r,
p,
q being
Element of
dom T st
r in p &
p in q holds
(
((T,p,q) incl) . (
r,
p)
= [r,q] &
((T,p,q) incl) . (
r,
q)
= [r,p] )
theorem Case47:
for
O being non
empty connected Poset for
T being non
empty array of
O for
p,
s,
q being
Element of
dom T st
p in s &
s in q holds
(
((T,p,q) incl) . (
p,
s)
= [p,s] &
((T,p,q) incl) . (
s,
q)
= [s,q] )
theorem Case68:
for
O being non
empty connected Poset for
T being non
empty array of
O for
p,
q,
s being
Element of
dom T st
p in q &
q in s holds
(
((T,p,q) incl) . (
p,
s)
= [q,s] &
((T,p,q) incl) . (
q,
s)
= [p,s] )
O2O:
for f being Function
for O being non empty connected Poset
for T being non empty array of O
for p, q being Element of dom T st p in q & f = (T,p,q) incl holds
for x1, x2, y1, y2 being Element of dom T st x1 in y1 & x2 in y2 & f . (x1,y1) = f . (x2,y2) holds
( x1 = x2 & y1 = y2 )
theorem one2one:
begin
theorem MAIN1:
theorem MAIN3:
theorem
:: deftheorem COMP defines arr_computation EXCHSORT:def 14 :
for O being non empty connected Poset
for R being array of O
for b3 being non empty array holds
( b3 is arr_computation of R iff ( b3 . (base- b3) = R & ( for a being ordinal number st a in dom b3 holds
b3 . a is array of O ) & ( for a being ordinal number st a in dom b3 & succ a in dom b3 holds
ex R being array of O ex x, y being set st
( [x,y] in inversions R & b3 . a = R & b3 . (succ a) = Swap (R,x,y) ) ) ) );
theorem TC0:
:: deftheorem COMPL defines complete EXCHSORT:def 15 :
for O being non empty connected Poset
for R being array of O
for C being arr_computation of R holds
( C is complete iff last C is ascending );
theorem MAIN4:
theorem
theorem Th83:
begin
theorem Lem3:
theorem Lem4:
theorem Lem5:
theorem ThF:
theorem
theorem Lem1:
theorem ThComp:
theorem ThSort: