Metamath Proof Explorer


Theorem opifismgm

Description: A structure with a group addition operation expressed by a conditional operator is a magma if both values of the conditional operator are contained in the base set. (Contributed by AV, 9-Feb-2020)

Ref Expression
Hypotheses opifismgm.b 𝐵 = ( Base ‘ 𝑀 )
opifismgm.p ( +g𝑀 ) = ( 𝑥𝐵 , 𝑦𝐵 ↦ if ( 𝜓 , 𝐶 , 𝐷 ) )
opifismgm.n ( 𝜑𝐵 ≠ ∅ )
opifismgm.c ( ( 𝜑 ∧ ( 𝑥𝐵𝑦𝐵 ) ) → 𝐶𝐵 )
opifismgm.d ( ( 𝜑 ∧ ( 𝑥𝐵𝑦𝐵 ) ) → 𝐷𝐵 )
Assertion opifismgm ( 𝜑𝑀 ∈ Mgm )

Proof

Step Hyp Ref Expression
1 opifismgm.b 𝐵 = ( Base ‘ 𝑀 )
2 opifismgm.p ( +g𝑀 ) = ( 𝑥𝐵 , 𝑦𝐵 ↦ if ( 𝜓 , 𝐶 , 𝐷 ) )
3 opifismgm.n ( 𝜑𝐵 ≠ ∅ )
4 opifismgm.c ( ( 𝜑 ∧ ( 𝑥𝐵𝑦𝐵 ) ) → 𝐶𝐵 )
5 opifismgm.d ( ( 𝜑 ∧ ( 𝑥𝐵𝑦𝐵 ) ) → 𝐷𝐵 )
6 4 5 ifcld ( ( 𝜑 ∧ ( 𝑥𝐵𝑦𝐵 ) ) → if ( 𝜓 , 𝐶 , 𝐷 ) ∈ 𝐵 )
7 6 ralrimivva ( 𝜑 → ∀ 𝑥𝐵𝑦𝐵 if ( 𝜓 , 𝐶 , 𝐷 ) ∈ 𝐵 )
8 7 adantr ( ( 𝜑 ∧ ( 𝑎𝐵𝑏𝐵 ) ) → ∀ 𝑥𝐵𝑦𝐵 if ( 𝜓 , 𝐶 , 𝐷 ) ∈ 𝐵 )
9 simprl ( ( 𝜑 ∧ ( 𝑎𝐵𝑏𝐵 ) ) → 𝑎𝐵 )
10 simprr ( ( 𝜑 ∧ ( 𝑎𝐵𝑏𝐵 ) ) → 𝑏𝐵 )
11 2 ovmpoelrn ( ( ∀ 𝑥𝐵𝑦𝐵 if ( 𝜓 , 𝐶 , 𝐷 ) ∈ 𝐵𝑎𝐵𝑏𝐵 ) → ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 )
12 8 9 10 11 syl3anc ( ( 𝜑 ∧ ( 𝑎𝐵𝑏𝐵 ) ) → ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 )
13 12 ralrimivva ( 𝜑 → ∀ 𝑎𝐵𝑏𝐵 ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 )
14 n0 ( 𝐵 ≠ ∅ ↔ ∃ 𝑥 𝑥𝐵 )
15 eqid ( +g𝑀 ) = ( +g𝑀 )
16 1 15 ismgmn0 ( 𝑥𝐵 → ( 𝑀 ∈ Mgm ↔ ∀ 𝑎𝐵𝑏𝐵 ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 ) )
17 16 exlimiv ( ∃ 𝑥 𝑥𝐵 → ( 𝑀 ∈ Mgm ↔ ∀ 𝑎𝐵𝑏𝐵 ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 ) )
18 14 17 sylbi ( 𝐵 ≠ ∅ → ( 𝑀 ∈ Mgm ↔ ∀ 𝑎𝐵𝑏𝐵 ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 ) )
19 3 18 syl ( 𝜑 → ( 𝑀 ∈ Mgm ↔ ∀ 𝑎𝐵𝑏𝐵 ( 𝑎 ( +g𝑀 ) 𝑏 ) ∈ 𝐵 ) )
20 13 19 mpbird ( 𝜑𝑀 ∈ Mgm )