Open andreaslyn opened 5 years ago
Hi @andreaslyn ! Sorry for the late comment. I will unfortunately not have any time to review this anytime before September, as I am leaving office now for a summer break. But may be @CohenCyril or @gares will have feedback before I am back online.
The following two branches allows one to play with ssreflect in HoTT:
Maybe someone will be interested in continuing this.
Thanks @andreaslyn I gave a quick look and at least some of the commit were proposed as PR in Coq's repo. Are you saying there are more commits I should pick from the Coq tree?
@gares I made those changes to the Coq sources to make ssreflect work in HoTT. Maybe some of those things have been fixed already in Coq, so I am not sure how much of it needs to be merged.
I have a HoTT branch https://github.com/andreaslyn/HoTT/tree/ssr with support for all the basic ssreflect tactics. The goal is to be able to build math components with HoTT and hopefully without changing code in math components. @mattam82 @amahboubi do you have ideas on how to do this?
Changes to make SSReflect Coq files compile
A few changes to the basic ssreflect files are needed. The following Coq compatibility file
SSRPreamble.v
is imported by all the 4 basic ssreflect Coq files:The remaining changes are:
Prop
everywhere toType
.#[universes(template)]
withCumulative
. Note that simply removing#[universes(template)]
seems to work as well.all_tag2
andall_sig2
inssrfun.v
need to change the use ofall_pair
to@all_pair I
. I don't know why this needs to be changed.ssrbool.v
the type ofif_spec
is changed fromSet
toType
, which is needed because of changingProp
toType
.ssreflect.v
theUNDER_EQ
andUNDER_IFF
module types need some explicit universe annotations, because of universe polymorphism.When PR https://github.com/coq/coq/pull/10457 has been merged into Coq, then the above lists all the changes to the basic ssreflect Coq files required to compile them with HoTT.
Changes to math components
It may also be feasible to build math components with HoTT. Similar issues occur when attempting to do so:
Prop
everywhere toType
.SSRPreamble.v
.==
notation is homotopy in HoTT and equality in math components.ssreflect/eqtype.v
in math components, the proof ofSubP
need to applyrec
explicitly:case: sT Sub_spec SubSpec u => /= U _ mkU rec _. apply: rec.
, where the proof working in coq is:by case: sT Sub_spec SubSpec u => /= U _ mkU rec _.
ssreflect/eqtype.v
in math components:tag_eq = eq_op
is a type error (need to provide the canonical structure explicitly for some reasontag_eq = @eq_op tag_eqType
), butsum_eq = eq_op
works just fine.