MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  eucalgval2 Structured version   Visualization version   GIF version

Theorem eucalgval2 15780
Description: The value of the step function 𝐸 for Euclid's Algorithm on an ordered pair. (Contributed by Paul Chapman, 31-Mar-2011.) (Revised by Mario Carneiro, 28-May-2014.)
Hypothesis
Ref Expression
eucalgval.1 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0 ↦ if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩))
Assertion
Ref Expression
eucalgval2 ((𝑀 ∈ ℕ0𝑁 ∈ ℕ0) → (𝑀𝐸𝑁) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
Distinct variable groups:   𝑥,𝑦,𝑀   𝑥,𝑁,𝑦
Allowed substitution hints:   𝐸(𝑥,𝑦)

Proof of Theorem eucalgval2
StepHypRef Expression
1 simpr 477 . . . 4 ((𝑥 = 𝑀𝑦 = 𝑁) → 𝑦 = 𝑁)
21eqeq1d 2775 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → (𝑦 = 0 ↔ 𝑁 = 0))
3 opeq12 4676 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → ⟨𝑥, 𝑦⟩ = ⟨𝑀, 𝑁⟩)
4 oveq12 6984 . . . 4 ((𝑥 = 𝑀𝑦 = 𝑁) → (𝑥 mod 𝑦) = (𝑀 mod 𝑁))
51, 4opeq12d 4682 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → ⟨𝑦, (𝑥 mod 𝑦)⟩ = ⟨𝑁, (𝑀 mod 𝑁)⟩)
62, 3, 5ifbieq12d 4372 . 2 ((𝑥 = 𝑀𝑦 = 𝑁) → if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
7 eucalgval.1 . 2 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0 ↦ if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩))
8 opex 5210 . . 3 𝑀, 𝑁⟩ ∈ V
9 opex 5210 . . 3 𝑁, (𝑀 mod 𝑁)⟩ ∈ V
108, 9ifex 4393 . 2 if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩) ∈ V
116, 7, 10ovmpoa 7120 1 ((𝑀 ∈ ℕ0𝑁 ∈ ℕ0) → (𝑀𝐸𝑁) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 387   = wceq 1508  wcel 2051  ifcif 4345  cop 4442  (class class class)co 6975  cmpo 6977  0cc0 10334  0cn0 11706   mod cmo 13051
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1759  ax-4 1773  ax-5 1870  ax-6 1929  ax-7 1966  ax-8 2053  ax-9 2060  ax-10 2080  ax-11 2094  ax-12 2107  ax-13 2302  ax-ext 2745  ax-sep 5057  ax-nul 5064  ax-pr 5183
This theorem depends on definitions:  df-bi 199  df-an 388  df-or 835  df-3an 1071  df-tru 1511  df-ex 1744  df-nf 1748  df-sb 2017  df-mo 2548  df-eu 2585  df-clab 2754  df-cleq 2766  df-clel 2841  df-nfc 2913  df-ral 3088  df-rex 3089  df-rab 3092  df-v 3412  df-sbc 3677  df-dif 3827  df-un 3829  df-in 3831  df-ss 3838  df-nul 4174  df-if 4346  df-sn 4437  df-pr 4439  df-op 4443  df-uni 4710  df-br 4927  df-opab 4989  df-id 5309  df-xp 5410  df-rel 5411  df-cnv 5412  df-co 5413  df-dm 5414  df-iota 6150  df-fun 6188  df-fv 6194  df-ov 6978  df-oprab 6979  df-mpo 6980
This theorem is referenced by:  eucalgval  15781
  Copyright terms: Public domain W3C validator