Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(algebra/category/FinVect): has finite limits (#13793)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
- Loading branch information
1 parent
e3d38ed
commit 85657f1
Showing
6 changed files
with
209 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/- | ||
Copyright (c) 2022 Scott Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Scott Morrison | ||
-/ | ||
import algebra.category.FinVect | ||
import algebra.category.Module.limits | ||
import algebra.category.Module.products | ||
import algebra.category.Module.epi_mono | ||
import category_theory.limits.creates | ||
import category_theory.limits.shapes.finite_limits | ||
import category_theory.limits.constructions.limits_of_products_and_equalizers | ||
|
||
/-! | ||
# `forget₂ (FinVect K) (Module K)` creates all finite limits. | ||
And hence `FinVect K` has all finite limits. | ||
-/ | ||
|
||
noncomputable theory | ||
universes v u | ||
|
||
open category_theory | ||
open category_theory.limits | ||
|
||
namespace FinVect | ||
|
||
variables {J : Type v} [small_category J] [fin_category J] | ||
variables {k : Type v} [field k] | ||
|
||
instance {J : Type v} [fintype J] (Z : J → Module.{v} k) [∀ j, finite_dimensional k (Z j)] : | ||
finite_dimensional k (∏ λ j, Z j : Module.{v} k) := | ||
begin | ||
haveI : finite_dimensional k (Module.of k (Π j, Z j)), { dsimp, apply_instance, }, | ||
exact finite_dimensional.of_injective | ||
(Module.pi_iso_pi _).hom | ||
((Module.mono_iff_injective _).1 (by apply_instance)), | ||
end | ||
|
||
/-- Finite limits of finite finite dimensional vectors spaces are finite dimensional, | ||
because we can realise them as subobjects of a finite product. -/ | ||
instance (F : J ⥤ FinVect k) : | ||
finite_dimensional k (limit (F ⋙ forget₂ (FinVect k) (Module.{v} k)) : Module.{v} k) := | ||
begin | ||
haveI : ∀ j, finite_dimensional k ((F ⋙ forget₂ (FinVect k) (Module.{v} k)).obj j), | ||
{ intro j, change finite_dimensional k (F.obj j), apply_instance, }, | ||
exact finite_dimensional.of_injective | ||
(limit_subobject_product (F ⋙ forget₂ (FinVect k) (Module.{v} k))) | ||
((Module.mono_iff_injective _).1 (by apply_instance)), | ||
end | ||
|
||
/-- The forgetful functor from `FinVect k` to `Module k` creates all finite limits. -/ | ||
def forget₂_creates_limit (F : J ⥤ FinVect k) : | ||
creates_limit F (forget₂ (FinVect k) (Module.{v} k)) := | ||
creates_limit_of_fully_faithful_of_iso | ||
⟨(limit (F ⋙ forget₂ (FinVect k) (Module.{v} k)) : Module.{v} k), by apply_instance⟩ | ||
(iso.refl _) | ||
|
||
instance : creates_limits_of_shape J (forget₂ (FinVect k) (Module.{v} k)) := | ||
{ creates_limit := λ F, forget₂_creates_limit F, } | ||
|
||
instance : has_finite_limits (FinVect k) := | ||
{ out := λ J _ _, by exactI | ||
has_limits_of_shape_of_has_limits_of_shape_creates_limits_of_shape | ||
(forget₂ (FinVect k) (Module.{v} k)), } | ||
|
||
instance : preserves_finite_limits (forget₂ (FinVect k) (Module.{v} k)) := | ||
{ preserves_finite_limits := λ J _ _, by exactI infer_instance, } | ||
|
||
end FinVect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/- | ||
Copyright (c) 2022 Scott Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Scott Morrison | ||
-/ | ||
import algebra.category.Module.epi_mono | ||
import linear_algebra.pi | ||
|
||
/-! | ||
# The concrete products in the category of modules are products in the categorical sense. | ||
-/ | ||
|
||
open category_theory | ||
open category_theory.limits | ||
|
||
universes u v | ||
|
||
namespace Module | ||
variables {R : Type u} [ring R] | ||
|
||
variables {ι : Type v} (Z : ι → Module.{v} R) | ||
|
||
/-- The product cone induced by the concrete product. -/ | ||
def product_cone : fan Z := | ||
fan.mk (Module.of R (Π i : ι, Z i)) (λ i, (linear_map.proj i : (Π i : ι, Z i) →ₗ[R] Z i)) | ||
|
||
/-- The concrete product cone is limiting. -/ | ||
def product_cone_is_limit : is_limit (product_cone Z) := | ||
{ lift := λ s, (linear_map.pi s.π.app : s.X →ₗ[R] (Π i : ι, Z i)), | ||
fac' := by tidy, | ||
uniq' := λ s m w, by { ext x i, exact linear_map.congr_fun (w i) x, }, } | ||
|
||
-- While we could use this to construct a `has_products (Module R)` instance, | ||
-- we already have `has_limits (Module R)` in `algebra.category.Module.limits`. | ||
|
||
variables [has_products (Module.{v} R)] | ||
|
||
/-- | ||
The categorical product of a family of objects in `Module` | ||
agrees with the usual module-theoretical product. | ||
-/ | ||
noncomputable def pi_iso_pi : | ||
∏ Z ≅ Module.of R (Π i, Z i) := | ||
limit.iso_limit_cone ⟨_, product_cone_is_limit Z⟩ | ||
|
||
-- We now show this isomorphism commutes with the inclusion of the kernel into the source. | ||
|
||
@[simp, elementwise] lemma pi_iso_pi_inv_kernel_ι (i : ι) : | ||
(pi_iso_pi Z).inv ≫ pi.π Z i = (linear_map.proj i : (Π i : ι, Z i) →ₗ[R] Z i) := | ||
limit.iso_limit_cone_inv_π _ _ | ||
|
||
@[simp, elementwise] lemma pi_iso_pi_hom_ker_subtype (i : ι) : | ||
(pi_iso_pi Z).hom ≫ (linear_map.proj i : (Π i : ι, Z i) →ₗ[R] Z i) = pi.π Z i := | ||
is_limit.cone_point_unique_up_to_iso_inv_comp _ (limit.is_limit _) _ | ||
|
||
end Module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters