algebraic_topology.simplicial_setMathlib.AlgebraicTopology.SimplicialSet

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -8,7 +8,7 @@ import AlgebraicTopology.TopologicalSimplex
 import CategoryTheory.Limits.Presheaf
 import CategoryTheory.Limits.Types
 import CategoryTheory.Yoneda
-import Topology.Category.Top.Limits.Basic
+import Topology.Category.TopCat.Limits.Basic
 
 #align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"f2b757fc5c341d88741b9c4630b1e8ba973c5726"
 
Diff
@@ -3,12 +3,12 @@ Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
 -/
-import Mathbin.AlgebraicTopology.SimplicialObject
-import Mathbin.AlgebraicTopology.TopologicalSimplex
-import Mathbin.CategoryTheory.Limits.Presheaf
-import Mathbin.CategoryTheory.Limits.Types
-import Mathbin.CategoryTheory.Yoneda
-import Mathbin.Topology.Category.Top.Limits.Basic
+import AlgebraicTopology.SimplicialObject
+import AlgebraicTopology.TopologicalSimplex
+import CategoryTheory.Limits.Presheaf
+import CategoryTheory.Limits.Types
+import CategoryTheory.Yoneda
+import Topology.Category.Top.Limits.Basic
 
 #align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"f2b757fc5c341d88741b9c4630b1e8ba973c5726"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
-
-! This file was ported from Lean 3 source module algebraic_topology.simplicial_set
-! leanprover-community/mathlib commit f2b757fc5c341d88741b9c4630b1e8ba973c5726
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.AlgebraicTopology.SimplicialObject
 import Mathbin.AlgebraicTopology.TopologicalSimplex
@@ -15,6 +10,8 @@ import Mathbin.CategoryTheory.Limits.Types
 import Mathbin.CategoryTheory.Yoneda
 import Mathbin.Topology.Category.Top.Limits.Basic
 
+#align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"f2b757fc5c341d88741b9c4630b1e8ba973c5726"
+
 /-!
 A simplicial set is just a simplicial object in `Type`,
 i.e. a `Type`-valued presheaf on the simplex category.
Diff
@@ -65,7 +65,6 @@ def standardSimplex : SimplexCategory ⥤ SSet :=
 #align sSet.standard_simplex SSet.standardSimplex
 -/
 
--- mathport name: standard_simplex
 scoped[Simplicial] notation "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCategory.mk n)
 
 instance : Inhabited SSet :=
@@ -73,11 +72,13 @@ instance : Inhabited SSet :=
 
 section
 
+#print SSet.asOrderHom /-
 /-- The `m`-simplices of the `n`-th standard simplex are
 the monotone maps from `fin (m+1)` to `fin (n+1)`. -/
 def asOrderHom {n} {m} (α : Δ[n].obj m) : OrderHom (Fin (m.unop.len + 1)) (Fin (n + 1)) :=
   α.toOrderHom
 #align sSet.as_order_hom SSet.asOrderHom
+-/
 
 end
 
@@ -93,12 +94,13 @@ def boundary (n : ℕ) : SSet
 #align sSet.boundary SSet.boundary
 -/
 
--- mathport name: sSet.boundary
 scoped[Simplicial] notation "∂Δ[" n "]" => SSet.boundary n
 
+#print SSet.boundaryInclusion /-
 /-- The inclusion of the boundary of the `n`-th standard simplex into that standard simplex. -/
 def boundaryInclusion (n : ℕ) : ∂Δ[n] ⟶ Δ[n] where app m (α : { α : Δ[n].obj m // _ }) := α
 #align sSet.boundary_inclusion SSet.boundaryInclusion
+-/
 
 #print SSet.horn /-
 /-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
@@ -118,13 +120,14 @@ def horn (n : ℕ) (i : Fin (n + 1)) : SSet
 #align sSet.horn SSet.horn
 -/
 
--- mathport name: sSet.horn
 scoped[Simplicial] notation "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
 
+#print SSet.hornInclusion /-
 /-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
 def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n]
     where app m (α : { α : Δ[n].obj m // _ }) := α
 #align sSet.horn_inclusion SSet.hornInclusion
+-/
 
 section Examples
 
Diff
@@ -50,7 +50,8 @@ open scoped Simplicial
 This is the category of contravariant functors from
 `simplex_category` to `Type u`. -/
 def SSet : Type (u + 1) :=
-  SimplicialObject (Type u)deriving LargeCategory, Limits.HasLimits, Limits.HasColimits
+  SimplicialObject (Type u)
+deriving LargeCategory, Limits.HasLimits, Limits.HasColimits
 #align sSet SSet
 -/
 
@@ -110,7 +111,7 @@ def horn (n : ℕ) (i : Fin (n + 1)) : SSet
   map m₁ m₂ f α :=
     ⟨f.unop ≫ (α : Δ[n].obj m₁), by
       intro h; apply α.property
-      rw [Set.eq_univ_iff_forall] at h⊢; intro j
+      rw [Set.eq_univ_iff_forall] at h ⊢; intro j
       apply Or.imp _ id (h j)
       intro hj
       exact Set.range_comp_subset_range _ _ hj⟩
@@ -143,7 +144,8 @@ end Examples
 #print SSet.Truncated /-
 /-- Truncated simplicial sets. -/
 def Truncated (n : ℕ) :=
-  SimplicialObject.Truncated (Type u) n deriving LargeCategory, Limits.HasLimits, Limits.HasColimits
+  SimplicialObject.Truncated (Type u) n
+deriving LargeCategory, Limits.HasLimits, Limits.HasColimits
 #align sSet.truncated SSet.Truncated
 -/
 
Diff
@@ -43,7 +43,7 @@ universe v u
 
 open CategoryTheory CategoryTheory.Limits
 
-open Simplicial
+open scoped Simplicial
 
 #print SSet /-
 /-- The category of simplicial sets.
@@ -127,7 +127,7 @@ def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n]
 
 section Examples
 
-open Simplicial
+open scoped Simplicial
 
 #print SSet.S1 /-
 /-- The simplicial circle. -/
Diff
@@ -72,12 +72,6 @@ instance : Inhabited SSet :=
 
 section
 
-/- warning: sSet.as_order_hom -> SSet.asOrderHom is a dubious translation:
-lean 3 declaration is
-  forall {n : Nat} {m : Opposite.{1} SimplexCategory}, (CategoryTheory.Functor.obj.{0, 0, 0, 1} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.opposite.{0, 0} SimplexCategory SimplexCategory.smallCategory) Type CategoryTheory.types.{0} (CategoryTheory.Functor.obj.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex (SimplexCategory.mk n)) m) -> (OrderHom.{0, 0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Fin.partialOrder (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (SimplexCategory.mk n)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Fin.partialOrder (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (SimplexCategory.mk n)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))))
-but is expected to have type
-  forall {n : Nat} {m : Opposite.{1} SimplexCategory}, (Prefunctor.obj.{1, 1, 0, 1} (Opposite.{1} SimplexCategory) (CategoryTheory.CategoryStruct.toQuiver.{0, 0} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.toCategoryStruct.{0, 0} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.opposite.{0, 0} SimplexCategory SimplexCategory.smallCategory))) Type (CategoryTheory.CategoryStruct.toQuiver.{0, 1} Type (CategoryTheory.Category.toCategoryStruct.{0, 1} Type CategoryTheory.types.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.opposite.{0, 0} SimplexCategory SimplexCategory.smallCategory) Type CategoryTheory.types.{0} (Prefunctor.obj.{1, 1, 0, 1} SimplexCategory (CategoryTheory.CategoryStruct.toQuiver.{0, 0} SimplexCategory (CategoryTheory.Category.toCategoryStruct.{0, 0} SimplexCategory SimplexCategory.smallCategory)) SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex) (SimplexCategory.mk n))) m) -> (OrderHom.{0, 0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Fin.instPartialOrderFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Fin.instPartialOrderFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))))
-Case conversion may be inaccurate. Consider using '#align sSet.as_order_hom SSet.asOrderHomₓ'. -/
 /-- The `m`-simplices of the `n`-th standard simplex are
 the monotone maps from `fin (m+1)` to `fin (n+1)`. -/
 def asOrderHom {n} {m} (α : Δ[n].obj m) : OrderHom (Fin (m.unop.len + 1)) (Fin (n + 1)) :=
