|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Joël Riou. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Joël Riou |
| 5 | +-/ |
| 6 | +import Mathlib.CategoryTheory.MorphismProperty.Basic |
| 7 | + |
| 8 | +/-! |
| 9 | +# Categories with classes of fibrations, cofibrations, weak equivalences |
| 10 | +
|
| 11 | +We introduce typeclasses `CategoryWithFibrations`, `CategoryWithCofibrations` and |
| 12 | +`CategoryWithWeakEquivalences` to express that a category `C` is equipped with |
| 13 | +classes of morphisms named "fibrations", "cofibrations" or "weak equivalences". |
| 14 | +
|
| 15 | +-/ |
| 16 | + |
| 17 | +universe v u |
| 18 | + |
| 19 | +namespace HomotopicalAlgebra |
| 20 | + |
| 21 | +open CategoryTheory |
| 22 | + |
| 23 | +variable (C : Type u) [Category.{v} C] |
| 24 | + |
| 25 | +/-- A category with fibrations is a category equipped with |
| 26 | +a class of morphisms named "fibrations". -/ |
| 27 | +class CategoryWithFibrations where |
| 28 | + /-- the class of fibrations -/ |
| 29 | + fibrations : MorphismProperty C |
| 30 | + |
| 31 | +/-- A category with cofibrations is a category equipped with |
| 32 | +a class of morphisms named "cofibrations". -/ |
| 33 | +class CategoryWithCofibrations where |
| 34 | + /-- the class of cofibrations -/ |
| 35 | + cofibrations : MorphismProperty C |
| 36 | + |
| 37 | +/-- A category with weak equivalences is a category equipped with |
| 38 | +a class of morphisms named "weak equivalences". -/ |
| 39 | +class CategoryWithWeakEquivalences where |
| 40 | + /-- the class of weak equivalences -/ |
| 41 | + weakEquivalences : MorphismProperty C |
| 42 | + |
| 43 | +variable {X Y : C} (f : X ⟶ Y) |
| 44 | + |
| 45 | +section Fib |
| 46 | + |
| 47 | +variable [CategoryWithFibrations C] |
| 48 | + |
| 49 | +/-- The class of fibrations in a category with fibrations. -/ |
| 50 | +def fibrations : MorphismProperty C := CategoryWithFibrations.fibrations |
| 51 | + |
| 52 | +variable {C} |
| 53 | + |
| 54 | +/-- A morphism `f` satisfies `[Fibration f]` if it belongs to `fibrations C`. -/ |
| 55 | +@[mk_iff] |
| 56 | +class Fibration : Prop where |
| 57 | + mem : fibrations C f |
| 58 | + |
| 59 | +lemma mem_fibrations [Fibration f] : fibrations C f := Fibration.mem |
| 60 | + |
| 61 | +end Fib |
| 62 | + |
| 63 | +section Cof |
| 64 | + |
| 65 | +variable [CategoryWithCofibrations C] |
| 66 | + |
| 67 | +/-- The class of cofibrations in a category with cofibrations. -/ |
| 68 | +def cofibrations : MorphismProperty C := CategoryWithCofibrations.cofibrations |
| 69 | + |
| 70 | +variable {C} |
| 71 | + |
| 72 | +/-- A morphism `f` satisfies `[Cofibration f]` if it belongs to `cofibrations C`. -/ |
| 73 | +@[mk_iff] |
| 74 | +class Cofibration : Prop where |
| 75 | + mem : cofibrations C f |
| 76 | + |
| 77 | +lemma mem_cofibrations [Cofibration f] : cofibrations C f := Cofibration.mem |
| 78 | + |
| 79 | +end Cof |
| 80 | + |
| 81 | +section W |
| 82 | + |
| 83 | +variable [CategoryWithWeakEquivalences C] |
| 84 | + |
| 85 | +/-- The class of weak equivalences in a category with weak equivalences. -/ |
| 86 | +def weakEquivalences : MorphismProperty C := CategoryWithWeakEquivalences.weakEquivalences |
| 87 | + |
| 88 | +variable {C} |
| 89 | + |
| 90 | +/-- A morphism `f` satisfies `[WeakEquivalence f]` if it belongs to `weakEquivalences C`. -/ |
| 91 | +@[mk_iff] |
| 92 | +class WeakEquivalence : Prop where |
| 93 | + mem : weakEquivalences C f |
| 94 | + |
| 95 | +lemma mem_weakEquivalences [WeakEquivalence f] : weakEquivalences C f := WeakEquivalence.mem |
| 96 | + |
| 97 | +end W |
| 98 | + |
| 99 | +section TrivFib |
| 100 | + |
| 101 | +variable [CategoryWithFibrations C] [CategoryWithWeakEquivalences C] |
| 102 | + |
| 103 | +/-- A trivial fibration is a morphism that is both a fibration and a weak equivalence. -/ |
| 104 | +def trivialFibrations : MorphismProperty C := fibrations C ⊓ weakEquivalences C |
| 105 | + |
| 106 | +lemma trivialFibrations_sub_fibrations : trivialFibrations C ≤ fibrations C := |
| 107 | + fun _ _ _ hf ↦ hf.1 |
| 108 | + |
| 109 | +lemma trivialFibrations_sub_weakEquivalences : trivialFibrations C ≤ weakEquivalences C := |
| 110 | + fun _ _ _ hf ↦ hf.2 |
| 111 | + |
| 112 | +variable {C} |
| 113 | + |
| 114 | +lemma mem_trivialFibrations [Fibration f] [WeakEquivalence f] : |
| 115 | + trivialFibrations C f := |
| 116 | + ⟨mem_fibrations f, mem_weakEquivalences f⟩ |
| 117 | + |
| 118 | +end TrivFib |
| 119 | + |
| 120 | +section TrivCof |
| 121 | + |
| 122 | +variable [CategoryWithCofibrations C] [CategoryWithWeakEquivalences C] |
| 123 | + |
| 124 | +/-- A trivial cofibration is a morphism that is both a cofibration and a weak equivalence. -/ |
| 125 | +def trivialCofibrations : MorphismProperty C := cofibrations C ⊓ weakEquivalences C |
| 126 | + |
| 127 | +lemma trivialCofibrations_sub_cofibrations : trivialCofibrations C ≤ cofibrations C := |
| 128 | + fun _ _ _ hf ↦ hf.1 |
| 129 | + |
| 130 | +lemma trivialCofibrations_sub_weakEquivalences : trivialCofibrations C ≤ weakEquivalences C := |
| 131 | + fun _ _ _ hf ↦ hf.2 |
| 132 | + |
| 133 | + |
| 134 | +variable {C} |
| 135 | + |
| 136 | +lemma mem_trivialCofibrations [Cofibration f] [WeakEquivalence f] : |
| 137 | + trivialCofibrations C f := |
| 138 | + ⟨mem_cofibrations f, mem_weakEquivalences f⟩ |
| 139 | + |
| 140 | +end TrivCof |
| 141 | + |
| 142 | +end HomotopicalAlgebra |
0 commit comments