Metamath Proof Explorer


Theorem sseqf

Description: A strong recursive sequence is a function over the nonnegative integers. (Contributed by Thierry Arnoux, 23-Apr-2019) (Proof shortened by AV, 7-Mar-2022)

Ref Expression
Hypotheses sseqval.1 φ S V
sseqval.2 φ M Word S
sseqval.3 W = Word S . -1 M
sseqval.4 φ F : W S
Assertion sseqf φ M seq str F : 0 S

Proof

Step Hyp Ref Expression
1 sseqval.1 φ S V
2 sseqval.2 φ M Word S
3 sseqval.3 W = Word S . -1 M
4 sseqval.4 φ F : W S
5 wrdf M Word S M : 0 ..^ M S
6 2 5 syl φ M : 0 ..^ M S
7 vex w V
8 7 a1i φ w W w V
9 fvex x x 1 V
10 df-lsw lastS = x V x x 1
11 9 10 dmmpti dom lastS = V
12 8 11 eleqtrrdi φ w W w dom lastS
13 eldifsn w W w W w
14 inss1 Word S . -1 M Word S
15 3 14 eqsstri W Word S
16 15 sseli w W w Word S
17 lswcl w Word S w lastS w S
18 16 17 sylan w W w lastS w S
19 13 18 sylbi w W lastS w S
20 19 adantl φ w W lastS w S
21 12 20 jca φ w W w dom lastS lastS w S
22 21 ralrimiva φ w W w dom lastS lastS w S
23 9 10 fnmpti lastS Fn V
24 fnfun lastS Fn V Fun lastS
25 ffvresb Fun lastS lastS W : W S w W w dom lastS lastS w S
26 23 24 25 mp2b lastS W : W S w W w dom lastS lastS w S
27 22 26 sylibr φ lastS W : W S
28 eqid M = M
29 lencl M Word S M 0
30 29 nn0zd M Word S M
31 2 30 syl φ M
32 ovex M ++ ⟨“ F M ”⟩ V
33 simpr φ a M a M
34 2 29 syl φ M 0
35 34 adantr φ a M M 0
36 elnn0uz M 0 M 0
37 35 36 sylib φ a M M 0
38 uztrn a M M 0 a 0
39 33 37 38 syl2anc φ a M a 0
40 nn0uz 0 = 0
41 39 40 eleqtrrdi φ a M a 0
42 fvconst2g M ++ ⟨“ F M ”⟩ V a 0 0 × M ++ ⟨“ F M ”⟩ a = M ++ ⟨“ F M ”⟩
43 32 41 42 sylancr φ a M 0 × M ++ ⟨“ F M ”⟩ a = M ++ ⟨“ F M ”⟩
44 1 2 3 4 sseqmw φ M W
45 4 44 ffvelrnd φ F M S
46 45 s1cld φ ⟨“ F M ”⟩ Word S
47 ccatcl M Word S ⟨“ F M ”⟩ Word S M ++ ⟨“ F M ”⟩ Word S
48 2 46 47 syl2anc φ M ++ ⟨“ F M ”⟩ Word S
49 32 a1i φ M ++ ⟨“ F M ”⟩ V
50 ccatws1len M Word S M ++ ⟨“ F M ”⟩ = M + 1
51 2 50 syl φ M ++ ⟨“ F M ”⟩ = M + 1
52 uzid M M M
53 peano2uz M M M + 1 M
54 31 52 53 3syl φ M + 1 M
55 51 54 eqeltrd φ M ++ ⟨“ F M ”⟩ M
56 hashf . : V 0 +∞
57 ffn . : V 0 +∞ . Fn V
58 elpreima . Fn V M ++ ⟨“ F M ”⟩ . -1 M M ++ ⟨“ F M ”⟩ V M ++ ⟨“ F M ”⟩ M
59 56 57 58 mp2b M ++ ⟨“ F M ”⟩ . -1 M M ++ ⟨“ F M ”⟩ V M ++ ⟨“ F M ”⟩ M
60 49 55 59 sylanbrc φ M ++ ⟨“ F M ”⟩ . -1 M
61 48 60 elind φ M ++ ⟨“ F M ”⟩ Word S . -1 M
62 61 3 eleqtrrdi φ M ++ ⟨“ F M ”⟩ W
63 62 adantr φ a M M ++ ⟨“ F M ”⟩ W
64 ccatws1n0 M Word S M ++ ⟨“ F M ”⟩
65 2 64 syl φ M ++ ⟨“ F M ”⟩
66 65 adantr φ a M M ++ ⟨“ F M ”⟩
67 eldifsn M ++ ⟨“ F M ”⟩ W M ++ ⟨“ F M ”⟩ W M ++ ⟨“ F M ”⟩
68 63 66 67 sylanbrc φ a M M ++ ⟨“ F M ”⟩ W
69 43 68 eqeltrd φ a M 0 × M ++ ⟨“ F M ”⟩ a W
70 eqidd φ a W b W x V , y V x ++ ⟨“ F x ”⟩ = x V , y V x ++ ⟨“ F x ”⟩
71 simprl φ a W b W x = a y = b x = a
72 71 fveq2d φ a W b W x = a y = b F x = F a
73 72 s1eqd φ a W b W x = a y = b ⟨“ F x ”⟩ = ⟨“ F a ”⟩
74 71 73 oveq12d φ a W b W x = a y = b x ++ ⟨“ F x ”⟩ = a ++ ⟨“ F a ”⟩
75 vex a V
76 75 a1i φ a W b W a V
77 vex b V
78 77 a1i φ a W b W b V
79 ovex a ++ ⟨“ F a ”⟩ V
80 79 a1i φ a W b W a ++ ⟨“ F a ”⟩ V
81 70 74 76 78 80 ovmpod φ a W b W a x V , y V x ++ ⟨“ F x ”⟩ b = a ++ ⟨“ F a ”⟩
82 eldifi a W a W
83 82 ad2antrl φ a W b W a W
84 15 83 sseldi φ a W b W a Word S
85 4 adantr φ a W b W F : W S
86 85 83 ffvelrnd φ a W b W F a S
87 86 s1cld φ a W b W ⟨“ F a ”⟩ Word S
88 ccatcl a Word S ⟨“ F a ”⟩ Word S a ++ ⟨“ F a ”⟩ Word S
89 84 87 88 syl2anc φ a W b W a ++ ⟨“ F a ”⟩ Word S
90 15 82 sseldi a W a Word S
91 90 ad2antrl φ a W b W a Word S
92 ccatws1len a Word S a ++ ⟨“ F a ”⟩ = a + 1
93 91 92 syl φ a W b W a ++ ⟨“ F a ”⟩ = a + 1
94 83 3 eleqtrdi φ a W b W a Word S . -1 M
95 94 elin2d φ a W b W a . -1 M
96 elpreima . Fn V a . -1 M a V a M
97 56 57 96 mp2b a . -1 M a V a M
98 95 97 sylib φ a W b W a V a M
99 peano2uz a M a + 1 M
100 98 99 simpl2im φ a W b W a + 1 M
101 93 100 eqeltrd φ a W b W a ++ ⟨“ F a ”⟩ M
102 elpreima . Fn V a ++ ⟨“ F a ”⟩ . -1 M a ++ ⟨“ F a ”⟩ V a ++ ⟨“ F a ”⟩ M
103 56 57 102 mp2b a ++ ⟨“ F a ”⟩ . -1 M a ++ ⟨“ F a ”⟩ V a ++ ⟨“ F a ”⟩ M
104 80 101 103 sylanbrc φ a W b W a ++ ⟨“ F a ”⟩ . -1 M
105 89 104 elind φ a W b W a ++ ⟨“ F a ”⟩ Word S . -1 M
106 105 3 eleqtrrdi φ a W b W a ++ ⟨“ F a ”⟩ W
107 ccatws1n0 a Word S a ++ ⟨“ F a ”⟩
108 91 107 syl φ a W b W a ++ ⟨“ F a ”⟩
109 eldifsn a ++ ⟨“ F a ”⟩ W a ++ ⟨“ F a ”⟩ W a ++ ⟨“ F a ”⟩
110 106 108 109 sylanbrc φ a W b W a ++ ⟨“ F a ”⟩ W
111 81 110 eqeltrd φ a W b W a x V , y V x ++ ⟨“ F x ”⟩ b W
112 28 31 69 111 seqf φ seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : M W
113 fco2 lastS W : W S seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : M W lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : M S
114 27 112 113 syl2anc φ lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : M S
115 fzouzdisj 0 ..^ M M =
116 115 a1i φ 0 ..^ M M =
117 fun M : 0 ..^ M S lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : M S 0 ..^ M M = M lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : 0 ..^ M M S S
118 6 114 116 117 syl21anc φ M lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : 0 ..^ M M S S
119 1 2 3 4 sseqval φ M seq str F = M lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩
120 fzouzsplit M 0 0 = 0 ..^ M M
121 36 120 sylbi M 0 0 = 0 ..^ M M
122 2 29 121 3syl φ 0 = 0 ..^ M M
123 40 122 syl5eq φ 0 = 0 ..^ M M
124 unidm S S = S
125 124 a1i φ S S = S
126 125 eqcomd φ S = S S
127 119 123 126 feq123d φ M seq str F : 0 S M lastS seq M x V , y V x ++ ⟨“ F x ”⟩ 0 × M ++ ⟨“ F M ”⟩ : 0 ..^ M M S S
128 118 127 mpbird φ M seq str F : 0 S