Metamath Proof Explorer


Theorem prmop1

Description: The primorial of a successor. (Contributed by AV, 28-Aug-2020)

Ref Expression
Assertion prmop1 N 0 # p N + 1 = if N + 1 # p N N + 1 # p N

Proof

Step Hyp Ref Expression
1 peano2nn0 N 0 N + 1 0
2 prmoval N + 1 0 # p N + 1 = k = 1 N + 1 if k k 1
3 1 2 syl N 0 # p N + 1 = k = 1 N + 1 if k k 1
4 nn0p1nn N 0 N + 1
5 elnnuz N + 1 N + 1 1
6 4 5 sylib N 0 N + 1 1
7 elfzelz k 1 N + 1 k
8 7 zcnd k 1 N + 1 k
9 8 adantl N 0 k 1 N + 1 k
10 1cnd N 0 k 1 N + 1 1
11 9 10 ifcld N 0 k 1 N + 1 if k k 1
12 eleq1 k = N + 1 k N + 1
13 id k = N + 1 k = N + 1
14 12 13 ifbieq1d k = N + 1 if k k 1 = if N + 1 N + 1 1
15 6 11 14 fprodm1 N 0 k = 1 N + 1 if k k 1 = k = 1 N + 1 - 1 if k k 1 if N + 1 N + 1 1
16 nn0cn N 0 N
17 pncan1 N N + 1 - 1 = N
18 16 17 syl N 0 N + 1 - 1 = N
19 18 oveq2d N 0 1 N + 1 - 1 = 1 N
20 19 prodeq1d N 0 k = 1 N + 1 - 1 if k k 1 = k = 1 N if k k 1
21 20 oveq1d N 0 k = 1 N + 1 - 1 if k k 1 if N + 1 N + 1 1 = k = 1 N if k k 1 if N + 1 N + 1 1
22 prmoval N 0 # p N = k = 1 N if k k 1
23 22 eqcomd N 0 k = 1 N if k k 1 = # p N
24 23 adantl N + 1 N 0 k = 1 N if k k 1 = # p N
25 24 oveq1d N + 1 N 0 k = 1 N if k k 1 N + 1 = # p N N + 1
26 iftrue N + 1 if N + 1 N + 1 1 = N + 1
27 26 oveq2d N + 1 k = 1 N if k k 1 if N + 1 N + 1 1 = k = 1 N if k k 1 N + 1
28 iftrue N + 1 if N + 1 # p N N + 1 # p N = # p N N + 1
29 27 28 eqeq12d N + 1 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N k = 1 N if k k 1 N + 1 = # p N N + 1
30 29 adantr N + 1 N 0 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N k = 1 N if k k 1 N + 1 = # p N N + 1
31 25 30 mpbird N + 1 N 0 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N
32 fzfid N 0 1 N Fin
33 elfznn k 1 N k
34 1nn 1
35 34 a1i k 1 N 1
36 33 35 ifcld k 1 N if k k 1
37 36 adantl N 0 k 1 N if k k 1
38 32 37 fprodnncl N 0 k = 1 N if k k 1
39 38 nncnd N 0 k = 1 N if k k 1
40 39 adantl ¬ N + 1 N 0 k = 1 N if k k 1
41 40 mulid1d ¬ N + 1 N 0 k = 1 N if k k 1 1 = k = 1 N if k k 1
42 22 adantl ¬ N + 1 N 0 # p N = k = 1 N if k k 1
43 41 42 eqtr4d ¬ N + 1 N 0 k = 1 N if k k 1 1 = # p N
44 iffalse ¬ N + 1 if N + 1 N + 1 1 = 1
45 44 oveq2d ¬ N + 1 k = 1 N if k k 1 if N + 1 N + 1 1 = k = 1 N if k k 1 1
46 iffalse ¬ N + 1 if N + 1 # p N N + 1 # p N = # p N
47 45 46 eqeq12d ¬ N + 1 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N k = 1 N if k k 1 1 = # p N
48 47 adantr ¬ N + 1 N 0 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N k = 1 N if k k 1 1 = # p N
49 43 48 mpbird ¬ N + 1 N 0 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N
50 31 49 pm2.61ian N 0 k = 1 N if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N
51 21 50 eqtrd N 0 k = 1 N + 1 - 1 if k k 1 if N + 1 N + 1 1 = if N + 1 # p N N + 1 # p N
52 3 15 51 3eqtrd N 0 # p N + 1 = if N + 1 # p N N + 1 # p N