Metamath Proof Explorer


Theorem dmatcrng

Description: The subring of diagonal matrices (over a commutative ring) is a commutative ring . (Contributed by AV, 20-Aug-2019) (Revised by AV, 18-Dec-2019)

Ref Expression
Hypotheses dmatid.a 𝐴 = ( 𝑁 Mat 𝑅 )
dmatid.b 𝐵 = ( Base ‘ 𝐴 )
dmatid.0 0 = ( 0g𝑅 )
dmatid.d 𝐷 = ( 𝑁 DMat 𝑅 )
dmatcrng.c 𝐶 = ( 𝐴s 𝐷 )
Assertion dmatcrng ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → 𝐶 ∈ CRing )

Proof

Step Hyp Ref Expression
1 dmatid.a 𝐴 = ( 𝑁 Mat 𝑅 )
2 dmatid.b 𝐵 = ( Base ‘ 𝐴 )
3 dmatid.0 0 = ( 0g𝑅 )
4 dmatid.d 𝐷 = ( 𝑁 DMat 𝑅 )
5 dmatcrng.c 𝐶 = ( 𝐴s 𝐷 )
6 crngring ( 𝑅 ∈ CRing → 𝑅 ∈ Ring )
7 1 2 3 4 dmatsrng ( ( 𝑅 ∈ Ring ∧ 𝑁 ∈ Fin ) → 𝐷 ∈ ( SubRing ‘ 𝐴 ) )
8 6 7 sylan ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → 𝐷 ∈ ( SubRing ‘ 𝐴 ) )
9 5 subrgring ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → 𝐶 ∈ Ring )
10 8 9 syl ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → 𝐶 ∈ Ring )
11 simp1lr ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → 𝑅 ∈ CRing )
12 eqid ( Base ‘ 𝑅 ) = ( Base ‘ 𝑅 )
13 eqid ( Base ‘ 𝐴 ) = ( Base ‘ 𝐴 )
14 simp2 ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → 𝑎𝑁 )
15 simp3 ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → 𝑏𝑁 )
16 1 13 3 4 dmatmat ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) → ( 𝑥𝐷𝑥 ∈ ( Base ‘ 𝐴 ) ) )
17 16 imp ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ 𝑥𝐷 ) → 𝑥 ∈ ( Base ‘ 𝐴 ) )
18 17 adantrr ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → 𝑥 ∈ ( Base ‘ 𝐴 ) )
19 18 3ad2ant1 ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → 𝑥 ∈ ( Base ‘ 𝐴 ) )
20 1 12 13 14 15 19 matecld ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → ( 𝑎 𝑥 𝑏 ) ∈ ( Base ‘ 𝑅 ) )
21 1 13 3 4 dmatmat ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) → ( 𝑦𝐷𝑦 ∈ ( Base ‘ 𝐴 ) ) )
22 21 imp ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ 𝑦𝐷 ) → 𝑦 ∈ ( Base ‘ 𝐴 ) )
23 22 adantrl ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → 𝑦 ∈ ( Base ‘ 𝐴 ) )
24 23 3ad2ant1 ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → 𝑦 ∈ ( Base ‘ 𝐴 ) )
25 1 12 13 14 15 24 matecld ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → ( 𝑎 𝑦 𝑏 ) ∈ ( Base ‘ 𝑅 ) )
26 eqid ( .r𝑅 ) = ( .r𝑅 )
27 12 26 crngcom ( ( 𝑅 ∈ CRing ∧ ( 𝑎 𝑥 𝑏 ) ∈ ( Base ‘ 𝑅 ) ∧ ( 𝑎 𝑦 𝑏 ) ∈ ( Base ‘ 𝑅 ) ) → ( ( 𝑎 𝑥 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑦 𝑏 ) ) = ( ( 𝑎 𝑦 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑥 𝑏 ) ) )
28 11 20 25 27 syl3anc ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → ( ( 𝑎 𝑥 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑦 𝑏 ) ) = ( ( 𝑎 𝑦 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑥 𝑏 ) ) )
29 28 ifeq1d ( ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) ∧ 𝑎𝑁𝑏𝑁 ) → if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑥 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑦 𝑏 ) ) , 0 ) = if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑦 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑥 𝑏 ) ) , 0 ) )
30 29 mpoeq3dva ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → ( 𝑎𝑁 , 𝑏𝑁 ↦ if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑥 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑦 𝑏 ) ) , 0 ) ) = ( 𝑎𝑁 , 𝑏𝑁 ↦ if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑦 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑥 𝑏 ) ) , 0 ) ) )
31 6 anim2i ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) → ( 𝑁 ∈ Fin ∧ 𝑅 ∈ Ring ) )
32 1 2 3 4 dmatmul ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ Ring ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑎𝑁 , 𝑏𝑁 ↦ if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑥 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑦 𝑏 ) ) , 0 ) ) )
33 31 32 sylan ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑎𝑁 , 𝑏𝑁 ↦ if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑥 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑦 𝑏 ) ) , 0 ) ) )
34 pm3.22 ( ( 𝑥𝐷𝑦𝐷 ) → ( 𝑦𝐷𝑥𝐷 ) )
35 1 2 3 4 dmatmul ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ Ring ) ∧ ( 𝑦𝐷𝑥𝐷 ) ) → ( 𝑦 ( .r𝐴 ) 𝑥 ) = ( 𝑎𝑁 , 𝑏𝑁 ↦ if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑦 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑥 𝑏 ) ) , 0 ) ) )
36 31 34 35 syl2an ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → ( 𝑦 ( .r𝐴 ) 𝑥 ) = ( 𝑎𝑁 , 𝑏𝑁 ↦ if ( 𝑎 = 𝑏 , ( ( 𝑎 𝑦 𝑏 ) ( .r𝑅 ) ( 𝑎 𝑥 𝑏 ) ) , 0 ) ) )
37 30 33 36 3eqtr4d ( ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) ∧ ( 𝑥𝐷𝑦𝐷 ) ) → ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) )
38 37 ralrimivva ( ( 𝑁 ∈ Fin ∧ 𝑅 ∈ CRing ) → ∀ 𝑥𝐷𝑦𝐷 ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) )
39 38 ancoms ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → ∀ 𝑥𝐷𝑦𝐷 ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) )
40 5 subrgbas ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → 𝐷 = ( Base ‘ 𝐶 ) )
41 40 eqcomd ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( Base ‘ 𝐶 ) = 𝐷 )
42 eqid ( .r𝐴 ) = ( .r𝐴 )
43 5 42 ressmulr ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( .r𝐴 ) = ( .r𝐶 ) )
44 43 eqcomd ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( .r𝐶 ) = ( .r𝐴 ) )
45 44 oveqd ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑥 ( .r𝐴 ) 𝑦 ) )
46 44 oveqd ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( 𝑦 ( .r𝐶 ) 𝑥 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) )
47 45 46 eqeq12d ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑦 ( .r𝐶 ) 𝑥 ) ↔ ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) ) )
48 41 47 raleqbidv ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( ∀ 𝑦 ∈ ( Base ‘ 𝐶 ) ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑦 ( .r𝐶 ) 𝑥 ) ↔ ∀ 𝑦𝐷 ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) ) )
49 41 48 raleqbidv ( 𝐷 ∈ ( SubRing ‘ 𝐴 ) → ( ∀ 𝑥 ∈ ( Base ‘ 𝐶 ) ∀ 𝑦 ∈ ( Base ‘ 𝐶 ) ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑦 ( .r𝐶 ) 𝑥 ) ↔ ∀ 𝑥𝐷𝑦𝐷 ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) ) )
50 8 49 syl ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → ( ∀ 𝑥 ∈ ( Base ‘ 𝐶 ) ∀ 𝑦 ∈ ( Base ‘ 𝐶 ) ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑦 ( .r𝐶 ) 𝑥 ) ↔ ∀ 𝑥𝐷𝑦𝐷 ( 𝑥 ( .r𝐴 ) 𝑦 ) = ( 𝑦 ( .r𝐴 ) 𝑥 ) ) )
51 39 50 mpbird ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → ∀ 𝑥 ∈ ( Base ‘ 𝐶 ) ∀ 𝑦 ∈ ( Base ‘ 𝐶 ) ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑦 ( .r𝐶 ) 𝑥 ) )
52 eqid ( Base ‘ 𝐶 ) = ( Base ‘ 𝐶 )
53 eqid ( .r𝐶 ) = ( .r𝐶 )
54 52 53 iscrng2 ( 𝐶 ∈ CRing ↔ ( 𝐶 ∈ Ring ∧ ∀ 𝑥 ∈ ( Base ‘ 𝐶 ) ∀ 𝑦 ∈ ( Base ‘ 𝐶 ) ( 𝑥 ( .r𝐶 ) 𝑦 ) = ( 𝑦 ( .r𝐶 ) 𝑥 ) ) )
55 10 51 54 sylanbrc ( ( 𝑅 ∈ CRing ∧ 𝑁 ∈ Fin ) → 𝐶 ∈ CRing )