Metamath Proof Explorer


Theorem mnd4g

Description: Commutative/associative law for commutative monoids, with an explicit commutativity hypothesis. (Contributed by Mario Carneiro, 21-Apr-2016)

Ref Expression
Hypotheses mndcl.b 𝐵 = ( Base ‘ 𝐺 )
mndcl.p + = ( +g𝐺 )
mnd4g.1 ( 𝜑𝐺 ∈ Mnd )
mnd4g.2 ( 𝜑𝑋𝐵 )
mnd4g.3 ( 𝜑𝑌𝐵 )
mnd4g.4 ( 𝜑𝑍𝐵 )
mnd4g.5 ( 𝜑𝑊𝐵 )
mnd4g.6 ( 𝜑 → ( 𝑌 + 𝑍 ) = ( 𝑍 + 𝑌 ) )
Assertion mnd4g ( 𝜑 → ( ( 𝑋 + 𝑌 ) + ( 𝑍 + 𝑊 ) ) = ( ( 𝑋 + 𝑍 ) + ( 𝑌 + 𝑊 ) ) )

Proof

Step Hyp Ref Expression
1 mndcl.b 𝐵 = ( Base ‘ 𝐺 )
2 mndcl.p + = ( +g𝐺 )
3 mnd4g.1 ( 𝜑𝐺 ∈ Mnd )
4 mnd4g.2 ( 𝜑𝑋𝐵 )
5 mnd4g.3 ( 𝜑𝑌𝐵 )
6 mnd4g.4 ( 𝜑𝑍𝐵 )
7 mnd4g.5 ( 𝜑𝑊𝐵 )
8 mnd4g.6 ( 𝜑 → ( 𝑌 + 𝑍 ) = ( 𝑍 + 𝑌 ) )
9 1 2 3 5 6 7 8 mnd12g ( 𝜑 → ( 𝑌 + ( 𝑍 + 𝑊 ) ) = ( 𝑍 + ( 𝑌 + 𝑊 ) ) )
10 9 oveq2d ( 𝜑 → ( 𝑋 + ( 𝑌 + ( 𝑍 + 𝑊 ) ) ) = ( 𝑋 + ( 𝑍 + ( 𝑌 + 𝑊 ) ) ) )
11 1 2 mndcl ( ( 𝐺 ∈ Mnd ∧ 𝑍𝐵𝑊𝐵 ) → ( 𝑍 + 𝑊 ) ∈ 𝐵 )
12 3 6 7 11 syl3anc ( 𝜑 → ( 𝑍 + 𝑊 ) ∈ 𝐵 )
13 1 2 mndass ( ( 𝐺 ∈ Mnd ∧ ( 𝑋𝐵𝑌𝐵 ∧ ( 𝑍 + 𝑊 ) ∈ 𝐵 ) ) → ( ( 𝑋 + 𝑌 ) + ( 𝑍 + 𝑊 ) ) = ( 𝑋 + ( 𝑌 + ( 𝑍 + 𝑊 ) ) ) )
14 3 4 5 12 13 syl13anc ( 𝜑 → ( ( 𝑋 + 𝑌 ) + ( 𝑍 + 𝑊 ) ) = ( 𝑋 + ( 𝑌 + ( 𝑍 + 𝑊 ) ) ) )
15 1 2 mndcl ( ( 𝐺 ∈ Mnd ∧ 𝑌𝐵𝑊𝐵 ) → ( 𝑌 + 𝑊 ) ∈ 𝐵 )
16 3 5 7 15 syl3anc ( 𝜑 → ( 𝑌 + 𝑊 ) ∈ 𝐵 )
17 1 2 mndass ( ( 𝐺 ∈ Mnd ∧ ( 𝑋𝐵𝑍𝐵 ∧ ( 𝑌 + 𝑊 ) ∈ 𝐵 ) ) → ( ( 𝑋 + 𝑍 ) + ( 𝑌 + 𝑊 ) ) = ( 𝑋 + ( 𝑍 + ( 𝑌 + 𝑊 ) ) ) )
18 3 4 6 16 17 syl13anc ( 𝜑 → ( ( 𝑋 + 𝑍 ) + ( 𝑌 + 𝑊 ) ) = ( 𝑋 + ( 𝑍 + ( 𝑌 + 𝑊 ) ) ) )
19 10 14 18 3eqtr4d ( 𝜑 → ( ( 𝑋 + 𝑌 ) + ( 𝑍 + 𝑊 ) ) = ( ( 𝑋 + 𝑍 ) + ( 𝑌 + 𝑊 ) ) )