Zulip Chat Archive
Stream: general
Topic: Arithmetic hierarchy of propositions in Lean
Joseph Tooby-Smith (Jan 23 2026 at 07:55):
Is it possible to talk about the arithmetic hierarchy of propositions in Lean, or more generally associate with a proposition some formal notion of complexity which can be proved?
Johan Commelin (Jan 23 2026 at 07:57):
You can do this, but not with random terms of Prop.
You'll have to define your own PropExpr (or reuse parts from ModelTheory/).
You can then define PropExpr.toProp : PropExpr -> Prop. The hierarchy can be defined on PropExpr.
Joseph Tooby-Smith (Jan 23 2026 at 08:00):
Ok, thanks, this makes sense. I will explore what is available in ModelTheory and go from there.
Dexin Zhang (Jan 23 2026 at 17:09):
FFL has a nice formalization of arithmetic hierarchy.
SnO2WMaN (Jan 23 2026 at 22:18):
Dexin Zhang said:
FFL has a nice formalization of arithmetic hierarchy.
Mention that this is not strict: https://github.com/FormalizedFormalLogic/Foundation/issues/707
FYI: @Palalansoukî
Palalansoukî (Jan 24 2026 at 04:19):
How about defining using computability theoretic notion?
import Mathlib
inductive SigmaPi
| sigma
| pi
inductive ArithmeticalHierarchy : SigmaPi → ℕ → (ℕ → Prop) → Prop
| delta0 : PrimrecPred p → ArithmeticalHierarchy Γ 0 p
| exists : ArithmeticalHierarchy .pi s p → ArithmeticalHierarchy .sigma (s + 1) fun x ↦ ∃ y, p (x.pair y)
| forall : ArithmeticalHierarchy .sigma s p → ArithmeticalHierarchy .pi (s + 1) fun x ↦ ∀ y, p (x.pair y)
Of course, this can only be used for predicates of natural numbers (or type which is Primrcodable), but I don't think meaningful definitions can be made for other type of predicates.
Last updated: Feb 28 2026 at 14:05 UTC