@@ -101,12 +95,6 @@ def boundary (n : ℕ) : SSet
 -- mathport name: sSet.boundary
 scoped[Simplicial] notation "∂Δ[" n "]" => SSet.boundary n
 
-/- warning: sSet.boundary_inclusion -> SSet.boundaryInclusion is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.boundary n) (CategoryTheory.Functor.obj.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex (SimplexCategory.mk n))
-but is expected to have type
-  forall (n : Nat), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.boundary n) (Prefunctor.obj.{1, 1, 0, 1} SimplexCategory (CategoryTheory.CategoryStruct.toQuiver.{0, 0} SimplexCategory (CategoryTheory.Category.toCategoryStruct.{0, 0} SimplexCategory SimplexCategory.smallCategory)) SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex) (SimplexCategory.mk n))
-Case conversion may be inaccurate. Consider using '#align sSet.boundary_inclusion SSet.boundaryInclusionₓ'. -/
 /-- The inclusion of the boundary of the `n`-th standard simplex into that standard simplex. -/
 def boundaryInclusion (n : ℕ) : ∂Δ[n] ⟶ Δ[n] where app m (α : { α : Δ[n].obj m // _ }) := α
 #align sSet.boundary_inclusion SSet.boundaryInclusion
@@ -132,12 +120,6 @@ def horn (n : ℕ) (i : Fin (n + 1)) : SSet
 -- mathport name: sSet.horn
 scoped[Simplicial] notation "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
 
-/- warning: sSet.horn_inclusion -> SSet.hornInclusion is a dubious translation:
-lean 3 declaration is
-  forall (n : Nat) (i : Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.horn n i) (CategoryTheory.Functor.obj.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex (SimplexCategory.mk n))
-but is expected to have type
-  forall (n : Nat) (i : Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.horn n i) (Prefunctor.obj.{1, 1, 0, 1} SimplexCategory (CategoryTheory.CategoryStruct.toQuiver.{0, 0} SimplexCategory (CategoryTheory.Category.toCategoryStruct.{0, 0} SimplexCategory SimplexCategory.smallCategory)) SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex) (SimplexCategory.mk n))
-Case conversion may be inaccurate. Consider using '#align sSet.horn_inclusion SSet.hornInclusionₓ'. -/
 /-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
 def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n]
     where app m (α : { α : Δ[n].obj m // _ }) := α
Diff
@@ -94,10 +94,7 @@ def boundary (n : ℕ) : SSet
     where
   obj m := { α : Δ[n].obj m // ¬Function.Surjective (asOrderHom α) }
   map m₁ m₂ f α :=
-    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
-      intro h
-      apply α.property
-      exact Function.Surjective.of_comp h⟩
+    ⟨f.unop ≫ (α : Δ[n].obj m₁), by intro h; apply α.property; exact Function.Surjective.of_comp h⟩
 #align sSet.boundary SSet.boundary
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
 
 ! This file was ported from Lean 3 source module algebraic_topology.simplicial_set
-! leanprover-community/mathlib commit 178a32653e369dce2da68dc6b2694e385d484ef1
+! leanprover-community/mathlib commit f2b757fc5c341d88741b9c4630b1e8ba973c5726
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -29,6 +29,9 @@ and their boundaries `∂Δ[n]` and horns `Λ[n, i]`.
 
 ## Future work
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 There isn't yet a complete API for simplices, boundaries, and horns.
 As an example, we should have a function that constructs
 from a non-surjective order preserving function `fin n → fin n`
Diff
@@ -42,20 +42,24 @@ open CategoryTheory CategoryTheory.Limits
 
 open Simplicial
 
+#print SSet /-
 /-- The category of simplicial sets.
 This is the category of contravariant functors from
 `simplex_category` to `Type u`. -/
 def SSet : Type (u + 1) :=
   SimplicialObject (Type u)deriving LargeCategory, Limits.HasLimits, Limits.HasColimits
 #align sSet SSet
+-/
 
 namespace SSet
 
+#print SSet.standardSimplex /-
 /-- The `n`-th standard simplex `Δ[n]` associated with a nonempty finite linear order `n`
 is the Yoneda embedding of `n`. -/
 def standardSimplex : SimplexCategory ⥤ SSet :=
   yoneda
 #align sSet.standard_simplex SSet.standardSimplex
+-/
 
 -- mathport name: standard_simplex
 scoped[Simplicial] notation "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCategory.mk n)
@@ -65,6 +69,12 @@ instance : Inhabited SSet :=
 
 section
 
+/- warning: sSet.as_order_hom -> SSet.asOrderHom is a dubious translation:
+lean 3 declaration is
+  forall {n : Nat} {m : Opposite.{1} SimplexCategory}, (CategoryTheory.Functor.obj.{0, 0, 0, 1} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.opposite.{0, 0} SimplexCategory SimplexCategory.smallCategory) Type CategoryTheory.types.{0} (CategoryTheory.Functor.obj.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex (SimplexCategory.mk n)) m) -> (OrderHom.{0, 0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Fin.partialOrder (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (SimplexCategory.mk n)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (Fin.partialOrder (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (SimplexCategory.len (SimplexCategory.mk n)) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))))
+but is expected to have type
+  forall {n : Nat} {m : Opposite.{1} SimplexCategory}, (Prefunctor.obj.{1, 1, 0, 1} (Opposite.{1} SimplexCategory) (CategoryTheory.CategoryStruct.toQuiver.{0, 0} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.toCategoryStruct.{0, 0} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.opposite.{0, 0} SimplexCategory SimplexCategory.smallCategory))) Type (CategoryTheory.CategoryStruct.toQuiver.{0, 1} Type (CategoryTheory.Category.toCategoryStruct.{0, 1} Type CategoryTheory.types.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} (Opposite.{1} SimplexCategory) (CategoryTheory.Category.opposite.{0, 0} SimplexCategory SimplexCategory.smallCategory) Type CategoryTheory.types.{0} (Prefunctor.obj.{1, 1, 0, 1} SimplexCategory (CategoryTheory.CategoryStruct.toQuiver.{0, 0} SimplexCategory (CategoryTheory.Category.toCategoryStruct.{0, 0} SimplexCategory SimplexCategory.smallCategory)) SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex) (SimplexCategory.mk n))) m) -> (OrderHom.{0, 0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Fin.instPartialOrderFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) (SimplexCategory.len (Opposite.unop.{1} SimplexCategory m)) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (PartialOrder.toPreorder.{0} (Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (Fin.instPartialOrderFin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))))
+Case conversion may be inaccurate. Consider using '#align sSet.as_order_hom SSet.asOrderHomₓ'. -/
 /-- The `m`-simplices of the `n`-th standard simplex are
 the monotone maps from `fin (m+1)` to `fin (n+1)`. -/
 def asOrderHom {n} {m} (α : Δ[n].obj m) : OrderHom (Fin (m.unop.len + 1)) (Fin (n + 1)) :=
@@ -73,6 +83,7 @@ def asOrderHom {n} {m} (α : Δ[n].obj m) : OrderHom (Fin (m.unop.len + 1)) (Fin
 
 end
 
+#print SSet.boundary /-
 /-- The boundary `∂Δ[n]` of the `n`-th standard simplex consists of
 all `m`-simplices of `standard_simplex n` that are not surjective
 (when viewed as monotone function `m → n`). -/
@@ -85,14 +96,22 @@ def boundary (n : ℕ) : SSet
       apply α.property
       exact Function.Surjective.of_comp h⟩
 #align sSet.boundary SSet.boundary
+-/
 
 -- mathport name: sSet.boundary
 scoped[Simplicial] notation "∂Δ[" n "]" => SSet.boundary n
 
+/- warning: sSet.boundary_inclusion -> SSet.boundaryInclusion is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.boundary n) (CategoryTheory.Functor.obj.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex (SimplexCategory.mk n))
+but is expected to have type
+  forall (n : Nat), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.boundary n) (Prefunctor.obj.{1, 1, 0, 1} SimplexCategory (CategoryTheory.CategoryStruct.toQuiver.{0, 0} SimplexCategory (CategoryTheory.Category.toCategoryStruct.{0, 0} SimplexCategory SimplexCategory.smallCategory)) SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex) (SimplexCategory.mk n))
+Case conversion may be inaccurate. Consider using '#align sSet.boundary_inclusion SSet.boundaryInclusionₓ'. -/
 /-- The inclusion of the boundary of the `n`-th standard simplex into that standard simplex. -/
 def boundaryInclusion (n : ℕ) : ∂Δ[n] ⟶ Δ[n] where app m (α : { α : Δ[n].obj m // _ }) := α
 #align sSet.boundary_inclusion SSet.boundaryInclusion
 
+#print SSet.horn /-
 /-- `horn n i` (or `Λ[n, i]`) is the `i`-th horn of the `n`-th standard simplex, where `i : n`.
 It consists of all `m`-simplices `α` of `Δ[n]`
 for which the union of `{i}` and the range of `α` is not all of `n`
@@ -108,10 +127,17 @@ def horn (n : ℕ) (i : Fin (n + 1)) : SSet
       intro hj
       exact Set.range_comp_subset_range _ _ hj⟩
 #align sSet.horn SSet.horn
+-/
 
 -- mathport name: sSet.horn
 scoped[Simplicial] notation "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
 
+/- warning: sSet.horn_inclusion -> SSet.hornInclusion is a dubious translation:
+lean 3 declaration is
+  forall (n : Nat) (i : Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.horn n i) (CategoryTheory.Functor.obj.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex (SimplexCategory.mk n))
+but is expected to have type
+  forall (n : Nat) (i : Fin (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))), Quiver.Hom.{1, 1} SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (SSet.horn n i) (Prefunctor.obj.{1, 1, 0, 1} SimplexCategory (CategoryTheory.CategoryStruct.toQuiver.{0, 0} SimplexCategory (CategoryTheory.Category.toCategoryStruct.{0, 0} SimplexCategory SimplexCategory.smallCategory)) SSet.{0} (CategoryTheory.CategoryStruct.toQuiver.{0, 1} SSet.{0} (CategoryTheory.Category.toCategoryStruct.{0, 1} SSet.{0} SSet.largeCategory.{0})) (CategoryTheory.Functor.toPrefunctor.{0, 0, 0, 1} SimplexCategory SimplexCategory.smallCategory SSet.{0} SSet.largeCategory.{0} SSet.standardSimplex) (SimplexCategory.mk n))
+Case conversion may be inaccurate. Consider using '#align sSet.horn_inclusion SSet.hornInclusionₓ'. -/
 /-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
 def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n]
     where app m (α : { α : Δ[n].obj m // _ }) := α
@@ -121,36 +147,45 @@ section Examples
 
 open Simplicial
 
+#print SSet.S1 /-
 /-- The simplicial circle. -/
-noncomputable def s1 : SSet :=
+noncomputable def S1 : SSet :=
   Limits.colimit <|
     Limits.parallelPair (standardSimplex.map <| SimplexCategory.δ 0 : Δ[0] ⟶ Δ[1])
       (standardSimplex.map <| SimplexCategory.δ 1)
-#align sSet.S1 SSet.s1
+#align sSet.S1 SSet.S1
+-/
 
 end Examples
 
+#print SSet.Truncated /-
 /-- Truncated simplicial sets. -/
 def Truncated (n : ℕ) :=
   SimplicialObject.Truncated (Type u) n deriving LargeCategory, Limits.HasLimits, Limits.HasColimits
 #align sSet.truncated SSet.Truncated
+-/
 
+#print SSet.sk /-
 /-- The skeleton functor on simplicial sets. -/
 def sk (n : ℕ) : SSet ⥤ SSet.Truncated n :=
   SimplicialObject.sk n
 #align sSet.sk SSet.sk
+-/
 
 instance {n} : Inhabited (SSet.Truncated n) :=
   ⟨(sk n).obj <| Δ[0]⟩
 
+#print SSet.Augmented /-
 /-- The category of augmented simplicial sets, as a particular case of
 augmented simplicial objects. -/
 abbrev Augmented :=
   SimplicialObject.Augmented (Type u)
 #align sSet.augmented SSet.Augmented
+-/
 
 namespace Augmented
 
+#print SSet.Augmented.standardSimplex /-
 /-- The functor which sends `[n]` to the simplicial set `Δ[n]` equipped by
 the obvious augmentation towards the terminal object of the category of sets. -/
 @[simps]
@@ -164,30 +199,39 @@ noncomputable def standardSimplex : SimplexCategory ⥤ SSet.Augmented
     { left := SSet.standardSimplex.map θ
       right := terminal.from _ }
 #align sSet.augmented.standard_simplex SSet.Augmented.standardSimplex
+-/
 
 end Augmented
 
 end SSet
 
+#print TopCat.toSSet /-
 /-- The functor associating the singular simplicial set to a topological space. -/
 def TopCat.toSSet : TopCat ⥤ SSet :=
   ColimitAdj.restrictedYoneda SimplexCategory.toTop
 #align Top.to_sSet TopCat.toSSet
+-/
 
+#print SSet.toTop /-
 /-- The geometric realization functor. -/
 noncomputable def SSet.toTop : SSet ⥤ TopCat :=
   ColimitAdj.extendAlongYoneda SimplexCategory.toTop
 #align sSet.to_Top SSet.toTop
+-/
 
+#print sSetTopAdj /-
 /-- Geometric realization is left adjoint to the singular simplicial set construction. -/
 noncomputable def sSetTopAdj : SSet.toTop ⊣ TopCat.toSSet :=
   ColimitAdj.yonedaAdjunction _
 #align sSet_Top_adj sSetTopAdj
+-/
 
+#print SSet.toTopSimplex /-
 /-- The geometric realization of the representable simplicial sets agree
   with the usual topological simplices. -/
 noncomputable def SSet.toTopSimplex :
     (yoneda : SimplexCategory ⥤ _) ⋙ SSet.toTop ≅ SimplexCategory.toTop :=
   ColimitAdj.isExtensionAlongYoneda _
 #align sSet.to_Top_simplex SSet.toTopSimplex
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
 
 ! This file was ported from Lean 3 source module algebraic_topology.simplicial_set
-! leanprover-community/mathlib commit d79c3671549ace83a93d2a97f316d12ab42232ae
+! leanprover-community/mathlib commit 178a32653e369dce2da68dc6b2694e385d484ef1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,7 +13,7 @@ import Mathbin.AlgebraicTopology.TopologicalSimplex
 import Mathbin.CategoryTheory.Limits.Presheaf
 import Mathbin.CategoryTheory.Limits.Types
 import Mathbin.CategoryTheory.Yoneda
-import Mathbin.Topology.Category.Top.Limits
+import Mathbin.Topology.Category.Top.Limits.Basic
 
 /-!
 A simplicial set is just a simplicial object in `Type`,

Changes in mathlib4

mathlib3
mathlib4
chore: Split Data.{Nat,Int}{.Order}.Basic in group vs ring instances (#11924)

Scatter the content of Data.Nat.Basic across:

  • Data.Nat.Defs for the lemmas having no dependencies
  • Algebra.Group.Nat for the monoid instances and the few miscellaneous lemmas needing them.
  • Algebra.Ring.Nat for the semiring instance and the few miscellaneous lemmas following it.

Similarly, scatter

  • Data.Int.Basic across Data.Int.Defs, Algebra.Group.Int, Algebra.Ring.Int
  • Data.Nat.Order.Basic across Data.Nat.Defs, Algebra.Order.Group.Nat, Algebra.Order.Ring.Nat
  • Data.Int.Order.Basic across Data.Int.Defs, Algebra.Order.Group.Int, Algebra.Order.Ring.Int

Also move a few lemmas from Data.Nat.Order.Lemmas to Data.Nat.Defs.

Before pre_11924

After post_11924

Diff
@@ -7,6 +7,7 @@ import Mathlib.AlgebraicTopology.SimplicialObject
 import Mathlib.CategoryTheory.Limits.Shapes.Types
 import Mathlib.CategoryTheory.Yoneda
 import Mathlib.Data.Fin.VecNotation
+import Mathlib.Data.Nat.Units
 import Mathlib.Tactic.FinCases
 
 #align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
doc: document some notation (#11922)

We cannot literally use @[inherit_doc] in these cases, but we can slightly modify the underlying docstring or a turn a regular comment into a doc comment.

Diff
@@ -78,7 +78,6 @@ def standardSimplex : SimplexCategory ⥤ SSet.{u} :=
 set_option linter.uppercaseLean3 false in
 #align sSet.standard_simplex SSet.standardSimplex
 
--- mathport name: standard_simplex
 @[inherit_doc SSet.standardSimplex]
 scoped[Simplicial] notation3 "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCategory.mk n)
 
@@ -173,7 +172,7 @@ def boundary (n : ℕ) : SSet.{u} where
 set_option linter.uppercaseLean3 false in
 #align sSet.boundary SSet.boundary
 
--- mathport name: sSet.boundary
+/-- The boundary `∂Δ[n]` of the `n`-th standard simplex -/
 scoped[Simplicial] notation3 "∂Δ[" n "]" => SSet.boundary n
 
 /-- The inclusion of the boundary of the `n`-th standard simplex into that standard simplex. -/
@@ -197,7 +196,7 @@ def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
 set_option linter.uppercaseLean3 false in
 #align sSet.horn SSet.horn
 
--- mathport name: sSet.horn
+/-- The `i`-th horn `Λ[n, i]` of the standard `n`-simplex -/
 scoped[Simplicial] notation3 "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
 
 /-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
chore: remove more autoImplicit (#11336)

... or reduce its scope (the full removal is not as obvious).

Diff
@@ -33,9 +33,6 @@ from a non-surjective order preserving function `Fin n → Fin n`
 a morphism `Δ[n] ⟶ ∂Δ[n]`.
 -/
 
-set_option autoImplicit true
-
-
 universe v u
 
 open CategoryTheory CategoryTheory.Limits
@@ -352,18 +349,19 @@ instance Truncated.largeCategory (n : ℕ) : LargeCategory (Truncated n) := by
   dsimp only [Truncated]
   infer_instance
 
-instance Truncated.hasLimits : HasLimits (Truncated n) := by
+instance Truncated.hasLimits {n : ℕ} : HasLimits (Truncated n) := by
   dsimp only [Truncated]
   infer_instance
 
-instance Truncated.hasColimits : HasColimits (Truncated n) := by
+instance Truncated.hasColimits {n : ℕ} : HasColimits (Truncated n) := by
   dsimp only [Truncated]
   infer_instance
 
 -- Porting note (#10756): added an `ext` lemma.
 -- See https://github.com/leanprover-community/mathlib4/issues/5229
 @[ext]
-lemma Truncated.hom_ext {X Y : Truncated n} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) : f = g :=
+lemma Truncated.hom_ext {n : ℕ} {X Y : Truncated n} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) :
+    f = g :=
   NatTrans.ext _ _ (funext w)
 
 /-- The skeleton functor on simplicial sets. -/
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -384,7 +384,7 @@ set_option linter.uppercaseLean3 false in
 
 namespace Augmented
 
--- porting note: an instance of `Subsingleton (⊤_ (Type u))` was added in
+-- Porting note: an instance of `Subsingleton (⊤_ (Type u))` was added in
 -- `CategoryTheory.Limits.Types` to ease the automation in this definition
 /-- The functor which sends `[n]` to the simplicial set `Δ[n]` equipped by
 the obvious augmentation towards the terminal object of the category of sets. -/
chore: classify added lemma porting notes (#10958)

Classifies by adding issue number #10756 to porting notes claiming added lemma.

Diff
@@ -64,7 +64,7 @@ instance hasColimits : HasColimits SSet := by
   dsimp only [SSet]
   infer_instance
 
--- Porting note: added an `ext` lemma.
+-- Porting note (#10756): added an `ext` lemma.
 -- See https://github.com/leanprover-community/mathlib4/issues/5229
 @[ext]
 lemma hom_ext {X Y : SSet} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) : f = g :=
@@ -360,7 +360,7 @@ instance Truncated.hasColimits : HasColimits (Truncated n) := by
   dsimp only [Truncated]
   infer_instance
 
--- Porting note: added an `ext` lemma.
+-- Porting note (#10756): added an `ext` lemma.
 -- See https://github.com/leanprover-community/mathlib4/issues/5229
 @[ext]
 lemma Truncated.hom_ext {X Y : Truncated n} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) : f = g :=
doc: @[inherit_doc] on notations (#9942)

Make all the notations that unambiguously should inherit the docstring of their definition actually inherit it.

Also write a few docstrings by hand. I only wrote the ones I was competent to write and which I was sure of. Some docstrings come from mathlib3 as they were lost during the early port.

This PR is only intended as a first pass There are many more docstrings to add.

Diff
@@ -82,6 +82,7 @@ set_option linter.uppercaseLean3 false in
 #align sSet.standard_simplex SSet.standardSimplex
 
 -- mathport name: standard_simplex
+@[inherit_doc SSet.standardSimplex]
 scoped[Simplicial] notation3 "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCategory.mk n)
 
 instance : Inhabited SSet :=
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
 -/
 import Mathlib.AlgebraicTopology.SimplicialObject
-import Mathlib.CategoryTheory.Limits.Presheaf
 import Mathlib.CategoryTheory.Limits.Shapes.Types
 import Mathlib.CategoryTheory.Yoneda
 import Mathlib.Data.Fin.VecNotation
feat(AlgebraicTopology): generalize universes for the standard simplex (#9631)

The PR generalizes universes for standardSimplex, which is now a functor SimplexCategory ⥤ SSet.{u} for any universe u.

Diff
@@ -71,10 +71,14 @@ instance hasColimits : HasColimits SSet := by
 lemma hom_ext {X Y : SSet} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) : f = g :=
   SimplicialObject.hom_ext _ _ w
 
+/-- The ulift functor `SSet.{u} ⥤ SSet.{max u v}` on simplicial sets. -/
+def uliftFunctor : SSet.{u} ⥤ SSet.{max u v} :=
+  (SimplicialObject.whiskering _ _).obj CategoryTheory.uliftFunctor.{v, u}
+
 /-- The `n`-th standard simplex `Δ[n]` associated with a nonempty finite linear order `n`
 is the Yoneda embedding of `n`. -/
-def standardSimplex : SimplexCategory ⥤ SSet :=
-  yoneda
+def standardSimplex : SimplexCategory ⥤ SSet.{u} :=
+  yoneda ⋙ uliftFunctor
 set_option linter.uppercaseLean3 false in
 #align sSet.standard_simplex SSet.standardSimplex
 
@@ -88,36 +92,62 @@ namespace standardSimplex
 
 open Finset Opposite SimplexCategory
 
+@[simp]
+lemma map_id (n : SimplexCategory) :
+    (SSet.standardSimplex.map (SimplexCategory.Hom.mk OrderHom.id : n ⟶ n)) = 𝟙 _ :=
+  CategoryTheory.Functor.map_id _ _
+
+/-- Simplices of the standard simplex identify to morphisms in `SimplexCategory`. -/
+def objEquiv (n : SimplexCategory) (m : SimplexCategoryᵒᵖ) :
+    (standardSimplex.{u}.obj n).obj m ≃ (m.unop ⟶ n) :=
+  Equiv.ulift.{u, 0}
+
+/-- Constructor for simplices of the standard simplex which takes a `OrderHom` as an input. -/
+abbrev objMk {n : SimplexCategory} {m : SimplexCategoryᵒᵖ}
+    (f : Fin (len m.unop + 1) →o Fin (n.len + 1)) :
+    (standardSimplex.{u}.obj n).obj m :=
+  (objEquiv _ _).symm (Hom.mk f)
+
+lemma map_apply {m₁ m₂ : SimplexCategoryᵒᵖ} (f : m₁ ⟶ m₂) {n : SimplexCategory}
+    (x : (standardSimplex.{u}.obj n).obj m₁) :
+    (standardSimplex.{u}.obj n).map f x = (objEquiv _ _).symm (f.unop ≫ (objEquiv _ _) x) := by
+  rfl
+
+/-- The canonical bijection `(standardSimplex.obj n ⟶ X) ≃ X.obj (op n)`. -/
+def _root_.SSet.yonedaEquiv (X : SSet.{u}) (n : SimplexCategory) :
+    (standardSimplex.obj n ⟶ X) ≃ X.obj (op n) :=
+  yonedaCompUliftFunctorEquiv X n
+
 /-- The (degenerate) `m`-simplex in the standard simplex concentrated in vertex `k`. -/
 def const (n : ℕ) (k : Fin (n+1)) (m : SimplexCategoryᵒᵖ) : Δ[n].obj m :=
-  Hom.mk <| OrderHom.const _ k
+  objMk (OrderHom.const _ k )
 
 @[simp]
-lemma const_toOrderHom (n : ℕ) (k : Fin (n+1)) (m : SimplexCategoryᵒᵖ) :
-    (const n k m).toOrderHom = OrderHom.const _ k :=
+lemma const_down_toOrderHom (n : ℕ) (k : Fin (n+1)) (m : SimplexCategoryᵒᵖ) :
+    (const n k m).down.toOrderHom = OrderHom.const _ k :=
   rfl
 
 /-- The edge of the standard simplex with endpoints `a` and `b`. -/
 def edge (n : ℕ) (a b : Fin (n+1)) (hab : a ≤ b) : Δ[n] _[1] := by
-  refine Hom.mk ⟨![a, b], ?_⟩
+  refine objMk ⟨![a, b], ?_⟩
   rw [Fin.monotone_iff_le_succ]
   simp only [unop_op, len_mk, Fin.forall_fin_one]
   apply Fin.mk_le_mk.mpr hab
 
-lemma coe_edge_toOrderHom (n : ℕ) (a b : Fin (n+1)) (hab : a ≤ b) :
-    ↑(edge n a b hab).toOrderHom = ![a, b] :=
+lemma coe_edge_down_toOrderHom (n : ℕ) (a b : Fin (n+1)) (hab : a ≤ b) :
+    ↑(edge n a b hab).down.toOrderHom = ![a, b] :=
   rfl
 
 /-- The triangle in the standard simplex with vertices `a`, `b`, and `c`. -/
 def triangle {n : ℕ} (a b c : Fin (n+1)) (hab : a ≤ b) (hbc : b ≤ c) : Δ[n] _[2] := by
-  refine Hom.mk ⟨![a, b, c], ?_⟩
+  refine objMk ⟨![a, b, c], ?_⟩
   rw [Fin.monotone_iff_le_succ]
   simp only [unop_op, len_mk, Fin.forall_fin_two]
   dsimp
   simp only [*, Matrix.tail_cons, Matrix.head_cons, true_and]
 
-lemma coe_triangle_toOrderHom {n : ℕ} (a b c : Fin (n+1)) (hab : a ≤ b) (hbc : b ≤ c) :
-    ↑(triangle a b c hab hbc).toOrderHom = ![a, b, c] :=
+lemma coe_triangle_down_toOrderHom {n : ℕ} (a b c : Fin (n+1)) (hab : a ≤ b) (hbc : b ≤ c) :
+    ↑(triangle a b c hab hbc).down.toOrderHom = ![a, b, c] :=
   rfl
 
 end standardSimplex
@@ -127,7 +157,7 @@ section
 /-- The `m`-simplices of the `n`-th standard simplex are
 the monotone maps from `Fin (m+1)` to `Fin (n+1)`. -/
 def asOrderHom {n} {m} (α : Δ[n].obj m) : OrderHom (Fin (m.unop.len + 1)) (Fin (n + 1)) :=
-  α.toOrderHom
+  α.down.toOrderHom
 set_option linter.uppercaseLean3 false in
 #align sSet.as_order_hom SSet.asOrderHom
 
@@ -136,10 +166,10 @@ end
 /-- The boundary `∂Δ[n]` of the `n`-th standard simplex consists of
 all `m`-simplices of `standardSimplex n` that are not surjective
 (when viewed as monotone function `m → n`). -/
-def boundary (n : ℕ) : SSet where
+def boundary (n : ℕ) : SSet.{u} where
   obj m := { α : Δ[n].obj m // ¬Function.Surjective (asOrderHom α) }
   map {m₁ m₂} f α :=
-    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
+    ⟨Δ[n].map f α.1, by
       intro h
       apply α.property
       exact Function.Surjective.of_comp h⟩
@@ -161,7 +191,7 @@ for which the union of `{i}` and the range of `α` is not all of `n`
 def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
   obj m := { α : Δ[n].obj m // Set.range (asOrderHom α) ∪ {i} ≠ Set.univ }
   map {m₁ m₂} f α :=
-    ⟨f.unop ≫ (α : Δ[n].obj m₁), by
+    ⟨Δ[n].map f α.1, by
       intro h; apply α.property
       rw [Set.eq_univ_iff_forall] at h ⊢; intro j
       apply Or.imp _ id (h j)
@@ -253,7 +283,8 @@ def primitiveTriangle {n : ℕ} (i : Fin (n+4))
     OrderHom.const_coe_coe, Set.union_singleton, ne_eq, ← Set.univ_subset_iff, Set.subset_def,
     Set.mem_univ, Set.mem_insert_iff, Set.mem_range, Function.const_apply, exists_const,
     forall_true_left, not_forall, not_or, unop_op, not_exists,
-    standardSimplex.triangle, OrderHom.coe_mk, @eq_comm _ _ i]
+    standardSimplex.triangle, OrderHom.coe_mk, @eq_comm _ _ i,
+    standardSimplex.objMk, standardSimplex.objEquiv, Equiv.ulift]
   dsimp
   by_cases hk0 : k = 0
   · subst hk0
@@ -268,9 +299,10 @@ def primitiveTriangle {n : ℕ} (i : Fin (n+4))
 
 /-- The `j`th subface of the `i`-th horn. -/
 @[simps]
-def face {n : ℕ} (i j : Fin (n+2)) (h : j ≠ i) : Λ[n+1, i] _[n] := by
-  refine ⟨SimplexCategory.δ j, ?_⟩
-  simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, SimplexCategory.δ, not_or]
+def face {n : ℕ} (i j : Fin (n+2)) (h : j ≠ i) : Λ[n+1, i] _[n] :=
+  ⟨(standardSimplex.objEquiv _ _).symm (SimplexCategory.δ j), by
+    simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, SimplexCategory.δ, not_or,
+      standardSimplex.objEquiv, asOrderHom, Equiv.ulift]⟩
 
 /-- Two morphisms from a horn are equal if they are equal on all suitable faces. -/
 protected
@@ -279,13 +311,18 @@ lemma hom_ext {n : ℕ} {i : Fin (n+2)} {S : SSet} (σ₁ σ₂ : Λ[n+1, i] ⟶
     σ₁ = σ₂ := by
   apply NatTrans.ext; apply funext; apply Opposite.rec; apply SimplexCategory.rec
   intro m; ext f
-  obtain ⟨j, hji, hfj⟩ : ∃ j, ¬j = i ∧ ∀ k, f.1.toOrderHom k ≠ j := by
-    simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, not_or] using f.2
-  have H : f = (Λ[n+1, i].map (factor_δ f.1 j).op) (face i j hji) := by
+  obtain ⟨f', hf⟩ := (standardSimplex.objEquiv _ _).symm.surjective f.1
+  obtain ⟨j, hji, hfj⟩ : ∃ j, ¬j = i ∧ ∀ k, f'.toOrderHom k ≠ j := by
+    obtain ⟨f, hf'⟩ := f
+    subst hf
+    simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, not_or] using hf'
+  have H : f = (Λ[n+1, i].map (factor_δ f' j).op) (face i j hji) := by
     apply Subtype.ext
-    exact (factor_δ_spec f.1 j hfj).symm
-  have H₁ := congrFun (σ₁.naturality (factor_δ f.1 j).op) (face i j hji)
-  have H₂ := congrFun (σ₂.naturality (factor_δ f.1 j).op) (face i j hji)
+    apply (standardSimplex.objEquiv _ _).injective
+    rw [← hf]
+    exact (factor_δ_spec f' j hfj).symm
+  have H₁ := congrFun (σ₁.naturality (factor_δ f' j).op) (face i j hji)
+  have H₂ := congrFun (σ₂.naturality (factor_δ f' j).op) (face i j hji)
   dsimp at H₁ H₂
   erw [H, H₁, H₂, h _ hji]
 
@@ -347,16 +384,12 @@ set_option linter.uppercaseLean3 false in
 
 namespace Augmented
 
--- porting note: added to ease the automation of the proofs in the definition
--- of `standardSimplex`
-attribute [local simp] SSet.standardSimplex
-
 -- porting note: an instance of `Subsingleton (⊤_ (Type u))` was added in
 -- `CategoryTheory.Limits.Types` to ease the automation in this definition
 /-- The functor which sends `[n]` to the simplicial set `Δ[n]` equipped by
 the obvious augmentation towards the terminal object of the category of sets. -/
 @[simps]
-noncomputable def standardSimplex : SimplexCategory ⥤ SSet.Augmented where
+noncomputable def standardSimplex : SimplexCategory ⥤ SSet.Augmented.{u} where
   obj Δ :=
     { left := SSet.standardSimplex.obj Δ
       right := terminal _
feat(AlgebraicTopology/Quasicategory): alternative statement of hornfilling condition (#9360)
Diff
@@ -147,7 +147,7 @@ set_option linter.uppercaseLean3 false in
 #align sSet.boundary SSet.boundary
 
 -- mathport name: sSet.boundary
-scoped[Simplicial] notation "∂Δ[" n "]" => SSet.boundary n
+scoped[Simplicial] notation3 "∂Δ[" n "]" => SSet.boundary n
 
 /-- The inclusion of the boundary of the `n`-th standard simplex into that standard simplex. -/
 def boundaryInclusion (n : ℕ) : ∂Δ[n] ⟶ Δ[n] where app m (α : { α : Δ[n].obj m // _ }) := α
@@ -266,6 +266,29 @@ def primitiveTriangle {n : ℕ} (i : Fin (n+4))
     intro j
     fin_cases j <;> simp [Fin.ext_iff, hk0]
 
+/-- The `j`th subface of the `i`-th horn. -/
+@[simps]
+def face {n : ℕ} (i j : Fin (n+2)) (h : j ≠ i) : Λ[n+1, i] _[n] := by
+  refine ⟨SimplexCategory.δ j, ?_⟩
+  simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, SimplexCategory.δ, not_or]
+
+/-- Two morphisms from a horn are equal if they are equal on all suitable faces. -/
+protected
+lemma hom_ext {n : ℕ} {i : Fin (n+2)} {S : SSet} (σ₁ σ₂ : Λ[n+1, i] ⟶ S)
+    (h : ∀ (j) (h : j ≠ i), σ₁.app _ (face i j h) = σ₂.app _ (face i j h)) :
+    σ₁ = σ₂ := by
+  apply NatTrans.ext; apply funext; apply Opposite.rec; apply SimplexCategory.rec
+  intro m; ext f
+  obtain ⟨j, hji, hfj⟩ : ∃ j, ¬j = i ∧ ∀ k, f.1.toOrderHom k ≠ j := by
+    simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, not_or] using f.2
+  have H : f = (Λ[n+1, i].map (factor_δ f.1 j).op) (face i j hji) := by
+    apply Subtype.ext
+    exact (factor_δ_spec f.1 j hfj).symm
+  have H₁ := congrFun (σ₁.naturality (factor_δ f.1 j).op) (face i j hji)
+  have H₂ := congrFun (σ₂.naturality (factor_δ f.1 j).op) (face i j hji)
+  dsimp at H₁ H₂
+  erw [H, H₁, H₂, h _ hji]
+
 end horn
 
 section Examples
feat(AlgebraicTopology/SimplicialSet): constructors for subfaces (#9363)

constructors for subfaces of the standard simplex and horn simplices

Diff
@@ -7,6 +7,8 @@ import Mathlib.AlgebraicTopology.SimplicialObject
 import Mathlib.CategoryTheory.Limits.Presheaf
 import Mathlib.CategoryTheory.Limits.Shapes.Types
 import Mathlib.CategoryTheory.Yoneda
+import Mathlib.Data.Fin.VecNotation
+import Mathlib.Tactic.FinCases
 
 #align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
 
@@ -82,6 +84,44 @@ scoped[Simplicial] notation3 "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCat
 instance : Inhabited SSet :=
   ⟨Δ[0]⟩
 
+namespace standardSimplex
+
+open Finset Opposite SimplexCategory
+
+/-- The (degenerate) `m`-simplex in the standard simplex concentrated in vertex `k`. -/
+def const (n : ℕ) (k : Fin (n+1)) (m : SimplexCategoryᵒᵖ) : Δ[n].obj m :=
+  Hom.mk <| OrderHom.const _ k
+
+@[simp]
+lemma const_toOrderHom (n : ℕ) (k : Fin (n+1)) (m : SimplexCategoryᵒᵖ) :
+    (const n k m).toOrderHom = OrderHom.const _ k :=
+  rfl
+
+/-- The edge of the standard simplex with endpoints `a` and `b`. -/
+def edge (n : ℕ) (a b : Fin (n+1)) (hab : a ≤ b) : Δ[n] _[1] := by
+  refine Hom.mk ⟨![a, b], ?_⟩
+  rw [Fin.monotone_iff_le_succ]
+  simp only [unop_op, len_mk, Fin.forall_fin_one]
+  apply Fin.mk_le_mk.mpr hab
+
+lemma coe_edge_toOrderHom (n : ℕ) (a b : Fin (n+1)) (hab : a ≤ b) :
+    ↑(edge n a b hab).toOrderHom = ![a, b] :=
+  rfl
+
+/-- The triangle in the standard simplex with vertices `a`, `b`, and `c`. -/
+def triangle {n : ℕ} (a b c : Fin (n+1)) (hab : a ≤ b) (hbc : b ≤ c) : Δ[n] _[2] := by
+  refine Hom.mk ⟨![a, b, c], ?_⟩
+  rw [Fin.monotone_iff_le_succ]
+  simp only [unop_op, len_mk, Fin.forall_fin_two]
+  dsimp
+  simp only [*, Matrix.tail_cons, Matrix.head_cons, true_and]
+
+lemma coe_triangle_toOrderHom {n : ℕ} (a b c : Fin (n+1)) (hab : a ≤ b) (hbc : b ≤ c) :
+    ↑(triangle a b c hab hbc).toOrderHom = ![a, b, c] :=
+  rfl
+
+end standardSimplex
+
 section
 
 /-- The `m`-simplices of the `n`-th standard simplex are
@@ -139,6 +179,95 @@ def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n] where
 set_option linter.uppercaseLean3 false in
 #align sSet.horn_inclusion SSet.hornInclusion
 
+namespace horn
+
+open SimplexCategory Finset Opposite
+
+/-- The (degenerate) subsimplex of `Λ[n+2, i]` concentrated in vertex `k`. -/
+@[simps]
+def const (n : ℕ) (i k : Fin (n+3)) (m : SimplexCategoryᵒᵖ) : Λ[n+2, i].obj m := by
+  refine ⟨standardSimplex.const _ k _, ?_⟩
+  suffices ¬ Finset.univ ⊆ {i, k} by
+    simpa [← Set.univ_subset_iff, Set.subset_def, asOrderHom, not_or, Fin.forall_fin_one,
+      subset_iff, mem_univ, @eq_comm _ _ k]
+  intro h
+  have := (card_le_card h).trans card_le_two
+  rw [card_fin] at this
+  omega
+
+/-- The edge of `Λ[n, i]` with endpoints `a` and `b`.
+
+This edge only exists if `{i, a, b}` has cardinality less than `n`. -/
+@[simps]
+def edge (n : ℕ) (i a b : Fin (n+1)) (hab : a ≤ b) (H : Finset.card {i, a, b} ≤ n) :
+    Λ[n, i] _[1] := by
+  refine ⟨standardSimplex.edge n a b hab, ?range⟩
+  case range =>
+    suffices ∃ x, ¬i = x ∧ ¬a = x ∧ ¬b = x by
+      simpa only [unop_op, SimplexCategory.len_mk, asOrderHom, SimplexCategory.Hom.toOrderHom_mk,
+        Set.union_singleton, ne_eq, ← Set.univ_subset_iff, Set.subset_def, Set.mem_univ,
+        Set.mem_insert_iff, @eq_comm _ _ i, Set.mem_range, forall_true_left, not_forall, not_or,
+        not_exists, Fin.forall_fin_two]
+    contrapose! H
+    replace H : univ ⊆ {i, a, b} :=
+      fun x _ ↦ by simpa [or_iff_not_imp_left, eq_comm] using H x
+    replace H := card_le_card H
+    rwa [card_fin] at H
+
+/-- Alternative constructor for the edge of `Λ[n, i]` with endpoints `a` and `b`,
+assuming `3 ≤ n`. -/
+@[simps!]
+def edge₃ (n : ℕ) (i a b : Fin (n+1)) (hab : a ≤ b) (H : 3 ≤ n) :
+    Λ[n, i] _[1] :=
+  horn.edge n i a b hab <| Finset.card_le_three.trans H
+
+/-- The edge of `Λ[n, i]` with endpoints `j` and `j+1`.
+
+This constructor assumes `0 < i < n`,
+which is the type of horn that occurs in the horn-filling condition of quasicategories. -/
+@[simps!]
+def primitiveEdge {n : ℕ} {i : Fin (n+1)}
+    (h₀ : 0 < i) (hₙ : i < Fin.last n) (j : Fin n) :
+    Λ[n, i] _[1] := by
+  refine horn.edge n i j.castSucc j.succ ?_ ?_
+  · simp only [← Fin.val_fin_le, Fin.coe_castSucc, Fin.val_succ, le_add_iff_nonneg_right, zero_le]
+  simp only [← Fin.val_fin_lt, Fin.val_zero, Fin.val_last] at h₀ hₙ
+  obtain rfl|hn : n = 2 ∨ 2 < n := by
+    rw [eq_comm, or_comm, ← le_iff_lt_or_eq]; omega
+  · revert i j; decide
+  · exact Finset.card_le_three.trans hn
+
+/-- The triangle in the standard simplex with vertices `k`, `k+1`, and `k+2`.
+
+This constructor assumes `0 < i < n`,
+which is the type of horn that occurs in the horn-filling condition of quasicategories. -/
+@[simps]
+def primitiveTriangle {n : ℕ} (i : Fin (n+4))
+    (h₀ : 0 < i) (hₙ : i < Fin.last (n+3))
+    (k : ℕ) (h : k < n+2) : Λ[n+3, i] _[2] := by
+  refine ⟨standardSimplex.triangle
+    (n := n+3) ⟨k, by omega⟩ ⟨k+1, by omega⟩ ⟨k+2, by omega⟩ ?_ ?_, ?_⟩
+  · simp only [Fin.mk_le_mk, le_add_iff_nonneg_right, zero_le]
+  · simp only [Fin.mk_le_mk, add_le_add_iff_left, one_le_two]
+  simp only [unop_op, SimplexCategory.len_mk, asOrderHom, SimplexCategory.Hom.toOrderHom_mk,
+    OrderHom.const_coe_coe, Set.union_singleton, ne_eq, ← Set.univ_subset_iff, Set.subset_def,
+    Set.mem_univ, Set.mem_insert_iff, Set.mem_range, Function.const_apply, exists_const,
+    forall_true_left, not_forall, not_or, unop_op, not_exists,
+    standardSimplex.triangle, OrderHom.coe_mk, @eq_comm _ _ i]
+  dsimp
+  by_cases hk0 : k = 0
+  · subst hk0
+    use Fin.last (n+3)
+    simp only [hₙ.ne, not_false_eq_true, Fin.zero_eta, zero_add, true_and]
+    intro j
+    fin_cases j <;> simp [Fin.ext_iff] <;> omega
+  · use 0
+    simp only [h₀.ne', not_false_eq_true, true_and]
+    intro j
+    fin_cases j <;> simp [Fin.ext_iff, hk0]
+
+end horn
+
 section Examples
 
 open Simplicial
chore(AlgebraicTopology/SingularSet): factor topology out of SimplicialSet into new file (#9428)
Diff
@@ -4,15 +4,15 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
 -/
 import Mathlib.AlgebraicTopology.SimplicialObject
-import Mathlib.AlgebraicTopology.TopologicalSimplex
 import Mathlib.CategoryTheory.Limits.Presheaf
 import Mathlib.CategoryTheory.Limits.Shapes.Types
 import Mathlib.CategoryTheory.Yoneda
-import Mathlib.Topology.Category.TopCat.Limits.Basic
 
 #align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
 
 /-!
+# Simplicial sets
+
 A simplicial set is just a simplicial object in `Type`,
 i.e. a `Type`-valued presheaf on the simplex category.
 
@@ -218,29 +218,3 @@ set_option linter.uppercaseLean3 false in
 end Augmented
 
 end SSet
-
-/-- The functor associating the singular simplicial set to a topological space. -/
-noncomputable def TopCat.toSSet : TopCat ⥤ SSet :=
-  ColimitAdj.restrictedYoneda SimplexCategory.toTop
-set_option linter.uppercaseLean3 false in
-#align Top.to_sSet TopCat.toSSet
-
-/-- The geometric realization functor. -/
-noncomputable def SSet.toTop : SSet ⥤ TopCat :=
-  ColimitAdj.extendAlongYoneda SimplexCategory.toTop
-set_option linter.uppercaseLean3 false in
-#align sSet.to_Top SSet.toTop
-
-/-- Geometric realization is left adjoint to the singular simplicial set construction. -/
-noncomputable def sSetTopAdj : SSet.toTop ⊣ TopCat.toSSet :=
-  ColimitAdj.yonedaAdjunction _
-set_option linter.uppercaseLean3 false in
-#align sSet_Top_adj sSetTopAdj
-
-/-- The geometric realization of the representable simplicial sets agree
-  with the usual topological simplices. -/
-noncomputable def SSet.toTopSimplex :
-    (yoneda : SimplexCategory ⥤ _) ⋙ SSet.toTop ≅ SimplexCategory.toTop :=
-  ColimitAdj.isExtensionAlongYoneda _
-set_option linter.uppercaseLean3 false in
-#align sSet.to_Top_simplex SSet.toTopSimplex
chore(AlgebraicTopology/SimplicialSet): add delaborator (#9358)

add delaborator for standard simplex and horn notation

Diff
@@ -77,7 +77,7 @@ set_option linter.uppercaseLean3 false in
 #align sSet.standard_simplex SSet.standardSimplex
 
 -- mathport name: standard_simplex
-scoped[Simplicial] notation "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCategory.mk n)
+scoped[Simplicial] notation3 "Δ[" n "]" => SSet.standardSimplex.obj (SimplexCategory.mk n)
 
 instance : Inhabited SSet :=
   ⟨Δ[0]⟩
@@ -131,7 +131,7 @@ set_option linter.uppercaseLean3 false in
 #align sSet.horn SSet.horn
 
 -- mathport name: sSet.horn
-scoped[Simplicial] notation "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
+scoped[Simplicial] notation3 "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
 
 /-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
 def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n] where
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -32,6 +32,8 @@ from a non-surjective order preserving function `Fin n → Fin n`
 a morphism `Δ[n] ⟶ ∂Δ[n]`.
 -/
 
+set_option autoImplicit true
+
 
 universe v u
 
feat: more about terminal objects in the category of types (#6401)
Diff
@@ -6,7 +6,7 @@ Authors: Johan Commelin, Scott Morrison, Adam Topaz
 import Mathlib.AlgebraicTopology.SimplicialObject
 import Mathlib.AlgebraicTopology.TopologicalSimplex
 import Mathlib.CategoryTheory.Limits.Presheaf
-import Mathlib.CategoryTheory.Limits.Types
+import Mathlib.CategoryTheory.Limits.Shapes.Types
 import Mathlib.CategoryTheory.Yoneda
 import Mathlib.Topology.Category.TopCat.Limits.Basic
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin, Scott Morrison, Adam Topaz
-
-! This file was ported from Lean 3 source module algebraic_topology.simplicial_set
-! leanprover-community/mathlib commit 178a32653e369dce2da68dc6b2694e385d484ef1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.AlgebraicTopology.SimplicialObject
 import Mathlib.AlgebraicTopology.TopologicalSimplex
@@ -15,6 +10,8 @@ import Mathlib.CategoryTheory.Limits.Types
 import Mathlib.CategoryTheory.Yoneda
 import Mathlib.Topology.Category.TopCat.Limits.Basic
 
+#align_import algebraic_topology.simplicial_set from "leanprover-community/mathlib"@"178a32653e369dce2da68dc6b2694e385d484ef1"
+
 /-!
 A simplicial set is just a simplicial object in `Type`,
 i.e. a `Type`-valued presheaf on the simplex category.
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊢ -> some_tactic at h ⊢
  • some_tactic at h -> some_tactic at h
Diff
@@ -124,7 +124,7 @@ def horn (n : ℕ) (i : Fin (n + 1)) : SSet where
   map {m₁ m₂} f α :=
     ⟨f.unop ≫ (α : Δ[n].obj m₁), by
       intro h; apply α.property
-      rw [Set.eq_univ_iff_forall] at h⊢; intro j
+      rw [Set.eq_univ_iff_forall] at h ⊢; intro j
       apply Or.imp _ id (h j)
       intro hj
       exact Set.range_comp_subset_range _ _ hj⟩
chore: add @[ext] lemmas for NatTrans synonyms (#5228)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -64,6 +64,12 @@ instance hasColimits : HasColimits SSet := by
   dsimp only [SSet]
   infer_instance
 
+-- Porting note: added an `ext` lemma.
+-- See https://github.com/leanprover-community/mathlib4/issues/5229
+@[ext]
+lemma hom_ext {X Y : SSet} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) : f = g :=
+  SimplicialObject.hom_ext _ _ w
+
 /-- The `n`-th standard simplex `Δ[n]` associated with a nonempty finite linear order `n`
 is the Yoneda embedding of `n`. -/
 def standardSimplex : SimplexCategory ⥤ SSet :=
@@ -129,8 +135,8 @@ set_option linter.uppercaseLean3 false in
 scoped[Simplicial] notation "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i
 
 /-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
-def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n]
-    where app m (α : { α : Δ[n].obj m // _ }) := α
+def hornInclusion (n : ℕ) (i : Fin (n + 1)) : Λ[n, i] ⟶ Δ[n] where
+  app m (α : { α : Δ[n].obj m // _ }) := α
 set_option linter.uppercaseLean3 false in
 #align sSet.horn_inclusion SSet.hornInclusion
 
@@ -166,6 +172,12 @@ instance Truncated.hasColimits : HasColimits (Truncated n) := by
   dsimp only [Truncated]
   infer_instance
 
+-- Porting note: added an `ext` lemma.
+-- See https://github.com/leanprover-community/mathlib4/issues/5229
+@[ext]
+lemma Truncated.hom_ext {X Y : Truncated n} {f g : X ⟶ Y} (w : ∀ n, f.app n = g.app n) : f = g :=
+  NatTrans.ext _ _ (funext w)
+
 /-- The skeleton functor on simplicial sets. -/
 def sk (n : ℕ) : SSet ⥤ SSet.Truncated n :=
   SimplicialObject.sk n
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -154,7 +154,7 @@ def Truncated (n : ℕ) :=
 set_option linter.uppercaseLean3 false in
 #align sSet.truncated SSet.Truncated
 
-instance Truncated.largeCategory (n : ℕ) : LargeCategory (Truncated n):= by
+instance Truncated.largeCategory (n : ℕ) : LargeCategory (Truncated n) := by
   dsimp only [Truncated]
   infer_instance
 
chore: rename Top->TopCat (#4089)
Diff
@@ -13,7 +13,7 @@ import Mathlib.AlgebraicTopology.TopologicalSimplex
 import Mathlib.CategoryTheory.Limits.Presheaf
 import Mathlib.CategoryTheory.Limits.Types
 import Mathlib.CategoryTheory.Yoneda
-import Mathlib.Topology.Category.Top.Limits.Basic
+import Mathlib.Topology.Category.TopCat.Limits.Basic
 
 /-!
 A simplicial set is just a simplicial object in `Type`,
feat: port AlgebraicTopology.SimplicialSet (#3689)

Dependencies 10 + 627

628 files ported (98.4%)
258072 lines ported (98.0%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file