Programming in Lean Release 3.4.2
to include all conventional mathematics. Lean’s underlying logical framework, the Calculus of Inductive Constructions, constitutes a surprisingly good programming language. It is expressive enough to define compilation in a future version of Lean. Viewed from a computational perspective, the Calculus of Inductive Constructions is an instance of a purely functional programming language. This means that a program natural ways. At the same, the system provides complementary mechanisms for proving claims, using inductive principles that capture the structure of the function definitions. One novel feature of Lean is0 码力 | 51 页 | 220.07 KB | 1 年前3An Introduction to Lean
theory. Specifi- cally, it implements a version of dependent type theory known as the Calculus of Inductive Constructions. The CIC is a formal language with a small and precise set of rules that governs the the structure generated freely and inductively by a constant, zero, and a unary function succ: inductive nat : Type | zero : nat | succ : nat → nat If you copy this definition into the editor window at and metaprogramming. 2 Defining Objects in Lean As a foundational framework, the Calculus of Inductive Constructions, or CIC, is flexi- ble enough to define all kinds of mathematical objects. It can define0 码力 | 48 页 | 191.92 KB | 1 年前3Theorem Proving in Lean Release 3.23.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 7 Inductive Types 95 7.1 Enumerated Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 7.6 Tactics for Inductive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 7.7 Inductive Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 7.9 Mutual and Nested Inductive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 7.10 Exercises0 码力 | 173 页 | 777.93 KB | 1 年前3The Hitchhiker’s Guide to Logical Verification
. . . . . . . . . 49 iii II Functional–Logic Programming 51 4 Functional Programming 53 4.1 Inductive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 4.2 Structural Induction 71 4.10 Dependent Inductive Types . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.11 Summary of New Lean Constructs . . . . . . . . . . . . . . . . . . . . . 74 5 Inductive Predicates 75 5.1 Introductory Program Equivalence . . . . . . . . . . . . . . . . . . . . 162 10.9 A Simpler Approach Based on an Inductive Predicate . . . . . . . . . 164 IV Mathematics 165 11 Logical Foundations of Mathematics 167 110 码力 | 215 页 | 1.95 MB | 1 年前3The Lean Reference Manual Release 3.3.0
. . . . . . . . . . . . . . . . 22 4.4 Inductive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.5 Inductive Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.6 Mutual and Nested Inductive Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.7 The Equation Compiler . . . . . . Tactic Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 6.5 Inductive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 码力 | 67 页 | 266.23 KB | 1 年前3Lean 2 Quick Reference
at the goal and all hypotheses Induction and cases cases: decompose an element of an inductive type cases with : name newly introduced variables as specified by induction constructor : construct an element of an inductive type by applying the first constructor that succeeds constructor : construct an element of an inductive type by applying the ith-constructor fconstructor fconstructor : construct an element of an inductive type by (fapply)ing the first constructor that succeeds fconstructor : construct an element of an inductive type by (fapply)ing the ith-constructor injection 0 码力 | 9 页 | 62.97 KB | 1 年前3Lean in Lean
address only 248 • 8 + 8 + 3 + 45 = 64 What about cycles? • Inductive datatypes in Lean are acyclic. • We can implement co-inductive datatypes without creating cycles. • Only unsafe code in Lean0 码力 | 54 页 | 4.78 MB | 1 年前3
共 7 条
- 1