module J-DC where

open import Logic
open import LogicalFacts
open import JK-LogicalFacts
open import Naturals
open import Addition
open import JK-Monads
open import Choice
open import Equality
open import J-Shift

-----------------------------------------------------------
--                                                       --
-- Translation of dependent choice for a particular case --
--                                                       --
-----------------------------------------------------------

J-∀-double-shift : {R : Ω} {P :       Ω} 
---------------
     (∀(n : )  ∀(x : )  J∃ \(y : )  P n x y) 
     J(∀(n : )  ∀(x : )   \(y : )  P n x y)

J-∀-double-shift {R} f = J-∀-shift {R}  n  J-∀-shift (f n))


J-DC-ℕ : {R : Ω} {P :       Ω} 
-------
      ∀(x₀ : ) 
     (∀(n : )  ∀(x : )  J∃ \(y : )  P n x y) 
     J∃ \(α :   )  α O  x₀  (∀(n : )  P n (α n) (α(n + 1)))

J-DC-ℕ {R} x₀ f = (J-functor {R} (DC x₀)) (J-∀-double-shift f)