The Hitchhiker’s Guide to
Logical Verification13 1.4 Lemma Statements 16 1.5 Summary of New Lean Constructs 18 2 Backward Proofs 21 2.1 Tactic Mode 22 2.2 Basic Tactics 23 2.3 Reasoning about Connectives and Quantifiers 26 2.4 Reasoning Equality 29 2.5 Rewriting Tactics 30 2.6 Proofs by Mathematical Induction 31 2.7 Induction Tactic 33 2.8 Cleanup Tactics 33 2.9 Summary of New Lean Constructs 34 3 Forward Proofs 35 3.1 Structured Introductory Examples 75 5.2 Logical Symbols 81 5.3 Rule Induction 82 5.4 Linear Arithmetic Tactic 85 5.5 Elimination 85 5.6 Further Examples 87 5.7 Summary of New Lean Constructs 91 60 码力 | 215 页 | 1.95 MB | 2 年前3
Programming in Lean
Release 3.4.2The IO monad 29 4.5 Related type classes 29 5 Writing Tactics 31 5.1 A First Look at the Tactic Monad 31 5.2 Names and Expressions 34 5.3 Examples 39 5.4 Reduction 40 5.5 Metavariables a_{0} $ , and b otherwise. ## WRITING TACTICS ### 5.1 A First Look at the Tactic Monad The canonical way to invoke a tactic in Lean is to use the by keyword within a Lean expression. Suppose we write \rightarrow $ a $ \land $ b := by _ Lean expects something of type tactic unit to fill the underscore, where tactic refers to the tactic monad. When the elaborator processes this definition, it elaborates0 码力 | 51 页 | 220.07 KB | 2 年前3
The Lean Reference Manual
Release 3.3.0Tactics .45 6.1 Tactic Mode .45 6.2 Basic Tactics .46 6.3 Equality and Other Relations .49 6.4 Structured Tactic Proofs .49 6.5 Inductive Types .50 6.6 Tactic Combinators .53 up a message window which shows you error messages, warnings, output, and goal information when in tactic mode. Typing an underscore in an expression asks Lean to infer a suitable value for the expression 25 or later, you can then press M-, to go back to the original location. In tactic mode, if you put your cursor on a tactic (or the keyword begin or end) and type C-c C-g, Emacs will show you the goal0 码力 | 67 页 | 266.23 KB | 2 年前3
Theorem Proving in Lean
Release 3.23.0Proof Language 4.6 Exercises 5 Tactics 5.1 Entering Tactic Mode 5.2 Basic Tactics 5.3 More Tactics 5.4 Structuring Tactic Proofs 5.5 Tactic Combinators ..... 68 5.6 Rewriting ..... 70 5.7 Using variables that only appear in a tactic command or block are not automatically added to the context. The include command takes care of that. Essentially, the rewrite tactic uses a given equality (which can complex term) to "rewrite" the goal. If doing so reduces the goal to an identity t = t, the tactic applies reflexivity to prove it. Rewrites can be applied sequentially, so that the proof above can0 码力 | 173 页 | 777.93 KB | 2 年前3
Lean 2 Quick Referencedefinition when fully applied recursor : user-defined precursor/eliminator, used for the induction tactic recursor: user-defined non-dependent precursor/eliminator where is the position of the hidden name. ## Tactic Mode At any point in a proof or definition you can switch to tactic mode and apply tactics to finish that part of the proof or definition. begin ... end : enter tactic mode, and blocking blocking mechanism within tactic mode { ... } : blocking mechanism within tactic mode by ... : enter tactic mode, can only execute a single tactic begin+; by+ : same as =begin= and =by=, but make local 0 码力 | 9 页 | 62.97 KB | 2 年前3
An Introduction to Leaninstructions, or procedures, that tell Lean how to construct the requisite expression. Here is a tactic-style proof of the theorem above: theorem even_add : ∀ m n, even m → even n → even (n + m) := begin that will assist in the verification of programs and the construction of proofs as well. It is the tactic framework that serves as a gateway to the use of automation. Lean provides means of implementing searches through two lists of expressions, assumed to be hypotheses available in the context of a tactic proof, in search of a pair of the form $ h_{1}:p $ and $ h_{2}:p $ . When it finds such a pair0 码力 | 48 页 | 191.92 KB | 2 年前3
The Idris Tutorial Version 0.99the rewrite: sym : l = r -> r = l sym Refl = Refl We can complete this proof using the trivial tactic, which finds value in the premises. The proof of the second lemma proceeds in exactly the same way is: views.parity_lemma_2 = proof { intro; intro; exact believe_me value; } The exact tactic allows us to provide an exact value for the proof. In this case, we assert that the value we gave to direct the construction of the proof. In this case, we can normalise the goal with the compute tactic: -plusredZ_Z> compute (plusredZ_Z) ----- {hole0} : Z = Z Now we have to prove that Z equals0 码力 | 182 页 | 1.04 MB | 2 年前3
The Idris Tutorial Version 2.3.0of the rewrite: sym : l = r -> r = l sym Refl = Refl We can complete this proof using the trivial tactic, which finds value in the premises. The proof of the second lemma proceeds in exactly the same way parity_lemma_1 using this is: views.parity_lemma_2 = proof { intro; intro; exact believe_me value; } The exact tactic allows us to provide an exact value for the proof. In this case, we assert that the value we gave to direct the construction of the proof. In this case, we can normalise the goal with the compute tactic: -plusredZ_Z> compute ---------------------------------- (plusredZ_Z) -------- {hole0} : Z = Z Now0 码力 | 228 页 | 1.23 MB | 2 年前3
The Idris Tutorial Version 0.99.2the rewrite: sym : l = r -> r = l sym Refl = Refl We can complete this proof using the trivial tactic, which finds value in the premises. The proof of the second lemma proceeds in exactly the same way is: views.parity_lemma_2 = proof { intro; intro; exact believe_me value; } The exact tactic allows us to provide an exact value for the proof. In this case, we assert that the value we gave to direct the construction of the proof. In this case, we can normalise the goal with the compute tactic: -plusredZ_Z> compute (plusredZ_Z) {hole0} : Z = Z Now we have to prove that Z equals Z, which0 码力 | 224 页 | 1.22 MB | 2 年前3
The Idris Tutorial Version 1.3.0the rewrite: sym : l = r -> r = l sym Refl = Refl We can complete this proof using the trivial tactic, which finds value in the premises. The proof of the second lemma proceeds in exactly the same way is: views.parity_lemma_2 = proof { intro; intro; exact believe_me value; } The exact tactic allows us to provide an exact value for the proof. In this case, we assert that the value we gave to direct the construction of the proof. In this case, we can normalise the goal with the compute tactic: -plusredZ_Z> compute (plusredZ_Z) ----- {hole0} : Z = Z Now we have to prove that Z equals0 码力 | 229 页 | 1.24 MB | 2 年前3
共 101 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
相关搜索词
Leantheorem provingtacticHoare logicformal proofLean编程语言归纳构造演算单子输入输出函数定义VSCodeEmacstheorempackage manager定理证明依赖类型理论命题策略定理Lean 2tacticscommandsquick referenceEmacs modedependent type theorymetaprogrammingautomationIdris依赖类型函数式编程Vect类型Effects库dependent typesinteractive environmentimplicit conversionsforeign function calls依赖类型系统交互式环境编译器运行时系统副作用处理编译器日志Agda比较













