Skip to content

Commit 3d14267

Browse files
committed
chore(Algebra/Homology/HomologicalComplex): backport fixes from nightly-testing (leanprover-community#38458)
1 parent 6b3e499 commit 3d14267

3 files changed

Lines changed: 19 additions & 28 deletions

File tree

Mathlib/Algebra/Homology/HomologicalComplex.lean

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -631,18 +631,17 @@ def of (X : α → V) (d : ∀ n, X (n + 1) ⟶ X n) (sq : ∀ n, d (n + 1) ≫
631631
variable (X : α → V) (d : ∀ n, X (n + 1) ⟶ X n) (sq : ∀ n, d (n + 1) ≫ d n = 0)
632632

633633
@[simp]
634-
theorem of_x (n : α) : (of X d sq).X n = X n :=
634+
theorem of_X : (of X d sq).X = X :=
635635
rfl
636636

637637
@[simp]
638638
theorem of_d (j : α) : (of X d sq).d (j + 1) j = d j := by
639639
dsimp [of]
640640
rw [if_pos rfl, Category.id_comp]
641641

642-
set_option backward.isDefEq.respectTransparency false in
643642
theorem of_d_ne {i j : α} (h : i ≠ j + 1) : (of X d sq).d i j = 0 := by
644-
dsimp [of]
645-
rw [dif_neg h]
643+
rw [of]
644+
simp [dif_neg h]
646645

647646
end Of
648647

@@ -652,7 +651,6 @@ variable {V} {α : Type*} [AddRightCancelSemigroup α] [One α] [DecidableEq α]
652651
variable (X : α → V) (d_X : ∀ n, X (n + 1) ⟶ X n) (sq_X : ∀ n, d_X (n + 1) ≫ d_X n = 0) (Y : α → V)
653652
(d_Y : ∀ n, Y (n + 1) ⟶ Y n) (sq_Y : ∀ n, d_Y (n + 1) ≫ d_Y n = 0)
654653

655-
set_option backward.isDefEq.respectTransparency false in
656654
/-- A constructor for chain maps between `α`-indexed chain complexes built using `ChainComplex.of`,
657655
from a dependently typed collection of morphisms.
658656
-/
@@ -661,11 +659,9 @@ def ofHom (f : ∀ i : α, X i ⟶ Y i) (comm : ∀ i : α, f (i + 1) ≫ d_Y i
661659
of X d_X sq_X ⟶ of Y d_Y sq_Y :=
662660
{ f
663661
comm' := fun n m => by
664-
by_cases h : n = m + 1
665-
· subst h
666-
simpa using comm m
667-
· rw [of_d_ne X _ _ h, of_d_ne Y _ _ h]
668-
simp }
662+
simp only [ComplexShape.down_Rel]
663+
rintro rfl
664+
simpa using comm m }
669665

670666
end OfHom
671667

@@ -727,9 +723,8 @@ lemma mk_congr_succ_d₂ {S S' : ShortComplex V} (h : S = S') :
727723
lemma mkAux_eq_shortComplex_mk_d_comp_d (n : ℕ) :
728724
mkAux X₀ X₁ X₂ d₀ d₁ s succ n =
729725
ShortComplex.mk _ _ ((mk X₀ X₁ X₂ d₀ d₁ s succ).d_comp_d (n + 2) (n + 1) n) := by
730-
change ShortComplex.mk _ _ (mkAux X₀ X₁ X₂ d₀ d₁ s succ n).zero = _
731-
dsimp [mk, of, mkAux]
732-
simp
726+
rw [show n + 2 = n + 1 + 1 from rfl]
727+
simp only [mk, of_X, of_d, mkAux]
733728

734729
/-- The isomorphism from `(mk X₀ X₁ X₂ d₀ d₁ s succ).X (n + 3)` that is given by
735730
the inductive construction. -/
@@ -741,14 +736,14 @@ def mkXIso (n : ℕ) :
741736
(mkAux_eq_shortComplex_mk_d_comp_d X₀ X₁ X₂ d₀ d₁ s succ n)]
742737
rfl)
743738

