Metamath Proof Explorer


Theorem marrepval

Description: Third substitution for the definition of the matrix row replacement function. (Contributed by AV, 12-Feb-2019)

Ref Expression
Hypotheses marrepfval.a 𝐴 = ( 𝑁 Mat 𝑅 )
marrepfval.b 𝐵 = ( Base ‘ 𝐴 )
marrepfval.q 𝑄 = ( 𝑁 matRRep 𝑅 )
marrepfval.z 0 = ( 0g𝑅 )
Assertion marrepval ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) → ( 𝐾 ( 𝑀 𝑄 𝑆 ) 𝐿 ) = ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝐾 , if ( 𝑗 = 𝐿 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) )

Proof

Step Hyp Ref Expression
1 marrepfval.a 𝐴 = ( 𝑁 Mat 𝑅 )
2 marrepfval.b 𝐵 = ( Base ‘ 𝐴 )
3 marrepfval.q 𝑄 = ( 𝑁 matRRep 𝑅 )
4 marrepfval.z 0 = ( 0g𝑅 )
5 1 2 3 4 marrepval0 ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) → ( 𝑀 𝑄 𝑆 ) = ( 𝑘𝑁 , 𝑙𝑁 ↦ ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) ) )
6 5 adantr ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) → ( 𝑀 𝑄 𝑆 ) = ( 𝑘𝑁 , 𝑙𝑁 ↦ ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) ) )
7 simprl ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) → 𝐾𝑁 )
8 simplrr ( ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) ∧ 𝑘 = 𝐾 ) → 𝐿𝑁 )
9 1 2 matrcl ( 𝑀𝐵 → ( 𝑁 ∈ Fin ∧ 𝑅 ∈ V ) )
10 9 simpld ( 𝑀𝐵𝑁 ∈ Fin )
11 10 10 jca ( 𝑀𝐵 → ( 𝑁 ∈ Fin ∧ 𝑁 ∈ Fin ) )
12 11 ad3antrrr ( ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) ∧ ( 𝑘 = 𝐾𝑙 = 𝐿 ) ) → ( 𝑁 ∈ Fin ∧ 𝑁 ∈ Fin ) )
13 mpoexga ( ( 𝑁 ∈ Fin ∧ 𝑁 ∈ Fin ) → ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) ∈ V )
14 12 13 syl ( ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) ∧ ( 𝑘 = 𝐾𝑙 = 𝐿 ) ) → ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) ∈ V )
15 eqeq2 ( 𝑘 = 𝐾 → ( 𝑖 = 𝑘𝑖 = 𝐾 ) )
16 15 adantr ( ( 𝑘 = 𝐾𝑙 = 𝐿 ) → ( 𝑖 = 𝑘𝑖 = 𝐾 ) )
17 eqeq2 ( 𝑙 = 𝐿 → ( 𝑗 = 𝑙𝑗 = 𝐿 ) )
18 17 ifbid ( 𝑙 = 𝐿 → if ( 𝑗 = 𝑙 , 𝑆 , 0 ) = if ( 𝑗 = 𝐿 , 𝑆 , 0 ) )
19 18 adantl ( ( 𝑘 = 𝐾𝑙 = 𝐿 ) → if ( 𝑗 = 𝑙 , 𝑆 , 0 ) = if ( 𝑗 = 𝐿 , 𝑆 , 0 ) )
20 16 19 ifbieq1d ( ( 𝑘 = 𝐾𝑙 = 𝐿 ) → if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) = if ( 𝑖 = 𝐾 , if ( 𝑗 = 𝐿 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) )
21 20 mpoeq3dv ( ( 𝑘 = 𝐾𝑙 = 𝐿 ) → ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) = ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝐾 , if ( 𝑗 = 𝐿 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) )
22 21 adantl ( ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) ∧ ( 𝑘 = 𝐾𝑙 = 𝐿 ) ) → ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) = ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝐾 , if ( 𝑗 = 𝐿 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) )
23 7 8 14 22 ovmpodv2 ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) → ( ( 𝑀 𝑄 𝑆 ) = ( 𝑘𝑁 , 𝑙𝑁 ↦ ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝑘 , if ( 𝑗 = 𝑙 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) ) → ( 𝐾 ( 𝑀 𝑄 𝑆 ) 𝐿 ) = ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝐾 , if ( 𝑗 = 𝐿 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) ) )
24 6 23 mpd ( ( ( 𝑀𝐵𝑆 ∈ ( Base ‘ 𝑅 ) ) ∧ ( 𝐾𝑁𝐿𝑁 ) ) → ( 𝐾 ( 𝑀 𝑄 𝑆 ) 𝐿 ) = ( 𝑖𝑁 , 𝑗𝑁 ↦ if ( 𝑖 = 𝐾 , if ( 𝑗 = 𝐿 , 𝑆 , 0 ) , ( 𝑖 𝑀 𝑗 ) ) ) )