:: FINSEQ_3 semantic presentation begin theorem Th1: :: FINSEQ_3:1 Seg 3 = {1,2,3} proof thus Seg 3 = {1,2} \/ {(2 + 1)} by FINSEQ_1:2, FINSEQ_1:9 .= {1,2,3} by ENUMSET1:3 ; ::_thesis: verum end; theorem Th2: :: FINSEQ_3:2 Seg 4 = {1,2,3,4} proof thus Seg 4 = {1,2,3} \/ {(3 + 1)} by Th1, FINSEQ_1:9 .= {1,2,3,4} by ENUMSET1:6 ; ::_thesis: verum end; theorem Th3: :: FINSEQ_3:3 Seg 5 = {1,2,3,4,5} proof thus Seg 5 = {1,2,3,4} \/ {(4 + 1)} by Th2, FINSEQ_1:9 .= {1,2,3,4,5} by ENUMSET1:10 ; ::_thesis: verum end; theorem Th4: :: FINSEQ_3:4 Seg 6 = {1,2,3,4,5,6} proof thus Seg 6 = {1,2,3,4,5} \/ {(5 + 1)} by Th3, FINSEQ_1:9 .= {1,2,3,4,5,6} by ENUMSET1:15 ; ::_thesis: verum end; theorem Th5: :: FINSEQ_3:5 Seg 7 = {1,2,3,4,5,6,7} proof thus Seg 7 = {1,2,3,4,5,6} \/ {(6 + 1)} by Th4, FINSEQ_1:9 .= {1,2,3,4,5,6,7} by ENUMSET1:21 ; ::_thesis: verum end; theorem :: FINSEQ_3:6 Seg 8 = {1,2,3,4,5,6,7,8} proof thus Seg 8 = {1,2,3,4,5,6,7} \/ {(7 + 1)} by Th5, FINSEQ_1:9 .= {1,2,3,4,5,6,7,8} by ENUMSET1:28 ; ::_thesis: verum end; theorem Th7: :: FINSEQ_3:7 for k being Nat holds ( Seg k = {} iff not k in Seg k ) proof let k be Nat; ::_thesis: ( Seg k = {} iff not k in Seg k ) thus ( Seg k = {} implies not k in Seg k ) ; ::_thesis: ( not k in Seg k implies Seg k = {} ) assume not k in Seg k ; ::_thesis: Seg k = {} then k = 0 by FINSEQ_1:3; hence Seg k = {} ; ::_thesis: verum end; theorem Th8: :: FINSEQ_3:8 for k being Nat holds not k + 1 in Seg k proof let k be Nat; ::_thesis: not k + 1 in Seg k assume k + 1 in Seg k ; ::_thesis: contradiction then A1: k + 1 <= k by FINSEQ_1:1; k <= k + 1 by NAT_1:12; then k + 0 = k + 1 by A1, XXREAL_0:1; hence contradiction ; ::_thesis: verum end; theorem :: FINSEQ_3:9 for k, n being Nat st k <> 0 holds k in Seg (k + n) proof let k, n be Nat; ::_thesis: ( k <> 0 implies k in Seg (k + n) ) assume k <> 0 ; ::_thesis: k in Seg (k + n) then A1: 0 + 1 <= k by NAT_1:13; k <= k + n by NAT_1:12; hence k in Seg (k + n) by A1, FINSEQ_1:1; ::_thesis: verum end; theorem Th10: :: FINSEQ_3:10 for k, n being Nat st k + n in Seg k holds n = 0 proof let k, n be Nat; ::_thesis: ( k + n in Seg k implies n = 0 ) assume k + n in Seg k ; ::_thesis: n = 0 then k + n <= k + 0 by FINSEQ_1:1; hence n = 0 by XREAL_1:6; ::_thesis: verum end; theorem :: FINSEQ_3:11 for k, n being Nat st k < n holds k + 1 in Seg n proof let k, n be Nat; ::_thesis: ( k < n implies k + 1 in Seg n ) assume k < n ; ::_thesis: k + 1 in Seg n then A1: k + 1 <= n by NAT_1:13; 1 <= k + 1 by NAT_1:12; hence k + 1 in Seg n by A1, FINSEQ_1:1; ::_thesis: verum end; theorem Th12: :: FINSEQ_3:12 for k, n, m being Nat st k in Seg n & m < k holds k - m in Seg n proof let k, n, m be Nat; ::_thesis: ( k in Seg n & m < k implies k - m in Seg n ) assume that A1: k in Seg n and A2: m < k ; ::_thesis: k - m in Seg n consider i being Nat such that A3: k = m + i by A2, NAT_1:10; reconsider x = k - m as Element of NAT by A3, ORDINAL1:def_12; A4: now__::_thesis:_1_<=_x assume not 1 <= x ; ::_thesis: contradiction then x = 0 by NAT_1:14; hence contradiction by A2; ::_thesis: verum end; A5: k <= n by A1, FINSEQ_1:1; i <= k by A3, NAT_1:12; then x <= n by A3, A5, XXREAL_0:2; hence k - m in Seg n by A4, FINSEQ_1:1; ::_thesis: verum end; theorem :: FINSEQ_3:13 for k, n being Nat holds ( k - n in Seg k iff n < k ) proof let k, n be Nat; ::_thesis: ( k - n in Seg k iff n < k ) thus ( k - n in Seg k implies n < k ) ::_thesis: ( n < k implies k - n in Seg k ) proof assume A1: k - n in Seg k ; ::_thesis: n < k then reconsider x = k - n as Element of NAT ; assume not n < k ; ::_thesis: contradiction then k - n <= n - n by XREAL_1:9; then x = 0 ; hence contradiction by A1, FINSEQ_1:1; ::_thesis: verum end; thus ( n < k implies k - n in Seg k ) by Th12, FINSEQ_1:3; ::_thesis: verum end; theorem Th14: :: FINSEQ_3:14 for k being Nat holds Seg k misses {(k + 1)} proof let k be Nat; ::_thesis: Seg k misses {(k + 1)} set x = the Element of (Seg k) /\ {(k + 1)}; assume not Seg k misses {(k + 1)} ; ::_thesis: contradiction then A1: (Seg k) /\ {(k + 1)} <> {} by XBOOLE_0:def_7; then A2: the Element of (Seg k) /\ {(k + 1)} in Seg k by XBOOLE_0:def_4; then reconsider x = the Element of (Seg k) /\ {(k + 1)} as Element of NAT ; x in {(k + 1)} by A1, XBOOLE_0:def_4; then A3: x = k + 1 by TARSKI:def_1; x <= k by A2, FINSEQ_1:1; hence contradiction by A3, XREAL_1:29; ::_thesis: verum end; theorem :: FINSEQ_3:15 for k being Nat holds (Seg (k + 1)) \ (Seg k) = {(k + 1)} proof let k be Nat; ::_thesis: (Seg (k + 1)) \ (Seg k) = {(k + 1)} A1: Seg (k + 1) = (Seg k) \/ {(k + 1)} by FINSEQ_1:9; Seg k misses {(k + 1)} by Th14; hence (Seg (k + 1)) \ (Seg k) = {(k + 1)} by A1, XBOOLE_1:88; ::_thesis: verum end; theorem :: FINSEQ_3:16 for k being Nat holds Seg k <> Seg (k + 1) by Th8, FINSEQ_1:4; theorem :: FINSEQ_3:17 for k, n being Nat st Seg k = Seg (k + n) holds n = 0 by Th10, FINSEQ_1:3; theorem Th18: :: FINSEQ_3:18 for k, n being Nat holds Seg k c= Seg (k + n) proof let k, n be Nat; ::_thesis: Seg k c= Seg (k + n) k <= k + n by NAT_1:12; hence Seg k c= Seg (k + n) by FINSEQ_1:5; ::_thesis: verum end; theorem Th19: :: FINSEQ_3:19 for k, n being Nat holds Seg k, Seg n are_c=-comparable proof let k, n be Nat; ::_thesis: Seg k, Seg n are_c=-comparable ( n <= k or k <= n ) ; then ( Seg n c= Seg k or Seg k c= Seg n ) by FINSEQ_1:5; hence Seg k, Seg n are_c=-comparable by XBOOLE_0:def_9; ::_thesis: verum end; theorem Th20: :: FINSEQ_3:20 for y being set for k being Nat st Seg k = {y} holds ( k = 1 & y = 1 ) proof let y be set ; ::_thesis: for k being Nat st Seg k = {y} holds ( k = 1 & y = 1 ) let k be Nat; ::_thesis: ( Seg k = {y} implies ( k = 1 & y = 1 ) ) assume A1: Seg k = {y} ; ::_thesis: ( k = 1 & y = 1 ) now__::_thesis:_(_k_=_1_&_y_=_1_) percases ( k = 0 or k <> 0 ) ; suppose k = 0 ; ::_thesis: ( k = 1 & y = 1 ) hence ( k = 1 & y = 1 ) by A1; ::_thesis: verum end; suppose k <> 0 ; ::_thesis: ( k = 1 & y = 1 ) then A2: k in Seg k by FINSEQ_1:3; then 1 <= k by FINSEQ_1:1; then Seg 1 c= Seg k by FINSEQ_1:5; then Seg 1 = {y} by A1, ZFMISC_1:33; hence ( k = 1 & y = 1 ) by A1, A2, FINSEQ_1:2, TARSKI:def_1, ZFMISC_1:3; ::_thesis: verum end; end; end; hence ( k = 1 & y = 1 ) ; ::_thesis: verum end; theorem :: FINSEQ_3:21 for x, y being set for k being Nat st Seg k = {x,y} & x <> y holds ( k = 2 & {x,y} = {1,2} ) proof let x, y be set ; ::_thesis: for k being Nat st Seg k = {x,y} & x <> y holds ( k = 2 & {x,y} = {1,2} ) let k be Nat; ::_thesis: ( Seg k = {x,y} & x <> y implies ( k = 2 & {x,y} = {1,2} ) ) assume that A1: Seg k = {x,y} and A2: x <> y ; ::_thesis: ( k = 2 & {x,y} = {1,2} ) now__::_thesis:_(_k_=_2_&_{x,y}_=_{1,2}_) percases ( k = 0 or k <> 0 ) ; suppose k = 0 ; ::_thesis: ( k = 2 & {x,y} = {1,2} ) hence ( k = 2 & {x,y} = {1,2} ) by A1; ::_thesis: verum end; supposeA3: k <> 0 ; ::_thesis: ( k = 2 & {x,y} = {1,2} ) now__::_thesis:_(_k_=_2_&_{x,y}_=_{1,2}_) percases ( k = 1 or k <> 1 ) ; suppose k = 1 ; ::_thesis: ( k = 2 & {x,y} = {1,2} ) hence ( k = 2 & {x,y} = {1,2} ) by A1, A2, FINSEQ_1:2, ZFMISC_1:5; ::_thesis: verum end; supposeA4: k <> 1 ; ::_thesis: ( k = 2 & {x,y} = {1,2} ) 1 <= k by A3, NAT_1:14; then 1 < k by A4, XXREAL_0:1; then A5: 1 + 1 <= k by NAT_1:13; then Seg 2 c= Seg k by FINSEQ_1:5; then A6: ( ( 1 = x & 2 = x ) or ( 1 = x & 2 = y ) or ( 2 = x & 1 = y ) or ( 1 = y & 2 = y ) ) by A1, FINSEQ_1:2, ZFMISC_1:22; now__::_thesis:_k_<=_2 k in Seg k by A1, Th7; then A7: ( k = 1 or k = 2 ) by A1, A6, TARSKI:def_2; assume not k <= 2 ; ::_thesis: contradiction hence contradiction by A7; ::_thesis: verum end; hence ( k = 2 & {x,y} = {1,2} ) by A1, A5, FINSEQ_1:2, XXREAL_0:1; ::_thesis: verum end; end; end; hence ( k = 2 & {x,y} = {1,2} ) ; ::_thesis: verum end; end; end; hence ( k = 2 & {x,y} = {1,2} ) ; ::_thesis: verum end; theorem Th22: :: FINSEQ_3:22 for p, q being FinSequence for x being set st x in dom p holds x in dom (p ^ q) proof let p, q be FinSequence; ::_thesis: for x being set st x in dom p holds x in dom (p ^ q) let x be set ; ::_thesis: ( x in dom p implies x in dom (p ^ q) ) dom p c= dom (p ^ q) by FINSEQ_1:26; hence ( x in dom p implies x in dom (p ^ q) ) ; ::_thesis: verum end; theorem :: FINSEQ_3:23 for p being FinSequence for x being set st x in dom p holds x is Element of NAT ; theorem Th24: :: FINSEQ_3:24 for p being FinSequence for x being set st x in dom p holds x <> 0 proof let p be FinSequence; ::_thesis: for x being set st x in dom p holds x <> 0 let x be set ; ::_thesis: ( x in dom p implies x <> 0 ) assume x in dom p ; ::_thesis: x <> 0 then x in Seg (len p) by FINSEQ_1:def_3; hence x <> 0 by FINSEQ_1:1; ::_thesis: verum end; theorem Th25: :: FINSEQ_3:25 for p being FinSequence for n being Nat holds ( n in dom p iff ( 1 <= n & n <= len p ) ) proof let p be FinSequence; ::_thesis: for n being Nat holds ( n in dom p iff ( 1 <= n & n <= len p ) ) let n be Nat; ::_thesis: ( n in dom p iff ( 1 <= n & n <= len p ) ) thus ( n in dom p implies ( 1 <= n & n <= len p ) ) ::_thesis: ( 1 <= n & n <= len p implies n in dom p ) proof assume n in dom p ; ::_thesis: ( 1 <= n & n <= len p ) then n in Seg (len p) by FINSEQ_1:def_3; hence ( 1 <= n & n <= len p ) by FINSEQ_1:1; ::_thesis: verum end; assume that A1: 1 <= n and A2: n <= len p ; ::_thesis: n in dom p n in Seg (len p) by A1, A2, FINSEQ_1:1; hence n in dom p by FINSEQ_1:def_3; ::_thesis: verum end; theorem :: FINSEQ_3:26 for p being FinSequence for n being Nat holds ( n in dom p iff ( n - 1 is Element of NAT & (len p) - n is Element of NAT ) ) proof let p be FinSequence; ::_thesis: for n being Nat holds ( n in dom p iff ( n - 1 is Element of NAT & (len p) - n is Element of NAT ) ) let n be Nat; ::_thesis: ( n in dom p iff ( n - 1 is Element of NAT & (len p) - n is Element of NAT ) ) thus ( n in dom p implies ( n - 1 is Element of NAT & (len p) - n is Element of NAT ) ) ::_thesis: ( n - 1 is Element of NAT & (len p) - n is Element of NAT implies n in dom p ) proof assume A1: n in dom p ; ::_thesis: ( n - 1 is Element of NAT & (len p) - n is Element of NAT ) then A2: n <= len p by Th25; 1 <= n by A1, Th25; hence ( n - 1 is Element of NAT & (len p) - n is Element of NAT ) by A2, INT_1:5; ::_thesis: verum end; assume that A3: n - 1 is Element of NAT and A4: (len p) - n is Element of NAT ; ::_thesis: n in dom p A5: 0 + n <= len p by A4, XREAL_1:19; 0 + 1 <= n by A3, XREAL_1:19; hence n in dom p by A5, Th25; ::_thesis: verum end; theorem :: FINSEQ_3:27 canceled; theorem :: FINSEQ_3:28 canceled; theorem Th29: :: FINSEQ_3:29 for p, q being FinSequence holds ( len p = len q iff dom p = dom q ) proof let p, q be FinSequence; ::_thesis: ( len p = len q iff dom p = dom q ) dom p = Seg (len p) by FINSEQ_1:def_3; hence ( len p = len q iff dom p = dom q ) by FINSEQ_1:def_3; ::_thesis: verum end; theorem Th30: :: FINSEQ_3:30 for p, q being FinSequence holds ( len p <= len q iff dom p c= dom q ) proof let p, q be FinSequence; ::_thesis: ( len p <= len q iff dom p c= dom q ) A1: dom q = Seg (len q) by FINSEQ_1:def_3; dom p = Seg (len p) by FINSEQ_1:def_3; hence ( len p <= len q iff dom p c= dom q ) by A1, FINSEQ_1:5; ::_thesis: verum end; theorem Th31: :: FINSEQ_3:31 for p being FinSequence for x being set st x in rng p holds 1 in dom p proof let p be FinSequence; ::_thesis: for x being set st x in rng p holds 1 in dom p let x be set ; ::_thesis: ( x in rng p implies 1 in dom p ) assume x in rng p ; ::_thesis: 1 in dom p then p <> {} ; then A1: 1 <= len p by NAT_1:14; dom p = Seg (len p) by FINSEQ_1:def_3; hence 1 in dom p by A1, FINSEQ_1:1; ::_thesis: verum end; theorem :: FINSEQ_3:32 for p being FinSequence st rng p <> {} holds 1 in dom p proof let p be FinSequence; ::_thesis: ( rng p <> {} implies 1 in dom p ) set y = the Element of rng p; assume rng p <> {} ; ::_thesis: 1 in dom p then the Element of rng p in rng p ; hence 1 in dom p by Th31; ::_thesis: verum end; theorem :: FINSEQ_3:33 for x, y being set holds {} <> <*x,y*> ; theorem :: FINSEQ_3:34 for x, y, z being set holds {} <> <*x,y,z*> ; theorem Th35: :: FINSEQ_3:35 for x, y, z being set holds <*x*> <> <*y,z*> proof let x, y, z be set ; ::_thesis: <*x*> <> <*y,z*> len <*x*> = 1 by FINSEQ_1:40; hence <*x*> <> <*y,z*> by FINSEQ_1:44; ::_thesis: verum end; theorem :: FINSEQ_3:36 for u, x, y, z being set holds <*u*> <> <*x,y,z*> proof let u, x, y, z be set ; ::_thesis: <*u*> <> <*x,y,z*> len <*u*> = 1 by FINSEQ_1:40; hence <*u*> <> <*x,y,z*> by FINSEQ_1:45; ::_thesis: verum end; theorem :: FINSEQ_3:37 for u, v, x, y, z being set holds <*u,v*> <> <*x,y,z*> proof let u, v, x, y, z be set ; ::_thesis: <*u,v*> <> <*x,y,z*> len <*u,v*> = 2 by FINSEQ_1:44; hence <*u,v*> <> <*x,y,z*> by FINSEQ_1:45; ::_thesis: verum end; theorem Th38: :: FINSEQ_3:38 for r, p, q being FinSequence st len r = (len p) + (len q) & ( for k being Element of NAT st k in dom p holds r . k = p . k ) & ( for k being Element of NAT st k in dom q holds r . ((len p) + k) = q . k ) holds r = p ^ q proof let r, p, q be FinSequence; ::_thesis: ( len r = (len p) + (len q) & ( for k being Element of NAT st k in dom p holds r . k = p . k ) & ( for k being Element of NAT st k in dom q holds r . ((len p) + k) = q . k ) implies r = p ^ q ) assume len r = (len p) + (len q) ; ::_thesis: ( ex k being Element of NAT st ( k in dom p & not r . k = p . k ) or ex k being Element of NAT st ( k in dom q & not r . ((len p) + k) = q . k ) or r = p ^ q ) then A1: dom r = Seg ((len p) + (len q)) by FINSEQ_1:def_3; assume that A2: for k being Element of NAT st k in dom p holds r . k = p . k and A3: for k being Element of NAT st k in dom q holds r . ((len p) + k) = q . k ; ::_thesis: r = p ^ q A4: for k being Nat st k in dom q holds r . ((len p) + k) = q . k by A3; for k being Nat st k in dom p holds r . k = p . k by A2; hence r = p ^ q by A1, A4, FINSEQ_1:def_7; ::_thesis: verum end; Lm1: for A being set for k being Nat st A c= Seg k holds Sgm A is one-to-one proof let A be set ; ::_thesis: for k being Nat st A c= Seg k holds Sgm A is one-to-one let k be Nat; ::_thesis: ( A c= Seg k implies Sgm A is one-to-one ) assume A1: A c= Seg k ; ::_thesis: Sgm A is one-to-one then A2: rng (Sgm A) = A by FINSEQ_1:def_13; let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not x in dom (Sgm A) or not b1 in dom (Sgm A) or not (Sgm A) . x = (Sgm A) . b1 or x = b1 ) let y be set ; ::_thesis: ( not x in dom (Sgm A) or not y in dom (Sgm A) or not (Sgm A) . x = (Sgm A) . y or x = y ) assume that A3: x in dom (Sgm A) and A4: y in dom (Sgm A) and A5: (Sgm A) . x = (Sgm A) . y and A6: x <> y ; ::_thesis: contradiction (Sgm A) . y in rng (Sgm A) by A4, FUNCT_1:def_3; then A7: (Sgm A) . y in Seg k by A1, A2; (Sgm A) . x in rng (Sgm A) by A3, FUNCT_1:def_3; then (Sgm A) . x in Seg k by A1, A2; then reconsider m = (Sgm A) . x, n = (Sgm A) . y as Element of NAT by A7; reconsider i = x, j = y as Element of NAT by A3, A4; A8: dom (Sgm A) = Seg (len (Sgm A)) by FINSEQ_1:def_3; now__::_thesis:_contradiction percases ( i < j or j < i ) by A6, XXREAL_0:1; supposeA9: i < j ; ::_thesis: contradiction A10: j <= len (Sgm A) by A4, A8, FINSEQ_1:1; 1 <= i by A3, A8, FINSEQ_1:1; then m < n by A1, A9, A10, FINSEQ_1:def_13; hence contradiction by A5; ::_thesis: verum end; supposeA11: j < i ; ::_thesis: contradiction A12: i <= len (Sgm A) by A3, A8, FINSEQ_1:1; 1 <= j by A4, A8, FINSEQ_1:1; then n < m by A1, A11, A12, FINSEQ_1:def_13; hence contradiction by A5; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; theorem Th39: :: FINSEQ_3:39 for k being Nat for A being finite set st A c= Seg k holds len (Sgm A) = card A proof let k be Nat; ::_thesis: for A being finite set st A c= Seg k holds len (Sgm A) = card A let A be finite set ; ::_thesis: ( A c= Seg k implies len (Sgm A) = card A ) A1: dom (Sgm A) = Seg (len (Sgm A)) by FINSEQ_1:def_3; A2: card (Seg (len (Sgm A))) = len (Sgm A) by FINSEQ_1:57; assume A3: A c= Seg k ; ::_thesis: len (Sgm A) = card A then A4: rng (Sgm A) = A by FINSEQ_1:def_13; Sgm A is one-to-one by A3, Lm1; then Seg (len (Sgm A)),A are_equipotent by A1, A4, WELLORD2:def_4; hence len (Sgm A) = card A by A2, CARD_1:5; ::_thesis: verum end; theorem :: FINSEQ_3:40 for k being Nat for A being finite set st A c= Seg k holds dom (Sgm A) = Seg (card A) proof let k be Nat; ::_thesis: for A being finite set st A c= Seg k holds dom (Sgm A) = Seg (card A) let A be finite set ; ::_thesis: ( A c= Seg k implies dom (Sgm A) = Seg (card A) ) assume A c= Seg k ; ::_thesis: dom (Sgm A) = Seg (card A) then len (Sgm A) = card A by Th39; hence dom (Sgm A) = Seg (card A) by FINSEQ_1:def_3; ::_thesis: verum end; theorem Th41: :: FINSEQ_3:41 for X being set for i, k, l, n, m being Nat st X c= Seg i & k < l & 1 <= n & m <= len (Sgm X) & (Sgm X) . m = k & (Sgm X) . n = l holds m < n proof let X be set ; ::_thesis: for i, k, l, n, m being Nat st X c= Seg i & k < l & 1 <= n & m <= len (Sgm X) & (Sgm X) . m = k & (Sgm X) . n = l holds m < n let i, k, l, n, m be Nat; ::_thesis: ( X c= Seg i & k < l & 1 <= n & m <= len (Sgm X) & (Sgm X) . m = k & (Sgm X) . n = l implies m < n ) assume that A1: X c= Seg i and A2: k < l and A3: 1 <= n and A4: m <= len (Sgm X) and A5: (Sgm X) . m = k and A6: (Sgm X) . n = l and A7: not m < n ; ::_thesis: contradiction n < m by A2, A5, A6, A7, XXREAL_0:1; hence contradiction by A1, A2, A3, A4, A5, A6, FINSEQ_1:def_13; ::_thesis: verum end; theorem Th42: :: FINSEQ_3:42 for X, Y being set for i, j being Nat st X c= Seg i & Y c= Seg j holds ( ( for m, n being Element of NAT st m in X & n in Y holds m < n ) iff Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) ) proof let X, Y be set ; ::_thesis: for i, j being Nat st X c= Seg i & Y c= Seg j holds ( ( for m, n being Element of NAT st m in X & n in Y holds m < n ) iff Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) ) let i, j be Nat; ::_thesis: ( X c= Seg i & Y c= Seg j implies ( ( for m, n being Element of NAT st m in X & n in Y holds m < n ) iff Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) ) ) assume that A1: X c= Seg i and A2: Y c= Seg j ; ::_thesis: ( ( for m, n being Element of NAT st m in X & n in Y holds m < n ) iff Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) ) set r = Sgm (X \/ Y); set q = Sgm Y; set p = Sgm X; Seg i, Seg j are_c=-comparable by Th19; then ( Seg i c= Seg j or Seg j c= Seg i ) by XBOOLE_0:def_9; then A3: ( X c= Seg j or Y c= Seg i ) by A1, A2, XBOOLE_1:1; then A4: ( X \/ Y c= Seg i or X \/ Y c= Seg j ) by A1, A2, XBOOLE_1:8; thus ( ( for m, n being Element of NAT st m in X & n in Y holds m < n ) implies Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) ) ::_thesis: ( Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) implies for m, n being Element of NAT st m in X & n in Y holds m < n ) proof reconsider X1 = X, Y1 = Y as finite set by A1, A2; defpred S1[ Element of NAT ] means ( $1 in dom (Sgm X) implies (Sgm (X \/ Y)) . $1 = (Sgm X) . $1 ); assume A5: for m, n being Element of NAT st m in X & n in Y holds m < n ; ::_thesis: Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) X /\ Y = {} proof set x = the Element of X /\ Y; X = rng (Sgm X) by A1, FINSEQ_1:def_13; then A6: X c= NAT ; assume A7: not X /\ Y = {} ; ::_thesis: contradiction then the Element of X /\ Y in X by XBOOLE_0:def_4; then reconsider m = the Element of X /\ Y as Element of NAT by A6; A8: m in Y by A7, XBOOLE_0:def_4; m in X by A7, XBOOLE_0:def_4; hence contradiction by A5, A8; ::_thesis: verum end; then A9: X misses Y by XBOOLE_0:def_7; A10: len (Sgm (X \/ Y)) = card (X1 \/ Y1) by A1, A2, A3, Th39, XBOOLE_1:8 .= (card X1) + (card Y1) by A9, CARD_2:40 .= (len (Sgm X)) + (card Y1) by A1, Th39 .= (len (Sgm X)) + (len (Sgm Y)) by A2, Th39 ; A11: now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_ S1[k_+_1] let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A12: S1[k] ; ::_thesis: S1[k + 1] thus S1[k + 1] ::_thesis: verum proof assume A13: k + 1 in dom (Sgm X) ; ::_thesis: (Sgm (X \/ Y)) . (k + 1) = (Sgm X) . (k + 1) then A14: (Sgm X) . (k + 1) in rng (Sgm X) by FUNCT_1:def_3; then reconsider n = (Sgm X) . (k + 1) as Element of NAT ; A15: n in X by A1, A14, FINSEQ_1:def_13; len (Sgm X) <= len (Sgm (X \/ Y)) by A10, NAT_1:12; then Seg (len (Sgm X)) c= Seg (len (Sgm (X \/ Y))) by FINSEQ_1:5; then dom (Sgm X) c= Seg (len (Sgm (X \/ Y))) by FINSEQ_1:def_3; then A16: dom (Sgm X) c= dom (Sgm (X \/ Y)) by FINSEQ_1:def_3; then A17: (Sgm (X \/ Y)) . (k + 1) in rng (Sgm (X \/ Y)) by A13, FUNCT_1:def_3; then reconsider m = (Sgm (X \/ Y)) . (k + 1) as Element of NAT ; A18: m in X \/ Y by A4, A17, FINSEQ_1:def_13; assume A19: (Sgm (X \/ Y)) . (k + 1) <> (Sgm X) . (k + 1) ; ::_thesis: contradiction A20: k + 1 in dom (Sgm (X \/ Y)) by A13, A16; now__::_thesis:_contradiction percases ( k in dom (Sgm X) or not k in dom (Sgm X) ) ; supposeA21: k in dom (Sgm X) ; ::_thesis: contradiction then (Sgm X) . k in rng (Sgm X) by FUNCT_1:def_3; then reconsider n1 = (Sgm X) . k as Element of NAT ; (Sgm (X \/ Y)) . k in rng (Sgm (X \/ Y)) by A16, A21, FUNCT_1:def_3; then reconsider m1 = (Sgm (X \/ Y)) . k as Element of NAT ; now__::_thesis:_contradiction percases ( m < n or n < m ) by A19, XXREAL_0:1; supposeA22: m < n ; ::_thesis: contradiction A23: 1 <= k + 1 by A13, Th25; not m in Y by A5, A15, A22; then m in X by A18, XBOOLE_0:def_3; then m in rng (Sgm X) by A1, FINSEQ_1:def_13; then consider x being set such that A24: x in dom (Sgm X) and A25: (Sgm X) . x = m by FUNCT_1:def_3; reconsider x = x as Element of NAT by A24; x <= len (Sgm X) by A24, Th25; then A26: x < k + 1 by A1, A22, A25, A23, Th41; k + 1 in Seg (len (Sgm (X \/ Y))) by A20, FINSEQ_1:def_3; then A27: k + 1 <= len (Sgm (X \/ Y)) by FINSEQ_1:1; k in Seg (len (Sgm X)) by A21, FINSEQ_1:def_3; then A28: 1 <= k by FINSEQ_1:1; k < k + 1 by XREAL_1:29; then A29: n1 < m by A4, A12, A21, A28, A27, FINSEQ_1:def_13; A30: k <= len (Sgm X) by A21, Th25; 1 <= x by A24, Th25; then k < x by A1, A25, A29, A30, Th41; hence contradiction by A26, NAT_1:13; ::_thesis: verum end; supposeA31: n < m ; ::_thesis: contradiction A32: 1 <= k + 1 by A13, Th25; n in X \/ Y by A15, XBOOLE_0:def_3; then n in rng (Sgm (X \/ Y)) by A4, FINSEQ_1:def_13; then consider x being set such that A33: x in dom (Sgm (X \/ Y)) and A34: (Sgm (X \/ Y)) . x = n by FUNCT_1:def_3; reconsider x = x as Element of NAT by A33; x <= len (Sgm (X \/ Y)) by A33, Th25; then A35: x < k + 1 by A1, A2, A3, A31, A34, A32, Th41, XBOOLE_1:8; A36: k + 1 <= len (Sgm X) by A13, Th25; A37: k < k + 1 by XREAL_1:29; 1 <= k by A21, Th25; then A38: m1 < n by A1, A12, A21, A37, A36, FINSEQ_1:def_13; A39: k <= len (Sgm (X \/ Y)) by A16, A21, Th25; 1 <= x by A33, Th25; then k < x by A1, A2, A3, A34, A38, A39, Th41, XBOOLE_1:8; hence contradiction by A35, NAT_1:13; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; supposeA40: not k in dom (Sgm X) ; ::_thesis: contradiction A41: k < k + 1 by XREAL_1:29; ( k < 1 or len (Sgm X) < k ) by A40, Th25; then A42: ( k = 0 or ( len (Sgm X) < k + 1 & k + 1 <= len (Sgm X) ) ) by A13, A41, Th25, NAT_1:14, XXREAL_0:2; now__::_thesis:_contradiction percases ( m < n or n < m ) by A19, XXREAL_0:1; supposeA43: m < n ; ::_thesis: contradiction then not m in Y by A5, A15; then m in X by A18, XBOOLE_0:def_3; then m in rng (Sgm X) by A1, FINSEQ_1:def_13; then consider x being set such that A44: x in dom (Sgm X) and A45: (Sgm X) . x = m by FUNCT_1:def_3; A46: 1 <= k + 1 by A13, Th25; reconsider x = x as Element of NAT by A44; x <= len (Sgm X) by A44, Th25; then x < k + 1 by A1, A43, A45, A46, Th41; hence contradiction by A42, A44, Th24, NAT_1:14; ::_thesis: verum end; supposeA47: n < m ; ::_thesis: contradiction A48: 1 <= k + 1 by A13, Th25; n in X \/ Y by A15, XBOOLE_0:def_3; then n in rng (Sgm (X \/ Y)) by A4, FINSEQ_1:def_13; then consider x being set such that A49: x in dom (Sgm (X \/ Y)) and A50: (Sgm (X \/ Y)) . x = n by FUNCT_1:def_3; reconsider x = x as Element of NAT by A49; x <= len (Sgm (X \/ Y)) by A49, Th25; then x < k + 1 by A1, A2, A3, A47, A50, A48, Th41, XBOOLE_1:8; hence contradiction by A42, A49, Th24, NAT_1:14; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; A51: S1[ 0 ] by Th24; A52: for k being Element of NAT holds S1[k] from NAT_1:sch_1(A51, A11); defpred S2[ Element of NAT ] means ( $1 in dom (Sgm Y) implies (Sgm (X \/ Y)) . ((len (Sgm X)) + $1) = (Sgm Y) . $1 ); A53: now__::_thesis:_for_k_being_Element_of_NAT_st_S2[k]_holds_ S2[k_+_1] let k be Element of NAT ; ::_thesis: ( S2[k] implies S2[k + 1] ) assume A54: S2[k] ; ::_thesis: S2[k + 1] thus S2[k + 1] ::_thesis: verum proof set a = (len (Sgm X)) + (k + 1); assume A55: k + 1 in dom (Sgm Y) ; ::_thesis: (Sgm (X \/ Y)) . ((len (Sgm X)) + (k + 1)) = (Sgm Y) . (k + 1) then k + 1 <= len (Sgm Y) by Th25; then A56: (len (Sgm X)) + (k + 1) <= len (Sgm (X \/ Y)) by A10, XREAL_1:7; A57: 1 <= k + 1 by NAT_1:12; then 1 <= (len (Sgm X)) + (k + 1) by NAT_1:12; then A58: (len (Sgm X)) + (k + 1) in dom (Sgm (X \/ Y)) by A56, Th25; then A59: (Sgm (X \/ Y)) . ((len (Sgm X)) + (k + 1)) in rng (Sgm (X \/ Y)) by FUNCT_1:def_3; reconsider m = (Sgm (X \/ Y)) . ((len (Sgm X)) + (k + 1)) as Element of NAT by A59; A60: now__::_thesis:_not_m_in_X assume m in X ; ::_thesis: contradiction then m in rng (Sgm X) by A1, FINSEQ_1:def_13; then consider x being set such that A61: x in dom (Sgm X) and A62: (Sgm X) . x = m by FUNCT_1:def_3; reconsider x = x as Element of NAT by A61; x <= len (Sgm X) by A61, Th25; then A63: x <= len (Sgm (X \/ Y)) by A10, NAT_1:12; A64: Sgm (X \/ Y) is one-to-one by A1, A2, A3, Lm1, XBOOLE_1:8; 1 <= x by A61, Th25; then A65: x in dom (Sgm (X \/ Y)) by A63, Th25; (Sgm (X \/ Y)) . x = (Sgm (X \/ Y)) . ((len (Sgm X)) + (k + 1)) by A52, A61, A62; then x = (len (Sgm X)) + (k + 1) by A58, A64, A65, FUNCT_1:def_4; then (len (Sgm X)) + (k + 1) <= (len (Sgm X)) + 0 by A61, Th25; hence contradiction by XREAL_1:29; ::_thesis: verum end; A66: (Sgm Y) . (k + 1) in rng (Sgm Y) by A55, FUNCT_1:def_3; then reconsider n = (Sgm Y) . (k + 1) as Element of NAT ; A67: n in Y by A2, A66, FINSEQ_1:def_13; assume A68: (Sgm (X \/ Y)) . ((len (Sgm X)) + (k + 1)) <> (Sgm Y) . (k + 1) ; ::_thesis: contradiction A69: m in X \/ Y by A4, A59, FINSEQ_1:def_13; now__::_thesis:_contradiction percases ( k in dom (Sgm Y) or not k in dom (Sgm Y) ) ; supposeA70: k in dom (Sgm Y) ; ::_thesis: contradiction then (Sgm Y) . k in rng (Sgm Y) by FUNCT_1:def_3; then reconsider n1 = (Sgm Y) . k as Element of NAT ; 1 <= k by A70, Th25; then A71: 1 <= (len (Sgm X)) + k by NAT_1:12; A72: k <= len (Sgm Y) by A70, Th25; then (len (Sgm X)) + k <= len (Sgm (X \/ Y)) by A10, XREAL_1:7; then (len (Sgm X)) + k in dom (Sgm (X \/ Y)) by A71, Th25; then (Sgm (X \/ Y)) . ((len (Sgm X)) + k) in rng (Sgm (X \/ Y)) by FUNCT_1:def_3; then reconsider m1 = (Sgm (X \/ Y)) . ((len (Sgm X)) + k) as Element of NAT ; now__::_thesis:_contradiction percases ( m < n or n < m ) by A68, XXREAL_0:1; supposeA73: m < n ; ::_thesis: contradiction A74: 1 <= k + 1 by A55, Th25; m in Y by A69, A60, XBOOLE_0:def_3; then m in rng (Sgm Y) by A2, FINSEQ_1:def_13; then consider x being set such that A75: x in dom (Sgm Y) and A76: (Sgm Y) . x = m by FUNCT_1:def_3; reconsider x = x as Element of NAT by A75; x <= len (Sgm Y) by A75, Th25; then A77: x < k + 1 by A2, A73, A76, A74, Th41; (len (Sgm X)) + k < ((len (Sgm X)) + k) + 1 by XREAL_1:29; then A78: n1 < m by A4, A54, A56, A70, A71, FINSEQ_1:def_13; A79: k <= len (Sgm Y) by A70, Th25; 1 <= x by A75, Th25; then k < x by A2, A76, A78, A79, Th41; hence contradiction by A77, NAT_1:13; ::_thesis: verum end; supposeA80: n < m ; ::_thesis: contradiction A81: 1 <= (len (Sgm X)) + (k + 1) by A57, NAT_1:12; n in X \/ Y by A67, XBOOLE_0:def_3; then n in rng (Sgm (X \/ Y)) by A4, FINSEQ_1:def_13; then consider x being set such that A82: x in dom (Sgm (X \/ Y)) and A83: (Sgm (X \/ Y)) . x = n by FUNCT_1:def_3; reconsider x = x as Element of NAT by A82; x <= len (Sgm (X \/ Y)) by A82, Th25; then A84: x < ((len (Sgm X)) + k) + 1 by A1, A2, A3, A80, A83, A81, Th41, XBOOLE_1:8; A85: k + 1 <= len (Sgm Y) by A55, Th25; A86: k < k + 1 by XREAL_1:29; 1 <= k by A70, Th25; then A87: m1 < n by A2, A54, A70, A86, A85, FINSEQ_1:def_13; A88: (len (Sgm X)) + k <= len (Sgm (X \/ Y)) by A10, A72, XREAL_1:7; 1 <= x by A82, Th25; then (len (Sgm X)) + k < x by A1, A2, A3, A83, A87, A88, Th41, XBOOLE_1:8; hence contradiction by A84, NAT_1:13; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; supposeA89: not k in dom (Sgm Y) ; ::_thesis: contradiction A90: k < k + 1 by XREAL_1:29; ( k < 1 or len (Sgm Y) < k ) by A89, Th25; then A91: ( k = 0 or ( len (Sgm Y) < k + 1 & k + 1 <= len (Sgm Y) ) ) by A55, A90, Th25, NAT_1:14, XXREAL_0:2; now__::_thesis:_contradiction percases ( m < n or n < m ) by A68, XXREAL_0:1; supposeA92: m < n ; ::_thesis: contradiction A93: 1 <= k + 1 by A55, Th25; m in Y by A69, A60, XBOOLE_0:def_3; then m in rng (Sgm Y) by A2, FINSEQ_1:def_13; then consider x being set such that A94: x in dom (Sgm Y) and A95: (Sgm Y) . x = m by FUNCT_1:def_3; reconsider x = x as Element of NAT by A94; x <= len (Sgm Y) by A94, Th25; then x < k + 1 by A2, A92, A95, A93, Th41; hence contradiction by A91, A94, Th24, NAT_1:14; ::_thesis: verum end; supposeA96: n < m ; ::_thesis: contradiction A97: 1 <= (len (Sgm X)) + 1 by NAT_1:12; n in X \/ Y by A67, XBOOLE_0:def_3; then n in rng (Sgm (X \/ Y)) by A4, FINSEQ_1:def_13; then consider x being set such that A98: x in dom (Sgm (X \/ Y)) and A99: (Sgm (X \/ Y)) . x = n by FUNCT_1:def_3; reconsider x = x as Element of NAT by A98; x <= len (Sgm (X \/ Y)) by A98, Th25; then x < (len (Sgm X)) + 1 by A1, A2, A3, A91, A96, A99, A97, Th41, XBOOLE_1:8; then A100: x <= len (Sgm X) by NAT_1:13; 1 <= x by A98, Th25; then A101: x in dom (Sgm X) by A100, Th25; then A102: (Sgm X) . x in rng (Sgm X) by FUNCT_1:def_3; n = (Sgm X) . x by A52, A99, A101; then n in X by A1, A102, FINSEQ_1:def_13; hence contradiction by A5, A67; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; end; hence contradiction ; ::_thesis: verum end; end; A103: S2[ 0 ] by Th24; for k being Element of NAT holds S2[k] from NAT_1:sch_1(A103, A53); hence Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) by A10, A52, Th38; ::_thesis: verum end; assume A104: Sgm (X \/ Y) = (Sgm X) ^ (Sgm Y) ; ::_thesis: for m, n being Element of NAT st m in X & n in Y holds m < n let m, n be Element of NAT ; ::_thesis: ( m in X & n in Y implies m < n ) assume that A105: m in X and A106: n in Y ; ::_thesis: m < n n in rng (Sgm Y) by A2, A106, FINSEQ_1:def_13; then consider y being set such that A107: y in dom (Sgm Y) and A108: (Sgm Y) . y = n by FUNCT_1:def_3; reconsider y = y as Element of NAT by A107; A109: n = (Sgm (X \/ Y)) . ((len (Sgm X)) + y) by A104, A107, A108, FINSEQ_1:def_7; y <= len (Sgm Y) by A107, Th25; then (len (Sgm X)) + y <= (len (Sgm X)) + (len (Sgm Y)) by XREAL_1:7; then A110: (len (Sgm X)) + y <= len (Sgm (X \/ Y)) by A104, FINSEQ_1:22; m in rng (Sgm X) by A1, A105, FINSEQ_1:def_13; then consider x being set such that A111: x in dom (Sgm X) and A112: (Sgm X) . x = m by FUNCT_1:def_3; reconsider x = x as Element of NAT by A111; A113: x in Seg (len (Sgm X)) by A111, FINSEQ_1:def_3; then A114: 1 <= x by FINSEQ_1:1; A115: x <= len (Sgm X) by A113, FINSEQ_1:1; y <> 0 by A107, Th24; then A116: x < (len (Sgm X)) + y by A115, NAT_1:16, XXREAL_0:2; m = (Sgm (X \/ Y)) . x by A104, A111, A112, FINSEQ_1:def_7; hence m < n by A4, A109, A114, A116, A110, FINSEQ_1:def_13; ::_thesis: verum end; theorem Th43: :: FINSEQ_3:43 Sgm {} = {} proof {} c= Seg 0 ; hence Sgm {} = {} by FINSEQ_1:51; ::_thesis: verum end; theorem :: FINSEQ_3:44 for n being Nat st 0 <> n holds Sgm {n} = <*n*> proof let n be Nat; ::_thesis: ( 0 <> n implies Sgm {n} = <*n*> ) assume 0 <> n ; ::_thesis: Sgm {n} = <*n*> then n in Seg n by FINSEQ_1:3; then A1: {n} c= Seg n by ZFMISC_1:31; then len (Sgm {n}) = card {n} by Th39; then A2: len (Sgm {n}) = 1 by CARD_1:30; rng (Sgm {n}) = {n} by A1, FINSEQ_1:def_13; hence Sgm {n} = <*n*> by A2, FINSEQ_1:39; ::_thesis: verum end; theorem :: FINSEQ_3:45 for n, m being Nat st 0 < n & n < m holds Sgm {n,m} = <*n,m*> proof let n, m be Nat; ::_thesis: ( 0 < n & n < m implies Sgm {n,m} = <*n,m*> ) assume that A1: 0 < n and A2: n < m ; ::_thesis: Sgm {n,m} = <*n,m*> A3: m in Seg m by A2, FINSEQ_1:3; A4: n in Seg n by A1, FINSEQ_1:3; Seg n c= Seg m by A2, FINSEQ_1:5; then A5: {n,m} c= Seg m by A3, A4, ZFMISC_1:32; then A6: Sgm {n,m} is one-to-one by Lm1; A7: len (Sgm {n,m}) = card {n,m} by A5, Th39 .= 2 by A2, CARD_2:57 ; then A8: dom (Sgm {n,m}) = {1,2} by FINSEQ_1:2, FINSEQ_1:def_3; then A9: 1 in dom (Sgm {n,m}) by TARSKI:def_2; A10: 2 in dom (Sgm {n,m}) by A8, TARSKI:def_2; A11: rng (Sgm {n,m}) = {n,m} by A5, FINSEQ_1:def_13; then A12: (Sgm {n,m}) . 2 in {n,m} by A10, FUNCT_1:def_3; A13: (Sgm {n,m}) . 1 in {n,m} by A9, A11, FUNCT_1:def_3; now__::_thesis:_(_(Sgm_{n,m})_._1_=_n_&_(Sgm_{n,m})_._2_=_m_) percases ( ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = n ) or ( (Sgm {n,m}) . 1 = m & (Sgm {n,m}) . 2 = m ) or ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) or ( (Sgm {n,m}) . 1 = m & (Sgm {n,m}) . 2 = n ) ) by A13, A12, TARSKI:def_2; suppose ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = n ) ; ::_thesis: ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) hence ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) by A9, A10, A6, FUNCT_1:def_4; ::_thesis: verum end; suppose ( (Sgm {n,m}) . 1 = m & (Sgm {n,m}) . 2 = m ) ; ::_thesis: ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) hence ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) by A9, A10, A6, FUNCT_1:def_4; ::_thesis: verum end; suppose ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) ; ::_thesis: ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) hence ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) ; ::_thesis: verum end; suppose ( (Sgm {n,m}) . 1 = m & (Sgm {n,m}) . 2 = n ) ; ::_thesis: ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) hence ( (Sgm {n,m}) . 1 = n & (Sgm {n,m}) . 2 = m ) by A2, A5, A7, FINSEQ_1:def_13; ::_thesis: verum end; end; end; hence Sgm {n,m} = <*n,m*> by A7, FINSEQ_1:44; ::_thesis: verum end; theorem Th46: :: FINSEQ_3:46 for k being Nat holds len (Sgm (Seg k)) = k proof let k be Nat; ::_thesis: len (Sgm (Seg k)) = k card (Seg k) = k by FINSEQ_1:57; hence len (Sgm (Seg k)) = k by Th39; ::_thesis: verum end; Lm2: for k being Nat holds (Sgm (Seg (k + 0))) | (Seg k) = Sgm (Seg k) proof let k be Nat; ::_thesis: (Sgm (Seg (k + 0))) | (Seg k) = Sgm (Seg k) card (Seg k) = k by FINSEQ_1:57; then len (Sgm (Seg k)) = k by Th39; then dom (Sgm (Seg k)) = Seg k by FINSEQ_1:def_3; hence (Sgm (Seg (k + 0))) | (Seg k) = Sgm (Seg k) by RELAT_1:68; ::_thesis: verum end; Lm3: now__::_thesis:_for_n_being_Nat_st_(_for_k_being_Nat_holds_(Sgm_(Seg_(k_+_n)))_|_(Seg_k)_=_Sgm_(Seg_k)_)_holds_ for_k_being_Nat_holds_(Sgm_(Seg_(k_+_(n_+_1))))_|_(Seg_k)_=_Sgm_(Seg_k) let n be Nat; ::_thesis: ( ( for k being Nat holds (Sgm (Seg (k + n))) | (Seg k) = Sgm (Seg k) ) implies for k being Nat holds (Sgm (Seg (k + (n + 1)))) | (Seg k) = Sgm (Seg k) ) assume A1: for k being Nat holds (Sgm (Seg (k + n))) | (Seg k) = Sgm (Seg k) ; ::_thesis: for k being Nat holds (Sgm (Seg (k + (n + 1)))) | (Seg k) = Sgm (Seg k) let k be Nat; ::_thesis: (Sgm (Seg (k + (n + 1)))) | (Seg k) = Sgm (Seg k) set X = Sgm (Seg (k + (n + 1))); set Y = Sgm (Seg (k + 1)); A2: (Sgm (Seg (k + 1))) | (Seg k) = Sgm (Seg k) proof reconsider p = (Sgm (Seg (k + 1))) | (Seg k) as FinSequence of NAT by FINSEQ_1:18; A3: len (Sgm (Seg (k + 1))) = k + 1 by Th46; then A4: dom (Sgm (Seg (k + 1))) = Seg (k + 1) by FINSEQ_1:def_3; A5: k <= k + 1 by NAT_1:12; then A6: dom p = Seg k by A3, FINSEQ_1:17; A7: rng (Sgm (Seg (k + 1))) = Seg (k + 1) by FINSEQ_1:def_13; A8: (Sgm (Seg (k + 1))) . (k + 1) = k + 1 proof k + 1 in dom (Sgm (Seg (k + 1))) by A4, FINSEQ_1:4; then A9: (Sgm (Seg (k + 1))) . (k + 1) in Seg (k + 1) by A7, FUNCT_1:def_3; then reconsider n = (Sgm (Seg (k + 1))) . (k + 1) as Element of NAT ; A10: k < k + 1 by XREAL_1:29; k + 1 in rng (Sgm (Seg (k + 1))) by A7, FINSEQ_1:4; then consider x being set such that A11: x in dom (Sgm (Seg (k + 1))) and A12: (Sgm (Seg (k + 1))) . x = k + 1 by FUNCT_1:def_3; reconsider x = x as Element of NAT by A11; assume not (Sgm (Seg (k + 1))) . (k + 1) = k + 1 ; ::_thesis: contradiction then not (Sgm (Seg (k + 1))) . (k + 1) in {(k + 1)} by TARSKI:def_1; then (Sgm (Seg (k + 1))) . (k + 1) in (Seg (k + 1)) \ {(k + 1)} by A9, XBOOLE_0:def_5; then A13: (Sgm (Seg (k + 1))) . (k + 1) in Seg k by FINSEQ_1:10; A14: now__::_thesis:_not_x_=_k_+_1 assume A15: x = k + 1 ; ::_thesis: contradiction n <= k by A13, FINSEQ_1:1; hence contradiction by A12, A15, XREAL_1:29; ::_thesis: verum end; x <= k + 1 by A3, A11, Th25; then A16: x < k + 1 by A14, XXREAL_0:1; 1 <= x by A11, Th25; then A17: k + 1 < n by A3, A12, A16, FINSEQ_1:def_13; n <= k by A13, FINSEQ_1:1; hence contradiction by A17, A10, XXREAL_0:2; ::_thesis: verum end; A18: Sgm (Seg (k + 1)) is one-to-one by Lm1; rng p = (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} proof thus rng p c= (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} :: according to XBOOLE_0:def_10 ::_thesis: (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} c= rng p proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng p or x in (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} ) assume A19: x in rng p ; ::_thesis: x in (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} A20: now__::_thesis:_not_x_in_{(k_+_1)} assume x in {(k + 1)} ; ::_thesis: contradiction then A21: x = k + 1 by TARSKI:def_1; A22: k < k + 1 by XREAL_1:29; A23: k + 1 in dom (Sgm (Seg (k + 1))) by A4, FINSEQ_1:4; A24: Seg k c= Seg (k + 1) by Th18; consider y being set such that A25: y in dom p and A26: p . y = x by A19, FUNCT_1:def_3; reconsider y = y as Element of NAT by A25; A27: (Sgm (Seg (k + 1))) . y = p . y by A25, FUNCT_1:47; y <= k by A6, A25, FINSEQ_1:1; hence contradiction by A18, A4, A6, A8, A25, A26, A24, A27, A21, A23, A22, FUNCT_1:def_4; ::_thesis: verum end; rng p c= rng (Sgm (Seg (k + 1))) by RELAT_1:70; hence x in (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} by A8, A19, A20, XBOOLE_0:def_5; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} or x in rng p ) assume A28: x in (rng (Sgm (Seg (k + 1)))) \ {((Sgm (Seg (k + 1))) . (k + 1))} ; ::_thesis: x in rng p then x in rng (Sgm (Seg (k + 1))) by XBOOLE_0:def_5; then consider y being set such that A29: y in dom (Sgm (Seg (k + 1))) and A30: (Sgm (Seg (k + 1))) . y = x by FUNCT_1:def_3; now__::_thesis:_not_y_in_{(k_+_1)} assume y in {(k + 1)} ; ::_thesis: contradiction then A31: x = k + 1 by A8, A30, TARSKI:def_1; not x in {(k + 1)} by A8, A28, XBOOLE_0:def_5; hence contradiction by A31, TARSKI:def_1; ::_thesis: verum end; then y in (Seg (k + 1)) \ {(k + 1)} by A4, A29, XBOOLE_0:def_5; then A32: y in dom p by A6, FINSEQ_1:10; then p . y = (Sgm (Seg (k + 1))) . y by FUNCT_1:47; hence x in rng p by A30, A32, FUNCT_1:def_3; ::_thesis: verum end; then A33: rng p = Seg k by A7, A8, FINSEQ_1:10; now__::_thesis:_for_i,_j,_l,_m_being_Nat_st_1_<=_i_&_i_<_j_&_j_<=_len_p_&_l_=_p_._i_&_m_=_p_._j_holds_ l_<_m A34: len p = k by A3, A5, FINSEQ_1:17; let i, j, l, m be Nat; ::_thesis: ( 1 <= i & i < j & j <= len p & l = p . i & m = p . j implies l < m ) assume that A35: 1 <= i and A36: i < j and A37: j <= len p and A38: l = p . i and A39: m = p . j ; ::_thesis: l < m i <= len p by A36, A37, XXREAL_0:2; then i in dom p by A6, A35, A34, FINSEQ_1:1; then A40: p . i = (Sgm (Seg (k + 1))) . i by FUNCT_1:47; 1 <= j by A35, A36, XXREAL_0:2; then j in dom p by A6, A37, A34, FINSEQ_1:1; then A41: p . j = (Sgm (Seg (k + 1))) . j by FUNCT_1:47; len (Sgm (Seg (k + 1))) = k + 1 by Th46; then j <= len (Sgm (Seg (k + 1))) by A37, A34, NAT_1:12; hence l < m by A35, A36, A38, A39, A40, A41, FINSEQ_1:def_13; ::_thesis: verum end; hence (Sgm (Seg (k + 1))) | (Seg k) = Sgm (Seg k) by A33, FINSEQ_1:def_13; ::_thesis: verum end; Sgm (Seg (k + (n + 1))) = Sgm (Seg ((k + 1) + n)) ; then (Sgm (Seg (k + (n + 1)))) | (Seg (k + 1)) = Sgm (Seg (k + 1)) by A1; then Sgm (Seg k) = (Sgm (Seg (k + (n + 1)))) | ((Seg (k + 1)) /\ (Seg k)) by A2, RELAT_1:71; hence (Sgm (Seg (k + (n + 1)))) | (Seg k) = Sgm (Seg k) by FINSEQ_1:7, NAT_1:12; ::_thesis: verum end; Lm4: for n, k being Nat holds (Sgm (Seg (k + n))) | (Seg k) = Sgm (Seg k) proof let n be Nat; ::_thesis: for k being Nat holds (Sgm (Seg (k + n))) | (Seg k) = Sgm (Seg k) defpred S1[ Nat] means for k being Nat holds (Sgm (Seg (k + $1))) | (Seg k) = Sgm (Seg k); A1: for k being Nat st S1[k] holds S1[k + 1] by Lm3; A2: S1[ 0 ] by Lm2; for n being Nat holds S1[n] from NAT_1:sch_2(A2, A1); hence for k being Nat holds (Sgm (Seg (k + n))) | (Seg k) = Sgm (Seg k) ; ::_thesis: verum end; theorem :: FINSEQ_3:47 for k, n being Nat holds (Sgm (Seg (k + n))) | (Seg k) = Sgm (Seg k) by Lm4; Lm5: now__::_thesis:_for_k_being_Nat_st_Sgm_(Seg_k)_=_idseq_k_holds_ Sgm_(Seg_(k_+_1))_=_idseq_(k_+_1) let k be Nat; ::_thesis: ( Sgm (Seg k) = idseq k implies Sgm (Seg (k + 1)) = idseq (k + 1) ) assume A1: Sgm (Seg k) = idseq k ; ::_thesis: Sgm (Seg (k + 1)) = idseq (k + 1) A2: len (idseq (k + 1)) = k + 1 by CARD_1:def_7; then A3: len (Sgm (Seg (k + 1))) = len (idseq (k + 1)) by Th46; then A4: dom (Sgm (Seg (k + 1))) = Seg (k + 1) by A2, FINSEQ_1:def_3; now__::_thesis:_for_j_being_Nat_st_j_in_dom_(Sgm_(Seg_(k_+_1)))_holds_ (Sgm_(Seg_(k_+_1)))_._j_=_(idseq_(k_+_1))_._j let j be Nat; ::_thesis: ( j in dom (Sgm (Seg (k + 1))) implies (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j ) assume A5: j in dom (Sgm (Seg (k + 1))) ; ::_thesis: (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j then A6: j in (Seg k) \/ {(k + 1)} by A4, FINSEQ_1:9; now__::_thesis:_(Sgm_(Seg_(k_+_1)))_._j_=_(idseq_(k_+_1))_._j percases ( j in Seg k or j in {(k + 1)} ) by A6, XBOOLE_0:def_3; supposeA7: j in Seg k ; ::_thesis: (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j A8: (idseq (k + 1)) . j = j by A4, A5, FUNCT_1:18; A9: (Sgm (Seg (k + 1))) | (Seg k) = Sgm (Seg k) by Lm4; (Sgm (Seg k)) . j = j by A1, A7, FUNCT_1:18; hence (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j by A7, A8, A9, FUNCT_1:49; ::_thesis: verum end; supposeA10: j in {(k + 1)} ; ::_thesis: (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j set Y = Sgm (Seg k); set X = Sgm (Seg (k + 1)); A11: j = k + 1 by A10, TARSKI:def_1; then A12: j in Seg (k + 1) by FINSEQ_1:4; now__::_thesis:_not_(Sgm_(Seg_(k_+_1)))_._j_<>_j rng (Sgm (Seg (k + 1))) = Seg (k + 1) by FINSEQ_1:def_13; then A13: (Sgm (Seg (k + 1))) . j in Seg (k + 1) by A5, FUNCT_1:def_3; then reconsider n = (Sgm (Seg (k + 1))) . j as Element of NAT ; assume (Sgm (Seg (k + 1))) . j <> j ; ::_thesis: contradiction then not (Sgm (Seg (k + 1))) . j in {j} by TARSKI:def_1; then (Sgm (Seg (k + 1))) . j in (Seg (k + 1)) \ {(k + 1)} by A11, A13, XBOOLE_0:def_5; then A14: (Sgm (Seg (k + 1))) . j in Seg k by FINSEQ_1:10; A15: Sgm (Seg (k + 1)) is one-to-one by Lm1; A16: dom (Sgm (Seg (k + 1))) = Seg (k + 1) by A2, A3, FINSEQ_1:def_3; A17: k < k + 1 by XREAL_1:29; (Sgm (Seg (k + 1))) | (Seg k) = Sgm (Seg k) by Lm4; then A18: (Sgm (Seg (k + 1))) . n = (Sgm (Seg k)) . n by A14, FUNCT_1:49 .= n by A1, A14, FUNCT_1:18 ; n <= k by A14, FINSEQ_1:1; hence contradiction by A11, A12, A16, A13, A15, A18, A17, FUNCT_1:def_4; ::_thesis: verum end; hence (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j by A11, FINSEQ_1:4, FUNCT_1:18; ::_thesis: verum end; end; end; hence (Sgm (Seg (k + 1))) . j = (idseq (k + 1)) . j ; ::_thesis: verum end; hence Sgm (Seg (k + 1)) = idseq (k + 1) by A3, FINSEQ_2:9; ::_thesis: verum end; theorem Th48: :: FINSEQ_3:48 for k being Nat holds Sgm (Seg k) = idseq k proof let k be Nat; ::_thesis: Sgm (Seg k) = idseq k defpred S1[ Nat] means Sgm (Seg $1) = idseq $1; A1: for k being Nat st S1[k] holds S1[k + 1] by Lm5; A2: S1[ 0 ] by Th43; for k being Nat holds S1[k] from NAT_1:sch_2(A2, A1); hence Sgm (Seg k) = idseq k ; ::_thesis: verum end; theorem Th49: :: FINSEQ_3:49 for p being FinSequence for n being Nat holds ( p | (Seg n) = p iff len p <= n ) proof let p be FinSequence; ::_thesis: for n being Nat holds ( p | (Seg n) = p iff len p <= n ) let n be Nat; ::_thesis: ( p | (Seg n) = p iff len p <= n ) thus ( p | (Seg n) = p implies len p <= n ) by FINSEQ_1:86; ::_thesis: ( len p <= n implies p | (Seg n) = p ) assume len p <= n ; ::_thesis: p | (Seg n) = p then Seg (len p) c= Seg n by FINSEQ_1:5; then dom p c= Seg n by FINSEQ_1:def_3; then A1: dom p = (dom p) /\ (Seg n) by XBOOLE_1:28; for x being set st x in dom p holds p . x = p . x ; hence p | (Seg n) = p by A1, FUNCT_1:46; ::_thesis: verum end; theorem Th50: :: FINSEQ_3:50 for n, k being Nat holds (idseq (n + k)) | (Seg n) = idseq n proof let n, k be Nat; ::_thesis: (idseq (n + k)) | (Seg n) = idseq n A1: Sgm (Seg n) = idseq n by Th48; Sgm (Seg (n + k)) = idseq (n + k) by Th48; hence (idseq (n + k)) | (Seg n) = idseq n by A1, Lm4; ::_thesis: verum end; theorem :: FINSEQ_3:51 for n, m being Nat holds ( (idseq n) | (Seg m) = idseq m iff m <= n ) proof let n, m be Nat; ::_thesis: ( (idseq n) | (Seg m) = idseq m iff m <= n ) thus ( (idseq n) | (Seg m) = idseq m implies m <= n ) ::_thesis: ( m <= n implies (idseq n) | (Seg m) = idseq m ) proof assume (idseq n) | (Seg m) = idseq m ; ::_thesis: m <= n then len (idseq m) <= len (idseq n) by FINSEQ_1:79; then m <= len (idseq n) by CARD_1:def_7; hence m <= n by CARD_1:def_7; ::_thesis: verum end; assume m <= n ; ::_thesis: (idseq n) | (Seg m) = idseq m then ex j being Nat st n = m + j by NAT_1:10; hence (idseq n) | (Seg m) = idseq m by Th50; ::_thesis: verum end; theorem :: FINSEQ_3:52 for n, m being Nat holds ( (idseq n) | (Seg m) = idseq n iff n <= m ) proof let n, m be Nat; ::_thesis: ( (idseq n) | (Seg m) = idseq n iff n <= m ) len (idseq n) = n by CARD_1:def_7; hence ( (idseq n) | (Seg m) = idseq n iff n <= m ) by Th49; ::_thesis: verum end; theorem Th53: :: FINSEQ_3:53 for p, q being FinSequence for k, l being Nat st len p = k + l & q = p | (Seg k) holds len q = k proof let p, q be FinSequence; ::_thesis: for k, l being Nat st len p = k + l & q = p | (Seg k) holds len q = k let k, l be Nat; ::_thesis: ( len p = k + l & q = p | (Seg k) implies len q = k ) assume that A1: len p = k + l and A2: q = p | (Seg k) ; ::_thesis: len q = k k <= len p by A1, NAT_1:12; hence len q = k by A2, FINSEQ_1:17; ::_thesis: verum end; theorem :: FINSEQ_3:54 for p, q being FinSequence for k, l being Nat st len p = k + l & q = p | (Seg k) holds dom q = Seg k proof let p, q be FinSequence; ::_thesis: for k, l being Nat st len p = k + l & q = p | (Seg k) holds dom q = Seg k let k, l be Nat; ::_thesis: ( len p = k + l & q = p | (Seg k) implies dom q = Seg k ) assume that A1: len p = k + l and A2: q = p | (Seg k) ; ::_thesis: dom q = Seg k len q = k by A1, A2, Th53; hence dom q = Seg k by FINSEQ_1:def_3; ::_thesis: verum end; theorem Th55: :: FINSEQ_3:55 for p, q being FinSequence for k being Nat st len p = k + 1 & q = p | (Seg k) holds p = q ^ <*(p . (k + 1))*> proof let p, q be FinSequence; ::_thesis: for k being Nat st len p = k + 1 & q = p | (Seg k) holds p = q ^ <*(p . (k + 1))*> let k be Nat; ::_thesis: ( len p = k + 1 & q = p | (Seg k) implies p = q ^ <*(p . (k + 1))*> ) assume that A1: len p = k + 1 and A2: q = p | (Seg k) ; ::_thesis: p = q ^ <*(p . (k + 1))*> A3: for l being Element of NAT st l in dom q holds p . l = q . l by A2, FUNCT_1:47; set r = <*(p . (k + 1))*>; A4: now__::_thesis:_for_l_being_Element_of_NAT_st_l_in_dom_<*(p_._(k_+_1))*>_holds_ p_._((len_q)_+_l)_=_<*(p_._(k_+_1))*>_._l let l be Element of NAT ; ::_thesis: ( l in dom <*(p . (k + 1))*> implies p . ((len q) + l) = <*(p . (k + 1))*> . l ) assume l in dom <*(p . (k + 1))*> ; ::_thesis: p . ((len q) + l) = <*(p . (k + 1))*> . l then l in {1} by FINSEQ_1:2, FINSEQ_1:38; then A5: l = 1 by TARSKI:def_1; hence p . ((len q) + l) = p . (k + 1) by A1, A2, Th53 .= <*(p . (k + 1))*> . l by A5, FINSEQ_1:40 ; ::_thesis: verum end; len p = (len q) + 1 by A1, A2, Th53 .= (len q) + (len <*(p . (k + 1))*>) by FINSEQ_1:39 ; hence p = q ^ <*(p . (k + 1))*> by A3, A4, Th38; ::_thesis: verum end; theorem :: FINSEQ_3:56 for p being FinSequence for X being set holds ( p | X is FinSequence iff ex k being Element of NAT st X /\ (dom p) = Seg k ) proof let p be FinSequence; ::_thesis: for X being set holds ( p | X is FinSequence iff ex k being Element of NAT st X /\ (dom p) = Seg k ) let X be set ; ::_thesis: ( p | X is FinSequence iff ex k being Element of NAT st X /\ (dom p) = Seg k ) thus ( p | X is FinSequence implies ex k being Element of NAT st X /\ (dom p) = Seg k ) ::_thesis: ( ex k being Element of NAT st X /\ (dom p) = Seg k implies p | X is FinSequence ) proof assume p | X is FinSequence ; ::_thesis: ex k being Element of NAT st X /\ (dom p) = Seg k then consider k being Nat such that A1: dom (p | X) = Seg k by FINSEQ_1:def_2; reconsider k = k as Element of NAT by ORDINAL1:def_12; take k ; ::_thesis: X /\ (dom p) = Seg k thus X /\ (dom p) = Seg k by A1, RELAT_1:61; ::_thesis: verum end; given k being Element of NAT such that A2: X /\ (dom p) = Seg k ; ::_thesis: p | X is FinSequence dom (p | X) = Seg k by A2, RELAT_1:61; hence p | X is FinSequence by FINSEQ_1:def_2; ::_thesis: verum end; theorem Th57: :: FINSEQ_3:57 for p, q being FinSequence for A being set holds card ((p ^ q) " A) = (card (p " A)) + (card (q " A)) proof let p, q be FinSequence; ::_thesis: for A being set holds card ((p ^ q) " A) = (card (p " A)) + (card (q " A)) let A be set ; ::_thesis: card ((p ^ q) " A) = (card (p " A)) + (card (q " A)) set X = (p ^ q) " A; set B = { ((len p) + n) where n is Element of NAT : n in q " A } ; defpred S1[ set , set ] means ex i being Nat st ( $1 = i & $2 = (len p) + i ); A1: (p ^ q) " A = (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } proof thus (p ^ q) " A c= (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } :: according to XBOOLE_0:def_10 ::_thesis: (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } c= (p ^ q) " A proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (p ^ q) " A or x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } ) assume A2: x in (p ^ q) " A ; ::_thesis: x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } then A3: x in dom (p ^ q) by FUNCT_1:def_7; then reconsider k = x as Element of NAT ; now__::_thesis:_x_in_(p_"_A)_\/__{__((len_p)_+_n)_where_n_is_Element_of_NAT_:_n_in_q_"_A__}_ percases ( k in dom p or ex m being Nat st ( m in dom q & k = (len p) + m ) ) by A3, FINSEQ_1:25; supposeA4: k in dom p ; ::_thesis: x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } then (p ^ q) . k = p . k by FINSEQ_1:def_7; then p . k in A by A2, FUNCT_1:def_7; then k in p " A by A4, FUNCT_1:def_7; hence x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } by XBOOLE_0:def_3; ::_thesis: verum end; suppose ex m being Nat st ( m in dom q & k = (len p) + m ) ; ::_thesis: x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } then consider m being Nat such that A5: m in dom q and A6: k = (len p) + m ; q . m = (p ^ q) . k by A5, A6, FINSEQ_1:def_7; then q . m in A by A2, FUNCT_1:def_7; then A7: m in q " A by A5, FUNCT_1:def_7; m in NAT by ORDINAL1:def_12; then k in { ((len p) + n) where n is Element of NAT : n in q " A } by A6, A7; hence x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } ; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } or x in (p ^ q) " A ) assume A8: x in (p " A) \/ { ((len p) + n) where n is Element of NAT : n in q " A } ; ::_thesis: x in (p ^ q) " A now__::_thesis:_x_in_(p_^_q)_"_A percases ( x in p " A or x in { ((len p) + n) where n is Element of NAT : n in q " A } ) by A8, XBOOLE_0:def_3; supposeA9: x in p " A ; ::_thesis: x in (p ^ q) " A then A10: x in dom p by FUNCT_1:def_7; then reconsider k = x as Element of NAT ; (p ^ q) . k = p . k by A10, FINSEQ_1:def_7; then A11: (p ^ q) . x in A by A9, FUNCT_1:def_7; x in dom (p ^ q) by A10, Th22; hence x in (p ^ q) " A by A11, FUNCT_1:def_7; ::_thesis: verum end; suppose x in { ((len p) + n) where n is Element of NAT : n in q " A } ; ::_thesis: x in (p ^ q) " A then consider n being Element of NAT such that A12: x = (len p) + n and A13: n in q " A ; A14: n in dom q by A13, FUNCT_1:def_7; then (p ^ q) . ((len p) + n) = q . n by FINSEQ_1:def_7; then A15: (p ^ q) . x in A by A12, A13, FUNCT_1:def_7; x in dom (p ^ q) by A12, A14, FINSEQ_1:28; hence x in (p ^ q) " A by A15, FUNCT_1:def_7; ::_thesis: verum end; end; end; hence x in (p ^ q) " A ; ::_thesis: verum end; (p " A) /\ { ((len p) + n) where n is Element of NAT : n in q " A } = {} proof set x = the Element of (p " A) /\ { ((len p) + n) where n is Element of NAT : n in q " A } ; assume A16: not (p " A) /\ { ((len p) + n) where n is Element of NAT : n in q " A } = {} ; ::_thesis: contradiction then the Element of (p " A) /\ { ((len p) + n) where n is Element of NAT : n in q " A } in { ((len p) + n) where n is Element of NAT : n in q " A } by XBOOLE_0:def_4; then consider n being Element of NAT such that A17: the Element of (p " A) /\ { ((len p) + n) where n is Element of NAT : n in q " A } = (len p) + n and A18: n in q " A ; (len p) + n in p " A by A16, A17, XBOOLE_0:def_4; then (len p) + n in dom p by FUNCT_1:def_7; then (len p) + n <= (len p) + 0 by Th25; then A19: n = 0 by XREAL_1:6; n in dom q by A18, FUNCT_1:def_7; hence contradiction by A19, Th24; ::_thesis: verum end; then A20: p " A misses { ((len p) + n) where n is Element of NAT : n in q " A } by XBOOLE_0:def_7; reconsider B = { ((len p) + n) where n is Element of NAT : n in q " A } as finite set by A1, FINSET_1:1, XBOOLE_1:7; A21: card ((p ^ q) " A) = (card (p " A)) + (card B) by A1, A20, CARD_2:40; A22: for x being set st x in q " A holds ex y being set st S1[x,y] proof let x be set ; ::_thesis: ( x in q " A implies ex y being set st S1[x,y] ) assume x in q " A ; ::_thesis: ex y being set st S1[x,y] then x in dom q by FUNCT_1:def_7; then reconsider i = x as Element of NAT ; reconsider y = (len p) + i as set ; take y ; ::_thesis: S1[x,y] take i ; ::_thesis: ( x = i & y = (len p) + i ) thus ( x = i & y = (len p) + i ) ; ::_thesis: verum end; consider f being Function such that A23: dom f = q " A and A24: for x being set st x in q " A holds S1[x,f . x] from CLASSES1:sch_1(A22); A25: rng f = B proof thus rng f c= B :: according to XBOOLE_0:def_10 ::_thesis: B c= rng f proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng f or x in B ) assume x in rng f ; ::_thesis: x in B then consider y being set such that A26: y in dom f and A27: f . y = x by FUNCT_1:def_3; consider i being Nat such that A28: y = i and A29: f . y = (len p) + i by A23, A24, A26; i is Element of NAT by ORDINAL1:def_12; hence x in B by A23, A26, A27, A28, A29; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in B or x in rng f ) assume x in B ; ::_thesis: x in rng f then consider n being Element of NAT such that A30: x = (len p) + n and A31: n in q " A ; ex i being Nat st ( n = i & f . n = (len p) + i ) by A24, A31; hence x in rng f by A23, A30, A31, FUNCT_1:def_3; ::_thesis: verum end; f is one-to-one proof let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not x in dom f or not b1 in dom f or not f . x = f . b1 or x = b1 ) let y be set ; ::_thesis: ( not x in dom f or not y in dom f or not f . x = f . y or x = y ) assume that A32: x in dom f and A33: y in dom f and A34: f . x = f . y ; ::_thesis: x = y A35: ex j being Nat st ( y = j & f . y = (len p) + j ) by A23, A24, A33; ex i being Nat st ( x = i & f . x = (len p) + i ) by A23, A24, A32; hence x = y by A34, A35; ::_thesis: verum end; then q " A,B are_equipotent by A23, A25, WELLORD2:def_4; hence card ((p ^ q) " A) = (card (p " A)) + (card (q " A)) by A21, CARD_1:5; ::_thesis: verum end; theorem Th58: :: FINSEQ_3:58 for p, q being FinSequence for A being set holds p " A c= (p ^ q) " A proof let p, q be FinSequence; ::_thesis: for A being set holds p " A c= (p ^ q) " A let A be set ; ::_thesis: p " A c= (p ^ q) " A let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in p " A or x in (p ^ q) " A ) A1: dom p c= dom (p ^ q) by FINSEQ_1:26; assume A2: x in p " A ; ::_thesis: x in (p ^ q) " A then A3: x in dom p by FUNCT_1:def_7; then reconsider k = x as Element of NAT ; A4: p . k in A by A2, FUNCT_1:def_7; p . k = (p ^ q) . k by A3, FINSEQ_1:def_7; hence x in (p ^ q) " A by A3, A1, A4, FUNCT_1:def_7; ::_thesis: verum end; definition let p be FinSequence; let A be set ; funcp - A -> FinSequence equals :: FINSEQ_3:def 1 p * (Sgm ((dom p) \ (p " A))); coherence p * (Sgm ((dom p) \ (p " A))) is FinSequence proof now__::_thesis:_(_p_<>_{}_implies_ex_rr_being_FinSequence_st_rr_=_p_*_(Sgm_((dom_p)_\_(p_"_A)))_) assume p <> {} ; ::_thesis: ex rr being FinSequence st rr = p * (Sgm ((dom p) \ (p " A))) then reconsider D = Seg (len p) as non empty Subset of NAT ; (Seg (len p)) \ (p " A) c= Seg (len p) by XBOOLE_1:36; then rng (Sgm ((Seg (len p)) \ (p " A))) c= D by FINSEQ_1:def_13; then reconsider q = Sgm ((Seg (len p)) \ (p " A)) as FinSequence of D by FINSEQ_1:def_4; reconsider r = p * q as FinSequence by FINSEQ_2:30; take rr = r; ::_thesis: rr = p * (Sgm ((dom p) \ (p " A))) thus rr = p * (Sgm ((dom p) \ (p " A))) by FINSEQ_1:def_3; ::_thesis: verum end; hence p * (Sgm ((dom p) \ (p " A))) is FinSequence ; ::_thesis: verum end; end; :: deftheorem defines - FINSEQ_3:def_1_:_ for p being FinSequence for A being set holds p - A = p * (Sgm ((dom p) \ (p " A))); theorem Th59: :: FINSEQ_3:59 for p being FinSequence for A being set holds len (p - A) = (len p) - (card (p " A)) proof let p be FinSequence; ::_thesis: for A being set holds len (p - A) = (len p) - (card (p " A)) let A be set ; ::_thesis: len (p - A) = (len p) - (card (p " A)) set q = Sgm ((Seg (len p)) \ (p " A)); A1: Seg (len p) = dom p by FINSEQ_1:def_3; (Seg (len p)) \ (p " A) c= Seg (len p) by XBOOLE_1:36; then rng (Sgm ((Seg (len p)) \ (p " A))) c= dom p by A1, FINSEQ_1:def_13; then A2: dom (Sgm ((Seg (len p)) \ (p " A))) = dom (p - A) by A1, RELAT_1:27; A3: dom (Sgm ((Seg (len p)) \ (p " A))) = Seg (len (Sgm ((Seg (len p)) \ (p " A)))) by FINSEQ_1:def_3; A4: p " A c= Seg (len p) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in p " A or x in Seg (len p) ) A5: p " A c= dom p by RELAT_1:132; A6: dom p = Seg (len p) by FINSEQ_1:def_3; assume x in p " A ; ::_thesis: x in Seg (len p) hence x in Seg (len p) by A5, A6; ::_thesis: verum end; len (Sgm ((Seg (len p)) \ (p " A))) = card ((Seg (len p)) \ (p " A)) by Th39, XBOOLE_1:36; then len (p - A) = card ((Seg (len p)) \ (p " A)) by A2, A3, FINSEQ_1:def_3; hence len (p - A) = (card (Seg (len p))) - (card (p " A)) by A4, CARD_2:44 .= (len p) - (card (p " A)) by FINSEQ_1:57 ; ::_thesis: verum end; theorem Th60: :: FINSEQ_3:60 for p being FinSequence for A being set holds len (p - A) <= len p proof let p be FinSequence; ::_thesis: for A being set holds len (p - A) <= len p let A be set ; ::_thesis: len (p - A) <= len p len (p - A) = (len p) - (card (p " A)) by Th59; hence len (p - A) <= len p by XREAL_1:43; ::_thesis: verum end; theorem Th61: :: FINSEQ_3:61 for p being FinSequence for A being set st len (p - A) = len p holds A misses rng p proof let p be FinSequence; ::_thesis: for A being set st len (p - A) = len p holds A misses rng p let A be set ; ::_thesis: ( len (p - A) = len p implies A misses rng p ) assume A1: len (p - A) = len p ; ::_thesis: A misses rng p A2: len (p - A) = (len p) - (card (p " A)) by Th59; assume A meets rng p ; ::_thesis: contradiction then p " A <> {} by RELAT_1:138; hence contradiction by A1, A2; ::_thesis: verum end; theorem :: FINSEQ_3:62 for p being FinSequence for A being set for n being Nat st n = (len p) - (card (p " A)) holds dom (p - A) = Seg n proof let p be FinSequence; ::_thesis: for A being set for n being Nat st n = (len p) - (card (p " A)) holds dom (p - A) = Seg n let A be set ; ::_thesis: for n being Nat st n = (len p) - (card (p " A)) holds dom (p - A) = Seg n let n be Nat; ::_thesis: ( n = (len p) - (card (p " A)) implies dom (p - A) = Seg n ) assume n = (len p) - (card (p " A)) ; ::_thesis: dom (p - A) = Seg n then len (p - A) = n by Th59; hence dom (p - A) = Seg n by FINSEQ_1:def_3; ::_thesis: verum end; theorem :: FINSEQ_3:63 for p being FinSequence for A being set holds dom (p - A) c= dom p proof let p be FinSequence; ::_thesis: for A being set holds dom (p - A) c= dom p let A be set ; ::_thesis: dom (p - A) c= dom p A1: dom (p - A) = Seg (len (p - A)) by FINSEQ_1:def_3; A2: dom p = Seg (len p) by FINSEQ_1:def_3; len (p - A) <= len p by Th60; hence dom (p - A) c= dom p by A1, A2, FINSEQ_1:5; ::_thesis: verum end; theorem :: FINSEQ_3:64 for p being FinSequence for A being set st dom (p - A) = dom p holds A misses rng p proof let p be FinSequence; ::_thesis: for A being set st dom (p - A) = dom p holds A misses rng p let A be set ; ::_thesis: ( dom (p - A) = dom p implies A misses rng p ) A1: dom (p - A) = Seg (len (p - A)) by FINSEQ_1:def_3; A2: dom p = Seg (len p) by FINSEQ_1:def_3; assume dom (p - A) = dom p ; ::_thesis: A misses rng p hence A misses rng p by A1, A2, Th61, FINSEQ_1:6; ::_thesis: verum end; theorem Th65: :: FINSEQ_3:65 for p being FinSequence for A being set holds rng (p - A) = (rng p) \ A proof let p be FinSequence; ::_thesis: for A being set holds rng (p - A) = (rng p) \ A let A be set ; ::_thesis: rng (p - A) = (rng p) \ A set q = Sgm ((Seg (len p)) \ (p " A)); A1: dom p = Seg (len p) by FINSEQ_1:def_3; A2: dom p = Seg (len p) by FINSEQ_1:def_3; thus rng (p - A) c= (rng p) \ A :: according to XBOOLE_0:def_10 ::_thesis: (rng p) \ A c= rng (p - A) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng (p - A) or x in (rng p) \ A ) A3: rng (p * (Sgm ((Seg (len p)) \ (p " A)))) c= rng p by RELAT_1:26; assume A4: x in rng (p - A) ; ::_thesis: x in (rng p) \ A A5: now__::_thesis:_not_x_in_A A6: (Seg (len p)) \ (p " A) c= Seg (len p) by XBOOLE_1:36; assume A7: x in A ; ::_thesis: contradiction consider y being set such that A8: y in dom (p - A) and A9: (p - A) . y = x by A4, FUNCT_1:def_3; set z = (Sgm ((Seg (len p)) \ (p " A))) . y; A10: y in dom (Sgm ((Seg (len p)) \ (p " A))) by A2, A8, FUNCT_1:11; then A11: (p - A) . y = p . ((Sgm ((Seg (len p)) \ (p " A))) . y) by A2, FUNCT_1:13; (Sgm ((Seg (len p)) \ (p " A))) . y in rng (Sgm ((Seg (len p)) \ (p " A))) by A10, FUNCT_1:def_3; then (Sgm ((Seg (len p)) \ (p " A))) . y in (Seg (len p)) \ (p " A) by A6, FINSEQ_1:def_13; then A12: not (Sgm ((Seg (len p)) \ (p " A))) . y in p " A by XBOOLE_0:def_5; (Sgm ((Seg (len p)) \ (p " A))) . y in dom p by A2, A8, FUNCT_1:11; hence contradiction by A7, A9, A11, A12, FUNCT_1:def_7; ::_thesis: verum end; x in rng (p * (Sgm ((Seg (len p)) \ (p " A)))) by A4, FINSEQ_1:def_3; hence x in (rng p) \ A by A3, A5, XBOOLE_0:def_5; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (rng p) \ A or x in rng (p - A) ) assume A13: x in (rng p) \ A ; ::_thesis: x in rng (p - A) then consider y being set such that A14: y in dom p and A15: p . y = x by FUNCT_1:def_3; (Seg (len p)) \ (p " A) c= Seg (len p) by XBOOLE_1:36; then A16: rng (Sgm ((Seg (len p)) \ (p " A))) = (Seg (len p)) \ (p " A) by FINSEQ_1:def_13; not p . y in A by A13, A15, XBOOLE_0:def_5; then not y in p " A by FUNCT_1:def_7; then y in rng (Sgm ((Seg (len p)) \ (p " A))) by A14, A1, A16, XBOOLE_0:def_5; then consider z being set such that A17: z in dom (Sgm ((Seg (len p)) \ (p " A))) and A18: (Sgm ((Seg (len p)) \ (p " A))) . z = y by FUNCT_1:def_3; A19: (p - A) . z = x by A2, A15, A17, A18, FUNCT_1:13; z in dom (p - A) by A2, A14, A17, A18, FUNCT_1:11; hence x in rng (p - A) by A19, FUNCT_1:def_3; ::_thesis: verum end; theorem :: FINSEQ_3:66 for p being FinSequence for A being set holds rng (p - A) c= rng p proof let p be FinSequence; ::_thesis: for A being set holds rng (p - A) c= rng p let A be set ; ::_thesis: rng (p - A) c= rng p rng (p - A) = (rng p) \ A by Th65; hence rng (p - A) c= rng p ; ::_thesis: verum end; theorem :: FINSEQ_3:67 for p being FinSequence for A being set st rng (p - A) = rng p holds A misses rng p proof let p be FinSequence; ::_thesis: for A being set st rng (p - A) = rng p holds A misses rng p let A be set ; ::_thesis: ( rng (p - A) = rng p implies A misses rng p ) assume rng (p - A) = rng p ; ::_thesis: A misses rng p then (rng p) \ A = rng p by Th65; hence A misses rng p by XBOOLE_1:83; ::_thesis: verum end; theorem Th68: :: FINSEQ_3:68 for p being FinSequence for A being set holds ( p - A = {} iff rng p c= A ) proof let p be FinSequence; ::_thesis: for A being set holds ( p - A = {} iff rng p c= A ) let A be set ; ::_thesis: ( p - A = {} iff rng p c= A ) thus ( p - A = {} implies rng p c= A ) ::_thesis: ( rng p c= A implies p - A = {} ) proof assume that A1: p - A = {} and A2: not rng p c= A ; ::_thesis: contradiction (rng p) \ A <> {} by A2, XBOOLE_1:37; then rng (p - A) <> {} by Th65; hence contradiction by A1; ::_thesis: verum end; assume A3: rng p c= A ; ::_thesis: p - A = {} rng (p - A) = (rng p) \ A by Th65; hence p - A = {} by A3, XBOOLE_1:37; ::_thesis: verum end; theorem Th69: :: FINSEQ_3:69 for p being FinSequence for A being set holds ( p - A = p iff A misses rng p ) proof let p be FinSequence; ::_thesis: for A being set holds ( p - A = p iff A misses rng p ) let A be set ; ::_thesis: ( p - A = p iff A misses rng p ) thus ( p - A = p implies A misses rng p ) ::_thesis: ( A misses rng p implies p - A = p ) proof assume that A1: p - A = p and A2: not A misses rng p ; ::_thesis: contradiction len (p - A) <> len p by A2, Th61; hence contradiction by A1; ::_thesis: verum end; assume A misses rng p ; ::_thesis: p - A = p then p " A = {} by RELAT_1:138; then Sgm ((Seg (len p)) \ (p " A)) = idseq (len p) by Th48; then p * (Sgm ((Seg (len p)) \ (p " A))) = p by FINSEQ_2:54; hence p - A = p by FINSEQ_1:def_3; ::_thesis: verum end; theorem :: FINSEQ_3:70 for p being FinSequence for x being set holds ( p - {x} = p iff not x in rng p ) proof let p be FinSequence; ::_thesis: for x being set holds ( p - {x} = p iff not x in rng p ) let x be set ; ::_thesis: ( p - {x} = p iff not x in rng p ) thus ( p - {x} = p implies not x in rng p ) ::_thesis: ( not x in rng p implies p - {x} = p ) proof assume p - {x} = p ; ::_thesis: not x in rng p then A1: {x} misses rng p by Th69; x in {x} by TARSKI:def_1; hence not x in rng p by A1, XBOOLE_0:3; ::_thesis: verum end; assume A2: not x in rng p ; ::_thesis: p - {x} = p {x} misses rng p proof assume {x} meets rng p ; ::_thesis: contradiction then ex y being set st ( y in {x} & y in rng p ) by XBOOLE_0:3; hence contradiction by A2, TARSKI:def_1; ::_thesis: verum end; hence p - {x} = p by Th69; ::_thesis: verum end; theorem :: FINSEQ_3:71 for p being FinSequence holds p - {} = p proof let p be FinSequence; ::_thesis: p - {} = p {} misses rng p by XBOOLE_1:65; hence p - {} = p by Th69; ::_thesis: verum end; theorem :: FINSEQ_3:72 for p being FinSequence holds p - (rng p) = {} by Th68; Lm6: for x, A being set holds ( <*x*> - A = <*x*> iff not x in A ) proof let x, A be set ; ::_thesis: ( <*x*> - A = <*x*> iff not x in A ) thus ( <*x*> - A = <*x*> implies not x in A ) ::_thesis: ( not x in A implies <*x*> - A = <*x*> ) proof assume <*x*> - A = <*x*> ; ::_thesis: not x in A then A1: rng <*x*> misses A by Th69; A2: rng <*x*> = {x} by FINSEQ_1:39; x in {x} by TARSKI:def_1; hence not x in A by A2, A1, XBOOLE_0:3; ::_thesis: verum end; assume A3: not x in A ; ::_thesis: <*x*> - A = <*x*> rng <*x*> misses A proof assume rng <*x*> meets A ; ::_thesis: contradiction then consider y being set such that A4: y in rng <*x*> and A5: y in A by XBOOLE_0:3; y in {x} by A4, FINSEQ_1:39; hence contradiction by A3, A5, TARSKI:def_1; ::_thesis: verum end; hence <*x*> - A = <*x*> by Th69; ::_thesis: verum end; Lm7: for x, A being set holds ( <*x*> - A = {} iff x in A ) proof let x, A be set ; ::_thesis: ( <*x*> - A = {} iff x in A ) A1: rng <*x*> = {x} by FINSEQ_1:39; thus ( <*x*> - A = {} implies x in A ) ::_thesis: ( x in A implies <*x*> - A = {} ) proof assume <*x*> - A = {} ; ::_thesis: x in A then rng <*x*> c= A by Th68; then {x} c= A by FINSEQ_1:39; hence x in A by ZFMISC_1:31; ::_thesis: verum end; assume x in A ; ::_thesis: <*x*> - A = {} then rng <*x*> c= A by A1, ZFMISC_1:31; hence <*x*> - A = {} by Th68; ::_thesis: verum end; Lm8: for p being FinSequence for A being set holds (p ^ {}) - A = (p - A) ^ ({} - A) proof let p be FinSequence; ::_thesis: for A being set holds (p ^ {}) - A = (p - A) ^ ({} - A) let A be set ; ::_thesis: (p ^ {}) - A = (p - A) ^ ({} - A) thus (p ^ {}) - A = p - A by FINSEQ_1:34 .= (p - A) ^ ({} - A) by FINSEQ_1:34 ; ::_thesis: verum end; Lm9: for p being FinSequence for x, A being set holds (p ^ <*x*>) - A = (p - A) ^ (<*x*> - A) proof let p be FinSequence; ::_thesis: for x, A being set holds (p ^ <*x*>) - A = (p - A) ^ (<*x*> - A) let x, A be set ; ::_thesis: (p ^ <*x*>) - A = (p - A) ^ (<*x*> - A) set r = (p ^ <*x*>) - A; set q = <*x*> - A; set t = p ^ <*x*>; A1: len (p ^ <*x*>) = (len p) + (len <*x*>) by FINSEQ_1:22 .= (len p) + 1 by FINSEQ_1:40 ; A2: now__::_thesis:_for_k_being_Element_of_NAT_st_k_in_dom_(<*x*>_-_A)_holds_ ((p_^_<*x*>)_-_A)_._((len_(p_-_A))_+_k)_=_(<*x*>_-_A)_._k (p ^ <*x*>) " A c= dom (p ^ <*x*>) by RELAT_1:132; then A3: (p ^ <*x*>) " A c= Seg (len (p ^ <*x*>)) by FINSEQ_1:def_3; set S = (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A); set s = Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)); let k be Element of NAT ; ::_thesis: ( k in dom (<*x*> - A) implies ((p ^ <*x*>) - A) . ((len (p - A)) + k) = (<*x*> - A) . k ) A4: (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) c= Seg (len (p ^ <*x*>)) by XBOOLE_1:36; assume A5: k in dom (<*x*> - A) ; ::_thesis: ((p ^ <*x*>) - A) . ((len (p - A)) + k) = (<*x*> - A) . k then A6: not x in A by Lm7, RELAT_1:38; then A7: <*x*> - A = <*x*> by Lm6; then A8: dom (<*x*> - A) = {1} by FINSEQ_1:2, FINSEQ_1:def_8; then A9: k = 1 by A5, TARSKI:def_1; A10: p " A = (p ^ <*x*>) " A proof thus p " A c= (p ^ <*x*>) " A :: according to XBOOLE_0:def_10 ::_thesis: (p ^ <*x*>) " A c= p " A proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in p " A or y in (p ^ <*x*>) " A ) assume A11: y in p " A ; ::_thesis: y in (p ^ <*x*>) " A then A12: y in dom p by FUNCT_1:def_7; then reconsider z = y as Element of NAT ; p . y in A by A11, FUNCT_1:def_7; then A13: (p ^ <*x*>) . z in A by A12, FINSEQ_1:def_7; y in dom (p ^ <*x*>) by A12, Th22; hence y in (p ^ <*x*>) " A by A13, FUNCT_1:def_7; ::_thesis: verum end; let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in (p ^ <*x*>) " A or y in p " A ) assume A14: y in (p ^ <*x*>) " A ; ::_thesis: y in p " A then A15: y in dom (p ^ <*x*>) by FUNCT_1:def_7; then reconsider z = y as Element of NAT ; A16: (p ^ <*x*>) . y in A by A14, FUNCT_1:def_7; A17: now__::_thesis:_for_n_being_Nat_holds_ (_not_n_in_dom_(<*x*>_-_A)_or_not_z_=_(len_p)_+_n_) given n being Nat such that A18: n in dom (<*x*> - A) and A19: z = (len p) + n ; ::_thesis: contradiction n = 1 by A8, A18, TARSKI:def_1; hence contradiction by A6, A16, A19, FINSEQ_1:42; ::_thesis: verum end; A20: ( z in dom p or ex n being Nat st ( n in dom (<*x*> - A) & z = (len p) + n ) ) by A7, A15, FINSEQ_1:25; then (p ^ <*x*>) . z = p . z by A17, FINSEQ_1:def_7; hence y in p " A by A16, A20, A17, FUNCT_1:def_7; ::_thesis: verum end; A21: now__::_thesis:_not_len_(p_^_<*x*>)_in_(p_^_<*x*>)_"_A assume A22: len (p ^ <*x*>) in (p ^ <*x*>) " A ; ::_thesis: contradiction (p ^ <*x*>) . (len (p ^ <*x*>)) = x by A1, FINSEQ_1:42; hence contradiction by A6, A22, FUNCT_1:def_7; ::_thesis: verum end; A23: dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) = Seg (len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)))) by FINSEQ_1:def_3; len (p ^ <*x*>) in Seg (len (p ^ <*x*>)) by A1, FINSEQ_1:4; then len (p ^ <*x*>) in (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) by A21, XBOOLE_0:def_5; then len (p ^ <*x*>) in rng (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by A4, FINSEQ_1:def_13; then consider y being set such that A24: y in dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) and A25: (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . y = len (p ^ <*x*>) by FUNCT_1:def_3; reconsider y = y as Element of NAT by A24; A26: (len (p - A)) + k = ((len p) - (card (p " A))) + k by Th59 .= ((len p) + 1) - (card ((p ^ <*x*>) " A)) by A9, A10 .= ((len p) + (len <*x*>)) - (card ((p ^ <*x*>) " A)) by FINSEQ_1:39 .= (len (p ^ <*x*>)) - (card ((p ^ <*x*>) " A)) by FINSEQ_1:22 .= len ((p ^ <*x*>) - A) by Th59 ; A27: len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) = card ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)) by Th39, XBOOLE_1:36 .= (card (Seg (len (p ^ <*x*>)))) - (card ((p ^ <*x*>) " A)) by A3, CARD_2:44 .= (len (p ^ <*x*>)) - (card (p " A)) by A10, FINSEQ_1:57 .= ((len p) - (card (p " A))) + k by A1, A9 .= len ((p ^ <*x*>) - A) by A26, Th59 ; then A28: len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) = (len (p - A)) + 1 by A5, A8, A26, TARSKI:def_1; then A29: len ((p ^ <*x*>) - A) in dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by A27, A23, FINSEQ_1:4; A30: now__::_thesis:_not_y_<>_len_(Sgm_((Seg_(len_(p_^_<*x*>)))_\_((p_^_<*x*>)_"_A))) A31: (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . (len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)))) in rng (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by A27, A29, FUNCT_1:def_3; reconsider w = (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . (len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)))) as Element of NAT by A31; w in (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) by A4, A31, FINSEQ_1:def_13; then A32: w in Seg (len (p ^ <*x*>)) by XBOOLE_0:def_5; assume A33: y <> len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) ; ::_thesis: contradiction A34: y in Seg (len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)))) by A24, FINSEQ_1:def_3; then y <= len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by FINSEQ_1:1; then A35: y < len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by A33, XXREAL_0:1; 1 <= y by A34, FINSEQ_1:1; then len (p ^ <*x*>) < w by A4, A25, A35, FINSEQ_1:def_13; hence contradiction by A32, FINSEQ_1:1; ::_thesis: verum end; dom (p ^ <*x*>) = Seg (len (p ^ <*x*>)) by FINSEQ_1:def_3; hence ((p ^ <*x*>) - A) . ((len (p - A)) + k) = (p ^ <*x*>) . (len (p ^ <*x*>)) by A26, A27, A28, A23, A25, A30, FINSEQ_1:4, FUNCT_1:13 .= x by A1, FINSEQ_1:42 .= (<*x*> - A) . k by A7, A9, FINSEQ_1:def_8 ; ::_thesis: verum end; A36: now__::_thesis:_for_k_being_Element_of_NAT_st_k_in_dom_(p_-_A)_holds_ ((p_^_<*x*>)_-_A)_._k_=_(p_-_A)_._k A37: ( x in A implies (p ^ <*x*>) " A = (p " A) \/ {((len p) + 1)} ) proof assume A38: x in A ; ::_thesis: (p ^ <*x*>) " A = (p " A) \/ {((len p) + 1)} thus (p ^ <*x*>) " A c= (p " A) \/ {((len p) + 1)} :: according to XBOOLE_0:def_10 ::_thesis: (p " A) \/ {((len p) + 1)} c= (p ^ <*x*>) " A proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in (p ^ <*x*>) " A or y in (p " A) \/ {((len p) + 1)} ) assume A39: y in (p ^ <*x*>) " A ; ::_thesis: y in (p " A) \/ {((len p) + 1)} then y in dom (p ^ <*x*>) by FUNCT_1:def_7; then y in Seg ((len p) + 1) by A1, FINSEQ_1:def_3; then A40: y in (Seg (len p)) \/ {((len p) + 1)} by FINSEQ_1:9; now__::_thesis:_y_in_(p_"_A)_\/_{((len_p)_+_1)} percases ( y in Seg (len p) or y in {((len p) + 1)} ) by A40, XBOOLE_0:def_3; supposeA41: y in Seg (len p) ; ::_thesis: y in (p " A) \/ {((len p) + 1)} then reconsider j = y as Element of NAT ; A42: (p ^ <*x*>) . y in A by A39, FUNCT_1:def_7; A43: y in dom p by A41, FINSEQ_1:def_3; then p . j = (p ^ <*x*>) . j by FINSEQ_1:def_7; then y in p " A by A43, A42, FUNCT_1:def_7; hence y in (p " A) \/ {((len p) + 1)} by XBOOLE_0:def_3; ::_thesis: verum end; suppose y in {((len p) + 1)} ; ::_thesis: y in (p " A) \/ {((len p) + 1)} hence y in (p " A) \/ {((len p) + 1)} by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence y in (p " A) \/ {((len p) + 1)} ; ::_thesis: verum end; let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in (p " A) \/ {((len p) + 1)} or y in (p ^ <*x*>) " A ) assume A44: y in (p " A) \/ {((len p) + 1)} ; ::_thesis: y in (p ^ <*x*>) " A now__::_thesis:_y_in_(p_^_<*x*>)_"_A percases ( y in p " A or y in {((len p) + 1)} ) by A44, XBOOLE_0:def_3; supposeA45: y in p " A ; ::_thesis: y in (p ^ <*x*>) " A p " A c= (p ^ <*x*>) " A by Th58; hence y in (p ^ <*x*>) " A by A45; ::_thesis: verum end; suppose y in {((len p) + 1)} ; ::_thesis: y in (p ^ <*x*>) " A then A46: y = (len p) + 1 by TARSKI:def_1; then y in Seg (len (p ^ <*x*>)) by A1, FINSEQ_1:4; then A47: y in dom (p ^ <*x*>) by FINSEQ_1:def_3; (p ^ <*x*>) . y in A by A38, A46, FINSEQ_1:42; hence y in (p ^ <*x*>) " A by A47, FUNCT_1:def_7; ::_thesis: verum end; end; end; hence y in (p ^ <*x*>) " A ; ::_thesis: verum end; (p ^ <*x*>) " A c= dom (p ^ <*x*>) by RELAT_1:132; then A48: (p ^ <*x*>) " A c= Seg (len (p ^ <*x*>)) by FINSEQ_1:def_3; A49: ( not x in A implies (p ^ <*x*>) " A = p " A ) proof assume A50: not x in A ; ::_thesis: (p ^ <*x*>) " A = p " A thus (p ^ <*x*>) " A c= p " A :: according to XBOOLE_0:def_10 ::_thesis: p " A c= (p ^ <*x*>) " A proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in (p ^ <*x*>) " A or y in p " A ) assume A51: y in (p ^ <*x*>) " A ; ::_thesis: y in p " A then A52: y in dom (p ^ <*x*>) by FUNCT_1:def_7; then reconsider l = y as Element of NAT ; A53: now__::_thesis:_not_l_=_(len_p)_+_1 assume l = (len p) + 1 ; ::_thesis: contradiction then (p ^ <*x*>) . l = x by FINSEQ_1:42; hence contradiction by A50, A51, FUNCT_1:def_7; ::_thesis: verum end; A54: y in Seg (len (p ^ <*x*>)) by A52, FINSEQ_1:def_3; then l <= (len p) + 1 by A1, FINSEQ_1:1; then l < (len p) + 1 by A53, XXREAL_0:1; then A55: l <= len p by NAT_1:13; 1 <= l by A54, FINSEQ_1:1; then l in Seg (len p) by A55, FINSEQ_1:1; then A56: y in dom p by FINSEQ_1:def_3; (p ^ <*x*>) . l in A by A51, FUNCT_1:def_7; then p . l in A by A56, FINSEQ_1:def_7; hence y in p " A by A56, FUNCT_1:def_7; ::_thesis: verum end; thus p " A c= (p ^ <*x*>) " A by Th58; ::_thesis: verum end; set s2 = Sgm ((Seg (len p)) \ (p " A)); set s1 = Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)); let k be Element of NAT ; ::_thesis: ( k in dom (p - A) implies ((p ^ <*x*>) - A) . k = (p - A) . k ) A57: dom p = Seg (len p) by FINSEQ_1:def_3; A58: now__::_thesis:_(_(p_^_<*x*>)_"_A_=_p_"_A_implies_(Seg_(len_(p_^_<*x*>)))_\_((p_^_<*x*>)_"_A)_=_((Seg_(len_p))_\_(p_"_A))_\/_{((len_p)_+_1)}_) {((len p) + 1)} /\ (p " A) = {} proof set z = the Element of {((len p) + 1)} /\ (p " A); A59: p " A c= dom p by RELAT_1:132; assume A60: not {((len p) + 1)} /\ (p " A) = {} ; ::_thesis: contradiction then the Element of {((len p) + 1)} /\ (p " A) in {((len p) + 1)} by XBOOLE_0:def_4; then A61: the Element of {((len p) + 1)} /\ (p " A) = (len p) + 1 by TARSKI:def_1; A62: dom p = Seg (len p) by FINSEQ_1:def_3; the Element of {((len p) + 1)} /\ (p " A) in p " A by A60, XBOOLE_0:def_4; then (len p) + 1 <= len p by A61, A59, A62, FINSEQ_1:1; hence contradiction by XREAL_1:29; ::_thesis: verum end; then A63: {((len p) + 1)} misses p " A by XBOOLE_0:def_7; assume (p ^ <*x*>) " A = p " A ; ::_thesis: (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) = ((Seg (len p)) \ (p " A)) \/ {((len p) + 1)} hence (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) = ((Seg (len p)) \/ {((len p) + 1)}) \ (p " A) by A1, FINSEQ_1:9 .= ((Seg (len p)) \ (p " A)) \/ ({((len p) + 1)} \ (p " A)) by XBOOLE_1:42 .= ((Seg (len p)) \ (p " A)) \/ {((len p) + 1)} by A63, XBOOLE_1:83 ; ::_thesis: verum end; (Seg (len p)) /\ {((len p) + 1)} = {} proof set z = the Element of (Seg (len p)) /\ {((len p) + 1)}; assume A64: not (Seg (len p)) /\ {((len p) + 1)} = {} ; ::_thesis: contradiction then A65: the Element of (Seg (len p)) /\ {((len p) + 1)} in Seg (len p) by XBOOLE_0:def_4; then reconsider f = the Element of (Seg (len p)) /\ {((len p) + 1)} as Element of NAT ; f in {((len p) + 1)} by A64, XBOOLE_0:def_4; then A66: f = (len p) + 1 by TARSKI:def_1; f <= len p by A65, FINSEQ_1:1; hence contradiction by A66, XREAL_1:29; ::_thesis: verum end; then A67: Seg (len p) misses {((len p) + 1)} by XBOOLE_0:def_7; A68: now__::_thesis:_(_(p_^_<*x*>)_"_A_=_(p_"_A)_\/_{((len_p)_+_1)}_implies_(Seg_(len_(p_^_<*x*>)))_\_((p_^_<*x*>)_"_A)_=_(Seg_(len_p))_\_(p_"_A)_) assume (p ^ <*x*>) " A = (p " A) \/ {((len p) + 1)} ; ::_thesis: (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) = (Seg (len p)) \ (p " A) hence (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) = ((Seg (len p)) \/ {((len p) + 1)}) \ ((p " A) \/ {((len p) + 1)}) by A1, FINSEQ_1:9 .= ((Seg (len p)) \ ((p " A) \/ {((len p) + 1)})) \/ ({((len p) + 1)} \ ((p " A) \/ {((len p) + 1)})) by XBOOLE_1:42 .= ((Seg (len p)) \ ((p " A) \/ {((len p) + 1)})) \/ {} by XBOOLE_1:46 .= ((Seg (len p)) \ (p " A)) /\ ((Seg (len p)) \ {((len p) + 1)}) by XBOOLE_1:53 .= ((Seg (len p)) \ (p " A)) /\ (Seg (len p)) by A67, XBOOLE_1:83 .= (Seg (len p)) \ (p " A) by XBOOLE_1:28, XBOOLE_1:36 ; ::_thesis: verum end; p " A c= dom p by RELAT_1:132; then A69: p " A c= Seg (len p) by FINSEQ_1:def_3; len (Sgm ((Seg (len p)) \ (p " A))) = card ((Seg (len p)) \ (p " A)) by Th39, XBOOLE_1:36 .= (card (Seg (len p))) - (card (p " A)) by A69, CARD_2:44 ; then A70: len (Sgm ((Seg (len p)) \ (p " A))) = (len p) - (card (p " A)) by FINSEQ_1:57; (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) c= Seg (len (p ^ <*x*>)) by XBOOLE_1:36; then A71: rng (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) c= Seg (len (p ^ <*x*>)) by FINSEQ_1:def_13; A72: (Seg (len p)) \ (p " A) c= Seg (len p) by XBOOLE_1:36; then A73: rng (Sgm ((Seg (len p)) \ (p " A))) c= Seg (len p) by FINSEQ_1:def_13; assume k in dom (p - A) ; ::_thesis: ((p ^ <*x*>) - A) . k = (p - A) . k then A74: k in dom (Sgm ((Seg (len p)) \ (p " A))) by A57, FUNCT_1:11; then (Sgm ((Seg (len p)) \ (p " A))) . k in rng (Sgm ((Seg (len p)) \ (p " A))) by FUNCT_1:def_3; then (Sgm ((Seg (len p)) \ (p " A))) . k in Seg (len p) by A73; then A75: (Sgm ((Seg (len p)) \ (p " A))) . k in dom p by FINSEQ_1:def_3; len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) = card ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)) by Th39, XBOOLE_1:36 .= (card (Seg (len (p ^ <*x*>)))) - (card ((p ^ <*x*>) " A)) by A48, CARD_2:44 ; then A76: len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) = (len (p ^ <*x*>)) - (card ((p ^ <*x*>) " A)) by FINSEQ_1:57; A77: dom (Sgm ((Seg (len p)) \ (p " A))) c= dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) proof <*x*> " A c= dom <*x*> by RELAT_1:132; then <*x*> " A c= {1} by FINSEQ_1:2, FINSEQ_1:def_8; then A78: ( <*x*> " A = {} or <*x*> " A = {1} ) by ZFMISC_1:33; let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in dom (Sgm ((Seg (len p)) \ (p " A))) or y in dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) ) A79: card (p " A) <= (card (p " A)) + 1 by NAT_1:12; assume A80: y in dom (Sgm ((Seg (len p)) \ (p " A))) ; ::_thesis: y in dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) then reconsider l = y as Element of NAT ; A81: y in Seg (len (Sgm ((Seg (len p)) \ (p " A)))) by A80, FINSEQ_1:def_3; then l <= (len p) - (card (p " A)) by A70, FINSEQ_1:1; then l + (card (p " A)) <= len p by XREAL_1:19; then A82: (l + (card (p " A))) + 1 <= len (p ^ <*x*>) by A1, XREAL_1:7; card ((p ^ <*x*>) " A) = (card (p " A)) + (card (<*x*> " A)) by Th57; then l + (card ((p ^ <*x*>) " A)) <= l + ((card (p " A)) + 1) by A78, A79, CARD_1:27, CARD_1:30, XREAL_1:7; then l + (card ((p ^ <*x*>) " A)) <= len (p ^ <*x*>) by A82, XXREAL_0:2; then A83: l <= len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by A76, XREAL_1:19; 1 <= l by A81, FINSEQ_1:1; then l in Seg (len (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)))) by A83, FINSEQ_1:1; hence y in dom (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by FINSEQ_1:def_3; ::_thesis: verum end; then (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k in rng (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) by A74, FUNCT_1:def_3; then (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k in Seg (len (p ^ <*x*>)) by A71; then reconsider l = (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k as Element of NAT ; dom (p ^ <*x*>) = Seg (len (p ^ <*x*>)) by FINSEQ_1:def_3; then A84: ((p ^ <*x*>) - A) . k = (p ^ <*x*>) . l by A74, A77, FUNCT_1:13; (len p) + 1 in Seg ((len p) + 1) by FINSEQ_1:4; then A85: {((len p) + 1)} c= Seg ((len p) + 1) by ZFMISC_1:31; A86: now__::_thesis:_(Sgm_((Seg_(len_(p_^_<*x*>)))_\_((p_^_<*x*>)_"_A)))_._k_=_(Sgm_((Seg_(len_p))_\_(p_"_A)))_._k percases ( (Seg (len p)) \ (p " A) = (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) or (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) = ((Seg (len p)) \ (p " A)) \/ {((len p) + 1)} ) by A37, A49, A58, A68; suppose (Seg (len p)) \ (p " A) = (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) ; ::_thesis: (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k = (Sgm ((Seg (len p)) \ (p " A))) . k hence (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k = (Sgm ((Seg (len p)) \ (p " A))) . k ; ::_thesis: verum end; supposeA87: (Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A) = ((Seg (len p)) \ (p " A)) \/ {((len p) + 1)} ; ::_thesis: (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k = (Sgm ((Seg (len p)) \ (p " A))) . k now__::_thesis:_for_m,_n_being_Element_of_NAT_st_m_in_(Seg_(len_p))_\_(p_"_A)_&_n_in_{((len_p)_+_1)}_holds_ m_<_n let m, n be Element of NAT ; ::_thesis: ( m in (Seg (len p)) \ (p " A) & n in {((len p) + 1)} implies m < n ) assume that A88: m in (Seg (len p)) \ (p " A) and A89: n in {((len p) + 1)} ; ::_thesis: m < n m in Seg (len p) by A88, XBOOLE_0:def_5; then A90: m <= len p by FINSEQ_1:1; A91: len p < (len p) + 1 by XREAL_1:29; n = (len p) + 1 by A89, TARSKI:def_1; hence m < n by A90, A91, XXREAL_0:2; ::_thesis: verum end; then Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A)) = (Sgm ((Seg (len p)) \ (p " A))) ^ (Sgm {((len p) + 1)}) by A72, A85, A87, Th42; hence (Sgm ((Seg (len (p ^ <*x*>))) \ ((p ^ <*x*>) " A))) . k = (Sgm ((Seg (len p)) \ (p " A))) . k by A74, FINSEQ_1:def_7; ::_thesis: verum end; end; end; (p - A) . k = p . ((Sgm ((Seg (len p)) \ (p " A))) . k) by A57, A74, FUNCT_1:13; hence ((p ^ <*x*>) - A) . k = (p - A) . k by A75, A86, A84, FINSEQ_1:def_7; ::_thesis: verum end; len ((p ^ <*x*>) - A) = (len (p ^ <*x*>)) - (card ((p ^ <*x*>) " A)) by Th59 .= ((len p) + (len <*x*>)) - (card ((p ^ <*x*>) " A)) by FINSEQ_1:22 .= ((len p) + (len <*x*>)) - ((card (p " A)) + (card (<*x*> " A))) by Th57 .= (((len p) - (card (p " A))) + (len <*x*>)) + (- (card (<*x*> " A))) .= ((len (p - A)) + (len <*x*>)) + (- (card (<*x*> " A))) by Th59 .= (len (p - A)) + ((len <*x*>) - (card (<*x*> " A))) .= (len (p - A)) + (len (<*x*> - A)) by Th59 ; hence (p ^ <*x*>) - A = (p - A) ^ (<*x*> - A) by A36, A2, Th38; ::_thesis: verum end; Lm10: now__::_thesis:_for_q_being_FinSequence for_x_being_set_st_(_for_p_being_FinSequence for_A_being_set_holds_(p_^_q)_-_A_=_(p_-_A)_^_(q_-_A)_)_holds_ for_p_being_FinSequence for_A_being_set_holds_(p_^_(q_^_<*x*>))_-_A_=_(p_-_A)_^_((q_^_<*x*>)_-_A) let q be FinSequence; ::_thesis: for x being set st ( for p being FinSequence for A being set holds (p ^ q) - A = (p - A) ^ (q - A) ) holds for p being FinSequence for A being set holds (p ^ (q ^ <*x*>)) - A = (p - A) ^ ((q ^ <*x*>) - A) let x be set ; ::_thesis: ( ( for p being FinSequence for A being set holds (p ^ q) - A = (p - A) ^ (q - A) ) implies for p being FinSequence for A being set holds (p ^ (q ^ <*x*>)) - A = (p - A) ^ ((q ^ <*x*>) - A) ) assume A1: for p being FinSequence for A being set holds (p ^ q) - A = (p - A) ^ (q - A) ; ::_thesis: for p being FinSequence for A being set holds (p ^ (q ^ <*x*>)) - A = (p - A) ^ ((q ^ <*x*>) - A) let p be FinSequence; ::_thesis: for A being set holds (p ^ (q ^ <*x*>)) - A = (p - A) ^ ((q ^ <*x*>) - A) let A be set ; ::_thesis: (p ^ (q ^ <*x*>)) - A = (p - A) ^ ((q ^ <*x*>) - A) thus (p ^ (q ^ <*x*>)) - A = ((p ^ q) ^ <*x*>) - A by FINSEQ_1:32 .= ((p ^ q) - A) ^ (<*x*> - A) by Lm9 .= ((p - A) ^ (q - A)) ^ (<*x*> - A) by A1 .= (p - A) ^ ((q - A) ^ (<*x*> - A)) by FINSEQ_1:32 .= (p - A) ^ ((q ^ <*x*>) - A) by Lm9 ; ::_thesis: verum end; Lm11: for q, p being FinSequence for A being set holds (p ^ q) - A = (p - A) ^ (q - A) proof defpred S1[ FinSequence] means for p being FinSequence for A being set holds (p ^ $1) - A = (p - A) ^ ($1 - A); A1: for q being FinSequence for x being set st S1[q] holds S1[q ^ <*x*>] by Lm10; A2: S1[ {} ] by Lm8; for q being FinSequence holds S1[q] from FINSEQ_1:sch_3(A2, A1); hence for q, p being FinSequence for A being set holds (p ^ q) - A = (p - A) ^ (q - A) ; ::_thesis: verum end; theorem :: FINSEQ_3:73 for p, q being FinSequence for A being set holds (p ^ q) - A = (p - A) ^ (q - A) by Lm11; theorem :: FINSEQ_3:74 for A being set holds {} - A = {} ; theorem :: FINSEQ_3:75 for x, A being set holds ( <*x*> - A = <*x*> iff not x in A ) by Lm6; theorem :: FINSEQ_3:76 for x, A being set holds ( <*x*> - A = {} iff x in A ) by Lm7; theorem Th77: :: FINSEQ_3:77 for x, y, A being set holds ( <*x,y*> - A = {} iff ( x in A & y in A ) ) proof let x, y, A be set ; ::_thesis: ( <*x,y*> - A = {} iff ( x in A & y in A ) ) A1: <*x,y*> = <*x*> ^ <*y*> by FINSEQ_1:def_9; thus ( <*x,y*> - A = {} implies ( x in A & y in A ) ) ::_thesis: ( x in A & y in A implies <*x,y*> - A = {} ) proof assume <*x,y*> - A = {} ; ::_thesis: ( x in A & y in A ) then rng <*x,y*> c= A by Th68; then {x,y} c= A by FINSEQ_2:127; hence ( x in A & y in A ) by ZFMISC_1:32; ::_thesis: verum end; assume that A2: x in A and A3: y in A ; ::_thesis: <*x,y*> - A = {} A4: <*y*> - A = {} by A3, Lm7; (card {}) + (card {}) = card ({} ^ {}) by FINSEQ_1:22; then A5: card ({} ^ {}) = 0 ; <*x*> - A = {} by A2, Lm7; hence <*x,y*> - A = {} ^ {} by A4, A1, Lm11 .= {} by A5 ; ::_thesis: verum end; theorem Th78: :: FINSEQ_3:78 for x, A, y being set st x in A & not y in A holds <*x,y*> - A = <*y*> proof let x, A, y be set ; ::_thesis: ( x in A & not y in A implies <*x,y*> - A = <*y*> ) assume that A1: x in A and A2: not y in A ; ::_thesis: <*x,y*> - A = <*y*> A3: <*y*> - A = <*y*> by A2, Lm6; A4: <*x,y*> = <*x*> ^ <*y*> by FINSEQ_1:def_9; <*x*> - A = {} by A1, Lm7; hence <*x,y*> - A = {} ^ <*y*> by A3, A4, Lm11 .= <*y*> by FINSEQ_1:34 ; ::_thesis: verum end; theorem :: FINSEQ_3:79 for x, y, A being set st <*x,y*> - A = <*y*> & x <> y holds ( x in A & not y in A ) proof let x, y, A be set ; ::_thesis: ( <*x,y*> - A = <*y*> & x <> y implies ( x in A & not y in A ) ) assume that A1: <*x,y*> - A = <*y*> and A2: x <> y ; ::_thesis: ( x in A & not y in A ) assume A3: ( not x in A or y in A ) ; ::_thesis: contradiction A4: ( y in A implies <*y*> - A = {} ) by Lm7; A5: ( not x in A implies <*x*> - A = <*x*> ) by Lm6; A6: ( not y in A implies <*y*> - A = <*y*> ) by Lm6; A7: ( x in A implies <*x*> - A = {} ) by Lm7; A8: <*x*> . 1 = x by FINSEQ_1:40; <*y*> = (<*x*> ^ <*y*>) - A by A1, FINSEQ_1:def_9 .= (<*x*> - A) ^ (<*y*> - A) by Lm11 ; then ( <*y*> = {} or <*x*> = <*y*> or <*y*> = <*x,y*> ) by A7, A5, A4, A6, A3, FINSEQ_1:34, FINSEQ_1:def_9; hence contradiction by A2, A8, Th35, FINSEQ_1:40; ::_thesis: verum end; theorem Th80: :: FINSEQ_3:80 for x, A, y being set st not x in A & y in A holds <*x,y*> - A = <*x*> proof let x, A, y be set ; ::_thesis: ( not x in A & y in A implies <*x,y*> - A = <*x*> ) assume that A1: not x in A and A2: y in A ; ::_thesis: <*x,y*> - A = <*x*> A3: <*y*> - A = {} by A2, Lm7; A4: <*x,y*> = <*x*> ^ <*y*> by FINSEQ_1:def_9; <*x*> - A = <*x*> by A1, Lm6; hence <*x,y*> - A = <*x*> ^ {} by A3, A4, Lm11 .= <*x*> by FINSEQ_1:34 ; ::_thesis: verum end; theorem :: FINSEQ_3:81 for x, y, A being set st <*x,y*> - A = <*x*> & x <> y holds ( not x in A & y in A ) proof let x, y, A be set ; ::_thesis: ( <*x,y*> - A = <*x*> & x <> y implies ( not x in A & y in A ) ) assume that A1: <*x,y*> - A = <*x*> and A2: x <> y ; ::_thesis: ( not x in A & y in A ) assume A3: ( x in A or not y in A ) ; ::_thesis: contradiction A4: ( y in A implies <*y*> - A = {} ) by Lm7; A5: ( not x in A implies <*x*> - A = <*x*> ) by Lm6; A6: ( not y in A implies <*y*> - A = <*y*> ) by Lm6; A7: ( x in A implies <*x*> - A = {} ) by Lm7; A8: <*x*> . 1 = x by FINSEQ_1:40; <*x*> = (<*x*> ^ <*y*>) - A by A1, FINSEQ_1:def_9 .= (<*x*> - A) ^ (<*y*> - A) by Lm11 ; then ( <*x*> = {} or <*x*> = <*y*> or <*x*> = <*x,y*> ) by A7, A5, A4, A6, A3, FINSEQ_1:34, FINSEQ_1:def_9; hence contradiction by A2, A8, Th35, FINSEQ_1:40; ::_thesis: verum end; theorem :: FINSEQ_3:82 for x, y, A being set holds ( <*x,y*> - A = <*x,y*> iff ( not x in A & not y in A ) ) proof let x, y, A be set ; ::_thesis: ( <*x,y*> - A = <*x,y*> iff ( not x in A & not y in A ) ) A1: <*x,y*> = <*x*> ^ <*y*> by FINSEQ_1:def_9; thus ( <*x,y*> - A = <*x,y*> implies ( not x in A & not y in A ) ) ::_thesis: ( not x in A & not y in A implies <*x,y*> - A = <*x,y*> ) proof assume A2: <*x,y*> - A = <*x,y*> ; ::_thesis: ( not x in A & not y in A ) assume ( x in A or y in A ) ; ::_thesis: contradiction then ( ( x in A & y in A ) or ( not x in A & y in A ) or ( x in A & not y in A ) ) ; then ( <*x,y*> - A = {} or <*x,y*> - A = <*x*> or <*x,y*> - A = <*y*> ) by Th77, Th78, Th80; hence contradiction by A2, Th35; ::_thesis: verum end; assume that A3: not x in A and A4: not y in A ; ::_thesis: <*x,y*> - A = <*x,y*> A5: <*y*> - A = <*y*> by A4, Lm6; <*x*> - A = <*x*> by A3, Lm6; hence <*x,y*> - A = <*x,y*> by A5, A1, Lm11; ::_thesis: verum end; theorem Th83: :: FINSEQ_3:83 for p, q being FinSequence for A being set for k being Nat st len p = k + 1 & q = p | (Seg k) holds ( p . (k + 1) in A iff p - A = q - A ) proof let p, q be FinSequence; ::_thesis: for A being set for k being Nat st len p = k + 1 & q = p | (Seg k) holds ( p . (k + 1) in A iff p - A = q - A ) let A be set ; ::_thesis: for k being Nat st len p = k + 1 & q = p | (Seg k) holds ( p . (k + 1) in A iff p - A = q - A ) let k be Nat; ::_thesis: ( len p = k + 1 & q = p | (Seg k) implies ( p . (k + 1) in A iff p - A = q - A ) ) assume that A1: len p = k + 1 and A2: q = p | (Seg k) ; ::_thesis: ( p . (k + 1) in A iff p - A = q - A ) thus ( p . (k + 1) in A implies p - A = q - A ) ::_thesis: ( p - A = q - A implies p . (k + 1) in A ) proof assume A3: p . (k + 1) in A ; ::_thesis: p - A = q - A thus p - A = (q ^ <*(p . (k + 1))*>) - A by A1, A2, Th55 .= (q - A) ^ (<*(p . (k + 1))*> - A) by Lm11 .= (q - A) ^ {} by A3, Lm7 .= q - A by FINSEQ_1:34 ; ::_thesis: verum end; assume that A4: p - A = q - A and A5: not p . (k + 1) in A ; ::_thesis: contradiction q - A = (q ^ <*(p . (k + 1))*>) - A by A1, A2, A4, Th55 .= (q - A) ^ (<*(p . (k + 1))*> - A) by Lm11 .= (q - A) ^ <*(p . (k + 1))*> by A5, Lm6 ; hence contradiction by FINSEQ_1:87; ::_thesis: verum end; theorem Th84: :: FINSEQ_3:84 for p, q being FinSequence for A being set for k being Nat st len p = k + 1 & q = p | (Seg k) holds ( not p . (k + 1) in A iff p - A = (q - A) ^ <*(p . (k + 1))*> ) proof let p, q be FinSequence; ::_thesis: for A being set for k being Nat st len p = k + 1 & q = p | (Seg k) holds ( not p . (k + 1) in A iff p - A = (q - A) ^ <*(p . (k + 1))*> ) let A be set ; ::_thesis: for k being Nat st len p = k + 1 & q = p | (Seg k) holds ( not p . (k + 1) in A iff p - A = (q - A) ^ <*(p . (k + 1))*> ) let k be Nat; ::_thesis: ( len p = k + 1 & q = p | (Seg k) implies ( not p . (k + 1) in A iff p - A = (q - A) ^ <*(p . (k + 1))*> ) ) assume that A1: len p = k + 1 and A2: q = p | (Seg k) ; ::_thesis: ( not p . (k + 1) in A iff p - A = (q - A) ^ <*(p . (k + 1))*> ) thus ( not p . (k + 1) in A implies p - A = (q - A) ^ <*(p . (k + 1))*> ) ::_thesis: ( p - A = (q - A) ^ <*(p . (k + 1))*> implies not p . (k + 1) in A ) proof assume A3: not p . (k + 1) in A ; ::_thesis: p - A = (q - A) ^ <*(p . (k + 1))*> thus p - A = (q ^ <*(p . (k + 1))*>) - A by A1, A2, Th55 .= (q - A) ^ (<*(p . (k + 1))*> - A) by Lm11 .= (q - A) ^ <*(p . (k + 1))*> by A3, Lm6 ; ::_thesis: verum end; assume A4: p - A = (q - A) ^ <*(p . (k + 1))*> ; ::_thesis: not p . (k + 1) in A assume p . (k + 1) in A ; ::_thesis: contradiction then q - A = (q - A) ^ <*(p . (k + 1))*> by A1, A2, A4, Th83; hence contradiction by FINSEQ_1:87; ::_thesis: verum end; Lm12: for l being Nat st ( for p being FinSequence for A being set st len p = l holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ) holds for p being FinSequence for A being set st len p = l + 1 holds for n being Nat st n in dom p holds for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) proof let l be Nat; ::_thesis: ( ( for p being FinSequence for A being set st len p = l holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ) implies for p being FinSequence for A being set st len p = l + 1 holds for n being Nat st n in dom p holds for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) ) assume A1: for p being FinSequence for A being set st len p = l holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ; ::_thesis: for p being FinSequence for A being set st len p = l + 1 holds for n being Nat st n in dom p holds for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) let p be FinSequence; ::_thesis: for A being set st len p = l + 1 holds for n being Nat st n in dom p holds for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) let A be set ; ::_thesis: ( len p = l + 1 implies for n being Nat st n in dom p holds for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) ) reconsider q = p | (Seg l) as FinSequence by FINSEQ_1:15; assume A2: len p = l + 1 ; ::_thesis: for n being Nat st n in dom p holds for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) then A3: len q = l by Th53; let n be Nat; ::_thesis: ( n in dom p implies for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) ) set B = { k where k is Element of NAT : ( k in dom q & k <= n & q . k in A ) } ; { k where k is Element of NAT : ( k in dom q & k <= n & q . k in A ) } c= dom q proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { k where k is Element of NAT : ( k in dom q & k <= n & q . k in A ) } or x in dom q ) assume x in { k where k is Element of NAT : ( k in dom q & k <= n & q . k in A ) } ; ::_thesis: x in dom q then ex k being Element of NAT st ( x = k & k in dom q & k <= n & q . k in A ) ; hence x in dom q ; ::_thesis: verum end; then reconsider B = { k where k is Element of NAT : ( k in dom q & k <= n & q . k in A ) } as finite set ; assume A4: n in dom p ; ::_thesis: for C being finite set holds ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) let C be finite set ; ::_thesis: ( not C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } or p . n in A or (p - A) . (n - (card C)) = p . n ) assume A5: C = { m where m is Element of NAT : ( m in dom p & m <= n & p . m in A ) } ; ::_thesis: ( p . n in A or (p - A) . (n - (card C)) = p . n ) assume A6: not p . n in A ; ::_thesis: (p - A) . (n - (card C)) = p . n now__::_thesis:_(p_-_A)_._(n_-_(card_C))_=_p_._n percases ( p . (l + 1) in A or not p . (l + 1) in A ) ; supposeA7: p . (l + 1) in A ; ::_thesis: (p - A) . (n - (card C)) = p . n A8: n in Seg (l + 1) by A2, A4, FINSEQ_1:def_3; not n in {(l + 1)} by A6, A7, TARSKI:def_1; then n in (Seg (l + 1)) \ {(l + 1)} by A8, XBOOLE_0:def_5; then A9: n in Seg l by FINSEQ_1:10; A10: B = C proof thus B c= C :: according to XBOOLE_0:def_10 ::_thesis: C c= B proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in B or x in C ) A11: dom q c= dom p by RELAT_1:60; assume x in B ; ::_thesis: x in C then consider k being Element of NAT such that A12: x = k and A13: k in dom q and A14: k <= n and A15: q . k in A ; p . k in A by A13, A15, FUNCT_1:47; hence x in C by A5, A12, A13, A14, A11; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in C or x in B ) assume x in C ; ::_thesis: x in B then consider m being Element of NAT such that A16: x = m and A17: m in dom p and A18: m <= n and A19: p . m in A by A5; m in Seg (len p) by A17, FINSEQ_1:def_3; then A20: 1 <= m by FINSEQ_1:1; n <= l by A9, FINSEQ_1:1; then m <= l by A18, XXREAL_0:2; then m in Seg l by A20, FINSEQ_1:1; then A21: m in dom q by A3, FINSEQ_1:def_3; then q . m in A by A19, FUNCT_1:47; hence x in B by A16, A18, A21; ::_thesis: verum end; A22: q - A = p - A by A2, A7, Th83; A23: n in dom q by A3, A9, FINSEQ_1:def_3; then p . n = q . n by FUNCT_1:47; hence (p - A) . (n - (card C)) = p . n by A1, A6, A3, A23, A22, A10; ::_thesis: verum end; suppose not p . (l + 1) in A ; ::_thesis: (p - A) . (n - (card C)) = p . n then A24: p - A = (q - A) ^ <*(p . (l + 1))*> by A2, Th84; now__::_thesis:_(p_-_A)_._(n_-_(card_C))_=_p_._n percases ( n = l + 1 or n <> l + 1 ) ; supposeA25: n = l + 1 ; ::_thesis: (p - A) . (n - (card C)) = p . n p " A = C proof thus p " A c= C :: according to XBOOLE_0:def_10 ::_thesis: C c= p " A proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in p " A or x in C ) assume A26: x in p " A ; ::_thesis: x in C then A27: x in dom p by FUNCT_1:def_7; then reconsider z = x as Element of NAT ; A28: p . x in A by A26, FUNCT_1:def_7; z in Seg n by A2, A25, A27, FINSEQ_1:def_3; then z <= n by FINSEQ_1:1; hence x in C by A5, A27, A28; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in C or x in p " A ) assume x in C ; ::_thesis: x in p " A then ex m being Element of NAT st ( x = m & m in dom p & m <= n & p . m in A ) by A5; hence x in p " A by FUNCT_1:def_7; ::_thesis: verum end; then A29: len (p - A) = n - (card C) by A2, A25, Th59; len <*(p . (l + 1))*> = 1 by FINSEQ_1:39; then (p - A) . (n - (card C)) = (p - A) . ((len (q - A)) + 1) by A24, A29, FINSEQ_1:22 .= p . (l + 1) by A24, FINSEQ_1:42 ; hence (p - A) . (n - (card C)) = p . n by A25; ::_thesis: verum end; suppose n <> l + 1 ; ::_thesis: (p - A) . (n - (card C)) = p . n then A30: not n in {(l + 1)} by TARSKI:def_1; n in Seg (l + 1) by A2, A4, FINSEQ_1:def_3; then n in (Seg (l + 1)) \ {(l + 1)} by A30, XBOOLE_0:def_5; then A31: n in Seg l by FINSEQ_1:10; then 1 <= n by FINSEQ_1:1; then n in Seg n by FINSEQ_1:1; then A32: {n} c= Seg n by ZFMISC_1:31; A33: (Seg n) \ B c= (Seg l) \ (q " A) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (Seg n) \ B or x in (Seg l) \ (q " A) ) assume A34: x in (Seg n) \ B ; ::_thesis: x in (Seg l) \ (q " A) then reconsider z = x as Element of NAT ; A35: x in Seg n by A34, XBOOLE_0:def_5; then A36: 1 <= z by FINSEQ_1:1; A37: z <= n by A35, FINSEQ_1:1; A38: now__::_thesis:_not_z_in_q_"_A assume A39: z in q " A ; ::_thesis: contradiction then A40: z in dom q by FUNCT_1:def_7; q . z in A by A39, FUNCT_1:def_7; then z in B by A37, A40; hence contradiction by A34, XBOOLE_0:def_5; ::_thesis: verum end; n <= l by A31, FINSEQ_1:1; then z <= l by A37, XXREAL_0:2; then z in Seg l by A36, FINSEQ_1:1; hence x in (Seg l) \ (q " A) by A38, XBOOLE_0:def_5; ::_thesis: verum end; A41: B = C proof thus B c= C :: according to XBOOLE_0:def_10 ::_thesis: C c= B proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in B or x in C ) A42: dom q c= dom p by RELAT_1:60; assume x in B ; ::_thesis: x in C then consider k being Element of NAT such that A43: x = k and A44: k in dom q and A45: k <= n and A46: q . k in A ; p . k in A by A44, A46, FUNCT_1:47; hence x in C by A5, A43, A44, A45, A42; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in C or x in B ) assume x in C ; ::_thesis: x in B then consider m being Element of NAT such that A47: x = m and A48: m in dom p and A49: m <= n and A50: p . m in A by A5; m in Seg (len p) by A48, FINSEQ_1:def_3; then A51: 1 <= m by FINSEQ_1:1; n <= l by A31, FINSEQ_1:1; then m <= l by A49, XXREAL_0:2; then m in Seg l by A51, FINSEQ_1:1; then A52: m in dom q by A3, FINSEQ_1:def_3; then q . m in A by A50, FUNCT_1:47; hence x in B by A47, A49, A52; ::_thesis: verum end; q " A c= dom q by RELAT_1:132; then A53: q " A c= Seg l by A3, FINSEQ_1:def_3; (q " A) \/ ((Seg l) \ (q " A)) = (q " A) \/ (Seg l) by XBOOLE_1:39 .= Seg l by A53, XBOOLE_1:12 ; then card (Seg l) = (card (q " A)) + (card ((Seg l) \ (q " A))) by CARD_2:40, XBOOLE_1:79; then A54: len q = (card (q " A)) + (card ((Seg (len q)) \ (q " A))) by A3, FINSEQ_1:57; set b = card B; set a = n - (card B); A55: card (Seg n) = n by FINSEQ_1:57; A56: n in dom q by A3, A31, FINSEQ_1:def_3; then A57: not q . n in A by A6, FUNCT_1:47; A58: B c= (Seg n) \ {n} proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in B or x in (Seg n) \ {n} ) assume x in B ; ::_thesis: x in (Seg n) \ {n} then consider k being Element of NAT such that A59: x = k and A60: k in dom q and A61: k <= n and A62: q . k in A ; k in Seg (len q) by A60, FINSEQ_1:def_3; then 1 <= k by FINSEQ_1:1; then A63: k in Seg n by A61, FINSEQ_1:1; not k in {n} by A57, A62, TARSKI:def_1; hence x in (Seg n) \ {n} by A59, A63, XBOOLE_0:def_5; ::_thesis: verum end; then card B <= card ((Seg n) \ {n}) by NAT_1:43; then card B <= (card (Seg n)) - (card {n}) by A32, CARD_2:44; then card B <= (card (Seg n)) - 1 by CARD_1:30; then card B <= n - 1 by FINSEQ_1:57; then (card B) + 1 <= n by XREAL_1:19; then A64: 0 + (card B) < (n - (card B)) + (card B) by NAT_1:13; then 0 <= n - (card B) by XREAL_1:6; then reconsider a = n - (card B) as Element of NAT by INT_1:3; (Seg n) \ {n} c= Seg n by XBOOLE_1:36; then a = card ((Seg n) \ B) by A58, A55, CARD_2:44, XBOOLE_1:1; then a <= (len q) - (card (q " A)) by A3, A54, A33, NAT_1:43; then A65: a <= len (q - A) by Th59; 1 <= a by A64, NAT_1:14; then a in Seg (len (q - A)) by A65, FINSEQ_1:1; then A66: a in dom (q - A) by FINSEQ_1:def_3; p . n = q . n by A56, FUNCT_1:47; then (q - A) . (n - (card B)) = p . n by A1, A6, A3, A56; hence (p - A) . (n - (card C)) = p . n by A24, A41, A66, FINSEQ_1:def_7; ::_thesis: verum end; end; end; hence (p - A) . (n - (card C)) = p . n ; ::_thesis: verum end; end; end; hence (p - A) . (n - (card C)) = p . n ; ::_thesis: verum end; Lm13: for l being Nat for p being FinSequence for A being set st len p = l holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) proof defpred S1[ Element of NAT ] means for p being FinSequence for A being set st len p = $1 holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ); A1: S1[ 0 ] proof let p be FinSequence; ::_thesis: for A being set st len p = 0 holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) let A be set ; ::_thesis: ( len p = 0 implies for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ) assume len p = 0 ; ::_thesis: for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) then p = {} ; hence for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ; ::_thesis: verum end; A2: for k being Element of NAT st S1[k] holds S1[k + 1] by Lm12; for n being Element of NAT holds S1[n] from NAT_1:sch_1(A1, A2); hence for l being Nat for p being FinSequence for A being set st len p = l holds for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ; ::_thesis: verum end; theorem :: FINSEQ_3:85 for p being FinSequence for A being set for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) proof let p be FinSequence; ::_thesis: for A being set for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) let A be set ; ::_thesis: for n being Nat st n in dom p holds for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) let n be Nat; ::_thesis: ( n in dom p implies for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ) len p = len p ; hence ( n in dom p implies for B being finite set holds ( not B = { k where k is Element of NAT : ( k in dom p & k <= n & p . k in A ) } or p . n in A or (p - A) . (n - (card B)) = p . n ) ) by Lm13; ::_thesis: verum end; theorem :: FINSEQ_3:86 for p being FinSequence for D, A being set st p is FinSequence of D holds p - A is FinSequence of D proof let p be FinSequence; ::_thesis: for D, A being set st p is FinSequence of D holds p - A is FinSequence of D let D, A be set ; ::_thesis: ( p is FinSequence of D implies p - A is FinSequence of D ) assume p is FinSequence of D ; ::_thesis: p - A is FinSequence of D then A1: rng p c= D by FINSEQ_1:def_4; rng (p - A) = (rng p) \ A by Th65; then rng (p - A) c= D by A1, XBOOLE_1:1; hence p - A is FinSequence of D by FINSEQ_1:def_4; ::_thesis: verum end; theorem :: FINSEQ_3:87 for p being FinSequence for A being set st p is one-to-one holds p - A is one-to-one proof let p be FinSequence; ::_thesis: for A being set st p is one-to-one holds p - A is one-to-one let A be set ; ::_thesis: ( p is one-to-one implies p - A is one-to-one ) assume A1: p is one-to-one ; ::_thesis: p - A is one-to-one A2: p - A = p * (Sgm ((Seg (len p)) \ (p " A))) by FINSEQ_1:def_3; Sgm ((Seg (len p)) \ (p " A)) is one-to-one by Lm1, XBOOLE_1:36; hence p - A is one-to-one by A1, A2; ::_thesis: verum end; theorem Th88: :: FINSEQ_3:88 for p being FinSequence for A being set st p is one-to-one holds len (p - A) = (len p) - (card (A /\ (rng p))) proof let p be FinSequence; ::_thesis: for A being set st p is one-to-one holds len (p - A) = (len p) - (card (A /\ (rng p))) let A be set ; ::_thesis: ( p is one-to-one implies len (p - A) = (len p) - (card (A /\ (rng p))) ) A1: p " A c= dom p by RELAT_1:132; assume A2: p is one-to-one ; ::_thesis: len (p - A) = (len p) - (card (A /\ (rng p))) p " A,A /\ (rng p) are_equipotent proof deffunc H1( set ) -> set = p . $1; consider f being Function such that A3: dom f = p " A and A4: for x being set st x in p " A holds f . x = H1(x) from FUNCT_1:sch_3(); take f ; :: according to WELLORD2:def_4 ::_thesis: ( f is one-to-one & dom f = p " A & rng f = A /\ (rng p) ) thus f is one-to-one ::_thesis: ( dom f = p " A & rng f = A /\ (rng p) ) proof let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not x in dom f or not b1 in dom f or not f . x = f . b1 or x = b1 ) let y be set ; ::_thesis: ( not x in dom f or not y in dom f or not f . x = f . y or x = y ) assume that A5: x in dom f and A6: y in dom f and A7: f . x = f . y ; ::_thesis: x = y A8: f . y = p . y by A3, A4, A6; p . x = f . x by A3, A4, A5; hence x = y by A2, A1, A3, A5, A6, A7, A8, FUNCT_1:def_4; ::_thesis: verum end; thus dom f = p " A by A3; ::_thesis: rng f = A /\ (rng p) thus rng f c= A /\ (rng p) :: according to XBOOLE_0:def_10 ::_thesis: A /\ (rng p) c= rng f proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng f or x in A /\ (rng p) ) assume x in rng f ; ::_thesis: x in A /\ (rng p) then consider y being set such that A9: y in dom f and A10: f . y = x by FUNCT_1:def_3; A11: p . y in A by A3, A9, FUNCT_1:def_7; y in dom p by A3, A9, FUNCT_1:def_7; then A12: p . y in rng p by FUNCT_1:def_3; p . y = f . y by A3, A4, A9; hence x in A /\ (rng p) by A10, A11, A12, XBOOLE_0:def_4; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in A /\ (rng p) or x in rng f ) assume A13: x in A /\ (rng p) ; ::_thesis: x in rng f then x in rng p by XBOOLE_0:def_4; then consider y being set such that A14: y in dom p and A15: p . y = x by FUNCT_1:def_3; p . y in A by A13, A15, XBOOLE_0:def_4; then A16: y in p " A by A14, FUNCT_1:def_7; then f . y = x by A4, A15; hence x in rng f by A3, A16, FUNCT_1:def_3; ::_thesis: verum end; then card (p " A) = card (A /\ (rng p)) by CARD_1:5; hence len (p - A) = (len p) - (card (A /\ (rng p))) by Th59; ::_thesis: verum end; theorem Th89: :: FINSEQ_3:89 for p being FinSequence for A being finite set st p is one-to-one & A c= rng p holds len (p - A) = (len p) - (card A) proof let p be FinSequence; ::_thesis: for A being finite set st p is one-to-one & A c= rng p holds len (p - A) = (len p) - (card A) let A be finite set ; ::_thesis: ( p is one-to-one & A c= rng p implies len (p - A) = (len p) - (card A) ) assume that A1: p is one-to-one and A2: A c= rng p ; ::_thesis: len (p - A) = (len p) - (card A) A /\ (rng p) = A by A2, XBOOLE_1:28; hence len (p - A) = (len p) - (card A) by A1, Th88; ::_thesis: verum end; theorem :: FINSEQ_3:90 for p being FinSequence for x being set st p is one-to-one & x in rng p holds len (p - {x}) = (len p) - 1 proof let p be FinSequence; ::_thesis: for x being set st p is one-to-one & x in rng p holds len (p - {x}) = (len p) - 1 let x be set ; ::_thesis: ( p is one-to-one & x in rng p implies len (p - {x}) = (len p) - 1 ) assume that A1: p is one-to-one and A2: x in rng p ; ::_thesis: len (p - {x}) = (len p) - 1 {x} c= rng p by A2, ZFMISC_1:31; then len (p - {x}) = (len p) - (card {x}) by A1, Th89; hence len (p - {x}) = (len p) - 1 by CARD_1:30; ::_thesis: verum end; theorem Th91: :: FINSEQ_3:91 for p, q being FinSequence holds ( ( rng p misses rng q & p is one-to-one & q is one-to-one ) iff p ^ q is one-to-one ) proof let p, q be FinSequence; ::_thesis: ( ( rng p misses rng q & p is one-to-one & q is one-to-one ) iff p ^ q is one-to-one ) thus ( rng p misses rng q & p is one-to-one & q is one-to-one implies p ^ q is one-to-one ) ::_thesis: ( p ^ q is one-to-one implies ( rng p misses rng q & p is one-to-one & q is one-to-one ) ) proof assume that A1: rng p misses rng q and A2: p is one-to-one and A3: q is one-to-one ; ::_thesis: p ^ q is one-to-one let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not x in dom (p ^ q) or not b1 in dom (p ^ q) or not (p ^ q) . x = (p ^ q) . b1 or x = b1 ) let y be set ; ::_thesis: ( not x in dom (p ^ q) or not y in dom (p ^ q) or not (p ^ q) . x = (p ^ q) . y or x = y ) assume that A4: x in dom (p ^ q) and A5: y in dom (p ^ q) and A6: (p ^ q) . x = (p ^ q) . y ; ::_thesis: x = y reconsider k1 = x, k2 = y as Element of NAT by A4, A5; now__::_thesis:_x_=_y percases ( ( k1 in dom p & k2 in dom p ) or ( k1 in dom p & ex n being Nat st ( n in dom q & k2 = (len p) + n ) ) or ( k2 in dom p & ex n being Nat st ( n in dom q & k1 = (len p) + n ) ) or ( ex n being Nat st ( n in dom q & k1 = (len p) + n ) & ex n being Nat st ( n in dom q & k2 = (len p) + n ) ) ) by A4, A5, FINSEQ_1:25; supposeA7: ( k1 in dom p & k2 in dom p ) ; ::_thesis: x = y then A8: (p ^ q) . k2 = p . k2 by FINSEQ_1:def_7; (p ^ q) . k1 = p . k1 by A7, FINSEQ_1:def_7; hence x = y by A2, A6, A7, A8, FUNCT_1:def_4; ::_thesis: verum end; supposeA9: ( k1 in dom p & ex n being Nat st ( n in dom q & k2 = (len p) + n ) ) ; ::_thesis: x = y then consider n being Nat such that A10: n in dom q and A11: k2 = (len p) + n ; A12: q . n in rng q by A10, FUNCT_1:def_3; A13: (p ^ q) . k1 = p . k1 by A9, FINSEQ_1:def_7; (p ^ q) . k2 = q . n by A9, A11, FINSEQ_1:def_7; then q . n in rng p by A6, A9, A13, FUNCT_1:def_3; hence x = y by A1, A12, XBOOLE_0:3; ::_thesis: verum end; supposeA14: ( k2 in dom p & ex n being Nat st ( n in dom q & k1 = (len p) + n ) ) ; ::_thesis: x = y then consider n being Nat such that A15: n in dom q and A16: k1 = (len p) + n ; A17: q . n in rng q by A15, FUNCT_1:def_3; A18: (p ^ q) . k2 = p . k2 by A14, FINSEQ_1:def_7; (p ^ q) . k1 = q . n by A14, A16, FINSEQ_1:def_7; then q . n in rng p by A6, A14, A18, FUNCT_1:def_3; hence x = y by A1, A17, XBOOLE_0:3; ::_thesis: verum end; supposeA19: ( ex n being Nat st ( n in dom q & k1 = (len p) + n ) & ex n being Nat st ( n in dom q & k2 = (len p) + n ) ) ; ::_thesis: x = y then consider n2 being Nat such that A20: n2 in dom q and A21: k2 = (len p) + n2 ; A22: (p ^ q) . k2 = q . n2 by A20, A21, FINSEQ_1:def_7; consider n1 being Nat such that A23: n1 in dom q and A24: k1 = (len p) + n1 by A19; (p ^ q) . k1 = q . n1 by A23, A24, FINSEQ_1:def_7; hence x = y by A3, A6, A23, A24, A20, A21, A22, FUNCT_1:def_4; ::_thesis: verum end; end; end; hence x = y ; ::_thesis: verum end; assume A25: p ^ q is one-to-one ; ::_thesis: ( rng p misses rng q & p is one-to-one & q is one-to-one ) thus rng p misses rng q ::_thesis: ( p is one-to-one & q is one-to-one ) proof assume not rng p misses rng q ; ::_thesis: contradiction then consider x being set such that A26: x in rng p and A27: x in rng q by XBOOLE_0:3; consider y1 being set such that A28: y1 in dom p and A29: p . y1 = x by A26, FUNCT_1:def_3; A30: y1 in Seg (len p) by A28, FINSEQ_1:def_3; consider y2 being set such that A31: y2 in dom q and A32: q . y2 = x by A27, FUNCT_1:def_3; A33: y2 in Seg (len q) by A31, FINSEQ_1:def_3; reconsider y1 = y1, y2 = y2 as Element of NAT by A28, A31; A34: (len p) + y2 in dom (p ^ q) by A31, FINSEQ_1:28; A35: (p ^ q) . y1 = p . y1 by A28, FINSEQ_1:def_7; A36: (p ^ q) . ((len p) + y2) = q . y2 by A31, FINSEQ_1:def_7; y1 in dom (p ^ q) by A28, Th22; then A37: y1 = (len p) + y2 by A25, A29, A32, A34, A35, A36, FUNCT_1:def_4; A38: y1 = y1 + 0 ; A39: len p <= (len p) + y2 by NAT_1:12; y1 <= len p by A30, FINSEQ_1:1; then y1 = len p by A37, A39, XXREAL_0:1; hence contradiction by A33, A37, A38, FINSEQ_1:1; ::_thesis: verum end; thus p is one-to-one ::_thesis: q is one-to-one proof let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not x in dom p or not b1 in dom p or not p . x = p . b1 or x = b1 ) let y be set ; ::_thesis: ( not x in dom p or not y in dom p or not p . x = p . y or x = y ) assume that A40: x in dom p and A41: y in dom p and A42: p . x = p . y ; ::_thesis: x = y reconsider k = x, l = y as Element of NAT by A40, A41; A43: (p ^ q) . k = p . k by A40, FINSEQ_1:def_7; A44: (p ^ q) . l = p . l by A41, FINSEQ_1:def_7; A45: l in dom (p ^ q) by A41, Th22; k in dom (p ^ q) by A40, Th22; hence x = y by A25, A42, A43, A44, A45, FUNCT_1:def_4; ::_thesis: verum end; let x be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not x in dom q or not b1 in dom q or not q . x = q . b1 or x = b1 ) let y be set ; ::_thesis: ( not x in dom q or not y in dom q or not q . x = q . y or x = y ) assume that A46: x in dom q and A47: y in dom q and A48: q . x = q . y ; ::_thesis: x = y consider l being Nat such that A49: y = l and A50: (len p) + l in dom (p ^ q) by A47, FINSEQ_1:27; A51: (p ^ q) . ((len p) + l) = q . l by A47, A49, FINSEQ_1:def_7; consider k being Nat such that A52: x = k and A53: (len p) + k in dom (p ^ q) by A46, FINSEQ_1:27; (p ^ q) . ((len p) + k) = q . k by A46, A52, FINSEQ_1:def_7; then (len p) + k = (len p) + l by A25, A48, A52, A53, A49, A50, A51, FUNCT_1:def_4; hence x = y by A52, A49; ::_thesis: verum end; theorem :: FINSEQ_3:92 for A being set for k being Nat st A c= Seg k holds Sgm A is one-to-one by Lm1; theorem Th93: :: FINSEQ_3:93 for x being set holds <*x*> is one-to-one proof let x be set ; ::_thesis: <*x*> is one-to-one let y1 be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not y1 in dom <*x*> or not b1 in dom <*x*> or not <*x*> . y1 = <*x*> . b1 or y1 = b1 ) let y2 be set ; ::_thesis: ( not y1 in dom <*x*> or not y2 in dom <*x*> or not <*x*> . y1 = <*x*> . y2 or y1 = y2 ) assume that A1: y1 in dom <*x*> and A2: y2 in dom <*x*> and <*x*> . y1 = <*x*> . y2 ; ::_thesis: y1 = y2 y1 in {1} by A1, FINSEQ_1:2, FINSEQ_1:def_8; then A3: y1 = 1 by TARSKI:def_1; y2 in {1} by A2, FINSEQ_1:2, FINSEQ_1:def_8; hence y1 = y2 by A3, TARSKI:def_1; ::_thesis: verum end; theorem Th94: :: FINSEQ_3:94 for x, y being set holds ( x <> y iff <*x,y*> is one-to-one ) proof let x, y be set ; ::_thesis: ( x <> y iff <*x,y*> is one-to-one ) A1: <*x,y*> . 2 = y by FINSEQ_1:44; 2 in {1,2} by TARSKI:def_2; then A2: 2 in dom <*x,y*> by FINSEQ_1:2, FINSEQ_1:89; thus ( x <> y implies <*x,y*> is one-to-one ) ::_thesis: ( <*x,y*> is one-to-one implies x <> y ) proof assume A3: x <> y ; ::_thesis: <*x,y*> is one-to-one let y1 be set ; :: according to FUNCT_1:def_4 ::_thesis: for b1 being set holds ( not y1 in dom <*x,y*> or not b1 in dom <*x,y*> or not <*x,y*> . y1 = <*x,y*> . b1 or y1 = b1 ) let y2 be set ; ::_thesis: ( not y1 in dom <*x,y*> or not y2 in dom <*x,y*> or not <*x,y*> . y1 = <*x,y*> . y2 or y1 = y2 ) assume that A4: y1 in dom <*x,y*> and A5: y2 in dom <*x,y*> and A6: <*x,y*> . y1 = <*x,y*> . y2 ; ::_thesis: y1 = y2 A7: y2 in {1,2} by A5, FINSEQ_1:2, FINSEQ_1:89; A8: y1 in {1,2} by A4, FINSEQ_1:2, FINSEQ_1:89; now__::_thesis:_y1_=_y2 percases ( ( y1 = 1 & y2 = 1 ) or ( y1 = 2 & y2 = 2 ) or ( y1 = 1 & y2 = 2 ) or ( y1 = 2 & y2 = 1 ) ) by A8, A7, TARSKI:def_2; suppose ( ( y1 = 1 & y2 = 1 ) or ( y1 = 2 & y2 = 2 ) ) ; ::_thesis: y1 = y2 hence y1 = y2 ; ::_thesis: verum end; supposeA9: ( y1 = 1 & y2 = 2 ) ; ::_thesis: y1 = y2 then <*x,y*> . y1 = x by FINSEQ_1:44; hence y1 = y2 by A3, A6, A9, FINSEQ_1:44; ::_thesis: verum end; supposeA10: ( y1 = 2 & y2 = 1 ) ; ::_thesis: y1 = y2 then <*x,y*> . y1 = y by FINSEQ_1:44; hence y1 = y2 by A3, A6, A10, FINSEQ_1:44; ::_thesis: verum end; end; end; hence y1 = y2 ; ::_thesis: verum end; assume that A11: <*x,y*> is one-to-one and A12: x = y ; ::_thesis: contradiction 1 in {1,2} by TARSKI:def_2; then A13: 1 in dom <*x,y*> by FINSEQ_1:2, FINSEQ_1:89; <*x,y*> . 1 = x by FINSEQ_1:44; hence contradiction by A11, A12, A13, A2, A1, FUNCT_1:def_4; ::_thesis: verum end; theorem Th95: :: FINSEQ_3:95 for x, y, z being set holds ( ( x <> y & y <> z & z <> x ) iff <*x,y,z*> is one-to-one ) proof let x, y, z be set ; ::_thesis: ( ( x <> y & y <> z & z <> x ) iff <*x,y,z*> is one-to-one ) set p = <*x,y,z*>; A1: <*x,y,z*> . 1 = x by FINSEQ_1:45; A2: <*x,y,z*> . 3 = z by FINSEQ_1:45; thus ( x <> y & y <> z & z <> x implies <*x,y,z*> is one-to-one ) ::_thesis: ( <*x,y,z*> is one-to-one implies ( x <> y & y <> z & z <> x ) ) proof assume that A3: x <> y and A4: y <> z and A5: z <> x ; ::_thesis: <*x,y,z*> is one-to-one {x,y} /\ {z} = {} proof set y1 = the Element of {x,y} /\ {z}; assume A6: not {x,y} /\ {z} = {} ; ::_thesis: contradiction then the Element of {x,y} /\ {z} in {x,y} by XBOOLE_0:def_4; then A7: ( the Element of {x,y} /\ {z} = x or the Element of {x,y} /\ {z} = y ) by TARSKI:def_2; the Element of {x,y} /\ {z} in {z} by A6, XBOOLE_0:def_4; hence contradiction by A4, A5, A7, TARSKI:def_1; ::_thesis: verum end; then {} = (rng <*x,y*>) /\ {z} by FINSEQ_2:127 .= (rng <*x,y*>) /\ (rng <*z*>) by FINSEQ_1:38 ; then A8: rng <*x,y*> misses rng <*z*> by XBOOLE_0:def_7; A9: <*z*> is one-to-one by Th93; <*x,y*> is one-to-one by A3, Th94; then <*x,y*> ^ <*z*> is one-to-one by A8, A9, Th91; hence <*x,y,z*> is one-to-one by FINSEQ_1:43; ::_thesis: verum end; A10: <*x,y,z*> . 2 = y by FINSEQ_1:45; 1 in {1,2,3} by ENUMSET1:def_1; then A11: 1 in dom <*x,y,z*> by Th1, FINSEQ_1:89; 3 in {1,2,3} by ENUMSET1:def_1; then A12: 3 in dom <*x,y,z*> by Th1, FINSEQ_1:89; 2 in {1,2,3} by ENUMSET1:def_1; then A13: 2 in dom <*x,y,z*> by Th1, FINSEQ_1:89; assume <*x,y,z*> is one-to-one ; ::_thesis: ( x <> y & y <> z & z <> x ) hence ( x <> y & y <> z & z <> x ) by A11, A13, A12, A1, A10, A2, FUNCT_1:def_4; ::_thesis: verum end; theorem Th96: :: FINSEQ_3:96 for p being FinSequence for x being set st p is one-to-one & rng p = {x} holds len p = 1 proof let p be FinSequence; ::_thesis: for x being set st p is one-to-one & rng p = {x} holds len p = 1 let x be set ; ::_thesis: ( p is one-to-one & rng p = {x} implies len p = 1 ) assume that A1: p is one-to-one and A2: rng p = {x} ; ::_thesis: len p = 1 A3: now__::_thesis:_for_y1,_y2_being_set_holds_ (_not_y1_in_dom_p_or_not_y2_in_dom_p_or_not_y1_<>_y2_) given y1, y2 being set such that A4: y1 in dom p and A5: y2 in dom p and A6: y1 <> y2 ; ::_thesis: contradiction p . y2 in rng p by A5, FUNCT_1:def_3; then A7: p . y2 = x by A2, TARSKI:def_1; p . y1 in rng p by A4, FUNCT_1:def_3; then p . y1 = x by A2, TARSKI:def_1; hence contradiction by A1, A4, A5, A6, A7, FUNCT_1:def_4; ::_thesis: verum end; set y = the Element of dom p; A8: dom p <> {} by A2, RELAT_1:42; A9: dom p = { the Element of dom p} proof thus dom p c= { the Element of dom p} :: according to XBOOLE_0:def_10 ::_thesis: { the Element of dom p} c= dom p proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom p or x in { the Element of dom p} ) assume x in dom p ; ::_thesis: x in { the Element of dom p} then x = the Element of dom p by A3; hence x in { the Element of dom p} by TARSKI:def_1; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { the Element of dom p} or x in dom p ) the Element of dom p in dom p by A8; hence ( not x in { the Element of dom p} or x in dom p ) by TARSKI:def_1; ::_thesis: verum end; dom p = Seg (len p) by FINSEQ_1:def_3; hence len p = 1 by A9, Th20; ::_thesis: verum end; theorem :: FINSEQ_3:97 for p being FinSequence for x being set st p is one-to-one & rng p = {x} holds p = <*x*> proof let p be FinSequence; ::_thesis: for x being set st p is one-to-one & rng p = {x} holds p = <*x*> let x be set ; ::_thesis: ( p is one-to-one & rng p = {x} implies p = <*x*> ) assume that A1: p is one-to-one and A2: rng p = {x} ; ::_thesis: p = <*x*> len p = 1 by A1, A2, Th96; hence p = <*x*> by A2, FINSEQ_1:39; ::_thesis: verum end; theorem Th98: :: FINSEQ_3:98 for p being FinSequence for x, y being set st p is one-to-one & rng p = {x,y} & x <> y holds len p = 2 proof let p be FinSequence; ::_thesis: for x, y being set st p is one-to-one & rng p = {x,y} & x <> y holds len p = 2 let x, y be set ; ::_thesis: ( p is one-to-one & rng p = {x,y} & x <> y implies len p = 2 ) assume that A1: p is one-to-one and A2: rng p = {x,y} and A3: x <> y ; ::_thesis: len p = 2 set q = <*x,y*>; A4: rng <*x,y*> = {x,y} by FINSEQ_2:127; A5: len <*x,y*> = 2 by FINSEQ_1:44; <*x,y*> is one-to-one by A3, Th94; hence len p = 2 by A1, A2, A4, A5, FINSEQ_1:48; ::_thesis: verum end; theorem :: FINSEQ_3:99 for p being FinSequence for x, y being set st p is one-to-one & rng p = {x,y} & x <> y & not p = <*x,y*> holds p = <*y,x*> proof let p be FinSequence; ::_thesis: for x, y being set st p is one-to-one & rng p = {x,y} & x <> y & not p = <*x,y*> holds p = <*y,x*> let x, y be set ; ::_thesis: ( p is one-to-one & rng p = {x,y} & x <> y & not p = <*x,y*> implies p = <*y,x*> ) assume that A1: p is one-to-one and A2: rng p = {x,y} and A3: x <> y ; ::_thesis: ( p = <*x,y*> or p = <*y,x*> ) A4: len p = 2 by A1, A2, A3, Th98; then A5: dom p = {1,2} by FINSEQ_1:2, FINSEQ_1:def_3; then A6: 2 in dom p by TARSKI:def_2; then A7: p . 2 in rng p by FUNCT_1:def_3; A8: 1 in dom p by A5, TARSKI:def_2; then p . 1 in rng p by FUNCT_1:def_3; then ( ( p . 1 = x & p . 2 = x ) or ( p . 1 = x & p . 2 = y ) or ( p . 1 = y & p . 2 = x ) or ( p . 1 = y & p . 2 = y ) ) by A2, A7, TARSKI:def_2; hence ( p = <*x,y*> or p = <*y,x*> ) by A1, A4, A8, A6, FINSEQ_1:44, FUNCT_1:def_4; ::_thesis: verum end; theorem Th100: :: FINSEQ_3:100 for p being FinSequence for x, y, z being set st p is one-to-one & rng p = {x,y,z} & <*x,y,z*> is one-to-one holds len p = 3 proof let p be FinSequence; ::_thesis: for x, y, z being set st p is one-to-one & rng p = {x,y,z} & <*x,y,z*> is one-to-one holds len p = 3 let x, y, z be set ; ::_thesis: ( p is one-to-one & rng p = {x,y,z} & <*x,y,z*> is one-to-one implies len p = 3 ) A1: len <*x,y,z*> = 3 by FINSEQ_1:45; rng <*x,y,z*> = {x,y,z} by FINSEQ_2:128; hence ( p is one-to-one & rng p = {x,y,z} & <*x,y,z*> is one-to-one implies len p = 3 ) by A1, FINSEQ_1:48; ::_thesis: verum end; theorem :: FINSEQ_3:101 for p being FinSequence for x, y, z being set st p is one-to-one & rng p = {x,y,z} & x <> y & y <> z & x <> z holds len p = 3 proof let p be FinSequence; ::_thesis: for x, y, z being set st p is one-to-one & rng p = {x,y,z} & x <> y & y <> z & x <> z holds len p = 3 let x, y, z be set ; ::_thesis: ( p is one-to-one & rng p = {x,y,z} & x <> y & y <> z & x <> z implies len p = 3 ) assume that A1: p is one-to-one and A2: rng p = {x,y,z} and A3: x <> y and A4: y <> z and A5: x <> z ; ::_thesis: len p = 3 <*x,y,z*> is one-to-one by A3, A4, A5, Th95; hence len p = 3 by A1, A2, Th100; ::_thesis: verum end; begin theorem :: FINSEQ_3:102 for D being non empty set for df being FinSequence of D st not df is empty holds ex d being Element of D ex df1 being FinSequence of D st ( d = df . 1 & df = <*d*> ^ df1 ) proof let D be non empty set ; ::_thesis: for df being FinSequence of D st not df is empty holds ex d being Element of D ex df1 being FinSequence of D st ( d = df . 1 & df = <*d*> ^ df1 ) let df be FinSequence of D; ::_thesis: ( not df is empty implies ex d being Element of D ex df1 being FinSequence of D st ( d = df . 1 & df = <*d*> ^ df1 ) ) deffunc H1( Nat) -> set = df . ($1 + 1); assume A1: not df is empty ; ::_thesis: ex d being Element of D ex df1 being FinSequence of D st ( d = df . 1 & df = <*d*> ^ df1 ) then reconsider lend1 = (len df) - 1 as Element of NAT by INT_1:5, NAT_1:14; 1 <= len df by A1, NAT_1:14; then 1 in dom df by Th25; then reconsider d = df . 1 as Element of D by FINSEQ_2:11; take d ; ::_thesis: ex df1 being FinSequence of D st ( d = df . 1 & df = <*d*> ^ df1 ) consider dta being FinSequence such that A2: len dta = lend1 and A3: for j being Nat st j in dom dta holds dta . j = H1(j) from FINSEQ_1:sch_2(); now__::_thesis:_for_j_being_Nat_st_j_in_dom_dta_holds_ dta_._j_in_D let j be Nat; ::_thesis: ( j in dom dta implies dta . j in D ) assume A4: j in dom dta ; ::_thesis: dta . j in D then j in Seg (len dta) by FINSEQ_1:def_3; then j + 1 in Seg ((len dta) + 1) by FINSEQ_1:60; then j + 1 in dom df by A2, FINSEQ_1:def_3; then df . (j + 1) in D by FINSEQ_2:11; hence dta . j in D by A3, A4; ::_thesis: verum end; then reconsider dta = dta as FinSequence of D by FINSEQ_2:12; take dta ; ::_thesis: ( d = df . 1 & df = <*d*> ^ dta ) thus d = df . 1 ; ::_thesis: df = <*d*> ^ dta now__::_thesis:_(_len_(<*d*>_^_dta)_=_len_df_&_(_for_i_being_Nat_st_i_in_dom_df_holds_ df_._i_=_(<*d*>_^_dta)_._i_)_) thus A5: len (<*d*> ^ dta) = (len <*d*>) + (len dta) by FINSEQ_1:22 .= 1 + ((len df) - 1) by A2, FINSEQ_1:40 .= len df ; ::_thesis: for i being Nat st i in dom df holds df . b2 = (<*d*> ^ dta) . b2 let i be Nat; ::_thesis: ( i in dom df implies df . b1 = (<*d*> ^ dta) . b1 ) A6: dom df = Seg (len df) by FINSEQ_1:def_3; assume A7: i in dom df ; ::_thesis: df . b1 = (<*d*> ^ dta) . b1 then A8: 1 <= i by A6, FINSEQ_1:1; A9: i <= len df by A6, A7, FINSEQ_1:1; percases ( i = 1 or i > 1 ) by A8, XXREAL_0:1; suppose i = 1 ; ::_thesis: df . b1 = (<*d*> ^ dta) . b1 hence df . i = (<*d*> ^ dta) . i by FINSEQ_1:41; ::_thesis: verum end; supposeA10: i > 1 ; ::_thesis: df . b1 = (<*d*> ^ dta) . b1 then consider j being Element of NAT such that A11: j = i - 1 and A12: 1 <= j by INT_1:51; i - 1 <= lend1 by A9, XREAL_1:9; then A13: j in dom dta by A2, A11, A12, Th25; len <*d*> = 1 by FINSEQ_1:40; then (<*d*> ^ dta) . i = dta . j by A5, A9, A10, A11, FINSEQ_1:24 .= df . (j + 1) by A3, A13 .= df . i by A11 ; hence df . i = (<*d*> ^ dta) . i ; ::_thesis: verum end; end; end; hence df = <*d*> ^ dta by FINSEQ_2:9; ::_thesis: verum end; theorem :: FINSEQ_3:103 for i being Nat for df being FinSequence for d being set st i in dom df holds (<*d*> ^ df) . (i + 1) = df . i proof let i be Nat; ::_thesis: for df being FinSequence for d being set st i in dom df holds (<*d*> ^ df) . (i + 1) = df . i let df be FinSequence; ::_thesis: for d being set st i in dom df holds (<*d*> ^ df) . (i + 1) = df . i let d be set ; ::_thesis: ( i in dom df implies (<*d*> ^ df) . (i + 1) = df . i ) A1: len (<*d*> ^ df) = (len <*d*>) + (len df) by FINSEQ_1:22 .= 1 + (len df) by FINSEQ_1:40 ; assume A2: i in dom df ; ::_thesis: (<*d*> ^ df) . (i + 1) = df . i then i in Seg (len df) by FINSEQ_1:def_3; then i + 1 in Seg (len (<*d*> ^ df)) by A1, FINSEQ_1:60; then i + 1 in dom (<*d*> ^ df) by FINSEQ_1:def_3; then A3: i + 1 <= len (<*d*> ^ df) by Th25; A4: len <*d*> = 1 by FINSEQ_1:40; 1 <= i by A2, Th25; then 1 < i + 1 by NAT_1:13; hence (<*d*> ^ df) . (i + 1) = df . ((i + 1) - (len <*d*>)) by A4, A3, FINSEQ_1:24 .= df . i by A4 ; ::_thesis: verum end; definition let i be Nat; let p be FinSequence; func Del (p,i) -> FinSequence equals :: FINSEQ_3:def 2 p * (Sgm ((dom p) \ {i})); coherence p * (Sgm ((dom p) \ {i})) is FinSequence proof set q = Sgm ((dom p) \ {i}); A1: (Seg (len p)) \ {i} c= Seg (len p) by XBOOLE_1:36; dom p = Seg (len p) by FINSEQ_1:def_3; then rng (Sgm ((dom p) \ {i})) c= dom p by A1, FINSEQ_1:def_13; then A2: dom (p * (Sgm ((dom p) \ {i}))) = dom (Sgm ((dom p) \ {i})) by RELAT_1:27; dom (Sgm ((dom p) \ {i})) = Seg (len (Sgm ((dom p) \ {i}))) by FINSEQ_1:def_3; hence p * (Sgm ((dom p) \ {i})) is FinSequence by A2, FINSEQ_1:def_2; ::_thesis: verum end; end; :: deftheorem defines Del FINSEQ_3:def_2_:_ for i being Nat for p being FinSequence holds Del (p,i) = p * (Sgm ((dom p) \ {i})); theorem Th104: :: FINSEQ_3:104 for i being Nat for p being FinSequence holds ( ( i in dom p implies ex m being Nat st ( len p = m + 1 & len (Del (p,i)) = m ) ) & ( not i in dom p implies Del (p,i) = p ) ) proof let i be Nat; ::_thesis: for p being FinSequence holds ( ( i in dom p implies ex m being Nat st ( len p = m + 1 & len (Del (p,i)) = m ) ) & ( not i in dom p implies Del (p,i) = p ) ) let p be FinSequence; ::_thesis: ( ( i in dom p implies ex m being Nat st ( len p = m + 1 & len (Del (p,i)) = m ) ) & ( not i in dom p implies Del (p,i) = p ) ) hereby ::_thesis: ( not i in dom p implies Del (p,i) = p ) not i in (Seg (len p)) \ {i} proof assume i in (Seg (len p)) \ {i} ; ::_thesis: contradiction then not i in {i} by XBOOLE_0:def_5; hence contradiction by TARSKI:def_1; ::_thesis: verum end; then A1: card (((Seg (len p)) \ {i}) \/ {i}) = (card ((Seg (len p)) \ {i})) + 1 by CARD_2:41; assume A2: i in dom p ; ::_thesis: ex m being Nat st ( len p = m + 1 & len (Del (p,i)) = m ) then reconsider D9 = dom p as non empty set ; reconsider D = rng p as non empty set by A2, FUNCT_1:3; reconsider r = p as Function of D9,D by FUNCT_2:1; A3: dom p = Seg (len p) by FINSEQ_1:def_3; for x being set st x in (Seg (len p)) \ {i} holds x in Seg (len p) by XBOOLE_0:def_5; then A4: (Seg (len p)) \ {i} c= Seg (len p) by TARSKI:def_3; then rng (Sgm ((Seg (len p)) \ {i})) c= Seg (len p) by FINSEQ_1:def_13; then reconsider q = Sgm ((dom p) \ {i}) as FinSequence of D9 by A3, FINSEQ_1:def_4; p <> {} by A2; then consider m being Nat such that A5: len p = m + 1 by NAT_1:6; take m = m; ::_thesis: ( len p = m + 1 & len (Del (p,i)) = m ) A6: len (r * q) = len q by FINSEQ_2:33; i in Seg (len p) by A2, FINSEQ_1:def_3; then for x being set st x in {i} holds x in Seg (len p) by TARSKI:def_1; then {i} c= Seg (len p) by TARSKI:def_3; then card (Seg (len p)) = (card ((Seg (len p)) \ {i})) + 1 by A1, XBOOLE_1:45; then (card ((Seg (len p)) \ {i})) + 1 = m + 1 by A5, FINSEQ_1:57; then len (Sgm ((Seg (len p)) \ {i})) = m by A4, Th39; hence ( len p = m + 1 & len (Del (p,i)) = m ) by A5, A6, FINSEQ_1:def_3; ::_thesis: verum end; assume not i in dom p ; ::_thesis: Del (p,i) = p then for x being set st x in {i} holds not x in dom p by TARSKI:def_1; then {i} misses dom p by XBOOLE_0:3; hence Del (p,i) = p * (Sgm (dom p)) by XBOOLE_1:83 .= p * (Sgm (Seg (len p))) by FINSEQ_1:def_3 .= p * (idseq (len p)) by Th48 .= p | (Seg (len p)) by RELAT_1:65 .= p | (dom p) by FINSEQ_1:def_3 .= p ; ::_thesis: verum end; theorem :: FINSEQ_3:105 for i being Nat for D being non empty set for p being FinSequence of D holds Del (p,i) is FinSequence of D proof let i be Nat; ::_thesis: for D being non empty set for p being FinSequence of D holds Del (p,i) is FinSequence of D let D be non empty set ; ::_thesis: for p being FinSequence of D holds Del (p,i) is FinSequence of D let p be FinSequence of D; ::_thesis: Del (p,i) is FinSequence of D percases ( i in dom p or not i in dom p ) ; suppose i in dom p ; ::_thesis: Del (p,i) is FinSequence of D then reconsider D9 = Seg (len p) as non empty set by FINSEQ_1:def_3; for x being set st x in (Seg (len p)) \ {i} holds x in Seg (len p) by XBOOLE_0:def_5; then (Seg (len p)) \ {i} c= Seg (len p) by TARSKI:def_3; then rng (Sgm ((Seg (len p)) \ {i})) c= Seg (len p) by FINSEQ_1:def_13; then reconsider q = Sgm ((Seg (len p)) \ {i}) as FinSequence of D9 by FINSEQ_1:def_4; p * q = Del (p,i) by FINSEQ_1:def_3; hence Del (p,i) is FinSequence of D by FINSEQ_2:31; ::_thesis: verum end; suppose not i in dom p ; ::_thesis: Del (p,i) is FinSequence of D hence Del (p,i) is FinSequence of D by Th104; ::_thesis: verum end; end; end; theorem :: FINSEQ_3:106 for i being Nat for p being FinSequence holds rng (Del (p,i)) c= rng p proof let i be Nat; ::_thesis: for p being FinSequence holds rng (Del (p,i)) c= rng p let p be FinSequence; ::_thesis: rng (Del (p,i)) c= rng p let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng (Del (p,i)) or x in rng p ) assume x in rng (Del (p,i)) ; ::_thesis: x in rng p hence x in rng p by FUNCT_1:14; ::_thesis: verum end; theorem Th107: :: FINSEQ_3:107 for n, m, i being Nat st n = m + 1 & i in Seg n holds len (Sgm ((Seg n) \ {i})) = m proof let n, m, i be Nat; ::_thesis: ( n = m + 1 & i in Seg n implies len (Sgm ((Seg n) \ {i})) = m ) assume that A1: n = m + 1 and A2: i in Seg n ; ::_thesis: len (Sgm ((Seg n) \ {i})) = m set X = (Seg n) \ {i}; i in {i} by TARSKI:def_1; then not i in (Seg n) \ {i} by XBOOLE_0:def_5; then (card ((Seg n) \ {i})) + 1 = card (((Seg n) \ {i}) \/ {i}) by CARD_2:41 .= card ((Seg n) \/ {i}) by XBOOLE_1:39 .= card (Seg n) by A2, ZFMISC_1:40 .= m + 1 by A1, FINSEQ_1:57 ; hence len (Sgm ((Seg n) \ {i})) = m by Th39, XBOOLE_1:36; ::_thesis: verum end; theorem Th108: :: FINSEQ_3:108 for i, k, m, n being Nat st n = m + 1 & k in Seg n & i in Seg m holds ( ( 1 <= i & i < k implies (Sgm ((Seg n) \ {k})) . i = i ) & ( k <= i & i <= m implies (Sgm ((Seg n) \ {k})) . i = i + 1 ) ) proof defpred S1[ Nat] means for n, k, i being Nat st n = $1 + 1 & k in Seg n & i in Seg $1 holds ( ( 1 <= i & i < k implies (Sgm ((Seg n) \ {k})) . i = i ) & ( k <= i & i <= $1 implies (Sgm ((Seg n) \ {k})) . i = i + 1 ) ); let i, k, m, n be Nat; ::_thesis: ( n = m + 1 & k in Seg n & i in Seg m implies ( ( 1 <= i & i < k implies (Sgm ((Seg n) \ {k})) . i = i ) & ( k <= i & i <= m implies (Sgm ((Seg n) \ {k})) . i = i + 1 ) ) ) assume that A1: n = m + 1 and A2: k in Seg n and A3: i in Seg m ; ::_thesis: ( ( 1 <= i & i < k implies (Sgm ((Seg n) \ {k})) . i = i ) & ( k <= i & i <= m implies (Sgm ((Seg n) \ {k})) . i = i + 1 ) ) A4: for k being Nat st S1[k] holds S1[k + 1] proof let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A5: S1[k] ; ::_thesis: S1[k + 1] let g, i, n be Nat; ::_thesis: ( g = (k + 1) + 1 & i in Seg g & n in Seg (k + 1) implies ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) ) assume that A6: g = (k + 1) + 1 and A7: i in Seg g and A8: n in Seg (k + 1) ; ::_thesis: ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) A9: 1 <= i by A7, FINSEQ_1:1; set X = (Seg g) \ {i}; A10: len (Sgm ((Seg g) \ {i})) = k + 1 by A6, A7, Th107; A11: 1 <= n by A8, FINSEQ_1:1; A12: i <= g by A7, FINSEQ_1:1; A13: (Seg g) \ {i} c= Seg g by XBOOLE_1:36; then A14: rng (Sgm ((Seg g) \ {i})) = (Seg g) \ {i} by FINSEQ_1:def_13; A15: n <= k + 1 by A8, FINSEQ_1:1; now__::_thesis:_(_(_1_<=_n_&_n_<_i_implies_(Sgm_((Seg_g)_\_{i}))_._n_=_n_)_&_(_i_<=_n_&_n_<=_k_+_1_implies_(Sgm_((Seg_g)_\_{i}))_._n_=_n_+_1_)_) percases ( i = g or i <> g ) ; supposeA16: i = g ; ::_thesis: ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) then A17: k + 1 < i by A6, NAT_1:13; (Seg g) \ {i} = Seg (k + 1) proof thus (Seg g) \ {i} c= Seg (k + 1) :: according to XBOOLE_0:def_10 ::_thesis: Seg (k + 1) c= (Seg g) \ {i} proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (Seg g) \ {i} or x in Seg (k + 1) ) A18: Seg g = { J where J is Element of NAT : ( 1 <= J & J <= g ) } by FINSEQ_1:def_1; assume A19: x in (Seg g) \ {i} ; ::_thesis: x in Seg (k + 1) then x in Seg g by XBOOLE_0:def_5; then consider J being Element of NAT such that A20: x = J and A21: 1 <= J and A22: J <= g by A18; not x in {i} by A19, XBOOLE_0:def_5; then x <> i by TARSKI:def_1; then J < g by A16, A20, A22, XXREAL_0:1; then J <= k + 1 by A6, NAT_1:13; hence x in Seg (k + 1) by A20, A21, FINSEQ_1:1; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Seg (k + 1) or x in (Seg g) \ {i} ) assume x in Seg (k + 1) ; ::_thesis: x in (Seg g) \ {i} then x in { J where J is Element of NAT : ( 1 <= J & J <= k + 1 ) } by FINSEQ_1:def_1; then consider J being Element of NAT such that A23: x = J and A24: 1 <= J and A25: J <= k + 1 ; k + 1 <= g by A6, NAT_1:11; then J <= g by A25, XXREAL_0:2; then A26: J in Seg g by A24, FINSEQ_1:1; not J in {i} by A17, A25, TARSKI:def_1; hence x in (Seg g) \ {i} by A23, A26, XBOOLE_0:def_5; ::_thesis: verum end; then Sgm ((Seg g) \ {i}) = idseq (k + 1) by Th48; hence ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) by A8, FUNCT_1:17; ::_thesis: ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) thus ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) by A6, A16, NAT_1:13; ::_thesis: verum end; supposeA27: i <> g ; ::_thesis: ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) set A = { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } ; A28: (Seg g) \ {i} = { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } proof thus (Seg g) \ {i} c= { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } :: according to XBOOLE_0:def_10 ::_thesis: { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } c= (Seg g) \ {i} proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (Seg g) \ {i} or x in { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } ) A29: Seg g = { J where J is Element of NAT : ( 1 <= J & J <= g ) } by FINSEQ_1:def_1; assume A30: x in (Seg g) \ {i} ; ::_thesis: x in { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } then x in Seg g by XBOOLE_0:def_5; then consider m being Element of NAT such that A31: x = m and A32: 1 <= m and A33: m <= g by A29; not x in {i} by A30, XBOOLE_0:def_5; then m <> i by A31, TARSKI:def_1; hence x in { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } by A31, A32, A33; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } or x in (Seg g) \ {i} ) assume x in { l where l is Element of NAT : ( 1 <= l & l <= g & l <> i ) } ; ::_thesis: x in (Seg g) \ {i} then consider m being Element of NAT such that A34: x = m and A35: 1 <= m and A36: m <= g and A37: m <> i ; A38: not m in {i} by A37, TARSKI:def_1; m in Seg g by A35, A36, FINSEQ_1:1; hence x in (Seg g) \ {i} by A34, A38, XBOOLE_0:def_5; ::_thesis: verum end; 1 <= k + 1 by A11, A15, XXREAL_0:2; then k + 1 in dom (Sgm ((Seg g) \ {i})) by A10, Th25; then (Sgm ((Seg g) \ {i})) . (k + 1) in (Seg g) \ {i} by A14, FUNCT_1:def_3; then A39: ex J being Element of NAT st ( (Sgm ((Seg g) \ {i})) . (k + 1) = J & 1 <= J & J <= g & J <> i ) by A28; A40: g in NAT by ORDINAL1:def_12; 1 <= g by A9, A12, XXREAL_0:2; then g in rng (Sgm ((Seg g) \ {i})) by A14, A27, A28, A40; then consider x being Nat such that A41: x in dom (Sgm ((Seg g) \ {i})) and A42: (Sgm ((Seg g) \ {i})) . x = g by FINSEQ_2:10; 1 <= x by A41, Th25; then A43: k + 1 <= x by A13, A10, A39, A42, FINSEQ_1:def_13; A44: i < g by A12, A27, XXREAL_0:1; then A45: i <= k + 1 by A6, NAT_1:13; A46: x <= k + 1 by A10, A41, Th25; now__::_thesis:_(_(_1_<=_n_&_n_<_i_implies_(Sgm_((Seg_g)_\_{i}))_._n_=_n_)_&_(_i_<=_n_&_n_<=_k_+_1_implies_(Sgm_((Seg_g)_\_{i}))_._n_=_n_+_1_)_) percases ( n = k + 1 or n < k + 1 ) by A15, XXREAL_0:1; supposeA47: n = k + 1 ; ::_thesis: ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) hence ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) by A6, A44, NAT_1:13; ::_thesis: ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) thus ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) by A6, A42, A46, A43, A47, XXREAL_0:1; ::_thesis: verum end; supposeA48: n < k + 1 ; ::_thesis: ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) set Y = (Seg (k + 1)) \ {i}; A49: now__::_thesis:_for_j1,_j_being_Element_of_NAT_st_j1_in_(Seg_(k_+_1))_\_{i}_&_j_in_{g}_holds_ j1_<_j let j1, j be Element of NAT ; ::_thesis: ( j1 in (Seg (k + 1)) \ {i} & j in {g} implies j1 < j ) assume that A50: j1 in (Seg (k + 1)) \ {i} and A51: j in {g} ; ::_thesis: j1 < j j1 in Seg (k + 1) by A50, XBOOLE_0:def_5; then A52: j1 <= k + 1 by FINSEQ_1:1; j = g by A51, TARSKI:def_1; hence j1 < j by A6, A52, NAT_1:13; ::_thesis: verum end; A53: (Seg g) \ {i} = ((Seg (k + 1)) \ {i}) \/ {g} proof thus (Seg g) \ {i} c= ((Seg (k + 1)) \ {i}) \/ {g} :: according to XBOOLE_0:def_10 ::_thesis: ((Seg (k + 1)) \ {i}) \/ {g} c= (Seg g) \ {i} proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (Seg g) \ {i} or x in ((Seg (k + 1)) \ {i}) \/ {g} ) assume x in (Seg g) \ {i} ; ::_thesis: x in ((Seg (k + 1)) \ {i}) \/ {g} then consider J being Element of NAT such that A54: x = J and A55: 1 <= J and A56: J <= g and A57: J <> i by A28; now__::_thesis:_x_in_((Seg_(k_+_1))_\_{i})_\/_{g} percases ( J = g or J < g ) by A56, XXREAL_0:1; suppose J = g ; ::_thesis: x in ((Seg (k + 1)) \ {i}) \/ {g} then x in {g} by A54, TARSKI:def_1; hence x in ((Seg (k + 1)) \ {i}) \/ {g} by XBOOLE_0:def_3; ::_thesis: verum end; suppose J < g ; ::_thesis: x in ((Seg (k + 1)) \ {i}) \/ {g} then J <= k + 1 by A6, NAT_1:13; then A58: J in Seg (k + 1) by A55, FINSEQ_1:1; not J in {i} by A57, TARSKI:def_1; then x in (Seg (k + 1)) \ {i} by A54, A58, XBOOLE_0:def_5; hence x in ((Seg (k + 1)) \ {i}) \/ {g} by XBOOLE_0:def_3; ::_thesis: verum end; end; end; hence x in ((Seg (k + 1)) \ {i}) \/ {g} ; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in ((Seg (k + 1)) \ {i}) \/ {g} or x in (Seg g) \ {i} ) assume A59: x in ((Seg (k + 1)) \ {i}) \/ {g} ; ::_thesis: x in (Seg g) \ {i} now__::_thesis:_x_in_(Seg_g)_\_{i} percases ( x in (Seg (k + 1)) \ {i} or x in {g} ) by A59, XBOOLE_0:def_3; supposeA60: x in (Seg (k + 1)) \ {i} ; ::_thesis: x in (Seg g) \ {i} A61: Seg (k + 1) = { s where s is Element of NAT : ( 1 <= s & s <= k + 1 ) } by FINSEQ_1:def_1; x in Seg (k + 1) by A60, XBOOLE_0:def_5; then consider s being Element of NAT such that A62: x = s and A63: 1 <= s and A64: s <= k + 1 by A61; not x in {i} by A60, XBOOLE_0:def_5; then A65: s <> i by A62, TARSKI:def_1; k + 1 <= g by A6, NAT_1:11; then s <= g by A64, XXREAL_0:2; hence x in (Seg g) \ {i} by A28, A62, A63, A65; ::_thesis: verum end; suppose x in {g} ; ::_thesis: x in (Seg g) \ {i} then A66: x = g by TARSKI:def_1; 1 <= g by A9, A12, XXREAL_0:2; hence x in (Seg g) \ {i} by A27, A28, A66, A40; ::_thesis: verum end; end; end; hence x in (Seg g) \ {i} ; ::_thesis: verum end; then {g} c= (Seg g) \ {i} by XBOOLE_1:7; then A67: {g} c= Seg g by A13, XBOOLE_1:1; (Seg (k + 1)) \ {i} c= (Seg g) \ {i} by A53, XBOOLE_1:7; then (Seg (k + 1)) \ {i} c= Seg g by A13, XBOOLE_1:1; then A68: Sgm ((Seg g) \ {i}) = (Sgm ((Seg (k + 1)) \ {i})) ^ (Sgm {g}) by A53, A49, A67, Th42; n <= k by A48, NAT_1:13; then A69: n in Seg k by A11, FINSEQ_1:1; A70: i in Seg (k + 1) by A9, A45, FINSEQ_1:1; then len (Sgm ((Seg (k + 1)) \ {i})) = k by Th107; then A71: n in dom (Sgm ((Seg (k + 1)) \ {i})) by A69, FINSEQ_1:def_3; n <= k by A48, NAT_1:13; then A72: n in Seg k by A11, FINSEQ_1:1; then A73: ( 1 <= n & n < i implies (Sgm ((Seg (k + 1)) \ {i})) . n = n ) by A5, A70; now__::_thesis:_(_1_<=_n_&_n_<_i_implies_(Sgm_((Seg_g)_\_{i}))_._n_=_n_) assume that A74: 1 <= n and A75: n < i ; ::_thesis: (Sgm ((Seg g) \ {i})) . n = n n in Seg (len (Sgm ((Seg (k + 1)) \ {i}))) by A72, A70, Th107; then n in dom (Sgm ((Seg (k + 1)) \ {i})) by FINSEQ_1:def_3; hence (Sgm ((Seg g) \ {i})) . n = n by A73, A68, A74, A75, FINSEQ_1:def_7; ::_thesis: verum end; hence ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) ; ::_thesis: ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) assume that A76: i <= n and n <= k + 1 ; ::_thesis: (Sgm ((Seg g) \ {i})) . n = n + 1 ( i <= n & n <= k implies (Sgm ((Seg (k + 1)) \ {i})) . n = n + 1 ) by A5, A72, A70; hence (Sgm ((Seg g) \ {i})) . n = n + 1 by A48, A68, A76, A71, FINSEQ_1:def_7, NAT_1:13; ::_thesis: verum end; end; end; hence ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) ; ::_thesis: verum end; end; end; hence ( ( 1 <= n & n < i implies (Sgm ((Seg g) \ {i})) . n = n ) & ( i <= n & n <= k + 1 implies (Sgm ((Seg g) \ {i})) . n = n + 1 ) ) ; ::_thesis: verum end; A77: S1[ 0 ] ; for k being Nat holds S1[k] from NAT_1:sch_2(A77, A4); hence ( ( 1 <= i & i < k implies (Sgm ((Seg n) \ {k})) . i = i ) & ( k <= i & i <= m implies (Sgm ((Seg n) \ {k})) . i = i + 1 ) ) by A1, A2, A3; ::_thesis: verum end; theorem Th109: :: FINSEQ_3:109 for m, n being Nat for f being FinSequence st len f = m + 1 & n in dom f holds len (Del (f,n)) = m proof let m, n be Nat; ::_thesis: for f being FinSequence st len f = m + 1 & n in dom f holds len (Del (f,n)) = m let f be FinSequence; ::_thesis: ( len f = m + 1 & n in dom f implies len (Del (f,n)) = m ) assume that A1: len f = m + 1 and A2: n in dom f ; ::_thesis: len (Del (f,n)) = m ex k being Nat st ( len f = k + 1 & len (Del (f,n)) = k ) by A2, Th104; hence len (Del (f,n)) = m by A1; ::_thesis: verum end; theorem :: FINSEQ_3:110 for k, n being Nat for f being FinSequence st k < n holds (Del (f,n)) . k = f . k proof let k, n be Nat; ::_thesis: for f being FinSequence st k < n holds (Del (f,n)) . k = f . k let f be FinSequence; ::_thesis: ( k < n implies (Del (f,n)) . k = f . k ) assume A1: k < n ; ::_thesis: (Del (f,n)) . k = f . k percases ( ( n in dom f & f <> {} ) or not n in dom f or f = {} ) ; supposethat A2: n in dom f and A3: f <> {} ; ::_thesis: (Del (f,n)) . k = f . k consider m being Nat such that A4: len f = m + 1 by A3, NAT_1:6; now__::_thesis:_(Del_(f,n))_._k_=_f_._k percases ( 1 <= k or not 1 <= k ) ; supposeA5: 1 <= k ; ::_thesis: (Del (f,n)) . k = f . k set X = (dom f) \ {n}; A6: dom (Sgm ((dom f) \ {n})) = Seg (len (Sgm ((dom f) \ {n}))) by FINSEQ_1:def_3; A7: dom f = Seg (len f) by FINSEQ_1:def_3; then A8: len (Sgm ((dom f) \ {n})) = m by A4, A2, Th107; (dom f) \ {n} c= Seg (len f) by A7, XBOOLE_1:36; then rng (Sgm ((dom f) \ {n})) = (dom f) \ {n} by FINSEQ_1:def_13; then A9: dom (f * (Sgm ((dom f) \ {n}))) = dom (Sgm ((dom f) \ {n})) by RELAT_1:27, XBOOLE_1:36; n <= m + 1 by A4, A2, Th25; then k < m + 1 by A1, XXREAL_0:2; then k <= m by NAT_1:13; then A10: k in Seg m by A5, FINSEQ_1:1; then ( 1 <= k & k < n implies (Sgm ((dom f) \ {n})) . k = k ) by A4, A2, A7, Th108; hence (Del (f,n)) . k = f . k by A1, A5, A10, A6, A9, A8, FUNCT_1:12; ::_thesis: verum end; supposeA11: not 1 <= k ; ::_thesis: (Del (f,n)) . k = f . k Seg (len (Del (f,n))) = Seg m by A4, A2, Th109; then dom (Del (f,n)) = Seg m by FINSEQ_1:def_3; then A12: not k in dom (Del (f,n)) by A11, FINSEQ_1:1; not k in dom f by A11, Th25; then f . k = {} by FUNCT_1:def_2; hence (Del (f,n)) . k = f . k by A12, FUNCT_1:def_2; ::_thesis: verum end; end; end; hence (Del (f,n)) . k = f . k ; ::_thesis: verum end; suppose ( not n in dom f or f = {} ) ; ::_thesis: (Del (f,n)) . k = f . k hence (Del (f,n)) . k = f . k by Th104; ::_thesis: verum end; end; end; theorem :: FINSEQ_3:111 for m, n, k being Nat for f being FinSequence st len f = m + 1 & n in dom f & n <= k & k <= m holds (Del (f,n)) . k = f . (k + 1) proof let m, n, k be Nat; ::_thesis: for f being FinSequence st len f = m + 1 & n in dom f & n <= k & k <= m holds (Del (f,n)) . k = f . (k + 1) let f be FinSequence; ::_thesis: ( len f = m + 1 & n in dom f & n <= k & k <= m implies (Del (f,n)) . k = f . (k + 1) ) assume that A1: len f = m + 1 and A2: n in dom f and A3: n <= k and A4: k <= m ; ::_thesis: (Del (f,n)) . k = f . (k + 1) set X = (dom f) \ {n}; A5: dom f = Seg (len f) by FINSEQ_1:def_3; then (dom f) \ {n} c= Seg (len f) by XBOOLE_1:36; then rng (Sgm ((dom f) \ {n})) = (dom f) \ {n} by FINSEQ_1:def_13; then A6: dom (f * (Sgm ((dom f) \ {n}))) = dom (Sgm ((dom f) \ {n})) by RELAT_1:27, XBOOLE_1:36; A7: len (Sgm ((dom f) \ {n})) = m by A1, A2, A5, Th107; A8: dom (Sgm ((dom f) \ {n})) = Seg (len (Sgm ((dom f) \ {n}))) by FINSEQ_1:def_3; 1 <= n by A2, Th25; then 1 <= k by A3, XXREAL_0:2; then A9: k in Seg m by A4, FINSEQ_1:1; then ( n <= k & k <= m implies (Sgm ((dom f) \ {n})) . k = k + 1 ) by A1, A2, A5, Th108; hence (Del (f,n)) . k = f . (k + 1) by A3, A4, A9, A8, A6, A7, FUNCT_1:12; ::_thesis: verum end; theorem Th112: :: FINSEQ_3:112 for k, n being Nat for f being FinSequence st k <= n holds (f | n) . k = f . k proof let k, n be Nat; ::_thesis: for f being FinSequence st k <= n holds (f | n) . k = f . k let f be FinSequence; ::_thesis: ( k <= n implies (f | n) . k = f . k ) assume A1: k <= n ; ::_thesis: (f | n) . k = f . k percases ( k = 0 or 1 <= k ) by NAT_1:14; supposeA2: k = 0 ; ::_thesis: (f | n) . k = f . k then A3: not k in dom f by Th25; not k in dom (f | n) by A2, Th25; hence (f | n) . k = {} by FUNCT_1:def_2 .= f . k by A3, FUNCT_1:def_2 ; ::_thesis: verum end; suppose 1 <= k ; ::_thesis: (f | n) . k = f . k then k in Seg n by A1, FINSEQ_1:1; then (f | (Seg n)) . k = f . k by FUNCT_1:49; hence (f | n) . k = f . k by FINSEQ_1:def_15; ::_thesis: verum end; end; end; theorem :: FINSEQ_3:113 for p, q being FinSequence st p c= q holds q | (len p) = p proof let p, q be FinSequence; ::_thesis: ( p c= q implies q | (len p) = p ) assume A1: p c= q ; ::_thesis: q | (len p) = p A2: for k being Nat st k in dom p holds p . k = (q | (len p)) . k proof let k be Nat; ::_thesis: ( k in dom p implies p . k = (q | (len p)) . k ) assume A3: k in dom p ; ::_thesis: p . k = (q | (len p)) . k then A4: k <= len p by Th25; thus p . k = q . k by A1, A3, GRFUNC_1:2 .= (q | (len p)) . k by A4, Th112 ; ::_thesis: verum end; len p <= len q by A1, FINSEQ_1:63; then len (q | (len p)) = len p by FINSEQ_1:59; then dom (q | (len p)) = dom p by Th29; hence q | (len p) = p by A2, FINSEQ_1:13; ::_thesis: verum end; theorem Th114: :: FINSEQ_3:114 for A being set for F being FinSequence holds (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))) is Permutation of (dom F) proof let A be set ; ::_thesis: for F being FinSequence holds (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))) is Permutation of (dom F) let F be FinSequence; ::_thesis: (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))) is Permutation of (dom F) A1: dom F = Seg (len F) by FINSEQ_1:def_3; set p = (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))); A misses (rng F) \ A by XBOOLE_1:79; then A2: A /\ ((rng F) \ A) = {} by XBOOLE_0:def_7; A3: (F " A) /\ (F " ((rng F) \ A)) = F " (A /\ ((rng F) \ A)) by FUNCT_1:68 .= {} by A2 ; then A4: F " A misses F " ((rng F) \ A) by XBOOLE_0:def_7; A5: F " ((rng F) \ A) c= dom F by RELAT_1:132; then A6: F " ((rng F) \ A) c= Seg (len F) by FINSEQ_1:def_3; then A7: Sgm (F " ((rng F) \ A)) is one-to-one by Lm1; A8: F " A c= dom F by RELAT_1:132; then A9: F " A c= Seg (len F) by FINSEQ_1:def_3; then (rng (Sgm (F " A))) /\ (rng (Sgm (F " ((rng F) \ A)))) = (F " A) /\ (rng (Sgm (F " ((rng F) \ A)))) by FINSEQ_1:def_13 .= {} by A6, A3, FINSEQ_1:def_13 ; then A10: rng (Sgm (F " A)) misses rng (Sgm (F " ((rng F) \ A))) by XBOOLE_0:def_7; A11: rng ((Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A)))) = (rng (Sgm (F " A))) \/ (rng (Sgm (F " ((rng F) \ A)))) by FINSEQ_1:31 .= (F " A) \/ (rng (Sgm (F " ((rng F) \ A)))) by A9, FINSEQ_1:def_13 .= (F " A) \/ (F " ((rng F) \ A)) by A6, FINSEQ_1:def_13 .= F " (A \/ ((rng F) \ A)) by RELAT_1:140 .= F " ((rng F) \/ A) by XBOOLE_1:39 .= (F " (rng F)) \/ (F " A) by RELAT_1:140 .= (dom F) \/ (F " A) by RELAT_1:134 .= dom F by RELAT_1:132, XBOOLE_1:12 ; Sgm (F " A) is one-to-one by A9, Lm1; then A12: (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))) is one-to-one by A7, A10, Th91; len ((Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A)))) = (len (Sgm (F " A))) + (len (Sgm (F " ((rng F) \ A)))) by FINSEQ_1:22 .= (card (F " A)) + (len (Sgm (F " ((rng F) \ A)))) by A9, Th39 .= (card (F " A)) + (card (F " ((rng F) \ A))) by A6, Th39 .= card ((F " A) \/ (F " ((rng F) \ A))) by A4, CARD_2:40 .= len (Sgm ((F " A) \/ (F " ((rng F) \ A)))) by A1, A8, A5, Th39, XBOOLE_1:8 .= len (Sgm (F " (A \/ ((rng F) \ A)))) by RELAT_1:140 .= len (Sgm (F " ((rng F) \/ A))) by XBOOLE_1:39 .= len (Sgm ((F " (rng F)) \/ (F " A))) by RELAT_1:140 .= len (Sgm ((dom F) \/ (F " A))) by RELAT_1:134 .= len (Sgm (dom F)) by RELAT_1:132, XBOOLE_1:12 .= card (Seg (len F)) by A1, Th39 .= len F by FINSEQ_1:57 ; then dom ((Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A)))) = dom F by Th29; then (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))) is Function of (dom F),(dom F) by A11, FUNCT_2:1; hence (Sgm (F " A)) ^ (Sgm (F " ((rng F) \ A))) is Permutation of (dom F) by A12, A11, FUNCT_2:57; ::_thesis: verum end; theorem :: FINSEQ_3:115 for F being FinSequence for A being Subset of (rng F) ex p being Permutation of (dom F) st (F - (A `)) ^ (F - A) = F * p proof let F be FinSequence; ::_thesis: for A being Subset of (rng F) ex p being Permutation of (dom F) st (F - (A `)) ^ (F - A) = F * p let A be Subset of (rng F); ::_thesis: ex p being Permutation of (dom F) st (F - (A `)) ^ (F - A) = F * p set F1 = F - (A `); set F2 = F - A; A ` = (rng F) \ A by SUBSET_1:def_4; then F " (A `) misses F " A by FUNCT_1:71, XBOOLE_1:79; then (card (F " (A `))) + (card (F " A)) = card ((F " (A `)) \/ (F " A)) by CARD_2:40 .= card (F " ((A `) \/ A)) by RELAT_1:140 .= card (F " ([#] (rng F))) by SUBSET_1:10 .= card (F " (rng F)) by SUBSET_1:def_3 .= card (dom F) by RELAT_1:134 .= len F by CARD_1:62 ; then A1: len F = ((len F) - (card (F " (A `)))) + ((len F) - (card (F " A))) .= (len (F - (A `))) + ((len F) - (card (F " A))) by Th59 .= (len (F - (A `))) + (len (F - A)) by Th59 ; (rng F) \ (rng (F - (A `))) = (rng F) \ ((rng F) \ (A `)) by Th65 .= (rng F) \ ((rng F) \ ((rng F) \ A)) by SUBSET_1:def_4 .= (rng F) \ ((rng F) /\ A) by XBOOLE_1:48 .= (rng F) \ A by XBOOLE_1:47 .= rng (F - A) by Th65 ; then reconsider p = (Sgm (F " (rng (F - (A `))))) ^ (Sgm (F " (rng (F - A)))) as Permutation of (dom F) by Th114; reconsider F3 = F * p as FinSequence by FINSEQ_2:40; take p ; ::_thesis: (F - (A `)) ^ (F - A) = F * p A2: now__::_thesis:_for_k_being_Element_of_NAT_st_k_in_dom_(F_-_(A_`))_holds_ (F_*_p)_._k_=_(F_-_(A_`))_._k A3: F " (A `) = F " ((rng F) \ A) by SUBSET_1:def_4 .= (F " (rng F)) \ (F " A) by FUNCT_1:69 .= (dom F) \ (F " A) by RELAT_1:134 ; A4: F " (rng F) = dom F by RELAT_1:134; then A5: card ((F " (rng F)) \ (F " (A `))) = (card (F " (rng F))) - (card (F " (A `))) by A3, CARD_2:44, XBOOLE_1:36 .= (card (Seg (len F))) - (card (F " (A `))) by A4, FINSEQ_1:def_3 .= (len F) - (card (F " (A `))) by FINSEQ_1:57 .= len (F - (A `)) by Th59 ; F " (rng (F - (A `))) c= dom F by RELAT_1:132; then A6: F " (rng (F - (A `))) c= Seg (len F) by FINSEQ_1:def_3; let k be Element of NAT ; ::_thesis: ( k in dom (F - (A `)) implies (F * p) . k = (F - (A `)) . k ) assume A7: k in dom (F - (A `)) ; ::_thesis: (F * p) . k = (F - (A `)) . k A8: dom (Sgm (F " (rng (F - (A `))))) = Seg (len (Sgm (F " (rng (F - (A `)))))) by FINSEQ_1:def_3 .= Seg (card (F " (rng (F - (A `))))) by A6, Th39 .= Seg (card (F " ((rng F) \ (A `)))) by Th65 .= Seg (len (F - (A `))) by A5, FUNCT_1:69 .= dom (F - (A `)) by FINSEQ_1:def_3 ; dom (Sgm (F " (rng (F - (A `))))) c= dom p by FINSEQ_1:26; hence (F * p) . k = F . (p . k) by A7, A8, FUNCT_1:13 .= F . ((Sgm (F " (rng (F - (A `))))) . k) by A7, A8, FINSEQ_1:def_7 .= (F * (Sgm (F " (rng (F - (A `)))))) . k by A7, A8, FUNCT_1:13 .= (F * (Sgm (F " ((rng F) \ (A `))))) . k by Th65 .= (F * (Sgm (F " ((rng F) \ ((rng F) \ A))))) . k by SUBSET_1:def_4 .= (F * (Sgm (F " ((rng F) /\ A)))) . k by XBOOLE_1:48 .= (F * (Sgm ((F " (rng F)) /\ (F " A)))) . k by FUNCT_1:68 .= (F * (Sgm ((dom F) /\ (F " A)))) . k by RELAT_1:134 .= (F - (A `)) . k by A3, XBOOLE_1:48 ; ::_thesis: verum end; A9: now__::_thesis:_for_k_being_Element_of_NAT_st_k_in_dom_(F_-_A)_holds_ (F_*_p)_._((len_(F_-_(A_`)))_+_k)_=_(F_-_A)_._k A10: F " (rng F) = dom F by RELAT_1:134; F " A c= dom F by RELAT_1:132; then F " A c= F " (rng F) by RELAT_1:134; then A11: card ((F " (rng F)) \ (F " A)) = (card (F " (rng F))) - (card (F " A)) by CARD_2:44 .= (card (Seg (len F))) - (card (F " A)) by A10, FINSEQ_1:def_3 .= (len F) - (card (F " A)) by FINSEQ_1:57 .= len (F - A) by Th59 ; dom F = Seg (len F) by FINSEQ_1:def_3; then len (Sgm (F " (rng (F - A)))) = card (F " (rng (F - A))) by Th39, RELAT_1:132 .= card (F " ((rng F) \ A)) by Th65 .= len (F - A) by A11, FUNCT_1:69 ; then A12: dom (Sgm (F " (rng (F - A)))) = dom (F - A) by Th29; A13: F " (rng F) = dom F by RELAT_1:134; F " (A `) = F " ((rng F) \ A) by SUBSET_1:def_4 .= (F " (rng F)) \ (F " A) by FUNCT_1:69 .= (dom F) \ (F " A) by RELAT_1:134 ; then A14: card ((F " (rng F)) \ (F " (A `))) = (card (F " (rng F))) - (card (F " (A `))) by A13, CARD_2:44, XBOOLE_1:36 .= (card (Seg (len F))) - (card (F " (A `))) by A13, FINSEQ_1:def_3 .= (len F) - (card (F " (A `))) by FINSEQ_1:57 .= len (F - (A `)) by Th59 ; let k be Element of NAT ; ::_thesis: ( k in dom (F - A) implies (F * p) . ((len (F - (A `))) + k) = (F - A) . k ) assume A15: k in dom (F - A) ; ::_thesis: (F * p) . ((len (F - (A `))) + k) = (F - A) . k F " (rng (F - (A `))) c= dom F by RELAT_1:132; then F " (rng (F - (A `))) c= Seg (len F) by FINSEQ_1:def_3; then A16: len (Sgm (F " (rng (F - (A `))))) = card (F " (rng (F - (A `)))) by Th39 .= card (F " ((rng F) \ (A `))) by Th65 .= len (F - (A `)) by A14, FUNCT_1:69 ; then (len (F - (A `))) + k in dom p by A15, A12, FINSEQ_1:28; hence (F * p) . ((len (F - (A `))) + k) = F . (p . ((len (F - (A `))) + k)) by FUNCT_1:13 .= F . ((Sgm (F " (rng (F - A)))) . k) by A15, A12, A16, FINSEQ_1:def_7 .= (F * (Sgm (F " (rng (F - A))))) . k by A15, A12, FUNCT_1:13 .= (F * (Sgm (F " ((rng F) \ A)))) . k by Th65 .= (F * (Sgm ((F " (rng F)) \ (F " A)))) . k by FUNCT_1:69 .= (F - A) . k by RELAT_1:134 ; ::_thesis: verum end; len F3 = (len (F - (A `))) + (len (F - A)) by A1, FINSEQ_2:44; hence (F - (A `)) ^ (F - A) = F * p by A2, A9, Th38; ::_thesis: verum end; theorem :: FINSEQ_3:116 for f being FinSubsequence st f is FinSequence holds Seq f = f proof let f be FinSubsequence; ::_thesis: ( f is FinSequence implies Seq f = f ) assume f is FinSequence ; ::_thesis: Seq f = f then reconsider ss9 = f as FinSequence ; consider k being Nat such that A1: dom ss9 = Seg k by FINSEQ_1:def_2; k in NAT by ORDINAL1:def_12; then A2: len ss9 <= k by A1, FINSEQ_1:def_3; Seq f = f * (Sgm (Seg k)) by A1, FINSEQ_1:def_14 .= f * (idseq k) by Th48 .= f by A2, FINSEQ_2:54 ; hence Seq f = f ; ::_thesis: verum end; theorem :: FINSEQ_3:117 for t being FinSequence of INT holds t is FinSequence of REAL proof let t be FinSequence of INT ; ::_thesis: t is FinSequence of REAL now__::_thesis:_for_i_being_Nat_st_i_in_dom_t_holds_ t_._i_in_REAL let i be Nat; ::_thesis: ( i in dom t implies t . i in REAL ) assume i in dom t ; ::_thesis: t . i in REAL then A1: t . i in rng t by FUNCT_1:def_3; t . i in INT by A1; hence t . i in REAL by NUMBERS:15; ::_thesis: verum end; hence t is FinSequence of REAL by FINSEQ_2:12; ::_thesis: verum end; theorem :: FINSEQ_3:118 for p, q being FinSequence holds ( len p < len q iff dom p c< dom q ) proof let p, q be FinSequence; ::_thesis: ( len p < len q iff dom p c< dom q ) A1: ( len p = len q iff dom p = dom q ) by Th29; ( len p <= len q iff dom p c= dom q ) by Th30; hence ( len p < len q iff dom p c< dom q ) by A1, XBOOLE_0:def_8, XXREAL_0:1; ::_thesis: verum end; theorem Th119: :: FINSEQ_3:119 for A being set for i being Nat holds ( ( i <> 0 & A = {} ) iff i -tuples_on A = {} ) proof let A be set ; ::_thesis: for i being Nat holds ( ( i <> 0 & A = {} ) iff i -tuples_on A = {} ) let i be Nat; ::_thesis: ( ( i <> 0 & A = {} ) iff i -tuples_on A = {} ) hereby ::_thesis: ( i -tuples_on A = {} implies ( i <> 0 & A = {} ) ) assume i <> 0 ; ::_thesis: ( A = {} implies not i -tuples_on A <> {} ) then A1: 0 + 1 <= i by NAT_1:13; assume that A2: A = {} and A3: i -tuples_on A <> {} ; ::_thesis: contradiction reconsider B = i -tuples_on A as non empty FinSequenceSet of A by A3; set p = the Element of B; ( B = { s where s is Element of A * : len s = i } & the Element of B in B ) ; then ex s being Element of A * st ( the Element of B = s & len s = i ) ; then 1 in dom the Element of B by A1, Th25; then A4: rng the Element of B <> {} by RELAT_1:42; thus contradiction by A2, A4; ::_thesis: verum end; assume that A5: i -tuples_on A = {} and A6: ( i = 0 or A <> {} ) ; ::_thesis: contradiction len (<*> A) = 0 ; then reconsider A = A as non empty set by A5, A6, FINSEQ_2:133; not i -tuples_on A is empty ; hence contradiction by A5; ::_thesis: verum end; registration let i be Nat; let D be set ; clusteri -tuples_on D -> with_common_domain ; coherence i -tuples_on D is with_common_domain proof set S = i -tuples_on D; let f, g be Function; :: according to CARD_3:def_10 ::_thesis: ( not f in i -tuples_on D or not g in i -tuples_on D or dom f = dom g ) assume that A1: f in i -tuples_on D and A2: g in i -tuples_on D ; ::_thesis: dom f = dom g A3: ex s being Element of D * st ( f = s & len s = i ) by A1; ex s being Element of D * st ( g = s & len s = i ) by A2; hence dom f = dom g by A3, Th29; ::_thesis: verum end; end; registration let i be Nat; let D be set ; clusteri -tuples_on D -> product-like ; coherence i -tuples_on D is product-like proof set S = i -tuples_on D; percases ( ( D = {} & i = 0 ) or ( D = {} & i <> 0 ) or D <> {} ) ; suppose ( D = {} & i = 0 ) ; ::_thesis: i -tuples_on D is product-like then i -tuples_on D = {(<*> D)} by FINSEQ_2:94 .= {{}} ; hence i -tuples_on D is product-like by CARD_3:10; ::_thesis: verum end; suppose ( D = {} & i <> 0 ) ; ::_thesis: i -tuples_on D is product-like then A1: i -tuples_on D = {} by Th119; take f = 0 .--> {}; :: according to CARD_3:def_13 ::_thesis: i -tuples_on D = product f rng f = {{}} by FUNCOP_1:8; then {} in rng f by TARSKI:def_1; hence i -tuples_on D = product f by A1, CARD_3:26; ::_thesis: verum end; suppose D <> {} ; ::_thesis: i -tuples_on D is product-like then reconsider D = D as non empty set ; set S = i -tuples_on D; take product" (i -tuples_on D) ; :: according to CARD_3:def_13 ::_thesis: i -tuples_on D = product (product" (i -tuples_on D)) i -tuples_on D = product (product" (i -tuples_on D)) proof thus i -tuples_on D c= product (product" (i -tuples_on D)) by CARD_3:77; :: according to XBOOLE_0:def_10 ::_thesis: product (product" (i -tuples_on D)) c= i -tuples_on D let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in product (product" (i -tuples_on D)) or x in i -tuples_on D ) assume x in product (product" (i -tuples_on D)) ; ::_thesis: x in i -tuples_on D then consider g being Function such that A2: x = g and A3: dom g = dom (product" (i -tuples_on D)) and A4: for z being set st z in dom (product" (i -tuples_on D)) holds g . z in (product" (i -tuples_on D)) . z by CARD_3:def_5; set s = the Element of i -tuples_on D; the Element of i -tuples_on D in i -tuples_on D ; then consider t being Element of D * such that A5: the Element of i -tuples_on D = t and A6: len t = i ; A7: dom g = DOM (i -tuples_on D) by A3, CARD_3:def_12 .= dom the Element of i -tuples_on D by CARD_3:108 ; dom the Element of i -tuples_on D = Seg (len t) by A5, FINSEQ_1:def_3; then A8: g is FinSequence by A7, FINSEQ_1:def_2; rng g c= D proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng g or y in D ) assume y in rng g ; ::_thesis: y in D then consider a being set such that A9: a in dom g and A10: g . a = y by FUNCT_1:def_3; g . a in (product" (i -tuples_on D)) . a by A3, A4, A9; then g . a in pi ((i -tuples_on D),a) by A3, A9, CARD_3:def_12; then consider f being Function such that A11: f in i -tuples_on D and A12: g . a = f . a by CARD_3:def_6; consider w being Element of D * such that A13: f = w and len w = i by A11; dom g = dom w by A7, A11, A13, CARD_3:def_10; then A14: w . a in rng w by A9, FUNCT_1:def_3; thus y in D by A10, A12, A13, A14; ::_thesis: verum end; then reconsider g = g as FinSequence of D by A8, FINSEQ_1:def_4; A15: g in D * by FINSEQ_1:def_11; len g = i by A5, A6, A7, Th29; hence x in i -tuples_on D by A2, A15; ::_thesis: verum end; hence i -tuples_on D = product (product" (i -tuples_on D)) ; ::_thesis: verum end; end; end; end; begin theorem :: FINSEQ_3:120 for D1, D2 being non empty set for p being FinSequence of D1 for f being Function of D1,D2 holds ( dom (f * p) = dom p & len (f * p) = len p & ( for n being Nat st n in dom (f * p) holds (f * p) . n = f . (p . n) ) ) proof let D1, D2 be non empty set ; ::_thesis: for p being FinSequence of D1 for f being Function of D1,D2 holds ( dom (f * p) = dom p & len (f * p) = len p & ( for n being Nat st n in dom (f * p) holds (f * p) . n = f . (p . n) ) ) let p be FinSequence of D1; ::_thesis: for f being Function of D1,D2 holds ( dom (f * p) = dom p & len (f * p) = len p & ( for n being Nat st n in dom (f * p) holds (f * p) . n = f . (p . n) ) ) let f be Function of D1,D2; ::_thesis: ( dom (f * p) = dom p & len (f * p) = len p & ( for n being Nat st n in dom (f * p) holds (f * p) . n = f . (p . n) ) ) A1: ( rng p c= D1 & dom f = D1 ) by FUNCT_2:def_1; hence dom (f * p) = dom p by RELAT_1:27; ::_thesis: ( len (f * p) = len p & ( for n being Nat st n in dom (f * p) holds (f * p) . n = f . (p . n) ) ) dom (f * p) = dom p by A1, RELAT_1:27; hence len (f * p) = len p by Th29; ::_thesis: for n being Nat st n in dom (f * p) holds (f * p) . n = f . (p . n) let n be Nat; ::_thesis: ( n in dom (f * p) implies (f * p) . n = f . (p . n) ) assume n in dom (f * p) ; ::_thesis: (f * p) . n = f . (p . n) hence (f * p) . n = f . (p . n) by FUNCT_1:12; ::_thesis: verum end; definition let D be non empty set ; let R be Relation of D; func ExtendRel R -> Relation of (D *) means :Def3: :: FINSEQ_3:def 3 for x, y being FinSequence of D holds ( [x,y] in it iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ); existence ex b1 being Relation of (D *) st for x, y being FinSequence of D holds ( [x,y] in b1 iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) proof defpred S1[ set , set ] means for a, b being FinSequence of D st a = $1 & b = $2 holds ( len a = len b & ( for n being Element of NAT st n in dom a holds [(a . n),(b . n)] in R ) ); consider P being Relation of (D *),(D *) such that A1: for x, y being set holds ( [x,y] in P iff ( x in D * & y in D * & S1[x,y] ) ) from RELSET_1:sch_1(); take P ; ::_thesis: for x, y being FinSequence of D holds ( [x,y] in P iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) let a, b be FinSequence of D; ::_thesis: ( [a,b] in P iff ( len a = len b & ( for n being Element of NAT st n in dom a holds [(a . n),(b . n)] in R ) ) ) thus ( [a,b] in P implies ( len a = len b & ( for n being Element of NAT st n in dom a holds [(a . n),(b . n)] in R ) ) ) by A1; ::_thesis: ( len a = len b & ( for n being Element of NAT st n in dom a holds [(a . n),(b . n)] in R ) implies [a,b] in P ) assume ( len a = len b & ( for n being Element of NAT st n in dom a holds [(a . n),(b . n)] in R ) ) ; ::_thesis: [a,b] in P then A2: S1[a,b] ; ( a in D * & b in D * ) by FINSEQ_1:def_11; hence [a,b] in P by A1, A2; ::_thesis: verum end; uniqueness for b1, b2 being Relation of (D *) st ( for x, y being FinSequence of D holds ( [x,y] in b1 iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) ) & ( for x, y being FinSequence of D holds ( [x,y] in b2 iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) ) holds b1 = b2 proof let P, Q be Relation of (D *); ::_thesis: ( ( for x, y being FinSequence of D holds ( [x,y] in P iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) ) & ( for x, y being FinSequence of D holds ( [x,y] in Q iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) ) implies P = Q ) assume that A3: for x, y being FinSequence of D holds ( [x,y] in P iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) and A4: for x, y being FinSequence of D holds ( [x,y] in Q iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) ; ::_thesis: P = Q for a, b being set holds ( [a,b] in P iff [a,b] in Q ) proof let a, b be set ; ::_thesis: ( [a,b] in P iff [a,b] in Q ) thus ( [a,b] in P implies [a,b] in Q ) ::_thesis: ( [a,b] in Q implies [a,b] in P ) proof assume A5: [a,b] in P ; ::_thesis: [a,b] in Q then reconsider a1 = a, b1 = b as Element of D * by ZFMISC_1:87; ( len a1 = len b1 & ( for n being Element of NAT st n in dom a1 holds [(a1 . n),(b1 . n)] in R ) ) by A3, A5; hence [a,b] in Q by A4; ::_thesis: verum end; assume A6: [a,b] in Q ; ::_thesis: [a,b] in P then reconsider a1 = a, b1 = b as Element of D * by ZFMISC_1:87; ( len a1 = len b1 & ( for n being Element of NAT st n in dom a1 holds [(a1 . n),(b1 . n)] in R ) ) by A4, A6; hence [a,b] in P by A3; ::_thesis: verum end; hence P = Q by RELAT_1:def_2; ::_thesis: verum end; end; :: deftheorem Def3 defines ExtendRel FINSEQ_3:def_3_:_ for D being non empty set for R being Relation of D for b3 being Relation of (D *) holds ( b3 = ExtendRel R iff for x, y being FinSequence of D holds ( [x,y] in b3 iff ( len x = len y & ( for n being Element of NAT st n in dom x holds [(x . n),(y . n)] in R ) ) ) ); theorem :: FINSEQ_3:121 for D being non empty set holds ExtendRel (id D) = id (D *) proof let D be non empty set ; ::_thesis: ExtendRel (id D) = id (D *) set P = ExtendRel (id D); set Q = id (D *); for a, b being set holds ( [a,b] in ExtendRel (id D) iff [a,b] in id (D *) ) proof let a, b be set ; ::_thesis: ( [a,b] in ExtendRel (id D) iff [a,b] in id (D *) ) thus ( [a,b] in ExtendRel (id D) implies [a,b] in id (D *) ) ::_thesis: ( [a,b] in id (D *) implies [a,b] in ExtendRel (id D) ) proof assume A1: [a,b] in ExtendRel (id D) ; ::_thesis: [a,b] in id (D *) then reconsider a1 = a, b1 = b as Element of D * by ZFMISC_1:87; A2: now__::_thesis:_for_n_being_Nat_st_n_in_dom_a1_holds_ a1_._n_=_b1_._n let n be Nat; ::_thesis: ( n in dom a1 implies a1 . n = b1 . n ) assume n in dom a1 ; ::_thesis: a1 . n = b1 . n then [(a1 . n),(b1 . n)] in id D by A1, Def3; hence a1 . n = b1 . n by RELAT_1:def_10; ::_thesis: verum end; len a1 = len b1 by A1, Def3; then a1 = b1 by A2, FINSEQ_2:9; hence [a,b] in id (D *) by RELAT_1:def_10; ::_thesis: verum end; assume A3: [a,b] in id (D *) ; ::_thesis: [a,b] in ExtendRel (id D) then reconsider a1 = a, b1 = b as Element of D * by ZFMISC_1:87; A4: a1 = b1 by A3, RELAT_1:def_10; A5: for n being Element of NAT st n in dom a1 holds [(a1 . n),(b1 . n)] in id D proof let n be Element of NAT ; ::_thesis: ( n in dom a1 implies [(a1 . n),(b1 . n)] in id D ) assume n in dom a1 ; ::_thesis: [(a1 . n),(b1 . n)] in id D then a1 . n in D by FINSEQ_2:11; hence [(a1 . n),(b1 . n)] in id D by A4, RELAT_1:def_10; ::_thesis: verum end; len a1 = len b1 by A3, RELAT_1:def_10; hence [a,b] in ExtendRel (id D) by A5, Def3; ::_thesis: verum end; hence ExtendRel (id D) = id (D *) by RELAT_1:def_2; ::_thesis: verum end; definition let D be non empty set ; let R be Equivalence_Relation of D; let y be FinSequence of Class R; let x be FinSequence of D; predx is_representatives_FS y means :: FINSEQ_3:def 4 ( len x = len y & ( for n being Element of NAT st n in dom x holds Class (R,(x . n)) = y . n ) ); end; :: deftheorem defines is_representatives_FS FINSEQ_3:def_4_:_ for D being non empty set for R being Equivalence_Relation of D for y being FinSequence of Class R for x being FinSequence of D holds ( x is_representatives_FS y iff ( len x = len y & ( for n being Element of NAT st n in dom x holds Class (R,(x . n)) = y . n ) ) ); theorem :: FINSEQ_3:122 for D being non empty set for R being Equivalence_Relation of D for y being FinSequence of Class R ex x being FinSequence of D st x is_representatives_FS y proof let D be non empty set ; ::_thesis: for R being Equivalence_Relation of D for y being FinSequence of Class R ex x being FinSequence of D st x is_representatives_FS y let R be Equivalence_Relation of D; ::_thesis: for y being FinSequence of Class R ex x being FinSequence of D st x is_representatives_FS y let y be FinSequence of Class R; ::_thesis: ex x being FinSequence of D st x is_representatives_FS y defpred S1[ set , set ] means for u being Element of D st $2 = u holds Class (R,u) = y . $1; A1: for e being set st e in dom y holds ex u being set st ( u in D & S1[e,u] ) proof let e be set ; ::_thesis: ( e in dom y implies ex u being set st ( u in D & S1[e,u] ) ) assume e in dom y ; ::_thesis: ex u being set st ( u in D & S1[e,u] ) then y . e in rng y by FUNCT_1:def_3; then consider a being Element of D such that A2: y . e = Class (R,a) by EQREL_1:36; reconsider b = a as set ; take b ; ::_thesis: ( b in D & S1[e,b] ) thus b in D ; ::_thesis: S1[e,b] let u be Element of D; ::_thesis: ( b = u implies Class (R,u) = y . e ) assume b = u ; ::_thesis: Class (R,u) = y . e hence Class (R,u) = y . e by A2; ::_thesis: verum end; consider f being Function such that A3: ( dom f = dom y & rng f c= D & ( for e being set st e in dom y holds S1[e,f . e] ) ) from FUNCT_1:sch_5(A1); dom f = Seg (len y) by A3, FINSEQ_1:def_3; then reconsider f = f as FinSequence by FINSEQ_1:def_2; reconsider f = f as FinSequence of D by A3, FINSEQ_1:def_4; take f ; ::_thesis: f is_representatives_FS y thus len f = len y by A3, Th29; :: according to FINSEQ_3:def_4 ::_thesis: for n being Element of NAT st n in dom f holds Class (R,(f . n)) = y . n let n be Element of NAT ; ::_thesis: ( n in dom f implies Class (R,(f . n)) = y . n ) assume A4: n in dom f ; ::_thesis: Class (R,(f . n)) = y . n then f . n in rng f by FUNCT_1:def_3; then reconsider u = f . n as Element of D ; Class (R,u) = y . n by A3, A4; hence Class (R,(f . n)) = y . n ; ::_thesis: verum end; theorem Th123: :: FINSEQ_3:123 for x, X being set holds ( x in product <*X*> iff ex y being set st ( y in X & x = <*y*> ) ) proof let x, X be set ; ::_thesis: ( x in product <*X*> iff ex y being set st ( y in X & x = <*y*> ) ) A1: dom <*X*> = Seg 1 by FINSEQ_1:def_8; A2: <*X*> . 1 = X by FINSEQ_1:def_8; A3: 1 in Seg 1 by FINSEQ_1:2, TARSKI:def_1; thus ( x in product <*X*> implies ex y being set st ( y in X & x = <*y*> ) ) ::_thesis: ( ex y being set st ( y in X & x = <*y*> ) implies x in product <*X*> ) proof assume x in product <*X*> ; ::_thesis: ex y being set st ( y in X & x = <*y*> ) then consider f being Function such that A4: x = f and A5: dom f = dom <*X*> and A6: for x being set st x in dom <*X*> holds f . x in <*X*> . x by CARD_3:def_5; reconsider f = f as FinSequence by A1, A5, FINSEQ_1:def_2; take f . 1 ; ::_thesis: ( f . 1 in X & x = <*(f . 1)*> ) thus ( f . 1 in X & x = <*(f . 1)*> ) by A1, A3, A2, A4, A5, A6, FINSEQ_1:def_8; ::_thesis: verum end; given y being set such that A7: y in X and A8: x = <*y*> ; ::_thesis: x in product <*X*> A9: now__::_thesis:_for_a_being_set_st_a_in_Seg_1_holds_ <*y*>_._a_in_<*X*>_._a let a be set ; ::_thesis: ( a in Seg 1 implies <*y*> . a in <*X*> . a ) assume a in Seg 1 ; ::_thesis: <*y*> . a in <*X*> . a then a = 1 by FINSEQ_1:2, TARSKI:def_1; hence <*y*> . a in <*X*> . a by A2, A7, FINSEQ_1:def_8; ::_thesis: verum end; dom <*y*> = Seg 1 by FINSEQ_1:def_8; hence x in product <*X*> by A1, A8, A9, CARD_3:def_5; ::_thesis: verum end; theorem Th124: :: FINSEQ_3:124 for z, X, Y being set holds ( z in product <*X,Y*> iff ex x, y being set st ( x in X & y in Y & z = <*x,y*> ) ) proof let z, X, Y be set ; ::_thesis: ( z in product <*X,Y*> iff ex x, y being set st ( x in X & y in Y & z = <*x,y*> ) ) A1: ( <*X,Y*> . 1 = X & <*X,Y*> . 2 = Y ) by FINSEQ_1:44; len <*X,Y*> = 2 by FINSEQ_1:44; then A2: dom <*X,Y*> = Seg 2 by FINSEQ_1:def_3; A3: ( 1 in Seg 2 & 2 in Seg 2 ) by FINSEQ_1:2, TARSKI:def_2; thus ( z in product <*X,Y*> implies ex x, y being set st ( x in X & y in Y & z = <*x,y*> ) ) ::_thesis: ( ex x, y being set st ( x in X & y in Y & z = <*x,y*> ) implies z in product <*X,Y*> ) proof assume z in product <*X,Y*> ; ::_thesis: ex x, y being set st ( x in X & y in Y & z = <*x,y*> ) then consider f being Function such that A4: z = f and A5: dom f = dom <*X,Y*> and A6: for x being set st x in dom <*X,Y*> holds f . x in <*X,Y*> . x by CARD_3:def_5; reconsider f = f as FinSequence by A2, A5, FINSEQ_1:def_2; take f . 1 ; ::_thesis: ex y being set st ( f . 1 in X & y in Y & z = <*(f . 1),y*> ) take f . 2 ; ::_thesis: ( f . 1 in X & f . 2 in Y & z = <*(f . 1),(f . 2)*> ) len f = 2 by A2, A5, FINSEQ_1:def_3; hence ( f . 1 in X & f . 2 in Y & z = <*(f . 1),(f . 2)*> ) by A2, A3, A1, A4, A6, FINSEQ_1:44; ::_thesis: verum end; given x, y being set such that A7: ( x in X & y in Y ) and A8: z = <*x,y*> ; ::_thesis: z in product <*X,Y*> A9: now__::_thesis:_for_a_being_set_st_a_in_Seg_2_holds_ <*x,y*>_._a_in_<*X,Y*>_._a let a be set ; ::_thesis: ( a in Seg 2 implies <*x,y*> . a in <*X,Y*> . a ) assume a in Seg 2 ; ::_thesis: <*x,y*> . a in <*X,Y*> . a then ( a = 1 or a = 2 ) by FINSEQ_1:2, TARSKI:def_2; hence <*x,y*> . a in <*X,Y*> . a by A1, A7, FINSEQ_1:44; ::_thesis: verum end; len <*x,y*> = 2 by FINSEQ_1:44; then dom <*x,y*> = Seg 2 by FINSEQ_1:def_3; hence z in product <*X,Y*> by A2, A8, A9, CARD_3:def_5; ::_thesis: verum end; theorem Th125: :: FINSEQ_3:125 for a, X, Y, Z being set holds ( a in product <*X,Y,Z*> iff ex x, y, z being set st ( x in X & y in Y & z in Z & a = <*x,y,z*> ) ) proof let a, X, Y, Z be set ; ::_thesis: ( a in product <*X,Y,Z*> iff ex x, y, z being set st ( x in X & y in Y & z in Z & a = <*x,y,z*> ) ) A1: 3 in Seg 3 by Th1, ENUMSET1:def_1; A2: ( <*X,Y,Z*> . 1 = X & <*X,Y,Z*> . 2 = Y ) by FINSEQ_1:45; A3: <*X,Y,Z*> . 3 = Z by FINSEQ_1:45; len <*X,Y,Z*> = 3 by FINSEQ_1:45; then A4: dom <*X,Y,Z*> = Seg 3 by FINSEQ_1:def_3; A5: ( 1 in Seg 3 & 2 in Seg 3 ) by Th1, ENUMSET1:def_1; thus ( a in product <*X,Y,Z*> implies ex x, y, z being set st ( x in X & y in Y & z in Z & a = <*x,y,z*> ) ) ::_thesis: ( ex x, y, z being set st ( x in X & y in Y & z in Z & a = <*x,y,z*> ) implies a in product <*X,Y,Z*> ) proof assume a in product <*X,Y,Z*> ; ::_thesis: ex x, y, z being set st ( x in X & y in Y & z in Z & a = <*x,y,z*> ) then consider f being Function such that A6: a = f and A7: dom f = dom <*X,Y,Z*> and A8: for x being set st x in dom <*X,Y,Z*> holds f . x in <*X,Y,Z*> . x by CARD_3:def_5; reconsider f = f as FinSequence by A4, A7, FINSEQ_1:def_2; take f . 1 ; ::_thesis: ex y, z being set st ( f . 1 in X & y in Y & z in Z & a = <*(f . 1),y,z*> ) take f . 2 ; ::_thesis: ex z being set st ( f . 1 in X & f . 2 in Y & z in Z & a = <*(f . 1),(f . 2),z*> ) take f . 3 ; ::_thesis: ( f . 1 in X & f . 2 in Y & f . 3 in Z & a = <*(f . 1),(f . 2),(f . 3)*> ) len f = 3 by A4, A7, FINSEQ_1:def_3; hence ( f . 1 in X & f . 2 in Y & f . 3 in Z & a = <*(f . 1),(f . 2),(f . 3)*> ) by A4, A5, A1, A2, A3, A6, A8, FINSEQ_1:45; ::_thesis: verum end; given x, y, z being set such that A9: ( x in X & y in Y & z in Z ) and A10: a = <*x,y,z*> ; ::_thesis: a in product <*X,Y,Z*> A11: now__::_thesis:_for_a_being_set_st_a_in_Seg_3_holds_ <*x,y,z*>_._a_in_<*X,Y,Z*>_._a let a be set ; ::_thesis: ( a in Seg 3 implies <*x,y,z*> . a in <*X,Y,Z*> . a ) assume a in Seg 3 ; ::_thesis: <*x,y,z*> . a in <*X,Y,Z*> . a then ( a = 1 or a = 2 or a = 3 ) by Th1, ENUMSET1:def_1; hence <*x,y,z*> . a in <*X,Y,Z*> . a by A2, A3, A9, FINSEQ_1:45; ::_thesis: verum end; len <*x,y,z*> = 3 by FINSEQ_1:45; then dom <*x,y,z*> = Seg 3 by FINSEQ_1:def_3; hence a in product <*X,Y,Z*> by A4, A10, A11, CARD_3:def_5; ::_thesis: verum end; theorem :: FINSEQ_3:126 for D being non empty set holds product <*D*> = 1 -tuples_on D proof let D be non empty set ; ::_thesis: product <*D*> = 1 -tuples_on D <*D*> = 1 |-> D by FINSEQ_2:59 .= (Seg 1) --> D ; then product <*D*> = Funcs ((Seg 1),D) by CARD_3:11; hence product <*D*> = 1 -tuples_on D by FINSEQ_2:93; ::_thesis: verum end; theorem Th127: :: FINSEQ_3:127 for D1, D2 being non empty set holds product <*D1,D2*> = { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } proof let D1, D2 be non empty set ; ::_thesis: product <*D1,D2*> = { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } thus product <*D1,D2*> c= { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } :: according to XBOOLE_0:def_10 ::_thesis: { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } c= product <*D1,D2*> proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in product <*D1,D2*> or a in { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } ) assume a in product <*D1,D2*> ; ::_thesis: a in { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } then ex x, y being set st ( x in D1 & y in D2 & a = <*x,y*> ) by Th124; hence a in { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } ; ::_thesis: verum end; let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } or a in product <*D1,D2*> ) assume a in { <*d1,d2*> where d1 is Element of D1, d2 is Element of D2 : verum } ; ::_thesis: a in product <*D1,D2*> then ex d1 being Element of D1 ex d2 being Element of D2 st a = <*d1,d2*> ; hence a in product <*D1,D2*> by Th124; ::_thesis: verum end; theorem :: FINSEQ_3:128 for D being non empty set holds product <*D,D*> = 2 -tuples_on D proof let D be non empty set ; ::_thesis: product <*D,D*> = 2 -tuples_on D thus product <*D,D*> = { <*d1,d2*> where d1, d2 is Element of D : verum } by Th127 .= 2 -tuples_on D by FINSEQ_2:99 ; ::_thesis: verum end; theorem Th129: :: FINSEQ_3:129 for D1, D2, D3 being non empty set holds product <*D1,D2,D3*> = { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } proof let D1, D2, D3 be non empty set ; ::_thesis: product <*D1,D2,D3*> = { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } thus product <*D1,D2,D3*> c= { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } :: according to XBOOLE_0:def_10 ::_thesis: { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } c= product <*D1,D2,D3*> proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in product <*D1,D2,D3*> or a in { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } ) assume a in product <*D1,D2,D3*> ; ::_thesis: a in { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } then ex x, y, z being set st ( x in D1 & y in D2 & z in D3 & a = <*x,y,z*> ) by Th125; hence a in { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } ; ::_thesis: verum end; let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } or a in product <*D1,D2,D3*> ) assume a in { <*d1,d2,d3*> where d1 is Element of D1, d2 is Element of D2, d3 is Element of D3 : verum } ; ::_thesis: a in product <*D1,D2,D3*> then ex d1 being Element of D1 ex d2 being Element of D2 ex d3 being Element of D3 st a = <*d1,d2,d3*> ; hence a in product <*D1,D2,D3*> by Th125; ::_thesis: verum end; theorem :: FINSEQ_3:130 for D being non empty set holds product <*D,D,D*> = 3 -tuples_on D proof let D be non empty set ; ::_thesis: product <*D,D,D*> = 3 -tuples_on D thus product <*D,D,D*> = { <*d1,d2,d3*> where d1, d2, d3 is Element of D : verum } by Th129 .= 3 -tuples_on D by FINSEQ_2:102 ; ::_thesis: verum end; theorem Th131: :: FINSEQ_3:131 for i being Nat for D being set holds product (i |-> D) = i -tuples_on D proof let i be Nat; ::_thesis: for D being set holds product (i |-> D) = i -tuples_on D let D be set ; ::_thesis: product (i |-> D) = i -tuples_on D thus product (i |-> D) = product ((Seg i) --> D) .= Funcs ((Seg i),D) by CARD_3:11 .= i -tuples_on D by FINSEQ_2:93 ; ::_thesis: verum end; theorem Th132: :: FINSEQ_3:132 for f being Function holds ( doms <*f*> = <*(dom f)*> & rngs <*f*> = <*(rng f)*> ) proof let f be Function; ::_thesis: ( doms <*f*> = <*(dom f)*> & rngs <*f*> = <*(rng f)*> ) A1: ( rng <*f*> = {f} & <*f*> " (rng <*f*>) = dom <*f*> ) by FINSEQ_1:38, RELAT_1:134; A2: ( dom (doms <*f*>) = <*f*> " (SubFuncs (rng <*f*>)) & dom <*(dom f)*> = Seg 1 ) by FINSEQ_1:38, FUNCT_6:def_2; A3: <*f*> . 1 = f by FINSEQ_1:40; A4: ( dom <*f*> = Seg 1 & SubFuncs {f} = {f} ) by FINSEQ_1:38, FUNCT_6:20; A5: <*(rng f)*> . 1 = rng f by FINSEQ_1:40; A6: now__::_thesis:_for_x_being_set_st_x_in_{1}_holds_ (rngs_<*f*>)_._x_=_<*(rng_f)*>_._x let x be set ; ::_thesis: ( x in {1} implies (rngs <*f*>) . x = <*(rng f)*> . x ) assume A7: x in {1} ; ::_thesis: (rngs <*f*>) . x = <*(rng f)*> . x then x = 1 by TARSKI:def_1; hence (rngs <*f*>) . x = <*(rng f)*> . x by A1, A3, A5, A4, A7, FINSEQ_1:2, FUNCT_6:def_3; ::_thesis: verum end; A8: <*(dom f)*> . 1 = dom f by FINSEQ_1:40; now__::_thesis:_for_x_being_set_st_x_in_{1}_holds_ (doms_<*f*>)_._x_=_<*(dom_f)*>_._x let x be set ; ::_thesis: ( x in {1} implies (doms <*f*>) . x = <*(dom f)*> . x ) assume A9: x in {1} ; ::_thesis: (doms <*f*>) . x = <*(dom f)*> . x then x = 1 by TARSKI:def_1; hence (doms <*f*>) . x = <*(dom f)*> . x by A1, A3, A8, A4, A9, FINSEQ_1:2, FUNCT_6:def_2; ::_thesis: verum end; hence doms <*f*> = <*(dom f)*> by A1, A2, A4, FINSEQ_1:2, FUNCT_1:2; ::_thesis: rngs <*f*> = <*(rng f)*> ( dom (rngs <*f*>) = <*f*> " (SubFuncs (rng <*f*>)) & dom <*(rng f)*> = Seg 1 ) by FINSEQ_1:38, FUNCT_6:def_3; hence rngs <*f*> = <*(rng f)*> by A1, A4, A6, FINSEQ_1:2, FUNCT_1:2; ::_thesis: verum end; theorem Th133: :: FINSEQ_3:133 for f, g being Function holds ( doms <*f,g*> = <*(dom f),(dom g)*> & rngs <*f,g*> = <*(rng f),(rng g)*> ) proof let f, g be Function; ::_thesis: ( doms <*f,g*> = <*(dom f),(dom g)*> & rngs <*f,g*> = <*(rng f),(rng g)*> ) A1: ( rng <*f,g*> = {f,g} & <*f,g*> " (rng <*f,g*>) = dom <*f,g*> ) by FINSEQ_2:127, RELAT_1:134; A2: ( dom (doms <*f,g*>) = <*f,g*> " (SubFuncs (rng <*f,g*>)) & dom <*(dom f),(dom g)*> = Seg 2 ) by FINSEQ_1:89, FUNCT_6:def_2; A3: ( <*f,g*> . 1 = f & <*f,g*> . 2 = g ) by FINSEQ_1:44; A4: ( dom <*f,g*> = Seg 2 & SubFuncs {f,g} = {f,g} ) by FINSEQ_1:89, FUNCT_6:20; A5: ( <*(rng f),(rng g)*> . 1 = rng f & <*(rng f),(rng g)*> . 2 = rng g ) by FINSEQ_1:44; A6: now__::_thesis:_for_x_being_set_st_x_in_{1,2}_holds_ (rngs_<*f,g*>)_._x_=_<*(rng_f),(rng_g)*>_._x let x be set ; ::_thesis: ( x in {1,2} implies (rngs <*f,g*>) . x = <*(rng f),(rng g)*> . x ) assume A7: x in {1,2} ; ::_thesis: (rngs <*f,g*>) . x = <*(rng f),(rng g)*> . x then ( x = 1 or x = 2 ) by TARSKI:def_2; hence (rngs <*f,g*>) . x = <*(rng f),(rng g)*> . x by A1, A3, A5, A4, A7, FINSEQ_1:2, FUNCT_6:def_3; ::_thesis: verum end; A8: ( <*(dom f),(dom g)*> . 1 = dom f & <*(dom f),(dom g)*> . 2 = dom g ) by FINSEQ_1:44; now__::_thesis:_for_x_being_set_st_x_in_{1,2}_holds_ (doms_<*f,g*>)_._x_=_<*(dom_f),(dom_g)*>_._x let x be set ; ::_thesis: ( x in {1,2} implies (doms <*f,g*>) . x = <*(dom f),(dom g)*> . x ) assume A9: x in {1,2} ; ::_thesis: (doms <*f,g*>) . x = <*(dom f),(dom g)*> . x then ( x = 1 or x = 2 ) by TARSKI:def_2; hence (doms <*f,g*>) . x = <*(dom f),(dom g)*> . x by A1, A3, A8, A4, A9, FINSEQ_1:2, FUNCT_6:def_2; ::_thesis: verum end; hence doms <*f,g*> = <*(dom f),(dom g)*> by A1, A2, A4, FINSEQ_1:2, FUNCT_1:2; ::_thesis: rngs <*f,g*> = <*(rng f),(rng g)*> ( dom (rngs <*f,g*>) = <*f,g*> " (SubFuncs (rng <*f,g*>)) & dom <*(rng f),(rng g)*> = Seg 2 ) by FINSEQ_1:89, FUNCT_6:def_3; hence rngs <*f,g*> = <*(rng f),(rng g)*> by A1, A4, A6, FINSEQ_1:2, FUNCT_1:2; ::_thesis: verum end; theorem :: FINSEQ_3:134 for f, g, h being Function holds ( doms <*f,g,h*> = <*(dom f),(dom g),(dom h)*> & rngs <*f,g,h*> = <*(rng f),(rng g),(rng h)*> ) proof let f, g, h be Function; ::_thesis: ( doms <*f,g,h*> = <*(dom f),(dom g),(dom h)*> & rngs <*f,g,h*> = <*(rng f),(rng g),(rng h)*> ) A1: ( rng <*f,g,h*> = {f,g,h} & <*f,g,h*> " (rng <*f,g,h*>) = dom <*f,g,h*> ) by FINSEQ_2:128, RELAT_1:134; A2: <*(rng f),(rng g),(rng h)*> . 3 = rng h by FINSEQ_1:45; A3: ( <*f,g,h*> . 1 = f & <*f,g,h*> . 2 = g ) by FINSEQ_1:45; A4: <*f,g,h*> . 3 = h by FINSEQ_1:45; A5: ( dom <*f,g,h*> = Seg 3 & SubFuncs {f,g,h} = {f,g,h} ) by FINSEQ_1:89, FUNCT_6:20; A6: ( <*(rng f),(rng g),(rng h)*> . 1 = rng f & <*(rng f),(rng g),(rng h)*> . 2 = rng g ) by FINSEQ_1:45; A7: now__::_thesis:_for_x_being_set_st_x_in_{1,2,3}_holds_ (rngs_<*f,g,h*>)_._x_=_<*(rng_f),(rng_g),(rng_h)*>_._x let x be set ; ::_thesis: ( x in {1,2,3} implies (rngs <*f,g,h*>) . x = <*(rng f),(rng g),(rng h)*> . x ) assume A8: x in {1,2,3} ; ::_thesis: (rngs <*f,g,h*>) . x = <*(rng f),(rng g),(rng h)*> . x then ( x = 1 or x = 2 or x = 3 ) by ENUMSET1:def_1; hence (rngs <*f,g,h*>) . x = <*(rng f),(rng g),(rng h)*> . x by A1, A3, A4, A6, A2, A5, A8, Th1, FUNCT_6:def_3; ::_thesis: verum end; A9: ( dom (doms <*f,g,h*>) = <*f,g,h*> " (SubFuncs (rng <*f,g,h*>)) & dom <*(dom f),(dom g),(dom h)*> = Seg 3 ) by FINSEQ_1:89, FUNCT_6:def_2; A10: <*(dom f),(dom g),(dom h)*> . 3 = dom h by FINSEQ_1:45; A11: ( <*(dom f),(dom g),(dom h)*> . 1 = dom f & <*(dom f),(dom g),(dom h)*> . 2 = dom g ) by FINSEQ_1:45; now__::_thesis:_for_x_being_set_st_x_in_{1,2,3}_holds_ (doms_<*f,g,h*>)_._x_=_<*(dom_f),(dom_g),(dom_h)*>_._x let x be set ; ::_thesis: ( x in {1,2,3} implies (doms <*f,g,h*>) . x = <*(dom f),(dom g),(dom h)*> . x ) assume A12: x in {1,2,3} ; ::_thesis: (doms <*f,g,h*>) . x = <*(dom f),(dom g),(dom h)*> . x then ( x = 1 or x = 2 or x = 3 ) by ENUMSET1:def_1; hence (doms <*f,g,h*>) . x = <*(dom f),(dom g),(dom h)*> . x by A1, A3, A4, A11, A10, A5, A12, Th1, FUNCT_6:def_2; ::_thesis: verum end; hence doms <*f,g,h*> = <*(dom f),(dom g),(dom h)*> by A1, A9, A5, Th1, FUNCT_1:2; ::_thesis: rngs <*f,g,h*> = <*(rng f),(rng g),(rng h)*> ( dom (rngs <*f,g,h*>) = <*f,g,h*> " (SubFuncs (rng <*f,g,h*>)) & dom <*(rng f),(rng g),(rng h)*> = Seg 3 ) by FINSEQ_1:89, FUNCT_6:def_3; hence rngs <*f,g,h*> = <*(rng f),(rng g),(rng h)*> by A1, A5, A7, Th1, FUNCT_1:2; ::_thesis: verum end; theorem Th135: :: FINSEQ_3:135 for X being set holds ( Union <*X*> = X & meet <*X*> = X ) proof let X be set ; ::_thesis: ( Union <*X*> = X & meet <*X*> = X ) thus Union <*X*> = union (rng <*X*>) .= union {X} by FINSEQ_1:38 .= X by ZFMISC_1:25 ; ::_thesis: meet <*X*> = X thus meet <*X*> = meet {X} by FINSEQ_1:38 .= X by SETFAM_1:10 ; ::_thesis: verum end; theorem Th136: :: FINSEQ_3:136 for X, Y being set holds ( Union <*X,Y*> = X \/ Y & meet <*X,Y*> = X /\ Y ) proof let X, Y be set ; ::_thesis: ( Union <*X,Y*> = X \/ Y & meet <*X,Y*> = X /\ Y ) thus Union <*X,Y*> = union (rng <*X,Y*>) .= union {X,Y} by FINSEQ_2:127 .= X \/ Y by ZFMISC_1:75 ; ::_thesis: meet <*X,Y*> = X /\ Y thus meet <*X,Y*> = meet {X,Y} by FINSEQ_2:127 .= X /\ Y by SETFAM_1:11 ; ::_thesis: verum end; theorem :: FINSEQ_3:137 for X, Y, Z being set holds ( Union <*X,Y,Z*> = (X \/ Y) \/ Z & meet <*X,Y,Z*> = (X /\ Y) /\ Z ) proof let X, Y, Z be set ; ::_thesis: ( Union <*X,Y,Z*> = (X \/ Y) \/ Z & meet <*X,Y,Z*> = (X /\ Y) /\ Z ) A1: ( union ({X,Y} \/ {Z}) = (union {X,Y}) \/ (union {Z}) & union {X,Y} = X \/ Y ) by ZFMISC_1:75, ZFMISC_1:78; A2: union {Z} = Z by ZFMISC_1:25; A3: {X,Y} \/ {Z} = {X,Y,Z} by ENUMSET1:3; thus Union <*X,Y,Z*> = union (rng <*X,Y,Z*>) .= (X \/ Y) \/ Z by A1, A2, A3, FINSEQ_2:128 ; ::_thesis: meet <*X,Y,Z*> = (X /\ Y) /\ Z A4: meet {Z} = Z by SETFAM_1:10; ( meet ({X,Y} \/ {Z}) = (meet {X,Y}) /\ (meet {Z}) & meet {X,Y} = X /\ Y ) by SETFAM_1:9, SETFAM_1:11; hence meet <*X,Y,Z*> = (X /\ Y) /\ Z by A4, A3, FINSEQ_2:128; ::_thesis: verum end; theorem :: FINSEQ_3:138 for x being set for f, g, h being Function st x in dom f holds ( <*f*> .. (1,x) = f . x & <*f,g*> .. (1,x) = f . x & <*f,g,h*> .. (1,x) = f . x ) proof let x be set ; ::_thesis: for f, g, h being Function st x in dom f holds ( <*f*> .. (1,x) = f . x & <*f,g*> .. (1,x) = f . x & <*f,g,h*> .. (1,x) = f . x ) let f, g, h be Function; ::_thesis: ( x in dom f implies ( <*f*> .. (1,x) = f . x & <*f,g*> .. (1,x) = f . x & <*f,g,h*> .. (1,x) = f . x ) ) A1: ( <*f,g,h*> . 1 = f & 1 in Seg 1 ) by FINSEQ_1:2, FINSEQ_1:45, TARSKI:def_1; A2: ( dom <*f*> = Seg 1 & dom <*f,g*> = Seg 2 ) by FINSEQ_1:89; A3: ( 1 in Seg 2 & 1 in Seg 3 ) by Th1, ENUMSET1:def_1, FINSEQ_1:2, TARSKI:def_2; A4: dom <*f,g,h*> = Seg 3 by FINSEQ_1:89; ( <*f*> . 1 = f & <*f,g*> . 1 = f ) by FINSEQ_1:44, FINSEQ_1:def_8; hence ( x in dom f implies ( <*f*> .. (1,x) = f . x & <*f,g*> .. (1,x) = f . x & <*f,g,h*> .. (1,x) = f . x ) ) by A1, A3, A2, A4, FUNCT_5:38; ::_thesis: verum end; theorem :: FINSEQ_3:139 for x being set for g, f, h being Function st x in dom g holds ( <*f,g*> .. (2,x) = g . x & <*f,g,h*> .. (2,x) = g . x ) proof let x be set ; ::_thesis: for g, f, h being Function st x in dom g holds ( <*f,g*> .. (2,x) = g . x & <*f,g,h*> .. (2,x) = g . x ) let g, f, h be Function; ::_thesis: ( x in dom g implies ( <*f,g*> .. (2,x) = g . x & <*f,g,h*> .. (2,x) = g . x ) ) A1: ( 2 in Seg 2 & 2 in Seg 3 ) by Th1, ENUMSET1:def_1, FINSEQ_1:2, TARSKI:def_2; A2: ( dom <*f,g*> = Seg 2 & dom <*f,g,h*> = Seg 3 ) by FINSEQ_1:89; ( <*f,g*> . 2 = g & <*f,g,h*> . 2 = g ) by FINSEQ_1:44, FINSEQ_1:45; hence ( x in dom g implies ( <*f,g*> .. (2,x) = g . x & <*f,g,h*> .. (2,x) = g . x ) ) by A1, A2, FUNCT_5:38; ::_thesis: verum end; theorem :: FINSEQ_3:140 for x being set for h, f, g being Function st x in dom h holds <*f,g,h*> .. (3,x) = h . x proof let x be set ; ::_thesis: for h, f, g being Function st x in dom h holds <*f,g,h*> .. (3,x) = h . x let h, f, g be Function; ::_thesis: ( x in dom h implies <*f,g,h*> .. (3,x) = h . x ) A1: dom <*f,g,h*> = Seg 3 by FINSEQ_1:89; ( <*f,g,h*> . 3 = h & 3 in Seg 3 ) by Th1, ENUMSET1:def_1, FINSEQ_1:45; hence ( x in dom h implies <*f,g,h*> .. (3,x) = h . x ) by A1, FUNCT_5:38; ::_thesis: verum end; theorem :: FINSEQ_3:141 for h being Function holds ( dom <:<*h*>:> = dom h & ( for x being set st x in dom h holds <:<*h*>:> . x = <*(h . x)*> ) ) proof let h be Function; ::_thesis: ( dom <:<*h*>:> = dom h & ( for x being set st x in dom h holds <:<*h*>:> . x = <*(h . x)*> ) ) A1: 1 in Seg 1 by FINSEQ_1:2, TARSKI:def_1; A2: ( rng <:<*h*>:> c= product (rngs <*h*>) & rngs <*h*> = <*(rng h)*> ) by Th132, FUNCT_6:29; thus A3: dom <:<*h*>:> = meet (doms <*h*>) by FUNCT_6:29 .= meet <*(dom h)*> by Th132 .= dom h by Th135 ; ::_thesis: for x being set st x in dom h holds <:<*h*>:> . x = <*(h . x)*> let x be set ; ::_thesis: ( x in dom h implies <:<*h*>:> . x = <*(h . x)*> ) assume A4: x in dom h ; ::_thesis: <:<*h*>:> . x = <*(h . x)*> then <:<*h*>:> . x in rng <:<*h*>:> by A3, FUNCT_1:def_3; then consider g being Function such that A5: <:<*h*>:> . x = g and A6: dom g = dom <*(rng h)*> and for y being set st y in dom <*(rng h)*> holds g . y in <*(rng h)*> . y by A2, CARD_3:def_5; A7: dom g = Seg 1 by A6, FINSEQ_1:38; ( dom <*h*> = Seg 1 & <*h*> . 1 = h ) by FINSEQ_1:38, FINSEQ_1:40; then A8: (uncurry <*h*>) . (1,x) = h . x by A4, A1, FUNCT_5:38; reconsider g = g as FinSequence by A7, FINSEQ_1:def_2; A9: len g = 1 by A7, FINSEQ_1:def_3; g . 1 = (uncurry <*h*>) . (1,x) by A3, A4, A5, A7, A1, FUNCT_6:31; hence <:<*h*>:> . x = <*(h . x)*> by A5, A8, A9, FINSEQ_1:40; ::_thesis: verum end; theorem Th142: :: FINSEQ_3:142 for f1, f2 being Function holds ( dom <:<*f1,f2*>:> = (dom f1) /\ (dom f2) & ( for x being set st x in (dom f1) /\ (dom f2) holds <:<*f1,f2*>:> . x = <*(f1 . x),(f2 . x)*> ) ) proof let f1, f2 be Function; ::_thesis: ( dom <:<*f1,f2*>:> = (dom f1) /\ (dom f2) & ( for x being set st x in (dom f1) /\ (dom f2) holds <:<*f1,f2*>:> . x = <*(f1 . x),(f2 . x)*> ) ) A1: dom <*f1,f2*> = Seg 2 by FINSEQ_1:89; A2: ( rng <:<*f1,f2*>:> c= product (rngs <*f1,f2*>) & rngs <*f1,f2*> = <*(rng f1),(rng f2)*> ) by Th133, FUNCT_6:29; thus A3: dom <:<*f1,f2*>:> = meet (doms <*f1,f2*>) by FUNCT_6:29 .= meet <*(dom f1),(dom f2)*> by Th133 .= (dom f1) /\ (dom f2) by Th136 ; ::_thesis: for x being set st x in (dom f1) /\ (dom f2) holds <:<*f1,f2*>:> . x = <*(f1 . x),(f2 . x)*> let x be set ; ::_thesis: ( x in (dom f1) /\ (dom f2) implies <:<*f1,f2*>:> . x = <*(f1 . x),(f2 . x)*> ) assume A4: x in (dom f1) /\ (dom f2) ; ::_thesis: <:<*f1,f2*>:> . x = <*(f1 . x),(f2 . x)*> then <:<*f1,f2*>:> . x in rng <:<*f1,f2*>:> by A3, FUNCT_1:def_3; then consider g being Function such that A5: <:<*f1,f2*>:> . x = g and A6: dom g = dom <*(rng f1),(rng f2)*> and for y being set st y in dom <*(rng f1),(rng f2)*> holds g . y in <*(rng f1),(rng f2)*> . y by A2, CARD_3:def_5; A7: dom g = Seg 2 by A6, FINSEQ_1:89; A8: 1 in Seg 2 by FINSEQ_1:2, TARSKI:def_2; reconsider g = g as FinSequence by A7, FINSEQ_1:def_2; A9: 2 in Seg 2 by FINSEQ_1:2, TARSKI:def_2; then A10: g . 2 = (uncurry <*f1,f2*>) . (2,x) by A3, A4, A5, A7, FUNCT_6:31; ( <*f1,f2*> . 2 = f2 & x in dom f2 ) by A4, FINSEQ_1:44, XBOOLE_0:def_4; then A11: (uncurry <*f1,f2*>) . (2,x) = f2 . x by A1, A9, FUNCT_5:38; A12: len g = 2 by A7, FINSEQ_1:def_3; ( <*f1,f2*> . 1 = f1 & x in dom f1 ) by A4, FINSEQ_1:44, XBOOLE_0:def_4; then A13: (uncurry <*f1,f2*>) . (1,x) = f1 . x by A1, A8, FUNCT_5:38; g . 1 = (uncurry <*f1,f2*>) . (1,x) by A3, A4, A5, A7, A8, FUNCT_6:31; hence <:<*f1,f2*>:> . x = <*(f1 . x),(f2 . x)*> by A5, A13, A10, A11, A12, FINSEQ_1:44; ::_thesis: verum end; theorem :: FINSEQ_3:143 for h being Function holds ( dom (Frege <*h*>) = product <*(dom h)*> & rng (Frege <*h*>) = product <*(rng h)*> & ( for x being set st x in dom h holds (Frege <*h*>) . <*x*> = <*(h . x)*> ) ) proof let h be Function; ::_thesis: ( dom (Frege <*h*>) = product <*(dom h)*> & rng (Frege <*h*>) = product <*(rng h)*> & ( for x being set st x in dom h holds (Frege <*h*>) . <*x*> = <*(h . x)*> ) ) A1: <*h*> . 1 = h by FINSEQ_1:def_8; A2: rngs <*h*> = <*(rng h)*> by Th132; A3: doms <*h*> = <*(dom h)*> by Th132; hence ( dom (Frege <*h*>) = product <*(dom h)*> & rng (Frege <*h*>) = product <*(rng h)*> ) by A2, FUNCT_6:38, FUNCT_6:def_7; ::_thesis: for x being set st x in dom h holds (Frege <*h*>) . <*x*> = <*(h . x)*> let x be set ; ::_thesis: ( x in dom h implies (Frege <*h*>) . <*x*> = <*(h . x)*> ) assume x in dom h ; ::_thesis: (Frege <*h*>) . <*x*> = <*(h . x)*> then A4: <*x*> in product (doms <*h*>) by A3, Th123; then consider f being Function such that A5: (Frege <*h*>) . <*x*> = f and dom f = <*h*> " (SubFuncs (rng <*h*>)) and for y being set st y in dom f holds f . y = (uncurry <*h*>) . (y,(<*x*> . y)) by FUNCT_6:def_7; A6: ( dom <*h*> = Seg 1 & 1 in Seg 1 ) by FINSEQ_1:2, FINSEQ_1:def_8, TARSKI:def_1; then ( dom <*(rng h)*> = Seg 1 & f in product (rngs <*h*>) ) by A1, A4, A5, FINSEQ_1:def_8, FUNCT_6:37; then A7: dom f = Seg 1 by A2, CARD_3:9; A8: <*x*> . 1 = x by FINSEQ_1:def_8; reconsider f = f as FinSequence by A7, FINSEQ_1:def_2; f . 1 = h . (<*x*> . 1) by A6, A1, A4, A5, FUNCT_6:37; hence (Frege <*h*>) . <*x*> = <*(h . x)*> by A5, A7, A8, FINSEQ_1:def_8; ::_thesis: verum end; theorem Th144: :: FINSEQ_3:144 for f1, f2 being Function holds ( dom (Frege <*f1,f2*>) = product <*(dom f1),(dom f2)*> & rng (Frege <*f1,f2*>) = product <*(rng f1),(rng f2)*> & ( for x, y being set st x in dom f1 & y in dom f2 holds (Frege <*f1,f2*>) . <*x,y*> = <*(f1 . x),(f2 . y)*> ) ) proof let f1, f2 be Function; ::_thesis: ( dom (Frege <*f1,f2*>) = product <*(dom f1),(dom f2)*> & rng (Frege <*f1,f2*>) = product <*(rng f1),(rng f2)*> & ( for x, y being set st x in dom f1 & y in dom f2 holds (Frege <*f1,f2*>) . <*x,y*> = <*(f1 . x),(f2 . y)*> ) ) A1: rngs <*f1,f2*> = <*(rng f1),(rng f2)*> by Th133; len <*(rng f1),(rng f2)*> = 2 by FINSEQ_1:44; then A2: dom <*(rng f1),(rng f2)*> = Seg 2 by FINSEQ_1:def_3; len <*f1,f2*> = 2 by FINSEQ_1:44; then A3: dom <*f1,f2*> = Seg 2 by FINSEQ_1:def_3; A4: doms <*f1,f2*> = <*(dom f1),(dom f2)*> by Th133; hence ( dom (Frege <*f1,f2*>) = product <*(dom f1),(dom f2)*> & rng (Frege <*f1,f2*>) = product <*(rng f1),(rng f2)*> ) by A1, FUNCT_6:38, FUNCT_6:def_7; ::_thesis: for x, y being set st x in dom f1 & y in dom f2 holds (Frege <*f1,f2*>) . <*x,y*> = <*(f1 . x),(f2 . y)*> let x, y be set ; ::_thesis: ( x in dom f1 & y in dom f2 implies (Frege <*f1,f2*>) . <*x,y*> = <*(f1 . x),(f2 . y)*> ) assume ( x in dom f1 & y in dom f2 ) ; ::_thesis: (Frege <*f1,f2*>) . <*x,y*> = <*(f1 . x),(f2 . y)*> then A5: <*x,y*> in product (doms <*f1,f2*>) by A4, Th124; then consider f being Function such that A6: (Frege <*f1,f2*>) . <*x,y*> = f and dom f = <*f1,f2*> " (SubFuncs (rng <*f1,f2*>)) and for z being set st z in dom f holds f . z = (uncurry <*f1,f2*>) . (z,(<*x,y*> . z)) by FUNCT_6:def_7; A7: ( <*x,y*> . 1 = x & <*x,y*> . 2 = y ) by FINSEQ_1:44; A8: ( 1 in Seg 2 & <*f1,f2*> . 1 = f1 ) by FINSEQ_1:2, FINSEQ_1:44, TARSKI:def_2; then f in product (rngs <*f1,f2*>) by A3, A5, A6, FUNCT_6:37; then A9: dom f = Seg 2 by A1, A2, CARD_3:9; then reconsider f = f as FinSequence by FINSEQ_1:def_2; ( 2 in Seg 2 & <*f1,f2*> . 2 = f2 ) by FINSEQ_1:2, FINSEQ_1:44, TARSKI:def_2; then A10: f . 2 = f2 . (<*x,y*> . 2) by A3, A5, A6, FUNCT_6:37; A11: len f = 2 by A9, FINSEQ_1:def_3; f . 1 = f1 . (<*x,y*> . 1) by A3, A8, A5, A6, FUNCT_6:37; hence (Frege <*f1,f2*>) . <*x,y*> = <*(f1 . x),(f2 . y)*> by A6, A10, A11, A7, FINSEQ_1:44; ::_thesis: verum end; theorem :: FINSEQ_3:145 for x being set for f1, f2 being Function st x in dom f1 & x in dom f2 holds for y1, y2 being set holds ( <:f1,f2:> . x = [y1,y2] iff <:<*f1,f2*>:> . x = <*y1,y2*> ) proof let x be set ; ::_thesis: for f1, f2 being Function st x in dom f1 & x in dom f2 holds for y1, y2 being set holds ( <:f1,f2:> . x = [y1,y2] iff <:<*f1,f2*>:> . x = <*y1,y2*> ) let f1, f2 be Function; ::_thesis: ( x in dom f1 & x in dom f2 implies for y1, y2 being set holds ( <:f1,f2:> . x = [y1,y2] iff <:<*f1,f2*>:> . x = <*y1,y2*> ) ) A1: ( <*(f1 . x),(f2 . x)*> . 1 = f1 . x & <*(f1 . x),(f2 . x)*> . 2 = f2 . x ) by FINSEQ_1:44; assume ( x in dom f1 & x in dom f2 ) ; ::_thesis: for y1, y2 being set holds ( <:f1,f2:> . x = [y1,y2] iff <:<*f1,f2*>:> . x = <*y1,y2*> ) then A2: x in (dom f1) /\ (dom f2) by XBOOLE_0:def_4; let y1, y2 be set ; ::_thesis: ( <:f1,f2:> . x = [y1,y2] iff <:<*f1,f2*>:> . x = <*y1,y2*> ) A3: ( <*y1,y2*> . 1 = y1 & <*y1,y2*> . 2 = y2 ) by FINSEQ_1:44; ( [(f1 . x),(f2 . x)] = [y1,y2] iff ( f1 . x = y1 & f2 . x = y2 ) ) by XTUPLE_0:1; hence ( <:f1,f2:> . x = [y1,y2] iff <:<*f1,f2*>:> . x = <*y1,y2*> ) by A2, A1, A3, Th142, FUNCT_3:48; ::_thesis: verum end; theorem :: FINSEQ_3:146 for x, y being set for f1, f2 being Function st x in dom f1 & y in dom f2 holds for y1, y2 being set holds ( [:f1,f2:] . (x,y) = [y1,y2] iff (Frege <*f1,f2*>) . <*x,y*> = <*y1,y2*> ) proof let x, y be set ; ::_thesis: for f1, f2 being Function st x in dom f1 & y in dom f2 holds for y1, y2 being set holds ( [:f1,f2:] . (x,y) = [y1,y2] iff (Frege <*f1,f2*>) . <*x,y*> = <*y1,y2*> ) let f1, f2 be Function; ::_thesis: ( x in dom f1 & y in dom f2 implies for y1, y2 being set holds ( [:f1,f2:] . (x,y) = [y1,y2] iff (Frege <*f1,f2*>) . <*x,y*> = <*y1,y2*> ) ) assume A1: ( x in dom f1 & y in dom f2 ) ; ::_thesis: for y1, y2 being set holds ( [:f1,f2:] . (x,y) = [y1,y2] iff (Frege <*f1,f2*>) . <*x,y*> = <*y1,y2*> ) let y1, y2 be set ; ::_thesis: ( [:f1,f2:] . (x,y) = [y1,y2] iff (Frege <*f1,f2*>) . <*x,y*> = <*y1,y2*> ) A2: ( <*(f1 . x),(f2 . y)*> . 1 = f1 . x & <*(f1 . x),(f2 . y)*> . 2 = f2 . y ) by FINSEQ_1:44; A3: ( <*y1,y2*> . 1 = y1 & <*y1,y2*> . 2 = y2 ) by FINSEQ_1:44; ( [(f1 . x),(f2 . y)] = [y1,y2] iff ( f1 . x = y1 & f2 . y = y2 ) ) by XTUPLE_0:1; hence ( [:f1,f2:] . (x,y) = [y1,y2] iff (Frege <*f1,f2*>) . <*x,y*> = <*y1,y2*> ) by A1, A2, A3, Th144, FUNCT_3:def_8; ::_thesis: verum end; theorem :: FINSEQ_3:147 for X, Y being set holds Funcs (<*X*>,Y) = <*(Funcs (X,Y))*> proof let X, Y be set ; ::_thesis: Funcs (<*X*>,Y) = <*(Funcs (X,Y))*> A1: dom <*X*> = Seg 1 by FINSEQ_1:def_8; A2: dom (Funcs (<*X*>,Y)) = dom <*X*> by FUNCT_6:def_8; then reconsider p = Funcs (<*X*>,Y) as FinSequence by A1, FINSEQ_1:def_2; ( <*X*> . 1 = X & 1 in Seg 1 ) by FINSEQ_1:2, FINSEQ_1:def_8, TARSKI:def_1; then p . 1 = Funcs (X,Y) by A1, FUNCT_6:def_8; hence Funcs (<*X*>,Y) = <*(Funcs (X,Y))*> by A2, A1, FINSEQ_1:def_8; ::_thesis: verum end; theorem :: FINSEQ_3:148 for X, Y, Z being set holds Funcs (<*X,Y*>,Z) = <*(Funcs (X,Z)),(Funcs (Y,Z))*> proof let X, Y, Z be set ; ::_thesis: Funcs (<*X,Y*>,Z) = <*(Funcs (X,Z)),(Funcs (Y,Z))*> A1: Seg (len <*X,Y*>) = dom <*X,Y*> by FINSEQ_1:def_3; A2: dom (Funcs (<*X,Y*>,Z)) = dom <*X,Y*> by FUNCT_6:def_8; then reconsider p = Funcs (<*X,Y*>,Z) as FinSequence by A1, FINSEQ_1:def_2; A3: len <*X,Y*> = 2 by FINSEQ_1:44; then A4: len p = 2 by A2, A1, FINSEQ_1:def_3; ( <*X,Y*> . 2 = Y & 2 in Seg 2 ) by FINSEQ_1:2, FINSEQ_1:44, TARSKI:def_2; then A5: p . 2 = Funcs (Y,Z) by A3, A1, FUNCT_6:def_8; ( <*X,Y*> . 1 = X & 1 in Seg 2 ) by FINSEQ_1:2, FINSEQ_1:44, TARSKI:def_2; then p . 1 = Funcs (X,Z) by A3, A1, FUNCT_6:def_8; hence Funcs (<*X,Y*>,Z) = <*(Funcs (X,Z)),(Funcs (Y,Z))*> by A4, A5, FINSEQ_1:44; ::_thesis: verum end; theorem :: FINSEQ_3:149 for X, Y being set holds Funcs (X,<*Y*>) = <*(Funcs (X,Y))*> proof let X, Y be set ; ::_thesis: Funcs (X,<*Y*>) = <*(Funcs (X,Y))*> A1: dom <*Y*> = Seg 1 by FINSEQ_1:def_8; A2: dom (Funcs (X,<*Y*>)) = dom <*Y*> by FUNCT_6:def_9; then reconsider p = Funcs (X,<*Y*>) as FinSequence by A1, FINSEQ_1:def_2; ( <*Y*> . 1 = Y & 1 in Seg 1 ) by FINSEQ_1:2, FINSEQ_1:def_8, TARSKI:def_1; then p . 1 = Funcs (X,Y) by A1, FUNCT_6:def_9; hence Funcs (X,<*Y*>) = <*(Funcs (X,Y))*> by A2, A1, FINSEQ_1:def_8; ::_thesis: verum end; theorem :: FINSEQ_3:150 for X, Y, Z being set holds Funcs (X,<*Y,Z*>) = <*(Funcs (X,Y)),(Funcs (X,Z))*> proof let X, Y, Z be set ; ::_thesis: Funcs (X,<*Y,Z*>) = <*(Funcs (X,Y)),(Funcs (X,Z))*> A1: Seg (len <*Y,Z*>) = dom <*Y,Z*> by FINSEQ_1:def_3; A2: dom (Funcs (X,<*Y,Z*>)) = dom <*Y,Z*> by FUNCT_6:def_9; then reconsider p = Funcs (X,<*Y,Z*>) as FinSequence by A1, FINSEQ_1:def_2; A3: len <*Y,Z*> = 2 by FINSEQ_1:44; then A4: len p = 2 by A2, A1, FINSEQ_1:def_3; ( <*Y,Z*> . 2 = Z & 2 in Seg 2 ) by FINSEQ_1:2, FINSEQ_1:44, TARSKI:def_2; then A5: p . 2 = Funcs (X,Z) by A3, A1, FUNCT_6:def_9; ( <*Y,Z*> . 1 = Y & 1 in Seg 2 ) by FINSEQ_1:2, FINSEQ_1:44, TARSKI:def_2; then p . 1 = Funcs (X,Y) by A3, A1, FUNCT_6:def_9; hence Funcs (X,<*Y,Z*>) = <*(Funcs (X,Y)),(Funcs (X,Z))*> by A4, A5, FINSEQ_1:44; ::_thesis: verum end; theorem :: FINSEQ_3:151 for x, y being set for f being FinSequence st rng f = {x,y} & len f = 2 & not ( f . 1 = x & f . 2 = y ) holds ( f . 1 = y & f . 2 = x ) proof let x, y be set ; ::_thesis: for f being FinSequence st rng f = {x,y} & len f = 2 & not ( f . 1 = x & f . 2 = y ) holds ( f . 1 = y & f . 2 = x ) let f be FinSequence; ::_thesis: ( rng f = {x,y} & len f = 2 & not ( f . 1 = x & f . 2 = y ) implies ( f . 1 = y & f . 2 = x ) ) assume that A1: rng f = {x,y} and A2: len f = 2 ; ::_thesis: ( ( f . 1 = x & f . 2 = y ) or ( f . 1 = y & f . 2 = x ) ) 2 in dom f by A2, Th25; then A3: f . 2 in rng f by FUNCT_1:def_3; A4: now__::_thesis:_(_f_._1_=_y_&_f_._2_=_y_implies_(_f_._1_=_x_&_f_._2_=_y_)_) x in rng f by A1, TARSKI:def_2; then consider z being set such that A5: z in dom f and A6: x = f . z by FUNCT_1:def_3; reconsider nz = z as Element of NAT by A5; A7: ( 1 <= nz & nz <= len f ) by A5, Th25; assume that A8: f . 1 = y and A9: f . 2 = y ; ::_thesis: ( f . 1 = x & f . 2 = y ) percases ( nz = 1 or nz = 1 + 1 ) by A2, A7, NAT_1:9; suppose nz = 1 ; ::_thesis: ( f . 1 = x & f . 2 = y ) hence ( f . 1 = x & f . 2 = y ) by A9, A6; ::_thesis: verum end; suppose nz = 1 + 1 ; ::_thesis: ( f . 1 = x & f . 2 = y ) hence ( f . 1 = x & f . 2 = y ) by A8, A9, A6; ::_thesis: verum end; end; end; A10: now__::_thesis:_(_f_._1_=_x_&_f_._2_=_x_implies_(_f_._1_=_x_&_f_._2_=_y_)_) y in rng f by A1, TARSKI:def_2; then consider z being set such that A11: z in dom f and A12: y = f . z by FUNCT_1:def_3; reconsider nz = z as Element of NAT by A11; A13: ( 1 <= nz & nz <= len f ) by A11, Th25; assume that A14: f . 1 = x and A15: f . 2 = x ; ::_thesis: ( f . 1 = x & f . 2 = y ) percases ( nz = 1 or nz = 1 + 1 ) by A2, A13, NAT_1:9; suppose nz = 1 ; ::_thesis: ( f . 1 = x & f . 2 = y ) hence ( f . 1 = x & f . 2 = y ) by A14, A15, A12; ::_thesis: verum end; suppose nz = 1 + 1 ; ::_thesis: ( f . 1 = x & f . 2 = y ) hence ( f . 1 = x & f . 2 = y ) by A14, A12; ::_thesis: verum end; end; end; 1 in dom f by A2, Th25; then f . 1 in rng f by FUNCT_1:def_3; hence ( ( f . 1 = x & f . 2 = y ) or ( f . 1 = y & f . 2 = x ) ) by A1, A3, A10, A4, TARSKI:def_2; ::_thesis: verum end; theorem :: FINSEQ_3:152 for X being set for k being Element of NAT st X c= Seg k holds for m, n being Element of NAT st m in dom (Sgm X) & n = (Sgm X) . m holds m <= n proof let X be set ; ::_thesis: for k being Element of NAT st X c= Seg k holds for m, n being Element of NAT st m in dom (Sgm X) & n = (Sgm X) . m holds m <= n let k be Element of NAT ; ::_thesis: ( X c= Seg k implies for m, n being Element of NAT st m in dom (Sgm X) & n = (Sgm X) . m holds m <= n ) defpred S1[ Nat] means ( ( $1 in dom (Sgm X) & ex n being Element of NAT st ( n = (Sgm X) . $1 & $1 <= n ) ) or not $1 in dom (Sgm X) ); assume A1: X c= Seg k ; ::_thesis: for m, n being Element of NAT st m in dom (Sgm X) & n = (Sgm X) . m holds m <= n now__::_thesis:_for_x_being_non_empty_Nat_st_S1[x]_holds_ S1[x_+_1] let x be non empty Nat; ::_thesis: ( S1[x] implies S1[x + 1] ) assume A2: S1[x] ; ::_thesis: S1[x + 1] now__::_thesis:_S1[x_+_1] percases ( ( x in dom (Sgm X) & ex n being Element of NAT st ( n = (Sgm X) . x & x <= n ) ) or not x in dom (Sgm X) ) by A2; supposeA3: ( x in dom (Sgm X) & ex n being Element of NAT st ( n = (Sgm X) . x & x <= n ) ) ; ::_thesis: S1[x + 1] A4: x + 0 < x + 1 by XREAL_1:8; consider n being Element of NAT such that A5: n = (Sgm X) . x and A6: x <= n by A3; A7: 1 <= x by A3, Th25; now__::_thesis:_(_x_+_1_in_dom_(Sgm_X)_implies_ex_n1_being_Element_of_NAT_st_ (_n1_=_(Sgm_X)_._(x_+_1)_&_x_+_1_<=_n1_)_) set n1 = (Sgm X) . (x + 1); assume A8: x + 1 in dom (Sgm X) ; ::_thesis: ex n1 being Element of NAT st ( n1 = (Sgm X) . (x + 1) & x + 1 <= n1 ) then (Sgm X) . (x + 1) in rng (Sgm X) by FUNCT_1:3; then reconsider n1 = (Sgm X) . (x + 1) as Element of NAT ; take n1 = n1; ::_thesis: ( n1 = (Sgm X) . (x + 1) & x + 1 <= n1 ) thus n1 = (Sgm X) . (x + 1) ; ::_thesis: x + 1 <= n1 x + 1 <= len (Sgm X) by A8, Th25; then n < n1 by A1, A7, A4, A5, FINSEQ_1:def_13; then x < n1 by A6, XXREAL_0:2; hence x + 1 <= n1 by NAT_1:13; ::_thesis: verum end; hence S1[x + 1] ; ::_thesis: verum end; suppose not x in dom (Sgm X) ; ::_thesis: S1[x + 1] then ( x < 0 + 1 or x > len (Sgm X) ) by Th25; then x + 1 > (len (Sgm X)) + 0 by NAT_1:13; hence S1[x + 1] by Th25; ::_thesis: verum end; end; end; hence S1[x + 1] ; ::_thesis: verum end; then A9: for x being non empty Nat st S1[x] holds S1[x + 1] ; let m, n be Element of NAT ; ::_thesis: ( m in dom (Sgm X) & n = (Sgm X) . m implies m <= n ) assume that A10: m in dom (Sgm X) and A11: n = (Sgm X) . m ; ::_thesis: m <= n reconsider m9 = m as non empty Element of NAT by A10, Th25; now__::_thesis:_(_1_in_dom_(Sgm_X)_&_ex_n_being_Element_of_NAT_st_ (_n_=_(Sgm_X)_._1_&_1_<=_n_)_) set n = (Sgm X) . 1; A12: m <= len (Sgm X) by A10, Th25; 1 <= m by A10, Th25; then 1 <= len (Sgm X) by A12, XXREAL_0:2; hence 1 in dom (Sgm X) by Th25; ::_thesis: ex n being Element of NAT st ( n = (Sgm X) . 1 & 1 <= n ) then A13: (Sgm X) . 1 in rng (Sgm X) by FUNCT_1:3; then reconsider n = (Sgm X) . 1 as Element of NAT ; take n = n; ::_thesis: ( n = (Sgm X) . 1 & 1 <= n ) thus n = (Sgm X) . 1 ; ::_thesis: 1 <= n rng (Sgm X) = X by A1, FINSEQ_1:def_13; hence 1 <= n by A1, A13, FINSEQ_1:1; ::_thesis: verum end; then A14: S1[1] ; for x being non empty Nat holds S1[x] from NAT_1:sch_10(A14, A9); then S1[m9] ; hence m <= n by A10, A11; ::_thesis: verum end; registration let i be Nat; let D be finite set ; clusteri -tuples_on D -> finite ; coherence i -tuples_on D is finite proof now__::_thesis:_for_x_being_set_st_x_in_dom_(i_|->_D)_holds_ (i_|->_D)_._x_is_finite let x be set ; ::_thesis: ( x in dom (i |-> D) implies (i |-> D) . x is finite ) assume x in dom (i |-> D) ; ::_thesis: (i |-> D) . x is finite then x in Seg i by FUNCOP_1:13; hence (i |-> D) . x is finite by FUNCOP_1:7; ::_thesis: verum end; then A1: i |-> D is V37() by FINSET_1:def_4; product (i |-> D) = i -tuples_on D by Th131; hence i -tuples_on D is finite by A1; ::_thesis: verum end; end;