Built with
doc-gen4, running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+βCtrl+βto navigate,
Ctrl+π±οΈto focus.
On Mac, use
Cmdinstead of
Ctrl.
/-
Copyright (c) 2018 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Johannes HΓΆlzl, Reid Barton, Sean Leather
! This file was ported from Lean 3 source module category_theory.concrete_category.bundled
! leanprover-community/mathlib commit a148d797a1094ab554ad4183a4ad6f130358ef64
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Std.Tactic.Lint.Frontend
import Std.Tactic.Lint.Misc
import Std.Tactic.CoeExt
import Mathlib.Mathport.Rename
/-!
# Bundled types
`Bundled c` provides a uniform structure for bundling a type equipped with a type class.
We provide `Category` instances for these in `CategoryTheory/UnbundledHom.lean`
(for categories with unbundled homs, e.g. topological spaces)
and in `CategoryTheory/BundledHom.lean` (for categories with bundled homs, e.g. monoids).
-/
universe u v
namespace CategoryTheory
variable {c d : Type u β Type v} {Ξ± : Type u}
/-- `Bundled` is a type bundled with a type class instance for that type. Only
the type class is exposed as a parameter. -/
structure Bundled (c : Type u β Type v) : Type max (u + 1) v: Type ((max(u+1)v)+1)
Type max (u + 1) v where
/-- The underlying type of the bundled type -/
Ξ± : Type u
/-- The corresponding instance of the bundled type class -/
str : c Ξ± := by infer_instance
#align category_theory.bundled CategoryTheory.Bundled: (Type u β Type v) β Type (max(u+1)v)
CategoryTheory.Bundled
namespace Bundled
attribute [coe] Ξ±
-- This is needed so that we can ask for an instance of `c Ξ±` below even though Lean doesn't know
-- that `c Ξ±` is a typeclass.
set_option checkBinderAnnotations false in
-- Usually explicit instances will provide their own version of this, e.g. `MonCat.of` and
-- `TopCat.of`.
/-- A generic function for lifting a type equipped with an instance to a bundled object. -/
def of {c : Type u β Type v} (Ξ± : Type u) [str : c Ξ±] : Bundled: (Type ?u.698 β Type ?u.697) β Type (max(?u.698+1)?u.697)
Bundled c :=
β¨Ξ±, strβ©
#align category_theory.bundled.of CategoryTheory.Bundled.of: {c : Type u β Type v} β (Ξ± : Type u) β [str : c Ξ±] β Bundled c
CategoryTheory.Bundled.of
instance coeSort : CoeSort (Bundled: (Type ?u.766 β Type ?u.765) β Type (max(?u.766+1)?u.765)
Bundled c) (Type u) :=
β¨Bundled.Ξ±β©
theorem coe_mk: β (Ξ± : Type u) (str : c Ξ±), β(mk Ξ±) = Ξ±
coe_mk (Ξ±) (str) : (@Bundled.mk c Ξ± str : Type u) = Ξ± :=
rfl: β {Ξ± : Sort ?u.1000} {a : Ξ±}, a = a
rfl
#align category_theory.bundled.coe_mk CategoryTheory.Bundled.coe_mk: β {c : Type u β Type v} (Ξ± : Type u) (str : c Ξ±), β(mk Ξ±) = Ξ±
CategoryTheory.Bundled.coe_mk
/-
`Bundled.map` is reducible so that, if we define a category
def Ring : Type (u+1) := induced_category SemiRing (bundled.map @ring.to_semiring)
instance search is able to "see" that a morphism R βΆ S in Ring is really
a (semi)ring homomorphism from R.Ξ± to S.Ξ±, and not merely from
`(Bundled.map @Ring.toSemiring R).Ξ±` to `(Bundled.map @Ring.toSemiring S).Ξ±`.
TODO: Once at least one use of this has been ported, check if this still needs to be reducible in
Lean 4.
-/
/-- Map over the bundled structure -/
def map (f: {Ξ± : Type u} β c Ξ± β d Ξ±
f : β {Ξ±}, c Ξ± β d Ξ±) (b : Bundled: (Type ?u.1030 β Type ?u.1029) β Type (max(?u.1030+1)?u.1029)
Bundled c) : Bundled: (Type ?u.1037 β Type ?u.1036) β Type (max(?u.1037+1)?u.1036)
Bundled d :=
β¨b, f: {Ξ± : Type u} β c Ξ± β d Ξ±
f b.str: {c : Type ?u.1184 β Type ?u.1183} β (self : Bundled c) β c βself
strβ©
#align category_theory.bundled.map CategoryTheory.Bundled.map
end Bundled
end CategoryTheory