Skip to content

Instantly share code, notes, and snippets.

@louisswarren
Created November 3, 2018 09:50
Show Gist options
  • Save louisswarren/e7e069afc1cb223c07ed7a1fb6a116f1 to your computer and use it in GitHub Desktop.
Save louisswarren/e7e069afc1cb223c07ed7a1fb6a116f1 to your computer and use it in GitHub Desktop.
Frontier algorithm
open import Agda.Primitive
open import Agda.Builtin.Equality
data Chain {n} {A : Set n} (f : A → A) (x : A) : A → Set (lsuc n) where
nil : Chain f x x
link : ∀{y} → Chain f x y → Chain f x (f y)
record FixedPoint {n} {A : Set n} (R : A → A → Set) (f : A → A) : Set (lsuc n) where
constructor fp
field
point : A
fixed : R point (f point)
open FixedPoint public
record Limit {n} {A : Set n} (R : A → A → Set) (f : A → A) (x : A) : Set (lsuc n) where
constructor limit
field
converges : FixedPoint R f
attains : Chain f x (point converges)
open Limit public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment