MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  cramer Structured version   Unicode version

Theorem cramer 19714
Description: Cramer's rule. According to Wikipedia "Cramer's rule", 21-Feb-2019, https://en.wikipedia.org/wiki/Cramer%27s_rule: "[Cramer's rule] ... expresses the [unique] solution [of a system of linear equations] in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the column vector of right-hand sides of the equations." If it is assumed that a (unique) solution exists, it can be obtained by Cramer's rule (see also cramerimp 19709). On the other hand, if a vector can be constructed by Cramer's rule, it is a solution of the system of linear equations, so at least one solution exists. The uniqueness is ensured by considering only systems of linear equations whose matrix has a unit (of the underlying ring) as determinant, see matunit 19701 or slesolinv 19703. For fields as underlying rings, this requirement is equivalent with the determinant not being 0. Theorem 4.4 in [Lang] p. 513. This is Metamath 100 proof #97. (Contributed by Alexander van der Vekens, 21-Feb-2019.) (Revised by Alexander van der Vekens, 1-Mar-2019.)
Hypotheses
Ref Expression
cramer.a  |-  A  =  ( N Mat  R )
cramer.b  |-  B  =  ( Base `  A
)
cramer.v  |-  V  =  ( ( Base `  R
)  ^m  N )
cramer.d  |-  D  =  ( N maDet  R )
cramer.x  |-  .x.  =  ( R maVecMul  <. N ,  N >. )
cramer.q  |-  ./  =  (/r
`  R )
Assertion
Ref Expression
cramer  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  -> 
( Z  =  ( i  e.  N  |->  ( ( D `  (
( X ( N matRepV  R ) Y ) `
 i ) ) 
./  ( D `  X ) ) )  <-> 
( X  .x.  Z
)  =  Y ) )
Distinct variable groups:    B, i    D, i    i, N    R, i    i, V    i, X    i, Y    i, Z    .x. , i    ./ , i
Allowed substitution hint:    A( i)

