Identity groupoids and the discrete universe of small groupoids
DefinitionHofmannStreicher1994_GroupoidsFor a groupoid and objects , the identity groupoid is discrete on the arrows . Given a functor and arrows and , identity transport sends to .
Semantic UIP means that every pair of arrows with common endpoints is joined by an arrow in this discrete identity groupoid. Its diagonal version requires every endomorphism to be joined to the identity. These are pointwise semantic predicates; they do not themselves supply an interpretation of the object syntax or a soundness theorem.
For each universe level, is the discrete groupoid on all small groupoids and decodes a code to its groupoid. Two total-space presentations are provided: the Grothendieck construction of and the categorical disjoint union of the small groupoids. A concrete object in the latter comes from the one-object groupoid of permutations of a two-element set, together with its identity and transposition loops.
module
public import Mathlib.CategoryTheory.Groupoid.Grpd.Basic
public import Mathlib.CategoryTheory.Groupoid.Discrete
public import Mathlib.CategoryTheory.Grothendieck
public import Mathlib.CategoryTheory.Sigma.Basic
public import Mathlib.Logic.Equiv.Basic
public import Mathlib.Algebra.Group.End
/-!
# The source geometry of the Hofmann–Streicher groupoid countermodel
This file records the literal semantic objects in Sections 2.2, 2.3 and 3 of
Hofmann and Streicher, *A Groupoid Model Refutes Uniqueness of Identity Proofs*,
author manuscript dated 21 March 1994, pp. 5–7 (LICS 1994, pp. 208–212).
The universe is **discrete on all small groupoids**, as in the 1994 manuscript.
The later universe whose morphisms are groupoid isomorphisms is not used here.
`UniverseTotal` is the explicit disjoint-union presentation of the Grothendieck
construction over this discrete universe. No claim about syntactic derivability
or soundness of an object type theory is part of these definitions.
-/
@[expose] public section
namespace HofmannStreicher1994
open CategoryTheory
universe u v w z
/-- The identity groupoid has original arrows as objects and only equality arrows.
Source: Section 2.2, manuscript p. 5. -/
def identityGroupoid (G : Type u) [Groupoid.{v} G] (x y : G) : Grpd.{v, v} :=
Grpd.of (Discrete (x ⟶ y))
/-- The source's conjugation map for identity proofs, including the action of the
groupoid-valued family on a base arrow in the functor `F`.
With Mathlib's diagrammatic composition order, it is `b⁻¹ ≫ F(p) ≫ c`.
Source: Section 2.2, manuscript p. 5. -/
def identityTransport {G : Type u} [Groupoid.{v} G]
{H : Type w} [Groupoid.{z} H] (F : G ⥤ H)
{x y : G} {x' y' : H} (b : F.obj x ⟶ x') (c : F.obj y ⟶ y') :
Discrete (x ⟶ y) ⥤ Discrete (x' ⟶ y') :=
Discrete.functor fun p ↦ Discrete.mk (Groupoid.inv b ≫ F.map p ≫ c)
/-- Semantic UIP says any two objects of any identity groupoid are connected
by an identity proof at the next level. The latter is a hom in a discrete
groupoid, rather than Lean's own identity type as a proof-relevant object.
Source: Section 1, manuscript p. 2, and Section 3, p. 7. -/
def SemanticUIP (G : Type u) [Groupoid.{v} G] : Prop :=
∀ (x y : G) (p q : x ⟶ y),
Nonempty ((Discrete.mk p : Discrete (x ⟶ y)) ⟶ Discrete.mk q)
/-- The diagonal version of semantic UIP: each endomorphism proof is identified
with reflexivity. This is the conclusion that an interpretation of K would
provide. It does not by definition assert existence of a K eliminator.
Source: Theorem 1, manuscript p. 2; Section 3.1, pp. 7–9. -/
def SemanticBasedUIP (G : Type u) [Groupoid.{v} G] : Prop :=
∀ (x : G) (p : x ⟶ x),
Nonempty ((Discrete.mk p : Discrete (x ⟶ x)) ⟶ Discrete.mk (𝟙 x))
/-- The first universe in the 1994 groupoid model. Objects are all groupoids
small in universe `u`; its arrows are equality arrows only.
Source: Section 2.3, manuscript p. 7. -/
abbrev Universe := Discrete Grpd.{u, u}
/-- The generic family decodes a universe object to the small groupoid it names.
Source: Section 2.3, manuscript p. 7. -/
def universeEl : Universe.{u} ⥤ Grpd.{u, u} :=
Discrete.functor id
/-- Mathlib's general Grothendieck presentation of `Σ X : U. El(X)`. -/
abbrev UniverseGrothendieck := Grothendieck (universeEl.{u} ⋙ Grpd.forgetToCat)
/-- Explicit disjoint-union presentation of `Σ X : U. El(X)`. Its objects are
pairs consisting of a small groupoid and an object of that groupoid. Since U is
discrete, arrows are precisely arrows within one chosen groupoid.
Source: Section 3, manuscript p. 7. -/
abbrev UniverseTotal := Σ G : Grpd.{u, u}, G
instance universeTotalGroupoid : Groupoid (UniverseTotal.{u}) where
toCategory := inferInstanceAs (Category (UniverseTotal.{u}))
inv {X Y} f := by
cases f with
| mk g => exact CategoryTheory.Sigma.SigmaHom.mk (Groupoid.inv g)
inv_comp := by
intro X Y f
cases f with
| mk g => exact congrArg CategoryTheory.Sigma.SigmaHom.mk (Groupoid.inv_comp g)
comp_inv := by
intro X Y f
cases f with
| mk g => exact congrArg CategoryTheory.Sigma.SigmaHom.mk (Groupoid.comp_inv g)
/-- A concrete small groupoid with one object and two automorphisms: the
permutation group of Bool, viewed as a one-object groupoid. -/
def twoAutomorphismGroupoid : Grpd.{0, 0} :=
Grpd.of (SingleObj (Equiv.Perm Bool))
/-- The object of `Σ X : U. El(X)` carrying the two distinct identity proofs. -/
def counterexampleObject : UniverseTotal.{0} :=
⟨twoAutomorphismGroupoid, SingleObj.star (Equiv.Perm Bool)⟩
/-- Reflexivity at the chosen counterexample object. -/
def counterexampleRefl : counterexampleObject ⟶ counterexampleObject :=
𝟙 counterexampleObject
/-- The transposition automorphism, regarded as a second proof of reflexive
identity at the chosen object of the total universe family. -/
def counterexampleLoop : counterexampleObject ⟶ counterexampleObject :=
CategoryTheory.Sigma.SigmaHom.mk (Equiv.swap false true)
end HofmannStreicher1994
Read-back
What the Lean code literally says, in plain math · GPT-6 (Codex independent blind auditor)
HofmannStreicher1994.identityGroupoid. For arbitrary universe levels and , a type in universe equipped with a groupoid structure whose morphism types lie in universe , and explicitly supplied objects , this definition returns the bundled discrete groupoid on the type . Its object and morphism universe levels are both . Its objects are the individual morphisms from to in ; a morphism between two such objects exists exactly when the original morphisms are equal, and is then unique. Thus it can be an empty groupoid when there is no morphism from to , and distinct parallel morphisms of remain distinct objects with no morphism between them in this discrete groupoid. No relation between and , or connectedness or finiteness assumption on , is imposed.
HofmannStreicher1994.identityTransport. For arbitrary universe levels , implicit types and in universes and equipped respectively with groupoid structures having morphism types in universes and , an explicitly supplied functor , implicit objects and , and explicitly supplied morphisms and , this definition gives a functor from the discrete category on to the discrete category on . It sends an object represented by to the object represented by , where composition is performed first with , then with , then with . Its action on morphisms is the action induced by this object function between discrete categories. The inverse of comes from the assumed groupoid structure; no separate invertibility hypothesis, faithfulness or fullness hypothesis on , or equality of the four universe levels is required. The source morphism type may be empty, in which case the source discrete category is empty.
HofmannStreicher1994.SemanticUIP. For arbitrary universe levels and an explicitly supplied type in universe equipped with a groupoid structure whose morphism types lie in universe , this definition is the proposition that for every pair of objects and every pair of parallel morphisms , the morphism type from the discrete object represented by to the discrete object represented by is inhabited. Since these are objects of the discrete category on , this says exactly that for every such pair: each morphism type of has at most one element. The proposition requires only inhabitation of the indicated morphism type, not a supplied family of chosen morphisms. It does not require a morphism between every pair of objects; empty morphism types satisfy the condition vacuously, and the entire condition is vacuous if has no objects.
HofmannStreicher1994.SemanticBasedUIP. For arbitrary universe levels and an explicitly supplied type in universe equipped with a groupoid structure whose morphism types lie in universe , this definition is the proposition that for every object and every morphism , the morphism type from the discrete object represented by to the discrete object represented by the identity , in the discrete category on , is inhabited. Equivalently, every endomorphism of every object is its identity. Each endomorphism type is already inhabited by its identity, so the condition makes it a singleton for every existing object. No particular base object is fixed: the quantifier ranges over all objects. There is no explicit quantifier over morphisms between different objects, and the whole proposition is vacuous for an empty object type.
HofmannStreicher1994.Universe. For each universe level , this abbreviation denotes the discrete category whose underlying objects are all bundled groupoids with object types and morphism types in universe . The collection of these bundled groupoids, and hence the underlying object type of this discrete category, lies in universe . A morphism between two of its objects encodes equality of the bundled groupoids and, when inhabited, is unique; the morphisms are not defined to be arbitrary functors or equivalences between the groupoids. The collection includes empty groupoids and imposes no finiteness or connectedness condition. The abbreviation has no term arguments or additional typeclass assumptions.
HofmannStreicher1994.universeEl. For each universe level , this definition is a functor from the discrete category on all bundled groupoids with object and morphism universe levels to the category of those bundled groupoids, whose morphisms are functors. It sends the discrete object represented by a bundled groupoid to itself. Its action on morphisms is the canonical one determined by that object function: an equality between bundled groupoids induces the corresponding functor, and an identity maps to the identity functor. It is defined for every such groupoid, including an empty one, and has no term arguments or additional typeclass assumptions.
HofmannStreicher1994.UniverseGrothendieck. For each universe level , this abbreviation denotes the Grothendieck construction of the functor that takes the discrete category on all bundled groupoids with object and morphism universe levels , sends each object to , and then regards as an underlying category. An object of this construction consists of a discrete index represented by such a groupoid , together with an object . A morphism from to consists of a base morphism from the discrete index to the discrete index , hence an equality of the bundled groupoids, together with a morphism in from the image of under the functor induced by that base morphism to . Thus a groupoid with no objects contributes no objects to the construction, and morphisms across indices require equality of the indices. The abbreviation has no term arguments or additional typeclass assumptions and uses the category structure supplied by the Grothendieck construction.
HofmannStreicher1994.UniverseTotal. For each universe level , this abbreviation denotes the dependent sum of the underlying object types of all bundled groupoids whose object and morphism types lie in universe . An element is a pair consisting of one such bundled groupoid and one object ; the total object type lies in universe . Every such pair is included without identifying groupoids merely because they are isomorphic or equivalent. An empty groupoid contributes no elements. The abbreviation itself supplies the dependent sum type, has no term arguments or additional typeclass assumptions, and does not itself give an equivalence with a Grothendieck construction.
HofmannStreicher1994.universeTotalGroupoid. For each universe level , this instance equips the dependent sum of the underlying object types of all bundled groupoids with object and morphism universe levels with a groupoid structure. It takes its category structure, including its morphism universe, directly from the existing category structure on this dependent sum. In that category, a morphism is represented by an underlying morphism inside a single indexed groupoid , with endpoints and ; equality transport allows equal indices to be presented in this common form. The defined inverse is the same kind of dependent sum morphism represented by in . Both inverse laws are obtained by applying the dependent sum morphism constructor to the corresponding inverse laws in . No extra groupoid assumptions are supplied separately, because the indices already contain groupoid structures; an empty indexed groupoid contributes no objects or morphisms.
HofmannStreicher1994.twoAutomorphismGroupoid. This definition has no universe parameters, term arguments, or additional typeclass assumptions. It returns a bundled groupoid with object and morphism universe levels both , obtained from the single-object category associated with the group of permutations of the two-element Boolean type. It has exactly one object, and its endomorphisms are precisely the bijections of the Boolean type, with the identities, composition, and inverses supplied by that permutation-group single-object construction. These bijections are the identity permutation and the permutation exchanging the two Boolean values; neither is identified with the other by the definition.
HofmannStreicher1994.counterexampleObject. This definition has no universe parameters, term arguments, or additional typeclass assumptions. It specifies an element of the dependent sum of the underlying object types of all bundled groupoids with object and morphism universe levels . Its first component is the bundled single-object groupoid whose endomorphisms are permutations of the Boolean type, and its second component is that groupoid's sole object. In particular, it is a specific object of the total category, with that bundled groupoid as its index.
HofmannStreicher1994.counterexampleRefl. This definition has no universe parameters, term arguments, or additional typeclass assumptions. Its domain and codomain are both the total-category object consisting of the bundled single-object groupoid of Boolean permutations together with that groupoid's sole object. It defines the identity morphism of this object in the dependent sum category of all bundled groupoids with object and morphism universe levels . Equivalently, it is the dependent sum morphism represented by the identity Boolean permutation inside the specified groupoid.
HofmannStreicher1994.counterexampleLoop. This definition has no universe parameters, term arguments, or additional typeclass assumptions. Its domain and codomain are both the total-category object consisting of the bundled single-object groupoid of Boolean permutations together with that groupoid's sole object. It defines the dependent sum morphism represented in that groupoid by the Boolean permutation exchanging false and true. Thus the underlying permutation sends false to true and true to false. The declaration supplies this specific endomorphism; it is not itself a proposition asserting an inequality between endomorphisms or a failure of either of the previously defined universal properties.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.