Internal categories in Set are ordinary small categories
ProvedQAlgorithms.Papers.Independent.Intake100.P20.internalCategoriesInSetAn internal category in Set has an object set , an arrow set , source and target maps , identities , and composition when . Require , the correct source and target of a composite, associativity, and both unit laws. It gives an ordinary small category by
Conversely, the total arrow set of an ordinary small category has these internal maps, with , where means first , then . The explicit arrow and hom-fibre equivalences recover identities and composition. Empty categories are allowed. This is a correspondence of structures with the original operations, not two unrelated existence statements.
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P20
namespace QAlgorithms.Papers.Independent.Intake100.P20
open CategoryTheory
open scoped TensorProduct Manifold ContDiff
universe u v w z
/-- PDF pp. 6–8: internal categories in Set and ordinary small categories have
mutually inverse structure translations. Objects stay fixed; arrows are identified
by the displayed canonical equivalences. Every reconstruction equation for
composition is restricted to the source's composable pairs. -/
theorem internalCategoriesInSet :
(∀ {A : Type u} {O : Type v} (D : CategoryMaps A O) (h : CategoryDiagrams D),
letI := categoryOfMaps D h
let E := mapsOfCategory O
let q := totalArrowEquiv D h
(∀ a, E.source (q a) = D.source a ∧ E.target (q a) = D.target a) ∧
(∀ x, E.identity x = q (D.identity x)) ∧
(∀ f g, D.target f = D.source g →
E.compose (q g) (q f) = q (D.compose g f))) ∧
(∀ (O : Type v) [Category.{u} O], CategoryDiagrams (mapsOfCategory O) ∧
(∀ x, (mapsOfCategory O).identity x = ⟨x, x, 𝟙 x⟩) ∧
(∀ x y z (f : x ⟶ y) (g : y ⟶ z),
(mapsOfCategory O).compose ⟨y, z, g⟩ ⟨x, y, f⟩ = ⟨x, z, f ≫ g⟩) ∧
(∀ x y (f : x ⟶ y), (totalHomEquiv O x y f).val = ⟨x, y, f⟩)) := by sorry
end QAlgorithms.Papers.Independent.Intake100.P20
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
The theorem asserts the conjunction of two statements. First, let be arbitrary types, and let , , and be total functions satisfying for every ; and whenever ; and for every ; and whenever and . Give the category whose morphisms are elements equipped with and , whose identities are , and whose composition is induced by . Let be the type of triples with in this category, and let be the bijection , where the last component includes its endpoint equalities. On , define , , , and define , for and , to be if , and to be otherwise. Then and for every , for every , and whenever . Second, for every category with object type , form its type of all morphism triples and the same maps , including the rule that composition returns its second argument when the endpoints do not match. These maps satisfy all the source, target, identity, and conditional associativity equations listed above; moreover , for every and , and the underlying triple of the image of under the endpoint-restricted bijection is . Empty types and empty morphism sets are allowed wherever the stated data exist; the composition-preservation assertions apply only when the specified endpoints match.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.