Skip to content

Instantly share code, notes, and snippets.

View Arrow7000's full-sized avatar
πŸ‘¨β€πŸ’»
thinking about types

Aron Adler Arrow7000

πŸ‘¨β€πŸ’»
thinking about types
View GitHub Profile
@Arrow7000
Arrow7000 / DisjointSetMap.lean
Last active March 18, 2025 10:28
Very simple type universe and zonking implementation
import Std.Data.HashMap
import Std.Data.HashSet
import Mathlib
open Std
instance {k} [BEq k] [Hashable k] : Hashable (HashSet k) where
hash := hash ∘ HashSet.toArray
def BoundedNat (min max : Nat) : Type :=
{n : Nat // min ≀ n ∧ n ≀ max}
def BoundedNat.mk {min max : Nat} (n : Nat) (h : min ≀ n ∧ n ≀ max) : BoundedNat min max :=
⟨n, h⟩
def BoundedNat.val {min max : Nat} (n : BoundedNat min max) : Nat :=
n.1
@Arrow7000
Arrow7000 / .gitconfig
Last active April 16, 2025 11:23
My .gitconfig
[branch]
autoSetupRebase = always
[merge]
defaultToUpstream = true
log = true
[pull]
rebase = true
[push]
default = upstream
autoSetupRemote = true