lean4-htt/tests/lean/run/790.lean
Joachim Breitner e33c32fb00
feat: ppOrigin to use MessageData.ofConst (#4362)
so that the pretty-printed origin is clickable, and avoid the
unnecessary `@`.

Particularly nice is this fix:
```diff
 /--
-info: [Meta.Tactic.simp.discharge] @bar discharge 
+info: [Meta.Tactic.simp.discharge] bar discharge 
       autoParam T _auto✝
-  [Meta.Tactic.simp.rewrite] { }:1000, T ==> True
-[Meta.Tactic.simp.rewrite] @bar:1000, U ==> True
+  [Meta.Tactic.simp.rewrite] T.mk:1000, T ==> True
+[Meta.Tactic.simp.rewrite] bar:1000, U ==> True
 -/
```
2024-06-05 11:00:34 +00:00

25 lines
835 B
Text

class Vec (X : Type) extends Add X, Inhabited X
class Vec' (X : Type) extends Vec X
def differential {X Y : Type} [Vec X] [Vec Y] (f : X → Y) (x dx : X) : Y := f dx
@[simp]
theorem differential_of_linear {X Y : Type} [Vec X] [Vec Y] (f : X → Y) (x dx : X)
: differential f x dx = f dx := by simp[differential]
example {X Y : Type} [Vec X] [Vec Y] (f : X → Y) (x dx : X)
: differential f x dx = f dx := by simp
instance : Vec Nat := ⟨⟩
instance : Vec' Nat := ⟨⟩
set_option trace.Meta.Tactic.simp true
/--
info: [Meta.Tactic.simp.rewrite] differential_of_linear:1000, differential f x dx ==> f dx
[Meta.Tactic.simp.rewrite] eq_self:1000, f dx = f dx ==> True
-/
#guard_msgs in
example {Y : Type} [Vec Y] (f : Nat → Y) (x dx : Nat)
: @differential _ _ Vec'.toVec _ f x dx = f dx :=
by simp