HL Terse source diff
HL/Equiv.lean
571571 rw [TotalMap.update_eq, TotalMap.update_eq] at contra
572572 contradiction
573573
574--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
574+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
HL/Hoare.lean
14021402 | whileTrue hb hc hloop ih₁ ih₂ =>
14031403 injection heq with hbeq hceq
14041404 subst hbeq hceq
1405- exact ih₂ (hhoare hc ⟨hpre, hb⟩) rfl
1405+ apply ih₂ (hhoare hc ⟨hpre, hb⟩) (by rfl)
14061406 | skip | asgn | seq | ifTrue | ifFalse =>
14071407 contradiction
14081408
15821582 -- of Hoare logic as a closed world for reasoning about
15831583 -- programs.
15841584
1585--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
1585+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
HL/Hoare2.lean
10091009
10101010 -- ----------------------------------------
10111011
1012--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
1012+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
HL/Imp.lean
764764 ]=> {Z ↦ 4, X ↦ 2} := by
765765 -- To supply the intermediate state to the `seq` rule, which is
766766 -- sometimes necessary, we can write `EvalR.seq (st' := ...)`.
767+ -- We can also write `EvalR.asgn (by rfl)` to immediately close
768+ -- the subgoal generated by the lookup.
767769 apply EvalR.seq (st' := {X ↦ 2})
768- · exact EvalR.asgn rfl
770+ · apply EvalR.asgn (by rfl)
769771 · apply EvalR.ifFalse
770772 · rfl
771- · exact EvalR.asgn rfl
773+ · apply EvalR.asgn (by rfl)
772774
773775 -- Since the total-map update notation (`→ₜ`) is difficult
774776 -- to type, we prefer to use the `{}`-notation with
775777 -- `KVPair`s.
776778 --
777--- In the above proof, using `EvalR.asgn rfl` is convenient
778--- because it computes the value of the right-hand side and
779--- can use it to determine `st'`.
780---
779+-- In the above proof, proving the premise of `EvalR.asgn`
780+-- with `rfl` is convenient because it computes the value
781+-- of the right-hand side and can use it to determine
782+-- `st'`.
783+
781784 -- Here are some more examples. Note the use of `~` in the
782785 -- first, since `.num x` is a Lean term that we want to
783786 -- splice into Imp.
788791 -- `simp` or `rfl`
789792 simp
790793
794+-- We can abbreviate this further using
795+-- `apply EvalR.asgn (by rfl)`, which automatically closes
796+-- the `=` subproof with `rfl`.
797+
791798 example {x : Nat} : ∅ =[ X := ~(.num x) ]=> {X ↦ x} := by
792- exact EvalR.asgn rfl
799+ apply EvalR.asgn (by rfl)
793800
794801 example : ∅ =[ X := 2; Y := 3 ]=> {Y ↦ 3, X ↦ 2} := by
795802 apply EvalR.seq
796803 · -- `⊢ imp {X := 2}.EvalR ∅ ?st'`
797804 -- assigns the metavariable `?st'` to `{X ↦ 2}` (or equivalent)
798- exact EvalR.asgn rfl
805+ apply EvalR.asgn (by rfl)
799806 · simp only [Aexp.eval_num, evalR_eq]
800- exact EvalR.asgn rfl
807+ apply EvalR.asgn (by rfl)
801808
802809 -- This is a case where `rfl` is more powerful than `simp`,
803810 -- because it can assign the `?st'` metavariable. To
10401047 have hz : st[Z] ≠ 0 := by
10411048 intro hz
10421049 simp [hz] at hb
1043- exact ih₂ (factBody_preserves_invariant hinv hz hc) rfl
1050+ apply ih₂ (factBody_preserves_invariant hinv hz hc)
1051+ rfl
10441052 | skip | asgn | seq | ifTrue | ifFalse => simp [factLoop] at heq
10451053
10461054 -- Next, we show that, for any loop, if the loop
12331241
12341242 end StackCompiler
12351243
1236--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
1244+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
HL/Preface.lean
190190 -- National Science Foundation under the NSF Expeditions
191191 -- grant 1521523, *The Science of Deep Specification*.
192192
193--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
193+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
HL/Slang.lean
398398 -- Functional: computation. Relational: expressive. Best:
399399 -- both, proved equivalent.
400400
401--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
401+-- Source revision: a06e066, committed 2026-10-27 16:51 UTC
HL.lean
55 import HL.Hoare
66 import HL.Hoare2
77
8--- Source revision: 2ca0e09, committed 2026-10-23 15:44 UTC
8+-- 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
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