Metamath Proof Explorer


Theorem fprodex01

Description: A product of factors equal to zero or one is zero exactly when one of the factors is zero. (Contributed by Thierry Arnoux, 11-Dec-2021)

Ref Expression
Hypotheses fprodex01.1 k = l B = C
fprodex01.a φ A Fin
fprodex01.b φ k A B 0 1
Assertion fprodex01 φ k A B = if l A C = 1 1 0

Proof

Step Hyp Ref Expression
1 fprodex01.1 k = l B = C
2 fprodex01.a φ A Fin
3 fprodex01.b φ k A B 0 1
4 simpr φ l A C = 1 l A C = 1
5 1 eqeq1d k = l B = 1 C = 1
6 5 cbvralvw k A B = 1 l A C = 1
7 4 6 sylibr φ l A C = 1 k A B = 1
8 7 prodeq2d φ l A C = 1 k A B = k A 1
9 prod1 A 0 A Fin k A 1 = 1
10 9 olcs A Fin k A 1 = 1
11 2 10 syl φ k A 1 = 1
12 11 adantr φ l A C = 1 k A 1 = 1
13 8 12 eqtr2d φ l A C = 1 1 = k A B
14 nfv l φ
15 nfra1 l l A C = 1
16 15 nfn l ¬ l A C = 1
17 14 16 nfan l φ ¬ l A C = 1
18 nfv l k A B = 0
19 2 adantr φ ¬ l A C = 1 A Fin
20 19 ad2antrr φ ¬ l A C = 1 l A C = 0 A Fin
21 pr01ssre 0 1
22 ax-resscn
23 21 22 sstri 0 1
24 23 3 sselid φ k A B
25 24 adantlr φ ¬ l A C = 1 k A B
26 25 adantlr φ ¬ l A C = 1 l A k A B
27 26 adantlr φ ¬ l A C = 1 l A C = 0 k A B
28 simplr φ ¬ l A C = 1 l A C = 0 l A
29 simpr φ ¬ l A C = 1 l A C = 0 C = 0
30 1 20 27 28 29 fprodeq02 φ ¬ l A C = 1 l A C = 0 k A B = 0
31 rexnal l A ¬ C = 1 ¬ l A C = 1
32 31 biimpri ¬ l A C = 1 l A ¬ C = 1
33 32 adantl φ ¬ l A C = 1 l A ¬ C = 1
34 3 ralrimiva φ k A B 0 1
35 1 eleq1d k = l B 0 1 C 0 1
36 35 cbvralvw k A B 0 1 l A C 0 1
37 34 36 sylib φ l A C 0 1
38 37 r19.21bi φ l A C 0 1
39 c0ex 0 V
40 1ex 1 V
41 39 40 elpr2 C 0 1 C = 0 C = 1
42 38 41 sylib φ l A C = 0 C = 1
43 42 orcomd φ l A C = 1 C = 0
44 43 ord φ l A ¬ C = 1 C = 0
45 44 reximdva φ l A ¬ C = 1 l A C = 0
46 45 adantr φ ¬ l A C = 1 l A ¬ C = 1 l A C = 0
47 33 46 mpd φ ¬ l A C = 1 l A C = 0
48 17 18 30 47 r19.29af2 φ ¬ l A C = 1 k A B = 0
49 48 eqcomd φ ¬ l A C = 1 0 = k A B
50 13 49 ifeqda φ if l A C = 1 1 0 = k A B
51 50 eqcomd φ k A B = if l A C = 1 1 0