let p be FinSequence; :: thesis: for x being object st x in rng p & p - {x} is one-to-one & p - {x} = (p -| x) ^ (p |-- x) holds
p is one-to-one

let x be object ; :: thesis: ( x in rng p & p - {x} is one-to-one & p - {x} = (p -| x) ^ (p |-- x) implies p is one-to-one )
assume that
A1: x in rng p and
A2: p - {x} is one-to-one and
A3: p - {x} = (p -| x) ^ (p |-- x) ; :: thesis: p is one-to-one
set q = p - {x};
let x1, x2 be object ; :: according to FUNCT_1:def 4 :: thesis: ( not x1 in dom p or not x2 in dom p or not p . x1 = p . x2 or x1 = x2 )
assume that
A4: x1 in dom p and
A5: x2 in dom p and
A6: p . x1 = p . x2 ; :: thesis: x1 = x2
reconsider k1 = x1, k2 = x2 as Element of NAT by A4, A5;
A7: p just_once_values x by A1, A3, Th54;
now :: thesis: x1 = x2
per cases ( ( x1 = x .. p & x2 = x .. p ) or ( x1 = x .. p & x .. p < k2 ) or ( x1 = x .. p & k2 < x .. p ) or ( k1 < x .. p & x .. p = x2 ) or ( k1 < x .. p & x .. p < k2 ) or ( k1 < x .. p & k2 < x .. p ) or ( x .. p < k1 & x .. p < k2 ) or ( x .. p < k1 & x .. p = x2 ) or ( x .. p < k1 & k2 < x .. p ) ) by XXREAL_0:1;
suppose ( x1 = x .. p & x2 = x .. p ) ; :: thesis: x1 = x2
hence x1 = x2 ; :: thesis: verum
end;
suppose ( x1 = x .. p & x .. p < k2 ) ; :: thesis: x1 = x2
hence x1 = x2 by A1, A5, A6, A7, Th19, Th26; :: thesis: verum
end;
suppose ( x1 = x .. p & k2 < x .. p ) ; :: thesis: x1 = x2
hence x1 = x2 by A1, A5, A6, A7, Th19, Th26; :: thesis: verum
end;
suppose ( k1 < x .. p & x .. p = x2 ) ; :: thesis: x1 = x2
hence x1 = x2 by A1, A4, A6, A7, Th19, Th26; :: thesis: verum
end;
suppose A8: ( k1 < x .. p & x .. p < k2 ) ; :: thesis: x1 = x2
x .. p <= len p by A1, Th21;
then k1 < len p by A8, XXREAL_0:2;
then k1 + 1 <= len p by NAT_1:13;
then k1 <= (len p) - 1 by XREAL_1:19;
then A9: k1 <= len (p - {x}) by A7, Th30;
k1 in Seg (len p) by A4, FINSEQ_1:def 3;
then 1 <= k1 by FINSEQ_1:1;
then k1 in Seg (len (p - {x})) by A9;
then A10: k1 in dom (p - {x}) by FINSEQ_1:def 3;
then A11: (p - {x}) . k1 = p . k1 by A7, A8, Th31;
consider m2 being Nat such that
A12: k2 = m2 + 1 by A8, NAT_1:6;
reconsider m2 = m2 as Element of NAT by ORDINAL1:def 12;
A13: x .. p <= m2 by A8, A12, NAT_1:13;
k2 in Seg (len p) by A5, FINSEQ_1:def 3;
then k2 <= len p by FINSEQ_1:1;
then m2 <= (len p) - 1 by A12, XREAL_1:19;
then A14: m2 <= len (p - {x}) by A7, Th30;
1 <= x .. p by A1, Th21;
then 1 <= m2 by A13, XXREAL_0:2;
then m2 in Seg (len (p - {x})) by A14;
then A15: m2 in dom (p - {x}) by FINSEQ_1:def 3;
then (p - {x}) . m2 = p . k2 by A7, A12, A13, Th31;
hence x1 = x2 by A2, A6, A8, A10, A13, A15, A11; :: thesis: verum
end;
suppose A16: ( k1 < x .. p & k2 < x .. p ) ; :: thesis: x1 = x2
end;
suppose A23: ( x .. p < k1 & x .. p < k2 ) ; :: thesis: x1 = x2
then consider m2 being Nat such that
A24: k2 = m2 + 1 by NAT_1:6;
consider m1 being Nat such that
A25: k1 = m1 + 1 by A23, NAT_1:6;
reconsider m1 = m1, m2 = m2 as Element of NAT by ORDINAL1:def 12;
k2 in Seg (len p) by A5, FINSEQ_1:def 3;
then k2 <= len p by FINSEQ_1:1;
then m2 <= (len p) - 1 by A24, XREAL_1:19;
then A26: m2 <= len (p - {x}) by A7, Th30;
A27: 1 <= x .. p by A1, Th21;
A28: x .. p <= m2 by A23, A24, NAT_1:13;
then 1 <= m2 by A27, XXREAL_0:2;
then m2 in Seg (len (p - {x})) by A26;
then A29: m2 in dom (p - {x}) by FINSEQ_1:def 3;
then A30: p . k2 = (p - {x}) . m2 by A7, A24, A28, Th31;
k1 in Seg (len p) by A4, FINSEQ_1:def 3;
then k1 <= len p by FINSEQ_1:1;
then m1 <= (len p) - 1 by A25, XREAL_1:19;
then A31: m1 <= len (p - {x}) by A7, Th30;
A32: x .. p <= m1 by A23, A25, NAT_1:13;
then 1 <= m1 by A27, XXREAL_0:2;
then m1 in Seg (len (p - {x})) by A31;
then A33: m1 in dom (p - {x}) by FINSEQ_1:def 3;
then p . k1 = (p - {x}) . m1 by A7, A25, A32, Th31;
hence x1 = x2 by A2, A6, A25, A24, A33, A29, A30; :: thesis: verum
end;
suppose ( x .. p < k1 & x .. p = x2 ) ; :: thesis: x1 = x2
hence x1 = x2 by A1, A4, A6, A7, Th19, Th26; :: thesis: verum
end;
suppose A34: ( x .. p < k1 & k2 < x .. p ) ; :: thesis: x1 = x2
end;
end;
end;
hence x1 = x2 ; :: thesis: verum