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

Theorem cramer 19319
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 19314). 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 19306 or slesolinv 19308. 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 19317 . . 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 1261 . 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 1047 . . . 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 1000 . . . 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 1001 . . . 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 17335 . . . . . . . . 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 1016 . . . . 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 19307 . . . . . 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 19315 . . . 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 1240 . . 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 973    = wceq 1395    e. wcel 1819    =/= wne 2652   (/)c0 3793   <.cop 4038    |-> cmpt 4515   ` cfv 5594  (class class class)co 6296    ^m cmap 7438   Basecbs 14643   Ringcrg 17324   CRingccrg 17325  Unitcui 17414  /rcdvr 17457   Mat cmat 19035   maVecMul cmvmul 19168   matRepV cmatrepV 19185   maDet cmdat 19212
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1619  ax-4 1632  ax-5 1705  ax-6 1748  ax-7 1791  ax-8 1821  ax-9 1823  ax-10 1838  ax-11 1843  ax-12 1855  ax-13 2000  ax-ext 2435  ax-rep 4568  ax-sep 4578  ax-nul 4586  ax-pow 4634  ax-pr 4695  ax-un 6591  ax-inf2 8075  ax-cnex 9565  ax-resscn 9566  ax-1cn 9567  ax-icn 9568  ax-addcl 9569  ax-addrcl 9570  ax-mulcl 9571  ax-mulrcl 9572  ax-mulcom 9573  ax-addass 9574  ax-mulass 9575  ax-distr 9576  ax-i2m1 9577  ax-1ne0 9578  ax-1rid 9579  ax-rnegex 9580  ax-rrecex 9581  ax-cnre 9582  ax-pre-lttri 9583  ax-pre-lttrn 9584  ax-pre-ltadd 9585  ax-pre-mulgt0 9586  ax-addf 9588  ax-mulf 9589
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-xor 1364  df-tru 1398  df-fal 1401  df-ex 1614  df-nf 1618  df-sb 1741  df-eu 2287  df-mo 2288  df-clab 2443  df-cleq 2449  df-clel 2452  df-nfc 2607  df-ne 2654  df-nel 2655  df-ral 2812  df-rex 2813  df-reu 2814  df-rmo 2815  df-rab 2816  df-v 3111  df-sbc 3328  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3794  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-ot 4041  df-uni 4252  df-int 4289  df-iun 4334  df-iin 4335  df-br 4457  df-opab 4516  df-mpt 4517  df-tr 4551  df-eprel 4800  df-id 4804  df-po 4809  df-so 4810  df-fr 4847  df-se 4848  df-we 4849  df-ord 4890  df-on 4891  df-lim 4892  df-suc 4893  df-xp 5014  df-rel 5015  df-cnv 5016  df-co 5017  df-dm 5018  df-rn 5019  df-res 5020  df-ima 5021  df-iota 5557  df-fun 5596  df-fn 5597  df-f 5598  df-f1 5599  df-fo 5600  df-f1o 5601  df-fv 5602  df-isom 5603  df-riota 6258  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-of 6539  df-om 6700  df-1st 6799  df-2nd 6800  df-supp 6918  df-tpos 6973  df-recs 7060  df-rdg 7094  df-1o 7148  df-2o 7149  df-oadd 7152  df-er 7329  df-map 7440  df-pm 7441  df-ixp 7489  df-en 7536  df-dom 7537  df-sdom 7538  df-fin 7539  df-fsupp 7848  df-sup 7919  df-oi 7953  df-card 8337  df-cda 8565  df-pnf 9647  df-mnf 9648  df-xr 9649  df-ltxr 9650  df-le 9651  df-sub 9826  df-neg 9827  df-div 10228  df-nn 10557  df-2 10615  df-3 10616  df-4 10617  df-5 10618  df-6 10619  df-7 10620  df-8 10621  df-9 10622  df-10 10623  df-n0 10817  df-z 10886  df-dec 11001  df-uz 11107  df-rp 11246  df-fz 11698  df-fzo 11821  df-seq 12110  df-exp 12169  df-hash 12408  df-word 12545  df-lsw 12546  df-concat 12547  df-s1 12548  df-substr 12549  df-splice 12550  df-reverse 12551  df-s2 12824  df-struct 14645  df-ndx 14646  df-slot 14647  df-base 14648  df-sets 14649  df-ress 14650  df-plusg 14724  df-mulr 14725  df-starv 14726  df-sca 14727  df-vsca 14728  df-ip 14729  df-tset 14730  df-ple 14731  df-ds 14733  df-unif 14734  df-hom 14735  df-cco 14736  df-0g 14858  df-gsum 14859  df-prds 14864  df-pws 14866  df-mre 15002  df-mrc 15003  df-acs 15005  df-mgm 15998  df-sgrp 16037  df-mnd 16047  df-mhm 16092  df-submnd 16093  df-grp 16183  df-minusg 16184  df-sbg 16185  df-mulg 16186  df-subg 16324  df-ghm 16391  df-gim 16433  df-cntz 16481  df-oppg 16507  df-symg 16529  df-pmtr 16593  df-psgn 16642  df-evpm 16643  df-cmn 16926  df-abl 16927  df-mgp 17268  df-ur 17280  df-srg 17284  df-ring 17326  df-cring 17327  df-oppr 17398  df-dvdsr 17416  df-unit 17417  df-invr 17447  df-dvr 17458  df-rnghom 17490  df-drng 17524  df-subrg 17553  df-lmod 17640  df-lss 17705  df-sra 17944  df-rgmod 17945  df-assa 18087  df-cnfld 18547  df-zring 18615  df-zrh 18667  df-dsmm 18889  df-frlm 18904  df-mamu 19012  df-mat 19036  df-mvmul 19169  df-marrep 19186  df-marepv 19187  df-subma 19205  df-mdet 19213  df-madu 19262  df-minmar1 19263
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator