category_theory.preadditive.schur ⟷ Mathlib.CategoryTheory.Preadditive.Schur

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -105,7 +105,7 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
     subsingleton_of_forall_eq (0 : X ⟢ Y) fun f =>
       by
       have p := not_congr (is_iso_iff_nonzero f)
-      simp only [Classical.not_not, Ne.def] at p 
+      simp only [Classical.not_not, Ne.def] at p
       refine' p.mp fun _ => h (as_iso f)
   finrank_zero_of_subsingleton
 #align category_theory.finrank_hom_simple_simple_eq_zero_of_not_iso CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso
@@ -143,7 +143,7 @@ theorem finrank_endomorphism_eq_one {X : C} (is_iso_iff_nonzero : βˆ€ f : X ⟢
         (by convert I; ext; rfl; ext; rfl) (End.of f)
     use c
     rw [spectrum.mem_iff, IsUnit.sub_iff, is_unit_iff_is_iso, is_iso_iff_nonzero, Ne.def,
-      Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu 
+      Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu
     exact nu.symm
 #align category_theory.finrank_endomorphism_eq_one CategoryTheory.finrank_endomorphism_eq_one
 -/
@@ -215,9 +215,9 @@ theorem finrank_hom_simple_simple_eq_one_iff (X Y : C) [FiniteDimensional π•œ (
   by
   fconstructor
   Β· intro h
-    rw [finrank_eq_one_iff'] at h 
+    rw [finrank_eq_one_iff'] at h
     obtain ⟨f, nz, -⟩ := h
-    rw [← is_iso_iff_nonzero] at nz 
+    rw [← is_iso_iff_nonzero] at nz
     exact ⟨as_iso f⟩
   · rintro ⟨f⟩
     have le_one := finrank_hom_simple_simple_le_one π•œ X Y
Diff
@@ -70,7 +70,24 @@ theorem isIso_iff_nonzero [HasKernels C] {X Y : C} [Simple X] [Simple Y] (f : X
 /-- In any preadditive category with kernels,
 the endomorphisms of a simple object form a division ring.
 -/
-noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) := by classical
+noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) := by
+  classical exact
+    {
+      (inferInstance :
+        Ring
+          (End
+            X)) with
+      inv := fun f =>
+        if h : f = 0 then 0
+        else
+          haveI := is_iso_of_hom_simple h
+          inv f
+      exists_pair_ne := βŸ¨πŸ™ X, 0, id_nonzero _⟩
+      inv_zero := dif_pos rfl
+      mul_inv_cancel := fun f h => by
+        haveI := is_iso_of_hom_simple h
+        convert is_iso.inv_hom_id f
+        exact dif_neg h }
 
 open FiniteDimensional
 
@@ -155,7 +172,14 @@ theorem endomorphism_simple_eq_smul_id {X : C} [Simple X] [I : FiniteDimensional
 This can't be an instance as `π•œ` would be undetermined.
 -/
 noncomputable def fieldEndOfFiniteDimensional (X : C) [Simple X] [I : FiniteDimensional π•œ (X ⟢ X)] :
-    Field (End X) := by classical
+    Field (End X) := by
+  classical exact
+    { (inferInstance : DivisionRing (End X)) with
+      mul_comm := fun f g =>
+        by
+        obtain ⟨c, rfl⟩ := endomorphism_simple_eq_smul_id π•œ f
+        obtain ⟨d, rfl⟩ := endomorphism_simple_eq_smul_id π•œ g
+        simp [← mul_smul, mul_comm c d] }
 #align category_theory.field_End_of_finite_dimensional CategoryTheory.fieldEndOfFiniteDimensional
 -/
 
Diff
@@ -70,24 +70,7 @@ theorem isIso_iff_nonzero [HasKernels C] {X Y : C} [Simple X] [Simple Y] (f : X
 /-- In any preadditive category with kernels,
 the endomorphisms of a simple object form a division ring.
 -/
-noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) := by
-  classical exact
-    {
-      (inferInstance :
-        Ring
-          (End
-            X)) with
-      inv := fun f =>
-        if h : f = 0 then 0
-        else
-          haveI := is_iso_of_hom_simple h
-          inv f
-      exists_pair_ne := βŸ¨πŸ™ X, 0, id_nonzero _⟩
-      inv_zero := dif_pos rfl
-      mul_inv_cancel := fun f h => by
-        haveI := is_iso_of_hom_simple h
-        convert is_iso.inv_hom_id f
-        exact dif_neg h }
+noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) := by classical
 
 open FiniteDimensional
 
@@ -172,14 +155,7 @@ theorem endomorphism_simple_eq_smul_id {X : C} [Simple X] [I : FiniteDimensional
 This can't be an instance as `π•œ` would be undetermined.
 -/
 noncomputable def fieldEndOfFiniteDimensional (X : C) [Simple X] [I : FiniteDimensional π•œ (X ⟢ X)] :
-    Field (End X) := by
-  classical exact
-    { (inferInstance : DivisionRing (End X)) with
-      mul_comm := fun f g =>
-        by
-        obtain ⟨c, rfl⟩ := endomorphism_simple_eq_smul_id π•œ f
-        obtain ⟨d, rfl⟩ := endomorphism_simple_eq_smul_id π•œ g
-        simp [← mul_smul, mul_comm c d] }
+    Field (End X) := by classical
 #align category_theory.field_End_of_finite_dimensional CategoryTheory.fieldEndOfFiniteDimensional
 -/
 
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Markus Himmel, Scott Morrison
 -/
-import Mathbin.Algebra.Group.Ext
-import Mathbin.CategoryTheory.Simple
-import Mathbin.CategoryTheory.Linear.Basic
-import Mathbin.CategoryTheory.Endomorphism
-import Mathbin.FieldTheory.IsAlgClosed.Spectrum
+import Algebra.Group.Ext
+import CategoryTheory.Simple
+import CategoryTheory.Linear.Basic
+import CategoryTheory.Endomorphism
+import FieldTheory.IsAlgClosed.Spectrum
 
 #align_import category_theory.preadditive.schur from "leanprover-community/mathlib"@"660b3a2db3522fa0db036e569dc995a615c4c848"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Markus Himmel, Scott Morrison
-
-! This file was ported from Lean 3 source module category_theory.preadditive.schur
-! leanprover-community/mathlib commit 660b3a2db3522fa0db036e569dc995a615c4c848
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Group.Ext
 import Mathbin.CategoryTheory.Simple
@@ -14,6 +9,8 @@ import Mathbin.CategoryTheory.Linear.Basic
 import Mathbin.CategoryTheory.Endomorphism
 import Mathbin.FieldTheory.IsAlgClosed.Spectrum
 
+#align_import category_theory.preadditive.schur from "leanprover-community/mathlib"@"660b3a2db3522fa0db036e569dc995a615c4c848"
+
 /-!
 # Schur's lemma
 
Diff
@@ -98,6 +98,7 @@ section
 
 variable (π•œ : Type _) [DivisionRing π•œ]
 
+#print CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso /-
 /-- Part of **Schur's lemma** for `π•œ`-linear categories:
 the hom space between two non-isomorphic simple objects is 0-dimensional.
 -/
@@ -111,6 +112,7 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
       refine' p.mp fun _ => h (as_iso f)
   finrank_zero_of_subsingleton
 #align category_theory.finrank_hom_simple_simple_eq_zero_of_not_iso CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso
+-/
 
 end
 
@@ -118,6 +120,7 @@ variable (π•œ : Type _) [Field π•œ]
 
 variable [IsAlgClosed π•œ] [Linear π•œ C]
 
+#print CategoryTheory.finrank_endomorphism_eq_one /-
 -- In the proof below we have some difficulty using `I : finite_dimensional π•œ (X ⟢ X)`
 -- where we need a `finite_dimensional π•œ (End X)`.
 -- These are definitionally equal, but without eta reduction Lean can't see this.
@@ -146,21 +149,26 @@ theorem finrank_endomorphism_eq_one {X : C} (is_iso_iff_nonzero : βˆ€ f : X ⟢
       Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu 
     exact nu.symm
 #align category_theory.finrank_endomorphism_eq_one CategoryTheory.finrank_endomorphism_eq_one
+-/
 
 variable [HasKernels C]
 
+#print CategoryTheory.finrank_endomorphism_simple_eq_one /-
 /-- **Schur's lemma** for endomorphisms in `π•œ`-linear categories.
 -/
 theorem finrank_endomorphism_simple_eq_one (X : C) [Simple X] [I : FiniteDimensional π•œ (X ⟢ X)] :
     finrank π•œ (X ⟢ X) = 1 :=
   finrank_endomorphism_eq_one π•œ isIso_iff_nonzero
 #align category_theory.finrank_endomorphism_simple_eq_one CategoryTheory.finrank_endomorphism_simple_eq_one
+-/
 
+#print CategoryTheory.endomorphism_simple_eq_smul_id /-
 theorem endomorphism_simple_eq_smul_id {X : C} [Simple X] [I : FiniteDimensional π•œ (X ⟢ X)]
     (f : X ⟢ X) : βˆƒ c : π•œ, c β€’ πŸ™ X = f :=
   (finrank_eq_one_iff_of_nonzero' (πŸ™ X) (id_nonzero X)).mp (finrank_endomorphism_simple_eq_one π•œ X)
     f
 #align category_theory.endomorphism_simple_eq_smul_id CategoryTheory.endomorphism_simple_eq_smul_id
+-/
 
 #print CategoryTheory.fieldEndOfFiniteDimensional /-
 /-- Endomorphisms of a simple object form a field if they are finite dimensional.
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Markus Himmel, Scott Morrison
 
 ! This file was ported from Lean 3 source module category_theory.preadditive.schur
-! leanprover-community/mathlib commit 58a272265b5e05f258161260dd2c5d247213cbd3
+! leanprover-community/mathlib commit 660b3a2db3522fa0db036e569dc995a615c4c848
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.FieldTheory.IsAlgClosed.Spectrum
 
 /-!
 # Schur's lemma
+
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
 We first prove the part of Schur's Lemma that holds in any preadditive category with kernels,
 that any nonzero morphism between simple objects
 is an isomorphism.
Diff
@@ -35,12 +35,15 @@ variable {C : Type _} [Category C]
 
 variable [Preadditive C]
 
+#print CategoryTheory.mono_of_nonzero_from_simple /-
 -- See also `epi_of_nonzero_to_simple`, which does not require `preadditive C`.
 theorem mono_of_nonzero_from_simple [HasKernels C] {X Y : C} [Simple X] {f : X ⟢ Y} (w : f β‰  0) :
     Mono f :=
   Preadditive.mono_of_kernel_zero (kernel_zero_of_nonzero_from_simple w)
 #align category_theory.mono_of_nonzero_from_simple CategoryTheory.mono_of_nonzero_from_simple
+-/
 
+#print CategoryTheory.isIso_of_hom_simple /-
 /-- The part of **Schur's lemma** that holds in any preadditive category with kernels:
 that a nonzero morphism between simple objects is an isomorphism.
 -/
@@ -49,7 +52,9 @@ theorem isIso_of_hom_simple [HasKernels C] {X Y : C} [Simple X] [Simple Y] {f :
   haveI := mono_of_nonzero_from_simple w
   is_iso_of_mono_of_nonzero w
 #align category_theory.is_iso_of_hom_simple CategoryTheory.isIso_of_hom_simple
+-/
 
+#print CategoryTheory.isIso_iff_nonzero /-
 /-- As a corollary of Schur's lemma for preadditive categories,
 any morphism between simple objects is (exclusively) either an isomorphism or zero.
 -/
@@ -60,6 +65,7 @@ theorem isIso_iff_nonzero [HasKernels C] {X Y : C} [Simple X] [Simple Y] (f : X
     apply id_nonzero X
     simp only [← is_iso.hom_inv_id f, h, zero_comp], fun w => isIso_of_hom_simple w⟩
 #align category_theory.is_iso_iff_nonzero CategoryTheory.isIso_iff_nonzero
+-/
 
 /-- In any preadditive category with kernels,
 the endomorphisms of a simple object form a division ring.
@@ -153,6 +159,7 @@ theorem endomorphism_simple_eq_smul_id {X : C} [Simple X] [I : FiniteDimensional
     f
 #align category_theory.endomorphism_simple_eq_smul_id CategoryTheory.endomorphism_simple_eq_smul_id
 
+#print CategoryTheory.fieldEndOfFiniteDimensional /-
 /-- Endomorphisms of a simple object form a field if they are finite dimensional.
 This can't be an instance as `π•œ` would be undetermined.
 -/
@@ -166,7 +173,9 @@ noncomputable def fieldEndOfFiniteDimensional (X : C) [Simple X] [I : FiniteDime
         obtain ⟨d, rfl⟩ := endomorphism_simple_eq_smul_id π•œ g
         simp [← mul_smul, mul_comm c d] }
 #align category_theory.field_End_of_finite_dimensional CategoryTheory.fieldEndOfFiniteDimensional
+-/
 
+#print CategoryTheory.finrank_hom_simple_simple_le_one /-
 -- There is a symmetric argument that uses `[finite_dimensional π•œ (Y ⟢ Y)]` instead,
 -- but we don't bother proving that here.
 /-- **Schur's lemma** for `π•œ`-linear categories:
@@ -189,7 +198,9 @@ theorem finrank_hom_simple_simple_le_one (X Y : C) [FiniteDimensional π•œ (X 
     obtain ⟨c, w⟩ := endomorphism_simple_eq_smul_id π•œ (g ≫ inv f)
     exact ⟨c, by simpa using w =≫ f⟩
 #align category_theory.finrank_hom_simple_simple_le_one CategoryTheory.finrank_hom_simple_simple_le_one
+-/
 
+#print CategoryTheory.finrank_hom_simple_simple_eq_one_iff /-
 theorem finrank_hom_simple_simple_eq_one_iff (X Y : C) [FiniteDimensional π•œ (X ⟢ X)]
     [FiniteDimensional π•œ (X ⟢ Y)] [Simple X] [Simple Y] :
     finrank π•œ (X ⟢ Y) = 1 ↔ Nonempty (X β‰… Y) :=
@@ -206,7 +217,9 @@ theorem finrank_hom_simple_simple_eq_one_iff (X Y : C) [FiniteDimensional π•œ (
       finrank_pos_iff_exists_ne_zero.mpr ⟨f.hom, (is_iso_iff_nonzero f.hom).mp inferInstance⟩
     linarith
 #align category_theory.finrank_hom_simple_simple_eq_one_iff CategoryTheory.finrank_hom_simple_simple_eq_one_iff
+-/
 
+#print CategoryTheory.finrank_hom_simple_simple_eq_zero_iff /-
 theorem finrank_hom_simple_simple_eq_zero_iff (X Y : C) [FiniteDimensional π•œ (X ⟢ X)]
     [FiniteDimensional π•œ (X ⟢ Y)] [Simple X] [Simple Y] : finrank π•œ (X ⟢ Y) = 0 ↔ IsEmpty (X β‰… Y) :=
   by
@@ -217,9 +230,11 @@ theorem finrank_hom_simple_simple_eq_zero_iff (X Y : C) [FiniteDimensional π•œ
   Β· exact h'
   Β· exact False.elim (h h')
 #align category_theory.finrank_hom_simple_simple_eq_zero_iff CategoryTheory.finrank_hom_simple_simple_eq_zero_iff
+-/
 
 open scoped Classical
 
+#print CategoryTheory.finrank_hom_simple_simple /-
 theorem finrank_hom_simple_simple (X Y : C) [βˆ€ X Y : C, FiniteDimensional π•œ (X ⟢ Y)] [Simple X]
     [Simple Y] : finrank π•œ (X ⟢ Y) = if Nonempty (X β‰… Y) then 1 else 0 :=
   by
@@ -227,6 +242,7 @@ theorem finrank_hom_simple_simple (X Y : C) [βˆ€ X Y : C, FiniteDimensional π•œ
   exact (finrank_hom_simple_simple_eq_one_iff π•œ X Y).2 h
   exact (finrank_hom_simple_simple_eq_zero_iff π•œ X Y).2 (not_nonempty_iff.mp h)
 #align category_theory.finrank_hom_simple_simple CategoryTheory.finrank_hom_simple_simple
+-/
 
 end CategoryTheory
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Markus Himmel, Scott Morrison
 
 ! This file was ported from Lean 3 source module category_theory.preadditive.schur
-! leanprover-community/mathlib commit 5ec62c8106221a3f9160e4e4fcc3eed79fe213e9
+! leanprover-community/mathlib commit 58a272265b5e05f258161260dd2c5d247213cbd3
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -12,7 +12,7 @@ import Mathbin.Algebra.Group.Ext
 import Mathbin.CategoryTheory.Simple
 import Mathbin.CategoryTheory.Linear.Basic
 import Mathbin.CategoryTheory.Endomorphism
-import Mathbin.Algebra.Algebra.Spectrum
+import Mathbin.FieldTheory.IsAlgClosed.Spectrum
 
 /-!
 # Schur's lemma
Diff
@@ -66,22 +66,22 @@ the endomorphisms of a simple object form a division ring.
 -/
 noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) := by
   classical exact
-      {
-        (inferInstance :
-          Ring
-            (End
-              X)) with
-        inv := fun f =>
-          if h : f = 0 then 0
-          else
-            haveI := is_iso_of_hom_simple h
-            inv f
-        exists_pair_ne := βŸ¨πŸ™ X, 0, id_nonzero _⟩
-        inv_zero := dif_pos rfl
-        mul_inv_cancel := fun f h => by
+    {
+      (inferInstance :
+        Ring
+          (End
+            X)) with
+      inv := fun f =>
+        if h : f = 0 then 0
+        else
           haveI := is_iso_of_hom_simple h
-          convert is_iso.inv_hom_id f
-          exact dif_neg h }
+          inv f
+      exists_pair_ne := βŸ¨πŸ™ X, 0, id_nonzero _⟩
+      inv_zero := dif_pos rfl
+      mul_inv_cancel := fun f h => by
+        haveI := is_iso_of_hom_simple h
+        convert is_iso.inv_hom_id f
+        exact dif_neg h }
 
 open FiniteDimensional
 
@@ -159,12 +159,12 @@ This can't be an instance as `π•œ` would be undetermined.
 noncomputable def fieldEndOfFiniteDimensional (X : C) [Simple X] [I : FiniteDimensional π•œ (X ⟢ X)] :
     Field (End X) := by
   classical exact
-      { (inferInstance : DivisionRing (End X)) with
-        mul_comm := fun f g =>
-          by
-          obtain ⟨c, rfl⟩ := endomorphism_simple_eq_smul_id π•œ f
-          obtain ⟨d, rfl⟩ := endomorphism_simple_eq_smul_id π•œ g
-          simp [← mul_smul, mul_comm c d] }
+    { (inferInstance : DivisionRing (End X)) with
+      mul_comm := fun f g =>
+        by
+        obtain ⟨c, rfl⟩ := endomorphism_simple_eq_smul_id π•œ f
+        obtain ⟨d, rfl⟩ := endomorphism_simple_eq_smul_id π•œ g
+        simp [← mul_smul, mul_comm c d] }
 #align category_theory.field_End_of_finite_dimensional CategoryTheory.fieldEndOfFiniteDimensional
 
 -- There is a symmetric argument that uses `[finite_dimensional π•œ (Y ⟢ Y)]` instead,
Diff
@@ -98,7 +98,7 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
     subsingleton_of_forall_eq (0 : X ⟢ Y) fun f =>
       by
       have p := not_congr (is_iso_iff_nonzero f)
-      simp only [Classical.not_not, Ne.def] at p
+      simp only [Classical.not_not, Ne.def] at p 
       refine' p.mp fun _ => h (as_iso f)
   finrank_zero_of_subsingleton
 #align category_theory.finrank_hom_simple_simple_eq_zero_of_not_iso CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso
@@ -134,7 +134,7 @@ theorem finrank_endomorphism_eq_one {X : C} (is_iso_iff_nonzero : βˆ€ f : X ⟢
         (by convert I; ext; rfl; ext; rfl) (End.of f)
     use c
     rw [spectrum.mem_iff, IsUnit.sub_iff, is_unit_iff_is_iso, is_iso_iff_nonzero, Ne.def,
-      Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu
+      Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu 
     exact nu.symm
 #align category_theory.finrank_endomorphism_eq_one CategoryTheory.finrank_endomorphism_eq_one
 
@@ -196,9 +196,9 @@ theorem finrank_hom_simple_simple_eq_one_iff (X Y : C) [FiniteDimensional π•œ (
   by
   fconstructor
   Β· intro h
-    rw [finrank_eq_one_iff'] at h
+    rw [finrank_eq_one_iff'] at h 
     obtain ⟨f, nz, -⟩ := h
-    rw [← is_iso_iff_nonzero] at nz
+    rw [← is_iso_iff_nonzero] at nz 
     exact ⟨as_iso f⟩
   · rintro ⟨f⟩
     have le_one := finrank_hom_simple_simple_le_one π•œ X Y
Diff
@@ -218,7 +218,7 @@ theorem finrank_hom_simple_simple_eq_zero_iff (X Y : C) [FiniteDimensional π•œ
   Β· exact False.elim (h h')
 #align category_theory.finrank_hom_simple_simple_eq_zero_iff CategoryTheory.finrank_hom_simple_simple_eq_zero_iff
 
-open Classical
+open scoped Classical
 
 theorem finrank_hom_simple_simple (X Y : C) [βˆ€ X Y : C, FiniteDimensional π•œ (X ⟢ Y)] [Simple X]
     [Simple Y] : finrank π•œ (X ⟢ Y) = if Nonempty (X β‰… Y) then 1 else 0 :=
Diff
@@ -131,13 +131,7 @@ theorem finrank_endomorphism_eq_one {X : C} (is_iso_iff_nonzero : βˆ€ f : X ⟢
     haveI : Nontrivial (End X) := nontrivial_of_ne _ _ id_nonzero
     obtain ⟨c, nu⟩ :=
       @spectrum.nonempty_of_isAlgClosed_of_finiteDimensional π•œ (End X) _ _ _ _ _
-        (by
-          convert I
-          ext
-          rfl
-          ext
-          rfl)
-        (End.of f)
+        (by convert I; ext; rfl; ext; rfl) (End.of f)
     use c
     rw [spectrum.mem_iff, IsUnit.sub_iff, is_unit_iff_is_iso, is_iso_iff_nonzero, Ne.def,
       Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu
@@ -217,10 +211,7 @@ theorem finrank_hom_simple_simple_eq_zero_iff (X Y : C) [FiniteDimensional π•œ
     [FiniteDimensional π•œ (X ⟢ Y)] [Simple X] [Simple Y] : finrank π•œ (X ⟢ Y) = 0 ↔ IsEmpty (X β‰… Y) :=
   by
   rw [← not_nonempty_iff, ← not_congr (finrank_hom_simple_simple_eq_one_iff π•œ X Y)]
-  refine'
-    ⟨fun h => by
-      rw [h]
-      simp, fun h => _⟩
+  refine' ⟨fun h => by rw [h]; simp, fun h => _⟩
   have := finrank_hom_simple_simple_le_one π•œ X Y
   interval_cases h' : finrank π•œ (X ⟢ Y)
   Β· exact h'
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Markus Himmel, Scott Morrison
 
 ! This file was ported from Lean 3 source module category_theory.preadditive.schur
-! leanprover-community/mathlib commit 829895f162a1f29d0133f4b3538f4cd1fb5bffd3
+! leanprover-community/mathlib commit 5ec62c8106221a3f9160e4e4fcc3eed79fe213e9
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -126,8 +126,7 @@ theorem finrank_endomorphism_eq_one {X : C} (is_iso_iff_nonzero : βˆ€ f : X ⟢
     [I : FiniteDimensional π•œ (X ⟢ X)] : finrank π•œ (X ⟢ X) = 1 :=
   by
   have id_nonzero := (is_iso_iff_nonzero (πŸ™ X)).mp (by infer_instance)
-  apply finrank_eq_one (πŸ™ X)
-  Β· exact id_nonzero
+  refine' finrank_eq_one (πŸ™ X) id_nonzero _
   Β· intro f
     haveI : Nontrivial (End X) := nontrivial_of_ne _ _ id_nonzero
     obtain ⟨c, nu⟩ :=
@@ -191,7 +190,7 @@ theorem finrank_hom_simple_simple_le_one (X Y : C) [FiniteDimensional π•œ (X 
     exact zero_le_one
   · obtain ⟨f, nz⟩ := (nontrivial_iff_exists_ne 0).mp h
     haveI fi := (is_iso_iff_nonzero f).mpr nz
-    apply finrank_le_one f
+    refine' finrank_le_one f _
     intro g
     obtain ⟨c, w⟩ := endomorphism_simple_eq_smul_id π•œ (g ≫ inv f)
     exact ⟨c, by simpa using w =≫ f⟩

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -206,8 +206,8 @@ open scoped Classical
 theorem finrank_hom_simple_simple (X Y : C) [βˆ€ X Y : C, FiniteDimensional π•œ (X ⟢ Y)] [Simple X]
     [Simple Y] : finrank π•œ (X ⟢ Y) = if Nonempty (X β‰… Y) then 1 else 0 := by
   split_ifs with h
-  exact (finrank_hom_simple_simple_eq_one_iff π•œ X Y).2 h
-  exact (finrank_hom_simple_simple_eq_zero_iff π•œ X Y).2 (not_nonempty_iff.mp h)
+  Β· exact (finrank_hom_simple_simple_eq_one_iff π•œ X Y).2 h
+  Β· exact (finrank_hom_simple_simple_eq_zero_iff π•œ X Y).2 (not_nonempty_iff.mp h)
 #align category_theory.finrank_hom_simple_simple CategoryTheory.finrank_hom_simple_simple
 
 end CategoryTheory
feat: NNRat.cast (#11203)

Define the canonical coercion from the nonnegative rationals to any division semiring.

From LeanAPAP

Diff
@@ -70,6 +70,7 @@ noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X)
     rw [dif_neg hf]
     haveI := isIso_of_hom_simple hf
     exact IsIso.inv_hom_id f
+  nnqsmul := _
   qsmul := _
 
 open FiniteDimensional
chore: Final cleanup before NNRat.cast (#12360)

This is the parts of the diff of #11203 which don't mention NNRat.cast.

  • Use more where notation.
  • Write qsmul := _ instead of qsmul := qsmulRec _ to make the instances more robust to definition changes.
  • Delete qsmulRec.
  • Move qsmul before ratCast_def in instance declarations.
  • Name more instances.
  • Rename rat_smul to qsmul.
Diff
@@ -58,25 +58,19 @@ theorem isIso_iff_nonzero [HasKernels C] {X Y : C} [Simple X] [Simple Y] (f : X
    fun w => isIso_of_hom_simple w⟩
 #align category_theory.is_iso_iff_nonzero CategoryTheory.isIso_iff_nonzero
 
+open scoped Classical in
 /-- In any preadditive category with kernels,
-the endomorphisms of a simple object form a division ring.
--/
-noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) := by
-  classical exact
-    { (inferInstance : Ring (End X)) with
-      inv := fun f =>
-        if h : f = 0 then 0
-        else
-          haveI := isIso_of_hom_simple h
-          inv f
-      exists_pair_ne := βŸ¨πŸ™ X, 0, id_nonzero _⟩
-      inv_zero := dif_pos rfl
-      mul_inv_cancel := fun f h => by
-        dsimp
-        rw [dif_neg h]
-        haveI := isIso_of_hom_simple h
-        exact IsIso.inv_hom_id f
-      qsmul := qsmulRec _ }
+the endomorphisms of a simple object form a division ring. -/
+noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) where
+  inv f := if h : f = 0 then 0 else haveI := isIso_of_hom_simple h; inv f
+  exists_pair_ne := βŸ¨πŸ™ X, 0, id_nonzero _⟩
+  inv_zero := dif_pos rfl
+  mul_inv_cancel f hf := by
+    dsimp
+    rw [dif_neg hf]
+    haveI := isIso_of_hom_simple hf
+    exact IsIso.inv_hom_id f
+  qsmul := _
 
 open FiniteDimensional
 
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -92,7 +92,7 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
   haveI :=
     subsingleton_of_forall_eq (0 : X ⟢ Y) fun f => by
       have p := not_congr (isIso_iff_nonzero f)
-      simp only [Classical.not_not, Ne.def] at p
+      simp only [Classical.not_not, Ne] at p
       exact p.mp fun _ => h (asIso f)
   finrank_zero_of_subsingleton
 #align category_theory.finrank_hom_simple_simple_eq_zero_of_not_iso CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso
@@ -125,7 +125,7 @@ theorem finrank_endomorphism_eq_one {X : C} (isIso_iff_nonzero : βˆ€ f : X ⟢ X
   have : FiniteDimensional π•œ (End X) := I
   obtain ⟨c, nu⟩ := spectrum.nonempty_of_isAlgClosed_of_finiteDimensional π•œ (End.of f)
   use c
-  rw [spectrum.mem_iff, IsUnit.sub_iff, isUnit_iff_isIso, isIso_iff_nonzero, Ne.def,
+  rw [spectrum.mem_iff, IsUnit.sub_iff, isUnit_iff_isIso, isIso_iff_nonzero, Ne,
     Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu
   exact nu.symm
 #align category_theory.finrank_endomorphism_eq_one CategoryTheory.finrank_endomorphism_eq_one
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -29,7 +29,6 @@ namespace CategoryTheory
 open CategoryTheory.Limits
 
 variable {C : Type*} [Category C]
-
 variable [Preadditive C]
 
 -- See also `epi_of_nonzero_to_simple`, which does not require `Preadditive C`.
@@ -101,7 +100,6 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
 end
 
 variable (π•œ : Type*) [Field π•œ]
-
 variable [IsAlgClosed π•œ] [Linear π•œ C]
 
 -- Porting note: the defeq issue in lean3 described below is no longer a problem in Lean4.
refactor: do not allow qsmul to default automatically (#11262)

Follows on from #6262. Again, this does not attempt to fix any diamonds; it only identifies where they may be.

Diff
@@ -76,7 +76,8 @@ noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X)
         dsimp
         rw [dif_neg h]
         haveI := isIso_of_hom_simple h
-        exact IsIso.inv_hom_id f }
+        exact IsIso.inv_hom_id f
+      qsmul := qsmulRec _ }
 
 open FiniteDimensional
 
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
@@ -103,7 +103,7 @@ variable (π•œ : Type*) [Field π•œ]
 
 variable [IsAlgClosed π•œ] [Linear π•œ C]
 
--- porting note: the defeq issue in lean3 described below is no longer a problem in Lean4.
+-- Porting note: the defeq issue in lean3 described below is no longer a problem in Lean4.
 -- In the proof below we have some difficulty using `I : FiniteDimensional π•œ (X ⟢ X)`
 -- where we need a `FiniteDimensional π•œ (End X)`.
 -- These are definitionally equal, but without eta reduction Lean can't see this.
refactor: optimize proofs with omega (#11093)

I ran tryAtEachStep on all files under Mathlib to find all locations where omega succeeds. For each that was a linarith without an only, I tried replacing it with omega, and I verified that elaboration time got smaller. (In almost all cases, there was a noticeable speedup.) I also replaced some slow aesops along the way.

Diff
@@ -193,7 +193,7 @@ theorem finrank_hom_simple_simple_eq_one_iff (X Y : C) [FiniteDimensional π•œ (
     have le_one := finrank_hom_simple_simple_le_one π•œ X Y
     have zero_lt : 0 < finrank π•œ (X ⟢ Y) :=
       finrank_pos_iff_exists_ne_zero.mpr ⟨f.hom, (isIso_iff_nonzero f.hom).mp inferInstance⟩
-    linarith
+    omega
 #align category_theory.finrank_hom_simple_simple_eq_one_iff CategoryTheory.finrank_hom_simple_simple_eq_one_iff
 
 theorem finrank_hom_simple_simple_eq_zero_iff (X Y : C) [FiniteDimensional π•œ (X ⟢ X)]
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -93,7 +93,7 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
     subsingleton_of_forall_eq (0 : X ⟢ Y) fun f => by
       have p := not_congr (isIso_iff_nonzero f)
       simp only [Classical.not_not, Ne.def] at p
-      refine' p.mp fun _ => h (asIso f)
+      exact p.mp fun _ => h (asIso f)
   finrank_zero_of_subsingleton
 #align category_theory.finrank_hom_simple_simple_eq_zero_of_not_iso CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -28,7 +28,7 @@ namespace CategoryTheory
 
 open CategoryTheory.Limits
 
-variable {C : Type _} [Category C]
+variable {C : Type*} [Category C]
 
 variable [Preadditive C]
 
@@ -82,7 +82,7 @@ open FiniteDimensional
 
 section
 
-variable (π•œ : Type _) [DivisionRing π•œ]
+variable (π•œ : Type*) [DivisionRing π•œ]
 
 /-- Part of **Schur's lemma** for `π•œ`-linear categories:
 the hom space between two non-isomorphic simple objects is 0-dimensional.
@@ -99,7 +99,7 @@ theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear π•œ
 
 end
 
-variable (π•œ : Type _) [Field π•œ]
+variable (π•œ : Type*) [Field π•œ]
 
 variable [IsAlgClosed π•œ] [Linear π•œ C]
 
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) 2020 Scott Morrison. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Markus Himmel, Scott Morrison
-
-! This file was ported from Lean 3 source module category_theory.preadditive.schur
-! leanprover-community/mathlib commit 58a272265b5e05f258161260dd2c5d247213cbd3
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Group.Ext
 import Mathlib.CategoryTheory.Simple
@@ -14,6 +9,8 @@ import Mathlib.CategoryTheory.Linear.Basic
 import Mathlib.CategoryTheory.Endomorphism
 import Mathlib.FieldTheory.IsAlgClosed.Spectrum
 
+#align_import category_theory.preadditive.schur from "leanprover-community/mathlib"@"58a272265b5e05f258161260dd2c5d247213cbd3"
+
 /-!
 # Schur's lemma
 We first prove the part of Schur's Lemma that holds in any preadditive category with kernels,
chore: fix focusing dots (#5708)

This PR is the result of running

find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1Β· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +Β·)\n +(.*)$/\1 \2/;P;D' {} \;

which firstly replaces . focusing dots with Β· and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.

Diff
@@ -206,7 +206,7 @@ theorem finrank_hom_simple_simple_eq_zero_iff (X Y : C) [FiniteDimensional π•œ
   refine' ⟨fun h => by rw [h]; simp, fun h => _⟩
   have := finrank_hom_simple_simple_le_one π•œ X Y
   interval_cases finrank π•œ (X ⟢ Y)
-  . rfl
+  Β· rfl
   Β· exact False.elim (h rfl)
 #align category_theory.finrank_hom_simple_simple_eq_zero_iff CategoryTheory.finrank_hom_simple_simple_eq_zero_iff
 
chore: tidy various files (#5104)
Diff
@@ -58,7 +58,8 @@ theorem isIso_iff_nonzero [HasKernels C] {X Y : C} [Simple X] [Simple Y] (f : X
   ⟨fun I => by
     intro h
     apply id_nonzero X
-    simp only [← IsIso.hom_inv_id f, h, zero_comp], fun w => isIso_of_hom_simple w⟩
+    simp only [← IsIso.hom_inv_id f, h, zero_comp],
+   fun w => isIso_of_hom_simple w⟩
 #align category_theory.is_iso_iff_nonzero CategoryTheory.isIso_iff_nonzero
 
 /-- In any preadditive category with kernels,
@@ -123,14 +124,14 @@ theorem finrank_endomorphism_eq_one {X : C} (isIso_iff_nonzero : βˆ€ f : X ⟢ X
     [I : FiniteDimensional π•œ (X ⟢ X)] : finrank π•œ (X ⟢ X) = 1 := by
   have id_nonzero := (isIso_iff_nonzero (πŸ™ X)).mp (by infer_instance)
   refine' finrank_eq_one (πŸ™ X) id_nonzero _
-  Β· intro f
-    have : Nontrivial (End X) := nontrivial_of_ne _ _ id_nonzero
-    have : FiniteDimensional π•œ (End X) := I
-    obtain ⟨c, nu⟩ := spectrum.nonempty_of_isAlgClosed_of_finiteDimensional π•œ (End.of f)
-    use c
-    rw [spectrum.mem_iff, IsUnit.sub_iff, isUnit_iff_isIso, isIso_iff_nonzero, Ne.def,
-      Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu
-    exact nu.symm
+  intro f
+  have : Nontrivial (End X) := nontrivial_of_ne _ _ id_nonzero
+  have : FiniteDimensional π•œ (End X) := I
+  obtain ⟨c, nu⟩ := spectrum.nonempty_of_isAlgClosed_of_finiteDimensional π•œ (End.of f)
+  use c
+  rw [spectrum.mem_iff, IsUnit.sub_iff, isUnit_iff_isIso, isIso_iff_nonzero, Ne.def,
+    Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu
+  exact nu.symm
 #align category_theory.finrank_endomorphism_eq_one CategoryTheory.finrank_endomorphism_eq_one
 
 variable [HasKernels C]
@@ -172,8 +173,7 @@ for the refinements when we know whether or not the simples are isomorphic.
 theorem finrank_hom_simple_simple_le_one (X Y : C) [FiniteDimensional π•œ (X ⟢ X)] [Simple X]
     [Simple Y] : finrank π•œ (X ⟢ Y) ≀ 1 := by
   obtain (h|h) := subsingleton_or_nontrivial (X ⟢ Y)
-  Β· skip
-    rw [finrank_zero_of_subsingleton]
+  Β· rw [finrank_zero_of_subsingleton]
     exact zero_le_one
   · obtain ⟨f, nz⟩ := (nontrivial_iff_exists_ne 0).mp h
     haveI fi := (isIso_iff_nonzero f).mpr nz
feat: port CategoryTheory.Preadditive.Schur (#4952)

Dependencies 10 + 778

779 files ported (98.7%)
313483 lines ported (98.9%)
Show graph

The unported dependencies are