1 of 47

ZK in Context - Part 4

Ali Atiia

yAcademy, yAudit

https://twitter.com/AliAtiia_

yAcademy

https://yacademy.dev/fellowships

2 of 47

(2) Accepted few self-evident Truths (axioms)

If:

(1) We started off with some set of alphabet like :

(3) Unambiguously defined the rules of derivation

Is there a guarantee that every conceivable language (=Truth, “problem”) is expressible thru? (completeness)

0 s ¬ ∀ ∃ = ( ) + ⨉ ∨ x1 x2 x3

Last time:

3 of 47

(2) Accepted few self-evident Truths (axioms)

If:

(1) We started off with some set of alphabet like :

(3) Unambiguously defined the rules of derivation

Is there a guarantee that no false statement cannot be arrived at by valid application of rules of derivation? (consistency)

0 s ¬ ∀ ∃ = ( ) + ⨉ ∨ x1 x2 x3

Last time:

4 of 47

(2) Accepted few self-evident Truths (axioms)

If:

(1) We started off with some set of alphabet like :

(3) Unambiguously defined the rules of derivation

Is there a guarantee that the truthfulness or falsehood of a statement can be determined by direct unambiguous mechanical application of the rules of derivation? (decidability)

0 s ¬ ∀ ∃ = ( ) + ⨉ ∨ x1 x2 x3

Last time:

5 of 47

Gödel’s reduction answered the first 2 questions

4) Construct a meta-statement that cannot be proven within the system

3) Arithmetized proofs into unique integers 1, 2, ….

2) Arithmetized statements into unique integers n1, n2, …. n

1) Encoded the alphabet

6 of 47

Completeness

Consistency

? Decidability

Today: Decidability

7 of 47

7

Is there a Universal language ? A language of all languages ?

Is there a Universal machine?

Languages

Machines

TRUTHS

PROOFS

8 of 47

8

Universal machine:

  • aware of the axioms of universal language
  • faithful to the rules of universal language

Languages

Machines

TRUTHS

PROOFS

Is there a Universal language ? A language of all languages ?

Is there a Universal machine?

9 of 47

9

Nothing special about this machine really, when consulted about whether a number is IN our OUT, it consults the axioms and applies the rules mechanically

e.g. recall the machine sketched above for the P-E language has no conception of “addition”

Languages

Machines

TRUTHS

PROOFS

Is there a Universal language ? A language of all languages ?

Is there a Universal machine?

Universal machine:

  • aware of the axioms of universal language
  • faithful to the rules of universal language

10 of 47

10

Is there a Universal machine?

Is there a Universal language ?

Languages

Machines

TRUTHS

PROOFS

11 of 47

11

Is there a Universal machine?

Is there a Universal language ?

Let’s settle for a universal language (in small letters) ..

(ignore those logical blackholes, when was the last time someone bumped into one anyway, practically speaking ? )

Languages

Machines

TRUTHS

PROOFS

12 of 47

12

Is there a Universal machine?

Is there a Universal language ?

Let’s settle for a universal language (in small letters) ..

Languages

Machines

TRUTHS

PROOFS

the most widely used “universal language” in practice is ZFC set theory (13 axioms)

�We used it to define SAT, Knapsack, EC, 3-coloring…

(ignore those logical blackholes, when was the last time someone bumped into one anyway, practically speaking ? )

13 of 47

13

universal language = all Truths (minus some weird “problematic statements”)

Is there a Universal machine?

Is there a Universal language ?

Let’s settle for a universal language (in small letters) ..

Languages

Machines

TRUTHS

PROOFS

14 of 47

14

universal language = all Truths (minus some weird “problematic statements”)

universal language can describe everything, including machines

Is there a Universal machine?

Is there a Universal language ?

Let’s settle for a universal language (in small letters) ..

Languages

Machines

TRUTHS

PROOFS

15 of 47

15

Every conceivable sentence

1

2

3

4

5

.

.

n

.

.

1

2

3

4

.

.

.

n

.

.

Every conceivable machine

Languages

Machines

TRUTHS

PROOFS

16 of 47

16

Every conceivable sentence

1

2

3

4

5

.

.

n

.

.

1

2

3

4

.

.

.

n

.

.

Every conceivable machine

Languages

Machines

TRUTHS

PROOFS

Recall the encoding of the P-E language�and its corresponding decider machine, �both encoded as natural numbers

17 of 47

17

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Every conceivable machine

This is the result returned by

machine encoded with 2 when supplied with statement encoded with 1 as input

Every conceivable sentence

Languages

Machines

TRUTHS

PROOFS

18 of 47

18

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Consider machine number k which operates as follows:

Languages

Machines

TRUTHS

PROOFS

19 of 47

19

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Consider machine number k which operates as follows:

1. It receives sentence n

Languages

Machines

TRUTHS

PROOFS

20 of 47

20

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Consider machine number k which operates as follows:

1. It receives sentence n

2. It feeds sentence n to machine n

Languages

Machines

TRUTHS

PROOFS

21 of 47

21

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Consider machine number k which operates as follows:

1. It receives sentence n

2. It feeds sentence n to machine n

3. It adds 1 to the result (diagonal+1)

Languages

Machines

TRUTHS

PROOFS

22 of 47

22

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Consider machine number k which operates as follows:

1. It receives sentence n

2. It feeds sentence n to machine n

3. It adds 1 to the result (diagonal+1)

4. It terminates

Languages

Machines

TRUTHS

PROOFS

23 of 47

23

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

mk (n) = mn (n) + 1

In other words, in shorthand notation :

Consider machine number k which operates as follows:

1. It receives sentence n

2. It feeds sentence n to machine n

3. It adds 1 to the result (diagonal+1)

4. It terminates

Languages

Machines

TRUTHS

PROOFS

24 of 47

24

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

What happens if we supply sentence k itself to mk ?

Languages

Machines

TRUTHS

PROOFS

25 of 47

25

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

mk (k) = mk (k) + 1

What happens if we supply sentence k itself to mk ?

Languages

Machines

TRUTHS

PROOFS

26 of 47

26

1

2

3

4

5

.

.

n

.

.

1

0

0

89

3

0

.

.

0

.

.

2

10

1

0

0

0

.

.

0

.

.

3

0

0

0

0

0

.

.

0

.

.

4

20

0

4

1

0

.

.

56

.

.

.

60

0

0

0

0

.

.

3

.

.

.

0

0

0

0

6

.

.

0

.

.

.

30

0

0

3

0

.

.

3

.

.

n

0

9

0

0

2

.

.

40

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

mk (k) = mk (k) + 1

What happens if we supply sentence k to mk ?

(!)

Logical blackhole, so mk does not, could not, exist!

Languages

Machines

TRUTHS

PROOFS

27 of 47

27

mk (k) = mk (k) + 1

(!)

Logical blackhole, so mk does not, could not, exist!

TRUTHS

PROOFS

Therefore, there exist at least one language that is beyond decidability

28 of 47

28

mk (k) = mk (k) + 1

(!)

Logical blackhole, so mk does not, could not, exist!

TRUTHS

PROOFS

Notice we didn’t even need to to define the internal of the machine (or the intricate details of an algorithm accepting and simulating other algorithms) in order to reach this undecidability result

29 of 47

29

No

Some Truths are beyond provability

No

There are more languages than there are machines to decide them!

Is there a Universal machine?

Is there a Universal language ?

Languages

Machines

TRUTHS

PROOFS

30 of 47

30

No

There are more languages than there are machines to decide them!

Is there a Universal machine?

Languages

Machines

TRUTHS

PROOFS

  • These are questions about the the foundation of mathematics itself

  • Computer Science was born out of answers to these questions

No

Some Truths are beyond provability

Is there a Universal language ?

31 of 47

Completeness

Consistency

Decidability

32 of 47

fuck it we ball

screw it, we tried

33 of 47

Whatever the axiomatic system, some truths are beyond decidability

33

34 of 47

Decidability: a finite and unambiguous set of instructions (algorithm) that terminate with a yes (true) or no (false)

Whatever the axiomatic system, some truths are beyond decidability

34

35 of 47

What we have proven so far is “there exists at least one language (diagonal+1) that no machine can decide. Other “natural” undecidable languages exist. Classic example (the halting problem):

for arbitrary j, print “yes” if mj terminates with an answer -any answer- on every input

Whatever the axiomatic system, some truths are beyond decidability

Decidability: a finite and unambiguous set of instructions (algorithm) that terminate with a yes (true) or no (false)

35

36 of 47

36

ljk

Philosophy/Theology

Mathematical truths

Provability boundary

Decidability boundary

37 of 47

37

Chess

Protein folding

Eact Cover, 3-SAT, Knapsack, 3-Coloring

Arithmetic, sorting

38 of 47

38

Eact Cover, 3-SAT, Knapsack, 3-Coloring

39 of 47

39

Chess

Protein folding

Complexity Hierarchy: the closer the language is to this boundary, the harder (more computationally expensive) it is for a decider to tell who is IN and who is OUT

Eact Cover, 3-SAT, Knapsack, 3-Coloring

Arithmetic, sorting

40 of 47

40

Complexity Hierarchy is to computer scientists what the Periodic Table is to physicists

41 of 47

41

We classify problems within the black boundary (decidable) according to the computational resources that must be expended to solve them:

Easy classes:

  • problems that require constant resources regardless of the input
  • problems that require ~nk resources, n = input size, k=constant

42 of 47

42

We classify problems with the black boundary (decidable) according to the computational resources that must be expended to solve them:

Hard classes:

  • problems that require ~2n resources, n = input size

43 of 47

43

Another way of describing these classes:

problems that can be decomposed into two computations:

  • a search that takes ~2n resources, n = input size
  • a verification that takes ~log(w) resources

44 of 47

44

Next time:

  • A closer look at computational classes of decidable langs
  • The ideal machine we used to measure resources → define classes
  • The equivalence class containing 3SAT, EC, Knapsack, 3-Coloring .. and verification of their witnesses in ZK

45 of 47

In preparation for our first audit of a Circom codebase on Wednesday, here is a starter kit to prepare you for it:�

https://sweltering-bill-f01.notion.site/Circom-Starter-Kit-e567a20b7e76431aa5b01b0d908baa28

The introduction ties Circom to the theory we have been covering of the first 3 sessions, and provides a sneak-peak into what we will cover in the remaining 1-2 sessions of Module 1.�

46 of 47

We pick up next time with the mother of all reductions, Cook’s, to understand the inside of the green boundary (decidable) and the prover-verifier computation model that can decide various subset within that green set

47 of 47

Thanks