:: COMPUT_1 semantic presentation begin theorem Th1: :: COMPUT_1:1 for x, y, z being set holds ( <*x,y*> +* (1,z) = <*z,y*> & <*x,y*> +* (2,z) = <*x,z*> ) proof let x, y, z be set ; ::_thesis: ( <*x,y*> +* (1,z) = <*z,y*> & <*x,y*> +* (2,z) = <*x,z*> ) set a = <*x,y*> +* (1,z); set b = <*x,y*> +* (2,z); <*x,y*> . 1 = x by FINSEQ_1:44; then A1: (<*x,y*> +* (2,z)) . 1 = x by FUNCT_7:32; <*x,y*> . 2 = y by FINSEQ_1:44; then A2: (<*x,y*> +* (1,z)) . 2 = y by FUNCT_7:32; A3: len <*x,y*> = 2 by FINSEQ_1:44; then 1 in dom <*x,y*> by FINSEQ_3:25; then A4: (<*x,y*> +* (1,z)) . 1 = z by FUNCT_7:31; len (<*x,y*> +* (1,z)) = 2 by A3, FUNCT_7:97; hence <*x,y*> +* (1,z) = <*z,y*> by A4, A2, FINSEQ_1:44; ::_thesis: <*x,y*> +* (2,z) = <*x,z*> 2 in dom <*x,y*> by A3, FINSEQ_3:25; then A5: (<*x,y*> +* (2,z)) . 2 = z by FUNCT_7:31; len (<*x,y*> +* (2,z)) = 2 by A3, FUNCT_7:97; hence <*x,y*> +* (2,z) = <*x,z*> by A1, A5, FINSEQ_1:44; ::_thesis: verum end; theorem Th2: :: COMPUT_1:2 for a, x, y, z being set for f, g being Function st f +* (a,x) = g +* (a,y) holds f +* (a,z) = g +* (a,z) proof let a, x, y, z be set ; ::_thesis: for f, g being Function st f +* (a,x) = g +* (a,y) holds f +* (a,z) = g +* (a,z) let f, g be Function; ::_thesis: ( f +* (a,x) = g +* (a,y) implies f +* (a,z) = g +* (a,z) ) set i = a; assume A1: f +* (a,x) = g +* (a,y) ; ::_thesis: f +* (a,z) = g +* (a,z) A2: dom (g +* (a,z)) = dom g by FUNCT_7:30; A3: dom (g +* (a,y)) = dom g by FUNCT_7:30; A4: dom (f +* (a,x)) = dom f by FUNCT_7:30; now__::_thesis:_(_dom_(f_+*_(a,z))_=_dom_f_&_dom_(g_+*_(a,z))_=_dom_f_&_(_for_a_being_set_st_a_in_dom_f_holds_ (f_+*_(a,z))_._a_=_(g_+*_(a,z))_._a_)_) thus dom (f +* (a,z)) = dom f by FUNCT_7:30; ::_thesis: ( dom (g +* (a,z)) = dom f & ( for a being set st a in dom f holds (f +* (a,z)) . b2 = (g +* (a,z)) . b2 ) ) thus dom (g +* (a,z)) = dom f by A1, A3, A2, FUNCT_7:30; ::_thesis: for a being set st a in dom f holds (f +* (a,z)) . b2 = (g +* (a,z)) . b2 let a be set ; ::_thesis: ( a in dom f implies (f +* (a,z)) . b1 = (g +* (a,z)) . b1 ) assume A5: a in dom f ; ::_thesis: (f +* (a,z)) . b1 = (g +* (a,z)) . b1 percases ( a = a or a <> a ) ; supposeA6: a = a ; ::_thesis: (f +* (a,z)) . b1 = (g +* (a,z)) . b1 hence (f +* (a,z)) . a = z by A5, FUNCT_7:31 .= (g +* (a,z)) . a by A1, A4, A3, A5, A6, FUNCT_7:31 ; ::_thesis: verum end; supposeA7: a <> a ; ::_thesis: (f +* (a,z)) . b1 = (g +* (a,z)) . b1 hence (f +* (a,z)) . a = f . a by FUNCT_7:32 .= (g +* (a,y)) . a by A1, A7, FUNCT_7:32 .= g . a by A7, FUNCT_7:32 .= (g +* (a,z)) . a by A7, FUNCT_7:32 ; ::_thesis: verum end; end; end; hence f +* (a,z) = g +* (a,z) by FUNCT_1:2; ::_thesis: verum end; theorem Th3: :: COMPUT_1:3 for i being Element of NAT for x being set for p being FinSequence holds Del ((p +* (i,x)),i) = Del (p,i) proof let i be Element of NAT ; ::_thesis: for x being set for p being FinSequence holds Del ((p +* (i,x)),i) = Del (p,i) let x be set ; ::_thesis: for p being FinSequence holds Del ((p +* (i,x)),i) = Del (p,i) let p be FinSequence; ::_thesis: Del ((p +* (i,x)),i) = Del (p,i) set f = p; percases ( i in dom p or not i in dom p ) ; supposeA1: i in dom p ; ::_thesis: Del ((p +* (i,x)),i) = Del (p,i) then A2: i <= len p by FINSEQ_3:25; 1 <= i by A1, FINSEQ_3:25; then consider j being Nat such that A3: len p = j + 1 by A2, NAT_1:6; reconsider j = j as Element of NAT by ORDINAL1:def_12; A4: dom (p +* (i,x)) = dom p by FUNCT_7:30; then A5: len (p +* (i,x)) = len p by FINSEQ_3:29; then len (Del ((p +* (i,x)),i)) = j by A1, A3, A4, FINSEQ_3:109; then A6: dom (Del ((p +* (i,x)),i)) = Seg j by FINSEQ_1:def_3; now__::_thesis:_(_len_(Del_((p_+*_(i,x)),i))_=_j_&_len_(Del_(p,i))_=_j_&_(_for_a_being_Nat_st_a_in_dom_(Del_((p_+*_(i,x)),i))_holds_ (Del_((p_+*_(i,x)),i))_._a_=_(Del_(p,i))_._a_)_) thus len (Del ((p +* (i,x)),i)) = j by A1, A3, A4, A5, FINSEQ_3:109; ::_thesis: ( len (Del (p,i)) = j & ( for a being Nat st a in dom (Del ((p +* (i,x)),i)) holds (Del ((p +* (i,x)),i)) . b2 = (Del (p,i)) . b2 ) ) thus len (Del (p,i)) = j by A1, A3, FINSEQ_3:109; ::_thesis: for a being Nat st a in dom (Del ((p +* (i,x)),i)) holds (Del ((p +* (i,x)),i)) . b2 = (Del (p,i)) . b2 let a be Nat; ::_thesis: ( a in dom (Del ((p +* (i,x)),i)) implies (Del ((p +* (i,x)),i)) . b1 = (Del (p,i)) . b1 ) assume a in dom (Del ((p +* (i,x)),i)) ; ::_thesis: (Del ((p +* (i,x)),i)) . b1 = (Del (p,i)) . b1 then A7: a <= j by A6, FINSEQ_1:1; percases ( a < i or i <= a ) ; supposeA8: a < i ; ::_thesis: (Del ((p +* (i,x)),i)) . b1 = (Del (p,i)) . b1 hence (Del ((p +* (i,x)),i)) . a = (p +* (i,x)) . a by FINSEQ_3:110 .= p . a by A8, FUNCT_7:32 .= (Del (p,i)) . a by A8, FINSEQ_3:110 ; ::_thesis: verum end; supposeA9: i <= a ; ::_thesis: (Del ((p +* (i,x)),i)) . b1 = (Del (p,i)) . b1 then A10: i < a + 1 by NAT_1:13; thus (Del ((p +* (i,x)),i)) . a = (p +* (i,x)) . (a + 1) by A1, A3, A4, A5, A7, A9, FINSEQ_3:111 .= p . (a + 1) by A10, FUNCT_7:32 .= (Del (p,i)) . a by A1, A3, A7, A9, FINSEQ_3:111 ; ::_thesis: verum end; end; end; hence Del ((p +* (i,x)),i) = Del (p,i) by FINSEQ_2:9; ::_thesis: verum end; suppose not i in dom p ; ::_thesis: Del ((p +* (i,x)),i) = Del (p,i) hence Del ((p +* (i,x)),i) = Del (p,i) by FUNCT_7:def_3; ::_thesis: verum end; end; end; theorem Th4: :: COMPUT_1:4 for i being Element of NAT for a being set for p, q being FinSequence st p +* (i,a) = q +* (i,a) holds Del (p,i) = Del (q,i) proof let i be Element of NAT ; ::_thesis: for a being set for p, q being FinSequence st p +* (i,a) = q +* (i,a) holds Del (p,i) = Del (q,i) let a be set ; ::_thesis: for p, q being FinSequence st p +* (i,a) = q +* (i,a) holds Del (p,i) = Del (q,i) let p, q be FinSequence; ::_thesis: ( p +* (i,a) = q +* (i,a) implies Del (p,i) = Del (q,i) ) set x = p; set y = q; assume A1: p +* (i,a) = q +* (i,a) ; ::_thesis: Del (p,i) = Del (q,i) set xi = p +* (i,a); set yi = q +* (i,a); set dx = Del (p,i); set dy = Del (q,i); A2: dom (p +* (i,a)) = dom p by FUNCT_7:30; A3: dom (q +* (i,a)) = dom q by FUNCT_7:30; A4: Seg (len q) = dom q by FINSEQ_1:def_3; A5: Seg (len p) = dom p by FINSEQ_1:def_3; percases ( i in dom p or not i in dom p ) ; supposeA6: i in dom p ; ::_thesis: Del (p,i) = Del (q,i) A7: dom (Del (p,i)) = Seg (len (Del (p,i))) by FINSEQ_1:def_3; now__::_thesis:_(_len_(Del_(p,i))_=_len_(Del_(p,i))_&_len_(Del_(q,i))_=_len_(Del_(p,i))_&_(_for_j_being_Nat_st_j_in_dom_(Del_(p,i))_holds_ (Del_(p,i))_._j_=_(Del_(q,i))_._j_)_) thus len (Del (p,i)) = len (Del (p,i)) ; ::_thesis: ( len (Del (q,i)) = len (Del (p,i)) & ( for j being Nat st j in dom (Del (p,i)) holds (Del (p,i)) . b2 = (Del (q,i)) . b2 ) ) p <> {} by A6; then consider m being Nat such that A8: len p = m + 1 by NAT_1:6; reconsider m = m as Element of NAT by ORDINAL1:def_12; A9: len (Del (p,i)) = m by A6, A8, FINSEQ_3:109; hence len (Del (q,i)) = len (Del (p,i)) by A1, A2, A3, A5, A4, A6, A8, FINSEQ_1:6, FINSEQ_3:109; ::_thesis: for j being Nat st j in dom (Del (p,i)) holds (Del (p,i)) . b2 = (Del (q,i)) . b2 let j be Nat; ::_thesis: ( j in dom (Del (p,i)) implies (Del (p,i)) . b1 = (Del (q,i)) . b1 ) assume j in dom (Del (p,i)) ; ::_thesis: (Del (p,i)) . b1 = (Del (q,i)) . b1 then A10: j <= m by A7, A9, FINSEQ_1:1; percases ( j < i or i <= j ) ; supposeA11: j < i ; ::_thesis: (Del (p,i)) . b1 = (Del (q,i)) . b1 hence (Del (p,i)) . j = p . j by FINSEQ_3:110 .= (q +* (i,a)) . j by A1, A11, FUNCT_7:32 .= q . j by A11, FUNCT_7:32 .= (Del (q,i)) . j by A11, FINSEQ_3:110 ; ::_thesis: verum end; supposeA12: i <= j ; ::_thesis: (Del (p,i)) . b1 = (Del (q,i)) . b1 then A13: j + 1 > i by NAT_1:13; thus (Del (p,i)) . j = p . (j + 1) by A6, A8, A10, A12, FINSEQ_3:111 .= (q +* (i,a)) . (j + 1) by A1, A13, FUNCT_7:32 .= q . (j + 1) by A13, FUNCT_7:32 .= (Del (q,i)) . j by A1, A2, A3, A5, A4, A6, A8, A10, A12, FINSEQ_1:6, FINSEQ_3:111 ; ::_thesis: verum end; end; end; hence Del (p,i) = Del (q,i) by FINSEQ_2:9; ::_thesis: verum end; supposeA14: not i in dom p ; ::_thesis: Del (p,i) = Del (q,i) then p +* (i,a) = p by FUNCT_7:def_3; hence Del (p,i) = Del (q,i) by A1, A3, A14, FUNCT_7:def_3; ::_thesis: verum end; end; end; theorem Th5: :: COMPUT_1:5 for X being set holds 0 -tuples_on X = {{}} proof let X be set ; ::_thesis: 0 -tuples_on X = {{}} set S = { s where s is Element of X * : len s = 0 } ; now__::_thesis:_for_x_being_set_holds_ (_(_x_in__{__s_where_s_is_Element_of_X_*_:_len_s_=_0__}__implies_x_in_{{}}_)_&_(_x_in_{{}}_implies_x_in__{__s_where_s_is_Element_of_X_*_:_len_s_=_0__}__)_) let x be set ; ::_thesis: ( ( x in { s where s is Element of X * : len s = 0 } implies x in {{}} ) & ( x in {{}} implies x in { s where s is Element of X * : len s = 0 } ) ) hereby ::_thesis: ( x in {{}} implies x in { s where s is Element of X * : len s = 0 } ) assume x in { s where s is Element of X * : len s = 0 } ; ::_thesis: x in {{}} then consider s being Element of X * such that A1: x = s and A2: len s = 0 ; s = {} by A2; hence x in {{}} by A1, TARSKI:def_1; ::_thesis: verum end; assume x in {{}} ; ::_thesis: x in { s where s is Element of X * : len s = 0 } then A3: x = {} by TARSKI:def_1; <*> (X *) is Element of X * by FINSEQ_1:49; hence x in { s where s is Element of X * : len s = 0 } by A3, CARD_1:27; ::_thesis: verum end; hence 0 -tuples_on X = {{}} by TARSKI:1; ::_thesis: verum end; theorem :: COMPUT_1:6 for n being Element of NAT st n <> 0 holds n -tuples_on {} = {} proof let n be Element of NAT ; ::_thesis: ( n <> 0 implies n -tuples_on {} = {} ) assume that A1: n <> 0 and A2: n -tuples_on {} <> {} ; ::_thesis: contradiction consider x being set such that A3: x in n -tuples_on {} by A2, XBOOLE_0:def_1; ex s being Element of {} * st ( s = x & len s = n ) by A3; hence contradiction by A1; ::_thesis: verum end; theorem Th7: :: COMPUT_1:7 for f being Function st {} in rng f holds <:f:> = {} proof let f be Function; ::_thesis: ( {} in rng f implies <:f:> = {} ) A1: dom <:f:> = meet (doms f) by FUNCT_6:29 .= meet (rng (doms f)) by FUNCT_6:def_4 ; assume {} in rng f ; ::_thesis: <:f:> = {} then consider x being set such that A2: x in dom f and A3: f . x = {} by FUNCT_1:def_3; A4: dom (doms f) = f " (SubFuncs (rng f)) by FUNCT_6:def_2; then A5: x in dom (doms f) by A2, A3, FUNCT_6:19; then (doms f) . x = {} by A3, A4, FUNCT_5:8, FUNCT_6:def_2; hence <:f:> = {} by A1, A5, FUNCT_1:3, SETFAM_1:4; ::_thesis: verum end; theorem Th8: :: COMPUT_1:8 for D being non empty set for f being Function st rng f = D holds rng <:<*f*>:> = 1 -tuples_on D proof let D be non empty set ; ::_thesis: for f being Function st rng f = D holds rng <:<*f*>:> = 1 -tuples_on D let f be Function; ::_thesis: ( rng f = D implies rng <:<*f*>:> = 1 -tuples_on D ) set X = D; A1: dom <:<*f*>:> = dom f by FINSEQ_3:141; assume A2: rng f = D ; ::_thesis: rng <:<*f*>:> = 1 -tuples_on D now__::_thesis:_for_x_being_set_holds_ (_(_x_in_rng_<:<*f*>:>_implies_x_in_1_-tuples_on_D_)_&_(_x_in_1_-tuples_on_D_implies_x_in_rng_<:<*f*>:>_)_) let x be set ; ::_thesis: ( ( x in rng <:<*f*>:> implies x in 1 -tuples_on D ) & ( x in 1 -tuples_on D implies x in rng <:<*f*>:> ) ) hereby ::_thesis: ( x in 1 -tuples_on D implies x in rng <:<*f*>:> ) assume x in rng <:<*f*>:> ; ::_thesis: x in 1 -tuples_on D then consider y being set such that A3: y in dom <:<*f*>:> and A4: <:<*f*>:> . y = x by FUNCT_1:def_3; reconsider fy = f . y as Element of D by A2, A1, A3, FUNCT_1:3; A5: <*fy*> is Element of 1 -tuples_on D by FINSEQ_2:131; <:<*f*>:> . y = <*(f . y)*> by A1, A3, FINSEQ_3:141; hence x in 1 -tuples_on D by A4, A5; ::_thesis: verum end; assume x in 1 -tuples_on D ; ::_thesis: x in rng <:<*f*>:> then x is Tuple of 1,D by FINSEQ_2:131; then consider d being Element of D such that A6: x = <*d*> by FINSEQ_2:97; consider y being set such that A7: y in dom f and A8: f . y = d by A2, FUNCT_1:def_3; <:<*f*>:> . y = <*d*> by A7, A8, FINSEQ_3:141; hence x in rng <:<*f*>:> by A1, A6, A7, FUNCT_1:3; ::_thesis: verum end; hence rng <:<*f*>:> = 1 -tuples_on D by TARSKI:1; ::_thesis: verum end; theorem Th9: :: COMPUT_1:9 for i, n being Element of NAT for D being non empty set st 1 <= i & i <= n + 1 holds for p being Element of (n + 1) -tuples_on D holds Del (p,i) in n -tuples_on D proof let i, n be Element of NAT ; ::_thesis: for D being non empty set st 1 <= i & i <= n + 1 holds for p being Element of (n + 1) -tuples_on D holds Del (p,i) in n -tuples_on D let D be non empty set ; ::_thesis: ( 1 <= i & i <= n + 1 implies for p being Element of (n + 1) -tuples_on D holds Del (p,i) in n -tuples_on D ) set X = D; assume that A1: 1 <= i and A2: i <= n + 1 ; ::_thesis: for p being Element of (n + 1) -tuples_on D holds Del (p,i) in n -tuples_on D let p be Element of (n + 1) -tuples_on D; ::_thesis: Del (p,i) in n -tuples_on D A3: len p = n + 1 by CARD_1:def_7; then i in dom p by A1, A2, FINSEQ_3:25; then A4: len (Del (p,i)) = n by A3, FINSEQ_3:109; Del (p,i) is FinSequence of D by FINSEQ_3:105; then Del (p,i) is Element of n -tuples_on D by A4, FINSEQ_2:92; hence Del (p,i) in n -tuples_on D ; ::_thesis: verum end; theorem Th10: :: COMPUT_1:10 for X being set for Y being FinSequenceSet of X holds Y c= X * proof let X be set ; ::_thesis: for Y being FinSequenceSet of X holds Y c= X * let Y be FinSequenceSet of X; ::_thesis: Y c= X * let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Y or x in X * ) assume x in Y ; ::_thesis: x in X * then x is FinSequence of X by FINSEQ_2:def_3; hence x in X * by FINSEQ_1:def_11; ::_thesis: verum end; begin definition let X be set ; attrX is compatible means :Def1: :: COMPUT_1:def 1 for f, g being Function st f in X & g in X holds f tolerates g; end; :: deftheorem Def1 defines compatible COMPUT_1:def_1_:_ for X being set holds ( X is compatible iff for f, g being Function st f in X & g in X holds f tolerates g ); registration cluster non empty functional compatible for set ; existence ex b1 being set st ( not b1 is empty & b1 is functional & b1 is compatible ) proof set A = {{}}; take {{}} ; ::_thesis: ( not {{}} is empty & {{}} is functional & {{}} is compatible ) {{}} is compatible proof let f, g be Function; :: according to COMPUT_1:def_1 ::_thesis: ( f in {{}} & g in {{}} implies f tolerates g ) assume that A1: f in {{}} and g in {{}} ; ::_thesis: f tolerates g f = {} by A1, TARSKI:def_1; hence f tolerates g by PARTFUN1:54, XBOOLE_1:2; ::_thesis: verum end; hence ( not {{}} is empty & {{}} is functional & {{}} is compatible ) ; ::_thesis: verum end; end; registration let X be functional compatible set ; cluster union X -> Relation-like Function-like ; coherence ( union X is Function-like & union X is Relation-like ) proof thus union X is Function-like ::_thesis: union X is Relation-like proof let x, y1, y2 be set ; :: according to FUNCT_1:def_1 ::_thesis: ( not [x,y1] in union X or not [x,y2] in union X or y1 = y2 ) assume that A1: [x,y1] in union X and A2: [x,y2] in union X ; ::_thesis: y1 = y2 consider f being set such that A3: [x,y1] in f and A4: f in X by A1, TARSKI:def_4; consider g being set such that A5: [x,y2] in g and A6: g in X by A2, TARSKI:def_4; reconsider f = f, g = g as Function by A4, A6; A7: x in dom f by A3, XTUPLE_0:def_12; then A8: f . x = y1 by A3, FUNCT_1:def_2; A9: x in dom g by A5, XTUPLE_0:def_12; then A10: g . x = y2 by A5, FUNCT_1:def_2; A11: x in (dom f) /\ (dom g) by A7, A9, XBOOLE_0:def_4; f tolerates g by A4, A6, Def1; hence y1 = y2 by A8, A10, A11, PARTFUN1:def_4; ::_thesis: verum end; thus union X is Relation-like ::_thesis: verum proof let x be set ; :: according to RELAT_1:def_1 ::_thesis: ( not x in union X or ex b1, b2 being set st x = [b1,b2] ) assume x in union X ; ::_thesis: ex b1, b2 being set st x = [b1,b2] then ex f being set st ( x in f & f in X ) by TARSKI:def_4; hence ex b1, b2 being set st x = [b1,b2] by RELAT_1:def_1; ::_thesis: verum end; end; end; theorem Th11: :: COMPUT_1:11 for X being set holds ( ( X is functional & X is compatible ) iff union X is Function ) proof let X be set ; ::_thesis: ( ( X is functional & X is compatible ) iff union X is Function ) now__::_thesis:_(_union_X_is_Function_implies_(_X_is_functional_&_X_is_compatible_)_) assume A1: union X is Function ; ::_thesis: ( X is functional & X is compatible ) thus X is functional ::_thesis: X is compatible proof let f be set ; :: according to FUNCT_1:def_13 ::_thesis: ( not f in X or f is set ) assume A2: f in X ; ::_thesis: f is set A3: f is Function-like proof let x, y1, y2 be set ; :: according to FUNCT_1:def_1 ::_thesis: ( not [x,y1] in f or not [x,y2] in f or y1 = y2 ) assume that A4: [x,y1] in f and A5: [x,y2] in f ; ::_thesis: y1 = y2 A6: [x,y2] in union X by A2, A5, TARSKI:def_4; [x,y1] in union X by A2, A4, TARSKI:def_4; hence y1 = y2 by A1, A6, FUNCT_1:def_1; ::_thesis: verum end; f is Relation-like proof let x be set ; :: according to RELAT_1:def_1 ::_thesis: ( not x in f or ex b1, b2 being set st x = [b1,b2] ) assume x in f ; ::_thesis: ex b1, b2 being set st x = [b1,b2] then x in union X by A2, TARSKI:def_4; hence ex b1, b2 being set st x = [b1,b2] by A1, RELAT_1:def_1; ::_thesis: verum end; hence f is set by A3; ::_thesis: verum end; thus X is compatible ::_thesis: verum proof let f, g be Function; :: according to COMPUT_1:def_1 ::_thesis: ( f in X & g in X implies f tolerates g ) assume that A7: f in X and A8: g in X ; ::_thesis: f tolerates g let x be set ; :: according to PARTFUN1:def_4 ::_thesis: ( not x in (dom f) /\ (dom g) or f . x = g . x ) assume A9: x in (dom f) /\ (dom g) ; ::_thesis: f . x = g . x then A10: x in dom g by XBOOLE_0:def_4; then consider y2 being set such that A11: [x,y2] in g by XTUPLE_0:def_12; A12: [x,y2] in union X by A8, A11, TARSKI:def_4; A13: x in dom f by A9, XBOOLE_0:def_4; then consider y1 being set such that A14: [x,y1] in f by XTUPLE_0:def_12; [x,y1] in union X by A7, A14, TARSKI:def_4; then A15: y1 = y2 by A1, A12, FUNCT_1:def_1; thus f . x = y1 by A13, A14, FUNCT_1:def_2 .= g . x by A10, A11, A15, FUNCT_1:def_2 ; ::_thesis: verum end; end; hence ( ( X is functional & X is compatible ) iff union X is Function ) ; ::_thesis: verum end; registration let X, Y be set ; cluster non empty compatible for PartFunc-set of X,Y; existence ex b1 being PFUNC_DOMAIN of X,Y st ( not b1 is empty & b1 is compatible ) proof set A = {{}}; A1: {{}} is compatible proof let f, g be Function; :: according to COMPUT_1:def_1 ::_thesis: ( f in {{}} & g in {{}} implies f tolerates g ) assume that A2: f in {{}} and g in {{}} ; ::_thesis: f tolerates g f = {} by A2, TARSKI:def_1; hence f tolerates g by PARTFUN1:54, XBOOLE_1:2; ::_thesis: verum end; now__::_thesis:_for_x_being_Element_of_{{}}_holds_x_is_PartFunc_of_X,Y let x be Element of {{}}; ::_thesis: x is PartFunc of X,Y x = {} by TARSKI:def_1; hence x is PartFunc of X,Y by XBOOLE_1:2; ::_thesis: verum end; then {{}} is PFUNC_DOMAIN of X,Y by RFUNCT_3:def_3; hence ex b1 being PFUNC_DOMAIN of X,Y st ( not b1 is empty & b1 is compatible ) by A1; ::_thesis: verum end; end; theorem Th12: :: COMPUT_1:12 for X being non empty functional compatible set holds dom (union X) = union { (dom f) where f is Element of X : verum } proof let X be non empty functional compatible set ; ::_thesis: dom (union X) = union { (dom f) where f is Element of X : verum } set F = { (dom f) where f is Element of X : verum } ; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_dom_(union_X)_implies_x_in_union__{__(dom_f)_where_f_is_Element_of_X_:_verum__}__)_&_(_x_in_union__{__(dom_f)_where_f_is_Element_of_X_:_verum__}__implies_x_in_dom_(union_X)_)_) let x be set ; ::_thesis: ( ( x in dom (union X) implies x in union { (dom f) where f is Element of X : verum } ) & ( x in union { (dom f) where f is Element of X : verum } implies x in dom (union X) ) ) hereby ::_thesis: ( x in union { (dom f) where f is Element of X : verum } implies x in dom (union X) ) assume x in dom (union X) ; ::_thesis: x in union { (dom f) where f is Element of X : verum } then consider y being set such that A1: [x,y] in union X by XTUPLE_0:def_12; consider Z being set such that A2: [x,y] in Z and A3: Z in X by A1, TARSKI:def_4; reconsider Z = Z as Element of X by A3; A4: dom Z in { (dom f) where f is Element of X : verum } ; x in dom Z by A2, XTUPLE_0:def_12; hence x in union { (dom f) where f is Element of X : verum } by A4, TARSKI:def_4; ::_thesis: verum end; assume x in union { (dom f) where f is Element of X : verum } ; ::_thesis: x in dom (union X) then consider Z being set such that A5: x in Z and A6: Z in { (dom f) where f is Element of X : verum } by TARSKI:def_4; consider f being Element of X such that A7: Z = dom f and verum by A6; consider y being set such that A8: [x,y] in f by A5, A7, XTUPLE_0:def_12; [x,y] in union X by A8, TARSKI:def_4; hence x in dom (union X) by XTUPLE_0:def_12; ::_thesis: verum end; hence dom (union X) = union { (dom f) where f is Element of X : verum } by TARSKI:1; ::_thesis: verum end; theorem Th13: :: COMPUT_1:13 for X being functional compatible set for f being Function st f in X holds ( dom f c= dom (union X) & ( for x being set st x in dom f holds (union X) . x = f . x ) ) proof let X be functional compatible set ; ::_thesis: for f being Function st f in X holds ( dom f c= dom (union X) & ( for x being set st x in dom f holds (union X) . x = f . x ) ) let f be Function; ::_thesis: ( f in X implies ( dom f c= dom (union X) & ( for x being set st x in dom f holds (union X) . x = f . x ) ) ) assume A1: f in X ; ::_thesis: ( dom f c= dom (union X) & ( for x being set st x in dom f holds (union X) . x = f . x ) ) thus dom f c= dom (union X) ::_thesis: for x being set st x in dom f holds (union X) . x = f . x proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom f or x in dom (union X) ) assume x in dom f ; ::_thesis: x in dom (union X) then consider y being set such that A2: [x,y] in f by XTUPLE_0:def_12; [x,y] in union X by A1, A2, TARSKI:def_4; hence x in dom (union X) by XTUPLE_0:def_12; ::_thesis: verum end; let x be set ; ::_thesis: ( x in dom f implies (union X) . x = f . x ) assume x in dom f ; ::_thesis: (union X) . x = f . x then consider y being set such that A3: [x,y] in f by XTUPLE_0:def_12; [x,y] in union X by A1, A3, TARSKI:def_4; hence (union X) . x = y by FUNCT_1:1 .= f . x by A3, FUNCT_1:1 ; ::_thesis: verum end; theorem Th14: :: COMPUT_1:14 for X being non empty functional compatible set holds rng (union X) = union { (rng f) where f is Element of X : verum } proof let X be non empty functional compatible set ; ::_thesis: rng (union X) = union { (rng f) where f is Element of X : verum } set F = { (rng f) where f is Element of X : verum } ; now__::_thesis:_for_y_being_set_holds_ (_(_y_in_rng_(union_X)_implies_y_in_union__{__(rng_f)_where_f_is_Element_of_X_:_verum__}__)_&_(_y_in_union__{__(rng_f)_where_f_is_Element_of_X_:_verum__}__implies_y_in_rng_(union_X)_)_) let y be set ; ::_thesis: ( ( y in rng (union X) implies y in union { (rng f) where f is Element of X : verum } ) & ( y in union { (rng f) where f is Element of X : verum } implies y in rng (union X) ) ) hereby ::_thesis: ( y in union { (rng f) where f is Element of X : verum } implies y in rng (union X) ) assume y in rng (union X) ; ::_thesis: y in union { (rng f) where f is Element of X : verum } then consider x being set such that A1: [x,y] in union X by XTUPLE_0:def_13; consider Z being set such that A2: [x,y] in Z and A3: Z in X by A1, TARSKI:def_4; reconsider Z = Z as Element of X by A3; A4: rng Z in { (rng f) where f is Element of X : verum } ; y in rng Z by A2, XTUPLE_0:def_13; hence y in union { (rng f) where f is Element of X : verum } by A4, TARSKI:def_4; ::_thesis: verum end; assume y in union { (rng f) where f is Element of X : verum } ; ::_thesis: y in rng (union X) then consider Z being set such that A5: y in Z and A6: Z in { (rng f) where f is Element of X : verum } by TARSKI:def_4; consider f being Element of X such that A7: Z = rng f and verum by A6; consider x being set such that A8: [x,y] in f by A5, A7, XTUPLE_0:def_13; [x,y] in union X by A8, TARSKI:def_4; hence y in rng (union X) by XTUPLE_0:def_13; ::_thesis: verum end; hence rng (union X) = union { (rng f) where f is Element of X : verum } by TARSKI:1; ::_thesis: verum end; registration let X, Y be set ; cluster non empty -> functional for PartFunc-set of X,Y; coherence for b1 being PFUNC_DOMAIN of X,Y holds b1 is functional proof let P be PFUNC_DOMAIN of X,Y; ::_thesis: P is functional let x be set ; :: according to FUNCT_1:def_13 ::_thesis: ( not x in P or x is set ) assume x in P ; ::_thesis: x is set hence x is set by RFUNCT_3:def_3; ::_thesis: verum end; end; theorem Th15: :: COMPUT_1:15 for X, Y being set for P being compatible PFUNC_DOMAIN of X,Y holds union P is PartFunc of X,Y proof let X, Y be set ; ::_thesis: for P being compatible PFUNC_DOMAIN of X,Y holds union P is PartFunc of X,Y let D be compatible PFUNC_DOMAIN of X,Y; ::_thesis: union D is PartFunc of X,Y set E = { (dom f) where f is Element of D : verum } ; set F = { (rng f) where f is Element of D : verum } ; reconsider u = union D as Function ; A1: rng u c= Y proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng u or y in Y ) assume y in rng u ; ::_thesis: y in Y then y in union { (rng f) where f is Element of D : verum } by Th14; then consider Z being set such that A2: y in Z and A3: Z in { (rng f) where f is Element of D : verum } by TARSKI:def_4; consider f being Element of D such that A4: Z = rng f and verum by A3; rng f c= Y by RELAT_1:def_19; hence y in Y by A2, A4; ::_thesis: verum end; dom u c= X proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom u or x in X ) assume x in dom u ; ::_thesis: x in X then x in union { (dom f) where f is Element of D : verum } by Th12; then consider Z being set such that A5: x in Z and A6: Z in { (dom f) where f is Element of D : verum } by TARSKI:def_4; ex f being Element of D st Z = dom f by A6; hence x in X by A5; ::_thesis: verum end; hence union D is PartFunc of X,Y by A1, RELSET_1:4; ::_thesis: verum end; begin notation let f be Relation; synonym to-naturals f for natural-valued ; end; registration cluster Relation-like NAT * -defined Function-like to-naturals for set ; existence ex b1 being Function st ( b1 is NAT * -defined & b1 is to-naturals ) proof take f = {} ; ::_thesis: ( f is NAT * -defined & f is to-naturals ) thus dom f c= NAT * by XBOOLE_1:2; :: according to RELAT_1:def_18 ::_thesis: f is to-naturals thus f is to-naturals ; ::_thesis: verum end; end; definition let f be NAT * -defined Relation; attrf is len-total means :Def2: :: COMPUT_1:def 2 for x, y being FinSequence of NAT st len x = len y & x in dom f holds y in dom f; end; :: deftheorem Def2 defines len-total COMPUT_1:def_2_:_ for f being NAT * -defined Relation holds ( f is len-total iff for x, y being FinSequence of NAT st len x = len y & x in dom f holds y in dom f ); theorem Th16: :: COMPUT_1:16 for n being Element of NAT for D being non empty set for R being Relation st dom R c= n -tuples_on D holds R is homogeneous proof let n be Element of NAT ; ::_thesis: for D being non empty set for R being Relation st dom R c= n -tuples_on D holds R is homogeneous let D be non empty set ; ::_thesis: for R being Relation st dom R c= n -tuples_on D holds R is homogeneous let R be Relation; ::_thesis: ( dom R c= n -tuples_on D implies R is homogeneous ) assume dom R c= n -tuples_on D ; ::_thesis: R is homogeneous hence dom R is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; registration cluster empty Relation-like -> homogeneous for set ; coherence for b1 being Relation st b1 is empty holds b1 is homogeneous proof let R be Relation; ::_thesis: ( R is empty implies R is homogeneous ) assume A1: R is empty ; ::_thesis: R is homogeneous thus dom R is with_common_domain by A1; :: according to MARGREL1:def_21 ::_thesis: verum end; end; registration let p be FinSequence; let x be set ; clusterp .--> x -> non empty homogeneous ; coherence ( not p .--> x is empty & p .--> x is homogeneous ) proof set f = p .--> x; thus not p .--> x is empty ; ::_thesis: p .--> x is homogeneous thus dom (p .--> x) is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; end; registration cluster non empty Relation-like Function-like homogeneous for set ; existence ex b1 being Function st ( not b1 is empty & b1 is homogeneous ) proof set p = the FinSequence; take the FinSequence .--> 0 ; ::_thesis: ( not the FinSequence .--> 0 is empty & the FinSequence .--> 0 is homogeneous ) thus ( not the FinSequence .--> 0 is empty & the FinSequence .--> 0 is homogeneous ) ; ::_thesis: verum end; end; registration let f be homogeneous Function; let g be Function; clusterf * g -> homogeneous ; coherence g * f is homogeneous proof dom (g * f) c= dom f by RELAT_1:25; hence dom (g * f) is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; end; registration let X, Y be set ; cluster Relation-like X * -defined Y -valued Function-like homogeneous for Element of K32(K33((X *),Y)); existence ex b1 being PartFunc of (X *),Y st b1 is homogeneous proof set f = {} ; reconsider f = {} as PartFunc of (X *),Y by XBOOLE_1:2; take f ; ::_thesis: f is homogeneous thus dom f is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; end; registration let X, Y be non empty set ; cluster non empty Relation-like X * -defined Y -valued Function-like homogeneous for Element of K32(K33((X *),Y)); existence ex b1 being PartFunc of (X *),Y st ( not b1 is empty & b1 is homogeneous ) proof set y = the Element of Y; reconsider Z = 0 -tuples_on X as non empty Subset of (X *) by Th10; reconsider f = Z --> the Element of Y as PartFunc of (X *),Y ; take f ; ::_thesis: ( not f is empty & f is homogeneous ) thus not f is empty ; ::_thesis: f is homogeneous thus dom f is with_common_domain by FUNCOP_1:13; :: according to MARGREL1:def_21 ::_thesis: verum end; end; registration let X be non empty set ; cluster non empty Relation-like X * -defined X -valued Function-like homogeneous quasi_total for Element of K32(K33((X *),X)); existence ex b1 being PartFunc of (X *),X st ( not b1 is empty & b1 is homogeneous & b1 is quasi_total ) proof set n = the Element of NAT ; set y = the Element of X; reconsider Z = the Element of NAT -tuples_on X as non empty Subset of (X *) by Th10; reconsider f = Z --> the Element of X as PartFunc of (X *),X ; take f ; ::_thesis: ( not f is empty & f is homogeneous & f is quasi_total ) thus not f is empty ; ::_thesis: ( f is homogeneous & f is quasi_total ) A1: dom f = Z by FUNCOP_1:13; thus f is homogeneous ::_thesis: f is quasi_total proof thus dom f is with_common_domain by A1; :: according to MARGREL1:def_21 ::_thesis: verum end; let p, q be FinSequence of X; :: according to MARGREL1:def_22 ::_thesis: ( not len p = len q or not p in dom f or q in dom f ) assume that A2: len p = len q and A3: p in dom f ; ::_thesis: q in dom f len q = the Element of NAT by A1, A2, A3, CARD_1:def_7; then q is Element of Z by FINSEQ_2:92; hence q in dom f by A1; ::_thesis: verum end; end; registration cluster non empty Relation-like NAT * -defined Function-like to-naturals homogeneous len-total for set ; existence ex b1 being NAT * -defined Function st ( not b1 is empty & b1 is homogeneous & b1 is to-naturals & b1 is len-total ) proof reconsider Z = 0 -tuples_on NAT as non empty Subset of (NAT *) by Th10; set f = Z --> 0; A1: dom (Z --> 0) = Z by FUNCOP_1:13; reconsider f = Z --> 0 as NAT * -defined Function ; A2: f is len-total proof let x, y be FinSequence of NAT ; :: according to COMPUT_1:def_2 ::_thesis: ( len x = len y & x in dom f implies y in dom f ) assume that A3: len x = len y and A4: x in dom f ; ::_thesis: y in dom f A5: y is Element of (len y) -tuples_on NAT by FINSEQ_2:92; len x = 0 by A1, A4; hence y in dom f by A1, A3, A5; ::_thesis: verum end; take f ; ::_thesis: ( not f is empty & f is homogeneous & f is to-naturals & f is len-total ) f is homogeneous proof thus dom f is with_common_domain by FUNCOP_1:13; :: according to MARGREL1:def_21 ::_thesis: verum end; hence ( not f is empty & f is homogeneous & f is to-naturals & f is len-total ) by A2; ::_thesis: verum end; end; registration cluster Function-like -> NAT * -defined to-naturals for Element of K32(K33((NAT *),NAT)); coherence for b1 being PartFunc of (NAT *),NAT holds ( b1 is to-naturals & b1 is NAT * -defined ) ; end; registration cluster Function-like quasi_total -> len-total for Element of K32(K33((NAT *),NAT)); coherence for b1 being PartFunc of (NAT *),NAT st b1 is quasi_total holds b1 is len-total proof let f be PartFunc of (NAT *),NAT; ::_thesis: ( f is quasi_total implies f is len-total ) assume A1: f is quasi_total ; ::_thesis: f is len-total let x, y be FinSequence of NAT ; :: according to COMPUT_1:def_2 ::_thesis: ( len x = len y & x in dom f implies y in dom f ) assume that A2: len x = len y and A3: x in dom f ; ::_thesis: y in dom f thus y in dom f by A1, A2, A3, MARGREL1:def_22; ::_thesis: verum end; end; theorem Th17: :: COMPUT_1:17 for g being NAT * -defined to-naturals len-total Function holds g is quasi_total PartFunc of (NAT *),NAT proof let g be NAT * -defined to-naturals len-total Function; ::_thesis: g is quasi_total PartFunc of (NAT *),NAT A1: rng g c= NAT by VALUED_0:def_6; dom g c= NAT * ; then reconsider g9 = g as PartFunc of (NAT *),NAT by A1, RELSET_1:4; for x, y being FinSequence of NAT st len x = len y & x in dom g holds y in dom g by Def2; then g9 is quasi_total by MARGREL1:def_22; hence g is quasi_total PartFunc of (NAT *),NAT ; ::_thesis: verum end; theorem Th18: :: COMPUT_1:18 arity {} = 0 proof for x being FinSequence holds not x in dom {} ; hence arity {} = 0 by MARGREL1:def_25; ::_thesis: verum end; theorem Th19: :: COMPUT_1:19 for f being homogeneous Relation st dom f = {{}} holds arity f = 0 proof let f be homogeneous Relation; ::_thesis: ( dom f = {{}} implies arity f = 0 ) assume dom f = {{}} ; ::_thesis: arity f = 0 then {} in dom f by TARSKI:def_1; hence arity f = 0 by CARD_1:27, MARGREL1:def_25; ::_thesis: verum end; theorem Th20: :: COMPUT_1:20 for X, Y being set for f being homogeneous PartFunc of (X *),Y holds dom f c= (arity f) -tuples_on X proof let X, Y be set ; ::_thesis: for f being homogeneous PartFunc of (X *),Y holds dom f c= (arity f) -tuples_on X let f be homogeneous PartFunc of (X *),Y; ::_thesis: dom f c= (arity f) -tuples_on X let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom f or x in (arity f) -tuples_on X ) assume A1: x in dom f ; ::_thesis: x in (arity f) -tuples_on X percases ( X is empty or not X is empty ) ; supposeA2: X is empty ; ::_thesis: x in (arity f) -tuples_on X then x = <*> (X *) by A1, FUNCT_7:17, TARSKI:def_1; then A3: arity f = len (<*> (X *)) by A1, MARGREL1:def_25; 0 -tuples_on X = {{}} by Th5; hence x in (arity f) -tuples_on X by A1, A2, A3, FUNCT_7:17; ::_thesis: verum end; suppose not X is empty ; ::_thesis: x in (arity f) -tuples_on X then reconsider X9 = X as non empty set ; reconsider x9 = x as FinSequence of X9 by A1, FINSEQ_1:def_11; len x9 = arity f by A1, MARGREL1:def_25; then x9 is Element of (arity f) -tuples_on X9 by FINSEQ_2:92; hence x in (arity f) -tuples_on X ; ::_thesis: verum end; end; end; theorem Th21: :: COMPUT_1:21 for f being NAT * -defined homogeneous Function holds dom f c= (arity f) -tuples_on NAT proof let f be NAT * -defined homogeneous Function; ::_thesis: dom f c= (arity f) -tuples_on NAT let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom f or x in (arity f) -tuples_on NAT ) assume A1: x in dom f ; ::_thesis: x in (arity f) -tuples_on NAT reconsider x9 = x as FinSequence of NAT by A1, FINSEQ_1:def_11; len x9 = arity f by A1, MARGREL1:def_25; then x9 is Element of (arity f) -tuples_on NAT by FINSEQ_2:92; hence x in (arity f) -tuples_on NAT ; ::_thesis: verum end; Lm1: for D being non empty set for f being homogeneous PartFunc of (D *),D holds ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on D ) proof let D be non empty set ; ::_thesis: for f being homogeneous PartFunc of (D *),D holds ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on D ) set X = D; let f be homogeneous PartFunc of (D *),D; ::_thesis: ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on D ) A1: dom f c= (arity f) -tuples_on D by Th20; hereby ::_thesis: ( dom f = (arity f) -tuples_on D implies ( f is quasi_total & not f is empty ) ) assume ( f is quasi_total & not f is empty ) ; ::_thesis: dom f = (arity f) -tuples_on D then reconsider f9 = f as non empty homogeneous quasi_total PartFunc of (D *),D ; consider x being set such that A2: x in dom f9 by XBOOLE_0:def_1; reconsider x9 = x as FinSequence of D by A2, FINSEQ_1:def_11; A3: len x9 = arity f by A2, MARGREL1:def_25; now__::_thesis:_for_z_being_set_holds_ (_(_z_in_dom_f_implies_z_in_(arity_f)_-tuples_on_D_)_&_(_z_in_(arity_f)_-tuples_on_D_implies_z_in_dom_f_)_) let z be set ; ::_thesis: ( ( z in dom f implies z in (arity f) -tuples_on D ) & ( z in (arity f) -tuples_on D implies z in dom f ) ) thus ( z in dom f implies z in (arity f) -tuples_on D ) by A1; ::_thesis: ( z in (arity f) -tuples_on D implies z in dom f ) assume z in (arity f) -tuples_on D ; ::_thesis: z in dom f then reconsider z9 = z as Element of (arity f) -tuples_on D ; len z9 = arity f by CARD_1:def_7; hence z in dom f by A2, A3, MARGREL1:def_22; ::_thesis: verum end; hence dom f = (arity f) -tuples_on D by TARSKI:1; ::_thesis: verum end; assume A4: dom f = (arity f) -tuples_on D ; ::_thesis: ( f is quasi_total & not f is empty ) thus f is quasi_total ::_thesis: not f is empty proof let x, y be FinSequence of D; :: according to MARGREL1:def_22 ::_thesis: ( not len x = len y or not x in dom f or y in dom f ) assume that A5: len x = len y and A6: x in dom f ; ::_thesis: y in dom f len x = arity f by A4, A6, CARD_1:def_7; then y is Element of (arity f) -tuples_on D by A5, FINSEQ_2:92; hence y in dom f by A4; ::_thesis: verum end; thus not f is empty by A4; ::_thesis: verum end; theorem Th22: :: COMPUT_1:22 for X being set for f being homogeneous PartFunc of (X *),X holds ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) proof let X be set ; ::_thesis: for f being homogeneous PartFunc of (X *),X holds ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) let f be homogeneous PartFunc of (X *),X; ::_thesis: ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) percases ( X is empty or not X is empty ) ; suppose X is empty ; ::_thesis: ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) then f = {} ; hence ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) by Th5, Th18; ::_thesis: verum end; suppose not X is empty ; ::_thesis: ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) hence ( ( f is quasi_total & not f is empty ) iff dom f = (arity f) -tuples_on X ) by Lm1; ::_thesis: verum end; end; end; theorem Th23: :: COMPUT_1:23 for f being NAT * -defined to-naturals homogeneous Function holds ( ( f is len-total & not f is empty ) iff dom f = (arity f) -tuples_on NAT ) proof let f be NAT * -defined to-naturals homogeneous Function; ::_thesis: ( ( f is len-total & not f is empty ) iff dom f = (arity f) -tuples_on NAT ) A1: dom f c= (arity f) -tuples_on NAT by Th21; hereby ::_thesis: ( dom f = (arity f) -tuples_on NAT implies ( f is len-total & not f is empty ) ) assume ( f is len-total & not f is empty ) ; ::_thesis: dom f = (arity f) -tuples_on NAT then reconsider f9 = f as non empty homogeneous quasi_total PartFunc of (NAT *),NAT by Th17; consider x being set such that A2: x in dom f9 by XBOOLE_0:def_1; reconsider x9 = x as FinSequence of NAT by A2, FINSEQ_1:def_11; A3: len x9 = arity f by A2, MARGREL1:def_25; now__::_thesis:_for_z_being_set_holds_ (_(_z_in_dom_f_implies_z_in_(arity_f)_-tuples_on_NAT_)_&_(_z_in_(arity_f)_-tuples_on_NAT_implies_z_in_dom_f_)_) let z be set ; ::_thesis: ( ( z in dom f implies z in (arity f) -tuples_on NAT ) & ( z in (arity f) -tuples_on NAT implies z in dom f ) ) thus ( z in dom f implies z in (arity f) -tuples_on NAT ) by A1; ::_thesis: ( z in (arity f) -tuples_on NAT implies z in dom f ) assume z in (arity f) -tuples_on NAT ; ::_thesis: z in dom f then reconsider z9 = z as Element of (arity f) -tuples_on NAT ; len z9 = arity f by CARD_1:def_7; hence z in dom f by A2, A3, MARGREL1:def_22; ::_thesis: verum end; hence dom f = (arity f) -tuples_on NAT by TARSKI:1; ::_thesis: verum end; assume A4: dom f = (arity f) -tuples_on NAT ; ::_thesis: ( f is len-total & not f is empty ) thus f is len-total ::_thesis: not f is empty proof let x, y be FinSequence of NAT ; :: according to COMPUT_1:def_2 ::_thesis: ( len x = len y & x in dom f implies y in dom f ) assume that A5: len x = len y and A6: x in dom f ; ::_thesis: y in dom f len x = arity f by A4, A6, CARD_1:def_7; then y is Element of (arity f) -tuples_on NAT by A5, FINSEQ_2:92; hence y in dom f by A4; ::_thesis: verum end; thus not f is empty by A4; ::_thesis: verum end; theorem :: COMPUT_1:24 for D being non empty set for f being non empty homogeneous PartFunc of (D *),D for n being Element of NAT st dom f c= n -tuples_on D holds arity f = n proof let D be non empty set ; ::_thesis: for f being non empty homogeneous PartFunc of (D *),D for n being Element of NAT st dom f c= n -tuples_on D holds arity f = n let f be non empty homogeneous PartFunc of (D *),D; ::_thesis: for n being Element of NAT st dom f c= n -tuples_on D holds arity f = n let n be Element of NAT ; ::_thesis: ( dom f c= n -tuples_on D implies arity f = n ) consider x being set such that A1: x in dom f by XBOOLE_0:def_1; assume A2: dom f c= n -tuples_on D ; ::_thesis: arity f = n then A3: for x being FinSequence st x in dom f holds n = len x by CARD_1:def_7; reconsider x = x as Element of n -tuples_on D by A2, A1; x in dom f by A1; hence arity f = n by A3, MARGREL1:def_25; ::_thesis: verum end; theorem Th25: :: COMPUT_1:25 for D being non empty set for f being homogeneous PartFunc of (D *),D for n being Element of NAT st dom f = n -tuples_on D holds arity f = n proof let D be non empty set ; ::_thesis: for f being homogeneous PartFunc of (D *),D for n being Element of NAT st dom f = n -tuples_on D holds arity f = n let f be homogeneous PartFunc of (D *),D; ::_thesis: for n being Element of NAT st dom f = n -tuples_on D holds arity f = n let n be Element of NAT ; ::_thesis: ( dom f = n -tuples_on D implies arity f = n ) consider x being set such that A1: x in n -tuples_on D by XBOOLE_0:def_1; reconsider x = x as Element of n -tuples_on D by A1; assume A2: dom f = n -tuples_on D ; ::_thesis: arity f = n then A3: for x being FinSequence st x in dom f holds len x = n by CARD_1:def_7; x in dom f by A2; hence arity f = n by A3, MARGREL1:def_25; ::_thesis: verum end; definition let R be Relation; attrR is with_the_same_arity means :Def3: :: COMPUT_1:def 3 for f, g being Function st f in rng R & g in rng R holds ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ); end; :: deftheorem Def3 defines with_the_same_arity COMPUT_1:def_3_:_ for R being Relation holds ( R is with_the_same_arity iff for f, g being Function st f in rng R & g in rng R holds ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) ); registration cluster empty Relation-like -> with_the_same_arity for set ; coherence for b1 being Relation st b1 is empty holds b1 is with_the_same_arity proof let R be Relation; ::_thesis: ( R is empty implies R is with_the_same_arity ) assume A1: R is empty ; ::_thesis: R is with_the_same_arity let f, g be Function; :: according to COMPUT_1:def_3 ::_thesis: ( f in rng R & g in rng R implies ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) ) thus ( f in rng R & g in rng R implies ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) ) by A1; ::_thesis: verum end; end; registration let X be set ; cluster Relation-like NAT -defined X -valued Function-like finite countable FinSequence-like FinSubsequence-like with_the_same_arity for FinSequence of X; existence ex b1 being FinSequence of X st b1 is with_the_same_arity proof take <*> X ; ::_thesis: <*> X is with_the_same_arity thus <*> X is with_the_same_arity ; ::_thesis: verum end; cluster Relation-like NAT -defined X -valued Function-like finite countable FinSequence-like FinSubsequence-like with_the_same_arity for Element of X * ; existence ex b1 being Element of X * st b1 is with_the_same_arity proof reconsider p = <*> X as Element of X * by FINSEQ_1:def_11; take p ; ::_thesis: p is with_the_same_arity thus p is with_the_same_arity ; ::_thesis: verum end; end; definition let F be with_the_same_arity Relation; func arity F -> Element of NAT means :Def4: :: COMPUT_1:def 4 for f being homogeneous Function st f in rng F holds it = arity f if ex f being homogeneous Function st f in rng F otherwise it = 0 ; existence ( ( ex f being homogeneous Function st f in rng F implies ex b1 being Element of NAT st for f being homogeneous Function st f in rng F holds b1 = arity f ) & ( ( for f being homogeneous Function holds not f in rng F ) implies ex b1 being Element of NAT st b1 = 0 ) ) proof hereby ::_thesis: ( ( for f being homogeneous Function holds not f in rng F ) implies ex b1 being Element of NAT st b1 = 0 ) given f being homogeneous Function such that A1: f in rng F ; ::_thesis: ex i being Element of NAT st for g being homogeneous Function st g in rng F holds b3 = arity b4 take i = arity f; ::_thesis: for g being homogeneous Function st g in rng F holds b2 = arity b3 let g be homogeneous Function; ::_thesis: ( g in rng F implies b1 = arity b2 ) assume A2: g in rng F ; ::_thesis: b1 = arity b2 percases ( f is empty or g is empty or ( not f is empty & not g is empty ) ) ; supposeA3: f is empty ; ::_thesis: b1 = arity b2 thus i = arity g ::_thesis: verum proof percases ( g is empty or dom g = {{}} ) by A1, A2, A3, Def3; suppose g is empty ; ::_thesis: i = arity g hence i = arity g by A3; ::_thesis: verum end; suppose dom g = {{}} ; ::_thesis: i = arity g hence i = arity g by A3, Th18, Th19; ::_thesis: verum end; end; end; end; supposeA4: g is empty ; ::_thesis: b1 = arity b2 thus i = arity g ::_thesis: verum proof percases ( f is empty or dom f = {{}} ) by A1, A2, A4, Def3; suppose f is empty ; ::_thesis: i = arity g hence i = arity g by A4; ::_thesis: verum end; suppose dom f = {{}} ; ::_thesis: i = arity g hence i = arity g by A4, Th18, Th19; ::_thesis: verum end; end; end; end; supposeA5: ( not f is empty & not g is empty ) ; ::_thesis: b1 = arity b2 set a = the Element of dom f; dom f <> {} by A5; then A6: the Element of dom f in dom f ; consider n being Element of NAT , X being non empty set such that A7: dom f c= n -tuples_on X and A8: dom g c= n -tuples_on X by A1, A2, A5, Def3; reconsider a = the Element of dom f as Element of n -tuples_on X by A7, A6; A9: arity f = len a by A5, MARGREL1:def_25 .= n by CARD_1:def_7 ; set a = the Element of dom g; dom g <> {} by A5; then the Element of dom g in dom g ; then reconsider a = the Element of dom g as Element of n -tuples_on X by A8; arity g = len a by A5, MARGREL1:def_25; hence i = arity g by A9, CARD_1:def_7; ::_thesis: verum end; end; end; thus ( ( for f being homogeneous Function holds not f in rng F ) implies ex b1 being Element of NAT st b1 = 0 ) ; ::_thesis: verum end; uniqueness for b1, b2 being Element of NAT holds ( ( ex f being homogeneous Function st f in rng F & ( for f being homogeneous Function st f in rng F holds b1 = arity f ) & ( for f being homogeneous Function st f in rng F holds b2 = arity f ) implies b1 = b2 ) & ( ( for f being homogeneous Function holds not f in rng F ) & b1 = 0 & b2 = 0 implies b1 = b2 ) ) proof let i1, i2 be Element of NAT ; ::_thesis: ( ( ex f being homogeneous Function st f in rng F & ( for f being homogeneous Function st f in rng F holds i1 = arity f ) & ( for f being homogeneous Function st f in rng F holds i2 = arity f ) implies i1 = i2 ) & ( ( for f being homogeneous Function holds not f in rng F ) & i1 = 0 & i2 = 0 implies i1 = i2 ) ) hereby ::_thesis: ( ( for f being homogeneous Function holds not f in rng F ) & i1 = 0 & i2 = 0 implies i1 = i2 ) given f being homogeneous Function such that A10: f in rng F ; ::_thesis: ( ( for f being homogeneous Function st f in rng F holds i1 = arity f ) & ( for f being homogeneous Function st f in rng F holds i2 = arity f ) implies i1 = i2 ) assume for f being homogeneous Function st f in rng F holds i1 = arity f ; ::_thesis: ( ( for f being homogeneous Function st f in rng F holds i2 = arity f ) implies i1 = i2 ) then i1 = arity f by A10; hence ( ( for f being homogeneous Function st f in rng F holds i2 = arity f ) implies i1 = i2 ) by A10; ::_thesis: verum end; thus ( ( for f being homogeneous Function holds not f in rng F ) & i1 = 0 & i2 = 0 implies i1 = i2 ) ; ::_thesis: verum end; correctness consistency for b1 being Element of NAT holds verum; ; end; :: deftheorem Def4 defines arity COMPUT_1:def_4_:_ for F being with_the_same_arity Relation for b2 being Element of NAT holds ( ( ex f being homogeneous Function st f in rng F implies ( b2 = arity F iff for f being homogeneous Function st f in rng F holds b2 = arity f ) ) & ( ( for f being homogeneous Function holds not f in rng F ) implies ( b2 = arity F iff b2 = 0 ) ) ); theorem :: COMPUT_1:26 for F being with_the_same_arity FinSequence st len F = 0 holds arity F = 0 proof let F be with_the_same_arity FinSequence; ::_thesis: ( len F = 0 implies arity F = 0 ) assume len F = 0 ; ::_thesis: arity F = 0 then F = {} ; then for f being homogeneous Function holds not f in rng F ; hence arity F = 0 by Def4; ::_thesis: verum end; definition let X be set ; func HFuncs X -> PFUNC_DOMAIN of X * ,X equals :: COMPUT_1:def 5 { f where f is Element of PFuncs ((X *),X) : f is homogeneous } ; coherence { f where f is Element of PFuncs ((X *),X) : f is homogeneous } is PFUNC_DOMAIN of X * ,X proof set H = { f where f is Element of PFuncs ((X *),X) : f is homogeneous } ; ( not { f where f is Element of PFuncs ((X *),X) : f is homogeneous } is empty & { f where f is Element of PFuncs ((X *),X) : f is homogeneous } is functional ) proof {} is PartFunc of (X *),X by RELSET_1:12; then {} in PFuncs ((X *),X) by PARTFUN1:45; then {} in { f where f is Element of PFuncs ((X *),X) : f is homogeneous } ; hence not { f where f is Element of PFuncs ((X *),X) : f is homogeneous } is empty ; ::_thesis: { f where f is Element of PFuncs ((X *),X) : f is homogeneous } is functional let x be set ; :: according to FUNCT_1:def_13 ::_thesis: ( not x in { f where f is Element of PFuncs ((X *),X) : f is homogeneous } or x is set ) assume x in { f where f is Element of PFuncs ((X *),X) : f is homogeneous } ; ::_thesis: x is set then ex g being Element of PFuncs ((X *),X) st ( x = g & g is homogeneous ) ; hence x is set ; ::_thesis: verum end; then reconsider H = { f where f is Element of PFuncs ((X *),X) : f is homogeneous } as non empty functional set ; now__::_thesis:_for_f_being_Element_of_H_holds_f_is_PartFunc_of_(X_*),X let f be Element of H; ::_thesis: f is PartFunc of (X *),X f in H ; then ex g being Element of PFuncs ((X *),X) st ( f = g & g is homogeneous ) ; hence f is PartFunc of (X *),X ; ::_thesis: verum end; hence { f where f is Element of PFuncs ((X *),X) : f is homogeneous } is PFUNC_DOMAIN of X * ,X by RFUNCT_3:def_3; ::_thesis: verum end; end; :: deftheorem defines HFuncs COMPUT_1:def_5_:_ for X being set holds HFuncs X = { f where f is Element of PFuncs ((X *),X) : f is homogeneous } ; theorem :: COMPUT_1:27 for X being set holds {} in HFuncs X proof let X be set ; ::_thesis: {} in HFuncs X set f = {} ; reconsider f = {} as PartFunc of (X *),X by XBOOLE_1:2; reconsider f = f as Element of PFuncs ((X *),X) by PARTFUN1:45; f in { g where g is Element of PFuncs ((X *),X) : g is homogeneous } ; hence {} in HFuncs X ; ::_thesis: verum end; registration let X be non empty set ; cluster non empty Relation-like X * -defined X -valued Function-like homogeneous quasi_total for Element of HFuncs X; existence ex b1 being Element of HFuncs X st ( not b1 is empty & b1 is homogeneous & b1 is quasi_total ) proof set p = <*> X; set x = the Element of X; <*> X in X * by FINSEQ_1:def_11; then reconsider Y = {(<*> X)} as Subset of (X *) by ZFMISC_1:31; A1: Y --> the Element of X in PFuncs ((X *),X) ; (<*> X) .--> the Element of X is homogeneous ; then {(<*> X)} --> the Element of X in { f where f is Element of PFuncs ((X *),X) : f is homogeneous } by A1; then reconsider f = (<*> X) .--> the Element of X as Element of HFuncs X ; take f ; ::_thesis: ( not f is empty & f is homogeneous & f is quasi_total ) A2: dom f = {(<*> X)} by FUNCOP_1:13; thus ( not f is empty & f is homogeneous ) ; ::_thesis: f is quasi_total let a, b be FinSequence of X; :: according to MARGREL1:def_22 ::_thesis: ( not len a = len b or not a in dom f or b in dom f ) assume A3: len a = len b ; ::_thesis: ( not a in dom f or b in dom f ) assume a in dom f ; ::_thesis: b in dom f then a = <*> X by A2, TARSKI:def_1; then b = {} by A3; hence b in dom f by A2, TARSKI:def_1; ::_thesis: verum end; end; registration let X be set ; cluster -> homogeneous for Element of HFuncs X; coherence for b1 being Element of HFuncs X holds b1 is homogeneous proof let f be Element of HFuncs X; ::_thesis: f is homogeneous f in HFuncs X ; then ex g being Element of PFuncs ((X *),X) st ( f = g & g is homogeneous ) ; hence f is homogeneous ; ::_thesis: verum end; end; registration let X be non empty set ; let S be non empty Subset of (HFuncs X); cluster -> homogeneous for Element of S; coherence for b1 being Element of S holds b1 is homogeneous ; end; theorem Th28: :: COMPUT_1:28 for f being NAT * -defined to-naturals homogeneous Function holds f is Element of HFuncs NAT proof let f be NAT * -defined to-naturals homogeneous Function; ::_thesis: f is Element of HFuncs NAT A1: rng f c= NAT by VALUED_0:def_6; dom f c= NAT * ; then f is PartFunc of (NAT *),NAT by A1, RELSET_1:4; then reconsider f9 = f as Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; f9 in { f1 where f1 is Element of PFuncs ((NAT *),NAT) : f1 is homogeneous } ; hence f is Element of HFuncs NAT ; ::_thesis: verum end; theorem Th29: :: COMPUT_1:29 for f being NAT * -defined to-naturals homogeneous len-total Function holds f is quasi_total Element of HFuncs NAT proof let f be NAT * -defined to-naturals homogeneous len-total Function; ::_thesis: f is quasi_total Element of HFuncs NAT reconsider f9 = f as Element of HFuncs NAT by Th28; f9 is quasi_total proof let x, y be FinSequence of NAT ; :: according to MARGREL1:def_22 ::_thesis: ( not len x = len y or not x in dom f9 or y in dom f9 ) assume that A1: len x = len y and A2: x in dom f9 ; ::_thesis: y in dom f9 thus y in dom f9 by A1, A2, Def2; ::_thesis: verum end; hence f is quasi_total Element of HFuncs NAT ; ::_thesis: verum end; theorem Th30: :: COMPUT_1:30 for X being non empty set for F being Relation st rng F c= HFuncs X & ( for f, g being homogeneous Function st f in rng F & g in rng F holds arity f = arity g ) holds F is with_the_same_arity proof let X be non empty set ; ::_thesis: for F being Relation st rng F c= HFuncs X & ( for f, g being homogeneous Function st f in rng F & g in rng F holds arity f = arity g ) holds F is with_the_same_arity let R be Relation; ::_thesis: ( rng R c= HFuncs X & ( for f, g being homogeneous Function st f in rng R & g in rng R holds arity f = arity g ) implies R is with_the_same_arity ) assume that A1: rng R c= HFuncs X and A2: for f, g being homogeneous Function st f in rng R & g in rng R holds arity f = arity g ; ::_thesis: R is with_the_same_arity let f, g be Function; :: according to COMPUT_1:def_3 ::_thesis: ( f in rng R & g in rng R implies ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) ) assume that A3: f in rng R and A4: g in rng R ; ::_thesis: ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) reconsider f9 = f, g9 = g as Element of HFuncs X by A1, A3, A4; A5: arity f9 = arity g9 by A2, A3, A4; hereby ::_thesis: ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) assume f is empty ; ::_thesis: ( g is empty or dom g = {{}} ) then dom g9 c= 0 -tuples_on X by A5, Th18, Th20; then dom g9 c= {(<*> X)} by FINSEQ_2:94; hence ( g is empty or dom g = {{}} ) by ZFMISC_1:33; ::_thesis: verum end; assume that A6: not f is empty and not g is empty ; ::_thesis: ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) reconsider f9 = f9 as non empty Element of HFuncs X by A6; take arity f9 ; ::_thesis: ex X being non empty set st ( dom f c= (arity f9) -tuples_on X & dom g c= (arity f9) -tuples_on X ) take X ; ::_thesis: ( dom f c= (arity f9) -tuples_on X & dom g c= (arity f9) -tuples_on X ) thus ( dom f c= (arity f9) -tuples_on X & dom g c= (arity f9) -tuples_on X ) by A5, Th20; ::_thesis: verum end; definition let n, m be Element of NAT ; funcn const m -> NAT * -defined to-naturals homogeneous Function equals :: COMPUT_1:def 6 (n -tuples_on NAT) --> m; coherence (n -tuples_on NAT) --> m is NAT * -defined to-naturals homogeneous Function proof set X = NAT ; set f = (n -tuples_on NAT) --> m; A1: n -tuples_on NAT c= NAT * by FINSEQ_2:142; A2: dom ((n -tuples_on NAT) --> m) = n -tuples_on NAT by FUNCOP_1:13; (n -tuples_on NAT) --> m is homogeneous proof thus dom ((n -tuples_on NAT) --> m) is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; hence (n -tuples_on NAT) --> m is NAT * -defined to-naturals homogeneous Function by A1, A2, RELAT_1:def_18; ::_thesis: verum end; end; :: deftheorem defines const COMPUT_1:def_6_:_ for n, m being Element of NAT holds n const m = (n -tuples_on NAT) --> m; theorem Th31: :: COMPUT_1:31 for n, m being Element of NAT holds n const m in HFuncs NAT proof let n, m be Element of NAT ; ::_thesis: n const m in HFuncs NAT set X = NAT ; set f = n const m; A1: rng (n const m) c= NAT by VALUED_0:def_6; dom (n const m) c= NAT * ; then n const m is PartFunc of (NAT *),NAT by A1, RELSET_1:4; then n const m is Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; hence n const m in HFuncs NAT ; ::_thesis: verum end; registration let n, m be Element of NAT ; clustern const m -> non empty NAT * -defined to-naturals homogeneous len-total ; coherence ( n const m is len-total & not n const m is empty ) proof set X = NAT ; A1: dom (n const m) = n -tuples_on NAT by FUNCOP_1:13; n const m is len-total proof let x, y be FinSequence of NAT ; :: according to COMPUT_1:def_2 ::_thesis: ( len x = len y & x in dom (n const m) implies y in dom (n const m) ) assume that A2: len x = len y and A3: x in dom (n const m) ; ::_thesis: y in dom (n const m) len x = n by A1, A3, CARD_1:def_7; then y is Element of n -tuples_on NAT by A2, FINSEQ_2:92; hence y in dom (n const m) by A1; ::_thesis: verum end; hence ( n const m is len-total & not n const m is empty ) ; ::_thesis: verum end; end; theorem Th32: :: COMPUT_1:32 for n, m being Element of NAT holds arity (n const m) = n proof let n, m be Element of NAT ; ::_thesis: arity (n const m) = n set X = NAT ; set d = the Element of n -tuples_on NAT; A1: dom (n const m) = n -tuples_on NAT by FUNCOP_1:13; then A2: for x being FinSequence st x in dom (n const m) holds n = len x by CARD_1:def_7; the Element of n -tuples_on NAT in dom (n const m) by A1; hence arity (n const m) = n by A2, MARGREL1:def_25; ::_thesis: verum end; registration cluster -> NAT * -defined to-naturals homogeneous for Element of HFuncs NAT; coherence for b1 being Element of HFuncs NAT holds ( b1 is homogeneous & b1 is to-naturals & b1 is NAT * -defined ) ; end; definition let n, i be Element of NAT ; funcn succ i -> NAT * -defined to-naturals homogeneous Function means :Def7: :: COMPUT_1:def 7 ( dom it = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds it . p = (p /. i) + 1 ) ); existence ex b1 being NAT * -defined to-naturals homogeneous Function st ( dom b1 = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds b1 . p = (p /. i) + 1 ) ) proof deffunc H1( Element of NAT * ) -> Element of NAT = ($1 /. i) + 1; defpred S1[ set ] means $1 in n -tuples_on NAT; consider f being PartFunc of (NAT *),NAT such that A1: for d being Element of NAT * holds ( d in dom f iff S1[d] ) and A2: for d being Element of NAT * st d in dom f holds f /. d = H1(d) from PARTFUN2:sch_2(); A3: n -tuples_on NAT c= NAT * by FINSEQ_2:142; then A4: for x being set holds ( x in dom f iff x in n -tuples_on NAT ) by A1; then A5: dom f = n -tuples_on NAT by TARSKI:1; reconsider f = f as Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; f is homogeneous proof thus dom f is with_common_domain by A5; :: according to MARGREL1:def_21 ::_thesis: verum end; then f in { g where g is Element of PFuncs ((NAT *),NAT) : g is homogeneous } ; then reconsider f = f as Element of HFuncs NAT ; take f ; ::_thesis: ( dom f = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds f . p = (p /. i) + 1 ) ) thus dom f = n -tuples_on NAT by A4, TARSKI:1; ::_thesis: for p being Element of n -tuples_on NAT holds f . p = (p /. i) + 1 let p be Element of n -tuples_on NAT; ::_thesis: f . p = (p /. i) + 1 p in n -tuples_on NAT ; then reconsider p9 = p as Element of NAT * by A3; thus f . p = f /. p9 by A5, PARTFUN1:def_6 .= (p /. i) + 1 by A2, A5 ; ::_thesis: verum end; uniqueness for b1, b2 being NAT * -defined to-naturals homogeneous Function st dom b1 = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds b1 . p = (p /. i) + 1 ) & dom b2 = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds b2 . p = (p /. i) + 1 ) holds b1 = b2 proof let it1, it2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: ( dom it1 = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds it1 . p = (p /. i) + 1 ) & dom it2 = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds it2 . p = (p /. i) + 1 ) implies it1 = it2 ) assume that A6: dom it1 = n -tuples_on NAT and A7: for p being Element of n -tuples_on NAT holds it1 . p = (p /. i) + 1 and A8: dom it2 = n -tuples_on NAT and A9: for p being Element of n -tuples_on NAT holds it2 . p = (p /. i) + 1 ; ::_thesis: it1 = it2 now__::_thesis:_for_x_being_set_st_x_in_n_-tuples_on_NAT_holds_ it1_._x_=_it2_._x let x be set ; ::_thesis: ( x in n -tuples_on NAT implies it1 . x = it2 . x ) assume x in n -tuples_on NAT ; ::_thesis: it1 . x = it2 . x then reconsider x9 = x as Element of n -tuples_on NAT ; thus it1 . x = (x9 /. i) + 1 by A7 .= it2 . x by A9 ; ::_thesis: verum end; hence it1 = it2 by A6, A8, FUNCT_1:2; ::_thesis: verum end; end; :: deftheorem Def7 defines succ COMPUT_1:def_7_:_ for n, i being Element of NAT for b3 being NAT * -defined to-naturals homogeneous Function holds ( b3 = n succ i iff ( dom b3 = n -tuples_on NAT & ( for p being Element of n -tuples_on NAT holds b3 . p = (p /. i) + 1 ) ) ); theorem Th33: :: COMPUT_1:33 for n, i being Element of NAT holds n succ i in HFuncs NAT proof let n, i be Element of NAT ; ::_thesis: n succ i in HFuncs NAT set X = NAT ; set f = n succ i; A1: rng (n succ i) c= NAT by VALUED_0:def_6; dom (n succ i) c= NAT * ; then n succ i is PartFunc of (NAT *),NAT by A1, RELSET_1:4; then n succ i is Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; hence n succ i in HFuncs NAT ; ::_thesis: verum end; registration let n, i be Element of NAT ; clustern succ i -> non empty NAT * -defined to-naturals homogeneous len-total ; coherence ( n succ i is len-total & not n succ i is empty ) proof A1: dom (n succ i) = n -tuples_on NAT by Def7; n succ i is len-total proof let x, y be FinSequence of NAT ; :: according to COMPUT_1:def_2 ::_thesis: ( len x = len y & x in dom (n succ i) implies y in dom (n succ i) ) assume that A2: len x = len y and A3: x in dom (n succ i) ; ::_thesis: y in dom (n succ i) len x = n by A1, A3, CARD_1:def_7; then y is Element of n -tuples_on NAT by A2, FINSEQ_2:92; hence y in dom (n succ i) by A1; ::_thesis: verum end; hence ( n succ i is len-total & not n succ i is empty ) by A1; ::_thesis: verum end; end; theorem Th34: :: COMPUT_1:34 for n, i being Element of NAT holds arity (n succ i) = n proof let n, i be Element of NAT ; ::_thesis: arity (n succ i) = n consider d being set such that A1: d in dom (n succ i) by XBOOLE_0:def_1; reconsider d = d as Element of n -tuples_on NAT by A1, Def7; dom (n succ i) = n -tuples_on NAT by Def7; then A2: for y being FinSequence st y in dom (n succ i) holds n = len y by CARD_1:def_7; d in dom (n succ i) by A1; hence arity (n succ i) = n by A2, MARGREL1:def_25; ::_thesis: verum end; definition let n, i be Element of NAT ; funcn proj i -> NAT * -defined to-naturals homogeneous Function equals :: COMPUT_1:def 8 proj ((n |-> NAT),i); correctness coherence proj ((n |-> NAT),i) is NAT * -defined to-naturals homogeneous Function; proof A1: dom (proj ((n |-> NAT),i)) = product (n |-> NAT) by CARD_3:def_16 .= n -tuples_on NAT by FINSEQ_3:131 ; now__::_thesis:_proj_((n_|->_NAT),i)_is_Element_of_HFuncs_NAT set P = proj ((n |-> NAT),i); A2: rng (proj ((n |-> NAT),i)) c= NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng (proj ((n |-> NAT),i)) or x in NAT ) assume x in rng (proj ((n |-> NAT),i)) ; ::_thesis: x in NAT then consider d being set such that A3: d in dom (proj ((n |-> NAT),i)) and A4: x = (proj ((n |-> NAT),i)) . d by FUNCT_1:def_3; reconsider d = d as Element of n -tuples_on NAT by A1, A3; reconsider d = d as FinSequence of NAT ; (proj ((n |-> NAT),i)) . d = d . i by A3, CARD_3:def_16; hence x in NAT by A4; ::_thesis: verum end; A5: proj ((n |-> NAT),i) is homogeneous proof thus dom (proj ((n |-> NAT),i)) is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; reconsider P = proj ((n |-> NAT),i) as PartFunc of (NAT *),NAT by A1, A2, FINSEQ_2:142, RELSET_1:4; P is Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; then P in HFuncs NAT by A5; hence proj ((n |-> NAT),i) is Element of HFuncs NAT ; ::_thesis: verum end; hence proj ((n |-> NAT),i) is NAT * -defined to-naturals homogeneous Function ; ::_thesis: verum end; end; :: deftheorem defines proj COMPUT_1:def_8_:_ for n, i being Element of NAT holds n proj i = proj ((n |-> NAT),i); theorem Th35: :: COMPUT_1:35 for n, i being Element of NAT holds n proj i in HFuncs NAT proof let n, i be Element of NAT ; ::_thesis: n proj i in HFuncs NAT set X = NAT ; set f = n proj i; A1: rng (n proj i) c= NAT by VALUED_0:def_6; dom (n proj i) c= NAT * ; then n proj i is PartFunc of (NAT *),NAT by A1, RELSET_1:4; then n proj i is Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; hence n proj i in HFuncs NAT ; ::_thesis: verum end; theorem Th36: :: COMPUT_1:36 for n, i being Element of NAT holds ( dom (n proj i) = n -tuples_on NAT & ( 1 <= i & i <= n implies rng (n proj i) = NAT ) ) proof let n, i be Element of NAT ; ::_thesis: ( dom (n proj i) = n -tuples_on NAT & ( 1 <= i & i <= n implies rng (n proj i) = NAT ) ) thus A1: dom (n proj i) = product (n |-> NAT) by CARD_3:def_16 .= n -tuples_on NAT by FINSEQ_3:131 ; ::_thesis: ( 1 <= i & i <= n implies rng (n proj i) = NAT ) assume that A2: 1 <= i and A3: i <= n ; ::_thesis: rng (n proj i) = NAT now__::_thesis:_for_x_being_set_holds_ (_(_x_in_rng_(n_proj_i)_implies_x_in_NAT_)_&_(_x_in_NAT_implies_x_in_rng_(n_proj_i)_)_) let x be set ; ::_thesis: ( ( x in rng (n proj i) implies x in NAT ) & ( x in NAT implies x in rng (n proj i) ) ) hereby ::_thesis: ( x in NAT implies x in rng (n proj i) ) assume x in rng (n proj i) ; ::_thesis: x in NAT then consider d being set such that d in dom (n proj i) and A4: x = (n proj i) . d by FUNCT_1:def_3; thus x in NAT by A4; ::_thesis: verum end; assume x in NAT ; ::_thesis: x in rng (n proj i) then reconsider x9 = x as Element of NAT ; reconsider d = n |-> x9 as FinSequence of NAT ; i in Seg n by A2, A3, FINSEQ_1:1; then A5: d . i = x9 by FUNCOP_1:7; (n proj i) . d = d . i by A1, CARD_3:def_16; hence x in rng (n proj i) by A1, A5, FUNCT_1:def_3; ::_thesis: verum end; hence rng (n proj i) = NAT by TARSKI:1; ::_thesis: verum end; registration let n, i be Element of NAT ; clustern proj i -> non empty NAT * -defined to-naturals homogeneous len-total ; coherence ( n proj i is len-total & not n proj i is empty ) proof A1: dom (n proj i) = n -tuples_on NAT by Th36; n proj i is len-total proof let x, y be FinSequence of NAT ; :: according to COMPUT_1:def_2 ::_thesis: ( len x = len y & x in dom (n proj i) implies y in dom (n proj i) ) assume that A2: len x = len y and A3: x in dom (n proj i) ; ::_thesis: y in dom (n proj i) len x = n by A1, A3, CARD_1:def_7; then y is Element of n -tuples_on NAT by A2, FINSEQ_2:92; hence y in dom (n proj i) by A1; ::_thesis: verum end; hence ( n proj i is len-total & not n proj i is empty ) by A1; ::_thesis: verum end; end; theorem Th37: :: COMPUT_1:37 for n, i being Element of NAT holds arity (n proj i) = n proof let n, i be Element of NAT ; ::_thesis: arity (n proj i) = n consider d being set such that A1: d in n -tuples_on NAT by XBOOLE_0:def_1; reconsider d = d as Element of n -tuples_on NAT by A1; A2: dom (n proj i) = n -tuples_on NAT by Th36; then A3: for x being FinSequence st x in dom (n proj i) holds n = len x by CARD_1:def_7; d in dom (n proj i) by A2; hence arity (n proj i) = n by A3, MARGREL1:def_25; ::_thesis: verum end; theorem Th38: :: COMPUT_1:38 for n, i being Element of NAT for t being Element of n -tuples_on NAT holds (n proj i) . t = t . i proof let n, i be Element of NAT ; ::_thesis: for t being Element of n -tuples_on NAT holds (n proj i) . t = t . i let t be Element of n -tuples_on NAT; ::_thesis: (n proj i) . t = t . i dom (n proj i) = n -tuples_on NAT by Th36; hence (n proj i) . t = t . i by CARD_3:def_16; ::_thesis: verum end; registration let X be set ; cluster HFuncs X -> functional ; coherence HFuncs X is functional ; end; theorem Th39: :: COMPUT_1:39 for n being Element of NAT for D, E being non empty set for F being Function of D,(HFuncs E) st rng F is compatible & ( for x being Element of D holds dom (F . x) c= n -tuples_on E ) holds ex f being Element of HFuncs E st ( f = Union F & dom f c= n -tuples_on E ) proof let n be Element of NAT ; ::_thesis: for D, E being non empty set for F being Function of D,(HFuncs E) st rng F is compatible & ( for x being Element of D holds dom (F . x) c= n -tuples_on E ) holds ex f being Element of HFuncs E st ( f = Union F & dom f c= n -tuples_on E ) let D, E be non empty set ; ::_thesis: for F being Function of D,(HFuncs E) st rng F is compatible & ( for x being Element of D holds dom (F . x) c= n -tuples_on E ) holds ex f being Element of HFuncs E st ( f = Union F & dom f c= n -tuples_on E ) set X = D; set Y = E; let F be Function of D,(HFuncs E); ::_thesis: ( rng F is compatible & ( for x being Element of D holds dom (F . x) c= n -tuples_on E ) implies ex f being Element of HFuncs E st ( f = Union F & dom f c= n -tuples_on E ) ) assume A1: rng F is compatible ; ::_thesis: ( ex x being Element of D st not dom (F . x) c= n -tuples_on E or ex f being Element of HFuncs E st ( f = Union F & dom f c= n -tuples_on E ) ) assume A2: for x being Element of D holds dom (F . x) c= n -tuples_on E ; ::_thesis: ex f being Element of HFuncs E st ( f = Union F & dom f c= n -tuples_on E ) A3: rng F is functional proof let x be set ; :: according to FUNCT_1:def_13 ::_thesis: ( not x in rng F or x is set ) A4: rng F c= HFuncs E by RELAT_1:def_19; assume x in rng F ; ::_thesis: x is set hence x is set by A4; ::_thesis: verum end; then reconsider rngF = rng F as non empty functional compatible set by A1; set D = { (dom g) where g is Element of rngF : verum } ; reconsider f = Union F as Function by A1, A3; A5: rng f c= E proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng f or y in E ) assume y in rng f ; ::_thesis: y in E then consider x being set such that A6: x in dom f and A7: f . x = y by FUNCT_1:def_3; x in union { (dom g) where g is Element of rngF : verum } by A6, Th12; then consider d being set such that A8: x in d and A9: d in { (dom g) where g is Element of rngF : verum } by TARSKI:def_4; consider g being Element of rngF such that A10: d = dom g and verum by A9; A11: g in rngF ; rng F c= HFuncs E by RELAT_1:def_19; then reconsider g = g as Element of HFuncs E by A11; A12: g . x in rng g by A8, A10, FUNCT_1:3; A13: rng g c= E by RELAT_1:def_19; f . x = g . x by A8, A10, Th13; hence y in E by A7, A13, A12; ::_thesis: verum end; A14: dom f c= n -tuples_on E proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom f or x in n -tuples_on E ) assume x in dom f ; ::_thesis: x in n -tuples_on E then x in union { (dom g) where g is Element of rngF : verum } by Th12; then consider d being set such that A15: x in d and A16: d in { (dom g) where g is Element of rngF : verum } by TARSKI:def_4; consider g being Element of rngF such that A17: d = dom g and verum by A16; consider e being set such that A18: e in dom F and A19: F . e = g by FUNCT_1:def_3; reconsider e = e as Element of D by A18; dom (F . e) c= n -tuples_on E by A2; hence x in n -tuples_on E by A15, A17, A19; ::_thesis: verum end; n -tuples_on E c= E * by FINSEQ_2:142; then dom f c= E * by A14, XBOOLE_1:1; then reconsider f = f as PartFunc of (E *),E by A5, RELSET_1:4; reconsider f = f as Element of PFuncs ((E *),E) by PARTFUN1:45; f is homogeneous proof thus dom f is with_common_domain by A14; :: according to MARGREL1:def_21 ::_thesis: verum end; then f in { g where g is Element of PFuncs ((E *),E) : g is homogeneous } ; then reconsider f = Union F as Element of HFuncs E ; take f ; ::_thesis: ( f = Union F & dom f c= n -tuples_on E ) thus f = Union F ; ::_thesis: dom f c= n -tuples_on E thus dom f c= n -tuples_on E by A14; ::_thesis: verum end; theorem :: COMPUT_1:40 for D being non empty set for F being Function of NAT,(HFuncs D) st ( for i being Element of NAT holds F . i c= F . (i + 1) ) holds Union F in HFuncs D proof let D be non empty set ; ::_thesis: for F being Function of NAT,(HFuncs D) st ( for i being Element of NAT holds F . i c= F . (i + 1) ) holds Union F in HFuncs D set X = D; let F be Function of NAT,(HFuncs D); ::_thesis: ( ( for i being Element of NAT holds F . i c= F . (i + 1) ) implies Union F in HFuncs D ) assume A1: for i being Element of NAT holds F . i c= F . (i + 1) ; ::_thesis: Union F in HFuncs D A2: now__::_thesis:_for_n,_m_being_Element_of_NAT_st_n_<=_m_holds_ F_._n_c=_F_._m let n be Element of NAT ; ::_thesis: for m being Element of NAT st n <= m holds F . n c= F . m defpred S1[ Element of NAT ] means F . n c= F . (n + $1); let m be Element of NAT ; ::_thesis: ( n <= m implies F . n c= F . m ) A3: now__::_thesis:_for_i_being_Element_of_NAT_st_S1[i]_holds_ S1[i_+_1] let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] ) assume A4: S1[i] ; ::_thesis: S1[i + 1] F . (n + i) c= F . ((n + i) + 1) by A1; hence S1[i + 1] by A4, XBOOLE_1:1; ::_thesis: verum end; A5: S1[ 0 ] ; A6: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A5, A3); assume n <= m ; ::_thesis: F . n c= F . m then consider i being Nat such that A7: m = n + i by NAT_1:10; i in NAT by ORDINAL1:def_12; hence F . n c= F . m by A6, A7; ::_thesis: verum end; reconsider Y = rng F as non empty Subset of (HFuncs D) by RELAT_1:def_19; A8: Y is compatible proof let f, g be Function; :: according to COMPUT_1:def_1 ::_thesis: ( f in Y & g in Y implies f tolerates g ) assume f in Y ; ::_thesis: ( not g in Y or f tolerates g ) then consider i being set such that A9: i in dom F and A10: f = F . i by FUNCT_1:def_3; assume g in Y ; ::_thesis: f tolerates g then consider j being set such that A11: j in dom F and A12: g = F . j by FUNCT_1:def_3; reconsider i = i, j = j as Element of NAT by A9, A11; ( i <= j or j <= i ) ; hence f tolerates g by A2, A10, A12, PARTFUN1:54; ::_thesis: verum end; Y is PartFunc-set of D * ,D proof let f be Element of Y; :: according to RFUNCT_3:def_3 ::_thesis: f is Element of K32(K33((D *),D)) f is Element of HFuncs D ; hence f is Element of K32(K33((D *),D)) ; ::_thesis: verum end; then Union F is PartFunc of (D *),D by A8, Th15; then reconsider f = Union F as Element of PFuncs ((D *),D) by PARTFUN1:45; A13: dom f = union { (dom g) where g is Element of Y : verum } by A8, Th12; f is homogeneous proof thus dom f is with_common_domain :: according to MARGREL1:def_21 ::_thesis: verum proof let x, y be FinSequence; :: according to MARGREL1:def_1 ::_thesis: ( not x in dom f or not y in dom f or len x = len y ) assume x in dom f ; ::_thesis: ( not y in dom f or len x = len y ) then consider A1 being set such that A14: x in A1 and A15: A1 in { (dom g) where g is Element of Y : verum } by A13, TARSKI:def_4; consider g1 being Element of Y such that A16: A1 = dom g1 by A15; assume y in dom f ; ::_thesis: len x = len y then consider A2 being set such that A17: y in A2 and A18: A2 in { (dom g) where g is Element of Y : verum } by A13, TARSKI:def_4; consider g2 being Element of Y such that A19: A2 = dom g2 by A18; consider i1 being set such that A20: i1 in dom F and A21: g1 = F . i1 by FUNCT_1:def_3; consider i2 being set such that A22: i2 in dom F and A23: g2 = F . i2 by FUNCT_1:def_3; reconsider i1 = i1, i2 = i2 as Element of NAT by A20, A22; ( i1 <= i2 or i2 <= i1 ) ; then ( g1 c= g2 or g2 c= g1 ) by A2, A21, A23; then ( dom g1 c= dom g2 or dom g2 c= dom g1 ) by GRFUNC_1:2; then dom x = dom y by A14, A16, A17, A19, CARD_3:def_10; hence len x = len y by FINSEQ_3:29; ::_thesis: verum end; end; hence Union F in HFuncs D ; ::_thesis: verum end; theorem Th41: :: COMPUT_1:41 for D being non empty set for F being with_the_same_arity FinSequence of HFuncs D holds dom <:F:> c= (arity F) -tuples_on D proof let D be non empty set ; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs D holds dom <:F:> c= (arity F) -tuples_on D set X = D; let F be with_the_same_arity FinSequence of HFuncs D; ::_thesis: dom <:F:> c= (arity F) -tuples_on D thus dom <:F:> c= (arity F) -tuples_on D ::_thesis: verum proof A1: dom <:F:> = meet (doms F) by FUNCT_6:29 .= meet (rng (doms F)) by FUNCT_6:def_4 ; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom <:F:> or x in (arity F) -tuples_on D ) assume A2: x in dom <:F:> ; ::_thesis: x in (arity F) -tuples_on D consider y being set such that A3: y in rng (doms F) by A2, A1, SETFAM_1:1, XBOOLE_0:def_1; A4: x in y by A2, A1, A3, SETFAM_1:def_1; consider z being set such that A5: z in dom (doms F) and A6: (doms F) . z = y by A3, FUNCT_1:def_3; A7: dom (doms F) = F " (SubFuncs (rng F)) by FUNCT_6:def_2; then z in dom F by A5, FUNCT_6:19; then A8: F . z in rng F by FUNCT_1:3; rng F c= HFuncs D by RELAT_1:def_19; then reconsider Fz = F . z as Element of HFuncs D by A8; A9: dom Fz c= (arity Fz) -tuples_on D by Th20; (doms F) . z = dom Fz by A7, A5, FUNCT_6:def_2; then x in (arity Fz) -tuples_on D by A6, A4, A9; hence x in (arity F) -tuples_on D by A8, Def4; ::_thesis: verum end; end; registration let X be non empty set ; let F be with_the_same_arity FinSequence of HFuncs X; cluster<:F:> -> homogeneous ; coherence <:F:> is homogeneous proof dom <:F:> c= (arity F) -tuples_on X by Th41; hence dom <:F:> is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; end; theorem Th42: :: COMPUT_1:42 for D being non empty set for f being Element of HFuncs D for F being with_the_same_arity FinSequence of HFuncs D holds ( dom (f * <:F:>) c= (arity F) -tuples_on D & rng (f * <:F:>) c= D & f * <:F:> in HFuncs D ) proof let D be non empty set ; ::_thesis: for f being Element of HFuncs D for F being with_the_same_arity FinSequence of HFuncs D holds ( dom (f * <:F:>) c= (arity F) -tuples_on D & rng (f * <:F:>) c= D & f * <:F:> in HFuncs D ) set X = D; let f be Element of HFuncs D; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs D holds ( dom (f * <:F:>) c= (arity F) -tuples_on D & rng (f * <:F:>) c= D & f * <:F:> in HFuncs D ) let F be with_the_same_arity FinSequence of HFuncs D; ::_thesis: ( dom (f * <:F:>) c= (arity F) -tuples_on D & rng (f * <:F:>) c= D & f * <:F:> in HFuncs D ) A1: dom (f * <:F:>) c= dom <:F:> by RELAT_1:25; A2: (arity F) -tuples_on D c= D * by FINSEQ_2:142; dom <:F:> c= (arity F) -tuples_on D by Th41; hence dom (f * <:F:>) c= (arity F) -tuples_on D by A1, XBOOLE_1:1; ::_thesis: ( rng (f * <:F:>) c= D & f * <:F:> in HFuncs D ) then A3: dom (f * <:F:>) c= D * by A2, XBOOLE_1:1; thus rng (f * <:F:>) c= D by RELAT_1:def_19; ::_thesis: f * <:F:> in HFuncs D then f * <:F:> is PartFunc of (D *),D by A3, RELSET_1:4; then f * <:F:> in PFuncs ((D *),D) by PARTFUN1:45; hence f * <:F:> in HFuncs D ; ::_thesis: verum end; definition let X, Y be non empty set ; let P be PFUNC_DOMAIN of X,Y; let S be non empty Subset of P; :: original: Element redefine mode Element of S -> Element of P; coherence for b1 being Element of S holds b1 is Element of P proof let f be Element of S; ::_thesis: f is Element of P thus f is Element of P ; ::_thesis: verum end; end; registration let f be NAT * -defined homogeneous Function; cluster<*f*> -> with_the_same_arity ; coherence <*f*> is with_the_same_arity proof let h, g be Function; :: according to COMPUT_1:def_3 ::_thesis: ( h in rng <*f*> & g in rng <*f*> implies ( ( not h is empty or g is empty or dom g = {{}} ) & ( not h is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom h c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) ) assume that A1: h in rng <*f*> and A2: g in rng <*f*> ; ::_thesis: ( ( not h is empty or g is empty or dom g = {{}} ) & ( not h is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom h c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) A3: rng <*f*> = {f} by FINSEQ_1:39; then A4: h = f by A1, TARSKI:def_1; hence ( not h is empty or g is empty or dom g = {{}} ) by A2, A3, TARSKI:def_1; ::_thesis: ( not h is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom h c= n -tuples_on X & dom g c= n -tuples_on X ) ) assume that not h is empty and not g is empty ; ::_thesis: ex n being Element of NAT ex X being non empty set st ( dom h c= n -tuples_on X & dom g c= n -tuples_on X ) take arity f ; ::_thesis: ex X being non empty set st ( dom h c= (arity f) -tuples_on X & dom g c= (arity f) -tuples_on X ) take NAT ; ::_thesis: ( dom h c= (arity f) -tuples_on NAT & dom g c= (arity f) -tuples_on NAT ) g = f by A2, A3, TARSKI:def_1; hence ( dom h c= (arity f) -tuples_on NAT & dom g c= (arity f) -tuples_on NAT ) by A4, Th21; ::_thesis: verum end; end; theorem :: COMPUT_1:43 for f being NAT * -defined to-naturals homogeneous Function holds arity <*f*> = arity f proof let f be NAT * -defined to-naturals homogeneous Function; ::_thesis: arity <*f*> = arity f rng <*f*> = {f} by FINSEQ_1:38; then f in rng <*f*> by TARSKI:def_1; hence arity <*f*> = arity f by Def4; ::_thesis: verum end; theorem Th44: :: COMPUT_1:44 for f, g being non empty Element of HFuncs NAT for F being with_the_same_arity FinSequence of HFuncs NAT st g = f * <:F:> holds arity g = arity F proof let f, g be non empty Element of HFuncs NAT; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs NAT st g = f * <:F:> holds arity g = arity F let F be with_the_same_arity FinSequence of HFuncs NAT; ::_thesis: ( g = f * <:F:> implies arity g = arity F ) assume g = f * <:F:> ; ::_thesis: arity g = arity F then A1: dom g c= (arity F) -tuples_on NAT by Th42; consider x being set such that A2: x in dom g by XBOOLE_0:def_1; reconsider x = x as Element of (arity F) -tuples_on NAT by A1, A2; len x = arity F by CARD_1:def_7; hence arity g = arity F by A2, MARGREL1:def_25; ::_thesis: verum end; theorem Th45: :: COMPUT_1:45 for D being non empty set for f being non empty quasi_total Element of HFuncs D for F being with_the_same_arity FinSequence of HFuncs D st arity f = len F & not F is empty & ( for h being Element of HFuncs D st h in rng F holds ( h is quasi_total & not h is empty ) ) holds ( f * <:F:> is non empty quasi_total Element of HFuncs D & dom (f * <:F:>) = (arity F) -tuples_on D ) proof let D be non empty set ; ::_thesis: for f being non empty quasi_total Element of HFuncs D for F being with_the_same_arity FinSequence of HFuncs D st arity f = len F & not F is empty & ( for h being Element of HFuncs D st h in rng F holds ( h is quasi_total & not h is empty ) ) holds ( f * <:F:> is non empty quasi_total Element of HFuncs D & dom (f * <:F:>) = (arity F) -tuples_on D ) set X = D; let f be non empty quasi_total Element of HFuncs D; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs D st arity f = len F & not F is empty & ( for h being Element of HFuncs D st h in rng F holds ( h is quasi_total & not h is empty ) ) holds ( f * <:F:> is non empty quasi_total Element of HFuncs D & dom (f * <:F:>) = (arity F) -tuples_on D ) let F be with_the_same_arity FinSequence of HFuncs D; ::_thesis: ( arity f = len F & not F is empty & ( for h being Element of HFuncs D st h in rng F holds ( h is quasi_total & not h is empty ) ) implies ( f * <:F:> is non empty quasi_total Element of HFuncs D & dom (f * <:F:>) = (arity F) -tuples_on D ) ) assume that A1: arity f = len F and A2: not F is empty and A3: for h being Element of HFuncs D st h in rng F holds ( h is quasi_total & not h is empty ) ; ::_thesis: ( f * <:F:> is non empty quasi_total Element of HFuncs D & dom (f * <:F:>) = (arity F) -tuples_on D ) set n = arity F; set fF = f * <:F:>; A4: dom (f * <:F:>) c= (arity F) -tuples_on D by Th42; A5: (arity F) -tuples_on D c= dom (f * <:F:>) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (arity F) -tuples_on D or x in dom (f * <:F:>) ) A6: product (rngs F) c= (len F) -tuples_on D proof let p be set ; :: according to TARSKI:def_3 ::_thesis: ( not p in product (rngs F) or p in (len F) -tuples_on D ) A7: dom (rngs F) = F " (SubFuncs (rng F)) by FUNCT_6:def_3; assume p in product (rngs F) ; ::_thesis: p in (len F) -tuples_on D then consider g being Function such that A8: p = g and A9: dom g = dom (rngs F) and A10: for x being set st x in dom (rngs F) holds g . x in (rngs F) . x by CARD_3:def_5; now__::_thesis:_for_x_being_set_holds_ (_(_x_in_F_"_(SubFuncs_(rng_F))_implies_x_in_Seg_(len_F)_)_&_(_x_in_Seg_(len_F)_implies_x_in_F_"_(SubFuncs_(rng_F))_)_) let x be set ; ::_thesis: ( ( x in F " (SubFuncs (rng F)) implies x in Seg (len F) ) & ( x in Seg (len F) implies x in F " (SubFuncs (rng F)) ) ) hereby ::_thesis: ( x in Seg (len F) implies x in F " (SubFuncs (rng F)) ) assume x in F " (SubFuncs (rng F)) ; ::_thesis: x in Seg (len F) then x in dom F by FUNCT_6:19; hence x in Seg (len F) by FINSEQ_1:def_3; ::_thesis: verum end; assume x in Seg (len F) ; ::_thesis: x in F " (SubFuncs (rng F)) then A11: x in dom F by FINSEQ_1:def_3; then F . x in rng F by FUNCT_1:3; hence x in F " (SubFuncs (rng F)) by A11, FUNCT_6:19; ::_thesis: verum end; then A12: F " (SubFuncs (rng F)) = Seg (len F) by TARSKI:1; then reconsider g = g as FinSequence by A9, A7, FINSEQ_1:def_2; rng g c= D proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng g or x in D ) assume x in rng g ; ::_thesis: x in D then consider d being set such that A13: d in dom g and A14: g . d = x by FUNCT_1:def_3; A15: g . d in (rngs F) . d by A9, A10, A13; reconsider d = d as Element of NAT by A13; dom F = Seg (len F) by FINSEQ_1:def_3; then reconsider Fd = F . d as Element of HFuncs D by A9, A7, A12, A13, FINSEQ_2:11; A16: rng Fd c= D by RELAT_1:def_19; (rngs F) . d = rng Fd by A9, A7, A13, FUNCT_6:def_3; hence x in D by A14, A15, A16; ::_thesis: verum end; then reconsider g = g as FinSequence of D by FINSEQ_1:def_4; len g = len F by A9, A7, A12, FINSEQ_1:def_3; then p is Element of (len F) -tuples_on D by A8, FINSEQ_2:92; hence p in (len F) -tuples_on D ; ::_thesis: verum end; rng <:F:> c= product (rngs F) by FUNCT_6:29; then A17: rng <:F:> c= (len F) -tuples_on D by A6, XBOOLE_1:1; A18: dom f = (arity f) -tuples_on D by Th22; A19: (arity F) -tuples_on D c= dom <:F:> proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in (arity F) -tuples_on D or x in dom <:F:> ) A20: dom (doms F) = F " (SubFuncs (rng F)) by FUNCT_6:def_2; assume A21: x in (arity F) -tuples_on D ; ::_thesis: x in dom <:F:> A22: now__::_thesis:_for_y_being_set_st_y_in_rng_(doms_F)_holds_ x_in_y let y be set ; ::_thesis: ( y in rng (doms F) implies x in y ) assume y in rng (doms F) ; ::_thesis: x in y then consider w being set such that A23: w in dom (doms F) and A24: (doms F) . w = y by FUNCT_1:def_3; A25: w in dom F by A20, A23, FUNCT_6:19; then reconsider w = w as Element of NAT ; reconsider Fw = F . w as Element of HFuncs D by A25, FINSEQ_2:11; A26: (doms F) . w = dom Fw by A20, A23, FUNCT_6:def_2; A27: Fw in rng F by A25, FUNCT_1:3; then ( not Fw is empty & Fw is quasi_total ) by A3; then dom Fw = (arity Fw) -tuples_on D by Th22; hence x in y by A21, A24, A26, A27, Def4; ::_thesis: verum end; consider z being set such that A28: z in dom F by A2, XBOOLE_0:def_1; F . z in rng F by A28, FUNCT_1:3; then z in dom (doms F) by A28, A20, FUNCT_6:19; then A29: rng (doms F) <> {} by RELAT_1:42; dom <:F:> = meet (doms F) by FUNCT_6:29 .= meet (rng (doms F)) by FUNCT_6:def_4 ; hence x in dom <:F:> by A29, A22, SETFAM_1:def_1; ::_thesis: verum end; assume A30: x in (arity F) -tuples_on D ; ::_thesis: x in dom (f * <:F:>) then <:F:> . x in rng <:F:> by A19, FUNCT_1:3; hence x in dom (f * <:F:>) by A1, A30, A19, A18, A17, FUNCT_1:11; ::_thesis: verum end; then A31: dom (f * <:F:>) = (arity F) -tuples_on D by A4, XBOOLE_0:def_10; A32: rng (f * <:F:>) c= D by Th42; (arity F) -tuples_on D c= D * by FINSEQ_2:142; then dom (f * <:F:>) c= D * by A4, XBOOLE_1:1; then f * <:F:> is Relation of (D *),D by A32, RELSET_1:4; then f * <:F:> is Element of PFuncs ((D *),D) by PARTFUN1:45; then f * <:F:> in HFuncs D ; then reconsider fF = f * <:F:> as Element of HFuncs D ; fF is quasi_total proof let x, y be FinSequence of D; :: according to MARGREL1:def_22 ::_thesis: ( not len x = len y or not x in dom fF or y in dom fF ) assume that A33: len x = len y and A34: x in dom fF ; ::_thesis: y in dom fF len x = arity F by A4, A34, CARD_1:def_7; then y is Element of (arity F) -tuples_on D by A33, FINSEQ_2:92; hence y in dom fF by A31; ::_thesis: verum end; hence f * <:F:> is non empty quasi_total Element of HFuncs D by A5; ::_thesis: dom (f * <:F:>) = (arity F) -tuples_on D thus dom (f * <:F:>) = (arity F) -tuples_on D by A4, A5, XBOOLE_0:def_10; ::_thesis: verum end; theorem Th46: :: COMPUT_1:46 for D being non empty set for f being quasi_total Element of HFuncs D for F being with_the_same_arity FinSequence of HFuncs D st arity f = len F & ( for h being Element of HFuncs D st h in rng F holds h is quasi_total ) holds f * <:F:> is quasi_total Element of HFuncs D proof let D be non empty set ; ::_thesis: for f being quasi_total Element of HFuncs D for F being with_the_same_arity FinSequence of HFuncs D st arity f = len F & ( for h being Element of HFuncs D st h in rng F holds h is quasi_total ) holds f * <:F:> is quasi_total Element of HFuncs D set X = D; let f be quasi_total Element of HFuncs D; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs D st arity f = len F & ( for h being Element of HFuncs D st h in rng F holds h is quasi_total ) holds f * <:F:> is quasi_total Element of HFuncs D let F be with_the_same_arity FinSequence of HFuncs D; ::_thesis: ( arity f = len F & ( for h being Element of HFuncs D st h in rng F holds h is quasi_total ) implies f * <:F:> is quasi_total Element of HFuncs D ) assume that A1: arity f = len F and A2: for h being Element of HFuncs D st h in rng F holds h is quasi_total ; ::_thesis: f * <:F:> is quasi_total Element of HFuncs D reconsider g = {} as PartFunc of (D *),D by RELSET_1:12; A3: g is quasi_total proof let x, y be FinSequence of D; :: according to MARGREL1:def_22 ::_thesis: ( not len x = len y or not x in dom g or y in dom g ) assume that len x = len y and A4: x in dom g ; ::_thesis: y in dom g thus y in dom g by A4; ::_thesis: verum end; g in PFuncs ((D *),D) by PARTFUN1:45; then A5: g in { h where h is Element of PFuncs ((D *),D) : h is homogeneous } ; percases ( f = {} or F = {} or ex h being set st ( h in rng F & h = {} ) or ( F <> {} & f <> {} & ( for h being set st h in rng F holds h <> {} ) ) ) ; suppose f = {} ; ::_thesis: f * <:F:> is quasi_total Element of HFuncs D hence f * <:F:> is quasi_total Element of HFuncs D ; ::_thesis: verum end; suppose F = {} ; ::_thesis: f * <:F:> is quasi_total Element of HFuncs D hence f * <:F:> is quasi_total Element of HFuncs D by A5, A3, FUNCT_6:40; ::_thesis: verum end; suppose ex h being set st ( h in rng F & h = {} ) ; ::_thesis: f * <:F:> is quasi_total Element of HFuncs D then <:F:> = {} by Th7; hence f * <:F:> is quasi_total Element of HFuncs D by A5, A3; ::_thesis: verum end; supposeA6: ( F <> {} & f <> {} & ( for h being set st h in rng F holds h <> {} ) ) ; ::_thesis: f * <:F:> is quasi_total Element of HFuncs D then for h being Element of HFuncs D st h in rng F holds ( h is quasi_total & not h is empty ) by A2; hence f * <:F:> is quasi_total Element of HFuncs D by A1, A6, Th45; ::_thesis: verum end; end; end; theorem Th47: :: COMPUT_1:47 for D being non empty set for f, g being non empty quasi_total Element of HFuncs D st arity f = 0 & arity g = 0 & f . {} = g . {} holds f = g proof let D be non empty set ; ::_thesis: for f, g being non empty quasi_total Element of HFuncs D st arity f = 0 & arity g = 0 & f . {} = g . {} holds f = g set X = D; let f, g be non empty quasi_total Element of HFuncs D; ::_thesis: ( arity f = 0 & arity g = 0 & f . {} = g . {} implies f = g ) assume that A1: arity f = 0 and A2: arity g = 0 and A3: f . {} = g . {} ; ::_thesis: f = g now__::_thesis:_(_dom_f_=_{(<*>_D)}_&_dom_g_=_{(<*>_D)}_&_(_for_x_being_set_st_x_in_{(<*>_D)}_holds_ f_._x_=_g_._x_)_) thus dom f = 0 -tuples_on D by A1, Th22 .= {(<*> D)} by FINSEQ_2:94 ; ::_thesis: ( dom g = {(<*> D)} & ( for x being set st x in {(<*> D)} holds f . x = g . x ) ) thus dom g = 0 -tuples_on D by A2, Th22 .= {(<*> D)} by FINSEQ_2:94 ; ::_thesis: for x being set st x in {(<*> D)} holds f . x = g . x let x be set ; ::_thesis: ( x in {(<*> D)} implies f . x = g . x ) assume x in {(<*> D)} ; ::_thesis: f . x = g . x then x = {} by TARSKI:def_1; hence f . x = g . x by A3; ::_thesis: verum end; hence f = g by FUNCT_1:2; ::_thesis: verum end; theorem Th48: :: COMPUT_1:48 for f, g being non empty NAT * -defined to-naturals homogeneous len-total Function st arity f = 0 & arity g = 0 & f . {} = g . {} holds f = g proof let f, g be non empty NAT * -defined to-naturals homogeneous len-total Function; ::_thesis: ( arity f = 0 & arity g = 0 & f . {} = g . {} implies f = g ) assume that A1: arity f = 0 and A2: arity g = 0 and A3: f . {} = g . {} ; ::_thesis: f = g A4: g is non empty quasi_total Element of HFuncs NAT by Th29; f is non empty quasi_total Element of HFuncs NAT by Th29; hence f = g by A1, A2, A3, A4, Th47; ::_thesis: verum end; begin definition let g, f1, f2 be NAT * -defined to-naturals homogeneous Function; let i be Element of NAT ; predg is_primitive-recursively_expressed_by f1,f2,i means :Def9: :: COMPUT_1:def 9 ex n being Element of NAT st ( dom g c= n -tuples_on NAT & i >= 1 & i <= n & (arity f1) + 1 = n & n + 1 = arity f2 & ( for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom g implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom g ) & ( p +* (i,0) in dom g implies g . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom g implies ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom g ) & ( p +* (i,(n + 1)) in dom g implies g . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*(g . (p +* (i,n)))*>) ) ) ) ) ) ); end; :: deftheorem Def9 defines is_primitive-recursively_expressed_by COMPUT_1:def_9_:_ for g, f1, f2 being NAT * -defined to-naturals homogeneous Function for i being Element of NAT holds ( g is_primitive-recursively_expressed_by f1,f2,i iff ex n being Element of NAT st ( dom g c= n -tuples_on NAT & i >= 1 & i <= n & (arity f1) + 1 = n & n + 1 = arity f2 & ( for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom g implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom g ) & ( p +* (i,0) in dom g implies g . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom g implies ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom g ) & ( p +* (i,(n + 1)) in dom g implies g . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*(g . (p +* (i,n)))*>) ) ) ) ) ) ) ); defpred S1[ Element of NAT , Element of HFuncs NAT, Element of HFuncs NAT, FinSequence of NAT , Element of NAT , homogeneous Function] means ( ( $5 in dom $4 & $4 +* ($5,$1) in dom $2 & ($4 +* ($5,$1)) ^ <*($2 . ($4 +* ($5,$1)))*> in dom $6 implies $3 = $2 +* (($4 +* ($5,($1 + 1))) .--> ($6 . (($4 +* ($5,$1)) ^ <*($2 . ($4 +* ($5,$1)))*>))) ) & ( ( not $5 in dom $4 or not $4 +* ($5,$1) in dom $2 or not ($4 +* ($5,$1)) ^ <*($2 . ($4 +* ($5,$1)))*> in dom $6 ) implies $3 = $2 ) ); definition let f1, f2 be NAT * -defined to-naturals homogeneous Function; let i be Element of NAT ; let p be FinSequence of NAT ; func primrec (f1,f2,i,p) -> Element of HFuncs NAT means :Def10: :: COMPUT_1:def 10 ex F being Function of NAT,(HFuncs NAT) st ( it = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ); existence ex b1 being Element of HFuncs NAT ex F being Function of NAT,(HFuncs NAT) st ( b1 = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) proof reconsider ff1 = f1, ff2 = f2 as Element of HFuncs NAT by Th28; set n = len p; reconsider z = ff1 . (Del (p,i)) as Element of NAT ; defpred S2[ Element of NAT , Element of HFuncs NAT, Element of HFuncs NAT] means S1[$1,$2,$3,p,i,ff2]; p +* (i,0) in NAT * by FINSEQ_1:def_11; then reconsider Ap = {(p +* (i,0))} as non empty Subset of (NAT *) by ZFMISC_1:31; {} is PartFunc of (NAT *),NAT by RELSET_1:12; then {} in PFuncs ((NAT *),NAT) by PARTFUN1:45; then A1: {} in HFuncs NAT ; Ap --> z = (p +* (i,0)) .--> z ; then Ap --> z in HFuncs NAT ; then reconsider t = Ap --> z, e = {} as Element of HFuncs NAT by A1; ( ( i in dom p & Del (p,i) in dom f1 ) or not i in dom p or not Del (p,i) in dom f1 ) ; then consider A being Element of HFuncs NAT such that A2: ( i in dom p & Del (p,i) in dom f1 implies A = t ) and A3: ( ( not i in dom p or not Del (p,i) in dom f1 ) implies A = e ) ; A4: for m being Element of NAT for x being Element of HFuncs NAT ex y being Element of HFuncs NAT st S2[m,x,y] proof let m be Element of NAT ; ::_thesis: for x being Element of HFuncs NAT ex y being Element of HFuncs NAT st S2[m,x,y] let x be Element of HFuncs NAT; ::_thesis: ex y being Element of HFuncs NAT st S2[m,x,y] set f = x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))); reconsider z = ff2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>) as Element of NAT ; ( ( i in dom p & p +* (i,m) in dom x & (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom f2 ) or not i in dom p or not p +* (i,m) in dom x or not (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom f2 ) ; then consider y being Function such that A5: ( ( i in dom p & p +* (i,m) in dom x & (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom f2 & y = x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) ) or ( ( not i in dom p or not p +* (i,m) in dom x or not (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom f2 ) & y = x ) ) ; p +* (i,(m + 1)) in NAT * by FINSEQ_1:def_11; then reconsider B = {(p +* (i,(m + 1)))} as Subset of (NAT *) by ZFMISC_1:31; dom (B --> z) = B by FUNCOP_1:13; then A6: dom (x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>)))) = (dom x) \/ B by FUNCT_4:def_1; dom p = dom (p +* (i,(m + 1))) by FUNCT_7:30; then len (p +* (i,(m + 1))) = len p by FINSEQ_3:29; then p +* (i,(m + 1)) is Element of (len p) -tuples_on NAT by FINSEQ_2:92; then A7: B c= (len p) -tuples_on NAT by ZFMISC_1:31; A8: x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) = x +* (B --> z) ; now__::_thesis:_(_p_+*_(i,m)_in_dom_x_implies_x_+*_({(p_+*_(i,(m_+_1)))}_-->_(f2_._((p_+*_(i,m))_^_<*(x_._(p_+*_(i,m)))*>)))_in_HFuncs_NAT_) assume A9: p +* (i,m) in dom x ; ::_thesis: x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) in HFuncs NAT dom x c= (len p) -tuples_on NAT proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in dom x or a in (len p) -tuples_on NAT ) A10: dom p = dom (p +* (i,m)) by FUNCT_7:30; assume A11: a in dom x ; ::_thesis: a in (len p) -tuples_on NAT then reconsider q = a as Element of NAT * ; len q = len (p +* (i,m)) by A9, A11, MARGREL1:def_1; then len q = len p by A10, FINSEQ_3:29; hence a in (len p) -tuples_on NAT ; ::_thesis: verum end; then A12: x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) is homogeneous by A7, A6, Th16, XBOOLE_1:8; x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) in PFuncs ((NAT *),NAT) by A8, PARTFUN1:45; hence x +* ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) in HFuncs NAT by A12; ::_thesis: verum end; then reconsider y = y as Element of HFuncs NAT by A5; take y ; ::_thesis: S2[m,x,y] thus ( i in dom p & p +* (i,m) in dom x & (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom ff2 implies y = x +* ((p +* (i,(m + 1))) .--> (ff2 . ((p +* (i,m)) ^ <*(x . (p +* (i,m)))*>))) ) by A5; ::_thesis: ( ( not i in dom p or not p +* (i,m) in dom x or not (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom ff2 ) implies y = x ) thus ( ( not i in dom p or not p +* (i,m) in dom x or not (p +* (i,m)) ^ <*(x . (p +* (i,m)))*> in dom ff2 ) implies y = x ) by A5; ::_thesis: verum end; consider FF being Function of NAT,(HFuncs NAT) such that A13: FF . 0 = A and A14: for m being Element of NAT holds S2[m,FF . m,FF . (m + 1)] from RECDEF_1:sch_2(A4); take FF . (p /. i) ; ::_thesis: ex F being Function of NAT,(HFuncs NAT) st ( FF . (p /. i) = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) take FF ; ::_thesis: ( FF . (p /. i) = FF . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies FF . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies FF . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (FF . m) & (p +* (i,m)) ^ <*((FF . m) . (p +* (i,m)))*> in dom f2 implies FF . (m + 1) = (FF . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((FF . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (FF . m) or not (p +* (i,m)) ^ <*((FF . m) . (p +* (i,m)))*> in dom f2 ) implies FF . (m + 1) = FF . m ) ) ) ) thus ( FF . (p /. i) = FF . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies FF . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies FF . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (FF . m) & (p +* (i,m)) ^ <*((FF . m) . (p +* (i,m)))*> in dom f2 implies FF . (m + 1) = (FF . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((FF . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (FF . m) or not (p +* (i,m)) ^ <*((FF . m) . (p +* (i,m)))*> in dom f2 ) implies FF . (m + 1) = FF . m ) ) ) ) by A2, A3, A13, A14; ::_thesis: verum end; uniqueness for b1, b2 being Element of HFuncs NAT st ex F being Function of NAT,(HFuncs NAT) st ( b1 = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) & ex F being Function of NAT,(HFuncs NAT) st ( b2 = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) holds b1 = b2 proof reconsider ff2 = f2 as Element of HFuncs NAT by Th28; let g1, g2 be Element of HFuncs NAT; ::_thesis: ( ex F being Function of NAT,(HFuncs NAT) st ( g1 = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) & ex F being Function of NAT,(HFuncs NAT) st ( g2 = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) implies g1 = g2 ) given F1 being Function of NAT,(HFuncs NAT) such that A15: g1 = F1 . (p /. i) and A16: ( i in dom p & Del (p,i) in dom f1 implies F1 . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) and A17: ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F1 . 0 = {} ) and A18: for m being Element of NAT holds S1[m,F1 . m,F1 . (m + 1),p,i,f2] ; ::_thesis: ( for F being Function of NAT,(HFuncs NAT) holds ( not g2 = F . (p /. i) or ( i in dom p & Del (p,i) in dom f1 & not F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) or ( ( not i in dom p or not Del (p,i) in dom f1 ) & not F . 0 = {} ) or ex m being Element of NAT st ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) implies ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) & not F . (m + 1) = F . m ) ) ) or g1 = g2 ) given F2 being Function of NAT,(HFuncs NAT) such that A19: g2 = F2 . (p /. i) and A20: ( i in dom p & Del (p,i) in dom f1 implies F2 . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) and A21: ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F2 . 0 = {} ) and A22: for m being Element of NAT holds S1[m,F2 . m,F2 . (m + 1),p,i,f2] ; ::_thesis: g1 = g2 defpred S2[ Element of NAT ] means F1 . $1 = F2 . $1; A23: now__::_thesis:_for_m_being_Element_of_NAT_st_S2[m]_holds_ S2[m_+_1] let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume S2[m] ; ::_thesis: S2[m + 1] then A24: S1[m,F1 . m,F2 . (m + 1),p,i,ff2] by A22; S1[m,F1 . m,F1 . (m + 1),p,i,f2] by A18; hence S2[m + 1] by A24; ::_thesis: verum end; A25: S2[ 0 ] by A16, A17, A20, A21; for m being Element of NAT holds S2[m] from NAT_1:sch_1(A25, A23); hence g1 = g2 by A15, A19; ::_thesis: verum end; end; :: deftheorem Def10 defines primrec COMPUT_1:def_10_:_ for f1, f2 being NAT * -defined to-naturals homogeneous Function for i being Element of NAT for p being FinSequence of NAT for b5 being Element of HFuncs NAT holds ( b5 = primrec (f1,f2,i,p) iff ex F being Function of NAT,(HFuncs NAT) st ( b5 = F . (p /. i) & ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) & ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) & ( for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) ) ) ); theorem Th49: :: COMPUT_1:49 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function for p, q being FinSequence of NAT st q in dom (primrec (e1,e2,i,p)) holds ex k being Element of NAT st q = p +* (i,k) proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function for p, q being FinSequence of NAT st q in dom (primrec (e1,e2,i,p)) holds ex k being Element of NAT st q = p +* (i,k) let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: for p, q being FinSequence of NAT st q in dom (primrec (e1,e2,i,p)) holds ex k being Element of NAT st q = p +* (i,k) set f1 = e1; set f2 = e2; let p, q be FinSequence of NAT ; ::_thesis: ( q in dom (primrec (e1,e2,i,p)) implies ex k being Element of NAT st q = p +* (i,k) ) assume A1: q in dom (primrec (e1,e2,i,p)) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) consider F being Function of NAT,(HFuncs NAT) such that A2: primrec (e1,e2,i,p) = F . (p /. i) and A3: ( i in dom p & Del (p,i) in dom e1 implies F . 0 = (p +* (i,0)) .--> (e1 . (Del (p,i))) ) and A4: ( ( not i in dom p or not Del (p,i) in dom e1 ) implies F . 0 = {} ) and A5: for m being Element of NAT holds S1[m,F . m,F . (m + 1),p,i,e2] by Def10; defpred S2[ Element of NAT ] means ( q in dom (F . $1) implies ex k being Element of NAT st q = p +* (i,k) ); A6: for m being Element of NAT st S2[m] holds S2[m + 1] proof let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume that A7: S2[m] and A8: q in dom (F . (m + 1)) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) percases ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) or not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) ; suppose ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) then F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (e2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) by A5; then dom (F . (m + 1)) = (dom (F . m)) \/ (dom ((p +* (i,(m + 1))) .--> (e2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>)))) by FUNCT_4:def_1; then A9: dom (F . (m + 1)) = (dom (F . m)) \/ {(p +* (i,(m + 1)))} by FUNCOP_1:13; thus ex k being Element of NAT st q = p +* (i,k) ::_thesis: verum proof percases ( q in dom (F . m) or q in {(p +* (i,(m + 1)))} ) by A8, A9, XBOOLE_0:def_3; suppose q in dom (F . m) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) hence ex k being Element of NAT st q = p +* (i,k) by A7; ::_thesis: verum end; suppose q in {(p +* (i,(m + 1)))} ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) then q = p +* (i,(m + 1)) by TARSKI:def_1; hence ex k being Element of NAT st q = p +* (i,k) ; ::_thesis: verum end; end; end; end; suppose ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) hence ex k being Element of NAT st q = p +* (i,k) by A5, A7, A8; ::_thesis: verum end; end; end; A10: S2[ 0 ] proof assume A11: q in dom (F . 0) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) percases ( ( i in dom p & Del (p,i) in dom e1 ) or not i in dom p or not Del (p,i) in dom e1 ) ; suppose ( i in dom p & Del (p,i) in dom e1 ) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) then dom (F . 0) = {(p +* (i,0))} by A3, FUNCOP_1:13; then p +* (i,0) = q by A11, TARSKI:def_1; hence ex k being Element of NAT st q = p +* (i,k) ; ::_thesis: verum end; suppose ( not i in dom p or not Del (p,i) in dom e1 ) ; ::_thesis: ex k being Element of NAT st q = p +* (i,k) hence ex k being Element of NAT st q = p +* (i,k) by A4, A11; ::_thesis: verum end; end; end; for n being Element of NAT holds S2[n] from NAT_1:sch_1(A10, A6); hence ex k being Element of NAT st q = p +* (i,k) by A1, A2; ::_thesis: verum end; theorem Th50: :: COMPUT_1:50 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function for p being FinSequence of NAT st not i in dom p holds primrec (e1,e2,i,p) = {} proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function for p being FinSequence of NAT st not i in dom p holds primrec (e1,e2,i,p) = {} let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being FinSequence of NAT st not i in dom p holds primrec (e1,e2,i,p) = {} set f1 = e1; set f2 = e2; let p be FinSequence of NAT ; ::_thesis: ( not i in dom p implies primrec (e1,e2,i,p) = {} ) consider F being Function of NAT,(HFuncs NAT) such that A1: primrec (e1,e2,i,p) = F . (p /. i) and ( i in dom p & Del (p,i) in dom e1 implies F . 0 = (p +* (i,0)) .--> (e1 . (Del (p,i))) ) and A2: ( ( not i in dom p or not Del (p,i) in dom e1 ) implies F . 0 = {} ) and A3: for m being Element of NAT holds S1[m,F . m,F . (m + 1),p,i,e2] by Def10; defpred S2[ Element of NAT ] means F . $1 = {} ; assume A4: not i in dom p ; ::_thesis: primrec (e1,e2,i,p) = {} then A5: for m being Element of NAT st S2[m] holds S2[m + 1] by A3; A6: S2[ 0 ] by A4, A2; for m being Element of NAT holds S2[m] from NAT_1:sch_1(A6, A5); hence primrec (e1,e2,i,p) = {} by A1; ::_thesis: verum end; theorem Th51: :: COMPUT_1:51 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function for p, q being FinSequence of NAT holds primrec (e1,e2,i,p) tolerates primrec (e1,e2,i,q) proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function for p, q being FinSequence of NAT holds primrec (e1,e2,i,p) tolerates primrec (e1,e2,i,q) let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: for p, q being FinSequence of NAT holds primrec (e1,e2,i,p) tolerates primrec (e1,e2,i,q) set f1 = e1; set f2 = e2; let p1, p2 be FinSequence of NAT ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) percases ( not i in dom p1 or not i in dom p2 or ( i in dom p1 & i in dom p2 ) ) ; suppose ( not i in dom p1 or not i in dom p2 ) ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) then ( primrec (e1,e2,i,p1) = {} or primrec (e1,e2,i,p2) = {} ) by Th50; hence primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) by PARTFUN1:59; ::_thesis: verum end; supposeA1: ( i in dom p1 & i in dom p2 ) ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) reconsider m = p1 /. i, n = p2 /. i as Element of NAT ; consider F2 being Function of NAT,(HFuncs NAT) such that A2: primrec (e1,e2,i,p2) = F2 . (p2 /. i) and A3: ( i in dom p2 & Del (p2,i) in dom e1 implies F2 . 0 = (p2 +* (i,0)) .--> (e1 . (Del (p2,i))) ) and A4: ( ( not i in dom p2 or not Del (p2,i) in dom e1 ) implies F2 . 0 = {} ) and A5: for m being Element of NAT holds S1[m,F2 . m,F2 . (m + 1),p2,i,e2] by Def10; consider F1 being Function of NAT,(HFuncs NAT) such that A6: primrec (e1,e2,i,p1) = F1 . (p1 /. i) and A7: ( i in dom p1 & Del (p1,i) in dom e1 implies F1 . 0 = (p1 +* (i,0)) .--> (e1 . (Del (p1,i))) ) and A8: ( ( not i in dom p1 or not Del (p1,i) in dom e1 ) implies F1 . 0 = {} ) and A9: for m being Element of NAT holds S1[m,F1 . m,F1 . (m + 1),p1,i,e2] by Def10; defpred S2[ Element of NAT ] means for x being set st x in dom (F1 . $1) holds ex n being Element of NAT st ( x = p1 +* (i,n) & n <= $1 ); A10: now__::_thesis:_for_m_being_Element_of_NAT_st_S2[m]_holds_ S2[m_+_1] let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume A11: S2[m] ; ::_thesis: S2[m + 1] thus S2[m + 1] ::_thesis: verum proof set p1c = (p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*>; let x be set ; ::_thesis: ( x in dom (F1 . (m + 1)) implies ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) ) assume A12: x in dom (F1 . (m + 1)) ; ::_thesis: ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) A13: m <= m + 1 by NAT_1:11; percases ( ( i in dom p1 & p1 +* (i,m) in dom (F1 . m) & (p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*> in dom e2 ) or not i in dom p1 or not p1 +* (i,m) in dom (F1 . m) or not (p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*> in dom e2 ) ; suppose ( i in dom p1 & p1 +* (i,m) in dom (F1 . m) & (p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*> in dom e2 ) ; ::_thesis: ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) then F1 . (m + 1) = (F1 . m) +* ((p1 +* (i,(m + 1))) .--> (e2 . ((p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*>))) by A9; then dom (F1 . (m + 1)) = (dom (F1 . m)) \/ (dom ((p1 +* (i,(m + 1))) .--> (e2 . ((p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*>)))) by FUNCT_4:def_1 .= (dom (F1 . m)) \/ {(p1 +* (i,(m + 1)))} by FUNCOP_1:13 ; then A14: ( x in dom (F1 . m) or x in {(p1 +* (i,(m + 1)))} ) by A12, XBOOLE_0:def_3; thus ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) ::_thesis: verum proof percases ( x in dom (F1 . m) or x = p1 +* (i,(m + 1)) ) by A14, TARSKI:def_1; suppose x in dom (F1 . m) ; ::_thesis: ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) then ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m ) by A11; hence ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) by A13, XXREAL_0:2; ::_thesis: verum end; suppose x = p1 +* (i,(m + 1)) ; ::_thesis: ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) hence ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) ; ::_thesis: verum end; end; end; end; suppose ( not i in dom p1 or not p1 +* (i,m) in dom (F1 . m) or not (p1 +* (i,m)) ^ <*((F1 . m) . (p1 +* (i,m)))*> in dom e2 ) ; ::_thesis: ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) then F1 . (m + 1) = F1 . m by A9; then ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m ) by A11, A12; hence ex n being Element of NAT st ( x = p1 +* (i,n) & n <= m + 1 ) by A13, XXREAL_0:2; ::_thesis: verum end; end; end; end; A15: now__::_thesis:_(_p1_+*_(i,0)_=_p2_+*_(i,0)_implies_for_m_being_Element_of_NAT_holds_S3[m]_) defpred S3[ Element of NAT ] means F1 . $1 = F2 . $1; assume A16: p1 +* (i,0) = p2 +* (i,0) ; ::_thesis: for m being Element of NAT holds S3[m] A17: S3[ 0 ] proof percases ( ( i in dom p1 & Del (p1,i) in dom e1 ) or not i in dom p1 or not Del (p1,i) in dom e1 ) ; suppose ( i in dom p1 & Del (p1,i) in dom e1 ) ; ::_thesis: S3[ 0 ] hence S3[ 0 ] by A1, A7, A3, A16, Th4; ::_thesis: verum end; suppose ( not i in dom p1 or not Del (p1,i) in dom e1 ) ; ::_thesis: S3[ 0 ] hence S3[ 0 ] by A1, A8, A4, A16, Th4; ::_thesis: verum end; end; end; A18: now__::_thesis:_for_m_being_Element_of_NAT_st_S3[m]_holds_ S3[m_+_1] let m be Element of NAT ; ::_thesis: ( S3[m] implies S3[m + 1] ) assume A19: S3[m] ; ::_thesis: S3[m + 1] A20: S1[m,F1 . m,F1 . (m + 1),p1,i,e2] by A9; A21: S1[m,F2 . m,F2 . (m + 1),p2,i,e2] by A5; p1 +* (i,m) = p2 +* (i,m) by A16, Th2; hence S3[m + 1] by A1, A19, A20, A21, Th2; ::_thesis: verum end; thus for m being Element of NAT holds S3[m] from NAT_1:sch_1(A17, A18); ::_thesis: verum end; A22: S2[ 0 ] proof let x be set ; ::_thesis: ( x in dom (F1 . 0) implies ex n being Element of NAT st ( x = p1 +* (i,n) & n <= 0 ) ) assume A23: x in dom (F1 . 0) ; ::_thesis: ex n being Element of NAT st ( x = p1 +* (i,n) & n <= 0 ) dom (F1 . 0) = {(p1 +* (i,0))} by A7, A8, A23, FUNCOP_1:13; then x = p1 +* (i,0) by A23, TARSKI:def_1; hence ex n being Element of NAT st ( x = p1 +* (i,n) & n <= 0 ) ; ::_thesis: verum end; A24: for m being Element of NAT holds S2[m] from NAT_1:sch_1(A22, A10); A25: for m, n being Element of NAT holds F1 . m c= F1 . (m + n) proof let m be Element of NAT ; ::_thesis: for n being Element of NAT holds F1 . m c= F1 . (m + n) defpred S3[ Element of NAT ] means F1 . m c= F1 . (m + $1); A26: now__::_thesis:_for_n_being_Element_of_NAT_st_S3[n]_holds_ S3[n_+_1] let n be Element of NAT ; ::_thesis: ( S3[n] implies S3[n + 1] ) assume A27: S3[n] ; ::_thesis: S3[n + 1] set k = m + n; F1 . (m + n) c= F1 . ((m + n) + 1) proof set p1c = (p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*>; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in F1 . (m + n) or x in F1 . ((m + n) + 1) ) assume A28: x in F1 . (m + n) ; ::_thesis: x in F1 . ((m + n) + 1) percases ( ( i in dom p1 & p1 +* (i,(m + n)) in dom (F1 . (m + n)) & (p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*> in dom e2 ) or not i in dom p1 or not p1 +* (i,(m + n)) in dom (F1 . (m + n)) or not (p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*> in dom e2 ) ; supposeA29: ( i in dom p1 & p1 +* (i,(m + n)) in dom (F1 . (m + n)) & (p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*> in dom e2 ) ; ::_thesis: x in F1 . ((m + n) + 1) A30: dom (F1 . (m + n)) misses dom ((p1 +* (i,((m + n) + 1))) .--> (e2 . ((p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*>))) proof assume not dom (F1 . (m + n)) misses dom ((p1 +* (i,((m + n) + 1))) .--> (e2 . ((p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*>))) ; ::_thesis: contradiction then consider x being set such that A31: x in (dom (F1 . (m + n))) /\ (dom ({(p1 +* (i,((m + n) + 1)))} --> (e2 . ((p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*>)))) by XBOOLE_0:4; x in dom (F1 . (m + n)) by A31, XBOOLE_0:def_4; then consider n1 being Element of NAT such that A32: x = p1 +* (i,n1) and A33: n1 <= m + n by A24; A34: (m + n) + 1 = (p1 +* (i,((m + n) + 1))) . i by A1, FUNCT_7:31; A35: x = p1 +* (i,((m + n) + 1)) by A31, TARSKI:def_1; n1 = (p1 +* (i,n1)) . i by A1, FUNCT_7:31; hence contradiction by A35, A32, A33, A34, NAT_1:13; ::_thesis: verum end; F1 . ((m + n) + 1) = (F1 . (m + n)) +* ((p1 +* (i,((m + n) + 1))) .--> (e2 . ((p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*>))) by A9, A29; then F1 . (m + n) c= F1 . ((m + n) + 1) by A30, FUNCT_4:32; hence x in F1 . ((m + n) + 1) by A28; ::_thesis: verum end; suppose ( not i in dom p1 or not p1 +* (i,(m + n)) in dom (F1 . (m + n)) or not (p1 +* (i,(m + n))) ^ <*((F1 . (m + n)) . (p1 +* (i,(m + n))))*> in dom e2 ) ; ::_thesis: x in F1 . ((m + n) + 1) hence x in F1 . ((m + n) + 1) by A9, A28; ::_thesis: verum end; end; end; hence S3[n + 1] by A27, XBOOLE_1:1; ::_thesis: verum end; A36: S3[ 0 ] ; thus for n being Element of NAT holds S3[n] from NAT_1:sch_1(A36, A26); ::_thesis: verum end; defpred S3[ Element of NAT ] means for x being set st x in dom (F2 . $1) holds ex n being Element of NAT st ( x = p2 +* (i,n) & n <= $1 ); A37: now__::_thesis:_for_m_being_Element_of_NAT_st_S3[m]_holds_ S3[m_+_1] let m be Element of NAT ; ::_thesis: ( S3[m] implies S3[m + 1] ) assume A38: S3[m] ; ::_thesis: S3[m + 1] thus S3[m + 1] ::_thesis: verum proof set p2c = (p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*>; let x be set ; ::_thesis: ( x in dom (F2 . (m + 1)) implies ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) ) assume A39: x in dom (F2 . (m + 1)) ; ::_thesis: ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) A40: m <= m + 1 by NAT_1:11; percases ( ( i in dom p2 & p2 +* (i,m) in dom (F2 . m) & (p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*> in dom e2 ) or not i in dom p2 or not p2 +* (i,m) in dom (F2 . m) or not (p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*> in dom e2 ) ; suppose ( i in dom p2 & p2 +* (i,m) in dom (F2 . m) & (p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*> in dom e2 ) ; ::_thesis: ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) then F2 . (m + 1) = (F2 . m) +* ((p2 +* (i,(m + 1))) .--> (e2 . ((p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*>))) by A5; then dom (F2 . (m + 1)) = (dom (F2 . m)) \/ (dom ((p2 +* (i,(m + 1))) .--> (e2 . ((p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*>)))) by FUNCT_4:def_1 .= (dom (F2 . m)) \/ {(p2 +* (i,(m + 1)))} by FUNCOP_1:13 ; then A41: ( x in dom (F2 . m) or x in {(p2 +* (i,(m + 1)))} ) by A39, XBOOLE_0:def_3; thus ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) ::_thesis: verum proof percases ( x in dom (F2 . m) or x = p2 +* (i,(m + 1)) ) by A41, TARSKI:def_1; suppose x in dom (F2 . m) ; ::_thesis: ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) then ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m ) by A38; hence ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) by A40, XXREAL_0:2; ::_thesis: verum end; suppose x = p2 +* (i,(m + 1)) ; ::_thesis: ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) hence ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) ; ::_thesis: verum end; end; end; end; suppose ( not i in dom p2 or not p2 +* (i,m) in dom (F2 . m) or not (p2 +* (i,m)) ^ <*((F2 . m) . (p2 +* (i,m)))*> in dom e2 ) ; ::_thesis: ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) then F2 . (m + 1) = F2 . m by A5; then ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m ) by A38, A39; hence ex n being Element of NAT st ( x = p2 +* (i,n) & n <= m + 1 ) by A40, XXREAL_0:2; ::_thesis: verum end; end; end; end; A42: S3[ 0 ] proof let x be set ; ::_thesis: ( x in dom (F2 . 0) implies ex n being Element of NAT st ( x = p2 +* (i,n) & n <= 0 ) ) assume A43: x in dom (F2 . 0) ; ::_thesis: ex n being Element of NAT st ( x = p2 +* (i,n) & n <= 0 ) dom (F2 . 0) = {(p2 +* (i,0))} by A3, A4, A43, FUNCOP_1:13; then x = p2 +* (i,0) by A43, TARSKI:def_1; hence ex n being Element of NAT st ( x = p2 +* (i,n) & n <= 0 ) ; ::_thesis: verum end; A44: for m being Element of NAT holds S3[m] from NAT_1:sch_1(A42, A37); A45: for m, n being Element of NAT holds F2 . m c= F2 . (m + n) proof let m be Element of NAT ; ::_thesis: for n being Element of NAT holds F2 . m c= F2 . (m + n) defpred S4[ Element of NAT ] means F2 . m c= F2 . (m + $1); A46: now__::_thesis:_for_n_being_Element_of_NAT_st_S4[n]_holds_ S4[n_+_1] let n be Element of NAT ; ::_thesis: ( S4[n] implies S4[n + 1] ) assume A47: S4[n] ; ::_thesis: S4[n + 1] set k = m + n; F2 . (m + n) c= F2 . ((m + n) + 1) proof set p2c = (p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*>; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in F2 . (m + n) or x in F2 . ((m + n) + 1) ) assume A48: x in F2 . (m + n) ; ::_thesis: x in F2 . ((m + n) + 1) percases ( ( i in dom p2 & p2 +* (i,(m + n)) in dom (F2 . (m + n)) & (p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*> in dom e2 ) or not i in dom p2 or not p2 +* (i,(m + n)) in dom (F2 . (m + n)) or not (p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*> in dom e2 ) ; supposeA49: ( i in dom p2 & p2 +* (i,(m + n)) in dom (F2 . (m + n)) & (p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*> in dom e2 ) ; ::_thesis: x in F2 . ((m + n) + 1) A50: dom (F2 . (m + n)) misses dom ((p2 +* (i,((m + n) + 1))) .--> (e2 . ((p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*>))) proof assume not dom (F2 . (m + n)) misses dom ((p2 +* (i,((m + n) + 1))) .--> (e2 . ((p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*>))) ; ::_thesis: contradiction then consider x being set such that A51: x in (dom (F2 . (m + n))) /\ (dom ({(p2 +* (i,((m + n) + 1)))} --> (e2 . ((p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*>)))) by XBOOLE_0:4; x in dom (F2 . (m + n)) by A51, XBOOLE_0:def_4; then consider n2 being Element of NAT such that A52: x = p2 +* (i,n2) and A53: n2 <= m + n by A44; A54: (m + n) + 1 = (p2 +* (i,((m + n) + 1))) . i by A1, FUNCT_7:31; A55: x = p2 +* (i,((m + n) + 1)) by A51, TARSKI:def_1; n2 = (p2 +* (i,n2)) . i by A1, FUNCT_7:31; hence contradiction by A55, A52, A53, A54, NAT_1:13; ::_thesis: verum end; F2 . ((m + n) + 1) = (F2 . (m + n)) +* ((p2 +* (i,((m + n) + 1))) .--> (e2 . ((p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*>))) by A5, A49; then F2 . (m + n) c= F2 . ((m + n) + 1) by A50, FUNCT_4:32; hence x in F2 . ((m + n) + 1) by A48; ::_thesis: verum end; suppose ( not i in dom p2 or not p2 +* (i,(m + n)) in dom (F2 . (m + n)) or not (p2 +* (i,(m + n))) ^ <*((F2 . (m + n)) . (p2 +* (i,(m + n))))*> in dom e2 ) ; ::_thesis: x in F2 . ((m + n) + 1) hence x in F2 . ((m + n) + 1) by A5, A48; ::_thesis: verum end; end; end; hence S4[n + 1] by A47, XBOOLE_1:1; ::_thesis: verum end; A56: S4[ 0 ] ; thus for n being Element of NAT holds S4[n] from NAT_1:sch_1(A56, A46); ::_thesis: verum end; reconsider F1m = F1 . m, F1n = F1 . n, F2m = F2 . m, F2n = F2 . n as Element of HFuncs NAT ; A57: now__::_thesis:_(_p1_+*_(i,0)_<>_p2_+*_(i,0)_implies_for_m_being_Element_of_NAT_holds_not_(dom_(F1_._m))_/\_(dom_(F2_._m))_<>_{}_) assume A58: p1 +* (i,0) <> p2 +* (i,0) ; ::_thesis: for m being Element of NAT holds not (dom (F1 . m)) /\ (dom (F2 . m)) <> {} let m be Element of NAT ; ::_thesis: not (dom (F1 . m)) /\ (dom (F2 . m)) <> {} assume (dom (F1 . m)) /\ (dom (F2 . m)) <> {} ; ::_thesis: contradiction then consider x being set such that A59: x in (dom (F1 . m)) /\ (dom (F2 . m)) by XBOOLE_0:def_1; x in dom (F2 . m) by A59, XBOOLE_0:def_4; then A60: ex n2 being Element of NAT st ( x = p2 +* (i,n2) & n2 <= m ) by A44; x in dom (F1 . m) by A59, XBOOLE_0:def_4; then ex n1 being Element of NAT st ( x = p1 +* (i,n1) & n1 <= m ) by A24; hence contradiction by A58, A60, Th2; ::_thesis: verum end; thus primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) ::_thesis: verum proof percases ( m <= n or m >= n ) ; suppose m <= n ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) then consider k being Nat such that A61: n = m + k by NAT_1:10; reconsider k = k as Element of NAT by ORDINAL1:def_12; A62: n = m + k by A61; thus primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) ::_thesis: verum proof percases ( F1n = F2n or (dom F1n) /\ (dom F2n) = {} ) by A15, A57; suppose F1n = F2n ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) hence primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) by A6, A2, A25, A62, PARTFUN1:58; ::_thesis: verum end; suppose (dom F1n) /\ (dom F2n) = {} ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) then dom F1n misses dom F2n by XBOOLE_0:def_7; then F1n tolerates F2n by PARTFUN1:56; hence primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) by A6, A2, A25, A62, PARTFUN1:58; ::_thesis: verum end; end; end; end; suppose m >= n ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) then consider k being Nat such that A63: m = n + k by NAT_1:10; reconsider k = k as Element of NAT by ORDINAL1:def_12; A64: m = n + k by A63; thus primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) ::_thesis: verum proof percases ( F1m = F2m or (dom F1m) /\ (dom F2m) = {} ) by A15, A57; suppose F1m = F2m ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) hence primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) by A6, A2, A45, A64, PARTFUN1:58; ::_thesis: verum end; suppose (dom F1m) /\ (dom F2m) = {} ; ::_thesis: primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) then dom F1m misses dom F2m by XBOOLE_0:def_7; then F1m tolerates F2m by PARTFUN1:56; hence primrec (e1,e2,i,p1) tolerates primrec (e1,e2,i,p2) by A6, A2, A45, A64, PARTFUN1:58; ::_thesis: verum end; end; end; end; end; end; end; end; end; theorem Th52: :: COMPUT_1:52 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function for p being FinSequence of NAT holds dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function for p being FinSequence of NAT holds dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being FinSequence of NAT holds dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT set f1 = e1; set f2 = e2; let p be FinSequence of NAT ; ::_thesis: dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT percases ( i in dom p or not i in dom p ) ; supposeA1: i in dom p ; ::_thesis: dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT consider F being Function of NAT,(HFuncs NAT) such that A2: primrec (e1,e2,i,p) = F . (p /. i) and A3: ( i in dom p & Del (p,i) in dom e1 implies F . 0 = (p +* (i,0)) .--> (e1 . (Del (p,i))) ) and A4: ( ( not i in dom p or not Del (p,i) in dom e1 ) implies F . 0 = {} ) and A5: for m being Element of NAT holds S1[m,F . m,F . (m + 1),p,i,e2] by Def10; defpred S2[ Element of NAT ] means dom (F . $1) c= (1 + (arity e1)) -tuples_on NAT; A6: now__::_thesis:_for_m_being_Element_of_NAT_st_S2[m]_holds_ S2[m_+_1] let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[b1 + 1] ) assume A7: S2[m] ; ::_thesis: S2[b1 + 1] set pc = (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>; percases ( ( p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) ; supposeA8: ( p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) ; ::_thesis: S2[b1 + 1] dom (p +* (i,m)) = dom p by FUNCT_7:30 .= dom (p +* (i,(m + 1))) by FUNCT_7:30 ; then A9: len (p +* (i,m)) = len (p +* (i,(m + 1))) by FINSEQ_3:29; len (p +* (i,m)) = 1 + (arity e1) by A7, A8, CARD_1:def_7; then p +* (i,(m + 1)) is Element of (1 + (arity e1)) -tuples_on NAT by A9, FINSEQ_2:92; then A10: {(p +* (i,(m + 1)))} c= (1 + (arity e1)) -tuples_on NAT by ZFMISC_1:31; F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (e2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) by A1, A5, A8; then dom (F . (m + 1)) = (dom (F . m)) \/ (dom ((p +* (i,(m + 1))) .--> (e2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>)))) by FUNCT_4:def_1; then dom (F . (m + 1)) = (dom (F . m)) \/ {(p +* (i,(m + 1)))} by FUNCOP_1:13; hence S2[m + 1] by A7, A10, XBOOLE_1:8; ::_thesis: verum end; suppose ( not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) ; ::_thesis: S2[b1 + 1] hence S2[m + 1] by A5, A7; ::_thesis: verum end; end; end; A11: S2[ 0 ] proof percases ( Del (p,i) in dom e1 or not Del (p,i) in dom e1 ) ; supposeA12: Del (p,i) in dom e1 ; ::_thesis: S2[ 0 ] dom e1 c= (arity e1) -tuples_on NAT by Th21; then A13: len (Del (p,i)) = arity e1 by A12, CARD_1:def_7; A14: dom p = dom (p +* (i,0)) by FUNCT_7:30; p <> <*> NAT by A1; then consider n being Nat such that A15: len p = n + 1 by NAT_1:6; len (Del (p,i)) = n by A1, A15, FINSEQ_3:109; then len (p +* (i,0)) = 1 + (arity e1) by A13, A15, A14, FINSEQ_3:29; then A16: p +* (i,0) is Element of (1 + (arity e1)) -tuples_on NAT by FINSEQ_2:92; dom (F . 0) = {(p +* (i,0))} by A1, A3, A12, FUNCOP_1:13; hence S2[ 0 ] by A16, ZFMISC_1:31; ::_thesis: verum end; suppose not Del (p,i) in dom e1 ; ::_thesis: S2[ 0 ] hence S2[ 0 ] by A4, RELAT_1:38, XBOOLE_1:2; ::_thesis: verum end; end; end; for m being Element of NAT holds S2[m] from NAT_1:sch_1(A11, A6); hence dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT by A2; ::_thesis: verum end; suppose not i in dom p ; ::_thesis: dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT then primrec (e1,e2,i,p) = {} by Th50; hence dom (primrec (e1,e2,i,p)) c= (1 + (arity e1)) -tuples_on NAT by RELAT_1:38, XBOOLE_1:2; ::_thesis: verum end; end; end; theorem Th53: :: COMPUT_1:53 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function for p being FinSequence of NAT st e1 is empty holds primrec (e1,e2,i,p) is empty proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function for p being FinSequence of NAT st e1 is empty holds primrec (e1,e2,i,p) is empty let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being FinSequence of NAT st e1 is empty holds primrec (e1,e2,i,p) is empty set f1 = e1; set f2 = e2; let p be FinSequence of NAT ; ::_thesis: ( e1 is empty implies primrec (e1,e2,i,p) is empty ) consider F being Function of NAT,(HFuncs NAT) such that A1: primrec (e1,e2,i,p) = F . (p /. i) and ( i in dom p & Del (p,i) in dom e1 implies F . 0 = (p +* (i,0)) .--> (e1 . (Del (p,i))) ) and A2: ( ( not i in dom p or not Del (p,i) in dom e1 ) implies F . 0 = {} ) and A3: for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (e2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom e2 ) implies F . (m + 1) = F . m ) ) by Def10; defpred S2[ Element of NAT ] means F . $1 = {} ; A4: for k being Element of NAT st S2[k] holds S2[k + 1] by A3, RELAT_1:38; assume e1 is empty ; ::_thesis: primrec (e1,e2,i,p) is empty then A5: S2[ 0 ] by A2; for k being Element of NAT holds S2[k] from NAT_1:sch_1(A5, A4); hence primrec (e1,e2,i,p) is empty by A1; ::_thesis: verum end; theorem Th54: :: COMPUT_1:54 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds p in dom (primrec (f1,f2,i,p)) proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds p in dom (primrec (f1,f2,i,p)) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds p in dom (primrec (f1,f2,i,p)) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: ( f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) implies p in dom (primrec (f1,f2,i,p)) ) assume that A1: f1 is len-total and A2: f2 is len-total and A3: (arity f1) + 2 = arity f2 and A4: 1 <= i and A5: i <= 1 + (arity f1) ; ::_thesis: p in dom (primrec (f1,f2,i,p)) A6: len p = 1 + (arity f1) by CARD_1:def_7; then A7: i in dom p by A4, A5, FINSEQ_3:25; then A8: p /. i = p . i by PARTFUN1:def_6; consider F being Function of NAT,(HFuncs NAT) such that A9: primrec (f1,f2,i,p) = F . (p /. i) and A10: ( i in dom p & Del (p,i) in dom f1 implies F . 0 = (p +* (i,0)) .--> (f1 . (Del (p,i))) ) and ( ( not i in dom p or not Del (p,i) in dom f1 ) implies F . 0 = {} ) and A11: for m being Element of NAT holds ( ( i in dom p & p +* (i,m) in dom (F . m) & (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 implies F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) ) & ( ( not i in dom p or not p +* (i,m) in dom (F . m) or not (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*> in dom f2 ) implies F . (m + 1) = F . m ) ) by Def10; defpred S2[ Element of NAT ] means p +* (i,$1) in dom (F . $1); A12: p +* (i,(p . i)) = p by FUNCT_7:35; A13: now__::_thesis:_for_m_being_Element_of_NAT_st_S2[m]_holds_ S2[m_+_1] let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume A14: S2[m] ; ::_thesis: S2[m + 1] reconsider aa = (F . m) . (p +* (i,m)) as Element of NAT ; set pc = (p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>; reconsider p2 = <*aa*> as FinSequence of NAT ; reconsider p1 = (p +* (i,m)) ^ p2 as FinSequence of NAT ; A15: len p2 = 1 by CARD_1:def_7; len (p +* (i,m)) = 1 + (arity f1) by CARD_1:def_7; then len p1 = ((arity f1) + 1) + 1 by A15, FINSEQ_1:22 .= arity f2 by A3 ; then A16: p1 is Element of (arity f2) -tuples_on NAT by FINSEQ_2:92; p +* (i,(m + 1)) in {(p +* (i,(m + 1)))} by TARSKI:def_1; then A17: p +* (i,(m + 1)) in dom ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) by FUNCOP_1:13; dom f2 = (arity f2) -tuples_on NAT by A2, Th23; then F . (m + 1) = (F . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>))) by A7, A11, A14, A16; then dom (F . (m + 1)) = (dom (F . m)) \/ (dom ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*((F . m) . (p +* (i,m)))*>)))) by FUNCT_4:def_1; hence S2[m + 1] by A17, XBOOLE_0:def_3; ::_thesis: verum end; A18: now__::_thesis:_S2[_0_] reconsider Dpi = Del (p,i) as FinSequence of NAT by FINSEQ_3:105; reconsider Dpi9 = Dpi as Element of (len Dpi) -tuples_on NAT by FINSEQ_2:92; A19: dom f1 = (arity f1) -tuples_on NAT by A1, Th23; len (Del (p,i)) = arity f1 by A6, A7, FINSEQ_3:109; then Dpi9 in dom f1 by A19; then dom (F . 0) = {(p +* (i,0))} by A4, A5, A6, A10, FINSEQ_3:25, FUNCOP_1:13; hence S2[ 0 ] by TARSKI:def_1; ::_thesis: verum end; for m being Element of NAT holds S2[m] from NAT_1:sch_1(A18, A13); hence p in dom (primrec (f1,f2,i,p)) by A8, A9, A12; ::_thesis: verum end; definition let f1, f2 be NAT * -defined to-naturals homogeneous Function; let i be Element of NAT ; func primrec (f1,f2,i) -> Element of HFuncs NAT means :Def11: :: COMPUT_1:def 11 ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( it = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ); existence ex b1 being Element of HFuncs NAT ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( b1 = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) proof deffunc H1( FinSequence of NAT ) -> Element of HFuncs NAT = primrec (f1,f2,i,$1); reconsider ff1 = f1, ff2 = f2 as Element of HFuncs NAT by Th28; set n = (arity f1) + 1; consider G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) such that A1: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = H1(p) from FUNCT_2:sch_4(); reconsider Y = rng G as non empty Subset of (HFuncs NAT) by RELAT_1:def_19; Y is PartFunc-set of NAT * , NAT proof let f be Element of Y; :: according to RFUNCT_3:def_3 ::_thesis: f is Element of K32(K33((NAT *),NAT)) thus f is Element of K32(K33((NAT *),NAT)) ; ::_thesis: verum end; then reconsider Y = Y as PFUNC_DOMAIN of NAT * , NAT ; A2: Y is compatible proof let f, g be Function; :: according to COMPUT_1:def_1 ::_thesis: ( f in Y & g in Y implies f tolerates g ) assume f in Y ; ::_thesis: ( not g in Y or f tolerates g ) then consider x being set such that A3: x in dom G and A4: f = G . x by FUNCT_1:def_3; assume g in Y ; ::_thesis: f tolerates g then consider y being set such that A5: y in dom G and A6: g = G . y by FUNCT_1:def_3; reconsider x = x, y = y as Element of ((arity f1) + 1) -tuples_on NAT by A3, A5; A7: g = primrec (ff1,ff2,i,y) by A1, A6; f = primrec (ff1,ff2,i,x) by A1, A4; hence f tolerates g by A7, Th51; ::_thesis: verum end; now__::_thesis:_for_x_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT_holds_dom_(G_._x)_c=_((arity_f1)_+_1)_-tuples_on_NAT let x be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: dom (G . x) c= ((arity f1) + 1) -tuples_on NAT G . x = primrec (ff1,ff2,i,x) by A1; hence dom (G . x) c= ((arity f1) + 1) -tuples_on NAT by Th52; ::_thesis: verum end; then consider g being Element of HFuncs NAT such that A8: g = Union G and dom g c= ((arity f1) + 1) -tuples_on NAT by A2, Th39; take g ; ::_thesis: ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( g = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) take G ; ::_thesis: ( g = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) thus ( g = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) by A1, A8; ::_thesis: verum end; uniqueness for b1, b2 being Element of HFuncs NAT st ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( b1 = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) & ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( b2 = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) holds b1 = b2 proof let g1, g2 be Element of HFuncs NAT; ::_thesis: ( ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( g1 = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) & ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( g2 = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) implies g1 = g2 ) given G1 being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) such that A9: g1 = Union G1 and A10: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G1 . p = primrec (f1,f2,i,p) ; ::_thesis: ( for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) holds ( not g2 = Union G or ex p being Element of ((arity f1) + 1) -tuples_on NAT st not G . p = primrec (f1,f2,i,p) ) or g1 = g2 ) given G2 being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) such that A11: g2 = Union G2 and A12: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G2 . p = primrec (f1,f2,i,p) ; ::_thesis: g1 = g2 now__::_thesis:_for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT_holds_G1_._p_=_G2_._p let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: G1 . p = G2 . p thus G1 . p = primrec (f1,f2,i,p) by A10 .= G2 . p by A12 ; ::_thesis: verum end; hence g1 = g2 by A9, A11, FUNCT_2:63; ::_thesis: verum end; end; :: deftheorem Def11 defines primrec COMPUT_1:def_11_:_ for f1, f2 being NAT * -defined to-naturals homogeneous Function for i being Element of NAT for b4 being Element of HFuncs NAT holds ( b4 = primrec (f1,f2,i) iff ex G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( b4 = Union G & ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) ) ); theorem Th55: :: COMPUT_1:55 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function st e1 is empty holds primrec (e1,e2,i) is empty proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function st e1 is empty holds primrec (e1,e2,i) is empty let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: ( e1 is empty implies primrec (e1,e2,i) is empty ) set f1 = e1; set f2 = e2; assume A1: e1 is empty ; ::_thesis: primrec (e1,e2,i) is empty consider G being Function of (((arity e1) + 1) -tuples_on NAT),(HFuncs NAT) such that A2: primrec (e1,e2,i) = Union G and A3: for p being Element of ((arity e1) + 1) -tuples_on NAT holds G . p = primrec (e1,e2,i,p) by Def11; A4: dom G = ((arity e1) + 1) -tuples_on NAT by FUNCT_2:def_1; now__::_thesis:_for_y_being_set_holds_ (_(_y_in_rng_G_implies_y_in_{{}}_)_&_(_y_in_{{}}_implies_y_in_rng_G_)_) set p = the Element of ((arity e1) + 1) -tuples_on NAT; let y be set ; ::_thesis: ( ( y in rng G implies y in {{}} ) & ( y in {{}} implies y in rng G ) ) hereby ::_thesis: ( y in {{}} implies y in rng G ) assume y in rng G ; ::_thesis: y in {{}} then consider x being set such that A5: x in dom G and A6: G . x = y by FUNCT_1:def_3; reconsider p = x as Element of ((arity e1) + 1) -tuples_on NAT by A5; G . p = primrec (e1,e2,i,p) by A3 .= {} by A1, Th53 ; hence y in {{}} by A6, TARSKI:def_1; ::_thesis: verum end; assume y in {{}} ; ::_thesis: y in rng G then A7: y = {} by TARSKI:def_1; G . the Element of ((arity e1) + 1) -tuples_on NAT = primrec (e1,e2,i, the Element of ((arity e1) + 1) -tuples_on NAT) by A3 .= {} by A1, Th53 ; hence y in rng G by A4, A7, FUNCT_1:3; ::_thesis: verum end; then A8: rng G = {{}} by TARSKI:1; Union G = union (rng G) .= {} by A8, ZFMISC_1:25 ; hence primrec (e1,e2,i) is empty by A2; ::_thesis: verum end; theorem Th56: :: COMPUT_1:56 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function holds dom (primrec (f1,f2,i)) c= ((arity f1) + 1) -tuples_on NAT proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function holds dom (primrec (f1,f2,i)) c= ((arity f1) + 1) -tuples_on NAT let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: dom (primrec (f1,f2,i)) c= ((arity f1) + 1) -tuples_on NAT let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in dom (primrec (f1,f2,i)) or x in ((arity f1) + 1) -tuples_on NAT ) assume A1: x in dom (primrec (f1,f2,i)) ; ::_thesis: x in ((arity f1) + 1) -tuples_on NAT consider G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) such that A2: primrec (f1,f2,i) = Union G and A3: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) by Def11; A4: rng G is compatible proof let f, g be Function; :: according to COMPUT_1:def_1 ::_thesis: ( f in rng G & g in rng G implies f tolerates g ) assume that A5: f in rng G and A6: g in rng G ; ::_thesis: f tolerates g consider fx being set such that A7: fx in dom G and A8: f = G . fx by A5, FUNCT_1:def_3; reconsider fx = fx as Element of ((arity f1) + 1) -tuples_on NAT by A7; consider gx being set such that A9: gx in dom G and A10: g = G . gx by A6, FUNCT_1:def_3; reconsider gx = gx as Element of ((arity f1) + 1) -tuples_on NAT by A9; A11: G . gx = primrec (f1,f2,i,gx) by A3; G . fx = primrec (f1,f2,i,fx) by A3; hence f tolerates g by A8, A10, A11, Th51; ::_thesis: verum end; now__::_thesis:_for_x_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT_holds_dom_(G_._x)_c=_((arity_f1)_+_1)_-tuples_on_NAT let x be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: dom (G . x) c= ((arity f1) + 1) -tuples_on NAT G . x = primrec (f1,f2,i,x) by A3; hence dom (G . x) c= ((arity f1) + 1) -tuples_on NAT by Th52; ::_thesis: verum end; then ex F being Element of HFuncs NAT st ( F = Union G & dom F c= ((arity f1) + 1) -tuples_on NAT ) by A4, Th39; hence x in ((arity f1) + 1) -tuples_on NAT by A1, A2; ::_thesis: verum end; theorem Th57: :: COMPUT_1:57 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds ( dom (primrec (f1,f2,i)) = ((arity f1) + 1) -tuples_on NAT & arity (primrec (f1,f2,i)) = (arity f1) + 1 ) proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds ( dom (primrec (f1,f2,i)) = ((arity f1) + 1) -tuples_on NAT & arity (primrec (f1,f2,i)) = (arity f1) + 1 ) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: ( f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) implies ( dom (primrec (f1,f2,i)) = ((arity f1) + 1) -tuples_on NAT & arity (primrec (f1,f2,i)) = (arity f1) + 1 ) ) assume that A1: f1 is len-total and A2: f2 is len-total and A3: (arity f1) + 2 = arity f2 and A4: 1 <= i and A5: i <= 1 + (arity f1) ; ::_thesis: ( dom (primrec (f1,f2,i)) = ((arity f1) + 1) -tuples_on NAT & arity (primrec (f1,f2,i)) = (arity f1) + 1 ) set n = (arity f1) + 1; A6: ((arity f1) + 1) -tuples_on NAT c= dom (primrec (f1,f2,i)) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in ((arity f1) + 1) -tuples_on NAT or x in dom (primrec (f1,f2,i)) ) assume x in ((arity f1) + 1) -tuples_on NAT ; ::_thesis: x in dom (primrec (f1,f2,i)) then reconsider x9 = x as Element of ((arity f1) + 1) -tuples_on NAT ; consider G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) such that A7: primrec (f1,f2,i) = Union G and A8: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) by Def11; reconsider rngG = rng G as non empty functional compatible set by A7, Th11; A9: dom (union rngG) = union { (dom f) where f is Element of rngG : verum } by Th12; dom G = ((arity f1) + 1) -tuples_on NAT by FUNCT_2:def_1; then G . x9 in rng G by FUNCT_1:3; then A10: dom (G . x9) in { (dom f) where f is Element of rngG : verum } ; A11: x9 in dom (primrec (f1,f2,i,x9)) by A1, A2, A3, A4, A5, Th54; G . x9 = primrec (f1,f2,i,x9) by A8; hence x in dom (primrec (f1,f2,i)) by A7, A11, A9, A10, TARSKI:def_4; ::_thesis: verum end; dom (primrec (f1,f2,i)) c= ((arity f1) + 1) -tuples_on NAT by Th56; hence dom (primrec (f1,f2,i)) = ((arity f1) + 1) -tuples_on NAT by A6, XBOOLE_0:def_10; ::_thesis: arity (primrec (f1,f2,i)) = (arity f1) + 1 hence arity (primrec (f1,f2,i)) = (arity f1) + 1 by Th25; ::_thesis: verum end; Lm2: now__::_thesis:_for_f1,_f2_being_non_empty_NAT_*_-defined_to-naturals_homogeneous_Function for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT for_i,_m_being_Element_of_NAT_ for_F1,_F_being_Function_of_NAT,(HFuncs_NAT)_st_(_i_in_dom_(p_+*_(i,(m_+_1)))_&_Del_((p_+*_(i,(m_+_1))),i)_in_dom_f1_implies_F1_._0_=_{((p_+*_(i,(m_+_1)))_+*_(i,0))}_-->_(f1_._(Del_((p_+*_(i,(m_+_1))),i)))_)_&_(_(_not_i_in_dom_(p_+*_(i,(m_+_1)))_or_not_Del_((p_+*_(i,(m_+_1))),i)_in_dom_f1_)_implies_F1_._0_=_{}_)_&_(_for_M_being_Element_of_NAT_holds_S1[M,F1_._M,F1_._(M_+_1),p_+*_(i,(m_+_1)),i,f2]_)_&_(_i_in_dom_(p_+*_(i,m))_&_Del_((p_+*_(i,m)),i)_in_dom_f1_implies_F_._0_=_{((p_+*_(i,m))_+*_(i,0))}_-->_(f1_._(Del_((p_+*_(i,m)),i)))_)_&_(_(_not_i_in_dom_(p_+*_(i,m))_or_not_Del_((p_+*_(i,m)),i)_in_dom_f1_)_implies_F_._0_=_{}_)_&_(_for_M_being_Element_of_NAT_holds_S1[M,F_._M,F_._(M_+_1),p_+*_(i,m),i,f2]_)_holds_ F1_=_F let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT for i, m being Element of NAT for F1, F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F1 . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F1 . 0 = {} ) & ( for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,(m + 1)),i,f2] ) & ( i in dom (p +* (i,m)) & Del ((p +* (i,m)),i) in dom f1 implies F . 0 = {((p +* (i,m)) +* (i,0))} --> (f1 . (Del ((p +* (i,m)),i))) ) & ( ( not i in dom (p +* (i,m)) or not Del ((p +* (i,m)),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,m),i,f2] ) holds F1 = F let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: for i, m being Element of NAT for F1, F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F1 . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F1 . 0 = {} ) & ( for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,(m + 1)),i,f2] ) & ( i in dom (p +* (i,m)) & Del ((p +* (i,m)),i) in dom f1 implies F . 0 = {((p +* (i,m)) +* (i,0))} --> (f1 . (Del ((p +* (i,m)),i))) ) & ( ( not i in dom (p +* (i,m)) or not Del ((p +* (i,m)),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,m),i,f2] ) holds F1 = F let i, m be Element of NAT ; ::_thesis: for F1, F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F1 . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F1 . 0 = {} ) & ( for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,(m + 1)),i,f2] ) & ( i in dom (p +* (i,m)) & Del ((p +* (i,m)),i) in dom f1 implies F . 0 = {((p +* (i,m)) +* (i,0))} --> (f1 . (Del ((p +* (i,m)),i))) ) & ( ( not i in dom (p +* (i,m)) or not Del ((p +* (i,m)),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,m),i,f2] ) holds F1 = F set pm1 = p +* (i,(m + 1)); set pm = p +* (i,m); let F1, F be Function of NAT,(HFuncs NAT); ::_thesis: ( ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F1 . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F1 . 0 = {} ) & ( for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,(m + 1)),i,f2] ) & ( i in dom (p +* (i,m)) & Del ((p +* (i,m)),i) in dom f1 implies F . 0 = {((p +* (i,m)) +* (i,0))} --> (f1 . (Del ((p +* (i,m)),i))) ) & ( ( not i in dom (p +* (i,m)) or not Del ((p +* (i,m)),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,m),i,f2] ) implies F1 = F ) assume that A1: ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F1 . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) and A2: ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F1 . 0 = {} ) and A3: for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,(m + 1)),i,f2] and A4: ( i in dom (p +* (i,m)) & Del ((p +* (i,m)),i) in dom f1 implies F . 0 = {((p +* (i,m)) +* (i,0))} --> (f1 . (Del ((p +* (i,m)),i))) ) and A5: ( ( not i in dom (p +* (i,m)) or not Del ((p +* (i,m)),i) in dom f1 ) implies F . 0 = {} ) and A6: for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,m),i,f2] ; ::_thesis: F1 = F A7: dom p = dom (p +* (i,m)) by FUNCT_7:30; A8: (p +* (i,m)) +* (i,0) = p +* (i,0) by FUNCT_7:34 .= (p +* (i,(m + 1))) +* (i,0) by FUNCT_7:34 ; A9: dom p = dom (p +* (i,(m + 1))) by FUNCT_7:30; A10: Del ((p +* (i,m)),i) = Del (p,i) by Th3 .= Del ((p +* (i,(m + 1))),i) by Th3 ; for x being set st x in NAT holds F . x = F1 . x proof let x be set ; ::_thesis: ( x in NAT implies F . x = F1 . x ) defpred S2[ Element of NAT ] means F . $1 = F1 . $1; A11: for k being Element of NAT st S2[k] holds S2[k + 1] proof let k be Element of NAT ; ::_thesis: ( S2[k] implies S2[k + 1] ) assume A12: S2[k] ; ::_thesis: S2[k + 1] A13: (p +* (i,m)) +* (i,(k + 1)) = p +* (i,(k + 1)) by FUNCT_7:34 .= (p +* (i,(m + 1))) +* (i,(k + 1)) by FUNCT_7:34 ; A14: (p +* (i,m)) +* (i,k) = p +* (i,k) by FUNCT_7:34 .= (p +* (i,(m + 1))) +* (i,k) by FUNCT_7:34 ; percases ( ( i in dom (p +* (i,m)) & (p +* (i,m)) +* (i,k) in dom (F . k) & ((p +* (i,m)) +* (i,k)) ^ <*((F . k) . ((p +* (i,m)) +* (i,k)))*> in dom f2 ) or not i in dom (p +* (i,m)) or not (p +* (i,m)) +* (i,k) in dom (F . k) or not ((p +* (i,m)) +* (i,k)) ^ <*((F . k) . ((p +* (i,m)) +* (i,k)))*> in dom f2 ) ; supposeA15: ( i in dom (p +* (i,m)) & (p +* (i,m)) +* (i,k) in dom (F . k) & ((p +* (i,m)) +* (i,k)) ^ <*((F . k) . ((p +* (i,m)) +* (i,k)))*> in dom f2 ) ; ::_thesis: S2[k + 1] hence F . (k + 1) = (F . k) +* (((p +* (i,m)) +* (i,(k + 1))) .--> (f2 . (((p +* (i,m)) +* (i,k)) ^ <*((F . k) . ((p +* (i,m)) +* (i,k)))*>))) by A6 .= F1 . (k + 1) by A3, A7, A9, A12, A14, A13, A15 ; ::_thesis: verum end; supposeA16: ( not i in dom (p +* (i,m)) or not (p +* (i,m)) +* (i,k) in dom (F . k) or not ((p +* (i,m)) +* (i,k)) ^ <*((F . k) . ((p +* (i,m)) +* (i,k)))*> in dom f2 ) ; ::_thesis: S2[k + 1] hence F . (k + 1) = F . k by A6 .= F1 . (k + 1) by A3, A7, A9, A12, A14, A16 ; ::_thesis: verum end; end; end; A17: S2[ 0 ] by A1, A2, A4, A5, A7, A8, A10, FUNCT_7:30; A18: for k being Element of NAT holds S2[k] from NAT_1:sch_1(A17, A11); assume x in NAT ; ::_thesis: F . x = F1 . x hence F . x = F1 . x by A18; ::_thesis: verum end; hence F1 = F by FUNCT_2:12; ::_thesis: verum end; Lm3: now__::_thesis:_for_f1,_f2_being_non_empty_NAT_*_-defined_to-naturals_homogeneous_Function for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT for_i,_m_being_Element_of_NAT_st_i_in_dom_p_holds_ for_F_being_Function_of_NAT,(HFuncs_NAT)_st_(_i_in_dom_(p_+*_(i,(m_+_1)))_&_Del_((p_+*_(i,(m_+_1))),i)_in_dom_f1_implies_F_._0_=_{((p_+*_(i,(m_+_1)))_+*_(i,0))}_-->_(f1_._(Del_((p_+*_(i,(m_+_1))),i)))_)_&_(_(_not_i_in_dom_(p_+*_(i,(m_+_1)))_or_not_Del_((p_+*_(i,(m_+_1))),i)_in_dom_f1_)_implies_F_._0_=_{}_)_&_(_for_M_being_Element_of_NAT_holds_S1[M,F_._M,F_._(M_+_1),p_+*_(i,(m_+_1)),i,f2]_)_holds_ (_(F_._(m_+_1))_._(p_+*_(i,m))_=_(F_._m)_._(p_+*_(i,m))_&_not_p_+*_(i,(m_+_1))_in_dom_(F_._m)_) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT for i, m being Element of NAT st i in dom p holds for F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(m + 1)),i,f2] ) holds ( (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) & not p +* (i,(m + 1)) in dom (F . m) ) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: for i, m being Element of NAT st i in dom p holds for F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(m + 1)),i,f2] ) holds ( (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) & not p +* (i,(m + 1)) in dom (F . m) ) let i, m be Element of NAT ; ::_thesis: ( i in dom p implies for F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(m + 1)),i,f2] ) holds ( (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) & not p +* (i,(m + 1)) in dom (F . m) ) ) assume A1: i in dom p ; ::_thesis: for F being Function of NAT,(HFuncs NAT) st ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(m + 1)),i,f2] ) holds ( (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) & not p +* (i,(m + 1)) in dom (F . m) ) set pm = p +* (i,m); set pm1 = p +* (i,(m + 1)); let F be Function of NAT,(HFuncs NAT); ::_thesis: ( ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) & ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F . 0 = {} ) & ( for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(m + 1)),i,f2] ) implies ( (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) & not p +* (i,(m + 1)) in dom (F . m) ) ) assume that A2: ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F . 0 = {((p +* (i,(m + 1))) +* (i,0))} --> (f1 . (Del ((p +* (i,(m + 1))),i))) ) and A3: ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F . 0 = {} ) and A4: for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(m + 1)),i,f2] ; ::_thesis: ( (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) & not p +* (i,(m + 1)) in dom (F . m) ) thus (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) ::_thesis: not p +* (i,(m + 1)) in dom (F . m) proof percases ( ( i in dom (p +* (i,(m + 1))) & (p +* (i,(m + 1))) +* (i,m) in dom (F . m) & ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) or not i in dom (p +* (i,(m + 1))) or not (p +* (i,(m + 1))) +* (i,m) in dom (F . m) or not ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; supposeA5: ( i in dom (p +* (i,(m + 1))) & (p +* (i,(m + 1))) +* (i,m) in dom (F . m) & ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; ::_thesis: (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) A6: p +* (i,(m + 1)) = (p +* (i,(m + 1))) +* (i,(m + 1)) by FUNCT_7:34; A7: (p +* (i,(m + 1))) . i = m + 1 by A1, FUNCT_7:31; (p +* (i,m)) . i = m by A1, FUNCT_7:31; then p +* (i,m) <> p +* (i,(m + 1)) by A7; then A8: not p +* (i,m) in dom ({((p +* (i,(m + 1))) +* (i,(m + 1)))} --> (f2 . (((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*>))) by A6, TARSKI:def_1; F . (m + 1) = (F . m) +* (((p +* (i,(m + 1))) +* (i,(m + 1))) .--> (f2 . (((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*>))) by A4, A5; hence (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) by A8, FUNCT_4:11; ::_thesis: verum end; suppose ( not i in dom (p +* (i,(m + 1))) or not (p +* (i,(m + 1))) +* (i,m) in dom (F . m) or not ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; ::_thesis: (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) hence (F . (m + 1)) . (p +* (i,m)) = (F . m) . (p +* (i,m)) by A4; ::_thesis: verum end; end; end; A9: for m, k being Element of NAT st p +* (i,k) in dom (F . m) holds k <= m proof defpred S2[ Element of NAT ] means for k being Element of NAT st p +* (i,k) in dom (F . $1) holds k <= $1; A10: for m being Element of NAT st S2[m] holds S2[m + 1] proof let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume A11: S2[m] ; ::_thesis: S2[m + 1] let k be Element of NAT ; ::_thesis: ( p +* (i,k) in dom (F . (m + 1)) implies k <= m + 1 ) assume A12: p +* (i,k) in dom (F . (m + 1)) ; ::_thesis: k <= m + 1 percases ( ( i in dom (p +* (i,(m + 1))) & (p +* (i,(m + 1))) +* (i,m) in dom (F . m) & ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) or not i in dom (p +* (i,(m + 1))) or not (p +* (i,(m + 1))) +* (i,m) in dom (F . m) or not ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; suppose ( i in dom (p +* (i,(m + 1))) & (p +* (i,(m + 1))) +* (i,m) in dom (F . m) & ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; ::_thesis: k <= m + 1 then F . (m + 1) = (F . m) +* (((p +* (i,(m + 1))) +* (i,(m + 1))) .--> (f2 . (((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*>))) by A4; then dom (F . (m + 1)) = (dom (F . m)) \/ (dom ({((p +* (i,(m + 1))) +* (i,(m + 1)))} --> (f2 . (((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*>)))) by FUNCT_4:def_1; then A13: dom (F . (m + 1)) = (dom (F . m)) \/ {((p +* (i,(m + 1))) +* (i,(m + 1)))} by FUNCOP_1:13; thus k <= m + 1 ::_thesis: verum proof percases ( p +* (i,k) in dom (F . m) or p +* (i,k) in {((p +* (i,(m + 1))) +* (i,(m + 1)))} ) by A12, A13, XBOOLE_0:def_3; supposeA14: p +* (i,k) in dom (F . m) ; ::_thesis: k <= m + 1 A15: m <= m + 1 by NAT_1:11; k <= m by A11, A14; hence k <= m + 1 by A15, XXREAL_0:2; ::_thesis: verum end; suppose p +* (i,k) in {((p +* (i,(m + 1))) +* (i,(m + 1)))} ; ::_thesis: k <= m + 1 then A16: p +* (i,k) = (p +* (i,(m + 1))) +* (i,(m + 1)) by TARSKI:def_1 .= p +* (i,(m + 1)) by FUNCT_7:34 ; k = (p +* (i,k)) . i by A1, FUNCT_7:31 .= m + 1 by A1, A16, FUNCT_7:31 ; hence k <= m + 1 ; ::_thesis: verum end; end; end; end; suppose ( not i in dom (p +* (i,(m + 1))) or not (p +* (i,(m + 1))) +* (i,m) in dom (F . m) or not ((p +* (i,(m + 1))) +* (i,m)) ^ <*((F . m) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; ::_thesis: k <= m + 1 then F . (m + 1) = F . m by A4; then A17: k <= m by A11, A12; m <= m + 1 by NAT_1:11; hence k <= m + 1 by A17, XXREAL_0:2; ::_thesis: verum end; end; end; A18: S2[ 0 ] proof let k be Element of NAT ; ::_thesis: ( p +* (i,k) in dom (F . 0) implies k <= 0 ) assume A19: p +* (i,k) in dom (F . 0) ; ::_thesis: k <= 0 percases ( ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 ) or not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) ; suppose ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 ) ; ::_thesis: k <= 0 then dom (F . 0) = {((p +* (i,(m + 1))) +* (i,0))} by A2, FUNCOP_1:13; then A20: p +* (i,k) = (p +* (i,(m + 1))) +* (i,0) by A19, TARSKI:def_1 .= p +* (i,0) by FUNCT_7:34 ; k = (p +* (i,k)) . i by A1, FUNCT_7:31 .= 0 by A1, A20, FUNCT_7:31 ; hence k <= 0 ; ::_thesis: verum end; suppose ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) ; ::_thesis: k <= 0 hence k <= 0 by A3, A19; ::_thesis: verum end; end; end; thus for n being Element of NAT holds S2[n] from NAT_1:sch_1(A18, A10); ::_thesis: verum end; thus not p +* (i,(m + 1)) in dom (F . m) ::_thesis: verum proof assume p +* (i,(m + 1)) in dom (F . m) ; ::_thesis: contradiction then m + 1 <= m by A9; hence contradiction by NAT_1:13; ::_thesis: verum end; end; definition let n be Nat; let p be Element of n -tuples_on NAT; let i, k be Element of NAT ; :: original: +* redefine funcp +* (i,k) -> Element of n -tuples_on NAT; coherence p +* (i,k) is Element of n -tuples_on NAT proof dom (p +* (i,k)) = dom p by FUNCT_7:30; then len (p +* (i,k)) = len p by FINSEQ_3:29 .= n by CARD_1:def_7 ; hence p +* (i,k) is Element of n -tuples_on NAT by FINSEQ_2:92; ::_thesis: verum end; end; Lm4: now__::_thesis:_for_f1,_f2_being_non_empty_NAT_*_-defined_to-naturals_homogeneous_Function for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT for_i,_m_being_Element_of_NAT_st_i_in_dom_p_holds_ for_G_being_Function_of_(((arity_f1)_+_1)_-tuples_on_NAT),(HFuncs_NAT)_st_(_for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT_holds_G_._p_=_primrec_(f1,f2,i,p)_)_holds_ for_k,_n_being_Element_of_NAT_holds_dom_(G_._(p_+*_(i,k)))_c=_dom_(G_._(p_+*_(i,(k_+_n)))) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT for i, m being Element of NAT st i in dom p holds for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: for i, m being Element of NAT st i in dom p holds for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) let i, m be Element of NAT ; ::_thesis: ( i in dom p implies for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) ) assume A1: i in dom p ; ::_thesis: for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) let G be Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT); ::_thesis: ( ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) implies for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) ) assume A2: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ; ::_thesis: for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) thus for k, n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) ::_thesis: verum proof let k be Element of NAT ; ::_thesis: for n being Element of NAT holds dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + n)))) set pk = p +* (i,k); defpred S2[ Element of NAT ] means dom (G . (p +* (i,k))) c= dom (G . (p +* (i,(k + $1)))); A3: now__::_thesis:_for_n_being_Element_of_NAT_st_S2[n]_holds_ S2[n_+_1] let n be Element of NAT ; ::_thesis: ( S2[n] implies S2[b1 + 1] ) assume A4: S2[n] ; ::_thesis: S2[b1 + 1] set m = k + n; set pkn1 = p +* (i,((k + n) + 1)); set pkn = p +* (i,(k + n)); consider F being Function of NAT,(HFuncs NAT) such that A5: primrec (f1,f2,i,(p +* (i,(k + n)))) = F . ((p +* (i,(k + n))) /. i) and A6: ( i in dom (p +* (i,(k + n))) & Del ((p +* (i,(k + n))),i) in dom f1 implies F . 0 = ((p +* (i,(k + n))) +* (i,0)) .--> (f1 . (Del ((p +* (i,(k + n))),i))) ) and A7: ( ( not i in dom (p +* (i,(k + n))) or not Del ((p +* (i,(k + n))),i) in dom f1 ) implies F . 0 = {} ) and A8: for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(k + n)),i,f2] by Def10; dom p = dom (p +* (i,((k + n) + 1))) by FUNCT_7:30; then A9: (p +* (i,((k + n) + 1))) /. i = (p +* (i,((k + n) + 1))) . i by A1, PARTFUN1:def_6 .= (k + n) + 1 by A1, FUNCT_7:31 ; consider F1 being Function of NAT,(HFuncs NAT) such that A10: primrec (f1,f2,i,(p +* (i,((k + n) + 1)))) = F1 . ((p +* (i,((k + n) + 1))) /. i) and A11: ( i in dom (p +* (i,((k + n) + 1))) & Del ((p +* (i,((k + n) + 1))),i) in dom f1 implies F1 . 0 = ((p +* (i,((k + n) + 1))) +* (i,0)) .--> (f1 . (Del ((p +* (i,((k + n) + 1))),i))) ) and A12: ( ( not i in dom (p +* (i,((k + n) + 1))) or not Del ((p +* (i,((k + n) + 1))),i) in dom f1 ) implies F1 . 0 = {} ) and A13: for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,((k + n) + 1)),i,f2] by Def10; F1 = F by A6, A7, A8, A11, A12, A13, Lm2; then A14: G . (p +* (i,(k + (n + 1)))) = F . ((k + n) + 1) by A2, A10, A9; dom p = dom (p +* (i,(k + n))) by FUNCT_7:30; then (p +* (i,(k + n))) /. i = (p +* (i,(k + n))) . i by A1, PARTFUN1:def_6 .= k + n by A1, FUNCT_7:31 ; then A15: G . (p +* (i,(k + n))) = F . (k + n) by A2, A5; percases ( ( i in dom (p +* (i,(k + n))) & (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) & ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) or not i in dom (p +* (i,(k + n))) or not (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) or not ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) ; suppose ( i in dom (p +* (i,(k + n))) & (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) & ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) ; ::_thesis: S2[b1 + 1] then F . ((k + n) + 1) = (F . (k + n)) +* (((p +* (i,(k + n))) +* (i,((k + n) + 1))) .--> (f2 . (((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*>))) by A8; then dom (F . ((k + n) + 1)) = (dom (F . (k + n))) \/ (dom ({((p +* (i,(k + n))) +* (i,((k + n) + 1)))} --> (f2 . (((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*>)))) by FUNCT_4:def_1; then dom (F . (k + n)) c= dom (F . ((k + n) + 1)) by XBOOLE_1:7; hence S2[n + 1] by A4, A14, A15, XBOOLE_1:1; ::_thesis: verum end; suppose ( not i in dom (p +* (i,(k + n))) or not (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) or not ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) ; ::_thesis: S2[b1 + 1] hence S2[n + 1] by A4, A8, A14, A15; ::_thesis: verum end; end; end; A16: S2[ 0 ] ; thus for n being Element of NAT holds S2[n] from NAT_1:sch_1(A16, A3); ::_thesis: verum end; end; Lm5: now__::_thesis:_for_f1,_f2_being_non_empty_NAT_*_-defined_to-naturals_homogeneous_Function for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT for_i,_m_being_Element_of_NAT_st_i_in_dom_p_holds_ for_G_being_Function_of_(((arity_f1)_+_1)_-tuples_on_NAT),(HFuncs_NAT)_st_(_for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT_holds_G_._p_=_primrec_(f1,f2,i,p)_)_holds_ for_k,_n_being_Element_of_NAT_st_not_p_+*_(i,k)_in_dom_(G_._(p_+*_(i,k)))_holds_ not_p_+*_(i,k)_in_dom_(G_._(p_+*_(i,(k_+_n)))) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT for i, m being Element of NAT st i in dom p holds for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: for i, m being Element of NAT st i in dom p holds for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) let i, m be Element of NAT ; ::_thesis: ( i in dom p implies for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) ) assume A1: i in dom p ; ::_thesis: for G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) st ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) holds for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) let G be Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT); ::_thesis: ( ( for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ) implies for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) ) assume A2: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) ; ::_thesis: for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) thus for k, n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) ::_thesis: verum proof let k be Element of NAT ; ::_thesis: for n being Element of NAT st not p +* (i,k) in dom (G . (p +* (i,k))) holds not p +* (i,k) in dom (G . (p +* (i,(k + n)))) set pk = p +* (i,k); defpred S2[ Element of NAT ] means ( not p +* (i,k) in dom (G . (p +* (i,k))) implies not p +* (i,k) in dom (G . (p +* (i,(k + $1)))) ); A3: for n being Element of NAT st S2[n] holds S2[n + 1] proof let n be Element of NAT ; ::_thesis: ( S2[n] implies S2[n + 1] ) assume that A4: S2[n] and A5: not p +* (i,k) in dom (G . (p +* (i,k))) ; ::_thesis: not p +* (i,k) in dom (G . (p +* (i,(k + (n + 1))))) set m = k + n; set pkn = p +* (i,(k + n)); consider F being Function of NAT,(HFuncs NAT) such that A6: primrec (f1,f2,i,(p +* (i,(k + n)))) = F . ((p +* (i,(k + n))) /. i) and A7: ( i in dom (p +* (i,(k + n))) & Del ((p +* (i,(k + n))),i) in dom f1 implies F . 0 = ((p +* (i,(k + n))) +* (i,0)) .--> (f1 . (Del ((p +* (i,(k + n))),i))) ) and A8: ( ( not i in dom (p +* (i,(k + n))) or not Del ((p +* (i,(k + n))),i) in dom f1 ) implies F . 0 = {} ) and A9: for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,(k + n)),i,f2] by Def10; A10: dom p = dom (p +* (i,(k + n))) by FUNCT_7:30; then (p +* (i,(k + n))) /. i = (p +* (i,(k + n))) . i by A1, PARTFUN1:def_6 .= k + n by A1, FUNCT_7:31 ; then A11: not p +* (i,k) in dom (F . (k + n)) by A2, A4, A5, A6; set pkn1 = p +* (i,((k + n) + 1)); consider F1 being Function of NAT,(HFuncs NAT) such that A12: primrec (f1,f2,i,(p +* (i,((k + n) + 1)))) = F1 . ((p +* (i,((k + n) + 1))) /. i) and A13: ( i in dom (p +* (i,((k + n) + 1))) & Del ((p +* (i,((k + n) + 1))),i) in dom f1 implies F1 . 0 = ((p +* (i,((k + n) + 1))) +* (i,0)) .--> (f1 . (Del ((p +* (i,((k + n) + 1))),i))) ) and A14: ( ( not i in dom (p +* (i,((k + n) + 1))) or not Del ((p +* (i,((k + n) + 1))),i) in dom f1 ) implies F1 . 0 = {} ) and A15: for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,((k + n) + 1)),i,f2] by Def10; dom p = dom (p +* (i,((k + n) + 1))) by FUNCT_7:30; then A16: (p +* (i,((k + n) + 1))) /. i = (p +* (i,((k + n) + 1))) . i by A1, PARTFUN1:def_6 .= (k + n) + 1 by A1, FUNCT_7:31 ; F1 = F by A7, A8, A9, A13, A14, A15, Lm2; then A17: G . (p +* (i,(k + (n + 1)))) = F . ((k + n) + 1) by A2, A12, A16; percases ( ( i in dom (p +* (i,(k + n))) & (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) & ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) or not i in dom (p +* (i,(k + n))) or not (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) or not ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) ; suppose ( i in dom (p +* (i,(k + n))) & (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) & ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) ; ::_thesis: not p +* (i,k) in dom (G . (p +* (i,(k + (n + 1))))) then F . ((k + n) + 1) = (F . (k + n)) +* (((p +* (i,(k + n))) +* (i,((k + n) + 1))) .--> (f2 . (((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*>))) by A9; then dom (F . ((k + n) + 1)) = (dom (F . (k + n))) \/ (dom ({((p +* (i,(k + n))) +* (i,((k + n) + 1)))} --> (f2 . (((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*>)))) by FUNCT_4:def_1; then A18: dom (F . ((k + n) + 1)) = (dom (F . (k + n))) \/ {((p +* (i,(k + n))) +* (i,((k + n) + 1)))} by FUNCOP_1:13; k <= k + n by NAT_1:11; then A19: k <> (k + n) + 1 by NAT_1:13; A20: (p +* (i,k)) . i = k by A1, FUNCT_7:31; ((p +* (i,(k + n))) +* (i,((k + n) + 1))) . i = (k + n) + 1 by A1, A10, FUNCT_7:31; then not p +* (i,k) in {((p +* (i,(k + n))) +* (i,((k + n) + 1)))} by A19, A20, TARSKI:def_1; hence not p +* (i,k) in dom (G . (p +* (i,(k + (n + 1))))) by A11, A17, A18, XBOOLE_0:def_3; ::_thesis: verum end; suppose ( not i in dom (p +* (i,(k + n))) or not (p +* (i,(k + n))) +* (i,(k + n)) in dom (F . (k + n)) or not ((p +* (i,(k + n))) +* (i,(k + n))) ^ <*((F . (k + n)) . ((p +* (i,(k + n))) +* (i,(k + n))))*> in dom f2 ) ; ::_thesis: not p +* (i,k) in dom (G . (p +* (i,(k + (n + 1))))) hence not p +* (i,k) in dom (G . (p +* (i,(k + (n + 1))))) by A9, A11, A17; ::_thesis: verum end; end; end; A21: S2[ 0 ] ; thus for n being Element of NAT holds S2[n] from NAT_1:sch_1(A21, A3); ::_thesis: verum end; end; Lm6: for i, m being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) proof let i, m be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: ( i in dom p implies ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) ) set p0 = p +* (i,0); consider G being Function of (((arity f1) + 1) -tuples_on NAT),(HFuncs NAT) such that A1: primrec (f1,f2,i) = Union G and A2: for p being Element of ((arity f1) + 1) -tuples_on NAT holds G . p = primrec (f1,f2,i,p) by Def11; reconsider rngG = rng G as functional compatible set by A1, Th11; assume A3: i in dom p ; ::_thesis: ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) A4: now__::_thesis:_for_k_being_Element_of_NAT_st_p_+*_(i,k)_in_dom_(primrec_(f1,f2,i))_holds_ p_+*_(i,k)_in_dom_(G_._(p_+*_(i,k))) let k be Element of NAT ; ::_thesis: ( p +* (i,k) in dom (primrec (f1,f2,i)) implies p +* (i,k) in dom (G . (p +* (i,k))) ) assume that A5: p +* (i,k) in dom (primrec (f1,f2,i)) and A6: not p +* (i,k) in dom (G . (p +* (i,k))) ; ::_thesis: contradiction union rngG <> {} by A1, A5; then reconsider rngG = rng G as non empty functional compatible set ; set pk = p +* (i,k); dom (union rngG) = union { (dom f) where f is Element of rngG : verum } by Th12; then consider X being set such that A7: p +* (i,k) in X and A8: X in { (dom f) where f is Element of rngG : verum } by A1, A5, TARSKI:def_4; consider f being Element of rngG such that A9: X = dom f and verum by A8; consider pp being set such that A10: pp in dom G and A11: f = G . pp by FUNCT_1:def_3; reconsider pp = pp as Element of ((arity f1) + 1) -tuples_on NAT by A10; G . pp = primrec (f1,f2,i,pp) by A2; then A12: ex m being Element of NAT st p +* (i,k) = pp +* (i,m) by A7, A9, A11, Th49; set ppi = pp . i; A13: p +* (i,(pp . i)) = (p +* (i,k)) +* (i,(pp . i)) by FUNCT_7:34 .= pp +* (i,(pp . i)) by A12, FUNCT_7:34 .= pp by FUNCT_7:35 ; percases ( k = pp . i or pp . i < k or pp . i > k ) by XXREAL_0:1; suppose k = pp . i ; ::_thesis: contradiction hence contradiction by A6, A7, A9, A11, A13; ::_thesis: verum end; suppose pp . i < k ; ::_thesis: contradiction then consider m being Nat such that A14: k = (pp . i) + m by NAT_1:10; reconsider m = m as Element of NAT by ORDINAL1:def_12; k = (pp . i) + m by A14; then dom (G . pp) c= dom (G . (p +* (i,k))) by A3, A2, A13, Lm4; hence contradiction by A6, A7, A9, A11; ::_thesis: verum end; suppose pp . i > k ; ::_thesis: contradiction then consider m being Nat such that A15: pp . i = k + m by NAT_1:10; reconsider m = m as Element of NAT by ORDINAL1:def_12; pp . i = k + m by A15; hence contradiction by A3, A2, A6, A7, A9, A11, A13, Lm5; ::_thesis: verum end; end; end; A16: dom p = dom (p +* (i,0)) by FUNCT_7:30; A17: now__::_thesis:_(_(_p_+*_(i,0)_in_dom_(G_._(p_+*_(i,0)))_implies_Del_(p,i)_in_dom_f1_)_&_(_Del_(p,i)_in_dom_f1_implies_p_+*_(i,0)_in_dom_(G_._(p_+*_(i,0)))_)_&_(_p_+*_(i,0)_in_dom_(G_._(p_+*_(i,0)))_implies_(G_._(p_+*_(i,0)))_._(p_+*_(i,0))_=_f1_._(Del_(p,i))_)_) A18: p +* (i,0) in {(p +* (i,0))} by TARSKI:def_1; A19: (p +* (i,0)) /. i = (p +* (i,0)) . i by A3, A16, PARTFUN1:def_6 .= 0 by A3, FUNCT_7:31 ; consider F being Function of NAT,(HFuncs NAT) such that A20: primrec (f1,f2,i,(p +* (i,0))) = F . ((p +* (i,0)) /. i) and A21: ( i in dom (p +* (i,0)) & Del ((p +* (i,0)),i) in dom f1 implies F . 0 = ((p +* (i,0)) +* (i,0)) .--> (f1 . (Del ((p +* (i,0)),i))) ) and A22: ( ( not i in dom (p +* (i,0)) or not Del ((p +* (i,0)),i) in dom f1 ) implies F . 0 = {} ) and for m being Element of NAT holds S1[m,F . m,F . (m + 1),p +* (i,0),i,f2] by Def10; A23: G . (p +* (i,0)) = primrec (f1,f2,i,(p +* (i,0))) by A2; thus ( p +* (i,0) in dom (G . (p +* (i,0))) iff Del (p,i) in dom f1 ) ::_thesis: ( p +* (i,0) in dom (G . (p +* (i,0))) implies (G . (p +* (i,0))) . (p +* (i,0)) = f1 . (Del (p,i)) ) proof thus ( p +* (i,0) in dom (G . (p +* (i,0))) implies Del (p,i) in dom f1 ) by A2, A20, A22, A19, Th3, RELAT_1:38; ::_thesis: ( Del (p,i) in dom f1 implies p +* (i,0) in dom (G . (p +* (i,0))) ) assume Del (p,i) in dom f1 ; ::_thesis: p +* (i,0) in dom (G . (p +* (i,0))) then dom (F . 0) = {((p +* (i,0)) +* (i,0))} by A3, A21, Th3, FUNCOP_1:13, FUNCT_7:30 .= {(p +* (i,0))} by FUNCT_7:34 ; hence p +* (i,0) in dom (G . (p +* (i,0))) by A23, A20, A19, TARSKI:def_1; ::_thesis: verum end; assume p +* (i,0) in dom (G . (p +* (i,0))) ; ::_thesis: (G . (p +* (i,0))) . (p +* (i,0)) = f1 . (Del (p,i)) then F . 0 = {(p +* (i,0))} --> (f1 . (Del ((p +* (i,0)),i))) by A2, A20, A21, A22, A19, FUNCT_7:34, RELAT_1:38; then F . 0 = {(p +* (i,0))} --> (f1 . (Del (p,i))) by Th3; hence (G . (p +* (i,0))) . (p +* (i,0)) = f1 . (Del (p,i)) by A23, A20, A19, A18, FUNCOP_1:7; ::_thesis: verum end; set pm1 = p +* (i,(m + 1)); set pm = p +* (i,m); set pc = <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*>; A24: dom G = ((arity f1) + 1) -tuples_on NAT by FUNCT_2:def_1; then A25: G . (p +* (i,(m + 1))) in rng G by FUNCT_1:def_3; reconsider rngG = rngG as non empty functional compatible set ; A26: G . (p +* (i,0)) in rng G by A24, FUNCT_1:def_3; thus ( p +* (i,0) in dom (primrec (f1,f2,i)) iff Del (p,i) in dom f1 ) ::_thesis: ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) proof thus ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) by A4, A17; ::_thesis: ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) assume A27: Del (p,i) in dom f1 ; ::_thesis: p +* (i,0) in dom (primrec (f1,f2,i)) dom (G . (p +* (i,0))) in { (dom f) where f is Element of rngG : verum } by A26; then p +* (i,0) in union { (dom f) where f is Element of rngG : verum } by A17, A27, TARSKI:def_4; hence p +* (i,0) in dom (primrec (f1,f2,i)) by A1, Th12; ::_thesis: verum end; hereby ::_thesis: ( ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) assume A28: p +* (i,0) in dom (primrec (f1,f2,i)) ; ::_thesis: (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) then p +* (i,0) in dom (G . (p +* (i,0))) by A4; then (union rngG) . (p +* (i,0)) = (G . (p +* (i,0))) . (p +* (i,0)) by A26, Th13; hence (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) by A1, A4, A17, A28; ::_thesis: verum end; A29: dom p = dom (p +* (i,(m + 1))) by FUNCT_7:30; A30: (p +* (i,(m + 1))) +* (i,(m + 1)) = p +* (i,(m + 1)) by FUNCT_7:34; A31: (p +* (i,(m + 1))) +* (i,m) = p +* (i,m) by FUNCT_7:34; A32: dom p = dom (p +* (i,m)) by FUNCT_7:30; A33: now__::_thesis:_(_(_p_+*_(i,(m_+_1))_in_dom_(G_._(p_+*_(i,(m_+_1))))_implies_(_p_+*_(i,m)_in_dom_(G_._(p_+*_(i,m)))_&_(p_+*_(i,m))_^_<*((G_._(p_+*_(i,(m_+_1))))_._((p_+*_(i,(m_+_1)))_+*_(i,m)))*>_in_dom_f2_)_)_&_(_p_+*_(i,m)_in_dom_(G_._(p_+*_(i,m)))_&_(p_+*_(i,m))_^_<*((G_._(p_+*_(i,(m_+_1))))_._((p_+*_(i,(m_+_1)))_+*_(i,m)))*>_in_dom_f2_implies_p_+*_(i,(m_+_1))_in_dom_(G_._(p_+*_(i,(m_+_1))))_)_&_(_p_+*_(i,(m_+_1))_in_dom_(G_._(p_+*_(i,(m_+_1))))_implies_(G_._(p_+*_(i,(m_+_1))))_._(p_+*_(i,(m_+_1)))_=_f2_._((p_+*_(i,m))_^_<*((G_._(p_+*_(i,(m_+_1))))_._((p_+*_(i,(m_+_1)))_+*_(i,m)))*>)_)_) A34: (p +* (i,m)) /. i = (p +* (i,m)) . i by A3, A32, PARTFUN1:def_6 .= m by A3, FUNCT_7:31 ; consider F being Function of NAT,(HFuncs NAT) such that A35: primrec (f1,f2,i,(p +* (i,m))) = F . ((p +* (i,m)) /. i) and A36: ( i in dom (p +* (i,m)) & Del ((p +* (i,m)),i) in dom f1 implies F . 0 = ((p +* (i,m)) +* (i,0)) .--> (f1 . (Del ((p +* (i,m)),i))) ) and A37: ( ( not i in dom (p +* (i,m)) or not Del ((p +* (i,m)),i) in dom f1 ) implies F . 0 = {} ) and A38: for M being Element of NAT holds S1[M,F . M,F . (M + 1),p +* (i,m),i,f2] by Def10; A39: G . (p +* (i,(m + 1))) = primrec (f1,f2,i,(p +* (i,(m + 1)))) by A2; consider F1 being Function of NAT,(HFuncs NAT) such that A40: primrec (f1,f2,i,(p +* (i,(m + 1)))) = F1 . ((p +* (i,(m + 1))) /. i) and A41: ( i in dom (p +* (i,(m + 1))) & Del ((p +* (i,(m + 1))),i) in dom f1 implies F1 . 0 = ((p +* (i,(m + 1))) +* (i,0)) .--> (f1 . (Del ((p +* (i,(m + 1))),i))) ) and A42: ( ( not i in dom (p +* (i,(m + 1))) or not Del ((p +* (i,(m + 1))),i) in dom f1 ) implies F1 . 0 = {} ) and A43: for M being Element of NAT holds S1[M,F1 . M,F1 . (M + 1),p +* (i,(m + 1)),i,f2] by Def10; A44: (F1 . (m + 1)) . (p +* (i,m)) = (F1 . m) . (p +* (i,m)) by A3, A41, A42, A43, Lm3; A45: p +* (i,(m + 1)) in {(p +* (i,(m + 1)))} by TARSKI:def_1; then A46: p +* (i,(m + 1)) in dom ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*>))) by FUNCOP_1:13; A47: G . (p +* (i,m)) = primrec (f1,f2,i,(p +* (i,m))) by A2; A48: (p +* (i,(m + 1))) /. i = (p +* (i,(m + 1))) . i by A3, A29, PARTFUN1:def_6 .= m + 1 by A3, FUNCT_7:31 ; A49: F1 . m = F . m by A41, A42, A43, A36, A37, A38, Lm2; A50: not p +* (i,(m + 1)) in dom (F1 . m) by A3, A41, A42, A43, Lm3; thus A51: ( p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) iff ( p +* (i,m) in dom (G . (p +* (i,m))) & (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ) ::_thesis: ( p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) implies (G . (p +* (i,(m + 1)))) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*>) ) proof hereby ::_thesis: ( p +* (i,m) in dom (G . (p +* (i,m))) & (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) ) assume A52: p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) ; ::_thesis: ( p +* (i,m) in dom (G . (p +* (i,m))) & (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) then A53: p +* (i,(m + 1)) in dom (F1 . (m + 1)) by A2, A40, A48; assume A54: ( not p +* (i,m) in dom (G . (p +* (i,m))) or not (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) ; ::_thesis: contradiction percases ( not p +* (i,m) in dom (G . (p +* (i,m))) or not (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ) by A54; suppose not p +* (i,m) in dom (G . (p +* (i,m))) ; ::_thesis: contradiction then not p +* (i,m) in dom (F1 . m) by A2, A35, A34, A49; hence contradiction by A31, A43, A50, A53; ::_thesis: verum end; suppose not (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ; ::_thesis: contradiction hence contradiction by A31, A39, A40, A43, A48, A44, A50, A52; ::_thesis: verum end; end; end; assume that A55: p +* (i,m) in dom (G . (p +* (i,m))) and A56: (p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*> in dom f2 ; ::_thesis: p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) p +* (i,(m + 1)) in {(p +* (i,(m + 1)))} by TARSKI:def_1; then p +* (i,(m + 1)) in dom ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*>))) by FUNCOP_1:13; then A57: p +* (i,(m + 1)) in (dom (F1 . m)) \/ (dom ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*>)))) by XBOOLE_0:def_3; F1 . (m + 1) = (F1 . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*>))) by A3, A29, A31, A30, A39, A47, A40, A43, A35, A48, A34, A49, A44, A55, A56; hence p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) by A39, A40, A48, A57, FUNCT_4:def_1; ::_thesis: verum end; assume A58: p +* (i,(m + 1)) in dom (G . (p +* (i,(m + 1)))) ; ::_thesis: (G . (p +* (i,(m + 1)))) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*>) then (p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*> in dom f2 by A31, A39, A40, A43, A48, A51; then F1 . (m + 1) = (F1 . m) +* ((p +* (i,(m + 1))) .--> (f2 . ((p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*>))) by A3, A29, A31, A30, A47, A43, A35, A34, A49, A51, A58; hence (G . (p +* (i,(m + 1)))) . (p +* (i,(m + 1))) = ({(p +* (i,(m + 1)))} --> (f2 . ((p +* (i,m)) ^ <*((F1 . m) . (p +* (i,m)))*>))) . (p +* (i,(m + 1))) by A39, A40, A48, A46, FUNCT_4:13 .= f2 . ((p +* (i,m)) ^ <*((G . (p +* (i,(m + 1)))) . ((p +* (i,(m + 1))) +* (i,m)))*>) by A31, A39, A40, A48, A44, A45, FUNCOP_1:7 ; ::_thesis: verum end; thus ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) iff ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) ::_thesis: ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) proof hereby ::_thesis: ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) assume A59: p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ; ::_thesis: ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) G . (p +* (i,m)) in rng G by A24, FUNCT_1:def_3; then dom (G . (p +* (i,m))) in { (dom f) where f is Element of rngG : verum } ; then p +* (i,m) in union { (dom f) where f is Element of rngG : verum } by A4, A33, A59, TARSKI:def_4; hence p +* (i,m) in dom (primrec (f1,f2,i)) by A1, Th12; ::_thesis: (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 A60: G . (p +* (i,(m + 1))) in rng G by A24, FUNCT_1:def_3; dom (G . (p +* (i,m))) c= dom (G . (p +* (i,(m + 1)))) by A3, A2, Lm4; then (union rngG) . (p +* (i,m)) = (G . (p +* (i,(m + 1)))) . (p +* (i,m)) by A4, A33, A59, A60, Th13; hence (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 by A1, A4, A33, A59, FUNCT_7:34; ::_thesis: verum end; assume that A61: p +* (i,m) in dom (primrec (f1,f2,i)) and A62: (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ; ::_thesis: p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) A63: G . (p +* (i,(m + 1))) in rng G by A24, FUNCT_1:def_3; G . (p +* (i,(m + 1))) in rng G by A24, FUNCT_1:def_3; then A64: dom (G . (p +* (i,(m + 1)))) in { (dom f) where f is Element of rngG : verum } ; A65: dom (G . (p +* (i,m))) c= dom (G . (p +* (i,(m + 1)))) by A3, A2, Lm4; p +* (i,m) in dom (G . (p +* (i,m))) by A4, A61; then p +* (i,(m + 1)) in union { (dom f) where f is Element of rngG : verum } by A1, A31, A33, A62, A64, A63, A65, Th13, TARSKI:def_4; hence p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) by A1, Th12; ::_thesis: verum end; assume A66: p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ; ::_thesis: (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) A67: dom (G . (p +* (i,m))) c= dom (G . (p +* (i,(m + 1)))) by A3, A2, Lm4; then A68: (union rngG) . (p +* (i,(m + 1))) = (G . (p +* (i,(m + 1)))) . (p +* (i,(m + 1))) by A4, A66, A25, Th13; (union rngG) . (p +* (i,m)) = (G . (p +* (i,(m + 1)))) . (p +* (i,m)) by A4, A33, A66, A25, A67, Th13; hence (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) by A1, A4, A33, A66, A68, FUNCT_7:34; ::_thesis: verum end; theorem :: COMPUT_1:58 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p holds ( p +* (i,0) in dom (primrec (f1,f2,i)) iff Del (p,i) in dom f1 ) by Lm6; theorem :: COMPUT_1:59 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p & p +* (i,0) in dom (primrec (f1,f2,i)) holds (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) by Lm6; theorem Th60: :: COMPUT_1:60 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p & f1 is len-total holds (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p & f1 is len-total holds (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p & f1 is len-total holds (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: ( i in dom p & f1 is len-total implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) assume that A1: i in dom p and A2: f1 is len-total ; ::_thesis: (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) A3: Del (p,i) is FinSequence of NAT by FINSEQ_3:105; len p = (arity f1) + 1 by CARD_1:def_7; then len (Del (p,i)) = arity f1 by A1, FINSEQ_3:109; then A4: Del (p,i) is Element of (arity f1) -tuples_on NAT by A3, FINSEQ_2:92; dom f1 = (arity f1) -tuples_on NAT by A2, Th23; then p +* (i,0) in dom (primrec (f1,f2,i)) by A1, A4, Lm6; hence (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) by A1, Lm6; ::_thesis: verum end; theorem :: COMPUT_1:61 for i, m being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p holds ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) iff ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) by Lm6; theorem :: COMPUT_1:62 for i, m being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st i in dom p & p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) holds (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) by Lm6; theorem Th63: :: COMPUT_1:63 for i, m being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) proof let i, m be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function for p being Element of ((arity f1) + 1) -tuples_on NAT st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: for p being Element of ((arity f1) + 1) -tuples_on NAT st f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) holds (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: ( f1 is len-total & f2 is len-total & (arity f1) + 2 = arity f2 & 1 <= i & i <= 1 + (arity f1) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) assume that A1: f1 is len-total and A2: f2 is len-total and A3: (arity f1) + 2 = arity f2 and A4: 1 <= i and A5: i <= 1 + (arity f1) ; ::_thesis: (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) len p = (arity f1) + 1 by CARD_1:def_7; then A6: i in dom p by A4, A5, FINSEQ_3:25; p +* (i,(m + 1)) in ((arity f1) + 1) -tuples_on NAT ; then p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) by A1, A2, A3, A4, A5, Th57; hence (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) by A6, Lm6; ::_thesis: verum end; theorem Th64: :: COMPUT_1:64 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st (arity f1) + 2 = arity f2 & 1 <= i & i <= (arity f1) + 1 holds primrec (f1,f2,i) is_primitive-recursively_expressed_by f1,f2,i proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st (arity f1) + 2 = arity f2 & 1 <= i & i <= (arity f1) + 1 holds primrec (f1,f2,i) is_primitive-recursively_expressed_by f1,f2,i let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: ( (arity f1) + 2 = arity f2 & 1 <= i & i <= (arity f1) + 1 implies primrec (f1,f2,i) is_primitive-recursively_expressed_by f1,f2,i ) assume that A1: (arity f1) + 2 = arity f2 and A2: 1 <= i and A3: i <= (arity f1) + 1 ; ::_thesis: primrec (f1,f2,i) is_primitive-recursively_expressed_by f1,f2,i take n = (arity f1) + 1; :: according to COMPUT_1:def_9 ::_thesis: ( dom (primrec (f1,f2,i)) c= n -tuples_on NAT & i >= 1 & i <= n & (arity f1) + 1 = n & n + 1 = arity f2 & ( for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) ) ) set g = primrec (f1,f2,i); thus dom (primrec (f1,f2,i)) c= n -tuples_on NAT by Th56; ::_thesis: ( i >= 1 & i <= n & (arity f1) + 1 = n & n + 1 = arity f2 & ( for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) ) ) thus ( i >= 1 & i <= n ) by A2, A3; ::_thesis: ( (arity f1) + 1 = n & n + 1 = arity f2 & ( for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) ) ) thus (arity f1) + 1 = n ; ::_thesis: ( n + 1 = arity f2 & ( for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) ) ) thus n + 1 = arity f2 by A1; ::_thesis: for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) let p be FinSequence of NAT ; ::_thesis: ( len p = n implies ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) ) assume A4: len p = n ; ::_thesis: ( ( p +* (i,0) in dom (primrec (f1,f2,i)) implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom (primrec (f1,f2,i)) ) & ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) ) ) then A5: i in dom p by A2, A3, FINSEQ_3:25; A6: p is Element of n -tuples_on NAT by A4, FINSEQ_2:92; hence ( p +* (i,0) in dom (primrec (f1,f2,i)) iff Del (p,i) in dom f1 ) by A5, Lm6; ::_thesis: ( p +* (i,0) in dom (primrec (f1,f2,i)) iff (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) thus ( p +* (i,0) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) by A6, A5, Lm6; ::_thesis: for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom (primrec (f1,f2,i)) & (p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(n + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*((primrec (f1,f2,i)) . (p +* (i,n)))*>) ) ) let m be Element of NAT ; ::_thesis: ( ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) & ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 implies p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) & ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) ) thus ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) iff ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) by A6, A5, Lm6; ::_thesis: ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) thus ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) implies (primrec (f1,f2,i)) . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*>) ) by A6, A5, Lm6; ::_thesis: verum end; theorem :: COMPUT_1:65 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st 1 <= i & i <= (arity f1) + 1 holds for g being Element of HFuncs NAT st g is_primitive-recursively_expressed_by f1,f2,i holds g = primrec (f1,f2,i) proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st 1 <= i & i <= (arity f1) + 1 holds for g being Element of HFuncs NAT st g is_primitive-recursively_expressed_by f1,f2,i holds g = primrec (f1,f2,i) let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: ( 1 <= i & i <= (arity f1) + 1 implies for g being Element of HFuncs NAT st g is_primitive-recursively_expressed_by f1,f2,i holds g = primrec (f1,f2,i) ) assume that A1: i >= 1 and A2: i <= (arity f1) + 1 ; ::_thesis: for g being Element of HFuncs NAT st g is_primitive-recursively_expressed_by f1,f2,i holds g = primrec (f1,f2,i) let g be Element of HFuncs NAT; ::_thesis: ( g is_primitive-recursively_expressed_by f1,f2,i implies g = primrec (f1,f2,i) ) set n = (arity f1) + 1; set h = primrec (f1,f2,i); given n9 being Element of NAT such that A3: dom g c= n9 -tuples_on NAT and i >= 1 and i <= n9 and A4: (arity f1) + 1 = n9 and n9 + 1 = arity f2 and A5: for p being FinSequence of NAT st len p = n9 holds ( ( p +* (i,0) in dom g implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom g ) & ( p +* (i,0) in dom g implies g . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom g implies ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom g ) & ( p +* (i,(n + 1)) in dom g implies g . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*(g . (p +* (i,n)))*>) ) ) ) ) ; :: according to COMPUT_1:def_9 ::_thesis: g = primrec (f1,f2,i) A6: now__::_thesis:_for_p_being_Element_of_((arity_f1)_+_1)_-tuples_on_NAT_holds_ (_(_p_in_dom_g_implies_p_in_dom_(primrec_(f1,f2,i))_)_&_(_p_in_dom_(primrec_(f1,f2,i))_implies_p_in_dom_g_)_&_(_p_in_dom_g_implies_g_._p_=_(primrec_(f1,f2,i))_._p_)_) let p be Element of ((arity f1) + 1) -tuples_on NAT; ::_thesis: ( ( p in dom g implies p in dom (primrec (f1,f2,i)) ) & ( p in dom (primrec (f1,f2,i)) implies p in dom g ) & ( p in dom g implies g . p = (primrec (f1,f2,i)) . p ) ) defpred S2[ Element of NAT ] means ( ( p +* (i,$1) in dom g implies p +* (i,$1) in dom (primrec (f1,f2,i)) ) & ( p +* (i,$1) in dom (primrec (f1,f2,i)) implies p +* (i,$1) in dom g ) & ( p +* (i,$1) in dom g implies g . (p +* (i,$1)) = (primrec (f1,f2,i)) . (p +* (i,$1)) ) ); set k = p /. i; A7: p = p +* (i,(p /. i)) by FUNCT_7:38; A8: len p = (arity f1) + 1 by CARD_1:def_7; then A9: i in dom p by A1, A2, FINSEQ_3:25; A10: for m being Element of NAT st S2[m] holds S2[m + 1] proof let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume that A11: ( p +* (i,m) in dom g iff p +* (i,m) in dom (primrec (f1,f2,i)) ) and A12: ( p +* (i,m) in dom g implies g . (p +* (i,m)) = (primrec (f1,f2,i)) . (p +* (i,m)) ) ; ::_thesis: S2[m + 1] ( p +* (i,(m + 1)) in dom g iff ( p +* (i,m) in dom g & (p +* (i,m)) ^ <*(g . (p +* (i,m)))*> in dom f2 ) ) by A4, A5, A8; hence ( p +* (i,(m + 1)) in dom g iff p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) ) by A9, A11, A12, Lm6; ::_thesis: ( p +* (i,(m + 1)) in dom g implies g . (p +* (i,(m + 1))) = (primrec (f1,f2,i)) . (p +* (i,(m + 1))) ) A13: ( p +* (i,(m + 1)) in dom (primrec (f1,f2,i)) iff ( p +* (i,m) in dom (primrec (f1,f2,i)) & (p +* (i,m)) ^ <*((primrec (f1,f2,i)) . (p +* (i,m)))*> in dom f2 ) ) by A9, Lm6; assume A14: p +* (i,(m + 1)) in dom g ; ::_thesis: g . (p +* (i,(m + 1))) = (primrec (f1,f2,i)) . (p +* (i,(m + 1))) then g . (p +* (i,(m + 1))) = f2 . ((p +* (i,m)) ^ <*(g . (p +* (i,m)))*>) by A4, A5, A8; hence g . (p +* (i,(m + 1))) = (primrec (f1,f2,i)) . (p +* (i,(m + 1))) by A4, A5, A8, A9, A11, A12, A13, A14, Lm6; ::_thesis: verum end; A15: ( p +* (i,0) in dom (primrec (f1,f2,i)) iff Del (p,i) in dom f1 ) by A9, Lm6; then ( p +* (i,0) in dom g implies ( g . (p +* (i,0)) = f1 . (Del (p,i)) & (primrec (f1,f2,i)) . (p +* (i,0)) = f1 . (Del (p,i)) ) ) by A4, A5, A8, A9, Lm6; then A16: S2[ 0 ] by A4, A5, A8, A15; for m being Element of NAT holds S2[m] from NAT_1:sch_1(A16, A10); hence ( ( p in dom g implies p in dom (primrec (f1,f2,i)) ) & ( p in dom (primrec (f1,f2,i)) implies p in dom g ) & ( p in dom g implies g . p = (primrec (f1,f2,i)) . p ) ) by A7; ::_thesis: verum end; A17: dom (primrec (f1,f2,i)) c= ((arity f1) + 1) -tuples_on NAT by Th56; then A18: dom g = dom (primrec (f1,f2,i)) by A3, A4, A6, SUBSET_1:3; for x being set st x in dom (primrec (f1,f2,i)) holds g . x = (primrec (f1,f2,i)) . x by A17, A6; hence g = primrec (f1,f2,i) by A18, FUNCT_1:2; ::_thesis: verum end; begin definition let X be set ; attrX is composition_closed means :Def12: :: COMPUT_1:def 12 for f being Element of HFuncs NAT for F being with_the_same_arity FinSequence of HFuncs NAT st f in X & arity f = len F & rng F c= X holds f * <:F:> in X; attrX is primitive-recursion_closed means :Def13: :: COMPUT_1:def 13 for g, f1, f2 being Element of HFuncs NAT for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i & f1 in X & f2 in X holds g in X; end; :: deftheorem Def12 defines composition_closed COMPUT_1:def_12_:_ for X being set holds ( X is composition_closed iff for f being Element of HFuncs NAT for F being with_the_same_arity FinSequence of HFuncs NAT st f in X & arity f = len F & rng F c= X holds f * <:F:> in X ); :: deftheorem Def13 defines primitive-recursion_closed COMPUT_1:def_13_:_ for X being set holds ( X is primitive-recursion_closed iff for g, f1, f2 being Element of HFuncs NAT for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i & f1 in X & f2 in X holds g in X ); definition let X be set ; attrX is primitive-recursively_closed means :Def14: :: COMPUT_1:def 14 ( 0 const 0 in X & 1 succ 1 in X & ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in X ) & X is composition_closed & X is primitive-recursion_closed ); end; :: deftheorem Def14 defines primitive-recursively_closed COMPUT_1:def_14_:_ for X being set holds ( X is primitive-recursively_closed iff ( 0 const 0 in X & 1 succ 1 in X & ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in X ) & X is composition_closed & X is primitive-recursion_closed ) ); theorem Th66: :: COMPUT_1:66 HFuncs NAT is primitive-recursively_closed proof set X = HFuncs NAT; thus ( 0 const 0 in HFuncs NAT & 1 succ 1 in HFuncs NAT & ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in HFuncs NAT ) ) by Th31, Th33, Th35; :: according to COMPUT_1:def_14 ::_thesis: ( HFuncs NAT is composition_closed & HFuncs NAT is primitive-recursion_closed ) thus for f being Element of HFuncs NAT for F being with_the_same_arity FinSequence of HFuncs NAT st f in HFuncs NAT & arity f = len F & rng F c= HFuncs NAT holds f * <:F:> in HFuncs NAT by Th42; :: according to COMPUT_1:def_12 ::_thesis: HFuncs NAT is primitive-recursion_closed let g be Element of HFuncs NAT; :: according to COMPUT_1:def_13 ::_thesis: for f1, f2 being Element of HFuncs NAT for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i & f1 in HFuncs NAT & f2 in HFuncs NAT holds g in HFuncs NAT thus for f1, f2 being Element of HFuncs NAT for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i & f1 in HFuncs NAT & f2 in HFuncs NAT holds g in HFuncs NAT ; ::_thesis: verum end; registration cluster non empty functional primitive-recursively_closed for Element of K32((HFuncs NAT)); existence ex b1 being Subset of (HFuncs NAT) st ( b1 is primitive-recursively_closed & not b1 is empty ) proof HFuncs NAT c= HFuncs NAT ; then reconsider X = HFuncs NAT as non empty Subset of (HFuncs NAT) ; take X ; ::_thesis: ( X is primitive-recursively_closed & not X is empty ) thus ( X is primitive-recursively_closed & not X is empty ) by Th66; ::_thesis: verum end; end; Lm7: for X being non empty set for n, i being Element of NAT st 1 <= i & i <= n holds for x being Element of X for p being Element of n -tuples_on X holds p +* (i,x) in n -tuples_on X ; theorem Th67: :: COMPUT_1:67 for i being Element of NAT for e1, e2 being NAT * -defined to-naturals homogeneous Function for g being Element of HFuncs NAT st e1 = {} & g is_primitive-recursively_expressed_by e1,e2,i holds g = {} proof let i be Element of NAT ; ::_thesis: for e1, e2 being NAT * -defined to-naturals homogeneous Function for g being Element of HFuncs NAT st e1 = {} & g is_primitive-recursively_expressed_by e1,e2,i holds g = {} let e1, e2 be NAT * -defined to-naturals homogeneous Function; ::_thesis: for g being Element of HFuncs NAT st e1 = {} & g is_primitive-recursively_expressed_by e1,e2,i holds g = {} set f1 = e1; set f2 = e2; let g be Element of HFuncs NAT; ::_thesis: ( e1 = {} & g is_primitive-recursively_expressed_by e1,e2,i implies g = {} ) assume A1: e1 = {} ; ::_thesis: ( not g is_primitive-recursively_expressed_by e1,e2,i or g = {} ) assume g is_primitive-recursively_expressed_by e1,e2,i ; ::_thesis: g = {} then consider n being Element of NAT such that A2: dom g c= n -tuples_on NAT and i >= 1 and i <= n and (arity e1) + 1 = n and n + 1 = arity e2 and A3: for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom g implies Del (p,i) in dom e1 ) & ( Del (p,i) in dom e1 implies p +* (i,0) in dom g ) & ( p +* (i,0) in dom g implies g . (p +* (i,0)) = e1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom g implies ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom e2 ) ) & ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom e2 implies p +* (i,(n + 1)) in dom g ) & ( p +* (i,(n + 1)) in dom g implies g . (p +* (i,(n + 1))) = e2 . ((p +* (i,n)) ^ <*(g . (p +* (i,n)))*>) ) ) ) ) by Def9; A4: now__::_thesis:_for_y_being_Element_of_n_-tuples_on_NAT for_k_being_Element_of_NAT_holds_S2[k] let y be Element of n -tuples_on NAT; ::_thesis: for k being Element of NAT holds S2[k] defpred S2[ Element of NAT ] means not y +* (i,$1) in dom g; A5: len y = n by CARD_1:def_7; then A6: for k being Element of NAT st S2[k] holds S2[k + 1] by A3; A7: S2[ 0 ] by A1, A3, A5; thus for k being Element of NAT holds S2[k] from NAT_1:sch_1(A7, A6); ::_thesis: verum end; assume g <> {} ; ::_thesis: contradiction then consider x being set such that A8: x in dom g by XBOOLE_0:def_1; reconsider x = x as Element of n -tuples_on NAT by A2, A8; set xi = x . i; x = x +* (i,(x . i)) by FUNCT_7:35; hence contradiction by A4, A8; ::_thesis: verum end; theorem Th68: :: COMPUT_1:68 for g being Element of HFuncs NAT for f1, f2 being quasi_total Element of HFuncs NAT for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i holds ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) proof let g be Element of HFuncs NAT; ::_thesis: for f1, f2 being quasi_total Element of HFuncs NAT for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i holds ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) let f1, f2 be quasi_total Element of HFuncs NAT; ::_thesis: for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i holds ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) let i be Element of NAT ; ::_thesis: ( g is_primitive-recursively_expressed_by f1,f2,i implies ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) ) assume A1: g is_primitive-recursively_expressed_by f1,f2,i ; ::_thesis: ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) then consider n being Element of NAT such that A2: dom g c= n -tuples_on NAT and A3: i >= 1 and A4: i <= n and A5: (arity f1) + 1 = n and A6: n + 1 = arity f2 and A7: for p being FinSequence of NAT st len p = n holds ( ( p +* (i,0) in dom g implies Del (p,i) in dom f1 ) & ( Del (p,i) in dom f1 implies p +* (i,0) in dom g ) & ( p +* (i,0) in dom g implies g . (p +* (i,0)) = f1 . (Del (p,i)) ) & ( for n being Element of NAT holds ( ( p +* (i,(n + 1)) in dom g implies ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 ) ) & ( p +* (i,n) in dom g & (p +* (i,n)) ^ <*(g . (p +* (i,n)))*> in dom f2 implies p +* (i,(n + 1)) in dom g ) & ( p +* (i,(n + 1)) in dom g implies g . (p +* (i,(n + 1))) = f2 . ((p +* (i,n)) ^ <*(g . (p +* (i,n)))*>) ) ) ) ) by Def9; reconsider f29 = f2 as non empty quasi_total Element of HFuncs NAT by A6, Th18; percases ( f1 is empty or not f1 is empty ) ; suppose f1 is empty ; ::_thesis: ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) hence ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) by A1, Th67; ::_thesis: verum end; suppose not f1 is empty ; ::_thesis: ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) then A8: dom f1 = (arity f1) -tuples_on NAT by Th22; A9: g is quasi_total proof let x, y be FinSequence of NAT ; :: according to MARGREL1:def_22 ::_thesis: ( not len x = len y or not x in dom g or y in dom g ) assume that A10: len x = len y and A11: x in dom g ; ::_thesis: y in dom g defpred S2[ Element of NAT ] means y +* (i,$1) in dom g; A12: len x = n by A2, A11, CARD_1:def_7; A13: 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 A14: S2[k] ; ::_thesis: S2[k + 1] A15: dom f29 = (arity f2) -tuples_on NAT by Th22; len ((y +* (i,k)) ^ <*(g . (y +* (i,k)))*>) = (len (y +* (i,k))) + (len <*(g . (y +* (i,k)))*>) by FINSEQ_1:22 .= n + (len <*(g . (y +* (i,k)))*>) by A10, A12, FUNCT_7:97 .= n + 1 by FINSEQ_1:39 ; then (y +* (i,k)) ^ <*(g . (y +* (i,k)))*> is Element of dom f2 by A6, A15, FINSEQ_2:92; then (y +* (i,k)) ^ <*(g . (y +* (i,k)))*> in dom f29 ; hence S2[k + 1] by A7, A10, A12, A14; ::_thesis: verum end; y is Element of (len y) -tuples_on NAT by FINSEQ_2:92; then Del (y,i) in (arity f1) -tuples_on NAT by A3, A4, A5, A10, A12, Th9; then A16: S2[ 0 ] by A7, A8, A10, A12; for k being Element of NAT holds S2[k] from NAT_1:sch_1(A16, A13); then A17: y +* (i,(y /. i)) in dom g ; i in dom y by A3, A4, A10, A12, FINSEQ_3:25; then y . i = y /. i by PARTFUN1:def_6; hence y in dom g by A17, FUNCT_7:35; ::_thesis: verum end; consider pp being set such that A18: pp in n -tuples_on NAT by XBOOLE_0:def_1; pp is Element of n -tuples_on NAT by A18; then reconsider p = pp as FinSequence of NAT ; A19: len p = n by A18, CARD_1:def_7; Del (p,i) in (arity f1) -tuples_on NAT by A3, A4, A5, A18, Th9; hence ( g is quasi_total & ( not f1 is empty implies not g is empty ) ) by A7, A19, A8, A9; ::_thesis: verum end; end; end; theorem Th69: :: COMPUT_1:69 for n, c being Element of NAT for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) holds n const c in P proof let n, c be Element of NAT ; ::_thesis: for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) holds n const c in P let P be non empty primitive-recursively_closed Subset of (HFuncs NAT); ::_thesis: n const c in P defpred S2[ Element of NAT ] means 0 const $1 in P; defpred S3[ Element of NAT ] means for c being Element of NAT holds $1 const c in P; A1: P is composition_closed by Def14; A2: for i being Element of NAT st S2[i] holds S2[i + 1] proof reconsider 1succ1 = 1 succ 1 as quasi_total Element of HFuncs NAT by Th29; let i be Element of NAT ; ::_thesis: ( S2[i] implies S2[i + 1] ) A3: 1 succ 1 in P by Def14; A4: <*> NAT is Element of 0 -tuples_on NAT by FINSEQ_2:131; then A5: (0 const i) . {} = i by FUNCOP_1:7; reconsider 0consti = 0 const i as Element of HFuncs NAT by Th28; set F = <*(0 const i)*>; <*0consti*> is FinSequence of HFuncs NAT ; then reconsider F = <*(0 const i)*> as with_the_same_arity FinSequence of HFuncs NAT ; assume 0 const i in P ; ::_thesis: S2[i + 1] then A6: {(0 const i)} c= P by ZFMISC_1:31; A7: arity (1 succ 1) = 1 by Th34 .= len F by FINSEQ_1:39 ; A8: rng F = {(0 const i)} by FINSEQ_1:39; now__::_thesis:_for_h_being_Element_of_HFuncs_NAT_st_h_in_rng_F_holds_ h_is_quasi_total let h be Element of HFuncs NAT; ::_thesis: ( h in rng F implies h is quasi_total ) assume h in rng F ; ::_thesis: h is quasi_total then h = 0 const i by A8, TARSKI:def_1; hence h is quasi_total by Th29; ::_thesis: verum end; then reconsider g = 1succ1 * <:F:> as quasi_total Element of HFuncs NAT by A7, Th46; A9: arity (0 const (i + 1)) = 0 by Th32; A10: (0 const (i + 1)) . {} = i + 1 by A4, FUNCOP_1:7; A11: dom (1 succ 1) = 1 -tuples_on NAT by Def7; A12: arity (0 const i) = 0 by Th32; then A13: dom (0 const i) = 0 -tuples_on NAT by Th23; then A14: <:F:> . {} = <*i*> by A4, A5, FINSEQ_3:141; reconsider ii = <*i*> as Element of 1 -tuples_on NAT by FINSEQ_2:131; A15: dom <:<*(0 const i)*>:> = dom (0 const i) by FINSEQ_3:141; then g . {} = (1 succ 1) . (<:F:> . {}) by A4, A13, FUNCT_1:13; then A16: g . {} = (ii /. 1) + 1 by A14, Def7 .= i + 1 by FINSEQ_4:16 ; A17: dom (0 const i) = 0 -tuples_on NAT by A12, Th23; then <:<*(0 const i)*>:> . {} = ii by A4, A5, FINSEQ_3:141; then A18: {} in dom g by A4, A15, A17, A11, FUNCT_1:11; 0 const i in rng F by A8, TARSKI:def_1; then arity F = 0 by A12, Def4; then arity g = 0 by A18, Th44, RELAT_1:38; then 0 const (i + 1) = (1 succ 1) * <:<*(0 const i)*>:> by A9, A10, A18, A16, Th48, RELAT_1:38; hence S2[i + 1] by A1, A6, A8, A3, A7, Def12; ::_thesis: verum end; A19: P is primitive-recursion_closed by Def14; A20: now__::_thesis:_for_n_being_Element_of_NAT_st_S3[n]_holds_ S3[n_+_1] let n be Element of NAT ; ::_thesis: ( S3[n] implies S3[n + 1] ) assume A21: S3[n] ; ::_thesis: S3[n + 1] thus S3[n + 1] ::_thesis: verum proof let i be Element of NAT ; ::_thesis: (n + 1) const i in P set g = (n + 1) const i; set f1 = n const i; set j = n + 1; set f2 = (n + 2) proj (n + 2); A22: dom ((n + 1) const i) = (n + 1) -tuples_on NAT by FUNCOP_1:13; A23: n + (1 + 1) = (n + 1) + 1 ; then 1 <= n + 2 by NAT_1:11; then A24: (n + 2) proj (n + 2) in P by Def14; A25: arity ((n + 2) proj (n + 2)) = n + 2 by Th37; A26: dom ((n + 2) proj (n + 2)) = (n + 2) -tuples_on NAT by Th36; A27: arity (n const i) = n by Th32; A28: dom (n const i) = n -tuples_on NAT by FUNCOP_1:13; A29: arity ((n + 1) const i) = n + 1 by Th32; A30: (n + 1) const i is_primitive-recursively_expressed_by n const i,(n + 2) proj (n + 2),n + 1 proof take m = arity ((n + 1) const i); :: according to COMPUT_1:def_9 ::_thesis: ( dom ((n + 1) const i) c= m -tuples_on NAT & n + 1 >= 1 & n + 1 <= m & (arity (n const i)) + 1 = m & m + 1 = arity ((n + 2) proj (n + 2)) & ( for p being FinSequence of NAT st len p = m holds ( ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) & ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) ) ) thus dom ((n + 1) const i) c= m -tuples_on NAT by Th21; ::_thesis: ( n + 1 >= 1 & n + 1 <= m & (arity (n const i)) + 1 = m & m + 1 = arity ((n + 2) proj (n + 2)) & ( for p being FinSequence of NAT st len p = m holds ( ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) & ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) ) ) thus ( n + 1 >= 1 & n + 1 <= m ) by Th32, NAT_1:11; ::_thesis: ( (arity (n const i)) + 1 = m & m + 1 = arity ((n + 2) proj (n + 2)) & ( for p being FinSequence of NAT st len p = m holds ( ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) & ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) ) ) thus ( (arity (n const i)) + 1 = m & m + 1 = arity ((n + 2) proj (n + 2)) ) by A27, A25, A23, Th32; ::_thesis: for p being FinSequence of NAT st len p = m holds ( ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) & ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) let p be FinSequence of NAT ; ::_thesis: ( len p = m implies ( ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) & ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) ) assume len p = m ; ::_thesis: ( ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) & ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) then A31: p is Element of (n + 1) -tuples_on NAT by A29, FINSEQ_2:92; A32: n + 1 >= 1 by NAT_1:11; hence ( p +* ((n + 1),0) in dom ((n + 1) const i) implies Del (p,(n + 1)) in dom (n const i) ) by A28, A31, Th9; ::_thesis: ( ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) & ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) & ( for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) ) ) thus ( Del (p,(n + 1)) in dom (n const i) implies p +* ((n + 1),0) in dom ((n + 1) const i) ) by A22, A31, A32, Lm7; ::_thesis: ( p +* ((n + 1),0) in dom ((n + 1) const i) iff ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) (n const i) . (Del (p,(n + 1))) = i by A31, A32, Th9, FUNCOP_1:7; hence ( p +* ((n + 1),0) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),0)) = (n const i) . (Del (p,(n + 1))) ) by A31, A32, Lm7, FUNCOP_1:7; ::_thesis: for n being Element of NAT holds ( ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),n) in dom ((n + 1) const i) & (p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(n + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(n + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),n)) ^ <*(((n + 1) const i) . (p +* ((n + 1),n)))*>) ) ) let m be Element of NAT ; ::_thesis: ( ( p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) implies ( p +* ((n + 1),m) in dom ((n + 1) const i) & (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) ) ) & ( p +* ((n + 1),m) in dom ((n + 1) const i) & (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) ) & ( p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(m + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*>) ) ) A33: p +* ((n + 1),m) in (n + 1) -tuples_on NAT by A31, A32, Lm7; then A34: (p +* ((n + 1),m)) ^ <*i*> is Tuple of n + 2, NAT by A23, FINSEQ_2:107; then A35: (p +* ((n + 1),m)) ^ <*i*> is Element of (n + 2) -tuples_on NAT by FINSEQ_2:131; hereby ::_thesis: ( p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) implies ((n + 1) const i) . (p +* ((n + 1),(m + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*>) ) hereby ::_thesis: ( p +* ((n + 1),m) in dom ((n + 1) const i) & (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) ) assume p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) ; ::_thesis: ( p +* ((n + 1),m) in dom ((n + 1) const i) & (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) ) thus p +* ((n + 1),m) in dom ((n + 1) const i) by A22, A31, A32, Lm7; ::_thesis: (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) ((n + 1) const i) . (p +* ((n + 1),m)) = i by A31, A32, Lm7, FUNCOP_1:7; hence (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) by A26, A34, FINSEQ_2:131; ::_thesis: verum end; thus ( p +* ((n + 1),m) in dom ((n + 1) const i) & (p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*> in dom ((n + 2) proj (n + 2)) implies p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) ) by A22, A31, A32, Lm7; ::_thesis: verum end; assume p +* ((n + 1),(m + 1)) in dom ((n + 1) const i) ; ::_thesis: ((n + 1) const i) . (p +* ((n + 1),(m + 1))) = ((n + 2) proj (n + 2)) . ((p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*>) len (p +* ((n + 1),m)) = n + 1 by A33, CARD_1:def_7; then A36: ((p +* ((n + 1),m)) ^ <*i*>) . ((n + 1) + 1) = i by FINSEQ_1:42; thus ((n + 1) const i) . (p +* ((n + 1),(m + 1))) = i by A31, A32, Lm7, FUNCOP_1:7 .= ((n + 2) proj (n + 2)) . ((p +* ((n + 1),m)) ^ <*i*>) by A36, A35, Th38 .= ((n + 2) proj (n + 2)) . ((p +* ((n + 1),m)) ^ <*(((n + 1) const i) . (p +* ((n + 1),m)))*>) by A31, A32, Lm7, FUNCOP_1:7 ; ::_thesis: verum end; A37: n const i in P by A21; (n + 1) const i is Element of HFuncs NAT by Th28; hence (n + 1) const i in P by A19, A30, A37, A24, Def13; ::_thesis: verum end; end; A38: S2[ 0 ] by Def14; for i being Element of NAT holds S2[i] from NAT_1:sch_1(A38, A2); then A39: S3[ 0 ] ; for n being Element of NAT holds S3[n] from NAT_1:sch_1(A39, A20); hence n const c in P ; ::_thesis: verum end; theorem Th70: :: COMPUT_1:70 for i, n being Element of NAT for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) st 1 <= i & i <= n holds n succ i in P proof let i, n be Element of NAT ; ::_thesis: for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) st 1 <= i & i <= n holds n succ i in P let P be non empty primitive-recursively_closed Subset of (HFuncs NAT); ::_thesis: ( 1 <= i & i <= n implies n succ i in P ) A1: 1 succ 1 in P by Def14; A2: arity (1 succ 1) = 1 by Th34 .= len <*(n proj i)*> by FINSEQ_1:39 ; reconsider nproji = n proj i as Element of HFuncs NAT by Th28; assume that A3: 1 <= i and A4: i <= n ; ::_thesis: n succ i in P A5: <*nproji*> is with_the_same_arity FinSequence of HFuncs NAT ; now__::_thesis:_(_dom_(n_succ_i)_=_n_-tuples_on_NAT_&_dom_((1_succ_1)_*_<:<*(n_proj_i)*>:>)_=_n_-tuples_on_NAT_&_(_for_x_being_set_st_x_in_n_-tuples_on_NAT_holds_ (n_succ_i)_._x_=_((1_succ_1)_*_<:<*(n_proj_i)*>:>)_._x_)_) rng (n proj i) = NAT by A3, A4, Th36; then A6: rng <:<*(n proj i)*>:> = 1 -tuples_on NAT by Th8; thus dom (n succ i) = n -tuples_on NAT by Def7; ::_thesis: ( dom ((1 succ 1) * <:<*(n proj i)*>:>) = n -tuples_on NAT & ( for x being set st x in n -tuples_on NAT holds (n succ i) . x = ((1 succ 1) * <:<*(n proj i)*>:>) . x ) ) A7: dom (n proj i) = n -tuples_on NAT by Th36; then A8: dom <:<*(n proj i)*>:> = n -tuples_on NAT by FINSEQ_3:141; dom (1 succ 1) = 1 -tuples_on NAT by Def7; hence dom ((1 succ 1) * <:<*(n proj i)*>:>) = n -tuples_on NAT by A8, A6, RELAT_1:27; ::_thesis: for x being set st x in n -tuples_on NAT holds (n succ i) . x = ((1 succ 1) * <:<*(n proj i)*>:>) . x let x be set ; ::_thesis: ( x in n -tuples_on NAT implies (n succ i) . x = ((1 succ 1) * <:<*(n proj i)*>:>) . x ) assume x in n -tuples_on NAT ; ::_thesis: (n succ i) . x = ((1 succ 1) * <:<*(n proj i)*>:>) . x then reconsider x9 = x as Element of n -tuples_on NAT ; set xi = x9 . i; len x9 = n by CARD_1:def_7; then A9: i in dom x9 by A3, A4, FINSEQ_3:25; A10: (n succ i) . x = (x9 /. i) + 1 by Def7 .= (x9 . i) + 1 by A9, PARTFUN1:def_6 ; reconsider ii = <*(x9 . i)*> as Element of 1 -tuples_on NAT by FINSEQ_2:131; ((1 succ 1) * <:<*(n proj i)*>:>) . x9 = (1 succ 1) . (<:<*(n proj i)*>:> . x9) by A8, FUNCT_1:13 .= (1 succ 1) . <*((n proj i) . x9)*> by A7, FINSEQ_3:141 .= (1 succ 1) . <*(x9 . i)*> by Th38 .= (ii /. 1) + 1 by Def7 .= (x9 . i) + 1 by FINSEQ_4:16 ; hence (n succ i) . x = ((1 succ 1) * <:<*(n proj i)*>:>) . x by A10; ::_thesis: verum end; then A11: n succ i = (1 succ 1) * <:<*(n proj i)*>:> by FUNCT_1:2; A12: rng <*(n proj i)*> c= P proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng <*(n proj i)*> or x in P ) assume x in rng <*(n proj i)*> ; ::_thesis: x in P then x in {(n proj i)} by FINSEQ_1:39; then x = n proj i by TARSKI:def_1; hence x in P by A3, A4, Def14; ::_thesis: verum end; P is composition_closed by Def14; hence n succ i in P by A11, A1, A2, A12, A5, Def12; ::_thesis: verum end; theorem Th71: :: COMPUT_1:71 for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) holds {} in P proof let P be non empty primitive-recursively_closed Subset of (HFuncs NAT); ::_thesis: {} in P reconsider F = {} as with_the_same_arity Element of (HFuncs NAT) * by FINSEQ_1:49; set f = 0 const 0; A1: rng {} c= P by XBOOLE_1:2; A2: arity (0 const 0) = 0 by Th32; A3: P is composition_closed by Def14; 0 const 0 in P by Th69; then (0 const 0) * <:F:> in P by A2, A1, A3, Def12, CARD_1:27; hence {} in P by FUNCT_6:40; ::_thesis: verum end; theorem Th72: :: COMPUT_1:72 for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) for f being Element of P for F being with_the_same_arity FinSequence of P st arity f = len F holds f * <:F:> in P proof let P be non empty primitive-recursively_closed Subset of (HFuncs NAT); ::_thesis: for f being Element of P for F being with_the_same_arity FinSequence of P st arity f = len F holds f * <:F:> in P let f be Element of P; ::_thesis: for F being with_the_same_arity FinSequence of P st arity f = len F holds f * <:F:> in P let F be with_the_same_arity FinSequence of P; ::_thesis: ( arity f = len F implies f * <:F:> in P ) assume A1: arity f = len F ; ::_thesis: f * <:F:> in P A2: rng F c= P by FINSEQ_1:def_4; percases ( f is empty or not f is empty ) ; suppose f is empty ; ::_thesis: f * <:F:> in P then f * <:F:> = {} ; hence f * <:F:> in P by Th71; ::_thesis: verum end; suppose not f is empty ; ::_thesis: f * <:F:> in P then reconsider f9 = f as non empty Element of HFuncs NAT ; A3: P * c= (HFuncs NAT) * by FINSEQ_1:62; F in P * by FINSEQ_1:def_11; then reconsider F9 = F as with_the_same_arity Element of (HFuncs NAT) * by A3; P is composition_closed by Def14; then f9 * <:F9:> in P by A1, A2, Def12; hence f * <:F:> in P ; ::_thesis: verum end; end; end; theorem Th73: :: COMPUT_1:73 for P being non empty primitive-recursively_closed Subset of (HFuncs NAT) for f1, f2 being Element of P st (arity f1) + 2 = arity f2 holds for i being Element of NAT st 1 <= i & i <= (arity f1) + 1 holds primrec (f1,f2,i) in P proof let P be non empty primitive-recursively_closed Subset of (HFuncs NAT); ::_thesis: for f1, f2 being Element of P st (arity f1) + 2 = arity f2 holds for i being Element of NAT st 1 <= i & i <= (arity f1) + 1 holds primrec (f1,f2,i) in P let f1, f2 be Element of P; ::_thesis: ( (arity f1) + 2 = arity f2 implies for i being Element of NAT st 1 <= i & i <= (arity f1) + 1 holds primrec (f1,f2,i) in P ) assume A1: (arity f1) + 2 = arity f2 ; ::_thesis: for i being Element of NAT st 1 <= i & i <= (arity f1) + 1 holds primrec (f1,f2,i) in P let i be Element of NAT ; ::_thesis: ( 1 <= i & i <= (arity f1) + 1 implies primrec (f1,f2,i) in P ) assume that A2: 1 <= i and A3: i <= (arity f1) + 1 ; ::_thesis: primrec (f1,f2,i) in P A4: P is primitive-recursion_closed by Def14; percases ( f1 is empty or not f1 is empty ) ; suppose f1 is empty ; ::_thesis: primrec (f1,f2,i) in P then primrec (f1,f2,i) is empty by Th55; hence primrec (f1,f2,i) in P by Th71; ::_thesis: verum end; suppose not f1 is empty ; ::_thesis: primrec (f1,f2,i) in P then primrec (f1,f2,i) is_primitive-recursively_expressed_by f1,f2,i by A1, A2, A3, Th18, Th64; hence primrec (f1,f2,i) in P by A4, Def13; ::_thesis: verum end; end; end; definition func PrimRec -> Subset of (HFuncs NAT) equals :: COMPUT_1:def 15 meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; coherence meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } is Subset of (HFuncs NAT) proof set S = { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; set T = meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; A1: {(HFuncs NAT)} c= bool (HFuncs NAT) by ZFMISC_1:68; HFuncs NAT in {(HFuncs NAT)} by TARSKI:def_1; then A2: HFuncs NAT in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } by A1, Th66; meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } c= HFuncs NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } or x in HFuncs NAT ) assume x in meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; ::_thesis: x in HFuncs NAT hence x in HFuncs NAT by A2, SETFAM_1:def_1; ::_thesis: verum end; hence meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } is Subset of (HFuncs NAT) ; ::_thesis: verum end; end; :: deftheorem defines PrimRec COMPUT_1:def_15_:_ PrimRec = meet { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; theorem Th74: :: COMPUT_1:74 for X being Subset of (HFuncs NAT) st X is primitive-recursively_closed holds PrimRec c= X proof let X be Subset of (HFuncs NAT); ::_thesis: ( X is primitive-recursively_closed implies PrimRec c= X ) set S = { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; assume X is primitive-recursively_closed ; ::_thesis: PrimRec c= X then A1: X in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in PrimRec or x in X ) assume x in PrimRec ; ::_thesis: x in X hence x in X by A1, SETFAM_1:def_1; ::_thesis: verum end; registration cluster PrimRec -> non empty primitive-recursively_closed ; coherence ( not PrimRec is empty & PrimRec is primitive-recursively_closed ) proof set S = { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; A1: {(HFuncs NAT)} c= bool (HFuncs NAT) by ZFMISC_1:68; HFuncs NAT in {(HFuncs NAT)} by TARSKI:def_1; then A2: HFuncs NAT in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } by A1, Th66; A3: now__::_thesis:_for_Y_being_set_st_Y_in__{__R_where_R_is_Subset_of_(HFuncs_NAT)_:_R_is_primitive-recursively_closed__}__holds_ 0_const_0_in_Y let Y be set ; ::_thesis: ( Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } implies 0 const 0 in Y ) assume Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; ::_thesis: 0 const 0 in Y then ex R being Subset of (HFuncs NAT) st ( R = Y & R is primitive-recursively_closed ) ; hence 0 const 0 in Y by Def14; ::_thesis: verum end; hence not PrimRec is empty by A2, SETFAM_1:def_1; ::_thesis: PrimRec is primitive-recursively_closed thus PrimRec is primitive-recursively_closed ::_thesis: verum proof thus 0 const 0 in PrimRec by A2, A3, SETFAM_1:def_1; :: according to COMPUT_1:def_14 ::_thesis: ( 1 succ 1 in PrimRec & ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in PrimRec ) & PrimRec is composition_closed & PrimRec is primitive-recursion_closed ) now__::_thesis:_for_Y_being_set_st_Y_in__{__R_where_R_is_Subset_of_(HFuncs_NAT)_:_R_is_primitive-recursively_closed__}__holds_ 1_succ_1_in_Y let Y be set ; ::_thesis: ( Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } implies 1 succ 1 in Y ) assume Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; ::_thesis: 1 succ 1 in Y then ex R being Subset of (HFuncs NAT) st ( R = Y & R is primitive-recursively_closed ) ; hence 1 succ 1 in Y by Def14; ::_thesis: verum end; hence 1 succ 1 in PrimRec by A2, SETFAM_1:def_1; ::_thesis: ( ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in PrimRec ) & PrimRec is composition_closed & PrimRec is primitive-recursion_closed ) hereby ::_thesis: ( PrimRec is composition_closed & PrimRec is primitive-recursion_closed ) let n, i be Element of NAT ; ::_thesis: ( 1 <= i & i <= n implies n proj i in PrimRec ) assume that A4: 1 <= i and A5: i <= n ; ::_thesis: n proj i in PrimRec now__::_thesis:_for_Y_being_set_st_Y_in__{__R_where_R_is_Subset_of_(HFuncs_NAT)_:_R_is_primitive-recursively_closed__}__holds_ n_proj_i_in_Y let Y be set ; ::_thesis: ( Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } implies n proj i in Y ) assume Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; ::_thesis: n proj i in Y then ex R being Subset of (HFuncs NAT) st ( R = Y & R is primitive-recursively_closed ) ; hence n proj i in Y by A4, A5, Def14; ::_thesis: verum end; hence n proj i in PrimRec by A2, SETFAM_1:def_1; ::_thesis: verum end; hereby :: according to COMPUT_1:def_12 ::_thesis: PrimRec is primitive-recursion_closed let f be Element of HFuncs NAT; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs NAT st f in PrimRec & arity f = len F & rng F c= PrimRec holds f * <:F:> in PrimRec let F be with_the_same_arity FinSequence of HFuncs NAT; ::_thesis: ( f in PrimRec & arity f = len F & rng F c= PrimRec implies f * <:F:> in PrimRec ) assume that A6: f in PrimRec and A7: arity f = len F and A8: rng F c= PrimRec ; ::_thesis: f * <:F:> in PrimRec now__::_thesis:_for_Y_being_set_st_Y_in__{__R_where_R_is_Subset_of_(HFuncs_NAT)_:_R_is_primitive-recursively_closed__}__holds_ f_*_<:F:>_in_Y let Y be set ; ::_thesis: ( Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } implies f * <:F:> in Y ) assume A9: Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; ::_thesis: f * <:F:> in Y then consider R being Subset of (HFuncs NAT) such that A10: R = Y and A11: R is primitive-recursively_closed ; A12: R is composition_closed by A11, Def14; A13: PrimRec c= R by A9, A10, SETFAM_1:3; then rng F c= R by A8, XBOOLE_1:1; hence f * <:F:> in Y by A6, A7, A10, A12, A13, Def12; ::_thesis: verum end; hence f * <:F:> in PrimRec by A2, SETFAM_1:def_1; ::_thesis: verum end; hereby :: according to COMPUT_1:def_13 ::_thesis: verum let g, f1, f2 be Element of HFuncs NAT; ::_thesis: for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i & f1 in PrimRec & f2 in PrimRec holds g in PrimRec let i be Element of NAT ; ::_thesis: ( g is_primitive-recursively_expressed_by f1,f2,i & f1 in PrimRec & f2 in PrimRec implies g in PrimRec ) assume that A14: g is_primitive-recursively_expressed_by f1,f2,i and A15: f1 in PrimRec and A16: f2 in PrimRec ; ::_thesis: g in PrimRec now__::_thesis:_for_Y_being_set_st_Y_in__{__R_where_R_is_Subset_of_(HFuncs_NAT)_:_R_is_primitive-recursively_closed__}__holds_ g_in_Y let Y be set ; ::_thesis: ( Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } implies g in Y ) assume A17: Y in { R where R is Subset of (HFuncs NAT) : R is primitive-recursively_closed } ; ::_thesis: g in Y then consider R being Subset of (HFuncs NAT) such that A18: R = Y and A19: R is primitive-recursively_closed ; A20: f2 in R by A16, A17, A18, SETFAM_1:def_1; A21: R is primitive-recursion_closed by A19, Def14; f1 in R by A15, A17, A18, SETFAM_1:def_1; hence g in Y by A14, A18, A21, A20, Def13; ::_thesis: verum end; hence g in PrimRec by A2, SETFAM_1:def_1; ::_thesis: verum end; end; end; end; registration cluster -> homogeneous for Element of PrimRec ; coherence for b1 being Element of PrimRec holds b1 is homogeneous ; end; definition let x be set ; attrx is primitive-recursive means :Def16: :: COMPUT_1:def 16 x in PrimRec ; end; :: deftheorem Def16 defines primitive-recursive COMPUT_1:def_16_:_ for x being set holds ( x is primitive-recursive iff x in PrimRec ); registration cluster primitive-recursive -> Relation-like Function-like for set ; coherence for b1 being set st b1 is primitive-recursive holds ( b1 is Relation-like & b1 is Function-like ) proof let x be set ; ::_thesis: ( x is primitive-recursive implies ( x is Relation-like & x is Function-like ) ) assume x in PrimRec ; :: according to COMPUT_1:def_16 ::_thesis: ( x is Relation-like & x is Function-like ) hence ( x is Relation-like & x is Function-like ) ; ::_thesis: verum end; end; registration cluster Relation-like primitive-recursive -> NAT * -defined to-naturals homogeneous for set ; coherence for b1 being Relation st b1 is primitive-recursive holds ( b1 is homogeneous & b1 is to-naturals & b1 is NAT * -defined ) proof let x be Relation; ::_thesis: ( x is primitive-recursive implies ( x is homogeneous & x is to-naturals & x is NAT * -defined ) ) assume x in PrimRec ; :: according to COMPUT_1:def_16 ::_thesis: ( x is homogeneous & x is to-naturals & x is NAT * -defined ) hence ( x is homogeneous & x is to-naturals & x is NAT * -defined ) ; ::_thesis: verum end; end; registration cluster -> primitive-recursive for Element of PrimRec ; coherence for b1 being Element of PrimRec holds b1 is primitive-recursive by Def16; end; registration cluster Relation-like Function-like primitive-recursive for set ; existence ex b1 being Function st b1 is primitive-recursive proof set x = the Element of PrimRec ; take the Element of PrimRec ; ::_thesis: the Element of PrimRec is primitive-recursive thus the Element of PrimRec is primitive-recursive ; ::_thesis: verum end; cluster Relation-like NAT * -defined NAT -valued Function-like complex-valued ext-real-valued real-valued to-naturals homogeneous primitive-recursive for Element of HFuncs NAT; existence ex b1 being Element of HFuncs NAT st b1 is primitive-recursive proof set x = the Element of PrimRec ; take the Element of PrimRec ; ::_thesis: the Element of PrimRec is primitive-recursive thus the Element of PrimRec is primitive-recursive ; ::_thesis: verum end; end; definition func initial-funcs -> Subset of (HFuncs NAT) equals :: COMPUT_1:def 17 {(0 const 0),(1 succ 1)} \/ { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; coherence {(0 const 0),(1 succ 1)} \/ { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } is Subset of (HFuncs NAT) proof set Q1 = {(0 const 0),(1 succ 1)}; set Q2 = { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; A1: { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } c= HFuncs NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } or x in HFuncs NAT ) assume x in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; ::_thesis: x in HFuncs NAT then ex n, i being Element of NAT st ( x = n proj i & 1 <= i & i <= n ) ; hence x in HFuncs NAT by Th35; ::_thesis: verum end; {(0 const 0),(1 succ 1)} c= HFuncs NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in {(0 const 0),(1 succ 1)} or x in HFuncs NAT ) assume x in {(0 const 0),(1 succ 1)} ; ::_thesis: x in HFuncs NAT then ( x = 0 const 0 or x = 1 succ 1 ) by TARSKI:def_2; hence x in HFuncs NAT by Th31, Th33; ::_thesis: verum end; hence {(0 const 0),(1 succ 1)} \/ { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } is Subset of (HFuncs NAT) by A1, XBOOLE_1:8; ::_thesis: verum end; let Q be Subset of (HFuncs NAT); func PR-closure Q -> Subset of (HFuncs NAT) equals :: COMPUT_1:def 18 Q \/ { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } ; coherence Q \/ { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } is Subset of (HFuncs NAT) proof set Q1 = { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } ; { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } c= HFuncs NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } or x in HFuncs NAT ) assume x in { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } ; ::_thesis: x in HFuncs NAT then ex g being Element of HFuncs NAT st ( x = g & ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) ) ; hence x in HFuncs NAT ; ::_thesis: verum end; hence Q \/ { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } is Subset of (HFuncs NAT) by XBOOLE_1:8; ::_thesis: verum end; func composition-closure Q -> Subset of (HFuncs NAT) equals :: COMPUT_1:def 19 Q \/ { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } ; coherence Q \/ { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } is Subset of (HFuncs NAT) proof set Q1 = { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } ; { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } c= HFuncs NAT proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } or x in HFuncs NAT ) assume x in { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } ; ::_thesis: x in HFuncs NAT then ex f being Element of HFuncs NAT ex F being with_the_same_arity Element of (HFuncs NAT) * st ( x = f * <:F:> & f in Q & arity f = len F & rng F c= Q ) ; hence x in HFuncs NAT by Th42; ::_thesis: verum end; hence Q \/ { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } is Subset of (HFuncs NAT) by XBOOLE_1:8; ::_thesis: verum end; end; :: deftheorem defines initial-funcs COMPUT_1:def_17_:_ initial-funcs = {(0 const 0),(1 succ 1)} \/ { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; :: deftheorem defines PR-closure COMPUT_1:def_18_:_ for Q being Subset of (HFuncs NAT) holds PR-closure Q = Q \/ { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in Q & f2 in Q & g is_primitive-recursively_expressed_by f1,f2,i ) } ; :: deftheorem defines composition-closure COMPUT_1:def_19_:_ for Q being Subset of (HFuncs NAT) holds composition-closure Q = Q \/ { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in Q & arity f = len F & rng F c= Q ) } ; definition func PrimRec-Approximation -> Function of NAT,(bool (HFuncs NAT)) means :Def20: :: COMPUT_1:def 20 ( it . 0 = initial-funcs & ( for m being Nat holds it . (m + 1) = (PR-closure (it . m)) \/ (composition-closure (it . m)) ) ); existence ex b1 being Function of NAT,(bool (HFuncs NAT)) st ( b1 . 0 = initial-funcs & ( for m being Nat holds b1 . (m + 1) = (PR-closure (b1 . m)) \/ (composition-closure (b1 . m)) ) ) proof deffunc H1( set , Subset of (HFuncs NAT)) -> Element of K32((HFuncs NAT)) = (PR-closure $2) \/ (composition-closure $2); consider A being Function of NAT,(bool (HFuncs NAT)) such that A1: A . 0 = initial-funcs and A2: for m being Nat holds A . (m + 1) = H1(m,A . m) from NAT_1:sch_12(); take A ; ::_thesis: ( A . 0 = initial-funcs & ( for m being Nat holds A . (m + 1) = (PR-closure (A . m)) \/ (composition-closure (A . m)) ) ) thus A . 0 = initial-funcs by A1; ::_thesis: for m being Nat holds A . (m + 1) = (PR-closure (A . m)) \/ (composition-closure (A . m)) let m be Nat; ::_thesis: A . (m + 1) = (PR-closure (A . m)) \/ (composition-closure (A . m)) thus A . (m + 1) = (PR-closure (A . m)) \/ (composition-closure (A . m)) by A2; ::_thesis: verum end; uniqueness for b1, b2 being Function of NAT,(bool (HFuncs NAT)) st b1 . 0 = initial-funcs & ( for m being Nat holds b1 . (m + 1) = (PR-closure (b1 . m)) \/ (composition-closure (b1 . m)) ) & b2 . 0 = initial-funcs & ( for m being Nat holds b2 . (m + 1) = (PR-closure (b2 . m)) \/ (composition-closure (b2 . m)) ) holds b1 = b2 proof deffunc H1( set , Subset of (HFuncs NAT)) -> Element of K32((HFuncs NAT)) = (PR-closure $2) \/ (composition-closure $2); let it1, it2 be Function of NAT,(bool (HFuncs NAT)); ::_thesis: ( it1 . 0 = initial-funcs & ( for m being Nat holds it1 . (m + 1) = (PR-closure (it1 . m)) \/ (composition-closure (it1 . m)) ) & it2 . 0 = initial-funcs & ( for m being Nat holds it2 . (m + 1) = (PR-closure (it2 . m)) \/ (composition-closure (it2 . m)) ) implies it1 = it2 ) assume that A3: it1 . 0 = initial-funcs and A4: for m being Nat holds it1 . (m + 1) = (PR-closure (it1 . m)) \/ (composition-closure (it1 . m)) and A5: it2 . 0 = initial-funcs and A6: for m being Nat holds it2 . (m + 1) = (PR-closure (it2 . m)) \/ (composition-closure (it2 . m)) ; ::_thesis: it1 = it2 A7: for m being Nat holds it1 . (m + 1) = H1(m,it1 . m) by A4; A8: for m being Nat holds it2 . (m + 1) = H1(m,it2 . m) by A6; A9: it2 . 0 = initial-funcs by A5; A10: it1 . 0 = initial-funcs by A3; thus it1 = it2 from NAT_1:sch_16(A10, A7, A9, A8); ::_thesis: verum end; end; :: deftheorem Def20 defines PrimRec-Approximation COMPUT_1:def_20_:_ for b1 being Function of NAT,(bool (HFuncs NAT)) holds ( b1 = PrimRec-Approximation iff ( b1 . 0 = initial-funcs & ( for m being Nat holds b1 . (m + 1) = (PR-closure (b1 . m)) \/ (composition-closure (b1 . m)) ) ) ); theorem Th75: :: COMPUT_1:75 for m, n being Element of NAT st m <= n holds PrimRec-Approximation . m c= PrimRec-Approximation . n proof let m, n be Element of NAT ; ::_thesis: ( m <= n implies PrimRec-Approximation . m c= PrimRec-Approximation . n ) set prd = PrimRec-Approximation ; defpred S2[ Element of NAT ] means ( m <= $1 implies PrimRec-Approximation . m c= PrimRec-Approximation . $1 ); A1: for n being Element of NAT st S2[n] holds S2[n + 1] proof let n be Element of NAT ; ::_thesis: ( S2[n] implies S2[n + 1] ) assume that A2: S2[n] and A3: m <= n + 1 ; ::_thesis: PrimRec-Approximation . m c= PrimRec-Approximation . (n + 1) PrimRec-Approximation . (n + 1) = (PR-closure (PrimRec-Approximation . n)) \/ (composition-closure (PrimRec-Approximation . n)) by Def20; then A4: PR-closure (PrimRec-Approximation . n) c= PrimRec-Approximation . (n + 1) by XBOOLE_1:7; PrimRec-Approximation . n c= PR-closure (PrimRec-Approximation . n) by XBOOLE_1:7; then A5: PrimRec-Approximation . n c= PrimRec-Approximation . (n + 1) by A4, XBOOLE_1:1; percases ( m < n + 1 or m = n + 1 ) by A3, XXREAL_0:1; suppose m < n + 1 ; ::_thesis: PrimRec-Approximation . m c= PrimRec-Approximation . (n + 1) hence PrimRec-Approximation . m c= PrimRec-Approximation . (n + 1) by A2, A5, NAT_1:13, XBOOLE_1:1; ::_thesis: verum end; suppose m = n + 1 ; ::_thesis: PrimRec-Approximation . m c= PrimRec-Approximation . (n + 1) hence PrimRec-Approximation . m c= PrimRec-Approximation . (n + 1) ; ::_thesis: verum end; end; end; A6: S2[ 0 ] ; for n being Element of NAT holds S2[n] from NAT_1:sch_1(A6, A1); hence ( m <= n implies PrimRec-Approximation . m c= PrimRec-Approximation . n ) ; ::_thesis: verum end; theorem Th76: :: COMPUT_1:76 Union PrimRec-Approximation is primitive-recursively_closed proof set PROJ = { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; set prd = PrimRec-Approximation ; set UP = Union PrimRec-Approximation; A1: dom PrimRec-Approximation = NAT by FUNCT_2:def_1; A2: PrimRec-Approximation . 0 = {(0 const 0),(1 succ 1)} \/ { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } by Def20; 0 const 0 in {(0 const 0),(1 succ 1)} by TARSKI:def_2; then 0 const 0 in PrimRec-Approximation . 0 by A2, XBOOLE_0:def_3; hence 0 const 0 in Union PrimRec-Approximation by A1, CARD_5:2; :: according to COMPUT_1:def_14 ::_thesis: ( 1 succ 1 in Union PrimRec-Approximation & ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in Union PrimRec-Approximation ) & Union PrimRec-Approximation is composition_closed & Union PrimRec-Approximation is primitive-recursion_closed ) 1 succ 1 in {(0 const 0),(1 succ 1)} by TARSKI:def_2; then 1 succ 1 in PrimRec-Approximation . 0 by A2, XBOOLE_0:def_3; hence 1 succ 1 in Union PrimRec-Approximation by A1, CARD_5:2; ::_thesis: ( ( for n, i being Element of NAT st 1 <= i & i <= n holds n proj i in Union PrimRec-Approximation ) & Union PrimRec-Approximation is composition_closed & Union PrimRec-Approximation is primitive-recursion_closed ) hereby ::_thesis: ( Union PrimRec-Approximation is composition_closed & Union PrimRec-Approximation is primitive-recursion_closed ) let n, i be Element of NAT ; ::_thesis: ( 1 <= i & i <= n implies n proj i in Union PrimRec-Approximation ) assume that A3: 1 <= i and A4: i <= n ; ::_thesis: n proj i in Union PrimRec-Approximation n proj i in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } by A3, A4; then n proj i in PrimRec-Approximation . 0 by A2, XBOOLE_0:def_3; hence n proj i in Union PrimRec-Approximation by A1, CARD_5:2; ::_thesis: verum end; hereby :: according to COMPUT_1:def_12 ::_thesis: Union PrimRec-Approximation is primitive-recursion_closed deffunc H1( Element of NAT ) -> set = { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in PrimRec-Approximation . $1 & arity f = len F & rng F c= PrimRec-Approximation . $1 ) } ; let f be Element of HFuncs NAT; ::_thesis: for F being with_the_same_arity FinSequence of HFuncs NAT st f in Union PrimRec-Approximation & arity f = len F & rng F c= Union PrimRec-Approximation holds b2 * <:b3:> in Union PrimRec-Approximation let F be with_the_same_arity FinSequence of HFuncs NAT; ::_thesis: ( f in Union PrimRec-Approximation & arity f = len F & rng F c= Union PrimRec-Approximation implies b1 * <:b2:> in Union PrimRec-Approximation ) assume that A5: f in Union PrimRec-Approximation and A6: arity f = len F and A7: rng F c= Union PrimRec-Approximation ; ::_thesis: b1 * <:b2:> in Union PrimRec-Approximation consider kf being set such that A8: kf in dom PrimRec-Approximation and A9: f in PrimRec-Approximation . kf by A5, CARD_5:2; reconsider kf = kf as Element of NAT by A8; percases ( arity f = 0 or arity f <> 0 ) ; suppose arity f = 0 ; ::_thesis: b1 * <:b2:> in Union PrimRec-Approximation then F = {} by A6; then A10: rng F c= PrimRec-Approximation . kf by RELAT_1:38, XBOOLE_1:2; F is with_the_same_arity Element of (HFuncs NAT) * by FINSEQ_1:def_11; then f * <:F:> in H1(kf) by A6, A9, A10; then f * <:F:> in (PrimRec-Approximation . kf) \/ H1(kf) by XBOOLE_0:def_3; then f * <:F:> in (PR-closure (PrimRec-Approximation . kf)) \/ (composition-closure (PrimRec-Approximation . kf)) by XBOOLE_0:def_3; then f * <:F:> in PrimRec-Approximation . (kf + 1) by Def20; hence f * <:F:> in Union PrimRec-Approximation by A1, CARD_5:2; ::_thesis: verum end; supposeA11: arity f <> 0 ; ::_thesis: b1 * <:b2:> in Union PrimRec-Approximation defpred S2[ set , set ] means ex k being Element of NAT st ( F . $1 in PrimRec-Approximation . k & $2 = k ); A12: for x being set st x in Seg (len F) holds ex y being Element of NAT st S2[x,y] proof let x be set ; ::_thesis: ( x in Seg (len F) implies ex y being Element of NAT st S2[x,y] ) assume x in Seg (len F) ; ::_thesis: ex y being Element of NAT st S2[x,y] then x in dom F by FINSEQ_1:def_3; then F . x in rng F by FUNCT_1:def_3; then consider k being set such that A13: k in dom PrimRec-Approximation and A14: F . x in PrimRec-Approximation . k by A7, CARD_5:2; reconsider k = k as Element of NAT by A13; take k ; ::_thesis: S2[x,k] take k1 = k; ::_thesis: ( F . x in PrimRec-Approximation . k1 & k = k1 ) thus F . x in PrimRec-Approximation . k1 by A14; ::_thesis: k = k1 thus k = k1 ; ::_thesis: verum end; consider fKF being Function of (Seg (len F)),NAT such that A15: for x being set st x in Seg (len F) holds S2[x,fKF . x] from MONOID_1:sch_1(A12); set KF = rng fKF; reconsider KF = rng fKF as non empty finite Subset of NAT by A6, A11, RELAT_1:def_19; set K = max KF; set k = max (kf,(max KF)); reconsider k = max (kf,(max KF)) as Element of NAT by ORDINAL1:def_12; A16: dom fKF = Seg (len F) by FUNCT_2:def_1; A17: rng F c= PrimRec-Approximation . k proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng F or x in PrimRec-Approximation . k ) A18: max KF <= k by XXREAL_0:25; assume x in rng F ; ::_thesis: x in PrimRec-Approximation . k then consider d being set such that A19: d in dom F and A20: x = F . d by FUNCT_1:def_3; A21: d in Seg (len F) by A19, FINSEQ_1:def_3; then consider m being Element of NAT such that A22: F . d in PrimRec-Approximation . m and A23: fKF . d = m by A15; m in KF by A16, A21, A23, FUNCT_1:3; then m <= max KF by XXREAL_2:def_8; then PrimRec-Approximation . m c= PrimRec-Approximation . k by A18, Th75, XXREAL_0:2; hence x in PrimRec-Approximation . k by A20, A22; ::_thesis: verum end; A24: F is with_the_same_arity Element of (HFuncs NAT) * by FINSEQ_1:def_11; PrimRec-Approximation . kf c= PrimRec-Approximation . k by Th75, XXREAL_0:25; then f * <:F:> in H1(k) by A6, A9, A17, A24; then f * <:F:> in (PrimRec-Approximation . k) \/ H1(k) by XBOOLE_0:def_3; then f * <:F:> in (PR-closure (PrimRec-Approximation . k)) \/ (composition-closure (PrimRec-Approximation . k)) by XBOOLE_0:def_3; then f * <:F:> in PrimRec-Approximation . (k + 1) by Def20; hence f * <:F:> in Union PrimRec-Approximation by A1, CARD_5:2; ::_thesis: verum end; end; end; deffunc H1( Element of NAT ) -> set = { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . $1 & f2 in PrimRec-Approximation . $1 & g is_primitive-recursively_expressed_by f1,f2,i ) } ; let g, f1, f2 be Element of HFuncs NAT; :: according to COMPUT_1:def_13 ::_thesis: for i being Element of NAT st g is_primitive-recursively_expressed_by f1,f2,i & f1 in Union PrimRec-Approximation & f2 in Union PrimRec-Approximation holds g in Union PrimRec-Approximation let i be Element of NAT ; ::_thesis: ( g is_primitive-recursively_expressed_by f1,f2,i & f1 in Union PrimRec-Approximation & f2 in Union PrimRec-Approximation implies g in Union PrimRec-Approximation ) assume that A25: g is_primitive-recursively_expressed_by f1,f2,i and A26: f1 in Union PrimRec-Approximation and A27: f2 in Union PrimRec-Approximation ; ::_thesis: g in Union PrimRec-Approximation consider k2 being set such that A28: k2 in dom PrimRec-Approximation and A29: f2 in PrimRec-Approximation . k2 by A27, CARD_5:2; reconsider k2 = k2 as Element of NAT by A28; consider k1 being set such that A30: k1 in dom PrimRec-Approximation and A31: f1 in PrimRec-Approximation . k1 by A26, CARD_5:2; reconsider k1 = k1 as Element of NAT by A30; percases ( k1 <= k2 or k2 <= k1 ) ; suppose k1 <= k2 ; ::_thesis: g in Union PrimRec-Approximation then PrimRec-Approximation . k1 c= PrimRec-Approximation . k2 by Th75; then g in H1(k2) by A25, A31, A29; then g in (PrimRec-Approximation . k2) \/ H1(k2) by XBOOLE_0:def_3; then g in (PR-closure (PrimRec-Approximation . k2)) \/ (composition-closure (PrimRec-Approximation . k2)) by XBOOLE_0:def_3; then g in PrimRec-Approximation . (k2 + 1) by Def20; hence g in Union PrimRec-Approximation by A1, CARD_5:2; ::_thesis: verum end; suppose k2 <= k1 ; ::_thesis: g in Union PrimRec-Approximation then PrimRec-Approximation . k2 c= PrimRec-Approximation . k1 by Th75; then g in H1(k1) by A25, A31, A29; then g in (PrimRec-Approximation . k1) \/ H1(k1) by XBOOLE_0:def_3; then g in (PR-closure (PrimRec-Approximation . k1)) \/ (composition-closure (PrimRec-Approximation . k1)) by XBOOLE_0:def_3; then g in PrimRec-Approximation . (k1 + 1) by Def20; hence g in Union PrimRec-Approximation by A1, CARD_5:2; ::_thesis: verum end; end; end; theorem Th77: :: COMPUT_1:77 PrimRec = Union PrimRec-Approximation proof set prd = PrimRec-Approximation ; defpred S2[ Element of NAT ] means PrimRec-Approximation . $1 c= PrimRec ; A1: now__::_thesis:_for_m_being_Element_of_NAT_st_S2[m]_holds_ S2[m_+_1] let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume A2: S2[m] ; ::_thesis: S2[m + 1] thus S2[m + 1] ::_thesis: verum proof set mcocl = { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in PrimRec-Approximation . m & arity f = len F & rng F c= PrimRec-Approximation . m ) } ; set mprcl = { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) } ; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in PrimRec-Approximation . (m + 1) or x in PrimRec ) A3: PrimRec-Approximation . (m + 1) = (PR-closure (PrimRec-Approximation . m)) \/ (composition-closure (PrimRec-Approximation . m)) by Def20; assume A4: x in PrimRec-Approximation . (m + 1) ; ::_thesis: x in PrimRec percases ( x in PR-closure (PrimRec-Approximation . m) or x in composition-closure (PrimRec-Approximation . m) ) by A4, A3, XBOOLE_0:def_3; supposeA5: x in PR-closure (PrimRec-Approximation . m) ; ::_thesis: x in PrimRec thus x in PrimRec ::_thesis: verum proof percases ( x in PrimRec-Approximation . m or x in { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) } ) by A5, XBOOLE_0:def_3; suppose x in PrimRec-Approximation . m ; ::_thesis: x in PrimRec hence x in PrimRec by A2; ::_thesis: verum end; supposeA6: x in { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) } ; ::_thesis: x in PrimRec A7: PrimRec is primitive-recursion_closed by Def14; ex g being Element of HFuncs NAT st ( x = g & ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) ) by A6; hence x in PrimRec by A2, A7, Def13; ::_thesis: verum end; end; end; end; supposeA8: x in composition-closure (PrimRec-Approximation . m) ; ::_thesis: x in PrimRec thus x in PrimRec ::_thesis: verum proof percases ( x in PrimRec-Approximation . m or x in { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in PrimRec-Approximation . m & arity f = len F & rng F c= PrimRec-Approximation . m ) } ) by A8, XBOOLE_0:def_3; suppose x in PrimRec-Approximation . m ; ::_thesis: x in PrimRec hence x in PrimRec by A2; ::_thesis: verum end; supposeA9: x in { (f * <:F:>) where f is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( f in PrimRec-Approximation . m & arity f = len F & rng F c= PrimRec-Approximation . m ) } ; ::_thesis: x in PrimRec A10: PrimRec is composition_closed by Def14; consider f being Element of HFuncs NAT, F being with_the_same_arity Element of (HFuncs NAT) * such that A11: x = f * <:F:> and A12: f in PrimRec-Approximation . m and A13: arity f = len F and A14: rng F c= PrimRec-Approximation . m by A9; rng F c= PrimRec by A2, A14, XBOOLE_1:1; hence x in PrimRec by A2, A11, A12, A13, A10, Def12; ::_thesis: verum end; end; end; end; end; end; end; A15: S2[ 0 ] proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in PrimRec-Approximation . 0 or x in PrimRec ) assume A16: x in PrimRec-Approximation . 0 ; ::_thesis: x in PrimRec PrimRec-Approximation . 0 = {(0 const 0),(1 succ 1)} \/ { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } by Def20; then A17: ( x in {(0 const 0),(1 succ 1)} or x in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ) by A16, XBOOLE_0:def_3; percases ( x = 0 const 0 or x = 1 succ 1 or x in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ) by A17, TARSKI:def_2; suppose x = 0 const 0 ; ::_thesis: x in PrimRec hence x in PrimRec by Def14; ::_thesis: verum end; suppose x = 1 succ 1 ; ::_thesis: x in PrimRec hence x in PrimRec by Def14; ::_thesis: verum end; suppose x in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; ::_thesis: x in PrimRec then ex n, i being Element of NAT st ( x = n proj i & 1 <= i & i <= n ) ; hence x in PrimRec by Def14; ::_thesis: verum end; end; end; A18: for k being Element of NAT holds S2[k] from NAT_1:sch_1(A15, A1); A19: Union PrimRec-Approximation c= PrimRec proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Union PrimRec-Approximation or x in PrimRec ) assume that A20: x in Union PrimRec-Approximation and A21: not x in PrimRec ; ::_thesis: contradiction consider X being set such that A22: x in X and A23: X in rng PrimRec-Approximation by A20, TARSKI:def_4; consider m being set such that A24: m in dom PrimRec-Approximation and A25: PrimRec-Approximation . m = X by A23, FUNCT_1:def_3; reconsider m = m as Element of NAT by A24; PrimRec-Approximation . m c= PrimRec by A18; hence contradiction by A21, A22, A25; ::_thesis: verum end; PrimRec c= Union PrimRec-Approximation by Th74, Th76; hence PrimRec = Union PrimRec-Approximation by A19, XBOOLE_0:def_10; ::_thesis: verum end; theorem Th78: :: COMPUT_1:78 for m being Element of NAT for f being Element of HFuncs NAT st f in PrimRec-Approximation . m holds f is quasi_total proof let m be Element of NAT ; ::_thesis: for f being Element of HFuncs NAT st f in PrimRec-Approximation . m holds f is quasi_total defpred S2[ Element of NAT ] means for f being Element of HFuncs NAT st f in PrimRec-Approximation . $1 holds f is quasi_total ; set prd = PrimRec-Approximation ; A1: for m being Element of NAT st S2[m] holds S2[m + 1] proof let m be Element of NAT ; ::_thesis: ( S2[m] implies S2[m + 1] ) assume A2: S2[m] ; ::_thesis: S2[m + 1] let f be Element of HFuncs NAT; ::_thesis: ( f in PrimRec-Approximation . (m + 1) implies f is quasi_total ) assume f in PrimRec-Approximation . (m + 1) ; ::_thesis: f is quasi_total then A3: f in (PR-closure (PrimRec-Approximation . m)) \/ (composition-closure (PrimRec-Approximation . m)) by Def20; percases ( f in PR-closure (PrimRec-Approximation . m) or f in composition-closure (PrimRec-Approximation . m) ) by A3, XBOOLE_0:def_3; supposeA4: f in PR-closure (PrimRec-Approximation . m) ; ::_thesis: f is quasi_total thus f is quasi_total ::_thesis: verum proof percases ( f in PrimRec-Approximation . m or f in { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) } ) by A4, XBOOLE_0:def_3; suppose f in PrimRec-Approximation . m ; ::_thesis: f is quasi_total hence f is quasi_total by A2; ::_thesis: verum end; suppose f in { g where g is Element of HFuncs NAT : ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) } ; ::_thesis: f is quasi_total then consider g being Element of HFuncs NAT such that A5: f = g and A6: ex f1, f2 being Element of HFuncs NAT ex i being Element of NAT st ( f1 in PrimRec-Approximation . m & f2 in PrimRec-Approximation . m & g is_primitive-recursively_expressed_by f1,f2,i ) ; consider f1, f2 being Element of HFuncs NAT, i being Element of NAT such that A7: f1 in PrimRec-Approximation . m and A8: f2 in PrimRec-Approximation . m and A9: g is_primitive-recursively_expressed_by f1,f2,i by A6; A10: f2 is quasi_total by A2, A8; f1 is quasi_total by A2, A7; hence f is quasi_total by A5, A9, A10, Th68; ::_thesis: verum end; end; end; end; supposeA11: f in composition-closure (PrimRec-Approximation . m) ; ::_thesis: f is quasi_total thus f is quasi_total ::_thesis: verum proof percases ( f in PrimRec-Approximation . m or f in { (h * <:F:>) where h is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( h in PrimRec-Approximation . m & arity h = len F & rng F c= PrimRec-Approximation . m ) } ) by A11, XBOOLE_0:def_3; suppose f in PrimRec-Approximation . m ; ::_thesis: f is quasi_total hence f is quasi_total by A2; ::_thesis: verum end; suppose f in { (h * <:F:>) where h is Element of HFuncs NAT, F is with_the_same_arity Element of (HFuncs NAT) * : ( h in PrimRec-Approximation . m & arity h = len F & rng F c= PrimRec-Approximation . m ) } ; ::_thesis: f is quasi_total then consider h being Element of HFuncs NAT, F being with_the_same_arity Element of (HFuncs NAT) * such that A12: f = h * <:F:> and A13: h in PrimRec-Approximation . m and A14: arity h = len F and A15: rng F c= PrimRec-Approximation . m ; A16: for h being Element of HFuncs NAT st h in rng F holds h is quasi_total by A2, A15; h is quasi_total by A2, A13; hence f is quasi_total by A12, A14, A16, Th46; ::_thesis: verum end; end; end; end; end; end; A17: S2[ 0 ] proof let f be Element of HFuncs NAT; ::_thesis: ( f in PrimRec-Approximation . 0 implies f is quasi_total ) assume f in PrimRec-Approximation . 0 ; ::_thesis: f is quasi_total then f in initial-funcs by Def20; then A18: ( f in {(0 const 0),(1 succ 1)} or f in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ) by XBOOLE_0:def_3; percases ( f = 0 const 0 or f = 1 succ 1 or f in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ) by A18, TARSKI:def_2; suppose f = 0 const 0 ; ::_thesis: f is quasi_total hence f is quasi_total by Th29; ::_thesis: verum end; suppose f = 1 succ 1 ; ::_thesis: f is quasi_total hence f is quasi_total by Th29; ::_thesis: verum end; suppose f in { (n proj i) where n, i is Element of NAT : ( 1 <= i & i <= n ) } ; ::_thesis: f is quasi_total then ex n, i being Element of NAT st ( f = n proj i & 1 <= i & i <= n ) ; hence f is quasi_total by Th29; ::_thesis: verum end; end; end; for m being Element of NAT holds S2[m] from NAT_1:sch_1(A17, A1); hence for f being Element of HFuncs NAT st f in PrimRec-Approximation . m holds f is quasi_total ; ::_thesis: verum end; registration cluster -> homogeneous quasi_total for Element of PrimRec ; coherence for b1 being Element of PrimRec holds ( b1 is quasi_total & b1 is homogeneous ) proof set prd = PrimRec-Approximation ; let f be Element of PrimRec ; ::_thesis: ( f is quasi_total & f is homogeneous ) consider X being set such that A1: f in X and A2: X in rng PrimRec-Approximation by Th77, TARSKI:def_4; ex m being set st ( m in dom PrimRec-Approximation & PrimRec-Approximation . m = X ) by A2, FUNCT_1:def_3; hence ( f is quasi_total & f is homogeneous ) by A1, Th78; ::_thesis: verum end; end; registration cluster primitive-recursive -> quasi_total for Element of HFuncs NAT; coherence for b1 being Element of HFuncs NAT st b1 is primitive-recursive holds b1 is quasi_total proof let f be Element of HFuncs NAT; ::_thesis: ( f is primitive-recursive implies f is quasi_total ) assume f in PrimRec ; :: according to COMPUT_1:def_16 ::_thesis: f is quasi_total hence f is quasi_total ; ::_thesis: verum end; end; registration cluster Relation-like NAT * -defined Function-like primitive-recursive -> NAT * -defined len-total for set ; coherence for b1 being NAT * -defined Function st b1 is primitive-recursive holds b1 is len-total proof let x be NAT * -defined Function; ::_thesis: ( x is primitive-recursive implies x is len-total ) assume x in PrimRec ; :: according to COMPUT_1:def_16 ::_thesis: x is len-total then x is Element of PrimRec ; hence x is len-total ; ::_thesis: verum end; cluster non empty Relation-like NAT * -defined NAT -valued Function-like complex-valued ext-real-valued real-valued to-naturals homogeneous quasi_total primitive-recursive for Element of PrimRec ; existence not for b1 being Element of PrimRec holds b1 is empty proof 0 const 0 in PrimRec by Th69; hence not for b1 being Element of PrimRec holds b1 is empty ; ::_thesis: verum end; end; begin definition let n be set ; let f be homogeneous Relation; attrf is n -ary means :Def21: :: COMPUT_1:def 21 arity f = n; end; :: deftheorem Def21 defines -ary COMPUT_1:def_21_:_ for n being set for f being homogeneous Relation holds ( f is n -ary iff arity f = n ); registration cluster Relation-like Function-like homogeneous 1 -ary -> non empty homogeneous for set ; coherence for b1 being homogeneous Function st b1 is 1 -ary holds not b1 is empty proof let f be homogeneous Function; ::_thesis: ( f is 1 -ary implies not f is empty ) assume arity f = 1 ; :: according to COMPUT_1:def_21 ::_thesis: not f is empty then ex x being FinSequence st x in dom f by MARGREL1:def_25; hence not f is empty ; ::_thesis: verum end; cluster Relation-like Function-like homogeneous 2 -ary -> non empty homogeneous for set ; coherence for b1 being homogeneous Function st b1 is 2 -ary holds not b1 is empty proof let f be homogeneous Function; ::_thesis: ( f is 2 -ary implies not f is empty ) assume arity f = 2 ; :: according to COMPUT_1:def_21 ::_thesis: not f is empty then ex x being FinSequence st x in dom f by MARGREL1:def_25; hence not f is empty ; ::_thesis: verum end; cluster Relation-like Function-like homogeneous 3 -ary -> non empty homogeneous for set ; coherence for b1 being homogeneous Function st b1 is 3 -ary holds not b1 is empty proof let f be homogeneous Function; ::_thesis: ( f is 3 -ary implies not f is empty ) assume arity f = 3 ; :: according to COMPUT_1:def_21 ::_thesis: not f is empty then ex x being FinSequence st x in dom f by MARGREL1:def_25; hence not f is empty ; ::_thesis: verum end; end; registration let n be non empty Element of NAT ; clustern proj 1 -> NAT * -defined to-naturals homogeneous primitive-recursive ; coherence n proj 1 is primitive-recursive proof 1 <= n by NAT_1:14; then n proj 1 in PrimRec by Def14; hence n proj 1 is primitive-recursive ; ::_thesis: verum end; end; registration cluster2 proj 2 -> NAT * -defined to-naturals homogeneous primitive-recursive ; coherence 2 proj 2 is primitive-recursive proof 2 proj 2 in PrimRec by Def14; hence 2 proj 2 is primitive-recursive ; ::_thesis: verum end; cluster1 succ 1 -> NAT * -defined to-naturals homogeneous primitive-recursive ; coherence 1 succ 1 is primitive-recursive proof 1 succ 1 in PrimRec by Th70; hence 1 succ 1 is primitive-recursive ; ::_thesis: verum end; cluster3 succ 3 -> NAT * -defined to-naturals homogeneous primitive-recursive ; coherence 3 succ 3 is primitive-recursive proof 3 succ 3 in PrimRec by Th70; hence 3 succ 3 is primitive-recursive ; ::_thesis: verum end; let i be Element of NAT ; cluster0 const i -> NAT * -defined to-naturals homogeneous 0 -ary ; coherence 0 const i is 0 -ary proof thus arity (0 const i) = 0 by Th32; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster1 const i -> NAT * -defined to-naturals homogeneous 1 -ary ; coherence 1 const i is 1 -ary proof thus arity (1 const i) = 1 by Th32; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster2 const i -> NAT * -defined to-naturals homogeneous 2 -ary ; coherence 2 const i is 2 -ary proof thus arity (2 const i) = 2 by Th32; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster3 const i -> NAT * -defined to-naturals homogeneous 3 -ary ; coherence 3 const i is 3 -ary proof thus arity (3 const i) = 3 by Th32; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster1 proj i -> NAT * -defined to-naturals homogeneous 1 -ary ; coherence 1 proj i is 1 -ary proof thus arity (1 proj i) = 1 by Th37; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster2 proj i -> NAT * -defined to-naturals homogeneous 2 -ary ; coherence 2 proj i is 2 -ary proof thus arity (2 proj i) = 2 by Th37; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster3 proj i -> NAT * -defined to-naturals homogeneous 3 -ary ; coherence 3 proj i is 3 -ary proof thus arity (3 proj i) = 3 by Th37; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster1 succ i -> NAT * -defined to-naturals homogeneous 1 -ary ; coherence 1 succ i is 1 -ary proof thus arity (1 succ i) = 1 by Th34; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster2 succ i -> NAT * -defined to-naturals homogeneous 2 -ary ; coherence 2 succ i is 2 -ary proof thus arity (2 succ i) = 2 by Th34; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster3 succ i -> NAT * -defined to-naturals homogeneous 3 -ary ; coherence 3 succ i is 3 -ary proof thus arity (3 succ i) = 3 by Th34; :: according to COMPUT_1:def_21 ::_thesis: verum end; let j be Element of NAT ; clusteri const j -> NAT * -defined to-naturals homogeneous primitive-recursive ; coherence i const j is primitive-recursive proof thus i const j in PrimRec by Th69; :: according to COMPUT_1:def_16 ::_thesis: verum end; end; registration cluster non empty Relation-like Function-like homogeneous primitive-recursive 0 -ary for set ; existence ex b1 being homogeneous Function st ( b1 is 0 -ary & b1 is primitive-recursive & not b1 is empty ) by Def14; cluster Relation-like Function-like homogeneous primitive-recursive 1 -ary for set ; existence ex b1 being homogeneous Function st ( b1 is 1 -ary & b1 is primitive-recursive ) by Def14; cluster Relation-like Function-like homogeneous primitive-recursive 2 -ary for set ; existence ex b1 being homogeneous Function st ( b1 is 2 -ary & b1 is primitive-recursive ) proof take f = 2 proj 1; ::_thesis: ( f is 2 -ary & f is primitive-recursive ) thus f is 2 -ary ; ::_thesis: f is primitive-recursive thus f in PrimRec by Def14; :: according to COMPUT_1:def_16 ::_thesis: verum end; cluster Relation-like Function-like homogeneous primitive-recursive 3 -ary for set ; existence ex b1 being homogeneous Function st ( b1 is 3 -ary & b1 is primitive-recursive ) proof take f = 3 proj 1; ::_thesis: ( f is 3 -ary & f is primitive-recursive ) thus f is 3 -ary ; ::_thesis: f is primitive-recursive thus f in PrimRec by Def14; :: according to COMPUT_1:def_16 ::_thesis: verum end; end; registration cluster non empty Relation-like NAT * -defined Function-like to-naturals homogeneous len-total 0 -ary for set ; existence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 0 -ary & b1 is len-total & b1 is to-naturals ) proof 0 const 0 is 0 -ary ; hence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 0 -ary & b1 is len-total & b1 is to-naturals ) ; ::_thesis: verum end; cluster non empty Relation-like NAT * -defined Function-like to-naturals homogeneous len-total 1 -ary for set ; existence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 1 -ary & b1 is len-total & b1 is to-naturals ) proof 1 const 0 is 1 -ary ; hence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 1 -ary & b1 is len-total & b1 is to-naturals ) ; ::_thesis: verum end; cluster non empty Relation-like NAT * -defined Function-like to-naturals homogeneous len-total 2 -ary for set ; existence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 2 -ary & b1 is len-total & b1 is to-naturals ) proof 2 const 0 is 2 -ary ; hence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 2 -ary & b1 is len-total & b1 is to-naturals ) ; ::_thesis: verum end; cluster non empty Relation-like NAT * -defined Function-like to-naturals homogeneous len-total 3 -ary for set ; existence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 3 -ary & b1 is len-total & b1 is to-naturals ) proof 3 const 0 is 3 -ary ; hence ex b1 being NAT * -defined homogeneous Function st ( not b1 is empty & b1 is 3 -ary & b1 is len-total & b1 is to-naturals ) ; ::_thesis: verum end; end; registration let f be non empty primitive-recursive 0 -ary Function; let g be primitive-recursive 2 -ary Function; cluster primrec (f,g,1) -> primitive-recursive 1 -ary ; coherence ( primrec (f,g,1) is primitive-recursive & primrec (f,g,1) is 1 -ary ) proof A1: g in PrimRec by Def16; A2: arity f = 0 by Def21; f is Element of PrimRec by Def16; then dom f = 0 -tuples_on NAT by A2, Th22 .= {(<*> NAT)} by FINSEQ_2:94 ; then A3: {} in dom f by TARSKI:def_1; A4: f in PrimRec by Def16; A5: 1 <= 0 + 1 ; arity g = 0 + 2 by Def21; hence primrec (f,g,1) in PrimRec by A5, A2, A4, A1, Th73; :: according to COMPUT_1:def_16 ::_thesis: primrec (f,g,1) is 1 -ary reconsider ii = <*0*> as Element of 1 -tuples_on NAT by FINSEQ_2:131; dom <*0*> = {1} by FINSEQ_1:2, FINSEQ_1:38; then A6: 1 in dom <*0*> by TARSKI:def_1; Del (<*0*>,1) = {} by WSIERP_1:19; then ii +* (1,0) in dom (primrec (f,g,1)) by A5, A2, A3, A6, Lm6; then A7: <*0*> in dom (primrec (f,g,1)) by FUNCT_7:95; len <*0*> = 1 by FINSEQ_1:39; hence arity (primrec (f,g,1)) = 1 by A7, MARGREL1:def_25; :: according to COMPUT_1:def_21 ::_thesis: verum end; end; registration let f be primitive-recursive 1 -ary Function; let g be primitive-recursive 3 -ary Function; cluster primrec (f,g,1) -> primitive-recursive 2 -ary ; coherence ( primrec (f,g,1) is primitive-recursive & primrec (f,g,1) is 2 -ary ) proof A1: g in PrimRec by Def16; A2: 1 <= 1 + 1 ; A3: arity g = 1 + 2 by Def21; A4: arity f = 1 by Def21; f in PrimRec by Def16; hence primrec (f,g,1) in PrimRec by A2, A4, A3, A1, Th73; :: according to COMPUT_1:def_16 ::_thesis: primrec (f,g,1) is 2 -ary thus arity (primrec (f,g,1)) = 2 by A2, A4, A3, Th57; :: according to COMPUT_1:def_21 ::_thesis: verum end; cluster primrec (f,g,2) -> primitive-recursive 2 -ary ; coherence ( primrec (f,g,2) is primitive-recursive & primrec (f,g,2) is 2 -ary ) proof A5: g in PrimRec by Def16; A6: 2 <= 1 + 1 ; A7: arity g = 1 + 2 by Def21; A8: arity f = 1 by Def21; f in PrimRec by Def16; hence primrec (f,g,2) in PrimRec by A6, A8, A7, A5, Th73; :: according to COMPUT_1:def_16 ::_thesis: primrec (f,g,2) is 2 -ary thus arity (primrec (f,g,2)) = 2 by A6, A8, A7, Th57; :: according to COMPUT_1:def_21 ::_thesis: verum end; end; theorem Th79: :: COMPUT_1:79 for i being Element of NAT for f1 being NAT * -defined to-naturals homogeneous len-total 1 -ary Function for f2 being non empty NAT * -defined to-naturals homogeneous Function holds (primrec (f1,f2,2)) . <*i,0*> = f1 . <*i*> proof let i be Element of NAT ; ::_thesis: for f1 being NAT * -defined to-naturals homogeneous len-total 1 -ary Function for f2 being non empty NAT * -defined to-naturals homogeneous Function holds (primrec (f1,f2,2)) . <*i,0*> = f1 . <*i*> let f1 be NAT * -defined to-naturals homogeneous len-total 1 -ary Function; ::_thesis: for f2 being non empty NAT * -defined to-naturals homogeneous Function holds (primrec (f1,f2,2)) . <*i,0*> = f1 . <*i*> let f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: (primrec (f1,f2,2)) . <*i,0*> = f1 . <*i*> arity f1 = 1 by Def21; then reconsider p = <*i,0*> as Element of ((arity f1) + 1) -tuples_on NAT by FINSEQ_2:101; len p = 2 by FINSEQ_1:44; then A1: 2 in dom p by FINSEQ_3:25; p +* (2,0) = p by Th1; hence (primrec (f1,f2,2)) . <*i,0*> = f1 . (Del (p,2)) by A1, Th60 .= f1 . <*i*> by WSIERP_1:19 ; ::_thesis: verum end; theorem Th80: :: COMPUT_1:80 for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st f1 is len-total & arity f1 = 0 holds (primrec (f1,f2,1)) . <*0*> = f1 . {} proof let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: ( f1 is len-total & arity f1 = 0 implies (primrec (f1,f2,1)) . <*0*> = f1 . {} ) assume that A1: f1 is len-total and A2: arity f1 = 0 ; ::_thesis: (primrec (f1,f2,1)) . <*0*> = f1 . {} reconsider p = <*0*> as Element of ((arity f1) + 1) -tuples_on NAT by A2, FINSEQ_2:131; len p = 1 by FINSEQ_1:39; then A3: 1 in dom p by FINSEQ_3:25; p +* (1,0) = p by FUNCT_7:95; hence (primrec (f1,f2,1)) . <*0*> = f1 . (Del (p,1)) by A1, A3, Th60 .= f1 . {} by WSIERP_1:19 ; ::_thesis: verum end; theorem Th81: :: COMPUT_1:81 for i, j being Element of NAT for f1 being NAT * -defined to-naturals homogeneous len-total 1 -ary Function for f2 being NAT * -defined to-naturals homogeneous len-total 3 -ary Function holds (primrec (f1,f2,2)) . <*i,(j + 1)*> = f2 . <*i,j,((primrec (f1,f2,2)) . <*i,j*>)*> proof let i, j be Element of NAT ; ::_thesis: for f1 being NAT * -defined to-naturals homogeneous len-total 1 -ary Function for f2 being NAT * -defined to-naturals homogeneous len-total 3 -ary Function holds (primrec (f1,f2,2)) . <*i,(j + 1)*> = f2 . <*i,j,((primrec (f1,f2,2)) . <*i,j*>)*> let f1 be NAT * -defined to-naturals homogeneous len-total 1 -ary Function; ::_thesis: for f2 being NAT * -defined to-naturals homogeneous len-total 3 -ary Function holds (primrec (f1,f2,2)) . <*i,(j + 1)*> = f2 . <*i,j,((primrec (f1,f2,2)) . <*i,j*>)*> let f2 be NAT * -defined to-naturals homogeneous len-total 3 -ary Function; ::_thesis: (primrec (f1,f2,2)) . <*i,(j + 1)*> = f2 . <*i,j,((primrec (f1,f2,2)) . <*i,j*>)*> A1: arity f1 = 1 by Def21; then reconsider p = <*i,j*> as Element of ((arity f1) + 1) -tuples_on NAT by FINSEQ_2:101; A2: p +* (2,(j + 1)) = <*i,(j + 1)*> by Th1; A3: p +* (2,j) = <*i,j*> by Th1; (arity f1) + 2 = arity f2 by A1, Def21; hence (primrec (f1,f2,2)) . <*i,(j + 1)*> = f2 . ((p +* (2,j)) ^ <*((primrec (f1,f2,2)) . (p +* (2,j)))*>) by A1, A2, Th63 .= f2 . <*i,j,((primrec (f1,f2,2)) . <*i,j*>)*> by A3, FINSEQ_1:43 ; ::_thesis: verum end; theorem Th82: :: COMPUT_1:82 for i being Element of NAT for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st f1 is len-total & f2 is len-total & arity f1 = 0 & arity f2 = 2 holds (primrec (f1,f2,1)) . <*(i + 1)*> = f2 . <*i,((primrec (f1,f2,1)) . <*i*>)*> proof let i be Element of NAT ; ::_thesis: for f1, f2 being non empty NAT * -defined to-naturals homogeneous Function st f1 is len-total & f2 is len-total & arity f1 = 0 & arity f2 = 2 holds (primrec (f1,f2,1)) . <*(i + 1)*> = f2 . <*i,((primrec (f1,f2,1)) . <*i*>)*> let f1, f2 be non empty NAT * -defined to-naturals homogeneous Function; ::_thesis: ( f1 is len-total & f2 is len-total & arity f1 = 0 & arity f2 = 2 implies (primrec (f1,f2,1)) . <*(i + 1)*> = f2 . <*i,((primrec (f1,f2,1)) . <*i*>)*> ) assume that A1: f1 is len-total and A2: f2 is len-total and A3: arity f1 = 0 and A4: arity f2 = 2 ; ::_thesis: (primrec (f1,f2,1)) . <*(i + 1)*> = f2 . <*i,((primrec (f1,f2,1)) . <*i*>)*> reconsider p = <*i*> as Element of ((arity f1) + 1) -tuples_on NAT by A3, FINSEQ_2:131; A5: p +* (1,(i + 1)) = <*(i + 1)*> by FUNCT_7:95; A6: p +* (1,i) = <*i*> by FUNCT_7:95; (arity f1) + 2 = arity f2 by A3, A4; hence (primrec (f1,f2,1)) . <*(i + 1)*> = f2 . ((p +* (1,i)) ^ <*((primrec (f1,f2,1)) . (p +* (1,i)))*>) by A1, A2, A3, A5, Th63 .= f2 . <*i,((primrec (f1,f2,1)) . <*i*>)*> by A6, FINSEQ_1:def_9 ; ::_thesis: verum end; Lm8: now__::_thesis:_for_g_being_non_empty_homogeneous_quasi_total_PartFunc_of_(NAT_*),NAT_st_arity_g_=_2_holds_ (_dom_<:<*(3_proj_1),(3_proj_3)*>:>_=_(dom_(3_proj_1))_/\_(dom_(3_proj_3))_&_dom_<:<*(3_proj_1),(3_proj_3)*>:>_=_3_-tuples_on_NAT_&_dom_(g_*_<:<*(3_proj_1),(3_proj_3)*>:>)_=_3_-tuples_on_NAT_&_ex_G_being_homogeneous_PartFunc_of_(NAT_*),NAT_st_ (_G_=_g_*_<:<*(3_proj_1),(3_proj_3)*>:>_&_G_is_Element_of_HFuncs_NAT_&_arity_G_=_3_&_G_is_quasi_total_&_not_G_is_empty_)_) reconsider z3 = <*0,0,0*> as FinSequence of NAT ; let g be non empty homogeneous quasi_total PartFunc of (NAT *),NAT; ::_thesis: ( arity g = 2 implies ( dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) & dom <:<*(3 proj 1),(3 proj 3)*>:> = 3 -tuples_on NAT & dom (g * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT & ex G being homogeneous PartFunc of (NAT *),NAT st ( G = g * <:<*(3 proj 1),(3 proj 3)*>:> & G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) ) ) set G = g * <:<*(3 proj 1),(3 proj 3)*>:>; A1: rng (g * <:<*(3 proj 1),(3 proj 3)*>:>) c= NAT by RELAT_1:def_19; assume A2: arity g = 2 ; ::_thesis: ( dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) & dom <:<*(3 proj 1),(3 proj 3)*>:> = 3 -tuples_on NAT & dom (g * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT & ex G being homogeneous PartFunc of (NAT *),NAT st ( G = g * <:<*(3 proj 1),(3 proj 3)*>:> & G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) ) then A3: dom g = 2 -tuples_on NAT by Th22; thus A4: dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) by FINSEQ_3:142; ::_thesis: ( dom <:<*(3 proj 1),(3 proj 3)*>:> = 3 -tuples_on NAT & dom (g * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT & ex G being homogeneous PartFunc of (NAT *),NAT st ( G = g * <:<*(3 proj 1),(3 proj 3)*>:> & G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) ) hence A5: dom <:<*(3 proj 1),(3 proj 3)*>:> = (3 -tuples_on NAT) /\ (dom (3 proj 3)) by Th36 .= (3 -tuples_on NAT) /\ (3 -tuples_on NAT) by Th36 .= 3 -tuples_on NAT ; ::_thesis: ( dom (g * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT & ex G being homogeneous PartFunc of (NAT *),NAT st ( G = g * <:<*(3 proj 1),(3 proj 3)*>:> & G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) ) now__::_thesis:_for_x_being_set_holds_ (_(_x_in_rng_<:<*(3_proj_1),(3_proj_3)*>:>_implies_x_in_dom_g_)_&_(_x_in_dom_g_implies_x_in_rng_<:<*(3_proj_1),(3_proj_3)*>:>_)_) set f = <*(3 proj 1),(3 proj 3)*>; let x be set ; ::_thesis: ( ( x in rng <:<*(3 proj 1),(3 proj 3)*>:> implies x in dom g ) & ( x in dom g implies x in rng <:<*(3 proj 1),(3 proj 3)*>:> ) ) set F = <:<*(3 proj 1),(3 proj 3)*>:>; A6: product (rngs <*(3 proj 1),(3 proj 3)*>) = product <*(rng (3 proj 1)),(rng (3 proj 3))*> by FINSEQ_3:133 .= product <*NAT,(rng (3 proj 3))*> by Th36 .= product <*NAT,NAT*> by Th36 .= 2 -tuples_on NAT by FINSEQ_3:128 ; hereby ::_thesis: ( x in dom g implies x in rng <:<*(3 proj 1),(3 proj 3)*>:> ) A7: rng <:<*(3 proj 1),(3 proj 3)*>:> c= product (rngs <*(3 proj 1),(3 proj 3)*>) by FUNCT_6:29; assume x in rng <:<*(3 proj 1),(3 proj 3)*>:> ; ::_thesis: x in dom g hence x in dom g by A3, A6, A7; ::_thesis: verum end; assume x in dom g ; ::_thesis: x in rng <:<*(3 proj 1),(3 proj 3)*>:> then x is Element of 2 -tuples_on NAT by A2, Th22; then consider d1, d2 being Element of NAT such that A8: x = <*d1,d2*> by FINSEQ_2:100; reconsider x9 = <*d1,0,d2*> as Element of 3 -tuples_on NAT by FINSEQ_2:104; <:<*(3 proj 1),(3 proj 3)*>:> . x9 = <*((3 proj 1) . x9),((3 proj 3) . x9)*> by A4, A5, FINSEQ_3:142 .= <*(x9 . 1),((3 proj 3) . x9)*> by Th38 .= <*(x9 . 1),(x9 . 3)*> by Th38 .= <*d1,(x9 . 3)*> by FINSEQ_1:45 .= x by A8, FINSEQ_1:45 ; hence x in rng <:<*(3 proj 1),(3 proj 3)*>:> by A5, FUNCT_1:def_3; ::_thesis: verum end; then rng <:<*(3 proj 1),(3 proj 3)*>:> = dom g by TARSKI:1; hence A9: dom (g * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT by A5, RELAT_1:27; ::_thesis: ex G being homogeneous PartFunc of (NAT *),NAT st ( G = g * <:<*(3 proj 1),(3 proj 3)*>:> & G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) then reconsider G = g * <:<*(3 proj 1),(3 proj 3)*>:> as PartFunc of (NAT *),NAT by A1, FINSEQ_2:142, RELSET_1:4; reconsider G = G as homogeneous PartFunc of (NAT *),NAT by A9, MARGREL1:def_21; take G = G; ::_thesis: ( G = g * <:<*(3 proj 1),(3 proj 3)*>:> & G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) thus G = g * <:<*(3 proj 1),(3 proj 3)*>:> ; ::_thesis: ( G is Element of HFuncs NAT & arity G = 3 & G is quasi_total & not G is empty ) G is Element of PFuncs ((NAT *),NAT) by PARTFUN1:45; then G in HFuncs NAT ; hence G is Element of HFuncs NAT ; ::_thesis: ( arity G = 3 & G is quasi_total & not G is empty ) len z3 = 3 by FINSEQ_1:45; then A10: z3 is Element of 3 -tuples_on NAT by FINSEQ_2:92; for x being FinSequence st x in dom G holds 3 = len x by A9, CARD_1:def_7; hence arity G = 3 by A10, A9, MARGREL1:def_25; ::_thesis: ( G is quasi_total & not G is empty ) hence ( G is quasi_total & not G is empty ) by A9, Th22; ::_thesis: verum end; definition let g be Function; func (1,2)->(1,?,2) g -> Function equals :: COMPUT_1:def 22 g * <:<*(3 proj 1),(3 proj 3)*>:>; coherence g * <:<*(3 proj 1),(3 proj 3)*>:> is Function ; end; :: deftheorem defines (1,2)->(1,?,2) COMPUT_1:def_22_:_ for g being Function holds (1,2)->(1,?,2) g = g * <:<*(3 proj 1),(3 proj 3)*>:>; registration let g be NAT * -defined to-naturals Function; cluster (1,2)->(1,?,2) g -> NAT * -defined to-naturals ; coherence ( (1,2)->(1,?,2) g is to-naturals & (1,2)->(1,?,2) g is NAT * -defined ) proof set G = (1,2)->(1,?,2) g; A1: 3 -tuples_on NAT c= NAT * by FINSEQ_2:142; dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) by FINSEQ_3:142; then A2: dom <:<*(3 proj 1),(3 proj 3)*>:> = (3 -tuples_on NAT) /\ (dom (3 proj 3)) by Th36 .= (3 -tuples_on NAT) /\ (3 -tuples_on NAT) by Th36 .= 3 -tuples_on NAT ; dom ((1,2)->(1,?,2) g) c= dom <:<*(3 proj 1),(3 proj 3)*>:> by RELAT_1:25; then dom ((1,2)->(1,?,2) g) c= NAT * by A2, A1, XBOOLE_1:1; hence ( (1,2)->(1,?,2) g is to-naturals & (1,2)->(1,?,2) g is NAT * -defined ) by RELAT_1:def_18; ::_thesis: verum end; end; registration let g be homogeneous Function; cluster (1,2)->(1,?,2) g -> homogeneous ; coherence (1,2)->(1,?,2) g is homogeneous proof set G = (1,2)->(1,?,2) g; dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) by FINSEQ_3:142; then dom <:<*(3 proj 1),(3 proj 3)*>:> = (3 -tuples_on NAT) /\ (dom (3 proj 3)) by Th36 .= (3 -tuples_on NAT) /\ (3 -tuples_on NAT) by Th36 .= 3 -tuples_on NAT ; then dom ((1,2)->(1,?,2) g) c= 3 -tuples_on NAT by RELAT_1:25; hence dom ((1,2)->(1,?,2) g) is with_common_domain ; :: according to MARGREL1:def_21 ::_thesis: verum end; end; registration let g be NAT * -defined to-naturals homogeneous len-total 2 -ary Function; cluster (1,2)->(1,?,2) g -> non empty len-total 3 -ary ; coherence ( not (1,2)->(1,?,2) g is empty & (1,2)->(1,?,2) g is 3 -ary & (1,2)->(1,?,2) g is len-total ) proof A1: g is non empty homogeneous quasi_total PartFunc of (NAT *),NAT by Th17; arity g = 2 by Def21; then consider G being homogeneous PartFunc of (NAT *),NAT such that A2: G = g * <:<*(3 proj 1),(3 proj 3)*>:> and G is Element of HFuncs NAT and A3: arity G = 3 and A4: ( G is quasi_total & not G is empty ) by A1, Lm8; reconsider G9 = G as non empty homogeneous quasi_total PartFunc of (NAT *),NAT by A4; G9 is non empty NAT * -defined to-naturals homogeneous len-total 3 -ary Function by A3, Def21; hence ( not (1,2)->(1,?,2) g is empty & (1,2)->(1,?,2) g is 3 -ary & (1,2)->(1,?,2) g is len-total ) by A2; ::_thesis: verum end; end; theorem Th83: :: COMPUT_1:83 for i, j, k being Element of NAT for f being NAT * -defined to-naturals homogeneous len-total 2 -ary Function holds ((1,2)->(1,?,2) f) . <*i,j,k*> = f . <*i,k*> proof let i, j, k be Element of NAT ; ::_thesis: for f being NAT * -defined to-naturals homogeneous len-total 2 -ary Function holds ((1,2)->(1,?,2) f) . <*i,j,k*> = f . <*i,k*> let f be NAT * -defined to-naturals homogeneous len-total 2 -ary Function; ::_thesis: ((1,2)->(1,?,2) f) . <*i,j,k*> = f . <*i,k*> reconsider ff = f as non empty homogeneous quasi_total PartFunc of (NAT *),NAT by Th17; reconsider ijk = <*i,j,k*> as Element of 3 -tuples_on NAT by FINSEQ_2:104; A1: arity ff = 2 by Def21; then A2: dom <:<*(3 proj 1),(3 proj 3)*>:> = (dom (3 proj 1)) /\ (dom (3 proj 3)) by Lm8; A3: dom <:<*(3 proj 1),(3 proj 3)*>:> = 3 -tuples_on NAT by A1, Lm8; dom (ff * <:<*(3 proj 1),(3 proj 3)*>:>) = 3 -tuples_on NAT by A1, Lm8; hence ((1,2)->(1,?,2) f) . <*i,j,k*> = f . (<:<*(3 proj 1),(3 proj 3)*>:> . ijk) by FUNCT_1:12 .= f . <*((3 proj 1) . ijk),((3 proj 3) . ijk)*> by A2, A3, FINSEQ_3:142 .= f . <*(ijk . 1),((3 proj 3) . ijk)*> by Th38 .= f . <*(ijk . 1),(ijk . 3)*> by Th38 .= f . <*i,(ijk . 3)*> by FINSEQ_1:45 .= f . <*i,k*> by FINSEQ_1:45 ; ::_thesis: verum end; theorem Th84: :: COMPUT_1:84 for g being primitive-recursive 2 -ary Function holds (1,2)->(1,?,2) g in PrimRec proof A1: 3 proj 3 in PrimRec by Def14; A2: 2 -tuples_on PrimRec c= PrimRec * by FINSEQ_2:142; 3 proj 1 in PrimRec by Def14; then <*(3 proj 1),(3 proj 3)*> in 2 -tuples_on PrimRec by A1, FINSEQ_2:101; then reconsider F = <*(3 proj 1),(3 proj 3)*> as Element of PrimRec * by A2; F is with_the_same_arity proof let f, g be Function; :: according to COMPUT_1:def_3 ::_thesis: ( f in rng F & g in rng F implies ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) ) assume that A3: f in rng F and A4: g in rng F ; ::_thesis: ( ( not f is empty or g is empty or dom g = {{}} ) & ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) ) A5: rng F = {(3 proj 1),(3 proj 3)} by FINSEQ_2:127; hence ( not f is empty or g is empty or dom g = {{}} ) by A3, TARSKI:def_2; ::_thesis: ( not f is empty & not g is empty implies ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) ) assume that not f is empty and not g is empty ; ::_thesis: ex n being Element of NAT ex X being non empty set st ( dom f c= n -tuples_on X & dom g c= n -tuples_on X ) take 3 ; ::_thesis: ex X being non empty set st ( dom f c= 3 -tuples_on X & dom g c= 3 -tuples_on X ) take NAT ; ::_thesis: ( dom f c= 3 -tuples_on NAT & dom g c= 3 -tuples_on NAT ) ( f = 3 proj 1 or f = 3 proj 3 ) by A3, A5, TARSKI:def_2; hence dom f c= 3 -tuples_on NAT by Th36; ::_thesis: dom g c= 3 -tuples_on NAT ( g = 3 proj 1 or g = 3 proj 3 ) by A4, A5, TARSKI:def_2; hence dom g c= 3 -tuples_on NAT by Th36; ::_thesis: verum end; then reconsider F = F as with_the_same_arity Element of PrimRec * ; let g be primitive-recursive 2 -ary Function; ::_thesis: (1,2)->(1,?,2) g in PrimRec arity g = 2 by Def21; then A6: arity g = len F by FINSEQ_1:44; g is Element of PrimRec by Def16; hence (1,2)->(1,?,2) g in PrimRec by A6, Th72; ::_thesis: verum end; registration let f be homogeneous primitive-recursive 2 -ary Function; cluster (1,2)->(1,?,2) f -> primitive-recursive 3 -ary ; coherence ( (1,2)->(1,?,2) f is primitive-recursive & (1,2)->(1,?,2) f is 3 -ary ) proof thus (1,2)->(1,?,2) f in PrimRec by Th84; :: according to COMPUT_1:def_16 ::_thesis: (1,2)->(1,?,2) f is 3 -ary thus arity ((1,2)->(1,?,2) f) = 3 by Def21; :: according to COMPUT_1:def_21 ::_thesis: verum end; end; definition func [+] -> primitive-recursive 2 -ary Function equals :: COMPUT_1:def 23 primrec ((1 proj 1),(3 succ 3),2); coherence primrec ((1 proj 1),(3 succ 3),2) is primitive-recursive 2 -ary Function ; end; :: deftheorem defines [+] COMPUT_1:def_23_:_ [+] = primrec ((1 proj 1),(3 succ 3),2); theorem Th85: :: COMPUT_1:85 for i, j being Element of NAT holds [+] . <*i,j*> = i + j proof let i, j be Element of NAT ; ::_thesis: [+] . <*i,j*> = i + j reconsider q = <*i*> as Element of 1 -tuples_on NAT by FINSEQ_2:131; defpred S2[ Element of NAT ] means [+] . <*i,$1*> = i + $1; A1: now__::_thesis:_for_j_being_Element_of_NAT_st_S2[j]_holds_ S2[j_+_1] let j be Element of NAT ; ::_thesis: ( S2[j] implies S2[j + 1] ) reconsider r = <*i,j,(i + j)*> as Element of 3 -tuples_on NAT by FINSEQ_2:104; assume S2[j] ; ::_thesis: S2[j + 1] then [+] . <*i,(j + 1)*> = (3 succ 3) . r by Th81 .= (r /. 3) + 1 by Def7 .= (i + j) + 1 by FINSEQ_4:18 .= i + (j + 1) ; hence S2[j + 1] ; ::_thesis: verum end; [+] . <*i,0*> = (1 proj 1) . q by Th79 .= q . 1 by Th38 .= i + 0 by FINSEQ_1:40 ; then A2: S2[ 0 ] ; for j being Element of NAT holds S2[j] from NAT_1:sch_1(A2, A1); hence [+] . <*i,j*> = i + j ; ::_thesis: verum end; definition func [*] -> primitive-recursive 2 -ary Function equals :: COMPUT_1:def 24 primrec ((1 const 0),((1,2)->(1,?,2) [+]),2); coherence primrec ((1 const 0),((1,2)->(1,?,2) [+]),2) is primitive-recursive 2 -ary Function ; end; :: deftheorem defines [*] COMPUT_1:def_24_:_ [*] = primrec ((1 const 0),((1,2)->(1,?,2) [+]),2); theorem Th86: :: COMPUT_1:86 for i, j being Element of NAT holds [*] . <*i,j*> = i * j proof let i be Element of NAT ; ::_thesis: for j being Element of NAT holds [*] . <*i,j*> = i * j defpred S2[ Element of NAT ] means [*] . <*i,$1*> = i * $1; A1: now__::_thesis:_for_j_being_Element_of_NAT_st_S2[j]_holds_ S2[j_+_1] let j be Element of NAT ; ::_thesis: ( S2[j] implies S2[j + 1] ) assume S2[j] ; ::_thesis: S2[j + 1] then [*] . <*i,(j + 1)*> = ((1,2)->(1,?,2) [+]) . <*i,j,(i * j)*> by Th81 .= [+] . <*i,(i * j)*> by Th83 .= (i * 1) + (i * j) by Th85 .= i * (j + 1) ; hence S2[j + 1] ; ::_thesis: verum end; reconsider ii = <*i*> as Element of 1 -tuples_on NAT by FINSEQ_2:98; [*] . <*i,0*> = (1 const 0) . ii by Th79 .= i * 0 by FUNCOP_1:7 ; then A2: S2[ 0 ] ; thus for i being Element of NAT holds S2[i] from NAT_1:sch_1(A2, A1); ::_thesis: verum end; registration let g, h be homogeneous primitive-recursive 2 -ary Function; cluster<*g,h*> -> with_the_same_arity ; coherence <*g,h*> is with_the_same_arity proof reconsider g = g, h = h as Element of PrimRec by Def16; A1: rng <*g,h*> = {g,h} by FINSEQ_2:127; A2: now__::_thesis:_for_f1,_f2_being_homogeneous_Function_st_f1_in_rng_<*g,h*>_&_f2_in_rng_<*g,h*>_holds_ arity_f1_=_arity_f2 let f1, f2 be homogeneous Function; ::_thesis: ( f1 in rng <*g,h*> & f2 in rng <*g,h*> implies arity f1 = arity f2 ) assume that A3: f1 in rng <*g,h*> and A4: f2 in rng <*g,h*> ; ::_thesis: arity f1 = arity f2 ( f1 = g or f1 = h ) by A1, A3, TARSKI:def_2; then A5: arity f1 = 2 by Def21; ( f2 = g or f2 = h ) by A1, A4, TARSKI:def_2; hence arity f1 = arity f2 by A5, Def21; ::_thesis: verum end; rng <*g,h*> c= PrimRec by FINSEQ_1:def_4; hence <*g,h*> is with_the_same_arity by A2, Th30, XBOOLE_1:1; ::_thesis: verum end; end; registration let f, g, h be primitive-recursive 2 -ary Function; cluster<:<*g,h*>:> * f -> primitive-recursive ; coherence f * <:<*g,h*>:> is primitive-recursive proof reconsider g9 = g, h9 = h as Element of PrimRec by Def16; A1: f in PrimRec by Def16; A2: rng <*g9,h9*> c= PrimRec by FINSEQ_1:def_4; then rng <*g,h*> c= HFuncs NAT by XBOOLE_1:1; then reconsider F = <*g,h*> as with_the_same_arity FinSequence of HFuncs NAT by FINSEQ_1:def_4; A3: PrimRec is composition_closed by Def14; A4: arity f = 2 by Def21; len F = 2 by FINSEQ_1:44; hence f * <:<*g,h*>:> in PrimRec by A2, A1, A3, A4, Def12; :: according to COMPUT_1:def_16 ::_thesis: verum end; end; registration let f, g, h be primitive-recursive 2 -ary Function; cluster<:<*g,h*>:> * f -> 2 -ary ; coherence f * <:<*g,h*>:> is 2 -ary proof set x = the Element of 2 -tuples_on NAT; reconsider f9 = f, fgh = f * <:<*g,h*>:>, g9 = g, h9 = h as Element of PrimRec by Def16; A1: f9 = f ; rng <*g9,h9*> c= PrimRec by FINSEQ_1:def_4; then rng <*g,h*> c= HFuncs NAT by XBOOLE_1:1; then reconsider F = <*g,h*> as with_the_same_arity FinSequence of HFuncs NAT by FINSEQ_1:def_4; A2: dom <:F:> = (dom g) /\ (dom h) by FINSEQ_3:142; A3: arity g = 2 by Def21; rng F = {g,h} by FINSEQ_2:127; then g in rng F by TARSKI:def_2; then A4: arity F = 2 by A3, Def4; arity f = 2 by Def21; then A5: dom f9 = 2 -tuples_on NAT by Lm1; arity h = 2 by Def21; then A6: dom h9 = 2 -tuples_on NAT by Lm1; A7: dom g9 = 2 -tuples_on NAT by A3, Lm1; then <:F:> . the Element of 2 -tuples_on NAT = <*(g9 . the Element of 2 -tuples_on NAT),(h9 . the Element of 2 -tuples_on NAT)*> by A6, A2, FINSEQ_3:142; then <:F:> . the Element of 2 -tuples_on NAT is Element of 2 -tuples_on NAT by FINSEQ_2:101; then not fgh is empty by A5, A7, A6, A2, FUNCT_1:11, RELAT_1:38; hence arity (f * <:<*g,h*>:>) = 2 by A1, A4, Th44; :: according to COMPUT_1:def_21 ::_thesis: verum end; end; registration let f be primitive-recursive 1 -ary Function; let g be primitive-recursive Function; cluster<:<*g*>:> * f -> primitive-recursive ; coherence f * <:<*g*>:> is primitive-recursive proof reconsider g9 = g as Element of PrimRec by Def16; A1: f in PrimRec by Def16; A2: rng <*g9*> c= PrimRec by FINSEQ_1:def_4; then rng <*g*> c= HFuncs NAT by XBOOLE_1:1; then reconsider F = <*g9*> as with_the_same_arity FinSequence of HFuncs NAT by FINSEQ_1:def_4; A3: PrimRec is composition_closed by Def14; A4: arity f = 1 by Def21; len F = 1 by FINSEQ_1:39; hence f * <:<*g*>:> in PrimRec by A2, A1, A3, A4, Def12; :: according to COMPUT_1:def_16 ::_thesis: verum end; end; registration let f be primitive-recursive 1 -ary Function; let g be primitive-recursive 2 -ary Function; cluster<:<*g*>:> * f -> 2 -ary ; coherence f * <:<*g*>:> is 2 -ary proof set x = the Element of 2 -tuples_on NAT; reconsider f9 = f, fg = f * <:<*g*>:>, g9 = g as Element of PrimRec by Def16; A1: f9 = f ; rng <*g9*> c= PrimRec by FINSEQ_1:def_4; then rng <*g*> c= HFuncs NAT by XBOOLE_1:1; then reconsider F = <*g9*> as with_the_same_arity FinSequence of HFuncs NAT by FINSEQ_1:def_4; A2: dom <:F:> = dom g by FINSEQ_3:141; arity f = 1 by Def21; then A3: dom f9 = 1 -tuples_on NAT by Lm1; A4: arity g = 2 by Def21; rng F = {g} by FINSEQ_1:39; then g in rng F by TARSKI:def_1; then A5: arity F = 2 by A4, Def4; A6: dom g9 = 2 -tuples_on NAT by A4, Lm1; then <:F:> . the Element of 2 -tuples_on NAT = <*(g9 . the Element of 2 -tuples_on NAT)*> by FINSEQ_3:141; then <:F:> . the Element of 2 -tuples_on NAT in 1 -tuples_on NAT by FINSEQ_2:98; then not fg is empty by A6, A2, A3, FUNCT_1:11, RELAT_1:38; hence arity (f * <:<*g*>:>) = 2 by A1, A5, Th44; :: according to COMPUT_1:def_21 ::_thesis: verum end; end; definition func [!] -> primitive-recursive 1 -ary Function equals :: COMPUT_1:def 25 primrec ((0 const 1),([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>),1); coherence primrec ((0 const 1),([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>),1) is primitive-recursive 1 -ary Function ; end; :: deftheorem defines [!] COMPUT_1:def_25_:_ [!] = primrec ((0 const 1),([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>),1); scheme :: COMPUT_1:sch 1 Primrec1{ F1() -> NAT * -defined to-naturals homogeneous len-total 1 -ary Function, F2() -> NAT * -defined to-naturals homogeneous len-total 2 -ary Function, F3( set ) -> Element of NAT , F4( set , set ) -> Element of NAT } : for i, j being Element of NAT holds (F1() * <:<*F2()*>:>) . <*i,j*> = F3(F4(i,j)) provided A1: for i being Element of NAT holds F1() . <*i*> = F3(i) and A2: for i, j being Element of NAT holds F2() . <*i,j*> = F4(i,j) proof let i, j be Element of NAT ; ::_thesis: (F1() * <:<*F2()*>:>) . <*i,j*> = F3(F4(i,j)) arity F2() = 2 by Def21; then A3: dom F2() = 2 -tuples_on NAT by Th23; dom <:<*F2()*>:> = dom F2() by FINSEQ_3:141; hence (F1() * <:<*F2()*>:>) . <*i,j*> = F1() . (<:<*F2()*>:> . <*i,j*>) by A3, FINSEQ_2:101, FUNCT_1:13 .= F1() . <*(F2() . <*i,j*>)*> by A3, FINSEQ_2:101, FINSEQ_3:141 .= F1() . <*F4(i,j)*> by A2 .= F3(F4(i,j)) by A1 ; ::_thesis: verum end; scheme :: COMPUT_1:sch 2 Primrec2{ F1() -> NAT * -defined to-naturals homogeneous len-total 2 -ary Function, F2() -> NAT * -defined to-naturals homogeneous len-total 2 -ary Function, F3() -> NAT * -defined to-naturals homogeneous len-total 2 -ary Function, F4( set , set ) -> Element of NAT , F5( set , set ) -> Element of NAT , F6( set , set ) -> Element of NAT } : for i, j being Element of NAT holds (F1() * <:<*F2(),F3()*>:>) . <*i,j*> = F4(F5(i,j),F6(i,j)) provided A1: for i, j being Element of NAT holds F1() . <*i,j*> = F4(i,j) and A2: for i, j being Element of NAT holds F2() . <*i,j*> = F5(i,j) and A3: for i, j being Element of NAT holds F3() . <*i,j*> = F6(i,j) proof let i, j be Element of NAT ; ::_thesis: (F1() * <:<*F2(),F3()*>:>) . <*i,j*> = F4(F5(i,j),F6(i,j)) arity F2() = 2 by Def21; then A4: dom F2() = 2 -tuples_on NAT by Th23; arity F3() = 2 by Def21; then A5: dom F3() = 2 -tuples_on NAT by Th23; A6: dom <:<*F2(),F3()*>:> = (dom F2()) /\ (dom F3()) by FINSEQ_3:142; hence (F1() * <:<*F2(),F3()*>:>) . <*i,j*> = F1() . (<:<*F2(),F3()*>:> . <*i,j*>) by A4, A5, FINSEQ_2:101, FUNCT_1:13 .= F1() . <*(F2() . <*i,j*>),(F3() . <*i,j*>)*> by A6, A4, A5, FINSEQ_2:101, FINSEQ_3:142 .= F1() . <*F5(i,j),(F3() . <*i,j*>)*> by A2 .= F1() . <*F5(i,j),F6(i,j)*> by A3 .= F4(F5(i,j),F6(i,j)) by A1 ; ::_thesis: verum end; theorem :: COMPUT_1:87 for i being Element of NAT holds [!] . <*i*> = i ! proof let i be Element of NAT ; ::_thesis: [!] . <*i*> = i ! defpred S2[ Element of NAT ] means [!] . <*$1*> = $1 ! ; deffunc H1( Element of NAT , Element of NAT ) -> Element of NAT = $2; deffunc H2( Element of NAT , Element of NAT ) -> Element of NAT = $1 * $2; deffunc H3( Element of NAT , Element of NAT ) -> Element of NAT = $1; deffunc H4( Element of NAT ) -> Element of NAT = $1 + 1; set g = [*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>; deffunc H5( Element of NAT , Element of NAT ) -> Element of NAT = H4(H3($1,$2)); A1: for i, j being Element of NAT holds (2 proj 1) . <*i,j*> = H3(i,j) proof let i, j be Element of NAT ; ::_thesis: (2 proj 1) . <*i,j*> = H3(i,j) reconsider ij = <*i,j*> as Element of 2 -tuples_on NAT by FINSEQ_2:101; thus (2 proj 1) . <*i,j*> = ij . 1 by Th38 .= i by FINSEQ_1:44 ; ::_thesis: verum end; A2: for i being Element of NAT holds (1 succ 1) . <*i*> = H4(i) proof let i be Element of NAT ; ::_thesis: (1 succ 1) . <*i*> = H4(i) reconsider ij = <*i*> as Element of 1 -tuples_on NAT by FINSEQ_2:131; thus (1 succ 1) . <*i*> = (ij /. 1) + 1 by Def7 .= i + 1 by FINSEQ_4:16 ; ::_thesis: verum end; for i, j being Element of NAT holds ((1 succ 1) * <:<*(2 proj 1)*>:>) . <*i,j*> = H4(H3(i,j)) from COMPUT_1:sch_1(A2, A1); then A3: for i, j being Element of NAT holds ((1 succ 1) * <:<*(2 proj 1)*>:>) . <*i,j*> = H5(i,j) ; A4: for i, j being Element of NAT holds (2 proj 2) . <*i,j*> = H1(i,j) proof let i, j be Element of NAT ; ::_thesis: (2 proj 2) . <*i,j*> = H1(i,j) reconsider ij = <*i,j*> as Element of 2 -tuples_on NAT by FINSEQ_2:101; thus (2 proj 2) . <*i,j*> = ij . 2 by Th38 .= j by FINSEQ_1:44 ; ::_thesis: verum end; A5: for i, j being Element of NAT holds [*] . <*i,j*> = H2(i,j) by Th86; A6: for i, j being Element of NAT holds ([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>) . <*i,j*> = H2(H5(i,j),H1(i,j)) from COMPUT_1:sch_2(A5, A3, A4); A7: arity (0 const 1) = 0 by Th32; A8: arity ([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>) = 2 by Def21; A9: now__::_thesis:_for_i_being_Element_of_NAT_st_S2[i]_holds_ S2[i_+_1] let i be Element of NAT ; ::_thesis: ( S2[i] implies S2[i + 1] ) reconsider ie = i ! as Element of NAT ; assume S2[i] ; ::_thesis: S2[i + 1] then [!] . <*(i + 1)*> = ([*] * <:<*((1 succ 1) * <:<*(2 proj 1)*>:>),(2 proj 2)*>:>) . <*i,ie*> by A8, A7, Th82 .= (i + 1) * ie by A6 .= (i + 1) ! by NEWTON:15 ; hence S2[i + 1] ; ::_thesis: verum end; 0 -tuples_on NAT = {{}} by Th5; then A10: {} in 0 -tuples_on NAT by TARSKI:def_1; [!] . <*0*> = (0 const 1) . {} by A7, Th80 .= 0 ! by A10, FUNCOP_1:7, NEWTON:12 ; then A11: S2[ 0 ] ; for i being Element of NAT holds S2[i] from NAT_1:sch_1(A11, A9); hence [!] . <*i*> = i ! ; ::_thesis: verum end; definition func [^] -> primitive-recursive 2 -ary Function equals :: COMPUT_1:def 26 primrec ((1 const 1),((1,2)->(1,?,2) [*]),2); coherence primrec ((1 const 1),((1,2)->(1,?,2) [*]),2) is primitive-recursive 2 -ary Function ; end; :: deftheorem defines [^] COMPUT_1:def_26_:_ [^] = primrec ((1 const 1),((1,2)->(1,?,2) [*]),2); theorem :: COMPUT_1:88 for i, j being Element of NAT holds [^] . <*i,j*> = i |^ j proof let i, j be Element of NAT ; ::_thesis: [^] . <*i,j*> = i |^ j defpred S2[ Element of NAT ] means [^] . <*i,$1*> = i |^ $1; A1: now__::_thesis:_for_j_being_Element_of_NAT_st_S2[j]_holds_ S2[j_+_1] let j be Element of NAT ; ::_thesis: ( S2[j] implies S2[j + 1] ) reconsider ij = i |^ j as Element of NAT ; assume S2[j] ; ::_thesis: S2[j + 1] then [^] . <*i,(j + 1)*> = ((1,2)->(1,?,2) [*]) . <*i,j,ij*> by Th81 .= [*] . <*i,ij*> by Th83 .= i * ij by Th86 .= i |^ (j + 1) by NEWTON:6 ; hence S2[j + 1] ; ::_thesis: verum end; reconsider ii = <*i*> as Element of 1 -tuples_on NAT by FINSEQ_2:131; [^] . <*i,0*> = (1 const 1) . ii by Th79 .= 1 by FUNCOP_1:7 .= i |^ 0 by NEWTON:4 ; then A2: S2[ 0 ] ; for j being Element of NAT holds S2[j] from NAT_1:sch_1(A2, A1); hence [^] . <*i,j*> = i |^ j ; ::_thesis: verum end; definition func [pred] -> primitive-recursive 1 -ary Function equals :: COMPUT_1:def 27 primrec ((0 const 0),(2 proj 1),1); coherence primrec ((0 const 0),(2 proj 1),1) is primitive-recursive 1 -ary Function ; end; :: deftheorem defines [pred] COMPUT_1:def_27_:_ [pred] = primrec ((0 const 0),(2 proj 1),1); theorem Th89: :: COMPUT_1:89 for i being Element of NAT holds ( [pred] . <*0*> = 0 & [pred] . <*(i + 1)*> = i ) proof let i be Element of NAT ; ::_thesis: ( [pred] . <*0*> = 0 & [pred] . <*(i + 1)*> = i ) 0 -tuples_on NAT = {{}} by Th5; then A1: {} in 0 -tuples_on NAT by TARSKI:def_1; defpred S2[ Element of NAT ] means [pred] . <*($1 + 1)*> = $1; reconsider p0 = <*0,0*> as Element of 2 -tuples_on NAT by FINSEQ_2:101; A2: arity (0 const 0) = 0 by Th32; A3: arity (2 proj 1) = 2 by Th37; A4: now__::_thesis:_for_i_being_Element_of_NAT_st_S2[i]_holds_ S2[i_+_1] let i be Element of NAT ; ::_thesis: ( S2[i] implies S2[i + 1] ) reconsider p0 = <*(i + 1),i*> as Element of 2 -tuples_on NAT by FINSEQ_2:101; assume S2[i] ; ::_thesis: S2[i + 1] then [pred] . <*((i + 1) + 1)*> = (2 proj 1) . p0 by A2, A3, Th82 .= <*(i + 1),i*> . 1 by Th38 .= i + 1 by FINSEQ_1:44 ; hence S2[i + 1] ; ::_thesis: verum end; thus [pred] . <*0*> = (0 const 0) . {} by A2, Th80 .= 0 by A1, FUNCOP_1:7 ; ::_thesis: [pred] . <*(i + 1)*> = i then [pred] . <*(0 + 1)*> = (2 proj 1) . p0 by A2, A3, Th82 .= <*0,0*> . 1 by Th38 .= 0 by FINSEQ_1:44 ; then A5: S2[ 0 ] ; for i being Element of NAT holds S2[i] from NAT_1:sch_1(A5, A4); hence [pred] . <*(i + 1)*> = i ; ::_thesis: verum end; definition func [-] -> primitive-recursive 2 -ary Function equals :: COMPUT_1:def 28 primrec ((1 proj 1),((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)),2); coherence primrec ((1 proj 1),((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)),2) is primitive-recursive 2 -ary Function ; end; :: deftheorem defines [-] COMPUT_1:def_28_:_ [-] = primrec ((1 proj 1),((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)),2); theorem :: COMPUT_1:90 for i, j being Element of NAT holds [-] . <*i,j*> = i -' j proof let i, j be Element of NAT ; ::_thesis: [-] . <*i,j*> = i -' j set F = <*(2 proj 2)*>; set g = [pred] * <:<*(2 proj 2)*>:>; rng <*(2 proj 2)*> c= PrimRec proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng <*(2 proj 2)*> or x in PrimRec ) assume x in rng <*(2 proj 2)*> ; ::_thesis: x in PrimRec then x in {(2 proj 2)} by FINSEQ_1:39; then x = 2 proj 2 by TARSKI:def_1; hence x in PrimRec by Def14; ::_thesis: verum end; then reconsider F = <*(2 proj 2)*> as with_the_same_arity FinSequence of PrimRec by FINSEQ_1:def_4; defpred S2[ Element of NAT ] means [-] . <*i,$1*> = i -' $1; A1: for i, j being Element of NAT holds ( ([pred] * <:<*(2 proj 2)*>:>) . <*i,0*> = 0 & ([pred] * <:<*(2 proj 2)*>:>) . <*i,(j + 1)*> = j ) proof let i, j be Element of NAT ; ::_thesis: ( ([pred] * <:<*(2 proj 2)*>:>) . <*i,0*> = 0 & ([pred] * <:<*(2 proj 2)*>:>) . <*i,(j + 1)*> = j ) reconsider i0 = <*i,0*> as Element of 2 -tuples_on NAT by FINSEQ_2:101; reconsider ij = <*i,(j + 1)*> as Element of 2 -tuples_on NAT by FINSEQ_2:101; A2: dom (2 proj 2) = 2 -tuples_on NAT by Th36; A3: dom <:F:> = dom (2 proj 2) by FINSEQ_3:141; hence ([pred] * <:<*(2 proj 2)*>:>) . <*i,0*> = [pred] . (<:F:> . i0) by A2, FUNCT_1:13 .= [pred] . <*((2 proj 2) . i0)*> by A2, FINSEQ_3:141 .= [pred] . <*(i0 . 2)*> by Th38 .= 0 by Th89, FINSEQ_1:44 ; ::_thesis: ([pred] * <:<*(2 proj 2)*>:>) . <*i,(j + 1)*> = j thus ([pred] * <:<*(2 proj 2)*>:>) . <*i,(j + 1)*> = [pred] . (<:F:> . ij) by A3, A2, FUNCT_1:13 .= [pred] . <*((2 proj 2) . ij)*> by A2, FINSEQ_3:141 .= [pred] . <*(ij . 2)*> by Th38 .= [pred] . <*(j + 1)*> by FINSEQ_1:44 .= j by Th89 ; ::_thesis: verum end; A4: now__::_thesis:_for_j_being_Element_of_NAT_st_S2[j]_holds_ S2[j_+_1] let j be Element of NAT ; ::_thesis: ( S2[j] implies S2[j + 1] ) assume A5: S2[j] ; ::_thesis: S2[j + 1] A6: now__::_thesis:_([pred]_*_<:<*(2_proj_2)*>:>)_._<*i,(i_-'_j)*>_=_i_-'_(j_+_1) percases ( i -' j = 0 or ex k being Nat st i -' j = k + 1 ) by NAT_1:6; supposeA7: i -' j = 0 ; ::_thesis: ([pred] * <:<*(2 proj 2)*>:>) . <*i,(i -' j)*> = i -' (j + 1) then i <= j by NAT_D:36; then i < j + 1 by NAT_1:13; then A8: i - (j + 1) < 0 by XREAL_1:49; thus ([pred] * <:<*(2 proj 2)*>:>) . <*i,(i -' j)*> = 0 by A1, A7 .= i -' (j + 1) by A8, XREAL_0:def_2 ; ::_thesis: verum end; suppose ex k being Nat st i -' j = k + 1 ; ::_thesis: ([pred] * <:<*(2 proj 2)*>:>) . <*i,(i -' j)*> = i -' (j + 1) then consider k being Nat such that A9: i -' j = k + 1 ; reconsider k = k as Element of NAT by ORDINAL1:def_12; i - j = k + 1 by A9, XREAL_0:def_2; then A10: i - (j + 1) = k ; thus ([pred] * <:<*(2 proj 2)*>:>) . <*i,(i -' j)*> = k by A1, A9 .= i -' (j + 1) by A10, XREAL_0:def_2 ; ::_thesis: verum end; end; end; [-] . <*i,(j + 1)*> = ((1,2)->(1,?,2) ([pred] * <:<*(2 proj 2)*>:>)) . <*i,j,([-] . <*i,j*>)*> by Th81 .= i -' (j + 1) by A5, A6, Th83 ; hence S2[j + 1] ; ::_thesis: verum end; reconsider ii = <*i*> as Element of 1 -tuples_on NAT by FINSEQ_2:98; [-] . <*i,0*> = (1 proj 1) . <*i*> by Th79 .= ii . 1 by Th38 .= i by FINSEQ_1:40 .= (i + 0) -' 0 by NAT_D:34 .= i -' 0 ; then A11: S2[ 0 ] ; for j being Element of NAT holds S2[j] from NAT_1:sch_1(A11, A4); hence [-] . <*i,j*> = i -' j ; ::_thesis: verum end;