Skip to content

Instantly share code, notes, and snippets.

View AlecsFerra's full-sized avatar
👾
λ

Alessio AlecsFerra

👾
λ
View GitHub Profile
import Mathlib
import Mathlib.Algebra.Group.Pi.Basic
import Mathlib.Algebra.Group.Subgroup.Ker
import Mathlib.Data.List.Chain
import Mathlib.Algebra.Group.Int.Defs
import Mathlib.Algebra.BigOperators.Group.List.Defs
namespace FreeGroup
#! /usr/bin/env bash
DIRS=(
"liquid-prelude"
"liquid-parallel"
"liquid-vector"
"." # This must be the last entry
)
echo "Installing libraries globally..."
@AlecsFerra
AlecsFerra / STLC.thy
Last active December 15, 2025 09:31
Isabelle/ZF proof of consistency of STLC
theory Scratch
imports ZF
begin
consts ty :: "i"
datatype "ty"
= TyNat
| TyBool
| TyArr ("τ ∈ ty", "υ ∈ ty")
@AlecsFerra
AlecsFerra / Rotate.hs
Created September 12, 2025 08:04
Rotate proof
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
module Rotate where
import Language.Haskell.Liquid.ProofCombinators
{-@ measure length' @-}
{-@ length' :: [a] -> Nat @-}
length' :: [a] -> Int
{-# OPTIONS_GHC -fplugin=LiquidHaskell #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--save" @-}
{-@ LIQUID "--dependantcase" @-}
@AlecsFerra
AlecsFerra / State.hs
Last active April 13, 2026 10:19
EtaCtor
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
module State where
import Language.Haskell.Liquid.ProofCombinators
import Prelude hiding (return, (>>=))
data Pair a b = MkPair a b
@AlecsFerra
AlecsFerra / ExprCompiler.hs
Last active April 13, 2026 10:19
Examples for lambdas
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--dependantcase" @-}
module ExprCompiler where
@AlecsFerra
AlecsFerra / CTC.hs
Last active April 13, 2026 10:20
CTC
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
module CTC where
import Prelude hiding (id)
import Language.Haskell.Liquid.ProofCombinators
data Cat k = Cat
@AlecsFerra
AlecsFerra / FuseMap.hs
Created December 12, 2024 15:56
Lambdas
{-# LANGUAGE RankNTypes #-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
{-@ LIQUID "--save" @-}
module FuseMap where
import Prelude hiding (map, foldr)
import Language.Haskell.Liquid.ProofCombinators
{-# OPTIONS_GHC -fplugin=LiquidHaskell #-}
{-# LANGUAGE GADTs #-}
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ LIQUID "--etabeta" @-}
{-@ LIQUID "--dependantcase" @-}
{-@ LIQUID "--max-case-expand=4" @-}
module Langs where