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

Theorem cramer 18509
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 18504). 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 assured by considering only systems of linear equations whose matrix has a unit (of the underlying ring) as determinant, see matunit 18496 or slesolinv 18498. 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 449 . . 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 18507 . . 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 1251 . 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 1039 . . . 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 992 . . . 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 993 . . . 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 crngrng 16667 . . . . . . . . 9  |-  ( R  e.  CRing  ->  R  e.  Ring )
1413anim1i 568 . . . . . . . 8  |-  ( ( R  e.  CRing  /\  N  =/=  (/) )  ->  ( R  e.  Ring  /\  N  =/=  (/) ) )
1514ancomd 451 . . . . . . 7  |-  ( ( R  e.  CRing  /\  N  =/=  (/) )  ->  ( N  =/=  (/)  /\  R  e. 
Ring ) )
1615anim1i 568 . . . . . 6  |-  ( ( ( R  e.  CRing  /\  N  =/=  (/) )  /\  ( X  e.  B  /\  Y  e.  V
) )  ->  (
( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V )
) )
17163adant3 1008 . . . . 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 18497 . . . . . 6  |-  ( ( ( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V )
)  ->  ( ( X  .x.  Z )  =  Y  ->  Z  e.  V ) )
1918imp 429 . . . . 5  |-  ( ( ( ( N  =/=  (/)  /\  R  e.  Ring )  /\  ( X  e.  B  /\  Y  e.  V ) )  /\  ( X  .x.  Z )  =  Y )  ->  Z  e.  V )
2017, 19sylan 471 . . . 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 461 . . . 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 18505 . . . 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 1230 . . 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 434 . 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 191 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 184    /\ wa 369    /\ w3a 965    = wceq 1369    e. wcel 1756    =/= wne 2618   (/)c0 3649   <.cop 3895    e. cmpt 4362   ` cfv 5430  (class class class)co 6103    ^m cmap 7226   Basecbs 14186   Ringcrg 16657   CRingccrg 16658  Unitcui 16743  /rcdvr 16786   Mat cmat 18292   maVecMul cmvmul 18363   matRepV cmatrepV 18380   maDet cmdat 18407
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2423  ax-rep 4415  ax-sep 4425  ax-nul 4433  ax-pow 4482  ax-pr 4543  ax-un 6384  ax-inf2 7859  ax-cnex 9350  ax-resscn 9351  ax-1cn 9352  ax-icn 9353  ax-addcl 9354  ax-addrcl 9355  ax-mulcl 9356  ax-mulrcl 9357  ax-mulcom 9358  ax-addass 9359  ax-mulass 9360  ax-distr 9361  ax-i2m1 9362  ax-1ne0 9363  ax-1rid 9364  ax-rnegex 9365  ax-rrecex 9366  ax-cnre 9367  ax-pre-lttri 9368  ax-pre-lttrn 9369  ax-pre-ltadd 9370  ax-pre-mulgt0 9371  ax-addf 9373  ax-mulf 9374
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-xor 1351  df-tru 1372  df-fal 1375  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2430  df-cleq 2436  df-clel 2439  df-nfc 2577  df-ne 2620  df-nel 2621  df-ral 2732  df-rex 2733  df-reu 2734  df-rmo 2735  df-rab 2736  df-v 2986  df-sbc 3199  df-csb 3301  df-dif 3343  df-un 3345  df-in 3347  df-ss 3354  df-pss 3356  df-nul 3650  df-if 3804  df-pw 3874  df-sn 3890  df-pr 3892  df-tp 3894  df-op 3896  df-ot 3898  df-uni 4104  df-int 4141  df-iun 4185  df-iin 4186  df-br 4305  df-opab 4363  df-mpt 4364  df-tr 4398  df-eprel 4644  df-id 4648  df-po 4653  df-so 4654  df-fr 4691  df-se 4692  df-we 4693  df-ord 4734  df-on 4735  df-lim 4736  df-suc 4737  df-xp 4858  df-rel 4859  df-cnv 4860  df-co 4861  df-dm 4862  df-rn 4863  df-res 4864  df-ima 4865  df-iota 5393  df-fun 5432  df-fn 5433  df-f 5434  df-f1 5435  df-fo 5436  df-f1o 5437  df-fv 5438  df-isom 5439  df-riota 6064  df-ov 6106  df-oprab 6107  df-mpt2 6108  df-of 6332  df-om 6489  df-1st 6589  df-2nd 6590  df-supp 6703  df-tpos 6757  df-recs 6844  df-rdg 6878  df-1o 6932  df-2o 6933  df-oadd 6936  df-er 7113  df-map 7228  df-pm 7229  df-ixp 7276  df-en 7323  df-dom 7324  df-sdom 7325  df-fin 7326  df-fsupp 7633  df-sup 7703  df-oi 7736  df-card 8121  df-pnf 9432  df-mnf 9433  df-xr 9434  df-ltxr 9435  df-le 9436  df-sub 9609  df-neg 9610  df-div 10006  df-nn 10335  df-2 10392  df-3 10393  df-4 10394  df-5 10395  df-6 10396  df-7 10397  df-8 10398  df-9 10399  df-10 10400  df-n0 10592  df-z 10659  df-dec 10768  df-uz 10874  df-rp 11004  df-fz 11450  df-fzo 11561  df-seq 11819  df-exp 11878  df-hash 12116  df-word 12241  df-concat 12243  df-s1 12244  df-substr 12245  df-splice 12246  df-reverse 12247  df-s2 12487  df-struct 14188  df-ndx 14189  df-slot 14190  df-base 14191  df-sets 14192  df-ress 14193  df-plusg 14263  df-mulr 14264  df-starv 14265  df-sca 14266  df-vsca 14267  df-ip 14268  df-tset 14269  df-ple 14270  df-ds 14272  df-unif 14273  df-hom 14274  df-cco 14275  df-0g 14392  df-gsum 14393  df-prds 14398  df-pws 14400  df-mre 14536  df-mrc 14537  df-acs 14539  df-mnd 15427  df-mhm 15476  df-submnd 15477  df-grp 15557  df-minusg 15558  df-sbg 15559  df-mulg 15560  df-subg 15690  df-ghm 15757  df-gim 15799  df-cntz 15847  df-oppg 15873  df-symg 15895  df-pmtr 15960  df-psgn 16009  df-evpm 16010  df-cmn 16291  df-abl 16292  df-mgp 16604  df-ur 16616  df-rng 16659  df-cring 16660  df-oppr 16727  df-dvdsr 16745  df-unit 16746  df-invr 16776  df-dvr 16787  df-rnghom 16818  df-drng 16846  df-subrg 16875  df-lmod 16962  df-lss 17026  df-sra 17265  df-rgmod 17266  df-assa 17396  df-cnfld 17831  df-zring 17896  df-zrh 17947  df-dsmm 18169  df-frlm 18184  df-mamu 18293  df-mat 18294  df-mvmul 18364  df-marrep 18381  df-marepv 18382  df-subma 18400  df-mdet 18408  df-madu 18452  df-minmar1 18453
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator