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

Theorem eucalgval2 16383
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 485 . . . 4 ((𝑥 = 𝑀𝑦 = 𝑁) → 𝑦 = 𝑁)
21eqeq1d 2738 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → (𝑦 = 0 ↔ 𝑁 = 0))
3 opeq12 4819 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → ⟨𝑥, 𝑦⟩ = ⟨𝑀, 𝑁⟩)
4 oveq12 7346 . . . 4 ((𝑥 = 𝑀𝑦 = 𝑁) → (𝑥 mod 𝑦) = (𝑀 mod 𝑁))
51, 4opeq12d 4825 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → ⟨𝑦, (𝑥 mod 𝑦)⟩ = ⟨𝑁, (𝑀 mod 𝑁)⟩)
62, 3, 5ifbieq12d 4501 . 2 ((𝑥 = 𝑀𝑦 = 𝑁) → if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
7 eucalgval.1 . 2 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0 ↦ if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩))
8 opex 5409 . . 3 𝑀, 𝑁⟩ ∈ V
9 opex 5409 . . 3 𝑁, (𝑀 mod 𝑁)⟩ ∈ V
108, 9ifex 4523 . 2 if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩) ∈ V
116, 7, 10ovmpoa 7490 1 ((𝑀 ∈ ℕ0𝑁 ∈ ℕ0) → (𝑀𝐸𝑁) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 396   = wceq 1540  wcel 2105  ifcif 4473  cop 4579  (class class class)co 7337  cmpo 7339  0cc0 10972  0cn0 12334   mod cmo 13690
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 1912  ax-6 1970  ax-7 2010  ax-8 2107  ax-9 2115  ax-10 2136  ax-11 2153  ax-12 2170  ax-ext 2707  ax-sep 5243  ax-nul 5250  ax-pr 5372
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 845  df-3an 1088  df-tru 1543  df-fal 1553  df-ex 1781  df-nf 1785  df-sb 2067  df-mo 2538  df-eu 2567  df-clab 2714  df-cleq 2728  df-clel 2814  df-nfc 2886  df-ral 3062  df-rex 3071  df-rab 3404  df-v 3443  df-sbc 3728  df-dif 3901  df-un 3903  df-in 3905  df-ss 3915  df-nul 4270  df-if 4474  df-sn 4574  df-pr 4576  df-op 4580  df-uni 4853  df-br 5093  df-opab 5155  df-id 5518  df-xp 5626  df-rel 5627  df-cnv 5628  df-co 5629  df-dm 5630  df-iota 6431  df-fun 6481  df-fv 6487  df-ov 7340  df-oprab 7341  df-mpo 7342
This theorem is referenced by:  eucalgval  16384
  Copyright terms: Public domain W3C validator