Inductive paths@{i} {A:Type@{i}} (a:A) : A -> Type@{i} := idpath : paths a a.
#[export] Hint Resolve idpath : core . Notation"a = b" := (paths a b) (at level 70, no associativity) : type_scope.
Set Primitive Projections. Set Nonrecursive Elimination Schemes.
Record total2@{i} { T: Type@{i} } ( P: T -> Type@{i} ) : Type@{i}
:= tpair { pr1 : T; pr2 : P pr1 }.
Definition map_on_two_paths {X Y Z : UU} (f : X -> Y -> Z) {x x' y y'} (ex : x = x') (ey: y = y') :
f x y = f x' y'. Proof. intros. induction ex. induction ey. exact (idpath _). Defined.
Definition maponpathscomp0 {X Y : UU} {x1 x2 x3 : X}
(f : X -> Y) (e1 : x1 = x2) (e2 : x2 = x3) :
maponpaths f (e1 @ e2) = maponpaths f e1 @ maponpaths f e2. Proof. intros. induction e1. induction e2. exact (idpath _). Defined.
Definition maponpathsinv0 {X Y : UU} (f : X -> Y)
{x1 x2 : X} (e : x1 = x2) : maponpaths f (! e) = ! (maponpaths f e). Proof. intros. induction e. exact (idpath _). Defined.
Definition constr1 {X : UU} (P : X -> UU) {x x' : X} (e : x = x') :
∑ (f : P x -> P x'),
∑ (ee : ∏ p : P x, tpair _ x p = tpair _ x' (f p)),
∏ (pp : P x), maponpaths pr1 (ee pp) = e. Proof. intros. induction e. splitwith (idfun (P x)). splitwith (λ p, idpath _). unfold maponpaths. simpl. intro. exact (idpath _). Defined.
Definition transportf@{i} {X : Type@{i}} (P : X -> Type@{i}) {x x' : X}
(e : x = x') : P x -> P x' := pr1 (constr1 P e).
Lemma two_arg_paths_f@{i} {A : Type@{i}} {B : A -> Type@{i}} {C:Type@{i}} {f : ∏ a, B a -> C} {a1 b1 a2 b2}
(p : a1 = a2) (q : transportf B p b1 = b2) : f a1 b1 = f a2 b2. Proof. intros. induction p. induction q. exact (idpath _). Defined.
(* To see the bug, run it both with and without this constraint: *)
(* Constraint uu0 < i. *)
(* Without this constraint, we get i = uu0 in the next definition *) Lemma isweqcontrtounit@{} {T : Type@{i}} (is : iscontr@{i} T) : isweq@{i} (λ _:T, tt). Proof. intros. intro y. induction y. induction is as [c h]. splitwith (hfiberpair@{i i i} _ c (idpath tt)). intros ha. induction ha as [x e]. simple refine (two_arg_paths_f (h x) _). simple refine (ifcontrthenunitl0 _ _). Defined.
(* Explanation of the bug:
With the constraint uu0 < i above we get:
|= uu0 <= bug.3 uu0 <= i uu1 <= i i <= bug.3
from this print statement: *)
Print isweqcontrtounit.
(*
Without the constraint uu0 < i above we get:
|= i <= bug.3 uu0 = i
Since uu0 = i is not inferred when we impose the constraint uu0 < i, it is invalid to infer it when we don't.
*)
Context (X : Type@{uu1}).
Check (@isweqcontrtounit X). (* detect a universe inconsistency *)
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.