Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type := match n with
| minus_two => Contr_internal A
| n'.+1 => forall (x y : A), IsTrunc_internal n' (x = y) end.
Class IsTrunc (n : trunc_index) (A : Type) : Type :=
Trunc_is_trunc : IsTrunc_internal n A.
End Core. DelimitScope functor_scope with functor.
LocalOpenScope morphism_scope.
Section Functor. Variables C D : PreCategory.
Record Functor :=
{
object_of :> C -> D;
morphism_of : forall s d, morphism C s d
-> morphism D (object_of s) (object_of d);
composition_of : forall s d d'
(m1 : morphism C s d) (m2: morphism C d d'),
morphism_of _ _ (m2 o m1)
= (morphism_of _ _ m2) o (morphism_of _ _ m1);
identity_of : forall x, morphism_of _ _ (identity x)
= identity (object_of x)
}. End Functor.
GeneralizableVariables A B m n f.
Fixpoint trunc_index_inc (k : trunc_index) (n : nat)
: trunc_index
:= match n with
| O => k
| S m => (trunc_index_inc k m).+1 end.
Definition int_to_trunc_index (v : Decimal.int) : option trunc_index
:= match v with
| Decimal.Pos d => Some (nat_to_trunc_index (Nat.of_uint d))
| Decimal.Neg d => match Nat.of_uint d with
| 2%nat => Some minus_two
| 1%nat => Some (minus_two.+1)
| 0 => Some (minus_two.+2)
| _ => None end end.
Definition num_int_to_trunc_index v : option trunc_index := match Nat.of_num_int v with
| Some n => Some (nat_to_trunc_index n)
| None => None end.
Fixpoint trunc_index_to_little_uint n acc := match n with
| minus_two => acc
| minus_two.+1 => acc
| minus_two.+2 => acc
| trunc_S n => trunc_index_to_little_uint n (Decimal.Little.succ acc) end.
Definition trunc_index_to_int n := match n with
| minus_two => Decimal.Neg (Nat.to_uint 2)
| minus_two.+1 => Decimal.Neg (Nat.to_uint 1)
| n => Decimal.Pos (Decimal.rev (trunc_index_to_little_uint n Decimal.zero)) end.
Definition trunc_index_to_num_int n :=
Number.IntDecimal (trunc_index_to_int n).
GlobalInstance istrunc_succ `{IsTrunc n A}
: IsTrunc n.+1 A | 1000. Admitted.
GlobalInstance contr_unit : Contr Unit | 0 := let x := {|
center := tt;
contr := fun t : Unit => match t with tt => 1 end
|} in x.
Definition indiscrete_category : PreCategory
:= @Build_PreCategory' X
(fun _ _ => Unit)
(fun _ => tt)
(fun _ _ _ _ _ => tt)
(fun _ _ _ _ _ _ _ => idpath)
(fun _ _ _ _ _ _ _ => idpath)
(fun _ _ f => match f with tt => idpath end)
(fun _ _ f => match f with tt => idpath end)
(fun _ => idpath)
_. End indiscrete_category. LocalOpenScope nat_scope.
Fixpoint CardinalityRepresentative (n : nat) : Type0 := match n with
| 0 => Empty
| 1 => Unit
| S n' => (CardinalityRepresentative n' + Unit)%type end.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.