| Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
| Mirrors > Home > MPE Home > Th. List > eulerth | Structured version Visualization version GIF version | ||
| Description: Euler's theorem, a generalization of Fermat's little theorem. If 𝐴 and 𝑁 are coprime, then 𝐴↑ϕ(𝑁)≡1 (mod 𝑁). This is Metamath 100 proof #10. Also called Euler-Fermat theorem, see theorem 5.17 in [ApostolNT] p. 113. (Contributed by Mario Carneiro, 28-Feb-2014.) |
| Ref | Expression |
|---|---|
| eulerth | ⊢ ((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) → ((𝐴↑(ϕ‘𝑁)) mod 𝑁) = (1 mod 𝑁)) |
| Step | Hyp | Ref | Expression |
|---|---|---|---|
| 1 | phicl 16672 | . . . . . . . 8 ⊢ (𝑁 ∈ ℕ → (ϕ‘𝑁) ∈ ℕ) | |
| 2 | 1 | nnnn0d 12434 | . . . . . . 7 ⊢ (𝑁 ∈ ℕ → (ϕ‘𝑁) ∈ ℕ0) |
| 3 | hashfz1 14245 | . . . . . . 7 ⊢ ((ϕ‘𝑁) ∈ ℕ0 → (♯‘(1...(ϕ‘𝑁))) = (ϕ‘𝑁)) | |
| 4 | 2, 3 | syl 17 | . . . . . 6 ⊢ (𝑁 ∈ ℕ → (♯‘(1...(ϕ‘𝑁))) = (ϕ‘𝑁)) |
| 5 | dfphi2 16677 | . . . . . 6 ⊢ (𝑁 ∈ ℕ → (ϕ‘𝑁) = (♯‘{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1})) | |
| 6 | 4, 5 | eqtrd 2765 | . . . . 5 ⊢ (𝑁 ∈ ℕ → (♯‘(1...(ϕ‘𝑁))) = (♯‘{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1})) |
| 7 | 6 | 3ad2ant1 1133 | . . . 4 ⊢ ((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) → (♯‘(1...(ϕ‘𝑁))) = (♯‘{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1})) |
| 8 | fzfi 13871 | . . . . 5 ⊢ (1...(ϕ‘𝑁)) ∈ Fin | |
| 9 | fzofi 13873 | . . . . . 6 ⊢ (0..^𝑁) ∈ Fin | |
| 10 | ssrab2 4028 | . . . . . 6 ⊢ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} ⊆ (0..^𝑁) | |
| 11 | ssfi 9077 | . . . . . 6 ⊢ (((0..^𝑁) ∈ Fin ∧ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} ⊆ (0..^𝑁)) → {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} ∈ Fin) | |
| 12 | 9, 10, 11 | mp2an 692 | . . . . 5 ⊢ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} ∈ Fin |
| 13 | hashen 14246 | . . . . 5 ⊢ (((1...(ϕ‘𝑁)) ∈ Fin ∧ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} ∈ Fin) → ((♯‘(1...(ϕ‘𝑁))) = (♯‘{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) ↔ (1...(ϕ‘𝑁)) ≈ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1})) | |
| 14 | 8, 12, 13 | mp2an 692 | . . . 4 ⊢ ((♯‘(1...(ϕ‘𝑁))) = (♯‘{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) ↔ (1...(ϕ‘𝑁)) ≈ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) |
| 15 | 7, 14 | sylib 218 | . . 3 ⊢ ((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) → (1...(ϕ‘𝑁)) ≈ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) |
| 16 | bren 8874 | . . 3 ⊢ ((1...(ϕ‘𝑁)) ≈ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} ↔ ∃𝑓 𝑓:(1...(ϕ‘𝑁))–1-1-onto→{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) | |
| 17 | 15, 16 | sylib 218 | . 2 ⊢ ((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) → ∃𝑓 𝑓:(1...(ϕ‘𝑁))–1-1-onto→{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) |
| 18 | simpl 482 | . . 3 ⊢ (((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) ∧ 𝑓:(1...(ϕ‘𝑁))–1-1-onto→{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) → (𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1)) | |
| 19 | oveq1 7348 | . . . . 5 ⊢ (𝑘 = 𝑦 → (𝑘 gcd 𝑁) = (𝑦 gcd 𝑁)) | |
| 20 | 19 | eqeq1d 2732 | . . . 4 ⊢ (𝑘 = 𝑦 → ((𝑘 gcd 𝑁) = 1 ↔ (𝑦 gcd 𝑁) = 1)) |
| 21 | 20 | cbvrabv 3403 | . . 3 ⊢ {𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1} = {𝑦 ∈ (0..^𝑁) ∣ (𝑦 gcd 𝑁) = 1} |
| 22 | eqid 2730 | . . 3 ⊢ (1...(ϕ‘𝑁)) = (1...(ϕ‘𝑁)) | |
| 23 | simpr 484 | . . 3 ⊢ (((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) ∧ 𝑓:(1...(ϕ‘𝑁))–1-1-onto→{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) → 𝑓:(1...(ϕ‘𝑁))–1-1-onto→{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) | |
| 24 | fveq2 6817 | . . . . . 6 ⊢ (𝑘 = 𝑥 → (𝑓‘𝑘) = (𝑓‘𝑥)) | |
| 25 | 24 | oveq2d 7357 | . . . . 5 ⊢ (𝑘 = 𝑥 → (𝐴 · (𝑓‘𝑘)) = (𝐴 · (𝑓‘𝑥))) |
| 26 | 25 | oveq1d 7356 | . . . 4 ⊢ (𝑘 = 𝑥 → ((𝐴 · (𝑓‘𝑘)) mod 𝑁) = ((𝐴 · (𝑓‘𝑥)) mod 𝑁)) |
| 27 | 26 | cbvmptv 5193 | . . 3 ⊢ (𝑘 ∈ (1...(ϕ‘𝑁)) ↦ ((𝐴 · (𝑓‘𝑘)) mod 𝑁)) = (𝑥 ∈ (1...(ϕ‘𝑁)) ↦ ((𝐴 · (𝑓‘𝑥)) mod 𝑁)) |
| 28 | 18, 21, 22, 23, 27 | eulerthlem2 16685 | . 2 ⊢ (((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) ∧ 𝑓:(1...(ϕ‘𝑁))–1-1-onto→{𝑘 ∈ (0..^𝑁) ∣ (𝑘 gcd 𝑁) = 1}) → ((𝐴↑(ϕ‘𝑁)) mod 𝑁) = (1 mod 𝑁)) |
| 29 | 17, 28 | exlimddv 1936 | 1 ⊢ ((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑁) = 1) → ((𝐴↑(ϕ‘𝑁)) mod 𝑁) = (1 mod 𝑁)) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ↔ wb 206 ∧ wa 395 ∧ w3a 1086 = wceq 1541 ∃wex 1780 ∈ wcel 2110 {crab 3393 ⊆ wss 3900 class class class wbr 5089 ↦ cmpt 5170 –1-1-onto→wf1o 6476 ‘cfv 6477 (class class class)co 7341 ≈ cen 8861 Fincfn 8864 0cc0 10998 1c1 10999 · cmul 11003 ℕcn 12117 ℕ0cn0 12373 ℤcz 12460 ...cfz 13399 ..^cfzo 13546 mod cmo 13765 ↑cexp 13960 ♯chash 14229 gcd cgcd 16397 ϕcphi 16667 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1796 ax-4 1810 ax-5 1911 ax-6 1968 ax-7 2009 ax-8 2112 ax-9 2120 ax-10 2143 ax-11 2159 ax-12 2179 ax-ext 2702 ax-rep 5215 ax-sep 5232 ax-nul 5242 ax-pow 5301 ax-pr 5368 ax-un 7663 ax-cnex 11054 ax-resscn 11055 ax-1cn 11056 ax-icn 11057 ax-addcl 11058 ax-addrcl 11059 ax-mulcl 11060 ax-mulrcl 11061 ax-mulcom 11062 ax-addass 11063 ax-mulass 11064 ax-distr 11065 ax-i2m1 11066 ax-1ne0 11067 ax-1rid 11068 ax-rnegex 11069 ax-rrecex 11070 ax-cnre 11071 ax-pre-lttri 11072 ax-pre-lttrn 11073 ax-pre-ltadd 11074 ax-pre-mulgt0 11075 ax-pre-sup 11076 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 848 df-3or 1087 df-3an 1088 df-tru 1544 df-fal 1554 df-ex 1781 df-nf 1785 df-sb 2067 df-mo 2534 df-eu 2563 df-clab 2709 df-cleq 2722 df-clel 2804 df-nfc 2879 df-ne 2927 df-nel 3031 df-ral 3046 df-rex 3055 df-rmo 3344 df-reu 3345 df-rab 3394 df-v 3436 df-sbc 3740 df-csb 3849 df-dif 3903 df-un 3905 df-in 3907 df-ss 3917 df-pss 3920 df-nul 4282 df-if 4474 df-pw 4550 df-sn 4575 df-pr 4577 df-op 4581 df-uni 4858 df-int 4896 df-iun 4941 df-br 5090 df-opab 5152 df-mpt 5171 df-tr 5197 df-id 5509 df-eprel 5514 df-po 5522 df-so 5523 df-fr 5567 df-we 5569 df-xp 5620 df-rel 5621 df-cnv 5622 df-co 5623 df-dm 5624 df-rn 5625 df-res 5626 df-ima 5627 df-pred 6244 df-ord 6305 df-on 6306 df-lim 6307 df-suc 6308 df-iota 6433 df-fun 6479 df-fn 6480 df-f 6481 df-f1 6482 df-fo 6483 df-f1o 6484 df-fv 6485 df-riota 7298 df-ov 7344 df-oprab 7345 df-mpo 7346 df-om 7792 df-1st 7916 df-2nd 7917 df-frecs 8206 df-wrecs 8237 df-recs 8286 df-rdg 8324 df-1o 8380 df-oadd 8384 df-er 8617 df-en 8865 df-dom 8866 df-sdom 8867 df-fin 8868 df-sup 9321 df-inf 9322 df-card 9824 df-pnf 11140 df-mnf 11141 df-xr 11142 df-ltxr 11143 df-le 11144 df-sub 11338 df-neg 11339 df-div 11767 df-nn 12118 df-2 12180 df-3 12181 df-n0 12374 df-xnn0 12447 df-z 12461 df-uz 12725 df-rp 12883 df-fz 13400 df-fzo 13547 df-fl 13688 df-mod 13766 df-seq 13901 df-exp 13961 df-hash 14230 df-cj 14998 df-re 14999 df-im 15000 df-sqrt 15134 df-abs 15135 df-dvds 16156 df-gcd 16398 df-phi 16669 |
| This theorem is referenced by: fermltl 16687 prmdiv 16688 odzcllem 16696 odzphi 16700 vfermltl 16705 lgslem1 27228 lgsqrlem2 27278 |
| Copyright terms: Public domain | W3C validator |