Metamath Proof Explorer


Theorem mnd12g

Description: Commutative/associative law for 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 ( 𝜑𝑍𝐵 )
mnd12g.5 ( 𝜑 → ( 𝑋 + 𝑌 ) = ( 𝑌 + 𝑋 ) )
Assertion mnd12g ( 𝜑 → ( 𝑋 + ( 𝑌 + 𝑍 ) ) = ( 𝑌 + ( 𝑋 + 𝑍 ) ) )

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 mnd12g.5 ( 𝜑 → ( 𝑋 + 𝑌 ) = ( 𝑌 + 𝑋 ) )
8 7 oveq1d ( 𝜑 → ( ( 𝑋 + 𝑌 ) + 𝑍 ) = ( ( 𝑌 + 𝑋 ) + 𝑍 ) )
9 1 2 mndass ( ( 𝐺 ∈ Mnd ∧ ( 𝑋𝐵𝑌𝐵𝑍𝐵 ) ) → ( ( 𝑋 + 𝑌 ) + 𝑍 ) = ( 𝑋 + ( 𝑌 + 𝑍 ) ) )
10 3 4 5 6 9 syl13anc ( 𝜑 → ( ( 𝑋 + 𝑌 ) + 𝑍 ) = ( 𝑋 + ( 𝑌 + 𝑍 ) ) )
11 1 2 mndass ( ( 𝐺 ∈ Mnd ∧ ( 𝑌𝐵𝑋𝐵𝑍𝐵 ) ) → ( ( 𝑌 + 𝑋 ) + 𝑍 ) = ( 𝑌 + ( 𝑋 + 𝑍 ) ) )
12 3 5 4 6 11 syl13anc ( 𝜑 → ( ( 𝑌 + 𝑋 ) + 𝑍 ) = ( 𝑌 + ( 𝑋 + 𝑍 ) ) )
13 8 10 12 3eqtr3d ( 𝜑 → ( 𝑋 + ( 𝑌 + 𝑍 ) ) = ( 𝑌 + ( 𝑋 + 𝑍 ) ) )