Metamath Proof Explorer


Theorem eulerthlem1

Description: Lemma for eulerth . (Contributed by Mario Carneiro, 8-May-2015)

Ref Expression
Hypotheses eulerth.1 φ N A A gcd N = 1
eulerth.2 S = y 0 ..^ N | y gcd N = 1
eulerth.3 T = 1 ϕ N
eulerth.4 φ F : T 1-1 onto S
eulerth.5 G = x T A F x mod N
Assertion eulerthlem1 φ G : T S

Proof

Step Hyp Ref Expression
1 eulerth.1 φ N A A gcd N = 1
2 eulerth.2 S = y 0 ..^ N | y gcd N = 1
3 eulerth.3 T = 1 ϕ N
4 eulerth.4 φ F : T 1-1 onto S
5 eulerth.5 G = x T A F x mod N
6 1 simp2d φ A
7 6 adantr φ x T A
8 f1of F : T 1-1 onto S F : T S
9 4 8 syl φ F : T S
10 9 ffvelrnda φ x T F x S
11 oveq1 y = F x y gcd N = F x gcd N
12 11 eqeq1d y = F x y gcd N = 1 F x gcd N = 1
13 12 2 elrab2 F x S F x 0 ..^ N F x gcd N = 1
14 10 13 sylib φ x T F x 0 ..^ N F x gcd N = 1
15 14 simpld φ x T F x 0 ..^ N
16 elfzoelz F x 0 ..^ N F x
17 15 16 syl φ x T F x
18 7 17 zmulcld φ x T A F x
19 1 simp1d φ N
20 19 adantr φ x T N
21 zmodfzo A F x N A F x mod N 0 ..^ N
22 18 20 21 syl2anc φ x T A F x mod N 0 ..^ N
23 modgcd A F x N A F x mod N gcd N = A F x gcd N
24 18 20 23 syl2anc φ x T A F x mod N gcd N = A F x gcd N
25 19 nnzd φ N
26 25 adantr φ x T N
27 18 26 gcdcomd φ x T A F x gcd N = N gcd A F x
28 25 6 gcdcomd φ N gcd A = A gcd N
29 1 simp3d φ A gcd N = 1
30 28 29 eqtrd φ N gcd A = 1
31 30 adantr φ x T N gcd A = 1
32 26 17 gcdcomd φ x T N gcd F x = F x gcd N
33 14 simprd φ x T F x gcd N = 1
34 32 33 eqtrd φ x T N gcd F x = 1
35 rpmul N A F x N gcd A = 1 N gcd F x = 1 N gcd A F x = 1
36 26 7 17 35 syl3anc φ x T N gcd A = 1 N gcd F x = 1 N gcd A F x = 1
37 31 34 36 mp2and φ x T N gcd A F x = 1
38 24 27 37 3eqtrd φ x T A F x mod N gcd N = 1
39 oveq1 y = A F x mod N y gcd N = A F x mod N gcd N
40 39 eqeq1d y = A F x mod N y gcd N = 1 A F x mod N gcd N = 1
41 40 2 elrab2 A F x mod N S A F x mod N 0 ..^ N A F x mod N gcd N = 1
42 22 38 41 sylanbrc φ x T A F x mod N S
43 42 5 fmptd φ G : T S