let p be FinSequence; :: thesis: for x being set holds
( p just_once_values x iff ( x in rng p & p - {x} = (p -| x) ^ (p |-- x) ) )
let x be set ; :: thesis: ( p just_once_values x iff ( x in rng p & p - {x} = (p -| x) ^ (p |-- x) ) )
set q = p - {x};
set r = p -| x;
set s = p |-- x;
thus
( p just_once_values x implies ( x in rng p & p - {x} = (p -| x) ^ (p |-- x) ) )
:: thesis: ( x in rng p & p - {x} = (p -| x) ^ (p |-- x) implies p just_once_values x )proof
assume A1:
p just_once_values x
;
:: thesis: ( x in rng p & p - {x} = (p -| x) ^ (p |-- x) )
hence A2:
x in rng p
by Th7;
:: thesis: p - {x} = (p -| x) ^ (p |-- x)
then (len (p -| x)) + (len (p |-- x)) =
((x .. p) - 1) + (len (p |-- x))
by Th46
.=
((x .. p) - 1) + ((len p) - (x .. p))
by A2, Def7
.=
(len p) - 1
.=
len (p - {x})
by A1, Th40
;
then A3:
dom (p - {x}) = Seg ((len (p -| x)) + (len (p |-- x)))
by FINSEQ_1:def 3;
A4:
now let k be
Nat;
:: thesis: ( k in dom (p -| x) implies (p - {x}) . k = (p -| x) . k )assume A5:
k in dom (p -| x)
;
:: thesis: (p - {x}) . k = (p -| x) . kthen A6:
(p -| x) . k = p . k
by A2, Th48;
x .. p <= len p
by A2, Th31;
then
(x .. p) - 1
<= (len p) - 1
by XREAL_1:11;
then
len (p -| x) <= (len p) - 1
by A2, Th46;
then
len (p -| x) <= len (p - {x})
by A1, Th40;
then A7:
(
Seg (len (p -| x)) c= Seg (len (p - {x})) &
Seg (len (p -| x)) = dom (p -| x) &
Seg (len (p - {x})) = dom (p - {x}) )
by FINSEQ_1:7, FINSEQ_1:def 3;
k in Seg (len (p -| x))
by A5, FINSEQ_1:def 3;
then
k <= len (p -| x)
by FINSEQ_1:3;
then
k <= (x .. p) - 1
by A2, Th46;
then
(
k + 1
<= x .. p &
k < k + 1 )
by XREAL_1:21, XREAL_1:31;
then
k < x .. p
by XXREAL_0:2;
hence
(p - {x}) . k = (p -| x) . k
by A1, A5, A6, A7, Th41;
:: thesis: verum end;
now let k be
Nat;
:: thesis: ( k in dom (p |-- x) implies (p - {x}) . ((len (p -| x)) + k) = (p |-- x) . k )assume A8:
k in dom (p |-- x)
;
:: thesis: (p - {x}) . ((len (p -| x)) + k) = (p |-- x) . kthen A9:
(p |-- x) . k = p . (k + (x .. p))
by A2, Def7;
reconsider m =
(x .. p) - 1 as
Element of
NAT by A2, Th32;
set z =
k + m;
A10:
dom (p |-- x) = Seg (len (p |-- x))
by FINSEQ_1:def 3;
then A11:
( 1
<= k & 1
<= x .. p )
by A2, A8, Th31, FINSEQ_1:3;
then
1
+ 1
<= k + (x .. p)
by XREAL_1:9;
then A12:
1
<= (k + (x .. p)) - 1
by XREAL_1:21;
k <= len (p |-- x)
by A8, A10, FINSEQ_1:3;
then
k <= (len p) - (x .. p)
by A2, Def7;
then
k + (x .. p) <= len p
by XREAL_1:21;
then
(k + (x .. p)) - 1
<= (len p) - 1
by XREAL_1:11;
then
(
(k + (x .. p)) - 1
<= len (p - {x}) &
dom (p - {x}) = Seg (len (p - {x})) )
by A1, Th40, FINSEQ_1:def 3;
then A13:
k + m in dom (p - {x})
by A12;
(x .. p) + 1
<= k + (x .. p)
by A11, XREAL_1:9;
then
x .. p <= (k + (x .. p)) - 1
by XREAL_1:21;
then (p - {x}) . (k + m) =
p . ((k + m) + 1)
by A1, A13, Th41
.=
p . (k + (x .. p))
;
hence
(p - {x}) . ((len (p -| x)) + k) = (p |-- x) . k
by A2, A9, Th46;
:: thesis: verum end;
hence
p - {x} = (p -| x) ^ (p |-- x)
by A3, A4, FINSEQ_1:def 7;
:: thesis: verum
end;
assume A14:
x in rng p
; :: thesis: ( not p - {x} = (p -| x) ^ (p |-- x) or p just_once_values x )
assume A15:
p - {x} = (p -| x) ^ (p |-- x)
; :: thesis: p just_once_values x
hence
p just_once_values x
by A14, Th37; :: thesis: verum