lean4-htt/tests/lean/run/coeSort2.lean
Leonardo de Moura 812c47d463 feat: simplify CoeFun and CoeSort
The main issue is nontermination for problems that do not have
solution. When using dependent coercions, we keep creating goals of
the form `CoeSort ... (coe (coe (coe ...))) ...`. Same for `CoeFun`.
I am considering simplifying it even further, and making sure
`CoeDep` can be used at most once in a sequence of coercions `CoeTC`.

Another option is to use a very small amount of fuel to
guarantee termination when solving coercion TC problems.

cc @Kha @dselsam
2020-01-29 21:56:26 -08:00

13 lines
263 B
Text

universe u
structure Group :=
(carrier : Type u) (mul : carrier → carrier → carrier) (one : carrier)
instance GroupToType : CoeSort Group (Type u) :=
CoeSort.mk (fun g => g.carrier)
new_frontend
variable (g : Group.{1})
#check fun (a b : g) => g.mul a b