You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Manual/ValidatingProofs.lean
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -30,26 +30,26 @@ htmlSplit := .never
30
30
This section discusses how to validate a proof expressed in Lean.
31
31
32
32
The steps needed to rule out a misleading proof depend on the author's {deftech}[trust] assumptions towards the _proof author_ (including authors that proved depended-upon theorems), the _verification software_, and the _correctness of the statement_.
33
+
Each of these is explained in detail below.
33
34
34
-
* Regarding the _proof author_, it matters a lot whether one is dealing with an {tech}[honest] proof attempt, and needs protection against only benign mistakes, or a possibly-{tech}[malicious] proof attempt that actively tries to mislead.
35
+
* Regarding the _proof author_, we distinguish whether one is dealing with an {tech}[honest] proof author, and needs protection against only benign mistakes, or a possibly-{tech}[malicious] proof author that actively tries to mislead.
35
36
36
37
In particular, we use {deftech}_honest_ when the goal is to create a valid proof.
37
-
This allows for mistakes and bugs in proofs and meta-code (tactics, attributes, commands, etc.), but not for code that clearly only serves to circumvent the system (such as using the {option}`debug.skipKernelTC`).
38
+
This allows for mistakes and bugs in proofs and meta-code (tactics, attributes, commands, etc.), but not forproof code that clearly only serves to circumvent the system (such as using the {option}`debug.skipKernelTC`).
38
39
Note that the {keyword}`unsafe` marker on API functions is unrelated to whether this API can be used in an dishonest way.
39
40
40
-
In contrast, we use {deftech}_malicious_ to describe code that goes out of its way to trick or mislead the user, exploit bugs or compromise the system.
41
+
In contrast, we use {deftech}_malicious_ to describe proof code that goes out of its way to trick or mislead the user, exploit bugs or compromise the system.
41
42
This includes un-reviewed AI-generated proofs and programs.
42
43
43
-
* Regarding the verification software, Lean takes {ref "elaboration-compilation"}[a number of steps] to process a theoremanditsproof.
Ataminimum,theLean {tech}[kernel] or an alternative kernel such as [`nanoda`](https://github.com/ammkrn/nanoda_lib) has to be trusted.
44
+
* Regarding the verification software, Lean takes {ref "elaboration-compilation"}[a number of steps] to process a theoremanditsproof.Someofthesestepsarepartofthe {deftech}[trusted computing base] (TCB), which typically comprises at least the Lean {tech}[kernel] or an alternative kernel such as [`nanoda`](https://github.com/ammkrn/nanoda_lib).
46
45
47
46
* Regarding the correctness of the statement, it is important to distinguish the question “does the theoremhaveavalidproof”from “whatdoesthetheoremstatementmean”.
48
47
Nomatterwhatsoftwareisusedandhowtrustedtheenvironmentis,atheoremismeaningfulonlyifitsauthor(s) and user(s) are certain that its statement mathematically expresses its intended informal meaning.
49
48
50
-
As written, the statement is {tech (key := "Lean elaborator")}[elaborated] before being passed to the kernel.
51
-
To avoid trusting the {tech (key := "Lean elaborator")}[elaborator], one has to {keywordOf Lean.Parser.Command.print}`#print` the statement to get the elaborated type and manually verify that it indeed expresses the desired statement.
52
-
This brings {keywordOf Lean.Parser.Command.print}`#print` into the trusted base, which is less than 1000 lines of code.
49
+
As written, the statement is {tech (key := "Lean elaborator")}[elaborated] before being passed to the {tech}[kernel].
50
+
As such, the {tech (key := "Lean elaborator")}[elaborator] is also part of the {tech (key := "trusted computing base")}[TCB].
51
+
To avoid trusting the {tech (key := "Lean elaborator")}[elaborator], one has to {keywordOf Lean.Parser.Command.print}`#print` the statement with the {keywordOf Lean.Util.PPExt.pp.raw}`pp.raw` option set to `true` to get the elaborated type and manually verify that it indeed expresses the desired statement.
52
+
Unfortunately the raw output is not user-friendly, so including the {tech (key := "Lean elaborator")}[elaborator] in the {tech (key := "trusted computing base")}[TCB] is currently the most reasonable approach.
53
53
54
54
Below, an escalating sequence of checks are presented, with instructions on how to perform them, an explanation of what they entail and the mistakes or attacks they guard against.
55
55
To avoid repetition, we will not discuss trust towards the correctness of the statement every time.
0 commit comments