The elements of the CODEHALT instance an instance is drawn as #
The tags of the reduction P ≤ᶠᵒ[≤] CODEHALT, and the positions of the one
abstract code it mentions.
The abstract code is drawn one tag per node #
The reduction composes a fixed code cP – the semi-decision procedure of the
source problem, which Mathlib's Nat.Partrec.Code.exists_code supplies
rather than has to be built – with the value the instance is written as. The
subtree of cP has no reason to be indexed by the input structure, so it is
drawn with one tag per node: DescriptiveComplexity.SubPos cP, the positions
of a code's syntax tree, defined by recursion on the code so that a position's
subterm (DescriptiveComplexity.subAt) and children
(DescriptiveComplexity.sub1, DescriptiveComplexity.sub2) are read off
definitionally. Tags cost nothing at any instance size, which is what makes
this compatible with hardness being cofinal in the reduction order.
The rest of the tags #
| tag | coordinates | draws |
|---|---|---|
root | – | comp cP (pair numeral nest) |
cp p | – | the node p of cP |
pairN | – | the pair of the numeral and the nest |
numN | (x, ⊥, …) | the comp succ … chain of the numeral, from x on |
symN i | – | the nest of the blocks of the symbols, from i on |
chainN i l | (x₀, …, x_l, ⊥, …) | the level-l chain of the block of i, from x_l on |
oneN | – | succ: the value 1 |
zeroN | – | zero: the value 0, and every empty tail |
Two of them are shared: oneN and zeroN are single elements, pointed at by
every chain that ends and by every bit of the table. A drawing is a relation on
the elements, so an element may have several parents – and sharing is what keeps
the bit of a tuple an edge of the drawing rather than a conditional mark, so
that every tag has one constructor (DescriptiveComplexity.ProgTag.mark) and
exclusivity of the marks is immediate.
The positions of a code's syntax tree #
The positions of the syntax tree of a code, by recursion on the code.
Equations
- DescriptiveComplexity.SubPos Nat.Partrec.Code.zero = Unit
- DescriptiveComplexity.SubPos Nat.Partrec.Code.succ = Unit
- DescriptiveComplexity.SubPos Nat.Partrec.Code.left = Unit
- DescriptiveComplexity.SubPos Nat.Partrec.Code.right = Unit
- DescriptiveComplexity.SubPos (cf.pair cg) = (Unit ⊕ DescriptiveComplexity.SubPos cf ⊕ DescriptiveComplexity.SubPos cg)
- DescriptiveComplexity.SubPos (cf.comp cg) = (Unit ⊕ DescriptiveComplexity.SubPos cf ⊕ DescriptiveComplexity.SubPos cg)
- DescriptiveComplexity.SubPos (cf.prec cg) = (Unit ⊕ DescriptiveComplexity.SubPos cf ⊕ DescriptiveComplexity.SubPos cg)
- DescriptiveComplexity.SubPos cf.rfind' = (Unit ⊕ DescriptiveComplexity.SubPos cf)
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.instDecidableEqSubPos Nat.Partrec.Code.zero = DescriptiveComplexity.instDecidableEqSubPos._aux_1
- DescriptiveComplexity.instDecidableEqSubPos Nat.Partrec.Code.succ = DescriptiveComplexity.instDecidableEqSubPos._aux_3
- DescriptiveComplexity.instDecidableEqSubPos Nat.Partrec.Code.left = DescriptiveComplexity.instDecidableEqSubPos._aux_5
- DescriptiveComplexity.instDecidableEqSubPos Nat.Partrec.Code.right = DescriptiveComplexity.instDecidableEqSubPos._aux_7
- DescriptiveComplexity.instDecidableEqSubPos cf.rfind' = DescriptiveComplexity.instDecidableEqSubPos._aux_15 cf (DescriptiveComplexity.instDecidableEqSubPos cf)
Dependency graph
The root position of a code's syntax tree.
Equations
- DescriptiveComplexity.codeRootPos Nat.Partrec.Code.zero = ()
- DescriptiveComplexity.codeRootPos Nat.Partrec.Code.succ = ()
- DescriptiveComplexity.codeRootPos Nat.Partrec.Code.left = ()
- DescriptiveComplexity.codeRootPos Nat.Partrec.Code.right = ()
- DescriptiveComplexity.codeRootPos (cf.pair cg) = Sum.inl ()
- DescriptiveComplexity.codeRootPos (cf.comp cg) = Sum.inl ()
- DescriptiveComplexity.codeRootPos (cf.prec cg) = Sum.inl ()
- DescriptiveComplexity.codeRootPos cf.rfind' = Sum.inl ()
Instances For
Dependency graph
Dependency graph
The subterm sitting at a position.
Equations
- DescriptiveComplexity.subAt Nat.Partrec.Code.zero x_2 = Nat.Partrec.Code.zero
- DescriptiveComplexity.subAt Nat.Partrec.Code.succ x_2 = Nat.Partrec.Code.succ
- DescriptiveComplexity.subAt Nat.Partrec.Code.left x_2 = Nat.Partrec.Code.left
- DescriptiveComplexity.subAt Nat.Partrec.Code.right x_2 = Nat.Partrec.Code.right
- DescriptiveComplexity.subAt (cf.pair cg) (Sum.inl val) = cf.pair cg
- DescriptiveComplexity.subAt (cf.pair a) (Sum.inr (Sum.inl p)) = DescriptiveComplexity.subAt cf p
- DescriptiveComplexity.subAt (a.pair cg) (Sum.inr (Sum.inr p)) = DescriptiveComplexity.subAt cg p
- DescriptiveComplexity.subAt (cf.comp cg) (Sum.inl val) = cf.comp cg
- DescriptiveComplexity.subAt (cf.comp a) (Sum.inr (Sum.inl p)) = DescriptiveComplexity.subAt cf p
- DescriptiveComplexity.subAt (a.comp cg) (Sum.inr (Sum.inr p)) = DescriptiveComplexity.subAt cg p
- DescriptiveComplexity.subAt (cf.prec cg) (Sum.inl val) = cf.prec cg
- DescriptiveComplexity.subAt (cf.prec a) (Sum.inr (Sum.inl p)) = DescriptiveComplexity.subAt cf p
- DescriptiveComplexity.subAt (a.prec cg) (Sum.inr (Sum.inr p)) = DescriptiveComplexity.subAt cg p
- DescriptiveComplexity.subAt cf.rfind' (Sum.inl val) = cf.rfind'
- DescriptiveComplexity.subAt cf.rfind' (Sum.inr p) = DescriptiveComplexity.subAt cf p
Instances For
Dependency graph
The position of the first child of a position, if it has one.
Equations
- DescriptiveComplexity.sub1 Nat.Partrec.Code.zero x_2 = none
- DescriptiveComplexity.sub1 Nat.Partrec.Code.succ x_2 = none
- DescriptiveComplexity.sub1 Nat.Partrec.Code.left x_2 = none
- DescriptiveComplexity.sub1 Nat.Partrec.Code.right x_2 = none
- DescriptiveComplexity.sub1 (cf.pair a) (Sum.inl val) = some (Sum.inr (Sum.inl (DescriptiveComplexity.codeRootPos cf)))
- DescriptiveComplexity.sub1 (a.pair a_1) (Sum.inr (Sum.inl p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a) => Sum.inr (Sum.inl q)) (DescriptiveComplexity.sub1 a p)
- DescriptiveComplexity.sub1 (a.pair a_1) (Sum.inr (Sum.inr p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a_1) => Sum.inr (Sum.inr q)) (DescriptiveComplexity.sub1 a_1 p)
- DescriptiveComplexity.sub1 (cf.comp a) (Sum.inl val) = some (Sum.inr (Sum.inl (DescriptiveComplexity.codeRootPos cf)))
- DescriptiveComplexity.sub1 (a.comp a_1) (Sum.inr (Sum.inl p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a) => Sum.inr (Sum.inl q)) (DescriptiveComplexity.sub1 a p)
- DescriptiveComplexity.sub1 (a.comp a_1) (Sum.inr (Sum.inr p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a_1) => Sum.inr (Sum.inr q)) (DescriptiveComplexity.sub1 a_1 p)
- DescriptiveComplexity.sub1 (cf.prec a) (Sum.inl val) = some (Sum.inr (Sum.inl (DescriptiveComplexity.codeRootPos cf)))
- DescriptiveComplexity.sub1 (a.prec a_1) (Sum.inr (Sum.inl p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a) => Sum.inr (Sum.inl q)) (DescriptiveComplexity.sub1 a p)
- DescriptiveComplexity.sub1 (a.prec a_1) (Sum.inr (Sum.inr p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a_1) => Sum.inr (Sum.inr q)) (DescriptiveComplexity.sub1 a_1 p)
- DescriptiveComplexity.sub1 cf.rfind' (Sum.inl val) = some (Sum.inr (DescriptiveComplexity.codeRootPos cf))
- DescriptiveComplexity.sub1 a.rfind' (Sum.inr p) = Option.map Sum.inr (DescriptiveComplexity.sub1 a p)
Instances For
Dependency graph
The position of the second child of a position, if it has one.
Equations
- DescriptiveComplexity.sub2 Nat.Partrec.Code.zero x_2 = none
- DescriptiveComplexity.sub2 Nat.Partrec.Code.succ x_2 = none
- DescriptiveComplexity.sub2 Nat.Partrec.Code.left x_2 = none
- DescriptiveComplexity.sub2 Nat.Partrec.Code.right x_2 = none
- DescriptiveComplexity.sub2 (a.pair cg) (Sum.inl val) = some (Sum.inr (Sum.inr (DescriptiveComplexity.codeRootPos cg)))
- DescriptiveComplexity.sub2 (a.pair a_1) (Sum.inr (Sum.inl p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a) => Sum.inr (Sum.inl q)) (DescriptiveComplexity.sub2 a p)
- DescriptiveComplexity.sub2 (a.pair a_1) (Sum.inr (Sum.inr p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a_1) => Sum.inr (Sum.inr q)) (DescriptiveComplexity.sub2 a_1 p)
- DescriptiveComplexity.sub2 (a.comp cg) (Sum.inl val) = some (Sum.inr (Sum.inr (DescriptiveComplexity.codeRootPos cg)))
- DescriptiveComplexity.sub2 (a.comp a_1) (Sum.inr (Sum.inl p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a) => Sum.inr (Sum.inl q)) (DescriptiveComplexity.sub2 a p)
- DescriptiveComplexity.sub2 (a.comp a_1) (Sum.inr (Sum.inr p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a_1) => Sum.inr (Sum.inr q)) (DescriptiveComplexity.sub2 a_1 p)
- DescriptiveComplexity.sub2 (a.prec cg) (Sum.inl val) = some (Sum.inr (Sum.inr (DescriptiveComplexity.codeRootPos cg)))
- DescriptiveComplexity.sub2 (a.prec a_1) (Sum.inr (Sum.inl p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a) => Sum.inr (Sum.inl q)) (DescriptiveComplexity.sub2 a p)
- DescriptiveComplexity.sub2 (a.prec a_1) (Sum.inr (Sum.inr p)) = Option.map (fun (q : DescriptiveComplexity.SubPos a_1) => Sum.inr (Sum.inr q)) (DescriptiveComplexity.sub2 a_1 p)
- DescriptiveComplexity.sub2 a.rfind' (Sum.inl val) = none
- DescriptiveComplexity.sub2 a.rfind' (Sum.inr p) = Option.map Sum.inr (DescriptiveComplexity.sub2 a p)
Instances For
Dependency graph
Dependency graph
The tags #
The tags of the reduction into CODEHALT.
- root
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
: ProgTag V cP
The root: the
compof the procedure with the value of the instance. - cp
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
(p : SubPos cP)
: ProgTag V cP
A node of the fixed code
cP. - pairN
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
: ProgTag V cP
The
pairof the numeral and the nest of the tables. - numN
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
: ProgTag V cP
The numeral chain, from the element held in the first coordinate on.
- symN
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
(i : Fin V.numSyms)
: ProgTag V cP
The nest of the blocks of the symbols, from the symbol
ion. - chainN
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
(i : Fin V.numSyms)
(l : Fin (dimOf V))
: ProgTag V cP
The level-
lchain of the block of the symboli, from the element held in the coordinatelon. - oneN
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
: ProgTag V cP
The shared
succnode: the value1. - zeroN
{L : FirstOrder.Language}
{V : L.FinVocab}
{cP : Nat.Partrec.Code}
: ProgTag V cP
The shared
zeronode: the value0, and the tail of every chain.
Instances For
Dependency graph
The numbering that makes the tags a finite type.
Equations
- DescriptiveComplexity.ProgTag.root.idx = (none, none, none, 0)
- (DescriptiveComplexity.ProgTag.cp p).idx = (some p, none, none, 1)
- DescriptiveComplexity.ProgTag.pairN.idx = (none, none, none, 2)
- DescriptiveComplexity.ProgTag.numN.idx = (none, none, none, 3)
- (DescriptiveComplexity.ProgTag.symN i).idx = (none, some i, none, 4)
- (DescriptiveComplexity.ProgTag.chainN i l).idx = (none, some i, some l, 5)
- DescriptiveComplexity.ProgTag.oneN.idx = (none, none, none, 6)
- DescriptiveComplexity.ProgTag.zeroN.idx = (none, none, none, 7)
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Equations
- x✝¹.instDecidableEq x✝ = decidable_of_iff (x✝¹.idx = x✝.idx) ⋯
Dependency graph
The constructor each tag draws. Every tag draws exactly one, which is what makes the exclusivity of the marks immediate.
Equations
- DescriptiveComplexity.ProgTag.root.mark = DescriptiveComplexity.CodeTag.comp
- (DescriptiveComplexity.ProgTag.cp p).mark = DescriptiveComplexity.tagOf (DescriptiveComplexity.subAt cP p)
- DescriptiveComplexity.ProgTag.pairN.mark = DescriptiveComplexity.CodeTag.pair
- DescriptiveComplexity.ProgTag.numN.mark = DescriptiveComplexity.CodeTag.comp
- (DescriptiveComplexity.ProgTag.symN i).mark = DescriptiveComplexity.CodeTag.pair
- (DescriptiveComplexity.ProgTag.chainN i l).mark = DescriptiveComplexity.CodeTag.pair
- DescriptiveComplexity.ProgTag.oneN.mark = DescriptiveComplexity.CodeTag.succ
- DescriptiveComplexity.ProgTag.zeroN.mark = DescriptiveComplexity.CodeTag.zero
Instances For
Dependency graph
The number of coordinates a tag uses; the others are padded with the minimum of the input order.
Equations
- DescriptiveComplexity.ProgTag.root.used = 0
- (DescriptiveComplexity.ProgTag.cp p).used = 0
- DescriptiveComplexity.ProgTag.pairN.used = 0
- DescriptiveComplexity.ProgTag.numN.used = 1
- (DescriptiveComplexity.ProgTag.symN i).used = 0
- (DescriptiveComplexity.ProgTag.chainN i l).used = ↑l + 1
- DescriptiveComplexity.ProgTag.oneN.used = 0
- DescriptiveComplexity.ProgTag.zeroN.used = 0