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
|- A = ( N Mat R )
marrepfval.b
|- B = ( Base ` A )
marrepfval.q
|- Q = ( N matRRep R )
marrepfval.z
|- .0. = ( 0g ` R )
Assertion marrepval
|- ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) -> ( K ( M Q S ) L ) = ( i e. N , j e. N |-> if ( i = K , if ( j = L , S , .0. ) , ( i M j ) ) ) )

Proof

Step Hyp Ref Expression
1 marrepfval.a
 |-  A = ( N Mat R )
2 marrepfval.b
 |-  B = ( Base ` A )
3 marrepfval.q
 |-  Q = ( N matRRep R )
4 marrepfval.z
 |-  .0. = ( 0g ` R )
5 1 2 3 4 marrepval0
 |-  ( ( M e. B /\ S e. ( Base ` R ) ) -> ( M Q S ) = ( k e. N , l e. N |-> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) ) )
6 5 adantr
 |-  ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) -> ( M Q S ) = ( k e. N , l e. N |-> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) ) )
7 simprl
 |-  ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) -> K e. N )
8 simplrr
 |-  ( ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) /\ k = K ) -> L e. N )
9 1 2 matrcl
 |-  ( M e. B -> ( N e. Fin /\ R e. _V ) )
10 9 simpld
 |-  ( M e. B -> N e. Fin )
11 10 10 jca
 |-  ( M e. B -> ( N e. Fin /\ N e. Fin ) )
12 11 ad3antrrr
 |-  ( ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) /\ ( k = K /\ l = L ) ) -> ( N e. Fin /\ N e. Fin ) )
13 mpoexga
 |-  ( ( N e. Fin /\ N e. Fin ) -> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) e. _V )
14 12 13 syl
 |-  ( ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) /\ ( k = K /\ l = L ) ) -> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) e. _V )
15 eqeq2
 |-  ( k = K -> ( i = k <-> i = K ) )
16 15 adantr
 |-  ( ( k = K /\ l = L ) -> ( i = k <-> i = K ) )
17 eqeq2
 |-  ( l = L -> ( j = l <-> j = L ) )
18 17 ifbid
 |-  ( l = L -> if ( j = l , S , .0. ) = if ( j = L , S , .0. ) )
19 18 adantl
 |-  ( ( k = K /\ l = L ) -> if ( j = l , S , .0. ) = if ( j = L , S , .0. ) )
20 16 19 ifbieq1d
 |-  ( ( k = K /\ l = L ) -> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) = if ( i = K , if ( j = L , S , .0. ) , ( i M j ) ) )
21 20 mpoeq3dv
 |-  ( ( k = K /\ l = L ) -> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) = ( i e. N , j e. N |-> if ( i = K , if ( j = L , S , .0. ) , ( i M j ) ) ) )
22 21 adantl
 |-  ( ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) /\ ( k = K /\ l = L ) ) -> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) = ( i e. N , j e. N |-> if ( i = K , if ( j = L , S , .0. ) , ( i M j ) ) ) )
23 7 8 14 22 ovmpodv2
 |-  ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) -> ( ( M Q S ) = ( k e. N , l e. N |-> ( i e. N , j e. N |-> if ( i = k , if ( j = l , S , .0. ) , ( i M j ) ) ) ) -> ( K ( M Q S ) L ) = ( i e. N , j e. N |-> if ( i = K , if ( j = L , S , .0. ) , ( i M j ) ) ) ) )
24 6 23 mpd
 |-  ( ( ( M e. B /\ S e. ( Base ` R ) ) /\ ( K e. N /\ L e. N ) ) -> ( K ( M Q S ) L ) = ( i e. N , j e. N |-> if ( i = K , if ( j = L , S , .0. ) , ( i M j ) ) ) )