let n, i, j be Element of NAT ; :: thesis: ( i <= n & j <= n implies ex fs1 being FinSequence of NAT st
( fs1 . 1 = i & fs1 . (len fs1) = j & len fs1 = ((i -' j) + (j -' i)) + 1 & ( for k, k1 being Element of NAT st 1 <= k & k <= len fs1 & k1 = fs1 . k holds
k1 <= n ) & ( for i1 being Element of NAT st 1 <= i1 & i1 < len fs1 & not fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) ) )
assume A1:
( i <= n & j <= n )
; :: thesis: ex fs1 being FinSequence of NAT st
( fs1 . 1 = i & fs1 . (len fs1) = j & len fs1 = ((i -' j) + (j -' i)) + 1 & ( for k, k1 being Element of NAT st 1 <= k & k <= len fs1 & k1 = fs1 . k holds
k1 <= n ) & ( for i1 being Element of NAT st 1 <= i1 & i1 < len fs1 & not fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )
now per cases
( i < j or i = j or j < i )
by XXREAL_0:1;
case A2:
i < j
;
:: thesis: ex fs1 being FinSequence of NAT st
( fs1 . 1 = i & fs1 . (len fs1) = j & len fs1 = ((i -' j) + (j -' i)) + 1 & ( for k, k1 being Element of NAT st 1 <= k & k <= len fs1 & k1 = fs1 . k holds
k1 <= n ) & ( for i1 being Element of NAT st 1 <= i1 & i1 < len fs1 & not fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )then
j - i > 0
by XREAL_1:52;
then A3:
(j - i) + 1
> 0 + 1
by XREAL_1:8;
deffunc H1(
Nat)
-> Element of
NAT =
(i + $1) -' 1;
ex
p being
FinSequence st
(
len p = (j + 1) -' i & ( for
k being
Nat st
k in dom p holds
p . k = H1(
k) ) )
from FINSEQ_1:sch 2();
then consider p being
FinSequence such that A4:
(
len p = (j + 1) -' i & ( for
k being
Nat st
k in dom p holds
p . k = (i + k) -' 1 ) )
;
A5:
for
k,
k1 being
Element of
NAT st 1
<= k &
k <= len p &
k1 = p . k holds
k1 <= n
A9:
(j + 1) - i >= 0
by A3;
A10:
(j + 1) -' i = (j + 1) - i
by A3, XREAL_0:def 2;
A11:
(j + 1) -' i = (j - i) + 1
by A9, XREAL_0:def 2;
1
in dom p
by A3, A10, FINSEQ_3:27, A4;
then
p . 1
= (i + 1) -' 1
by A4;
then A12:
p . 1
= i
by NAT_D:34;
A13:
j - i >= i - i
by A2, XREAL_1:11;
A14:
(i + ((j + 1) -' i)) -' 1
= (i + ((j + 1) -' i)) - 1
by A11, XREAL_0:def 2;
len p in dom p
by FINSEQ_3:27, A3, A10, A4;
then A15:
p . (len p) = j
by A4, A10, A14;
i - j < j - j
by A2, XREAL_1:11;
then
i -' j = 0
by XREAL_0:def 2;
then A16:
len p = ((i -' j) + (j -' i)) + 1
by A4, A11, A13, XREAL_0:def 2;
rng p c= NAT
then reconsider fs2 =
p as
FinSequence of
NAT by FINSEQ_1:def 4;
for
i1 being
Element of
NAT st 1
<= i1 &
i1 < len fs2 & not
fs2 . (i1 + 1) = (fs2 /. i1) + 1 holds
fs2 . i1 = (fs2 /. (i1 + 1)) + 1
hence
ex
fs1 being
FinSequence of
NAT st
(
fs1 . 1
= i &
fs1 . (len fs1) = j &
len fs1 = ((i -' j) + (j -' i)) + 1 & ( for
k,
k1 being
Element of
NAT st 1
<= k &
k <= len fs1 &
k1 = fs1 . k holds
k1 <= n ) & ( for
i1 being
Element of
NAT st 1
<= i1 &
i1 < len fs1 & not
fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )
by A5, A12, A15, A16;
:: thesis: verum end; case A25:
i = j
;
:: thesis: ex fs1 being FinSequence of NAT st
( fs1 . 1 = i & fs1 . (len fs1) = j & len fs1 = ((i -' j) + (j -' i)) + 1 & ( for k, k1 being Element of NAT st 1 <= k & k <= len fs1 & k1 = fs1 . k holds
k1 <= n ) & ( for i1 being Element of NAT st 1 <= i1 & i1 < len fs1 & not fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )consider f being
Function such that A26:
(
dom f = Seg 1 &
rng f = {i} )
by FUNCT_1:15;
A27:
rng f c= NAT
by A26, ZFMISC_1:37;
f is
FinSequence-like
by A26, FINSEQ_1:def 2;
then reconsider fs1 =
f as
FinSequence of
NAT by A27, FINSEQ_1:def 4;
1
in dom f
by A26, FINSEQ_1:3;
then
fs1 . 1
in rng f
by FUNCT_1:def 5;
then A28:
fs1 . 1
= i
by A26, TARSKI:def 1;
A29:
len fs1 = 1
by A26, FINSEQ_1:def 3;
i - j = 0
by A25;
then A30:
i -' j = 0
by XREAL_0:def 2;
A31:
for
k,
k1 being
Element of
NAT st 1
<= k &
k <= len fs1 &
k1 = fs1 . k holds
k1 <= n
by A1, A28, A29, XXREAL_0:1;
for
i1 being
Element of
NAT st 1
<= i1 &
i1 < len fs1 & not
fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1
by A26, FINSEQ_1:def 3;
hence
ex
fs1 being
FinSequence of
NAT st
(
fs1 . 1
= i &
fs1 . (len fs1) = j &
len fs1 = ((i -' j) + (j -' i)) + 1 & ( for
k,
k1 being
Element of
NAT st 1
<= k &
k <= len fs1 &
k1 = fs1 . k holds
k1 <= n ) & ( for
i1 being
Element of
NAT st 1
<= i1 &
i1 < len fs1 & not
fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )
by A25, A28, A29, A30, A31;
:: thesis: verum end; case A32:
j < i
;
:: thesis: ex fs1 being FinSequence of NAT st
( fs1 . 1 = i & fs1 . (len fs1) = j & len fs1 = ((i -' j) + (j -' i)) + 1 & ( for k, k1 being Element of NAT st 1 <= k & k <= len fs1 & k1 = fs1 . k holds
k1 <= n ) & ( for i1 being Element of NAT st 1 <= i1 & i1 < len fs1 & not fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )then
i - j > 0
by XREAL_1:52;
then A33:
(i - j) + 1
> 0 + 1
by XREAL_1:8;
deffunc H1(
Nat)
-> Element of
NAT =
(i + 1) -' $1;
ex
p being
FinSequence st
(
len p = (i + 1) -' j & ( for
k being
Nat st
k in dom p holds
p . k = H1(
k) ) )
from FINSEQ_1:sch 2();
then consider p being
FinSequence such that A34:
(
len p = (i + 1) -' j & ( for
k being
Nat st
k in dom p holds
p . k = (i + 1) -' k ) )
;
A35:
for
k,
k1 being
Element of
NAT st 1
<= k &
k <= len p &
k1 = p . k holds
k1 <= n
A39:
(i + 1) -' j = (i + 1) - j
by A33, XREAL_0:def 2;
then
1
in dom p
by A33, FINSEQ_3:27, A34;
then A40:
p . 1
= (i + 1) -' 1
by A34;
(i + 1) - 1
>= 0
;
then A41:
p . 1
= i
by A40, XREAL_0:def 2;
A42:
i - j >= j - j
by A32, XREAL_1:11;
then
(i - j) + 1
>= 0 + 1
by XREAL_1:8;
then A43:
(i + 1) - j >= 0
;
A44:
(i + 1) - ((i + 1) -' j) =
(i + 1) - ((i + 1) - j)
by A33, XREAL_0:def 2
.=
j
;
len p in dom p
by FINSEQ_3:27, A33, A34, A39;
then A46:
p . (len p) =
(i + 1) -' ((i + 1) -' j)
by A34
.=
j
by A44, XREAL_0:def 2
;
j - i < i - i
by A32, XREAL_1:11;
then
j -' i = 0
by XREAL_0:def 2;
then A47:
((i -' j) + (j -' i)) + 1 =
((i - j) + 1) + (j -' i)
by A42, XREAL_0:def 2
.=
(i + 1) - j
by A45
;
rng p c= NAT
then reconsider fs2 =
p as
FinSequence of
NAT by FINSEQ_1:def 4;
for
i1 being
Element of
NAT st 1
<= i1 &
i1 < len fs2 & not
fs2 . (i1 + 1) = (fs2 /. i1) + 1 holds
fs2 . i1 = (fs2 /. (i1 + 1)) + 1
hence
ex
fs1 being
FinSequence of
NAT st
(
fs1 . 1
= i &
fs1 . (len fs1) = j &
len fs1 = ((i -' j) + (j -' i)) + 1 & ( for
k,
k1 being
Element of
NAT st 1
<= k &
k <= len fs1 &
k1 = fs1 . k holds
k1 <= n ) & ( for
i1 being
Element of
NAT st 1
<= i1 &
i1 < len fs1 & not
fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )
by A34, A35, A39, A41, A46, A47;
:: thesis: verum end; end; end;
hence
ex fs1 being FinSequence of NAT st
( fs1 . 1 = i & fs1 . (len fs1) = j & len fs1 = ((i -' j) + (j -' i)) + 1 & ( for k, k1 being Element of NAT st 1 <= k & k <= len fs1 & k1 = fs1 . k holds
k1 <= n ) & ( for i1 being Element of NAT st 1 <= i1 & i1 < len fs1 & not fs1 . (i1 + 1) = (fs1 /. i1) + 1 holds
fs1 . i1 = (fs1 /. (i1 + 1)) + 1 ) )
; :: thesis: verum