744-
set_option backward.isDefEq.respectTransparency false in
745739
lemma mk_d (n : ℕ) :
746740
(mk X₀ X₁ X₂ d₀ d₁ s succ).d (n + 3) (n + 2) =
747741
(mkXIso X₀ X₁ X₂ d₀ d₁ s succ n).hom ≫ (succ
748742
(ShortComplex.mk _ _ ((mk X₀ X₁ X₂ d₀ d₁ s succ).d_comp_d (n + 2) (n + 1) n))).2.1 := by
749743
have eq := mk_congr_succ_d₂ succ
750744
(mkAux_eq_shortComplex_mk_d_comp_d X₀ X₁ X₂ d₀ d₁ s succ n)
751-
rw [eqToHom_refl, comp_id] at eq
745+
set_option backward.isDefEq.respectTransparency false in
746+
rw [eqToHom_refl, comp_id] at eq
752747
refine Eq.trans ?_ eq
753748
dsimp only [mk, of]
754749
rw [dif_pos (by rfl), eqToHom_refl, id_comp]
@@ -895,18 +890,17 @@ def of (X : α → V) (d : ∀ n, X n ⟶ X (n + 1)) (sq : ∀ n, d n ≫ d (n +
895890
variable (X : α → V) (d : ∀ n, X n ⟶ X (n + 1)) (sq : ∀ n, d n ≫ d (n + 1) = 0)
896891

897892
@[simp]
898-
theorem of_x (n : α) : (of X d sq).X n = X n :=
893+
theorem of_X : (of X d sq).X = X :=
899894
rfl
900895

901896
@[simp]
902897
theorem of_d (j : α) : (of X d sq).d j (j + 1) = d j := by
903898
dsimp [of]
904899
rw [if_pos rfl, Category.comp_id]
905900

906-
set_option backward.isDefEq.respectTransparency false in
907901
theorem of_d_ne {i j : α} (h : i + 1 ≠ j) : (of X d sq).d i j = 0 := by
908-
dsimp [of]
909-
rw [dif_neg h]
902+
rw [of]
903+
simp [dif_neg h]
910904

911905
end Of
912906

@@ -916,7 +910,6 @@ variable {V} {α : Type*} [AddRightCancelSemigroup α] [One α] [DecidableEq α]
916910
variable (X : α → V) (d_X : ∀ n, X n ⟶ X (n + 1)) (sq_X : ∀ n, d_X n ≫ d_X (n + 1) = 0) (Y : α → V)
917911
(d_Y : ∀ n, Y n ⟶ Y (n + 1)) (sq_Y : ∀ n, d_Y n ≫ d_Y (n + 1) = 0)
918912

919-
set_option backward.isDefEq.respectTransparency false in
920913
/--
921914
A constructor for chain maps between `α`-indexed cochain complexes built using `CochainComplex.of`,
922915
from a dependently typed collection of morphisms.
@@ -926,11 +919,9 @@ def ofHom (f : ∀ i : α, X i ⟶ Y i) (comm : ∀ i : α, f i ≫ d_Y i = d_X
926919
of X d_X sq_X ⟶ of Y d_Y sq_Y :=
927920
{ f
928921
comm' := fun n m => by
929-
by_cases h : n + 1 = m
930-
· subst h
931-
simpa using comm n
932-
· rw [of_d_ne X _ _ h, of_d_ne Y _ _ h]
933-
simp }
922+
simp only [ComplexShape.up_Rel]
923+
rintro rfl
924+
simpa using comm n }
934925

935926
end OfHom
936927

Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ lemma cyclesMk₁_eq (x : cycles₁ A) :
776776
cyclesMk 1 0 (by simp) ((chainsIso₁ A).inv x) (by simp +instances) = (isoCycles₁ A).inv x :=
777777
(ModuleCat.mono_iff_injective <| iCycles A 1).1 inferInstance <| by
778778
rw [iCycles_mk]
779-
simp only [ChainComplex.of_x, isoCycles₁_inv_comp_iCycles_apply]
779+
simp only [ChainComplex.of_X, isoCycles₁_inv_comp_iCycles_apply]
780780
rfl
781781

782782
end isoCycles₁
@@ -822,7 +822,7 @@ lemma cyclesMk₂_eq (x : cycles₂ A) :
822822
cyclesMk 2 1 (by simp) ((chainsIso₂ A).inv x) (by simp +instances) = (isoCycles₂ A).inv x :=
823823
(ModuleCat.mono_iff_injective <| iCycles A 2).1 inferInstance <| by
824824
rw [iCycles_mk]
825-
simp only [ChainComplex.of_x, isoCycles₂_inv_comp_iCycles_apply]
825+
simp only [ChainComplex.of_X, isoCycles₂_inv_comp_iCycles_apply]
826826
rfl
827827

828828
end isoCycles₂

Mathlib/RepresentationTheory/Homological/Resolution.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ set_option backward.isDefEq.respectTransparency false in
416416
def isoStandardComplex : barComplex k G ≅ standardComplex k G :=
417417
HomologicalComplex.Hom.isoOfComponents (fun i => (diagonalSuccIsoFree k G i).symm) fun i j => by
418418
rintro (rfl : j + 1 = i)
419-
simp only [ChainComplex.of_x, Iso.symm_hom, d_def, d_comp_diagonalSuccIsoFree_inv_eq]
419+
simp only [ChainComplex.of_X, Iso.symm_hom, d_def, d_comp_diagonalSuccIsoFree_inv_eq]
420420

421421
end barComplex
422422

0 commit comments

Comments
 (0)