LF Terse source diff
LF/Automation.lean
790790
791791 end RegExp
792792
793--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
793+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Basics.lean
723723 -- Similarly, for each of the three branches of the
724724 -- definition of `even`, we need one simplification rule:
725725
726-theorem even_zero : even zero = true := rfl
727-theorem even_one : even (succ zero) = false := rfl
728-theorem even_succ_succ (n : Nat) : even (succ (succ n)) = even n := rfl
726+theorem even_zero : even zero = true := by rfl
727+theorem even_one : even (succ zero) = false := by rfl
728+theorem even_succ_succ (n : Nat) : even (succ (succ n)) = even n := by rfl
729729
730730 attribute [irreducible] even odd
731731
979979
980980 end Nat
981981
982--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
982+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/IndProp.lean
716716 -- The characterizing lemmas for `∈` are called
717717 -- `List.mem_nil_iff` and `List.mem_cons`.
718718
719--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
719+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Induction.lean
445445 example (b c : Bool) : (b && c) = (c && b) := by
446446 cases b <;> cases c <;> rfl
447447
448--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
448+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Lists.lean
576576
577577 end Lists
578578
579--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
579+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Logic.lean
255255
256256 -- Rather than applying the constructor, we can explicitly
257257 -- provide the arguments to the constructor as an `exact`
258--- proof.
258+-- proof. In particular, we can write each argument as a
259+-- *subproof* using the `by` keyword (the same keyword that
260+-- begins a proof- not a coincidence!). For example, since
261+-- each subproof of `And.intro` in the example below is
262+-- closed by `rfl`, we can close these proofs by passing
263+-- `(by rfl)` as an argument to `And.intro`.
259264
260265 example : 3 + 4 = 7 ∧ 2 * 2 = 4 := by
261- exact And.intro rfl rfl
266+ exact And.intro (by rfl) (by rfl)
262267
263268 -- Lean can figure out which constructor to use just from
264269 -- the goal's type, so we don't have to name it ourselves.
267272 -- value of the goal's type, leaving one subgoal per
268273 -- argument of that constructor. Since `And` has just one
269274 -- constructor, `constructor` always picks it here.
275+--
276+-- The constructor tactic is *very* useful for proofs
277+-- involving types with many constructors, which we will
278+-- see in the IndProp chapter.
270279
271280 example : 3 + 4 = 7 ∧ 2 * 2 = 4 := by
272281 constructor
278287 -- well.
279288
280289 example : 3 + 4 = 7 ∧ 2 * 2 = 4 := by
281- exact ⟨rfl, rfl⟩
290+ exact ⟨(by rfl), (by rfl)⟩
282291
283292 -- ### Exercise (2 stars): add_is_zero ⭐⭐
284293
13391348 -- Output:
13401349 -- Classical.em (p : Prop) : p ∨ ¬p
13411350
1342--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
1351+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Poly.lean
7171 -- Some simple facts about `replicate`:
7272
7373 theorem replicate_zero (α : Type) (a : α) :
74- replicate α a 0 = MyList.nil := rfl
74+ replicate α a 0 = MyList.nil := by rfl
7575
7676 theorem replicate_succ (α : Type) (a : α) (count : Nat) :
77- replicate α a (count + 1) = MyList.cons a (replicate α a count) := rfl
77+ replicate α a (count + 1) = MyList.cons a (replicate α a count) := by rfl
7878
7979 example : replicate Nat 4 2 = .cons 4 (.cons 4 .nil) := by rfl
8080
687687 -- Output:
688688 -- fold_plus : List Nat → Nat → Nat
689689
690--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
690+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Postscript.lean
6868 -- develops formalized mathematics using Lean and
6969 -- Mathlib.
7070
71--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
71+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Preface.lean
487487 -- National Science Foundation under the NSF Expeditions
488488 -- grant 1521523, *The Science of Deep Specification*.
489489
490--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
490+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Tactics.lean
722722 -- generalizing the listed local variables, giving a more
723723 -- general induction hypothesis
724724
725--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
725+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/Typeclasses.lean
17231723
17241724 end Reflection
17251725
1726--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
1726+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF/UsingLean.lean
227227
228228 def Nat.odd (n : Nat) := !(even n)
229229
230-theorem Nat.odd_def (n : Nat) : n.odd = !(n.even) := rfl
230+theorem Nat.odd_def (n : Nat) : n.odd = !(n.even) := by rfl
231231
232232 def Nat.minusTwo (n : Nat) : Nat :=
233233 match n with
268268 theorem Nat.double_zero : double 0 = 0 := by rfl
269269 theorem Nat.double_succ (n : Nat) : (n + 1).double = n.double + 2 := by rfl
270270
271--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
271+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
LF.lean
1111 import LF.Typeclasses
1212 import LF.Postscript
1313
14--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
14+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
SFLCompat/Experiment.lean
146146 Example:
147147 ```lean
148148 sf_expect_failure_in
149- example : 1 = 2 := rfl
149+ example : 1 = 2 := by rfl
150150 ```
151151 -/
152152 def expectFailureTk := leading_parser
SFLCompat/Recall/Check.lean
460460
461461 def twice (f : Nat → Nat) (n : Nat) : Nat := f (f n)
462462
463-theorem twice_id : twice id 3 = 3 := rfl
463+theorem twice_id : twice id 3 = 3 := by rfl
464464
465465 sf_recall
466466 inductive Palette where
490490
491491 -- The statement form counts universe parameters: a placeholder universe
492492 -- becomes a parameter and matches, and a fixed universe is rejected.
493-theorem poly_refl.{u} : ∀ {α : Sort u} (a : α), a = a := fun _ => rfl
493+theorem poly_refl.{u} : ∀ {α : Sort u} (a : α), a = a := fun _ => by rfl
494494
495495 sf_recall statement poly_refl : ∀ {α : Sort _} (a : α), a = a
496496
SFLCompat/Recall/Source.lean
6363
6464 def twice (f : Nat → Nat) (n : Nat) : Nat := f (f n)
6565
66-theorem twice_id : twice id 3 = 3 := rfl
66+theorem twice_id : twice id 3 = 3 := by rfl
6767
6868 sf_recall_source
6969 inductive Palette where