This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
31 lines
876 B
Text
31 lines
876 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.rewrite true
|
|
/--
|
|
trace: [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
|