Metamath Proof Explorer


Theorem mgmidmo

Description: A two-sided identity element is unique (if it exists) in any magma. (Contributed by Mario Carneiro, 7-Dec-2014) (Revised by NM, 17-Jun-2017)

Ref Expression
Assertion mgmidmo
|- E* u e. B A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x )

Proof

Step Hyp Ref Expression
1 simpl
 |-  ( ( ( u .+ x ) = x /\ ( x .+ u ) = x ) -> ( u .+ x ) = x )
2 1 ralimi
 |-  ( A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x ) -> A. x e. B ( u .+ x ) = x )
3 simpr
 |-  ( ( ( w .+ x ) = x /\ ( x .+ w ) = x ) -> ( x .+ w ) = x )
4 3 ralimi
 |-  ( A. x e. B ( ( w .+ x ) = x /\ ( x .+ w ) = x ) -> A. x e. B ( x .+ w ) = x )
5 oveq1
 |-  ( x = u -> ( x .+ w ) = ( u .+ w ) )
6 id
 |-  ( x = u -> x = u )
7 5 6 eqeq12d
 |-  ( x = u -> ( ( x .+ w ) = x <-> ( u .+ w ) = u ) )
8 7 rspcva
 |-  ( ( u e. B /\ A. x e. B ( x .+ w ) = x ) -> ( u .+ w ) = u )
9 oveq2
 |-  ( x = w -> ( u .+ x ) = ( u .+ w ) )
10 id
 |-  ( x = w -> x = w )
11 9 10 eqeq12d
 |-  ( x = w -> ( ( u .+ x ) = x <-> ( u .+ w ) = w ) )
12 11 rspcva
 |-  ( ( w e. B /\ A. x e. B ( u .+ x ) = x ) -> ( u .+ w ) = w )
13 8 12 sylan9req
 |-  ( ( ( u e. B /\ A. x e. B ( x .+ w ) = x ) /\ ( w e. B /\ A. x e. B ( u .+ x ) = x ) ) -> u = w )
14 13 an42s
 |-  ( ( ( u e. B /\ w e. B ) /\ ( A. x e. B ( u .+ x ) = x /\ A. x e. B ( x .+ w ) = x ) ) -> u = w )
15 14 ex
 |-  ( ( u e. B /\ w e. B ) -> ( ( A. x e. B ( u .+ x ) = x /\ A. x e. B ( x .+ w ) = x ) -> u = w ) )
16 2 4 15 syl2ani
 |-  ( ( u e. B /\ w e. B ) -> ( ( A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x ) /\ A. x e. B ( ( w .+ x ) = x /\ ( x .+ w ) = x ) ) -> u = w ) )
17 16 rgen2
 |-  A. u e. B A. w e. B ( ( A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x ) /\ A. x e. B ( ( w .+ x ) = x /\ ( x .+ w ) = x ) ) -> u = w )
18 oveq1
 |-  ( u = w -> ( u .+ x ) = ( w .+ x ) )
19 18 eqeq1d
 |-  ( u = w -> ( ( u .+ x ) = x <-> ( w .+ x ) = x ) )
20 19 ovanraleqv
 |-  ( u = w -> ( A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x ) <-> A. x e. B ( ( w .+ x ) = x /\ ( x .+ w ) = x ) ) )
21 20 rmo4
 |-  ( E* u e. B A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x ) <-> A. u e. B A. w e. B ( ( A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x ) /\ A. x e. B ( ( w .+ x ) = x /\ ( x .+ w ) = x ) ) -> u = w ) )
22 17 21 mpbir
 |-  E* u e. B A. x e. B ( ( u .+ x ) = x /\ ( x .+ u ) = x )