Proof of Theorem cramer
StepHypRef Expression
1 pm3.22 450 . . 3  |-  ( ( R  e.  CRing  /\  N  =/=  (/) )  ->  ( N  =/=  (/)  /\  R  e. 
CRing ) )
2 cramer.a . . . 4  |-  A  =  ( N Mat  R )
3 cramer.b . . . 4  |-  B  =  ( Base `  A
)
4 cramer.v . . . 4  |-  V  =  ( ( Base `  R
)  ^m  N )
5 cramer.d . . . 4  |-  D  =  ( N maDet  R )
6 cramer.x . . . 4  |-  .x.  =  ( R maVecMul  <. N ,  N >. )
7 cramer.q . . . 4  |-  ./  =  (/r
`  R )
82, 3, 4, 5, 6, 7cramerlem3 19712 . . 3  |-  ( ( ( N  =/=  (/)  /\  R  e.  CRing )  /\  ( X  e.  B  /\  Y  e.  V )  /\  ( D `  X
)  e.  (Unit `  R ) )  -> 
( Z  =  ( i  e.  N  |->  ( ( D `  (
( X ( N matRepV  R ) Y ) `
 i ) ) 
./  ( D `  X ) ) )  ->  ( X  .x.  Z )  =  Y ) )
91, 8syl3an1 1297 . 2  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  -> 
( Z  =  ( i  e.  N  |->  ( ( D `  (
( X ( N matRepV  R ) Y ) `
 i ) ) 
./  ( D `  X ) ) )  ->  ( X  .x.  Z )  =  Y ) )
10 simpl1l 1056 . . . 4  |-  ( ( ( ( R  e. 
CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  /\  ( X  .x.  Z )  =  Y )  ->  R  e.  CRing )
11 simpl2 1009 . . . 4  |-  ( ( ( ( R  e. 
CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  /\  ( X  .x.  Z )  =  Y )  -> 
( X  e.  B  /\  Y  e.  V
) )
12 simpl3 1010 . . . 4  |-  ( ( ( ( R  e. 
CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  /\  ( X  .x.  Z )  =  Y )  -> 
( D `  X
)  e.  (Unit `  R ) )
13 crngring 17790 . . . . . . . . 9  |-  ( R  e.  CRing  ->  R  e.  Ring )
1413anim1i 570 . . . . . . . 8  |-  ( ( R  e.  CRing  /\  N  =/=  (/) )  ->  ( R  e.  Ring  /\  N  =/=  (/) ) )
1514ancomd 452 . . . . . . 7  |-  ( ( R  e.  CRing  /\  N  =/=  (/) )  ->  ( N  =/=  (/)  /\  R  e. 
Ring ) )
1615anim1i 570 . . . . . 6  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
) )  ->  (
( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V )
) )
17163adant3 1025 . . . . 5  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  -> 
( ( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V ) ) )
182, 3, 4, 6slesolvec 19702 . . . . . 6  |-  ( ( ( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V )
)  ->  ( ( X  .x.  Z )  =  Y  ->  Z  e.  V ) )
1918imp 430 . . . . 5  |-  ( ( ( ( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V ) )  /\  ( X  .x.  Z )  =  Y )  ->  Z  e.  V )
2017, 19sylan 473 . . . 4  |-  ( ( ( ( R  e. 
CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  /\  ( X  .x.  Z )  =  Y )  ->  Z  e.  V )
21 simpr 462 . . . 4  |-  ( ( ( ( R  e. 
CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  /\  ( X  .x.  Z )  =  Y )  -> 
( X  .x.  Z
)  =  Y )
222, 3, 4, 5, 6, 7cramerlem1 19710 . . . 4  |-  ( ( R  e.  CRing  /\  ( X  e.  B  /\  Y  e.  V )  /\  ( ( D `  X )  e.  (Unit `  R )  /\  Z  e.  V  /\  ( X  .x.  Z )  =  Y ) )  ->  Z  =  ( i  e.  N  |->  ( ( D `  ( ( X ( N matRepV  R
) Y ) `  i ) )  ./  ( D `  X ) ) ) )
2310, 11, 12, 20, 21, 22syl113anc 1276 . . 3  |-  ( ( ( ( R  e. 
CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  /\  ( X  .x.  Z )  =  Y )  ->  Z  =  ( i  e.  N  |->  ( ( D `  ( ( X ( N matRepV  R
) Y ) `  i ) )  ./  ( D `  X ) ) ) )
2423ex 435 . 2  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  -> 
( ( X  .x.  Z )  =  Y  ->  Z  =  ( i  e.  N  |->  ( ( D `  (
( X ( N matRepV  R ) Y ) `
 i ) ) 
./  ( D `  X ) ) ) ) )
259, 24impbid 193 1  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
)  /\  ( D `  X )  e.  (Unit `  R ) )  -> 
( Z  =  ( i  e.  N  |->  ( ( D `  (
( X ( N matRepV  R ) Y ) `
 i ) ) 
./  ( D `  X ) ) )  <-> 
( X  .x.  Z
)  =  Y ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 187    /\ wa 370    /\ w3a 982    = wceq 1437    e. wcel 1872    =/= wne 2614   (/)c0 3761   <.cop 4004    |-> cmpt 4482   ` cfv 5601  (class class class)co 6305    ^m cmap 7483   Basecbs 15120   Ringcrg 17779   CRingccrg 17780  Unitcui 17866  /rcdvr 17909   Mat cmat 19430   maVecMul cmvmul 19563   matRepV cmatrepV 19580   maDet cmdat 19607
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1663  ax-4 1676  ax-5 1752  ax-6 1798  ax-7 1843  ax-8 1874  ax-9 1876  ax-10 1891  ax-11 1896  ax-12 1909  ax-13 2057  ax-ext 2401  ax-rep 4536  ax-sep 4546  ax-nul 4555  ax-pow 4602  ax-pr 4660  ax-un 6597  ax-inf2 8155  ax-cnex 9602  ax-resscn 9603  ax-1cn 9604  ax-icn 9605  ax-addcl 9606  ax-addrcl 9607  ax-mulcl 9608  ax-mulrcl 9609  ax-mulcom 9610  ax-addass 9611  ax-mulass 9612  ax-distr 9613  ax-i2m1 9614  ax-1ne0 9615  ax-1rid 9616  ax-rnegex 9617  ax-rrecex 9618  ax-cnre 9619  ax-pre-lttri 9620  ax-pre-lttrn 9621  ax-pre-ltadd 9622  ax-pre-mulgt0 9623  ax-addf 9625  ax-mulf 9626
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3or 983  df-3an 984  df-xor 1401  df-tru 1440  df-fal 1443  df-ex 1658  df-nf 1662  df-sb 1791  df-eu 2273  df-mo 2274  df-clab 2408  df-cleq 2414  df-clel 2417  df-nfc 2568  df-ne 2616  df-nel 2617  df-ral 2776  df-rex 2777  df-reu 2778  df-rmo 2779  df-rab 2780  df-v 3082  df-sbc 3300  df-csb 3396  df-dif 3439  df-un 3441  df-in 3443  df-ss 3450  df-pss 3452  df-nul 3762  df-if 3912  df-pw 3983  df-sn 3999  df-pr 4001  df-tp 4003  df-op 4005  df-ot 4007  df-uni 4220  df-int 4256  df-iun 4301  df-iin 4302  df-br 4424  df-opab 4483  df-mpt 4484  df-tr 4519  df-eprel 4764  df-id 4768  df-po 4774  df-so 4775  df-fr 4812  df-se 4813  df-we 4814  df-xp 4859  df-rel 4860  df-cnv 4861  df-co 4862  df-dm 4863  df-rn 4864  df-res 4865  df-ima 4866  df-pred 5399  df-ord 5445  df-on 5446  df-lim 5447  df-suc 5448  df-iota 5565  df-fun 5603  df-fn 5604  df-f 5605  df-f1 5606  df-fo 5607  df-f1o 5608  df-fv 5609  df-isom 5610  df-riota 6267  df-ov 6308  df-oprab 6309  df-mpt2 6310  df-of 6545  df-om 6707  df-1st 6807  df-2nd 6808  df-supp 6926  df-tpos 6984  df-wrecs 7039  df-recs 7101  df-rdg 7139  df-1o 7193  df-2o 7194  df-oadd 7197  df-er 7374  df-map 7485  df-pm 7486  df-ixp 7534  df-en 7581  df-dom 7582  df-sdom 7583  df-fin 7584  df-fsupp 7893  df-sup 7965  df-oi 8034  df-card 8381  df-cda 8605  df-pnf 9684  df-mnf 9685  df-xr 9686  df-ltxr 9687  df-le 9688  df-sub 9869  df-neg 9870  df-div 10277  df-nn 10617  df-2 10675  df-3 10676  df-4 10677  df-5 10678  df-6 10679  df-7 10680  df-8 10681  df-9 10682  df-10 10683  df-n0 10877  df-z 10945  df-dec 11059  df-uz 11167  df-rp 11310  df-fz 11792  df-fzo 11923  df-seq 12220  df-exp 12279  df-hash 12522  df-word 12668  df-lsw 12669  df-concat 12670  df-s1 12671  df-substr 12672  df-splice 12673  df-reverse 12674  df-s2 12946  df-struct 15122  df-ndx 15123  df-slot 15124  df-base 15125  df-sets 15126  df-ress 15127  df-plusg 15202  df-mulr 15203  df-starv 15204  df-sca 15205  df-vsca 15206  df-ip 15207  df-tset 15208  df-ple 15209  df-ds 15211  df-unif 15212  df-hom 15213  df-cco 15214  df-0g 15339  df-gsum 15340  df-prds 15345  df-pws 15347  df-mre 15491  df-mrc 15492  df-acs 15494  df-mgm 16487  df-sgrp 16526  df-mnd 16536  df-mhm 16581  df-submnd 16582  df-grp 16672  df-minusg 16673  df-sbg 16674  df-mulg 16675  df-subg 16813  df-ghm 16880  df-gim 16922  df-cntz 16970  df-oppg 16996  df-symg 17018  df-pmtr 17082  df-psgn 17131  df-evpm 17132  df-cmn 17431  df-abl 17432  df-mgp 17723  df-ur 17735  df-srg 17739  df-ring 17781  df-cring 17782  df-oppr 17850  df-dvdsr 17868  df-unit 17869  df-invr 17899  df-dvr 17910  df-rnghom 17942  df-drng 17976  df-subrg 18005  df-lmod 18092  df-lss 18155  df-sra 18394  df-rgmod 18395  df-assa 18535  df-cnfld 18970  df-zring 19038  df-zrh 19073  df-dsmm 19293  df-frlm 19308  df-mamu 19407  df-mat 19431  df-mvmul 19564  df-marrep 19581  df-marepv 19582  df-subma 19600  df-mdet 19608  df-madu 19657  df-minmar1 19658
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator