Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

K230: the compact theory K

Definition
K230_theoryK

by LG · Nov 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

The compact first-order set theory K. For a matrix φ\varphiφ, emittedClosure φ asserts that whenever an input lies in a container, the container supplies an output of φ\varphiφ and is closed under subset-witness requests; kprimeCore φ is its output-root universal closure. KPrimeOrd is the theory of equality axioms plus all closed universal instances of kprimeCore; KPrimeOrdIR adds irreflexivity ∀x ¬(x∈x)\forall x\,\neg(x\in x)∀x¬(x∈x). Ports KPrimeCore.v, KPrimeTheory.v, KP0.v, KPSeed.v, KPRaw.v.

Definition code
import Definitions.Def_K230_fol
namespace K230
def rawSubset (a b : Nat) : Form := .all (.impl (mem 0 (a + 1)) (mem 0 (b + 1)))
def emittedClosure (φ : Form) : Form :=
  .all (.impl (mem 0 1)
    (.ex (.conj (subst φ (scons 1 (scons 0 (fun k => 4 + k))))
      (.all (.impl (rawSubset 0 2)
        (.all (.impl (subst φ (scons 0 (scons 1 (fun k => 6 + k))))
          (.ex (.conj (subst φ (scons 0 (scons 2 (fun k => 7 + k)))) (mem 0 5))))))))))
def outputRoot (P H : Form) : Form := .all (.ex (.conj (.impl (subst P shift) (mem 1 0)) (subst H (up shift))))
def seedRoot (P H : Form) : Form := .ex (.conj (.impl (subst (.ex P) shift) (.ex (.conj (mem 0 1) (subst P (up shift))))) H)
def kprimeCore (φ : Form) : Form := .all (outputRoot φ (emittedClosure φ))
inductive KPrimeOrd : Form → Prop where
  | eq {φ : Form} : φ ∈ equalityAxioms → KPrimeOrd φ
  | instance (φ : Form) (n : Nat) : closedf (forallTimes n (kprimeCore φ)) → KPrimeOrd (forallTimes n (kprimeCore φ))
def irreflexivity : Form := .all (neg (mem 0 0))
def KPrimeOrdIR (φ : Form) : Prop := KPrimeOrd φ ∨ φ = irreflexivity
end K230
Source
https://github.com/elliotglazer/k230-rocq/blob/main/coq/settheory/KPrimeTheory.v

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me