Metamath Proof Explorer


Theorem odzval

Description: Value of the order function. This is a function of functions; the inner argument selects the base (i.e., mod N for some N , often prime) and the outer argument selects the integer or equivalence class (if you want to think about it that way) from the integers mod N . In order to ensure the supremum is well-defined, we only define the expression when A and N are coprime. (Contributed by Mario Carneiro, 23-Feb-2014) (Revised by AV, 26-Sep-2020)

Ref Expression
Assertion odzval N A A gcd N = 1 od N A = sup n | N A n 1 <

Proof

Step Hyp Ref Expression
1 oveq2 m = N x gcd m = x gcd N
2 1 eqeq1d m = N x gcd m = 1 x gcd N = 1
3 2 rabbidv m = N x | x gcd m = 1 = x | x gcd N = 1
4 oveq1 n = x n gcd N = x gcd N
5 4 eqeq1d n = x n gcd N = 1 x gcd N = 1
6 5 cbvrabv n | n gcd N = 1 = x | x gcd N = 1
7 3 6 eqtr4di m = N x | x gcd m = 1 = n | n gcd N = 1
8 breq1 m = N m x n 1 N x n 1
9 8 rabbidv m = N n | m x n 1 = n | N x n 1
10 9 infeq1d m = N sup n | m x n 1 < = sup n | N x n 1 <
11 7 10 mpteq12dv m = N x x | x gcd m = 1 sup n | m x n 1 < = x n | n gcd N = 1 sup n | N x n 1 <
12 df-odz od = m x x | x gcd m = 1 sup n | m x n 1 <
13 zex V
14 13 mptrabex x n | n gcd N = 1 sup n | N x n 1 < V
15 11 12 14 fvmpt N od N = x n | n gcd N = 1 sup n | N x n 1 <
16 15 fveq1d N od N A = x n | n gcd N = 1 sup n | N x n 1 < A
17 oveq1 n = A n gcd N = A gcd N
18 17 eqeq1d n = A n gcd N = 1 A gcd N = 1
19 18 elrab A n | n gcd N = 1 A A gcd N = 1
20 oveq1 x = A x n = A n
21 20 oveq1d x = A x n 1 = A n 1
22 21 breq2d x = A N x n 1 N A n 1
23 22 rabbidv x = A n | N x n 1 = n | N A n 1
24 23 infeq1d x = A sup n | N x n 1 < = sup n | N A n 1 <
25 eqid x n | n gcd N = 1 sup n | N x n 1 < = x n | n gcd N = 1 sup n | N x n 1 <
26 ltso < Or
27 26 infex sup n | N A n 1 < V
28 24 25 27 fvmpt A n | n gcd N = 1 x n | n gcd N = 1 sup n | N x n 1 < A = sup n | N A n 1 <
29 19 28 sylbir A A gcd N = 1 x n | n gcd N = 1 sup n | N x n 1 < A = sup n | N A n 1 <
30 16 29 sylan9eq N A A gcd N = 1 od N A = sup n | N A n 1 <
31 30 3impb N A A gcd N = 1 od N A = sup n | N A n 1 <