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 ˙=a101,b101ifb=0ab
signsv.w W=Basendx101+ndx˙
signsv.t T=fWordn0..^fWi=0nsgnfi
signsv.v V=fWordj1..^fifTfjTfj110
Assertion signstfvn FWordKTF++⟨“K”⟩F=TFF1˙sgnK

Proof

Step Hyp Ref Expression
1 signsv.p ˙=a101,b101ifb=0ab
2 signsv.w W=Basendx101+ndx˙
3 signsv.t T=fWordn0..^fWi=0nsgnfi
4 signsv.v V=fWordj1..^fifTfjTfj110
5 1 2 signswbase 101=BaseW
6 1 2 signswmnd WMnd
7 6 a1i FWordKWMnd
8 eldifi FWordFWord
9 lencl FWordF0
10 8 9 syl FWordF0
11 eldifsn FWordFWordF
12 hasheq0 FWordF=0F=
13 12 necon3bid FWordF0F
14 13 biimpar FWordFF0
15 11 14 sylbi FWordF0
16 elnnne0 FF0F0
17 10 15 16 sylanbrc FWordF
18 17 adantr FWordKF
19 nnm1nn0 FF10
20 18 19 syl FWordKF10
21 nn0uz 0=0
22 20 21 eleqtrdi FWordKF10
23 ccatws1cl FWordKF++⟨“K”⟩Word
24 23 adantr FWordKi0F1F++⟨“K”⟩Word
25 wrdf F++⟨“K”⟩WordF++⟨“K”⟩:0..^F++⟨“K”⟩
26 24 25 syl FWordKi0F1F++⟨“K”⟩:0..^F++⟨“K”⟩
27 9 nn0zd FWordF
28 fzoval F0..^F=0F1
29 27 28 syl FWord0..^F=0F1
30 29 adantr FWordK0..^F=0F1
31 fzossfz 0..^F0F
32 30 31 eqsstrrdi FWordK0F10F
33 s1cl K⟨“K”⟩Word
34 ccatlen FWord⟨“K”⟩WordF++⟨“K”⟩=F+⟨“K”⟩
35 33 34 sylan2 FWordKF++⟨“K”⟩=F+⟨“K”⟩
36 s1len ⟨“K”⟩=1
37 36 oveq2i F+⟨“K”⟩=F+1
38 35 37 eqtrdi FWordKF++⟨“K”⟩=F+1
39 38 oveq2d FWordK0..^F++⟨“K”⟩=0..^F+1
40 27 adantr FWordKF
41 40 peano2zd FWordKF+1
42 fzoval F+10..^F+1=0F+1-1
43 41 42 syl FWordK0..^F+1=0F+1-1
44 9 nn0cnd FWordF
45 1cnd FWord1
46 44 45 pncand FWordF+1-1=F
47 46 adantr FWordKF+1-1=F
48 47 oveq2d FWordK0F+1-1=0F
49 39 43 48 3eqtrd FWordK0..^F++⟨“K”⟩=0F
50 32 49 sseqtrrd FWordK0F10..^F++⟨“K”⟩
51 50 sselda FWordKi0F1i0..^F++⟨“K”⟩
52 26 51 ffvelcdmd FWordKi0F1F++⟨“K”⟩i
53 8 52 sylanl1 FWordKi0F1F++⟨“K”⟩i
54 53 rexrd FWordKi0F1F++⟨“K”⟩i*
55 sgncl F++⟨“K”⟩i*sgnF++⟨“K”⟩i101
56 54 55 syl FWordKi0F1sgnF++⟨“K”⟩i101
57 1 2 signswplusg ˙=+W
58 rexr KK*
59 sgncl K*sgnK101
60 58 59 syl KsgnK101
61 60 adantl FWordKsgnK101
62 id i=F-1+1i=F-1+1
63 44 45 npcand FWordF-1+1=F
64 63 adantr FWordKF-1+1=F
65 62 64 sylan9eqr FWordKi=F-1+1i=F
66 65 fveq2d FWordKi=F-1+1F++⟨“K”⟩i=F++⟨“K”⟩F
67 ccatws1ls FWordKF++⟨“K”⟩F=K
68 67 adantr FWordKi=F-1+1F++⟨“K”⟩F=K
69 66 68 eqtrd FWordKi=F-1+1F++⟨“K”⟩i=K
70 8 69 sylanl1 FWordKi=F-1+1F++⟨“K”⟩i=K
71 70 fveq2d FWordKi=F-1+1sgnF++⟨“K”⟩i=sgnK
72 5 7 22 56 57 61 71 gsumnunsn FWordKWi=0F-1+1sgnF++⟨“K”⟩i=Wi=0F1sgnF++⟨“K”⟩i˙sgnK
73 8 63 syl FWordF-1+1=F
74 73 adantr FWordKF-1+1=F
75 74 oveq2d FWordK0F-1+1=0F
76 75 mpteq1d FWordKi0F-1+1sgnF++⟨“K”⟩i=i0FsgnF++⟨“K”⟩i
77 76 oveq2d FWordKWi=0F-1+1sgnF++⟨“K”⟩i=Wi=0FsgnF++⟨“K”⟩i
78 simpll FWordKi0F1FWord
79 33 ad2antlr FWordKi0F1⟨“K”⟩Word
80 30 eleq2d FWordKi0..^Fi0F1
81 80 biimpar FWordKi0F1i0..^F
82 ccatval1 FWord⟨“K”⟩Wordi0..^FF++⟨“K”⟩i=Fi
83 78 79 81 82 syl3anc FWordKi0F1F++⟨“K”⟩i=Fi
84 83 fveq2d FWordKi0F1sgnF++⟨“K”⟩i=sgnFi
85 84 mpteq2dva FWordKi0F1sgnF++⟨“K”⟩i=i0F1sgnFi
86 8 85 sylan FWordKi0F1sgnF++⟨“K”⟩i=i0F1sgnFi
87 86 oveq2d FWordKWi=0F1sgnF++⟨“K”⟩i=Wi=0F1sgnFi
88 87 oveq1d FWordKWi=0F1sgnF++⟨“K”⟩i˙sgnK=Wi=0F1sgnFi˙sgnK
89 72 77 88 3eqtr3d FWordKWi=0FsgnF++⟨“K”⟩i=Wi=0F1sgnFi˙sgnK
90 eqid F=F
91 90 olci F0..^FF=F
92 9 21 eleqtrdi FWordF0
93 fzosplitsni F0F0..^F+1F0..^FF=F
94 92 93 syl FWordF0..^F+1F0..^FF=F
95 91 94 mpbiri FWordF0..^F+1
96 95 adantr FWordKF0..^F+1
97 96 39 eleqtrrd FWordKF0..^F++⟨“K”⟩
98 1 2 3 4 signstfval F++⟨“K”⟩WordF0..^F++⟨“K”⟩TF++⟨“K”⟩F=Wi=0FsgnF++⟨“K”⟩i
99 23 97 98 syl2anc FWordKTF++⟨“K”⟩F=Wi=0FsgnF++⟨“K”⟩i
100 8 99 sylan FWordKTF++⟨“K”⟩F=Wi=0FsgnF++⟨“K”⟩i
101 fzo0end FF10..^F
102 17 101 syl FWordF10..^F
103 1 2 3 4 signstfval FWordF10..^FTFF1=Wi=0F1sgnFi
104 8 102 103 syl2anc FWordTFF1=Wi=0F1sgnFi
105 104 adantr FWordKTFF1=Wi=0F1sgnFi
106 105 oveq1d FWordKTFF1˙sgnK=Wi=0F1sgnFi˙sgnK
107 89 100 106 3eqtr4d FWordKTF++⟨“K”⟩F=TFF1˙sgnK