Metamath Proof Explorer


Theorem cramer

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 ). 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 or slesolinv . For fields as underlying rings, this requirement is equivalent to 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)

Ref Expression
Hypotheses cramer.a A=NMatR
cramer.b B=BaseA
cramer.v V=BaseRN
cramer.d D=NmaDetR
cramer.x ·˙=RmaVecMulNN
cramer.q ×˙=/rR
Assertion cramer RCRingNXBYVDXUnitRZ=iNDXNmatRepVRYi×˙DXX·˙Z=Y

Proof

Step Hyp Ref Expression
1 cramer.a A=NMatR
2 cramer.b B=BaseA
3 cramer.v V=BaseRN
4 cramer.d D=NmaDetR
5 cramer.x ·˙=RmaVecMulNN
6 cramer.q ×˙=/rR
7 pm3.22 RCRingNNRCRing
8 1 2 3 4 5 6 cramerlem3 NRCRingXBYVDXUnitRZ=iNDXNmatRepVRYi×˙DXX·˙Z=Y
9 7 8 syl3an1 RCRingNXBYVDXUnitRZ=iNDXNmatRepVRYi×˙DXX·˙Z=Y
10 simpl1l RCRingNXBYVDXUnitRX·˙Z=YRCRing
11 simpl2 RCRingNXBYVDXUnitRX·˙Z=YXBYV
12 simpl3 RCRingNXBYVDXUnitRX·˙Z=YDXUnitR
13 crngring RCRingRRing
14 13 anim1ci RCRingNNRRing
15 14 anim1i RCRingNXBYVNRRingXBYV
16 15 3adant3 RCRingNXBYVDXUnitRNRRingXBYV
17 1 2 3 5 slesolvec NRRingXBYVX·˙Z=YZV
18 17 imp NRRingXBYVX·˙Z=YZV
19 16 18 sylan RCRingNXBYVDXUnitRX·˙Z=YZV
20 simpr RCRingNXBYVDXUnitRX·˙Z=YX·˙Z=Y
21 1 2 3 4 5 6 cramerlem1 RCRingXBYVDXUnitRZVX·˙Z=YZ=iNDXNmatRepVRYi×˙DX
22 10 11 12 19 20 21 syl113anc RCRingNXBYVDXUnitRX·˙Z=YZ=iNDXNmatRepVRYi×˙DX
23 22 ex RCRingNXBYVDXUnitRX·˙Z=YZ=iNDXNmatRepVRYi×˙DX
24 9 23 impbid RCRingNXBYVDXUnitRZ=iNDXNmatRepVRYi×˙DXX·˙Z=Y