Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/MathlibTest/Instances/     Datei vom 15.10.2026 mit Größe 830 B image not shown  

Quelle  ComputableShortcuts.lean   Sprache: Lean

 

/-
This test must import everything to make the noncomputable instances which we don't want available.
-/

import Mathlib

/-!
# Tests that basic algebraic typeclasses are computable

Frequently mathlib will have instances of the form
```
instance : FooAndBar X := ...

-- in a later file
noncomputable instance : VeryNoncomputableFoo X := ...
```
which means that `Foo X` will sometimes be synthesized noncomputably even though a computable
version is available.

TODO: test this more exhaustively.
-/


macro "#guard_computable" t:term : command =>
  `(#guard_msgs (drop info) in #eval $t)

section Real

#guard_computable LinearMap.mul ℝ ℝ 2 3
#guard_computable LinearEquiv.neg ℝ (2 : ℝ)

end Real

section Complex

#guard_computable LinearMap.mul ℂ ℂ 2 3
#guard_computable LinearEquiv.neg ℂ (2 : ℂ)

end Complex

Messung
CHZG
100100100100

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland