Metamath Proof Explorer


Theorem prmonn2

Description: Value of the primorial function expressed recursively. (Contributed by AV, 28-Aug-2020)

Ref Expression
Assertion prmonn2 N # p N = if N # p N 1 N # p N 1

Proof

Step Hyp Ref Expression
1 nncn N N
2 npcan1 N N - 1 + 1 = N
3 1 2 syl N N - 1 + 1 = N
4 3 eqcomd N N = N - 1 + 1
5 4 fveq2d N # p N = # p N - 1 + 1
6 nnm1nn0 N N 1 0
7 prmop1 N 1 0 # p N - 1 + 1 = if N - 1 + 1 # p N 1 N - 1 + 1 # p N 1
8 6 7 syl N # p N - 1 + 1 = if N - 1 + 1 # p N 1 N - 1 + 1 # p N 1
9 3 eleq1d N N - 1 + 1 N
10 3 oveq2d N # p N 1 N - 1 + 1 = # p N 1 N
11 9 10 ifbieq1d N if N - 1 + 1 # p N 1 N - 1 + 1 # p N 1 = if N # p N 1 N # p N 1
12 5 8 11 3eqtrd N # p N = if N # p N 1 N # p N 1