Skip to content

Instantly share code, notes, and snippets.

@EduardoRFS
Created June 25, 2023 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EduardoRFS/398119cf8094b28b10b89428a0a2ba37 to your computer and use it in GitHub Desktop.
Save EduardoRFS/398119cf8094b28b10b89428a0a2ba37 to your computer and use it in GitHub Desktop.
Γ, x : %self(x). T |- T : Type
------------------------------
%self(x). T : Type

Γ, x : %self(x). T,
  eq : %self(eq). (P : T -> Type) -> P (%unroll x) -> P M |- M : T[x := M]
--------------------------------------------------------------------------
%fix(self%x : T, eq). M : %self(x). T

Γ |- M : %self(x). T
---------------------
%unroll M : T[x := M]

---------------------------------------------------
%unroll (%fix(self%x : T, eq). M) ===
M[x := %fix(self%x : T, eq). M]
 [eq := %fix(eq, _). (P : T -> Type) => (x : P M) => x]


fix%Unit (self%unit : %self(u). %unroll Unit unit u) (self%u : %unroll Unit unit u) =
  (P : (self%u : %unroll Unit unit u) -> Type) -> P (%unroll unit) -> P u;
unit : %self(unit). %self(u). %unroll Unit unit u =
  %fix(unit, eq). %fix(u, _). P => x => %unroll eq P x;

Unit = %self(u). %unroll Unit unit u;
unit : Unit = %unroll unit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment