Created
April 30, 2023 12:16
-
-
Save gaxiiiiiiiiiiii/711d0757d13bea1a7f08a25d361a8bb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From mathcomp Require Export fintype. | |
Set Implicit Arguments. | |
Unset Strict Implicit. | |
Unset Printing Implicit Defensive. | |
Module NonEmptyFintype. | |
Section Def. | |
Variable T : finType. | |
Record mixin_of := Mixin { | |
default : T; | |
}. | |
Structure class_of (T : finType):= Class { | |
base : Finite.class_of T; | |
mixin : mixin_of | |
}. | |
Structure type := Pack { | |
sort : finType ; | |
class_ : class_of sort | |
}. | |
End Def. | |
Section NonEmptyFintype_of. | |
Variable T : finType. | |
Variable x : T. | |
Definition nonEmptyFinType_of : type T := | |
{| | |
sort := T; | |
class_ := {| | |
base := Finite.class T; | |
mixin := {| default := x |} | |
|}; | |
|}. | |
End NonEmptyFintype_of. | |
Module Exports. | |
Coercion base : class_of >-> Finite.class_of. | |
Coercion sort : type >-> finType. | |
Notation nonEmptyFintype := NonEmptyFintype.type. | |
Notation default T := (default (mixin (class_ T))). | |
Notation nonEmptyFinType_of := NonEmptyFintype.nonEmptyFinType_of. | |
End Exports. | |
End NonEmptyFintype. | |
Export NonEmptyFintype.Exports. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment