Metamath Proof Explorer


Theorem lswn0

Description: The last symbol of a not empty word exists. The empty set must be excluded as symbol, because otherwise, it cannot be distinguished between valid cases ( (/) is the last symbol) and invalid cases ( (/) means that no last symbol exists. This is because of the special definition of a function in set.mm. (Contributed by Alexander van der Vekens, 18-Mar-2018)

Ref Expression
Assertion lswn0 WWordVVW0lastSW

Proof

Step Hyp Ref Expression
1 lsw WWordVlastSW=WW1
2 1 3ad2ant1 WWordVVW0lastSW=WW1
3 wrdf WWordVW:0..^WV
4 lencl WWordVW0
5 simpll W:0..^WVW0W0W:0..^WV
6 elnnne0 WW0W0
7 6 biimpri W0W0W
8 nnm1nn0 WW10
9 7 8 syl W0W0W10
10 nn0re W0W
11 10 ltm1d W0W1<W
12 11 adantr W0W0W1<W
13 elfzo0 W10..^WW10WW1<W
14 9 7 12 13 syl3anbrc W0W0W10..^W
15 14 adantll W:0..^WVW0W0W10..^W
16 5 15 ffvelcdmd W:0..^WVW0W0WW1V
17 16 ex W:0..^WVW0W0WW1V
18 3 4 17 syl2anc WWordVW0WW1V
19 eleq1a WW1V=WW1V
20 19 com12 =WW1WW1VV
21 20 eqcoms WW1=WW1VV
22 21 com12 WW1VWW1=V
23 nnel ¬VV
24 22 23 imbitrrdi WW1VWW1=¬V
25 24 necon2ad WW1VVWW1
26 18 25 syl6 WWordVW0VWW1
27 26 com23 WWordVVW0WW1
28 27 3imp WWordVVW0WW1
29 2 28 eqnetrd WWordVVW0lastSW