Lean in Leanhttp://leanprover.github.io Lean in Lean Leonardo de Moura - MSR - USA  Workshop Microsoft $ ^{®} $ Research ## Lean ## • Goals • proof/type checkers ## Lean Timeline • Lean 1 (2013) Leo and Soonho Kong • Almost useless • Brave (crazy?) users in 2014: Jeremy Avigad, Cody Roux and Floris van Doorn • Lean 2 (2015) Leo and Soonho the HoTT library for Lean • First Math library (Jeremy Avigad, Rob Lewis, and many others) • Lean 3 (2016) Leo, Daniel Selsam, Gabriel Ebner, Jared Roesch, Sebastian Ullrich • Lean is now a programming0 码力 | 54 页 | 4.78 MB | 2 年前3
An Introduction to Lean# An Introduction to Lean Jeremy Avigad Leonardo de Moura Gabriel Ebner and Sebastian Ullrich Version 1fc176a, updated at 2017-01-09 14:16:26 -0500 ## Contents Contents 3 1 Overview 5 1 1.1 Perspectives on Lean 5 1.2 Where To Go From Here 12 2 Defining Objects in Lean 13 2.1 Some Basic Types 14 2.2 Defining Functions 17 2.3 Defining New Types 20 2.4 Records and and Structures 22 2.5 Nonconstructive Definitions 25 3 Programming in Lean 27 3.1 Evaluating Expressions 28 3.2 Recursive Definitions 30 3.3 Inhabited Types, Subtypes, and Option Types0 码力 | 48 页 | 191.92 KB | 2 年前3
Lean 4http://leanprover.github.io  Lean 4 Leonardo de Moura - MSR - USA Sebastian Ullrich - KIT - Germany Microsoft $ ^{®} $ Research io/theorem_proving_in_lean/ • Zulip channel: https://leanprover.zulipchat.com/ • Community website: https://leanprover-community.github.io/ • Maintainers of the official release (Lean 3) • Mathlib: ht https://leanprover-community.github.io/mathlib-overview.html • Lean 4 repository: https://github.com/leanprover/lean4 ## Mathlib The Lean mathematical library, mathlib, is a community-driven effort to0 码力 | 20 页 | 1.78 MB | 2 年前3
Programming in Lean
Release 3.4.2# Programming in Lean Release 3.4.2 Jeremy Avigad and Simon Hudon Apr 02, 2019 Powered by TCPDF (www.tcpdf.org) ## CONTENTS 1 Introduction 1 2 Types and Terms 3 2.1 Some Basic Types 3 2.2 Defining Theorem Proving in Lean, which presents Lean as a system for building mathematical libraries and stating and proving mathematical theorems. From that perspective, the point of Lean is to implement a formal framework in which one can define mathematical objects and reason about them. But expressions in Lean have a computational interpretation, which is to say, they can be evaluated. Any closed term of type0 码力 | 51 页 | 220.07 KB | 2 年前3
Lean 2 Quick Reference# Lean 2 Quick Reference Jeremy Avigad, Leonardo de Moura, Soonho Kong Version d0dd6d0, updated at 2017-01-30 19:53:44 -0500 ## Quick Reference Note that this quick reference guide describes Lean 2 intros: same as intro intro : let Lean choose a name intros : introduce variables as long as the goal reduces to a function type and let Lean choose the names rename : rename a variable : execute a single tactic with different options ( is a comma-separated list) ## Emacs Lean-mode commands ## Flycheck commands 0 码力 | 9 页 | 62.97 KB | 2 年前3
MoonBit月兔编程语言 现代编程思想 第九课 接口# 现代编程思想 接口 Hongbo Zhang ## 回顾 ## • 第六课:定义平衡二叉树 我们定义一个更一般的二叉搜索树,允许存放任意类型的数据 1. enum Tree[T] { 2. Empty 3. Node(T, Tree[T], Tree[T]) 4. } 5. 6. // 我们需要一个比较函数来比较值的大小以了解顺序 7. // 负数表示小于,0表示等于,正数表示大于0 码力 | 16 页 | 346.04 KB | 2 年前3
MoonBit月兔编程语言 现代编程思想 第十二课 案例:自动微分现代编程思想 案例:自动微分 Hongbo Zhang ## 微分 • 微分被应用于机器学习领域 ◦ 利用梯度下降求局部极值 牛顿迭代法求函数解: $ x^{3}-10x^{2}+x+1=0 $ • 我们今天研究简单的函数组合 ○ 例: $ f(x_{0},x_{1})=5x_{0}^{2}+x_{1} $ ■ $ f(10,100)=600 $ ■ $ \frac{\partial ■ 缺点:计算机无法精准表达小数,且绝对值越大,越不精准 符号微分:Mul(Const(2), Var(1)) -> Const(2) ■ 缺点:计算结果可能复杂;可能重复计算;难以直接利用语言原生控制流 1. // 需要额外定义原生算子以实现相同效果 2. fn max[N : Number](x : N, y : N) -> N { 3. if x.value() < ■ 缺点:计算机无法精准表达小数,且绝对值越大,越不精准 符号微分:Mul(Const(2), Var(1)) -> Const(2) ■ 缺点:计算结果可能复杂;可能重复计算;难以直接利用语言原生控制流 ◦ 自动微分:利用复合函数求导法则、由基本运算组合进行微分 ■ 分为前向微分和后向微分 ## 符号微分 ## • 我们以符号微分定义表达式构建的一种语义 1. enum Symbol0 码力 | 30 页 | 3.24 MB | 2 年前3
The Lean Reference Manual
Release 3.3.0# The Lean Reference Manual Release 3.3.0 Jeremy Avigad, Gabriel Ebner, and Sebastian Ullrich Sep 06, 2018 Powered by TCPDF (www.tcpdf.org) ## CONTENTS 1 Using Lean 1 1.1 Using Lean Online 1 1.2 2 Using Lean with VSCode 1 1.3 Using Lean with Emacs 2 1.4 Using the Package Manager 3 2 Lexical Structure 7 2.1 Symbols and Commands 7 2.2 Identifiers 7 2.3 String Literals 8 2.4 Char Literals 61 ## Bibliography # USING LEAN ### 1.1 Using Lean Online You can run a Javascript version of Lean online in your browser. It is much slower than running a version of Lean installed on your computer0 码力 | 67 页 | 266.23 KB | 2 年前3
Theorem Proving in Lean
Release 3.23.0# Theorem Proving in Lean Release 3.23.0 Jeremy Avigad, Leonardo de Moura, and Soonho Kong Apr 25, 2023 Powered by TCPDF (www.tcpdf.org) ## CONTENTS 1 Introduction 1.1 Computers and Theorem Proving Proving 1.2 About Lean 1.3 About this Book 1.4 Acknowledgments 2 Dependent Type Theory 2.1 Simple Type Theory 2.2 Types as Objects 2.3 Function Abstraction and Evaluation 2.4 Introducing Definitions Rewriting ..... 70 5.7 Using the Simplifier ..... 72 5.8 Exercises ..... 77 6 Interacting with Lean ..... 79 6.1 Importing Files ..... 79 6.2 More on Sections ..... 80 6.3 More on Namespaces0 码力 | 173 页 | 777.93 KB | 2 年前3
MoonBit月兔编程语言 现代编程思想 第十三课 案例:神经网络## 现代编程思想 ## 案例:基于梯度下降的神经网络 Hongbo Zhang ## 案例:鸢尾花 • 鸢尾花数据集是机器学习中的"Hello World" ☐ 1936年发布 包含对3种鸢尾花的测量,各有50个样本 ☐ 每个样本包含4项特征:花萼与花瓣的长度和宽度 目标 ☐ 通过特征,判断属于哪一类鸢尾花 ◦ 构建并训练神经网络,正确率95%以上 ## 神经网络0 码力 | 17 页 | 521.66 KB | 2 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













