Open pi8027 opened 1 year ago
@pi8027 this seems to work in the hierarchy-builder branch so maybe not worth trying to fix that in master
From HB Require Import structures.
From mathcomp Require Import all_ssreflect.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Record tupleprod_of n (T : Type) :=
Tupleprod { tpval : seqprod T; _ : size tpval == n }.
HB.instance Definition _ n T :=
[isSub for @tpval n T].
(* work also if uncommented
HB.instance Definition _ n (T : eqType) :=
[Equality of tupleprod_of n T by <:].
*)
HB.instance Definition _ n (T : choiceType) :=
[Choice of tupleprod_of n T by <:].
(* work also if uncommented
HB.instance Definition _ n (T : countType) :=
[Countable of tupleprod_of n T by <:].
*)
HB.instance Definition _ d n (T : porderType d) :=
[SubChoice_isSubPOrder of tupleprod_of n T by <: with d].
Print Canonical Projections tupleprod_of.
(*
tupleprod_of <- SubChoice.sort ( test_tupleprod_of__canonical__choice_SubChoice )
tupleprod_of <- Order.SubPOrder.sort ( test_tupleprod_of__canonical__Order_SubPOrder )
tupleprod_of <- Sub.sort ( test_tupleprod_of__canonical__eqtype_Sub )
tupleprod_of <- Choice.sort ( test_tupleprod_of__canonical__choice_Choice )
tupleprod_of <- Order.POrder.sort ( test_tupleprod_of__canonical__Order_POrder )
tupleprod_of <- Equality.sort ( test_tupleprod_of__canonical__eqtype_Equality )
tupleprod_of <- SubEquality.sort ( test_tupleprod_of__canonical__eqtype_SubEquality )
*)
Example:
It works if
DefaultSeqProdOrder
is imported.