lean4-htt/tests/elab_fail/1007.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
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.
2026-02-25 13:51:53 +00:00

56 lines
1.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Vec (X : Type u)
class IsLin {X Y} [Vec X] [Vec Y] (f : X → Y)
structure where
value : Float
instance instFoo1 {X : Type u} {Y : Type v} [Vec X] [Vec Y] : Vec (X × Y) := sorry
instance instProblem {α : Type u} {X : Type v} [Vec X] : Vec (α → X) := sorry
instance (priority := default+1) instFoo2 : Vec := sorry
--------------
instance comp_is_lin {X Y Z : Type} [Vec X] [Vec Y] [Vec Z]
(f : Y → Z) (g : X → Y) [IsLin f] [IsLin g]
: IsLin (λ x => f (g x)) := sorry
----------------
class Trait (X : Type u) where
R : Type v
attribute [reducible] Trait.R
class SemiInner (X : Type u) (R : outParam (Type v)) where
semiInner : X → X → R
@[reducible] instance (X) (R : Type u) [SemiInner X R] : Trait X := ⟨R⟩
class SemiHilbert (X) (R : outParam (Type u)) [Vec R] [Vec X] extends SemiInner X R
instance (X R) [Trait X] [Vec R] [Vec X] [SemiHilbert X R] (ι : Type v) : SemiHilbert (ι → X) R := sorry
instance : SemiHilbert := sorry
--------------
def norm {X} [Trait X] [inst : SemiInner X (Trait.R X)] (x : X) : Trait.R X := sorry
def sum {n} (f : Fin n → ) : := sorry
variable (n m : Nat)
-- these all should work
example : Trait (Fin n → Fin m → ) := by infer_instance
example : SemiInner (Trait.R ) := by infer_instance
example : SemiHilbert (Fin n → ) := by infer_instance
example : SemiHilbert (Fin n → ) (Trait.R ) := by infer_instance
example : Trait (Fin n → Fin m → (Trait.R )) := by infer_instance
example : SemiHilbert (Trait.R ) := by infer_instance
-- set_option synthInstance.maxHeartbeats 50 in
-- set_option pp.explicit true in
-- set_option trace.Meta.synthInstance true in
-- This should not timeout but fail in finite number of steps like in Lean 3
example : IsLin (λ (x : ) => sum λ i : Fin n => norm x) := by infer_instance