Metamath Proof Explorer


Theorem reprdifc

Description: Express the representations as a sum of integers in a difference of sets using conditions on each of the indices. (Contributed by Thierry Arnoux, 27-Dec-2021)

Ref Expression
Hypotheses reprdifc.c C = c A repr S M | ¬ c x B
reprdifc.a φ A
reprdifc.b φ B
reprdifc.m φ M 0
reprdifc.s φ S 0
Assertion reprdifc φ A repr S M B repr S M = x 0 ..^ S C

Proof

Step Hyp Ref Expression
1 reprdifc.c C = c A repr S M | ¬ c x B
2 reprdifc.a φ A
3 reprdifc.b φ B
4 reprdifc.m φ M 0
5 reprdifc.s φ S 0
6 nfv d φ
7 nfrab1 _ d d A 0 ..^ S B 0 ..^ S | a 0 ..^ S d a = M
8 nfcv _ d x 0 ..^ S c A repr S M | ¬ c x B
9 4 nn0zd φ M
10 2 9 5 reprval φ A repr S M = d A 0 ..^ S | a 0 ..^ S d a = M
11 10 eleq2d φ d A repr S M d d A 0 ..^ S | a 0 ..^ S d a = M
12 rabid d d A 0 ..^ S | a 0 ..^ S d a = M d A 0 ..^ S a 0 ..^ S d a = M
13 11 12 bitrdi φ d A repr S M d A 0 ..^ S a 0 ..^ S d a = M
14 13 anbi1d φ d A repr S M ¬ d B 0 ..^ S d A 0 ..^ S a 0 ..^ S d a = M ¬ d B 0 ..^ S
15 eldif d A 0 ..^ S B 0 ..^ S d A 0 ..^ S ¬ d B 0 ..^ S
16 15 anbi1i d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M d A 0 ..^ S ¬ d B 0 ..^ S a 0 ..^ S d a = M
17 an32 d A 0 ..^ S ¬ d B 0 ..^ S a 0 ..^ S d a = M d A 0 ..^ S a 0 ..^ S d a = M ¬ d B 0 ..^ S
18 16 17 bitri d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M d A 0 ..^ S a 0 ..^ S d a = M ¬ d B 0 ..^ S
19 18 a1i φ d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M d A 0 ..^ S a 0 ..^ S d a = M ¬ d B 0 ..^ S
20 14 19 bitr4d φ d A repr S M ¬ d B 0 ..^ S d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M
21 nnex V
22 21 a1i φ V
23 22 3 ssexd φ B V
24 ovexd φ 0 ..^ S V
25 elmapg B V 0 ..^ S V d B 0 ..^ S d : 0 ..^ S B
26 23 24 25 syl2anc φ d B 0 ..^ S d : 0 ..^ S B
27 26 adantr φ d A repr S M d B 0 ..^ S d : 0 ..^ S B
28 ffnfv d : 0 ..^ S B d Fn 0 ..^ S x 0 ..^ S d x B
29 2 adantr φ d A repr S M A
30 9 adantr φ d A repr S M M
31 5 adantr φ d A repr S M S 0
32 simpr φ d A repr S M d A repr S M
33 29 30 31 32 reprf φ d A repr S M d : 0 ..^ S A
34 33 ffnd φ d A repr S M d Fn 0 ..^ S
35 34 biantrurd φ d A repr S M x 0 ..^ S d x B d Fn 0 ..^ S x 0 ..^ S d x B
36 28 35 bitr4id φ d A repr S M d : 0 ..^ S B x 0 ..^ S d x B
37 27 36 bitrd φ d A repr S M d B 0 ..^ S x 0 ..^ S d x B
38 37 notbid φ d A repr S M ¬ d B 0 ..^ S ¬ x 0 ..^ S d x B
39 rexnal x 0 ..^ S ¬ d x B ¬ x 0 ..^ S d x B
40 38 39 bitr4di φ d A repr S M ¬ d B 0 ..^ S x 0 ..^ S ¬ d x B
41 40 pm5.32da φ d A repr S M ¬ d B 0 ..^ S d A repr S M x 0 ..^ S ¬ d x B
42 20 41 bitr3d φ d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M d A repr S M x 0 ..^ S ¬ d x B
43 fveq1 c = d c x = d x
44 43 eleq1d c = d c x B d x B
45 44 notbid c = d ¬ c x B ¬ d x B
46 45 elrab d c A repr S M | ¬ c x B d A repr S M ¬ d x B
47 46 rexbii x 0 ..^ S d c A repr S M | ¬ c x B x 0 ..^ S d A repr S M ¬ d x B
48 r19.42v x 0 ..^ S d A repr S M ¬ d x B d A repr S M x 0 ..^ S ¬ d x B
49 47 48 bitri x 0 ..^ S d c A repr S M | ¬ c x B d A repr S M x 0 ..^ S ¬ d x B
50 42 49 bitr4di φ d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M x 0 ..^ S d c A repr S M | ¬ c x B
51 rabid d d A 0 ..^ S B 0 ..^ S | a 0 ..^ S d a = M d A 0 ..^ S B 0 ..^ S a 0 ..^ S d a = M
52 eliun d x 0 ..^ S c A repr S M | ¬ c x B x 0 ..^ S d c A repr S M | ¬ c x B
53 50 51 52 3bitr4g φ d d A 0 ..^ S B 0 ..^ S | a 0 ..^ S d a = M d x 0 ..^ S c A repr S M | ¬ c x B
54 6 7 8 53 eqrd φ d A 0 ..^ S B 0 ..^ S | a 0 ..^ S d a = M = x 0 ..^ S c A repr S M | ¬ c x B
55 3 9 5 reprval φ B repr S M = d B 0 ..^ S | a 0 ..^ S d a = M
56 10 55 difeq12d φ A repr S M B repr S M = d A 0 ..^ S | a 0 ..^ S d a = M d B 0 ..^ S | a 0 ..^ S d a = M
57 difrab2 d A 0 ..^ S | a 0 ..^ S d a = M d B 0 ..^ S | a 0 ..^ S d a = M = d A 0 ..^ S B 0 ..^ S | a 0 ..^ S d a = M
58 56 57 eqtrdi φ A repr S M B repr S M = d A 0 ..^ S B 0 ..^ S | a 0 ..^ S d a = M
59 1 a1i φ C = c A repr S M | ¬ c x B
60 59 iuneq2d φ x 0 ..^ S C = x 0 ..^ S c A repr S M | ¬ c x B
61 54 58 60 3eqtr4d φ A repr S M B repr S M = x 0 ..^ S C