Metamath Proof Explorer


Theorem signstfvn

Description: Zero-skipping sign in a word compared to a shorter word. (Contributed by Thierry Arnoux, 8-Oct-2018)

Ref Expression
Hypotheses signsv.p ˙ = a 1 0 1 , b 1 0 1 if b = 0 a b
signsv.w W = Base ndx 1 0 1 + ndx ˙
signsv.t T = f Word n 0 ..^ f W i = 0 n sgn f i
signsv.v V = f Word j 1 ..^ f if T f j T f j 1 1 0
Assertion signstfvn F Word K T F ++ ⟨“ K ”⟩ F = T F F 1 ˙ sgn K

Proof

Step Hyp Ref Expression
1 signsv.p ˙ = a 1 0 1 , b 1 0 1 if b = 0 a b
2 signsv.w W = Base ndx 1 0 1 + ndx ˙
3 signsv.t T = f Word n 0 ..^ f W i = 0 n sgn f i
4 signsv.v V = f Word j 1 ..^ f if T f j T f j 1 1 0
5 1 2 signswbase 1 0 1 = Base W
6 1 2 signswmnd W Mnd
7 6 a1i F Word K W Mnd
8 eldifi F Word F Word
9 lencl F Word F 0
10 8 9 syl F Word F 0
11 eldifsn F Word F Word F
12 hasheq0 F Word F = 0 F =
13 12 necon3bid F Word F 0 F
14 13 biimpar F Word F F 0
15 11 14 sylbi F Word F 0
16 elnnne0 F F 0 F 0
17 10 15 16 sylanbrc F Word F
18 17 adantr F Word K F
19 nnm1nn0 F F 1 0
20 18 19 syl F Word K F 1 0
21 nn0uz 0 = 0
22 20 21 eleqtrdi F Word K F 1 0
23 ccatws1cl F Word K F ++ ⟨“ K ”⟩ Word
24 23 adantr F Word K i 0 F 1 F ++ ⟨“ K ”⟩ Word
25 wrdf F ++ ⟨“ K ”⟩ Word F ++ ⟨“ K ”⟩ : 0 ..^ F ++ ⟨“ K ”⟩
26 24 25 syl F Word K i 0 F 1 F ++ ⟨“ K ”⟩ : 0 ..^ F ++ ⟨“ K ”⟩
27 9 nn0zd F Word F
28 fzoval F 0 ..^ F = 0 F 1
29 27 28 syl F Word 0 ..^ F = 0 F 1
30 29 adantr F Word K 0 ..^ F = 0 F 1
31 fzossfz 0 ..^ F 0 F
32 30 31 eqsstrrdi F Word K 0 F 1 0 F
33 s1cl K ⟨“ K ”⟩ Word
34 ccatlen F Word ⟨“ K ”⟩ Word F ++ ⟨“ K ”⟩ = F + ⟨“ K ”⟩
35 33 34 sylan2 F Word K F ++ ⟨“ K ”⟩ = F + ⟨“ K ”⟩
36 s1len ⟨“ K ”⟩ = 1
37 36 oveq2i F + ⟨“ K ”⟩ = F + 1
38 35 37 eqtrdi F Word K F ++ ⟨“ K ”⟩ = F + 1
39 38 oveq2d F Word K 0 ..^ F ++ ⟨“ K ”⟩ = 0 ..^ F + 1
40 27 adantr F Word K F
41 40 peano2zd F Word K F + 1
42 fzoval F + 1 0 ..^ F + 1 = 0 F + 1 - 1
43 41 42 syl F Word K 0 ..^ F + 1 = 0 F + 1 - 1
44 9 nn0cnd F Word F
45 1cnd F Word 1
46 44 45 pncand F Word F + 1 - 1 = F
47 46 adantr F Word K F + 1 - 1 = F
48 47 oveq2d F Word K 0 F + 1 - 1 = 0 F
49 39 43 48 3eqtrd F Word K 0 ..^ F ++ ⟨“ K ”⟩ = 0 F
50 32 49 sseqtrrd F Word K 0 F 1 0 ..^ F ++ ⟨“ K ”⟩
51 50 sselda F Word K i 0 F 1 i 0 ..^ F ++ ⟨“ K ”⟩
52 26 51 ffvelrnd F Word K i 0 F 1 F ++ ⟨“ K ”⟩ i
53 8 52 sylanl1 F Word K i 0 F 1 F ++ ⟨“ K ”⟩ i
54 53 rexrd F Word K i 0 F 1 F ++ ⟨“ K ”⟩ i *
55 sgncl F ++ ⟨“ K ”⟩ i * sgn F ++ ⟨“ K ”⟩ i 1 0 1
56 54 55 syl F Word K i 0 F 1 sgn F ++ ⟨“ K ”⟩ i 1 0 1
57 1 2 signswplusg ˙ = + W
58 rexr K K *
59 sgncl K * sgn K 1 0 1
60 58 59 syl K sgn K 1 0 1
61 60 adantl F Word K sgn K 1 0 1
62 id i = F - 1 + 1 i = F - 1 + 1
63 44 45 npcand F Word F - 1 + 1 = F
64 63 adantr F Word K F - 1 + 1 = F
65 62 64 sylan9eqr F Word K i = F - 1 + 1 i = F
66 65 fveq2d F Word K i = F - 1 + 1 F ++ ⟨“ K ”⟩ i = F ++ ⟨“ K ”⟩ F
67 ccatws1ls F Word K F ++ ⟨“ K ”⟩ F = K
68 67 adantr F Word K i = F - 1 + 1 F ++ ⟨“ K ”⟩ F = K
69 66 68 eqtrd F Word K i = F - 1 + 1 F ++ ⟨“ K ”⟩ i = K
70 8 69 sylanl1 F Word K i = F - 1 + 1 F ++ ⟨“ K ”⟩ i = K
71 70 fveq2d F Word K i = F - 1 + 1 sgn F ++ ⟨“ K ”⟩ i = sgn K
72 5 7 22 56 57 61 71 gsumnunsn F Word K W i = 0 F - 1 + 1 sgn F ++ ⟨“ K ”⟩ i = W i = 0 F 1 sgn F ++ ⟨“ K ”⟩ i ˙ sgn K
73 8 63 syl F Word F - 1 + 1 = F
74 73 adantr F Word K F - 1 + 1 = F
75 74 oveq2d F Word K 0 F - 1 + 1 = 0 F
76 75 mpteq1d F Word K i 0 F - 1 + 1 sgn F ++ ⟨“ K ”⟩ i = i 0 F sgn F ++ ⟨“ K ”⟩ i
77 76 oveq2d F Word K W i = 0 F - 1 + 1 sgn F ++ ⟨“ K ”⟩ i = W i = 0 F sgn F ++ ⟨“ K ”⟩ i
78 simpll F Word K i 0 F 1 F Word
79 33 ad2antlr F Word K i 0 F 1 ⟨“ K ”⟩ Word
80 30 eleq2d F Word K i 0 ..^ F i 0 F 1
81 80 biimpar F Word K i 0 F 1 i 0 ..^ F
82 ccatval1 F Word ⟨“ K ”⟩ Word i 0 ..^ F F ++ ⟨“ K ”⟩ i = F i
83 78 79 81 82 syl3anc F Word K i 0 F 1 F ++ ⟨“ K ”⟩ i = F i
84 83 fveq2d F Word K i 0 F 1 sgn F ++ ⟨“ K ”⟩ i = sgn F i
85 84 mpteq2dva F Word K i 0 F 1 sgn F ++ ⟨“ K ”⟩ i = i 0 F 1 sgn F i
86 8 85 sylan F Word K i 0 F 1 sgn F ++ ⟨“ K ”⟩ i = i 0 F 1 sgn F i
87 86 oveq2d F Word K W i = 0 F 1 sgn F ++ ⟨“ K ”⟩ i = W i = 0 F 1 sgn F i
88 87 oveq1d F Word K W i = 0 F 1 sgn F ++ ⟨“ K ”⟩ i ˙ sgn K = W i = 0 F 1 sgn F i ˙ sgn K
89 72 77 88 3eqtr3d F Word K W i = 0 F sgn F ++ ⟨“ K ”⟩ i = W i = 0 F 1 sgn F i ˙ sgn K
90 eqid F = F
91 90 olci F 0 ..^ F F = F
92 9 21 eleqtrdi F Word F 0
93 fzosplitsni F 0 F 0 ..^ F + 1 F 0 ..^ F F = F
94 92 93 syl F Word F 0 ..^ F + 1 F 0 ..^ F F = F
95 91 94 mpbiri F Word F 0 ..^ F + 1
96 95 adantr F Word K F 0 ..^ F + 1
97 96 39 eleqtrrd F Word K F 0 ..^ F ++ ⟨“ K ”⟩
98 1 2 3 4 signstfval F ++ ⟨“ K ”⟩ Word F 0 ..^ F ++ ⟨“ K ”⟩ T F ++ ⟨“ K ”⟩ F = W i = 0 F sgn F ++ ⟨“ K ”⟩ i
99 23 97 98 syl2anc F Word K T F ++ ⟨“ K ”⟩ F = W i = 0 F sgn F ++ ⟨“ K ”⟩ i
100 8 99 sylan F Word K T F ++ ⟨“ K ”⟩ F = W i = 0 F sgn F ++ ⟨“ K ”⟩ i
101 fzo0end F F 1 0 ..^ F
102 17 101 syl F Word F 1 0 ..^ F
103 1 2 3 4 signstfval F Word F 1 0 ..^ F T F F 1 = W i = 0 F 1 sgn F i
104 8 102 103 syl2anc F Word T F F 1 = W i = 0 F 1 sgn F i
105 104 adantr F Word K T F F 1 = W i = 0 F 1 sgn F i
106 105 oveq1d F Word K T F F 1 ˙ sgn K = W i = 0 F 1 sgn F i ˙ sgn K
107 89 100 106 3eqtr4d F Word K T F ++ ⟨“ K ”⟩ F = T F F 1 ˙ sgn K