Metamath Proof Explorer


Theorem prodindf

Description: The product of indicators is one if and only if all values are in the set. (Contributed by Thierry Arnoux, 11-Dec-2021)

Ref Expression
Hypotheses prodindf.1 ( 𝜑𝑂𝑉 )
prodindf.2 ( 𝜑𝐴 ∈ Fin )
prodindf.3 ( 𝜑𝐵𝑂 )
prodindf.4 ( 𝜑𝐹 : 𝐴𝑂 )
Assertion prodindf ( 𝜑 → ∏ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = if ( ran 𝐹𝐵 , 1 , 0 ) )

Proof

Step Hyp Ref Expression
1 prodindf.1 ( 𝜑𝑂𝑉 )
2 prodindf.2 ( 𝜑𝐴 ∈ Fin )
3 prodindf.3 ( 𝜑𝐵𝑂 )
4 prodindf.4 ( 𝜑𝐹 : 𝐴𝑂 )
5 2fveq3 ( 𝑘 = 𝑙 → ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) )
6 indf ( ( 𝑂𝑉𝐵𝑂 ) → ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) : 𝑂 ⟶ { 0 , 1 } )
7 1 3 6 syl2anc ( 𝜑 → ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) : 𝑂 ⟶ { 0 , 1 } )
8 7 adantr ( ( 𝜑𝑘𝐴 ) → ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) : 𝑂 ⟶ { 0 , 1 } )
9 4 ffvelrnda ( ( 𝜑𝑘𝐴 ) → ( 𝐹𝑘 ) ∈ 𝑂 )
10 8 9 ffvelrnd ( ( 𝜑𝑘𝐴 ) → ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) ∈ { 0 , 1 } )
11 5 2 10 fprodex01 ( 𝜑 → ∏ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = if ( ∀ 𝑙𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) = 1 , 1 , 0 ) )
12 2fveq3 ( 𝑙 = 𝑘 → ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) = ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) )
13 12 eqeq1d ( 𝑙 = 𝑘 → ( ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) = 1 ↔ ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 ) )
14 13 cbvralvw ( ∀ 𝑙𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) = 1 ↔ ∀ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 )
15 14 a1i ( 𝜑 → ( ∀ 𝑙𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) = 1 ↔ ∀ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 ) )
16 15 ifbid ( 𝜑 → if ( ∀ 𝑙𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑙 ) ) = 1 , 1 , 0 ) = if ( ∀ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 , 1 , 0 ) )
17 eqid ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) = ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) )
18 17 rnmptss ( ∀ 𝑘𝐴 ( 𝐹𝑘 ) ∈ 𝐵 → ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 )
19 nfv 𝑘 𝜑
20 nfmpt1 𝑘 ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) )
21 20 nfrn 𝑘 ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) )
22 nfcv 𝑘 𝐵
23 21 22 nfss 𝑘 ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵
24 19 23 nfan 𝑘 ( 𝜑 ∧ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 )
25 simplr ( ( ( 𝜑 ∧ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) ∧ 𝑘𝐴 ) → ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 )
26 4 feqmptd ( 𝜑𝐹 = ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) )
27 eqidd ( 𝜑𝑘 = 𝑘 )
28 26 27 fveq12d ( 𝜑 → ( 𝐹𝑘 ) = ( ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ‘ 𝑘 ) )
29 28 ralrimivw ( 𝜑 → ∀ 𝑘𝐴 ( 𝐹𝑘 ) = ( ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ‘ 𝑘 ) )
30 29 r19.21bi ( ( 𝜑𝑘𝐴 ) → ( 𝐹𝑘 ) = ( ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ‘ 𝑘 ) )
31 4 ffnd ( 𝜑𝐹 Fn 𝐴 )
32 26 fneq1d ( 𝜑 → ( 𝐹 Fn 𝐴 ↔ ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) Fn 𝐴 ) )
33 31 32 mpbid ( 𝜑 → ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) Fn 𝐴 )
34 33 adantr ( ( 𝜑𝑘𝐴 ) → ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) Fn 𝐴 )
35 simpr ( ( 𝜑𝑘𝐴 ) → 𝑘𝐴 )
36 fnfvelrn ( ( ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) Fn 𝐴𝑘𝐴 ) → ( ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ‘ 𝑘 ) ∈ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) )
37 34 35 36 syl2anc ( ( 𝜑𝑘𝐴 ) → ( ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ‘ 𝑘 ) ∈ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) )
38 30 37 eqeltrd ( ( 𝜑𝑘𝐴 ) → ( 𝐹𝑘 ) ∈ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) )
39 38 adantlr ( ( ( 𝜑 ∧ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) ∧ 𝑘𝐴 ) → ( 𝐹𝑘 ) ∈ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) )
40 25 39 sseldd ( ( ( 𝜑 ∧ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) ∧ 𝑘𝐴 ) → ( 𝐹𝑘 ) ∈ 𝐵 )
41 40 ex ( ( 𝜑 ∧ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) → ( 𝑘𝐴 → ( 𝐹𝑘 ) ∈ 𝐵 ) )
42 24 41 ralrimi ( ( 𝜑 ∧ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) → ∀ 𝑘𝐴 ( 𝐹𝑘 ) ∈ 𝐵 )
43 42 ex ( 𝜑 → ( ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 → ∀ 𝑘𝐴 ( 𝐹𝑘 ) ∈ 𝐵 ) )
44 18 43 impbid2 ( 𝜑 → ( ∀ 𝑘𝐴 ( 𝐹𝑘 ) ∈ 𝐵 ↔ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) )
45 1 adantr ( ( 𝜑𝑘𝐴 ) → 𝑂𝑉 )
46 3 adantr ( ( 𝜑𝑘𝐴 ) → 𝐵𝑂 )
47 ind1a ( ( 𝑂𝑉𝐵𝑂 ∧ ( 𝐹𝑘 ) ∈ 𝑂 ) → ( ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 ↔ ( 𝐹𝑘 ) ∈ 𝐵 ) )
48 45 46 9 47 syl3anc ( ( 𝜑𝑘𝐴 ) → ( ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 ↔ ( 𝐹𝑘 ) ∈ 𝐵 ) )
49 48 ralbidva ( 𝜑 → ( ∀ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 ↔ ∀ 𝑘𝐴 ( 𝐹𝑘 ) ∈ 𝐵 ) )
50 26 rneqd ( 𝜑 → ran 𝐹 = ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) )
51 50 sseq1d ( 𝜑 → ( ran 𝐹𝐵 ↔ ran ( 𝑘𝐴 ↦ ( 𝐹𝑘 ) ) ⊆ 𝐵 ) )
52 44 49 51 3bitr4d ( 𝜑 → ( ∀ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 ↔ ran 𝐹𝐵 ) )
53 52 ifbid ( 𝜑 → if ( ∀ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = 1 , 1 , 0 ) = if ( ran 𝐹𝐵 , 1 , 0 ) )
54 11 16 53 3eqtrd ( 𝜑 → ∏ 𝑘𝐴 ( ( ( 𝟭 ‘ 𝑂 ) ‘ 𝐵 ) ‘ ( 𝐹𝑘 ) ) = if ( ran 𝐹𝐵 , 1 , 0 ) )