Metamath Proof Explorer


Theorem frmdmnd

Description: A free monoid is a monoid. (Contributed by Mario Carneiro, 27-Sep-2015) (Revised by Mario Carneiro, 27-Feb-2016)

Ref Expression
Hypothesis frmdmnd.m ⊢ M = freeMnd ⁡ I
Assertion frmdmnd ⊢ I ∈ V → M ∈ Mnd

Proof

Step Hyp Ref Expression
1 frmdmnd.m ⊢ M = freeMnd ⁡ I
2 eqidd ⊢ I ∈ V → Base M = Base M
3 eqidd ⊢ I ∈ V → + M = + M
4 eqid ⊢ Base M = Base M
5 eqid ⊢ + M = + M
6 1 4 5 frmdadd ⊢ x ∈ Base M ∧ y ∈ Base M → x + M y = x ++ y
7 1 4 frmdelbas ⊢ x ∈ Base M → x ∈ Word I
8 1 4 frmdelbas ⊢ y ∈ Base M → y ∈ Word I
9 ccatcl ⊢ x ∈ Word I ∧ y ∈ Word I → x ++ y ∈ Word I
10 7 8 9 syl2an ⊢ x ∈ Base M ∧ y ∈ Base M → x ++ y ∈ Word I
11 6 10 eqeltrd ⊢ x ∈ Base M ∧ y ∈ Base M → x + M y ∈ Word I
12 11 3adant1 ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M → x + M y ∈ Word I
13 1 4 frmdbas ⊢ I ∈ V → Base M = Word I
14 13 3ad2ant1 ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M → Base M = Word I
15 12 14 eleqtrrd ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M → x + M y ∈ Base M
16 simpr1 ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ∈ Base M
17 16 7 syl ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ∈ Word I
18 simpr2 ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → y ∈ Base M
19 18 8 syl ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → y ∈ Word I
20 simpr3 ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → z ∈ Base M
21 1 4 frmdelbas ⊢ z ∈ Base M → z ∈ Word I
22 20 21 syl ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → z ∈ Word I
23 ccatass ⊢ x ∈ Word I ∧ y ∈ Word I ∧ z ∈ Word I → x ++ y ++ z = x ++ y ++ z
24 17 19 22 23 syl3anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ++ y ++ z = x ++ y ++ z
25 16 18 10 syl2anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ++ y ∈ Word I
26 13 adantr ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → Base M = Word I
27 25 26 eleqtrrd ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ++ y ∈ Base M
28 1 4 5 frmdadd ⊢ x ++ y ∈ Base M ∧ z ∈ Base M → x ++ y + M z = x ++ y ++ z
29 27 20 28 syl2anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ++ y + M z = x ++ y ++ z
30 ccatcl ⊢ y ∈ Word I ∧ z ∈ Word I → y ++ z ∈ Word I
31 19 22 30 syl2anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → y ++ z ∈ Word I
32 31 26 eleqtrrd ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → y ++ z ∈ Base M
33 1 4 5 frmdadd ⊢ x ∈ Base M ∧ y ++ z ∈ Base M → x + M y ++ z = x ++ y ++ z
34 16 32 33 syl2anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x + M y ++ z = x ++ y ++ z
35 24 29 34 3eqtr4d ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x ++ y + M z = x + M y ++ z
36 16 18 6 syl2anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x + M y = x ++ y
37 36 oveq1d ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x + M y + M z = x ++ y + M z
38 1 4 5 frmdadd ⊢ y ∈ Base M ∧ z ∈ Base M → y + M z = y ++ z
39 18 20 38 syl2anc ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → y + M z = y ++ z
40 39 oveq2d ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x + M y + M z = x + M y ++ z
41 35 37 40 3eqtr4d ⊢ I ∈ V ∧ x ∈ Base M ∧ y ∈ Base M ∧ z ∈ Base M → x + M y + M z = x + M y + M z
42 wrd0 ⊢ ∅ ∈ Word I
43 42 13 eleqtrrid ⊢ I ∈ V → ∅ ∈ Base M
44 1 4 5 frmdadd ⊢ ∅ ∈ Base M ∧ x ∈ Base M → ∅ + M x = ∅ ++ x
45 43 44 sylan ⊢ I ∈ V ∧ x ∈ Base M → ∅ + M x = ∅ ++ x
46 7 adantl ⊢ I ∈ V ∧ x ∈ Base M → x ∈ Word I
47 ccatlid ⊢ x ∈ Word I → ∅ ++ x = x
48 46 47 syl ⊢ I ∈ V ∧ x ∈ Base M → ∅ ++ x = x
49 45 48 eqtrd ⊢ I ∈ V ∧ x ∈ Base M → ∅ + M x = x
50 1 4 5 frmdadd ⊢ x ∈ Base M ∧ ∅ ∈ Base M → x + M ∅ = x ++ ∅
51 50 ancoms ⊢ ∅ ∈ Base M ∧ x ∈ Base M → x + M ∅ = x ++ ∅
52 43 51 sylan ⊢ I ∈ V ∧ x ∈ Base M → x + M ∅ = x ++ ∅
53 ccatrid ⊢ x ∈ Word I → x ++ ∅ = x
54 46 53 syl ⊢ I ∈ V ∧ x ∈ Base M → x ++ ∅ = x
55 52 54 eqtrd ⊢ I ∈ V ∧ x ∈ Base M → x + M ∅ = x
56 2 3 15 41 43 49 55 ismndd ⊢ I ∈ V → M ∈ Mnd