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

Theorem eucalgval2 15003
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 475 . . . 4 ((𝑥 = 𝑀𝑦 = 𝑁) → 𝑦 = 𝑁)
21eqeq1d 2516 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → (𝑦 = 0 ↔ 𝑁 = 0))
3 opeq12 4240 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → ⟨𝑥, 𝑦⟩ = ⟨𝑀, 𝑁⟩)
4 oveq12 6434 . . . 4 ((𝑥 = 𝑀𝑦 = 𝑁) → (𝑥 mod 𝑦) = (𝑀 mod 𝑁))
51, 4opeq12d 4246 . . 3 ((𝑥 = 𝑀𝑦 = 𝑁) → ⟨𝑦, (𝑥 mod 𝑦)⟩ = ⟨𝑁, (𝑀 mod 𝑁)⟩)
62, 3, 5ifbieq12d 3966 . 2 ((𝑥 = 𝑀𝑦 = 𝑁) → if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
7 eucalgval.1 . 2 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0 ↦ if(𝑦 = 0, ⟨𝑥, 𝑦⟩, ⟨𝑦, (𝑥 mod 𝑦)⟩))
8 opex 4757 . . 3 𝑀, 𝑁⟩ ∈ V
9 opex 4757 . . 3 𝑁, (𝑀 mod 𝑁)⟩ ∈ V
108, 9ifex 4009 . 2 if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩) ∈ V
116, 7, 10ovmpt2a 6564 1 ((𝑀 ∈ ℕ0𝑁 ∈ ℕ0) → (𝑀𝐸𝑁) = if(𝑁 = 0, ⟨𝑀, 𝑁⟩, ⟨𝑁, (𝑀 mod 𝑁)⟩))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1474  wcel 1938  ifcif 3939  cop 4034  (class class class)co 6425  cmpt2 6427  0cc0 9689  0cn0 11045   mod cmo 12394
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1700  ax-4 1713  ax-5 1793  ax-6 1838  ax-7 1885  ax-9 1947  ax-10 1966  ax-11 1971  ax-12 1983  ax-13 2137  ax-ext 2494  ax-sep 4607  ax-nul 4616  ax-pr 4732
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1699  df-sb 1831  df-eu 2366  df-mo 2367  df-clab 2501  df-cleq 2507  df-clel 2510  df-nfc 2644  df-ral 2805  df-rex 2806  df-rab 2809  df-v 3079  df-sbc 3307  df-dif 3447  df-un 3449  df-in 3451  df-ss 3458  df-nul 3778  df-if 3940  df-sn 4029  df-pr 4031  df-op 4035  df-uni 4271  df-br 4482  df-opab 4542  df-id 4847  df-xp 4938  df-rel 4939  df-cnv 4940  df-co 4941  df-dm 4942  df-iota 5653  df-fun 5691  df-fv 5697  df-ov 6428  df-oprab 6429  df-mpt2 6430
This theorem is referenced by:  eucalgval  15004
  Copyright terms: Public domain W3C validator