Skip to content

Instantly share code, notes, and snippets.

@cppio
Created September 7, 2023 15:14
Show Gist options
  • Select an option

  • Save cppio/c0308fc792b91cbbe455b25918767a93 to your computer and use it in GitHub Desktop.

Select an option

Save cppio/c0308fc792b91cbbe455b25918767a93 to your computer and use it in GitHub Desktop.
{-# OPTIONS --cubical-compatible #-}
open import Data.Nat.Base
open import Data.Product
open import Relation.Nullary
open import Relation.Unary
module Markov {p} (P : ℕ → Set p) (dec : Decidable P) .(h : Σ ℕ P) where
{-# TERMINATING #-}
markov′ : ∀ n → (∀ m → m <′ n → ¬ P m) → Σ ℕ P
markov′ n pf with dec n
... | yes p = n , p
... | no p = markov′ (suc n) λ where
n ≤′-refl → p
m (≤′-step lt) → pf m lt
markov : Σ ℕ P
markov = markov′ zero λ _ ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment