diff --git a/Archive/Hairer.lean b/Archive/Hairer.lean index 254922be74cc28..a52aa78ee49e37 100644 --- a/Archive/Hairer.lean +++ b/Archive/Hairer.lean @@ -93,6 +93,7 @@ def L : MvPolynomial ι ℝ →ₗ[ℝ] (fun p f₁ f₂ ↦ by simp_rw [smul_eq_mul, ← integral_add (int p _) (int p _), ← mul_add]; rfl) fun r p f ↦ by simp_rw [← integral_smul, smul_comm r]; rfl +set_option backward.isDefEq.respectTransparency.types false in lemma inj_L : Injective (L ι) := (injective_iff_map_eq_zero _).mpr fun p hp ↦ by have H : ∀ᵐ x : EuclideanSpace ℝ ι, x ∈ ball 0 1 → eval x p = 0 := diff --git a/Archive/Imo/Imo1987Q1.lean b/Archive/Imo/Imo1987Q1.lean index 20c83703c77438..b6218e9c670390 100644 --- a/Archive/Imo/Imo1987Q1.lean +++ b/Archive/Imo/Imo1987Q1.lean @@ -31,6 +31,7 @@ open Finset (range sum_const) namespace Imo1987Q1 +set_option backward.isDefEq.respectTransparency false in /-- The set of pairs `(x : α, σ : Perm α)` such that `σ x = x` is equivalent to the set of pairs `(x : α, σ : Perm {x}ᶜ)`. -/ def fixedPointsEquiv : { σx : α × Perm α // σx.2 σx.1 = σx.1 } ≃ Σ x : α, Perm ({x}ᶜ : Set α) := @@ -41,6 +42,7 @@ def fixedPointsEquiv : { σx : α × Perm α // σx.2 σx.1 = σx.1 } ≃ Σ x : (sigmaCongrRight fun x => Equiv.setCongr <| by simp only [SetCoe.forall]; simp) _ ≃ Σ x : α, Perm ({x}ᶜ : Set α) := sigmaCongrRight fun x => by apply Equiv.Set.compl +set_option backward.isDefEq.respectTransparency false in theorem card_fixed_points : card { σx : α × Perm α // σx.2 σx.1 = σx.1 } = card α * (card α - 1)! := by simp only [card_congr (fixedPointsEquiv α), card_sigma, card_perm] diff --git a/Archive/Imo/Imo2013Q1.lean b/Archive/Imo/Imo2013Q1.lean index 0c379f5a42bdd7..c495c9dc7573c9 100644 --- a/Archive/Imo/Imo2013Q1.lean +++ b/Archive/Imo/Imo2013Q1.lean @@ -39,6 +39,8 @@ theorem prod_lemma (m : ℕ → ℕ+) (k : ℕ) (nm : ℕ+) : end Imo2013Q1 open Imo2013Q1 + +set_option backward.isDefEq.respectTransparency.types false in theorem imo2013_q1 (n : ℕ+) (k : ℕ) : ∃ m : ℕ → ℕ+, (1 : ℚ) + (2 ^ k - 1) / n = ∏ i ∈ Finset.range k, (1 + 1 / (m i : ℚ)) := by induction k generalizing n with diff --git a/Archive/Imo/Imo2019Q2.lean b/Archive/Imo/Imo2019Q2.lean index 9a8aafe704dd53..e8d16c06c9097f 100644 --- a/Archive/Imo/Imo2019Q2.lean +++ b/Archive/Imo/Imo2019Q2.lean @@ -94,7 +94,7 @@ structure Imo2019q2Cfg where C_ne_Q₁ : C ≠ Q₁ /-- A default choice of orientation, for lemmas that need to pick one. -/ -@[implicit_reducible] +@[instance_reducible] def someOrientation [hd2 : Fact (finrank ℝ V = 2)] : Module.Oriented ℝ V (Fin 2) := ⟨Basis.orientation (finBasisOfFinrankEq _ _ hd2.out)⟩ diff --git a/Archive/Imo/Imo2024Q5.lean b/Archive/Imo/Imo2024Q5.lean index ebdb10c91fe044..0ba79f1f9813d9 100644 --- a/Archive/Imo/Imo2024Q5.lean +++ b/Archive/Imo/Imo2024Q5.lean @@ -128,6 +128,7 @@ def MonsterData.reflect (m : MonsterData N) : MonsterData N where toFun := Fin.rev ∘ m inj' := fun i j hij ↦ by simpa using hij +set_option backward.isDefEq.respectTransparency false in lemma MonsterData.reflect_reflect (m : MonsterData N) : m.reflect.reflect = m := by ext i simp [MonsterData.reflect] @@ -149,7 +150,7 @@ lemma MonsterData.mk_mem_monsterCells_iff_of_le {m : MonsterData N} {r : Fin (N simp only [monsterCells, Set.mem_range, Prod.mk.injEq] refine ⟨?_, ?_⟩ · rintro ⟨r', rfl, rfl⟩ - simp only [Subtype.coe_eta] + simp only · rintro rfl exact ⟨⟨r, hr1, hrN⟩, rfl, rfl⟩ @@ -449,6 +450,7 @@ def Path.reflect (p : Path N) : Path N where simp_rw [Adjacent, Nat.dist, Cell.reflect, Fin.rev] at h ⊢ lia +set_option backward.isDefEq.respectTransparency false in lemma Path.firstMonster_reflect (p : Path N) (m : MonsterData N) : p.reflect.firstMonster m.reflect = (p.firstMonster m).map Cell.reflect := by simp_rw [firstMonster, reflect, List.find?_map] @@ -524,6 +526,7 @@ lemma Strategy.ForcesWinIn.mono (s : Strategy N) {k₁ k₂ : ℕ} (h : s.Forces /-! ### Proof of lower bound with constructions used therein -/ +set_option backward.isDefEq.respectTransparency false in /-- An arbitrary choice of monster positions, which is modified to put selected monsters in desired places. -/ def baseMonsterData (N : ℕ) : MonsterData N where @@ -539,6 +542,7 @@ def baseMonsterData (N : ℕ) : MonsterData N where def monsterData12 (hN : 2 ≤ N) (c₁ c₂ : Fin (N + 1)) : MonsterData N := ((baseMonsterData N).setValue (row2 hN) c₂).setValue (row1 hN) c₁ +set_option backward.isDefEq.respectTransparency false in lemma monsterData12_apply_row2 (hN : 2 ≤ N) {c₁ c₂ : Fin (N + 1)} (h : c₁ ≠ c₂) : monsterData12 hN c₁ c₂ (row2 hN) = c₂ := by rw [monsterData12, Function.Embedding.setValue_eq_of_ne] @@ -729,6 +733,7 @@ def winningStrategy (hN : 2 ≤ N) : Strategy N | 1 => fun r => path1 hN ((r 0).getD 0).2 | _ + 2 => fun r => path2 hN ((r 0).getD 0).2 ((r 1).getD 0).1 +set_option backward.isDefEq.respectTransparency false in lemma path0_firstMonster_eq_apply_row1 (hN : 2 ≤ N) (m : MonsterData N) : (path0 hN).firstMonster m = some (1, m (row1 hN)) := by simp_rw [path0, Path.firstMonster, Path.ofFn] @@ -958,6 +963,7 @@ lemma winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_zero (hN : 2 exact path2OfEdge0_firstMonster_eq_none_of_path1OfEdge0_firstMonster_eq_some hN hx2N.1 hx2N.2 hc₁0 hx.symm +set_option backward.isDefEq.respectTransparency false in lemma winningStrategy_play_one_of_edge_N (hN : 2 ≤ N) {m : MonsterData N} (hc₁N : (m (row1 hN) : ℕ) = N) : (winningStrategy hN).play m 3 ⟨1, by simp⟩ = ((winningStrategy hN).play m.reflect 3 ⟨1, by simp⟩).map Cell.reflect := by @@ -972,6 +978,7 @@ lemma winningStrategy_play_one_of_edge_N (hN : 2 ≤ N) {m : MonsterData N} simp_rw [winningStrategy_play_one hN, path1, path1OfEdgeN, dif_neg hc₁0, if_pos hc₁N, dif_pos hc₁r0, ← Path.firstMonster_reflect, MonsterData.reflect_reflect] +set_option backward.isDefEq.respectTransparency false in lemma winningStrategy_play_two_of_edge_N (hN : 2 ≤ N) {m : MonsterData N} (hc₁N : (m (row1 hN) : ℕ) = N) : (winningStrategy hN).play m 3 ⟨2, by simp⟩ = ((winningStrategy hN).play m.reflect 3 ⟨2, by simp⟩).map Cell.reflect := by @@ -994,6 +1001,7 @@ lemma winningStrategy_play_two_of_edge_N (hN : 2 ≤ N) {m : MonsterData N} · rcases h with ⟨x, hx⟩ simp [hx, Cell.reflect] +set_option backward.isDefEq.respectTransparency false in lemma winningStrategy_play_one_eq_none_or_play_two_eq_none_of_edge_N (hN : 2 ≤ N) {m : MonsterData N} (hc₁N : (m (row1 hN) : ℕ) = N) : (winningStrategy hN).play m 3 ⟨1, by simp⟩ = none ∨ diff --git a/Archive/MinimalSheffer.lean b/Archive/MinimalSheffer.lean index 329aa377c84033..5f2818c56343f0 100644 --- a/Archive/MinimalSheffer.lean +++ b/Archive/MinimalSheffer.lean @@ -46,7 +46,7 @@ class VeroffAlgebra (α : Type*) extends Inhabited α where variable {α : Type*} /-- Derive a Veroff algebra from a Boolean algebra. -/ -@[implicit_reducible] +@[instance_reducible] def BooleanAlgebra.veroffAlgebra [BooleanAlgebra α] : VeroffAlgebra α where default := ⊥ f a b := (a ⊓ b)ᶜ @@ -207,7 +207,7 @@ class SingleShefferAlgebra (α : Type*) extends Inhabited α where variable {α : Type*} /-- Derive a `SingleShefferAlgebra` from a Boolean algebra. -/ -@[implicit_reducible] +@[instance_reducible] def BooleanAlgebra.singleShefferAlgebra [BooleanAlgebra α] : SingleShefferAlgebra α where default := ⊥ f a b := (a ⊓ b)ᶜ diff --git a/Archive/Sensitivity.lean b/Archive/Sensitivity.lean index 32dce0a60794f9..8b75c7fc0ba0b7 100644 --- a/Archive/Sensitivity.lean +++ b/Archive/Sensitivity.lean @@ -407,6 +407,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) : rw [Set.toFinset_card] at hH linarith +set_option backward.isDefEq.respectTransparency false in open Classical in /-- **Huang sensitivity theorem** also known as the **Huang degree theorem** -/ theorem huang_degree_theorem (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) : diff --git a/Archive/Wiedijk100Theorems/FriendshipGraphs.lean b/Archive/Wiedijk100Theorems/FriendshipGraphs.lean index 49eda393a6f626..b299a5f292b364 100644 --- a/Archive/Wiedijk100Theorems/FriendshipGraphs.lean +++ b/Archive/Wiedijk100Theorems/FriendshipGraphs.lean @@ -173,6 +173,7 @@ theorem isRegularOf_not_existsPolitician (hG' : ¬ExistsPolitician G) : open scoped Classical in include hG in +set_option backward.isDefEq.respectTransparency.types false in /-- Let `A` be the adjacency matrix of a `d`-regular friendship graph, and let `v` be a vector all of whose components are `1`. Then `v` is an eigenvector of `A ^ 2`, and we can compute the eigenvalue to be `d * d`, or as `d + (Fintype.card V - 1)`, so those quantities must be equal. diff --git a/Archive/Wiedijk100Theorems/Konigsberg.lean b/Archive/Wiedijk100Theorems/Konigsberg.lean index b4d9332c2a3fa7..7113829152d15e 100644 --- a/Archive/Wiedijk100Theorems/Konigsberg.lean +++ b/Archive/Wiedijk100Theorems/Konigsberg.lean @@ -17,6 +17,7 @@ between them has no Eulerian trail. namespace Konigsberg +set_option backward.isDefEq.respectTransparency.types false in /-- The vertices for the Königsberg graph; four vertices for the bodies of land and seven vertices for the bridges. -/ inductive Verts : Type diff --git a/Archive/ZagierTwoSquares.lean b/Archive/ZagierTwoSquares.lean index f3ca1d717a3649..61f14901867c4d 100644 --- a/Archive/ZagierTwoSquares.lean +++ b/Archive/ZagierTwoSquares.lean @@ -113,6 +113,7 @@ def complexInvo : Function.End (zagierSet k) := fun ⟨⟨x, y, z⟩, h⟩ => variable [hk : Fact (4 * k + 1).Prime] +set_option backward.isDefEq.respectTransparency false in /-- `complexInvo k` is indeed an involution. -/ theorem complexInvo_sq : complexInvo k ^ 2 = 1 := by change complexInvo k ∘ complexInvo k = id @@ -139,6 +140,7 @@ theorem complexInvo_sq : complexInvo k ^ 2 = 1 := by ← Nat.add_sub_assoc less, ← add_assoc, Nat.sub_add_cancel more, Nat.sub_sub _ _ y, ← two_mul, add_comm, Nat.add_sub_cancel] +set_option backward.isDefEq.respectTransparency false in /-- Any fixed point of `complexInvo k` must be `(1, 1, k)`. -/ theorem eq_of_mem_fixedPoints {t : zagierSet k} (mem : t ∈ fixedPoints (complexInvo k)) : t.val = (1, 1, k) := by @@ -169,6 +171,7 @@ theorem eq_of_mem_fixedPoints {t : zagierSet k} (mem : t ∈ fixedPoints (comple def singletonFixedPoint : Finset (zagierSet k) := {⟨(1, 1, k), (by simp only [zagierSet, Set.mem_setOf_eq]; linarith)⟩} +set_option backward.isDefEq.respectTransparency false in /-- `complexInvo k` has exactly one fixed point. -/ theorem card_fixedPoints_eq_one : Fintype.card (fixedPoints (complexInvo k)) = 1 := by rw [show 1 = Finset.card (singletonFixedPoint k) by rfl, ← Set.toFinset_card] diff --git a/Counterexamples/AharoniKorman.lean b/Counterexamples/AharoniKorman.lean index 558a146b8f437a..92dc0026576e14 100644 --- a/Counterexamples/AharoniKorman.lean +++ b/Counterexamples/AharoniKorman.lean @@ -206,6 +206,7 @@ lemma induction_on_level {n : ℕ} {p : (x : Hollom) → x ∈ level n → Prop} rintro x y _ rfl exact h _ _ +set_option backward.isDefEq.respectTransparency false in /-- For each `n`, there is an order embedding from ℕ × ℕ (which has the product order) to the Hollom partial order. @@ -219,6 +220,7 @@ lemma embed_apply (n : ℕ) (x y : ℕ) : embed n (x, y) = h(x, y, n) := rfl lemma embed_strictMono {n : ℕ} : StrictMono (embed n) := (embed n).strictMono +set_option backward.isDefEq.respectTransparency false in lemma level_eq_range (n : ℕ) : level n = Set.range (embed n) := by simp [level, Set.range, embed] @@ -810,6 +812,7 @@ variable {n : ℕ} lemma R_subset_level : R n C ⊆ level n := Set.sep_subset (level n) _ +set_option backward.isDefEq.respectTransparency false in /-- A helper lemma to show `square_subset_R`. In particular shows that if `C ∩ level n` is finite, the set of points `x` such that `x` is at least as large as every element of `C ∩ level n` contains an @@ -851,6 +854,7 @@ lemma square_subset_above (h : (C ∩ level n).Finite) : specialize hab _ _ hfg lia +set_option backward.isDefEq.respectTransparency false in lemma square_subset_R (h : (C ∩ level n).Finite) : ∀ᶠ a in atTop, embed n '' Set.Ici (a, a) ⊆ R n C \ (C ∩ level n) := by filter_upwards [square_subset_above h] with a ha @@ -933,6 +937,7 @@ lemma S_subset_R : S n C ⊆ R n C := by lemma S_subset_level : S n C ⊆ level n := S_subset_R.trans R_subset_level +set_option backward.isDefEq.respectTransparency false in /-- Assuming `C ∩ level n` is finite, and `C ∩ level (n + 1)` is finite, that there exists cofinitely many `a` such that `{(x, y, n) | x ≥ a ∧ y ≥ a} ⊆ S \ (C ∩ level n)`. diff --git a/Counterexamples/MapFloor.lean b/Counterexamples/MapFloor.lean index c45e5c9454e12d..9edd2ddce521df 100644 --- a/Counterexamples/MapFloor.lean +++ b/Counterexamples/MapFloor.lean @@ -59,6 +59,7 @@ instance isOrderedAddMonoid : IsOrderedAddMonoid ℤ[ε] := Function.Injective.isOrderedAddMonoid (toLex ∘ coeff) (fun _ _ => funext fun _ => coeff_add _ _ _) .rfl +set_option backward.isDefEq.respectTransparency false in theorem pos_iff {p : ℤ[ε]} : 0 < p ↔ 0 < p.trailingCoeff := by rw [trailingCoeff] refine @@ -118,6 +119,7 @@ theorem forgetEpsilons_floor_lt (n : ℤ) : exact (if_neg <| by rw [coeff_sub, intCast_coeff_zero]; simp [this]).trans (by rw [coeff_sub, intCast_coeff_zero]; simp) +set_option backward.isDefEq.respectTransparency false in /-- The ceil of `n + ε` is `n + 1` but its image under `forgetEpsilons` is `n`, whose ceil is itself. -/ theorem lt_forgetEpsilons_ceil (n : ℤ) : diff --git a/Counterexamples/Phillips.lean b/Counterexamples/Phillips.lean index 94f3be62695b36..24fb529f45154e 100644 --- a/Counterexamples/Phillips.lean +++ b/Counterexamples/Phillips.lean @@ -288,13 +288,13 @@ theorem exists_discrete_support_nonpos (f : BoundedAdditiveMeasure α) : simp only [u, not_exists, mem_iUnion, mem_diff] tauto · congr 1 - simp only [G, s, Function.iterate_succ', Subtype.coe_mk, union_diff_left, Function.comp] + simp only [G, s, Function.iterate_succ', union_diff_left, Function.comp] have I2 : ∀ n : ℕ, (n : ℝ) * (ε / 2) ≤ f ↑(s n) := by intro n induction n with | zero => simp only [s, empty, BoundedAdditiveMeasure.empty, id, Nat.cast_zero, zero_mul, - Function.iterate_zero, Subtype.coe_mk, le_rfl] + Function.iterate_zero, le_rfl] | succ n IH => have : (s (n + 1)).1 = (s (n + 1)).1 \ (s n).1 ∪ (s n).1 := by simpa only [s, Function.iterate_succ', union_diff_self] diff --git a/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean b/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean index 4a9c213dd49407..24e93c2187951b 100644 --- a/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean +++ b/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean @@ -217,6 +217,7 @@ theorem f111 : ofLex (Finsupp.single (1 : F) (1 : F)) 1 = 1 := theorem f110 : ofLex (Finsupp.single (1 : F) (1 : F)) 0 = 0 := single_apply_eq_zero.mpr fun h => h.symm +set_option backward.isDefEq.respectTransparency false in /-- Here we see that (not-necessarily strict) monotonicity of addition on `Lex (F →₀ F)` is not a consequence of monotonicity of addition on `F`. Strict monotonicity of addition on `F` is enough and is the content of `Finsupp.Lex.addLeftStrictMono`. -/ diff --git a/Mathlib/Algebra/Algebra/Epi.lean b/Mathlib/Algebra/Algebra/Epi.lean index 52f7f61ab1ba33..8e114e11a53858 100644 --- a/Mathlib/Algebra/Algebra/Epi.lean +++ b/Mathlib/Algebra/Algebra/Epi.lean @@ -122,6 +122,7 @@ section Module variable (M : Type*) [AddCommMonoid M] [Module R M] [Module A M] [IsScalarTower R A M] +set_option backward.isDefEq.respectTransparency false in /-- If an `R`-algebra `A` is epi, then the scalar multiplication `A ⊗[R] M → M` is injective, for any `A`-module `M`. -/ lemma injective_lift_lsmul : diff --git a/Mathlib/Algebra/Algebra/Equiv.lean b/Mathlib/Algebra/Algebra/Equiv.lean index e079099d6851dc..118a8b62bb0fcf 100644 --- a/Mathlib/Algebra/Algebra/Equiv.lean +++ b/Mathlib/Algebra/Algebra/Equiv.lean @@ -885,6 +885,7 @@ variable {R S M₁ M₂ : Type*} [CommSemiring R] [AddCommMonoid M₁] [Module R [SMulCommClass S R M₁] [SMulCommClass S R M₂] [SMul R S] [IsScalarTower R S M₁] [IsScalarTower R S M₂] +set_option backward.isDefEq.respectTransparency false in variable (R) in /-- A linear equivalence of two modules induces an equivalence of algebras of their endomorphisms. -/ diff --git a/Mathlib/Algebra/Algebra/NonUnitalHom.lean b/Mathlib/Algebra/Algebra/NonUnitalHom.lean index e6728c9cba175c..5679f20a0291a9 100644 --- a/Mathlib/Algebra/Algebra/NonUnitalHom.lean +++ b/Mathlib/Algebra/Algebra/NonUnitalHom.lean @@ -317,6 +317,7 @@ theorem coe_inverse (f : A →ₙₐ[R] B₁) (g : B₁ → A) (h₁ : Function. (h₂ : Function.RightInverse g f) : (inverse f g h₁ h₂ : B₁ → A) = g := rfl +set_option backward.isDefEq.respectTransparency false in /-- The inverse of a bijective morphism is a morphism. -/ def inverse' (f : A →ₛₙₐ[φ] B) (g : B → A) (k : Function.RightInverse φ' φ) @@ -368,6 +369,7 @@ def snd : A × B →ₙₐ[R] B where variable {R A B} variable [DistribMulAction R C] +set_option backward.isDefEq.respectTransparency false in /-- The prod of two morphisms is a morphism. -/ @[simps toFun] def prod (f : A →ₙₐ[R] B) (g : A →ₙₐ[R] C) : A →ₙₐ[R] B × C where diff --git a/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean b/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean index dcfd2f8b8f8e02..9d588a0906ed3b 100644 --- a/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean +++ b/Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean @@ -998,6 +998,8 @@ instance instIsMulCommutative_iSup {ι : Type*} [Nonempty ι] [Preorder ι] [IsD IsMulCommutative (⨆ i, S i : NonUnitalSubalgebra R A) := isMulCommutative_iSup S.monotone.directed_le +-- TODO: fails since `Set.Mem` is implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in /-- Define an algebra homomorphism on a directed supremum of non-unital subalgebras by defining it on each non-unital subalgebra, and proving that it agrees on the intersection of non-unital subalgebras. -/ diff --git a/Mathlib/Algebra/Algebra/Operations.lean b/Mathlib/Algebra/Algebra/Operations.lean index 54267e7ffb5618..8b112a4b10b6bf 100644 --- a/Mathlib/Algebra/Algebra/Operations.lean +++ b/Mathlib/Algebra/Algebra/Operations.lean @@ -719,6 +719,7 @@ noncomputable def span.ringHom : SetSemiring A →+* Submodule R A where map_add' := span_union map_mul' s t := by simp_rw [SetSemiring.down_mul, span_mul_span] +set_option backward.isDefEq.respectTransparency false in variable (R) in /-- `(span R {·})` as a `MonoidWithZeroHom`. -/ noncomputable def spanSingleton : A →*₀ Submodule R A where diff --git a/Mathlib/Algebra/Algebra/Opposite.lean b/Mathlib/Algebra/Algebra/Opposite.lean index d9099b935aeaef..7d43b1c00a569b 100644 --- a/Mathlib/Algebra/Algebra/Opposite.lean +++ b/Mathlib/Algebra/Algebra/Opposite.lean @@ -41,6 +41,7 @@ variable [IsScalarTower R S A] namespace MulOpposite +set_option backward.isDefEq.respectTransparency false in instance instAlgebra : Algebra R Aᵐᵒᵖ where algebraMap := (algebraMap R A).toOpposite fun _ _ => Algebra.commutes _ _ smul_def' c x := unop_injective <| by diff --git a/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean b/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean index 352921912f0081..33014156b0979c 100644 --- a/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean +++ b/Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean @@ -268,6 +268,7 @@ instance quasispectrum.instZero [Nontrivial R] (a : A) : Zero (quasispectrum R a variable {R} +set_option backward.isDefEq.respectTransparency false in /-- A version of `NonUnitalAlgHom.quasispectrum_apply_subset` which allows for `quasispectrum R`, where `R` is a *semi*ring, but `φ` must still function over a scalar ring `S`. In this case, we need `S` to be explicit. The primary use case is, for instance, `R := ℝ≥0` and `S := ℝ` or diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean b/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean index 89b7e8ae8207bd..077b910955228c 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Basic.lean @@ -287,7 +287,7 @@ instance toCommRing {R A} [CommRing R] [CommRing A] [Algebra R A] (S : Subalgebr end /-- The forgetful map from `Subalgebra` to `Submodule` as an `OrderEmbedding` -/ -@[implicit_reducible] -- Not `@[reducible]` because it is an order embedding rather than a function. +@[instance_reducible] -- Not `@[reducible]` because it is an order embedding rather than a function. def toSubmodule : Subalgebra R A ↪o Submodule R A where toEmbedding := { toFun := fun S => diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean b/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean index 9f7129dabe3f2b..9780adb8d58823 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Directed.lean @@ -51,6 +51,8 @@ instance instIsMulCommutative_iSup [Preorder ι] [IsDirectedOrder ι] variable (K) +-- TODO: `respectTransparency.types false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in /-- Define an algebra homomorphism on a directed supremum of subalgebras by defining it on each subalgebra, and proving that it agrees on the intersection of subalgebras. -/ noncomputable def iSupLift (dir : Directed (· ≤ ·) K) (f : ∀ i, K i →ₐ[R] B) @@ -88,6 +90,7 @@ noncomputable def iSupLift (dir : Directed (· ≤ ·) K) (f : ∀ i, K i →ₐ exact liftSup.comp (inclusion hT) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem iSupLift_inclusion {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B} {hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)} @@ -103,6 +106,7 @@ theorem iSupLift_comp_inclusion {dir : Directed (· ≤ ·) K} {f : ∀ i, K i {T : Subalgebra R A} {hT : T ≤ iSup K} {i : ι} (h : K i ≤ T) : (iSupLift K dir f hf T hT).comp (inclusion h) = f i := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem iSupLift_mk {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B} {hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)} @@ -111,6 +115,7 @@ theorem iSupLift_mk {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B} dsimp [iSupLift, inclusion] rw [Set.iUnionLift_mk] +set_option backward.isDefEq.respectTransparency false in theorem iSupLift_of_mem {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B} {hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)} {T : Subalgebra R A} {hT : T ≤ iSup K} {i : ι} (x : T) (hx : (x : A) ∈ K i) : diff --git a/Mathlib/Algebra/Algebra/ZMod.lean b/Mathlib/Algebra/Algebra/ZMod.lean index f85f479649561a..63a9d05116a9b7 100644 --- a/Mathlib/Algebra/Algebra/ZMod.lean +++ b/Mathlib/Algebra/Algebra/ZMod.lean @@ -50,7 +50,7 @@ abbrev algebra (p : ℕ) [CharP R p] : Algebra (ZMod p) R := set_option backward.isDefEq.respectTransparency false in /-- Any ring with a `ZMod p`-module structure can be upgraded to a `ZMod p`-algebra. Not an instance because this is usually not the default way, and this will cause typeclass search loop. -/ -@[implicit_reducible] +@[instance_reducible] def algebraOfModule (n : ℕ) (R : Type*) [Ring R] [Module (ZMod n) R] : Algebra (ZMod n) R := Algebra.ofModule' (proof · · |>.1) (proof · · |>.2) where proof (r : ZMod n) (x : R) : r • 1 * x = r • x ∧ x * r • 1 = r • x := by diff --git a/Mathlib/Algebra/BigOperators/Expect.lean b/Mathlib/Algebra/BigOperators/Expect.lean index 155aae5dc8a9af..be495a5b2a086f 100644 --- a/Mathlib/Algebra/BigOperators/Expect.lean +++ b/Mathlib/Algebra/BigOperators/Expect.lean @@ -280,6 +280,7 @@ end bij @[simp] lemma expect_neg_index [DecidableEq ι] [InvolutiveNeg ι] (s : Finset ι) (f : ι → M) : 𝔼 i ∈ -s, f i = 𝔼 i ∈ s, f (-i) := expect_image neg_injective.injOn +set_option backward.isDefEq.respectTransparency false in lemma _root_.map_expect {F : Type*} [FunLike F M N] [LinearMapClass F ℚ≥0 M N] (g : F) (f : ι → M) (s : Finset ι) : g (𝔼 i ∈ s, f i) = 𝔼 i ∈ s, g (f i) := by simp only [expect, map_smul, map_sum] diff --git a/Mathlib/Algebra/BigOperators/Fin.lean b/Mathlib/Algebra/BigOperators/Fin.lean index b5b9f42ae72d7e..fb46aaadf65755 100644 --- a/Mathlib/Algebra/BigOperators/Fin.lean +++ b/Mathlib/Algebra/BigOperators/Fin.lean @@ -617,6 +617,7 @@ theorem finFunctionFinEquiv_single {m n : ℕ} [NeZero m] (i : Fin n) (j : Fin m rintro x hx rw [Pi.single_eq_of_ne hx, Fin.val_zero, zero_mul] +set_option backward.isDefEq.respectTransparency false in /-- Equivalence between `∀ i : Fin m, Fin (n i)` and `Fin (∏ i : Fin m, n i)`. -/ def finPiFinEquiv {m : ℕ} {n : Fin m → ℕ} : (∀ i : Fin m, Fin (n i)) ≃ Fin (∏ i : Fin m, n i) := Equiv.ofRightInverseOfCardLE (le_of_eq <| by simp_rw [Fintype.card_pi, Fintype.card_fin]) @@ -688,6 +689,7 @@ def finSigmaFinEquiv {m : ℕ} {n : Fin m → ℕ} : (i : Fin m) × Fin (n i) _ ≃ _ := finSumFinEquiv _ ≃ _ := finCongr (Fin.sum_univ_castSucc n).symm +set_option backward.isDefEq.respectTransparency false in @[simp] theorem finSigmaFinEquiv_apply {m : ℕ} {n : Fin m → ℕ} (k : (i : Fin m) × Fin (n i)) : (finSigmaFinEquiv k : ℕ) = ∑ i : Fin k.1, n (Fin.castLE k.1.2.le i) + k.2 := by diff --git a/Mathlib/Algebra/BigOperators/Finprod.lean b/Mathlib/Algebra/BigOperators/Finprod.lean index ec2b992d915110..a5bcbc6a4c838f 100644 --- a/Mathlib/Algebra/BigOperators/Finprod.lean +++ b/Mathlib/Algebra/BigOperators/Finprod.lean @@ -395,6 +395,7 @@ theorem finprod_def (f : α → M) [Decidable (HasFiniteMulSupport f)] : rw [HasFiniteMulSupport, mulSupport_comp_eq_preimage] exact mt (fun hf => hf.of_preimage Equiv.plift.surjective) h +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem finprod_of_infinite_mulSupport {f : α → M} (hf : (mulSupport f).Infinite) : ∏ᶠ i, f i = 1 := by @@ -469,6 +470,7 @@ theorem finprod_cond_eq_prod_of_cond_iff (f : α → M) {p : α → Prop} {t : F contrapose! hxs exact (h hxs).2 hx +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem finprod_cond_ne (f : α → M) (a : α) [DecidableEq α] (hf : HasFiniteMulSupport f) : (∏ᶠ (i) (_ : i ≠ a), f i) = ∏ i ∈ hf.toFinset.erase a, f i := by @@ -501,6 +503,7 @@ theorem finprod_mem_eq_prod (f : α → M) {s : Set α} (hf : (s ∩ mulSupport ∏ᶠ i ∈ s, f i = ∏ i ∈ hf.toFinset, f i := finprod_mem_eq_prod_of_inter_mulSupport_eq _ <| by simp [inter_assoc] +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem finprod_mem_eq_prod_filter (f : α → M) (s : Set α) [DecidablePred (· ∈ s)] (hf : HasFiniteMulSupport f) : @@ -634,6 +637,7 @@ lemma finprod_zero_le_one {M α : Type*} [CommMonoidWithZero M] [PartialOrder M] -/ +set_option backward.isDefEq.respectTransparency false in /-- If the multiplicative supports of `f` and `g` are finite, then the product of `f i * g i` equals the product of `f i` multiplied by the product of `g i`. -/ @[to_additive @@ -1086,6 +1090,7 @@ lemma finprod_mem_powerset_diff_elem {f : Set α → M} {s : Set α} {a : α} (h exact finprod_mem_powerset_insert (hs.subset Set.diff_subset) (notMem_diff_of_mem (Set.mem_singleton a)) +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem mul_finprod_cond_ne (a : α) (hf : HasFiniteMulSupport f) : (f a * ∏ᶠ (i) (_ : i ≠ a), f i) = ∏ᶠ i, f i := by @@ -1263,6 +1268,7 @@ theorem finsum_mem_mul {R : Type*} [NonUnitalNonAssocSemiring R] [NoZeroDivisors ext a by_cases h : a ∈ s <;> simp_all +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma finprod_apply {α ι : Type*} {f : ι → α → N} (hf : HasFiniteMulSupport f) (a : α) : (∏ᶠ i, f i) a = ∏ᶠ i, f i a := by @@ -1321,6 +1327,7 @@ theorem finprod_mem_finset_product₃ {γ : Type*} (s : Finset (α × β × γ)) simp_rw [finprod_mem_finset_product'] simp +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem finprod_curry (f : α × β → M) (hf : HasFiniteMulSupport f) : ∏ᶠ ab, f ab = ∏ᶠ (a) (b), f (a, b) := by diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean index df6800dcc64955..5bdd415f438b15 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Powerset.lean @@ -47,6 +47,7 @@ lemma prod_powerset_cons (ha : a ∉ s) (f : Finset α → β) : simp_rw [cons_eq_insert] rw [prod_powerset_insert ha, prod_attach _ fun t ↦ f (insert a t)] +set_option backward.isDefEq.respectTransparency false in /-- A product over `powerset s` is equal to the double product over sets of subsets of `s` with `#s = k`, for `k = 0, ..., #s`. -/ @[to_additive /-- A sum over `powerset s` is equal to the double sum over sets of subsets of `s` diff --git a/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean b/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean index a4f7d95f92c9c3..515bc522bec882 100644 --- a/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean +++ b/Mathlib/Algebra/BigOperators/Group/Multiset/Basic.lean @@ -195,6 +195,7 @@ theorem prod_map_inv : (m.map fun i => (f i)⁻¹).prod = (m.map f).prod⁻¹ := theorem prod_map_div : (m.map fun i => f i / g i).prod = (m.map f).prod / (m.map g).prod := m.prod_hom₂ (· / ·) mul_div_mul_comm (div_one _) _ _ +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem prod_map_zpow {n : ℤ} : (m.map fun i => f i ^ n).prod = (m.map f).prod ^ n := by convert! (m.map f).prod_hom (zpowGroupHom n : G →* G) diff --git a/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean b/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean index 161fd1db9edb53..ea97561f206602 100644 --- a/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean +++ b/Mathlib/Algebra/BigOperators/GroupWithZero/Finset.lean @@ -77,6 +77,7 @@ lemma prod_boole : ∏ i, (ite (p i) 1 0 : M₀) = ite (∀ i, p i) 1 0 := by si end Fintype +set_option backward.isDefEq.respectTransparency false in lemma Units.mk0_prod [CommGroupWithZero G₀] (s : Finset ι) (f : ι → G₀) (h) : Units.mk0 (∏ i ∈ s, f i) h = ∏ i ∈ s.attach, Units.mk0 (f i) fun hh ↦ h (Finset.prod_eq_zero i.2 hh) := by diff --git a/Mathlib/Algebra/BrauerGroup/Defs.lean b/Mathlib/Algebra/BrauerGroup/Defs.lean index 8b82a886f653dd..2b54517bb12e66 100644 --- a/Mathlib/Algebra/BrauerGroup/Defs.lean +++ b/Mathlib/Algebra/BrauerGroup/Defs.lean @@ -89,7 +89,7 @@ end IsBrauerEquivalent variable (K) /-- `CSA` equipped with Brauer Equivalence is indeed a setoid. -/ -@[implicit_reducible] +@[instance_reducible] def Brauer.CSA_Setoid : Setoid (CSA K) where r := IsBrauerEquivalent iseqv := IsBrauerEquivalent.is_eqv diff --git a/Mathlib/Algebra/Category/FGModuleCat/Basic.lean b/Mathlib/Algebra/Category/FGModuleCat/Basic.lean index bd7a124b616bc7..bb5e074d6f023e 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Basic.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Basic.lean @@ -192,6 +192,7 @@ variable (K : Type u) [Field K] instance (V W : FGModuleCat.{v} K) : Module.Finite K (V.obj ⟶ W.obj) := ((inferInstance : Module.Finite K (V →ₗ[K] W))).equiv ModuleCat.homLinearEquiv.symm +set_option backward.isDefEq.respectTransparency.types false in instance (V W : FGModuleCat.{v} K) : Module.Finite K (V ⟶ W) := ((inferInstance : Module.Finite K (V.obj ⟶ W.obj))).equiv InducedCategory.homLinearEquiv.symm diff --git a/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean b/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean index 57f060aa8d6d3d..3f651e84df2be2 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Colimits.lean @@ -47,7 +47,7 @@ instance (F : J ⥤ FGModuleCat k) : ((ModuleCat.epi_iff_surjective _).1 inferInstance) /-- The forgetful functor from `FGModuleCat k` to `ModuleCat k` creates all finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def forget₂CreatesColimit (F : J ⥤ FGModuleCat k) : CreatesColimit F (forget₂ (FGModuleCat k) (ModuleCat.{v} k)) := createsColimitOfFullyFaithfulOfIso diff --git a/Mathlib/Algebra/Category/FGModuleCat/Limits.lean b/Mathlib/Algebra/Category/FGModuleCat/Limits.lean index b69d9069967393..76acb6a4d3fff6 100644 --- a/Mathlib/Algebra/Category/FGModuleCat/Limits.lean +++ b/Mathlib/Algebra/Category/FGModuleCat/Limits.lean @@ -55,7 +55,7 @@ instance (F : J ⥤ FGModuleCat k) : ((ModuleCat.mono_iff_injective _).1 inferInstance) /-- The forgetful functor from `FGModuleCat k` to `ModuleCat k` creates all finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def forget₂CreatesLimit (F : J ⥤ FGModuleCat k) : CreatesLimit F (forget₂ (FGModuleCat k) (ModuleCat.{v} k)) := createsLimitOfFullyFaithfulOfIso diff --git a/Mathlib/Algebra/Category/Grp/Abelian.lean b/Mathlib/Algebra/Category/Grp/Abelian.lean index 7c562be12b48e8..8149f6ee485631 100644 --- a/Mathlib/Algebra/Category/Grp/Abelian.lean +++ b/Mathlib/Algebra/Category/Grp/Abelian.lean @@ -29,13 +29,13 @@ namespace AddCommGrpCat variable {X Y Z : AddCommGrpCat.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) /-- In the category of abelian groups, every monomorphism is normal. -/ -@[implicit_reducible] +@[instance_reducible] def normalMono (_ : Mono f) : NormalMono f := equivalenceReflectsNormalMono (forget₂ (ModuleCat.{u} ℤ) AddCommGrpCat.{u}).inv <| ModuleCat.normalMono _ inferInstance /-- In the category of abelian groups, every epimorphism is normal. -/ -@[implicit_reducible] +@[instance_reducible] def normalEpi (_ : Epi f) : NormalEpi f := equivalenceReflectsNormalEpi (forget₂ (ModuleCat.{u} ℤ) AddCommGrpCat.{u}).inv <| ModuleCat.normalEpi _ inferInstance diff --git a/Mathlib/Algebra/Category/Grp/Colimits.lean b/Mathlib/Algebra/Category/Grp/Colimits.lean index 7ff1fa394848fa..1d3448264ffa4f 100644 --- a/Mathlib/Algebra/Category/Grp/Colimits.lean +++ b/Mathlib/Algebra/Category/Grp/Colimits.lean @@ -126,8 +126,7 @@ lemma quotToQuotUlift_ι [DecidableEq J] (j : J) (x : F.obj j) : dsimp [quotToQuotUlift, Quot.ι] conv_lhs => erw [AddMonoidHom.comp_apply (QuotientAddGroup.mk' (Relations F)) (DFinsupp.singleAddHom _ j), QuotientAddGroup.lift_mk'] - simp only [DFinsupp.singleAddHom_apply, DFinsupp.sumAddHom_single, AddMonoidHom.coe_comp, - Function.comp_apply] + simp only [DFinsupp.singleAddHom_apply, DFinsupp.sumAddHom_single] rfl set_option backward.defeqAttrib.useBackward true in @@ -153,6 +152,7 @@ lemma quotUliftToQuot_ι [DecidableEq J] (j : J) (x : (F ⋙ uliftFunctor.{u'}). DFinsupp.sumAddHom_single, AddMonoidHom.coe_comp, Function.comp_apply] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The additive equivalence between `Quot F` and `Quot (F ⋙ uliftFunctor.{u'})`. -/ @@ -321,7 +321,18 @@ noncomputable def cokernelIsoQuotient {G H : AddCommGrpCat.{u}} (f : G ⟶ H) : inv_hom_id := by ext x dsimp only [hom_comp, hom_ofHom, hom_zero, AddMonoidHom.coe_comp, coe_mk', - Function.comp_apply, AddMonoidHom.zero_apply, id_eq, lift_mk, hom_id, AddMonoidHom.coe_id] - exact QuotientAddGroup.induction_on (α := H) x <| cokernel.π_desc_apply f _ _ + Function.comp_apply, AddMonoidHom.zero_apply, id_eq, hom_id, AddMonoidHom.coe_id] + apply cokernel.π_desc_apply f + + -- ext x + -- dsimp only [hom_comp, hom_ofHom, hom_zero, AddMonoidHom.coe_comp, coe_mk'] + -- dsimp only [Function.comp_apply, AddMonoidHom.zero_apply, id_eq] + -- set_option backward.isDefEq.implicitBumpHO false in + -- set_option trace.Meta.isDefEq true in + -- set_option trace.Meta.Tactic.simp true in + -- dsimp only [hom_id, lift_mk] + -- set_option backward.isDefEq.implicitBumpHO true in + -- dsimp only [AddMonoidHom.coe_id] + -- exact QuotientAddGroup.induction_on (α := H) x <| cokernel.π_desc_apply f _ _ end AddCommGrpCat diff --git a/Mathlib/Algebra/Category/Grp/EpiMono.lean b/Mathlib/Algebra/Category/Grp/EpiMono.lean index 441946c54d9b03..a2c75c749693ec 100644 --- a/Mathlib/Algebra/Category/Grp/EpiMono.lean +++ b/Mathlib/Algebra/Category/Grp/EpiMono.lean @@ -134,6 +134,7 @@ theorem fromCoset_eq_of_mem_range {b : B} (hb : b ∈ f.hom.range) : example (G : Type) [Group G] (S : Subgroup G) : Set G := S +set_option backward.isDefEq.respectTransparency.types false in theorem fromCoset_ne_of_nin_range {b : B} (hb : b ∉ f.hom.range) : fromCoset ⟨b • ↑f.hom.range, b, rfl⟩ ≠ fromCoset ⟨f.hom.range, 1, one_leftCoset _⟩ := by intro r @@ -170,6 +171,7 @@ theorem τ_symm_apply_infinity : Equiv.symm τ ∞ = fromCoset ⟨f.hom.range, 1, one_leftCoset _⟩ := by rw [tau, Equiv.symm_swap, Equiv.swap_apply_right] +set_option backward.isDefEq.respectTransparency.types false in /-- Let `g : B ⟶ S(X')` be defined as such that, for any `β : B`, `g(β)` is the function sending point at infinity to point at infinity and sending coset `y` to `β • y`. -/ @@ -279,6 +281,7 @@ theorem comp_eq : (f ≫ ofHom g) = f ≫ ofHom h := by use a rw [this] +set_option backward.isDefEq.respectTransparency.types false in theorem g_ne_h (x : B) (hx : x ∉ f.hom.range) : g ≠ h := by intro r apply fromCoset_ne_of_nin_range _ hx diff --git a/Mathlib/Algebra/Category/Grp/Images.lean b/Mathlib/Algebra/Category/Grp/Images.lean index af3773c9aa8ccf..eb168c66c4ef80 100644 --- a/Mathlib/Algebra/Category/Grp/Images.lean +++ b/Mathlib/Algebra/Category/Grp/Images.lean @@ -55,6 +55,7 @@ attribute [local simp] image.fac variable {f} +set_option backward.isDefEq.respectTransparency.types false in /-- the universal property for the image factorisation -/ noncomputable def image.lift (F' : MonoFactorisation f) : image f ⟶ F'.I := ofHom @@ -77,6 +78,7 @@ noncomputable def image.lift (F' : MonoFactorisation f) : image f ⟶ F'.I := rw [(Classical.indefiniteDescription (fun z => f z = _) _).2] rfl } +set_option backward.isDefEq.respectTransparency.types false in theorem image.lift_fac (F' : MonoFactorisation f) : image.lift F' ≫ F'.m = image.ι f := by ext x change (F'.e ≫ F'.m) _ = _ diff --git a/Mathlib/Algebra/Category/Grp/Injective.lean b/Mathlib/Algebra/Category/Grp/Injective.lean index 9290f8ac559458..e49bf9d0c6de2e 100644 --- a/Mathlib/Algebra/Category/Grp/Injective.lean +++ b/Mathlib/Algebra/Category/Grp/Injective.lean @@ -32,6 +32,8 @@ universe u variable (A : Type u) [AddCommGroup A] +-- TODO: `respectTransparency.types false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in theorem Module.Baer.of_divisible [DivisibleBy A ℤ] : Module.Baer ℤ A := fun I g ↦ by rcases IsPrincipalIdealRing.principal I with ⟨m, rfl⟩ obtain rfl | h0 := eq_or_ne m 0 diff --git a/Mathlib/Algebra/Category/ModuleCat/Abelian.lean b/Mathlib/Algebra/Category/ModuleCat/Abelian.lean index 0c4cd3385802ff..54da0a7772bd94 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Abelian.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Abelian.lean @@ -29,7 +29,7 @@ namespace ModuleCat variable {R : Type u} [Ring R] {M N : ModuleCat.{v} R} (f : M ⟶ N) /-- In the category of modules, every monomorphism is normal. -/ -@[implicit_reducible] +@[instance_reducible] def normalMono (hf : Mono f) : NormalMono f where Z := of R (N ⧸ LinearMap.range f.hom) g := ofHom (LinearMap.range f.hom).mkQ @@ -51,7 +51,7 @@ def normalMono (hf : Mono f) : NormalMono f where LinearEquiv.ofEq _ _ (Submodule.ker_mkQ _).symm))) <| by ext; rfl /-- In the category of modules, every epimorphism is normal. -/ -@[implicit_reducible] +@[instance_reducible] def normalEpi (hf : Epi f) : NormalEpi f where W := of R (LinearMap.ker f.hom) g := ofHom (LinearMap.ker f.hom).subtype diff --git a/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean b/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean index e1425d1a1ac8e2..97b85215a1ee38 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean @@ -82,8 +82,8 @@ def freeHomEquiv {X : Type u} {M : ModuleCat.{u} R} : variable (R) -/-- The free-forgetful adjunction for R-modules. --/ +set_option backward.isDefEq.respectTransparency.types false in +/-- The free-forgetful adjunction for R-modules. -/ def adj : free R ⊣ forget (ModuleCat.{u} R) := Adjunction.mkOfHomEquiv { homEquiv := fun _ _ => freeHomEquiv @@ -107,6 +107,7 @@ variable [CommRing R] namespace FreeMonoidal +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical isomorphism `𝟙_ (ModuleCat R) ≅ (free R).obj (𝟙_ (Type u))`. (This should not be used directly: it is part of the implementation of the monoidal structure on the functor `free R`.) -/ @@ -122,9 +123,11 @@ def εIso : 𝟙_ (ModuleCat R) ≅ (free R).obj (𝟙_ (Type u)) where erw [Finsupp.lapply_apply, Finsupp.lsingle_apply] rw [Finsupp.single_eq_same] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma εIso_hom_one : (εIso R).hom 1 = freeMk PUnit.unit := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma εIso_inv_freeMk (x : PUnit) : (εIso R).inv (freeMk x) = 1 := by dsimp [εIso, freeMk] @@ -154,6 +157,7 @@ lemma μIso_inv_freeMk {X Y : Type u} (z : X ⊗ Y) : erw [finsuppTensorFinsupp'_symm_single_eq_single_one_tmul] end FreeMonoidal +set_option backward.isDefEq.respectTransparency.types false in open FreeMonoidal in /-- The free functor `Type u ⥤ ModuleCat R` is a monoidal functor. -/ instance : (free R).Monoidal := @@ -185,9 +189,11 @@ instance : (free R).Monoidal := open Functor.LaxMonoidal Functor.OplaxMonoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma free_ε_one : ε (free R) 1 = freeMk PUnit.unit := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma free_η_freeMk (x : PUnit) : η (free R) (freeMk x) = 1 := by apply FreeMonoidal.εIso_inv_freeMk @@ -233,6 +239,7 @@ open Finsupp -- Conceptually, it would be nice to construct this via "transport of enrichment", -- using the fact that `ModuleCat.Free R : Type ⥤ ModuleCat R` and `ModuleCat.forget` are both lax -- monoidal. This still seems difficult, so we just do it by hand. +set_option backward.isDefEq.respectTransparency.types false in instance categoryFree : Category (Free R C) where Hom := fun X Y : C => (X ⟶ Y) →₀ R id := fun X : C => Finsupp.single (𝟙 X) 1 @@ -246,6 +253,7 @@ namespace Free section +set_option backward.isDefEq.respectTransparency.types false in instance : Preadditive (Free R C) where homGroup _ _ := Finsupp.instAddCommGroup add_comp X Y Z f f' g := by @@ -257,6 +265,7 @@ instance : Preadditive (Free R C) where congr; ext r h rw [Finsupp.sum_add_index'] <;> · simp [mul_add] +set_option backward.isDefEq.respectTransparency.types false in instance : Linear R (Free R C) where homModule _ _ := Finsupp.module _ R smul_comp X Y Z r f g := by @@ -330,6 +339,7 @@ def lift (F : C ⥤ D) : Free R C ⥤ D where rw [single_comp_single _ _ f' g' r s] simp [mul_comm r s, mul_smul] +set_option backward.isDefEq.respectTransparency.types false in theorem lift_map_single (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) (r : R) : (lift R F).map (single f r) = r • F.map f := by simp @@ -347,6 +357,7 @@ instance lift_linear (F : C ⥤ D) : (lift R F).Linear R where dsimp rw [Finsupp.sum_smul_index] <;> simp [Finsupp.smul_sum, mul_smul] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The embedding into the `R`-linear completion, followed by the lift, is isomorphic to the original functor. diff --git a/Mathlib/Algebra/Category/ModuleCat/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Basic.lean index 4c29f9d53dd76d..eee3a429a6c93a 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Basic.lean @@ -524,6 +524,19 @@ def smulNatTrans : R →+* End (forget₂ (ModuleCat R) AddCommGrpCat) where { app := fun M => M.smul r naturality := fun _ _ _ => smul_naturality _ r } map_one' := by cat_disch + /- + (by + #adaptation_note /-- Prior to https://github.com/leanprover/lean4/pull/12244 + this was just `cat_disch`. -/ + simp only [End.one_def,forget₂_obj, map_one] + set_option trace.Meta.isDefEq true in + set_option trace.Meta.isDefEq.printTransparency true in + set_option trace.Meta.Tactic.simp true in + set_option trace.Meta.synthInstance true in + simp only [map_one] + simp only [forget₂_obj] + rfl_cat) + -/ map_zero' := by cat_disch map_mul' _ _ := by cat_disch map_add' _ _ := by cat_disch diff --git a/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean b/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean index ad14a41b804d9a..c63fd082e70d4d 100644 --- a/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean +++ b/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean @@ -460,6 +460,7 @@ instance mulAction : MulAction S <| (restrictScalars f).obj (of _ S) →ₗ[R] M one_smul := fun g => LinearMap.ext fun s : S => by simp mul_smul := fun (s t : S) g => LinearMap.ext fun x : S => by simp [mul_assoc] } +set_option backward.isDefEq.respectTransparency.types false in instance distribMulAction : DistribMulAction S <| (restrictScalars f).obj (of _ S) →ₗ[R] M := { CoextendScalars.mulAction f _ with smul_add := fun s g h => LinearMap.ext fun _ : S => by simp @@ -486,6 +487,7 @@ This is an implementation detail: use `(coextendScalars f).obj` instead. def obj' : ModuleCat S := of _ ((restrictScalars f).obj (of _ S) →ₗ[R] M) +set_option backward.isDefEq.respectTransparency.types false in /-- If `M, M'` are `R`-modules, then any `R`-linear map `g : M ⟶ M'` induces an `S`-linear map `(S →ₗ[R] M) ⟶ (S →ₗ[R] M')` defined by `h ↦ g ∘ h` -/ @[simps!] @@ -621,7 +623,7 @@ protected noncomputable def unit' : 𝟭 (ModuleCat S) ⟶ restrictScalars f ⋙ naturality Y Y' g := hom_ext <| LinearMap.ext fun y : Y => CoextendScalars.ext <| LinearMap.ext fun s : S => by -- Porting note (https://github.com/leanprover-community/mathlib4/issues/10745): previously simp [CoextendScalars.map_apply] - simp only [ModuleCat.hom_comp, Functor.id_map, Functor.id_obj, + simp only [Functor.id_map, Functor.id_obj, Functor.comp_map] change s • (g y) = g (s • y) rw [map_smul] @@ -1048,6 +1050,7 @@ lemma extendScalars_id_comp : erw [extendScalarsId_hom_app_one_tmul] rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma extendScalars_comp_id : (extendScalarsComp f₁₂ (RingHom.id R₂)).hom ≫ Functor.whiskerLeft _ (extendScalarsId R₂).hom ≫ diff --git a/Mathlib/Algebra/Category/ModuleCat/Descent.lean b/Mathlib/Algebra/Category/ModuleCat/Descent.lean index f5bb399eb354fd..d8fff96c019e2e 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Descent.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Descent.lean @@ -55,7 +55,7 @@ lemma ModuleCat.reflectsIsomorphisms_extendScalars_of_faithfullyFlat rwa [Module.FaithfullyFlat.lTensor_bijective_iff_bijective] at h /-- Extension of scalars by a faithfully flat ring map is comonadic. -/ -@[implicit_reducible] +@[instance_reducible] def comonadicExtendScalars (hf : f.FaithfullyFlat) : ComonadicLeftAdjoint (extendScalars f) := by have := preservesFiniteLimits_extendScalars_of_flat hf.flat diff --git a/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean index 6457b8aeb1a7ae..06ad7edb943cac 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean @@ -73,6 +73,7 @@ def d (b : B) : M := @[simp] lemma d_add (b b' : B) : D.d (b + b') = D.d b + D.d b' := by simp [d] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma d_mul (b b' : B) : D.d (b * b') = b • D.d b' + b' • D.d b := by simp [d] diff --git a/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean b/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean index 381db8f0797c9f..63b60eb1d85684 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean @@ -138,6 +138,7 @@ lemma d_app (d : M.Derivation' φ') {X : Dᵒᵖ} (a : S'.obj X) : d.d (φ'.app X a) = 0 := Derivation.d_app d _ +set_option backward.isDefEq.respectTransparency.types false in /-- The derivation relative to the morphism of commutative rings `φ'.app X` induced by a derivation relative to a morphism of presheaves of commutative rings. -/ noncomputable def app (d : M.Derivation' φ') (X : Dᵒᵖ) : (M.obj X).Derivation (φ'.app X) := diff --git a/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean b/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean index a9a88bee1e05ce..40377fdd233362 100644 --- a/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean +++ b/Mathlib/Algebra/Category/ModuleCat/EpiMono.lean @@ -51,7 +51,7 @@ theorem epi_iff_surjective : Epi f ↔ Function.Surjective f := by rw [epi_iff_range_eq_top, LinearMap.range_eq_top] /-- If the zero morphism is an epi then the codomain is trivial. -/ -@[implicit_reducible] +@[instance_reducible] def uniqueOfEpiZero (X) [h : Epi (0 : X ⟶ of R M)] : Unique M := uniqueOfSurjectiveZero X ((ModuleCat.epi_iff_surjective _).mp h) diff --git a/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean b/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean index 60c8e9cc610120..d5df26b03af575 100644 --- a/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean +++ b/Mathlib/Algebra/Category/ModuleCat/FilteredColimits.lean @@ -150,6 +150,7 @@ def coconeMorphism (j : J) : F.obj j ⟶ colimit F := map_smul' := by solve_by_elim } /-- The cocone over the proposed colimit module. -/ +@[implicit_reducible] def colimitCocone : Cocone F where pt := colimit F ι := diff --git a/Mathlib/Algebra/Category/ModuleCat/Images.lean b/Mathlib/Algebra/Category/ModuleCat/Images.lean index 0377c499e94cd6..47574ab1b4dab1 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Images.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Images.lean @@ -53,6 +53,7 @@ attribute [local simp] image.fac variable {f} +set_option backward.isDefEq.respectTransparency.types false in /-- The universal property for the image factorisation -/ noncomputable def image.lift (F' : MonoFactorisation f) : image f ⟶ F'.I := ofHom @@ -72,6 +73,7 @@ noncomputable def image.lift (F' : MonoFactorisation f) : image f ⟶ F'.I := simp_rw [F'.fac, (Classical.indefiniteDescription (fun z => f z = _) _).2] rfl } +set_option backward.isDefEq.respectTransparency.types false in theorem image.lift_fac (F' : MonoFactorisation f) : image.lift F' ≫ F'.m = image.ι f := by ext x change (F'.e ≫ F'.m) _ = _ diff --git a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean index 2f8ad3328e1090..03b9839839829d 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean @@ -40,6 +40,7 @@ lemma extendsScalars_map_rightUnitor_inv_one_tmul (M : ModuleCat R) (m : M) : letI := f.toAlgebra (extendScalars f).map (ρ_ M).inv ((1 : S) ⊗ₜ[R] m) = (1 : S) ⊗ₜ[R] (m ⊗ₜ 1) := rfl +set_option backward.isDefEq.respectTransparency.types false in open ModuleCat.MonoidalCategory in noncomputable instance : (extendScalars f).Monoidal := letI : Algebra R S := f.toAlgebra @@ -75,16 +76,19 @@ noncomputable instance : (extendScalars f).Monoidal := rw [one_smul] rfl)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma extendScalars_ε : letI := f.toAlgebra dsimp% ε (extendScalars f) = (AlgebraTensorModule.rid R S S).toModuleIso.inv := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma extendScalars_η : letI := f.toAlgebra dsimp% η (extendScalars f) = (AlgebraTensorModule.rid R S S).toModuleIso.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma extendScalars_μ (M₁ M₂ : ModuleCat R) : letI := f.toAlgebra @@ -92,6 +96,7 @@ lemma extendScalars_μ (M₁ M₂ : ModuleCat R) : (AlgebraTensorModule.distribBaseChange R S M₁ M₂).toModuleIso.inv := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma extendScalars_δ (M₁ M₂ : ModuleCat R) : letI := f.toAlgebra @@ -99,15 +104,18 @@ lemma extendScalars_δ (M₁ M₂ : ModuleCat R) : (AlgebraTensorModule.distribBaseChange R S M₁ M₂).toModuleIso.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma extendScalars_δ_tmul (M₁ M₂ : ModuleCat R) (m₁ : M₁) (m₂ : M₂) : letI := f.toAlgebra dsimp% δ (extendScalars f) M₁ M₂ (((1 : S) ⊗ₜ[R] (m₁ ⊗ₜ[R] m₂) :)) = ((1 : S) ⊗ₜ[R] m₁) ⊗ₜ[S] ((1 : S) ⊗ₜ[R] m₂) := rfl +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance : (restrictScalars f).LaxMonoidal := (extendRestrictScalarsAdj f).rightAdjointLaxMonoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma restrictScalars_η (r : R) : ε (restrictScalars f) r = f r := by diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean index b2d94c8c704d37..3f9b9844829d20 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf.lean @@ -193,6 +193,7 @@ lemma ofPresheaf_presheaf : (ofPresheaf M map_smul).presheaf = M := rfl end +set_option backward.isDefEq.respectTransparency.types false in /-- The morphism of presheaves of modules `M₁ ⟶ M₂` given by a morphism of abelian presheaves `M₁.presheaf ⟶ M₂.presheaf` which satisfy a suitable linearity condition. -/ @@ -318,6 +319,7 @@ lemma sections_ext {M : PresheafOfModules.{v} R} (s t : M.sections) (h : ∀ (X : Cᵒᵖ), s.val X = t.val X) : s = t := Subtype.ext (by ext; apply h) +set_option backward.isDefEq.respectTransparency.types false in /-- The map `M.sections → N.sections` induced by a morphisms `M ⟶ N` of presheaves of modules. -/ @[simps!] def sectionsMap {M N : PresheafOfModules.{v} R} (f : M ⟶ N) (s : M.sections) : N.sections := @@ -398,6 +400,7 @@ noncomputable def forgetToPresheafModuleCatObjMap {Y Z : Cᵒᵖ} (f : Y ⟶ Z) lemma forgetToPresheafModuleCatObjMap_apply {Y Z : Cᵒᵖ} (f : Y ⟶ Z) (m : M.obj Y) : (forgetToPresheafModuleCatObjMap X hX M f).hom m = M.map f m := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Implementation of the functor `PresheafOfModules R ⥤ Cᵒᵖ ⥤ ModuleCat (R.obj X)` when `X` is initial. @@ -437,6 +440,7 @@ noncomputable def forgetToPresheafModuleCatMap ext x exact naturality_apply f g x +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from presheaves of modules over a presheaf of rings `R` to presheaves of `R(X)`-modules where `X` is an initial object. diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/ColimitFunctor.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/ColimitFunctor.lean index 9f4ea88b2bab53..226ca278563546 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/ColimitFunctor.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/ColimitFunctor.lean @@ -52,7 +52,7 @@ noncomputable def constFunctor : ModuleCat cR.pt ⥤ PresheafOfModules.{w} R whe { obj X := (ModuleCat.restrictScalars (cR.ι.app X).hom).obj M map {X Y} f := (ModuleCat.restrictScalarsComp' _ _ _ - (by ext; dsimp; rw [← Cocone.w cR f]; dsimp; rfl)).hom.app _ } + (by ext; dsimp; rw [← Cocone.w cR f]; dsimp)).hom.app _ } map φ := { app X := (ModuleCat.restrictScalars (cR.ι.app X).hom).map φ } section @@ -221,6 +221,7 @@ lemma homEquiv'_symm_apply {N : ModuleCat.{w} cR.pt} (homEquiv' hcR hcM).symm β (cM.ι.app X x) = β.app X x := ConcreteCategory.congr_hom (hcM.ι_app_homEquiv_symm β X) x +set_option backward.isDefEq.respectTransparency.types false in lemma map_smul_homEquiv'_iff {N : ModuleCat.{w} cR.pt} (α : ModuleColimit hcR hcM →+ N) : dsimp% (∀ (U : Cᵒᵖ) (r : R.obj U) (m : M.obj U), (homEquiv' hcR hcM α).app U (r • m) = @@ -236,6 +237,7 @@ lemma map_smul_homEquiv'_iff {N : ModuleCat.{w} cR.pt} congr 1 exact (smul_eq ..).symm +set_option backward.isDefEq.respectTransparency.types false in /-- This is the universal property of `PresheafOfModules.ModuleColimit` as a module. See also `PresheafOfModules.colimitAdjunction`. -/ noncomputable def homEquiv {N : ModuleCat.{w} cR.pt} : @@ -262,16 +264,19 @@ noncomputable def homEquiv {N : ModuleCat.{w} cR.pt} : ((homEquiv' hcR hcM).map_add ((forget₂ _ AddCommGrpCat).map φ₁).hom ((forget₂ _ AddCommGrpCat).map φ₂).hom) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma homEquiv_app_apply {N : ModuleCat.{w} cR.pt} (α : ModuleCat.of cR.pt (ModuleColimit hcR hcM) ⟶ N) {X : Cᵒᵖ} (x : M.obj X) : dsimp% (homEquiv hcR hcM α).app X x = α (cM.ι.app X x) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma homEquiv_naturality_right {N N' : ModuleCat.{w} cR.pt} (φ : ModuleCat.of cR.pt (ModuleColimit hcR hcM) ⟶ N) (g : N ⟶ N') : homEquiv hcR hcM (φ ≫ g) = homEquiv hcR hcM φ ≫ (constFunctor cR).map g := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma homEquiv_symm_apply {N : ModuleCat.{w} cR.pt} (β : M ⟶ (constFunctor cR).obj N) {X : Cᵒᵖ} (x : M.obj X) : @@ -283,6 +288,7 @@ section variable {M' : PresheafOfModules.{w} R} {cM' : Cocone M'.presheaf} (hcM' : IsColimit cM') +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The linear map between the colimit modules induced by a morphism of modules. -/ noncomputable def map (f : M ⟶ M') : @@ -299,17 +305,20 @@ noncomputable def map (f : M ⟶ M') : erw [h₁, h₂, ModuleColimit.smul_eq, ← (f.app U).hom.map_smul] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma map_apply (f : M ⟶ M') {U : Cᵒᵖ} (m : M.obj U) : dsimp% map hcR hcM hcM' f (ιM m) = ιM (f.app _ m) := ConcreteCategory.congr_hom (hcM.fac ((Cocone.precompose ((toPresheaf _).map f)).obj cM') U) m +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma map_id : map hcR hcM hcM (𝟙 M) = .id := by ext m obtain ⟨U, m, rfl⟩ := ιM_jointly_surjective m simp +set_option backward.isDefEq.respectTransparency.types false in lemma comp_map (f : M ⟶ M') {M'' : PresheafOfModules.{w} R} {cM'' : Cocone M''.presheaf} @@ -321,6 +330,7 @@ lemma comp_map end +set_option backward.isDefEq.respectTransparency.types false in lemma homEquiv_naturality_left {M' : PresheafOfModules.{w} R} {cM' : Cocone M'.presheaf} (hcM' : IsColimit cM') {N : ModuleCat.{w} cR.pt} (φ' : ModuleCat.of cR.pt (ModuleColimit hcR hcM') ⟶ N) @@ -333,6 +343,7 @@ lemma homEquiv_naturality_left {M' : PresheafOfModules.{w} R} {cM' : Cocone M'.p apply congr_arg exact map_apply hcR hcM hcM' f m +set_option backward.isDefEq.respectTransparency.types false in lemma homEquiv_naturality_left_symm {M' : PresheafOfModules.{w} R} {cM' : Cocone M'.presheaf} (hcM' : IsColimit cM') {N : ModuleCat.{w} cR.pt} (f : M ⟶ M') (g : M' ⟶ (constFunctor cR).obj N) : @@ -346,6 +357,7 @@ end ModuleColimit end +set_option backward.isDefEq.respectTransparency.types false in /-- The colimit module functor from the category of presheaves of modules over a presheaf of rings `R` on a cofiltered category to the category of modules over a colimit of `R`. -/ @@ -354,6 +366,7 @@ noncomputable def colimitFunctor : PresheafOfModules.{w} R ⥤ ModuleCat.{w} cR. map f := ModuleCat.ofHom (ModuleColimit.map _ _ _ f) map_comp f g := by ext : 1; exact (ModuleColimit.comp_map ..).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Given a presheaf of rings `R` on a cofiltered category, this is the adjunction between `colimitFunctor : PresheafOfModules R ⥤ ModuleCat cR.pt` and the constant functor. -/ @@ -364,6 +377,7 @@ noncomputable def colimitAdjunction : homEquiv_naturality_left_symm _ _ := ModuleColimit.homEquiv_naturality_left_symm _ _ _ _ _ homEquiv_naturality_right _ _ := ModuleColimit.homEquiv_naturality_right _ _ _ _ } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma colimitAdjunction_homEquiv (F : PresheafOfModules R) (G : ModuleCat cR.pt) : @@ -372,6 +386,7 @@ lemma colimitAdjunction_homEquiv (colimit.isColimit F.presheaf)).toEquiv := by simp [colimitAdjunction] +set_option backward.isDefEq.respectTransparency.types false in open ModuleColimit in lemma colimitAdjunction_homEquiv_symm_apply {F : PresheafOfModules R} {G : ModuleCat cR.pt} diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean index 9f3b41a0720b39..e31937cdc05b32 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Free.lean @@ -35,6 +35,7 @@ namespace PresheafOfModules variable {C : Type u₁} [Category.{v₁} C] (R : Cᵒᵖ ⥤ RingCat.{u}) +set_option backward.isDefEq.respectTransparency.types false in variable {R} in /-- Given a presheaf of types `F : Cᵒᵖ ⥤ Type u`, this is the presheaf of modules over `R` which sends `X : Cᵒᵖ` to the free `R.obj X`-module on `F.obj X`. -/ @@ -44,6 +45,7 @@ noncomputable def freeObj (F : Cᵒᵖ ⥤ Type u) : PresheafOfModules.{u} R whe map {X Y} f := ModuleCat.freeDesc (↾fun x ↦ ModuleCat.freeMk (F.map f x)) map_id := by aesop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The free presheaf of modules functor `(Cᵒᵖ ⥤ Type u) ⥤ PresheafOfModules.{u} R`. -/ @[simps] @@ -57,6 +59,7 @@ variable {R} variable {F : Cᵒᵖ ⥤ Type u} {G : PresheafOfModules.{u} R} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The morphism of presheaves of modules `freeObj F ⟶ G` corresponding to a morphism `F ⟶ G.presheaf ⋙ forget _` of presheaves of types. -/ @@ -105,11 +108,13 @@ noncomputable def freeAdjunction : free_hom_ext (by ext; simp [freeHomEquiv, toPresheaf]) homEquiv_naturality_right := fun {F G₁ G₂} f g ↦ rfl } +set_option backward.isDefEq.respectTransparency.types false in variable (F G) in @[simp] lemma freeAdjunction_homEquiv : (freeAdjunction R).homEquiv F G = freeHomEquiv := by simp [freeAdjunction, Adjunction.mkOfHomEquiv_homEquiv] +set_option backward.isDefEq.respectTransparency.types false in variable (R F) in @[simp] lemma freeAdjunction_unit_app : diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean index 993e866bad7cae..9f993d95a9fa0d 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Generator.lean @@ -168,6 +168,7 @@ lemma ι_fromFreeYonedaCoproduct_apply (m : M.Elements) (X : Cᵒᵖ) (x : m.fre ConcreteCategory.congr_hom ((evaluation R X ⋙ forget _).congr_map (M.ι_fromFreeYonedaCoproduct m)) x +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma fromFreeYonedaCoproduct_app_mk (m : M.Elements) : M.fromFreeYonedaCoproduct.app _ (M.freeYonedaCoproductMk m) = m.2 := by diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean index db8c9a6831aa72..074725c2a54c22 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean @@ -99,6 +99,7 @@ lemma pushforward_obj_map_apply (M : PresheafOfModules.{v} R) {X Y : Cᵒᵖ} (f (m : (ModuleCat.restrictScalars (φ.app X).hom).obj (M.obj (Opposite.op (F.obj X.unop)))) : (((pushforward φ).obj M).map f).hom m = M.map (F.map f.unop).op m := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `@[simp]`-normal form of `pushforward_obj_map_apply`. -/ @[simp] lemma pushforward_obj_map_apply' (M : PresheafOfModules.{v} R) {X Y : Cᵒᵖ} (f : X ⟶ Y) @@ -112,6 +113,7 @@ lemma pushforward_map_app_apply {M N : PresheafOfModules.{v} R} (α : M ⟶ N) ( (m : (ModuleCat.restrictScalars (φ.app X).hom).obj (M.obj (Opposite.op (F.obj X.unop)))) : (((pushforward φ).map α).app X).hom m = α.app (Opposite.op (F.obj X.unop)) m := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `@[simp]`-normal form of `pushforward_map_app_apply`. -/ @[simp] lemma pushforward_map_app_apply' {M N : PresheafOfModules.{v} R} (α : M ⟶ N) (X : Cᵒᵖ) diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean index 1be45f473ed2fc..2df2b896ffbf24 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafification.lean @@ -106,6 +106,7 @@ lemma toPresheaf_map_sheafificationHomEquiv rw [toPresheaf_map_sheafificationHomEquiv_def, Adjunction.homEquiv_unit] dsimp +set_option backward.isDefEq.respectTransparency.types false in lemma toSheaf_map_sheafificationHomEquiv_symm {P : PresheafOfModules.{v} R₀} {F : SheafOfModules.{v} R} (g : P ⟶ (restrictScalars α).obj ((SheafOfModules.forget _).obj F)) : diff --git a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean index 5319e8a1fa916a..6e1d44b598d08c 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Presheaf/Sheafify.lean @@ -57,6 +57,7 @@ variable {R₀ R : Cᵒᵖ ⥤ RingCat.{u}} (α : R₀ ⟶ R) [Presheaf.IsLocall (r₀ : FamilyOfElements (R₀ ⋙ forget _) P) (m₀ : FamilyOfElements (M₀.presheaf ⋙ forget _) P) include hA +set_option backward.isDefEq.respectTransparency.types false in lemma _root_.PresheafOfModules.Sheafify.app_eq_of_isLocallyInjective {Y : C} (r₀ r₀' : R₀.obj (Opposite.op Y)) (m₀ m₀' : M₀.obj (Opposite.op Y)) @@ -149,6 +150,7 @@ structure SMulCandidate where h ⦃Y : Cᵒᵖ⦄ (f : X ⟶ Y) (r₀ : R₀.obj Y) (hr₀ : α.app Y r₀ = R.obj.map f r) (m₀ : M₀.obj Y) (hm₀ : φ.app Y m₀ = A.obj.map f m) : A.obj.map f x = φ.app Y (r₀ • m₀) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Constructor for `SMulCandidate`. -/ def SMulCandidate.mk' (S : Sieve X.unop) (hS : S ∈ J X.unop) @@ -170,13 +172,13 @@ def SMulCandidate.mk' (S : Sieve X.unop) (hS : S ∈ J X.unop) · rw [← RingCat.comp_apply, NatTrans.naturality, RingCat.comp_apply, ha₀] apply (hr₀ _ hg).symm.trans simp - rfl · erw [NatTrans.naturality_apply φ, hb₀] apply (hm₀ _ hg).symm.trans dsimp rw [Functor.map_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in instance : Nonempty (SMulCandidate α φ r m) := ⟨by let S := (Presheaf.imageSieve α r ⊓ Presheaf.imageSieve φ m) have hS : S ∈ J _ := by @@ -224,6 +226,7 @@ lemma map_smul_eq {Y : Cᵒᵖ} (f : X ⟶ Y) (r₀ : R₀.obj Y) (hr₀ : α.ap A.obj.map f (smul α φ r m) = φ.app Y (r₀ • m₀) := (smulCandidate α φ r m).h f r₀ hr₀ m₀ hm₀ +set_option backward.isDefEq.respectTransparency.types false in protected lemma one_smul : smul α φ 1 m = m := by apply A.isSeparated _ _ (Presheaf.imageSieve_mem J φ m) rintro Y f ⟨m₀, hm₀⟩ @@ -290,7 +293,7 @@ variable (X) /-- The module structure on the sections of the sheafification of the underlying presheaf of abelian groups of a presheaf of modules. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def module : Module (R.obj.obj X) (A.obj.obj X) where smul r m := smul α φ r m one_smul := Sheafify.one_smul α φ @@ -335,6 +338,7 @@ noncomputable def toSheafify : M₀ ⟶ (restrictScalars α).obj (sheafify α φ lemma toSheafify_app_apply (X : Cᵒᵖ) (x : M₀.obj X) : ((toSheafify α φ).app X).hom x = φ.app X x := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `@[simp]`-normal form of `toSheafify_app_apply`. -/ @[simp] lemma toSheafify_app_apply' (X : Cᵒᵖ) (x : M₀.obj X) : diff --git a/Mathlib/Algebra/Category/ModuleCat/ProjectiveDimension.lean b/Mathlib/Algebra/Category/ModuleCat/ProjectiveDimension.lean index 8ceec875a545f7..45e18839de5af7 100644 --- a/Mathlib/Algebra/Category/ModuleCat/ProjectiveDimension.lean +++ b/Mathlib/Algebra/Category/ModuleCat/ProjectiveDimension.lean @@ -32,6 +32,7 @@ variable [Small.{v} R] {R' : Type u'} [CommRing R'] [Small.{v'} R'] (e : R ≃+* variable {M : ModuleCat.{v} R} {N : ModuleCat.{v'} R'} +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] RingHomInvPair.of_ringEquiv in lemma hasProjectiveDimensionLE_of_semiLinearEquiv (e' : M ≃ₛₗ[RingHomClass.toRingHom e] N) (n : ℕ) [HasProjectiveDimensionLE M n] : HasProjectiveDimensionLE N n := by diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean index c293c026fc508f..2fc74e201285de 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/ChangeOfRings.lean @@ -49,6 +49,7 @@ namespace PresheafOfModules variable {R R' : Cᵒᵖ ⥤ RingCat.{u}} (α : R ⟶ R') {M₁ M₂ : PresheafOfModules.{v} R'} +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `PresheafOfModules.restrictScalars α` induces bijections on morphisms if `α` is locally surjective and the target presheaf is a sheaf. -/ noncomputable def restrictHomEquivOfIsLocallySurjective diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean index b19bc3ec15312c..18579b9e99bffc 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Free.lean @@ -71,6 +71,7 @@ lemma freeHomEquiv_comp_apply {M N : SheafOfModules.{u} R} {I : Type u} (f : free I ⟶ M) (p : M ⟶ N) (i : I) : N.freeHomEquiv (f ≫ p) i = sectionsMap p (M.freeHomEquiv f i) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma freeHomEquiv_symm_comp {M N : SheafOfModules.{u} R} {I : Type u} (s : I → M.sections) (p : M ⟶ N) : M.freeHomEquiv.symm s ≫ p = N.freeHomEquiv.symm (fun i ↦ sectionsMap p (s i)) := @@ -85,6 +86,7 @@ lemma freeHomEquiv_apply {M : SheafOfModules.{u} R} {I : Type u} freeHomEquiv M f i = sectionsMap f (freeSection i) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma unitHomEquiv_symm_freeHomEquiv_apply {I : Type u} {M : SheafOfModules.{u} R} (f : free I ⟶ M) (i : I) : M.unitHomEquiv.symm (M.freeHomEquiv f i) = ιFree i ≫ f := by diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean index 4eecb928d058c3..ac1824d5d58403 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean @@ -182,6 +182,7 @@ lemma pushforwardNatTrans_comp (α : F ⟶ G) (β : G ⟶ H) lemma pushforwardNatTrans_app_val_app_apply (α : F ⟶ G) (X U x) : ((pushforwardNatTrans φ α).app X).val.app U x = X.val.map (α.app U.unop).op x := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism gives a natural isomorphism between the pushforward functors. -/ @[simps] diff --git a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean index 0f625950f6f968..a5600d1694c75a 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Sheaf/Quasicoherent.lean @@ -137,6 +137,7 @@ noncomputable def Presentation.ofIsIso {M N : SheafOfModules.{u} R} (f : M ⟶ N @[deprecated (since := "2026-04-15")] alias Presentation.of_isIso := Presentation.ofIsIso +set_option backward.isDefEq.respectTransparency.types false in instance {M N : SheafOfModules.{u} R} (f : M ⟶ N) [IsIso f] (σ : M.Presentation) [σ.IsFinite] : (σ.ofIsIso f).IsFinite where isFiniteType_generators := inferInstanceAs (σ.generators.ofEpi _).IsFiniteType @@ -173,6 +174,7 @@ theorem Presentation.mapRelations_mapGenerators : simp only [mapRelations, mapGenerators, Category.assoc, Iso.inv_hom_id_assoc, ← Functor.map_comp, kernel.condition, Functor.map_zero, comp_zero] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Let `F` be a functor from sheaf of `R`-module to sheaf of `S`-module, if `F` preserves colimits and `F.obj (unit R) ≅ unit S`, given a `P : Presentation M`, then we will get a @@ -329,6 +331,7 @@ instance : (isQuasicoherent R).IsClosedUnderIsomorphisms where intro ⟨⟨q⟩⟩ exact ⟨⟨q.ofIsIso e.hom⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {M N : SheafOfModules.{u} R} (f : M ⟶ N) [IsIso f] (σ : M.QuasicoherentData) [σ.IsFinitePresentation] : (σ.ofIsIso f).IsFinitePresentation where diff --git a/Mathlib/Algebra/Category/MonCat/Colimits.lean b/Mathlib/Algebra/Category/MonCat/Colimits.lean index 2299758562eaf6..f621e777b17200 100644 --- a/Mathlib/Algebra/Category/MonCat/Colimits.lean +++ b/Mathlib/Algebra/Category/MonCat/Colimits.lean @@ -187,7 +187,7 @@ def descFun (s : Cocone F) : ColimitType F → s.pt := by | refl x => rfl | symm x y _ h => exact h.symm | trans x y z _ _ h₁ h₂ => exact h₁.trans h₂ - | map j j' f x => exact s.w_apply f x + | map j j' f x => simp | mul j x y => exact map_mul (s.ι.app j).hom x y | one j => exact map_one (s.ι.app j).hom | mul_1 x x' y _ h => exact congr_arg (· * _) h diff --git a/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean b/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean index 7bd13a893314d7..420df3d212a76d 100644 --- a/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean +++ b/Mathlib/Algebra/Category/MonCat/FilteredColimits.lean @@ -258,6 +258,8 @@ noncomputable def colimitDesc (t : Cocone F) : colimit.{v, u} F ⟶ t.pt := rw [colimit_mul_mk_eq F ⟨i, x⟩ ⟨j, y⟩ (max' i j) (IsFiltered.leftToMax i j) (IsFiltered.rightToMax i j)] dsimp + -- for the implicit bump in HO positions + set_option backward.isDefEq.respectTransparency true in rw [map_mul, t.w_apply, t.w_apply] } /-- The proposed colimit cocone is a colimit in `MonCat`. -/ diff --git a/Mathlib/Algebra/Category/Ring/Adjunctions.lean b/Mathlib/Algebra/Category/Ring/Adjunctions.lean index c33f16a3eefec6..80c50c1d6a31da 100644 --- a/Mathlib/Algebra/Category/Ring/Adjunctions.lean +++ b/Mathlib/Algebra/Category/Ring/Adjunctions.lean @@ -85,6 +85,7 @@ set_option backward.isDefEq.respectTransparency false in def coyonedaUnique {n : Type v} [Unique n] : coyoneda.obj (op n) ≅ 𝟭 CommRingCat.{max u v} := NatIso.ofComponents (fun X ↦ (RingEquiv.piUnique _).toCommRingCatIso) (fun f ↦ by ext; simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The monoid algebra functor `CommGrpCat ⥤ R-Alg` given by `G ↦ R[G]`. -/ @[simps] diff --git a/Mathlib/Algebra/Category/Ring/Constructions.lean b/Mathlib/Algebra/Category/Ring/Constructions.lean index 1857f13160b8ab..8d8d184fc092e5 100644 --- a/Mathlib/Algebra/Category/Ring/Constructions.lean +++ b/Mathlib/Algebra/Category/Ring/Constructions.lean @@ -357,6 +357,7 @@ def equalizerForkIsLimit : IsLimit (equalizerFork f g) := by ext x exact Subtype.ext <| RingHom.congr_fun (congrArg Hom.hom hm) x +set_option backward.isDefEq.respectTransparency.types false in instance : IsLocalHom (equalizerFork f g).ι.hom := by constructor rintro ⟨a, h₁ : _ = _⟩ (⟨⟨x, y, h₃, h₄⟩, rfl : x = _⟩ : IsUnit a) @@ -367,6 +368,7 @@ instance : IsLocalHom (equalizerFork f g).ι.hom := by rw [isUnit_iff_exists_inv] exact ⟨⟨y, this⟩, Subtype.ext h₃⟩ +set_option backward.isDefEq.respectTransparency.types false in @[instance] theorem equalizer_ι_isLocalHom (F : WalkingParallelPair ⥤ CommRingCat.{u}) : IsLocalHom (limit.π F WalkingParallelPair.zero).hom := by diff --git a/Mathlib/Algebra/Category/Ring/FinitePresentation.lean b/Mathlib/Algebra/Category/Ring/FinitePresentation.lean index a6af210fb9b3b5..42dd804b8b0657 100644 --- a/Mathlib/Algebra/Category/Ring/FinitePresentation.lean +++ b/Mathlib/Algebra/Category/Ring/FinitePresentation.lean @@ -139,6 +139,7 @@ lemma RingHom.EssFiniteType.exists_eq_comp_ι_app_of_isColimit (hf : f.hom.Finit rw [c.w, hg'] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `S` is a finitely presented `R`-algebra, then `Hom_R(S, -)` preserves filtered colimits. -/ lemma CommRingCat.preservesColimit_coyoneda_of_finitePresentation diff --git a/Mathlib/Algebra/Category/Ring/Under/Basic.lean b/Mathlib/Algebra/Category/Ring/Under/Basic.lean index 02bc2f62ae8b53..378eac1234c29c 100644 --- a/Mathlib/Algebra/Category/Ring/Under/Basic.lean +++ b/Mathlib/Algebra/Category/Ring/Under/Basic.lean @@ -93,6 +93,7 @@ end AlgHom namespace AlgEquiv +set_option backward.isDefEq.respectTransparency.types false in /-- Make an isomorphism in `Under R` from an algebra isomorphism. -/ def toUnder {A B : Type u} [CommRing A] [CommRing B] [Algebra R A] [Algebra R B] (f : A ≃ₐ[R] B) : diff --git a/Mathlib/Algebra/Category/Ring/Under/Property.lean b/Mathlib/Algebra/Category/Ring/Under/Property.lean index 630f31d646a012..d58aa65795a2e8 100644 --- a/Mathlib/Algebra/Category/Ring/Under/Property.lean +++ b/Mathlib/Algebra/Category/Ring/Under/Property.lean @@ -34,6 +34,7 @@ variable {Q : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop open MorphismProperty +set_option backward.isDefEq.respectTransparency.types false in lemma RingHom.HasFiniteProducts.isClosedUnderLimitsOfShape (hQi : RespectsIso Q) (hQp : HasFiniteProducts Q) (R : CommRingCat.{u}) : (toMorphismProperty Q).underObj (X := R).IsClosedUnderFiniteProducts := by @@ -47,6 +48,7 @@ lemma RingHom.HasFiniteProducts.isClosedUnderLimitsOfShape (hQi : RespectsIso Q) rw [underObj_iff, ← Under.w e.inv, (toMorphismProperty Q).cancel_right_of_respectsIso] exact hQp _ fun i ↦ hpres _ +set_option backward.isDefEq.respectTransparency.types false in lemma RingHom.HasEqualizers.isClosedUnderLimitsOfShape (hQi : RespectsIso Q) (hQe : HasEqualizers Q) (R : CommRingCat.{u}) : (toMorphismProperty Q).underObj (X := R).IsClosedUnderLimitsOfShape WalkingParallelPair := by @@ -67,7 +69,7 @@ lemma RingHom.HasEqualizers.isClosedUnderLimitsOfShape (hQi : RespectsIso Q) /-- If `Q` is stable under finite products, the inclusion from the subcategory of `Under R` defined by `Q` creates finite products. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def RingHom.HasFiniteProducts.createsFiniteProductsForget (hQi : RespectsIso Q) (hQp : HasFiniteProducts Q) (R : CommRingCat.{u}) : CreatesFiniteProducts (MorphismProperty.Under.forget (toMorphismProperty Q) ⊤ R) := by @@ -97,7 +99,7 @@ lemma RingHom.HasFiniteProducts.preservesFiniteProducts_pushout (hQi : RingHom.R /-- If `Q` is stable under equalizers, the inclusion from the subcategory of `Under R` defined by `Q` creates equalizers. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def RingHom.HasEqualizers.createsLimitsWalkingParallelPair (hQi : RespectsIso Q) (hQe : HasEqualizers Q) (R : CommRingCat.{u}) : CreatesLimitsOfShape WalkingParallelPair @@ -116,7 +118,7 @@ namespace CommRingCat /-- If `Q` is stable under finite products and equalizers, the inclusion from the subcategory of `Under R` defined by `Q` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Under.createsFiniteLimitsForget (hQi : RingHom.RespectsIso Q) (hQp : RingHom.HasFiniteProducts Q) (hQe : RingHom.HasEqualizers Q) (R : CommRingCat.{u}) : CreatesFiniteLimits (Under.forget (RingHom.toMorphismProperty Q) ⊤ R) := @@ -139,6 +141,7 @@ open RingHom variable {P} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma CommRingCat.preservesLimit_parallelPair_tensorProd_iff_tensorEqualizer_bijective {R S : CommRingCat.{u}} [Algebra R S] {A B : Under R} {f g : A ⟶ B} : diff --git a/Mathlib/Algebra/Central/Basic.lean b/Mathlib/Algebra/Central/Basic.lean index 3f810abca4111e..cff2802cb3df12 100644 --- a/Mathlib/Algebra/Central/Basic.lean +++ b/Mathlib/Algebra/Central/Basic.lean @@ -59,6 +59,7 @@ lemma baseField_essentially_unique obtain ⟨x', H⟩ := H exact ⟨x', (algebraMap K D).injective <| by simp [← H, algebraMap_eq_smul_one]⟩ +set_option backward.isDefEq.respectTransparency false in lemma of_algEquiv (e : D ≃ₐ[K] D') : IsCentral K D' where out x hx := have ⟨k, hk⟩ := h.1 ((MulEquivClass.apply_mem_center_iff e.symm).mpr hx) diff --git a/Mathlib/Algebra/CharP/Invertible.lean b/Mathlib/Algebra/CharP/Invertible.lean index 7b36b94527fc62..32b80af34abb81 100644 --- a/Mathlib/Algebra/CharP/Invertible.lean +++ b/Mathlib/Algebra/CharP/Invertible.lean @@ -56,7 +56,7 @@ theorem CharP.natCast_gcdA_mul_intCast_eq_gcd (n : ℕ) : /-- In a ring of characteristic `p`, `(n : R)` is invertible when `n` is coprime with `p`, with inverse `n.gcdA p`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfCoprime {n : ℕ} (h : n.Coprime p) : Invertible (n : R) where invOf := n.gcdA p @@ -93,13 +93,13 @@ variable [Semifield K] /-- A natural number `t` is invertible in a semifield `K` if the characteristic of `K` does not divide `t`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfRingCharNotDvd {t : ℕ} (not_dvd : ¬ringChar K ∣ t) : Invertible (t : K) := invertibleOfNonzero fun h => not_dvd ((ringChar.spec K t).mp h) /-- A natural number `t` is invertible in a semifield `K` of characteristic `p` if `p` does not divide `t`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfCharPNotDvd {p : ℕ} [CharP K p] {t : ℕ} (not_dvd : ¬p ∣ t) : Invertible (t : K) := invertibleOfNonzero fun h => not_dvd ((CharP.cast_eq_zero_iff K p t).mp h) diff --git a/Mathlib/Algebra/CharP/MixedCharZero.lean b/Mathlib/Algebra/CharP/MixedCharZero.lean index 6d184970dc9fdb..9d851e9f94fb9d 100644 --- a/Mathlib/Algebra/CharP/MixedCharZero.lean +++ b/Mathlib/Algebra/CharP/MixedCharZero.lean @@ -214,7 +214,7 @@ private lemma pnatCast_eq_natCast [Fact (∀ I : Ideal R, I ≠ ⊤ → CharZero simp only [IsUnit.unit_spec] /-- Equal characteristic implies `ℚ`-algebra. -/ -@[implicit_reducible] +@[instance_reducible] private noncomputable def algebraRat (h : ∀ I : Ideal R, I ≠ ⊤ → CharZero (R ⧸ I)) : Algebra ℚ R := haveI : Fact (∀ I : Ideal R, I ≠ ⊤ → CharZero (R ⧸ I)) := ⟨h⟩ diff --git a/Mathlib/Algebra/Colimit/DirectLimit.lean b/Mathlib/Algebra/Colimit/DirectLimit.lean index 155c886395e868..58a23981940048 100644 --- a/Mathlib/Algebra/Colimit/DirectLimit.lean +++ b/Mathlib/Algebra/Colimit/DirectLimit.lean @@ -628,6 +628,7 @@ lemma map₀_algebraMap (i : ι) (r : R) : map₀ f (fun i ↦ algebraMap R (G i) r) = ⟦⟨i, algebraMap R (G i) r⟩⟧ := map₀_def _ _ (fun _ _ _ => AlgHomClass.commutes _ _) i +set_option backward.isDefEq.respectTransparency.types false in instance : Algebra R (DirectLimit G f) where algebraMap := map₀RingHom (f := f).comp (algebraMap R (∀ i, G i)) commutes' r := DirectLimit.induction f fun i _ ↦ by @@ -637,6 +638,7 @@ instance : Algebra R (DirectLimit G f) where dsimp [Pi.algebraMap_def, map₀RingHom] rw [smul_def, map₀_algebraMap i, mul_def, Algebra.smul_def'] +set_option backward.isDefEq.respectTransparency.types false in lemma algebraMap_def (i : ι) (r : R) : algebraMap R (DirectLimit G f) r = ⟦⟨i, algebraMap R (G i) r⟩⟧:= map₀_algebraMap i r @@ -837,6 +839,7 @@ variable [∀ i, Semiring (G i)] [∀ i, Algebra R (G i)] variable [∀ i j h, AlgHomClass (T h) R (G i) (G j)] variable [Nonempty ι] +set_option backward.isDefEq.respectTransparency.types false in variable (G f) in /-- The canonical map from a component to the direct limit. -/ @[simps] @@ -845,10 +848,12 @@ def of (i) : G i →ₐ[R] DirectLimit G f where __ := (DirectLimit.Ring.of G f i) commutes' r := by rw [algebraMap_def i] +set_option backward.isDefEq.respectTransparency.types false in lemma of_f {i j} (hij) (x) : of G f j (f i j hij x) = of G f i x := .symm <| eq_of_le .. variable (P : Type*) [Semiring P] [Algebra R P] +set_option backward.isDefEq.respectTransparency.types false in variable (G f) in /-- The universal property of the direct limit: maps from the components to another R-algebra that respect the directed system structure (i.e. make some diagram commute) give rise @@ -870,6 +875,7 @@ theorem lift_comp_of {i} : (lift G f P g Hg).comp (of G f i) = g i := rfl theorem lift_of (i x) : lift G f P g Hg (of G f i x) = g i x := rfl +set_option backward.isDefEq.respectTransparency.types false in @[ext] theorem hom_ext {g₁ g₂ : DirectLimit G f →ₐ[R] P} (h : ∀ i, g₁.comp (of G f i) = g₂.comp (of G f i)) : diff --git a/Mathlib/Algebra/Colimit/Finiteness.lean b/Mathlib/Algebra/Colimit/Finiteness.lean index 0730c41a1b9bd6..1fad3193792e28 100644 --- a/Mathlib/Algebra/Colimit/Finiteness.lean +++ b/Mathlib/Algebra/Colimit/Finiteness.lean @@ -54,6 +54,7 @@ noncomputable def equiv : DirectLimit _ (fgSystem R M) ≃ₗ[R] M := variable {R M} +set_option backward.isDefEq.respectTransparency.types false in lemma equiv_comp_of (N : {N : Submodule R M // N.FG}) : (equiv R M).toLinearMap ∘ₗ of _ _ _ _ N = N.1.subtype := by ext; simp [equiv] diff --git a/Mathlib/Algebra/Colimit/Module.lean b/Mathlib/Algebra/Colimit/Module.lean index 55ff912d75383f..790a96c7537728 100644 --- a/Mathlib/Algebra/Colimit/Module.lean +++ b/Mathlib/Algebra/Colimit/Module.lean @@ -408,6 +408,7 @@ lemma map_comp (g₁ : (i : ι) → G i →+ G' i) (g₂ : (i : ι) → G' i → DirectLimit G f →+ DirectLimit G'' f'') := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in /-- Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence @@ -424,12 +425,14 @@ def congr (e : (i : ι) → G i ≃+ G' i) simp [← eq1]) (by simp [map_comp]) (by simp [map_comp]) +set_option backward.isDefEq.respectTransparency.types false in lemma congr_apply_of (e : (i : ι) → G i ≃+ G' i) (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i)) {i : ι} (g : G i) : congr e he (of G f i g) = of G' f' i (e i g) := map_apply_of _ he _ +set_option backward.isDefEq.respectTransparency.types false in lemma congr_symm_apply_of (e : (i : ι) → G i ≃+ G' i) (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i)) {i : ι} (g : G' i) : diff --git a/Mathlib/Algebra/Colimit/Ring.lean b/Mathlib/Algebra/Colimit/Ring.lean index ed479e03486171..f6ee9b3d00d210 100644 --- a/Mathlib/Algebra/Colimit/Ring.lean +++ b/Mathlib/Algebra/Colimit/Ring.lean @@ -256,6 +256,7 @@ lemma map_comp (g₁ : (i : ι) → G i →+* G' i) (g₂ : (i : ι) → G' i DirectLimit G (fun _ _ h ↦ f _ _ h) →+* DirectLimit G'' fun _ _ h ↦ f'' _ _ h) := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in /-- Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence @@ -279,6 +280,7 @@ lemma congr_apply_of (e : (i : ι) → G i ≃+* G' i) congr e he (of G _ i g) = of G' (fun _ _ h ↦ f' _ _ h) i (e i g) := map_apply_of _ he _ +set_option backward.isDefEq.respectTransparency.types false in lemma congr_symm_apply_of (e : (i : ι) → G i ≃+* G' i) (he : ∀ i j h, (e j).toRingHom.comp (f i j h) = (f' i j h).comp (e i)) {i : ι} (g : G' i) : diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean b/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean index 658d5c80153d5b..39000843f54bd9 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/ApproximationCorollaries.lean @@ -116,6 +116,7 @@ theorem of_convergence_epsilon : _ ≤ fib (n + 1) * fib (n + 2) := by gcongr; lia _ ≤ B * nB := by gcongr +set_option backward.isDefEq.respectTransparency false in theorem of_convergence [TopologicalSpace K] [OrderTopology K] : Filter.Tendsto (of v).convs Filter.atTop <| 𝓝 v := by simpa [LinearOrderedAddCommGroup.tendsto_nhds, abs_sub_comm] using of_convergence_epsilon v diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean b/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean index 48a482400dd512..2016113be85c68 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean @@ -195,6 +195,7 @@ end IntFractPair theorem coe_of_h_rat_eq (v_eq_q : v = (↑q : K)) : (↑((of q).h : ℚ) : K) = (of v).h := by simp_all +set_option backward.isDefEq.respectTransparency false in theorem coe_of_s_get?_rat_eq (v_eq_q : v = (↑q : K)) (n : ℕ) : (((of q).s.get? n).map (Pair.map (↑)) : Option <| Pair K) = (of v).s.get? n := by simp only [of, IntFractPair.seq1, Stream'.Seq.map_get?, Stream'.Seq.get?_tail] diff --git a/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean b/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean index 498afd423052e1..1f1d80ba91d472 100644 --- a/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean +++ b/Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean @@ -216,6 +216,7 @@ Now let's show how the values of the sequences correspond to one another. -/ +set_option backward.isDefEq.respectTransparency.types false in theorem IntFractPair.exists_succ_get?_stream_of_gcf_of_get?_eq_some {gp_n : Pair K} (s_nth_eq : (of v).s.get? n = some gp_n) : ∃ ifp : IntFractPair K, IntFractPair.stream v (n + 1) = some ifp ∧ (ifp.b : K) = gp_n.b := by @@ -226,6 +227,7 @@ theorem IntFractPair.exists_succ_get?_stream_of_gcf_of_get?_eq_some {gp_n : Pair cases gp_n_eq simp_all only [Option.some.injEq, exists_eq_left'] +set_option backward.isDefEq.respectTransparency false in /-- Shows how the entries of the sequence of the computed continued fraction can be obtained by the integer parts of the stream of integer and fractional parts. -/ diff --git a/Mathlib/Algebra/DirectSum/Basic.lean b/Mathlib/Algebra/DirectSum/Basic.lean index 7bd5417d8977b6..77ae46b85bdb61 100644 --- a/Mathlib/Algebra/DirectSum/Basic.lean +++ b/Mathlib/Algebra/DirectSum/Basic.lean @@ -39,9 +39,6 @@ def DirectSum [∀ i, AddCommMonoid (β i)] : Type _ := Π₀ i, β i deriving AddCommMonoid, Inhabited, DFunLike -set_option backward.inferInstanceAs.wrap.data false in -deriving instance CoeFun for DirectSum - /-- `⨁ i, f i` is notation for `DirectSum _ f` and equals the direct sum of `fun i ↦ f i`. Taking the direct sum over multiple arguments is possible, e.g. `⨁ (i) (j), f i j`. -/ scoped[DirectSum] notation3 "⨁ "(...)", "r:(scoped f => DirectSum _ f) => r @@ -369,8 +366,7 @@ theorem coeAddMonoidHom_eq_dfinsuppSum [DecidableEq ι] {M S : Type*} [DecidableEq M] [AddCommMonoid M] [SetLike S M] [AddSubmonoidClass S M] (A : ι → S) (x : DirectSum ι fun i => A i) : DirectSum.coeAddMonoidHom A x = DFinsupp.sum x fun i => (fun x : A i => ↑x) := by - simp only [DirectSum.coeAddMonoidHom, toAddMonoid, DFinsupp.liftAddHom, AddEquiv.coe_mk, - Equiv.coe_fn_mk] + simp only [DirectSum.coeAddMonoidHom, toAddMonoid, DFinsupp.liftAddHom, AddEquiv.coe_mk] exact DFinsupp.sumAddHom_apply _ x @[simp] @@ -379,6 +375,17 @@ theorem coeAddMonoidHom_of {M S : Type*} [DecidableEq ι] [AddCommMonoid M] [Set DirectSum.coeAddMonoidHom A (of (fun i => A i) i x) = x := toAddMonoid_of _ _ _ +/- +TODO: +`respectTransparency false` isn't actually needed for this to build, but the *statement* +changes if we don't use it: `DirectSum` is somewhere getting unfolded to `DFinSupp`. +This is *currently* needed in `DirectSum.Internal`, lemma `coe_mul_apply`, because it relies +on the discrimination key involving `DFinSupp`, not `DirectSum`. + +Note that `coe_mul_apply` also uses `respectTransparency false`. There might be hope that, +after removing that from `coe_mul_apply`, we can also remove the annotation from this lemma. +-/ +set_option backward.isDefEq.respectTransparency false in theorem coe_of_apply {M S : Type*} [DecidableEq ι] [AddCommMonoid M] [SetLike S M] [AddSubmonoidClass S M] {A : ι → S} (i j : ι) (x : A i) : (of (fun i ↦ {x // x ∈ A i}) i x j : M) = if i = j then x else 0 := by @@ -403,6 +410,7 @@ theorem IsInternal.addSubmonoid_iSup_eq_top {M : Type*} [DecidableEq ι] [AddCom variable {M S : Type*} [AddCommMonoid M] [SetLike S M] [AddSubmonoidClass S M] +set_option backward.isDefEq.respectTransparency false in theorem support_subset [DecidableEq ι] [DecidableEq M] (A : ι → S) (x : DirectSum ι fun i => A i) : (Function.support fun i => (x i : M)) ⊆ ↑(DFinsupp.support x) := by intro m @@ -459,5 +467,5 @@ and the corresponding finite product. -/ def DirectSum.addEquivProd {ι : Type*} [Fintype ι] (G : ι → Type*) [(i : ι) → AddCommMonoid (G i)] : DirectSum ι G ≃+ ((i : ι) → G i) := ⟨DFinsupp.equivFunOnFintype, fun g h ↦ funext fun _ ↦ by - simp only [DFinsupp.equivFunOnFintype, Equiv.toFun_as_coe, Equiv.coe_fn_mk, add_apply, - Pi.add_apply]⟩ + simp only [DFinsupp.equivFunOnFintype, Equiv.toFun_as_coe, Equiv.coe_fn_mk, + ← DFinsupp.add_apply, Pi.add_apply]⟩ diff --git a/Mathlib/Algebra/DirectSum/Decomposition.lean b/Mathlib/Algebra/DirectSum/Decomposition.lean index 32e9581ec7509f..36060c97ca291e 100644 --- a/Mathlib/Algebra/DirectSum/Decomposition.lean +++ b/Mathlib/Algebra/DirectSum/Decomposition.lean @@ -76,7 +76,7 @@ abbrev Decomposition.ofAddHom (decompose : M →+ ⨁ i, ℳ i) right_inv := DFunLike.congr_fun h_right_inv /-- Noncomputably conjure a decomposition instance from a `DirectSum.IsInternal` proof. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsInternal.chooseDecomposition (h : IsInternal ℳ) : DirectSum.Decomposition ℳ where decompose' := (Equiv.ofBijective _ h).symm @@ -150,7 +150,12 @@ theorem degree_eq_of_mem_mem {x : M} {i j : ι} (hxi : x ∈ ℳ i) (hxj : x ∈ an additive monoid to a direct sum of components. -/ @[simps!] def decomposeAddEquiv : M ≃+ ⨁ i, ℳ i := - AddEquiv.symm { (decompose ℳ).symm with map_add' := map_add (DirectSum.coeAddMonoidHom ℳ) } + AddEquiv.symm { (decompose ℳ).symm with + -- TODO: + -- `simps!` won't apply `AddEquiv.symm_mk` without this `id` because `decompose` and + -- `Equiv.symm` are not implicit-reducible, so the type of the proof doesn't match the expected + -- type up to implicit reducibility. + map_add' := id <| map_add (DirectSum.coeAddMonoidHom ℳ) } @[simp] theorem decompose_zero : decompose ℳ (0 : M) = 0 := diff --git a/Mathlib/Algebra/DirectSum/Idempotents.lean b/Mathlib/Algebra/DirectSum/Idempotents.lean index 9c26923e73bb1f..fb0f09837d327b 100644 --- a/Mathlib/Algebra/DirectSum/Idempotents.lean +++ b/Mathlib/Algebra/DirectSum/Idempotents.lean @@ -52,7 +52,10 @@ theorem completeOrthogonalIdempotents_idempotent [Fintype I] : apply (decompose V).injective refine DFunLike.ext _ _ fun i ↦ ?_ rw [decompose_sum, DFinsupp.finsetSum_apply] - simp [idempotent, of_apply] + -- TODO: This should be closed with `simp [idempotent, of_apply]` + simp only [idempotent, decompose_coe] + conv => enter [1, 2, ext]; rw [of_apply] + simp end OrthogonalIdempotents diff --git a/Mathlib/Algebra/DirectSum/Internal.lean b/Mathlib/Algebra/DirectSum/Internal.lean index 546a7e935fb270..144dc357f6737c 100644 --- a/Mathlib/Algebra/DirectSum/Internal.lean +++ b/Mathlib/Algebra/DirectSum/Internal.lean @@ -146,7 +146,9 @@ theorem coe_mul_apply [AddMonoid ι] [SetLike.GradedMonoid A] ((r * r') n : R) = ∑ ij ∈ r.support ×ˢ r'.support with ij.1 + ij.2 = n, (r ij.1 * r' ij.2 : R) := by rw [mul_eq_sum_support_ghas_mul, DFinsupp.finsetSum_apply, AddSubmonoidClass.coe_finsetSum] - simp_rw [coe_of_apply, apply_ite, ZeroMemClass.coe_zero, ← Finset.sum_filter, SetLike.coe_gMul] + -- TODO: This should finish with a single `simp_rw` statement + conv => enter [1, 2, ext]; rw [coe_of_apply] + simp_rw [apply_ite, ZeroMemClass.coe_zero, ← Finset.sum_filter, SetLike.coe_gMul] set_option backward.isDefEq.respectTransparency false in theorem coe_mul_apply_eq_dfinsuppSum [AddMonoid ι] [SetLike.GradedMonoid A] @@ -163,6 +165,7 @@ theorem coe_mul_apply_eq_dfinsuppSum [AddMonoid ι] [SetLike.GradedMonoid A] · rw [of_eq_of_ne _ _ _ (Ne.symm h)] rfl +set_option backward.isDefEq.respectTransparency false in open Finset in theorem coe_mul_apply_eq_sum_antidiagonal [AddMonoid ι] [HasAntidiagonal ι] [SetLike.GradedMonoid A] (r r' : ⨁ i, A i) (n : ι) : @@ -172,6 +175,7 @@ theorem coe_mul_apply_eq_sum_antidiagonal [AddMonoid ι] [HasAntidiagonal ι] apply Finset.sum_subset (fun _ ↦ by simp) aesop (erase simp not_and) (add simp not_and_or) +set_option backward.isDefEq.respectTransparency false in theorem coe_of_mul_apply_aux [AddMonoid ι] [SetLike.GradedMonoid A] {i : ι} (r : A i) (r' : ⨁ i, A i) {j n : ι} (H : ∀ x : ι, i + x = n ↔ x = j) : ((of (fun i => A i) i r * r') n : R) = r * r' j := by @@ -186,6 +190,7 @@ theorem coe_of_mul_apply_aux [AddMonoid ι] [SetLike.GradedMonoid A] {i : ι} (r · rfl rw [DFinsupp.notMem_support_iff.mp h, ZeroMemClass.coe_zero, mul_zero] +set_option backward.isDefEq.respectTransparency false in theorem coe_mul_of_apply_aux [AddMonoid ι] [SetLike.GradedMonoid A] (r : ⨁ i, A i) {i : ι} (r' : A i) {j n : ι} (H : ∀ x : ι, x + i = n ↔ x = j) : ((r * of (fun i => A i) i r') n : R) = r j * r' := by @@ -223,6 +228,7 @@ section CanonicallyOrderedAddCommMonoid variable [Semiring R] [SetLike σ R] [AddSubmonoidClass σ R] (A : ι → σ) variable [AddCommMonoid ι] [PartialOrder ι] [CanonicallyOrderedAdd ι] [SetLike.GradedMonoid A] +set_option backward.isDefEq.respectTransparency.types false in theorem coe_of_mul_apply_of_not_le {i : ι} (r : A i) (r' : ⨁ i, A i) (n : ι) (h : ¬i ≤ n) : ((of (fun i => A i) i r * r') n : R) = 0 := by classical @@ -234,6 +240,7 @@ theorem coe_of_mul_apply_of_not_le {i : ι} (r : A i) (r' : ⨁ i, A i) (n : ι) · rw [DFinsupp.sum, Finset.sum_ite_of_false, Finset.sum_const_zero] exact fun x _ H => h ((self_le_add_right i x).trans_eq H) +set_option backward.isDefEq.respectTransparency.types false in theorem coe_mul_of_apply_of_not_le (r : ⨁ i, A i) {i : ι} (r' : A i) (n : ι) (h : ¬i ≤ n) : ((r * of (fun i => A i) i r') n : R) = 0 := by classical @@ -435,6 +442,7 @@ section Semiring variable [Semiring R] [SetLike σ R] [AddSubmonoidClass σ R] variable {A : ι → σ} [SetLike.GradedMonoid A] +set_option backward.isDefEq.respectTransparency.types false in theorem mul_apply_eq_zero {r r' : ⨁ i, A i} {m n : ι} (hr : ∀ i < m, r i = 0) (hr' : ∀ i < n, r' i = 0) ⦃k : ι⦄ (hk : k < m + n) : (r * r') k = 0 := by diff --git a/Mathlib/Algebra/DirectSum/LinearMap.lean b/Mathlib/Algebra/DirectSum/LinearMap.lean index 0f7ed92c3481eb..119c4f6e26947c 100644 --- a/Mathlib/Algebra/DirectSum/LinearMap.lean +++ b/Mathlib/Algebra/DirectSum/LinearMap.lean @@ -30,6 +30,7 @@ section IsInternal variable [DecidableEq ι] +set_option backward.isDefEq.respectTransparency.types false in /-- If a linear map `f : M₁ → M₂` respects direct sum decompositions of `M₁` and `M₂`, then it has a block diagonal matrix with respect to bases compatible with the direct sum decompositions. -/ lemma toMatrix_directSum_collectedBasis_eq_blockDiagonal' {R M₁ M₂ : Type*} [CommSemiring R] diff --git a/Mathlib/Algebra/DirectSum/Module.lean b/Mathlib/Algebra/DirectSum/Module.lean index 557a0b847006b6..bdaf840f01c392 100644 --- a/Mathlib/Algebra/DirectSum/Module.lean +++ b/Mathlib/Algebra/DirectSum/Module.lean @@ -137,6 +137,7 @@ theorem linearMap_ext ⦃ψ ψ' : (⨁ i, M i) →ₗ[R] N⦄ (H : ∀ i, ψ.comp (lof R ι M i) = ψ'.comp (lof R ι M i)) : ψ = ψ' := DFinsupp.lhom_ext' H +set_option backward.isDefEq.respectTransparency false in /-- The inclusion of a subset of the direct summands into a larger subset of the direct summands, as a linear map. -/ def lsetToSet (S T : Set ι) (H : S ⊆ T) : (⨁ i : S, M i) →ₗ[R] ⨁ i : T, M i := @@ -428,12 +429,14 @@ variable {A} theorem range_coeLinearMap : LinearMap.range (coeLinearMap A) = ⨆ i, A i := (Submodule.iSup_eq_range_dfinsupp_lsum _).symm +set_option backward.isDefEq.respectTransparency false in @[simp] theorem IsInternal.ofBijective_coeLinearMap_same (h : IsInternal A) {i : ι} (x : A i) : (LinearEquiv.ofBijective (coeLinearMap A) h).symm x i = x := by rw [← coeLinearMap_of, LinearEquiv.ofBijective_symm_apply_apply, of_eq_same] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem IsInternal.ofBijective_coeLinearMap_of_ne (h : IsInternal A) {i j : ι} (hij : i ≠ j) (x : A i) : @@ -478,12 +481,14 @@ theorem IsInternal.collectedBasis_coe (h : IsInternal A) {α : ι → Type*} theorem IsInternal.collectedBasis_mem (h : IsInternal A) {α : ι → Type*} (v : ∀ i, Basis (α i) R (A i)) (a : Σ i, α i) : h.collectedBasis v a ∈ A a.1 := by simp +set_option backward.isDefEq.respectTransparency false in theorem IsInternal.collectedBasis_repr_of_mem (h : IsInternal A) {α : ι → Type*} (v : ∀ i, Basis (α i) R (A i)) {x : M} {i : ι} {a : α i} (hx : x ∈ A i) : (h.collectedBasis v).repr x ⟨i, a⟩ = (v i).repr ⟨x, hx⟩ a := by change (sigmaFinsuppLequivDFinsupp R).symm (DFinsupp.mapRange _ (fun i ↦ map_zero _) _) _ = _ simp [h.ofBijective_coeLinearMap_of_mem hx] +set_option backward.isDefEq.respectTransparency false in theorem IsInternal.collectedBasis_repr_of_mem_ne (h : IsInternal A) {α : ι → Type*} (v : ∀ i, Basis (α i) R (A i)) {x : M} {i j : ι} (hij : i ≠ j) {a : α j} (hx : x ∈ A i) : (h.collectedBasis v).repr x ⟨j, a⟩ = 0 := by diff --git a/Mathlib/Algebra/DirectSum/Ring.lean b/Mathlib/Algebra/DirectSum/Ring.lean index 7635412701f528..3a6a30771d1caa 100644 --- a/Mathlib/Algebra/DirectSum/Ring.lean +++ b/Mathlib/Algebra/DirectSum/Ring.lean @@ -294,6 +294,7 @@ theorem mul_eq_dfinsuppSum [∀ (i : ι) (x : A i), Decidable (x ≠ 0)] (a a' : funext x simp [AddMonoidHom.dfinsuppSum_apply, DFinsupp.sumAddHom_apply, DirectSum.toAddMonoid] +set_option backward.isDefEq.respectTransparency false in /-- A heavily unfolded version of the definition of multiplication -/ theorem mul_eq_sum_support_ghas_mul [∀ (i : ι) (x : A i), Decidable (x ≠ 0)] (a a' : ⨁ i, A i) : a * a' = diff --git a/Mathlib/Algebra/DualQuaternion.lean b/Mathlib/Algebra/DualQuaternion.lean index 3b49c02830a40d..565840eca5825e 100644 --- a/Mathlib/Algebra/DualQuaternion.lean +++ b/Mathlib/Algebra/DualQuaternion.lean @@ -31,6 +31,7 @@ variable {R : Type*} [CommRing R] namespace Quaternion +set_option backward.isDefEq.respectTransparency.types false in /-- The dual quaternions can be equivalently represented as a quaternion with dual coefficients, or as a dual number with quaternion coefficients. diff --git a/Mathlib/Algebra/Exact.lean b/Mathlib/Algebra/Exact.lean index 1571cd71f00027..bfdeba0eeebc46 100644 --- a/Mathlib/Algebra/Exact.lean +++ b/Mathlib/Algebra/Exact.lean @@ -374,6 +374,7 @@ variable {f : M →ₗ[R] N} {g : N →ₗ[R] P} open LinearMap +set_option backward.isDefEq.respectTransparency false in /-- Given an exact sequence `0 → M → N → P`, giving a section `P → N` is equivalent to giving a splitting `N ≃ M × P`. -/ noncomputable @@ -410,6 +411,7 @@ def Exact.splitSurjectiveEquiv (h : Function.Exact f g) (hf : Function.Injective apply e.injective ext <;> simp +set_option backward.isDefEq.respectTransparency false in /-- Given an exact sequence `M → N → P → 0`, giving a retraction `N → M` is equivalent to giving a splitting `N ≃ M × P`. -/ noncomputable @@ -560,6 +562,7 @@ lemma ker_eq_bot_range_liftQ_iff (h : range f ≤ ker g) : obtain ⟨x, rfl⟩ := Submodule.Quotient.mk_surjective _ x simpa using hfg x +set_option backward.isDefEq.respectTransparency false in lemma injective_range_liftQ_of_exact (h : Function.Exact f g) : Function.Injective ((range f).liftQ g (h · |>.mpr)) := by simpa only [← LinearMap.ker_eq_bot, ker_eq_bot_range_liftQ_iff, exact_iff] using h @@ -574,6 +577,7 @@ noncomputable def Function.Exact.linearEquivOfSurjective (h : Function.Exact f g LinearEquiv.ofBijective ((LinearMap.range f).liftQ g (h · |>.mpr)) ⟨LinearMap.injective_range_liftQ_of_exact h, LinearMap.surjective_range_liftQ _ hg⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma Function.Exact.linearEquivOfSurjective_symm_apply (h : Function.Exact f g) (hg : Function.Surjective g) (x : N) : diff --git a/Mathlib/Algebra/Expr.lean b/Mathlib/Algebra/Expr.lean index 8a68c40ae87c11..a4bb7798353ea2 100644 --- a/Mathlib/Algebra/Expr.lean +++ b/Mathlib/Algebra/Expr.lean @@ -18,21 +18,21 @@ This file provides instances on `x y : Q($α)` such that `x + y = q($x + $y)`. open Qq /-- Produce a `One` instance for `Q($α)` such that `1 : Q($α)` is `q(1 : $α)`. -/ -@[implicit_reducible] +@[instance_reducible] def Expr.instOne {u : Lean.Level} (α : Q(Type u)) (_ : Q(One $α)) : One Q($α) where one := q(1 : $α) /-- Produce a `Zero` instance for `Q($α)` such that `0 : Q($α)` is `q(0 : $α)`. -/ -@[implicit_reducible] +@[instance_reducible] def Expr.instZero {u : Lean.Level} (α : Q(Type u)) (_ : Q(Zero $α)) : Zero Q($α) where zero := q(0 : $α) /-- Produce a `Mul` instance for `Q($α)` such that `x * y : Q($α)` is `q($x * $y)`. -/ -@[implicit_reducible] +@[instance_reducible] def Expr.instMul {u : Lean.Level} (α : Q(Type u)) (_ : Q(Mul $α)) : Mul Q($α) where mul x y := q($x * $y) /-- Produce an `Add` instance for `Q($α)` such that `x + y : Q($α)` is `q($x + $y)`. -/ -@[implicit_reducible] +@[instance_reducible] def Expr.instAdd {u : Lean.Level} (α : Q(Type u)) (_ : Q(Add $α)) : Add Q($α) where add x y := q($x + $y) diff --git a/Mathlib/Algebra/Field/IsField.lean b/Mathlib/Algebra/Field/IsField.lean index 69710a3312cc6f..ad6da2a1b75bda 100644 --- a/Mathlib/Algebra/Field/IsField.lean +++ b/Mathlib/Algebra/Field/IsField.lean @@ -71,7 +71,7 @@ theorem not_isField_of_subsingleton (R : Type u) [Semiring R] [Subsingleton R] : open Classical in /-- Transferring from `IsField` to `Semifield`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsField.toSemifield {R : Type u} [Semiring R] (h : IsField R) : Semifield R where __ := ‹Semiring R› __ := h @@ -82,7 +82,7 @@ noncomputable def IsField.toSemifield {R : Type u} [Semiring R] (h : IsField R) nnqsmul_def _ _ := rfl /-- Transferring from `IsField` to `Field`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsField.toField {R : Type u} [Ring R] (h : IsField R) : Field R where __ := (‹Ring R› :) -- this also works without the `( :)`, but it's slow __ := h.toSemifield diff --git a/Mathlib/Algebra/Field/Rat.lean b/Mathlib/Algebra/Field/Rat.lean index 7731a2f3d33b13..04a3054ae47445 100644 --- a/Mathlib/Algebra/Field/Rat.lean +++ b/Mathlib/Algebra/Field/Rat.lean @@ -71,11 +71,13 @@ lemma inv_def (q : ℚ≥0) : q⁻¹ = divNat q.den q.num := by ext; simp [Rat.i lemma div_def (p q : ℚ≥0) : p / q = divNat (p.num * q.den) (p.den * q.num) := by ext; simp [Rat.div_def', num_coe, den_coe] +set_option backward.isDefEq.respectTransparency false in lemma num_inv_of_ne_zero {q : ℚ≥0} (hq : q ≠ 0) : q⁻¹.num = q.den := by rw [inv_def, divNat, num, coe_mk, Rat.divInt_ofNat, ← Rat.mk_eq_mkRat _ _ (num_ne_zero.mpr hq), Int.natAbs_natCast] simpa using q.coprime_num_den.symm +set_option backward.isDefEq.respectTransparency false in lemma den_inv_of_ne_zero {q : ℚ≥0} (hq : q ≠ 0) : q⁻¹.den = q.num := by rw [inv_def, divNat, den, coe_mk, Rat.divInt_ofNat, ← Rat.mk_eq_mkRat _ _ (num_ne_zero.mpr hq)] simpa using q.coprime_num_den.symm diff --git a/Mathlib/Algebra/Free.lean b/Mathlib/Algebra/Free.lean index 4fc7edd49571d3..92518530e644c4 100644 --- a/Mathlib/Algebra/Free.lean +++ b/Mathlib/Algebra/Free.lean @@ -344,6 +344,7 @@ theorem quot_mk_assoc_left (x y z w : α) : Quot.mk (AssocRel α) (x * (y * z * w)) = Quot.mk _ (x * (y * (z * w))) := Quot.sound (AssocRel.left _ _ _ _) +set_option backward.isDefEq.respectTransparency false in @[to_additive] instance : Semigroup (AssocQuotient α) where mul x y := by diff --git a/Mathlib/Algebra/FreeAlgebra.lean b/Mathlib/Algebra/FreeAlgebra.lean index a3df9a637be7b2..2cef1ff7c145b8 100644 --- a/Mathlib/Algebra/FreeAlgebra.lean +++ b/Mathlib/Algebra/FreeAlgebra.lean @@ -223,6 +223,7 @@ instance instDistrib : Distrib (FreeAlgebra R X) where rintro ⟨⟩ ⟨⟩ ⟨⟩ exact Quot.sound Rel.right_distrib +set_option backward.isDefEq.respectTransparency false in instance instAddCommMonoid : AddCommMonoid (FreeAlgebra R X) where add_assoc := by rintro ⟨⟩ ⟨⟩ ⟨⟩ @@ -537,6 +538,7 @@ end FreeAlgebra `CoeSort` below. Closing it and reopening it fixes it... -/ namespace FreeAlgebra +set_option backward.isDefEq.respectTransparency.types false in /-- An induction principle for the free algebra. If `C` holds for the `algebraMap` of `r : R` into `FreeAlgebra R X`, the `ι` of `x : X`, and is diff --git a/Mathlib/Algebra/FreeMonoid/Basic.lean b/Mathlib/Algebra/FreeMonoid/Basic.lean index ce8a872ce25477..806fe80a9bcdac 100644 --- a/Mathlib/Algebra/FreeMonoid/Basic.lean +++ b/Mathlib/Algebra/FreeMonoid/Basic.lean @@ -340,7 +340,7 @@ theorem hom_map_lift (g : M →* N) (f : α → M) (x : FreeMonoid α) : g (lift DFunLike.ext_iff.1 (comp_lift g f) x /-- Define a multiplicative action of `FreeMonoid α` on `β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Define an additive action of `FreeAddMonoid α` on `β`. -/] def mkMulAction (f : α → β → β) : MulAction (FreeMonoid α) β where smul l b := l.toList.foldr f b @@ -381,6 +381,7 @@ theorem map_of (f : α → β) (x : α) : map f (of x) = of (f x) := rfl @[to_additive] theorem mem_map {m : β} : m ∈ map f a ↔ ∃ n ∈ a, f n = m := List.mem_map +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem map_map {α₁ : Type*} {g : α₁ → α} {x : FreeMonoid α₁} : map f (map g x) = map (f ∘ g) x := by diff --git a/Mathlib/Algebra/GCDMonoid/Basic.lean b/Mathlib/Algebra/GCDMonoid/Basic.lean index 5c5fb38a783f39..25dbfae7447c77 100644 --- a/Mathlib/Algebra/GCDMonoid/Basic.lean +++ b/Mathlib/Algebra/GCDMonoid/Basic.lean @@ -967,7 +967,7 @@ private theorem map_mk_unit_aux {f : Associates α →* α} variable [IsCancelMulZero α] /-- Define `NormalizationMonoid` on a structure from a `MonoidHom` inverse to `Associates.mk`. -/ -@[implicit_reducible] +@[instance_reducible] def normalizationMonoidOfMonoidHomRightInverse [DecidableEq α] (f : Associates α →* α) (hinv : Function.RightInverse f Associates.mk) : NormalizationMonoid α where @@ -993,7 +993,7 @@ def normalizationMonoidOfMonoidHomRightInverse [DecidableEq α] (f : Associates Associates.mk_one, map_one] /-- Define `GCDMonoid` on a structure just from the `gcd` and its properties. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def gcdMonoidOfGCD [DecidableEq α] (gcd : α → α → α) (gcd_dvd_left : ∀ a b, gcd a b ∣ a) (gcd_dvd_right : ∀ a b, gcd a b ∣ b) (dvd_gcd : ∀ {a b c}, a ∣ c → a ∣ b → a ∣ gcd c b) : GCDMonoid α := @@ -1021,7 +1021,7 @@ noncomputable def gcdMonoidOfGCD [DecidableEq α] (gcd : α → α → α) set_option backward.isDefEq.respectTransparency false in /-- Define `NormalizedGCDMonoid` on a structure just from the `gcd` and its properties. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def normalizedGCDMonoidOfGCD [NormalizationMonoid α] [DecidableEq α] (gcd : α → α → α) (gcd_dvd_left : ∀ a b, gcd a b ∣ a) (gcd_dvd_right : ∀ a b, gcd a b ∣ b) (dvd_gcd : ∀ {a b c}, a ∣ c → a ∣ b → a ∣ gcd c b) @@ -1076,7 +1076,7 @@ noncomputable def normalizedGCDMonoidOfGCD [NormalizationMonoid α] [DecidableEq rw [h, mul_zero, normalize_zero] } /-- Define `GCDMonoid` on a structure just from the `lcm` and its properties. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def gcdMonoidOfLCM [DecidableEq α] (lcm : α → α → α) (dvd_lcm_left : ∀ a b, a ∣ lcm a b) (dvd_lcm_right : ∀ a b, b ∣ lcm a b) (lcm_dvd : ∀ {a b c}, c ∣ a → b ∣ a → lcm c b ∣ a) : GCDMonoid α := @@ -1142,7 +1142,7 @@ noncomputable def gcdMonoidOfLCM [DecidableEq α] (lcm : α → α → α) set_option backward.isDefEq.respectTransparency false in /-- Define `NormalizedGCDMonoid` on a structure just from the `lcm` and its properties. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def normalizedGCDMonoidOfLCM [NormalizationMonoid α] [DecidableEq α] (lcm : α → α → α) (dvd_lcm_left : ∀ a b, a ∣ lcm a b) (dvd_lcm_right : ∀ a b, b ∣ lcm a b) (lcm_dvd : ∀ {a b c}, c ∣ a → b ∣ a → lcm c b ∣ a) @@ -1234,7 +1234,7 @@ noncomputable def normalizedGCDMonoidOfLCM [NormalizationMonoid α] [DecidableEq apply ac } /-- Define a `GCDMonoid` structure on a monoid just from the existence of a `gcd`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def gcdMonoidOfExistsGCD [DecidableEq α] (h : ∀ a b : α, ∃ c : α, ∀ d : α, d ∣ a ∧ d ∣ b ↔ d ∣ c) : GCDMonoid α := gcdMonoidOfGCD (fun a b => Classical.choose (h a b)) @@ -1243,7 +1243,7 @@ noncomputable def gcdMonoidOfExistsGCD [DecidableEq α] fun {a b c} ac ab => (Classical.choose_spec (h c b) a).1 ⟨ac, ab⟩ /-- Define a `NormalizedGCDMonoid` structure on a monoid just from the existence of a `gcd`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def normalizedGCDMonoidOfExistsGCD [NormalizationMonoid α] [DecidableEq α] (h : ∀ a b : α, ∃ c : α, ∀ d : α, d ∣ a ∧ d ∣ b ↔ d ∣ c) : NormalizedGCDMonoid α := normalizedGCDMonoidOfGCD (fun a b => normalize (Classical.choose (h a b))) @@ -1255,7 +1255,7 @@ noncomputable def normalizedGCDMonoidOfExistsGCD [NormalizationMonoid α] [Decid fun _ _ => normalize_idem _ /-- Define a `GCDMonoid` structure on a monoid just from the existence of an `lcm`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def gcdMonoidOfExistsLCM [DecidableEq α] (h : ∀ a b : α, ∃ c : α, ∀ d : α, a ∣ d ∧ b ∣ d ↔ c ∣ d) : GCDMonoid α := gcdMonoidOfLCM (fun a b => Classical.choose (h a b)) @@ -1264,7 +1264,7 @@ noncomputable def gcdMonoidOfExistsLCM [DecidableEq α] fun {a b c} ac ab => (Classical.choose_spec (h c b) a).1 ⟨ac, ab⟩ /-- Define a `NormalizedGCDMonoid` structure on a monoid just from the existence of an `lcm`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def normalizedGCDMonoidOfExistsLCM [NormalizationMonoid α] [DecidableEq α] (h : ∀ a b : α, ∃ c : α, ∀ d : α, a ∣ d ∧ b ∣ d ↔ c ∣ d) : NormalizedGCDMonoid α := normalizedGCDMonoidOfLCM (fun a b => normalize (Classical.choose (h a b))) diff --git a/Mathlib/Algebra/GradedMonoid.lean b/Mathlib/Algebra/GradedMonoid.lean index 9cd3249feff46e..db129f170ebdb4 100644 --- a/Mathlib/Algebra/GradedMonoid.lean +++ b/Mathlib/Algebra/GradedMonoid.lean @@ -417,6 +417,7 @@ theorem GradedMonoid.mk_list_dProd (l : List α) (fι : α → ι) (fA : ∀ a, | head::tail => simp [← GradedMonoid.mk_list_dProd tail _ _, GradedMonoid.mk_mul_mk, List.prod_cons] +set_option backward.isDefEq.respectTransparency false in /-- A variant of `GradedMonoid.mk_list_dProd` for rewriting in the other direction. -/ theorem GradedMonoid.list_prod_map_eq_dProd (l : List α) (f : α → GradedMonoid A) : (l.map f).prod = GradedMonoid.mk _ (l.dProd (fun i => (f i).1) fun i => (f i).2) := by diff --git a/Mathlib/Algebra/Group/Action/Basic.lean b/Mathlib/Algebra/Group/Action/Basic.lean index c414d3ab2fdfc8..7990462bc9f6b7 100644 --- a/Mathlib/Algebra/Group/Action/Basic.lean +++ b/Mathlib/Algebra/Group/Action/Basic.lean @@ -95,7 +95,7 @@ section Arrow variable {G A B : Type*} [DivisionMonoid G] [MulAction G A] /-- If `G` acts on `A`, then it acts also on `A → B`, by `(g • F) a = F (g⁻¹ • a)`. -/ -@[to_additive (attr := implicit_reducible, simps) arrowAddAction +@[to_additive (attr := instance_reducible, simps) arrowAddAction /-- If `G` acts on `A`, then it acts also on `A → B`, by `(g +ᵥ F) a = F (g⁻¹ +ᵥ a)` -/] def arrowAction : MulAction G (A → B) where smul g F a := F (g⁻¹ • a) @@ -111,7 +111,7 @@ attribute [local instance] arrowAction variable [Monoid M] /-- When `M` is a monoid, `ArrowAction` is additionally a `MulDistribMulAction`. -/ -@[implicit_reducible] +@[instance_reducible] def arrowMulDistribMulAction : MulDistribMulAction G (A → M) where smul_one _ := rfl smul_mul _ _ _ := rfl diff --git a/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean b/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean index 2a7468e8f5fd28..a1ce1fe211cb3b 100644 --- a/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean +++ b/Mathlib/Algebra/Group/Action/Pointwise/Finset.lean @@ -79,7 +79,7 @@ instance isCentralScalar [SMul α β] [SMul αᵐᵒᵖ β] [IsCentralScalar α /-- A multiplicative action of a monoid `α` on a type `β` gives a multiplicative action of `Finset α` on `Finset β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive action of an additive monoid `α` on a type `β` gives an additive action of `Finset α` on `Finset β` -/] protected def mulAction [DecidableEq α] [Monoid α] [MulAction α β] : @@ -89,7 +89,7 @@ protected def mulAction [DecidableEq α] [Monoid α] [MulAction α β] : /-- A multiplicative action of a monoid on a type `β` gives a multiplicative action on `Finset β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive action of an additive monoid on a type `β` gives an additive action on `Finset β`. -/] protected def mulActionFinset [Monoid α] [MulAction α β] : MulAction α (Finset β) := diff --git a/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean b/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean index 8d9a066d98e6d2..d33650cc6157a7 100644 --- a/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean +++ b/Mathlib/Algebra/Group/Action/Pointwise/Set/Basic.lean @@ -168,7 +168,7 @@ instance isCentralScalar [SMul α β] [SMul αᵐᵒᵖ β] [IsCentralScalar α /-- A multiplicative action of a monoid `α` on a type `β` gives a multiplicative action of `Set α` on `Set β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive action of an additive monoid `α` on a type `β` gives an additive action of `Set α` on `Set β` -/] protected noncomputable def mulAction [Monoid α] [MulAction α β] : MulAction (Set α) (Set β) where @@ -176,7 +176,7 @@ protected noncomputable def mulAction [Monoid α] [MulAction α β] : MulAction one_smul s := image2_singleton_left.trans <| by simp_rw [one_smul, image_id'] /-- A multiplicative action of a monoid on a type `β` gives a multiplicative action on `Set β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive action of an additive monoid on a type `β` gives an additive action on `Set β`. -/] protected def mulActionSet [Monoid α] [MulAction α β] : MulAction α (Set β) where mul_smul _ _ _ := by simp only [← image_smul, image_image, ← mul_smul] diff --git a/Mathlib/Algebra/Group/Conj.lean b/Mathlib/Algebra/Group/Conj.lean index 691ab9ca1ead6b..c71fa9e5fcdc8f 100644 --- a/Mathlib/Algebra/Group/Conj.lean +++ b/Mathlib/Algebra/Group/Conj.lean @@ -230,6 +230,7 @@ theorem mk_injective : Function.Injective (@ConjClasses.mk α _) := fun _ _ => theorem mk_bijective : Function.Bijective (@ConjClasses.mk α _) := ⟨mk_injective, mk_surjective⟩ +set_option backward.isDefEq.respectTransparency false in /-- The bijection between a `CommGroup` and its `ConjClasses`. -/ @[to_additive /-- The bijection between an `AddCommGroup` and its `AddConjClasses`. -/] def mkEquiv : α ≃ ConjClasses α := diff --git a/Mathlib/Algebra/Group/End.lean b/Mathlib/Algebra/Group/End.lean index 116f29bec9aa51..c04f0f96191721 100644 --- a/Mathlib/Algebra/Group/End.lean +++ b/Mathlib/Algebra/Group/End.lean @@ -410,6 +410,7 @@ private theorem pow_aux (hf : ∀ x, p (f x) ↔ p x) : ∀ {n : ℕ} (x), p ((f | 0, _ => Iff.rfl | _ + 1, _ => (pow_aux hf (f _)).trans (hf _) +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in @[simp] @@ -469,6 +470,7 @@ theorem ofSubtype_apply_mem_iff_mem (f : Perm (Subtype p)) (x : α) : simpa only [h, iff_true, MonoidHom.coe_mk, ofSubtype_apply_of_mem f h] using (f ⟨x, h⟩).2 else by simp [h, ofSubtype_apply_of_not_mem f h] +set_option backward.isDefEq.respectTransparency false in theorem ofSubtype_injective : Function.Injective (ofSubtype : Perm (Subtype p) → Perm α) := by intro x y h rw [Perm.ext_iff] at h ⊢ diff --git a/Mathlib/Algebra/Group/Finsupp.lean b/Mathlib/Algebra/Group/Finsupp.lean index 4f87ef389726c9..0cbe4a8b1497af 100644 --- a/Mathlib/Algebra/Group/Finsupp.lean +++ b/Mathlib/Algebra/Group/Finsupp.lean @@ -173,6 +173,7 @@ lemma support_single_add_single_subset [DecidableEq ι] {f₁ f₂ : ι} {g₁ g refine subset_trans Finsupp.support_add <| union_subset_iff.mpr ⟨?_, ?_⟩ <;> exact subset_trans Finsupp.support_single_subset (by simp) +set_option backward.isDefEq.respectTransparency false in set_option linter.deprecated false in @[deprecated uniqueAddEquiv_symm_apply (since := "2026-05-06")] lemma _root_.AddEquiv.finsuppUnique_symm {M : Type*} [AddZeroClass M] (d : M) : diff --git a/Mathlib/Algebra/Group/Hom/Basic.lean b/Mathlib/Algebra/Group/Hom/Basic.lean index 94b3d51bf17eb8..45fb02c63c31d7 100644 --- a/Mathlib/Algebra/Group/Hom/Basic.lean +++ b/Mathlib/Algebra/Group/Hom/Basic.lean @@ -302,13 +302,13 @@ lemma comp_div (f : G →* H) (g h : M →* G) : f.comp (g / h) = f.comp g / f.c end InvDiv /-- If `H` is commutative and `G →* H` is injective, then `G` is commutative. -/ -@[implicit_reducible] +@[instance_reducible] def commGroupOfInjective [Group G] [CommGroup H] (f : G →* H) (hf : Function.Injective f) : CommGroup G := ⟨by simp_rw [← hf.eq_iff, map_mul, mul_comm, implies_true]⟩ /-- If `G` is commutative and `G →* H` is surjective, then `H` is commutative. -/ -@[implicit_reducible] +@[instance_reducible] def commGroupOfSurjective [CommGroup G] [Group H] (f : G →* H) (hf : Function.Surjective f) : CommGroup H := ⟨by simp_rw [hf.forall₂, ← map_mul, mul_comm, implies_true]⟩ diff --git a/Mathlib/Algebra/Group/Hom/Defs.lean b/Mathlib/Algebra/Group/Hom/Defs.lean index 8e48fda8d22d01..b570c75a1eab1a 100644 --- a/Mathlib/Algebra/Group/Hom/Defs.lean +++ b/Mathlib/Algebra/Group/Hom/Defs.lean @@ -717,21 +717,21 @@ alias isDedekindFiniteMonoid_of_injective := IsDedekindFiniteMonoid.of_injective end MonoidHom /-- The identity map from a type with 1 to itself. -/ -@[to_additive (attr := simps, implicit_reducible) +@[to_additive (attr := simps, instance_reducible) /-- The identity map from a type with zero to itself. -/] def OneHom.id (M : Type*) [One M] : OneHom M M where toFun x := x map_one' := rfl /-- The identity map from a type with multiplication to itself. -/ -@[to_additive (attr := simps, implicit_reducible) +@[to_additive (attr := simps, instance_reducible) /-- The identity map from a type with addition to itself. -/] def MulHom.id (M : Type*) [Mul M] : M →ₙ* M where toFun x := x map_mul' _ _ := rfl /-- The identity map from a monoid to itself. -/ -@[to_additive (attr := simps, implicit_reducible) +@[to_additive (attr := simps, instance_reducible) /-- The identity map from an additive monoid to itself. -/] def MonoidHom.id (M : Type*) [MulOne M] : M →* M where toFun x := x @@ -748,19 +748,19 @@ lemma MulHom.coe_id {M : Type*} [Mul M] : (MulHom.id M : M → M) = _root_.id := lemma MonoidHom.coe_id {M : Type*} [MulOne M] : (MonoidHom.id M : M → M) = _root_.id := rfl /-- Composition of `OneHom`s as a `OneHom`. -/ -@[to_additive (attr := implicit_reducible) /-- Composition of `ZeroHom`s as a `ZeroHom`. -/] +@[to_additive (attr := instance_reducible) /-- Composition of `ZeroHom`s as a `ZeroHom`. -/] def OneHom.comp [One M] [One N] [One P] (hnp : OneHom N P) (hmn : OneHom M N) : OneHom M P where toFun x := hnp (hmn x) map_one' := by simp /-- Composition of `MulHom`s as a `MulHom`. -/ -@[to_additive (attr := implicit_reducible) /-- Composition of `AddHom`s as an `AddHom`. -/] +@[to_additive (attr := instance_reducible) /-- Composition of `AddHom`s as an `AddHom`. -/] def MulHom.comp [Mul M] [Mul N] [Mul P] (hnp : N →ₙ* P) (hmn : M →ₙ* N) : M →ₙ* P where toFun x := hnp (hmn x) map_mul' x y := by simp /-- Composition of monoid morphisms as a monoid morphism. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Composition of additive monoid morphisms as an additive monoid morphism. -/] def MonoidHom.comp [MulOne M] [MulOne N] [MulOne P] (hnp : N →* P) (hmn : M →* N) : M →* P where diff --git a/Mathlib/Algebra/Group/Invertible/Basic.lean b/Mathlib/Algebra/Group/Invertible/Basic.lean index c3bdb9985fe699..dd782dfcc428e8 100644 --- a/Mathlib/Algebra/Group/Invertible/Basic.lean +++ b/Mathlib/Algebra/Group/Invertible/Basic.lean @@ -51,7 +51,7 @@ theorem IsUnit.nonempty_invertible [Monoid α] {a : α} (h : IsUnit a) : Nonempt /-- Convert `IsUnit` to `Invertible` using `Classical.choice`. Prefer `casesI h.nonempty_invertible` over `letI := h.invertible` if you want to avoid choice. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsUnit.invertible [Monoid α] {a : α} (h : IsUnit a) : Invertible a := Classical.choice h.nonempty_invertible @@ -123,7 +123,7 @@ lemma invOf_pow (m : α) [Invertible m] (n : ℕ) [Invertible (m ^ n)] : ⅟(m ^ @invertible_unique _ _ _ _ _ (invertiblePow m n) rfl /-- If `x ^ n = 1` then `x` has an inverse, `x^(n - 1)`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfPowEqOne (x : α) (n : ℕ) (hx : x ^ n = 1) (hn : n ≠ 0) : Invertible x := inferInstanceAs <| Invertible (Units.ofPowEqOne x n hx hn : α) @@ -131,7 +131,7 @@ end Monoid /-- Monoid homs preserve invertibility. -/ -@[implicit_reducible] +@[instance_reducible] def Invertible.map {R : Type*} {S : Type*} {F : Type*} [MulOneClass R] [MulOneClass S] [FunLike F R S] [MonoidHomClass F R S] (f : F) (r : R) [Invertible r] : Invertible (f r) where @@ -151,7 +151,7 @@ theorem map_invOf {R : Type*} {S : Type*} {F : Type*} [MulOneClass R] [Monoid S] then `r : R` is invertible if `f r` is. The inverse is computed as `g (⅟(f r))` -/ -@[simps! -isSimp, implicit_reducible] +@[simps! -isSimp, instance_reducible] def Invertible.ofLeftInverse {R : Type*} {S : Type*} {G : Type*} [MulOneClass R] [MulOneClass S] [FunLike G S R] [MonoidHomClass G S R] (f : R → S) (g : G) (r : R) (h : Function.LeftInverse g f) [Invertible (f r)] : Invertible r := diff --git a/Mathlib/Algebra/Group/Invertible/Defs.lean b/Mathlib/Algebra/Group/Invertible/Defs.lean index 63e1a5e82f456a..2d1673614e51a0 100644 --- a/Mathlib/Algebra/Group/Invertible/Defs.lean +++ b/Mathlib/Algebra/Group/Invertible/Defs.lean @@ -179,7 +179,7 @@ theorem Invertible.congr [Invertible a] [Invertible b] (h : a = b) : end Monoid /-- If `r` is invertible and `s = r` and `si = ⅟r`, then `s` is invertible with `⅟s = si`. -/ -@[implicit_reducible] +@[instance_reducible] def Invertible.copy' [MulOneClass α] {r : α} (hr : Invertible r) (s : α) (si : α) (hs : s = r) (hsi : si = ⅟r) : Invertible s where invOf := si @@ -192,7 +192,7 @@ abbrev Invertible.copy [MulOneClass α] {r : α} (hr : Invertible r) (s : α) (h hr.copy' _ _ hs rfl /-- Each element of a group is invertible. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfGroup [Group α] (a : α) : Invertible a := ⟨a⁻¹, inv_mul_cancel a, mul_inv_cancel a⟩ @@ -201,7 +201,7 @@ theorem invOf_eq_group_inv [Group α] (a : α) [Invertible a] : ⅟a = a⁻¹ := invOf_eq_right_inv (mul_inv_cancel a) /-- `1` is the inverse of itself -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOne [Monoid α] : Invertible (1 : α) := ⟨1, mul_one _, one_mul _⟩ @@ -224,7 +224,7 @@ theorem invOf_inj [Monoid α] {a b : α} [Invertible a] [Invertible b] : ⅟a = ⟨invertible_unique _ _, invertible_unique _ _⟩ /-- `⅟b * ⅟a` is the inverse of `a * b` -/ -@[implicit_reducible] +@[instance_reducible] def invertibleMul [Monoid α] (a b : α) [Invertible a] [Invertible b] : Invertible (a * b) := ⟨⅟b * ⅟a, by simp [← mul_assoc], by simp [← mul_assoc]⟩ @@ -264,12 +264,12 @@ theorem mul_right_eq_iff_eq_mul_invOf : a * c = b ↔ a = b * ⅟c := by variable [IsDedekindFiniteMonoid α] (a b : α) /-- An element in a Dedekind-finite monoid is invertible if it has a left inverse. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfLeftInverse (h : b * a = 1) : Invertible a := ⟨b, h, mul_eq_one_symm h⟩ /-- An element in a Dedekind-finite monoid is invertible if it has a right inverse. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfRightInverse (h : a * b = 1) : Invertible a := ⟨b, mul_eq_one_symm h, h⟩ diff --git a/Mathlib/Algebra/Group/Pi/Basic.lean b/Mathlib/Algebra/Group/Pi/Basic.lean index ba7f7d9d87f6f1..07ee5263040b31 100644 --- a/Mathlib/Algebra/Group/Pi/Basic.lean +++ b/Mathlib/Algebra/Group/Pi/Basic.lean @@ -191,7 +191,7 @@ lemma comp_ne_one_iff [One β] [One γ] (f : α → β) {g : β → γ} (hg : In end Function /-- If the one function is surjective, the codomain is trivial. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If the zero function is surjective, the codomain is trivial. -/] def uniqueOfSurjectiveOne (α : Type*) {β : Type*} [One β] (h : Function.Surjective (1 : α → β)) : Unique β := diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean b/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean index d2652c3e4c35e3..bd89126b189b39 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/Basic.lean @@ -66,7 +66,7 @@ section One variable [One α] {s : Finset α} {a : α} /-- The finset `1 : Finset α` is defined as `{1}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The finset `0 : Finset α` is defined as `{0}` in scope `Pointwise`. -/] protected def one : One (Finset α) := ⟨{1}⟩ @@ -184,7 +184,7 @@ section Inv variable [DecidableEq α] [Inv α] {s t : Finset α} {a : α} /-- The pointwise inversion of finset `s⁻¹` is defined as `{x⁻¹ | x ∈ s}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise negation of finset `-s` is defined as `{-x | x ∈ s}` in scope `Pointwise`. -/] protected def inv : Inv (Finset α) := ⟨image Inv.inv⟩ @@ -317,7 +317,7 @@ variable [DecidableEq α] [Mul α] [Mul β] [FunLike F α β] [MulHomClass F α /-- The pointwise multiplication of finsets `s * t` and `t` is defined as `{x * y | x ∈ s, y ∈ t}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise addition of finsets `s + t` is defined as `{x + y | x ∈ s, y ∈ t}` in scope `Pointwise`. -/] protected def mul : Mul (Finset α) := @@ -536,7 +536,7 @@ variable [DecidableEq α] [Div α] {s s₁ s₂ t t₁ t₂ u : Finset α} {a b /-- The pointwise division of finsets `s / t` is defined as `{x / y | x ∈ s, y ∈ t}` in locale `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise subtraction of finsets `s - t` is defined as `{x - y | x ∈ s, y ∈ t}` in scope `Pointwise`. -/] protected def div : Div (Finset α) := @@ -714,7 +714,7 @@ protected def zpow [One α] [Mul α] [Inv α] : Pow (Finset α) ℤ := scoped[Pointwise] attribute [instance] Finset.nsmul Finset.npow Finset.zsmul Finset.zpow /-- `Finset α` is a `Semigroup` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Finset α` is an `AddSemigroup` under pointwise operations if `α` is. -/] protected def semigroup [Semigroup α] : Semigroup (Finset α) := coe_injective.semigroup _ coe_mul @@ -724,7 +724,7 @@ section CommSemigroup variable [CommSemigroup α] {s t : Finset α} /-- `Finset α` is a `CommSemigroup` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Finset α` is an `AddCommSemigroup` under pointwise operations if `α` is. -/] protected def commSemigroup : CommSemigroup (Finset α) := coe_injective.commSemigroup _ coe_mul @@ -744,7 +744,7 @@ section MulOneClass variable [MulOneClass α] /-- `Finset α` is a `MulOneClass` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Finset α` is an `AddZeroClass` under pointwise operations if `α` is. -/] protected def mulOneClass : MulOneClass (Finset α) := coe_injective.mulOneClass _ (coe_singleton 1) coe_mul @@ -808,7 +808,7 @@ theorem coe_pow (s : Finset α) (n : ℕ) : ↑(s ^ n) = (s : Set α) ^ n := by | succ n ih => rw [npowRec, pow_succ, coe_mul, ih] /-- `Finset α` is a `Monoid` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Finset α` is an `AddMonoid` under pointwise operations if `α` is. -/] protected def monoid : Monoid (Finset α) := coe_injective.monoid _ coe_one coe_mul coe_pow @@ -934,7 +934,7 @@ section CommMonoid variable [CommMonoid α] /-- `Finset α` is a `CommMonoid` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Finset α` is an `AddCommMonoid` under pointwise operations if `α` is. -/] protected def commMonoid : CommMonoid (Finset α) := coe_injective.commMonoid _ coe_one coe_mul coe_pow @@ -959,7 +959,7 @@ protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = {a} ∧ t = {b} simp_rw [← coe_inj, coe_mul, coe_one, Set.mul_eq_one_iff, coe_singleton] /-- `Finset α` is a division monoid under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Finset α` is a subtraction monoid under pointwise operations if `α` is. -/] protected def divisionMonoid : DivisionMonoid (Finset α) := coe_injective.divisionMonoid _ coe_one coe_mul coe_inv coe_div coe_pow coe_zpow @@ -1013,7 +1013,7 @@ lemma singleton_zpow (a : α) (n : ℤ) : ({a} : Finset α) ^ n = {a ^ n} := by end DivisionMonoid /-- `Finset α` is a commutative division monoid under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) subtractionCommMonoid +@[to_additive (attr := instance_reducible) subtractionCommMonoid /-- `Finset α` is a commutative subtraction monoid under pointwise operations if `α` is. -/] protected def divisionCommMonoid [DivisionCommMonoid α] : DivisionCommMonoid (Finset α) := diff --git a/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean b/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean index 1e97e9c0f6849b..fc380aa9b54e2e 100644 --- a/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean +++ b/Mathlib/Algebra/Group/Pointwise/Finset/Scalar.lean @@ -63,7 +63,7 @@ section SMul variable [DecidableEq β] [SMul α β] {s s₁ s₂ : Finset α} {t t₁ t₂ u : Finset β} {a : α} {b : β} /-- The pointwise product of two finsets `s` and `t`: `s • t = {x • y | x ∈ s, y ∈ t}`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise sum of two finsets `s` and `t`: `s +ᵥ t = {x +ᵥ y | x ∈ s, y ∈ t}`. -/] protected def smul : SMul (Finset α) (Finset β) := ⟨image₂ (· • ·)⟩ @@ -153,7 +153,7 @@ section SMul variable [DecidableEq β] [SMul α β] {s s₁ s₂ t : Finset β} {a : α} {b : β} /-- The scaling of a finset `s` by a scalar `a`: `a • s = {a • x | x ∈ s}`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The translation of a finset `s` by a vector `a`: `a +ᵥ s = {a +ᵥ x | x ∈ s}`. -/] protected def smulFinset : SMul α (Finset β) where smul a := image <| (a • ·) diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean b/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean index 8b833f8c4dbe32..b82cc65f8d5826 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Basic.lean @@ -78,7 +78,7 @@ section One variable [One α] {s : Set α} {a : α} /-- The set `1 : Set α` is defined as `{1}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The set `0 : Set α` is defined as `{0}` in scope `Pointwise`. -/] protected def one : One (Set α) := ⟨{1}⟩ @@ -144,7 +144,7 @@ section Inv /-- The pointwise inversion of set `s⁻¹` is defined as `{x | x⁻¹ ∈ s}` in scope `Pointwise`. It is equal to `{x⁻¹ | x ∈ s}`, see `Set.image_inv_eq_inv`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise negation of set `-s` is defined as `{x | -x ∈ s}` in scope `Pointwise`. It is equal to `{-x | x ∈ s}`, see `Set.image_neg_eq_neg`. -/] protected def inv [Inv α] : Inv (Set α) := @@ -290,7 +290,7 @@ variable {ι : Sort*} {κ : ι → Sort*} [Mul α] {s s₁ s₂ t t₁ t₂ u : /-- The pointwise multiplication of sets `s * t` and `t` is defined as `{x * y | x ∈ s, y ∈ t}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise addition of sets `s + t` is defined as `{x + y | x ∈ s, y ∈ t}` in locale `Pointwise`. -/] protected def mul : Mul (Set α) := @@ -432,7 +432,7 @@ variable {ι : Sort*} {κ : ι → Sort*} [Div α] {s s₁ s₂ t t₁ t₂ u : /-- The pointwise division of sets `s / t` is defined as `{x / y | x ∈ s, y ∈ t}` in locale `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise subtraction of sets `s - t` is defined as `{x - y | x ∈ s, y ∈ t}` in locale `Pointwise`. -/] protected def div : Div (Set α) := @@ -558,7 +558,7 @@ protected def ZPow [One α] [Mul α] [Inv α] : Pow (Set α) ℤ := scoped[Pointwise] attribute [instance] Set.NSMul Set.NPow Set.ZSMul Set.ZPow /-- `Set α` is a `Semigroup` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Set α` is an `AddSemigroup` under pointwise operations if `α` is. -/] protected def semigroup [Semigroup α] : Semigroup (Set α) := { Set.mul with mul_assoc := fun _ _ _ => image2_assoc mul_assoc } @@ -568,7 +568,7 @@ section CommSemigroup variable [CommSemigroup α] {s t : Set α} /-- `Set α` is a `CommSemigroup` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Set α` is an `AddCommSemigroup` under pointwise operations if `α` is. -/] protected def commSemigroup : CommSemigroup (Set α) := { Set.semigroup with mul_comm := fun _ _ => image2_comm mul_comm } @@ -588,7 +588,7 @@ section MulOneClass variable [MulOneClass α] /-- `Set α` is a `MulOneClass` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Set α` is an `AddZeroClass` under pointwise operations if `α` is. -/] protected def mulOneClass : MulOneClass (Set α) := { Set.one, Set.mul with @@ -628,7 +628,7 @@ section Monoid variable [Monoid α] {s t : Set α} {a : α} {m n : ℕ} /-- `Set α` is a `Monoid` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Set α` is an `AddMonoid` under pointwise operations if `α` is. -/] protected def monoid : Monoid (Set α) := { Set.semigroup, Set.mulOneClass, @Set.NPow α _ _ with } @@ -755,7 +755,7 @@ lemma Nontrivial.pow (hs : s.Nontrivial) : ∀ {n}, n ≠ 0 → (s ^ n).Nontrivi end CancelMonoid /-- `Set α` is a `CommMonoid` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Set α` is an `AddCommMonoid` under pointwise operations if `α` is. -/] protected def commMonoid [CommMonoid α] : CommMonoid (Set α) := { Set.monoid, Set.commSemigroup with } @@ -791,7 +791,7 @@ protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = {a} ∧ t = {b} rw [← nonempty_inv, inter_inv]; simp_rw [← image_inv_eq_inv, image_image, mul_inv_rev, inv_inv] /-- `Set α` is a division monoid under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Set α` is a subtraction monoid under pointwise operations if `α` is. -/] protected def divisionMonoid : DivisionMonoid (Set α) := { Set.monoid, Set.involutiveInv, Set.div, @Set.ZPow α _ _ _ with @@ -850,7 +850,7 @@ lemma singleton_zpow (a : α) (n : ℤ) : ({a} : Set α) ^ n = {a ^ n} := by cas end DivisionMonoid /-- `Set α` is a commutative division monoid under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) subtractionCommMonoid +@[to_additive (attr := instance_reducible) subtractionCommMonoid /-- `Set α` is a commutative subtraction monoid under pointwise operations if `α` is. -/] protected def divisionCommMonoid [DivisionCommMonoid α] : DivisionCommMonoid (Set α) := diff --git a/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean b/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean index cf2f02a38bb6e9..f678e82b001d37 100644 --- a/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean +++ b/Mathlib/Algebra/Group/Pointwise/Set/Scalar.lean @@ -64,13 +64,13 @@ namespace Set section SMul /-- The dilation of set `x • s` is defined as `{x • y | y ∈ s}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The translation of set `x +ᵥ s` is defined as `{x +ᵥ y | y ∈ s}` in scope `Pointwise`. -/] protected def smulSet [SMul α β] : SMul α (Set β) where smul a := image (a • ·) /-- The pointwise scalar multiplication of sets `s • t` is defined as `{x • y | x ∈ s, y ∈ t}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The pointwise scalar addition of sets `s +ᵥ t` is defined as `{x +ᵥ y | x ∈ s, y ∈ t}` in locale `Pointwise`. -/] protected def smul [SMul α β] : SMul (Set α) (Set β) where smul := image2 (· • ·) diff --git a/Mathlib/Algebra/Group/Subgroup/Basic.lean b/Mathlib/Algebra/Group/Subgroup/Basic.lean index 5bc9042d89b8d1..f67af0105777b4 100644 --- a/Mathlib/Algebra/Group/Subgroup/Basic.lean +++ b/Mathlib/Algebra/Group/Subgroup/Basic.lean @@ -755,6 +755,7 @@ def liftOfRightInverseAux (hf : Function.RightInverse f_inv f) (g : G₁ →* G rw [f.mem_ker, f.map_mul, f.map_inv, mul_inv_eq_one, f.map_mul] simp only [hf _] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem liftOfRightInverseAux_comp_apply (hf : Function.RightInverse f_inv f) (g : G₁ →* G₃) (hg : f.ker ≤ g.ker) (x : G₁) : (f.liftOfRightInverseAux f_inv hf g hg) (f x) = g x := by @@ -862,6 +863,7 @@ instance (priority := 100) normal_subgroupOf {H N : Subgroup G} [N.Normal] : (N.subgroupOf H).Normal := Subgroup.normal_comap _ +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem comap_normalClosure_image_ge (s : Set G) (f : G →* N) : (normalClosure s) ≤ (normalClosure (f '' s)).comap f := by @@ -993,6 +995,7 @@ namespace IsConj open Subgroup +set_option backward.isDefEq.respectTransparency false in theorem normalClosure_eq_top_of {N : Subgroup G} [hn : N.Normal] {g g' : G} {hg : g ∈ N} {hg' : g' ∈ N} (hc : IsConj g g') (ht : normalClosure ({⟨g, hg⟩} : Set N) = ⊤) : normalClosure ({⟨g', hg'⟩} : Set N) = ⊤ := by diff --git a/Mathlib/Algebra/Group/Subgroup/Ker.lean b/Mathlib/Algebra/Group/Subgroup/Ker.lean index 1aa93164bf554e..61f2a2692064b0 100644 --- a/Mathlib/Algebra/Group/Subgroup/Ker.lean +++ b/Mathlib/Algebra/Group/Subgroup/Ker.lean @@ -301,6 +301,7 @@ theorem ker_one : (1 : G →* M).ker = ⊤ := theorem ker_id : (MonoidHom.id G).ker = ⊥ := rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem ker_eq_top_iff {f : G →* M} : f.ker = ⊤ ↔ f = 1 := by simp [ker, ← top_le_iff, SetLike.le_def, f.ext_iff] @@ -482,6 +483,7 @@ theorem map_subtype_le_map_subtype {G' : Subgroup G} {H K : Subgroup G'} : H.map G'.subtype ≤ K.map G'.subtype ↔ H ≤ K := map_le_map_iff_of_injective G'.subtype_injective +set_option backward.isDefEq.respectTransparency false in /-- Subgroups of the subgroup `H` are considered as subgroups that are less than or equal to `H`. -/ @[to_additive (attr := simps apply_coe) /-- Additive subgroups of the subgroup `H` are considered as diff --git a/Mathlib/Algebra/Group/Subgroup/Map.lean b/Mathlib/Algebra/Group/Subgroup/Map.lean index 2d8825b6258ce9..0813dc11783aff 100644 --- a/Mathlib/Algebra/Group/Subgroup/Map.lean +++ b/Mathlib/Algebra/Group/Subgroup/Map.lean @@ -397,6 +397,7 @@ end Subgroup namespace MulEquiv variable {H : Type*} [Group H] +set_option backward.isDefEq.respectTransparency false in /-- An isomorphism of groups gives an order isomorphism between the lattices of subgroups, defined by sending subgroups to their inverse images. @@ -423,6 +424,7 @@ lemma coe_comapSubgroup (e : G ≃* H) : comapSubgroup e = Subgroup.comap e.toMo @[to_additive (attr := simp)] lemma symm_comapSubgroup (e : G ≃* H) : (comapSubgroup e).symm = comapSubgroup e.symm := rfl +set_option backward.isDefEq.respectTransparency false in /-- An isomorphism of groups gives an order isomorphism between the lattices of subgroups, defined by sending subgroups to their forward images. diff --git a/Mathlib/Algebra/Group/Subgroup/Pointwise.lean b/Mathlib/Algebra/Group/Subgroup/Pointwise.lean index 6813019b0ca24b..aa1c4ec42a96d7 100644 --- a/Mathlib/Algebra/Group/Subgroup/Pointwise.lean +++ b/Mathlib/Algebra/Group/Subgroup/Pointwise.lean @@ -528,6 +528,7 @@ theorem Normal.of_conjugate_fixed {H : Subgroup G} (h : ∀ g : G, (MulAut.conj ← mul_assoc, inv_mul_cancel, one_mul] exact hn +set_option backward.isDefEq.respectTransparency false in theorem normalCore_eq_iInf_conjAct (H : Subgroup G) : H.normalCore = ⨅ (g : ConjAct G), g • H := by ext g diff --git a/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean b/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean index 5440c705af0fc6..a0e1738206669b 100644 --- a/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean +++ b/Mathlib/Algebra/Group/Subgroup/ZPowers/Basic.lean @@ -111,6 +111,7 @@ namespace Subgroup variable {s : Set G} {g : G} +set_option backward.isDefEq.respectTransparency false in @[to_additive] instance zpowers_isMulCommutative (g : G) : IsMulCommutative (zpowers g) := ⟨⟨fun ⟨_, _, h₁⟩ ⟨_, _, h₂⟩ ↦ by simp [← h₁, ← h₂, zpow_mul_comm]⟩⟩ diff --git a/Mathlib/Algebra/Group/Submonoid/Operations.lean b/Mathlib/Algebra/Group/Submonoid/Operations.lean index 5107384f25ea41..a74117734a7317 100644 --- a/Mathlib/Algebra/Group/Submonoid/Operations.lean +++ b/Mathlib/Algebra/Group/Submonoid/Operations.lean @@ -796,6 +796,7 @@ theorem comap_bot' (f : F) : (⊥ : Submonoid N).comap f = mker f := theorem restrict_mker (f : M →* N) : mker (f.restrict S) = (MonoidHom.mker f).comap S.subtype := rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem mrangeRestrict_mker (f : M →* N) : mker (mrangeRestrict f) = mker f := by ext x @@ -1120,6 +1121,7 @@ section Units namespace Submonoid +set_option backward.isDefEq.respectTransparency false in /-- The multiplicative equivalence between the type of units of `M` and the submonoid of unit elements of `M`. -/ @[to_additive (attr := simps!) /-- The additive equivalence between the type of additive units of diff --git a/Mathlib/Algebra/Group/Submonoid/Pointwise.lean b/Mathlib/Algebra/Group/Submonoid/Pointwise.lean index f3c3a07ab3a768..e2c09a095bacfa 100644 --- a/Mathlib/Algebra/Group/Submonoid/Pointwise.lean +++ b/Mathlib/Algebra/Group/Submonoid/Pointwise.lean @@ -127,7 +127,7 @@ theorem pow_smul_mem_closure_smul {N : Type*} [CommMonoid N] [MulAction M N] [Is variable [Group G] /-- The submonoid with every element inverted. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The additive submonoid with every element negated. -/] protected def inv : Inv (Submonoid G) where inv S := @@ -146,7 +146,7 @@ theorem mem_inv {g : G} {S : Submonoid G} : g ∈ S⁻¹ ↔ g⁻¹ ∈ S := Iff.rfl /-- Inversion is involutive on submonoids. -/ -@[to_additive (attr := implicit_reducible) /-- Inversion is involutive on additive submonoids. -/] +@[to_additive (attr := instance_reducible) /-- Inversion is involutive on additive submonoids. -/] def involutiveInv : InvolutiveInv (Submonoid G) := SetLike.coe_injective.involutiveInv _ fun _ => rfl diff --git a/Mathlib/Algebra/Group/Units/Defs.lean b/Mathlib/Algebra/Group/Units/Defs.lean index 96dd3018a9281f..75533b2fd47b41 100644 --- a/Mathlib/Algebra/Group/Units/Defs.lean +++ b/Mathlib/Algebra/Group/Units/Defs.lean @@ -638,12 +638,12 @@ section NoncomputableDefs variable {M : Type*} /-- Constructs an inv operation for a `Monoid` consisting only of units. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def invOfIsUnit [Monoid M] (h : ∀ a : M, IsUnit a) : Inv M where inv := fun a => ↑(h a).unit⁻¹ /-- Constructs a `Group` structure on a `Monoid` consisting only of units. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def groupOfIsUnit [hM : Monoid M] (h : ∀ a : M, IsUnit a) : Group M := { hM with toInv := invOfIsUnit h, @@ -652,7 +652,7 @@ noncomputable def groupOfIsUnit [hM : Monoid M] (h : ∀ a : M, IsUnit a) : Grou rw [Units.inv_mul_eq_iff_eq_mul, (h a).unit_spec, mul_one] } /-- Constructs a `CommGroup` structure on a `CommMonoid` consisting only of units. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def commGroupOfIsUnit [hM : CommMonoid M] (h : ∀ a : M, IsUnit a) : CommGroup M := { hM with toInv := invOfIsUnit h, diff --git a/Mathlib/Algebra/Group/WithOne/Basic.lean b/Mathlib/Algebra/Group/WithOne/Basic.lean index c3ce8cae26ec97..e5cbef6052abea 100644 --- a/Mathlib/Algebra/Group/WithOne/Basic.lean +++ b/Mathlib/Algebra/Group/WithOne/Basic.lean @@ -31,6 +31,7 @@ variable {α : Type u} {β : Type v} {γ : Type w} namespace WithOne +set_option backward.isDefEq.respectTransparency false in @[to_additive] instance instInvolutiveInv [InvolutiveInv α] : InvolutiveInv (WithOne α) where inv_inv a := (Option.map_map _ _ _).trans <| by simp_rw [inv_comp_inv, Option.map_id, id] diff --git a/Mathlib/Algebra/GroupWithZero/Action/Defs.lean b/Mathlib/Algebra/GroupWithZero/Action/Defs.lean index f7ad5ae6267f1a..c6e0fb79136517 100644 --- a/Mathlib/Algebra/GroupWithZero/Action/Defs.lean +++ b/Mathlib/Algebra/GroupWithZero/Action/Defs.lean @@ -159,7 +159,7 @@ protected abbrev Function.Surjective.smulWithZero (f : ZeroHom A A') (hf : Surje variable (A) /-- Compose a `SMulWithZero` with a `ZeroHom`, with action `f r' • m` -/ -@[implicit_reducible] +@[instance_reducible] def SMulWithZero.compHom (f : ZeroHom M₀' M₀) : SMulWithZero M₀' A where smul := (f · • ·) smul_zero m := smul_zero (f m) @@ -238,7 +238,7 @@ protected abbrev Function.Surjective.mulActionWithZero (f : ZeroHom A A') (hf : variable (A) /-- Compose a `MulActionWithZero` with a `MonoidWithZeroHom`, with action `f r' • m` -/ -@[implicit_reducible] +@[instance_reducible] def MulActionWithZero.compHom (f : M₀' →*₀ M₀) : MulActionWithZero M₀' A where __ := SMulWithZero.compHom A f.toZeroHom mul_smul r s m := by change f (r * s) • m = f r • f s • m; simp [mul_smul] diff --git a/Mathlib/Algebra/GroupWithZero/Associated.lean b/Mathlib/Algebra/GroupWithZero/Associated.lean index ed2f121e36380d..2290d72fe23a9d 100644 --- a/Mathlib/Algebra/GroupWithZero/Associated.lean +++ b/Mathlib/Algebra/GroupWithZero/Associated.lean @@ -406,6 +406,7 @@ theorem quotient_mk_eq_mk [Monoid M] (a : M) : ⟦a⟧ = Associates.mk a := theorem quot_mk_eq_mk [Monoid M] (a : M) : Quot.mk Setoid.r a = Associates.mk a := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem quot_out [Monoid M] (a : Associates M) : Associates.mk (Quot.out a) = a := by rw [← quot_mk_eq_mk, Quot.out_eq] diff --git a/Mathlib/Algebra/GroupWithZero/Basic.lean b/Mathlib/Algebra/GroupWithZero/Basic.lean index a6ce83d77a3f5c..e8156e9ac9b22a 100644 --- a/Mathlib/Algebra/GroupWithZero/Basic.lean +++ b/Mathlib/Algebra/GroupWithZero/Basic.lean @@ -108,7 +108,7 @@ theorem eq_zero_of_zero_eq_one (h : (0 : M₀) = 1) (a : M₀) : a = 0 := by Somewhat arbitrarily, we define the default element to be `0`. All other elements will be provably equal to it, but not necessarily definitionally equal. -/ -@[implicit_reducible] +@[instance_reducible] def uniqueOfZeroEqOne (h : (0 : M₀) = 1) : Unique M₀ where default := 0 uniq := eq_zero_of_zero_eq_one h diff --git a/Mathlib/Algebra/GroupWithZero/Indicator.lean b/Mathlib/Algebra/GroupWithZero/Indicator.lean index db9d0159d74aa4..b19269b9baf9b2 100644 --- a/Mathlib/Algebra/GroupWithZero/Indicator.lean +++ b/Mathlib/Algebra/GroupWithZero/Indicator.lean @@ -68,6 +68,7 @@ variable [MulZeroOneClass M₀] {s t : Set ι} {i : ι} lemma inter_indicator_one : (s ∩ t).indicator (1 : ι → M₀) = s.indicator 1 * t.indicator 1 := funext fun _ ↦ by simp only [← inter_indicator_mul, Pi.mul_apply, Pi.one_apply, one_mul]; congr +set_option backward.isDefEq.respectTransparency false in lemma indicator_prod_one {t : Set κ} {j : κ} : (s ×ˢ t).indicator (1 : ι × κ → M₀) (i, j) = s.indicator 1 i * t.indicator 1 j := by simp_rw [indicator, mem_prod_eq] diff --git a/Mathlib/Algebra/GroupWithZero/InjSurj.lean b/Mathlib/Algebra/GroupWithZero/InjSurj.lean index f4dcc90064bab7..382fae62eb993e 100644 --- a/Mathlib/Algebra/GroupWithZero/InjSurj.lean +++ b/Mathlib/Algebra/GroupWithZero/InjSurj.lean @@ -201,7 +201,7 @@ protected abbrev Function.Injective.commGroupWithZero [Zero G₀'] [Mul G₀'] [ /-- Push forward a `CommGroupWithZero` along a surjective function. See note [reducible non-instances]. -/ -@[implicit_reducible] +@[instance_reducible] protected def Function.Surjective.commGroupWithZero [Zero G₀'] [Mul G₀'] [One G₀'] [Inv G₀'] [Div G₀'] [Pow G₀' ℕ] [Pow G₀' ℤ] (h01 : (0 : G₀') ≠ 1) (f : G₀ → G₀') (hf : Surjective f) (zero : f 0 = 0) (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y) diff --git a/Mathlib/Algebra/GroupWithZero/Invertible.lean b/Mathlib/Algebra/GroupWithZero/Invertible.lean index e2304a4584fe59..ee672b5ca71e32 100644 --- a/Mathlib/Algebra/GroupWithZero/Invertible.lean +++ b/Mathlib/Algebra/GroupWithZero/Invertible.lean @@ -49,7 +49,7 @@ section GroupWithZero variable [GroupWithZero α] /-- `a⁻¹` is an inverse of `a` if `a ≠ 0` -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfNonzero {a : α} (h : a ≠ 0) : Invertible a := ⟨a⁻¹, inv_mul_cancel₀ h, mul_inv_cancel₀ h⟩ @@ -82,7 +82,7 @@ theorem div_self_of_invertible (a : α) [Invertible a] : a / a = 1 := div_self (Invertible.ne_zero a) /-- `b / a` is the inverse of `a / b` -/ -@[implicit_reducible] +@[instance_reducible] def invertibleDiv (a b : α) [Invertible a] [Invertible b] : Invertible (a / b) := ⟨b / a, by simp [← mul_div_assoc], by simp [← mul_div_assoc]⟩ diff --git a/Mathlib/Algebra/GroupWithZero/ProdHom.lean b/Mathlib/Algebra/GroupWithZero/ProdHom.lean index ebc7b4a8b80234..cd205e16b1de2d 100644 --- a/Mathlib/Algebra/GroupWithZero/ProdHom.lean +++ b/Mathlib/Algebra/GroupWithZero/ProdHom.lean @@ -96,6 +96,7 @@ lemma inr_apply_unit [DecidablePred fun x : H₀ ↦ x = 0] (x : H₀ˣ) : @[simp] lemma fst_apply_coe (x : G₀ˣ × H₀ˣ) : fst G₀ H₀ x = x.fst := by rfl @[simp] lemma snd_apply_coe (x : G₀ˣ × H₀ˣ) : snd G₀ H₀ x = x.snd := by rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem fst_inl [DecidablePred fun x : G₀ ↦ x = 0] (x : G₀) : fst _ H₀ (inl _ _ x) = x := by @@ -107,6 +108,7 @@ theorem fst_comp_inl [DecidablePred fun x : G₀ ↦ x = 0] : (fst ..).comp (inl G₀ H₀) = .id _ := MonoidWithZeroHom.ext fun _ ↦ fst_inl _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem snd_comp_inl [DecidablePred fun x : G₀ ↦ x = 0] : (snd ..).comp (inl G₀ H₀) = 1 := by @@ -118,6 +120,7 @@ theorem snd_inl_apply_of_ne_zero [DecidablePred fun x : G₀ ↦ x = 0] {x : G snd _ _ (inl _ H₀ x) = 1 := by rw [← MonoidWithZeroHom.comp_apply, snd_comp_inl, one_apply_of_ne_zero hx] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem fst_comp_inr [DecidablePred fun x : H₀ ↦ x = 0] : (fst ..).comp (inr G₀ H₀) = 1 := by @@ -129,6 +132,7 @@ theorem fst_inr_apply_of_ne_zero [DecidablePred fun x : H₀ ↦ x = 0] {x : H fst _ _ (inr G₀ _ x) = 1 := by rw [← MonoidWithZeroHom.comp_apply, fst_comp_inr, one_apply_of_ne_zero hx] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem snd_inr [DecidablePred fun x : H₀ ↦ x = 0] (x : H₀) : snd _ _ (inr G₀ _ x) = x := by @@ -155,10 +159,12 @@ lemma snd_surjective : Function.Surjective (snd G₀ H₀) := by variable [DecidablePred fun x : G₀ ↦ x = 0] [DecidablePred fun x : H₀ ↦ x = 0] +set_option backward.isDefEq.respectTransparency false in theorem inl_mul_inr_eq_mk_of_unit (m : G₀ˣ) (n : H₀ˣ) : (inl G₀ H₀ m * inr G₀ H₀ n) = (m, n) := by simp [inl, WithZero.withZeroUnitsEquiv, inr, ← WithZero.coe_mul] +set_option backward.isDefEq.respectTransparency false in theorem commute_inl_inr (m : G₀) (n : H₀) : Commute (inl G₀ H₀ m) (inr G₀ H₀ n) := by obtain rfl | ⟨_, rfl⟩ := GroupWithZero.eq_zero_or_unit m <;> obtain rfl | ⟨_, rfl⟩ := GroupWithZero.eq_zero_or_unit n <;> diff --git a/Mathlib/Algebra/GroupWithZero/Range.lean b/Mathlib/Algebra/GroupWithZero/Range.lean index 68a28f4edcf81d..ac46908b9bd4ab 100644 --- a/Mathlib/Algebra/GroupWithZero/Range.lean +++ b/Mathlib/Algebra/GroupWithZero/Range.lean @@ -195,6 +195,7 @@ lemma valueGroup_eq_range : Units.val '' (valueGroup f) = (range f \ {0}) := by refine ⟨Units.mk0 x hx₀, ?_, rfl⟩ simpa [Units.val_mk0, mem_range] using ⟨y, hy⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma ValueGroup₀.restrict₀_range_eq_top : range (ValueGroup₀.restrict₀ f) = ⊤ := by rw [top_eq_univ, range_eq_univ] @@ -222,7 +223,7 @@ variable [MonoidWithZero A] [CommGroupWithZero B] [MonoidWithZeroHomClass F A B] theorem mem_valueGroup_iff_of_comm {y : Bˣ} : y ∈ valueGroup f ↔ ∃ a, f a ≠ 0 ∧ ∃ x, f a * y = f x := by refine ⟨fun hy ↦ ?_, fun ⟨a, ha, x, hy⟩ ↦ ?_⟩ - · simp only [valueGroup, valueMonoid, Submonoid.coe_set_mk, Subsemigroup.coe_set_mk] at hy + · simp only [valueGroup, valueMonoid] at hy induction hy using Subgroup.closure_induction with | mem _ h => obtain ⟨a, ha⟩ := h diff --git a/Mathlib/Algebra/GroupWithZero/Units/Basic.lean b/Mathlib/Algebra/GroupWithZero/Units/Basic.lean index 9916a90765c529..96280fcec84a55 100644 --- a/Mathlib/Algebra/GroupWithZero/Units/Basic.lean +++ b/Mathlib/Algebra/GroupWithZero/Units/Basic.lean @@ -511,7 +511,7 @@ variable {M : Type*} [Nontrivial M] open Classical in /-- Constructs a `GroupWithZero` structure on a `MonoidWithZero` consisting only of units and 0. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def groupWithZeroOfIsUnitOrEqZero [hM : MonoidWithZero M] (h : ∀ a : M, IsUnit a ∨ a = 0) : GroupWithZero M := { hM with @@ -523,7 +523,7 @@ noncomputable def groupWithZeroOfIsUnitOrEqZero [hM : MonoidWithZero M] /-- Constructs a `CommGroupWithZero` structure on a `CommMonoidWithZero` consisting only of units and 0. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def commGroupWithZeroOfIsUnitOrEqZero [hM : CommMonoidWithZero M] (h : ∀ a : M, IsUnit a ∨ a = 0) : CommGroupWithZero M := { groupWithZeroOfIsUnitOrEqZero h, hM with } diff --git a/Mathlib/Algebra/GroupWithZero/WithZero.lean b/Mathlib/Algebra/GroupWithZero/WithZero.lean index d86e3ee518fc58..5b62e51974c245 100644 --- a/Mathlib/Algebra/GroupWithZero/WithZero.lean +++ b/Mathlib/Algebra/GroupWithZero/WithZero.lean @@ -262,6 +262,7 @@ instance instDivInvMonoid [DivInvMonoid α] : DivInvMonoid (WithZero α) where instance instDivInvOneMonoid [DivInvOneMonoid α] : DivInvOneMonoid (WithZero α) where +set_option backward.isDefEq.respectTransparency false in instance instInvolutiveInv [InvolutiveInv α] : InvolutiveInv (WithZero α) where inv_inv a := (Option.map_map _ _ _).trans <| by simp @@ -300,6 +301,7 @@ def unitsWithZeroEquiv : (WithZero α)ˣ ≃* α where instance [Nontrivial α] : Nontrivial (WithZero α)ˣ := unitsWithZeroEquiv.toEquiv.surjective.nontrivial +set_option backward.isDefEq.respectTransparency false in theorem coe_unitsWithZeroEquiv_eq_units_val (γ : (WithZero α)ˣ) : ↑(unitsWithZeroEquiv γ) = γ.val := by simp only [WithZero.unitsWithZeroEquiv, MulEquiv.coe_mk, Equiv.coe_fn_mk, WithZero.coe_unzero] @@ -320,6 +322,7 @@ lemma withZeroUnitsEquiv_symm_apply_coe {G : Type*} [GroupWithZero G] WithZero.withZeroUnitsEquiv.symm (a : G) = a := by simp +set_option backward.isDefEq.respectTransparency false in /-- A version of `Equiv.optionCongr` for `WithZero`. -/ @[simps!] def _root_.MulEquiv.withZero [Group β] : diff --git a/Mathlib/Algebra/Homology/Additive.lean b/Mathlib/Algebra/Homology/Additive.lean index 86ab7ca1703cef..1465680d9bdc7d 100644 --- a/Mathlib/Algebra/Homology/Additive.lean +++ b/Mathlib/Algebra/Homology/Additive.lean @@ -122,6 +122,7 @@ instance Functor.map_homogical_complex_additive (F : V ⥤ W) [F.Additive] (c : variable (W₁) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor on homological complexes induced by the identity functor is isomorphic to the identity functor. -/ @@ -188,6 +189,7 @@ def NatIso.mapHomologicalComplex {F G : W₁ ⥤ W₂} [F.PreservesZeroMorphisms inv_hom_id := by simp only [← NatTrans.mapHomologicalComplex_comp, α.inv_hom_id, NatTrans.mapHomologicalComplex_id] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories induces an equivalences between the respective categories of homological complex. @@ -209,6 +211,7 @@ namespace ChainComplex variable {α : Type*} [AddRightCancelSemigroup α] [One α] [DecidableEq α] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem map_chain_complex_of (F : W₁ ⥤ W₂) [F.PreservesZeroMorphisms] (X : α → W₁) (d : ∀ n, X (n + 1) ⟶ X n) (sq : ∀ n, d (n + 1) ≫ d n = 0) : diff --git a/Mathlib/Algebra/Homology/Augment.lean b/Mathlib/Algebra/Homology/Augment.lean index 0db91bf9035150..2e754ced6a1f67 100644 --- a/Mathlib/Algebra/Homology/Augment.lean +++ b/Mathlib/Algebra/Homology/Augment.lean @@ -119,6 +119,7 @@ theorem chainComplex_d_succ_succ_zero (C : ChainComplex V ℕ) (i : ℕ) : C.d ( rw [C.shape] exact i.succ_succ_ne_one.symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Augmenting a truncated complex with the original object and morphism is isomorphic (with components the identity) to the original complex. @@ -280,6 +281,7 @@ theorem cochainComplex_d_succ_succ_zero (C : CochainComplex V ℕ) (i : ℕ) : C simp only [ComplexShape.up_Rel, zero_add] exact (Nat.one_lt_succ_succ _).ne +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Augmenting a truncated complex with the original object and morphism is isomorphic (with components the identity) to the original complex. diff --git a/Mathlib/Algebra/Homology/BifunctorAssociator.lean b/Mathlib/Algebra/Homology/BifunctorAssociator.lean index af70bcf3fb53fd..9de2cc124aca4c 100644 --- a/Mathlib/Algebra/Homology/BifunctorAssociator.lean +++ b/Mathlib/Algebra/Homology/BifunctorAssociator.lean @@ -314,6 +314,7 @@ lemma ι_D₂ [HasGoodTrifunctor₁₂Obj F₁₂ G K₁ K₂ K₃ c₁₂ c₄] d₂ F₁₂ G K₁ K₂ K₃ c₁₂ c₄ i₁ i₂ i₃ j' := by simp [D₂] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma ι_D₃ : ι F₁₂ G K₁ K₂ K₃ c₁₂ c₄ i₁ i₂ i₃ j h ≫ D₃ F₁₂ G K₁ K₂ K₃ c₁₂ c₄ j j' = @@ -334,6 +335,7 @@ lemma ι_D₃ : end +set_option backward.isDefEq.respectTransparency.types false in lemma d_eq (j j' : ι₄) [HasGoodTrifunctor₁₂Obj F₁₂ G K₁ K₂ K₃ c₁₂ c₄] : (mapBifunctor (mapBifunctor K₁ K₂ F₁₂ c₁₂) K₃ G c₄).d j j' = D₁ F₁₂ G K₁ K₂ K₃ c₁₂ c₄ j j' + D₂ F₁₂ G K₁ K₂ K₃ c₁₂ c₄ j j' + diff --git a/Mathlib/Algebra/Homology/BifunctorShift.lean b/Mathlib/Algebra/Homology/BifunctorShift.lean index 1181a469aa314d..2179772f5f1368 100644 --- a/Mathlib/Algebra/Homology/BifunctorShift.lean +++ b/Mathlib/Algebra/Homology/BifunctorShift.lean @@ -132,6 +132,7 @@ variable [HasZeroMorphisms C₁] [Preadditive C₂] [Preadditive D] (F : C₁ ⥤ C₂ ⥤ D) [F.PreservesZeroMorphisms] [∀ (X₁ : C₁), (F.obj X₁).Additive] (y : ℤ) [HasMapBifunctor K₁ K₂ F] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `mapBifunctorShift₂Iso`. -/ @[simps! hom_f_f inv_f_f] diff --git a/Mathlib/Algebra/Homology/CochainComplexOpposite.lean b/Mathlib/Algebra/Homology/CochainComplexOpposite.lean index 64b8dbc3f9a1d8..6f17863cb0ffec 100644 --- a/Mathlib/Algebra/Homology/CochainComplexOpposite.lean +++ b/Mathlib/Algebra/Homology/CochainComplexOpposite.lean @@ -57,6 +57,7 @@ namespace ChainComplex variable [HasZeroMorphisms C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] HomologicalComplex.XIsoOfEq in /-- The equivalence of categories `ChainComplex C ℤ ≌ CochainComplex C ℤ`. -/ @@ -114,6 +115,7 @@ def homotopyOp (h : Homotopy f g) : symm exact prevD_eq _ (j' := n - 1) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma homotopyOp_hom_eq (h : Homotopy f g) (p q p' q' : ℤ) (hp : p + p' = 0 := by lia) (hq : q + q' = 0 := by lia) : @@ -157,6 +159,7 @@ def homotopyUnop (h : Homotopy ((opEquivalence C).functor.map f.op) dsimp simp [H (- -(n + 1)) (- -n) (n + 1) n (by simp) (by simp), ← op_comp_assoc, ← op_comp]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma homotopyUnop_hom_eq (h : Homotopy ((opEquivalence C).functor.map f.op) @@ -171,6 +174,7 @@ lemma homotopyUnop_hom_eq end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Two morphisms of cochain complexes indexed by `ℤ` are homotopic iff they are homotopic after the application of the functor @@ -189,6 +193,7 @@ def homotopyOpEquiv {K L : CochainComplex C ℤ} {f g : K ⟶ L} : simp [homotopyOp_hom_eq _ p q (-p) (-q), homotopyUnop_hom_eq _ (-q) (-p) q p] +set_option backward.isDefEq.respectTransparency.types false in lemma exactAt_op {K : CochainComplex C ℤ} {n : ℤ} (hK : K.ExactAt n) (m : ℤ) (hm : n + m = 0 := by lia) : ((opEquivalence C).functor.obj (op K)).ExactAt m := by diff --git a/Mathlib/Algebra/Homology/CommSq.lean b/Mathlib/Algebra/Homology/CommSq.lean index c86adab4086186..71d8a72a8122ec 100644 --- a/Mathlib/Algebra/Homology/CommSq.lean +++ b/Mathlib/Algebra/Homology/CommSq.lean @@ -55,6 +55,7 @@ noncomputable def CommSq.shortComplex (sq : CommSq f g inl inr) : ShortComplex C g := biprod.desc inl inr zero := by simp [sq.w] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A commutative square in a preadditive category is a pushout square iff the corresponding diagram `X₁ ⟶ X₂ ⊞ X₃ ⟶ X₄ ⟶ 0` makes `X₄` a cokernel. -/ @@ -136,6 +137,7 @@ noncomputable def CommSq.shortComplex' (sq : CommSq fst snd f g) : ShortComplex g := biprod.desc f (-g) zero := by simp [sq.w] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A commutative square in a preadditive category is a pullback square iff the corresponding diagram `0 ⟶ X₁ ⟶ X₂ ⊞ X₃ ⟶ X₄ ⟶ 0` makes `X₁` a kernel. -/ diff --git a/Mathlib/Algebra/Homology/ComplexShape.lean b/Mathlib/Algebra/Homology/ComplexShape.lean index ce57848afdc0bd..fe9b41934d3aa1 100644 --- a/Mathlib/Algebra/Homology/ComplexShape.lean +++ b/Mathlib/Algebra/Homology/ComplexShape.lean @@ -88,7 +88,7 @@ def refl (ι : Type*) : ComplexShape ι where /-- The reverse of a `ComplexShape`. -/ -@[simps] +@[simps, implicit_reducible] def symm (c : ComplexShape ι) : ComplexShape ι where Rel i j := c.Rel j i next_eq w w' := c.prev_eq w w' @@ -96,7 +96,7 @@ def symm (c : ComplexShape ι) : ComplexShape ι where /-- If `c : ComplexShape α` is such that `c.Rel` is decidable, it is also the case of `c.symm.Rel`. -/ -@[implicit_reducible] +@[instance_reducible] def decidableRelSymm {α : Type*} (c : ComplexShape α) [DecidableRel c.Rel] : DecidableRel c.symm.Rel := fun a b ↦ decidable_of_iff (c.Rel b a) Iff.rfl diff --git a/Mathlib/Algebra/Homology/ComplexShapeSigns.lean b/Mathlib/Algebra/Homology/ComplexShapeSigns.lean index b4cff6ba6d2ac6..b71a2e9b49f547 100644 --- a/Mathlib/Algebra/Homology/ComplexShapeSigns.lean +++ b/Mathlib/Algebra/Homology/ComplexShapeSigns.lean @@ -177,6 +177,7 @@ instance : TensorSigns (ComplexShape.down ℕ) where @[simp] lemma ε_down_ℕ (n : ℕ) : (ComplexShape.down ℕ).ε n = (-1 : ℤˣ) ^ n := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : TensorSigns (ComplexShape.up ℤ) where ε' := MonoidHom.mk' Int.negOnePow Int.negOnePow_add @@ -275,7 +276,7 @@ end ComplexShape /-- The total complex shape for `c₂`, `c₁` and `c₁₂` that is deduced from a total complex shape for `c₁`, `c₂` and `c₁₂`. -/ -@[implicit_reducible] +@[instance_reducible] def TotalComplexShape.symm [TotalComplexShape c₁ c₂ c₁₂] : TotalComplexShape c₂ c₁ c₁₂ where π := fun ⟨i₂, i₁⟩ ↦ ComplexShape.π c₁ c₂ c₁₂ ⟨i₁, i₂⟩ @@ -301,7 +302,7 @@ class TotalComplexShapeSymmetry [TotalComplexShape c₁ c₂ c₁₂] [TotalComp /-- The symmetry between the total complex shape for `c₁`, `c₂` and `c₁₂`, and its symmetric total complex shape. -/ -@[implicit_reducible] +@[instance_reducible] def TotalComplexShape.symmSymmetry [TotalComplexShape c₁ c₂ c₁₂] : letI := TotalComplexShape.symm c₁ c₂ c₁₂ TotalComplexShapeSymmetry c₁ c₂ c₁₂ := @@ -342,6 +343,7 @@ lemma σ_ε₂ (i₁ : I₁) {i₂ i₂' : I₂} (h₂ : c₂.Rel i₂ i₂') : σ c₁ c₂ c₁₂ i₁ i₂ * ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ = ε₁ c₂ c₁ c₁₂ ⟨i₂, i₁⟩ * σ c₁ c₂ c₁₂ i₁ i₂' := TotalComplexShapeSymmetry.σ_ε₂ i₁ h₂ +set_option backward.isDefEq.respectTransparency.types false in @[simps] instance : TotalComplexShapeSymmetry (up ℤ) (up ℤ) (up ℤ) where symm p q := add_comm q p @@ -360,7 +362,7 @@ end ComplexShape /-- The obvious `TotalComplexShapeSymmetry c₂ c₁ c₁₂` deduced from a `TotalComplexShapeSymmetry c₁ c₂ c₁₂`. -/ -@[implicit_reducible] +@[instance_reducible] def TotalComplexShapeSymmetry.symmetry [TotalComplexShape c₁ c₂ c₁₂] [TotalComplexShape c₂ c₁ c₁₂] [TotalComplexShapeSymmetry c₁ c₂ c₁₂] : TotalComplexShapeSymmetry c₂ c₁ c₁₂ where diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean index 72369bf49d4c35..4158348c55b2a7 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean @@ -272,6 +272,7 @@ def singleFunctorsPostcompQIso : SingleFunctors.postcompIsoOfIso (CochainComplex.singleFunctors C) (quotientCompQhIso C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma singleFunctorsPostcompQIso_hom_hom (n : ℤ) : (singleFunctorsPostcompQIso C).hom.hom n = 𝟙 _ := by @@ -282,6 +283,7 @@ lemma singleFunctorsPostcompQIso_hom_hom (n : ℤ) : erw [Category.id_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma singleFunctorsPostcompQIso_inv_hom (n : ℤ) : (singleFunctorsPostcompQIso C).inv.hom n = 𝟙 _ := by diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean index 2f6cac77be8ef4..63f1bd27d0f714 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean @@ -37,6 +37,29 @@ namespace Ext section CovariantSequence +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + DerivedCategory + Ext + Functor.shift + HomologicalComplexUpToQuasiIso.Qh + Localization.SmallHom + Localization.SmallShiftedHom + MorphismProperty.Localization + MorphismProperty.Localization' + MorphismProperty.Q + MorphismProperty.Q' + Qh + Quotient.functor + Quotient.lift + ShortComplex.ShortExact.singleTriangle + SingleFunctors.postcomp + Triangle.mk + instCategoryDerivedCategory._aux_5 + preadditiveCoyoneda + preadditiveCoyonedaObj + singleFunctors + lemma hom_comp_singleFunctor_map_shift [HasDerivedCategory.{w'} C] {X Y Z : C} {n : ℕ} (x : Ext X Y n) (f : Y ⟶ Z) : x.hom ≫ ((DerivedCategory.singleFunctor C 0).map f)⟦(n : ℤ)⟧' = @@ -45,6 +68,7 @@ lemma hom_comp_singleFunctor_map_shift [HasDerivedCategory.{w'} C] variable {X : C} {S : ShortComplex C} (hS : S.ShortExact) +set_option backward.isDefEq.respectTransparency.types false in lemma preadditiveCoyoneda_homologySequenceδ_singleTriangle_apply [HasDerivedCategory.{w'} C] {X : C} {n₀ : ℕ} (x : Ext X S.X₃ n₀) {n₁ : ℕ} (h : n₀ + 1 = n₁) : @@ -185,6 +209,7 @@ lemma singleFunctor_map_comp_hom [HasDerivedCategory.{w'} C] ((mk₀ f).comp x (zero_add n)).hom := by simp only [comp_hom, mk₀_hom, ShiftedHom.mk₀_comp] +set_option backward.isDefEq.respectTransparency.types false in lemma preadditiveYoneda_homologySequenceδ_singleTriangle_apply [HasDerivedCategory.{w'} C] {Y : C} {n₀ : ℕ} (x : Ext S.X₁ Y n₀) {n₁ : ℕ} (h : 1 + n₀ = n₁) : diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Map.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Map.lean index f59e9bda08aabe..4c3a396bb62583 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Map.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Map.lean @@ -68,13 +68,13 @@ lemma DerivedCategory.map_triangleOfSESδ [HasDerivedCategory.{t} C] [HasDerived (Q.map (CochainComplex.mappingCone.descShortComplex S))), ← Functor.map_comp, descShortComplex_triangleOfSESδ, F.mapDerivedCategoryFactors_hom_naturality_assoc, ← CochainComplex.mappingCone.mapHomologicalComplexIso_hom_descShortComplex, - Functor.map_comp, Category.assoc, Functor.map_comp_assoc, - descShortComplex_triangleOfSESδ_assoc] + Functor.map_comp_assoc, descShortComplex_triangleOfSESδ_assoc] dsimp - rw [← Functor.map_comp_assoc, ← CochainComplex.mappingCone.map_δ, Functor.map_comp_assoc, - ← Category.assoc, ← F.mapDerivedCategoryFactors_hom_naturality_assoc] - simp [← Q.map_comp_assoc, NatTrans.shift_app, - Functor.commShiftIso_comp_hom_app, Functor.commShiftIso_comp_inv_app] + rw [← Functor.map_comp_assoc] + rw [← CochainComplex.mappingCone.map_δ, Functor.map_comp_assoc, + ← F.mapDerivedCategoryFactors_hom_naturality_assoc, Functor.map_comp] + simp [NatTrans.shift_app, Functor.commShiftIso_comp_hom_app, Functor.commShiftIso_comp_inv_app, + ← Functor.map_comp_assoc] set_option backward.isDefEq.respectTransparency false in @[reassoc] diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean b/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean index 7e734c31df414d..8b44157a42a89b 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Fractions.lean @@ -39,6 +39,7 @@ instance : (HomotopyCategory.quasiIso C (ComplexShape.up ℤ)).HasRightCalculusO rw [HomotopyCategory.quasiIso_eq_trW_subcategoryAcyclic] infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- Any morphism `f : Q.obj X ⟶ Q.obj Y` in the derived category can be written as `f = inv (Q.map s) ≫ Q.map g` with `s : X' ⟶ X` a quasi-isomorphism and `g : X' ⟶ Y`. -/ lemma right_fac {X Y : CochainComplex C ℤ} (f : Q.obj X ⟶ Q.obj Y) : @@ -52,6 +53,7 @@ lemma right_fac {X Y : CochainComplex C ℤ} (f : Q.obj X ⟶ Q.obj Y) : rw [← isIso_Qh_map_iff] at hs exact ⟨X', s, hs, g, hφ⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Any morphism `f : Q.obj X ⟶ Q.obj Y` in the derived category can be written as `f = Q.map g ≫ inv (Q.map s)` with `g : X ⟶ Y'` and `s : Y ⟶ Y'` a quasi-isomorphism. -/ lemma left_fac {X Y : CochainComplex C ℤ} (f : Q.obj X ⟶ Q.obj Y) : diff --git a/Mathlib/Algebra/Homology/DifferentialObject.lean b/Mathlib/Algebra/Homology/DifferentialObject.lean index 7c1db0389ef3cf..99119279533767 100644 --- a/Mathlib/Algebra/Homology/DifferentialObject.lean +++ b/Mathlib/Algebra/Homology/DifferentialObject.lean @@ -99,6 +99,7 @@ def dgoToHomologicalComplex : have : f.f i ≫ Y.d i = X.d i ≫ f.f _ := (congr_fun f.comm i).symm simp only [dite_true, Category.assoc, eqToHom_f', reassoc_of% this] } +set_option backward.isDefEq.respectTransparency.types false in /-- The functor from homological complexes to differential graded objects. -/ @[simps] @@ -110,6 +111,7 @@ def homologicalComplexToDGO : d := fun i => X.d i _ } map {X Y} f := { f := f.f } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit isomorphism for `dgoEquivHomologicalComplex`. -/ @@ -133,6 +135,7 @@ def dgoEquivHomologicalComplexCounitIso : { hom := { f := fun i => 𝟙 (X.X i) } inv := { f := fun i => 𝟙 (X.X i) } }) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of differential graded objects in `V` is equivalent to the category of homological complexes in `V`. diff --git a/Mathlib/Algebra/Homology/Embedding/Basic.lean b/Mathlib/Algebra/Homology/Embedding/Basic.lean index f4aa921fcc8fe4..3d7f56d8aef740 100644 --- a/Mathlib/Algebra/Homology/Embedding/Basic.lean +++ b/Mathlib/Algebra/Homology/Embedding/Basic.lean @@ -182,6 +182,7 @@ def embeddingUp'Add (a b : A) : Embedding (up' a) (up' a) := (fun _ _ h => by simpa using h) (by dsimp; simp_rw [add_right_comm _ b a, add_right_cancel_iff, implies_true]) +set_option backward.isDefEq.respectTransparency false in instance (a b : A) : (embeddingUp'Add a b).IsRelIff := by dsimp [embeddingUp'Add]; infer_instance instance (a b : A) : (embeddingUp'Add a b).IsTruncGE where @@ -195,6 +196,7 @@ def embeddingDown'Add (a b : A) : Embedding (down' a) (down' a) := (fun _ _ h => by simpa using h) (by dsimp; simp_rw [add_right_comm _ b a, add_right_cancel_iff, implies_true]) +set_option backward.isDefEq.respectTransparency false in instance (a b : A) : (embeddingDown'Add a b).IsRelIff := by dsimp [embeddingDown'Add]; infer_instance @@ -211,6 +213,7 @@ def embeddingUpNat : Embedding (up ℕ) (up ℤ) := (fun _ _ h => by simpa using h) (by dsimp; lia) +set_option backward.isDefEq.respectTransparency false in instance : embeddingUpNat.IsRelIff := by dsimp [embeddingUpNat]; infer_instance instance : embeddingUpNat.IsTruncGE where @@ -224,6 +227,7 @@ def embeddingDownNat : Embedding (down ℕ) (up ℤ) := (fun _ _ h => by simpa using h) (by dsimp; lia) +set_option backward.isDefEq.respectTransparency false in instance : embeddingDownNat.IsRelIff := by dsimp [embeddingDownNat]; infer_instance set_option backward.defeqAttrib.useBackward true in @@ -240,6 +244,7 @@ def embeddingUpIntGE : Embedding (up ℕ) (up ℤ) := (fun _ _ h => by dsimp at h; lia) (by dsimp; lia) +set_option backward.isDefEq.respectTransparency false in instance : (embeddingUpIntGE p).IsRelIff := by dsimp [embeddingUpIntGE]; infer_instance set_option backward.defeqAttrib.useBackward true in @@ -254,6 +259,7 @@ def embeddingUpIntLE : Embedding (down ℕ) (up ℤ) := (fun _ _ h => by dsimp at h; lia) (by dsimp; lia) +set_option backward.isDefEq.respectTransparency false in instance : (embeddingUpIntLE p).IsRelIff := by dsimp [embeddingUpIntLE]; infer_instance set_option backward.defeqAttrib.useBackward true in diff --git a/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean b/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean index cd3908b34d4fc7..26b9e67fcb0b31 100644 --- a/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean +++ b/Mathlib/Algebra/Homology/Embedding/CochainComplex.lean @@ -232,6 +232,7 @@ instance (X : ChainComplex C ℕ) : CochainComplex.IsStrictlyLE (X.extend embeddingDownNat) 0 where isZero _ _ := isZero_extend_X _ _ _ (by aesop) +set_option backward.isDefEq.respectTransparency.types false in /-- A cochain complex that is both strictly `≤ n` and `≥ n` is isomorphic to a complex `(single _ _ n).obj M` for some object `M`. -/ lemma exists_iso_single (n : ℤ) [K.IsStrictlyGE n] [K.IsStrictlyLE n] : diff --git a/Mathlib/Algebra/Homology/Embedding/Connect.lean b/Mathlib/Algebra/Homology/Embedding/Connect.lean index 40a5bd6d2b0524..eb86596ebd7655 100644 --- a/Mathlib/Algebra/Homology/Embedding/Connect.lean +++ b/Mathlib/Algebra/Homology/Embedding/Connect.lean @@ -93,6 +93,7 @@ def d : ∀ (n m : ℤ), X K L n ⟶ X K L m @[simp] lemma d_zero_one : h.d 0 1 = L.d 0 1 := rfl @[simp] lemma d_sub_two_sub_one : h.d (-2) (-1) = K.d 1 0 := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma shape (n m : ℤ) (hnm : n + 1 ≠ m) : h.d n m = 0 := match n, m with | .ofNat n, .ofNat m => L.shape _ _ (by simp at hnm ⊢; lia) @@ -152,6 +153,7 @@ def restrictionGEIso : (j' := (n + 1 : ℕ)) (by simp) (by simp), cochainComplex_d, h.d_ofNat] simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `h : ConnectData K L`, then `h.cochainComplex` identifies to `K` in degrees `≤ -1`. -/ @[simps!] diff --git a/Mathlib/Algebra/Homology/Embedding/Extend.lean b/Mathlib/Algebra/Homology/Embedding/Extend.lean index 4d668afb9ed8ac..47c6cecdd69e81 100644 --- a/Mathlib/Algebra/Homology/Embedding/Extend.lean +++ b/Mathlib/Algebra/Homology/Embedding/Extend.lean @@ -69,6 +69,7 @@ lemma d_none_eq_zero (i j : Option ι) (hi : i = none) : lemma d_none_eq_zero' (i j : Option ι) (hj : j = none) : d K i j = 0 := by subst hj; cases i <;> rfl +set_option backward.isDefEq.respectTransparency.types false in lemma d_eq {i j : Option ι} {a b : ι} (hi : i = some a) (hj : j = some b) : d K i j = (XIso K hi).hom ≫ K.d a b ≫ (XIso K hj).inv := by subst hi hj @@ -97,6 +98,7 @@ noncomputable def mapX : ∀ (i : Option ι), X K i ⟶ X L i | some i => φ.f i | none => 0 +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma mapX_some {i : Option ι} {a : ι} (hi : i = some a) : mapX φ i = (XIso K hi).hom ≫ φ.f a ≫ (XIso L hi).inv := by diff --git a/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean b/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean index a25c3e4aaf3047..80f1510f13b1a2 100644 --- a/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/ExtendHomology.lean @@ -261,6 +261,7 @@ lemma rightHomologyData_g' (h : (K.sc' i j k).RightHomologyData) (hk'' : e.f k = rw [assoc] at this rw [this, K.extend_d_eq e hj' hk'', h.p_g'_assoc, shortComplexFunctor'_obj_g] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The homology data of `(K.extend e).sc' i' j' k'` that is deduced from a homology data of `K.sc' i j k`. -/ @@ -271,6 +272,7 @@ noncomputable def homologyData (h : (K.sc' i j k).HomologyData) : right := rightHomologyData K e hj' hi hi' hk hk' h.right iso := h.iso +set_option backward.isDefEq.respectTransparency.types false in /-- The homology data of `(K.extend e).sc j'` that is deduced from a homology data of `K.sc' i j k`. -/ @[simps!] diff --git a/Mathlib/Algebra/Homology/Embedding/ExtendHomotopy.lean b/Mathlib/Algebra/Homology/Embedding/ExtendHomotopy.lean index 117b9a21ec44a6..275a0669c57631 100644 --- a/Mathlib/Algebra/Homology/Embedding/ExtendHomotopy.lean +++ b/Mathlib/Algebra/Homology/Embedding/ExtendHomotopy.lean @@ -34,6 +34,7 @@ namespace extend variable (e : c.Embedding c') (φ : ∀ i j, K.X i ⟶ L.X j) +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `Homotopy.extend` -/ noncomputable def homAux (i' j' : Option ι) : extend.X K i' ⟶ extend.X L j' := match i', j' with @@ -41,6 +42,7 @@ noncomputable def homAux (i' j' : Option ι) : extend.X K i' ⟶ extend.X L j' : | _, none => 0 | some i, some j => φ i j +set_option backward.isDefEq.respectTransparency.types false in lemma homAux_eq (i' j' : Option ι) (i j : ι) (hi : i' = some i) (hj : j' = some j) : homAux φ i' j' = (extend.XIso K hi).hom ≫ φ i j ≫ (extend.XIso L hj).inv := by subst hi hj diff --git a/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean b/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean index 3d01a691d6b85c..1af9754e4d5e60 100644 --- a/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean +++ b/Mathlib/Algebra/Homology/Embedding/HomEquiv.lean @@ -115,6 +115,7 @@ lemma liftExtend_f : (L.extendXIso e hi).inv := by apply liftExtend.f_eq +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `φ : K.restriction e ⟶ L` such that `hφ : e.HasLift φ`, this is the isomorphisms in the category of arrows between the maps @@ -147,6 +148,7 @@ variable (ψ : K ⟶ L.extend e) noncomputable def f (i : ι) : (K.restriction e).X i ⟶ L.X i := ψ.f (e.f i) ≫ (L.extendXIso e rfl).hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma f_eq {i : ι} {i' : ι'} (h : e.f i = i') : f ψ i = (K.restrictionXIso e h).hom ≫ ψ.f i' ≫ (L.extendXIso e h).hom := by @@ -196,6 +198,7 @@ lemma homRestrict_liftExtend (φ : K.restriction e ⟶ L) (hφ : e.HasLift φ) : ext i simp [e.homRestrict_f _ rfl, e.liftExtend_f _ _ rfl] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma homRestrict_precomp (α : K' ⟶ K) (ψ : K ⟶ L.extend e) : diff --git a/Mathlib/Algebra/Homology/Embedding/Restriction.lean b/Mathlib/Algebra/Homology/Embedding/Restriction.lean index 0fe781b43e9ee8..6b4af0a1d60a96 100644 --- a/Mathlib/Algebra/Homology/Embedding/Restriction.lean +++ b/Mathlib/Algebra/Homology/Embedding/Restriction.lean @@ -43,6 +43,7 @@ def restrictionXIso {i : ι} {i' : ι'} (h : e.f i = i') : eqToIso (h ▸ rfl) set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma restriction_d_eq {i j : ι} {i' j' : ι'} (hi : e.f i = i') (hj : e.f j = j') : (K.restriction e).d i j = (K.restrictionXIso e hi).hom ≫ K.d i' j' ≫ @@ -59,6 +60,7 @@ def restrictionMap : K.restriction e ⟶ L.restriction e where f i := φ.f (e.f i) set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma restrictionMap_f' {i : ι} {i' : ι'} (hi : e.f i = i') : (restrictionMap φ e).f i = (K.restrictionXIso e hi).hom ≫ diff --git a/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean b/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean index 2d363213dd6d85..c83127ea4504c6 100644 --- a/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/RestrictionHomology.lean @@ -35,6 +35,7 @@ variable (i j k : ι) (hi : c.prev j = i) (hk : c.next j = k) {i' j' k' : ι'} (hi' : e.f i = i') (hj' : e.f j = j') (hk' : e.f k = k') (hi'' : c'.prev j' = i') (hk'' : c'.next j' = k') +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The isomorphism `(K.restriction e).sc' i j k ≅ K.sc' i' j' k'` when `e` is an embedding of complex shapes, `i'`, `j`, `k`' are the respective diff --git a/Mathlib/Algebra/Homology/Embedding/TruncGE.lean b/Mathlib/Algebra/Homology/Embedding/TruncGE.lean index 3546703a083a46..0716c2ef6510c7 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncGE.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncGE.lean @@ -116,6 +116,7 @@ noncomputable def truncGE'XIsoOpcycles {i : ι} {i' : ι'} (hi' : e.f i = i') (h (K.truncGE' e).X i ≅ K.opcycles i' := (truncGE'.XIsoOpcycles K e hi) ≪≫ eqToIso (by subst hi'; rfl) +set_option backward.isDefEq.respectTransparency.types false in lemma truncGE'_d_eq {i j : ι} (hij : c.Rel i j) {i' j' : ι'} (hi' : e.f i = i') (hj' : e.f j = j') (hi : ¬ e.BoundaryGE i) : (K.truncGE' e).d i j = (K.truncGE'XIso e hi' hi).hom ≫ K.d i' j' ≫ @@ -125,6 +126,7 @@ lemma truncGE'_d_eq {i j : ι} (hij : c.Rel i j) {i' j' : ι'} subst hi' hj' simp [truncGE'XIso] +set_option backward.isDefEq.respectTransparency.types false in lemma truncGE'_d_eq_fromOpcycles {i j : ι} (hij : c.Rel i j) {i' j' : ι'} (hi' : e.f i = i') (hj' : e.f j = j') (hi : e.BoundaryGE i) : (K.truncGE' e).d i j = (K.truncGE'XIsoOpcycles e hi' hi).hom ≫ K.fromOpcycles i' j' ≫ @@ -234,6 +236,7 @@ noncomputable def f (i : ι) : (K.restriction e).X i ⟶ (K.truncGE' e).X i := else (K.truncGE'XIso e rfl hi).inv +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma f_eq_iso_hom_pOpcycles_iso_inv {i : ι} {i' : ι'} (hi' : e.f i = i') (hi : e.BoundaryGE i) : f K e i = (K.restrictionXIso e hi').hom ≫ K.pOpcycles i' ≫ @@ -243,6 +246,7 @@ lemma f_eq_iso_hom_pOpcycles_iso_inv {i : ι} {i' : ι'} (hi' : e.f i = i') (hi subst hi' simp [restrictionXIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma f_eq_iso_hom_iso_inv {i : ι} {i' : ι'} (hi' : e.f i = i') (hi : ¬ e.BoundaryGE i) : f K e i = (K.restrictionXIso e hi').hom ≫ (K.truncGE'XIso e hi' hi).inv := by @@ -274,6 +278,7 @@ set_option backward.isDefEq.respectTransparency false in noncomputable def restrictionToTruncGE' : K.restriction e ⟶ K.truncGE' e where f := restrictionToTruncGE'.f K e +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma restrictionToTruncGE'_hasLift : e.HasLift (K.restrictionToTruncGE' e) := by intro j hj i' _ @@ -299,6 +304,7 @@ lemma isIso_restrictionToTruncGE' (i : ι) (hi : ¬ e.BoundaryGE i) : rw [K.restrictionToTruncGE'_f_eq_iso_hom_iso_inv e rfl hi] infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {K L} in @[reassoc (attr := simp)] diff --git a/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean b/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean index 4a3dfcb22871f7..6b92fcc1647a02 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncGEHomology.lean @@ -80,6 +80,7 @@ lemma homologyι_truncGE'XIsoOpcycles_inv_d : homologyι_comp_fromOpcycles_assoc, zero_comp] · rw [shape _ _ _ hjk, comp_zero] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `truncGE'.homologyData`. -/ noncomputable def isLimitKernelFork : diff --git a/Mathlib/Algebra/Homology/Embedding/TruncLE.lean b/Mathlib/Algebra/Homology/Embedding/TruncLE.lean index 30f0ff662f3b41..df7623dd3bc1b3 100644 --- a/Mathlib/Algebra/Homology/Embedding/TruncLE.lean +++ b/Mathlib/Algebra/Homology/Embedding/TruncLE.lean @@ -57,6 +57,7 @@ lemma truncLE'_d_eq {i j : ι} (hij : c.Rel i j) {i' j' : ι'} (K.truncLE'XIso e hj' hj).inv := Quiver.Hom.op_inj (by simpa using! K.op.truncGE'_d_eq e.op hij hj' hi' (by simpa)) +set_option backward.isDefEq.respectTransparency.types false in lemma truncLE'_d_eq_toCycles {i j : ι} (hij : c.Rel i j) {i' j' : ι'} (hi' : e.f i = i') (hj' : e.f j = j') (hj : e.BoundaryLE j) : (K.truncLE' e).d i j = (K.truncLE'XIso e hi' (e.not_boundaryLE_prev hij)).hom ≫ diff --git a/Mathlib/Algebra/Homology/Factorizations/CM5a.lean b/Mathlib/Algebra/Homology/Factorizations/CM5a.lean index 30242a2ebf1749..fda465b86a84ce 100644 --- a/Mathlib/Algebra/Homology/Factorizations/CM5a.lean +++ b/Mathlib/Algebra/Homology/Factorizations/CM5a.lean @@ -371,6 +371,7 @@ lemma quasiIso_truncGEπ [Mono f] [Mono (homologyMap f n)] : rw [quasiIso_πTruncGE_iff] exact isGE_cokernel f n hf +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local instance] HasDerivedCategory.standard in lemma quasiIsoAt_ι [Mono f] [Mono (homologyMap f n)] (q : ℤ) (hq : q ≤ n) : diff --git a/Mathlib/Algebra/Homology/HomologicalBicomplex.lean b/Mathlib/Algebra/Homology/HomologicalBicomplex.lean index 7c82ce0a8a027a..2e9e8bf964dad9 100644 --- a/Mathlib/Algebra/Homology/HomologicalBicomplex.lean +++ b/Mathlib/Algebra/Homology/HomologicalBicomplex.lean @@ -176,6 +176,7 @@ def flipFunctor : comm' := by intros; simp } comm' := by intros; ext; simp } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `HomologicalComplex₂.flipEquivalence`. -/ @[simps!] @@ -185,6 +186,7 @@ def flipEquivalenceUnitIso : HomologicalComplex.Hom.isoOfComponents (fun _ => Iso.refl _) (by simp)) (by cat_disch)) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `HomologicalComplex₂.flipEquivalence`. -/ @[simps!] @@ -194,6 +196,7 @@ def flipEquivalenceCounitIso : HomologicalComplex.Hom.isoOfComponents (fun _ => Iso.refl _) (by simp)) (by cat_disch)) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Flipping a complex of complexes over the diagonal, as an equivalence of categories. -/ @[simps] diff --git a/Mathlib/Algebra/Homology/HomologicalComplex.lean b/Mathlib/Algebra/Homology/HomologicalComplex.lean index 585053c8ec5414..2b7780c59385f0 100644 --- a/Mathlib/Algebra/Homology/HomologicalComplex.lean +++ b/Mathlib/Algebra/Homology/HomologicalComplex.lean @@ -740,6 +740,7 @@ lemma mk_congr_succ_d₂ {S S' : ShortComplex V} (h : S = S') : subst h simp +set_option backward.isDefEq.respectTransparency.types false in lemma mkAux_eq_shortComplex_mk_d_comp_d (n : ℕ) : mkAux X₀ X₁ X₂ d₀ d₁ s succ n = ShortComplex.mk _ _ ((mk X₀ X₁ X₂ d₀ d₁ s succ).d_comp_d (n + 2) (n + 1) n) := by @@ -756,6 +757,7 @@ def mkXIso (n : ℕ) : (mkAux_eq_shortComplex_mk_d_comp_d X₀ X₁ X₂ d₀ d₁ s succ n)] rfl) +set_option backward.isDefEq.respectTransparency.types false in lemma mk_d (n : ℕ) : (mk X₀ X₁ X₂ d₀ d₁ s succ).d (n + 3) (n + 2) = (mkXIso X₀ X₁ X₂ d₀ d₁ s succ n).hom ≫ (succ @@ -796,6 +798,7 @@ theorem mk'_d_1_0 : (mk' X₀ X₁ d₀ succ').d 1 0 = d₀ := by change ite (1 = 0 + 1) (𝟙 X₁ ≫ d₀) 0 = d₀ rw [if_pos rfl, Category.id_comp] +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism from `(mk' X₀ X₁ d₀ succ').X (n + 2)` that is given by the inductive construction. -/ def mk'XIso (n : ℕ) : diff --git a/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean b/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean index d8234ae73ca56d..4135b304884899 100644 --- a/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean +++ b/Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean @@ -58,12 +58,14 @@ lemma inr_biprodXIso_inv (i : ι) : biprod.inr ≫ (biprodXIso K L i).inv = (biprod.inr : L ⟶ K ⊞ L).f i := by simp [biprodXIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma biprodXIso_hom_fst (i : ι) : (biprodXIso K L i).hom ≫ biprod.fst = (biprod.fst : K ⊞ L ⟶ K).f i := by simp [biprodXIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma biprodXIso_hom_snd (i : ι) : diff --git a/Mathlib/Algebra/Homology/HomologySequence.lean b/Mathlib/Algebra/Homology/HomologySequence.lean index c0445b350b4200..0b0b69e73648f8 100644 --- a/Mathlib/Algebra/Homology/HomologySequence.lean +++ b/Mathlib/Algebra/Homology/HomologySequence.lean @@ -109,12 +109,14 @@ noncomputable def composableArrows₃ [K.HasHomology i] [K.HasHomology j] : ComposableArrows C 3 := ComposableArrows.mk₃ (K.homologyι i) (K.opcyclesToCycles i j) (K.homologyπ j) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [K.HasHomology i] [K.HasHomology j] : Mono ((composableArrows₃ K i j).map' 0 1) := by dsimp infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [K.HasHomology i] [K.HasHomology j] : Epi ((composableArrows₃ K i j).map' 2 3) := by @@ -153,6 +155,7 @@ variable (C) attribute [local simp] homologyMap_comp cyclesMap_comp opcyclesMap_comp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `HomologicalComplex C c ⥤ ComposableArrows C 3` that maps `K` to the diagram `K.homology i ⟶ K.opcycles i ⟶ K.cycles j ⟶ K.homology j`. -/ diff --git a/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean b/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean index 96602c613cc295..c35667a6657a61 100644 --- a/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean +++ b/Mathlib/Algebra/Homology/HomologySequenceLemmas.lean @@ -40,6 +40,7 @@ namespace HomologicalComplex namespace HomologySequence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The morphism `snakeInput hS₁ i j hij ⟶ snakeInput hS₂ i j hij` induced by a morphism `φ : S₁ ⟶ S₂` of short complexes of homological complexes, that @@ -52,6 +53,7 @@ noncomputable def mapSnakeInput (i j : ι) (hij : c.Rel i j) : f₂ := (cyclesFunctor C c j).mapShortComplex.map φ f₃ := (homologyFunctor C c j).mapShortComplex.map φ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma δ_naturality (i j : ι) (hij : c.Rel i j) : hS₁.δ i j hij ≫ HomologicalComplex.homologyMap φ.τ₁ _ = diff --git a/Mathlib/Algebra/Homology/Homotopy.lean b/Mathlib/Algebra/Homology/Homotopy.lean index b921e0e5a06f8d..efa65e68cde38e 100644 --- a/Mathlib/Algebra/Homology/Homotopy.lean +++ b/Mathlib/Algebra/Homology/Homotopy.lean @@ -483,6 +483,7 @@ def mkInductiveAux₁ : section +set_option backward.isDefEq.respectTransparency.types false in /-- An auxiliary construction for `mkInductive`. -/ def mkInductiveAux₂ : @@ -493,23 +494,27 @@ def mkInductiveAux₂ : one comm_one succ n ⟨(P.xNextIso rfl).hom ≫ I.1, I.2.1 ≫ (Q.xPrevIso rfl).inv, by simpa using! I.2.2⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mkInductiveAux₂_zero : mkInductiveAux₂ e zero comm_zero one comm_one succ 0 = ⟨0, zero ≫ (Q.xPrevIso rfl).inv, by simpa using comm_zero⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mkInductiveAux₂_add_one (n) : mkInductiveAux₂ e zero comm_zero one comm_one succ (n + 1) = letI I := mkInductiveAux₁ e zero one comm_one succ n ⟨(P.xNextIso rfl).hom ≫ I.1, I.2.1 ≫ (Q.xPrevIso rfl).inv, by simpa using! I.2.2⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem mkInductiveAux₃ (i j : ℕ) (h : i + 1 = j) : (mkInductiveAux₂ e zero comm_zero one comm_one succ i).2.1 ≫ (Q.xPrevIso h).hom = (P.xNextIso h).inv ≫ (mkInductiveAux₂ e zero comm_zero one comm_one succ j).1 := by subst j rcases i with (_ | _ | i) <;> simp [mkInductiveAux₂] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A constructor for a `Homotopy e 0`, for `e` a chain map between `ℕ`-indexed chain complexes, working by induction. @@ -613,6 +618,7 @@ def mkCoinductiveAux₁ : section +set_option backward.isDefEq.respectTransparency.types false in /-- An auxiliary construction for `mkInductive`. -/ def mkCoinductiveAux₂ : @@ -622,23 +628,27 @@ def mkCoinductiveAux₂ : let I := mkCoinductiveAux₁ e zero one comm_one succ n ⟨I.1 ≫ (Q.xPrevIso rfl).inv, (P.xNextIso rfl).hom ≫ I.2.1, by simpa using! I.2.2⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mkCoinductiveAux₂_zero : mkCoinductiveAux₂ e zero comm_zero one comm_one succ 0 = ⟨0, (P.xNextIso rfl).hom ≫ zero, by simpa using comm_zero⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mkCoinductiveAux₂_add_one (n) : mkCoinductiveAux₂ e zero comm_zero one comm_one succ (n + 1) = letI I := mkCoinductiveAux₁ e zero one comm_one succ n ⟨I.1 ≫ (Q.xPrevIso rfl).inv, (P.xNextIso rfl).hom ≫ I.2.1, by simpa using! I.2.2⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem mkCoinductiveAux₃ (i j : ℕ) (h : i + 1 = j) : (P.xNextIso h).inv ≫ (mkCoinductiveAux₂ e zero comm_zero one comm_one succ i).2.1 = (mkCoinductiveAux₂ e zero comm_zero one comm_one succ j).1 ≫ (Q.xPrevIso h).hom := by subst j rcases i with (_ | _ | i) <;> simp [mkCoinductiveAux₂] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A constructor for a `Homotopy e 0`, for `e` a chain map between `ℕ`-indexed cochain complexes, working by induction. diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean b/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean index 3cb9ceb13198ed..e5fe56e3d4ea1c 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/DegreewiseSplit.lean @@ -216,6 +216,7 @@ noncomputable def triangleRotateShortComplexSplitting (n : ℤ) : r := (snd φ).v n n (add_zero n) id := by simp [ext_from_iff φ _ _ rfl] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma cocycleOfDegreewiseSplit_triangleRotateShortComplexSplitting_v (p : ℤ) : diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean index f75048f1e960fb..c8874023b2d02e 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean @@ -778,6 +778,7 @@ def Cocycle.postcomp {n : ℤ} (z : Cocycle F G n) (f : G ⟶ K) : Cocycle F K n namespace Cochain +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given two morphisms of complexes `φ₁ φ₂ : F ⟶ G`, the datum of a homotopy between `φ₁` and `φ₂` is equivalent to the datum of a `1`-cochain `z` such that `δ (-1) 0 z` is the difference diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexCohomology.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexCohomology.lean index d251133210dbbf..7d3ea6fd41faa6 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexCohomology.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexCohomology.lean @@ -53,6 +53,7 @@ def coboundaries : AddSubgroup (Cocycle K L n) where rintro α ⟨m, hm, β, hβ⟩ exact ⟨m, hm, -β, by aesop⟩ +set_option backward.isDefEq.respectTransparency.types false in variable {K L n} in lemma mem_coboundaries_iff (α : Cocycle K L n) (m : ℤ) (hm : m + 1 = n) : α ∈ coboundaries K L n ↔ ∃ (β : Cochain K L m), δ m n β = α := by diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean index ee5bf10f3124ec..d7dba586be210c 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexShift.lean @@ -116,6 +116,7 @@ lemma shift_v (a : ℤ) (p q : ℤ) (hpq : p + n = q) (p' q' : ℤ) subst hp' hq' rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma shift_v' (a : ℤ) (p q : ℤ) (hpq : p + n = q) : (γ.shift a).v p q hpq = γ.v (p + a) (q + a) (by lia) := by @@ -583,6 +584,7 @@ def equivHomShift : (K ⟶ L⟦n⟧) ≃+ Cocycle K L n := (equivHom _ _).trans (rightShiftAddEquiv _ _ _ (zero_add n)).symm +set_option backward.isDefEq.respectTransparency.types false in lemma equivHomShift_comp {K' : CochainComplex C ℤ} (g : K' ⟶ K) (f : K ⟶ L⟦n⟧) : equivHomShift (g ≫ f) = Cocycle.precomp (equivHomShift f) g := by @@ -594,6 +596,7 @@ lemma equivHomShift_symm_precomp equivHomShift.symm (z.precomp g) = g ≫ equivHomShift.symm z := equivHomShift.injective (by simp [equivHomShift_comp]) +set_option backward.isDefEq.respectTransparency.types false in lemma equivHomShift_comp_shift (f : K ⟶ L⟦n⟧) {L' : CochainComplex C ℤ} (g : L ⟶ L') : equivHomShift (f ≫ g⟦n⟧') = Cocycle.postcomp (equivHomShift f) g := by ext p q rfl diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexSingle.lean b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexSingle.lean index e7e8d5105eb8cb..5f69fc2041de8b 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexSingle.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/HomComplexSingle.lean @@ -86,6 +86,7 @@ noncomputable def fromSingleEquiv {p q n : ℤ} (h : p + n = q) : right_inv f := by simp map_add' := by simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma fromSingleEquiv_fromSingleMk {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q) : fromSingleEquiv h (fromSingleMk f h) = f := by diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean b/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean index 5160488fd7fa88..f8d62c2be710f3 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/MappingCone.lean @@ -168,6 +168,7 @@ lemma inr_snd_assoc {K : CochainComplex C ℤ} {d e : ℤ} (γ : Cochain G K d) obtain rfl : d = e := by lia rw [← Cochain.comp_assoc_of_first_is_zero_cochain, inr_snd, Cochain.id_comp] +set_option backward.isDefEq.respectTransparency.types false in lemma ext_to (i j : ℤ) (hij : i + 1 = j) {A : C} {f g : A ⟶ (mappingCone φ).X i} (h₁ : f ≫ (fst φ).1.v i j hij = g ≫ (fst φ).1.v i j hij) (h₂ : f ≫ (snd φ).v i i (add_zero i) = g ≫ (snd φ).v i i (add_zero i)) : @@ -255,6 +256,7 @@ lemma id_X (p q : ℤ) (hpq : p + 1 = q) : Cochain.comp_v _ _ (add_neg_cancel 1) p q p hpq (by lia)] using Cochain.congr_v (id φ) p p (add_zero p) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma inl_v_d (i j k : ℤ) (hij : i + (-1) = j) (hik : k + (-1) = i) : @@ -281,6 +283,7 @@ lemma d_fst_v' (i j : ℤ) (hij : i + 1 = j) : -(fst φ).1.v (i - 1) i (by lia) ≫ F.d i j := d_fst_v φ (i - 1) i j (by lia) hij +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma d_snd_v (i j : ℤ) (hij : i + 1 = j) : (mappingCone φ).d i j ≫ (snd φ).v j j (add_zero _) = diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Plus.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Plus.lean index 505b25c297c77f..56d68747a8cb14 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Plus.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Plus.lean @@ -203,6 +203,7 @@ section variable [HasZeroObject C] [HasBinaryBiproducts C] +set_option backward.isDefEq.respectTransparency.types false in open HomologicalComplex in set_option backward.defeqAttrib.useBackward true in instance : @@ -239,6 +240,7 @@ noncomputable def singleFunctorCompιIso (n : ℤ) : singleFunctor C n ⋙ ι C ≅ HomotopyCategory.singleFunctor C n := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in instance (n : ℤ) : (singleFunctor C n).Additive := by dsimp [singleFunctor, singleFunctors] infer_instance diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean index a38b8e5ab1fe2f..d6b6251685c0b8 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Pretriangulated.lean @@ -488,6 +488,7 @@ lemma isomorphic_distinguished (T₁ : Triangle (HomotopyCategory C (ComplexShap obtain ⟨X, Y, f, ⟨e'⟩⟩ := hT₁ exact ⟨X, Y, f, ⟨e ≪≫ e'⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable [HasZeroObject C] in lemma contractible_distinguished (X : HomotopyCategory C (ComplexShape.up ℤ)) : diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean index fde81639dbe022..1620345d889941 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Shift.lean @@ -83,6 +83,7 @@ variable (C) attribute [local simp] XIsoOfEq_hom_naturality +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The shift functor by `n` on `CochainComplex C ℤ` identifies to the identity functor when `n = 0`. -/ @@ -111,6 +112,7 @@ def shiftFunctorAdd' (n₁ n₂ n₁₂ : ℤ) (h : n₁ + n₂ = n₁₂) : attribute [local simp] XIsoOfEq +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : HasShift (CochainComplex C ℤ) ℤ := hasShiftMk _ _ { F := shiftFunctor C @@ -127,23 +129,28 @@ instance (n : ℤ) {R : Type*} [Ring R] [Linear R C] : end +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctor_obj_X' (K : CochainComplex C ℤ) (n p : ℤ) : ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).obj K).X p = K.X (p + n) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctor_map_f' {K L : CochainComplex C ℤ} (φ : K ⟶ L) (n p : ℤ) : ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).map φ).f p = φ.f (p + n) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctor_obj_d' (K : CochainComplex C ℤ) (n i j : ℤ) : ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).obj K).d i j = n.negOnePow • K.d _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma shiftFunctorAdd_inv_app_f (K : CochainComplex C ℤ) (a b n : ℤ) : ((shiftFunctorAdd (CochainComplex C ℤ) a b).inv.app K).f n = (K.XIsoOfEq (by dsimp; rw [add_comm a, add_assoc])).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma shiftFunctorAdd_hom_app_f (K : CochainComplex C ℤ) (a b n : ℤ) : ((shiftFunctorAdd (CochainComplex C ℤ) a b).hom.app K).f n = (K.XIsoOfEq (by dsimp; rw [add_comm a, add_assoc])).hom := by @@ -175,6 +182,7 @@ lemma XIsoOfEq_shift (K : CochainComplex C ℤ) (n : ℤ) {p q : ℤ} (hpq : p = variable (C) +set_option backward.isDefEq.respectTransparency.types false in lemma shiftFunctorAdd'_eq (a b c : ℤ) (h : a + b = c) : CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) a b c h = shiftFunctorAdd' C a b c h := by @@ -206,6 +214,7 @@ variable (C) attribute [local simp] XIsoOfEq_hom_naturality +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Shifting cochain complexes by `n` and evaluating in a degree `i` identifies to the evaluation in degree `i'` when `n + i = i'`. -/ diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean b/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean index 2a3a0d3a619473..dab3233c370f21 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/SingleFunctors.lean @@ -34,6 +34,7 @@ namespace CochainComplex open HomologicalComplex +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The collection of all single functors `C ⥤ CochainComplex C ℤ` along with their compatibilities with shifts. (This definition has purposely no `simps` diff --git a/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean b/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean index 535bd8c4c9edff..fdc2f77f9fb63c 100644 --- a/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean +++ b/Mathlib/Algebra/Homology/HomotopyCategory/Triangulated.lean @@ -151,6 +151,7 @@ lemma mappingConeCompHomotopyEquiv_hom_inv_id : (mappingConeCompHomotopyEquiv f g).inv = 𝟙 _ := by simp [mappingConeCompHomotopyEquiv] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma mappingConeCompHomotopyEquiv_comm₁ : diff --git a/Mathlib/Algebra/Homology/HomotopyCofiber.lean b/Mathlib/Algebra/Homology/HomotopyCofiber.lean index 8d179f9944bac2..70f76f0d6da298 100644 --- a/Mathlib/Algebra/Homology/HomotopyCofiber.lean +++ b/Mathlib/Algebra/Homology/HomotopyCofiber.lean @@ -229,7 +229,7 @@ end homotopyCofiber /-- The homotopy cofiber of a morphism of homological complexes, also known as the mapping cone. -/ -@[simps] +@[simps, implicit_reducible] noncomputable def homotopyCofiber : HomologicalComplex C c where X i := homotopyCofiber.X φ i d i j := homotopyCofiber.d φ i j @@ -313,6 +313,7 @@ lemma desc_f' (j : ι) (hj : ¬ c.Rel j (c.next j)) : (desc φ α hα).f j = sndX φ j ≫ α.f j := by apply dif_neg hj +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma inlX_desc_f (i j : ι) (hjk : c.Rel j i) : inlX φ i j hjk ≫ (desc φ α hα).f j = hα.hom i j := by diff --git a/Mathlib/Algebra/Homology/Localization.lean b/Mathlib/Algebra/Homology/Localization.lean index 715f0183478b8c..5cf355a56d8932 100644 --- a/Mathlib/Algebra/Homology/Localization.lean +++ b/Mathlib/Algebra/Homology/Localization.lean @@ -403,6 +403,7 @@ noncomputable instance : variable {c} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma mapHomologicalComplexUpToQuasiIsoFactorsh_hom_app (K : HomologicalComplex C c) : diff --git a/Mathlib/Algebra/Homology/ModelCategory/Lifting.lean b/Mathlib/Algebra/Homology/ModelCategory/Lifting.lean index 45271328faa704..ba9a3e58ac03b7 100644 --- a/Mathlib/Algebra/Homology/ModelCategory/Lifting.lean +++ b/Mathlib/Algebra/Homology/ModelCategory/Lifting.lean @@ -56,6 +56,7 @@ cokernel of `i : A ⟶ B` and `K` a kernel of `p : X ⟶ Y` (see `cocycle₁`). def cocycle₁' : Cocycle B X 1 := Cocycle.mk (δ 0 1 (cochain₀ sq hsq)) 2 (by simp) (by simp [δ_δ]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma coe_cocycle₁'_v_comp_eq_zero (n m : ℤ) (hnm : n + 1 = m := by lia) : @@ -65,6 +66,7 @@ lemma coe_cocycle₁'_v_comp_eq_zero (n m : ℤ) (hnm : n + 1 = m := by lia) : simp [cocycle₁', -HomologicalComplex.Hom.comm, ← p.comm, fac_right, reassoc_of% fac_right, b.comm] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma comp_coe_cocyle₁'_v_eq_zero (n m : ℤ) (hnm : n + 1 = m := by lia) : @@ -122,6 +124,7 @@ lemma comp_coe_cocycle₁_comp : ext n m hnm simp [cocycle₁] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Consider a commutative square in the category `CochainComplex C ℤ` diff --git a/Mathlib/Algebra/Homology/Monoidal.lean b/Mathlib/Algebra/Homology/Monoidal.lean index b4473aebf23bf7..1f1c41dc705523 100644 --- a/Mathlib/Algebra/Homology/Monoidal.lean +++ b/Mathlib/Algebra/Homology/Monoidal.lean @@ -125,6 +125,7 @@ section variable [∀ X₂, PreservesColimit (Functor.empty.{0} C) ((curriedTensor C).flip.obj X₂)] +set_option backward.isDefEq.respectTransparency.types false in instance : GradedObject.HasTensor (tensorUnit C c).X K.X := GradedObject.hasTensor_of_iso (tensorUnitIso C c) (Iso.refl _) @@ -147,6 +148,7 @@ section variable [∀ X₁, PreservesColimit (Functor.empty.{0} C) ((curriedTensor C).obj X₁)] +set_option backward.isDefEq.respectTransparency.types false in instance : GradedObject.HasTensor K.X (tensorUnit C c).X := GradedObject.hasTensor_of_iso (Iso.refl _) (tensorUnitIso C c) @@ -175,6 +177,7 @@ section LeftUnitor variable [∀ X₂, PreservesColimit (Functor.empty.{0} C) ((curriedTensor C).flip.obj X₂)] +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `leftUnitor`. -/ noncomputable def leftUnitor' : (tensorObj (tensorUnit C c) K).X ≅ K.X := @@ -225,6 +228,7 @@ section RightUnitor variable [∀ X₁, PreservesColimit (Functor.empty.{0} C) ((curriedTensor C).obj X₁)] +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `rightUnitor`. -/ noncomputable def rightUnitor' : (tensorObj K (tensorUnit C c)).X ≅ K.X := @@ -279,6 +283,7 @@ variable (C c) [∀ (X₁ X₂ : GradedObject I C), GradedObject.HasTensor X₁ [∀ (X₁ X₂ X₃ : GradedObject I C), GradedObject.HasGoodTensorTensor₂₃ X₁ X₂ X₃] [DecidableEq I] +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance monoidalCategoryStruct : MonoidalCategoryStruct (HomologicalComplex C c) where tensorObj K₁ K₂ := tensorObj K₁ K₂ @@ -335,6 +340,7 @@ noncomputable def Monoidal.inducingFunctorData : noncomputable instance monoidalCategory : MonoidalCategory (HomologicalComplex C c) := Monoidal.induced _ (Monoidal.inducingFunctorData C c) +set_option backward.isDefEq.respectTransparency.types false in noncomputable example {D : Type*} [Category* D] [Preadditive D] [MonoidalCategory D] [HasZeroObject D] [HasFiniteCoproducts D] [((curriedTensor D).Additive)] [∀ (X : D), (((curriedTensor D).obj X).Additive)] diff --git a/Mathlib/Algebra/Homology/Opposite.lean b/Mathlib/Algebra/Homology/Opposite.lean index ede453bfc5cf30..c8d19fd09fa4d6 100644 --- a/Mathlib/Algebra/Homology/Opposite.lean +++ b/Mathlib/Algebra/Homology/Opposite.lean @@ -52,6 +52,7 @@ theorem imageToKernel_op {X Y Z : V} (f : X ⟶ Y) (g : Y ⟶ Z) (w : f ≫ g = ← imageSubobject_arrow, ← imageUnopOp_inv_comp_op_factorThruImage g.op] rfl +set_option backward.isDefEq.respectTransparency.types false in theorem imageToKernel_unop {X Y Z : Vᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) (w : f ≫ g = 0) : imageToKernel g.unop f.unop (by rw [← unop_comp, w, unop_zero]) = (imageSubobjectIso _ ≪≫ (imageUnopUnop _).symm).hom ≫ @@ -142,12 +143,14 @@ def opUnitIso : 𝟭 (HomologicalComplex V c)ᵒᵖ ≅ opFunctor V c ⋙ opInve ext x simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `opEquivalence`. -/ def opCounitIso : opInverse V c ⋙ opFunctor V c ≅ 𝟭 (HomologicalComplex Vᵒᵖ c.symm) := NatIso.ofComponents fun X => HomologicalComplex.Hom.isoOfComponents fun _ => Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- Given a category of complexes with objects in `V`, there is a natural equivalence between its opposite category and a category of complexes with objects in `Vᵒᵖ`. -/ @[simps] @@ -199,12 +202,14 @@ def unopUnitIso : 𝟭 (HomologicalComplex Vᵒᵖ c)ᵒᵖ ≅ unopFunctor V c ext x simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `unopEquivalence`. -/ def unopCounitIso : unopInverse V c ⋙ unopFunctor V c ≅ 𝟭 (HomologicalComplex V c.symm) := NatIso.ofComponents fun X => HomologicalComplex.Hom.isoOfComponents fun _ => Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- Given a category of complexes with objects in `Vᵒᵖ`, there is a natural equivalence between its opposite category and a category of complexes with objects in `V`. -/ @[simps] diff --git a/Mathlib/Algebra/Homology/ShortComplex/Ab.lean b/Mathlib/Algebra/Homology/ShortComplex/Ab.lean index 8b78c29fc83b89..bce20b773321f1 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Ab.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Ab.lean @@ -100,6 +100,7 @@ noncomputable def abHomologyIso : S.homology ≅ AddCommGrpCat.of ((AddMonoidHom.ker S.g.hom) ⧸ AddMonoidHom.range S.abToCycles) := S.abLeftHomologyData.homologyIso +set_option backward.isDefEq.respectTransparency.types false in lemma exact_iff_surjective_abToCycles : S.Exact ↔ Function.Surjective S.abToCycles := by rw [S.abLeftHomologyData.exact_iff_epi_f', abLeftHomologyData_f', diff --git a/Mathlib/Algebra/Homology/ShortComplex/Basic.lean b/Mathlib/Algebra/Homology/ShortComplex/Basic.lean index 4f1674401779fc..4592fde38cb51a 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Basic.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Basic.lean @@ -301,6 +301,7 @@ def unopFunctor : ShortComplex Cᵒᵖ ⥤ (ShortComplex C)ᵒᵖ where obj S := Opposite.op (S.unop) map φ := (unopMap φ).op +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The obvious equivalence of categories `(ShortComplex C)ᵒᵖ ≌ ShortComplex Cᵒᵖ`. -/ @[simps] @@ -312,9 +313,11 @@ def opEquiv : (ShortComplex C)ᵒᵖ ≌ ShortComplex Cᵒᵖ where variable {C} +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical isomorphism `S.unop.op ≅ S` for a short complex `S` in `Cᵒᵖ` -/ abbrev unopOp (S : ShortComplex Cᵒᵖ) : S.unop.op ≅ S := (opEquiv C).counitIso.app S +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical isomorphism `S.op.unop ≅ S` for a short complex `S` -/ abbrev opUnop (S : ShortComplex C) : S.op.unop ≅ S := Iso.unop ((opEquiv C).unitIso.app (Opposite.op S)) diff --git a/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean b/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean index af18cdb9ab7b82..028373dd2a21e4 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/FunctorEquivalence.lean @@ -30,6 +30,7 @@ namespace FunctorEquivalence attribute [local simp] ShortComplex.Hom.comm₁₂ ShortComplex.Hom.comm₂₃ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The obvious functor `ShortComplex (J ⥤ C) ⥤ J ⥤ ShortComplex C`. -/ @[simps] @@ -40,6 +41,7 @@ def functor : ShortComplex (J ⥤ C) ⥤ J ⥤ ShortComplex C where map φ := { app := fun j => ((evaluation J C).obj j).mapShortComplex.map φ } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The obvious functor `(J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)`. -/ @[simps] @@ -51,6 +53,7 @@ def inverse : (J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C) where map φ := Hom.mk (whiskerRight φ π₁) (whiskerRight φ π₂) (whiskerRight φ π₃) (by cat_disch) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit isomorphism of the equivalence `ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/ @@ -62,6 +65,7 @@ def unitIso : 𝟭 _ ≅ functor J C ⋙ inverse J C := (NatIso.ofComponents (fun _ => Iso.refl _) (by simp)) (by cat_disch) (by cat_disch)) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The counit isomorphism of the equivalence `ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/ @@ -73,6 +77,7 @@ def counitIso : inverse J C ⋙ functor J C ≅ 𝟭 _ := end FunctorEquivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The obvious equivalence `ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/ @[simps] diff --git a/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean b/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean index 8bf6fe4a551d0f..428bfbec684acc 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/HomologicalComplex.lean @@ -48,6 +48,7 @@ complex `K` to the short complex `K.X (c.prev i) ⟶ K.X i ⟶ K.X (c.next i)`. noncomputable def shortComplexFunctor (i : ι) := shortComplexFunctor' C c (c.prev i) i (c.next i) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism `shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k` when `c.prev j = i` and `c.next j = k`. -/ @@ -910,6 +911,7 @@ noncomputable def homologyIsoSc' : K.homology j ≅ (K.sc' i j k).homology := lemma homology_sc'_eq_homology [(K.sc' (c.prev j) j (c.next j)).HasHomology] : (K.sc' (c.prev j) j (c.next j)).homology = K.homology j := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma homologyIsoSc'_eq_refl [(K.sc' (c.prev j) j (c.next j)).HasHomology] : diff --git a/Mathlib/Algebra/Homology/ShortComplex/Homology.lean b/Mathlib/Algebra/Homology/ShortComplex/Homology.lean index 123c6e89fc7520..9fd1091440d703 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Homology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Homology.lean @@ -413,6 +413,7 @@ lemma LeftHomologyData.homologyIso_leftHomologyData [S.HasHomology] : dsimp [homologyIso, leftHomologyIso, ShortComplex.leftHomologyIso] rw [← leftHomologyMap'_comp, comp_id] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma RightHomologyData.homologyIso_rightHomologyData [S.HasHomology] : S.rightHomologyData.homologyIso = S.rightHomologyIso.symm := by @@ -1050,6 +1051,7 @@ noncomputable def homologyOpIso [S.HasHomology] : S.op.homology ≅ Opposite.op S.homology := S.op.leftHomologyIso.symm ≪≫ S.leftHomologyOpIso ≪≫ S.rightHomologyIso.symm.op +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma homologyMap'_op : (homologyMap' φ h₁ h₂).op = h₂.iso.inv.op ≫ homologyMap' (opMap φ) h₂.op h₁.op ≫ h₁.iso.hom.op := diff --git a/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean index 56c1b1fb4575e4..5815bf853d3b2c 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean @@ -133,6 +133,7 @@ lemma isIso_i (hg : S.g = 0) : IsIso h.i := ⟨h.liftK (𝟙 S.X₂) (by rw [hg, id_comp]), by simp only [← cancel_mono h.i, id_comp, assoc, liftK_i, comp_id], liftK_i _ _ _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isIso_π (hf : S.f = 0) : IsIso h.π := by have ⟨φ, hφ⟩ := CokernelCofork.IsColimit.desc' h.hπ' (𝟙 _) @@ -142,6 +143,7 @@ lemma isIso_π (hf : S.f = 0) : IsIso h.π := by variable (S) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When the second map `S.g` is zero, this is the left homology data on `S` given by any colimit cokernel cofork of `S.f` -/ @@ -393,6 +395,7 @@ def ofIsLimitKernelFork (φ : S₁ ⟶ S₂) variable (S) +set_option backward.isDefEq.respectTransparency.types false in /-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the left homology map data (for the identity of `S`) which relates the left homology data `ofZeros` and `ofIsColimitCokernelCofork`. -/ diff --git a/Mathlib/Algebra/Homology/ShortComplex/Limits.lean b/Mathlib/Algebra/Homology/ShortComplex/Limits.lean index 4c8d7970bd8976..f69c3b88880c5c 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Limits.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Limits.lean @@ -29,6 +29,7 @@ variable {J C : Type*} [Category* J] [Category* C] [HasZeroMorphisms C] namespace ShortComplex +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If a cone with values in `ShortComplex C` is such that it becomes limit when we apply the three projections `ShortComplex C ⥤ C`, then it is limit. -/ @@ -161,6 +162,7 @@ instance preservesMonomorphisms_π₃ : end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If a cocone with values in `ShortComplex C` is such that it becomes colimit when we apply the three projections `ShortComplex C ⥤ C`, then it is colimit. -/ diff --git a/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean index d3ee48beba9abc..e2b02e3a9cfc28 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean @@ -485,6 +485,7 @@ def ofIsColimitCokernelCofork (φ : S₁ ⟶ S₂) variable (S) +set_option backward.isDefEq.respectTransparency.types false in /-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the right homology map data (for the identity of `S`) which relates the right homology data `RightHomologyData.ofIsLimitKernelFork` and `ofZeros` . -/ @@ -1148,6 +1149,7 @@ noncomputable def ofEpiOfIsIsoOfMono : RightHomologyData S₂ := by @[simp] lemma ofEpiOfIsIsoOfMono_H : (ofEpiOfIsIsoOfMono φ h).H = h.H := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma ofEpiOfIsIsoOfMono_p : (ofEpiOfIsIsoOfMono φ h).p = inv φ.τ₂ ≫ h.p := by simp [ofEpiOfIsIsoOfMono, opMap] @@ -1179,6 +1181,7 @@ noncomputable def ofEpiOfIsIsoOfMono' : RightHomologyData S₁ := by @[simp] lemma ofEpiOfIsIsoOfMono'_H : (ofEpiOfIsIsoOfMono' φ h).H = h.H := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma ofEpiOfIsIsoOfMono'_p : (ofEpiOfIsIsoOfMono' φ h).p = φ.τ₂ ≫ h.p := by simp [ofEpiOfIsIsoOfMono', opMap] diff --git a/Mathlib/Algebra/Homology/Single.lean b/Mathlib/Algebra/Homology/Single.lean index 3a954e803a4ceb..f613890c7ae62d 100644 --- a/Mathlib/Algebra/Homology/Single.lean +++ b/Mathlib/Algebra/Homology/Single.lean @@ -204,6 +204,7 @@ variable {V} lemma single₀_obj_zero (A : V) : ((single₀ V).obj A).X 0 = A := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma single₀_map_f_zero {A B : V} (f : A ⟶ B) : @@ -232,12 +233,14 @@ noncomputable def toSingle₀Equiv (C : ChainComplex V ℕ) (X : V) : left_inv φ := by cat_disch right_inv f := by simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toSingle₀Equiv_symm_apply_f_zero {C : ChainComplex V ℕ} {X : V} (f : C.X 0 ⟶ X) (hf : C.d 1 0 ≫ f = 0) : ((toSingle₀Equiv C X).symm ⟨f, hf⟩).f 0 = f := by simp [toSingle₀Equiv] +set_option backward.isDefEq.respectTransparency.types false in /-- Morphisms from a single object chain complex with `X` concentrated in degree 0 to an `ℕ`-indexed chain complex `C` are the same as morphisms `f : X → C.X 0`. -/ @@ -249,6 +252,7 @@ noncomputable def fromSingle₀Equiv (C : ChainComplex V ℕ) (X : V) : left_inv := by cat_disch right_inv := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma fromSingle₀Equiv_symm_apply_f_zero {C : ChainComplex V ℕ} {X : V} (f : X ⟶ C.X 0) : @@ -274,6 +278,7 @@ variable {V} lemma single₀_obj_zero (A : V) : ((single₀ V).obj A).X 0 = A := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma single₀_map_f_zero {A B : V} (f : A ⟶ B) : @@ -300,12 +305,14 @@ noncomputable def fromSingle₀Equiv (C : CochainComplex V ℕ) (X : V) : left_inv φ := by cat_disch right_inv := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma fromSingle₀Equiv_symm_apply_f_zero {C : CochainComplex V ℕ} {X : V} (f : X ⟶ C.X 0) (hf : f ≫ C.d 0 1 = 0) : ((fromSingle₀Equiv C X).symm ⟨f, hf⟩).f 0 = f := by simp [fromSingle₀Equiv] +set_option backward.isDefEq.respectTransparency.types false in /-- Morphisms to a single object cochain complex with `X` concentrated in degree 0 to an `ℕ`-indexed cochain complex `C` are the same as morphisms `f : C.X 0 ⟶ X`. -/ @@ -317,6 +324,7 @@ noncomputable def toSingle₀Equiv (C : CochainComplex V ℕ) (X : V) : left_inv := by cat_disch right_inv := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toSingle₀Equiv_symm_apply_f_zero {C : CochainComplex V ℕ} {X : V} (f : C.X 0 ⟶ X) : diff --git a/Mathlib/Algebra/Homology/SingleHomology.lean b/Mathlib/Algebra/Homology/SingleHomology.lean index 8ab0c9128a685d..822522705b7a0e 100644 --- a/Mathlib/Algebra/Homology/SingleHomology.lean +++ b/Mathlib/Algebra/Homology/SingleHomology.lean @@ -65,12 +65,14 @@ noncomputable def singleObjHomologySelfIso : ((single C c j).obj A).homology j ≅ A := (((single C c j).obj A).isoHomologyπ _ j rfl rfl).symm ≪≫ singleObjCyclesSelfIso c j A +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma singleObjCyclesSelfIso_inv_iCycles : (singleObjCyclesSelfIso _ _ _).inv ≫ ((single C c j).obj A).iCycles j = (singleObjXSelf c j A).inv := by simp [singleObjCyclesSelfIso] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma homologyπ_singleObjHomologySelfIso_hom : ((single C c j).obj A).homologyπ j ≫ (singleObjHomologySelfIso _ _ _).hom = @@ -84,12 +86,14 @@ lemma singleObjHomologySelfIso_hom_singleObjHomologySelfIso_inv : simp only [← cancel_mono (singleObjHomologySelfIso _ _ _).hom, assoc, Iso.inv_hom_id, comp_id, homologyπ_singleObjHomologySelfIso_hom] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma singleObjCyclesSelfIso_hom_singleObjOpcyclesSelfIso_hom : (singleObjCyclesSelfIso c j A).hom ≫ (singleObjOpcyclesSelfIso c j A).hom = ((single C c j).obj A).iCycles j ≫ ((single C c j).obj A).pOpcycles j := by simp [singleObjCyclesSelfIso, singleObjOpcyclesSelfIso] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma singleObjCyclesSelfIso_inv_homologyπ : (singleObjCyclesSelfIso _ _ _).inv ≫ ((single C c j).obj A).homologyπ j = @@ -130,6 +134,7 @@ lemma pOpcycles_singleObjOpcyclesSelfIso_inv : variable {A} variable {B : C} (f : A ⟶ B) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma singleObjCyclesSelfIso_hom_naturality : cyclesMap ((single C c j).map f) j ≫ (singleObjCyclesSelfIso c j B).hom = diff --git a/Mathlib/Algebra/Homology/SpectralObject/Basic.lean b/Mathlib/Algebra/Homology/SpectralObject/Basic.lean index a3e0a1a237d15d..c4a7f0e8bdd839 100644 --- a/Mathlib/Algebra/Homology/SpectralObject/Basic.lean +++ b/Mathlib/Algebra/Homology/SpectralObject/Basic.lean @@ -64,6 +64,7 @@ def δ {i j k : ι} (f : i ⟶ j) (g : j ⟶ k) (n₀ n₁ : ℤ) (hn₁ : n₀ (X.H n₀).obj (mk₁ g) ⟶ (X.H n₁).obj (mk₁ f) := (X.δ' n₀ n₁ hn₁).app (mk₂ f g) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma δ_naturality {i j k : ι} (f : i ⟶ j) (g : j ⟶ k) diff --git a/Mathlib/Algebra/Homology/SpectralObject/Cycles.lean b/Mathlib/Algebra/Homology/SpectralObject/Cycles.lean index 9c554a6b54f557..8720cc8a24458f 100644 --- a/Mathlib/Algebra/Homology/SpectralObject/Cycles.lean +++ b/Mathlib/Algebra/Homology/SpectralObject/Cycles.lean @@ -302,6 +302,7 @@ lemma toCycles_i (n : ℤ) : X.toCycles f g fg h n ≫ X.iCycles f g n = (X.H n).map (twoδ₁Toδ₀ f g fg h) := kernel.lift_ι .. +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma toCycles_cyclesMap (α : mk₂ f g ⟶ mk₂ f' g') (β : mk₁ fg ⟶ mk₁ fg') (n : ℤ) @@ -333,6 +334,7 @@ lemma p_fromOpcycles (n : ℤ) : (X.H n).map (twoδ₂Toδ₁ f g fg h) := cokernel.π_desc .. +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma opcyclesMap_fromOpcycles (α : mk₂ f g ⟶ mk₂ f' g') (β : mk₁ fg ⟶ mk₁ fg') (n : ℤ) diff --git a/Mathlib/Algebra/Homology/SpectralObject/Page.lean b/Mathlib/Algebra/Homology/SpectralObject/Page.lean index 4b7662ad43bb1e..8c9d4d790dc899 100644 --- a/Mathlib/Algebra/Homology/SpectralObject/Page.lean +++ b/Mathlib/Algebra/Homology/SpectralObject/Page.lean @@ -440,6 +440,7 @@ noncomputable def descE (hn₂ : n₁ + 1 = n₂ := by lia) : X.E f₁ f₂ f₃ n₀ n₁ n₂ hn₁ hn₂ ⟶ A := (X.cokernelSequenceE_exact f₁ f₂ f₃ f₁₂ h₁₂ n₀ n₁ n₂).desc x (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma toCycles_πE_descE (hn₂ : n₁ + 1 = n₂ := by lia) : X.toCycles f₁ f₂ f₁₂ h₁₂ n₁ ≫ X.πE f₁ f₂ f₃ n₀ n₁ n₂ hn₁ hn₂ ≫ @@ -709,6 +710,7 @@ noncomputable def EIsoH (n₀ n₁ n₂ : ℤ) X.E (𝟙 i) f (𝟙 j) n₀ n₁ n₂ hn₁ hn₂ ≅ (X.H n₁).obj (mk₁ f) := (X.homologyDataIdId ..).left.homologyIso +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma EIsoH_hom_naturality (α : mk₁ f ⟶ mk₁ f') (β : mk₃ (𝟙 _) f (𝟙 _) ⟶ mk₃ (𝟙 _) f' (𝟙 _)) @@ -874,6 +876,7 @@ noncomputable def shortComplexOpcyclesThreeδ₂Toδ₁ ShortComplex.mk _ _ (X.opcyclesMap_threeδ₂Toδ₁_opcyclesToE f₁ f₂ f₃ f₁₂ f₂₃ h₁₂ h₂₃ n₀ n₁ n₂ hn₁ hn₂) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance (n₀ n₁ n₂ : ℤ) (hn₁ : n₀ + 1 = n₁) (hn₂ : n₁ + 1 = n₂) : Mono (X.shortComplexOpcyclesThreeδ₂Toδ₁ f₁ f₂ f₃ f₁₂ f₂₃ h₁₂ h₂₃ n₀ n₁ n₂ hn₁ hn₂).f := by diff --git a/Mathlib/Algebra/Homology/SpectralObject/SpectralSequence.lean b/Mathlib/Algebra/Homology/SpectralObject/SpectralSequence.lean index debb0e05f49302..aa74ce79b30c5d 100644 --- a/Mathlib/Algebra/Homology/SpectralObject/SpectralSequence.lean +++ b/Mathlib/Algebra/Homology/SpectralObject/SpectralSequence.lean @@ -185,6 +185,7 @@ noncomputable def page (r : ℤ) (hr : r₀ ≤ r) : d := pageD X data r shape pq pq' hpq := dif_neg hpq +set_option backward.isDefEq.respectTransparency.types false in /-- The short complex of the `r`th page of the spectral sequence on position `pq'` identifies to the short complex given by the differentials of the spectral object. Then, the homology of this short complex can be computed using @@ -612,6 +613,7 @@ lemma spectralSequenceHomologyData_right_p X.mapFourδ₄Toδ₃' i₀ i₁ i₂ i₃ i₃' _ _ _ (data.le₃₃' hrr' hr pq' hi₃ hi₃') n₀ n₁ n₂ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma spectralSequenceHomologyData_right_homologyIso_eq_left_homologyIso (hn₁ : n₀ + 1 = n₁ := by lia) (hn₂ : n₁ + 1 = n₂ := by lia) : @@ -622,6 +624,7 @@ lemma spectralSequenceHomologyData_right_homologyIso_eq_left_homologyIso ext1 simp [ShortComplex.HomologyData.right_homologyIso_eq_left_homologyIso_trans_iso] +set_option backward.isDefEq.respectTransparency.types false in unseal spectralSequence in lemma spectralSequence_iso (hn₁ : n₀ + 1 = n₁ := by lia) (hn₂ : n₁ + 1 = n₂ := by lia) : (X.spectralSequence data).iso r r' pq' = diff --git a/Mathlib/Algebra/Homology/TotalComplex.lean b/Mathlib/Algebra/Homology/TotalComplex.lean index bd6d9e398455b1..14e126e05f0240 100644 --- a/Mathlib/Algebra/Homology/TotalComplex.lean +++ b/Mathlib/Algebra/Homology/TotalComplex.lean @@ -69,11 +69,13 @@ noncomputable def d₂ : ComplexShape.ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ • ((K.X i₁).d i₂ (c₂.next i₂) ≫ K.toGradedObject.ιMapObjOrZero (ComplexShape.π c₁ c₂ c₁₂) ⟨i₁, _⟩ i₁₂) +set_option backward.isDefEq.respectTransparency.types false in lemma d₁_eq_zero (h : ¬ c₁.Rel i₁ (c₁.next i₁)) : K.d₁ c₁₂ i₁ i₂ i₁₂ = 0 := by dsimp [d₁] rw [K.shape_f _ _ h, zero_comp, smul_zero] +set_option backward.isDefEq.respectTransparency.types false in lemma d₂_eq_zero (h : ¬ c₂.Rel i₂ (c₂.next i₂)) : K.d₂ c₁₂ i₁ i₂ i₁₂ = 0 := by dsimp [d₂] @@ -144,12 +146,14 @@ noncomputable def D₂ (i₁₂ i₁₂' : I₁₂) : namespace totalAux +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma ιMapObj_D₁ (i₁₂ i₁₂' : I₁₂) (i : I₁ × I₂) (h : ComplexShape.π c₁ c₂ c₁₂ i = i₁₂) : K.toGradedObject.ιMapObj (ComplexShape.π c₁ c₂ c₁₂) i i₁₂ h ≫ K.D₁ c₁₂ i₁₂ i₁₂' = K.d₁ c₁₂ i.1 i.2 i₁₂' := by simp [D₁] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma ιMapObj_D₂ (i₁₂ i₁₂' : I₁₂) (i : I₁ × I₂) (h : ComplexShape.π c₁ c₂ c₁₂ i = i₁₂) : K.toGradedObject.ιMapObj (ComplexShape.π c₁ c₂ c₁₂) i i₁₂ h ≫ K.D₂ c₁₂ i₁₂ i₁₂' = @@ -257,7 +261,7 @@ lemma D₁_D₂ (i₁₂ i₁₂' i₁₂'' : I₁₂) : K.D₁ c₁₂ i₁₂ i₁₂' ≫ K.D₂ c₁₂ i₁₂' i₁₂'' = - K.D₂ c₁₂ i₁₂ i₁₂' ≫ K.D₁ c₁₂ i₁₂' i₁₂'' := by simp /-- The total complex of a bicomplex. -/ -@[simps -isSimp d] +@[simps -isSimp d, implicit_reducible] noncomputable def total : HomologicalComplex C c₁₂ where X := K.toGradedObject.mapObj (ComplexShape.π c₁ c₂ c₁₂) d i₁₂ i₁₂' := K.D₁ c₁₂ i₁₂ i₁₂' + K.D₂ c₁₂ i₁₂ i₁₂' diff --git a/Mathlib/Algebra/Homology/TotalComplexShift.lean b/Mathlib/Algebra/Homology/TotalComplexShift.lean index 0e333f78bf8896..32b54bb2d2351d 100644 --- a/Mathlib/Algebra/Homology/TotalComplexShift.lean +++ b/Mathlib/Algebra/Homology/TotalComplexShift.lean @@ -207,6 +207,7 @@ lemma ι_totalShift₁Iso_hom_f (a b n : ℤ) (h : a + b = n) (a' : ℤ) (ha' : dsimp [totalShift₁Iso, totalShift₁XIso] simp only [ι_totalDesc, comp_id, id_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma ι_totalShift₁Iso_inv_f (a b n : ℤ) (h : a + b = n) (a' n' : ℤ) @@ -331,6 +332,7 @@ lemma ι_totalShift₂Iso_hom_f (a b n : ℤ) (h : a + b = n) (b' : ℤ) (hb' : dsimp [totalShift₂Iso, totalShift₂XIso] simp only [ι_totalDesc, comp_id, id_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma ι_totalShift₂Iso_inv_f (a b n : ℤ) (h : a + b = n) (b' n' : ℤ) diff --git a/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean b/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean index feb35570ad310d..660ff51aa97c8d 100644 --- a/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean +++ b/Mathlib/Algebra/Homology/TotalComplexSymmetry.lean @@ -138,6 +138,7 @@ lemma ιTotal_totalFlipIso_f_hom (by rw [← ComplexShape.π_symm c₁ c₂ c i₁ i₂, h]) := by simp [totalFlipIso, totalFlipIsoX] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma ιTotal_totalFlipIso_f_inv (i₁ : I₁) (i₂ : I₂) (j : J) (h : ComplexShape.π c₁ c₂ c (i₁, i₂) = j) : @@ -152,6 +153,7 @@ section variable [TotalComplexShapeSymmetry c₂ c₁ c] [TotalComplexShapeSymmetrySymmetry c₁ c₂ c] +set_option backward.isDefEq.respectTransparency.types false in lemma flip_totalFlipIso : K.flip.totalFlipIso c = (K.totalFlipIso c).symm := by ext j i₁ i₂ h rw [Iso.symm_hom, ιTotal_totalFlipIso_f_hom] diff --git a/Mathlib/Algebra/Lie/Abelian.lean b/Mathlib/Algebra/Lie/Abelian.lean index 711d151636a041..8a1636f78df3e9 100644 --- a/Mathlib/Algebra/Lie/Abelian.lean +++ b/Mathlib/Algebra/Lie/Abelian.lean @@ -203,6 +203,7 @@ theorem isTrivial_iff_max_triv_eq_top : IsTrivial L M ↔ maxTrivSubmodule R L M variable {R L M N} +set_option backward.isDefEq.respectTransparency false in /-- `maxTrivSubmodule` is functorial. -/ def maxTrivHom (f : M →ₗ⁅R,L⁆ N) : maxTrivSubmodule R L M →ₗ⁅R,L⁆ maxTrivSubmodule R L N where toFun m := ⟨f m, fun x => diff --git a/Mathlib/Algebra/Lie/BaseChange.lean b/Mathlib/Algebra/Lie/BaseChange.lean index 053db2056415ce..6e7cae1b17c056 100644 --- a/Mathlib/Algebra/Lie/BaseChange.lean +++ b/Mathlib/Algebra/Lie/BaseChange.lean @@ -120,6 +120,7 @@ instance instLieRingModule : LieRingModule (A ⊗[R] L) (A ⊗[R] M) where lie_add x y z := by simp only [bracket_def, map_add] leibniz_lie := bracket_leibniz_lie R A L M +set_option backward.isDefEq.respectTransparency false in instance instLieModule : LieModule A (A ⊗[R] L) (A ⊗[R] M) where smul_lie t x m := by simp only [bracket_def, map_smul, LinearMap.smul_apply] lie_smul _ _ _ := map_smul _ _ _ @@ -183,6 +184,7 @@ variable (N : LieSubmodule R L M) open LieModule +set_option backward.isDefEq.respectTransparency false in variable {R L M} in /-- If `A` is an `R`-algebra, any Lie submodule of a Lie module `M` with coefficients in `R` may be pushed forward to a Lie submodule of `A ⊗ M` with coefficients in `A`. diff --git a/Mathlib/Algebra/Lie/Basic.lean b/Mathlib/Algebra/Lie/Basic.lean index f1a9094f84b662..eac8fb3752e733 100644 --- a/Mathlib/Algebra/Lie/Basic.lean +++ b/Mathlib/Algebra/Lie/Basic.lean @@ -245,6 +245,7 @@ instance : LieModule ℤ L M where smul_lie n x m := zsmul_lie x m n lie_smul n x m := lie_zsmul x m n +set_option backward.isDefEq.respectTransparency false in instance LinearMap.instLieRingModule : LieRingModule L (M →ₗ[R] N) where bracket x f := { toFun := fun m => ⁅x, f m⁆ - f ⁅x, m⁆ @@ -270,6 +271,7 @@ instance LinearMap.instLieRingModule : LieRingModule L (M →ₗ[R] N) where theorem LieHom.lie_apply (f : M →ₗ[R] N) (x : L) (m : M) : ⁅x, f⁆ m = ⁅x, f m⁆ - f ⁅x, m⁆ := rfl +set_option backward.isDefEq.respectTransparency false in instance LinearMap.instLieModule : LieModule R L (M →ₗ[R] N) where smul_lie t x f := by ext n @@ -298,7 +300,7 @@ instance Module.Dual.instLieModule : LieModule R L (M →ₗ[R] R) where variable (L) in /-- It is sometimes useful to regard a `LieRing` as a `NonUnitalNonAssocRing`. -/ -@[implicit_reducible] +@[instance_reducible] def LieRing.toNonUnitalNonAssocRing : NonUnitalNonAssocRing L := { mul := Bracket.bracket left_distrib := lie_add @@ -472,7 +474,7 @@ variable (f : L₁ →ₗ⁅R⁆ L₂) /-- A Lie ring module may be pulled back along a morphism of Lie algebras. See note [reducible non-instances]. -/ -@[implicit_reducible] +@[instance_reducible] def LieRingModule.compLieHom : LieRingModule L₁ M where bracket x m := ⁅f x, m⁆ lie_add x := lie_add (f x) @@ -484,6 +486,7 @@ theorem LieRingModule.compLieHom_apply (x : L₁) (m : M) : ⁅x, m⁆ = ⁅f x, m⁆ := rfl +set_option backward.isDefEq.respectTransparency false in /-- A Lie module may be pulled back along a morphism of Lie algebras. -/ theorem LieModule.compLieHom [Module R M] [LieModule R L₂ M] : @LieModule R L₁ M _ _ _ _ _ (LieRingModule.compLieHom M f) := diff --git a/Mathlib/Algebra/Lie/Basis.lean b/Mathlib/Algebra/Lie/Basis.lean index 2d0156503cd810..802af44d9ba17e 100644 --- a/Mathlib/Algebra/Lie/Basis.lean +++ b/Mathlib/Algebra/Lie/Basis.lean @@ -48,6 +48,12 @@ noncomputable section namespace LieAlgebra +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Matrix + Set + symm + /-- A basis for a semisimple Lie algebra distinguishes a natural Cartan subalgebra and a base for the associated root system. -/ @[ext] @@ -277,6 +283,7 @@ def baseSupp (i : ι) : Dual R b.cartan := simp [f, this, Finsupp.single_apply] simp [this] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma symm_baseSupp : b.symm.baseSupp = -b.baseSupp := by let b₁ : Module.Basis ι R b.cartan := @@ -331,6 +338,7 @@ lemma linearIndependent_baseSupp [IsDomain R] [CharZero R] : variable [IsDomain R] [CharZero R] +set_option backward.isDefEq.respectTransparency.types false in /-- Lemma 4.4 from [Geck](Geck2017). -/ lemma borelUpper_le_biSup : b.borelUpper ≤ ⨆ (n : ι → ℕ) (_ : n ≠ 0), rootSpace b.cartan (∑ i, n i • b.baseSupp i) := by @@ -390,6 +398,7 @@ private lemma cartan_borelLower_borelUpper_le : variable [IsTorsionFree R L] +set_option backward.isDefEq.respectTransparency.types false in lemma iSupIndep_rootSpace : letI U := ⨆ (n : ι → ℕ) (_ : n ≠ 0), rootSpace b.cartan (∑ i, n i • (-b.baseSupp) i) letI V := ⨆ (n : ι → ℕ) (_ : n ≠ 0), rootSpace b.cartan (∑ i, n i • b.baseSupp i) diff --git a/Mathlib/Algebra/Lie/Classical.lean b/Mathlib/Algebra/Lie/Classical.lean index 17bc1eeee7990d..d541089a517eb0 100644 --- a/Mathlib/Algebra/Lie/Classical.lean +++ b/Mathlib/Algebra/Lie/Classical.lean @@ -200,7 +200,7 @@ theorem pso_inv {i : R} (hi : i * i = -1) : Pso p q R i * Pso p q R (-i) = 1 := simp [Pso, h, hi, one_apply] /-- There is a constructive inverse of `Pso p q R i`. -/ -@[implicit_reducible] +@[instance_reducible] def invertiblePso {i : R} (hi : i * i = -1) : Invertible (Pso p q R i) := invertibleOfRightInverse _ _ (pso_inv p q R hi) diff --git a/Mathlib/Algebra/Lie/Cochain.lean b/Mathlib/Algebra/Lie/Cochain.lean index 6771c1329235ee..df7d092500c01d 100644 --- a/Mathlib/Algebra/Lie/Cochain.lean +++ b/Mathlib/Algebra/Lie/Cochain.lean @@ -117,6 +117,7 @@ lemma d₁₂_apply_apply_ofTrivial [LieModule.IsTrivial L M] (f : oneCochain R d₁₂ R L M f x y = - f ⁅x, y⁆ := by simp [trivial_lie_zero] +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in /-- The coboundary operator taking degree 2 cochains to a space containing degree 3 cochains. -/ private def d₂₃_aux (a : twoCochain R L M) : L →ₗ[R] L →ₗ[R] L →ₗ[R] M where diff --git a/Mathlib/Algebra/Lie/Derivation/Basic.lean b/Mathlib/Algebra/Lie/Derivation/Basic.lean index c451e6297aba17..16201a5e02255c 100644 --- a/Mathlib/Algebra/Lie/Derivation/Basic.lean +++ b/Mathlib/Algebra/Lie/Derivation/Basic.lean @@ -107,6 +107,7 @@ lemma apply_lie_eq_add (D : LieDerivation R L L) (a b : L) : D ⁅a, b⁆ = ⁅a, D b⁆ + ⁅D a, b⁆ := by rw [LieDerivation.apply_lie_eq_sub, sub_eq_add_neg, lie_skew] +set_option backward.isDefEq.respectTransparency false in /-- Two Lie derivations equal on a set are equal on its Lie span. -/ theorem eqOn_lieSpan {s : Set L} (h : Set.EqOn D1 D2 s) : Set.EqOn D1 D2 (LieSubalgebra.lieSpan R L s) := by @@ -317,6 +318,7 @@ instance : LieRing (LieDerivation R L L) where leibniz_lie d e f := by ext a; simp only [commutator_apply, add_apply, map_sub]; abel +set_option backward.isDefEq.respectTransparency false in /-- The set of Lie derivations from a Lie algebra `L` to itself is a Lie algebra. -/ instance instLieAlgebra : LieAlgebra R (LieDerivation R L L) where lie_smul := fun r d e => by ext a; simp only [commutator_apply, map_smul, smul_sub, smul_apply] @@ -376,6 +378,7 @@ instance instLieRingModule : LieRingModule L (LieDerivation R L M) where ⁅x, (D : L →ₗ[R] M)⁆ = ⁅x, D⁆ := by ext; simp +set_option backward.isDefEq.respectTransparency false in instance instLieModule : LieModule R L (LieDerivation R L M) where smul_lie t x D := by ext; simp lie_smul t x D := by ext; simp diff --git a/Mathlib/Algebra/Lie/DirectSum.lean b/Mathlib/Algebra/Lie/DirectSum.lean index 890b08ca949466..75c6947d15e11e 100644 --- a/Mathlib/Algebra/Lie/DirectSum.lean +++ b/Mathlib/Algebra/Lie/DirectSum.lean @@ -44,17 +44,28 @@ variable [LieRing L] [LieAlgebra R L] variable [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] variable [∀ i, LieRingModule L (M i)] [∀ i, LieModule R L (M i)] +-- Underlying problem: `DirectSum` is semireducible +set_option backward.isDefEq.respectTransparency false in instance : LieRingModule L (⨁ i, M i) where bracket x m := m.mapRange (fun _ m' => ⁅x, m'⁆) fun _ => lie_zero x add_lie x y m := by ext - simp only [mapRange_apply, add_apply, add_lie] + -- TODO: This should be closed by `simp only [mapRange_apply, add_apply, add_lie]` + rw [mapRange_apply] + simp only [add_apply, add_lie] + rw [mapRange_apply, mapRange_apply] lie_add x m n := by ext - simp only [mapRange_apply, add_apply, lie_add] + -- TODO: This should be closed by `simp only [mapRange_apply, add_apply, lie_add]` + rw [mapRange_apply] + simp only [add_apply] + rw [mapRange_apply, mapRange_apply, add_apply, lie_add] leibniz_lie x y m := by ext - simp only [mapRange_apply, lie_lie, add_apply, sub_add_cancel] + -- TODO: should be closed by `simp only [mapRange_apply, lie_lie, add_apply, sub_add_cancel]` + rw [mapRange_apply] + simp only [mapRange_apply, lie_lie, add_apply] + rw [mapRange_apply, mapRange_apply, mapRange_apply, sub_add_cancel] @[simp] theorem lie_module_bracket_apply (x : L) (m : ⨁ i, M i) (i : ι) : ⁅x, m⁆ i = ⁅x, m i⁆ := @@ -70,6 +81,7 @@ instance : LieModule R L (⨁ i, M i) where variable (R ι L M) +set_option backward.isDefEq.respectTransparency false in /-- The inclusion of each component into a direct sum as a morphism of Lie modules. -/ def lieModuleOf [DecidableEq ι] (j : ι) : M j →ₗ⁅R,L⁆ ⨁ i, M i := { lof R ι M j with @@ -83,13 +95,18 @@ def lieModuleOf [DecidableEq ι] (j : ι) : M j →ₗ⁅R,L⁆ ⨁ i, M i := -- The coercion in the goal is `DFunLike.coe (β := fun x ↦ Π₀ (i : ι), M i)` -- but the lemma is expecting `DFunLike.coe (β := fun x ↦ ⨁ (i : ι), M i)` erw [AddHom.coe_mk] - simp [h] } + -- TODO: should be closed by `simp [h]` + rw [single_apply, single_apply] + simp only [h, ↓reduceDIte, lie_zero] } set_option backward.isDefEq.respectTransparency false in /-- The projection map onto one component, as a morphism of Lie modules. -/ def lieModuleComponent (j : ι) : (⨁ i, M i) →ₗ⁅R,L⁆ M j := { component R ι M j with - map_lie' := fun {x m} => by simp [component, lapply] } + map_lie' := fun {x m} => by + -- TODO: should be closed by `simp [component, lapply]` + simp only [component, lapply, AddHom.toFun_eq_coe, AddHom.coe_mk] + rw [lie_module_bracket_apply] } end Modules @@ -101,21 +118,28 @@ section Algebras variable (L : ι → Type w) variable [∀ i, LieRing (L i)] [∀ i, LieAlgebra R (L i)] +set_option backward.isDefEq.respectTransparency false in instance lieRing : LieRing (⨁ i, L i) := { (inferInstance : AddCommGroup _) with bracket := zipWith (fun _ => fun x y => ⁅x, y⁆) fun _ => lie_zero 0 add_lie := fun x y z => by ext - simp only [zipWith_apply, add_apply, add_lie] + -- TODO: should be solved by `simp only [zipWith_apply, add_apply, add_lie]` + rw [zipWith_apply] + simp only [add_apply] + rw [zipWith_apply, zipWith_apply, add_apply, add_lie] lie_add := fun x y z => by ext - simp only [zipWith_apply, add_apply, lie_add] + -- TODO: should be solved by `simp only [zipWith_apply, add_apply, lie_add]` + rw [zipWith_apply, add_apply, add_apply, zipWith_apply, zipWith_apply, lie_add] lie_self := fun x => by ext - simp only [zipWith_apply, lie_self, zero_apply] + -- TODO: should be solved by `simp only [zipWith_apply, lie_self, zero_apply]` + rw [zipWith_apply, lie_self, zero_apply] leibniz_lie := fun x y z => by ext - simp only [zipWith_apply, add_apply] + -- TODO: instead of `rw`, `simp only [zipWith_apply, add_apply]` should work here + rw [zipWith_apply, zipWith_apply, add_apply] apply leibniz_lie } @[simp] @@ -162,7 +186,10 @@ set_option backward.isDefEq.respectTransparency false in def lieAlgebraComponent (j : ι) : (⨁ i, L i) →ₗ⁅R⁆ L j := { component R ι L j with toFun := component R ι L j - map_lie' := fun {x y} => by simp [component, lapply] } + map_lie' := fun {x y} => by + -- TODO: should be closed by `simp [component, lapply]` + simp only [component, lapply, LinearMap.coe_mk, AddHom.coe_mk] + rw [bracket_apply] } -- Note(kmill): `ext` cannot generate an iff theorem here since `x` and `y` do not determine `R`. @[ext (iff := false)] diff --git a/Mathlib/Algebra/Lie/EngelSubalgebra.lean b/Mathlib/Algebra/Lie/EngelSubalgebra.lean index 77c52aedbc4bfe..44a2f30a061f39 100644 --- a/Mathlib/Algebra/Lie/EngelSubalgebra.lean +++ b/Mathlib/Algebra/Lie/EngelSubalgebra.lean @@ -143,6 +143,7 @@ lemma normalizer_eq_self_of_engel_le [IsArtinian R L] apply aux₁ simp only [Submodule.coe_subtype, SetLike.coe_mem] +set_option backward.isDefEq.respectTransparency.types false in /-- A Lie subalgebra of a Noetherian Lie algebra is nilpotent if it is contained in the Engel subalgebra of all its elements. -/ lemma isNilpotent_of_forall_le_engel [IsNoetherian R L] diff --git a/Mathlib/Algebra/Lie/Extension.lean b/Mathlib/Algebra/Lie/Extension.lean index 0ebbbe99e24d39..eedb2e906fca90 100644 --- a/Mathlib/Algebra/Lie/Extension.lean +++ b/Mathlib/Algebra/Lie/Extension.lean @@ -298,6 +298,7 @@ lemma lie_incl_mem_ker {E : Extension R M L} (x : E.L) (y : M) : ⁅x, E.incl y⁆ ∈ E.proj.ker := by rw [LieHom.mem_ker, LieHom.map_lie, proj_incl, lie_zero] +set_option backward.isDefEq.respectTransparency.types false in /-- The Lie algebra isomorphism from the kernel of an extension to the kernel of the projection. -/ noncomputable def toKer (E : Extension R M L) : M ≃ₗ⁅R⁆ E.proj.ker where @@ -311,6 +312,7 @@ noncomputable def toKer (E : Extension R M L) : rfl right_inv x := by simpa [Subtype.ext_iff] using! Equiv.apply_ofInjective_symm E.incl_injective _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lie_toKer_apply (E : Extension R M L) (x : M) (y : E.L) : ⁅y, (E.toKer x : E.L)⁆ = ⁅y, E.incl x⁆ := by rfl @@ -321,7 +323,7 @@ instance [IsLieAbelian M] (E : Extension R M L) : IsLieAbelian E.proj.ker := /-- Given an extension of `L` by `M` whose kernel `M` is abelian, the kernel `M` gets an `L`-module structure. We do not make this an instance, because we may have to work with more than one extension. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] noncomputable def ringModuleOf [IsLieAbelian M] (E : Extension R M L) : LieRingModule L M where bracket x y := E.toKer.symm ⁅E.proj_surjective.hasRightInverse.choose x, E.toKer y⁆ add_lie x y m := by diff --git a/Mathlib/Algebra/Lie/Graded.lean b/Mathlib/Algebra/Lie/Graded.lean index 14ef244ac42f03..5c772994581ff5 100644 --- a/Mathlib/Algebra/Lie/Graded.lean +++ b/Mathlib/Algebra/Lie/Graded.lean @@ -83,6 +83,7 @@ lemma decompose_symm_bracket (x y : ⨁ i, ℒ i) : simp only [← decomposeLinearEquiv_symm_apply] simp +set_option backward.isDefEq.respectTransparency false in instance : LieAlgebra R (⨁ i, ℒ i) where add_smul _ _ _ := by simp [add_smul] zero_smul _ := by simp @@ -141,6 +142,7 @@ lemma ofGradingSum_of (φ : ι →+ R) (i : ι) (a : ℒ i) : ofGradingSum ℒ φ (of (ℒ ·) i a) = (φ i) • (of (ℒ ·) i a) := by simp [← lof_eq_of R, ofGradingSum] +set_option backward.isDefEq.respectTransparency false in /-- The Lie derivation on a graded Lie algebra that scalar-multiplies by an additive function of the degree. -/ def ofGrading (φ : ι →+ R) : @@ -150,6 +152,7 @@ def ofGrading (φ : ι →+ R) : map_smul' _ _ := by simp leibniz' x y := by simp [decomposeLinearEquiv_apply, decomposeLinearEquiv_symm_apply] +set_option backward.isDefEq.respectTransparency false in lemma ofGrading_apply_apply (φ : ι →+ R) {i : ι} {a : L} (ha : a ∈ ℒ i) : ofGrading ℒ φ a = φ i • a := by simp [ofGrading, decomposeLinearEquiv_apply, decompose_of_mem ℒ ha] diff --git a/Mathlib/Algebra/Lie/LieTheorem.lean b/Mathlib/Algebra/Lie/LieTheorem.lean index 1010589825e994..01bb44f6e99c20 100644 --- a/Mathlib/Algebra/Lie/LieTheorem.lean +++ b/Mathlib/Algebra/Lie/LieTheorem.lean @@ -49,6 +49,7 @@ local notation "π" => LieModule.toEnd R _ V private abbrev T (w : A) : Module.End R V := (π w) - χ w • 1 +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in /-- An auxiliary lemma used only in the definition `LieModule.weightSpaceOfIsLieTower` below. -/ private lemma weightSpaceOfIsLieTower_aux (z : L) (v : V) (hv : v ∈ weightSpace V χ) : diff --git a/Mathlib/Algebra/Lie/SemiDirect.lean b/Mathlib/Algebra/Lie/SemiDirect.lean index 1aadbffaf653cd..0532ebe7a19e85 100644 --- a/Mathlib/Algebra/Lie/SemiDirect.lean +++ b/Mathlib/Algebra/Lie/SemiDirect.lean @@ -96,6 +96,7 @@ instance : LieRing (K ⋊⁅ψ⁆ L) where lie_self _ := by simp leibniz_lie _ _ _ := by simp; grind [lie_skew] +set_option backward.isDefEq.respectTransparency false in instance : LieAlgebra R (K ⋊⁅ψ⁆ L) where lie_smul _ _ _ := by simp [smul_sub, smul_add] diff --git a/Mathlib/Algebra/Lie/Solvable.lean b/Mathlib/Algebra/Lie/Solvable.lean index c6923c1c2982f7..bb82448d13643e 100644 --- a/Mathlib/Algebra/Lie/Solvable.lean +++ b/Mathlib/Algebra/Lie/Solvable.lean @@ -114,6 +114,7 @@ theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I ≤ J) (k : ℕ) : theorem derivedSeriesOfIdeal_antitone {k l : ℕ} (h : l ≤ k) : D k I ≤ D l I := derivedSeriesOfIdeal_le le_rfl h +set_option backward.isDefEq.respectTransparency.types false in theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : ℕ) : D (k + l) (I + J) ≤ D k I + D l J := by let D₁ : LieIdeal R L →o LieIdeal R L := diff --git a/Mathlib/Algebra/Lie/Submodule.lean b/Mathlib/Algebra/Lie/Submodule.lean index a5a978511e024c..149d17be504e58 100644 --- a/Mathlib/Algebra/Lie/Submodule.lean +++ b/Mathlib/Algebra/Lie/Submodule.lean @@ -971,6 +971,7 @@ lemma map_le_range {M' : Type*} rw [← LieModuleHom.map_top] exact LieSubmodule.map_mono le_top +set_option backward.isDefEq.respectTransparency false in @[simp] lemma map_incl_lt_iff_lt_top {N' : LieSubmodule R L N} : N'.map (LieSubmodule.incl N) < N ↔ N' < ⊤ := by diff --git a/Mathlib/Algebra/Lie/TensorProduct.lean b/Mathlib/Algebra/Lie/TensorProduct.lean index 80726c4340b0e4..3db80295299c09 100644 --- a/Mathlib/Algebra/Lie/TensorProduct.lean +++ b/Mathlib/Algebra/Lie/TensorProduct.lean @@ -66,6 +66,7 @@ instance lieRingModule : LieRingModule L (M ⊗[R] N) where map_add, LieHom.lie_apply, Module.End.lie_apply, LinearMap.lTensor_tmul] abel +set_option backward.isDefEq.respectTransparency false in /-- The tensor product of two Lie modules is a Lie module. -/ instance lieModule : LieModule R L (M ⊗[R] N) where smul_lie c x t := by diff --git a/Mathlib/Algebra/Lie/Weights/Basic.lean b/Mathlib/Algebra/Lie/Weights/Basic.lean index 33b8f679569bf4..a1c841bbd69b6d 100644 --- a/Mathlib/Algebra/Lie/Weights/Basic.lean +++ b/Mathlib/Algebra/Lie/Weights/Basic.lean @@ -266,6 +266,7 @@ lemma isNonZero_iff_ne_zero [Nontrivial (genWeightSpace M (0 : L → R))] {χ : noncomputable instance : DecidablePred (IsNonZero (R := R) (L := L) (M := M)) := Classical.decPred _ +set_option backward.isDefEq.respectTransparency.types false in variable (R L M) in /-- The set of weights is equivalent to a subtype. -/ def equivSetOf : Weight R L M ≃ {χ : L → R | genWeightSpace M χ ≠ ⊥} where diff --git a/Mathlib/Algebra/Lie/Weights/Chain.lean b/Mathlib/Algebra/Lie/Weights/Chain.lean index cbc27a949a541c..e657a79cc4acab 100644 --- a/Mathlib/Algebra/Lie/Weights/Chain.lean +++ b/Mathlib/Algebra/Lie/Weights/Chain.lean @@ -202,6 +202,7 @@ lemma trace_toEnd_genWeightSpaceChain_eq_zero | add => simp_all | smul => simp_all +set_option backward.isDefEq.respectTransparency.types false in /-- Given a (potential) root `α` relative to a Cartan subalgebra `H`, if we restrict to the ideal `I = corootSpace α` of `H` (informally, `I = ⁅H(α), H(-α)⁆`), we may find an integral linear combination between `α` and any weight `χ` of a representation. diff --git a/Mathlib/Algebra/Lie/Weights/IsSimple.lean b/Mathlib/Algebra/Lie/Weights/IsSimple.lean index 46c7955c7d3236..e5bc1c66b7253c 100644 --- a/Mathlib/Algebra/Lie/Weights/IsSimple.lean +++ b/Mathlib/Algebra/Lie/Weights/IsSimple.lean @@ -139,6 +139,7 @@ lemma rootSet_apply_coroot_eq_zero_of_notMem_rootSet (I : LieIdeal K L) LinearMap.BilinForm.orthogonal_span_singleton_eq_toLin_ker, LinearMap.mem_ker] exact traceForm_eq_zero_of_mem_ker_of_mem_span_coroot h_ker (Submodule.mem_span_singleton_self _) +set_option backward.isDefEq.respectTransparency.types false in /-- The intersection of a Lie ideal and a Cartan subalgebra is the span of the coroots whose roots have root spaces in the ideal. -/ lemma restr_inf_cartan_eq_biSup_corootSubmodule (I : LieIdeal K L) : @@ -375,6 +376,7 @@ private theorem chi_not_in_q_aux (h_chi_not_in_q : ↑χ ∉ q) : end +set_option backward.isDefEq.respectTransparency.types false in include hq hx_χ hαq in private theorem invtSubmoduleToLieIdeal_aux (hm_α : m_α ∈ sl2SubmoduleOfRoot hα₀) : ⁅x_χ, m_α⁆ ∈ ⨆ α : {α : Weight K H L // ↑α ∈ q ∧ α.IsNonZero}, sl2SubmoduleOfRoot α.2.2 := by diff --git a/Mathlib/Algebra/Lie/Weights/Killing.lean b/Mathlib/Algebra/Lie/Weights/Killing.lean index 4a54f115b1b491..97f8fc035cb5c6 100644 --- a/Mathlib/Algebra/Lie/Weights/Killing.lean +++ b/Mathlib/Algebra/Lie/Weights/Killing.lean @@ -692,6 +692,7 @@ lemma coe_coroot_mem_corootSubmodule (α : Weight K H L) : (LieSubmodule.mem_map _).mpr ⟨⟨coroot α, (coroot α).property⟩, coroot_mem_corootSpace α, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in open Submodule in lemma sl2SubmoduleOfRoot_eq_sup (α : Weight K H L) (hα : α.IsNonZero) : sl2SubmoduleOfRoot hα = genWeightSpace L α ⊔ genWeightSpace L (-α) ⊔ corootSubmodule α := by diff --git a/Mathlib/Algebra/Module/CharacterModule.lean b/Mathlib/Algebra/Module/CharacterModule.lean index 6e22dfba48b85c..9170222fd25185 100644 --- a/Mathlib/Algebra/Module/CharacterModule.lean +++ b/Mathlib/Algebra/Module/CharacterModule.lean @@ -47,6 +47,7 @@ def CharacterModule : Type uA := A →+ AddCircle (1 : ℚ) namespace CharacterModule +set_option backward.isDefEq.respectTransparency.types false in instance : FunLike (CharacterModule A) A (AddCircle (1 : ℚ)) where coe c := c.toFun coe_injective' _ _ _ := by simp_all @@ -113,6 +114,7 @@ def congr (e : A ≃ₗ[R] B) : CharacterModule A ≃ₗ[R] CharacterModule B := open TensorProduct +set_option backward.isDefEq.respectTransparency.types false in /-- Any linear map `L : A → B⋆` induces a character in `(A ⊗ B)⋆` by `a ⊗ b ↦ L a b`. -/ @@ -136,6 +138,7 @@ Any character `c` in `(A ⊗ B)⋆` induces a linear map `A → B⋆` by `a ↦ map_add' _ _ := rfl map_smul' r c := by ext; exact congr(c $(TensorProduct.tmul_smul _ _ _)).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Linear maps into a character module are exactly characters of the tensor product. -/ diff --git a/Mathlib/Algebra/Module/Equiv/Basic.lean b/Mathlib/Algebra/Module/Equiv/Basic.lean index d54d846e37e0eb..566923c75a50ea 100644 --- a/Mathlib/Algebra/Module/Equiv/Basic.lean +++ b/Mathlib/Algebra/Module/Equiv/Basic.lean @@ -563,6 +563,7 @@ See also `LinearEquiv.arrowCongr` for the linear version of this isomorphism. -/ ext x simp only [map_add, add_apply, Function.comp_apply, coe_comp, coe_coe] +set_option backward.isDefEq.respectTransparency false in /-- If `M` and `M₂` are linearly isomorphic then the endomorphism rings of `M` and `M₂` are isomorphic. @@ -665,6 +666,7 @@ variable [RingHomCompTriple σ₂'₂'' σ₂''₁'' σ₂'₁''] [RingHomCompTr variable [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [RingHomCompTriple σ₃₂ σ₂₁ σ₃₁] variable [RingHomCompTriple σ₁'₂' σ₂'₃' σ₁'₃'] [RingHomCompTriple σ₃'₂' σ₂'₁' σ₃'₁'] +set_option backward.isDefEq.respectTransparency false in /-- A linear isomorphism between the domains and codomains of two spaces of linear maps gives a linear isomorphism between the two function spaces. diff --git a/Mathlib/Algebra/Module/Equiv/Defs.lean b/Mathlib/Algebra/Module/Equiv/Defs.lean index 5d4616cf15966c..14a412f258926e 100644 --- a/Mathlib/Algebra/Module/Equiv/Defs.lean +++ b/Mathlib/Algebra/Module/Equiv/Defs.lean @@ -140,6 +140,7 @@ instance : Coe (M ≃ₛₗ[σ] M₂) (M →ₛₗ[σ] M₂) := -- This exists for compatibility, previously `≃ₗ[R]` extended `≃` instead of `≃+`. /-- The equivalence of types underlying a linear equivalence. -/ +@[implicit_reducible] def toEquiv (e : M ≃ₛₗ[σ] M₂) : M ≃ M₂ := e.toAddEquiv.toEquiv theorem toEquiv_injective : @@ -243,7 +244,7 @@ theorem refl_apply [Module R M] (x : M) : refl R M x = x := rfl /-- Linear equivalences are symmetric. -/ -@[symm] +@[symm, implicit_reducible] def symm (e : M ≃ₛₗ[σ] M₂) : M₂ ≃ₛₗ[σ'] M := { e.toLinearMap.inverse e.invFun e.left_inv e.right_inv, e.toEquiv.symm with @@ -541,8 +542,7 @@ theorem coe_symm_mk [Module R M] [Module R M₂] @[simp] theorem coe_symm_mk' [Module R M] [Module R M₂] {f inv_fun left_inv right_inv} : - ⇑(⟨f, inv_fun, left_inv, right_inv⟩ : M ≃ₗ[R] M₂).symm = inv_fun := - rfl + ⇑(⟨f, inv_fun, left_inv, right_inv⟩ : M ≃ₗ[R] M₂).symm = inv_fun := rfl protected theorem bijective : Function.Bijective e := e.toEquiv.bijective @@ -584,6 +584,7 @@ def _root_.RingEquiv.toSemilinearEquiv (f : R ≃+* S) : toFun := f map_smul' := f.map_mul } +set_option backward.isDefEq.respectTransparency false in @[simp] lemma _root_.RingEquiv.symm_toSemilinearEquiv_symm_apply (f : R ≃+* S) (x : R) : f.symm.toSemilinearEquiv.symm (σ' := RingHomClass.toRingHom f) x = f x := rfl diff --git a/Mathlib/Algebra/Module/FinitePresentation.lean b/Mathlib/Algebra/Module/FinitePresentation.lean index 71029470069912..da760ae4caf67e 100644 --- a/Mathlib/Algebra/Module/FinitePresentation.lean +++ b/Mathlib/Algebra/Module/FinitePresentation.lean @@ -163,6 +163,8 @@ instance : Module.FinitePresentation R R := Module.finitePresentation_of_project instance : Module.FinitePresentation R (ι →₀ R) := Module.finitePresentation_of_projective _ _ instance : Module.FinitePresentation R (ι → R) := Module.finitePresentation_of_projective _ _ +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in lemma Module.finitePresentation_of_surjective [h : Module.FinitePresentation R M] (l : M →ₗ[R] N) (hl : Function.Surjective l) (hl' : (LinearMap.ker l).FG) : Module.FinitePresentation R N := by @@ -181,6 +183,8 @@ lemma Module.finitePresentation_of_surjective [h : Module.FinitePresentation R M ← Finset.coe_image] exact Submodule.FG.sup ⟨_, rfl⟩ hs' +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in lemma Module.FinitePresentation.fg_ker [Module.Finite R M] [h : Module.FinitePresentation R N] (l : M →ₗ[R] N) (hl : Function.Surjective l) : (LinearMap.ker l).FG := by @@ -210,6 +214,8 @@ lemma Module.FinitePresentation.fg_ker_iff [Module.FinitePresentation R M] Submodule.FG (LinearMap.ker l) ↔ Module.FinitePresentation R N := ⟨finitePresentation_of_surjective l hl, fun _ ↦ fg_ker l hl⟩ +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in lemma Module.finitePresentation_of_ker [Module.FinitePresentation R N] (l : M →ₗ[R] N) (hl : Function.Surjective l) [Module.FinitePresentation R (LinearMap.ker l)] : Module.FinitePresentation R M := by @@ -358,6 +364,8 @@ instance (S : Submonoid R) [Module.FinitePresentation R M] : FinitePresentation.of_isBaseChange (LocalizedModule.mkLinearMap S M) ((isLocalizedModule_iff_isBaseChange S _ _).mp inferInstance) +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in lemma Module.FinitePresentation.exists_lift_of_isLocalizedModule [h : Module.FinitePresentation R M] (g : M →ₗ[R] N') : ∃ (h : M →ₗ[R] N) (s : S), f ∘ₗ h = s • g := by diff --git a/Mathlib/Algebra/Module/Injective.lean b/Mathlib/Algebra/Module/Injective.lean index ca85a85e159ea9..79a3d21da9da63 100644 --- a/Mathlib/Algebra/Module/Injective.lean +++ b/Mathlib/Algebra/Module/Injective.lean @@ -473,6 +473,7 @@ instance Module.Injective.pi ext i exact DFunLike.congr_fun (hl i) x⟩ +set_option backward.isDefEq.respectTransparency false in universe u' in attribute [local instance] RingHomInvPair.of_ringEquiv in theorem Module.Injective.of_ringEquiv {R : Type u} [Ring R] [Small.{v} R] {S : Type u'} [Ring S] diff --git a/Mathlib/Algebra/Module/Lattice.lean b/Mathlib/Algebra/Module/Lattice.lean index c97a642252df6f..bac5f85eaa181e 100644 --- a/Mathlib/Algebra/Module/Lattice.lean +++ b/Mathlib/Algebra/Module/Lattice.lean @@ -148,6 +148,7 @@ noncomputable def _root_.Module.Basis.extendOfIsLattice [IsFractionRing R K] {κ simp [b.span_eq, Submodule.map_top, span_eq_top] Basis.mk hli hsp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma _root_.Module.Basis.extendOfIsLattice_apply [IsFractionRing R K] {κ : Type*} {M : Submodule R V} [IsLattice K M] (b : Basis κ R M) (k : κ) : diff --git a/Mathlib/Algebra/Module/LinearMap/Defs.lean b/Mathlib/Algebra/Module/LinearMap/Defs.lean index 9d5922bdb21dda..306e5b993d7d52 100644 --- a/Mathlib/Algebra/Module/LinearMap/Defs.lean +++ b/Mathlib/Algebra/Module/LinearMap/Defs.lean @@ -264,7 +264,7 @@ theorem toLinearMap_injective {F : Type*} [FunLike F M M₃] [SemilinearMapClass exact DFunLike.congr_fun h m /-- Identity map as a `LinearMap` -/ -@[implicit_reducible] +@[instance_reducible] def id : M →ₗ[R] M := { DistribMulActionHom.id R with toFun x := x } @@ -482,7 +482,7 @@ variable {module_M₁ : Module R₁ M₁} {module_M₂ : Module R₂ M₂} {modu variable {σ₁₂ : R₁ →+* R₂} {σ₂₃ : R₂ →+* R₃} {σ₁₃ : R₁ →+* R₃} /-- Composition of two linear maps is a linear map -/ -@[implicit_reducible] +@[instance_reducible] def comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] (f : M₂ →ₛₗ[σ₂₃] M₃) (g : M₁ →ₛₗ[σ₁₂] M₂) : M₁ →ₛₗ[σ₁₃] M₃ where toFun x := f (g x) @@ -558,6 +558,7 @@ variable [AddCommMonoid M] [AddCommMonoid M₂] [AddCommMonoid M₃] variable [Module R M] [Module S M₂] {σ : R →+* S} {σ' : S →+* R} [RingHomInvPair σ σ'] /-- If a function `g` is a left and right inverse of a linear map `f`, then `g` is linear itself. -/ +@[implicit_reducible] def inverse (f : M →ₛₗ[σ] M₂) (g : M₂ → M) (h₁ : LeftInverse g f) (h₂ : RightInverse g f) : M₂ →ₛₗ[σ'] M := by dsimp [LeftInverse, Function.RightInverse] at h₁ h₂ diff --git a/Mathlib/Algebra/Module/LinearMap/Polynomial.lean b/Mathlib/Algebra/Module/LinearMap/Polynomial.lean index f4ac32d9e1ee8e..bef65afd2fea62 100644 --- a/Mathlib/Algebra/Module/LinearMap/Polynomial.lean +++ b/Mathlib/Algebra/Module/LinearMap/Polynomial.lean @@ -127,6 +127,7 @@ lemma toMvPolynomial_add (M N : Matrix m n R) : ext i : 1 simp only [toMvPolynomial, add_apply, map_add, Finset.sum_add_distrib, Pi.add_apply] +set_option backward.isDefEq.respectTransparency.types false in lemma toMvPolynomial_mul (M : Matrix m n R) (N : Matrix n o R) (i : m) : (M * N).toMvPolynomial i = bind₁ N.toMvPolynomial (M.toMvPolynomial i) := by simp only [toMvPolynomial, mul_apply, map_sum, Finset.sum_comm (γ := o), bind₁, aeval, @@ -303,6 +304,7 @@ lemma polyCharpolyAux_coeff_eval [Module.Finite R M] [Module.Free R M] (x : L) ( nontriviality R rw [← polyCharpolyAux_map_eq_charpoly φ b bₘ x, Polynomial.coeff_map] +set_option backward.isDefEq.respectTransparency.types false in lemma polyCharpolyAux_map_eval [Module.Finite R M] [Module.Free R M] (x : ι → R) : (polyCharpolyAux φ b bₘ).map (MvPolynomial.eval x) = diff --git a/Mathlib/Algebra/Module/LocalizedModule/Basic.lean b/Mathlib/Algebra/Module/LocalizedModule/Basic.lean index d4e732feb760fb..82e3a90766fb3c 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Basic.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Basic.lean @@ -541,6 +541,7 @@ lemma IsLocalizedModule.injective_iff_isRegular [IsLocalizedModule S f] : Function.Injective f ↔ ∀ c : S, IsSMulRegular M c := by simp_rw [IsSMulRegular, Function.Injective, eq_iff_exists S, exists_imp, forall_comm (α := S)] +set_option backward.isDefEq.respectTransparency false in instance IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] : IsLocalizedModule S (e ∘ₗ f : M →ₗ[R] M'') where map_units s := by @@ -557,6 +558,7 @@ instance IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocaliz EmbeddingLike.apply_eq_iff_eq] at h exact hf.exists_of_eq h +set_option backward.isDefEq.respectTransparency false in instance IsLocalizedModule.of_linearEquiv_right (e : M'' ≃ₗ[R] M) [hf : IsLocalizedModule S f] : IsLocalizedModule S (f ∘ₗ e : M'' →ₗ[R] M') where map_units s := hf.map_units s @@ -1052,6 +1054,7 @@ theorem mk_eq_mk' (s : S) (m : M) : rw [eq_comm, mk'_eq_iff, Submonoid.smul_def, LocalizedModule.smul'_mk, ← Submonoid.smul_def, LocalizedModule.mk_cancel, LocalizedModule.mkLinearMap_apply] +set_option backward.isDefEq.respectTransparency false in variable (A) in lemma mk'_smul_mk' (x : R) (m : M) (s t : S) : IsLocalization.mk' A x s • mk' f m t = mk' f (x • m) (s * t) := by @@ -1091,6 +1094,7 @@ lemma liftOfLE_comp : (liftOfLE S₁ S₂ h f₁ f₂).comp f₁ = f₂ := lift_ @[simp] lemma liftOfLE_apply (x) : liftOfLE S₁ S₂ h f₁ f₂ (f₁ x) = f₂ x := lift_apply .. +set_option backward.isDefEq.respectTransparency false in /-- The image of `m/s` under `liftOfLE` is `m/s`. -/ @[simp] lemma liftOfLE_mk' (m : M) (s : S₁) : @@ -1245,6 +1249,7 @@ theorem map_comp' (g : M₀ →ₗ[R] M₁) (h : M₁ →ₗ[R] M₂) : section Algebra +set_option backward.isDefEq.respectTransparency false in theorem mkOfAlgebra {R S S' : Type*} [CommSemiring R] [Ring S] [Ring S'] [Algebra R S] [Algebra R S'] (M : Submonoid R) (f : S →ₐ[R] S') (h₁ : ∀ x ∈ M, IsUnit (algebraMap R S' x)) (h₂ : ∀ y, ∃ x : S × M, x.2 • y = f x.1) (h₃ : ∀ x, f x = 0 → ∃ m : M, m • x = 0) : diff --git a/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean b/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean index 5f9397f0e4d59c..efe52148da271f 100644 --- a/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean +++ b/Mathlib/Algebra/Module/LocalizedModule/Submodule.lean @@ -40,8 +40,13 @@ variable (M' M'' : Submodule R M) namespace Submodule +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Set + /-- Let `N` be a localization of an `R`-module `M` at `p`. This is the localization of an `R`-submodule of `M` viewed as an `R`-submodule of `N`. -/ +@[local implicit_reducible] def localized₀ : Submodule R N where carrier := { x | ∃ m ∈ M', ∃ s : p, IsLocalizedModule.mk' f m s = x } add_mem' := fun {x y} ⟨m, hm, s, hx⟩ ⟨n, hn, t, hy⟩ ↦ ⟨t • m + s • n, add_mem (M'.smul_mem t hm) @@ -72,6 +77,7 @@ lemma restrictScalars_localized' : (localized' S p f M').restrictScalars R = localized₀ p f M' := rfl +@[local implicit_reducible] theorem localized'_eq_span : localized' S p f M' = span S (f '' M') := by refine le_antisymm ?_ (span_le.mpr <| by rintro _ ⟨m, hm, rfl⟩; exact ⟨m, hm, 1, by simp⟩) rintro _ ⟨m, hm, s, rfl⟩ diff --git a/Mathlib/Algebra/Module/NatInt.lean b/Mathlib/Algebra/Module/NatInt.lean index 9daa84aa1c71eb..db46f24d919d5e 100644 --- a/Mathlib/Algebra/Module/NatInt.lean +++ b/Mathlib/Algebra/Module/NatInt.lean @@ -131,7 +131,7 @@ theorem nat_smul_eq_nsmul (h : Module ℕ M) (n : ℕ) (x : M) : h.smul n x = n /-- All `ℕ`-module structures are equal. Not an instance since in mathlib all `AddCommMonoid` should normally have exactly one `ℕ`-module structure by design. -/ -@[implicit_reducible] +@[instance_reducible] def AddCommMonoid.uniqueNatModule : Unique (Module ℕ M) where default := inferInstance uniq P := (Module.ext' P _) fun n => by convert! nat_smul_eq_nsmul P n @@ -183,7 +183,7 @@ theorem int_smul_eq_zsmul (h : Module ℤ M) (n : ℤ) (x : M) : h.smul n x = n /-- All `ℤ`-module structures are equal. Not an instance since in mathlib all `AddCommGroup` should normally have exactly one `ℤ`-module structure by design. -/ -@[implicit_reducible] +@[instance_reducible] def AddCommGroup.uniqueIntModule : Unique (Module ℤ M) where default := inferInstance uniq P := (Module.ext' P _) fun n => by convert! int_smul_eq_zsmul P n diff --git a/Mathlib/Algebra/Module/PID.lean b/Mathlib/Algebra/Module/PID.lean index afc20225a1d2ba..2a08b44d558d82 100644 --- a/Mathlib/Algebra/Module/PID.lean +++ b/Mathlib/Algebra/Module/PID.lean @@ -166,6 +166,7 @@ theorem exists_smul_eq_zero_and_mk_eq {z : M} (hz : Module.IsTorsionBy R M (p ^ open Finset Multiset +set_option backward.isDefEq.respectTransparency.types false in omit dec in /-- A finitely generated `p ^ ∞`-torsion module over a PID is isomorphic to a direct sum of some `R ⧸ R ∙ (p ^ e i)` for some `e i`. -/ diff --git a/Mathlib/Algebra/Module/Presentation/Cokernel.lean b/Mathlib/Algebra/Module/Presentation/Cokernel.lean index 5e7bd266e20efd..1b0f88f55b63f4 100644 --- a/Mathlib/Algebra/Module/Presentation/Cokernel.lean +++ b/Mathlib/Algebra/Module/Presentation/Cokernel.lean @@ -98,6 +98,7 @@ variable (hg₁ : Submodule.span A (Set.range g₁) = ⊤) namespace cokernelSolution +set_option backward.isDefEq.respectTransparency false in /-- The cokernel can be defined by generators and relations. -/ noncomputable def isPresentationCore : Relations.Solution.IsPresentationCore.{w} diff --git a/Mathlib/Algebra/Module/Presentation/Differentials.lean b/Mathlib/Algebra/Module/Presentation/Differentials.lean index b836e39a4e43f4..4b692a5b0b6378 100644 --- a/Mathlib/Algebra/Module/Presentation/Differentials.lean +++ b/Mathlib/Algebra/Module/Presentation/Differentials.lean @@ -152,6 +152,7 @@ lemma differentials.comm₂₃ : pres.differentialsSolution.π := comm₂₃' pres +set_option backward.isDefEq.respectTransparency.types false in open differentials in lemma differentialsSolution_isPresentation : pres.differentialsSolution.IsPresentation := by diff --git a/Mathlib/Algebra/Module/Presentation/DirectSum.lean b/Mathlib/Algebra/Module/Presentation/DirectSum.lean index 4b889999a013fb..caa9245fc39ede 100644 --- a/Mathlib/Algebra/Module/Presentation/DirectSum.lean +++ b/Mathlib/Algebra/Module/Presentation/DirectSum.lean @@ -84,6 +84,7 @@ namespace IsPresentation variable {solution : ∀ (i : ι), (relations i).Solution (M i)} (h : ∀ i, (solution i).IsPresentation) +set_option backward.isDefEq.respectTransparency false in /-- The direct sum admits a presentation by generators and relations. -/ noncomputable def directSum.isRepresentationCore : Solution.IsPresentationCore.{w'} (directSum solution) where diff --git a/Mathlib/Algebra/Module/SnakeLemma.lean b/Mathlib/Algebra/Module/SnakeLemma.lean index 16cf157e6bcc5a..ca281ff1d7c074 100644 --- a/Mathlib/Algebra/Module/SnakeLemma.lean +++ b/Mathlib/Algebra/Module/SnakeLemma.lean @@ -82,6 +82,7 @@ lemma SnakeLemma.eq_of_eq (x : K₃) rw [← sub_eq_zero, ← map_sub, hz₁, hπ₁] exact ⟨_, rfl⟩ +set_option backward.isDefEq.respectTransparency false in /-- **Snake Lemma** Suppose we have an exact commutative diagram diff --git a/Mathlib/Algebra/Module/Submodule/Bilinear.lean b/Mathlib/Algebra/Module/Submodule/Bilinear.lean index 4d739f6616c6dc..658cfd25f5e2bc 100644 --- a/Mathlib/Algebra/Module/Submodule/Bilinear.lean +++ b/Mathlib/Algebra/Module/Submodule/Bilinear.lean @@ -57,6 +57,7 @@ theorem map₂_le {f : M →ₗ[R] N →ₗ[R] P} {p : Submodule R M} {q : Submo ⟨fun H _m hm _n hn => H <| apply_mem_map₂ _ hm hn, fun H => iSup_le fun ⟨m, hm⟩ => map_le_iff_le_comap.2 fun n hn => H m hm n hn⟩ +set_option backward.isDefEq.respectTransparency false in variable (R) in theorem map₂_span_span (f : M →ₗ[R] N →ₗ[R] P) (s : Set M) (t : Set N) : map₂ f (span R s) (span R t) = span R (Set.image2 (fun m n => f m n) s t) := by diff --git a/Mathlib/Algebra/Module/Submodule/Defs.lean b/Mathlib/Algebra/Module/Submodule/Defs.lean index da020d975621c2..4eedfbd08fae36 100644 --- a/Mathlib/Algebra/Module/Submodule/Defs.lean +++ b/Mathlib/Algebra/Module/Submodule/Defs.lean @@ -179,7 +179,7 @@ instance (priority := 75) toModule : Module R S' := fast_instance% /-- This can't be an instance because Lean wouldn't know how to find `R`, but we can still use this to manually derive `Module` on specific types. -/ -@[implicit_reducible] +@[instance_reducible] def toModule' (S R' R A : Type*) [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A] [Semiring R'] [SMul R' R] [Module R' A] [IsScalarTower R' R A] [SetLike S A] [AddSubmonoidClass S A] [SMulMemClass S R A] (s : S) : diff --git a/Mathlib/Algebra/Module/Submodule/Invariant.lean b/Mathlib/Algebra/Module/Submodule/Invariant.lean index ec04da8d126ce9..620c23580f7b15 100644 --- a/Mathlib/Algebra/Module/Submodule/Invariant.lean +++ b/Mathlib/Algebra/Module/Submodule/Invariant.lean @@ -98,9 +98,11 @@ lemma sup_mem {p q : Submodule R M} (hp : p ∈ f.invtSubmodule) (hq : q ∈ f.i variable (f) +set_option backward.isDefEq.respectTransparency false in @[simp] protected lemma top_mem : ⊤ ∈ f.invtSubmodule := by simp [invtSubmodule] +set_option backward.isDefEq.respectTransparency false in @[simp] protected lemma bot_mem : ⊥ ∈ f.invtSubmodule := by simp [invtSubmodule] @@ -125,10 +127,12 @@ protected lemma one : invtSubmodule (1 : End R M) = ⊤ := invtSubmodule.id +set_option backward.isDefEq.respectTransparency false in protected lemma mk_eq_bot_iff {p : Submodule R M} (hp : p ∈ f.invtSubmodule) : (⟨p, hp⟩ : f.invtSubmodule) = ⊥ ↔ p = ⊥ := Subtype.mk_eq_bot_iff (by simp [invtSubmodule]) _ +set_option backward.isDefEq.respectTransparency false in protected lemma mk_eq_top_iff {p : Submodule R M} (hp : p ∈ f.invtSubmodule) : (⟨p, hp⟩ : f.invtSubmodule) = ⊤ ↔ p = ⊤ := Subtype.mk_eq_top_iff (by simp [invtSubmodule]) _ @@ -171,6 +175,7 @@ protected lemma isCompl_iff {p q : f.invtSubmodule} : obtain ⟨q, hq⟩ := q simp +set_option backward.isDefEq.respectTransparency false in lemma map_subtype_mem_of_mem_invtSubmodule {p : Submodule R M} (hp : p ∈ f.invtSubmodule) {q : Submodule R p} (hq : q ∈ invtSubmodule (LinearMap.restrict f hp)) : Submodule.map p.subtype q ∈ f.invtSubmodule := by diff --git a/Mathlib/Algebra/Module/Submodule/Ker.lean b/Mathlib/Algebra/Module/Submodule/Ker.lean index 876ecf85efa630..4b53e962f07cf8 100644 --- a/Mathlib/Algebra/Module/Submodule/Ker.lean +++ b/Mathlib/Algebra/Module/Submodule/Ker.lean @@ -121,6 +121,7 @@ theorem ker_codRestrict (p : Submodule R₂ M₂) (f : M →ₛₗ[τ₁₂] M lemma ker_domRestrict (p : Submodule R M) (f : M →ₛₗ[τ₁₂] M₂) : ker (domRestrict f p) = (ker f).comap p.subtype := ker_comp .. +set_option backward.isDefEq.respectTransparency false in theorem ker_restrict {p : Submodule R M} {q : Submodule R₂ M₂} {f : M →ₛₗ[τ₁₂] M₂} (hf : ∀ x : M, x ∈ p → f x ∈ q) : ker (f.restrict hf) = (ker f).comap p.subtype := by diff --git a/Mathlib/Algebra/Module/Submodule/LinearMap.lean b/Mathlib/Algebra/Module/Submodule/LinearMap.lean index 928792321523ec..12ed7dd4a16856 100644 --- a/Mathlib/Algebra/Module/Submodule/LinearMap.lean +++ b/Mathlib/Algebra/Module/Submodule/LinearMap.lean @@ -185,6 +185,7 @@ section variable {M₂' : Type*} [AddCommMonoid M₂'] [Module R₂ M₂'] (p : M₂' →ₗ[R₂] M₂) (hp : Injective p) (h : ∀ c, f c ∈ range p) +set_option backward.isDefEq.respectTransparency false in /-- A linear map `f : M → M₂` whose values lie in the image of an injective linear map `p : M₂' → M₂` admits a unique lift to a linear map `M → M₂'`. -/ noncomputable def codLift : @@ -224,6 +225,7 @@ theorem restrict_apply {f : M →ₛₗ[σ₁₂] M₂} {p : Submodule R M} {q : (hf : ∀ x ∈ p, f x ∈ q) (x : p) : f.restrict hf x = ⟨f x, hf x.1 x.2⟩ := rfl +set_option backward.isDefEq.respectTransparency false in lemma restrict_sub {R R₂ M M₂ : Type*} [Ring R] [Ring R₂] {σ₁₂ : R →+* R₂} [AddCommGroup M] [AddCommGroup M₂] [Module R M] [Module R₂ M₂] {p : Submodule R M} {q : Submodule R₂ M₂} {f g : M →ₛₗ[σ₁₂] M₂} diff --git a/Mathlib/Algebra/Module/Submodule/Map.lean b/Mathlib/Algebra/Module/Submodule/Map.lean index c41af3f34468ea..5dc79d8130931e 100644 --- a/Mathlib/Algebra/Module/Submodule/Map.lean +++ b/Mathlib/Algebra/Module/Submodule/Map.lean @@ -168,6 +168,7 @@ theorem map_equivMapOfInjective_symm_apply (f : M →ₛₗ[σ₁₂] M₂) (i : i.eq_iff, LinearEquiv.apply_symm_apply] /-- The pullback of a submodule `p ⊆ M₂` along `f : M → M₂` -/ +@[implicit_reducible] def comap (f : M →ₛₗ[σ₁₂] M₂) (p : Submodule R₂ M₂) : Submodule R M := { p.toAddSubmonoid.comap f with carrier := f ⁻¹' p @@ -537,8 +538,8 @@ of `t.subtype`. -/ def comapSubtypeEquivOfLe {p q : Submodule R M} (hpq : p ≤ q) : comap q.subtype p ≃ₗ[R] p where toFun x := ⟨x, x.2⟩ invFun x := ⟨⟨x, hpq x.2⟩, x.2⟩ - left_inv x := by simp only [SetLike.eta] - right_inv x := by simp only [SetLike.eta] + left_inv x := by simp + right_inv x := by simp map_add' _ _ := rfl map_smul' _ _ := rfl @@ -692,11 +693,13 @@ theorem comap_domRestrict (p : Submodule R₂ M₂) (f : M₂ →ₛₗ[σ₂₁ comap (domRestrict f p) p' = comap p.subtype (comap f p') := comap_comp p.subtype f p' +set_option backward.isDefEq.respectTransparency.types false in theorem map_restrict [RingHomSurjective σ₂₁] {p : Submodule R₂ M₂} {q : Submodule R M} {f : M₂ →ₛₗ[σ₂₁] M} (h : ∀ x ∈ p, f x ∈ q) (p') : map (f.restrict h) p' = comap q.subtype (map f (map p.subtype p')) := by rw [restrict_eq_codRestrict_domRestrict, map_codRestrict, map_domRestrict] +set_option backward.isDefEq.respectTransparency.types false in theorem comap_restrict [RingHomSurjective σ₂₁] {p : Submodule R₂ M₂} {q : Submodule R M} {f : M₂ →ₛₗ[σ₂₁] M} (h : ∀ x ∈ p, f x ∈ q) (p') : comap (f.restrict h) p' = comap p.subtype (comap f (map q.subtype p')) := by @@ -719,6 +722,7 @@ variable {σ₁₂ : R →+* R₂} {σ₂₁ : R₂ →+* R} variable {re₁₂ : RingHomInvPair σ₁₂ σ₂₁} {re₂₁ : RingHomInvPair σ₂₁ σ₁₂} variable (e : M ≃ₛₗ[σ₁₂] M₂) +set_option backward.isDefEq.respectTransparency false in /-- A linear equivalence of two modules restricts to a linear equivalence from any submodule `p` of the domain onto the image of that submodule. diff --git a/Mathlib/Algebra/Module/Submodule/Range.lean b/Mathlib/Algebra/Module/Submodule/Range.lean index af73d5e971206b..ac563b31ac6134 100644 --- a/Mathlib/Algebra/Module/Submodule/Range.lean +++ b/Mathlib/Algebra/Module/Submodule/Range.lean @@ -144,6 +144,7 @@ def iterateRange (f : M →ₗ[R] M) : ℕ →o (Submodule R M)ᵒᵈ where toFun n := LinearMap.range (f ^ n) monotone' := monotone_nat_of_le_succ fun | n, _, ⟨x, rfl⟩ => ⟨f x, rfl⟩ +set_option backward.isDefEq.respectTransparency false in lemma iterateRange_succ {f : M →ₗ[R] M} {n : ℕ} : iterateRange f (n + 1) = (iterateRange f n).map f := by simp only [iterateRange_coe, range_eq_map, ← map_comp, Module.End.iterate_succ'] @@ -350,6 +351,7 @@ lemma restrictScalars_map [SMul R R₂] [Module R₂ M] [Module R M₂] [IsScala [IsScalarTower R R₂ M₂] (f : M →ₗ[R₂] M₂) (M' : Submodule R₂ M) : (M'.map f).restrictScalars R = (M'.restrictScalars R).map (f.restrictScalars R) := rfl +set_option backward.isDefEq.respectTransparency false in /-- If `N ⊆ M` then submodules of `N` are the same as submodules of `M` contained in `N`. See also `Submodule.mapIic`. -/ diff --git a/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean b/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean index 26aca7cdc39ede..2f286da58ecd1c 100644 --- a/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean +++ b/Mathlib/Algebra/Module/Submodule/RestrictScalars.lean @@ -137,6 +137,7 @@ lemma restrictScalars_sInf (s : Set (Submodule R M)) : (sInf s).restrictScalars S = sInf (restrictScalars S '' s) := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma restrictScalars_sSup (s : Set (Submodule R M)) : (sSup s).restrictScalars S = sSup (restrictScalars S '' s) := by diff --git a/Mathlib/Algebra/Module/Torsion/Basic.lean b/Mathlib/Algebra/Module/Torsion/Basic.lean index 73f3ab0e224fe2..d2d9b9941e17e4 100644 --- a/Mathlib/Algebra/Module/Torsion/Basic.lean +++ b/Mathlib/Algebra/Module/Torsion/Basic.lean @@ -549,7 +549,7 @@ variable [Ring R] [AddCommGroup M] [Module R M] variable {I : Ideal R} {r : R} /-- can't be an instance because `hM` can't be inferred -/ -@[implicit_reducible] +@[instance_reducible] def IsTorsionBySet.hasSMul (hM : IsTorsionBySet R M I) : SMul (R ⧸ I) M where smul b := QuotientAddGroup.lift I.toAddSubgroup (smulAddHom R M) (by rwa [isTorsionBySet_iff_subset_annihilator] at hM) b @@ -573,7 +573,7 @@ theorem IsTorsionBy.mk_smul [(Ideal.span {r}).IsTwoSided] (hM : IsTorsionBy R M rfl /-- An `(R ⧸ I)`-module is an `R`-module which `IsTorsionBySet R M I`. -/ -@[implicit_reducible] +@[instance_reducible] def IsTorsionBySet.module [I.IsTwoSided] (hM : IsTorsionBySet R M I) : Module (R ⧸ I) M := letI := hM.hasSMul; fast_instance% I.mkQ_surjective.moduleLeft _ (IsTorsionBySet.mk_smul hM) @@ -608,7 +608,7 @@ where finally /-- Any module is also a module over the quotient of the ring by the annihilator. Not an instance because it causes synthesis failures / timeouts. -/ -@[implicit_reducible] +@[instance_reducible] def quotientAnnihilator : Module (R ⧸ Module.annihilator R M) M := (isTorsionBySet_annihilator R M).module @@ -1005,7 +1005,7 @@ lemma torsionBy.mod_self_nsmul' (s : ℕ) {x : A} (h : x ∈ A[n]) : nsmul_eq_mod_nsmul s (torsionBy.nsmul_iff.mp h) /-- For a natural number `n`, the `n`-torsion subgroup of `A` is a `ZMod n` module. -/ -@[implicit_reducible] +@[instance_reducible] def torsionBy.zmodModule : Module (ZMod n) A[n] := AddCommGroup.zmodModule torsionBy.nsmul diff --git a/Mathlib/Algebra/Module/TransferInstance.lean b/Mathlib/Algebra/Module/TransferInstance.lean index 9913582e578408..cb46991e01940d 100644 --- a/Mathlib/Algebra/Module/TransferInstance.lean +++ b/Mathlib/Algebra/Module/TransferInstance.lean @@ -63,6 +63,7 @@ def linearEquiv (e : α ≃ β) [AddCommMonoid β] [Module R β] : simp only [toFun_as_coe, RingHom.id_apply, EmbeddingLike.apply_eq_iff_eq] exact Iff.mpr (apply_eq_iff_eq_symm_apply _) rfl } +set_option backward.isDefEq.respectTransparency false in variable (R) in /-- Transfer `Module.IsTorsionFree` across an `Equiv` -/ protected lemma moduleIsTorsionFree (e : α ≃ β) [AddCommMonoid β] [Module R β] diff --git a/Mathlib/Algebra/Module/ZLattice/Covolume.lean b/Mathlib/Algebra/Module/ZLattice/Covolume.lean index 05d7349d94a083..8f3ce50df2e7a9 100644 --- a/Mathlib/Algebra/Module/ZLattice/Covolume.lean +++ b/Mathlib/Algebra/Module/ZLattice/Covolume.lean @@ -140,6 +140,7 @@ theorem covolume_eq_det_inv {ι : Type*} [Fintype ι] (L : Submodule ℤ (ι → IsUnit.unit_spec, ← Basis.det_basis, LinearEquiv.coe_det] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Let `L₁` be a sub-`ℤ`-lattice of `L₂`. Then the index of `L₁` inside `L₂` is equal to `covolume L₁ / covolume L₂`. @@ -188,6 +189,7 @@ theorem volume_image_eq_volume_div_covolume {ι : Type*} [Fintype ι] (L : Submo LinearEquiv.symm_symm, covolume_eq_det_inv L b, ENNReal.div_eq_inv_mul, ENNReal.ofReal_inv_of_pos (abs_pos.2 (LinearEquiv.det _).ne_zero), inv_inv, LinearEquiv.coe_det] +set_option backward.isDefEq.respectTransparency.types false in /-- A more general version of `ZLattice.volume_image_eq_volume_div_covolume`; see the `Naming conventions` section in the introduction. -/ theorem volume_image_eq_volume_div_covolume' {E : Type*} [NormedAddCommGroup E] @@ -221,6 +223,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] variable {L : Submodule ℤ E} [DiscreteTopology L] [IsZLattice ℝ L] variable {ι : Type*} [Fintype ι] (b : Basis ι ℤ L) +set_option backward.isDefEq.respectTransparency.types false in /-- A version of `ZLattice.covolume.tendsto_card_div_pow` for the general case; see the `Naming convention` section in the introduction. -/ theorem tendsto_card_div_pow'' [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] diff --git a/Mathlib/Algebra/Module/ZLattice/Summable.lean b/Mathlib/Algebra/Module/ZLattice/Summable.lean index 3e39537c3564fd..02ae1af1c490b4 100644 --- a/Mathlib/Algebra/Module/ZLattice/Summable.lean +++ b/Mathlib/Algebra/Module/ZLattice/Summable.lean @@ -157,6 +157,7 @@ lemma sum_piFinset_Icc_rpow_le {ι : Type*} [Fintype ι] [DecidableEq ι] variable (L) +set_option backward.isDefEq.respectTransparency.types false in lemma exists_finsetSum_norm_rpow_le_tsum : ∃ A > (0 : ℝ), ∀ r < (-Module.finrank ℤ L : ℝ), ∀ s : Finset L, ∑ z ∈ s, ‖z‖ ^ r ≤ A ^ r * ∑' k : ℕ, (k : ℝ) ^ (Module.finrank ℤ L - 1 + r) := by diff --git a/Mathlib/Algebra/MonoidAlgebra/Basic.lean b/Mathlib/Algebra/MonoidAlgebra/Basic.lean index 5a7c4928ebada5..b1e6db15d46585 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Basic.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Basic.lean @@ -228,6 +228,7 @@ theorem algHom_ext' ⦃φ₁ φ₂ : R[M] →ₐ[R] A⦄ (h : (φ₁ : R[M] →* A).comp (of R M) = (φ₂ : R[M] →* A).comp (of R M)) : φ₁ = φ₂ := algHom_ext <| DFunLike.congr_fun h +set_option backward.isDefEq.respectTransparency false in variable (R A M) in /-- Any monoid homomorphism `M →* A` can be lifted to an algebra homomorphism `R[M] →ₐ[R] A`. -/ def lift : (M →* A) ≃ (R[M] →ₐ[R] A) where @@ -277,6 +278,7 @@ theorem lift_mapRingHom_algebraMap [CommSemiring S] [Algebra S A] @[deprecated (since := "2026-03-20")] alias lift_mapRangeRingHom_algebraMap := lift_mapRingHom_algebraMap +set_option backward.isDefEq.respectTransparency false in variable (R A) in /-- If `f : M → N` is a monoid homomorphism, then `MonoidAlgebra.mapDomain f` is an algebra homomorphism between their monoid algebras. -/ @@ -287,10 +289,12 @@ def mapDomainAlgHom (f : M →* N) : A[M] →ₐ[R] A[N] where toRingHom := mapDomainRingHom A f commutes' := by simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainAlgHom_id : mapDomainAlgHom R A (.id M) = .id R A[M] := by ext; simp [MonoidHom.id, ← Function.id_def] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainAlgHom_comp (f : M →* N) (g : N →* O) : mapDomainAlgHom R A (g.comp f) = (mapDomainAlgHom R A g).comp (mapDomainAlgHom R A f) := by @@ -313,6 +317,7 @@ lemma domCongr_apply (e : M ≃* N) (x : A[M]) (n : N) : domCongr R A e x n = x @[to_additive] theorem domCongr_toAlgHom (e : M ≃* N) : (domCongr R A e).toAlgHom = mapDomainAlgHom R A e := rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma domCongr_support (e : M ≃* N) (f : A[M]) : (domCongr R A e f).support = f.support.map e := by ext; simp @@ -589,6 +594,7 @@ theorem algHom_ext' ⦃φ₁ φ₂ : R[M] →ₐ[R] A⦄ φ₁ = φ₂ := algHom_ext <| DFunLike.congr_fun h +set_option backward.isDefEq.respectTransparency false in variable (R M A) in /-- Any monoid homomorphism `M →* A` can be lifted to an algebra homomorphism `R[M] →ₐ[R] A`. -/ @@ -678,6 +684,7 @@ end AddMonoidAlgebra variable [CommSemiring R] [Semiring A] [Algebra R A] +set_option backward.isDefEq.respectTransparency false in variable (A M) in /-- The algebra equivalence between `AddMonoidAlgebra` and `MonoidAlgebra` in terms of `Multiplicative`. -/ @@ -686,6 +693,7 @@ def AddMonoidAlgebra.toMultiplicativeAlgEquiv [AddMonoid M] : toRingEquiv := AddMonoidAlgebra.toMultiplicative A M commutes' r := by simp [AddMonoidAlgebra.toMultiplicative] +set_option backward.isDefEq.respectTransparency false in variable (A M) in /-- The algebra equivalence between `MonoidAlgebra` and `AddMonoidAlgebra` in terms of `Additive`. -/ diff --git a/Mathlib/Algebra/MonoidAlgebra/Defs.lean b/Mathlib/Algebra/MonoidAlgebra/Defs.lean index f88a130a9fc3c9..af3532a7efa9b5 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Defs.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Defs.lean @@ -287,6 +287,7 @@ lemma ofCoeff_smul (a : A) (x : M →₀ R) : ofCoeff (a • x) = a • ofCoeff @[to_additive (attr := simp) (dont_translate := A) smul_apply] lemma smul_apply (a : A) (x : R[M]) (m : M) : (a • x) m = a • x m := rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp) (dont_translate := A) smul_single] lemma smul_single (a : A) (m : M) (r : R) : a • single m r = single m (a • r) := by ext @@ -374,6 +375,7 @@ theorem single_apply {a a' : M} {b : R} [Decidable (a = a')] : @[to_additive (attr := simp)] lemma single_eq_zero : single m r = 0 ↔ r = 0 := Finsupp.single_eq_zero +set_option backward.isDefEq.respectTransparency false in @[to_additive] lemma single_ne_zero : single m r ≠ 0 ↔ r ≠ 0 := by simp [single] @[to_additive (attr := elab_as_elim)] @@ -442,6 +444,7 @@ lemma mul_apply [DecidableEq M] (x y : R[M]) (m : M) : rw [Finsupp.sum_apply]; congr; ext apply single_apply +set_option backward.isDefEq.respectTransparency false in open Finset in @[to_additive (dont_translate := R) mul_apply_antidiagonal] lemma mul_apply_antidiagonal (x y : R[M]) (m : M) (s : Finset (M × M)) @@ -477,6 +480,7 @@ lemma single_commute (hm : ∀ m', Commute m m') (hr : ∀ r', Commute r r') (x ext m' r' : 2; exact single_commute_single (hm m') (hr r') exact congr($this x) +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) mul_single_apply_aux] lemma mul_single_apply_aux (H : ∀ m' ∈ x.support, m' * m = m₁ ↔ m' = m₂) : (x * single m r) m₁ = x m₂ * r := by @@ -488,6 +492,7 @@ lemma mul_single_apply_aux (H : ∀ m' ∈ x.support, m' * m = m₁ ↔ m' = m dsimp [Finsupp.sum]; congr! 2; simp [*] _ = x m₂ * r := by simp +contextual [Finsupp.sum_eq_single m₂] +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) single_mul_apply_aux] lemma single_mul_apply_aux (H : ∀ m' ∈ x.support, m * m' = m₁ ↔ m' = m₂) : (single m r * x) m₁ = r * x m₂ := by @@ -499,10 +504,12 @@ lemma single_mul_apply_aux (H : ∀ m' ∈ x.support, m * m' = m₁ ↔ m' = m dsimp [Finsupp.sum]; congr! 2; simp [*] _ = r * x m₂ := by simp +contextual [Finsupp.sum_eq_single m₂] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp) (dont_translate := R) mul_single_apply_of_not_exists_add] lemma mul_single_apply_of_not_exists_mul (r : R) (x : R[M]) (h : ¬ ∃ d, m' = d * m) : (x * single m r) m' = 0 := by classical simp_all [mul_apply, eq_comm] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp) (dont_translate := R) single_mul_apply_of_not_exists_add] lemma single_mul_apply_of_not_exists_mul (r : R) (x : R[M]) (h : ¬ ∃ d, m' = m * d) : (single m r * x) m' = 0 := by classical simp_all [mul_apply, eq_comm] @@ -688,6 +695,7 @@ lemma mul_single_apply (x : R[G]) (r : R) (g h : G) : (x * single g r) h = x (h lemma single_mul_apply (x : R[G]) (r : R) (g h : G) : (single g r * x) h = r * x (g⁻¹ * h) := single_mul_apply_aux <| by simp [eq_inv_mul_iff_mul_eq] +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) mul_apply_left] lemma mul_apply_left (x y : R[G]) (g : G) : (x * y) g = x.sum fun h r ↦ r * y (h⁻¹ * g) := by classical @@ -696,6 +704,7 @@ lemma mul_apply_left (x y : R[G]) (g : G) : (x * y) g = x.sum fun h r ↦ r * y congr! 1 simp +contextual [← eq_inv_mul_iff_mul_eq] +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) mul_apply_right] lemma mul_apply_right (x y : R[G]) (g : G) : (x * y) g = y.sum fun h r ↦ x (g * h⁻¹) * r := by classical @@ -846,6 +855,7 @@ def singleHom [AddZeroClass M] : R × Multiplicative M →* R[M] where map_one' := rfl map_mul' _a _b := (single_mul_single ..).symm +set_option backward.isDefEq.respectTransparency false in theorem induction_on [AddMonoid M] {p : R[M] → Prop} (x : R[M]) (hM : ∀ m, p (of R M <| .ofAdd m)) (hadd : ∀ x y : R[M], p x → p y → p (x + y)) (hsmul : ∀ (r : R) (x), p x → p (r • x)) : p x := diff --git a/Mathlib/Algebra/MonoidAlgebra/Degree.lean b/Mathlib/Algebra/MonoidAlgebra/Degree.lean index 40d0c19acdf791..637d83b48947b9 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Degree.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Degree.lean @@ -419,6 +419,7 @@ lemma supDegree_mem_support (hD : D.Injective) (hp : p ≠ 0) : obtain ⟨a, ha, he⟩ := exists_supDegree_mem_support D hp rwa [he, Function.leftInverse_invFun hD] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma leadingCoeff_eq_zero (hD : D.Injective) : p.leadingCoeff D = 0 ↔ p = 0 := by refine ⟨(fun h => ?_).mtr, fun h => h ▸ leadingCoeff_zero⟩ @@ -489,6 +490,7 @@ lemma apply_supDegree_add_supDegree (hD : D.Injective) (hadd : ∀ a1 a2, D (a1 simp_rw [leadingCoeff, hp, hq, ← hadd, Function.leftInverse_invFun hD _] exact apply_add_of_supDegree_le hadd hD hp.le hq.le +set_option backward.isDefEq.respectTransparency false in lemma supDegree_mul (hD : D.Injective) (hadd : ∀ a1 a2, D (a1 + a2) = D a1 + D a2) (hpq : leadingCoeff D p * leadingCoeff D q ≠ 0) diff --git a/Mathlib/Algebra/MonoidAlgebra/Grading.lean b/Mathlib/Algebra/MonoidAlgebra/Grading.lean index 618855dacd15c4..84383fb7db7e35 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Grading.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Grading.lean @@ -67,6 +67,7 @@ theorem mem_grade_iff (m : M) (a : R[M]) : a ∈ grade R m ↔ a.support ⊆ {m} rw [← Finset.coe_subset, Finset.coe_singleton] rfl +set_option backward.isDefEq.respectTransparency.types false in theorem mem_grade_iff' (m : M) (a : R[M]) : a ∈ grade R m ↔ a ∈ (LinearMap.range (Finsupp.lsingle m : R →ₗ[R] M →₀ R) : Submodule R R[M]) := by @@ -169,6 +170,7 @@ theorem decomposeAux_coe {i : ι} (x : gradeBy R f i) : apply DirectSum.of_eq_of_gradedMonoid_eq congr 2 +set_option backward.isDefEq.respectTransparency.types false in instance gradeBy.gradedAlgebra : GradedAlgebra (gradeBy R f) := GradedAlgebra.ofAlgHom _ (decomposeAux f) (by diff --git a/Mathlib/Algebra/MonoidAlgebra/Lift.lean b/Mathlib/Algebra/MonoidAlgebra/Lift.lean index 56726221b2e651..29706bf761942a 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Lift.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Lift.lean @@ -60,6 +60,7 @@ section Mul variable [Semiring k] [Mul G] [Semiring R] +set_option backward.isDefEq.respectTransparency false in theorem liftNC_mul {g_hom : Type*} [FunLike g_hom G R] [MulHomClass g_hom G R] (f : k →+* R) (g : g_hom) (a b : k[G]) (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) : diff --git a/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean b/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean index 78ac51ec702b1a..6d693953b2a90f 100644 --- a/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean +++ b/Mathlib/Algebra/MonoidAlgebra/MapDomain.lean @@ -60,6 +60,7 @@ lemma mapDomain_single : mapDomain f (single a r) = single (f a) r := by ext; si lemma mapDomain_injective (hf : Injective f) : Injective (mapDomain (R := R) f) := Finsupp.mapDomain_injective hf +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) (attr := simp) mapDomain_one] theorem mapDomain_one [One M] [One N] {F : Type*} [FunLike F M N] [OneHomClass F M N] (f : F) : mapDomain f (1 : R[M]) = (1 : R[N]) := by @@ -96,9 +97,11 @@ protected lemma map_sum (f : R →+ S) (s : Finset ι) (x : ι → R[M]) : lemma map_single (f : R →+ S) (r : R) (m : M) : map f (single m r) = single m (f r) := mapRange_single (hf := f.map_zero) +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma map_id (x : R[M]) : map (.id R) x = x := by simp [map, coeff, ofCoeff] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma map_map (f : S →+ T) (g : R →+ S) (x : R[M]) : map f (map g x) = map (f.comp g) x := by simp [map, coeff, ofCoeff] @@ -158,6 +161,7 @@ def comapDomainAddMonoidHom (f : M → N) (hf : Injective f) : R[N] →+ R[M] wh map_zero' := by simp map_add' := by simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma comapDomain_single_map (f : M → N) (hf) (m : M) (r : R) : comapDomain f hf (single (f m) r) = single m r := by simp [comapDomain, single, coeff, ofCoeff] @@ -186,15 +190,18 @@ def mapDomainNonUnitalRingHom (f : M →ₙ* N) : R[M] →ₙ+* R[N] where map_add' := mapDomain_add _ map_mul' := mapDomain_mul f +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) (attr := simp)] lemma mapDomainNonUnitalRingHom_id : mapDomainNonUnitalRingHom R (.id M) = .id R[M] := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) (attr := simp)] lemma mapDomainNonUnitalRingHom_comp (f : N →ₙ* O) (g : M →ₙ* N) : mapDomainNonUnitalRingHom R (f.comp g) = (mapDomainNonUnitalRingHom R f).comp (mapDomainNonUnitalRingHom R g) := by ext; simp [Finsupp.mapDomain_comp] +set_option backward.isDefEq.respectTransparency false in variable (R) in /-- Equivalent monoids have additively isomorphic monoid algebras. @@ -210,10 +217,12 @@ def mapDomainAddEquiv (e : M ≃ N) : R[M] ≃+ R[N] where right_inv x := by ext; simp map_add' x y := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainAddEquiv_apply (e : M ≃ N) (x : R[M]) (n : N) : mapDomainAddEquiv R e x n = x (e.symm n) := by simp [mapDomainAddEquiv] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainAddEquiv_single (e : M ≃ N) (r : R) (m : M) : mapDomainAddEquiv R e (single m r) = single (e m) r := by simp [mapDomainAddEquiv] @@ -244,12 +253,14 @@ def mapAddEquiv (e : R ≃+ S) : R[M] ≃+ S[M] where @[deprecated (since := "2026-03-20")] alias mapRangeAddEquiv := mapAddEquiv +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapAddEquiv_apply (e : R ≃+ S) (x : R[M]) (m : M) : mapAddEquiv M e x m = e (x m) := by simp [mapAddEquiv, map, coeff, ofCoeff] @[deprecated (since := "2026-03-20")] alias mapRangeAddEquiv_apply := mapAddEquiv_apply +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapAddEquiv_single (e : R ≃+ S) (r : R) (m : M) : mapAddEquiv M e (single m r) = single m (e r) := by simp [mapAddEquiv] @@ -301,6 +312,7 @@ attribute [local ext high] ringHom_ext @[to_additive (dont_translate := R) (attr := simp)] lemma mapDomainRingHom_id : mapDomainRingHom R (.id M) = .id R[M] := by ext <;> simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R) (attr := simp)] lemma mapDomainRingHom_comp (f : N →* O) (g : M →* N) : mapDomainRingHom R (f.comp g) = (mapDomainRingHom R f).comp (mapDomainRingHom R g) := by @@ -328,6 +340,7 @@ lemma coe_mapRingHom (f : R →+* S) : ⇑(mapRingHom M f) = map f := rfl @[deprecated (since := "2026-03-20")] alias coe_mapRangeRingHom := coe_mapRingHom +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapRingHom_apply (f : R →+* S) (x : R[M]) (m : M) : mapRingHom M f x m = f (x m) := by simp [mapRingHom, map, coeff, ofCoeff] @@ -361,6 +374,7 @@ lemma mapRingHom_comp_mapDomainRingHom (f : R →+* S) (g : M →* N) : @[deprecated (since := "2026-03-20")] alias mapRangeRingHom_comp_mapDomainRingHom := mapRingHom_comp_mapDomainRingHom +set_option backward.isDefEq.respectTransparency false in variable (R) in /-- Isomorphic monoids have isomorphic monoid algebras. -/ @[to_additive (dont_translate := R) @@ -373,6 +387,7 @@ def mapDomainRingEquiv (e : M ≃* N) : R[M] ≃+* R[N] := lemma mapDomainRingEquiv_apply (e : M ≃* N) (x : R[M]) (n : N) : mapDomainRingEquiv R e x n = x (e.symm n) := mapDomainAddEquiv_apply .. +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainRingEquiv_single (e : M ≃* N) (r : R) (m : M) : mapDomainRingEquiv R e (single m r) = single (e m) r := by simp [mapDomainRingEquiv] @@ -482,6 +497,7 @@ since the changes that have made `nsmul` definitional, this would be possible, but for now we just construct the ring isomorphisms using `RingEquiv.refl _`. -/ +set_option backward.isDefEq.respectTransparency false in variable (k G) in /-- The equivalence between `AddMonoidAlgebra` and `MonoidAlgebra` in terms of `Multiplicative` -/ @@ -496,6 +512,7 @@ protected def AddMonoidAlgebra.toMultiplicative [Semiring k] [Add G] : dsimp [Multiplicative.ofAdd] exact MonoidAlgebra.mapDomain_mul (M := Multiplicative G) (MulHom.id (Multiplicative G)) x y +set_option backward.isDefEq.respectTransparency false in variable (k G) in /-- The equivalence between `MonoidAlgebra` and `AddMonoidAlgebra` in terms of `Additive` -/ protected def MonoidAlgebra.toAdditive [Semiring k] [Mul G] : diff --git a/Mathlib/Algebra/MonoidAlgebra/Module.lean b/Mathlib/Algebra/MonoidAlgebra/Module.lean index 241638e85a37f6..5ebc09e6cc2cd9 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Module.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Module.lean @@ -84,6 +84,7 @@ lemma supported_eq_map : supported R S s = (Finsupp.supported S R s).map (coeffLinearEquiv R).symm.toLinearMap := Submodule.comap_equiv_eq_map_symm .. +set_option backward.isDefEq.respectTransparency false in variable (R S s) in @[to_additive (dont_translate := R)] lemma supported_eq_span_single : supported R R s = .span R ((fun m ↦ single m 1) '' s) := by @@ -134,7 +135,7 @@ lemma basis_apply (k) [Semiring k] (r : R) : TODO: Change the type to `DistribMulAction Gᵈᵐᵃ k[G]` and then it can be an instance. TODO: Generalise to a group acting on another, instead of just the left multiplication action. -/ -@[implicit_reducible] +@[instance_reducible] def comapDistribMulActionSelf [Group G] [Semiring k] : DistribMulAction G k[G] := fast_instance% Finsupp.comapDistribMulAction diff --git a/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean b/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean index 992b5313c14df6..95f21efeebbeb7 100644 --- a/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean +++ b/Mathlib/Algebra/MonoidAlgebra/NoZeroDivisors.lean @@ -83,6 +83,7 @@ theorem mul_apply_mul_eq_mul_of_uniqueMul [Mul A] {f g : R[A]} {a0 b0 : A} · rw [notMem_support_iff.mp af, zero_mul] · rw [notMem_support_iff.mp bg, mul_zero] +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := R)] instance [NoZeroDivisors R] [Mul A] [UniqueProds A] : NoZeroDivisors R[A] where eq_zero_or_eq_zero_of_mul_eq_zero {a b} ab := by diff --git a/Mathlib/Algebra/MonoidAlgebra/PointwiseSMul.lean b/Mathlib/Algebra/MonoidAlgebra/PointwiseSMul.lean index c62c2e40b5261a..2a5e0897163031 100644 --- a/Mathlib/Algebra/MonoidAlgebra/PointwiseSMul.lean +++ b/Mathlib/Algebra/MonoidAlgebra/PointwiseSMul.lean @@ -24,6 +24,7 @@ variable {G P R V : Type*} namespace MonoidAlgebra +set_option backward.isDefEq.respectTransparency.types false in @[to_additive] theorem mem_smulAntidiagonal_of_group [Group G] [MulAction G P] [Semiring R] [Zero V] (f : R[G]) (x : P → V) (p : P) (gh : G × P) : diff --git a/Mathlib/Algebra/MonoidAlgebra/Support.lean b/Mathlib/Algebra/MonoidAlgebra/Support.lean index 5d4bd9aa4163d4..750a0c0b5f8051 100644 --- a/Mathlib/Algebra/MonoidAlgebra/Support.lean +++ b/Mathlib/Algebra/MonoidAlgebra/Support.lean @@ -48,6 +48,7 @@ theorem support_mul_single_subset [DecidableEq G] (f : k[G]) (r : k) (a : G) : (support_mul _ _).trans <| (Finset.image₂_subset_left support_single_subset).trans <| by rw [Finset.image₂_singleton_right] +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := k) support_single_mul_eq_image] theorem support_single_mul_eq_image [DecidableEq G] (f : k[G]) {r : k} (hr : ∀ y, r * y = 0 ↔ y = 0) {x : G} (lx : IsLeftRegular x) : @@ -56,6 +57,7 @@ theorem support_single_mul_eq_image [DecidableEq G] (f : k[G]) {r : k} obtain ⟨y, yf, rfl⟩ : ∃ a : G, a ∈ f.support ∧ x * a = y := by grind simp [mul_apply, mem_support_iff.mp yf, hr, lx.eq_iff] +set_option backward.isDefEq.respectTransparency false in @[to_additive (dont_translate := k) support_mul_single_eq_image] theorem support_mul_single_eq_image [DecidableEq G] (f : k[G]) {r : k} (hr : ∀ y, y * r = 0 ↔ y = 0) {x : G} (rx : IsRightRegular x) : diff --git a/Mathlib/Algebra/MvPolynomial/Basic.lean b/Mathlib/Algebra/MvPolynomial/Basic.lean index d63fa0c7e6d40d..71386614842430 100644 --- a/Mathlib/Algebra/MvPolynomial/Basic.lean +++ b/Mathlib/Algebra/MvPolynomial/Basic.lean @@ -514,6 +514,7 @@ section Coeff def coeff (m : σ →₀ ℕ) (p : MvPolynomial σ R) : R := @DFunLike.coe ((σ →₀ ℕ) →₀ R) _ _ _ p m +set_option backward.isDefEq.respectTransparency false in @[simp, grind =] theorem mem_support_iff {p : MvPolynomial σ R} {m : σ →₀ ℕ} : m ∈ p.support ↔ p.coeff m ≠ 0 := by simp [support, coeff] @@ -624,6 +625,7 @@ theorem coeff_X' [DecidableEq σ] (i : σ) (m) : theorem coeff_X (i : σ) : coeff (Finsupp.single i 1) (X i : MvPolynomial σ R) = 1 := by classical rw [coeff_X', if_pos rfl] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem coeff_C_mul (m) (a : R) (p : MvPolynomial σ R) : coeff m (C a * p) = a * coeff m p := by classical diff --git a/Mathlib/Algebra/MvPolynomial/CommRing.lean b/Mathlib/Algebra/MvPolynomial/CommRing.lean index 03f3ab728abf50..4b106220c286ff 100644 --- a/Mathlib/Algebra/MvPolynomial/CommRing.lean +++ b/Mathlib/Algebra/MvPolynomial/CommRing.lean @@ -88,6 +88,7 @@ section Degrees theorem degrees_neg (p : MvPolynomial σ R) : (-p).degrees = p.degrees := by rw [degrees, support_neg]; rfl +set_option backward.isDefEq.respectTransparency false in theorem degrees_sub_le [DecidableEq σ] {p q : MvPolynomial σ R} : (p - q).degrees ≤ p.degrees ∪ q.degrees := by simpa [degrees_def] using! AddMonoidAlgebra.supDegree_sub_le diff --git a/Mathlib/Algebra/MvPolynomial/Degrees.lean b/Mathlib/Algebra/MvPolynomial/Degrees.lean index 7b595c7d04643f..80f7361d8de86b 100644 --- a/Mathlib/Algebra/MvPolynomial/Degrees.lean +++ b/Mathlib/Algebra/MvPolynomial/Degrees.lean @@ -150,6 +150,7 @@ theorem degrees_eq_zero_iff_support_subset_zero : p.degrees = 0 ↔ p.support have := Finsupp.support_eq_empty.mpr (h s <| mem_support_iff.mpr hs1) ▸ hs2 grind +set_option backward.isDefEq.respectTransparency false in theorem le_degrees_add_left (h : Disjoint p.degrees q.degrees) : p.degrees ≤ (p + q).degrees := by classical apply Finset.sup_le diff --git a/Mathlib/Algebra/MvPolynomial/Equiv.lean b/Mathlib/Algebra/MvPolynomial/Equiv.lean index 9ec384c43f8b69..b35c0d9e66bf6e 100644 --- a/Mathlib/Algebra/MvPolynomial/Equiv.lean +++ b/Mathlib/Algebra/MvPolynomial/Equiv.lean @@ -372,6 +372,7 @@ def sumRingEquiv : MvPolynomial (S₁ ⊕ S₂) R ≃+* MvPolynomial S₁ (MvPol @[simp] lemma sumToIter_iterToSum (p) : sumToIter R S₁ S₂ (iterToSum R S₁ S₂ p) = p := (sumRingEquiv _ _ _).apply_symm_apply _ +set_option backward.isDefEq.respectTransparency false in /-- The algebra isomorphism between multivariable polynomials in a sum of two types, and multivariable polynomials in one of the types, with coefficients in multivariable polynomials in the other type. @@ -549,6 +550,7 @@ lemma natDegree_optionEquivLeft (p : MvPolynomial (Option σ) R) : · rw [c, map_zero, Polynomial.natDegree_zero, degreeOf_zero] · rw [Polynomial.natDegree, degree_optionEquivLeft R c, Nat.cast_withBot, WithBot.unbotD_coe] +set_option backward.isDefEq.respectTransparency false in lemma totalDegree_coeff_optionEquivLeft_add_le (p : MvPolynomial (Option S₁) R) (i : ℕ) (hi : i ≤ p.totalDegree) : ((optionEquivLeft R S₁ p).coeff i).totalDegree + i ≤ p.totalDegree := by @@ -561,6 +563,7 @@ lemma totalDegree_coeff_optionEquivLeft_add_le · simp [Finsupp.sum_add_index, Finsupp.sum_embDomain, add_comm i] · simpa [mem_support_iff, ← optionEquivLeft_coeff_some_coeff_none R S₁] using hσ +set_option backward.isDefEq.respectTransparency false in lemma totalDegree_coeff_optionEquivLeft_le (p : MvPolynomial (Option S₁) R) (i : ℕ) : ((optionEquivLeft R S₁ p).coeff i).totalDegree ≤ p.totalDegree := by diff --git a/Mathlib/Algebra/MvPolynomial/Eval.lean b/Mathlib/Algebra/MvPolynomial/Eval.lean index 0e13948de38b25..417cf00a332aad 100644 --- a/Mathlib/Algebra/MvPolynomial/Eval.lean +++ b/Mathlib/Algebra/MvPolynomial/Eval.lean @@ -218,6 +218,7 @@ theorem eval₂_eta (p : MvPolynomial σ R) : eval₂ C X p = p := by apply MvPolynomial.induction_on p <;> simp +contextual [eval₂_add, eval₂_mul] +set_option backward.isDefEq.respectTransparency false in theorem eval₂_congr (g₁ g₂ : σ → S₁) (h : ∀ {i : σ} {c : σ →₀ ℕ}, i ∈ c.support → coeff c p ≠ 0 → g₁ i = g₂ i) : p.eval₂ f g₁ = p.eval₂ f g₂ := by @@ -473,6 +474,7 @@ theorem C_dvd_iff_map_hom_eq_zero (q : R →+* S₁) (r : R) (hr : ∀ r' : R, q rw [C_dvd_iff_dvd_coeff, MvPolynomial.ext_iff] simp only [coeff_map, coeff_zero, hr] +set_option backward.isDefEq.respectTransparency false in theorem map_mapRange_eq_iff (f : R →+* S₁) (g : S₁ → R) (hg : g 0 = 0) (φ : MvPolynomial σ S₁) : map f (Finsupp.mapRange g hg φ) = φ ↔ ∀ d, f (g (coeff d φ)) = coeff d φ := by simp_rw [MvPolynomial.ext_iff, coeff_map]; rfl diff --git a/Mathlib/Algebra/MvPolynomial/Rename.lean b/Mathlib/Algebra/MvPolynomial/Rename.lean index 9dfb980d984cfc..664f3847c6821d 100644 --- a/Mathlib/Algebra/MvPolynomial/Rename.lean +++ b/Mathlib/Algebra/MvPolynomial/Rename.lean @@ -362,6 +362,7 @@ theorem coeff_rename_embDomain (f : σ ↪ τ) (φ : MvPolynomial σ R) (d : σ (rename f φ).coeff (d.embDomain f) = φ.coeff d := by rw [Finsupp.embDomain_eq_mapDomain f, coeff_rename_mapDomain f f.injective] +set_option backward.isDefEq.respectTransparency false in theorem coeff_rename_eq_zero (f : σ → τ) (φ : MvPolynomial σ R) (d : τ →₀ ℕ) (h : ∀ u : σ →₀ ℕ, u.mapDomain f = d → φ.coeff u = 0) : (rename f φ).coeff d = 0 := by classical diff --git a/Mathlib/Algebra/MvPolynomial/Variables.lean b/Mathlib/Algebra/MvPolynomial/Variables.lean index a832754446ea5a..0bc02c4263c284 100644 --- a/Mathlib/Algebra/MvPolynomial/Variables.lean +++ b/Mathlib/Algebra/MvPolynomial/Variables.lean @@ -236,6 +236,7 @@ section EvalVars variable [CommSemiring S] +set_option backward.isDefEq.respectTransparency false in theorem eval₂Hom_eq_constantCoeff_of_vars (f : R →+* S) {g : σ → S} {p : MvPolynomial σ R} (hp : ∀ i ∈ p.vars, g i = 0) : eval₂Hom f g p = f (constantCoeff p) := by conv_lhs => rw [p.as_sum] diff --git a/Mathlib/Algebra/Opposites.lean b/Mathlib/Algebra/Opposites.lean index b9d19e7f62af83..d92899c5359482 100644 --- a/Mathlib/Algebra/Opposites.lean +++ b/Mathlib/Algebra/Opposites.lean @@ -73,12 +73,14 @@ postfix:max "ᵃᵒᵖ" => AddOpposite namespace MulOpposite /-- The element of `MulOpposite α` that represents `x : α`. -/ -@[to_additive /-- The element of `αᵃᵒᵖ` that represents `x : α`. -/] +-- implicit-reducible so that `op_star` can be `rfl` +@[to_additive /-- The element of `αᵃᵒᵖ` that represents `x : α`. -/, implicit_reducible] def op : α → αᵐᵒᵖ := PreOpposite.op' /-- The element of `α` represented by `x : αᵐᵒᵖ`. -/ -@[to_additive (attr := pp_nodot) /-- The element of `α` represented by `x : αᵃᵒᵖ`. -/] +@[to_additive (attr := pp_nodot) /-- The element of `α` represented by `x : αᵃᵒᵖ`. -/, + implicit_reducible] -- implicit-reducible so that `op_star` can be `rfl` def unop : αᵐᵒᵖ → α := PreOpposite.unop' diff --git a/Mathlib/Algebra/Order/Antidiag/Finsupp.lean b/Mathlib/Algebra/Order/Antidiag/Finsupp.lean index 7d7efc43d009cf..418a7c2c10e81f 100644 --- a/Mathlib/Algebra/Order/Antidiag/Finsupp.lean +++ b/Mathlib/Algebra/Order/Antidiag/Finsupp.lean @@ -46,6 +46,7 @@ def finsuppAntidiag (s : Finset ι) (n : μ) : Finset (ι →₀ μ) := (piAntidiag s n).attach.map ⟨fun f ↦ ⟨s.filter (f.1 · ≠ 0), f.1, by simpa using (mem_piAntidiag.1 f.2).2⟩, fun _ _ hfg ↦ Subtype.ext (congr_arg (⇑) hfg)⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mem_finsuppAntidiag : f ∈ finsuppAntidiag s n ↔ s.sum f = n ∧ f.support ⊆ s := by simp [finsuppAntidiag, ← DFunLike.coe_fn_eq, subset_iff] @@ -88,6 +89,7 @@ theorem mem_finsuppAntidiag_insert {a : ι} {s : Finset ι} intro x hx rw [update_of_ne (ne_of_mem_of_not_mem hx h) n1 ⇑g] +set_option backward.isDefEq.respectTransparency false in theorem finsuppAntidiag_insert {a : ι} {s : Finset ι} (h : a ∉ s) (n : μ) : finsuppAntidiag (insert a s) n = (antidiagonal n).biUnion @@ -118,6 +120,7 @@ theorem finsuppAntidiag_mono {s t : Finset ι} (h : s ⊆ t) (n : μ) : variable [AddCommMonoid μ'] [HasAntidiagonal μ'] [DecidableEq μ'] +set_option backward.isDefEq.respectTransparency false in -- This should work under the assumption that e is an embedding and an AddHom lemma mapRange_finsuppAntidiag_subset {e : μ ≃+ μ'} {s : Finset ι} {n : μ} : (finsuppAntidiag s n).map (mapRange.addEquiv e).toEmbedding ⊆ finsuppAntidiag s (e n) := by diff --git a/Mathlib/Algebra/Order/Antidiag/FinsuppEquiv.lean b/Mathlib/Algebra/Order/Antidiag/FinsuppEquiv.lean index 46e04d0d7535ae..72ca953453ec21 100644 --- a/Mathlib/Algebra/Order/Antidiag/FinsuppEquiv.lean +++ b/Mathlib/Algebra/Order/Antidiag/FinsuppEquiv.lean @@ -37,6 +37,7 @@ namespace Finset variable [DecidableEq ι] [AddCommMonoid μ] [HasAntidiagonal μ] [DecidableEq μ] {s : Finset ι} {n : μ} +set_option backward.isDefEq.respectTransparency false in variable (s n) in /-- The equivalence between `Finset.finsuppAntidiag s n` and the subtype of `s →₀ μ` whose sum is `n`. -/ diff --git a/Mathlib/Algebra/Order/Antidiag/Nat.lean b/Mathlib/Algebra/Order/Antidiag/Nat.lean index 0aa55fa23256da..e0079f66298e3c 100644 --- a/Mathlib/Algebra/Order/Antidiag/Nat.lean +++ b/Mathlib/Algebra/Order/Antidiag/Nat.lean @@ -29,6 +29,7 @@ open Finset open scoped ArithmeticFunction namespace PNat +set_option backward.isDefEq.respectTransparency false in instance instHasAntidiagonal : Finset.HasAntidiagonal (Additive ℕ+) := /- The set of divisors of a positive natural number. This is `Nat.divisorsAntidiagonal` without a special case for `n = 0`. -/ @@ -60,6 +61,7 @@ def finMulAntidiag (d : ℕ) (n : ℕ) : Finset (Fin d → ℕ) := else ∅ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mem_finMulAntidiag {d n : ℕ} {f : Fin d → ℕ} : f ∈ finMulAntidiag d n ↔ ∏ i, f i = n ∧ n ≠ 0 := by diff --git a/Mathlib/Algebra/Order/Antidiag/Pi.lean b/Mathlib/Algebra/Order/Antidiag/Pi.lean index b9f0282abd1dda..12963241fa4f5b 100644 --- a/Mathlib/Algebra/Order/Antidiag/Pi.lean +++ b/Mathlib/Algebra/Order/Antidiag/Pi.lean @@ -58,6 +58,7 @@ In this section, we define the antidiagonals in `Fin d → μ` by recursion on ` computationally efficient, although probably not as efficient as `Finset.Nat.antidiagonalTuple`. -/ +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary construction for `finAntidiagonal` that bundles a proof of lawfulness (`mem_finAntidiagonal`), as this is needed to invoke `disjiUnion`. Using `Finset.disjiUnion` makes this computationally much more efficient than using `Finset.biUnion`. -/ @@ -91,6 +92,8 @@ def finAntidiagonal.aux (d : ℕ) (n : μ) : {s : Finset (Fin d → μ) // ∀ f · intro hf exact ⟨_, _, hf, _, rfl, Fin.cons_self_tail f⟩ } +set_option backward.isDefEq.respectTransparency false in +set_option backward.proofsInPublic true in /-- `finAntidiagonal d n` is the type of `d`-tuples with sum `n`. TODO: deduplicate with the less general `Finset.Nat.antidiagonalTuple`. -/ @@ -107,6 +110,7 @@ choosing an identification `s ≃ Fin s.card` and proving that the end result do choice. -/ +set_option backward.isDefEq.respectTransparency false in /-- The finset of functions `ι → μ` with support contained in `s` and sum `n`. -/ def piAntidiag (s : Finset ι) (n : μ) : Finset (ι → μ) := by refine (Fintype.truncEquivFinOfCardEq <| Fintype.card_coe s).lift @@ -123,6 +127,7 @@ def piAntidiag (s : Finset ι) (n : μ) : Finset (ι → μ) := by variable {s : Finset ι} {n : μ} {f : ι → μ} +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mem_piAntidiag : f ∈ piAntidiag s n ↔ s.sum f = n ∧ ∀ i, f i ≠ 0 → i ∈ s := by rw [piAntidiag] induction Fintype.truncEquivFinOfCardEq (Fintype.card_coe s) using Trunc.ind with | _ e diff --git a/Mathlib/Algebra/Order/Archimedean/Basic.lean b/Mathlib/Algebra/Order/Archimedean/Basic.lean index f2ba71cf32dfa8..931f5f21df0575 100644 --- a/Mathlib/Algebra/Order/Archimedean/Basic.lean +++ b/Mathlib/Algebra/Order/Archimedean/Basic.lean @@ -476,7 +476,7 @@ instance : MulArchimedean NNRat := Nonneg.instMulArchimedean /-- A linear ordered archimedean ring is a floor ring. This is not an `instance` because in some cases we have a computable `floor` function. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Archimedean.floorRing (R) [Ring R] [LinearOrder R] [IsStrictOrderedRing R] [Archimedean R] : FloorRing R := .ofBounded _ exists_nat_ge diff --git a/Mathlib/Algebra/Order/Archimedean/Class.lean b/Mathlib/Algebra/Order/Archimedean/Class.lean index ed9bc3fca9dfa1..19812abed95041 100644 --- a/Mathlib/Algebra/Order/Archimedean/Class.lean +++ b/Mathlib/Algebra/Order/Archimedean/Class.lean @@ -865,6 +865,7 @@ theorem subsemigroup_eq_subgroup : MulArchimedeanClass.subsemigroup (toUpperSetMulArchimedeanClass s) = (subgroup s : Set M) := rfl +set_option backward.isDefEq.respectTransparency false in variable (M) in @[to_additive (attr := simp)] theorem subgroup_eq_bot : subgroup (M := M) ⊤ = ⊥ := by diff --git a/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean b/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean index 01e9559229ffbb..0ccb893cdef688 100644 --- a/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean +++ b/Mathlib/Algebra/Order/BigOperators/Group/LocallyFinite.lean @@ -125,6 +125,7 @@ lemma prod_prod_Ioi_mul_eq_prod_prod_off_diag (f : α → α → M) : end LinearOrder +set_option backward.isDefEq.respectTransparency false in /-- Given a sequence of finite sets `s₀ ⊆ s₁ ⊆ s₂ ⋯`, the product of `gᵢ` over `i ∈ sₙ` is equal to `∏_{i ∈ s₀} gᵢ` * `∏_{j < n, i ∈ sⱼ₊₁ \ sⱼ} gᵢ`. -/ @[to_additive /-- Given a sequence of finite sets `s₀ ⊆ s₁ ⊆ s₂ ⋯`, the sum of `gᵢ` over `i ∈ sₙ` is diff --git a/Mathlib/Algebra/Order/CompleteField.lean b/Mathlib/Algebra/Order/CompleteField.lean index 368aabd6624c2a..3116ef077b6ca9 100644 --- a/Mathlib/Algebra/Order/CompleteField.lean +++ b/Mathlib/Algebra/Order/CompleteField.lean @@ -279,6 +279,7 @@ def inducedOrderRingHom : α →+*o β := two_ne_zero (inducedMap_one _ _) with monotone' := inducedMap_mono _ _ } +set_option backward.isDefEq.respectTransparency false in /-- The isomorphism of ordered rings between two conditionally complete linearly ordered fields. -/ def inducedOrderRingIso : β ≃+*o γ := { inducedOrderRingHom β γ with diff --git a/Mathlib/Algebra/Order/Floor/Defs.lean b/Mathlib/Algebra/Order/Floor/Defs.lean index 09feaa309753b9..718a161dd62d4d 100644 --- a/Mathlib/Algebra/Order/Floor/Defs.lean +++ b/Mathlib/Algebra/Order/Floor/Defs.lean @@ -169,7 +169,7 @@ instance : FloorRing ℤ where rw [Int.cast_id, id_def] /-- A `FloorRing` constructor from the `floor` function alone. -/ -@[implicit_reducible] +@[instance_reducible] def FloorRing.ofFloor (α) [Ring α] [LinearOrder α] [IsOrderedRing α] (floor : α → ℤ) (gc_coe_floor : GaloisConnection (↑) floor) : FloorRing α := { floor @@ -178,7 +178,7 @@ def FloorRing.ofFloor (α) [Ring α] [LinearOrder α] [IsOrderedRing α] (floor gc_ceil_coe := fun a z => by rw [neg_le, ← gc_coe_floor, Int.cast_neg, neg_le_neg_iff] } /-- A `FloorRing` constructor from the `ceil` function alone. -/ -@[implicit_reducible] +@[instance_reducible] def FloorRing.ofCeil (α) [Ring α] [LinearOrder α] [IsOrderedRing α] (ceil : α → ℤ) (gc_ceil_coe : GaloisConnection ceil (↑)) : FloorRing α := { floor := fun a => -ceil (-a) @@ -205,7 +205,7 @@ theorem exists_floor' {α} [Ring α] [PartialOrder α] [IsStrictOrderedRing α] /-- Construct a `FloorRing` instance noncomputably, from the hypothesis that every element is bounded above by a natural number. -/ -@[no_expose, implicit_reducible] +@[no_expose, instance_reducible] noncomputable def FloorRing.ofBounded (α) [Ring α] [LinearOrder α] [IsStrictOrderedRing α] (bounded : ∀ x : α, ∃ n : ℕ, x ≤ n) : FloorRing α := have below (x : α) : ∃ n : ℤ, n ≤ x := by diff --git a/Mathlib/Algebra/Order/Group/Lattice.lean b/Mathlib/Algebra/Order/Group/Lattice.lean index 58d100aebc7618..0bbd1acea016ee 100644 --- a/Mathlib/Algebra/Order/Group/Lattice.lean +++ b/Mathlib/Algebra/Order/Group/Lattice.lean @@ -119,7 +119,7 @@ lemma inf_mul_sup [MulLeftMono α] (a b : α) : (a ⊓ b) * (a ⊔ b) = a * b := /-- Every lattice ordered commutative group is a distributive lattice. -/ -- Non-comm case needs cancellation law https://ncatlab.org/nlab/show/distributive+lattice -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Every lattice ordered commutative additive group is a distributive lattice -/] def CommGroup.toDistribLattice (α : Type*) [Lattice α] [CommGroup α] [MulLeftMono α] : DistribLattice α where diff --git a/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean b/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean index fade0d85326990..b978a85f5b4ccd 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Canonical.lean @@ -37,6 +37,11 @@ The solutions is to use a typeclass, and that is exactly what we do in this file variable {α β : Type*} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Additive + OrderDual + /-- A linearly ordered commutative monoid with a zero element. -/ class LinearOrderedCommMonoidWithZero (α : Type*) extends CommMonoidWithZero α, LinearOrder α, PosMulStrictMono α, OrderBot α, IsBotZeroClass α where @@ -98,6 +103,7 @@ instance instLinearOrderedAddCommMonoidWithTopAdditiveOrderDual : top_add' a := by ext; simp [bot_eq_zero] isAddLeftRegular_of_ne_top := by simp +contextual [IsRegular.of_ne_zero, bot_eq_zero] +set_option backward.isDefEq.respectTransparency false in instance instLinearOrderedAddCommMonoidWithTopOrderDualAdditive : LinearOrderedAddCommMonoidWithTop (Additive α)ᵒᵈ where top_add' a := by ext; simp; simp [bot_eq_zero (α := α)] diff --git a/Mathlib/Algebra/Order/GroupWithZero/Lex.lean b/Mathlib/Algebra/Order/GroupWithZero/Lex.lean index b989a02d0bcc45..e68e48615d6875 100644 --- a/Mathlib/Algebra/Order/GroupWithZero/Lex.lean +++ b/Mathlib/Algebra/Order/GroupWithZero/Lex.lean @@ -34,6 +34,7 @@ namespace MonoidWithZeroHom variable {M₀ N₀ : Type*} +set_option backward.isDefEq.respectTransparency false in lemma inl_mono [LinearOrderedCommGroupWithZero M₀] [GroupWithZero N₀] [Preorder N₀] [DecidablePred fun x : M₀ ↦ x = 0] : Monotone (inl M₀ N₀) := by refine (WithZero.map'_mono MonoidHom.inl_mono).comp ?_ @@ -46,6 +47,7 @@ lemma inl_strictMono [LinearOrderedCommGroupWithZero M₀] [GroupWithZero N₀] [DecidablePred fun x : M₀ ↦ x = 0] : StrictMono (inl M₀ N₀) := inl_mono.strictMono_of_injective inl_injective +set_option backward.isDefEq.respectTransparency false in lemma inr_mono [GroupWithZero M₀] [Preorder M₀] [LinearOrderedCommGroupWithZero N₀] [DecidablePred fun x : N₀ ↦ x = 0] : Monotone (inr M₀ N₀) := by refine (WithZero.map'_mono MonoidHom.inr_mono).comp ?_ @@ -93,6 +95,7 @@ nonrec def inr : β →*₀o WithZero (αˣ ×ₗ βˣ) where __ := (WithZero.map' (toLexMulEquiv ..).toMonoidHom).comp (inr α β) monotone' := by simpa using (WithZero.map'_mono (Prod.Lex.toLex_mono)).comp inr_mono +set_option backward.isDefEq.respectTransparency.types false in /-- Given linearly ordered groups with zero M, N, the natural projection ordered homomorphism from `WithZero (Mˣ ×ₗ Nˣ)` to M, which is the linearly ordered group with zero that can be identified as their product. -/ @@ -109,6 +112,7 @@ nonrec def fst : WithZero (αˣ ×ₗ βˣ) →*₀o α where · simp · simpa using Prod.Lex.monotone_fst _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem fst_comp_inl : (fst _ _).comp (inl α β) = .id α := by ext x @@ -117,11 +121,13 @@ theorem fst_comp_inl : (fst _ _).comp (inl α β) = .id α := by variable {α β} +set_option backward.isDefEq.respectTransparency false in lemma inl_eq_coe_inlₗ {m : α} (hm : m ≠ 0) : inl α β m = OrderMonoidHom.inlₗ αˣ βˣ (Units.mk0 _ hm) := by lift m to αˣ using isUnit_iff_ne_zero.mpr hm simp +set_option backward.isDefEq.respectTransparency false in lemma inr_eq_coe_inrₗ {n : β} (hn : n ≠ 0) : inr α β n = OrderMonoidHom.inrₗ αˣ βˣ (Units.mk0 _ hn) := by lift n to βˣ using isUnit_iff_ne_zero.mpr hn diff --git a/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean b/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean index a3d8148312f5bd..88239e2d0d58c3 100644 --- a/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean +++ b/Mathlib/Algebra/Order/Hom/MonoidWithZero.lean @@ -264,6 +264,7 @@ end LinearOrderedCommMonoidWithZero end OrderMonoidWithZeroHom +set_option backward.isDefEq.respectTransparency false in /-- Any ordered group is isomorphic to the units of itself adjoined with `0`. -/ @[simps! -isSimp] def OrderMonoidIso.unitsWithZero {α : Type*} [Group α] [Preorder α] : (WithZero α)ˣ ≃*o α where diff --git a/Mathlib/Algebra/Order/Interval/Basic.lean b/Mathlib/Algebra/Order/Interval/Basic.lean index 714243ac6829cd..2aec959f1fb949 100644 --- a/Mathlib/Algebra/Order/Interval/Basic.lean +++ b/Mathlib/Algebra/Order/Interval/Basic.lean @@ -227,6 +227,7 @@ instance commMonoid [CommMonoid α] [Preorder α] [IsOrderedMonoid α] : end NonemptyInterval +set_option backward.isDefEq.respectTransparency false in @[to_additive] instance Interval.mulOneClass [CommMonoid α] [Preorder α] [IsOrderedMonoid α] : MulOneClass (Interval α) where diff --git a/Mathlib/Algebra/Order/IsBotOne.lean b/Mathlib/Algebra/Order/IsBotOne.lean index 504add64df0afe..75b4ed62c65ea7 100644 --- a/Mathlib/Algebra/Order/IsBotOne.lean +++ b/Mathlib/Algebra/Order/IsBotOne.lean @@ -43,7 +43,7 @@ alias zero_le' := zero_le variable (α) in /-- Create an `OrderBot` instance, setting `1` as the bottom element. -/ -@[expose, to_additive (attr := implicit_reducible) +@[expose, to_additive (attr := instance_reducible) /-- Create an `OrderBot` instance, setting `0` as the bottom element. -/] def IsBotOneClass.toOrderBot : OrderBot α where bot := 1 diff --git a/Mathlib/Algebra/Order/Module/HahnEmbedding.lean b/Mathlib/Algebra/Order/Module/HahnEmbedding.lean index 1be65bc81b92c1..d872fee0c14f31 100644 --- a/Mathlib/Algebra/Order/Module/HahnEmbedding.lean +++ b/Mathlib/Algebra/Order/Module/HahnEmbedding.lean @@ -209,8 +209,12 @@ theorem hahnCoeff_apply {x : seed.baseDomain} {f : Π₀ c, seed.stratum c} let f' : ⨁ c, seed.stratum' c := f.mapRange (fun c x ↦ (⟨⟨x.val, hxm x⟩, by simp⟩ : seed.stratum' c)) (by simp) have hf : f c = (seed.baseDomain.subtype.submoduleComap (seed.stratum c)) (f' c) := by + set_option backward.isDefEq.respectTransparency false in apply Subtype.ext - simp [f'] + -- TODO: This should finish with `simp [f']` + simp only [DFinsupp.mapRange, DFinsupp.toFun_eq_coe, LinearMap.submoduleComap_apply_coe, + Submodule.subtype_apply, f'] + simp only [DFunLike.coe, instDFunLikeDirectSum._aux_1] have hx : x = (decompose seed.stratum').symm f' := by change x = f'.coeAddMonoidHom _ apply Submodule.subtype_injective diff --git a/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean b/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean index 0675be29429bd3..23c39c9066ab88 100644 --- a/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean +++ b/Mathlib/Algebra/Order/Monoid/LocallyFiniteOrder.lean @@ -164,6 +164,7 @@ def LocallyFiniteOrder.orderAddMonoidEquiv [Nontrivial G] : lemma LocallyFiniteOrder.orderAddMonoidEquiv_apply [Nontrivial G] (x : G) : orderAddMonoidEquiv G x = addMonoidHom G x := rfl +set_option backward.isDefEq.respectTransparency false in /-- Any linearly ordered abelian group that is locally finite embeds to `Multiplicative ℤ`. -/ noncomputable def LocallyFiniteOrder.orderMonoidEquiv (G : Type*) [CommGroup G] [LinearOrder G] @@ -172,6 +173,7 @@ def LocallyFiniteOrder.orderMonoidEquiv (G : Type*) [CommGroup G] [LinearOrder G have : LocallyFiniteOrder (Additive G) := ‹LocallyFiniteOrder G› (orderAddMonoidEquiv (Additive G)).toMultiplicative +set_option backward.isDefEq.respectTransparency false in /-- Any linearly ordered abelian group that is locally finite embeds into `Multiplicative ℤ`. -/ noncomputable def LocallyFiniteOrder.orderMonoidHom (G : Type*) [CommGroup G] [LinearOrder G] @@ -180,6 +182,7 @@ def LocallyFiniteOrder.orderMonoidHom (G : Type*) [CommGroup G] [LinearOrder G] have : LocallyFiniteOrder (Additive G) := ‹LocallyFiniteOrder G› ⟨(orderAddMonoidHom (Additive G)).toMultiplicative, (orderAddMonoidHom (Additive G)).2⟩ +set_option backward.isDefEq.respectTransparency false in lemma LocallyFiniteOrder.orderMonoidHom_strictMono {G : Type*} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] [LocallyFiniteOrder G] : StrictMono (orderMonoidHom G) := diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean index fdef87ac6490bc..c03effea22dd8d 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean @@ -1139,7 +1139,7 @@ variable [PartialOrder α] to the appropriate covariant class. -/ /-- A semigroup with a partial order and satisfying `LeftCancelSemigroup` (i.e. `a * c < b * c → a < b`) is a `LeftCancelSemigroup`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive semigroup with a partial order and satisfying `AddLeftCancelSemigroup` (i.e. `c + a < c + b → a < b`) is a `AddLeftCancelSemigroup`. -/] def Contravariant.toLeftCancelSemigroup [MulLeftReflectLE α] : LeftCancelSemigroup α where @@ -1148,7 +1148,7 @@ def Contravariant.toLeftCancelSemigroup [MulLeftReflectLE α] : LeftCancelSemigr to the appropriate covariant class. -/ /-- A semigroup with a partial order and satisfying `RightCancelSemigroup` (i.e. `a * c < b * c → a < b`) is a `RightCancelSemigroup`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive semigroup with a partial order and satisfying `AddRightCancelSemigroup` (`a + c < b + c → a < b`) is a `AddRightCancelSemigroup`. -/] def Contravariant.toRightCancelSemigroup [MulRightReflectLE α] : RightCancelSemigroup α where diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean index c5bf37515ba1f0..e0a149893a26fe 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/WithTop.lean @@ -127,6 +127,7 @@ lemma _root_.IsAddRightRegular.withTop (ha : IsAddRightRegular a) : IsAddRightRegular (a : WithTop α) := by rintro (_ | b) (_ | c) <;> simp [none_eq_top, some_eq_coe, ← coe_add, ha.eq_iff] +set_option backward.isDefEq.respectTransparency false in lemma _root_.AddLECancellable.withTop [LE α] (ha : AddLECancellable a) : AddLECancellable (a : WithTop α) := by rintro (_ | b) (_ | c) @@ -485,6 +486,7 @@ lemma _root_.IsAddRightRegular.withBot (ha : IsAddRightRegular a) : IsAddRightRegular (a : WithBot α) := by rintro (_ | b) (_ | c) <;> simp [none_eq_bot, some_eq_coe, ← coe_add]; simpa using @ha _ _ +set_option backward.isDefEq.respectTransparency false in lemma _root_.AddLECancellable.withBot [LE α] (ha : AddLECancellable a) : AddLECancellable (a : WithBot α) := by rintro (_ | b) (_ | c) diff --git a/Mathlib/Algebra/Order/Ring/StandardPart.lean b/Mathlib/Algebra/Order/Ring/StandardPart.lean index 2ce7ebf85c3f7f..1b8fc4349ec7ce 100644 --- a/Mathlib/Algebra/Order/Ring/StandardPart.lean +++ b/Mathlib/Algebra/Order/Ring/StandardPart.lean @@ -119,6 +119,7 @@ instance : FloorRing (FiniteElement K) := end FiniteElement +set_option backward.isDefEq.respectTransparency.types false in variable (K) in /-- The residue field of `FiniteElement`. This quotient inherits an order from `K`, which makes it into a linearly ordered Archimedean field. -/ @@ -128,6 +129,7 @@ deriving Field namespace FiniteResidueField +set_option backward.isDefEq.respectTransparency.types false in instance ordConnected_preimage_mk' : ∀ x, Set.OrdConnected <| Quotient.mk (Submodule.quotientRel (IsLocalRing.maximalIdeal (FiniteElement K))) ⁻¹' {x} := by refine fun x ↦ ⟨?_⟩ @@ -137,21 +139,25 @@ instance ordConnected_preimage_mk' : ∀ x, Set.OrdConnected <| Quotient.mk IsLocalRing.mem_maximalIdeal, mem_nonunits_iff, FiniteElement.not_isUnit_iff_mk_pos] at hy ⊢ apply hy.trans_le (mk_antitoneOn _ _ _) <;> simpa +set_option backward.isDefEq.respectTransparency.types false in instance : LinearOrder (FiniteResidueField K) := haveI := Classical.decRel fun x y : FiniteElement K ↦ letI := Submodule.quotientRel (IsLocalRing.maximalIdeal (FiniteElement K)) x ≈ y inferInstanceAs <| LinearOrder (Quotient _) +set_option backward.isDefEq.respectTransparency.types false in /-- The quotient map from finite elements on the field to the associated residue field. -/ def mk : FiniteElement K →+*o FiniteResidueField K where monotone' _ _ h := Quotient.mk_monotone h __ := IsLocalRing.residue (FiniteElement K) +set_option backward.isDefEq.respectTransparency.types false in @[induction_eliminator] theorem ind {motive : FiniteResidueField K → Prop} (mk : ∀ x, motive (mk x)) : ∀ x, motive x := Quotient.ind mk +set_option backward.isDefEq.respectTransparency.types false in instance ordConnected_preimage_mk : ∀ x, Set.OrdConnected (mk ⁻¹' ({x} : Set (FiniteResidueField K))) := ordConnected_preimage_mk' @@ -166,22 +172,27 @@ theorem mk_eq_zero {x : FiniteElement K} : mk x = 0 ↔ 0 < ArchimedeanClass.mk apply mk_eq_mk.trans simp +set_option backward.isDefEq.respectTransparency.types false in theorem mk_ne_zero {x : FiniteElement K} : mk x ≠ 0 ↔ ArchimedeanClass.mk x.1 = 0 := by rw [ne_eq, mk_eq_zero, not_lt, x.2.ge_iff_eq'] +set_option backward.isDefEq.respectTransparency.types false in theorem mk_le_mk {x y : FiniteElement K} : mk x ≤ mk y ↔ x ≤ y ∨ mk x = mk y := by refine (Quotient.mk_le_mk (H := ordConnected_preimage_mk')).trans ?_ rw [← Quotient.eq_iff_equiv] rfl +set_option backward.isDefEq.respectTransparency.types false in theorem mk_lt_mk {x y : FiniteElement K} : mk x < mk y ↔ x < y ∧ mk x ≠ mk y := by refine (Quotient.mk_lt_mk (H := ordConnected_preimage_mk')).trans ?_ rw [← Quotient.eq_iff_equiv] rfl +set_option backward.isDefEq.respectTransparency.types false in theorem lt_of_mk_lt_mk {x y : FiniteElement K} (h : mk x < mk y) : x < y := (mk_lt_mk.1 h).1 +set_option backward.isDefEq.respectTransparency.types false in private theorem mul_le_mul_of_nonneg_left' {x y z : FiniteResidueField K} (h : x ≤ y) (hz : 0 ≤ z) : z * x ≤ z * y := by induction x with | mk x @@ -192,6 +203,7 @@ private theorem mul_le_mul_of_nonneg_left' {x y z : FiniteResidueField K} (h : x rw [mk_le_mk] at h hz ⊢ grind [mul_le_mul_of_nonneg_left] +set_option backward.isDefEq.respectTransparency.types false in instance : IsOrderedRing (FiniteResidueField K) where zero_le_one := mk.monotone' zero_le_one add_le_add_left x y h z := by @@ -206,6 +218,7 @@ instance : IsOrderedRing (FiniteResidueField K) where simp_rw [mul_comm _ x] exact mul_le_mul_of_nonneg_left' h hx +set_option backward.isDefEq.respectTransparency.types false in instance : Archimedean (FiniteResidueField K) where arch x y hy := by induction x with | mk x @@ -220,6 +233,7 @@ instance : Archimedean (FiniteResidueField K) where · exact abs_of_pos <| lt_of_mk_lt_mk hx · exact abs_of_pos <| lt_of_mk_lt_mk hy +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mk_ratCast (q : ℚ) : mk (q : FiniteElement K) = q := by change mk (FiniteElement.mk ..) = _ @@ -228,6 +242,7 @@ theorem mk_ratCast (q : ℚ) : mk (q : FiniteElement K) = q := by ← FiniteElement.mk_natCast, FiniteElement.mk_mul_mk] simp_all +set_option backward.isDefEq.respectTransparency.types false in /-- An embedding from an Archimedean field into `K` induces an embedding into `FiniteResidueField K`. -/ def ofArchimedean (f : R →+*o K) : R →+*o FiniteResidueField K where @@ -255,6 +270,7 @@ theorem ofArchimedean_injective (f : R →+*o K) : Function.Injective (ofArchime rw [ofArchimedean_apply, mk_ne_zero] exact mk_map_of_archimedean' f hr +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem ofArchimedean_inj (f : R →+*o K) {x y : R} : ofArchimedean f x = ofArchimedean f y ↔ x = y := @@ -264,6 +280,7 @@ end FiniteResidueField /-! ### Standard part -/ +set_option backward.isDefEq.respectTransparency.types false in /-- The standard part of a `FiniteElement` is the unique real number with an infinitesimal difference. @@ -273,12 +290,14 @@ def stdPart (x : K) : ℝ := if h : 0 ≤ mk x then OrderRingHom.comp Classical.ofNonempty FiniteResidueField.mk (.mk x h) else 0 +set_option backward.isDefEq.respectTransparency.types false in theorem stdPart_of_mk_nonneg (f : FiniteResidueField K →+*o ℝ) (h : 0 ≤ mk x) : stdPart x = f (.mk <| .mk x h) := by rw [stdPart, dif_pos h, OrderRingHom.comp_apply] congr exact Subsingleton.allEq _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem stdPart_eq_zero {x : K} : stdPart x = 0 ↔ mk x ≠ 0 where mpr h := by @@ -365,6 +384,7 @@ theorem stdPart_div (hx : 0 ≤ mk x) (hy : 0 ≤ -mk y) : rw [div_eq_mul_inv, div_eq_mul_inv, stdPart_mul hx, stdPart_inv] rwa [mk_inv] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem stdPart_ratCast (q : ℚ) : stdPart (q : K) = q := by rw [stdPart_of_mk_nonneg Classical.ofNonempty (mk_ratCast_nonneg q), FiniteElement.mk_ratCast, @@ -391,6 +411,7 @@ theorem stdPart_map_real (f : ℝ →+*o K) (r : ℝ) : stdPart (f r) = r := by theorem stdPart_real (r : ℝ) : stdPart r = r := stdPart_map_real (.id ℝ) r +set_option backward.isDefEq.respectTransparency.types false in theorem ofArchimedean_stdPart (f : ℝ →+*o K) (hx : 0 ≤ mk x) : FiniteResidueField.ofArchimedean f (stdPart x) = .mk (.mk x hx) := by rw [stdPart, dif_pos hx, ← OrderRingHom.comp_apply, ← OrderRingHom.comp_assoc, diff --git a/Mathlib/Algebra/Polynomial/Basic.lean b/Mathlib/Algebra/Polynomial/Basic.lean index d4e14c21b0c65b..2e4f2628656bbf 100644 --- a/Mathlib/Algebra/Polynomial/Basic.lean +++ b/Mathlib/Algebra/Polynomial/Basic.lean @@ -499,6 +499,7 @@ theorem X_ne_C [Nontrivial R] (a : R) : X ≠ C a := by intro he simpa using monomial_eq_monomial_iff.1 he +set_option backward.isDefEq.respectTransparency false in /-- `X` commutes with everything, even when the coefficients are noncommutative. -/ theorem X_mul : X * p = p * X := by rcases p with ⟨⟩ @@ -624,6 +625,7 @@ theorem coeff_X : coeff (X : R[X]) n = if 1 = n then 1 else 0 := theorem coeff_X_of_ne_one {n : ℕ} (hn : n ≠ 1) : coeff (X : R[X]) n = 0 := by rw [coeff_X, if_neg hn.symm] +set_option backward.isDefEq.respectTransparency false in @[simp, grind =] theorem mem_support_iff : n ∈ p.support ↔ p.coeff n ≠ 0 := by rcases p with ⟨⟩ @@ -703,6 +705,7 @@ theorem Nontrivial.of_polynomial_ne (h : p ≠ q) : Nontrivial R := theorem forall_eq_iff_forall_eq : (∀ f g : R[X], f = g) ↔ ∀ a b : R, a = b := by simpa only [← subsingleton_iff] using subsingleton_iff_subsingleton +set_option backward.isDefEq.respectTransparency false in theorem ext_iff {p q : R[X]} : p = q ↔ ∀ n, coeff p n = coeff q n := by rcases p with ⟨f : ℕ →₀ R⟩ rcases q with ⟨g : ℕ →₀ R⟩ @@ -945,6 +948,7 @@ theorem ofFinsupp_erase (p : R[ℕ]) (n : ℕ) : (⟨p.erase n⟩ : R[X]) = (⟨p⟩ : R[X]).erase n := by simp only [erase_def] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem support_erase (p : R[X]) (n : ℕ) : support (p.erase n) = (support p).erase n := by simp only [support, erase_def, Finsupp.support_erase, AddMonoidAlgebra.erase, ofCoeff, @@ -984,6 +988,7 @@ If `p.natDegree < n` and `a ≠ 0`, this increases the degree to `n`. -/ def update (p : R[X]) (n : ℕ) (a : R) : R[X] := Polynomial.ofFinsupp (p.toFinsupp.update n a) +set_option backward.isDefEq.respectTransparency false in theorem coeff_update (p : R[X]) (n : ℕ) (a : R) : (p.update n a).coeff = Function.update p.coeff n a := by ext @@ -1006,6 +1011,7 @@ theorem update_zero_eq_erase (p : R[X]) (n : ℕ) : p.update n 0 = p.erase n := ext rw [coeff_update_apply, coeff_erase] +set_option backward.isDefEq.respectTransparency false in theorem support_update (p : R[X]) (n : ℕ) (a : R) [Decidable (a = 0)] : support (p.update n a) = if a = 0 then p.support.erase n else insert n p.support := by classical diff --git a/Mathlib/Algebra/Polynomial/BigOperators.lean b/Mathlib/Algebra/Polynomial/BigOperators.lean index a8ccdda0b743dd..a95597b181e5cf 100644 --- a/Mathlib/Algebra/Polynomial/BigOperators.lean +++ b/Mathlib/Algebra/Polynomial/BigOperators.lean @@ -66,6 +66,7 @@ lemma natDegree_sum_le_of_forall_le {n : ℕ} (f : ι → S[X]) (h : ∀ i ∈ s natDegree (∑ i ∈ s, f i) ≤ n := le_trans (natDegree_sum_le s f) <| (Finset.fold_max_le n).mpr <| by simpa +set_option backward.isDefEq.respectTransparency false in /-- The leading coefficient of a sum of polynomials with the same degree is the sum of the leading coefficients, provided that this sum is nonzero. -/ @@ -393,6 +394,7 @@ the sum of the degrees, where the degree of the zero polynomial is ⊥. theorem degree_prod [Nontrivial R] : (∏ i ∈ s, f i).degree = ∑ i ∈ s, (f i).degree := map_prod (@degreeMonoidHom R _ _ _) _ _ +set_option backward.isDefEq.respectTransparency false in /-- The leading coefficient of a product of polynomials is equal to the product of the leading coefficients. diff --git a/Mathlib/Algebra/Polynomial/Bivariate.lean b/Mathlib/Algebra/Polynomial/Bivariate.lean index c2064ba46b87fb..1c840a5ba08c61 100644 --- a/Mathlib/Algebra/Polynomial/Bivariate.lean +++ b/Mathlib/Algebra/Polynomial/Bivariate.lean @@ -234,6 +234,7 @@ abbrev aevalAeval (x y : A) : R[X][Y] →ₐ[R] A := lemma aevalAevalEquiv_apply (xy : A × A) : aevalAevalEquiv R A xy = aevalAeval xy.1 xy.2 := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem coe_aevalAeval_eq_evalEval (x y : A) : ⇑(aevalAeval x y) = evalEval x y := by ext simp [aeval, aevalEquiv] diff --git a/Mathlib/Algebra/Polynomial/Coeff.lean b/Mathlib/Algebra/Polynomial/Coeff.lean index c8158f3421dbb4..64197627378591 100644 --- a/Mathlib/Algebra/Polynomial/Coeff.lean +++ b/Mathlib/Algebra/Polynomial/Coeff.lean @@ -64,6 +64,7 @@ theorem card_support_mul_le : #(p * q).support ≤ #p.support * #q.support := by Finset.card_le_card (AddMonoidAlgebra.support_mul p.toFinsupp q.toFinsupp) _ ≤ #p.support * #q.support := Finset.card_image₂_le .. +set_option backward.isDefEq.respectTransparency false in /-- `Polynomial.sum` as a linear map. -/ @[simps] def lsum {R A M : Type*} [Semiring R] [Semiring A] [AddCommMonoid M] [Module R A] [Module R M] @@ -117,6 +118,7 @@ theorem coeff_mul (p q : R[X]) (n : ℕ) : @[simp] theorem mul_coeff_zero (p q : R[X]) : coeff (p * q) 0 = coeff p 0 * coeff q 0 := by simp [coeff_mul] +set_option backward.isDefEq.respectTransparency false in theorem mul_coeff_one (p q : R[X]) : coeff (p * q) 1 = coeff p 0 * coeff q 1 + coeff p 1 * coeff q 0 := by rw [coeff_mul, Nat.antidiagonal_eq_map] diff --git a/Mathlib/Algebra/Polynomial/Degree/Defs.lean b/Mathlib/Algebra/Polynomial/Degree/Defs.lean index 2baa8b38271173..cb29e70a425e0e 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Defs.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Defs.lean @@ -365,6 +365,7 @@ theorem leadingCoeff_eq_zero_iff_deg_eq_bot : leadingCoeff p = 0 ↔ degree p = theorem natDegree_C_mul_X_pow_le (a : R) (n : ℕ) : natDegree (C a * X ^ n) ≤ n := natDegree_le_iff_degree_le.2 <| degree_C_mul_X_pow_le _ _ +set_option backward.isDefEq.respectTransparency false in theorem degree_erase_le (p : R[X]) (n : ℕ) : degree (p.erase n) ≤ degree p := by simp only [erase_def, AddMonoidAlgebra.erase, AddMonoidAlgebra.coeff, AddMonoidAlgebra.ofCoeff, degree, support] diff --git a/Mathlib/Algebra/Polynomial/Derivation.lean b/Mathlib/Algebra/Polynomial/Derivation.lean index 86479cb9a7a556..41dbee4c2422d5 100644 --- a/Mathlib/Algebra/Polynomial/Derivation.lean +++ b/Mathlib/Algebra/Polynomial/Derivation.lean @@ -29,6 +29,7 @@ section CommSemiring variable {R A : Type*} [CommSemiring R] +set_option backward.isDefEq.respectTransparency false in /-- `Polynomial.derivative` as a derivation. -/ @[simps] def derivative' : Derivation R R[X] R[X] where @@ -71,6 +72,7 @@ lemma mkDerivation_apply (a : A) (f : R[X]) : @[simp] theorem mkDerivation_X (a : A) : mkDerivation R a X = a := by simp [mkDerivation_apply] +set_option backward.isDefEq.respectTransparency false in lemma mkDerivation_one_eq_derivative' : mkDerivation R (1 : R[X]) = derivative' := by ext : 1 simp [derivative'] @@ -106,6 +108,7 @@ variable {R A M : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A] [AddCom open Polynomial Module +set_option backward.isDefEq.respectTransparency false in set_option linter.style.whitespace false in -- manual alignment is not recognised /-- For a derivation `d : A → M` and an element `a : A`, `d.compAEval a` is the diff --git a/Mathlib/Algebra/Polynomial/Expand.lean b/Mathlib/Algebra/Polynomial/Expand.lean index 8f46371e485833..94bd5832fa12c9 100644 --- a/Mathlib/Algebra/Polynomial/Expand.lean +++ b/Mathlib/Algebra/Polynomial/Expand.lean @@ -47,6 +47,7 @@ variable {R} theorem expand_eq_comp_X_pow {f : R[X]} : expand R p f = f.comp (X ^ p) := rfl +set_option backward.isDefEq.respectTransparency false in theorem expand_eq_sum {f : R[X]} : expand R p f = f.sum fun e a => C a * (X ^ p) ^ e := by simp [expand, eval₂_eq_sum] @@ -58,6 +59,7 @@ theorem expand_C (r : R) : expand R p (C r) = C r := theorem expand_X : expand R p X = X ^ p := eval₂_X _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem expand_monomial (r : R) : expand R p (monomial q r) = monomial (q * p) r := by simp_rw [← smul_X_eq_monomial, map_smul, map_pow, expand_X, mul_comm, pow_mul] diff --git a/Mathlib/Algebra/Polynomial/Laurent.lean b/Mathlib/Algebra/Polynomial/Laurent.lean index e3b674a50ed46d..4d56f7019a6311 100644 --- a/Mathlib/Algebra/Polynomial/Laurent.lean +++ b/Mathlib/Algebra/Polynomial/Laurent.lean @@ -297,6 +297,7 @@ nonnegative degree coincide with the ones of `f`. The terms of negative degree def trunc : R[T;T⁻¹] →+ R[X] := (toFinsuppIso R).symm.toAddMonoidHom.comp <| comapDomain.addMonoidHom fun _ _ => Int.ofNat.inj +set_option backward.isDefEq.respectTransparency false in @[simp] theorem trunc_C_mul_T (n : ℤ) (r : R) : trunc (C r * T n) = ite (0 ≤ n) (monomial n.toNat r) 0 := by apply (toFinsuppIso R).injective @@ -539,6 +540,7 @@ theorem mk'_one_X_pow (n : ℕ) : IsLocalization.mk' R[T;T⁻¹] 1 (⟨X^n, n, rfl⟩ : Submonoid.powers (X : R[X])) = T (-n) := by rw [mk'_eq 1 n, toLaurent_one, one_mul] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mk'_one_X : IsLocalization.mk' R[T;T⁻¹] 1 (⟨X, 1, pow_one X⟩ : Submonoid.powers (X : R[X])) = T (-1) := by diff --git a/Mathlib/Algebra/Polynomial/Module/AEval.lean b/Mathlib/Algebra/Polynomial/Module/AEval.lean index ed21373297fda9..bddecde3f66012 100644 --- a/Mathlib/Algebra/Polynomial/Module/AEval.lean +++ b/Mathlib/Algebra/Polynomial/Module/AEval.lean @@ -73,6 +73,7 @@ lemma of_aeval_smul (f : R[X]) (m : M) : of R M a (aeval a f • m) = f • of R @[simp] lemma of_symm_smul (f : R[X]) (m : AEval R M a) : (of R M a).symm (f • m) = aeval a f • (of R M a).symm m := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma C_smul (t : R) (m : AEval R M a) : C t • m = t • m := (of R M a).symm.injective <| by simp @@ -170,6 +171,7 @@ def equiv_mapSubmodule : map_add' x y := rfl map_smul' t x := rfl +set_option backward.isDefEq.respectTransparency false in /-- The natural `R[X]`-linear equivalence between the two ways to represent an invariant submodule. -/ noncomputable def restrict_equiv_mapSubmodule : diff --git a/Mathlib/Algebra/Polynomial/Module/Basic.lean b/Mathlib/Algebra/Polynomial/Module/Basic.lean index b2961d0fc98a3b..cc23712c4629ec 100644 --- a/Mathlib/Algebra/Polynomial/Module/Basic.lean +++ b/Mathlib/Algebra/Polynomial/Module/Basic.lean @@ -42,9 +42,6 @@ for the full discussion. def PolynomialModule (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] := ℕ →₀ M deriving Inhabited, FunLike, AddCommGroup -set_option backward.inferInstanceAs.wrap.data false in -deriving instance CoeFun for PolynomialModule - variable (R : Type*) {M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) variable {S : Type*} [CommSemiring S] [Algebra S R] [Module S M] [IsScalarTower S R M] @@ -105,6 +102,7 @@ instance isScalarTower' (M : Type u) [AddCommGroup M] [Module R M] [Module S M] intro x y z rw [← @IsScalarTower.algebraMap_smul S R, ← @IsScalarTower.algebraMap_smul S R, smul_assoc] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem monomial_smul_single (i : ℕ) (r : R) (j : ℕ) (m : M) : monomial i r • single R j m = single R (i + j) (r • m) := by @@ -174,8 +172,12 @@ def equivPolynomialSelf : PolynomialModule R R ≃ₗ[R[X]] R[X] := | add _ _ hp hq => rw [smul_add, map_add, map_add, mul_add, hp, hq] | single n a => ext i - simp_rw [toFinsuppIso_symm_apply, coeff_ofFinsupp, coeff_mul, smul_single_apply, - smul_eq_mul, coeff_ofFinsupp, single_apply, mul_ite, mul_zero] + -- TODO: The following 5 lines should be one `simp_rw` statement + simp_rw [toFinsuppIso_symm_apply, coeff_ofFinsupp, coeff_mul] + rw [smul_single_apply] + simp_rw [smul_eq_mul, coeff_ofFinsupp] + conv => enter [2, 2, ext]; rw [single_apply] + simp_rw [mul_ite, mul_zero] split_ifs with hn · rw [Finset.sum_eq_single (i - n, n)] · simp only [ite_true] @@ -245,6 +247,7 @@ theorem map_smul (f : M →ₗ[R] M') (p : R[X]) (q : PolynomialModule R M) : | monomial => rw [monomial_smul_single, map_single, Polynomial.map_monomial, map_single, monomial_smul_single, f.map_smul, algebraMap_smul] +set_option backward.isDefEq.respectTransparency.types false in /-- Evaluate a polynomial `p : PolynomialModule R M` at `r : R`. -/ @[simps! -isSimp] def eval (r : R) : PolynomialModule R M →ₗ[R] M where diff --git a/Mathlib/Algebra/Polynomial/OfFn.lean b/Mathlib/Algebra/Polynomial/OfFn.lean index db8f8fbcbea18f..a6407e01a07a31 100644 --- a/Mathlib/Algebra/Polynomial/OfFn.lean +++ b/Mathlib/Algebra/Polynomial/OfFn.lean @@ -40,6 +40,7 @@ section ofFn variable {R : Type*} [Semiring R] [DecidableEq R] +set_option backward.isDefEq.respectTransparency false in /-- `ofFn n v` is the polynomial whose coefficients are the entries of the vector `v`. -/ def ofFn (n : ℕ) : (Fin n → R) →ₗ[R] R[X] where toFun v := ⟨(List.ofFn v).toFinsupp⟩ @@ -64,12 +65,14 @@ lemma ne_zero_of_ofFn_ne_zero {n : ℕ} {v : Fin n → R} (h : ofFn n v ≠ 0) : subst h simp +set_option backward.isDefEq.respectTransparency false in /-- If `i < n` the `i`-th coefficient of `ofFn n v` is `v i`. -/ @[simp] theorem ofFn_coeff_eq_val_of_lt {n i : ℕ} (v : Fin n → R) (hi : i < n) : (ofFn n v).coeff i = v ⟨i, hi⟩ := by simp [ofFn, hi] +set_option backward.isDefEq.respectTransparency false in /-- If `n ≤ i` the `i`-th coefficient of `ofFn n v` is `0`. -/ @[simp] theorem ofFn_coeff_eq_zero_of_ge {n i : ℕ} (v : Fin n → R) (hi : n ≤ i) : @@ -98,6 +101,7 @@ theorem ofFn_eq_sum_monomial {n : ℕ} (v : Fin n → R) : ofFn n v = · rw [as_sum_range' (ofFn n v) n <| ofFn_natDegree_lt (Nat.one_le_iff_ne_zero.mpr h) v] simp [Finset.sum_range] +set_option backward.isDefEq.respectTransparency false in theorem toFn_comp_ofFn_eq_id (n : ℕ) (v : Fin n → R) : toFn n (ofFn n v) = v := by simp [toFn, ofFn, LinearMap.pi] diff --git a/Mathlib/Algebra/Polynomial/Reverse.lean b/Mathlib/Algebra/Polynomial/Reverse.lean index 4b1821d13d7268..97023526274a52 100644 --- a/Mathlib/Algebra/Polynomial/Reverse.lean +++ b/Mathlib/Algebra/Polynomial/Reverse.lean @@ -66,6 +66,7 @@ theorem revAt_invol {N i : ℕ} : (revAt N) (revAt N i) = i := theorem revAt_le {N i : ℕ} (H : i ≤ N) : revAt N i = N - i := if_pos H +set_option backward.isDefEq.respectTransparency false in lemma revAt_eq_self_of_lt {N i : ℕ} (h : N < i) : revAt N i = i := by simp [revAt, Nat.not_le.mpr h] theorem revAt_add {N O n o : ℕ} (hn : n ≤ N) (ho : o ≤ O) : @@ -87,6 +88,7 @@ Eventually, it will be used with `N` exactly equal to the degree of `f`. -/ noncomputable def reflect (N : ℕ) : R[X] → R[X] | ⟨f⟩ => ⟨Finsupp.embDomain (revAt N) f⟩ +set_option backward.isDefEq.respectTransparency false in theorem reflect_support (N : ℕ) (f : R[X]) : (reflect N f).support = Finset.image (revAt N) f.support := by rcases f with ⟨⟩ @@ -181,6 +183,7 @@ theorem reflect_mul (f g : R[X]) {F G : ℕ} (Ff : f.natDegree ≤ F) (Gg : g.na reflect (F + G) (f * g) = reflect F f * reflect G g := reflect_mul_induction _ _ F G f g f.support.card.le_succ g.support.card.le_succ Ff Gg +set_option backward.isDefEq.respectTransparency false in lemma natDegree_reflect_le {N : ℕ} {p : R[X]} : (p.reflect N).natDegree ≤ max N p.natDegree := by simp +contextual [-le_sup_iff, natDegree_le_iff_coeff_eq_zero, @@ -234,6 +237,7 @@ theorem reverse_zero : reverse (0 : R[X]) = 0 := @[simp] theorem reverse_eq_zero : f.reverse = 0 ↔ f = 0 := by simp [reverse] +set_option backward.isDefEq.respectTransparency false in theorem reverse_natDegree_le (f : R[X]) : f.reverse.natDegree ≤ f.natDegree := by rw [natDegree_le_iff_degree_le, degree_le_iff_coeff_zero] intro n hn diff --git a/Mathlib/Algebra/Polynomial/Splits.lean b/Mathlib/Algebra/Polynomial/Splits.lean index 3af24a480166c1..58c1b57bc51ee8 100644 --- a/Mathlib/Algebra/Polynomial/Splits.lean +++ b/Mathlib/Algebra/Polynomial/Splits.lean @@ -469,6 +469,7 @@ lemma map_sub_sprod_roots_eq_prod_map_eval congr! with x hx ext; simp +set_option backward.isDefEq.respectTransparency false in lemma map_sub_roots_sprod_eq_prod_map_eval (s : Multiset R) (g : R[X]) (hg : g.Monic) (hg' : g.Splits) : ((g.roots ×ˢ s).map fun ij ↦ ij.1 - ij.2).prod = diff --git a/Mathlib/Algebra/QuadraticAlgebra/Basic.lean b/Mathlib/Algebra/QuadraticAlgebra/Basic.lean index 585161108f95c1..c2b5d5edf91f63 100644 --- a/Mathlib/Algebra/QuadraticAlgebra/Basic.lean +++ b/Mathlib/Algebra/QuadraticAlgebra/Basic.lean @@ -86,12 +86,14 @@ theorem mk_eq_add_smul_omega (x y : R) : variable {A : Type*} [Ring A] [Algebra R A] +set_option backward.isDefEq.respectTransparency false in @[ext] theorem algHom_ext {f g : QuadraticAlgebra R a b →ₐ[R] A} (h : f ω = g ω) : f = g := by ext ⟨x, y⟩ simp [mk_eq_add_smul_omega, h] +set_option backward.isDefEq.respectTransparency false in /-- The unique `AlgHom` from `QuadraticAlgebra R a b` to an `R`-algebra `A`, constructed by replacing `ω` with the provided root. Conversely, this associates to every algebra morphism `QuadraticAlgebra R a b →ₐ[R] A` diff --git a/Mathlib/Algebra/Quandle.lean b/Mathlib/Algebra/Quandle.lean index 2c5fe6dbff6259..ac50462355e7e6 100644 --- a/Mathlib/Algebra/Quandle.lean +++ b/Mathlib/Algebra/Quandle.lean @@ -422,6 +422,7 @@ theorem dihedralAct.inv (n : ℕ) (a : ZMod n) : Function.Involutive (dihedralAc dsimp only [dihedralAct] simp +set_option backward.isDefEq.respectTransparency false in instance (n : ℕ) : Quandle (Dihedral n) where act := dihedralAct n self_distrib := by @@ -647,6 +648,7 @@ theorem well_def {R : Type*} [Rack R] {G : Type*} [Group G] (f : R →◃ Quandl end toEnvelGroup.mapAux +set_option backward.isDefEq.respectTransparency false in /-- Given a map from a rack to a group, lift it to being a map from the enveloping group. More precisely, the `EnvelGroup` functor is left adjoint to `Quandle.Conj`. -/ diff --git a/Mathlib/Algebra/Quaternion.lean b/Mathlib/Algebra/Quaternion.lean index b76bf93cde6f72..24c5d4987adf70 100644 --- a/Mathlib/Algebra/Quaternion.lean +++ b/Mathlib/Algebra/Quaternion.lean @@ -724,9 +724,7 @@ variable {S T R : Type*} [CommRing R] (r x y : R) (a b : ℍ[R]) instance : CoeTC R ℍ[R] := ⟨coe⟩ instance instRing : Ring ℍ[R] := inferInstanceAs <| Ring ℍ[R,-1,0,-1] - instance : Inhabited ℍ[R] := inferInstanceAs <| Inhabited ℍ[R,-1,0,-1] - instance [SMul S R] : SMul S ℍ[R] := inferInstanceAs <| SMul S ℍ[R,-1,0,-1] instance [SMul S T] [SMul S R] [SMul T R] [IsScalarTower S T R] : IsScalarTower S T ℍ[R] := @@ -748,7 +746,10 @@ protected instance algebra [CommSemiring S] [Algebra S R] : Algebra S ℍ[R] := inferInstanceAs <| Algebra S ℍ[R,-1,0,-1] instance : Star ℍ[R] := inferInstanceAs <| Star ℍ[R,-1,0,-1] + instance : StarRing ℍ[R] := inferInstanceAs <| StarRing ℍ[R,-1,0,-1] + +set_option backward.isDefEq.respectTransparency.types false in instance : IsStarNormal a := inferInstanceAs <| IsStarNormal (R := ℍ[R,-1,0,-1]) a @[ext] diff --git a/Mathlib/Algebra/Ring/CentroidHom.lean b/Mathlib/Algebra/Ring/CentroidHom.lean index 261dbd53a831fb..009d9a10fef47c 100644 --- a/Mathlib/Algebra/Ring/CentroidHom.lean +++ b/Mathlib/Algebra/Ring/CentroidHom.lean @@ -519,6 +519,7 @@ section NonAssocSemiring variable [NonAssocSemiring α] +set_option backward.isDefEq.respectTransparency false in /-- The canonical isomorphism from the center of a (non-associative) semiring onto its centroid. -/ def centerIsoCentroid : Subsemiring.center α ≃+* CentroidHom α := { centerToCentroid with diff --git a/Mathlib/Algebra/Ring/Hom/Defs.lean b/Mathlib/Algebra/Ring/Hom/Defs.lean index 68b5181952ba1c..2b597c7208a5f1 100644 --- a/Mathlib/Algebra/Ring/Hom/Defs.lean +++ b/Mathlib/Algebra/Ring/Hom/Defs.lean @@ -171,7 +171,7 @@ end variable [NonUnitalNonAssocSemiring α] [NonUnitalNonAssocSemiring β] /-- The identity non-unital ring homomorphism from a non-unital semiring to itself. -/ -@[implicit_reducible] +@[instance_reducible] protected def id (α : Type*) [NonUnitalNonAssocSemiring α] : α →ₙ+* α where toFun x := x map_mul' _ _ := rfl @@ -208,7 +208,7 @@ theorem coe_mulHom_id : (NonUnitalRingHom.id α : α →ₙ* α) = MulHom.id α variable [NonUnitalNonAssocSemiring γ] /-- Composition of non-unital ring homomorphisms is a non-unital ring homomorphism. -/ -@[implicit_reducible] +@[instance_reducible] def comp (g : β →ₙ+* γ) (f : α →ₙ+* β) : α →ₙ+* γ := { g.toMulHom.comp f.toMulHom, g.toAddMonoidHom.comp f.toAddMonoidHom with } @@ -508,7 +508,7 @@ def mk' [NonAssocSemiring α] [NonAssocRing β] (f : α →* β) variable {_ : NonAssocSemiring α} {_ : NonAssocSemiring β} /-- The identity ring homomorphism from a semiring to itself. -/ -@[implicit_reducible] +@[instance_reducible] def id (α : Type*) [NonAssocSemiring α] : α →+* α where toFun x := x map_zero' := rfl @@ -537,7 +537,7 @@ theorem coe_monoidHom_id : (id α : α →* α) = MonoidHom.id α := variable {_ : NonAssocSemiring γ} /-- Composition of ring homomorphisms is a ring homomorphism. -/ -@[implicit_reducible] +@[instance_reducible] def comp (g : β →+* γ) (f : α →+* β) : α →+* γ := { g.toNonUnitalRingHom.comp f.toNonUnitalRingHom with toFun x := g (f x), map_one' := by simp } diff --git a/Mathlib/Algebra/Ring/Invertible.lean b/Mathlib/Algebra/Ring/Invertible.lean index bfc4dc0b75b186..f6dd9d7a84a87f 100644 --- a/Mathlib/Algebra/Ring/Invertible.lean +++ b/Mathlib/Algebra/Ring/Invertible.lean @@ -61,7 +61,7 @@ theorem IsAddUnit.mul_right {x : R} (h : IsAddUnit x) (y : R) : IsAddUnit (x * y end NonUnitalNonAssocSemiring /-- `-⅟a` is the inverse of `-a` -/ -@[implicit_reducible] +@[instance_reducible] def invertibleNeg [Mul R] [One R] [HasDistribNeg R] (a : R) [Invertible a] : Invertible (-a) := ⟨-⅟a, by simp, by simp⟩ diff --git a/Mathlib/Algebra/Ring/Subring/Basic.lean b/Mathlib/Algebra/Ring/Subring/Basic.lean index c2885905fded4e..ca0fb7b37945a2 100644 --- a/Mathlib/Algebra/Ring/Subring/Basic.lean +++ b/Mathlib/Algebra/Ring/Subring/Basic.lean @@ -967,6 +967,7 @@ theorem ofLeftInverse_symm_apply {g : S → R} {f : R →+* S} (h : Function.Lef def subringMap (e : R ≃+* S) : s ≃+* s.map e.toRingHom := e.subsemiringMap s.toSubsemiring +set_option backward.isDefEq.respectTransparency false in /-- A ring isomorphism `e : R ≃+* S` descends to subrings `s' ≃+* s` provided `x ∈ s' ↔ e x ∈ s`. -/ @[simps!] diff --git a/Mathlib/Algebra/RingQuot.lean b/Mathlib/Algebra/RingQuot.lean index f71b9b73273a73..10c30a697460d7 100644 --- a/Mathlib/Algebra/RingQuot.lean +++ b/Mathlib/Algebra/RingQuot.lean @@ -512,6 +512,7 @@ theorem ringQuot_ext' {s : A → A → Prop} (f g : RingQuot s →ₐ[S] B) rcases mkAlgHom_surjective S s x with ⟨x, rfl⟩ exact AlgHom.congr_fun w x +set_option backward.isDefEq.respectTransparency false in irreducible_def preLiftAlgHom {s : A → A → Prop} {f : A →ₐ[S] B} (h : ∀ ⦃x y⦄, s x y → f x = f y) : RingQuot s →ₐ[S] B := { toFun := fun x ↦ Quot.lift f diff --git a/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean b/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean index f94cb15ffdfd9c..09745dd819808c 100644 --- a/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean +++ b/Mathlib/Algebra/SkewMonoidAlgebra/Basic.lean @@ -835,7 +835,7 @@ def comapMulAction : MulAction G (SkewMonoidAlgebra M α) where attribute [local instance] comapMulAction /-- This is not an instance as it conflicts with `SkewMonoidAlgebra.distribMulAction` when `G = kˣ`. -/ -@[implicit_reducible] +@[instance_reducible] def comapDistribMulActionSelf [AddCommMonoid k] : DistribMulAction G (SkewMonoidAlgebra k G) where smul_zero g := by diff --git a/Mathlib/Algebra/Star/CentroidHom.lean b/Mathlib/Algebra/Star/CentroidHom.lean index c19be02a62c6cf..f90ec24349cf35 100644 --- a/Mathlib/Algebra/Star/CentroidHom.lean +++ b/Mathlib/Algebra/Star/CentroidHom.lean @@ -117,6 +117,7 @@ section NonAssocStarSemiring variable [NonAssocSemiring α] [StarRing α] +set_option backward.isDefEq.respectTransparency false in /-- The canonical isomorphism from the center of a (non-associative) semiring onto its centroid. -/ def starCenterIsoCentroid : StarSubsemiring.center α ≃⋆+* CentroidHom α where __ := starCenterToCentroid diff --git a/Mathlib/Algebra/Star/Module.lean b/Mathlib/Algebra/Star/Module.lean index ccb3632bc539f1..0cc242915fb4d9 100644 --- a/Mathlib/Algebra/Star/Module.lean +++ b/Mathlib/Algebra/Star/Module.lean @@ -196,6 +196,7 @@ theorem skewAdjointPart_comp_subtype_skewAdjoint : variable (A) +set_option backward.isDefEq.respectTransparency false in /-- The decomposition of elements of a star module into their self- and skew-adjoint parts, as a linear equivalence. -/ @[simps!] diff --git a/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean b/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean index 69fdd112ff2256..876b6a58b36797 100644 --- a/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean +++ b/Mathlib/Algebra/Star/NonUnitalSubalgebra.lean @@ -1048,6 +1048,7 @@ instance instIsMulCommutative_iSup [Nonempty ι] [Preorder ι] [IsDirectedOrder IsMulCommutative (⨆ i, S i : NonUnitalStarSubalgebra R A) := isMulCommutative_iSup S.monotone.directed_le +set_option backward.isDefEq.respectTransparency false in /-- Define a non-unital star algebra homomorphism on a directed supremum of non-unital star subalgebras by defining it on each non-unital star subalgebra, and proving that it agrees on the intersection of non-unital star subalgebras. -/ diff --git a/Mathlib/Algebra/Star/RingQuot.lean b/Mathlib/Algebra/Star/RingQuot.lean index 7bb4c00a742dea..8ac151788c6ed4 100644 --- a/Mathlib/Algebra/Star/RingQuot.lean +++ b/Mathlib/Algebra/Star/RingQuot.lean @@ -43,7 +43,7 @@ private theorem star'_quot (hr : ∀ a b, r a b → r (star a) (star b)) {a} : (star' r hr ⟨Quot.mk _ a⟩ : RingQuot r) = ⟨Quot.mk _ (star a)⟩ := rfl /-- Transfer a `StarRing` instance through a quotient, if the quotient is invariant to `star` -/ -@[implicit_reducible] +@[instance_reducible] def starRing {R : Type u} [Semiring R] [StarRing R] (r : R → R → Prop) (hr : ∀ a b, r a b → r (star a) (star b)) : StarRing (RingQuot r) where star := star' r hr diff --git a/Mathlib/Algebra/Star/StarAlgHom.lean b/Mathlib/Algebra/Star/StarAlgHom.lean index 9954e7d7744a2c..a5c812f4b32d8a 100644 --- a/Mathlib/Algebra/Star/StarAlgHom.lean +++ b/Mathlib/Algebra/Star/StarAlgHom.lean @@ -656,6 +656,7 @@ instance (priority := 100) {F R A B : Type*} [Monoid R] [NonUnitalNonAssocSemiri NonUnitalAlgHomClass F R A B := { } +set_option backward.isDefEq.respectTransparency false in -- See note [lower instance priority] instance (priority := 100) (F R A B : Type*) [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [EquivLike F A B] [NonUnitalAlgEquivClass F R A B] : diff --git a/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean b/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean index 25d846324e92f6..5ae10ac70a2f54 100644 --- a/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean +++ b/Mathlib/Algebra/Star/UnitaryStarAlgAut.lean @@ -24,6 +24,7 @@ variable {S R : Type*} [Semiring R] [StarMul R] [SMul S R] [IsScalarTower S R R] [SMulCommClass S R R] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in variable (S R) in /-- Each unitary element `u` defines a ⋆-algebra automorphism such that `x ↦ u * x * star u`. diff --git a/Mathlib/Algebra/Symmetrized.lean b/Mathlib/Algebra/Symmetrized.lean index 87503423a78036..0898016505271d 100644 --- a/Mathlib/Algebra/Symmetrized.lean +++ b/Mathlib/Algebra/Symmetrized.lean @@ -249,6 +249,7 @@ theorem invOf_sym [Mul α] [AddMonoidWithOne α] [Invertible (2 : α)] (a : α) ⅟(sym a) = sym (⅟a) := rfl +set_option backward.isDefEq.respectTransparency false in instance nonAssocSemiring [Semiring α] [Invertible (2 : α)] : NonAssocSemiring αˢʸᵐ := { SymAlg.addCommMonoid with zero_mul := fun _ => by diff --git a/Mathlib/Algebra/TrivSqZeroExt/Basic.lean b/Mathlib/Algebra/TrivSqZeroExt/Basic.lean index 7133a5c4559176..a3f78d394f989d 100644 --- a/Mathlib/Algebra/TrivSqZeroExt/Basic.lean +++ b/Mathlib/Algebra/TrivSqZeroExt/Basic.lean @@ -724,6 +724,7 @@ theorem mul_right_eq_one (x : tsze R M) (r : R) (h : x.fst * r = 1) : variable [SMulCommClass R Rᵐᵒᵖ M] +set_option backward.isDefEq.respectTransparency false in /-- `x : tzre R M` is invertible when `x.fst : R` is. -/ abbrev invertibleOfInvertibleFst (x : tsze R M) [Invertible x.fst] : Invertible x where invOf := (⅟x.fst, -(⅟x.fst •> x.snd <• ⅟x.fst)) diff --git a/Mathlib/Algebra/TrivSqZeroExt/Ideal.lean b/Mathlib/Algebra/TrivSqZeroExt/Ideal.lean index 07c93c2a4fe6db..e0455c79023574 100644 --- a/Mathlib/Algebra/TrivSqZeroExt/Ideal.lean +++ b/Mathlib/Algebra/TrivSqZeroExt/Ideal.lean @@ -29,6 +29,7 @@ variable (R M : Type*) /-- The kernel of the `AlgHom` `fstHom R R M` -/ def kerIdeal : Ideal (TrivSqZeroExt R M) := RingHom.ker (fstHom R R M) +set_option backward.isDefEq.respectTransparency false in theorem mem_kerIdeal_iff_inr (x : TrivSqZeroExt R M) : x ∈ kerIdeal R M ↔ x = inr x.snd := by obtain ⟨r, m⟩ := x simp only [kerIdeal, RingHom.mem_ker, fstHom_apply, fst_mk] diff --git a/Mathlib/AlgebraicGeometry/AffineScheme.lean b/Mathlib/AlgebraicGeometry/AffineScheme.lean index 5c6067430c560d..c29f944683a6ed 100644 --- a/Mathlib/AlgebraicGeometry/AffineScheme.lean +++ b/Mathlib/AlgebraicGeometry/AffineScheme.lean @@ -258,6 +258,7 @@ def Scheme.affineOpens (X : Scheme) : Set X.Opens := instance {Y : Scheme.{u}} (U : Y.affineOpens) : IsAffine U := U.property +set_option backward.isDefEq.respectTransparency.types false in theorem isAffineOpen_opensRange {X Y : Scheme} [IsAffine X] (f : X ⟶ Y) [H : IsOpenImmersion f] : IsAffineOpen f.opensRange := by refine .of_isIso (IsOpenImmersion.isoOfRangeEq f (Y.ofRestrict _) ?_).inv @@ -295,6 +296,7 @@ instance (X : Scheme) [CompactSpace X] (𝒰 : X.OpenCover) [∀ i, IsAffine ( IsAffine (𝒰.finiteSubcover.X i) := inferInstanceAs (IsAffine (𝒰.X _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {X} [IsAffine X] (i) : IsAffine ((Scheme.coverOfIsIso (P := @IsOpenImmersion) (𝟙 X)).X i) := by @@ -355,6 +357,7 @@ lemma Scheme.Opens.toSpecΓ_top {X : Scheme} : (⊤ : X.Opens).toSpecΓ = (⊤ : X.Opens).ι ≫ X.toSpecΓ := by simp [Scheme.Opens.toSpecΓ, toSpecΓ_naturality]; rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma Scheme.Opens.toSpecΓ_appTop {X : Scheme.{u}} (U : X.Opens) : U.toSpecΓ.appTop = (Scheme.ΓSpecIso Γ(X, U)).hom ≫ U.topIso.inv := by @@ -378,6 +381,7 @@ namespace IsAffineOpen variable {X Y : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U) (f : Γ(X, U)) +set_option backward.isDefEq.respectTransparency.types false in attribute [-simp] eqToHom_op in /-- The isomorphism `U ≅ Spec Γ(X, U)` for an affine `U`. -/ @[simps! -isSimp inv] @@ -407,6 +411,7 @@ lemma isoSpec_hom_apply (x : U) : congr 1 exact IsLocalRing.comap_closedPoint (U.stalkIso x).inv.hom +set_option backward.isDefEq.respectTransparency.types false in lemma isoSpec_hom_appTop : hU.isoSpec.hom.appTop = (Scheme.ΓSpecIso Γ(X, U)).hom ≫ U.topIso.inv := by simp [isoSpec, Scheme.isoSpec] @@ -593,6 +598,7 @@ theorem basicOpen_fromSpec_app : (Spec Γ(X, U)).basicOpen (hU.fromSpec.app U f) = PrimeSpectrum.basicOpen f := by rw [← hU.fromSpec_preimage_basicOpen, Scheme.preimage_basicOpen] +set_option backward.isDefEq.respectTransparency.types false in include hU in theorem basicOpen : IsAffineOpen (X.basicOpen f) := by @@ -629,6 +635,7 @@ theorem exists_basicOpen_le {V : X.Opens} (x : V) (h : ↑x ∈ U) : simpa [Scheme.image_basicOpen] using! (U.ι.image_mono h₂).trans (U.ι.image_preimage_le _) exact ⟨U.topIso.hom.hom r, by simp [Scheme.Opens.toScheme_presheaf_obj, h₁, h₂]⟩ +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance {R : CommRingCat} {U} : Algebra R Γ(Spec R, U) := inferInstanceAs (Algebra R ((Spec.structureSheaf R).presheaf.obj _)) @@ -637,6 +644,7 @@ instance {R : CommRingCat} {U} : Algebra R Γ(Spec R, U) := lemma algebraMap_Spec_obj {R : CommRingCat} {U} : algebraMap R Γ(Spec R, U) = ((Scheme.ΓSpecIso R).inv ≫ (Spec R).presheaf.map (homOfLE le_top).op).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in instance {R : CommRingCat} {f : R} : IsLocalization.Away f Γ(Spec R, PrimeSpectrum.basicOpen f) := inferInstanceAs (IsLocalization.Away f @@ -650,11 +658,13 @@ def basicOpenSectionsToAffine : hU.fromSpec.app (X.basicOpen f) ≫ (Spec Γ(X, U)).presheaf.map (eqToHom (hU.fromSpec_preimage_basicOpen f).symm).op +set_option backward.isDefEq.respectTransparency.types false in instance basicOpenSectionsToAffine_isIso : IsIso (basicOpenSectionsToAffine hU f) := (hU.fromSpec.isIso_app _ (hU.opensRange_fromSpec.symm ▸ X.basicOpen_le f)).comp_isIso' inferInstance +set_option backward.isDefEq.respectTransparency.types false in include hU in theorem isLocalization_basicOpen : IsLocalization.Away f Γ(X, X.basicOpen f) := by @@ -762,6 +772,7 @@ noncomputable def primeIdealOf (x : U) : PrimeSpectrum Γ(X, U) := hU.isoSpec.hom x +set_option backward.isDefEq.respectTransparency.types false in theorem fromSpec_primeIdealOf (x : U) : hU.fromSpec (hU.primeIdealOf x) = x.1 := by dsimp only [IsAffineOpen.fromSpec, Subtype.coe_mk, IsAffineOpen.primeIdealOf] @@ -773,6 +784,7 @@ theorem primeIdealOf_eq_map_closedPoint (x : U) : hU.primeIdealOf x = Spec.map (X.presheaf.germ _ x x.2) (closedPoint _) := hU.isoSpec_hom_apply _ +set_option backward.isDefEq.respectTransparency.types false in lemma comap_primeIdealOf_appLE {f : X ⟶ Y} {x : X} (U : Y.Opens) (hU : IsAffineOpen U) (V : X.Opens) (hV : IsAffineOpen V) (hVU : V ≤ f ⁻¹ᵁ U) (hx : x ∈ V) : (hV.primeIdealOf ⟨x, hx⟩).comap (f.appLE U V hVU).hom = hU.primeIdealOf ⟨f x, hVU hx⟩ := by @@ -784,6 +796,7 @@ lemma comap_primeIdealOf_appLE {f : X ⟶ Y} {x : X} (U : Y.Opens) apply Subtype.ext simp +set_option backward.isDefEq.respectTransparency.types false in /-- If a point `x : U` is a closed point, then its corresponding prime ideal is maximal. -/ theorem primeIdealOf_isMaximal_of_isClosed (x : U) (hx : IsClosed {(x : X)}) : (hU.primeIdealOf x).asIdeal.IsMaximal := by @@ -797,6 +810,7 @@ theorem primeIdealOf_isMaximal_of_isClosed (x : U) (hx : IsClosed {(x : X)}) : apply (TopCat.isIso_iff_isHomeomorph _).mp infer_instance +set_option backward.isDefEq.respectTransparency.types false in theorem isLocalization_stalk' (y : PrimeSpectrum Γ(X, U)) (hy : hU.fromSpec y ∈ U) : @IsLocalization.AtPrime (R := Γ(X, U)) @@ -831,6 +845,7 @@ lemma stalkMap_injective (f : X ⟶ Y) {U : Opens Y} (hU : IsAffineOpen U) (x : apply (hU.isLocalization_stalk ⟨f x, hx⟩).injective_of_map_algebraMap_zero exact h +set_option backward.isDefEq.respectTransparency.types false in include hU in lemma mem_ideal_iff {s : Γ(X, U)} {I : Ideal Γ(X, U)} : s ∈ I ↔ ∀ (x : X) (h : x ∈ U), X.presheaf.germ U x h s ∈ I.map (X.presheaf.germ U x h).hom := by @@ -859,6 +874,7 @@ lemma ideal_ext_iff {I J : Ideal Γ(X, U)} : I.map (X.presheaf.germ U x h).hom = J.map (X.presheaf.germ U x h).hom := by simp_rw [le_antisymm_iff, hU.ideal_le_iff, forall_and] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given affine opens `x ∈ V ⊆ f⁻¹(U)`, the stalk map of `f` at `x` is isomorphic to `Localization.localRingHom` of `f.appLE U V`. -/ @@ -995,6 +1011,7 @@ lemma stalkMap_injective_of_isAffine {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] ( Function.Injective (f.stalkMap x) := (isAffineOpen_top Y).stalkMap_injective f x trivial h +set_option backward.isDefEq.respectTransparency.types false in /-- Given a spanning set of `Γ(X, U)`, the corresponding basic open sets cover `U`. See `IsAffineOpen.basicOpen_union_eq_self_iff` for the inverse direction for affine open sets. @@ -1084,6 +1101,7 @@ lemma toSpecΓ_preimage_zeroLocus (s : Set Γ(X, ⊤)) : X.toSpecΓ ⁻¹' PrimeSpectrum.zeroLocus s = X.zeroLocus s := LocallyRingedSpace.toΓSpec_preimage_zeroLocus_eq s +set_option backward.isDefEq.respectTransparency.types false in /-- If `X` is affine, the image of the zero locus of global sections of `X` under `X.isoSpec` is the zero locus in terms of the prime spectrum of `Γ(X, ⊤)`. -/ lemma isoSpec_image_zeroLocus [IsAffine X] @@ -1096,6 +1114,7 @@ lemma toSpecΓ_image_zeroLocus [IsAffine X] (s : Set Γ(X, ⊤)) : X.toSpecΓ '' X.zeroLocus s = PrimeSpectrum.zeroLocus s := X.isoSpec_image_zeroLocus _ +set_option backward.isDefEq.respectTransparency.types false in lemma isoSpec_inv_preimage_zeroLocus [IsAffine X] (s : Set Γ(X, ⊤)) : X.isoSpec.inv ⁻¹' X.zeroLocus s = PrimeSpectrum.zeroLocus s := by rw [← toSpecΓ_preimage_zeroLocus, ← Set.preimage_comp, ← TopCat.coe_comp, ← Scheme.Hom.comp_base, @@ -1142,6 +1161,7 @@ lemma Opens.toSpecΓ_preimage_zeroLocus {X : Scheme.{u}} (U : X.Opens) (s : Set end Scheme +set_option backward.isDefEq.respectTransparency.types false in lemma IsAffineOpen.fromSpec_preimage_zeroLocus {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U) (s : Set Γ(X, U)) : hU.fromSpec ⁻¹' X.zeroLocus s = PrimeSpectrum.zeroLocus s := by @@ -1216,6 +1236,7 @@ def Scheme.Hom.liftQuotient (f : X.Hom (Spec A)) (I : Ideal A) X.toSpecΓ ≫ Spec.map (CommRingCat.ofHom (Ideal.Quotient.lift _ ((Scheme.ΓSpecIso _).inv ≫ f.appTop).hom hI)) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma Scheme.Hom.liftQuotient_comp (f : X.Hom (Spec A)) (I : Ideal A) (hI : I ≤ RingHom.ker ((Scheme.ΓSpecIso A).inv ≫ f.appTop).hom) : @@ -1275,6 +1296,7 @@ section Stalks variable {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum S) (x : PrimeSpectrum R) +set_option backward.isDefEq.respectTransparency.types false in variable (R) (x : PrimeSpectrum R) in /-- The stalk of `Spec R` at `x` is isomorphic to `Rₚ`, where `p` is the prime corresponding to `x`. -/ diff --git a/Mathlib/AlgebraicGeometry/AffineSpace.lean b/Mathlib/AlgebraicGeometry/AffineSpace.lean index 9d3d25fdf59a8a..620956ab7d882d 100644 --- a/Mathlib/AlgebraicGeometry/AffineSpace.lean +++ b/Mathlib/AlgebraicGeometry/AffineSpace.lean @@ -73,6 +73,7 @@ def toSpecMvPoly : 𝔸(n; S) ⟶ Spec ℤ[n].{u, v} := pullback.snd _ _ variable {X : Scheme.{max u v}} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Morphisms into `Spec ℤ[n]` are equivalent the choice of `n` global sections. @@ -138,6 +139,7 @@ lemma hom_ext {f g : X ⟶ 𝔸(n; S)} rw [toSpecMvPolyIntEquiv_comp, toSpecMvPolyIntEquiv_comp] exact h₂ i +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma comp_homOfVector {X Y : Scheme} (v : n → Γ(Y, ⊤)) (f : X ⟶ Y) (g : Y ⟶ S) : f ≫ homOfVector g v = homOfVector (f ≫ g) (f.appTop ∘ v) := by @@ -162,6 +164,7 @@ def homOverEquiv : { f : X ⟶ 𝔸(n; S) // f.IsOver S } ≃ (n → Γ(X, ⊤)) · rw [homOfVector_appTop_coord] right_inv v := by ext i; simp [-TopologicalSpace.Opens.map_top, homOfVector_appTop_coord] +set_option backward.isDefEq.respectTransparency.types false in variable (n) in /-- The affine space over an affine base is isomorphic to the spectrum of the polynomial ring. @@ -210,11 +213,13 @@ lemma isoOfIsAffine_hom_appTop [IsAffine S] : (eval₂Hom ((𝔸(n; S) ↘ S).appTop).hom (coord S)) := by simp [isoOfIsAffine_hom] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma isoOfIsAffine_inv_appTop_coord [IsAffine S] (i) : (isoOfIsAffine n S).inv.appTop (coord _ i) = (Scheme.ΓSpecIso (.of _)).inv (.X i) := homOfVector_appTop_coord _ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma isoOfIsAffine_inv_over [IsAffine S] : (isoOfIsAffine n S).inv ≫ 𝔸(n; S) ↘ S = Spec.map (CommRingCat.ofHom C) ≫ S.isoSpec.inv := @@ -229,6 +234,7 @@ def SpecIso (R : CommRingCat.{max u v}) : isoOfIsAffine _ _ ≪≫ Scheme.Spec.mapIso (MvPolynomial.mapEquiv _ (Scheme.ΓSpecIso R).symm.commRingCatIsoToRingEquiv).toCommRingCatIso.op +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma SpecIso_hom_appTop (R : CommRingCat.{max u v}) : (SpecIso n R).hom.appTop = (Scheme.ΓSpecIso _).hom ≫ @@ -237,6 +243,7 @@ lemma SpecIso_hom_appTop (R : CommRingCat.{max u v}) : ext i simp [SpecIso] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma SpecIso_inv_appTop_coord (R : CommRingCat.{max u v}) (i) : (SpecIso n R).inv.appTop (coord _ i) = (Scheme.ΓSpecIso (.of _)).inv (.X i) := by @@ -247,6 +254,7 @@ lemma SpecIso_inv_appTop_coord (R : CommRingCat.{max u v}) (i) : congr 1 exact map_X _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma SpecIso_inv_over (R : CommRingCat.{max u v}) : (SpecIso n R).inv ≫ 𝔸(n; Spec R) ↘ Spec R = Spec.map (CommRingCat.ofHom C) := by @@ -285,6 +293,7 @@ lemma map_toSpecMvPoly {S T : Scheme.{max u v}} (f : S ⟶ T) : lemma map_id : map n (𝟙 S) = 𝟙 𝔸(n; S) := by ext1 <;> simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc, simp] lemma map_comp {S S' S'' : Scheme} (f : S ⟶ S') (g : S' ⟶ S'') : map n (f ≫ g) = map n f ≫ map n g := by @@ -292,6 +301,7 @@ lemma map_comp {S S' S'' : Scheme} (f : S ⟶ S') (g : S' ⟶ S'') : · simp · simp +set_option backward.isDefEq.respectTransparency.types false in lemma map_SpecMap {R S : CommRingCat.{max u v}} (φ : R ⟶ S) : map n (Spec.map φ) = (SpecIso n S).hom ≫ Spec.map (CommRingCat.ofHom (MvPolynomial.map φ.hom)) ≫ @@ -341,11 +351,13 @@ lemma reindex_appTop_coord {n m : Type v} (i : m → n) (S : Scheme.{max u v}) ( lemma reindex_id : reindex id S = 𝟙 𝔸(n; S) := by ext1 <;> simp +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] lemma reindex_comp {n₁ n₂ n₃ : Type v} (i : n₁ ⟶ n₂) (j : n₂ ⟶ n₃) (S : Scheme.{max u v}) : reindex (i ≫ j) S = reindex j S ≫ reindex i S := by ext k <;> simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma map_reindex {n₁ n₂ : Type v} (i : n₁ → n₂) {S T : Scheme.{max u v}} (f : S ⟶ T) : map n₂ f ≫ reindex i T = reindex i S ≫ map n₁ f := by @@ -362,14 +374,17 @@ def functor : (Type v)ᵒᵖ ⥤ Scheme.{max u v} ⥤ Scheme.{max u v} where end functorial section instances +set_option backward.isDefEq.respectTransparency.types false in instance : IsAffineHom (𝔸(n; S) ↘ S) := MorphismProperty.pullback_fst _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance : Surjective (𝔸(n; S) ↘ S) := MorphismProperty.pullback_fst _ _ <| by have := isIso_of_isTerminal specULiftZIsTerminal terminalIsTerminal (terminal.from _) rw [← terminal.comp_from (Spec.map (CommRingCat.ofHom C)), MorphismProperty.cancel_right_of_respectsIso (P := @Surjective)] exact ⟨MvPolynomial.comap_C_surjective⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [Finite n] : LocallyOfFinitePresentation (𝔸(n; S) ↘ S) := MorphismProperty.pullback_fst _ _ <| by have := isIso_of_isTerminal specULiftZIsTerminal.{max u v} terminalIsTerminal (terminal.from _) @@ -393,6 +408,7 @@ lemma isOpenMap_over : IsOpenMap (𝔸(n; S) ↘ S) := by (SpecIso n R).inv, SpecIso_inv_over] exact MvPolynomial.isOpenMap_comap_C +set_option backward.isDefEq.respectTransparency.types false in open MorphismProperty in instance [IsEmpty n] : IsIso (𝔸(n; S) ↘ S) := pullback_fst (P := isomorphisms _) _ _ <| by @@ -404,6 +420,7 @@ instance [IsEmpty n] : IsIso (𝔸(n; S) ↘ S) := pullback_fst ⟨C_injective n _, C_surjective _⟩⟩ · exact isIso_of_isTerminal specULiftZIsTerminal terminalIsTerminal (terminal.from _) +set_option backward.isDefEq.respectTransparency.types false in lemma isIntegralHom_over_iff_isEmpty : IsIntegralHom (𝔸(n; S) ↘ S) ↔ IsEmpty S ∨ IsEmpty n := by constructor · intro h @@ -436,6 +453,7 @@ lemma isIntegralHom_over_iff_isEmpty : IsIntegralHom (𝔸(n; S) ↘ S) ↔ IsEm lemma not_isIntegralHom [Nonempty S] [Nonempty n] : ¬ IsIntegralHom (𝔸(n; S) ↘ S) := by simp [isIntegralHom_over_iff_isEmpty] +set_option backward.isDefEq.respectTransparency.types false in lemma spec_le_iff (R : CommRingCat) (p q : Spec R) : p ≤ q ↔ q.asIdeal ≤ p.asIdeal := by aesop (add simp PrimeSpectrum.le_iff_specializes) diff --git a/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean b/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean index 462e71b6bf63f5..5e8b399d852494 100644 --- a/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean +++ b/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean @@ -174,6 +174,7 @@ lemma exists_mem_of_isClosed_of_nonempty' section Opens +set_option backward.isDefEq.respectTransparency false in include hc in /-- Let `{ Dᵢ }` be a cofiltered diagram of compact schemes with affine transition maps. If `U ⊆ Dⱼ` contains the image of `limᵢ Dᵢ ⟶ Dⱼ`, then it contains the image of some `Dₖ ⟶ Dⱼ`. -/ @@ -194,6 +195,7 @@ lemma exists_map_eq_top attribute [local simp] Scheme.Hom.resLE_comp_resLE +set_option backward.isDefEq.respectTransparency.types false in /-- Given a diagram `{ Dᵢ }` of schemes and an open `U ⊆ Dᵢ`, this is the diagram of `{ Dⱼᵢ⁻¹ U }_{j ≤ i}`. -/ @[simps] noncomputable @@ -355,6 +357,7 @@ lemma exists_preimage_eq end Opens +set_option backward.isDefEq.respectTransparency.types false in include hc in lemma isAffineHom_π_app [IsCofiltered I] [∀ {i j} (f : i ⟶ j), IsAffineHom (D.map f)] (i : I) : IsAffineHom (c.π.app i) where @@ -1053,6 +1056,7 @@ lemma Scheme.exists_isAffine_of_isLimit [IsCofiltered I] exact ⟨j, ⟨isIso_of_isOpenImmersion_of_opensRange_eq_top _ ((preimage_opensRange_toSpecΓ (D.map fij)).symm.trans hj)⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in include hc in @[stacks 01Z4 "(1)"] diff --git a/Mathlib/AlgebraicGeometry/AlgClosed/Basic.lean b/Mathlib/AlgebraicGeometry/AlgClosed/Basic.lean index eb685a5d628f8f..06fdb9596096f5 100644 --- a/Mathlib/AlgebraicGeometry/AlgClosed/Basic.lean +++ b/Mathlib/AlgebraicGeometry/AlgClosed/Basic.lean @@ -60,6 +60,7 @@ lemma pointOfClosedPoint_comp : pointOfClosedPoint f x hx ≫ f = 𝟙 _ := by lemma pointOfClosedPoint_apply (a : _) : pointOfClosedPoint f x hx a = x := by simp [pointOfClosedPoint] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `k` is algebraically closed, then the closed points of `X` are in bijection with the `k`-points of `X`. -/ @@ -85,6 +86,7 @@ def pointEquivClosedPoint : rw [reassoc_of% Scheme.descResidueField_stalkClosedPointTo_fromSpecResidueField, p.2] right_inv x := by simp +set_option backward.isDefEq.respectTransparency.types false in lemma ext_of_apply_closedPoint_eq {f g : Spec (.of K) ⟶ X} (h : X ⟶ Spec (.of K)) [LocallyOfFiniteType h] @@ -92,6 +94,7 @@ lemma ext_of_apply_closedPoint_eq (H : f (IsLocalRing.closedPoint K) = g (IsLocalRing.closedPoint K)) : f = g := congr($((pointEquivClosedPoint h).injective (a₁ := ⟨f, hf⟩) (a₂ := ⟨g, hg⟩) (Subtype.ext H)).1) +set_option backward.isDefEq.respectTransparency.types false in /-- Let `X` and `Y` be locally of finite type `K`-schemes with `K` algebraically closed and `Y` separated over `K`. Suppose `X` is reduced, then two `K`-morphisms `f g : X ⟶ Y` are equal if they are equal on the closed points of a dense locally closed subset of `X`. -/ diff --git a/Mathlib/AlgebraicGeometry/Artinian.lean b/Mathlib/AlgebraicGeometry/Artinian.lean index 4fb8016f87be0c..f465a94b506c1e 100644 --- a/Mathlib/AlgebraicGeometry/Artinian.lean +++ b/Mathlib/AlgebraicGeometry/Artinian.lean @@ -131,6 +131,7 @@ theorem isLocallyArtinian_iff_openCover (𝒰 : X.OpenCover) : obtain ⟨i, x, rfl⟩ := 𝒰.exists_eq x simpa using (𝒰.f i).isOpenEmbedding.isOpenMap _ (isOpen_discrete {x}) +set_option backward.isDefEq.respectTransparency.types false in theorem isLocallyArtinian_iff_of_isOpenCover {ι : Type*} {U : ι → X.Opens} (hU : TopologicalSpace.IsOpenCover U) (hU' : ∀ i, IsAffineOpen (U i)) : IsLocallyArtinian X ↔ ∀ i, IsArtinianRing Γ(X, U i) := by @@ -141,6 +142,7 @@ theorem isLocallyArtinian_iff_of_isOpenCover {ι : Type*} {U : ι → X.Opens} instance (priority := low) {X : Scheme} [IsEmpty X] : IsLocallyArtinian X where +set_option backward.isDefEq.respectTransparency.types false in instance (priority := low) {X : Scheme} [DiscreteTopology X] [IsReduced X] : IsLocallyArtinian X := by wlog hX : Subsingleton X generalizing X diff --git a/Mathlib/AlgebraicGeometry/Birational/RationalMap.lean b/Mathlib/AlgebraicGeometry/Birational/RationalMap.lean index 9f67f767fa06f7..7ad32e7d19653e 100644 --- a/Mathlib/AlgebraicGeometry/Birational/RationalMap.lean +++ b/Mathlib/AlgebraicGeometry/Birational/RationalMap.lean @@ -89,10 +89,12 @@ set_option backward.defeqAttrib.useBackward true in lemma restrict_id (f : X.PartialMap Y) : f.restrict f.domain f.dense_domain le_rfl = f := by ext1 <;> simp [restrict_domain] +set_option backward.isDefEq.respectTransparency.types false in lemma restrict_id_hom (f : X.PartialMap Y) : (f.restrict f.domain f.dense_domain le_rfl).hom = f.hom := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma restrict_restrict (f : X.PartialMap Y) @@ -101,6 +103,7 @@ lemma restrict_restrict (f : X.PartialMap Y) (f.restrict U hU hU').restrict V hV hV' = f.restrict V hV (hV'.trans hU') := by ext1 <;> simp [restrict_domain] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma restrict_restrict_hom (f : X.PartialMap Y) (U : X.Opens) (hU : Dense (U : Set X)) (hU' : U ≤ f.domain) @@ -137,6 +140,7 @@ lemma isOver_iff [X.Over S] [Y.Over S] {f : X.PartialMap Y} : f.IsOver S ↔ (f.compHom (Y ↘ S)).hom = f.domain.ι ≫ X ↘ S := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isOver_iff_eq_restrict [X.Over S] [Y.Over S] {f : X.PartialMap Y} : f.IsOver S ↔ f.compHom (Y ↘ S) = (X ↘ S).toPartialMap.restrict _ f.dense_domain (by simp) := by @@ -214,6 +218,7 @@ lemma fromSpecStalkOfMem_compHom (f : X.PartialMap Y) (g : Y ⟶ Z) (x) (hx) : (f.compHom g).fromSpecStalkOfMem (x := x) hx = f.fromSpecStalkOfMem hx ≫ g := by simp [fromSpecStalkOfMem] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma fromSpecStalkOfMem_toPartialMap (f : X ⟶ Y) (x) : @@ -243,6 +248,7 @@ lemma equivalence_rel : Equivalence (@Scheme.PartialMap.equiv X Y) where instance : Setoid (X.PartialMap Y) := ⟨@PartialMap.equiv X Y, equivalence_rel⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma restrict_equiv (f : X.PartialMap Y) (U : X.Opens) (hU : Dense (U : Set X)) (hU' : U ≤ f.domain) : (f.restrict U hU hU').equiv f := @@ -307,6 +313,7 @@ lemma equiv_iff_of_domain_eq_of_isSeparated [X.Over S] [Y.Over S] [IsReduced X] obtain rfl : Uf = Ug := hfg simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A partial map from a reduced scheme to a separated scheme is equivalent to a morphism if and only if it is equal to the restriction of the morphism. -/ @@ -377,6 +384,7 @@ lemma RationalMap.exists_partialMap_over [X.Over S] [Y.Over S] (f : X ⤏ Y) [f. ∃ g : X.PartialMap Y, g.IsOver S ∧ g.toRationalMap = f := IsOver.exists_partialMap_over +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The composition of a rational map and a morphism on the right. -/ def RationalMap.compHom (f : X ⤏ Y) (g : Y ⟶ Z) : X ⤏ Z := by @@ -405,6 +413,7 @@ lemma PartialMap.exists_restrict_isOver [X.Over S] [Y.Over S] (f : X.PartialMap obtain ⟨U, hU, hUl, hUr, e⟩ := PartialMap.toRationalMap_eq_iff.mp hf₂ exact ⟨U, hU, hUr, by rw [IsOver, ← e]; infer_instance⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma RationalMap.isOver_iff [X.Over S] [Y.Over S] {f : X ⤏ Y} : f.IsOver S ↔ f.compHom (Y ↘ S) = (X ↘ S).toRationalMap := by @@ -469,6 +478,7 @@ lemma RationalMap.eq_of_fromFunctionField_eq [IsIntegral X] (f g : X.RationalMap refine PartialMap.toRationalMap_eq_iff.mpr ?_ exact PartialMap.equiv_of_fromSpecStalkOfMem_eq _ _ _ _ H +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `S`-schemes `X` and `Y` such that `Y` is locally of finite type and `X` is integral, @@ -566,6 +576,7 @@ lemma PartialMap.toPartialMap_toRationalMap_restrict [IsReduced X] [Y.IsSeparate (toRationalMap_eq_iff.mp H.choose_spec.1) exact ((ext_iff _ _).mp this.symm).choose_spec.symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma RationalMap.toRationalMap_toPartialMap [IsReduced X] [Y.IsSeparated] diff --git a/Mathlib/AlgebraicGeometry/Cover/Directed.lean b/Mathlib/AlgebraicGeometry/Cover/Directed.lean index fe9840a3d15876..121b3fdc57af59 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Directed.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Directed.lean @@ -228,6 +228,7 @@ lemma map_glueMorphismsOfLocallyDirected {Y : Scheme.{u}} (g : ∀ i, 𝒰.X i 𝒰.f i ≫ 𝒰.glueMorphismsOfLocallyDirected g h = g i := by simp [glueMorphismsOfLocallyDirected] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `𝒰` is an open cover of `X` that is locally directed, `X` is the colimit of the components of `𝒰`. -/ @@ -258,9 +259,10 @@ lemma map_glueMorphismsOverOfLocallyDirected_left {S : Scheme.{u}} {X : Over S} end OpenCover +set_option backward.isDefEq.respectTransparency.types false in /-- If `𝒰` is an open cover such that the images of the components form a basis of the topology of `X`, `𝒰` is directed by the ordering of subset inclusion of the images. -/ -@[implicit_reducible] +@[instance_reducible] def Cover.LocallyDirected.ofIsBasisOpensRange {𝒰 : X.OpenCover} [Preorder 𝒰.I₀] (hle : ∀ {i j : 𝒰.I₀}, i ≤ j ↔ (𝒰.f i).opensRange ≤ (𝒰.f j).opensRange) (H : TopologicalSpace.Opens.IsBasis (Set.range <| fun i ↦ (𝒰.f i).opensRange)) : @@ -293,6 +295,7 @@ lemma Cover.LocallyDirected.ofIsBasisOpensRange_le_iff (i j : 𝒰.I₀) : letI := Cover.LocallyDirected.ofIsBasisOpensRange hle H i ≤ j ↔ (𝒰.f i).opensRange ≤ (𝒰.f j).opensRange := hle +set_option backward.isDefEq.respectTransparency.types false in lemma Cover.LocallyDirected.ofIsBasisOpensRange_trans {i j : 𝒰.I₀} : letI := Cover.LocallyDirected.ofIsBasisOpensRange hle H (hij : i ≤ j) → 𝒰.trans (homOfLE hij) = IsOpenImmersion.lift (𝒰.f j) (𝒰.f i) (hle.mp hij) := @@ -317,12 +320,14 @@ def directedAffineCover : X.OpenCover where instance : Preorder X.directedAffineCover.I₀ := inferInstanceAs <| Preorder X.affineOpens +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : Scheme.Cover.LocallyDirected X.directedAffineCover := .ofIsBasisOpensRange (by intros; simp; rfl) <| by convert! X.isBasis_affineOpens simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma directedAffineCover_trans {U V : X.affineOpens} (hUV : U ≤ V) : Cover.trans X.directedAffineCover (homOfLE hUV) = X.homOfLE hUV := rfl diff --git a/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean b/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean index 533fbe95d15a9b..fe84c8700dc990 100644 --- a/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean +++ b/Mathlib/AlgebraicGeometry/Cover/MorphismProperty.lean @@ -151,8 +151,12 @@ def Cover.copy [P.RespectsIso] {X : Scheme.{u}} (𝒰 : X.Cover (precoverage P)) intro i exact 𝒰.map_prop _ +-- `respectTransparency false` is needed for `simps!`. +-- Consider making implicit-reducible: +-- `Precoverage.ZeroHypercover.bind`, `Cover.mkOfCovers`, `coverOfIso` +set_option backward.isDefEq.respectTransparency false in /-- The pushforward of a cover along an isomorphism. -/ -@[simps! I₀ X f] +@[simps! I₀ X f, implicit_reducible] def Cover.pushforwardIso [P.RespectsIso] [P.ContainsIdentities] [P.IsStableUnderComposition] {X Y : Scheme.{u}} (𝒰 : Cover.{v} (precoverage P) X) (f : X ⟶ Y) [IsIso f] : Cover.{v} (precoverage P) Y := diff --git a/Mathlib/AlgebraicGeometry/Cover/Open.lean b/Mathlib/AlgebraicGeometry/Cover/Open.lean index 722cb124e5be01..219f5e6a893662 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Open.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Open.lean @@ -296,6 +296,7 @@ theorem affineBasisCover_map_range (X : Scheme.{u}) (x : X) congr exact (PrimeSpectrum.localization_away_comap_range (Localization.Away r) r :) +set_option backward.isDefEq.respectTransparency.types false in theorem affineBasisCover_is_basis (X : Scheme.{u}) : TopologicalSpace.IsTopologicalBasis {x : Set X | diff --git a/Mathlib/AlgebraicGeometry/Cover/Over.lean b/Mathlib/AlgebraicGeometry/Cover/Over.lean index 6c01bf3df1f520..12498f90327b2d 100644 --- a/Mathlib/AlgebraicGeometry/Cover/Over.lean +++ b/Mathlib/AlgebraicGeometry/Cover/Over.lean @@ -89,6 +89,7 @@ def Cover.pullbackCoverOver : W.Cover (precoverage P) where instance (j : 𝒰.I₀) : ((𝒰.pullbackCoverOver S f).X j).Over S where hom := (pullback (f.asOver S) ((𝒰.f j).asOver S)).hom +set_option backward.isDefEq.respectTransparency.types false in instance : (𝒰.pullbackCoverOver S f).Over S where isOver_map j := { comp_over := by exact Over.w (pullback.fst (f.asOver S) ((𝒰.f j).asOver S)) } @@ -115,6 +116,7 @@ def Cover.pullbackCoverOver' : W.Cover (precoverage P) where instance (j : 𝒰.I₀) : ((𝒰.pullbackCoverOver' S f).X j).Over S where hom := (pullback ((𝒰.f j).asOver S) (f.asOver S)).hom +set_option backward.isDefEq.respectTransparency.types false in instance : (𝒰.pullbackCoverOver' S f).Over S where isOver_map j := { comp_over := by exact Over.w (pullback.snd ((𝒰.f j).asOver S) (f.asOver S)) } @@ -153,6 +155,7 @@ instance (j : 𝒰.I₀) : ((𝒰.pullbackCoverOverProp S f hX hW hQ).X j).Over hom := (pullback (f.asOverProp (hX := hW) (hY := hX) S) ((𝒰.f j).asOverProp (hX := hQ j) (hY := hX) S)).hom +set_option backward.isDefEq.respectTransparency.types false in instance : (𝒰.pullbackCoverOverProp S f hX hW hQ).Over S where isOver_map j := { comp_over := by exact (pullback.fst (f.asOverProp S) ((𝒰.f j).asOverProp S)).w } @@ -185,6 +188,7 @@ instance (j : 𝒰.I₀) : ((𝒰.pullbackCoverOverProp' S f hX hW hQ).X j).Over hom := (pullback ((𝒰.f j).asOverProp (hX := hQ j) (hY := hX) S) (f.asOverProp (hX := hW) (hY := hX) S)).hom +set_option backward.isDefEq.respectTransparency.types false in instance : (𝒰.pullbackCoverOverProp' S f hX hW hQ).Over S where isOver_map j := { comp_over := by exact (pullback.snd ((𝒰.f j).asOverProp S) (f.asOverProp S)).w } @@ -198,6 +202,7 @@ variable {X : Scheme.{u}} (𝒰 : X.Cover (precoverage P)) (𝒱 : ∀ x, (𝒰. instance (j : (𝒰.bind 𝒱).I₀) : ((𝒰.bind 𝒱).X j).Over S := inferInstanceAs <| ((𝒱 j.1).X j.2).Over S +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {X : Scheme.{u}} (𝒰 : X.Cover (precoverage P)) (𝒱 : ∀ x, (𝒰.X x).Cover (precoverage P)) [X.Over S] [𝒰.Over S] [∀ x, (𝒱 x).Over S] : Cover.Over S (𝒰.bind 𝒱) where diff --git a/Mathlib/AlgebraicGeometry/Cover/QuasiCompact.lean b/Mathlib/AlgebraicGeometry/Cover/QuasiCompact.lean index ea345eee74d357..415ab1694207ed 100644 --- a/Mathlib/AlgebraicGeometry/Cover/QuasiCompact.lean +++ b/Mathlib/AlgebraicGeometry/Cover/QuasiCompact.lean @@ -144,6 +144,7 @@ instance of_finite {𝒰 : S.Cover K} [Scheme.JointlySurjective K] refine .of_finite_of_isSpectralMap (fun i ↦ (𝒰.f i).isSpectralMap) ?_ U.2 hU.isCompact exact (fun x _ ↦ ⟨𝒰.idx x, 𝒰.covers x⟩) +set_option backward.isDefEq.respectTransparency.types false in instance [IsAffine S] {P : MorphismProperty Scheme.{u}} (𝒰 : S.AffineCover P) [Finite 𝒰.I₀] : QuasiCompactCover 𝒰.cover.toPreZeroHypercover := haveI : Finite 𝒰.cover.I₀ := ‹_› diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean index 942de0e5a8d33f..1a30a8e66ba8b7 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Formula.lean @@ -109,7 +109,11 @@ variable (W') in `W`. This depends on `W`, and has argument order: `x`, `y`. -/ -@[simp] +-- Without this `implicit_reducible` attribute, `simpNF` gives a linter error on `slope_of_Y_eq` +-- because of a nonconfluence: `negY` can be unfolded on the LHS, which prevents discharging the +-- side condition of `slope_of_Y_eq` -- except if `negY` is implicit-reducible. +-- So this attribute improves the confluence of `simp`. +@[simp, implicit_reducible] def negY (x y : R) : R := -y - W'.a₁ * x - W'.a₃ diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean index f52f7e4aee8dac..f085140438e73f 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean @@ -118,6 +118,7 @@ protected noncomputable def basis : Basis (Fin 2) R[X] W'.CoordinateRing := (subsingleton_or_nontrivial R).by_cases (fun _ => default) fun _ => (AdjoinRoot.powerBasis' monic_polynomial).basis.reindex <| finCongr natDegree_polynomial +set_option backward.isDefEq.respectTransparency.types false in lemma basis_apply (n : Fin 2) : CoordinateRing.basis W' n = (AdjoinRoot.powerBasis' monic_polynomial).gen ^ (n : ℕ) := by classical @@ -241,6 +242,7 @@ variable (W') in noncomputable def XYIdeal (x : R) (y : R[X]) : Ideal W'.CoordinateRing := .span {XClass W' x, YClass W' y} +set_option backward.isDefEq.respectTransparency.types false in /-- The `R`-algebra isomorphism from `R[W] / ⟨X - x, Y - y(X)⟩` to `R` obtained by evaluation at some `y(X)` in `R[X]` and at some `x` in `R` provided that `W(x, y(x)) = 0`. -/ noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W'.polynomial.eval y).eval x = 0) : @@ -709,6 +711,7 @@ lemma add_of_X_ne' {x₁ x₂ y₁ y₂ : F} {h₁ : W.Nonsingular x₁ y₁} {h some _ _ h₁ + some _ _ h₂ = -some _ _ (nonsingular_negAdd h₁ h₂ fun hxy => hx hxy.left) := add_of_X_ne hx +set_option backward.isDefEq.respectTransparency.types false in /-- The group homomorphism mapping a nonsingular affine point `(x, y)` of a Weierstrass curve `W` to the class of the non-zero fractional ideal `⟨X - x, Y - y⟩` in the ideal class group of `F[W]`. -/ @[simps] diff --git a/Mathlib/AlgebraicGeometry/Fiber.lean b/Mathlib/AlgebraicGeometry/Fiber.lean index bb0a2929f09ea1..669c34a345042a 100644 --- a/Mathlib/AlgebraicGeometry/Fiber.lean +++ b/Mathlib/AlgebraicGeometry/Fiber.lean @@ -90,6 +90,7 @@ lemma Scheme.Hom.range_fiberι (f : X ⟶ Y) (y : Y) : Set.range (f.fiberι y) = f ⁻¹' {y} := by simp [fiber, fiberι, Scheme.Pullback.range_fst, Scheme.range_fromSpecResidueField] +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (y : Y) : IsPreimmersion (f.fiberι y) := MorphismProperty.pullback_fst _ _ inferInstance @@ -114,6 +115,7 @@ def Scheme.Hom.asFiber (f : X ⟶ Y) (x : X) : f.fiber (f x) := lemma Scheme.Hom.fiberι_asFiber (f : X ⟶ Y) (x : X) : f.fiberι _ (f.asFiber x) = x := f.fiberι_fiberHomeo_symm _ _ +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) [QuasiCompact f] (y : Y) : CompactSpace (f.fiber y) := haveI : QuasiCompact (f.fiberToSpecResidueField y) := MorphismProperty.pullback_snd _ _ inferInstance @@ -127,11 +129,13 @@ lemma Scheme.Hom.isCompact_preimage_singleton (f : X ⟶ Y) [QuasiCompact f] (y @[deprecated (since := "2026-02-05")] alias QuasiCompact.isCompact_preimage_singleton := Scheme.Hom.isCompact_preimage_singleton +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) [IsAffineHom f] (y : Y) : IsAffine (f.fiber y) := haveI : IsAffineHom (f.fiberToSpecResidueField y) := MorphismProperty.pullback_snd _ _ inferInstance isAffine_of_isAffineHom (f.fiberToSpecResidueField y) +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (y : Y) [LocallyOfFiniteType f] : JacobsonSpace (f.fiber y) := have : LocallyOfFiniteType (f.fiberToSpecResidueField y) := MorphismProperty.pullback_snd _ _ inferInstance diff --git a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean index 53e9b03f6e29ac..aa0d42e7e47967 100644 --- a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean +++ b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean @@ -125,6 +125,7 @@ theorem isUnit_res_toΓSpecMapBasicOpen : IsUnit (X.toToΓSpecMapBasicOpen r r) rw [← CommRingCat.comp_apply, ← Functor.map_comp] congr +set_option backward.isDefEq.respectTransparency.types false in /-- Define the sheaf hom on individual basic opens for the unit. -/ def toΓSpecCApp : (structureSheaf <| Γ.obj <| op X).obj.obj (op <| basicOpen r) ⟶ @@ -191,6 +192,7 @@ theorem toΓSpecSheafedSpace_app_eq : X.toΓSpecSheafedSpace.hom.c.app (op (basicOpen r)) = X.toΓSpecCApp r := by apply TopCat.Sheaf.extend_hom_app _ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] theorem toΓSpecSheafedSpace_app_spec (r : Γ.obj (op X)) : CommRingCat.ofHom (algebraMap (Γ.obj (op X)) _) ≫ X.toΓSpecSheafedSpace.hom.c.app (op (basicOpen r)) = @@ -252,6 +254,7 @@ lemma toΓSpec_preimage_zeroLocus_eq {X : LocallyRingedSpace.{u}} rw [← PrimeSpectrum.zeroLocus_iUnion₂] simp +set_option backward.isDefEq.respectTransparency.types false in theorem comp_ring_hom_ext {X : LocallyRingedSpace.{u}} {R : CommRingCat.{u}} {f : R ⟶ Γ.obj (op X)} {β : X ⟶ Spec.locallyRingedSpaceObj R} (w : X.toΓSpec.base ≫ (Spec.locallyRingedSpaceMap f).base = β.base) @@ -269,6 +272,7 @@ theorem comp_ring_hom_ext {X : LocallyRingedSpace.{u}} {R : CommRingCat.{u}} {f erw [toΓSpecSheafedSpace_app_spec, ← X.presheaf.map_comp] exact h r +set_option backward.isDefEq.respectTransparency.types false in /-- `toSpecΓ _` is an isomorphism so these are mutually two-sided inverses. -/ theorem Γ_Spec_left_triangle : toSpecΓ (Γ.obj (op X)) ≫ X.toΓSpec.c.app (op ⊤) = 𝟙 _ := by unfold toSpecΓ @@ -303,6 +307,7 @@ def identityToΓSpec : 𝟭 LocallyRingedSpace.{u} ⟶ Γ.rightOp ⋙ Spec.toLoc namespace ΓSpec +set_option backward.isDefEq.respectTransparency.types false in theorem left_triangle (X : LocallyRingedSpace) : SpecΓIdentity.inv.app (Γ.obj (op X)) ≫ (identityToΓSpec.app X).c.app (op ⊤) = 𝟙 _ := X.Γ_Spec_left_triangle @@ -333,27 +338,31 @@ def locallyRingedSpaceAdjunction : Γ.rightOp ⊣ Spec.toLocallyRingedSpace.{u} Quiver.Hom.unop_op, NatIso.op_inv, NatTrans.op_app, SpecΓIdentity_inv_app] exact congr_arg Quiver.Hom.op (left_triangle X) right_triangle_components R := by - simp only [Functor.id_obj, NatIso.op_inv, NatTrans.op_app, SpecΓIdentity_inv_app, - Spec.toLocallyRingedSpace_map] + simp only [Functor.id_obj, NatIso.op_inv, NatTrans.op_app, SpecΓIdentity_inv_app] exact right_triangle R.unop +set_option backward.isDefEq.respectTransparency.types false in lemma toSpecΓ_unop (R : CommRingCatᵒᵖ) : AlgebraicGeometry.toSpecΓ (Opposite.unop R) = CommRingCat.ofHom (algebraMap _ _) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `@[simp]`-normal form of `locallyRingedSpaceAdjunction_counit_app'`. -/ @[simp] lemma toSpecΓ_of (R : Type u) [CommRing R] : AlgebraicGeometry.toSpecΓ (CommRingCat.of R) = CommRingCat.ofHom (algebraMap _ _) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma locallyRingedSpaceAdjunction_counit_app (R : CommRingCatᵒᵖ) : locallyRingedSpaceAdjunction.counit.app R = (CommRingCat.ofHom (algebraMap _ _)).op := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma locallyRingedSpaceAdjunction_counit_app' (R : Type u) [CommRing R] : locallyRingedSpaceAdjunction.counit.app (op <| CommRingCat.of R) = (CommRingCat.ofHom (algebraMap _ _)).op := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma unop_locallyRingedSpaceAdjunction_counit_app' (R : Type u) [CommRing R] : (locallyRingedSpaceAdjunction.counit.app (op <| CommRingCat.of R)).unop = (CommRingCat.ofHom (algebraMap _ _)) := rfl @@ -443,6 +452,7 @@ instance isIso_adjunction_counit : IsIso ΓSpec.adjunction.counit := by end ΓSpec +set_option backward.isDefEq.respectTransparency.types false in theorem Scheme.toSpecΓ_apply (X : Scheme.{u}) (x) : Scheme.toSpecΓ X x = Spec.map (X.presheaf.Γgerm x) (IsLocalRing.closedPoint _) := rfl diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean b/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean index b6c245a2f37e03..e9deefedb33d94 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean @@ -57,6 +57,7 @@ lemma geometrically_eq_universally (P : ObjectProperty Scheme.{u}) : apply h.flip.of_iso (.refl _) (.refl _) W.isoSpec (.refl _) <;> simp · exact hf _ _ _ h.flip inferInstance inferInstance +set_option backward.isDefEq.respectTransparency.types false in lemma geometrically_inf (P Q : ObjectProperty Scheme.{u}) : geometrically (P ⊓ Q) = geometrically P ⊓ geometrically Q := by simp only [geometrically_eq_universally, ← MorphismProperty.universally_inf] @@ -65,6 +66,7 @@ lemma geometrically_inf (P Q : ObjectProperty Scheme.{u}) : variable (P : ObjectProperty Scheme.{u}) +set_option backward.isDefEq.respectTransparency.types false in instance : (geometrically P).IsStableUnderBaseChange := by rw [geometrically_eq_universally] infer_instance diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Connected.lean b/Mathlib/AlgebraicGeometry/Geometrically/Connected.lean index a2d29f1a5e128c..060f361329b5ed 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Connected.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Connected.lean @@ -47,15 +47,18 @@ lemma GeometricallyConnected.eq_geometrically : instance : IsStableUnderBaseChange @GeometricallyConnected := GeometricallyConnected.eq_geometrically ▸ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyConnected g] : GeometricallyConnected (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyConnected f] : GeometricallyConnected (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance instance (V : S.Opens) [GeometricallyConnected f] : GeometricallyConnected (f ∣_ V) := MorphismProperty.of_isPullback (isPullback_morphismRestrict ..).flip ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (s : S) [GeometricallyConnected f] : GeometricallyConnected (f.fiberToSpecResidueField s) := MorphismProperty.pullback_snd _ _ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Integral.lean b/Mathlib/AlgebraicGeometry/Geometrically/Integral.lean index 9755185a422c12..2dc55ece5e133f 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Integral.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Integral.lean @@ -66,15 +66,18 @@ lemma GeometricallyIntegral.of_geometricallyReduced_of_geometricallyIrreducible instance : IsStableUnderBaseChange @GeometricallyIntegral := GeometricallyIntegral.eq_geometrically ▸ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyIntegral g] : GeometricallyIntegral (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyIntegral f] : GeometricallyIntegral (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance instance (V : S.Opens) [GeometricallyIntegral f] : GeometricallyIntegral (f ∣_ V) := MorphismProperty.of_isPullback (isPullback_morphismRestrict ..).flip ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (s : S) [GeometricallyIntegral f] : GeometricallyIntegral (f.fiberToSpecResidueField s) := MorphismProperty.pullback_snd _ _ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Irreducible.lean b/Mathlib/AlgebraicGeometry/Geometrically/Irreducible.lean index d52551a96300e8..0a421c973f5ea2 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Irreducible.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Irreducible.lean @@ -49,15 +49,18 @@ lemma GeometricallyIrreducible.eq_geometrically : instance : IsStableUnderBaseChange @GeometricallyIrreducible := GeometricallyIrreducible.eq_geometrically ▸ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyIrreducible g] : GeometricallyIrreducible (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyIrreducible f] : GeometricallyIrreducible (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance instance (V : S.Opens) [GeometricallyIrreducible f] : GeometricallyIrreducible (f ∣_ V) := MorphismProperty.of_isPullback (isPullback_morphismRestrict ..).flip ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (s : S) [GeometricallyIrreducible f] : GeometricallyIrreducible (f.fiberToSpecResidueField s) := MorphismProperty.pullback_snd _ _ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Reduced.lean b/Mathlib/AlgebraicGeometry/Geometrically/Reduced.lean index 4ec04afaef6caf..5934193fc589df 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Reduced.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Reduced.lean @@ -51,15 +51,18 @@ lemma GeometricallyReduced.eq_geometrically : instance : IsStableUnderBaseChange @GeometricallyReduced := GeometricallyReduced.eq_geometrically ▸ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyReduced g] : GeometricallyReduced (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [GeometricallyReduced f] : GeometricallyReduced (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance instance (V : S.Opens) [GeometricallyReduced f] : GeometricallyReduced (f ∣_ V) := MorphismProperty.of_isPullback (isPullback_morphismRestrict ..).flip ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (s : S) [GeometricallyReduced f] : GeometricallyReduced (f.fiberToSpecResidueField s) := MorphismProperty.pullback_snd _ _ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Gluing.lean b/Mathlib/AlgebraicGeometry/Gluing.lean index 2c642da6af605a..2be5518b2eb191 100644 --- a/Mathlib/AlgebraicGeometry/Gluing.lean +++ b/Mathlib/AlgebraicGeometry/Gluing.lean @@ -140,6 +140,7 @@ def gluedScheme : Scheme := by exact Set.mem_image_of_mem _ ⟨z, hz⟩ · infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : CreatesColimit 𝖣.diagram.multispan forgetToLocallyRingedSpace := createsColimitOfFullyFaithfulOfIso D.gluedScheme (HasColimit.isoOfNatIso (𝖣.diagramIso forgetToLocallyRingedSpace).symm) @@ -205,6 +206,7 @@ def vPullbackConeIsLimit (i j : D.J) : IsLimit (D.vPullbackCone i j) := local notation "D_" => TopCat.GlueData.toGlueData <| D.toLocallyRingedSpaceGlueData.toSheafedSpaceGlueData.toPresheafedSpaceGlueData.toTopGlueData +set_option backward.isDefEq.respectTransparency.types false in /-- The underlying topological space of the glued scheme is isomorphic to the gluing of the underlying spaces -/ def isoCarrier : @@ -239,6 +241,7 @@ See `AlgebraicGeometry.Scheme.GlueData.ι_eq_iff`. -/ def Rel (a b : Σ i, ((D.U i).carrier : Type _)) : Prop := ∃ x : (D.V (a.1, b.1)).carrier, D.f _ _ x = a.2 ∧ (D.t _ _ ≫ D.f _ _) x = b.2 +set_option backward.isDefEq.respectTransparency.types false in theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) : 𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by refine Iff.trans ?_ @@ -250,6 +253,7 @@ theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) : rfl -- `rfl` was not needed before https://github.com/leanprover-community/mathlib4/pull/13170 · infer_instance +set_option backward.isDefEq.respectTransparency.types false in theorem isOpen_iff (U : Set D.glued.carrier) : IsOpen U ↔ ∀ i, IsOpen (D.ι i ⁻¹' U) := by rw [← (TopCat.homeoOfIso D.isoCarrier.symm).isOpen_preimage, TopCat.GlueData.isOpen_iff] apply forall_congr' @@ -345,6 +349,7 @@ def gluedCover : Scheme.GlueData.{u} where cocycle x y z := glued_cover_cocycle 𝒰 x y z f_open _ := inferInstance +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical morphism from the gluing of an open cover of `X` into `X`. This is an isomorphism, as witnessed by an `IsIso` instance. -/ def fromGlued : 𝒰.gluedCover.glued ⟶ X := by @@ -358,6 +363,7 @@ def fromGlued : 𝒰.gluedCover.glued ⟶ X := by theorem ι_fromGlued (x : 𝒰.I₀) : 𝒰.gluedCover.ι x ≫ 𝒰.fromGlued = 𝒰.f x := Multicoequalizer.π_desc _ _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem fromGlued_injective : Function.Injective 𝒰.fromGlued := by intro x y h obtain ⟨i, x, rfl⟩ := 𝒰.gluedCover.ι_jointly_surjective x @@ -387,6 +393,7 @@ instance (x : 𝒰.gluedCover.glued.carrier) : rw [this] infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem isOpenMap_fromGlued : IsOpenMap 𝒰.fromGlued := by intro U hU @@ -408,6 +415,7 @@ theorem isOpenMap_fromGlued : IsOpenMap 𝒰.fromGlued := by theorem isOpenEmbedding_fromGlued : IsOpenEmbedding 𝒰.fromGlued := .of_continuous_injective_isOpenMap (by fun_prop) 𝒰.fromGlued_injective 𝒰.isOpenMap_fromGlued +set_option backward.isDefEq.respectTransparency.types false in instance : Epi 𝒰.fromGlued.base := by rw [TopCat.epi_iff_surjective] intro x @@ -428,6 +436,7 @@ instance : IsIso 𝒰.fromGlued := apply PresheafedSpace.IsOpenImmersion.to_iso isIso_of_reflects_iso _ F +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given an open cover of `X`, and a morphism `𝒰.X x ⟶ Y` for each open subscheme in the cover, such that these morphisms are compatible in the intersection (pullback), we may glue the morphisms @@ -616,6 +625,7 @@ def tAux (i j : J) : (V F i j).toScheme ⟶ F.obj j := dsimp [Scheme.Opens.iSupOpenCover] apply fst_inv_eq_snd_inv F +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma homOfLE_tAux (i j : J) {k : J} (fi : k ⟶ i) (fj : k ⟶ j) : (F.obj i).homOfLE (le_iSup_of_le ⟨k, fi, fj⟩ le_rfl) ≫ @@ -699,6 +709,7 @@ def glueData : Scheme.GlueData where ← Iso.inv_comp_eq, Scheme.Hom.isoOpensRange_inv_comp] exact (Scheme.homOfLE_ι _ _).symm +set_option backward.isDefEq.respectTransparency.types false in lemma glueDataι_naturality {i j : Shrink.{u} J} (f : ↓i ⟶ ↓j) : F.map f ≫ (glueData F).ι j = (glueData F).ι i := by have : IsIso (V F ↓i ↓j).ι := by @@ -714,6 +725,7 @@ lemma glueDataι_naturality {i j : Shrink.{u} J} (f : ↓i ⟶ ↓j) : convert! Category.id_comp _ simp [← cancel_mono (Opens.ι _), V] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- (Implementation detail) The cocone associated to a locally directed diagram. @@ -810,6 +822,7 @@ def openCover : (colimit F).OpenCover := change colimit.ι F i = _ ≫ (glueData F).ι (equivShrink J i) ≫ _ simp [← Category.assoc, ← Iso.comp_inv_eq, cocone] +set_option backward.isDefEq.respectTransparency.types false in instance (i) : IsOpenImmersion (colimit.ι F i) := inferInstanceAs (IsOpenImmersion ((openCover F).f i)) diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean index c03fc7a53b0c76..326c6749863c70 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean @@ -388,6 +388,7 @@ lemma support_antitone : Antitone (support (X := X)) := by J.coe_support_eq_eq_iInter_zeroLocus] exact Set.iInter_mono fun U ↦ X.zeroLocus_mono (h U) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma support_eq_bot_iff : support I = ⊥ ↔ I = ⊤ := by refine ⟨fun H ↦ top_le_iff.mp fun U ↦ ?_, by simp +contextual⟩ @@ -770,6 +771,7 @@ lemma Hom.range_subset_ker_support (f : X ⟶ Y) : lemma Hom.ker_eq_top_iff_isEmpty (f : X.Hom Y) : f.ker = ⊤ ↔ IsEmpty X := ⟨fun H ↦ by simpa [H] using f.range_subset_ker_support, fun _ ↦ ker_eq_top_of_isEmpty f⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma Hom.iInf_ker_openCover_map_comp_apply (f : X.Hom Y) [QuasiCompact f] (𝒰 : X.OpenCover) (U : Y.affineOpens) : ⨅ i, (𝒰.f i ≫ f).ker.ideal U = f.ker.ideal U := by @@ -840,6 +842,7 @@ lemma ker_ideal_of_isPullback_of_isOpenImmersion {X Y U V : Scheme.{u}} ← CommRingCat.hom_comp, this] simpa using (map_eq_zero_iff _ (ConcreteCategory.bijective_of_isIso e.inv).1).symm +set_option backward.isDefEq.respectTransparency.types false in lemma Hom.support_ker (f : X ⟶ Y) [QuasiCompact f] : f.ker.support = closure (Set.range f) := by apply subset_antisymm diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean index 19f0c8c31c1002..c2ba4d50739f43 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Functorial.lean @@ -100,6 +100,7 @@ lemma _root_.AlgebraicGeometry.isPullback_of_isClosedImmersion def map (I : X.IdealSheafData) (f : X ⟶ Y) : Y.IdealSheafData := (I.subschemeι ≫ f).ker +set_option backward.isDefEq.respectTransparency.types false in lemma le_map_iff_comap_le {I : X.IdealSheafData} {f : X ⟶ Y} {J : Y.IdealSheafData} : J ≤ I.map f ↔ J.comap f ≤ I := by constructor diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean index 5258a16c141d39..4bece7aa4b4d69 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean @@ -59,10 +59,12 @@ instance (U : X.affineOpens) : IsPreimmersion (I.glueDataObjι U) := (RingHom.surjectiveOnStalks_of_surjective Ideal.Quotient.mk_surjective) .comp _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma glueDataObjι_ι (U : X.affineOpens) : I.glueDataObjι U ≫ U.1.ι = Spec.map (CommRingCat.ofHom (Ideal.Quotient.mk _)) ≫ U.2.fromSpec := by rw [glueDataObjι, Category.assoc]; rfl +set_option backward.isDefEq.respectTransparency.types false in lemma ker_glueDataObjι_appTop (U : X.affineOpens) : RingHom.ker (I.glueDataObjι U).appTop.hom = (I.ideal U).comap U.1.topIso.hom.hom := by let φ : Γ(X, U) ⟶ CommRingCat.of (Γ(X, U) ⧸ I.ideal U) := @@ -78,6 +80,7 @@ lemma ker_glueDataObjι_appTop (U : X.affineOpens) : rw [← Scheme.Hom.appTop, U.2.isoSpec_inv_appTop, Category.assoc, Iso.inv_hom_id_assoc] simp only [Scheme.Opens.topIso_hom] +set_option backward.isDefEq.respectTransparency.types false in open scoped Set.Notation in lemma range_glueDataObjι (U : X.affineOpens) : Set.range (I.glueDataObjι U) = @@ -88,6 +91,7 @@ lemma range_glueDataObjι (U : X.affineOpens) : simp rfl +set_option backward.isDefEq.respectTransparency.types false in lemma range_glueDataObjι_ι (U : X.affineOpens) : Set.range (I.glueDataObjι U ≫ U.1.ι) = X.zeroLocus (U := U) (I.ideal U) ∩ U := by simp only [Scheme.Hom.comp_base, TopCat.coe_comp, Set.range_comp, range_glueDataObjι] @@ -333,6 +337,7 @@ private lemma ι_gluedTo (U : X.affineOpens) : I.glueData.ι U ≫ I.gluedTo = I.glueDataObjι U ≫ U.1.ι := Multicoequalizer.π_desc _ _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] private lemma glueDataObjMap_ι (U V : X.affineOpens) (h : U ≤ V) : @@ -384,6 +389,7 @@ lemma range_glueDataObjι_ι_eq_support_inter (U : X.affineOpens) : Set.range (I.glueDataObjι U ≫ U.1.ι) = (I.support : Set X) ∩ U := (I.range_glueDataObjι_ι U).trans (I.coe_support_inter U).symm +set_option backward.isDefEq.respectTransparency.types false in lemma range_gluedTo : Set.range I.gluedTo = I.support := by refine subset_antisymm (Set.range_subset_iff.mpr fun x ↦ ?_) ?_ · obtain ⟨ix, x : I.glueDataObj ix, rfl⟩ := @@ -427,6 +433,7 @@ private lemma glueDataObjIso_hom_restrict (U : X.affineOpens) : (I.glueDataObjIso U).hom ≫ I.gluedTo ∣_ ↑U = I.glueDataObjι U := by rw [← cancel_mono U.1.ι]; simp +set_option backward.isDefEq.respectTransparency.types false in instance : IsPreimmersion I.gluedTo := by rw [IsZariskiLocalAtTarget.iff_of_iSup_eq_top (P := @IsPreimmersion) _ (iSup_affineOpens_eq_top X)] @@ -460,6 +467,7 @@ def subschemeIso : I.subscheme ≅ I.glueData.glued := letI := IsOpenImmersion.isIso F asIso F +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion from the subscheme associated to an ideal sheaf. -/ noncomputable def subschemeι : I.subscheme ⟶ X := @@ -486,6 +494,7 @@ instance : QuasiCompact I.subschemeι := by lemma range_subschemeι : Set.range I.subschemeι = I.support := by simp [← range_gluedTo, I.subschemeι_def, Set.range_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in private lemma opensRange_glueData_ι_subschemeIso_inv (U : X.affineOpens) : (I.glueData.ι U ≫ I.subschemeIso.inv).opensRange = I.subschemeι ⁻¹ᵁ U := by @@ -507,6 +516,7 @@ def subschemeCover : I.subscheme.AffineOpenCover where (X.openCoverOfIsOpenCover _ (iSup_affineOpens_eq_top X)).covers x.1 exact (I.opensRange_glueData_ι_subschemeIso_inv U).ge hy +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma opensRange_subschemeCover_map (U : X.affineOpens) : (I.subschemeCover.f U).opensRange = I.subschemeι ⁻¹ᵁ U := @@ -619,6 +629,7 @@ lemma inclusion_subschemeι {I J : IdealSheafData X} (h : I ≤ J) : inclusion h ≫ I.subschemeι = J.subschemeι := J.subschemeCover.openCover.hom_ext _ _ fun _ ↦ by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp, reassoc] lemma inclusion_id (I : IdealSheafData X) : @@ -631,6 +642,7 @@ lemma inclusion_comp {I J K : IdealSheafData X} (h₁ : I ≤ J) (h₂ : J ≤ K inclusion h₂ ≫ inclusion h₁ = inclusion (h₁.trans h₂) := K.subschemeCover.openCover.hom_ext _ _ fun _ ↦ by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor taking an ideal sheaf to its associated subscheme. -/ @[simps] @@ -765,6 +777,7 @@ def kerAdjunction (Y : Scheme.{u}) : (subschemeFunctor Y).rightOp ⊣ Y.kerFunct counit.naturality _ _ _ := Quiver.Hom.unop_inj (by ext1; simp [← cancel_mono (subschemeι _)]) left_triangle_components I := Quiver.Hom.unop_inj (by ext1; simp [← cancel_mono (subschemeι _)]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : (IdealSheafData.subschemeFunctor Y).Full := have : IsIso Y.kerAdjunction.rightOp.counit := by diff --git a/Mathlib/AlgebraicGeometry/Limits.lean b/Mathlib/AlgebraicGeometry/Limits.lean index 7d557c41b1f71f..ce906d4ff37a3d 100644 --- a/Mathlib/AlgebraicGeometry/Limits.lean +++ b/Mathlib/AlgebraicGeometry/Limits.lean @@ -46,6 +46,50 @@ attribute [local instance] Opposite.small namespace AlgebraicGeometry +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + BinaryCofan.mk + Cocone.functoriality + Cocone.precompose + CommRingCat.piFan + CommRingCat.prodFan + ContinuousMap.comp + Discrete.rec + Fan.op + Functor.mapCocone + LocallyRingedSpace.comp + LocallyRingedSpace.forgetToSheafedSpace + LocallyRingedSpace.forgetToTop + MorphismProperty + Option.rec + PresheafedSpace.comp + Scheme.Cover.copy + Scheme.IsLocallyDirected.openCover + Scheme.Spec + Scheme.empty + Scheme.forget + Scheme.forgetToLocallyRingedSpace + Scheme.forgetToTop + Set + SheafedSpace.forget + Spec + Spec.locallyRingedSpaceObj + Spec.sheafedSpaceObj + Spec.topObj + Sum.elim + Sum.rec + TopCat.binaryCofan + WalkingPair.rec + WidePushoutShape.wideSpan + colimit.cocone + colimit.desc + colimit.isColimit + colimit.ι + getColimitCocone + getLimitCone + limit.cone + pair + /-- `Spec ℤ` is the terminal object in the category of schemes. -/ noncomputable def specZIsTerminal : IsTerminal (Spec <| .of ℤ) := @IsTerminal.isTerminalObj _ _ _ _ Scheme.Spec _ inferInstance @@ -75,7 +119,7 @@ instance {X : Scheme} : Subsingleton (X.Over (⊤_ Scheme)) := section Initial /-- The map from the empty scheme. -/ -@[simps] +@[local implicit_reducible, simps] def Scheme.emptyTo (X : Scheme.{u}) : ∅ ⟶ X := ⟨{ base := TopCat.ofHom ⟨fun x => PEmpty.elim x, by fun_prop⟩ c := { app := fun _ => CommRingCat.punitIsTerminal.from _ } }, fun x => PEmpty.elim x⟩ @@ -232,11 +276,12 @@ noncomputable instance [Small.{u} σ] : CoproductsOfShapeDisjoint Scheme.{u} σ instance : HasFiniteCoproducts Scheme.{u} where out := inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance : MonoCoprod Scheme.{u} := .mk' fun X Y ↦ ⟨.mk coprod.inl coprod.inr, coprodIsCoprod X Y, inferInstanceAs <| Mono coprod.inl⟩ /-- The cover of `∐ X` by the `Xᵢ`. -/ -@[simps!] +@[local implicit_reducible, simps!] noncomputable def sigmaOpenCover [Small.{u} σ] : (∐ g).OpenCover := (Scheme.IsLocallyDirected.openCover (Discrete.functor g)).copy σ g (Sigma.ι _) (discreteEquiv.symm) (fun _ ↦ Iso.refl _) (fun _ ↦ rfl) @@ -508,6 +553,7 @@ variable (R S : Type u) [CommRing R] [CommRing S] /-- The map `Spec R ⨿ Spec S ⟶ Spec (R × S)`. This is an isomorphism as witnessed by an `IsIso` instance provided below. -/ +@[local implicit_reducible] noncomputable def coprodSpec : Spec (.of R) ⨿ Spec (.of S) ⟶ Spec (.of <| R × S) := coprod.desc (Spec.map (CommRingCat.ofHom <| RingHom.fst _ _)) diff --git a/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean b/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean index d19ea817b170d3..7f0c6f5fbfccbc 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Sheaf.lean @@ -32,13 +32,55 @@ namespace AlgebraicGeometry.Scheme variable {X Y Z T : Scheme.{u}} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Bundled.of + Cat.of + Classical.choose + Classical.indefiniteDescription + Functor.leftAdjoint + Functor.sheafPushforwardContinuous + Hom.opensFunctor + InducedCategory + InducedCategory.homMk + IsOpenMap.functor + IsOpenMap.functorMap + LocallyDiscrete.mkPseudofunctor + ModuleCat.RestrictScalars.obj' + ModuleCat.restrictScalars + ObjectProperty.FullSubcategory.category._aux_1 + ObjectProperty.ι + Opens.map + PresheafOfModules.pushforward₀ + PresheafOfModules.pushforward₀Obj + PresheafOfModules.restrictScalars + PresheafOfModules.restrictScalarsObj + Quiver.Hom.op + Quiver.Hom.unop + Set + Set.image + SheafOfModules.forget + SheafedSpace.sheaf + TopCat.Presheaf.stalk + TopCat.Presheaf.stalkFunctor + TopCat.Sheaf + TopCat.instCategorySheaf._aux_1 + colim + colimit.cocone + getColimitCocone + inducedFunctor + pseudofunctorOfIsLocallyDiscrete + sheafCompose + variable (X) in /-- The category of sheaves of modules over a scheme. -/ +@[local implicit_reducible] def Modules := SheafOfModules.{u} X.ringCatSheaf namespace Modules /-- Morphisms between `𝒪ₓ`-modules. Use `Hom.app` to act on sections. -/ +@[local implicit_reducible] def Hom (M N : X.Modules) : Type u := SheafOfModules.Hom M N instance : Category X.Modules where @@ -56,6 +98,7 @@ variable (X) in /-- The forgetful functor from `𝒪ₓ`-modules to presheaves of modules. This is mostly useful to transport results from (pre)sheaves of modules to `𝒪ₓ`-modules and usually shouldn't be used directly when working with actual `𝒪ₓ`-modules. -/ +@[local implicit_reducible] def toPresheafOfModules : X.Modules ⥤ X.PresheafOfModules := SheafOfModules.forget _ /-- The forgetful functor from `𝒪ₓ`-modules to presheaves of modules is fully faithful. -/ @@ -69,6 +112,7 @@ instance : (toPresheafOfModules X).IsRightAdjoint := variable (X) in /-- The forgetful functor from `𝒪ₓ`-modules to presheaves of abelian groups. -/ +@[local implicit_reducible, local implicit_reducible] noncomputable def toPresheaf : X.Modules ⥤ TopCat.Presheaf Ab X := toPresheafOfModules X ⋙ PresheafOfModules.toPresheaf _ @@ -84,6 +128,7 @@ variable {M N K : X.Modules} {φ : M ⟶ N} {U V : X.Opens} section Presheaf /-- The underlying abelian presheaf of an `𝒪ₓ`-module. -/ +@[local implicit_reducible, local implicit_reducible] noncomputable def presheaf (M : X.Modules) : TopCat.Presheaf Ab X := M.1.presheaf /-- Notation for sections of a presheaf of module. -/ @@ -148,6 +193,7 @@ noncomputable section Functorial variable (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ T) /-- The pushforward functor for categories of sheaves of modules over schemes. -/ +@[local implicit_reducible, local implicit_reducible, local implicit_reducible] def pushforward : X.Modules ⥤ Y.Modules := SheafOfModules.pushforward f.toRingCatSheafHom @@ -163,10 +209,13 @@ lemma pushforward_obj_presheaf_map {U V : Y.Opens} (i : U ⟶ V) : lemma pushforward_map_app (φ : M ⟶ N) (U : Y.Opens) : ((pushforward f).map φ).app U = φ.app (f ⁻¹ᵁ U) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The pullback functor for categories of sheaves of modules over schemes. -/ +@[local implicit_reducible, local implicit_reducible] def pullback : Y.Modules ⥤ X.Modules := SheafOfModules.pullback f.toRingCatSheafHom +set_option backward.isDefEq.respectTransparency.types false in /-- The pullback functor for categories of sheaves of modules over schemes is left adjoint to the pushforward functor. -/ def pullbackPushforwardAdjunction : pullback f ⊣ pushforward f := @@ -177,9 +226,11 @@ section attribute [local instance] preservesBinaryBiproducts_of_preservesBinaryCoproducts preservesBinaryBiproducts_of_preservesBinaryProducts +set_option backward.isDefEq.respectTransparency.types false in instance : (pullback f).IsLeftAdjoint := (pullbackPushforwardAdjunction f).isLeftAdjoint instance : (pushforward f).IsRightAdjoint := (pullbackPushforwardAdjunction f).isRightAdjoint instance : (pushforward f).Additive := Functor.additive_of_preservesBinaryBiproducts _ +set_option backward.isDefEq.respectTransparency.types false in instance : (pullback f).Additive := Functor.additive_of_preservesBinaryBiproducts _ end @@ -193,12 +244,14 @@ def pushforwardId : pushforward (𝟙 X) ≅ 𝟭 _ := @[simp] lemma pushforwardId_hom_app_app : ((pushforwardId X).hom.app M).app U = 𝟙 _ := rfl @[simp] lemma pushforwardId_inv_app_app : ((pushforwardId X).inv.app M).app U = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in variable (X) in /-- The pullback of sheaves of modules by the identity morphism identifies to the identity functor. -/ def pullbackId : pullback (𝟙 X) ≅ 𝟭 _ := SheafOfModules.pullbackId _ +set_option backward.isDefEq.respectTransparency.types false in variable (X) in lemma conjugateEquiv_pullbackId_hom : conjugateEquiv .id (pullbackPushforwardAdjunction (𝟙 X)) (pullbackId X).hom = @@ -214,27 +267,33 @@ def pushforwardComp : @[simp] lemma pushforwardComp_hom_app_app (U) : ((pushforwardComp f g).hom.app M).app U = 𝟙 _ := rfl @[simp] lemma pushforwardComp_inv_app_app (U) : ((pushforwardComp f g).inv.app M).app U = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The composition of two pullback functors for sheaves of modules on schemes identify to the pullback for the composition. -/ def pullbackComp : pullback g ⋙ pullback f ≅ pullback (f ≫ g) := SheafOfModules.pullbackComp _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- Pushforwards along equal morphisms are isomorphic. -/ def pushforwardCongr {f g : X ⟶ Y} (hf : f = g) : pushforward f ≅ pushforward g := pushforwardNatIso _ (Opens.mapIso _ _ (hf ▸ rfl)) ≪≫ SheafOfModules.pushforwardCongr (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma pushforwardCongr_hom_app_app {f g : X ⟶ Y} (hf : f = g) (U : Y.Opens) : ((pushforwardCongr hf).hom.app M).app U = M.presheaf.map (eqToHom (hf ▸ rfl)).op := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma pushforwardCongr_inv_app_app {f g : X ⟶ Y} (hf : f = g) (U : Y.Opens) : ((pushforwardCongr hf).inv.app M).app U = M.presheaf.map (eqToHom (hf ▸ rfl)).op := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Inverse images along equal morphisms are isomorphic. -/ def pullbackCongr {f g : X ⟶ Y} (hf : f = g) : pullback f ≅ pullback g := eqToIso (hf ▸ rfl) +set_option backward.isDefEq.respectTransparency.types false in lemma conjugateEquiv_pullbackComp_inv : conjugateEquiv ((pullbackPushforwardAdjunction g).comp (pullbackPushforwardAdjunction f)) (pullbackPushforwardAdjunction (f ≫ g)) (pullbackComp f g).inv = @@ -297,7 +356,7 @@ a scheme `X` to the category `X.Modules` of sheaves of modules over `X`. these categories.) -/ @[simps! obj_obj map_l map_r map_adj mapId_hom_τl mapId_hom_τr mapId_inv_τl mapId_inv_τr - mapComp_hom_τl mapComp_hom_τr mapComp_inv_τl mapComp_inv_τr] + mapComp_hom_τl mapComp_hom_τr mapComp_inv_τl mapComp_inv_τr, local implicit_reducible] def pseudofunctor : Pseudofunctor (LocallyDiscrete Scheme.{u}ᵒᵖ) (Adj Cat) := LocallyDiscrete.mkPseudofunctor @@ -318,6 +377,7 @@ set_option backward.defeqAttrib.useBackward true in /-- Restriction of an `𝒪ₓ`-module along an open immersion. This is isomorphic to the pullback functor (see `restrictFunctorIsoPullback`) but has better defeqs. -/ +@[local implicit_reducible] def restrictFunctor : Y.Modules ⥤ X.Modules := letI α : X.presheaf ⟶ f.opensFunctor.op ⋙ Y.presheaf := { app U := (f.appIso U.unop).inv } SheafOfModules.pushforward (F := f.opensFunctor) @@ -369,10 +429,12 @@ lemma restrictAdjunction_counit_app_app (M : X.Modules) (U : X.Opens) : ((restrictAdjunction f).counit.app M).app U = M.presheaf.map (eqToHom (f.preimage_image_eq U).symm).op := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Restriction is naturally isomorphic to the inverse image. -/ def restrictFunctorIsoPullback : restrictFunctor f ≅ pullback f := (restrictAdjunction f).leftAdjointUniq (pullbackPushforwardAdjunction f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restriction along the identity is isomorphic to the identity. -/ def restrictFunctorId : restrictFunctor (𝟙 X) ≅ 𝟭 _ := @@ -391,6 +453,7 @@ lemma restrictFunctorId_inv_app_app : (restrictFunctorId.inv.app M).app U = M.presheaf.map (eqToHom (show 𝟙 X ''ᵁ U = U by simp)).op := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restriction along the composition is isomorphic to the composition of restrictions. -/ def restrictFunctorComp : restrictFunctor (f ≫ g) ≅ restrictFunctor g ⋙ restrictFunctor f := @@ -409,6 +472,7 @@ lemma restrictFunctorComp_hom_app_app (M : Z.Modules) : lemma restrictFunctorComp_inv_app_app (M : Z.Modules) : ((restrictFunctorComp f g).inv.app M).app U = M.presheaf.map (eqToHom (by simp)).op := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restriction along equal morphisms are isomorphic. -/ def restrictFunctorCongr {f g : X ⟶ Y} (hf : f = g) [IsOpenImmersion f] [IsOpenImmersion g] : diff --git a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean index 787dac2b6cfeee..46fb944789f2e4 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean @@ -38,6 +38,7 @@ namespace AlgebraicGeometry open _root_.PrimeSpectrum +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from `𝒪_{Spec R}` modules to sheaves of `R`-modules. -/ def modulesSpecToSheaf : (Spec R).Modules ⥤ TopCat.Sheaf (ModuleCat R) (Spec R) := @@ -107,6 +108,7 @@ def modulesSpecToSheafIso : def toOpen (U : (Spec R).Opens) : M ⟶ (modulesSpecToSheaf.obj (tilde M)).presheaf.obj (.op U) := ModuleCat.ofHom (StructureSheaf.toOpenₗ R M U) ≫ ((modulesSpecToSheafIso M).app _).inv +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem toOpen_res (U V : Opens (PrimeSpectrum.Top R)) (i : V ⟶ U) : toOpen M U ≫ (modulesSpecToSheaf.obj (tilde M)).presheaf.map i.op = toOpen M V := @@ -128,21 +130,25 @@ noncomputable def toStalk (x : PrimeSpectrum.Top R) : ModuleCat.of R M ⟶ ModuleCat.of R ((tilde M).presheaf.stalk x) := ModuleCat.ofHom (StructureSheaf.toStalkₗ ..) +set_option backward.isDefEq.respectTransparency.types false in instance (x : PrimeSpectrum.Top R) : IsLocalizedModule x.asIdeal.primeCompl (toStalk M x).hom := inferInstanceAs (IsLocalizedModule x.asIdeal.primeCompl (StructureSheaf.toStalkₗ ..)) +set_option backward.isDefEq.respectTransparency.types false in /-- The tilde construction is functorial. -/ protected noncomputable def map {M N : ModuleCat R} (f : M ⟶ N) : tilde M ⟶ tilde N := SpecModulesToSheafFullyFaithful.preimage ⟨(modulesSpecToSheafIso M).hom ≫ { app U := ModuleCat.ofHom (StructureSheaf.comapₗ f.hom _ _ .rfl) } ≫ (modulesSpecToSheafIso N).inv⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] protected lemma map_id {M : ModuleCat R} : tilde.map (𝟙 M) = 𝟙 _ := by ext p x exact Subtype.ext (funext fun y ↦ DFunLike.congr_fun (LocalizedModule.map_id _) _) +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] protected lemma map_comp {M N P : ModuleCat R} (f : M ⟶ N) (g : N ⟶ P) : tilde.map (f ≫ g) = tilde.map f ≫ tilde.map g := by @@ -153,6 +159,7 @@ protected lemma map_comp {M N P : ModuleCat R} (f : M ⟶ N) (g : N ⟶ P) : (LocalizedModule.mkLinearMap y.1.asIdeal.primeCompl N) (LocalizedModule.mkLinearMap y.1.asIdeal.primeCompl P) _ _) _) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma toOpen_map_app {M N : ModuleCat R} (f : M ⟶ N) (U : TopologicalSpace.Opens (PrimeSpectrum R)) : @@ -168,6 +175,7 @@ variable (R) in obj := tilde map := tilde.map +set_option backward.isDefEq.respectTransparency.types false in instance isIso_toOpen_top {M : ModuleCat R} : IsIso (toOpen M ⊤) := by rw [toOpen, isIso_comp_right_iff, ConcreteCategory.isIso_iff_bijective] exact StructureSheaf.toOpenₗ_top_bijective @@ -178,6 +186,7 @@ noncomputable def isoTop (M : ModuleCat R) : M ≅ (modulesSpecToSheaf.obj (tilde M)).presheaf.obj (.op ⊤) := asIso (toOpen M ⊤) +set_option backward.isDefEq.respectTransparency.types false in open PrimeSpectrum in lemma isUnit_algebraMap_end_basicOpen (M : (Spec (.of R)).Modules) (f : R) : IsUnit (algebraMap R (Module.End R @@ -307,6 +316,7 @@ def tilde.adjunction : tilde.functor R ⊣ moduleSpecΓFunctor where rw [toOpen_fromTildeΓ_app] exact (modulesSpecToSheaf.obj M).obj.map_id _ +set_option backward.isDefEq.respectTransparency.types false in instance : IsIso (tilde.adjunction (R := R)).unit := by dsimp [tilde.adjunction]; infer_instance @@ -329,17 +339,21 @@ variable {M N : ModuleCat R} (f g : M ⟶ N) @[simp] lemma tilde.map_zero : tilde.map (0 : M ⟶ N) = 0 := (tilde.functor R).map_zero _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tilde.map_add : tilde.map (f + g) = tilde.map f + tilde.map g := (tilde.functor R).map_add +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tilde.map_sub : tilde.map (f - g) = tilde.map f - tilde.map g := (tilde.functor R).map_sub +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tilde.map_neg : tilde.map (-f) = - tilde.map f := (tilde.functor R).map_neg end +set_option backward.isDefEq.respectTransparency.types false in lemma isIso_fromTildeΓ_iff {M : (Spec R).Modules} : IsIso M.fromTildeΓ ↔ (tilde.functor R).essImage M := tilde.adjunction.isIso_counit_app_iff_mem_essImage diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean index fad81099650161..2e9fcbfe3aa476 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean @@ -168,6 +168,7 @@ instance : HasAffineProperty @IsAffineHom fun X _ _ _ ↦ IsAffine X where Subtype.forall, isAffineHom_iff] rfl +set_option backward.isDefEq.respectTransparency.types false in instance isAffineHom_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsAffineHom := by apply HasAffineProperty.isStableUnderBaseChange @@ -176,12 +177,15 @@ instance isAffineHom_isStableUnderBaseChange : introv X hX H infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance (priority := 100) isAffineHom_of_isAffine [IsAffine X] [IsAffine Y] : IsAffineHom f := (HasAffineProperty.iff_of_isAffine (P := @IsAffineHom)).mpr inferInstance +set_option backward.isDefEq.respectTransparency.types false in lemma isAffine_of_isAffineHom [IsAffineHom f] [IsAffine Y] : IsAffine X := (HasAffineProperty.iff_of_isAffine (P := @IsAffineHom) (f := f)).mp inferInstance +set_option backward.isDefEq.respectTransparency.types false in lemma isAffineHom_of_forall_exists_isAffineOpen (H : ∀ x : Y, ∃ U : Y.Opens, x ∈ U ∧ IsAffineOpen U ∧ IsAffineOpen (f ⁻¹ᵁ U)) : IsAffineHom f := by @@ -190,11 +194,13 @@ lemma isAffineHom_of_forall_exists_isAffineOpen · exact hfU · exact top_le_iff.mp (fun x _ ↦ by simpa using ⟨x, hxU x⟩) +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [IsAffineHom f] [IsAffine Y] : IsAffine (pullback f g) := letI : IsAffineHom (pullback.snd f g) := MorphismProperty.pullback_snd _ _ ‹_› isAffine_of_isAffineHom (pullback.snd f g) +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [IsAffineHom g] [IsAffine X] : IsAffine (pullback f g) := letI : IsAffineHom (pullback.fst f g) := MorphismProperty.pullback_fst _ _ ‹_› @@ -288,6 +294,7 @@ lemma isIso_morphismRestrict_iff_isIso_app [IsAffineHom f] {U : Y.Opens} (hU : I simp only [morphismRestrict_app', TopologicalSpace.Opens.map_top] congr! <;> simp [Scheme.Opens.toScheme_presheaf_obj] +set_option backward.isDefEq.respectTransparency.types false in theorem diagonal_isAffine_iff_forall_isAffineOpen_inf [IsAffine Y] (f : X ⟶ Y) : AffineTargetMorphismProperty.diagonal (fun X _ _ _ ↦ IsAffine X) f ↔ ∀ (U V : X.Opens), IsAffineOpen U → IsAffineOpen V → IsAffineOpen (U ⊓ V) := by @@ -308,6 +315,7 @@ theorem diagonal_isAffine_iff_forall_isAffineOpen_inf [IsAffine Y] (f : X ⟶ Y) change IsAffine _ at this exact .of_isIso (pullback.fst f₁ f₂ ≫ f₁).isoOpensRange.hom +set_option backward.isDefEq.respectTransparency.types false in theorem isAffineHom_diagonal_iff {f : X ⟶ Y} : IsAffineHom (pullback.diagonal f) ↔ ∀ (U : Y.Opens), IsAffineOpen U → ∀ V₁ ≤ f ⁻¹ᵁ U, ∀ V₂ ≤ f ⁻¹ᵁ U, diff --git a/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean b/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean index 795563aef108b4..1dade8ab7512b8 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean @@ -243,6 +243,7 @@ lemma HasAffineProperty.affineAnd_iff (P : MorphismProperty Scheme.{u}) rw [targetAffineLocally_affineAnd_iff hQi, h f] aesop +set_option backward.isDefEq.respectTransparency.types false in lemma HasAffineProperty.affineAnd_le_isAffineHom (P : MorphismProperty Scheme.{u}) (hA : HasAffineProperty P (affineAnd Q)) : P ≤ @IsAffineHom := by intro X Y f hf diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean index 5cbe20de44db82..e5ba46c8016f54 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean @@ -141,6 +141,7 @@ lemma of_isPullback {UX UY : Scheme.{u}} {iY : UY ⟶ Y} [IsOpenImmersion iY] theorem restrict (hf : P f) (U : Y.Opens) : P (f ∣_ U) := of_isPullback (isPullback_morphismRestrict f U).flip hf +set_option backward.isDefEq.respectTransparency.types false in lemma of_iSup_eq_top {ι} (U : ι → Y.Opens) (hU : iSup U = ⊤) (H : ∀ i, P (f ∣_ U i)) : P f := by refine (P.iff_of_zeroHypercover_target @@ -285,6 +286,7 @@ variable (f) in lemma of_isOpenImmersion [P.ContainsIdentities] [IsOpenImmersion f] : P f := Category.comp_id f ▸ comp (P.id_mem Y) f +set_option backward.isDefEq.respectTransparency.types false in lemma isZariskiLocalAtTarget [P.IsMultiplicative] (hP : ∀ {X Y Z : Scheme.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) [IsOpenImmersion g], P (f ≫ g) → P f) : IsZariskiLocalAtTarget P where diff --git a/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean index 36fc7ca754988f..3d64992b66f569 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean @@ -81,6 +81,7 @@ instance : MorphismProperty.IsMultiplicative @IsClosedImmersion where id_mem _ := inferInstance comp_mem f g _ _ := ⟨g.isClosedEmbedding.comp f.isClosedEmbedding⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Composition of closed immersions is a closed immersion. -/ instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsClosedImmersion f] [IsClosedImmersion g] : IsClosedImmersion (f ≫ g) := @@ -93,6 +94,7 @@ instance respectsIso : MorphismProperty.RespectsIso @IsClosedImmersion := by instance {X : Scheme} (I : X.IdealSheafData) : IsClosedImmersion I.subschemeι := .of_isPreimmersion _ (I.range_subschemeι ▸ I.support.isClosed) +set_option backward.isDefEq.respectTransparency.types false in /-- Given two commutative rings `R S : CommRingCat` and a surjective morphism `f : R ⟶ S`, the induced scheme morphism `specObj S ⟶ specObj R` is a closed immersion. -/ @@ -215,6 +217,7 @@ lemma lift_fac {X Y Z : Scheme.{u}} nth_rw 2 [← f.toImage_imageι] simp [lift, -Scheme.Hom.toImage_imageι, g.toImage_imageι] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isIso_of_ker_eq {Z₁ Z₂ X : Scheme.{u}} (i₁ : Z₁ ⟶ X) (i₂ : Z₂ ⟶ X) [IsClosedImmersion i₁] [IsClosedImmersion i₂] (f : Z₁ ⟶ Z₂) @@ -239,6 +242,7 @@ variable {X Y : Scheme.{u}} [IsAffine Y] {f : X ⟶ Y} open IsClosedImmersion LocallyRingedSpace +set_option backward.isDefEq.respectTransparency.types false in /-- If `f : X ⟶ Y` is a morphism of schemes with quasi-compact source and affine target, `f` induces an injection on global sections, then `f` is dominant. -/ lemma isDominant_of_of_appTop_injective [CompactSpace X] @@ -254,6 +258,7 @@ instance [CompactSpace X] : IsDominant X.toSpecΓ := simpa only [Scheme.toSpecΓ_appTop] using (ConcreteCategory.bijective_of_isIso (Scheme.ΓSpecIso Γ(X, ⊤)).hom).1) +set_option backward.isDefEq.respectTransparency.types false in /-- If `f : X ⟶ Y` is open, injective, `X` is quasi-compact and `Y` is affine, then `f` is stalkwise injective if it is injective on global sections. -/ lemma stalkMap_injective_of_isOpenMap_of_injective [CompactSpace X] @@ -298,6 +303,7 @@ lemma stalkMap_injective_of_isOpenMap_of_injective [CompactSpace X] namespace IsClosedImmersion +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` is a closed immersion with affine target such that the induced map on global sections is injective, `f` is an isomorphism. -/ theorem isIso_of_injective_of_isAffine [IsClosedImmersion f] @@ -320,6 +326,7 @@ theorem isAffine_surjective_of_isAffine [IsClosedImmersion f] : exact (ConcreteCategory.bijective_of_isIso _).2.comp ((ConcreteCategory.bijective_of_isIso _).2.comp Ideal.Quotient.mk_surjective) +set_option backward.isDefEq.respectTransparency.types false in lemma Spec_iff {R : CommRingCat} {f : X ⟶ Spec R} : IsClosedImmersion f ↔ ∃ I : Ideal R, ∃ e : X ≅ Spec (.of <| R ⧸ I), f = e.hom ≫ Spec.map (CommRingCat.ofHom (Ideal.Quotient.mk I)) := by @@ -346,10 +353,12 @@ end Affine variable {X Y Z : Scheme.{u}} +set_option backward.isDefEq.respectTransparency.types false in /-- Being a closed immersion is local at the target. -/ instance IsClosedImmersion.isZariskiLocalAtTarget : IsZariskiLocalAtTarget @IsClosedImmersion := eq_inf ▸ inferInstance +set_option backward.isDefEq.respectTransparency.types false in /-- On morphisms with affine target, being a closed immersion is precisely having affine source and being surjective on global sections. -/ instance IsClosedImmersion.hasAffineProperty : HasAffineProperty @IsClosedImmersion @@ -357,6 +366,7 @@ instance IsClosedImmersion.hasAffineProperty : HasAffineProperty @IsClosedImmers convert! HasAffineProperty.of_isZariskiLocalAtTarget @IsClosedImmersion refine ⟨fun ⟨h₁, h₂⟩ ↦ of_surjective_of_isAffine _ h₂, by apply isAffine_surjective_of_isAffine⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma isClosedImmersion_iff_isAffineHom {f : X ⟶ Y} : IsClosedImmersion f ↔ IsAffineHom f ∧ ∀ U : Y.Opens, IsAffineOpen U → Function.Surjective (f.app U) := by @@ -367,6 +377,7 @@ lemma Scheme.Hom.app_surjective (f : X ⟶ Y) (U : Y.Opens) (hU : IsAffineOpen U [IsClosedImmersion f] : Function.Surjective (f.app U) := (isClosedImmersion_iff_isAffineHom.mp ‹_›).2 U hU +set_option backward.isDefEq.respectTransparency.types false in /-- Being a closed immersion is stable under base change. -/ instance IsClosedImmersion.isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsClosedImmersion := by @@ -377,10 +388,12 @@ instance IsClosedImmersion.isStableUnderBaseChange : exact ⟨inferInstance, RingHom.surjective_isStableUnderBaseChange.pullback_fst_appTop _ RingHom.surjective_respectsIso f _ hsurj⟩ +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [IsClosedImmersion g] : IsClosedImmersion (Limits.pullback.fst f g) := MorphismProperty.pullback_fst _ _ ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [IsClosedImmersion f] : IsClosedImmersion (Limits.pullback.snd f g) := MorphismProperty.pullback_snd _ _ ‹_› @@ -389,6 +402,7 @@ instance (f : X ⟶ Y) (V : Y.Opens) [IsClosedImmersion f] : IsClosedImmersion (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V +set_option backward.isDefEq.respectTransparency.types false in /-- Closed immersions are locally of finite type. -/ instance (priority := 900) {X Y : Scheme.{u}} (f : X ⟶ Y) [h : IsClosedImmersion f] : LocallyOfFiniteType f := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean index e760ae909335aa..10416084bb353d 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean @@ -93,6 +93,7 @@ theorem HasAffineProperty.diagonal_of_openCover (P) {Q} [HasAffineProperty P Q] convert! h𝒰' i j k ext1 <;> simp [Scheme.Cover.pullbackHom] +set_option backward.isDefEq.respectTransparency.types false in theorem HasAffineProperty.diagonal_of_openCover_diagonal (P) {Q} [HasAffineProperty P Q] {X Y : Scheme.{u}} (f : X ⟶ Y) (𝒰 : Scheme.OpenCover Y) [∀ i, IsAffine (𝒰.X i)] @@ -118,6 +119,7 @@ theorem HasAffineProperty.diagonal_of_diagonal_of_isPullback · infer_instance · infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem HasAffineProperty.diagonal_iff (P) {Q} [HasAffineProperty P Q] {X Y : Scheme.{u}} {f : X ⟶ Y} [IsAffine Y] : @@ -152,6 +154,7 @@ theorem AffineTargetMorphismProperty.diagonal_of_openCover_source rw [← Q.cancel_left_of_respectsIso this.isoPullback.hom, IsPullback.isoPullback_hom_snd] exact h𝒰 _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance HasAffineProperty.diagonal_affineProperty_isLocal {Q : AffineTargetMorphismProperty} [Q.IsLocal] : @@ -227,6 +230,7 @@ theorem universally_isZariskiLocalAtTarget (P : MorphismProperty Scheme) · rw [← cancel_mono (Scheme.Opens.ι _)] simp [morphismRestrict_ι_assoc, h.1.1] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma universally_isZariskiLocalAtSource (P : MorphismProperty Scheme) [IsZariskiLocalAtSource P] : IsZariskiLocalAtSource P.universally := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean b/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean index e66b740b2661f0..897c5f708aa982 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Descent.lean @@ -129,6 +129,7 @@ variable (H₁ : (@IsLocalIso ⊓ @Surjective : MorphismProperty Scheme) ≤ P') (H₂ : ∀ {R S : CommRingCat.{u}} {f : R ⟶ S}, P' (Spec.map f) → Q' f.hom) +set_option backward.isDefEq.respectTransparency.types false in include H₁ in lemma IsZariskiLocalAtTarget.descendsAlong_inf_quasiCompact [IsZariskiLocalAtTarget P] (H : ∀ {R S : CommRingCat.{u}} {Y : Scheme.{u}} (φ : R ⟶ S) (g : Y ⟶ Spec R), diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean b/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean index 52bc757775e5a9..712a3bb1af26ce 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Etale.lean @@ -64,6 +64,7 @@ instance : MorphismProperty.IsMultiplicative @Etale := HasRingHomProperty.isMultiplicative RingHom.Etale.stableUnderComposition RingHom.Etale.containsIdentities +set_option backward.isDefEq.respectTransparency.types false in /-- The composition of étale morphisms is étale. -/ instance etale_comp {Z : Scheme.{u}} (g : Y ⟶ Z) [Etale f] [Etale g] : Etale (f ≫ g) := @@ -77,14 +78,17 @@ instance etale_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChang instance (priority := 900) [IsOpenImmersion f] : Etale f := HasRingHomProperty.of_isOpenImmersion RingHom.Etale.containsIdentities +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [Etale g] : Etale (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [Etale f] : Etale (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [Etale f] : Etale (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -115,6 +119,7 @@ instance (priority := 900) [Etale f] : FormallyUnramified f where formallyUnramified_appLE {_} hU {_} hV e := (f.etale_appLE hU hV e).formallyUnramified +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.HasOfPostcompProperty @Etale (@LocallyOfFiniteType ⊓ @FormallyUnramified) := by rw [MorphismProperty.hasOfPostcompProperty_iff_le_diagonal] @@ -147,6 +152,7 @@ end Etale namespace Scheme +set_option backward.isDefEq.respectTransparency.types false in /-- The category `Etale X` is the category of schemes étale over `X`. -/ protected def Etale (X : Scheme.{u}) : Type _ := MorphismProperty.Over @Etale ⊤ X deriving Category, HasPullbacks @@ -155,11 +161,13 @@ variable (X : Scheme.{u}) instance (Y : X.Etale) : Etale Y.hom := Y.prop +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from schemes étale over `X` to schemes over `X`. -/ def Etale.forget : X.Etale ⥤ Over X := MorphismProperty.Over.forget @Etale ⊤ X deriving Functor.Full, Functor.Faithful +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from schemes étale over `X` to schemes over `X` is fully faithful. -/ def Etale.forgetFullyFaithful : (Etale.forget X).FullyFaithful := MorphismProperty.Comma.forgetFullyFaithful _ _ _ diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean b/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean index 86a83253b590f5..275c2f28639780 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean @@ -43,6 +43,7 @@ alias Scheme.Hom.finite_app := IsFinite.finite_app namespace IsFinite +set_option backward.isDefEq.respectTransparency.types false in instance : HasAffineProperty @IsFinite (fun X _ f _ ↦ IsAffine X ∧ RingHom.Finite (f.appTop).hom) := by change HasAffineProperty @IsFinite (affineAnd RingHom.Finite) @@ -50,20 +51,24 @@ instance : HasAffineProperty @IsFinite RingHom.finite_localizationPreserves.away RingHom.finite_ofLocalizationSpan] simp [isFinite_iff] +set_option backward.isDefEq.respectTransparency.types false in instance : IsStableUnderComposition @IsFinite := HasAffineProperty.affineAnd_isStableUnderComposition inferInstance RingHom.finite_stableUnderComposition +set_option backward.isDefEq.respectTransparency.types false in instance : IsStableUnderBaseChange @IsFinite := HasAffineProperty.affineAnd_isStableUnderBaseChange inferInstance RingHom.finite_respectsIso RingHom.finite_isStableUnderBaseChange +set_option backward.isDefEq.respectTransparency.types false in instance : ContainsIdentities @IsFinite := HasAffineProperty.affineAnd_containsIdentities inferInstance RingHom.finite_respectsIso RingHom.finite_containsIdentities instance : IsMultiplicative @IsFinite where +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma SpecMap_iff {R S : CommRingCat.{u}} (f : R ⟶ S) : IsFinite (Spec.map f) ↔ f.hom.Finite := by @@ -72,20 +77,26 @@ lemma SpecMap_iff {R S : CommRingCat.{u}} (f : R ⟶ S) : variable {X Y Z : Scheme.{u}} (f : X ⟶ Y) +set_option backward.isDefEq.respectTransparency.types false in instance (priority := 900) [IsIso f] : IsFinite f := of_isIso @IsFinite f +set_option backward.isDefEq.respectTransparency.types false in instance {Z : Scheme.{u}} (g : Y ⟶ Z) [IsFinite f] [IsFinite g] : IsFinite (f ≫ g) := IsStableUnderComposition.comp_mem f g ‹IsFinite f› ‹IsFinite g› +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [IsFinite g] : IsFinite (Limits.pullback.fst f g) := MorphismProperty.pullback_fst _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [IsFinite f] : IsFinite (Limits.pullback.snd f g) := MorphismProperty.pullback_snd _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [IsFinite f] : IsFinite (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V +set_option backward.isDefEq.respectTransparency.types false in lemma iff_isIntegralHom_and_locallyOfFiniteType : IsFinite f ↔ IsIntegralHom f ∧ LocallyOfFiniteType f := by wlog hY : IsAffine Y @@ -144,6 +155,7 @@ lemma comp_iff {f : X ⟶ Y} {g : Y ⟶ Z} [IsFinite g] : IsFinite (f ≫ g) ↔ IsFinite f := ⟨fun _ ↦ .of_comp f g, fun _ ↦ inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in instance {U V X : Scheme.{u}} (f : U ⟶ X) (g : V ⟶ X) [IsFinite f] [IsFinite g] : IsFinite (Limits.coprod.desc f g) := by refine HasAffineProperty.coprodDesc_affineAnd inferInstance RingHom.finite_respectsIso @@ -154,11 +166,13 @@ instance {U V X : Scheme.{u}} (f : U ⟶ X) (g : V ⟶ X) [IsFinite f] [IsFinite end IsFinite +set_option backward.isDefEq.respectTransparency.types false in lemma Scheme.Hom.finite_appTop {X Y : Scheme.{u}} (f : X ⟶ Y) [IsAffine X] [IsAffine Y] [IsFinite f] : f.appTop.hom.Finite := (HasAffineProperty.iff_of_isAffine (P := @IsFinite).mp inferInstance).2 +set_option backward.isDefEq.respectTransparency.types false in /-- If `X` is a Jacobson scheme and `k` is a field, `Spec(k) ⟶ X` is finite iff it is (locally) of finite type. (The statement is more general to allow the empty scheme as well) -/ @@ -203,6 +217,7 @@ lemma Scheme.Hom.closePoints_subset_preimage_closedPoints simpa [Set.range_comp, Scheme.range_fromSpecResidueField] using (X.fromSpecResidueField x ≫ f).isClosedMap.isClosed_range +set_option backward.isDefEq.respectTransparency.types false in @[stacks 01TB "(1) => (2)"] lemma isClosed_singleton_iff_locallyOfFiniteType {X : Scheme.{u}} [JacobsonSpace X] {x : X} : IsClosed {x} ↔ LocallyOfFiniteType (X.fromSpecResidueField x) := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean b/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean index ad50cc03d03afb..253bbf756c95b1 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FinitePresentation.lean @@ -86,14 +86,17 @@ instance locallyOfFinitePresentation_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @LocallyOfFinitePresentation := HasRingHomProperty.isStableUnderBaseChange RingHom.finitePresentation_isStableUnderBaseChange +set_option backward.isDefEq.respectTransparency.types false in instance {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z) [LocallyOfFinitePresentation g] : LocallyOfFinitePresentation (Limits.pullback.fst f g) := MorphismProperty.pullback_fst _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z) [LocallyOfFinitePresentation f] : LocallyOfFinitePresentation (Limits.pullback.snd f g) := MorphismProperty.pullback_snd _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [LocallyOfFinitePresentation f] : LocallyOfFinitePresentation (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean b/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean index 044bb9779a91e1..b4babad0160370 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FiniteType.lean @@ -81,14 +81,17 @@ instance locallyOfFiniteType_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @LocallyOfFiniteType := HasRingHomProperty.isStableUnderBaseChange RingHom.finiteType_isStableUnderBaseChange +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [LocallyOfFiniteType g] : LocallyOfFiniteType (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [LocallyOfFiniteType f] : LocallyOfFiniteType (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [LocallyOfFiniteType f] : LocallyOfFiniteType (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -110,6 +113,7 @@ instance {R} [CommRing R] [IsJacobsonRing R] : JacobsonSpace <| Spec <| .of R := instance {R : CommRingCat} [IsJacobsonRing R] : JacobsonSpace (Spec R) := inferInstanceAs (JacobsonSpace (PrimeSpectrum R)) +set_option backward.isDefEq.respectTransparency.types false in nonrec lemma LocallyOfFiniteType.jacobsonSpace (f : X ⟶ Y) [LocallyOfFiniteType f] [JacobsonSpace Y] : JacobsonSpace X := by wlog hY : ∃ S, Y = Spec S diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean index 2318b91abfc6a9..f06100b783b577 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean @@ -71,6 +71,7 @@ instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [hf : Flat f] [hg : Flat g] : Flat (f ≫ g) := MorphismProperty.comp_mem _ f g hf hg +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.Respects @Flat @IsOpenImmersion where postcomp _ _ _ _ := inferInstance @@ -80,12 +81,15 @@ instance : MorphismProperty.IsMultiplicative @Flat where instance isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @Flat := HasRingHomProperty.isStableUnderBaseChange RingHom.Flat.isStableUnderBaseChange +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [Flat g] : Flat (pullback.fst f g) := MorphismProperty.pullback_fst _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [Flat f] : Flat (pullback.snd f g) := MorphismProperty.pullback_snd _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [Flat f] : Flat (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -102,6 +106,7 @@ lemma stalkMap [Flat f] (x : X) : (f.stalkMap x).hom.Flat := lemma iff_flat_stalkMap : Flat f ↔ ∀ x, (f.stalkMap x).hom.Flat := ⟨fun _ ↦ stalkMap f, fun H ↦ of_stalkMap f H⟩ +set_option backward.isDefEq.respectTransparency.types false in instance {X : Scheme.{u}} {ι : Type v} [Small.{u} ι] {Y : ι → Scheme.{u}} {f : ∀ i, Y i ⟶ X} [∀ i, Flat (f i)] : Flat (Sigma.desc f) := IsZariskiLocalAtSource.sigmaDesc (fun _ ↦ inferInstance) @@ -146,6 +151,7 @@ lemma isQuotientMap_of_surjective {X Y : Scheme.{u}} (f : X ⟶ Y) [Flat f] [Qua · apply RingHom.Flat.generalizingMap_comap rwa [← HasRingHomProperty.Spec_iff (P := @Flat)] +set_option backward.isDefEq.respectTransparency.types false in /-- A flat surjective morphism of schemes is an epimorphism in the category of schemes. -/ @[stacks 02VW] lemma epi_of_flat_of_surjective (f : X ⟶ Y) [Flat f] [Surjective f] : Epi f := by @@ -160,6 +166,7 @@ lemma epi_of_flat_of_surjective (f : X ⟶ Y) [Flat f] [Surjective f] : Epi f := (Flat.stalkMap f x) (f.toLRSHom.prop x) exact ‹RingHom.FaithfullyFlat _›.injective +set_option backward.isDefEq.respectTransparency.types false in lemma flat_and_surjective_iff_faithfullyFlat_of_isAffine [IsAffine X] [IsAffine Y] : Flat f ∧ Surjective f ↔ f.appTop.hom.FaithfullyFlat := by rw [RingHom.FaithfullyFlat.iff_flat_and_comap_surjective, diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FlatDescent.lean b/Mathlib/AlgebraicGeometry/Morphisms/FlatDescent.lean index 84083edb0322c1..754666351a96d0 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FlatDescent.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FlatDescent.lean @@ -36,11 +36,13 @@ open CategoryTheory Limits MorphismProperty namespace AlgebraicGeometry +set_option backward.isDefEq.respectTransparency.types false in /-- Surjective satisfies fpqc descent. -/ instance Flat.surjective_descendsAlong_surjective_inf_flat_inf_quasicompact : DescendsAlong @Surjective (@Surjective ⊓ @Flat ⊓ @QuasiCompact) := .of_le (Q := @Surjective) (le_of_inf_eq' (by grind)) +set_option backward.isDefEq.respectTransparency.types false in /-- Universally closed satisfies fpqc descent. -/ @[stacks 02KS] instance descendsAlong_universallyClosed_surjective_inf_flat_inf_quasicompact : @@ -58,6 +60,7 @@ instance descendsAlong_universallyClosed_surjective_inf_flat_inf_quasicompact : exact p.isClosedMap _ (hs.preimage r.continuous) rwa [(Flat.isQuotientMap_of_surjective _).isClosed_preimage] at this +set_option backward.isDefEq.respectTransparency.types false in /-- Universally open satisfies fpqc descent. -/ @[stacks 02KT] instance descendsAlong_universallyOpen_surjective_inf_flat_inf_quasicompact : @@ -76,6 +79,7 @@ instance descendsAlong_universallyOpen_surjective_inf_flat_inf_quasicompact : exact p.isOpenMap _ (hs.preimage r.continuous) rwa [(Flat.isQuotientMap_of_surjective _).isOpen_preimage] at this +set_option backward.isDefEq.respectTransparency.types false in /-- Universally injective satisfies fpqc descent. -/ @[stacks 02KW] instance descendsAlong_universallyInjective_surjective_inf_flat_inf_quasicompact : @@ -83,6 +87,7 @@ instance descendsAlong_universallyInjective_surjective_inf_flat_inf_quasicompact rw [universallyInjective_eq_diagonal] infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- Being an isomorphism satisfies fpqc descent. -/ @[stacks 02L4] instance descendsAlong_isomorphisms_surjective_inf_flat_inf_quasicompact : @@ -122,6 +127,7 @@ instance descendsAlong_isomorphisms_surjective_inf_flat_inf_quasicompact : rwa [← flat_and_surjective_SpecMap_iff, and_comm] · simp_rw [← isIso_SpecMap_iff, implies_true] +set_option backward.isDefEq.respectTransparency.types false in /-- Being an open immersion satisfies fpqc descent. -/ @[stacks 02L3] instance descendsAlong_isOpenImmersion_surjective_inf_flat_inf_quasicompact' : @@ -153,6 +159,7 @@ instance descendsAlong_isOpenImmersion_surjective_inf_flat_inf_quasicompact' : rw [← IsOpenImmersion.lift_fac U.ι g (by simp [U])] infer_instance +set_option backward.isDefEq.respectTransparency.types false in lemma HasRingHomProperty.descendsAlong_flat {P : MorphismProperty Scheme.{u}} [P.IsStableUnderBaseChange] {Q : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop} [HasRingHomProperty P Q] (h : RingHom.CodescendsAlong Q RingHom.FaithfullyFlat) : @@ -166,6 +173,7 @@ lemma HasRingHomProperty.descendsAlong_flat {P : MorphismProperty Scheme.{u}} refine ⟨?_, (Spec.map f).surjective⟩ rwa [HasRingHomProperty.Spec_iff (P := @Flat)] at hf₂ +set_option backward.isDefEq.respectTransparency.types false in /-- fpqc descent implies fppf descent -/ instance (P : MorphismProperty Scheme) [P.DescendsAlong (@Surjective ⊓ @Flat ⊓ @QuasiCompact)] [IsZariskiLocalAtTarget P] : @@ -180,12 +188,14 @@ instance (P : MorphismProperty Scheme) [P.DescendsAlong (@Surjective ⊓ @Flat · exact ⟨fun x ↦ have ⟨y, hyV, e⟩ := e.ge (Set.mem_univ x); ⟨⟨y, hyV⟩, e⟩⟩ · exact IsZariskiLocalAtTarget.of_isPullback (.flip <| .of_hasPullback _ _) H +set_option backward.isDefEq.respectTransparency.types false in instance {X Y : Scheme} (f : X ⟶ Y) [Surjective f] [Flat f] [QuasiCompact f] : (Over.pullback f).Faithful := MorphismProperty.faithful_overPullback_of_isomorphisms_descendAlong (P := @Surjective ⊓ @Flat ⊓ @QuasiCompact) ⟨⟨inferInstance, inferInstance⟩, inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in instance {X Y : Scheme} (f : X ⟶ Y) [Surjective f] [Flat f] [LocallyOfFinitePresentation f] : (Over.pullback f).Faithful := MorphismProperty.faithful_overPullback_of_isomorphisms_descendAlong diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FlatMono.lean b/Mathlib/AlgebraicGeometry/Morphisms/FlatMono.lean index 7c7f220e5a7d57..87b4f5fc10f7a3 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FlatMono.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FlatMono.lean @@ -29,6 +29,7 @@ lemma Flat.isIso_of_surjective_of_mono {X Y : Scheme.{u}} (f : X ⟶ Y) [Flat f] · tauto · exact inferInstanceAs <| IsIso (pullback.fst f f) +set_option backward.isDefEq.respectTransparency.types false in /-- Flat monomorphisms that are locally of finite presentation are open immersions. In particular, every smooth monomorphism is an open immersion. diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FlatRank.lean b/Mathlib/AlgebraicGeometry/Morphisms/FlatRank.lean index 48f37a653d471f..1a9a0a36dcdeeb 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FlatRank.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FlatRank.lean @@ -112,6 +112,7 @@ private lemma Scheme.Hom.finrank_eq_of_isAffine [IsAffine S] [Flat f] [IsFinite rw [show s = (𝟙 S : S ⟶ S) s from rfl, finrank_eq_finrank_snd_of_isAffine, IsAffine.finrank_snd] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma Scheme.Hom.finrank_SpecMap_eq_finrank {R S : CommRingCat.{u}} {f : R ⟶ S} (hf₁ : f.hom.Finite) (hf₂ : f.hom.Flat) : @@ -171,6 +172,7 @@ lemma Scheme.Hom.finrank_pullback_fst {Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ finrank (pullback.fst g f) y = finrank f (g y) := finrank_of_isPullback (pullback.snd g f) _ _ _ (.flip <| .of_hasPullback _ _) y +set_option backward.isDefEq.respectTransparency.types false in nonrec lemma Scheme.Hom.one_le_finrank_map (x : X) : 1 ≤ finrank f (f x) := by wlog hY : ∃ R, Y = Spec R · obtain ⟨R, g, hg, y, hy⟩ := Y.exists_Spec_apply_eq (f x) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean index 897283b0a8f0f7..a40e516aa6f53d 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean @@ -72,6 +72,7 @@ instance : HasRingHomProperty @FormallyUnramified RingHom.FormallyUnramified whe instance : MorphismProperty.IsStableUnderComposition @FormallyUnramified := HasRingHomProperty.stableUnderComposition RingHom.FormallyUnramified.stableUnderComposition +set_option backward.isDefEq.respectTransparency.types false in /-- `f : X ⟶ S` is formally unramified if `X ⟶ X ×ₛ X` is an open immersion. In particular, monomorphisms (e.g. immersions) are formally unramified. The converse is true if `f` is locally of finite type. -/ @@ -119,6 +120,7 @@ instance : MorphismProperty.IsMultiplicative @FormallyUnramified where instance : MorphismProperty.IsStableUnderBaseChange @FormallyUnramified := HasRingHomProperty.isStableUnderBaseChange RingHom.FormallyUnramified.isStableUnderBaseChange +set_option backward.isDefEq.respectTransparency.types false in open MorphismProperty in /-- The diagonal of a formally unramified morphism of finite type is an open immersion. -/ instance isOpenImmersion_diagonal [FormallyUnramified f] [LocallyOfFiniteType f] : @@ -175,6 +177,7 @@ instance [FormallyUnramified f] [LocallyOfFiniteType f] (x : X) : exact stalkMap f x infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- Given any commuting diagram ``` diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean index 4bcef5bbce97af..9c338e8307024f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean @@ -107,6 +107,7 @@ lemma isImmersion_eq_inf : @IsImmersion = (@IsPreimmersion ⊓ namespace IsImmersion +set_option backward.isDefEq.respectTransparency.types false in instance : IsZariskiLocalAtTarget @IsImmersion := by suffices IsZariskiLocalAtTarget (topologically fun {X Y} _ _ f ↦ IsLocallyClosed (Set.range f)) from @@ -141,6 +142,7 @@ instance : MorphismProperty.IsMultiplicative @IsImmersion where simp only [Scheme.Hom.comp_base, TopCat.coe_comp, Set.range_comp] exact f.isLocallyClosed_range.image g.isEmbedding.isInducing g.isLocallyClosed_range +set_option backward.isDefEq.respectTransparency.types false in instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsImmersion f] [IsImmersion g] : IsImmersion (f ≫ g) := MorphismProperty.IsStableUnderComposition.comp_mem f g inferInstance inferInstance @@ -170,9 +172,11 @@ instance isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsI (by simpa using H.w.symm)] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [IsImmersion g] : IsImmersion (Limits.pullback.fst f g) := MorphismProperty.pullback_fst _ _ ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [IsImmersion f] : IsImmersion (Limits.pullback.snd f g) := MorphismProperty.pullback_snd _ _ ‹_› @@ -187,6 +191,7 @@ instance (priority := 900) (f : X ⟶ Y) [IsImmersion f] : LocallyOfFiniteType f rw [← f.liftCoborder_ι] infer_instance +set_option backward.isDefEq.respectTransparency.types false in open Limits Scheme.Pullback in /-- The diagonal morphism is always an immersion. -/ @[stacks 01KJ] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean b/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean index 925ae38a2fc25b..e7c548a462bfb0 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Integral.lean @@ -41,6 +41,7 @@ namespace IsIntegralHom variable {X Y Z S : Scheme.{u}} +set_option backward.isDefEq.respectTransparency.types false in instance hasAffineProperty : HasAffineProperty @IsIntegralHom fun X _ f _ ↦ IsAffine X ∧ RingHom.IsIntegral (f.app ⊤).hom := by change HasAffineProperty @IsIntegralHom (affineAnd RingHom.IsIntegral) @@ -66,12 +67,15 @@ instance : IsMultiplicative @IsIntegralHom where instance (f : X ⟶ Y) (g : Y ⟶ Z) [IsIntegralHom f] [IsIntegralHom g] : IsIntegralHom (f ≫ g) := MorphismProperty.comp_mem _ _ _ ‹_› ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ S) (g : Y ⟶ S) [IsIntegralHom g] : IsIntegralHom (Limits.pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ S) (g : Y ⟶ S) [IsIntegralHom f] : IsIntegralHom (Limits.pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [IsIntegralHom f] : IsIntegralHom (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -86,6 +90,7 @@ lemma comp_iff {f : X ⟶ Y} {g : Y ⟶ Z} [IsIntegralHom g] : IsIntegralHom (f ≫ g) ↔ IsIntegralHom f := ⟨fun _ ↦ .of_comp f g, fun _ ↦ inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma SpecMap_iff {R S : CommRingCat} {φ : R ⟶ S} : IsIntegralHom (Spec.map φ) ↔ φ.hom.IsIntegral := by have := RingHom.toMorphismProperty_respectsIso_iff.mp RingHom.isIntegral_respectsIso @@ -93,6 +98,7 @@ lemma SpecMap_iff {R S : CommRingCat} {φ : R ⟶ S} : exacts [MorphismProperty.arrow_mk_iso_iff (RingHom.toMorphismProperty RingHom.IsIntegral) (arrowIsoΓSpecOfIsAffine φ).symm, inferInstance] +set_option backward.isDefEq.respectTransparency.types false in instance : IsMultiplicative @IsIntegralHom where instance {U V X : Scheme.{u}} (f : U ⟶ X) (g : V ⟶ X) [IsIntegralHom f] [IsIntegralHom g] : @@ -102,6 +108,7 @@ instance {U V X : Scheme.{u}} (f : U ⟶ X) (g : V ⟶ X) [IsIntegralHom f] [IsI algebraize [f, g] refine algebraMap_isIntegral_iff.mpr inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (priority := 100) (f : X ⟶ Y) [IsIntegralHom f] : UniversallyClosed f := by revert X Y f ‹IsIntegralHom f› @@ -124,6 +131,7 @@ instance (priority := 100) (f : X ⟶ Y) [IsIntegralHom f] : rw [SpecMap_iff] exact PrimeSpectrum.isClosedMap_comap_of_isIntegral _ +set_option backward.isDefEq.respectTransparency.types false in lemma iff_universallyClosed_and_isAffineHom {X Y : Scheme.{u}} {f : X ⟶ Y} : IsIntegralHom f ↔ UniversallyClosed f ∧ IsAffineHom f := by refine ⟨fun _ ↦ ⟨inferInstance, inferInstance⟩, fun ⟨H₁, H₂⟩ ↦ ?_⟩ diff --git a/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean b/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean index 3a757b210c8ab9..11fb1935c872be 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/LocalClosure.lean @@ -59,6 +59,7 @@ lemma iff_forall_exists [P.RespectsIso] {f : X ⟶ Y} : variable [W.IsStableUnderBaseChange] [Scheme.IsJointlySurjectivePreserving W] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [P.RespectsLeft Q] [Q.IsStableUnderBaseChange] : (sourceLocalClosure W P).RespectsLeft Q := by @@ -73,6 +74,7 @@ instance [P.RespectsRight Q] : (sourceLocalClosure W P).RespectsRight Q := by instance [P.RespectsIso] : (sourceLocalClosure W P).RespectsIso where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [P.RespectsIso] [P.RespectsLeft @IsOpenImmersion] : IsZariskiLocalAtSource (sourceLocalClosure IsOpenImmersion P) := by @@ -83,6 +85,7 @@ instance [P.RespectsIso] [P.RespectsLeft @IsOpenImmersion] : · choose 𝒱 h𝒱 using h exact ⟨𝒰.bind 𝒱, fun i ↦ h𝒱 _ _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [P.IsStableUnderBaseChange] : (sourceLocalClosure W P).IsStableUnderBaseChange := by refine .mk' fun X Y S f g _ ⟨𝒰, hg⟩ ↦ ⟨𝒰.pullback₁ (pullback.snd f g), fun i ↦ ?_⟩ @@ -93,6 +96,7 @@ instance [W.ContainsIdentities] [P.ContainsIdentities] : (sourceLocalClosure W P).ContainsIdentities := ⟨fun X ↦ ⟨X.coverOfIsIso (𝟙 X), fun _ ↦ P.id_mem _⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [W.IsStableUnderComposition] [P.IsStableUnderBaseChange] [P.IsStableUnderComposition] : (sourceLocalClosure W P).IsStableUnderComposition := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean index 9344fdf1b8f994..074c35b69a40ba 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Preimmersion.lean @@ -45,6 +45,7 @@ lemma isPreimmersion_eq_inf : namespace IsPreimmersion +set_option backward.isDefEq.respectTransparency.types false in instance : IsZariskiLocalAtTarget @IsPreimmersion := isPreimmersion_eq_inf ▸ inferInstance @@ -56,6 +57,7 @@ instance : MorphismProperty.IsMultiplicative @IsPreimmersion where id_mem _ := inferInstance comp_mem f g _ _ := ⟨g.isEmbedding.comp f.isEmbedding⟩ +set_option backward.isDefEq.respectTransparency.types false in instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsPreimmersion f] [IsPreimmersion g] : IsPreimmersion (f ≫ g) := MorphismProperty.IsStableUnderComposition.comp_mem f g inferInstance inferInstance @@ -95,6 +97,7 @@ lemma of_isLocalization {R S : Type u} [CommRing R] (M : Submonoid R) [CommRing (PrimeSpectrum.localization_comap_isEmbedding (R := R) S M) (RingHom.surjectiveOnStalks_of_isLocalization (M := M) S) +set_option backward.isDefEq.respectTransparency.types false in open Limits MorphismProperty in instance : IsStableUnderBaseChange @IsPreimmersion := by refine .mk' fun X Y Z f g _ _ ↦ ?_ @@ -110,9 +113,11 @@ instance : IsStableUnderBaseChange @IsPreimmersion := by variable {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) +set_option backward.isDefEq.respectTransparency.types false in instance [IsPreimmersion g] : IsPreimmersion (Limits.pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance [IsPreimmersion f] : IsPreimmersion (Limits.pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean index 5baa0b7f663642..60f7cac4cfa5d0 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean @@ -49,14 +49,17 @@ lemma isProper_eq : @IsProper = namespace IsProper +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.RespectsIso @IsProper := by rw [isProper_eq] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance stableUnderComposition : MorphismProperty.IsStableUnderComposition @IsProper := by rw [isProper_eq] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.IsMultiplicative @IsProper := by rw [isProper_eq] infer_instance @@ -65,10 +68,12 @@ instance [IsProper f] [IsProper g] : IsProper (f ≫ g) where instance (priority := 900) [IsFinite f] : IsProper f where +set_option backward.isDefEq.respectTransparency.types false in instance isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsProper := by rw [isProper_eq] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : IsZariskiLocalAtTarget @IsProper := by rw [isProper_eq] infer_instance @@ -81,6 +86,7 @@ instance (f : X ⟶ Y) (V : Y.Opens) [IsProper f] : IsProper (f ∣_ V) where end IsProper +set_option backward.isDefEq.respectTransparency.types false in lemma IsFinite.eq_isProper_inf_isAffineHom : @IsFinite = (@IsProper ⊓ @IsAffineHom : MorphismProperty _) := by have : (@IsAffineHom ⊓ @IsSeparated : MorphismProperty _) = @IsAffineHom := @@ -126,6 +132,7 @@ section GlobalSection variable (K : Type u) [Field K] +set_option backward.isDefEq.respectTransparency.types false in /-- If `f : X ⟶ Y` is universally closed and `Y` is affine, then the map on global sections is integral. -/ theorem isIntegral_appTop_of_universallyClosed (f : X ⟶ Y) [UniversallyClosed f] [IsAffine Y] : diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean index 8d498a091cc989..661b60d0ecfafc 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean @@ -134,10 +134,12 @@ instance : HasAffineProperty @QuasiCompact (fun X _ _ _ ↦ CompactSpace X) wher Opens.iSup_mk, Opens.coe_mk] exact isCompact_iUnion fun i => isCompact_iff_compactSpace.mpr (hS' i) +set_option backward.isDefEq.respectTransparency.types false in theorem compactSpace_iff_quasiCompact (X : Scheme) : CompactSpace X ↔ QuasiCompact (terminal.from X) := by rw [HasAffineProperty.iff_of_isAffine (P := @QuasiCompact)] +set_option backward.isDefEq.respectTransparency.types false in instance {X : Scheme} [CompactSpace X] : QuasiCompact X.toSpecΓ := HasAffineProperty.iff_of_isAffine.mpr ‹_› @@ -174,12 +176,15 @@ instance quasiCompact_isStableUnderBaseChange : variable {Z : Scheme.{u}} +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [QuasiCompact g] : QuasiCompact (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Z) (g : Y ⟶ Z) [QuasiCompact f] : QuasiCompact (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [QuasiCompact f] : QuasiCompact (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -206,6 +211,7 @@ lemma isCompact_iff_exists {U : X.Opens} : simp only [Set.image_univ, Scheme.Opens.range_ι] rwa [← Set.range_comp, ← TopCat.coe_comp, ← Scheme.Hom.comp_base, IsOpenImmersion.lift_fac] +set_option backward.isDefEq.respectTransparency.types false in @[stacks 01K9] nonrec lemma isClosedMap_iff_specializingMap (f : X ⟶ Y) [QuasiCompact f] : IsClosedMap f ↔ SpecializingMap f := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiFinite.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiFinite.lean index bf8b7375fbea2a..aae0b71cc25411 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiFinite.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiFinite.lean @@ -86,6 +86,7 @@ instance {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [LocallyQuasiFinite f] [LocallyQuasiFinite g] : LocallyQuasiFinite (f ≫ g) := MorphismProperty.comp_mem _ f g ‹_› ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (priority := low) [IsFinite f] : LocallyQuasiFinite f := by rw [HasAffineProperty.eq_targetAffineLocally @IsFinite] at ‹IsFinite f› rw [HasRingHomProperty.eq_affineLocally @LocallyQuasiFinite] @@ -114,14 +115,17 @@ instance : MorphismProperty.IsMultiplicative @LocallyQuasiFinite where instance : MorphismProperty.IsStableUnderBaseChange @LocallyQuasiFinite := HasRingHomProperty.isStableUnderBaseChange RingHom.QuasiFinite.isStableUnderBaseChange +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [LocallyQuasiFinite g] : LocallyQuasiFinite (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [LocallyQuasiFinite f] : LocallyQuasiFinite (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (V : Y.Opens) [LocallyQuasiFinite f] : LocallyQuasiFinite (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -182,6 +186,7 @@ lemma Scheme.Hom.tendsto_cofinite_cofinite [LocallyQuasiFinite f] [QuasiCompact Filter.Tendsto f .cofinite .cofinite := .cofinite_of_finite_preimage_singleton f.finite_preimage_singleton +set_option backward.isDefEq.respectTransparency.types false in nonrec lemma IsFinite.of_locallyQuasiFinite (f : X ⟶ Y) [LocallyQuasiFinite f] [QuasiCompact f] [IsLocallyArtinian Y] : IsFinite f := by change id _ -- avoid typeclass synthesis from getting stuck on the wlog hypothesis. @@ -267,6 +272,7 @@ instance (priority := low) [IsPreimmersion f] : LocallyQuasiFinite f := by .of_isPreimmersion (pullback.snd _ _) (isClosed_discrete _) infer_instance +set_option backward.isDefEq.respectTransparency.types false in nonrec lemma locallyQuasiFinite_iff_isDiscrete_preimage_singleton {f : X ⟶ Y} [LocallyOfFiniteType f] : LocallyQuasiFinite f ↔ ∀ x, IsDiscrete (f ⁻¹' {x}) := by @@ -293,6 +299,7 @@ nonrec lemma locallyQuasiFinite_iff_isDiscrete_preimage_singleton exact (Algebra.QuasiFinite.iff_finite_comap_preimage_singleton).mpr fun x ↦ ((Spec.map φ).isCompact_preimage_singleton _).finite (H _) +set_option backward.isDefEq.respectTransparency.types false in nonrec lemma LocallyQuasiFinite.of_finite_preimage_singleton [LocallyOfFiniteType f] (hf : ∀ x, (f ⁻¹' {x}).Finite) : LocallyQuasiFinite f := by change id _ -- avoid typeclass synthesis from getting stuck on the wlog hypothesis. @@ -332,6 +339,7 @@ if the stalk map `𝒪_{X, x} ⟶ 𝒪_{Y, f x}` is quasi-finite. -/ def Scheme.Hom.QuasiFiniteAt (x : X) : Prop := (f.stalkMap x).hom.QuasiFinite variable {f} in +set_option backward.isDefEq.respectTransparency.types false in lemma Scheme.Hom.QuasiFiniteAt.quasiFiniteAt {x : X} (hx : f.QuasiFiniteAt x) {V : X.Opens} (hV : IsAffineOpen V) {U : Y.Opens} (hU : IsAffineOpen U) (hVU : V ≤ f ⁻¹ᵁ U) (hxV : x ∈ V.1) : diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean index b4af43fadb9d62..ca8e9b2dcf4e4e 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean @@ -103,6 +103,7 @@ theorem quasiCompact_affineProperty_iff_quasiSeparatedSpace [IsAffine Y] (f : X theorem quasiSeparated_eq_diagonal_is_quasiCompact : @QuasiSeparated = MorphismProperty.diagonal @QuasiCompact := by ext; exact quasiSeparated_iff _ +set_option backward.isDefEq.respectTransparency.types false in instance : HasAffineProperty @QuasiSeparated (fun X _ _ _ ↦ QuasiSeparatedSpace X) where __ := HasAffineProperty.copy quasiSeparated_eq_diagonal_is_quasiCompact.symm @@ -111,6 +112,7 @@ instance : HasAffineProperty @QuasiSeparated (fun X _ _ _ ↦ QuasiSeparatedSpac instance (priority := 900) (f : X ⟶ Y) [Mono f] : QuasiSeparated f where +set_option backward.isDefEq.respectTransparency.types false in instance quasiSeparated_isStableUnderComposition : MorphismProperty.IsStableUnderComposition @QuasiSeparated := quasiSeparated_eq_diagonal_is_quasiCompact.symm ▸ inferInstance @@ -118,6 +120,7 @@ instance quasiSeparated_isStableUnderComposition : instance : MorphismProperty.IsMultiplicative @QuasiSeparated where id_mem _ := inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance quasiSeparated_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @QuasiSeparated := quasiSeparated_eq_diagonal_is_quasiCompact.symm ▸ inferInstance @@ -126,18 +129,22 @@ instance quasiSeparated_comp (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiSeparated f] [QuasiSeparated g] : QuasiSeparated (f ≫ g) := MorphismProperty.comp_mem _ f g inferInstance inferInstance +set_option backward.isDefEq.respectTransparency.types false in theorem quasiSeparatedSpace_iff_quasiSeparated (X : Scheme) : QuasiSeparatedSpace X ↔ QuasiSeparated (terminal.from X) := (HasAffineProperty.iff_of_isAffine (P := @QuasiSeparated)).symm +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [QuasiSeparated g] : QuasiSeparated (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [QuasiSeparated f] : QuasiSeparated (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [QuasiSeparated f] : QuasiSeparated (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -165,6 +172,7 @@ theorem IsAffineOpen.isQuasiSeparated {U : X.Opens} (hU : IsAffineOpen U) : rw [isQuasiSeparated_iff_quasiSeparatedSpace] exacts [@AlgebraicGeometry.quasiSeparatedSpace_of_isAffine _ hU, U.isOpen] +set_option backward.isDefEq.respectTransparency.types false in instance [QuasiSeparatedSpace X] : QuasiSeparated X.toSpecΓ := HasAffineProperty.iff_of_isAffine.mpr ‹_› @@ -221,6 +229,7 @@ theorem QuasiSeparated.of_comp (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiSeparated (f (pullbackRightPullbackFstIso g (Z.affineCover.f i) f).hom · exact inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (priority := low) QuasiSeparated.of_quasiSeparatedSpace (f : X ⟶ Y) [QuasiSeparatedSpace X] : QuasiSeparated f := have : QuasiSeparated (f ≫ Y.toSpecΓ) := @@ -242,6 +251,7 @@ lemma QuasiCompact.of_comp (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCompact (f ≫ g)] QuasiCompact f := MorphismProperty.of_postcomp _ _ g ‹_› ‹_› +set_option backward.isDefEq.respectTransparency.types false in instance (priority := low) quasiCompact_of_compactSpace {X Y : Scheme} (f : X ⟶ Y) [CompactSpace X] [QuasiSeparatedSpace Y] : QuasiCompact f := have : QuasiCompact (f ≫ Y.toSpecΓ) := HasAffineProperty.iff_of_isAffine.mpr ‹_› diff --git a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean index e741b68d3c7085..c89ed3ff41de98 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean @@ -110,6 +110,7 @@ Also see `affineLocally_iff_affineOpens_le`. -/ abbrev affineLocally : MorphismProperty Scheme.{u} := targetAffineLocally (sourceAffineLocally P) +set_option backward.isDefEq.respectTransparency.types false in theorem sourceAffineLocally_respectsIso (h₁ : RingHom.RespectsIso P) : (sourceAffineLocally P).toProperty.RespectsIso := by apply AffineTargetMorphismProperty.respectsIso_mk @@ -128,6 +129,7 @@ theorem affineLocally_respectsIso (h : RingHom.RespectsIso P) : (affineLocally P letI := sourceAffineLocally_respectsIso P h inferInstance +set_option backward.isDefEq.respectTransparency.types false in open Scheme in theorem sourceAffineLocally_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) (hU : IsAffineOpen U) : @@ -189,6 +191,7 @@ open RingHom variable {X Y : Scheme.{u}} {f : X ⟶ Y} +set_option backward.isDefEq.respectTransparency.types false in /-- If `P` holds for `f` over affine opens `U₂` of `Y` and `V₂` of `X` and `U₁` (resp. `V₁`) are open affine neighborhoods of `x` (resp. `f.base x`), then `P` also holds for `f` over some basic open of `U₁` (resp. `V₁`). -/ @@ -477,6 +480,7 @@ lemma stalkwise {P} (hP : RingHom.RespectsIso P) : S _ _ φ exact (stalkwise_SpecMap_iff hP (CommRingCat.ofHom φ)).symm +set_option backward.isDefEq.respectTransparency.types false in lemma stableUnderComposition (hP : RingHom.StableUnderComposition Q) : P.IsStableUnderComposition where comp_mem {X Y Z} f g hf hg := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean b/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean index 062845c2c55847..3f8bd43d9acf14 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean @@ -60,12 +60,14 @@ theorem isSeparated_eq_diagonal_isClosedImmersion : /-- Monomorphisms are separated. -/ instance (priority := 900) isSeparated_of_mono [Mono f] : IsSeparated f where +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.RespectsIso @IsSeparated := by rw [isSeparated_eq_diagonal_isClosedImmersion] infer_instance instance (priority := 900) [IsSeparated f] : QuasiSeparated f where +set_option backward.isDefEq.respectTransparency.types false in instance stableUnderComposition : MorphismProperty.IsStableUnderComposition @IsSeparated := by rw [isSeparated_eq_diagonal_isClosedImmersion] infer_instance @@ -76,18 +78,22 @@ instance [IsSeparated f] [IsSeparated g] : IsSeparated (f ≫ g) := instance : MorphismProperty.IsMultiplicative @IsSeparated where id_mem _ := inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsSeparated := by rw [isSeparated_eq_diagonal_isClosedImmersion] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : IsZariskiLocalAtTarget @IsSeparated := by rw [isSeparated_eq_diagonal_isClosedImmersion] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [IsSeparated g] : IsSeparated (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [IsSeparated f] : IsSeparated (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance @@ -108,6 +114,7 @@ instance (R S : CommRingCat.{u}) (f : R ⟶ S) : IsSeparated (Spec.map f) := by exact .spec_of_surjective _ fun x ↦ ⟨.tmul R 1 x, (Algebra.TensorProduct.lmul'_apply_tmul (R := R) (S := S) 1 x).trans (one_mul x)⟩ +set_option backward.isDefEq.respectTransparency.types false in @[instance 100] lemma of_isAffineHom [h : IsAffineHom f] : IsSeparated f := by wlog hY : IsAffine Y @@ -197,6 +204,7 @@ lemma Scheme.Pullback.range_diagonal_subset_diagonalCoverDiagonalRange : congr 5 apply pullback.hom_ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in lemma isClosedImmersion_diagonal_restrict_diagonalCoverDiagonalRange [∀ i, IsAffine (𝒰.X i)] [∀ i j, IsAffine ((𝒱 i).X j)] : IsClosedImmersion (pullback.diagonal f ∣_ diagonalCoverDiagonalRange f 𝒰 𝒱) := by @@ -358,6 +366,7 @@ instance (f g : X ⟶ Y) [Y.IsSeparated] : IsClosedImmersion (Limits.equalizer. end Scheme +set_option backward.isDefEq.respectTransparency.types false in instance IsSeparated.hasAffineProperty : HasAffineProperty @IsSeparated fun X _ _ _ ↦ X.IsSeparated := by convert! HasAffineProperty.of_isZariskiLocalAtTarget @IsSeparated with X Y f hY diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean index d90933f9f5698c..fdcb799862f8f0 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean @@ -183,14 +183,17 @@ instance (priority := 900) [IsOpenImmersion f] : SmoothOfRelativeDimension 0 f : instance (priority := 900) [IsOpenImmersion f] : Smooth f := SmoothOfRelativeDimension.smooth 0 f +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [Smooth g] : Smooth (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [Smooth f] : Smooth (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance (f : X ⟶ Y) (V : Y.Opens) [Smooth f] : Smooth (f ∣_ V) := IsZariskiLocalAtTarget.restrict ‹_› V @@ -318,6 +321,7 @@ lemma Scheme.Hom.smoothLocus_eq_top (f : X ⟶ Y) [Smooth f] : rw [Scheme.Hom.mem_smoothLocus, formallySmooth_stalkMap_iff U hU V hV hVU hxV] exact inferInstanceAs (Algebra.IsSmoothAt _ _) +set_option backward.isDefEq.respectTransparency.types false in lemma Scheme.Hom.smoothLocus_eq_top_iff {f : X ⟶ Y} [LocallyOfFinitePresentation f] : f.smoothLocus = ⊤ ↔ Smooth f := by refine ⟨fun H ↦ ?_, fun _ ↦ f.smoothLocus_eq_top⟩ @@ -358,6 +362,7 @@ lemma Scheme.Hom.genericPoint_mem_smoothLocus_of_perfectField (L := (Spec.structureSheaf K).presheaf.stalk (f (genericPoint X))) exact Algebra.FormallySmooth.of_perfectField +set_option backward.isDefEq.respectTransparency.types false in lemma Scheme.Hom.dense_smoothLocus_of_perfectField {K : Type u} [Field K] [PerfectField K] [IsReduced X] (f : X ⟶ Spec (.of K)) [LocallyOfFinitePresentation f] : Dense (f.smoothLocus : Set X) := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean b/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean index 730acfea42a4df..1164abb4b6a5dc 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/SurjectiveOnStalks.lean @@ -54,6 +54,7 @@ instance : MorphismProperty.IsMultiplicative @SurjectiveOnStalks where rw [Scheme.Hom.stalkMap_comp] exact (f.stalkMap_surjective x).comp (g.stalkMap_surjective (f x)) +set_option backward.isDefEq.respectTransparency.types false in instance comp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [SurjectiveOnStalks f] [SurjectiveOnStalks g] : SurjectiveOnStalks (f ≫ g) := MorphismProperty.IsStableUnderComposition.comp_mem f g inferInstance inferInstance diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean b/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean index e71b9335da7474..886a03127ba21d 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UnderlyingMap.lean @@ -239,6 +239,7 @@ lemma IsDominant.of_comp [H : IsDominant (f ≫ g)] : IsDominant g := by lemma IsDominant.comp_iff [IsDominant f] : IsDominant (f ≫ g) ↔ IsDominant g := ⟨fun _ ↦ of_comp f g, fun _ ↦ inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in instance IsDominant.respectsIso : MorphismProperty.RespectsIso @IsDominant := MorphismProperty.respectsIso_of_isStableUnderComposition fun _ _ f (_ : IsIso f) ↦ inferInstance @@ -282,6 +283,7 @@ instance specializingMap_respectsIso : (topologically @SpecializingMap).Respects · introv hf hg exact hf.comp hg +set_option backward.isDefEq.respectTransparency.types false in instance specializingMap_isZariskiLocalAtTarget : IsZariskiLocalAtTarget (topologically @SpecializingMap) := by apply topologically_isZariskiLocalAtTarget diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean index 6d72007e6c9e16..bee804f020a50e 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyClosed.lean @@ -74,6 +74,7 @@ instance universallyClosed_isStableUnderComposition : rw [universallyClosed_eq] infer_instance +set_option backward.isDefEq.respectTransparency.types false in lemma UniversallyClosed.of_comp_surjective {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [UniversallyClosed (f ≫ g)] [Surjective f] : UniversallyClosed g := by constructor @@ -90,10 +91,12 @@ instance universallyClosedTypeComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) instance : MorphismProperty.IsMultiplicative @UniversallyClosed where id_mem _ := inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance universallyClosed_fst {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) [hg : UniversallyClosed g] : UniversallyClosed (pullback.fst f g) := MorphismProperty.pullback_fst f g hg +set_option backward.isDefEq.respectTransparency.types false in instance universallyClosed_snd {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) [hf : UniversallyClosed f] : UniversallyClosed (pullback.snd f g) := MorphismProperty.pullback_snd f g hf @@ -164,6 +167,7 @@ lemma Scheme.Hom.isProperMap (f : X ⟶ Y) [UniversallyClosed f] : IsProperMap f instance (priority := 900) [UniversallyClosed f] : QuasiCompact f where isCompact_preimage _ _ := f.isProperMap.isCompact_preimage +set_option backward.isDefEq.respectTransparency.types false in lemma universallyClosed_eq_universallySpecializing : @UniversallyClosed = (topologically @SpecializingMap).universally ⊓ @QuasiCompact := by rw [← universally_eq_iff (P := @QuasiCompact).mpr inferInstance, ← universally_inf] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean index d55be0d5ba408c..0f48604200a5a7 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyInjective.lean @@ -55,6 +55,7 @@ theorem universallyInjective_eq : @UniversallyInjective = universally (topologically (Injective ·)) := by ext X Y f; rw [universallyInjective_iff] +set_option backward.isDefEq.respectTransparency.types false in theorem universallyInjective_eq_diagonal : @UniversallyInjective = diagonal @Surjective := by apply le_antisymm @@ -79,9 +80,11 @@ instance (priority := 900) [Mono f] : UniversallyInjective f := have := (pullback.isIso_diagonal_iff f).mpr inferInstance (UniversallyInjective.iff_diagonal f).mpr inferInstance +set_option backward.isDefEq.respectTransparency.types false in theorem UniversallyInjective.respectsIso : RespectsIso @UniversallyInjective := universallyInjective_eq_diagonal.symm ▸ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance UniversallyInjective.isStableUnderBaseChange : IsStableUnderBaseChange @UniversallyInjective := universallyInjective_eq_diagonal.symm ▸ inferInstance @@ -93,6 +96,7 @@ instance universallyInjective_isStableUnderComposition : instance : MorphismProperty.IsMultiplicative @UniversallyInjective where id_mem _ := inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance universallyInjective_isZariskiLocalAtTarget : IsZariskiLocalAtTarget @UniversallyInjective := universallyInjective_eq_diagonal.symm ▸ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean index 0dbe1974e1aee9..143f8f2c6401ff 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/UniversallyOpen.lean @@ -79,10 +79,12 @@ instance {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) instance : MorphismProperty.IsMultiplicative @UniversallyOpen where id_mem _ := inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance fst {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) [hg : UniversallyOpen g] : UniversallyOpen (pullback.fst f g) := MorphismProperty.pullback_fst f g hg +set_option backward.isDefEq.respectTransparency.types false in instance snd {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) [hf : UniversallyOpen f] : UniversallyOpen (pullback.snd f g) := MorphismProperty.pullback_snd f g hf diff --git a/Mathlib/AlgebraicGeometry/Morphisms/WeaklyEtale.lean b/Mathlib/AlgebraicGeometry/Morphisms/WeaklyEtale.lean index a14d8c33f2c76b..de828d12bb7a15 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/WeaklyEtale.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/WeaklyEtale.lean @@ -57,33 +57,41 @@ theorem weaklyEtale_eq_flat_inf_diagonal_flat : /-- Etale morphisms are weakly étale. -/ instance (priority := 900) [Etale f] : WeaklyEtale f where +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.RespectsIso @WeaklyEtale := by rw [weaklyEtale_eq_flat_inf_diagonal_flat] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.IsMultiplicative @WeaklyEtale := by rw [weaklyEtale_eq_flat_inf_diagonal_flat] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance [WeaklyEtale f] [WeaklyEtale g] : WeaklyEtale (f ≫ g) := MorphismProperty.comp_mem _ f g inferInstance inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance : MorphismProperty.IsStableUnderBaseChange @WeaklyEtale := by rw [weaklyEtale_eq_flat_inf_diagonal_flat] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : IsZariskiLocalAtSource @WeaklyEtale := by rw [weaklyEtale_eq_flat_inf_diagonal_flat] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : IsZariskiLocalAtTarget @WeaklyEtale := by rw [weaklyEtale_eq_flat_inf_diagonal_flat] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [WeaklyEtale g] : WeaklyEtale (pullback.fst f g) := MorphismProperty.pullback_fst f g inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [WeaklyEtale f] : WeaklyEtale (pullback.snd f g) := MorphismProperty.pullback_snd f g inferInstance @@ -99,6 +107,7 @@ instance (f : X ⟶ Y) (U : X.Opens) (V : Y.Opens) (e) [WeaklyEtale f] : `IsImmersion (diagonal f) → Mono (diagonal f) → IsIso (diagonal (diagonal f))`. -/ instance (f : X ⟶ Y) [WeaklyEtale f] : WeaklyEtale (pullback.diagonal f) where +set_option backward.isDefEq.respectTransparency.types false in @[stacks 0951] instance : MorphismProperty.HasOfPostcompProperty @WeaklyEtale @WeaklyEtale := by rw [MorphismProperty.hasOfPostcompProperty_iff_le_diagonal] diff --git a/Mathlib/AlgebraicGeometry/Noetherian.lean b/Mathlib/AlgebraicGeometry/Noetherian.lean index 9e57b460d25af5..69e87d81797b35 100644 --- a/Mathlib/AlgebraicGeometry/Noetherian.lean +++ b/Mathlib/AlgebraicGeometry/Noetherian.lean @@ -161,6 +161,7 @@ instance {U : X.Opens} [IsLocallyNoetherian X] : IsLocallyNoetherian U := instance {U : X.OpenCover} (i) [IsLocallyNoetherian X] : IsLocallyNoetherian (U.X i) := isLocallyNoetherian_of_isOpenImmersion (U.f i) +set_option backward.isDefEq.respectTransparency.types false in /-- If `𝒰` is an open cover of a scheme `X`, then `X` is locally Noetherian if and only if `𝒰.X i` are all locally Noetherian. -/ theorem isLocallyNoetherian_iff_openCover (𝒰 : Scheme.OpenCover X) : @@ -214,6 +215,7 @@ instance (priority := 100) {Z : Scheme} [IsLocallyNoetherian X] · exact Set.inter_subset_left · exact Set.inter_subset_right +set_option backward.isDefEq.respectTransparency.types false in /-- A locally Noetherian scheme is quasi-separated. -/ @[stacks 01OY] instance (priority := 100) IsLocallyNoetherian.quasiSeparatedSpace [IsLocallyNoetherian X] : @@ -312,6 +314,7 @@ theorem isNoetherian_iff_of_finite_affine_openCover {𝒰 : Scheme.OpenCover.{v, · exact (isLocallyNoetherian_iff_of_affine_openCover _).mpr hNoeth · exact Scheme.OpenCover.compactSpace 𝒰 +set_option backward.isDefEq.respectTransparency.types false in /-- A Noetherian scheme has a Noetherian underlying topological space. -/ @[stacks 01OZ] instance (priority := 100) IsNoetherian.noetherianSpace [IsNoetherian X] : diff --git a/Mathlib/AlgebraicGeometry/Normalization.lean b/Mathlib/AlgebraicGeometry/Normalization.lean index 7a32d452744893..5d1a5b7a5238b9 100644 --- a/Mathlib/AlgebraicGeometry/Normalization.lean +++ b/Mathlib/AlgebraicGeometry/Normalization.lean @@ -155,6 +155,7 @@ def toNormalization : X ⟶ f.normalization := rw [← Spec.map_comp_assoc] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma ι_toNormalization (U : Y.affineOpens) : @@ -179,6 +180,7 @@ lemma ι_fromNormalization (U : Y.affineOpens) : Spec.map (f.normalizationDiagramMap.app (.op U.1)) ≫ U.2.fromSpec := colimit.ι_desc _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma fromNormalization_preimage (U : Y.affineOpens) : f.fromNormalization ⁻¹ᵁ U = (f.normalizationOpenCover.f U).opensRange := by simpa using! f.normalizationGlueData.toBase_preimage_eq_opensRange_ι U @@ -211,6 +213,7 @@ instance : IsIntegralHom f.fromNormalization := by rw [← cancel_mono U.2.fromSpec] simp [IsAffineOpen.isoSpec_hom, e, ι_fromNormalization] +set_option backward.isDefEq.respectTransparency.types false in /-- The sections of the relative normalization on the preimage of an affine open is isomorphic to the integral closure. -/ noncomputable @@ -340,6 +343,7 @@ instance : IsDominant f.toNormalization := by rw [IdealSheafData.support_bot, Scheme.Hom.support_ker, TopologicalSpace.Closeds.coe_top] at this exact ⟨dense_iff_closure_eq.mpr this⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[stacks 0AXN] instance [IsReduced X] : IsReduced f.normalization := diff --git a/Mathlib/AlgebraicGeometry/OpenImmersion.lean b/Mathlib/AlgebraicGeometry/OpenImmersion.lean index c4467f35be902f..976c91bda282e4 100644 --- a/Mathlib/AlgebraicGeometry/OpenImmersion.lean +++ b/Mathlib/AlgebraicGeometry/OpenImmersion.lean @@ -186,16 +186,19 @@ lemma isIso_app (V : Y.Opens) (hV : V ≤ f.opensRange) : IsIso (f.app V) := by rw [show V = f ''ᵁ f ⁻¹ᵁ V from Opens.ext (Set.image_preimage_eq_of_subset hV).symm] infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism `Γ(Y, f(U)) ≅ Γ(X, U)` induced by an open immersion `f : X ⟶ Y`. -/ def appIso (U) : Γ(Y, f ''ᵁ U) ≅ Γ(X, U) := (asIso <| LocallyRingedSpace.IsOpenImmersion.invApp f.toLRSHom U).symm +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem appIso_inv_naturality {U V : X.Opens} (i : op U ⟶ op V) : X.presheaf.map i ≫ (f.appIso V).inv = (f.appIso U).inv ≫ Y.presheaf.map (f.opensFunctor.op.map i) := PresheafedSpace.IsOpenImmersion.inv_naturality _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem appIso_hom (U) : (f.appIso U).hom = f.app (f ''ᵁ U) ≫ X.presheaf.map (eqToHom (preimage_image_eq f U).symm).op := @@ -206,12 +209,14 @@ theorem appIso_hom' (U) : (f.appIso U).hom = f.appLE (f ''ᵁ U) U (preimage_image_eq f U).ge := f.appIso_hom U +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem app_appIso_inv (U) : f.app U ≫ (f.appIso (f ⁻¹ᵁ U)).inv = Y.presheaf.map (homOfLE (Set.image_preimage_subset f U.1)).op := PresheafedSpace.IsOpenImmersion.app_invApp _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `app_invApp` that gives an `eqToHom` instead of `homOfLE`. -/ @[reassoc] theorem app_invApp' (U) (hU : U ≤ f.opensRange) : @@ -225,6 +230,7 @@ theorem appIso_inv_app (U) : (f.appIso U).inv ≫ f.app (f ''ᵁ U) = X.presheaf.map (eqToHom (preimage_image_eq f U)).op := (PresheafedSpace.IsOpenImmersion.invApp_app _ _).trans (by rw [eqToHom_op]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp), elementwise nosimp] lemma appLE_appIso_inv {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] {U : Y.Opens} @@ -257,6 +263,7 @@ lemma id_appIso (U : X.Opens) : (𝟙 X :).appIso U = X.presheaf.mapIso (eqToIso (by simp)).op := by ext; simp [appIso_hom] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma comp_appIso {X Y Z : Scheme.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) [IsOpenImmersion f] [IsOpenImmersion g] (U : X.Opens) : @@ -401,6 +408,7 @@ lemma Scheme.ofRestrict_appLE (V W e) : dsimp [Hom.appLE] exact (X.presheaf.map_comp _ _).symm +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma Scheme.ofRestrict_appIso (U) : (X.ofRestrict h).appIso U = Iso.refl _ := by @@ -434,6 +442,7 @@ theorem of_isIso_stalkMap {X Y : Scheme.{u}} (f : X ⟶ Y) (hf : IsOpenEmbedding have (x : X) : IsIso (f.toShHom.hom.stalkMap x) := inferInstanceAs (IsIso (f.stalkMap x)) SheafedSpace.IsOpenImmersion.of_stalk_iso f.toShHom hf +set_option backward.isDefEq.respectTransparency.types false in instance {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (x : X) : IsIso (f.stalkMap x) := inferInstanceAs <| IsIso (f.toLRSHom.stalkMap x) @@ -513,6 +522,7 @@ instance hasLimit_cospan_forget_of_right' : HasLimit (cospan ((cospan g f ⋙ forget).map Hom.inl) ((cospan g f ⋙ forget).map Hom.inr)) := show HasLimit (cospan ((forget).map g) ((forget).map f)) from inferInstance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance forgetCreatesPullbackOfLeft : CreatesLimit (cospan f g) forget := createsLimitOfFullyFaithfulOfIso @@ -548,6 +558,7 @@ instance : IsOpenImmersion (pullback.fst g f) := by rw [← pullbackSymmetry_hom_comp_snd] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance [IsOpenImmersion g] : IsOpenImmersion (limit.π (cospan f g) WalkingCospan.one) := by rw [← limit.w (cospan f g) WalkingCospan.Hom.inl] @@ -806,6 +817,7 @@ lemma image_zeroLocus {U : X.Opens} (s : Set Γ(X, U)) : · simp only [Set.mem_inter_iff, hx, and_false, iff_false] exact fun H ↦ hx (Set.image_subset_range _ _ H) +set_option backward.isDefEq.respectTransparency.types false in /-- If ``` P --fst--> X diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean index ff1d90bb7626a8..1f22acba0821c0 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean @@ -141,6 +141,7 @@ noncomputable def basicOpenToSpec : (basicOpen 𝒜 f).toScheme ⟶ Spec (.of <| Away 𝒜 f) := (basicOpen 𝒜 f).toSpecΓ ≫ Spec.map (awayToSection 𝒜 f) +set_option backward.isDefEq.respectTransparency.types false in lemma basicOpenToSpec_app_top : (basicOpenToSpec 𝒜 f).app ⊤ = (Scheme.ΓSpecIso _).hom ≫ awayToSection 𝒜 f ≫ (basicOpen 𝒜 f).topIso.inv := by @@ -353,6 +354,7 @@ end basicOpen section stalk +set_option backward.isDefEq.respectTransparency.types false in /-- The stalk of `Proj A` at `x` is the degree `0` part of the localization of `A` at `x`. -/ noncomputable def stalkIso (x : Proj 𝒜) : @@ -379,6 +381,7 @@ def toBasicOpenOfGlobalSections (H : f t = x) (h0d : 0 < d) (hd : t ∈ 𝒜 d) · rw [← Submonoid.map_le_iff_le_comap, Submonoid.map_powers] simp [H] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma homOfLE_toBasicOpenOfGlobalSections_ι {H : f t = x} {h0d : 0 < d} {hd : t ∈ 𝒜 d} {H' : f t' = x'} {h0d' : 0 < d'} {hd' : t' ∈ 𝒜 d'} @@ -410,6 +413,7 @@ lemma homOfLE_toBasicOpenOfGlobalSections_ι variable (f : A →+* Γ(X, ⊤)) (hf : (HomogeneousIdeal.irrelevant 𝒜).toIdeal.map f = ⊤) +set_option backward.isDefEq.respectTransparency false in /-- Given a graded ring `A` and a map `f : A →+* Γ(X, ⊤)` such that the image of the irrelevant ideal under `f` generates the whole ring, the set of `D(f(r))` for homogeneous `r` of positive degree forms an open cover on `X`. -/ @@ -437,6 +441,7 @@ def openCoverOfMapIrrelevantEqTop : X.OpenCover := rw [← Scheme.zeroLocus_span, Set.range_comp', ← Ideal.map_span, H, hf] simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a graded ring `A` and a map `f : A →+* Γ(X, ⊤)` such that the image of the irrelevant ideal under `f` generates the whole ring, we can construct a map `X ⟶ Proj 𝒜`. -/ @@ -492,6 +497,7 @@ lemma fromOfGlobalSections_preimage_basicOpen {r : A} {n : ℕ} (hn : 0 < n) (hr ← Scheme.Hom.comp_apply, fromOfGlobalSections] simp +set_option backward.isDefEq.respectTransparency.types false in lemma fromOfGlobalSections_morphismRestrict {r : A} {n : ℕ} (hn : 0 < n) (hr : r ∈ 𝒜 n) : (fromOfGlobalSections 𝒜 f hf) ∣_ (basicOpen 𝒜 r) = (Scheme.isoOfEq _ (fromOfGlobalSections_preimage_basicOpen _ _ _ hn hr)).hom ≫ diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Functor.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Functor.lean index e087a6d8ef7445..19b55940cfcc83 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Functor.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Functor.lean @@ -95,6 +95,7 @@ variable {A B C σ τ ψ : Type u} [CommRing A] [SetLike σ A] [AddSubgroupClass {𝒜 : ℕ → σ} {ℬ : ℕ → τ} {𝒞 : ℕ → ψ} [GradedRing 𝒜] [GradedRing ℬ] [GradedRing 𝒞] (f : 𝒜 →+*ᵍ ℬ) (g : ℬ →+*ᵍ 𝒞) (hf : ℬ₊ ≤ 𝒜₊.map f) (hg : 𝒞₊ ≤ ℬ₊.map g) +set_option backward.isDefEq.respectTransparency.types false in /-- The underlying map of `Proj ℬ ⟶ Proj 𝒜` on the level of sheafed spaces. -/ @[simps! (isSimp := false)] noncomputable def sheafedSpaceMap : Proj.toSheafedSpace ℬ ⟶ Proj.toSheafedSpace 𝒜 where @@ -102,6 +103,7 @@ variable {A B C σ τ ψ : Type u} [CommRing A] [SetLike σ A] [AddSubgroupClass { base := TopCat.ofHom <| comap f hf c := { app U := CommRingCat.ofHom <| comapStructureSheaf f hf _ _ Set.Subset.rfl } } +set_option backward.isDefEq.respectTransparency.types false in lemma germ_map_sectionInBasicOpen {p : ProjectiveSpectrum ℬ} (c : NumDenSameDeg 𝒜 (p.comap f hf).1.toIdeal.primeCompl) : (toSheafedSpace ℬ).presheaf.germ @@ -112,12 +114,14 @@ lemma germ_map_sectionInBasicOpen {p : ProjectiveSpectrum ℬ} (sectionInBasicOpen ℬ p (c.map _ le_rfl)) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma val_sectionInBasicOpen_apply (p : ProjectiveSpectrum.top 𝒜) (c : NumDenSameDeg 𝒜 p.1.toIdeal.primeCompl) (q : ProjectiveSpectrum.basicOpen 𝒜 c.den) : ((sectionInBasicOpen 𝒜 p c).val q).val = .mk c.num ⟨c.den, q.2⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[elementwise] theorem localRingHom_comp_stalkIso (p : ProjectiveSpectrum ℬ) : (stalkIso 𝒜 (ProjectiveSpectrum.comap f hf p)).hom ≫ CommRingCat.ofHom (localRingHom f _ _ rfl) ≫ @@ -156,9 +160,11 @@ noncomputable def map : Proj ℬ ⟶ Proj 𝒜 where @[simp] theorem map_preimage_basicOpen (s : A) : map f hf ⁻¹ᵁ basicOpen 𝒜 s = basicOpen ℬ (f s) := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem ι_comp_map (s : A) : (basicOpen ℬ (f s)).ι ≫ map f hf = (map f hf).resLE _ _ le_rfl ≫ (basicOpen 𝒜 s).ι := by simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma awayToSection_comp_appLE {i : ℕ} {s : A} (hs : s ∈ 𝒜 i) : awayToSection 𝒜 s ≫ Scheme.Hom.appLE (map f hf) (basicOpen 𝒜 s) (basicOpen ℬ (f s)) (by rfl) = diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean index a938ef1f7147b6..f6777a871370e1 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean @@ -125,6 +125,7 @@ instance isSeparated : IsSeparated (toSpecZero 𝒜) := by exact DFunLike.congr_fun (Algebra.TensorProduct.lift_comp_includeRight (awayMapₐ 𝒜 j.2.2 rfl) (awayMapₐ 𝒜 i.2.2 (mul_comm _ _)) (fun _ _ ↦ .all _ _)).symm x +set_option backward.isDefEq.respectTransparency.types false in @[stacks 01MC] instance : Scheme.IsSeparated (Proj 𝒜) := (HasAffineProperty.iff_of_isAffine (P := @IsSeparated)).mp (isSeparated 𝒜) @@ -133,6 +134,7 @@ end IsSeparated section LocallyOfFiniteType +set_option backward.isDefEq.respectTransparency.types false in instance [Algebra.FiniteType (𝒜 0) A] : LocallyOfFiniteType (Proj.toSpecZero 𝒜) := by obtain ⟨x, hx, hx'⟩ := GradedAlgebra.exists_finset_adjoin_eq_top_and_homogeneous_ne_zero 𝒜 choose d hd hxd using hx' @@ -148,6 +150,7 @@ end LocallyOfFiniteType section QuasiCompact +set_option backward.isDefEq.respectTransparency.types false in instance [Algebra.FiniteType (𝒜 0) A] : QuasiCompact (Proj.toSpecZero 𝒜) := by rw [HasAffineProperty.iff_of_isAffine (P := @QuasiCompact)] obtain ⟨x, hx, hx'⟩ := GradedAlgebra.exists_finset_adjoin_eq_top_and_homogeneous_ne_zero 𝒜 @@ -309,6 +312,7 @@ theorem valuativeCriterion_existence_aux Finset.univ.prod_erase_mul d (h := Finset.mem_univ _), mul_comm _ a, mul_right_comm] +set_option backward.isDefEq.respectTransparency.types false in @[stacks 01MF] lemma valuativeCriterion_existence [Algebra.FiniteType (𝒜 0) A] : ValuativeCriterion.Existence (Proj.toSpecZero 𝒜) := by diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean index 0df625c2b1eb3b..2181c89d188e4c 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean @@ -174,6 +174,7 @@ def carrier : Ideal (A⁰_ f) := Ideal.comap (algebraMap (A⁰_ f) (Away f)) (x.val.asHomogeneousIdeal.toIdeal.map (algebraMap A (Away f))) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mk_mem_carrier (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) : HomogeneousLocalization.mk z ∈ carrier x ↔ z.num.1 ∈ x.1.asHomogeneousIdeal := by @@ -186,6 +187,7 @@ theorem mk_mem_carrier (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers · exact (disjoint_powers_iff_notMem_of_isPrime _).mpr x.2 · exact isUnit_of_invertible _ +set_option backward.isDefEq.respectTransparency.types false in theorem isPrime_carrier : Ideal.IsPrime (carrier x) := by refine Ideal.IsPrime.comap _ (hK := ?_) exact IsLocalization.isPrime_of_isPrime_disjoint @@ -307,6 +309,7 @@ theorem mem_carrier_iff_of_mem (hm : 0 < m) (q : Spec.T A⁰_ f) (a : A) {n} (hn HomogeneousLocalization.val_mk, Localization.mk_zero, HomogeneousLocalization.val_zero] · simp only [proj_apply, decompose_of_mem_same _ hn] +set_option backward.isDefEq.respectTransparency.types false in theorem mem_carrier_iff_of_mem_mul (hm : 0 < m) (q : Spec.T A⁰_ f) (a : A) {n} (hn : a ∈ 𝒜 (n * m)) : a ∈ carrier f_deg q ↔ (HomogeneousLocalization.mk ⟨m * n, ⟨a, mul_comm n m ▸ hn⟩, @@ -613,6 +616,7 @@ lemma awayToSection_germ (f x hx) : apply (Proj.stalkIso' 𝒜 x).eq_symm_apply.mpr apply Proj.stalkIso'_germ +set_option backward.isDefEq.respectTransparency.types false in lemma awayToSection_apply (f : A) (x p) : (((ProjectiveSpectrum.Proj.awayToSection 𝒜 f).1 x).val p).val = IsLocalization.map (M := Submonoid.powers f) (T := p.1.1.toIdeal.primeCompl) _ @@ -667,6 +671,7 @@ lemma toSpec_base_apply_eq_comap {f} (x : Proj| pbo f) : (HomogeneousLocalization.AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal) _ _ ((Proj| pbo f).presheaf.stalk x) _ _ _ (isLocalHom_of_isIso _))) +set_option backward.isDefEq.respectTransparency.types false in lemma toSpec_base_apply_eq {f} (x : Proj| pbo f) : (toSpec 𝒜 f).base x = ProjIsoSpecTopComponent.toSpec 𝒜 f x := toSpec_base_apply_eq_comap 𝒜 x |>.trans <| PrimeSpectrum.ext <| Ideal.ext fun z => @@ -689,6 +694,7 @@ lemma mk_mem_toSpec_base_apply {f} (x : Proj| pbo f) z.num.1 ∈ x.1.asHomogeneousIdeal := (toSpec_base_apply_eq 𝒜 x).symm ▸ ProjIsoSpecTopComponent.ToSpec.mk_mem_carrier _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma toSpec_preimage_basicOpen {f} (t : NumDenSameDeg 𝒜 (.powers f)) : (Opens.map (toSpec 𝒜 f).base).obj (sbo (HomogeneousLocalization.mk t)) = @@ -774,6 +780,7 @@ lemma isLocalization_atPrime (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 rw [mul_left_comm, mul_left_comm y.den.1, ← tsub_add_cancel_of_le (show 1 ≤ m from hm), pow_succ, mul_assoc, mul_assoc, e] +set_option backward.isDefEq.respectTransparency.types false in /-- For an element `f ∈ A` with positive degree and a homogeneous ideal in `D(f)`, we have that the stalk of `Spec A⁰_ f` at `y` is isomorphic to `A⁰ₓ` where `y` is the point in `Proj` corresponding @@ -791,6 +798,7 @@ def specStalkEquiv (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) : (S := (Spec.structureSheaf (A⁰_ f)).presheaf.stalk ((toSpec 𝒜 f).base x)) (Q := AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal)).toRingEquiv.toCommRingCatIso +set_option backward.isDefEq.respectTransparency.types false in lemma toStalk_specStalkEquiv (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) : StructureSheaf.toStalk (A⁰_ f) ((toSpec 𝒜 f).base x) ≫ (specStalkEquiv 𝒜 f x f_deg hm).hom = CommRingCat.ofHom (mapId _ <| Submonoid.powers_le.mpr x.2) := @@ -803,6 +811,7 @@ lemma toStalk_specStalkEquiv (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 (S := (Spec.structureSheaf (A⁰_ f)).presheaf.stalk ((toSpec 𝒜 f).base x)) (Q := AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal)).toAlgHom.comp_algebraMap +set_option backward.isDefEq.respectTransparency.types false in lemma stalkMap_toSpec (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) : (toSpec 𝒜 f).stalkMap x = (specStalkEquiv 𝒜 f x f_deg hm).hom ≫ (Proj.stalkIso' 𝒜 x.1).toCommRingCatIso.inv ≫ @@ -836,6 +845,7 @@ def projIsoSpec (f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) : (Proj| pbo f) ≅ (Spec (A⁰_ f)) := @asIso _ _ _ _ (f := toSpec 𝒜 f) (isIso_toSpec 𝒜 f f_deg hm) +set_option backward.isDefEq.respectTransparency false in /-- This is the scheme `Proj(A)` for any `ℕ`-graded ring `A`. -/ diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean index 90159f71e32c95..b66abd44acadf7 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/StructureSheaf.lean @@ -68,6 +68,7 @@ local notation3 "at " x => namespace ProjectiveSpectrum.StructureSheaf +set_option backward.isDefEq.respectTransparency.types false in variable {𝒜} in /-- The predicate saying that a dependent function on an open `U` is realised as a fixed fraction `r / s` of *same grading* in each of the stalks (which are localizations at various prime ideals). @@ -75,6 +76,7 @@ variable {𝒜} in def IsFraction {U : Opens (ProjectiveSpectrum.top 𝒜)} (f : ∀ x : U, at x.1) : Prop := ∃ (i : ℕ) (r s : 𝒜 i) (s_nin : ∀ x : U, s.1 ∉ x.1.asHomogeneousIdeal), ∀ x : U, f x = .mk ⟨i, r, s, s_nin x⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The predicate `IsFraction` is "prelocal", in the sense that if it holds on `U` it holds on any open subset `V` of `U`. @@ -83,6 +85,7 @@ def isFractionPrelocal : PrelocalPredicate fun x : ProjectiveSpectrum.top 𝒜 = pred f := IsFraction f res := by rintro V U i f ⟨j, r, s, h, w⟩; exact ⟨j, r, s, (h <| i ·), (w <| i ·)⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- We will define the structure sheaf as the subsheaf of all dependent functions in `Π x : U, HomogeneousLocalization 𝒜 x` consisting of those functions which can locally be expressed as a ratio of `A` of same grading. -/ @@ -95,14 +98,17 @@ variable {𝒜} open Submodule SetLike.GradedMonoid HomogeneousLocalization +set_option backward.isDefEq.respectTransparency.types false in theorem zero_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) : (isLocallyFraction 𝒜).pred (0 : ∀ x : U.unop, at x.1) := fun x => ⟨unop U, x.2, 𝟙 (unop U), ⟨0, ⟨0, zero_mem _⟩, ⟨1, one_mem_graded _⟩, _, fun _ => rfl⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem one_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) : (isLocallyFraction 𝒜).pred (1 : ∀ x : U.unop, at x.1) := fun x => ⟨unop U, x.2, 𝟙 (unop U), ⟨0, ⟨1, one_mem_graded _⟩, ⟨1, one_mem_graded _⟩, _, fun _ => rfl⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem add_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1) (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) : (isLocallyFraction 𝒜).pred (a + b) := fun x => by @@ -119,6 +125,7 @@ theorem add_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x simp only [Subtype.forall, Opens.apply_mk] at wa wb simp [wa y hy.1, wb y hy.2, ext_iff_val, add_mk, add_comm (sa * rb)] +set_option backward.isDefEq.respectTransparency.types false in theorem neg_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a : ∀ x : U.unop, at x.1) (ha : (isLocallyFraction 𝒜).pred a) : (isLocallyFraction 𝒜).pred (-a) := fun x => by rcases ha x with ⟨V, m, i, j, ⟨r, r_mem⟩, ⟨s, s_mem⟩, nin, hy⟩ @@ -126,6 +133,7 @@ theorem neg_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a : ∀ x : simp only [ext_iff_val, val_mk] at hy simp only [Pi.neg_apply, ext_iff_val, val_neg, hy, val_mk, neg_mk] +set_option backward.isDefEq.respectTransparency.types false in theorem mul_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1) (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) : (isLocallyFraction 𝒜).pred (a * b) := fun x => by @@ -148,6 +156,7 @@ open SectionSubring variable {𝒜} +set_option backward.isDefEq.respectTransparency.types false in /-- The functions satisfying `isLocallyFraction` form a subring of all dependent functions `Π x : U, HomogeneousLocalization 𝒜 x`. -/ def sectionsSubring (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) : @@ -231,6 +240,7 @@ def Proj.toSheafedSpace : SheafedSpace CommRingCat where presheaf := (Proj.structureSheaf 𝒜).1 IsSheaf := (Proj.structureSheaf 𝒜).2 +set_option backward.isDefEq.respectTransparency.types false in /-- The ring homomorphism that takes a section of the structure sheaf of `Proj` on the open set `U`, implemented as a subtype of dependent functions to localizations at homogeneous prime ideals, and evaluates the section on the point corresponding to a given homogeneous prime ideal. -/ @@ -243,6 +253,7 @@ def openToLocalization (U : Opens (ProjectiveSpectrum.top 𝒜)) (x : Projective map_zero' := rfl map_add' _ _ := rfl } +set_option backward.isDefEq.respectTransparency.types false in /-- The ring homomorphism from the stalk of the structure sheaf of `Proj` at a point corresponding to a homogeneous prime ideal `x` to the *homogeneous localization* at `x`, formed by gluing the `openToLocalization` maps. -/ @@ -274,6 +285,7 @@ theorem mem_basicOpen_den (x : ProjectiveSpectrum.top 𝒜) rw [ProjectiveSpectrum.mem_basicOpen] exact f.den_mem +set_option backward.isDefEq.respectTransparency.types false in /-- Given a point `x` corresponding to a homogeneous prime ideal, there is a (dependent) function such that, for any `f` in the homogeneous localization at `x`, it returns the obvious section in the basic open set `D(f.den)`. -/ @@ -285,6 +297,7 @@ def sectionInBasicOpen (x : ProjectiveSpectrum.top 𝒜) : ⟨ProjectiveSpectrum.basicOpen 𝒜 f.den, y.2, ⟨𝟙 _, ⟨f.deg, ⟨f.num, f.den, _, fun _ => rfl⟩⟩⟩⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in open HomogeneousLocalization in /-- Given any point `x` and `f` in the homogeneous localization at `x`, there is an element in the stalk at `x` obtained by `sectionInBasicOpen`. This is the inverse of `stalkToFiberRingHom`. @@ -328,12 +341,14 @@ lemma homogeneousLocalizationToStalk_stalkToFiberRingHom (x z) : rw [Proj.res_apply, Proj.res_apply] simp [sectionInBasicOpen, HomogeneousLocalization.val_mk, Localization.mk_eq_mk', e t ht] +set_option backward.isDefEq.respectTransparency.types false in lemma stalkToFiberRingHom_homogeneousLocalizationToStalk (x z) : stalkToFiberRingHom 𝒜 x (homogeneousLocalizationToStalk 𝒜 x z) = z := by obtain ⟨z, rfl⟩ := Quotient.mk''_surjective z rw [homogeneousLocalizationToStalk, Quotient.liftOn'_mk'', stalkToFiberRingHom_germ, sectionInBasicOpen] +set_option backward.isDefEq.respectTransparency.types false in /-- Using `homogeneousLocalizationToStalk`, we construct a ring isomorphism between stalk at `x` and homogeneous localization at `x` for any point `x` in `Proj`. -/ def Proj.stalkIso' (x : ProjectiveSpectrum.top 𝒜) : @@ -354,6 +369,7 @@ theorem Proj.stalkIso'_symm_mk (x) (f) : (Proj.stalkIso' 𝒜 x).symm (.mk f) = (Proj.structureSheaf 𝒜).presheaf.germ _ x (mem_basicOpen_den _ x f) (sectionInBasicOpen _ x f) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `Proj` of a graded ring as a `LocallyRingedSpace` -/ def Proj.toLocallyRingedSpace : LocallyRingedSpace := { Proj.toSheafedSpace 𝒜 with diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean index 8f5630f669eab2..911ffad935d36b 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean @@ -126,6 +126,7 @@ theorem gc_ideal : (fun I => zeroLocus 𝒜 I) fun t => (vanishingIdeal t).toIdeal := fun I t => subset_zeroLocus_iff_le_vanishingIdeal t I +set_option backward.isDefEq.respectTransparency.types false in /-- `zeroLocus` and `vanishingIdeal` form a Galois connection. -/ theorem gc_set : @GaloisConnection (Set A) (Set (ProjectiveSpectrum 𝒜))ᵒᵈ _ _ diff --git a/Mathlib/AlgebraicGeometry/Properties.lean b/Mathlib/AlgebraicGeometry/Properties.lean index fa9ebece33bb2d..63c04c42aa8bbf 100644 --- a/Mathlib/AlgebraicGeometry/Properties.lean +++ b/Mathlib/AlgebraicGeometry/Properties.lean @@ -104,6 +104,7 @@ theorem isReduced_of_isOpenImmersion {X Y : Scheme} (f : X ⟶ Y) [IsOpenImmersi instance {X : Scheme} {U : X.Opens} [IsReduced X] : IsReduced U := isReduced_of_isOpenImmersion U.ι +set_option backward.isDefEq.respectTransparency.types false in instance {R : CommRingCat.{u}} [H : _root_.IsReduced R] : IsReduced (Spec R) := by apply +allowSynthFailures isReduced_of_isReduced_stalk intro x @@ -204,6 +205,7 @@ theorem basicOpen_eq_bot_iff {X : Scheme} [IsReduced X] {U : X.Opens} rintro rfl simp +set_option backward.isDefEq.respectTransparency.types false in /-- If `X` is reduced and has finitely many irreducible components, then the stalks at the generic points of the irreducible components are fields. -/ lemma isField_stalk_of_closure_mem_irreducibleComponents @@ -351,6 +353,7 @@ open IrreducibleCloseds Set in lemma coheight_eq_of_isOpenImmersion {U X : Scheme} {x : U} (f : U ⟶ X) [IsOpenImmersion f] : Order.coheight (f.base x) = Order.coheight x := f.isOpenEmbedding.coheight_eq +set_option backward.isDefEq.respectTransparency.types false in open Order in lemma idealHeight_eq_coheight (R : CommRingCat) (x : Spec R) : x.asIdeal.height = coheight x := by @@ -358,6 +361,7 @@ lemma idealHeight_eq_coheight (R : CommRingCat) (x : Spec R) : ← Order.coheight_orderIso (specOrderIsoPrimeSpectrum R), ← height_ofDual, specOrderIsoPrimeSpectrum_apply, OrderDual.ofDual_toDual] +set_option backward.isDefEq.respectTransparency.types false in open Order in @[stacks 02IZ] lemma ringKrullDim_stalk_eq_coheight {X : Scheme} (x : X) : diff --git a/Mathlib/AlgebraicGeometry/PullbackCarrier.lean b/Mathlib/AlgebraicGeometry/PullbackCarrier.lean index 011991bfa3ae35..a527a4636647ec 100644 --- a/Mathlib/AlgebraicGeometry/PullbackCarrier.lean +++ b/Mathlib/AlgebraicGeometry/PullbackCarrier.lean @@ -183,6 +183,7 @@ lemma ofPoint_SpecTensorTo (T : Triplet f g) (p : Spec T.tensor) : end Triplet +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma residueFieldCongr_inv_residueFieldMap_ofPoint (t : ↑(pullback f g)) : ((S.residueFieldCongr (Triplet.ofPoint t).hx).inv ≫ f.residueFieldMap (Triplet.ofPoint t).x) ≫ @@ -219,6 +220,7 @@ point of `Spec κ(s)` in `Spec κ(x) ⊗[κ(s)] κ(y)`. -/ def SpecOfPoint (t : ↑(pullback f g)) : Spec (Triplet.ofPoint t).tensor := Spec.map (ofPointTensor t) (⊥ : PrimeSpectrum _) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma SpecTensorTo_SpecOfPoint (t : ↑(pullback f g)) : (Triplet.ofPoint t).SpecTensorTo (SpecOfPoint t) = t := by @@ -254,6 +256,7 @@ lemma carrierEquiv_eq_iff {T₁ T₂ : Σ T : Triplet f g, Spec T.tensor} : rintro ⟨rfl : T = T', e⟩ simpa [e] +set_option backward.isDefEq.respectTransparency.types false in /-- The points of the underlying topological space of `X ×[S] Y` bijectively correspond to pairs of triples `x : X`, `y : Y`, `s : S` with `f x = s = f y` and prime ideals of @@ -274,11 +277,13 @@ def carrierEquiv : ↑(pullback f g) ≃ Σ T : Triplet f g, Spec T.tensor where ← Scheme.Hom.comp_apply] simp [Triplet.Spec_ofPointTensor_SpecTensorTo] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma carrierEquiv_symm_fst (T : Triplet f g) (p : Spec T.tensor) : pullback.fst f g (carrierEquiv.symm ⟨T, p⟩) = T.x := by simp [carrierEquiv] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma carrierEquiv_symm_snd (T : Triplet f g) (p : Spec T.tensor) : pullback.snd f g (carrierEquiv.symm ⟨T, p⟩) = T.y := by @@ -434,10 +439,12 @@ instance : MorphismProperty.IsStableUnderBaseChange @Surjective := by simp only [surjective_iff, ← Set.range_eq_univ, Scheme.Pullback.range_fst] at hg ⊢ rw [hg, Set.preimage_univ] +set_option backward.isDefEq.respectTransparency.types false in instance {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z) [Surjective g] : Surjective (pullback.fst f g) := MorphismProperty.pullback_fst _ _ inferInstance +set_option backward.isDefEq.respectTransparency.types false in instance {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z) [Surjective f] : Surjective (pullback.snd f g) := MorphismProperty.pullback_snd _ _ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Pullbacks.lean b/Mathlib/AlgebraicGeometry/Pullbacks.lean index bd40b94c85ad3f..d9b0ac926ff062 100644 --- a/Mathlib/AlgebraicGeometry/Pullbacks.lean +++ b/Mathlib/AlgebraicGeometry/Pullbacks.lean @@ -43,7 +43,7 @@ variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ variable [∀ i, HasPullback (𝒰.f i ≫ f) g] /-- The intersection of `Uᵢ ×[Z] Y` and `Uⱼ ×[Z] Y` is given by (Uᵢ ×[Z] Y) ×[X] Uⱼ -/ -@[implicit_reducible] +@[instance_reducible] def v (i j : 𝒰.I₀) : Scheme := pullback ((pullback.fst (𝒰.f i ≫ f) g) ≫ 𝒰.f i) (𝒰.f j) @@ -219,12 +219,14 @@ def gluing : Scheme.GlueData.{u} where lemma gluing_ι (j : 𝒰.I₀) : (gluing 𝒰 f g).ι j = Multicoequalizer.π (gluing 𝒰 f g).diagram j := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The first projection from the glued scheme into `X`. -/ def p1 : (gluing 𝒰 f g).glued ⟶ X := by apply Multicoequalizer.desc (gluing 𝒰 f g).diagram _ fun i ↦ pullback.fst _ _ ≫ 𝒰.f i simp [t_fst_fst_assoc, ← pullback.condition] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The second projection from the glued scheme into `Y`. -/ def p2 : (gluing 𝒰 f g).glued ⟶ Y := by @@ -318,6 +320,7 @@ theorem gluedLift_p2 : gluedLift 𝒰 f g s ≫ p2 𝒰 f g = s.snd := by simp_rw [(Cover.ι_glueMorphisms <| 𝒰.pullback₁ s.fst)] simp [p2] +set_option backward.isDefEq.respectTransparency.types false in /-- (Implementation) The canonical map `(W ×[X] Uᵢ) ×[W] (Uⱼ ×[Z] Y) ⟶ (Uⱼ ×[Z] Y) ×[X] Uᵢ = V j i` where `W` is the glued fibred product. @@ -397,11 +400,13 @@ theorem pullbackP1Iso_hom_snd (i : 𝒰.I₀) : (pullbackP1Iso 𝒰 f g i).hom ≫ pullback.snd _ _ = pullback.fst _ _ ≫ p2 𝒰 f g := by simp_rw [pullbackP1Iso, pullback.lift_snd] +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] theorem pullbackP1Iso_inv_fst (i : 𝒰.I₀) : (pullbackP1Iso 𝒰 f g i).inv ≫ pullback.fst _ _ = (gluing 𝒰 f g).ι i := by simp_rw [pullbackP1Iso, pullback.lift_fst] +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] theorem pullbackP1Iso_inv_snd (i : 𝒰.I₀) : (pullbackP1Iso 𝒰 f g i).inv ≫ pullback.snd _ _ = pullback.fst _ _ := by @@ -473,6 +478,7 @@ instance left_affine_comp_pullback_hasPullback {X Y Z : Scheme} (f : X ⟶ Z) (g simpa [pullback.condition] using hasPullback_assoc_symm f (Z.affineCover.f i) (Z.affineCover.f i) g +set_option backward.isDefEq.respectTransparency.types false in instance {X Y Z : Scheme} (f : X ⟶ Z) (g : Y ⟶ Z) : HasPullback f g := hasPullback_of_cover (Z.affineCover.pullback₁ f) f g @@ -635,6 +641,7 @@ def diagonalCover : (pullback.diagonalObj f).OpenCover := (openCoverOfBase 𝒰 f f).bind fun i ↦ openCoverOfLeftRight (𝒱 i) (𝒱 i) (𝒰.pullbackHom _ _) (𝒰.pullbackHom _ _) +set_option backward.isDefEq.respectTransparency.types false in /-- The image of `𝒱 i j₁ ×[𝒰 i] 𝒱 i j₂` in `diagonalCover` with `j₁ = j₂` -/ noncomputable def diagonalCoverDiagonalRange : (pullback.diagonalObj f).Opens := diff --git a/Mathlib/AlgebraicGeometry/QuasiAffine.lean b/Mathlib/AlgebraicGeometry/QuasiAffine.lean index cd803f6d086d64..0c42bb0714541a 100644 --- a/Mathlib/AlgebraicGeometry/QuasiAffine.lean +++ b/Mathlib/AlgebraicGeometry/QuasiAffine.lean @@ -56,6 +56,7 @@ lemma IsQuasiAffine.of_isImmersion have : IsImmersion X.toSpecΓ := .of_comp _ (Spec.map f.appTop) constructor +set_option backward.isDefEq.respectTransparency.types false in lemma IsQuasiAffine.isBasis_basicOpen (X : Scheme.{u}) [IsQuasiAffine X] : Opens.IsBasis { X.basicOpen r | (r : Γ(X, ⊤)) (_ : IsAffineOpen (X.basicOpen r)) } := by refine Opens.isBasis_iff_nbhd.mpr fun {U x} hxU ↦ ?_ diff --git a/Mathlib/AlgebraicGeometry/ResidueField.lean b/Mathlib/AlgebraicGeometry/ResidueField.lean index 62fd0195ccbb67..4d8b63dcb92b82 100644 --- a/Mathlib/AlgebraicGeometry/ResidueField.lean +++ b/Mathlib/AlgebraicGeometry/ResidueField.lean @@ -274,6 +274,7 @@ section Spec variable (R : CommRingCat) (x : Spec R) +set_option backward.isDefEq.respectTransparency.types false in /-- The residue fields of `Spec R` are isomorphic to `Ideal.ResidueField`. -/ noncomputable def Spec.residueFieldIso : @@ -281,6 +282,7 @@ def Spec.residueFieldIso : (IsLocalRing.ResidueField.mapEquiv (Spec.stalkIso R x).commRingCatIsoToRingEquiv).toCommRingCatIso +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma Spec.algebraMap_residueFieldIso_inv : CommRingCat.ofHom (algebraMap R _) ≫ (residueFieldIso R x).inv = @@ -292,6 +294,7 @@ lemma Spec.residue_residueFieldIso_hom : (Spec R).residue x ≫ (residueFieldIso R x).hom = (Spec.stalkIso R x).hom ≫ CommRingCat.ofHom (algebraMap _ _) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma Spec.map_residueFieldIso_inv_eq_fromSpecResidueField : Spec.map (residueFieldIso _ _).inv ≫ @@ -315,6 +318,7 @@ lemma SpecToEquivOfField_eq_iff {K : Type*} [Field K] {X : Scheme} rintro ⟨(rfl : f = g), h⟩ simpa +set_option backward.isDefEq.respectTransparency.types false in /-- For a field `K` and a scheme `X`, the morphisms `Spec K ⟶ X` bijectively correspond to pairs of points `x` of `X` and embeddings `κ(x) ⟶ K`. -/ def SpecToEquivOfField (K : Type u) [Field K] (X : Scheme.{u}) : diff --git a/Mathlib/AlgebraicGeometry/Restrict.lean b/Mathlib/AlgebraicGeometry/Restrict.lean index 9bf91da8be64e1..927f23eb4102a1 100644 --- a/Mathlib/AlgebraicGeometry/Restrict.lean +++ b/Mathlib/AlgebraicGeometry/Restrict.lean @@ -162,6 +162,7 @@ lemma germ_stalkIso_inv {X : Scheme.{u}} (U : X.Opens) (V : U.toScheme.Opens) (x (U.stalkIso x).inv = U.toScheme.presheaf.germ V x hx := PresheafedSpace.restrictStalkIso_inv_eq_germ X.toPresheafedSpace U.isOpenEmbedding V x hx +set_option backward.isDefEq.respectTransparency.types false in lemma stalkIso_inv {X : Scheme.{u}} (U : X.Opens) (x : U) : (U.stalkIso x).inv = U.ι.stalkMap x := by rw [← Category.comp_id (U.stalkIso x).inv, Iso.inv_comp_eq] @@ -266,6 +267,7 @@ theorem Scheme.homOfLE_apply {U V : X.Opens} (e : U ≤ V) (x : U) : (X.homOfLE e x).1 = x := by rw [Scheme.homOfLE_apply'] +set_option backward.isDefEq.respectTransparency.types false in theorem Scheme.ι_image_homOfLE_eq_ι_image_inf {U V : X.Opens} (e : U ≤ V) (W : Opens V) : U.ι ''ᵁ X.homOfLE e ⁻¹ᵁ W = V.ι ''ᵁ W ⊓ U := by ext x @@ -495,6 +497,7 @@ lemma Scheme.Opens.isoOfLE_inv_ι {X : Scheme.{u}} {U V : X.Opens} (hUV : U ≤ (isoOfLE hUV).inv ≫ (V.ι ⁻¹ᵁ U).ι ≫ V.ι = U.ι := by simp [isoOfLE] +set_option backward.isDefEq.respectTransparency.types false in /-- For `f : R`, `D(f)` as an open subscheme of `Spec R` is isomorphic to `Spec R[1/f]`. -/ def basicOpenIsoSpecAway {R : CommRingCat.{u}} (f : R) : Scheme.Opens.toScheme (X := Spec R) (PrimeSpectrum.basicOpen f) ≅ @@ -561,6 +564,7 @@ theorem isPullback_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Open apply IsOpenImmersion.isPullback <;> simp +set_option backward.isDefEq.respectTransparency.types false in lemma isPullback_opens_inf_le {X : Scheme} {U V W : X.Opens} (hU : U ≤ W) (hV : V ≤ W) : IsPullback (X.homOfLE inf_le_left) (X.homOfLE inf_le_right) (X.homOfLE hU) (X.homOfLE hV) := by refine (isPullback_morphismRestrict (X.homOfLE hV) (W.ι ⁻¹ᵁ U)).of_iso (V.ι.isoImage _ ≪≫ @@ -570,6 +574,7 @@ lemma isPullback_opens_inf_le {X : Scheme} {U V W : X.Opens} (hU : U ≤ W) (hV · exact (W.functor_map_eq_inf U).trans (by simpa) all_goals { simp [← cancel_mono (Scheme.Opens.ι _)] } +set_option backward.isDefEq.respectTransparency.types false in lemma isPullback_opens_inf {X : Scheme} (U V : X.Opens) : IsPullback (X.homOfLE inf_le_left) (X.homOfLE inf_le_right) U.ι V.ι := (isPullback_morphismRestrict V.ι U).of_iso (V.ι.isoImage _ ≪≫ X.isoOfEq @@ -752,11 +757,13 @@ lemma resLE_comp_resLE {Z : Scheme.{u}} (g : Y ⟶ Z) {W : Z.Opens} (e') : (e.trans ((Opens.map f.base).map (homOfLE e')).le) := by simp [← cancel_mono W.ι] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma map_resLE (i : V' ≤ V) : X.homOfLE i ≫ f.resLE U V e = f.resLE U V' (i.trans e) := by simp_rw [← resLE_id, resLE_comp_resLE, Category.id_comp] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma resLE_map (i : U ≤ U') : f.resLE U V e ≫ Y.homOfLE i = @@ -791,6 +798,7 @@ lemma resLE_appLE {U : Y.Opens} {V : X.Opens} (e : V ≤ f ⁻¹ᵁ U) rw [← X.presheaf.map_comp, ← X.presheaf.map_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma coe_resLE_apply (x : V) : (f.resLE U V e x).1 = f x := by simp [resLE, morphismRestrict_base] @@ -818,6 +826,7 @@ noncomputable def arrowResLEAppIso (f : X ⟶ Y) (U : Y.Opens) (V : X.Opens) (e simp only [Scheme.Opens.topIso_hom, eqToHom_op, Arrow.mk_hom, Scheme.Hom.map_appLE] rw [Scheme.Hom.appTop, ← Scheme.Hom.appLE_eq_app, Scheme.Hom.resLE_appLE, Scheme.Hom.appLE_map] +set_option backward.isDefEq.respectTransparency.types false in lemma Scheme.Hom.isPullback_resLE {X Y S T : Scheme.{u}} {f : T ⟶ S} {g : Y ⟶ X} {iX : X ⟶ S} {iY : Y ⟶ T} (H : IsPullback g iY iX f) diff --git a/Mathlib/AlgebraicGeometry/Scheme.lean b/Mathlib/AlgebraicGeometry/Scheme.lean index 20bb3f23a28425..6691e0a71a671d 100644 --- a/Mathlib/AlgebraicGeometry/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/Scheme.lean @@ -237,6 +237,7 @@ lemma appLE_congr (e : V ≤ f ⁻¹ᵁ U) (e₁ : U = U') (e₂ : V = V') def stalkMap (x : X) : Y.presheaf.stalk (f x) ⟶ X.presheaf.stalk x := f.toLRSHom.stalkMap x +set_option backward.isDefEq.respectTransparency.types false in protected lemma ext {f g : X ⟶ Y} (h_base : f.base = g.base) (h_app : ∀ U, f.app U ≫ X.presheaf.map (eqToHom congr((Opens.map $h_base.symm).obj U)).op = g.app U) : f = g := by @@ -399,6 +400,7 @@ theorem appLE_comp_appLE {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) (U V W e rw [Category.assoc, f.naturality_assoc, ← Functor.map_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] -- reassoc lemma does not need `simp` theorem comp_appLE {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) (U V e) : (f ≫ g).appLE U V e = g.app U ≫ f.appLE _ V e := by @@ -503,6 +505,7 @@ def Spec.map {R S : CommRingCat} (f : R ⟶ S) : Spec S ⟶ Spec R := theorem Spec.map_id (R : CommRingCat) : Spec.map (𝟙 R) = 𝟙 (Spec R) := Scheme.Hom.ext' <| Spec.locallyRingedSpaceMap_id R +set_option backward.isDefEq.respectTransparency.types false in @[reassoc, simp] theorem Spec.map_comp {R S T : CommRingCat} (f : R ⟶ S) (g : S ⟶ T) : Spec.map (f ≫ g) = Spec.map g ≫ Spec.map f := @@ -634,9 +637,11 @@ lemma ΓSpecIso_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) : lemma ΓSpecIso_inv_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) : f ≫ (ΓSpecIso S).inv = (ΓSpecIso R).inv ≫ (Spec.map f).appTop := SpecΓIdentity.inv.naturality f +set_option backward.isDefEq.respectTransparency.types false in -- This is not marked simp to respect the abstraction lemma ΓSpecIso_inv : (ΓSpecIso R).inv = CommRingCat.ofHom (algebraMap _ _) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma toOpen_eq (U) : CommRingCat.ofHom (algebraMap R <| (Spec.structureSheaf R).presheaf.obj (.op U)) = (ΓSpecIso R).inv ≫ (Spec R).presheaf.map (homOfLE le_top).op := rfl @@ -850,6 +855,7 @@ end ZeroLocus end Scheme +set_option backward.isDefEq.respectTransparency.types false in theorem basicOpen_eq_of_affine {R : CommRingCat} (f : R) : (Spec R).basicOpen ((Scheme.ΓSpecIso R).inv f) = PrimeSpectrum.basicOpen f := by ext x @@ -859,6 +865,7 @@ theorem basicOpen_eq_of_affine {R : CommRingCat} (f : R) : rw [← isUnit_map_iff (StructureSheaf.stalkIso R x).symm, AlgEquiv.commutes] exact IsLocalization.AtPrime.isUnit_to_map_iff _ (PrimeSpectrum.asIdeal x) f +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem basicOpen_eq_of_affine' {R : CommRingCat} (f : Γ(Spec R, ⊤)) : (Spec R).basicOpen f = PrimeSpectrum.basicOpen ((Scheme.ΓSpecIso R).hom f) := by @@ -904,6 +911,7 @@ lemma Scheme.inv_hom_apply {X Y : Scheme.{u}} (e : X ≅ Y) (y : Y) : change (e.inv ≫ e.hom) y = 𝟙 Y.toPresheafedSpace y simp +set_option backward.isDefEq.respectTransparency.types false in theorem Spec_zeroLocus_eq_zeroLocus {R : CommRingCat} (s : Set R) : (Spec R).zeroLocus ((Scheme.ΓSpecIso R).inv '' s) = PrimeSpectrum.zeroLocus s := by ext x @@ -998,6 +1006,7 @@ lemma germ_stalkMap_apply (U : Y.Opens) (x : X) (hx : f x ∈ U) (y) : X.presheaf.germ (f ⁻¹ᵁ U) x hx (f.app U y) := PresheafedSpace.stalkMap_germ_apply f.toPshHom U x hx y +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `x = y`, the stalk maps are isomorphic. -/ noncomputable def arrowStalkMapIsoOfEq {x y : X} diff --git a/Mathlib/AlgebraicGeometry/Sites/Affine.lean b/Mathlib/AlgebraicGeometry/Sites/Affine.lean index 83c32dfdb5345c..299e6d2922b06e 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Affine.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Affine.lean @@ -45,6 +45,7 @@ noncomputable def affineOverMk {P : MorphismProperty Scheme.{u}} {R : CommRingCa variable (P : MorphismProperty Scheme.{u}) [P.IsMultiplicative] [IsZariskiLocalAtSource P] [P.IsStableUnderBaseChange] [P.HasOfPostcompProperty P] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The `Spec` functor from affine `P`-schemes over `S` to `P`-schemes over `S` is dense if `P` is local at the source. -/ @@ -64,6 +65,7 @@ instance isCoverDense_toOver_Spec : CostructuredArrow.homMk (𝟙 _) ⟨⟩ rfl, Over.homMk (𝒰.f i) (by simp) trivial, by cat_disch⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in instance isOneHypercoverDense_toOver_Spec : Functor.IsOneHypercoverDense.{u} (CostructuredArrow.toOver P Scheme.Spec S) ((CostructuredArrow.toOver P Scheme.Spec S).inducedTopology (smallGrothendieckTopology P)) diff --git a/Mathlib/AlgebraicGeometry/Sites/AffineEtale.lean b/Mathlib/AlgebraicGeometry/Sites/AffineEtale.lean index 254b66d74a2519..7cdba589ec0d01 100644 --- a/Mathlib/AlgebraicGeometry/Sites/AffineEtale.lean +++ b/Mathlib/AlgebraicGeometry/Sites/AffineEtale.lean @@ -39,6 +39,7 @@ namespace AlgebraicGeometry.Scheme variable {S : Scheme.{u}} +set_option backward.isDefEq.respectTransparency.types false in /-- The small affine étale site: The category of affine schemes étale over `S`, whose objects are commutative rings `R` with an étale structure morphism `Spec R ⟶ S`. -/ def AffineEtale (S : Scheme.{u}) : Type (u + 1) := @@ -57,12 +58,15 @@ protected def mk {R : CommRingCat.{u}} (f : Spec R ⟶ S) [Etale f] : AffineEtal protected def Spec (S : Scheme.{u}) : S.AffineEtale ⥤ S.Etale := MorphismProperty.CostructuredArrow.toOver _ _ _ +set_option backward.isDefEq.respectTransparency.types false in instance : (AffineEtale.Spec S).Faithful := inferInstanceAs <| (MorphismProperty.CostructuredArrow.toOver _ _ _).Faithful +set_option backward.isDefEq.respectTransparency.types false in instance : (AffineEtale.Spec S).Full := inferInstanceAs <| (MorphismProperty.CostructuredArrow.toOver _ _ _).Full +set_option backward.isDefEq.respectTransparency.types false in instance : (AffineEtale.Spec S).IsCoverDense S.smallEtaleTopology := inferInstanceAs <| (MorphismProperty.CostructuredArrow.toOver _ _ _).IsCoverDense (smallGrothendieckTopology _) @@ -77,10 +81,12 @@ instance : Functor.IsDenseSubsite (topology S) S.smallEtaleTopology (AffineEtale dsimp [topology] infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : Functor.IsOneHypercoverDense.{u} (AffineEtale.Spec S) (topology S) S.smallEtaleTopology := isOneHypercoverDense_toOver_Spec _ +set_option backward.isDefEq.respectTransparency.types false in instance : EssentiallySmall.{u} S.AffineEtale := essentiallySmall_costructuredArrow_Spec _ fun _ _ _ _ ↦ inferInstance diff --git a/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean b/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean index 71924db7f69809..8e41ce3c456aae 100644 --- a/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean +++ b/Mathlib/AlgebraicGeometry/Sites/BigZariski.lean @@ -53,6 +53,7 @@ abbrev zariskiTopology : GrothendieckTopology Scheme.{u} := lemma zariskiTopology_eq : zariskiTopology.{u} = zariskiPretopology.toGrothendieck := Precoverage.toGrothendieck_toPretopology_eq_toGrothendieck.symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance subcanonical_zariskiTopology : zariskiTopology.Subcanonical := by apply GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj @@ -87,6 +88,7 @@ instance : Scheme.forgetToTop.{u}.IsContinuous zariskiTopology TopCat.grothendie · rw [MorphismProperty.comap_precoverage] exact MorphismProperty.precoverage_monotone fun X Y f hf ↦ f.isOpenEmbedding +set_option backward.isDefEq.respectTransparency.types false in /-- A Zariski-`1`-hypercover of a scheme where all components are affine. -/ @[simps! toPreOneHypercover_toPreZeroHypercover] noncomputable diff --git a/Mathlib/AlgebraicGeometry/Sites/ConstantSheaf.lean b/Mathlib/AlgebraicGeometry/Sites/ConstantSheaf.lean index 3417017aa374a8..3b1513855cd314 100644 --- a/Mathlib/AlgebraicGeometry/Sites/ConstantSheaf.lean +++ b/Mathlib/AlgebraicGeometry/Sites/ConstantSheaf.lean @@ -84,6 +84,7 @@ lemma isSheaf_fpqcTopology_continuousMapPresheaf : · intro y hy rwa [← ContinuousMap.cancel_right (Spec.map f).surjective, Topology.IsQuotientMap.lift_comp] +set_option backward.isDefEq.respectTransparency.types false in /-- `continuousMapPresheaf` is `U ↦ C(ConnectedComponents U, T)` if `T` is totally disconnected. -/ def continuousMapPresheafEquivOfTotallyDisconnectedSpace [TotallyDisconnectedSpace T] diff --git a/Mathlib/AlgebraicGeometry/Sites/Etale.lean b/Mathlib/AlgebraicGeometry/Sites/Etale.lean index b54e73a748fcdd..ab938bfbd86c81 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Etale.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Etale.lean @@ -45,11 +45,13 @@ lemma zariskiTopology_le_etaleTopology : zariskiTopology ≤ etaleTopology := by intro X Y f hf infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- The small étale site of a scheme is the Grothendieck topology on the category of schemes étale over `X` induced from the étale topology on `Scheme.{u}`. -/ def smallEtaleTopology (X : Scheme.{u}) : GrothendieckTopology X.Etale := X.smallGrothendieckTopology (P := @Etale) +set_option backward.isDefEq.respectTransparency.types false in /-- The pretopology generating the small étale site. -/ def smallEtalePretopology (X : Scheme.{u}) : Pretopology X.Etale := X.smallPretopology (Q := @Etale) (P := @Etale) diff --git a/Mathlib/AlgebraicGeometry/Sites/Fpqc.lean b/Mathlib/AlgebraicGeometry/Sites/Fpqc.lean index 3e343f60a1f49d..482618806c476c 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Fpqc.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Fpqc.lean @@ -34,6 +34,7 @@ open CategoryTheory namespace AlgebraicGeometry.Scheme +set_option backward.isDefEq.respectTransparency.types false in /-- The fppf precoverage on the category of schemes. The covering families are jointly-surjective families of flat morphisms, locally of finite presentation. -/ def fppfPrecoverage : Precoverage Scheme.{u} := @@ -52,6 +53,7 @@ lemma fppfPrecoverage_eq_inf : abbrev fppfTopology : GrothendieckTopology Scheme.{u} := fppfPrecoverage.toGrothendieck +set_option backward.isDefEq.respectTransparency.types false in /-- The fpqc precoverage on the category of schemes is the quasi-compact precoverage on flat morphisms. The covering families are jointly-surjective, quasi-compact families of flat morphisms. -/ @@ -60,6 +62,7 @@ def fpqcPrecoverage : Precoverage Scheme.{u} := deriving Precoverage.HasIsos, Precoverage.IsStableUnderBaseChange, Precoverage.IsStableUnderComposition +set_option backward.isDefEq.respectTransparency.types false in lemma fppfPrecoverage_le_fpqcPrecoverage : fppfPrecoverage ≤ fpqcPrecoverage := by rw [fpqcPrecoverage, propQCPrecoverage, le_inf_iff] refine ⟨?_, precoverage_mono fun X Y f ⟨hf, _⟩ ↦ inferInstance⟩ @@ -80,6 +83,7 @@ lemma zariskiTopology_le_fpqcTopology : zariskiTopology ≤ fpqcTopology := lemma fppfTopology_le_fpqcTopology : fppfTopology ≤ fpqcTopology := Precoverage.toGrothendieck_mono fppfPrecoverage_le_fpqcPrecoverage +set_option backward.isDefEq.respectTransparency.types false in instance : fpqcTopology.Subcanonical := by refine GrothendieckTopology.Subcanonical.of_isSheaf_yoneda_obj _ fun X ↦ ?_ rw [fpqcTopology_eq_propQCTopology, isSheaf_type_propQCTopology_iff] diff --git a/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean b/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean index 7fb519d3c2dbe7..583dc8ec8ece20 100644 --- a/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean +++ b/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean @@ -55,6 +55,7 @@ lemma IsJointlySurjectivePreserving.exists_preimage_snd_triplet_of_prop use (pullbackSymmetry f g).inv a rwa [← Scheme.Hom.comp_apply, pullbackSymmetry_inv_comp_snd] +set_option backward.isDefEq.respectTransparency.types false in instance : IsJointlySurjectivePreserving @IsOpenImmersion where exists_preimage_fst_triplet_of_prop {X Y S f g} _ hg x y h := by rw [← show _ = (pullback.fst _ _ : pullback f g ⟶ _).base from diff --git a/Mathlib/AlgebraicGeometry/Sites/Proetale.lean b/Mathlib/AlgebraicGeometry/Sites/Proetale.lean index 31706081c9f175..7d5d25324889e2 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Proetale.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Proetale.lean @@ -43,6 +43,7 @@ open CategoryTheory MorphismProperty Limits namespace AlgebraicGeometry.Scheme +set_option backward.isDefEq.respectTransparency.types false in /-- Big pro-étale site: the pro-étale precoverage on the category of schemes given by fpqc covers of weakly étale morphisms. @@ -67,6 +68,7 @@ abbrev proetaleTopology : GrothendieckTopology Scheme.{u} := lemma proetaleTopology_eq_propQCTopology : proetaleTopology = propQCTopology @WeaklyEtale := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma etalePrecoverage_le_proetalePrecoverage : etalePrecoverage ≤ proetalePrecoverage := by rw [proetalePrecoverage, propQCPrecoverage, etalePrecoverage, le_inf_iff] refine ⟨precoverage_le_qcPrecoverage_of_isOpenMap fun X Y f hf ↦ f.isOpenMap, ?_⟩ @@ -87,6 +89,7 @@ instance {S : Scheme.{u}} (𝒰 : S.Cover (precoverage @WeaklyEtale)) (i : 𝒰. WeaklyEtale (𝒰.f i) := 𝒰.map_prop i +set_option backward.isDefEq.respectTransparency.types false in /-- The (small) pro-étale site of a scheme `S`: Its objects are the schemes weakly étale over `S`. We prefer to work with weakly étale morphisms instead of pro-étale morphisms, since the property @@ -111,55 +114,69 @@ variable {S} in protected def mk {X : Scheme.{u}} (f : X ⟶ S) [WeaklyEtale f] : S.ProEt := MorphismProperty.Over.mk _ f ‹_› +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor the pro-étale site of `S` to schemes over `S`. -/ @[simps!] protected def forget : S.ProEt ⥤ Over S := MorphismProperty.Over.forget @WeaklyEtale ⊤ S +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from the pro-étale site of `S` to schemes over `S` is fully faithful. -/ def forgetFullyFaithful : (ProEt.forget S).FullyFaithful := MorphismProperty.Comma.forgetFullyFaithful _ _ _ +set_option backward.isDefEq.respectTransparency.types false in instance : (ProEt.forget S).Full := inferInstanceAs <| (MorphismProperty.Over.forget _ _ _).Full +set_option backward.isDefEq.respectTransparency.types false in instance : (ProEt.forget S).Faithful := inferInstanceAs <| (MorphismProperty.Over.forget _ _ _).Faithful +set_option backward.isDefEq.respectTransparency.types false in instance : PreservesFiniteLimits (ProEt.forget S) := inferInstanceAs <| PreservesFiniteLimits (MorphismProperty.Over.forget _ _ _) +set_option backward.isDefEq.respectTransparency.types false in instance : RepresentablyFlat (ProEt.forget S) := flat_of_preservesFiniteLimits _ +set_option backward.isDefEq.respectTransparency.types false in instance : (ProEt.forget S).LocallyCoverDense (proetaleTopology.over S) := by apply MorphismProperty.locallyCoverDense_forget_of_le exact proetalePrecoverage_le_precoverage_weaklyEtale +set_option backward.isDefEq.respectTransparency.types false in /-- The pro-étale precoverage on the small pro-étale site. -/ def precoverage : Precoverage S.ProEt := proetalePrecoverage.comap (ProEt.forget S ⋙ Over.forget S) +set_option backward.isDefEq.respectTransparency.types false in /-- The pro-étale topology on the small pro-étale site. -/ abbrev topology : GrothendieckTopology S.ProEt := (precoverage S).toGrothendieck +set_option backward.isDefEq.respectTransparency.types false in lemma topology_eq_inducedTopology : topology S = (ProEt.forget S).inducedTopology (proetaleTopology.over S) := by apply MorphismProperty.toGrothendieck_comap_forget_eq_inducedTopology exact proetalePrecoverage_le_precoverage_weaklyEtale +set_option backward.isDefEq.respectTransparency.types false in instance : (ProEt.forget S).IsContinuous (topology S) (proetaleTopology.over S) := by rw [topology_eq_inducedTopology] refine Functor.isContinuous_of_coverPreserving (compatiblePreservingOfFlat _ _) ?_ exact Functor.inducedTopology_coverPreserving _ _ +set_option backward.isDefEq.respectTransparency.types false in instance : (ProEt.forget S ⋙ Over.forget S).IsContinuous (ProEt.topology S) proetaleTopology := Functor.isContinuous_comp _ _ _ (proetaleTopology.over S) _ +set_option backward.isDefEq.respectTransparency.types false in instance : (topology S).Subcanonical := GrothendieckTopology.subcanonical_of_full_of_faithful (ProEt.forget S) _ (proetaleTopology.over S) +set_option backward.isDefEq.respectTransparency.types false in /-- If `S` is the empty scheme, the pro-étale site over `S` is a point. -/ noncomputable def equivOfIsEmpty [IsEmpty S] : S.ProEt ≌ Discrete PUnit := MorphismProperty.overEquivOfIsInitial _ _ _ isInitialOfIsEmpty @@ -171,6 +188,7 @@ lemma bot_mem_topology (X : S.ProEt) [IsEmpty X.left] : ⊥ ∈ topology S X := simp [topology_eq_inducedTopology, GrothendieckTopology.mem_over_iff, proetaleTopology_eq_propQCTopology, bot_mem_propQCTopology] +set_option backward.isDefEq.respectTransparency.types false in lemma topology_eq_top_of_isEmpty [IsEmpty S] : topology S = ⊤ := by rw [GrothendieckTopology.eq_top_iff] intro X diff --git a/Mathlib/AlgebraicGeometry/Sites/Representability.lean b/Mathlib/AlgebraicGeometry/Sites/Representability.lean index 6a61e1324e0cec..a4c7b35fa395f7 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Representability.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Representability.lean @@ -87,6 +87,7 @@ noncomputable def glueData : GlueData where noncomputable def toGlued (i : ι) : X i ⟶ (glueData hf).glued := (glueData hf).ι i +set_option backward.isDefEq.respectTransparency.types false in instance : IsOpenImmersion (toGlued hf i) := inferInstanceAs (IsOpenImmersion ((glueData hf).ι i)) @@ -115,13 +116,13 @@ lemma yoneda_toGlued_yonedaGluedToSheaf (i : ι) : NatTrans.comp_app_apply, yoneda_map_app] simpa using! GlueData.sheafValGluedMk_val _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma yonedaGluedToSheaf_app_toGlued {i : ι} : dsimp% (yonedaGluedToSheaf hf).hom.app _ (toGlued hf i) = yonedaEquiv (f i) := by rw [← yoneda_toGlued_yonedaGluedToSheaf hf i, yonedaEquiv_comp, yonedaEquiv_yoneda_map] - rfl set_option backward.defeqAttrib.useBackward true in @[simp] @@ -137,6 +138,7 @@ instance [Presheaf.IsLocallySurjective Scheme.zariskiTopology (Sigma.desc f)] : (show Sigma.desc (fun i ↦ yoneda.map (toGlued hf i)) ≫ (yonedaGluedToSheaf hf).hom = Sigma.desc f by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma comp_toGlued_eq {U : Scheme} {i j : ι} (a : U ⟶ X i) (b : U ⟶ X j) (h : yoneda.map a ≫ f i = yoneda.map b ≫ f j) : @@ -149,6 +151,7 @@ lemma comp_toGlued_eq {U : Scheme} {i j : ι} (a : U ⟶ X i) (b : U ⟶ X j) @[simp] lemma glueData_openCover_map : (glueData hf).openCover.f j = toGlued hf j := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : Sheaf.IsLocallyInjective (yonedaGluedToSheaf hf) where equalizerSieve_mem := by diff --git a/Mathlib/AlgebraicGeometry/Sites/Small.lean b/Mathlib/AlgebraicGeometry/Sites/Small.lean index 10556ab28c6012..968daaa05b103a 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Small.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Small.lean @@ -47,6 +47,7 @@ def Cover.toPresieveOver {X : Over S} (𝒰 : Cover.{u} (precoverage P) X.left) Presieve X := Presieve.ofArrows (fun i ↦ (𝒰.X i).asOver S) (fun i ↦ (𝒰.f i).asOver S) +set_option backward.isDefEq.respectTransparency.types false in /-- The presieve defined by a `P`-cover of `S`-schemes with `Q`. -/ def Cover.toPresieveOverProp {X : Q.Over ⊤ S} (𝒰 : Cover.{u} (precoverage P) X.left) [𝒰.Over S] (h : ∀ j, Q (𝒰.X j ↘ S)) : Presieve X := @@ -228,12 +229,14 @@ lemma smallGrothendieckTopologyOfLE_eq_toGrothendieck_smallPretopology (hPQ : P rintro - - ⟨i⟩ exact ⟨(𝒰.X i).asOverProp S (p i), (𝒰.f i).asOverProp S, 𝟙 _, le _ _ ⟨i⟩, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma smallGrothendieckTopology_eq_toGrothendieck_smallPretopology [P.HasOfPostcompProperty P] : S.smallGrothendieckTopology P = (S.smallPretopology P P).toGrothendieck := S.smallGrothendieckTopologyOfLE_eq_toGrothendieck_smallPretopology le_rfl variable {P Q} +set_option backward.isDefEq.respectTransparency.types false in lemma mem_toGrothendieck_smallPretopology (X : Q.Over ⊤ S) (R : Sieve X) : R ∈ (S.smallPretopology P Q).toGrothendieck X ↔ ∀ x : X.left, ∃ (Y : Q.Over ⊤ S) (f : Y ⟶ X) (y : Y.left), @@ -262,6 +265,7 @@ lemma mem_toGrothendieck_smallPretopology (X : Q.Over ⊤ S) (R : Sieve X) : · rintro - - ⟨i⟩ exact hf i +set_option backward.isDefEq.respectTransparency.types false in lemma mem_smallGrothendieckTopology [P.HasOfPostcompProperty P] (X : P.Over ⊤ S) (R : Sieve X) : R ∈ S.smallGrothendieckTopology P X ↔ ∃ (𝒰 : Cover.{u} (precoverage P) X.left) (_ : 𝒰.Over S) (h : ∀ j, P (𝒰.X j ↘ S)), diff --git a/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean b/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean index 8c7429bd4ed764..f02bcf499ff754 100644 --- a/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean +++ b/Mathlib/AlgebraicGeometry/Sites/SmallAffineZariski.lean @@ -254,6 +254,7 @@ This is closely related to the notion of quasi-coherent `𝒪ₓ`-algebras, and together once the theory of quasi-coherent `𝒪ₓ`-algebras are developed. -/ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (X) in /-- `X` is the colimit of its affine opens. See `isColimit_cocone` below. -/ @@ -291,6 +292,7 @@ lemma coequifibered_iff_forall_isLocalizationAway {F : X.AffineZariskiSiteᵒᵖ @[deprecated (since := "2026-02-01")] alias PreservesLocalization := NatTrans.Coequifibered +set_option backward.isDefEq.respectTransparency.types false in /-- The relative gluing data associated to a quasi-coherent `𝒪ₓ` algebra. -/ def relativeGluingData {F : X.AffineZariskiSiteᵒᵖ ⥤ CommRingCat} {α : (AffineZariskiSite.toOpensFunctor X).op ⋙ X.presheaf ⟶ F} @@ -328,6 +330,7 @@ lemma opensRange_relativeGluingData_map (F : X.AffineZariskiSiteᵒᵖ ⥤ CommR @[deprecated (since := "2026-02-01")] alias PreservesLocalization.opensRange_map := opensRange_relativeGluingData_map +set_option backward.isDefEq.respectTransparency.types false in @[deprecated Cover.RelativeGluingData.toBase_preimage_eq_opensRange_ι (since := "2026-02-01")] lemma PreservesLocalization.colimitDesc_preimage (F : X.AffineZariskiSiteᵒᵖ ⥤ CommRingCat) (α : (AffineZariskiSite.toOpensFunctor X).op ⋙ X.presheaf ⟶ F) diff --git a/Mathlib/AlgebraicGeometry/Spec.lean b/Mathlib/AlgebraicGeometry/Spec.lean index 8f0902682edf88..77a0538dbe10fa 100644 --- a/Mathlib/AlgebraicGeometry/Spec.lean +++ b/Mathlib/AlgebraicGeometry/Spec.lean @@ -92,6 +92,7 @@ def Spec.sheafedSpaceObj (R : CommRingCat.{u}) : SheafedSpace CommRingCat where presheaf := (structureSheaf R).1 IsSheaf := (structureSheaf R).2 +set_option backward.isDefEq.respectTransparency.types false in /-- The induced map of a ring homomorphism on the ring spectra, as a morphism of sheafed spaces. -/ @[simps hom_base hom_c_app] @@ -157,6 +158,7 @@ theorem Spec.toPresheafedSpace_map (R S : CommRingCat.{u}ᵒᵖ) (f : R ⟶ S) : Spec.toPresheafedSpace.map f = (Spec.sheafedSpaceMap f.unop).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem Spec.toPresheafedSpace_map_op (R S : CommRingCat.{u}) (f : R ⟶ S) : Spec.toPresheafedSpace.map f.op = (Spec.sheafedSpaceMap f).hom := rfl @@ -178,6 +180,7 @@ theorem Spec.basicOpen_hom_ext {X : RingedSpace.{u}} {R : CommRingCat.{u}} apply (StructureSheaf.to_basicOpen_epi R r).1 simpa using! h r +set_option backward.isDefEq.respectTransparency.types false in -- `simps!` generates some garbage lemmas, so choose manually, -- if more is needed, add them here /-- The spectrum of a commutative ring, as a `LocallyRingedSpace`. -/ @@ -203,6 +206,7 @@ lemma Spec.locallyRingedSpaceObj_presheaf_map' (R : Type u) [CommRing R] {U V} ( (Spec.locallyRingedSpaceObj <| CommRingCat.of R).presheaf.map i = (structureSheaf R).1.map i := rfl +set_option backward.isDefEq.respectTransparency.types false in @[elementwise] theorem stalkMap_toStalk {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum S) : toStalk R (PrimeSpectrum.comap f.hom p) ≫ (Spec.sheafedSpaceMap f).hom.stalkMap p = @@ -273,13 +277,16 @@ section SpecΓ open AlgebraicGeometry.LocallyRingedSpace +set_option backward.isDefEq.respectTransparency.types false in /-- The counit morphism `R ⟶ Γ(Spec R)` given by `AlgebraicGeometry.StructureSheaf.toOpen`. -/ def toSpecΓ (R : CommRingCat.{u}) : R ⟶ Γ.obj (op (Spec.toLocallyRingedSpace.obj (op R))) := CommRingCat.ofHom (algebraMap _ _) +set_option backward.isDefEq.respectTransparency.types false in instance isIso_toSpecΓ (R : CommRingCat.{u}) : IsIso (toSpecΓ R) := (ConcreteCategory.isIso_iff_bijective _).mpr algebraMap_obj_top_bijective +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] theorem Spec_Γ_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) : f ≫ toSpecΓ S = toSpecΓ R ≫ Γ.map (Spec.toLocallyRingedSpace.map f.op).op := by @@ -319,6 +326,7 @@ namespace StructureSheaf variable {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum R) +set_option backward.isDefEq.respectTransparency.types false in /-- For an algebra `f : R →+* S`, this is the ring homomorphism `S →+* (f∗ 𝒪ₛ)ₚ` for a `p : Spec R`. This is shown to be the localization at `p` in `isLocalizedModule_toPushforwardStalkAlgHom`. -/ @@ -346,6 +354,7 @@ theorem algebraMap_pushforward_stalk : variable (R S) variable [Algebra R S] +set_option backward.isDefEq.respectTransparency.types false in /-- This is the `AlgHom` version of `toPushforwardStalk`, which is the map `S ⟶ (f∗ 𝒪ₛ)ₚ` for some algebra `R ⟶ S` and some `p : Spec R`. @@ -356,6 +365,7 @@ def toPushforwardStalkAlgHom : { (StructureSheaf.toPushforwardStalk (CommRingCat.ofHom (algebraMap R S)) p).hom with commutes' := fun _ => rfl } +set_option backward.isDefEq.respectTransparency.types false in theorem isLocalizedModule_toPushforwardStalkAlgHom_aux (y) : ∃ x : S × p.asIdeal.primeCompl, x.2 • y = toPushforwardStalkAlgHom R S p x.1 := by obtain ⟨U, hp, s, e⟩ := TopCat.Presheaf.exists_germ_eq _ y @@ -388,6 +398,7 @@ theorem isLocalizedModule_toPushforwardStalkAlgHom_aux (y) : rw [← map_pow (algebraMap R S)] at hsn congr 1 +set_option backward.isDefEq.respectTransparency.types false in instance isLocalizedModule_toPushforwardStalkAlgHom : IsLocalizedModule p.asIdeal.primeCompl (toPushforwardStalkAlgHom R S p).toLinearMap := by apply IsLocalizedModule.mkOfAlgebra diff --git a/Mathlib/AlgebraicGeometry/SpreadingOut.lean b/Mathlib/AlgebraicGeometry/SpreadingOut.lean index bad1ab4203d0da..34806ac3cdefa4 100644 --- a/Mathlib/AlgebraicGeometry/SpreadingOut.lean +++ b/Mathlib/AlgebraicGeometry/SpreadingOut.lean @@ -87,6 +87,7 @@ lemma Scheme.exists_le_and_germ_injective (X : Scheme.{u}) (x : X) [X.IsGermInje obtain ⟨f, hf, hxf⟩ := hU.exists_basicOpen_le ⟨x, hxV⟩ hx exact ⟨X.basicOpen f, hxf, hU.basicOpen f, hf, injective_germ_basicOpen U hU x hx f hxf H⟩ +set_option backward.isDefEq.respectTransparency.types false in instance (x : X) [X.IsGermInjectiveAt x] [IsOpenImmersion f] : Y.IsGermInjectiveAt (f x) := by obtain ⟨U, hxU, hU, H⟩ := X.exists_germ_injective x @@ -97,6 +98,7 @@ instance (x : X) [X.IsGermInjectiveAt x] [IsOpenImmersion f] : (f.appIso U).inv _).mp ?_ simpa +set_option backward.isDefEq.respectTransparency.types false in variable {f} in lemma isGermInjectiveAt_iff_of_isOpenImmersion {x : X} [IsOpenImmersion f] : Y.IsGermInjectiveAt (f x) ↔ X.IsGermInjectiveAt x := by @@ -164,6 +166,7 @@ instance (priority := 100) [IsIntegral X] : X.IsGermInjective := by exact @IsLocalization.injective _ _ _ _ _ (show _ from _) this (Ideal.primeCompl_le_nonZeroDivisors _) +set_option backward.isDefEq.respectTransparency.types false in instance (priority := 100) [IsLocallyNoetherian X] : X.IsGermInjective := by suffices ∀ (R : CommRingCat.{u}) (_ : IsNoetherianRing R), (Spec R).IsGermInjective by refine @Scheme.IsGermInjective.of_openCover _ (X.affineOpenCover.openCover) (fun i ↦ this _ ?_) @@ -187,6 +190,7 @@ instance (priority := 100) [IsLocallyNoetherian X] : X.IsGermInjective := by rw [Submodule.mem_annihilator_span_singleton, smul_eq_mul] exact hf i _ +set_option backward.isDefEq.respectTransparency.types false in /-- Let `x : X` and `f g : X ⟶ Y` be two morphisms such that `f x = g x`. If `f` and `g` agree on the stalk of `x`, then they agree on an open neighborhood of `x`, @@ -223,6 +227,7 @@ lemma spread_out_unique_of_isGermInjective {x : X} [X.IsGermInjectiveAt x] simp only [Scheme.Hom.appLE, Category.assoc, X.presheaf.germ_res', ← Scheme.Hom.germ_stalkMap, H] simp only [TopCat.Presheaf.germ_stalkSpecializes_assoc, Scheme.Hom.germ_stalkMap] +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `spread_out_unique_of_isGermInjective` whose condition is an equality of scheme morphisms instead of ring homomorphisms. @@ -302,6 +307,7 @@ lemma exists_lift_of_germInjective {x : X} [X.IsGermInjectiveAt x] {U : X.Opens} rw [TopCat.Presheaf.germ_res_apply, ‹φRA ≫ φ = _›] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Given `S`-schemes `X Y` and points `x : X` `y : Y` over `s : S`. Suppose we have the following diagram of `S`-schemes @@ -356,6 +362,7 @@ lemma spread_out_of_isGermInjective [LocallyOfFiniteType sY] {x : X} [X.IsGermIn ← Scheme.Hom.appLE, ← hW.isoSpec_hom, IsAffineOpen.SpecMap_appLE_fromSpec sX hU hW i, ← Iso.eq_inv_comp, IsAffineOpen.isoSpec_inv_ι_assoc] +set_option backward.isDefEq.respectTransparency.types false in /-- Given `S`-schemes `X Y`, a point `x : X`, and an `S`-morphism `φ : Spec 𝒪_{X, x} ⟶ Y`, we may spread it out to an `S`-morphism `f : U ⟶ Y` diff --git a/Mathlib/AlgebraicGeometry/Stalk.lean b/Mathlib/AlgebraicGeometry/Stalk.lean index 72a527c40f8f2e..96e00f1b7ad11d 100644 --- a/Mathlib/AlgebraicGeometry/Stalk.lean +++ b/Mathlib/AlgebraicGeometry/Stalk.lean @@ -89,6 +89,7 @@ instance IsAffineOpen.fromSpecStalk_isPreimmersion {X : Scheme.{u}} {U : Opens X instance {X : Scheme.{u}} (x : X) : IsPreimmersion (X.fromSpecStalk x) := IsAffineOpen.fromSpecStalk_isPreimmersion _ _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma IsAffineOpen.fromSpecStalk_closedPoint {U : Opens X} (hU : IsAffineOpen U) {x : X} (hxU : x ∈ U) : hU.fromSpecStalk hxU (closedPoint (X.presheaf.stalk x)) = x := by @@ -121,6 +122,7 @@ lemma fromSpecStalk_appTop {x : X} : (Spec (X.presheaf.stalk x)).presheaf.map (homOfLE le_top).op := fromSpecStalk_app .. +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma SpecMap_stalkSpecializes_fromSpecStalk {x y : X} (h : x ⤳ y) : Spec.map (X.presheaf.stalkSpecializes h) ≫ X.fromSpecStalk y = X.fromSpecStalk x := by @@ -133,6 +135,7 @@ lemma SpecMap_stalkSpecializes_fromSpecStalk {x y : X} (h : x ⤳ y) : instance {x y : X} (h : x ⤳ y) : (Spec.map (X.presheaf.stalkSpecializes h)).IsOver X where +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma SpecMap_stalkMap_fromSpecStalk {x} : Spec.map (f.stalkMap x) ≫ Y.fromSpecStalk _ = X.fromSpecStalk x ≫ f := by @@ -168,6 +171,7 @@ def Opens.fromSpecStalkOfMem {X : Scheme.{u}} (U : X.Opens) (x : X) (hxU : x ∈ Spec (X.presheaf.stalk x) ⟶ U := Spec.map (inv (U.ι.stalkMap ⟨x, hxU⟩)) ≫ U.toScheme.fromSpecStalk ⟨x, hxU⟩ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma Opens.fromSpecStalkOfMem_ι {X : Scheme.{u}} (U : X.Opens) (x : X) (hxU : x ∈ U) : U.fromSpecStalkOfMem x hxU ≫ U.ι = X.fromSpecStalk x := by @@ -202,6 +206,7 @@ section Spec variable (R : CommRingCat) (x) +set_option backward.isDefEq.respectTransparency.types false in lemma Spec.fromSpecStalk_eq : (Spec R).fromSpecStalk x = Spec.map ((Scheme.ΓSpecIso R).inv ≫ (Spec R).presheaf.germ ⊤ x trivial) := by @@ -233,11 +238,13 @@ def stalkClosedPointIso : Spec.stalkIso _ _ ≪≫ (IsLocalization.atUnits R (closedPoint R).asIdeal.primeCompl fun _ ↦ not_not.mp).toRingEquiv.toCommRingCatIso.symm +set_option backward.isDefEq.respectTransparency.types false in lemma stalkClosedPointIso_inv : (stalkClosedPointIso R).inv = StructureSheaf.toStalk R _ := by ext x exact (StructureSheaf.stalkIso _ _).commutes _ +set_option backward.isDefEq.respectTransparency.types false in lemma ΓSpecIso_hom_stalkClosedPointIso_inv : (Scheme.ΓSpecIso R).hom ≫ (stalkClosedPointIso R).inv = (Spec R).presheaf.germ ⊤ (closedPoint _) trivial := by @@ -274,6 +281,7 @@ def stalkClosedPointTo : X.presheaf.stalk (f (closedPoint R)) ⟶ R := f.stalkMap (closedPoint R) ≫ (stalkClosedPointIso R).hom +set_option backward.isDefEq.respectTransparency.types false in instance isLocalHom_stalkClosedPointTo : IsLocalHom (stalkClosedPointTo f).hom := inferInstanceAs <| IsLocalHom (f.stalkMap (closedPoint R) ≫ (stalkClosedPointIso R).hom).hom @@ -291,6 +299,7 @@ lemma preimage_eq_top_of_closedPoint_mem {U : Opens X} (hU : f (closedPoint R) ∈ U) : f ⁻¹ᵁ U = ⊤ := IsLocalRing.closed_point_mem_iff.mp hU +set_option backward.isDefEq.respectTransparency.types false in lemma stalkClosedPointTo_comp (g : X ⟶ Y) : stalkClosedPointTo (f ≫ g) = g.stalkMap _ ≫ stalkClosedPointTo f := by rw [stalkClosedPointTo, Scheme.Hom.stalkMap_comp] @@ -305,6 +314,7 @@ lemma germ_stalkClosedPointTo_Spec {R S : CommRingCat} [IsLocalRing S] (φ : R simp_rw [Opens.map_top] rw [germ_stalkClosedPointIso_hom, Iso.inv_hom_id, Category.comp_id] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma germ_stalkClosedPointTo (U : Opens X) (hU : f (closedPoint R) ∈ U) : X.presheaf.germ U _ hU ≫ stalkClosedPointTo f = f.app U ≫ @@ -331,6 +341,7 @@ lemma germ_stalkClosedPointTo_Spec_fromSpecStalk simp_rw [← Opens.map_top (Spec.map f).base] rw [← (Spec.map f).app_eq_appLE, ΓSpecIso_naturality, Iso.inv_hom_id_assoc] +set_option backward.isDefEq.respectTransparency.types false in lemma stalkClosedPointTo_fromSpecStalk (x : X) : stalkClosedPointTo (X.fromSpecStalk x) = (X.presheaf.stalkCongr (by rw [fromSpecStalk_closedPoint]; rfl)).hom := by @@ -339,6 +350,7 @@ lemma stalkClosedPointTo_fromSpecStalk (x : X) : have : X.fromSpecStalk x = Spec.map (𝟙 (X.presheaf.stalk x)) ≫ X.fromSpecStalk x := by simp convert! germ_stalkClosedPointTo_Spec_fromSpecStalk (𝟙 (X.presheaf.stalk x)) U hxU +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma Spec_stalkClosedPointTo_fromSpecStalk : Spec.map (stalkClosedPointTo f) ≫ X.fromSpecStalk _ = f := by @@ -373,6 +385,7 @@ lemma SpecToEquivOfLocalRing_eq_iff variable (X R) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a local ring `R` and scheme `X`, morphisms `Spec R ⟶ X` corresponds to pairs `(x, f)` where `x : X` and `f : 𝒪_{X, x} ⟶ R` is a local ring homomorphism. diff --git a/Mathlib/AlgebraicGeometry/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/StructureSheaf.lean index 8ce364d6d643fd..51af8e53d9d607 100644 --- a/Mathlib/AlgebraicGeometry/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/StructureSheaf.lean @@ -72,6 +72,7 @@ namespace StructureSheaf variable {P : PrimeSpectrum.Top R} +set_option backward.isDefEq.respectTransparency.types false in variable (M P) in /-- The type family over `PrimeSpectrum R` consisting of the localization over each point. -/ abbrev Localizations : Type u := LocalizedModule P.asIdeal.primeCompl M @@ -112,6 +113,7 @@ so we replace his circumlocution about functions into a disjoint union with def isLocallyFraction : LocalPredicate (Localizations (R := R) M) := (isFractionPrelocal R M).sheafify +set_option backward.isDefEq.respectTransparency.types false in variable (M) in /-- The functions satisfying `isLocallyFraction` form a submodule. -/ def sectionsSubmodule (U : (Opens (PrimeSpectrum.Top R))) : @@ -131,6 +133,7 @@ def sectionsSubmodule (U : (Opens (PrimeSpectrum.Top R))) : exact ⟨V, m, i, r • ra, sa, fun x ↦ ⟨(wa x).1, congr(r • $((wa x).2)).trans (LocalizedModule.smul'_mk ..)⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in variable (A) in /-- The functions satisfying `isLocallyFraction` form a subalgebra. -/ def sectionsSubalgebra (U : (Opens (PrimeSpectrum.Top R))) : @@ -276,6 +279,7 @@ def const (f : M) (g : R) (U : Opens (PrimeSpectrum.Top R)) Γ(M, U) := ⟨fun x => .mk f ⟨g, hu x.2⟩, fun x ↦ ⟨U, x.2, 𝟙 _, f, g, fun y ↦ ⟨hu y.2, rfl⟩⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem const_apply (f : M) (g : R) (U : Opens (PrimeSpectrum.Top R)) (hu : ∀ x ∈ U, g ∈ (x : PrimeSpectrum.Top R).asIdeal.primeCompl) (x : U) : @@ -303,6 +307,7 @@ theorem res_const (f : M) (g : R) (U hu V hv i) : (structureSheafInType R M).1.map i (const f g U hu) = const f g V hv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem const_zero (f : R) (U hu) : const (0 : M) f U hu = 0 := Subtype.ext <| funext fun x ↦ by simp; rfl @@ -356,6 +361,7 @@ theorem const_mul_cancel' (f g₁ g₂ : R) (U hu₁ hu₂) : const g₁ g₂ U hu₂ * const f g₁ U hu₁ = const f g₂ U hu₂ := by rw [mul_comm, const_mul_cancel] +set_option backward.isDefEq.respectTransparency.types false in theorem const_eq_const_of_smul_eq_smul (f₁ f₂ : M) (g₁ g₂ : R) (U hu₁ hu₂) (H : g₁ • f₂ = g₂ • f₁) : const f₁ g₁ U hu₁ = const f₂ g₂ U hu₂ := Subtype.ext (funext fun x ↦ by @@ -410,6 +416,7 @@ def toBasicOpenₗ (f : R) : exact Submonoid.powers_le (P := (IsUnit.submonoid _).comap (algebraMap R _)).mpr (isUnit_basicOpen_end ..) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toBasicOpenₗ_mk (s : R) (f : M) (g : Submonoid.powers s) : toBasicOpenₗ R M s (.mk f g) = const f g.1 (basicOpen s) (by @@ -512,6 +519,7 @@ theorem toBasicOpenₗ_surjective (f : R) : Function.Surjective (toBasicOpenₗ simp_rw [one_smul, Finset.smul_sum, Submonoid.smul_def, smul_comm (b i), hab _ i, ← smul_assoc, ← Finset.sum_smul, hc] +set_option backward.isDefEq.respectTransparency.types false in public instance (f : R) : IsLocalizedModule.Away f (toOpenₗ R M (basicOpen f)) := by convert! IsLocalizedModule.of_linearEquiv (.powers f) (LocalizedModule.mkLinearMap (.powers f) M) @@ -589,6 +597,7 @@ instance (x : PrimeSpectrum.Top R) : ↑(TopCat.Presheaf.stalk (moduleStructurePresheaf R M).presheaf x) := .of_algebraMap_smul fun _ _ ↦ rfl +set_option backward.isDefEq.respectTransparency.types false in variable (R M) in def modulePresheafStalkIso (x : PrimeSpectrum.Top R) : ↑(TopCat.Presheaf.stalk (moduleStructurePresheaf R M).presheaf x) ≃ₗ[R] @@ -660,6 +669,7 @@ theorem isUnit_toStalkₗ' (x : PrimeSpectrum.Top R) (f : R) (hf : x ∈ basicOp simp only [Module.algebraMap_end_apply] rw [toStalk_smul] +set_option backward.isDefEq.respectTransparency.types false in variable (R M) in /-- The canonical ring homomorphism from the localization of `R` at `p` to the stalk of the structure sheaf at the point `p`. -/ @@ -684,6 +694,7 @@ theorem localizationtoStalkₗ_mk (x : PrimeSpectrum.Top R) (f : M) (s) : congr 1 exact const_eq_const_of_smul_eq_smul (H := by simp) .. +set_option backward.isDefEq.respectTransparency.types false in variable (R M) in /-- The ring homomorphism that takes a section of the structure sheaf of `R` on the open set `U`, implemented as a subtype of dependent functions to localizations at prime ideals, and evaluates @@ -696,6 +707,7 @@ def openToLocalizationₗ (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.T map_smul' _ _ := rfl map_add' _ _ := rfl } +set_option backward.isDefEq.respectTransparency.types false in variable (R M) in /-- The ring homomorphism from the stalk of the structure sheaf of `R` at a point corresponding to a prime ideal `p` to the localization of `R` at `p`, @@ -769,6 +781,7 @@ theorem localizationToStalk_stalkToFiberRingHom (x : PrimeSpectrum.Top R) : localizationtoStalkₗ R M x ≫ stalkToLocalizationₗ R M x = 𝟙 _ := (stalkIsoₗ R M x).inv_hom_id +set_option backward.isDefEq.respectTransparency.types false in instance (x : PrimeSpectrum.Top R) : IsLocalizedModule x.asIdeal.primeCompl (toStalkₗ' R M x).hom := by convert! @@ -797,6 +810,7 @@ def toStalkₗ (x : PrimeSpectrum.Top R) : congr 1 exact (IsScalarTower.algebraMap_smul Γ(R, _) (M := Γ(M, _)) _ _).symm +set_option backward.isDefEq.respectTransparency.types false in public instance (x : PrimeSpectrum.Top R) : IsLocalizedModule x.asIdeal.primeCompl (toStalkₗ R M x) := by convert! @@ -815,6 +829,7 @@ instance (x : PrimeSpectrum.Top R) : IsLocalizedModule x.asIdeal.primeCompl (toS Limits.colimit.isoColimitCocone_ι_hom (C := Ab) .. exact congr($this _) +set_option backward.isDefEq.respectTransparency.types false in variable (R) in /-- The stalk of `Spec R` at `x` is isomorphic to the stalk of `R^~` at `x`. -/ @[expose] public @@ -848,6 +863,7 @@ def commRingCatStalkEquivModuleStalk (x : PrimeSpectrum.Top R) : rfl · exact congr($this _).symm +set_option backward.isDefEq.respectTransparency.types false in public instance (x : PrimeSpectrum.Top R) : IsLocalization.AtPrime ((structurePresheafInCommRingCat R).stalk x) x.asIdeal := by refine (isLocalizedModule_iff_isLocalization' _ _).mp ?_ @@ -872,6 +888,7 @@ public instance (x : PrimeSpectrum.Top R) : exact (((structurePresheafInCommRingCat R).germ ⊤ x (by simp)).hom.comp (algebraMap R Γ(R, _))).map_one.symm +set_option backward.isDefEq.respectTransparency.types false in variable (R) in /-- The stalk of `Spec R` at `x` is isomorphic to `Rₚ`, where `p` is the prime corresponding to `x`. -/ @@ -917,19 +934,23 @@ theorem stalkAlgebra_map (p : PrimeSpectrum R) (r : R) : algebraMap R ((structureSheaf R).presheaf.stalk p) r = toStalk R p r := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Stalk of the structure sheaf at a prime p as localization of R -/ instance IsLocalization.to_stalk (p : PrimeSpectrum R) : IsLocalization.AtPrime ((structureSheaf R).presheaf.stalk p) p.asIdeal := inferInstanceAs (IsLocalization.AtPrime ((structurePresheafInCommRingCat R).stalk p) p.asIdeal) +set_option backward.isDefEq.respectTransparency.types false in instance openAlgebra (U : (Opens (PrimeSpectrum R))ᵒᵖ) : Algebra R ((structureSheaf R).obj.obj U) := inferInstanceAs (Algebra R ((structureSheafInType R R).presheaf.obj _)) +set_option backward.isDefEq.respectTransparency.types false in /-- Sections of the structure sheaf of Spec R on a basic open as localization of R -/ instance IsLocalization.to_basicOpen (r : R) : IsLocalization.Away r ((structureSheaf R).obj.obj (op <| basicOpen r)) := inferInstanceAs (IsLocalization.Away r Γ(R, basicOpen r)) +set_option backward.isDefEq.respectTransparency.types false in instance to_basicOpen_epi (r : R) : Epi (CommRingCat.ofHom <| algebraMap R ((structureSheaf R).obj.obj (op <| basicOpen r))) := @@ -1035,6 +1056,7 @@ theorem isLocallyFraction_comapFun (U : Opens (PrimeSpectrum.Top R)) rw [H] simp +set_option backward.isDefEq.respectTransparency.types false in /-- For a ring homomorphism `f : R →+* S` and open sets `U` and `V` of the prime spectra of `R` and `S` such that `V ⊆ (comap f) ⁻¹ U`, the induced ring homomorphism from the structure sheaf of `R` at `U` to the structure sheaf of `S` at `V`. @@ -1082,6 +1104,7 @@ theorem comapₗ_eq_localRingHom (f : R →+* S) (U : Opens (PrimeSpectrum.Top R convert_to Localization.mk _ _ = Localization.localRingHom _ _ _ _ (Localization.mk _ _) simp [Localization.mk_eq_mk'] +set_option backward.isDefEq.respectTransparency.types false in /-- For a ring homomorphism `f : R →+* S` and open sets `U` and `V` of the prime spectra of `R` and `S` such that `V ⊆ (comap f) ⁻¹ U`, the induced ring homomorphism from the structure sheaf of `R` at `U` to the structure sheaf of `S` at `V`. @@ -1107,6 +1130,7 @@ def comap (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) (V : Opens (PrimeSpe simp only [comapₗ_eq_localRingHom, PrimeSpectrum.comap_asIdeal] exact (Localization.localRingHom ..).map_zero +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem comap_apply (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) (V : Opens (PrimeSpectrum.Top S)) (hUV : V.1 ⊆ PrimeSpectrum.comap f ⁻¹' U.1) @@ -1127,6 +1151,7 @@ theorem comap_const (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) convert_to Localization.localRingHom _ _ _ _ (Localization.mk _ _) = Localization.mk _ _ simp [Localization.mk_eq_mk'] +set_option backward.isDefEq.respectTransparency.types false in /-- For an inclusion `i : V ⟶ U` between open sets of the prime spectrum of `R`, the comap of the identity from OO_X(U) to OO_X(V) equals as the restriction map of the structure sheaf. @@ -1167,6 +1192,7 @@ theorem comap_comp (f : R →+* S) (g : S →+* P) (U : Opens (PrimeSpectrum.Top rw [comap_apply, Localization.localRingHom_comp _ (PrimeSpectrum.comap g p.1).asIdeal] <;> simp +set_option backward.isDefEq.respectTransparency.types false in @[elementwise, reassoc] theorem toOpen_comp_comap (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) : CommRingCat.ofHom (algebraMap _ _) ≫ @@ -1178,6 +1204,7 @@ theorem toOpen_comp_comap (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) : rw [comap_apply] exact Localization.localRingHom_to_map _ _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma comap_basicOpen (f : R →+* S) (x : R) : comap f (PrimeSpectrum.basicOpen x) (PrimeSpectrum.basicOpen (f x)) (PrimeSpectrum.comap_basicOpen f x).le = diff --git a/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean b/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean index 0394d01b69ff79..829e9d30a42e93 100644 --- a/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean +++ b/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean @@ -110,6 +110,7 @@ namespace ValuativeCriterion.Existence open IsLocalRing +set_option backward.isDefEq.respectTransparency.types false in @[stacks 01KE] lemma specializingMap (H : ValuativeCriterion.Existence f) : SpecializingMap f := by @@ -323,6 +324,7 @@ lemma IsSeparated.eq_valuativeCriterion : end Uniqueness +set_option backward.isDefEq.respectTransparency.types false in /-- The **valuative criterion** for proper morphisms. -/ @[stacks 0BX5] lemma IsProper.eq_valuativeCriterion : diff --git a/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean b/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean index 0448888c13e6d0..1879be52c37a82 100644 --- a/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean +++ b/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean @@ -188,6 +188,7 @@ lemma Scheme.Hom.exists_mem_and_isIso_morphismRestrict_toNormalization (Q := @Surjective ⊓ @Flat ⊓ @LocallyOfFinitePresentation) this ⟨⟨‹_›, inferInstance⟩, inferInstance⟩ ‹_› +set_option backward.isDefEq.respectTransparency.types false in /-- **Zariski's main theorem** @@ -287,6 +288,7 @@ lemma Scheme.Hom.exists_isIso_morphismRestrict_toNormalization rw [← RingHom.algebraMap_toAlgebra (X.presheaf.germ _ _ _).hom, @RingHom.quasiFinite_algebraMap] exact .of_isLocalization (hr.primeIdealOf ⟨x, hxV⟩).asIdeal.primeCompl +set_option backward.isDefEq.respectTransparency.types false in lemma Scheme.Hom.isOpen_quasiFiniteAt [LocallyOfFiniteType f] : IsOpen { x | f.QuasiFiniteAt x } := by wlog H : IsAffineHom f @@ -399,6 +401,7 @@ lemma IsClosedImmersion.eq_proper_inf_monomorphisms : ext exact IsClosedImmersion.iff_isProper_and_mono .. +set_option backward.isDefEq.respectTransparency.types false in @[stacks 02UP] lemma exists_isFinite_morphismRestrict_of_finite_preimage_singleton [IsProper f] (y : Y) (hx : (f ⁻¹' {y}).Finite) : diff --git a/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean b/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean index 7e6761fa8ed7d9..967618574f0171 100644 --- a/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean +++ b/Mathlib/AlgebraicTopology/AlternatingFaceMapComplex.lean @@ -120,6 +120,7 @@ theorem d_squared (n : ℕ) : objD X (n + 1) ≫ objD X n = 0 := by /-- The alternating face map complex, on objects -/ +@[implicit_reducible] def obj : ChainComplex C ℕ := ChainComplex.of (fun n => X _⦋n⦌) (objD X) (d_squared X) @@ -155,6 +156,7 @@ end AlternatingFaceMapComplex variable (C : Type*) [Category* C] [Preadditive C] /-- The alternating face map complex, as a functor -/ +@[implicit_reducible] def alternatingFaceMapComplex : SimplicialObject C ⥤ ChainComplex C ℕ where obj := AlternatingFaceMapComplex.obj map f := AlternatingFaceMapComplex.map f @@ -261,6 +263,7 @@ end AlternatingFaceMapComplex variable {A : Type*} [Category* A] [Abelian A] +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion map of the Moore complex in the alternating face map complex -/ def inclusionOfMooreComplexMap (X : SimplicialObject A) : (normalizedMooreComplex A).obj X ⟶ (alternatingFaceMapComplex A).obj X := @@ -290,6 +293,7 @@ theorem inclusionOfMooreComplexMap_f (X : SimplicialObject A) (n : ℕ) : variable (A) set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion map of the Moore complex in the alternating face map complex, as a natural transformation -/ @[simps] diff --git a/Mathlib/AlgebraicTopology/CechNerve.lean b/Mathlib/AlgebraicTopology/CechNerve.lean index 9b9f4f0b1aff3e..c0299606cfaf62 100644 --- a/Mathlib/AlgebraicTopology/CechNerve.lean +++ b/Mathlib/AlgebraicTopology/CechNerve.lean @@ -52,7 +52,7 @@ variable [∀ n : ℕ, HasWidePullback.{0} f.right (fun _ : Fin (n + 1) => f.lef set_option backward.isDefEq.respectTransparency false in /-- The Čech nerve associated to an arrow. -/ -@[simps] +@[simps, implicit_reducible] def cechNerve : SimplicialObject C where obj n := widePullback.{0} f.right (fun _ : Fin (n.unop.len + 1) => f.left) fun _ => f.hom map g := WidePullback.lift (WidePullback.base _) @@ -114,6 +114,7 @@ def augmentedCechNerve : Arrow C ⥤ SimplicialObject.Augmented C where obj f := f.augmentedCechNerve map F := Arrow.mapAugmentedCechNerve F +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A helper function used in defining the Čech adjunction. -/ @[simps] @@ -254,6 +255,7 @@ def augmentedCechConerve : Arrow C ⥤ CosimplicialObject.Augmented C where obj f := f.augmentedCechConerve map F := Arrow.mapAugmentedCechConerve F +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A helper function used in defining the Čech conerve adjunction. -/ @[simps!] @@ -344,6 +346,7 @@ namespace CechNerveTerminalFrom variable [HasTerminal C] (ι : Type w) /-- The diagram `Option ι ⥤ C` sending `none` to the terminal object and `some j` to `X`. -/ +@[implicit_reducible] def wideCospan (X : C) : WidePullbackShape ι ⥤ C := WidePullbackShape.wideCospan (terminal C) (fun _ : ι => X) fun _ => terminal.from X @@ -405,6 +408,7 @@ lemma wideCospan.limitIsoPi_inv_comp_pi [Finite ι] (X : C) (j : ι) : (wideCospan.limitIsoPi ι X).inv ≫ WidePullback.π _ j = Pi.π _ j := IsLimit.conePointUniqueUpToIso_inv_comp _ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma wideCospan.limitIsoPi_hom_comp_pi [Finite ι] (X : C) (j : ι) : (wideCospan.limitIsoPi ι X).hom ≫ Pi.π _ j = WidePullback.π _ j := by diff --git a/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean b/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean index 5d64c0bc3c4a4b..967dd761693aea 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean @@ -85,6 +85,7 @@ def equivalence₁CounitIso : (e'.inverse ⋙ eA.inverse) ⋙ F ≅ 𝟭 B' := _ ≅ e'.inverse ⋙ e'.functor := isoWhiskerLeft _ (leftUnitor _) _ ≅ 𝟭 B' := e'.counitIso +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by ext Y @@ -103,6 +104,7 @@ def equivalence₁UnitIso : 𝟭 A ≅ F ⋙ e'.inverse ⋙ eA.inverse := _ ≅ (eA.functor ⋙ e'.functor) ⋙ e'.inverse ⋙ eA.inverse := (associator _ _ _).symm _ ≅ F ⋙ e'.inverse ⋙ eA.inverse := isoWhiskerRight hF _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by ext X @@ -154,6 +156,7 @@ def equivalence₂UnitIso : 𝟭 A ≅ (F ⋙ eB.inverse) ⋙ eB.functor ⋙ e'. _ ≅ (F ⋙ eB.inverse) ⋙ eB.functor ⋙ e'.inverse ⋙ eA.inverse := associator _ _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem equivalence₂UnitIso_eq : (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF := by ext X @@ -269,6 +272,7 @@ def equivalenceUnitIso : 𝟭 A ≅ (F ⋙ eB.inverse) ⋙ G := variable {ε hF hG} +set_option backward.isDefEq.respectTransparency.types false in theorem equivalenceUnitIso_eq (hε : υ hF = ε) : (equivalence hF hG).unitIso = equivalenceUnitIso hG ε := by ext1; apply NatTrans.ext; ext X diff --git a/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean b/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean index f6a735cfaa3bd1..cffd8bd19436ea 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/FunctorGamma.lean @@ -327,6 +327,7 @@ for any additive category `C`. -/ def Γ₂ : Karoubi (ChainComplex C ℕ) ⥤ Karoubi (SimplicialObject C) := (CategoryTheory.Idempotents.functorExtension₂ _ _).obj Γ₀ +set_option backward.isDefEq.respectTransparency.types false in theorem HigherFacesVanish.on_Γ₀_summand_id (K : ChainComplex C ℕ) (n : ℕ) : @HigherFacesVanish C _ _ (Γ₀.obj K) _ n (n + 1) (((Γ₀.splitting K).cofan _).inj (Splitting.IndexSet.id (op ⦋n + 1⦌))) := by diff --git a/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean b/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean index cbfd75b4f86e11..019657de331b8d 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/FunctorN.lean @@ -48,7 +48,7 @@ variable {C : Type*} [Category* C] [Preadditive C] set_option backward.isDefEq.respectTransparency false in /-- The functor `SimplicialObject C ⥤ Karoubi (ChainComplex C ℕ)` which maps `X` to the formal direct factor of `K[X]` defined by `PInfty`. -/ -@[simps] +@[simps, implicit_reducible] def N₁ : SimplicialObject C ⥤ Karoubi (ChainComplex C ℕ) where obj X := { X := AlternatingFaceMapComplex.obj X diff --git a/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean b/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean index 544576f07024a4..07504406f1a7d9 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean @@ -140,6 +140,7 @@ theorem Hσ_eq_zero (q : ℕ) : (Hσ q : K[X] ⟶ K[X]).f 0 = 0 := by simp · rw [hσ'_eq_zero (Nat.succ_pos q) (c_mk 1 0 rfl), zero_comp] +set_option backward.isDefEq.respectTransparency.types false in /-- The maps `hσ' q n m hnm` are natural on the simplicial object -/ theorem hσ'_naturality (q : ℕ) (n m : ℕ) (hnm : c.Rel m n) {X Y : SimplicialObject C} (f : X ⟶ Y) : f.app (op ⦋n⦌) ≫ hσ' q n m hnm = hσ' q n m hnm ≫ f.app (op ⦋m⦌) := by diff --git a/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean b/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean index 43c7aa64499ae2..ae8275f4163c33 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/Normalized.lean @@ -73,6 +73,7 @@ def PInftyToNormalizedMooreComplex (X : SimplicialObject A) : K[X] ⟶ N[X] := ← alternatingFaceMapComplex_obj_d] exact PInfty.comm (n + 1) n +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] theorem PInftyToNormalizedMooreComplex_comp_inclusionOfMooreComplexMap (X : SimplicialObject A) : diff --git a/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean b/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean index f91f096b7b636f..dda65810f8dbe1 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/SplitSimplicialObject.lean @@ -226,6 +226,7 @@ noncomputable def toKaroubiNondegComplexIsoN₁ : simp only [πSummand_comp_cofan_inj_id_comp_PInfty_eq_PInfty, Karoubi.comp_f, HomologicalComplex.comp_f, N₁_obj_p, Karoubi.id_f] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma toKaroubiNondegComplexIsoN₁_hom_f_PInfty : @@ -259,23 +260,27 @@ noncomputable def fromNondegComplex : s.nondegComplex ⟶ K[X] := (fullyFaithfulToKaroubi _).preimage (s.toKaroubiNondegComplexIsoN₁.hom ≫ { f := PInfty }) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma PInfty_toNondegComplex : PInfty ≫ s.toNondegComplex = s.toNondegComplex := (toKaroubi _).map_injective (by simp [toNondegComplex]) +set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma fromNondegComplex_toNondegComplex : s.fromNondegComplex ≫ s.toNondegComplex = 𝟙 _ := (toKaroubi _).map_injective (by simp [toNondegComplex, fromNondegComplex]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma toNondegComplex_f (n : ℕ) : s.toNondegComplex.f n = PInfty.f n ≫ s.toKaroubiNondegComplexIsoN₁.inv.f.f n := by simp [toNondegComplex, fullyFaithfulToKaroubi] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma fromNondegComplex_f (n : ℕ) : diff --git a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean index 9a9a9cbf0c3cf6..1b5bfc794593c7 100644 --- a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean +++ b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean @@ -87,6 +87,7 @@ namespace ExtraDegeneracy attribute [reassoc] s₀_comp_δ₁ s_comp_δ s_comp_σ attribute [reassoc (attr := simp)] s'_comp_ε s_comp_δ₀ +set_option backward.isDefEq.respectTransparency.types false in attribute [local simp←] Functor.map_comp in attribute [local simp] s₀_comp_δ₁ s_comp_δ s_comp_σ in /-- If `ed` is an extra degeneracy for `X : SimplicialObject.Augmented C` and diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean index 60ec55089e9660..3b91c35369beac 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean @@ -99,6 +99,7 @@ theorem transReflReparamAux_zero : transReflReparamAux 0 = 0 := by theorem transReflReparamAux_one : transReflReparamAux 1 = 1 := by norm_num [transReflReparamAux] +set_option backward.isDefEq.respectTransparency.types false in theorem trans_refl_reparam (p : Path x₀ x₁) : p.trans (Path.refl x₁) = p.reparam (fun t => ⟨transReflReparamAux t, transReflReparamAux_mem_I t⟩) (by fun_prop) diff --git a/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean b/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean index c22a0cb1c11ea3..b5f417f6d8ac27 100644 --- a/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean +++ b/Mathlib/AlgebraicTopology/FundamentalGroupoid/InducedMaps.lean @@ -150,7 +150,6 @@ include hfg `f(p)` and `g(p)` are the same as well, despite having a priori different types -/ theorem heq_path_of_eq_image : (πₘ (TopCat.ofHom f)).map ⟦p⟧ ≍ (πₘ (TopCat.ofHom g)).map ⟦q⟧ := by - simp only [map_eq] apply Path.Homotopic.hpath_hext exact hfg diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean b/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean index ec18683c46f7ff..5206244cd8631f 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Basic.lean @@ -123,7 +123,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Constructor for `ModelCategory C` which assumes a formulation of axioms using weak factorization systems. -/ -@[implicit_reducible] +@[instance_reducible] def mk' [CategoryWithFibrations C] [CategoryWithCofibrations C] [CategoryWithWeakEquivalences C] [HasFiniteLimits C] [HasFiniteColimits C] [(weakEquivalences C).HasTwoOutOfThreeProperty] diff --git a/Mathlib/AlgebraicTopology/ModelCategory/BifibrantObjectHomotopy.lean b/Mathlib/AlgebraicTopology/ModelCategory/BifibrantObjectHomotopy.lean index 38eb10e6e53d71..8c9fad73ed6f81 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/BifibrantObjectHomotopy.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/BifibrantObjectHomotopy.lean @@ -141,6 +141,7 @@ section variable {X Y : C} [IsCofibrant X] [IsCofibrant Y] [IsFibrant X] [IsFibrant Y] +set_option backward.isDefEq.respectTransparency.types false in /-- Right homotopy classes of maps between bifibrant objects identify to morphisms in the homotopy category `BifibrantObject.HoCat`. -/ def HoCat.homEquivRight : @@ -170,12 +171,14 @@ lemma HoCat.homEquivLeft_apply (f : X ⟶ Y) : HoCat.homEquivLeft (.mk f) = toHoCat.map (homMk f) := by simp [homEquivLeft] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma HoCat.homEquivLeft_symm_apply (f : X ⟶ Y) : HoCat.homEquivRight.symm (toHoCat.map (homMk f)) = .mk f := rfl end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inclusion functor `BifibrantObject.HoCat C ⥤ FibrantObject.HoCat C`. -/ def HoCat.ιFibrantObject : HoCat C ⥤ FibrantObject.HoCat C := @@ -202,6 +205,7 @@ def toHoCatCompιFibrantObject : toHoCat (C := C) ⋙ HoCat.ιFibrantObject ≅ ιFibrantObject ⋙ FibrantObject.toHoCat := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inclusion functor `BifibrantObject.HoCat C ⥤ CofibrantObject.HoCat C`. -/ def HoCat.ιCofibrantObject : HoCat C ⥤ CofibrantObject.HoCat C := @@ -308,6 +312,7 @@ lemma bifibrantResolutionMap_fac' {X₁ X₂ : CofibrantObject C} (f : X₁ ⟶ toHoCat.map f ≫ toHoCat.map X₂.iBifibrantResolutionObj := toHoCat.congr_map (bifibrantResolutionMap_fac f) +set_option backward.isDefEq.respectTransparency.types false in lemma bifibrantResolutionObj_hom_ext {X : CofibrantObject C} {Y : BifibrantObject.HoCat C} {f g : BifibrantObject.toHoCat.obj (bifibrantResolutionObj X) ⟶ Y} diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean b/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean index f849e99bcc646c..d463d479839614 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Cylinder.lean @@ -200,6 +200,7 @@ instance : IsCofibrant P.I := end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [HasBinaryCoproducts C] [CategoryWithCofibrations C] [P.IsGood] [(cofibrations C).RespectsIso] : P.symm.IsGood where diff --git a/Mathlib/AlgebraicTopology/ModelCategory/Transport.lean b/Mathlib/AlgebraicTopology/ModelCategory/Transport.lean index b644d80c29d975..0d9ae1b0ab77ac 100644 --- a/Mathlib/AlgebraicTopology/ModelCategory/Transport.lean +++ b/Mathlib/AlgebraicTopology/ModelCategory/Transport.lean @@ -35,7 +35,7 @@ with a `CategoryWithFibrations` instance (and similarly for cofibrations and wea equivalences), and that the three properties of morphisms (fibrations, cofibrations, weak equivalences) in `C` coincide with the inverse images by `e.functor : C ⥤ D` of the corresponding properties of morphisms in `D`. -/ -@[implicit_reducible] +@[instance_reducible] def ModelCategory.transport {C D : Type*} [Category* C] [Category* D] [ModelCategory D] [CategoryWithCofibrations C] [CategoryWithFibrations C] diff --git a/Mathlib/AlgebraicTopology/MooreComplex.lean b/Mathlib/AlgebraicTopology/MooreComplex.lean index f020476c6b2c50..d8a3344110ada6 100644 --- a/Mathlib/AlgebraicTopology/MooreComplex.lean +++ b/Mathlib/AlgebraicTopology/MooreComplex.lean @@ -120,6 +120,7 @@ def obj (X : SimplicialObject C) : ChainComplex C ℕ := variable {X} {Y : SimplicialObject C} (f : X ⟶ Y) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The normalized Moore complex functor, on morphisms. -/ @@ -140,6 +141,7 @@ end NormalizedMooreComplex open NormalizedMooreComplex +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (C) in /-- The (normalized) Moore complex of a simplicial object `X` in an abelian category `C`. @@ -155,6 +157,7 @@ def normalizedMooreComplex : SimplicialObject C ⥤ ChainComplex C ℕ where obj := obj map f := map f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- Not `@[simp]` as `simp` can prove this. theorem normalizedMooreComplex_objD (X : SimplicialObject C) (n : ℕ) : diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean index 2aadc5ef00a66b..988ef2258db890 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean @@ -176,6 +176,7 @@ def subinterval {n} (j l : ℕ) (hjl : j + l ≤ n) : monotone' := fun i i' hii' => by simpa only [Fin.mk_le_mk, add_le_add_iff_right] using! hii' } +set_option backward.isDefEq.respectTransparency.types false in lemma const_subinterval_eq {n} (j l : ℕ) (hjl : j + l ≤ n) (i : Fin (l + 1)) : ⦋0⦌.const ⦋l⦌ i ≫ subinterval j l hjl = ⦋0⦌.const ⦋n⦌ ⟨j + i.1, lt_add_of_lt_add_right (Nat.add_lt_add_left i.2 j) hjl⟩ := by @@ -185,6 +186,7 @@ lemma const_subinterval_eq {n} (j l : ℕ) (hjl : j + l ≤ n) (i : Fin (l + 1)) dsimp [subinterval] rw [add_comm] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mkOfSucc_subinterval_eq {n} (j l : ℕ) (hjl : j + l ≤ n) (i : Fin l) : mkOfSucc i ≫ subinterval j l hjl = @@ -193,6 +195,7 @@ lemma mkOfSucc_subinterval_eq {n} (j l : ℕ) (hjl : j + l ≤ n) (i : Fin l) : ext (i : Fin 2) match i with | 0 | 1 => simp; lia +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma diag_subinterval_eq {n} (j l : ℕ) (hjl : j + l ≤ n) : diag l ≫ subinterval j l hjl = intervalEdge j l hjl := by diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/DeltaZeroIter.lean b/Mathlib/AlgebraicTopology/SimplexCategory/DeltaZeroIter.lean index e32acc183430c2..0d4397d323b424 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/DeltaZeroIter.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/DeltaZeroIter.lean @@ -126,6 +126,7 @@ lemma σ₀Iter_coe_eq_of_lt (i : ℕ) {n m : ℕ} dsimp% (σ₀Iter i hi j).val = 0 := by simp [σ₀Iter, Hom.mk, ConcreteCategory.hom, Hom.toOrderHom, if_pos hj] +set_option backward.isDefEq.respectTransparency.types false in lemma σ₀Iter_coe_eq_of_ge (i : ℕ) {n m : ℕ} (j : Fin (m + 1)) (hi : n + i = m := by lia) (hj : i ≤ j.val := by grind) : dsimp% (σ₀Iter i hi j).val = j.val - i := by diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean index 7a80d72802d63e..2504a8f2b88e73 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Rev.lean @@ -23,6 +23,7 @@ open CategoryTheory namespace SimplexCategory +set_option backward.isDefEq.respectTransparency.types false in /-- The covariant involution `rev : SimplexCategory ⥤ SimplexCategory` which, via the equivalence between the simplex category and the category of nonempty finite linearly ordered types, corresponds to @@ -74,6 +75,7 @@ lemma rev_map_rev_map {n m : SimplexCategory} (f : n ⟶ m) : rev.map (rev.map f) = f := by aesop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `SimplexCategory.rev : SimplexCategory ⥤ SimplexCategory` as an equivalence of category. -/ diff --git a/Mathlib/AlgebraicTopology/SimplicialNerve.lean b/Mathlib/AlgebraicTopology/SimplicialNerve.lean index e09a994f76df67..0b3ef7c8929fd3 100644 --- a/Mathlib/AlgebraicTopology/SimplicialNerve.lean +++ b/Mathlib/AlgebraicTopology/SimplicialNerve.lean @@ -116,6 +116,7 @@ def compFunctor {J : Type*} [LinearOrder J] obj x := x.1 ≫ x.2 map f := ⟨⟨⟨Set.union_subset_union f.1.1.1.1 f.2.1.1.1⟩⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local ext (iff := false)] Functor.ext in attribute [local simp] types_tensorObj_def in @@ -128,6 +129,7 @@ instance (J : Type*) [LinearOrder J] : fun _ _ _ ↦ by simp; rfl⟩ homEquiv {i j} := nerveEquiv.symm.trans (SSet.unitHomEquiv (nerve (i ⟶ j))).symm +set_option backward.isDefEq.respectTransparency.types false in attribute [local simp] SimplicialThickening.Hom_def /-- Auxiliary definition for `SimplicialThickening.functor` -/ @@ -144,6 +146,7 @@ alias orderHom := functorMap attribute [local simp] nerveMap_app +set_option backward.isDefEq.respectTransparency.types false in attribute [local simp] types_tensorObj_def in /-- The simplicial thickening defines a functor from the category of linear orders to the category of @@ -181,6 +184,7 @@ lemma functor_comp {J K L : Type u} [LinearOrder J] [LinearOrder K] end SimplicialThickening +set_option backward.isDefEq.respectTransparency.types false in /-- The simplicial nerve of a simplicial category `C` is defined as the simplicial set whose `n`-simplices are given by the set of simplicial functors from the simplicial thickening of diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean index 08d66037bf9ba6..4f96de1268e5e6 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Basic.lean @@ -395,6 +395,7 @@ abbrev const : C ⥤ SimplicialObject C := CategoryTheory.Functor.const _ /-- The category of augmented simplicial objects, defined as a comma category. -/ +@[implicit_reducible] def Augmented := Comma (𝟭 (SimplicialObject C)) (const C) @@ -412,12 +413,12 @@ lemma hom_ext {X Y : Augmented C} (f g : X ⟶ Y) (h₁ : f.left = g.left) (h₂ Comma.hom_ext _ _ h₁ h₂ /-- Drop the augmentation. -/ -@[simps!] +@[simps!, implicit_reducible] def drop : Augmented C ⥤ SimplicialObject C := Comma.fst _ _ /-- The point of the augmentation. -/ -@[simps!] +@[simps!, implicit_reducible] def point : Augmented C ⥤ C := Comma.snd _ _ @@ -462,6 +463,7 @@ def whiskeringObj (D : Type*) [Category* D] (F : C ⥤ D) : Augmented C ⥤ Augm right := F.map η.right w := by ext; simp [← Functor.map_comp, w_app] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functor composition induces a functor on augmented simplicial objects. -/ @[simps] @@ -510,6 +512,7 @@ def augment (X : SimplicialObject C) (X₀ : C) (f : X _⦋0⦌ ⟶ X₀) simpa only [← X.map_comp, ← Category.assoc, Category.comp_id, ← op_comp] using w _ _ _ } -- Not `@[simp]` since `simp` can prove this. +set_option backward.isDefEq.respectTransparency.types false in theorem augment_hom_zero (X : SimplicialObject C) (X₀ : C) (f : X _⦋0⦌ ⟶ X₀) (w) : (X.augment X₀ f w).hom.app (op ⦋0⦌) = f := by simp @@ -582,6 +585,7 @@ def σ {n} (i : Fin (n + 1)) : X ^⦋n + 1⦌ ⟶ X ^⦋n⦌ := def eqToIso {n m : ℕ} (h : n = m) : X ^⦋n⦌ ≅ X ^⦋m⦌ := X.mapIso (CategoryTheory.eqToIso (by rw [h])) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem eqToIso_refl {n : ℕ} (h : n = n) : X.eqToIso h = Iso.refl _ := by simp [eqToIso] @@ -831,6 +835,7 @@ def whiskeringObj (D : Type*) [Category* D] (F : C ⥤ D) : Augmented C ⥤ Augm rw [Category.id_comp, Category.id_comp, ← F.map_comp, ← F.map_comp] simp [w_app, map_comp] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functor composition induces a functor on augmented cosimplicial objects. -/ @[simps] @@ -879,6 +884,7 @@ def augment (X : CosimplicialObject C) (X₀ : C) (f : X₀ ⟶ X.obj ⦋0⦌) rw [Category.id_comp, Category.assoc, ← X.map_comp, w] } -- Not `@[simp]` since `simp` can prove this. +set_option backward.isDefEq.respectTransparency.types false in theorem augment_hom_zero (X : CosimplicialObject C) (X₀ : C) (f : X₀ ⟶ X.obj ⦋0⦌) (w) : (X.augment X₀ f w).hom.app ⦋0⦌ = f := by simp @@ -924,6 +930,7 @@ def CosimplicialObject.Augmented.leftOp (X : CosimplicialObject.Augmented Cᵒ right := X.left.unop hom := NatTrans.leftOp X.hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Converting an augmented simplicial object to an augmented cosimplicial object and back is isomorphic to the given object. -/ @@ -932,6 +939,7 @@ def SimplicialObject.Augmented.rightOpLeftOpIso (X : SimplicialObject.Augmented X.rightOp.leftOp ≅ X := Comma.isoMk X.left.rightOpLeftOpIso (CategoryTheory.eqToIso <| by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Converting an augmented cosimplicial object to an augmented simplicial object and back is isomorphic to the given object. -/ @@ -942,6 +950,7 @@ def CosimplicialObject.Augmented.leftOpRightOpIso (X : CosimplicialObject.Augmen variable (C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functorial version of `SimplicialObject.Augmented.rightOp`. -/ @[simps] @@ -958,6 +967,7 @@ def simplicialToCosimplicialAugmented : congr 1 exact (congr_app f.unop.w (op x)).symm } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functorial version of `Cosimplicial_object.Augmented.leftOp`. -/ @[simps] @@ -975,6 +985,7 @@ def cosimplicialToSimplicialAugmented : congr 1 exact (congr_app f.w (unop x)).symm } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The contravariant categorical equivalence between augmented simplicial objects and augmented cosimplicial objects in the opposite category. -/ diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/DeltaZeroIter.lean b/Mathlib/AlgebraicTopology/SimplicialObject/DeltaZeroIter.lean index 2ab142cda6f1ae..6ca1ad01718f6d 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/DeltaZeroIter.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/DeltaZeroIter.lean @@ -153,13 +153,15 @@ set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma δ₀Iter_hom_app {n m : ℕ} (i : ℕ) (hi : n + i = m := by lia) : dsimp% Y.left.δ₀Iter i hi ≫ Y.hom.app (op ⦋n⦌) = Y.hom.app (op ⦋m⦌) := by - simpa using! Y.hom.naturality (SimplexCategory.δ₀Iter i hi).op + simpa only [Functor.id_obj, Functor.const_obj_obj, Functor.const_obj_map, Category.comp_id] using! + Y.hom.naturality (SimplexCategory.δ₀Iter i hi).op set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma σ₀Iter_hom_app {n m : ℕ} (i : ℕ) (hi : n + i = m := by lia) : dsimp% Y.left.σ₀Iter i hi ≫ Y.hom.app (op ⦋m⦌) = Y.hom.app (op ⦋n⦌) := by - simpa using! Y.hom.naturality (SimplexCategory.σ₀Iter i hi).op + simpa only [Functor.id_obj, Functor.const_obj_obj, Functor.const_obj_map, Category.comp_id] using! + Y.hom.naturality (SimplexCategory.σ₀Iter i hi).op end Augmented diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean index a773994633dab2..338e1a8be37c03 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Op.lean @@ -70,12 +70,14 @@ def opFunctorCompOpFunctorIso : opFunctor (C := C) ⋙ opFunctor ≅ 𝟭 _ := ((Functor.opHom _ _).mapIso (SimplexCategory.revCompRevIso).symm.op) ≪≫ Functor.whiskeringLeftObjIdIso +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma opFunctorCompOpFunctorIso_hom_app_app (X : SimplicialObject C) (n : SimplexCategoryᵒᵖ) : (opFunctorCompOpFunctorIso.hom.app X).app n = opObjIso.hom ≫ opObjIso.hom := by simp [opFunctorCompOpFunctorIso, opObjIso, opFunctor] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma opFunctorCompOpFunctorIso_inv_app_app (X : SimplicialObject C) (n : SimplexCategoryᵒᵖ) : diff --git a/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean b/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean index ec40d99b4bf5e3..2cb1f4c2364b72 100644 --- a/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean +++ b/Mathlib/AlgebraicTopology/SimplicialObject/Split.lean @@ -74,6 +74,7 @@ instance : Epi A.e := theorem ext' : A = ⟨A.1, ⟨A.e, A.2.2⟩⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem ext (A₁ A₂ : IndexSet Δ) (h₁ : A₁.1 = A₂.1) (h₂ : A₁.e ≫ eqToHom (by rw [h₁]) = A₂.e) : A₁ = A₂ := by rcases A₁ with ⟨Δ₁, ⟨α₁, hα₁⟩⟩ @@ -221,6 +222,7 @@ namespace Splitting variable {X Y : SimplicialObject C} (s : Splitting X) /-- The cofan for `summand s.N Δ` induced by a splitting of a simplicial object. -/ +@[implicit_reducible] def cofan (Δ : SimplexCategoryᵒᵖ) : Cofan (summand s.N Δ) := Cofan.mk (X.obj Δ) (fun A => s.ι A.1.unop.len ≫ X.map A.e.op) @@ -231,6 +233,7 @@ def isColimit (Δ : SimplexCategoryᵒᵖ) : IsColimit (s.cofan Δ) := s.isColim theorem cofan_inj_eq {Δ : SimplexCategoryᵒᵖ} (A : IndexSet Δ) : (s.cofan Δ).inj A = s.ι A.1.unop.len ≫ X.map A.e.op := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem cofan_inj_id (n : ℕ) : (s.cofan _).inj (IndexSet.id (op ⦋n⦌)) = s.ι n := by simp [IndexSet.id, IndexSet.e, cofan_inj_eq] @@ -272,6 +275,7 @@ theorem ι_desc {Z : C} (Δ : SimplexCategoryᵒᵖ) (F : ∀ A : IndexSet Δ, s (A : IndexSet Δ) : (s.cofan Δ).inj A ≫ s.desc Δ F = F A := by apply Cofan.IsColimit.fac +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A simplicial object that is isomorphic to a split simplicial object is split. -/ @[simps] @@ -281,6 +285,7 @@ def ofIso (e : X ≅ Y) : Splitting Y where isColimit' Δ := IsColimit.ofIsoColimit (s.isColimit Δ) (Cofan.ext (e.app Δ) (fun A => by simp [cofan, cofan'])) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] theorem cofan_inj_epi_naturality {Δ₁ Δ₂ : SimplexCategoryᵒᵖ} (A : IndexSet Δ₁) (p : Δ₁ ⟶ Δ₂) diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean index e07d23faf0f987..77deaff9de95d4 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/IsUniquelyCodimOneFace.lean @@ -104,6 +104,7 @@ lemma unique (f : ⦋d⦌ ⟶ ⦋d + 1⦌) [Mono f] end +set_option backward.isDefEq.respectTransparency.types false in include hxy in lemma op : (S.opEquiv.symm x).IsUniquelyCodimOneFace (S.opEquiv.symm y) := by obtain ⟨d, x, rfl⟩ := x.mk_surjective diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Op.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Op.lean index 724526cc37f81d..d1ba23806c652e 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Op.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Op.lean @@ -41,6 +41,7 @@ lemma op_p (x : P.II) : dsimp% P.op.p ⟨Subcomplex.N.opEquiv.symm x.1, x.2⟩ = ⟨Subcomplex.N.opEquiv.symm (P.p x), by simp⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma op_ancestralRel_iff (x y : P.II) : P.op.AncestralRel ⟨Subcomplex.N.opEquiv.symm x.1, x.2⟩ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean index 601646535b80e9..ecdc03c012730d 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Pairing.lean @@ -165,6 +165,7 @@ lemma ofIso_p (x : P.II) : change e'.symm (P.p ⟨e' (e'.symm x), _⟩) = e'.symm (P.p x) simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma ofIso_ancestralRel_iff (x y : P.II) : (P.ofIso e hA).AncestralRel diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean index 5e05459a0ba5f6..2664422265f537 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/PairingCore.lean @@ -240,6 +240,7 @@ is regular. -/ class IsRegular (h : A.PairingCore) extends h.IsProper where wf (h) : WellFounded h.AncestralRel +set_option backward.isDefEq.respectTransparency.types false in instance [h.IsRegular] : h.pairing.IsRegular where wf := by have := IsRegular.wf h diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Rank.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Rank.lean index 28299b8bd37ccd..a2b0af5074e5d8 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Rank.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/Rank.lean @@ -81,6 +81,7 @@ variable {P α} [WellFoundedLT α] [P.IsProper] (f : P.WeakRankFunction α) include f +set_option backward.isDefEq.respectTransparency.types false in lemma wf_ancestralRel : WellFounded P.AncestralRel := by rw [wellFounded_iff_isEmpty_descending_chain] refine ⟨fun ⟨g, hg⟩ ↦ ?_⟩ @@ -128,6 +129,7 @@ structure WeakRankFunction where rank : h.ι → α lt {x y : h.ι} : h.AncestralRel x y → h.dim x = h.dim y → rank x < rank y +set_option backward.isDefEq.respectTransparency.types false in /-- Rank functions for `h : A.PairingCore` correspond to rank functions for `h.pairing : A.Pairing`. -/ noncomputable def rankFunctionEquiv : @@ -147,6 +149,7 @@ noncomputable def rankFunctionEquiv : left_inv _ := by simp right_inv _ := by simp +set_option backward.isDefEq.respectTransparency.types false in /-- Weak rank functions for `h : A.PairingCore` correspond to weak rank functions for `h.pairing : A.Pairing`. -/ noncomputable def weakRankFunctionEquiv : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/RelativeCellComplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/RelativeCellComplex.lean index fb29355165b900..631b2617f66bcb 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/RelativeCellComplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/AnodyneExtensions/RelativeCellComplex.lean @@ -79,6 +79,7 @@ abbrev map : Δ[c.dim + 1] ⟶ X := yonedaEquiv.symm ((P.p c.s).val.cast (P.isUniquelyCodimOneFace c.s).dim_eq).simplex +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma range_map : Subcomplex.range c.map = (P.p c.s).val.subcomplex := by @@ -91,6 +92,7 @@ lemma map_app_objEquiv_symm_δ_index : c.s.val.simplex := (P.isUniquelyCodimOneFace c.s).δ_index rfl +set_option backward.isDefEq.respectTransparency.types false in lemma subcomplex_not_le_image_horn : ¬ c.s.val.subcomplex ≤ c.horn.image c.map := by intro h simp only [Subfunctor.ofSection_le_iff, image_obj, Set.mem_image] at h @@ -379,7 +381,7 @@ noncomputable def t (j : ι) : f.sigmaHorn j ⟶ f.filtration j := variable {f} in @[reassoc (attr := simp)] lemma Cell.ι_t {j : ι} (c : f.Cell j) : c.ιSigmaHorn ≫ f.t j = c.mapHorn := by - simp [t, Sigma.ι_desc] + simp [t] variable {f} in @[reassoc (attr := simp), elementwise (attr := simp)] @@ -387,6 +389,7 @@ lemma Cell.ι_t_app {j : ι} (c : f.Cell j) (x : SimplexCategoryᵒᵖ) : c.ιSigmaHorn.app x ≫ (f.t j).app x = c.mapHorn.app x := NatTrans.congr_app c.ι_t x +set_option backward.isDefEq.respectTransparency.types false in /-- Given a rank `j` cell `c` for a rank function `f` for a proper pairing of a subcomplex of a simplicial set, this is the nondegenerate simplex in `f.sigmaStdSimplex j` @@ -406,6 +409,7 @@ noncomputable def Cell.type₁ {j : ι} (c : f.Cell j) : (Subcomplex.range (f.m obtain ⟨rfl, rfl⟩ := hy exact objEquiv_symm_notMem_horn_of_isIso _ _ hy' +set_option backward.isDefEq.respectTransparency.types false in /-- Given a rank `j` cell `c` for a rank function `f` for a proper pairing of a subcomplex of a simplicial set, this is the nondegenerate simplex in `f.sigmaStdSimplex j` @@ -457,7 +461,7 @@ noncomputable def b (j : ι) : f.sigmaStdSimplex j ⟶ f.filtration (Order.succ variable {f} in @[reassoc (attr := simp)] lemma Cell.ι_b {j : ι} (c : f.Cell j) : c.ιSigmaStdSimplex ≫ f.b j = c.mapToSucc := by - simp [b, Sigma.ι_desc] + simp [b] variable {f} in @[reassoc (attr := simp), elementwise (attr := simp)] @@ -521,6 +525,7 @@ corresponding to an element in `(Subcomplex.range (f.m j)).N`. -/ noncomputable def mapN {j : ι} (x : (Subcomplex.range (f.m j)).N) : X.S := S.mk ((f.b j).app _ x.simplex).val +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapN_type₁ {j : ι} (c : f.Cell j) : f.mapN c.type₁ = S.mk (P.p c.s).val.simplex := by dsimp only [Cell.type₁, mapN] diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean index c348e34404fd67..c4f373a953e81e 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Coskeletal.lean @@ -84,6 +84,7 @@ noncomputable def lift {X : SSet.{u}} (sx : StrictSegal X) {n} (Quiver.Hom.unop_inj (by ext x; fin_cases x; rfl)) exact ConcreteCategory.congr_hom (s.w φ) x } +set_option backward.isDefEq.respectTransparency.types false in lemma fac_aux₁ {n : ℕ} (s : Cone (proj (op ⦋n⦌) (Truncated.inclusion 2).op ⋙ (Truncated.inclusion 2).op ⋙ X)) (x : s.pt) (i : ℕ) (hi : i < n) : @@ -178,6 +179,7 @@ end isPointwiseRightKanExtensionAt open Truncated +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open isPointwiseRightKanExtensionAt in /-- A strict Segal simplicial set is 2-coskeletal. -/ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/FiniteProd.lean b/Mathlib/AlgebraicTopology/SimplicialSet/FiniteProd.lean index e536c0c9497b10..6f4a1f0fa0d3ca 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/FiniteProd.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/FiniteProd.lean @@ -27,6 +27,7 @@ namespace SSet variable {X₁ X₂ X₃ X₄ : SSet.{u}} +set_option backward.isDefEq.respectTransparency.types false in variable (X₁ X₂) in lemma iSup_subcomplexOfSimplex_prod_eq_top : ⨆ (x₁ : X₁.N) (x₂ : X₂.N), diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/HoFunctorMonoidal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/HoFunctorMonoidal.lean index c4bb0adfc057e5..54f7d1cf19b280 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/HoFunctorMonoidal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/HoFunctorMonoidal.lean @@ -139,6 +139,7 @@ lemma functor_map {x₀ x₁ : X _⦋0⦌₂} (e : Edge x₀ x₁) {y₀ y₁ : Y _⦋0⦌₂} (e' : Edge y₀ y₁) : (functor X Y).map (homMk (e.tensor e')) = (homMk e, homMk e') := rfl +set_option backward.isDefEq.respectTransparency.types false in variable (X Y) in /-- The functor `X.HomotopyCategory ⥤ Y.HomotopyCategory ⥤ (X ⊗ Y).HomotopyCategory` when `X` and `Y` are `2`-truncated simplicial sets. -/ @@ -152,28 +153,34 @@ def curriedInverse : X.HomotopyCategory ⥤ Y.HomotopyCategory ⥤ (X ⊗ Y).Hom obtain ⟨y, rfl⟩ := mk_surjective y simpa using homMk_comp_homMk (h.tensor (.idCompId y))) +set_option backward.isDefEq.respectTransparency.types false in variable (X Y) in /-- The functor `X.HomotopyCategory × Y.HomotopyCategory ⥤ (X ⊗ Y).HomotopyCategory` when `X` and `Y` are `2`-truncated simplicial sets. -/ def inverse : X.HomotopyCategory × Y.HomotopyCategory ⥤ (X ⊗ Y).HomotopyCategory := Functor.uncurry.obj (curriedInverse X Y) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inverse_obj (x : X _⦋0⦌₂) (y : Y _⦋0⦌₂) : (inverse X Y).obj (mk x, mk y) = mk (x, y) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inverse_map_mkHom_homMk_id {x₀ x₁ : X _⦋0⦌₂} (e : Edge x₀ x₁) (y : Y _⦋0⦌₂) : (inverse X Y).map (Prod.mkHom (homMk e) (𝟙 (mk y))) = homMk (e.tensor (.id y)) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inverse_map_mkHom_id_homMk (x : X _⦋0⦌₂) {y₀ y₁ : Y _⦋0⦌₂} (e : Edge y₀ y₁) : (inverse X Y).map (Prod.mkHom (𝟙 (mk x)) (homMk e)) = homMk ((Edge.id x).tensor e) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma inverse_map_mkHom_homMk_homMk {x₀ x₁ : X _⦋0⦌₂} (e : Edge x₀ x₁) {y₀ y₁ : Y _⦋0⦌₂} (e' : Edge y₀ y₁) : (inverse X Y).map (Prod.mkHom (homMk e) (homMk e')) = homMk (e.tensor e') := homMk_comp_homMk ((Edge.CompStruct.compId e).tensor (Edge.CompStruct.idComp e')) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (X Y) in /-- Auxiliary definition for `equivalence`. -/ @@ -184,14 +191,17 @@ def functorCompInverseIso : functor X Y ⋙ inverse X Y ≅ 𝟭 _ := dsimp rw [Category.comp_id, Category.id_comp, inverse_map_mkHom_homMk_homMk]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma functorCompInverseIso_hom_app (x : X _⦋0⦌₂) (y : Y _⦋0⦌₂) : (functorCompInverseIso X Y).hom.app (mk (x, y)) = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma functorCompInverseIso_inv_app (x : X _⦋0⦌₂) (y : Y _⦋0⦌₂) : (functorCompInverseIso X Y).inv.app (mk (x, y)) = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in variable (X Y) in /-- Auxiliary definition for `equivalence`. -/ def inverseCompFunctorIso : inverse X Y ⋙ functor X Y ≅ 𝟭 _ := @@ -202,22 +212,27 @@ def inverseCompFunctorIso : inverse X Y ⋙ functor X Y ≅ 𝟭 _ := obtain ⟨y, rfl⟩ := y.mk_surjective cat_disch)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inverseCompFunctorIso_hom_app (x : X _⦋0⦌₂) (y : Y _⦋0⦌₂) : (inverseCompFunctorIso X Y).hom.app (mk x, mk y) = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inverseCompFunctorIso_inv_app (x : X _⦋0⦌₂) (y : Y _⦋0⦌₂) : (inverseCompFunctorIso X Y).inv.app (mk x, mk y) = 𝟙 _ := rfl variable (X Y) +set_option backward.isDefEq.respectTransparency.types false in lemma functor_comp_inverse : functor X Y ⋙ inverse X Y = 𝟭 _ := Functor.ext_of_iso (functorCompInverseIso X Y) (fun _ ↦ rfl) +set_option backward.isDefEq.respectTransparency.types false in lemma inverse_comp_functor : inverse X Y ⋙ functor X Y = 𝟭 _ := Functor.ext_of_iso (inverseCompFunctorIso X Y) (fun _ ↦ rfl) +set_option backward.isDefEq.respectTransparency.types false in /-- The equivalence `(X ⊗ Y).HomotopyCategory ≌ X.HomotopyCategory ⥤ Y.HomotopyCategory` when `X` and `Y` are `2`-truncated simplicial sets. -/ def equivalence : @@ -227,6 +242,7 @@ def equivalence : unitIso := (functorCompInverseIso X Y).symm counitIso := inverseCompFunctorIso X Y +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism of categories between `(X ⊗ Y).HomotopyCategory` and `X.HomotopyCategory ⥤ Y.HomotopyCategory`. -/ @[simps] @@ -237,6 +253,7 @@ def iso : hom_inv_id := by ext; exact functor_comp_inverse X Y inv_hom_id := by ext; exact inverse_comp_functor X Y +set_option backward.isDefEq.respectTransparency.types false in variable {X} in /-- The naturality of `HomotopyCategory.BinaryProduct.inverse` with respect to the first variable. -/ @@ -250,6 +267,7 @@ def mapHomotopyCategoryProdIdCompInverseIso (f : X ⟶ X') : simp rfl)) +set_option backward.isDefEq.respectTransparency.types false in variable {Y} in /-- The naturality of `HomotopyCategory.BinaryProduct.inverse` with respect to the second variable. -/ @@ -263,12 +281,14 @@ def idProdMapHomotopyCategoryCompInverseIso (g : Y ⟶ Y') : simp rfl)) +set_option backward.isDefEq.respectTransparency.types false in variable {X} in lemma mapHomotopyCategory_prod_id_comp_inverse (f : X ⟶ X') : (mapHomotopyCategory f).prod (𝟭 _) ⋙ inverse X' Y = inverse X Y ⋙ mapHomotopyCategory (f ▷ Y) := Functor.ext_of_iso (mapHomotopyCategoryProdIdCompInverseIso _ _) (fun _ ↦ rfl) +set_option backward.isDefEq.respectTransparency.types false in variable {Y} in lemma id_prod_mapHomotopyCategory_comp_inverse (g : Y ⟶ Y') : Functor.prod (𝟭 _) (mapHomotopyCategory g) ⋙ inverse X Y' = @@ -290,6 +310,7 @@ def inverseCompMapHomotopyCategoryFstIso : obtain ⟨y, rfl⟩ := y.mk_surjective simp)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The compatibility of `HomotopyCategory.BinaryProduct.inverse` with respect to the second projection. -/ @@ -303,10 +324,12 @@ def inverseCompMapHomotopyCategorySndIso : simp only [Category.comp_id] exact homMk_id y)) +set_option backward.isDefEq.respectTransparency.types false in lemma inverse_comp_mapHomotopyCategory_fst : inverse X Y ⋙ mapHomotopyCategory (fst _ _) = CategoryTheory.Prod.fst _ _ := Functor.ext_of_iso (inverseCompMapHomotopyCategoryFstIso _ _) (fun _ ↦ rfl) +set_option backward.isDefEq.respectTransparency.types false in lemma inverse_comp_mapHomotopyCategory_snd : inverse X Y ⋙ mapHomotopyCategory (snd _ _) = CategoryTheory.Prod.snd _ _ := Functor.ext_of_iso (inverseCompMapHomotopyCategorySndIso _ _) (fun _ ↦ rfl) @@ -356,6 +379,7 @@ def associativity'Iso : simp only [Category.comp_id, Category.id_comp, ← prod_id', CategoryTheory.Functor.map_id, inverse_obj, inverse_map_mkHom_homMk_id])) +set_option backward.isDefEq.respectTransparency.types false in variable {X Y Z} in lemma associativity'Iso_hom_app (xyz) : (associativity'Iso X Y Z).hom.app xyz = 𝟙 _ := by @@ -363,6 +387,7 @@ lemma associativity'Iso_hom_app (xyz) : rw [Category.id_comp, Category.comp_id] rfl +set_option backward.isDefEq.respectTransparency.types false in open Functor in /-- The compatibility of `HomotopyCategory.BinaryProduct.inverse` with respect to associators. -/ @@ -386,6 +411,7 @@ lemma associativityIso_hom_app (xyz) : Category.comp_id, ← prod_id, CategoryTheory.Functor.map_id, CategoryTheory.Functor.map_id] +set_option backward.isDefEq.respectTransparency.types false in lemma associativity : (inverse X Y).prod (𝟭 _) ⋙ inverse (X ⊗ Y) Z ⋙ mapHomotopyCategory (α_ _ _ _).hom = (prod.associativity _ _ _).functor ⋙ Functor.prod (𝟭 _) (inverse Y Z) ⋙ @@ -396,6 +422,7 @@ end BinaryProduct end HomotopyCategory +set_option backward.isDefEq.respectTransparency.types false in open HomotopyCategory.BinaryProduct in instance : hoFunctor₂.{u}.Monoidal := Functor.CoreMonoidal.toMonoidal @@ -407,6 +434,7 @@ instance : hoFunctor₂.{u}.Monoidal := right_unitality X := by ext; apply right_unitality associativity _ _ _ := by ext; apply associativity } +set_option backward.isDefEq.respectTransparency.types false in /-- The homotopy category functor `hoFunctor : SSet.{u} ⥤ Cat.{u, u}` is (cartesian) monoidal. -/ instance hoFunctor.monoidal : hoFunctor.{u}.Monoidal := inferInstanceAs (truncation 2 ⋙ hoFunctor₂).Monoidal @@ -420,6 +448,7 @@ def hoFunctor.unitHomEquiv (X : SSet.{u}) : (SSet.unitHomEquiv X).trans <| (hoFunctor.obj.equiv.{u} X).symm.trans Cat.fromChosenTerminalEquiv.symm +set_option backward.isDefEq.respectTransparency.types false in theorem hoFunctor.unitHomEquiv_eq (X : SSet.{u}) (x : 𝟙_ SSet ⟶ X) : hoFunctor.unitHomEquiv X x = (Functor.LaxMonoidal.ε hoFunctor.{u}).toFunctor ⋙ (hoFunctor.map x).toFunctor := diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Basic.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Basic.lean index 281e2ca237fd8f..a4cd4c1af907e0 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Basic.lean @@ -37,6 +37,7 @@ It computes the simplicial homology of a simplicial sets with coefficients in `R`. One can recover the ordinary simplicial chain complex when `C := Ab` and `X := ℤ`. -/ +@[implicit_reducible] noncomputable def chainComplexFunctor : C ⥤ SSet.{w} ⥤ ChainComplex C ℕ := (Functor.postcompose₂.obj (AlgebraicTopology.alternatingFaceMapComplex _)).obj (sigmaConst ⋙ SimplicialObject.whiskering _ _) @@ -100,7 +101,7 @@ lemma ι_chainComplexMap_f {n : ℕ} (x : X _⦋n⦌) : Y.ιChainComplex (f.app _ x) := by dsimp [chainComplexMap, chainComplexFunctor, ιChainComplex, Sigma.map', chainComplex, chainComplexFunctor] - simp [Sigma.ι_desc] + simp /-- The colimit cofan which defines the simplicial `n`-chains `(X.chainComplex R).X n`. -/ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Nondegenerate.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Nondegenerate.lean index 73defd1e949bc6..a12d8f54895cf2 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Nondegenerate.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Homology/Nondegenerate.lean @@ -124,7 +124,6 @@ lemma ιNormalizedChainComplex_fromNormalizedChainComplex_f (x : X _⦋n⦌) : X.ιChainComplex x ≫ (PInfty).f n := by dsimp [ιNormalizedChainComplex] rw [Category.assoc, toNormalizedChainComplex_f_fromNormalizedChainComplex_f] - rfl set_option backward.isDefEq.respectTransparency false in lemma ιNormalizedChainComplex_eq_zero (x : X _⦋n⦌) (hx : x ∈ X.degenerate n) : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean b/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean index 4b83ce509510f0..0faed8d9244a19 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean @@ -64,6 +64,7 @@ lemma hom_ext (h : f.edge = g.edge) : f = g := Truncated.Edge.ext h +set_option backward.isDefEq.respectTransparency.types false in /-- The prefunctor on refl quivers `OneTruncation₂` induced by a morphism of `2`-truncated simplicial sets. -/ @[simps] @@ -122,6 +123,7 @@ def ofNerve₂ (C : Type u) [Category.{u} C] : ReflQuiv.isoOfEquiv.{u, u} OneTruncation₂.nerveEquiv (fun _ _ ↦ OneTruncation₂.nerveHomEquiv) nerveHomEquiv_id +set_option backward.isDefEq.respectTransparency.types false in lemma nerve_hom_ext {X : (SSet.Truncated 2)} {C : Type u} [Category.{u} C] {F G : X ⟶ ((truncation 2).obj (nerve C))} (h : OneTruncation₂.map F = OneTruncation₂.map G) : F = G := @@ -287,6 +289,7 @@ lemma congr_arrowMk_homMk {x₀ x₁ : V _⦋0⦌₂} (e : Edge x₀ x₁) obtain rfl : e = e' := by aesop rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma homMk_id (x : V _⦋0⦌₂) : homMk (.id x) = 𝟙 (mk x) := by @@ -357,6 +360,7 @@ variable (obj : V _⦋0⦌₂ → D) (map : ∀ {x y : V _⦋0⦌₂}, Edge x y {e₀₁ : Edge x₀ x₁} {e₁₂ : Edge x₁ x₂} {e₀₂ : Edge x₀ x₂} (_ : Edge.CompStruct e₀₁ e₁₂ e₀₂), map e₀₁ ≫ map e₁₂ = map e₀₂) +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for functors from the homotopy category. -/ def lift : V.HomotopyCategory ⥤ D := CategoryTheory.Quotient.lift _ @@ -365,9 +369,11 @@ def lift : V.HomotopyCategory ⥤ D := simp only [Functor.map_comp] convert! map_comp h <;> apply Cat.FreeRefl.lift'_map) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift_obj_mk (x : V _⦋0⦌₂) : (lift obj map map_id map_comp).obj (mk x) = obj x := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift_map_homMk {x y : V _⦋0⦌₂} (e : Edge x y) : (lift obj map map_id map_comp).map (homMk e) = map e := @@ -383,6 +389,7 @@ variable (φ : ∀ (x : V _⦋0⦌₂), F.obj (mk x) ⟶ G.obj (mk x)) (hφ : ∀ ⦃x y : V _⦋0⦌₂⦄ (e : Edge x y), F.map (homMk e) ≫ φ y = φ x ≫ G.map (homMk e) := by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Constructor for natural transformations between functors from `V.HomotopyCategory`. -/ @@ -393,6 +400,7 @@ def mkNatTrans : F ⟶ G where morphismProperty_eq_top (fun e ↦ hφ e) exact this.symm.le f (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in @[simp] @@ -407,18 +415,21 @@ variable (iso : ∀ (x : V _⦋0⦌₂), F.obj (mk x) ≅ G.obj (mk x)) (hiso : ∀ ⦃x y : V _⦋0⦌₂⦄ (e : Edge x y), F.map (homMk e) ≫ (iso y).hom = (iso x).hom ≫ G.map (homMk e) := by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Constructor for natural isomorphisms between functors from `V.HomotopyCategory`. -/ def mkNatIso : F ≅ G := NatIso.ofComponents (fun _ ↦ iso _) (fun f ↦ (mkNatTrans _ hiso).naturality f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in @[simp] lemma mkNatIso_hom_app_mk (v : V _⦋0⦌₂) : (mkNatIso iso hiso).hom.app (mk v) = (iso v).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in @[simp] @@ -427,6 +438,7 @@ lemma mkNatIso_inv_app_mk (v : V _⦋0⦌₂) : end +set_option backward.isDefEq.respectTransparency.types false in lemma functor_ext {F G : V.HomotopyCategory ⥤ D} (h₁ : ∀ (x : V _⦋0⦌₂), F.obj (mk x) = G.obj (mk x)) (h₂ : ∀ ⦃x y : V _⦋0⦌₂⦄ (e : Edge x y), @@ -445,6 +457,7 @@ instance (X : Truncated.{u} 2) [Subsingleton (X _⦋0⦌₂)] : obtain rfl := Subsingleton.elim x y rfl +set_option backward.isDefEq.respectTransparency.types false in instance subsingleton_hom (X : Truncated.{u} 2) [Unique (X _⦋0⦌₂)] [Subsingleton (X _⦋1⦌₂)] (x y : X.HomotopyCategory) : Subsingleton (x ⟶ y) := @@ -490,6 +503,7 @@ lemma mapHomotopyCategory_homMk {x y : V _⦋0⦌₂} (e : Edge x y) : end +set_option backward.isDefEq.respectTransparency.types false in /-- The functor that takes a 2-truncated simplicial set to its homotopy category. -/ def hoFunctor₂ : SSet.Truncated.{u} 2 ⥤ Cat.{u, u} where obj V := Cat.of V.HomotopyCategory @@ -541,6 +555,7 @@ instance (x y : OneTruncation₂ ((truncation 2).obj Δ[0])) : Unique (x ⟶ y) instance : Unique ((truncation.{u} 2).obj Δ[0]).HomotopyCategory := inferInstanceAs (Unique <| CategoryTheory.Quotient _) +set_option backward.isDefEq.respectTransparency.types false in instance : IsDiscrete ((truncation.{u} 2).obj Δ[0]).HomotopyCategory where subsingleton x y := inferInstanceAs (Subsingleton ((_ : CategoryTheory.Quotient _) ⟶ _)) diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/HornColimits.lean b/Mathlib/AlgebraicTopology/SimplicialSet/HornColimits.lean index 2da056980cb8ea..6c176df7bec3e9 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/HornColimits.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/HornColimits.lean @@ -153,6 +153,7 @@ noncomputable def isColimit (i : Fin (n + 1)) : variable {X : SSet.{u}} +set_option backward.isDefEq.respectTransparency.types false in lemma hom_ext' {i : Fin (n + 2)} {f g : (Λ[n + 1, i] : SSet) ⟶ X} (h : ∀ (j : Fin (n + 2)) (hj : j ≠ i), horn.ι i j hj ≫ f = horn.ι i j hj ≫ g) : f = g := by @@ -206,6 +207,7 @@ lemma δ_pred_comp {i : Fin (n + 3)} {f : ∀ (j : Fin (n + 3)) (_ : j ≠ i), ( variable {i : Fin (n + 2)} {f : ∀ (j : Fin (n + 2)) (_ : j ≠ i), (Δ[n] : SSet) ⟶ X} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open stdSimplex in /-- Auxiliary definition for `horn.IsCompatible.desc`. -/ @@ -223,6 +225,7 @@ private def multicofork (hf : horn.IsCompatible f) : homOfLE_faceSingletonComplIso_inv_eq_facePairComplIso_inv_δ_castPred_assoc _ _ hab, hf.δ_pred_comp ..]) +set_option backward.isDefEq.respectTransparency.types false in lemma exists_desc (hf : horn.IsCompatible f) : ∃ (φ : (Λ[n + 1, i] : SSet) ⟶ X), ∀ (j : Fin (n + 2)) (hj : j ≠ i), horn.ι i j hj ≫ φ = f j hj := diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean index fe44959d802f8d..fd11e08f023ea6 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean @@ -289,6 +289,7 @@ lemma isPushout : IsPushout (S.ι ▷ (T : SSet)) ((S : SSet) ◁ T.ι) (prodIso _ _ ≪≫ whiskerLeftIso _ (topIso Y)) (Iso.refl _) rfl rfl rfl rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma preimage_β_hom : (unionProd S T).preimage (β_ _ _).hom = unionProd T S := by ext n ⟨x, y⟩ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean index 7c8cdde239dcad..7462fe08488681 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Nerve.lean @@ -81,6 +81,7 @@ def nerveEquiv {C : Type u} [Category.{v} C] : ComposableArrows C 0 ≃ C where namespace nerve +set_option backward.isDefEq.respectTransparency.types false in /-- Nerves of finite non-empty ordinals are representable functors. -/ def representableBy {n : ℕ} (α : Type u) [Preorder α] (e : α ≃o Fin (n + 1)) : (nerve α).RepresentableBy ⦋n⦌ where @@ -103,6 +104,7 @@ lemma σ_obj {n : ℕ} (i : Fin (n + 1)) (x : ComposableArrows C n) (j : Fin (n lemma δ₀_eq {x : ComposableArrows C (n + 1)} : (nerve C).δ (0 : Fin (n + 2)) x = x.δ₀ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma σ₀_mk₀_eq (x : C) : (nerve C).σ (0 : Fin 1) (.mk₀ x) = .mk₁ (𝟙 x) := ComposableArrows.ext₁ rfl rfl (by simp; rfl) @@ -159,6 +161,7 @@ section attribute [local ext (iff := false)] ComposableArrows.ext₀ ComposableArrows.ext₁ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Bijection between edges in the nerve of category and morphisms in the category. -/ @[simps -isSimp] @@ -169,6 +172,7 @@ def homEquiv {x y : ComposableArrows C 0} : left_inv e := by cat_disch right_inv f := by simp +set_option backward.isDefEq.respectTransparency.types false in lemma mk₁_homEquiv_apply {x y : ComposableArrows C 0} (e : (nerve C).Edge x y) : ComposableArrows.mk₁ (homEquiv e) = ComposableArrows.mk₁ e.edge.hom := by simp [homEquiv, ComposableArrows.mk₁_eqToHom_comp, ComposableArrows.mk₁_comp_eqToHom] diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean index ec2aa812866e1f..06955c8d97cf2c 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean @@ -83,11 +83,13 @@ lemma spineEquiv_f₂_arrow_one (x : X _⦋2⦌₂) : ((hY.spineEquiv 2) (f₂ f₀ f₁ hδ₁ hδ₀ hY x)).arrow 1 = f₁ (X.map (δ₂ 0).op x) := by simp [f₂] +set_option backward.isDefEq.respectTransparency.types false in lemma hδ'₀ (x : X _⦋2⦌₂) : f₁ (X.map (δ₂ 0).op x) = Y.map (δ₂ 0).op (f₂ f₀ f₁ hδ₁ hδ₀ hY x) := by simp [← spineEquiv_f₂_arrow_one f₀ f₁ hδ₁ hδ₀ hY, StrictSegal.spineEquiv, SimplexCategory.mkOfSucc_one_eq_δ] +set_option backward.isDefEq.respectTransparency.types false in lemma hδ'₂ (x : X _⦋2⦌₂) : f₁ (X.map (δ₂ 2).op x) = Y.map (δ₂ 2).op (f₂ f₀ f₁ hδ₁ hδ₀ hY x) := by simp [← spineEquiv_f₂_arrow_zero f₀ f₁ hδ₁ hδ₀ hY, StrictSegal.spineEquiv, @@ -98,6 +100,7 @@ lemma hδ'₁ (x : X _⦋2⦌₂) : f₁ (X.map (δ₂ 1).op x) = Y.map (δ₂ 1).op (f₂ f₀ f₁ hδ₁ hδ₀ hY x) := H x (f₂ f₀ f₁ hδ₁ hδ₀ hY x) (hδ'₂ f₀ f₁ hδ₁ hδ₀ hY x) (hδ'₀ f₀ f₁ hδ₁ hδ₀ hY x) +set_option backward.isDefEq.respectTransparency.types false in include hσ in lemma hσ'₀ (x : X _⦋1⦌₂) : f₂ f₀ f₁ hδ₁ hδ₀ hY (X.map (σ₂ 0).op x) = Y.map (σ₂ 0).op (f₁ x) := by @@ -116,6 +119,7 @@ lemma hσ'₀ (x : X _⦋1⦌₂) : simp [StrictSegal.spineEquiv, SimplexCategory.mkOfSucc_one_eq_δ, ← Functor.map_comp_apply, ← op_comp] +set_option backward.isDefEq.respectTransparency.types false in include hσ in lemma hσ'₁ (x : X _⦋1⦌₂) : f₂ f₀ f₁ hδ₁ hδ₀ hY (X.map (σ₂ 1).op x) = Y.map (σ₂ 1).op (f₁ x) := by @@ -213,12 +217,14 @@ lemma descOfTruncation_map_homMk (φ : X ⟶ (truncation 2).obj (nerve C)) (descOfTruncation φ).map (homMk e) = nerve.homEquiv (e.map φ) := Category.id_comp _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma descOfTruncation_comp {X' : Truncated.{u} 2} (ψ : X ⟶ X') (φ : X' ⟶ (truncation 2).obj (nerve C)) : descOfTruncation (ψ ≫ φ) = mapHomotopyCategory ψ ⋙ descOfTruncation φ := functor_ext (fun _ ↦ by simp) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a `2`-truncated simplicial set `X` and a category `C`, this is the morphism `X ⟶ (truncation 2).obj (nerve C)` corresponding @@ -334,6 +340,7 @@ namespace nerve variable {C D : Type u} [SmallCategory C] [SmallCategory D] +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `C ⥤ D` that is reconstructed for a morphism between the `2`-truncated nerves. -/ @[simps] @@ -348,6 +355,7 @@ def functorOfNerveMap (φ : nerveFunctor₂.obj (.of C) ⟶ nerveFunctor₂.obj obtain ⟨h⟩ := (nerve.nonempty_compStruct_iff f g (f ≫ g)).2 rfl exact (nerve.homEquiv_comp (h.toTruncated.map φ)).symm +set_option backward.isDefEq.respectTransparency.types false in lemma nerveFunctor₂_map_functorOfNerveMap (φ : nerveFunctor₂.obj (.of C) ⟶ nerveFunctor₂.obj (.of D)) : nerveFunctor₂.map (functorOfNerveMap φ).toCatHom = φ := @@ -356,10 +364,12 @@ lemma nerveFunctor₂_map_functorOfNerveMap exact (nerveMap_app_mk₁ _ _).trans ((nerve.mk₁_homEquiv_apply _).trans (ComposableArrows.mk₁_hom _))) +set_option backward.isDefEq.respectTransparency.types false in lemma functorOfNerveMap_nerveFunctor₂_map (F : C ⥤ D) : functorOfNerveMap ((SSet.truncation 2).map (nerveMap F)) = F := Functor.ext (fun x ↦ by cat_disch) (fun x y f ↦ by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in /-- The `2`-truncated nerve functor is fully faithful. -/ def fullyFaithfulNerveFunctor₂ : nerveFunctor₂.{u, u}.FullyFaithful where preimage φ := (functorOfNerveMap φ).toCatHom diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean index 9a07c27f7b30ea..cbde3a6512b942 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NerveNondegenerate.lean @@ -27,6 +27,7 @@ namespace PartialOrder variable {X : Type*} [PartialOrder X] {n : ℕ} +set_option backward.isDefEq.respectTransparency.types false in lemma mem_range_nerve_σ_iff (s : (nerve X) _⦋n + 1⦌) (i : Fin (n + 1)) : s ∈ Set.range ((nerve X).σ i) ↔ s.obj i.castSucc = s.obj i.succ := by diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplexOne.lean b/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplexOne.lean index ed5e8a53a6602c..f9b37a3a15fb59 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplexOne.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplexOne.lean @@ -29,6 +29,7 @@ namespace prodStdSimplex variable {p : ℕ} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open stdSimplex in /-- This is an enumeration of the `p + 1` nondegenerate dimension-`(p + 1)` @@ -73,11 +74,13 @@ noncomputable def nonDegenerateEquiv₁ : Fin.coe_ofNat_eq_mod, Nat.zero_mod, add_zero] at this lia) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma nonDegenerateEquiv₁_fst (i : Fin (p + 1)) : dsimp% (nonDegenerateEquiv₁ i).1.1 = (stdSimplex.objEquiv (m := op ⦋p + 1⦌)).symm (SimplexCategory.σ i) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma nonDegenerateEquiv₁_snd (i : Fin (p + 1)) : dsimp% (nonDegenerateEquiv₁ i).1.2 = diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/RelativeMorphism.lean b/Mathlib/AlgebraicTopology/SimplicialSet/RelativeMorphism.lean index 5dcfb52ffb256d..228519c125ab4f 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/RelativeMorphism.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/RelativeMorphism.lean @@ -71,6 +71,7 @@ lemma map_coe {n : SimplexCategoryᵒᵖ} (a : A.obj n) : f.map.app n a = φ.app n a := map_eq_of_mem _ _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma image_le : A.image f.map ≤ B := by rintro n _ ⟨a, ha, rfl⟩ have := f.map_coe ⟨a, ha⟩ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Skeleton.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Skeleton.lean index 3a63d8d2710023..86613f559c87e8 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Skeleton.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Skeleton.lean @@ -70,6 +70,7 @@ lemma ofSimplex_le_skeleton {i : ℕ} (x : X _⦋i⦌) {n : ℕ} (hi : i < n) : Subcomplex.ofSimplex x ≤ X.skeleton n := by simpa using X.mem_skeleton x hi +set_option backward.isDefEq.respectTransparency.types false in lemma mem_skeleton_obj_iff_of_nonDegenerate {d : ℕ} (x : X.nonDegenerate d) (n : ℕ) : x.1 ∈ (X.skeleton n).obj _ ↔ d < n := by @@ -82,6 +83,7 @@ lemma mem_skeleton_obj_iff_of_nonDegenerate have : d ≤ i := SimplexCategory.len_le_of_mono f lia +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma skeleton_zero : X.skeleton 0 = ⊥ := by simp [skeleton] @@ -94,6 +96,7 @@ lemma iSup_skeleton : simp only [Subfunctor.iSup_obj, Set.mem_iUnion] exact ⟨n + 1, mem_skeleton _ _ (by lia)⟩) +set_option backward.isDefEq.respectTransparency.types false in lemma skeleton_succ (n : ℕ) : X.skeleton (n + 1) = X.skeleton n ⊔ ⨆ (x : X.nonDegenerate n), Subcomplex.ofSimplex x.1 := by @@ -132,6 +135,7 @@ section lemma skeleton_le_skeletonOfMono (n : ℕ) : Y.skeleton n ≤ skeletonOfMono i n := le_sup_right +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma skeletonOfMono_zero : skeletonOfMono i 0 = Subcomplex.range i := by @@ -144,6 +148,7 @@ lemma iSup_skeletonOfMono : intro n exact le_trans (skeleton_le_skeletonOfMono i n) (le_iSup _ n) +set_option backward.isDefEq.respectTransparency.types false in lemma mem_skeletonOfMono_obj_iff_of_nonDegenerate {d : ℕ} (x : Y.nonDegenerate d) (n : ℕ) : x.1 ∈ (skeletonOfMono i n).obj _ ↔ @@ -155,6 +160,7 @@ lemma skeletonOfMono_obj_eq_top {d n : ℕ} (h : d < n) : rw [← top_le_iff, ← Y.skeleton_obj_eq_top h] exact le_sup_right +set_option backward.isDefEq.respectTransparency.types false in lemma skeletonOfMono_succ (n : ℕ) : skeletonOfMono i (n + 1) = skeletonOfMono i n ⊔ ⨆ (x : Y.nonDegenerate n) @@ -237,6 +243,7 @@ noncomputable abbrev ιSigmaBoundary : (∂Δ[d] : SSet) ⟶ sigmaBoundary i d : of `Y` not in the range of `i`, this is the corresponding morphism `Δ[d] ⟶ Y`. -/ abbrev map : Δ[d] ⟶ Y := yonedaEquiv.symm c.simplex +set_option backward.isDefEq.respectTransparency.types false in lemma mem_skeletonOfMono_obj_iff {d' : ℕ} : c.simplex ∈ (skeletonOfMono i d').obj _ ↔ c.simplex ∈ Set.range (i.app _) ∨ d < d' := by @@ -290,7 +297,7 @@ abbrev r : (skeletonOfMono i d : SSet) ⟶ skeletonOfMono i (d + 1) := @[reassoc] lemma w : t i d ≫ r i d = l i d ≫ b i d := by ext c : 1 - simp [← cancel_mono (Subcomplex.ι _), Sigma.ι_desc_assoc] + simp [← cancel_mono (Subcomplex.ι _)] namespace Cell @@ -300,16 +307,24 @@ variable {i d} lemma ι_t_ι_eq_ι_l_b_ι (c : Cell i d) : c.ιSigmaBoundary ≫ t i d ≫ Subcomplex.ι _ = ∂Δ[d].ι ≫ c.ιSigmaStdSimplex ≫ b i d ≫ Subcomplex.ι _ := by - simp [Sigma.ι_desc_assoc] + simp @[reassoc] lemma ι_l (c : Cell i d) : c.ιSigmaBoundary ≫ l i d = ∂Δ[d].ι ≫ c.ιSigmaStdSimplex := by simp -@[reassoc (attr := simp)] +/- +Now that `Cofan.mk` and `Discrete.functor` are implicit-reducible and +`backward.isDefEq.implicitBump` is enabled, the simp lemma `colimit.ι_desc_assoc` is applicable. +Previously, we had to use `by simp [Sigma.ι_desc_assoc]`, now `by simp` suffices. +The `simp` annotation on this lemma was removed because it would be redundant now, triggering the +`simpNF` linter. +-/ +@[reassoc] lemma ι_b_ι (c : Cell i d) : c.ιSigmaStdSimplex ≫ b i d ≫ Subcomplex.ι _ = c.map := by - simp [Sigma.ι_desc_assoc] + simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma b_app_ι_app_objEquiv_symm_val (c : Cell i d) {n : SimplexCategory} (f : n ⟶ ⦋d⦌) : dsimp% ((b i d).app _ (c.ιSigmaStdSimplex.app _ (stdSimplex.objEquiv.symm f))).val = @@ -319,6 +334,7 @@ lemma b_app_ι_app_objEquiv_symm_val (c : Cell i d) {n : SimplexCategory} (f : n end Cell +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isPullback : IsPullback (t i d) (l i d) (r i d) (b i d) where w := w i d diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean index 326e1a21cf0ddb..a02bee13b8a0d2 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean @@ -608,6 +608,7 @@ lemma nonDegenerateEquiv'_iff {n d : ℕ} (x : (Δ[n] : SSet.{u}).nonDegenerate dsimp [nonDegenerateEquiv'] aesop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `x` is a nondegenerate `d`-simplex of `Δ[n]`, this is the order isomorphism between `Fin (d + 1)` and the corresponding subset of `Fin (n + 1)` of cardinality `d + 1`. -/ @@ -764,6 +765,7 @@ end Examples namespace Augmented +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor which sends `⦋n⦌` to the simplicial set `Δ[n]` equipped by the obvious augmentation towards the terminal object of the category of sets. -/ diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean index c690fffbc253ec..8d3db78f46eb3a 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean @@ -159,6 +159,7 @@ theorem spineToSimplex_arrow (i : Fin m) (f : Path X m) : X.map (tr (mkOfSucc i)).op (sx.spineToSimplex m h f) = f.arrow i := by rw [← spine_arrow, spine_spineToSimplex_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem spineToSimplex_interval (f : Path X m) (j l : ℕ) (hjl : j + l ≤ m) : X.map (tr (subinterval j l hjl)).op (sx.spineToSimplex m h f) = @@ -178,6 +179,7 @@ theorem spineToSimplex_edge (f : Path X m) (j l : ℕ) (hjl : j + l ≤ m) : end spineToSimplex +set_option backward.isDefEq.respectTransparency.types false in /-- For any `σ : X ⟶ Y` between `n + 1`-truncated `StrictSegal` simplicial sets, `spineToSimplex` commutes with `Path.map`. -/ lemma spineToSimplex_map {X Y : SSet.Truncated.{u} (n + 1)} (sx : StrictSegal X) @@ -346,6 +348,7 @@ section interval variable (f : Path X n) (j l : ℕ) (hjl : j + l ≤ n) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem spineToSimplex_interval : X.map (subinterval j l hjl).op (sx.spineToSimplex f) = @@ -364,6 +367,7 @@ theorem spineToSimplex_edge : end interval +set_option backward.isDefEq.respectTransparency.types false in /-- For any `σ : X ⟶ Y` between `StrictSegal` simplicial sets, `spineToSimplex` commutes with `Path.map`. -/ lemma spineToSimplex_map {X Y : SSet.{u}} (sx : StrictSegal X) diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/SubcomplexColimits.lean b/Mathlib/AlgebraicTopology/SimplicialSet/SubcomplexColimits.lean index 757394006e77a6..a431362cbad119 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/SubcomplexColimits.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/SubcomplexColimits.lean @@ -60,6 +60,7 @@ noncomputable def isColimit : exact (Multicofork.isColimitMapEquiv _ _).2 (Types.isColimitOfMulticoequalizerDiagram h')) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A colimit multicofork attached to a `MulticoequalizerDiagram` structure in the complete lattice of subcomplexes of a simplicial set. diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Subdivision.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Subdivision.lean index 9bfd8d64387c42..3446352d88f2f7 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Subdivision.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Subdivision.lean @@ -41,6 +41,7 @@ noncomputable def SimplexCategory.sd : SimplexCategory ⥤ SSet.{u} := namespace SSet +set_option backward.isDefEq.respectTransparency.types false in /-- The subdivision functor on simplicial sets. -/ noncomputable def sd : SSet.{u} ⥤ SSet.{u} := stdSimplex.leftKanExtension SimplexCategory.sd @@ -62,12 +63,14 @@ instance : ex.{u}.IsRightAdjoint := sdExAdjunction.isRightAdjoint namespace stdSimplex +set_option backward.isDefEq.respectTransparency.types false in /-- The natural isomorphism `stdSimplex ⋙ sd ≅ SimplexCategory.sd`. -/ noncomputable def sdIso : stdSimplex.{u} ⋙ sd ≅ SimplexCategory.sd := Presheaf.isExtensionAlongULiftYoneda _ end stdSimplex +set_option backward.isDefEq.respectTransparency.types false in instance : sd.{u}.IsLeftKanExtension stdSimplex.sdIso.inv := inferInstanceAs (Functor.IsLeftKanExtension _ (SSet.stdSimplex.leftKanExtensionUnit SimplexCategory.sd.{u})) diff --git a/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean b/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean index 67a2ba669291b6..c4adbbf61b5c9b 100644 --- a/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean +++ b/Mathlib/AlgebraicTopology/SingularHomology/Basic.lean @@ -68,6 +68,7 @@ def singularChainComplexFunctorAdjunction : (Functor.postcompose₂.obj (eval _ ((SSet.chainComplexFunctorAdjunction C n).comp (sSetTopAdj.whiskerLeft _)).ofNatIsoRight ((evaluation TopCat C).mapIso (SSet.toTopSimplex.app _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma singularChainComplexFunctorAdjunction_unit_app (R : C) : (singularChainComplexFunctorAdjunction C n).unit.app R = diff --git a/Mathlib/AlgebraicTopology/SingularSet.lean b/Mathlib/AlgebraicTopology/SingularSet.lean index f681694a1d8b48..52ac3325aa4e64 100644 --- a/Mathlib/AlgebraicTopology/SingularSet.lean +++ b/Mathlib/AlgebraicTopology/SingularSet.lean @@ -62,6 +62,7 @@ noncomputable def TopCat.toSSetObjEquiv (X : TopCat.{u}) (n : SimplexCategoryᵒ Equiv.ulift.{0}.trans (ConcreteCategory.homEquiv.trans (Homeomorph.ulift.continuousMapCongr (.refl _))) +set_option backward.isDefEq.respectTransparency.types false in /-- The *geometric realization functor* is the left Kan extension of `SimplexCategory.toTop` along the Yoneda embedding. @@ -82,16 +83,19 @@ noncomputable def sSetTopAdj : SSet.toTop.{u} ⊣ TopCat.toSSet.{u} := instance : SSet.toTop.{u}.IsLeftAdjoint := sSetTopAdj.isLeftAdjoint instance : TopCat.toSSet.{u}.IsRightAdjoint := sSetTopAdj.isRightAdjoint +set_option backward.isDefEq.respectTransparency.types false in /-- The geometric realization of the representable simplicial sets agree with the usual topological simplices. -/ noncomputable def SSet.toTopSimplex : SSet.stdSimplex.{u} ⋙ SSet.toTop ≅ SimplexCategory.toTop := Presheaf.isExtensionAlongULiftYoneda _ +set_option backward.isDefEq.respectTransparency.types false in instance : SSet.toTop.{u}.IsLeftKanExtension SSet.toTopSimplex.inv := inferInstanceAs (Functor.IsLeftKanExtension _ (SSet.stdSimplex.{u}.leftKanExtensionUnit SimplexCategory.toTop.{u})) +set_option backward.isDefEq.respectTransparency.types false in lemma sSetTopAdj_unit_app_app_down (S : SSet) (m : SimplexCategoryᵒᵖ) (a : S.obj m) : ((sSetTopAdj.unit.app S).app m a).down = SSet.toTopSimplex.inv.app _ ≫ SSet.toTop.map (SSet.yonedaEquiv.symm a) := by diff --git a/Mathlib/Analysis/Analytic/Composition.lean b/Mathlib/Analysis/Analytic/Composition.lean index 98964e5b35a1f0..9d5f1de58e8322 100644 --- a/Mathlib/Analysis/Analytic/Composition.lean +++ b/Mathlib/Analysis/Analytic/Composition.lean @@ -394,6 +394,7 @@ theorem comp_id (p : FormalMultilinearSeries 𝕜 E F) (x : E) : p.comp (id 𝕜 rw [id_apply_of_one_lt _ _ _ A, ContinuousMultilinearMap.zero_apply] · simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem id_comp (p : FormalMultilinearSeries 𝕜 E F) (v0 : Fin 0 → E) : (id 𝕜 F (p 0 v0)).comp p = p := by @@ -1093,6 +1094,7 @@ theorem length_gather (a : Composition n) (b : Composition a.length) : show (map List.sum (a.blocks.splitWrtComposition b)).length = b.blocks.length by rw [length_map, length_splitWrtComposition] +set_option backward.isDefEq.respectTransparency false in /-- An auxiliary function used in the definition of `sigmaEquivSigmaPi` below, associating to two compositions `a` of `n` and `b` of `a.length`, and an index `i` bounded by the length of `a.gather b`, the subcomposition of `a` made of those blocks belonging to the `i`-th block of diff --git a/Mathlib/Analysis/Analytic/Inverse.lean b/Mathlib/Analysis/Analytic/Inverse.lean index 50a002eae4d227..894e48da193129 100644 --- a/Mathlib/Analysis/Analytic/Inverse.lean +++ b/Mathlib/Analysis/Analytic/Inverse.lean @@ -184,6 +184,7 @@ theorem rightInv_coeff_zero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[ theorem rightInv_coeff_one (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) (x : E) : p.rightInv i x 1 = (continuousMultilinearCurryFin1 𝕜 F E).symm i.symm := by rw [rightInv] +set_option backward.isDefEq.respectTransparency false in /-- The right inverse does not depend on the zeroth coefficient of a formal multilinear series. -/ theorem rightInv_removeZero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) (x : E) : @@ -241,6 +242,7 @@ theorem comp_rightInv_aux2 (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[ simp [← Composition.ne_single_iff N, Composition.eq_single_iff_length, ne_of_gt hc] simp [applyComposition, this] +set_option backward.isDefEq.respectTransparency false in /-- The right inverse to a formal multilinear series is indeed a right inverse, provided its linear term is invertible and its constant term vanishes. -/ theorem comp_rightInv (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) (x : E) @@ -260,6 +262,7 @@ theorem comp_rightInv (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F have N : 0 < n + 2 := by simp simp [comp_rightInv_aux1 N, h, rightInv, comp_rightInv_aux2, -Set.toFinset_setOf] +set_option backward.isDefEq.respectTransparency false in theorem rightInv_coeff (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) (x : E) (n : ℕ) (hn : 2 ≤ n) : p.rightInv i x n = diff --git a/Mathlib/Analysis/Analytic/IteratedFDeriv.lean b/Mathlib/Analysis/Analytic/IteratedFDeriv.lean index 61168105022f72..f07ae7d399a1a2 100644 --- a/Mathlib/Analysis/Analytic/IteratedFDeriv.lean +++ b/Mathlib/Analysis/Analytic/IteratedFDeriv.lean @@ -130,6 +130,7 @@ lemma ContinuousMultilinearMap.iteratedFDeriv_comp_diagonal obtain ⟨y, rfl⟩ := σ.equivOfFiniteSelfEmbedding.surjective i simp [Function.Embedding.equivOfFiniteSelfEmbedding, g] +set_option backward.isDefEq.respectTransparency false in private lemma HasFPowerSeriesWithinOnBall.iteratedFDerivWithin_eq_sum_of_subset (h : HasFPowerSeriesWithinOnBall f p s x r) (h' : AnalyticOn 𝕜 f s) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) diff --git a/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean b/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean index f3f33a2615c0b3..f95b8a2e839f36 100644 --- a/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean +++ b/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean @@ -155,10 +155,12 @@ noncomputable def mapBilipschitz (f : X ≃ Y) (K₁ K₂ : ℝ≥0) (hK₁ : 0 coveringRadius_pos := mul_pos hK₂ D.coveringRadius_pos isCover_coveringRadius := D.isCover_coveringRadius.image_lipschitz_of_surjective hf₂ f.surjective +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mapBilipschitz_refl (D : DeloneSet X) (hK1 hK2 hA hL) : D.mapBilipschitz (.refl X) 1 1 hK1 hK2 hA hL = D := by ext <;> simp only [mapBilipschitz, Equiv.refl_apply, Set.image_id', div_one, one_mul] +set_option backward.isDefEq.respectTransparency false in lemma mapBilipschitz_trans {Z : Type*} [MetricSpace Z] (D : DeloneSet X) (f : X ≃ Y) (g : Y ≃ Z) (K₁f K₂f K₁g K₂g : ℝ≥0) (hf₁_pos : 0 < K₁f) (hf₂_pos : 0 < K₂f) @@ -176,6 +178,7 @@ lemma mapBilipschitz_trans {Z : Type*} [MetricSpace Z] (D : DeloneSet X) · simp only [mapBilipschitz_packingRadius, NNReal.coe_div, div_div] · simp only [mapBilipschitz_coveringRadius, NNReal.coe_mul, mul_assoc] +set_option backward.isDefEq.respectTransparency false in /-- The image of a Delone set under an isometry. This is a specialization of `DeloneSet.mapBilipschitz` where the packing and covering radii are preserved because the Lipschitz constants are both 1. -/ @@ -190,6 +193,7 @@ noncomputable def mapIsometry (f : X ≃ᵢ Y) : DeloneSet X ≃ DeloneSet Y whe left_inv D := by ext <;> simp [copy_eq] right_inv D := by ext <;> simp [copy_eq] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mapIsometry_refl (D : DeloneSet X) : D.mapIsometry (.refl X) = D := by ext <;> simp [mapIsometry, IsometryEquiv.refl, DeloneSet.copy] diff --git a/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean b/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean index 116249ba98ace2..e449db0449a718 100644 --- a/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean +++ b/Mathlib/Analysis/BoxIntegral/DivergenceTheorem.lean @@ -137,6 +137,7 @@ theorem norm_volume_sub_integral_face_upper_sub_lower_smul_le {f : (Fin (n + 1) ← I.volume_face_mul i] ac_rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `f : ℝⁿ⁺¹ → E` is differentiable on a closed rectangular box `I` with derivative `f'`, then the partial derivative `fun x ↦ f' x (Pi.single i 1)` is Henstock-Kurzweil integrable with integral diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean b/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean index e88622d3d35486..c0f2df59d30980 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Basic.lean @@ -352,6 +352,7 @@ theorem biUnion_assoc (πi : ∀ J, Prepartition J) (πi' : Box ι → ∀ J : B refine ⟨J₂, hJ₂, J₁, hJ₁, ?_⟩ rwa [π.biUnionIndex_of_mem hJ₂ hJ₁] at hJ +set_option backward.isDefEq.respectTransparency false in /-- Create a `BoxIntegral.Prepartition` from a collection of possibly empty boxes by filtering out the empty one if it exists. -/ def ofWithBot (boxes : Finset (WithBot (Box ι))) @@ -371,6 +372,7 @@ theorem mem_ofWithBot {boxes : Finset (WithBot (Box ι))} {h₁ h₂} : J ∈ (ofWithBot boxes h₁ h₂ : Prepartition I) ↔ (J : WithBot (Box ι)) ∈ boxes := mem_eraseNone +set_option backward.isDefEq.respectTransparency false in @[simp] theorem iUnion_ofWithBot (boxes : Finset (WithBot (Box ι))) (le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I) @@ -381,6 +383,7 @@ theorem iUnion_ofWithBot (boxes : Finset (WithBot (Box ι))) simp only [← Box.biUnion_coe_eq_coe, @iUnion_comm _ _ (Box ι), @iUnion_comm _ _ (@Eq _ _ _), iUnion_iUnion_eq_right] +set_option backward.isDefEq.respectTransparency false in theorem ofWithBot_le {boxes : Finset (WithBot (Box ι))} {le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I} {pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint} @@ -449,6 +452,7 @@ theorem restrict_mono {π₁ π₂ : Prepartition I} (Hle : π₁ ≤ π₂) : theorem monotone_restrict : Monotone fun π : Prepartition I => restrict π J := fun _ _ => restrict_mono +set_option backward.isDefEq.respectTransparency false in /-- Restricting to a larger box does not change the set of boxes. We cannot claim equality of prepartitions because they have different types. -/ theorem restrict_boxes_of_le (π : Prepartition I) (h : I ≤ J) : (π.restrict J).boxes = π.boxes := by diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean b/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean index 9bd1813fa24e48..b211a19341e72f 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Filter.lean @@ -365,6 +365,7 @@ protected theorem MemBaseSet.unionComplToSubordinate (hπ₁ : l.MemBaseSet I c variable {r : (ι → ℝ) → Ioi (0 : ℝ)} +set_option backward.isDefEq.respectTransparency false in protected theorem MemBaseSet.filter (hπ : l.MemBaseSet I c r π) (p : Box ι → Prop) : l.MemBaseSet I c r (π.filter p) := by classical diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index 64048745bab0a2..9fcda6a10a9744 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -178,6 +178,7 @@ theorem iUnion_split (I : Box ι) (i : ι) (x : ℝ) : (split I i x).iUnion = I theorem isPartitionSplit (I : Box ι) (i : ι) (x : ℝ) : IsPartition (split I i x) := isPartition_iff_iUnion_eq.2 <| iUnion_split I i x +set_option backward.isDefEq.respectTransparency false in theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : ℝ) (f : Box ι → M) : (∑ J ∈ (split I i x).boxes, f J) = (I.splitLower i x).elim' 0 f + (I.splitUpper i x).elim' 0 f := by diff --git a/Mathlib/Analysis/BoxIntegral/UnitPartition.lean b/Mathlib/Analysis/BoxIntegral/UnitPartition.lean index b8f218c8f6b7d6..0a516b7f12470b 100644 --- a/Mathlib/Analysis/BoxIntegral/UnitPartition.lean +++ b/Mathlib/Analysis/BoxIntegral/UnitPartition.lean @@ -243,6 +243,7 @@ def prepartition (B : Box ι) : TaggedPrepartition B where · simp_rw [dif_neg hI] exact Box.coe_subset_Icc B.exists_mem.choose_spec +set_option backward.isDefEq.respectTransparency.types false in variable {n} in @[simp] theorem mem_prepartition_iff {B I : Box ι} : diff --git a/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean b/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean index 4db5f19f1e3938..d18e56a8718c1d 100644 --- a/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean +++ b/Mathlib/Analysis/CStarAlgebra/CStarMatrix.lean @@ -387,6 +387,7 @@ lemma ofMatrix_eq_ofMatrixStarAlgEquiv [Fintype n] [SMul ℂ A] [Semiring A] [St (ofMatrix : Matrix n n A → CStarMatrix n n A) = (ofMatrixStarAlgEquiv : Matrix n n A → CStarMatrix n n A) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable (R) (A) in /-- The natural map that reindexes a matrix's rows and columns with equivalent types is an equivalence. -/ @@ -401,6 +402,7 @@ lemma reindexₗ_apply {l o : Type*} [Semiring R] [AddCommMonoid A] [Module R A] {eₘ : m ≃ l} {eₙ : n ≃ o} {M : CStarMatrix m n A} {i : l} {j : o} : reindexₗ R A eₘ eₙ M i j = Matrix.reindex eₘ eₙ M i j := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The natural map that reindexes a matrix's rows and columns with equivalent types is an equivalence. -/ def reindexₐ (R) (A) [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [Mul A] [Module R A] @@ -420,20 +422,24 @@ def reindexₐ (R) (A) [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [M rw [star_apply, star_apply] simp [Matrix.submatrix_apply] } +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma reindexₐ_apply [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [Mul A] [Star A] [Module R A] {e : m ≃ n} {M : CStarMatrix m m A} {i : n} {j : n} : reindexₐ R A e M i j = Matrix.reindex e e M i j := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma mapₗ_reindexₐ [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [Mul A] [Module R A] [Star A] [AddCommMonoid B] [Mul B] [Module R B] [Star B] {e : m ≃ n} {M : CStarMatrix m m A} (φ : A →ₗ[R] B) : reindexₐ R B e (M.mapₗ φ) = ((reindexₐ R A e M).mapₗ φ) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma reindexₐ_symm [Fintype m] [Fintype n] [Semiring R] [AddCommMonoid A] [Mul A] [Module R A] [Star A] {e : m ≃ n} : reindexₐ R A e.symm = (reindexₐ R A e).symm := by simp [reindexₐ, reindexₗ] +set_option backward.isDefEq.respectTransparency.types false in /-- Applying a non-unital ⋆-algebra homomorphism to every entry of a matrix is itself a ⋆-algebra homomorphism on matrices. -/ @[simps] @@ -455,6 +461,7 @@ theorem algebraMap_apply [Fintype n] [DecidableEq n] [CommSemiring R] [Semiring [Algebra R A] {r : R} {i j : n} : (algebraMap R (CStarMatrix n n A) r) i j = if i = j then algebraMap R A r else 0 := rfl +set_option backward.isDefEq.respectTransparency.types false in variable (n) (R) (A) in /-- The ⋆-algebra equivalence between `A` and 1×1 matrices with its entry in `A`. -/ def toOneByOne [Unique n] [Semiring R] [AddCommMonoid A] [Mul A] [Star A] [Module R A] : @@ -555,6 +562,7 @@ lemma mul_entry_mul_eq_inner_toCLM [Fintype n] [DecidableEq m] [DecidableEq n] variable [Fintype n] +set_option backward.isDefEq.respectTransparency.types false in open WithCStarModule in lemma inner_toCLM_conjTranspose_left {M : CStarMatrix m n A} {v : C⋆ᵐᵒᵈ(A, n → A)} {w : C⋆ᵐᵒᵈ(A, m → A)} : ⟪toCLM Mᴴ v, w⟫_A = ⟪v, toCLM M w⟫_A := by @@ -563,6 +571,7 @@ lemma inner_toCLM_conjTranspose_left {M : CStarMatrix m n A} {v : C⋆ᵐᵒᵈ( rw [Finset.sum_comm] simp_rw [mul_assoc] +set_option backward.isDefEq.respectTransparency.types false in lemma inner_toCLM_conjTranspose_right {M : CStarMatrix m n A} {v : C⋆ᵐᵒᵈ(A, m → A)} {w : C⋆ᵐᵒᵈ(A, n → A)} : ⟪v, toCLM Mᴴ w⟫_A = ⟪toCLM M v, w⟫_A := by apply Eq.symm @@ -634,7 +643,7 @@ private noncomputable local instance normedAddCommGroupAux : NormedAddCommGroup (CStarMatrix m n A) := .ofCore CStarMatrix.normedSpaceCore -@[implicit_reducible] +@[instance_reducible] private noncomputable def normedSpaceAux : NormedSpace ℂ (CStarMatrix m n A) := .ofCore CStarMatrix.normedSpaceCore diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index 3143700d96afb5..2c9bd708489a25 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -180,6 +180,7 @@ variable [Algebra R S] [Algebra R A] [IsScalarTower R S A] [StarModule R S] [Con variable [MetricSpace A] [IsometricContinuousFunctionalCalculus S A q] variable [CompleteSpace R] [ContinuousMap.UniqueHom R A] +set_option backward.isDefEq.respectTransparency.types false in open scoped ContinuousFunctionalCalculus in protected theorem isometric_cfc (f : C(S, R)) (halg : Isometry (algebraMap R S)) (h0 : p 0) (h : ∀ a, p a ↔ q a ∧ SpectrumRestricts a f) : @@ -257,6 +258,7 @@ lemma nnnorm_cfcₙHom (a : A) (f : C(σₙ 𝕜 a, 𝕜)₀) (ha : p a := by cf ‖cfcₙHom (show p a from ha) f‖₊ = ‖f‖₊ := Subtype.ext <| norm_cfcₙHom a f ha +set_option backward.isDefEq.respectTransparency.types false in lemma IsGreatest.norm_cfcₙ (f : 𝕜 → 𝕜) (a : A) (hf : ContinuousOn f (σₙ 𝕜 a) := by cfc_cont_tac) (hf₀ : f 0 = 0 := by cfc_zero_tac) (ha : p a := by cfc_tac) : IsGreatest ((fun x ↦ ‖f x‖) '' σₙ 𝕜 a) ‖cfcₙ f a‖ := by @@ -370,6 +372,7 @@ variable [IsScalarTower R A A] [SMulCommClass R A A] variable [MetricSpace A] [NonUnitalIsometricContinuousFunctionalCalculus S A q] variable [CompleteSpace R] [ContinuousMapZero.UniqueHom R A] +set_option backward.isDefEq.respectTransparency.types false in open scoped NonUnitalContinuousFunctionalCalculus in protected theorem isometric_cfc (f : C(S, R)) (halg : Isometry (algebraMap R S)) (h0 : p 0) (h : ∀ a, p a ↔ q a ∧ QuasispectrumRestricts a f) : diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean index ff14e3c5dd92ea..ebb0db210d5349 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean @@ -164,6 +164,7 @@ lemma cfcₙHom_eq_of_continuous_of_map_id [UniqueHom R A] (cfcₙHom ha).ext_continuousMap a φ (cfcₙHom_continuous ha) hφ₁ <| by rw [cfcₙHom_id ha, hφ₂] +set_option backward.isDefEq.respectTransparency false in theorem cfcₙHom_comp [UniqueHom R A] (f : C(σₙ R a, R)₀) (f' : C(σₙ R a, σₙ R (cfcₙHom ha f))₀) (hff' : ∀ x, f x = f' x) (g : C(σₙ R (cfcₙHom ha f), R)₀) : @@ -249,6 +250,7 @@ lemma cfcₙ_apply_of_not_map_zero {f : R → R} (a : A) (hf : ¬ f 0 = 0) : cfcₙ f a = 0 := by rw [cfcₙ_def, dif_neg (not_and_of_not_right _ (not_and_of_not_right _ hf))] +set_option backward.isDefEq.respectTransparency false in lemma cfcₙHom_eq_cfcₙ_extend {a : A} (g : R → R) (ha : p a) (f : C(σₙ R a, R)₀) : cfcₙHom ha f = cfcₙ (Function.extend Subtype.val f g) a := by have h : f = (σₙ R a).restrict (Function.extend Subtype.val f g) := by @@ -311,6 +313,7 @@ variable (R) in include ha in lemma cfcₙ_id' : cfcₙ (fun x : R ↦ x) a = a := cfcₙ_id R a +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in include ha hf hf0 in /-- The **spectral mapping theorem** for the non-unital continuous functional calculus. -/ @@ -383,6 +386,7 @@ lemma cfcₙ_add : cfcₙ (fun x ↦ f x + g x) a = cfcₙ f a + cfcₙ g a := b congr · simp [cfcₙ_apply_of_not_predicate a ha] +set_option backward.isDefEq.respectTransparency false in open Finset in lemma cfcₙ_sum {ι : Type*} (f : ι → R → R) (a : A) (s : Finset ι) (hf : ∀ i ∈ s, ContinuousOn (f i) (σₙ R a) := by cfc_cont_tac) @@ -463,6 +467,7 @@ section Comp variable [UniqueHom R A] +set_option backward.isDefEq.respectTransparency false in lemma cfcₙ_comp (g f : R → R) (a : A) (hg : ContinuousOn g (f '' σₙ R a) := by cfc_cont_tac) (hg0 : g 0 = 0 := by cfc_zero_tac) (hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) @@ -637,7 +642,7 @@ lemma cfcₙ_nonneg_iff [NonnegSpectrumClass R A] (f : R → R) (a : A) (h0 : f 0 = 0 := by cfc_zero_tac) (ha : p a := by cfc_tac) : 0 ≤ cfcₙ f a ↔ ∀ x ∈ σₙ R a, 0 ≤ f x := by rw [cfcₙ_apply .., cfcₙHom_nonneg_iff, ContinuousMapZero.le_def] - simp only [ContinuousMapZero.coe_mk, ContinuousMap.coe_mk, Set.restrict_apply, Subtype.forall] + simp only [Subtype.forall] congr! lemma StarOrderedRing.nonneg_iff_quasispectrum_nonneg [NonnegSpectrumClass R A] (a : A) @@ -680,6 +685,7 @@ lemma cfcₙHom_le_iff {a : A} (ha : p a) {f g : C(σₙ R a, R)₀} : cfcₙHom ha f ≤ cfcₙHom ha g ↔ f ≤ g := by rw [← sub_nonneg, ← map_sub, cfcₙHom_nonneg_iff, sub_nonneg] +set_option backward.isDefEq.respectTransparency false in lemma cfcₙ_le_iff (f g : R → R) (a : A) (hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac) (hg : ContinuousOn g (σₙ R a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) (hg0 : g 0 = 0 := by cfc_zero_tac) (ha : p a := by cfc_tac) : diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean index ae98b71f0e4926..b84af52809af7d 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean @@ -25,6 +25,8 @@ simply by proving: 2. `0 ≤ x ↔ IsSelfAdjoint x ∧ SpectrumRestricts Real.toNNReal x`. -/ +set_option backward.isDefEq.respectTransparency.types false + @[expose] public section open Set Topology diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean index fdb9f5146c0b56..e5ced46d0f2ef0 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean @@ -284,6 +284,7 @@ section IsTopologicalRing variable [TopologicalSpace A] [IsSemitopologicalRing A] +set_option backward.isDefEq.respectTransparency false in /-- Given a non-unital star `ℝ≥0`-algebra homomorphism `φ` from `C(X, ℝ≥0)₀` into a non-unital `ℝ`-algebra `A`, this is the unique extension of `φ` from `C(X, ℝ)₀` to `A` as a non-unital star `ℝ`-algebra homomorphism. -/ @@ -328,6 +329,7 @@ lemma continuous_realContinuousMapZeroOfNNReal (φ : C(X, ℝ≥0)₀ →⋆ₙ end IsTopologicalRing +set_option backward.isDefEq.respectTransparency false in @[simp high] lemma realContinuousMapZeroOfNNReal_apply_comp_toReal (φ : C(X, ℝ≥0)₀ →⋆ₙₐ[ℝ≥0] A) (f : C(X, ℝ≥0)₀) : @@ -351,6 +353,7 @@ end NonUnitalStarAlgHom open ContinuousMapZero +set_option backward.isDefEq.respectTransparency false in instance NNReal.instContinuousMapZero.UniqueHom [TopologicalSpace A] [IsSemitopologicalRing A] [IsScalarTower ℝ A A] [SMulCommClass ℝ A A] [T2Space A] : @@ -456,6 +459,7 @@ variable {F R S A B : Type*} {p : A → Prop} {q : B → Prop} [ContinuousMap.UniqueHom R B] [FunLike F A B] [AlgHomClass F S A B] [StarHomClass F A B] +set_option backward.isDefEq.respectTransparency false in include S in /-- Star algebra homomorphisms commute with the continuous functional calculus. -/ lemma StarAlgHomClass.map_cfc (φ : F) (f : R → R) (a : A) diff --git a/Mathlib/Analysis/CStarAlgebra/Matrix.lean b/Mathlib/Analysis/CStarAlgebra/Matrix.lean index 2dae014aca2719..c68c83ac5407d0 100644 --- a/Mathlib/Analysis/CStarAlgebra/Matrix.lean +++ b/Mathlib/Analysis/CStarAlgebra/Matrix.lean @@ -45,6 +45,10 @@ section EntrywiseSupNorm variable [RCLike 𝕜] [Fintype n] [DecidableEq n] +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Matrix + theorem entry_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.unitaryGroup n 𝕜) (i j : n) : ‖U i j‖ ≤ 1 := by -- The norm squared of an entry is at most the L2 norm of its row. @@ -135,7 +139,7 @@ lemma inner_toEuclideanCLM (A : Matrix n n ℝ) (x y : EuclideanSpace ℝ n) : /-- An auxiliary definition used only to construct the true `NormedAddCommGroup` (and `Metric`) structure provided by `Matrix.instMetricSpaceL2Op` and `Matrix.instNormedAddCommGroupL2Op`. -/ -@[implicit_reducible] +@[instance_reducible] def l2OpNormedAddCommGroupAux : NormedAddCommGroup (Matrix m n 𝕜) := @NormedAddCommGroup.induced ((Matrix m n 𝕜) ≃ₗ[𝕜] (EuclideanSpace 𝕜 n →L[𝕜] EuclideanSpace 𝕜 m)) _ _ _ _ ContinuousLinearMap.toNormedAddCommGroup.toNormedAddGroup _ _ <| @@ -143,7 +147,7 @@ def l2OpNormedAddCommGroupAux : NormedAddCommGroup (Matrix m n 𝕜) := /-- An auxiliary definition used only to construct the true `NormedRing` (and `Metric`) structure provided by `Matrix.instMetricSpaceL2Op` and `Matrix.instNormedRingL2Op`. -/ -@[implicit_reducible] +@[instance_reducible] def l2OpNormedRingAux : NormedRing (Matrix n n 𝕜) := @NormedRing.induced ((Matrix n n 𝕜) ≃⋆ₐ[𝕜] (EuclideanSpace 𝕜 n →L[𝕜] EuclideanSpace 𝕜 n)) _ _ _ _ ContinuousLinearMap.toNormedRing _ _ toEuclideanCLM.injective diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean b/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean index 3087a60b83ef44..d5dee87f586507 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Defs.lean @@ -168,7 +168,7 @@ local notation "⟪" x ", " y "⟫" => inner A x y open scoped InnerProductSpace in /-- The norm associated with a Hilbert C⋆-module. It is not registered as a norm, since a type might already have a norm defined on it. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def norm (A : Type*) {E : Type*} [Norm A] [Inner A E] : Norm E where norm x := √‖⟪x, x⟫_A‖ diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index 7457faed8f3497..c3701ee5f6ea29 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -265,6 +265,7 @@ variable [FunLike F A B] [NonUnitalAlgHomClass F ℂ A B] [StarHomClass F A B] open Unitization +set_option backward.isDefEq.respectTransparency.types false in /-- A non-unital star algebra homomorphism of complex C⋆-algebras is norm contractive. -/ lemma nnnorm_apply_le (φ : F) (a : A) : ‖φ a‖₊ ≤ ‖a‖₊ := by have h (ψ : Unitization ℂ A →⋆ₐ[ℂ] Unitization ℂ B) (x : Unitization ℂ A) : diff --git a/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean b/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean index ab6c20e1b8b863..5af4d80cd9d50c 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitary/Connected.lean @@ -214,7 +214,7 @@ lemma Unitary.norm_expUnitary_smul_argSelfAdjoint_sub_one_le (u : unitary A) lemma Unitary.continuousOn_argSelfAdjoint : ContinuousOn (argSelfAdjoint : unitary A → selfAdjoint A) (ball (1 : unitary A) 2) := by rw [Topology.IsInducing.subtypeVal.continuousOn_iff] - simp only [SetLike.coe_sort_coe, Function.comp_def, argSelfAdjoint_coe] + simp only [Function.comp_def, argSelfAdjoint_coe] rw [isOpen_ball.continuousOn_iff] intro u (hu : dist u 1 < 2) obtain ⟨ε, huε, hε2⟩ := exists_between (sq_lt_sq₀ (by positivity) (by positivity) |>.mpr hu) diff --git a/Mathlib/Analysis/CStarAlgebra/Unitary/Maps.lean b/Mathlib/Analysis/CStarAlgebra/Unitary/Maps.lean index 01160e3b901cb7..5054a58e23e5a3 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitary/Maps.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitary/Maps.lean @@ -19,6 +19,7 @@ variable {R A : Type*} [NormedRing A] [StarRing A] [CStarRing A] [Ring R] [Modul section mulLeft variable [SMulCommClass R A A] +set_option backward.isDefEq.respectTransparency false in variable (R A) in /-- Left multiplication by a unitary as a linear isometric equivalence. -/ noncomputable def mulLeft : unitary A →* A ≃ₗᵢ[R] A where diff --git a/Mathlib/Analysis/CStarAlgebra/Unitization.lean b/Mathlib/Analysis/CStarAlgebra/Unitization.lean index 64b76f2b32ed6f..523b5e64326493 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitization.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitization.lean @@ -56,6 +56,7 @@ variable [DenselyNormedField 𝕜] [NonUnitalNormedRing E] [StarRing E] [CStarRi variable [NormedSpace 𝕜 E] [IsScalarTower 𝕜 E E] [SMulCommClass 𝕜 E E] variable (E) +set_option backward.isDefEq.respectTransparency false in /-- A C⋆-algebra over a densely normed field is a regular normed algebra. -/ instance CStarRing.instRegularNormedAlgebra : RegularNormedAlgebra 𝕜 E where isometry_mul' := AddMonoidHomClass.isometry_of_norm (mul 𝕜 E) fun a => NNReal.eq_iff.mp <| diff --git a/Mathlib/Analysis/Calculus/ContDiff/Basic.lean b/Mathlib/Analysis/Calculus/ContDiff/Basic.lean index 8782686073b4aa..3ef7fc99ed110f 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/Basic.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/Basic.lean @@ -354,6 +354,7 @@ theorem ContinuousLinearEquiv.comp_contDiff_iff (e : F ≃L[𝕜] G) : ContDiff 𝕜 n (e ∘ f) ↔ ContDiff 𝕜 n f := by simp only [← contDiffOn_univ, e.comp_contDiffOn_iff] +set_option backward.isDefEq.respectTransparency false in /-- If `f` admits a Taylor series `p` in a set `s`, and `g` is affine, then `f ∘ g` admits a Taylor series in `g ⁻¹' s`, whose `k`-th term at `x` is given by `p (g x) k (g.contLinear v₁, ..., g.contLinear vₖ)` . -/ diff --git a/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean b/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean index 5b3768361c4e3e..1041cb6e9f3734 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/FaaDiBruno.lean @@ -442,6 +442,7 @@ lemma index_extendMiddle_zero (c : OrderedFinpartition n) (i : Fin c.length) : contrapose! this exact (c.extendMiddle i).emb_ne_emb_of_ne (Ne.symm this) +set_option backward.isDefEq.respectTransparency false in lemma range_emb_extendMiddle_ne_singleton_zero (c : OrderedFinpartition n) (i j : Fin c.length) : range ((c.extendMiddle i).emb j) ≠ {0} := by intro h diff --git a/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean b/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean index 516a5ea02b5dd0..4cedcd6de95acb 100644 --- a/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean +++ b/Mathlib/Analysis/Calculus/Deriv/AffineMap.lean @@ -62,12 +62,15 @@ In this section we specialize some lemmas to `AffineMap.lineMap` because this ma deduce higher-dimensional lemmas from one-dimensional versions. -/ +set_option backward.isDefEq.respectTransparency false in theorem hasStrictDerivAt_lineMap : HasStrictDerivAt (lineMap a b) (b - a) x := by simpa using (lineMap a b : 𝕜 →ᵃ[𝕜] E).hasStrictDerivAt +set_option backward.isDefEq.respectTransparency false in theorem hasDerivAt_lineMap : HasDerivAt (lineMap a b) (b - a) x := hasStrictDerivAt_lineMap.hasDerivAt +set_option backward.isDefEq.respectTransparency false in theorem hasDerivWithinAt_lineMap : HasDerivWithinAt (lineMap a b) (b - a) s x := hasDerivAt_lineMap.hasDerivWithinAt diff --git a/Mathlib/Analysis/Calculus/Deriv/Basic.lean b/Mathlib/Analysis/Calculus/Deriv/Basic.lean index 74f4ba8a3d68de..b08a55153dfe25 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Basic.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Basic.lean @@ -915,6 +915,7 @@ variable {σ σ' : RingHom 𝕜 𝕜} [RingHomIsometric σ] [RingHomInvPair σ variable (σ') +set_option backward.isDefEq.respectTransparency false in /-- If `L` is a `σ`-semilinear map, and `f` has Fréchet derivative `f'` at `x`, then `L ∘ f ∘ σ⁻¹` has Fréchet derivative `L ∘ f'` at `σ x`. -/ lemma HasDerivAt.comp_semilinear (hf : HasDerivAt f f' x) : diff --git a/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean b/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean index 2da41777d06175..f42875395bf8e2 100644 --- a/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean +++ b/Mathlib/Analysis/Calculus/Deriv/MeanValue.lean @@ -509,6 +509,7 @@ lemma antitone_of_hasDerivAt_nonpos {f f' : ℝ → ℝ} (hf : ∀ x, HasDerivAt variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +set_option backward.isDefEq.respectTransparency false in /-- Lagrange's **Mean Value Theorem**, applied to convex domains. -/ theorem domain_mvt {f : E → ℝ} {s : Set E} {x y : E} {f' : E → StrongDual ℝ E} (hf : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) : diff --git a/Mathlib/Analysis/Calculus/Deriv/Star.lean b/Mathlib/Analysis/Calculus/Deriv/Star.lean index 1d0a0f93e6b796..d59765b95981d2 100644 --- a/Mathlib/Analysis/Calculus/Deriv/Star.lean +++ b/Mathlib/Analysis/Calculus/Deriv/Star.lean @@ -34,6 +34,7 @@ section TrivialStar variable [TrivialStar 𝕜] {s : Set 𝕜} {L : Filter (𝕜 × 𝕜)} +set_option backward.isDefEq.respectTransparency.types false in protected theorem HasDerivAtFilter.star (h : HasDerivAtFilter f f' L) : HasDerivAtFilter (fun x => star (f x)) (star f') L := by simpa using h.hasFDerivAtFilter.star.hasDerivAtFilter diff --git a/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean b/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean index 73fa63240dea5c..062d20f0587a9c 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Analytic.lean @@ -721,6 +721,7 @@ private lemma _root_.Equiv.succ_embeddingFinSucc_fst_symm_apply {ι : Type*} [De simp_rw [this] simp [-Equiv.embeddingFinSucc_fst] +set_option backward.isDefEq.respectTransparency false in /-- A continuous multilinear function `f` admits a Taylor series, whose successive terms are given by `f.iteratedFDeriv n`. This is the point of the definition of `f.iteratedFDeriv`. -/ theorem hasFTaylorSeriesUpTo_iteratedFDeriv : diff --git a/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean b/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean index 97ce608ae1fb7e..ea73abd3770c48 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Symmetric.lean @@ -212,6 +212,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddComm section include s_conv hf xs hx +set_option backward.isDefEq.respectTransparency false in /-- Assume that `f` is differentiable inside a convex set `s`, and that its derivative `f'` is differentiable at a point `x`. Then, given two vectors `v` and `w` pointing inside `s`, one can Taylor-expand to order two the function `f` on the segment `[x + h v, x + h (v + w)]`, giving a @@ -391,6 +392,7 @@ theorem Convex.second_derivative_within_at_symmetric_of_mem_interior {v w : E} end +set_option backward.isDefEq.respectTransparency false in /-- If a function is differentiable inside a convex set with nonempty interior, and has a second derivative at a point of this convex set, then this second derivative is symmetric. -/ theorem Convex.second_derivative_within_at_symmetric {s : Set E} (s_conv : Convex ℝ s) @@ -460,6 +462,7 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E F : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] {s : Set E} {f : E → F} {x : E} +set_option backward.isDefEq.respectTransparency false in theorem second_derivative_symmetric_of_eventually [IsRCLikeNormedField 𝕜] {f' : E → E →L[𝕜] F} {x : E} {f'' : E →L[𝕜] E →L[𝕜] F} (hf : ∀ᶠ y in 𝓝 x, HasFDerivAt f (f' y) y) diff --git a/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean b/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean index abe0d80a50dcb9..0ece8b92e56dbf 100644 --- a/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean +++ b/Mathlib/Analysis/Calculus/FormalMultilinearSeries.lean @@ -279,6 +279,7 @@ theorem order_zero : (0 : FormalMultilinearSeries 𝕜 E F).order = 0 := by simp theorem ne_zero_of_order_ne_zero (hp : p.order ≠ 0) : p ≠ 0 := fun h => by simp [h] at hp +set_option backward.isDefEq.respectTransparency false in theorem order_eq_find [DecidablePred fun n => p n ≠ 0] (hp : ∃ n, p n ≠ 0) : p.order = Nat.find hp := by convert! Nat.sInf_def hp diff --git a/Mathlib/Analysis/Calculus/Implicit.lean b/Mathlib/Analysis/Calculus/Implicit.lean index dce376ac9d4997..dd513e5ca2d3d1 100644 --- a/Mathlib/Analysis/Calculus/Implicit.lean +++ b/Mathlib/Analysis/Calculus/Implicit.lean @@ -419,6 +419,7 @@ theorem implicitFunctionOfComplemented_apply_image (hf : HasStrictFDerivAt f f' (hf.implicitToOpenPartialHomeomorphOfComplemented f f' hf' hker).left_inv (hf.mem_implicitToOpenPartialHomeomorphOfComplemented_source hf' hker) +set_option backward.isDefEq.respectTransparency.types false in theorem to_implicitFunctionOfComplemented (hf : HasStrictFDerivAt f f' a) (hf' : f'.range = ⊤) (hker : f'.ker.ClosedComplemented) : HasStrictFDerivAt (hf.implicitFunctionOfComplemented f f' hf' hker (f a)) diff --git a/Mathlib/Analysis/Calculus/MeanValue.lean b/Mathlib/Analysis/Calculus/MeanValue.lean index fabcfd43dc9227..a8d86d4ac35c70 100644 --- a/Mathlib/Analysis/Calculus/MeanValue.lean +++ b/Mathlib/Analysis/Calculus/MeanValue.lean @@ -418,6 +418,7 @@ instance (priority := 100) : PathConnectedSpace 𝕜 := by letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 infer_instance +set_option backward.isDefEq.respectTransparency false in /-- The mean value theorem on a convex set: if the derivative of a function is bounded by `C`, then the function is `C`-Lipschitz. Version with `HasFDerivWithinAt`. -/ theorem norm_image_sub_le_of_norm_hasFDerivWithin_le diff --git a/Mathlib/Analysis/Complex/AbsMax.lean b/Mathlib/Analysis/Complex/AbsMax.lean index 91fc12726b6e26..469ed7e35a22c3 100644 --- a/Mathlib/Analysis/Complex/AbsMax.lean +++ b/Mathlib/Analysis/Complex/AbsMax.lean @@ -177,6 +177,7 @@ If we do not assume that the codomain is a strictly convex space, then we can on Finally, we generalize the theorem from a disk in `ℂ` to a closed ball in any normed space. -/ +set_option backward.isDefEq.respectTransparency.types false in /-- **Maximum modulus principle** on a closed ball: if `f : E → F` is continuous on a closed ball, is complex differentiable on the corresponding open ball, and the norm `‖f w‖` takes its maximum value on the open ball at its center, then the norm `‖f w‖` is constant on the closed ball. -/ @@ -395,6 +396,7 @@ theorem exists_mem_frontier_isMaxOn_norm [FiniteDimensional ℂ E] {f : E → F} rw [dist_comm, ← hzw] exact ball_infDist_compl_subset.trans interior_subset +set_option backward.isDefEq.respectTransparency.types false in /-- **Maximum modulus principle**: if `f : E → F` is complex differentiable on a bounded set `U` and `‖f z‖ ≤ C` for any `z ∈ frontier U`, then the same is true for any `z ∈ closure U`. -/ theorem norm_le_of_forall_mem_frontier_norm_le {f : E → F} {U : Set E} (hU : IsBounded U) diff --git a/Mathlib/Analysis/Complex/Circle.lean b/Mathlib/Analysis/Complex/Circle.lean index bd8604c8b56d59..86571cd5e4bc74 100644 --- a/Mathlib/Analysis/Complex/Circle.lean +++ b/Mathlib/Analysis/Complex/Circle.lean @@ -69,6 +69,7 @@ lemma coe_inj : (x : ℂ) = y ↔ x = y := coe_injective.eq_iff lemma norm_coe (z : Circle) : ‖(z : ℂ)‖ = 1 := mem_sphere_zero_iff_norm.1 z.2 +set_option backward.isDefEq.respectTransparency false in @[simp] lemma normSq_coe (z : Circle) : normSq z = 1 := by simp [normSq_eq_norm_sq] @[simp] lemma coe_ne_zero (z : Circle) : (z : ℂ) ≠ 0 := ne_zero_of_mem_unit_sphere z @[simp, norm_cast] lemma coe_one : ↑(1 : Circle) = (1 : ℂ) := rfl @@ -154,6 +155,7 @@ lemma exp_pi_ne_one : Circle.exp Real.pi ≠ 1 := by variable {e : AddChar ℝ Circle} +set_option backward.isDefEq.respectTransparency false in @[simp] lemma star_addChar (x : ℝ) : star ((e x) : ℂ) = e (-x) := by have h := Circle.coe_inv_eq_conj ⟨e x, ?_⟩ @@ -192,6 +194,7 @@ instance instContinuousSMul [TopologicalSpace α] [MulAction ℂ α] [Continuous ContinuousSMul Circle α := inferInstanceAs <| ContinuousSMul (Submonoid.unitSphere _) α +set_option backward.isDefEq.respectTransparency false in @[simp] protected lemma norm_smul {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℂ E] (u : Circle) (v : E) : diff --git a/Mathlib/Analysis/Complex/CoveringMap.lean b/Mathlib/Analysis/Complex/CoveringMap.lean index d4774878d8dc2a..eb4ad9b33f8917 100644 --- a/Mathlib/Analysis/Complex/CoveringMap.lean +++ b/Mathlib/Analysis/Complex/CoveringMap.lean @@ -75,6 +75,7 @@ theorem isCoveringMap_npow (n : ℕ) (hn : (n : 𝕜) ≠ 0) : (.setCongr (s := {x | x ≠ 0}) _) using 1 ext; simp [show n ≠ 0 by aesop] +set_option backward.isDefEq.respectTransparency false in /-- `(· ^ n) : 𝕜 \ {0} → 𝕜 \ {0}` is a covering map (if `n ≠ 0` in `𝕜`). -/ theorem isCoveringMap_zpow (n : ℤ) (hn : (n : 𝕜) ≠ 0) : IsCoveringMap fun x : {x : 𝕜 // x ≠ 0} ↦ (⟨x ^ n, zpow_ne_zero n x.2⟩ : {x : 𝕜 // x ≠ 0}) := by diff --git a/Mathlib/Analysis/Complex/Exponential.lean b/Mathlib/Analysis/Complex/Exponential.lean index fe589ea2143973..802d94ad005a77 100644 --- a/Mathlib/Analysis/Complex/Exponential.lean +++ b/Mathlib/Analysis/Complex/Exponential.lean @@ -89,6 +89,7 @@ namespace Complex variable (x y : ℂ) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem exp_zero : exp 0 = 1 := by rw [exp] @@ -104,6 +105,7 @@ theorem exp_zero : exp 0 = 1 := by simp only [sum_range_succ, pow_succ] simp +set_option backward.isDefEq.respectTransparency false in theorem exp_add : exp (x + y) = exp x * exp y := by have hj : ∀ j : ℕ, (∑ m ∈ range j, (x + y) ^ m / m.factorial) = ∑ i ∈ range j, ∑ k ∈ range (i + 1), x ^ k / k.factorial * diff --git a/Mathlib/Analysis/Complex/Hadamard.lean b/Mathlib/Analysis/Complex/Hadamard.lean index 1e1878d2c7da4f..edd044f8b102af 100644 --- a/Mathlib/Analysis/Complex/Hadamard.lean +++ b/Mathlib/Analysis/Complex/Hadamard.lean @@ -147,6 +147,7 @@ lemma norm_lt_sSupNormIm_eps (f : ℂ → E) (ε : ℝ) (hε : ε > 0) (z : ℂ) variable [NormedSpace ℂ E] +set_option backward.isDefEq.respectTransparency.types false in /-- When the function `f` is bounded above on a vertical strip, then so is `F`. -/ lemma F_BddAbove (f : ℂ → E) (ε : ℝ) (hε : ε > 0) (hB : BddAbove ((norm ∘ f) '' verticalClosedStrip 0 1)) : diff --git a/Mathlib/Analysis/Complex/Isometry.lean b/Mathlib/Analysis/Complex/Isometry.lean index 9be1f7b76ccabc..2752cb81615c67 100644 --- a/Mathlib/Analysis/Complex/Isometry.lean +++ b/Mathlib/Analysis/Complex/Isometry.lean @@ -43,6 +43,7 @@ open ComplexConjugate local notation "|" x "|" => Complex.abs x +set_option backward.isDefEq.respectTransparency.types false in /-- An element of the unit circle defines a `LinearIsometryEquiv` from `ℂ` to itself, by rotation. -/ def rotation : Circle →* ℂ ≃ₗᵢ[ℝ] ℂ where @@ -80,6 +81,7 @@ unit circle. -/ def rotationOf (e : ℂ ≃ₗᵢ[ℝ] ℂ) : Circle := ⟨e 1 / ‖e 1‖, by simp [Submonoid.unitSphere]⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem rotationOf_rotation (a : Circle) : rotationOf (rotation a) = a := Subtype.ext <| by simp @@ -133,6 +135,7 @@ theorem linear_isometry_complex_aux {f : ℂ ≃ₗᵢ[ℝ] ℂ} (h : f 1 = 1) : intro i fin_cases i <;> simp [h, h'] +set_option backward.isDefEq.respectTransparency false in theorem linear_isometry_complex (f : ℂ ≃ₗᵢ[ℝ] ℂ) : ∃ a : Circle, f = rotation a ∨ f = conjLIE.trans (rotation a) := by let a : Circle := ⟨f 1, by simp [Submonoid.unitSphere, f.norm_map]⟩ diff --git a/Mathlib/Analysis/Complex/JensenFormula.lean b/Mathlib/Analysis/Complex/JensenFormula.lean index 7ad87cd1cb869f..319d4bc1dac2db 100644 --- a/Mathlib/Analysis/Complex/JensenFormula.lean +++ b/Mathlib/Analysis/Complex/JensenFormula.lean @@ -267,6 +267,7 @@ lemma AnalyticOnNhd.circleAverage_log_norm_of_ne_zero {R : ℝ} {c : ℂ} {g : circleAverage (Real.log ‖g ·‖) c R = Real.log ‖g c‖ := HarmonicOnNhd.circleAverage_eq (fun x hx ↦ (h₁g x hx).harmonicAt_log_norm (h₂g x hx)) +set_option backward.isDefEq.respectTransparency.types false in /-- Reformulation of a finsum that appears in Jensen's formula and in the definition of the counting function of Value Distribution Theory, as discussed in diff --git a/Mathlib/Analysis/Complex/Norm.lean b/Mathlib/Analysis/Complex/Norm.lean index 2bdf7e6abb5b9a..5a64ca959265cb 100644 --- a/Mathlib/Analysis/Complex/Norm.lean +++ b/Mathlib/Analysis/Complex/Norm.lean @@ -338,6 +338,7 @@ theorem isCauSeq_conj (f : CauSeq ℂ (‖·‖)) : noncomputable def cauSeqConj (f : CauSeq ℂ (‖·‖)) : CauSeq ℂ (‖·‖) := ⟨_, isCauSeq_conj f⟩ +set_option backward.isDefEq.respectTransparency false in theorem lim_conj (f : CauSeq ℂ (‖·‖)) : lim (cauSeqConj f) = conj (lim f) := Complex.ext (by simp [cauSeqConj, (lim_re _).symm, cauSeqRe]) (by simp [cauSeqConj, (lim_im _).symm, cauSeqIm, (lim_neg _).symm]; rfl) diff --git a/Mathlib/Analysis/Complex/OpenMapping.lean b/Mathlib/Analysis/Complex/OpenMapping.lean index bf2e6ef5658fbf..1b5b168f78ab24 100644 --- a/Mathlib/Analysis/Complex/OpenMapping.lean +++ b/Mathlib/Analysis/Complex/OpenMapping.lean @@ -264,6 +264,7 @@ theorem isOpenQuotientMap_pow_compl_zero (n : ℕ) [NeZero n] : isOpenMap := (IsOpen.isOpenEmbedding_subtypeVal isClosed_singleton.1).isOpenMap_iff.mpr <| (isOpenQuotientMap_pow n).isOpenMap.comp isClosed_singleton.1.isOpenMap_subtype_val +set_option backward.isDefEq.respectTransparency.types false in theorem isOpenQuotientMap_zpow_compl_zero (n : ℤ) [NeZero n] : IsOpenQuotientMap fun z : {z : ℂ // z ≠ 0} ↦ (⟨z ^ n, zpow_ne_zero n z.2⟩ : {z : ℂ // z ≠ 0}) := by diff --git a/Mathlib/Analysis/Complex/Schwarz.lean b/Mathlib/Analysis/Complex/Schwarz.lean index 63c55b682bd93a..2ee5cc2a1c2219 100644 --- a/Mathlib/Analysis/Complex/Schwarz.lean +++ b/Mathlib/Analysis/Complex/Schwarz.lean @@ -132,6 +132,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] {R R₁ R₂ : ℝ} {f : E → F} {c z : E} +set_option backward.isDefEq.respectTransparency.types false in open AffineMap in /-- Let `f : E → F` be a complex analytic map sending an open ball of radius `R₁` to a closed ball of radius `R₂`. diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean index 8ff78c4ba9a762..80937009c27d53 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/FunctionsBoundedAtInfty.lean @@ -75,6 +75,7 @@ theorem IsZeroAtImInfty.isBoundedAtImInfty {α : Type*} [SeminormedAddGroup α] (hf : IsZeroAtImInfty f) : IsBoundedAtImInfty f := hf.boundedAtFilter +set_option backward.isDefEq.respectTransparency false in lemma tendsto_comap_im_ofComplex : Tendsto ofComplex (comap Complex.im atTop) atImInfty := by simp only [atImInfty, tendsto_comap_iff, Function.comp_def] diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean index 1d0e7e65be6fbf..e8bbc88531e1a7 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean @@ -109,7 +109,7 @@ theorem dist_le_dist_coe_div_sqrt (z w : ℍ) : dist z w ≤ dist (z : ℂ) w / /-- An auxiliary `MetricSpace` instance on the upper half-plane. This instance has bad projection to `TopologicalSpace`. We replace it later. -/ -@[implicit_reducible] +@[instance_reducible] def metricSpaceAux : MetricSpace ℍ where dist := dist dist_self z := by rw [dist_eq, dist_self, zero_div, arsinh_zero, mul_zero] diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean index a6464445d1c541..79bec24b761d1a 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean @@ -107,6 +107,7 @@ lemma σ_num (g h : GL (Fin 2) ℝ) (z : ℂ) : σ g (num h z) = num h (σ g z) lemma σ_denom (g h : GL (Fin 2) ℝ) (z : ℂ) : σ g (denom h z) = denom h (σ g z) := by simp [denom] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma σ_neg (g : GL (Fin 2) ℝ) : σ (-g) = σ g := by simp [σ, det_neg] @@ -211,6 +212,7 @@ lemma glPos_smul_def {g : GL (Fin 2) ℝ} (hg : 0 < g.det.val) (z : ℍ) : section GLAction variable (g : GL (Fin 2) ℝ) (z : ℍ) +set_option backward.isDefEq.respectTransparency false in theorem re_smul : (g • z).re = (num g z / denom g z).re := by change (smulAux' g z).re = _ simp +contextual [smulAux', σ, DFunLike.ite_apply, apply_ite, Complex.div_re] @@ -319,6 +321,7 @@ theorem modular_T_zpow_smul (z : ℍ) (n : ℤ) : ModularGroup.T ^ n • z = (n theorem modular_T_smul (z : ℍ) : ModularGroup.T • z = (1 : ℝ) +ᵥ z := by simpa only [zpow_one, Int.cast_one] using modular_T_zpow_smul z 1 +set_option backward.isDefEq.respectTransparency false in theorem exists_SL2_smul_eq_of_apply_zero_one_eq_zero (g : SL(2, ℝ)) (hc : g 1 0 = 0) : ∃ (u : { x : ℝ // 0 < x }) (v : ℝ), (g • · : ℍ → ℍ) = (v +ᵥ ·) ∘ (u • ·) := by obtain ⟨a, b, ha, rfl⟩ := g.fin_two_exists_eq_mk_of_apply_zero_one_eq_zero hc @@ -327,6 +330,7 @@ theorem exists_SL2_smul_eq_of_apply_zero_one_eq_zero (g : SL(2, ℝ)) (hc : g 1 suffices ↑a * z * a + b * a = b * a + a * a * z by simpa [specialLinearGroup_apply, add_mul] ring +set_option backward.isDefEq.respectTransparency false in theorem exists_SL2_smul_eq_of_apply_zero_one_ne_zero (g : SL(2, ℝ)) (hc : g 1 0 ≠ 0) : ∃ (u : { x : ℝ // 0 < x }) (v w : ℝ), (g • · : ℍ → ℍ) = @@ -483,6 +487,7 @@ theorem im_smul_eq_div_normSq : (g • z).im = z.im / Complex.normSq (denom g z) theorem denom_apply : denom g z = g 1 0 * z + g 1 1 := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma denom_S : denom S z = z := by simp [S, denom_apply] end SLModularAction diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/ProperAction.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/ProperAction.lean index aa9604b24b4f2c..bbedde98d9180b 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/ProperAction.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/ProperAction.lean @@ -32,6 +32,7 @@ theorem num_continuous : Continuous ↿num := by unfold num; fun_prop @[fun_prop] theorem denom_continuous : Continuous ↿denom := by unfold denom; fun_prop +set_option backward.isDefEq.respectTransparency.types false in lemma continuous_toSL2R : Continuous toSL2R := by apply continuous_induced_rng.mpr simp only [Function.comp_def, coe_toSL2R] diff --git a/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean b/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean index a08119f5e7bbc6..80c3901b9ab805 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/FirstMainTheorem.lean @@ -58,6 +58,7 @@ lemma characteristic_sub_characteristic_inv (h : Meromorphic f) : _ = circleAverage (log ‖f ·‖) 0 - (divisor f Set.univ).logCounting := by rw [← ValueDistribution.log_counting_zero_sub_logCounting_top] +set_option backward.isDefEq.respectTransparency.types false in /-- Helper lemma for the first part of the First Main Theorem: Away from zero, the difference between the characteristic functions of `f` and `f⁻¹` equals `log ‖meromorphicTrailingCoeffAt f 0‖`. diff --git a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean index 14f6c3a5f03b14..6c1d5ecc89d496 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean @@ -101,6 +101,7 @@ variable ## Logarithmic Counting Functions for the Poles of a Meromorphic Function -/ +set_option backward.isDefEq.respectTransparency.types false in /-- A meromorphic function has only removable singularities if and only if the logarithmic counting function for its pole divisor is asymptotically bounded. diff --git a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean index 4de3fb6b6928a1..431e895c07bd97 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean @@ -59,6 +59,7 @@ noncomputable def toClosedBall (r : ℝ) : apply restrictMonoidHom tauto +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toClosedBall_eval_within {r : ℝ} {z : E} (f : locallyFinsupp E ℤ) (ha : z ∈ closedBall 0 |r|) : @@ -66,11 +67,13 @@ lemma toClosedBall_eval_within {r : ℝ} {z : E} (f : locallyFinsupp E ℤ) unfold toClosedBall simp_all [restrict_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toClosedBall_divisor {r : ℝ} {f : ℂ → ℂ} (h : Meromorphic f) : (divisor f (closedBall 0 |r|)) = (locallyFinsuppWithin.toClosedBall r) (divisor f univ) := by simp_all [locallyFinsuppWithin.toClosedBall] +set_option backward.isDefEq.respectTransparency.types false in lemma toClosedBall_support_subset_closedBall {E : Type*} [NormedAddCommGroup E] {r : ℝ} (f : locallyFinsupp E ℤ) : (toClosedBall r f).support ⊆ closedBall 0 |r| := by @@ -124,6 +127,7 @@ Evaluation of the logarithmic counting function at zero yields zero. logCounting D 0 = 0 := by simp [logCounting] +set_option backward.isDefEq.respectTransparency.types false in /-- The logarithmic counting function of a singleton indicator is asymptotically equal to `log · - log ‖e‖`. @@ -148,6 +152,7 @@ The logarithmic counting function of a singleton indicator is asymptotically equ ### Elementary Properties of Logarithmic Counting Functions -/ +set_option backward.isDefEq.respectTransparency.types false in /-- The logarithmic counting function is even. -/ diff --git a/Mathlib/Analysis/Convex/Basic.lean b/Mathlib/Analysis/Convex/Basic.lean index 9c17d20218a071..4f437d82e01eee 100644 --- a/Mathlib/Analysis/Convex/Basic.lean +++ b/Mathlib/Analysis/Convex/Basic.lean @@ -477,10 +477,12 @@ theorem Convex.smul_mem_of_zero_mem (hs : Convex 𝕜 s) {x : E} (zero_mem : (0 {t : 𝕜} (ht : t ∈ Icc (0 : 𝕜) 1) : t • x ∈ s := by simpa using hs.add_smul_mem zero_mem (by simpa using hx) ht +set_option backward.isDefEq.respectTransparency false in theorem Convex.mapsTo_lineMap (h : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) : MapsTo (AffineMap.lineMap x y) (Icc (0 : 𝕜) 1) s := by simpa only [mapsTo_iff_image_subset, segment_eq_image_lineMap] using h.segment_subset hx hy +set_option backward.isDefEq.respectTransparency false in theorem Convex.lineMap_mem (h : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) {t : 𝕜} (ht : t ∈ Icc 0 1) : AffineMap.lineMap x y t ∈ s := h.mapsTo_lineMap hx hy ht diff --git a/Mathlib/Analysis/Convex/Between.lean b/Mathlib/Analysis/Convex/Between.lean index 644e30e935d809..a35ca6cd637a24 100644 --- a/Mathlib/Analysis/Convex/Between.lean +++ b/Mathlib/Analysis/Convex/Between.lean @@ -34,6 +34,7 @@ open AffineEquiv AffineMap Module section OrderedRing +set_option backward.isDefEq.respectTransparency false in /-- The segment of points weakly between `x` and `y`. When convexity is refactored to support abstract affine combination spaces, this will no longer need to be a separate definition from `segment`. However, lemmas involving `+ᵥ` or `-ᵥ` will still be relevant after such a @@ -350,6 +351,7 @@ theorem Sbtw.ne_right {x y z : P} (h : Sbtw R x y z) : y ≠ z := theorem Sbtw.right_ne {x y z : P} (h : Sbtw R x y z) : z ≠ y := h.2.2.symm +set_option backward.isDefEq.respectTransparency false in theorem Sbtw.mem_image_Ioo {x y z : P} (h : Sbtw R x y z) : y ∈ lineMap x z '' Set.Ioo (0 : R) 1 := by rcases h with ⟨⟨t, ht, rfl⟩, hyx, hyz⟩ @@ -378,6 +380,7 @@ theorem wbtw_self_left (x y : P) : Wbtw R x x y := theorem wbtw_self_right (x y : P) : Wbtw R x y y := right_mem_affineSegment _ _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem wbtw_self_iff {x y : P} : Wbtw R x y x ↔ y = x := by refine ⟨fun h => ?_, fun h => ?_⟩ @@ -478,6 +481,7 @@ theorem Wbtw.trans_right {w x y z : P} (h₁ : Wbtw R w x z) (h₂ : Wbtw R x y section IsTorsionFree variable [IsDomain R] [IsTorsionFree R V] {w x y z : P} {r : R} +set_option backward.isDefEq.respectTransparency false in theorem sbtw_iff_mem_image_Ioo_and_ne : Sbtw R x y z ↔ y ∈ lineMap x z '' Set.Ioo (0 : R) 1 ∧ x ≠ z := by refine ⟨fun h => ⟨h.mem_image_Ioo, h.left_ne_right⟩, fun h => ?_⟩ @@ -536,6 +540,7 @@ theorem Sbtw.not_swap_right (h : Sbtw R x y z) : ¬Wbtw R x z y := fun hs => theorem Sbtw.not_rotate (h : Sbtw R x y z) : ¬Wbtw R z x y := fun hs => h.left_ne (h.wbtw.rotate_iff.1 hs) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem wbtw_lineMap_iff : Wbtw R x (lineMap x y r) y ↔ x = y ∨ r ∈ Set.Icc (0 : R) 1 := by @@ -544,6 +549,7 @@ theorem wbtw_lineMap_iff : simp rw [or_iff_right hxy, Wbtw, affineSegment, (lineMap_injective R hxy).mem_set_image] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem sbtw_lineMap_iff : Sbtw R x (lineMap x y r) y ↔ x ≠ y ∧ r ∈ Set.Ioo (0 : R) 1 := by @@ -672,6 +678,7 @@ lemma mem_closedInterior_face_iff_wbtw {n : ℕ} (s : Simplex R P n) {p : P} {i p ∈ (s.face (Finset.card_pair h)).closedInterior ↔ Wbtw R (s.points i) p (s.points j) := by rw [s.closedInterior_face_eq_affineSegment h, Wbtw] +set_option backward.isDefEq.respectTransparency false in /-- The interior of a 1-simplex is a segment between its vertices. -/ lemma interior_eq_image_Ioo (s : Simplex R P 1) : s.interior = AffineMap.lineMap (s.points 0) (s.points 1) '' Set.Ioo (0 : R) 1 := by @@ -845,6 +852,7 @@ lemma Wbtw.of_le_of_le {x y z : R} (hxy : x ≤ y) (hyz : y ≤ z) : Wbtw R x y lemma Sbtw.of_lt_of_lt {x y z : R} (hxy : x < y) (hyz : y < z) : Sbtw R x y z := ⟨.of_le_of_le hxy.le hyz.le, hxy.ne', hyz.ne⟩ +set_option backward.isDefEq.respectTransparency false in theorem wbtw_iff_left_eq_or_right_mem_image_Ici {x y z : P} : Wbtw R x y z ↔ x = y ∨ z ∈ lineMap x y '' Set.Ici (1 : R) := by refine ⟨fun h => ?_, fun h => ?_⟩ @@ -862,6 +870,7 @@ theorem wbtw_iff_left_eq_or_right_mem_image_Ici {x y z : P} : simp only [lineMap_apply, smul_smul, vadd_vsub] rw [inv_mul_cancel₀ (one_pos.trans_le hr).ne', one_smul, vsub_vadd] +set_option backward.isDefEq.respectTransparency false in theorem Wbtw.right_mem_image_Ici_of_left_ne {x y z : P} (h : Wbtw R x y z) (hne : x ≠ y) : z ∈ lineMap x y '' Set.Ici (1 : R) := (wbtw_iff_left_eq_or_right_mem_image_Ici.1 h).resolve_left hne @@ -871,6 +880,7 @@ theorem Wbtw.right_mem_affineSpan_of_left_ne {x y z : P} (h : Wbtw R x y z) (hne rcases h.right_mem_image_Ici_of_left_ne hne with ⟨r, ⟨-, rfl⟩⟩ exact lineMap_mem_affineSpan_pair _ _ _ +set_option backward.isDefEq.respectTransparency false in theorem sbtw_iff_left_ne_and_right_mem_image_Ioi {x y z : P} : Sbtw R x y z ↔ x ≠ y ∧ z ∈ lineMap x y '' Set.Ioi (1 : R) := by refine ⟨fun h => ⟨h.left_ne, ?_⟩, fun h => ?_⟩ @@ -890,6 +900,7 @@ theorem sbtw_iff_left_ne_and_right_mem_image_Ioi {x y z : P} : rw [← sub_smul, smul_ne_zero_iff, vsub_ne_zero, sub_ne_zero] exact ⟨hr.ne, hne.symm⟩ +set_option backward.isDefEq.respectTransparency false in theorem Sbtw.right_mem_image_Ioi {x y z : P} (h : Sbtw R x y z) : z ∈ lineMap x y '' Set.Ioi (1 : R) := (sbtw_iff_left_ne_and_right_mem_image_Ioi.1 h).2 @@ -897,10 +908,12 @@ theorem Sbtw.right_mem_image_Ioi {x y z : P} (h : Sbtw R x y z) : theorem Sbtw.right_mem_affineSpan {x y z : P} (h : Sbtw R x y z) : z ∈ line[R, x, y] := h.wbtw.right_mem_affineSpan_of_left_ne h.left_ne +set_option backward.isDefEq.respectTransparency false in theorem wbtw_iff_right_eq_or_left_mem_image_Ici {x y z : P} : Wbtw R x y z ↔ z = y ∨ x ∈ lineMap z y '' Set.Ici (1 : R) := by rw [wbtw_comm, wbtw_iff_left_eq_or_right_mem_image_Ici] +set_option backward.isDefEq.respectTransparency false in theorem Wbtw.left_mem_image_Ici_of_right_ne {x y z : P} (h : Wbtw R x y z) (hne : z ≠ y) : x ∈ lineMap z y '' Set.Ici (1 : R) := h.symm.right_mem_image_Ici_of_left_ne hne @@ -909,10 +922,12 @@ theorem Wbtw.left_mem_affineSpan_of_right_ne {x y z : P} (h : Wbtw R x y z) (hne x ∈ line[R, z, y] := h.symm.right_mem_affineSpan_of_left_ne hne +set_option backward.isDefEq.respectTransparency false in theorem sbtw_iff_right_ne_and_left_mem_image_Ioi {x y z : P} : Sbtw R x y z ↔ z ≠ y ∧ x ∈ lineMap z y '' Set.Ioi (1 : R) := by rw [sbtw_comm, sbtw_iff_left_ne_and_right_mem_image_Ioi] +set_option backward.isDefEq.respectTransparency false in theorem Sbtw.left_mem_image_Ioi {x y z : P} (h : Sbtw R x y z) : x ∈ lineMap z y '' Set.Ioi (1 : R) := h.symm.right_mem_image_Ioi diff --git a/Mathlib/Analysis/Convex/BetweenList.lean b/Mathlib/Analysis/Convex/BetweenList.lean index abe92b3744fc36..f242c3f1caa1a8 100644 --- a/Mathlib/Analysis/Convex/BetweenList.lean +++ b/Mathlib/Analysis/Convex/BetweenList.lean @@ -198,6 +198,7 @@ lemma SortedLE.wbtw {l : List R} (h : l.SortedLE) : l.Wbtw R := by lemma SortedLT.sbtw {l : List R} (h : l.SortedLT) : l.Sbtw R := ⟨h.sortedLE.wbtw, h.nodup⟩ +set_option backward.isDefEq.respectTransparency false in lemma exists_map_eq_of_sorted_nonempty_iff_wbtw {l : List P} (hl : l ≠ []) : (∃ l' : List R, l'.SortedLE ∧ l'.map (lineMap (l.head hl) (l.getLast hl)) = l) ↔ l.Wbtw R := by @@ -247,6 +248,7 @@ lemma exists_map_eq_of_sorted_nonempty_iff_wbtw {l : List P} (hl : l ≠ []) : ring_nf simp +set_option backward.isDefEq.respectTransparency false in lemma exists_map_eq_of_sorted_iff_wbtw {l : List P} : (∃ p₁ p₂ : P, ∃ l' : List R, l'.SortedLE ∧ l'.map (lineMap p₁ p₂) = l) ↔ l.Wbtw R := by refine ⟨fun ⟨p₁, p₂, l', hl's, hl'l⟩ ↦ ?_, fun h ↦ ?_⟩ @@ -257,6 +259,7 @@ lemma exists_map_eq_of_sorted_iff_wbtw {l : List P} : simp [hl, sortedLE_iff_pairwise]⟩ · exact ⟨l.head hl, l.getLast hl, (exists_map_eq_of_sorted_nonempty_iff_wbtw hl).2 h⟩ +set_option backward.isDefEq.respectTransparency false in lemma exists_map_eq_of_sorted_nonempty_iff_sbtw {l : List P} (hl : l ≠ []) : (∃ l' : List R, l'.SortedLT ∧ l'.map (lineMap (l.head hl) (l.getLast hl)) = l ∧ (l.length = 1 ∨ l.head hl ≠ l.getLast hl)) ↔ l.Sbtw R := by @@ -286,6 +289,7 @@ lemma exists_map_eq_of_sorted_nonempty_iff_sbtw {l : List P} (hl : l ≠ []) : refine hp.1 ((head :: head2 :: tail).getLast hl) ?_ simp +set_option backward.isDefEq.respectTransparency false in lemma exists_map_eq_of_sorted_iff_sbtw [Nontrivial P] {l : List P} : (∃ p₁ p₂ : P, p₁ ≠ p₂ ∧ ∃ l' : List R, l'.SortedLT ∧ l'.map (lineMap p₁ p₂) = l) ↔ l.Sbtw R := by diff --git a/Mathlib/Analysis/Convex/Birkhoff.lean b/Mathlib/Analysis/Convex/Birkhoff.lean index 2083948fd5b2da..27be3693d2b196 100644 --- a/Mathlib/Analysis/Convex/Birkhoff.lean +++ b/Mathlib/Analysis/Convex/Birkhoff.lean @@ -44,6 +44,7 @@ section LinearOrderedSemifield variable [Semifield R] [LinearOrder R] [IsStrictOrderedRing R] {M : Matrix n n R} +set_option backward.isDefEq.respectTransparency.types false in /-- If M is a positive scalar multiple of a doubly stochastic matrix, then there is a permutation matrix whose support is contained in the support of M. diff --git a/Mathlib/Analysis/Convex/Cone/Extension.lean b/Mathlib/Analysis/Convex/Cone/Extension.lean index 544b4f61a6a70c..d3f5b57cf66637 100644 --- a/Mathlib/Analysis/Convex/Cone/Extension.lean +++ b/Mathlib/Analysis/Convex/Cone/Extension.lean @@ -152,6 +152,7 @@ theorem riesz_extension (s : ConvexCone ℝ E) (f : E →ₗ.[ℝ] ℝ) · exact fun x => (hfg rfl).symm · exact fun x hx => hgs ⟨x, _⟩ hx +set_option backward.isDefEq.respectTransparency false in /-- **Hahn-Banach theorem**: if `N : E → ℝ` is a sublinear map, `f` is a linear map defined on a subspace of `E`, and `f x ≤ N x` for all `x` in the domain of `f`, then `f` can be extended to the whole space to a linear map `g` such that `g x ≤ N x` diff --git a/Mathlib/Analysis/Convex/Cone/TensorProduct.lean b/Mathlib/Analysis/Convex/Cone/TensorProduct.lean index 635db471ec4b07..b0ff9da1e1b5d2 100644 --- a/Mathlib/Analysis/Convex/Cone/TensorProduct.lean +++ b/Mathlib/Analysis/Convex/Cone/TensorProduct.lean @@ -81,6 +81,7 @@ variable [FiniteDimensional ℝ F] [ContinuousSMul ℝ F] [LocallyConvexSpace open TensorProduct Module +set_option backward.isDefEq.respectTransparency false in /-- If `C₁` is a simplicial and generating cone and `C₂` is a proper cone, then their minimal and maximal tensor products are equal. -/ theorem minTensorProduct_eq_max_of_simplicial_generating_left (C₁ : PointedCone ℝ E) diff --git a/Mathlib/Analysis/Convex/Hull.lean b/Mathlib/Analysis/Convex/Hull.lean index 66a31621354ef4..9628e95157be99 100644 --- a/Mathlib/Analysis/Convex/Hull.lean +++ b/Mathlib/Analysis/Convex/Hull.lean @@ -52,6 +52,7 @@ theorem subset_convexHull : s ⊆ convexHull 𝕜 s := theorem convex_convexHull : Convex 𝕜 (convexHull 𝕜 s) := (convexHull 𝕜).isClosed_closure s +set_option backward.isDefEq.respectTransparency false in theorem convexHull_eq_iInter : convexHull 𝕜 s = ⋂ (t : Set E) (_ : s ⊆ t) (_ : Convex 𝕜 t), t := by simp [convexHull, iInter_subtype, iInter_and] diff --git a/Mathlib/Analysis/Convex/Independent.lean b/Mathlib/Analysis/Convex/Independent.lean index c7b9a8a152a995..1fa885bf71479d 100644 --- a/Mathlib/Analysis/Convex/Independent.lean +++ b/Mathlib/Analysis/Convex/Independent.lean @@ -87,6 +87,7 @@ protected theorem ConvexIndependent.subtype {p : ι → E} (hc : ConvexIndepende ConvexIndependent 𝕜 fun i : s => p i := hc.comp_embedding (Embedding.subtype _) +set_option backward.isDefEq.respectTransparency false in /-- If an indexed family of points is convex independent, so is the corresponding set of points. -/ protected theorem ConvexIndependent.range {p : ι → E} (hc : ConvexIndependent 𝕜 p) : ConvexIndependent 𝕜 ((↑) : Set.range p → E) := by diff --git a/Mathlib/Analysis/Convex/Intrinsic.lean b/Mathlib/Analysis/Convex/Intrinsic.lean index 14f5aa3e67192c..f225c22f299012 100644 --- a/Mathlib/Analysis/Convex/Intrinsic.lean +++ b/Mathlib/Analysis/Convex/Intrinsic.lean @@ -203,6 +203,8 @@ theorem intrinsicClosure_idem (s : Set P) : rw [intrinsicClosure, preimage_image_eq _ Subtype.coe_injective] exact isClosed_closure +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in theorem intrinsicClosure_eq_closure_inter_affineSpan (s : Set P) : intrinsicClosure 𝕜 s = closure s ∩ affineSpan 𝕜 s := by have h : Topology.IsInducing ((↑) : affineSpan 𝕜 s → P) := .subtypeVal diff --git a/Mathlib/Analysis/Convex/NNReal.lean b/Mathlib/Analysis/Convex/NNReal.lean index 269ce781e9c774..47a6a01e75b3fd 100644 --- a/Mathlib/Analysis/Convex/NNReal.lean +++ b/Mathlib/Analysis/Convex/NNReal.lean @@ -35,6 +35,7 @@ protected lemma segment_eq_uIcc {x y : ℝ≥0} : segment ℝ≥0 x y = uIcc x y := Nonneg.segment_eq_uIcc +set_option backward.isDefEq.respectTransparency false in protected lemma convex_iff {M : Type*} [AddCommMonoid M] [Module ℝ M] {s : Set M} : Convex ℝ≥0 s ↔ Convex ℝ s := by refine ⟨fun H ↦ ?_, Convex.lift ℝ≥0⟩ diff --git a/Mathlib/Analysis/Convex/PathConnected.lean b/Mathlib/Analysis/Convex/PathConnected.lean index 2daa2c26a7bec5..37d3f9f8c4bdbc 100644 --- a/Mathlib/Analysis/Convex/PathConnected.lean +++ b/Mathlib/Analysis/Convex/PathConnected.lean @@ -30,6 +30,7 @@ variable {E : Type*} [AddCommGroup E] [Module ℝ E] namespace Path +set_option backward.isDefEq.respectTransparency false in /-- The path from `a` to `b` going along a straight line segment -/ @[simps] protected def segment (a b : E) : Path a b where @@ -61,6 +62,7 @@ theorem cast_segment {a b c d : E} (hac : c = a) (hbd : d = b) : (Path.segment a b).cast hac hbd = .segment c d := by subst_vars; rfl +set_option backward.isDefEq.respectTransparency false in theorem eqOn_extend_segment (a b : E) : EqOn (Path.segment a b).extend (AffineMap.lineMap a b) I := by intro t ht @@ -119,12 +121,14 @@ theorem isPathConnected_compl_of_isPathConnected_compl_zero {p q : Submodule ℝ section Real +set_option backward.isDefEq.respectTransparency.types false in theorem segment_image_Ico {x y : ℝ} (h : x < y) : (Path.segment x y) '' Ico 0 1 = Ico x y := by simp_rw [Path.segment_apply, ← image_image _ Subtype.val (Ico 0 1)] simp only [lineMap_apply, vsub_eq_sub, smul_eq_mul, vadd_eq_add, image_subtype_val_Ico, Icc.coe_zero, Icc.coe_one] convert! image_affine_Ico (sub_pos_of_lt h) x 0 1 using 2 <;> ring +set_option backward.isDefEq.respectTransparency.types false in theorem segment_image_Ioc {x y : ℝ} (h : x < y) : (Path.segment x y) '' Ioc 0 1 = Ioc x y := by simp_rw [Path.segment_apply, ← image_image _ Subtype.val (Ioc 0 1)] simp only [lineMap_apply, vsub_eq_sub, smul_eq_mul, vadd_eq_add, image_subtype_val_Ioc, diff --git a/Mathlib/Analysis/Convex/Segment.lean b/Mathlib/Analysis/Convex/Segment.lean index 55af8816d0d3cd..ccfa6dd44c591b 100644 --- a/Mathlib/Analysis/Convex/Segment.lean +++ b/Mathlib/Analysis/Convex/Segment.lean @@ -216,20 +216,24 @@ theorem openSegment_eq_image' (x y : E) : simp only [smul_sub, sub_smul, one_smul] abel +set_option backward.isDefEq.respectTransparency false in theorem segment_eq_image_lineMap (x y : E) : [x -[𝕜] y] = AffineMap.lineMap x y '' Icc (0 : 𝕜) 1 := by convert! segment_eq_image 𝕜 x y using 2 exact AffineMap.lineMap_apply_module _ _ _ +set_option backward.isDefEq.respectTransparency false in theorem openSegment_eq_image_lineMap (x y : E) : openSegment 𝕜 x y = AffineMap.lineMap x y '' Ioo (0 : 𝕜) 1 := by convert! openSegment_eq_image 𝕜 x y using 2 exact AffineMap.lineMap_apply_module _ _ _ +set_option backward.isDefEq.respectTransparency false in theorem lineMap_mem_openSegment (a b : E) {t : 𝕜} (ht : t ∈ Ioo 0 1) : AffineMap.lineMap a b t ∈ openSegment 𝕜 a b := openSegment_eq_image_lineMap 𝕜 a b ▸ mem_image_of_mem _ ht +set_option backward.isDefEq.respectTransparency.types false in theorem lineMap_mem_segment (a b : E) {t : 𝕜} (ht : t ∈ Icc 0 1) : AffineMap.lineMap a b t ∈ [a -[𝕜] b] := segment_eq_image_lineMap 𝕜 a b ▸ mem_image_of_mem _ ht @@ -417,6 +421,7 @@ theorem mem_segment_iff_sameRay : x ∈ [y -[𝕜] z] ↔ SameRay 𝕜 (x - y) ( open AffineMap +set_option backward.isDefEq.respectTransparency false in /-- If `z = lineMap x y c` is a point on the line passing through `x` and `y`, then the open segment `openSegment 𝕜 x y` is included in the union of the open segments `openSegment 𝕜 x z`, `openSegment 𝕜 z y`, and the point `z`. Informally, `(x, y) ⊆ {z} ∪ (x, z) ∪ (z, y)`. -/ diff --git a/Mathlib/Analysis/Convex/Side.lean b/Mathlib/Analysis/Convex/Side.lean index 000cf596517e4f..1a5bb19f5d073b 100644 --- a/Mathlib/Analysis/Convex/Side.lean +++ b/Mathlib/Analysis/Convex/Side.lean @@ -286,10 +286,12 @@ theorem wSameSide_smul_vsub_vadd_right {s : AffineSubspace R P} {p₁ p₂ : P} (hp₂ : p₂ ∈ s) {t : R} (ht : 0 ≤ t) : s.WSameSide x (t • (x -ᵥ p₁) +ᵥ p₂) := (wSameSide_smul_vsub_vadd_left x hp₁ hp₂ ht).symm +set_option backward.isDefEq.respectTransparency false in theorem wSameSide_lineMap_left {s : AffineSubspace R P} {x : P} (y : P) (h : x ∈ s) {t : R} (ht : 0 ≤ t) : s.WSameSide (lineMap x y t) y := wSameSide_smul_vsub_vadd_left y h h ht +set_option backward.isDefEq.respectTransparency false in theorem wSameSide_lineMap_right {s : AffineSubspace R P} {x : P} (y : P) (h : x ∈ s) {t : R} (ht : 0 ≤ t) : s.WSameSide y (lineMap x y t) := (wSameSide_lineMap_left y h ht).symm @@ -304,10 +306,12 @@ theorem wOppSide_smul_vsub_vadd_right {s : AffineSubspace R P} {p₁ p₂ : P} ( (hp₂ : p₂ ∈ s) {t : R} (ht : t ≤ 0) : s.WOppSide x (t • (x -ᵥ p₁) +ᵥ p₂) := (wOppSide_smul_vsub_vadd_left x hp₁ hp₂ ht).symm +set_option backward.isDefEq.respectTransparency false in theorem wOppSide_lineMap_left {s : AffineSubspace R P} {x : P} (y : P) (h : x ∈ s) {t : R} (ht : t ≤ 0) : s.WOppSide (lineMap x y t) y := wOppSide_smul_vsub_vadd_left y h h ht +set_option backward.isDefEq.respectTransparency false in theorem wOppSide_lineMap_right {s : AffineSubspace R P} {x : P} (y : P) (h : x ∈ s) {t : R} (ht : t ≤ 0) : s.WOppSide y (lineMap x y t) := (wOppSide_lineMap_left y h ht).symm @@ -571,6 +575,7 @@ theorem SOppSide.not_sSameSide {s : AffineSubspace R P} {x y : P} (h : s.SOppSid ¬s.SSameSide x y := fun hs => h.not_wSameSide hs.1 +set_option backward.isDefEq.respectTransparency false in theorem wOppSide_iff_exists_wbtw {s : AffineSubspace R P} {x y : P} : s.WOppSide x y ↔ ∃ p ∈ s, Wbtw R x p y := by refine ⟨fun h => ?_, fun ⟨p, hp, h⟩ => h.wOppSide₁₃ hp⟩ @@ -625,10 +630,12 @@ theorem sSameSide_smul_vsub_vadd_right {s : AffineSubspace R P} {x p₁ p₂ : P (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) {t : R} (ht : 0 < t) : s.SSameSide x (t • (x -ᵥ p₁) +ᵥ p₂) := (sSameSide_smul_vsub_vadd_left hx hp₁ hp₂ ht).symm +set_option backward.isDefEq.respectTransparency false in theorem sSameSide_lineMap_left {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) {t : R} (ht : 0 < t) : s.SSameSide (lineMap x y t) y := sSameSide_smul_vsub_vadd_left hy hx hx ht +set_option backward.isDefEq.respectTransparency false in theorem sSameSide_lineMap_right {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) {t : R} (ht : 0 < t) : s.SSameSide y (lineMap x y t) := (sSameSide_lineMap_left hx hy ht).symm @@ -643,10 +650,12 @@ theorem sOppSide_smul_vsub_vadd_right {s : AffineSubspace R P} {x p₁ p₂ : P} (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) {t : R} (ht : t < 0) : s.SOppSide x (t • (x -ᵥ p₁) +ᵥ p₂) := (sOppSide_smul_vsub_vadd_left hx hp₁ hp₂ ht).symm +set_option backward.isDefEq.respectTransparency false in theorem sOppSide_lineMap_left {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) {t : R} (ht : t < 0) : s.SOppSide (lineMap x y t) y := sOppSide_smul_vsub_vadd_left hy hx hx ht +set_option backward.isDefEq.respectTransparency false in theorem sOppSide_lineMap_right {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) {t : R} (ht : t < 0) : s.SOppSide y (lineMap x y t) := (sOppSide_lineMap_left hx hy ht).symm @@ -830,6 +839,7 @@ open AffineSubspace variable [Field R] [LinearOrder R] [IsStrictOrderedRing R] [AddCommGroup V] [Module R V] variable [AddTorsor V P] {n : ℕ} [NeZero n] (s : Simplex R P n) +set_option backward.isDefEq.respectTransparency false in lemma sSameSide_affineSpan_faceOpposite_of_sign_eq {w₁ w₂ : Fin (n + 1) → R} (hw₁ : ∑ j, w₁ j = 1) (hw₂ : ∑ j, w₂ j = 1) {i : Fin (n + 1)} (hs : SignType.sign (w₁ i) = SignType.sign (w₂ i)) (h0 : w₁ i ≠ 0) : @@ -860,6 +870,7 @@ lemma sSameSide_affineSpan_faceOpposite_of_sign_eq {w₁ w₂ : Fin (n + 1) → · rw [sign_pos h, eq_comm, sign_eq_one_iff] at hs positivity +set_option backward.isDefEq.respectTransparency false in lemma sOppSide_affineSpan_faceOpposite_of_pos_of_neg {w₁ w₂ : Fin (n + 1) → R} (hw₁ : ∑ j, w₁ j = 1) (hw₂ : ∑ j, w₂ j = 1) {i : Fin (n + 1)} (hs₁ : 0 < w₁ i) (hs₂ : w₂ i < 0) : diff --git a/Mathlib/Analysis/Convex/StrictConvexBetween.lean b/Mathlib/Analysis/Convex/StrictConvexBetween.lean index 139a6b8534b7ef..43ca1ad16da523 100644 --- a/Mathlib/Analysis/Convex/StrictConvexBetween.lean +++ b/Mathlib/Analysis/Convex/StrictConvexBetween.lean @@ -111,6 +111,7 @@ variable {E F PE PF : Type*} [NormedAddCommGroup E] [NormedAddCommGroup F] [Norm [NormedSpace ℝ F] [StrictConvexSpace ℝ E] [MetricSpace PE] [MetricSpace PF] [NormedAddTorsor E PE] [NormedAddTorsor F PF] {r : ℝ} {f : PF → PE} {x y z : PE} +set_option backward.isDefEq.respectTransparency false in lemma eq_lineMap_of_dist_eq_mul_of_dist_eq_mul (hxy : dist x y = r * dist x z) (hyz : dist y z = (1 - r) * dist x z) : y = AffineMap.lineMap x z r := by have : y -ᵥ x ∈ [(0 : E) -[ℝ] z -ᵥ x] := by diff --git a/Mathlib/Analysis/Convex/Topology.lean b/Mathlib/Analysis/Convex/Topology.lean index ae0c4095b9aa36..1373d58464e199 100644 --- a/Mathlib/Analysis/Convex/Topology.lean +++ b/Mathlib/Analysis/Convex/Topology.lean @@ -212,6 +212,7 @@ variable [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] open AffineMap +set_option backward.isDefEq.respectTransparency false in /-- A convex set `s` is strictly convex provided that for any two distinct points of `s \ interior s`, the line passing through these points has nonempty intersection with `interior s`. -/ @@ -494,6 +495,7 @@ variable {𝕜 V P : Type*} [Module 𝕜 V] [ContinuousSMul 𝕜 V] [AddTorsor V P] [TopologicalSpace P] [IsTopologicalAddTorsor P] +set_option backward.isDefEq.respectTransparency false in /-- The closed interior of a simplex is compact. -/ theorem isCompact_closedInterior {n : ℕ} (s : Simplex 𝕜 P n) : IsCompact s.closedInterior := by suffices IsCompact ((AffineEquiv.vaddConst 𝕜 (s.points 0)).symm.toAffineMap '' diff --git a/Mathlib/Analysis/Convex/Visible.lean b/Mathlib/Analysis/Convex/Visible.lean index 4edf4e41f7bf90..933c946f704339 100644 --- a/Mathlib/Analysis/Convex/Visible.lean +++ b/Mathlib/Analysis/Convex/Visible.lean @@ -57,6 +57,7 @@ omit [IsOrderedRing 𝕜] in lemma IsVisible.mono (hst : s ⊆ t) (ht : IsVisible 𝕜 t x y) : IsVisible 𝕜 s x y := fun _z hz ↦ ht <| hst hz +set_option backward.isDefEq.respectTransparency false in lemma isVisible_iff_lineMap (hxy : x ≠ y) : IsVisible 𝕜 s x y ↔ ∀ δ ∈ Set.Ioo (0 : 𝕜) 1, lineMap x y δ ∉ s := by simp [IsVisible, sbtw_iff_mem_image_Ioo_and_ne, hxy] @@ -68,6 +69,7 @@ section Module variable [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [AddCommGroup V] [Module 𝕜 V] {s : Set V} {x y z : V} +set_option backward.isDefEq.respectTransparency false in /-- If a point `x` sees a convex combination of points of a set `s` through `convexHull ℝ s ∌ x`, then it sees all terms of that combination. @@ -119,6 +121,7 @@ lemma IsVisible.of_convexHull_of_pos {ι : Type*} {t : Finset ι} {a : ι → V} variable [TopologicalSpace 𝕜] [OrderTopology 𝕜] [TopologicalSpace V] [IsTopologicalAddGroup V] [ContinuousSMul 𝕜 V] +set_option backward.isDefEq.respectTransparency false in /-- One cannot see any point in the interior of a set. -/ lemma IsVisible.eq_of_mem_interior (hsxy : IsVisible 𝕜 s x y) (hy : y ∈ interior s) : x = y := by @@ -156,6 +159,7 @@ lemma IsVisible.mem_convexHull_isVisible (hx : x ∉ convexHull ℝ s) (hy : y variable [TopologicalSpace V] [IsTopologicalAddGroup V] [ContinuousSMul ℝ V] +set_option backward.isDefEq.respectTransparency false in /-- If `s` is a closed set, then any point `x` sees some point of `s` in any direction where there is something to see. -/ lemma IsClosed.exists_wbtw_isVisible (hs : IsClosed s) (hy : y ∈ s) (x : V) : diff --git a/Mathlib/Analysis/Distribution/TestFunction.lean b/Mathlib/Analysis/Distribution/TestFunction.lean index c515b7de323347..1057b9b446021e 100644 --- a/Mathlib/Analysis/Distribution/TestFunction.lean +++ b/Mathlib/Analysis/Distribution/TestFunction.lean @@ -62,6 +62,14 @@ variable {𝕜 𝕂 : Type*} [NontriviallyNormedField 𝕜] {F' : Type*} [NormedAddCommGroup F'] [NormedSpace ℝ F'] [NormedSpace 𝕜 F'] {n n₁ n₂ k : ℕ∞} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Option.map₂ + Option.rec + Set.Subset + WithTop.map₂ + WithTop.some + variable (Ω F n) in /-- The type of bundled `n`-times continuously differentiable maps with compact support -/ structure TestFunction : Type _ where @@ -244,7 +252,7 @@ limit of the `𝓓^{n}_{K}(E, F)`s **in the category of topological spaces**. Note that this has no reason to be a locally convex (or even vector space) topology. For this reason, we actually endow `𝓓^{n}(Ω, F)` with another topology, namely the finest locally convex topology which is coarser than this original topology. See `TestFunction.topologicalSpace`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def originalTop : TopologicalSpace 𝓓^{n}(Ω, F) := ⨆ (K : Compacts E) (K_sub_Ω : (K : Set E) ⊆ Ω), coinduced (ofSupportedIn K_sub_Ω) ContDiffMapSupportedIn.topologicalSpace @@ -401,6 +409,7 @@ lemma toBoundedContinuousFunctionCLM_eq_of_scalars [Algebra ℝ 𝕜] [IsScalarT (toBoundedContinuousFunctionCLM 𝕜 : 𝓓^{n}(Ω, F) → _) = toBoundedContinuousFunctionCLM 𝕜' := rfl +set_option backward.isDefEq.respectTransparency false in variable (𝕜) in theorem injective_toBoundedContinuousFunctionCLM [Algebra ℝ 𝕜] [IsScalarTower ℝ 𝕜 F] : Function.Injective (toBoundedContinuousFunctionCLM 𝕜 : 𝓓^{n}(Ω, F) →L[𝕜] E →ᵇ F) := @@ -447,6 +456,7 @@ section Monotone variable [Algebra ℝ 𝕜] [IsScalarTower ℝ 𝕜 F] +set_option backward.isDefEq.respectTransparency false in variable (𝕜) in /-- If `n₁ ≥ n₂` and `Ω₁ ⊆ Ω₂`, `monoCLM 𝕜` is the continuous `𝕜`-linear inclusion of `𝓓^{n₁}(Ω₁, F)` inside `𝓓^{n₂}(Ω₂, F)`. Otherwise, this is the zero map. @@ -491,6 +501,7 @@ section FDerivCLM variable [Algebra ℝ 𝕜] [IsScalarTower ℝ 𝕜 F] +set_option backward.isDefEq.respectTransparency false in variable (𝕜 n k) in /-- `fderivCLM 𝕜 n k` is the continuous `𝕜`-linear-map sending `f : 𝓓^{n}_{K}(E, F)` to its derivative as an element of `𝓓^{k}_{K}(E, E →L[ℝ] F)`. diff --git a/Mathlib/Analysis/Fourier/AddCircle.lean b/Mathlib/Analysis/Fourier/AddCircle.lean index a29469c3576dde..7f7e65c5471d0d 100644 --- a/Mathlib/Analysis/Fourier/AddCircle.lean +++ b/Mathlib/Analysis/Fourier/AddCircle.lean @@ -225,6 +225,7 @@ theorem fourierSubalgebra_coe : variable [hT : Fact (0 < T)] +set_option backward.isDefEq.respectTransparency.types false in /-- The subalgebra of `C(AddCircle T, ℂ)` generated by `fourier n` for `n ∈ ℤ` separates points. -/ theorem fourierSubalgebra_separatesPoints : (@fourierSubalgebra T).SeparatesPoints := by diff --git a/Mathlib/Analysis/Fourier/AddCircleMulti.lean b/Mathlib/Analysis/Fourier/AddCircleMulti.lean index 154f06a1346757..eea41963b46d25 100644 --- a/Mathlib/Analysis/Fourier/AddCircleMulti.lean +++ b/Mathlib/Analysis/Fourier/AddCircleMulti.lean @@ -114,6 +114,7 @@ theorem mFourierSubalgebra_coe : simp only [mFourier, Pi.add_apply, fourier_apply, fourier_add', Finset.prod_mul_distrib, ContinuousMap.coe_mk, ContinuousMap.mul_apply] +set_option backward.isDefEq.respectTransparency.types false in /-- The subalgebra of `C(UnitAddTorus d, ℂ)` generated by `mFourier n` for `n ∈ ℤᵈ` separates points. -/ theorem mFourierSubalgebra_separatesPoints : (mFourierSubalgebra d).SeparatesPoints := by diff --git a/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean b/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean index 7c636ca0124d61..4c05bcb2aae871 100644 --- a/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean +++ b/Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean @@ -48,6 +48,7 @@ variable {V W : Type*} [AddCommGroup V] [Module ℝ V] [TopologicalSpace V] {e : AddChar ℝ Circle} {L : V →ₗ[ℝ] W →ₗ[ℝ] ℝ} {he : Continuous e} {hL : Continuous fun p : V × W ↦ L p.1 p.2} +set_option backward.isDefEq.respectTransparency false in /-- The bounded continuous mapping `fun v ↦ e (L v w)` from `V` to `ℂ`. -/ noncomputable def char (he : Continuous e) (hL : Continuous fun p : V × W ↦ L p.1 p.2) (w : W) : @@ -107,6 +108,7 @@ noncomputable def charMonoidHom (he : Continuous e) (hL : Continuous fun p : V map_one' := char_zero_eq_one map_mul' := char_add_eq_mul (he := he) (hL := hL) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma charMonoidHom_apply (w : Multiplicative W) (v : V) : charMonoidHom he hL w v = e (L v w) := by simp [charMonoidHom] @@ -126,6 +128,7 @@ lemma charAlgHom_apply (w : AddMonoidAlgebra ℂ W) (v : V) : rfl · simp +set_option backward.isDefEq.respectTransparency false in /-- The family of `ℂ`-linear combinations of `char he hL w, w : W`, is closed under `star`. -/ lemma star_mem_range_charAlgHom (he : Continuous e) (hL : Continuous fun p : V × W ↦ L p.1 p.2) {x : V →ᵇ ℂ} (hx : x ∈ (charAlgHom he hL).range) : diff --git a/Mathlib/Analysis/Fourier/PoissonSummation.lean b/Mathlib/Analysis/Fourier/PoissonSummation.lean index 452433e592bf01..224df713f9ae62 100644 --- a/Mathlib/Analysis/Fourier/PoissonSummation.lean +++ b/Mathlib/Analysis/Fourier/PoissonSummation.lean @@ -46,6 +46,7 @@ open scoped Real Filter FourierTransform open ContinuousMap +set_option backward.isDefEq.respectTransparency.types false in /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `∑' n : ℤ, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, ℂ)} diff --git a/Mathlib/Analysis/InnerProductSpace/Adjoint.lean b/Mathlib/Analysis/InnerProductSpace/Adjoint.lean index 50e68b3e4fd590..86027558e67a30 100644 --- a/Mathlib/Analysis/InnerProductSpace/Adjoint.lean +++ b/Mathlib/Analysis/InnerProductSpace/Adjoint.lean @@ -171,7 +171,10 @@ theorem _root_.LinearMap.IsSymmetric.clm_adjoint_eq {A : E →L[𝕜] E} (hA : A A† = A := by rwa [eq_comm, eq_adjoint_iff A A] +set_option backward.isDefEq.respectTransparency.types false in lemma adjoint_id : (.id 𝕜 E)† = .id 𝕜 E := by simp + +set_option backward.isDefEq.respectTransparency.types false in lemma adjoint_one : (1 : E →L[𝕜] E)† = 1 := by simp theorem _root_.Submodule.adjoint_subtypeL (U : Submodule 𝕜 E) [CompleteSpace U] : @@ -409,6 +412,7 @@ but with stronger type class assumptions (i.e., `CompleteSpace`). -/ theorem IsStarNormal.orthogonal_range (hT : IsStarNormal T) : T.rangeᗮ = T.ker := T.orthogonal_range ▸ hT.ker_adjoint_eq_ker +set_option backward.isDefEq.respectTransparency false in /- TODO: As we have a more general result of this for elements in non-unital C⋆-algebras (see `Mathlib/Analysis/CStarAlgebra/Projection.lean`), we will want to simplify the proof by using the complexification of an inner product space over `𝕜`. -/ @@ -887,6 +891,7 @@ theorem conjStarAlgEquiv_trans {G : Type*} [NormedAddCommGroup G] [InnerProductS [CompleteSpace G] (e : H ≃ₗᵢ[𝕜] K) (f : K ≃ₗᵢ[𝕜] G) : (e.trans f).conjStarAlgEquiv = e.conjStarAlgEquiv.trans f.conjStarAlgEquiv := rfl +set_option backward.isDefEq.respectTransparency false in open ContinuousLinearEquiv ContinuousLinearMap in theorem conjStarAlgEquiv_ext_iff (f g : H ≃ₗᵢ[𝕜] K) : f.conjStarAlgEquiv = g.conjStarAlgEquiv ↔ ∃ α : unitary 𝕜, f = α • g := by diff --git a/Mathlib/Analysis/InnerProductSpace/Affine.lean b/Mathlib/Analysis/InnerProductSpace/Affine.lean index e621f5659fc205..99ffb7cb2a45bd 100644 --- a/Mathlib/Analysis/InnerProductSpace/Affine.lean +++ b/Mathlib/Analysis/InnerProductSpace/Affine.lean @@ -62,6 +62,7 @@ theorem inner_vsub_vsub_right_eq_dist_sq_right_iff {a b c : P} : ⟪a -ᵥ c, b -ᵥ c⟫ = dist b c ^ 2 ↔ ⟪a -ᵥ b, b -ᵥ c⟫ = 0 := by rw [real_inner_comm, inner_vsub_vsub_right_eq_dist_sq_left_iff, real_inner_comm] +set_option backward.isDefEq.respectTransparency false in /-- Squared distance between two points on lines from a common origin, given orthogonality of the direction vectors. -/ theorem dist_sq_lineMap_lineMap_of_inner_eq_zero {a b c : P} (t₁ t₂ : ℝ) @@ -75,6 +76,7 @@ theorem dist_sq_lineMap_lineMap_of_inner_eq_zero {a b c : P} (t₁ t₂ : ℝ) Real.norm_eq_abs, Real.norm_eq_abs, inner_smul_left, inner_smul_right, h_inner] simp only [mul_zero, sub_zero, mul_pow, sq_abs, ← dist_eq_norm_vsub' V] +set_option backward.isDefEq.respectTransparency false in /-- Squared distance from `p` to a point on the line from `a` to `b`, given that `p -ᵥ a` is orthogonal to `b -ᵥ a`. -/ theorem dist_sq_lineMap_of_inner_eq_zero {a b p : P} (t : ℝ) diff --git a/Mathlib/Analysis/InnerProductSpace/Basic.lean b/Mathlib/Analysis/InnerProductSpace/Basic.lean index 6db945fad96026..5826793adc8bdb 100644 --- a/Mathlib/Analysis/InnerProductSpace/Basic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Basic.lean @@ -930,7 +930,7 @@ local notation "⟪" x ", " y "⟫" => inner 𝕜 x y /-- A general inner product implies a real inner product. This is not registered as an instance since `𝕜` does not appear in the return type `Inner ℝ E`. -/ -@[implicit_reducible] +@[instance_reducible] def Inner.rclikeToReal : Inner ℝ E where inner x y := re ⟪x, y⟫ /-- A general inner product space structure implies a real inner product structure. @@ -969,7 +969,7 @@ theorem real_inner_I_smul_self (x : E) : /-- A complex inner product implies a real inner product. This cannot be an instance since it creates a diamond with `PiLp.innerProductSpace` because `re (sum i, ⟪x i, y i⟫)` and `sum i, re ⟪x i, y i⟫` are not defeq. -/ -@[implicit_reducible] +@[instance_reducible] def InnerProductSpace.complexToReal [SeminormedAddCommGroup G] [InnerProductSpace ℂ G] : InnerProductSpace ℝ G := InnerProductSpace.rclikeToReal ℂ G diff --git a/Mathlib/Analysis/InnerProductSpace/Defs.lean b/Mathlib/Analysis/InnerProductSpace/Defs.lean index cc34ea1e8dda94..0a7d45cc8a3e87 100644 --- a/Mathlib/Analysis/InnerProductSpace/Defs.lean +++ b/Mathlib/Analysis/InnerProductSpace/Defs.lean @@ -170,7 +170,7 @@ instance (𝕜 : Type*) (F : Type*) [RCLike 𝕜] [AddCommGroup F] `PreInnerProductSpace.Core` for `PreInnerProductSpace`s. Note that the `Seminorm` instance provided by `PreInnerProductSpace.Core.norm` is propositionally but not definitionally equal to the original norm. -/ -@[implicit_reducible] +@[instance_reducible] def PreInnerProductSpace.toCore [SeminormedAddCommGroup E] [c : InnerProductSpace 𝕜 E] : PreInnerProductSpace.Core 𝕜 E where __ := c @@ -180,7 +180,7 @@ def PreInnerProductSpace.toCore [SeminormedAddCommGroup E] [c : InnerProductSpac `InnerProductSpace.Core` for `InnerProductSpace`s. Note that the `Norm` instance provided by `InnerProductSpace.Core.norm` is propositionally but not definitionally equal to the original norm. -/ -@[implicit_reducible] +@[instance_reducible] def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace 𝕜 E] : InnerProductSpace.Core 𝕜 E := { c with @@ -412,7 +412,7 @@ attribute [local instance] toSeminormedAddCommGroup /-- Normed space (which is actually a seminorm in general) structure constructed from a `PreInnerProductSpace.Core` structure -/ -@[implicit_reducible] +@[instance_reducible] def toNormedSpace : NormedSpace 𝕜 F where norm_smul_le r x := by rw [norm_eq_sqrt_re_inner, inner_smul_left, inner_smul_right, ← mul_assoc] @@ -564,7 +564,7 @@ attribute [local instance] InnerProductSpace.Core.toSeminormedAddCommGroup the space into a pre-inner product space (i.e., `SeminormedAddCommGroup` and `InnerProductSpace`). The `SeminormedAddCommGroup` structure is expected to already be defined with `InnerProductSpace.ofCore.toSeminormedAddCommGroup`. -/ -@[implicit_reducible] +@[instance_reducible] def InnerProductSpace.ofCore [AddCommGroup F] [Module 𝕜 F] (cd : PreInnerProductSpace.Core 𝕜 F) : InnerProductSpace 𝕜 F := letI : NormedSpace 𝕜 F := InnerProductSpace.Core.toNormedSpace @@ -579,7 +579,7 @@ end /-- Given an `InnerProductSpace.Core` structure on a space with a topology, one can use it to turn the space into an inner product space. The `NormedAddCommGroup` structure is expected to already be defined with `InnerProductSpace.ofCore.toNormedAddCommGroupOfTopology`. -/ -@[implicit_reducible] +@[instance_reducible] def InnerProductSpace.ofCoreOfTopology [AddCommGroup F] [hF : Module 𝕜 F] [TopologicalSpace F] [IsTopologicalAddGroup F] [ContinuousConstSMul 𝕜 F] (cd : InnerProductSpace.Core 𝕜 F) diff --git a/Mathlib/Analysis/InnerProductSpace/LinearMap.lean b/Mathlib/Analysis/InnerProductSpace/LinearMap.lean index 1ef51e0d746376..e2555d778f500b 100644 --- a/Mathlib/Analysis/InnerProductSpace/LinearMap.lean +++ b/Mathlib/Analysis/InnerProductSpace/LinearMap.lean @@ -49,6 +49,7 @@ section Complex_Seminormed variable {V : Type*} [SeminormedAddCommGroup V] [InnerProductSpace ℂ V] +set_option backward.isDefEq.respectTransparency false in /-- A complex polarization identity, with a linear map. -/ theorem inner_map_polarization (T : V →ₗ[ℂ] V) (x y : V) : ⟪T y, x⟫_ℂ = @@ -61,6 +62,7 @@ theorem inner_map_polarization (T : V →ₗ[ℂ] V) (x y : V) : mul_add, ← mul_assoc, mul_neg, neg_neg, one_mul, neg_one_mul, mul_sub, sub_sub] ring +set_option backward.isDefEq.respectTransparency false in theorem inner_map_polarization' (T : V →ₗ[ℂ] V) (x y : V) : ⟪T x, y⟫_ℂ = (⟪T (x + y), x + y⟫_ℂ - ⟪T (x - y), x - y⟫_ℂ - @@ -107,6 +109,7 @@ variable {ι : Type*} {ι' : Type*} {ι'' : Type*} variable {E' : Type*} [SeminormedAddCommGroup E'] [InnerProductSpace 𝕜 E'] variable {E'' : Type*} [SeminormedAddCommGroup E''] [InnerProductSpace 𝕜 E''] +set_option backward.isDefEq.respectTransparency false in /-- A linear isometry preserves the inner product. -/ @[simp] theorem LinearIsometry.inner_map_map (f : E →ₗᵢ[𝕜] E') (x y : E) : ⟪f x, f y⟫ = ⟪x, y⟫ := by @@ -278,6 +281,7 @@ theorem ContinuousLinearMap.reApplyInnerSelf_continuous (T : E →L[𝕜] E) : Continuous T.reApplyInnerSelf := reCLM.continuous.comp <| T.continuous.inner continuous_id +set_option backward.isDefEq.respectTransparency false in theorem ContinuousLinearMap.reApplyInnerSelf_smul (T : E →L[𝕜] E) (x : E) {c : 𝕜} : T.reApplyInnerSelf (c • x) = ‖c‖ ^ 2 * T.reApplyInnerSelf x := by simp only [map_smul, ContinuousLinearMap.reApplyInnerSelf_apply, inner_smul_left, @@ -355,6 +359,7 @@ variable {F H : Type*} [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] lemma rankOne_ne_zero {x : E} {y : F} (hx : x ≠ 0) (hy : y ≠ 0) : rankOne 𝕜 x y ≠ 0 := by grind [rankOne_eq_zero] +set_option backward.isDefEq.respectTransparency false in theorem isIdempotentElem_rankOne_self_iff {x : F} (hx : x ≠ 0) : IsIdempotentElem (rankOne 𝕜 x x) ↔ ‖x‖ = 1 := by refine ⟨?_, isIdempotentElem_rankOne_self⟩ diff --git a/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean b/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean index 9cf3e7608ebd4c..c3befca92dfba7 100644 --- a/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean +++ b/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean @@ -169,6 +169,7 @@ theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, convert! this using 1 exact funext fun x => (hw x).symm +set_option backward.isDefEq.respectTransparency false in theorem adjoint_apply_of_not_dense (hT : ¬Dense (T.domain : Set E)) (y : T†.domain) : T† y = 0 := by classical change (if hT : Dense (T.domain : Set E) then adjointAux hT else 0) y = _ @@ -206,6 +207,7 @@ namespace ContinuousLinearMap variable [CompleteSpace E] [CompleteSpace F] variable (A : E →L[𝕜] F) {p : Submodule 𝕜 E} +set_option backward.isDefEq.respectTransparency false in /-- Restricting `A` to a dense submodule and taking the `LinearPMap.adjoint` is the same as taking the `ContinuousLinearMap.adjoint` interpreted as a `LinearPMap`. -/ theorem toPMap_adjoint_eq_adjoint_toPMap_of_dense (hp : Dense (p : Set E)) : diff --git a/Mathlib/Analysis/InnerProductSpace/OfNorm.lean b/Mathlib/Analysis/InnerProductSpace/OfNorm.lean index 49ffd3cc9cd697..b1b90414e99d85 100644 --- a/Mathlib/Analysis/InnerProductSpace/OfNorm.lean +++ b/Mathlib/Analysis/InnerProductSpace/OfNorm.lean @@ -203,7 +203,7 @@ set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- **Fréchet–von Neumann–Jordan Theorem**. A normed space `E` whose norm satisfies the parallelogram identity can be given a compatible inner product. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def InnerProductSpace.ofNorm (h : ∀ x y : E, ‖x + y‖ * ‖x + y‖ + ‖x - y‖ * ‖x - y‖ = 2 * (‖x‖ * ‖x‖ + ‖y‖ * ‖y‖)) : InnerProductSpace 𝕜 E := diff --git a/Mathlib/Analysis/InnerProductSpace/Orientation.lean b/Mathlib/Analysis/InnerProductSpace/Orientation.lean index 7ff0181b423f2e..aea1e5dbaf051f 100644 --- a/Mathlib/Analysis/InnerProductSpace/Orientation.lean +++ b/Mathlib/Analysis/InnerProductSpace/Orientation.lean @@ -181,6 +181,7 @@ theorem volumeForm_zero_pos [_i : Fact (finrank ℝ E = 0)] : AlternatingMap.constLinearEquivOfIsEmpty 1 := by simp [volumeForm, Or.by_cases] +set_option backward.isDefEq.respectTransparency.types false in theorem volumeForm_zero_neg [_i : Fact (finrank ℝ E = 0)] : Orientation.volumeForm (-positiveOrientation : Orientation ℝ E (Fin 0)) = -AlternatingMap.constLinearEquivOfIsEmpty 1 := by diff --git a/Mathlib/Analysis/InnerProductSpace/PiL2.lean b/Mathlib/Analysis/InnerProductSpace/PiL2.lean index e213de6bed46ee..607bd21507a03e 100644 --- a/Mathlib/Analysis/InnerProductSpace/PiL2.lean +++ b/Mathlib/Analysis/InnerProductSpace/PiL2.lean @@ -400,6 +400,7 @@ theorem repr_injective : cases g congr +set_option backward.isDefEq.respectTransparency false in /-- `b i` is the `i`th basis vector. -/ instance instFunLike : FunLike (OrthonormalBasis ι 𝕜 E) ι E where coe b i := by classical exact b.repr.symm (EuclideanSpace.single i (1 : 𝕜)) @@ -846,6 +847,7 @@ lemma equiv_self_rfl : b.equiv b (.refl ι) = .refl 𝕜 E := by apply b.toBasis.ext_linearIsometryEquiv simp +set_option backward.isDefEq.respectTransparency false in lemma equiv_apply (x : E) : b.equiv b' e x = ∑ i, b.repr x i • b' (e i) := by nth_rw 1 [← b.sum_repr x, map_sum] simp_rw [map_smul, equiv_apply_basis] @@ -1306,6 +1308,7 @@ theorem InnerProductSpace.toMatrix_rankOne {𝕜 E F ι ι' : Type*} [RCLike Basis.coe_singleton, Matrix.vecMulVec_one, OrthonormalBasis.coe_singleton, star_one, Matrix.one_vecMulVec, Matrix.vecMulVec_eq Unit] +set_option backward.isDefEq.respectTransparency false in open Matrix LinearMap EuclideanSpace in theorem InnerProductSpace.symm_toEuclideanLin_rankOne {𝕜 m n : Type*} [RCLike 𝕜] [Fintype m] [Fintype n] [DecidableEq n] (x : EuclideanSpace 𝕜 m) (y : EuclideanSpace 𝕜 n) : diff --git a/Mathlib/Analysis/InnerProductSpace/Positive.lean b/Mathlib/Analysis/InnerProductSpace/Positive.lean index ae72a4b544e65c..7d270ec05d9f06 100644 --- a/Mathlib/Analysis/InnerProductSpace/Positive.lean +++ b/Mathlib/Analysis/InnerProductSpace/Positive.lean @@ -199,6 +199,7 @@ theorem isPositive_linearIsometryEquiv_conj_iff {T : E →ₗ[𝕜] E} (f : E Function.comp_apply, LinearIsometryEquiv.inner_map_eq_flip] exact fun _ => ⟨fun h x => by simpa using h (f x), fun h x => h _⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- `A.toEuclideanLin` is positive if and only if `A` is positive semi-definite. -/ @[simp] theorem _root_.Matrix.isPositive_toEuclideanLin_iff {n : Type*} [Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} : A.toEuclideanLin.IsPositive ↔ A.PosSemidef := by diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean b/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean index 5dcee02d3cba00..6caef17c623204 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean @@ -298,6 +298,7 @@ theorem OrthogonalFamily.projection_directSum_coeAddHom [DecidableEq ι] {V : ι simp_rw [map_add] exact congr_arg₂ (· + ·) hx hy +set_option backward.isDefEq.respectTransparency false in /-- If a family of submodules is orthogonal and they span the whole space, then the orthogonal projection provides a means to decompose the space into its submodules. @@ -321,7 +322,9 @@ noncomputable abbrev OrthogonalFamily.decomposition exact map_zero _ right_inv x := by dsimp only - simp_rw [hV.projection_directSum_coeAddHom, DFinsupp.equivFunOnFintype_symm_coe] + -- TODO: Merge `simp_rw` and `rw` + simp_rw [hV.projection_directSum_coeAddHom] + rw [DFinsupp.equivFunOnFintype_symm_coe] end OrthogonalFamily diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean index 4d8a0b48016da6..9b415664519994 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Reflection.lean @@ -39,6 +39,7 @@ def reflectionLinearEquiv : E ≃ₗ[𝕜] E := (2 • (K.starProjection.toLinearMap) - LinearMap.id) fun x => by simp [two_smul, starProjection_eq_self_iff.mpr] +set_option backward.isDefEq.respectTransparency false in /-- Reflection in a complete subspace of an inner product space. The word "reflection" is sometimes understood to mean specifically reflection in a codimension-one subspace, and sometimes more generally to cover operations such as reflection in a point. The definition here, of diff --git a/Mathlib/Analysis/InnerProductSpace/Reproducing.lean b/Mathlib/Analysis/InnerProductSpace/Reproducing.lean index 7fe97d9977d220..0c098ca924f313 100644 --- a/Mathlib/Analysis/InnerProductSpace/Reproducing.lean +++ b/Mathlib/Analysis/InnerProductSpace/Reproducing.lean @@ -138,6 +138,7 @@ lemma norm_kernel_le (x y) : ‖kernel H x y‖ ≤ √‖kernel H x x‖ * √ lemma norm_kernel_sq_le (x y) : ‖kernel H x y‖ ^ 2 ≤ ‖kernel H x x‖ * ‖kernel H y y‖ := by grw [norm_kernel_le]; simp [mul_pow] +set_option backward.isDefEq.respectTransparency.types false in /-- The span of the kernel functions is dense. -/ theorem kerFun_dense : topologicalClosure (span 𝕜 {kerFun H x v | (x) (v)}) = ⊤ := by refine (orthogonal_eq_bot_iff.mp ((Submodule.eq_bot_iff _).mpr fun f fin ↦ DFunLike.ext f 0 ?_)) diff --git a/Mathlib/Analysis/InnerProductSpace/Subspace.lean b/Mathlib/Analysis/InnerProductSpace/Subspace.lean index 83d08d22e20c0b..0ab7a28a195140 100644 --- a/Mathlib/Analysis/InnerProductSpace/Subspace.lean +++ b/Mathlib/Analysis/InnerProductSpace/Subspace.lean @@ -99,6 +99,7 @@ theorem OrthogonalFamily.eq_ite [DecidableEq ι] {i j : ι} (v : G i) (w : G j) · rfl · exact hV h v w +set_option backward.isDefEq.respectTransparency false in theorem OrthogonalFamily.inner_right_dfinsupp [∀ (i) (x : G i), Decidable (x ≠ 0)] [DecidableEq ι] (l : ⨁ i, G i) (i : ι) (v : G i) : ⟪V i v, l.sum fun j => V j⟫ = ⟪v, l i⟫ := diff --git a/Mathlib/Analysis/InnerProductSpace/Symmetric.lean b/Mathlib/Analysis/InnerProductSpace/Symmetric.lean index 0ae3aa1b3cca3d..7015200594785b 100644 --- a/Mathlib/Analysis/InnerProductSpace/Symmetric.lean +++ b/Mathlib/Analysis/InnerProductSpace/Symmetric.lean @@ -195,6 +195,7 @@ theorem isSymmetric_iff_inner_map_self_real (T : V →ₗ[ℂ] V) : end Complex +set_option backward.isDefEq.respectTransparency false in /-- Polarization identity for symmetric linear maps. See `inner_map_polarization` for the complex version without the symmetric assumption. -/ theorem IsSymmetric.inner_map_polarization {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (x y : E) : diff --git a/Mathlib/Analysis/LocallyConvex/AbsConvex.lean b/Mathlib/Analysis/LocallyConvex/AbsConvex.lean index d61f7dea8bc319..65362780b35069 100644 --- a/Mathlib/Analysis/LocallyConvex/AbsConvex.lean +++ b/Mathlib/Analysis/LocallyConvex/AbsConvex.lean @@ -93,6 +93,7 @@ theorem balanced_absConvexHull : Balanced 𝕜 (absConvexHull 𝕜 s) := theorem convex_absConvexHull : Convex 𝕜 (absConvexHull 𝕜 s) := absConvex_absConvexHull.2 +set_option backward.isDefEq.respectTransparency false in variable (𝕜 s) in theorem absConvexHull_eq_iInter : absConvexHull 𝕜 s = ⋂ (t : Set E) (_ : s ⊆ t) (_ : AbsConvex 𝕜 t), t := by diff --git a/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean b/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean index 812c09cfba3a10..ed55037e7b52ba 100644 --- a/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean +++ b/Mathlib/Analysis/LocallyConvex/AbsConvexOpen.lean @@ -105,6 +105,7 @@ theorem gaugeSeminormFamily_ball (s : AbsConvexOpenSets 𝕜 E) : variable [IsTopologicalAddGroup E] [ContinuousSMul 𝕜 E] variable [LocallyConvexSpace 𝕜 E] +set_option backward.isDefEq.respectTransparency false in /-- The topology of a locally convex space is induced by the gauge seminorm family. -/ theorem with_gaugeSeminormFamily : WithSeminorms (gaugeSeminormFamily 𝕜 E) := by refine SeminormFamily.withSeminorms_of_hasBasis _ ?_ diff --git a/Mathlib/Analysis/LocallyConvex/Separation.lean b/Mathlib/Analysis/LocallyConvex/Separation.lean index 0b60ee86f7af5c..d51abfcb35d523 100644 --- a/Mathlib/Analysis/LocallyConvex/Separation.lean +++ b/Mathlib/Analysis/LocallyConvex/Separation.lean @@ -48,6 +48,7 @@ open scoped Pointwise variable {𝕜 E : Type*} +set_option backward.isDefEq.respectTransparency false in /-- Given a set `s` which is a convex neighbourhood of `0` and a point `x₀` outside of it, there is a continuous linear functional `f` separating `x₀` and `s`, in the sense that it sends `x₀` to 1 and all of `s` to values strictly below `1`. -/ diff --git a/Mathlib/Analysis/LocallyConvex/WeakSpace.lean b/Mathlib/Analysis/LocallyConvex/WeakSpace.lean index c56bde3b317779..5000af72f946f1 100644 --- a/Mathlib/Analysis/LocallyConvex/WeakSpace.lean +++ b/Mathlib/Analysis/LocallyConvex/WeakSpace.lean @@ -30,6 +30,7 @@ variable [TopologicalSpace E] [IsTopologicalAddGroup E] [ContinuousSMul 𝕜 E] variable [TopologicalSpace F] [IsTopologicalAddGroup F] [ContinuousSMul 𝕜 F] [LocallyConvexSpace ℝ F] +set_option backward.isDefEq.respectTransparency.types false in variable (𝕜) in /-- If `E` is a locally convex space over `𝕜` (with `RCLike 𝕜`), and `s : Set E` is `ℝ`-convex, then the closure of `s` and the weak closure of `s` coincide. More precisely, the topological closure diff --git a/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean b/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean index 98a83a679d5ae0..2288771b2db02e 100644 --- a/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean +++ b/Mathlib/Analysis/LocallyConvex/WithSeminorms.lean @@ -138,7 +138,7 @@ theorem basisSets_neg (U) (hU' : U ∈ p.basisSets) : exact ⟨U, hU', Eq.subset hU⟩ /-- The `addGroupFilterBasis` induced by the filter basis `Seminorm.basisSets`. -/ -@[implicit_reducible] +@[instance_reducible] protected def addGroupFilterBasis : AddGroupFilterBasis E := addGroupFilterBasisOfComm p.basisSets p.basisSets_nonempty p.basisSets_intersect p.basisSets_zero p.basisSets_add p.basisSets_neg diff --git a/Mathlib/Analysis/Matrix/Order.lean b/Mathlib/Analysis/Matrix/Order.lean index e07208296f2cec..37bdfc0112b872 100644 --- a/Mathlib/Analysis/Matrix/Order.lean +++ b/Mathlib/Analysis/Matrix/Order.lean @@ -304,7 +304,7 @@ set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- A positive definite matrix `M` induces a norm on `Matrix n n 𝕜` `‖x‖ = sqrt (x * M * xᴴ).trace`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def toMatrixSeminormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosSemidef) : SeminormedAddCommGroup (Matrix n n 𝕜) := @InnerProductSpace.Core.toSeminormedAddCommGroup _ _ _ _ _ hM.matrixPreInnerProductSpace @@ -313,7 +313,7 @@ set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- A positive definite matrix `M` induces a norm on `Matrix n n 𝕜`: `‖x‖ = sqrt (x * M * xᴴ).trace`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def toMatrixNormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosDef) : NormedAddCommGroup (Matrix n n 𝕜) := letI : InnerProductSpace.Core 𝕜 (Matrix n n 𝕜) := @@ -331,7 +331,7 @@ noncomputable def toMatrixNormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosDe /-- A positive semi-definite matrix `M` induces an inner product on `Matrix n n 𝕜`: `⟪x, y⟫ = (y * M * xᴴ).trace`. -/ -@[implicit_reducible] +@[instance_reducible] def toMatrixInnerProductSpace (M : Matrix n n 𝕜) (hM : M.PosSemidef) : letI : SeminormedAddCommGroup (Matrix n n 𝕜) := M.toMatrixSeminormedAddCommGroup hM InnerProductSpace 𝕜 (Matrix n n 𝕜) := diff --git a/Mathlib/Analysis/Matrix/PosDef.lean b/Mathlib/Analysis/Matrix/PosDef.lean index 0931c1b8e8bfe3..a9e7fd020b3fd7 100644 --- a/Mathlib/Analysis/Matrix/PosDef.lean +++ b/Mathlib/Analysis/Matrix/PosDef.lean @@ -94,7 +94,7 @@ set_option backward.privateInPublic true in /-- The pre-inner product space structure implementation. Only an auxiliary for `Matrix.toSeminormedAddCommGroup`, `Matrix.toNormedAddCommGroup`, and `Matrix.toInnerProductSpace`. -/ -@[implicit_reducible] +@[instance_reducible] private def PosSemidef.preInnerProductSpace {M : Matrix n n 𝕜} (hM : M.PosSemidef) : PreInnerProductSpace.Core 𝕜 (n → 𝕜) where inner x y := (M *ᵥ y) ⬝ᵥ star x @@ -124,7 +124,7 @@ noncomputable abbrev toNormedAddCommGroup (M : Matrix n n 𝕜) (hM : M.PosDef) simpa [hx, lt_irrefl, dotProduct_comm] using hM.re_dotProduct_pos h } /-- A positive semi-definite matrix `M` induces an inner product `⟪x, y⟫ = xᴴMy`. -/ -@[implicit_reducible] +@[instance_reducible] def toInnerProductSpace (M : Matrix n n 𝕜) (hM : M.PosSemidef) : @InnerProductSpace 𝕜 (n → 𝕜) _ (M.toSeminormedAddCommGroup hM) := InnerProductSpace.ofCore _ diff --git a/Mathlib/Analysis/Matrix/Spectrum.lean b/Mathlib/Analysis/Matrix/Spectrum.lean index f44c74e2756a28..9d663107693060 100644 --- a/Mathlib/Analysis/Matrix/Spectrum.lean +++ b/Mathlib/Analysis/Matrix/Spectrum.lean @@ -162,6 +162,7 @@ lemma roots_charpoly_eq_eigenvalues : · simp · simp [Finset.prod_ne_zero_iff, Polynomial.X_sub_C_ne_zero] +set_option backward.isDefEq.respectTransparency.types false in lemma roots_charpoly_eq_eigenvalues₀ : A.charpoly.roots = Multiset.map (RCLike.ofReal ∘ hA.eigenvalues₀) Finset.univ.val := by rw [hA.roots_charpoly_eq_eigenvalues] diff --git a/Mathlib/Analysis/MeanInequalities.lean b/Mathlib/Analysis/MeanInequalities.lean index 91cf9e0a12a0aa..cd62fddfaa4853 100644 --- a/Mathlib/Analysis/MeanInequalities.lean +++ b/Mathlib/Analysis/MeanInequalities.lean @@ -746,6 +746,7 @@ theorem inner_le_Lp_mul_Lq (hpq : HolderConjugate p q) : refine le_trans (sum_le_sum fun i _ ↦ ?_) (by simpa using Lr_rpow_le_Lp_mul_Lq s f g hpq) simp only [← abs_mul, le_abs_self] +set_option backward.isDefEq.respectTransparency false in /-- For `1 ≤ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `ℝ`-valued functions. -/ theorem rpow_sum_le_const_mul_sum_rpow (hp : 1 ≤ p) : diff --git a/Mathlib/Analysis/Meromorphic/FactorizedRational.lean b/Mathlib/Analysis/Meromorphic/FactorizedRational.lean index 78c48e562fd40f..356588d6d41070 100644 --- a/Mathlib/Analysis/Meromorphic/FactorizedRational.lean +++ b/Mathlib/Analysis/Meromorphic/FactorizedRational.lean @@ -60,6 +60,7 @@ lemma mulSupport (d : 𝕜 → ℤ) : use u simp_all [zero_zpow_eq_one₀] +set_option backward.isDefEq.respectTransparency false in /-- Helper Lemma: If the support of `d` is finite, then evaluation of functions commutes with finprod, and the function `∏ᶠ u, (· - u) ^ d u` equals `fun x ↦ ∏ᶠ u, (x - u) ^ d u`. @@ -100,6 +101,7 @@ theorem ne_zero {d : 𝕜 → ℤ} {x : 𝕜} (h : d x = 0) : by_cases h₂ : x = z <;> simp_all [zpow_ne_zero, sub_ne_zero] · simp [finprod_of_infinite_mulSupport h₁] +set_option backward.isDefEq.respectTransparency false in open Classical in /-- Helper Lemma for Computations: Extract one factor out of a factorized rational function. @@ -191,6 +193,7 @@ private lemma mulSupport_update {d : 𝕜 → ℤ} {x : 𝕜} simp · simp_all +set_option backward.isDefEq.respectTransparency false in open Classical in /-- Compute the trailing coefficient of the factorized rational function associated with `d : 𝕜 → ℤ`. @@ -214,6 +217,7 @@ theorem meromorphicTrailingCoeffAt_factorizedRational {d : 𝕜 → ℤ} {x : simp_all · grind [meromorphicTrailingCoeffAt_id_sub_const] +set_option backward.isDefEq.respectTransparency false in /-- Variant of `meromorphicTrailingCoeffAt_factorizedRational`: Compute the trailing coefficient of the factorized rational function associated with `d : 𝕜 → ℤ` at points outside the support of `d`. @@ -235,6 +239,7 @@ theorem meromorphicTrailingCoeffAt_factorizedRational_off_support {d : 𝕜 → by_contra hCon simp_all +set_option backward.isDefEq.respectTransparency false in /-- Variant of `meromorphicTrailingCoeffAt_factorizedRational`: Compute log of the norm of the trailing coefficient. The convention that `log 0 = 0` gives a closed formula easier than the one in diff --git a/Mathlib/Analysis/Normed/Affine/AddTorsor.lean b/Mathlib/Analysis/Normed/Affine/AddTorsor.lean index 0beb28f923ee47..217cd410576753 100644 --- a/Mathlib/Analysis/Normed/Affine/AddTorsor.lean +++ b/Mathlib/Analysis/Normed/Affine/AddTorsor.lean @@ -56,6 +56,7 @@ theorem nndist_homothety_center (p₁ p₂ : P) (c : 𝕜) : nndist (homothety p₁ c p₂) p₁ = ‖c‖₊ * nndist p₁ p₂ := NNReal.eq <| dist_homothety_center _ _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem dist_lineMap_lineMap (p₁ p₂ : P) (c₁ c₂ : 𝕜) : dist (lineMap p₁ p₂ c₁) (lineMap p₁ p₂ c₂) = dist c₁ c₂ * dist p₁ p₂ := by @@ -63,47 +64,57 @@ theorem dist_lineMap_lineMap (p₁ p₂ : P) (c₁ c₂ : 𝕜) : simp only [lineMap_apply, dist_eq_norm_vsub, vadd_vsub_vadd_cancel_right, ← sub_smul, norm_smul, vsub_eq_sub] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem nndist_lineMap_lineMap (p₁ p₂ : P) (c₁ c₂ : 𝕜) : nndist (lineMap p₁ p₂ c₁) (lineMap p₁ p₂ c₂) = nndist c₁ c₂ * nndist p₁ p₂ := NNReal.eq <| dist_lineMap_lineMap _ _ _ _ +set_option backward.isDefEq.respectTransparency false in theorem lipschitzWith_lineMap (p₁ p₂ : P) : LipschitzWith (nndist p₁ p₂) (lineMap p₁ p₂ : 𝕜 → P) := LipschitzWith.of_dist_le_mul fun c₁ c₂ => ((dist_lineMap_lineMap p₁ p₂ c₁ c₂).trans (mul_comm _ _)).le +set_option backward.isDefEq.respectTransparency false in @[simp] theorem dist_lineMap_left (p₁ p₂ : P) (c : 𝕜) : dist (lineMap p₁ p₂ c) p₁ = ‖c‖ * dist p₁ p₂ := by simpa only [lineMap_apply_zero, dist_zero_right] using dist_lineMap_lineMap p₁ p₂ c 0 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem nndist_lineMap_left (p₁ p₂ : P) (c : 𝕜) : nndist (lineMap p₁ p₂ c) p₁ = ‖c‖₊ * nndist p₁ p₂ := NNReal.eq <| dist_lineMap_left _ _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem dist_left_lineMap (p₁ p₂ : P) (c : 𝕜) : dist p₁ (lineMap p₁ p₂ c) = ‖c‖ * dist p₁ p₂ := (dist_comm _ _).trans (dist_lineMap_left _ _ _) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem nndist_left_lineMap (p₁ p₂ : P) (c : 𝕜) : nndist p₁ (lineMap p₁ p₂ c) = ‖c‖₊ * nndist p₁ p₂ := NNReal.eq <| dist_left_lineMap _ _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem dist_lineMap_right (p₁ p₂ : P) (c : 𝕜) : dist (lineMap p₁ p₂ c) p₂ = ‖1 - c‖ * dist p₁ p₂ := by simpa only [lineMap_apply_one, dist_eq_norm'] using dist_lineMap_lineMap p₁ p₂ c 1 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem nndist_lineMap_right (p₁ p₂ : P) (c : 𝕜) : nndist (lineMap p₁ p₂ c) p₂ = ‖1 - c‖₊ * nndist p₁ p₂ := NNReal.eq <| dist_lineMap_right _ _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem dist_right_lineMap (p₁ p₂ : P) (c : 𝕜) : dist p₂ (lineMap p₁ p₂ c) = ‖1 - c‖ * dist p₁ p₂ := (dist_comm _ _).trans (dist_lineMap_right _ _ _) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem nndist_right_lineMap (p₁ p₂ : P) (c : 𝕜) : nndist p₂ (lineMap p₁ p₂ c) = ‖1 - c‖₊ * nndist p₁ p₂ := @@ -206,6 +217,7 @@ theorem dist_right_pointReflection (p q : P) : dist q (Equiv.pointReflection p q) = ‖(2 : 𝕜)‖ * dist p q := (dist_comm _ _).trans (dist_pointReflection_right 𝕜 _ _) +set_option backward.isDefEq.respectTransparency false in theorem antilipschitzWith_lineMap {p₁ p₂ : Q} (h : p₁ ≠ p₂) : AntilipschitzWith (nndist p₁ p₂)⁻¹ (lineMap p₁ p₂ : 𝕜 → Q) := AntilipschitzWith.of_le_mul_dist fun c₁ c₂ => by diff --git a/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean b/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean index 9ce6fe4f1ad9a8..9a17aabcfa9be6 100644 --- a/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean +++ b/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean @@ -77,6 +77,7 @@ variable {V P : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] [MetricSpace P open AffineMap +set_option backward.isDefEq.respectTransparency false in /-- Given a set `s` of affine-independent points belonging to an open set `u`, we may extend `s` to an affine basis, all of whose elements belong to `u`. -/ theorem IsOpen.exists_between_affineIndependent_span_eq_top {s u : Set P} (hu : IsOpen u) diff --git a/Mathlib/Analysis/Normed/Algebra/Exponential.lean b/Mathlib/Analysis/Normed/Algebra/Exponential.lean index a1a169cb33b4c4..650a1cb6d20820 100644 --- a/Mathlib/Analysis/Normed/Algebra/Exponential.lean +++ b/Mathlib/Analysis/Normed/Algebra/Exponential.lean @@ -352,7 +352,7 @@ theorem exp_add_of_commute_of_mem_ball [CharZero 𝕂] {x y : 𝔸} (hxy : Commu field_simp [n.factorial_ne_zero] /-- `NormedSpace.exp x` has explicit two-sided inverse `NormedSpace.exp (-x)`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def invertibleExpOfMemBall [CharZero 𝕂] {x : 𝔸} (hx : x ∈ Metric.eball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) : Invertible (exp x) where @@ -522,7 +522,7 @@ theorem exp_add_of_commute {x y : 𝔸} (hxy : Commute x y) : exp (x + y) = exp ((expSeries_radius_eq_top ℚ 𝔸).symm ▸ edist_lt_top _ _) /-- `NormedSpace.exp x` has explicit two-sided inverse `NormedSpace.exp (-x)`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def invertibleExp (x : 𝔸) : Invertible (exp x) := invertibleExpOfMemBall <| (expSeries_radius_eq_top ℚ 𝔸).symm ▸ edist_lt_top _ _ @@ -553,6 +553,7 @@ lemma _root_.SemiconjBy.exp_neg_mul_mul_exp_eq_self {x a b : 𝔸} (h : Semiconj let := invertibleExp b simpa [← invOf_exp, mul_assoc, invOf_mul_eq_iff_eq_mul_left] using! h.exp_right +set_option backward.isDefEq.respectTransparency false in open scoped Function in -- required for scoped `on` notation /-- In a Banach-algebra `𝔸` over `𝕂 = ℝ` or `𝕂 = ℂ`, if a family of elements `f i` mutually commute then `NormedSpace.exp (∑ i, f i) = ∏ i, NormedSpace.exp (f i)`. -/ diff --git a/Mathlib/Analysis/Normed/Algebra/Spectrum.lean b/Mathlib/Analysis/Normed/Algebra/Spectrum.lean index bea3ada86d0875..4b46bc7df1972f 100644 --- a/Mathlib/Analysis/Normed/Algebra/Spectrum.lean +++ b/Mathlib/Analysis/Normed/Algebra/Spectrum.lean @@ -491,6 +491,7 @@ section NormedField variable [NormedField 𝕜] [NormedAlgebra 𝕜 A] [instSMulMem : SMulMemClass SA 𝕜 A] variable (S : SA) [hS : IsClosed (S : Set A)] (x : S) +set_option backward.isDefEq.respectTransparency.types false in open SubalgebraClass in include instSMulMem in /-- Let `S` be a closed subalgebra of a Banach algebra `A`. If `a : S` is invertible in `A`, diff --git a/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean b/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean index cebb8451450c51..8872a65a751f61 100644 --- a/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean +++ b/Mathlib/Analysis/Normed/Algebra/TrivSqZeroExt.lean @@ -208,6 +208,7 @@ example : (TrivSqZeroExt.instUniformSpace : UniformSpace (tsze R M)) = PseudoMetricSpace.toUniformSpace := rfl +set_option backward.isDefEq.respectTransparency false in theorem norm_def (x : tsze R M) : ‖x‖ = ‖fst x‖ + ‖snd x‖ := by erw [WithLp.norm_seminormedAddCommGroupToProd] rw [WithLp.prod_norm_eq_add (by norm_num)] @@ -227,6 +228,7 @@ theorem nnnorm_def (x : tsze R M) : ‖x‖₊ = ‖fst x‖₊ + ‖snd x‖₊ variable [Module R M] [IsBoundedSMul R M] [Module Rᵐᵒᵖ M] [IsBoundedSMul Rᵐᵒᵖ M] [SMulCommClass R Rᵐᵒᵖ M] +set_option backward.isDefEq.respectTransparency false in instance instL1SeminormedRing : SeminormedRing (tsze R M) where norm_mul_le | ⟨r₁, m₁⟩, ⟨r₂, m₂⟩ => by diff --git a/Mathlib/Analysis/Normed/Field/Basic.lean b/Mathlib/Analysis/Normed/Field/Basic.lean index 9a0b0745f1b610..75309093768f50 100644 --- a/Mathlib/Analysis/Normed/Field/Basic.lean +++ b/Mathlib/Analysis/Normed/Field/Basic.lean @@ -280,7 +280,7 @@ end NormedField /-- A normed field is nontrivially normed provided that the norm of some nonzero element is not one. -/ -@[implicit_reducible] +@[instance_reducible] def NontriviallyNormedField.ofNormNeOne {𝕜 : Type*} [h' : NormedField 𝕜] (h : ∃ x : 𝕜, x ≠ 0 ∧ ‖x‖ ≠ 1) : NontriviallyNormedField 𝕜 where toNormedField := h' @@ -355,7 +355,7 @@ end SubfieldClass namespace AbsoluteValue /-- A real absolute value on a field determines a `NormedField` structure. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def toNormedField {K : Type*} [Field K] (v : AbsoluteValue K ℝ) : NormedField K where toField := inferInstanceAs (Field K) __ := v.toNormedRing diff --git a/Mathlib/Analysis/Normed/Group/AddTorsor.lean b/Mathlib/Analysis/Normed/Group/AddTorsor.lean index 122ad1e7fed0f0..c03419538b56e0 100644 --- a/Mathlib/Analysis/Normed/Group/AddTorsor.lean +++ b/Mathlib/Analysis/Normed/Group/AddTorsor.lean @@ -181,7 +181,7 @@ theorem edist_vsub_vsub_le (p₁ p₂ p₃ p₄ : P) : /-- The pseudodistance defines a pseudometric space structure on the torsor. This is not an instance because it depends on `V` to define a `MetricSpace P`. -/ -@[implicit_reducible] +@[instance_reducible] def pseudoMetricSpaceOfNormedAddCommGroupOfAddTorsor (V P : Type*) [SeminormedAddCommGroup V] [AddTorsor V P] : PseudoMetricSpace P where dist x y := ‖(x -ᵥ y : V)‖ @@ -193,7 +193,7 @@ def pseudoMetricSpaceOfNormedAddCommGroupOfAddTorsor (V P : Type*) [SeminormedAd /-- The distance defines a metric space structure on the torsor. This is not an instance because it depends on `V` to define a `MetricSpace P`. -/ -@[implicit_reducible] +@[instance_reducible] def metricSpaceOfNormedAddCommGroupOfAddTorsor (V P : Type*) [NormedAddCommGroup V] [AddTorsor V P] : MetricSpace P where dist x y := ‖(x -ᵥ y : V)‖ diff --git a/Mathlib/Analysis/Normed/Group/FunctionSeries.lean b/Mathlib/Analysis/Normed/Group/FunctionSeries.lean index 73ea32348fd936..1f06c0253eddc4 100644 --- a/Mathlib/Analysis/Normed/Group/FunctionSeries.lean +++ b/Mathlib/Analysis/Normed/Group/FunctionSeries.lean @@ -51,6 +51,7 @@ theorem tendstoUniformlyOn_tsum_nat {f : ℕ → β → F} {u : ℕ → ℝ} (hu s := fun v hv => tendsto_finset_range.eventually (tendstoUniformlyOn_tsum hu hfu v hv) +set_option backward.isDefEq.respectTransparency false in /-- An infinite sum of functions with eventually summable sup norm is the uniform limit of its partial sums. Version relative to a set, with general index set. -/ theorem tendstoUniformlyOn_tsum_of_cofinite_eventually {ι : Type*} {f : ι → β → F} {u : ι → ℝ} diff --git a/Mathlib/Analysis/Normed/Group/Quotient.lean b/Mathlib/Analysis/Normed/Group/Quotient.lean index a2be9239e6f3e8..f6b40a8b9e5163 100644 --- a/Mathlib/Analysis/Normed/Group/Quotient.lean +++ b/Mathlib/Analysis/Normed/Group/Quotient.lean @@ -300,6 +300,7 @@ theorem ker_normedMk (S : AddSubgroup M) : S.normedMk.ker = S := theorem norm_normedMk_le (S : AddSubgroup M) : ‖S.normedMk‖ ≤ 1 := NormedAddGroupHom.opNorm_le_bound _ zero_le_one fun m => by simp [norm_mk_le_norm] +set_option backward.isDefEq.respectTransparency.types false in theorem _root_.QuotientAddGroup.norm_lift_apply_le {S : AddSubgroup M} (f : NormedAddGroupHom M N) (hf : ∀ x ∈ S, f x = 0) (x : M ⧸ S) : ‖lift S f.toAddMonoidHom hf x‖ ≤ ‖f‖ * ‖x‖ := by cases (norm_nonneg f).eq_or_lt' with diff --git a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean index 2af2a8e852a39a..ca4248685aafdf 100644 --- a/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean +++ b/Mathlib/Analysis/Normed/Group/SemiNormedGrp/Kernels.lean @@ -36,6 +36,7 @@ namespace SemiNormedGrp₁ noncomputable section +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `HasCokernels SemiNormedGrp₁`. -/ def cokernelCocone {X Y : SemiNormedGrp₁.{u}} (f : X ⟶ Y) : Cofork f 0 := Cofork.ofπ @@ -48,6 +49,7 @@ def cokernelCocone {X Y : SemiNormedGrp₁.{u}} (f : X ⟶ Y) : Cofork f 0 := f.hom.1.mem_range] use x) +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `HasCokernels SemiNormedGrp₁`. -/ def cokernelLift {X Y : SemiNormedGrp₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) : (cokernelCocone f).pt ⟶ s.pt := by @@ -60,6 +62,7 @@ def cokernelLift {X Y : SemiNormedGrp₁.{u}} (f : X ⟶ Y) (s : CokernelCofork -- The lift has norm at most one: exact NormedAddGroupHom.lift_normNoninc _ _ _ s.π.2 +set_option backward.isDefEq.respectTransparency.types false in instance : HasCokernels SemiNormedGrp₁.{u} where has_colimit f := HasColimit.mk @@ -211,6 +214,7 @@ theorem explicitCokernelπ_desc_apply {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y} {cond : f ≫ g = 0} (x : Y) : explicitCokernelDesc cond (explicitCokernelπ f x) = g x := show (explicitCokernelπ f ≫ explicitCokernelDesc cond) x = g x by rw [explicitCokernelπ_desc] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem explicitCokernelDesc_unique {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y} {g : Y ⟶ Z} (w : f ≫ g = 0) (e : explicitCokernel f ⟶ Z) (he : explicitCokernelπ f ≫ e = g) : diff --git a/Mathlib/Analysis/Normed/Lp/PiLp.lean b/Mathlib/Analysis/Normed/Lp/PiLp.lean index 558b4a00548e99..5c427b5086ece8 100644 --- a/Mathlib/Analysis/Normed/Lp/PiLp.lean +++ b/Mathlib/Analysis/Normed/Lp/PiLp.lean @@ -416,6 +416,7 @@ def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where attribute [local instance] PiLp.pseudoEmetricAux +set_option backward.isDefEq.respectTransparency false in /-- An auxiliary lemma used twice in the proof of `PiLp.pseudoMetricAux` below. Not intended for use outside this file. -/ theorem iSup_edist_ne_top_aux {ι : Type*} [Finite ι] {α : ι → Type*} @@ -750,6 +751,7 @@ theorem norm_eq_of_nat {p : ℝ≥0∞} [Fact (1 ≤ p)] {β : ι → Type*} section L1 variable {β} [∀ i, SeminormedAddCommGroup (β i)] +set_option backward.isDefEq.respectTransparency false in theorem norm_eq_of_L1 (x : PiLp 1 β) : ‖x‖ = ∑ i : ι, ‖x i‖ := by simp [norm_eq_sum] @@ -762,6 +764,7 @@ theorem dist_eq_of_L1 (x y : PiLp 1 β) : dist x y = ∑ i, dist (x i) (y i) := theorem nndist_eq_of_L1 (x y : PiLp 1 β) : nndist x y = ∑ i, nndist (x i) (y i) := NNReal.eq <| by push_cast; exact dist_eq_of_L1 _ _ +set_option backward.isDefEq.respectTransparency false in theorem edist_eq_of_L1 (x y : PiLp 1 β) : edist x y = ∑ i, edist (x i) (y i) := by simp [PiLp.edist_eq_sum] diff --git a/Mathlib/Analysis/Normed/Lp/ProdLp.lean b/Mathlib/Analysis/Normed/Lp/ProdLp.lean index c48b16bc11de1b..b2b59366c4fcf6 100644 --- a/Mathlib/Analysis/Normed/Lp/ProdLp.lean +++ b/Mathlib/Analysis/Normed/Lp/ProdLp.lean @@ -769,6 +769,7 @@ theorem prod_nnnorm_eq_sup (f : WithLp ∞ (α × β)) : ‖f‖₊ = ‖f.fst section L1 +set_option backward.isDefEq.respectTransparency false in theorem prod_norm_eq_of_L1 (x : WithLp 1 (α × β)) : ‖x‖ = ‖x.fst‖ + ‖x.snd‖ := by simp [prod_norm_eq_add] @@ -789,6 +790,7 @@ theorem prod_nndist_eq_of_L1 (x y : WithLp 1 (α × β)) : push_cast exact prod_dist_eq_of_L1 _ _ +set_option backward.isDefEq.respectTransparency false in theorem prod_edist_eq_of_L1 (x y : WithLp 1 (α × β)) : edist x y = edist x.fst y.fst + edist x.snd y.snd := by simp [prod_edist_eq_add] diff --git a/Mathlib/Analysis/Normed/Lp/lpSpace.lean b/Mathlib/Analysis/Normed/Lp/lpSpace.lean index 2d8a941d12501b..f37534536696d0 100644 --- a/Mathlib/Analysis/Normed/Lp/lpSpace.lean +++ b/Mathlib/Analysis/Normed/Lp/lpSpace.lean @@ -720,6 +720,7 @@ section Sum variable {E : Type*} [NormedAddCommGroup E] +set_option backward.isDefEq.respectTransparency false in lemma norm_tsum_le (f : ℓ¹(α, E)) : ‖∑' i, f i‖ ≤ ‖f‖ := calc ‖∑' i, f i‖ ≤ ∑' i, ‖f i‖ := norm_tsum_le_tsum_norm (.of_norm (by simpa using f.2.summable)) @@ -1062,6 +1063,7 @@ noncomputable def zeroBasis : Module.Basis α 𝕜 ℓ⁰(α, 𝕜) where left_inv _ := rfl right_inv _ := Finsupp.ext fun _ ↦ rfl } +set_option backward.isDefEq.respectTransparency false in lemma zeroBasis_apply (i : α) : zeroBasis i = lp.single 0 i (1 : 𝕜) := by ext; simp [zeroBasis, Finsupp.single_apply, Pi.single, Function.update, eq_comm] @@ -1259,6 +1261,7 @@ open Filter open scoped Topology uniformity +set_option backward.isDefEq.respectTransparency false in /-- The coercion from `lp E p` to `∀ i, E i` is uniformly continuous. -/ theorem uniformContinuous_coe [_i : Fact (1 ≤ p)] : UniformContinuous (α := lp E p) ((↑) : lp E p → ∀ i, E i) := diff --git a/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean b/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean index 041b21ca768536..a72e60eb3f192f 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/Homeomorph.lean @@ -139,6 +139,7 @@ theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c · rw [univBall, dif_neg hr] exact subset_univ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem univBall_apply_zero (c : P) (r : ℝ) : univBall c r 0 = c := by unfold univBall; split_ifs <;> simp diff --git a/Mathlib/Analysis/Normed/Module/Bases.lean b/Mathlib/Analysis/Normed/Module/Bases.lean index bb322bb074a2d0..6ef743dd1be44e 100644 --- a/Mathlib/Analysis/Normed/Module/Bases.lean +++ b/Mathlib/Analysis/Normed/Module/Bases.lean @@ -181,6 +181,7 @@ theorem range_proj_eq_span (A : Finset β) : use b i rw [ContinuousLinearMap.coe_coe, proj_apply_basis_mem, if_pos (Finset.mem_coe.mp hi)] +set_option backward.isDefEq.respectTransparency false in open Classical in /-- Composition of projections: `proj A (proj B x) = proj (A ∩ B) x`. -/ theorem proj_comp (A B : Finset β) (x : X) : b.proj A (b.proj B x) = b.proj (A ∩ B) x := by diff --git a/Mathlib/Analysis/Normed/Module/Basic.lean b/Mathlib/Analysis/Normed/Module/Basic.lean index af6d6e2b774a5c..78a943ebbf3bac 100644 --- a/Mathlib/Analysis/Normed/Module/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Basic.lean @@ -469,7 +469,7 @@ inferred, and because it is likely to create instance diamonds. See Note [reducible non-instances]. -/ -@[implicit_reducible] +@[instance_reducible] def NormedSpace.restrictScalars : NormedSpace 𝕜 E := { Module.restrictScalars 𝕜 𝕜' E with norm_smul_le := fun c x => @@ -491,7 +491,7 @@ instance RestrictScalars.normedSpace : NormedSpace 𝕜 (RestrictScalars 𝕜 /-- The action of the original `NormedField` on `RestrictScalars 𝕜 𝕜' E`. This is not an instance as it would be contrary to the purpose of `RestrictScalars`. -/ -@[implicit_reducible] +@[instance_reducible] def Module.RestrictScalars.normedSpaceOrig {𝕜 : Type*} {𝕜' : Type*} {E : Type*} [NormedField 𝕜'] [SeminormedAddCommGroup E] [I : NormedSpace 𝕜' E] : NormedSpace 𝕜' (RestrictScalars 𝕜 𝕜' E) := I @@ -513,7 +513,7 @@ inferred, and because it is likely to create instance diamonds. See Note [reducible non-instances]. -/ -@[implicit_reducible] +@[instance_reducible] def NormedAlgebra.restrictScalars : NormedAlgebra 𝕜 E := { NormedSpace.restrictScalars 𝕜 𝕜' E, Algebra.restrictScalars 𝕜 𝕜' E with } @@ -527,7 +527,7 @@ instance RestrictScalars.normedAlgebra : NormedAlgebra 𝕜 (RestrictScalars /-- The action of the original `NormedField` on `RestrictScalars 𝕜 𝕜' E`. This is not an instance as it would be contrary to the purpose of `RestrictScalars`. -/ -@[implicit_reducible] +@[instance_reducible] def Module.RestrictScalars.normedAlgebraOrig {𝕜 : Type*} {𝕜' : Type*} {E : Type*} [NormedField 𝕜'] [SeminormedRing E] [I : NormedAlgebra 𝕜' E] : NormedAlgebra 𝕜' (RestrictScalars 𝕜 𝕜' E) := I diff --git a/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean b/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean index 04788b4319f136..b1b63a6efd862b 100644 --- a/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean +++ b/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean @@ -202,6 +202,7 @@ variable {R E E' F F' G : Type*} [Ring R] [TopologicalSpace E] [AddCommGroup E] [Module R E] [TopologicalSpace F] [AddCommGroup F] [Module R F] {f : E →L[R] F} +set_option backward.isDefEq.respectTransparency false in /-- If `f` has a continuous left inverse, its range admits a closed complement. -/ lemma closedComplemented_range (hf : f.HasLeftInverse) : Submodule.ClosedComplemented f.range := by -- Idea of proof: let g be a left inverse for f. Then ker g is a closed subspace of F, diff --git a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean index b14a8275c13509..4913cf399ffcbc 100644 --- a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean +++ b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean @@ -334,6 +334,7 @@ theorem isOpen_setOf_affineIndependent {ι : Type*} [Finite ι] : namespace Module.Basis +set_option backward.isDefEq.respectTransparency false in theorem opNNNorm_le {ι : Type*} [Fintype ι] (v : Basis ι 𝕜 E) {u : E →L[𝕜] F} (M : ℝ≥0) (hu : ∀ i, ‖u (v i)‖₊ ≤ M) : ‖u‖₊ ≤ Fintype.card ι • ‖v.equivFunL.toContinuousLinearMap‖₊ * M := u.opNNNorm_le_bound _ fun e => by diff --git a/Mathlib/Analysis/Normed/Module/HahnBanach.lean b/Mathlib/Analysis/Normed/Module/HahnBanach.lean index 3156ea842be1cd..0ff3f00edaf6a4 100644 --- a/Mathlib/Analysis/Normed/Module/HahnBanach.lean +++ b/Mathlib/Analysis/Normed/Module/HahnBanach.lean @@ -105,6 +105,7 @@ theorem exists_extension_norm_eq (p : Subspace 𝕜 E) (f : StrongDual 𝕜 p) : open Module +set_option backward.isDefEq.respectTransparency.types false in /-- Corollary of the **Hahn-Banach theorem**: if `f : p → F` is a continuous linear map from a submodule of a normed space `E` over `𝕜`, `𝕜 = ℝ` or `𝕜 = ℂ`, with a finite-dimensional range, then `f` admits an extension to a continuous linear map `E → F`. diff --git a/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean b/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean index 6ee1cf8378902f..cd2b38bb687460 100644 --- a/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean @@ -924,6 +924,7 @@ theorem norm_compContinuousMultilinearMap_le (g : G →L[𝕜] G') (f : Continuo ‖g (f m)‖ ≤ ‖g‖ * (‖f‖ * ∏ i, ‖m i‖) := g.le_opNorm_of_le <| f.le_opNorm _ _ = _ := (mul_assoc _ _ _).symm +set_option backward.isDefEq.respectTransparency false in /-- Flip arguments in `f : G →L[𝕜] ContinuousMultilinearMap 𝕜 E G'` to get `ContinuousMultilinearMap 𝕜 E (G →L[𝕜] G')` -/ @[simps! apply_apply] diff --git a/Mathlib/Analysis/Normed/Module/Multilinear/Curry.lean b/Mathlib/Analysis/Normed/Module/Multilinear/Curry.lean index 14e5230d77ab1b..6e759e7d578086 100644 --- a/Mathlib/Analysis/Normed/Module/Multilinear/Curry.lean +++ b/Mathlib/Analysis/Normed/Module/Multilinear/Curry.lean @@ -137,6 +137,7 @@ theorem ContinuousMultilinearMap.uncurry_curryLeft (f : ContinuousMultilinearMap variable (𝕜 Ei G) +set_option backward.isDefEq.respectTransparency false in /-- The space of continuous multilinear maps on `Π(i : Fin (n+1)), E i` is canonically isomorphic to the space of continuous linear maps from `E 0` to the space of continuous multilinear maps on `Π(i : Fin n), E i.succ`, by separating the first variable. We register this isomorphism in @@ -204,6 +205,7 @@ theorem ContinuousMultilinearMap.uncurryRight_apply (m : ∀ i, Ei i) : f.uncurryRight m = f (init m) (m (last n)) := rfl +set_option backward.isDefEq.respectTransparency false in /-- Given a continuous multilinear map `f` in `n+1` variables, split the last variable to obtain a continuous multilinear map in `n` variables into continuous linear maps, given by `m ↦ (x ↦ f (snoc m x))`. -/ @@ -244,6 +246,7 @@ theorem ContinuousMultilinearMap.uncurry_curryRight (f : ContinuousMultilinearMa variable (𝕜 Ei G) +set_option backward.isDefEq.respectTransparency false in /-- The space of continuous multilinear maps on `Π(i : Fin (n+1)), Ei i` is canonically isomorphic to the space of continuous multilinear maps on `Π(i : Fin n), Ei <| castSucc i` with values in the @@ -362,6 +365,7 @@ theorem ContinuousMultilinearMap.uncurryMid_curryMid (p : Fin (n + 1)) variable (𝕜 Ei G) +set_option backward.isDefEq.respectTransparency false in /-- `ContinuousMultilinearMap.curryMid` as a linear isometry equivalence. -/ @[simps! apply symm_apply] def ContinuousMultilinearMap.curryMidEquiv (p : Fin (n + 1)) : @@ -576,6 +580,7 @@ theorem uncurrySum_apply (f : ContinuousMultilinearMap 𝕜 (fun _ : ι => G) variable (𝕜 ι ι' G G') +set_option backward.isDefEq.respectTransparency false in /-- Linear isometric equivalence between the space of continuous multilinear maps with variables indexed by `ι ⊕ ι'` and the space of continuous multilinear maps with variables indexed by `ι` taking values in the space of continuous multilinear maps with variables indexed by `ι'`. diff --git a/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean b/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean index 7669b31e356f1a..2ffe6ce8c147bf 100644 --- a/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean +++ b/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean @@ -138,6 +138,7 @@ theorem injectiveSeminorm_apply (x : ⨂[𝕜] i, E i) : simpa only [injectiveSeminorm, Set.coe_setOf, Set.mem_setOf_eq] using Seminorm.sSup_apply dualSeminorms_bounded +set_option backward.isDefEq.respectTransparency false in theorem norm_eval_le_injectiveSeminorm (f : ContinuousMultilinearMap 𝕜 E F) (x : ⨂[𝕜] i, E i) : ‖lift f.toMultilinearMap x‖ ≤ ‖f‖ * injectiveSeminorm x := by /- If `F` were in `Type (max uι u𝕜 uE)` (which is the type of `⨂[𝕜] i, E i`), then the @@ -222,6 +223,7 @@ noncomputable instance : NormedSpace 𝕜 (⨂[𝕜] i, E i) := ⟨projectiveSem variable (𝕜 E F) +set_option backward.isDefEq.respectTransparency false in /-- The linear equivalence between `ContinuousMultilinearMap 𝕜 E F` and `(⨂[𝕜] i, Eᵢ) →L[𝕜] F` induced by `PiTensorProduct.lift`, for every normed space `F`. -/ @@ -251,6 +253,7 @@ noncomputable def liftIsometry : ContinuousMultilinearMap 𝕜 E F ≃ₗᵢ[ variable {𝕜 E F} +set_option backward.isDefEq.respectTransparency false in -- API missing for `LinearIsometryEquiv.ofBounds`? @[simp] theorem liftIsometry_apply_apply (f : ContinuousMultilinearMap 𝕜 E F) (x : ⨂[𝕜] i, E i) : diff --git a/Mathlib/Analysis/Normed/Module/WeakDual.lean b/Mathlib/Analysis/Normed/Module/WeakDual.lean index 857a24373b9937..8e877ef4927e6a 100644 --- a/Mathlib/Analysis/Normed/Module/WeakDual.lean +++ b/Mathlib/Analysis/Normed/Module/WeakDual.lean @@ -168,6 +168,7 @@ map. -/ def continuousLinearMapToWeakDual : StrongDual 𝕜 E →L[𝕜] WeakDual 𝕜 E := { StrongDual.toWeakDual with } +set_option backward.isDefEq.respectTransparency false in /-- The weak-star topology is coarser than the dual-norm topology. -/ theorem dual_norm_topology_le_weak_dual_topology : (UniformSpace.toTopologicalSpace : TopologicalSpace (StrongDual 𝕜 E)) ≤ diff --git a/Mathlib/Analysis/Normed/Operator/Banach.lean b/Mathlib/Analysis/Normed/Operator/Banach.lean index ba85918fe33a85..9a7e2a31d2103d 100644 --- a/Mathlib/Analysis/Normed/Operator/Banach.lean +++ b/Mathlib/Analysis/Normed/Operator/Banach.lean @@ -364,6 +364,7 @@ lemma equivRange_symm_toLinearEquiv (hinj : Injective f) (hclo : IsClosed (range (f.equivRange hinj hclo).toLinearEquiv.symm = (LinearEquiv.ofInjective f.toLinearMap hinj).symm := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma equivRange_symm_apply (hinj : Injective f) (hclo : IsClosed (range f)) (x : E) : (f.equivRange hinj hclo).symm ⟨f x, by simp⟩ = x := by diff --git a/Mathlib/Analysis/Normed/Operator/ContinuousAlgEquiv.lean b/Mathlib/Analysis/Normed/Operator/ContinuousAlgEquiv.lean index 9fd02a5ae5b174..a58781df6c59d8 100644 --- a/Mathlib/Analysis/Normed/Operator/ContinuousAlgEquiv.lean +++ b/Mathlib/Analysis/Normed/Operator/ContinuousAlgEquiv.lean @@ -34,6 +34,7 @@ variable {𝕜 V W : Type*} [NontriviallyNormedField 𝕜] [SeminormedAddCommGro [SeminormedAddCommGroup W] [NormedSpace 𝕜 V] [NormedSpace 𝕜 W] [SeparatingDual 𝕜 V] [SeparatingDual 𝕜 W] +set_option backward.isDefEq.respectTransparency.types false in /-- This is the continuous version of `AlgEquiv.eq_linearEquivConjAlgEquiv`. -/ public theorem ContinuousAlgEquiv.eq_continuousLinearEquivConjContinuousAlgEquiv (f : (V →L[𝕜] V) ≃A[𝕜] (W →L[𝕜] W)) : @@ -151,6 +152,7 @@ end auxiliaryDefs open ComplexOrder +set_option backward.isDefEq.respectTransparency.types false in /-- The ⋆-algebra equivalence version of `ContinuousAlgEquiv.eq_continuousLinearEquivConjContinuousAlgEquiv`. diff --git a/Mathlib/Analysis/Normed/Operator/Extend.lean b/Mathlib/Analysis/Normed/Operator/Extend.lean index aba5c6cf788421..b81e86d2b8f972 100644 --- a/Mathlib/Analysis/Normed/Operator/Extend.lean +++ b/Mathlib/Analysis/Normed/Operator/Extend.lean @@ -246,6 +246,7 @@ variable [NormedDivisionRing 𝕜] [NormedDivisionRing 𝕜₂] variable {σ₁₂ : 𝕜 →+* 𝕜₂} {σ₂₁ : 𝕜₂ →+* 𝕜} [RingHomInvPair σ₁₂ σ₂₁] [RingHomInvPair σ₂₁ σ₁₂] variable (f : E ≃ₛₗ[σ₁₂] F) (e₁ : E →ₗ[𝕜] Eₗ) (e₂ : F →ₗ[𝕜₂] Fₗ) +set_option backward.isDefEq.respectTransparency false in /-- Extension of a linear equivalence `f : E ≃ₛₗ[σ₁₂] F` to a continuous linear equivalence `Eₗ ≃SL[σ₁₂] Fₗ`, where `E` and `F` are normed spaces and `Eₗ` and `Fₗ` are Banach spaces, using dense maps `e₁ : E →ₗ[𝕜₁] Eₗ` and `e₂ : F →ₗ[𝕜₂] F₂` together with bounds diff --git a/Mathlib/Analysis/Normed/Ring/Basic.lean b/Mathlib/Analysis/Normed/Ring/Basic.lean index 11cf61cac3956f..dd4151503470ed 100644 --- a/Mathlib/Analysis/Normed/Ring/Basic.lean +++ b/Mathlib/Analysis/Normed/Ring/Basic.lean @@ -912,7 +912,7 @@ end SubringClass namespace AbsoluteValue /-- A real absolute value on a ring determines a `NormedRing` structure. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def toNormedRing {R : Type*} [Ring R] (v : AbsoluteValue R ℝ) : NormedRing R where norm := v dist x y := v (-x + y) diff --git a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean index 25ddf12a0d5810..7080d0be02ad99 100644 --- a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean +++ b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean @@ -97,6 +97,7 @@ theorem norm_isNonarchimedean (hna : IsNonarchimedean (Norm.norm : K → ℝ)) : · exact le_max_of_le_left (le_trans hx (norm_repr_le_norm B ixy)) · exact le_max_of_le_right (le_trans hy (norm_repr_le_norm B ixy)) +set_option backward.isDefEq.respectTransparency false in /-- For any `K`-basis of `L`, `B.norm` is bounded with respect to multiplication. That is, `∃ (c : ℝ), c > 0` such that ` ∀ (x y : L), B.norm (x * y) ≤ c * B.norm x * B.norm y`. -/ theorem norm_mul_le_const_mul_norm {i : ι} (hBi : B i = (1 : L)) diff --git a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean index 4151c59566afd8..d9daff0854e6b5 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean @@ -285,6 +285,7 @@ theorem norm_root_le_spectralValue {f : AlgebraNorm K L} (hf_pm : IsPowMul f) open Multiset +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` is a nonarchimedean, power-multiplicative `K`-algebra norm on `L`, then the spectral value of a polynomial `p : K[X]` that decomposes into linear factors in `L` is equal to the maximum of the norms of the roots. See [S. Bosch, U. Güntzer, R. Remmert, *Non-Archimedean Analysis* @@ -689,6 +690,11 @@ universe u v variable {K : Type u} [NontriviallyNormedField K] {L : Type v} [Field L] [Algebra K L] [Algebra.IsAlgebraic K L] [hu : IsUltrametricDist K] +set_option allowUnsafeReducibility true + +-- `E` and `K⟮x⟯` are distinguished by `id`, which has been made `instance_reducible` in core. +-- TODO: Make `id` only `implicit_reducible` in Core. +attribute [local implicit_reducible] id in /-- If `K` is a field complete with respect to a nontrivial nonarchimedean multiplicative norm and `L/K` is an algebraic extension, then any power-multiplicative `K`-algebra norm on `L` coincides with the spectral norm. -/ @@ -846,7 +852,7 @@ namespace spectralNorm variable (K L) /-- `L` with the spectral norm is a `NormedField`. -/ -@[implicit_reducible] +@[instance_reducible] def normedField : NormedField L := { (inferInstance : Field L) with norm x := (spectralNorm K L x : ℝ) @@ -865,7 +871,7 @@ def normedField : NormedField L := edist_dist x y := by rw [ENNReal.ofReal_eq_coe_nnreal] } /-- `L` with the spectral norm is a `NontriviallyNormedField`. -/ -@[implicit_reducible] +@[instance_reducible] def nontriviallyNormedField : NontriviallyNormedField L where __ := spectralNorm.normedField K L non_trivial := @@ -873,25 +879,25 @@ def nontriviallyNormedField : NontriviallyNormedField L where ⟨algebraMap K L x, hx.trans_eq <| (spectralNorm_extends _).symm⟩ /-- `L` with the spectral norm is a `SeminormedRing`. -/ -@[implicit_reducible] +@[instance_reducible] def seminormedRing : SeminormedRing L := by letI : NormedField L := normedField K L infer_instance /-- `L` with the spectral norm is a `NormedAddCommGroup`. -/ -@[implicit_reducible] +@[instance_reducible] def normedAddCommGroup : NormedAddCommGroup L := by haveI : NormedField L := normedField K L infer_instance /-- `L` with the spectral norm is a `SeminormedAddCommGroup`. -/ -@[implicit_reducible] +@[instance_reducible] def seminormedAddCommGroup : SeminormedAddCommGroup L := by have : NormedField L := normedField K L infer_instance /-- `L` with the spectral norm is a `NormedSpace` over `K`. -/ -@[implicit_reducible] +@[instance_reducible] def normedSpace : @NormedSpace K L _ (seminormedAddCommGroup K L) := letI _ := seminormedAddCommGroup K L { (inferInstance : Module K L) with @@ -900,7 +906,7 @@ def normedSpace : @NormedSpace K L _ (seminormedAddCommGroup K L) := exact le_of_eq (map_smul_eq_mul _ _ _) } /-- `L` with the spectral norm is a `NormedAlgebra` over `K`. -/ -@[implicit_reducible] +@[instance_reducible] def normedAlgebra : @NormedAlgebra K L _ (seminormedRing K L) := letI _ := normedField K L @@ -908,7 +914,7 @@ def normedAlgebra : /-- `L` with the spectral norm is a `NormedAlgebra` over any intermediate `E` that is a normed algebra over `K`. -/ -@[implicit_reducible] +@[instance_reducible] def normedAlgebra' (E L : Type*) [Field L] [Algebra K L] [Algebra.IsAlgebraic K L] [NormedField E] [NormedAlgebra K E] [Algebra E L] [IsScalarTower K E L] : @NormedAlgebra E L _ (seminormedRing K L) := @@ -923,11 +929,11 @@ def normedAlgebra' (E L : Type*) [Field L] [Algebra K L] [Algebra.IsAlgebraic K exact Or.inl <| (spectralNorm.eq_of_tower _).symm } /-- The metric space structure on `L` induced by the spectral norm. -/ -@[implicit_reducible] +@[instance_reducible] def metricSpace : MetricSpace L := (normedField K L).toMetricSpace /-- The uniform space structure on `L` induced by the spectral norm. -/ -@[implicit_reducible] +@[instance_reducible] def uniformSpace : UniformSpace L := (metricSpace K L).toUniformSpace /-- If `L/K` is finite dimensional, then `L` is a complete space with respect to topology induced diff --git a/Mathlib/Analysis/RCLike/Basic.lean b/Mathlib/Analysis/RCLike/Basic.lean index 40070b08a30ae9..6c39eda56d0406 100644 --- a/Mathlib/Analysis/RCLike/Basic.lean +++ b/Mathlib/Analysis/RCLike/Basic.lean @@ -1283,7 +1283,7 @@ instance (priority := 100) (𝕜 : Type*) [h : RCLike 𝕜] : IsRCLikeNormedFiel /-- A copy of an `RCLike` field in which the `NormedField` field is adjusted to be become defeq to a propeq one. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def RCLike.copy_of_normedField {𝕜 : Type*} (h : RCLike 𝕜) (hk : NormedField 𝕜) (h'' : hk = h.toNormedField) : RCLike 𝕜 where __ := hk @@ -1327,7 +1327,7 @@ noncomputable def RCLike.copy_of_normedField {𝕜 : Type*} (h : RCLike 𝕜) (h /-- Given a normed field `𝕜` satisfying `IsRCLikeNormedField 𝕜`, build an associated `RCLike 𝕜` structure on `𝕜` which is definitionally compatible with the given normed field structure. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsRCLikeNormedField.rclike (𝕜 : Type*) [hk : NormedField 𝕜] [h : IsRCLikeNormedField 𝕜] : RCLike 𝕜 := by choose p hp using h.out @@ -1360,6 +1360,7 @@ theorem symm_smul_apply (e : V ≃ₗᵢ[𝕜] W) (α : unitary 𝕜) (x : W) : @[simp] theorem toContinuousLinearEquiv_smul (e : G ≃ₗᵢ[𝕜] W) (α : unitary 𝕜) : (α • e).toContinuousLinearEquiv = Unitary.toUnits α • e.toContinuousLinearEquiv := rfl +set_option backward.isDefEq.respectTransparency false in theorem smul_trans (α : unitary 𝕜) (e : V ≃ₗᵢ[𝕜] G) (f : G ≃ₗᵢ[𝕜] W) : (α • e).trans f = α • (e.trans f) := by ext; simp diff --git a/Mathlib/Analysis/RCLike/BoundedContinuous.lean b/Mathlib/Analysis/RCLike/BoundedContinuous.lean index 4570eefe1e7e14..67fb0f2c0dc5f2 100644 --- a/Mathlib/Analysis/RCLike/BoundedContinuous.lean +++ b/Mathlib/Analysis/RCLike/BoundedContinuous.lean @@ -22,6 +22,7 @@ variable (𝕜 E : Type*) [RCLike 𝕜] [PseudoEMetricSpace E] namespace RCLike +set_option backward.isDefEq.respectTransparency false in /-- On a star subalgebra of bounded continuous functions, the operations "restrict scalars to ℝ" and "forget that a bounded continuous function is a bounded" commute. -/ theorem restrict_toContinuousMap_eq_toContinuousMapStar_restrict diff --git a/Mathlib/Analysis/RCLike/ContinuousMap.lean b/Mathlib/Analysis/RCLike/ContinuousMap.lean index 707ecca8a0a459..0ccede3a32df44 100644 --- a/Mathlib/Analysis/RCLike/ContinuousMap.lean +++ b/Mathlib/Analysis/RCLike/ContinuousMap.lean @@ -32,6 +32,7 @@ variable {X : Type*} (𝕜 : Type*) [TopologicalSpace X] [RCLike 𝕜] open ComplexOrder +set_option backward.isDefEq.respectTransparency.types false in variable (X) in /-- `ContinuousMap.realToRCLike` as an order embedding. -/ @[simps] def realToRCLikeOrderEmbedding : C(X, ℝ) ↪o C(X, 𝕜) where diff --git a/Mathlib/Analysis/RCLike/Sqrt.lean b/Mathlib/Analysis/RCLike/Sqrt.lean index 9d7020a0061a07..020ba6d6ebe0bd 100644 --- a/Mathlib/Analysis/RCLike/Sqrt.lean +++ b/Mathlib/Analysis/RCLike/Sqrt.lean @@ -82,6 +82,7 @@ theorem RCLike.re_sqrt_ofReal {a : ℝ} : @[simp] theorem RCLike.sqrt_complex {a : ℂ} : sqrt a = a.sqrt := by simp [sqrt] +set_option backward.isDefEq.respectTransparency false in theorem Complex.sqrt_of_nonneg {a : ℂ} (ha : 0 ≤ a) : a.sqrt = √a.re := by obtain ⟨α : ℝ, hα, rfl⟩ := RCLike.nonneg_iff_exists_ofReal.mp ha diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean index 6bca65ccb25844..5909229620dde1 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Circle.lean @@ -173,6 +173,7 @@ lemma coe_path (x y : Circle) : (path x y : _ → _) = ext t rw [path_apply, comp_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma path_self (x : Circle) : path x x = Path.refl x := by ext a diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean b/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean index 4f8e207c7027df..c547e9ed5e1b90 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/CircleAddChar.lean @@ -82,6 +82,7 @@ lemma injective_toCircle : Injective (toCircle : ZMod N → Circle) := /-- The additive character from `ZMod N` to `ℂ`, sending `j mod N` to `exp (2 * π * I * j / N)`. -/ noncomputable def stdAddChar : AddChar (ZMod N) ℂ := Circle.coeHom.compAddChar toCircle +set_option backward.isDefEq.respectTransparency.types false in lemma stdAddChar_coe (j : ℤ) : stdAddChar (j : ZMod N) = exp (2 * π * I * j / N) := by simp [stdAddChar, toCircle_intCast] diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/ConjSqrt.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/ConjSqrt.lean index b9c6cf68f86e3b..e131ea82eab34b 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/ConjSqrt.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/ConjSqrt.lean @@ -27,25 +27,31 @@ variable {A : Type*} [PartialOrder A] [Ring A] [StarRing A] [TopologicalSpace A] [StarOrderedRing A] [Algebra ℝ A] [ContinuousFunctionalCalculus ℝ A IsSelfAdjoint] [NonnegSpectrumClass ℝ A] [SeparatelyContinuousMul A] +set_option backward.isDefEq.respectTransparency.types false in /-- Conjugation by the square root of an element, i.e. `sqrt c * a * sqrt c`. -/ @[expose] noncomputable def conjSqrt (c : A) : A →L[ℝ] A where toLinearMap := .mulLeftRight ℝ (sqrt c, sqrt c) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toLinearMap_conjSqrt (c : A) : (conjSqrt c).toLinearMap = .mulLeftRight ℝ (sqrt c, sqrt c) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma conjSqrt_apply {c a : A} : conjSqrt c a = sqrt c * a * sqrt c := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma conjSqrt_of_not_nonneg {c a : A} (hc : ¬0 ≤ c) : conjSqrt c a = 0 := by simp [conjSqrt_apply, sqrt_of_not_nonneg hc] +set_option backward.isDefEq.respectTransparency.types false in lemma conjSqrt_monotone {c : A} : Monotone (conjSqrt c) := by intro a b hab by_cases hc : 0 ≤ c · exact IsSelfAdjoint.conjugate_le_conjugate hab (by cfc_tac) · simp [conjSqrt_of_not_nonneg hc] +set_option backward.isDefEq.respectTransparency.types false in @[gcongr] lemma conjSqrt_le_conjSqrt {c a b : A} (h : a ≤ b) : conjSqrt c a ≤ conjSqrt c b := conjSqrt_monotone h @@ -61,6 +67,7 @@ lemma isStrictlyPositive_conjSqrt_iff (c a : A) (hc : IsStrictlyPositive c := by rw [conjSqrt_apply] by_cases ha : IsSelfAdjoint a <;> grind +set_option backward.isDefEq.respectTransparency.types false in @[grind _=_] lemma ringInverse_conjSqrt (c a : A) (hc : IsStrictlyPositive c := by cfc_tac) : (conjSqrt c a)⁻¹ʳ = conjSqrt c⁻¹ʳ a⁻¹ʳ := by @@ -69,6 +76,7 @@ lemma ringInverse_conjSqrt (c a : A) (hc : IsStrictlyPositive c := by cfc_tac) : · have : ¬IsUnit (conjSqrt c a) := by grind [conjSqrt_apply, IsUnit.mul_left_iff] simp [inverse_non_unit a ha, inverse_non_unit _ this] +set_option backward.isDefEq.respectTransparency.types false in @[grind =] lemma conjSqrt_ringInverse_conjSqrt (c a : A) (hc : IsStrictlyPositive c := by cfc_tac) : conjSqrt c⁻¹ʳ (conjSqrt c a) = a := by @@ -78,15 +86,18 @@ lemma conjSqrt_ringInverse_conjSqrt (c a : A) (hc : IsStrictlyPositive c := by c have : Commute (sqrt c) (sqrt c⁻¹ʳ) finish +set_option backward.isDefEq.respectTransparency.types false in @[grind =] lemma conjSqrt_conjSqrt_ringInverse (c a : A) (hc : IsStrictlyPositive c := by cfc_tac) : conjSqrt c (conjSqrt c⁻¹ʳ a) = a := by grind [conjSqrt_ringInverse_conjSqrt _ _ hc.ringInverse] +set_option backward.isDefEq.respectTransparency.types false in @[grind =] lemma conjSqrt_one (c : A) (hc : 0 ≤ c := by cfc_tac) : conjSqrt c 1 = c := by rw [conjSqrt_apply, mul_one, sqrt_mul_sqrt_self _] +set_option backward.isDefEq.respectTransparency.types false in @[grind =] lemma conjSqrt_ringInverse_self (c : A) (hc : IsStrictlyPositive c := by cfc_tac) : conjSqrt c⁻¹ʳ c = 1 := by diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean index a71d901bf60852..68831f3a9c20ca 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean @@ -58,6 +58,10 @@ open scoped NNReal Topology namespace Real +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Set + /-- Integrand for representing `x ↦ x ^ p` for `p ∈ (0,1)` -/ noncomputable def rpowIntegrand₀₁ (p t x : ℝ) : ℝ := t ^ p * (t⁻¹ - (t + x)⁻¹) diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/RingInverseOrder.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/RingInverseOrder.lean index 5a8472a75f3e13..e4d1cd71be4cf9 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/RingInverseOrder.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/RingInverseOrder.lean @@ -99,6 +99,7 @@ public lemma convexOn_ringInverse : _ = _ := by rw [← ringInverse_conjSqrt _ _ xpos, conjSqrt_conjSqrt_ringInverse _ _ xpos] +set_option backward.isDefEq.respectTransparency.types false in public lemma convexOn_ringInverse_algebraMap_add {t : ℝ} (ht : 0 < t) : ConvexOn ℝ (Ici (0 : A)) (fun x : A => Ring.inverse (algebraMap ℝ A t + x)) := by have : ∀ x ∈ Ici (0 : A), IsStrictlyPositive (algebraMap ℝ A t + x) := by grind diff --git a/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean b/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean index e94989b067b09d..93b8f5a7848784 100644 --- a/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean +++ b/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean @@ -644,6 +644,7 @@ lemma coeff_weierstrassPExceptSeries (l₀ x : ℂ) (i : ℕ) : simp [h₁, tsum_mul_left, sumInvPow, add_assoc, one_add_one_eq_two, ← zpow_natCast, -neg_add_rev] +set_option backward.isDefEq.respectTransparency.types false in /-- In the power series expansion of `℘(z) = ∑ᵢ aᵢ (z - x)ⁱ` at some `x ∉ L`, each `aᵢ` can be written as a sum over `l ∈ L`, i.e. diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean index 0a67f28fa8aa8e..153c9c437e1ecf 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean @@ -331,6 +331,7 @@ theorem integral_cexp_neg_mul_sq_norm (hb : 0 < b.re) : ∫ v : V, cexp (-b * ‖v‖ ^ 2) = (π / b) ^ (Module.finrank ℝ V / 2 : ℂ) := by simpa using integral_cexp_neg_mul_sq_norm_add hb 0 (0 : V) +set_option backward.isDefEq.respectTransparency.types false in theorem integral_rexp_neg_mul_sq_norm {b : ℝ} (hb : 0 < b) : ∫ v : V, rexp (-b * ‖v‖ ^ 2) = (π / b) ^ (Module.finrank ℝ V / 2 : ℝ) := by rw [← ofReal_inj] diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean index 04ddb94fdc1d91..8cb5498dbd1a06 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean @@ -52,6 +52,7 @@ theorem log_of_pos (hx : 0 < x) : log x = expOrderIso.symm ⟨x, hx⟩ := by congr exact abs_of_pos hx +set_option backward.isDefEq.respectTransparency false in theorem exp_log_eq_abs (hx : x ≠ 0) : exp (log x) = |x| := by rw [log_of_ne_zero hx, ← coe_expOrderIso_apply, OrderIso.apply_symm_apply, Subtype.coe_mk] diff --git a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean index f1733727682ffd..fc408708586741 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLogExp.lean @@ -72,6 +72,7 @@ end Exp namespace ENNReal section OrderIso +set_option backward.isDefEq.respectTransparency false in /-- `ENNReal.log` and its inverse `EReal.exp` are an order isomorphism between `ℝ≥0∞` and `EReal`. -/ noncomputable diff --git a/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean b/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean index 2fb877b7f71693..e6ed5f29c95a8d 100644 --- a/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean +++ b/Mathlib/Analysis/SpecialFunctions/Sigmoid.lean @@ -252,6 +252,7 @@ lemma sigmoid_neg (x : ℝ) : sigmoid (-x) = σ (sigmoid x) := by ext exact Real.sigmoid_neg x +set_option backward.isDefEq.respectTransparency false in open Set in lemma range_sigmoid : range unitInterval.sigmoid = Ioo 0 1 := by rw [sigmoid, Subtype.range_coind, Real.range_sigmoid] diff --git a/Mathlib/Analysis/SumOverResidueClass.lean b/Mathlib/Analysis/SumOverResidueClass.lean index b29da2f5d98ff7..c389b80cef8375 100644 --- a/Mathlib/Analysis/SumOverResidueClass.lean +++ b/Mathlib/Analysis/SumOverResidueClass.lean @@ -28,6 +28,7 @@ lemma Finset.sum_indicator_mod {R : Type*} [AddCommMonoid R] (m : ℕ) [NeZero m simp only [Finset.sum_apply, Set.indicator_apply, Set.mem_setOf_eq, Finset.sum_ite_eq, Finset.mem_univ, ↓reduceIte] +set_option backward.isDefEq.respectTransparency false in open Set in /-- A sequence `f` with values in an additive topological group `R` is summable on the residue class of `k` mod `m` if and only if `f (m*n + k)` is summable. -/ @@ -99,6 +100,7 @@ lemma summable_indicator_mod_iff {m : ℕ} [NeZero m] {f : ℕ → ℝ} (hf : An open ZMod +set_option backward.isDefEq.respectTransparency false in /-- If `f` is a summable function on `ℕ`, and `0 < N`, then we may compute `∑' n : ℕ, f n` by summing each residue class mod `N` separately. -/ lemma Nat.sumByResidueClasses {R : Type*} [AddCommGroup R] [UniformSpace R] [IsUniformAddGroup R] diff --git a/Mathlib/CategoryTheory/Abelian/Basic.lean b/Mathlib/CategoryTheory/Abelian/Basic.lean index e0cc2843fb1d57..a39c408b3aacb0 100644 --- a/Mathlib/CategoryTheory/Abelian/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Basic.lean @@ -255,7 +255,7 @@ in which the coimage-image comparison morphism is always an isomorphism, is an abelian category. -/ @[stacks 0109 "The Stacks project uses this characterisation at the definition of an abelian category.", - implicit_reducible] + instance_reducible] def ofCoimageImageComparisonIsIso : Abelian C where end CategoryTheory.Abelian @@ -818,7 +818,7 @@ namespace CategoryTheory.NonPreadditiveAbelian variable (C : Type u) [Category.{v} C] [NonPreadditiveAbelian C] /-- Every `NonPreadditiveAbelian` category can be promoted to an abelian category. -/ -@[implicit_reducible] +@[instance_reducible] def abelian : Abelian C where toPreadditive := NonPreadditiveAbelian.preadditive normalMonoOfMono := fun f _ ↦ ⟨normalMonoOfMono f⟩ @@ -867,7 +867,7 @@ preadditive, has finite products, and that any morphism `f : X ⟶ Y` has a kernel `i : K ⟶ X`, a cokernel `p : Y ⟶ Q` such that `f` factors as `f = π ≫ ι` where `π : X ⟶ I` is a cokernel of `i` and `ι : I ⟶ Y` is a kernel of `p`. This assumption is packaged in a structure `AbelianStruct f`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def mk' [HasFiniteProducts C] (h : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), Nonempty (AbelianStruct f)) : Abelian C where diff --git a/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean b/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean index 6d2596c97b8ef8..cd7cb28b52c50d 100644 --- a/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean +++ b/Mathlib/CategoryTheory/Abelian/DiagramLemmas/KernelCokernelComp.lean @@ -185,6 +185,7 @@ noncomputable def snakeInput : ShortComplex.SnakeInput C where is the connecting homomorphism `kernel g ⟶ cokernel f`. -/ noncomputable def δ : kernel g ⟶ cokernel f := (snakeInput f g).δ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma δ_fac : δ f g = - kernel.ι g ≫ cokernel.π f := by simpa using! (snakeInput f g).δ_eq (𝟙 _) (kernel.ι g ≫ biprod.inr) (-kernel.ι g) @@ -204,6 +205,7 @@ noncomputable abbrev kernelCokernelCompSequence : ComposableArrows C 5 := (cokernel.map f (f ≫ g) (𝟙 _) g (by simp)) (cokernel.map (f ≫ g) g f (𝟙 _) (by simp)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : Mono ((kernelCokernelCompSequence f g).map' 0 1) := by dsimp; infer_instance diff --git a/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean b/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean index 5cdc78c8ab2bc6..d3d1385e919fc1 100644 --- a/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean +++ b/Mathlib/CategoryTheory/Abelian/EpiWithInjectiveKernel.lean @@ -108,7 +108,7 @@ instance : (epiWithInjectiveKernel (C := C)).IsStableUnderRetracts where let r' : Retract (kernel f') (kernel f) := { i := kernel.map _ _ r.i.left r.i.right (Arrow.w r.i).symm r := kernel.map _ _ r.r.left r.r.right (Arrow.w r.r).symm - retract := by ext; simp [dsimp% r.left.retract] } + retract := by ext; simp } exact ⟨inferInstance, r'.injective⟩ lemma epiWithInjectiveKernel.hasLiftingProperty diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean index 8e4f0f73a84f83..feb1a92b0e24a9 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean @@ -100,6 +100,7 @@ lemma HasExactColimitsOfShape.domain_of_functor {D : Type*} (J : Type*) [Categor exact Cone.ext ((preservesColimitNatIso F).symm.app _) fun i ↦ (preservesColimitNatIso F).inv.naturality _ } } } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {C} in /-- diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean index fbd04e6d1a8dd3..2097f150b0d6ef 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ColimCoyoneda.lean @@ -87,6 +87,7 @@ lemma hf (j : Under j₀) : colimit.ι (kernel (g y)) j ≫ f y = (kernel.ι (g y)).app j := (IsColimit.ι_map _ _ _ _).trans (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {y} in include hc hy in diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean index e906c11c7cf233..d237ce979c9f6a 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/EnoughInjectives.lean @@ -242,6 +242,7 @@ instance : (functor hG A₀ J).IsWellOrderContinuous where simp only [Subobject.mk_arrow] exact transfiniteIterate_limit (largerSubobject hG) A₀ m hm⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {J} in /-- For any `j`, the map `(functor hG A₀ J).map (homOfLE bot_le : ⊥ ⟶ j)` diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean index 3a26d2a81604f7..d9634c52c52c08 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/ModuleEmbedding/GabrielPopescu.lean @@ -73,6 +73,7 @@ theorem ι_d {G A : C} {M : ModuleCat (End G)ᵐᵒᵖ} (g : M ⟶ ModuleCat.of Sigma.ι _ m ≫ d g = g.hom m := by simp [d] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local instance] IsFiltered.isConnected in /-- This is the "Lemma" in [mitchell1981]. -/ diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean b/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean index 80480ea8fccd10..6462cac5b29ef4 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean @@ -267,6 +267,7 @@ lemma injectiveDimension_eq_of_iso {X Y : C} (e : X ≅ Y) : exact ⟨fun h ↦ hasInjectiveDimensionLT_of_iso e _, fun h ↦ hasInjectiveDimensionLT_of_iso e.symm _⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma Retract.injectiveDimension_le {X Y : C} (h : Retract X Y) : injectiveDimension X ≤ injectiveDimension Y := sInf_le_sInf_of_subset_insert_top (fun n hn ↦ by diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean b/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean index 0bc98d1925ba10..d703736b323876 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Resolution.lean @@ -96,6 +96,7 @@ def desc {Y Z : C} (f : Z ⟶ Y) (I : InjectiveResolution Y) (J : InjectiveResol CochainComplex.mkHom _ _ (descFZero f _ _) (descFOne f _ _) (descFOne_zero_comm f I J).symm fun n ⟨g, g', w⟩ => ⟨(descFSucc I J n g g' w.symm).1, (descFSucc I J n g g' w.symm).2.symm⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The resolution maps intertwine the descent of a morphism and that morphism. -/ @[reassoc (attr := simp)] theorem desc_commutes {Y Z : C} (f : Z ⟶ Y) (I : InjectiveResolution Y) @@ -295,15 +296,18 @@ variable [Abelian C] [EnoughInjectives C] (Z : C) -- The construction of the injective resolution `of` would be very, very slow -- if it were not broken into separate definitions and lemmas +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `InjectiveResolution.of`. -/ def ofCocomplex : CochainComplex C ℕ := CochainComplex.mk' (Injective.under Z) (Injective.syzygies (Injective.ι Z)) (Injective.d (Injective.ι Z)) fun f => ⟨_, Injective.d f, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma ofCocomplex_d_0_1 : (ofCocomplex Z).d 0 1 = d (Injective.ι Z) := by simp [ofCocomplex] +set_option backward.isDefEq.respectTransparency.types false in lemma ofCocomplex_exactAt_succ (n : ℕ) : (ofCocomplex Z).ExactAt (n + 1) := by rw [HomologicalComplex.exactAt_iff' _ n (n + 1) (n + 1 + 1) (by simp) (by simp)] @@ -315,6 +319,7 @@ lemma ofCocomplex_exactAt_succ (n : ℕ) : | n + 1 => apply exact_f_d ((CochainComplex.mkAux _ _ _ (d (Injective.ι Z)) (d (d (Injective.ι Z))) _ _ (n + 1)).f) +set_option backward.isDefEq.respectTransparency.types false in instance (n : ℕ) : Injective ((ofCocomplex Z).X n) := by obtain (_ | _ | _ | n) := n <;> apply Injective.injective_under diff --git a/Mathlib/CategoryTheory/Abelian/LeftDerived.lean b/Mathlib/CategoryTheory/Abelian/LeftDerived.lean index 69ba5c4f17ff75..b1623d7d05342c 100644 --- a/Mathlib/CategoryTheory/Abelian/LeftDerived.lean +++ b/Mathlib/CategoryTheory/Abelian/LeftDerived.lean @@ -335,6 +335,7 @@ lemma ProjectiveResolution.fromLeftDerivedZero_eq erw [← NatTrans.naturality_assoc] rfl +set_option backward.isDefEq.respectTransparency.types false in instance (F : C ⥤ D) [F.Additive] (X : C) [Projective X] : IsIso (F.fromLeftDerivedZero.app X) := by rw [(ProjectiveResolution.self X).fromLeftDerivedZero_eq F] @@ -344,6 +345,7 @@ section variable (F : C ⥤ D) [F.Additive] [PreservesFiniteColimits F] +set_option backward.isDefEq.respectTransparency.types false in instance {X : C} (P : ProjectiveResolution X) : IsIso (P.fromLeftDerivedZero' F) := by dsimp [ProjectiveResolution.fromLeftDerivedZero'] diff --git a/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean b/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean index 6363c73b342102..29ace594b6f710 100644 --- a/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean +++ b/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean @@ -220,6 +220,7 @@ abbrev r (A : C) : A ⟶ cokernel (diag A) := instance mono_Δ {A : C} : Mono (diag A) := mono_of_mono_fac <| prod.lift_fst _ _ +set_option backward.isDefEq.respectTransparency.types false in instance mono_r {A : C} : Mono (r A) := by let hl : IsLimit (KernelFork.ofι (diag A) (cokernel.condition (diag A))) := monoIsKernelOfCokernel _ (colimit.isColimit _) @@ -409,7 +410,7 @@ theorem add_comp (X Y Z : C) (f g : X ⟶ Y) (h : Y ⟶ Z) : (f + g) ≫ h = f rw [add_def, sub_comp, neg_def, sub_comp, zero_comp, add_def, neg_def] /-- Every `NonPreadditiveAbelian` category is preadditive. -/ -@[implicit_reducible] +@[instance_reducible] def preadditive : Preadditive C where homGroup X Y := { add_assoc := add_assoc diff --git a/Mathlib/CategoryTheory/Abelian/Opposite.lean b/Mathlib/CategoryTheory/Abelian/Opposite.lean index 253a4f004a512b..719ff615478d30 100644 --- a/Mathlib/CategoryTheory/Abelian/Opposite.lean +++ b/Mathlib/CategoryTheory/Abelian/Opposite.lean @@ -105,10 +105,12 @@ def cokernelOpOp : cokernel f.op ≅ Opposite.op (kernel f) := def kernelUnopUnop : kernel g.unop ≅ (cokernel g).unop := (kernelUnopOp g).unop.symm +set_option backward.isDefEq.respectTransparency.types false in theorem kernel.ι_unop : (kernel.ι g.unop).op = eqToHom (Opposite.op_unop _) ≫ cokernel.π g ≫ (kernelUnopOp g).inv := by simp +set_option backward.isDefEq.respectTransparency.types false in theorem cokernel.π_unop : (cokernel.π g.unop).op = (cokernelUnopOp g).hom ≫ kernel.ι g ≫ eqToHom (Opposite.op_unop _).symm := by diff --git a/Mathlib/CategoryTheory/Abelian/Preradical/Colon.lean b/Mathlib/CategoryTheory/Abelian/Preradical/Colon.lean index cef74be9f4b386..66ffaa73dfddb6 100644 --- a/Mathlib/CategoryTheory/Abelian/Preradical/Colon.lean +++ b/Mathlib/CategoryTheory/Abelian/Preradical/Colon.lean @@ -159,6 +159,7 @@ via `Φ.ι : Φ.r X ⟶ 𝟭 C` and the zero morphism `Φ.r ⟶ Φ.quotient ⋙ noncomputable def toColon : Φ ⟶ Φ.colon Ψ := MonoOver.homMk ((isPullback_colon Φ Ψ).lift Φ.ι 0 (by simp)) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma toColon_hom_left_colonπ : (toColon Φ Ψ).hom.left ≫ colonπ Φ Ψ = 0 := by diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean b/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean index 84d39c8c75290e..416666630a17d7 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean @@ -272,6 +272,7 @@ lemma projectiveDimension_eq_of_iso {X Y : C} (e : X ≅ Y) : exact ⟨fun h ↦ hasProjectiveDimensionLT_of_iso e _, fun h ↦ hasProjectiveDimensionLT_of_iso e.symm _⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma Retract.projectiveDimension_le {X Y : C} (h : Retract X Y) : projectiveDimension X ≤ projectiveDimension Y := sInf_le_sInf_of_subset_insert_top (fun n hn ↦ by diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean b/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean index 2cfbd81ba9a38a..92d4216d0d58d1 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Resolution.lean @@ -94,6 +94,7 @@ def lift {Y Z : C} (f : Y ⟶ Z) (P : ProjectiveResolution Y) (Q : ProjectiveRes ChainComplex.mkHom _ _ (liftFZero f _ _) (liftFOne f _ _) (liftFOne_zero_comm f P Q) fun n ⟨g, g', w⟩ => ⟨(liftFSucc P Q n g g' w).1, (liftFSucc P Q n g g' w).2⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The resolution maps intertwine the lift of a morphism and that morphism. -/ @[reassoc (attr := simp)] theorem lift_commutes {Y Z : C} (f : Y ⟶ Z) (P : ProjectiveResolution Y) @@ -288,6 +289,7 @@ variable (Z : C) -- The construction of the projective resolution `of` would be very, very slow -- if it were not broken into separate definitions and lemmas +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `ProjectiveResolution.of`. -/ def ofComplex : ChainComplex C ℕ := ChainComplex.mk' (Projective.over Z) (Projective.syzygies (Projective.π Z)) @@ -297,6 +299,7 @@ lemma ofComplex_d_1_0 : (ofComplex Z).d 1 0 = d (Projective.π Z) := by simp [ofComplex] +set_option backward.isDefEq.respectTransparency.types false in lemma ofComplex_exactAt_succ (n : ℕ) : (ofComplex Z).ExactAt (n + 1) := by rw [HomologicalComplex.exactAt_iff' _ (n + 1 + 1) (n + 1) n (by simp) (by simp)] @@ -307,6 +310,7 @@ lemma ofComplex_exactAt_succ (n : ℕ) : | 0 => apply exact_d_f | n + 1 => apply exact_d_f +set_option backward.isDefEq.respectTransparency.types false in instance (n : ℕ) : Projective ((ofComplex Z).X n) := by obtain (_ | _ | _ | n) := n <;> apply Projective.projective_over diff --git a/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean b/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean index b4dc5dd6b40d5b..06f4b0d4236300 100644 --- a/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean +++ b/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean @@ -268,6 +268,7 @@ theorem zero_morphism_ext' {P Q : C} (f : P ⟶ Q) : (∀ a, f a = 0) → 0 = f theorem eq_zero_iff {P Q : C} (f : P ⟶ Q) : f = 0 ↔ ∀ a, f a = 0 := ⟨fun h a => by simp [h], zero_morphism_ext _⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- A monomorphism is injective on pseudoelements. -/ theorem pseudo_injective_of_mono {P Q : C} (f : P ⟶ Q) [Mono f] : Function.Injective f := by intro abar abar' diff --git a/Mathlib/CategoryTheory/Abelian/RightDerived.lean b/Mathlib/CategoryTheory/Abelian/RightDerived.lean index 2a2354544dc071..0e94ef51f40d8d 100644 --- a/Mathlib/CategoryTheory/Abelian/RightDerived.lean +++ b/Mathlib/CategoryTheory/Abelian/RightDerived.lean @@ -344,6 +344,7 @@ lemma InjectiveResolution.toRightDerivedZero_eq erw [← NatTrans.naturality] rfl +set_option backward.isDefEq.respectTransparency.types false in instance (F : C ⥤ D) [F.Additive] (X : C) [Injective X] : IsIso (F.toRightDerivedZero.app X) := by rw [(InjectiveResolution.self X).toRightDerivedZero_eq F] @@ -353,6 +354,7 @@ section variable (F : C ⥤ D) [F.Additive] [PreservesFiniteLimits F] +set_option backward.isDefEq.respectTransparency.types false in instance {X : C} (P : InjectiveResolution X) : IsIso (P.toRightDerivedZero' F) := by dsimp [InjectiveResolution.toRightDerivedZero'] diff --git a/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean b/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean index f92126f9c75b86..66bff8ec8672d6 100644 --- a/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean +++ b/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean @@ -429,7 +429,7 @@ Note that we assume that `D` has already been equipped with a preadditive struct and that `L` is additive. Otherwise, see the results in the file `Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean` which applies because `P.isoModSerre` has a calculus of left and right fractions. -/ -@[stacks 02MS, implicit_reducible] +@[stacks 02MS, instance_reducible] def abelian : Abelian D := by have := hasFiniteProducts L P have := hasKernels L P diff --git a/Mathlib/CategoryTheory/Abelian/Subobject.lean b/Mathlib/CategoryTheory/Abelian/Subobject.lean index b76a0ae170dbff..08831cebcccffe 100644 --- a/Mathlib/CategoryTheory/Abelian/Subobject.lean +++ b/Mathlib/CategoryTheory/Abelian/Subobject.lean @@ -26,6 +26,7 @@ namespace CategoryTheory.Abelian variable {C : Type u} [Category.{v} C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- In an abelian category, the subobjects and quotient objects of an object `X` are order-isomorphic via taking kernels and cokernels. diff --git a/Mathlib/CategoryTheory/Abelian/Transfer.lean b/Mathlib/CategoryTheory/Abelian/Transfer.lean index 099e982bca1390..73a420136db112 100644 --- a/Mathlib/CategoryTheory/Abelian/Transfer.lean +++ b/Mathlib/CategoryTheory/Abelian/Transfer.lean @@ -84,7 +84,7 @@ we have `F : C ⥤ D` `G : D ⥤ C` (with `G` preserving zero morphisms), `G` is left exact (that is, preserves finite limits), and further we have `adj : G ⊣ F` and `i : F ⋙ G ≅ 𝟭 C`, then `C` is also abelian. -/ -@[stacks 03A3, implicit_reducible] +@[stacks 03A3, instance_reducible] def abelianOfAdjunction {C : Type u₁} [Category.{v₁} C] [Preadditive C] [HasFiniteProducts C] {D : Type u₂} [Category.{v₂} D] [Abelian D] (F : C ⥤ D) (G : D ⥤ C) [Functor.PreservesZeroMorphisms G] [PreservesFiniteLimits G] (i : F ⋙ G ≅ 𝟭 C) @@ -108,7 +108,7 @@ def abelianOfAdjunction {C : Type u₁} [Category.{v₁} C] [Preadditive C] [Has via a functor that preserves zero morphisms, then `C` is also abelian. -/ -@[implicit_reducible] +@[instance_reducible] def abelianOfEquivalence {C : Type u₁} [Category.{v₁} C] [Preadditive C] [HasFiniteProducts C] {D : Type u₂} [Category.{v₂} D] [Abelian D] (F : C ⥤ D) [F.IsEquivalence] : Abelian C := diff --git a/Mathlib/CategoryTheory/Action.lean b/Mathlib/CategoryTheory/Action.lean index 940eafb9f2f4b9..fbee9da997609e 100644 --- a/Mathlib/CategoryTheory/Action.lean +++ b/Mathlib/CategoryTheory/Action.lean @@ -100,6 +100,7 @@ instance [Nonempty X] : Nonempty (ActionCategory M X) := variable {X} (x : X) +set_option backward.isDefEq.respectTransparency.types false in /-- The stabilizer of a point is isomorphic to the endomorphism monoid at the corresponding point. In fact they are definitionally equivalent. -/ def stabilizerIsoEnd : stabilizerSubmonoid M x ≃* @End (ActionCategory M X) _ x := @@ -110,6 +111,7 @@ theorem stabilizerIsoEnd_apply (f : stabilizerSubmonoid M x) : (stabilizerIsoEnd M x) f = f := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp 1100] theorem stabilizerIsoEnd_symm_apply (f : End _) : (stabilizerIsoEnd M x).symm f = f := rfl @@ -137,6 +139,7 @@ variable {G : Type*} [Group G] [MulAction G X] instance : Groupoid (ActionCategory G X) := CategoryTheory.groupoidOfElements _ +set_option backward.isDefEq.respectTransparency.types false in /-- Any subgroup of `G` is a vertex group in its action groupoid. -/ def endMulEquivSubgroup (H : Subgroup G) : End (objEquiv G (G ⧸ H) ↑(1 : G)) ≃* H := MulEquiv.trans (stabilizerIsoEnd G ((1 : G) : G ⧸ H)).symm @@ -184,6 +187,7 @@ def curry (F : ActionCategory G X ⥤ SingleObj H) : G →* (X → H) ⋊[mulAut · exact F_map_eq.symm.trans (F.map_comp (homOfPair (g⁻¹ • b) h) (homOfPair b g)) rfl } +set_option backward.isDefEq.respectTransparency.types false in /-- Given `G` acting on `X`, a group homomorphism `φ : G →* (X → H) ⋊ G` can be uncurried to a functor from the action groupoid to `H`, provided that `φ g = (_, g)` for all `g`. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Action/Basic.lean b/Mathlib/CategoryTheory/Action/Basic.lean index 6341f3bc826516..cf7ae7424a207e 100644 --- a/Mathlib/CategoryTheory/Action/Basic.lean +++ b/Mathlib/CategoryTheory/Action/Basic.lean @@ -51,6 +51,7 @@ namespace Action variable {V} +set_option backward.isDefEq.respectTransparency.types false in theorem ρ_one {G : Type*} [Monoid G] (A : Action V G) : A.ρ 1 = 𝟙 A.V := by simp /-- When a group acts, we can lift the action to the group of automorphisms. -/ @@ -96,6 +97,7 @@ namespace Hom attribute [reassoc] comm attribute [local simp] comm comm_assoc +set_option backward.isDefEq.respectTransparency.types false in /-- The identity morphism on an `Action V G`. -/ @[simps] def id (M : Action V G) : Action.Hom M M where hom := 𝟙 M.V @@ -103,11 +105,15 @@ def id (M : Action V G) : Action.Hom M M where hom := 𝟙 M.V instance (M : Action V G) : Inhabited (Action.Hom M M) := ⟨id M⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The composition of two `Action V G` homomorphisms is the composition of the underlying maps. -/ @[simps] def comp {M N K : Action V G} (p : Action.Hom M N) (q : Action.Hom N K) : Action.Hom M K where hom := p.hom ≫ q.hom + comm := by + intro g + simp_all only [comm_assoc, comm, Category.assoc] end Hom @@ -123,10 +129,12 @@ lemma hom_injective {M N : Action V G} : Function.Injective (Hom.hom : (M ⟶ N) lemma hom_ext {M N : Action V G} (φ₁ φ₂ : M ⟶ N) (h : φ₁.hom = φ₂.hom) : φ₁ = φ₂ := Hom.ext h +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem id_hom (M : Action V G) : (𝟙 M : Hom M M).hom = 𝟙 M.V := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] theorem comp_hom {M N K : Action V G} (f : M ⟶ N) (g : N ⟶ K) : (f ≫ g : Hom M K).hom = f.hom ≫ g.hom := @@ -142,6 +150,7 @@ theorem inv_hom_hom {M N : Action V G} (f : M ≅ N) : f.inv.hom ≫ f.hom.hom = 𝟙 N.V := by rw [← comp_hom, Iso.inv_hom_id, id_hom] +set_option backward.isDefEq.respectTransparency.types false in /-- Construct an isomorphism of `G` actions/representations from an isomorphism of the underlying objects, where the forward direction commutes with the group action. -/ @@ -155,9 +164,11 @@ def mkIso {M N : Action V G} (f : M.V ≅ N.V) { hom := f.inv comm := fun g => by have w := comm g =≫ f.inv; simp at w; simp [w] } +set_option backward.isDefEq.respectTransparency.types false in instance (priority := 100) isIso_of_hom_isIso {M N : Action V G} (f : M ⟶ N) [IsIso f.hom] : IsIso f := (mkIso (asIso f.hom) f.comm).isIso_hom +set_option backward.isDefEq.respectTransparency.types false in instance isIso_hom_mk {M N : Action V G} (f : M.V ⟶ N.V) [IsIso f] (w) : @IsIso _ _ M N (Hom.mk f w) := (mkIso (asIso f) w).isIso_hom @@ -170,6 +181,7 @@ instance {M N : Action V G} (f : M ≅ N) : IsIso f.inv.hom where namespace FunctorCategoryEquivalence +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `functorCategoryEquivalence`. -/ @[simps] def functor : Action V G ⥤ SingleObj G ⥤ V where @@ -182,6 +194,7 @@ def functor : Action V G ⥤ SingleObj G ⥤ V where { app := fun _ => f.hom naturality := fun _ _ g => f.comm g } +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `functorCategoryEquivalence`. -/ @[simps] def inverse : (SingleObj G ⥤ V) ⥤ Action V G where @@ -195,6 +208,7 @@ def inverse : (SingleObj G ⥤ V) ⥤ Action V G where { hom := f.app PUnit.unit comm := fun g => f.naturality g } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `functorCategoryEquivalence`. -/ @[simps!] @@ -215,6 +229,7 @@ open FunctorCategoryEquivalence variable (V G) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of actions of `G` in the category `V` is equivalent to the functor category `SingleObj G ⥤ V`. @@ -226,9 +241,11 @@ def functorCategoryEquivalence : Action V G ≌ SingleObj G ⥤ V where unitIso := unitIso counitIso := counitIso +set_option backward.isDefEq.respectTransparency.types false in instance : (FunctorCategoryEquivalence.functor (V := V) (G := G)).IsEquivalence := (functorCategoryEquivalence V G).isEquivalence_functor +set_option backward.isDefEq.respectTransparency.types false in instance : (FunctorCategoryEquivalence.inverse (V := V) (G := G)).IsEquivalence := (functorCategoryEquivalence V G).isEquivalence_inverse @@ -238,6 +255,7 @@ section Forget variable (V G) +set_option backward.isDefEq.respectTransparency.types false in /-- (implementation) The forgetful functor from bundled actions to the underlying objects. Use the `CategoryTheory.forget` API provided by the `ConcreteCategory` instance below, @@ -262,6 +280,7 @@ instance {FV : V → V → Type*} {CV : V → Type*} [∀ X Y, FunLike (FV X Y) coe f := f.1 coe_injective' _ _ h := Subtype.ext (DFunLike.coe_injective h) +set_option backward.isDefEq.respectTransparency.types false in instance {FV : V → V → Type*} {CV : V → Type*} [∀ X Y, FunLike (FV X Y) (CV X) (CV Y)] [ConcreteCategory V FV] : ConcreteCategory (Action V G) (HomSubtype V G) where hom f := ⟨ConcreteCategory.hom (C := V) f.1, fun g => by @@ -274,19 +293,23 @@ instance {FV : V → V → Type*} {CV : V → Type*} [∀ X Y, FunLike (FV X Y) id_apply := ConcreteCategory.id_apply (C := V) comp_apply _ _ := ConcreteCategory.comp_apply (C := V) _ _ +set_option backward.isDefEq.respectTransparency.types false in instance hasForgetToV {FV : V → V → Type*} {CV : V → Type*} [∀ X Y, FunLike (FV X Y) (CV X) (CV Y)] [ConcreteCategory V FV] : HasForget₂ (Action V G) V where forget₂ := forget V G +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor is intertwined by `functorCategoryEquivalence` with evaluation at `PUnit.star`. -/ def functorCategoryEquivalenceCompEvaluation : (functorCategoryEquivalence V G).functor ⋙ (evaluation _ _).obj PUnit.unit ≅ forget V G := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance preservesLimits_forget [HasLimits V] : PreservesLimits (forget V G) := Limits.preservesLimits_of_natIso (Action.functorCategoryEquivalenceCompEvaluation V G) +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance preservesColimits_forget [HasColimits V] : PreservesColimits (forget V G) := preservesColimits_of_natIso (Action.functorCategoryEquivalenceCompEvaluation V G) @@ -318,6 +341,7 @@ def actionPUnitEquivalence : Action V PUnit ≌ V where variable (V) +set_option backward.isDefEq.respectTransparency.types false in /-- The "restriction" functor along a monoid homomorphism `f : G →* H`, taking actions of `H` to actions of `G`. @@ -332,6 +356,7 @@ def res {G H : Type*} [Monoid G] [Monoid H] (f : G →* H) : Action V H ⥤ Acti { hom := p.hom comm := fun g => p.comm (f g) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism from restriction along the identity homomorphism to the identity functor on `Action V G`. @@ -340,6 +365,7 @@ the identity functor on `Action V G`. def resId {G : Type*} [Monoid G] : res V (MonoidHom.id G) ≅ 𝟭 (Action V G) := NatIso.ofComponents fun M => mkIso (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism from the composition of restrictions along homomorphisms to the restriction along the composition of homomorphism. @@ -349,12 +375,14 @@ def resComp {G H K : Type*} [Monoid G] [Monoid H] [Monoid K] (f : G →* H) (g : H →* K) : res V g ⋙ res V f ≅ res V (g.comp f) := NatIso.ofComponents fun M => mkIso (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- Restricting scalars along equal maps is naturally isomorphic. -/ @[simps! hom inv] def resCongr {G H : Type*} [Monoid G] [Monoid H] {f f' : G →* H} (h : f = f') : Action.res V f ≅ Action.res V f' := NatIso.ofComponents (fun _ ↦ Action.mkIso (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restricting scalars along a monoid isomorphism induces an equivalence of categories. -/ @[simps! functor inverse] @@ -398,6 +426,7 @@ namespace CategoryTheory.Functor variable {V} {W : Type*} [Category* W] +set_option backward.isDefEq.respectTransparency.types false in /-- A functor between categories induces a functor between the categories of `G`-actions within those categories. -/ @[simps] @@ -416,12 +445,14 @@ def mapAction (F : V ⥤ W) (G : Type*) [Monoid G] : Action V G ⥤ Action W G w map_id M := by ext; simp only [Action.id_hom, F.map_id] map_comp f g := by ext; simp only [Action.comp_hom, F.map_comp] +set_option backward.isDefEq.respectTransparency.types false in instance (F : V ⥤ W) (G : Type*) [Monoid G] [F.Faithful] : (F.mapAction G).Faithful where map_injective eq := by ext apply_fun (fun f ↦ f.hom) at eq exact F.map_injective eq +set_option backward.isDefEq.respectTransparency.types false in /-- A fully faithful functor between categories induces a fully faithful functor between the categories of `G`-actions within those categories. -/ @@ -437,6 +468,7 @@ instance (F : V ⥤ W) (G : Type*) [Monoid G] [F.Faithful] [F.Full] : (F.mapActi variable (G : Type*) [Monoid G] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Functor.mapAction` is functorial in the functor. -/ @[simps! hom inv] @@ -454,6 +486,7 @@ def mapActionCongr {F F' : V ⥤ W} (e : F ≅ F') : end Functor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories induces an equivalence of the categories of `G`-actions within those categories. -/ diff --git a/Mathlib/CategoryTheory/Action/Concrete.lean b/Mathlib/CategoryTheory/Action/Concrete.lean index 648f39a33f51db..67885235db4624 100644 --- a/Mathlib/CategoryTheory/Action/Concrete.lean +++ b/Mathlib/CategoryTheory/Action/Concrete.lean @@ -70,6 +70,7 @@ theorem ofMulAction_apply {G : Type*} {H : Type*} [Monoid G] [MulAction G H] (g (ofMulAction G H).ρ g x = (g • x : H) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Given a family `F` of types with `G`-actions, this is the limit cone demonstrating that the product of `F` as types is a product in the category of `G`-sets. -/ def ofMulActionLimitCone {ι : Type v} (G : Type max v u) [Monoid G] (F : ι → Type max v u) @@ -132,6 +133,7 @@ notation:10 G:10 " ⧸ₐ " H:10 => Action.FintypeCat.ofMulAction G (FintypeCat. variable {G : Type*} [Group G] (H N : Subgroup G) [Fintype (G ⧸ N)] +set_option backward.isDefEq.respectTransparency.types false in /-- If `N` is a normal subgroup of `G`, then this is the group homomorphism sending an element `g` of `G` to the `G`-endomorphism of `G ⧸ₐ N` given by multiplication with `g⁻¹` on the right. -/ @@ -161,9 +163,11 @@ def toEndHom [N.Normal] : G →* End (G ⧸ₐ N) where change ⟦x * (σ * τ)⁻¹⟧ = ⟦x * τ⁻¹ * σ⁻¹⟧ rw [mul_inv_rev, mul_assoc] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toEndHom_apply [N.Normal] (g h : G) : (toEndHom N g).hom ⟦h⟧ = ⟦h * g⁻¹⟧ := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {N} in lemma toEndHom_trivial_of_mem [N.Normal] {n : G} (hn : n ∈ N) : toEndHom N n = 𝟙 (G ⧸ₐ N) := by apply Action.hom_ext @@ -177,6 +181,7 @@ def quotientToEndHom [N.Normal] : H ⧸ Subgroup.subgroupOf N H →* End (G ⧸ QuotientGroup.lift (Subgroup.subgroupOf N H) ((toEndHom N).comp H.subtype) <| fun _ uinU' ↦ toEndHom_trivial_of_mem uinU' +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma quotientToEndHom_mk [N.Normal] (x : H) (g : G) : (quotientToEndHom H N ⟦x⟧).hom ⟦g⟧ = ⟦g * x⁻¹⟧ := diff --git a/Mathlib/CategoryTheory/Action/Continuous.lean b/Mathlib/CategoryTheory/Action/Continuous.lean index b5da64b91f2320..cf638edfcdc5a3 100644 --- a/Mathlib/CategoryTheory/Action/Continuous.lean +++ b/Mathlib/CategoryTheory/Action/Continuous.lean @@ -40,6 +40,7 @@ namespace Action instance : HasForget₂ (Action V G) TopCat := HasForget₂.trans (Action V G) V TopCat +set_option backward.isDefEq.respectTransparency.types false in instance (X : Action V G) : MulAction G ((CategoryTheory.forget₂ _ TopCat).obj X) where smul g x := ((CategoryTheory.forget₂ _ TopCat).map (X.ρ g)) x one_smul x := by @@ -107,6 +108,7 @@ def res (f : G →ₜ* H) : ContAction V H ⥤ ContAction V G := change Continuous (u ∘ v) fun_prop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restricting scalars along a composition is naturally isomorphic to restricting scalars twice. -/ @[simps! hom inv] @@ -115,6 +117,7 @@ def resComp {K : Type*} [Monoid K] [TopologicalSpace K] ContAction.res V (h.comp f) ≅ ContAction.res V h ⋙ ContAction.res V f := NatIso.ofComponents (fun _ ↦ Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `f = f'`, restriction of scalars along `f` and `f'` is the same. -/ @[simps! hom inv] @@ -122,6 +125,7 @@ def resCongr (f f' : G →ₜ* H) (h : f = f') : ContAction.res V f ≅ ContActi NatIso.ofComponents (fun _ ↦ ObjectProperty.isoMk _ (Action.mkIso (Iso.refl _) (by subst h; simp))) fun f ↦ ObjectProperty.hom_ext _ (Action.Hom.ext (by simp)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restriction of scalars along a topological monoid isomorphism induces an equivalence of categories. -/ @@ -138,6 +142,7 @@ end ContAction open ContAction +set_option backward.isDefEq.respectTransparency.types false in /-- The subcategory of `ContAction V G` where the topology is discrete. -/ def DiscreteContAction : Type _ := ObjectProperty.FullSubcategory (IsDiscrete (V := V) (G := G)) deriving Category, ConcreteCategory @@ -145,14 +150,17 @@ deriving Category, ConcreteCategory namespace DiscreteContAction +set_option backward.isDefEq.respectTransparency.types false in instance : HasForget₂ (DiscreteContAction V G) (ContAction V G) := inferInstanceAs <| HasForget₂ (ObjectProperty.FullSubcategory _) _ +set_option backward.isDefEq.respectTransparency.types false in instance : HasForget₂ (DiscreteContAction V G) TopCat := HasForget₂.trans (DiscreteContAction V G) (ContAction V G) TopCat variable {V G} +set_option backward.isDefEq.respectTransparency.types false in instance (X : DiscreteContAction V G) : DiscreteTopology ((CategoryTheory.forget₂ _ TopCat).obj X) := X.property @@ -176,6 +184,7 @@ def mapContAction (F : V ⥤ W) (H : ∀ X : ContAction V G, ((F.mapAction G).ob ContAction V G ⥤ ContAction W G := ObjectProperty.lift _ (ObjectProperty.ι _ ⋙ F.mapAction G) H +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Continuous version of `Functor.mapActionComp`. -/ @[simps! hom inv] @@ -201,6 +210,7 @@ def mapContActionCongr end Functor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Continuous version of `Equivalence.mapAction`. -/ @[simps functor inverse] diff --git a/Mathlib/CategoryTheory/Action/Monoidal.lean b/Mathlib/CategoryTheory/Action/Monoidal.lean index 420f9d1ec667ba..21b1a4ccd94ba0 100644 --- a/Mathlib/CategoryTheory/Action/Monoidal.lean +++ b/Mathlib/CategoryTheory/Action/Monoidal.lean @@ -64,6 +64,7 @@ def tensorUnitIso {X : V} (f : 𝟙_ V ≅ X) : 𝟙_ (Action V G) ≅ Action.mk variable (V G) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : (Action.forget V G).Monoidal := Functor.CoreMonoidal.toMonoidal @@ -72,12 +73,16 @@ instance : (Action.forget V G).Monoidal := open Functor.LaxMonoidal Functor.OplaxMonoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_ε : ε (Action.forget V G) = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_η : η (Action.forget V G) = 𝟙 _ := rfl variable {V G} +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_μ (X Y : Action V G) : μ (Action.forget V G) X Y = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_δ (X Y : Action V G) : δ (Action.forget V G) X Y = 𝟙 _ := rfl variable (V G) @@ -86,6 +91,7 @@ section variable [BraidedCategory V] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : BraidedCategory (Action V G) := .ofFaithful (Action.forget V G) fun X Y ↦ mkIso (β_ _ _) fun g ↦ by simp @@ -96,12 +102,14 @@ theorem β_hom_hom {X Y : Action V G} : (β_ X Y).hom.hom = (β_ X.V Y.V).hom := @[simp] theorem β_inv_hom {X Y : Action V G} : (β_ X Y).inv.hom = (β_ X.V Y.V).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When `V` is braided the forgetful functor `Action V G` to `V` is braided. -/ instance : (Action.forget V G).Braided where end +set_option backward.isDefEq.respectTransparency.types false in instance [SymmetricCategory V] : SymmetricCategory (Action V G) := .ofFaithful (Action.forget V G) @@ -111,10 +119,12 @@ variable [Preadditive V] [MonoidalPreadditive V] attribute [local simp] MonoidalPreadditive.whiskerLeft_add MonoidalPreadditive.add_whiskerRight +set_option backward.isDefEq.respectTransparency.types false in instance : MonoidalPreadditive (Action V G) where variable {R : Type*} [Semiring R] [Linear R V] [MonoidalLinear R V] +set_option backward.isDefEq.respectTransparency.types false in instance : MonoidalLinear R (Action V G) where end @@ -218,6 +228,7 @@ noncomputable def diagonalSuccIsoTensorDiagonal [Monoid G] (n : ℕ) : variable [Group G] +set_option backward.isDefEq.respectTransparency.types false in /-- Given `X : Action (Type u) G` for `G` a group, then `G × X` (with `G` acting as left multiplication on the first factor and by `X.ρ` on the second) is isomorphic as a `G`-set to `G × X` (with `G` acting as left multiplication on the first factor and trivially on the second). @@ -317,9 +328,11 @@ instance [F.LaxMonoidal] : (F.mapAction G).LaxMonoidal where left_unitality _ := by ext; simp right_unitality _ := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapAction_ε_hom [F.LaxMonoidal] : (ε (F.mapAction G)).hom = ε F := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapAction_μ_hom [F.LaxMonoidal] (X Y : Action V G) : (μ (F.mapAction G) X Y).hom = μ F X.V Y.V := rfl @@ -343,13 +356,16 @@ instance [F.OplaxMonoidal] : (F.mapAction G).OplaxMonoidal where oplax_left_unitality _ := by ext; simp oplax_right_unitality _ := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapAction_η_hom [F.OplaxMonoidal] : (η (F.mapAction G)).hom = η F := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapAction_δ_hom [F.OplaxMonoidal] (X Y : Action V G) : (δ (F.mapAction G) X Y).hom = δ F X.V Y.V := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A monoidal functor induces a monoidal functor between the categories of `G`-actions within those categories. -/ diff --git a/Mathlib/CategoryTheory/Adjunction/Basic.lean b/Mathlib/CategoryTheory/Adjunction/Basic.lean index 67802c63a2e8fd..278ba1f464c126 100644 --- a/Mathlib/CategoryTheory/Adjunction/Basic.lean +++ b/Mathlib/CategoryTheory/Adjunction/Basic.lean @@ -541,6 +541,7 @@ lemma homEquiv_ofNatIsoRight_symm_apply {F : C ⥤ D} {G H : D ⥤ C} (adj : F (adj.homEquiv _ _).symm (f ≫ iso.inv.app _) := by simp +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism which an adjunction `F ⊣ G` induces on `G ⋙ yoneda`. This states that `Adjunction.homEquiv` is natural in both arguments. -/ @[simps!] @@ -549,6 +550,7 @@ def compYonedaIso {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category. G ⋙ yoneda ≅ yoneda ⋙ (whiskeringLeft _ _ _).obj F.op := NatIso.ofComponents fun X => NatIso.ofComponents fun Y => (adj.homEquiv Y.unop X).toIso.symm +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism which an adjunction `F ⊣ G` induces on `F.op ⋙ coyoneda`. This states that `Adjunction.homEquiv` is natural in both arguments. -/ @[simps!] @@ -557,6 +559,7 @@ def compCoyonedaIso {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Categor F.op ⋙ coyoneda ≅ coyoneda ⋙ (whiskeringLeft _ _ _).obj G := NatIso.ofComponents fun X => NatIso.ofComponents fun Y => (adj.homEquiv X.unop Y).toIso +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism which an adjunction `F ⊣ G` induces on `F.op ⋙ uliftCoyoneda`. This states that `Adjunction.homEquiv` is natural in both arguments. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Adjunction/FullyFaithfulLimits.lean b/Mathlib/CategoryTheory/Adjunction/FullyFaithfulLimits.lean index aa1dbd06e3e89a..640c25af746d45 100644 --- a/Mathlib/CategoryTheory/Adjunction/FullyFaithfulLimits.lean +++ b/Mathlib/CategoryTheory/Adjunction/FullyFaithfulLimits.lean @@ -35,6 +35,7 @@ variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] include adj +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma preservesColimitsOfShape_iff (J : Type u) [Category.{v} J] [HasColimitsOfShape J C] [G.Full] [G.Faithful] : diff --git a/Mathlib/CategoryTheory/Adjunction/Limits.lean b/Mathlib/CategoryTheory/Adjunction/Limits.lean index 2346d8b7fb1d13..b9fa083a6b0ea6 100644 --- a/Mathlib/CategoryTheory/Adjunction/Limits.lean +++ b/Mathlib/CategoryTheory/Adjunction/Limits.lean @@ -330,6 +330,7 @@ def coconesIso {J : Type u} [Category.{v} J] {K : J ⥤ C} : { hom := ↾(coconesIsoComponentHom adj Y) inv := ↾(coconesIsoComponentInv adj Y) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- Note: this is natural in K, but we do not yet have the tools to formulate that. /-- When `F ⊣ G`, diff --git a/Mathlib/CategoryTheory/Adjunction/Mates.lean b/Mathlib/CategoryTheory/Adjunction/Mates.lean index 852c240b7a7e24..e17cec0c123ee3 100644 --- a/Mathlib/CategoryTheory/Adjunction/Mates.lean +++ b/Mathlib/CategoryTheory/Adjunction/Mates.lean @@ -300,6 +300,7 @@ theorem conjugateEquiv_counit_symm (α : R₁ ⟶ R₂) (d : D) : conv_lhs => rw [← (conjugateEquiv adj₁ adj₂).right_inv α] exact (conjugateEquiv_counit adj₁ adj₂ ((conjugateEquiv adj₁ adj₂).symm α) d) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A component of a transposed form of the conjugation definition. -/ theorem unit_conjugateEquiv (α : L₂ ⟶ L₁) (c : C) : @@ -335,6 +336,7 @@ theorem conjugateEquiv_adjunction_id {L R : C ⥤ C} (adj : L ⊣ R) (α : 𝟭 (conjugateEquiv adj Adjunction.id α).app c = α.app (R.obj c) ≫ adj.counit.app c := by simp [conjugateEquiv, mateEquiv, Adjunction.id] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem conjugateEquiv_adjunction_id_symm {L R : C ⥤ C} (adj : L ⊣ R) (α : R ⟶ 𝟭 C) (c : C) : ((conjugateEquiv adj Adjunction.id).symm α).app c = adj.unit.app c ≫ α.app (L.obj c) := by @@ -348,6 +350,7 @@ variable [Category.{v₁} C] [Category.{v₂} D] variable {L₁ L₂ L₃ : C ⥤ D} {R₁ R₂ R₃ : D ⥤ C} variable (adj₁ : L₁ ⊣ R₁) (adj₂ : L₂ ⊣ R₂) (adj₃ : L₃ ⊣ R₃) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] theorem conjugateEquiv_comp (α : L₂ ⟶ L₁) (β : L₃ ⟶ L₂) : @@ -448,6 +451,7 @@ variable {F₁ : A ⥤ C} {U₁ : C ⥤ A} {F₂ : B ⥤ D} {U₂ : D ⥤ B} variable {L₁ : A ⥤ B} {R₁ : B ⥤ A} {L₂ : C ⥤ D} {R₂ : D ⥤ C} variable (adj₁ : L₁ ⊣ R₁) (adj₂ : L₂ ⊣ R₂) (adj₃ : F₁ ⊣ U₁) (adj₄ : F₂ ⊣ U₂) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When all four functors in a square are left adjoints, the mates operation can be iterated: @@ -469,6 +473,7 @@ theorem iterated_mateEquiv_conjugateEquiv (α : TwoSquare F₁ L₁ L₂ F₂) : ext d simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem iterated_mateEquiv_conjugateEquiv_symm (α : TwoSquare U₂ R₂ R₁ U₁) : (mateEquiv adj₁ adj₂).symm ((mateEquiv adj₄ adj₃).symm α) = @@ -481,6 +486,7 @@ end IteratedmateEquiv variable {G : A ⥤ C} {H : B ⥤ D} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The mates equivalence commutes with this composition, essentially by `mateEquiv_vcomp`. -/ theorem mateEquiv_conjugateEquiv_vcomp {L₁ : A ⥤ B} {R₁ : B ⥤ A} {L₂ : C ⥤ D} {R₂ : D ⥤ C} @@ -499,6 +505,7 @@ theorem mateEquiv_conjugateEquiv_vcomp {L₁ : A ⥤ B} {R₁ : B ⥤ A} {L₂ : comp_id] at vcompb simpa [mateEquiv] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The mates equivalence commutes with this composition, essentially by `mateEquiv_vcomp`. -/ theorem conjugateEquiv_mateEquiv_vcomp {L₁ : A ⥤ B} {R₁ : B ⥤ A} {L₂ : A ⥤ B} {R₂ : B ⥤ A} diff --git a/Mathlib/CategoryTheory/Adjunction/Opposites.lean b/Mathlib/CategoryTheory/Adjunction/Opposites.lean index 042c19f629bcfe..6963ea9b49dd60 100644 --- a/Mathlib/CategoryTheory/Adjunction/Opposites.lean +++ b/Mathlib/CategoryTheory/Adjunction/Opposites.lean @@ -66,11 +66,13 @@ def rightOp {F : Cᵒᵖ ⥤ D} {G : Dᵒᵖ ⥤ C} (a : F.rightOp ⊣ G) : G.ri left_triangle_components X := congr($(a.right_triangle_components (.op X)).op) right_triangle_components X := congr($(a.left_triangle_components X.unop).unop) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma leftOp_eq {F : C ⥤ Dᵒᵖ} {G : D ⥤ Cᵒᵖ} (a : F ⊣ G.leftOp) : a.leftOp = (opOpEquivalence D).symm.toAdjunction.comp a.op := by ext X; simp [Equivalence.unit] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma rightOp_eq {F : Cᵒᵖ ⥤ D} {G : Dᵒᵖ ⥤ C} (a : F.rightOp ⊣ G) : a.rightOp = (opOpEquivalence D).symm.toAdjunction.comp a.op := by diff --git a/Mathlib/CategoryTheory/Adjunction/Quadruple.lean b/Mathlib/CategoryTheory/Adjunction/Quadruple.lean index bc7e4a20e916e5..f7c4fc4116ab98 100644 --- a/Mathlib/CategoryTheory/Adjunction/Quadruple.lean +++ b/Mathlib/CategoryTheory/Adjunction/Quadruple.lean @@ -84,6 +84,7 @@ section RightFullyFaithful variable [F.Full] [F.Faithful] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For an adjoint quadruple `L ⊣ F ⊣ G ⊣ R` where `F` (and hence also `R`) is fully faithful, all components of the natural transformation `G ⟶ L` are epimorphisms iff all components of the natural diff --git a/Mathlib/CategoryTheory/Adjunction/Triple.lean b/Mathlib/CategoryTheory/Adjunction/Triple.lean index 952f2a5bf6b9b6..b28a602b3069ec 100644 --- a/Mathlib/CategoryTheory/Adjunction/Triple.lean +++ b/Mathlib/CategoryTheory/Adjunction/Triple.lean @@ -158,6 +158,7 @@ lemma rightToLeft_app_adj₂_unit_app (X : C) : t.rightToLeft.app X ≫ t.adj₂.unit.app (F.obj X) = H.map (t.adj₁.unit.app X) := G.map_injective (by simp [← cancel_mono (t.adj₂.counit.app _)]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For an adjoint triple `F ⊣ G ⊣ H` where `G` is fully faithful, the natural transformation `F.op ⟶ H.op` obtained from the dual adjoint triple `H.op ⊣ G.op ⊣ F.op` is dual to the natural @@ -265,6 +266,7 @@ lemma leftToRight_app_map_adj₁_unit_app (X : C) : t.leftToRight.app X ≫ H.map (t.adj₁.unit.app X) = t.adj₂.unit.app (F.obj X) := by simp [leftToRight_app] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For an adjoint triple `F ⊣ G ⊣ H` where `F` and `H` are fully faithful, the natural transformation `H.op ⟶ F.op` obtained from the dual adjoint triple `H.op ⊣ G.op ⊣ F.op` is diff --git a/Mathlib/CategoryTheory/Bicategory/Adjunction/Cat.lean b/Mathlib/CategoryTheory/Bicategory/Adjunction/Cat.lean index c6b07f45d5f632..c2986fe78e6cc1 100644 --- a/Mathlib/CategoryTheory/Bicategory/Adjunction/Cat.lean +++ b/Mathlib/CategoryTheory/Bicategory/Adjunction/Cat.lean @@ -80,6 +80,7 @@ lemma Adjunction.ofCat_id (C : Cat.{v, u}) : Adjunction.ofCat (Adjunction.id C) = CategoryTheory.Adjunction.id := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma Adjunction.ofCat_comp {C D E : Cat.{v, u}} {F : C ⟶ D} {G : D ⟶ C} (adj : F ⊣ G) @@ -88,6 +89,7 @@ lemma Adjunction.ofCat_comp {C D E : Cat.{v, u}} ext simp [bicategoricalComp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma toNatTrans_mateEquiv {C D E F : Cat} {G : C ⟶ E} {H : D ⟶ F} {L₁ : C ⟶ D} {R₁ : D ⟶ C} {L₂ : E ⟶ F} {R₂ : F ⟶ E} diff --git a/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean b/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean index 977186d57550e6..bfa43a5a0228e4 100644 --- a/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean +++ b/Mathlib/CategoryTheory/Bicategory/CatEnriched.lean @@ -101,6 +101,7 @@ instance : EnrichedOrdinaryCategory Cat (CatEnriched C) where homEquiv_id _ := ((Cat.Hom.equivFunctor _ _).trans Cat.fromChosenTerminalEquiv).symm_apply_eq.mpr rfl +set_option backward.isDefEq.respectTransparency.types false in theorem id_hComp_heq {a b : CatEnriched C} {f f' : a ⟶ b} (η : f ⟶ f') : HEq (hComp (𝟙 (𝟙 a)) η) η := by rw [id_eq, ← Functor.map_id] @@ -110,6 +111,7 @@ theorem id_hComp {a b : CatEnriched C} {f f' : a ⟶ b} (η : f ⟶ f') : hComp (𝟙 (𝟙 a)) η = eqToHom (id_comp f) ≫ η ≫ eqToHom (id_comp f').symm := by simp [← heq_eq_eq, id_hComp_heq] +set_option backward.isDefEq.respectTransparency.types false in theorem hComp_id_heq {a b : CatEnriched C} {f f' : a ⟶ b} (η : f ⟶ f') : HEq (hComp η (𝟙 (𝟙 b))) η := by rw [id_eq, ← Functor.map_id] @@ -315,6 +317,7 @@ theorem hComp_assoc_heq {a b c d : CatEnrichedOrdinary C} {f f' : a ⟶ b} {g g' : b ⟶ c} {h h' : c ⟶ d} (η : f ⟶ f') (θ : g ⟶ g') (κ : h ⟶ h') : HEq (hComp (hComp η θ) κ) (hComp η (hComp θ κ)) := by simp [hComp_assoc] +set_option backward.isDefEq.respectTransparency.types false in instance : Bicategory (CatEnrichedOrdinary C) where homCategory := inferInstance whiskerLeft {_ _ _} f {_ _} η := hComp (𝟙 f) η diff --git a/Mathlib/CategoryTheory/Bicategory/Coherence.lean b/Mathlib/CategoryTheory/Bicategory/Coherence.lean index c0b2107c8b5ca9..c7ae6f12261feb 100644 --- a/Mathlib/CategoryTheory/Bicategory/Coherence.lean +++ b/Mathlib/CategoryTheory/Bicategory/Coherence.lean @@ -72,6 +72,7 @@ bicategory. def inclusionPath (a b : B) : Discrete (Path.{v} a b) ⥤ Hom a b := Discrete.functor inclusionPathAux +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion from the locally discrete bicategory on the path category into the free bicategory as a prelax functor. This will be promoted to a pseudofunctor after proving the coherence theorem. See `inclusion`. @@ -86,6 +87,7 @@ def preinclusion (B : Type u) [Quiver.{v} B] : theorem preinclusion_obj (a : B) : (preinclusion B).obj ⟨a⟩ = a := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem preinclusion_map₂ {a b : B} (f g : Discrete (Path.{v} a b)) (η : f ⟶ g) : (preinclusion B).map₂ η = eqToHom (congr_arg _ (Discrete.ext (Discrete.eq_of_hom η))) := @@ -121,6 +123,7 @@ example {a b c : B} (p : Path a b) (f : Hom b c) : case comp _ _ _ _ _ ihf ihg => rw [normalizeAux, ihf, ihg]; apply comp_assoc ``` -/ +set_option backward.isDefEq.respectTransparency.types false in /-- A 2-isomorphism between a partially-normalized 1-morphism in the free bicategory to the fully-normalized 1-morphism. -/ @@ -142,11 +145,13 @@ def normalizeIso {a : B} : normalizeAux p (f ≫ g) = normalizeAux (normalizeAux p f) g := rfl @[simp] theorem normalizeAux_id {a : B} {b : FreeBicategory B} (p : Path a b) : normalizeAux p (𝟙 b) = p := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem normalizeIso_comp {a : B} {b c d : FreeBicategory B} (p : Path a b) (f : b ⟶ c) (g : c ⟶ d) : normalizeIso p (f ≫ g) = (α_ _ _ _).symm ≪≫ whiskerRightIso (normalizeIso p f) g ≪≫ normalizeIso (normalizeAux p f) g := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem normalizeIso_id {a : B} {b : FreeBicategory B} (p : Path a b) : normalizeIso p (𝟙 b) = ρ_ _ := rfl @[simp] theorem quot_whisker_left {a b c : FreeBicategory B} (f : a ⟶ b) {g h : b ⟶ c} @@ -210,6 +215,7 @@ def normalize (B : Type u) [Quiver.{v} B] : mapId _ := eqToIso <| Discrete.ext rfl mapComp f g := eqToIso <| Discrete.ext <| normalizeAux_nil_comp f g +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `normalizeEquiv`. -/ def normalizeUnitIso (a b : FreeBicategory B) : 𝟭 (a ⟶ b) ≅ (normalize B).mapFunctor a b ⋙ @inclusionPath B _ a b := @@ -220,6 +226,7 @@ def normalizeUnitIso (a b : FreeBicategory B) : congr 1 exact normalize_naturality nil η) +set_option backward.isDefEq.respectTransparency.types false in /-- Normalization as an equivalence of categories. -/ def normalizeEquiv (a b : B) : Hom a b ≌ Discrete (Path.{v} a b) := Equivalence.mk ((normalize _).mapFunctor a b) (inclusionPath a b) (normalizeUnitIso a b) @@ -233,11 +240,13 @@ def normalizeEquiv (a b : B) : Hom a b ≌ Discrete (Path.{v} a b) := conv_rhs => rw [← ih] rfl)) +set_option backward.isDefEq.respectTransparency.types false in /-- The coherence theorem for bicategories. -/ instance locally_thin {a b : FreeBicategory B} : Quiver.IsThin (a ⟶ b) := fun _ _ => ⟨fun _ _ => (@normalizeEquiv B _ a b).functor.map_injective (Subsingleton.elim _ _)⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `inclusion`. -/ def inclusionMapCompAux {a b : B} : ∀ {c : B} (f : Path a b) (g : Path b c), @@ -245,6 +254,7 @@ def inclusionMapCompAux {a b : B} : | _, f, nil => (ρ_ ((preinclusion _).map ⟨f⟩)).symm | _, f, cons g₁ g₂ => whiskerRightIso (inclusionMapCompAux f g₁) (Hom.of g₂) ≪≫ α_ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion pseudofunctor from the locally discrete bicategory on the path category into the free bicategory. -/ diff --git a/Mathlib/CategoryTheory/Bicategory/Extension.lean b/Mathlib/CategoryTheory/Bicategory/Extension.lean index 5078a40108f198..94e2f8a0a7d1fc 100644 --- a/Mathlib/CategoryTheory/Bicategory/Extension.lean +++ b/Mathlib/CategoryTheory/Bicategory/Extension.lean @@ -139,6 +139,7 @@ def whiskerHom (i : s ⟶ t) {x : B} (h : c ⟶ x) : _ = unit t ▷ h := congrArg (· ▷ h) (LeftExtension.w i) _ = _ := by simp +set_option backward.isDefEq.respectTransparency.types false in /-- Construct an isomorphism between whiskered extensions. -/ def whiskerIso (i : s ≅ t) {x : B} (h : c ⟶ x) : s.whisker h ≅ t.whisker h := @@ -262,6 +263,7 @@ def whiskerHom (i : s ⟶ t) {x : B} (h : x ⟶ c) : _ = h ◁ unit t := congrArg (h ◁ ·) (LeftLift.w i) _ = _ := by simp +set_option backward.isDefEq.respectTransparency.types false in /-- Construct an isomorphism between whiskered lifts. -/ def whiskerIso (i : s ≅ t) {x : B} (h : x ⟶ c) : s.whisker h ≅ t.whisker h := diff --git a/Mathlib/CategoryTheory/Bicategory/Free.lean b/Mathlib/CategoryTheory/Bicategory/Free.lean index c07d7406b13fa8..db951b2a5fbf5d 100644 --- a/Mathlib/CategoryTheory/Bicategory/Free.lean +++ b/Mathlib/CategoryTheory/Bicategory/Free.lean @@ -317,6 +317,7 @@ def liftHom₂ : ∀ {a b : FreeBicategory B} {f g : a ⟶ b}, Hom₂ f g → (l | _, _, _, _, Hom₂.whisker_left f η => liftHom F f ◁ liftHom₂ η | _, _, _, _, Hom₂.whisker_right h η => liftHom₂ η ▷ liftHom F h +set_option backward.isDefEq.respectTransparency.types false in attribute [local simp] whisker_exchange in theorem liftHom₂_congr {a b : FreeBicategory B} {f g : a ⟶ b} {η θ : Hom₂ f g} (H : Rel η θ) : liftHom₂ F η = liftHom₂ F θ := by induction H <;> (dsimp [liftHom₂]; cat_disch) diff --git a/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Pseudo.lean b/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Pseudo.lean index a02d89864b0886..9278706dd3226b 100644 --- a/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Pseudo.lean +++ b/Mathlib/CategoryTheory/Bicategory/FunctorBicategory/Pseudo.lean @@ -77,6 +77,7 @@ abbrev rightUnitor (η : F ⟶ G) : η ≫ 𝟙 G ≅ η := variable (B C) +set_option backward.isDefEq.respectTransparency.types false in /-- A bicategory structure on pseudofunctors, with strong transformations as 1-morphisms. Note that this instance is scoped to the `Pseudofunctor.StrongTrans` namespace. -/ diff --git a/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean b/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean index 7be4c39c547b71..2aae0033f3462d 100644 --- a/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Bicategory/Grothendieck.lean @@ -352,11 +352,11 @@ def map (α : F ⟶ G) : ∫ᶜ F ⥤ ∫ᶜ G where · dsimp · simp only [categoryStruct_comp_base, op_comp, Quiver.Hom.comp_toLoc, categoryStruct_comp_fiber, Cat.Hom.comp_toFunctor, map_comp, naturality_comp_hom_app, assoc, - eqToHom_refl, comp_id, id_comp] + eqToHom_refl, comp_id] slice_lhs 2 4 => simp [← Cat.Hom.toNatIso_inv, Cat.Hom.comp_toFunctor, ← Cat.Hom.toNatIso_hom, ← map_comp, Iso.inv_hom_id_app, comp_obj, map_id, comp_id] simp only [assoc, ← reassoc_of% Cat.Hom.comp_map, - (α.naturality f.base.op.toLoc).hom.toNatTrans.naturality_assoc] + Cat.Hom.comp_toFunctor, Functor.comp_obj, NatTrans.naturality_assoc] set_option backward.isDefEq.respectTransparency false in @[simp] diff --git a/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean b/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean index e5feabb27e393c..97929ad437a9e5 100644 --- a/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean +++ b/Mathlib/CategoryTheory/Bicategory/Kan/Adjunction.lean @@ -43,6 +43,7 @@ section LeftExtension open LeftExtension +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For an adjunction `f ⊣ u`, `u` is an absolute left Kan extension of the identity along `f`. The unit of this Kan extension is given by the unit of the adjunction. -/ @@ -75,6 +76,7 @@ def Adjunction.isAbsoluteLeftKan {f : a ⟶ b} {u : b ⟶ a} (adj : f ⊣ u) : _ = _ := by rw [hτ]; dsimp only [StructuredArrow.homMk_right] +set_option backward.isDefEq.respectTransparency.types false in /-- A left Kan extension `t` of the identity along `f` that commutes with `f`, in the sense that `t.whisker f` is a left Kan extension, is a right adjoint to `f`. The unit of this adjoint is given by the unit of the Kan extension. -/ @@ -125,6 +127,7 @@ section LeftLift open LeftLift +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For an adjunction `f ⊣ u`, `f` is an absolute left Kan lift of the identity along `u`. The unit of this Kan lift is given by the unit of the adjunction. -/ @@ -156,6 +159,7 @@ def Adjunction.isAbsoluteLeftKanLift {f : a ⟶ b} {u : b ⟶ a} (adj : f ⊣ u) _ = _ := by rw [hτ]; dsimp only [StructuredArrow.homMk_right] +set_option backward.isDefEq.respectTransparency.types false in /-- A left Kan lift `t` of the identity along `u` that commutes with `u`, in the sense that `t.whisker u` is a left Kan lift, is a left adjoint to `u`. The unit of this adjoint is given by the unit of the Kan lift. -/ diff --git a/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean b/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean index 5e4fae35cb8c5f..3bbac00b2f138c 100644 --- a/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean +++ b/Mathlib/CategoryTheory/Bicategory/Monad/Basic.lean @@ -77,7 +77,7 @@ instance {a : B} : Comonad (𝟙 a) := ComonObj.instTensorUnit (a ⟶ a) /-- An oplax functor from the trivial bicategory to `B` defines a comonad in `B`. -/ -@[implicit_reducible] +@[instance_reducible] def ofOplaxFromUnit (F : LocallyDiscrete (Discrete Unit) ⥤ᵒᵖᴸ B) : Comonad (F.map (𝟙 ⟨⟨Unit.unit⟩⟩)) where comul := F.map₂ (ρ_ _).inv ≫ F.mapComp _ _ diff --git a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean index 9a14a4bb255ac5..7c78e792732c32 100644 --- a/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean +++ b/Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean @@ -215,6 +215,7 @@ lemma naturality_naturality_hom (α : F ⟶ G) {a b : B} {f g : a ⟶ b} (η : f (F.map₂ η.inv) ▷ α.app b ≫ (α.naturality f).hom ≫ α.app a ◁ G.map₂ η.hom := by simp [← IsIso.inv_comp_eq, ← G.map₂_inv η.inv] +set_option backward.isDefEq.respectTransparency.types false in lemma naturality_naturality_iso (α : F ⟶ G) {a b : B} {f g : a ⟶ b} (η : f ≅ g) : α.naturality g = whiskerRightIso (F.map₂Iso η.symm) (α.app b) ≪≫ (α.naturality f) ≪≫ whiskerLeftIso (α.app a) (G.map₂Iso η) := by @@ -222,6 +223,7 @@ lemma naturality_naturality_iso (α : F ⟶ G) {a b : B} {f g : a ⟶ b} (η : f rw [naturality_naturality_hom α η] simp +set_option backward.isDefEq.respectTransparency.types false in lemma naturality_naturality_inv (α : F ⟶ G) {a b : B} {f g : a ⟶ b} (η : f ≅ g) : (α.naturality g).inv = α.app a ◁ G.map₂ η.inv ≫ (α.naturality f).inv ≫ F.map₂ η.hom ▷ α.app b := by diff --git a/Mathlib/CategoryTheory/Bicategory/Opposites.lean b/Mathlib/CategoryTheory/Bicategory/Opposites.lean index 9858eebf9c5f0e..befc467ec2c718 100644 --- a/Mathlib/CategoryTheory/Bicategory/Opposites.lean +++ b/Mathlib/CategoryTheory/Bicategory/Opposites.lean @@ -143,6 +143,7 @@ open Hom2 variable {B : Type u} [Bicategory.{w, v} B] +set_option backward.isDefEq.respectTransparency.types false in /-- The 1-cell dual bicategory `Bᵒᵖ`. It is defined as follows. diff --git a/Mathlib/CategoryTheory/Bicategory/Yoneda.lean b/Mathlib/CategoryTheory/Bicategory/Yoneda.lean index c8612bfa8dd5cd..a529dbaba81e04 100644 --- a/Mathlib/CategoryTheory/Bicategory/Yoneda.lean +++ b/Mathlib/CategoryTheory/Bicategory/Yoneda.lean @@ -46,6 +46,7 @@ set_option backward.defeqAttrib.useBackward true in def leftUnitorNatIsoCat (a b : B) : (precomposingCat _ _ b).obj (𝟙 a) ≅ 𝟙 (Cat.of (a ⟶ b)) := Cat.Hom.isoMk <| NatIso.ofComponents (λ_ ·) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Right component of the associator as a 2-isomorphism in `Cat`. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/CatCommSq.lean b/Mathlib/CategoryTheory/CatCommSq.lean index cb8bcbad6a61e8..b17a880684e808 100644 --- a/Mathlib/CategoryTheory/CatCommSq.lean +++ b/Mathlib/CategoryTheory/CatCommSq.lean @@ -51,7 +51,7 @@ def vId : CatCommSq T (𝟭 C₁) (𝟭 C₂) T where iso := Functor.rightUnitor _ ≪≫ (Functor.leftUnitor _).symm /-- The horizontal identity `CatCommSq` -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def hId : CatCommSq (𝟭 C₁) L L (𝟭 C₃) where iso := Functor.leftUnitor _ ≪≫ (Functor.rightUnitor _).symm @@ -66,7 +66,7 @@ lemma iso_inv_naturality [h : CatCommSq T L R B] {x y : C₁} (f : x ⟶ y) : (iso T L R B).inv.naturality f /-- Horizontal composition of 2-commutative squares -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def hComp (T₁ : C₁ ⥤ C₂) (T₂ : C₂ ⥤ C₃) (V₁ : C₁ ⥤ C₄) (V₂ : C₂ ⥤ C₅) (V₃ : C₃ ⥤ C₆) (B₁ : C₄ ⥤ C₅) (B₂ : C₅ ⥤ C₆) [CatCommSq T₁ V₁ V₂ B₁] [CatCommSq T₂ V₂ V₃ B₂] : CatCommSq (T₁ ⋙ T₂) V₁ V₃ (B₁ ⋙ B₂) where @@ -83,7 +83,7 @@ abbrev hComp' {T₁ : C₁ ⥤ C₂} {T₂ : C₂ ⥤ C₃} {V₁ : C₁ ⥤ C hComp _ _ _ V₂ _ _ _ /-- Vertical composition of 2-commutative squares -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def vComp (L₁ : C₁ ⥤ C₂) (L₂ : C₂ ⥤ C₃) (H₁ : C₁ ⥤ C₄) (H₂ : C₂ ⥤ C₅) (H₃ : C₃ ⥤ C₆) (R₁ : C₄ ⥤ C₅) (R₂ : C₅ ⥤ C₆) [CatCommSq H₁ L₁ R₁ H₂] [CatCommSq H₂ L₂ R₂ H₃] : CatCommSq H₁ (L₁ ⋙ L₂) (R₁ ⋙ R₂) H₃ where @@ -104,7 +104,7 @@ section variable (T : C₁ ≌ C₂) (L : C₁ ⥤ C₃) (R : C₂ ⥤ C₄) (B : C₃ ≌ C₄) /-- Horizontal inverse of a 2-commutative square -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def hInv (_ : CatCommSq T.functor L R B.functor) : CatCommSq T.inverse R L B.inverse where iso := isoWhiskerLeft _ (L.rightUnitor.symm ≪≫ isoWhiskerLeft L B.unitIso ≪≫ (associator _ _ _).symm ≪≫ @@ -145,7 +145,7 @@ section variable (T : C₁ ⥤ C₂) (L : C₁ ≌ C₃) (R : C₂ ≌ C₄) (B : C₃ ⥤ C₄) /-- Vertical inverse of a 2-commutative square -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def vInv (_ : CatCommSq T L.functor R.functor B) : CatCommSq B L.inverse R.inverse T where iso := isoWhiskerRight (B.leftUnitor.symm ≪≫ isoWhiskerRight L.counitIso.symm B ≪≫ associator _ _ _ ≪≫ diff --git a/Mathlib/CategoryTheory/Category/Cat.lean b/Mathlib/CategoryTheory/Category/Cat.lean index f1335563886635..5e3c11a21066af 100644 --- a/Mathlib/CategoryTheory/Category/Cat.lean +++ b/Mathlib/CategoryTheory/Category/Cat.lean @@ -32,7 +32,7 @@ open Bicategory Functor -- intended to be used with explicit universe parameters /-- Category of categories. -/ -@[nolint checkUnivs] +@[nolint checkUnivs, implicit_reducible] def Cat := Bundled Category.{v, u} @@ -71,7 +71,7 @@ instance : Quiver (Cat.{v, u}) where Hom C D := Hom C D /-- The 1-morphism in `Cat` corresponding to a functor. -/ -@[simps] +@[simps, implicit_reducible] def _root_.CategoryTheory.Functor.toCatHom {C D : Type u} [Category.{v} C] [Category.{v} D] (F : C ⥤ D) : Cat.of C ⟶ Cat.of D where toFunctor := F @@ -301,10 +301,12 @@ lemma leftUnitor_hom_toNatTrans {B C : Cat.{v, u}} (F : B ⟶ C) : lemma leftUnitor_inv_toNatTrans {B C : Cat.{v, u}} (F : B ⟶ C) : (λ_ F).inv.toNatTrans = (F.toFunctor.leftUnitor).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma leftUnitor_hom_app {B C : Cat} (F : B ⟶ C) (X : B) : (λ_ F).hom.toNatTrans.app X = eqToHom (by simp) := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma leftUnitor_inv_app {B C : Cat} (F : B ⟶ C) (X : B) : (λ_ F).inv.toNatTrans.app X = eqToHom (by simp) := by simp @@ -321,10 +323,12 @@ lemma rightUnitor_hom_toNatTrans {B C : Cat.{v, u}} (F : B ⟶ C) : lemma rightUnitor_inv_toNatTrans {B C : Cat.{v, u}} (F : B ⟶ C) : (ρ_ F).inv.toNatTrans = (F.toFunctor.rightUnitor).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma rightUnitor_hom_app {B C : Cat.{v, u}} (F : B ⟶ C) (X : B) : (ρ_ F).hom.toNatTrans.app X = eqToHom (by simp) := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma rightUnitor_inv_app {B C : Cat.{v, u}} (F : B ⟶ C) (X : B) : (ρ_ F).inv.toNatTrans.app X = eqToHom (by simp) := by simp @@ -341,10 +345,12 @@ lemma associator_hom_toNatTrans {B C D E : Cat.{v, u}} (F : B ⟶ C) (G : C ⟶ lemma associator_inv_toNatTrans {B C D E : Cat.{v, u}} (F : B ⟶ C) (G : C ⟶ D) (H : D ⟶ E) : (α_ F G H).inv.toNatTrans = (Functor.associator F.toFunctor G.toFunctor H.toFunctor).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma associator_hom_app {B C D E : Cat} (F : B ⟶ C) (G : C ⟶ D) (H : D ⟶ E) (X : B) : (α_ F G H).hom.toNatTrans.app X = eqToHom (by simp) := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma associator_inv_app {B C D E : Cat} (F : B ⟶ C) (G : C ⟶ D) (H : D ⟶ E) (X : B) : (α_ F G H).inv.toNatTrans.app X = eqToHom (by simp) := by simp @@ -373,6 +379,7 @@ section attribute [local simp] eqToHom_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Any isomorphism in `Cat` induces an equivalence of the underlying categories. -/ def equivOfIso {C D : Cat} (γ : C ≅ D) : C ≌ D where @@ -400,6 +407,7 @@ end end Cat +set_option backward.isDefEq.respectTransparency.types false in /-- Embedding `Type` into `Cat` as discrete categories. This ought to be modelled as a 2-functor! diff --git a/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean b/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean index 1605de86087424..6cf7f35c809261 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Adjunction.lean @@ -40,12 +40,14 @@ private def typeToCatObjectsAdjHomEquiv : (typeToCat.obj X ⟶ C) ≃ (X ⟶ Cat obtain rfl := Discrete.eq_of_hom f simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in private def typeToCatObjectsAdjCounitApp : (Cat.objects ⋙ typeToCat).obj C ⥤ C where obj := Discrete.as map := eqToHom ∘ Discrete.eq_of_hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- `typeToCat : Type ⥤ Cat` is left adjoint to `Cat.objects : Cat ⥤ Type` -/ diff --git a/Mathlib/CategoryTheory/Category/Cat/Limit.lean b/Mathlib/CategoryTheory/Category/Cat/Limit.lean index 85c58e1dcad83f..4a3ad7a8f1030a 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Limit.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Limit.lean @@ -85,6 +85,7 @@ instance (F : J ⥤ Cat.{v, v}) : Category (limit (F ⋙ Cat.objects) :) where @[simps] def limitConeX (F : J ⥤ Cat.{v, v}) : Cat.{v, v} where α := limit (F ⋙ Cat.objects) +set_option backward.isDefEq.respectTransparency.types false in attribute [-simp] homDiagram_obj in /-- Auxiliary definition: the cone over the limit category. -/ @[simps] @@ -125,6 +126,7 @@ def limitConeLift (F : J ⥤ Cat.{v, v}) (s : Cone F) : s.pt ⟶ limitConeX F := rw [Functor.congr_hom this f] simp } +set_option backward.isDefEq.respectTransparency.types false in theorem limit_π_homDiagram_eqToHom {F : J ⥤ Cat.{v, v}} (X Y : limit (F ⋙ Cat.objects.{v, v})) (j : J) (h : X = Y) : limit.π (homDiagram X Y) j (eqToHom h) = @@ -160,6 +162,7 @@ instance : HasLimits Cat.{v, v} where has_limits_of_shape _ := { has_limit := fun F => ⟨⟨⟨HasLimits.limitCone F, HasLimits.limitConeIsLimit F⟩⟩⟩ } +set_option backward.isDefEq.respectTransparency.types false in instance : PreservesLimits Cat.objects.{v, v} where preservesLimitsOfShape := { preservesLimit := fun {F} => diff --git a/Mathlib/CategoryTheory/Category/Factorisation.lean b/Mathlib/CategoryTheory/Category/Factorisation.lean index 66f0470aeb0784..85aa1852e7eb92 100644 --- a/Mathlib/CategoryTheory/Category/Factorisation.lean +++ b/Mathlib/CategoryTheory/Category/Factorisation.lean @@ -86,6 +86,7 @@ protected def initialHom (d : Factorisation f) : Factorisation.Hom (Factorisation.initial : Factorisation f) d where h := d.ι +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : Unique ((Factorisation.initial : Factorisation f) ⟶ d) where default := Factorisation.initialHom d @@ -105,6 +106,7 @@ protected def terminalHom (d : Factorisation f) : Factorisation.Hom d (Factorisation.terminal : Factorisation f) where h := d.π +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : Unique (d ⟶ (Factorisation.terminal : Factorisation f)) where default := Factorisation.terminalHom d diff --git a/Mathlib/CategoryTheory/Category/KleisliCat.lean b/Mathlib/CategoryTheory/Category/KleisliCat.lean index f33b82e8203ecc..2c183c5f786b5f 100644 --- a/Mathlib/CategoryTheory/Category/KleisliCat.lean +++ b/Mathlib/CategoryTheory/Category/KleisliCat.lean @@ -48,6 +48,7 @@ instance KleisliCat.categoryStruct {m} [Monad.{u, v} m] : theorem KleisliCat.ext {m} [Monad.{u, v} m] (α β : KleisliCat m) (f g : α ⟶ β) (h : ∀ x, f x = g x) : f = g := funext h +set_option backward.isDefEq.respectTransparency false in instance KleisliCat.category {m} [Monad.{u, v} m] [LawfulMonad m] : Category (KleisliCat m) := by refine { id_comp := ?_, comp_id := ?_, assoc := ?_ } <;> intros <;> ext <;> diff --git a/Mathlib/CategoryTheory/Category/PartialFun.lean b/Mathlib/CategoryTheory/Category/PartialFun.lean index e2380ce6ed4ad8..9057c742ffa429 100644 --- a/Mathlib/CategoryTheory/Category/PartialFun.lean +++ b/Mathlib/CategoryTheory/Category/PartialFun.lean @@ -50,11 +50,13 @@ instance : Inhabited PartialFun.{u} := ⟨PartialFun.of PUnit⟩ -- TODO: wrap morphisms in this category into a one-field `PFun.Hom` structure +set_option backward.isDefEq.respectTransparency.types false in instance largeCategory : LargeCategory.{u} PartialFun where Hom X Y := PFun X Y id X := PFun.id X comp f g := g.comp f +set_option backward.isDefEq.respectTransparency.types false in /-- Constructs a partial function isomorphism between types from an equivalence between them. -/ @[simps] def Iso.mk {α β : PartialFun.{u}} (e : α ≃ β) : α ≅ β where @@ -69,12 +71,14 @@ def Iso.mk {α β : PartialFun.{u}} (e : α ≃ β) : α ≅ β where end PartialFun +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from `Type` to `PartialFun` which forgets that the maps are total. -/ def typeToPartialFun : Type u ⥤ PartialFun where obj := id map f := PFun.lift (f : _ → _) map_comp _ _ := PFun.coe_comp _ _ +set_option backward.isDefEq.respectTransparency.types false in instance : typeToPartialFun.Faithful where map_injective h := by ext x diff --git a/Mathlib/CategoryTheory/Category/Quiv.lean b/Mathlib/CategoryTheory/Category/Quiv.lean index 473229f413a7c4..83527163381867 100644 --- a/Mathlib/CategoryTheory/Category/Quiv.lean +++ b/Mathlib/CategoryTheory/Category/Quiv.lean @@ -85,6 +85,7 @@ def freeMap {V W : Type*} [Quiver V] [Quiver W] (F : V ⥤q W) : Paths V ⥤ Pat map := F.mapPath map_comp f g := F.mapPath_comp f g +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `free : Quiv ⥤ Cat` preserves identities up to natural isomorphism and in fact up to equality. -/ @@ -92,10 +93,12 @@ to equality. -/ def freeMapIdIso (V : Type*) [Quiver V] : freeMap (𝟭q V) ≅ 𝟭 _ := NatIso.ofComponents (fun _ ↦ Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in theorem freeMap_id (V : Type*) [Quiver V] : freeMap (𝟭q V) = 𝟭 _ := Functor.ext_of_iso (freeMapIdIso V) (fun _ ↦ rfl) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `free : Quiv ⥤ Cat` preserves composition up to natural isomorphism and in fact up to equality. -/ @@ -107,6 +110,7 @@ def freeMapCompIso {V₁ : Type u₁} {V₂ : Type u₂} {V₃ : Type u₃} dsimp simp only [Category.comp_id, Category.id_comp, Prefunctor.mapPath_comp_apply]) +set_option backward.isDefEq.respectTransparency.types false in theorem freeMap_comp {V₁ : Type u₁} {V₂ : Type u₂} {V₃ : Type u₃} [Quiver.{v₁} V₁] [Quiver.{v₂} V₂] [Quiver.{v₃} V₃] (F : V₁ ⥤q V₂) (G : V₂ ⥤q V₃) : @@ -199,6 +203,7 @@ def lift {V : Type u} [Quiver.{v} V] {C : Type u₁} [Category.{v₁} C] obj X := F.obj X map f := composePath (F.mapPath f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Naturality of `pathComposition`. -/ def pathCompositionNaturality {C : Type u} {D : Type u₁} @@ -206,6 +211,7 @@ def pathCompositionNaturality {C : Type u} {D : Type u₁} Cat.freeMap (F.toPrefunctor) ⋙ pathComposition D ≅ pathComposition C ⋙ F := Paths.liftNatIso (fun _ ↦ Iso.refl _) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Naturality of `pathComposition`, which defines a natural transformation `Quiv.forget ⋙ Cat.free ⟶ 𝟭 _`. -/ @@ -220,12 +226,14 @@ lemma pathsOf_freeMap_toPrefunctor {V : Type u} {W : Type u₁} [Quiver.{v} V] [Quiver.{v₁} W] (F : V ⥤q W) : Paths.of V ⋙q (Cat.freeMap F).toPrefunctor = F ⋙q Paths.of W := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The left triangle identity of `Cat.free ⊣ Quiv.forget` as a natural isomorphism -/ def freeMapPathsOfCompPathCompositionIso (V : Type u) [Quiver.{v} V] : Cat.freeMap (Paths.of V) ⋙ pathComposition (Paths V) ≅ 𝟭 (Paths V) := Paths.liftNatIso (fun v ↦ Iso.refl _) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma freeMap_pathsOf_pathComposition (V : Type u) [Quiver.{v} V] : Cat.freeMap (Paths.of (V := V)) ⋙ pathComposition (Paths V) = 𝟭 (Paths V) := diff --git a/Mathlib/CategoryTheory/Category/ReflQuiv.lean b/Mathlib/CategoryTheory/Category/ReflQuiv.lean index 9dd8b7a23195f1..b40935fcdbbb77 100644 --- a/Mathlib/CategoryTheory/Category/ReflQuiv.lean +++ b/Mathlib/CategoryTheory/Category/ReflQuiv.lean @@ -150,6 +150,7 @@ namespace FreeRefl variable {V} +set_option backward.isDefEq.respectTransparency.types false in instance : Category (FreeRefl V) := inferInstanceAs (Category (Quotient _)) @@ -239,6 +240,7 @@ section variable {D : Type*} [Category* D] (F : V ⥤rq D) +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for functors from `FreeRefl`. (See also `lift'` for which the data is unbundled.) -/ def lift : FreeRefl V ⥤ D := @@ -246,9 +248,11 @@ def lift : FreeRefl V ⥤ D := rintro _ _ _ _ ⟨h⟩ simp) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift_obj (v : V) : (lift F).obj (mk v) = F.obj v := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift_map {v w : V} (f : v ⟶ w) : (lift F).map (homMk f) = F.map f := Category.id_comp _ @@ -261,15 +265,18 @@ variable {D : Type*} [Category* D] (obj : V → D) (map : ∀ {v w : V}, (v ⟶ w) → (obj v ⟶ obj w)) (map_id : ∀ (v : V), map (𝟙rq v) = 𝟙 _) +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for functors from `FreeRefl`. (See also `lift` for which the data is bundled.) -/ def lift' : FreeRefl V ⥤ D := lift { obj := obj, map := map, map_id := map_id } +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift'_obj (v : V) : (lift' obj map map_id).obj (mk v) = obj v := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift'_map {v w : V} (f : v ⟶ w) : (lift' obj map map_id).map (homMk f) = map f := by @@ -295,9 +302,11 @@ lemma quotientFunctor_map_id (V) [ReflQuiver V] (X : V) : (FreeRefl.quotientFunctor V).map (𝟙rq X).toPath = 𝟙 _ := Quotient.sound _ .mk +set_option backward.isDefEq.respectTransparency.types false in instance (V : Type*) [ReflQuiver V] [Unique V] : Unique (FreeRefl V) := inferInstanceAs (Unique (Quotient _)) +set_option backward.isDefEq.respectTransparency.types false in instance (V : Type*) [ReflQuiver V] [Unique V] [∀ (x y : V), Unique (x ⟶ y)] (x y : FreeRefl V) : Unique (x ⟶ y) where @@ -327,6 +336,7 @@ def toFreeRefl : V ⥤rq FreeRefl V where obj := .mk map := FreeRefl.homMk +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] Functor.toReflPrefunctor in variable {V} in @@ -336,19 +346,23 @@ lemma FreeRefl.lift_spec {D : Type*} [Category* D] (F : V ⥤rq D) : ReflPrefunctor.ext (fun v ↦ by simp) (by simp) variable {V} {W : Type*} [ReflQuiver W] (F : V ⥤rq W) +set_option backward.isDefEq.respectTransparency.types false in /-- A refl prefunctor `V ⥤rq W` induces a functor `FreeRefl V ⥤ FreeRefl W` defined using `freeMap` and the quotient functor. -/ def freeReflMap : FreeRefl V ⥤ FreeRefl W := FreeRefl.lift' (fun v ↦ .mk (F.obj v)) (fun f ↦ FreeRefl.homMk (F.map f)) (fun v ↦ by simp) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma freeReflMap_obj (v : V) : (freeReflMap F).obj (.mk v) = .mk (F.obj v) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma freeReflMap_map {v w : V} (f : v ⟶ w) : (freeReflMap F).map (FreeRefl.homMk f) = FreeRefl.homMk (F.map f) := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem freeReflMap_naturality {V W : Type*} [ReflQuiver.{v₁} V] [ReflQuiver.{v₂} W] (F : V ⥤rq W) : FreeRefl.quotientFunctor V ⋙ freeReflMap F = @@ -366,6 +380,7 @@ def freeRefl : ReflQuiv.{v, u} ⥤ Cat.{max u v, u} where map_id X := by ext1; exact FreeRefl.functor_ext (by simp) (by simp) map_comp {X Y Z} f g := by ext1; exact FreeRefl.functor_ext (by simp) (by simp) +set_option backward.isDefEq.respectTransparency.types false in /-- We will make use of the natural quotient map from the free category on the underlying quiver of a refl quiver to the free category on the reflexive quiver. -/ def freeReflNatTrans : ReflQuiv.forgetToQuiv ⋙ Cat.free ⟶ freeRefl where diff --git a/Mathlib/CategoryTheory/Category/RelCat.lean b/Mathlib/CategoryTheory/Category/RelCat.lean index 72c463e23550e3..e5452fe7af7df8 100644 --- a/Mathlib/CategoryTheory/Category/RelCat.lean +++ b/Mathlib/CategoryTheory/Category/RelCat.lean @@ -46,6 +46,7 @@ structure Hom (X Y : RelCat.{u}) : Type u where initialize_simps_projections Hom (as_prefix rel) +set_option backward.isDefEq.respectTransparency.types false in /-- The category of types with binary relations as morphisms. -/ instance instLargeCategory : LargeCategory RelCat where Hom := Hom @@ -54,18 +55,24 @@ instance instLargeCategory : LargeCategory RelCat where namespace Hom +set_option backward.isDefEq.respectTransparency.types false in @[ext] lemma ext (f g : X ⟶ Y) (h : f.rel = g.rel) : f = g := by cases f; cases g; congr +set_option backward.isDefEq.respectTransparency.types false in @[simp] protected lemma rel_id (X : RelCat.{u}) : rel (𝟙 X) = .id := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] protected lemma rel_comp (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).rel = f.rel.comp g.rel := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem rel_id_apply₂ (x y : X) : x ~[rel (𝟙 X)] y ↔ x = y := .rfl +set_option backward.isDefEq.respectTransparency.types false in theorem rel_comp_apply₂ (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) (z : Z) : x ~[(f ≫ g).rel] z ↔ ∃ y, x ~[f.rel] y ∧ y ~[g.rel] z := .rfl end Hom +set_option backward.isDefEq.respectTransparency.types false in /-- The essentially surjective faithful embedding from the category of types and functions into the category of types and relations. -/ @[simps obj map_rel] @@ -73,11 +80,13 @@ def graphFunctor : Type u ⥤ RelCat.{u} where obj X := X map f := .ofRel (f : _ → _).graph +set_option backward.isDefEq.respectTransparency.types false in instance graphFunctor_faithful : graphFunctor.Faithful where map_injective h := by ext simp [Function.graph_injective congr(($h).rel)] +set_option backward.isDefEq.respectTransparency.types false in instance graphFunctor_essSurj : graphFunctor.EssSurj := graphFunctor.essSurj_of_surj Function.surjective_id @@ -111,19 +120,23 @@ theorem rel_iso_iff {X Y : RelCat} (r : X ⟶ Y) : section Opposite open Opposite +set_option backward.isDefEq.respectTransparency.types false in /-- The argument-swap isomorphism from `RelCat` to its opposite. -/ def opFunctor : RelCat ⥤ RelCatᵒᵖ where obj X := op X map {_ _} r := .op <| .ofRel r.rel.inv +set_option backward.isDefEq.respectTransparency.types false in /-- The other direction of `opFunctor`. -/ def unopFunctor : RelCatᵒᵖ ⥤ RelCat where obj X := unop X map {_ _} r := .ofRel r.unop.rel.inv +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem opFunctor_comp_unopFunctor_eq : Functor.comp opFunctor unopFunctor = Functor.id _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem unopFunctor_comp_opFunctor_eq : Functor.comp unopFunctor opFunctor = Functor.id _ := rfl @@ -137,10 +150,12 @@ def opEquivalence : RelCat ≌ RelCatᵒᵖ where unitIso := Iso.refl _ counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in instance : opFunctor.IsEquivalence := by change opEquivalence.functor.IsEquivalence infer_instance +set_option backward.isDefEq.respectTransparency.types false in instance : unopFunctor.IsEquivalence := by change opEquivalence.inverse.IsEquivalence infer_instance diff --git a/Mathlib/CategoryTheory/Category/TwoP.lean b/Mathlib/CategoryTheory/Category/TwoP.lean index 73b90dfe53bed5..a42cf45e2f3f54 100644 --- a/Mathlib/CategoryTheory/Category/TwoP.lean +++ b/Mathlib/CategoryTheory/Category/TwoP.lean @@ -65,10 +65,12 @@ theorem coe_toBipointed (X : TwoP) : ↥X.toBipointed = ↥X := noncomputable instance largeCategory : LargeCategory TwoP := inferInstanceAs <| Category (InducedCategory _ toBipointed) +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance concreteCategory : ConcreteCategory TwoP (fun X Y => Bipointed.HomSubtype X.toBipointed Y.toBipointed) := inferInstanceAs <| ConcreteCategory (InducedCategory _ toBipointed) _ +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance hasForgetToBipointed : HasForget₂ TwoP Bipointed := inferInstanceAs <| HasForget₂ (InducedCategory _ toBipointed) _ @@ -100,6 +102,7 @@ theorem swapEquiv_symm : swapEquiv.symm = swapEquiv := end TwoP +set_option backward.isDefEq.respectTransparency.types false in @[simp, nolint simpNF] -- mathlib builds without this simp attribute theorem TwoP_swap_comp_forget_to_Bipointed : TwoP.swap ⋙ forget₂ TwoP Bipointed = forget₂ TwoP Bipointed ⋙ Bipointed.swap := @@ -131,16 +134,19 @@ theorem pointedToTwoPFst_comp_swap : pointedToTwoPFst ⋙ TwoP.swap = pointedToT theorem pointedToTwoPSnd_comp_swap : pointedToTwoPSnd ⋙ TwoP.swap = pointedToTwoPFst := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp, nolint simpNF] -- mathlib builds without this simp attribute theorem pointedToTwoPFst_comp_forget_to_bipointed : pointedToTwoPFst ⋙ forget₂ TwoP Bipointed = pointedToBipointedFst := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp, nolint simpNF] -- mathlib builds without this simp attribute theorem pointedToTwoPSnd_comp_forget_to_bipointed : pointedToTwoPSnd ⋙ forget₂ TwoP Bipointed = pointedToBipointedSnd := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Adding a second point is left adjoint to forgetting the second point. -/ noncomputable def pointedToTwoPFstForgetCompBipointedToPointedFstAdjunction : pointedToTwoPFst ⊣ forget₂ TwoP Bipointed ⋙ bipointedToPointedFst := @@ -154,6 +160,7 @@ noncomputable def pointedToTwoPFstForgetCompBipointedToPointedFstAdjunction : · rfl } homEquiv_naturality_left_symm := fun f g => by ext (_ | _) : 4 <;> rfl } +set_option backward.isDefEq.respectTransparency.types false in /-- Adding a first point is left adjoint to forgetting the first point. -/ noncomputable def pointedToTwoPSndForgetCompBipointedToPointedSndAdjunction : pointedToTwoPSnd ⊣ forget₂ TwoP Bipointed ⋙ bipointedToPointedSnd := diff --git a/Mathlib/CategoryTheory/Category/ULift.lean b/Mathlib/CategoryTheory/Category/ULift.lean index f8aa46c9974cb4..b4ced550df606f 100644 --- a/Mathlib/CategoryTheory/Category/ULift.lean +++ b/Mathlib/CategoryTheory/Category/ULift.lean @@ -125,6 +125,7 @@ def ULiftHom.down : ULiftHom C ⥤ C where obj := ULiftHom.objDown map f := f.down +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence between `C` and `ULiftHom C`. -/ def ULiftHom.equiv : C ≌ ULiftHom C where diff --git a/Mathlib/CategoryTheory/Center/Linear.lean b/Mathlib/CategoryTheory/Center/Linear.lean index efebe39a3869c2..0608254d424364 100644 --- a/Mathlib/CategoryTheory/Center/Linear.lean +++ b/Mathlib/CategoryTheory/Center/Linear.lean @@ -53,7 +53,7 @@ variable (φ : R →+* CatCenter C) (X Y : C) /-- The scalar multiplication by `R` on the type `X ⟶ Y` of morphisms in a category `C` equipped with a ring morphism `R →+* CatCenter C`. -/ -@[implicit_reducible] +@[instance_reducible] def smulOfRingMorphism : SMul R (X ⟶ Y) where smul a f := (φ a).app X ≫ f @@ -75,7 +75,7 @@ variable (X Y) set_option backward.isDefEq.respectTransparency false in /-- The `R`-module structure on the type `X ⟶ Y` of morphisms in a category `C` equipped with a ring morphism `R →+* CatCenter C`. -/ -@[implicit_reducible] +@[instance_reducible] def homModuleOfRingMorphism : Module R (X ⟶ Y) := by letI := smulOfRingMorphism φ X Y exact @@ -97,7 +97,7 @@ def homModuleOfRingMorphism : Module R (X ⟶ Y) := by /-- The `R`-linear structure on a preadditive category `C` equipped with a ring morphism `R →+* CatCenter C`. -/ -@[implicit_reducible] +@[instance_reducible] def ofRingMorphism : Linear R C := by letI := homModuleOfRingMorphism φ exact diff --git a/Mathlib/CategoryTheory/CofilteredSystem.lean b/Mathlib/CategoryTheory/CofilteredSystem.lean index e1efcaed5e6314..0b21237cfe4798 100644 --- a/Mathlib/CategoryTheory/CofilteredSystem.lean +++ b/Mathlib/CategoryTheory/CofilteredSystem.lean @@ -94,7 +94,7 @@ theorem nonempty_sections_of_finite_cofiltered_system {J : Type u} [Category.{w} use fun j => (u ⟨j⟩).down intro j j' f have h := @hu (⟨j⟩ : J') (⟨j'⟩ : J') (ULift.up f) - simp only [F', down, AsSmall.down, Functor.comp_map, uliftFunctor_map] at h + simp only [F', down, AsSmall.down] at h simp_rw [← h] rfl @@ -307,6 +307,7 @@ variable [∀ j : J, Nonempty (F.obj j)] [∀ j : J, Finite (F.obj j)] (Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), Function.Surjective (F.map f)) include Fsur +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem eval_section_surjective_of_surjective (i : J) : (fun s : F.sections => s.val i).Surjective := fun x => by diff --git a/Mathlib/CategoryTheory/Comma/Arrow.lean b/Mathlib/CategoryTheory/Comma/Arrow.lean index 767eae2fdee3b1..c5662b53ebdc30 100644 --- a/Mathlib/CategoryTheory/Comma/Arrow.lean +++ b/Mathlib/CategoryTheory/Comma/Arrow.lean @@ -81,7 +81,7 @@ theorem comp_right {X Y Z : Arrow T} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).right = f.right ≫ g.right := rfl /-- An object in the arrow category is simply a morphism in `T`. -/ -@[simps] +@[simps, implicit_reducible] def mk {X Y : T} (f : X ⟶ Y) : Arrow T where left := X right := Y @@ -150,12 +150,14 @@ lemma ext {f g : Arrow T} (h₃ : f.hom = eqToHom h₁ ≫ g.hom ≫ eqToHom h₂.symm) : f = g := (mk_eq_mk_iff _ _).2 (by simp_all) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma arrow_mk_comp_eqToHom {X Y Y' : T} (f : X ⟶ Y) (h : Y = Y') : Arrow.mk (f ≫ eqToHom h) = Arrow.mk f := ext rfl h.symm (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma arrow_mk_eqToHom_comp {X' X Y : T} (f : X ⟶ Y) (h : X' = X) : @@ -262,6 +264,7 @@ theorem left_hom_inv_right [IsIso sq] : sq.left ≫ g.hom ≫ inv sq.right = f.h theorem inv_left_hom_right [IsIso sq] : inv sq.left ≫ f.hom ≫ sq.right = g.hom := by simp only [w, IsIso.inv_comp_eq] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance mono_left [Mono sq] : Mono sq.left where right_cancellation {Z} φ ψ h := by @@ -276,6 +279,7 @@ instance mono_left [Mono sq] : Mono sq.left where · exact h · simp [this, ← Arrow.w_mk_right, reassoc_of% h] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance epi_right [Epi sq] : Epi sq.right where left_cancellation {Z} φ ψ h := by @@ -306,6 +310,7 @@ lemma inv_hom_id_right (e : f ≅ g) : e.inv.right ≫ e.hom.right = 𝟙 _ := b end +set_option backward.isDefEq.respectTransparency.types false in /-- Given a square from an arrow `i` to an isomorphism `p`, express the source part of `sq` in terms of the inverse of `p`. -/ @[simp] @@ -313,14 +318,16 @@ theorem square_to_iso_invert (i : Arrow T) {X Y : T} (p : X ≅ Y) (sq : i ⟶ A i.hom ≫ sq.right ≫ p.inv = sq.left := by simpa only [mk_right, Category.assoc] using! (Iso.comp_inv_eq p).mpr (Arrow.w_mk_right sq).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Given a square from an isomorphism `i` to an arrow `p`, express the target part of `sq` in terms of the inverse of `i`. -/ theorem square_from_iso_invert {X Y : T} (i : X ≅ Y) (p : Arrow T) (sq : Arrow.mk i.hom ⟶ p) : i.inv ≫ sq.left ≫ p.hom = sq.right := by - simp [Arrow.w_mk_left] + simp variable {C : Type u} [Category.{v} C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A helper construction: given a square between `i` and `f ≫ g`, produce a square between `i` and `g`, whose top leg uses `f`: @@ -347,6 +354,7 @@ def leftFunc : Arrow C ⥤ C := def rightFunc : Arrow C ⥤ C := Comma.snd _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural transformation from `leftFunc` to `rightFunc`, given by the arrow itself. -/ @[simps] @@ -369,6 +377,7 @@ def mapArrow (F : C ⥤ D) : Arrow C ⥤ Arrow D where variable (C D) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `(C ⥤ D) ⥤ (Arrow C ⥤ Arrow D)` which sends a functor `F : C ⥤ D` to `F.mapArrow`. -/ @@ -379,6 +388,7 @@ def mapArrowFunctor : (C ⥤ D) ⥤ (Arrow C ⥤ Arrow D) where variable {C D} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories `Arrow C ≌ Arrow D` induced by an equivalence `C ≌ D`. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Comma/Basic.lean b/Mathlib/CategoryTheory/Comma/Basic.lean index 424c8964e8c1c0..c0ef38f1de59f1 100644 --- a/Mathlib/CategoryTheory/Comma/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/Basic.lean @@ -154,13 +154,13 @@ end variable (L) (R) /-- The functor sending an object `X` in the comma category to `X.left`. -/ -@[simps] +@[simps, implicit_reducible] def fst : Comma L R ⥤ A where obj X := X.left map f := f.left /-- The functor sending an object `X` in the comma category to `X.right`. -/ -@[simps] +@[simps, implicit_reducible] def snd : Comma L R ⥤ B where obj X := X.right map f := f.right @@ -253,7 +253,7 @@ variable {L' : A' ⥤ T'} {R' : B' ⥤ T'} set_option backward.isDefEq.respectTransparency false in /-- The functor `Comma L R ⥤ Comma L' R'` induced by three functors `F₁`, `F₂`, `F` and two natural transformations `F₁ ⋙ L' ⟶ L ⋙ F` and `R ⋙ F ⟶ F₂ ⋙ R'`. -/ -@[simps] +@[simps, implicit_reducible] def map : Comma L R ⥤ Comma L' R' where obj X := { left := F₁.obj X.left @@ -332,7 +332,7 @@ def mapSnd : map α β ⋙ snd L' R' ≅ snd L R ⋙ F₂ := end /-- A natural transformation `L₁ ⟶ L₂` induces a functor `Comma L₂ R ⥤ Comma L₁ R`. -/ -@[simps] +@[simps, implicit_reducible] def mapLeft (l : L₁ ⟶ L₂) : Comma L₂ R ⥤ Comma L₁ R where obj X := { left := X.left @@ -342,6 +342,7 @@ def mapLeft (l : L₁ ⟶ L₂) : Comma L₂ R ⥤ Comma L₁ R where { left := f.left right := f.right } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `L` is naturally isomorphic to the identity functor. -/ @@ -349,6 +350,7 @@ naturally isomorphic to the identity functor. -/ def mapLeftId : mapLeft R (𝟙 L) ≅ 𝟭 _ := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `Comma L₁ R ⥤ Comma L₃ R` induced by the composition of two natural transformations `l : L₁ ⟶ L₂` and `l' : L₂ ⟶ L₃` is naturally isomorphic to the composition of the two functors @@ -358,16 +360,18 @@ def mapLeftComp (l : L₁ ⟶ L₂) (l' : L₂ ⟶ L₃) : mapLeft R (l ≫ l') ≅ mapLeft R l' ⋙ mapLeft R l := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in /-- Two equal natural transformations `L₁ ⟶ L₂` yield naturally isomorphic functors `Comma L₁ R ⥤ Comma L₂ R`. -/ @[simps!] def mapLeftEq (l l' : L₁ ⟶ L₂) (h : l = l') : mapLeft R l ≅ mapLeft R l' := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories `Comma L₁ R ≌ Comma L₂ R`. -/ -@[simps!] +@[simps!, implicit_reducible] def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R where functor := mapLeft _ i.inv inverse := mapLeft _ i.hom @@ -375,7 +379,7 @@ def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R where counitIso := (mapLeftComp _ _ _).symm ≪≫ mapLeftEq _ _ _ i.inv_hom_id ≪≫ mapLeftId _ _ /-- A natural transformation `R₁ ⟶ R₂` induces a functor `Comma L R₁ ⥤ Comma L R₂`. -/ -@[simps] +@[simps, implicit_reducible] def mapRight (r : R₁ ⟶ R₂) : Comma L R₁ ⥤ Comma L R₂ where obj X := { left := X.left @@ -385,6 +389,7 @@ def mapRight (r : R₁ ⟶ R₂) : Comma L R₁ ⥤ Comma L R₂ where { left := f.left right := f.right } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `R` is naturally isomorphic to the identity functor. -/ @@ -392,6 +397,7 @@ naturally isomorphic to the identity functor. -/ def mapRightId : mapRight L (𝟙 R) ≅ 𝟭 _ := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `Comma L R₁ ⥤ Comma L R₃` induced by the composition of the natural transformations `r : R₁ ⟶ R₂` and `r' : R₂ ⟶ R₃` is naturally isomorphic to the composition of the functors @@ -401,16 +407,18 @@ def mapRightComp (r : R₁ ⟶ R₂) (r' : R₂ ⟶ R₃) : mapRight L (r ≫ r') ≅ mapRight L r ⋙ mapRight L r' := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in /-- Two equal natural transformations `R₁ ⟶ R₂` yield naturally isomorphic functors `Comma L R₁ ⥤ Comma L R₂`. -/ @[simps!] def mapRightEq (r r' : R₁ ⟶ R₂) (h : r = r') : mapRight L r ≅ mapRight L r' := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories `Comma L R₁ ≌ Comma L R₂`. -/ -@[simps!] +@[simps!, implicit_reducible] def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂ where functor := mapRight _ i.hom inverse := mapRight _ i.inv @@ -424,7 +432,7 @@ section variable {C : Type u₄} [Category.{v₄} C] /-- The functor `(F ⋙ L, R) ⥤ (L, R)` -/ -@[simps] +@[simps, implicit_reducible] def preLeft (F : C ⥤ A) (L : A ⥤ T) (R : B ⥤ T) : Comma (F ⋙ L) R ⥤ Comma L R where obj X := { left := F.obj X.left @@ -435,6 +443,7 @@ def preLeft (F : C ⥤ A) (L : A ⥤ T) (R : B ⥤ T) : Comma (F ⋙ L) R ⥤ Co right := f.right w := by simpa using! f.w } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Comma.preLeft` is a particular case of `Comma.map`, but with better definitional properties. -/ @@ -457,7 +466,7 @@ instance isEquivalence_preLeft (F : C ⥤ A) (L : A ⥤ T) (R : B ⥤ T) [F.IsEq set_option backward.isDefEq.respectTransparency false in /-- The functor `(L, F ⋙ R) ⥤ (L, R)` -/ -@[simps] +@[simps, implicit_reducible] def preRight (L : A ⥤ T) (F : C ⥤ B) (R : B ⥤ T) : Comma L (F ⋙ R) ⥤ Comma L R where obj X := { left := X.left @@ -467,6 +476,7 @@ def preRight (L : A ⥤ T) (F : C ⥤ B) (R : B ⥤ T) : Comma L (F ⋙ R) ⥤ C { left := f.left right := F.map f.right } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Comma.preRight` is a particular case of `Comma.map`, but with better definitional properties. -/ @@ -500,6 +510,7 @@ def post (L : A ⥤ T) (R : B ⥤ T) (F : T ⥤ C) : Comma L R ⥤ Comma (L ⋙ right := f.right w := by simp only [Functor.comp_map, ← F.map_comp, f.w] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Comma.post` is a particular case of `Comma.map`, but with better definitional properties. -/ def postIso (L : A ⥤ T) (R : B ⥤ T) (F : T ⥤ C) : @@ -532,6 +543,7 @@ def fromProd (L : A ⥤ Discrete PUnit) (R : B ⥤ Discrete PUnit) : { left := f.1 right := f.2 } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Taking the comma category of two functors into `Discrete PUnit` results in something is equivalent to their product. -/ @@ -543,24 +555,28 @@ def equivProd (L : A ⥤ Discrete PUnit) (R : B ⥤ Discrete PUnit) : unitIso := Iso.refl _ counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- Taking the comma category of a functor into `A ⥤ Discrete PUnit` and the identity `Discrete PUnit ⥤ Discrete PUnit` results in a category equivalent to `A`. -/ def toPUnitIdEquiv (L : A ⥤ Discrete PUnit) (R : Discrete PUnit ⥤ Discrete PUnit) : Comma L R ≌ A := (equivProd L _).trans (prod.rightUnitorEquivalence A) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toPUnitIdEquiv_functor_iso {L : A ⥤ Discrete PUnit} {R : Discrete PUnit ⥤ Discrete PUnit} : (toPUnitIdEquiv L R).functor = fst L R := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Taking the comma category of the identity `Discrete PUnit ⥤ Discrete PUnit` and a functor `B ⥤ Discrete PUnit` results in a category equivalent to `B`. -/ def toIdPUnitEquiv (L : Discrete PUnit ⥤ Discrete PUnit) (R : B ⥤ Discrete PUnit) : Comma L R ≌ B := (equivProd _ R).trans (prod.leftUnitorEquivalence B) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toIdPUnitEquiv_functor_iso {L : Discrete PUnit ⥤ Discrete PUnit} {R : B ⥤ Discrete PUnit} : diff --git a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean index b1f67c4c554b52..27f8412c6ab65a 100644 --- a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean +++ b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean @@ -86,6 +86,7 @@ noncomputable def Arrow.shrinkHomsEquiv (C : Type u) [Category.{v} C] [LocallySm left_inv _ := by simp right_inv _ := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The bijection `Arrow (Shrink C) ≃ Arrow C`. -/ noncomputable def Arrow.shrinkEquiv (C : Type u) [Category.{v} C] [Small.{w} C] : diff --git a/Mathlib/CategoryTheory/Comma/Final.lean b/Mathlib/CategoryTheory/Comma/Final.lean index 471c7c667af357..4634a7bdc89a2a 100644 --- a/Mathlib/CategoryTheory/Comma/Final.lean +++ b/Mathlib/CategoryTheory/Comma/Final.lean @@ -76,6 +76,7 @@ variable {B : Type u₂} [Category.{v₂} B] variable {T : Type u₃} [Category.{v₃} T] variable (L : A ⥤ T) (R : B ⥤ T) +set_option backward.isDefEq.respectTransparency.types false in instance final_fst [R.Final] : (fst L R).Final := by let sA : A ≌ AsSmall.{max u₁ u₂ u₃ v₁ v₂ v₃} A := AsSmall.equiv let sB : B ≌ AsSmall.{max u₁ u₂ u₃ v₁ v₂ v₃} B := AsSmall.equiv @@ -176,6 +177,7 @@ lemma isCofiltered_of_initial [IsCofiltered A] [IsCofiltered B] [L.Initial] : IsCofiltered (Comma L R) := IsCofiltered.of_equivalence (Comma.opEquiv _ _).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local instance] final_of_isFiltered_of_pUnit in /-- Let `A` and `B` be filtered categories, `R : B ⥤ T` be final and `R : A ⥤ T`. Then, the diff --git a/Mathlib/CategoryTheory/Comma/Over/Basic.lean b/Mathlib/CategoryTheory/Comma/Over/Basic.lean index 930b487f42e385..ade71fe2cc76df 100644 --- a/Mathlib/CategoryTheory/Comma/Over/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/Over/Basic.lean @@ -35,7 +35,7 @@ variable {D : Type u₂} [Category.{v₂} D] /-- The over category has as objects arrows in `T` with codomain `X` and as morphisms commutative triangles. -/ -@[stacks 001G] +@[stacks 001G, implicit_reducible] def Over (X : T) := CostructuredArrow (𝟭 T) X @@ -95,7 +95,7 @@ theorem comp_left (a b c : Over X) (f : a ⟶ b) (g : b ⟶ c) : (f ≫ g).left rfl /-- To give an object in the over category, it suffices to give a morphism with codomain `X`. -/ -@[simps! left hom] +@[simps! left hom, implicit_reducible] def mk {X Y : T} (f : Y ⟶ X) : Over X := CostructuredArrow.mk f @@ -195,7 +195,7 @@ def forgetCocone (X : T) : Limits.Cocone (forget X) := ι := { app := Comma.hom } } /-- A morphism `f : X ⟶ Y` induces a functor `Over X ⥤ Over Y` in the obvious way. -/ -@[stacks 001G] +@[stacks 001G, implicit_reducible] def map {Y : T} (f : X ⟶ Y) : Over X ⥤ Over Y := Comma.mapRight _ <| Discrete.natTrans fun _ => f @@ -239,11 +239,13 @@ better computational properties, when used, for instance, in developing the theory of Beck-Chevalley transformations. -/ +set_option backward.isDefEq.respectTransparency.types false in /-- The natural isomorphism arising from `mapForget_eq`. -/ @[simps!] def mapId (Y : T) : map (𝟙 Y) ≅ 𝟭 _ := NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Mapping by the identity morphism is just the identity functor. -/ theorem mapId_eq (Y : T) : map (𝟙 Y) = 𝟭 _ := @@ -258,6 +260,7 @@ theorem mapForget_eq {X Y : T} (f : X ⟶ Y) : def mapForget {X Y : T} (f : X ⟶ Y) : (map f) ⋙ (forget Y) ≅ (forget X) := eqToIso (mapForget_eq f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism arising from `mapComp_eq`. -/ @[simps!] @@ -265,6 +268,7 @@ def mapComp {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : map (f ≫ g) ≅ map f ⋙ map g := NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Mapping by the composite morphism `f ≫ g` is the same as mapping by `f` then by `g`. -/ theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : @@ -273,12 +277,14 @@ theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : (fun _ ↦ by simp [map, Comma.mapRight]) (fun _ ↦ by ext; simp [eqToHom_left]) +set_option backward.isDefEq.respectTransparency.types false in /-- If `f = g`, then `map f` is naturally isomorphic to `map g`. -/ @[simps!] def mapCongr {X Y : T} (f g : X ⟶ Y) (h : f = g) : map f ≅ map g := NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapCongr_rfl {X Y : T} (f : X ⟶ Y) : mapCongr f f rfl = Iso.refl _ := rfl @@ -369,6 +375,7 @@ theorem iteratedSliceBackward_forget (f : Over X) : iteratedSliceBackward f ⋙ Over.forget f = Over.map f.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given f : Y ⟶ X, we have an equivalence between (T/X)/f and T/Y -/ @[simps] @@ -394,6 +401,7 @@ def iteratedSliceForwardNaturalityIso {g : Over X} (p : f ⟶ g) : iteratedSliceForward f ⋙ Over.map p.left ≅ Over.map p ⋙ iteratedSliceForward g := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism relating the functor `Over.map p` to the functor `Over.map p.left`, mediated by the underlying functor of the iterated slice equivalence. @@ -424,6 +432,7 @@ lemma post_forget_eq_forget_comp (F : T ⥤ D) (X : T) : post F ⋙ forget (F.obj X) = forget X ⋙ F := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `post (F ⋙ G)` is isomorphic (actually equal) to `post F ⋙ post G`. -/ @[simps!] @@ -434,6 +443,7 @@ def postComp {E : Type*} [Category* E] (F : T ⥤ D) (G : D ⥤ E) : dsimp only [Iso.refl_hom, Over.comp_left, Over.id_left] simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural transformation `F ⟶ G` induces a natural transformation on `Over X` up to `Over.map`. -/ @@ -441,6 +451,7 @@ set_option backward.defeqAttrib.useBackward true in def postMap {F G : T ⥤ D} (e : F ⟶ G) : post F ⋙ map (e.app X) ⟶ post G where app Y := Over.homMk (e.app Y.left) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` and `G` are naturally isomorphic, then `Over.post F` and `Over.post G` are also naturally isomorphic up to `Over.map` -/ @@ -470,12 +481,14 @@ instance [F.Full] [F.EssSurj] : (Over.post (X := X) F).EssSurj where instance [F.IsEquivalence] : (Over.post (X := X) F).IsEquivalence where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` is fully faithful, then so is `Over.post F`. -/ def _root_.CategoryTheory.Functor.FullyFaithful.over (h : F.FullyFaithful) : (post (X := X) F).FullyFaithful where preimage {A B} f := Over.homMk (h.preimage f.left) <| h.map_injective (by simpa using Over.w f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `G` is a right adjoint, then so is `post G : Over Y ⥤ Over (G Y)`. @@ -497,6 +510,7 @@ instance isRightAdjoint_post {Y : D} {G : D ⥤ T} [G.IsRightAdjoint] : (post (X := Y) G).IsRightAdjoint := let ⟨F, ⟨a⟩⟩ := ‹G.IsRightAdjoint›; ⟨_, ⟨postAdjunctionRight a⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories induces an equivalence on over categories. -/ @[simps] @@ -515,6 +529,7 @@ def iteratedSliceForwardIsoPost (f : Over X) : open Limits +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {X} in /-- If `X : T` is terminal, then the over category of `X` is equivalent to `T`. -/ @@ -532,8 +547,9 @@ For the converse direction see `CategoryTheory.WithTerminal.commaFromOver`. -/ protected def lift {J : Type*} [Category* J] (D : J ⥤ T) {X : T} (s : D ⟶ (Functor.const J).obj X) : J ⥤ Over X where obj j := mk (s.app j) - map f := homMk (D.map f) (by simpa using s.naturality f) + map f := homMk (D.map f) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The induced cone on `Over X` on the lifted functor. -/ @[simps] @@ -543,6 +559,7 @@ def liftCone {J : Type*} [Category* J] (D : J ⥤ T) {X : T} (s : D ⟶ (Functor pt := mk p π.app j := homMk (c.π.app j) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The lifted cone on `Over X` is a limit cone if the original cone was limiting and `J` is nonempty. -/ @@ -564,6 +581,7 @@ def isLimitLiftCone {J : Type*} [Category* J] [Nonempty J] end Over +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restrict a cone to the diagram over `j`. This preserves being limiting if the forgetful functor @@ -602,6 +620,7 @@ namespace costructuredArrowToOverEquivalence variable (F : D ⥤ T) {X : T} (Y : Over X) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `costructuredArrowToOverEquivalence`. -/ @[simps] @@ -623,6 +642,7 @@ def inverse : CostructuredArrow F Y.left ⥤ CostructuredArrow (toOver F X) Y wh end costructuredArrowToOverEquivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A category of costructured arrows for a functor `toOver F X` identifies to a category of costructured arrows for `F`. -/ @@ -818,11 +838,13 @@ demonstrate, for instance, that under categories assemble into a functor `mapFunctor : Tᵒᵖ ⥤ Cat`. -/ +set_option backward.isDefEq.respectTransparency.types false in /-- Mapping by the identity morphism is just the identity functor. -/ @[simps!] def mapId (Y : T) : map (𝟙 Y) ≅ 𝟭 _ := NatIso.ofComponents (fun _ ↦ isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Mapping by the identity morphism is just the identity functor. -/ theorem mapId_eq (Y : T) : map (𝟙 Y) = 𝟭 _ := @@ -837,6 +859,7 @@ theorem mapForget_eq {X Y : T} (f : X ⟶ Y) : def mapForget {X Y : T} (f : X ⟶ Y) : (map f) ⋙ (forget X) ≅ (forget Y) := eqToIso (mapForget_eq f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Mapping by the composite morphism `f ≫ g` is the same as mapping by `f` then by `g`. -/ theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : @@ -936,6 +959,7 @@ lemma post_forget_eq_forget_comp (F : T ⥤ D) (X : T) : post F ⋙ forget (F.obj X) = forget X ⋙ F := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `post (F ⋙ G)` is isomorphic (actually equal) to `post F ⋙ post G`. -/ @[simps!] @@ -946,6 +970,7 @@ def postComp {E : Type*} [Category* E] (F : T ⥤ D) (G : D ⥤ E) : dsimp only [Iso.refl_hom, Under.comp_right, Under.id_right] simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural transformation `F ⟶ G` induces a natural transformation on `Under X` up to `Under.map`. -/ @@ -953,6 +978,7 @@ set_option backward.defeqAttrib.useBackward true in def postMap {F G : T ⥤ D} (e : F ⟶ G) : post (X := X) F ⟶ post G ⋙ map (e.app X) where app Y := Under.homMk (e.app Y.right) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` and `G` are naturally isomorphic, then `Under.post F` and `Under.post G` are also naturally isomorphic up to `Under.map` -/ @@ -982,12 +1008,14 @@ instance [F.Full] [F.EssSurj] : (Under.post (X := X) F).EssSurj where instance [F.IsEquivalence] : (Under.post (X := X) F).IsEquivalence where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` is fully faithful, then so is `Under.post F`. -/ def _root_.CategoryTheory.Functor.FullyFaithful.under (h : F.FullyFaithful) : (post (X := X) F).FullyFaithful where preimage {A B} f := Under.homMk (h.preimage f.right) <| h.map_injective (by simpa using Under.w f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` is a left adjoint, then so is `post F : Under X ⥤ Under (F X)`. @@ -1014,6 +1042,7 @@ def postAdjunctionLeft {X : T} {F : T ⥤ D} {G : D ⥤ T} (a : F ⊣ G) : instance isLeftAdjoint_post [F.IsLeftAdjoint] : (post (X := X) F).IsLeftAdjoint := let ⟨G, ⟨a⟩⟩ := ‹F.IsLeftAdjoint›; ⟨_, ⟨postAdjunctionLeft a⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories induces an equivalence on under categories. -/ @[simps] @@ -1025,6 +1054,7 @@ def postEquiv (F : T ≌ D) : Under X ≌ Under (F.functor.obj X) where open Limits +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {X} in /-- If `X : T` is initial, then the under category of `X` is equivalent to `T`. -/ @@ -1043,6 +1073,7 @@ protected def lift {J : Type*} [Category* J] (D : J ⥤ T) {X : T} (s : (Functor obj j := .mk (s.app j) map f := Under.homMk (D.map f) (by simpa using (s.naturality f).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The induced cocone on `Under X` from on the lifted functor. -/ @[simps] @@ -1052,6 +1083,7 @@ def liftCocone {J : Type*} [Category* J] (D : J ⥤ T) {X : T} (s : (Functor.con pt := mk p ι.app j := homMk (c.ι.app j) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The lifted cocone on `Under X` is a colimit cocone if the original cocone was colimiting and `J` is nonempty. -/ @@ -1073,6 +1105,7 @@ def isColimitLiftCocone {J : Type*} [Category* J] [Nonempty J] end Under +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Restrict a cocone to the diagram under `j`. This preserves being colimiting if the forgetful functor @@ -1182,6 +1215,7 @@ end Functor namespace StructuredArrow +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor from the structured arrow category on the projection functor for any structured arrow category. -/ @@ -1193,6 +1227,7 @@ def ofStructuredArrowProjEquivalence.functor (F : D ⥤ T) (Y : T) (X : D) : (fun g => by exact g.hom) (fun m => by have := m.w; cat_disch)) _ _ (fun f => f.right.hom) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor of `ofStructuredArrowProjEquivalence.functor`. -/ @[simps!] @@ -1203,6 +1238,7 @@ def ofStructuredArrowProjEquivalence.inverse (F : D ⥤ T) (Y : T) (X : D) : (fun g => by exact g.hom) (fun m => by have := m.w; cat_disch)) _ _ (fun f => f.right.hom) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Characterization of the structured arrow category on the projection functor of any structured arrow category. -/ @@ -1213,6 +1249,7 @@ def ofStructuredArrowProjEquivalence (F : D ⥤ T) (Y : T) (X : D) : unitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by simp) counitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical functor from the structured arrow category on the diagonal functor `T ⥤ T × T` to the structured arrow category on `Under.forget`. -/ @@ -1224,6 +1261,7 @@ def ofDiagEquivalence.functor (X : T × T) : (fun f ↦ f.hom.1) (fun g ↦ by simp [← w g])) _ _ (fun f ↦ f.hom.2) (fun g ↦ by simp [← w g]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor of `ofDiagEquivalence.functor`. -/ @[simps!] @@ -1232,6 +1270,7 @@ def ofDiagEquivalence.inverse (X : T × T) : Functor.toStructuredArrow (StructuredArrow.proj _ _ ⋙ Under.forget _) _ _ (fun f => (f.right.hom, f.hom)) (fun m => by have := m.w; cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Characterization of the structured arrow category on the diagonal functor `T ⥤ T × T`. -/ def ofDiagEquivalence (X : T × T) : @@ -1253,6 +1292,7 @@ section CommaFst variable {C : Type u₃} [Category.{v₃} C] (F : C ⥤ T) (G : D ⥤ T) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor used to define the equivalence `ofCommaSndEquivalence`. -/ @[simps] @@ -1269,6 +1309,7 @@ def ofCommaSndEquivalenceInverse (c : C) : Functor.toStructuredArrow (Comma.preLeft (Under.forget c) F G) _ _ (fun Y => Y.left.hom) (fun _ => by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- There is a canonical equivalence between the structured arrow category with domain `c` on the functor `Comma.fst F G : Comma F G ⥤ F` and the comma category over @@ -1287,6 +1328,7 @@ end StructuredArrow namespace CostructuredArrow +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor from the costructured arrow category on the projection functor for any costructured arrow category. -/ @@ -1298,6 +1340,7 @@ def ofCostructuredArrowProjEquivalence.functor (F : T ⥤ D) (Y : D) (X : T) : (fun g => by exact g.hom) (fun m => by have := m.w; cat_disch)) _ _ (fun f => f.left.hom) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor of `ofCostructuredArrowProjEquivalence.functor`. -/ @[simps!] @@ -1308,6 +1351,7 @@ def ofCostructuredArrowProjEquivalence.inverse (F : T ⥤ D) (Y : D) (X : T) : (fun g => by exact g.hom) (fun m => by have := m.w; cat_disch)) _ _ (fun f => f.left.hom) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Characterization of the costructured arrow category on the projection functor of any costructured arrow category. -/ @@ -1319,6 +1363,7 @@ def ofCostructuredArrowProjEquivalence (F : T ⥤ D) (Y : D) (X : T) : unitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by simp) counitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical functor from the costructured arrow category on the diagonal functor `T ⥤ T × T` to the costructured arrow category on `Under.forget`. -/ @@ -1331,6 +1376,7 @@ def ofDiagEquivalence.functor (X : T × T) : _ _ (fun f => f.hom.2) (fun m => by have := congrArg (·.2) m.w; cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor of `ofDiagEquivalence.functor`. -/ @[simps!] @@ -1339,6 +1385,7 @@ def ofDiagEquivalence.inverse (X : T × T) : Functor.toCostructuredArrow (CostructuredArrow.proj _ _ ⋙ Over.forget _) _ X (fun f => (f.left.hom, f.hom)) (fun m => by have := m.w; cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Characterization of the costructured arrow category on the diagonal functor `T ⥤ T × T`. -/ def ofDiagEquivalence (X : T × T) : @@ -1361,6 +1408,7 @@ section CommaFst variable {C : Type u₃} [Category.{v₃} C] (F : C ⥤ T) (G : D ⥤ T) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor used to define the equivalence `ofCommaFstEquivalence`. -/ @[simps] @@ -1377,6 +1425,7 @@ def ofCommaFstEquivalenceInverse (c : C) : Functor.toCostructuredArrow (Comma.preLeft (Over.forget c) F G) _ _ (fun Y => Y.left.hom) (fun _ => by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- There is a canonical equivalence between the costructured arrow category with codomain `c` on the functor `Comma.fst F G : Comma F G ⥤ F` and the comma category over diff --git a/Mathlib/CategoryTheory/Comma/Over/OverClass.lean b/Mathlib/CategoryTheory/Comma/Over/OverClass.lean index 0252308ec07e47..a3d88519658425 100644 --- a/Mathlib/CategoryTheory/Comma/Over/OverClass.lean +++ b/Mathlib/CategoryTheory/Comma/Over/OverClass.lean @@ -173,6 +173,7 @@ instance {f : X ⟶ Y} [IsIso f] [HomIsOver f S] : HomIsOver (inv f) S where end OverClass +set_option backward.isDefEq.respectTransparency.types false in /-- Reinterpret an isomorphism over an object `S` into an isomorphism in the category over `S`. -/ @[simps] def Iso.asOver (e : X ≅ Y) [HomIsOver e.hom S] : OverClass.asOver X S ≅ OverClass.asOver Y S where diff --git a/Mathlib/CategoryTheory/Comma/Over/Pullback.lean b/Mathlib/CategoryTheory/Comma/Over/Pullback.lean index 4eb249b5a8a64d..edda67d63234cc 100644 --- a/Mathlib/CategoryTheory/Comma/Over/Pullback.lean +++ b/Mathlib/CategoryTheory/Comma/Over/Pullback.lean @@ -59,7 +59,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- In a category with pullbacks, a morphism `f : X ⟶ Y` induces a functor `Over Y ⥤ Over X`, by pulling back a morphism along `f`. -/ -@[simps! +simpRhs obj_left obj_hom map_left] +@[simps! +simpRhs obj_left obj_hom map_left, implicit_reducible] def pullback {X Y : C} (f : X ⟶ Y) [HasPullbacksAlong f] : Over Y ⥤ Over X where obj g := Over.mk (pullback.snd g.hom f) @@ -158,11 +158,13 @@ Note that the binary products assumption is necessary: the existence of a right -/ def forgetAdjStar : forget X ⊣ star X := (coalgebraEquivOver X).symm.toAdjunction.comp (adj _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma forgetAdjStar_counit_app (X Y : C) : (Over.forgetAdjStar X).counit.app Y = prod.snd := by simp [Over.forgetAdjStar, CategoryTheory.coalgebraEquivOver] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma forgetAdjStar_unit_app_left (X : C) (Y : Over X) : diff --git a/Mathlib/CategoryTheory/Comma/Over/StrictInitial.lean b/Mathlib/CategoryTheory/Comma/Over/StrictInitial.lean index 9d8dc2d9944a0d..37e29b9f99feb3 100644 --- a/Mathlib/CategoryTheory/Comma/Over/StrictInitial.lean +++ b/Mathlib/CategoryTheory/Comma/Over/StrictInitial.lean @@ -41,6 +41,7 @@ def overEquivOfIsInitial [HasStrictInitialObjects C] (X : C) (h : IsInitial X) : Over.isoMk (asIso A.hom) counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `C` has strict terminal objects and `X` is a terminal object, the category `Under X` is equivalent to a point. -/ diff --git a/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean b/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean index fb651c8fc85183..db42a2b7f6ae84 100644 --- a/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/Presheaf/Basic.lean @@ -206,6 +206,7 @@ def restrictedYonedaObj {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) : obj s := OverArrows η s.unop.hom map f := ↾fun u ↦ u.map₂ f.unop.left f.unop.w +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functoriality of `restrictedYonedaObj η` in `η`. -/ @[simps] @@ -213,6 +214,7 @@ def restrictedYonedaObjMap₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G (hε : ε ≫ μ = η) : restrictedYonedaObj η ⟶ restrictedYonedaObj μ where app _ := ↾fun u ↦ u.map₁ ε hε +set_option backward.isDefEq.respectTransparency.types false in /-- This is basically just `yoneda : Over A ⥤ (Over A)ᵒᵖ ⥤ Type (max u v)` restricted in the second argument along the forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way @@ -389,6 +391,7 @@ def yonedaCollectionPresheaf (A : Cᵒᵖ ⥤ Type v) (F : (CostructuredArrow yo obj X := YonedaCollection F X.unop map f := ↾(YonedaCollection.map₂ F f.unop) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functoriality of `yonedaCollectionPresheaf A F` in `F`. -/ @[simps] @@ -414,6 +417,7 @@ def yonedaCollectionPresheafToA (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type yonedaCollectionPresheaf A F ⟶ A where app _ := ↾(YonedaCollection.yonedaEquivFst) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- This is the reverse direction of the equivalence we're constructing. -/ @[simps! obj map] @@ -485,12 +489,14 @@ def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) : yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F := NatIso.ofComponents (fun X => unitAuxAuxAux η X.unop) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Intermediate stage of assembling the unit. -/ @[simps! hom_left] def unitAux (η : Over A) : (restrictedYoneda A ⋙ costructuredArrowPresheafToOver A).obj η ≅ η := Over.isoMk (unitAuxAux η.hom) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit of the equivalence we're constructing. -/ def unit (A : Cᵒᵖ ⥤ Type v) : 𝟭 (Over A) ≅ restrictedYoneda A ⋙ costructuredArrowPresheafToOver A := @@ -583,6 +589,7 @@ def counitAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) : F ≅ restrictedYonedaObj (yonedaCollectionPresheafToA F) := NatIso.ofComponents (fun s => counitAuxAux F s.unop) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The counit of the equivalence we're constructing. -/ def counit (A : Cᵒᵖ ⥤ Type v) : @@ -595,6 +602,7 @@ end OverPresheafAux open OverPresheafAux +set_option backward.isDefEq.respectTransparency.types false in /-- If `A : Cᵒᵖ ⥤ Type v` is a presheaf, then we have an equivalence between presheaves lying over `A` and the category of presheaves on `CostructuredArrow yoneda A`. There is a quasicommutative @@ -616,6 +624,7 @@ def CostructuredArrow.toOverCompOverEquivPresheafCostructuredArrow (A : Cᵒᵖ CostructuredArrow.toOver yoneda A ⋙ (overEquivPresheafCostructuredArrow A).functor ≅ yoneda := toOverYonedaCompRestrictedYoneda A +set_option backward.isDefEq.respectTransparency.types false in /-- This isomorphism says that hom-sets in the category `Over A` for a presheaf `A` where the domain is of the form `(CostructuredArrow.toOver yoneda A).obj X` can instead be interpreted as hom-sets in the category `(CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v` where the domain is of the diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean index c82b8d8d072083..54d86af73fb482 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/Basic.lean @@ -36,10 +36,12 @@ and morphisms `C`-morphisms `Y ⟶ Y'` making the obvious triangle commute. -/ -- We explicitly come from `PUnit.{1}` here to obtain the correct universe for morphisms of -- structured arrows. +@[implicit_reducible] def StructuredArrow (S : D) (T : C ⥤ D) := Comma (Functor.fromPUnit.{0} S) T /-- The type of morphisms in the category `StructuredArrow`. -/ +@[implicit_reducible] protected def StructuredArrow.Hom {S : D} {T : C ⥤ D} (f g : StructuredArrow S T) : Type v₁ := CommaMorphism f g @@ -91,6 +93,7 @@ theorem hom_eq_iff {X Y : StructuredArrow S T} (f g : X ⟶ Y) : f = g ↔ f.rig ⟨fun h ↦ by rw [h], hom_ext _ _⟩ /-- Construct a structured arrow from a morphism. -/ +@[implicit_reducible] def mk (f : S ⟶ T.obj Y) : StructuredArrow S T := ⟨⟨⟨⟩⟩, Y, f⟩ @@ -127,7 +130,7 @@ set_option backward.defeqAttrib.useBackward true in we need a morphism of the objects underlying the target, and to check that the triangle commutes. -/ -@[simps right] +@[simps right, implicit_reducible] def homMk {f f' : StructuredArrow S T} (g : f.right ⟶ f'.right) (w : f.hom ≫ T.map g = f'.hom := by cat_disch) : f ⟶ f' where left := 𝟙 f.left @@ -145,12 +148,14 @@ def homMk' (f : StructuredArrow S T) (g : f.right ⟶ Y') : f ⟶ mk (f.hom ≫ left := 𝟙 _ right := g +set_option backward.isDefEq.respectTransparency.types false in lemma homMk'_id (f : StructuredArrow S T) : homMk' f (𝟙 f.right) = eqToHom (by cat_disch) := by simp [eqToHom_right] lemma homMk'_mk_id (f : S ⟶ T.obj Y) : homMk' (mk f) (𝟙 Y) = eqToHom (by simp) := homMk'_id _ +set_option backward.isDefEq.respectTransparency.types false in lemma homMk'_comp (f : StructuredArrow S T) (g : f.right ⟶ Y') (g' : Y' ⟶ Y'') : homMk' f (g ≫ g') = homMk' f g ≫ homMk' (mk (f.hom ≫ T.map g)) g' ≫ eqToHom (by simp) := by simp [eqToHom_right] @@ -165,7 +170,9 @@ def mkPostcomp (f : S ⟶ T.obj Y) (g : Y ⟶ Y') : mk f ⟶ mk (f ≫ T.map g) left := 𝟙 _ right := g +set_option backward.isDefEq.respectTransparency.types false in lemma mkPostcomp_id (f : S ⟶ T.obj Y) : mkPostcomp f (𝟙 Y) = eqToHom (by simp) := by simp +set_option backward.isDefEq.respectTransparency.types false in lemma mkPostcomp_comp (f : S ⟶ T.obj Y) (g : Y ⟶ Y') (g' : Y' ⟶ Y'') : mkPostcomp f (g ≫ g') = mkPostcomp f g ≫ mkPostcomp (f ≫ T.map g) g' ≫ eqToHom (by simp) := by simp @@ -234,7 +241,7 @@ Ideally this would be described as a 2-functor from `D` (promoted to a 2-category with equations as 2-morphisms) to `Cat`. -/ -@[simps!] +@[simps!, implicit_reducible] def map (f : S ⟶ S') : StructuredArrow S' T ⥤ StructuredArrow S T := Comma.mapLeft _ ((Functor.const _).map f) @@ -254,22 +261,24 @@ theorem map_comp {f : S ⟶ S'} {f' : S' ⟶ S''} {h : StructuredArrow S'' T} : simp /-- An isomorphism `S ≅ S'` induces an equivalence `StructuredArrow S T ≌ StructuredArrow S' T`. -/ -@[simps!] +@[simps!, implicit_reducible] def mapIso (i : S ≅ S') : StructuredArrow S T ≌ StructuredArrow S' T := Comma.mapLeftIso _ ((Functor.const _).mapIso i) /-- A natural isomorphism `T ≅ T'` induces an equivalence `StructuredArrow S T ≌ StructuredArrow S T'`. -/ -@[simps!] +@[simps!, implicit_reducible] def mapNatIso (i : T ≅ T') : StructuredArrow S T ≌ StructuredArrow S T' := Comma.mapRightIso _ i +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance proj_reflectsIsomorphisms : (proj S T).ReflectsIsomorphisms where reflects f t := ⟨StructuredArrow.homMk (inv ((proj S T).map f) :), by simp⟩ open CategoryTheory.Limits +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The identity structured arrow is initial. -/ noncomputable def mkIdInitial [T.Full] [T.Faithful] : IsInitial (mk (𝟙 (T.obj Y))) where @@ -283,7 +292,7 @@ noncomputable def mkIdInitial [T.Full] [T.Faithful] : IsInitial (mk (𝟙 (T.obj variable {A : Type u₃} [Category.{v₃} A] {B : Type u₄} [Category.{v₄} B] /-- The functor `(S, F ⋙ G) ⥤ (S, G)`. -/ -@[simps!] +@[simps!, implicit_reducible] def pre (S : D) (F : B ⥤ C) (G : C ⥤ D) : StructuredArrow S (F ⋙ G) ⥤ StructuredArrow S G := Comma.preRight _ F G @@ -313,6 +322,7 @@ set_option backward.defeqAttrib.useBackward true in instance (S : C) (F : B ⥤ C) (G : C ⥤ D) : (post S F G).Faithful where map_injective {_ _} _ _ h := by simpa [ext_iff] using h +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance (S : C) (F : B ⥤ C) (G : C ⥤ D) [G.Faithful] : (post S F G).Full where map_surjective f := ⟨homMk f.right (G.map_injective (by simpa using f.w)), by simp⟩ @@ -332,33 +342,31 @@ variable {L : D} {R : C ⥤ D} {L' : B} {R' : A ⥤ B} {F : C ⥤ A} {G : D ⥤ /-- The functor `StructuredArrow L R ⥤ StructuredArrow L' R'` that is deduced from a natural transformation `R ⋙ G ⟶ F ⋙ R'` and a morphism `L' ⟶ G.obj L.` -/ -@[simps!] +@[simps!, implicit_reducible] def map₂ : StructuredArrow L R ⥤ StructuredArrow L' R' := Comma.map (F₁ := 𝟭 (Discrete PUnit)) (Discrete.natTrans (fun _ => α)) β instance faithful_map₂ [F.Faithful] : (map₂ α β).Faithful := by apply Comma.faithful_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance full_map₂ [G.Faithful] [F.Full] [IsIso α] [IsIso β] : (map₂ α β).Full := by - apply +allowSynthFailures Comma.full_map - rw [NatTrans.isIso_iff_isIso_app] - intro; dsimp; infer_instance + apply Comma.full_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance essSurj_map₂ [F.EssSurj] [G.Full] [IsIso α] [IsIso β] : (map₂ α β).EssSurj := by - apply +allowSynthFailures Comma.essSurj_map - rw [NatTrans.isIso_iff_isIso_app] - intro; dsimp; infer_instance + apply Comma.essSurj_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in noncomputable instance isEquivalenceMap₂ [F.IsEquivalence] [G.Faithful] [G.Full] [IsIso α] [IsIso β] : (map₂ α β).IsEquivalence := by - apply +allowSynthFailures Comma.isEquivalenceMap - rw [NatTrans.isIso_iff_isIso_app] - intro; dsimp; infer_instance + apply Comma.isEquivalenceMap +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The composition of two applications of `map₂` is naturally isomorphic to a single such one. -/ def map₂CompMap₂Iso {C' : Type u₆} [Category.{v₆} C'] {D' : Type u₅} [Category.{v₅} D'] @@ -372,17 +380,20 @@ def map₂CompMap₂Iso {C' : Type u₆} [Category.{v₆} C'] {D' : Type u₅} [ end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `StructuredArrow.post` is a special case of `StructuredArrow.map₂` up to natural isomorphism. -/ def postIsoMap₂ (S : C) (F : B ⥤ C) (G : C ⥤ D) : post S F G ≅ map₂ (F := 𝟭 _) (𝟙 _) (𝟙 (F ⋙ G)) := NatIso.ofComponents fun _ => isoMk <| Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `StructuredArrow.map` is a special case of `StructuredArrow.map₂` up to natural isomorphism. -/ def mapIsoMap₂ {S S' : D} (f : S ⟶ S') : map (T := T) f ≅ map₂ (F := 𝟭 _) (G := 𝟭 _) f (𝟙 T) := NatIso.ofComponents fun _ => isoMk <| Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `StructuredArrow.pre` is a special case of `StructuredArrow.map₂` up to natural isomorphism. -/ def preIsoMap₂ (S : D) (F : B ⥤ C) (G : C ⥤ D) : @@ -434,6 +445,7 @@ and morphisms `C`-morphisms `Y ⟶ Y'` making the obvious triangle commute. -/ -- We explicitly come from `PUnit.{1}` here to obtain the correct universe for morphisms of -- costructured arrows. +@[implicit_reducible] def CostructuredArrow (S : C ⥤ D) (T : D) := Comma S (Functor.fromPUnit.{0} T) @@ -464,10 +476,13 @@ variable {X Y : CostructuredArrow S T} (f : X ⟶ Y) /-- The morphism that is part of a morphism of costructured arrows. -/ abbrev Hom.left : X.left ⟶ Y.left := CommaMorphism.left f -set_option backward.defeqAttrib.useBackward true in -@[reassoc (attr := simp)] +/- +The combination of `implicitBump` and making `Functor.const` implicit-reducible makes this former +`simp` lemma redundant, so no `simp` annotation. +-/ +@[reassoc] theorem w (f : X ⟶ Y) : S.map f.left ≫ Y.hom = X.hom := by - simpa using CommaMorphism.w f + simp @[reassoc] theorem Hom.w (f : X ⟶ Y) : S.map f.left ≫ Y.hom = X.hom := CostructuredArrow.w f @@ -491,6 +506,7 @@ theorem hom_eq_iff {X Y : CostructuredArrow S T} (f g : X ⟶ Y) : f = g ↔ f.l ⟨fun h ↦ by rw [h], hom_ext _ _⟩ /-- Construct a costructured arrow from a morphism. -/ +@[implicit_reducible] def mk (f : S.obj Y ⟶ T) : CostructuredArrow S T := ⟨Y, ⟨⟨⟩⟩, f⟩ @@ -545,12 +561,14 @@ def homMk' (f : CostructuredArrow S T) (g : Y' ⟶ f.left) : mk (S.map g ≫ f.h left := g right := 𝟙 _ +set_option backward.isDefEq.respectTransparency.types false in lemma homMk'_id (f : CostructuredArrow S T) : homMk' f (𝟙 f.left) = eqToHom (by cat_disch) := by simp [eqToHom_left] lemma homMk'_mk_id (f : S.obj Y ⟶ T) : homMk' (mk f) (𝟙 Y) = eqToHom (by simp) := homMk'_id _ +set_option backward.isDefEq.respectTransparency.types false in lemma homMk'_comp (f : CostructuredArrow S T) (g : Y' ⟶ f.left) (g' : Y'' ⟶ Y') : homMk' f (g' ≫ g) = eqToHom (by simp) ≫ homMk' (mk (S.map g ≫ f.hom)) g' ≫ homMk' f g := by simp [eqToHom_left] @@ -565,7 +583,9 @@ def mkPrecomp (f : S.obj Y ⟶ T) (g : Y' ⟶ Y) : mk (S.map g ≫ f) ⟶ mk f w left := g right := 𝟙 _ +set_option backward.isDefEq.respectTransparency.types false in lemma mkPrecomp_id (f : S.obj Y ⟶ T) : mkPrecomp f (𝟙 Y) = eqToHom (by simp) := by simp +set_option backward.isDefEq.respectTransparency.types false in lemma mkPrecomp_comp (f : S.obj Y ⟶ T) (g : Y' ⟶ Y) (g' : Y'' ⟶ Y') : mkPrecomp f (g' ≫ g) = eqToHom (by simp) ≫ mkPrecomp (S.map g ≫ f) g' ≫ mkPrecomp f g := by simp @@ -632,7 +652,7 @@ Ideally this would be described as a 2-functor from `D` (promoted to a 2-category with equations as 2-morphisms) to `Cat`. -/ -@[simps!] +@[simps!, implicit_reducible] def map (f : T ⟶ T') : CostructuredArrow S T ⥤ CostructuredArrow S T' := Comma.mapRight _ ((Functor.const _).map f) @@ -653,22 +673,24 @@ theorem map_comp {f : T ⟶ T'} {f' : T' ⟶ T''} {h : CostructuredArrow S T} : /-- An isomorphism `T ≅ T'` induces an equivalence `CostructuredArrow S T ≌ CostructuredArrow S T'`. -/ -@[simps!] +@[simps!, implicit_reducible] def mapIso (i : T ≅ T') : CostructuredArrow S T ≌ CostructuredArrow S T' := Comma.mapRightIso _ ((Functor.const _).mapIso i) /-- A natural isomorphism `S ≅ S'` induces an equivalence `CostrucutredArrow S T ≌ CostructuredArrow S' T`. -/ -@[simps!] +@[simps!, implicit_reducible] def mapNatIso (i : S ≅ S') : CostructuredArrow S T ≌ CostructuredArrow S' T := Comma.mapLeftIso _ i +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance proj_reflectsIsomorphisms : (proj S T).ReflectsIsomorphisms where reflects f t := ⟨CostructuredArrow.homMk (inv ((proj S T).map f) :), by simp⟩ open CategoryTheory.Limits +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The identity costructured arrow is terminal. -/ noncomputable def mkIdTerminal [S.Full] [S.Faithful] : IsTerminal (mk (𝟙 (S.obj Y))) where @@ -682,7 +704,7 @@ noncomputable def mkIdTerminal [S.Full] [S.Faithful] : IsTerminal (mk (𝟙 (S.o variable {A : Type u₃} [Category.{v₃} A] {B : Type u₄} [Category.{v₄} B] /-- The functor `(F ⋙ G, S) ⥤ (G, S)`. -/ -@[simps!] +@[simps!, implicit_reducible] def pre (F : B ⥤ C) (G : C ⥤ D) (S : D) : CostructuredArrow (F ⋙ G) S ⥤ CostructuredArrow G S := Comma.preLeft F G _ @@ -712,6 +734,7 @@ set_option backward.defeqAttrib.useBackward true in instance (F : B ⥤ C) (G : C ⥤ D) (S : C) : (post F G S).Faithful where map_injective {_ _} _ _ h := by simpa [ext_iff] using h +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance (F : B ⥤ C) (G : C ⥤ D) (S : C) [G.Faithful] : (post F G S).Full where map_surjective f := ⟨homMk f.left (G.map_injective (by simpa using f.w)), by simp⟩ @@ -731,35 +754,27 @@ variable {U : A ⥤ B} {V : B} {F : C ⥤ A} {G : D ⥤ B} /-- The functor `CostructuredArrow S T ⥤ CostructuredArrow U V` that is deduced from a natural transformation `F ⋙ U ⟶ S ⋙ G` and a morphism `G.obj T ⟶ V` -/ -@[simps!] +@[simps!, implicit_reducible] def map₂ : CostructuredArrow S T ⥤ CostructuredArrow U V := Comma.map (F₂ := 𝟭 (Discrete PUnit)) α (Discrete.natTrans (fun _ => β)) instance faithful_map₂ [F.Faithful] : (map₂ α β).Faithful := by apply Comma.faithful_map -set_option backward.defeqAttrib.useBackward true in instance full_map₂ [G.Faithful] [F.Full] [IsIso α] [IsIso β] : (map₂ α β).Full := by - apply +allowSynthFailures Comma.full_map - rw [NatTrans.isIso_iff_isIso_app] - intro; dsimp; infer_instance + apply Comma.full_map -set_option backward.defeqAttrib.useBackward true in instance essSurj_map₂ [F.EssSurj] [G.Full] [IsIso α] [IsIso β] : (map₂ α β).EssSurj := by - apply +allowSynthFailures Comma.essSurj_map - rw [NatTrans.isIso_iff_isIso_app] - intro; dsimp; infer_instance + apply Comma.essSurj_map -set_option backward.defeqAttrib.useBackward true in noncomputable instance isEquivalenceMap₂ [F.IsEquivalence] [G.Faithful] [G.Full] [IsIso α] [IsIso β] : (map₂ α β).IsEquivalence := by - apply +allowSynthFailures Comma.isEquivalenceMap - rw [NatTrans.isIso_iff_isIso_app] - intro; dsimp; infer_instance + apply Comma.isEquivalenceMap end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `CostructuredArrow.post` is a special case of `CostructuredArrow.map₂` up to natural isomorphism. -/ @@ -866,6 +881,7 @@ open Opposite namespace StructuredArrow +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the category of structured arrows `d ⟶ F.obj c` to the category of costructured arrows @@ -877,6 +893,7 @@ def toCostructuredArrow (F : C ⥤ D) (d : D) : obj X := CostructuredArrow.mk (Y := op X.unop.right) X.unop.hom.op map f := CostructuredArrow.homMk f.unop.right.op (by simp [← op_comp]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the category of structured arrows `op d ⟶ F.op.obj c` to the category of costructured arrows @@ -894,6 +911,7 @@ end StructuredArrow namespace CostructuredArrow +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the category of costructured arrows `F.obj c ⟶ d` to the category of structured arrows @@ -905,6 +923,7 @@ def toStructuredArrow (F : C ⥤ D) (d : D) : obj X := StructuredArrow.mk (Y := op X.unop.left) X.unop.hom.op map f := StructuredArrow.homMk f.unop.left.op (by simp [← op_comp]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the category of costructured arrows `F.op.obj c ⟶ op d` to the category of structured arrows @@ -920,6 +939,7 @@ def toStructuredArrow' (F : C ⥤ D) (d : D) : end CostructuredArrow +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a functor `F : C ⥤ D` and an object `d : D`, the category of structured arrows `d ⟶ F.obj c` is contravariantly equivalent to the category of costructured arrows `F.op.obj c ⟶ op d`. @@ -937,6 +957,7 @@ def structuredArrowOpEquivalence (F : C ⥤ D) (d : D) : counitIso := NatIso.ofComponents (fun X => CostructuredArrow.isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a functor `F : C ⥤ D` and an object `d : D`, the category of costructured arrows `F.obj c ⟶ d` is contravariantly equivalent to the category of structured arrows @@ -959,6 +980,7 @@ section Pre variable {E : Type u₃} [Category.{v₃} E] (F : C ⥤ D) {G : D ⥤ E} {e : E} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor establishing the equivalence `StructuredArrow.preEquivalence`. -/ @[simps!] @@ -969,6 +991,7 @@ def StructuredArrow.preEquivalenceFunctor (f : StructuredArrow e G) : rw [← w φ, comp_right] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor establishing the equivalence `StructuredArrow.preEquivalence`. -/ @[simps!] @@ -982,6 +1005,7 @@ def StructuredArrow.preEquivalenceInverse (f : StructuredArrow e G) : simp only [Functor.comp_obj, mk_right, mk_hom_eq_self, Functor.comp_map, Category.assoc, ← w φ, Functor.map_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A structured arrow category on a `StructuredArrow.pre e F G` functor is equivalent to the structured arrow category on F -/ @@ -990,9 +1014,10 @@ def StructuredArrow.preEquivalence (f : StructuredArrow e G) : StructuredArrow f (pre e F G) ≌ StructuredArrow f.right F where functor := preEquivalenceFunctor F f inverse := preEquivalenceInverse F f - unitIso := NatIso.ofComponents (fun X => isoMk (isoMk (Iso.refl _) (by simpa using X.hom.w.symm))) + unitIso := NatIso.ofComponents (fun X => isoMk (isoMk (Iso.refl _) (by simp))) counitIso := NatIso.ofComponents (fun _ => isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `StructuredArrow d T ⥤ StructuredArrow e (T ⋙ S)` that `u : e ⟶ S.obj d` induces via `StructuredArrow.map₂` can be expressed up to isomorphism by @@ -1003,6 +1028,7 @@ def StructuredArrow.map₂IsoPreEquivalenceInverseCompProj {T : C ⥤ D} {S : D map₂ (F := 𝟭 _) (G := 𝟭 _) (𝟙 _) α := NatIso.ofComponents fun _ => isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor establishing the equivalence `CostructuredArrow.preEquivalence`. -/ @[simps!] @@ -1013,6 +1039,7 @@ def CostructuredArrow.preEquivalence.functor (f : CostructuredArrow G e) : rw [← w φ, comp_left] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor establishing the equivalence `CostructuredArrow.preEquivalence`. -/ @[simps!] @@ -1023,6 +1050,7 @@ def CostructuredArrow.preEquivalence.inverse (f : CostructuredArrow G e) : simp only [Functor.comp_obj, mk_left, Functor.comp_map, mk_hom_eq_self, ← w φ, Functor.map_comp, Category.assoc] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A costructured arrow category on a `CostructuredArrow.pre F G e` functor is equivalent to the costructured arrow category on F -/ @@ -1032,9 +1060,10 @@ def CostructuredArrow.preEquivalence (f : CostructuredArrow G e) : functor := preEquivalence.functor F f inverse := preEquivalence.inverse F f unitIso := NatIso.ofComponents (fun X => isoMk (isoMk (Iso.refl _) - (by simpa using X.hom.w))) + (by simp))) counitIso := NatIso.ofComponents (fun _ => isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `CostructuredArrow T d ⥤ CostructuredArrow (T ⋙ S) e` that `u : S.obj d ⟶ e` induces via `CostructuredArrow.map₂` can be expressed up to isomorphism by @@ -1064,15 +1093,15 @@ theorem StructuredArrow.w_prod_snd {X Y : StructuredArrow (S, S') (T.prod T')} (f : X ⟶ Y) : X.hom.2 ≫ T'.map f.right.2 = Y.hom.2 := congr_arg _root_.Prod.snd (StructuredArrow.w f) -set_option backward.defeqAttrib.useBackward true in /-- Implementation; see `StructuredArrow.prodEquivalence`. -/ @[simps] def StructuredArrow.prodFunctor : StructuredArrow (S, S') (T.prod T') ⥤ StructuredArrow S T × StructuredArrow S' T' where obj f := ⟨.mk f.hom.1, .mk f.hom.2⟩ - map η := ⟨StructuredArrow.homMk η.right.1 (by simp [← η.w]), - StructuredArrow.homMk η.right.2 (by simp [← η.w])⟩ + map η := ⟨StructuredArrow.homMk η.right.1 (by simp), + StructuredArrow.homMk η.right.2 (by simp)⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Implementation; see `StructuredArrow.prodEquivalence`. -/ @[simps] @@ -1081,6 +1110,7 @@ def StructuredArrow.prodInverse : obj f := .mk (Y := (f.1.right, f.2.right)) ⟨f.1.hom, f.2.hom⟩ map η := StructuredArrow.homMk ⟨η.1.right, η.2.right⟩ (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural equivalence `StructuredArrow (S, S') (T.prod T') ≌ StructuredArrow S T × StructuredArrow S' T'`. -/ @@ -1109,6 +1139,7 @@ theorem CostructuredArrow.w_prod_snd {A B : CostructuredArrow (S.prod S') (T, T' S'.map f.left.2 ≫ B.hom.2 = A.hom.2 := congr_arg _root_.Prod.snd (CostructuredArrow.w f) +set_option backward.isDefEq.respectTransparency.types false in /-- Implementation; see `CostructuredArrow.prodEquivalence`. -/ @[simps] def CostructuredArrow.prodFunctor : @@ -1117,6 +1148,7 @@ def CostructuredArrow.prodFunctor : map η := ⟨CostructuredArrow.homMk η.left.1 (by simp), CostructuredArrow.homMk η.left.2 (by simp)⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Implementation; see `CostructuredArrow.prodEquivalence`. -/ @[simps] @@ -1125,6 +1157,7 @@ def CostructuredArrow.prodInverse : obj f := .mk (Y := (f.1.left, f.2.left)) ⟨f.1.hom, f.2.hom⟩ map η := CostructuredArrow.homMk ⟨η.1.left, η.2.left⟩ (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural equivalence `CostructuredArrow (S.prod S') (T, T') ≌ CostructuredArrow S T × CostructuredArrow S' T'`. -/ diff --git a/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean b/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean index 0ff4b7db2e53f7..c7108cdeb389e5 100644 --- a/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean +++ b/Mathlib/CategoryTheory/Comma/StructuredArrow/CommaMap.lean @@ -30,9 +30,10 @@ variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] [Category.{v₆} T'] {L' : C' ⥤ T'} {R' : D' ⥤ T'} {F₁ : C ⥤ C'} {F₂ : D ⥤ D'} {F : T ⥤ T'} (α : F₁ ⋙ L' ⟶ L ⋙ F) (β : R ⋙ F ⟶ F₂ ⋙ R') +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor establishing the equivalence `StructuredArrow.commaMapEquivalence`. -/ -@[simps] +@[simps, implicit_reducible] def commaMapEquivalenceFunctor [IsIso β] (X : Comma L' R') : StructuredArrow X (Comma.map α β) ⥤ Comma (map₂ (𝟙 _) α) (map₂ X.hom (inv β)) where obj Y := ⟨mk Y.hom.left, mk Y.hom.right, @@ -47,6 +48,7 @@ def commaMapEquivalenceFunctor [IsIso β] (X : Comma L' R') : by simp only [map₂_obj_right, mk_right, hom_eq_iff, comp_right, map₂_map_right, homMk_right, CommaMorphism.w] ⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor establishing the equivalence `StructuredArrow.commaMapEquivalence`. -/ @[simps] @@ -75,6 +77,7 @@ def commaMapEquivalenceCounitIso [IsIso β] (X : Comma L' R') : 𝟭 (Comma (map₂ (𝟙 (L'.obj X.left)) α) (map₂ X.hom (inv β))) := NatIso.ofComponents (fun _ => Comma.isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The structured arrow category on the functor `Comma.map α β`, with `β` a natural isomorphism, is equivalent to a comma category on two instances of `StructuredArrow.map₂`. -/ diff --git a/Mathlib/CategoryTheory/ComposableArrows/Basic.lean b/Mathlib/CategoryTheory/ComposableArrows/Basic.lean index b2a4d03fec39b2..54c653e6ed5c7f 100644 --- a/Mathlib/CategoryTheory/ComposableArrows/Basic.lean +++ b/Mathlib/CategoryTheory/ComposableArrows/Basic.lean @@ -304,11 +304,13 @@ lemma mk₁_comp_eqToHom {X₀ X₁ X₁' : C} (f : X₀ ⟶ X₁) (h : X₁ = X ComposableArrows.mk₁ (f ≫ eqToHom h) = ComposableArrows.mk₁ f := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma mk₁_hom (X : ComposableArrows C 1) : mk₁ X.hom = X := ext₁ rfl rfl (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The bijection between `ComposableArrows C 1` and `Arrow C`. -/ @[simps] @@ -439,21 +441,35 @@ variable {X₀ X₁ X₂ X₃ X₄ : C} (f : X₀ ⟶ X₁) (g : X₁ ⟶ X₂) /-! These examples are meant to test the good definitional properties of `precomp`, and that `dsimp` can see through. -/ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in example : map' (mk₂ f g) 0 1 = f := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₂ f g) 1 2 = g := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₂ f g) 0 2 = f ≫ g := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : (mk₂ f g).hom = f ≫ g := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₂ f g) 0 0 = 𝟙 _ := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₂ f g) 1 1 = 𝟙 _ := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₂ f g) 2 2 = 𝟙 _ := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₃ f g h) 0 1 = f := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₃ f g h) 1 2 = g := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₃ f g h) 2 3 = h := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₃ f g h) 0 3 = f ≫ g ≫ h := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : (mk₃ f g h).hom = f ≫ g ≫ h := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₃ f g h) 0 2 = f ≫ g := by dsimp +set_option backward.isDefEq.respectTransparency.types false in example : map' (mk₃ f g h) 1 3 = g ≫ h := by dsimp end @@ -602,6 +618,7 @@ lemma ext_succ {F G : ComposableArrows C (n + 1)} (h₀ : F.obj' 0 = G.obj' 0) rw [eqToHom_app, assoc, assoc, eqToHom_trans, eqToHom_refl, comp_id])) this (by rintro ⟨_ | _, hi⟩ <;> simp) +set_option backward.isDefEq.respectTransparency.types false in lemma precomp_surjective (F : ComposableArrows C (n + 1)) : ∃ (F₀ : ComposableArrows C n) (X₀ : C) (f₀ : X₀ ⟶ F₀.left), F = F₀.precomp f₀ := ⟨F.δ₀, _, F.map' 0 1, ext_succ rfl (by simp) (by simp)⟩ @@ -661,6 +678,7 @@ lemma ext₂ {f g : ComposableArrows C 2} (w₁ : f.map' 1 2 = eqToHom h₁ ≫ g.map' 1 2 ≫ eqToHom h₂.symm) : f = g := ext_succ h₀ (ext₁ h₁ h₂ w₁) w₀ +set_option backward.isDefEq.respectTransparency.types false in lemma mk₂_surjective (X : ComposableArrows C 2) : ∃ (X₀ X₁ X₂ : C) (f₀ : X₀ ⟶ X₁) (f₁ : X₁ ⟶ X₂), X = mk₂ f₀ f₁ := ⟨_, _, _, X.map' 0 1, X.map' 1 2, ext₂ rfl rfl rfl (by simp) (by simp)⟩ @@ -738,6 +756,7 @@ lemma ext₃ {f g : ComposableArrows C 3} (w₂ : f.map' 2 3 = eqToHom h₂ ≫ g.map' 2 3 ≫ eqToHom h₃.symm) : f = g := ext_succ h₀ (ext₂ h₁ h₂ h₃ w₁ w₂) w₀ +set_option backward.isDefEq.respectTransparency.types false in lemma mk₃_surjective (X : ComposableArrows C 3) : ∃ (X₀ X₁ X₂ X₃ : C) (f₀ : X₀ ⟶ X₁) (f₁ : X₁ ⟶ X₂) (f₂ : X₂ ⟶ X₃), X = mk₃ f₀ f₁ f₂ := ⟨_, _, _, _, X.map' 0 1, X.map' 1 2, X.map' 2 3, @@ -817,6 +836,7 @@ lemma ext₄ {f g : ComposableArrows C 4} f = g := ext_succ h₀ (ext₃ h₁ h₂ h₃ h₄ w₁ w₂ w₃) w₀ +set_option backward.isDefEq.respectTransparency.types false in lemma mk₄_surjective (X : ComposableArrows C 4) : ∃ (X₀ X₁ X₂ X₃ X₄ : C) (f₀ : X₀ ⟶ X₁) (f₁ : X₁ ⟶ X₂) (f₂ : X₂ ⟶ X₃) (f₃ : X₃ ⟶ X₄), X = mk₄ f₀ f₁ f₂ f₃ := @@ -899,6 +919,7 @@ lemma ext₅ {f g : ComposableArrows C 5} f = g := ext_succ h₀ (ext₄ h₁ h₂ h₃ h₄ h₅ w₁ w₂ w₃ w₄) w₀ +set_option backward.isDefEq.respectTransparency.types false in lemma mk₅_surjective (X : ComposableArrows C 5) : ∃ (X₀ X₁ X₂ X₃ X₄ X₅ : C) (f₀ : X₀ ⟶ X₁) (f₁ : X₁ ⟶ X₂) (f₂ : X₂ ⟶ X₃) (f₃ : X₃ ⟶ X₄) (f₄ : X₄ ⟶ X₅), X = mk₅ f₀ f₁ f₂ f₃ f₄ := @@ -982,6 +1003,7 @@ def Functor.mapComposableArrowsObjMk₁Iso {X Y : C} (f : X ⟶ Y) : (G.mapComposableArrows 1).obj (.mk₁ f) ≅ .mk₁ (G.map f) := isoMk₁ (Iso.refl _) (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism between `(G.mapComposableArrows 2).obj (.mk₂ f g)` and `.mk₂ (G.map f) (G.map g)`. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/ComposableArrows/One.lean b/Mathlib/CategoryTheory/ComposableArrows/One.lean index 93765c80565cd0..ecbbcfe9d856b0 100644 --- a/Mathlib/CategoryTheory/ComposableArrows/One.lean +++ b/Mathlib/CategoryTheory/ComposableArrows/One.lean @@ -31,6 +31,7 @@ def functorArrows (i j n : ℕ) (hij : i ≤ j := by lia) (hj : j ≤ n := by li obj S := mk₁ (S.map' i j) map {S S'} φ := homMk₁ (φ.app _) (φ.app _) (φ.naturality _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural transformation `functorArrows C i j n ⟶ functorArrows C i' j' n` when `i ≤ i'` and `j ≤ j'`. -/ diff --git a/Mathlib/CategoryTheory/ComposableArrows/Three.lean b/Mathlib/CategoryTheory/ComposableArrows/Three.lean index b3774d77cca6a8..79d3818029f61e 100644 --- a/Mathlib/CategoryTheory/ComposableArrows/Three.lean +++ b/Mathlib/CategoryTheory/ComposableArrows/Three.lean @@ -35,6 +35,7 @@ variable {C : Type u} [Category.{v} C] {i j k l : C} (f₁ : i ⟶ j) (f₂ : j ⟶ k) (f₃ : k ⟶ l) (f₁₂ : i ⟶ k) (f₂₃ : j ⟶ l) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The morphism `mk₂ f₁ f₂ ⟶ mk₂ f₁ f₂₃` when `f₂ ≫ f₃ = f₂₃`. -/ def threeδ₃Toδ₂ (h₂₃ : f₂ ≫ f₃ = f₂₃ := by cat_disch) : @@ -55,14 +56,17 @@ def threeδ₁Toδ₀ (h₁₂ : f₁ ≫ f₂ = f₁₂ := by cat_disch) : variable (h₁₂ : f₁ ≫ f₂ = f₁₂) (h₂₃ : f₂ ≫ f₃ = f₂₃) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma threeδ₃Toδ₂_app_zero : (threeδ₃Toδ₂ f₁ f₂ f₃ f₂₃ h₂₃).app 0 = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma threeδ₃Toδ₂_app_one : (threeδ₃Toδ₂ f₁ f₂ f₃ f₂₃ h₂₃).app 1 = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma threeδ₃Toδ₂_app_two : (threeδ₃Toδ₂ f₁ f₂ f₃ f₂₃ h₂₃).app 2 = f₃ := rfl @@ -98,6 +102,7 @@ section variable {ι : Type*} [Preorder ι] (i₀ i₁ i₂ i₃ : ι) (hi₀₁ : i₀ ≤ i₁) (hi₁₂ : i₁ ≤ i₂) (hi₂₃ : i₂ ≤ i₃) +set_option backward.isDefEq.respectTransparency.types false in /-- Variant of `threeδ₃Toδ₂` for preorders. -/ abbrev threeδ₃Toδ₂' : mk₂ (homOfLE hi₀₁) (homOfLE hi₁₂) ⟶ diff --git a/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean b/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean index 78ffdf915096d2..cfc1e3c352969e 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/Basic.lean @@ -185,6 +185,7 @@ theorem hom_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g : ToType X open ConcreteCategory +set_option backward.isDefEq.respectTransparency false in instance InducedCategory.concreteCategory {C : Type u} {D : Type u'} [Category.{v'} D] {FD : D → D → Type*} {CD : D → Type w} [∀ X Y, FunLike (FD X Y) (CD X) (CD Y)] [ConcreteCategory.{w} D FD] (f : C → D) : diff --git a/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean b/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean index d138b3a8bda864..00a6757085705b 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/Elementwise.lean @@ -18,6 +18,8 @@ public section open CategoryTheory CategoryTheory.Limits +set_option backward.isDefEq.respectTransparency.types false in + attribute [elementwise] limit.lift_π limit.w colimit.ι_desc colimit.w kernel.lift_ι cokernel.π_desc kernel.condition cokernel.condition diff --git a/Mathlib/CategoryTheory/ConcreteCategory/Forget.lean b/Mathlib/CategoryTheory/ConcreteCategory/Forget.lean index 106e3ee8090230..99adc805c705ae 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/Forget.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/Forget.lean @@ -106,6 +106,7 @@ lemma forget₂_comp_apply [HasForget₂ C D] {X Y Z : C} instance forget₂_faithful [HasForget₂ C D] : (forget₂ C D).Faithful := HasForget₂.forget_comp.faithful_of_comp +set_option backward.isDefEq.respectTransparency.types false in instance InducedCategory.hasForget₂ (f : C → D) : HasForget₂ (InducedCategory D f) D where forget₂ := inducedFunctor f forget_comp := rfl @@ -121,7 +122,7 @@ instance ObjectProperty.FullSubcategory.hasForget₂ (P : ObjectProperty C) : /-- In order to construct a “partially forgetting” functor, we do not need to verify functor laws; it suffices to ensure that compositions agree with `forget₂ C D ⋙ forget D = forget C`. -/ -@[implicit_reducible] +@[instance_reducible] def HasForget₂.mk' (obj : C → D) (h_obj : ∀ X, (forget D).obj (obj X) = (forget C).obj X) (map : ∀ {X Y}, (X ⟶ Y) → (obj X ⟶ obj Y)) (h_map : ∀ {X Y} {f : X ⟶ Y}, (forget D).map (map f) ≍ (forget C).map f) : diff --git a/Mathlib/CategoryTheory/Conj.lean b/Mathlib/CategoryTheory/Conj.lean index 66fe66d2ac21db..3bc802cc1ac426 100644 --- a/Mathlib/CategoryTheory/Conj.lean +++ b/Mathlib/CategoryTheory/Conj.lean @@ -51,6 +51,7 @@ theorem conj_comp (f g : End X) : α.conj (f ≫ g) = α.conj f ≫ α.conj g := theorem conj_id : α.conj (𝟙 X) = 𝟙 Y := map_one α.conj +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem refl_conj (f : End X) : (Iso.refl X).conj f = f := by rw [conj_apply, Iso.refl_inv, Iso.refl_hom, Category.id_comp, Category.comp_id] @@ -82,6 +83,7 @@ theorem conjAut_apply (f : Aut X) : α.conjAut f = α.symm ≪≫ f ≪≫ α := theorem conjAut_hom (f : Aut X) : (α.conjAut f).hom = α.conj f.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem trans_conjAut {Z : C} (β : Y ≅ Z) (f : Aut X) : (α ≪≫ β).conjAut f = β.conjAut (α.conjAut f) := by @@ -115,6 +117,7 @@ theorem map_conj {X Y : C} (α : X ≅ Y) (f : End X) : F.map (α.conj f) = (F.mapIso α).conj (F.map f) := map_homCongr F α α f +set_option backward.isDefEq.respectTransparency.types false in theorem map_conjAut (F : C ⥤ D) {X Y : C} (α : X ≅ Y) (f : Aut X) : F.mapIso (α.conjAut f) = (F.mapIso α).conjAut (F.mapIso f) := by ext; simp only [mapIso_hom, Iso.conjAut_hom, F.map_conj] diff --git a/Mathlib/CategoryTheory/Core.lean b/Mathlib/CategoryTheory/Core.lean index 87b752bd35da86..18ad4d92acc4d6 100644 --- a/Mathlib/CategoryTheory/Core.lean +++ b/Mathlib/CategoryTheory/Core.lean @@ -150,38 +150,46 @@ namespace Iso variable {D : Type u₂} [Category.{v₂} D] +set_option backward.isDefEq.respectTransparency.types false in /-- A natural isomorphism of functors induces a natural isomorphism between their cores. -/ @[simps!] def core {F G : C ⥤ D} (α : F ≅ G) : F.core ≅ G.core := NatIso.ofComponents (fun x ↦ Groupoid.isoEquivHom _ _ |>.symm <| .mk <| α.app x.of) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma coreComp {F G H : C ⥤ D} (α : F ≅ G) (β : G ≅ H) : (α ≪≫ β).core = α.core ≪≫ β.core := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma coreId {F : C ⥤ D} : (Iso.refl F).core = Iso.refl F.core := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma coreWhiskerLeft {E : Type u₃} [Category.{v₃} E] (F : C ⥤ D) {G H : D ⥤ E} (η : G ≅ H) : (isoWhiskerLeft F η).core = F.coreComp G ≪≫ isoWhiskerLeft F.core η.core ≪≫ (F.coreComp H).symm := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in lemma coreWhiskerRight {E : Type u₃} [Category.{v₃} E] {F G : C ⥤ D} (η : F ≅ G) (H : D ⥤ E) : (isoWhiskerRight η H).core = F.coreComp H ≪≫ isoWhiskerRight η.core H.core ≪≫ (G.coreComp H).symm := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in lemma coreLeftUnitor {F : C ⥤ D} : F.leftUnitor.core = (𝟭 C).coreComp F ≪≫ isoWhiskerRight (Functor.coreId C) _ ≪≫ F.core.leftUnitor := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in lemma coreRightUnitor {F : C ⥤ D} : F.rightUnitor.core = (F).coreComp (𝟭 D) ≪≫ isoWhiskerLeft _ (Functor.coreId D) ≪≫ F.core.rightUnitor := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in lemma coreAssociator {E : Type u₃} [Category.{v₃} E] {E' : Type u₄} [Category.{v₄} E'] (F : C ⥤ D) (G : D ⥤ E) (H : E ⥤ E') : (Functor.associator F G H).core = @@ -196,11 +204,13 @@ namespace Core variable {G : Type u₂} [Groupoid.{v₂} G] +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `functorToCore (F ⋙ H)` factors through `functorToCore H`. -/ def functorToCoreCompLeftIso {G' : Type u₃} [Groupoid.{v₃} G'] (H : G ⥤ C) (F : G' ⥤ G) : functorToCore (F ⋙ H) ≅ F ⋙ functorToCore H := NatIso.ofComponents (fun _ ↦ Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in lemma functorToCore_comp_left {G' : Type u₃} [Groupoid.{v₃} G'] (H : G ⥤ C) (F : G' ⥤ G) : functorToCore (F ⋙ H) = F ⋙ functorToCore H := Functor.ext_of_iso (functorToCoreCompLeftIso H F) (by cat_disch) @@ -214,10 +224,12 @@ lemma functorToCore_comp_right {C' : Type u₄} [Category.{v₄} C'] (H : G ⥤ functorToCore (H ⋙ F) = functorToCore H ⋙ F.core := Functor.ext_of_iso (functorToCoreCompRightIso H F) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `functorToCore (𝟭 G)` is a section of `inclusion G`. -/ def inclusionCompFunctorToCoreIso : inclusion G ⋙ functorToCore (𝟭 G) ≅ 𝟭 (Core G) := NatIso.ofComponents (fun _ ↦ Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in theorem inclusion_comp_functorToCore : inclusion G ⋙ functorToCore (𝟭 G) = 𝟭 (Core G) := Functor.ext_of_iso inclusionCompFunctorToCoreIso (by cat_disch) @@ -234,6 +246,7 @@ variable (D : Type u₂) [Category.{v₂} D] namespace Equivalence +set_option backward.isDefEq.respectTransparency.types false in variable {D} in /-- Equivalent categories have equivalent cores. -/ @[simps!] @@ -245,6 +258,7 @@ def core (E : C ≌ D) : Core C ≌ Core D where end Equivalence +set_option backward.isDefEq.respectTransparency.types false in variable (C) in /-- Taking the core of a functor is functorial if we discard non-invertible natural transformations. -/ diff --git a/Mathlib/CategoryTheory/Discrete/Basic.lean b/Mathlib/CategoryTheory/Discrete/Basic.lean index 7d03d8068c25b7..ed82e36e8c624a 100644 --- a/Mathlib/CategoryTheory/Discrete/Basic.lean +++ b/Mathlib/CategoryTheory/Discrete/Basic.lean @@ -159,6 +159,7 @@ attribute [local aesop safe tactic (rule_sets := [CategoryTheory])] CategoryTheory.Discrete.discreteCases /-- Any function `I → C` gives a functor `Discrete I ⥤ C`. -/ +@[implicit_reducible] def functor {I : Type u₁} (F : I → C) : Discrete I ⥤ C where obj := F ∘ Discrete.as map {X Y} f := by @@ -186,6 +187,7 @@ lemma functor_ext {I : Type u₁} {G F : Discrete I ⥤ C} (h : (i : I) → G.ob · intro I; rw [h] · intro ⟨X⟩ ⟨Y⟩ ⟨⟨p⟩⟩; simp only at p; induction p; simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The discrete functor induced by a composition of maps can be written as a composition of two discrete functors. @@ -199,7 +201,7 @@ def functorComp {I : Type u₁} {J : Type u₁'} (f : J → C) (g : I → J) : a natural transformation is just a collection of maps, as the naturality squares are trivial. -/ -@[simps] +@[simps, implicit_reducible] def natTrans {I : Type u₁} {F G : Discrete I ⥤ C} (f : ∀ i : Discrete I, F.obj i ⟶ G.obj i) : F ⟶ G where app := f @@ -291,18 +293,21 @@ theorem functor_map_id (F : Discrete J ⥤ C) {j : Discrete J} (f : j ⟶ j) : end Discrete +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma Discrete.forall {α : Type*} {p : Discrete α → Prop} : (∀ (a : Discrete α), p a) ↔ ∀ (a' : α), p ⟨a'⟩ := by rw [iff_iff_eq, discreteEquiv.forall_congr_left] - simp [discreteEquiv] + simp only [discreteEquiv, Equiv.symm_mk, Equiv.coe_fn_mk] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma Discrete.exists {α : Type*} {p : Discrete α → Prop} : (∃ (a : Discrete α), p a) ↔ ∃ (a' : α), p ⟨a'⟩ := by rw [iff_iff_eq, discreteEquiv.exists_congr_left] simp [discreteEquiv] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories `(J → C) ≌ (Discrete J ⥤ C)`. -/ @[simps] @@ -322,6 +327,7 @@ def piEquivalenceFunctorDiscrete (J : Type u₂) (C : Type u₁) [Category.{v₁ obtain rfl : f = 𝟙 _ := rfl simp))) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `piEquivalenceFunctorDiscrete` is compatible with `evaluation`. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean b/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean index 5e9489732e0fff..8865504532b23f 100644 --- a/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean +++ b/Mathlib/CategoryTheory/Discrete/StructuredArrow.lean @@ -28,6 +28,7 @@ variable {C : Type u} [Category.{v} C] {T : Type w} namespace Discrete +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F : C ⥤ Discrete T` is a functor with `T` containing a unique element `t`, then this is the equivalence @@ -41,6 +42,7 @@ def structuredArrowEquivalenceOfUnique unitIso := NatIso.ofComponents (fun _ ↦ StructuredArrow.isoMk (Iso.refl _)) counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F : C ⥤ Discrete T` is a functor with `T` containing a unique element `t`, then this is the equivalence diff --git a/Mathlib/CategoryTheory/Distributive/Monoidal.lean b/Mathlib/CategoryTheory/Distributive/Monoidal.lean index c741b6b5e05727..ae266b653feab5 100644 --- a/Mathlib/CategoryTheory/Distributive/Monoidal.lean +++ b/Mathlib/CategoryTheory/Distributive/Monoidal.lean @@ -212,6 +212,7 @@ lemma coprodComparison_tensorLeft_braiding_hom [BraidedCategory C] {X Y Z : C} : (coprod.map (β_ X Y).hom (β_ X Z).hom) ≫ (coprodComparison (tensorRight X) Y Z) := by simp [coprodComparison] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- In a symmetric monoidal category, the right distributivity is equal to the left distributivity up to braiding isomorphisms. -/ diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean b/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean index 2e30e726eaeb93..de5b0880c1b052 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Coproduct.lean @@ -41,6 +41,7 @@ def effectiveEpiStructIsColimitDescOfEffectiveEpiFamily {B : C} {α : Type*} (X uniq e _ m hm := EffectiveEpiFamily.uniq X π (fun a ↦ c.ι.app ⟨a⟩ ≫ e) (fun _ _ _ _ hg ↦ (by simp [← hm, reassoc_of% hg])) m (fun _ ↦ (by simp [← hm])) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {B : C} {α : Type*} (X : α → C) (π : (a : α) → (X a ⟶ B)) [HasCoproduct X] [EffectiveEpiFamily X π] : EffectiveEpi (Sigma.desc π) := by diff --git a/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean b/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean index 22b8d036f7a3f8..8e57aa1f01fc48 100644 --- a/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean +++ b/Mathlib/CategoryTheory/EffectiveEpi/Preserves.lean @@ -110,6 +110,7 @@ instance [IsRegularEpiCategory D] (F : C ⥤ D) [F.PreservesEpimorphisms] [Limit rw [← isRegularEpi_iff_effectiveEpi] apply IsRegularEpiCategory.regularEpiOfEpi +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Applying a functor which preserves pullbacks and effective epimorphisms to a regular epi diagram diff --git a/Mathlib/CategoryTheory/Elements.lean b/Mathlib/CategoryTheory/Elements.lean index 7f3047d809803b..b3d19006de5a54 100644 --- a/Mathlib/CategoryTheory/Elements.lean +++ b/Mathlib/CategoryTheory/Elements.lean @@ -50,6 +50,7 @@ def Functor.Elements (F : C ⥤ Type w) := /-- Constructor for the type `F.Elements` when `F` is a functor to types. -/ abbrev Functor.elementsMk (F : C ⥤ Type w) (X : C) (x : F.obj X) : F.Elements := ⟨X, x⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma Functor.Elements.ext {F : C ⥤ Type w} (x y : F.Elements) (h₁ : x.fst = y.fst) (h₂ : F.map (eqToHom h₁) x.snd = y.snd) : x = y := by cases x @@ -197,6 +198,7 @@ theorem fromStructuredArrow_map {X Y} (f : X ⟶ Y) : ⟨f.right, by simp [ConcreteCategory.congr_hom f.w.symm PUnit.unit]; rfl⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The equivalence between the category of elements `F.Elements` and the comma category `(*, F)`. -/ @[simps] @@ -208,6 +210,7 @@ def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F where open Opposite +set_option backward.isDefEq.respectTransparency.types false in /-- The forward direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`, given by `CategoryTheory.yonedaEquiv`. -/ @@ -235,6 +238,7 @@ theorem fromCostructuredArrow_obj_mk (F : Cᵒᵖ ⥤ Type v) {X : C} (f : yoned (fromCostructuredArrow F).obj (op (CostructuredArrow.mk f)) = ⟨op X, yonedaEquiv.1 f⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/ @[simps] @@ -252,6 +256,7 @@ def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) : simpa only [Functor.map_id, Category.id_comp] using! (yonedaEquiv.symm_apply_apply X.hom).symm)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `(-.Elements)ᵒᵖ ≅ (yoneda, -)` of is actually a natural isomorphism of functors. -/ diff --git a/Mathlib/CategoryTheory/Endofunctor/Algebra.lean b/Mathlib/CategoryTheory/Endofunctor/Algebra.lean index 970b1e52b57094..2b4f30d41b21ae 100644 --- a/Mathlib/CategoryTheory/Endofunctor/Algebra.lean +++ b/Mathlib/CategoryTheory/Endofunctor/Algebra.lean @@ -159,12 +159,14 @@ def functorOfNatTrans {F G : C ⥤ C} (α : G ⟶ F) : Algebra F ⥤ Algebra G w str := α.app _ ≫ A.str } map f := { f := f.1 } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The identity transformation induces the identity endofunctor on the category of algebras. -/ @[simps!] def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ := NatIso.ofComponents fun X => isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A composition of natural transformations gives the composition of corresponding functors. -/ @[simps!] @@ -172,6 +174,7 @@ def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans β ⋙ functorOfNatTrans α := NatIso.ofComponents fun X => isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- If `α` and `β` are two equal natural transformations, then the functors of algebras induced by them are isomorphic. @@ -354,12 +357,14 @@ def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra { f := f.1 h := by rw [Category.assoc, ← α.naturality, ← Category.assoc, f.h, Category.assoc] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The identity transformation induces the identity endofunctor on the category of coalgebras. -/ @[simps!] def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _ := NatIso.ofComponents fun X => isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A composition of natural transformations gives the composition of corresponding functors. -/ @[simps!] @@ -367,6 +372,7 @@ def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans α ⋙ functorOfNatTrans β := NatIso.ofComponents fun X => isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- If `α` and `β` are two equal natural transformations, then the functors of coalgebras induced by them are isomorphic. We define it like this as opposed to using `eq_to_iso` so that the components are nicer to prove diff --git a/Mathlib/CategoryTheory/Endomorphism.lean b/Mathlib/CategoryTheory/Endomorphism.lean index 0494615ecaa92a..55ce568f6f2a85 100644 --- a/Mathlib/CategoryTheory/Endomorphism.lean +++ b/Mathlib/CategoryTheory/Endomorphism.lean @@ -29,6 +29,7 @@ namespace CategoryTheory /-- Endomorphisms of an object in a category. Arguments order in multiplication agrees with `Function.comp`, not with `CategoryTheory.CategoryStruct.comp`. -/ +@[implicit_reducible] def End {C : Type u} [CategoryStruct.{v} C] (X : C) := X ⟶ X namespace End @@ -105,6 +106,7 @@ instance group {C : Type u} [Groupoid.{v} C] (X : C) : Group (End X) where end End +set_option backward.isDefEq.respectTransparency.types false in theorem isUnit_iff_isIso {C : Type u} [Category.{v} C] {X : C} (f : End X) : IsUnit (f : End X) ↔ IsIso f := ⟨fun h => { out := ⟨h.unit.inv, ⟨h.unit.inv_val, h.unit.val_inv⟩⟩ }, fun h => @@ -152,6 +154,7 @@ def unitsEndEquivAut : (End X)ˣ ≃* Aut X where @[simps!] def toEnd (X : C) : Aut X →* End X := (Units.coeHom (End X)).comp (Aut.unitsEndEquivAut X).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Isomorphisms induce isomorphisms of the automorphism group -/ def autMulEquivOfIso {X Y : C} (h : X ≅ Y) : Aut X ≃* Aut Y where toFun x := { hom := h.inv ≫ x.hom ≫ h.hom, inv := h.inv ≫ x.inv ≫ h.hom } diff --git a/Mathlib/CategoryTheory/Enriched/Basic.lean b/Mathlib/CategoryTheory/Enriched/Basic.lean index 08c4ff97b3253a..b8df8021b4d734 100644 --- a/Mathlib/CategoryTheory/Enriched/Basic.lean +++ b/Mathlib/CategoryTheory/Enriched/Basic.lean @@ -119,6 +119,7 @@ variable (F : V ⥤ W) [F.LaxMonoidal] open Functor.LaxMonoidal +set_option backward.isDefEq.respectTransparency.types false in instance : EnrichedCategory W (TransportEnrichment F C) where Hom := fun X Y : C => F.obj (X ⟶[V] Y) id := fun X : C => ε F ≫ F.map (eId V X) @@ -142,10 +143,12 @@ instance : EnrichedCategory W (TransportEnrichment F C) where F.map_comp, MonoidalCategory.whiskerLeft_comp, Category.assoc, Functor.LaxMonoidal.μ_natural_right_assoc] +set_option backward.isDefEq.respectTransparency.types false in lemma TransportEnrichment.eId_eq (X : TransportEnrichment F C) : eId W X = ε F ≫ F.map (eId (C := C) V X) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma TransportEnrichment.eComp_eq (X Y Z : TransportEnrichment F C) : eComp W X Y Z = μ F _ _ ≫ F.map (eComp V _ _ _) := rfl @@ -167,7 +170,7 @@ def categoryOfEnrichedCategoryType (C : Type u₁) [𝒞 : EnrichedCategory (Typ attribute [local simp] types_tensorObj_def in /-- Construct a `Type v`-enriched category from an honest category. -/ -@[implicit_reducible] +@[instance_reducible] def enrichedCategoryTypeOfCategory (C : Type u₁) [𝒞 : Category.{v} C] : EnrichedCategory (Type v) C where Hom X Y := 𝒞.Hom X Y @@ -176,6 +179,7 @@ def enrichedCategoryTypeOfCategory (C : Type u₁) [𝒞 : Category.{v} C] : /-- We verify that an enriched category in `Type u` is just the same thing as an honest category. -/ +@[implicit_reducible] def enrichedCategoryTypeEquivCategory (C : Type u₁) : EnrichedCategory (Type v) C ≃ Category.{v} C where toFun _ := categoryOfEnrichedCategoryType C @@ -210,10 +214,12 @@ def ForgetEnrichment (W : Type v) [Category.{w} W] [MonoidalCategory W] (C : Typ variable (W) /-- Typecheck an object of `C` as an object of `ForgetEnrichment W C`. -/ +@[implicit_reducible] def ForgetEnrichment.of (X : C) : ForgetEnrichment W C := X /-- Typecheck an object of `ForgetEnrichment W C` as an object of `C`. -/ +@[implicit_reducible] def ForgetEnrichment.to (X : ForgetEnrichment W C) : C := X @@ -226,6 +232,7 @@ theorem ForgetEnrichment.of_to (X : ForgetEnrichment W C) : ForgetEnrichment.of W (ForgetEnrichment.to W X) = X := rfl +set_option backward.isDefEq.respectTransparency.types false in instance categoryForgetEnrichment : Category (ForgetEnrichment W C) := enrichedCategoryTypeEquivCategory C (inferInstanceAs (EnrichedCategory (Type w) (TransportEnrichment (coyoneda.obj (op (𝟙_ W))) C))) @@ -256,23 +263,27 @@ theorem ForgetEnrichment.homOf_homTo {X Y : ForgetEnrichment W C} (f : X ⟶ Y) ForgetEnrichment.homOf W (ForgetEnrichment.homTo W f) = f := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The identity in the "underlying" category of an enriched category. -/ @[simp] theorem ForgetEnrichment.homTo_id (X : ForgetEnrichment W C) : ForgetEnrichment.homTo W (𝟙 X) = eId W (ForgetEnrichment.to W X : C) := Category.id_comp _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem ForgetEnrichment.homOf_eId (X : C) : ForgetEnrichment.homOf W (eId W X) = 𝟙 (of W X : C) := (homTo_id W (ForgetEnrichment.of W X)).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Composition in the "underlying" category of an enriched category. -/ @[simp] theorem ForgetEnrichment.homTo_comp {X Y Z : ForgetEnrichment W C} (f : X ⟶ Y) (g : Y ⟶ Z) : homTo W (f ≫ g) = ((λ_ (𝟙_ W)).inv ≫ (homTo W f ⊗ₘ homTo W g)) ≫ eComp W _ _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem ForgetEnrichment.homOf_comp {X Y Z : C} (f : 𝟙_ W ⟶ (X ⟶[W] Y)) (g : 𝟙_ W ⟶ (Y ⟶[W] Z)) : homOf W ((λ_ _).inv ≫ (f ⊗ₘ g) ≫ eComp W ..) = homOf W f ≫ homOf W g := by @@ -341,7 +352,7 @@ set_option backward.isDefEq.respectTransparency false in /-- An enriched functor induces an honest functor of the underlying categories, by mapping the `(𝟙_ W)`-shaped morphisms. -/ -@[simps] +@[simps, implicit_reducible] def forget (F : EnrichedFunctor W C D) : ForgetEnrichment W C ⥤ ForgetEnrichment W D where obj X := ForgetEnrichment.of W (F.obj (ForgetEnrichment.to W X)) @@ -349,7 +360,6 @@ def forget (F : EnrichedFunctor W C D) : ForgetEnrichment.homOf W (ForgetEnrichment.homTo W f ≫ F.map (ForgetEnrichment.to W _) (ForgetEnrichment.to W _)) map_comp f g := by - dsimp apply_fun ForgetEnrichment.homTo W · simp only [Iso.cancel_iso_inv_left, Category.assoc, ← tensorHom_comp_tensorHom, ForgetEnrichment.homTo_homOf, EnrichedFunctor.map_comp, ForgetEnrichment.homTo_comp] @@ -478,6 +488,7 @@ variable [BraidedCategory V] open BraidedCategory +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A presheaf isomorphic to the Yoneda embedding of the `V`-object of natural transformations from `F` to `G`. @@ -520,6 +531,7 @@ def enrichedFunctorTypeEquivFunctor {C : Type u₁} [𝒞 : EnrichedCategory (Ty map_id := fun X => by ext ⟨⟩; exact F.map_id X map_comp := fun X Y Z => by ext ⟨f, g⟩; exact F.map_comp f g } +set_option backward.isDefEq.respectTransparency.types false in /-- We verify that the presheaf representing natural transformations between `Type v`-enriched functors is actually represented by the usual type of natural transformations! diff --git a/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean b/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean index d695c105155b68..1d8c3502773af1 100644 --- a/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean +++ b/Mathlib/CategoryTheory/Enriched/EnrichedCat.lean @@ -93,6 +93,7 @@ def associator (F : EnrichedFunctor V C D) (G : EnrichedFunctor V D E) Functor.isoWhiskerLeft _ (G.forgetComp H).symm ≪≫ (F.forgetComp _).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma comp_whiskerRight {F G H : EnrichedFunctor V C D} (α : F ⟶ G) (β : G ⟶ H) (I : EnrichedFunctor V D E) : @@ -102,6 +103,7 @@ lemma comp_whiskerRight {F G H : EnrichedFunctor V C D} (α : F ⟶ G) EnrichedFunctor.forget, EnrichedFunctor.comp_obj, EnrichedFunctor.comp_map] simp [← ForgetEnrichment.homOf_comp] +set_option backward.isDefEq.respectTransparency.types false in lemma whisker_exchange {F G : EnrichedFunctor V C D} {H I : EnrichedFunctor V D E} (α : F ⟶ G) (β : H ⟶ I) : whiskerLeft F β ≫ whiskerRight α I = whiskerRight α H ≫ whiskerLeft G β := by @@ -111,6 +113,7 @@ lemma whisker_exchange {F G : EnrichedFunctor V C D} {H I : EnrichedFunctor V D whiskerRight_out_app] exact (β.out.naturality (α.out.app (ForgetEnrichment.of V X))).symm +set_option backward.isDefEq.respectTransparency.types false in /-- The bicategory structure on `EnrichedCat V` for a monoidal category `V`. -/ instance bicategory : Bicategory (EnrichedCat.{w, v, u} V) where Hom C D := EnrichedFunctor V C D diff --git a/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean b/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean index c7581dea793a07..f3dd275f7ed40c 100644 --- a/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Enriched/FunctorCategory.lean @@ -136,6 +136,7 @@ section variable [HasEnrichedHom V F₁ F₂] [HasEnrichedHom V F₂ F₃] [HasEnrichedHom V F₁ F₃] +set_option backward.isDefEq.respectTransparency.types false in /-- The composition for the `V`-enrichment of the category `J ⥤ C`. -/ noncomputable def enrichedComp : enrichedHom V F₁ F₂ ⊗ enrichedHom V F₂ F₃ ⟶ enrichedHom V F₁ F₃ := end_.lift (fun j ↦ (end_.π _ j ⊗ₘ end_.π _ j) ≫ eComp V _ _ _) (fun i j f ↦ by @@ -236,7 +237,7 @@ variable (J C) /-- If `C` is a `V`-enriched ordinary category, and `C` has suitable limits, then `J ⥤ C` is also a `V`-enriched ordinary category. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def enrichedOrdinaryCategory [∀ (F₁ F₂ : J ⥤ C), HasEnrichedHom V F₁ F₂] : EnrichedOrdinaryCategory V (J ⥤ C) where Hom F₁ F₂ := enrichedHom V F₁ F₂ diff --git a/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean b/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean index a52d606f8d7f4e..1db6c840d9af88 100644 --- a/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean +++ b/Mathlib/CategoryTheory/Enriched/Ordinary/Basic.lean @@ -233,7 +233,7 @@ set_option backward.isDefEq.respectTransparency false in `(𝟙_ V ⟶ v) → (𝟙_ W ⟶ F.obj v)` is bijective, and `C` is an enriched ordinary category on `V`, then `F` induces the structure of a `W`-enriched ordinary category on `TransportEnrichment F C`, i.e. on the same underlying category `C`. -/ -@[implicit_reducible] +@[instance_reducible] def TransportEnrichment.enrichedOrdinaryCategory (e : ∀ v : V, (𝟙_ V ⟶ v) ≃ (𝟙_ W ⟶ F.obj v)) (h : ∀ v : V, ∀ f : 𝟙_ V ⟶ v, e v f = Functor.LaxMonoidal.ε F ≫ F.map f) : @@ -342,7 +342,7 @@ instance (P : ObjectProperty C) : rw [← eHomEquiv_id] rfl homEquiv_comp f g := by - simp only [ObjectProperty.ι_obj, Equiv.trans_apply] + simp only [ObjectProperty.ι_obj] change (eHomEquiv V) (P.ι.map (f ≫ g)) = _ rw [Functor.map_comp, eHomEquiv_comp] rfl diff --git a/Mathlib/CategoryTheory/EpiMono.lean b/Mathlib/CategoryTheory/EpiMono.lean index 9fcd9c470107df..7a4f8005da8a5b 100644 --- a/Mathlib/CategoryTheory/EpiMono.lean +++ b/Mathlib/CategoryTheory/EpiMono.lean @@ -149,7 +149,7 @@ theorem IsIso.of_epi_section {X Y : C} (f : X ⟶ Y) [hf : IsSplitEpi f] [hf' : -- FIXME this has unnecessarily become noncomputable! /-- A category where every morphism has a `Trunc` retraction is computably a groupoid. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Groupoid.ofTruncSplitMono (all_split_mono : ∀ {X Y : C} (f : X ⟶ Y), Trunc (IsSplitMono f)) : Groupoid.{v₁} C := by apply Groupoid.ofIsIso diff --git a/Mathlib/CategoryTheory/EqToHom.lean b/Mathlib/CategoryTheory/EqToHom.lean index 803eb1b07b990e..1f85a909252c53 100644 --- a/Mathlib/CategoryTheory/EqToHom.lean +++ b/Mathlib/CategoryTheory/EqToHom.lean @@ -361,6 +361,7 @@ lemma ObjectProperty.eqToHom_hom {C : Type*} [Category C] {P : ObjectProperty C} subst h rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `T ≃ D` is a bijection and `D` is a category, then `InducedCategory D e` is equivalent to `D`. -/ diff --git a/Mathlib/CategoryTheory/Equivalence.lean b/Mathlib/CategoryTheory/Equivalence.lean index f7090ed368a065..ceb9702ab1538d 100644 --- a/Mathlib/CategoryTheory/Equivalence.lean +++ b/Mathlib/CategoryTheory/Equivalence.lean @@ -57,8 +57,8 @@ if it is full, faithful and essentially surjective. We write `C ≌ D` (`\backcong`, not to be confused with `≅`/`\cong`) for a bundled equivalence. -/ - set_option backward.defeqAttrib.useBackward true +set_option backward.isDefEq.respectTransparency.types false @[expose] public section @@ -109,6 +109,7 @@ variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] namespace Equivalence +set_option backward.isDefEq.respectTransparency false in @[to_dual existing functor_unitIso_comp] theorem counitIso_functor_comp (e : C ≌ D) (X : C) : dsimp% e.counitIso.inv.app (e.functor.obj X) ≫ e.functor.map (e.unitIso.inv.app X) = @@ -116,6 +117,7 @@ theorem counitIso_functor_comp (e : C ≌ D) (X : C) : simpa [functor_unitIso_comp] using Iso.inv_eq_inv (e.functor.mapIso (e.unitIso.app X) ≪≫ e.counitIso.app (e.functor.obj X)) (Iso.refl _) +set_option backward.isDefEq.respectTransparency false in /-- `Equivalence.mk'` is the dual of `Equivalence.mk`, which we need for `to_dual`. Please avoid using this directly. -/ @[to_dual existing mk'] @@ -142,25 +144,25 @@ abbrev unit (e : C ≌ D) : 𝟭 C ⟶ e.functor ⋙ e.inverse := abbrev counit (e : C ≌ D) : e.inverse ⋙ e.functor ⟶ 𝟭 D := e.counitIso.hom -@[reassoc +to_dual (attr := simp)] +@[reassoc +to_dual] lemma unitIso_hom_inv_id_app (e : C ≌ D) (X : C) : - dsimp% e.unit.app X ≫ e.unitInv.app X = 𝟙 X := - e.unitIso.hom_inv_id_app X + dsimp% e.unit.app X ≫ e.unitInv.app X = 𝟙 X := by + simp -@[reassoc +to_dual (attr := simp)] +@[reassoc +to_dual] lemma unitIso_inv_hom_id_app (e : C ≌ D) (X : C) : - dsimp% e.unitInv.app X ≫ e.unit.app X = 𝟙 _ := - e.unitIso.inv_hom_id_app X + dsimp% e.unitInv.app X ≫ e.unit.app X = 𝟙 _ := by + simp -@[reassoc +to_dual (attr := simp)] +@[reassoc +to_dual] lemma counitIso_hom_inv_id_app (e : C ≌ D) (Y : D) : - dsimp% e.counit.app Y ≫ e.counitInv.app Y = 𝟙 _ := - e.counitIso.hom_inv_id_app Y + dsimp% e.counit.app Y ≫ e.counitInv.app Y = 𝟙 _ := by + simp -@[reassoc +to_dual (attr := simp)] +@[reassoc +to_dual] lemma counitIso_inv_hom_id_app (e : C ≌ D) (Y : D) : - dsimp% e.counitInv.app Y ≫ e.counit.app Y = 𝟙 Y := - e.counitIso.inv_hom_id_app Y + dsimp% e.counitInv.app Y ≫ e.counit.app Y = 𝟙 Y := by + simp section CategoryStructure @@ -263,6 +265,7 @@ theorem functor_unit_comp (e : C ≌ D) (X : C) : dsimp% e.functor.map (e.unit.app X) ≫ e.counit.app (e.functor.obj X) = 𝟙 (e.functor.obj X) := e.functor_unitIso_comp X +set_option backward.isDefEq.respectTransparency false in @[to_dual counitInv_app_functor] theorem counit_app_functor (e : C ≌ D) (X : C) : e.counit.app (e.functor.obj X) = e.functor.map (e.unitInv.app X) := by @@ -304,6 +307,7 @@ theorem unit_inverse_comp (e : C ≌ D) (Y : D) : rw [← map_comp e.inverse, e.counitInv_naturality, e.counitIso.hom_inv_id_app] simp +set_option backward.isDefEq.respectTransparency false in @[to_dual unitInv_app_inverse] theorem unit_app_inverse (e : C ≌ D) (Y : D) : e.unit.app (e.inverse.obj Y) = e.inverse.map (e.counitInv.app Y) := by @@ -337,6 +341,7 @@ def adjointifyη : 𝟭 C ≅ F ⋙ G := by _ ≅ 𝟭 C ⋙ F ⋙ G := isoWhiskerRight η.symm (F ⋙ G) _ ≅ F ⋙ G := leftUnitor (F ⋙ G) +set_option backward.isDefEq.respectTransparency false in @[reassoc] theorem adjointify_η_ε (X : C) : F.map ((adjointifyη η ε).hom.app X) ≫ ε.hom.app (F.obj X) = 𝟙 (F.obj X) := by @@ -461,8 +466,11 @@ set_option backward.isDefEq.respectTransparency false in `cancel_natIso_inv_right(_assoc)` for units and counits, because neither `simp` or `rw` will apply those lemmas in this setting without providing `e.unitIso` (or similar) as an explicit argument. We also provide the lemmas for length four compositions, since they're occasionally useful. -(e.g. in proving that equivalences take monos to monos) -/ -@[to_dual (attr := simp) cancel_unitInv_left] +(e.g. in proving that equivalences take monos to monos) + +`cancel_unitInv_left` is not a `simp` lemma because it would be redundant. +-/ +@[to_dual cancel_unitInv_left, simp] theorem cancel_unit_right {X Y : C} (f f' : X ⟶ Y) : f ≫ e.unit.app Y = f' ≫ e.unit.app Y ↔ f = f' := by simp only [cancel_mono] @@ -476,8 +484,11 @@ set_option backward.isDefEq.respectTransparency false in theorem cancel_counit_right {X Y : D} (f f' : X ⟶ e.functor.obj (e.inverse.obj Y)) : f ≫ e.counit.app Y = f' ≫ e.counit.app Y ↔ f = f' := by simp only [cancel_mono] +/- +`cancel_counit_left` is not a `simp` lemma because it would be redundant. +-/ set_option backward.isDefEq.respectTransparency false in -@[to_dual (attr := simp) cancel_counit_left] +@[to_dual cancel_counit_left, simp] theorem cancel_counitInv_right {X Y : D} (f f' : X ⟶ Y) : f ≫ e.counitInv.app Y = f' ≫ e.counitInv.app Y ↔ f = f' := by simp only [cancel_mono] diff --git a/Mathlib/CategoryTheory/Equivalence/Symmetry.lean b/Mathlib/CategoryTheory/Equivalence/Symmetry.lean index f93fc316d7903a..88399593e8a13e 100644 --- a/Mathlib/CategoryTheory/Equivalence/Symmetry.lean +++ b/Mathlib/CategoryTheory/Equivalence/Symmetry.lean @@ -37,6 +37,7 @@ namespace Equivalence variable (C : Type*) [Category* C] (D : Type*) [Category* D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The forward functor of the equivalence `(C ≌ D) ≌ (D ≌ C)ᵒᵖ`. -/ @[simps] @@ -45,6 +46,7 @@ def symmEquivFunctor : (C ≌ D) ⥤ (D ≌ C)ᵒᵖ where map {e f} α := (mkHom <| conjugateEquiv f.toAdjunction e.toAdjunction <| asNatTrans α).op map_comp _ _ := Quiver.Hom.unop_inj (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inverse functor of the equivalence `(C ≌ D) ≌ (D ≌ C)ᵒᵖ`. -/ @[simps!] @@ -80,11 +82,13 @@ def inverseFunctor : (C ≌ D) ⥤ (D ⥤ C)ᵒᵖ := variable {C D} +set_option backward.isDefEq.respectTransparency.types false in /-- The `inverse` functor sends an equivalence to its inverse. -/ @[simps!] def inverseFunctorObjIso (e : C ≌ D) : (inverseFunctor C D).obj e ≅ Opposite.op e.inverse := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- We can compare the way we obtain a natural isomorphism `e.inverse ≅ f.inverse` from an isomorphism `e ≌ f` via `inverseFunctor` with the way we get one through `Iso.isoInverseOfIsoFunctor`. -/ @@ -93,12 +97,14 @@ lemma inverseFunctorMapIso_symm_eq_isoInverseOfIsoFunctor {e f : C ≌ D} (α : Iso.isoInverseOfIsoFunctor ((functorFunctor _ _).mapIso α) := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- An "unopped" version of the equivalence `inverseFunctorObj'`. -/ @[simps!] def inverseFunctorObj' (e : C ≌ D) : Opposite.unop ((inverseFunctor C D).obj e) ≅ e.inverse := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in variable (C D) in /-- Promoting `Equivalence.congrLeft` to a functor. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Extensive.lean b/Mathlib/CategoryTheory/Extensive.lean index 3f5988a12aa152..20d4241fd5e215 100644 --- a/Mathlib/CategoryTheory/Extensive.lean +++ b/Mathlib/CategoryTheory/Extensive.lean @@ -207,6 +207,7 @@ theorem finitaryExtensive_iff_of_isTerminal (C : Type u) [Category.{v} C] [HasFi obtain ⟨hl, hr⟩ := (H c (HT.from _) (HT.from _) d hd.symm hd'.symm).mp ⟨hc⟩ rw [hl.paste_vert_iff hX.symm, hr.paste_vert_iff hY.symm] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance types.finitaryExtensive : FinitaryExtensive (Type u) := by classical @@ -308,6 +309,7 @@ noncomputable def finitaryExtensiveTopCatAux (Z : TopCat.{u}) convert! f.hom.2.1 _ isOpen_range_inr · convert! Set.isCompl_range_inl_range_inr.preimage f +set_option backward.isDefEq.respectTransparency.types false in instance finitaryExtensive_TopCat : FinitaryExtensive TopCat.{u} := by rw [finitaryExtensive_iff_of_isTerminal TopCat.{u} _ TopCat.isTerminalPUnit _ (TopCat.binaryCofanIsColimit _ _)] @@ -551,6 +553,7 @@ instance FinitaryPreExtensive.hasPullbacks_of_inclusions [FinitaryPreExtensive C apply FinitaryPreExtensive.hasPullbacks_of_is_coproduct (c := Cofan.mk Z i) exact @IsColimit.ofPointIso (t := Cofan.mk Z i) (P := _) (i := hi) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma FinitaryPreExtensive.isIso_sigmaDesc_fst [FinitaryPreExtensive C] {α : Type} [Finite α] {X : C} {Z : α → C} (π : (a : α) → Z a ⟶ X) {Y : C} (f : Y ⟶ X) (hπ : IsIso (Sigma.desc π)) : diff --git a/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean b/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean index ed5734b16d5cd4..b8b8d6202aac88 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/BasedCategory.lean @@ -281,6 +281,7 @@ instance : Category (BasedCategory.{v₂, u₂} 𝒮) where id := id comp := comp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The bicategory of based categories. -/ instance bicategory : Bicategory (BasedCategory.{v₂, u₂} 𝒮) where @@ -294,6 +295,7 @@ instance bicategory : Bicategory (BasedCategory.{v₂, u₂} 𝒮) where leftUnitor {_ _} F := BasedNatIso.id F rightUnitor {_ _} F := BasedNatIso.id F +set_option backward.isDefEq.respectTransparency.types false in /-- The bicategory structure on `BasedCategory.{v₂, u₂} 𝒮` is strict. -/ instance : Bicategory.Strict (BasedCategory.{v₂, u₂} 𝒮) where diff --git a/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean b/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean index 760a03fef90c0c..5bfd8f4da589af 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Fiber.lean @@ -63,6 +63,7 @@ instance : (fiberInclusion : Fiber p S ⥤ _).Faithful where lemma fiberInclusion_obj_inj : (fiberInclusion : Fiber p S ⥤ _).obj.Injective := fun _ _ f ↦ Subtype.val_inj.1 f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For fixed `S : 𝒮` this is the natural isomorphism between `fiberInclusion ⋙ p` and the constant function valued at `S`. -/ diff --git a/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean b/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean index 842c34c53cde56..28e7de5cd38ac9 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean @@ -44,6 +44,7 @@ abbrev cartesianLift : domainCartesianLift a f ⟶ ⟨S, a⟩ := ⟨f, 𝟙 _⟩ instance isHomLift_cartesianLift : IsHomLift (forget F) f (cartesianLift a f) := IsHomLift.map (forget F) (cartesianLift a f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {a} in /-- Given some lift `φ'` of `g ≫ f`, the canonical map from the domain of `φ'` to the domain of @@ -55,6 +56,7 @@ abbrev homCartesianLift {a' : ∫ᶜ F} (g : a'.1 ⟶ R) (φ' : a' ⟶ ⟨S, a have : φ'.base = g ≫ f := by simpa using IsHomLift.fac' (forget F) (g ≫ f) φ' φ'.fiber ≫ eqToHom (by simp [this]) ≫ (F.mapComp f.op.toLoc g.op.toLoc).hom.toNatTrans.app a +set_option backward.isDefEq.respectTransparency.types false in instance isHomLift_homCartesianLift {a' : ∫ᶜ F} {φ' : a' ⟶ ⟨S, a⟩} {g : a'.1 ⟶ R} [IsHomLift (forget F) (g ≫ f) φ'] : IsHomLift (forget F) g (homCartesianLift f g φ') := IsHomLift.map (forget F) (homCartesianLift f g φ') diff --git a/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean b/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean index 7907d6276d3caa..a21c845ac51157 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/HasFibers.lean @@ -78,7 +78,7 @@ class HasFibers (p : 𝒳 ⥤ 𝒮) where namespace HasFibers /-- The `HasFibers` on `p : 𝒳 ⥤ 𝒮` given by the fibers of `p` -/ -@[implicit_reducible] +@[instance_reducible] def canonical (p : 𝒳 ⥤ 𝒮) : HasFibers p where Fib := Fiber p ι S := fiberInclusion @@ -124,6 +124,7 @@ def projMap {R S : 𝒮} {a : Fib p R} {b : Fib p S} (φ : (ι R).obj a ⟶ (ι S).obj b) : R ⟶ S := eqToHom (proj_eq a).symm ≫ (p.map φ) ≫ eqToHom (proj_eq b) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For any homomorphism `φ` in a fiber `Fib S`, its image under `ι S` lies over `𝟙 S`. -/ instance homLift {S : 𝒮} {a b : Fib p S} (φ : a ⟶ b) : IsHomLift p (𝟙 S) ((ι S).map φ) := by diff --git a/Mathlib/CategoryTheory/Filtered/Final.lean b/Mathlib/CategoryTheory/Filtered/Final.lean index bebaba5487036e..f5fde8bd413451 100644 --- a/Mathlib/CategoryTheory/Filtered/Final.lean +++ b/Mathlib/CategoryTheory/Filtered/Final.lean @@ -207,6 +207,7 @@ instance IsCofiltered.over [IsCofilteredOrEmpty C] (c : C) : IsCofiltered (Over (fun c' => ⟨c', ⟨𝟙 _⟩⟩) (fun s s' => IsCofilteredOrEmpty.cone_maps s s') c +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The forgetful functor of the under category on any filtered or empty category is final. -/ instance Under.final_forget [IsFilteredOrEmpty C] (c : C) : Final (Under.forget c) := @@ -218,6 +219,7 @@ instance Under.final_forget [IsFilteredOrEmpty C] (c : C) : Final (Under.forget simp only [forget_obj, mk_right, forget_map, homMk_right] rw [IsFiltered.coeq_condition]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The forgetful functor of the over category on any cofiltered or empty category is initial. -/ instance Over.initial_forget [IsCofilteredOrEmpty C] (c : C) : Initial (Over.forget c) := @@ -249,6 +251,7 @@ theorem Functor.Final.exists_coeq_of_locally_small [IsFilteredOrEmpty C] [Final end LocallySmall +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `C` is filtered, then we can give an explicit condition for a functor `F : C ⥤ D` to be final. -/ @@ -399,6 +402,7 @@ instance StructuredArrow.final_post [IsFiltered C] {E : Type u₃} [Category.{v (T : C ⥤ D) [T.Final] (S : D ⥤ E) [S.Final] : Final (post X T S) := by apply final_of_natIso (postIsoMap₂ X T S).symm +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `CostructuredArrow T d ⥤ CostructuredArrow (T ⋙ S) e` that `u : S.obj d ⟶ e` induces via `CostructuredArrow.map₂` is initial, if `T` and `S` are initial and the domain of `T` is filtered. -/ diff --git a/Mathlib/CategoryTheory/Filtered/Grothendieck.lean b/Mathlib/CategoryTheory/Filtered/Grothendieck.lean index 1653fc92955552..8f5691181d4e67 100644 --- a/Mathlib/CategoryTheory/Filtered/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Filtered/Grothendieck.lean @@ -25,6 +25,7 @@ variable {C : Type u} [Category.{v} C] (F : C ⥤ Cat) open IsFiltered +set_option backward.isDefEq.respectTransparency.types false in instance [IsFilteredOrEmpty C] [∀ c, IsFilteredOrEmpty (F.obj c)] : IsFilteredOrEmpty (Grothendieck F) := by refine ⟨?_, ?_⟩ @@ -38,7 +39,8 @@ instance [IsFilteredOrEmpty C] [∀ c, IsFilteredOrEmpty (F.obj c)] : ⟨coeqHom u v, coeqHom _ _⟩, ?_⟩ · conv_rhs => rw [← Cat.Hom.comp_obj, ← F.map_comp, coeq_condition, F.map_comp, Cat.Hom.comp_obj] - · apply Grothendieck.ext _ _ (coeq_condition u v) + · set_option backward.isDefEq.respectTransparency.types false in + apply Grothendieck.ext _ _ (coeq_condition u v) refine Eq.trans ?_ (eqToHom _ ≫= coeq_condition _ _) simp diff --git a/Mathlib/CategoryTheory/FinCategory/AsType.lean b/Mathlib/CategoryTheory/FinCategory/AsType.lean index 5fe1e4c0b6fcfa..a6e164203eb44c 100644 --- a/Mathlib/CategoryTheory/FinCategory/AsType.lean +++ b/Mathlib/CategoryTheory/FinCategory/AsType.lean @@ -41,6 +41,7 @@ noncomputable def objAsTypeEquiv : ObjAsType α ≌ α := abbrev AsType : Type := Fin (Fintype.card α) +set_option backward.isDefEq.respectTransparency.types false in @[simps -isSimp id comp] noncomputable instance categoryAsType : SmallCategory (AsType α) where Hom i j := Fin (Fintype.card (@Quiver.Hom (ObjAsType α) _ i j)) @@ -49,6 +50,7 @@ noncomputable instance categoryAsType : SmallCategory (AsType α) where attribute [local simp] categoryAsType_id categoryAsType_comp +set_option backward.isDefEq.respectTransparency.types false in /-- The "identity" functor from `AsType α` to `ObjAsType α`. -/ @[simps] noncomputable def asTypeToObjAsType : AsType α ⥤ ObjAsType α where diff --git a/Mathlib/CategoryTheory/FintypeCat.lean b/Mathlib/CategoryTheory/FintypeCat.lean index 17670dd99cdd62..817c08808a3193 100644 --- a/Mathlib/CategoryTheory/FintypeCat.lean +++ b/Mathlib/CategoryTheory/FintypeCat.lean @@ -47,7 +47,7 @@ instance {X : FintypeCat} : Finite X := /-- A `Fintype` instance on objects on `FintypeCat`, that should be turned on as needed. Prefer the `Finite` instance if possible. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintype {X : FintypeCat} : Fintype X := Fintype.ofFinite X.obj @@ -215,6 +215,7 @@ instance : incl.Faithful where map_injective h := by simpa using TypeCat.homEquiv.symm.injective (InducedCategory.homEquiv.symm.injective h) +set_option backward.isDefEq.respectTransparency.types false in instance : incl.EssSurj := Functor.EssSurj.mk fun X => letI := X.fintype diff --git a/Mathlib/CategoryTheory/Functor/Basic.lean b/Mathlib/CategoryTheory/Functor/Basic.lean index 3e8b86481693f7..360f04db903fae 100644 --- a/Mathlib/CategoryTheory/Functor/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/Basic.lean @@ -77,6 +77,7 @@ initialize_simps_projections Functor -- We don't use `@[simps]` here because we want `C` implicit for the simp lemmas. /-- `𝟭 C` is the identity functor on a category `C`. -/ +@[implicit_reducible] protected def id : C ⥤ C where obj X := X map f := f @@ -113,7 +114,7 @@ theorem congr_map (F : C ⥤ D) {X Y : C} {f g : X ⟶ Y} /-- `F ⋙ G` is the composition of a functor `F` and a functor `G` (`F` first, then `G`). -/ -@[simps (attr := grind =) obj] +@[simps (attr := grind =) obj, implicit_reducible] def comp (F : C ⥤ D) (G : D ⥤ E) : C ⥤ E where obj X := G.obj (F.obj X) map f := G.map (F.map f) diff --git a/Mathlib/CategoryTheory/Functor/Category.lean b/Mathlib/CategoryTheory/Functor/Category.lean index c084dc651ea1e2..fda9c872ad0237 100644 --- a/Mathlib/CategoryTheory/Functor/Category.lean +++ b/Mathlib/CategoryTheory/Functor/Category.lean @@ -149,7 +149,7 @@ end NatTrans namespace Functor /-- Flip the arguments of a bifunctor. See also `Currying.lean`. -/ -@[simps (attr := grind =) obj_obj obj_map] +@[simps (attr := grind =) obj_obj obj_map, implicit_reducible] protected def flip (F : C ⥤ D ⥤ E) : D ⥤ C ⥤ E where obj k := { obj := fun j => (F.obj j).obj k, diff --git a/Mathlib/CategoryTheory/Functor/Const.lean b/Mathlib/CategoryTheory/Functor/Const.lean index 970b034f3908e7..6bf01f34d6453d 100644 --- a/Mathlib/CategoryTheory/Functor/Const.lean +++ b/Mathlib/CategoryTheory/Functor/Const.lean @@ -32,13 +32,15 @@ variable {C : Type u₂} [Category.{v₂} C] /-- The functor sending `X : C` to the constant functor `J ⥤ C` sending everything to `X`. -/ -@[simps] +@[simps, implicit_reducible] def const : C ⥤ J ⥤ C where obj X := { obj := fun _ => X map := fun _ => 𝟙 X } map f := { app := fun _ => f } +attribute [defeq, simp] const_obj_obj + namespace const open Opposite @@ -96,6 +98,7 @@ def constComp (X : C) (F : C ⥤ D) : (const J).obj X ⋙ F ≅ (const J).obj (F instance [Nonempty J] : Faithful (const J : C ⥤ J ⥤ C) where map_injective e := NatTrans.congr_app e (Classical.arbitrary J) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism `F ⋙ Functor.const J ≅ Functor.const F ⋙ (whiskeringRight J _ _).obj L`. -/ @@ -106,6 +109,7 @@ def compConstIso (F : C ⥤ D) : (fun X => NatIso.ofComponents (fun _ => Iso.refl _) (by simp)) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism `const D ⋙ (whiskeringLeft J _ _).obj F ≅ const J` -/ diff --git a/Mathlib/CategoryTheory/Functor/Currying.lean b/Mathlib/CategoryTheory/Functor/Currying.lean index 3ba90b52b22a85..a8f6f12c9f9f02 100644 --- a/Mathlib/CategoryTheory/Functor/Currying.lean +++ b/Mathlib/CategoryTheory/Functor/Currying.lean @@ -34,7 +34,7 @@ variable {B : Type u₁} [Category.{v₁} B] {C : Type u₂} [Category.{v₂} C] /-- The uncurrying functor, taking a functor `C ⥤ (D ⥤ E)` and producing a functor `(C × D) ⥤ E`. -/ -@[simps] +@[simps, implicit_reducible] def uncurry : (C ⥤ D ⥤ E) ⥤ C × D ⥤ E where obj F := { obj := fun X => (F.obj X.1).obj X.2 @@ -81,6 +81,7 @@ def curry : (C × D ⥤ E) ⥤ C ⥤ D ⥤ E where ext; dsimp [curryObj] rw [NatTrans.naturality] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- create projection simp lemmas even though this isn't a `{ .. }`. /-- The equivalence of functor categories given by currying/uncurrying. @@ -97,6 +98,7 @@ def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E where dsimp at f₁ f₂ ⊢ simp only [← F.map_comp, prod_comp, Category.comp_id, Category.id_comp])) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of functor categories given by flipping. -/ @[simps!] @@ -108,10 +110,12 @@ def flipping : C ⥤ D ⥤ E ≌ D ⥤ C ⥤ E where counitIso := NatIso.ofComponents (fun _ ↦ NatIso.ofComponents (fun _ ↦ NatIso.ofComponents (fun _ ↦ Iso.refl _))) +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `uncurry : (C ⥤ D ⥤ E) ⥤ C × D ⥤ E` is fully faithful. -/ def fullyFaithfulUncurry : (uncurry : (C ⥤ D ⥤ E) ⥤ C × D ⥤ E).FullyFaithful := currying.fullyFaithfulFunctor +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `curry : (C × D ⥤ E) ⥤ C ⥤ D ⥤ E` is fully faithful. -/ def fullyFaithfulCurry : (curry : (C × D ⥤ E) ⥤ C ⥤ D ⥤ E).FullyFaithful := currying.fullyFaithfulInverse @@ -128,6 +132,7 @@ instance : (uncurry : (C ⥤ D ⥤ E) ⥤ C × D ⥤ E).Full := instance : (uncurry : (C ⥤ D ⥤ E) ⥤ C × D ⥤ E).Faithful := fullyFaithfulUncurry.faithful +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given functors `F₁ : C ⥤ D`, `F₂ : C' ⥤ D'` and `G : D × D' ⥤ E`, this is the isomorphism between `curry.obj ((F₁.prod F₂).comp G)` and @@ -139,6 +144,7 @@ def curryObjProdComp {C' D' : Type*} [Category* C'] [Category* D'] F₁ ⋙ curry.obj G ⋙ (whiskeringLeft C' D' E).obj F₂ := NatIso.ofComponents (fun X₁ ↦ NatIso.ofComponents (fun X₂ ↦ Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `F.flip` is isomorphic to uncurrying `F`, swapping the variables, and currying. -/ @[simps!] @@ -164,6 +170,7 @@ def whiskeringRight₂ : (C ⥤ D ⥤ E) ⥤ (B ⥤ C) ⥤ (B ⥤ D) ⥤ B ⥤ E variable {B C D E} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma uncurry_obj_curry_obj (F : B × C ⥤ D) : uncurry.obj (curry.obj F) = F := Functor.ext (by simp) (fun ⟨x₁, x₂⟩ ⟨y₁, y₂⟩ ⟨f₁, f₂⟩ => by @@ -174,6 +181,7 @@ lemma curry_obj_injective {F₁ F₂ : C × D ⥤ E} (h : curry.obj F₁ = curry F₁ = F₂ := by rw [← uncurry_obj_curry_obj F₁, ← uncurry_obj_curry_obj F₂, h] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma curry_obj_uncurry_obj (F : B ⥤ C ⥤ D) : curry.obj (uncurry.obj F) = F := Functor.ext (fun _ => Functor.ext (by simp) (by simp)) (by cat_disch) @@ -188,6 +196,7 @@ lemma flip_injective {F₁ F₂ : B ⥤ C ⥤ D} (h : F₁.flip = F₂.flip) : F₁ = F₂ := by rw [← flip_flip F₁, ← flip_flip F₂, h] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma uncurry_obj_curry_obj_flip_flip (F₁ : B ⥤ C) (F₂ : D ⥤ E) (G : C × E ⥤ H) : uncurry.obj (F₂ ⋙ (F₁ ⋙ curry.obj G).flip).flip = (F₁.prod F₂) ⋙ G := @@ -195,6 +204,7 @@ lemma uncurry_obj_curry_obj_flip_flip (F₁ : B ⥤ C) (F₂ : D ⥤ E) (G : C dsimp simp only [Category.id_comp, Category.comp_id, ← G.map_comp, prod_comp]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma uncurry_obj_curry_obj_flip_flip' (F₁ : B ⥤ C) (F₂ : D ⥤ E) (G : C × E ⥤ H) : uncurry.obj (F₁ ⋙ (F₂ ⋙ (curry.obj G).flip).flip) = (F₁.prod F₂) ⋙ G := diff --git a/Mathlib/CategoryTheory/Functor/CurryingThree.lean b/Mathlib/CategoryTheory/Functor/CurryingThree.lean index 163a4d1426d871..9cf3402b9c0115 100644 --- a/Mathlib/CategoryTheory/Functor/CurryingThree.lean +++ b/Mathlib/CategoryTheory/Functor/CurryingThree.lean @@ -80,6 +80,7 @@ lemma curry₃_map_app_app_app {F G : C₁ × C₂ × C₃ ⥤ E} (f : F ⟶ G) (X₁ : C₁) (X₂ : C₂) (X₃ : C₃) : (((curry₃.map f).app X₁).app X₂).app X₃ = f.app ⟨X₁, X₂, X₃⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma currying₃_unitIso_hom_app_app_app_app (F : C₁ ⥤ C₂ ⥤ C₃ ⥤ E) @@ -87,6 +88,7 @@ lemma currying₃_unitIso_hom_app_app_app_app (F : C₁ ⥤ C₂ ⥤ C₃ ⥤ E) (((currying₃.unitIso.hom.app F).app X₁).app X₂).app X₃ = 𝟙 _ := by simp [currying₃, Equivalence.unit] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma currying₃_unitIso_inv_app_app_app_app (F : C₁ ⥤ C₂ ⥤ C₃ ⥤ E) @@ -108,6 +110,7 @@ def curry₃ObjProdComp (F₁ : C₁ ⥤ D₁) (F₂ : C₂ ⥤ D₂) (F₃ : C (fun X₁ ↦ NatIso.ofComponents (fun X₂ ↦ NatIso.ofComponents (fun X₃ ↦ Iso.refl _))) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `bifunctorComp₁₂` can be described in terms of the curryfication of functors. -/ @[simps!] @@ -115,6 +118,7 @@ def bifunctorComp₁₂Iso (F₁₂ : C₁ ⥤ C₂ ⥤ C₁₂) (G : C₁₂ bifunctorComp₁₂ F₁₂ G ≅ curry.obj (uncurry.obj F₁₂ ⋙ G) := NatIso.ofComponents (fun _ => NatIso.ofComponents (fun _ => Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `bifunctorComp₂₃` can be described in terms of the curryfication of functors. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Functor/Flat.lean b/Mathlib/CategoryTheory/Functor/Flat.lean index 665c09322a853a..8e0acdef3606dc 100644 --- a/Mathlib/CategoryTheory/Functor/Flat.lean +++ b/Mathlib/CategoryTheory/Functor/Flat.lean @@ -180,6 +180,7 @@ open StructuredArrow variable {J : Type v₁} [SmallCategory J] [FinCategory J] {K : J ⥤ C} variable (F : C ⥤ D) [RepresentablyFlat F] {c : Cone K} (hc : IsLimit c) (s : Cone (K ⋙ F)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- (Implementation). Given a limit cone `c : cone K` and a cone `s : cone (K ⋙ F)` with `F` representably flat, diff --git a/Mathlib/CategoryTheory/Functor/FullyFaithful.lean b/Mathlib/CategoryTheory/Functor/FullyFaithful.lean index df388bbf5931f1..d7b7098026f9a8 100644 --- a/Mathlib/CategoryTheory/Functor/FullyFaithful.lean +++ b/Mathlib/CategoryTheory/Functor/FullyFaithful.lean @@ -217,6 +217,7 @@ def isoEquiv {X Y : C} : (X ≅ Y) ≃ (F.obj X ≅ F.obj Y) where left_inv := by cat_disch right_inv := by cat_disch +set_option backward.isDefEq.respectTransparency false in /-- Fully faithful functors are stable by composition. -/ @[simps] def comp {G : D ⥤ E} (hG : G.FullyFaithful) : (F ⋙ G).FullyFaithful where @@ -350,6 +351,7 @@ theorem Faithful.div_faithful (F : C ⥤ E) [F.Faithful] (G : D ⥤ E) [G.Faithf Functor.Faithful (Faithful.div F G obj @h_obj @map @h_map) := (Faithful.div_comp F G _ h_obj _ @h_map).faithful_of_comp +set_option backward.isDefEq.respectTransparency false in instance Full.comp [Full F] [Full G] : Full (F ⋙ G) where map_surjective f := ⟨F.preimage (G.preimage f), by simp⟩ @@ -363,6 +365,7 @@ lemma Full.of_comp_faithful_iso {F : C ⥤ D} {G : D ⥤ E} {H : C ⥤ E} [Full have := Full.of_iso h.symm exact Full.of_comp_faithful F G +set_option backward.isDefEq.respectTransparency false in /-- Given a natural isomorphism between `F ⋙ H` and `G ⋙ H` for a fully faithful functor `H`, we can 'cancel' it to give a natural iso between `F` and `G`. -/ diff --git a/Mathlib/CategoryTheory/Functor/FunctorHom.lean b/Mathlib/CategoryTheory/Functor/FunctorHom.lean index 29e13d9da2b210..711689e7153c6a 100644 --- a/Mathlib/CategoryTheory/Functor/FunctorHom.lean +++ b/Mathlib/CategoryTheory/Functor/FunctorHom.lean @@ -201,6 +201,7 @@ lemma associator_hom_apply (K L M N : C ⥤ D) {X : C} dsimp% (α_ ((K.functorHom L).obj X) ((L.functorHom M).obj X) ((M.functorHom N).obj X)).hom x = ⟨x.1.1, x.1.2, x.2⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in attribute [local simp] functorHom types_tensorObj_def in instance : EnrichedCategory (C ⥤ Type (max v' v u)) (C ⥤ D) where Hom := functorHom diff --git a/Mathlib/CategoryTheory/Functor/Functorial.lean b/Mathlib/CategoryTheory/Functor/Functorial.lean index 0ccf44c8d7bd1d..cd38c5e2c1ef84 100644 --- a/Mathlib/CategoryTheory/Functor/Functorial.lean +++ b/Mathlib/CategoryTheory/Functor/Functorial.lean @@ -65,7 +65,7 @@ variable {E : Type u₃} [Category.{v₃} E] -- Will this be a problem? /-- `G ∘ F` is a functorial if both `F` and `G` are. -/ -@[implicit_reducible] +@[instance_reducible] def functorial_comp (F : C → D) [Functorial.{v₁, v₂} F] (G : D → E) [Functorial.{v₂, v₃} G] : Functorial.{v₁, v₃} (G ∘ F) := { Functor.of F ⋙ Functor.of G with map := fun f => map G (map F f) } diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean index dabb7a27d6ecab..e6ff07816461d4 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean @@ -242,6 +242,7 @@ lemma ι_colimitIsoColimitGrothendieck_inv (X : Grothendieck (CostructuredArrow. colimit.ι G ((CostructuredArrow.proj L X.base).obj X.fiber) := by simp [colimitIsoColimitGrothendieck] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma ι_colimitIsoColimitGrothendieck_hom (X : C) : colimit.ι G X ≫ (colimitIsoColimitGrothendieck L G).hom = diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean index 8f258c7b23fce8..eea4adbd0a0529 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean @@ -319,7 +319,7 @@ variable {L : C ⥤ D} {L' : C ⥤ D'} (G : D ⥤ D') /-- The functor `LeftExtension L' F ⥤ LeftExtension L F` induced by a natural transformation `L' ⟶ L ⋙ G'`. -/ -@[simps!] +@[simps!, implicit_reducible] def LeftExtension.postcomp₁ (f : L' ⟶ L ⋙ G) (F : C ⥤ H) : LeftExtension L' F ⥤ LeftExtension L F := StructuredArrow.map₂ (F := (whiskeringLeft D D' H).obj G) (G := 𝟭 _) (𝟙 _) @@ -327,7 +327,7 @@ def LeftExtension.postcomp₁ (f : L' ⟶ L ⋙ G) (F : C ⥤ H) : /-- The functor `RightExtension L' F ⥤ RightExtension L F` induced by a natural transformation `L ⋙ G ⟶ L'`. -/ -@[simps!] +@[simps!, implicit_reducible] def RightExtension.postcomp₁ (f : L ⋙ G ⟶ L') (F : C ⥤ H) : RightExtension L' F ⥤ RightExtension L F := CostructuredArrow.map₂ (F := (whiskeringLeft D D' H).obj G) (G := 𝟭 _) @@ -371,6 +371,7 @@ noncomputable def RightExtension.isUniversalPostcomp₁Equiv (ex : RightExtensio variable {F F'} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isLeftKanExtension_iff_postcomp₁ (α : F ⟶ L' ⋙ F') : F'.IsLeftKanExtension α ↔ (G ⋙ F').IsLeftKanExtension @@ -384,6 +385,7 @@ lemma isLeftKanExtension_iff_postcomp₁ (α : F ⟶ L' ⋙ F') : · exact fun _ => ⟨⟨eq (isUniversalOfIsLeftKanExtension _ _)⟩⟩ · exact fun _ => ⟨⟨eq.symm (isUniversalOfIsLeftKanExtension _ _)⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isRightKanExtension_iff_postcomp₁ (α : L' ⋙ F' ⟶ F) : F'.IsRightKanExtension α ↔ (G ⋙ F').IsRightKanExtension @@ -407,7 +409,7 @@ set_option backward.defeqAttrib.useBackward true in /-- Given a left extension `E` of `F : C ⥤ H` along `L : C ⥤ D` and a functor `G : H ⥤ D'`, `E.postcompose₂ G` is the extension of `F ⋙ G` along `L` obtained by whiskering by `G` on the right. -/ -@[simps!] +@[simps!, implicit_reducible] def LeftExtension.postcompose₂ : LeftExtension L F ⥤ LeftExtension L (F ⋙ G) := StructuredArrow.map₂ (F := (whiskeringRight _ _ _).obj G) @@ -418,7 +420,7 @@ set_option backward.defeqAttrib.useBackward true in /-- Given a right extension `E` of `F : C ⥤ H` along `L : C ⥤ D` and a functor `G : H ⥤ D'`, `E.postcompose₂ G` is the extension of `F ⋙ G` along `L` obtained by whiskering by `G` on the right. -/ -@[simps!] +@[simps!, implicit_reducible] def RightExtension.postcompose₂ : RightExtension L F ⥤ RightExtension L (F ⋙ G) := CostructuredArrow.map₂ (F := (whiskeringRight _ _ _).obj G) @@ -426,6 +428,7 @@ def RightExtension.postcompose₂ : RightExtension L F ⥤ RightExtension L (F ({ app _ := associator _ _ _ |>.inv }) (𝟙 _) variable {L F} {F' : D ⥤ H} +set_option backward.isDefEq.respectTransparency.types false in /-- An isomorphism to describe the action of `LeftExtension.postcompose₂` on terms of the form `LeftExtension.mk _ α`. -/ @[simps!] @@ -434,6 +437,7 @@ def LeftExtension.postcompose₂ObjMkIso (α : F ⟶ L ⋙ F') : .mk (F' ⋙ G) <| whiskerRight α G ≫ (associator _ _ _).hom := StructuredArrow.isoMk (.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An isomorphism to describe the action of `RightExtension.postcompose₂` on terms of the form `RightExtension.mk _ α`. -/ @@ -451,13 +455,13 @@ variable (L : C ⥤ D) (F : C ⥤ H) (F' : D ⥤ H) (G : C' ⥤ C) /-- The functor `LeftExtension L F ⥤ LeftExtension (G ⋙ L) (G ⋙ F)` obtained by precomposition. -/ -@[simps!] +@[simps!, implicit_reducible] def LeftExtension.precomp : LeftExtension L F ⥤ LeftExtension (G ⋙ L) (G ⋙ F) := StructuredArrow.map₂ (F := 𝟭 _) (G := (whiskeringLeft C' C H).obj G) (𝟙 _) (𝟙 _) /-- The functor `RightExtension L F ⥤ RightExtension (G ⋙ L) (G ⋙ F)` obtained by precomposition. -/ -@[simps!] +@[simps!, implicit_reducible] def RightExtension.precomp : RightExtension L F ⥤ RightExtension (G ⋙ L) (G ⋙ F) := CostructuredArrow.map₂ (F := 𝟭 _) (G := (whiskeringLeft C' C H).obj G) (𝟙 _) (𝟙 _) @@ -485,6 +489,7 @@ noncomputable def RightExtension.isUniversalPrecompEquiv (e : RightExtension L F variable {F L} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isLeftKanExtension_iff_precomp (α : F ⟶ L ⋙ F') : F'.IsLeftKanExtension α ↔ F'.IsLeftKanExtension @@ -497,6 +502,7 @@ lemma isLeftKanExtension_iff_precomp (α : F ⟶ L ⋙ F') : · exact fun _ => ⟨⟨eq (isUniversalOfIsLeftKanExtension _ _)⟩⟩ · exact fun _ => ⟨⟨eq.symm (isUniversalOfIsLeftKanExtension _ _)⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isRightKanExtension_iff_precomp (α : L ⋙ F' ⟶ F) : F'.IsRightKanExtension α ↔ @@ -517,6 +523,7 @@ variable {L L' : C ⥤ D} (iso₁ : L ≅ L') (F : C ⥤ H) /-- The equivalence `RightExtension L F ≌ RightExtension L' F` induced by a natural isomorphism `L ≅ L'`. -/ +-- TODO: Should this be `@[simps!]` too? def rightExtensionEquivalenceOfIso₁ : RightExtension L F ≌ RightExtension L' F := CostructuredArrow.mapNatIso ((whiskeringLeft C D H).mapIso iso₁) @@ -526,7 +533,7 @@ lemma hasRightExtension_iff_of_iso₁ : HasRightKanExtension L F ↔ HasRightKan /-- The equivalence `LeftExtension L F ≌ LeftExtension L' F` induced by a natural isomorphism `L ≅ L'`. -/ -@[simps!] +@[simps!, implicit_reducible] def leftExtensionEquivalenceOfIso₁ : LeftExtension L F ≌ LeftExtension L' F := StructuredArrow.mapNatIso ((whiskeringLeft C D H).mapIso iso₁) @@ -586,6 +593,7 @@ lemma isLeftKanExtension_iff_of_iso₂ {F₁' F₂' : D ⥤ H} (α₁ : F₁ ⟶ · exact fun _ => ⟨⟨eq.1 (isUniversalOfIsLeftKanExtension F₁' α₁)⟩⟩ · exact fun _ => ⟨⟨eq.2 (isUniversalOfIsLeftKanExtension F₂' α₂)⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- When two right extensions `α₁ : RightExtension L F₁` and `α₂ : RightExtension L F₂` are essentially the same via an isomorphism of functors `F₁ ≅ F₂`, then `α₁` is universal iff `α₂` is. -/ @@ -672,6 +680,7 @@ def LeftExtension.isUniversalPrecomp₂ simp [← a_w_t, hb_fac_app, u, hα_fac_app] apply IsInitial.ofUnique +set_option backward.isDefEq.respectTransparency.types false in /-- If the left extension defined by `α : F₀ ⟶ L ⋙ F₁` is universal, then for every `L' : D ⥤ D'`, `F₁ : D ⥤ H`, if an extension `b : L'.LeftExtension F₁` is such that the "pasted" extension @@ -807,7 +816,7 @@ variable (F' : D ⥤ H) {L : C ⥤ D} {F : C ⥤ H} (α : L ⋙ F' ⟶ F) [F'.Is /-- Construct a cone for a right Kan extension `F' : D ⥤ H` of `F : C ⥤ H` along a functor `L : C ⥤ D` given a cone for `F`. -/ -@[simps] +@[simps, implicit_reducible] noncomputable def coneOfIsRightKanExtension (c : Cone F) : Cone F' where pt := c.pt π := F'.liftOfIsRightKanExtension α _ c.π @@ -839,7 +848,6 @@ noncomputable def limitIsoOfIsRightKanExtension : limit F' ≅ limit F := IsLimit.conePointUniqueUpToIso (limit.isLimit F') (F'.isLimitConeOfIsRightKanExtension α (limit.isLimit F)) -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma limitIsoOfIsRightKanExtension_inv_π (i : C) : (F'.limitIsoOfIsRightKanExtension α).inv ≫ limit.π F' (L.obj i) ≫ α.app i = limit.π F i := by @@ -907,3 +915,15 @@ end end Functor end CategoryTheory + +/- +TODO: Fixing linter errors was nontrivial. +For `#lint` to trigger, I had to disable the module-wide +`set_option backward.defeqAttrib.useBackward true`. +Even then, lemmas didn't seem to involve defeq abuse. +However, when I split the `simp` into multiple parts, the `tacticCheckInstances` linter +started reporting defeq abuse. +Should it actually check after every single simp lemma application? + +Also had to make `NatTrans.id` implicit-reducible. +-/ diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean b/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean index ddb1edf780ce77..558e289ed6ba55 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/DenseAt.lean @@ -62,6 +62,7 @@ if `Y` and `Y'` are isomorphic. -/ def DenseAt.ofIso {Y' : D} (e : Y ≅ Y') : F.DenseAt Y' := LeftExtension.isPointwiseLeftKanExtensionAtOfIso' _ hY e +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F : C ⥤ D` is dense at `Y : D`, and `G` is a functor that is isomorphic to `F`, then `G` is also dense at `Y`. -/ @@ -90,6 +91,7 @@ noncomputable def DenseAt.precompOfFinal @[deprecated (since := "2025-12-17")] alias DenseAt.precompEquivalence := DenseAt.precompOfFinal +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F : C ⥤ D` is dense at `Y : D` and `G : D ⥤ D'` is an equivalence, then `F ⋙ G` is dense at `G.obj Y`. -/ diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean index f238874689ff1b..9d7c7bc039a7ee 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Pointwise.lean @@ -182,6 +182,7 @@ def coconeAt (Y : D) : Cocone (CostructuredArrow.proj L Y ⋙ F) where simp only [NatTrans.naturality_assoc, Functor.comp_map, Functor.map_comp, comp_id] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (L F) in /-- The cocones for `CostructuredArrow.proj L Y ⋙ F`, as a functor from `LeftExtension L F`. -/ @@ -206,12 +207,14 @@ lemma IsPointwiseLeftKanExtensionAt.hasPointwiseLeftKanExtensionAt {Y : D} (h : E.IsPointwiseLeftKanExtensionAt Y) : HasPointwiseLeftKanExtensionAt L F Y := ⟨_, h⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma IsPointwiseLeftKanExtensionAt.isIso_hom_app {X : C} (h : E.IsPointwiseLeftKanExtensionAt (L.obj X)) [L.Full] [L.Faithful] : IsIso (E.hom.app X) := by simpa using h.isIso_ι_app_of_isTerminal _ CostructuredArrow.mkIdTerminal +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The condition of being a pointwise left Kan extension at an object `Y` is unchanged by replacing `Y` by an isomorphic object `Y'`. -/ @@ -221,6 +224,7 @@ def isPointwiseLeftKanExtensionAtOfIso' IsColimit.ofIsoColimit (hY.whiskerEquivalence (CostructuredArrow.mapIso e.symm)) (Cocone.ext (E.right.mapIso e)) +set_option backward.isDefEq.respectTransparency.types false in /-- The condition of being a pointwise left Kan extension at an object `Y` is unchanged by replacing `Y` by an isomorphic object `Y'`. -/ def isPointwiseLeftKanExtensionAtEquivOfIso' {Y Y' : D} (e : Y ≅ Y') : @@ -234,6 +238,7 @@ namespace IsPointwiseLeftKanExtensionAt variable {E} {Y : D} (h : E.IsPointwiseLeftKanExtensionAt Y) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in include h in lemma hom_ext' {T : H} {f g : E.right.obj Y ⟶ T} @@ -241,6 +246,7 @@ lemma hom_ext' {T : H} {f g : E.right.obj Y ⟶ T} E.hom.app X ≫ E.right.map φ ≫ f = E.hom.app X ≫ E.right.map φ ≫ g) : f = g := h.hom_ext (fun j ↦ by simpa using hfg j.hom) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma comp_homEquiv_symm {Z : H} @@ -262,6 +268,7 @@ lemma ι_isoColimit_inv (g : CostructuredArrow L Y) : colimit.ι _ g ≫ h.isoColimit.inv = E.hom.app g.left ≫ E.right.map g.hom := IsColimit.comp_coconePointUniqueUpToIso_inv _ _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma ι_isoColimit_hom (g : CostructuredArrow L Y) : @@ -320,6 +327,7 @@ def IsPointwiseLeftKanExtension.homFrom (G : LeftExtension L F) : E ⟶ G := ext X simpa using (h (L.obj X)).fac (LeftExtension.coconeAt G _) (CostructuredArrow.mk (𝟙 _))) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma IsPointwiseLeftKanExtension.hom_ext {G : LeftExtension L F} {f₁ f₂ : E ⟶ G} : f₁ = f₂ := by @@ -402,6 +410,7 @@ lemma IsPointwiseRightKanExtensionAt.isIso_hom_app IsIso (E.hom.app X) := by simpa using h.isIso_π_app_of_isInitial _ StructuredArrow.mkIdInitial +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The condition of being a pointwise right Kan extension at an object `Y` is unchanged by replacing `Y` by an isomorphic object `Y'`. -/ @@ -411,6 +420,7 @@ def isPointwiseRightKanExtensionAtOfIso' IsLimit.ofIsoLimit (hY.whiskerEquivalence (StructuredArrow.mapIso e.symm)) (Cone.ext (E.left.mapIso e)) +set_option backward.isDefEq.respectTransparency.types false in /-- The condition of being a pointwise right Kan extension at an object `Y` is unchanged by replacing `Y` by an isomorphic object `Y'`. -/ def isPointwiseRightKanExtensionAtEquivOfIso' {Y Y' : D} (e : Y ≅ Y') : diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean index 15e4a2f66dcc41..0d8c921a3e2b18 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Preserves.lean @@ -107,6 +107,7 @@ def LeftExtension.IsPointwiseLeftKanExtension.postcompose LeftExtension.postcompose₂ L F G |>.obj E |>.IsPointwiseLeftKanExtension := fun c ↦ (hE c).postcompose G +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The cocone at a point of the whiskering right by `G` of an extension is isomorphic to the action of `G` on the cocone at that point for the original extension. -/ @@ -237,6 +238,7 @@ lemma pointwiseLeftKanExtensionCompIsoOfPreserves_hom_fac : (α := whiskerRight (L.pointwiseLeftKanExtensionUnit F) G ≫ (Functor.associator _ _ _).hom) (β := L.pointwiseLeftKanExtensionUnit <| F ⋙ G) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma pointwiseLeftKanExtensionCompIsoOfPreserves_hom_fac_app (a : A) : @@ -367,6 +369,7 @@ def RightExtension.IsPointwiseRightKanExtension.postcompose RightExtension.postcompose₂ L F G |>.obj E |>.IsPointwiseRightKanExtension := fun c ↦ (hE c).postcompose G +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The cone at a point of the whiskering right by `G` of an extension is isomorphic to the action of `G` on the cone at that point for the original extension. -/ diff --git a/Mathlib/CategoryTheory/Functor/ReflectsIso/Jointly.lean b/Mathlib/CategoryTheory/Functor/ReflectsIso/Jointly.lean index 7bff77c9a45407..06cef52b9c490a 100644 --- a/Mathlib/CategoryTheory/Functor/ReflectsIso/Jointly.lean +++ b/Mathlib/CategoryTheory/Functor/ReflectsIso/Jointly.lean @@ -50,6 +50,7 @@ structure JointlyFaithful (F : ∀ i, C ⥤ D i) : Prop where variable {F : ∀ i, C ⥤ D i} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma JointlyFaithful.of_jointly_reflects_isIso_of_mono [HasEqualizers C] [∀ i, PreservesLimitsOfShape WalkingParallelPair (F i)] diff --git a/Mathlib/CategoryTheory/Functor/ReflectsIso/Limits.lean b/Mathlib/CategoryTheory/Functor/ReflectsIso/Limits.lean index ecabd9af3b0829..5766047aca3247 100644 --- a/Mathlib/CategoryTheory/Functor/ReflectsIso/Limits.lean +++ b/Mathlib/CategoryTheory/Functor/ReflectsIso/Limits.lean @@ -26,6 +26,7 @@ variable {C : Type*} [Category C] {I : Type*} {D : I → Type*} [∀ i, Category {F : ∀ i, C ⥤ D i} (hF : JointlyReflectIsomorphisms F) {J : Type*} [Category* J] {G : J ⥤ C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `Fᵢ : C ⥤ Dᵢ` is a conservative family of functors which also preserve the (existing) limit of a functor `G : J ⥤ C`, then a cone @@ -51,6 +52,7 @@ noncomputable def jointlyReflectsLimit rw [← this] infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `Fᵢ : C ⥤ Dᵢ` is a conservative family of functors which also preserve the (existing) colimit of a functor `G : J ⥤ C`, then a cocone diff --git a/Mathlib/CategoryTheory/Functor/RegularEpi.lean b/Mathlib/CategoryTheory/Functor/RegularEpi.lean index ee15857c11b944..96ebe576a8c3af 100644 --- a/Mathlib/CategoryTheory/Functor/RegularEpi.lean +++ b/Mathlib/CategoryTheory/Functor/RegularEpi.lean @@ -27,6 +27,7 @@ open Limits variable {C D : Type*} [Category C] [Category D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [∀ {F G : D} (f : F ⟶ G) [Epi f], HasPullback f f] [HasPushouts D] [IsRegularEpiCategory D] : diff --git a/Mathlib/CategoryTheory/Functor/Trifunctor.lean b/Mathlib/CategoryTheory/Functor/Trifunctor.lean index 1409aea4f3d58d..d2fe02db515ba6 100644 --- a/Mathlib/CategoryTheory/Functor/Trifunctor.lean +++ b/Mathlib/CategoryTheory/Functor/Trifunctor.lean @@ -54,6 +54,7 @@ def bifunctorComp₁₂ (F₁₂ : C₁ ⥤ C₂ ⥤ C₁₂) (G : C₁₂ ⥤ C simp only [← NatTrans.comp_app, ← G.map_comp, NatTrans.naturality] } set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `bifunctorComp₁₂Functor`. -/ @[simps] def bifunctorComp₁₂FunctorObj (F₁₂ : C₁ ⥤ C₂ ⥤ C₁₂) : @@ -73,6 +74,7 @@ def bifunctorComp₁₂FunctorObj (F₁₂ : C₁ ⥤ C₂ ⥤ C₁₂) : simp only [← NatTrans.comp_app, NatTrans.naturality] } set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `bifunctorComp₁₂Functor`. -/ @[simps] def bifunctorComp₁₂FunctorMap {F₁₂ F₁₂' : C₁ ⥤ C₂ ⥤ C₁₂} (φ : F₁₂ ⟶ F₁₂') : @@ -130,6 +132,7 @@ def bifunctorComp₂₃ (F : C₁ ⥤ C₂₃ ⥤ C₄) (G₂₃ : C₂ ⥤ C₃ { app := fun X₃ => (F.map φ).app ((G₂₃.obj X₂).obj X₃) } } set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `bifunctorComp₂₃Functor`. -/ @[simps] def bifunctorComp₂₃FunctorObj (F : C₁ ⥤ C₂₃ ⥤ C₄) : @@ -148,6 +151,7 @@ def bifunctorComp₂₃FunctorObj (F : C₁ ⥤ C₂₃ ⥤ C₄) : simp only [← NatTrans.comp_app, ← Functor.map_comp, NatTrans.naturality] } } set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `bifunctorComp₂₃Functor`. -/ @[simps] def bifunctorComp₂₃FunctorMap {F F' : C₁ ⥤ C₂₃ ⥤ C₄} (φ : F ⟶ F') : diff --git a/Mathlib/CategoryTheory/Galois/Basic.lean b/Mathlib/CategoryTheory/Galois/Basic.lean index e235544c384ddd..44046684b7ae57 100644 --- a/Mathlib/CategoryTheory/Galois/Basic.lean +++ b/Mathlib/CategoryTheory/Galois/Basic.lean @@ -62,6 +62,43 @@ The only difference between `[PreGaloisCategory C] (F : C ⥤ FintypeCat) [Fiber `[GaloisCategory C]` is that the former fixes one fiber functor `F`. -/ +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Aut + Cone.functoriality + Cone.postcompose + Cone.postcomposeEquivalence + Discrete.rec + Eq.mpr + Eq.rec + Equivalence.symm + InducedCategory + NatIso.ofComponents + NatTrans.vcomp + ObjectProperty.FullSubcategory.category._aux_1 + ObjectProperty.ι + Option.rec + PullbackCone.mk + TypeCat.Fun.comp + WalkingPair.rec + WalkingParallelPair.rec + WalkingParallelPairHom.rec + WidePullbackShape.Hom.rec + WidePullbackShape.wideCospan + diagramIsoCospan + diagramIsoPair + diagramIsoParallelPair + eqToHom + eqToIso + getLimitCone + inducedFunctor + limit.cone + mapCone + mapPairIso + pair + parallelPair + parallelPair.parallelPairHom + /-- Definition of a (Pre)Galois category. Lenstra, Def 3.1, (G1)-(G3) -/ class PreGaloisCategory (C : Type u₁) [Category.{u₂, u₁} C] : Prop where /-- `C` has a terminal object (G1). -/ @@ -255,7 +292,7 @@ noncomputable def fiberEqualizerEquiv {X Y : C} (f g : X ⟶ Y) : lemma fiberEqualizerEquiv_symm_ι_apply {X Y : C} {f g : X ⟶ Y} (x : F.obj X) (h : F.map f x = F.map g x) : F.map (equalizer.ι f g) ((fiberEqualizerEquiv F f g).symm ⟨x, h⟩) = x := by - simp only [fiberEqualizerEquiv, Functor.comp_map, Iso.toEquiv_comp] + simp only [fiberEqualizerEquiv, Functor.comp_map] change ((Types.equalizerIso _ _).inv ≫ _ ≫ (F ⋙ FintypeCat.incl).map (equalizer.ι f g)) _ = _ erw [PreservesEqualizer.iso_inv_ι, Types.equalizerIso_inv_comp_ι] rfl @@ -270,8 +307,7 @@ noncomputable def fiberPullbackEquiv {X A B : C} (f : A ⟶ X) (g : B ⟶ X) : lemma fiberPullbackEquiv_symm_fst_apply {X A B : C} {f : A ⟶ X} {g : B ⟶ X} (a : F.obj A) (b : F.obj B) (h : F.map f a = F.map g b) : F.map (pullback.fst f g) ((fiberPullbackEquiv F f g).symm ⟨(a, b), h⟩) = a := by - simp only [fiberPullbackEquiv, Functor.comp_map, Iso.toEquiv_comp, - Equiv.symm_trans_apply, Iso.toEquiv_symm_fun] + simp only [fiberPullbackEquiv, Functor.comp_map, Iso.toEquiv_symm_fun] change ((Types.pullbackIsoPullback _ _).inv ≫ _ ≫ (F ⋙ FintypeCat.incl).map (pullback.fst f g)) _ = _ erw [PreservesPullback.iso_inv_fst, Types.pullbackIsoPullback_inv_fst] @@ -281,8 +317,7 @@ lemma fiberPullbackEquiv_symm_fst_apply {X A B : C} {f : A ⟶ X} {g : B ⟶ X} lemma fiberPullbackEquiv_symm_snd_apply {X A B : C} {f : A ⟶ X} {g : B ⟶ X} (a : F.obj A) (b : F.obj B) (h : F.map f a = F.map g b) : F.map (pullback.snd f g) ((fiberPullbackEquiv F f g).symm ⟨(a, b), h⟩) = b := by - simp only [fiberPullbackEquiv, Functor.comp_map, Iso.toEquiv_comp, - Equiv.symm_trans_apply, Iso.toEquiv_symm_fun] + simp only [fiberPullbackEquiv, Functor.comp_map, Iso.toEquiv_symm_fun] change ((Types.pullbackIsoPullback _ _).inv ≫ _ ≫ (F ⋙ FintypeCat.incl).map (pullback.snd f g)) _ = _ erw [PreservesPullback.iso_inv_snd, Types.pullbackIsoPullback_inv_snd] @@ -297,7 +332,7 @@ noncomputable def fiberBinaryProductEquiv (X Y : C) : @[simp] lemma fiberBinaryProductEquiv_symm_fst_apply {X Y : C} (x : F.obj X) (y : F.obj Y) : F.map prod.fst ((fiberBinaryProductEquiv F X Y).symm (x, y)) = x := by - simp only [fiberBinaryProductEquiv, Iso.toEquiv_comp] + simp only [fiberBinaryProductEquiv] change ((Types.binaryProductIso _ _).inv ≫ _ ≫ (F ⋙ FintypeCat.incl).map prod.fst) _ = _ erw [PreservesLimitPair.iso_inv_fst, Types.binaryProductIso_inv_comp_fst] rfl @@ -305,7 +340,7 @@ lemma fiberBinaryProductEquiv_symm_fst_apply {X Y : C} (x : F.obj X) (y : F.obj @[simp] lemma fiberBinaryProductEquiv_symm_snd_apply {X Y : C} (x : F.obj X) (y : F.obj Y) : F.map prod.snd ((fiberBinaryProductEquiv F X Y).symm (x, y)) = y := by - simp only [fiberBinaryProductEquiv, Iso.toEquiv_comp] + simp only [fiberBinaryProductEquiv] change ((Types.binaryProductIso _ _).inv ≫ _ ≫ (F ⋙ FintypeCat.incl).map prod.snd) _ = _ erw [PreservesLimitPair.iso_inv_snd, Types.binaryProductIso_inv_comp_snd] rfl diff --git a/Mathlib/CategoryTheory/Galois/Decomposition.lean b/Mathlib/CategoryTheory/Galois/Decomposition.lean index aec4fac9dde38b..b0c651b4760d35 100644 --- a/Mathlib/CategoryTheory/Galois/Decomposition.lean +++ b/Mathlib/CategoryTheory/Galois/Decomposition.lean @@ -58,6 +58,7 @@ non-trivial subobjects which have strictly smaller fiber and conclude by the ind -/ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The trivial case if `X` is connected. -/ private lemma has_decomp_connected_components_aux_conn (X : C) [IsConnected X] : @@ -243,9 +244,11 @@ set_option backward.privateInPublic true in private noncomputable def selfProdPermIncl (b : F.obj A) : A ⟶ selfProd F X := u ≫ (Pi.whiskerEquiv (fiberPerm h b) (fun _ => Iso.refl X)).inv +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in private instance [Mono u] (b : F.obj A) : Mono (selfProdPermIncl h b) := mono_comp _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in /-- Key technical lemma: the twisted inclusion `selfProdPermIncl h b` maps `a` to `F.map u b`. -/ private lemma selfProdTermIncl_fib_eq (b : F.obj A) : diff --git a/Mathlib/CategoryTheory/Galois/Equivalence.lean b/Mathlib/CategoryTheory/Galois/Equivalence.lean index 67a3796c5440fb..e60b2123ab43d0 100644 --- a/Mathlib/CategoryTheory/Galois/Equivalence.lean +++ b/Mathlib/CategoryTheory/Galois/Equivalence.lean @@ -40,9 +40,11 @@ variable (F) in def functorToContAction : C ⥤ ContAction FintypeCat (Aut F) := ObjectProperty.lift _ (functorToAction F) (fun X ↦ continuousSMul_aut_fiber F X) +set_option backward.isDefEq.respectTransparency.types false in instance : (functorToContAction F).Faithful := inferInstanceAs <| (ObjectProperty.lift _ _ _).Faithful +set_option backward.isDefEq.respectTransparency.types false in instance : (functorToContAction F).Full := inferInstanceAs <| (ObjectProperty.lift _ _ _).Full diff --git a/Mathlib/CategoryTheory/Galois/GaloisObjects.lean b/Mathlib/CategoryTheory/Galois/GaloisObjects.lean index d6bddab93e3d71..c49aac43eec4f2 100644 --- a/Mathlib/CategoryTheory/Galois/GaloisObjects.lean +++ b/Mathlib/CategoryTheory/Galois/GaloisObjects.lean @@ -195,6 +195,7 @@ lemma autMap_surjective_of_isGalois {A B : C} [IsGalois A] [IsGalois B] (f : A apply evaluation_aut_injective_of_isConnected F B (F.map f a) simp [hτ, ha'] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma autMap_apply_mul {A B : C} [IsConnected A] [IsGalois B] (f : A ⟶ B) (σ τ : Aut A) : autMap f (σ * τ) = autMap f σ * autMap f τ := by diff --git a/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean b/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean index 5cdcfb7e782300..a87f14b3b606a3 100644 --- a/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean +++ b/Mathlib/CategoryTheory/Galois/IsFundamentalgroup.lean @@ -132,6 +132,7 @@ lemma toAut_continuous [TopologicalSpace G] [IsTopologicalGroup G] variable {G} +set_option backward.isDefEq.respectTransparency.types false in lemma action_ext_of_isGalois {t : F ⟶ F} {X : C} [IsGalois X] {g : G} (x : F.obj X) (hg : g • x = t.app X x) (y : F.obj X) : g • y = t.app X y := by obtain ⟨φ, (rfl : F.map φ.hom y = x)⟩ := MulAction.exists_smul_eq (Aut X) y x diff --git a/Mathlib/CategoryTheory/Galois/Prorepresentability.lean b/Mathlib/CategoryTheory/Galois/Prorepresentability.lean index d33c328d858baa..6c151231563ed9 100644 --- a/Mathlib/CategoryTheory/Galois/Prorepresentability.lean +++ b/Mathlib/CategoryTheory/Galois/Prorepresentability.lean @@ -354,6 +354,7 @@ lemma endEquivAutGalois_π (f : End F) (A : PointedGaloisObject F) : simp only [endEquivSectionsFibers_π] erw [evaluationEquivOfIsGalois_symm_fiber] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem endEquivAutGalois_mul (f g : End F) : (endEquivAutGalois F) (g ≫ f) = (endEquivAutGalois F g) * (endEquivAutGalois F f) := by @@ -394,10 +395,11 @@ noncomputable def autMulEquivAutGalois : Aut F ≃* (AutGalois F)ᵐᵒᵖ where MulEquiv.symm_apply_apply] exact Aut.ext rfl right_inv t := by - simp only [MonoidHom.coe_comp, MonoidHom.coe_coe, Function.comp_apply, Aut.toEnd_apply] + simp only [MonoidHom.coe_comp, MonoidHom.coe_coe] exact (MulEquiv.eq_symm_apply (endMulEquivAutGalois F)).mp rfl map_mul' := by simp [map_mul] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma autMulEquivAutGalois_π (f : Aut F) (A : C) [IsGalois A] (a : F.obj A) : F.map (AutGalois.π F { obj := A, pt := a } (autMulEquivAutGalois F f).unop).hom a = @@ -406,6 +408,7 @@ lemma autMulEquivAutGalois_π (f : Aut F) (A : C) [IsGalois A] (a : F.obj A) : rw [endEquivAutGalois_π] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma autMulEquivAutGalois_symm_app (x : AutGalois F) (A : C) [IsGalois A] (a : F.obj A) : ((autMulEquivAutGalois F).symm ⟨x⟩).hom.app A a = @@ -447,6 +450,7 @@ section General variable (F : C ⥤ FintypeCat.{w}) [FiberFunctor F] +set_option backward.isDefEq.respectTransparency.types false in /-- The `Aut F` action on the fiber of a connected object is transitive. -/ instance FiberFunctor.isPretransitive_of_isConnected (X : C) [IsConnected X] : MulAction.IsPretransitive (Aut F) (F.obj X) where diff --git a/Mathlib/CategoryTheory/Galois/Topology.lean b/Mathlib/CategoryTheory/Galois/Topology.lean index b3075869aaa53e..5f0e1123cf1cf3 100644 --- a/Mathlib/CategoryTheory/Galois/Topology.lean +++ b/Mathlib/CategoryTheory/Galois/Topology.lean @@ -47,6 +47,7 @@ def autEmbedding : Aut F →* ∀ X, Aut (F.obj X) := lemma autEmbedding_apply (σ : Aut F) (X : C) : autEmbedding F σ X = σ.app X := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma autEmbedding_injective : Function.Injective (autEmbedding F) := by intro σ τ h ext X x @@ -86,6 +87,7 @@ instance : TopologicalSpace (Aut F) := · use NatIso.ofComponents a (fun {X Y} f ↦ h ⟨X, Y, f⟩) rfl-/ +set_option backward.isDefEq.respectTransparency.types false in /-- The image of `Aut F` in `∀ X, Aut (F.obj X)` are precisely the compatible families of automorphisms. -/ lemma autEmbedding_range : diff --git a/Mathlib/CategoryTheory/Generator/Basic.lean b/Mathlib/CategoryTheory/Generator/Basic.lean index 29ee725fc88105..f56c44135fe91c 100644 --- a/Mathlib/CategoryTheory/Generator/Basic.lean +++ b/Mathlib/CategoryTheory/Generator/Basic.lean @@ -737,6 +737,7 @@ lemma isCoseparator_of_isLimit_fan {β : Type w} {f : β → C} obtain ⟨b⟩ := h classical simpa using huv (hc.lift (Fan.mk _ (Pi.single b g))) =≫ c.proj b +set_option backward.isDefEq.respectTransparency.types false in lemma isCoseparator_iff_of_isLimit_fan {β : Type w} {f : β → C} {c : Fan f} (hc : IsLimit c) : IsCoseparator c.pt ↔ ObjectProperty.IsCoseparating (.ofObj f) := by diff --git a/Mathlib/CategoryTheory/Generator/Presheaf.lean b/Mathlib/CategoryTheory/Generator/Presheaf.lean index d3cde1d92e3c50..e3d84aef069223 100644 --- a/Mathlib/CategoryTheory/Generator/Presheaf.lean +++ b/Mathlib/CategoryTheory/Generator/Presheaf.lean @@ -51,6 +51,7 @@ noncomputable def freeYonedaHomEquiv {X : C} {M : A} {F : Cᵒᵖ ⥤ A} : simpa using (Sigma.ι _ (𝟙 _) ≫= f.naturality φ.op).symm right_inv g := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma freeYonedaHomEquiv_comp {X : C} {M : A} {F G : Cᵒᵖ ⥤ A} diff --git a/Mathlib/CategoryTheory/GlueData.lean b/Mathlib/CategoryTheory/GlueData.lean index 1b3505e7579b55..d18b4505c3aa82 100644 --- a/Mathlib/CategoryTheory/GlueData.lean +++ b/Mathlib/CategoryTheory/GlueData.lean @@ -190,6 +190,7 @@ end theorem types_π_surjective (D : GlueData Type*) : Function.Surjective D.π := (epi_iff_surjective _).mp inferInstance +set_option backward.isDefEq.respectTransparency.types false in theorem types_ι_jointly_surjective (D : GlueData (Type v)) (x : D.glued) : ∃ (i : _) (y : D.U i), D.ι i y = x := by delta CategoryTheory.GlueData.ι @@ -327,6 +328,7 @@ def vPullbackConeIsLimitOfMap (i j : D.J) [ReflectsLimit (cospan (D.ι i) (D.ι rintro (_ | _ | _) all_goals simp [e]; rfl +set_option backward.isDefEq.respectTransparency.types false in /-- If there is a forgetful functor into `Type` that preserves enough (co)limits, then `D.ι` will be jointly surjective. -/ theorem ι_jointly_surjective (F : C ⥤ Type v) [PreservesColimit D.diagram.multispan F] diff --git a/Mathlib/CategoryTheory/GradedObject.lean b/Mathlib/CategoryTheory/GradedObject.lean index 03ef00b947be24..097e1ec4ae9fc9 100644 --- a/Mathlib/CategoryTheory/GradedObject.lean +++ b/Mathlib/CategoryTheory/GradedObject.lean @@ -40,6 +40,7 @@ open Category Limits universe w v u /-- A type synonym for `β → C`, used for `β`-graded objects in a category `C`. -/ +@[implicit_reducible] def GradedObject (β : Type w) (C : Type u) : Type max w u := β → C @@ -79,6 +80,7 @@ section variable {β : Type*} (X Y : GradedObject β C) +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for isomorphisms in `GradedObject` -/ @[simps] def isoMk (e : ∀ i, X i ≅ Y i) : X ≅ Y where @@ -88,6 +90,7 @@ def isoMk (e : ∀ i, X i ≅ Y i) : X ≅ Y where variable {X Y} -- this lemma is not an instance as it may create a loop with `isIso_apply_of_isIso` +set_option backward.isDefEq.respectTransparency.types false in lemma isIso_of_isIso_apply (f : X ⟶ Y) [hf : ∀ i, IsIso (f i)] : IsIso f := by change IsIso (isoMk X Y (fun i => asIso (f i))).hom @@ -106,24 +109,28 @@ namespace Iso variable {C D E J : Type*} [Category* C] [Category* D] [Category* E] {X Y : GradedObject J C} +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma hom_inv_id_eval (e : X ≅ Y) (j : J) : e.hom j ≫ e.inv j = 𝟙 _ := by rw [← GradedObject.categoryOfGradedObjects_comp, e.hom_inv_id, GradedObject.categoryOfGradedObjects_id] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma inv_hom_id_eval (e : X ≅ Y) (j : J) : e.inv j ≫ e.hom j = 𝟙 _ := by rw [← GradedObject.categoryOfGradedObjects_comp, e.inv_hom_id, GradedObject.categoryOfGradedObjects_id] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma map_hom_inv_id_eval (e : X ≅ Y) (F : C ⥤ D) (j : J) : F.map (e.hom j) ≫ F.map (e.inv j) = 𝟙 _ := by rw [← F.map_comp, ← GradedObject.categoryOfGradedObjects_comp, e.hom_inv_id, GradedObject.categoryOfGradedObjects_id, Functor.map_id] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma map_inv_hom_id_eval (e : X ≅ Y) (F : C ⥤ D) (j : J) : F.map (e.inv j) ≫ F.map (e.hom j) = 𝟙 _ := by @@ -162,6 +169,7 @@ theorem eqToHom_proj {I : Type*} {x x' : GradedObject I C} (h : x = x') (i : I) subst h rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The natural isomorphism comparing between pulling back along two propositionally equal functions. -/ @@ -173,6 +181,7 @@ def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap theorem comapEq_symm {β γ : Type w} {f g : β → γ} (h : f = g) : comapEq C h.symm = (comapEq C h).symm := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in theorem comapEq_trans {β γ : Type w} {f g h : β → γ} (k : f = g) (l : g = h) : comapEq C (k.trans l) = comapEq C k ≪≫ comapEq C l := by cat_disch @@ -196,6 +205,7 @@ def comapEquiv {β γ : Type w} (e : β ≃ γ) : GradedObject β C ≌ GradedOb end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance hasShift {β : Type*} [AddCommGroup β] (s : β) : HasShift (GradedObjectWithShift s C) ℤ := hasShiftMk _ _ @@ -204,11 +214,13 @@ instance hasShift {β : Type*} [AddCommGroup β] (s : β) : HasShift (GradedObje add := fun m n => comapEq C (by ext; dsimp; rw [add_comm m n, add_zsmul, add_assoc]) ≪≫ (Pi.comapComp _ _ _).symm } +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem shiftFunctor_obj_apply {β : Type*} [AddCommGroup β] (s : β) (X : β → C) (t : β) (n : ℤ) : (shiftFunctor (GradedObjectWithShift s C) n).obj X t = X (t + n • s) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem shiftFunctor_map_apply {β : Type*} [AddCommGroup β] (s : β) {X Y : GradedObjectWithShift s C} (f : X ⟶ Y) (t : β) (n : ℤ) : @@ -223,6 +235,7 @@ theorem zero_apply [HasZeroMorphisms C] (β : Type w) (X Y : GradedObject β C) (0 : X ⟶ Y) b = 0 := rfl +set_option backward.isDefEq.respectTransparency.types false in instance hasZeroMorphisms [HasZeroMorphisms C] (β : Type w) : HasZeroMorphisms.{max w v} (GradedObject β C) where @@ -250,6 +263,7 @@ variable [HasCoproducts.{0} C] section +set_option backward.isDefEq.respectTransparency.types false in /-- The total object of a graded object is the coproduct of the graded components. -/ noncomputable def total : GradedObject β C ⥤ C where @@ -260,6 +274,7 @@ end variable [HasZeroMorphisms C] +set_option backward.isDefEq.respectTransparency.types false in /-- The `total` functor taking a graded object to the coproduct of its graded components is faithful. To prove this, we need to know that the coprojections into the coproduct are monomorphisms, @@ -396,14 +411,17 @@ lemma congr_mapMap (φ₁ φ₂ : X ⟶ Y) (h : φ₁ = φ₂) : mapMap φ₁ p variable (X) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapMap_id : mapMap (𝟙 X) p = 𝟙 _ := by cat_disch variable {X Z} +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc] lemma mapMap_comp [Z.HasMap p] : mapMap (φ ≫ ψ) p = mapMap φ p ≫ mapMap ψ p := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism of `J`-graded objects `X.mapObj p ≅ Y.mapObj p` induced by an isomorphism `X ≅ Y` of graded objects and a map `p : I → J`. -/ @[simps] @@ -442,6 +460,7 @@ def cofanMapObjComp : X.CofanMapObjFun r k := (c (p i) (by rw [hpqr, hi])).inj ⟨i, rfl⟩ ≫ c'.inj (⟨p i, by rw [Set.mem_preimage, Set.mem_singleton_iff, hpqr, hi]⟩)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given maps `p : I → J`, `q : J → K` and `r : I → K` such that `q.comp p = r`, `X : GradedObject I C`, `k : K`, the cofan constructed by `cofanMapObjComp` is a colimit. diff --git a/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean b/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean index bf8bdd713a6a2a..dbb3693887f67c 100644 --- a/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean +++ b/Mathlib/CategoryTheory/GradedObject/Bifunctor.lean @@ -32,15 +32,18 @@ variable {C₁ C₂ C₃ : Type*} [Category* C₁] [Category* C₂] [Category* C namespace GradedObject +set_option backward.isDefEq.respectTransparency.types false in /-- Given a bifunctor `F : C₁ ⥤ C₂ ⥤ C₃` and types `I` and `J`, this is the obvious functor `GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject (I × J) C₃`. -/ @[simps] def mapBifunctor (I J : Type*) : GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject (I × J) C₃ where obj X := + set_option backward.isDefEq.respectTransparency.types false in { obj := fun Y ij => (F.obj (X ij.1)).obj (Y ij.2) map := fun φ ij => (F.obj (X ij.1)).map (φ ij.2) } map φ := + set_option backward.isDefEq.respectTransparency.types false in { app := fun Y ij => (F.map (φ ij.1)).app (Y ij.2) } section @@ -119,6 +122,7 @@ variable {X₁ X₂ : GradedObject I C₁} {Y₁ Y₂ : GradedObject J C₂} [HasMap (((mapBifunctor F I J).obj X₁).obj Y₁) p] [HasMap (((mapBifunctor F I J).obj X₂).obj Y₂) p] +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism `mapBifunctorMapObj F p X₁ Y₁ ≅ mapBifunctorMapObj F p X₂ Y₂` induced by isomorphisms `X₁ ≅ X₂` and `Y₁ ≅ Y₂`. -/ @[simps] diff --git a/Mathlib/CategoryTheory/GradedObject/Braiding.lean b/Mathlib/CategoryTheory/GradedObject/Braiding.lean index b3e8f4b487f204..890134c479fbb7 100644 --- a/Mathlib/CategoryTheory/GradedObject/Braiding.lean +++ b/Mathlib/CategoryTheory/GradedObject/Braiding.lean @@ -38,6 +38,7 @@ section Braided variable [BraidedCategory C] +set_option backward.isDefEq.respectTransparency.types false in /-- The braiding `tensorObj X Y ≅ tensorObj Y X` when `X` and `Y` are graded objects indexed by a commutative additive monoid. -/ noncomputable def braiding [HasTensor X Y] [HasTensor Y X] : tensorObj X Y ≅ tensorObj Y X where @@ -46,6 +47,7 @@ noncomputable def braiding [HasTensor X Y] [HasTensor Y X] : tensorObj X Y ≅ t inv k := tensorObjDesc (fun i j hij => (β_ _ _).inv ≫ ιTensorObj X Y j i k (by simpa only [add_comm j i] using hij)) +set_option backward.isDefEq.respectTransparency.types false in variable {Y Z} in lemma braiding_naturality_right [HasTensor X Y] [HasTensor Y X] [HasTensor X Z] [HasTensor Z X] (f : Y ⟶ Z) : @@ -53,6 +55,7 @@ lemma braiding_naturality_right [HasTensor X Y] [HasTensor Y X] [HasTensor X Z] dsimp [braiding] cat_disch +set_option backward.isDefEq.respectTransparency.types false in variable {X Y} in lemma braiding_naturality_left [HasTensor Y Z] [HasTensor Z Y] [HasTensor X Z] [HasTensor Z X] (f : X ⟶ Y) : @@ -60,6 +63,7 @@ lemma braiding_naturality_left [HasTensor Y Z] [HasTensor Z Y] [HasTensor X Z] [ dsimp [braiding] cat_disch +set_option backward.isDefEq.respectTransparency.types false in lemma hexagon_forward [HasTensor X Y] [HasTensor Y X] [HasTensor Y Z] [HasTensor Z X] [HasTensor X Z] [HasTensor (tensorObj X Y) Z] [HasTensor X (tensorObj Y Z)] @@ -98,6 +102,7 @@ lemma hexagon_forward [HasTensor X Y] [HasTensor Y X] [HasTensor Y Z] ← ιTensorObj₃_eq Y Z X i₂ i₃ i₁ k (by rw [add_comm _ i₁, ← add_assoc, h]) (i₁ + i₃) (add_comm _ _)] +set_option backward.isDefEq.respectTransparency.types false in lemma hexagon_reverse [HasTensor X Y] [HasTensor Y Z] [HasTensor Z X] [HasTensor Z Y] [HasTensor X Z] [HasTensor (tensorObj X Y) Z] [HasTensor X (tensorObj Y Z)] @@ -136,6 +141,7 @@ lemma hexagon_reverse [HasTensor X Y] [HasTensor Y Z] [HasTensor Z X] end Braided +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma symmetry [SymmetricCategory C] [HasTensor X Y] [HasTensor Y X] : (braiding X Y).hom ≫ (braiding Y X).hom = 𝟙 _ := by diff --git a/Mathlib/CategoryTheory/GradedObject/Monoidal.lean b/Mathlib/CategoryTheory/GradedObject/Monoidal.lean index f76ec435b1c719..c2054c9663457f 100644 --- a/Mathlib/CategoryTheory/GradedObject/Monoidal.lean +++ b/Mathlib/CategoryTheory/GradedObject/Monoidal.lean @@ -123,6 +123,7 @@ lemma id_tensorHom_id (X Y : GradedObject I C) [HasTensor X Y] : simp only [Functor.map_id, NatTrans.id_app, comp_id, mapMap_id] rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma tensorHom_comp_tensorHom {X₁ X₂ X₃ Y₁ Y₂ Y₃ : GradedObject I C} (f₁ : X₁ ⟶ X₂) (f₂ : X₂ ⟶ X₃) (g₁ : Y₁ ⟶ Y₂) (g₂ : Y₂ ⟶ Y₃) [HasTensor X₁ Y₁] [HasTensor X₂ Y₂] [HasTensor X₃ Y₃] : @@ -307,6 +308,7 @@ lemma ιTensorObj₃_associator_inv variable {X₁ X₂ X₃} +set_option backward.isDefEq.respectTransparency.types false in variable [HasTensor Y₁ Y₂] [HasTensor (tensorObj Y₁ Y₂) Y₃] [HasTensor Y₂ Y₃] [HasTensor Y₁ (tensorObj Y₂ Y₃)] in lemma associator_naturality (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃) @@ -415,6 +417,7 @@ variable (X₁ X₂ X₃ X₄ : GradedObject I C) [HasGoodTensorTensor₂₃ X₁ X₂ (tensorObj X₃ X₄)] [HasTensor₄ObjExt X₁ X₂ X₃ X₄] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma pentagon_inv : tensorHom (𝟙 X₁) (associator X₂ X₃ X₄).inv ≫ (associator X₁ (tensorObj X₂ X₃) X₄).inv ≫ @@ -606,6 +609,7 @@ instance (n : ℕ) : Finite ((fun (i : ℕ × ℕ) => i.1 + i.2) ⁻¹' {n}) := rintro ⟨⟨_, _⟩, _⟩ ⟨⟨_, _⟩, _⟩ h simpa using h +set_option backward.isDefEq.respectTransparency.types false in instance (n : ℕ) : Finite ({ i : (ℕ × ℕ × ℕ) | i.1 + i.2.1 + i.2.2 = n }) := by refine Finite.of_injective (fun ⟨⟨i₁, i₂, i₃⟩, (hi : i₁ + i₂ + i₃ = n)⟩ => (⟨⟨i₁, by lia⟩, ⟨i₂, by lia⟩, ⟨i₃, by lia⟩⟩ : diff --git a/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean b/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean index 8caa9cdb3add5a..0f62907d31a21f 100644 --- a/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean +++ b/Mathlib/CategoryTheory/GradedObject/Trifunctor.lean @@ -40,6 +40,7 @@ section variable (F F' : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄) +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `mapTrifunctor`. -/ @[simps] def mapTrifunctorObj {I₁ : Type*} (X₁ : GradedObject I₁ C₁) (I₂ I₃ : Type*) : @@ -50,6 +51,7 @@ def mapTrifunctorObj {I₁ : Type*} (X₁ : GradedObject I₁ C₁) (I₂ I₃ : map {X₂ Y₂} φ := { app := fun X₃ x => ((F.obj (X₁ x.1)).map (φ x.2.1)).app (X₃ x.2.2) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a trifunctor `F : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄` and types `I₁`, `I₂`, `I₃`, this is the obvious functor @@ -75,6 +77,7 @@ section variable {F F' : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural transformation `mapTrifunctor F I₁ I₂ I₃ ⟶ mapTrifunctor F' I₁ I₂ I₃` induced by a natural transformation `F ⟶ F'` of trifunctors. -/ @@ -93,6 +96,7 @@ def mapTrifunctorMapNatTrans (α : F ⟶ F') (I₁ I₂ I₃ : Type*) : dsimp simp only [← NatTrans.comp_app, NatTrans.naturality] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism `mapTrifunctor F I₁ I₂ I₃ ≅ mapTrifunctor F' I₁ I₂ I₃` induced by a natural isomorphism `F ≅ F'` of trifunctors. -/ @@ -117,6 +121,7 @@ section variable (F : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄) variable {I₁ I₂ I₃ J : Type*} (p : I₁ × I₂ × I₃ → J) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a trifunctor `F : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₃`, graded objects `X₁ : GradedObject I₁ C₁`, `X₂ : GradedObject I₂ C₂`, `X₃ : GradedObject I₃ C₃`, and a map `p : I₁ × I₂ × I₃ → J`, this is the `J`-graded object sending `j` to the coproduct of @@ -127,6 +132,7 @@ noncomputable def mapTrifunctorMapObj (X₁ : GradedObject I₁ C₁) (X₂ : Gr GradedObject J C₄ := ((((mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃).mapObj p +set_option backward.isDefEq.respectTransparency.types false in /-- The obvious inclusion `((F.obj (X₁ i₁)).obj (X₂ i₂)).obj (X₃ i₃) ⟶ mapTrifunctorMapObj F p X₁ X₂ X₃ j` when `p ⟨i₁, i₂, i₃⟩ = j`. -/ @@ -136,6 +142,7 @@ noncomputable def ιMapTrifunctorMapObj (X₁ : GradedObject I₁ C₁) (X₂ : ((F.obj (X₁ i₁)).obj (X₂ i₂)).obj (X₃ i₃) ⟶ mapTrifunctorMapObj F p X₁ X₂ X₃ j := ((((mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃).ιMapObj p ⟨i₁, i₂, i₃⟩ j h +set_option backward.isDefEq.respectTransparency.types false in /-- The maps `mapTrifunctorMapObj F p X₁ X₂ X₃ ⟶ mapTrifunctorMapObj F p Y₁ Y₂ Y₃` which express the functoriality of `mapTrifunctorMapObj`, see `mapTrifunctorMap` -/ noncomputable def mapTrifunctorMapMap {X₁ Y₁ : GradedObject I₁ C₁} (f₁ : X₁ ⟶ Y₁) @@ -183,6 +190,7 @@ instance (X₁ : GradedObject I₁ C₁) (X₂ : GradedObject I₂ C₂) (X₃ : [h : HasMap ((((mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃) p] : HasMap (((mapTrifunctorObj F X₁ I₂ I₃).obj X₂).obj X₃) p := h +set_option backward.isDefEq.respectTransparency.types false in /-- Given a trifunctor `F : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄`, a map `p : I₁ × I₂ × I₃ → J`, and graded objects `X₁ : GradedObject I₁ C₁`, `X₂ : GradedObject I₂ C₂` and `X₃ : GradedObject I₃ C₃`, this is the `J`-graded object sending `j` to the coproduct of @@ -220,6 +228,7 @@ noncomputable def mapTrifunctorMapFunctorObj (X₁ : GradedObject I₁ C₁) NatTrans.id_app, categoryOfGradedObjects_comp, Functor.map_comp, NatTrans.comp_app, id_comp, assoc, ι_mapTrifunctorMapMap_assoc] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a trifunctor `F : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄` and a map `p : I₁ × I₂ × I₃ → J`, this is the functor @@ -376,6 +385,7 @@ noncomputable def mapBifunctorComp₁₂MapObjIso : isoMk _ _ (fun j => (CofanMapObjFun.iso (isColimitCofan₃MapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ j)).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma ι_mapBifunctorComp₁₂MapObjIso_hom (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (j : J) @@ -556,6 +566,7 @@ noncomputable def mapBifunctorComp₂₃MapObjIso : isoMk _ _ (fun j => (CofanMapObjFun.iso (isColimitCofan₃MapBifunctorBifunctor₂₃MapObj F G₂₃ ρ₂₃ X₁ X₂ X₃ j)).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma ι_mapBifunctorComp₂₃MapObjIso_hom (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (j : J) diff --git a/Mathlib/CategoryTheory/GradedObject/Unitor.lean b/Mathlib/CategoryTheory/GradedObject/Unitor.lean index 9806cd65f5b742..f2ba95118e9dba 100644 --- a/Mathlib/CategoryTheory/GradedObject/Unitor.lean +++ b/Mathlib/CategoryTheory/GradedObject/Unitor.lean @@ -65,6 +65,7 @@ noncomputable def mapBifunctorLeftUnitorCofan (hp : ∀ (j : J), p ⟨0, j⟩ = else (mapBifunctorObjSingle₀ObjIsInitial F X Y a ha).to _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp, reassoc] lemma mapBifunctorLeftUnitorCofan_inj (j : J) : @@ -182,6 +183,7 @@ noncomputable def mapBifunctorRightUnitorCofan (hp : ∀ (j : J), p ⟨j, 0⟩ = else (mapBifunctorObjObjSingle₀IsInitial F Y X a ha).to _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp, reassoc] lemma mapBifunctorRightUnitorCofan_inj (j : J) : diff --git a/Mathlib/CategoryTheory/Grothendieck.lean b/Mathlib/CategoryTheory/Grothendieck.lean index 478a3af7012396..326c256b7a1079 100644 --- a/Mathlib/CategoryTheory/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Grothendieck.lean @@ -115,6 +115,7 @@ def comp {X Y Z : Grothendieck F} (f : Hom X Y) (g : Hom Y Z) : Hom X Z where attribute [local simp] eqToHom_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : Category (Grothendieck F) where Hom X Y := Grothendieck.Hom X Y @@ -193,6 +194,7 @@ If `F : C ⥤ Cat` is a functor and `t : c ⟶ d` is a morphism in `C`, then `tr def toTransport (x : Grothendieck F) {c : C} (t : x.base ⟶ c) : x ⟶ x.transport t := ⟨t, 𝟙 _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Construct an isomorphism in a Grothendieck construction from isomorphisms in its base and fiber. @@ -234,6 +236,7 @@ section variable {G : C ⥤ Cat} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The Grothendieck construction is functorial: a natural transformation `α : F ⟶ G` induces a functor `Grothendieck.map : Grothendieck F ⥤ Grothendieck G`. @@ -255,6 +258,7 @@ def map (α : F ⟶ G) : Grothendieck F ⥤ Grothendieck G where simp +set_option backward.isDefEq.respectTransparency.types false in theorem map_obj {α : F ⟶ G} (X : Grothendieck F) : (Grothendieck.map α).obj X = ⟨X.base, (α.app X.base).toFunctor.obj X.fiber⟩ := rfl @@ -265,6 +269,7 @@ theorem map_map {α : F ⟶ G} {X Y : Grothendieck F} {f : X ⟶ Y} : (α.app Y.base).toFunctor.map f.fiber⟩ := by apply Grothendieck.ext _ _ (by simp) (by simp) +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `Grothendieck.map α : Grothendieck F ⥤ Grothendieck G` lies over `C`. -/ theorem functor_comp_forget {α : F ⟶ G} : Grothendieck.map α ⋙ Grothendieck.forget G = Grothendieck.forget F := rfl @@ -279,6 +284,7 @@ theorem map_id_eq : map (𝟙 F) = Functor.id (Grothendieck <| F) := by simp [map_map] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Making the equality of functors into an isomorphism. Note: we should avoid equality of functors if possible, and we should prefer `mapIdIso` to `map_id_eq` whenever we can. -/ def mapIdIso : (map (𝟙 F)).toCatHom ≅ 𝟙 (Cat.of <| Grothendieck <| F) := @@ -298,6 +304,7 @@ theorem map_comp_eq (α : F ⟶ G) (β : G ⟶ H) : comp_obj, Cat.Hom₂.eqToHom_toNatTrans, eqToHom_app, Functor.comp_map, eqToHom_refl, map_comp, eqToHom_map, eqToHom_trans_assoc, Category.comp_id, Category.id_comp] +set_option backward.isDefEq.respectTransparency.types false in /-- Making the equality of functors into an isomorphism. Note: we should avoid equality of functors if possible, and we should prefer `map_comp_iso` to `map_comp_eq` whenever we can. -/ def mapCompIso (α : F ⟶ G) (β : G ⟶ H) : map (α ≫ β) ≅ map α ⋙ map β := eqToIso (map_comp_eq α β) @@ -368,6 +375,7 @@ def mapWhiskerRightAsSmallFunctor (α : F ⟶ G) : end +set_option backward.isDefEq.respectTransparency.types false in /-- The Grothendieck construction as a functor from the functor category `E ⥤ Cat` to the over category `Over E`. -/ def functor {E : Cat.{v, u}} : (E ⥤ Cat.{v, u}) ⥤ Over (T := Cat.{v, u}) E where @@ -436,7 +444,7 @@ variable (F) set_option backward.isDefEq.respectTransparency false in /-- Applying a functor `G : D ⥤ C` to the base of the Grothendieck construction induces a functor `Grothendieck (G ⋙ F) ⥤ Grothendieck F`. -/ -@[simps] +@[simps, implicit_reducible] def pre (G : D ⥤ C) : Grothendieck (G ⋙ F) ⥤ Grothendieck F where obj X := ⟨G.obj X.base, X.fiber⟩ map f := ⟨G.map f.base, f.fiber⟩ @@ -459,16 +467,19 @@ def preNatIso {G H : D ⥤ C} (α : G ≅ H) : (fun X => (transportIso ⟨G.obj X.base, X.fiber⟩ (α.app X.base)).symm) (fun f => by fapply Grothendieck.ext <;> simp) +set_option backward.isDefEq.respectTransparency.types false in /-- Given an equivalence of categories `G`, `preInv _ G` is the (weak) inverse of the `pre _ G.functor`. -/ def preInv (G : D ≌ C) : Grothendieck F ⥤ Grothendieck (G.functor ⋙ F) := map (whiskerRight G.counitInv F) ⋙ Grothendieck.pre (G.functor ⋙ F) G.inverse +set_option backward.isDefEq.respectTransparency.types false in variable {F} in lemma pre_comp_map (G : D ⥤ C) {H : C ⥤ Cat} (α : F ⟶ H) : pre F G ⋙ map α = map (whiskerLeft G α) ⋙ pre H G := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {F} in lemma pre_comp_map_assoc (G : D ⥤ C) {H : C ⥤ Cat} (α : F ⟶ H) {E : Type*} [Category* E] (K : Grothendieck H ⥤ E) : pre F G ⋙ map α ⋙ K = map (whiskerLeft G α) ⋙ pre H G ⋙ K := rfl @@ -477,6 +488,7 @@ variable {E : Type*} [Category* E] in @[simp] lemma pre_comp (G : D ⥤ C) (H : E ⥤ D) : pre F (H ⋙ G) = pre (G ⋙ F) H ⋙ pre F G := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Let `G` be an equivalence of categories. The functor induced via `pre` by `G.functor ⋙ G.inverse` is naturally isomorphic to the functor induced via `map` by a whiskered version of `G`'s inverse @@ -514,6 +526,7 @@ def preEquivalence (G : D ≌ C) : Grothendieck (G.functor ⋙ F) ≌ Grothendie Iso.trans_hom, eqToIso.hom, eqToHom_app, eqToHom_refl, isoWhiskerLeft_hom, NatTrans.comp_app] fapply Grothendieck.ext <;> simp [preNatIso, transportIso] +set_option backward.isDefEq.respectTransparency.types false in variable {F} in /-- Let `F, F' : C ⥤ Cat` be functor, `G : D ≌ C` an equivalence and `α : F ⟶ F'` a natural @@ -538,6 +551,7 @@ section FunctorFrom variable {E : Type*} [Category* E] +set_option backward.isDefEq.respectTransparency.types false in variable (F) in /-- The inclusion of a fiber `F.obj c` of a functor `F : C ⥤ Cat` into its Grothendieck construction. -/ @@ -557,6 +571,7 @@ def ι (c : C) : F.obj c ⥤ Grothendieck F where simp only [eqToHom_comp_iff, Category.assoc, eqToHom_trans_assoc] apply Functor.congr_hom congr($(F.map_id _).toFunctor).symm +set_option backward.isDefEq.respectTransparency.types false in instance faithful_ι (c : C) : (ι F c).Faithful where map_injective f := by injection f with _ f diff --git a/Mathlib/CategoryTheory/Groupoid.lean b/Mathlib/CategoryTheory/Groupoid.lean index 968883bf434261..645d26e17459e1 100644 --- a/Mathlib/CategoryTheory/Groupoid.lean +++ b/Mathlib/CategoryTheory/Groupoid.lean @@ -132,19 +132,19 @@ noncomputable instance {C : Type u} [Groupoid.{v} C] : IsGroupoid C where variable {C : Type u} [Category.{v} C] /-- Promote (noncomputably) an `IsGroupoid` to a `Groupoid` structure. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Groupoid.ofIsGroupoid [IsGroupoid C] : Groupoid.{v} C where inv := fun f => CategoryTheory.inv f /-- A category where every morphism `IsIso` is a groupoid. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Groupoid.ofIsIso (all_is_iso : ∀ {X Y : C} (f : X ⟶ Y), IsIso f) : Groupoid.{v} C where inv := fun f => CategoryTheory.inv f /-- A category with a unique morphism between any two objects is a groupoid -/ -@[implicit_reducible] +@[instance_reducible] def Groupoid.ofHomUnique (all_unique : ∀ {X Y : C}, Unique (X ⟶ Y)) : Groupoid.{v} C where inv _ := all_unique.default @@ -156,7 +156,7 @@ lemma isGroupoid_of_reflects_iso {C D : Type*} [Category* C] [Category* D] all_isIso _ := isIso_of_reflects_iso _ F /-- A category equipped with a fully faithful functor to a groupoid is fully faithful -/ -@[implicit_reducible] +@[instance_reducible] def Groupoid.ofFullyFaithfulToGroupoid {C : Type*} [𝒞 : Category C] {D : Type u} [Groupoid.{v} D] (F : C ⥤ D) (h : F.FullyFaithful) : Groupoid C := { 𝒞 with diff --git a/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean b/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean index 4e1115b66d2287..ac3d3b0965540c 100644 --- a/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean +++ b/Mathlib/CategoryTheory/Groupoid/FreeGroupoid.lean @@ -82,6 +82,7 @@ theorem congr_reverse {X Y : Paths <| Quiver.Symmetrify V} (p q : X ⟶ Y) : Quiver.Path.reverse_comp, Quiver.reverse_reverse, Quiver.Path.reverse_toPath, Quiver.Path.comp_assoc] using this +set_option backward.isDefEq.respectTransparency.types false in open Relation in theorem congr_comp_reverse {X Y : Paths <| Quiver.Symmetrify V} (p : X ⟶ Y) : Quot.mk (@HomRel.CompClosure _ _ redStep _ _) (p ≫ p.reverse) = @@ -158,6 +159,7 @@ theorem lift_spec (φ : V ⥤q V') : of V ⋙q (lift φ).toPrefunctor = φ := by dsimp [lift] rw [Quotient.lift_spec, Paths.lift_spec, Quiver.Symmetrify.lift_spec] +set_option backward.isDefEq.respectTransparency.types false in theorem lift_unique (φ : V ⥤q V') (Φ : Quiver.FreeGroupoid V ⥤ V') (hΦ : of V ⋙q Φ.toPrefunctor = φ) : Φ = lift φ := by apply Quotient.lift_unique diff --git a/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean b/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean index 21aa8897944a83..601d9ef3b8e403 100644 --- a/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean +++ b/Mathlib/CategoryTheory/Groupoid/FreeGroupoidOfCategory.lean @@ -119,6 +119,7 @@ theorem lift_spec (φ : C ⥤ G) : of C ⋙ lift φ = φ := lemma lift_obj_mk {E : Type u₂} [Groupoid.{v₂} E] (φ : C ⥤ E) (X : C) : (lift φ).obj (mk X) = φ.obj X := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma lift_map_homMk {E : Type u₂} [Groupoid.{v₂} E] (φ : C ⥤ E) {X Y : C} (f : X ⟶ Y) : diff --git a/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean b/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean index 33fd840edbc5ca..7f283aeafb4f09 100644 --- a/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean +++ b/Mathlib/CategoryTheory/Groupoid/Subgroupoid.lean @@ -127,7 +127,7 @@ theorem id_mem_of_tgt {c d : C} {f : c ⟶ d} (h : f ∈ S.arrows c d) : 𝟙 d id_mem_of_nonempty_isotropy S d (mem_objs_of_tgt S h) /-- A subgroupoid seen as a quiver on vertex set `C` -/ -@[implicit_reducible] +@[instance_reducible] def asWideQuiver : Quiver C := ⟨fun c d => S.arrows c d⟩ @@ -250,6 +250,7 @@ theorem inclusion_inj_on_objects {S T : Subgroupoid C} (h : S ≤ T) : Function.Injective (inclusion h).obj := fun ⟨s, hs⟩ ⟨t, ht⟩ => by simpa only [inclusion, Subtype.mk_eq_mk] using id +set_option backward.isDefEq.respectTransparency.types false in theorem inclusion_faithful {S T : Subgroupoid C} (h : S ≤ T) (s t : S.objs) : Function.Injective fun f : s ⟶ t => (inclusion h).map f := fun ⟨f, hf⟩ ⟨g, hg⟩ => by -- Porting note: was `...; simpa only [Subtype.mk_eq_mk] using id` diff --git a/Mathlib/CategoryTheory/GuitartExact/Basic.lean b/Mathlib/CategoryTheory/GuitartExact/Basic.lean index 6e12df64c4f545..63177795ecc9f2 100644 --- a/Mathlib/CategoryTheory/GuitartExact/Basic.lean +++ b/Mathlib/CategoryTheory/GuitartExact/Basic.lean @@ -114,6 +114,7 @@ abbrev StructuredArrowRightwards.mk (comm : R.map a ≫ w.app X₁ ≫ B.map b = w.StructuredArrowRightwards g := StructuredArrow.mk (Y := CostructuredArrow.mk b) (CostructuredArrow.homMk a comm) +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for objects in `w.CostructuredArrowDownwards g`. -/ abbrev CostructuredArrowDownwards.mk (comm : R.map a ≫ w.app X₁ ≫ B.map b = g) : w.CostructuredArrowDownwards g := @@ -122,6 +123,7 @@ abbrev CostructuredArrowDownwards.mk (comm : R.map a ≫ w.app X₁ ≫ B.map b variable {w g} +set_option backward.isDefEq.respectTransparency.types false in lemma StructuredArrowRightwards.mk_surjective (f : w.StructuredArrowRightwards g) : ∃ (X₁ : C₁) (a : X₂ ⟶ T.obj X₁) (b : L.obj X₁ ⟶ X₃) @@ -131,6 +133,7 @@ lemma StructuredArrowRightwards.mk_surjective obtain ⟨a, ha, rfl⟩ := CostructuredArrow.homMk_surjective φ exact ⟨X₁, a, b, by simpa using ha, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma CostructuredArrowDownwards.mk_surjective (f : w.CostructuredArrowDownwards g) : ∃ (X₁ : C₁) (a : X₂ ⟶ T.obj X₁) (b : L.obj X₁ ⟶ X₃) @@ -144,6 +147,7 @@ end namespace EquivalenceJ +set_option backward.isDefEq.respectTransparency.types false in /-- Given `w : TwoSquare T L R B` and a morphism `g : R.obj X₂ ⟶ B.obj X₃`, this is the obvious functor `w.StructuredArrowRightwards g ⥤ w.CostructuredArrowDownwards g`. -/ @[simps] @@ -157,6 +161,7 @@ def functor : w.StructuredArrowRightwards g ⥤ w.CostructuredArrowDownwards g w map_id _ := rfl map_comp _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Given `w : TwoSquare T L R B` and a morphism `g : R.obj X₂ ⟶ B.obj X₃`, this is the obvious functor `w.CostructuredArrowDownwards g ⥤ w.StructuredArrowRightwards g`. -/ @[simps] @@ -172,6 +177,7 @@ def inverse : w.CostructuredArrowDownwards g ⥤ w.StructuredArrowRightwards g w end EquivalenceJ +set_option backward.isDefEq.respectTransparency.types false in /-- Given `w : TwoSquare T L R B` and a morphism `g : R.obj X₂ ⟶ B.obj X₃`, this is the obvious equivalence of categories `w.StructuredArrowRightwards g ≌ w.CostructuredArrowDownwards g`. -/ @@ -190,6 +196,7 @@ end section +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `w.CostructuredArrowDownwards g ⥤ w.CostructuredArrowDownwards g'` induced by a morphism `γ` such that `R.map γ ≫ g = g'`. -/ @[simps] @@ -243,6 +250,7 @@ instance [hw : w.GuitartExact] {X₂ : C₂} (g : StructuredArrow (R.obj X₂) B rw [guitartExact_iff_isConnected_downwards] at hw apply hw +set_option backward.isDefEq.respectTransparency.types false in lemma costructuredArrowRightwards_final_iff_of_iso {X₃ X₃' : C₃} (e : X₃ ≅ X₃') : (w.costructuredArrowRightwards X₃).Final ↔ (w.costructuredArrowRightwards X₃').Final := by @@ -260,6 +268,7 @@ instance [hw : w.GuitartExact] (X₃ : C₃) : rw [guitartExact_iff_final] at hw apply hw +set_option backward.isDefEq.respectTransparency.types false in lemma structuredArrowDownwards_initial_iff_of_iso {X₂ X₂' : C₂} (e : X₂ ≅ X₂') : (w.structuredArrowDownwards X₂).Initial ↔ (w.structuredArrowDownwards X₂').Initial := by diff --git a/Mathlib/CategoryTheory/GuitartExact/HorizontalComposition.lean b/Mathlib/CategoryTheory/GuitartExact/HorizontalComposition.lean index a18813f8de3f54..4ae05225baa88e 100644 --- a/Mathlib/CategoryTheory/GuitartExact/HorizontalComposition.lean +++ b/Mathlib/CategoryTheory/GuitartExact/HorizontalComposition.lean @@ -40,6 +40,7 @@ def whiskerHorizontal (α : T' ⟶ T) (β : B ⟶ B') : namespace GuitartExact +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A 2-square stays Guitart exact if we replace the top and bottom functors by isomorphic functors. See also `whiskerHorizontal_iff`. -/ @@ -86,6 +87,7 @@ def hComp' {T₁₂ : C₁ ⥤ C₃} {B₁₂ : D₁ ⥤ D₃} (eT : T₁ ⋙ T namespace GuitartExact +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance hComp [w.GuitartExact] [w'.GuitartExact] : (w ≫ₕ w').GuitartExact := by @@ -100,6 +102,7 @@ instance hComp' {T₁₂ : C₁ ⥤ C₃} {B₁₂ : D₁ ⥤ D₃} (eT : T₁ dsimp only [TwoSquare.hComp'] infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism between `w.costructuredArrowRightwards Y₁ ⋙ w'.costructuredArrowRightwards (B₁.obj Y₁)` and @@ -136,6 +139,7 @@ lemma hComp'_iff_of_essSurj (w.hComp' w' eT eB).GuitartExact ↔ w'.GuitartExact := ⟨fun _ ↦ of_hComp' w w' eT eB, fun _ ↦ inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma hComp_iff_of_equivalences (eT : C₂ ≌ C₃) (eB : D₂ ≌ D₃) (w' : eT.functor ⋙ V₃ ≅ V₂ ⋙ eB.functor) : @@ -146,6 +150,7 @@ lemma hComp_iff_of_equivalences (eT : C₂ ≌ C₃) (eB : D₂ ≌ D₃) ← vComp_iff_of_equivalences _ _ _ w'', this] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma hComp'_iff_of_equivalences (E : C₂ ≌ C₃) (E' : D₂ ≌ D₃) (w' : E.functor ⋙ V₃ ≅ V₂ ⋙ E'.functor) {T₁₂ : C₁ ⥤ C₃} {B₁₂ : D₁ ⥤ D₃} (eT : T₁ ⋙ E.functor ≅ T₁₂) diff --git a/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean b/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean index 6c2f104be25efd..cd303e07e713e6 100644 --- a/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean +++ b/Mathlib/CategoryTheory/GuitartExact/KanExtension.lean @@ -61,7 +61,9 @@ abbrev compTwoSquare (w : TwoSquare T L R B) : L.LeftExtension (T ⋙ F) := (whiskerLeft _ E.hom ≫ (associator _ _ _).inv ≫ whiskerRight w.natTrans _ ≫ (associator _ _ _).hom) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- If `w : TwoSquare T L R B` is a Guitart exact square, and `E` is a left extension of `F` along `R`, then `E` is a pointwise left Kan extension of `F` along `R` at `B.obj X₃` iff `E.compTwoSquare w` is a pointwise left Kan extension diff --git a/Mathlib/CategoryTheory/GuitartExact/Quotient.lean b/Mathlib/CategoryTheory/GuitartExact/Quotient.lean index 3a92213979db7c..e4be0bc0edf69b 100644 --- a/Mathlib/CategoryTheory/GuitartExact/Quotient.lean +++ b/Mathlib/CategoryTheory/GuitartExact/Quotient.lean @@ -85,6 +85,7 @@ lemma quotient_of_nonempty_leftHomotopy (e : T ⋙ R ≅ L ⋙ B) CostructuredArrow.homMk (StructuredArrow.homMk P.i₁) (by simp [Z, Z', dsimp% h.h₁]) Zigzag (Z s₁) A₁ := .of_hom f₁ +set_option backward.isDefEq.respectTransparency.types false in lemma quotient_of_nonempty_rightHomotopy (e : T ⋙ R ≅ L ⋙ B) (he : ∀ ⦃X : C⦄ ⦃Y₀ : C₀⦄ (f₀ f₁ : X ⟶ L.obj Y₀) (_ : B.map f₀ = B.map f₁), ∃ (P : PrepathObject Y₀), T.map P.p₀ = T.map P.p₁ ∧ diff --git a/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean b/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean index 220d795a454a37..6cc7f8a3047a57 100644 --- a/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean +++ b/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean @@ -43,6 +43,7 @@ def whiskerVertical (α : L ⟶ L') (β : R' ⟶ R) : namespace GuitartExact +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A 2-square stays Guitart exact if we replace the left and right functors by isomorphic functors. See also `whiskerVertical_iff`. -/ @@ -90,6 +91,7 @@ variable {H₁ : C₁ ⥤ D₁} {L₁ : C₁ ⥤ C₂} {R₁ : D₁ ⥤ D₂} {H {L₂ : C₂ ⥤ C₃} {R₂ : D₂ ⥤ D₃} {H₃ : C₃ ⥤ D₃} (w' : TwoSquare H₂ L₂ R₂ H₃) +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical isomorphism between `w.structuredArrowDownwards Y₁ ⋙ w'.structuredArrowDownwards (R₁.obj Y₁)` and `(w ≫ᵥ w').structuredArrowDownwards Y₁.` -/ @@ -178,6 +180,7 @@ lemma vComp_iff_of_equivalences (eL : C₂ ≌ C₃) (eR : D₂ ≌ D₃) · intro exact vComp w w'.hom +set_option backward.isDefEq.respectTransparency.types false in lemma vComp'_iff_of_equivalences (E : C₂ ≌ C₃) (E' : D₂ ≌ D₃) (w' : H₂ ⋙ E'.functor ≅ E.functor ⋙ H₃) {L₁₂ : C₁ ⥤ C₃} {R₁₂ : D₁ ⥤ D₃} (eL : L₁ ⋙ E.functor ≅ L₁₂) diff --git a/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean b/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean index 75d3640e2a9a42..9f412f9d244b6c 100644 --- a/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean +++ b/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean @@ -87,6 +87,7 @@ namespace KaroubiFunctorCategoryEmbedding variable {J C} +set_option backward.isDefEq.respectTransparency.types false in /-- On objects, the functor which sends a formal direct factor `P` of a functor `F : J ⥤ C` to the functor `J ⥤ Karoubi C` which sends `(j : J)` to the corresponding direct factor of `F.obj j`. -/ @@ -101,6 +102,7 @@ def obj (P : Karoubi (J ⥤ C)) : J ⥤ Karoubi C where rw [NatTrans.comp_app] at h rw [reassoc_of% h, reassoc_of% h] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Tautological action on maps of the functor `Karoubi (J ⥤ C) ⥤ (J ⥤ Karoubi C)`. -/ @[simps] @@ -138,6 +140,7 @@ instance : (karoubiFunctorCategoryEmbedding J C).Faithful where ext j exact hom_ext_iff.mp (congr_app h j) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The composition of `(J ⥤ C) ⥤ Karoubi (J ⥤ C)` and `Karoubi (J ⥤ C) ⥤ (J ⥤ Karoubi C)` equals the functor `(J ⥤ C) ⥤ (J ⥤ Karoubi C)` given by the composition with diff --git a/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean b/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean index 0a33a4a315ebd3..d3764d876f710f 100644 --- a/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean +++ b/Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean @@ -32,6 +32,7 @@ open Category Karoubi Functor variable {C D E : Type*} [Category* C] [Category* D] [Category* E] +set_option backward.isDefEq.respectTransparency.types false in /-- A natural transformation between functors `Karoubi C ⥤ D` is determined by its value on objects coming from `C`. -/ theorem natTrans_eq {F G : Karoubi C ⥤ D} (φ : F ⟶ G) (P : Karoubi C) : @@ -100,6 +101,7 @@ def functorExtension₁ : (C ⥤ Karoubi D) ⥤ Karoubi C ⥤ Karoubi D where slice_rhs 1 2 => rw [h'] simp only [assoc] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism expressing that functors `Karoubi C ⥤ Karoubi D` obtained using `functorExtension₁` actually extend the original functors `C ⥤ Karoubi D`. -/ @@ -155,6 +157,7 @@ def KaroubiUniversal₁.counitIso : attribute [simps!] KaroubiUniversal₁.counitIso +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories `(C ⥤ Karoubi D) ≌ (Karoubi C ⥤ Karoubi D)`. -/ @[simps] @@ -168,6 +171,7 @@ def karoubiUniversal₁ : C ⥤ Karoubi D ≌ Karoubi C ⥤ Karoubi D where dsimp rw [comp_p, ← comp_f, ← F.map_comp, P.idem] +set_option backward.isDefEq.respectTransparency.types false in /-- Compatibility isomorphisms of `functorExtension₁` with respect to the composition of functors. -/ def functorExtension₁Comp (F : C ⥤ Karoubi D) (G : D ⥤ Karoubi E) : @@ -175,11 +179,13 @@ def functorExtension₁Comp (F : C ⥤ Karoubi D) (G : D ⥤ Karoubi E) : (functorExtension₁ C D).obj F ⋙ (functorExtension₁ D E).obj G := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical functor `(C ⥤ D) ⥤ (Karoubi C ⥤ Karoubi D)` -/ @[simps!] def functorExtension₂ : (C ⥤ D) ⥤ Karoubi C ⥤ Karoubi D := (whiskeringRight C D (Karoubi D)).obj (toKaroubi D) ⋙ functorExtension₁ C D +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism expressing that functors `Karoubi C ⥤ Karoubi D` obtained using `functorExtension₂` actually extend the original functors `C ⥤ D`. -/ @@ -243,6 +249,7 @@ instance : ((whiskeringLeft C (Karoubi C) D).obj (toKaroubi C)).IsEquivalence := variable {C D} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem whiskeringLeft_obj_preimage_app {F G : Karoubi C ⥤ D} (τ : toKaroubi _ ⋙ F ⟶ toKaroubi _ ⋙ G) (P : Karoubi C) : diff --git a/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean b/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean index e841b869bd8244..4c8ad12de08c5a 100644 --- a/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean +++ b/Mathlib/CategoryTheory/Idempotents/HomologicalComplex.lean @@ -123,6 +123,7 @@ def inverse : HomologicalComplex (Karoubi C) c ⥤ Karoubi (HomologicalComplex C map f := Inverse.map f set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- The counit isomorphism of the equivalence `Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/ @[simps!] @@ -180,6 +181,7 @@ end KaroubiHomologicalComplexEquivalence variable (C) (c) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/ @[simps] @@ -192,11 +194,13 @@ def karoubiHomologicalComplexEquivalence : variable (α : Type*) [AddRightCancelSemigroup α] [One α] +set_option backward.isDefEq.respectTransparency.types false in /-- The equivalence `Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α`. -/ @[simps!] def karoubiChainComplexEquivalence : Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α := karoubiHomologicalComplexEquivalence C (ComplexShape.down α) +set_option backward.isDefEq.respectTransparency.types false in /-- The equivalence `Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α`. -/ @[simps!] def karoubiCochainComplexEquivalence : diff --git a/Mathlib/CategoryTheory/Idempotents/Karoubi.lean b/Mathlib/CategoryTheory/Idempotents/Karoubi.lean index ccd3388c1f67ac..d15d8a1322996c 100644 --- a/Mathlib/CategoryTheory/Idempotents/Karoubi.lean +++ b/Mathlib/CategoryTheory/Idempotents/Karoubi.lean @@ -135,7 +135,7 @@ end Karoubi /-- The obvious fully faithful functor `toKaroubi` sends an object `X : C` to the obvious formal direct factor of `X` given by `𝟙 X`. -/ -@[simps] +@[simps, implicit_reducible] def toKaroubi : C ⥤ Karoubi C where obj X := ⟨X, 𝟙 X, by rw [comp_id]⟩ map f := ⟨f, by simp only [comp_id, id_comp]⟩ @@ -261,6 +261,7 @@ theorem decompId (P : Karoubi C) : 𝟙 P = decompId_i P ≫ decompId_p P := by ext simp only [comp_f, id_f, P.idem, decompId_i, decompId_p] +set_option backward.isDefEq.respectTransparency.types false in theorem decomp_p (P : Karoubi C) : (toKaroubi C).map P.p = decompId_p P ≫ decompId_i P := by ext simp only [comp_f, decompId_p_f, decompId_i_f, P.idem, toKaroubi_map_f] diff --git a/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean b/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean index d8eba8e94090b2..3e7183ed572ea1 100644 --- a/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean +++ b/Mathlib/CategoryTheory/Idempotents/KaroubiKaroubi.lean @@ -30,28 +30,34 @@ namespace KaroubiKaroubi variable (C : Type*) [Category* C] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma idem_f (P : Karoubi (Karoubi C)) : P.p.f ≫ P.p.f = P.p.f := by simpa only [hom_ext_iff, comp_f] using P.idem +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma p_comm_f {P Q : Karoubi (Karoubi C)} (f : P ⟶ Q) : P.p.f ≫ f.f.f = f.f.f ≫ Q.p.f := by simpa only [hom_ext_iff, comp_f] using p_comm f +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical functor `Karoubi (Karoubi C) ⥤ Karoubi C` -/ @[simps] def inverse : Karoubi (Karoubi C) ⥤ Karoubi C where obj P := ⟨P.X.X, P.p.f, by simpa only [hom_ext_iff] using! P.idem⟩ map f := ⟨f.f.f, by simpa only [hom_ext_iff] using! f.comm⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [Preadditive C] : Functor.Additive (inverse C) where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit isomorphism of the equivalence -/ @[simps!] def unitIso : 𝟭 (Karoubi C) ≅ toKaroubi (Karoubi C) ⋙ inverse C := eqToIso (Functor.ext (by cat_disch) (by simp)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] p_comm_f in /-- The counit isomorphism of the equivalence -/ @@ -60,6 +66,7 @@ def counitIso : inverse C ⋙ toKaroubi (Karoubi C) ≅ 𝟭 (Karoubi (Karoubi C hom := { app := fun P => { f := { f := P.p.1 } } } inv := { app := fun P => { f := { f := P.p.1 } } } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `Karoubi C ≌ Karoubi (Karoubi C)` -/ @[simps] @@ -69,9 +76,11 @@ def equivalence : Karoubi C ≌ Karoubi (Karoubi C) where unitIso := KaroubiKaroubi.unitIso C counitIso := KaroubiKaroubi.counitIso C +set_option backward.isDefEq.respectTransparency.types false in instance equivalence.additive_functor [Preadditive C] : Functor.Additive (equivalence C).functor where +set_option backward.isDefEq.respectTransparency.types false in instance equivalence.additive_inverse [Preadditive C] : Functor.Additive (equivalence C).inverse where diff --git a/Mathlib/CategoryTheory/IsConnected.lean b/Mathlib/CategoryTheory/IsConnected.lean index d6bdb887733612..15b81363cd0de7 100644 --- a/Mathlib/CategoryTheory/IsConnected.lean +++ b/Mathlib/CategoryTheory/IsConnected.lean @@ -364,7 +364,7 @@ theorem Zigzag.of_inv_inv {j₁ j₂ j₃ : J} (f₂₁ : j₂ ⟶ j₁) (f₃ /-- The setoid given by the equivalence relation `Zigzag`. A quotient for this setoid is a connected component of the category. -/ -@[implicit_reducible] +@[instance_reducible] def Zigzag.setoid (J : Type u₂) [Category.{v₁} J] : Setoid J where r := Zigzag iseqv := zigzag_equivalence @@ -466,6 +466,7 @@ def discreteIsConnectedEquivPUnit {α : Type u₁} [IsConnected (Discrete α)] : variable {C : Type w₂} [Category.{w₁} C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For objects `X Y : C`, any natural transformation `α : const X ⟶ const Y` from a connected category must be constant. diff --git a/Mathlib/CategoryTheory/Join/Basic.lean b/Mathlib/CategoryTheory/Join/Basic.lean index a8999e2aa636d9..ab910b33d05029 100644 --- a/Mathlib/CategoryTheory/Join/Basic.lean +++ b/Mathlib/CategoryTheory/Join/Basic.lean @@ -268,6 +268,7 @@ lemma mkFunctor_map_inclRight {d d' : D} (f : d ⟶ d') : (mkFunctor F G α).map ((inclRight C D).map f) = G.map f := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering `mkFunctor F G α` with the universal transformation gives back `α`. -/ @[simp] @@ -413,6 +414,7 @@ def mapPairRight : inclRight _ _ ⋙ mapPair Fₗ Fᵣ ≅ Fᵣ ⋙ inclRight _ end mapPair +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Any functor out of a join is naturally isomorphic to a functor of the form `mkFunctor F G α`. -/ @[simps!] @@ -450,6 +452,7 @@ section mapPairComp variable (Fₗ : C ⥤ E) (Fᵣ : D ⥤ E') (Gₗ : E ⥤ J) (Gᵣ : E' ⥤ K) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma mapPairComp_hom_app_left (c : C) : @@ -457,6 +460,7 @@ lemma mapPairComp_hom_app_left (c : C) : dsimp [mapPairComp] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma mapPairComp_hom_app_right (d : D) : @@ -498,6 +502,7 @@ def mapWhiskerRight {Fₗ : C ⥤ E} {Gₗ : C ⥤ E} (α : Fₗ ⟶ Gₗ) (H : ((mapPairLeft Fₗ H).hom ≫ whiskerRight α (inclLeft E E') ≫ (mapPairLeft Gₗ H).inv) ((mapPairRight Fₗ H).hom ≫ whiskerRight (𝟙 H) (inclRight E E') ≫ (mapPairRight Gₗ H).inv) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma mapWhiskerRight_comp {Fₗ : C ⥤ E} {Gₗ : C ⥤ E} {Hₗ : C ⥤ E} @@ -520,6 +525,7 @@ def mapWhiskerLeft (H : C ⥤ E) {Fᵣ : D ⥤ E'} {Gᵣ : D ⥤ E'} (α : Fᵣ ((mapPairLeft H Fᵣ).hom ≫ whiskerRight (𝟙 H) (inclLeft E E') ≫ (mapPairLeft H Gᵣ).inv) ((mapPairRight H Fᵣ).hom ≫ whiskerRight α (inclRight E E') ≫ (mapPairRight H Gᵣ).inv) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma mapWhiskerLeft_comp {Fᵣ : D ⥤ E'} {Gᵣ : D ⥤ E'} {Hᵣ : D ⥤ E'} diff --git a/Mathlib/CategoryTheory/Join/Final.lean b/Mathlib/CategoryTheory/Join/Final.lean index aadf77e3d8e6d0..99ab2a8b108822 100644 --- a/Mathlib/CategoryTheory/Join/Final.lean +++ b/Mathlib/CategoryTheory/Join/Final.lean @@ -23,6 +23,7 @@ namespace CategoryTheory.Join variable (C D : Type*) [Category* C] [Category* D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of `Join.inclLeft C D`-costructured arrows with target `right d` is equivalent to `C`. -/ @@ -34,6 +35,7 @@ def costructuredArrowEquiv (d : D) : CostructuredArrow (inclLeft C D) (right d) unitIso := NatIso.ofComponents (fun _ ↦ CostructuredArrow.isoMk (Iso.refl _)) counitIso := NatIso.ofComponents (fun _ ↦ Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of `Join.inclRight C D`-structured arrows with source `left c` is equivalent to `D`. -/ diff --git a/Mathlib/CategoryTheory/Join/Opposites.lean b/Mathlib/CategoryTheory/Join/Opposites.lean index a97fd3398380b2..96f80b62fb7d85 100644 --- a/Mathlib/CategoryTheory/Join/Opposites.lean +++ b/Mathlib/CategoryTheory/Join/Opposites.lean @@ -25,6 +25,7 @@ universe v₁ v₂ u₁ u₂ variable (C : Type u₁) (D : Type u₂) [Category.{v₁} C] [Category.{v₂} D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `(C ⋆ D)ᵒᵖ ≌ Dᵒᵖ ⋆ Cᵒᵖ` induced by `Join.opEquivFunctor` and `Join.opEquivInverse`. -/ @@ -48,105 +49,123 @@ def opEquiv : (C ⋆ D)ᵒᵖ ≌ Dᵒᵖ ⋆ Cᵒᵖ where | op (left _) => by cat_disch | op (right _) => by cat_disch +set_option backward.isDefEq.respectTransparency.types false in variable {C} in @[simp] lemma opEquiv_functor_obj_op_left (c : C) : (opEquiv C D).functor.obj (op <| left c) = right (op c) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma opEquiv_functor_obj_op_right (d : D) : (opEquiv C D).functor.obj (op <| right d) = left (op d) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {C} in @[simp] lemma opEquiv_functor_map_op_inclLeft {c c' : C} (f : c ⟶ c') : (opEquiv C D).functor.map (op <| (inclLeft C D).map f) = (inclRight _ _).map (op f) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma opEquiv_functor_map_op_inclRight {d d' : D} (f : d ⟶ d') : (opEquiv C D).functor.map (op <| (inclRight C D).map f) = (inclLeft _ _).map (op f) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {C D} in lemma opEquiv_functor_map_op_edge (c : C) (d : D) : (opEquiv C D).functor.map (op <| edge c d) = edge (op d) (op c) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Characterize (up to a rightOp) the action of the left inclusion on `Join.opEquivFunctor`. -/ @[simps!] def InclLeftCompRightOpOpEquivFunctor : inclLeft C D ⋙ (opEquiv C D).functor.rightOp ≅ (inclRight _ _).rightOp := isoWhiskerLeft _ (leftOpRightOpIso _) ≪≫ mkFunctorLeft _ _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- Characterize (up to a rightOp) the action of the right inclusion on `Join.opEquivFunctor`. -/ @[simps!] def InclRightCompRightOpOpEquivFunctor : inclRight C D ⋙ (opEquiv C D).functor.rightOp ≅ (inclLeft _ _).rightOp := isoWhiskerLeft _ (leftOpRightOpIso _) ≪≫ mkFunctorRight _ _ _ +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma opEquiv_inverse_obj_left_op (d : D) : (opEquiv C D).inverse.obj (left <| op d) = op (right d) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {C} in @[simp] lemma opEquiv_inverse_obj_right_op (c : C) : (opEquiv C D).inverse.obj (right <| op c) = op (left c) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma opEquiv_inverse_map_inclLeft_op {d d' : D} (f : d ⟶ d') : (opEquiv C D).inverse.map ((inclLeft Dᵒᵖ Cᵒᵖ).map f.op) = op ((inclRight _ _).map f) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma opEquiv_inverse_map_inclRight_op {c c' : C} (f : c ⟶ c') : (opEquiv C D).inverse.map ((inclRight Dᵒᵖ Cᵒᵖ).map f.op) = op ((inclLeft _ _).map f) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {C D} in @[simp] lemma opEquiv_inverse_map_edge_op (c : C) (d : D) : (opEquiv C D).inverse.map (edge (op d) (op c)) = op (edge c d) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Characterize `Join.opEquivInverse` with respect to the left inclusion -/ def inclLeftCompOpEquivInverse : Join.inclLeft Dᵒᵖ Cᵒᵖ ⋙ (opEquiv C D).inverse ≅ (inclRight _ _).op := Join.mkFunctorLeft _ _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- Characterize `Join.opEquivInverse` with respect to the right inclusion -/ def inclRightCompOpEquivInverse : Join.inclRight Dᵒᵖ Cᵒᵖ ⋙ (opEquiv C D).inverse ≅ (inclLeft _ _).op := Join.mkFunctorRight _ _ _ +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma inclLeftCompOpEquivInverse_hom_app_op (d : D) : (inclLeftCompOpEquivInverse C D).hom.app (op d) = 𝟙 (op <| right d) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {C} in @[simp] lemma inclRightCompOpEquivInverse_hom_app_op (c : C) : (inclRightCompOpEquivInverse C D).hom.app (op c) = 𝟙 (op <| left c) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {D} in @[simp] lemma inclLeftCompOpEquivInverse_inv_app_op (d : D) : (inclLeftCompOpEquivInverse C D).inv.app (op d) = 𝟙 (op <| right d) := rfl +set_option backward.isDefEq.respectTransparency.types false in variable {C} in @[simp] lemma inclRightCompOpEquivInverse_inv_app_op (c : C) : diff --git a/Mathlib/CategoryTheory/LiftingProperties/Over.lean b/Mathlib/CategoryTheory/LiftingProperties/Over.lean index 9b7e311cf01bb8..f719b440634a55 100644 --- a/Mathlib/CategoryTheory/LiftingProperties/Over.lean +++ b/Mathlib/CategoryTheory/LiftingProperties/Over.lean @@ -47,6 +47,7 @@ end CommSq.HasLift namespace HasLiftingProperty +set_option backward.isDefEq.respectTransparency.types false in lemma over {A B X Y : Over S} (i : A ⟶ B) (p : X ⟶ Y) [HasLiftingProperty i.left p.left] : HasLiftingProperty i p := ⟨fun _ ↦ .over⟩ diff --git a/Mathlib/CategoryTheory/Limits/Chosen/End.lean b/Mathlib/CategoryTheory/Limits/Chosen/End.lean index 29a4f819429c10..6e8a75e4e97c1c 100644 --- a/Mathlib/CategoryTheory/Limits/Chosen/End.lean +++ b/Mathlib/CategoryTheory/Limits/Chosen/End.lean @@ -52,6 +52,7 @@ lemma chosenCoend.condition {i j : J} (f : i ⟶ j) : variable {F} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Morphisms out of the chosen coend are determined by their composites with `chosenCoend.ι`. -/ @[ext] diff --git a/Mathlib/CategoryTheory/Limits/ConeCategory.lean b/Mathlib/CategoryTheory/Limits/ConeCategory.lean index 62c83bfa5e08af..2c60e52355353b 100644 --- a/Mathlib/CategoryTheory/Limits/ConeCategory.lean +++ b/Mathlib/CategoryTheory/Limits/ConeCategory.lean @@ -38,14 +38,14 @@ variable {C : Type u₃} [Category.{v₃} C] {D : Type u₄} [Category.{v₄} D] /-- Given a cone `c` over `F`, we can interpret the legs of `c` as structured arrows `c.pt ⟶ F.obj -`. -/ -@[simps] +@[simps, implicit_reducible] def Cone.toStructuredArrow {F : J ⥤ C} (c : Cone F) : J ⥤ StructuredArrow c.pt F where obj j := StructuredArrow.mk (c.π.app j) map f := StructuredArrow.homMk f /-- If `F` has a limit, then the limit projections can be interpreted as structured arrows `limit F ⟶ F.obj -`. -/ -@[simps] +@[simps, implicit_reducible] noncomputable def limit.toStructuredArrow (F : J ⥤ C) [HasLimit F] : J ⥤ StructuredArrow (limit F) F where obj j := StructuredArrow.mk (limit.π F j) @@ -90,6 +90,7 @@ lemma Cone.toStructuredArrow_comp_toUnder_comp_forget {F : J ⥤ C} (c : Cone F) c.toStructuredArrow ⋙ StructuredArrow.toUnder _ _ ⋙ Under.forget _ = F := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A cone `c` on `F : J ⥤ C` lifts to a cone in `Over c.pt` with cone point `𝟙 c.pt`. -/ @[simps] @@ -98,6 +99,7 @@ def Cone.toUnder {F : J ⥤ C} (c : Cone F) : pt := Under.mk (𝟙 c.pt) π := { app := fun j => Under.homMk (c.π.app j) (by simp) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The limit cone for `F : J ⥤ C` lifts to a cocone in `Under (limit F)` with cone point `𝟙 (limit F)`. This is automatically also a limit cone. -/ @@ -106,6 +108,7 @@ noncomputable def limit.toUnder (F : J ⥤ C) [HasLimit F] : pt := Under.mk (𝟙 (limit F)) π := { app := fun j => Under.homMk (limit.π F j) (by simp) } +set_option backward.isDefEq.respectTransparency.types false in /-- `c.toUnder` is a lift of `c` under the forgetful functor. -/ @[simps!] def Cone.mapConeToUnder {F : J ⥤ C} (c : Cone F) : (Under.forget c.pt).mapCone c.toUnder ≅ c := @@ -120,6 +123,7 @@ def Cone.fromStructuredArrow (F : C ⥤ D) {X : D} (G : J ⥤ StructuredArrow X pt := X π := { app := fun j => (G.obj j).hom } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a cone `c : Cone K` and a map `f : X ⟶ F.obj c.X`, we can construct a cone of structured arrows over `X` with `f` as the cone point. @@ -150,6 +154,7 @@ def Cone.fromCostructuredArrow (F : J ⥤ C) : CostructuredArrow (const J) F ⥤ convert! congr_fun (congr_arg NatTrans.app f.w) j simp } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant functor. -/ @@ -218,11 +223,13 @@ noncomputable def colimit.toCostructuredArrow (F : J ⥤ C) [HasColimit F] : obj j := CostructuredArrow.mk (colimit.ι F j) map f := CostructuredArrow.homMk f +set_option backward.isDefEq.respectTransparency.types false in /-- `Cocone.toCostructuredArrow` can be expressed in terms of `Functor.toCostructuredArrow`. -/ def Cocone.toCostructuredArrowIsoToCostructuredArrow {F : J ⥤ C} (c : Cocone F) : c.toCostructuredArrow ≅ (𝟭 J).toCostructuredArrow F c.pt c.ι.app (by simp) := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Functor.toCostructuredArrow` can be expressed in terms of `Cocone.toCostructuredArrow`. -/ def _root_.CategoryTheory.Functor.toCostructuredArrowIsoToCostructuredArrow (G : J ⥤ K) @@ -232,6 +239,7 @@ def _root_.CategoryTheory.Functor.toCostructuredArrowIsoToCostructuredArrow (G : (Cocone.mk X ⟨f, by simp [h]⟩).toCostructuredArrow ⋙ CostructuredArrow.pre _ _ _ := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- Interpreting the legs of a cocone as a costructured arrow and then forgetting the arrow again does nothing. -/ @[simps!] @@ -239,11 +247,13 @@ def Cocone.toCostructuredArrowCompProj {F : J ⥤ C} (c : Cocone F) : c.toCostructuredArrow ⋙ CostructuredArrow.proj _ _ ≅ 𝟭 J := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma Cocone.toCostructuredArrow_comp_proj {F : J ⥤ C} (c : Cocone F) : c.toCostructuredArrow ⋙ CostructuredArrow.proj _ _ = 𝟭 J := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Interpreting the legs of a cocone as a costructured arrow, interpreting this arrow as an arrow over the cocone point, and finally forgetting the arrow is the same as just applying the functor the cocone was over. -/ @@ -252,11 +262,13 @@ def Cocone.toCostructuredArrowCompToOverCompForget {F : J ⥤ C} (c : Cocone F) c.toCostructuredArrow ⋙ CostructuredArrow.toOver _ _ ⋙ Over.forget _ ≅ F := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma Cocone.toCostructuredArrow_comp_toOver_comp_forget {F : J ⥤ C} (c : Cocone F) : c.toCostructuredArrow ⋙ CostructuredArrow.toOver _ _ ⋙ Over.forget _ = F := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A cocone `c` on `F : J ⥤ C` lifts to a cocone in `Over c.pt` with cone point `𝟙 c.pt`. -/ @[simps] @@ -265,6 +277,7 @@ def Cocone.toOver {F : J ⥤ C} (c : Cocone F) : pt := Over.mk (𝟙 c.pt) ι := { app := fun j => Over.homMk (c.ι.app j) (by simp) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The colimit cocone for `F : J ⥤ C` lifts to a cocone in `Over (colimit F)` with cone point `𝟙 (colimit F)`. This is automatically also a colimit cocone. -/ @@ -274,11 +287,13 @@ noncomputable def colimit.toOver (F : J ⥤ C) [HasColimit F] : pt := Over.mk (𝟙 (colimit F)) ι := { app := fun j => Over.homMk (colimit.ι F j) (by simp) } +set_option backward.isDefEq.respectTransparency.types false in /-- `c.toOver` is a lift of `c` under the forgetful functor. -/ @[simps!] def Cocone.mapCoconeToOver {F : J ⥤ C} (c : Cocone F) : (Over.forget c.pt).mapCocone c.toOver ≅ c := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a diagram `CostructuredArrow F X`s, we may obtain a cocone with cone point `X`. -/ @[simps!] @@ -287,6 +302,7 @@ def Cocone.fromCostructuredArrow (F : C ⥤ D) {X : D} (G : J ⥤ CostructuredAr pt := X ι := { app := fun j => (G.obj j).hom } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a cocone `c : Cocone K` and a map `f : F.obj c.X ⟶ X`, we can construct a cocone of costructured arrows over `X` with `f` as the cone point. -/ @@ -315,6 +331,7 @@ def Cocone.fromStructuredArrow (F : J ⥤ C) : StructuredArrow F (const J) ⥤ C { hom := f.right w j := by simp [dsimp% congr_app f.w j] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of cocones on `F` is just the comma category `(F ↓ Δ)`, where `Δ` is the constant functor. -/ diff --git a/Mathlib/CategoryTheory/Limits/Cones.lean b/Mathlib/CategoryTheory/Limits/Cones.lean index 44c7bb106f67ae..767696df4bb0b2 100644 --- a/Mathlib/CategoryTheory/Limits/Cones.lean +++ b/Mathlib/CategoryTheory/Limits/Cones.lean @@ -150,13 +150,27 @@ instance inhabitedCone (F : Discrete PUnit ⥤ C) : Inhabited (Cone F) := } }⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -@[to_dual (attr := reassoc (attr := simp))] +@[to_dual (attr := reassoc)] theorem Cone.w {F : J ⥤ C} (c : Cone F) {j j' : J} (f : j ⟶ j') : dsimp% c.π.app j ≫ F.map f = c.π.app j' := by simpa using (c.π.naturality f).symm -attribute [elementwise] Cocone.w Cone.w +attribute [simp] Cone.w Cone.w_assoc -- `Cocone.w` and `Cocone.w_assoc` are redundant + +set_option backward.isDefEq.respectTransparency.types false in +attribute [elementwise] Cone.w + +-- TODO: Is there a less manual way to state this even though `simp` can derive it? +theorem Cocone.w_apply.{uF, w} {J : Type u₁} [Category.{v₁, u₁} J] {C : Type u₃} + [Category.{v₃, u₃} C] {F : J ⥤ C} (c : Cocone F) {j j' : J} (f : j' ⟶ j) {F' : C → C → Type uF} + {carrier : C → Type w} + {instFunLike : (X Y : C) → FunLike (F' X Y) (carrier X) (carrier Y)} + [inst : ConcreteCategory C F'] (x : carrier (F.obj j')) : + (ConcreteCategory.hom (c.ι.app j)) ((ConcreteCategory.hom (F.map f)) x) = + (ConcreteCategory.hom (c.ι.app j')) x := by + simp end @@ -247,10 +261,12 @@ structure CoconeMorphism (A B : Cocone F) where attribute [reassoc (attr := simp)] ConeMorphism.w CoconeMorphism.w attribute [to_dual existing] ConeMorphism.casesOn +set_option backward.isDefEq.respectTransparency.types false in @[to_dual] instance inhabitedConeMorphism (A : Cone F) : Inhabited (ConeMorphism A A) := ⟨{ hom := 𝟙 _ }⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The category of cones on a given diagram. -/ @[to_dual (attr := simps) /-- The category of cocones on a given diagram. -/] instance Cone.category : Category (Cone F) where @@ -261,6 +277,7 @@ instance Cone.category : Category (Cone F) where /- We do not want `simps` automatically generate the lemma for simplifying the hom field of a category. So we need to write the `ext` lemma in terms of the categorical morphism, rather than the underlying structure. -/ +set_option backward.isDefEq.respectTransparency.types false in @[to_dual (attr := ext) /- We do not want `simps` automatically generate the lemma for simplifying the hom field of a category. So we need to write the `ext` lemma in terms of the @@ -270,20 +287,25 @@ theorem ConeMorphism.ext {c c' : Cone F} (f g : c ⟶ c') (w : f.hom = g.hom) : cases g congr +set_option backward.isDefEq.respectTransparency.types false in @[to_dual (attr := reassoc (attr := simp))] lemma ConeMorphism.hom_inv_id {c d : Cone F} (f : c ≅ d) : f.hom.hom ≫ f.inv.hom = 𝟙 _ := by simp [← Cone.category_comp_hom] +set_option backward.isDefEq.respectTransparency.types false in @[to_dual (attr := reassoc (attr := simp))] lemma ConeMorphism.inv_hom_id {c d : Cone F} (f : c ≅ d) : f.inv.hom ≫ f.hom.hom = 𝟙 _ := by simp [← Cone.category_comp_hom] +set_option backward.isDefEq.respectTransparency.types false in @[to_dual] instance {c d : Cone F} (f : c ≅ d) : IsIso f.hom.hom := ⟨f.inv.hom, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in @[to_dual] instance {c d : Cone F} (f : c ≅ d) : IsIso f.inv.hom := ⟨f.hom.hom, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in @[to_dual (attr := reassoc (attr := simp))] lemma ConeMorphism.map_w {c c' : Cone F} (f : c ⟶ c') (G : C ⥤ D) (j : J) : G.map f.hom ≫ G.map (c'.π.app j) = G.map (c.π.app j) := by @@ -291,6 +313,7 @@ lemma ConeMorphism.map_w {c c' : Cone F} (f : c ⟶ c') (G : C ⥤ D) (j : J) : namespace Cone +set_option backward.isDefEq.respectTransparency.types false in /-- To give an isomorphism between cones, it suffices to give an isomorphism between their vertices which commutes with the cone maps. -/ @[to_dual (attr := simps) ext_inv @@ -303,6 +326,7 @@ def ext {c c' : Cone F} (φ : c.pt ≅ c'.pt) { hom := φ.inv w := fun j => φ.inv_comp_eq.mpr (w j) } +set_option backward.isDefEq.respectTransparency.types false in /-- To give an isomorphism between cones, it suffices to give an isomorphism between their vertices which commutes with the cone maps. -/ @[to_dual (attr := simps!) ext @@ -314,11 +338,13 @@ def ext_inv {c c' : Cone F} (φ : c.pt ≅ c'.pt) attribute [aesop apply safe (rule_sets := [CategoryTheory])] Limits.Cone.ext Limits.Cocone.ext +set_option backward.isDefEq.respectTransparency.types false in /-- Eta rule for cones. -/ @[to_dual (attr := simps!) /-- Eta rule for cocones. -/] def eta (c : Cone F) : c ≅ ⟨c.pt, c.π⟩ := ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a cone morphism whose object part is an isomorphism, produce an isomorphism of cones. -/ @@ -330,16 +356,19 @@ theorem cone_iso_of_hom_iso {K : J ⥤ C} {c d : Cone K} (f : c ⟶ d) [i : IsIs ⟨⟨{ hom := inv f.hom w := fun j => (asIso f.hom).inv_comp_eq.2 (f.w j).symm }, by cat_disch⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- There is a morphism from an extended cone to the original cone. -/ @[to_dual (attr := simps) /-- There is a morphism from a cocone to its extension. -/] def extendHom (s : Cone F) {X : C} (f : X ⟶ s.pt) : s.extend f ⟶ s where hom := f +set_option backward.isDefEq.respectTransparency.types false in /-- Extending a cone by the identity does nothing. -/ @[to_dual (attr := simps!) /-- Extending a cocone by the identity does nothing. -/] def extendId (s : Cone F) : s.extend (𝟙 s.pt) ≅ s := ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- Extending a cone by a composition is the same as extending the cone twice. -/ @[to_dual (attr := simps!) (reorder := f g) /-- Extending a cocone by a composition is the same as extending the cone twice. -/] @@ -347,6 +376,7 @@ def extendComp (s : Cone F) {X Y : C} (f : X ⟶ Y) (g : Y ⟶ s.pt) : s.extend (f ≫ g) ≅ (s.extend g).extend f := ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- A cone extended by an isomorphism is isomorphic to the original cone. -/ @[to_dual (attr := simps) /-- A cocone extended by an isomorphism is isomorphic to the original cone. -/] @@ -354,10 +384,12 @@ def extendIso (s : Cone F) {X : C} (f : s.pt ≅ X) : s ≅ s.extend f.inv where hom := { hom := f.hom } inv := { hom := f.inv } +set_option backward.isDefEq.respectTransparency.types false in @[to_dual] instance {s : Cone F} {X : C} (f : X ⟶ s.pt) [IsIso f] : IsIso (s.extendHom f) := ⟨(extendIso s (asIso' f)).hom, by cat_disch⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Functorially postcompose a cone for `F` by a natural transformation `F ⟶ G` to give a cone for `G`. -/ @@ -370,6 +402,7 @@ def postcompose {G : J ⥤ C} (α : F ⟶ G) : Cone F ⥤ Cone G where π := c.π ≫ α } map f := { hom := f.hom } +set_option backward.isDefEq.respectTransparency.types false in /-- Postcomposing a cone by the composite natural transformation `α ≫ β` is the same as postcomposing by `α` and then by `β`. -/ @[to_dual (attr := simps!) (reorder := α β) @@ -379,12 +412,14 @@ def postcomposeComp {G H : J ⥤ C} (α : F ⟶ G) (β : G ⟶ H) : postcompose (α ≫ β) ≅ postcompose α ⋙ postcompose β := NatIso.ofComponents fun s => ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- Postcomposing by the identity does not change the cone up to isomorphism. -/ @[to_dual (attr := simps!) /-- Precomposing by the identity does not change the cocone up to isomorphism. -/] def postcomposeId : postcompose (𝟙 F) ≅ 𝟭 (Cone F) := NatIso.ofComponents fun s => ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- If `F` and `G` are naturally isomorphic functors, then they have equivalent categories of cones. -/ @@ -407,6 +442,7 @@ def whiskering (E : K ⥤ J) : Cone F ⥤ Cone (E ⋙ F) where obj c := c.whisker E map f := { hom := f.hom } +set_option backward.isDefEq.respectTransparency.types false in /-- Whiskering by an equivalence gives an equivalence between categories of cones. -/ @[to_dual (attr := simps) @@ -446,6 +482,7 @@ def forget : Cone F ⥤ C where variable (G : C ⥤ D) +set_option backward.isDefEq.respectTransparency.types false in /-- A functor `G : C ⥤ D` sends cones over `F` to cones over `F ⋙ G` functorially. -/ @[to_dual (attr := simps) /-- A functor `G : C ⥤ D` sends cocones over `F` to cocones over `F ⋙ G` functorially. -/] @@ -459,12 +496,14 @@ def functoriality : Cone F ⥤ Cone (F ⋙ G) where { hom := G.map f.hom w := ConeMorphism.map_w f G } +set_option backward.isDefEq.respectTransparency.types false in /-- Functoriality is functorial. -/ @[to_dual /-- Functoriality is functorial. -/] def functorialityCompFunctoriality (H : D ⥤ E) : functoriality F G ⋙ functoriality (F ⋙ G) H ≅ functoriality F (G ⋙ H) := NatIso.ofComponents (fun _ ↦ Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in @[to_dual] instance functoriality_full [G.Full] [G.Faithful] : (functoriality F G).Full where map_surjective t := @@ -476,6 +515,7 @@ instance functoriality_faithful [G.Faithful] : (functoriality F G).Faithful wher map_injective {_X} {_Y} f g h := ConeMorphism.ext f g <| G.map_injective <| congr_arg ConeMorphism.hom h +set_option backward.isDefEq.respectTransparency.types false in /-- If `e : C ≌ D` is an equivalence of categories, then `functoriality F e.functor` induces an equivalence between cones over `F` and cones over `F ⋙ e.functor`. -/ @@ -529,6 +569,7 @@ namespace Cones @[deprecated (since := "2026-03-06")] alias equivalenceOfReindexing := Cone.equivalenceOfReindexing @[deprecated (since := "2026-03-06")] alias forget := Cone.forget @[deprecated (since := "2026-03-06")] alias functoriality := Cone.functoriality +set_option backward.isDefEq.respectTransparency.types false in @[deprecated (since := "2026-03-06")] alias functorialityCompFunctoriality := Cone.functorialityCompFunctoriality @[deprecated (since := "2026-03-06")] alias functoriality_full := Cone.functoriality_full @@ -559,6 +600,7 @@ namespace Cocones alias equivalenceOfReindexing := Cocone.equivalenceOfReindexing @[deprecated (since := "2026-03-06")] alias forget := Cocone.forget @[deprecated (since := "2026-03-06")] alias functoriality := Cocone.functoriality +set_option backward.isDefEq.respectTransparency.types false in @[deprecated (since := "2026-03-06")] alias functorialityCompFunctoriality := Cocone.functorialityCompFunctoriality @[deprecated (since := "2026-03-06")] alias functoriality_full := Cocone.functoriality_full @@ -618,6 +660,7 @@ noncomputable def mapConeInvMapCone {F : J ⥤ D} (H : D ⥤ C) [IsEquivalence H mapConeInv H (mapCone H c) ≅ c := (Limits.Cone.functorialityEquivalence F (asEquivalence H)).unitIso.symm.app c +set_option backward.isDefEq.respectTransparency.types false in /-- `functoriality F _ ⋙ postcompose (whisker_left F _)` simplifies to `functoriality F _`. -/ @[to_dual (attr := simps!) /-- `functoriality F _ ⋙ precompose (whiskerLeft F _)` simplifies to `functoriality F _`. -/] @@ -639,6 +682,7 @@ def postcomposeWhiskerLeftMapCone {H H' : C ⥤ D} (α : H ≅ H') (c : Cone F) (Cone.postcompose (whiskerLeft F α.hom :)).obj (mapCone H c) ≅ mapCone H' c := (functorialityCompPostcompose α).app c +set_option backward.isDefEq.respectTransparency.types false in /-- `mapCone` commutes with `postcompose`. In particular, for `F : J ⥤ C`, given a cone `c : Cone F`, a natural transformation `α : F ⟶ G` and a functor `H : C ⥤ D`, we have two obvious ways of producing @@ -654,6 +698,7 @@ def mapConePostcompose {α : F ⟶ G} {c} : (Cone.postcompose (whiskerRight α H :)).obj (mapCone H c) := Cone.ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- `mapCone` commutes with `postcomposeEquivalence` -/ @[to_dual (attr := simps!) /-- `mapCocone` commutes with `precomposeEquivalence` -/] def mapConePostcomposeEquivalenceFunctor {α : F ≅ G} {c} : @@ -661,6 +706,7 @@ def mapConePostcomposeEquivalenceFunctor {α : F ≅ G} {c} : (Cone.postcomposeEquivalence (isoWhiskerRight α H :)).functor.obj (mapCone H c) := Cone.ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- `mapCone` commutes with `whisker` -/ @[to_dual (attr := simps!) /-- `mapCocone` commutes with `whisker` -/] def mapConeWhisker {E : K ⥤ J} {c : Cone F} : mapCone H (c.whisker E) ≅ (mapCone H c).whisker E := @@ -717,6 +763,7 @@ def coconeEquivalenceOpConeOp : Cocone F ≌ (Cone F.op)ᵒᵖ where unitIso := Iso.refl _ counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- Cones on `F : J ⥤ C` are equivalent to cocones on `F.op : Jᵒᵖ ⥤ Cᵒᵖ`. -/ @[to_dual (attr := simps) /-- Cocones on `F : J ⥤ C` are equivalent to cones on `F.op : Jᵒᵖ ⥤ Cᵒᵖ`. -/] @@ -748,6 +795,7 @@ def coconeLeftOpOfCone (c : Cone F) : Cocone F.leftOp where pt := unop c.pt ι := NatTrans.leftOp c.π +set_option backward.isDefEq.respectTransparency.types false in /-- Cones on `F : J ⥤ Cᵒᵖ` are equivalent to cocones on `F.leftOp : Jᵒᵖ ⥤ C`. -/ @[to_dual (attr := simps) /-- Cocones on `F : J ⥤ Cᵒᵖ` are equivalent to cones on `F.leftOp : Jᵒᵖ ⥤ C`. -/] @@ -779,6 +827,7 @@ def coconeRightOpOfCone (c : Cone F) : Cocone F.rightOp where pt := op c.pt ι := NatTrans.rightOp c.π +set_option backward.isDefEq.respectTransparency.types false in /-- Cones on `F : Jᵒᵖ ⥤ C` are equivalent to cocones on `F.rightOp : J ⥤ Cᵒᵖ`. -/ @[to_dual (attr := simps) /-- Cocones on `F : Jᵒᵖ ⥤ C` are equivalent to cones on `F.rightOp : J ⥤ Cᵒᵖ`. -/] @@ -810,6 +859,7 @@ def coconeUnopOfCone (c : Cone F) : Cocone F.unop where pt := unop c.pt ι := NatTrans.unop c.π +set_option backward.isDefEq.respectTransparency.types false in /-- Cones on `F : Jᵒᵖ ⥤ Cᵒᵖ` are equivalent to cocones on `F.unop : J ⥤ C`. -/ @[to_dual (attr := simps) /-- Cocones on `F : Jᵒᵖ ⥤ Cᵒᵖ` are equivalent to cones on `F.unop : J ⥤ C`. -/] @@ -831,6 +881,7 @@ open CategoryTheory.Limits variable {F : J ⥤ C} (G : C ⥤ D) +set_option backward.isDefEq.respectTransparency.types false in /-- The opposite cocone of the image of a cone is the image of the opposite cocone. -/ @[to_dual (attr := simps!) /-- The opposite cone of the image of a cocone is the image of the opposite cone. -/] diff --git a/Mathlib/CategoryTheory/Limits/Connected.lean b/Mathlib/CategoryTheory/Limits/Connected.lean index a58824cacfe172..3dfcc0fede6b6d 100644 --- a/Mathlib/CategoryTheory/Limits/Connected.lean +++ b/Mathlib/CategoryTheory/Limits/Connected.lean @@ -63,6 +63,7 @@ def constCocone : Cocone ((Functor.const J).obj X) where variable [IsConnected J] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When `J` is a connected category, the limit of a constant functor `J ⥤ C` with value `X : C` identifies to `X`. -/ @@ -75,6 +76,7 @@ def isLimitConstCone : IsLimit (constCone J X) where (fun _ _ f ↦ by simpa using s.w f) _ _ uniq s m hm := by simpa using hm (Classical.arbitrary _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When `J` is a connected category, the colimit of a constant functor `J ⥤ C` with value `X : C` identifies to `X`. -/ diff --git a/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean b/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean index c307ece418a386..d2ceef978b60a7 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/EventuallyConstant.lean @@ -116,7 +116,9 @@ noncomputable def cone : Cone F where let β : i ⟶ j := IsCofiltered.minToRight _ _ rw [h.coneπApp_eq j _ α β, assoc, h.coneπApp_eq j' _ α (β ≫ φ), map_comp] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- When `h : F.IsEventuallyConstantTo i₀`, the limit of `F` exists and is `F.obj i₀`. -/ noncomputable def isLimitCone : IsLimit h.cone where lift s := s.π.app i₀ @@ -128,7 +130,9 @@ noncomputable def isLimitCone : IsLimit h.cone where lemma hasLimit : HasLimit F := ⟨_, h.isLimitCone⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in lemma isIso_π_of_isLimit {c : Cone F} (hc : IsLimit c) : IsIso (c.π.app i₀) := by simp only [← IsLimit.conePointUniqueUpToIso_hom_comp hc h.isLimitCone i₀, diff --git a/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean index cb582d90a1552c..b8e18f8e867d99 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean @@ -119,6 +119,7 @@ variable [PreservesLimitsOfShape (Discrete WalkingPair) F] variable [PreservesLimitsOfShape (Discrete.{0} PEmpty) F] variable [HasFiniteProducts.{v} C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` preserves the terminal object and binary products, then it preserves products indexed by `Fin n` for any `n`. @@ -244,6 +245,7 @@ variable [PreservesColimitsOfShape (Discrete WalkingPair) F] variable [PreservesColimitsOfShape (Discrete.{0} PEmpty) F] variable [HasFiniteCoproducts.{v} C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` preserves the initial object and binary coproducts, then it preserves products indexed by `Fin n` for any `n`. diff --git a/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean b/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean index 5915e5f70240f2..7db9e29cd91700 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean @@ -226,7 +226,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating limits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsLimitsOfShapeOfCreatesEqualizersAndProducts : CreatesLimitsOfShape J G where CreatesLimit {K} := @@ -247,7 +247,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating limits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsFiniteLimitsOfCreatesEqualizersAndFiniteProducts [HasEqualizers D] [HasFiniteProducts D] (G : C ⥤ D) [G.ReflectsIsomorphisms] [CreatesLimitsOfShape WalkingParallelPair G] @@ -260,7 +260,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating limits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsLimitsOfSizeOfCreatesEqualizersAndProducts [HasEqualizers D] [HasProducts.{w} D] (G : C ⥤ D) [G.ReflectsIsomorphisms] [CreatesLimitsOfShape WalkingParallelPair G] [∀ J, CreatesLimitsOfShape (Discrete.{w} J) G] : @@ -294,7 +294,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating limits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsFiniteLimitsOfCreatesTerminalAndPullbacks [HasTerminal D] [HasPullbacks D] (G : C ⥤ D) [G.ReflectsIsomorphisms] [CreatesLimitsOfShape (Discrete.{0} PEmpty) G] [CreatesLimitsOfShape WalkingCospan G] : @@ -401,6 +401,7 @@ noncomputable def colimitQuotientCoproduct [HasColimitsOfSize.{w, w} C] (F : J have := hasFiniteColimits_of_hasColimitsOfSize C coequalizer.π _ _ ≫ (colimit.isoColimitCocone (colimitCoconeOfCoequalizerAndCoproduct F)).inv +set_option backward.isDefEq.respectTransparency.types false in instance colimitQuotientCoproduct_epi [HasColimitsOfSize.{w, w} C] (F : J ⥤ C) : Epi (colimitQuotientCoproduct F) := epi_comp _ _ @@ -502,7 +503,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating colimits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsColimitsOfShapeOfCreatesCoequalizersAndCoproducts : CreatesColimitsOfShape J G where CreatesColimit {K} := @@ -523,7 +524,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating colimits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsFiniteColimitsOfCreatesCoequalizersAndFiniteCoproducts [HasCoequalizers D] [HasFiniteCoproducts D] (G : C ⥤ D) [G.ReflectsIsomorphisms] [CreatesColimitsOfShape WalkingParallelPair G] @@ -536,7 +537,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating colimits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsColimitsOfSizeOfCreatesCoequalizersAndCoproducts [HasCoequalizers D] [HasCoproducts.{w} D] (G : C ⥤ D) [G.ReflectsIsomorphisms] [CreatesColimitsOfShape WalkingParallelPair G] @@ -572,7 +573,7 @@ We additionally require the rather strong condition that the functor reflects is unclear whether the statement remains true without this condition. There are various definitions of "creating colimits" in the literature, and whether or not the condition can be dropped seems to depend on the specific definition that is used. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def createsFiniteColimitsOfCreatesInitialAndPushouts [HasInitial D] [HasPushouts D] (G : C ⥤ D) [G.ReflectsIsomorphisms] [CreatesColimitsOfShape (Discrete.{0} PEmpty) G] [CreatesColimitsOfShape WalkingSpan G] : diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean b/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean index 5408ed6c593fbd..5c22914bd8ccc1 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean @@ -46,6 +46,7 @@ def natTransInCostructuredArrow {B : D} (F : J ⥤ CostructuredArrow K B) : F ⋙ CostructuredArrow.proj K B ⋙ K ⟶ (CategoryTheory.Functor.const J).obj B where app j := (F.obj j).hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- (Implementation) Given a cone in the base category, raise it to a cone in `CostructuredArrow K B`. Note this is where the connected assumption is used. @@ -157,6 +158,7 @@ instance hasLimitsOfShape_of_isConnected {B : C} [IsConnected J] [HasLimitsOfSha HasLimitsOfShape J (Over B) where has_limit F := hasLimit_of_created F (forget B) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor taking a cone over `F` to a cone over `Over.post F : Over i ⥤ Over (F.obj i)`. This takes limit cones to limit cones when `J` is cofiltered. See `isLimitConePost` -/ @@ -165,12 +167,14 @@ def conePost (F : J ⥤ C) (i : J) : Cone F ⥤ Cone (Over.post (X := i) F) wher obj c := { pt := Over.mk (c.π.app i), π := { app X := Over.homMk (c.π.app X.left) } } map f := { hom := Over.homMk f.hom } +set_option backward.isDefEq.respectTransparency.types false in /-- `conePost` is compatible with the forgetful functors on over categories. -/ @[simps!] def conePostIso (F : J ⥤ C) (i : J) : conePost F i ⋙ Cone.functoriality _ (Over.forget (F.obj i)) ≅ Cone.whiskering (Over.forget _) := .refl _ +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] IsCofiltered.isConnected in /-- The functor taking a cone over `F` to a cone over `Over.post F : Over i ⥤ Over (F.obj i)` preserves limit cones -/ diff --git a/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean b/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean index 9b9fc29bce0359..7ae39ef61d264d 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/Over/Products.lean @@ -94,7 +94,9 @@ def IsLimit.pullbackConeEquivBinaryFanFunctor {c : PullbackCone f g} (hc : IsLim · simpa using! congr(($e₁).left) · simpa using! congr(($e₂).left) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- A pullback cone to `X` is a limit if its corresponding binary fan in `Over X` is a limit. -/ -- This could also be `(IsLimit.ofConeEquiv pullbackConeEquivBinaryFan.symm).symm hc`, but possibly -- bad defeqs? @@ -295,7 +297,9 @@ def conesEquivFunctor (B : C) {J : Type w} (F : Discrete J ⥤ Over B) : -- attribute [local aesop safe cases (rule_sets := [CategoryTheory])] WidePullbackShape -- If this worked we could avoid the `rintro` in `conesEquivUnitIso`. +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- (Impl) A preliminary definition to avoid timeouts. -/ @[simps!] def conesEquivUnitIso (B : C) (F : Discrete J ⥤ Over B) : @@ -306,6 +310,7 @@ def conesEquivUnitIso (B : C) (F : Discrete J ⥤ Over B) : inv := 𝟙 _ } (by rintro (j | j) <;> cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- TODO: Can we add `:= by aesop` to the second arguments of `NatIso.ofComponents` and -- `Cone.ext`? @@ -317,6 +322,7 @@ def conesEquivCounitIso (B : C) (F : Discrete J ⥤ Over B) : { hom := Over.homMk (𝟙 _) inv := Over.homMk (𝟙 _) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- (Impl) Establish an equivalence between the category of cones for `F` and for the "grown" `F`. -/ @@ -357,6 +363,7 @@ theorem over_finiteProducts_of_finiteWidePullbacks [HasFiniteWidePullbacks C] {B end ConstructProducts +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Construct terminal object in the over category. This isn't an instance as it's not typically the way we want to define terminal objects. diff --git a/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean b/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean index fbbd4ce92ff73e..b9878e04e8a121 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/ZeroObjects.lean @@ -34,6 +34,7 @@ open ZeroObject def binaryFanZeroLeft (X : C) : BinaryFan (0 : C) X := BinaryFan.mk 0 (𝟙 X) +set_option backward.isDefEq.respectTransparency.types false in /-- The limit cone for the product with a zero object is limiting. -/ def binaryFanZeroLeftIsLimit (X : C) : IsLimit (binaryFanZeroLeft X) := BinaryFan.isLimitMk (fun s => BinaryFan.snd s) (by cat_disch) (by simp) @@ -60,6 +61,7 @@ theorem zeroProdIso_inv_snd (X : C) : (zeroProdIso X).inv ≫ prod.snd = 𝟙 X def binaryFanZeroRight (X : C) : BinaryFan X (0 : C) := BinaryFan.mk (𝟙 X) 0 +set_option backward.isDefEq.respectTransparency.types false in /-- The limit cone for the product with a zero object is limiting. -/ def binaryFanZeroRightIsLimit (X : C) : IsLimit (binaryFanZeroRight X) := BinaryFan.isLimitMk (fun s => BinaryFan.fst s) (by simp) (by cat_disch) @@ -86,6 +88,7 @@ theorem prodZeroIso_iso_inv_snd (X : C) : (prodZeroIso X).inv ≫ prod.fst = def binaryCofanZeroLeft (X : C) : BinaryCofan (0 : C) X := BinaryCofan.mk 0 (𝟙 X) +set_option backward.isDefEq.respectTransparency.types false in /-- The colimit cocone for the coproduct with a zero object is colimiting. -/ def binaryCofanZeroLeftIsColimit (X : C) : IsColimit (binaryCofanZeroLeft X) := BinaryCofan.isColimitMk (fun s => BinaryCofan.inr s) (by cat_disch) (by simp) @@ -112,6 +115,7 @@ theorem zeroCoprodIso_inv (X : C) : (zeroCoprodIso X).inv = coprod.inr := def binaryCofanZeroRight (X : C) : BinaryCofan X (0 : C) := BinaryCofan.mk (𝟙 X) 0 +set_option backward.isDefEq.respectTransparency.types false in /-- The colimit cocone for the coproduct with a zero object is colimiting. -/ def binaryCofanZeroRightIsColimit (X : C) : IsColimit (binaryCofanZeroRight X) := BinaryCofan.isColimitMk (fun s => BinaryCofan.inl s) (by simp) (by cat_disch) diff --git a/Mathlib/CategoryTheory/Limits/Creates.lean b/Mathlib/CategoryTheory/Limits/Creates.lean index 6e50771af6bbee..36a09f08c3724f 100644 --- a/Mathlib/CategoryTheory/Limits/Creates.lean +++ b/Mathlib/CategoryTheory/Limits/Creates.lean @@ -250,11 +250,12 @@ structure LiftsToColimit (K : J ⥤ C) (F : C ⥤ D) (c : Cocone (K ⋙ F)) (t : /-- the lifted cocone is colimit -/ makesColimit : IsColimit liftedCocone +set_option backward.isDefEq.respectTransparency.types false in /-- If `F` reflects isomorphisms and we can lift any limit cone to a limit cone, then `F` creates limits. In particular here we don't need to assume that F reflects limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfReflectsIso {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphisms] (h : ∀ c t, LiftsToLimit K F c t) : CreatesLimit K F where lifts c t := (h c t).toLiftableCone @@ -276,7 +277,7 @@ def createsLimitOfReflectsIso {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphism /-- If `F` reflects isomorphisms and we can lift a single limit cone to a limit cone, then `F` creates limits. Note that unlike `createsLimitOfReflectsIso`, to apply this result it is necessary to know that `K ⋙ F` actually has a limit. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfReflectsIso' {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphisms] {c : Cone (K ⋙ F)} (hc : IsLimit c) (h : LiftsToLimit K F c hc) : CreatesLimit K F := createsLimitOfReflectsIso fun _ t => @@ -286,7 +287,7 @@ def createsLimitOfReflectsIso' {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphis /-- If `F` reflects isomorphisms, and we already know that the limit exists in the source and `F` preserves it, then `F` creates that limit. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfReflectsIsomorphismsOfPreserves {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphisms] [HasLimit K] [PreservesLimit K F] : CreatesLimit K F := createsLimitOfReflectsIso' (isLimitOfPreserves F (limit.isLimit _)) @@ -299,7 +300,7 @@ def createsLimitOfReflectsIsomorphismsOfPreserves {K : J ⥤ C} {F : C ⥤ D} [F When `F` is fully faithful, to show that `F` creates the limit for `K` it suffices to exhibit a lift of a limit cone for `K ⋙ F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfFullyFaithfulOfLift' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] {l : Cone (K ⋙ F)} (hl : IsLimit l) (c : Cone K) (i : F.mapCone c ≅ l) : CreatesLimit K F := @@ -311,7 +312,7 @@ def createsLimitOfFullyFaithfulOfLift' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.F /-- When `F` is fully faithful, and `HasLimit (K ⋙ F)`, to show that `F` creates the limit for `K` it suffices to exhibit a lift of the chosen limit cone for `K ⋙ F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfFullyFaithfulOfLift {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] [HasLimit (K ⋙ F)] (c : Cone K) (i : F.mapCone c ≅ limit.cone (K ⋙ F)) : CreatesLimit K F := @@ -326,7 +327,7 @@ set_option backward.isDefEq.respectTransparency false in When `F` is fully faithful, to show that `F` creates the limit for `K` it suffices to show that a limit point is in the essential image of `F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfFullyFaithfulOfIso' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] {l : Cone (K ⋙ F)} (hl : IsLimit l) (X : C) (i : F.obj X ≅ l.pt) : CreatesLimit K F := createsLimitOfFullyFaithfulOfLift' hl @@ -344,13 +345,13 @@ def createsLimitOfFullyFaithfulOfIso' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Fa /-- When `F` is fully faithful, and `HasLimit (K ⋙ F)`, to show that `F` creates the limit for `K` it suffices to show that the chosen limit point is in the essential image of `F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfFullyFaithfulOfIso {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] [HasLimit (K ⋙ F)] (X : C) (i : F.obj X ≅ limit (K ⋙ F)) : CreatesLimit K F := createsLimitOfFullyFaithfulOfIso' (limit.isLimit _) X i /-- A fully faithful functor that preserves a limit that exists also creates the limit. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfFullyFaithfulOfPreserves {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] [HasLimit K] [PreservesLimit K F] : CreatesLimit K F := createsLimitOfFullyFaithfulOfLift' (isLimitOfPreserves _ (limit.isLimit K)) _ (Iso.refl _) @@ -374,11 +375,12 @@ instance (priority := 100) preservesLimits_of_createsLimits_and_hasLimits (F : C [CreatesLimitsOfSize.{w, w'} F] [HasLimitsOfSize.{w, w'} D] : PreservesLimitsOfSize.{w, w'} F where +set_option backward.isDefEq.respectTransparency.types false in /-- If `F` reflects isomorphisms and we can lift any colimit cocone to a colimit cocone, then `F` creates colimits. In particular here we don't need to assume that F reflects colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfReflectsIso {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphisms] (h : ∀ c t, LiftsToColimit K F c t) : CreatesColimit K F where lifts c t := (h c t).toLiftableCocone @@ -400,7 +402,7 @@ def createsColimitOfReflectsIso {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphi /-- If `F` reflects isomorphisms and we can lift a single colimit cocone to a colimit cocone, then `F` creates limits. Note that unlike `createsColimitOfReflectsIso`, to apply this result it is necessary to know that `K ⋙ F` actually has a colimit. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfReflectsIso' {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphisms] {c : Cocone (K ⋙ F)} (hc : IsColimit c) (h : LiftsToColimit K F c hc) : CreatesColimit K F := createsColimitOfReflectsIso fun _ t => @@ -410,7 +412,7 @@ def createsColimitOfReflectsIso' {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorph /-- If `F` reflects isomorphisms, and we already know that the colimit exists in the source and `F` preserves it, then `F` creates that colimit. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfReflectsIsomorphismsOfPreserves {K : J ⥤ C} {F : C ⥤ D} [F.ReflectsIsomorphisms] [HasColimit K] [PreservesColimit K F] : CreatesColimit K F := createsColimitOfReflectsIso' (isColimitOfPreserves F (colimit.isColimit _)) @@ -423,7 +425,7 @@ def createsColimitOfReflectsIsomorphismsOfPreserves {K : J ⥤ C} {F : C ⥤ D} When `F` is fully faithful, to show that `F` creates the colimit for `K` it suffices to exhibit a lift of a colimit cocone for `K ⋙ F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfFullyFaithfulOfLift' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] {l : Cocone (K ⋙ F)} (hl : IsColimit l) (c : Cocone K) (i : F.mapCocone c ≅ l) : CreatesColimit K F := @@ -436,7 +438,7 @@ def createsColimitOfFullyFaithfulOfLift' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F When `F` is fully faithful, and `HasColimit (K ⋙ F)`, to show that `F` creates the colimit for `K` it suffices to exhibit a lift of the chosen colimit cocone for `K ⋙ F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfFullyFaithfulOfLift {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] [HasColimit (K ⋙ F)] (c : Cocone K) (i : F.mapCocone c ≅ colimit.cocone (K ⋙ F)) : CreatesColimit K F := @@ -450,7 +452,7 @@ set_option backward.defeqAttrib.useBackward true in When `F` is fully faithful, to show that `F` creates the colimit for `K` it suffices to show that a colimit point is in the essential image of `F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfFullyFaithfulOfIso' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] {l : Cocone (K ⋙ F)} (hl : IsColimit l) (X : C) (i : F.obj X ≅ l.pt) : CreatesColimit K F := createsColimitOfFullyFaithfulOfLift' hl @@ -469,7 +471,7 @@ def createsColimitOfFullyFaithfulOfIso' {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F. When `F` is fully faithful, and `HasColimit (K ⋙ F)`, to show that `F` creates the colimit for `K` it suffices to show that the chosen colimit point is in the essential image of `F`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfFullyFaithfulOfIso {K : J ⥤ C} {F : C ⥤ D} [F.Full] [F.Faithful] [HasColimit (K ⋙ F)] (X : C) (i : F.obj X ≅ colimit (K ⋙ F)) : CreatesColimit K F := createsColimitOfFullyFaithfulOfIso' (colimit.isColimit _) X i @@ -498,7 +500,7 @@ instance (priority := 100) preservesColimits_of_createsColimits_and_hasColimits set_option backward.defeqAttrib.useBackward true in /-- Transfer creation of limits along a natural isomorphism in the diagram. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfIsoDiagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K₁ ≅ K₂) [CreatesLimit K₁ F] : CreatesLimit K₂ F := { reflectsLimit_of_iso_diagram F h with @@ -514,7 +516,7 @@ def createsLimitOfIsoDiagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K₁ ≅ K simp } } /-- If `F` creates the limit of `K` and `F ≅ G`, then `G` creates the limit of `K`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesLimit K F] : CreatesLimit K G where lifts c t := { liftedCone := liftLimit ((IsLimit.postcomposeInvEquiv (isoWhiskerLeft K h :) c).symm t) @@ -525,19 +527,19 @@ def createsLimitOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesLimit K F] : Crea toReflectsLimit := reflectsLimit_of_natIso _ h /-- If `F` creates limits of shape `J` and `F ≅ G`, then `G` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesLimitsOfShape J F] : CreatesLimitsOfShape J G where CreatesLimit := createsLimitOfNatIso h /-- If `F` creates limits and `F ≅ G`, then `G` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesLimitsOfSize.{w, w'} F] : CreatesLimitsOfSize.{w, w'} G where CreatesLimitsOfShape := createsLimitsOfShapeOfNatIso h set_option backward.defeqAttrib.useBackward true in /-- If `F` creates limits of shape `J` and `J ≌ J'`, then `F` creates limits of shape `J'`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfEquiv {J' : Type w₁} [Category.{w'₁} J'] (e : J ≌ J') (F : C ⥤ D) [CreatesLimitsOfShape J F] : CreatesLimitsOfShape J' F where CreatesLimit {K} := @@ -552,7 +554,7 @@ def createsLimitsOfShapeOfEquiv {J' : Type w₁} [Category.{w'₁} J'] (e : J set_option backward.defeqAttrib.useBackward true in /-- Transfer creation of colimits along a natural isomorphism in the diagram. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfIsoDiagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K₁ ≅ K₂) [CreatesColimit K₁ F] : CreatesColimit K₂ F := { reflectsColimit_of_iso_diagram F h with @@ -569,7 +571,7 @@ def createsColimitOfIsoDiagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K₁ ≅ simp } } /-- If `F` creates the colimit of `K` and `F ≅ G`, then `G` creates the colimit of `K`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesColimit K F] : CreatesColimit K G where lifts c t := { liftedCocone := liftColimit ((IsColimit.precomposeHomEquiv (isoWhiskerLeft K h :) c).symm t) @@ -580,19 +582,19 @@ def createsColimitOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesColimit K F] : toReflectsColimit := reflectsColimit_of_natIso _ h /-- If `F` creates colimits of shape `J` and `F ≅ G`, then `G` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesColimitsOfShape J F] : CreatesColimitsOfShape J G where CreatesColimit := createsColimitOfNatIso h /-- If `F` creates colimits and `F ≅ G`, then `G` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfNatIso {F G : C ⥤ D} (h : F ≅ G) [CreatesColimitsOfSize.{w, w'} F] : CreatesColimitsOfSize.{w, w'} G where CreatesColimitsOfShape := createsColimitsOfShapeOfNatIso h set_option backward.defeqAttrib.useBackward true in /-- If `F` creates colimits of shape `J` and `J ≌ J'`, then `F` creates colimits of shape `J'`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfEquiv {J' : Type w₁} [Category.{w'₁} J'] (e : J ≌ J') (F : C ⥤ D) [CreatesColimitsOfShape J F] : CreatesColimitsOfShape J' F where CreatesColimit {K} := diff --git a/Mathlib/CategoryTheory/Limits/Elements.lean b/Mathlib/CategoryTheory/Limits/Elements.lean index db7788ec4db95d..4648d35aba364c 100644 --- a/Mathlib/CategoryTheory/Limits/Elements.lean +++ b/Mathlib/CategoryTheory/Limits/Elements.lean @@ -84,6 +84,7 @@ lemma map_π_liftedConeElement (i : I) : (preservesLimitIso_inv_π A (F ⋙ π A) i) (liftedConeElement' F) simp [liftedConeElement, ← comp_apply] +set_option backward.isDefEq.respectTransparency.types false in /-- (implementation) The constructed limit cone. -/ @[simps] noncomputable def liftedCone : Cone F where @@ -92,6 +93,7 @@ noncomputable def liftedCone : Cone F where { app := fun i => ⟨limit.π (F ⋙ π A) i, by simpa using! map_π_liftedConeElement _ _⟩ naturality := fun i i' f => by ext; simpa using! (limit.w _ _).symm } +set_option backward.isDefEq.respectTransparency.types false in /-- (implementation) The constructed limit cone is a lift of the limit cone in `C`. -/ noncomputable def isValidLift : (π A).mapCone (liftedCone F) ≅ limit.cone (F ⋙ π A) := Iso.refl _ diff --git a/Mathlib/CategoryTheory/Limits/ExactFunctor.lean b/Mathlib/CategoryTheory/Limits/ExactFunctor.lean index 57581749c25f4e..bebaf0521a7691 100644 --- a/Mathlib/CategoryTheory/Limits/ExactFunctor.lean +++ b/Mathlib/CategoryTheory/Limits/ExactFunctor.lean @@ -234,6 +234,7 @@ section variable (C D E) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering a left exact functor by a left exact functor yields a left exact functor. -/ @[simps! obj_obj_obj obj_map map_app] @@ -243,6 +244,7 @@ def LeftExactFunctor.whiskeringLeft : (C ⥤ₗ D) ⥤ (D ⥤ₗ E) ⥤ (C ⥤ map {F G} η := { app H := ObjectProperty.homMk (((Functor.whiskeringLeft C D E).map η.hom).app H.obj) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering a left exact functor by a left exact functor yields a left exact functor. -/ @[simps! obj_obj_obj obj_map map_app] @@ -252,6 +254,7 @@ def LeftExactFunctor.whiskeringRight : (D ⥤ₗ E) ⥤ (C ⥤ₗ D) ⥤ (C ⥤ map {F G} η := { app H := ObjectProperty.homMk (((Functor.whiskeringRight C D E).map η.hom).app H.obj) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering a right exact functor by a right exact functor yields a right exact functor. -/ @[simps! obj_obj_obj obj_map map_app] @@ -261,6 +264,7 @@ def RightExactFunctor.whiskeringLeft : (C ⥤ᵣ D) ⥤ (D ⥤ᵣ E) ⥤ (C ⥤ map {F G} η := { app H := ObjectProperty.homMk (((Functor.whiskeringLeft C D E).map η.hom).app H.obj) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering a right exact functor by a right exact functor yields a right exact functor. -/ @[simps! obj_obj_obj obj_map map_app] @@ -270,6 +274,7 @@ def RightExactFunctor.whiskeringRight : (D ⥤ᵣ E) ⥤ (C ⥤ᵣ D) ⥤ (C ⥤ map {F G} η := { app H := ObjectProperty.homMk (((Functor.whiskeringRight C D E).map η.hom).app H.obj) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering an exact functor by an exact functor yields an exact functor. -/ @[simps! obj_obj_obj obj_map map_app] @@ -280,6 +285,7 @@ def ExactFunctor.whiskeringLeft : (C ⥤ₑ D) ⥤ (D ⥤ₑ E) ⥤ (C ⥤ₑ E) map {F G} η := { app H := ObjectProperty.homMk (((Functor.whiskeringLeft C D E).map η.hom).app H.obj) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Whiskering an exact functor by an exact functor yields an exact functor. -/ @[simps! obj_obj_obj obj_map map_app] diff --git a/Mathlib/CategoryTheory/Limits/Final.lean b/Mathlib/CategoryTheory/Limits/Final.lean index 959c0ee15b23d7..8ddcf864279dff 100644 --- a/Mathlib/CategoryTheory/Limits/Final.lean +++ b/Mathlib/CategoryTheory/Limits/Final.lean @@ -333,6 +333,7 @@ instance (priority := 100) compCreatesColimit {B : Type u₄} [Category.{v₄} B let i := liftedColimitMapsToOriginal ((isColimitExtendCoconeEquiv F (G := G ⋙ H) _).symm hc) exact (Cocone.whiskering F).mapIso i ≪≫ ((coconesEquiv F (G ⋙ H)).unitIso.app _).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance colimit_pre_isIso [HasColimit G] : IsIso (colimit.pre G F) := by simp only [colimit.pre_eq (colimitCoconeComp F (getColimitCocone G)) (getColimitCocone G), @@ -393,6 +394,7 @@ lemma hasColimit_comp_iff : HasColimit (F ⋙ G) ↔ HasColimit G := ⟨fun _ ↦ Functor.Final.hasColimit_of_comp F, fun _ ↦ inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem preservesColimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} [PreservesColimit (F ⋙ G) H] : PreservesColimit G H where @@ -401,6 +403,7 @@ theorem preservesColimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ let hc' := isColimitOfPreserves H ((isColimitWhiskerEquiv F _).symm hc) exact IsColimit.ofIsoColimit hc' (Cocone.ext (Iso.refl _) (by simp)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem reflectsColimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} [ReflectsColimit (F ⋙ G) H] : ReflectsColimit G H where @@ -411,7 +414,7 @@ theorem reflectsColimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B set_option backward.defeqAttrib.useBackward true in /-- If `F` is final and `F ⋙ G` creates colimits of `H`, then so does `G`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfComp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} [CreatesColimit (F ⋙ G) H] : CreatesColimit G H where reflects := (reflectsColimit_of_comp F).reflects @@ -438,7 +441,7 @@ theorem reflectsColimitsOfShape_of_final {B : Type u₄} [Category.{v₄} B] (H include F in /-- If `H` creates colimits of shape `C` and `F : C ⥤ D` is final, then `H` creates colimits of shape `D`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfFinal {B : Type u₄} [Category.{v₄} B] (H : E ⥤ B) [CreatesColimitsOfShape C H] : CreatesColimitsOfShape D H where CreatesColimit := createsColimitOfComp F @@ -698,6 +701,7 @@ instance (priority := 100) compCreatesLimit {B : Type u₄} [Category.{v₄} B] let i := liftedLimitMapsToOriginal ((isLimitExtendConeEquiv F (G := G ⋙ H) _).symm hc) exact (Cone.whiskering F).mapIso i ≪≫ ((conesEquiv F (G ⋙ H)).unitIso.app _).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance limit_pre_isIso [HasLimit G] : IsIso (limit.pre G F) := by rw [limit.pre_eq (limitConeComp F (getLimitCone G)) (getLimitCone G)] @@ -747,6 +751,7 @@ lemma hasLimit_comp_iff : HasLimit (F ⋙ G) ↔ HasLimit G := ⟨fun _ ↦ Functor.Initial.hasLimit_of_comp F, fun _ ↦ inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem preservesLimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} [PreservesLimit (F ⋙ G) H] : PreservesLimit G H where @@ -755,6 +760,7 @@ theorem preservesLimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} let hc' := isLimitOfPreserves H ((isLimitWhiskerEquiv F _).symm hc) exact IsLimit.ofIsoLimit hc' (Cone.ext (Iso.refl _) (by simp)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem reflectsLimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} [ReflectsLimit (F ⋙ G) H] : ReflectsLimit G H where @@ -765,7 +771,7 @@ theorem reflectsLimit_of_comp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} set_option backward.defeqAttrib.useBackward true in /-- If `F` is initial and `F ⋙ G` creates limits of `H`, then so does `G`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfComp {B : Type u₄} [Category.{v₄} B] {H : E ⥤ B} [CreatesLimit (F ⋙ G) H] : CreatesLimit G H where reflects := (reflectsLimit_of_comp F).reflects @@ -792,7 +798,7 @@ theorem reflectsLimitsOfShape_of_initial {B : Type u₄} [Category.{v₄} B] (H include F in /-- If `H` creates limits of shape `C` and `F : C ⥤ D` is initial, then `H` creates limits of shape `D`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfInitial {B : Type u₄} [Category.{v₄} B] (H : E ⥤ B) [CreatesLimitsOfShape C H] : CreatesLimitsOfShape D H where CreatesLimit := createsLimitOfComp F @@ -1188,6 +1194,7 @@ end Prod namespace ObjectProperty +set_option backward.isDefEq.respectTransparency.types false in /-- For the full subcategory induced by an object property `P` on `C`, to show initiality of the inclusion functor it is enough to consider arrows to objects outside of the subcategory. -/ theorem initial_ι {C : Type u₁} [Category.{v₁} C] (P : ObjectProperty C) @@ -1207,6 +1214,7 @@ section Restriction variable {J C : Type*} [Category* J] [Category* C] {D : J ⥤ C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `Over j ⥤ J` is initial, restricting a limit cone to the diagram above `j`, preserves the limit. -/ @@ -1222,6 +1230,7 @@ noncomputable def Limits.IsLimit.overPost {c : Cone D} (hc : IsLimit c) (j : J) · exact NatIso.ofComponents (fun k ↦ CategoryTheory.Over.isoMk (Iso.refl _)) · exact Cone.ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `Over j ⥤ J` is final, restricting a colimit cocone to the diagram below `j`, preserves the limit. -/ diff --git a/Mathlib/CategoryTheory/Limits/FintypeCat.lean b/Mathlib/CategoryTheory/Limits/FintypeCat.lean index 18cea9e69b6286..5442e28a9af81b 100644 --- a/Mathlib/CategoryTheory/Limits/FintypeCat.lean +++ b/Mathlib/CategoryTheory/Limits/FintypeCat.lean @@ -81,6 +81,7 @@ noncomputable def productEquiv {ι : Type*} [Finite ι] (X : ι → FintypeCat.{ let e : (∀ i, X i) ≃ Shrink.{u} (∀ i, X i) := equivShrink _ (equivEquivIso.symm is₁).trans ((equivEquivIso.symm is₂).trans e.symm) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma productEquiv_apply {ι : Type*} [Finite ι] (X : ι → FintypeCat.{u}) (x : (∏ᶜ X : FintypeCat)) (i : ι) : productEquiv X x i = Pi.π X i x := by diff --git a/Mathlib/CategoryTheory/Limits/FormalCoproducts/Basic.lean b/Mathlib/CategoryTheory/Limits/FormalCoproducts/Basic.lean index 6e237d4593500a..1670e1f8a69d08 100644 --- a/Mathlib/CategoryTheory/Limits/FormalCoproducts/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/FormalCoproducts/Basic.lean @@ -232,6 +232,7 @@ lemma fromIncl_comp_cofanPtIsoSelf_inv (i : X.I) : ∐ X.toFun ≅ X := coproductIsoCofanPt _ _ ≪≫ cofanPtIsoSelf X +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma ι_comp_coproductIsoSelf_hom (i : X.I) : Sigma.ι _ i ≫ (coproductIsoSelf X).hom = .fromIncl i (𝟙 (X.obj i)) := by simp [coproductIsoSelf] diff --git a/Mathlib/CategoryTheory/Limits/FormalCoproducts/ExtraDegeneracy.lean b/Mathlib/CategoryTheory/Limits/FormalCoproducts/ExtraDegeneracy.lean index a16d707d3c7fac..da98aa840ed219 100644 --- a/Mathlib/CategoryTheory/Limits/FormalCoproducts/ExtraDegeneracy.lean +++ b/Mathlib/CategoryTheory/Limits/FormalCoproducts/ExtraDegeneracy.lean @@ -61,6 +61,7 @@ lemma cechIsoCechNerveApp_hom_π (n : SimplexCategoryᵒᵖ) (i : ToType n.unop) WidePullback.π (fun _ ↦ (isTerminalIncl T hT).from U) i = U.powerπ i := IsLimit.conePointUniqueUpToIso_hom_comp _ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma cechIsoCechNerveApp_inv_π (n : SimplexCategoryᵒᵖ) (i : ToType n.unop) : (U.cechIsoCechNerveApp hT n).inv ≫ U.powerπ i = diff --git a/Mathlib/CategoryTheory/Limits/Fubini.lean b/Mathlib/CategoryTheory/Limits/Fubini.lean index 3e2809883fd7ec..fb601efcf7518d 100644 --- a/Mathlib/CategoryTheory/Limits/Fubini.lean +++ b/Mathlib/CategoryTheory/Limits/Fubini.lean @@ -526,6 +526,7 @@ theorem colimitUncurryIsoColimitCompColim_ι_ι_inv {j} {k} : IsColimit.uniqueUpToIso] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp, reassoc] theorem colimitUncurryIsoColimitCompColim_ι_hom {j} {k} : diff --git a/Mathlib/CategoryTheory/Limits/FullSubcategory.lean b/Mathlib/CategoryTheory/Limits/FullSubcategory.lean index 8d1bf11de6ae6f..9711f59107d5e7 100644 --- a/Mathlib/CategoryTheory/Limits/FullSubcategory.lean +++ b/Mathlib/CategoryTheory/Limits/FullSubcategory.lean @@ -34,7 +34,7 @@ variable {J : Type w} [Category.{w'} J] {C : Type u} [Category.{v} C] {P : Objec /-- If a `J`-shaped diagram in `FullSubcategory P` has a limit cone in `C` whose cone point lives in the full subcategory, then this defines a limit in the full subcategory. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitFullSubcategoryInclusion' (F : J ⥤ P.FullSubcategory) {c : Cone (F ⋙ P.ι)} (hc : IsLimit c) (h : P c.pt) : CreatesLimit F P.ι := @@ -42,7 +42,7 @@ def createsLimitFullSubcategoryInclusion' (F : J ⥤ P.FullSubcategory) /-- If a `J`-shaped diagram in `FullSubcategory P` has a limit in `C` whose cone point lives in the full subcategory, then this defines a limit in the full subcategory. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitFullSubcategoryInclusion (F : J ⥤ P.FullSubcategory) [HasLimit (F ⋙ P.ι)] (h : P (limit (F ⋙ P.ι))) : CreatesLimit F P.ι := @@ -50,7 +50,7 @@ def createsLimitFullSubcategoryInclusion (F : J ⥤ P.FullSubcategory) /-- If a `J`-shaped diagram in `FullSubcategory P` has a colimit cocone in `C` whose cocone point lives in the full subcategory, then this defines a colimit in the full subcategory. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitFullSubcategoryInclusion' (F : J ⥤ P.FullSubcategory) {c : Cocone (F ⋙ P.ι)} (hc : IsColimit c) (h : P c.pt) : CreatesColimit F P.ι := @@ -58,7 +58,7 @@ def createsColimitFullSubcategoryInclusion' (F : J ⥤ P.FullSubcategory) /-- If a `J`-shaped diagram in `FullSubcategory P` has a colimit in `C` whose cocone point lives in the full subcategory, then this defines a colimit in the full subcategory. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitFullSubcategoryInclusion (F : J ⥤ P.FullSubcategory) [HasColimit (F ⋙ P.ι)] (h : P (colimit (F ⋙ P.ι))) : @@ -68,7 +68,7 @@ def createsColimitFullSubcategoryInclusion (F : J ⥤ P.FullSubcategory) variable (P J) /-- If `P` is closed under limits of shape `J`, then the inclusion creates such limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitFullSubcategoryInclusionOfClosed [P.IsClosedUnderLimitsOfShape J] (F : J ⥤ P.FullSubcategory) [HasLimit (F ⋙ P.ι)] : CreatesLimit F P.ι := @@ -90,7 +90,7 @@ instance hasLimitsOfShape_of_closedUnderLimits [P.IsClosedUnderLimitsOfShape J] { has_limit := fun F => hasLimit_of_closedUnderLimits J P F } /-- If `P` is closed under colimits of shape `J`, then the inclusion creates such colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitFullSubcategoryInclusionOfClosed [P.IsClosedUnderColimitsOfShape J] (F : J ⥤ P.FullSubcategory) [HasColimit (F ⋙ P.ι)] : CreatesColimit F P.ι := diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean index 0b2f7286adab7e..a2508b593e8003 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Basic.lean @@ -85,12 +85,14 @@ def combineCones (F : J ⥤ K ⥤ C) (c : ∀ k : K, LimitCone (F.flip.obj k)) : { app := fun j => { app := fun k => (c k).cone.π.app j } naturality := fun j₁ j₂ g => by ext k; exact (c k).cone.π.naturality g } +set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- The stitched together cones each project down to the original given cones (up to iso). -/ def evaluateCombinedCones (F : J ⥤ K ⥤ C) (c : ∀ k : K, LimitCone (F.flip.obj k)) (k : K) : ((evaluation K C).obj k).mapCone (combineCones F c) ≅ (c k).cone := Cone.ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency false in /-- Stitching together limiting cones gives a limiting cone. -/ def combinedIsLimit (F : J ⥤ K ⥤ C) (c : ∀ k : K, LimitCone (F.flip.obj k)) : IsLimit (combineCones F c) := @@ -140,12 +142,14 @@ def combineCocones (F : J ⥤ K ⥤ C) (c : ∀ k : K, ColimitCocone (F.flip.obj { app := fun j => { app := fun k => (c k).cocone.ι.app j } naturality := fun j₁ j₂ g => by ext k; exact (c k).cocone.ι.naturality g } +set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- The stitched together cocones each project down to the original given cocones (up to iso). -/ def evaluateCombinedCocones (F : J ⥤ K ⥤ C) (c : ∀ k : K, ColimitCocone (F.flip.obj k)) (k : K) : ((evaluation K C).obj k).mapCocone (combineCocones F c) ≅ (c k).cocone := Cocone.ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency false in /-- Stitching together colimiting cocones gives a colimiting cocone. -/ def combinedIsColimit (F : J ⥤ K ⥤ C) (c : ∀ k : K, ColimitCocone (F.flip.obj k)) : IsColimit (combineCocones F c) := @@ -170,6 +174,7 @@ noncomputable def pointwiseCocone [HasColimitsOfShape J C] (F : J ⥤ K ⥤ C) : change (F.flip.obj x).map f ≫ _ = _ rw [colimit.w] } +set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in /-- `pointwiseCocone` is indeed a colimit cocone. -/ noncomputable def pointwiseIsColimit [HasColimitsOfShape J C] (F : J ⥤ K ⥤ C) : @@ -291,6 +296,7 @@ theorem limitCompWhiskeringLeftIsoCompLimit_hom_whiskerLeft_π (F : J ⥤ K ⥤ ext d simp [limitCompWhiskeringLeftIsoCompLimit] +set_option backward.isDefEq.respectTransparency false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] theorem limitCompWhiskeringLeftIsoCompLimit_inv_π (F : J ⥤ K ⥤ C) (G : D ⥤ K) diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/BinaryBiproducts.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/BinaryBiproducts.lean index ec966799567d7c..13fe145fc458bf 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/BinaryBiproducts.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/BinaryBiproducts.lean @@ -37,6 +37,7 @@ def pointwiseBinaryBicone : BinaryBicone F G where inl := { app X := biprod.inl } inr := { app X := biprod.inr } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The bicone associated with `F` and `G` is a bilimit bicone. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Images.lean index 395dc3c8619b4a..6f6b0d91c4f3dc 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Images.lean @@ -32,6 +32,7 @@ def monoFactorisation {F G : C ⥤ Type u} (f : F ⟶ G) : MonoFactorisation f w m := (Subfunctor.range f).ι e := Subfunctor.toRange f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The image of a natural transformation between type-valued functors satisfies the universal property of images -/ diff --git a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean index 9e5e5613067e7f..5bb966e41855bd 100644 --- a/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/FunctorCategory/Shapes/Pullbacks.lean @@ -42,6 +42,7 @@ def PullbackCone.combine (f : F ⟶ H) (g : G ⟶ H) (c : ∀ X, PullbackCone (f { app X := (c X).snd } (by ext; simp [(c _).condition]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The pullback cone `combinePullbackCones` is limiting. diff --git a/Mathlib/CategoryTheory/Limits/HasLimits.lean b/Mathlib/CategoryTheory/Limits/HasLimits.lean index 32b9ff4f07b696..161e7a00084772 100644 --- a/Mathlib/CategoryTheory/Limits/HasLimits.lean +++ b/Mathlib/CategoryTheory/Limits/HasLimits.lean @@ -137,6 +137,7 @@ def limit.cone (F : J ⥤ C) [HasLimit F] : Cone F := (getLimitCone F).cone /-- An arbitrary choice of limit object of a functor. -/ +@[implicit_reducible] def limit (F : J ⥤ C) [HasLimit F] := (limit.cone F).pt @@ -476,7 +477,7 @@ variable [HasLimitsOfShape J C] section /-- `limit F` is functorial in `F`, when `C` has all limits of shape `J`. -/ -@[simps] +@[simps, implicit_reducible] def lim : (J ⥤ C) ⥤ C where obj F := limit F map α := limMap α @@ -522,6 +523,7 @@ theorem limit.map_post {D : Type u'} [Category.{v'} D] [HasLimitsOfShape J D] (H ext simp only [whiskerRight_app, limMap_π, assoc, limit.post_π_assoc, limit.post_π, ← H.map_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The isomorphism between morphisms from `W` to the cone point of the limit cone for `F` @@ -701,6 +703,7 @@ def colimit.cocone (F : J ⥤ C) [HasColimit F] : Cocone F := (getColimitCocone F).cocone /-- An arbitrary choice of colimit object of a functor. -/ +@[implicit_reducible] def colimit (F : J ⥤ C) [HasColimit F] := (colimit.cocone F).pt @@ -1132,6 +1135,7 @@ theorem colimit.map_post {D : Type u'} [Category.{v'} D] [HasColimitsOfShape J D rw [← assoc, colimit.ι_map, assoc, colimit.ι_post] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The isomorphism between morphisms from the cone point of the colimit cocone for `F` to `W` @@ -1215,6 +1219,7 @@ end Colimit section Opposite +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `t : Cone F` is a limit cone, then `t.op : Cocone F.op` is a colimit cocone. -/ @@ -1230,6 +1235,7 @@ def IsLimit.op {t : Cone F} (P : IsLimit t) : IsColimit t.op where rw [← w] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `t : Cocone F` is a colimit cocone, then `t.op : Cone F.op` is a limit cone. -/ diff --git a/Mathlib/CategoryTheory/Limits/IndYoneda.lean b/Mathlib/CategoryTheory/Limits/IndYoneda.lean index 62e7486874499a..4cafd6af6dbe9f 100644 --- a/Mathlib/CategoryTheory/Limits/IndYoneda.lean +++ b/Mathlib/CategoryTheory/Limits/IndYoneda.lean @@ -71,6 +71,7 @@ noncomputable def colimitHomIsoLimitYoneda (colimit F ⟶ A) ≅ limit (F.op ⋙ yoneda.obj A) := (coyonedaOpColimitIsoLimitCoyoneda F).app A ≪≫ limitObjIsoLimitCompEvaluation _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma colimitHomIsoLimitYoneda_hom_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂)] (A : C) (i : I) : (colimitHomIsoLimitYoneda F A).hom ≫ limit.π (F.op ⋙ yoneda.obj A) ⟨i⟩ = @@ -80,6 +81,7 @@ lemma colimitHomIsoLimitYoneda_hom_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂) change ((coyonedaOpColimitIsoLimitCoyoneda F).hom ≫ _).app A = _ rw [coyonedaOpColimitIsoLimitCoyoneda_hom_comp_π, Functor.flip_map_app] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma colimitHomIsoLimitYoneda_inv_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂)] (A : C) (i : I) : @@ -121,6 +123,7 @@ noncomputable def colimitHomIsoLimitYoneda' [HasLimitsOfShape I (Type u₂)] (A (colimit F ⟶ A) ≅ limit (F.rightOp ⋙ yoneda.obj A) := (coyonedaOpColimitIsoLimitCoyoneda' F).app A ≪≫ limitObjIsoLimitCompEvaluation _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma colimitHomIsoLimitYoneda'_hom_comp_π [HasLimitsOfShape I (Type u₂)] (A : C) (i : I) : (colimitHomIsoLimitYoneda' F A).hom ≫ limit.π (F.rightOp ⋙ yoneda.obj A) i = @@ -131,6 +134,7 @@ lemma colimitHomIsoLimitYoneda'_hom_comp_π [HasLimitsOfShape I (Type u₂)] (A change ((coyonedaOpColimitIsoLimitCoyoneda' F).hom ≫ _).app A = _ rw [coyonedaOpColimitIsoLimitCoyoneda'_hom_comp_π, Functor.flip_map_app] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma colimitHomIsoLimitYoneda'_inv_comp_π [HasLimitsOfShape I (Type u₂)] (A : C) (i : I) : @@ -154,6 +158,7 @@ noncomputable def colimitCoyonedaHomIsoLimit : colimitHomIsoLimitYoneda _ F ≪≫ HasLimit.isoOfNatIso (Functor.isoWhiskerLeft (D ⋙ Prod.sectL C F) (coyonedaLemma C)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma colimitCoyonedaHomIsoLimit_π_apply (f : colimit (D.rightOp ⋙ coyoneda) ⟶ F) (i : I) : dsimp% limit.π (D ⋙ F ⋙ uliftFunctor.{u₁}) (op i) ((colimitCoyonedaHomIsoLimit D F).hom f) = @@ -207,6 +212,7 @@ noncomputable def colimitYonedaHomIsoLimit : colimitHomIsoLimitYoneda _ _ ≪≫ HasLimit.isoOfNatIso (Functor.isoWhiskerLeft (D ⋙ Prod.sectL _ _) (yonedaLemma C)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma colimitYonedaHomIsoLimit_π_apply (f : colimit (D.unop ⋙ yoneda) ⟶ F) (i : Iᵒᵖ) : dsimp% limit.π (D ⋙ F ⋙ uliftFunctor.{u₁}) i ((colimitYonedaHomIsoLimit D F).hom f) = @@ -258,6 +264,7 @@ noncomputable def colimitCoyonedaHomIsoLimit' : colimitHomIsoLimitYoneda' _ F ≪≫ HasLimit.isoOfNatIso (Functor.isoWhiskerLeft (D ⋙ Prod.sectL C F) (coyonedaLemma C)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma colimitCoyonedaHomIsoLimit'_π_apply (f : colimit (D.op ⋙ coyoneda) ⟶ F) (i : I) : dsimp% limit.π (D ⋙ F ⋙ uliftFunctor.{u₁}) i ((colimitCoyonedaHomIsoLimit' D F).hom f) = @@ -308,6 +315,7 @@ noncomputable def colimitYonedaHomIsoLimit' : colimitHomIsoLimitYoneda' _ F ≪≫ HasLimit.isoOfNatIso (Functor.isoWhiskerLeft (D ⋙ Prod.sectL _ _) (yonedaLemma C)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma colimitYonedaHomIsoLimit'_π_apply (f : colimit (D.leftOp ⋙ yoneda) ⟶ F) (i : I) : dsimp% limit.π (D ⋙ F ⋙ uliftFunctor.{u₁}) i ((colimitYonedaHomIsoLimit' D F).hom f) = diff --git a/Mathlib/CategoryTheory/Limits/Indization/Category.lean b/Mathlib/CategoryTheory/Limits/Indization/Category.lean index 8d05c3bbbb0845..24b2e9fa04ed57 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/Category.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/Category.lean @@ -284,6 +284,7 @@ instance [HasColimitsOfShape WalkingParallelPair C] : instance [HasFiniteColimits C] : HasColimits (Ind C) := has_colimits_of_hasCoequalizers_and_coproducts +set_option backward.isDefEq.respectTransparency.types false in /-- A way to understand morphisms in `Ind C`: every morphism is induced by a natural transformation of diagrams. -/ theorem Ind.exists_nonempty_arrow_mk_iso_ind_lim {A B : Ind C} {f : A ⟶ B} : diff --git a/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean b/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean index 1b9a19d571a67a..954da6cfcfe329 100644 --- a/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean +++ b/Mathlib/CategoryTheory/Limits/Indization/LocallySmall.lean @@ -61,7 +61,7 @@ theorem colimitYonedaHomEquiv_π_apply (η : colimit (F ⋙ yoneda) ⟶ G) (i : dsimp% limit.π (F.op ⋙ G) i (colimitYonedaHomEquiv F G η) = η.app (op (F.obj i.unop)) ((colimit.ι (F ⋙ yoneda) i.unop).app _ (𝟙 _)) := by simp only [colimitYonedaHomEquiv, Iso.toEquiv, uliftFunctor_obj, - Iso.trans_def, Iso.trans_assoc, Iso.trans_hom, Iso.symm_hom, Iso.trans_inv, Iso.symm_inv, + Iso.trans_def, Iso.trans_assoc, Iso.trans_hom, Iso.trans_inv, Category.assoc, Equiv.symm_trans_apply, Equiv.symm_symm, Equiv.coe_fn_mk, comp_apply, Equiv.ulift_apply] have (a : limit ((F.op ⋙ G) ⋙ uliftFunctor.{u, v})) := congrArg ULift.down @@ -70,7 +70,6 @@ theorem colimitYonedaHomEquiv_π_apply (η : colimit (F ⋙ yoneda) ⟶ G) (i : rw [HasLimit.isoOfNatIso_hom_π_apply] dsimp erw [colimitYonedaHomIsoLimitOp_π_apply] - rfl instance : Small.{v} (colimit (F ⋙ yoneda) ⟶ G) where equiv_small := ⟨_, ⟨colimitYonedaHomEquiv F G⟩⟩ diff --git a/Mathlib/CategoryTheory/Limits/IsLimit.lean b/Mathlib/CategoryTheory/Limits/IsLimit.lean index 01979ff1b19b62..e0f666ace44f51 100644 --- a/Mathlib/CategoryTheory/Limits/IsLimit.lean +++ b/Mathlib/CategoryTheory/Limits/IsLimit.lean @@ -49,6 +49,32 @@ variable {J : Type u₁} [Category.{v₁} J] {K : Type u₂} [Category.{v₂} K] variable {C : Type u₃} [Category.{v₃} C] variable {F : J ⥤ C} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Cocone.equivalenceOfReindexing + Cocone.extend + Cocone.functoriality + Cocone.precompose + Cocone.precomposeEquivalence + Cocone.whisker + Cocone.whiskering + Cocone.whiskeringEquivalence + Cone.equivalenceOfReindexing + Cone.extend + Cone.functoriality + Cone.postcompose + Cone.postcomposeEquivalence + Cone.whisker + Cone.whiskering + Cone.whiskeringEquivalence + Equivalence.symm + Equivalence.trans + Functor.cocones + Functor.cones + mapCocone + mapCone + uliftFunctor + /-- A cone `t` on `F` is a limit cone if each cone on `F` admits a unique cone morphism to `t`. -/ @[stacks 002E] @@ -70,6 +96,7 @@ instance subsingleton {t : Cone F} : Subsingleton (IsLimit t) := /-- Given a natural transformation `α : F ⟶ G`, we give a morphism from the cone point of any cone over `F` to the cone point of a limit cone over `G`. -/ +@[implicit_reducible] def map {F G : J ⥤ C} (s : Cone F) {t : Cone G} (P : IsLimit t) (α : F ⟶ G) : s.pt ⟶ t.pt := P.lift ((Cone.postcompose α).obj s) @@ -141,11 +168,13 @@ theorem conePointUniqueUpToIso_inv_comp {s t : Cone F} (P : IsLimit s) (Q : IsLi (conePointUniqueUpToIso P Q).inv ≫ s.π.app j = t.π.app j := (uniqueUpToIso P Q).inv.w _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem lift_comp_conePointUniqueUpToIso_hom {r s t : Cone F} (P : IsLimit s) (Q : IsLimit t) : P.lift r ≫ (conePointUniqueUpToIso P Q).hom = Q.lift r := Q.uniq _ _ (by simp) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem lift_comp_conePointUniqueUpToIso_inv {r s t : Cone F} (P : IsLimit s) (Q : IsLimit t) : Q.lift r ≫ (conePointUniqueUpToIso P Q).inv = P.lift r := @@ -190,11 +219,13 @@ def ofPointIso {r t : Cone F} (P : IsLimit r) [i : IsIso (P.lift t)] : IsLimit t variable {t : Cone F} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem hom_lift (h : IsLimit t) {W : C} (m : W ⟶ t.pt) : m = h.lift { pt := W, π := { app := fun b => m ≫ t.π.app b } } := h.uniq { pt := W, π := { app := fun b => m ≫ t.π.app b } } m fun _ => rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Two morphisms into a limit are equal if their compositions with each cone morphism are equal. -/ theorem hom_ext (h : IsLimit t) {W : C} {f f' : W ⟶ t.pt} @@ -202,6 +233,7 @@ theorem hom_ext (h : IsLimit t) {W : C} {f f' : W ⟶ t.pt} f = f' := by rw [h.hom_lift f, h.hom_lift f']; congr; exact funext w +set_option backward.isDefEq.respectTransparency.types false in lemma nonempty_isLimit_iff_isIso_lift {s t : Cone F} (hs : IsLimit s) : Nonempty (IsLimit t) ↔ IsIso (hs.lift t) := ⟨fun ⟨ht⟩ ↦ ⟨ht.lift s, ht.hom_ext (by simp), hs.hom_ext (by simp)⟩, fun h ↦ ⟨hs.ofPointIso⟩⟩ @@ -261,7 +293,6 @@ def equivOfNatIsoOfIso {F G : J ⥤ C} (α : F ≅ G) (c : Cone F) (d : Cone G) (w : (Cone.postcompose α.hom).obj c ≅ d) : IsLimit c ≃ IsLimit d := (postcomposeHomEquiv α _).symm.trans (equivIsoLimit w) -set_option backward.defeqAttrib.useBackward true in /-- The cone points of two limit cones for naturally isomorphic functors are themselves isomorphic. -/ @@ -283,14 +314,12 @@ theorem conePointsIsoOfNatIso_inv_comp {F G : J ⥤ C} {s : Cone F} {t : Cone G} (Q : IsLimit t) (w : F ≅ G) (j : J) : (conePointsIsoOfNatIso P Q w).inv ≫ s.π.app j = t.π.app j ≫ w.inv.app j := by simp -set_option backward.defeqAttrib.useBackward true in @[reassoc] theorem lift_comp_conePointsIsoOfNatIso_hom {F G : J ⥤ C} {r s : Cone F} {t : Cone G} (P : IsLimit s) (Q : IsLimit t) (w : F ≅ G) : P.lift r ≫ (conePointsIsoOfNatIso P Q w).hom = Q.map r w.hom := Q.hom_ext (by simp) -set_option backward.defeqAttrib.useBackward true in @[reassoc] theorem lift_comp_conePointsIsoOfNatIso_inv {F G : J ⥤ C} {r s : Cone G} {t : Cone F} (P : IsLimit t) (Q : IsLimit s) (w : F ≅ G) : @@ -375,6 +404,7 @@ def homEquiv (h : IsLimit t) {W : C} : (W ⟶ t.pt) ≃ ((Functor.const J).obj W left_inv f := h.hom_ext (by simp) right_inv π := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma homEquiv_symm_π_app (h : IsLimit t) {W : C} (f : (const J).obj W ⟶ F) (j : J) : @@ -457,6 +487,7 @@ variable {X : C} (h : F.cones.RepresentableBy X) /-- If `F.cones` is represented by `X`, each morphism `f : Y ⟶ X` gives a cone with cone point `Y`. -/ +@[local implicit_reducible] def coneOfHom {Y : C} (f : Y ⟶ X) : Cone F where pt := Y π := h.homEquiv f @@ -480,6 +511,7 @@ theorem homOfCone_coneOfHom {Y : C} (f : Y ⟶ X) : homOfCone h (coneOfHom h f) /-- If `F.cones` is represented by `X`, the cone corresponding to the identity morphism on `X` will be a limit cone. -/ +@[local implicit_reducible] def limitCone : Cone F := coneOfHom h (𝟙 X) @@ -504,6 +536,7 @@ section open OfNatIso +set_option backward.isDefEq.respectTransparency.types false in /-- If `F.cones` is representable, then the cone corresponding to the identity morphism on the representing object is a limit cone. -/ @@ -966,6 +999,7 @@ variable {X : C} (h : F.cocones.CorepresentableBy X) /-- If `F.cocones` is corepresented by `X`, each morphism `f : X ⟶ Y` gives a cocone with cone point `Y`. -/ +@[local implicit_reducible] def coconeOfHom {Y : C} (f : X ⟶ Y) : Cocone F where pt := Y ι := h.homEquiv f @@ -989,6 +1023,7 @@ theorem homOfCocone_coconeOfHom {Y : C} (f : X ⟶ Y) : homOfCocone h (coconeOfH /-- If `F.cocones` is corepresented by `X`, the cocone corresponding to the identity morphism on `X` will be a colimit cocone. -/ +@[local implicit_reducible] def colimitCocone : Cocone F := coconeOfHom h (𝟙 X) @@ -1013,6 +1048,7 @@ section open OfNatIso +set_option backward.isDefEq.respectTransparency.types false in /-- If `F.cocones` is corepresentable, then the cocone corresponding to the identity morphism on the representing object is a colimit cocone. -/ diff --git a/Mathlib/CategoryTheory/Limits/MonoCoprod.lean b/Mathlib/CategoryTheory/Limits/MonoCoprod.lean index 3cf2f524ae1b5e..d4f67205336ba8 100644 --- a/Mathlib/CategoryTheory/Limits/MonoCoprod.lean +++ b/Mathlib/CategoryTheory/Limits/MonoCoprod.lean @@ -214,6 +214,7 @@ section variable [MonoCoprod C] {I : Type*} (X : I → C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma mono_inj (c : Cofan X) (h : IsColimit c) (i : I) [HasCoproduct (fun (k : ((Set.range (fun _ : Unit ↦ i))ᶜ : Set I)) => X k.1)] : diff --git a/Mathlib/CategoryTheory/Limits/MorphismProperty.lean b/Mathlib/CategoryTheory/Limits/MorphismProperty.lean index ac7d181aaf9671..79c0c2a53981b5 100644 --- a/Mathlib/CategoryTheory/Limits/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/Limits/MorphismProperty.lean @@ -28,7 +28,7 @@ variable (D : J ⥤ P.Comma L R ⊤ ⊤) /-- If `P` is closed under limits of shape `J` in `Comma L R`, then when `D` has a limit in `Comma L R`, the forgetful functor creates this limit. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def forgetCreatesLimitOfClosed [(P.commaObj L R).IsClosedUnderLimitsOfShape J] [HasLimit (D ⋙ forget L R P ⊤ ⊤)] : @@ -40,7 +40,7 @@ noncomputable def forgetCreatesLimitOfClosed /-- If `Comma L R` has limits of shape `J` and `Comma L R` is closed under limits of shape `J`, then `forget L R P ⊤ ⊤` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def forgetCreatesLimitsOfShapeOfClosed [HasLimitsOfShape J (Comma L R)] [ObjectProperty.IsClosedUnderLimitsOfShape (P.commaObj L R) J] : CreatesLimitsOfShape J (forget L R P ⊤ ⊤) where @@ -60,7 +60,7 @@ instance hasLimitsOfShape_of_closedUnderLimitsOfShape [HasLimitsOfShape J (Comma /-- If `P` is closed under colimits of shape `J` in `Comma L R`, then when `D` has a colimit in `Comma L R`, the forgetful functor creates this colimit. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def forgetCreatesColimitOfClosed [(P.commaObj L R).IsClosedUnderColimitsOfShape J] [HasColimit (D ⋙ forget L R P ⊤ ⊤)] : @@ -72,7 +72,7 @@ noncomputable def forgetCreatesColimitOfClosed variable (J) in /-- If `Comma L R` has colimits of shape `J` and `Comma L R` is closed under colimits of shape `J`, then `forget L R P ⊤ ⊤` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def forgetCreatesColimitsOfShapeOfClosed [HasColimitsOfShape J (Comma L R)] [(P.commaObj L R).IsClosedUnderColimitsOfShape J] : CreatesColimitsOfShape J (forget L R P ⊤ ⊤) where @@ -264,6 +264,7 @@ noncomputable instance [P.ContainsIdentities] [P.RespectsIso] : · exact inferInstanceAs (HasLimitsOfShape _ (Over X)) · apply Over.closedUnderLimitsOfShape_discrete_empty _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {X} in instance [P.ContainsIdentities] (Y : P.Over ⊤ X) : diff --git a/Mathlib/CategoryTheory/Limits/Over.lean b/Mathlib/CategoryTheory/Limits/Over.lean index ebf513ada46641..c00d072a5fd721 100644 --- a/Mathlib/CategoryTheory/Limits/Over.lean +++ b/Mathlib/CategoryTheory/Limits/Over.lean @@ -86,6 +86,7 @@ def _root_.CategoryTheory.Limits.colimit.isColimitToOver (F : J ⥤ C) [HasColim IsColimit (colimit.toOver F) := Over.isColimitToOver (colimit.isColimit F) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given an arrow `c.pt ⟶ X`, the diagram `J ⥤ C` can be lifted to `Over X ⥤ C`, and the cocone `c` also lifts to the diagram on `Over`. -/ @@ -147,6 +148,7 @@ def _root_.CategoryTheory.Limits.limit.isLimitToOver (F : J ⥤ C) [HasLimit F] IsLimit (limit.toUnder F) := Under.isLimitToUnder (limit.isLimit F) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given an arrow `X ⟶ c.pt`, the diagram `J ⥤ C` can be lifted to `Under X ⥤ C`, and the cone `c` also lifts to the diagram on `Under`. -/ diff --git a/Mathlib/CategoryTheory/Limits/Preorder.lean b/Mathlib/CategoryTheory/Limits/Preorder.lean index 2bbcb334ca57be..b58c78385a3a5c 100644 --- a/Mathlib/CategoryTheory/Limits/Preorder.lean +++ b/Mathlib/CategoryTheory/Limits/Preorder.lean @@ -104,13 +104,13 @@ section variable [Preorder C] /-- A terminal object in a preorder `C` is top element for `C`. -/ -@[implicit_reducible] +@[instance_reducible] def _root_.CategoryTheory.Limits.IsTerminal.orderTop {X : C} (t : IsTerminal X) : OrderTop C where top := X le_top Y := leOfHom (t.from Y) /-- A preorder with a terminal object has a greatest element. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def orderTopOfHasTerminal [HasTerminal C] : OrderTop C := IsTerminal.orderTop terminalIsTerminal @@ -121,13 +121,13 @@ def isTerminalTop [OrderTop C] : IsTerminal (⊤ : C) := IsTerminal.ofUnique _ instance (priority := low) [OrderTop C] : HasTerminal C := hasTerminal_of_unique ⊤ /-- An initial object in a preorder `C` is bottom element for `C`. -/ -@[implicit_reducible] +@[instance_reducible] def _root_.CategoryTheory.Limits.IsInitial.orderBot {X : C} (t : IsInitial X) : OrderBot C where bot := X bot_le Y := leOfHom (t.to Y) /-- A preorder with an initial object has a least element. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def orderBotOfHasInitial [HasInitial C] : OrderBot C := IsInitial.orderBot initialIsInitial @@ -146,7 +146,7 @@ variable [PartialOrder C] /-- A family of limiting binary fans on a partial order induces an inf-semilattice structure on it. -/ -@[implicit_reducible] +@[instance_reducible] def semilatticeInfOfIsLimitBinaryFan (c : ∀ (X Y : C), BinaryFan X Y) (h : (X Y : C) → IsLimit (c X Y)) : SemilatticeInf C where inf X Y := (c X Y).pt @@ -156,7 +156,7 @@ def semilatticeInfOfIsLimitBinaryFan variable (C) in /-- If a partial order has binary products, then it is an inf-semilattice -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def semilatticeInfOfHasBinaryProducts [HasBinaryProducts C] : SemilatticeInf C := semilatticeInfOfIsLimitBinaryFan (fun _ _ ↦ BinaryFan.mk prod.fst prod.snd) (fun X Y ↦ prodIsProd X Y) @@ -164,7 +164,7 @@ noncomputable def semilatticeInfOfHasBinaryProducts [HasBinaryProducts C] : Semi /-- A family of colimiting binary cofans on a partial order induces a sup-semilattice structure on it. -/ -@[implicit_reducible] +@[instance_reducible] def semilatticeSupOfIsColimitBinaryCofan (c : ∀ (X Y : C), BinaryCofan X Y) (h : (X Y : C) → IsColimit (c X Y)) : SemilatticeSup C where sup X Y := (c X Y).pt @@ -174,7 +174,7 @@ def semilatticeSupOfIsColimitBinaryCofan variable (C) in /-- If a partial order has binary coproducts, then it is a sup-semilattice -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def semilatticeSupOfHasBinaryCoproducts [HasBinaryCoproducts C] : SemilatticeSup C := semilatticeSupOfIsColimitBinaryCofan (fun _ _ ↦ BinaryCofan.mk coprod.inl coprod.inr) (fun X Y ↦ coprodIsCoprod X Y) diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean b/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean index 1967dc99751bd3..5e575a7662bd34 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Basic.lean @@ -263,6 +263,7 @@ lemma preservesLimitsOfSize_iff_of_natIso {F G : C ⥤ D} (h : F ≅ G) : PreservesLimitsOfSize.{w, w'} F ↔ PreservesLimitsOfSize.{w, w'} G := ⟨fun _ ↦ preservesLimits_of_natIso h, fun _ ↦ preservesLimits_of_natIso h.symm⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Transfer preservation of limits along an equivalence in the shape. -/ lemma preservesLimitsOfShape_of_equiv {J' : Type w₂} [Category.{w₂'} J'] (e : J ≌ J') (F : C ⥤ D) @@ -345,6 +346,7 @@ lemma preservesColimitsOfSize_iff_of_natIso {F G : C ⥤ D} (h : F ≅ G) : PreservesColimitsOfSize.{w, w'} F ↔ PreservesColimitsOfSize.{w, w'} G := ⟨fun _ ↦ preservesColimits_of_natIso h, fun _ ↦ preservesColimits_of_natIso h.symm⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Transfer preservation of colimits along an equivalence in the shape. -/ lemma preservesColimitsOfShape_of_equiv {J' : Type w₂} [Category.{w₂'} J'] (e : J ≌ J') (F : C ⥤ D) @@ -787,6 +789,7 @@ end variable (F : C ⥤ D) +set_option backward.isDefEq.respectTransparency.types false in /-- A fully faithful functor reflects limits. -/ instance fullyFaithful_reflectsLimits [F.Full] [F.Faithful] : ReflectsLimitsOfSize.{w, w'} F where reflectsLimitsOfShape {J} 𝒥₁ := @@ -798,6 +801,7 @@ instance fullyFaithful_reflectsLimits [F.Full] [F.Faithful] : ReflectsLimitsOfSi intro s m rw [Functor.map_preimage] apply t.uniq_cone_morphism⟩ } } +set_option backward.isDefEq.respectTransparency.types false in /-- A fully faithful functor reflects colimits. -/ instance fullyFaithful_reflectsColimits [F.Full] [F.Faithful] : ReflectsColimitsOfSize.{w, w'} F where diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean b/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean index aa2e9f87cca4d0..446156f513a3ba 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean @@ -239,6 +239,7 @@ instance of_preservesColimits_in_each_variable ⟨IsColimit.ofCoconeUncurry P <| IsColimit.precomposeHomEquiv E₀ _ <| IsColimit.ofIsoColimit (isColimitOfPreserves _ hc₁) E₁.symm⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem of_preservesColimit₂_flip : PreservesColimit₂ K₂ K₁ G.flip where nonempty_isColimit_mapCocone₂ {c₁} hc₁ {c₂} hc₂ := by @@ -338,6 +339,7 @@ lemma isoLimitUncurryWhiskeringLeft₂_hom_comp_map_π (j : J₁ × J₂) : end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If a bifunctor preserves separately limits of `K₁` in the first variable and limits of `K₂` in the second variable, then it preserves colimit of the pair of cones `K₁, K₂`. -/ @@ -370,6 +372,7 @@ instance of_preservesLimits_in_each_variable ⟨IsLimit.ofConeOfConeUncurry P <| IsLimit.postcomposeHomEquiv E₀ _ <| IsLimit.ofIsoLimit (isLimitOfPreserves _ hc₁) E₁.symm⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem of_preservesLimit₂_flip : PreservesLimit₂ K₂ K₁ G.flip where nonempty_isLimit_mapCone₂ {c₁} hc₁ {c₂} hc₂ := by diff --git a/Mathlib/CategoryTheory/Limits/Preserves/BifunctorCokernel.lean b/Mathlib/CategoryTheory/Limits/Preserves/BifunctorCokernel.lean index 27ea2512e32ed1..98a48c79708bbe 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/BifunctorCokernel.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/BifunctorCokernel.lean @@ -87,6 +87,7 @@ end isColimitMapBifunctor variable [HasBinaryCoproduct ((F.obj X₁).obj Y₂) ((F.obj Y₁).obj X₂)] [PreservesColimit (parallelPair f₁ 0) (F.flip.obj X₂)] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open isColimitMapBifunctor in /-- Let `c₁` (resp. `c₂`) be a colimit cokernel cofork for a morphism `f₁ : X₁ ⟶ Y₁` diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean index 67d93ec1b09e3f..ba47912dc78d69 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Finite.lean @@ -46,7 +46,7 @@ instance (priority := 100) createsLimitsOfShapeOfCreatesFiniteLimits (F : C ⥤ -- Cannot be an instance because of unbound universe variables. /-- If `F` creates limits of any size, it creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def CreatesLimitsOfSize.createsFiniteLimits (F : C ⥤ D) [CreatesLimitsOfSize.{w, w'} F] : CreatesFiniteLimits F where createsFiniteLimits J _ _ := createsLimitsOfShapeOfEquiv @@ -62,7 +62,7 @@ instance (priority := 100) CreatesLimits.createsFiniteLimits (F : C ⥤ D) attribute [local instance] uliftCategory in /-- If `F` creates finite limits in any universe, then it creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOfCreatesFiniteLimitsOfSize (F : C ⥤ D) (h : ∀ (J : Type w) {_ : SmallCategory J} (_ : FinCategory J), CreatesLimitsOfShape J F) : CreatesFiniteLimits F where @@ -75,7 +75,7 @@ instance compCreatesFiniteLimits (F : C ⥤ D) (G : D ⥤ E) [CreatesFiniteLimit createsFiniteLimits _ _ _ := compCreatesLimitsOfShape F G /-- Transfer creation of finite limits along a natural isomorphism in the functor. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOfNatIso {F G : C ⥤ D} {h : F ≅ G} [CreatesFiniteLimits F] : CreatesFiniteLimits G where createsFiniteLimits _ _ _ := createsLimitsOfShapeOfNatIso h @@ -103,7 +103,7 @@ noncomputable section /-- The condition of `CreatesFiniteProducts` can be checked for finite types in an arbitrary universe. -/ -@[implicit_reducible] +@[instance_reducible] def CreatesFiniteProducts.mk' (F : C ⥤ D) (H : ∀ (J : Type w) [Fintype J], CreatesLimitsOfShape (Discrete J) F) : CreatesFiniteProducts F where @@ -119,7 +119,7 @@ instance compCreatesFiniteProducts (F : C ⥤ D) (G : D ⥤ E) [CreatesFinitePro creates _ _ := compCreatesLimitsOfShape _ _ /-- Transfer creation of finite products along a natural isomorphism in the functor. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteProductsOfNatIso {F G : C ⥤ D} {h : F ≅ G} [CreatesFiniteProducts F] : CreatesFiniteProducts G where creates _ _ := createsLimitsOfShapeOfNatIso h @@ -147,7 +147,7 @@ instance (priority := 100) createsColimitsOfShapeOfCreatesFiniteColimits (F : C -- Cannot be an instance because of unbound universe variables. /-- If `F` creates colimits of any size, it creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def CreatesColimitsOfSize.createsFiniteColimits (F : C ⥤ D) [CreatesColimitsOfSize.{w, w'} F] : CreatesFiniteColimits F where createsFiniteColimits J _ _ := createsColimitsOfShapeOfEquiv @@ -163,7 +163,7 @@ instance (priority := 100) CreatesColimits.createsFiniteColimits (F : C ⥤ D) attribute [local instance] uliftCategory in /-- If `F` creates finite colimits in any universe, then it creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOfCreatesFiniteColimitsOfSize (F : C ⥤ D) (h : ∀ (J : Type w) {_ : SmallCategory J} (_ : FinCategory J), CreatesColimitsOfShape J F) : CreatesFiniteColimits F where @@ -176,7 +176,7 @@ instance compCreatesFiniteColimits (F : C ⥤ D) (G : D ⥤ E) [CreatesFiniteCol createsFiniteColimits _ _ _ := compCreatesColimitsOfShape F G /-- Transfer creation of finite colimits along a natural isomorphism in the functor. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOfNatIso {F G : C ⥤ D} {h : F ≅ G} [CreatesFiniteColimits F] : CreatesFiniteColimits G where createsFiniteColimits _ _ _ := createsColimitsOfShapeOfNatIso h @@ -212,7 +212,7 @@ instance compCreatesFiniteCoproducts (F : C ⥤ D) (G : D ⥤ E) [CreatesFiniteC creates _ _ := compCreatesColimitsOfShape _ _ /-- Transfer creation of finite limits along a natural isomorphism in the functor. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteCoproductsOfNatIso {F G : C ⥤ D} {h : F ≅ G} [CreatesFiniteCoproducts F] : CreatesFiniteCoproducts G where creates _ _ := createsColimitsOfShapeOfNatIso h diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Opposites.lean b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Opposites.lean index 418b03cf97fa36..04f7847409478a 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Creates/Opposites.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Creates/Opposites.lean @@ -33,7 +33,7 @@ namespace Limits /-- If `F : C ⥤ D` creates colimits of `K.leftOp : Jᵒᵖ ⥤ C`, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ D) [CreatesColimit K.leftOp F] : CreatesLimit K F.op where __ := reflectsLimit_op _ _ @@ -44,7 +44,7 @@ def createsLimitOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ D) [CreatesColimit K.leftOp F] /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F : C ⥤ D` creates limits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfOp (K : J ⥤ C) (F : C ⥤ D) [CreatesColimit K.op F.op] : CreatesLimit K F where __ := reflectsLimit_of_op _ _ @@ -55,7 +55,7 @@ def createsLimitOfOp (K : J ⥤ C) (F : C ⥤ D) [CreatesColimit K.op F.op] : /-- If `F : C ⥤ Dᵒᵖ` creates colimits of `K.leftOp : Jᵒᵖ ⥤ C`, then `F.leftOp : Cᵒᵖ ⥤ D` creates limits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitLeftOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ Dᵒᵖ) [CreatesColimit K.leftOp F] : CreatesLimit K F.leftOp where __ := reflectsLimit_leftOp _ _ @@ -66,7 +66,7 @@ def createsLimitLeftOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ Dᵒᵖ) [CreatesColimit K /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates colimits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F : C ⥤ Dᵒᵖ` creates limits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfLeftOp (K : J ⥤ C) (F : C ⥤ Dᵒᵖ) [CreatesColimit K.op F.leftOp] : CreatesLimit K F where __ := reflectsLimit_of_leftOp _ _ @@ -78,7 +78,7 @@ def createsLimitOfLeftOp (K : J ⥤ C) (F : C ⥤ Dᵒᵖ) [CreatesColimit K.op /-- If `F : Cᵒᵖ ⥤ D` creates colimits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F.rightOp : C ⥤ Dᵒᵖ` creates limits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitRightOp (K : J ⥤ C) (F : Cᵒᵖ ⥤ D) [CreatesColimit K.op F] : CreatesLimit K F.rightOp where __ := reflectsLimit_rightOp _ _ @@ -90,7 +90,7 @@ def createsLimitRightOp (K : J ⥤ C) (F : Cᵒᵖ ⥤ D) [CreatesColimit K.op F /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates colimits of `K.leftOp : Jᵒᵖ ⥤ Cᵒᵖ`, then `F : Cᵒᵖ ⥤ D` creates limits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfRightOp (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ D) [CreatesColimit K.leftOp F.rightOp] : CreatesLimit K F where __ := reflectsLimit_of_rightOp _ _ @@ -101,7 +101,7 @@ def createsLimitOfRightOp (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ D) [CreatesColimi /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F.unop : C ⥤ D` creates limits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitUnop (K : J ⥤ C) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimit K.op F] : CreatesLimit K F.unop where __ := reflectsLimit_unop _ _ @@ -112,7 +112,7 @@ def createsLimitUnop (K : J ⥤ C) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimit K.o /-- If `F.unop : C ⥤ D` creates colimits of `K.leftOp : Jᵒᵖ ⥤ C`, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitOfUnop (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimit K.leftOp F.unop] : CreatesLimit K F where __ := reflectsLimit_of_unop _ _ @@ -124,7 +124,7 @@ def createsLimitOfUnop (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesCol /-- If `F : C ⥤ D` creates limits of `K.leftOp : Jᵒᵖ ⥤ C`, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ D) [CreatesLimit K.leftOp F] : CreatesColimit K F.op where __ := reflectsColimit_op _ _ @@ -136,7 +136,7 @@ def createsColimitOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ D) [CreatesLimit K.leftOp F] /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F : C ⥤ D` creates colimits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfOp (K : J ⥤ C) (F : C ⥤ D) [CreatesLimit K.op F.op] : CreatesColimit K F where __ := reflectsColimit_of_op _ _ @@ -147,7 +147,7 @@ def createsColimitOfOp (K : J ⥤ C) (F : C ⥤ D) [CreatesLimit K.op F.op] : /-- If `F : C ⥤ Dᵒᵖ` creates limits of `K.leftOp : Jᵒᵖ ⥤ C`, then `F.leftOp : Cᵒᵖ ⥤ D` creates colimits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitLeftOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ Dᵒᵖ) [CreatesLimit K.leftOp F] : CreatesColimit K F.leftOp where __ := reflectsColimit_leftOp _ _ @@ -158,7 +158,7 @@ def createsColimitLeftOp (K : J ⥤ Cᵒᵖ) (F : C ⥤ Dᵒᵖ) [CreatesLimit K /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates limits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F : C ⥤ Dᵒᵖ` creates colimits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfLeftOp (K : J ⥤ C) (F : C ⥤ Dᵒᵖ) [CreatesLimit K.op F.leftOp] : CreatesColimit K F where __ := reflectsColimit_of_leftOp _ _ @@ -170,7 +170,7 @@ def createsColimitOfLeftOp (K : J ⥤ C) (F : C ⥤ Dᵒᵖ) [CreatesLimit K.op /-- If `F : Cᵒᵖ ⥤ D` creates limits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F.rightOp : C ⥤ Dᵒᵖ` creates colimits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitRightOp (K : J ⥤ C) (F : Cᵒᵖ ⥤ D) [CreatesLimit K.op F] : CreatesColimit K F.rightOp where __ := reflectsColimit_rightOp _ _ @@ -182,7 +182,7 @@ def createsColimitRightOp (K : J ⥤ C) (F : Cᵒᵖ ⥤ D) [CreatesLimit K.op F /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates limits of `K.leftOp : Jᵒᵖ ⥤ Cᵒᵖ`, then `F : Cᵒᵖ ⥤ D` creates colimits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfRightOp (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ D) [CreatesLimit K.leftOp F.rightOp] : CreatesColimit K F where __ := reflectsColimit_of_rightOp _ _ @@ -193,7 +193,7 @@ def createsColimitOfRightOp (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ D) [CreatesLimi /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of `K.op : Jᵒᵖ ⥤ Cᵒᵖ`, then `F.unop : C ⥤ D` creates colimits of `K : J ⥤ C`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitUnop (K : J ⥤ C) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimit K.op F] : CreatesColimit K F.unop where __ := reflectsColimit_unop _ _ @@ -204,7 +204,7 @@ def createsColimitUnop (K : J ⥤ C) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimit K.o /-- If `F.unop : C ⥤ D` creates limits of `K.op : Jᵒᵖ ⥤ C`, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of `K : J ⥤ Cᵒᵖ`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfUnop (K : J ⥤ Cᵒᵖ) (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimit K.leftOp F.unop] : CreatesColimit K F where __ := reflectsColimit_of_unop _ _ @@ -220,194 +220,194 @@ variable (J) /-- If `F : C ⥤ D` creates colimits of shape `Jᵒᵖ`, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOp (F : C ⥤ D) [CreatesColimitsOfShape Jᵒᵖ F] : CreatesLimitsOfShape J F.op where CreatesLimit {K} := createsLimitOp K F /-- If `F : C ⥤ Dᵒᵖ` creates colimits of shape `Jᵒᵖ`, then `F.leftOp : Cᵒᵖ ⥤ D` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeLeftOp (F : C ⥤ Dᵒᵖ) [CreatesColimitsOfShape Jᵒᵖ F] : CreatesLimitsOfShape J F.leftOp where CreatesLimit {K} := createsLimitLeftOp K F /-- If `F : Cᵒᵖ ⥤ D` creates colimits of shape `Jᵒᵖ`, then `F.rightOp : C ⥤ Dᵒᵖ` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeRightOp (F : Cᵒᵖ ⥤ D) [CreatesColimitsOfShape Jᵒᵖ F] : CreatesLimitsOfShape J F.rightOp where CreatesLimit {K} := createsLimitRightOp K F /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of shape `Jᵒᵖ`, then `F.unop : C ⥤ D` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimitsOfShape Jᵒᵖ F] : CreatesLimitsOfShape J F.unop where CreatesLimit {K} := createsLimitUnop K F /-- If `F : C ⥤ D` creates limits of shape `Jᵒᵖ`, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOp (F : C ⥤ D) [CreatesLimitsOfShape Jᵒᵖ F] : CreatesColimitsOfShape J F.op where CreatesColimit {K} := createsColimitOp K F /-- If `F : C ⥤ Dᵒᵖ` creates limits of shape `Jᵒᵖ`, then `F.leftOp : Cᵒᵖ ⥤ D` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeLeftOp (F : C ⥤ Dᵒᵖ) [CreatesLimitsOfShape Jᵒᵖ F] : CreatesColimitsOfShape J F.leftOp where CreatesColimit {K} := createsColimitLeftOp K F /-- If `F : Cᵒᵖ ⥤ D` creates limits of shape `Jᵒᵖ`, then `F.rightOp : C ⥤ Dᵒᵖ` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeRightOp (F : Cᵒᵖ ⥤ D) [CreatesLimitsOfShape Jᵒᵖ F] : CreatesColimitsOfShape J F.rightOp where CreatesColimit {K} := createsColimitRightOp K F /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of shape `Jᵒᵖ`, then `F.unop : C ⥤ D` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimitsOfShape Jᵒᵖ F] : CreatesColimitsOfShape J F.unop where CreatesColimit {K} := createsColimitUnop K F /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of shape `Jᵒᵖ`, then `F : C ⥤ D` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfOp (F : C ⥤ D) [CreatesColimitsOfShape Jᵒᵖ F.op] : CreatesLimitsOfShape J F where CreatesLimit {K} := createsLimitOfOp K F /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates colimits of shape `Jᵒᵖ`, then `F : C ⥤ Dᵒᵖ` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfLeftOp (F : C ⥤ Dᵒᵖ) [CreatesColimitsOfShape Jᵒᵖ F.leftOp] : CreatesLimitsOfShape J F where CreatesLimit {K} := createsLimitOfLeftOp K F /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates colimits of shape `Jᵒᵖ`, then `F : Cᵒᵖ ⥤ D` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfRightOp (F : Cᵒᵖ ⥤ D) [CreatesColimitsOfShape Jᵒᵖ F.rightOp] : CreatesLimitsOfShape J F where CreatesLimit {K} := createsLimitOfRightOp K F /-- If `F.unop : C ⥤ D` creates colimits of shape `Jᵒᵖ`, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfShapeOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimitsOfShape Jᵒᵖ F.unop] : CreatesLimitsOfShape J F where CreatesLimit {K} := createsLimitOfUnop K F /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates limits of shape `Jᵒᵖ`, then `F : C ⥤ D` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfOp (F : C ⥤ D) [CreatesLimitsOfShape Jᵒᵖ F.op] : CreatesColimitsOfShape J F where CreatesColimit {K} := createsColimitOfOp K F /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates limits of shape `Jᵒᵖ`, then `F : C ⥤ Dᵒᵖ` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfLeftOp (F : C ⥤ Dᵒᵖ) [CreatesLimitsOfShape Jᵒᵖ F.leftOp] : CreatesColimitsOfShape J F where CreatesColimit {K} := createsColimitOfLeftOp K F /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates limits of shape `Jᵒᵖ`, then `F : Cᵒᵖ ⥤ D` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfRightOp (F : Cᵒᵖ ⥤ D) [CreatesLimitsOfShape Jᵒᵖ F.rightOp] : CreatesColimitsOfShape J F where CreatesColimit {K} := createsColimitOfRightOp K F /-- If `F.unop : C ⥤ D` creates limits of shape `Jᵒᵖ`, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits of shape `J`. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfShapeOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimitsOfShape Jᵒᵖ F.unop] : CreatesColimitsOfShape J F where CreatesColimit {K} := createsColimitOfUnop K F end /-- If `F : C ⥤ D` creates colimits, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeOp (F : C ⥤ D) [CreatesColimitsOfSize.{w, w'} F] : CreatesLimitsOfSize.{w, w'} F.op where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeOp _ _ /-- If `F : C ⥤ Dᵒᵖ` creates colimits, then `F.leftOp : Cᵒᵖ ⥤ D` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeLeftOp (F : C ⥤ Dᵒᵖ) [CreatesColimitsOfSize.{w, w'} F] : CreatesLimitsOfSize.{w, w'} F.leftOp where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeLeftOp _ _ /-- If `F : Cᵒᵖ ⥤ D` creates colimits, then `F.rightOp : C ⥤ Dᵒᵖ` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeRightOp (F : Cᵒᵖ ⥤ D) [CreatesColimitsOfSize.{w, w'} F] : CreatesLimitsOfSize.{w, w'} F.rightOp where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeRightOp _ _ /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits, then `F.unop : C ⥤ D` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimitsOfSize.{w, w'} F] : CreatesLimitsOfSize.{w, w'} F.unop where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeUnop _ _ /-- If `F : C ⥤ D` creates limits, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeOp (F : C ⥤ D) [CreatesLimitsOfSize.{w, w'} F] : CreatesColimitsOfSize.{w, w'} F.op where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeOp _ _ /-- If `F : C ⥤ Dᵒᵖ` creates limits, then `F.leftOp : Cᵒᵖ ⥤ D` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeLeftOp (F : C ⥤ Dᵒᵖ) [CreatesLimitsOfSize.{w, w'} F] : CreatesColimitsOfSize.{w, w'} F.leftOp where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeLeftOp _ _ /-- If `F : Cᵒᵖ ⥤ D` creates limits, then `F.rightOp : C ⥤ Dᵒᵖ` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeRightOp (F : Cᵒᵖ ⥤ D) [CreatesLimitsOfSize.{w, w'} F] : CreatesColimitsOfSize.{w, w'} F.rightOp where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeRightOp _ _ /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates limits, then `F.unop : C ⥤ D` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimitsOfSize.{w, w'} F] : CreatesColimitsOfSize.{w, w'} F.unop where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeUnop _ _ /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits, then `F : C ⥤ D` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeOfOp (F : C ⥤ D) [CreatesColimitsOfSize.{w, w'} F.op] : CreatesLimitsOfSize.{w, w'} F where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeOfOp _ _ /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates colimits, then `F : C ⥤ Dᵒᵖ` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeOfLeftOp (F : C ⥤ Dᵒᵖ) [CreatesColimitsOfSize.{w, w'} F.leftOp] : CreatesLimitsOfSize.{w, w'} F where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeOfLeftOp _ _ /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates colimits, then `F : Cᵒᵖ ⥤ D` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeOfRightOp (F : Cᵒᵖ ⥤ D) [CreatesColimitsOfSize.{w, w'} F.rightOp] : CreatesLimitsOfSize.{w, w'} F where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeOfRightOp _ _ /-- If `F.unop : C ⥤ D` creates colimits, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsLimitsOfSizeOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesColimitsOfSize.{w, w'} F.unop] : CreatesLimitsOfSize.{w, w'} F where CreatesLimitsOfShape {_} _ := createsLimitsOfShapeOfUnop _ _ /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates limits, then `F : C ⥤ D` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeOfOp (F : C ⥤ D) [CreatesLimitsOfSize.{w, w'} F.op] : CreatesColimitsOfSize.{w, w'} F where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeOfOp _ _ /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates limits, then `F : C ⥤ Dᵒᵖ` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeOfLeftOp (F : C ⥤ Dᵒᵖ) [CreatesLimitsOfSize.{w, w'} F.leftOp] : CreatesColimitsOfSize.{w, w'} F where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeOfLeftOp _ _ /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates limits, then `F : Cᵒᵖ ⥤ D` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeOfRightOp (F : Cᵒᵖ ⥤ D) [CreatesLimitsOfSize.{w, w'} F.rightOp] : CreatesColimitsOfSize.{w, w'} F where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeOfRightOp _ _ /-- If `F.unop : C ⥤ D` creates limits, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitsOfSizeOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimitsOfSize.{w, w'} F.unop] : CreatesColimitsOfSize.{w, w'} F where CreatesColimitsOfShape {_} _ := createsColimitsOfShapeOfUnop _ _ @@ -478,115 +478,115 @@ abbrev createsColimitsOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesLimits F.unop] : /-- If `F : C ⥤ D` creates finite colimits, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOp (F : C ⥤ D) [CreatesFiniteColimits F] : CreatesFiniteLimits F.op where createsFiniteLimits J _ _ := createsLimitsOfShapeOp J F /-- If `F : C ⥤ Dᵒᵖ` creates finite colimits, then `F.leftOp : Cᵒᵖ ⥤ D` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteColimits F] : CreatesFiniteLimits F.leftOp where createsFiniteLimits J _ _ := createsLimitsOfShapeLeftOp J F /-- If `F : Cᵒᵖ ⥤ D` creates finite colimits, then `F.rightOp : C ⥤ Dᵒᵖ` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteColimits F] : CreatesFiniteLimits F.rightOp where createsFiniteLimits J _ _ := createsLimitsOfShapeRightOp J F /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates finite colimits, then `F.unop : C ⥤ D` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteColimits F] : CreatesFiniteLimits F.unop where createsFiniteLimits J _ _ := createsLimitsOfShapeUnop J F /-- If `F : C ⥤ D` creates finite limits, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOp (F : C ⥤ D) [CreatesFiniteLimits F] : CreatesFiniteColimits F.op where createsFiniteColimits J _ _ := createsColimitsOfShapeOp J F /-- If `F : C ⥤ Dᵒᵖ` creates finite limits, then `F.leftOp : Cᵒᵖ ⥤ D` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteLimits F] : CreatesFiniteColimits F.leftOp where createsFiniteColimits J _ _ := createsColimitsOfShapeLeftOp J F /-- If `F : Cᵒᵖ ⥤ D` creates finite limits, then `F.rightOp : C ⥤ Dᵒᵖ` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteLimits F] : CreatesFiniteColimits F.rightOp where createsFiniteColimits J _ _ := createsColimitsOfShapeRightOp J F /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates finite limits, then `F.unop : C ⥤ D` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteLimits F] : CreatesFiniteColimits F.unop where createsFiniteColimits J _ _ := createsColimitsOfShapeUnop J F /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates finite colimits, then `F : C ⥤ D` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOfOp (F : C ⥤ D) [CreatesFiniteColimits F.op] : CreatesFiniteLimits F where createsFiniteLimits J _ _ := createsLimitsOfShapeOfOp J F /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates finite colimits, then `F : C ⥤ Dᵒᵖ` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOfLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteColimits F.leftOp] : CreatesFiniteLimits F where createsFiniteLimits J _ _ := createsLimitsOfShapeOfLeftOp J F /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates finite colimits, then `F : Cᵒᵖ ⥤ D` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOfRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteColimits F.rightOp] : CreatesFiniteLimits F where createsFiniteLimits J _ _ := createsLimitsOfShapeOfRightOp J F /-- If `F.unop : C ⥤ D` creates finite colimits, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates finite limits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteLimitsOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteColimits F.unop] : CreatesFiniteLimits F where createsFiniteLimits J _ _ := createsLimitsOfShapeOfUnop J F /-- If `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates finite limits, then `F : C ⥤ D` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOfOp (F : C ⥤ D) [CreatesFiniteLimits F.op] : CreatesFiniteColimits F where createsFiniteColimits J _ _ := createsColimitsOfShapeOfOp J F /-- If `F.leftOp : Cᵒᵖ ⥤ D` creates finite limits, then `F : C ⥤ Dᵒᵖ` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOfLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteLimits F.leftOp] : CreatesFiniteColimits F where createsFiniteColimits J _ _ := createsColimitsOfShapeOfLeftOp J F /-- If `F.rightOp : C ⥤ Dᵒᵖ` creates finite limits, then `F : Cᵒᵖ ⥤ D` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOfRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteLimits F.rightOp] : CreatesFiniteColimits F where createsFiniteColimits J _ _ := createsColimitsOfShapeOfRightOp J F /-- If `F.unop : C ⥤ D` creates finite limits, then `F : Cᵒᵖ ⥤ Dᵒᵖ` creates finite colimits. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteColimitsOfUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteLimits F.unop] : CreatesFiniteColimits F where createsFiniteColimits J _ _ := createsColimitsOfShapeOfUnop J F /-- If `F : C ⥤ D` creates finite coproducts, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates finite products. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteProductsOp (F : C ⥤ D) [CreatesFiniteCoproducts F] : CreatesFiniteProducts F.op where creates _ _ := by @@ -595,7 +595,7 @@ def createsFiniteProductsOp (F : C ⥤ D) [CreatesFiniteCoproducts F] : /-- If `F : C ⥤ Dᵒᵖ` creates finite coproducts, then `F.leftOp : Cᵒᵖ ⥤ D` creates finite products. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteProductsLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteCoproducts F] : CreatesFiniteProducts F.leftOp where creates _ _ := by @@ -604,7 +604,7 @@ def createsFiniteProductsLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteCoproducts F] /-- If `F : Cᵒᵖ ⥤ D` creates finite coproducts, then `F.rightOp : C ⥤ Dᵒᵖ` creates finite products. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteProductsRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteCoproducts F] : CreatesFiniteProducts F.rightOp where creates _ _ := by @@ -613,7 +613,7 @@ def createsFiniteProductsRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteCoproducts F] /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates finite coproducts, then `F.unop : C ⥤ D` creates finite products. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteProductsUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteCoproducts F] : CreatesFiniteProducts F.unop where creates _ _ := by @@ -622,7 +622,7 @@ def createsFiniteProductsUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteCoproducts /-- If `F : C ⥤ D` creates finite products, then `F.op : Cᵒᵖ ⥤ Dᵒᵖ` creates finite coproducts. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteCoproductsOp (F : C ⥤ D) [CreatesFiniteProducts F] : CreatesFiniteCoproducts F.op where creates _ _ := by @@ -631,7 +631,7 @@ def createsFiniteCoproductsOp (F : C ⥤ D) [CreatesFiniteProducts F] : /-- If `F : C ⥤ Dᵒᵖ` creates finite products, then `F.leftOp : Cᵒᵖ ⥤ D` creates finite coproducts. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteCoproductsLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteProducts F] : CreatesFiniteCoproducts F.leftOp where creates _ _ := by @@ -640,7 +640,7 @@ def createsFiniteCoproductsLeftOp (F : C ⥤ Dᵒᵖ) [CreatesFiniteProducts F] /-- If `F : Cᵒᵖ ⥤ D` creates finite products, then `F.rightOp : C ⥤ Dᵒᵖ` creates finite coproducts. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteCoproductsRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteProducts F] : CreatesFiniteCoproducts F.rightOp where creates _ _ := by @@ -649,7 +649,7 @@ def createsFiniteCoproductsRightOp (F : Cᵒᵖ ⥤ D) [CreatesFiniteProducts F] /-- If `F : Cᵒᵖ ⥤ Dᵒᵖ` creates finite products, then `F.unop : C ⥤ D` creates finite coproducts. -/ -@[implicit_reducible] +@[instance_reducible] def createsFiniteCoproductsUnop (F : Cᵒᵖ ⥤ Dᵒᵖ) [CreatesFiniteProducts F] : CreatesFiniteCoproducts F.unop where creates _ _ := by diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean index de09cda06c9444..43c2555108a207 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/BinaryProducts.lean @@ -37,6 +37,7 @@ section variable {P X Y Z : C} (f : P ⟶ X) (g : P ⟶ Y) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a binary fan is a limit iff the fork consisting of the mapped morphisms is a limit. This @@ -131,6 +132,7 @@ section variable {P X Y Z : C} (f : X ⟶ P) (g : Y ⟶ P) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a binary cofan is a colimit iff the cofork consisting of the mapped morphisms is a colimit. diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean index b6f53dbfb62472..fc04d44edf386b 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean @@ -167,6 +167,7 @@ class PreservesBinaryBiproducts (F : C ⥤ D) [PreservesZeroMorphisms F] : Prop attribute [inherit_doc PreservesBinaryBiproducts] PreservesBinaryBiproducts.preserves +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor that preserves biproducts of a pair preserves binary biproducts. -/ lemma preservesBinaryBiproduct_of_preservesBiproduct (F : C ⥤ D) diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean index df1b7a6308947f..bd4db04a64e74d 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean @@ -38,6 +38,7 @@ section Equalizers variable {X Y Z : C} {f g : X ⟶ Y} {h : Z ⟶ X} (w : h ≫ f = h ≫ g) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a fork is a limit iff the fork consisting of the mapped morphisms is a limit. This essentially lets us commute `Fork.ofι` with `Functor.mapCone`. @@ -114,6 +115,7 @@ section Coequalizers variable {X Y Z : C} {f g : X ⟶ Y} {h : Y ⟶ Z} (w : f ≫ h = g ≫ h) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a cofork is a colimit iff the cofork consisting of the mapped morphisms is a colimit. This essentially lets us commute `Cofork.ofπ` with `Functor.mapCocone`. diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean index 6541cb8e15ace9..394fb640d3fabe 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Kernels.lean @@ -304,6 +304,7 @@ instance preservesKernel_zero : refine IsLimit.ofIsoLimit (KernelFork.IsLimit.ofId _ (G.map_zero _ _)) ?_ exact (Fork.ext (G.mapIso (asIso (Fork.ι c))).symm (by simp))⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in noncomputable instance preservesCokernel_zero : PreservesColimit (parallelPair (0 : X ⟶ Y) 0) G where diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean index c9e40fff12d47a..5ec85d260a7e6c 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Multiequalizer.lean @@ -65,6 +65,7 @@ def Multicofork.map : Multicofork (d.map F) := dsimp rw [← F.map_comp, ← F.map_comp, condition]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `d : MultispanIndex J C`, `c : Multicofork d` and `F : C ⥤ D`, the cocone `F.mapCocone c` is colimit iff the multicofork `c.map F` is. -/ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean index f198d3f479106d..d6896c7d9c75e5 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Over.lean @@ -35,6 +35,7 @@ instance PreservesLimitsOfShape.ofWidePullbacks {J : Type*} PreservesLimitsOfShape (WithTerminal <| Discrete J) F := preservesLimitsOfShape_of_equiv WithTerminal.widePullbackShapeEquiv F +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open WithTerminal in instance PreservesLimitsOfShape.overPost [PreservesLimitsOfShape (WithTerminal J) F] : @@ -51,6 +52,7 @@ instance PreservesFiniteLimits.overPost [PreservesFiniteLimits F] : instance PreservesLimitsOfSize.overPost [PreservesLimitsOfSize.{w', w} F] : PreservesLimitsOfSize.{w', w} (Over.post F (X := X)) where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open WithInitial in instance PreservesColimitsOfShape.underPost [PreservesColimitsOfShape (WithInitial J) F] : diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean index 21d4b9c830d66e..b82cb3b18b5a96 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Products.lean @@ -35,6 +35,7 @@ namespace CategoryTheory.Limits variable {J : Type w} (f : J → C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a fan is a limit iff the fan consisting of the mapped morphisms is a limit. This essentially lets us commute `Fan.mk` with `Functor.mapCone`. @@ -110,6 +111,7 @@ instance {I : Type*} [Category* I] [IsGroupoid I] (F : C ⥤ D) [PreservesLimits end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a cofan is a colimit iff the cofan consisting of the mapped morphisms is a colimit. This essentially lets us commute `Cofan.mk` with `Functor.mapCocone`. diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean index 917b893f1dbf0f..9c6364e048360f 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean @@ -52,6 +52,7 @@ abbrev map : PullbackCone (G.map f) (G.map g) := PullbackCone.mk (G.map c.fst) (G.map c.snd) (by simpa using G.congr_map c.condition) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map (as a cone) of a pullback cone is limit iff the map (as a pullback cone) is limit. -/ @@ -180,6 +181,7 @@ variable {W X Y : C} {f : W ⟶ X} {g : W ⟶ Y} (c : PushoutCocone f g) (G : C abbrev map : PushoutCocone (G.map f) (G.map g) := PushoutCocone.mk (G.map c.inl) (G.map c.inr) (by simpa using G.congr_map c.condition) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map (as a cocone) of a pushout cocone is colimit iff the map (as a pushout cocone) is limit. -/ @@ -198,6 +200,7 @@ end PushoutCocone variable (G : C ⥤ D) variable {W X Y Z : C} {h : X ⟶ Z} {k : Y ⟶ Z} {f : W ⟶ X} {g : W ⟶ Y} (comm : f ≫ h = g ≫ k) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The map of a pushout cocone is a colimit iff the cofork consisting of the mapped morphisms is a colimit. This essentially lets us commute `PushoutCocone.mk` with `Functor.mapCocone`. -/ @@ -333,7 +336,9 @@ instance : IsIso (pushoutComparison G f g) := by rw [← PreservesPushout.iso_hom] infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- A pushout cocone in `C` is colimit iff it becomes limit after the application of `yoneda.obj X` for all `X : C`. -/ def PushoutCocone.isColimitYonedaEquiv (c : PushoutCocone f g) : diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean index 936ca34053ffae..3884edcc451d55 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Square.lean @@ -91,6 +91,7 @@ variable {sq₁ : Square (Type v)} {sq₂ : Square (Type u)} (comm₃₄ : e₄ ∘ sq₁.f₃₄ = sq₂.f₃₄ ∘ e₃) include comm₁₂ comm₁₃ comm₂₄ comm₃₄ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (sq₁ sq₂) in lemma IsPullback.iff_of_equiv : sq₁.IsPullback ↔ sq₂.IsPullback := by diff --git a/Mathlib/CategoryTheory/Limits/Preserves/SigmaConst.lean b/Mathlib/CategoryTheory/Limits/Preserves/SigmaConst.lean index 288d0e0d270b25..b11f7577d12950 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/SigmaConst.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/SigmaConst.lean @@ -67,14 +67,14 @@ variable {α β : Type*} (f : α → β) open Classical in /-- A colimit cokernel cofork for the map `∐ fun (_ : α) ↦ R ⟶ ∐ fun (_ : β) ↦ R` induced by a map `f : α → β`. -/ -@[simps! pt] +@[simps! pt, implicit_reducible] noncomputable def sigmaConstCokernelCofork : CokernelCofork (Sigma.map' (f := fun (_ : α) ↦ R) (g := fun (_ : β) ↦ R) f (fun _ ↦ 𝟙 R)) := CokernelCofork.ofπ (Z := ∐ fun (_ : ((Set.range f)ᶜ : Set _)) ↦ R) (Sigma.desc (fun b ↦ if hb : b ∈ (Set.range f)ᶜ then Sigma.ι (fun _ ↦ R) ⟨b, hb⟩ else 0)) - (by ext; simp [Sigma.ι_desc]) + (by ext; simp) set_option backward.defeqAttrib.useBackward true in @[reassoc] diff --git a/Mathlib/CategoryTheory/Limits/Presheaf.lean b/Mathlib/CategoryTheory/Limits/Presheaf.lean index 59fe1e8925575b..7afd08d9f649c1 100644 --- a/Mathlib/CategoryTheory/Limits/Presheaf.lean +++ b/Mathlib/CategoryTheory/Limits/Presheaf.lean @@ -195,6 +195,7 @@ noncomputable def uliftYonedaAdjunction : L ⊣ restrictedULiftYoneda.{max w v simp [restrictedULiftYonedaHomEquiv, restrictedULiftYonedaHomEquiv'_symm_naturality_right, this] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma uliftYonedaAdjunction_homEquiv_app {P : Cᵒᵖ ⥤ Type max w v₁ v₂} @@ -331,6 +332,7 @@ variable (L : (Cᵒᵖ ⥤ Type max w v₁ v₂) ⥤ ℰ) (α : A ⟶ uliftYoned instance [L.IsLeftKanExtension α] : IsIso α := (Functor.isPointwiseLeftKanExtensionOfIsLeftKanExtension L α).isIso_hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isLeftKanExtension_along_uliftYoneda_iff : L.IsLeftKanExtension α ↔ @@ -648,6 +650,7 @@ instance : F.op.lan.IsLeftKanExtension (compULiftYonedaIsoULiftYonedaCompLan.{w} end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a presheaf `P`, consider the forgetful functor from the category of representable presheaves over `P` to the category of presheaves. There is a tautological cocone over this @@ -672,6 +675,7 @@ def isColimitTautologicalCocone' (P : Cᵒᵖ ⥤ Type max w v₁) : (colimitOfRepresentable.{w} P) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- For a presheaf `P`, consider the forgetful functor from the category of representable presheaves over `P` to the category of presheaves. There is a tautological cocone over this diff --git a/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean index c47b386a741a16..79463a9ec7d6af 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/BinaryBiproducts.lean @@ -141,6 +141,7 @@ def functoriality : BinaryBicone P Q ⥤ BinaryBicone (F.obj P) (F.obj Q) where winl := by simp [-BinaryBiconeMorphism.winl, ← f.winl] winr := by simp [-BinaryBiconeMorphism.winr, ← f.winr] } +set_option backward.isDefEq.respectTransparency.types false in instance functoriality_full [F.Full] [F.Faithful] : (functoriality P Q F).Full where map_surjective t := ⟨{ hom := F.preimage t.hom @@ -298,6 +299,7 @@ def toBinaryBiconeFunctor {X Y : C} : Bicone (pairFunction X Y) ⥤ BinaryBicone abbrev toBinaryBicone {X Y : C} (b : Bicone (pairFunction X Y)) : BinaryBicone X Y := toBinaryBiconeFunctor.obj b +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A bicone over a pair is a limit cone if and only if the corresponding binary bicone is a limit cone. -/ @@ -305,6 +307,7 @@ def toBinaryBiconeIsLimit {X Y : C} (b : Bicone (pairFunction X Y)) : IsLimit b.toBinaryBicone.toCone ≃ IsLimit b.toCone := IsLimit.equivIsoLimit <| Cone.ext (Iso.refl _) fun j => by rcases j with ⟨⟨⟩⟩ <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A bicone over a pair is a colimit cocone if and only if the corresponding binary bicone is a colimit cocone. -/ @@ -723,6 +726,7 @@ theorem biprod.conePointUniqueUpToIso_inv (X Y : C) [HasBinaryBiproduct X Y] {b rcases j with ⟨⟨⟩⟩ all_goals simp +set_option backward.isDefEq.respectTransparency.types false in /-- Binary biproducts are unique up to isomorphism. This already follows because bilimits are limits, but in the case of biproducts we can give an isomorphism with particularly nice definitional properties, namely that `biprod.lift b.fst b.snd` and `biprod.desc b.inl b.inr` @@ -907,6 +911,7 @@ section variable (P Q) [HasBinaryBiproduct P Q] +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism `op (P ⊞ Q) ≅ op P ⊞ op Q`. -/ def biprod.opIso : op (P ⊞ Q) ≅ op P ⊞ op Q := biprod.uniqueUpToIso _ _ (getBinaryBiproductData P Q).op.isBilimit diff --git a/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean index 22cf041fcc4de6..3717bd6d0ab3f3 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean @@ -289,7 +289,7 @@ attribute [local aesop safe cases (rule_sets := [CategoryTheory])] Eq set_option backward.defeqAttrib.useBackward true in /-- A binary fan with vertex `P` consists of the two projections `π₁ : P ⟶ X` and `π₂ : P ⟶ Y`. -/ -@[simps pt] +@[simps pt, implicit_reducible] def BinaryFan.mk {P : C} (π₁ : P ⟶ X) (π₂ : P ⟶ Y) : BinaryFan X Y where pt := P π := { app := fun | { as := j } => match j with | left => π₁ | right => π₂ } @@ -319,11 +319,13 @@ theorem BinaryCofan.mk_inl {P : C} (ι₁ : X ⟶ P) (ι₂ : Y ⟶ P) : (Binary theorem BinaryCofan.mk_inr {P : C} (ι₁ : X ⟶ P) (ι₂ : Y ⟶ P) : (BinaryCofan.mk ι₁ ι₂).inr = ι₂ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Every `BinaryFan` is isomorphic to an application of `BinaryFan.mk`. -/ def isoBinaryFanMk {X Y : C} (c : BinaryFan X Y) : c ≅ BinaryFan.mk c.fst c.snd := Cone.ext (Iso.refl _) fun ⟨l⟩ => by cases l; repeat simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Every `BinaryFan` is isomorphic to an application of `BinaryFan.mk`. -/ def isoBinaryCofanMk {X Y : C} (c : BinaryCofan X Y) : c ≅ BinaryCofan.mk c.inl c.inr := @@ -556,6 +558,7 @@ noncomputable abbrev coprod.inl {X Y : C} [HasBinaryCoproduct X Y] : X ⟶ X ⨿ noncomputable abbrev coprod.inr {X Y : C} [HasBinaryCoproduct X Y] : Y ⟶ X ⨿ Y := colimit.ι (pair X Y) ⟨WalkingPair.right⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The binary fan constructed from the projection maps is a limit. -/ noncomputable def prodIsProd (X Y : C) [HasBinaryProduct X Y] : @@ -566,6 +569,7 @@ noncomputable def prodIsProd (X Y : C) [HasBinaryProduct X Y] : · simp [Category.id_comp] )) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The binary cofan constructed from the coprojection maps is a colimit. -/ noncomputable def coprodIsCoprod (X Y : C) [HasBinaryCoproduct X Y] : @@ -1144,6 +1148,7 @@ lemma BinaryCofan.map_inl {X Y : C} (s : BinaryCofan X Y) : (s.map F).inl = F.ma @[simp] lemma BinaryCofan.map_inr {X Y : C} (s : BinaryCofan X Y) : (s.map F).inr = F.map s.inr := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `F.mapCone s` being limiting is the same as the induced binary fan being limiting. -/ def BinaryFan.isLimitMapConeEquiv {X Y : C} {s : BinaryFan X Y} : @@ -1151,6 +1156,7 @@ def BinaryFan.isLimitMapConeEquiv {X Y : C} {s : BinaryFan X Y} : IsLimit.equivOfNatIsoOfIso (diagramIsoPair _) _ _ <| ext (Iso.refl _) (by simp [fst]) (by simp [snd]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `F.mapCocone s` being colimiting is the same as the induced binary cofan being colimiting. -/ def BinaryCofan.isColimitMapConeEquiv {X Y : C} {s : BinaryCofan X Y} : @@ -1339,6 +1345,7 @@ namespace CategoryTheory variable {C : Type u} [Category.{v} C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `Over.coprod`. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean index 4df104d9343322..86f4b43a0ec0d4 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean @@ -141,6 +141,7 @@ def functoriality (G : C ⥤ D) [Functor.PreservesZeroMorphisms G] : variable (G : C ⥤ D) +set_option backward.isDefEq.respectTransparency.types false in instance functoriality_full [G.PreservesZeroMorphisms] [G.Full] [G.Faithful] : (functoriality F G).Full where map_surjective t := @@ -274,6 +275,7 @@ def whisker {f : J → C} (c : Bicone f) (g : K ≃ J) : Bicone (f ∘ g) where simp only [c.ι_π] split_ifs with h h' h' <;> simp [Equiv.apply_eq_iff_eq g] at h h' <;> tauto +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Taking the cone of a whiskered bicone results in a cone isomorphic to one gained by whiskering the cone and postcomposing with a suitable isomorphism. -/ @@ -283,6 +285,7 @@ def whiskerToCone {f : J → C} (c : Bicone f) (g : K ≃ J) : (c.toCone.whisker (Discrete.functor (Discrete.mk ∘ g))) := Cone.ext (Iso.refl _) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Taking the cocone of a whiskered bicone results in a cone isomorphic to one gained by whiskering the cocone and precomposing with a suitable isomorphism. -/ @@ -690,6 +693,7 @@ lemma biproduct.whiskerEquiv_inv_eq_lift {f : J → C} {g : K → C} (e : J ≃ · rintro rfl simp at h +set_option backward.isDefEq.respectTransparency.types false in attribute [local simp] Sigma.forall in instance {ι} (f : ι → Type*) (g : (i : ι) → (f i) → C) [∀ i, HasBiproduct (g i)] [HasBiproduct fun i => ⨁ g i] : @@ -1043,6 +1047,7 @@ theorem biproduct.conePointUniqueUpToIso_inv (f : J → C) [HasBiproduct f] {b : rw [Category.assoc, IsLimit.conePointUniqueUpToIso_inv_comp, Bicone.toCone_π_app, biproduct.bicone_π, biproduct.ι_desc, biproduct.ι_π, b.toCone_π_app, b.ι_π] +set_option backward.isDefEq.respectTransparency.types false in /-- Biproducts are unique up to isomorphism. This already follows because bilimits are limits, but in the case of biproducts we can give an isomorphism with particularly nice definitional properties, namely that `biproduct.lift b.π` and `biproduct.desc b.ι` are inverses of each diff --git a/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean b/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean index 720a6586168134..2e56b203b8fb7c 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean @@ -102,7 +102,7 @@ variable [ConcreteCategory.{w} C FC] /-- If `forget C` preserves terminals and `X` is terminal, then `ToType X` is a singleton. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def uniqueOfTerminalOfPreserves [PreservesLimit (Functor.empty.{0} C) (forget C)] (X : C) (h : IsTerminal X) : Unique (ToType X) := Types.isTerminalEquivUnique (ToType X) <| IsTerminal.isTerminalObj (forget C) X h diff --git a/Mathlib/CategoryTheory/Limits/Shapes/End.lean b/Mathlib/CategoryTheory/Limits/Shapes/End.lean index f7174f9f0f898a..83c0b53abba90d 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/End.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/End.lean @@ -143,6 +143,7 @@ namespace Cowedge variable {F} +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `CategoryTheory.Limits.Cocone.ext` specialized to produce isomorphisms of cowedges. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean index a6810807769a8f..41c849f2289562 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean @@ -135,6 +135,7 @@ theorem walkingParallelPairOp_left : theorem walkingParallelPairOp_right : walkingParallelPairOp.map right = @Quiver.Hom.op _ _ zero one right := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `WalkingParallelPair ⥤ WalkingParallelPairᵒᵖ` sending left to left and right to @@ -271,6 +272,7 @@ theorem parallelPair_map_right (f g : X ⟶ Y) : (parallelPair f g).map right = theorem parallelPair_functor_obj {F : WalkingParallelPair ⥤ C} (j : WalkingParallelPair) : (parallelPair (F.map left) (F.map right)).obj j = F.obj j := by cases j <;> rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Every functor indexing a (co)equalizer is naturally isomorphic (actually, equal) to a `parallelPair` -/ @[simps!] @@ -393,7 +395,7 @@ theorem Cofork.app_zero_eq_comp_π_right (s : Cofork f g) : s.ι.app zero = g set_option backward.defeqAttrib.useBackward true in /-- A fork on `f g : X ⟶ Y` is determined by the morphism `ι : P ⟶ X` satisfying `ι ≫ f = ι ≫ g`. -/ -@[simps] +@[simps, implicit_reducible] def Fork.ofι {P : C} (ι : P ⟶ X) (w : ι ≫ f = ι ≫ g) : Fork f g where pt := P π := @@ -407,7 +409,7 @@ def Fork.ofι {P : C} (ι : P ⟶ X) (w : ι ≫ f = ι ≫ g) : Fork f g where set_option backward.defeqAttrib.useBackward true in /-- A cofork on `f g : X ⟶ Y` is determined by the morphism `π : Y ⟶ P` satisfying `f ≫ π = g ≫ π`. -/ -@[simps] +@[simps, implicit_reducible] def Cofork.ofπ {P : C} (π : Y ⟶ P) (w : f ≫ π = g ≫ π) : Cofork f g where pt := P ι := @@ -620,6 +622,7 @@ def Cone.ofFork {F : WalkingParallelPair ⥤ C} (t : Fork (F.map left) (F.map ri { app := fun X => t.π.app X ≫ eqToHom (by simp) naturality := by rintro _ _ (_ | _ | _) <;> simp [t.condition] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- This is a helper construction that can be useful when verifying that a category has all coequalizers. Given `F : WalkingParallelPair ⥤ C`, which is really the same as @@ -653,6 +656,7 @@ def Fork.ofCone {F : WalkingParallelPair ⥤ C} (t : Cone F) : Fork (F.map left) π := { app := fun X => t.π.app X ≫ eqToHom (by simp) naturality := by rintro _ _ (_ | _ | _) <;> simp } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `F : WalkingParallelPair ⥤ C`, which is really the same as `parallelPair (F.map left) (F.map right)` and a cocone on `F`, we get a cofork on @@ -931,12 +935,14 @@ variable {f g} def idFork (h : f = g) : Fork f g := Fork.ofι (𝟙 X) <| h ▸ rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The identity on `X` is an equalizer of `(f, g)`, if `f = g`. -/ def isLimitIdFork (h : f = g) : IsLimit (idFork h) := Fork.IsLimit.mk _ (fun s => Fork.ι s) (fun _ => Category.comp_id _) fun s m h => by convert! h exact (Category.comp_id _).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Every equalizer of `(f, g)`, where `f = g`, is an isomorphism. -/ theorem isIso_limit_cone_parallelPair_of_eq (h₀ : f = g) {c : Fork f g} (h : IsLimit c) : IsIso c.ι := @@ -1150,12 +1156,14 @@ variable {f g} def idCofork (h : f = g) : Cofork f g := Cofork.ofπ (𝟙 Y) <| h ▸ rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The identity on `Y` is a coequalizer of `(f, g)`, where `f = g`. -/ def isColimitIdCofork (h : f = g) : IsColimit (idCofork h) := Cofork.IsColimit.mk _ (fun s => Cofork.π s) (fun _ => Category.id_comp _) fun s m h => by convert! h exact (Category.id_comp _).symm +set_option backward.isDefEq.respectTransparency.types false in /-- Every coequalizer of `(f, g)`, where `f = g`, is an isomorphism. -/ theorem isIso_colimit_cocone_parallelPair_of_eq (h₀ : f = g) {c : Cofork f g} (h : IsColimit c) : IsIso c.π := diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean index c91fcb8a76cec2..c353168634b236 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FiniteMultiequalizer.lean @@ -24,6 +24,7 @@ variable {J : MulticospanShape} [Fintype J.L] [Fintype J.R] instance : Fintype (WalkingMulticospan J) := .ofEquiv _ (proxy_equiv% (WalkingMulticospan J)) +set_option backward.isDefEq.respectTransparency.types false in instance [DecidableEq J.L] [DecidableEq J.R] : FinCategory (WalkingMulticospan J) where fintypeHom | .left a, .left b => ⟨if e : a = b then {eqToHom (e ▸ rfl)} else ∅, by rintro ⟨⟩; simp⟩ @@ -51,6 +52,7 @@ variable {J : MultispanShape} [Fintype J.L] [Fintype J.R] instance : Fintype (WalkingMultispan J) := .ofEquiv _ (proxy_equiv% (WalkingMultispan J)) +set_option backward.isDefEq.respectTransparency.types false in instance [DecidableEq J.L] [DecidableEq J.R] : FinCategory (WalkingMultispan J) where fintypeHom | .left a, .left b => ⟨if e : a = b then {eqToHom (e ▸ rfl)} else ∅, by rintro ⟨⟩; simp⟩ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean b/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean index 358803ff0ee2ce..389802cb63ad81 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FunctorToTypes.lean @@ -50,6 +50,7 @@ def prod.fst : prod F G ⟶ F where def prod.snd : prod F G ⟶ G where app _ := ↾fun a ↦ a.2 +set_option backward.isDefEq.respectTransparency.types false in /-- Given natural transformations `F ⟶ F₁` and `F ⟶ F₂`, construct a natural transformation `F ⟶ prod F₁ F₂`. -/ @[simps] @@ -57,10 +58,12 @@ def prod.lift {F₁ F₂ : C ⥤ Type w} (τ₁ : F ⟶ F₁) (τ₂ : F ⟶ F F ⟶ prod F₁ F₂ where app x := ↾fun y ↦ ⟨τ₁.app x y, τ₂.app x y⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod.lift_fst {F₁ F₂ : C ⥤ Type w} (τ₁ : F ⟶ F₁) (τ₂ : F ⟶ F₂) : prod.lift τ₁ τ₂ ≫ prod.fst = τ₁ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod.lift_snd {F₁ F₂ : C ⥤ Type w} (τ₁ : F ⟶ F₁) (τ₂ : F ⟶ F₂) : prod.lift τ₁ τ₂ ≫ prod.snd = τ₂ := rfl @@ -72,6 +75,7 @@ variable (F G) def binaryProductCone : BinaryFan F G := BinaryFan.mk prod.fst prod.snd +set_option backward.isDefEq.respectTransparency.types false in /-- `prod F G` is a limit cone. -/ @[simps] def binaryProductLimit : IsLimit (binaryProductCone F G) where @@ -81,6 +85,7 @@ def binaryProductLimit : IsLimit (binaryProductCone F G) where simp only [← h ⟨WalkingPair.right⟩, ← h ⟨WalkingPair.left⟩] congr +set_option backward.isDefEq.respectTransparency.types false in /-- `prod F G` is a binary product for `F` and `G`. -/ def binaryProductLimitCone : Limits.LimitCone (pair F G) := ⟨_, binaryProductLimit F G⟩ @@ -89,10 +94,12 @@ def binaryProductLimitCone : Limits.LimitCone (pair F G) := noncomputable def binaryProductIso : F ⨯ G ≅ prod F G := limit.isoLimitCone (binaryProductLimitCone F G) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma binaryProductIso_hom_comp_fst : (binaryProductIso F G).hom ≫ prod.fst = Limits.prod.fst := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma binaryProductIso_hom_comp_snd : (binaryProductIso F G).hom ≫ prod.snd = Limits.prod.snd := rfl @@ -127,11 +134,13 @@ noncomputable def prodMk {a : C} (x : F.obj a) (y : G.obj a) : (F ⨯ G).obj a := ((binaryProductIso F G).inv).app a ⟨x, y⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prodMk_fst {a : C} (x : F.obj a) (y : G.obj a) : (Limits.prod.fst (X := F)).app a (prodMk x y) = x := by simp [prodMk] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prodMk_snd {a : C} (x : F.obj a) (y : G.obj a) : (Limits.prod.snd (X := F)).app a (prodMk x y) = y := by @@ -143,6 +152,7 @@ lemma prod_ext {a : C} (z w : (prod F G).obj a) (h1 : z.1 = w.1) (h2 : z.2 = w.2 variable (F G) +set_option backward.isDefEq.respectTransparency.types false in /-- `(F ⨯ G).obj a` is in bijection with the product of `F.obj a` and `G.obj a`. -/ @[simps] noncomputable @@ -152,6 +162,7 @@ def binaryProductEquiv (a : C) : (F ⨯ G).obj a ≃ (F.obj a) × (G.obj a) wher left_inv _ := by simp [-prod_obj, prodMk] right_inv _ := by simp [-prod_obj, prodMk] +set_option backward.isDefEq.respectTransparency.types false in @[ext] lemma prod_ext' (a : C) (z w : (F ⨯ G).obj a) (h1 : (Limits.prod.fst (X := F)).app a z = (Limits.prod.fst (X := F)).app a w) @@ -208,6 +219,7 @@ variable (F G) def binaryCoproductCocone : BinaryCofan F G := BinaryCofan.mk coprod.inl coprod.inr +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `coprod F G` is a colimit cocone. -/ @[simps] @@ -280,6 +292,7 @@ abbrev coprodInr {a : C} (x : G.obj a) : (F ⨿ G).obj a := variable (F G) +set_option backward.isDefEq.respectTransparency.types false in /-- `(F ⨿ G).obj a` is in bijection with disjoint union of `F.obj a` and `G.obj a`. -/ @[simps] noncomputable diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean index 7a32afb6b3122a..447e8fb73759c9 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean @@ -208,6 +208,7 @@ theorem fac_lift {F : MonoFactorisation f} (hF : IsImage F) (F' : MonoFactorisat variable (f) +set_option backward.isDefEq.respectTransparency.types false in /-- The trivial factorisation of a monomorphism satisfies the universal property. -/ @[simps] def self [Mono f] : IsImage (MonoFactorisation.self f) where lift F' := F'.e @@ -249,6 +250,7 @@ def ofArrowIso {f g : Arrow C} {F : MonoFactorisation f.hom} (hF : IsImage F) (s simpa only [MonoFactorisation.ofArrowIso_m, Arrow.inv_right, ← Category.assoc, IsIso.comp_inv_eq] using hF.lift_fac (F'.ofArrowIso (inv sq)) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a mono factorisation `X ⟶ I ⟶ Y` of an arrow `f` that is an image and an isomorphism `I ≅ I'`, the induced mono factorisation by the isomorphism is also an image. @@ -351,6 +353,7 @@ def Image.isImage : IsImage (Image.monoFactorisation f) := (Image.imageFactorisation f).isImage /-- The categorical image of a morphism. -/ +@[implicit_reducible] def image : C := (Image.monoFactorisation f).I diff --git a/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean b/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean index f68d561c9176f3..6419ea112e698d 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean @@ -38,7 +38,7 @@ namespace CategoryTheory.Limits variable {C : Type u₁} [Category.{v₁} C] /-- Construct a cone for the empty diagram given an object. -/ -@[simps] +@[simps, implicit_reducible] def asEmptyCone (X : C) : Cone (Functor.empty.{0} C) := { pt := X π := @@ -92,6 +92,7 @@ def IsTerminal.ofUniqueHom {Y : C} (h : ∀ X : C, X ⟶ Y) (uniq : ∀ (X : C) def isTerminalTop {α : Type*} [Preorder α] [OrderTop α] : IsTerminal (⊤ : α) := IsTerminal.ofUnique _ +set_option backward.isDefEq.respectTransparency.types false in /-- Transport a term of type `IsTerminal` across an isomorphism. -/ def IsTerminal.ofIso {Y Z : C} (hY : IsTerminal Y) (i : Y ≅ Z) : IsTerminal Z := IsLimit.ofIsoLimit hY @@ -136,6 +137,7 @@ def IsInitial.ofUniqueHom {X : C} (h : ∀ Y : C, X ⟶ Y) (uniq : ∀ (Y : C) ( def isInitialBot {α : Type*} [Preorder α] [OrderBot α] : IsInitial (⊥ : α) := IsInitial.ofUnique _ +set_option backward.isDefEq.respectTransparency.types false in /-- Transport a term of type `IsInitial` across an isomorphism. -/ def IsInitial.ofIso {X Y : C} (hX : IsInitial X) (i : X ≅ Y) : IsInitial Y := IsColimit.ofIsoColimit hX @@ -348,6 +350,7 @@ def coneOfDiagramInitial {X : J} (tX : IsInitial X) (F : J ⥤ C) : Cone F where dsimp rw [← F.map_comp, Category.id_comp, tX.hom_ext (tX.to j ≫ k) (tX.to j')] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- From a functor `F : J ⥤ C`, given an initial object of `J`, show the cone `coneOfDiagramInitial` is a limit. -/ @@ -376,6 +379,7 @@ def coneOfDiagramTerminal {X : J} (hX : IsTerminal X) (F : J ⥤ C) simp only [IsIso.eq_inv_comp, IsIso.comp_inv_eq, Category.id_comp, ← F.map_comp, hX.hom_ext (hX.from i) (f ≫ hX.from j)] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- From a functor `F : J ⥤ C`, given a terminal object of `J` and that the morphisms in the diagram are isomorphisms, show the cone `coneOfDiagramTerminal` is a limit. -/ @@ -395,6 +399,7 @@ def coconeOfDiagramTerminal {X : J} (tX : IsTerminal X) (F : J ⥤ C) : Cocone F dsimp rw [← F.map_comp, Category.comp_id, tX.hom_ext (k ≫ tX.from j') (tX.from j)] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- From a functor `F : J ⥤ C`, given a terminal object of `J`, show the cocone `coconeOfDiagramTerminal` is a colimit. -/ @@ -426,6 +431,7 @@ def coconeOfDiagramInitial {X : J} (hX : IsInitial X) (F : J ⥤ C) simp only [IsIso.eq_inv_comp, IsIso.comp_inv_eq, Category.comp_id, ← F.map_comp, hX.hom_ext (hX.to i ≫ f) (hX.to j)] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- From a functor `F : J ⥤ C`, given an initial object of `J` and that the morphisms in the diagram are isomorphisms, show the cone `coconeOfDiagramInitial` is a colimit. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean b/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean index ce65d956ac1222..8680dd87f44c4e 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/KernelPair.lean @@ -209,6 +209,7 @@ theorem mono_of_eq_fst_snd' (h : IsKernelPair f a a) : Mono f := theorem mono_of_eq_fst_snd (h : IsKernelPair f a b) (e : a = b) : Mono f := by induction e; exact h.mono_of_eq_fst_snd' +set_option backward.isDefEq.respectTransparency.types false in theorem isIso_of_mono (h : IsKernelPair f a b) [Mono f] : IsIso a := by rw [← show _ = a from diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean index 7714d20b79f979..6d2b17dcd514b7 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean @@ -106,6 +106,7 @@ set_option backward.defeqAttrib.useBackward true in def isoOfι (s : Fork f 0) : s ≅ Fork.ofι (Fork.ι s) (Fork.condition s) := Cone.ext (Iso.refl _) <| by aesop +set_option backward.isDefEq.respectTransparency.types false in /-- If `ι = ι'`, then `fork.ofι ι _` and `fork.ofι ι' _` are isomorphic. -/ def ofιCongr {P : C} {ι ι' : P ⟶ X} {w : ι ≫ f = 0} (h : ι = ι') : KernelFork.ofι ι w ≅ KernelFork.ofι ι' (by rw [← h, w]) := @@ -531,7 +532,9 @@ end HasZeroObject section Transport +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in /-- Transport an `IsKernel` across isomorphisms. -/ def IsKernel.ofIso {X' Y' : C} {f' : X' ⟶ Y'} {s : KernelFork f} (hs : IsLimit s) (s' : KernelFork f') (eX : X ≅ X') (eY : Y ≅ Y') (e : s.pt ≅ s'.pt) @@ -617,6 +620,7 @@ set_option backward.defeqAttrib.useBackward true in def isoOfπ (s : Cofork f 0) : s ≅ Cofork.ofπ (Cofork.π s) (Cofork.condition s) := Cocone.ext (Iso.refl _) fun j => by cases j <;> cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- If `π = π'`, then `CokernelCofork.of_π π _` and `CokernelCofork.of_π π' _` are isomorphic. -/ def ofπCongr {P : C} {π π' : Y ⟶ P} {w : f ≫ π = 0} (h : π = π') : CokernelCofork.ofπ π w ≅ CokernelCofork.ofπ π' (by rw [← h, w]) := @@ -1187,6 +1191,7 @@ def IsCokernel.cokernelIso {Z : C} (l : Y ⟶ Z) {s : CokernelCofork f} (hs : Is · dsimp; rw [← h]; simp · exact h +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Transport an `IsCokernel` across isomorphisms. -/ def IsCokernel.ofIso {X' Y' : C} {f' : X' ⟶ Y'} {s : CokernelCofork f} (hs : IsColimit s) @@ -1303,10 +1308,12 @@ noncomputable def ker : Arrow C ⥤ C where obj f := kernel f.hom map {f g} u := kernel.lift _ (kernel.ι _ ≫ u.left) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The kernel inclusion is natural. -/ @[simps] def ker.ι : ker (C := C) ⟶ Arrow.leftFunc where app f := kernel.ι _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma ker.condition : ι C ≫ Arrow.leftToRight = 0 := by cat_disch @@ -1321,10 +1328,12 @@ noncomputable def coker : Arrow C ⥤ C where obj f := cokernel f.hom map {f g} u := cokernel.desc _ (u.right ≫ cokernel.π _) (by simp [← Arrow.w_assoc u]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The cokernel projection is natural. -/ @[simps] def coker.π : Arrow.rightFunc ⟶ coker (C := C) where app f := cokernel.π _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma coker.condition : Arrow.leftToRight ≫ π C = 0 := by cat_disch diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean index 90cd3c1b5577cb..f8c4e837a6fffc 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Multiequalizer.lean @@ -162,6 +162,7 @@ def functorExt {C : Type*} [Category* C] {F G : WalkingMulticospan J ⥤ C} NatIso.ofComponents (fun j ↦ match j with | .left i => left i | .right i => right i) <| by rintro _ _ ⟨_⟩ <;> simp [wl, wr] +set_option backward.isDefEq.respectTransparency.types false in lemma functor_ext {C : Type*} [Category* C] {F G : WalkingMulticospan J ⥤ C} (left : ∀ i, F.obj (.left i) = G.obj (.left i)) (right : ∀ i, F.obj (.right i) = G.obj (.right i)) @@ -528,6 +529,7 @@ theorem app_right_eq_ι_comp_snd (b) : theorem hom_comp_ι (K₁ K₂ : Multifork I) (f : K₁ ⟶ K₂) (j : J.L) : f.hom ≫ K₂.ι j = K₁.ι j := f.w _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Construct a multifork using a collection `ι` of morphisms. -/ @[simps] @@ -613,12 +615,14 @@ lemma IsLimit.hom_ext (hK : IsLimit K) {T : C} {f g : T ⟶ K.pt} · dsimp rw [app_right_eq_ι_comp_fst, reassoc_of% h] +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for morphisms to the point of a limit multifork. -/ def IsLimit.lift (hK : IsLimit K) {T : C} (k : ∀ a, T ⟶ I.left a) (hk : ∀ b, k (J.fst b) ≫ I.fst b = k (J.snd b) ≫ I.snd b) : T ⟶ K.pt := hK.lift (Multifork.ofι _ _ k hk) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma IsLimit.fac (hK : IsLimit K) {T : C} (k : ∀ a, T ⟶ I.left a) (hk : ∀ b, k (J.fst b) ≫ I.fst b = k (J.snd b) ≫ I.snd b) (a : J.L) : @@ -746,6 +750,7 @@ def ofPiForkFunctor : { hom := f.hom w := by rintro (_ | _) <;> simp } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of multiforks is equivalent to the category of forks over `∏ᶜ I.left ⇉ ∏ᶜ I.right`. It then follows from `CategoryTheory.IsLimit.ofPreservesConeTerminal` (or `reflects`) that it @@ -766,6 +771,7 @@ def multiforkEquivPiForkOfIsLimit : variable [HasProduct I.left] [HasProduct I.right] +set_option backward.isDefEq.respectTransparency.types false in /-- The category of multiforks is equivalent to the category of forks over `∏ᶜ I.left ⇉ ∏ᶜ I.right`. It then follows from `CategoryTheory.IsLimit.ofPreservesConeTerminal` (or `reflects`) that it preserves and reflects limit cones. @@ -801,6 +807,7 @@ def multiforkOfParallelHomsEquivFork (J : MulticospanShape) [Unique J.L] [Unique Category.comp_id, sndPiMapOfIsLimit_proj] simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma multiforkOfParallelHomsEquivFork_functor_obj_ι (J : MulticospanShape) [Unique J.L] [Unique J.R] {X Y : C} (f g : X ⟶ Y) (c : Multifork (ofParallelHoms J f g)) : @@ -1012,6 +1019,7 @@ noncomputable def ofSigmaCoforkFunctor : { hom := f.hom w := by rintro (_ | _) <;> simp } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The category of multicoforks is equivalent to the category of coforks over `∐ I.left ⇉ ∐ I.right`. @@ -1033,6 +1041,7 @@ noncomputable def multicoforkEquivSigmaCoforkOfIsColimit : variable [HasCoproduct I.left] [HasCoproduct I.right] +set_option backward.isDefEq.respectTransparency.types false in /-- The category of multicoforks is equivalent to the category of coforks over `∐ I.left ⇉ ∐ I.right`. It then follows from `CategoryTheory.IsColimit.ofPreservesCoconeInitial` (or `reflects`) that @@ -1114,6 +1123,7 @@ variable [HasProduct I.left] [HasProduct I.right] instance : HasEqualizer I.fstPiMap I.sndPiMap := ⟨⟨⟨_, IsLimit.ofPreservesConeTerminal I.multiforkEquivPiFork.functor (limit.isLimit _)⟩⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The multiequalizer is isomorphic to the equalizer of `∏ᶜ I.left ⇉ ∏ᶜ I.right`. -/ def isoEqualizer : multiequalizer I ≅ equalizer I.fstPiMap I.sndPiMap := limit.isoLimitCone @@ -1194,6 +1204,7 @@ instance : HasCoequalizer I.fstSigmaMap I.sndSigmaMap := IsColimit.ofPreservesCoconeInitial I.multicoforkEquivSigmaCofork.functor (colimit.isColimit _)⟩⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The multicoequalizer is isomorphic to the coequalizer of `∐ I.left ⇉ ∐ I.right`. -/ def isoCoequalizer : multicoequalizer I ≅ coequalizer I.fstSigmaMap I.sndSigmaMap := colimit.isoColimitCocone @@ -1257,6 +1268,7 @@ def toLinearOrder : MultispanIndex (.ofLinearOrder ι) C where fst j := I.fst j.1 snd j := I.snd j.1 +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a linearly ordered type `ι` and `I : MultispanIndex (.prod ι) C`, this is the isomorphism of functors between diff --git a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean index b440455edad094..d4df2767dc7234 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean @@ -54,9 +54,10 @@ attribute [inherit_doc NormalMono] NormalMono.Z NormalMono.g NormalMono.w Normal section +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` is an equivalence and `F.map f` is a normal mono, then `f` is a normal mono. -/ -@[implicit_reducible] +@[instance_reducible] def equivalenceReflectsNormalMono {D : Type u₂} [Category.{v₁} D] [HasZeroMorphisms D] (F : C ⥤ D) [F.IsEquivalence] {X Y : C} {f : X ⟶ Y} (hf : NormalMono (F.map f)) : NormalMono f where Z := F.objPreimage hf.Z @@ -93,7 +94,7 @@ def NormalMono.lift' {W : C} (f : X ⟶ Y) [hf : NormalMono f] (k : W ⟶ Y) (h See also `pullback.sndOfMono` for the basic monomorphism version, and `normalOfIsPullbackFstOfNormal` for the flipped version. -/ -@[implicit_reducible] +@[instance_reducible] def normalOfIsPullbackSndOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [hn : NormalMono h] (comm : f ≫ h = g ≫ k) (t : IsLimit (PullbackCone.mk _ _ comm)) : NormalMono g where @@ -113,7 +114,7 @@ def normalOfIsPullbackSndOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : See also `pullback.fstOfMono` for the basic monomorphism version, and `normalOfIsPullbackSndOfNormal` for the flipped version. -/ -@[implicit_reducible] +@[instance_reducible] def normalOfIsPullbackFstOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [NormalMono k] (comm : f ≫ h = g ≫ k) (t : IsLimit (PullbackCone.mk _ _ comm)) : NormalMono f := @@ -122,7 +123,7 @@ def normalOfIsPullbackFstOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Transport a `NormalMono` structure via an isomorphism of arrows. -/ -@[implicit_reducible] +@[instance_reducible] def NormalMono.ofArrowIso {X Y : C} {f : X ⟶ Y} (hf : NormalMono f) {X' Y' : C} {f' : X' ⟶ Y'} (e : Arrow.mk f ≅ Arrow.mk f') : NormalMono f' where @@ -151,7 +152,7 @@ end /-- In a category in which every monomorphism is normal, we can express every monomorphism as a kernel. This is not an instance because it would create an instance loop. -/ -@[implicit_reducible] +@[instance_reducible] def normalMonoOfMono [IsNormalMonoCategory C] (f : X ⟶ Y) [Mono f] : NormalMono f := (IsNormalMonoCategory.normalMonoOfMono _).some @@ -178,9 +179,10 @@ attribute [inherit_doc NormalEpi] NormalEpi.W NormalEpi.g NormalEpi.w NormalEpi. section +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F` is an equivalence and `F.map f` is a normal epi, then `f` is a normal epi. -/ -@[implicit_reducible] +@[instance_reducible] def equivalenceReflectsNormalEpi {D : Type u₂} [Category.{v₁} D] [HasZeroMorphisms D] (F : C ⥤ D) [F.IsEquivalence] {X Y : C} {f : X ⟶ Y} (hf : NormalEpi (F.map f)) : NormalEpi f where W := F.objPreimage hf.W @@ -214,7 +216,7 @@ def NormalEpi.desc' {W : C} (f : X ⟶ Y) [nef : NormalEpi f] (k : X ⟶ W) (h : See also `pushout.sndOfEpi` for the basic epimorphism version, and `normalOfIsPushoutFstOfNormal` for the flipped version. -/ -@[implicit_reducible] +@[instance_reducible] def normalOfIsPushoutSndOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [gn : NormalEpi g] (comm : f ≫ h = g ≫ k) (t : IsColimit (PushoutCocone.mk _ _ comm)) : NormalEpi h where @@ -234,7 +236,7 @@ def normalOfIsPushoutSndOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : See also `pushout.fstOfEpi` for the basic epimorphism version, and `normalOfIsPushoutSndOfNormal` for the flipped version. -/ -@[implicit_reducible] +@[instance_reducible] def normalOfIsPushoutFstOfNormal {P Q R S : C} {f : P ⟶ Q} {g : P ⟶ R} {h : Q ⟶ S} {k : R ⟶ S} [NormalEpi f] (comm : f ≫ h = g ≫ k) (t : IsColimit (PushoutCocone.mk _ _ comm)) : NormalEpi k := @@ -249,7 +251,7 @@ variable [HasZeroMorphisms C] set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Transport a `NormalEpi` structure via an isomorphism of arrows. -/ -@[implicit_reducible] +@[instance_reducible] def NormalEpi.ofArrowIso {X Y : C} {f : X ⟶ Y} (hf : NormalEpi f) {X' Y' : C} {f' : X' ⟶ Y'} (e : Arrow.mk f ≅ Arrow.mk f') : NormalEpi f' where @@ -267,7 +269,7 @@ def NormalEpi.ofArrowIso {X Y : C} {f : X ⟶ Y} set_option backward.defeqAttrib.useBackward true in /-- A normal mono becomes a normal epi in the opposite category. -/ -@[implicit_reducible] +@[instance_reducible] def normalEpiOfNormalMonoUnop {X Y : Cᵒᵖ} (f : X ⟶ Y) (m : NormalMono f.unop) : NormalEpi f where W := op m.Z g := m.g.op @@ -287,7 +289,7 @@ def normalEpiOfNormalMonoUnop {X Y : Cᵒᵖ} (f : X ⟶ Y) (m : NormalMono f.un set_option backward.defeqAttrib.useBackward true in /-- A normal epi becomes a normal mono in the opposite category. -/ -@[implicit_reducible] +@[instance_reducible] def normalMonoOfNormalEpiUnop {X Y : Cᵒᵖ} (f : X ⟶ Y) (m : NormalEpi f.unop) : NormalMono f where Z := op m.W g := m.g.op @@ -319,7 +321,7 @@ end /-- In a category in which every epimorphism is normal, we can express every epimorphism as a kernel. This is not an instance because it would create an instance loop. -/ -@[implicit_reducible] +@[instance_reducible] def normalEpiOfEpi [IsNormalEpiCategory C] (f : X ⟶ Y) [Epi f] : NormalEpi f := (IsNormalEpiCategory.normalEpiOfEpi _).some diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean index dbd325de31bf8a..e3225584c0baed 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Equalizers.lean @@ -80,24 +80,28 @@ def opParallelPairIso {X Y : C} (f g : X ⟶ Y) : _ ≅ walkingParallelPairOpEquiv.inverse ⋙ parallelPair f.op g.op := isoWhiskerLeft _ (parallelPairOpIso f g).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma opParallelPairIso_hom_app_zero {X Y : C} (f g : X ⟶ Y) : (opParallelPairIso f g).hom.app (op WalkingParallelPair.zero) = 𝟙 _ := by simp [opParallelPairIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma opParallelPairIso_hom_app_one {X Y : C} (f g : X ⟶ Y) : (opParallelPairIso f g).hom.app (op WalkingParallelPair.one) = 𝟙 _ := by simp [opParallelPairIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma opParallelPairIso_inv_app_zero {X Y : C} (f g : X ⟶ Y) : (opParallelPairIso f g).inv.app (op WalkingParallelPair.zero) = 𝟙 _ := by simp [opParallelPairIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma opParallelPairIso_inv_app_one {X Y : C} (f g : X ⟶ Y) : @@ -130,16 +134,19 @@ def op {X Y : C} {f g : X ⟶ Y} (c : Cofork f g) : Fork f.op g.op := (Cone.postcompose (parallelPairOpIso f g).symm.hom).obj (Cone.whisker walkingParallelPairOpEquiv.functor (Cocone.op c)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma op_π_app_one {X Y : C} {f g : X ⟶ Y} (c : Cofork f g) : c.op.π.app .one = Quiver.Hom.op (c.ι.app .zero) := by simp [op] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma op_π_app_zero {X Y : C} {f g : X ⟶ Y} (c : Cofork f g) : c.op.π.app .zero = Quiver.Hom.op (c.ι.app .one) := by simp [op] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem op_ι {X Y : C} {f g : X ⟶ Y} (c : Cofork f g) : c.op.ι = c.π.op := by simp [Cofork.op, Fork.ι] @@ -153,16 +160,19 @@ def unop {X Y : Cᵒᵖ} {f g : X ⟶ Y} (c : Fork f g) : Cofork f.unop g.unop : Cone.unop ((Cone.postcompose (opParallelPairIso f.unop g.unop).symm.hom).obj (Cone.whisker walkingParallelPairOpEquiv.inverse c)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma unop_ι_app_one {X Y : Cᵒᵖ} {f g : X ⟶ Y} (c : Fork f g) : c.unop.ι.app .one = Quiver.Hom.unop (c.π.app .zero) := by simp [unop] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma unop_ι_app_zero {X Y : Cᵒᵖ} {f g : X ⟶ Y} (c : Fork f g) : c.unop.ι.app .zero = Quiver.Hom.unop (c.π.app .one) := by simp [unop] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem unop_π {X Y : Cᵒᵖ} {f g : X ⟶ Y} (c : Fork f g) : c.unop.π = c.ι.unop := by simp [Fork.unop, Cofork.π] @@ -338,6 +348,7 @@ end Fork namespace Cofork +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Cofork.ofπ f pullback.condition` is a colimit cocone if and only if `Fork.ofι f.op pushout.condition` in the opposite category is a limit cone. -/ @@ -354,6 +365,7 @@ def isColimitCoforkPushoutEquivIsColimitForkOpPullback left_inv := by cat_disch right_inv := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Cofork.ofπ f pullback.condition` is a colimit cocone in `Cᵒᵖ` if and only if `Fork.ofι f.unop pushout.condition` in `C` is a limit cone. -/ @@ -375,6 +387,7 @@ end Cofork namespace Fork +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Fork.ofι f pushout.condition` is a limit cone if and only if `Cofork.ofπ f.op pullback.condition` in the opposite category is a colimit cocone. -/ @@ -396,6 +409,7 @@ def isLimitForkPushoutEquivIsColimitForkOpPullback left_inv := by cat_disch right_inv := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Fork.ofι f pushout.condition` is a limit cone in `Cᵒᵖ` if and only if `Cofork.ofπ f.op pullback.condition` in `C` is a colimit cocone. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean index 7ed24f4290765c..cf698c8ef6fa4e 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean @@ -99,9 +99,10 @@ instance : HasProduct (op <| Z ·) := hasLimit_of_iso Discrete.functor (op <| Z ·)) /-- A `Cofan` gives a `Fan` in the opposite category. -/ -@[simp] +@[simp, implicit_reducible] def Cofan.op (c : Cofan Z) : Fan (op <| Z ·) := Fan.mk _ (fun a ↦ (c.inj a).op) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If a `Cofan` is colimit, then its opposite is limit. -/ -- noncomputability is just for performance (compilation takes a while) @@ -182,6 +183,7 @@ theorem desc_op_comp_opCoproductIsoProduct'_hom {c : Cofan Z} {f : Fan (op <| Z erw [opCoproductIsoProduct'_inv_comp_inj, IsLimit.fac] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem desc_op_comp_opCoproductIsoProduct_hom [HasCoproduct Z] {X : C} (π : (a : α) → Z a ⟶ X) : (Sigma.desc π).op ≫ (opCoproductIsoProduct Z).hom = Pi.lift (fun a ↦ (π a).op) := by @@ -189,7 +191,7 @@ theorem desc_op_comp_opCoproductIsoProduct_hom [HasCoproduct Z] {X : C} (π : (a desc_op_comp_opCoproductIsoProduct'_hom (coproductIsCoproduct Z) (productIsProduct (op <| Z ·)) (Cofan.mk _ π) · simp [Sigma.desc, coproductIsCoproduct] - · simp [Pi.lift, productIsProduct] + · simp [productIsProduct] end OppositeCoproducts @@ -214,6 +216,7 @@ instance : HasCoproduct (op <| Z ·) := hasColimit_of_iso @[simp] def Fan.op (f : Fan Z) : Cofan (op <| Z ·) := Cofan.mk _ (fun a ↦ (f.proj a).op) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If a `Fan` is limit, then its opposite is colimit. -/ -- noncomputability is just for performance (compilation takes a while) @@ -281,6 +284,7 @@ theorem opProductIsoCoproduct'_inv_comp_lift {f : Fan Z} {c : Cofan (op <| Z ·) erw [← Category.assoc, proj_comp_opProductIsoCoproduct'_hom, IsColimit.fac] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem opProductIsoCoproduct_inv_comp_lift [HasProduct Z] {X : C} (π : (a : α) → X ⟶ Z a) : (opProductIsoCoproduct Z).inv ≫ (Pi.lift π).op = Sigma.desc (fun a ↦ (π a).op) := by @@ -288,7 +292,7 @@ theorem opProductIsoCoproduct_inv_comp_lift [HasProduct Z] {X : C} (π : (a : α opProductIsoCoproduct'_inv_comp_lift (productIsProduct Z) (coproductIsCoproduct (op <| Z ·)) (Fan.mk _ π) · simp [Pi.lift, productIsProduct] - · simp [Sigma.desc, coproductIsCoproduct] + · simp [coproductIsCoproduct] end OppositeProducts diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean index ffe8ab9e0a96bc..0972fb697741ee 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean @@ -42,6 +42,7 @@ instance hasPushouts_opposite [HasPullbacks C] : HasPushouts Cᵒᵖ := by hasLimitsOfShape_of_equivalence walkingSpanOpEquiv.symm infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism relating `Span f.op g.op` and `(Cospan f g).op` -/ @[simps!] @@ -53,6 +54,7 @@ def spanOp {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) : | .right => .refl _) (by rintro (_ | _ | _) (_ | _ | _) f <;> cases f <;> cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism relating `span f.unop g.unop` and `(cospan f g).leftOp` -/ @[simps!] @@ -76,6 +78,7 @@ def opCospan {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) : Functor.associator _ _ _ _ ≅ walkingCospanOpEquiv.functor ⋙ span f.op g.op := isoWhiskerLeft _ (spanOp f g).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism relating `Cospan f.op g.op` and `(Span f g).op` -/ @[simps!] @@ -87,6 +90,7 @@ def cospanOp {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : | .right => .refl _) (by rintro (_ | _ | _) (_ | _ | _) f <;> cases f <;> cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism relating `cospan f.unop g.unop` and `(span f g).leftOp` -/ @[simps!] @@ -119,9 +123,11 @@ def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : Cocone.unop ((Cocone.precompose (opCospan f.unop g.unop).hom).obj (Cocone.whisker walkingCospanOpEquiv.functor c)) +set_option backward.isDefEq.respectTransparency.types false in theorem unop_fst {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.unop.fst = c.inl.unop := by simp +set_option backward.isDefEq.respectTransparency.types false in theorem unop_snd {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.unop.snd = c.inr.unop := by simp @@ -131,9 +137,11 @@ def op {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : Pullbac (Cone.postcompose (cospanOp f g).symm.hom).obj (Cone.whisker walkingSpanOpEquiv.inverse (Cocone.op c)) +set_option backward.isDefEq.respectTransparency.types false in theorem op_fst {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.op.fst = c.inl.op := by simp +set_option backward.isDefEq.respectTransparency.types false in theorem op_snd {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.op.snd = c.inr.op := by simp @@ -149,9 +157,11 @@ def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : ((Cone.postcompose (opSpan f.unop g.unop).symm.hom).obj (Cone.whisker walkingSpanOpEquiv.functor c)) +set_option backward.isDefEq.respectTransparency.types false in theorem unop_inl {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.unop.inl = c.fst.unop := by simp +set_option backward.isDefEq.respectTransparency.types false in theorem unop_inr {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.unop.inr = c.snd.unop := by simp @@ -161,17 +171,21 @@ def op {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : PushoutC (Cocone.precompose (spanOp f g).hom).obj (Cocone.whisker walkingCospanOpEquiv.inverse (Cone.op c)) +set_option backward.isDefEq.respectTransparency.types false in theorem op_inl {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.op.inl = c.fst.op := by simp +set_option backward.isDefEq.respectTransparency.types false in theorem op_inr {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.op.inr = c.snd.op := by simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `c` is a pullback cone, then `c.op.unop` is isomorphic to `c`. -/ def opUnopIso {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.op.unop ≅ c := PullbackCone.ext (Iso.refl _) (by simp) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `c` is a pullback cone in `Cᵒᵖ`, then `c.unop.op` is isomorphic to `c`. -/ def unopOpIso {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.unop.op ≅ c := @@ -181,11 +195,13 @@ end PullbackCone namespace PushoutCocone +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `c` is a pushout cocone, then `c.op.unop` is isomorphic to `c`. -/ def opUnopIso {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.op.unop ≅ c := PushoutCocone.ext (Iso.refl _) (by simp) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `c` is a pushout cocone in `Cᵒᵖ`, then `c.unop.op` is isomorphic to `c`. -/ def unopOpIso {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.unop.op ≅ c := @@ -266,11 +282,13 @@ noncomputable def pullbackIsoUnopPushout {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) IsLimit.conePointUniqueUpToIso (@limit.isLimit _ _ _ _ _ h) ((PushoutCocone.isColimitEquivIsLimitUnop _) (colimit.isColimit (span f.op g.op))) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pullbackIsoUnopPushout_inv_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g] : (pullbackIsoUnopPushout f g).inv ≫ pullback.fst f g = (pushout.inl f.op g.op).unop := (IsLimit.conePointUniqueUpToIso_inv_comp _ _ _).trans (by simp [unop_id (X := { unop := X })]) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pullbackIsoUnopPushout_inv_snd {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g] : (pullbackIsoUnopPushout f g).inv ≫ pullback.snd f g = (pushout.inr f.op g.op).unop := @@ -293,11 +311,13 @@ noncomputable def pullbackIsoOpPushout {X Y Z : Cᵒᵖ} (f : X ⟶ Z) (g : Y IsLimit.conePointUniqueUpToIso (@limit.isLimit _ _ _ _ _ h) ((PushoutCocone.isColimitEquivIsLimitOp _) (colimit.isColimit (span f.unop g.unop))) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pullbackIsoOpPushout_inv_fst {X Y Z : Cᵒᵖ} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g] : (pullbackIsoOpPushout f g).inv ≫ pullback.fst f g = (pushout.inl f.unop g.unop).op := (IsLimit.conePointUniqueUpToIso_inv_comp _ _ _).trans (by simp) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pullbackIsoOpPushout_inv_snd {X Y Z : Cᵒᵖ} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g] : (pullbackIsoOpPushout f g).inv ≫ pullback.snd f g = (pushout.inr f.unop g.unop).op := @@ -342,11 +362,13 @@ noncomputable def pushoutIsoUnopPullback {X Y Z : C} (f : X ⟶ Z) (g : X ⟶ Y) IsColimit.coconePointUniqueUpToIso (@colimit.isColimit _ _ _ _ _ h) ((PullbackCone.isLimitEquivIsColimitUnop _) (limit.isLimit (cospan f.op g.op))) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pushoutIsoUnopPullback_inl_hom {X Y Z : C} (f : X ⟶ Z) (g : X ⟶ Y) [HasPushout f g] : pushout.inl _ _ ≫ (pushoutIsoUnopPullback f g).hom = (pullback.fst f.op g.op).unop := (IsColimit.comp_coconePointUniqueUpToIso_hom _ _ _).trans (by simp) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pushoutIsoUnopPullback_inr_hom {X Y Z : C} (f : X ⟶ Z) (g : X ⟶ Y) [HasPushout f g] : pushout.inr _ _ ≫ (pushoutIsoUnopPullback f g).hom = (pullback.snd f.op g.op).unop := @@ -369,11 +391,13 @@ noncomputable def pushoutIsoOpPullback {X Y Z : Cᵒᵖ} (f : X ⟶ Z) (g : X IsColimit.coconePointUniqueUpToIso (@colimit.isColimit _ _ _ _ _ h) ((PullbackCone.isLimitEquivIsColimitOp _) (limit.isLimit (cospan f.unop g.unop))) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pushoutIsoOpPullback_inl_hom {X Y Z : Cᵒᵖ} (f : X ⟶ Z) (g : X ⟶ Y) [HasPushout f g] : pushout.inl _ _ ≫ (pushoutIsoOpPullback f g).hom = (pullback.fst f.unop g.unop).op := (IsColimit.comp_coconePointUniqueUpToIso_hom _ _ _).trans (by simp) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] theorem pushoutIsoOpPullback_inr_hom {X Y Z : Cᵒᵖ} (f : X ⟶ Z) (g : X ⟶ Y) [HasPushout f g] : pushout.inr _ _ ≫ (pushoutIsoOpPullback f g).hom = (pullback.snd f.unop g.unop).op := diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean index 9ac4858d6d39f8..66ebbd32f0ee95 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Preorder/PrincipalSeg.lean @@ -22,6 +22,7 @@ the point of which is `F.obj f.top`. open CategoryTheory Category Limits +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When `f : α p X.as) /-- A cofan over `f : β → C` consists of a collection of maps from every `f b` to an object `P`. -/ -@[simps! pt ι_app] +@[simps! pt ι_app, implicit_reducible] def Cofan.mk {f : β → C} (P : C) (p : ∀ b, f b ⟶ P) : Cofan f where pt := P ι := Discrete.natTrans (fun X => p X.as) @@ -233,6 +233,7 @@ set_option backward.defeqAttrib.useBackward true in def productIsProduct (f : β → C) [HasProduct f] : IsLimit (Fan.mk _ (Pi.π f)) := IsLimit.ofIsoLimit (limit.isLimit (Discrete.functor f)) (Cone.ext (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The cofan constructed of the inclusions from the coproduct is colimiting. -/ def coproductIsCoproduct (f : β → C) [HasCoproduct f] : IsColimit (Cofan.mk _ (Sigma.ι f)) := @@ -312,6 +313,7 @@ lemma Cofan.nonempty_isColimit_iff_isIso_sigmaDesc {f : β → C} [HasCoproduct @[deprecated (since := "2026-01-21")] alias Cofan.isColimit_iff_isIso_sigmaDesc := Cofan.nonempty_isColimit_iff_isIso_sigmaDesc +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A coproduct of coproducts is a coproduct -/ def Cofan.isColimitTrans {X : α → C} (c : Cofan X) (hc : IsColimit c) @@ -350,6 +352,7 @@ lemma Pi.map_comp_map {f g h : α → C} [HasProduct f] [HasProduct g] [HasProdu Pi.map q ≫ Pi.map q' = Pi.map (fun a => q a ≫ q' a) := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance Pi.map_mono {f g : β → C} [HasProduct f] [HasProduct g] (p : ∀ b, f b ⟶ g b) [∀ i, Mono (p i)] : Mono <| Pi.map p := @@ -483,6 +486,7 @@ lemma Sigma.map_comp_map {f g h : α → C} [HasCoproduct f] [HasCoproduct g] [H Sigma.map q ≫ Sigma.map q' = Sigma.map (fun a => q a ≫ q' a) := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance Sigma.map_epi {f g : β → C} [HasCoproduct f] [HasCoproduct g] (p : ∀ b, f b ⟶ g b) [∀ i, Epi (p i)] : Epi <| Sigma.map p := @@ -701,6 +705,7 @@ theorem sigmaComparison_map_desc [HasCoproduct f] [HasCoproduct fun b => G.obj ( ext j simp only [ι_comp_sigmaComparison_assoc, ← G.map_comp, colimit.ι_desc, Cofan.mk_ι_app] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `F.mapCone c` being limiting is the same as the induced fan being limiting. -/ def Fan.isLimitMapConeEquiv (F : C ⥤ D) {ι : Type*} (X : ι → C) (c : Fan X) : @@ -708,6 +713,7 @@ def Fan.isLimitMapConeEquiv (F : C ⥤ D) {ι : Type*} (X : ι → C) (c : Fan X (IsLimit.postcomposeHomEquiv Discrete.natIsoFunctor (F.mapCone c)).symm.trans <| IsLimit.equivIsoLimit (Cone.ext (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `F.mapCocone c` being colimiting is the same as the induced cofan being colimiting. -/ def Cofan.isColimitMapCoconeEquiv (F : C ⥤ D) {ι : Type*} (X : ι → C) (c : Cofan X) : @@ -802,6 +808,7 @@ def sigmaConstAdj [Limits.HasCoproducts.{v} C] (X : C) : section Unique +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The limit cone for the product over an index type with exactly one term. -/ @[simps] @@ -830,6 +837,7 @@ instance (priority := 100) hasProduct_unique [Nonempty β] [Subsingleton β] (f def productUniqueIso [Unique β] (f : β → C) : ∏ᶜ f ≅ f default := IsLimit.conePointUniqueUpToIso (limit.isLimit _) (limitConeOfUnique f).isLimit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Any isomorphism is the projection from a single object product. -/ def Fan.isLimitMkOfUnique {X Y : C} (e : X ≅ Y) (J : Type*) [Unique J] : @@ -839,6 +847,7 @@ def Fan.isLimitMkOfUnique {X Y : C} (e : X ≅ Y) (J : Type*) [Unique J] : simp · simpa [← cancel_mono e.hom] using hm default +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The colimit cocone for the coproduct over an index type with exactly one term. -/ @[simps] @@ -867,6 +876,7 @@ instance (priority := 100) hasCoproduct_unique [Nonempty β] [Subsingleton β] ( def coproductUniqueIso [Unique β] (f : β → C) : ∐ f ≅ f default := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (colimitCoconeOfUnique f).isColimit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Any isomorphism is the projection from a single object product. -/ def Cofan.isColimitMkOfUnique {X Y : C} (e : X ≅ Y) (J : Type*) [Unique J] : @@ -971,6 +981,7 @@ section Fubini variable {ι ι' : Type*} {X : ι → ι' → C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A product over products is a product indexed by a product. -/ def Fan.IsLimit.prod (c : ∀ i : ι, Fan (fun j : ι' ↦ X i j)) (hc : ∀ i : ι, IsLimit (c i)) @@ -982,6 +993,7 @@ def Fan.IsLimit.prod (c : ∀ i : ι, Fan (fun j : ι' ↦ X i j)) (hc : ∀ i : · refine Fan.IsLimit.hom_ext hc' _ _ fun i ↦ ?_ exact Fan.IsLimit.hom_ext (hc i) _ _ fun j ↦ (by simpa using hm (i, j)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A coproduct over coproducts is a coproduct indexed by a product. -/ def Cofan.IsColimit.prod (c : ∀ i : ι, Cofan (fun j : ι' ↦ X i j)) (hc : ∀ i : ι, IsColimit (c i)) @@ -1017,6 +1029,7 @@ def piEquivalenceFunctorDiscreteCompLim [HasProductsOfShape α C] : (piEquivalenceFunctorDiscrete α C).functor ⋙ lim ≅ Pi.functor _ := NatIso.ofComponents fun _ ↦ Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma piEquivalenceFunctorDiscreteCompLim_comp_functorπ [HasProductsOfShape α C] (a : α) : @@ -1059,6 +1072,7 @@ def piEquivalenceFunctorDiscreteCompColim [HasCoproductsOfShape α C] : (piEquivalenceFunctorDiscrete α C).functor ⋙ colim ≅ Sigma.functor _ := NatIso.ofComponents fun _ ↦ Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma piEquivalenceFunctorDiscreteCompColim_comp_functorι [HasCoproductsOfShape α C] (a : α) : diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/Basic.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/Basic.lean index 2e0766dd0ebf84..217eb024c24511 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/Basic.lean @@ -346,6 +346,7 @@ def CatCommSqOver.toFunctorToCategoricalPullback : map_id := by intros; ext <;> simp map_comp := by intros; ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The universal property of categorical pullbacks, stated as an equivalence of categories between functors `X ⥤ (F ⊡ G)` and categorical commutative squares @@ -411,6 +412,7 @@ section variable {J K : X ⥤ F ⊡ G} (e₁ : J ⋙ π₁ F G ≅ K ⋙ π₁ F G) (e₂ : J ⋙ π₂ F G ≅ K ⋙ π₂ F G) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toCatCommSqOver_mapIso_mkNatIso_eq_mkIso (coh : @@ -635,6 +637,7 @@ def precompose : map_id := by intros; ext <;> simp map_comp := by intros; ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (X) in /-- The construction `precompose` respects functor identities. -/ @@ -644,6 +647,7 @@ def precomposeObjId : NatIso.ofComponents fun _ => CatCommSqOver.mkIso (Functor.leftUnitor _) (Functor.leftUnitor _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The construction `precompose` respects functor composition. -/ @[simps!] @@ -655,6 +659,7 @@ def precomposeObjComp (U : X ⥤ Y) (V : Y ⥤ Z) : (Functor.associator _ _ _) (Functor.associator _ _ _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma precompose_map_whiskerLeft (U : X ⥤ Y) {V W : Y ⥤ Z} (α : V ⟶ W) : (precompose F G).map (whiskerLeft U α) = @@ -663,6 +668,7 @@ lemma precompose_map_whiskerLeft (U : X ⥤ Y) {V W : Y ⥤ Z} (α : V ⟶ W) : (precomposeObjComp F G U W).inv := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma precompose_map_whiskerRight {U V : X ⥤ Y} (α : U ⟶ V) (W : Y ⥤ Z) : (precompose F G).map (whiskerRight α W) = @@ -671,6 +677,7 @@ lemma precompose_map_whiskerRight {U V : X ⥤ Y} (α : U ⟶ V) (W : Y ⥤ Z) : (precomposeObjComp F G V W).inv := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma precompose_map_associator {T : Type u₇} [Category.{v₇} T] (U : X ⥤ Y) (V : Y ⥤ Z) (W : Z ⥤ T) : @@ -682,6 +689,7 @@ lemma precompose_map_associator {T : Type u₇} [Category.{v₇} T] (precomposeObjComp F G _ _).inv := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma precompose_map_leftUnitor (U : X ⥤ Y) : (precompose F G).map U.leftUnitor.hom = @@ -690,6 +698,7 @@ lemma precompose_map_leftUnitor (U : X ⥤ Y) : (Functor.rightUnitor _).hom := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma precompose_map_rightUnitor (U : X ⥤ Y) : (precompose F G).map U.rightUnitor.hom = @@ -706,6 +715,7 @@ variable {A₁ : Type u₄} {B₁ : Type u₅} {C₁ : Type u₆} [Category.{v₄} A₁] [Category.{v₅} B₁] [Category.{v₆} C₁] {F₁ : A₁ ⥤ B₁} {G₁ : C₁ ⥤ B₁} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical compatibility square between (the object components of) `precompose` and `transform`. @@ -742,6 +752,7 @@ lemma precomposeObjTransformObjSquare_iso_hom_naturality₂ whiskerLeft (transform Y |>.obj ψ) (precompose F₁ G₁ |>.map α) := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The square `precomposeObjTransformOBjSquare` respects identities. -/ lemma precomposeObjTransformObjSquare_iso_hom_id @@ -753,6 +764,7 @@ lemma precomposeObjTransformObjSquare_iso_hom_id (Functor.leftUnitor _).hom ≫ (Functor.rightUnitor _).inv := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The square `precomposeTransformSquare` respects compositions. -/ lemma precomposeObjTransformObjSquare_iso_hom_comp @@ -773,6 +785,7 @@ lemma precomposeObjTransformObjSquare_iso_hom_comp (Functor.associator _ _ _).hom := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical compatibility square between (the object components of) `transform` and `precompose`. @@ -796,6 +809,7 @@ instance transformObjPrecomposeObjSquare -- Compare the next 3 lemmas with the components of a strong natural transform -- of pseudofunctors +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The square `transformObjPrecomposeObjSquare` is itself natural. -/ lemma transformObjPrecomposeObjSquare_iso_hom_naturality₂ @@ -807,6 +821,7 @@ lemma transformObjPrecomposeObjSquare_iso_hom_naturality₂ whiskerLeft (precompose F G |>.obj U) (transform X |>.map η) := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The square `transformObjPrecomposeObjSquare` respects identities. -/ lemma transformObjPrecomposeObjSquare_iso_hom_id @@ -820,6 +835,7 @@ lemma transformObjPrecomposeObjSquare_iso_hom_id (precompose F G |>.obj U).rightUnitor.inv := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The square `transformPrecomposeSquare` respects compositions. -/ lemma transformPrecomposeObjSquare_iso_hom_comp diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/CatCospanTransform.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/CatCospanTransform.lean index 045bbdaf50a484..8aca996e37195e 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/CatCospanTransform.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Categorical/CatCospanTransform.lean @@ -304,6 +304,7 @@ def baseIso : ψ.base ≅ ψ'.base where hom_inv_id := by simp [← category_comp_base] inv_hom_id := by simp [← category_comp_base] +set_option backward.isDefEq.respectTransparency.types false in omit [IsIso f] in lemma isIso_iff : IsIso f ↔ IsIso f.left ∧ IsIso f.base ∧ IsIso f.right where mp h := ⟨inferInstance, inferInstance, inferInstance⟩ @@ -376,6 +377,7 @@ lemma whisker_exchange : ψ ◁ θ ≫ η ▷ φ' = η ▷ φ ≫ ψ' ◁ θ := @[simp] lemma id_whiskerRight : 𝟙 ψ ▷ φ = 𝟙 _ := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma whiskerRight_id : η ▷ (.id _ _) = (ρ_ _).hom ≫ η ≫ (ρ_ _).inv := by cat_disch @@ -383,6 +385,7 @@ lemma whiskerRight_id : η ▷ (.id _ _) = (ρ_ _).hom ≫ η ≫ (ρ_ _).inv := @[simp, reassoc] lemma comp_whiskerRight : (η ≫ η') ▷ φ = η ▷ φ ≫ η' ▷ φ := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma whiskerRight_comp : @@ -392,6 +395,7 @@ lemma whiskerRight_comp : @[simp] lemma whiskerleft_id : ψ ◁ 𝟙 φ = 𝟙 _ := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma id_whiskerLeft : (.id _ _) ◁ η = (λ_ _).hom ≫ η ≫ (λ_ _).inv := by cat_disch @@ -399,12 +403,14 @@ lemma id_whiskerLeft : (.id _ _) ◁ η = (λ_ _).hom ≫ η ≫ (λ_ _).inv := @[simp, reassoc] lemma whiskerLeft_comp : ψ ◁ (θ ≫ θ') = (ψ ◁ θ) ≫ (ψ ◁ θ') := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma comp_whiskerLeft : (ψ.comp φ) ◁ γ = (α_ _ _ _).hom ≫ (ψ ◁ (φ ◁ γ)) ≫ (α_ _ _ _).inv := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma pentagon @@ -416,12 +422,14 @@ lemma pentagon (α_ (ψ.comp φ) τ σ).hom ≫ (α_ ψ φ (τ.comp σ)).hom := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma triangle : (α_ ψ (.id _ _) φ).hom ≫ ψ ◁ (λ_ φ).hom = (ρ_ ψ).hom ▷ φ := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma triangle_inv : diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Cospan.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Cospan.lean index 2cb2fbbda18ed7..5a20ba7ef6dfd1 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Cospan.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Cospan.lean @@ -170,11 +170,13 @@ def WalkingSpan.ext {F : WalkingSpan ⥤ C} {s t : Cocone F} (i : s.pt ≅ t.pt) · exact w₂ /-- `cospan f g` is the functor from the walking cospan hitting `f` and `g`. -/ +@[implicit_reducible] def cospan {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) : WalkingCospan ⥤ C := WidePullbackShape.wideCospan Z (fun j => WalkingPair.casesOn j X Y) fun j => WalkingPair.casesOn j f g /-- `span f g` is the functor from the walking span hitting `f` and `g`. -/ +@[implicit_reducible] def span {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : WalkingSpan ⥤ C := WidePushoutShape.wideSpan X (fun j => WalkingPair.casesOn j Y Z) fun j => WalkingPair.casesOn j f g @@ -225,6 +227,7 @@ theorem cospan_map_id {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) (w : WalkingCospan theorem span_map_id {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) (w : WalkingSpan) : (span f g).map (WalkingSpan.Hom.id w) = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Every diagram indexing a pullback is naturally isomorphic (actually, equal) to a `cospan` -/ @[simps (rhsMd := default)] def diagramIsoCospan (F : WalkingCospan ⥤ C) : F ≅ cospan (F.map inl) (F.map inr) := @@ -232,6 +235,7 @@ def diagramIsoCospan (F : WalkingCospan ⥤ C) : F ≅ cospan (F.map inl) (F.map (fun j => eqToIso (by rcases j with (⟨⟩ | ⟨⟨⟩⟩) <;> rfl)) (by rintro (⟨⟩ | ⟨⟨⟩⟩) (⟨⟩ | ⟨⟨⟩⟩) f <;> cases f <;> simp) +set_option backward.isDefEq.respectTransparency.types false in /-- Every diagram indexing a pushout is naturally isomorphic (actually, equal) to a `span` -/ @[simps (rhsMd := default)] def diagramIsoSpan (F : WalkingSpan ⥤ C) : F ≅ span (F.map fst) (F.map snd) := @@ -241,6 +245,7 @@ def diagramIsoSpan (F : WalkingSpan ⥤ C) : F ≅ span (F.map fst) (F.map snd) variable {D : Type u₂} [Category.{v₂} D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor applied to a cospan is a cospan. -/ def cospanCompIso (F : C ⥤ D) {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) : @@ -286,6 +291,7 @@ theorem cospanCompIso_inv_app_one : (cospanCompIso F f g).inv.app WalkingCospan. end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor applied to a span is a span. -/ def spanCompIso (F : C ⥤ D) {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : @@ -332,6 +338,7 @@ variable {X Y Z X' Y' Z' : C} (iX : X ≅ X') (iY : Y ≅ Y') (iZ : Z ≅ Z') section +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for natural transformations between cospans. -/ @[simps] def cospanHomMk {F G : WalkingCospan ⥤ C} @@ -342,6 +349,7 @@ def cospanHomMk {F G : WalkingCospan ⥤ C} app := by rintro (_ | _ | _); exacts [z, l, r] naturality := by rintro (_ | _ | _) (_ | _ | _) (_ | _); all_goals cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for natural isomorphisms between cospans. -/ @[simps!] def cospanIsoMk {F G : WalkingCospan ⥤ C} @@ -398,6 +406,7 @@ end section +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for natural transformations between spans. -/ @[simps] def spanHomMk {F G : WalkingSpan ⥤ C} @@ -408,6 +417,7 @@ def spanHomMk {F G : WalkingSpan ⥤ C} app := by rintro (_ | _ | _); exacts [z, l, r] naturality := by rintro (_ | _ | _) (_ | _ | _) (_ | _); all_goals cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for natural isomorphisms between spans. -/ @[simps!] def spanIsoMk {F G : WalkingSpan ⥤ C} diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/IsPullback/Basic.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/IsPullback/Basic.lean index fc8dafa3356779..4a6ee776ceb9e6 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/IsPullback/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/IsPullback/Basic.lean @@ -35,6 +35,7 @@ namespace IsPullback variable {P X Y Z : C} {fst : P ⟶ X} {snd : P ⟶ Y} {f : X ⟶ Z} {g : Y ⟶ Z} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `c` is a limiting binary product cone, and we have a terminal object, then we have `IsPullback c.fst c.snd 0 0` @@ -429,6 +430,7 @@ namespace IsPushout variable {Z X Y P : C} {f : Z ⟶ X} {g : Z ⟶ Y} {inl : X ⟶ P} {inr : Y ⟶ P} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `c` is a colimiting binary coproduct cocone, and we have an initial object, then we have `IsPushout 0 0 c.inl c.inr` diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Mono.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Mono.lean index 705894aae5d3af..011f4cbdd028f7 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Mono.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Mono.lean @@ -162,6 +162,7 @@ variable (f : X ⟶ Z) (i : Z ⟶ W) [Mono i] instance hasPullback_of_right_factors_mono : HasPullback i (f ≫ i) := by simpa only [Category.id_comp] using hasPullback_of_comp_mono (𝟙 Z) f i +set_option backward.isDefEq.respectTransparency.types false in instance pullback_snd_iso_of_right_factors_mono : IsIso (pullback.snd i (f ≫ i)) := by have := limit.isoLimitCone_hom_π ⟨_, pullbackIsPullbackOfCompMono (𝟙 _) f i⟩ WalkingCospan.right @@ -174,6 +175,7 @@ attribute [local instance] hasPullback_of_right_iso instance hasPullback_of_left_factors_mono : HasPullback (f ≫ i) i := by simpa only [Category.id_comp] using hasPullback_of_comp_mono f (𝟙 Z) i +set_option backward.isDefEq.respectTransparency.types false in instance pullback_snd_iso_of_left_factors_mono : IsIso (pullback.fst (f ≫ i) i) := by have := limit.isoLimitCone_hom_π ⟨_, pullbackIsPullbackOfCompMono f (𝟙 _) i⟩ WalkingCospan.left diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Pasting.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Pasting.lean index df7be2d7bf6cf9..3c3806af27e6e2 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Pasting.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/Pasting.lean @@ -76,6 +76,7 @@ local notation "f₁" => t₁.snd variable {t₁} {t₂} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given ``` @@ -105,6 +106,7 @@ def pasteHorizIsPullback (H : IsLimit t₂) (H' : IsLimit t₁) : IsLimit (t₂. variable (t₁) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given ``` @@ -267,6 +269,7 @@ local notation "i₃" => t₂.inr variable {t₁} {t₂} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given ``` @@ -297,6 +300,7 @@ def pasteHorizIsPushout (H : IsColimit t₁) (H' : IsColimit t₂) : variable (t₂) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackCone.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackCone.lean index a8488b4764950a..84ea2502d317f9 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackCone.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackCone.lean @@ -104,12 +104,14 @@ theorem π_app_left (c : PullbackCone f g) : c.π.app WalkingCospan.left = c.fst theorem π_app_right (c : PullbackCone f g) : c.π.app WalkingCospan.right = c.snd := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem condition_one (t : PullbackCone f g) : t.π.app WalkingCospan.one = t.fst ≫ f := by have w := t.π.naturality WalkingCospan.Hom.inl dsimp at w; simpa using w +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A pullback cone on `f` and `g` is determined by morphisms `fst : W ⟶ X` and `snd : W ⟶ Y` such that `fst ≫ f = snd ≫ g`. -/ @@ -291,6 +293,7 @@ def PullbackCone.ofCone {F : WalkingCospan ⥤ C} (t : Cone F) : pt := t.pt π := t.π ≫ (diagramIsoCospan F).hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A diagram `WalkingCospan ⥤ C` is isomorphic to some `PullbackCone.mk` after composing with `diagramIsoCospan`. -/ @@ -325,12 +328,14 @@ theorem ι_app_left (c : PushoutCocone f g) : c.ι.app WalkingSpan.left = c.inl -- This cannot be `@[simp]` because `c.inr` is reducibly defeq to the LHS. theorem ι_app_right (c : PushoutCocone f g) : c.ι.app WalkingSpan.right = c.inr := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem condition_zero (t : PushoutCocone f g) : t.ι.app WalkingSpan.zero = f ≫ t.inl := by have w := t.ι.naturality WalkingSpan.Hom.fst dsimp at w; simpa using w.symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A pushout cocone on `f` and `g` is determined by morphisms `inl : Y ⟶ W` and `inr : Z ⟶ W` such that `f ≫ inl = g ↠ inr`. -/ @@ -381,6 +386,7 @@ def ext {s t : PushoutCocone f g} (i : s.pt ≅ t.pt) (w₁ : s.inl ≫ i.hom = (w₂ : s.inr ≫ i.hom = t.inr := by cat_disch) : s ≅ t := WalkingSpan.ext i w₁ w₂ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism between a pushout cocone and the corresponding pushout cocone reconstructed using `PushoutCocone.mk`. -/ @@ -388,6 +394,7 @@ reconstructed using `PushoutCocone.mk`. -/ def eta (t : PushoutCocone f g) : t ≅ mk t.inl t.inr t.condition := PushoutCocone.ext (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- This is a slightly more convenient method to verify that a pushout cocone is a colimit cocone. It only asks for a proof of facts that carry any mathematical content -/ @@ -427,11 +434,13 @@ def IsColimit.desc {t : PushoutCocone f g} (ht : IsColimit t) {W : C} (h : Y ⟶ (w : f ≫ h = g ≫ k) : t.pt ⟶ W := ht.desc (PushoutCocone.mk _ _ w) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma IsColimit.inl_desc {t : PushoutCocone f g} (ht : IsColimit t) {W : C} (h : Y ⟶ W) (k : Z ⟶ W) (w : f ≫ h = g ≫ k) : inl t ≫ IsColimit.desc ht h k w = h := ht.fac _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma IsColimit.inr_desc {t : PushoutCocone f g} (ht : IsColimit t) {W : C} (h : Y ⟶ W) (k : Z ⟶ W) (w : f ≫ h = g ≫ k) : inr t ≫ IsColimit.desc ht h k w = k := @@ -444,6 +453,7 @@ def IsColimit.desc' {t : PushoutCocone f g} (ht : IsColimit t) {W : C} (h : Y (w : f ≫ h = g ≫ k) : { l : t.pt ⟶ W // inl t ≫ l = h ∧ inr t ≫ l = k } := ⟨IsColimit.desc ht h k w, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- This is a more convenient formulation to show that a `PushoutCocone` constructed using `PushoutCocone.mk` is a colimit cocone. -/ @@ -514,6 +524,7 @@ def PushoutCocone.ofCocone {F : WalkingSpan ⥤ C} (t : Cocone F) : pt := t.pt ι := (diagramIsoSpan F).inv ≫ t.ι +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A diagram `WalkingSpan ⥤ C` is isomorphic to some `PushoutCocone.mk` after composing with `diagramIsoSpan`. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean index 240a41e7591ce0..9a5309dcb3b171 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean @@ -139,6 +139,7 @@ def ofNatIso : F'.PushoutObjObj f₁ f₂ where sq.isPushout.of_iso ((e.app _).app _) ((e.app _).app _) ((e.app _).app _) (Iso.refl _) (by simp) (by simp) (by simp) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp, reassoc] lemma ofNatIso_ι : @@ -177,6 +178,7 @@ noncomputable def ofIsInitialLeft : F.PushoutObjObj f₁ f₂ where · exact isIso_of_isInitial hX₂ hY₂ _ · exact ⟨hX₂.hom_ext _ _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma ofIsInitialLeft_ι : (ofIsInitialLeft F f₁ f₂ h).ι = (F.obj Y₁).map f₂ := by @@ -206,6 +208,7 @@ noncomputable def ofIsInitialRight : F.PushoutObjObj f₁ f₂ where · exact isIso_of_isInitial hX₁ hY₁ _ · exact ⟨hX₁.hom_ext _ _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma ofIsInitialRight_ι : (ofIsInitialRight F f₁ f₂ h).ι = (F.map f₁).app Y₂ := by @@ -420,6 +423,7 @@ noncomputable def ofIsInitial : G.PullbackObjObj f₁ f₃ where · exact isIso_of_isTerminal hX₃ hY₃ _ · exact ⟨hY₃.hom_ext _ _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma ofIsInitial_π : (ofIsInitial G f₁ f₃ h).π = (G.obj (op Y₁)).map f₃ := by @@ -449,6 +453,7 @@ noncomputable def ofIsTerminal : G.PullbackObjObj f₁ f₃ where · exact isIso_of_isTerminal hY₁ hX₁ _ · exact ⟨hX₁.hom_ext _ _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma ofIsTerminal_π : (ofIsTerminal G f₁ f₃ h).π = (G.map f₁.op).app X₃ := by diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean b/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean index 3d08f695eb27e5..7af98524565941 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean @@ -546,6 +546,7 @@ def reflexiveCoforkEquivCofork : (Functor.Final.coconesEquiv _ F).symm.trans (Cocone.precomposeEquivalence (diagramIsoParallelPair (WalkingParallelPair.inclusionWalkingReflexivePair ⋙ F))) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma reflexiveCoforkEquivCofork_functor_obj_π (G : ReflexiveCofork F) : @@ -554,6 +555,7 @@ lemma reflexiveCoforkEquivCofork_functor_obj_π (G : ReflexiveCofork F) : rw [ReflexiveCofork.π, Cofork.π] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma reflexiveCoforkEquivCofork_inverse_obj_π @@ -565,6 +567,7 @@ lemma reflexiveCoforkEquivCofork_inverse_obj_π rw [Functor.Final.extendCocone_obj_ι_app' (Y := .one) (f := 𝟙 zero)] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence between reflexive coforks and coforks sends a reflexive cofork to its underlying cofork. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean b/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean index 551923d5e75324..4213646032923b 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean @@ -72,6 +72,7 @@ attribute [reassoc] RegularMono.w lemma RegularMono.mono {f : X ⟶ Y} (h : RegularMono f) : Mono f := mono_of_isLimit_fork h.isLimit +set_option backward.isDefEq.respectTransparency.types false in /-- Every isomorphism is a regular monomorphism. -/ def RegularMono.ofIso (e : X ≅ Y) : RegularMono e.hom where Z := Y @@ -316,6 +317,7 @@ attribute [reassoc] RegularEpi.w lemma RegularEpi.epi (f : X ⟶ Y) (h : RegularEpi f) : Epi f := epi_of_isColimit_cofork h.isColimit +set_option backward.isDefEq.respectTransparency.types false in /-- Every isomorphism is a regular epimorphism. -/ def RegularEpi.ofIso (e : X ≅ Y) : RegularEpi e.hom where W := X @@ -548,6 +550,7 @@ def RegularEpi.desc' {W : C} {f : X ⟶ Y} (hf : RegularEpi f) (k : X ⟶ W) { l : Y ⟶ W // f ≫ l = k } := Cofork.IsColimit.desc' hf.isColimit _ h +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The second leg of a pushout cocone is a regular epimorphism if the right component is too. diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean b/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean index ec42ce0eba4518..187326f85d5f6c 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean @@ -219,6 +219,7 @@ variable [HasZeroMorphisms C] [HasFiniteBiproducts C] [∀ n, Epi (f n)] attribute [local instance] hasBinaryBiproducts_of_finite_biproducts +set_option backward.isDefEq.respectTransparency.types false in lemma functorMap_epi (n : ℕ) : Epi (functorMap f n) := by rw [functorMap, Pi.map_eq_prod_map (P := fun m : ℕ ↦ m < n + 1)] apply +allowSynthFailures epi_comp diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean index dbda39cafb53e1..b25248d27debf8 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SplitCoequalizer.lean @@ -107,6 +107,7 @@ def IsSplitCoequalizer.asCofork {Z : C} {h : Y ⟶ Z} (t : IsSplitCoequalizer f theorem IsSplitCoequalizer.asCofork_π {Z : C} {h : Y ⟶ Z} (t : IsSplitCoequalizer f g h) : t.asCofork.π = h := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The cofork induced by a split coequalizer is a coequalizer, justifying the name. In some cases it diff --git a/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean b/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean index 9c6a0fcccc6428..736c88f0f5cd44 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/SplitEqualizer.lean @@ -111,6 +111,7 @@ def IsSplitEqualizer.asFork {W : C} {h : W ⟶ X} (t : IsSplitEqualizer f g h) : theorem IsSplitEqualizer.asFork_ι {W : C} {h : W ⟶ X} (t : IsSplitEqualizer f g h) : t.asFork.ι = h := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The fork induced by a split equalizer is an equalizer, justifying the name. In some cases it diff --git a/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean index ed473795f75d2c..10e8e9453f1c68 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean @@ -149,6 +149,7 @@ theorem parallelFamily_obj_one : (parallelFamily f).obj one = Y := theorem parallelFamily_map_left {j : J} : (parallelFamily f).map (line j) = f j := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Every functor indexing a wide (co)equalizer is naturally isomorphic (actually, equal) to a `parallelFamily` -/ @[simps!] @@ -442,6 +443,7 @@ def Trident.ofCone {F : WalkingParallelFamily J ⥤ C} (t : Cone F) : { app := fun X => t.π.app X ≫ eqToHom (by cases X <;> cat_disch) naturality := by rintro _ _ (_ | _) <;> cat_disch } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `F : WalkingParallelFamily ⥤ C`, which is really the same as `parallelFamily (F.map left) (F.map right)` and a cocone on `F`, we get a cotrident on @@ -631,6 +633,7 @@ theorem wideCoequalizer.condition (j₁ j₂ : J) : f j₁ ≫ wideCoequalizer.π f = f j₂ ≫ wideCoequalizer.π f := Cotrident.condition j₁ j₂ <| colimit.cocone <| parallelFamily f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The cotrident built from `wideCoequalizer.π f` is colimiting. -/ def wideCoequalizerIsWideCoequalizer [Nonempty J] : diff --git a/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean b/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean index 803363327cbac3..bc55bd9b5c7ef5 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/WidePullbacks.lean @@ -35,13 +35,24 @@ namespace CategoryTheory.Limits variable (J : Type w) +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Eq.rec + Functor.leftOp + colimit.cocone + getColimitCocone + getLimitCone + limit.cone + /-- A wide pullback shape for any type `J` can be written simply as `Option J`. -/ +@[implicit_reducible] def WidePullbackShape := Option J instance : Inhabited (WidePullbackShape J) where default := none /-- A wide pushout shape for any type `J` can be written simply as `Option J`. -/ +@[implicit_reducible] def WidePushoutShape := Option J instance : Inhabited (WidePushoutShape J) where @@ -85,6 +96,7 @@ meta def evalCasesBash : TacticM Unit := do attribute [local aesop safe tactic (rule_sets := [CategoryTheory])] evalCasesBash +set_option backward.isDefEq.respectTransparency.types false in instance subsingleton_hom : Quiver.IsThin (WidePullbackShape J) := fun _ _ => by constructor intro a b @@ -102,10 +114,11 @@ theorem hom_id (X : WidePullbackShape J) : Hom.id X = 𝟙 X := variable {C : Type u} [Category.{v} C] +set_option backward.isDefEq.respectTransparency.types false in /-- Construct a functor out of the wide pullback shape given a J-indexed collection of arrows to a fixed object. -/ -@[simps] +@[local implicit_reducible, local implicit_reducible, simps] def wideCospan (B : C) (objs : J → C) (arrows : ∀ j : J, objs j ⟶ B) : WidePullbackShape J ⥤ C where obj j := Option.casesOn j B objs map f := by @@ -113,15 +126,17 @@ def wideCospan (B : C) (objs : J → C) (arrows : ∀ j : J, objs j ⟶ B) : Wid · apply 𝟙 _ · exact arrows j +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Every diagram is naturally isomorphic (actually, equal) to a `wideCospan` -/ def diagramIsoWideCospan (F : WidePullbackShape J ⥤ C) : F ≅ wideCospan (F.obj none) (fun j => F.obj (some j)) fun j => F.map (Hom.term j) := NatIso.ofComponents fun j => eqToIso <| by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Construct a cone over a wide cospan. -/ -@[simps] +@[local implicit_reducible, local implicit_reducible, simps] def mkCone {F : WidePullbackShape J ⥤ C} {X : C} (f : X ⟶ F.obj none) (π : ∀ j, X ⟶ F.obj (some j)) (w : ∀ j, π j ≫ F.map (Hom.term j) = f) : Cone F := { pt := X @@ -133,7 +148,9 @@ def mkCone {F : WidePullbackShape J ⥤ C} {X : C} (f : X ⟶ F.obj none) (π : naturality := fun j j' f => by cases j <;> cases j' <;> cases f <;> simp [w] } } +set_option backward.isDefEq.respectTransparency.types false in /-- Wide pullback diagrams of equivalent index types are equivalent. -/ +@[local implicit_reducible] def equivalenceOfEquiv (J' : Type w') (h : J ≃ J') : WidePullbackShape J ≌ WidePullbackShape J' where functor := wideCospan none (fun j => some (h j)) fun j => Hom.term (h j) @@ -212,6 +229,7 @@ meta def evalCasesBash' : TacticM Unit := do attribute [local aesop safe tactic (rule_sets := [CategoryTheory])] evalCasesBash' +set_option backward.isDefEq.respectTransparency.types false in instance subsingleton_hom : Quiver.IsThin (WidePushoutShape J) := fun _ _ => by constructor intro a b @@ -230,7 +248,7 @@ variable {C : Type u} [Category.{v} C] /-- Construct a functor out of the wide pushout shape given a J-indexed collection of arrows from a fixed object. -/ -@[simps] +@[local implicit_reducible, local implicit_reducible, simps] def wideSpan (B : C) (objs : J → C) (arrows : ∀ j : J, B ⟶ objs j) : WidePushoutShape J ⥤ C where obj j := Option.casesOn j B objs map f := by @@ -243,15 +261,17 @@ def wideSpan (B : C) (objs : J → C) (arrows : ∀ j : J, B ⟶ objs j) : WideP · cases g simp only [hom_id, Category.comp_id]; congr +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Every diagram is naturally isomorphic (actually, equal) to a `wideSpan` -/ def diagramIsoWideSpan (F : WidePushoutShape J ⥤ C) : F ≅ wideSpan (F.obj none) (fun j => F.obj (some j)) fun j => F.map (Hom.init j) := NatIso.ofComponents fun j => eqToIso <| by cases j; repeat rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Construct a cocone over a wide span. -/ -@[simps] +@[local implicit_reducible, local implicit_reducible, simps] def mkCocone {F : WidePushoutShape J ⥤ C} {X : C} (f : F.obj none ⟶ X) (ι : ∀ j, F.obj (some j) ⟶ X) (w : ∀ j, F.map (Hom.init j) ≫ ι j = f) : Cocone F := { pt := X @@ -263,6 +283,7 @@ def mkCocone {F : WidePushoutShape J ⥤ C} {X : C} (f : F.obj none ⟶ X) (ι : naturality := fun j j' f => by cases j <;> cases j' <;> cases f <;> simp [w] } } +set_option backward.isDefEq.respectTransparency.types false in /-- Wide pushout diagrams of equivalent index types are equivalent. -/ def equivalenceOfEquiv (J' : Type w') (h : J ≃ J') : WidePushoutShape J ≌ WidePushoutShape J' where functor := wideSpan none (fun j => some (h j)) fun j => Hom.init (h j) @@ -389,6 +410,7 @@ def π (s : WidePullbackCone f) (i : ι) : s.pt ⟶ Y i := def base (s : WidePullbackCone f) : s.pt ⟶ X := (Cone.π s).app none +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma condition (s : WidePullbackCone f) (i : ι) : s.π i ≫ f i = s.base := by @@ -569,7 +591,7 @@ def widePullbackShapeOpMap : | _, _, WidePullbackShape.Hom.term _ => Quiver.Hom.op (WidePushoutShape.Hom.init _) /-- The obvious functor `WidePullbackShape J ⥤ (WidePushoutShape J)ᵒᵖ` -/ -@[simps] +@[local implicit_reducible, simps] def widePullbackShapeOp : WidePullbackShape J ⥤ (WidePushoutShape J)ᵒᵖ where obj X := op X map {X₁} {X₂} := widePullbackShapeOpMap J X₁ X₂ @@ -583,18 +605,18 @@ def widePushoutShapeOpMap : | _, _, WidePushoutShape.Hom.init _ => Quiver.Hom.op (WidePullbackShape.Hom.term _) /-- The obvious functor `WidePushoutShape J ⥤ (WidePullbackShape J)ᵒᵖ` -/ -@[simps] +@[local implicit_reducible, simps] def widePushoutShapeOp : WidePushoutShape J ⥤ (WidePullbackShape J)ᵒᵖ where obj X := op X map := fun {X} {Y} => widePushoutShapeOpMap J X Y /-- The obvious functor `(WidePullbackShape J)ᵒᵖ ⥤ WidePushoutShape J` -/ -@[simps!] +@[local implicit_reducible, simps!] def widePullbackShapeUnop : (WidePullbackShape J)ᵒᵖ ⥤ WidePushoutShape J := (widePullbackShapeOp J).leftOp /-- The obvious functor `(WidePushoutShape J)ᵒᵖ ⥤ WidePullbackShape J` -/ -@[simps!] +@[local implicit_reducible, simps!] def widePushoutShapeUnop : (WidePushoutShape J)ᵒᵖ ⥤ WidePullbackShape J := (widePushoutShapeOp J).leftOp @@ -619,7 +641,7 @@ def widePullbackShapeUnopOp : widePullbackShapeOp J ⋙ widePushoutShapeUnop J NatIso.ofComponents fun _ => Iso.refl _ /-- The duality equivalence `(WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J` -/ -@[simps] +@[local implicit_reducible, simps] def widePushoutShapeOpEquiv : (WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J where functor := widePushoutShapeUnop J inverse := widePullbackShapeOp J @@ -627,7 +649,7 @@ def widePushoutShapeOpEquiv : (WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J counitIso := widePullbackShapeUnopOp J /-- The duality equivalence `(WidePullbackShape J)ᵒᵖ ≌ WidePushoutShape J` -/ -@[simps] +@[local implicit_reducible, simps] def widePullbackShapeOpEquiv : (WidePullbackShape J)ᵒᵖ ≌ WidePushoutShape J where functor := widePullbackShapeUnop J inverse := widePushoutShapeOp J diff --git a/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean b/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean index be97296ed55f29..eb4632f1d01278 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/ZeroMorphisms.lean @@ -222,7 +222,7 @@ morphisms for some other reason, for example from additivity. Library code that the `HasZeroMorphisms` instances will not be definitionally equal. For this reason library code should generally ask for an instance of `HasZeroMorphisms` separately, even if it already asks for an instance of `HasZeroObject`. -/ -@[implicit_reducible] +@[instance_reducible] def IsZero.hasZeroMorphisms {O : C} (hO : IsZero O) : HasZeroMorphisms C where zero X Y := { zero := hO.from_ X ≫ hO.to_ Y } zero_comp X {Y Z} f := by @@ -250,7 +250,7 @@ morphisms for some other reason, for example from additivity. Library code that the `HasZeroMorphisms` instances will not be definitionally equal. For this reason library code should generally ask for an instance of `HasZeroMorphisms` separately, even if it already asks for an instance of `HasZeroObject`. -/ -@[implicit_reducible] +@[instance_reducible] def zeroMorphismsOfZeroObject : HasZeroMorphisms C where zero X _ := { zero := (default : X ⟶ 0) ≫ default } zero_comp X {Y Z} f := by @@ -543,6 +543,7 @@ def imageZero {X Y : C} : image (0 : X ⟶ Y) ≅ 0 := def imageZero' {X Y : C} {f : X ⟶ Y} (h : f = 0) [HasImage f] : image f ≅ 0 := image.eqToIso h ≪≫ imageZero +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem image.ι_zero {X Y : C} [HasImage (0 : X ⟶ Y)] : image.ι (0 : X ⟶ Y) = 0 := by diff --git a/Mathlib/CategoryTheory/Limits/Types/Filtered.lean b/Mathlib/CategoryTheory/Limits/Types/Filtered.lean index 013c92339f0080..b195815e28b5f5 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Filtered.lean @@ -84,7 +84,6 @@ noncomputable def isColimitOf (t : Cocone F) (hsurj : ∀ x : t.pt, ∃ i xi, x variable [IsFilteredOrEmpty J] set_option backward.defeqAttrib.useBackward true in -set_option backward.isDefEq.respectTransparency false in /-- Recognizing filtered colimits of types. The injectivity condition here is slightly easier to check as compared to `isColimitOf`. -/ noncomputable def isColimitOf' (t : Cocone F) (hsurj : ∀ x : t.pt, ∃ i xi, x = t.ι.app i xi) @@ -92,7 +91,7 @@ noncomputable def isColimitOf' (t : Cocone F) (hsurj : ∀ x : t.pt, ∃ i xi, x IsColimit t := isColimitOf _ _ hsurj (fun i j xi xj h ↦ by obtain ⟨k, g, hg⟩ := hinj (IsFiltered.max i j) (F.map (IsFiltered.leftToMax i j) xi) - (F.map (IsFiltered.rightToMax i j) xj) (by simp_all [Cocone.w_apply]) + (F.map (IsFiltered.rightToMax i j) xj) (by simp_all) exact ⟨k, IsFiltered.leftToMax i j ≫ g, IsFiltered.rightToMax i j ≫ g, by simpa using hg⟩) protected theorem rel_equiv : _root_.Equivalence (FilteredColimit.Rel.{v, u} F) where diff --git a/Mathlib/CategoryTheory/Limits/Types/Limits.lean b/Mathlib/CategoryTheory/Limits/Types/Limits.lean index dec26a7ed19692..76f0d35b2870ce 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Limits.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Limits.lean @@ -111,6 +111,7 @@ noncomputable def limitCone : Cone F where π := { app j := ↾fun u => ((equivShrink F.sections).symm u).val j } +set_option backward.isDefEq.respectTransparency.types false in @[ext] lemma limitCone_pt_ext {x y : (limitCone F).pt} (w : (equivShrink F.sections).symm x = (equivShrink F.sections).symm y) : x = y := by diff --git a/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean b/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean index ce78a0adc36eeb..11c376d34aa76d 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Multicoequalizer.lean @@ -35,6 +35,7 @@ namespace CategoryTheory.Functor.CoconeTypes open Limits +set_option backward.isDefEq.respectTransparency.types false in lemma isMulticoequalizer_iff {J : MultispanShape.{w, w'}} {d : MultispanIndex J (Type u)} (c : d.multispan.CoconeTypes) : c.IsColimit ↔ @@ -98,6 +99,7 @@ noncomputable def isColimitOfMulticoequalizerDiagram obtain ⟨i, hi⟩ := hx exact ⟨i, ⟨x, hi⟩, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Let `X : Type u`, `A : Set X`, `U : ι → Set X` and `V : ι → ι → Set X` such that `MulticoequalizerDiagram A U V` holds, then in the category of types, diff --git a/Mathlib/CategoryTheory/Limits/Types/Products.lean b/Mathlib/CategoryTheory/Limits/Types/Products.lean index 84825a5671be74..812c6398819220 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Products.lean @@ -217,6 +217,7 @@ namespace Small variable {J : Type v} (F : J → Type u) [Small.{u} J] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A variant of `productLimitCone` using a `Small` hypothesis rather than a function to `Type`. @@ -233,18 +234,21 @@ noncomputable def productLimitCone : uniq := fun s m w => ConcreteCategory.hom_ext _ _ fun x => Shrink.ext (funext fun j => by simpa using! ConcreteCategory.congr_hom (w ⟨j⟩) x) } +set_option backward.isDefEq.respectTransparency.types false in /-- The categorical product in `Type u` indexed in `Type v` is the type-theoretic product `Π j, F j`, after shrinking back to `Type u`. -/ noncomputable def productIso : (∏ᶜ F : Type u) ≅ Shrink (∀ j, F j) := limit.isoLimitCone (productLimitCone.{v, u} F) +set_option backward.isDefEq.respectTransparency.types false in @[elementwise (attr := simp)] theorem productIso_hom_comp_eval (j : J) : (productIso.{v, u} F).hom ≫ (↾fun f => (equivShrink (∀ j, F j)).symm f j) = Pi.π F j := limit.isoLimitCone_hom_π (productLimitCone.{v, u} F) ⟨j⟩ +set_option backward.isDefEq.respectTransparency.types false in @[elementwise (attr := simp)] theorem productIso_inv_comp_π (j : J) : (productIso.{v, u} F).inv ≫ Pi.π F j = diff --git a/Mathlib/CategoryTheory/Limits/VanKampen.lean b/Mathlib/CategoryTheory/Limits/VanKampen.lean index 4b7e5be79c6a66..22aa21871d27c7 100644 --- a/Mathlib/CategoryTheory/Limits/VanKampen.lean +++ b/Mathlib/CategoryTheory/Limits/VanKampen.lean @@ -419,6 +419,7 @@ end reflective section Initial +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem hasStrictInitial_of_isUniversal [HasInitial C] (H : IsUniversalColimit (BinaryCofan.mk (𝟙 (⊥_ C)) (𝟙 (⊥_ C)))) : HasStrictInitialObjects C := @@ -524,6 +525,7 @@ theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y) exact (BinaryCofan.mk _ _).isColimitCompRightIso e₂.hom ((BinaryCofan.mk _ _).isColimitCompLeftIso e₁.hom (h₂ f)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y} (h : IsVanKampenColimit c) : Mono c.inr := by @@ -535,6 +537,7 @@ theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : Binary dsimp infer_instance)).some +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem BinaryCofan.isPullback_initial_to_of_isVanKampen [HasInitial C] {c : BinaryCofan X Y} (h : IsVanKampenColimit c) : IsPullback (initial.to _) (initial.to _) c.inl c.inr := by @@ -681,6 +684,7 @@ theorem isVanKampenColimit_extendCofan {n : ℕ} (f : Fin (n + 1) → C) BinaryCofan.ι_app_right, BinaryCofan.mk_inr, colimit.ι_desc, Discrete.natTrans_app] using! t₁'.paste_horiz (t₂' ⟨WalkingPair.right⟩) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem isPullback_of_cofan_isVanKampen [HasInitial C] {ι : Type*} {X : ι → C} {c : Cofan X} (hc : IsVanKampenColimit c) (i j : ι) [DecidableEq ι] : @@ -748,6 +752,7 @@ variable {ι ι' : Type*} {S : C} variable {B : C} {X : ι → C} {a : Cofan X} (hau : IsUniversalColimit a) (f : ∀ i, X i ⟶ S) (u : a.pt ⟶ S) (v : B ⟶ S) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in include hau in /-- Pullbacks distribute over universal coproducts on the left: This is the isomorphism @@ -812,6 +817,7 @@ lemma IsUniversalColimit.isPullback_of_isColimit_left {d : Cofan P} (hd : IsColi end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in include hau in /-- Pullbacks distribute over universal coproducts on the right: This is the isomorphism diff --git a/Mathlib/CategoryTheory/Localization/Bifunctor.lean b/Mathlib/CategoryTheory/Localization/Bifunctor.lean index 4eba690853dd4f..9e2e4db571667a 100644 --- a/Mathlib/CategoryTheory/Localization/Bifunctor.lean +++ b/Mathlib/CategoryTheory/Localization/Bifunctor.lean @@ -69,7 +69,7 @@ variable (W₁ : MorphismProperty C₁) (W₂ : MorphismProperty C₂) /-- If `Lifting₂ L₁ L₂ W₁ W₂ F F'` holds, then `Lifting L₂ W₂ (F.obj X₁) (F'.obj (L₁.obj X₁))` holds for any `X₁ : C₁`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Lifting₂.fst (X₁ : C₁) : Lifting L₂ W₂ (F.obj X₁) (F'.obj (L₁.obj X₁)) where iso := ((evaluation _ _).obj X₁).mapIso (Lifting₂.iso L₁ L₂ W₁ W₂ F F') @@ -79,7 +79,7 @@ noncomputable instance Lifting₂.flip : Lifting₂ L₂ L₁ W₂ W₁ F.flip F /-- If `Lifting₂ L₁ L₂ W₁ W₂ F F'` holds, then `Lifting L₁ W₁ (F.flip.obj X₂) (F'.flip.obj (L₂.obj X₂))` holds for any `X₂ : C₂`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Lifting₂.snd (X₂ : C₂) : Lifting L₁ W₁ (F.flip.obj X₂) (F'.flip.obj (L₂.obj X₂)) := Lifting₂.fst L₂ L₁ W₂ W₁ F.flip F'.flip X₂ @@ -164,6 +164,7 @@ noncomputable def lift₂NatTrans (τ : F₁ ⟶ F₂) : F₁' ⟶ F₂' := (liftNatTrans (L₁.prod L₂) (W₁.prod W₂) (uncurry.obj F₁) (uncurry.obj F₂) (uncurry.obj F₁') (uncurry.obj F₂') (uncurry.map τ)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem lift₂NatTrans_app_app (τ : F₁ ⟶ F₂) (X₁ : C₁) (X₂ : C₂) : diff --git a/Mathlib/CategoryTheory/Localization/Bousfield.lean b/Mathlib/CategoryTheory/Localization/Bousfield.lean index 4a0358f853bfcf..4f1f5c65aa19ac 100644 --- a/Mathlib/CategoryTheory/Localization/Bousfield.lean +++ b/Mathlib/CategoryTheory/Localization/Bousfield.lean @@ -213,6 +213,7 @@ section variable {F : C ⥤ D} {G : D ⥤ C} (adj : G ⊣ F) [F.Full] [F.Faithful] include adj +set_option backward.isDefEq.respectTransparency.types false in lemma isLocal_adj_unit_app (X : D) : isLocal (· ∈ Set.range F.obj) (adj.unit.app X) := by rintro _ ⟨Y, rfl⟩ convert! @@ -248,6 +249,7 @@ section variable {F : C ⥤ D} {G : D ⥤ C} (adj : G ⊣ F) [G.Full] [G.Faithful] include adj +set_option backward.isDefEq.respectTransparency.types false in lemma isColocal_adj_counit_app (X : C) : isColocal (· ∈ Set.range G.obj) (adj.counit.app X) := by rintro _ ⟨Y, rfl⟩ convert! diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean index 74cf1be098c1f4..c95871c2c04c29 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean @@ -528,6 +528,7 @@ which belongs to `W`. -/ noncomputable def Qinv {X Y : C} (s : X ⟶ Y) (hs : W s) : (Q W).obj Y ⟶ (Q W).obj X := homMk (ofInv s hs) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma Q_map_comp_Qinv {X Y Y' : C} (f : X ⟶ Y') (s : Y ⟶ Y') (hs : W s) : (Q W).map f ≫ Qinv s hs = homMk (mk f s hs) := by @@ -962,6 +963,7 @@ section variable [W.HasRightCalculusOfFractions] +set_option backward.isDefEq.respectTransparency.types false in lemma Localization.exists_rightFraction {X Y : C} (f : L.obj X ⟶ L.obj Y) : ∃ (φ : W.RightFraction X Y), f = φ.map L (Localization.inverts L W) := by obtain ⟨φ, eq⟩ := Localization.exists_leftFraction L.op W.op f.op diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean index 41552d8b556bad..275b7e171ff691 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions/Preadditive.lean @@ -220,7 +220,7 @@ variable (L X Y) /-- The abelian group structure on `L.obj X ⟶ L.obj Y` when `L : C ⥤ D` is a localization functor, `C` is preadditive and there is a left calculus of fractions. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def addCommGroup' : AddCommGroup (L.obj X ⟶ L.obj Y) := by letI : Zero (L.obj X ⟶ L.obj Y) := ⟨L.map 0⟩ letI : Add (L.obj X ⟶ L.obj Y) := ⟨add' W⟩ @@ -277,7 +277,7 @@ lemma add_eq_add {X'' Y'' : C} (eX' : L.obj X'' ≅ X') (eY' : L.obj Y'' ≅ Y') variable (L X' Y') in /-- The abelian group structure on morphisms in `D`, when `L : C ⥤ D` is a localization functor, `C` is preadditive and there is a left calculus of fractions. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def addCommGroup : AddCommGroup (X' ⟶ Y') := by have := Localization.essSurj L W letI := addCommGroup' L W (L.objPreimage X') (L.objPreimage Y') @@ -304,7 +304,7 @@ variable [W.HasLeftCalculusOfFractions] /-- The preadditive structure on `D`, when `L : C ⥤ D` is a localization functor, `C` is preadditive and there is a left calculus of fractions. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def preadditive : Preadditive D where homGroup := Preadditive.addCommGroup L W add_comp _ _ _ _ _ _ := by apply Preadditive.add_comp diff --git a/Mathlib/CategoryTheory/Localization/Construction.lean b/Mathlib/CategoryTheory/Localization/Construction.lean index 15b685a2cd1179..f9d136c800b92d 100644 --- a/Mathlib/CategoryTheory/Localization/Construction.lean +++ b/Mathlib/CategoryTheory/Localization/Construction.lean @@ -333,6 +333,7 @@ def inverse : W.FunctorsInverting D ⥤ W.Localization ⥤ D where natTransExtension_app, NatTransExtension.app_eq] rfl) +set_option backward.isDefEq.respectTransparency.types false in /-- The unit isomorphism of the equivalence of categories `whiskeringLeftEquivalence W D`. -/ @[simps!] def unitIso : 𝟭 (W.Localization ⥤ D) ≅ functor W D ⋙ inverse W D := diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean index 31e6933b2bb383..8775726b371273 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/Constructor.lean @@ -56,6 +56,7 @@ namespace Constructor variable {D : Type*} [Category* D] (L : C₂ ⥤ D) [L.IsLocalization W₂] {X₂ : C₂} {X₃ : D} (y : L.obj X₂ ⟶ X₃) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `Φ : LocalizerMorphism W₁ W₂`, `L : C₂ ⥤ D` a localization functor for `W₂` and a morphism `y : L.obj X₂ ⟶ X₃`, this is the functor which sends `R : Φ.RightResolution d` to @@ -107,6 +108,7 @@ lemma isConnected : end Constructor +set_option backward.isDefEq.respectTransparency.types false in /-- If a localizer morphism `Φ` is a localized equivalence, then it is a right derivability structure if the categories of right resolutions are connected and the categories of right resolutions of arrows are nonempty. -/ diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean index 77ffa0d7158fb2..2ae504808bf4d7 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean @@ -83,6 +83,7 @@ lemma isLeftDerivabilityStructure_of_isLocalizedEquivalence rw [B.isLeftDerivabilityStructure_iff W₁'.Q W₂'.Q F e'] apply TwoSquare.GuitartExact.of_hComp iso.inv +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isLeftDerivabilityStructure_iff_of_isLocalizedEquivalence [L.functor.EssSurj] [R.functor.Full] [R.IsInduced] @@ -115,6 +116,7 @@ lemma isLeftDerivabilityStructure_iff_of_isLocalizedEquivalence (R.functor ⋙ W₂'.Q) F e, ← this] infer_instance +set_option backward.isDefEq.respectTransparency.types false in lemma isRightDerivabilityStructure_of_isLocalizedEquivalence [T.IsRightDerivabilityStructure] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) @@ -126,6 +128,7 @@ lemma isRightDerivabilityStructure_of_isLocalizedEquivalence inferInstanceAs (TwoSquare.op iso.hom).GuitartExact exact isLeftDerivabilityStructure_of_isLocalizedEquivalence iso' +set_option backward.isDefEq.respectTransparency.types false in lemma isRightDerivabilityStructure_iff_of_isLocalizedEquivalence [L.functor.EssSurj] [R.functor.Full] [R.IsInduced] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) @@ -143,6 +146,7 @@ variable [W₁'.RespectsIso] [W₂'.RespectsIso] [L.IsInduced] [L.functor.IsEqui [R.IsInduced] [R.functor.IsEquivalence] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) +set_option backward.isDefEq.respectTransparency.types false in lemma isLeftDerivabilityStructure_of_equivalences [T.IsLeftDerivabilityStructure] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) : diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean index c2040bba245e85..0dc1c069dbcc9f 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/PointwiseRightDerived.lean @@ -84,6 +84,7 @@ lemma rightDerivedFunctorComparison_fac_app (X : C₁) : variable [Φ.IsRightDerivabilityStructure] +set_option backward.isDefEq.respectTransparency.types false in lemma hasPointwiseRightDerivedFunctorAt_iff_of_isRightDerivabilityStructure (X : C₁) : (Φ.functor ⋙ F).HasPointwiseRightDerivedFunctorAt W₁ X ↔ F.HasPointwiseRightDerivedFunctorAt W₂ (Φ.functor.obj X) := by diff --git a/Mathlib/CategoryTheory/Localization/FiniteProducts.lean b/Mathlib/CategoryTheory/Localization/FiniteProducts.lean index f96ce11aa5b0a3..32af6761b312c5 100644 --- a/Mathlib/CategoryTheory/Localization/FiniteProducts.lean +++ b/Mathlib/CategoryTheory/Localization/FiniteProducts.lean @@ -80,6 +80,7 @@ lemma adj_counit_app (F : Discrete J ⥤ C) : whiskerRight (constLimAdj.counit.app F) L := by apply constLimAdj.localization_counit_app +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `Localization.preservesProductsOfShape`. -/ noncomputable def isLimitMapCone (F : Discrete J ⥤ C) : diff --git a/Mathlib/CategoryTheory/Localization/HasLocalization.lean b/Mathlib/CategoryTheory/Localization/HasLocalization.lean index 34b69ea761aad9..0a71d8a2e23cfd 100644 --- a/Mathlib/CategoryTheory/Localization/HasLocalization.lean +++ b/Mathlib/CategoryTheory/Localization/HasLocalization.lean @@ -75,7 +75,7 @@ def Q' : C ⥤ W.Localization' := HasLocalization.L instance : W.Q'.IsLocalization W := HasLocalization.hL /-- The constructed localized category. -/ -@[implicit_reducible] +@[instance_reducible] def HasLocalization.standard : HasLocalization.{max u v} W where L := W.Q diff --git a/Mathlib/CategoryTheory/Localization/HomEquiv.lean b/Mathlib/CategoryTheory/Localization/HomEquiv.lean index b77ff45803589b..c919a652f4ccf0 100644 --- a/Mathlib/CategoryTheory/Localization/HomEquiv.lean +++ b/Mathlib/CategoryTheory/Localization/HomEquiv.lean @@ -144,6 +144,7 @@ lemma homEquiv_refl (f : L₁.obj X ⟶ L₁.obj Y) : homEquiv W L₁ L₁ f = f := by apply LocalizerMorphism.id_homMap +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma homEquiv_trans (f : L₁.obj X ⟶ L₁.obj Y) : homEquiv W L₂ L₃ (homEquiv W L₁ L₂ f) = homEquiv W L₁ L₃ f := by diff --git a/Mathlib/CategoryTheory/Localization/Linear.lean b/Mathlib/CategoryTheory/Localization/Linear.lean index 4accef731aee7e..28764bbc5df8a7 100644 --- a/Mathlib/CategoryTheory/Localization/Linear.lean +++ b/Mathlib/CategoryTheory/Localization/Linear.lean @@ -34,7 +34,7 @@ variable (R : Type w) [Ring R] {C : Type u₁} [Category.{v₁} C] {D : Type u /-- If `L : C ⥤ D` is a localization functor and `C` is `R`-linear, then `D` is `R`-linear if we already know that `D` is preadditive and `L` is additive. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def linear : Linear R D := Linear.ofRingMorphism ((CatCenter.localizationRingHom L W).comp (Linear.toCatCenter R C)) diff --git a/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean b/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean index d69534f721a440..2b857b950eee93 100644 --- a/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean +++ b/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean @@ -381,6 +381,7 @@ section variable [Φ.functor.IsEquivalence] [Φ.IsInduced] [W₂.RespectsIso] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] Functor.asEquivalence_counitIso_hom_app Functor.asEquivalence_counitIso_inv_app in @@ -402,6 +403,7 @@ instance : Φ.inv.functor.IsEquivalence := by dsimp infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] Functor.asEquivalence_inverse Functor.asEquivalence_counitIso_hom_app Functor.asEquivalence_counitIso_inv_app in diff --git a/Mathlib/CategoryTheory/Localization/LocallySmall.lean b/Mathlib/CategoryTheory/Localization/LocallySmall.lean index bac83aa39df13b..7f8ea9097f8f74 100644 --- a/Mathlib/CategoryTheory/Localization/LocallySmall.lean +++ b/Mathlib/CategoryTheory/Localization/LocallySmall.lean @@ -33,7 +33,7 @@ variable {C : Type u₁} [Category.{v₁} C] (W : MorphismProperty C) a `HasLocalization.{w} W` instance by shrinking the morphisms in `D`. (This version assumes that the types of objects of the categories `C` and `D` are in the same universe.) -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def hasLocalizationOfLocallySmall {D : Type u₁} [Category.{v₂} D] [LocallySmall.{w} D] (L : C ⥤ D) [L.IsLocalization W] : @@ -41,7 +41,7 @@ noncomputable def hasLocalizationOfLocallySmall D := ShrinkHoms D L := L ⋙ (ShrinkHoms.equivalence D).functor --- adding `@[implicit_reducible]` causes downstream breakage +-- adding `@[instance_reducible]` causes downstream breakage set_option warn.classDefReducibility false in /-- If `L : C ⥤ D` is a localization functor for a class of morphisms `W : MorphismProperty C`, and `D` is locally `w`-small, we may obtain diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean index 2c047c74c9aebf..fdfc21b4f1d604 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Basic.lean @@ -234,6 +234,7 @@ lemma rightUnitor_hom_app (X : C) : change _ ≫ (μ L W ε _ _).hom ≫ _ ≫ 𝟙 _ ≫ 𝟙 _ = _ simp only [comp_id] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma associator_hom_app (X₁ X₂ X₃ : C) : (α_ ((L').obj X₁) ((L').obj X₂) ((L').obj X₃)).hom = @@ -286,6 +287,7 @@ lemma whisker_exchange {Q X Y Z : LocalizedMonoidal L W ε} (f : Q ⟶ X) (g : Y Q ◁ g ≫ f ▷ Z = f ▷ Y ≫ X ◁ g := by simp only [← id_tensorHom, ← tensorHom_id, ← tensor_comp, id_comp, comp_id] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma associator_naturality {X₁ X₂ X₃ Y₁ Y₂ Y₃ : LocalizedMonoidal L W ε} @@ -391,6 +393,7 @@ lemma triangle_aux₁ {X₁ X₂ X₃ Y₁ Y₂ Y₃ : LocalizedMonoidal L W ε} simp only [associator_naturality_assoc, ← tensor_comp, Iso.hom_inv_id, id_tensorHom, whiskerLeft_id, comp_id] +set_option backward.isDefEq.respectTransparency.types false in lemma triangle_aux₂ {X Y : LocalizedMonoidal L W ε} {X' Y' : C} (e₁ : (L').obj X' ≅ X) (e₂ : (L').obj Y' ≅ Y) : e₁.hom ⊗ₘ (ε.hom ⊗ₘ e₂.hom) ≫ (λ_ Y).hom = @@ -413,6 +416,7 @@ lemma triangle_aux₃ {X Y : LocalizedMonoidal L W ε} {X' Y' : C} ← rightUnitor_naturality, rightUnitor_hom_app, ← tensorHom_id, ← id_tensorHom, ← tensor_comp_assoc, comp_id, id_comp] +set_option backward.isDefEq.respectTransparency.types false in variable {L W ε} in lemma triangle (X Y : LocalizedMonoidal L W ε) : (α_ X (𝟙_ _) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y := by diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean index 44e1a7c75839e1..14b818e761fec2 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Braided.lean @@ -138,6 +138,7 @@ section Symmetric variable [SymmetricCategory C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in noncomputable instance : SymmetricCategory (LocalizedMonoidal L W ε) := by refine .ofCurried (natTrans₂_ext (L') (L') W W fun X Y ↦ ?_) diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean index 5fa9970fc17379..21a07472d61224 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean @@ -55,6 +55,7 @@ noncomputable def curriedTensorPreIsoPost : curriedTensorPre F ≅ curriedTensor lift₂NatIso L L W W (curriedTensorPre G) (curriedTensorPost G) _ _ (Functor.curriedTensorPreIsoPost G) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma curriedTensorPreIsoPost_hom_app_app (X₁ X₂ : C) : @@ -130,7 +131,7 @@ noncomputable def functorCoreMonoidalOfComp : F.CoreMonoidal := by Monoidal structure on `F`, given that `F` lifts along `L` to a monoidal functor `G`, where `L` is a monoidal localization functor. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def functorMonoidalOfComp : F.Monoidal := (functorCoreMonoidalOfComp L W F G).toMonoidal diff --git a/Mathlib/CategoryTheory/Localization/Predicate.lean b/Mathlib/CategoryTheory/Localization/Predicate.lean index 28242d1d57c21d..b520faf13e73ea 100644 --- a/Mathlib/CategoryTheory/Localization/Predicate.lean +++ b/Mathlib/CategoryTheory/Localization/Predicate.lean @@ -374,7 +374,7 @@ instance compLeft (F : D ⥤ E) : Localization.Lifting L W (L ⋙ F) F := ⟨Iso /-- Given a localization functor `L : C ⥤ D` for `W : MorphismProperty C`, if `F₁' : D ⥤ E` lifts a functor `F₁ : C ⥤ D`, then a functor `F₂'` which is isomorphic to `F₁'` also lifts a functor `F₂` that is isomorphic to `F₁`. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def ofIsos {F₁ F₂ : C ⥤ E} {F₁' F₂' : D ⥤ E} (e : F₁ ≅ F₂) (e' : F₁' ≅ F₂') [Lifting L W F₁ F₁'] : Lifting L W F₂ F₂' := ⟨isoWhiskerLeft L e'.symm ≪≫ iso L W F₁ F₁' ≪≫ e⟩ @@ -436,6 +436,7 @@ same `MorphismProperty C`, this is an equivalence of categories `D₁ ≌ D₂`. def uniq : D₁ ≌ D₂ := (equivalenceFromModel L₁ W').symm.trans (equivalenceFromModel L₂ W') +set_option backward.isDefEq.respectTransparency.types false in lemma uniq_symm : (uniq L₁ L₂ W').symm = uniq L₂ L₁ W' := by dsimp [uniq, Equivalence.trans] ext <;> aesop diff --git a/Mathlib/CategoryTheory/Localization/Resolution.lean b/Mathlib/CategoryTheory/Localization/Resolution.lean index b8f5c6f731127f..6d44f6d5844179 100644 --- a/Mathlib/CategoryTheory/Localization/Resolution.lean +++ b/Mathlib/CategoryTheory/Localization/Resolution.lean @@ -255,6 +255,7 @@ def RightResolution.unopFunctor (X₂ : C₂ᵒᵖ) : { f := φ.unop.f.unop comm := Quiver.Hom.op_inj φ.unop.comm } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories `(Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)`. -/ diff --git a/Mathlib/CategoryTheory/Localization/Triangulated.lean b/Mathlib/CategoryTheory/Localization/Triangulated.lean index 7074b0ad91d595..b5b025da4f9cdd 100644 --- a/Mathlib/CategoryTheory/Localization/Triangulated.lean +++ b/Mathlib/CategoryTheory/Localization/Triangulated.lean @@ -195,7 +195,7 @@ lemma complete_distinguished_triangle_morphism (T₁ T₂ : Triangle D) variable [HasZeroObject D] [Preadditive D] [∀ (n : ℤ), (shiftFunctor D n).Additive] [L.Additive] /-- The pretriangulated structure on the localized category. -/ -@[implicit_reducible] +@[instance_reducible] def pretriangulated : Pretriangulated D where distinguishedTriangles := L.essImageDistTriang isomorphic_distinguished _ hT₁ _ e := L.essImageDistTriang_mem_of_iso e hT₁ diff --git a/Mathlib/CategoryTheory/Localization/Trifunctor.lean b/Mathlib/CategoryTheory/Localization/Trifunctor.lean index 0a82e9dd1e54aa..5ddf686ca4e75d 100644 --- a/Mathlib/CategoryTheory/Localization/Trifunctor.lean +++ b/Mathlib/CategoryTheory/Localization/Trifunctor.lean @@ -171,7 +171,7 @@ variable /-- The construction `bifunctorComp₁₂` of a trifunctor by composition of bifunctors is compatible with localization. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Lifting₃.bifunctorComp₁₂ : Lifting₃ L₁ L₂ L₃ W₁ W₂ W₃ ((Functor.postcompose₃.obj L).obj (bifunctorComp₁₂ F₁₂ G)) @@ -186,7 +186,7 @@ noncomputable def Lifting₃.bifunctorComp₁₂ : /-- The construction `bifunctorComp₂₃` of a trifunctor by composition of bifunctors is compatible with localization. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Lifting₃.bifunctorComp₂₃ : Lifting₃ L₁ L₂ L₃ W₁ W₂ W₃ ((Functor.postcompose₃.obj L).obj (bifunctorComp₂₃ F G₂₃)) @@ -205,6 +205,7 @@ noncomputable def associator : bifunctorComp₁₂ F₁₂' G' ≅ bifunctorComp letI := Lifting₃.bifunctorComp₂₃ L₁ L₂ L₃ L₂₃ L W₁ W₂ W₃ W₂₃ F G₂₃ F' G₂₃' lift₃NatIso L₁ L₂ L₃ W₁ W₂ W₃ _ _ _ _ ((Functor.postcompose₃.obj L).mapIso iso) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma associator_hom_app_app_app (X₁ : C₁) (X₂ : C₂) (X₃ : C₃) : (((associator L₁ L₂ L₃ L₁₂ L₂₃ L W₁ W₂ W₃ W₁₂ W₂₃ iso F₁₂' G' F' G₂₃').hom.app (L₁.obj X₁)).app diff --git a/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean b/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean index cf453411ef677d..7fc555379f6a82 100644 --- a/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean +++ b/Mathlib/CategoryTheory/LocallyCartesianClosed/ChosenPullbacksAlong.lean @@ -60,14 +60,14 @@ abbrev ChosenPullbacks := Π {X Y : C} (f : Y ⟶ X), ChosenPullbacksAlong f namespace ChosenPullbacksAlong /-- Relating the existing noncomputable `HasPullbacksAlong` typeclass to `ChosenPullbacksAlong`. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] noncomputable def ofHasPullbacksAlong {Y X : C} (f : Y ⟶ X) [HasPullbacksAlong f] : ChosenPullbacksAlong f where pullback := Over.pullback f mapPullbackAdj := Over.mapPullbackAdj f /-- The identity morphism has a functorial choice of pullbacks. -/ -@[implicit_reducible] +@[instance_reducible] def id (X : C) : ChosenPullbacksAlong (𝟙 X) where pullback := 𝟭 _ mapPullbackAdj := (Adjunction.id).ofNatIsoLeft (Over.mapId _).symm @@ -100,7 +100,7 @@ theorem pullbackId_hom_counit (X : C) [ChosenPullbacksAlong (𝟙 X)] : set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Every isomorphism has a functorial choice of pullbacks. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def iso {Y X : C} (f : Y ≅ X) : ChosenPullbacksAlong f.hom where pullback.obj Z := Over.mk (Z.hom ≫ f.inv) pullback.map {Y Z} g := Over.homMk (g.left) @@ -108,11 +108,11 @@ def iso {Y X : C} (f : Y ≅ X) : ChosenPullbacksAlong f.hom where mapPullbackAdj.counit.app U := Over.homMk (𝟙 _) /-- The inverse of an isomorphism has a functorial choice of pullbacks. -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def isoInv {Y X : C} (f : Y ≅ X) : ChosenPullbacksAlong f.inv := iso f.symm /-- The composition of morphisms with chosen pullbacks has a chosen pullback. -/ -@[implicit_reducible] +@[instance_reducible] def comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [ChosenPullbacksAlong f] [ChosenPullbacksAlong g] : ChosenPullbacksAlong (f ≫ g) where pullback := pullback g ⋙ pullback f @@ -157,7 +157,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- In cartesian monoidal categories, the first product projections `fst` have a functorial choice of pullbacks. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def cartesianMonoidalCategoryFst [CartesianMonoidalCategory C] (X Y : C) : ChosenPullbacksAlong (fst X Y : X ⊗ Y ⟶ X) where pullback.obj Z := Over.mk (Z.hom ▷ Y) @@ -169,7 +169,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- In cartesian monoidal categories, the second product projections `snd` have a functorial choice of pullbacks. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def cartesianMonoidalCategorySnd [CartesianMonoidalCategory C] (X Y : C) : ChosenPullbacksAlong (snd X Y : X ⊗ Y ⟶ Y) where pullback.obj Z := Over.mk (X ◁ Z.hom) @@ -336,7 +336,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in attribute [local simp] condition in /-- If `g` has a chosen pullback, then `Over.ChosenPullbacksAlong.fst f g` has a chosen pullback. -/ -@[implicit_reducible] +@[instance_reducible] def chosenPullbacksAlongFst : ChosenPullbacksAlong (fst f g) where pullback.obj W := Over.mk (pullbackMap _ _ _ _ W.hom (𝟙 _) (𝟙 _)) pullback.map {W' W} k := Over.homMk (lift (fst _ g ≫ k.left) (snd _ g)) _ diff --git a/Mathlib/CategoryTheory/LocallyCartesianClosed/ExponentiableMorphism.lean b/Mathlib/CategoryTheory/LocallyCartesianClosed/ExponentiableMorphism.lean index 3bc6492b8b0313..90e87a435554b7 100644 --- a/Mathlib/CategoryTheory/LocallyCartesianClosed/ExponentiableMorphism.lean +++ b/Mathlib/CategoryTheory/LocallyCartesianClosed/ExponentiableMorphism.lean @@ -145,7 +145,7 @@ end section /-- The identity morphisms `𝟙 _` are exponentiable. -/ -@[implicit_reducible] +@[instance_reducible] def id (I : C) [ChosenPullbacksAlong (𝟙 I)] : ExponentiableMorphism (𝟙 I) := ⟨𝟭 _, ofNatIsoLeft (F := 𝟭 _) Adjunction.id (pullbackId I).symm⟩ @@ -174,7 +174,7 @@ theorem pushforwardId_hom_counit (I : C) [ChosenPullbacksAlong (𝟙 I)] rw [pushforwardId, Adjunction.rightAdjointUniq_hom_counit] /-- The composition of exponentiable morphisms is exponentiable. -/ -@[implicit_reducible] +@[instance_reducible] def comp {I J K : C} (f : I ⟶ J) (g : J ⟶ K) [ChosenPullbacksAlong f] [ChosenPullbacksAlong g] [ChosenPullbacksAlong (f ≫ g)] [ExponentiableMorphism f] [ExponentiableMorphism g] : diff --git a/Mathlib/CategoryTheory/LocallyCartesianClosed/Over.lean b/Mathlib/CategoryTheory/LocallyCartesianClosed/Over.lean index 58f26c4f4e1b66..e3c2b2ad0ef90e 100644 --- a/Mathlib/CategoryTheory/LocallyCartesianClosed/Over.lean +++ b/Mathlib/CategoryTheory/LocallyCartesianClosed/Over.lean @@ -82,6 +82,7 @@ def binaryFanIsBinaryProduct [ChosenPullbacksAlong Z.hom] : end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A computable instance of `CartesianMonoidalCategory` for `Over X` when `C` has chosen pullbacks. Contrast this with the noncomputable instance provided by @@ -274,6 +275,7 @@ def toOverUnit : C ⥤ Over (𝟙_ C) where obj X := Over.mk <| toUnit X map f := Over.homMk f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The slice category over the terminal unit object is equivalent to the original category. -/ @[simps] @@ -287,6 +289,7 @@ variable {C} attribute [local instance] ChosenPullbacksAlong.cartesianMonoidalCategoryToUnit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The isomorphism of functors `toOverUnit C ⋙ ChosenPullbacksAlong.pullback (toUnit X)` and `toOver X`. -/ @@ -308,6 +311,7 @@ theorem forgetAdjToOver.homEquiv_symm {X : C} (Z : Over X) (A : C) (f : Z ⟶ (t rw [Adjunction.homEquiv_counit, forgetAdjToOver_counit_app] simp +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism of functors `toOver (𝟙_ C)` and `toOverUnit C`. -/ @[simps!] def toOverIsoToOverUnit : toOver (𝟙_ C) ≅ toOverUnit C := @@ -323,6 +327,7 @@ def toOverPullbackIsoToOver {X Y : C} (f : Y ⟶ X) [ChosenPullbacksAlong f] : attribute [local instance] cartesianMonoidalCategoryOver +set_option backward.isDefEq.respectTransparency.types false in omit [CartesianMonoidalCategory C] in /-- The functor `pullback f : Over X ⥤ Over Y` is naturally isomorphic to `toOver : Over X ⥤ Over (Over.mk f)` post-composed with the diff --git a/Mathlib/CategoryTheory/LocallyCartesianClosed/Sections.lean b/Mathlib/CategoryTheory/LocallyCartesianClosed/Sections.lean index 51dcd3f759ba86..0074c99856747d 100644 --- a/Mathlib/CategoryTheory/LocallyCartesianClosed/Sections.lean +++ b/Mathlib/CategoryTheory/LocallyCartesianClosed/Sections.lean @@ -104,6 +104,7 @@ def sectionsUncurry {X : Over I} {A : C} (v : A ⟶ (sections I).obj X) : dsimp [uncurry] at * rw [Category.assoc, ← w', whiskerLeft_toUnit_comp_rightUnitor_hom, braiding_hom_fst]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem sectionsCurry_sectionUncurry {X : Over I} {A : C} {v : A ⟶ (sections I).obj X} : @@ -111,6 +112,7 @@ theorem sectionsCurry_sectionUncurry {X : Over I} {A : C} {v : A ⟶ (sections I dsimp [sectionsCurry, sectionsUncurry] cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem sectionsUncurry_sectionsCurry {X : Over I} {A : C} {u : (toOver I).obj A ⟶ X} : diff --git a/Mathlib/CategoryTheory/LocallyDirected.lean b/Mathlib/CategoryTheory/LocallyDirected.lean index 816b7e293aba30..d23d13d21f714c 100644 --- a/Mathlib/CategoryTheory/LocallyDirected.lean +++ b/Mathlib/CategoryTheory/LocallyDirected.lean @@ -55,6 +55,7 @@ instance (F : Discrete J ⥤ Type*) : F.IsLocallyDirected := by rintro ⟨i⟩ ⟨j⟩ ⟨k⟩ ⟨⟨⟨⟩⟩⟩ ⟨⟨⟨⟩⟩⟩ simpa using fun x ↦ ⟨i, 𝟙 _, 𝟙 _, x, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in instance (F : WidePushoutShape J ⥤ Type*) [∀ i, Mono (F.map (.init i))] : F.IsLocallyDirected := by constructor diff --git a/Mathlib/CategoryTheory/Monad/Adjunction.lean b/Mathlib/CategoryTheory/Monad/Adjunction.lean index 56a96a51d2bb9c..7f25255de21635 100644 --- a/Mathlib/CategoryTheory/Monad/Adjunction.lean +++ b/Mathlib/CategoryTheory/Monad/Adjunction.lean @@ -79,18 +79,21 @@ def toComonad (h : L ⊣ R) : Comonad D where rw [← L.map_comp] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The monad induced by the Eilenberg-Moore adjunction is the original monad. -/ @[simps!] def adjToMonadIso (T : Monad C) : T.adj.toMonad ≅ T := MonadIso.mk (NatIso.ofComponents fun _ => Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The comonad induced by the Eilenberg-Moore adjunction is the original comonad. -/ @[simps!] def adjToComonadIso (G : Comonad C) : G.adj.toComonad ≅ G := ComonadIso.mk (NatIso.ofComponents fun _ => Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- Given an adjunction `L ⊣ R`, if `L ⋙ R` is abstractly isomorphic to the identity functor, then the unit is an isomorphism. @@ -108,6 +111,7 @@ def unitAsIsoOfIso (adj : L ⊣ R) (i : L ⋙ R ≅ 𝟭 C) : 𝟭 C ≅ L ⋙ R ext X exact (adj.toMonad.transport i).right_unit X +set_option backward.isDefEq.respectTransparency.types false in lemma isIso_unit_of_iso (adj : L ⊣ R) (i : L ⋙ R ≅ 𝟭 C) : IsIso adj.unit := (inferInstanceAs (IsIso (unitAsIsoOfIso adj i).hom)) @@ -189,6 +193,7 @@ instance [R.Faithful] (h : L ⊣ R) : (Monad.comparison h).Faithful where instance (T : Monad C) : (Monad.comparison T.adj).Full where map_surjective {_ _} f := ⟨⟨f.f, by simpa using! f.h⟩, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance (T : Monad C) : (Monad.comparison T.adj).EssSurj where mem_essImage X := @@ -239,6 +244,7 @@ instance Comonad.comparison_faithful_of_faithful [L.Faithful] (h : L ⊣ R) : instance (G : Comonad C) : (Comonad.comparison G.adj).Full where map_surjective f := ⟨⟨f.f, by simpa using! f.h⟩, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance (G : Comonad C) : (Comonad.comparison G.adj).EssSurj where mem_essImage X := @@ -358,6 +364,7 @@ instance comparison_essSurj [Reflective R] : Adjunction.right_triangle_components, comp_id] apply (X.unit_assoc _).symm +set_option backward.isDefEq.respectTransparency.types false in lemma comparison_full [R.Full] {L : C ⥤ D} (adj : L ⊣ R) : (Monad.comparison adj).Full where map_surjective f := ⟨R.preimage f.f, by cat_disch⟩ @@ -390,6 +397,7 @@ instance comparison_essSurj [Coreflective R] : assoc] simpa using (coreflectorAdjunction R).counit.app X.A ≫= X.counit.symm +set_option backward.isDefEq.respectTransparency.types false in lemma comparison_full [R.Full] {L : C ⥤ D} (adj : R ⊣ L) : (Comonad.comparison adj).Full where map_surjective f := ⟨R.preimage f.f, by cat_disch⟩ diff --git a/Mathlib/CategoryTheory/Monad/Algebra.lean b/Mathlib/CategoryTheory/Monad/Algebra.lean index 3849a7c0dc307c..77f9b5d4927786 100644 --- a/Mathlib/CategoryTheory/Monad/Algebra.lean +++ b/Mathlib/CategoryTheory/Monad/Algebra.lean @@ -206,6 +206,7 @@ def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra assoc := by simp [A.assoc] } map f := { f := f.f } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The identity monad morphism induces the identity functor from the category of algebras to itself. @@ -214,6 +215,7 @@ The identity monad morphism induces the identity functor from the category of al def algebraFunctorOfMonadHomId {T₁ : Monad C} : algebraFunctorOfMonadHom (𝟙 T₁) ≅ 𝟭 _ := NatIso.ofComponents fun X => Algebra.isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A composition of monad morphisms gives the composition of corresponding functors. -/ @@ -222,6 +224,7 @@ def algebraFunctorOfMonadHomComp {T₁ T₂ T₃ : Monad C} (f : T₁ ⟶ T₂) algebraFunctorOfMonadHom (f ≫ g) ≅ algebraFunctorOfMonadHom g ⋙ algebraFunctorOfMonadHom f := NatIso.ofComponents fun X => Algebra.isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` and `g` are two equal morphisms of monads, then the functors of algebras induced by them are isomorphic. We define it like this as opposed to using `eqToIso` so that the components are nicer to prove @@ -232,6 +235,7 @@ def algebraFunctorOfMonadHomEq {T₁ T₂ : Monad C} {f g : T₁ ⟶ T₂} (h : algebraFunctorOfMonadHom f ≅ algebraFunctorOfMonadHom g := NatIso.ofComponents fun X => Algebra.isoMk (Iso.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`. diff --git a/Mathlib/CategoryTheory/Monad/Comonadicity.lean b/Mathlib/CategoryTheory/Monad/Comonadicity.lean index 70e929cac334bb..da5db5a982c096 100644 --- a/Mathlib/CategoryTheory/Monad/Comonadicity.lean +++ b/Mathlib/CategoryTheory/Monad/Comonadicity.lean @@ -146,6 +146,7 @@ theorem comparisonAdjunction_counit_f_aux (adj.homEquiv _ A.A).symm (equalizer.ι (G.map A.a) (adj.unit.app (G.obj A.A))) := congr_arg (adj.homEquiv _ _).symm (Category.id_comp _) +set_option backward.isDefEq.respectTransparency.types false in /-- This is a fork which is helpful for establishing comonadicity: the morphism from this fork to the Beck equalizer is the counit for the adjunction on the comparison functor. -/ @@ -181,6 +182,7 @@ def unitFork (B : C) : (adj.unit.app (G.obj (F.obj B))) := Fork.ofι (adj.unit.app B) (adj.unit_naturality _) +set_option backward.isDefEq.respectTransparency.types false in variable {adj} in /-- The counit fork is a limit provided `F` preserves it. -/ def counitLimitOfPreservesEqualizer (A : adj.toComonad.Coalgebra) @@ -230,7 +232,7 @@ variable (G) in If `F` is comonadic, it creates limits of `F`-cosplit pairs. This is the "boring" direction of Beck's comonadicity theorem, the converse is given in `comonadicOfCreatesFSplitEqualizers`. -/ -@[implicit_reducible] +@[instance_reducible] def createsFSplitEqualizersOfComonadic [ComonadicLeftAdjoint F] ⦃A B⦄ (f g : A ⟶ B) [F.IsCosplitPair f g] : CreatesLimit (parallelPair f g) F := by apply +allowSynthFailures comonadicCreatesLimitOfPreservesLimit @@ -276,10 +278,11 @@ instance [ReflectsLimitOfIsCosplitPair F] : ∀ (A : Coalgebra adj.toComonad), (NatTrans.app adj.unit (G.obj A.A))) F := fun _ => ReflectsLimitOfIsCosplitPair.out _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- To show `F` is a comonadic left adjoint, we can show it preserves and reflects `F`-split equalizers, and `C` has them. -/ -@[implicit_reducible] +@[instance_reducible] def comonadicOfHasPreservesReflectsFSplitEqualizers [HasEqualizerOfIsCosplitPair F] [PreservesLimitOfIsCosplitPair F] [ReflectsLimitOfIsCosplitPair F] : ComonadicLeftAdjoint F where @@ -327,7 +330,7 @@ Beck's comonadicity theorem. If `F` has a right adjoint and creates equalizers o then it is comonadic. This is the converse of `createsFSplitEqualizersOfComonadic`. -/ -@[implicit_reducible] +@[instance_reducible] def comonadicOfCreatesFSplitEqualizers [CreatesLimitOfIsCosplitPair F] : ComonadicLeftAdjoint F := by have I {A B} (f g : A ⟶ B) [F.IsCosplitPair f g] : HasLimit (parallelPair f g ⋙ F) := by @@ -341,7 +344,7 @@ def comonadicOfCreatesFSplitEqualizers [CreatesLimitOfIsCosplitPair F] : /-- An alternate version of Beck's comonadicity theorem. If `F` reflects isomorphisms, preserves equalizers of `F`-cosplit pairs and `C` has equalizers of `F`-cosplit pairs, then it is comonadic. -/ -@[implicit_reducible] +@[instance_reducible] def comonadicOfHasPreservesFSplitEqualizersOfReflectsIsomorphisms [F.ReflectsIsomorphisms] [HasEqualizerOfIsCosplitPair F] [PreservesLimitOfIsCosplitPair F] : ComonadicLeftAdjoint F := by @@ -375,7 +378,7 @@ set_option backward.isDefEq.respectTransparency false in /-- Coreflexive (crude) comonadicity theorem. If `F` has a right adjoint, `C` has and `F` preserves coreflexive equalizers and `F` reflects isomorphisms, then `F` is comonadic. -/ -@[implicit_reducible] +@[instance_reducible] def comonadicOfHasPreservesCoreflexiveEqualizersOfReflectsIsomorphisms : ComonadicLeftAdjoint F where R := G diff --git a/Mathlib/CategoryTheory/Monad/Limits.lean b/Mathlib/CategoryTheory/Monad/Limits.lean index cb06848c5cea2d..1c511a76b29552 100644 --- a/Mathlib/CategoryTheory/Monad/Limits.lean +++ b/Mathlib/CategoryTheory/Monad/Limits.lean @@ -194,6 +194,7 @@ noncomputable def coconePoint : Algebra T where Functor.map_comp_assoc, commuting, Functor.map_comp, Category.assoc, commuting] apply (D.obj j).assoc_assoc _ +set_option backward.isDefEq.respectTransparency.types false in /-- (Impl) Construct the lifted cocone in `Algebra T` which will be colimiting. -/ @[simps] noncomputable def liftedCocone : Cocone D where @@ -230,6 +231,7 @@ end ForgetCreatesColimits open ForgetCreatesColimits -- TODO: the converse of this is true as well +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit which the monad itself preserves. -/ @@ -277,7 +279,7 @@ instance comp_comparison_hasLimit (F : J ⥤ D) (R : D ⥤ C) [MonadicRightAdjoi Monad.hasLimit_of_comp_forget_hasLimit (F ⋙ Monad.comparison (monadicAdjunction R)) /-- Any monadic functor creates limits. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monadicCreatesLimits (R : D ⥤ C) [MonadicRightAdjoint R] : CreatesLimitsOfSize.{v, u} R := createsLimitsOfNatIso (Monad.comparisonForget (monadicAdjunction R)) @@ -285,7 +287,7 @@ noncomputable def monadicCreatesLimits (R : D ⥤ C) [MonadicRightAdjoint R] : /-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit which the monad itself preserves. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D) [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (monadicLeftAdjoint R ⋙ R)] [PreservesColimit ((K ⋙ R) ⋙ monadicLeftAdjoint R ⋙ R) (monadicLeftAdjoint R ⋙ R)] : @@ -314,7 +316,7 @@ noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J apply createsColimitOfNatIso e /-- A monadic functor creates any colimits of shapes it preserves. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monadicCreatesColimitsOfShapeOfPreservesColimitsOfShape (R : D ⥤ C) [MonadicRightAdjoint R] [PreservesColimitsOfShape J R] : CreatesColimitsOfShape J R := letI : PreservesColimitsOfShape J (monadicLeftAdjoint R) := by @@ -324,7 +326,7 @@ noncomputable def monadicCreatesColimitsOfShapeOfPreservesColimitsOfShape (R : D ⟨monadicCreatesColimitOfPreservesColimit _ _⟩ /-- A monadic functor creates colimits if it preserves colimits. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monadicCreatesColimitsOfPreservesColimits (R : D ⥤ C) [MonadicRightAdjoint R] [PreservesColimitsOfSize.{v, u} R] : CreatesColimitsOfSize.{v, u} R where CreatesColimitsOfShape := @@ -527,6 +529,7 @@ noncomputable def conePoint : Coalgebra T where simp only [Functor.comp_obj, forget_obj, Functor.const_obj_obj, assoc] rw [(D.obj j).coassoc, ← assoc, ← assoc, commuting] +set_option backward.isDefEq.respectTransparency.types false in /-- (Impl) Construct the lifted cone in `Coalgebra T` which will be limiting. -/ @[simps] noncomputable def liftedCone : Cone D where @@ -564,6 +567,7 @@ end ForgetCreatesLimits' open ForgetCreatesLimits' -- TODO: the converse of this is true as well +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from the Eilenberg-Moore category for a comonad creates any limit which the comonad itself preserves. -/ @@ -608,7 +612,7 @@ instance comp_comparison_hasColimit (F : J ⥤ D) (R : D ⥤ C) [ComonadicLeftAd Comonad.hasColimit_of_comp_forget_hasColimit (F ⋙ Comonad.comparison (comonadicAdjunction R)) /-- Any comonadic functor creates colimits. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def comonadicCreatesColimits (R : D ⥤ C) [ComonadicLeftAdjoint R] : CreatesColimitsOfSize.{v, u} R := createsColimitsOfNatIso (Comonad.comparisonForget (comonadicAdjunction R)) @@ -616,7 +620,7 @@ noncomputable def comonadicCreatesColimits (R : D ⥤ C) [ComonadicLeftAdjoint R /-- The forgetful functor from the Eilenberg-Moore category for a comonad creates any limit which the comonad itself preserves. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def comonadicCreatesLimitOfPreservesLimit (R : D ⥤ C) (K : J ⥤ D) [ComonadicLeftAdjoint R] [PreservesLimit (K ⋙ R) (comonadicRightAdjoint R ⋙ R)] [PreservesLimit ((K ⋙ R) ⋙ comonadicRightAdjoint R ⋙ R) (comonadicRightAdjoint R ⋙ R)] : @@ -643,7 +647,7 @@ noncomputable def comonadicCreatesLimitOfPreservesLimit (R : D ⥤ C) (K : J ⥤ apply createsLimitOfNatIso e /-- A comonadic functor creates any limits of shapes it preserves. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def comonadicCreatesLimitsOfShapeOfPreservesLimitsOfShape (R : D ⥤ C) [ComonadicLeftAdjoint R] [PreservesLimitsOfShape J R] : CreatesLimitsOfShape J R := letI : PreservesLimitsOfShape J (comonadicRightAdjoint R) := by @@ -653,7 +657,7 @@ noncomputable def comonadicCreatesLimitsOfShapeOfPreservesLimitsOfShape (R : D ⟨comonadicCreatesLimitOfPreservesLimit _ _⟩ /-- A comonadic functor creates limits if it preserves limits. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def comonadicCreatesLimitsOfPreservesLimits (R : D ⥤ C) [ComonadicLeftAdjoint R] [PreservesLimitsOfSize.{v, u} R] : CreatesLimitsOfSize.{v, u} R where CreatesLimitsOfShape := diff --git a/Mathlib/CategoryTheory/Monad/Monadicity.lean b/Mathlib/CategoryTheory/Monad/Monadicity.lean index 131cb1b731effe..f432f0c38a7849 100644 --- a/Mathlib/CategoryTheory/Monad/Monadicity.lean +++ b/Mathlib/CategoryTheory/Monad/Monadicity.lean @@ -147,6 +147,7 @@ theorem comparisonAdjunction_unit_f_aux (coequalizer.π (F.map A.a) (adj.counit.app (F.obj A.A))) := congr_arg (adj.homEquiv _ _) (Category.comp_id _) +set_option backward.isDefEq.respectTransparency.types false in /-- This is a cofork which is helpful for establishing monadicity: the morphism from the Beck coequalizer to this cofork is the unit for the adjunction on the comparison functor. -/ @@ -157,6 +158,7 @@ def unitCofork (A : adj.toMonad.Algebra) Cofork.ofπ (G.map (coequalizer.π (F.map A.a) (adj.counit.app (F.obj A.A)))) (by rw [← G.map_comp, coequalizer.condition, G.map_comp]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem unitCofork_π (A : adj.toMonad.Algebra) [HasCoequalizer (F.map A.a) (adj.counit.app (F.obj A.A))] : @@ -187,6 +189,7 @@ def counitCofork (B : D) : (adj.counit.app (F.obj (G.obj B))) := Cofork.ofπ (adj.counit.app B) (adj.counit_naturality _) +set_option backward.isDefEq.respectTransparency.types false in variable {adj} in /-- The unit cofork is a colimit provided `G` preserves it. -/ def unitColimitOfPreservesCoequalizer (A : adj.toMonad.Algebra) @@ -235,7 +238,7 @@ variable (G) in If `G` is monadic, it creates colimits of `G`-split pairs. This is the "boring" direction of Beck's monadicity theorem, the converse is given in `monadicOfCreatesGSplitCoequalizers`. -/ -@[implicit_reducible] +@[instance_reducible] def createsGSplitCoequalizersOfMonadic [MonadicRightAdjoint G] ⦃A B⦄ (f g : A ⟶ B) [G.IsSplitPair f g] : CreatesColimit (parallelPair f g) G := by apply +allowSynthFailures monadicCreatesColimitOfPreservesColimit @@ -292,10 +295,11 @@ instance [ReflectsColimitOfIsSplitPair G] : ∀ (A : Algebra adj.toMonad), (NatTrans.app adj.counit (F.obj A.A))) G := fun _ => ReflectsColimitOfIsSplitPair.out _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- To show `G` is a monadic right adjoint, we can show it preserves and reflects `G`-split coequalizers, and `D` has them. -/ -@[implicit_reducible] +@[instance_reducible] def monadicOfHasPreservesReflectsGSplitCoequalizers [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] [ReflectsColimitOfIsSplitPair G] : MonadicRightAdjoint G where @@ -348,7 +352,7 @@ instance [CreatesColimitOfIsSplitPair G] : ∀ (A : Algebra adj.toMonad), pairs, then it is monadic. This is the converse of `createsGSplitCoequalizersOfMonadic`. -/ -@[implicit_reducible] +@[instance_reducible] def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] : MonadicRightAdjoint G := by have I {A B} (f g : A ⟶ B) [G.IsSplitPair f g] : HasColimit (parallelPair f g ⋙ G) := by @@ -362,7 +366,7 @@ def monadicOfCreatesGSplitCoequalizers [CreatesColimitOfIsSplitPair G] : /-- An alternate version of **Beck's monadicity theorem**: if `G` reflects isomorphisms, preserves coequalizers of `G`-split pairs and `C` has coequalizers of `G`-split pairs, then it is monadic. -/ -@[implicit_reducible] +@[instance_reducible] def monadicOfHasPreservesGSplitCoequalizersOfReflectsIsomorphisms [G.ReflectsIsomorphisms] [HasCoequalizerOfIsSplitPair G] [PreservesColimitOfIsSplitPair G] : MonadicRightAdjoint G := by @@ -394,10 +398,11 @@ instance [PreservesColimitOfIsReflexivePair G] : ∀ X : Algebra adj.toMonad, variable [PreservesColimitOfIsReflexivePair G] +set_option backward.isDefEq.respectTransparency.types false in /-- Reflexive (crude) monadicity theorem. If `G` has a right adjoint, `D` has and `G` preserves reflexive coequalizers and `G` reflects isomorphisms, then `G` is monadic. -/ -@[implicit_reducible] +@[instance_reducible] def monadicOfHasPreservesReflexiveCoequalizersOfReflectsIsomorphisms : MonadicRightAdjoint G where L := F adj := adj diff --git a/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean index 6b0534d4b0818e..7f08186e10469e 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/Basic.lean @@ -338,6 +338,7 @@ variable {D} in /-- Bundle `c ↦ c ⊙ₗ d` as a functor. -/ abbrev actionRight (d : D) : C ⥤ D := curriedAction C D |>.flip.obj d +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Bundle `αₗ _ _ _` as an isomorphism of trifunctors. -/ @[simps!] @@ -649,6 +650,7 @@ variable {D} in /-- Bundle `c ↦ d ⊙ᵣ c` as a functor. -/ abbrev actionLeft (d : D) : C ⥤ D := curriedAction C D |>.flip.obj d +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Bundle `αᵣ _ _ _` as an isomorphism of trifunctors. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Monoidal/Action/End.lean b/Mathlib/CategoryTheory/Monoidal/Action/End.lean index 838a81c229eab7..b758cbbd3c219c 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/End.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/End.lean @@ -95,7 +95,7 @@ variable {C D} set_option backward.isDefEq.respectTransparency false in /-- A monoidal functor `F : C ⥤ (D ⥤ D)ᴹᵒᵖ` can be thought of as a left action of `C` on `D`. -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def actionOfMonoidalFunctorToEndofunctorMop (F : C ⥤ (D ⥤ D)ᴹᵒᵖ) [F.Monoidal] : MonoidalLeftAction C D where actionObj c d := (F.obj c).unmop.obj d @@ -185,7 +185,7 @@ instance curriedActionMonoidal [MonoidalRightAction C D] : set_option backward.isDefEq.respectTransparency false in /-- A monoidal functor `F : C ⥤ D ⥤ D` can be thought of as a right action of `C` on `D`. -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def actionOfMonoidalFunctorToEndofunctor (F : C ⥤ D ⥤ D) [F.Monoidal] : MonoidalRightAction C D where actionObj d c := (F.obj c).obj d diff --git a/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean b/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean index ffd1a2eb940b39..3e5dee1dfe11e4 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean @@ -41,7 +41,7 @@ open MonoidalOpposite /-- Define a left action of `C` on `D` from a right action of `Cᴹᵒᵖ` on `D` via the formula `c ⊙ₗ d := d ⊙ᵣ (mop c)`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def leftActionOfMonoidalOppositeRightAction [MonoidalRightAction Cᴹᵒᵖ D] : MonoidalLeftAction C D where actionObj c d := d ⊙ᵣ mop c @@ -257,7 +257,7 @@ open MonoidalOpposite /-- Define a right action of `C` on `D` from a left action of `Cᴹᵒᵖ` on `D` via the formula `d ⊙ᵣ c := (mop c) ⊙ₗ d`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def rightActionOfMonoidalOppositeLeftAction [MonoidalLeftAction Cᴹᵒᵖ D] : MonoidalRightAction C D where actionObj d c := mop c ⊙ₗ d diff --git a/Mathlib/CategoryTheory/Monoidal/Arrow.lean b/Mathlib/CategoryTheory/Monoidal/Arrow.lean index 1ade744d18a540..aceb189befe881 100644 --- a/Mathlib/CategoryTheory/Monoidal/Arrow.lean +++ b/Mathlib/CategoryTheory/Monoidal/Arrow.lean @@ -52,6 +52,7 @@ scoped instance [HasPushouts C] [HasInitial C] [CartesianMonoidalCategory C] [Mo variable [HasPushouts C] [HasInitial C] [CartesianMonoidalCategory C] [MonoidalClosed C] [BraidedCategory C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma tensorHom_comp_tensorHom {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : Arrow C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁) (g₂ : Y₂ ⟶ Z₂) : @@ -114,6 +115,7 @@ lemma triangle (X Y : Arrow C) : exact initialIsInitial.ofIso (zeroMul initialIsInitial).symm · simp [← comp_whiskerRight_assoc] +set_option backward.isDefEq.respectTransparency.types false in /-- The monoidal category instance induced by the pushout-product. -/ scoped instance : MonoidalCategory (Arrow C) where tensorHom_comp_tensorHom := tensorHom_comp_tensorHom diff --git a/Mathlib/CategoryTheory/Monoidal/Bimod.lean b/Mathlib/CategoryTheory/Monoidal/Bimod.lean index ee60388b5f483c..f97cef76e94937 100644 --- a/Mathlib/CategoryTheory/Monoidal/Bimod.lean +++ b/Mathlib/CategoryTheory/Monoidal/Bimod.lean @@ -626,6 +626,7 @@ noncomputable def hom : TensorBimod.X (regular R) P ⟶ P.X := noncomputable def inv : P.X ⟶ TensorBimod.X (regular R) P := (λ_ P.X).inv ≫ (η[R.X] ▷ _) ≫ coequalizer.π _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem hom_inv_id : hom P ≫ inv P = 𝟙 _ := by dsimp only [hom, inv, TensorBimod.X] @@ -688,6 +689,7 @@ noncomputable def hom : TensorBimod.X P (regular S) ⟶ P.X := noncomputable def inv : P.X ⟶ TensorBimod.X P (regular S) := (ρ_ P.X).inv ≫ (_ ◁ η[S.X]) ≫ coequalizer.π _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem hom_inv_id : hom P ≫ inv P = 𝟙 _ := by dsimp only [hom, inv, TensorBimod.X] @@ -1014,7 +1016,7 @@ theorem triangle_bimod {X Y Z : Mon C} (M : Bimod X Y) (N : Bimod Y Z) : simp only [Category.assoc] /-- The bicategory of algebras (monoids) and bimodules, all internal to some monoidal category. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monBicategory : Bicategory (Mon C) where Hom X Y := Bimod X Y homCategory X Y := (inferInstance : Category (Bimod X Y)) diff --git a/Mathlib/CategoryTheory/Monoidal/Bimon_.lean b/Mathlib/CategoryTheory/Monoidal/Bimon_.lean index e24b705f6e8de5..898ffc9b643dc3 100644 --- a/Mathlib/CategoryTheory/Monoidal/Bimon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Bimon_.lean @@ -109,6 +109,7 @@ def toMonComonObj (M : Bimon C) : Mon (Comon C) where mon.mul.hom := μ[M.X.X] mon.mul.isComonHom_hom.hom_comul := by simp +set_option backward.isDefEq.respectTransparency.types false in /-- The forward direction of `Comon (Mon C) ≌ Mon (Comon C)` -/ @[simps] def toMonComon : Bimon C ⥤ Mon (Comon C) where @@ -141,6 +142,7 @@ def ofMonComonObj (M : Mon (Comon C)) : Bimon C where comon.counit := .mk' ε[M.X.X] comon.comul := .mk' Δ[M.X.X] +set_option backward.isDefEq.respectTransparency.types false in variable (C) in /-- The backward direction of `Comon (Mon C) ≌ Mon (Comon C)` -/ @[simps] @@ -148,16 +150,19 @@ def ofMonComon : Mon (Comon C) ⥤ Bimon C where obj := ofMonComonObj map f := .mk' ((Comon.forget C).mapMon.map f) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toMonComon_ofMonComon_obj_one (M : Bimon C) : η[((toMonComon C ⋙ ofMonComon C).obj M).X.X] = 𝟙 _ ≫ η[M.X.X] := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toMonComon_ofMonComon_obj_mul (M : Bimon C) : μ[((toMonComon C ⋙ ofMonComon C).obj M).X.X] = 𝟙 _ ≫ μ[M.X.X] := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `equivMonComonUnitIsoApp`. -/ @[simps!] def equivMonComonUnitIsoAppXAux (M : Bimon C) : @@ -218,6 +223,7 @@ def equivMonComonCounitIsoApp (M : Mon (Comon C)) : (ofMonComon C ⋙ toMonComon C).obj M ≅ M := Mon.mkIso <| (equivMonComonCounitIsoAppX M) +set_option backward.isDefEq.respectTransparency.types false in /-- The equivalence `Comon (Mon C) ≌ Mon (Comon C)` -/ def equivMonComon : Bimon C ≌ Mon (Comon C) where functor := toMonComon C @@ -232,11 +238,13 @@ variable (C) in @[simps!] def trivial : Bimon C := Comon.trivial (Mon C) +set_option backward.isDefEq.respectTransparency.types false in /-- The bimonoid morphism from the trivial bimonoid to any bimonoid. -/ @[simps] def trivialTo (A : Bimon C) : trivial C ⟶ A := .mk' (default : Mon.trivial C ⟶ A.X) +set_option backward.isDefEq.respectTransparency.types false in /-- The bimonoid morphism from any bimonoid to the trivial bimonoid. -/ @[simps!] def toTrivial (A : Bimon C) : A ⟶ trivial C := @@ -244,10 +252,12 @@ def toTrivial (A : Bimon C) : A ⟶ trivial C := /-! ### Additional lemmas -/ +set_option backward.isDefEq.respectTransparency.types false in theorem BimonObjAux_counit (M : Bimon C) : ε[((toComon C).obj M).X] = ε[M.X].hom := Category.comp_id _ +set_option backward.isDefEq.respectTransparency.types false in theorem BimonObjAux_comul (M : Bimon C) : Δ[((toComon C).obj M).X] = Δ[M.X].hom := Category.comp_id _ diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean index 10edcb978c5329..7ede235a475564 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean @@ -147,6 +147,7 @@ def tensorLeftIsoTensorRight (X : C) : hom := { app Y := (β_ X Y).hom } inv := { app Y := (β_ X Y).inv } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (C) in /-- The braiding isomorphism as a natural isomorphism of bifunctors `C ⥤ C ⥤ C`. -/ @@ -208,7 +209,7 @@ end BraidedCategory Verifying the axioms for a braiding by checking that the candidate braiding is sent to a braiding by a faithful monoidal functor. -/ -@[implicit_reducible] +@[instance_reducible] def BraidedCategory.ofFaithful {C D : Type*} [Category* C] [Category* D] [MonoidalCategory C] [MonoidalCategory D] (F : C ⥤ D) [F.Monoidal] [F.Faithful] [BraidedCategory D] (β : ∀ X Y : C, X ⊗ Y ≅ Y ⊗ X) @@ -252,7 +253,7 @@ def BraidedCategory.ofFaithful {C D : Type*} [Category* C] [Category* D] [Monoid braiding_naturality_left_assoc, Functor.LaxMonoidal.associativity_inv, hexagon_reverse_assoc] /-- Pull back a braiding along a fully faithful monoidal functor. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def BraidedCategory.ofFullyFaithful {C D : Type*} [Category* C] [Category* D] [MonoidalCategory C] [MonoidalCategory D] (F : C ⥤ D) [F.Monoidal] [F.Full] [F.Faithful] [BraidedCategory D] : BraidedCategory C := @@ -405,7 +406,7 @@ instance (F : C ⥤ D) (G : D ⥤ E) [F.LaxBraided] [G.LaxBraided] : /-- Given two lax monoidal, monoidally isomorphic functors, if one is lax braided, so is the other. -/ -@[implicit_reducible] +@[instance_reducible] def ofNatIso {F G : C ⥤ D} (i : F ≅ G) [F.LaxBraided] [G.LaxMonoidal] [NatTrans.IsMonoidal i.hom] : G.LaxBraided where braided X Y := by @@ -462,6 +463,7 @@ set_option backward.isDefEq.respectTransparency false in def homMk {F G : LaxBraidedFunctor C D} (f : F.toFunctor ⟶ G.toFunctor) [NatTrans.IsMonoidal f] : F ⟶ G := ⟨f, inferInstance⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Constructor for isomorphisms in the category `LaxBraidedFunctor C D`. -/ @[simps] def isoMk {F G : LaxBraidedFunctor C D} (e : F.toFunctor ≅ G.toFunctor) @@ -533,14 +535,14 @@ lemma Functor.map_braiding (F : C ⥤ D) (X Y : C) [F.Braided] : /-- A braided category with a faithful braided functor to a symmetric category is itself symmetric. -/ -@[implicit_reducible] +@[instance_reducible] def SymmetricCategory.ofFaithful {C D : Type*} [Category* C] [Category* D] [MonoidalCategory C] [MonoidalCategory D] [BraidedCategory C] [SymmetricCategory D] (F : C ⥤ D) [F.Braided] [F.Faithful] : SymmetricCategory C where symmetry X Y := F.map_injective (by simp) /-- Pull back a symmetric braiding along a fully faithful monoidal functor. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def SymmetricCategory.ofFullyFaithful {C D : Type*} [Category* C] [Category* D] [MonoidalCategory C] [MonoidalCategory D] (F : C ⥤ D) [F.Monoidal] [F.Full] [F.Faithful] [SymmetricCategory D] : SymmetricCategory C := @@ -883,7 +885,7 @@ lemma SymmetricCategory.reverseBraiding_eq (C : Type u₁) [Category.{v₁} C] /-- The identity functor from `C` to `C`, where the codomain is given the reversed braiding, upgraded to a braided functor. -/ -@[implicit_reducible] +@[instance_reducible] def SymmetricCategory.equivReverseBraiding (C : Type u₁) [Category.{v₁} C] [MonoidalCategory C] [SymmetricCategory C] := @Functor.Braided.mk C _ _ _ C _ _ (reverseBraiding C) (𝟭 C) _ <| by diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean index 0b8ec4dbf448c4..e7d728acd1f85b 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Multifunctor.lean @@ -223,7 +223,7 @@ Given a braiding `β : curriedTensor C ≅ (curriedTensor C).flip` as a natural bifunctors, and the two equalities `hexagon_forward` and `hexagon_reverse` of natural transformations between trifunctors, we obtain a braided category structure. -/ -@[implicit_reducible] +@[instance_reducible] def ofBifunctor : BraidedCategory C where braiding X Y := (β.app X).app Y braiding_naturality_right _ _ _ _ := (β.app _).hom.naturality _ @@ -241,7 +241,7 @@ open BraidedCategory Alternative constructor for symmetric categories, where the symmetry of the braiding is phrased as an equality of natural transformation of bifunctors. -/ -@[implicit_reducible] +@[instance_reducible] def SymmetricCategory.ofCurried [BraidedCategory C] (h : (curriedBraidingNatIso C).hom ≫ (flipFunctor _ _ _).map (curriedBraidingNatIso C).hom = 𝟙 _) : diff --git a/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean b/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean index b7501b5b3e9eae..55777060442399 100644 --- a/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean +++ b/Mathlib/CategoryTheory/Monoidal/Braided/Reflection.lean @@ -220,7 +220,7 @@ instance (c : C) (d : D) : IsIso (adj.unit.app ((ihom d).obj (R.obj c))) := by set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `monoidalClosed`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def closed (c : C) : Closed c where rightAdj := R ⋙ (ihom (R.obj c)) ⋙ L adj := by @@ -240,7 +240,7 @@ noncomputable def closed (c : C) : Closed c where Given a reflective functor `R : C ⥤ D` with a monoidal left adjoint, such that `D` is symmetric monoidal closed, then `C` is monoidal closed. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monoidalClosed : MonoidalClosed C where closed c := closed adj c diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean index b02b3fafc21679..0f81fae81804c4 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean @@ -474,7 +474,7 @@ instance (priority := low) toSymmetricCategory : SymmetricCategory C where /-- `CartesianMonoidalCategory` implies `BraidedCategory`. This is not an instance to prevent diamonds. -/ -@[implicit_reducible] +@[instance_reducible] def _root_.CategoryTheory.BraidedCategory.ofCartesianMonoidalCategory : BraidedCategory C where braiding X Y := { hom := lift (snd _ _) (fst _ _), inv := lift (snd _ _) (fst _ _) } @@ -679,6 +679,7 @@ def prodComparisonBifunctorNatTrans : variable {E : Type u₂} [Category.{v₂} E] [CartesianMonoidalCategory E] (G : D ⥤ E) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem prodComparisonBifunctorNatTrans_comp : prodComparisonBifunctorNatTrans (F ⋙ G) = Functor.whiskerRight @@ -801,6 +802,7 @@ open Limits variable {P : ObjectProperty C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- TODO: Introduce `ClosedUnderFiniteProducts`? /-- The restriction of a Cartesian-monoidal category along an object property that's closed under @@ -988,16 +990,21 @@ end Braided namespace EssImageSubcategory variable [F.Full] [F.Faithful] [PreservesFiniteProducts F] {T X Y Z : F.EssImageSubcategory} +set_option backward.isDefEq.respectTransparency.types false in lemma tensor_obj (X Y : F.EssImageSubcategory) : (X ⊗ Y).obj = X.obj ⊗ Y.obj := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma lift_def (f : T ⟶ X) (g : T ⟶ Y) : lift f g = ObjectProperty.homMk (lift f.hom g.hom) := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma associator_hom_def (X Y Z : F.EssImageSubcategory) : (α_ X Y Z).hom = ObjectProperty.homMk (α_ X.obj Y.obj Z.obj).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma associator_inv_def (X Y Z : F.EssImageSubcategory) : (α_ X Y Z).inv = ObjectProperty.homMk (α_ X.obj Y.obj Z.obj).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma toUnit_def (X : F.EssImageSubcategory) : toUnit X = ObjectProperty.homMk (toUnit X.obj) := rfl diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean index fe020f0ea6ccd3..1e7689bea5f4a3 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Cat.lean @@ -50,6 +50,7 @@ def fromChosenTerminalEquiv {C : Type u} [Category.{v} C] : Cat.chosenTerminal def prodCone (C D : Cat.{v, u}) : BinaryFan C D := .mk (P := .of (C × D)) (Prod.fst _ _).toCatHom (Prod.snd _ _).toCatHom +set_option backward.isDefEq.respectTransparency.types false in /-- The product cone in `Cat` is indeed a product. -/ def isLimitProdCone (X Y : Cat) : IsLimit (prodCone X Y) := BinaryFan.isLimitMk (fun S => (S.fst.toFunctor.prod' S.snd.toFunctor).toCatHom) (fun _ => rfl) diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean index 275e6483a968e2..dc5467926bc884 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommGrp_.lean @@ -30,7 +30,7 @@ class abbrev CommGrpObj := GrpObj X, IsCommMonObj X variable (X) in /-- If `X` represents a presheaf of commutative groups, then `X` is a commutative group object. -/ -@[implicit_reducible] +@[instance_reducible] def CommGrpObj.ofRepresentableBy (F : Cᵒᵖ ⥤ CommGrpCat.{w}) (α : (F ⋙ forget _).RepresentableBy X) : CommGrpObj X where __ := GrpObj.ofRepresentableBy X (F ⋙ forget₂ CommGrpCat GrpCat) α diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean index 81119fa7777267..df01f1f232d83a 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean @@ -29,6 +29,7 @@ variable {J C D E : Type*} [Category* J] [Category* C] [Category* D] [Category* namespace Functor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance cartesianMonoidalCategory : CartesianMonoidalCategory (J ⥤ C) where fst X Y := { app _ := CartesianMonoidalCategory.fst _ _ } diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean index 0ebc7b3a240160..678ed44a825a74 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean @@ -30,7 +30,7 @@ variable {C : Type u} [Category.{v} C] [CartesianMonoidalCategory C] variable (X) in /-- If `X` represents a presheaf of monoids, then `X` is a monoid object. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If `X` represents a presheaf of additive monoids, then `X` is an additive monoid object. -/] def GrpObj.ofRepresentableBy (F : Cᵒᵖ ⥤ GrpCat.{w}) (α : (F ⋙ forget _).RepresentableBy X) : GrpObj X where diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean index aebc3e41b449ac..657547d58981ad 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean @@ -176,7 +176,7 @@ end Mon variable (X) in /-- If `X` represents a presheaf of monoids, then `X` is a monoid object. -/ -@[to_additive (attr := simps, implicit_reducible) +@[to_additive (attr := simps, instance_reducible) /-- If `X` represents a presheaf of additive monoids, then `X` is an additive monoid object. -/] def MonObj.ofRepresentableBy (F : Cᵒᵖ ⥤ MonCat.{w}) (α : (F ⋙ forget _).RepresentableBy X) : MonObj X where diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean index aa334a5b7de085..c3993c7a1b48dc 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Over.lean @@ -29,6 +29,7 @@ open Functor Limits CartesianMonoidalCategory variable {C : Type*} [Category* C] [HasPullbacks C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A choice of finite products of `Over X` given by `Limits.pullback`. -/ abbrev cartesianMonoidalCategory (X : C) : CartesianMonoidalCategory (Over X) := @@ -40,6 +41,7 @@ abbrev cartesianMonoidalCategory (X : C) : CartesianMonoidalCategory (Over X) := attribute [local instance] cartesianMonoidalCategory +set_option backward.isDefEq.respectTransparency.types false in /-- `Over X` is braided w.r.t. the Cartesian monoidal structure given by `Limits.pullback`. -/ abbrev braidedCategory (X : C) : BraidedCategory (Over X) := .ofCartesianMonoidalCategory @@ -50,154 +52,188 @@ open MonoidalCategory variable {X : C} +set_option backward.isDefEq.respectTransparency.types false in @[ext] lemma tensorObj_ext {R : C} {S T : Over X} (f₁ f₂ : R ⟶ (S ⊗ T).left) (e₁ : f₁ ≫ pullback.fst _ _ = f₂ ≫ pullback.fst _ _) (e₂ : f₁ ≫ pullback.snd _ _ = f₂ ≫ pullback.snd _ _) : f₁ = f₂ := pullback.hom_ext e₁ e₂ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensorObj_left (R S : Over X) : (R ⊗ S).left = Limits.pullback R.hom S.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensorObj_hom (R S : Over X) : (R ⊗ S).hom = pullback.fst R.hom S.hom ≫ R.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensorUnit_left : (𝟙_ (Over X)).left = X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensorUnit_hom : (𝟙_ (Over X)).hom = 𝟙 X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lift_left {R S T : Over X} (f : R ⟶ S) (g : R ⟶ T) : (lift f g).left = pullback.lift f.left g.left (f.w.trans g.w.symm) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma fst_left {R S : Over X} : (fst R S).left = pullback.fst _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma snd_left {R S : Over X} : (snd R S).left = pullback.snd _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toUnit_left {R : Over X} : (toUnit R).left = R.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma associator_hom_left_fst (R S T : Over X) : (α_ R S T).hom.left ≫ pullback.fst _ (pullback.fst _ _ ≫ _) = pullback.fst _ _ ≫ pullback.fst _ _ := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma associator_hom_left_snd_fst (R S T : Over X) : (α_ R S T).hom.left ≫ pullback.snd _ (pullback.fst _ _ ≫ _) ≫ pullback.fst _ _ = pullback.fst _ _ ≫ pullback.snd _ _ := (limit.lift_π_assoc _ _ _).trans (limit.lift_π _ _) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma associator_hom_left_snd_snd (R S T : Over X) : (α_ R S T).hom.left ≫ pullback.snd _ (pullback.fst _ _ ≫ _) ≫ pullback.snd _ _ = pullback.snd _ _ := (limit.lift_π_assoc _ _ _).trans (limit.lift_π _ _) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma associator_inv_left_fst_fst (R S T : Over X) : (α_ R S T).inv.left ≫ pullback.fst (pullback.fst _ _ ≫ _) _ ≫ pullback.fst _ _ = pullback.fst _ _ := (limit.lift_π_assoc _ _ _).trans (limit.lift_π _ _) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma associator_inv_left_fst_snd (R S T : Over X) : (α_ R S T).inv.left ≫ pullback.fst (pullback.fst _ _ ≫ _) _ ≫ pullback.snd _ _ = pullback.snd _ _ ≫ pullback.fst _ _ := (limit.lift_π_assoc _ _ _).trans (limit.lift_π _ _) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma associator_inv_left_snd (R S T : Over X) : (α_ R S T).inv.left ≫ pullback.snd (pullback.fst _ _ ≫ _) _ = pullback.snd _ _ ≫ pullback.snd _ _ := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma leftUnitor_hom_left (Y : Over X) : (λ_ Y).hom.left = pullback.snd _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma leftUnitor_inv_left_fst (Y : Over X) : (λ_ Y).inv.left ≫ pullback.fst (𝟙 X) _ = Y.hom := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma leftUnitor_inv_left_snd (Y : Over X) : (λ_ Y).inv.left ≫ pullback.snd (𝟙 X) _ = 𝟙 Y.left := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma rightUnitor_hom_left (Y : Over X) : (ρ_ Y).hom.left = pullback.fst _ (𝟙 X) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma rightUnitor_inv_left_fst (Y : Over X) : (ρ_ Y).inv.left ≫ pullback.fst _ (𝟙 X) = 𝟙 _ := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma rightUnitor_inv_left_snd (Y : Over X) : (ρ_ Y).inv.left ≫ pullback.snd _ (𝟙 X) = Y.hom := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma whiskerLeft_left {R S T : Over X} (f : S ⟶ T) : (R ◁ f).left = pullback.map _ _ _ _ (𝟙 _) f.left (𝟙 _) (by simp) (by simp) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma whiskerLeft_left_fst {R S T : Over X} (f : S ⟶ T) : (R ◁ f).left ≫ pullback.fst _ _ = pullback.fst _ _ := (limit.lift_π _ _).trans (Category.comp_id _) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma whiskerLeft_left_snd {R S T : Over X} (f : S ⟶ T) : (R ◁ f).left ≫ pullback.snd _ _ = pullback.snd _ _ ≫ f.left := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma whiskerRight_left {R S T : Over X} (f : S ⟶ T) : (f ▷ R).left = pullback.map _ _ _ _ f.left (𝟙 _) (𝟙 _) (by simp) (by simp) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma whiskerRight_left_fst {R S T : Over X} (f : S ⟶ T) : (f ▷ R).left ≫ pullback.fst _ _ = pullback.fst _ _ ≫ f.left := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma whiskerRight_left_snd {R S T : Over X} (f : S ⟶ T) : (f ▷ R).left ≫ pullback.snd _ _ = pullback.snd _ _ := (limit.lift_π _ _).trans (Category.comp_id _) +set_option backward.isDefEq.respectTransparency.types false in lemma tensorHom_left {R S T U : Over X} (f : R ⟶ S) (g : T ⟶ U) : (f ⊗ₘ g).left = pullback.map _ _ _ _ f.left g.left (𝟙 _) (by simp) (by simp) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma tensorHom_left_fst {S U : C} {R T : Over X} (fS : S ⟶ X) (fU : U ⟶ X) (f : R ⟶ mk fS) (g : T ⟶ mk fU) : (f ⊗ₘ g).left ≫ pullback.fst fS fU = pullback.fst R.hom T.hom ≫ f.left := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma tensorHom_left_snd {S U : C} {R T : Over X} (fS : S ⟶ X) (fU : U ⟶ X) (f : R ⟶ mk fS) (g : T ⟶ mk fU) : (f ⊗ₘ g).left ≫ pullback.snd fS fU = pullback.snd R.hom T.hom ≫ g.left := limit.lift_π _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma braiding_hom_left {R S : Over X} : (β_ R S).hom.left = (pullbackSymmetry _ _).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma braiding_inv_left {R S : Over X} : (β_ R S).inv.left = (pullbackSymmetry _ _).hom := rfl variable {A B R S Y Z : C} {f : R ⟶ X} {g : S ⟶ X} +set_option backward.isDefEq.respectTransparency.types false in instance : (Over.pullback f).Braided := .ofChosenFiniteProducts _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma η_pullback_left : (OplaxMonoidal.η (Over.pullback f)).left = (pullback.snd (𝟙 _) f) := rfl @@ -236,6 +272,7 @@ lemma μ_pullback_left_snd (R S : Over X) : ← Over.comp_left_assoc, Iso.hom_inv_id] simp [CartesianMonoidalCategory.prodComparison] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma μ_pullback_left_fst_fst' (g₁ : Y ⟶ X) (g₂ : Z ⟶ X) : (LaxMonoidal.μ (Over.pullback f) (.mk g₁) (.mk g₂)).left ≫ @@ -243,6 +280,7 @@ lemma μ_pullback_left_fst_fst' (g₁ : Y ⟶ X) (g₂ : Z ⟶ X) : pullback.fst _ _ ≫ pullback.fst _ _ := μ_pullback_left_fst_fst .. +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma μ_pullback_left_fst_snd' (g₁ : Y ⟶ X) (g₂ : Z ⟶ X) : (LaxMonoidal.μ (Over.pullback f) (.mk g₁) (.mk g₂)).left ≫ @@ -250,6 +288,7 @@ lemma μ_pullback_left_fst_snd' (g₁ : Y ⟶ X) (g₂ : Z ⟶ X) : pullback.snd _ _ ≫ pullback.fst _ _ := μ_pullback_left_fst_snd .. +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma μ_pullback_left_snd' (g₁ : Y ⟶ X) (g₂ : Z ⟶ X) : (LaxMonoidal.μ (Over.pullback f) (.mk g₁) (.mk g₂)).left ≫ @@ -274,6 +313,7 @@ lemma prodComparisonIso_pullback_inv_left_fst_fst (f : X ⟶ Y) (A B : Over Y) : Over.hom_left_inv_left_assoc] simp [CartesianMonoidalCategory.prodComparison, fst] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prodComparisonIso_pullback_Spec_inv_left_fst_fst' (f : X ⟶ Y) (gA : A ⟶ Y) (gB : B ⟶ Y) : (prodComparisonIso (Over.pullback f) (.mk gA) (.mk gB)).inv.left ≫ @@ -301,6 +341,7 @@ lemma prodComparisonIso_pullback_inv_left_snd' (f : X ⟶ Y) (gA : A ⟶ Y) (gB Over.hom_left_inv_left_assoc] simp [CartesianMonoidalCategory.prodComparison] +set_option backward.isDefEq.respectTransparency.types false in /-- The pullback of a monoid object is a monoid object. -/ @[simps! -isSimp mul one] abbrev monObjMkPullbackSnd [MonObj (Over.mk f)] : MonObj (Over.mk <| pullback.snd f g) := @@ -308,10 +349,12 @@ abbrev monObjMkPullbackSnd [MonObj (Over.mk f)] : MonObj (Over.mk <| pullback.sn attribute [local instance] monObjMkPullbackSnd +set_option backward.isDefEq.respectTransparency.types false in instance isCommMonObj_mk_pullbackSnd [MonObj (Over.mk f)] [IsCommMonObj (Over.mk f)] : IsCommMonObj (Over.mk <| pullback.snd f g) := ((Over.pullback g).mapCommMon.obj <| .mk <| .mk f).comm +set_option backward.isDefEq.respectTransparency.types false in /-- The pullback of a monoid object is a monoid object. -/ @[simps! -isSimp mul one] abbrev grpObjMkPullbackSnd [GrpObj (Over.mk f)] : GrpObj (Over.mk (pullback.snd f g)) := diff --git a/Mathlib/CategoryTheory/Monoidal/Category.lean b/Mathlib/CategoryTheory/Monoidal/Category.lean index 44a9f3526f26bb..907c763344ebb8 100644 --- a/Mathlib/CategoryTheory/Monoidal/Category.lean +++ b/Mathlib/CategoryTheory/Monoidal/Category.lean @@ -786,7 +786,7 @@ variable (C) attribute [local simp] whisker_exchange /-- The tensor product expressed as a functor. -/ -@[simps] +@[simps, implicit_reducible] def tensor : C × C ⥤ C where obj X := X.1 ⊗ X.2 map {X Y : C × C} (f : X ⟶ Y) := f.1 ⊗ₘ f.2 @@ -820,7 +820,7 @@ theorem rightAssocTensor_map {X Y} (f : X ⟶ Y) : rfl /-- The tensor product bifunctor `C ⥤ C ⥤ C` of a monoidal category. -/ -@[simps] +@[simps, implicit_reducible] def curriedTensor : C ⥤ C ⥤ C where obj X := { obj := fun Y => X ⊗ Y @@ -863,6 +863,7 @@ set_option backward.defeqAttrib.useBackward true in def rightUnitorNatIso : tensorUnitRight C ≅ 𝟭 C := NatIso.ofComponents MonoidalCategory.rightUnitor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The associator as a natural isomorphism between trifunctors `C ⥤ C ⥤ C ⥤ C`. -/ @[simps!] @@ -888,6 +889,7 @@ theorem tensorLeftTensor_hom_app (X Y Z : C) : (tensorLeftTensor X Y).hom.app Z = (associator X Y Z).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorLeftTensor_inv_app (X Y Z : C) : (tensorLeftTensor X Y).inv.app Z = (associator X Y Z).inv := by simp [tensorLeftTensor] @@ -933,6 +935,7 @@ theorem tensorRightTensor_hom_app (X Y Z : C) : (tensorRightTensor X Y).hom.app Z = (associator Z X Y).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorRightTensor_inv_app (X Y Z : C) : (tensorRightTensor X Y).inv.app Z = (associator Z X Y).hom := by simp [tensorRightTensor] @@ -997,6 +1000,7 @@ section ObjectProperty open ObjectProperty +set_option backward.isDefEq.respectTransparency.types false in /-- The restriction of a monoidal category along an object property that's closed under the monoidal structure. -/ -- See note [reducible non-instances] diff --git a/Mathlib/CategoryTheory/Monoidal/Center.lean b/Mathlib/CategoryTheory/Monoidal/Center.lean index 664b5d5387ad06..078d4078f4de0e 100644 --- a/Mathlib/CategoryTheory/Monoidal/Center.lean +++ b/Mathlib/CategoryTheory/Monoidal/Center.lean @@ -217,16 +217,19 @@ section def tensorUnit : Center C := ⟨𝟙_ C, { β := fun U => λ_ U ≪≫ (ρ_ U).symm }⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for the `MonoidalCategory` instance on `Center C`. -/ def associator (X Y Z : Center C) : tensorObj (tensorObj X Y) Z ≅ tensorObj X (tensorObj Y Z) := isoMk ⟨(α_ X.1 Y.1 Z.1).hom, fun U => by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for the `MonoidalCategory` instance on `Center C`. -/ def leftUnitor (X : Center C) : tensorObj tensorUnit X ≅ X := isoMk ⟨(λ_ X.1).hom, fun U => by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for the `MonoidalCategory` instance on `Center C`. -/ def rightUnitor (X : Center C) : tensorObj X tensorUnit ≅ X := @@ -242,6 +245,7 @@ attribute [local simp] Center.associator Center.leftUnitor Center.rightUnitor attribute [local simp] Center.whiskerLeft Center.whiskerRight Center.tensorHom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : MonoidalCategory (Center C) where tensorObj X Y := tensorObj X Y @@ -254,10 +258,12 @@ instance : MonoidalCategory (Center C) where leftUnitor := leftUnitor rightUnitor := rightUnitor +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensor_fst (X Y : Center C) : (X ⊗ Y).1 = X.1 ⊗ Y.1 := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensor_β (X Y : Center C) (U : C) : (X ⊗ Y).2.β U = @@ -266,44 +272,54 @@ theorem tensor_β (X Y : Center C) (U : C) : (whiskerRightIso (X.2.β U) Y.1) ≪≫ α_ _ _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem whiskerLeft_f (X : Center C) {Y₁ Y₂ : Center C} (f : Y₁ ⟶ Y₂) : (X ◁ f).f = X.1 ◁ f.f := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem whiskerRight_f {X₁ X₂ : Center C} (f : X₁ ⟶ X₂) (Y : Center C) : (f ▷ Y).f = f.f ▷ Y.1 := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensor_f {X₁ Y₁ X₂ Y₂ : Center C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) : (f ⊗ₘ g).f = f.f ⊗ₘ g.f := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorUnit_β (U : C) : (𝟙_ (Center C)).2.β U = λ_ U ≪≫ (ρ_ U).symm := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem associator_hom_f (X Y Z : Center C) : Hom.f (α_ X Y Z).hom = (α_ X.1 Y.1 Z.1).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem associator_inv_f (X Y Z : Center C) : Hom.f (α_ X Y Z).inv = (α_ X.1 Y.1 Z.1).inv := by apply Iso.inv_ext' -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): Originally `ext` rw [← associator_hom_f, ← comp_f, Iso.hom_inv_id]; rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem leftUnitor_hom_f (X : Center C) : Hom.f (λ_ X).hom = (λ_ X.1).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem leftUnitor_inv_f (X : Center C) : Hom.f (λ_ X).inv = (λ_ X.1).inv := by apply Iso.inv_ext' -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): Originally `ext` rw [← leftUnitor_hom_f, ← comp_f, Iso.hom_inv_id]; rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem rightUnitor_hom_f (X : Center C) : Hom.f (ρ_ X).hom = (ρ_ X.1).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem rightUnitor_inv_f (X : Center C) : Hom.f (ρ_ X).inv = (ρ_ X.1).inv := by apply Iso.inv_ext' -- Porting note (https://github.com/leanprover-community/mathlib4/issues/11041): Originally `ext` @@ -327,12 +343,16 @@ instance : (forget C).Monoidal := { εIso := Iso.refl _ μIso := fun _ _ ↦ Iso.refl _ } +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_ε : ε (forget C) = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_η : η (forget C) = 𝟙 _ := rfl variable {C} +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_μ (X Y : Center C) : μ (forget C) X Y = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma forget_δ (X Y : Center C) : δ (forget C) X Y = 𝟙 _ := rfl set_option backward.defeqAttrib.useBackward true in @@ -341,6 +361,7 @@ instance : (forget C).ReflectsIsomorphisms where end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for the `BraidedCategory` instance on `Center C`. -/ @[simps!] @@ -353,6 +374,7 @@ def braiding (X Y : Center C) : X ⊗ Y ≅ Y ⊗ X := ← HalfBraiding.naturality_assoc, HalfBraiding.monoidal] simp⟩ +set_option backward.isDefEq.respectTransparency.types false in instance braidedCategoryCenter : BraidedCategory (Center C) where braiding := braiding @@ -390,12 +412,16 @@ instance : (ofBraided C).Monoidal := { hom := { f := 𝟙 _ } inv := { f := 𝟙 _ } } } +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma ofBraided_ε_f : (ε (ofBraided C)).f = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma ofBraided_η_f : (η (ofBraided C)).f = 𝟙 _ := rfl variable {C} +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma ofBraided_μ_f (X Y : C) : (μ (ofBraided C) X Y).f = 𝟙 _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma ofBraided_δ_f (X Y : C) : (δ (ofBraided C) X Y).f = 𝟙 _ := rfl end diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Basic.lean index 8de3073bff264e..6a9d9a312cdf88 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Basic.lean @@ -53,7 +53,7 @@ variable {C : Type u} [Category.{v} C] [MonoidalCategory.{v} C] This isn't an instance because it's not usually how we want to construct internal homs, we'll usually prove all objects are closed uniformly. -/ -@[implicit_reducible] +@[instance_reducible] def tensorClosed {X Y : C} (hX : Closed X) (hY : Closed Y) : Closed (X ⊗ Y) where rightAdj := Closed.rightAdj X ⋙ Closed.rightAdj Y adj := (hY.adj.comp hX.adj).ofNatIsoLeft (MonoidalCategory.tensorLeftTensor X Y).symm @@ -62,7 +62,7 @@ def tensorClosed {X Y : C} (hX : Closed X) (hY : Closed Y) : Closed (X ⊗ Y) wh This isn't an instance because most of the time we'll prove closedness for all objects at once, rather than just for this one. -/ -@[implicit_reducible] +@[instance_reducible] def unitClosed : Closed (𝟙_ C) where rightAdj := 𝟭 C adj := Adjunction.id.ofNatIsoLeft (MonoidalCategory.leftUnitorNatIso C).symm @@ -201,6 +201,7 @@ theorem uncurry_injective : Function.Injective (uncurry : (Y ⟶ A ⟶[C] X) → variable (A X) +set_option backward.isDefEq.respectTransparency.types false in theorem uncurry_id_eq_ev : uncurry (𝟙 (A ⟶[C] X)) = (ihom.ev A).app X := by simp [uncurry_eq] @@ -210,7 +211,6 @@ theorem curry_id_eq_coev : curry (𝟙 _) = (ihom.coev A).app X := by apply comp_id set_option backward.defeqAttrib.useBackward true in -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma whiskerLeft_curry_ihom_ev_app (g : A ⊗ Y ⟶ X) : A ◁ curry g ≫ (ihom.ev A).app X = g := by @@ -308,7 +308,7 @@ variable (F : C ⥤ D) {G : D ⥤ C} (adj : F ⊣ G) [F.Monoidal] [F.IsEquivalence] [MonoidalClosed D] /-- Transport the property of being monoidal closed across a monoidal equivalence of categories -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofEquiv : MonoidalClosed C where closed X := { rightAdj := F ⋙ ihom (F.obj X) ⋙ G @@ -316,6 +316,7 @@ noncomputable def ofEquiv : MonoidalClosed C where adj.toEquivalence.symm.toAdjunction)).ofNatIsoLeft (Iso.compInverseIso (H := adj.toEquivalence) (Functor.Monoidal.commTensorLeft F X)) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Suppose we have a monoidal equivalence `F : C ≌ D`, with `D` monoidal closed. We can pull the monoidal closed instance back along the equivalence. For `X, Y, Z : C`, this lemma describes the @@ -337,6 +338,7 @@ theorem ofEquiv_curry_def {X Y Z : C} (f : X ⊗ Y ⟶ Z) : rw [Adjunction.comp_homEquiv, Adjunction.comp_homEquiv] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Suppose we have a monoidal equivalence `F : C ≌ D`, with `D` monoidal closed. We can pull the monoidal closed instance back along the equivalence. For `X, Y, Z : C`, this lemma describes the diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean index 02f96505e73e9e..971b4d5871e7ec 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean @@ -145,7 +145,7 @@ variable [CartesianMonoidalCategory D] Note we didn't require any coherence between the choice of finite products here, since we transport along the `prodComparison` isomorphism. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def cartesianClosedOfEquiv (e : C ≌ D) [MonoidalClosed C] : MonoidalClosed D := letI : e.inverse.Monoidal := .ofChosenFiniteProducts _ MonoidalClosed.ofEquiv e.inverse e.symm.toAdjunction diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Functor.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Functor.lean index c6366d48f9f306..5a85ae288418e7 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Functor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Functor.lean @@ -136,6 +136,7 @@ class MonoidalClosedFunctor : Prop where attribute [instance] MonoidalClosedFunctor.comparison_iso +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem frobeniusMorphism_mate (h : L ⊣ F) (A : C) : conjugateEquiv (h.comp (ihom.adjunction A)) ((ihom.adjunction (F.obj A)).comp h) diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Basic.lean index 239885c4c240b7..6f3c9a844bc5f9 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Basic.lean @@ -89,6 +89,7 @@ noncomputable def homEquiv : (F₁ ⊗ F₂ ⟶ F₃) ≃ (F₂ ⟶ functorEnric congr simp +set_option backward.isDefEq.respectTransparency.types false in lemma homEquiv_naturality_two_symm (f₂ : F₂ ⟶ F₂') (g : F₂' ⟶ functorEnrichedHom C F₁ F₃) : homEquiv.symm (f₂ ≫ g) = F₁ ◁ f₂ ≫ homEquiv.symm g := by dsimp [homEquiv] @@ -134,7 +135,7 @@ noncomputable def adj (F : J ⥤ C) : /-- When `C` is monoidal closed and has suitable limits, then for any `F : J ⥤ C`, `tensorLeft F` has a right adjoint. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def closed (F : J ⥤ C) : Closed F where rightAdj := (eHomFunctor _ _).obj ⟨F⟩ adj := adj F diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Complete.lean b/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Complete.lean index 31f5754c824cca..29d8214edef9f6 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Complete.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/FunctorCategory/Complete.lean @@ -68,7 +68,7 @@ instance (F : I ⥤ C) : IsLeftAdjoint (tensorLeft (incl I ⋙ F)) := set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Auxiliary definition for `functorCategoryMonoidalClosed` -/ -@[implicit_reducible] +@[instance_reducible] def functorCategoryClosed (F : I ⥤ C) : Closed F := have := (ihom.adjunction (incl I ⋙ F)).isLeftAdjoint have := isLeftAdjoint_square_lift_comonadic (tensorLeft F) ((whiskeringLeft _ _ C).obj (incl I)) @@ -83,7 +83,7 @@ monoidal closed category. Note: this is defined completely abstractly, and does not have any good definitional properties. See the TODO in the module docstring. -/ -@[implicit_reducible] +@[instance_reducible] def functorCategoryMonoidalClosed : MonoidalClosed (I ⥤ C) where closed F := functorCategoryClosed I C F diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean index 7d35e3362cc4b6..3315319f56b2a2 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean @@ -202,7 +202,7 @@ takes in an explicit choice of lift of the essential image of `i` to `D`, in the `l : i.EssImageSubcategory ⥤ D` and natural isomorphism `φ : l ⋙ i ≅ i.essImage.ι`. When `l ⋙ i` is defeq to `i.essImage.ι`, images of exponential objects in `D` under `i` will be defeq to the respective exponential objects in `C`. -/ -@[implicit_reducible] +@[instance_reducible] def cartesianClosedOfReflective' (l : i.EssImageSubcategory ⥤ D) (φ : l ⋙ i ≅ i.essImage.ι) : MonoidalClosed D where closed := fun B => @@ -229,7 +229,7 @@ Unlike `cartesianClosedOfReflective'` this construction lifts exponential object exponential objects in `D` by applying the reflector to them, even though they already lie in the essential image of `i`; if you need better control over definitional equality, use `cartesianClosedOfReflective'` instead. -/ -@[implicit_reducible] +@[instance_reducible] def cartesianClosedOfReflective : MonoidalClosed D := cartesianClosedOfReflective' i (i.essImage.ι ⋙ reflector i) (NatIso.ofComponents (fun X ↦ diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Types.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Types.lean index 4f67893fef4153..1e3a030a37164f 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Types.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Types.lean @@ -58,7 +58,7 @@ instance {C : Type v₁} [SmallCategory C] : MonoidalClosed (C ⥤ Type v₁) := attribute [local instance] uliftCategory in /-- This is not a good instance because of the universe levels. Below is the instance where the target category is `Type (max u₁ v₁)`. -/ -@[implicit_reducible] +@[instance_reducible] def cartesianClosedFunctorToTypes {C : Type u₁} [Category.{v₁} C] : MonoidalClosed (C ⥤ Type (max u₁ v₁ u₂)) := let e : (ULiftHom.{max u₁ v₁ u₂} (ULift.{max u₁ v₁ u₂} C)) ⥤ Type (max u₁ v₁ u₂) ≌ diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Zero.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Zero.lean index 360ccf0f4c1fe6..0f18cb59aba382 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Zero.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Zero.lean @@ -40,7 +40,7 @@ open scoped CartesianClosed /-- If a Cartesian closed category has an initial object which is isomorphic to the terminal object, then each homset has exactly one element. -/ -@[implicit_reducible] +@[instance_reducible] def uniqueHomsetOfInitialIsoUnit [HasInitial C] (i : ⊥_ C ≅ 𝟙_ C) (X Y : C) : Unique (X ⟶ Y) := Equiv.unique <| calc diff --git a/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean b/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean index e230ff0d1f5d7f..5770b9222e8a30 100644 --- a/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Monoidal/CommGrp_.lean @@ -215,6 +215,7 @@ protected instance Faithful.mapCommGrp [F.Faithful] : F.mapCommGrp.Faithful wher map_injective hfg := (CommGrp.forget _ ⋙ F).map_injective ((CommGrp.forget _).congr_map hfg) +set_option backward.isDefEq.respectTransparency.types false in /-- If `F : C ⥤ D` is a fully faithful monoidal functor, then `CommGrpCat(F) : CommGrpCat C ⥤ CommGrpCat D` is fully faithful too. -/ @[simps] @@ -257,6 +258,7 @@ set_option backward.isDefEq.respectTransparency false in def mapCommGrpCompIso : (F ⋙ G).mapCommGrp ≅ F.mapCommGrp ⋙ G.mapCommGrp := NatIso.ofComponents fun X ↦ CommGrp.mkIso (.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Natural transformations between functors lift to commutative group objects. -/ @[simps!] @@ -283,6 +285,7 @@ open Functor namespace Adjunction variable {F : C ⥤ D} {G : D ⥤ C} (a : F ⊣ G) [F.Braided] [G.Braided] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An adjunction of braided functors lifts to an adjunction of their lifts to commutative group objects. -/ diff --git a/Mathlib/CategoryTheory/Monoidal/CommMon_.lean b/Mathlib/CategoryTheory/Monoidal/CommMon_.lean index 4ae398fd5d8307..cd6aa88b53d9cd 100644 --- a/Mathlib/CategoryTheory/Monoidal/CommMon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/CommMon_.lean @@ -242,6 +242,7 @@ end LaxBraided section Braided variable [F.Braided] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F : C ⥤ D` is a fully faithful monoidal functor, then `CommMonCat(F) : CommMonCat C ⥤ CommMonCat D` is fully faithful too. -/ @@ -365,6 +366,7 @@ end EquivLaxBraidedFunctorPUnit open EquivLaxBraidedFunctorPUnit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Commutative monoid objects in `C` are "just" braided lax monoidal functors from the trivial braided monoidal category to `C`. diff --git a/Mathlib/CategoryTheory/Monoidal/Conv.lean b/Mathlib/CategoryTheory/Monoidal/Conv.lean index 4a3662c33bd208..0de8ea26455f6d 100644 --- a/Mathlib/CategoryTheory/Monoidal/Conv.lean +++ b/Mathlib/CategoryTheory/Monoidal/Conv.lean @@ -40,6 +40,7 @@ instance : Mul (Conv M N) where theorem mul_eq (f g : Conv M N) : f * g = Δ[M] ≫ f ▷ M ≫ N ◁ g ≫ μ[N] := rfl +set_option backward.isDefEq.respectTransparency.types false in instance : Monoid (Conv M N) where one_mul f := by simp [one_eq, mul_eq, ← whisker_exchange_assoc] mul_one f := by simp [one_eq, mul_eq, ← whisker_exchange_assoc] diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean index a1f3dfdb59c13e..aa314e9bcbeac4 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean @@ -121,7 +121,7 @@ lemma unit_naturality (f : x ⟶ x') (g : y ⟶ y') : set_option backward.defeqAttrib.useBackward true in variable (y) in -set_option backward.isDefEq.respectTransparency false in -- Needed in DayConvolution.lean +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma whiskerRight_comp_unit_app (f : x ⟶ x') : F.map f ▷ G.obj y ≫ (unit F G).app (x', y) = @@ -176,6 +176,7 @@ def corepresentableBy : homEquiv := Functor.homEquivOfIsLeftKanExtension _ (unit F G) _ homEquiv_comp := by aesop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Use the fact that `(F ⊛ G).obj c` is a colimit to characterize morphisms out of it at a point. -/ @@ -358,6 +359,7 @@ variable [∀ (v : V) (d : C × C), Limits.PreservesColimitsOfShape (CostructuredArrow ((tensor C).prod (𝟭 C)) d) (tensorRight v)] set_option backward.isDefEq.respectTransparency false in +set_option backward.defeqAttrib.useBackward true in lemma pentagon (H K : C ⥤ V) [DayConvolution G H] [DayConvolution (F ⊛ G) H] [DayConvolution F (G ⊛ H)] [DayConvolution H K] [DayConvolution G (H ⊛ K)] [DayConvolution (G ⊛ H) K] @@ -917,7 +919,7 @@ open DayConvolution DayConvolutionUnit in /-- We can promote a `LawfulDayConvolutionMonoidalCategoryStruct` to a monoidal category, note that every non-prop data is already here, so this is just about showing that they satisfy the axioms of a monoidal category. -/ -@[implicit_reducible] +@[instance_reducible] def monoidalOfLawfulDayConvolutionMonoidalCategoryStruct (D : Type u₃) [Category.{v₃} D] [MonoidalCategoryStruct D] @@ -1206,7 +1208,7 @@ lemma ι_map_tensorHom_eq {d₁ d₁' d₂ d₂' : D} (f : d₁ ⟶ d₂) (f' : set_option backward.isDefEq.respectTransparency false in /-- The monoidal category struct constructed in `DayConvolution.mkMonoidalCategoryStruct` extends to a `LawfulDayConvolutionMonoidalCategoryStruct`. -/ -@[implicit_reducible] +@[instance_reducible] def mkLawfulDayConvolutionMonoidalCategoryStruct : letI : MonoidalCategoryStruct D := mkMonoidalCategoryStruct C V D LawfulDayConvolutionMonoidalCategoryStruct C V D := @@ -1253,7 +1255,7 @@ variable {C V} in `ι.obj d` and `ι.obj d'` such that the convolution remains in the essential image of `ι`, construct an `InducedLawfulDayConvolutionMonoidalCategoryStructCore` by letting all other data be the generic ones from the `HasPointwiseLeftKanExtension` API. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofHasDayConvolutions {D : Type u₃} [Category.{v₃} D] (ι : D ⥤ C ⥤ V) @@ -1332,7 +1334,7 @@ variable {C V} of relevant colimits by the tensor product of `V`, we can define a `MonoidalCategory D` from the data of a fully faithful functor `ι : D ⥤ C ⥤ V` whose essential image contains a Day convolution unit and is stable under binary Day convolutions. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def monoidalOfHasDayConvolutions : MonoidalCategory D := letI induced : InducedLawfulDayConvolutionMonoidalCategoryStructCore C V D := .ofHasDayConvolutions ι ffι essImageDayConvolution essImageDayConvolutionUnit @@ -1344,7 +1346,7 @@ noncomputable def monoidalOfHasDayConvolutions : MonoidalCategory D := open InducedLawfulDayConvolutionMonoidalCategoryStructCore in /-- The monoidal category constructed via `monoidalOfHasDayConvolutions` has a canonical `LawfulDayConvolutionMonoidalCategoryStruct C V D`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def lawfulDayConvolutionMonoidalCategoryStructOfHasDayConvolutions : letI := monoidalOfHasDayConvolutions ι ffι essImageDayConvolution essImageDayConvolutionUnit diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean index 248f5c4c941e9e..69fe8ae2f7dcad 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution/DayFunctor.lean @@ -177,6 +177,7 @@ def isoPointwiseLeftKanExtension (F G : C ⊛⥤ V) : (F ⊗ G).functor (η F G) _ ((tensor C).pointwiseLeftKanExtensionUnit (F.functor ⊠ G.functor)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma η_comp_isoPointwiseLeftKanExtension_hom (F G : C ⊛⥤ V) (x y : C) : (η F G).app (x, y) ≫ (isoPointwiseLeftKanExtension F G).hom.app (x ⊗ y) = diff --git a/Mathlib/CategoryTheory/Monoidal/End.lean b/Mathlib/CategoryTheory/Monoidal/End.lean index 463706a399c184..4e8d8500a616bc 100644 --- a/Mathlib/CategoryTheory/Monoidal/End.lean +++ b/Mathlib/CategoryTheory/Monoidal/End.lean @@ -102,6 +102,7 @@ namespace MonoidalCategory variable [MonoidalCategory C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Tensoring on the right gives a monoidal functor from `C` into endofunctors of `C`. -/ @@ -111,15 +112,19 @@ instance : (tensoringRight C).Monoidal := μIso := fun X Y => (Functor.isoWhiskerRight (curriedAssociatorNatIso C) ((evaluation C (C ⥤ C)).obj X ⋙ (evaluation C C).obj Y)) } +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensoringRight_ε : ε (tensoringRight C) = (rightUnitorNatIso C).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensoringRight_η : η (tensoringRight C) = (rightUnitorNatIso C).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensoringRight_μ (X Y : C) (Z : C) : (μ (tensoringRight C) X Y).app Z = (α_ Z X Y).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensoringRight_δ (X Y : C) (Z : C) : (δ (tensoringRight C) X Y).app Z = (α_ Z X Y).inv := rfl diff --git a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean index 2acf8e046924da..6fda0cf555902f 100644 --- a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/Basic.lean @@ -26,15 +26,23 @@ open Functor variable (J₁ : Type u₁) (J₂ : Type u₂) (C : Type u₃) [Category.{v₁} J₁] [Category.{v₂} J₂] [Category.{v₃} C] [MonoidalCategory C] +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Functor.prod' + Monoidal.FunctorCategory.tensorObj + Prod.swap + diag + flipFunctor + /-- The (curried version of the) external product bifunctor: given diagrams `K₁ : J₁ ⥤ C` and `K₂ : J₂ ⥤ C`, this is the bifunctor `j₁ ↦ j₂ ↦ K₁ j₁ ⊗ K₂ j₂`. -/ -@[simps!] +@[simps!, implicit_reducible] def externalProductBifunctorCurried : (J₁ ⥤ C) ⥤ (J₂ ⥤ C) ⥤ J₁ ⥤ J₂ ⥤ C := (Functor.postcompose₂.obj <| (evaluation _ _).obj <| curriedTensor C).obj <| whiskeringLeft₂ C /-- The external product bifunctor: given diagrams `K₁ : J₁ ⥤ C` and `K₂ : J₂ ⥤ C`, this is the bifunctor `(j₁, j₂) ↦ K₁ j₁ ⊗ K₂ j₂`. -/ -@[simps!] +@[simps!, implicit_reducible] def externalProductBifunctor : ((J₁ ⥤ C) × (J₂ ⥤ C)) ⥤ J₁ × J₂ ⥤ C := uncurry.obj <| (Functor.postcompose₂.obj <| uncurry).obj <| externalProductBifunctorCurried J₁ J₂ C @@ -56,6 +64,7 @@ open scoped ExternalProduct variable (J₁ J₂ C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When both diagrams have the same source category, composing the external product with the diagonal gives the pointwise functor tensor product. @@ -69,6 +78,7 @@ def externalProductCompDiagIso : (fun _ ↦ NatIso.ofComponents (fun _ ↦ Iso.refl _) (by simp [tensorHom_def])) (fun _ ↦ by ext; simp [tensorHom_def]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When `C` is braided, there is an isomorphism `Prod.swap _ _ ⋙ F₁ ⊠ F₂ ≅ F₂ ⊠ F₁`, natural in both `F₁` and `F₂`. @@ -82,6 +92,7 @@ def externalProductSwap [BraidedCategory C] : (fun _ ↦ NatIso.ofComponents (fun _ ↦ β_ _ _) (by simp [whisker_exchange])) (fun _ ↦ by ext; simp [whisker_exchange]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A version of `externalProductSwap` phrased in terms of the curried functors. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean index a3e22d97ec9d8a..a8bcf0c9ae11e0 100644 --- a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean +++ b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean @@ -45,6 +45,7 @@ abbrev extensionUnitLeft : H ⊠ K ⟶ L.prod (𝟭 E) ⋙ H' ⊠ K := abbrev extensionUnitRight : K ⊠ H ⟶ (𝟭 E).prod L ⋙ K ⊠ H' := (externalProductBifunctor E D V).map (K.leftUnitor.inv ×ₘ α) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `H' : D' ⥤ V` is a pointwise left Kan extension along `L : D ⥤ D'` at `(d : D')` and if tensoring right with an object preserves colimits in `V`, @@ -92,6 +93,7 @@ def isPointwiseLeftKanExtensionExtensionUnitLeft Functor.LeftExtension.mk (H' ⊠ K) (extensionUnitLeft H' α K) |>.IsPointwiseLeftKanExtension := fun ⟨d, e⟩ ↦ isPointwiseLeftKanExtensionAtExtensionUnitLeft H' α K d (P d) e +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `H' : D' ⥤ V` is a pointwise left Kan extension along `L : D ⥤ D'` at `d : D'` and if tensoring left with an object preserves colimits in `V`, diff --git a/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean b/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean index 6df588af282423..3ba744572a3dfc 100644 --- a/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean +++ b/Mathlib/CategoryTheory/Monoidal/Free/Coherence.lean @@ -254,6 +254,7 @@ theorem normalizeObj_congr (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶ Y simp [congr_fun ih₁ n, congr_fun ih₂ (normalizeObj Y n)] | _ => funext; rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem normalize_naturality (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶ Y) : inclusionObj n ◁ f ≫ (normalizeIsoApp' C Y n).hom = @@ -291,6 +292,7 @@ def normalizeIso : tensorFunc C ≅ normalize' C := convert! normalize_naturality n f using 1 any_goals dsimp; rw [normalizeIsoApp_eq] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The isomorphism between an object and its normal form is natural. -/ def fullNormalizeIso : 𝟭 (F C) ≅ fullNormalize C ⋙ inclusion := diff --git a/Mathlib/CategoryTheory/Monoidal/Functor.lean b/Mathlib/CategoryTheory/Monoidal/Functor.lean index bcdd43d9738c65..f64bc6427afeea 100644 --- a/Mathlib/CategoryTheory/Monoidal/Functor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Functor.lean @@ -189,7 +189,7 @@ set_option backward.privateInPublic.warn false in A constructor for lax monoidal functors whose axioms are described by `tensorHom` instead of `whiskerLeft` and `whiskerRight`. -/ -@[implicit_reducible] +@[instance_reducible] def ofTensorHom : F.LaxMonoidal where ε := ε μ := μ @@ -659,7 +659,7 @@ def mk' (εIso : 𝟙_ D ≅ F.obj (𝟙_ C)) variable (h : F.CoreMonoidal) /-- The lax monoidal functor structure induced by a `Functor.CoreMonoidal` structure. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def toLaxMonoidal : F.LaxMonoidal where ε := h.εIso.hom μ X Y := (h.μIso X Y).hom @@ -667,7 +667,7 @@ def toLaxMonoidal : F.LaxMonoidal where right_unitality := h.right_unitality /-- The oplax monoidal functor structure induced by a `Functor.CoreMonoidal` structure. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def toOplaxMonoidal : F.OplaxMonoidal where η := h.εIso.inv δ X Y := (h.μIso X Y).inv @@ -690,7 +690,7 @@ def toOplaxMonoidal : F.OplaxMonoidal where attribute [local simp] toLaxMonoidal_ε toLaxMonoidal_μ toOplaxMonoidal_η toOplaxMonoidal_δ in /-- The monoidal functor structure induced by a `Functor.CoreMonoidal` structure. -/ -@[simps! toLaxMonoidal toOplaxMonoidal, implicit_reducible] +@[simps! toLaxMonoidal toOplaxMonoidal, instance_reducible] def toMonoidal : F.Monoidal where toLaxMonoidal := h.toLaxMonoidal toOplaxMonoidal := h.toOplaxMonoidal @@ -720,14 +720,14 @@ end CoreMonoidal /-- The `Functor.Monoidal` structure given by a lax monoidal functor such that `ε` and `μ` are isomorphisms. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Monoidal.ofLaxMonoidal [F.LaxMonoidal] [IsIso (ε F)] [∀ X Y, IsIso (μ F X Y)] := (CoreMonoidal.ofLaxMonoidal F).toMonoidal /-- The `Functor.Monoidal` structure given by an oplax monoidal functor such that `η` and `δ` are isomorphisms. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Monoidal.ofOplaxMonoidal [F.OplaxMonoidal] [IsIso (η F)] [∀ X Y, IsIso (δ F X Y)] := (CoreMonoidal.ofOplaxMonoidal F).toMonoidal @@ -803,21 +803,25 @@ variable [F.LaxMonoidal] [G.LaxMonoidal] instance LaxMonoidal.prod' : (prod' F G).LaxMonoidal := inferInstanceAs (diag C ⋙ prod F G).LaxMonoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_ε_fst : (ε (prod' F G)).1 = ε F := by change _ ≫ F.map (𝟙 _) = _ rw [Functor.map_id, Category.comp_id] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_ε_snd : (ε (prod' F G)).2 = ε G := by change _ ≫ G.map (𝟙 _) = _ rw [Functor.map_id, Category.comp_id] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_μ_fst (X Y : C) : (μ (prod' F G) X Y).1 = μ F X Y := by change _ ≫ F.map (𝟙 _) = _ rw [Functor.map_id, Category.comp_id] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_μ_snd (X Y : C) : (μ (prod' F G) X Y).2 = μ G X Y := by change _ ≫ G.map (𝟙 _) = _ rw [Functor.map_id, Category.comp_id] @@ -833,21 +837,25 @@ variable [F.OplaxMonoidal] [G.OplaxMonoidal] instance OplaxMonoidal.prod' : (prod' F G).OplaxMonoidal := inferInstanceAs (diag C ⋙ prod F G).OplaxMonoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_η_fst : (η (prod' F G)).1 = η F := by change F.map (𝟙 _) ≫ _ = _ rw [Functor.map_id, Category.id_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_η_snd : (η (prod' F G)).2 = η G := by change G.map (𝟙 _) ≫ _ = _ rw [Functor.map_id, Category.id_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_δ_fst (X Y : C) : (δ (prod' F G) X Y).1 = δ F X Y := by change F.map (𝟙 _) ≫ _ = _ rw [Functor.map_id, Category.id_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma prod'_δ_snd (X Y : C) : (δ (prod' F G) X Y).2 = δ G X Y := by change G.map (𝟙 _) ≫ _ = _ rw [Functor.map_id, Category.id_comp] @@ -904,7 +912,7 @@ variable [F.OplaxMonoidal] set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- The right adjoint of an oplax monoidal functor is lax monoidal. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def rightAdjointLaxMonoidal : G.LaxMonoidal where ε := adj.homEquiv _ _ (η F) μ X Y := adj.homEquiv _ _ (δ F _ _ ≫ (adj.counit.app X ⊗ₘ adj.counit.app Y)) @@ -1022,7 +1030,7 @@ variable [G.LaxMonoidal] set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- The left adjoint of a lax monoidal functor is oplax monoidal. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def leftAdjointOplaxMonoidal : F.OplaxMonoidal where η := (adj.homEquiv _ _).symm (ε G) δ X Y := (adj.homEquiv _ _).symm ((adj.unit.app X ⊗ₘ adj.unit.app Y) ≫ μ G _ _) @@ -1123,7 +1131,7 @@ instance [e.functor.Monoidal] : e.symm.inverse.Monoidal := inferInstanceAs (e.fu set_option backward.isDefEq.respectTransparency false in /-- If a monoidal functor `F` is an equivalence of categories then its inverse is also monoidal. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def inverseMonoidal [e.functor.Monoidal] : e.inverse.Monoidal := by letI := e.toAdjunction.rightAdjointLaxMonoidal have : IsIso (LaxMonoidal.ε e.inverse) := by @@ -1339,7 +1347,7 @@ def coreMonoidalTransport {F G : C ⥤ D} [F.Monoidal] (i : F ≅ G) : G.CoreMon /-- Transport the structure of a monoidal functor along a natural isomorphism of functors. -/ -@[implicit_reducible] +@[instance_reducible] def transport {F G : C ⥤ D} [F.Monoidal] (i : F ≅ G) : G.Monoidal := (coreMonoidalTransport i).toMonoidal @@ -1374,7 +1382,7 @@ variable {C D} Given a functor `F` and an equivalence of categories `e` such that `e.inverse` and `e.functor ⋙ F` are monoidal functors, `F` is monoidal as well. -/ -@[implicit_reducible] +@[instance_reducible] def monoidalOfPrecompFunctor (e : C ≌ D) (F : D ⥤ E) {F' : C ⥤ E} (i : e.functor ⋙ F ≅ F') [e.inverse.Monoidal] [F'.Monoidal] : F.Monoidal := letI : (e.functor ⋙ F).Monoidal := .transport i.symm @@ -1384,7 +1392,7 @@ def monoidalOfPrecompFunctor (e : C ≌ D) (F : D ⥤ E) {F' : C ⥤ E} (i : e.f Given a functor `F` and an equivalence of categories `e` such that `e.functor` and `e.inverse ⋙ F` are monoidal functors, `F` is monoidal as well. -/ -@[implicit_reducible] +@[instance_reducible] def monoidalOfPrecompInverse (e : C ≌ D) (F : C ⥤ E) {F' : D ⥤ E} (i : e.inverse ⋙ F ≅ F') [e.functor.Monoidal] [F'.Monoidal] : F.Monoidal := e.symm.monoidalOfPrecompFunctor F i @@ -1393,7 +1401,7 @@ def monoidalOfPrecompInverse (e : C ≌ D) (F : C ⥤ E) {F' : D ⥤ E} (i : e.i Given a functor `F` and an equivalence of categories `e` such that `e.functor` and `F ⋙ e.inverse` are monoidal functors, `F` is monoidal as well. -/ -@[implicit_reducible] +@[instance_reducible] def monoidalOfPostcompInverse (e : C ≌ D) (F : E ⥤ D) {F' : E ⥤ C} (i : F ⋙ e.inverse ≅ F') [e.functor.Monoidal] [F'.Monoidal] : F.Monoidal := .transport (Functor.isoWhiskerRight i.symm e.functor ≪≫ Functor.associator _ _ _ ≪≫ @@ -1403,7 +1411,7 @@ def monoidalOfPostcompInverse (e : C ≌ D) (F : E ⥤ D) {F' : E ⥤ C} (i : F Given a functor `F` and an equivalence of categories `e` such that `e.inverse` and `F ⋙ e.functor` are monoidal functors, `F` is monoidal as well. -/ -@[implicit_reducible] +@[instance_reducible] def monoidalOfPostcompFunctor (e : C ≌ D) (F : E ⥤ C) {F' : E ⥤ D} (i : F ⋙ e.functor ≅ F') [e.inverse.Monoidal] [F'.Monoidal] : F.Monoidal := e.symm.monoidalOfPostcompInverse _ i diff --git a/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean index c81166b9bba582..617ec161b7d189 100644 --- a/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/FunctorCategory.lean @@ -167,6 +167,7 @@ open CategoryTheory.BraidedCategory variable [BraidedCategory.{v₂} D] +set_option backward.isDefEq.respectTransparency.types false in /-- When `C` is any category, and `D` is a braided monoidal category, the natural pointwise monoidal structure on the functor category `C ⥤ D` is also braided. @@ -176,6 +177,7 @@ instance functorCategoryBraided : BraidedCategory (C ⥤ D) where hexagon_forward F G H := by ext X; apply hexagon_forward hexagon_reverse F G H := by ext X; apply hexagon_reverse +set_option backward.isDefEq.respectTransparency.types false in example : BraidedCategory (C ⥤ D) := CategoryTheory.Monoidal.functorCategoryBraided @@ -187,6 +189,7 @@ open CategoryTheory.SymmetricCategory variable [SymmetricCategory.{v₂} D] +set_option backward.isDefEq.respectTransparency.types false in /-- When `C` is any category, and `D` is a symmetric monoidal category, the natural pointwise monoidal structure on the functor category `C ⥤ D` is also symmetric. @@ -218,6 +221,7 @@ instance Functor.OplaxMonoidal.whiskeringRight oplax_left_unitality := by aesop oplax_right_unitality := by aesop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {C D E : Type*} [Category* C] [Category* D] [Category* E] [MonoidalCategory D] [MonoidalCategory E] (L : D ⥤ E) [L.Monoidal] : @@ -232,6 +236,7 @@ instance {C D E : Type*} [Category* C] [Category* D] [Category* E] [MonoidalCate @[deprecated (since := "2025-11-06")] alias η_app := Functor.OplaxMonoidal.whiskeringRight_η_app @[deprecated (since := "2025-11-06")] alias δ_app := Functor.OplaxMonoidal.whiskeringRight_δ_app +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps!] instance Functor.Monoidal.whiskeringLeft diff --git a/Mathlib/CategoryTheory/Monoidal/Grp.lean b/Mathlib/CategoryTheory/Monoidal/Grp.lean index b532109706244c..6cdcbb09064ee1 100644 --- a/Mathlib/CategoryTheory/Monoidal/Grp.lean +++ b/Mathlib/CategoryTheory/Monoidal/Grp.lean @@ -345,7 +345,7 @@ lemma ext {X : C} (h₁ h₂ : GrpObj X) (H : h₁.toMonObj = h₂.toMonObj) : h -- Note: `Invertible` has no additive variant /-- A monoid object with invertible homs is a group object. -/ -@[implicit_reducible] +@[instance_reducible] def ofInvertible (G : C) [MonObj G] (h : ∀ X (f : X ⟶ G), Invertible f) : GrpObj G where inv := Yoneda.fullyFaithful.preimage ⟨fun X ↦ ↾fun f ↦ (h X.unop f).invOf, fun X Y f ↦ by @@ -542,6 +542,7 @@ instance instMonoidalCategory : MonoidalCategory (Grp C) where tensorHom_def := by intros; ext; simp [tensorHom_def] triangle _ _ := by ext; exact triangle _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[to_additive] instance instCartesianMonoidalCategory : CartesianMonoidalCategory (Grp C) where @@ -573,6 +574,7 @@ instance : (forget₂Mon C).Monoidal where «η» := 𝟙 _ δ G H := 𝟙 _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] MonObj.tensorObj.mul_def mul_eq_mul comp_mul in @[to_additive] @@ -635,6 +637,7 @@ protected instance Faithful.mapGrp [F.Faithful] : F.mapGrp.Faithful where (Grp.forget₂Mon _).map_injective (F.mapMon.map_injective ((Grp.forget₂Mon _).congr_map hfg)) +set_option backward.isDefEq.respectTransparency.types false in /-- If `F : C ⥤ D` is a fully faithful monoidal functor, then `F.mapGrp : Grp C ⥤ Grp D` is fully faithful too. -/ @[to_additive /-- If `F : C ⥤ D` is a fully faithful monoidal functor, then @@ -642,6 +645,7 @@ protected instance Faithful.mapGrp [F.Faithful] : F.mapGrp.Faithful where protected def FullyFaithful.mapGrp (hF : F.FullyFaithful) : F.mapGrp.FullyFaithful where preimage f := Grp.homMk' (hF.mapMon.preimage f.hom) +set_option backward.isDefEq.respectTransparency.types false in @[to_additive] protected instance Full.mapGrp [F.Full] [F.Faithful] : F.mapGrp.Full := ((FullyFaithful.ofFullyFaithful F).mapGrp).full @@ -680,6 +684,7 @@ set_option backward.isDefEq.respectTransparency false in def mapGrpCompIso : (F ⋙ G).mapGrp ≅ F.mapGrp ⋙ G.mapGrp := NatIso.ofComponents fun X ↦ Grp.mkIso (.refl _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Natural transformations between functors lift to group objects. -/ @[to_additive (attr := simps!) @@ -687,6 +692,7 @@ set_option backward.defeqAttrib.useBackward true in def mapGrpNatTrans (f : F ⟶ F') : F.mapGrp ⟶ F'.mapGrp where app X := Grp.homMk' ((mapMonNatTrans f).app X.toMon) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Natural isomorphisms between functors lift to group objects. -/ @[to_additive (attr := simps!) @@ -694,6 +700,7 @@ set_option backward.defeqAttrib.useBackward true in def mapGrpNatIso (e : F ≅ F') : F.mapGrp ≅ F'.mapGrp := NatIso.ofComponents fun X ↦ Grp.mkIso (e.app _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local instance] Monoidal.ofChosenFiniteProducts in /-- `mapGrp` is functorial in the left-exact functor. -/ @@ -767,6 +774,7 @@ open Functor namespace Adjunction variable {F : C ⥤ D} {G : D ⥤ C} (a : F ⊣ G) [F.Monoidal] [G.Monoidal] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An adjunction of monoidal functors lifts to an adjunction of their lifts to group objects. -/ @[to_additive (attr := simps) @@ -781,6 +789,7 @@ end Adjunction namespace Equivalence variable (e : C ≌ D) [e.functor.Monoidal] [e.inverse.Monoidal] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories lifts to an equivalence of their group objects. -/ @[to_additive (attr := simps) diff --git a/Mathlib/CategoryTheory/Monoidal/Hopf_.lean b/Mathlib/CategoryTheory/Monoidal/Hopf_.lean index 90d793bd1f497f..f0d268a1ff1cf1 100644 --- a/Mathlib/CategoryTheory/Monoidal/Hopf_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Hopf_.lean @@ -82,6 +82,7 @@ namespace HopfObj variable {C} +set_option backward.isDefEq.respectTransparency.types false in /-- Morphisms of Hopf monoids intertwine the antipodes. -/ theorem hom_antipode {A B : C} [HopfObj A] [HopfObj B] (f : A ⟶ B) [IsBimonHom f] : f ≫ 𝒮 = 𝒮 ≫ f := by @@ -255,6 +256,7 @@ theorem antipode_comul₂ (A : C) [HopfObj A] : rw [rightUnitor_inv_naturality_assoc, tensorHom_def] monoidal +set_option backward.isDefEq.respectTransparency.types false in theorem antipode_comul (A : C) [HopfObj A] : 𝒮[A] ≫ Δ[A] = Δ[A] ≫ (β_ _ _).hom ≫ (𝒮[A] ⊗ₘ 𝒮[A]) := by -- Again, it is a "left inverse equals right inverse" argument in the convolution monoid. @@ -418,6 +420,7 @@ theorem mul_antipode₂ (A : C) [HopfObj A] : rw [rightUnitor_naturality] monoidal +set_option backward.isDefEq.respectTransparency.types false in theorem mul_antipode (A : C) [HopfObj A] : μ[A] ≫ 𝒮[A] = (𝒮[A] ⊗ₘ 𝒮[A]) ≫ (β_ _ _).hom ≫ μ[A] := by -- Again, it is a "left inverse equals right inverse" argument in the convolution monoid. @@ -440,6 +443,7 @@ theorem mul_antipode (A : C) [HopfObj A] : simp only [Category.assoc, pentagon_hom_inv_inv_inv_inv_assoc] exact mul_antipode₂ A +set_option backward.isDefEq.respectTransparency.types false in /-- In a commutative Hopf algebra, the antipode squares to the identity. -/ diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean index dd8986022e18a3..400fe22c77f8c9 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/FunctorCategory.lean @@ -46,8 +46,16 @@ namespace MonFunctorCategoryEquivalence variable {C D} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + FunctorCategory.tensorHom + FunctorCategory.tensorObj + Mon.comp + Mon.forget + NatTrans.vcomp + /-- A monoid object in a functor category sends any object to a monoid object. -/ -@[simps] +@[local implicit_reducible, simps] def functorObjObj (A : C ⥤ D) [MonObj A] (X : C) : Mon D where X := A.obj X mon := @@ -60,7 +68,7 @@ def functorObjObj (A : C ⥤ D) [MonObj A] (X : C) : Mon D where set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- A monoid object in a functor category induces a functor to the category of monoid objects. -/ -@[simps] +@[local implicit_reducible, simps] def functorObj (A : C ⥤ D) [MonObj A] : C ⥤ Mon D where obj := functorObjObj A map f := @@ -71,11 +79,12 @@ def functorObj (A : C ⥤ D) [MonObj A] : C ⥤ Mon D where map_id X := by ext; dsimp; rw [CategoryTheory.Functor.map_id] map_comp f g := by ext; dsimp; rw [Functor.map_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functor translating a monoid object in a functor category to a functor into the category of monoid objects. -/ -@[simps] +@[local implicit_reducible, simps] def functor : Mon (C ⥤ D) ⥤ C ⥤ Mon D where obj A := functorObj A.X map f := @@ -88,7 +97,7 @@ def functor : Mon (C ⥤ D) ⥤ C ⥤ Mon D where set_option backward.defeqAttrib.useBackward true in /-- A functor to the category of monoid objects can be translated as a monoid object in the functor category. -/ -@[simps] +@[local implicit_reducible, simps] def inverseObj (F : C ⥤ Mon D) : Mon (C ⥤ D) where X := F ⋙ Mon.forget D mon := @@ -99,13 +108,14 @@ set_option backward.defeqAttrib.useBackward true in /-- Functor translating a functor into the category of monoid objects to a monoid object in the functor category -/ -@[simps] +@[local implicit_reducible, simps] def inverse : (C ⥤ Mon D) ⥤ Mon (C ⥤ D) where obj := inverseObj map α := .mk' { app := fun X => (α.app X).hom naturality := fun _ _ f => congr_arg Mon.Hom.hom (α.naturality f) } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit for the equivalence `Mon (C ⥤ D) ≌ C ⥤ Mon D`. -/ @@ -127,6 +137,7 @@ end MonFunctorCategoryEquivalence open MonFunctorCategoryEquivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- When `D` is a monoidal category, monoid objects in `C ⥤ D` are the same thing @@ -170,6 +181,7 @@ def functorObj (A : (C ⥤ D)) [ComonObj A] : C ⥤ Comon D where map_id X := by ext; dsimp; rw [CategoryTheory.Functor.map_id] map_comp f g := by ext; dsimp; rw [Functor.map_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in set_option backward.privateInPublic true in /-- Functor translating a comonoid object in a functor category @@ -209,6 +221,7 @@ private def inverse : (C ⥤ Comon D) ⥤ Comon (C ⥤ D) where isComonHom_hom.hom_counit := by ext x; dsimp; rw [IsComonHom.hom_counit (α.app x).hom] isComonHom_hom.hom_comul := by ext x; dsimp; rw [IsComonHom.hom_comul (α.app x).hom] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in set_option backward.privateInPublic true in /-- The unit for the equivalence `Comon (C ⥤ D) ≌ C ⥤ Comon D`. @@ -234,6 +247,7 @@ end ComonFunctorCategoryEquivalence open ComonFunctorCategoryEquivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in @@ -254,6 +268,7 @@ namespace CommMonFunctorCategoryEquivalence variable {C D} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functor translating a commutative monoid object in a functor category to a functor into the category of commutative monoid objects. @@ -281,12 +296,14 @@ def inverse : (C ⥤ CommMon D) ⥤ CommMon (C ⥤ D) where map α := CommMon.homMk ((monFunctorCategoryEquivalence C D).inverse.map (Functor.whiskerRight α _)) +set_option backward.isDefEq.respectTransparency.types false in /-- The unit for the equivalence `CommMon (C ⥤ D) ≌ C ⥤ CommMon D`. -/ @[simps!] def unitIso : 𝟭 (CommMon (C ⥤ D)) ≅ functor ⋙ inverse := NatIso.ofComponents (fun A => CommMon.mkIso (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in /-- The counit for the equivalence `CommMon (C ⥤ D) ≌ C ⥤ CommMon D`. -/ @[simps!] @@ -297,6 +314,7 @@ end CommMonFunctorCategoryEquivalence open CommMonFunctorCategoryEquivalence +set_option backward.isDefEq.respectTransparency.types false in /-- When `D` is a braided monoidal category, commutative monoid objects in `C ⥤ D` are the same thing as functors from `C` into the commutative monoid objects of `D`. diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean index 9dc3052ee9af33..e010c5e1544de0 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Limits.lean @@ -70,6 +70,7 @@ def limitCone (F : J ⥤ Mon C) (c : Cone (F ⋙ Mon.forget C)) (hc : IsLimit c) π.app j := .mk' (c.π.app j) π.naturality j j' f := Hom.ext' (c.π.naturality f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The image of the proposed limit cone for `F : J ⥤ Mon C` under the forgetful functor `forget C : Mon C ⥤ C` is isomorphic to the limit cone of `F ⋙ forget C`. diff --git a/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean b/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean index 99fff9f427fd49..07c5bb599e70ba 100644 --- a/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean +++ b/Mathlib/CategoryTheory/Monoidal/Internal/Module.lean @@ -43,7 +43,7 @@ namespace MonModuleEquivalenceAlgebra /-- The ring structure on a monoid object. This instance is dangerous as it doesn't round trip from a ring to a monoid object and then back to a ring, since the `npow` field is lost in the middle. Therefore, it is scoped. -/ -@[implicit_reducible] +@[instance_reducible] def MonObj.toRing (A : ModuleCat.{u} R) [MonObj A] : Ring A := { (inferInstance : AddCommGroup A) with one := η[A] (1 : R) diff --git a/Mathlib/CategoryTheory/Monoidal/Limits/Colimits.lean b/Mathlib/CategoryTheory/Monoidal/Limits/Colimits.lean index 3324ebe6a1f8f0..b742cc966611e7 100644 --- a/Mathlib/CategoryTheory/Monoidal/Limits/Colimits.lean +++ b/Mathlib/CategoryTheory/Monoidal/Limits/Colimits.lean @@ -67,6 +67,7 @@ def Cocone.tensor : Cocone (F₁ ⊗ F₂) where pt := c₁.pt ⊗ c₂.pt ι.app j := c₁.ι.app j ⊗ₘ c₂.ι.app j +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in attribute [local simp] tensorHom_def in /-- The tensor product of colimit cocones for functors `F₁ : J ⥤ C` diff --git a/Mathlib/CategoryTheory/Monoidal/Mod.lean b/Mathlib/CategoryTheory/Monoidal/Mod.lean index c46da70fe15944..334d9d02083bc1 100644 --- a/Mathlib/CategoryTheory/Monoidal/Mod.lean +++ b/Mathlib/CategoryTheory/Monoidal/Mod.lean @@ -354,7 +354,7 @@ open MonoidalLeftAction in /-- When `M` is a `B`-module in `D` and `f : A ⟶ B` is a morphism of internal monoid objects, `M` inherits an `A`-module structure via "restriction of scalars", i.e `γ[A, M] = f ⊵ₗ M ≫ γ[B, M]`. -/ -@[to_additive (attr := simps!, implicit_reducible) +@[to_additive (attr := simps!, instance_reducible) /-- When `M` is a `B`-additive module in `D` and `f : A ⟶ B` is a morphism of internal additive monoid objects, `M` inherits an `A`-additive module structure via "restriction of scalars", i.e `δ[A, M] = f ⊵ₗ M ≫ δ[B, M]`. -/] diff --git a/Mathlib/CategoryTheory/Monoidal/Mon.lean b/Mathlib/CategoryTheory/Monoidal/Mon.lean index 511a06c6329210..836449e32a57d3 100644 --- a/Mathlib/CategoryTheory/Monoidal/Mon.lean +++ b/Mathlib/CategoryTheory/Monoidal/Mon.lean @@ -106,7 +106,7 @@ attribute [to_additive existing (attr := reassoc (attr := simp))] one_mul mul_on /-- Transfer `MonObj` along an isomorphism. -/ -- Note: The simps lemmas are not tagged simp because their `#discr_tree_simp_key` are too generic. -@[to_additive (attr := simps! -isSimp, implicit_reducible) +@[to_additive (attr := simps! -isSimp, instance_reducible) /-- Transfer `AddMonObj` along an isomorphism. -/] def ofIso (e : M ≅ X) : MonObj X where one := η[M] ≫ e.hom @@ -906,6 +906,7 @@ set_option backward.defeqAttrib.useBackward true in def mapMonNatTrans (f : F ⟶ F') [NatTrans.IsMonoidal f] : F.mapMon ⟶ F'.mapMon where app X := .mk' (f.app _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Natural isomorphisms between functors lift to monoid objects. -/ @[to_additive (attr := simps!) @@ -1073,6 +1074,7 @@ end Adjunction namespace Equivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories lifts to an equivalence of their monoid objects. -/ @[to_additive (attr := simps) @@ -1182,6 +1184,7 @@ open EquivLaxMonoidalFunctorPUnit attribute [local simp] eqToIso_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Monoid objects in `C` are "just" lax monoidal functors from the trivial monoidal category to `C`. diff --git a/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean b/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean index 1b3f4711c10904..3e723a3e20b7cf 100644 --- a/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Multifunctor.lean @@ -71,6 +71,7 @@ abbrev curriedTensorPostPost (F : C ⥤ D) : C ⥤ C ⥤ C ⥤ D := abbrev curriedTensorPostPost' (F : C ⥤ D) : C ⥤ C ⥤ C ⥤ D := bifunctorComp₂₃ (curriedTensorPost F) (curriedTensor C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural isomorphism of bifunctors `F - ⊗ F - ≅ F (- ⊗ -)`, given a monoidal functor `F`. -/ @[simps!] @@ -273,7 +274,7 @@ variable {F : C ⥤ D} `μ : F - ⊗ F - ⟶ F (- ⊗ -)` as a natural transformation between bifunctors, satisfying the relevant compatibilities. -/ -@[implicit_reducible] +@[instance_reducible] def ofBifunctor : F.LaxMonoidal where ε := ε μ X Y := (μ.app X).app Y @@ -460,7 +461,7 @@ variable {F : C ⥤ D} `δ : F (- ⊗ -) ⟶ F - ⊗ F -` as a natural transformation between bifunctors, satisfying the relevant compatibilities. -/ -@[implicit_reducible] +@[instance_reducible] def ofBifunctor : F.OplaxMonoidal where η := η δ X Y := (δ.app X).app Y @@ -507,7 +508,7 @@ variable {F : C ⥤ D} `μ / δ : F - ⊗ F - ↔ F (- ⊗ -)` as natural transformations between bifunctors, satisfying the relevant compatibilities. -/ -@[implicit_reducible] +@[instance_reducible] def ofBifunctor (ε_η : ε ≫ η = 𝟙 _) (η_ε : η ≫ ε = 𝟙 _) (μ_δ : μ ≫ δ = 𝟙 _) (δ_μ : δ ≫ μ = 𝟙 _) : F.Monoidal where toLaxMonoidal := .ofBifunctor ε μ associativity left_unitality right_unitality diff --git a/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean b/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean index db187334c5de14..70c74ca2c6e2c6 100644 --- a/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean +++ b/Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean @@ -132,7 +132,7 @@ open MonoidalCategory set_option backward.isDefEq.respectTransparency false in /-- The monoidal structure coming from finite coproducts is symmetric. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def symmetricOfHasFiniteCoproducts [HasInitial C] [HasBinaryCoproducts C] : SymmetricCategory C where braiding := Limits.coprod.braiding diff --git a/Mathlib/CategoryTheory/Monoidal/Opposite.lean b/Mathlib/CategoryTheory/Monoidal/Opposite.lean index 88d5cf98f15d49..c973ce89b6d870 100644 --- a/Mathlib/CategoryTheory/Monoidal/Opposite.lean +++ b/Mathlib/CategoryTheory/Monoidal/Opposite.lean @@ -240,6 +240,7 @@ theorem op_tensor_op {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) : f.op ⊗ₘ g.o theorem unop_tensor_unop {W X Y Z : Cᵒᵖ} (f : W ⟶ X) (g : Y ⟶ Z) : f.unop ⊗ₘ g.unop = (f ⊗ₘ g).unop := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance monoidalCategoryMop : MonoidalCategory Cᴹᵒᵖ where tensorObj X Y := mop (unmop Y ⊗ unmop X) @@ -261,58 +262,86 @@ instance monoidalCategoryMop : MonoidalCategory Cᴹᵒᵖ where -- it would be nice if we could autogenerate all of these somehow section MonoidalOppositeLemmas +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_tensorObj (X Y : C) : mop (X ⊗ Y) = mop Y ⊗ mop X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_tensorObj (X Y : Cᴹᵒᵖ) : unmop (X ⊗ Y) = unmop Y ⊗ unmop X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_tensorUnit : mop (𝟙_ C) = 𝟙_ Cᴹᵒᵖ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_tensorUnit : unmop (𝟙_ Cᴹᵒᵖ) = 𝟙_ C := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_tensorHom {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) : (f ⊗ₘ g).mop = g.mop ⊗ₘ f.mop := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_tensorHom {X₁ Y₁ X₂ Y₂ : Cᴹᵒᵖ} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) : (f ⊗ₘ g).unmop = g.unmop ⊗ₘ f.unmop := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_whiskerLeft (X : C) {Y Z : C} (f : Y ⟶ Z) : (X ◁ f).mop = f.mop ▷ mop X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_whiskerLeft (X : Cᴹᵒᵖ) {Y Z : Cᴹᵒᵖ} (f : Y ⟶ Z) : (X ◁ f).unmop = f.unmop ▷ unmop X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_whiskerRight {X Y : C} (f : X ⟶ Y) (Z : C) : (f ▷ Z).mop = mop Z ◁ f.mop := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_whiskerRight {X Y : Cᴹᵒᵖ} (f : X ⟶ Y) (Z : Cᴹᵒᵖ) : (f ▷ Z).unmop = unmop Z ◁ f.unmop := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_associator (X Y Z : C) : (α_ X Y Z).mop = (α_ (mop Z) (mop Y) (mop X)).symm := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_associator (X Y Z : Cᴹᵒᵖ) : (α_ X Y Z).unmop = (α_ (unmop Z) (unmop Y) (unmop X)).symm := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_hom_associator (X Y Z : C) : (α_ X Y Z).hom.mop = (α_ (mop Z) (mop Y) (mop X)).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_hom_associator (X Y Z : Cᴹᵒᵖ) : (α_ X Y Z).hom.unmop = (α_ (unmop Z) (unmop Y) (unmop X)).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_inv_associator (X Y Z : C) : (α_ X Y Z).inv.mop = (α_ (mop Z) (mop Y) (mop X)).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_inv_associator (X Y Z : Cᴹᵒᵖ) : (α_ X Y Z).inv.unmop = (α_ (unmop Z) (unmop Y) (unmop X)).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_leftUnitor (X : C) : (λ_ X).mop = (ρ_ (mop X)) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_leftUnitor (X : Cᴹᵒᵖ) : (λ_ X).unmop = ρ_ (unmop X) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_hom_leftUnitor (X : C) : (λ_ X).hom.mop = (ρ_ (mop X)).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_hom_leftUnitor (X : Cᴹᵒᵖ) : (λ_ X).hom.unmop = (ρ_ (unmop X)).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_inv_leftUnitor (X : C) : (λ_ X).inv.mop = (ρ_ (mop X)).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_inv_leftUnitor (X : Cᴹᵒᵖ) : (λ_ X).inv.unmop = (ρ_ (unmop X)).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_rightUnitor (X : C) : (ρ_ X).mop = (λ_ (mop X)) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_rightUnitor (X : Cᴹᵒᵖ) : (ρ_ X).unmop = λ_ (unmop X) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_hom_rightUnitor (X : C) : (ρ_ X).hom.mop = (λ_ (mop X)).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_hom_rightUnitor (X : Cᴹᵒᵖ) : (ρ_ X).hom.unmop = (λ_ (unmop X)).hom := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mop_inv_rightUnitor (X : C) : (ρ_ X).inv.mop = (λ_ (mop X)).inv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma unmop_inv_rightUnitor (X : Cᴹᵒᵖ) : (ρ_ X).inv.unmop = (λ_ (unmop X)).inv := rfl end MonoidalOppositeLemmas @@ -335,6 +364,7 @@ set_option linter.style.whitespace false in -- manual alignment is not recognise @[simps!] def MonoidalOpposite.mopMopEquivalence : Cᴹᵒᵖᴹᵒᵖ ≌ C := .trans (MonoidalOpposite.unmopEquiv Cᴹᵒᵖ) (MonoidalOpposite.unmopEquiv C) +set_option backward.isDefEq.respectTransparency.types false in @[simps!] instance MonoidalOpposite.mopMopEquivalenceFunctorMonoidal : (MonoidalOpposite.mopMopEquivalence C).functor.Monoidal where @@ -360,12 +390,14 @@ instance MonoidalOpposite.mopMopEquivalenceInverseMonoidal : μ_δ X Y := Category.comp_id _ δ_μ X Y := Category.comp_id _ +set_option backward.isDefEq.respectTransparency.types false in instance : (mopMopEquivalence C).IsMonoidal where leftAdjoint_ε := by simp [ε, η, mopMopEquivalence, Equivalence.trans, unmopEquiv, ε] leftAdjoint_μ X Y := by simp [μ, δ, mopMopEquivalence, Equivalence.trans, unmopEquiv, μ] +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `mop X ⊗ mop Y = mop (Y ⊗ X)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorIso : @@ -375,36 +407,42 @@ def MonoidalOpposite.tensorIso : variable {C} +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `X ⊗ - = mop (- ⊗ unmop X)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorLeftIso (X : Cᴹᵒᵖ) : tensorLeft X ≅ unmopFunctor C ⋙ tensorRight (unmop X) ⋙ mopFunctor C := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `mop X ⊗ - = mop (- ⊗ X)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorLeftMopIso (X : C) : tensorLeft (mop X) ≅ unmopFunctor C ⋙ tensorRight X ⋙ mopFunctor C := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `unmop X ⊗ - = unmop (mop - ⊗ X)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorLeftUnmopIso (X : Cᴹᵒᵖ) : tensorLeft (unmop X) ≅ mopFunctor C ⋙ tensorRight X ⋙ unmopFunctor C := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `- ⊗ X = mop (unmop X ⊗ -)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorRightIso (X : Cᴹᵒᵖ) : tensorRight X ≅ unmopFunctor C ⋙ tensorLeft (unmop X) ⋙ mopFunctor C := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `- ⊗ mop X = mop (- ⊗ unmop X)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorRightMopIso (X : C) : tensorRight (mop X) ≅ unmopFunctor C ⋙ tensorLeft X ⋙ mopFunctor C := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The identification `- ⊗ unmop X = unmop (X ⊗ mop -)` as a natural isomorphism. -/ @[simps!] def MonoidalOpposite.tensorRightUnmopIso (X : Cᴹᵒᵖ) : @@ -436,6 +474,7 @@ instance monoidalUnopUnop : (unopUnop C).Monoidal where instance : (opOpEquivalence C).functor.Monoidal := monoidalUnopUnop instance : (opOpEquivalence C).inverse.Monoidal := monoidalOpOp +set_option backward.isDefEq.respectTransparency.types false in instance : (opOpEquivalence C).IsMonoidal where leftAdjoint_ε := by simp [opOpEquivalence] leftAdjoint_μ := by simp [opOpEquivalence] diff --git a/Mathlib/CategoryTheory/Monoidal/Opposite/Mon.lean b/Mathlib/CategoryTheory/Monoidal/Opposite/Mon.lean index 1d7abf4c324fbe..337f37627e5503 100644 --- a/Mathlib/CategoryTheory/Monoidal/Opposite/Mon.lean +++ b/Mathlib/CategoryTheory/Monoidal/Opposite/Mon.lean @@ -89,6 +89,7 @@ instance unmop_isMonHom {N : Cᴹᵒᵖ} [MonObj N] end unmop +set_option backward.isDefEq.respectTransparency.types false in variable (C) in /-- The equivalence of categories between monoids internal to `C` and monoids internal to the monoidal opposite of `C`. -/ @@ -103,6 +104,7 @@ def mopEquiv : Mon C ≌ Mon Cᴹᵒᵖ where unitIso := .refl _ counitIso := .refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The equivalence of categories between monoids internal to `C` and monoids internal to the monoidal opposite of `C` lies over the equivalence `C ≌ Cᴹᵒᵖ` via the forgetful functors. -/ diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean index 06ca90b22a06e3..ed53d71d7b9fc0 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean @@ -316,22 +316,26 @@ def tensorRightHomEquiv (X Y Y' Z : C) [ExactPairing Y Y'] : (X ⊗ Y ⟶ Z) ≃ _ = f := by rw [coevaluation_evaluation'']; monoidal +set_option backward.isDefEq.respectTransparency.types false in theorem tensorLeftHomEquiv_naturality {X Y Y' Z Z' : C} [ExactPairing Y Y'] (f : Y' ⊗ X ⟶ Z) (g : Z ⟶ Z') : (tensorLeftHomEquiv X Y Y' Z') (f ≫ g) = (tensorLeftHomEquiv X Y Y' Z) f ≫ Y ◁ g := by simp [tensorLeftHomEquiv] +set_option backward.isDefEq.respectTransparency.types false in theorem tensorLeftHomEquiv_symm_naturality {X X' Y Y' Z : C} [ExactPairing Y Y'] (f : X ⟶ X') (g : X' ⟶ Y ⊗ Z) : (tensorLeftHomEquiv X Y Y' Z).symm (f ≫ g) = _ ◁ f ≫ (tensorLeftHomEquiv X' Y Y' Z).symm g := by simp [tensorLeftHomEquiv] +set_option backward.isDefEq.respectTransparency.types false in theorem tensorRightHomEquiv_naturality {X Y Y' Z Z' : C} [ExactPairing Y Y'] (f : X ⊗ Y ⟶ Z) (g : Z ⟶ Z') : (tensorRightHomEquiv X Y Y' Z') (f ≫ g) = (tensorRightHomEquiv X Y Y' Z) f ≫ g ▷ Y' := by simp [tensorRightHomEquiv] +set_option backward.isDefEq.respectTransparency.types false in theorem tensorRightHomEquiv_symm_naturality {X X' Y Y' Z : C} [ExactPairing Y Y'] (f : X ⟶ X') (g : X' ⟶ Z ⊗ Y') : (tensorRightHomEquiv X Y Y' Z).symm (f ≫ g) = @@ -367,11 +371,12 @@ structure shouldn't come from `HasLeftDual` (e.g. in the category `FinVect k`, i convenient to define the internal hom as `Y →ₗ[k] X` rather than `ᘁY ⊗ X` even though these are naturally isomorphic). -/ -@[implicit_reducible] +@[instance_reducible] def closedOfHasLeftDual (Y : C) [HasLeftDual Y] : Closed Y where rightAdj := tensorLeft (ᘁY) adj := tensorLeftAdjunction (ᘁY) Y +set_option backward.isDefEq.respectTransparency.types false in /-- `tensorLeftHomEquiv` commutes with tensoring on the right -/ theorem tensorLeftHomEquiv_tensor {X X' Y Y' Z Z' : C} [ExactPairing Y Y'] (f : X ⟶ Y ⊗ Z) (g : X' ⟶ Z') : @@ -379,6 +384,7 @@ theorem tensorLeftHomEquiv_tensor {X X' Y Y' Z Z' : C} [ExactPairing Y Y'] (f : (α_ _ _ _).inv ≫ ((tensorLeftHomEquiv X Y Y' Z).symm f ⊗ₘ g) := by simp [tensorLeftHomEquiv, tensorHom_def'] +set_option backward.isDefEq.respectTransparency.types false in /-- `tensorRightHomEquiv` commutes with tensoring on the left -/ theorem tensorRightHomEquiv_tensor {X X' Y Y' Z Z' : C} [ExactPairing Y Y'] (f : X ⟶ Z ⊗ Y') (g : X' ⟶ Z') : @@ -386,6 +392,7 @@ theorem tensorRightHomEquiv_tensor {X X' Y Y' Z Z' : C} [ExactPairing Y Y'] (f : (α_ _ _ _).hom ≫ (g ⊗ₘ (tensorRightHomEquiv X Y Y' Z).symm f) := by simp [tensorRightHomEquiv, tensorHom_def] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorLeftHomEquiv_symm_coevaluation_comp_whiskerLeft {Y Y' Z : C} [ExactPairing Y Y'] (f : Y' ⟶ Z) : (tensorLeftHomEquiv _ _ _ _).symm (η_ _ _ ≫ Y ◁ f) = (ρ_ _).hom ≫ f := by @@ -396,6 +403,7 @@ theorem tensorLeftHomEquiv_symm_coevaluation_comp_whiskerLeft {Y Y' Z : C} [Exac rw [whisker_exchange]; monoidal _ = _ := by rw [coevaluation_evaluation'']; monoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorLeftHomEquiv_symm_coevaluation_comp_whiskerRight {X Y : C} [HasRightDual X] [HasRightDual Y] (f : X ⟶ Y) : @@ -403,6 +411,7 @@ theorem tensorLeftHomEquiv_symm_coevaluation_comp_whiskerRight {X Y : C} [HasRig dsimp [tensorLeftHomEquiv, rightAdjointMate] simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorRightHomEquiv_symm_coevaluation_comp_whiskerLeft {X Y : C} [HasLeftDual X] [HasLeftDual Y] (f : X ⟶ Y) : @@ -410,6 +419,7 @@ theorem tensorRightHomEquiv_symm_coevaluation_comp_whiskerLeft {X Y : C} [HasLef dsimp [tensorRightHomEquiv, leftAdjointMate] simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorRightHomEquiv_symm_coevaluation_comp_whiskerRight {Y Y' Z : C} [ExactPairing Y Y'] (f : Y ⟶ Z) : (tensorRightHomEquiv _ Y _ _).symm (η_ Y Y' ≫ f ▷ Y') = (λ_ _).hom ≫ f := @@ -421,6 +431,7 @@ theorem tensorRightHomEquiv_symm_coevaluation_comp_whiskerRight {Y Y' Z : C} [Ex _ = _ := by rw [evaluation_coevaluation'']; monoidal +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorLeftHomEquiv_whiskerLeft_comp_evaluation {Y Z : C} [HasLeftDual Z] (f : Y ⟶ ᘁZ) : (tensorLeftHomEquiv _ _ _ _) (Z ◁ f ≫ ε_ _ _) = f ≫ (ρ_ _).inv := @@ -444,6 +455,7 @@ theorem tensorRightHomEquiv_whiskerLeft_comp_evaluation {X Y : C} [HasRightDual dsimp [tensorRightHomEquiv, rightAdjointMate] simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorRightHomEquiv_whiskerRight_comp_evaluation {X Y : C} [HasRightDual X] (f : Y ⟶ Xᘁ) : (tensorRightHomEquiv _ _ _ _) (f ▷ X ≫ ε_ X (Xᘁ)) = f ≫ (λ_ _).inv := @@ -481,7 +493,7 @@ theorem rightAdjointMate_comp_evaluation {X Y : C} [HasRightDual X] [HasRightDua simp /-- Transport an exact pairing across an isomorphism in the first argument. -/ -@[implicit_reducible] +@[instance_reducible] def exactPairingCongrLeft {X X' Y : C} [ExactPairing X' Y] (i : X ≅ X') : ExactPairing X Y where evaluation' := Y ◁ i.hom ≫ ε_ _ _ coevaluation' := η_ _ _ ≫ i.inv ▷ Y @@ -510,7 +522,7 @@ def exactPairingCongrLeft {X X' Y : C} [ExactPairing X' Y] (i : X ≅ X') : Exac simp /-- Transport an exact pairing across an isomorphism in the second argument. -/ -@[implicit_reducible] +@[instance_reducible] def exactPairingCongrRight {X Y Y' : C} [ExactPairing X Y'] (i : Y ≅ Y') : ExactPairing X Y where evaluation' := i.hom ▷ X ≫ ε_ _ _ coevaluation' := η_ _ _ ≫ X ◁ i.inv @@ -539,7 +551,7 @@ def exactPairingCongrRight {X Y Y' : C} [ExactPairing X Y'] (i : Y ≅ Y') : Exa monoidal /-- Transport an exact pairing across isomorphisms. -/ -@[implicit_reducible] +@[instance_reducible] def exactPairingCongr {X X' Y Y' : C} [ExactPairing X' Y'] (i : X ≅ X') (j : Y ≅ Y') : ExactPairing X Y := haveI : ExactPairing X' Y := exactPairingCongrRight j @@ -598,7 +610,7 @@ often a more useful definition of the internal hom object than `ᘁY ⊗ X`, in closed structure shouldn't come the rigid structure (e.g. in the category `FinVect k`, it is more convenient to define the internal hom as `Y →ₗ[k] X` rather than `ᘁY ⊗ X` even though these are naturally isomorphic). -/ -@[implicit_reducible] +@[instance_reducible] def monoidalClosedOfLeftRigidCategory (C : Type u) [Category.{v} C] [MonoidalCategory.{v} C] [LeftRigidCategory C] : MonoidalClosed C where closed X := closedOfHasLeftDual X diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean index 8631273bd73480..88bc6e2f1e289e 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/Braided.lean @@ -77,7 +77,7 @@ set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- If `X` and `Y` forms an exact pairing in a braided category, then so does `Y` and `X` by composing the coevaluation and evaluation morphisms with associators. -/ -@[implicit_reducible] +@[instance_reducible] def exactPairing_swap (X Y : C) [ExactPairing X Y] : ExactPairing Y X where coevaluation' := η_ X Y ≫ (β_ Y X).inv evaluation' := (β_ X Y).hom ≫ ε_ X Y @@ -85,39 +85,39 @@ def exactPairing_swap (X Y : C) [ExactPairing X Y] : ExactPairing Y X where evaluation_coevaluation' := evaluation_coevaluation_braided' /-- If `X` has a right dual in a braided category, then it has a left dual. -/ -@[implicit_reducible] +@[instance_reducible] def hasLeftDualOfHasRightDual [HasRightDual X] : HasLeftDual X where leftDual := Xᘁ exact := exactPairing_swap X Xᘁ /-- If `X` has a left dual in a braided category, then it has a right dual. -/ -@[implicit_reducible] +@[instance_reducible] def hasRightDualOfHasLeftDual [HasLeftDual X] : HasRightDual X where rightDual := ᘁX exact := exactPairing_swap ᘁX X /-- If a braided category is right-rigid, then it is left-rigid. Not registered as an instance as this is not canonical enough. -/ -@[implicit_reducible] +@[instance_reducible] def leftRigidCategoryOfRightRigidCategory [RightRigidCategory C] : LeftRigidCategory C where leftDual X := hasLeftDualOfHasRightDual (X := X) /-- If a braided category is left-rigid, then it is right-rigid. Not registered as an instance as this is not canonical enough. -/ -@[implicit_reducible] +@[instance_reducible] def rightRigidCategoryOfLeftRigidCategory [LeftRigidCategory C] : RightRigidCategory C where rightDual X := hasRightDualOfHasLeftDual (X := X) /-- If `C` is a braided and right rigid category, then it is a rigid category. Not registered as an instance as this is not canonical enough. -/ -@[implicit_reducible] +@[instance_reducible] def rigidCategoryOfRightRigidCategory [RightRigidCategory C] : RigidCategory C where rightDual := inferInstance leftDual X := hasLeftDualOfHasRightDual (X := X) /-- If `C` is a braided and left rigid category, then it is a rigid category. Not registered as an instance as this is not canonical enough. -/ -@[implicit_reducible] +@[instance_reducible] def rigidCategoryOfLeftRigidCategory [LeftRigidCategory C] : RigidCategory C where rightDual X := hasRightDualOfHasLeftDual (X := X) leftDual := inferInstance diff --git a/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean b/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean index 9c528fb2adaefa..d7eadc75a0e32d 100644 --- a/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean +++ b/Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean @@ -24,7 +24,7 @@ variable {C D : Type*} [Category* C] [Category* D] [MonoidalCategory C] [Monoida /-- Given candidate data for an exact pairing, which is sent by a faithful monoidal functor to an exact pairing, the equations holds automatically. -/ -@[implicit_reducible] +@[instance_reducible] def ExactPairing.ofFaithful [F.Faithful] {X Y : C} (eval : Y ⊗ X ⟶ 𝟙_ C) (coeval : 𝟙_ C ⟶ X ⊗ Y) [ExactPairing (F.obj X) (F.obj Y)] (map_eval : F.map eval = (δ F _ _) ≫ ε_ _ _ ≫ ε F) @@ -43,7 +43,7 @@ def ExactPairing.ofFaithful [F.Faithful] {X Y : C} (eval : Y ⊗ X ⟶ 𝟙_ C) /-- Given a pair of objects which are sent by a fully faithful functor to a pair of objects with an exact pairing, we get an exact pairing. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ExactPairing.ofFullyFaithful [F.Full] [F.Faithful] (X Y : C) [ExactPairing (F.obj X) (F.obj Y)] : ExactPairing X Y := .ofFaithful F (F.preimage (δ F _ _ ≫ ε_ _ _ ≫ (ε F))) @@ -55,7 +55,7 @@ variable {G : D ⥤ C} (adj : F ⊣ G) [F.IsEquivalence] noncomputable section /-- Pull back a left dual along an equivalence. -/ -@[implicit_reducible] +@[instance_reducible] def hasLeftDualOfEquivalence (X : C) [HasLeftDual (F.obj X)] : HasLeftDual X where leftDual := G.obj (ᘁ(F.obj X)) @@ -65,7 +65,7 @@ def hasLeftDualOfEquivalence (X : C) [HasLeftDual (F.obj X)] : apply ExactPairing.ofFullyFaithful F /-- Pull back a right dual along an equivalence. -/ -@[implicit_reducible] +@[instance_reducible] def hasRightDualOfEquivalence (X : C) [HasRightDual (F.obj X)] : HasRightDual X where rightDual := G.obj ((F.obj X)ᘁ) @@ -75,17 +75,17 @@ def hasRightDualOfEquivalence (X : C) [HasRightDual (F.obj X)] : apply ExactPairing.ofFullyFaithful F /-- Pull back a left rigid structure along an equivalence. -/ -@[implicit_reducible] +@[instance_reducible] def leftRigidCategoryOfEquivalence [LeftRigidCategory D] : LeftRigidCategory C where leftDual X := hasLeftDualOfEquivalence adj X /-- Pull back a right rigid structure along an equivalence. -/ -@[implicit_reducible] +@[instance_reducible] def rightRigidCategoryOfEquivalence [RightRigidCategory D] : RightRigidCategory C where rightDual X := hasRightDualOfEquivalence adj X /-- Pull back a rigid structure along an equivalence. -/ -@[implicit_reducible] +@[instance_reducible] def rigidCategoryOfEquivalence [RigidCategory D] : RigidCategory C where leftDual X := hasLeftDualOfEquivalence adj X rightDual X := hasRightDualOfEquivalence adj X diff --git a/Mathlib/CategoryTheory/Monoidal/Subcategory.lean b/Mathlib/CategoryTheory/Monoidal/Subcategory.lean index 74e6a94d9d27b3..9ccd1130415c47 100644 --- a/Mathlib/CategoryTheory/Monoidal/Subcategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Subcategory.lean @@ -128,6 +128,7 @@ section variable {P} {P' : ObjectProperty C} [P'.IsMonoidal] (h : P ≤ P') +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An inequality `P ≤ P'` between monoidal properties of objects induces a monoidal functor between full monoidal subcategories. -/ @@ -159,6 +160,7 @@ instance : P.ι.Braided where variable {P} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An inequality `P ≤ P'` between monoidal properties of objects induces a braided functor between full braided subcategories. -/ diff --git a/Mathlib/CategoryTheory/Monoidal/Transport.lean b/Mathlib/CategoryTheory/Monoidal/Transport.lean index bde842e597be2a..dde3a9c25f5661 100644 --- a/Mathlib/CategoryTheory/Monoidal/Transport.lean +++ b/Mathlib/CategoryTheory/Monoidal/Transport.lean @@ -81,7 +81,7 @@ where the operations are already defined on the destination type `D`. The functor `F` must preserve all the data parts of the monoidal structure between the two categories. -/ -@[implicit_reducible] +@[instance_reducible] def induced [MonoidalCategoryStruct D] (F : D ⥤ C) [F.Faithful] (fData : InducingFunctorData F) : MonoidalCategory.{v₂} D where @@ -134,7 +134,7 @@ instance fromInducedMonoidal [MonoidalCategoryStruct D] (F : D ⥤ C) [F.Faithfu /-- Transport a monoidal structure along an equivalence of (plain) categories. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def transportStruct (e : C ≌ D) : MonoidalCategoryStruct.{v₂} D where tensorObj X Y := e.functor.obj (e.inverse.obj X ⊗ e.inverse.obj Y) whiskerLeft X _ _ f := e.functor.map (e.inverse.obj X ◁ e.inverse.map f) @@ -158,7 +158,7 @@ the fields `whiskerLeft_eq` and following were all filled by the `cat_disch` aut attribute [local simp] transportStruct in /-- Transport a monoidal structure along an equivalence of (plain) categories. -/ -@[implicit_reducible] +@[instance_reducible] def transport (e : C ≌ D) : MonoidalCategory.{v₂} D := letI : MonoidalCategoryStruct.{v₂} D := transportStruct e induced e.inverse diff --git a/Mathlib/CategoryTheory/MorphismProperty/Basic.lean b/Mathlib/CategoryTheory/MorphismProperty/Basic.lean index d27c680a517aaa..51e5d15f28b55d 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Basic.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Basic.lean @@ -73,6 +73,7 @@ lemma of_eq_top {P : MorphismProperty C} (h : P = ⊤) {X Y : C} (f : X ⟶ Y) : lemma sup_iff (W W' : MorphismProperty C) {X Y : C} (f : X ⟶ Y) : (W ⊔ W') f ↔ W f ∨ W' f := Iff.rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma sSup_iff (S : Set (MorphismProperty C)) {X Y : C} (f : X ⟶ Y) : sSup S f ↔ ∃ W ∈ S, W f := by @@ -87,6 +88,7 @@ lemma iSup_iff {ι : Sort*} (W : ι → MorphismProperty C) {X Y : C} (f : X ⟶ lemma inf_iff (W W' : MorphismProperty C) {X Y : C} (f : X ⟶ Y) : (W ⊓ W') f ↔ W f ∧ W' f := Iff.rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma sInf_iff (S : Set (MorphismProperty C)) {X Y : C} (f : X ⟶ Y) : sInf S f ↔ ∀ W ∈ S, W f := by diff --git a/Mathlib/CategoryTheory/MorphismProperty/Comma.lean b/Mathlib/CategoryTheory/MorphismProperty/Comma.lean index f5c14845afd010..1c1e9bc0b38caf 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Comma.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Comma.lean @@ -378,6 +378,7 @@ def mapLeft (l : L₁ ⟶ L₂) (hl : ∀ X : P.Comma L₂ R Q W, P (l.app X.lef lift (forget _ _ _ _ _ ⋙ CategoryTheory.Comma.mapLeft R l) hl (fun f ↦ f.prop_hom_left) (fun f ↦ f.prop_hom_right) +set_option backward.isDefEq.respectTransparency.types false in variable (L R) in /-- The functor `P.Comma L R Q W ⥤ P.Comma L R Q W` induced by the identity natural transformation on `L` is naturally isomorphic to the identity functor. -/ @@ -386,6 +387,7 @@ def mapLeftId [Q.RespectsIso] [W.RespectsIso] : mapLeft (P := P) (Q := Q) (W := W) R (𝟙 L) (fun X ↦ by simpa using X.prop) ≅ 𝟭 _ := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in variable (R) in /-- The functor `P.Comma L₁ R Q W ⥤ P.Comma L₃ R Q W` induced by the composition of two natural transformations `l : L₁ ⟶ L₂` and `l' : L₂ ⟶ L₃` is naturally isomorphic to the composition of the @@ -399,6 +401,7 @@ def mapLeftComp [Q.RespectsIso] [W.RespectsIso] (l : L₁ ⟶ L₂) (l' : L₂ mapLeft R l' hl' ⋙ mapLeft R l hl := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in variable (R) in /-- Two equal natural transformations `L₁ ⟶ L₂` yield naturally isomorphic functors `P.Comma L₁ R Q W ⥤ P.Comma L₂ R Q W`. -/ @@ -408,6 +411,7 @@ def mapLeftEq [Q.RespectsIso] [W.RespectsIso] (l l' : L₁ ⟶ L₂) (h : l = l' mapLeft R l hl ≅ mapLeft R l' (h ▸ hl) := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in variable (R) in /-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories `P.Comma L₁ R Q W ≌ P.Comma L₂ R Q W`. -/ @@ -440,6 +444,7 @@ def mapRight (r : R₁ ⟶ R₂) (hr : ∀ X : P.Comma L R₁ Q W, P (X.hom ≫ lift (forget _ _ _ _ _ ⋙ CategoryTheory.Comma.mapRight L r) hr (fun f ↦ f.prop_hom_left) (fun f ↦ f.prop_hom_right) +set_option backward.isDefEq.respectTransparency.types false in variable (L R) in /-- The functor `P.Comma L R Q W ⥤ P.Comma L R Q W` induced by the identity natural transformation on `R` is naturally isomorphic to the identity functor. -/ @@ -448,6 +453,7 @@ def mapRightId [Q.RespectsIso] [W.RespectsIso] : mapRight (P := P) (Q := Q) (W := W) L (𝟙 R) (fun X ↦ by simpa using X.prop) ≅ 𝟭 _ := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in variable (L) in /-- The functor `P.Comma L R₁ Q W ⥤ P.Comma L R₃ Q W` induced by the composition of the natural transformations `r : R₁ ⟶ R₂` and `r' : R₂ ⟶ R₃` is naturally isomorphic to the composition of the @@ -461,6 +467,7 @@ def mapRightComp [Q.RespectsIso] [W.RespectsIso] (r : R₁ ⟶ R₂) (r' : R₂ mapRight L r hr ⋙ mapRight L r' hr' := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in variable (L) in /-- Two equal natural transformations `R₁ ⟶ R₂` yield naturally isomorphic functors `P.Comma L R₁ Q W ⥤ P.Comma L R₂ Q W`. -/ @@ -470,6 +477,7 @@ def mapRightEq [Q.RespectsIso] [W.RespectsIso] (r r' : R₁ ⟶ R₂) (h : r = r mapRight L r hr ≅ mapRight L r' (h ▸ hr) := NatIso.ofComponents (fun X => isoMk (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in variable (L) in /-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories `P.Comma L R₁ Q W ≌ P.Comma L R₂ Q W`. -/ @@ -651,12 +659,14 @@ protected def Over.isoMk [Q.RespectsIso] {A B : P.Over Q X} (f : A.left ≅ B.le (w : f.hom ≫ B.hom = A.hom := by cat_disch) : A ≅ B := Comma.isoMk f (Discrete.eqToIso' rfl) +set_option backward.isDefEq.respectTransparency.types false in @[ext] lemma Over.Hom.ext {A B : P.Over Q X} {f g : A ⟶ B} (h : f.left = g.left) : f = g := by ext · exact h · simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma Over.w {A B : P.Over Q X} (f : A ⟶ B) : f.left ≫ B.hom = A.hom := by @@ -737,12 +747,14 @@ protected def Under.isoMk [Q.RespectsIso] {A B : P.Under Q X} (f : A.right ≅ B (w : A.hom ≫ f.hom = B.hom := by cat_disch) : A ≅ B := Comma.isoMk (Discrete.eqToIso' rfl) f +set_option backward.isDefEq.respectTransparency.types false in @[ext] lemma Under.Hom.ext {A B : P.Under Q X} {f g : A ⟶ B} (h : f.right = g.right) : f = g := by ext · simp · exact h +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma Under.w {A B : P.Under Q X} (f : A ⟶ B) : A.hom ≫ f.right = B.hom := by @@ -783,6 +795,7 @@ def CostructuredArrow.homMk {A B : P.CostructuredArrow Q F X} (f : A.left ⟶ B. prop_hom_left := hf prop_hom_right := trivial +set_option backward.isDefEq.respectTransparency.types false in variable {P Q F X} in @[ext] lemma CostructuredArrow.Hom.ext {A B : P.CostructuredArrow Q F X} {f g : A ⟶ B} @@ -817,6 +830,7 @@ instance [F.Faithful] : (CostructuredArrow.toOver P F X).Faithful := by ext exact F.map_injective congr($(hfg).left) +set_option backward.isDefEq.respectTransparency.types false in instance [F.Full] : (CostructuredArrow.toOver P F X).Full := by constructor intro A B f @@ -826,6 +840,7 @@ instance [F.Full] : (CostructuredArrow.toOver P F X).Full := by end CostructuredArrow +set_option backward.isDefEq.respectTransparency.types false in instance HasFactorization.over {C : Type*} [Category* C] (W₁ W₂ : MorphismProperty C) [W₁.HasFactorization W₂] (S : C) : diff --git a/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean b/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean index 083328e2b51d15..1890aabc2c4718 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Concrete.lean @@ -114,6 +114,7 @@ end ConcreteCategory open ConcreteCategory +set_option backward.isDefEq.respectTransparency.types false in /-- In the category of types, any map can be functorially factored as a surjective map followed by an injective map. -/ def functorialSurjectiveInjectiveFactorizationData : diff --git a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean index b60209d56ddf55..e1a186d0f85198 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean @@ -183,6 +183,7 @@ section variable (J : Type*) [Category* J] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/ @[simps] @@ -214,6 +215,7 @@ def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C where rw [← data.mapZ_comp] congr 1 +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functorial factorization in the category `C` extends to the functor category `J ⥤ C`. -/ def functorCategory : diff --git a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean index 4c075e67dd424f..bb96650771b374 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean @@ -669,6 +669,7 @@ lemma coproducts_of_small {X Y : C} (f : X ⟶ Y) {J : Type w'} refine ⟨Shrink J, ?_⟩ rwa [← W.colimitsOfShape_eq_of_equivalence (Discrete.equivalence (equivShrink.{w} J))] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma le_colimitsOfShape_punit : W ≤ W.colimitsOfShape (Discrete PUnit.{w + 1}) := by intro X₁ X₂ f hf diff --git a/Mathlib/CategoryTheory/MorphismProperty/Local.lean b/Mathlib/CategoryTheory/MorphismProperty/Local.lean index 3397bd5c629b80..e4431cba710218 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Local.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Local.lean @@ -183,6 +183,7 @@ alias iff_of_zeroHypercover_source := IsLocalAtSource.iff_of_zeroHypercover end MorphismProperty +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Let `J` be a precoverage for which isomorphisms are local at the target. Let diff --git a/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean b/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean index 536698b9fb6302..03b48b6fc08fd6 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean @@ -42,6 +42,7 @@ this is the functor `P.Over Q X ⥤ P.Over Q Y` given by composing with `f`. -/ def Over.map {f : X ⟶ Y} (hPf : P f) : P.Over Q X ⥤ P.Over Q Y := Comma.mapRight _ (Discrete.natTrans fun _ ↦ f) <| fun X ↦ P.comp_mem _ _ X.prop hPf +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma Over.map_comp {f : X ⟶ Y} (hf : P f) {g : Y ⟶ Z} (hg : P g) : map Q (P.comp_mem f g hf hg) = map Q hf ⋙ map Q hg := by @@ -51,12 +52,14 @@ lemma Over.map_comp {f : X ⟶ Y} (hf : P f) {g : Y ⟶ Z} (hg : P g) : ext simp +set_option backward.isDefEq.respectTransparency.types false in /-- Promote an equality to an isomorphism of `Over.map` functors. -/ @[simps!] def Over.mapCongr [Q.RespectsIso] {X Y : T} {f g : X ⟶ Y} (hfg : f = g) (hf : P f) : Over.map Q hf ≅ Over.map (f := g) Q (by cat_disch) := NatIso.ofComponents (fun Y ↦ Over.isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in set_option linter.overlappingInstances false in /-- `Over.map` preserves identities. -/ @@ -66,6 +69,7 @@ def Over.mapId [P.IsMultiplicative] [Q.RespectsIso] (X : T) (f : X ⟶ X := 𝟙 Over.map (f := f) (P := P) Q (by subst hf; exact P.id_mem X) ≅ 𝟭 _ := NatIso.ofComponents (fun Y ↦ Over.isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Over.map` commutes with composition. -/ @[simps! hom_app_left inv_app_left] @@ -142,6 +146,7 @@ noncomputable def Over.pullbackCongr {f : X ⟶ Y} [P.HasPullbacksAlong f] haveI : HasPullback X.hom g := HasPullbacksAlong.hasPullback _ X.prop Over.isoMk (pullback.congrHom rfl h) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma Over.pullbackCongr_hom_app_left_fst {f : X ⟶ Y} [P.HasPullbacksAlong f] {g : X ⟶ Y} @@ -222,6 +227,7 @@ this is the functor `P.Under Q Y ⥤ P.Under Q X` given by composing with `f`. - def Under.map {f : X ⟶ Y} (hPf : P f) : P.Under Q Y ⥤ P.Under Q X := Comma.mapLeft _ (Discrete.natTrans fun _ ↦ f) <| fun X ↦ P.comp_mem _ _ hPf X.prop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma Under.map_comp {f : X ⟶ Y} (hf : P f) {g : Y ⟶ Z} (hg : P g) : map Q (P.comp_mem f g hf hg) = map Q hg ⋙ map Q hf := by @@ -231,12 +237,14 @@ lemma Under.map_comp {f : X ⟶ Y} (hf : P f) {g : Y ⟶ Z} (hg : P g) : ext simp +set_option backward.isDefEq.respectTransparency.types false in /-- Promote an equality to an isomorphism of `Under.map` functors. -/ @[simps!] def Under.mapCongr [Q.RespectsIso] {X Y : T} {f g : X ⟶ Y} (hfg : f = g) (hf : P f) : Under.map Q hf ≅ Under.map (f := g) Q (by cat_disch) := NatIso.ofComponents (fun Y ↦ Under.isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in set_option linter.overlappingInstances false in /-- `Under.map` preserves identities. -/ @@ -246,6 +254,7 @@ def Under.mapId [P.IsMultiplicative] [Q.RespectsIso] (X : T) (f : X ⟶ X := Under.map (f := f) (P := P) Q (by subst hf; exact P.id_mem X) ≅ 𝟭 _ := NatIso.ofComponents (fun Y ↦ Under.isoMk (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Under.map` commutes with composition. -/ @[simps! hom_app_left] @@ -314,6 +323,7 @@ noncomputable def Under.pushoutCongr {f : X ⟶ Y} [P.HasPushoutsAlong f] haveI : HasPushout X.hom g := HasPushoutsAlong.hasPushout _ X.prop Under.isoMk (pushout.congrHom rfl h) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma Under.pushoutCongr_hom_app_left_fst {f : X ⟶ Y} [P.HasPushoutsAlong f] {g : X ⟶ Y} diff --git a/Mathlib/CategoryTheory/MorphismProperty/Representable.lean b/Mathlib/CategoryTheory/MorphismProperty/Representable.lean index 72a06cb7ab00ec..5c187fb55aa8e7 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Representable.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Representable.lean @@ -213,10 +213,12 @@ case when the cone point is in the image of `F.obj`. -/ noncomputable def lift [Full F] : c ⟶ hf.pullback g := F.preimage <| PullbackCone.IsLimit.lift (hf.isPullback g).isLimit _ _ hi +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma lift_fst [Full F] : F.map (hf.lift i h hi) ≫ hf.fst g = i := by simpa [lift] using! PullbackCone.IsLimit.lift_fst _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma lift_snd [Full F] [Faithful F] : hf.lift i h hi ≫ hf.snd g = h := F.map_injective <| by simpa [lift] using! PullbackCone.IsLimit.lift_snd _ _ _ _ @@ -499,6 +501,7 @@ noncomputable def pullback₃.π : F.obj (pullback₃ hf₁ f₂ f₃) ⟶ X := lemma pullback₃.map_p₁_comp : F.map (p₁ hf₁ f₂ f₃) ≫ f₁ = π _ _ _ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma pullback₃.map_p₂_comp : F.map (p₂ hf₁ f₂ f₃) ≫ f₂ = π _ _ _ := by simp [π, p₁, p₂, ← hf₁.w f₂] @@ -550,6 +553,7 @@ lemma pullback₃.snd_fst'_eq_p₁ : pullback.snd (hf₁.fst' f₂) (hf₁.fst' f₃) ≫ hf₁.fst' f₃ = pullback₃.p₁ hf₁ f₂ f₃ := pullback.condition.symm +set_option backward.isDefEq.respectTransparency.types false in variable {hf₁ f₂ f₃} in @[ext] lemma pullback₃.hom_ext [Faithful F] {Z : C} {φ φ' : Z ⟶ pullback₃ hf₁ f₂ f₃} diff --git a/Mathlib/CategoryTheory/NatTrans.lean b/Mathlib/CategoryTheory/NatTrans.lean index c6d33c94908d94..84d31b62be2f34 100644 --- a/Mathlib/CategoryTheory/NatTrans.lean +++ b/Mathlib/CategoryTheory/NatTrans.lean @@ -81,6 +81,7 @@ theorem congr_app {F G : C ⥤ D} {α β : NatTrans F G} (h : α = β) (X : C) : namespace NatTrans /-- `NatTrans.id F` is the identity natural transformation on a functor `F`. -/ +@[implicit_reducible] protected def id (F : C ⥤ D) : NatTrans F F where app X := 𝟙 (F.obj X) @[simp] diff --git a/Mathlib/CategoryTheory/ObjectProperty/Equivalence.lean b/Mathlib/CategoryTheory/ObjectProperty/Equivalence.lean index 6f7f16339d34d2..e500fecbfd2073 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Equivalence.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Equivalence.lean @@ -48,6 +48,7 @@ def topEquivalence : ObjectProperty.FullSubcategory (C := C) ⊤ ≌ C where inverse := ObjectProperty.lift _ (𝟭 _) (by simp) unitIso := Iso.refl _ counitIso := Iso.refl _ + functor_unitIso_comp := by cat_disch end CategoryTheory.ObjectProperty diff --git a/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean b/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean index e6c2ab7b09469c..3d29b520b66058 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean @@ -62,6 +62,7 @@ instance (priority := 100) [P.IsClosedUnderLimitsOfShape (Discrete.{0} PEmpty)] P.Nonempty := nonempty_of_prop P.prop_terminal +set_option backward.isDefEq.respectTransparency.types false in lemma IsClosedUnderBinaryProducts.closedUnderIsomorphisms [HasTerminal C] [P.IsClosedUnderLimitsOfShape (Discrete.{0} PEmpty)] [P.IsClosedUnderBinaryProducts] : P.IsClosedUnderIsomorphisms where @@ -165,6 +166,7 @@ instance (priority := 100) [P.IsClosedUnderColimitsOfShape (Discrete.{0} PEmpty) P.Nonempty := nonempty_of_prop P.prop_initial +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma IsClosedUnderBinaryCoproducts.closedUnderIsomorphisms [HasInitial C] [P.IsClosedUnderColimitsOfShape (Discrete.{0} PEmpty)] [P.IsClosedUnderBinaryCoproducts] : diff --git a/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean b/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean index 83f2dfe56b0822..7612586037d80c 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/FullSubcategory.lean @@ -131,7 +131,7 @@ variable {P' : ObjectProperty C} /-- If `P` and `P'` are properties of objects such that `P ≤ P'`, there is an induced functor `P.FullSubcategory ⥤ P'.FullSubcategory`. -/ -@[simps] +@[simps, implicit_reducible] def ιOfLE (h : P ≤ P') : P.FullSubcategory ⥤ P'.FullSubcategory where obj X := ⟨X.1, h _ X.2⟩ map f := homMk f.hom @@ -157,7 +157,7 @@ variable {D : Type u'} [Category.{v'} D] (P Q : ObjectProperty D) /-- A functor which maps objects to objects satisfying a certain property induces a lift through the full subcategory of objects satisfying that property. -/ -@[simps] +@[simps, implicit_reducible] def lift : C ⥤ FullSubcategory P where obj X := ⟨F.obj X, hF X⟩ map f := homMk (F.map f) diff --git a/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean b/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean index 985cbd93dd332b..59ac50ca9775ec 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/LimitsClosure.lean @@ -151,6 +151,7 @@ lemma strictLimitsClosureIter_le_limitsClosure (b : β) : intro c hc exact hb' _ hc +set_option backward.isDefEq.respectTransparency.types false in instance [ObjectProperty.Small.{w} P] [LocallySmall.{w} C] [Small.{w} α] [∀ a, Small.{w} (J a)] [∀ a, LocallySmall.{w} (J a)] (b : β) [hb₀ : Small.{w} (Set.Iio b)] : diff --git a/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean b/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean index 757761c8d2c7cf..75ddb590f7b117 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/LimitsOfShape.lean @@ -110,6 +110,7 @@ noncomputable def reindex {X : C} (h : P.LimitOfShape J X) (G : J' ⥤ J) [G.Ini toLimitPresentation := h.toLimitPresentation.reindex G prop_diag_obj _ := h.prop_diag_obj _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `P : ObjectProperty C`, and a presentation `P.LimitOfShape J X` of an object `X : C`, this is the induced functor `J ⥤ StructuredArrow P.ι X`. -/ diff --git a/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean b/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean index 72bfb9eb14b469..1804573630a362 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Opposite.lean @@ -137,6 +137,7 @@ lemma unop_isoClosure (P : ObjectProperty Cᵒᵖ) : P.isoClosure.unop = P.unop.isoClosure := by rw [← op_injective_iff, P.unop.op_isoClosure, op_unop, op_unop] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `P : ObjectProperty C`, this is the equivalence between `P.op.FullSubcategory` and `P.FullSubcategoryᵒᵖ`. -/ diff --git a/Mathlib/CategoryTheory/Opposites.lean b/Mathlib/CategoryTheory/Opposites.lean index 8c0b06b3b0882b..42b357191825a0 100644 --- a/Mathlib/CategoryTheory/Opposites.lean +++ b/Mathlib/CategoryTheory/Opposites.lean @@ -205,7 +205,7 @@ variable {D : Type u₂} [Category.{v₂} D] /-- The opposite of a functor, i.e. considering a functor `F : C ⥤ D` as a functor `Cᵒᵖ ⥤ Dᵒᵖ`. In informal mathematics no distinction is made between these. -/ -@[simps] +@[simps, implicit_reducible] protected def op (F : C ⥤ D) : Cᵒᵖ ⥤ Dᵒᵖ where obj X := op (F.obj (unop X)) map f := (F.map f.unop).op @@ -213,7 +213,7 @@ protected def op (F : C ⥤ D) : Cᵒᵖ ⥤ Dᵒᵖ where /-- Given a functor `F : Cᵒᵖ ⥤ Dᵒᵖ` we can take the "unopposite" functor `F : C ⥤ D`. In informal mathematics no distinction is made between these. -/ -@[simps] +@[simps, implicit_reducible] protected def unop (F : Cᵒᵖ ⥤ Dᵒᵖ) : C ⥤ D where obj X := unop (F.obj (op X)) map f := (F.map f.op).unop @@ -298,6 +298,7 @@ protected def rightOp (F : Cᵒᵖ ⥤ D) : C ⥤ Dᵒᵖ where lemma rightOp_map_unop {F : Cᵒᵖ ⥤ D} {X Y} (f : X ⟶ Y) : (F.rightOp.map f).unop = F.map f.op := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {F : C ⥤ D} [Full F] : Full F.op where map_surjective f := ⟨(F.preimage f.unop).op, by simp⟩ @@ -324,10 +325,12 @@ instance rightOp_faithful {F : Cᵒᵖ ⥤ D} [Faithful F] : Faithful F.rightOp instance leftOp_faithful {F : C ⥤ Dᵒᵖ} [Faithful F] : Faithful F.leftOp where map_injective h := Quiver.Hom.unop_inj (map_injective F (Quiver.Hom.unop_inj h)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance rightOp_full {F : Cᵒᵖ ⥤ D} [Full F] : Full F.rightOp where map_surjective f := ⟨(F.preimage f.unop).unop, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance leftOp_full {F : C ⥤ Dᵒᵖ} [Full F] : Full F.leftOp where map_surjective f := ⟨(F.preimage f.op).op, by simp⟩ @@ -872,6 +875,7 @@ namespace Functor variable (C) variable (D : Type u₂) [Category.{v₂} D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of functor categories induced by `op` and `unop`. -/ diff --git a/Mathlib/CategoryTheory/PUnit.lean b/Mathlib/CategoryTheory/PUnit.lean index 90e23fb3a72964..c4113994a9cd50 100644 --- a/Mathlib/CategoryTheory/PUnit.lean +++ b/Mathlib/CategoryTheory/PUnit.lean @@ -47,6 +47,7 @@ theorem punit_ext' (F G : C ⥤ Discrete PUnit.{w + 1}) : F = G := abbrev fromPUnit (X : C) : Discrete PUnit.{w + 1} ⥤ C := (Functor.const _).obj X +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Functors from `Discrete PUnit` are equivalent to the category itself. -/ @[simps] diff --git a/Mathlib/CategoryTheory/PathCategory/Basic.lean b/Mathlib/CategoryTheory/PathCategory/Basic.lean index 7e012cc4e81fa5..13fc9ed33823cd 100644 --- a/Mathlib/CategoryTheory/PathCategory/Basic.lean +++ b/Mathlib/CategoryTheory/PathCategory/Basic.lean @@ -38,11 +38,13 @@ variable (V : Type u₁) [Quiver.{v₁} V] namespace Paths +set_option backward.isDefEq.respectTransparency.types false in instance categoryPaths : Category.{max u₁ v₁} (Paths V) where Hom := fun X Y : V => Quiver.Path X Y id _ := Quiver.Path.nil comp f g := Quiver.Path.comp f g +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion of a quiver `V` into its path category, as a prefunctor. -/ @[simps] @@ -52,6 +54,7 @@ def of : V ⥤q Paths V where variable {V} +set_option backward.isDefEq.respectTransparency.types false in /-- To prove a property on morphisms of a path category with given source `a`, it suffices to prove it for the identity and prove that the property is preserved under composition on the right with length 1 paths. -/ @@ -82,6 +85,7 @@ lemma induction_fixed_target {b : Paths V} (P : ∀ {a : Paths V}, (a ⟶ b) → obtain ⟨c, f, q, hq, rfl⟩ := f.eq_toPath_comp_of_length_eq_succ h exact comp _ _ (h' _ hq) +set_option backward.isDefEq.respectTransparency.types false in /-- To prove a property on morphisms of a path category, it suffices to prove it for the identity and prove that the property is preserved under composition on the right with length 1 paths. -/ lemma induction (P : ∀ {a b : Paths V}, (a ⟶ b) → Prop) @@ -91,6 +95,7 @@ lemma induction (P : ∀ {a b : Paths V}, (a ⟶ b) → Prop) ∀ {a b : Paths V} (f : a ⟶ b), P f := fun {_} ↦ induction_fixed_source _ id comp +set_option backward.isDefEq.respectTransparency.types false in /-- To prove a property on morphisms of a path category, it suffices to prove it for the identity and prove that the property is preserved under composition on the left with length 1 paths. -/ lemma induction' (P : ∀ {a b : Paths V}, (a ⟶ b) → Prop) @@ -123,20 +128,24 @@ def lift {C} [Category* C] (φ : V ⥤q C) : Paths V ⥤ C where simp only at ih ⊢ rw [ih, Category.assoc] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem lift_nil {C} [Category* C] (φ : V ⥤q C) (X : V) : (lift φ).map Quiver.Path.nil = 𝟙 (φ.obj X) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem lift_cons {C} [Category* C] (φ : V ⥤q C) {X Y Z : V} (p : Quiver.Path X Y) (f : Y ⟶ Z) : (lift φ).map (p.cons f) = (lift φ).map p ≫ φ.map f := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem lift_toPath {C} [Category* C] (φ : V ⥤q C) {X Y : V} (f : X ⟶ Y) : (lift φ).map f.toPath = φ.map f := by dsimp [Quiver.Hom.toPath, lift] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem lift_spec {C} [Category* C] (φ : V ⥤q C) : of V ⋙q (lift φ).toPrefunctor = φ := by fapply Prefunctor.ext @@ -169,6 +178,7 @@ theorem lift_unique {C} [Category* C] (φ : V ⥤q C) (Φ : Paths V ⥤ C) convert! Functor.map_comp Φ p (Quiver.Hom.toPath f') rw [this, ih] +set_option backward.isDefEq.respectTransparency.types false in /-- Two functors out of a path category are equal when they agree on singleton paths. -/ @[ext (iff := false)] theorem ext_functor {C} [Category* C] {F G : Paths V ⥤ C} (h_obj : F.obj = G.obj) @@ -190,6 +200,7 @@ end Paths variable (W : Type u₂) [Quiver.{v₂} W] -- A restatement of `Prefunctor.mapPath_comp` using `f ≫ g` instead of `f.comp g`. +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem Prefunctor.mapPath_comp' (F : V ⥤q W) {X Y Z : Paths V} (f : X ⟶ Y) (g : Y ⟶ Z) : F.mapPath (f ≫ g) = (F.mapPath f).comp (F.mapPath g) := @@ -226,10 +237,12 @@ theorem composePath_comp {X Y Z : C} (f : Path X Y) (g : Path Y Z) : | nil => simp | cons g e ih => simp [ih] +set_option backward.isDefEq.respectTransparency.types false in @[simp] -- TODO get rid of `(id X : C)` somehow? theorem composePath_id {X : Paths C} : composePath (𝟙 X) = 𝟙 (show C from X) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem composePath_comp' {X Y Z : Paths C} (f : X ⟶ Y) (g : Y ⟶ Z) : composePath (f ≫ g) = composePath f ≫ composePath g := @@ -237,6 +250,7 @@ theorem composePath_comp' {X Y Z : Paths C} (f : X ⟶ Y) (g : Y ⟶ Z) : variable (C) +set_option backward.isDefEq.respectTransparency.types false in /-- Composition of paths as functor from the path category of a category to the category. -/ @[simps] def pathComposition : Paths C ⥤ C where @@ -259,6 +273,7 @@ def pathsHomRel : HomRel (Paths C) := fun _ _ p q => Assistance investigating this would be appreciated. -/ attribute [nolint simpNF] pathsHomRel.eq_1 +set_option backward.isDefEq.respectTransparency.types false in /-- The functor from a category to the canonical quotient of its path category. -/ @[simps] def toQuotientPaths : C ⥤ Quotient (pathsHomRel C) where @@ -267,12 +282,14 @@ def toQuotientPaths : C ⥤ Quotient (pathsHomRel C) where map_id X := Quot.sound (HomRel.CompClosure.of (by simp)) map_comp f g := Quot.sound (HomRel.CompClosure.of (by simp)) +set_option backward.isDefEq.respectTransparency.types false in /-- The functor from the canonical quotient of a path category of a category to the original category. -/ @[simps!] def quotientPathsTo : Quotient (pathsHomRel C) ⥤ C := Quotient.lift _ (pathComposition C) fun _ _ _ _ w => w +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical quotient of the path category of a category is equivalent to the original category. -/ diff --git a/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean b/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean index a9052c1bdc66c8..b3f9ecc646335e 100644 --- a/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/PathCategory/MorphismProperty.lean @@ -59,6 +59,7 @@ section variable {C : Type*} [Category* C] {V : Type u₁} [Quiver.{v₁} V] +set_option backward.isDefEq.respectTransparency.types false in /-- A natural transformation between `F G : Paths V ⥤ C` is defined by its components and its unary naturality squares. -/ @[simps] @@ -169,11 +170,13 @@ lemma paths_le_inverseImage (W : MorphismProperty C) [W.IsMultiplicative] : W.paths ≤ W.inverseImage (pathComposition C) := fun _ _ _ ↦ W.composePath_mem +set_option backward.isDefEq.respectTransparency.types false in instance (W : MorphismProperty C) : IsMultiplicative (W.paths.strictMap (pathComposition C)) where id_mem X := W.paths.map_mem_strictMap (pathComposition C) _ (W.paths.id_mem X) comp_mem := fun _ _ ⟨hp⟩ ⟨hq⟩ ↦ by simpa using! W.paths.map_mem_strictMap (pathComposition C) _ <| W.paths.comp_mem _ _ hp hq +set_option backward.isDefEq.respectTransparency.types false in lemma multiplicativeClosure_eq_strictMap_paths (W : MorphismProperty C) : W.multiplicativeClosure = W.paths.strictMap (pathComposition C) := by refine le_antisymm ?_ fun _ _ _ ⟨h⟩ ↦ ?_ diff --git a/Mathlib/CategoryTheory/Pi/Basic.lean b/Mathlib/CategoryTheory/Pi/Basic.lean index 36bd5d7834a9fd..18f21930ef89e3 100644 --- a/Mathlib/CategoryTheory/Pi/Basic.lean +++ b/Mathlib/CategoryTheory/Pi/Basic.lean @@ -67,7 +67,7 @@ instance (f : J → I) : (j : J) → Category ((C ∘ f) j) := /-- Pull back an `I`-indexed family of objects to a `J`-indexed family, along a function `J → I`. -/ -@[simps] +@[simps, implicit_reducible] def comap (h : J → I) : (∀ i, C i) ⥤ (∀ j, C (h j)) where obj f i := f (h i) map α i := α (h i) @@ -239,6 +239,7 @@ variable {C} variable {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] variable {F G : ∀ i, C i ⥤ D i} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Assemble an `I`-indexed family of natural transformations into a single natural transformation. -/ @@ -264,6 +265,7 @@ variable {C} variable {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] variable {F G : ∀ i, C i ⥤ D i} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Assemble an `I`-indexed family of natural isomorphisms into a single natural isomorphism. -/ @@ -316,6 +318,7 @@ def Pi.eqToEquivalenceFunctorIso (f : J → I) {i' j' : J} (h : i' = j') : attribute [local simp] eqToHom_map +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Reindexing a family of categories gives equivalent `Pi` categories. -/ @[simps] @@ -334,6 +337,7 @@ noncomputable def Pi.equivalenceOfEquiv (e : J ≃ I) : Pi.evalCompEqToEquivalenceFunctor C (e.apply_symm_apply i) ≪≫ (leftUnitor _).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A product of categories indexed by `Option J` identifies to a binary product. -/ @[simps] @@ -354,6 +358,7 @@ namespace Equivalence variable {C} variable {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Assemble an `I`-indexed family of equivalences of categories into a single equivalence. -/ diff --git a/Mathlib/CategoryTheory/Pi/Monoidal.lean b/Mathlib/CategoryTheory/Pi/Monoidal.lean index c4430bd112df35..f36f35ef354a9f 100644 --- a/Mathlib/CategoryTheory/Pi/Monoidal.lean +++ b/Mathlib/CategoryTheory/Pi/Monoidal.lean @@ -174,6 +174,7 @@ instance (i : I) : (Pi.eval C i).Monoidal where set_option backward.defeqAttrib.useBackward true in instance [∀ i, BraidedCategory (C i)] (i : I) : (Pi.eval C i).Braided where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps] instance laxMonoidalPi' {D : Type*} [Category* D] [MonoidalCategory D] (F : ∀ i : I, D ⥤ C i) @@ -182,6 +183,7 @@ instance laxMonoidalPi' {D : Type*} [Category* D] [MonoidalCategory D] (F : ∀ ε := fun i ↦ Functor.LaxMonoidal.ε (F i) μ X Y := fun i ↦ Functor.LaxMonoidal.μ (F i) X Y +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps] instance opLaxMonoidalPi' {D : Type*} [Category* D] [MonoidalCategory D] @@ -193,6 +195,7 @@ instance opLaxMonoidalPi' {D : Type*} [Category* D] [MonoidalCategory D] oplax_left_unitality X := by ext; simp oplax_right_unitality X := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps!] instance monoidalPi' {D : Type*} [Category* D] [MonoidalCategory D] @@ -210,6 +213,7 @@ instance [∀ i, BraidedCategory (C i)] (F : ∀ i : I, D ⥤ C i) [∀ i, (F i).Braided] : (Functor.pi' F).Braided where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps] instance laxMonoidalPi {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] @@ -219,6 +223,7 @@ instance laxMonoidalPi {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] ε := fun i ↦ Functor.LaxMonoidal.ε (F i) μ X Y := fun i ↦ Functor.LaxMonoidal.μ (F i) (X i) (Y i) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps] instance opLaxMonoidalPi {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] @@ -230,6 +235,7 @@ instance opLaxMonoidalPi {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] oplax_left_unitality X := by ext; simp oplax_right_unitality X := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps!] instance monoidalPi {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] @@ -259,6 +265,7 @@ instance {D : Type*} [Category* D] [MonoidalCategory D] unit := by ext i; simpa using NatTrans.IsMonoidal.unit (τ := τ i) tensor X Y := by ext i; simpa using NatTrans.IsMonoidal.tensor _ _ (τ := τ i) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance {D : I → Type u₂} [∀ i, Category.{v₂} (D i)] [∀ i, MonoidalCategory (D i)] diff --git a/Mathlib/CategoryTheory/Preadditive/Biproducts.lean b/Mathlib/CategoryTheory/Preadditive/Biproducts.lean index 003a6a2ae4b31b..c2de1cd5eedf4a 100644 --- a/Mathlib/CategoryTheory/Preadditive/Biproducts.lean +++ b/Mathlib/CategoryTheory/Preadditive/Biproducts.lean @@ -147,6 +147,7 @@ def isBilimitOfIsLimit {f : J → C} (t : Bicone f) (ht : IsLimit t.toCone) : t. cases j simp [sum_comp, t.ι_π, comp_dite] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- We can turn any limit cone over a pair into a bilimit bicone. -/ def biconeIsBilimitOfLimitConeOfIsLimit {f : J → C} {t : Cone (Discrete.functor f)} @@ -165,6 +166,7 @@ def isBilimitOfIsColimit {f : J → C} (t : Bicone f) (ht : IsColimit t.toCocone simp_rw [Bicone.toCocone_ι_app, comp_sum, ← Category.assoc, t.ι_π, dite_comp] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- We can turn any limit cone over a pair into a bilimit bicone. -/ def biconeIsBilimitOfColimitCoconeOfIsColimit {f : J → C} {t : Cocone (Discrete.functor f)} @@ -301,6 +303,7 @@ def biproduct.reindex {β γ : Type} [Finite β] (ε : β ≃ γ) simp [Preadditive.sum_comp, biproduct.lift_desc, biproduct.ι_π, comp_dite, Equiv.apply_eq_iff_eq_symm_apply, h] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- In a preadditive category, we can construct a binary biproduct for `X Y : C` from any binary bicone `b` satisfying `total : b.fst ≫ b.inl + b.snd ≫ b.inr = 𝟙 b.X`. @@ -419,6 +422,7 @@ def isBinaryBilimitOfIsColimit {X Y : C} (t : BinaryBicone X Y) (ht : IsColimit isBinaryBilimitOfTotal _ <| by refine BinaryCofan.IsColimit.hom_ext ht ?_ ?_ <;> simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- We can turn any colimit cocone over a pair into a bilimit bicone. -/ def binaryBiconeIsBilimitOfColimitCoconeOfIsColimit {X Y : C} {t : Cocone (pair X Y)} @@ -874,6 +878,7 @@ section Finite variable {J : Type*} [Finite J] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) finite biproducts preserves finite products. -/ @@ -898,6 +903,7 @@ lemma preservesProductsOfShape_of_preservesBiproductsOfShape [PreservesBiproduct end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) finite products preserves finite biproducts. -/ @@ -947,6 +953,7 @@ lemma preservesBiproductsOfShape_of_preservesProductsOfShape PreservesBiproductsOfShape J F where preserves {_} := preservesBiproduct_of_preservesProduct F +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) finite biproducts preserves finite coproducts. -/ @@ -971,6 +978,7 @@ lemma preservesCoproductsOfShape_of_preservesBiproductsOfShape [PreservesBiprodu end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) finite coproducts preserves finite biproducts. -/ @@ -994,6 +1002,7 @@ lemma preservesBiproductsOfShape_of_preservesCoproductsOfShape end Finite +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) binary biproducts preserves binary products. -/ @@ -1018,6 +1027,7 @@ lemma preservesBinaryProducts_of_preservesBinaryBiproducts [PreservesBinaryBipro end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) binary products preserves binary biproducts. -/ @@ -1062,6 +1072,7 @@ lemma preservesBinaryBiproducts_of_preservesBinaryProducts [PreservesLimitsOfShape (Discrete WalkingPair) F] : PreservesBinaryBiproducts F where preserves {_} {_} := preservesBinaryBiproduct_of_preservesBinaryProduct F +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) binary biproducts preserves binary coproducts. -/ @@ -1088,6 +1099,7 @@ lemma preservesBinaryCoproducts_of_preservesBinaryBiproducts [PreservesBinaryBip end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories that preserves (zero morphisms and) binary coproducts preserves binary biproducts. -/ diff --git a/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean b/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean index 190a83e50c9b3c..2259a0a8b96c64 100644 --- a/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean +++ b/Mathlib/CategoryTheory/Preadditive/CommGrp_.lean @@ -81,6 +81,7 @@ def commGrpEquivalenceAux : CommGrp.forget C ⋙ toCommGrp C ≅ · infer_instance · cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An additive category is equivalent to its category of commutative group objects. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Preadditive/LeftExact.lean b/Mathlib/CategoryTheory/Preadditive/LeftExact.lean index 7eef13254cee94..79a519a6f8568d 100644 --- a/Mathlib/CategoryTheory/Preadditive/LeftExact.lean +++ b/Mathlib/CategoryTheory/Preadditive/LeftExact.lean @@ -163,6 +163,7 @@ attribute [local instance] preservesBinaryCoproducts_of_preservesCokernels variable [HasBinaryBiproducts C] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor between preadditive categories preserves the coequalizer of two morphisms if it preserves all cokernels. -/ diff --git a/Mathlib/CategoryTheory/Preadditive/Mat.lean b/Mathlib/CategoryTheory/Preadditive/Mat.lean index c351f45778065d..2b392fd24a4726 100644 --- a/Mathlib/CategoryTheory/Preadditive/Mat.lean +++ b/Mathlib/CategoryTheory/Preadditive/Mat.lean @@ -98,6 +98,7 @@ section attribute [local simp] Hom.id Hom.comp +set_option backward.isDefEq.respectTransparency.types false in instance : Category.{v₁} (Mat_ C) where Hom := Hom id := Hom.id @@ -280,6 +281,7 @@ end Functor namespace Mat_ +set_option backward.isDefEq.respectTransparency.types false in /-- The embedding of `C` into `Mat_ C` as one-by-one matrices. (We index the summands by `PUnit`.) -/ @[simps] @@ -355,6 +357,7 @@ def additiveObjIsoBiproduct (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) F.obj M ≅ ⨁ fun i => F.obj ((embedding C).obj (M.X i)) := F.mapIso (isoBiproductEmbedding M) ≪≫ F.mapBiproduct _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma additiveObjIsoBiproduct_hom_π (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) (i : M.ι) : @@ -421,6 +424,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in instance lift_additive (F : C ⥤ D) [Functor.Additive F] : Functor.Additive (lift F) where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An additive functor `C ⥤ D` factors through its lift to `Mat_ C ⥤ D`. -/ @[simps!] @@ -512,6 +516,7 @@ instance (R : Type u) : CoeSort (Mat R) (Type u) := open Matrix +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] FintypeCat.fintype in open scoped Classical in instance (R : Type u) [Semiring R] : Category (Mat R) where @@ -547,11 +552,13 @@ theorem id_apply_self (M : Mat R) (i : M) : (𝟙 M : Matrix M M R) i i = 1 := b theorem id_apply_of_ne (M : Mat R) (i j : M) (h : i ≠ j) : (𝟙 M : Matrix M M R) i j = 0 := by simp [id_apply, h] +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] FintypeCat.fintype in theorem comp_def {M N K : Mat R} (f : M ⟶ N) (g : N ⟶ K) : f ≫ g = fun i k => ∑ j : N, f i j * g j k := rfl +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] FintypeCat.fintype in @[simp] theorem comp_apply {M N K : Mat R} (f : M ⟶ N) (g : N ⟶ K) (i k) : @@ -567,6 +574,7 @@ variable (R : Type) [Ring R] open Opposite +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition for `CategoryTheory.Mat.equivalenceSingleObj`. -/ @[simps] def equivalenceSingleObjInverse : Mat_ (SingleObj Rᵐᵒᵖ) ⥤ Mat R where @@ -591,6 +599,7 @@ instance : (equivalenceSingleObjInverse R).Faithful where instance : (equivalenceSingleObjInverse R).Full where map_surjective f := ⟨fun i j => MulOpposite.op (f i j), rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] FintypeCat.fintype in instance : (equivalenceSingleObjInverse R).EssSurj where mem_essImage X := diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean b/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean index 20e1988d960d66..0c4d654fe19069 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/Resolution.lean @@ -103,6 +103,7 @@ theorem complex_d_succ_comp (n : ℕ) : noncomputable def cokernelCofork : CokernelCofork (P.complex.d 1 0) := CokernelCofork.ofπ _ P.complex_d_comp_π_f_zero +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `Z` is the cokernel of `P.complex.X 1 ⟶ P.complex.X 0` when `P : ProjectiveResolution Z`. -/ noncomputable def isColimitCokernelCofork : IsColimit (P.cokernelCofork) := by diff --git a/Mathlib/CategoryTheory/Preadditive/Schur.lean b/Mathlib/CategoryTheory/Preadditive/Schur.lean index 254cf45acf2c65..8229722f5b2f9a 100644 --- a/Mathlib/CategoryTheory/Preadditive/Schur.lean +++ b/Mathlib/CategoryTheory/Preadditive/Schur.lean @@ -135,7 +135,7 @@ theorem endomorphism_simple_eq_smul_id {X : C} [Simple X] [FiniteDimensional /-- Endomorphisms of a simple object form a field if they are finite dimensional. This can't be an instance as `𝕜` would be undetermined. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fieldEndOfFiniteDimensional (X : C) [Simple X] [I : FiniteDimensional 𝕜 (X ⟶ X)] : Field (End X) := by classical exact diff --git a/Mathlib/CategoryTheory/Preadditive/Transfer.lean b/Mathlib/CategoryTheory/Preadditive/Transfer.lean index e8431d4fcbd61a..54fccf66bc08c1 100644 --- a/Mathlib/CategoryTheory/Preadditive/Transfer.lean +++ b/Mathlib/CategoryTheory/Preadditive/Transfer.lean @@ -31,7 +31,7 @@ namespace Preadditive /-- If `D` is a preadditive category, any fully faithful functor `F : C ⥤ D` induces a preadditive structure on `C`. -/ -@[implicit_reducible] +@[instance_reducible] def ofFullyFaithful : Preadditive C where homGroup P Q := hF.homEquiv.addCommGroup add_comp P Q R f f' g := hF.map_injective (by simp [Equiv.add_def]) diff --git a/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean index 5eb4bc6ac67db5..2baa6b876e4e03 100644 --- a/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Yoneda/Basic.lean @@ -76,6 +76,7 @@ def preadditiveCoyonedaObj (X : C) : C ⥤ ModuleCat.{v} (End X)ᵐᵒᵖ where map_add' := fun _ _ => add_comp _ _ _ _ _ _ map_smul' := fun _ _ => Category.assoc _ _ _ } +set_option backward.isDefEq.respectTransparency.types false in /-- The Yoneda embedding for preadditive categories sends an object `X` to the copresheaf sending an object `Y` to the group of morphisms `X ⟶ Y`. At each point, we get an additional `End X`-module structure, see `preadditiveCoyonedaObj`. @@ -98,6 +99,7 @@ instance additive_yonedaObj' (X : C) : Functor.Additive (preadditiveYoneda.obj X instance additive_coyonedaObj (X : C) : Functor.Additive (preadditiveCoyonedaObj X) where +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance additive_coyonedaObj' (X : Cᵒᵖ) : Functor.Additive (preadditiveCoyoneda.obj X) where @@ -111,6 +113,7 @@ theorem whiskering_preadditiveYoneda : yoneda := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Composing the preadditive yoneda embedding with the forgetful functor yields the regular Yoneda embedding. -/ @@ -128,6 +131,7 @@ instance full_preadditiveYoneda : (preadditiveYoneda : C ⥤ Cᵒᵖ ⥤ AddComm Functor.Full.of_comp_faithful preadditiveYoneda ((whiskeringRight Cᵒᵖ AddCommGrpCat (Type v)).obj (forget AddCommGrpCat)) +set_option backward.isDefEq.respectTransparency.types false in instance full_preadditiveCoyoneda : (preadditiveCoyoneda : Cᵒᵖ ⥤ C ⥤ AddCommGrpCat).Full := let _ : Functor.Full (preadditiveCoyoneda ⋙ (whiskeringRight C AddCommGrpCat (Type v)).obj (forget AddCommGrpCat)) := @@ -157,6 +161,7 @@ def preadditiveYonedaMap (X : C) : end +set_option backward.isDefEq.respectTransparency.types false in /-- The preadditive coyoneda functor for the category `AddCommGrpCat` agrees with `AddCommGrpCat.coyoneda`. -/ def _root_.AddCommGrpCat.preadditiveCoyonedaIso : preadditiveCoyoneda ≅ AddCommGrpCat.coyoneda := diff --git a/Mathlib/CategoryTheory/Presentable/Dense.lean b/Mathlib/CategoryTheory/Presentable/Dense.lean index b69f5f34a7eed0..b6164e9c28df67 100644 --- a/Mathlib/CategoryTheory/Presentable/Dense.lean +++ b/Mathlib/CategoryTheory/Presentable/Dense.lean @@ -55,6 +55,7 @@ instance final_toCostructuredArrow g₁.left.hom g₂.left.hom ((CostructuredArrow.w g₁).trans (CostructuredArrow.w g₂).symm) exact ⟨k, a, by cat_disch⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [IsCardinalAccessibleCategory C κ] : (isCardinalPresentable C κ).ι.IsDense where diff --git a/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean b/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean index 8be9d46f911933..3a10e3281f0c93 100644 --- a/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean +++ b/Mathlib/CategoryTheory/Presentable/IsCardinalFiltered.lean @@ -184,6 +184,7 @@ lemma isCardinalFiltered_preorder (J : Type w) [Preorder J] { app a := homOfLE (hj a) naturality _ _ _ := rfl }⟩ +set_option backward.isDefEq.respectTransparency.types false in instance (κ : Cardinal.{w}) [hκ : Fact κ.IsRegular] : IsCardinalFiltered κ.ord.ToType κ := isCardinalFiltered_preorder _ _ (fun ι f hs ↦ by @@ -196,6 +197,7 @@ instance (κ : Cardinal.{w}) [hκ : Fact κ.IsRegular] : open IsCardinalFiltered +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance isCardinalFiltered_under (J : Type u) [Category.{v} J] (κ : Cardinal.{w}) [Fact κ.IsRegular] @@ -217,6 +219,7 @@ instance isCardinalFiltered_under dsimp at this ⊢ simp only [reassoc_of% this, Category.comp_id] } }⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance isCardinalFiltered_prod (J₁ : Type u) (J₂ : Type u') [Category.{v} J₁] [Category.{v'} J₂] (κ : Cardinal.{w}) [Fact κ.IsRegular] @@ -233,6 +236,7 @@ instance isCardinalFiltered_prod (J₁ : Type u) (J₂ : Type u') · simpa using c₁.w f · simpa using c₂.w f }⟩ +set_option backward.isDefEq.respectTransparency.types false in instance isCardinalFiltered_pi {ι : Type u'} (J : ι → Type u) [∀ i, Category.{v} (J i)] (κ : Cardinal.{w}) [Fact κ.IsRegular] [∀ i, IsCardinalFiltered (J i) κ] : IsCardinalFiltered (∀ i, J i) κ where diff --git a/Mathlib/CategoryTheory/Presentable/Type.lean b/Mathlib/CategoryTheory/Presentable/Type.lean index 81f42fa1a9c37d..1f5dc095bc307c 100644 --- a/Mathlib/CategoryTheory/Presentable/Type.lean +++ b/Mathlib/CategoryTheory/Presentable/Type.lean @@ -99,6 +99,7 @@ def cocone : Cocone (Set.functor X κ) where pt := X ι.app _ := ↾(Subtype.val) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Any type `X` is the (filtered) colimit of its subsets of cardinality `< κ` when `κ` is an infinite cardinal. (This colimit is `κ`-filtered when `κ` is diff --git a/Mathlib/CategoryTheory/Products/Associator.lean b/Mathlib/CategoryTheory/Products/Associator.lean index 422d178b9af840..84d42640fba955 100644 --- a/Mathlib/CategoryTheory/Products/Associator.lean +++ b/Mathlib/CategoryTheory/Products/Associator.lean @@ -11,6 +11,23 @@ public import Mathlib.CategoryTheory.Products.Basic The associator functor `((C × D) × E) ⥤ (C × (D × E))` and its inverse form an equivalence. -/ +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + CategoryTheory.Equivalence.congrRight + CategoryTheory.Equivalence.prod + CategoryTheory.Equivalence.refl + CategoryTheory.Equivalence.symm + CategoryTheory.Equivalence.trans + CategoryTheory.Functor.prod' + CategoryTheory.Functor.whiskerRight + CategoryTheory.NatTrans.prod' + CategoryTheory.Prod.braiding + CategoryTheory.Prod.fst + CategoryTheory.Prod.snd + CategoryTheory.Prod.swap + CategoryTheory.functorProdToProdFunctor + CategoryTheory.prodFunctorToFunctorProd + @[expose] public section universe v₁ v₂ v₃ v₄ u₁ u₂ u₃ u₄ @@ -26,14 +43,14 @@ variable (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D] /-- The associator functor `(C × D) × E ⥤ C × (D × E)`. -/ -@[simps] +@[local implicit_reducible, simps] def associator : (C × D) × E ⥤ C × D × E where obj X := (X.1.1, (X.1.2, X.2)) map := @fun _ _ f => f.1.1 ×ₘ (f.1.2 ×ₘ f.2) /-- The inverse associator functor `C × (D × E) ⥤ (C × D) × E `. -/ -@[simps] +@[local implicit_reducible, simps] def inverseAssociator : C × D × E ⥤ (C × D) × E where obj X := ((X.1, X.2.1), X.2.2) map := @fun _ _ f => (f.1 ×ₘ f.2.1) ×ₘ f.2.2 @@ -41,7 +58,7 @@ def inverseAssociator : C × D × E ⥤ (C × D) × E where set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories expressing associativity of products of categories. -/ -@[simps] +@[local implicit_reducible, simps] def associativity : (C × D) × E ≌ C × D × E where functor := associator C D E inverse := inverseAssociator C D E @@ -78,7 +95,7 @@ def functorProdToProdFunctorAssociator : /-- The equivalence swapping the second and third categories in `(A × C) × (D × E)`. This follows the definition of `MonoidalCategory.tensorμ`. -/ -@[simps!] +@[local implicit_reducible, simps!] def prodμ : (A × C) × (D × E) ≌ (A × D) × (C × E) := (associativity ..).trans <| (Equivalence.refl.prod (associativity ..).symm).trans <| diff --git a/Mathlib/CategoryTheory/Products/Basic.lean b/Mathlib/CategoryTheory/Products/Basic.lean index 88f4a206fd6821..928a4d108aad47 100644 --- a/Mathlib/CategoryTheory/Products/Basic.lean +++ b/Mathlib/CategoryTheory/Products/Basic.lean @@ -220,7 +220,7 @@ variable (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D] `(evaluation.obj X).obj F = F.obj X`, which is functorial in both `X` and `F`. -/ -@[simps] +@[simps, implicit_reducible] def evaluation : C ⥤ (C ⥤ D) ⥤ D where obj X := { obj := fun F => F.obj X @@ -252,7 +252,7 @@ variable {A : Type u₁} [Category.{v₁} A] {B : Type u₂} [Category.{v₂} B] namespace Functor /-- The Cartesian product of two functors. -/ -@[simps] +@[simps, implicit_reducible] def prod (F : A ⥤ B) (G : C ⥤ D) : A × C ⥤ B × D where obj X := (F.obj X.1, G.obj X.2) map f := F.map f.1 ×ₘ G.map f.2 @@ -318,6 +318,7 @@ def prodFunctor : (A ⥤ B) × (C ⥤ D) ⥤ A × C ⥤ B × D where namespace NatIso +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The Cartesian product of two natural isomorphisms. -/ @[simps] @@ -330,6 +331,7 @@ end NatIso namespace Equivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The Cartesian product of two equivalences of categories. -/ @[simps] @@ -399,6 +401,7 @@ def functorProdToProdFunctor : (A ⥤ B × C) ⥤ (A ⥤ B) × (A ⥤ C) where obj F := ⟨F ⋙ CategoryTheory.Prod.fst B C, F ⋙ CategoryTheory.Prod.snd B C⟩ map α := whiskerRight α _ ×ₘ whiskerRight α _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit isomorphism for `functorProdFunctorEquiv` -/ @[simps!] @@ -408,6 +411,7 @@ def functorProdFunctorEquivUnitIso : Functor.prod'CompFst F.fst F.snd |>.prod (Functor.prod'CompSnd F.fst F.snd) |>.trans (prod.etaIso F) |>.symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The counit isomorphism for `functorProdFunctorEquiv` -/ @[simps!] @@ -415,6 +419,7 @@ def functorProdFunctorEquivCounitIso : functorProdToProdFunctor A B C ⋙ prodFunctorToFunctorProd A B C ≅ 𝟭 _ := NatIso.ofComponents fun F => NatIso.ofComponents fun X => prod.etaIso (F.obj X) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories between `(A ⥤ B) × (A ⥤ C)` and `A ⥤ (B × C)` -/ @[simps] diff --git a/Mathlib/CategoryTheory/Quotient.lean b/Mathlib/CategoryTheory/Quotient.lean index f91fb662557a3f..78d8256cb3c84d 100644 --- a/Mathlib/CategoryTheory/Quotient.lean +++ b/Mathlib/CategoryTheory/Quotient.lean @@ -159,6 +159,7 @@ theorem comp_mk {a b c : Quotient r} (f : a.as ⟶ b.as) (g : b.as ⟶ c.as) : comp r (Quot.mk _ f) (Quot.mk _ g) = Quot.mk _ (f ≫ g) := rfl +set_option backward.isDefEq.respectTransparency.types false in instance category : Category (Quotient r) where Hom := Hom r id a := Quot.mk _ (𝟙 a.as) @@ -189,6 +190,7 @@ theorem inv_mk {X Y : Quotient r} (f : X.as ⟶ Y.as) : Quotient.inv r (Quot.mk _ f) = Quot.mk _ (Groupoid.inv f) := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The quotient of a groupoid is a groupoid. -/ instance groupoid : Groupoid (Quotient r) where inv f := Quotient.inv r f @@ -202,6 +204,7 @@ def functor : C ⥤ Quotient r where obj a := { as := a } map f := Quot.mk _ f +set_option backward.isDefEq.respectTransparency.types false in instance full_functor : (functor r).Full where map_surjective f := ⟨Quot.out f, by simp [functor]⟩ @@ -235,6 +238,7 @@ theorem functor_homRel_eq_compClosure_eqvGen {X Y : C} (f g : X ⟶ Y) : (functor r).homRel f g ↔ Relation.EqvGen (@HomRel.CompClosure C _ r X Y) f g := Quot.eq +set_option backward.isDefEq.respectTransparency.types false in theorem compClosure.congruence : Congruence fun X Y => Relation.EqvGen (@HomRel.CompClosure C _ r X Y) := by convert! (inferInstance : Congruence (functor r).homRel) diff --git a/Mathlib/CategoryTheory/Quotient/Linear.lean b/Mathlib/CategoryTheory/Quotient/Linear.lean index d17a32660e0f4b..80adbcb798930a 100644 --- a/Mathlib/CategoryTheory/Quotient/Linear.lean +++ b/Mathlib/CategoryTheory/Quotient/Linear.lean @@ -33,7 +33,7 @@ variable {R C : Type*} [Semiring R] [Category* C] [Preadditive C] [Linear R C] namespace Linear /-- The scalar multiplications on morphisms in `Quotient R`. -/ -@[implicit_reducible] +@[instance_reducible] def smul (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f₂), r (a • f₁) (a • f₂)) (X Y : Quotient r) : SMul R (X ⟶ Y) where smul a := Quot.lift (fun g => Quot.mk _ (a • g)) (fun f₁ f₂ h₁₂ => by @@ -50,7 +50,7 @@ lemma smul_eq (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ /-- Auxiliary definition for `Quotient.Linear.module`. -/ -@[implicit_reducible] +@[instance_reducible] def module' (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f₂), r (a • f₁) (a • f₂)) [Preadditive (Quotient r)] [(functor r).Additive] (X Y : C) : Module R ((functor r).obj X ⟶ (functor r).obj Y) := @@ -80,7 +80,7 @@ def module' (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f rw [add_smul, Functor.map_add] } /-- Auxiliary definition for `Quotient.linear`. -/ -@[implicit_reducible] +@[instance_reducible] def module (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f₂), r (a • f₁) (a • f₂)) [Preadditive (Quotient r)] [(functor r).Additive] (X Y : Quotient r) : Module R (X ⟶ Y) := module' r hr X.as Y.as @@ -94,7 +94,7 @@ set_option backward.isDefEq.respectTransparency false in such that `functor r : C ⥤ Quotient r` is additive, and that `C` has an `R`-linear category structure compatible with `r`, this is the induced `R`-linear category structure on `Quotient r`. -/ -@[implicit_reducible] +@[instance_reducible] def linear (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f₂), r (a • f₁) (a • f₂)) [Preadditive (Quotient r)] [(functor r).Additive] : Linear R (Quotient r) := by letI := Linear.module r hr diff --git a/Mathlib/CategoryTheory/Quotient/Preadditive.lean b/Mathlib/CategoryTheory/Quotient/Preadditive.lean index 633b61c185ff24..2114c2bd04d4d7 100644 --- a/Mathlib/CategoryTheory/Quotient/Preadditive.lean +++ b/Mathlib/CategoryTheory/Quotient/Preadditive.lean @@ -57,7 +57,7 @@ end Preadditive /-- The preadditive structure on the category `Quotient r` when `r` is compatible with the addition. -/ -@[implicit_reducible] +@[instance_reducible] def preadditive (hr : ∀ ⦃X Y : C⦄ (f₁ f₂ g₁ g₂ : X ⟶ Y) (_ : r f₁ f₂) (_ : r g₁ g₂), r (f₁ + g₁) (f₂ + g₂)) : Preadditive (Quotient r) where diff --git a/Mathlib/CategoryTheory/Shift/Adjunction.lean b/Mathlib/CategoryTheory/Shift/Adjunction.lean index e83e02ed9beffc..7ec4b99149719d 100644 --- a/Mathlib/CategoryTheory/Shift/Adjunction.lean +++ b/Mathlib/CategoryTheory/Shift/Adjunction.lean @@ -394,7 +394,7 @@ open RightAdjointCommShift in Given an adjunction `F ⊣ G` and a `CommShift` structure on `F`, this constructs the unique compatible `CommShift` structure on `G`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] noncomputable def rightAdjointCommShift [F.CommShift A] : G.CommShift A where commShiftIso a := iso adj a commShiftIso_zero := by @@ -483,7 +483,7 @@ open LeftAdjointCommShift in Given an adjunction `F ⊣ G` and a `CommShift` structure on `G`, this constructs the unique compatible `CommShift` structure on `F`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] noncomputable def leftAdjointCommShift [G.CommShift A] : F.CommShift A where commShiftIso a := iso adj a commShiftIso_zero := by @@ -613,7 +613,7 @@ variable (A : Type*) [AddGroup A] [HasShift C A] [HasShift D A] If `E : C ≌ D` is an equivalence and we have a `CommShift` structure on `E.functor`, this constructs the unique compatible `CommShift` structure on `E.inverse`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def commShiftInverse [E.functor.CommShift A] : E.inverse.CommShift A := E.toAdjunction.rightAdjointCommShift A @@ -627,7 +627,7 @@ lemma commShift_of_functor [E.functor.CommShift A] : If `E : C ≌ D` is an equivalence and we have a `CommShift` structure on `E.inverse`, this constructs the unique compatible `CommShift` structure on `E.functor`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def commShiftFunctor [E.inverse.CommShift A] : E.functor.CommShift A := E.symm.toAdjunction.rightAdjointCommShift A diff --git a/Mathlib/CategoryTheory/Shift/Basic.lean b/Mathlib/CategoryTheory/Shift/Basic.lean index 512b3a71c90453..cd3aee3ce78d6e 100644 --- a/Mathlib/CategoryTheory/Shift/Basic.lean +++ b/Mathlib/CategoryTheory/Shift/Basic.lean @@ -153,7 +153,7 @@ instance (h : ShiftMkCore C A) : (Discrete.functor h.F).Monoidal := simp [h.add_zero_inv_app] } /-- Constructs a `HasShift C A` instance from `ShiftMkCore`. -/ -@[implicit_reducible] +@[instance_reducible] def hasShiftMk (h : ShiftMkCore C A) : HasShift C A where shift := Discrete.functor h.F @@ -163,6 +163,7 @@ section variable [HasShift C A] /-- The monoidal functor from `A` to `C ⥤ C` given a `HasShift` instance. -/ +@[implicit_reducible] def shiftMonoidalFunctor : Discrete A ⥤ C ⥤ C := HasShift.shift @@ -173,6 +174,7 @@ variable {A} open Functor.Monoidal /-- The shift autoequivalence, moving objects and morphisms 'up'. -/ +@[implicit_reducible] def shiftFunctor (i : A) : C ⥤ C := (shiftMonoidalFunctor C A).obj ⟨i⟩ @@ -238,6 +240,7 @@ lemma shiftFunctorAdd'_zero_add (a : A) : eqToHom_map, Category.id_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma shiftFunctorAdd'_add_zero (a : A) : shiftFunctorAdd' C a 0 a (add_zero a) = (rightUnitor _).symm ≪≫ @@ -741,6 +744,7 @@ def zero : s 0 ≅ 𝟭 C := (hF.whiskeringRight C).preimageIso ((i 0) ≪≫ isoWhiskerLeft F (shiftFunctorZero D A) ≪≫ rightUnitor _ ≪≫ (leftUnitor _).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma map_zero_hom_app (X : C) : @@ -748,6 +752,7 @@ lemma map_zero_hom_app (X : C) : (i 0).hom.app X ≫ (shiftFunctorZero D A).hom.app (F.obj X) := by simp [zero] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma map_zero_inv_app (X : C) : @@ -762,6 +767,7 @@ def add (a b : A) : s (a + b) ≅ s a ⋙ s b := associator _ _ _ ≪≫ (isoWhiskerLeft _ (i b).symm) ≪≫ (associator _ _ _).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma map_add_hom_app (a b : A) (X : C) : @@ -771,6 +777,7 @@ lemma map_add_hom_app (a b : A) (X : C) : dsimp [add] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma map_add_inv_app (a b : A) (X : C) : @@ -787,7 +794,7 @@ set_option backward.isDefEq.respectTransparency false in open hasShift in /-- Given a family of endomorphisms of `C` which are intertwined by a fully faithful `F : C ⥤ D` with shift functors on `D`, we can promote that family to shift functors on `C`. -/ -@[implicit_reducible] +@[instance_reducible] def hasShift : HasShift C A := hasShiftMk C A diff --git a/Mathlib/CategoryTheory/Shift/CommShift.lean b/Mathlib/CategoryTheory/Shift/CommShift.lean index 7f8d6bd467a2dd..5b6a726ee10c63 100644 --- a/Mathlib/CategoryTheory/Shift/CommShift.lean +++ b/Mathlib/CategoryTheory/Shift/CommShift.lean @@ -463,7 +463,7 @@ variable {C D E : Type*} [Category* C] [Category* D] set_option backward.isDefEq.respectTransparency false in /-- If `e : F ≅ G` is an isomorphism of functors and if `F` commutes with the shift, then `G` also commutes with the shift. -/ -@[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app, implicit_reducible] +@[simps! -isSimp commShiftIso_hom_app commShiftIso_inv_app, instance_reducible] def ofIso : G.CommShift A where commShiftIso a := isoWhiskerLeft _ e.symm ≪≫ F.commShiftIso a ≪≫ isoWhiskerRight e _ commShiftIso_zero := by @@ -504,7 +504,7 @@ set_option backward.isDefEq.respectTransparency false in /-- If `F : C ⥤ D` is a fully faithful functor which is used to construct a shift by `A` on `C` from a shift on `D`, then the functor `F` itself commutes with the shift by `A`. -/ -@[implicit_reducible] +@[instance_reducible] def ofHasShiftOfFullyFaithful : letI := hF.hasShift s i; F.CommShift A := by letI := hF.hasShift s i @@ -580,7 +580,7 @@ end OfComp set_option backward.isDefEq.respectTransparency false in /-- Given an isomorphism `e : F ⋙ G ≅ H` where `G` is fully faithful, the functor `F` commutes with shifts by `A` if `G` and `H` do. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofComp : F.CommShift A where commShiftIso := OfComp.iso e commShiftIso_zero := by diff --git a/Mathlib/CategoryTheory/Shift/CommShiftTwo.lean b/Mathlib/CategoryTheory/Shift/CommShiftTwo.lean index 52607c03e7b794..f9a6e802698e2e 100644 --- a/Mathlib/CategoryTheory/Shift/CommShiftTwo.lean +++ b/Mathlib/CategoryTheory/Shift/CommShiftTwo.lean @@ -133,6 +133,7 @@ instance precomp₁ {M : Type*} [AddCommMonoid M] [HasShift C₁ M] [HasShift C rw [NatTrans.shift_app (G.map ((F.commShiftIso m).hom.app X₁')) n X₂] simp [this] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in set_option backward.inferInstanceAs.wrap false in instance precomp₂ {M : Type*} [AddCommMonoid M] [HasShift C₁ M] [HasShift C₂' M] @@ -186,6 +187,7 @@ instance : CommShift₂ (𝟙 G₁) h where simp only [flipApp, flipFunctor_obj, Functor.map_id, id_app] infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [CommShift₂ τ h] [CommShift₂ τ' h] : CommShift₂ (τ ≫ τ') h where commShift_app _ := by dsimp; infer_instance diff --git a/Mathlib/CategoryTheory/Shift/Induced.lean b/Mathlib/CategoryTheory/Shift/Induced.lean index c6eff67b0a7bf6..a433c3619c9886 100644 --- a/Mathlib/CategoryTheory/Shift/Induced.lean +++ b/Mathlib/CategoryTheory/Shift/Induced.lean @@ -99,7 +99,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in /-- When `F : C ⥤ D` is a functor satisfying suitable technical assumptions, this is the induced term of type `HasShift D A` deduced from `[HasShift C A]`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def induced : HasShift D A := hasShiftMk D A { F := s @@ -174,6 +174,7 @@ lemma shiftFunctor_of_induced (a : A) : variable (A) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctorZero_hom_app_obj_of_induced (X : C) : letI := HasShift.induced F A s i @@ -181,6 +182,7 @@ lemma shiftFunctorZero_hom_app_obj_of_induced (X : C) : (i 0).hom.app X ≫ F.map ((shiftFunctorZero C A).hom.app X) := by simp only [ShiftMkCore.shiftFunctorZero_eq, HasShift.Induced.zero_hom_app_obj] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctorZero_inv_app_obj_of_induced (X : C) : letI := HasShift.induced F A s i @@ -190,6 +192,7 @@ lemma shiftFunctorZero_inv_app_obj_of_induced (X : C) : variable {A} +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctorAdd_hom_app_obj_of_induced (a b : A) (X : C) : letI := HasShift.induced F A s i @@ -200,6 +203,7 @@ lemma shiftFunctorAdd_hom_app_obj_of_induced (a b : A) (X : C) : (s b).map ((i a).inv.app X) := by simp only [ShiftMkCore.shiftFunctorAdd_eq, HasShift.Induced.add_hom_app_obj] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma shiftFunctorAdd_inv_app_obj_of_induced (a b : A) (X : C) : letI := HasShift.induced F A s i @@ -217,7 +221,7 @@ set_option backward.isDefEq.respectTransparency false in /-- When the target category of a functor `F : C ⥤ D` is equipped with the induced shift, this is the compatibility of `F` with the shifts on the categories `C` and `D`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Functor.CommShift.ofInduced : letI := HasShift.induced F A s i F.CommShift A := by diff --git a/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean b/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean index fb53dc2a94bbb5..81394bdf986a84 100644 --- a/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean +++ b/Mathlib/CategoryTheory/Shift/InducedShiftSequence.lean @@ -86,7 +86,7 @@ set_option backward.isDefEq.respectTransparency false in equipped with isomorphisms `e' : ∀ m, L ⋙ F' m ≅ G.shift m`, this is the shift sequence induced on `F` induced by a shift sequence for the functor `G`, provided that the functor `(whiskeringLeft C D A).obj L` of precomposition by `L` is fully faithful. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def induced : F.ShiftSequence M where sequence := F' isoZero := induced.isoZero e M F' e' diff --git a/Mathlib/CategoryTheory/Shift/Localization.lean b/Mathlib/CategoryTheory/Shift/Localization.lean index ba1303396ea965..47a26179a6cc99 100644 --- a/Mathlib/CategoryTheory/Shift/Localization.lean +++ b/Mathlib/CategoryTheory/Shift/Localization.lean @@ -76,7 +76,7 @@ variable [W.IsCompatibleWithShift A] /-- When `L : C ⥤ D` is a localization functor with respect to a morphism property `W` that is compatible with the shift by a monoid `A` on `C`, this is the induced shift on the category `D`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def HasShift.localized : HasShift D A := have := Localization.full_whiskeringLeft L W D have := Localization.faithful_whiskeringLeft L W D @@ -86,7 +86,7 @@ noncomputable def HasShift.localized : HasShift D A := (fun _ => Localization.fac _ _ _) /-- The localization functor `L : C ⥤ D` is compatible with the shift. -/ -@[nolint unusedHavesSuffices, implicit_reducible] +@[nolint unusedHavesSuffices, instance_reducible] noncomputable def Functor.CommShift.localized : @Functor.CommShift _ _ _ _ L A _ _ (HasShift.localized L W A) := have := Localization.full_whiskeringLeft L W D @@ -175,7 +175,7 @@ set_option backward.isDefEq.respectTransparency false in /-- In the context of localization of categories, if a functor is induced by a functor which commutes with the shift, then this functor commutes with the shift. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def commShiftOfLocalization : F'.CommShift A where commShiftIso := commShiftOfLocalization.iso L W F F' commShiftIso_zero := by @@ -275,7 +275,7 @@ variable (M) in `e : Φ.functor ⋙ L₂ ≅ L₁ ⋙ G` is an isomorphism, `Φ` is a localizer morphism and `L₁` is a localization functor. We assume that all categories involved are equipped with shifts and that `L₁`, `L₂` and `Φ.functor` commute to them. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def commShift : G.CommShift M := by letI : Localization.Lifting L₁ W₁ (Φ.functor ⋙ L₂) G := ⟨e.symm⟩ exact Functor.commShiftOfLocalization L₁ W₁ M (Φ.functor ⋙ L₂) G diff --git a/Mathlib/CategoryTheory/Shift/Opposite.lean b/Mathlib/CategoryTheory/Shift/Opposite.lean index 9594e4a4e51096..5d321df55acd23 100644 --- a/Mathlib/CategoryTheory/Shift/Opposite.lean +++ b/Mathlib/CategoryTheory/Shift/Opposite.lean @@ -129,12 +129,14 @@ lemma oppositeShiftFunctorAdd_hom_app : Iso.hom_inv_id_app, op_id] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma oppositeShiftFunctorAdd'_inv_app : (shiftFunctorAdd' (OppositeShift C A) a b c h).inv.app X = ((shiftFunctorAdd' C a b c h).hom.app X.unop).op := by subst h simp only [shiftFunctorAdd'_eq_shiftFunctorAdd, oppositeShiftFunctorAdd_inv_app] +set_option backward.isDefEq.respectTransparency.types false in lemma oppositeShiftFunctorAdd'_hom_app : (shiftFunctorAdd' (OppositeShift C A) a b c h).hom.app X = ((shiftFunctorAdd' C a b c h).inv.app X.unop).op := by @@ -165,6 +167,7 @@ def OppositeShift.natTrans {G : C ⥤ D} (τ : F ⟶ G) : namespace Functor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a `CommShift` structure on `F`, this is the corresponding `CommShift` structure on @@ -188,6 +191,7 @@ instance commShiftOp [CommShift F A] : erw [oppositeShiftFunctorAdd_inv_app, oppositeShiftFunctorAdd_hom_app] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma commShiftOp_iso_eq [CommShift F A] (a : A) : (OppositeShift.functor A F).commShiftIso a = (NatIso.op (F.commShiftIso a)).symm := rfl @@ -196,7 +200,7 @@ set_option backward.isDefEq.respectTransparency false in Given a `CommShift` structure on `OppositeShift.functor F` (for the naive shifts on the opposite categories), this is the corresponding `CommShift` structure on `F`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def commShiftUnop [CommShift (OppositeShift.functor A F) A] : CommShift F A where commShiftIso a := NatIso.removeOp ((OppositeShift.functor A F).commShiftIso a).symm diff --git a/Mathlib/CategoryTheory/Shift/Pullback.lean b/Mathlib/CategoryTheory/Shift/Pullback.lean index fbe6cea8ac976e..8596a7ddc41666 100644 --- a/Mathlib/CategoryTheory/Shift/Pullback.lean +++ b/Mathlib/CategoryTheory/Shift/Pullback.lean @@ -109,6 +109,7 @@ lemma pullbackShiftFunctorZero'_hom_app : pullbackShiftFunctorZero'_inv_app, assoc, Iso.inv_hom_id_app_assoc, Iso.inv_hom_id_app] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma pullbackShiftFunctorAdd'_inv_app : (shiftFunctorAdd' _ a₁ a₂ a₃ h).inv.app X = (shiftFunctor (PullbackShift C φ) a₂).map ((pullbackShiftIso C φ a₁ b₁ h₁).hom.app X) ≫ diff --git a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean index 47ada4ddad480f..3bf75498520505 100644 --- a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean +++ b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean @@ -60,7 +60,7 @@ class ShiftSequence where set_option backward.defeqAttrib.useBackward true in /-- The tautological shift sequence on a functor. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ShiftSequence.tautological : ShiftSequence F M where sequence n := shiftFunctor C n ⋙ F isoZero := isoWhiskerRight (shiftFunctorZero C M) F ≪≫ F.leftUnitor diff --git a/Mathlib/CategoryTheory/ShrinkYoneda.lean b/Mathlib/CategoryTheory/ShrinkYoneda.lean index 63e7aa9a203fae..53a5e78672c74b 100644 --- a/Mathlib/CategoryTheory/ShrinkYoneda.lean +++ b/Mathlib/CategoryTheory/ShrinkYoneda.lean @@ -70,6 +70,7 @@ set_option backward.defeqAttrib.useBackward true in instance (X : C) : FunctorToTypes.Small.{w} (yoneda.obj X) := fun _ ↦ by dsimp; infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- The Yoneda embedding `C ⥤ Cᵒᵖ ⥤ Type w` for a locally `w`-small category `C`. -/ @[simps -isSimp obj map, pp_with_univ] noncomputable def shrinkYoneda : @@ -77,6 +78,7 @@ noncomputable def shrinkYoneda : obj X := FunctorToTypes.shrink (yoneda.obj X) map f := FunctorToTypes.shrinkMap (yoneda.map f) +set_option backward.isDefEq.respectTransparency.types false in /-- The type `(shrinkYoneda.obj X).obj Y` is equivalent to `Y.unop ⟶ X`. -/ noncomputable def shrinkYonedaObjObjEquiv {X : C} {Y : Cᵒᵖ} : ((shrinkYoneda.{w}.obj X).obj Y) ≃ (Y.unop ⟶ X) := @@ -150,6 +152,7 @@ lemma shrinkYonedaEquiv_shrinkYoneda_map {X Y : C} (f : X ⟶ Y) : shrinkYonedaEquiv (shrinkYoneda.{w}.map f) = shrinkYonedaObjObjEquiv.symm f := by simp [shrinkYonedaEquiv, shrinkYoneda, shrinkYonedaObjObjEquiv] +set_option backward.isDefEq.respectTransparency.types false in lemma shrinkYonedaEquiv_comp {X : C} {P Q : Cᵒᵖ ⥤ Type w} (α : shrinkYoneda.obj X ⟶ P) (β : P ⟶ Q) : shrinkYonedaEquiv (α ≫ β) = β.app _ (shrinkYonedaEquiv α) := by @@ -178,6 +181,7 @@ lemma shrinkYonedaEquiv_symm_app_shrinkYonedaObjObjEquiv_symm {X : C} {P : Cᵒ obtain ⟨g, rfl⟩ := shrinkYonedaEquiv.surjective s simp [map_shrinkYonedaEquiv] +set_option backward.isDefEq.respectTransparency.types false in variable (C) in /-- The functor `shrinkYoneda : C ⥤ Cᵒᵖ ⥤ Type w` for a locally `w`-small category `C` is fully faithful. -/ diff --git a/Mathlib/CategoryTheory/SingleObj.lean b/Mathlib/CategoryTheory/SingleObj.lean index 654702d8b0fb55..5380231ec5266f 100644 --- a/Mathlib/CategoryTheory/SingleObj.lean +++ b/Mathlib/CategoryTheory/SingleObj.lean @@ -133,6 +133,7 @@ theorem mapHom_comp (f : M →* N) {P : Type w} [Monoid P] (g : N →* P) : variable {C : Type v} [Category.{w} C] +set_option backward.isDefEq.respectTransparency.types false in /-- Given a function `f : C → G` from a category to a group, we get a functor `C ⥤ G` sending any morphism `x ⟶ y` to `f y * (f x)⁻¹`. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Sites/Canonical.lean b/Mathlib/CategoryTheory/Sites/Canonical.lean index d28cdafc3cf167..4541e69072c4bf 100644 --- a/Mathlib/CategoryTheory/Sites/Canonical.lean +++ b/Mathlib/CategoryTheory/Sites/Canonical.lean @@ -164,7 +164,7 @@ variable (J : GrothendieckTopology C) If `J` is subcanonical, we obtain a "Yoneda" functor from the defining site into the sheaf category. -/ -@[simps! obj_obj map_hom] +@[simps! obj_obj map_hom, implicit_reducible] def yoneda [J.Subcanonical] : C ⥤ Sheaf J (Type v) := ObjectProperty.lift _ CategoryTheory.yoneda <| fun X ↦ by rw [isSheaf_iff_isSheaf_of_type] diff --git a/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean b/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean index 994ca69622a51f..c99d4297499fc7 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean @@ -215,6 +215,7 @@ theorem parallelPair_pullback_initial {X B : C} (π : X ⟶ B) refine ⟨Quiver.Hom.op (ObjectProperty.homMk (Over.homMk ij)), ?_, ?_⟩ all_goals congr; aesop +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a limiting pullback cone, the fork in `SingleEqualizerCondition` is limiting iff the diagram diff --git a/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean b/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean index f7951629f943f5..197567d5666846 100644 --- a/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean +++ b/Mathlib/CategoryTheory/Sites/Coherent/SheafComparison.lean @@ -258,6 +258,7 @@ theorem isSheaf_iff_extensiveSheaf_of_projective [Preregular C] [FinitaryExtensi IsSheaf (coherentTopology C) F ↔ IsSheaf (extensiveTopology C) F := by rw [isSheaf_iff_preservesFiniteProducts_of_projective, isSheaf_iff_preservesFiniteProducts] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The categories of coherent sheaves and extensive sheaves on `C` are equivalent if `C` is diff --git a/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean b/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean index d0d88b9b53d618..2be9a63c54acc4 100644 --- a/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/CompatibleSheafification.lean @@ -74,6 +74,7 @@ theorem sheafificationWhiskerLeftIso_hom_app (P : Cᵒᵖ ⥤ D) (F : D ⥤ E) dsimp [sheafificationWhiskerLeftIso, sheafifyCompIso] simp only [sheafify, Category.comp_id] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem sheafificationWhiskerLeftIso_inv_app (P : Cᵒᵖ ⥤ D) (F : D ⥤ E) diff --git a/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean b/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean index 05152c715b8756..824c7d89917782 100644 --- a/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean @@ -117,6 +117,7 @@ theorem equiv_apply {X : C} {P : Cᵒᵖ ⥤ D} {S : J.Cover X} [HasMultiequaliz equiv P S x I = Multiequalizer.ι (S.index P) I x := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem equiv_symm_eq_apply {X : C} {P : Cᵒᵖ ⥤ D} {S : J.Cover X} [HasMultiequalizer (S.index P)] (x : Meq P S) (I : S.Arrow) : -- We can hint `ConcreteCategory.hom (Y := P.obj (op I.Y))` below to put it into `simp`-normal @@ -203,6 +204,7 @@ theorem toPlus_eq_mk {X : C} {P : Cᵒᵖ ⥤ D} (x : ToType (P.obj (op X))) : variable [∀ X : C, PreservesColimitsOfShape (J.Cover X)ᵒᵖ (forget D)] +set_option backward.isDefEq.respectTransparency.types false in theorem exists_rep {X : C} {P : Cᵒᵖ ⥤ D} (x : ToType ((J.plusObj P).obj (op X))) : ∃ (S : J.Cover X) (y : Meq P S), x = mk y := by obtain ⟨S, y, h⟩ := Concrete.colimit_exists_rep (J.diagram P X) x @@ -239,6 +241,7 @@ theorem eq_mk_iff_exists {X : C} {P : Cᵒᵖ ⥤ D} {S T : J.Cover X} (x : Meq erw [Meq.equiv_symm_eq_apply] cases i; rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `P⁺` is always separated. -/ theorem sep {X : C} (P : Cᵒᵖ ⥤ D) (S : J.Cover X) (x y : ToType ((J.plusObj P).obj (op X))) (h : ∀ I : S.Arrow, (J.plusObj P).map I.f.op x = (J.plusObj P).map I.f.op y) : x = y := by @@ -285,6 +288,7 @@ theorem sep {X : C} (P : Cᵒᵖ ⥤ D) (S : J.Cover X) (x y : ToType ((J.plusOb · exact x.congr_apply I.middle_spec.symm _ · exact y.congr_apply I.middle_spec.symm _ +set_option backward.isDefEq.respectTransparency.types false in theorem inj_of_sep (P : Cᵒᵖ ⥤ D) (hsep : ∀ (X : C) (S : J.Cover X) (x y : ToType (P.obj (op X))), @@ -519,6 +523,7 @@ theorem toSheafify_sheafifyLift {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Presh dsimp only [sheafifyLift, toSheafify] simp +set_option backward.isDefEq.respectTransparency.types false in theorem sheafifyLift_unique {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Presheaf.IsSheaf J Q) (γ : J.sheafify P ⟶ Q) : J.toSheafify P ≫ γ = η → γ = sheafifyLift J η hQ := by intro h @@ -533,6 +538,7 @@ theorem isoSheafify_inv {P : Cᵒᵖ ⥤ D} (hP : Presheaf.IsSheaf J P) : apply J.sheafifyLift_unique simp [Iso.comp_inv_eq] +set_option backward.isDefEq.respectTransparency.types false in theorem sheafify_hom_ext {P Q : Cᵒᵖ ⥤ D} (η γ : J.sheafify P ⟶ Q) (hQ : Presheaf.IsSheaf J Q) (h : J.toSheafify P ≫ η = J.toSheafify P ≫ γ) : η = γ := by apply J.plus_hom_ext _ _ hQ diff --git a/Mathlib/CategoryTheory/Sites/Continuous.lean b/Mathlib/CategoryTheory/Sites/Continuous.lean index 9e2731416f66d1..95056174684230 100644 --- a/Mathlib/CategoryTheory/Sites/Continuous.lean +++ b/Mathlib/CategoryTheory/Sites/Continuous.lean @@ -89,6 +89,7 @@ section variable {E} {W : C} {i₁ i₂ : E.I₀} (p₁ : W ⟶ E.X i₁) (p₂ : W ⟶ E.X i₂) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma functorPushforward_sieve₁_map_le : Sieve.functorPushforward F (E.sieve₁ p₁ p₂) ≤ (E.map F).sieve₁ (F.map p₁) (F.map p₂) := by @@ -232,7 +233,6 @@ private lemma isSheaf_of_isContinuous_aux (F : C ⥤ D) [Functor.IsContinuous F Iso.trans_hom, Iso.symm_hom, Functor.mapIso_inv, Iso.app_inv, Category.assoc] rw [← Functor.map_comp_assoc, ← dsimp% e.inv.naturality, ← Functor.map_comp_assoc, Sieve.shrinkFunctorUliftFunctorIso_inv_ι] - rfl rw [K.W.arrow_mk_iso_iff iso] apply GrothendieckTopology.W_of_preservesSheafification exact F.W_map_of_adjunction_of_isContinuous_aux J K H adj @@ -373,6 +373,7 @@ def sheafPushforwardContinuousComp [IsContinuous G K L] : sheafPushforwardContinuous G A K L ⋙ sheafPushforwardContinuous F A J K ≅ sheafPushforwardContinuous (F ⋙ G) A J L := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {F F'} in /-- The action of a natural transformation on pushforward functors of sheaves. -/ @@ -381,6 +382,7 @@ def sheafPushforwardContinuousNatTrans [IsContinuous F' J K] : sheafPushforwardContinuous F' A J K ⟶ sheafPushforwardContinuous F A J K where app M := ⟨whiskerRight (NatTrans.op τ) _⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {F F'} in /-- The action of a natural isomorphism on pushforward functors of sheaves. -/ @@ -392,6 +394,7 @@ def sheafPushforwardContinuousIso [IsContinuous F' J K] : hom_inv_id := by ext; simp [← Functor.map_comp, ← op_comp] inv_hom_id := by ext; simp [← Functor.map_comp, ← op_comp] +set_option backward.isDefEq.respectTransparency.types false in /-- If a continuous functor between sites is isomorphic to the identity functor, then the corresponding pushforward functor on sheaves identifies to the identity functor. -/ @@ -400,6 +403,7 @@ def sheafPushforwardContinuousId' [IsContinuous F'' J J] : sheafPushforwardContinuous F'' A J J ≅ 𝟭 _ := sheafPushforwardContinuousIso eF'' _ _ _ ≪≫ sheafPushforwardContinuousId _ _ +set_option backward.isDefEq.respectTransparency.types false in variable {F G} in /-- When we have an isomorphism `F ⋙ G ≅ FG` between continuous functors between sites, the composition of the pushforward functors for @@ -414,6 +418,7 @@ def sheafPushforwardContinuousComp' end Functor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F ⊣ G` is an adjunction between continuous functors, the associated pushforwards on sheaves are adjoint. -/ diff --git a/Mathlib/CategoryTheory/Sites/CoverLifting.lean b/Mathlib/CategoryTheory/Sites/CoverLifting.lean index 03ed89ebd24bf7..858082ad99db2d 100644 --- a/Mathlib/CategoryTheory/Sites/CoverLifting.lean +++ b/Mathlib/CategoryTheory/Sites/CoverLifting.lean @@ -164,6 +164,7 @@ def liftAux {Y : C} (f : G.obj Y ⟶ X) : s.pt ⟶ F.obj (op Y) := r.w := by simpa using G.congr_map w =≫ f .. }) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma liftAux_map {Y : C} (f : G.obj Y ⟶ X) {W : C} (g : W ⟶ Y) (i : S.Arrow) (h : G.obj W ⟶ i.Y) (w : h ≫ i.f = G.map g ≫ f) : @@ -212,6 +213,7 @@ lemma fac' (j : StructuredArrow (op X) G.op) : lift hF hR s ≫ R.map j.hom ≫ α.app j.right = liftAux hF α s j.hom.unop := by apply IsLimit.fac +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma fac (i : S.Arrow) : lift hF hR s ≫ R.map i.f.op = s.ι i := by diff --git a/Mathlib/CategoryTheory/Sites/CoverPreserving.lean b/Mathlib/CategoryTheory/Sites/CoverPreserving.lean index 1b28051ce64ce9..1d2c97bf827526 100644 --- a/Mathlib/CategoryTheory/Sites/CoverPreserving.lean +++ b/Mathlib/CategoryTheory/Sites/CoverPreserving.lean @@ -170,6 +170,7 @@ lemma Functor.isContinuous_of_coverPreserving (hF₁ : CompatiblePreserving.{max rintro Y _ ⟨Z, g, h, hg, rfl⟩ simpa using! congrArg _ ((hy₁ g hg).trans (hy₂ g hg).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `C` has pullbacks and `F : C ⥤ D` preserves pullbacks, any cover preserving functor preserves all `1`-hypercovers. -/ diff --git a/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean b/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean index 9e0d7e8ac1d319..6b7d84dcbb5f4f 100644 --- a/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean +++ b/Mathlib/CategoryTheory/Sites/DenseSubsite/Basic.lean @@ -506,6 +506,7 @@ instance full_sheafPushforwardContinuous [G.IsContinuous J K] : Full (G.sheafPushforwardContinuous A J K) where map_surjective α := ⟨⟨sheafHom α.hom⟩, Sheaf.hom_ext <| sheafHom_restrict_eq α.hom⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance faithful_sheafPushforwardContinuous [G.IsContinuous J K] : Faithful (G.sheafPushforwardContinuous A J K) where @@ -706,6 +707,7 @@ noncomputable def sheafifyHomEquivOfIsEquivalence ((G.sheafPushforwardContinuous A J K).asEquivalence.symm.toAdjunction.homEquiv _ _).trans (((sheafificationAdjunction J A).homEquiv _ _).trans IsCoverDense.restrictHomEquivHom) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma sheafifyHomEquivOfIsEquivalence_naturality_left {P₁ P₂ : Dᵒᵖ ⥤ A} (f : P₁ ⟶ P₂) {Q : Sheaf K A} @@ -728,6 +730,7 @@ lemma sheafifyHomEquivOfIsEquivalence_naturality_left apply adj₁.homEquiv_naturality_left · apply adj₂.homEquiv_naturality_left +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma sheafifyHomEquivOfIsEquivalence_naturality_right {P : Dᵒᵖ ⥤ A} {Q₁ Q₂ : Sheaf K A} diff --git a/Mathlib/CategoryTheory/Sites/DenseSubsite/OneHypercoverDense.lean b/Mathlib/CategoryTheory/Sites/DenseSubsite/OneHypercoverDense.lean index a37bcb9cb250e3..cc58bc109e4593 100644 --- a/Mathlib/CategoryTheory/Sites/DenseSubsite/OneHypercoverDense.lean +++ b/Mathlib/CategoryTheory/Sites/DenseSubsite/OneHypercoverDense.lean @@ -97,6 +97,7 @@ def multicospanIndex (P : C₀ᵒᵖ ⥤ A) : MulticospanIndex data.multicospanS fst j := P.map ((data.p₁ j.2).op) snd j := P.map ((data.p₂ j.2).op) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functoriality of the diagrams attached to `data : F.PreOneHypercoverDenseData X` with respect to morphisms in `C₀ᵒᵖ ⥤ A`. -/ @@ -213,6 +214,7 @@ section variable {X : C} (data : OneHypercoverDenseData.{w} F J₀ J X) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma mem₁ (i₁ i₂ : data.I₀) {W : C} (p₁ : W ⟶ F.obj (data.X i₁)) (p₂ : W ⟶ F.obj (data.X i₂)) (w : p₁ ≫ data.f i₁ = p₂ ≫ data.f i₂) : data.toPreOneHypercover.sieve₁ p₁ p₂ ∈ J W := by @@ -340,6 +342,7 @@ lemma liftAux_fac {i : (data X).I₀} {W₀ : C₀} (a : W₀ ⟶ (data X).X i) liftAux hG₀ s i ≫ G.map (F.map a).op = s.ι ⟨_, F.map a ≫ (data X).f i, ha⟩ := hG₀.amalgamate_map _ _ _ ⟨W₀, a, ha⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for the lemma `OneHypercoverDenseData.isSheaf_iff`. -/ noncomputable def lift : s.pt ⟶ G.obj (op X) := @@ -359,6 +362,7 @@ noncomputable def lift : s.pt ⟶ G.obj (op X) := congr 2 rw [map_comp_assoc, map_comp_assoc, (data X).w j]) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma lift_map (i : (data X).I₀) : lift hG₀ hG s ≫ G.map ((data X).f i).op = liftAux hG₀ s i := @@ -553,6 +557,7 @@ noncomputable def restriction {X : C} {X₀ : C₀} (f : F.obj X₀ ⟶ X) : apply presheafObj_mapPreimage_condition simp only [assoc, h₁.fac, h₂.fac, ← Functor.map_comp_assoc, w]) +set_option backward.isDefEq.respectTransparency.types false in lemma restriction_map {X : C} {X₀ : C₀} (f : F.obj X₀ ⟶ X) {Y₀ : C₀} (g : Y₀ ⟶ X₀) {i : (data X).I₀} (p : F.obj Y₀ ⟶ F.obj ((data X).X i)) (fac : p ≫ (data X).f i = F.map g ≫ f) : @@ -571,6 +576,7 @@ lemma restriction_eq_of_fac {X : C} {X₀ : C₀} (f : F.obj X₀ ⟶ X) presheafObjπ data G₀ X i ≫ IsDenseSubsite.mapPreimage J F G₀ p := by simpa using restriction_map data G₀ f (𝟙 _) p (by simpa using fac) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `OneHypercoverDenseData.essSurj.presheaf`. -/ noncomputable def presheafMap {X Y : C} (f : X ⟶ Y) : @@ -587,6 +593,7 @@ noncomputable def presheafMap {X Y : C} (f : X ⟶ Y) : rw [restriction_map (p := p), restriction_map (p := p)] all_goals simp_all) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma presheafMap_π {X Y : C} (f : X ⟶ Y) (i : (data X).I₀) : presheafMap data G₀ f ≫ presheafObjπ data G₀ X i = @@ -646,7 +653,7 @@ lemma presheafMap_comp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : be a family. Let `G₀` be a sheaf on `C₀`. This is a presheaf on `C` which extends `G₀` (see `OneHypercoverDenseData.essSurj.compPresheafIso`) and it is a sheaf (see `OneHypercoverDenseData.essSurj.isSheaf`). -/ -@[simps] +@[simps, implicit_reducible] noncomputable def presheaf : Cᵒᵖ ⥤ A where obj X := presheafObj data G₀ X.unop map f := presheafMap data G₀ f.unop @@ -689,6 +696,7 @@ lemma hom_map {W₀ : C₀} (a : W₀ ⟶ X₀) {i : (data (F.obj X₀)).I₀} (presheafObj_mapPreimage_condition _ _ _ _ _ _ _ ((Sieve.ofArrows.fac ha).trans fac.symm)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc] lemma hom_mapPreimage {W₀ : C₀} (a : F.obj W₀ ⟶ F.obj X₀) {i : (data (F.obj X₀)).I₀} @@ -706,6 +714,7 @@ lemma hom_mapPreimage {W₀ : C₀} (a : F.obj W₀ ⟶ F.obj X₀) {i : (data ( variable (X₀) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `OneHypercoverDenseData.essSurj.presheafObjObjIso`. -/ noncomputable def inv : G₀.obj.obj (op X₀) ⟶ (presheaf data G₀).obj (op (F.obj X₀)) := @@ -783,11 +792,13 @@ lemma presheafObjObjIso_inv_naturality {X₀ Y₀ : C₀} (f : X₀ ⟶ Y₀) : simp [presheafObjObjIso, IsDenseSubsite.mapPreimage_comp] +set_option backward.isDefEq.respectTransparency.types false in /-- The presheaf `presheaf data G₀` extends `G₀`. -/ noncomputable def compPresheafIso : F.op ⋙ presheaf data G₀ ≅ G₀.obj := (NatIso.ofComponents (fun _ ↦ (presheafObjObjIso data G₀ _).symm) (fun f ↦ presheafObjObjIso_inv_naturality data G₀ f.unop)).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isSheaf : Presheaf.IsSheaf J (presheaf data G₀) := by rw [isSheaf_iff data] diff --git a/Mathlib/CategoryTheory/Sites/Descent/DescentData.lean b/Mathlib/CategoryTheory/Sites/Descent/DescentData.lean index 0330de4a5c5ae8..d41274dc720d3e 100644 --- a/Mathlib/CategoryTheory/Sites/Descent/DescentData.lean +++ b/Mathlib/CategoryTheory/Sites/Descent/DescentData.lean @@ -334,6 +334,7 @@ def pullFunctorIdIso : rw [pullFunctorObjHom_eq_assoc _ _ _ _ _ q f₁ f₂ rfl] simp [mapComp'_id_comp_inv_app_assoc, mapComp'_id_comp_hom_app, ← Functor.map_comp])) +set_option backward.isDefEq.respectTransparency.types false in /-- The composition of two functors `pullFunctor` is isomorphic to `pullFunctor` applied to the compositions. -/ @[simps!] @@ -557,6 +558,7 @@ lemma bijective_toDescentData_map_iff (M N : F.obj (.mk (op S))) : ext φ : 1 apply DescentData.subtypeCompatibleHomEquiv_toCompatible_presheafHomObjHomEquiv +set_option backward.isDefEq.respectTransparency.types false in lemma isPrestackFor_iff_isSheafFor {S : C} (R : Sieve S) : F.IsPrestackFor R.arrows ↔ ∀ (M N : F.obj (.mk (op S))), Presieve.IsSheafFor (P := F.presheafHom M N) @@ -573,6 +575,7 @@ lemma isPrestackFor_iff_isSheafFor {S : C} (R : Sieve S) : · rintro _ _ ⟨_, h⟩ exact h +set_option backward.isDefEq.respectTransparency.types false in lemma isPrestackFor_iff_isSheafFor' {S : C} (R : Sieve S) : F.IsPrestackFor R.arrows ↔ ∀ ⦃S₀ : C⦄ (M N : F.obj (.mk (op S₀))) (a : S ⟶ S₀), Presieve.IsSheafFor (F.presheafHom M N) ((Sieve.overEquiv (Over.mk a)).symm R).arrows := by @@ -606,6 +609,7 @@ lemma IsPrestackFor.isSheafFor' variable {J : GrothendieckTopology C} +set_option backward.isDefEq.respectTransparency.types false in /-- If `F` is a prestack for a Grothendieck topology `J`, and `f` is a covering family of morphisms, then the functor `F.toDescentData f` is fully faithful. -/ noncomputable def fullyFaithfulToDescentData [F.IsPrestack J] (hf : Sieve.ofArrows _ f ∈ J S) : diff --git a/Mathlib/CategoryTheory/Sites/Descent/DescentDataPrime.lean b/Mathlib/CategoryTheory/Sites/Descent/DescentDataPrime.lean index 66f62c5b424931..5a4f9c26deb728 100644 --- a/Mathlib/CategoryTheory/Sites/Descent/DescentDataPrime.lean +++ b/Mathlib/CategoryTheory/Sites/Descent/DescentDataPrime.lean @@ -318,6 +318,7 @@ noncomputable def fromDescentDataFunctor : F.DescentData f ⥤ F.DescentData' sq obj D := .ofDescentData _ _ D map φ := { hom := φ.hom } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `F.DescentData' sq sq₃ ≌ F.DescentData f`. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean b/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean index 5b6a94384c8388..642d77d87deb22 100644 --- a/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean +++ b/Mathlib/CategoryTheory/Sites/Descent/IsPrestack.lean @@ -121,7 +121,7 @@ variable (F) {S : C} (M N : F.obj (.mk (op S))) `F.obj (.mk (op S))`, this is the presheaf of morphisms from `M` to `N`: it sends an object `T : Over S` corresponding to a morphism `p : X ⟶ S` to the type of morphisms $p^* M ⟶ p^* N$. -/ -@[simps] +@[simps, implicit_reducible] def presheafHom : (Over S)ᵒᵖ ⥤ Type v' where obj T := (F.map (.toLoc T.unop.hom.op)).toFunctor.obj M ⟶ (F.map (.toLoc T.unop.hom.op)).toFunctor.obj N diff --git a/Mathlib/CategoryTheory/Sites/Descent/Precoverage.lean b/Mathlib/CategoryTheory/Sites/Descent/Precoverage.lean index fd2a5da5fe7d2a..18b53c51d2d137 100644 --- a/Mathlib/CategoryTheory/Sites/Descent/Precoverage.lean +++ b/Mathlib/CategoryTheory/Sites/Descent/Precoverage.lean @@ -198,6 +198,7 @@ lemma mor_unique ⦃i : ι⦄ {Z : C} (q : Z ⟶ X i) rw [mor_eq _ _ _ _ _ _ _ rfl rfl, mor_eq _ _ _ _ _ _ _ rfl rfl, this] simp +set_option backward.isDefEq.respectTransparency.types false in /-- Given two family of morphisms `f : X i ⟶ S` and `f' : X' j ⟶ S`, two objects `D₁ D₂ : F.DescentData f`, a morphism `φ` between the images in `F.DescentData f'` of `D₁` and `D₂` by a functor `pullFunctor`. This is @@ -212,6 +213,7 @@ noncomputable def familyOfElements (i : ι) : ext simpa using (Over.w q).symm)) +set_option backward.isDefEq.respectTransparency.types false in lemma familyOfElements_eq {i : ι} {Z : Over (X i)} (g : Z ⟶ Over.mk (𝟙 (X i))) ⦃j : ι'⦄ (a : Z.left ⟶ X' j) (fac : a ≫ f' j = Z.hom ≫ f i := by cat_disch) : familyOfElements w φ i g (by @@ -299,6 +301,7 @@ end full_pullFunctor public section +set_option backward.isDefEq.respectTransparency.types false in open full_pullFunctor in include w hf' in lemma full_pullFunctor : @@ -378,6 +381,7 @@ section variable {F} [HasPullbacks C] {J : Precoverage C} [J.HasIsos] [J.IsStableUnderBaseChange] [J.IsStableUnderComposition] +set_option backward.isDefEq.respectTransparency.types false in /-- If a precoverage satisfies `HasIsos`, `IsStableUnderBaseChange` and `IsStableUnderComposition` (which is a slightly stronger condition as compared to pretopologies), then in order to check that a pseudofunctor is a prestack diff --git a/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean b/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean index 407c524ae3f725..049fd7a8e41106 100644 --- a/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean +++ b/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean @@ -68,6 +68,7 @@ lemma FirstObj.ext (z₁ z₂ : FirstObj P R) (h : ∀ (Y : C) (f : Y ⟶ X) variable (P R) +set_option backward.isDefEq.respectTransparency.types false in /-- Show that `FirstObj` is isomorphic to `FamilyOfElements`. -/ @[simps] def firstObjEqFamily : FirstObj P R ≅ (R.FamilyOfElements P) where @@ -148,6 +149,7 @@ theorem compatible_iff (x : FirstObj P S.arrows) : rw [Types.limit_ext_iff'] at t simpa [firstMap, secondMap] using t ⟨⟨Y, Z, g, f, hf⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- `P` is a sheaf for `S`, iff the fork given by `w` is an equalizer. -/ theorem equalizer_sheaf_condition : Presieve.IsSheafFor P (S : Presieve X) ↔ Nonempty (IsLimit (Fork.ofι _ (w P S))) := by @@ -235,6 +237,7 @@ theorem compatible_iff (x : FirstObj P R) : rw [Types.limit_ext_iff'] at t simpa [firstMap, secondMap] using t ⟨⟨⟨Y, f, hf⟩, Z, g, hg⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- `P` is a sheaf for `R`, iff the fork given by `w` is an equalizer. -/ @[stacks 00VM] theorem sheaf_condition : R.IsSheafFor P ↔ Nonempty (IsLimit (Fork.ofι _ (w P R))) := by @@ -352,6 +355,7 @@ lemma compatible_iff_of_small (x : FirstObj P X) : · apply_fun Pi.π (fun (ij : I × I) ↦ P.obj (op (pullback (π ij.1) (π ij.2)))) ⟨i, j⟩ at t simpa [firstMap, secondMap] using t +set_option backward.isDefEq.respectTransparency.types false in /-- `P` is a sheaf for `Presieve.ofArrows X π`, iff the fork given by `w` is an equalizer. -/ @[stacks 00VM] theorem sheaf_condition : (Presieve.ofArrows X π).IsSheafFor P ↔ diff --git a/Mathlib/CategoryTheory/Sites/Equivalence.lean b/Mathlib/CategoryTheory/Sites/Equivalence.lean index 8f3300c5be5ab5..9cc9b503de3547 100644 --- a/Mathlib/CategoryTheory/Sites/Equivalence.lean +++ b/Mathlib/CategoryTheory/Sites/Equivalence.lean @@ -119,6 +119,7 @@ def sheafCongr.inverse : Sheaf K A ⥤ Sheaf J A := (sheafToPresheaf _ _ ⋙ (Functor.whiskeringLeft _ _ _).obj e.functor.op) (e.functor.op_comp_isSheaf _ _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The unit iso in the equivalence of sheaf categories. -/ @[simps!] @@ -126,6 +127,7 @@ def sheafCongr.unitIso : 𝟭 (Sheaf J A) ≅ functor J K e A ⋙ inverse J K e NatIso.ofComponents (fun F ↦ ObjectProperty.isoMk _ (isoWhiskerRight e.op.unitIso F.obj)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The counit iso in the equivalence of sheaf categories. -/ @[simps!] @@ -133,6 +135,7 @@ def sheafCongr.counitIso : inverse J K e A ⋙ functor J K e A ≅ 𝟭 (Sheaf _ NatIso.ofComponents (fun F ↦ ObjectProperty.isoMk _ (isoWhiskerRight e.op.counitIso F.obj)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of sheaf categories. -/ @[simps] @@ -152,6 +155,7 @@ noncomputable def transportAndSheafify : (Cᵒᵖ ⥤ A) ⥤ Sheaf J A := e.op.congrLeft.functor ⋙ presheafToSheaf _ _ ⋙ (e.sheafCongr J K A).inverse +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An auxiliary definition for the sheafification adjunction. -/ noncomputable diff --git a/Mathlib/CategoryTheory/Sites/GlobalSections.lean b/Mathlib/CategoryTheory/Sites/GlobalSections.lean index 8f4dc66c773516..9d1bb0ed58be3f 100644 --- a/Mathlib/CategoryTheory/Sites/GlobalSections.lean +++ b/Mathlib/CategoryTheory/Sites/GlobalSections.lean @@ -138,6 +138,7 @@ noncomputable def Sheaf.coneΓ [HasGlobalSectionsFunctor J A] (F : Sheaf J A) : pt := (Γ J A).obj F π := ΓHomEquiv.symm (𝟙 _) +set_option backward.isDefEq.respectTransparency.types false in /-- The global sections cone `Sheaf.coneΓ` is limiting - that is, global sections are limits even when not all limits of shape `Cᵒᵖ` exist in `A`. -/ noncomputable def Sheaf.isLimitConeΓ [HasGlobalSectionsFunctor J A] (F : Sheaf J A) : diff --git a/Mathlib/CategoryTheory/Sites/Grothendieck.lean b/Mathlib/CategoryTheory/Sites/Grothendieck.lean index 126fc3b57f3735..b8fa746858b43e 100644 --- a/Mathlib/CategoryTheory/Sites/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Sites/Grothendieck.lean @@ -486,6 +486,7 @@ corresponding to `g ≫ I.f`. -/ def Arrow.precomp {S : J.Cover X} (I : S.Arrow) {Z : C} (g : Z ⟶ I.Y) : S.Arrow := ⟨Z, g ≫ I.f, S.1.downward_closed I.hf g⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Given `I : S.Arrow` and a morphism `g : Z ⟶ I.Y`, this is the obvious relation from `I.precomp g` to `I`. -/ @[simps] @@ -630,6 +631,7 @@ def index {D : Type u₁} [Category.{v₁} D] (S : J.Cover X) (P : Cᵒᵖ ⥤ D fst I := P.map I.r.g₁.op snd I := P.map I.r.g₂.op +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural multifork associated to `S : J.Cover X` for a presheaf `P`. Saying that this multifork is a limit is essentially equivalent to the sheaf condition at the diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean b/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean index 8a9f7185d7359a..6179996d2c6fd0 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/Homotopy.lean @@ -251,6 +251,7 @@ namespace OneHypercover variable {S : C} {E : OneHypercover.{w} J S} {F : OneHypercover.{w'} J S} variable [HasPullbacks C] +set_option backward.isDefEq.respectTransparency.types false in /-- Given two refinement morphism `f, g : E ⟶ F`, this is a `1`-hypercover `W` that admits a morphism `h : W ⟶ E` such that `h ≫ f` and `h ≫ g` are homotopic. Hence they become equal after quotienting out by homotopy. -/ diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean b/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean index 7ee4e8c72b323a..c8d33c74b19e5a 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/IsSheaf.lean @@ -154,6 +154,7 @@ end OneHypercoverFamily abbrev IsGeneratedByOneHypercovers : Prop := OneHypercoverFamily.IsGenerating.{w} (J := J) ⊤ +set_option backward.isDefEq.respectTransparency.types false in instance : IsGeneratedByOneHypercovers.{max u v} J where le S hS := ⟨Cover.oneHypercover ⟨S, hS⟩, by simp, by simp⟩ diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/One.lean b/Mathlib/CategoryTheory/Sites/Hypercover/One.lean index 8e82688a138de2..6d28526f2ed1c3 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/One.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/One.lean @@ -146,6 +146,7 @@ def multicospanIndex (F : Cᵒᵖ ⥤ A) : MulticospanIndex E.multicospanShape A fst j := F.map ((E.p₁ j.2).op) snd j := F.map ((E.p₂ j.2).op) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The multifork attached to a presheaf `F : Cᵒᵖ ⥤ A`, `S : C` and `E : PreOneHypercover S`. -/ def multifork (F : Cᵒᵖ ⥤ A) : @@ -171,6 +172,7 @@ def forkOfIsColimit {c : Cofan E.X} (hc : IsColimit c) {d : Cofan E.Y'} (hd : Is congr 2 exact Cofan.IsColimit.hom_ext hd _ _ (by simp [E.w]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma forkOfIsColimit_ι_map_inj {c : Cofan E.X} (hc : IsColimit c) {d : Cofan E.Y'} @@ -265,6 +267,7 @@ def isLimitSigmaOfIsColimitEquiv {c : Cofan E.X} (hc : IsColimit c) {d : Cofan E · exact fun _ ↦ .refl _ all_goals cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The trivial pre-`1`-hypercover of `S` with a single component `S`. -/ @[simps toPreZeroHypercover I₁ Y p₁ p₂] @@ -276,15 +279,18 @@ def trivial (S : C) : PreOneHypercover.{w} S where p₂ _ _ _ := 𝟙 _ w _ _ _ := by simp +set_option backward.isDefEq.respectTransparency.types false in lemma sieve₀_trivial (S : C) : (trivial S).sieve₀ = ⊤ := by rw [PreZeroHypercover.sieve₀, Sieve.ofArrows, ← PreZeroHypercover.presieve₀] simp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma sieve₁_trivial {S : C} {W : C} {p : W ⟶ S} : (trivial S).sieve₁ (i₁ := ⟨⟩) (i₂ := ⟨⟩) p p = ⊤ := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in instance : Nonempty (PreOneHypercover.{w} S) := ⟨trivial S⟩ section @@ -389,6 +395,7 @@ def Hom.comp (f : E.Hom F) (g : F.Hom G) : E.Hom G where def Hom.s₁' (f : E.Hom F) (k : E.I₁') : F.I₁' := ⟨⟨f.s₀ k.1.1, f.s₀ k.1.2⟩, f.s₁ k.2⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps! id_s₀ id_s₁ id_h₀ id_h₁ comp_s₀ comp_s₁ comp_h₀ comp_h₁] instance : Category (PreOneHypercover S) where @@ -396,12 +403,14 @@ instance : Category (PreOneHypercover S) where id E := Hom.id E comp f g := f.comp g +set_option backward.isDefEq.respectTransparency.types false in /-- The forgetful functor from pre-`1`-hypercovers to pre-`0`-hypercovers. -/ @[simps] def oneToZero : PreOneHypercover.{w} S ⥤ PreZeroHypercover.{w} S where obj f := f.1 map f := f.1 +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A refinement morphism `E ⟶ F` induces a morphism on associated multiequalizers. -/ def Hom.mapMultiforkOfIsLimit (f : E.Hom F) (P : Cᵒᵖ ⥤ A) {c : Multifork (E.multicospanIndex P)} @@ -526,18 +535,21 @@ lemma congrIndexOneOfEqIso_refl {i j : E.I₀} (k : E.I₁ i j) : E.congrIndexOneOfEqIso rfl rfl k = Iso.refl _ := by simp [congrIndexOneOfEqIso] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma congrIndexOneOfEqIso_hom_p₁ (k : E.I₁ i j) : (E.congrIndexOneOfEqIso hii' hjj' k).hom ≫ E.p₁ _ = E.p₁ _ ≫ eqToHom (by rw [hii']) := by subst hii' hjj' simp [congrIndexOneOfEqIso, congrIndexOneOfEq] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma congrIndexOneOfEqIso_inv_p₁ (k : E.I₁ i j) : (E.congrIndexOneOfEqIso hii' hjj' k).inv ≫ E.p₁ _ = E.p₁ k ≫ eqToHom (by rw [hii']) := by subst hii' hjj' simp [congrIndexOneOfEqIso, congrIndexOneOfEq] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma congrIndexOneOfEqIso_inv_p₂ (k : E.I₁ i j) : (E.congrIndexOneOfEqIso hii' hjj' k).inv ≫ E.p₂ _ = E.p₂ k ≫ eqToHom (by rw [hjj']) := by @@ -549,6 +561,7 @@ variable {i i' j j' : E.I₀} (u₀ : E.I₀ → F.I₀) (z : ∀ i j (k : E.I₁ i j), E.Y k ⟶ F.Y (u₁ i j k)) (hii' : i = i') (hjj' : j = j') (k : E.I₁ i j) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma congrIndexOneOfEqIso_hom_naturality : (E.congrIndexOneOfEqIso hii' hjj' k).hom ≫ @@ -558,6 +571,7 @@ lemma congrIndexOneOfEqIso_hom_naturality : subst hii' hjj' simp [congrIndexOneOfEqIso, congrIndexOneOfEq] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma congrIndexOneOfEqIso_inv_naturality : (E.congrIndexOneOfEqIso hii' hjj' k).inv ≫ @@ -697,38 +711,45 @@ section variable {S : C} {E F : PreOneHypercover.{w} S} (e : E ≅ F) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma hom_inv_s₀_apply (i : E.I₀) : e.inv.s₀ (e.hom.s₀ i) = i := congr($(e.hom_inv_id).s₀ i) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inv_hom_s₀_apply (i : F.I₀) : e.hom.s₀ (e.inv.s₀ i) = i := congr($(e.inv_hom_id).s₀ i) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma hom_inv_s₁_apply {i j : E.I₀} (k : E.I₁ i j) : e.inv.s₁ (e.hom.s₁ k) = E.congrIndexOneOfEq (by simp) (by simp) k := by obtain ⟨hs₀, hh₀, hs₁, hh₁⟩ := PreOneHypercover.Hom.ext'_iff.mp e.hom_inv_id simpa using! hs₁ i j k +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma inv_hom_s₁_apply {i j : F.I₀} (k : F.I₁ i j) : e.hom.s₁ (e.inv.s₁ k) = F.congrIndexOneOfEq (by simp) (by simp) k := by obtain ⟨hs₀, hh₀, hs₁, hh₁⟩ := PreOneHypercover.Hom.ext'_iff.mp e.inv_hom_id simpa using! hs₁ i j k +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma hom_inv_h₀ (i : E.I₀) : e.hom.h₀ i ≫ e.inv.h₀ (e.hom.s₀ i) = eqToHom (by simp) := by obtain ⟨hs, hh, _⟩ := Hom.ext'_iff.mp e.hom_inv_id simpa using hh i +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma inv_hom_h₀ (i : F.I₀) : e.inv.h₀ i ≫ e.hom.h₀ (e.inv.s₀ i) = eqToHom (by simp) := by obtain ⟨hs, hh, _⟩ := Hom.ext'_iff.mp e.inv_hom_id simpa using hh i +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma hom_inv_h₁ {i j : E.I₀} (k : E.I₁ i j) : @@ -738,6 +759,7 @@ lemma hom_inv_h₁ {i j : E.I₀} (k : E.I₁ i j) : obtain ⟨hs, _, _, hh⟩ := Hom.ext'_iff.mp e.hom_inv_id simpa using hh i j k +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma inv_hom_h₁ {i j : F.I₀} (k : F.I₁ i j) : @@ -747,15 +769,18 @@ lemma inv_hom_h₁ {i j : F.I₀} (k : F.I₁ i j) : obtain ⟨hs, _, _, hh⟩ := Hom.ext'_iff.mp e.inv_hom_id simpa using hh i j k +set_option backward.isDefEq.respectTransparency.types false in instance (i : E.I₀) : IsIso (e.hom.h₀ i) := by use e.inv.h₀ (e.hom.s₀ i) ≫ eqToHom (by simp) rw [PreOneHypercover.hom_inv_h₀_assoc, eqToHom_trans, eqToHom_refl, Category.assoc, ← eqToHom_naturality _ (by simp), PreOneHypercover.inv_hom_h₀_assoc] simp +set_option backward.isDefEq.respectTransparency.types false in instance (i : F.I₀) : IsIso (e.inv.h₀ i) := .of_isIso_fac_right (PreOneHypercover.inv_hom_h₀ e i) +set_option backward.isDefEq.respectTransparency.types false in instance {i j : E.I₀} (k : E.I₁ i j) : IsIso (e.hom.h₁ k) := by use e.inv.h₁ _ ≫ eqToHom (by congr 1; simp) ≫ (E.congrIndexOneOfEqIso (by simp) (by simp) k).hom simp only [PreOneHypercover.hom_inv_h₁_assoc, eqToHom_trans_assoc, eqToHom_refl, Category.id_comp, @@ -763,6 +788,7 @@ instance {i j : E.I₀} (k : E.I₁ i j) : IsIso (e.hom.h₁ k) := by rw [← eqToHom_naturality_assoc _ (by simp)] simp +set_option backward.isDefEq.respectTransparency.types false in instance {i j : F.I₀} (k : F.I₁ i j) : IsIso (e.inv.h₁ k) := .of_isIso_fac_right (PreOneHypercover.inv_hom_h₁ e k) @@ -770,6 +796,7 @@ end section +set_option backward.isDefEq.respectTransparency.types false in /-- A refinement morphism `E ⟶ F` induces a functor between the multifork indexing categories. -/ @[simps] def Hom.mapMulticospan {E : PreOneHypercover.{w} S} {F : PreOneHypercover.{w'} S} (f : E.Hom F) : @@ -930,6 +957,7 @@ section variable {E F} variable (c : Multifork (E.multicospanIndex F.obj)) +set_option backward.isDefEq.respectTransparency.types false in /-- Auxiliary definition of `isLimitMultifork`. -/ noncomputable def multiforkLift : c.pt ⟶ F.obj.obj (Opposite.op S) := F.property.amalgamateOfArrows _ E.mem₀ c.ι (fun W i₁ i₂ p₁ p₂ w => by @@ -940,12 +968,14 @@ noncomputable def multiforkLift : c.pt ⟶ F.obj.obj (Opposite.op S) := simp only [op_comp, Functor.map_comp] simpa using! c.condition ⟨⟨i₁, i₂⟩, j⟩ =≫ F.obj.map h.op) +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma multiforkLift_map (i₀ : E.I₀) : multiforkLift c ≫ F.obj.map (E.f i₀).op = c.ι i₀ := by simp [multiforkLift] end +set_option backward.isDefEq.respectTransparency.types false in /-- If `E : J.OneHypercover S` and `F : Sheaf J A`, then `F.obj (op S)` is a multiequalizer of suitable maps `F.obj (op (E.X i)) ⟶ F.obj (op (E.Y j))` induced by `E.p₁ j` and `E.p₂ j`. -/ @@ -985,6 +1015,7 @@ def trivial (S : C) : OneHypercover.{w} J S where instance (S : C) : Nonempty (J.OneHypercover S) := ⟨trivial J S⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Intersection of two `1`-hypercovers. -/ @[simps toPreOneHypercover] noncomputable @@ -1010,6 +1041,7 @@ variable {S : C} {E : OneHypercover.{w} J S} {F : OneHypercover.{w'} J S} abbrev Hom (E : OneHypercover.{w} J S) (F : OneHypercover.{w'} J S) := E.toPreOneHypercover.Hom F.toPreOneHypercover +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps! id_s₀ id_s₁ id_h₀ id_h₁ comp_s₀ comp_s₁ comp_h₀ comp_h₁] instance : Category (J.OneHypercover S) where @@ -1017,6 +1049,7 @@ instance : Category (J.OneHypercover S) where id E := PreOneHypercover.Hom.id E.toPreOneHypercover comp f g := f.comp g +set_option backward.isDefEq.respectTransparency.types false in /-- An isomorphism of `1`-hypercovers is an isomorphism of pre-`1`-hypercovers. -/ @[simps] def isoMk {E F : J.OneHypercover S} (f : E.toPreOneHypercover ≅ F.toPreOneHypercover) : @@ -1061,6 +1094,7 @@ lemma preOneHypercover_sieve₁ (f₁ f₂ : S.Arrow) {W : C} (p₁ : W ⟶ f₁ simp only [Sieve.top_apply, iff_true] exact ⟨{ w := w, .. }, f, rfl, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The tautological 1-hypercover induced by `S : J.Cover X`. Its index type `I₀` is given by `S.Arrow` (i.e. all the morphisms in the sieve `S`), while `I₁` is given by all possible pullback cones. -/ @@ -1099,6 +1133,7 @@ instance {S : C} (E : PreZeroHypercover S) [E.HasPullbacks] : dsimp infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma sieve₁'_toPreOneHypercover_eq_top {S : C} (E : PreZeroHypercover S) [E.HasPullbacks] diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/Saturate.lean b/Mathlib/CategoryTheory/Sites/Hypercover/Saturate.lean index 7ba01ed3e2b1e1..f863c5d421daba 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/Saturate.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/Saturate.lean @@ -68,6 +68,7 @@ lemma isLimit_saturate_type_iff {S : C} (E : PreZeroHypercover S) (F : Cᵒᵖ ← Function.Bijective.of_comp_iff' (E.sectionsSaturateEquiv F).symm.bijective] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `E` has pairwise pullbacks, this is the canonical map from the minimal `1`-hypercover to the saturation. -/ @@ -94,6 +95,7 @@ def fromSaturateOfHasPullbacks {S : C} (E : PreZeroHypercover S) variable {S : C} (E : PreZeroHypercover S) [E.HasPullbacks] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The identity of the minimal pre-`1`-hypercover when `E` has pairwise pullbacks is homotopic to itself. -/ @@ -108,6 +110,7 @@ def toPreOneHypercoverHomotopy {S : C} (E : PreZeroHypercover S) variable {S : C} (E : PreZeroHypercover S) [E.HasPullbacks] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma toSaturateOfHasPullbacks_fromSaturateOfHasPullbacks : diff --git a/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean b/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean index 45384739957a84..774ec4c3d808e7 100644 --- a/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean +++ b/Mathlib/CategoryTheory/Sites/Hypercover/Zero.lean @@ -231,12 +231,13 @@ def add (E : PreZeroHypercover.{w} S) {T : C} (f : T ⟶ S) : PreZeroHypercover. @[simp] lemma add_f_nome {T : C} (f : T ⟶ S) : (E.add f).f none = f := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma presieve₀_add {T : C} (f : T ⟶ S) : (E.add f).presieve₀ = E.presieve₀ ⊔ .singleton f := by simp [add, presieve₀_reindex, presieve₀_sum] /-- The single object pre-`0`-hypercover obtained from taking the coproduct of the components. -/ -@[simps I₀ X, simps -isSimp f] +@[simps I₀ X, simps -isSimp f, implicit_reducible] def sigmaOfIsColimit (E : PreZeroHypercover.{w} S) {c : Cofan E.X} (hc : IsColimit c) : PreZeroHypercover.{w} S where I₀ := PUnit @@ -284,6 +285,7 @@ def Hom.comp (f : E.Hom F) (g : F.Hom G) : E.Hom G where s₀ := g.s₀ ∘ f.s₀ h₀ i := f.h₀ i ≫ g.h₀ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps! id_s₀ id_h₀ comp_s₀ comp_h₀] instance : Category (PreZeroHypercover S) where @@ -447,6 +449,7 @@ def sumLift (f : E.Hom G) (g : F.Hom G) : (E.sum F).Hom G where variable [∀ (i : E.I₀) (j : F.I₀), HasPullback (E.f i) (F.f j)] +set_option backward.isDefEq.respectTransparency.types false in /-- First projection from the intersection of two pre-`0`-hypercovers. -/ @[simps] noncomputable @@ -475,6 +478,7 @@ def interLift (f : G.Hom E) (g : G.Hom F) : s₀ i := ⟨f.s₀ i, g.s₀ i⟩ h₀ i := pullback.lift (f.h₀ i) (g.h₀ i) (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The refinement given by restricting the indexing type. -/ @[simps] @@ -685,6 +689,7 @@ def bind [J.IsStableUnderComposition] (E : ZeroHypercover.{w} J T) mem₀ := comp_mem_coverings (f := E.f) (g := fun i j ↦ (F i).f j) E.mem₀ (fun i ↦ (F i).mem₀) +set_option backward.isDefEq.respectTransparency.types false in /-- Pairwise intersection of two `0`-hypercovers. -/ @[simps toPreZeroHypercover] noncomputable @@ -745,6 +750,7 @@ variable (J) in abbrev Hom (E : ZeroHypercover.{w} J S) (F : ZeroHypercover.{w'} J S) := E.toPreZeroHypercover.Hom F.toPreZeroHypercover +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simps! id_s₀ id_h₀ comp_s₀ comp_h₀] instance : Category (ZeroHypercover.{w} J S) where @@ -752,6 +758,7 @@ instance : Category (ZeroHypercover.{w} J S) where id _ := PreZeroHypercover.Hom.id _ comp := PreZeroHypercover.Hom.comp +set_option backward.isDefEq.respectTransparency.types false in /-- An isomorphism in `0`-hypercovers is an isomorphism of the underlying pre-`0`-hypercovers. -/ @[simps] def isoMk {E F : ZeroHypercover.{w} J S} (e : E.toPreZeroHypercover ≅ F.toPreZeroHypercover) : @@ -828,6 +835,7 @@ def restrictIndexOfSmall (E : ZeroHypercover.{w} J S) [ZeroHypercover.Small.{w'} __ := E.toPreZeroHypercover.restrictIndex (Small.restrictFun E) mem₀ := Small.mem₀ E +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance (E : ZeroHypercover.{w} J S) [ZeroHypercover.Small.{w'} E] {T : C} (f : T ⟶ S) [IsStableUnderBaseChange J] [∀ (i : E.I₀), HasPullback f (E.f i)] : @@ -870,6 +878,7 @@ instance {D : Type*} [Category* D] {F : C ⥤ D} (J : Precoverage D) [Small.{w} refine ⟨(E.map F le_rfl).restrictIndexOfSmall.I₀, ZeroHypercover.Small.restrictFun _, ?_⟩ simpa using! (E.map F le_rfl).restrictIndexOfSmall.mem₀ +set_option backward.isDefEq.respectTransparency.types false in lemma Small.inf {J K : Precoverage C} [Small.{w} J] (of_le : ∀ ⦃X : C⦄ ⦃R S : Presieve X⦄, R ≤ S → S ∈ K X → R ∈ K X) : Small.{w} (J ⊓ K) where diff --git a/Mathlib/CategoryTheory/Sites/IsSheafFor.lean b/Mathlib/CategoryTheory/Sites/IsSheafFor.lean index 2e232f49968b17..5f852b04ec6a67 100644 --- a/Mathlib/CategoryTheory/Sites/IsSheafFor.lean +++ b/Mathlib/CategoryTheory/Sites/IsSheafFor.lean @@ -730,6 +730,7 @@ theorem isSeparatedFor_iso {P' : Cᵒᵖ ⥤ Type w} (i : P ≅ P') (hP : IsSepa intro x t₁ t₂ ht₁ ht₂ simpa using congrArg (i.hom.app _) <| hP (x.map i.inv) _ _ (ht₁.map i.inv) (ht₂.map i.inv) +set_option backward.isDefEq.respectTransparency.types false in /-- If a presieve `R` on `X` has a subsieve `S` such that: * `P` is a sheaf for `S`. @@ -854,6 +855,7 @@ theorem isSheafFor_ofArrows_iff_bijective_toCompabible : subst hy exact ⟨y, fun _ ↦ rfl, fun y' hy' ↦ h.1 (by ext; apply hy')⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma isSheafFor_pullback_iff (P : Cᵒᵖ ⥤ Type w) {X : C} (R : Sieve X) {Y : C} (f : Y ⟶ X) [IsIso f] : @@ -907,6 +909,7 @@ lemma isSheafFor_over_map_op_comp_ofArrows_iff ← e.bijective.of_comp_iff'] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma isSheafFor_over_map_op_comp_iff {B B' : C} (p : B ⟶ B') (P : (Over B')ᵒᵖ ⥤ Type w) {X : Over B} (R : Sieve X) {X' : Over B'} diff --git a/Mathlib/CategoryTheory/Sites/Limits.lean b/Mathlib/CategoryTheory/Sites/Limits.lean index c2b2220ff983ff..7e4240b60ec600 100644 --- a/Mathlib/CategoryTheory/Sites/Limits.lean +++ b/Mathlib/CategoryTheory/Sites/Limits.lean @@ -53,6 +53,7 @@ noncomputable section section +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An auxiliary definition to be used below. @@ -235,7 +236,7 @@ creates colimits of the diagram. Note: this almost never holds in sheaf categories in general, but it does for the extensive topology (see `Mathlib/CategoryTheory/Sites/Coherent/ExtensiveColimits.lean`). -/ -@[implicit_reducible] +@[instance_reducible] def createsColimitOfIsSheaf (F : K ⥤ Sheaf J D) (h : ∀ (c : Cocone (F ⋙ sheafToPresheaf J D)) (_ : IsColimit c), Presheaf.IsSheaf J c.pt) : CreatesColimit F (sheafToPresheaf J D) := diff --git a/Mathlib/CategoryTheory/Sites/Monoidal.lean b/Mathlib/CategoryTheory/Sites/Monoidal.lean index 2d2a8d0bfba4ce..64b111b39f9f44 100644 --- a/Mathlib/CategoryTheory/Sites/Monoidal.lean +++ b/Mathlib/CategoryTheory/Sites/Monoidal.lean @@ -174,7 +174,7 @@ attribute [local instance] monoidalCategory /-- The monoidal category structure on `Sheaf J A` obtained in `Sheaf.monoidalCategory` is braided when `A` is braided. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def braidedCategory [(J.W (A := A)).IsMonoidal] [HasWeakSheafify J A] [BraidedCategory A] : BraidedCategory (Sheaf J A) := inferInstanceAs (BraidedCategory @@ -182,7 +182,7 @@ noncomputable def braidedCategory [(J.W (A := A)).IsMonoidal] [HasWeakSheafify J /-- The monoidal category structure on `Sheaf J A` obtained in `Sheaf.monoidalCategory` is symmetric when `A` is symmetric. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def symmetricCategory [(J.W (A := A)).IsMonoidal] [HasWeakSheafify J A] [SymmetricCategory A] : SymmetricCategory (Sheaf J A) := diff --git a/Mathlib/CategoryTheory/Sites/Over.lean b/Mathlib/CategoryTheory/Sites/Over.lean index 34d3e552ccdf17..8f8ebe6f6d6a4c 100644 --- a/Mathlib/CategoryTheory/Sites/Over.lean +++ b/Mathlib/CategoryTheory/Sites/Over.lean @@ -126,16 +126,19 @@ lemma overEquiv_symm_iff {X : C} {Y : Over X} (S : Sieve Y.left) {Z : Over X} (f rfl set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in lemma overEquiv_iff {X : C} {Y : Over X} (S : Sieve Y) {Z : C} (f : Z ⟶ Y.left) : overEquiv Y S f ↔ S (Over.homMk f : Over.mk (f ≫ Y.hom) ⟶ Y) := by obtain ⟨S, rfl⟩ := (overEquiv Y).symm.surjective S simp +set_option backward.isDefEq.respectTransparency.types false in lemma overEquiv_ofArrows {X : C} {Y : Over X} {I : Type*} (Z : I → Over X) (g : ∀ i, Z i ⟶ Y) : overEquiv Y (ofArrows Z g) = ofArrows (fun i => (Z i).left) (fun i => (g i).left) := by simp [Sieve.overEquiv, functorPushforward_ofArrows] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in lemma overEquiv_preOneHypercover_sieve₁ {X : C} {Y : Over X} (E : PreOneHypercover.{w} Y) {i₁ i₂ : E.I₀} {W : Over X} (p₁ : W ⟶ E.X i₁) (p₂ : W ⟶ E.X i₂) : overEquiv W (E.sieve₁ p₁ p₂) = @@ -146,6 +149,7 @@ lemma overEquiv_preOneHypercover_sieve₁ {X : C} {Y : Over X} (E : PreOneHyperc intro ⟨k, b, hb₁, hb₂⟩ exact ⟨k, Over.homMk b (by simpa using (hb₁ =≫ (E.X i₁).hom).symm), by cat_disch, by cat_disch⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma overEquiv_generate {X : C} {Y : Over X} (R : Presieve Y) : overEquiv Y (.generate R) = .generate (Presieve.functorPushforward (Over.forget X) R) := by refine le_antisymm (fun Z g hg ↦ ?_) ?_ @@ -170,6 +174,7 @@ lemma overEquiv_symm_generate {X : C} {Y : Over X} (R : Presieve Y.left) : exact fun Z g hg ↦ le_generate _ _ _ hg set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma functorPushforward_over_map {X Y : C} (f : X ⟶ Y) (Z : Over X) (S : Sieve Z.left) : Sieve.functorPushforward (Over.map f) ((Sieve.overEquiv Z).symm S) = @@ -254,6 +259,7 @@ lemma over_forget_coverPreserving (X : C) : CoverPreserving (J.over X) J (Over.forget X) where cover_preserve hS := hS +set_option backward.isDefEq.respectTransparency.types false in lemma over_forget_compatiblePreserving (X : C) : CompatiblePreserving J (Over.forget X) where compatible {_ Z _ _ hx Y₁ Y₂ W f₁ f₂ g₁ g₂ hg₁ hg₂ h} := by @@ -334,6 +340,7 @@ lemma _root_.CategoryTheory.CoverPreserving.overPost {D : Type*} [Category* D] exact h.cover_preserve hS set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in instance {J : GrothendieckTopology C} (X : C) : (Over.forget X).PreservesOneHypercovers (J.over _) J := by intro Y E @@ -349,6 +356,7 @@ instance {J : GrothendieckTopology C} (X : C) : rwa [GrothendieckTopology.mem_over_iff, Sieve.overEquiv_preOneHypercover_sieve₁] at this set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency.types false in instance {D : Type*} [Category* D] {J : GrothendieckTopology C} {K : GrothendieckTopology D} (F : C ⥤ D) (X : C) [Functor.PreservesOneHypercovers.{w} F J K] : Functor.PreservesOneHypercovers.{w} (Over.post F) (J.over X) (K.over _) := by @@ -496,6 +504,7 @@ section variable (K : Precoverage C) [K.HasPullbacks] [K.IsStableUnderBaseChange] +set_option backward.isDefEq.respectTransparency.types false in /-- The Grothendieck topology on `Over X`, obtained from localizing the topology generated by the precoverage `K`, is generated by the preimage of `K`. -/ lemma over_toGrothendieck_eq_toGrothendieck_comap_forget (X : C) : diff --git a/Mathlib/CategoryTheory/Sites/Point/Basic.lean b/Mathlib/CategoryTheory/Sites/Point/Basic.lean index c9421f9d5182a2..f4297ed6db6ead 100644 --- a/Mathlib/CategoryTheory/Sites/Point/Basic.lean +++ b/Mathlib/CategoryTheory/Sites/Point/Basic.lean @@ -308,7 +308,7 @@ noncomputable def isTerminalFiberObj (T : C) (hT : IsTerminal T) : IsTerminal.isTerminalObj _ _ hT /-- The fiber of the terminal object contains a unique element. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def uniqueFiberObj (T : C) (hT : IsTerminal T) : Unique (Φ.fiber.obj T) := Types.isTerminalEquivUnique _ (Φ.isTerminalFiberObj T hT) diff --git a/Mathlib/CategoryTheory/Sites/Point/Map.lean b/Mathlib/CategoryTheory/Sites/Point/Map.lean index 77d4a858bddb5e..99eb6541bdadcf 100644 --- a/Mathlib/CategoryTheory/Sites/Point/Map.lean +++ b/Mathlib/CategoryTheory/Sites/Point/Map.lean @@ -35,6 +35,7 @@ variable {C : Type u} [Category.{v} C] {D : Type u'} [Category.{v'} D] {J : GrothendieckTopology C} (Φ : Point.{w} J) (F : C ⥤ D) (K : GrothendieckTopology D) [F.IsCocontinuous J K] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma map_aux ⦃X : D⦄ (R : Sieve X) (hR : R ∈ K X) ⦃u : Φ.fiber.Elements⦄ (f : (CategoryOfElements.π Φ.fiber ⋙ F).obj u ⟶ X) : diff --git a/Mathlib/CategoryTheory/Sites/Point/OfIsCofiltered.lean b/Mathlib/CategoryTheory/Sites/Point/OfIsCofiltered.lean index 3253ac0bd272ad..d98198dfd1f6c8 100644 --- a/Mathlib/CategoryTheory/Sites/Point/OfIsCofiltered.lean +++ b/Mathlib/CategoryTheory/Sites/Point/OfIsCofiltered.lean @@ -163,6 +163,7 @@ lemma toPresheafFiberOfIsCofiltered_w {V U : N} (f : V ⟶ U) (P : Cᵒᵖ ⥤ A toPresheafFiberOfIsCofiltered p hp U P := by simp [toPresheafFiberOfIsCofiltered] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma toPresheafFiberOfIsCofiltered_naturality {P Q : Cᵒᵖ ⥤ A} (g : P ⟶ Q) (U : N) : toPresheafFiberOfIsCofiltered p hp U P ≫ diff --git a/Mathlib/CategoryTheory/Sites/Point/Skyscraper.lean b/Mathlib/CategoryTheory/Sites/Point/Skyscraper.lean index 54e9c9b6f39918..a955d327723c06 100644 --- a/Mathlib/CategoryTheory/Sites/Point/Skyscraper.lean +++ b/Mathlib/CategoryTheory/Sites/Point/Skyscraper.lean @@ -72,6 +72,7 @@ lemma toPresheafFiber_skyscraperPresheafHomEquiv_symm g.app (op X) ≫ Pi.π _ x := by simp [skyscraperPresheafHomEquiv_symm_apply] +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma skyscraperPresheafHomEquiv_naturality_left_symm (f : P ⟶ Q) (g : Q ⟶ Φ.skyscraperPresheaf M) : @@ -178,6 +179,7 @@ private lemma isSheaf_skyscraperPresheaf_aux simpa [hz₁, hz₂, φ₁, φ₂] using! (Cone.w s φ₂.op =≫ Pi.π _ z).trans (Cone.w s φ₁.op =≫ Pi.π _ z).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isSheaf_skyscraperPresheaf (M : A) : Presheaf.IsSheaf J (Φ.skyscraperPresheaf M) := by @@ -232,6 +234,7 @@ instance : (Φ.sheafFiber (A := A)).IsLeftAdjoint := instance : (Φ.skyscraperSheafFunctor (A := A)).IsRightAdjoint := Φ.skyscraperSheafAdjunction.isRightAdjoint +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma skyscraperSheafAdjunction_homEquiv_apply_hom {F : Sheaf J A} {M : A} @@ -245,6 +248,7 @@ lemma skyscraperSheafAdjunction_homEquiv_apply_hom {F : Sheaf J A} {M : A} alias skyscraperSheafAdjunction_homEquiv_apply_val := skyscraperSheafAdjunction_homEquiv_apply_hom +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma skyscraperSheafAdjunction_homEquiv_symm_apply {F : Sheaf J A} {M : A} diff --git a/Mathlib/CategoryTheory/Sites/Precoverage.lean b/Mathlib/CategoryTheory/Sites/Precoverage.lean index fc62daf0cbf9d8..799ae8fe51b87c 100644 --- a/Mathlib/CategoryTheory/Sites/Precoverage.lean +++ b/Mathlib/CategoryTheory/Sites/Precoverage.lean @@ -126,6 +126,7 @@ alias mem_coverings_of_isIso := HasIsos.mem_coverings_of_isIso alias sup_mem_coverings := IsStableUnderSup.sup_mem_coverings alias hasPullbacks_of_mem := HasPullbacks.hasPullbacks_of_mem +set_option backward.isDefEq.respectTransparency.types false in set_option warning.simp.varHead false in attribute [local simp] Presieve.ofArrows.obj_idx Presieve.ofArrows.hom_idx in lemma mem_coverings_of_isPullback {J : Precoverage C} [IsStableUnderBaseChange J] @@ -147,6 +148,7 @@ lemma mem_coverings_of_isPullback {J : Precoverage C} [IsStableUnderBaseChange J refine le_antisymm (fun Z g ⟨i⟩ ↦ .mk _) fun Z g hg ↦ ?_ exact .mk' (Sum.inl ⟨⟨_, _⟩, hg⟩) (by cat_disch) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option warning.simp.varHead false in attribute [local simp] Presieve.ofArrows.obj_idx Presieve.ofArrows.hom_idx in lemma comp_mem_coverings {J : Precoverage C} [IsStableUnderComposition J] {ι : Type w} diff --git a/Mathlib/CategoryTheory/Sites/Preserves.lean b/Mathlib/CategoryTheory/Sites/Preserves.lean index 35b9d4e04988fe..5fdcd16571ec3c 100644 --- a/Mathlib/CategoryTheory/Sites/Preserves.lean +++ b/Mathlib/CategoryTheory/Sites/Preserves.lean @@ -80,6 +80,7 @@ variable (hI : IsInitial I) -- This is the data of a particular disjoint coproduct in `C`. variable {α : Type*} [Small.{w} α] {X : α → C} (c : Cofan X) (hc : IsColimit c) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem piComparison_fac : have : HasCoproduct X := ⟨⟨c, hc⟩⟩ diff --git a/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean b/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean index 0a3ec627c0cba3..e1b99046cedfd4 100644 --- a/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/PreservesSheafification.lean @@ -157,6 +157,7 @@ section HasSheafCompose variable (adj₂ : G₂ ⊣ sheafToPresheaf J B) [J.HasSheafCompose F] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical natural transformation `(whiskeringRight Cᵒᵖ A B).obj F ⋙ G₂ ⟶ G₁ ⋙ sheafCompose J F` @@ -286,6 +287,7 @@ lemma sheafToPresheaf_map_sheafComposeNatTrans_eq_sheafifyCompIso_inv (P : Cᵒ dsimp [plusPlusAdjunction] simp +set_option backward.isDefEq.respectTransparency.types false in instance (P : Cᵒᵖ ⥤ D) : IsIso ((sheafComposeNatTrans J F (plusPlusAdjunction J D) (plusPlusAdjunction J E)).app P) := by rw [← isIso_iff_of_reflects_iso _ (sheafToPresheaf J E), diff --git a/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean b/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean index f112008fcd2b6e..d1beef96ed74f0 100644 --- a/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean +++ b/Mathlib/CategoryTheory/Sites/PseudofunctorSheafOver.lean @@ -30,6 +30,7 @@ namespace GrothendieckTopology variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) (A : Type u') [Category.{v'} A] +set_option backward.isDefEq.respectTransparency.types false in /-- Given a Grothendieck topology `J` on a category `C` and a category `A`, this is the pseudofunctor which sends `X : C` to the categories of sheaves on `Over X` with values in `A`. -/ diff --git a/Mathlib/CategoryTheory/Sites/Sheaf.lean b/Mathlib/CategoryTheory/Sites/Sheaf.lean index 0483c6977df99f..ae3382c32eb19b 100644 --- a/Mathlib/CategoryTheory/Sites/Sheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Sheaf.lean @@ -439,6 +439,7 @@ lemma Presheaf.IsSheaf.of_le {K : GrothendieckTopology C} {F : Cᵒᵖ ⥤ A} (h Presheaf.IsSheaf J F := fun _ _ _ hS ↦ h _ _ (hle _ hS) +set_option backward.isDefEq.respectTransparency.types false in /-- The category of sheaves on the bottom (trivial) Grothendieck topology is equivalent to the category of presheaves. @@ -522,6 +523,7 @@ variable (P : Cᵒᵖ ⥤ A) (P' : Cᵒᵖ ⥤ A') section MultiequalizerConditions +set_option backward.isDefEq.respectTransparency.types false in /-- When `P` is a sheaf and `S` is a cover, the associated multifork is a limit. -/ def isLimitOfIsSheaf {X : C} (S : J.Cover X) (hP : IsSheaf J P) : IsLimit (S.multifork P) where lift := fun E : Multifork _ => hP.amalgamate S (fun _ => E.ι _) @@ -541,6 +543,7 @@ def isLimitOfIsSheaf {X : C} (S : J.Cover X) (hP : IsSheaf J P) : IsLimit (S.mul symm apply hP.amalgamate_map +set_option backward.isDefEq.respectTransparency.types false in theorem isSheaf_iff_multifork : IsSheaf J P ↔ ∀ (X : C) (S : J.Cover X), Nonempty (IsLimit (S.multifork P)) := by refine ⟨fun hP X S => ⟨isLimitOfIsSheaf _ _ _ hP⟩, ?_⟩ diff --git a/Mathlib/CategoryTheory/Sites/SheafHom.lean b/Mathlib/CategoryTheory/Sites/SheafHom.lean index 26bda6ee8f9315..01c704b4b9da51 100644 --- a/Mathlib/CategoryTheory/Sites/SheafHom.lean +++ b/Mathlib/CategoryTheory/Sites/SheafHom.lean @@ -39,6 +39,7 @@ variable {C : Type u} [Category.{v} C] {J : GrothendieckTopology C} variable (F G : Cᵒᵖ ⥤ A) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given two presheaves `F` and `G` on a category `C` with values in a category `A`, this `presheafHom F G` is the presheaf of types which sends an object `X : C` @@ -78,6 +79,7 @@ lemma presheafHom_map_app_op_mk_id {X Y : C} (g : Y ⟶ X) variable (F G) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The sections of the presheaf `presheafHom F G` identify to morphisms `F ⟶ G`. -/ def presheafHomSectionsEquiv : (presheafHom F G).sections ≃ (F ⟶ G) where @@ -245,12 +247,14 @@ def sheafHom (F G : Sheaf J A) : Sheaf J (Type _) where obj := sheafHom' F G property := (Presheaf.isSheaf_of_iso_iff (sheafHom'Iso F G)).2 (G.2.hom F.1) +set_option backward.isDefEq.respectTransparency.types false in /-- The sections of the sheaf `sheafHom F G` identify to morphisms `F ⟶ G`. -/ def sheafHomSectionsEquiv (F G : Sheaf J A) : (sheafHom F G).1.sections ≃ (F ⟶ G) := ((Functor.sectionsFunctor Cᵒᵖ).mapIso (sheafHom'Iso F G)).toEquiv.trans ((presheafHomSectionsEquiv F.1 G.1).trans Sheaf.homEquiv.symm) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma sheafHomSectionsEquiv_symm_apply_coe_apply {F G : Sheaf J A} (φ : F ⟶ G) (X : Cᵒᵖ) : ((sheafHomSectionsEquiv F G).symm φ).1 X = (J.overPullback A X.unop).map φ := (rfl) diff --git a/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean b/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean index 9c17bf92445dba..cd9687e6e786a0 100644 --- a/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean +++ b/Mathlib/CategoryTheory/Sites/SheafOfTypes.lean @@ -203,6 +203,7 @@ open Presieve variable {C : Type u} [Category.{v} C] variable {X : C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem yonedaFamily_fromCocone_compatible (S : Sieve X) (s : Cocone (diagram S.arrows)) : FamilyOfElements.Compatible <| yonedaFamilyOfElements_fromCocone S.arrows s := by diff --git a/Mathlib/CategoryTheory/Sites/Sheafification.lean b/Mathlib/CategoryTheory/Sites/Sheafification.lean index d2206924841c9a..40aae0fd1c8c6b 100644 --- a/Mathlib/CategoryTheory/Sites/Sheafification.lean +++ b/Mathlib/CategoryTheory/Sites/Sheafification.lean @@ -146,6 +146,7 @@ theorem toSheafification_app (P : Cᵒᵖ ⥤ D) : (toSheafification J D).app P variable {D} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem isIso_toSheafify {P : Cᵒᵖ ⥤ D} (hP : Presheaf.IsSheaf J P) : IsIso (toSheafify J P) := by refine ⟨(sheafificationAdjunction J D |>.counit.app ⟨P, hP⟩).hom, ?_, ?_⟩ @@ -172,6 +173,7 @@ noncomputable def sheafifyLift {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Preshe sheafify J P ⟶ Q := (sheafificationAdjunction J D).homEquiv P ⟨Q, hQ⟩ |>.symm η |>.hom +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem sheafificationAdjunction_counit_app_val (P : Sheaf J D) : ((sheafificationAdjunction J D).counit.app P).hom = sheafifyLift J (𝟙 P.obj) P.property := by @@ -191,6 +193,7 @@ theorem toSheafify_sheafifyLift {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Presh rw [sheafificationAdjunction J D |>.right_triangle_components (Y := ⟨Q, hQ⟩)] simp +set_option backward.isDefEq.respectTransparency.types false in theorem sheafifyLift_unique {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Presheaf.IsSheaf J Q) (γ : sheafify J P ⟶ Q) : toSheafify J P ≫ γ = η → γ = sheafifyLift J η hQ := by intro h diff --git a/Mathlib/CategoryTheory/Sites/Sieves.lean b/Mathlib/CategoryTheory/Sites/Sieves.lean index c8f66eef9ae174..96fe90cbac2b68 100644 --- a/Mathlib/CategoryTheory/Sites/Sieves.lean +++ b/Mathlib/CategoryTheory/Sites/Sieves.lean @@ -38,6 +38,7 @@ variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] variable {X Y Z : C} (f : Y ⟶ X) /-- A predicate on arrows with codomain `X`. -/ +@[implicit_reducible] def Presieve (X : C) := ∀ ⦃Y⦄, (Y ⟶ X) → Prop deriving CompleteLattice, Inhabited @@ -483,6 +484,7 @@ def uncurry : Set (Σ Y, Y ⟶ X) := · rintro ⟨i⟩; exact ⟨_, rfl, HEq.refl _⟩ · rintro ⟨i, rfl, h⟩; rw [← eq_of_heq h]; exact ⟨i⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma ofArrows_eq_ofArrows_uncurry {ι : Type*} {S : C} {X : ι → C} (f : ∀ i, X i ⟶ S) : ofArrows X f = ofArrows _ (fun i : (Presieve.ofArrows X f).uncurry ↦ f i.2.idx) := by refine le_antisymm (fun Z g hg ↦ ?_) fun Z g ⟨i⟩ ↦ .mk _ @@ -1207,6 +1209,7 @@ def natTransOfLe {S T : Sieve X} (h : S ≤ T) : S.functor ⟶ T.functor where def functorInclusion (S : Sieve X) : S.functor ⟶ yoneda.obj X where app _ := ↾fun f ↦ f.1 +set_option backward.isDefEq.respectTransparency.types false in /-- Any component `f : Y ⟶ X` of the sieve `S` induces a natural transformation from `yoneda.obj Y` to the presheaf induced by `S`. -/ @[simps] @@ -1219,6 +1222,7 @@ theorem natTransOfLe_comm {S T : Sieve X} (h : S ≤ T) : open ConcreteCategory +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The presheaf induced by a sieve is a subobject of the yoneda embedding. -/ instance functorInclusion_is_mono : Mono S.functorInclusion := @@ -1266,6 +1270,7 @@ def uliftFunctorInclusion (S : Sieve X) : S.uliftFunctor ⟶ uliftYoneda.{w}.obj X := Functor.whiskerRight S.functorInclusion CategoryTheory.uliftFunctor +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `Sieve.toFunctor` with universe lifting. -/ @[simps] def toUliftFunctor (S : Sieve X) {Y : C} (f : Y ⟶ X) (hf : S f) : @@ -1276,6 +1281,7 @@ theorem uliftNatTransOfLe_comm {S T : Sieve X} (h : S ≤ T) : uliftNatTransOfLe.{w} h ≫ uliftFunctorInclusion.{w} _ = uliftFunctorInclusion.{w} _ := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The presheaf induced by a sieve is a subobject of the yoneda embedding. -/ instance uliftFunctorInclusion_is_mono (S : Sieve X) : @@ -1325,6 +1331,7 @@ def shrinkFunctor [LocallySmall.{w} C] {X : C} (S : Sieve X) : map {Y Z} g f hf := by simpa [shrinkYonedaObjObjEquiv_obj_map] using S.downward_closed hf _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (S) in /-- `Sieve.shrinkFunctor` is compatible with universe lifting. -/ @@ -1344,6 +1351,7 @@ def shrinkFunctorUliftFunctorIso [LocallySmall.{w} C] [LocallySmall.{max w' w} C rw [shrinkYonedaObjObjEquiv_obj_map, shrinkYonedaObjObjEquiv_symm_comp] simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma shrinkFunctorUliftFunctorIso_inv_ι [LocallySmall.{w} C] [LocallySmall.{max w' w} C] : (shrinkFunctorUliftFunctorIso.{w, w'} S).inv ≫ @@ -1352,6 +1360,7 @@ lemma shrinkFunctorUliftFunctorIso_inv_ι [LocallySmall.{w} C] [LocallySmall.{ma shrinkYonedaUliftFunctorIso.{w, w'}.inv.app X := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (S) in /-- Shrinking does nothing for the same universe level. -/ diff --git a/Mathlib/CategoryTheory/Sites/Subcanonical.lean b/Mathlib/CategoryTheory/Sites/Subcanonical.lean index ef05b6fd22bb64..ea76f003c7fa9b 100644 --- a/Mathlib/CategoryTheory/Sites/Subcanonical.lean +++ b/Mathlib/CategoryTheory/Sites/Subcanonical.lean @@ -44,6 +44,7 @@ theorem yonedaEquiv_symm_app_apply {X : C} {F : Sheaf J (Type v)} (x : F.obj.obj (Y : Cᵒᵖ) (f : Y.unop ⟶ X) : dsimp% (J.yonedaEquiv.symm x).hom.app Y f = F.obj.map f.op x := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- See also `yonedaEquiv_naturality'` for a more general version. -/ lemma yonedaEquiv_naturality {X Y : C} {F : Sheaf J (Type v)} (f : J.yoneda.obj X ⟶ F) diff --git a/Mathlib/CategoryTheory/Sites/Subsheaf.lean b/Mathlib/CategoryTheory/Sites/Subsheaf.lean index 1b3481cd7502c2..e7dc0a6804b48a 100644 --- a/Mathlib/CategoryTheory/Sites/Subsheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Subsheaf.lean @@ -150,6 +150,7 @@ theorem Subfunctor.sheafify_sheafify (h : Presieve.IsSheaf J F) : @[deprecated (since := "2025-12-11")] alias Subpresheaf.sheafify_sheafify := Subfunctor.sheafify_sheafify +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The lift of a presheaf morphism onto the sheafification subpresheaf. -/ noncomputable def Subfunctor.sheafifyLift (f : G.toFunctor ⟶ F') (h : Presieve.IsSheaf J F') : @@ -175,6 +176,7 @@ noncomputable def Subfunctor.sheafifyLift (f : G.toFunctor ⟶ F') (h : Presieve @[deprecated (since := "2025-12-11")] alias Subpresheaf.sheafifyLift := Subfunctor.sheafifyLift +set_option backward.isDefEq.respectTransparency.types false in theorem Subfunctor.to_sheafifyLift (f : G.toFunctor ⟶ F') (h : Presieve.IsSheaf J F') : Subfunctor.homOfLe (G.le_sheafify J) ≫ G.sheafifyLift f h = f := by ext U s @@ -187,6 +189,7 @@ theorem Subfunctor.to_sheafifyLift (f : G.toFunctor ⟶ F') (h : Presieve.IsShea @[deprecated (since := "2025-12-11")] alias Subpresheaf.to_sheafifyLift := Subfunctor.to_sheafifyLift +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem Subfunctor.to_sheafify_lift_unique (h : Presieve.IsSheaf J F') (l₁ l₂ : (G.sheafify J).toFunctor ⟶ F') @@ -202,6 +205,7 @@ theorem Subfunctor.to_sheafify_lift_unique (h : Presieve.IsSheaf J F') @[deprecated (since := "2025-12-11")] alias Subpresheaf.to_sheafify_lift_unique := Subfunctor.to_sheafify_lift_unique +set_option backward.isDefEq.respectTransparency.types false in theorem Subfunctor.sheafify_le (h : G ≤ G') (hF : Presieve.IsSheaf J F) (hG' : Presieve.IsSheaf J G'.toFunctor) : G.sheafify J ≤ G' := by intro U x hx @@ -286,6 +290,7 @@ def imageMonoFactorization {F F' : Sheaf J (Type w)} (f : F ⟶ F') : m := Sheaf.imageι f e := Sheaf.toImage f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The mono factorization given by `image_sheaf` for a morphism is an image. -/ noncomputable def imageFactorization {F F' : Sheaf J (Type (max v u))} (f : F ⟶ F') : diff --git a/Mathlib/CategoryTheory/Sites/Whiskering.lean b/Mathlib/CategoryTheory/Sites/Whiskering.lean index 0d5fbc2c2d0f39..8d27c1ad16cdb6 100644 --- a/Mathlib/CategoryTheory/Sites/Whiskering.lean +++ b/Mathlib/CategoryTheory/Sites/Whiskering.lean @@ -87,6 +87,7 @@ instance [F.ReflectsIsomorphisms] : (sheafCompose J F).ReflectsIsomorphisms wher variable {F G} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `η : F ⟶ G` is a natural transformation then we obtain a morphism of functors @@ -107,6 +108,7 @@ namespace GrothendieckTopology.Cover variable (F G) {J} variable (P : Cᵒᵖ ⥤ A) {X : C} (S : J.Cover X) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The multicospan associated to a cover `S : J.Cover X` and a presheaf of the form `P ⋙ F` is isomorphic to the composition of the multicospan associated to `S` and `P`, @@ -134,6 +136,7 @@ def multicospanComp : (S.index (P ⋙ F)).multicospan ≅ (S.index P).multicospa Category.comp_id, Functor.map_id] <;> dsimp [CategoryStruct.comp] <;> simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Mapping the multifork associated to a cover `S : J.Cover X` and a presheaf `P` with respect to a functor `F` is isomorphic (upto a natural isomorphism of the underlying functors) diff --git a/Mathlib/CategoryTheory/Skeletal.lean b/Mathlib/CategoryTheory/Skeletal.lean index c739b129ecd056..b976479114c903 100644 --- a/Mathlib/CategoryTheory/Skeletal.lean +++ b/Mathlib/CategoryTheory/Skeletal.lean @@ -121,6 +121,7 @@ lemma Skeleton.comp_hom {X Y Z : Skeleton C} (f : X ⟶ Y) (g : Y ⟶ Z) : variable (C) +set_option backward.isDefEq.respectTransparency.types false in /-- An inverse to `fromSkeleton C` that forms an equivalence with it. -/ @[simps] noncomputable def toSkeletonFunctor : C ⥤ Skeleton C where obj := toSkeleton @@ -129,6 +130,7 @@ variable (C) map_id _ := by aesop map_comp _ _ := InducedCategory.hom_ext (by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence between the skeleton and the category itself. -/ @[simps] noncomputable def skeletonEquivalence : Skeleton C ≌ C where @@ -140,6 +142,7 @@ set_option backward.defeqAttrib.useBackward true in counitIso := NatIso.ofComponents fromSkeletonToSkeletonIso functor_unitIso_comp _ := Iso.inv_hom_id _ +set_option backward.isDefEq.respectTransparency.types false in theorem skeleton_skeletal : Skeletal (Skeleton C) := by rintro X Y ⟨h⟩ have : X.out ≈ Y.out := ⟨(fromSkeleton C).mapIso h⟩ @@ -178,6 +181,7 @@ noncomputable def mapSkeleton (F : C ⥤ D) : Skeleton C ⥤ Skeleton D := variable (F : C ⥤ D) +set_option backward.isDefEq.respectTransparency.types false in lemma mapSkeleton_obj_toSkeleton (X : C) : F.mapSkeleton.obj (toSkeleton X) = toSkeleton (F.obj X) := congr_toSkeleton_of_iso <| F.mapIso <| fromSkeletonToSkeletonIso X @@ -248,7 +252,7 @@ instance ThinSkeleton.preorder : Preorder (ThinSkeleton C) where le_trans a b c := Quotient.inductionOn₃ a b c fun _ _ _ => Nonempty.map2 (· ≫ ·) /-- The functor from a category to its thin skeleton. -/ -@[simps] +@[simps, implicit_reducible] def toThinSkeleton : C ⥤ ThinSkeleton C where obj := ThinSkeleton.mk map f := homOfLE (Nonempty.intro f) @@ -269,6 +273,7 @@ instance thin : Quiver.IsThin (ThinSkeleton C) := fun _ _ => variable {C} {D} +set_option backward.isDefEq.respectTransparency.types false in /-- A functor `C ⥤ D` computably lowers to a functor `ThinSkeleton C ⥤ ThinSkeleton D`. -/ @[simps] def map (F : C ⥤ D) : ThinSkeleton C ⥤ ThinSkeleton D where diff --git a/Mathlib/CategoryTheory/SmallObject/Construction.lean b/Mathlib/CategoryTheory/SmallObject/Construction.lean index 6d1538ec667877..8596537fd3940f 100644 --- a/Mathlib/CategoryTheory/SmallObject/Construction.lean +++ b/Mathlib/CategoryTheory/SmallObject/Construction.lean @@ -348,6 +348,7 @@ noncomputable def functor : Arrow C ⥤ Arrow C where (t ≫ (τ ≫ τ').left) (by simp)] · dsimp +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical natural transformation `𝟭 (Arrow C) ⟶ functor f`. -/ @[simps app] diff --git a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean index eaeabf4d62d737..9cf5c29247eefe 100644 --- a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean +++ b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean @@ -133,6 +133,7 @@ noncomputable def succStruct : SuccStruct (Arrow C ⥤ Arrow C) := haveI := hasPushouts I κ SuccStruct.ofNatTrans (ε I.homFamily) +set_option backward.isDefEq.respectTransparency.types false in /-- For the successor structure `succStruct I κ` on `Arrow C ⥤ Arrow C`, the morphism from an object to its successor induces morphisms in `C` which consists in attaching `I`-cells. -/ @@ -154,6 +155,7 @@ isomorphisms on the right side. -/ def propArrow : MorphismProperty (Arrow C) := fun _ _ f ↦ (coproducts.{w} I).pushouts f.left ∧ (isomorphisms C) f.right +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma succStruct_prop_le_propArrow : (succStruct I κ).prop ≤ (propArrow.{w} I).functorCategory (Arrow C) := by @@ -233,6 +235,7 @@ noncomputable def iterationFunctorObjObjRightIso (f : Arrow C) (j : κ.ord.ToTyp asIso ((transfiniteCompositionOfShapeιIterationAppRight I κ f).incl.app j) ≪≫ (iterationObjRightIso I κ f).symm +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma iterationFunctorObjObjRightIso_ιIteration_app_right (f : Arrow C) (j : κ.ord.ToType) : @@ -301,6 +304,7 @@ the small object argument. -/ noncomputable def πObj : obj I κ f ⟶ Y := ((iteration I κ).obj (Arrow.mk f)).hom ≫ inv ((ιIteration I κ).app f).right +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma πObj_ιIteration_app_right : πObj I κ f ≫ ((ιIteration I κ).app f).right = @@ -449,6 +453,7 @@ lemma πObj_naturality {f g : Arrow C} (φ : f ⟶ g) : rw [← assoc] apply comp_id +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functorial factorization `ιObj I κ f ≫ πObj I κ f.hom = f` with `ιObj I κ f` in `I.rlp.llp` and `πObj I κ f.hom` in `I.rlp`. -/ diff --git a/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean b/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean index ac5a0ee0e8329a..73df1b0563b163 100644 --- a/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean +++ b/Mathlib/CategoryTheory/SmallObject/Iteration/Basic.lean @@ -92,6 +92,7 @@ def restrictionLT : Set.Iio i ⥤ C := lemma restrictionLT_obj (k : J) (hk : k < i) : (restrictionLT F hi).obj ⟨k, hk⟩ = F.obj ⟨k, hk.le.trans hi⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma restrictionLT_map {k₁ k₂ : Set.Iio i} (φ : k₁ ⟶ k₂) : (restrictionLT F hi).map φ = F.map (homOfLE (by simpa using leOfHom φ)) := rfl @@ -361,6 +362,7 @@ lemma ext (h : ∀ (k₁ k₂ : K) (h₁₂ : k₁ ≤ k₂) (h₂ : k₂ ≤ x) end subsingleton +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open subsingleton in instance subsingleton : Subsingleton (Φ.Iteration j) where diff --git a/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean b/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean index 74249097eeffaf..619c8db9ef56bb 100644 --- a/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean +++ b/Mathlib/CategoryTheory/SmallObject/Iteration/Nonempty.lean @@ -114,6 +114,7 @@ lemma arrowMap_functor_to_top (i : J) (hi : i < j) : end mkOfLimit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in open mkOfLimit in /-- When `j` is a limit element, this is the element in `Φ.Iteration j` diff --git a/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean b/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean index 1d02903f86b7b2..20e5b0af4131f3 100644 --- a/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean +++ b/Mathlib/CategoryTheory/SmallObject/TransfiniteCompositionLifting.lean @@ -169,6 +169,7 @@ lemma liftHom_fac (i : J) (hi : i < j) : F.map (homOfLE hi.le) ≫ liftHom hj s = (s.1 ⟨⟨i, hi⟩⟩).f' := (F.isColimitOfIsWellOrderContinuous j hj).fac _ ⟨i, hi⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Auxiliary definition for `transfiniteComposition.wellOrderInductionData`. -/ @[simps] @@ -185,6 +186,7 @@ noncomputable def lift : (sqFunctor c p f g).obj (Opposite.op j) where dsimp at this ⊢ rw [liftHom_fac_assoc _ _ _ hij, this, Cocone.w_assoc]) +set_option backward.isDefEq.respectTransparency.types false in lemma map_lift {i : J} (hij : i < j) : (lift hj s).map (homOfLE hij.le) = s.1 ⟨⟨i, hij⟩⟩ := by ext diff --git a/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean b/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean index eb3361f312a56a..92f03356cb32ef 100644 --- a/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean +++ b/Mathlib/CategoryTheory/SmallObject/TransfiniteIteration.lean @@ -36,6 +36,7 @@ variable {J} in this is the unique element in `Φ.Iteration j`. -/ noncomputable def iter (j : J) : Φ.Iteration j := Classical.arbitrary _ +set_option backward.isDefEq.respectTransparency.types false in /-- Given `Φ : SuccStruct C` and a well-ordered type `J`, this is the functor `J ⥤ C` which gives the iterations of `Φ` indexed by `J`. -/ noncomputable def iterationFunctor : J ⥤ C where @@ -61,10 +62,12 @@ noncomputable def isColimitIterationCocone : IsColimit (Φ.iterationCocone J) := variable {J} +set_option backward.isDefEq.respectTransparency.types false in lemma iterationFunctor_obj (i : J) {j : J} (iter : Φ.Iteration j) (hi : i ≤ j) : (Φ.iterationFunctor J).obj i = iter.F.obj ⟨i, hi⟩ := Iteration.congr_obj (Φ.iter i) iter i (by simp) hi +set_option backward.isDefEq.respectTransparency.types false in lemma arrowMk_iterationFunctor_map (i₁ i₂ : J) (h₁₂ : i₁ ≤ i₂) {j : J} (iter : Φ.Iteration j) (hj : i₂ ≤ j) : Arrow.mk ((Φ.iterationFunctor J).map (homOfLE h₁₂)) = @@ -76,6 +79,7 @@ lemma arrowMk_iterationFunctor_map (i₁ i₂ : J) (h₁₂ : i₁ ≤ i₂) variable (J) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : (Φ.iterationFunctor J).IsWellOrderContinuous where nonempty_isColimit i hi := ⟨by @@ -92,6 +96,7 @@ instance : (Φ.iterationFunctor J).IsWellOrderContinuous where apply Arrow.mk_injective simp [Φ.arrowMk_iterationFunctor_map k i hk.le (Φ.iter i) (by simp), e]⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism `(Φ.iterationFunctor J).obj ⊥ ≅ Φ.X₀`. -/ noncomputable def iterationFunctorObjBotIso : (Φ.iterationFunctor J).obj ⊥ ≅ Φ.X₀ := eqToIso (Φ.iter ⊥).obj_bot diff --git a/Mathlib/CategoryTheory/SmallRepresentatives.lean b/Mathlib/CategoryTheory/SmallRepresentatives.lean index 9c0f318dc1c217..e608101c8b730b 100644 --- a/Mathlib/CategoryTheory/SmallRepresentatives.lean +++ b/Mathlib/CategoryTheory/SmallRepresentatives.lean @@ -95,6 +95,7 @@ def smallCategoryOfSet : SmallCategoryOfSet Ω where id X := h.homEquiv.symm (𝟙 _) comp f g := h.homEquiv.symm (h.homEquiv f ≫ h.homEquiv g) +set_option backward.isDefEq.respectTransparency.types false in /-- Given `h : CoreSmallCategoryOfSet Ω C`, this is the obvious functor `h.smallCategoryOfSet.obj ⥤ C`. -/ @[simps!] @@ -104,11 +105,13 @@ def functor : h.smallCategoryOfSet.obj ⥤ C where map_id _ := by rw [SmallCategoryOfSet.id_def]; simp map_comp _ _ := by rw [SmallCategoryOfSet.comp_def]; simp +set_option backward.isDefEq.respectTransparency.types false in /-- Given `h : CoreSmallCategoryOfSet Ω C`, the obvious functor `h.smallCategoryOfSet.obj ⥤ C` is fully faithful. -/ def fullyFaithfulFunctor : h.functor.FullyFaithful where preimage := h.homEquiv.symm +set_option backward.isDefEq.respectTransparency.types false in instance : h.functor.IsEquivalence where faithful := h.fullyFaithfulFunctor.faithful full := h.fullyFaithfulFunctor.full @@ -121,6 +124,7 @@ the obvious functor `h.smallCategoryOfSet.obj ⥤ C` is an equivalence. -/ noncomputable def equivalence : h.smallCategoryOfSet.obj ≌ C := h.functor.asEquivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given `h : CoreSmallCategoryOfSet Ω C`, the equivalence of categories `h.smallCategoryOfSet.obj ≌ C` is actually an isomorphism: it induces diff --git a/Mathlib/CategoryTheory/Square.lean b/Mathlib/CategoryTheory/Square.lean index 01242d1c7c953d..3c1080dde4f6f7 100644 --- a/Mathlib/CategoryTheory/Square.lean +++ b/Mathlib/CategoryTheory/Square.lean @@ -168,6 +168,7 @@ def flipFunctor : Square C ⥤ Square C where τ₃ := φ.τ₂ τ₄ := φ.τ₄ } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Flipping commutative squares is an auto-equivalence. -/ @[simps] @@ -177,6 +178,7 @@ def flipEquivalence : Square C ≌ Square C where unitIso := Iso.refl _ counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a commutative square `sq` to the obvious arrow from the left morphism of `sq` @@ -203,6 +205,7 @@ def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C where comm₂₄ := φ.right.w.symm comm₃₄ := Arrow.rightFunc.congr_map φ.w.symm } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `Square C ≌ Arrow (Arrow C)` which sends a commutative square `sq` to the obvious arrow from the left morphism of `sq` @@ -214,6 +217,7 @@ def arrowArrowEquivalence : Square C ≌ Arrow (Arrow C) where unitIso := Iso.refl _ counitIso := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a commutative square `sq` to the obvious arrow from the top morphism of `sq` @@ -240,6 +244,7 @@ def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C where comm₂₄ := Arrow.rightFunc.congr_map φ.w.symm comm₃₄ := φ.right.w.symm } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `Square C ≌ Arrow (Arrow C)` which sends a commutative square `sq` to the obvious arrow from the top morphism of `sq` @@ -363,6 +368,7 @@ def mapSquare (F : C ⥤ D) : Square C ⥤ Square D where end Functor +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The natural transformation `F.mapSquare ⟶ G.mapSquare` induces by a natural transformation `F ⟶ G`. -/ @@ -375,6 +381,7 @@ def NatTrans.mapSquare {F G : C ⥤ D} (τ : F ⟶ G) : τ₃ := τ.app _ τ₄ := τ.app _ } +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `(C ⥤ D) ⥤ Square C ⥤ Square D`. -/ @[simps] def Square.mapFunctor : (C ⥤ D) ⥤ Square C ⥤ Square D where diff --git a/Mathlib/CategoryTheory/Subfunctor/Equalizer.lean b/Mathlib/CategoryTheory/Subfunctor/Equalizer.lean index 47acf2b4af2165..05d9d6988d897d 100644 --- a/Mathlib/CategoryTheory/Subfunctor/Equalizer.lean +++ b/Mathlib/CategoryTheory/Subfunctor/Equalizer.lean @@ -48,6 +48,7 @@ lemma equalizer_le : Subfunctor.equalizer f g ≤ A := @[simp] lemma equalizer_self : Subfunctor.equalizer f f = A := by aesop +set_option backward.isDefEq.respectTransparency.types false in lemma mem_equalizer_iff {i : C} (x : A.toFunctor.obj i) : x.1 ∈ (Subfunctor.equalizer f g).obj i ↔ f.app i x = g.app i x := by simp @@ -117,6 +118,7 @@ def equalizer.fork : Limits.Fork f g := lemma equalizer.fork_ι : (equalizer.fork f g).ι = equalizer.ι f g := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- `(Subfunctor.equalizer f g).toFunctor` is the equalizer of `f` and `g`. -/ def equalizer.forkIsLimit : Limits.IsLimit (equalizer.fork f g) := diff --git a/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean b/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean index ca98d7c0d4f556..60d30eaa66f18f 100644 --- a/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean +++ b/Mathlib/CategoryTheory/Subobject/ArtinianObject.lean @@ -86,6 +86,7 @@ lemma not_strictAnti_of_isArtinianObject ¬ StrictAnti f := (isArtinianObject_iff_not_strictAnti X).1 inferInstance f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isArtinianObject_iff_isEventuallyConstant : IsArtinianObject X ↔ ∀ (F : ℕ ⥤ (MonoOver X)ᵒᵖ), diff --git a/Mathlib/CategoryTheory/Subobject/Basic.lean b/Mathlib/CategoryTheory/Subobject/Basic.lean index 520297ad6eb9cf..a6e2e43572c925 100644 --- a/Mathlib/CategoryTheory/Subobject/Basic.lean +++ b/Mathlib/CategoryTheory/Subobject/Basic.lean @@ -99,6 +99,7 @@ with morphisms becoming inequalities, and isomorphisms becoming equations. /-- The category of subobjects of `X : C`, defined as isomorphism classes of monomorphisms into `X`. -/ +@[implicit_reducible] def Subobject (X : C) := ThinSkeleton (MonoOver X) @@ -110,6 +111,7 @@ namespace Subobject lemma skeletal (X : C) : Skeletal (Subobject X) := ThinSkeleton.skeletal /-- Convenience constructor for a subobject. -/ +@[implicit_reducible] def mk {X A : C} (f : A ⟶ X) [Mono f] : Subobject X := (toThinSkeleton _).obj (MonoOver.mk f) @@ -489,6 +491,7 @@ namespace Subobject /-- Any functor `MonoOver X ⥤ MonoOver Y` descends to a functor `Subobject X ⥤ Subobject Y`, because `MonoOver Y` is thin. -/ +@[implicit_reducible] def lower {Y : D} (F : MonoOver X ⥤ MonoOver Y) : Subobject X ⥤ Subobject Y := ThinSkeleton.map F @@ -521,6 +524,7 @@ def lowerAdjunction {A : C} {B : D} {L : MonoOver A ⥤ MonoOver B} {R : MonoOve (h : L ⊣ R) : lower L ⊣ lower R := ThinSkeleton.lowerAdjunction _ _ h +set_option backward.isDefEq.respectTransparency.types false in /-- An equivalence between `MonoOver A` and `MonoOver B` gives an equivalence between `Subobject A` and `Subobject B`. -/ @[simps] @@ -531,12 +535,13 @@ def lowerEquivalence {A : C} {B : D} (e : MonoOver A ≌ MonoOver B) : Subobject apply eqToIso convert! ThinSkeleton.map_iso_eq e.unitIso · exact ThinSkeleton.map_id_eq.symm - · exact (ThinSkeleton.map_comp_eq _ _).symm + · -- TODO: `simp; rfl` is a code smell + simp [lower, ThinSkeleton.map_comp_eq]; rfl counitIso := by apply eqToIso convert! ThinSkeleton.map_iso_eq e.counitIso · exact (ThinSkeleton.map_comp_eq _ _).symm - · exact ThinSkeleton.map_id_eq.symm + · simp [ThinSkeleton.map_id_eq]; rfl section Limits @@ -666,6 +671,7 @@ lemma map_obj_injective {X Y : C} (f : X ⟶ Y) [Mono f] : def mapIso {A B : C} (e : A ≅ B) : Subobject A ≌ Subobject B := lowerEquivalence (MonoOver.mapIso e) +set_option backward.isDefEq.respectTransparency.types false in /-- In fact, there's a type level bijection between the subobjects of isomorphic objects, which preserves the order. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Subobject/Classifier/Defs.lean b/Mathlib/CategoryTheory/Subobject/Classifier/Defs.lean index ce1187d910572b..462063263eb211 100644 --- a/Mathlib/CategoryTheory/Subobject/Classifier/Defs.lean +++ b/Mathlib/CategoryTheory/Subobject/Classifier/Defs.lean @@ -408,6 +408,7 @@ alias _root.CategoryTheory.Classifier.SubobjectRepresentableBy.homEquiv_eq := ho @[deprecated (since := "2026-03-06")] alias _root_.CategoryTheory.Classifier.SubobjectRepresentableBy.homEquiv_eq := homEquiv_eq +set_option backward.isDefEq.respectTransparency.types false in /-- For any subobject `x`, the pullback of `h.Ω₀` along the characteristic map of `x` given by `h.homEquiv` is `x` itself. -/ lemma pullback_homEquiv_symm_obj_Ω₀ {X : C} (x : Subobject X) : @@ -509,6 +510,7 @@ alias _root.CategoryTheory.Classifier.SubobjectRepresentableBy.isPullback := isP alias _root_.CategoryTheory.Classifier.SubobjectRepresentableBy.isPullback := isPullback variable {m} +set_option backward.isDefEq.respectTransparency.types false in lemma uniq {χ' : X ⟶ Ω} {π : U ⟶ h.Ω₀} (sq : IsPullback m π χ' h.Ω₀.arrow) : χ' = h.χ m := by apply h.homEquiv.injective diff --git a/Mathlib/CategoryTheory/Subobject/FactorThru.lean b/Mathlib/CategoryTheory/Subobject/FactorThru.lean index f0166d43fd21d1..0b54ef34f7fb92 100644 --- a/Mathlib/CategoryTheory/Subobject/FactorThru.lean +++ b/Mathlib/CategoryTheory/Subobject/FactorThru.lean @@ -96,6 +96,7 @@ set_option backward.isDefEq.respectTransparency false in theorem factors_zero [HasZeroMorphisms C] {X Y : C} {P : Subobject Y} : P.Factors (0 : X ⟶ Y) := (factors_iff _ _).mpr ⟨0, by simp⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem factors_of_le {Y Z : C} {P Q : Subobject Y} (f : Z ⟶ Y) (h : P ≤ Q) : P.Factors f → Q.Factors f := by simp only [factors_iff] diff --git a/Mathlib/CategoryTheory/Subobject/Lattice.lean b/Mathlib/CategoryTheory/Subobject/Lattice.lean index 79fb2a2166e0b6..db6af4c2a442e2 100644 --- a/Mathlib/CategoryTheory/Subobject/Lattice.lean +++ b/Mathlib/CategoryTheory/Subobject/Lattice.lean @@ -174,12 +174,14 @@ and which on `Subobject A` will induce a `SemilatticeSup`. -/ def sup {A : C} : MonoOver A ⥤ MonoOver A ⥤ MonoOver A := Functor.curryObj ((forget A).prod (forget A) ⋙ Functor.uncurry.obj Over.coprod ⋙ image) +set_option backward.isDefEq.respectTransparency.types false in /-- A morphism version of `le_sup_left`. -/ def leSupLeft {A : C} (f g : MonoOver A) : f ⟶ (sup.obj f).obj g := by refine homMk (coprod.inl ≫ factorThruImage _) ?_ erw [Category.assoc, image.fac, coprod.inl_desc] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- A morphism version of `le_sup_right`. -/ def leSupRight {A : C} (f g : MonoOver A) : g ⟶ (sup.obj f).obj g := by refine homMk (coprod.inr ≫ factorThruImage _) ?_ @@ -218,10 +220,12 @@ instance {X : C} : Inhabited (Subobject X) := theorem top_eq_id (B : C) : (⊤ : Subobject B) = Subobject.mk (𝟙 B) := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem underlyingIso_top_hom {B : C} : (underlyingIso (𝟙 B)).hom = (⊤ : Subobject B).arrow := by convert! underlyingIso_hom_comp_eq_mk (𝟙 B) simp only [comp_id] +set_option backward.isDefEq.respectTransparency.types false in instance top_arrow_isIso {B : C} : IsIso (⊤ : Subobject B).arrow := by rw [← underlyingIso_top_hom] infer_instance @@ -727,6 +731,7 @@ end ZeroObject section SubobjectSubobject +set_option backward.isDefEq.respectTransparency.types false in /-- The subobject lattice of a subobject `Y` is order isomorphic to the interval `Set.Iic Y`. -/ def subobjectOrderIso {X : C} (Y : Subobject X) : Subobject (Y : C) ≃o Set.Iic Y where toFun Z := diff --git a/Mathlib/CategoryTheory/Subobject/MonoOver.lean b/Mathlib/CategoryTheory/Subobject/MonoOver.lean index 4ea58b08d7a8c6..b3d7c00a07e1c8 100644 --- a/Mathlib/CategoryTheory/Subobject/MonoOver.lean +++ b/Mathlib/CategoryTheory/Subobject/MonoOver.lean @@ -363,6 +363,7 @@ theorem map_obj_left (f : X ⟶ Y) [Mono f] (g : MonoOver X) : ((map f).obj g : theorem map_obj_arrow (f : X ⟶ Y) [Mono f] (g : MonoOver X) : ((map f).obj g).arrow = g.arrow ≫ f := rfl +set_option backward.isDefEq.respectTransparency.types false in instance full_map (f : X ⟶ Y) [Mono f] : Functor.Full (map f) where map_surjective {g h} e := by refine ⟨homMk e.hom.left ?_, rfl⟩ @@ -384,6 +385,7 @@ section variable (X) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An equivalence of categories `e` between `C` and `D` induces an equivalence between `MonoOver X` and `MonoOver (e.functor.obj X)` whenever `X` is an object of `C`. -/ diff --git a/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean b/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean index 6cf3d8e3bfbecc..48e935f72d0493 100644 --- a/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean +++ b/Mathlib/CategoryTheory/Subobject/NoetherianObject.lean @@ -84,6 +84,7 @@ lemma not_strictMono_of_isNoetherianObject ¬ StrictMono f := (isNoetherianObject_iff_not_strictMono X).1 inferInstance f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isNoetherianObject_iff_isEventuallyConstant : IsNoetherianObject X ↔ ∀ (F : ℕ ⥤ MonoOver X), diff --git a/Mathlib/CategoryTheory/Sums/Associator.lean b/Mathlib/CategoryTheory/Sums/Associator.lean index 495146a14eecc8..f1153d2fbd7452 100644 --- a/Mathlib/CategoryTheory/Sums/Associator.lean +++ b/Mathlib/CategoryTheory/Sums/Associator.lean @@ -146,6 +146,7 @@ def inrCompInrCompInverseAssociator : inr_ D E ⋙ inr_ C (D ⊕ E) ⋙ inverseAssociator C D E ≅ inr_ (C ⊕ D) E := isoWhiskerLeft (inr_ _ _) (inrCompInverseAssociator C D E) ≪≫ Functor.inrCompSum' _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence of categories expressing associativity of sums of categories. -/ diff --git a/Mathlib/CategoryTheory/Sums/Products.lean b/Mathlib/CategoryTheory/Sums/Products.lean index f8ec716ab7d39a..0d33461420a323 100644 --- a/Mathlib/CategoryTheory/Sums/Products.lean +++ b/Mathlib/CategoryTheory/Sums/Products.lean @@ -115,12 +115,14 @@ def natTransOfWhiskerLeftInlInr {F G : A ⊕ A' ⥤ B} (Sum.functorEquiv A A' B).inverse.map ((η₁, η₂) :) ≫ (Sum.functorEquiv A A' B).unitInv.app G +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma natTransOfWhiskerLeftInlInr_id {F : A ⊕ A' ⥤ B} : natTransOfWhiskerLeftInlInr (𝟙 (Sum.inl_ A A' ⋙ F)) (𝟙 (Sum.inr_ A A' ⋙ F)) = 𝟙 F := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] lemma natTransOfWhiskerLeftInlInr_comp {F G H : A ⊕ A' ⥤ B} @@ -167,6 +169,7 @@ section CompatibilityWithProductAssociator variable (T : Type*) [Category* T] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The equivalence `Sum.functorEquiv` sends associativity of sums to associativity of products -/ @[simps! hom_app_fst hom_app_snd_fst hom_app_snd_snd inv_app_fst inv_app_snd_fst inv_app_snd_snd] diff --git a/Mathlib/CategoryTheory/Thin.lean b/Mathlib/CategoryTheory/Thin.lean index bcdb471330e201..5ac6b5b55d44bf 100644 --- a/Mathlib/CategoryTheory/Thin.lean +++ b/Mathlib/CategoryTheory/Thin.lean @@ -35,7 +35,7 @@ variable [CategoryStruct.{v₁} C] [Quiver.IsThin C] /-- Construct a category instance from a `CategoryStruct`, using the fact that hom spaces are subsingletons to prove the axioms. -/ -@[implicit_reducible] +@[instance_reducible] def thin_category : Category C where end diff --git a/Mathlib/CategoryTheory/Topos/Sheaf.lean b/Mathlib/CategoryTheory/Topos/Sheaf.lean index c1dadee9c9a127..bc633a5b1fe422 100644 --- a/Mathlib/CategoryTheory/Topos/Sheaf.lean +++ b/Mathlib/CategoryTheory/Topos/Sheaf.lean @@ -73,6 +73,7 @@ def Presheaf.χ (m : F ⟶ G) : G ⟶ Functor.sieves C where use F.map g.op a simp [ha, NatTrans.naturality_apply]⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma Presheaf.comp_χ_eq (m : F ⟶ G) : m ≫ Presheaf.χ m = (Functor.isTerminalConst _ Types.isTerminalPUnit).from F ≫ Presheaf.truth C := by ext @@ -135,6 +136,7 @@ end presheaf variable {J : GrothendieckTopology C} +set_option backward.isDefEq.respectTransparency.types false in open Presheaf in lemma GrothendieckTopology.isClosed_χ_app_apply_of_isSheaf_of_isSeparated {F G : Cᵒᵖ ⥤ Type (max u v)} (m : F ⟶ G) [Mono m] (hF : Presieve.IsSheaf J F) @@ -187,6 +189,7 @@ def χ (m : F ⟶ G) [Mono m] : G ⟶ Sheaf.Ω J where ((isSheaf_iff_isSheaf_of_type _ _).mp F.property) ((isSheaf_iff_isSheaf_of_type _ _).mp G.property).isSeparated _) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma isPullback_χ_truth (m : F ⟶ G) [Mono m] : IsPullback m ((isTerminalTerminal J _).from F) (Sheaf.χ m) (Sheaf.truth J) := by diff --git a/Mathlib/CategoryTheory/Triangulated/Functor.lean b/Mathlib/CategoryTheory/Triangulated/Functor.lean index f94a31bf8e579b..ece099e5b4900a 100644 --- a/Mathlib/CategoryTheory/Triangulated/Functor.lean +++ b/Mathlib/CategoryTheory/Triangulated/Functor.lean @@ -101,6 +101,7 @@ attribute [local simp] map_zsmul comp_zsmul zsmul_comp commShiftIso_zero commShiftIso_add commShiftIso_comp_hom_app shiftFunctorAdd'_eq_shiftFunctorAdd +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- Split out from the following instance for faster elaboration. set_option backward.privateInPublic true in @@ -143,6 +144,7 @@ noncomputable def mapTriangleInvRotateIso : (by simp) (by simp) (by simp)) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable (C) in /-- The canonical isomorphism `(𝟭 C).mapTriangle ≅ 𝟭 (Triangle C)`. -/ @@ -150,6 +152,7 @@ variable (C) in def mapTriangleIdIso : (𝟭 C).mapTriangle ≅ 𝟭 _ := NatIso.ofComponents (fun T ↦ Triangle.isoMk _ _ (Iso.refl _) (Iso.refl _) (Iso.refl _)) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The canonical isomorphism `(F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle`. -/ @[simps!] diff --git a/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean b/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean index 198d712223bef8..66501d4ca9368e 100644 --- a/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean +++ b/Mathlib/CategoryTheory/Triangulated/HomologicalFunctor.lean @@ -127,6 +127,7 @@ instance : F.homologicalKernel.IsTriangulated where end +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in noncomputable instance (priority := 100) [F.IsHomological] : PreservesLimitsOfShape (Discrete WalkingPair) F := by diff --git a/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean b/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean index bbd21fec91ac21..26ec47662226ba 100644 --- a/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean +++ b/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean @@ -158,7 +158,7 @@ and `B : ObjectProperty C`, this is the inclusion functor `A.ι : A.FullSubcategory ⥤ C`, considered as a localizer morphism, where `C` is equipped with the property of morphisms `B.trW` and `A.FullSubcategory` with the property of morphisms `(B.inverseImage A.ι).trW`. -/ -@[implicit_reducible] +@[instance_reducible] def triangulatedLocalizerMorphism [A.IsTriangulated] : LocalizerMorphism (B.inverseImage A.ι).trW B.trW where functor := A.ι @@ -175,6 +175,7 @@ instance [A.IsTriangulated] : (triangulatedLocalizerMorphism A B).functor.IsTriangulated := inferInstanceAs A.ι.IsTriangulated +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma trW_inverseImage_ι_iff [A.IsTriangulated] {X Y : A.FullSubcategory} (f : X ⟶ Y) : (B.inverseImage A.ι).trW f ↔ (A ⊓ B).trW f.hom := by @@ -191,6 +192,7 @@ lemma trW_inverseImage_ι_iff [A.IsTriangulated] {X Y : A.FullSubcategory} (f : · cat_disch · simp [dsimp% (A.ι.commShiftIso (1 : ℤ)).inv_hom_id_app X] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma inverseImage_opEquivalence_inverse_trW_inverseImage_ι_op [A.IsTriangulated] [B.IsTriangulated] [B.IsClosedUnderIsomorphisms] : @@ -207,6 +209,7 @@ variable [A.IsVerdierRightLocalizing B] (L₁ : A.FullSubcategory ⥤ D₁) (L₂ : C ⥤ D₂) [L₁.IsLocalization (B.inverseImage A.ι).trW] [L₂.IsLocalization B.trW] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : ((A.triangulatedLocalizerMorphism B).localizedFunctor L₁ L₂).Full := by let F := (A.triangulatedLocalizerMorphism B).localizedFunctor L₁ L₂ @@ -240,6 +243,7 @@ instance [Preadditive D₁] [Preadditive D₂] [L₁.Additive] [L₂.Additive] : (A.triangulatedLocalizerMorphism B).functor L₁ L₂ F exact Functor.additive_of_iso e +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : ((A.triangulatedLocalizerMorphism B).localizedFunctor L₁ L₂).Faithful := by letI := Localization.preadditive L₁ (B.inverseImage A.ι).trW diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean index 7a8ec10f7c0a7a..2ada327cf86f69 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Basic.lean @@ -100,6 +100,7 @@ lemma shiftFunctorZero_op_inv_app (X : Cᵒᵖ) : shiftFunctorZero_op_hom_app, assoc, ← op_comp_assoc, Iso.hom_inv_id_app, op_id, id_comp, Iso.hom_inv_id_app] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma shiftFunctorAdd'_op_hom_app (X : Cᵒᵖ) (a₁ a₂ a₃ : ℤ) (h : a₁ + a₂ = a₃) (b₁ b₂ b₃ : ℤ) (h₁ : a₁ + b₁ = 0) (h₂ : a₂ + b₂ = 0) (h₃ : a₃ + b₃ = 0) : @@ -140,7 +141,7 @@ variable (C) in functor is `(shiftFunctor C n).op`. In most cases, it is not necessary to unfold the definitions of the unit and counit isomorphisms: the compatibilities they satisfy are stated as separate lemmas. -/ -@[simps functor inverse] +@[simps functor inverse, implicit_reducible] def opShiftFunctorEquivalence (n : ℤ) : Cᵒᵖ ≌ Cᵒᵖ where functor := shiftFunctor Cᵒᵖ n inverse := (shiftFunctor C n).op diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean index a19b7a7a5fce3c..358c0a874389cb 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Functor.lean @@ -191,6 +191,7 @@ noncomputable def mapTriangleOpCompTriangleOpEquivalenceFunctorApp (T : Triangle Triangle.isoMk _ _ (Iso.refl _) (Iso.refl _) (Iso.refl _) (by simp) (by simp) (by simp [shift_map_op, map_opShiftFunctorEquivalence_counitIso_inv_app_unop]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `F : C ⥤ D` commutes with shifts, this expresses the compatibility of `F.mapTriangle` diff --git a/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean b/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean index 75654096379349..d81af1d06aac3c 100644 --- a/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean +++ b/Mathlib/CategoryTheory/Triangulated/Opposite/Triangle.lean @@ -108,6 +108,7 @@ noncomputable def counitIso : inverse C ⋙ functor C ≅ 𝟭 _ := end TriangleOpEquivalence +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- An anti-equivalence between the categories of triangles in `C` and in `Cᵒᵖ`. A triangle in `Cᵒᵖ` shall be distinguished iff it corresponds to a distinguished diff --git a/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean b/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean index 6c4dcfcabba059..e8cc03adc93e73 100644 --- a/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean +++ b/Mathlib/CategoryTheory/Triangulated/Pretriangulated.lean @@ -182,6 +182,7 @@ lemma distinguished_cocone_triangle₂ {Z X : C} (h : Z ⟶ X⟦(1 : ℤ)⟧) : (by cat_disch) (by cat_disch) (by dsimp; simp only [shift_shiftFunctorCompIsoId_inv_app, id_comp]) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A commutative square involving the morphisms `mor₂` of two distinguished triangles can be extended as morphism of triangles -/ @@ -242,6 +243,7 @@ namespace Triangle variable (T : Triangle C) (hT : T ∈ distTriang C) include hT +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma yoneda_exact₂ {X : C} (f : T.obj₂ ⟶ X) (hf : T.mor₁ ≫ f = 0) : ∃ (g : T.obj₃ ⟶ X), f = T.mor₂ ≫ g := by @@ -253,6 +255,7 @@ lemma yoneda_exact₃ {X : C} (f : T.obj₃ ⟶ X) (hf : T.mor₂ ≫ f = 0) : ∃ (g : T.obj₁⟦(1 : ℤ)⟧ ⟶ X), f = T.mor₃ ≫ g := yoneda_exact₂ _ (rot_of_distTriang _ hT) f hf +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma coyoneda_exact₂ {X : C} (f : X ⟶ T.obj₂) (hf : f ≫ T.mor₂ = 0) : ∃ (g : X ⟶ T.obj₁), f = g ≫ T.mor₁ := by diff --git a/Mathlib/CategoryTheory/Triangulated/Subcategory.lean b/Mathlib/CategoryTheory/Triangulated/Subcategory.lean index d80856d3f48c93..ce5c10f55c46db 100644 --- a/Mathlib/CategoryTheory/Triangulated/Subcategory.lean +++ b/Mathlib/CategoryTheory/Triangulated/Subcategory.lean @@ -639,6 +639,7 @@ instance [IsTriangulated C] [P.IsTriangulated] : P.trW.HasRightCalculusOfFractio dsimp at eq rw [← sub_eq_zero, ← comp_sub, hq, reassoc_of% eq, zero_comp] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance [IsTriangulated C] [P.IsTriangulated] : P.trW.IsCompatibleWithTriangulation := ⟨by rintro T₁ T₃ mem₁ mem₃ a b ⟨Z₅, g₅, h₅, mem₅, mem₅'⟩ ⟨Z₄, g₄, h₄, mem₄, mem₄'⟩ comm diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/AbelianSubcategory.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/AbelianSubcategory.lean index 4cf10b27ede892..a7e8cbc21860a7 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/AbelianSubcategory.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/AbelianSubcategory.lean @@ -304,7 +304,7 @@ is abelian if the following conditions are satisfied: we complete `ι.obj f₁` in a distinguished triangle `ι.obj X₁ ⟶ ι.obj X₂ ⟶ X₃ ⟶ (ι.obj X₁)⟦1⟧`, there exists objects `K` and `Q`, and a distinguished triangle `(ι.obj K)⟦1⟧ ⟶ X₃ ⟶ (ι.obj Q) ⟶ ...`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def abelian [IsTriangulated C] : Abelian A := Abelian.mk' (fun X₁ X₂ f₁ ↦ by obtain ⟨X₃, f₂, f₃, hT⟩ := distinguished_cocone_triangle (ι.map f₁) diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean index dfea1ee2660993..f0c00f382b1fd8 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/Basic.lean @@ -74,6 +74,7 @@ attribute [instance] le_isClosedUnderIsomorphisms ge_isClosedUnderIsomorphisms variable {C} variable (t : TStructure C) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma exists_triangle (A : C) (n₀ n₁ : ℤ) (h : n₀ + 1 = n₁) : ∃ (X Y : C) (_ : t.le n₀ X) (_ : t.ge n₁ Y) (f : X ⟶ A) (g : A ⟶ Y) diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/ETrunc.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/ETrunc.lean index d098e1ecf37b55..3be0ed6a314593 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/ETrunc.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/ETrunc.lean @@ -33,6 +33,7 @@ namespace TStructure variable (t : TStructure C) +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `EInt ⥤ C ⥤ C` which sends `⊥` to the zero functor, `n : ℤ` to `t.truncLT n` and `⊤` to `𝟭 C`. -/ noncomputable def eTruncLT : EInt ⥤ C ⥤ C where @@ -78,6 +79,7 @@ instance (i : EInt) : (t.eTruncLT.obj i).Additive := by induction i using WithBotTop.rec all_goals dsimp; infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- The functor `EInt ⥤ C ⥤ C` which sends `⊥` to `𝟭 C`, `n : ℤ` to `t.truncGE n` and `⊤` to the zero functor. -/ noncomputable def eTruncGE : EInt ⥤ C ⥤ C where diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/Heart.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/Heart.lean index 0c258022806f56..7ee75dc56b1af7 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/Heart.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/Heart.lean @@ -65,7 +65,7 @@ class Heart where /-- Unless a better candidate category is available, the full subcategory of objects satisfying `t.heart` can be chosen as the heart of a t-structure `t`. -/ -@[implicit_reducible] +@[instance_reducible] def hasHeartFullSubcategory : t.Heart t.heart.FullSubcategory where ι := t.heart.ι essImage_eq_heart := by diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLEGT.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLEGT.lean index adf345f4437820..2f553a762cadbb 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLEGT.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLEGT.lean @@ -94,6 +94,7 @@ lemma truncLEIsoTruncLT_hom_ι_app (a b : ℤ) (h : a + 1 = b) (X : C) : (t.truncLEIsoTruncLT a b h).hom.app X ≫ (t.truncLTι b).app X = (t.truncLEι a).app X := congr_app (t.truncLEIsoTruncLT_hom_ι a b h) X +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma truncLEIsoTruncLT_inv_ι (a b : ℤ) (h : a + 1 = b) : @@ -162,6 +163,7 @@ lemma π_truncGTIsoTruncGE_hom_ι_app (a b : ℤ) (h : a + 1 = b) (X : C) : (t.truncGTπ a).app X ≫ (t.truncGTIsoTruncGE a b h).hom.app X = (t.truncGEπ b).app X := congr_app (t.π_truncGTIsoTruncGE_hom a b h) X +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma π_truncGTIsoTruncGE_inv (a b : ℤ) (h : a + 1 = b) : diff --git a/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLTGE.lean b/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLTGE.lean index c6b767d4e658c6..06fec2fa03e043 100644 --- a/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLTGE.lean +++ b/Mathlib/CategoryTheory/Triangulated/TStructure/TruncLTGE.lean @@ -196,6 +196,7 @@ noncomputable def triangleFunctorNatTransOfLE (a b : ℤ) (h : a ≤ b) : lemma triangleFunctorNatTransOfLE_app_hom₂ (a b : ℤ) (h : a ≤ b) (X : C) : ((triangleFunctorNatTransOfLE t a b h).app X).hom₂ = 𝟙 X := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma triangleFunctorNatTransOfLE_trans (a b c : ℤ) (hab : a ≤ b) (hbc : b ≤ c) : triangleFunctorNatTransOfLE t a b hab ≫ triangleFunctorNatTransOfLE t b c hbc = @@ -351,6 +352,7 @@ noncomputable def natTransTruncGEOfLE (a b : ℤ) (h : a ≤ b) : t.truncGE a ⟶ t.truncGE b := Functor.whiskerRight (TruncAux.triangleFunctorNatTransOfLE t a b h) Triangle.π₃ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma natTransTruncLTOfLE_ι_app (a b : ℤ) (h : a ≤ b) (X : C) : @@ -363,6 +365,7 @@ lemma natTransTruncLTOfLE_ι (a b : ℤ) (h : a ≤ b) : t.natTransTruncLTOfLE a b h ≫ t.truncLTι b = t.truncLTι a := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma π_natTransTruncGEOfLE_app (a b : ℤ) (h : a ≤ b) (X : C) : diff --git a/Mathlib/CategoryTheory/Triangulated/Yoneda.lean b/Mathlib/CategoryTheory/Triangulated/Yoneda.lean index ecefc73618f020..c37aa096149e65 100644 --- a/Mathlib/CategoryTheory/Triangulated/Yoneda.lean +++ b/Mathlib/CategoryTheory/Triangulated/Yoneda.lean @@ -94,6 +94,7 @@ lemma preadditiveYoneda_shiftMap_apply (B : C) {X Y : Cᵒᵖ} (n : ℤ) (f : X symm apply ShiftedHom.opEquiv_symm_apply_comp +set_option backward.isDefEq.respectTransparency.types false in lemma preadditiveYoneda_homologySequenceδ_apply (T : Triangle C) (n₀ n₁ : ℤ) (h : n₀ + 1 = n₁) {B : C} (x : T.obj₁ ⟶ B⟦n₀⟧) : (preadditiveYoneda.obj B).homologySequenceδ diff --git a/Mathlib/CategoryTheory/Whiskering.lean b/Mathlib/CategoryTheory/Whiskering.lean index db8c41289954fc..9c718d6ef8a982 100644 --- a/Mathlib/CategoryTheory/Whiskering.lean +++ b/Mathlib/CategoryTheory/Whiskering.lean @@ -78,7 +78,7 @@ set_option backward.defeqAttrib.useBackward true in `(whiskeringLeft.obj F).obj G` is `F ⋙ G`, and `(whiskeringLeft.obj F).map α` is `whiskerLeft F α`. -/ -@[simps] +@[simps, implicit_reducible] def whiskeringLeft : (C ⥤ D) ⥤ (D ⥤ E) ⥤ C ⥤ E where obj F := { obj := fun G => F ⋙ G @@ -89,13 +89,16 @@ def whiskeringLeft : (C ⥤ D) ⥤ (D ⥤ E) ⥤ C ⥤ E where naturality := fun X Y f => by dsimp; rw [← H.map_comp, ← H.map_comp, ← τ.naturality] } naturality := fun X Y f => by ext; dsimp; rw [f.naturality] } +-- TODO: Is there something to learn from the necessity to do this? Should it be done automatically? +attribute [defeq, simp] whiskeringLeft_obj_obj + set_option backward.defeqAttrib.useBackward true in /-- Right-composition gives a functor `(D ⥤ E) ⥤ ((C ⥤ D) ⥤ (C ⥤ E))`. `(whiskeringRight.obj H).obj F` is `F ⋙ H`, and `(whiskeringRight.obj H).map α` is `whiskerRight α H`. -/ -@[simps] +@[simps, implicit_reducible] def whiskeringRight : (D ⥤ E) ⥤ (C ⥤ D) ⥤ C ⥤ E where obj H := { obj := fun F => F ⋙ H @@ -114,6 +117,7 @@ instance faithful_whiskeringRight_obj {F : D ⥤ E} [F.Faithful] : ext X exact F.map_injective <| congr_fun (congr_arg NatTrans.app hαβ) X +set_option backward.isDefEq.respectTransparency false in /-- If `F : D ⥤ E` is fully faithful, then so is `(whiskeringRight C D E).obj F : (C ⥤ D) ⥤ C ⥤ E`. -/ @[simps] @@ -396,8 +400,9 @@ variable {C₁ C₂ C₃ D₁ D₂ D₃ : Type*} [Category* C₁] [Category* C [Category* D₁] [Category* D₂] [Category* D₃] (E : Type*) [Category* E] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- The obvious functor `(C₁ ⥤ D₁) ⥤ (C₂ ⥤ D₂) ⥤ (D₁ ⥤ D₂ ⥤ E) ⥤ (C₁ ⥤ C₂ ⥤ E)`. -/ -@[simps!] +@[simps!, implicit_reducible] def whiskeringLeft₂ : (C₁ ⥤ D₁) ⥤ (C₂ ⥤ D₂) ⥤ (D₁ ⥤ D₂ ⥤ E) ⥤ (C₁ ⥤ C₂ ⥤ E) where obj F₁ := @@ -417,6 +422,7 @@ def whiskeringLeft₃ObjObjObj (F₁ : C₁ ⥤ D₁) (F₂ : C₂ ⥤ D₂) (F (whiskeringLeft C₁ D₁ _).obj F₁ set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `whiskeringLeft₃`. -/ @[simps] def whiskeringLeft₃ObjObjMap (F₁ : C₁ ⥤ D₁) (F₂ : C₂ ⥤ D₂) {F₃ F₃' : C₃ ⥤ D₃} (τ₃ : F₃ ⟶ F₃') : @@ -424,6 +430,7 @@ def whiskeringLeft₃ObjObjMap (F₁ : C₁ ⥤ D₁) (F₂ : C₂ ⥤ D₂) {F whiskeringLeft₃ObjObjObj E F₁ F₂ F₃' where app F := whiskerLeft _ (whiskerLeft _ (((whiskeringLeft₂ E).obj F₂).map τ₃)) +set_option backward.isDefEq.respectTransparency false in variable (C₃ D₃) in /-- Auxiliary definition for `whiskeringLeft₃`. -/ @[simps] @@ -433,6 +440,7 @@ def whiskeringLeft₃ObjObj (F₁ : C₁ ⥤ D₁) (F₂ : C₂ ⥤ D₂) : map τ₃ := whiskeringLeft₃ObjObjMap E F₁ F₂ τ₃ set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in variable (C₃ D₃) in /-- Auxiliary definition for `whiskeringLeft₃`. -/ @[simps] @@ -449,6 +457,7 @@ def whiskeringLeft₃Obj (F₁ : C₁ ⥤ D₁) : map τ₂ := whiskeringLeft₃ObjMap C₃ D₃ E F₁ τ₂ set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in variable (C₂ C₃ D₂ D₃) in /-- Auxiliary definition for `whiskeringLeft₃`. -/ @[simps] @@ -458,7 +467,7 @@ def whiskeringLeft₃Map {F₁ F₁' : C₁ ⥤ D₁} (τ₁ : F₁ ⟶ F₁') : /-- The obvious functor `(C₁ ⥤ D₁) ⥤ (C₂ ⥤ D₂) ⥤ (C₃ ⥤ D₃) ⥤ (D₁ ⥤ D₂ ⥤ D₃ ⥤ E) ⥤ (C₁ ⥤ C₂ ⥤ C₃ ⥤ E)`. -/ -@[simps!] +@[simps!, implicit_reducible] def whiskeringLeft₃ : (C₁ ⥤ D₁) ⥤ (C₂ ⥤ D₂) ⥤ (C₃ ⥤ D₃) ⥤ (D₁ ⥤ D₂ ⥤ D₃ ⥤ E) ⥤ (C₁ ⥤ C₂ ⥤ C₃ ⥤ E) where obj F₁ := whiskeringLeft₃Obj C₂ C₃ D₂ D₃ E F₁ @@ -468,14 +477,14 @@ variable {E} /-- The "postcomposition" with a functor `E ⥤ E'` gives a functor `(E ⥤ E') ⥤ (C₁ ⥤ C₂ ⥤ E) ⥤ C₁ ⥤ C₂ ⥤ E'`. -/ -@[simps!] +@[simps!, implicit_reducible] def postcompose₂ {E' : Type*} [Category* E'] : (E ⥤ E') ⥤ (C₁ ⥤ C₂ ⥤ E) ⥤ C₁ ⥤ C₂ ⥤ E' := whiskeringRight C₂ _ _ ⋙ whiskeringRight C₁ _ _ /-- The "postcomposition" with a functor `E ⥤ E'` gives a functor `(E ⥤ E') ⥤ (C₁ ⥤ C₂ ⥤ C₃ ⥤ E) ⥤ C₁ ⥤ C₂ ⥤ C₃ ⥤ E'`. -/ -@[simps!] +@[simps!, implicit_reducible] def postcompose₃ {E' : Type*} [Category* E'] : (E ⥤ E') ⥤ (C₁ ⥤ C₂ ⥤ C₃ ⥤ E) ⥤ C₁ ⥤ C₂ ⥤ C₃ ⥤ E' := whiskeringRight C₃ _ _ ⋙ whiskeringRight C₂ _ _ ⋙ whiskeringRight C₁ _ _ diff --git a/Mathlib/CategoryTheory/WithTerminal/Basic.lean b/Mathlib/CategoryTheory/WithTerminal/Basic.lean index dc00c176e29eb2..af5da24de8c6a3 100644 --- a/Mathlib/CategoryTheory/WithTerminal/Basic.lean +++ b/Mathlib/CategoryTheory/WithTerminal/Basic.lean @@ -100,32 +100,41 @@ attribute [nolint simpNF] comp.eq_2 comp.eq_4 @[aesop safe destruct (rule_sets := [CategoryTheory])] lemma false_of_from_star' {X : C} (f : Hom star (of X)) : False := (f : PEmpty).elim +set_option backward.isDefEq.respectTransparency.types false in instance : Category.{v} (WithTerminal C) where Hom X Y := Hom X Y id _ := id _ comp := comp +set_option backward.isDefEq.respectTransparency.types false in /-- Helper function for typechecking. -/ def down {X Y : C} (f : of X ⟶ of Y) : X ⟶ Y := f +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma down_id {X : C} : down (𝟙 (of X)) = 𝟙 X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma down_comp {X Y Z : C} (f : of X ⟶ of Y) (g : of Y ⟶ of Z) : down (f ≫ g) = down f ≫ down g := rfl +set_option backward.isDefEq.respectTransparency.types false in @[aesop safe destruct (rule_sets := [CategoryTheory])] lemma false_of_from_star {X : C} (f : star ⟶ of X) : False := (f : PEmpty).elim +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion from `C` into `WithTerminal C`. -/ def incl : C ⥤ WithTerminal C where obj := of map f := f +set_option backward.isDefEq.respectTransparency.types false in instance : (incl : C ⥤ _).Full where map_surjective f := ⟨f, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in instance : (incl : C ⥤ _).Faithful where +set_option backward.isDefEq.respectTransparency.types false in /-- Map `WithTerminal` with respect to a functor `F : C ⥤ D`. -/ @[simps] def map {D : Type*} [Category* D] (F : C ⥤ D) : WithTerminal C ⥤ WithTerminal D where @@ -139,6 +148,7 @@ def map {D : Type*} [Category* D] (F : C ⥤ D) : WithTerminal C ⥤ WithTermina | of _, star, _ => PUnit.unit | star, star, _ => PUnit.unit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism between the functor `map (𝟭 C)` and `𝟭 (WithTerminal C)`. -/ @[simps!] @@ -147,6 +157,7 @@ def mapId (C : Type*) [Category* C] : map (𝟭 C) ≅ 𝟭 (WithTerminal C) := | of _ => Iso.refl _ | star => Iso.refl _) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism between the functor `map (F ⋙ G) ` and `map F ⋙ map G `. -/ @[simps!] @@ -156,6 +167,7 @@ def mapComp {D E : Type*} [Category* D] [Category* E] (F : C ⥤ D) (G : D ⥤ E | of _ => Iso.refl _ | star => Iso.refl _) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in /-- From a natural transformation of functors `C ⥤ D`, the induced natural transformation of functors `WithTerminal C ⥤ WithTerminal D`. -/ @[simps] @@ -171,6 +183,7 @@ def map₂ {D : Type*} [Category* D] {F G : C ⥤ D} (η : F ⟶ G) : map F ⟶ | star, star, _ => rfl -- Note: ... +set_option backward.isDefEq.respectTransparency.types false in /-- The prelax functor from `Cat` to `Cat` defined with `WithTerminal`. -/ @[simps] def prelaxfunctor : PrelaxFunctor Cat Cat where @@ -227,6 +240,7 @@ def pseudofunctor : Pseudofunctor Cat Cat where · simpa using! (refl _) · rfl +set_option backward.isDefEq.respectTransparency.types false in instance {X : WithTerminal C} : Unique (X ⟶ star) where default := match X with @@ -234,10 +248,12 @@ instance {X : WithTerminal C} : Unique (X ⟶ star) where | star => PUnit.unit uniq := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- `WithTerminal.star` is terminal. -/ def starTerminal : Limits.IsTerminal (star : WithTerminal C) := Limits.IsTerminal.ofUnique _ +set_option backward.isDefEq.respectTransparency.types false in instance : Limits.HasTerminal (WithTerminal C) := Limits.hasTerminal_of_unique star /-- The isomorphism between star and an abstract terminal object of `WithTerminal C` -/ @@ -245,6 +261,7 @@ instance : Limits.HasTerminal (WithTerminal C) := Limits.hasTerminal_of_unique s noncomputable def starIsoTerminal : star ≅ ⊤_ (WithTerminal C) := starTerminal.uniqueUpToIso (Limits.terminalIsTerminal) +set_option backward.isDefEq.respectTransparency.types false in /-- Lift a functor `F : C ⥤ D` to `WithTerminal C ⥤ D`. -/ @[simps] def lift {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.obj x ⟶ Z) @@ -267,6 +284,7 @@ def inclLift {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.o hom := { app := fun _ => 𝟙 _ } inv := { app := fun _ => 𝟙 _ } +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism between `(lift F _ _).obj WithTerminal.star` with `Z`. -/ @[simps!] def liftStar {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.obj x ⟶ Z) @@ -282,6 +300,7 @@ theorem lift_map_liftStar {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : simp rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The uniqueness of `lift`. -/ @[simp] def liftUnique {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.obj x ⟶ Z) @@ -305,18 +324,21 @@ def liftUnique {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F change G.map (𝟙 _) ≫ hG.hom = hG.hom ≫ 𝟙 _ simp) +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `lift` with `Z` a terminal object. -/ @[simps!] def liftToTerminal {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z) : WithTerminal C ⥤ D := lift F (fun _x => hZ.from _) fun _x _y _f => hZ.hom_ext _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `incl_lift` with `Z` a terminal object. -/ @[simps!] def inclLiftToTerminal {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z) : incl ⋙ liftToTerminal F hZ ≅ F := inclLift _ _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `lift_unique` with `Z` a terminal object. -/ @[simps!] def liftToTerminalUnique {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z) @@ -324,11 +346,13 @@ def liftToTerminalUnique {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : L liftUnique F (fun _z => hZ.from _) (fun _x _y _f => hZ.hom_ext _ _) G h hG fun _x => hZ.hom_ext _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- Constructs a morphism to `star` from `of X`. -/ @[simp] def homFrom (X : C) : incl.obj X ⟶ star := starTerminal.from _ +set_option backward.isDefEq.respectTransparency.types false in instance isIso_of_from_star {X : WithTerminal C} (f : star ⟶ X) : IsIso f := match X with | of _X => f.elim @@ -338,6 +362,7 @@ section variable {D : Type*} [Category* D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor `WithTerminal C ⥤ D` can be seen as an element of the comma category `Comma (𝟭 (C ⥤ D)) (const C)`. -/ @@ -352,6 +377,7 @@ def mkCommaObject (F : WithTerminal C ⥤ D) : Comma (𝟭 (C ⥤ D)) (Functor.c rw [Category.comp_id, ← F.map_comp] congr 1 } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A morphism of functors `WithTerminal C ⥤ D` gives a morphism between the associated comma objects. -/ @@ -368,6 +394,7 @@ functor `WithTerminal C ⥤ D`. -/ def ofCommaObject (c : Comma (𝟭 (C ⥤ D)) (Functor.const C)) : WithTerminal C ⥤ D := lift (Z := c.right) c.left (fun x ↦ c.hom.app x) (fun x y f ↦ by simp) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A morphism in `Comma (𝟭 (C ⥤ D)) (Functor.const C)` gives a morphism between the associated functors `WithTerminal C ⥤ D`. -/ @@ -428,6 +455,7 @@ instance subsingleton_hom {J : Type*} : Quiver.IsThin (WithTerminal (Discrete J) · rfl · rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Implementation detail for `widePullbackShapeEquiv`. -/ @@ -514,32 +542,41 @@ attribute [nolint simpNF] comp.eq_3 @[aesop safe destruct (rule_sets := [CategoryTheory])] lemma false_of_to_star' {X : C} (f : Hom (of X) star) : False := (f : PEmpty).elim +set_option backward.isDefEq.respectTransparency.types false in instance : Category.{v} (WithInitial C) where Hom X Y := Hom X Y id X := id X comp f g := comp f g +set_option backward.isDefEq.respectTransparency.types false in /-- Helper function for typechecking. -/ def down {X Y : C} (f : of X ⟶ of Y) : X ⟶ Y := f +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma down_id {X : C} : down (𝟙 (of X)) = 𝟙 X := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma down_comp {X Y Z : C} (f : of X ⟶ of Y) (g : of Y ⟶ of Z) : down (f ≫ g) = down f ≫ down g := rfl +set_option backward.isDefEq.respectTransparency.types false in @[aesop safe destruct (rule_sets := [CategoryTheory])] lemma false_of_to_star {X : C} (f : of X ⟶ star) : False := (f : PEmpty).elim +set_option backward.isDefEq.respectTransparency.types false in /-- The inclusion of `C` into `WithInitial C`. -/ def incl : C ⥤ WithInitial C where obj := of map f := f +set_option backward.isDefEq.respectTransparency.types false in instance : (incl : C ⥤ _).Full where map_surjective f := ⟨f, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in instance : (incl : C ⥤ _).Faithful where +set_option backward.isDefEq.respectTransparency.types false in /-- Map `WithInitial` with respect to a functor `F : C ⥤ D`. -/ @[simps] def map {D : Type*} [Category* D] (F : C ⥤ D) : WithInitial C ⥤ WithInitial D where @@ -553,6 +590,7 @@ def map {D : Type*} [Category* D] (F : C ⥤ D) : WithInitial C ⥤ WithInitial | star, of _, _ => PUnit.unit | star, star, _ => PUnit.unit +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism between the functor `map (𝟭 C)` and `𝟭 (WithInitial C)`. -/ @[simps!] @@ -561,6 +599,7 @@ def mapId (C : Type*) [Category* C] : map (𝟭 C) ≅ 𝟭 (WithInitial C) := | of _ => Iso.refl _ | star => Iso.refl _) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A natural isomorphism between the functor `map (F ⋙ G) ` and `map F ⋙ map G `. -/ @[simps!] @@ -570,6 +609,7 @@ def mapComp {D E : Type*} [Category* D] [Category* E] (F : C ⥤ D) (G : D ⥤ E | of _ => Iso.refl _ | star => Iso.refl _) (by cat_disch) +set_option backward.isDefEq.respectTransparency.types false in /-- From a natural transformation of functors `C ⥤ D`, the induced natural transformation of functors `WithInitial C ⥤ WithInitial D`. -/ @[simps] @@ -584,6 +624,7 @@ def map₂ {D : Type*} [Category* D] {F G : C ⥤ D} (η : F ⟶ G) : map F ⟶ | star, of x, _ => rfl | star, star, _ => rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The prelax functor from `Cat` to `Cat` defined with `WithInitial`. -/ @[simps] def prelaxfunctor : PrelaxFunctor Cat Cat where @@ -639,6 +680,7 @@ def pseudofunctor : Pseudofunctor Cat Cat where · simpa using! (refl _) · rfl +set_option backward.isDefEq.respectTransparency.types false in instance {X : WithInitial C} : Unique (star ⟶ X) where default := match X with @@ -646,10 +688,12 @@ instance {X : WithInitial C} : Unique (star ⟶ X) where | star => PUnit.unit uniq := by cat_disch +set_option backward.isDefEq.respectTransparency.types false in /-- `WithInitial.star` is initial. -/ def starInitial : Limits.IsInitial (star : WithInitial C) := Limits.IsInitial.ofUnique _ +set_option backward.isDefEq.respectTransparency.types false in instance : Limits.HasInitial (WithInitial C) := Limits.hasInitial_of_unique star /-- The isomorphism between star and an abstract initial object of `WithInitial C` -/ @@ -657,6 +701,7 @@ instance : Limits.HasInitial (WithInitial C) := Limits.hasInitial_of_unique star noncomputable def starIsoInitial : star ≅ ⊥_ (WithInitial C) := starInitial.uniqueUpToIso (Limits.initialIsInitial) +set_option backward.isDefEq.respectTransparency.types false in /-- Lift a functor `F : C ⥤ D` to `WithInitial C ⥤ D`. -/ @[simps] def lift {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x) @@ -679,12 +724,14 @@ def inclLift {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z hom := { app := fun _ => 𝟙 _ } inv := { app := fun _ => 𝟙 _ } +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism between `(lift F _ _).obj WithInitial.star` with `Z`. -/ @[simps!] def liftStar {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x) (hM : ∀ (x y : C) (f : x ⟶ y), M x ≫ F.map f = M y) : (lift F M hM).obj star ≅ Z := eqToIso rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem liftStar_lift_map {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x) (hM : ∀ (x y : C) (f : x ⟶ y), M x ≫ F.map f = M y) (x : C) : @@ -719,29 +766,34 @@ def liftUnique {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z change G.map (𝟙 _) ≫ hG.hom = hG.hom ≫ 𝟙 _ simp) +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `lift` with `Z` an initial object. -/ @[simps!] def liftToInitial {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z) : WithInitial C ⥤ D := lift F (fun _x => hZ.to _) fun _x _y _f => hZ.hom_ext _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `incl_lift` with `Z` an initial object. -/ @[simps!] def inclLiftToInitial {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z) : incl ⋙ liftToInitial F hZ ≅ F := inclLift _ _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- A variant of `lift_unique` with `Z` an initial object. -/ @[simps!] def liftToInitialUnique {D : Type*} [Category* D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z) (G : WithInitial C ⥤ D) (h : incl ⋙ G ≅ F) (hG : G.obj star ≅ Z) : G ≅ liftToInitial F hZ := liftUnique F (fun _z => hZ.to _) (fun _x _y _f => hZ.hom_ext _ _) G h hG fun _x => hZ.hom_ext _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- Constructs a morphism from `star` to `of X`. -/ @[simp] def homTo (X : C) : star ⟶ incl.obj X := starInitial.to _ +set_option backward.isDefEq.respectTransparency.types false in instance isIso_of_to_star {X : WithInitial C} (f : X ⟶ star) : IsIso f := match X with | of _ => f.elim @@ -751,6 +803,7 @@ section variable {D : Type*} [Category* D] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A functor `WithInitial C ⥤ D` can be seen as an element of the comma category `Comma (const C) (𝟭 (C ⥤ D))`. -/ @@ -765,6 +818,7 @@ def mkCommaObject (F : WithInitial C ⥤ D) : Comma (Functor.const C) (𝟭 (C rw [Category.id_comp, ← F.map_comp] congr 1 } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- A morphism of functors `WithInitial C ⥤ D` gives a morphism between the associated comma objects. -/ diff --git a/Mathlib/CategoryTheory/WithTerminal/Cone.lean b/Mathlib/CategoryTheory/WithTerminal/Cone.lean index eb1afc6c3b4b56..4573ffe9cfd28a 100644 --- a/Mathlib/CategoryTheory/WithTerminal/Cone.lean +++ b/Mathlib/CategoryTheory/WithTerminal/Cone.lean @@ -56,6 +56,7 @@ def commaFromOver : (J ⥤ Over X) ⥤ Comma (𝟭 (J ⥤ C)) (Functor.const J) @[simps!] def liftFromOver : (J ⥤ Over X) ⥤ WithTerminal J ⥤ C := commaFromOver ⋙ equivComma.inverse +set_option backward.isDefEq.respectTransparency.types false in /-- The extension of a functor to over categories behaves well with compositions. -/ @[simps] def liftFromOverComp : liftFromOver.obj (K ⋙ Over.post F) ≅ liftFromOver.obj K ⋙ F where @@ -87,6 +88,7 @@ private def coneLift : Cone K ⥤ Cone (liftFromOver.obj K) where | of a => by simp [← Comma.comp_left] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- This is the inverse of the previous construction: a cone of an extended functor @@ -102,6 +104,7 @@ private def coneBack : Cone (liftFromOver.obj K) ⥤ Cone K where { hom := Over.homMk f.hom (by simp [dsimp% f.w star] ) w j := by ext; simp [dsimp% f.w (of j)] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Given a functor `K : J ⥤ Over X` and its extension `liftFromOver K : WithTerminal J ⥤ C`, @@ -170,6 +173,7 @@ def commaFromUnder : (J ⥤ Under X) ⥤ Comma (Functor.const J) (𝟭 (J ⥤ C) @[simps!] def liftFromUnder : (J ⥤ Under X) ⥤ WithInitial J ⥤ C := commaFromUnder ⋙ equivComma.inverse +set_option backward.isDefEq.respectTransparency.types false in /-- The extension of a functor to under categories behaves well with compositions. -/ @[simps] def liftFromUnderComp : liftFromUnder.obj (K ⋙ Under.post F) ≅ liftFromUnder.obj K ⋙ F where @@ -201,6 +205,7 @@ private def coconeLift : Cocone K ⥤ Cocone (liftFromUnder.obj K) where | of a => by simp [← Comma.comp_right] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- This is the inverse of the previous construction: a cocone of an extended functor @@ -216,6 +221,7 @@ private def coconeBack : Cocone (liftFromUnder.obj K) ⥤ Cocone K where { hom := Under.homMk f.hom (f.w .star) w j := by ext; simp [dsimp% f.w (of j)] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Given a functor `K : J ⥤ Under X` and its extension `liftFromUnder K : WithInitial J ⥤ C`, diff --git a/Mathlib/CategoryTheory/Yoneda.lean b/Mathlib/CategoryTheory/Yoneda.lean index 3388c9f734728f..a908622aed3811 100644 --- a/Mathlib/CategoryTheory/Yoneda.lean +++ b/Mathlib/CategoryTheory/Yoneda.lean @@ -39,7 +39,7 @@ universe w v v₁ v₂ u₁ u₂ variable {C : Type u₁} [Category.{v₁} C] /-- The Yoneda embedding, as a functor from `C` into presheaves on `C`. -/ -@[simps obj_obj obj_map map_app, stacks 001O] +@[simps obj_obj obj_map map_app, stacks 001O, implicit_reducible] def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁ where obj X := { obj Y := (unop Y) ⟶ X @@ -762,6 +762,7 @@ lemma yonedaEquiv_yoneda_map {X Y : C} (f : X ⟶ Y) : yonedaEquiv (yoneda.map f rw [yonedaEquiv_apply] simp +set_option backward.isDefEq.respectTransparency.types false in lemma yonedaEquiv_symm_naturality_left {X X' : C} (f : X' ⟶ X) (F : Cᵒᵖ ⥤ Type v₁) (x : F.obj ⟨X⟩) : yoneda.map f ≫ yonedaEquiv.symm x = yonedaEquiv.symm ((F.map f.op) x) := by apply yonedaEquiv.injective @@ -845,6 +846,7 @@ def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C := variable {C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /- Porting note: this used to be two calls to `tidy` -/ /-- The curried version of yoneda lemma when `C` is small. -/ @@ -879,6 +881,7 @@ def yonedaOpCompYonedaObj {C : Type u₁} [Category.{v₁} C] (P : Cᵒᵖ ⥤ T yoneda.op ⋙ yoneda.obj P ≅ P ⋙ uliftFunctor.{u₁} := isoWhiskerRight largeCurriedYonedaLemma ((evaluation _ _).obj P) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The curried version of yoneda lemma when `C` is small. -/ def curriedYonedaLemma' {C : Type u₁} [SmallCategory C] : @@ -1085,6 +1088,7 @@ def coyonedaLemma : coyonedaPairing C ≅ coyonedaEvaluation C := variable {C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /- Porting note: this used to be two calls to `tidy` -/ /-- The curried version of coyoneda lemma when `C` is small. -/ @@ -1120,6 +1124,7 @@ def coyonedaCompYonedaObj {C : Type u₁} [Category.{v₁} C] (P : C ⥤ Type v coyoneda.rightOp ⋙ yoneda.obj P ≅ P ⋙ uliftFunctor.{u₁} := isoWhiskerRight largeCurriedCoyonedaLemma ((evaluation _ _).obj P) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The curried version of coyoneda lemma when `C` is small. -/ def curriedCoyonedaLemma' {C : Type u₁} [SmallCategory C] : @@ -1149,6 +1154,7 @@ lemma isIso_iff_isIso_coyoneda_map {X Y : C} (f : X ⟶ Y) : rw [isIso_iff_coyoneda_map_bijective] exact forall_congr' fun _ ↦ bijective_iff_isIso_ofHom _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Coyoneda's lemma as a bijection `(uliftCoyoneda.{w}.obj X ⟶ F) ≃ F.obj (op X)` for any presheaf of type `F : Cᵒᵖ ⥤ Type (max w v₁)` for some @@ -1165,6 +1171,7 @@ def uliftCoyonedaEquiv {X : Cᵒᵖ} {F : C ⥤ Type (max w v₁)} : attribute [simp] uliftCoyonedaEquiv_symm_apply_app +set_option backward.isDefEq.respectTransparency.types false in lemma uliftCoyonedaEquiv_naturality {X Y : C} {F : C ⥤ Type max w v₁} (f : uliftCoyoneda.{w}.obj (op X) ⟶ F) (g : X ⟶ Y) : F.map g (uliftCoyonedaEquiv.{w} f) = uliftCoyonedaEquiv.{w} (uliftCoyoneda.map g.op ≫ f) := by @@ -1191,6 +1198,7 @@ lemma uliftCoyonedaEquiv_uliftCoyoneda_map {X Y : Cᵒᵖ} (f : X ⟶ Y) : uliftCoyonedaEquiv.{w} (uliftCoyoneda.map f) = ULift.up f.unop := by simp [uliftCoyonedaEquiv, uliftYoneda] +set_option backward.isDefEq.respectTransparency.types false in /-- Two morphisms of presheaves of types `P ⟶ Q` coincide if the precompositions with morphisms `uliftCoyoneda.obj X ⟶ P` agree. -/ lemma hom_ext_uliftCoyoneda {P Q : C ⥤ Type (max w v₁)} {f g : P ⟶ Q} @@ -1258,6 +1266,7 @@ section variable {C : Type u₁} [Category.{v₁} C] +set_option backward.isDefEq.respectTransparency.types false in /-- A type-level equivalence between sections of a functor and morphisms from a terminal functor to it. We use the constant functor on a given singleton type here as a specific choice of terminal functor. -/ @@ -1300,6 +1309,7 @@ namespace Functor.FullyFaithful variable {C : Type u₁} [Category.{v₁} C] +set_option backward.isDefEq.respectTransparency.types false in /-- `FullyFaithful.homEquiv` as a natural isomorphism. -/ @[simps! hom_app inv_app] def homNatIso {D : Type u₂} [Category.{v₂} D] {F : C ⥤ D} (hF : F.FullyFaithful) (X : C) : @@ -1315,6 +1325,7 @@ def homNatIsoMaxRight {D : Type u₂} [Category.{max v₁ v₂} D] {F : C ⥤ D} isoWhiskerLeft F.op (uliftYonedaIsoYoneda.symm.app _) ≪≫ hF.homNatIso _ ≪≫ NatIso.ofComponents (fun _ => Equiv.toIso (Equiv.ulift.trans Equiv.ulift.symm)) +set_option backward.isDefEq.respectTransparency.types false in /-- `FullyFaithful.homEquiv` as a natural isomorphism. -/ @[simps! +dsimpLhs] def compUliftYonedaCompWhiskeringLeft {D : Type u₂} [Category.{v₂} D] {F : C ⥤ D} @@ -1335,6 +1346,7 @@ def compYonedaCompWhiskeringLeftMaxRight {D : Type u₂} [Category.{max v₁ v NatIso.ofComponents (fun _ => NatIso.ofComponents (fun _ => Equiv.toIso (Equiv.ulift.trans Equiv.ulift.symm))) +set_option backward.isDefEq.respectTransparency.types false in /-- `FullyFaithful.homEquiv` as a natural isomorphism, using coyoneda. -/ @[simps! hom_app inv_app] def homNatIso' {D : Type u₂} [Category.{v₂} D] {F : C ⥤ D} (hF : F.FullyFaithful) (X : C) : @@ -1343,6 +1355,7 @@ def homNatIso' {D : Type u₂} [Category.{v₂} D] {F : C ⥤ D} (hF : F.FullyFa (fun Y => Equiv.toIso (Equiv.ulift.trans <| hF.homEquiv.symm.trans Equiv.ulift.symm)) (fun f => by ext; exact Equiv.ulift.injective (hF.map_injective (by simp))) +set_option backward.isDefEq.respectTransparency.types false in /-- `FullyFaithful.homEquiv` as a natural isomorphism, using coyoneda. -/ @[simps! +dsimpLhs] def compUliftCoyonedaCompWhiskeringLeft {D : Type u₂} [Category.{v₂} D] {F : C ⥤ D} diff --git a/Mathlib/Combinatorics/Additive/Corner/Roth.lean b/Mathlib/Combinatorics/Additive/Corner/Roth.lean index b012b8b6a77b39..388532648cb4c0 100644 --- a/Mathlib/Combinatorics/Additive/Corner/Roth.lean +++ b/Mathlib/Combinatorics/Additive/Corner/Roth.lean @@ -31,13 +31,18 @@ variable {G : Type*} [AddCommGroup G] {A : Finset (G × G)} {a b c : G} {n : ℕ namespace Corners +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Injective + Prod.rec + /-- The triangle indices for the proof of the corners theorem construction. -/ private def triangleIndices (A : Finset (G × G)) : Finset (G × G × G) := A.map ⟨fun (a, b) ↦ (a, b, a + b), by rintro ⟨x₁, x₂⟩ ⟨y₁, y₂⟩ ⟨⟩; rfl⟩ @[simp] private lemma mk_mem_triangleIndices : (a, b, c) ∈ triangleIndices A ↔ (a, b) ∈ A ∧ c = a + b := by - simp only [triangleIndices, Prod.ext_iff, mem_map, Embedding.coeFn_mk, Prod.exists, + simp only [triangleIndices, Prod.ext_iff, mem_map, Prod.exists, eq_comm] refine ⟨?_, fun h ↦ ⟨_, _, h.1, rfl, rfl, h.2⟩⟩ rintro ⟨_, _, h₁, rfl, rfl, h₂⟩ diff --git a/Mathlib/Combinatorics/Additive/Energy.lean b/Mathlib/Combinatorics/Additive/Energy.lean index ee0c970e97de9b..a4b9928c9edebd 100644 --- a/Mathlib/Combinatorics/Additive/Energy.lean +++ b/Mathlib/Combinatorics/Additive/Energy.lean @@ -123,6 +123,7 @@ variable {s t} Eₘ[s, t] = #{x ∈ ((s ×ˢ t) ×ˢ s ×ˢ t) | x.1.1 * x.1.2 = x.2.1 * x.2.2} := card_equiv (.prodProdProdComm _ _ _ _) (by simp [and_and_and_comm]) +set_option backward.isDefEq.respectTransparency false in @[to_additive] lemma mulEnergy_eq_sum_sq' (s t : Finset α) : Eₘ[s, t] = ∑ a ∈ s * t, #{xy ∈ s ×ˢ t | xy.1 * xy.2 = a} ^ 2 := by simp_rw [mulEnergy_eq_card_filter, sq, ← card_product] diff --git a/Mathlib/Combinatorics/Colex.lean b/Mathlib/Combinatorics/Colex.lean index 638979cbff807d..e9c82c1fb2f30d 100644 --- a/Mathlib/Combinatorics/Colex.lean +++ b/Mathlib/Combinatorics/Colex.lean @@ -460,6 +460,7 @@ lemma isInitSeg_initSeg : IsInitSeg (initSeg s) #s := by rw [mem_initSeg] at ht₁ exact ht₂.1.le.trans ht₁.2 +set_option backward.isDefEq.respectTransparency false in lemma IsInitSeg.exists_initSeg (h𝒜 : IsInitSeg 𝒜 r) (h𝒜₀ : 𝒜.Nonempty) : ∃ s : Finset α, #s = r ∧ 𝒜 = initSeg s := by have hs := sup'_mem (ofColex ⁻¹' 𝒜) (LinearOrder.supClosed _) 𝒜 h𝒜₀ toColex diff --git a/Mathlib/Combinatorics/Configuration.lean b/Mathlib/Combinatorics/Configuration.lean index 2b1f5a6ad5d985..8f2db618deee0f 100644 --- a/Mathlib/Combinatorics/Configuration.lean +++ b/Mathlib/Combinatorics/Configuration.lean @@ -282,7 +282,7 @@ theorem HasPoints.lineCount_eq_pointCount [HasPoints P L] [Fintype P] [Fintype L /-- If a nondegenerate configuration has a unique line through any two points, and if `|P| = |L|`, then there is a unique point on any two lines. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def HasLines.hasPoints [HasLines P L] [Fintype P] [Fintype L] (h : Fintype.card P = Fintype.card L) : HasPoints P L := let this : ∀ l₁ l₂ : L, l₁ ≠ l₂ → ∃ p : P, p ∈ l₁ ∧ p ∈ l₂ := fun l₁ l₂ hl => by @@ -317,7 +317,7 @@ noncomputable def HasLines.hasPoints [HasLines P L] [Fintype P] [Fintype L] /-- If a nondegenerate configuration has a unique point on any two lines, and if `|P| = |L|`, then there is a unique line through any two points. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def HasPoints.hasLines [HasPoints P L] [Fintype P] [Fintype L] (h : Fintype.card P = Fintype.card L) : HasLines P L := let this := @HasLines.hasPoints (Dual L) (Dual P) _ _ _ _ h.symm diff --git a/Mathlib/Combinatorics/Derangements/Basic.lean b/Mathlib/Combinatorics/Derangements/Basic.lean index 87cad0b77a04a2..eea016bcb1b1b2 100644 --- a/Mathlib/Combinatorics/Derangements/Basic.lean +++ b/Mathlib/Combinatorics/Derangements/Basic.lean @@ -49,6 +49,7 @@ def Equiv.derangementsCongr (e : α ≃ β) : derangements α ≃ derangements namespace derangements +set_option backward.isDefEq.respectTransparency false in /-- Derangements on a subtype are equivalent to permutations on the original type where points are fixed iff they are not in the subtype. -/ protected def subtypeEquiv (p : α → Prop) [DecidablePred p] : @@ -115,6 +116,7 @@ variable [DecidableEq α] def RemoveNone.fiber (a : Option α) : Set (Perm α) := { f : Perm α | (a, f) ∈ Equiv.Perm.decomposeOption '' derangements (Option α) } +set_option backward.isDefEq.respectTransparency false in theorem RemoveNone.mem_fiber (a : Option α) (f : Perm α) : f ∈ RemoveNone.fiber a ↔ ∃ F : Perm (Option α), F ∈ derangements (Option α) ∧ F none = a ∧ removeNone F = f := by diff --git a/Mathlib/Combinatorics/Enumerative/Catalan/Tree.lean b/Mathlib/Combinatorics/Enumerative/Catalan/Tree.lean index 6822befbff552e..5804c21718f893 100644 --- a/Mathlib/Combinatorics/Enumerative/Catalan/Tree.lean +++ b/Mathlib/Combinatorics/Enumerative/Catalan/Tree.lean @@ -56,6 +56,7 @@ theorem treesOfNumNodesEq_succ (n : ℕ) : ext simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem mem_treesOfNumNodesEq {x : Tree Unit} {n : ℕ} : x ∈ treesOfNumNodesEq n ↔ x.numNodes = n := by diff --git a/Mathlib/Combinatorics/Enumerative/Composition.lean b/Mathlib/Combinatorics/Enumerative/Composition.lean index 831a6111194d90..33e4313ac9ab52 100644 --- a/Mathlib/Combinatorics/Enumerative/Composition.lean +++ b/Mathlib/Combinatorics/Enumerative/Composition.lean @@ -469,6 +469,7 @@ theorem ones_length (n : ℕ) : (ones n).length = n := theorem ones_blocks (n : ℕ) : (ones n).blocks = replicate n (1 : ℕ) := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ones_blocksFun (n : ℕ) (i : Fin (ones n).length) : (ones n).blocksFun i = 1 := by simp only [blocksFun, ones, get_eq_getElem, getElem_replicate] @@ -536,10 +537,12 @@ theorem single_length {n : ℕ} (h : 0 < n) : (single n h).length = 1 := theorem single_blocks {n : ℕ} (h : 0 < n) : (single n h).blocks = [n] := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem single_blocksFun {n : ℕ} (h : 0 < n) (i : Fin (single n h).length) : (single n h).blocksFun i = n := by simp [blocksFun, single] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem single_embedding {n : ℕ} (h : 0 < n) (i : Fin n) : ((single n h).embedding (0 : Fin 1)) i = i := by @@ -559,6 +562,7 @@ theorem eq_single_iff_length {n : ℕ} (h : 0 < n) {c : Composition n} : rw [eq_cons_of_length_one A] at B ⊢ simpa [single_blocks] using B +set_option backward.isDefEq.respectTransparency false in theorem ne_single_iff {n : ℕ} (hn : 0 < n) {c : Composition n} : c ≠ single n hn ↔ ∀ i, c.blocksFun i < n := by contrapose! @@ -810,6 +814,7 @@ Combinatorial viewpoints on compositions, seen as finite subsets of `Fin (n+1)` -/ +set_option backward.isDefEq.respectTransparency false in /-- Bijection between compositions of `n` and subsets of `{0, ..., n-2}`, defined by considering the restriction of the subset to `{1, ..., n-1}` and shifting to the left by one. -/ def compositionAsSetEquiv (n : ℕ) : CompositionAsSet n ≃ Finset (Fin (n - 1)) where @@ -913,6 +918,7 @@ def blocks (c : CompositionAsSet n) : List ℕ := theorem blocks_length : c.blocks.length = c.length := length_ofFn +set_option backward.isDefEq.respectTransparency false in theorem blocks_partial_sum {i : ℕ} (h : i < c.boundaries.card) : (c.blocks.take i).sum = c.boundary ⟨i, h⟩ := by induction i with diff --git a/Mathlib/Combinatorics/Enumerative/DyckWord.lean b/Mathlib/Combinatorics/Enumerative/DyckWord.lean index 7a6a5447ff038a..9f677a9aac9372 100644 --- a/Mathlib/Combinatorics/Enumerative/DyckWord.lean +++ b/Mathlib/Combinatorics/Enumerative/DyckWord.lean @@ -277,6 +277,7 @@ lemma firstReturn_lt_length : p.firstReturn < p.toList.length := by exact ⟨by lia, by rw [Nat.sub_add_cancel lp, take_of_length_le (le_refl _), p.count_U_eq_count_D]⟩ +set_option backward.isDefEq.respectTransparency false in include h in lemma count_take_firstReturn_add_one : (p.toList.take (p.firstReturn + 1)).count U = (p.toList.take (p.firstReturn + 1)).count D := by @@ -374,6 +375,7 @@ lemma outsidePart_nest : p.nest.outsidePart = 0 := by rw [DyckWord.ext_iff]; apply drop_of_length_le simp_rw [nest, length_append, length_singleton]; lia +set_option backward.isDefEq.respectTransparency false in include h in @[simp] theorem nest_insidePart_add_outsidePart : p.insidePart.nest + p.outsidePart = p := by diff --git a/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean b/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean index 6758df6efd0420..a9fd63c4e30b3c 100644 --- a/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean +++ b/Mathlib/Combinatorics/Enumerative/InclusionExclusion.lean @@ -108,6 +108,7 @@ lemma prod_indicator_biUnion_finset_sub_indicator (hs : s.Nonempty) (S : ι → convert! prod_indicator_biUnion_sub_indicator hs (fun i ↦ S i) a simp +set_option backward.isDefEq.respectTransparency false in /-- **Inclusion-exclusion principle** for the sum of a function over a union. The sum of a function `f` over the union of the `S i` over `i ∈ s` is the alternating sum of the diff --git a/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean b/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean index 4bb7639e6fa7b9..037cdde9a7a5bf 100644 --- a/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean +++ b/Mathlib/Combinatorics/Enumerative/Partition/Basic.lean @@ -165,6 +165,7 @@ def indiscrete (n : ℕ) : Partition n := ofSums n {n} rfl instance {n : ℕ} : Inhabited (Partition n) := ⟨indiscrete n⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma indiscrete_parts {n : ℕ} (hn : n ≠ 0) : (indiscrete n).parts = {n} := by simp [indiscrete, filter_eq_self, hn] diff --git a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean index 295e9e0dbaa35e..3feb2be0fef622 100644 --- a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean +++ b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean @@ -126,6 +126,7 @@ private def triangleIndices (s : Finset α) : Finset (α × α × α) := obtain rfl := add_right_injective _ h.2.1 rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in @[simp] private lemma mem_triangleIndices : x ∈ triangleIndices s ↔ ∃ y, ∃ a ∈ s, (y, y + a, y + 2 * a) = x := by simp [triangleIndices] diff --git a/Mathlib/Combinatorics/Hall/Basic.lean b/Mathlib/Combinatorics/Hall/Basic.lean index 5d7cb118a5f2c8..ae1d2e3f1c8f80 100644 --- a/Mathlib/Combinatorics/Hall/Basic.lean +++ b/Mathlib/Combinatorics/Hall/Basic.lean @@ -152,6 +152,7 @@ theorem Finset.all_card_le_biUnion_card_iff_exists_injective {ι : Type u} {α : apply Finset.card_le_card grind +set_option backward.isDefEq.respectTransparency.types false in /-- Given a relation such that the image of every singleton set is finite, then the image of every finite set is finite. -/ instance {α : Type u} {β : Type v} [DecidableEq β] (R : SetRel α β) @@ -162,6 +163,7 @@ instance {α : Type u} {β : Type v} [DecidableEq β] (R : SetRel α β) rw [h] apply FinsetCoe.fintype +set_option backward.isDefEq.respectTransparency.types false in /-- This is a version of **Hall's Marriage Theorem** in terms of a relation between types `α` and `β` such that `α` is finite and the image of each `x : α` is finite (it suffices for `β` to be finite; see diff --git a/Mathlib/Combinatorics/Hall/Finite.lean b/Mathlib/Combinatorics/Hall/Finite.lean index 3bd50b4a414a08..76d1f88db66af0 100644 --- a/Mathlib/Combinatorics/Hall/Finite.lean +++ b/Mathlib/Combinatorics/Hall/Finite.lean @@ -72,6 +72,7 @@ theorem hall_cond_of_erase {x : ι} (a : α) · subst s' simp +set_option backward.isDefEq.respectTransparency false in /-- First case of the inductive step: assuming that `∀ (s : Finset ι), s.Nonempty → s ≠ univ → #s < #(s.biUnion t)` and that the statement of **Hall's Marriage Theorem** is true for all diff --git a/Mathlib/Combinatorics/Hindman.lean b/Mathlib/Combinatorics/Hindman.lean index ae3e73a4701384..4206df5e4a1391 100644 --- a/Mathlib/Combinatorics/Hindman.lean +++ b/Mathlib/Combinatorics/Hindman.lean @@ -49,7 +49,7 @@ Ramsey theory, ultrafilter open Filter /-- Multiplication of ultrafilters given by `∀ᶠ m in U*V, p m ↔ ∀ᶠ m in U, ∀ᶠ m' in V, p (m*m')`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Addition of ultrafilters given by `∀ᶠ m in U+V, p m ↔ ∀ᶠ m in U, ∀ᶠ m' in V, p (m+m')`. -/] def Ultrafilter.mul {M} [Mul M] : Mul (Ultrafilter M) where mul U V := (· * ·) <$> U <*> V @@ -63,7 +63,7 @@ theorem Ultrafilter.eventually_mul {M} [Mul M] (U V : Ultrafilter M) (p : M → Iff.rfl /-- Semigroup structure on `Ultrafilter M` induced by a semigroup structure on `M`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Additive semigroup structure on `Ultrafilter M` induced by an additive semigroup structure on `M`. -/] def Ultrafilter.semigroup {M} [Semigroup M] : Semigroup (Ultrafilter M) := diff --git a/Mathlib/Combinatorics/KatonaCircle.lean b/Mathlib/Combinatorics/KatonaCircle.lean index 64a5fba43c6194..55c9345fb8a648 100644 --- a/Mathlib/Combinatorics/KatonaCircle.lean +++ b/Mathlib/Combinatorics/KatonaCircle.lean @@ -35,6 +35,7 @@ variable {f : Numbering X} {s t : Finset X} /-- `IsPrefix f s` means that the elements of `s` precede the elements of `sᶜ` in the numbering `f`. -/ +@[local implicit_reducible] def IsPrefix (f : Numbering X) (s : Finset X) := ∀ x, x ∈ s ↔ f x < #s lemma IsPrefix.subset_of_card_le_card (hs : IsPrefix f s) (ht : IsPrefix f t) (hst : #s ≤ #t) : @@ -49,6 +50,7 @@ def prefixed (s : Finset X) : Finset (Numbering X) := {f | IsPrefix f s} @[simp] lemma mem_prefixed : f ∈ prefixed s ↔ IsPrefix f s := by simp [prefixed] +set_option backward.isDefEq.respectTransparency false in /-- Decompose a numbering of which `s` is a prefix into a numbering of `s` and a numbering on `sᶜ`. -/ def prefixedEquiv (s : Finset X) : prefixed s ≃ Numbering s × Numbering ↑(sᶜ) where diff --git a/Mathlib/Combinatorics/Matroid/Basic.lean b/Mathlib/Combinatorics/Matroid/Basic.lean index d776d78b5dd7d7..8e4efc355c4818 100644 --- a/Mathlib/Combinatorics/Matroid/Basic.lean +++ b/Mathlib/Combinatorics/Matroid/Basic.lean @@ -515,6 +515,7 @@ variable {B B' I J D X : Set α} {e f : α} theorem indep_iff : M.Indep I ↔ ∃ B, M.IsBase B ∧ I ⊆ B := M.indep_iff' (I := I) +set_option backward.isDefEq.respectTransparency false in theorem setOf_indep_eq (M : Matroid α) : {I | M.Indep I} = lowerClosure ({B | M.IsBase B}) := by simp_rw [indep_iff, lowerClosure, LowerSet.coe_mk, mem_setOf, le_eq_subset] diff --git a/Mathlib/Combinatorics/Matroid/IndepAxioms.lean b/Mathlib/Combinatorics/Matroid/IndepAxioms.lean index 840b40e7602018..0ea95c0af5305f 100644 --- a/Mathlib/Combinatorics/Matroid/IndepAxioms.lean +++ b/Mathlib/Combinatorics/Matroid/IndepAxioms.lean @@ -444,9 +444,10 @@ protected def ofFinset [DecidableEq α] (E : Set α) (Indep : Finset α → Prop @[simp] theorem ofFinset_indep [DecidableEq α] (E : Set α) Indep indep_empty indep_subset indep_aug subset_ground {I : Finset α} : (IndepMatroid.ofFinset E Indep indep_empty indep_subset indep_aug subset_ground).Indep I ↔ Indep I := by - simp only [IndepMatroid.ofFinset, ofFinitaryCardAugment_indep, Finset.coe_subset] + simp only [IndepMatroid.ofFinset] exact ⟨fun h ↦ h _ Subset.rfl, fun h J hJI ↦ indep_subset h hJI⟩ +set_option backward.isDefEq.respectTransparency false in /-- This can't be `@[simp]`, because it would cause the more useful `Matroid.ofIndepFinset_apply` not to be in simp normal form. -/ theorem ofFinset_indep' [DecidableEq α] (E : Set α) Indep indep_empty indep_subset indep_aug diff --git a/Mathlib/Combinatorics/Matroid/Map.lean b/Mathlib/Combinatorics/Matroid/Map.lean index c1458a80cfcd33..932c668df215a3 100644 --- a/Mathlib/Combinatorics/Matroid/Map.lean +++ b/Mathlib/Combinatorics/Matroid/Map.lean @@ -437,6 +437,7 @@ lemma map_isBasis_iff' {I X : Set β} {hf} : rintro ⟨I, X, hIX, rfl, rfl⟩ exact hIX.map hf +set_option backward.isDefEq.respectTransparency false in @[simp] lemma map_dual {hf} : (M.map f hf)✶ = M✶.map f hf := by apply ext_isBase (by simp) simp only [dual_ground, map_ground, subset_image_iff, forall_exists_index, and_imp, @@ -458,6 +459,7 @@ lemma map_isBasis_iff' {I X : Set β} {hf} : @[simp] lemma map_id : M.map id (injOn_id M.E) = M := by simp [ext_iff_indep] +set_option backward.isDefEq.respectTransparency false in lemma map_comap {f : α → β} (h_range : N.E ⊆ range f) (hf : InjOn f (f ⁻¹' N.E)) : (N.comap f).map f hf = N := by refine ext_indep (by simpa [image_preimage_eq_iff]) ?_ @@ -498,6 +500,7 @@ end map section mapSetEquiv +set_option backward.isDefEq.respectTransparency false in /-- Map `M : Matroid α` to a `Matroid β` with ground set `E` using an equivalence `M.E ≃ E`. Defined using `Matroid.ofExistsMatroid` for better defeq. -/ def mapSetEquiv (M : Matroid α) {E : Set β} (e : M.E ≃ E) : Matroid β := @@ -683,6 +686,7 @@ lemma eq_of_restrictSubtype_eq {N : Matroid α} (hM : M.E = E) (hN : N.E = E) lemma restrictSubtype_dual' (hM : M.E = E) : (M.restrictSubtype E)✶ = M✶.restrictSubtype E := by rw [← hM, restrictSubtype_dual] +set_option backward.isDefEq.respectTransparency false in /-- `M.restrictSubtype X` is isomorphic to `M ↾ X`. -/ @[simp] lemma map_val_restrictSubtype_eq (M : Matroid α) (X : Set α) : (M.restrictSubtype X).map (↑) Subtype.val_injective.injOn = M ↾ X := by diff --git a/Mathlib/Combinatorics/Matroid/Sum.lean b/Mathlib/Combinatorics/Matroid/Sum.lean index 02ed7cc23695e2..db27f09e922664 100644 --- a/Mathlib/Combinatorics/Matroid/Sum.lean +++ b/Mathlib/Combinatorics/Matroid/Sum.lean @@ -164,6 +164,7 @@ protected def sum' (M : ι → Matroid α) : Matroid (ι × α) := ext simp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma sum'_ground_eq (M : ι → Matroid α) : (Matroid.sum' M).E = ⋃ i, Prod.mk i '' (M i).E := by ext diff --git a/Mathlib/Combinatorics/Quiver/Arborescence.lean b/Mathlib/Combinatorics/Quiver/Arborescence.lean index 233ee59ef5cca2..063ffb6f43e888 100644 --- a/Mathlib/Combinatorics/Quiver/Arborescence.lean +++ b/Mathlib/Combinatorics/Quiver/Arborescence.lean @@ -57,7 +57,7 @@ instance {V : Type u} [Quiver V] [Arborescence V] (b : V) : Unique (Path (root V lower vertex to a higher vertex, - show that every vertex has at most one arrow to it, and - show that every vertex other than `r` has an arrow to it. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def arborescenceMk {V : Type u} [Quiver V] (r : V) (height : V → ℕ) (height_lt : ∀ ⦃a b⦄, (a ⟶ b) → height a < height b) (unique_arrow : ∀ ⦃a b c : V⦄ (e : a ⟶ c) (f : b ⟶ c), a = b ∧ e ≍ f) @@ -116,6 +116,7 @@ theorem shortest_path_spec {a : V} (p : Path r a) : (shortestPath r a).length def geodesicSubtree : WideSubquiver V := fun a b => { e | ∃ p : Path r a, shortestPath r b = p.cons e } +set_option backward.isDefEq.respectTransparency false in noncomputable instance geodesicArborescence : Arborescence (geodesicSubtree r) := arborescenceMk r (fun a => (shortestPath r a).length) (by diff --git a/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean b/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean index 487b77e3ca3e42..3653855a39d4a0 100644 --- a/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean +++ b/Mathlib/Combinatorics/Quiver/ConnectedComponent.lean @@ -36,7 +36,7 @@ variable (V : Type*) [Quiver.{u} V] /-- Two vertices are related in the zigzag setoid if there is a zigzag of arrows from one to the other. -/ -@[implicit_reducible] +@[instance_reducible] def zigzagSetoid : Setoid V := ⟨fun a b ↦ Nonempty (@Path (Symmetrify V) _ a b), fun _ ↦ ⟨Path.nil⟩, fun ⟨p⟩ ↦ ⟨p.reverse⟩, fun ⟨p⟩ ⟨q⟩ ↦ ⟨p.comp q⟩⟩ @@ -115,7 +115,7 @@ lemma IsSStronglyConnected.isStronglyConnected intro i j; obtain ⟨p, _⟩ := h i j; exact ⟨p⟩ /-- Equivalence relation identifying vertices connected by directed paths in both directions. -/ -@[implicit_reducible] +@[instance_reducible] def stronglyConnectedSetoid : Setoid V := ⟨fun a b => (Nonempty (Path a b)) ∧ (Nonempty (Path b a)), fun _ => ⟨⟨Path.nil⟩, ⟨Path.nil⟩⟩, fun ⟨hab, hba⟩ => ⟨hba, hab⟩, fun ⟨hab, hba⟩ ⟨hbc, hcb⟩ => diff --git a/Mathlib/Combinatorics/Quiver/Push.lean b/Mathlib/Combinatorics/Quiver/Push.lean index bce18e536a9aad..b98888d22d291c 100644 --- a/Mathlib/Combinatorics/Quiver/Push.lean +++ b/Mathlib/Combinatorics/Quiver/Push.lean @@ -65,6 +65,7 @@ noncomputable def lift : Push σ ⥤q W' where theorem lift_obj : (lift σ φ τ h).obj = τ := rfl +set_option backward.isDefEq.respectTransparency false in theorem lift_comp : (of σ ⋙q lift σ φ τ h) = φ := by fapply Prefunctor.ext · rintro X diff --git a/Mathlib/Combinatorics/Quiver/SingleObj.lean b/Mathlib/Combinatorics/Quiver/SingleObj.lean index a9b435ed8a35a1..d395fc74343415 100644 --- a/Mathlib/Combinatorics/Quiver/SingleObj.lean +++ b/Mathlib/Combinatorics/Quiver/SingleObj.lean @@ -28,7 +28,7 @@ itself using `pathEquivList`. namespace Quiver /-- Type tag on `Unit` used to define single-object quivers. -/ -@[nolint unusedArguments] +@[nolint unusedArguments, implicit_reducible] def SingleObj (_ : Type*) : Type := Unit deriving Unique diff --git a/Mathlib/Combinatorics/Schnirelmann.lean b/Mathlib/Combinatorics/Schnirelmann.lean index 5bc3ace7aa10d5..c3d48a966518e9 100644 --- a/Mathlib/Combinatorics/Schnirelmann.lean +++ b/Mathlib/Combinatorics/Schnirelmann.lean @@ -217,6 +217,7 @@ lemma schnirelmannDensity_setOf_even : schnirelmannDensity (setOf Even) = 0 := lemma schnirelmannDensity_setOf_prime : schnirelmannDensity (setOf Nat.Prime) = 0 := schnirelmannDensity_eq_zero_of_one_notMem <| by simp [Nat.not_prime_one] +set_option backward.isDefEq.respectTransparency false in /-- The Schnirelmann density of the set of naturals which are `1 mod m` is `m⁻¹`, for any `m ≠ 1`. diff --git a/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean b/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean index ac0a357e9bf3c3..d7ad0a795fefda 100644 --- a/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean +++ b/Mathlib/Combinatorics/SetFamily/AhlswedeZhang.lean @@ -77,6 +77,7 @@ private lemma binomial_sum_eq (h : n < m) : have : (m.choose i : ℚ) ≠ 0 := cast_ne_zero.2 (choose_pos h₂.le).ne' simp [field, *] +set_option backward.isDefEq.respectTransparency false in private lemma Fintype.sum_div_mul_card_choose_card : ∑ s : Finset α, (card α / ((card α - #s) * (card α).choose #s) : ℚ) = card α * ∑ k ∈ range (card α), (↑k)⁻¹ + 1 := by diff --git a/Mathlib/Combinatorics/SetFamily/FourFunctions.lean b/Mathlib/Combinatorics/SetFamily/FourFunctions.lean index 5976608d493bb9..a0c968b938c13b 100644 --- a/Mathlib/Combinatorics/SetFamily/FourFunctions.lean +++ b/Mathlib/Combinatorics/SetFamily/FourFunctions.lean @@ -296,6 +296,7 @@ section DistribLattice variable [DistribLattice α] [CommSemiring β] [LinearOrder β] [IsStrictOrderedRing β] [ExistsAddOfLE β] (f f₁ f₂ f₃ f₄ g μ : α → β) +set_option backward.isDefEq.respectTransparency false in /-- The **Four Functions Theorem**, aka **Ahlswede-Daykin Inequality**. -/ lemma four_functions_theorem [DecidableEq α] (h₁ : 0 ≤ f₁) (h₂ : 0 ≤ f₂) (h₃ : 0 ≤ f₃) (h₄ : 0 ≤ f₄) (h : ∀ a b, f₁ a * f₂ b ≤ f₃ (a ⊓ b) * f₄ (a ⊔ b)) (s t : Finset α) : diff --git a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean index 14edcc8e8f9e7f..6fa3fc1526cb21 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean @@ -132,6 +132,7 @@ theorem exists_maximal_isAcyclic_of_le_isAcyclic · grind [sSup_le_iff] · exact isAcyclic_sSup_of_isAcyclic_directedOn c (by grind) hc.directedOn +set_option backward.isDefEq.respectTransparency.types false in /-- A connected component of an acyclic graph is a tree. -/ lemma IsAcyclic.isTree_connectedComponent (h : G.IsAcyclic) (c : G.ConnectedComponent) : c.toSimpleGraph.IsTree where @@ -321,6 +322,7 @@ theorem IsAcyclic.isPath_iff_isTrail (hG : G.IsAcyclic) {v w : V} (p : G.Walk v p.IsPath ↔ p.IsTrail := ⟨IsPath.isTrail, fun h ↦ hG.isPath_iff_isChain p |>.mpr <| p.isTrail_def.mp h |>.isChain⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma IsTree.card_edgeFinset [Fintype V] [Fintype G.edgeSet] (hG : G.IsTree) : Finset.card G.edgeFinset + 1 = Fintype.card V := by have := hG.connected.nonempty @@ -507,6 +509,7 @@ lemma Connected.card_vert_le_card_edgeSet_add_one (h : G.Connected) : Nat.card_eq_fintype_card, ← edgeFinset_card] exact Finset.card_mono <| by simpa +set_option backward.isDefEq.respectTransparency.types false in lemma isTree_iff_connected_and_card [Finite V] : G.IsTree ↔ G.Connected ∧ Nat.card G.edgeSet + 1 = Nat.card V := by have := Fintype.ofFinite V diff --git a/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean b/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean index e17d2cb5151426..0b7b4b58aa0c64 100644 --- a/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean +++ b/Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean @@ -86,6 +86,7 @@ def toGraph [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) : SimpleGra symm i j hij := by simp only; rwa [h.symm.apply i j] loopless := ⟨fun i ↦ by simp [h]⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [MulZeroOneClass α] [Nontrivial α] [DecidableEq α] (h : IsAdjMatrix A) : DecidableRel h.toGraph.Adj := by simp only [toGraph] @@ -348,7 +349,7 @@ theorem adjMatrix_pow_apply_eq_card_walk [DecidableEq V] [Semiring α] (n : ℕ) · rintro ⟨x, hx⟩ - ⟨y, hy⟩ - hxy rw [Function.onFun, disjoint_iff_inf_le] intro p hp - simp only [inf_eq_inter, mem_inter, mem_map, Function.Embedding.coeFn_mk] at hp + simp only [inf_eq_inter, mem_inter, mem_map] at hp obtain ⟨⟨px, _, rfl⟩, ⟨py, hpy, hp⟩⟩ := hp cases hp simp at hxy diff --git a/Mathlib/Combinatorics/SimpleGraph/Basic.lean b/Mathlib/Combinatorics/SimpleGraph/Basic.lean index dae909a1b6bf39..49443d768807ef 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Basic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Basic.lean @@ -97,6 +97,7 @@ structure SimpleGraph (V : Type u) where initialize_simps_projections SimpleGraph (Adj → adj) +set_option backward.isDefEq.respectTransparency false in /-- Constructor for simple graphs using a symmetric irreflexive Boolean function. -/ @[simps] def SimpleGraph.mk' {V : Type u} : diff --git a/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean b/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean index 5812a8461af7d1..87c83782068a8e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Bipartite.lean @@ -322,6 +322,7 @@ section Copy variable {α β : Type*} [Fintype α] [Fintype β] +set_option backward.isDefEq.respectTransparency.types false in /-- A "left" subset of `card α` vertices and a "right" subset of `card β` vertices such that every vertex in the "left" subset is adjacent to every vertex in the "right" subset gives rise to a copy of a complete bipartite graph. -/ @@ -541,6 +542,7 @@ theorem bipartiteDoubleCover_le : G.bipartiteDoubleCover ≤ completeBipartiteGr | .inl _, .inr _ | .inr _, .inl _ => by simp | .inl _, .inl _ | .inr _, .inr _ => by simp at hadj +set_option backward.isDefEq.respectTransparency.types false in /-- The bipartite double cover of `G` has twice the number of edges as `G`. -/ theorem card_edgeFinset_bipartiteDoubleCover [Fintype V] [DecidableRel G.Adj] : #G.bipartiteDoubleCover.edgeFinset = 2 * #G.edgeFinset := by diff --git a/Mathlib/Combinatorics/SimpleGraph/Clique.lean b/Mathlib/Combinatorics/SimpleGraph/Clique.lean index 0651a6926363a8..c3c71194ed94b5 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Clique.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Clique.lean @@ -305,6 +305,7 @@ theorem is3Clique_iff_exists_cycle_length_three : ⟨(fun ⟨_, a, _, _, hab, hac, hbc, _⟩ => ⟨a, cons hab (cons hbc (cons hac.symm nil)), by aesop⟩), (fun ⟨_, .cons hab (.cons hbc (.cons hca nil)), _, _⟩ => ⟨_, _, _, _, hab, hca.symm, hbc, rfl⟩)⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- If a set of vertices `A` is an `n`-clique in subgraph of `G` induced by a superset of `A`, its embedding is an `n`-clique in `G`. -/ theorem IsNClique.of_induce {S : Subgraph G} {F : Set α} {s : Finset { x // x ∈ F }} {n : ℕ} @@ -438,6 +439,7 @@ namespace completeMultipartiteGraph variable {ι : Type*} (V : ι → Type*) +set_option backward.isDefEq.respectTransparency.types false in /-- Embedding of the complete graph on `ι` into `completeMultipartiteGraph` on `ι` nonempty parts -/ @[simps] def topEmbedding (f : ∀ (i : ι), V i) : @@ -830,6 +832,7 @@ theorem isIndepSet_neighborSet_of_triangleFree (h : G.CliqueFree 3) (v : α) : obtain ⟨j, avj, k, avk, _, ajk⟩ := nind exact h {v, j, k} (is3Clique_triple_iff.mpr (by simp [avj, avk, ajk])) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The embedding of an independent set of an induced subgraph of the subgraph `G` is an independent set in `G` and vice versa. -/ diff --git a/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean b/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean index aa43c29edb30d7..a61eeee49e5ff5 100644 --- a/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean @@ -73,7 +73,7 @@ protected lemma IsCompleteMultipartite.induce (hG : G.IsCompleteMultipartite) : (G.induce s).IsCompleteMultipartite where trans _u _v _w := hG.trans _ _ _ /-- The setoid given by non-adjacency -/ -@[implicit_reducible] +@[instance_reducible] def IsCompleteMultipartite.setoid (h : G.IsCompleteMultipartite) : Setoid α := ⟨(¬ G.Adj · ·), ⟨G.loopless.irrefl, fun h' ↦ by rwa [adj_comm] at h', h.trans _ _ _⟩⟩ @@ -81,6 +81,7 @@ lemma completeMultipartiteGraph.isCompleteMultipartite {ι : Type*} (V : ι → (completeMultipartiteGraph V).IsCompleteMultipartite := ⟨by simp_all⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The graph isomorphism from a graph `G` that `IsCompleteMultipartite` to the corresponding `completeMultipartiteGraph` (see also `isCompleteMultipartite_iff`) -/ def IsCompleteMultipartite.iso (h : G.IsCompleteMultipartite) : @@ -226,6 +227,7 @@ def completeEquipartiteGraph.completeMultipartiteGraph : completeEquipartiteGraph r t ≃g completeMultipartiteGraph (const (Fin r) (Fin t)) := { (Equiv.sigmaEquivProd (Fin r) (Fin t)).symm with map_rel_iff' := by simp } +set_option backward.isDefEq.respectTransparency.types false in /-- A `completeEquipartiteGraph` is isomorphic to a corresponding `turanGraph`. The difference is that the former vertices are a product type whereas the latter vertices are @@ -372,10 +374,12 @@ theorem disjoint : (K.parts : Set (Finset V)).Pairwise Disjoint := /-- The finset of vertices in a complete equipartite subgraph. -/ def verts : Finset V := K.parts.disjiUnion id K.disjoint +set_option backward.isDefEq.respectTransparency.types false in open Classical in /-- The finset of vertices in a complete equipartite subgraph as a `biUnion`. -/ lemma verts_eq_biUnion : K.verts = K.parts.biUnion id := by rw [verts, disjiUnion_eq_biUnion] +set_option backward.isDefEq.respectTransparency.types false in /-- There are `r * t` vertices in a complete equipartite subgraph with `r` parts of size `t`. -/ theorem card_verts : #K.verts = r * t := by simp_rw [verts, card_disjiUnion, id_eq, sum_congr rfl fun _ ↦ K.card_mem_parts, sum_const, @@ -410,6 +414,7 @@ noncomputable def toCopy : Copy (completeEquipartiteGraph r t) G := by refine K.isCompleteBetween (fᵣ _).prop (fᵣ _).prop ?_ (fₜ _ _).prop (fₜ _ _).prop exact Subtype.ext_iff.ne.mp <| fᵣ.injective.ne hne +set_option backward.isDefEq.respectTransparency.types false in /-- A copy of a complete equipartite graph identifies a complete equipartite subgraph. -/ def ofCopy (f : Copy (completeEquipartiteGraph r t) G) : G.CompleteEquipartiteSubgraph r t := by by_cases ht : t = 0 diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean index cf74d0ab6d6873..bab15afc952bfe 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean @@ -220,7 +220,7 @@ lemma not_reachable_of_right_degree_zero {G : SimpleGraph V} {u v : V} [Fintype exact not_reachable_of_left_degree_zero huv.symm hu /-- The equivalence relation on vertices given by `SimpleGraph.Reachable`. -/ -@[implicit_reducible] +@[instance_reducible] def reachableSetoid : Setoid V := Setoid.mk _ G.reachable_is_equivalence /-- A graph is preconnected if every pair of vertices is reachable from one another. -/ diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean index c1359d16dac765..e2623c1cf47a5b 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean @@ -70,6 +70,7 @@ instance instDecidableMemSupp (c : G.ConnectedComponent) (v : V) : Decidable (v c.recOn (fun w ↦ decidable_of_iff (G.Reachable v w) <| by simp) (fun _ _ _ _ ↦ Subsingleton.elim _ _) +set_option backward.isDefEq.respectTransparency.types false in variable {G} in lemma disjiUnion_supp_toFinset_eq_supp_toFinset {G' : SimpleGraph V} (h : G ≤ G') (c' : ConnectedComponent G') [Fintype c'.supp] @@ -85,6 +86,7 @@ end Fintype infinite components. -/ abbrev oddComponents : Set G.ConnectedComponent := {c : G.ConnectedComponent | Odd c.supp.ncard} +set_option backward.isDefEq.respectTransparency.types false in lemma ConnectedComponent.odd_oddComponents_ncard_subset_supp [Finite V] {G'} (h : G ≤ G') (c' : ConnectedComponent G') : Odd {c ∈ G.oddComponents | c.supp ⊆ c'.supp}.ncard ↔ Odd c'.supp.ncard := by @@ -110,6 +112,7 @@ lemma odd_ncard_oddComponents [Finite V] : Odd G.oddComponents.ncard ↔ Odd (Na simp_rw [← Set.ncard_eq_toFinset_card', ← Finset.coe_filter_univ, Set.ncard_coe_finset] exact (Finset.odd_sum_iff_odd_card_odd (fun x : G.ConnectedComponent ↦ x.supp.ncard)).symm +set_option backward.isDefEq.respectTransparency.types false in lemma ncard_oddComponents_mono [Finite V] {G' : SimpleGraph V} (h : G ≤ G') : G'.oddComponents.ncard ≤ G.oddComponents.ncard := by have aux (c : G'.ConnectedComponent) (hc : Odd c.supp.ncard) : diff --git a/Mathlib/Combinatorics/SimpleGraph/Copy.lean b/Mathlib/Combinatorics/SimpleGraph/Copy.lean index e17ae25f87c389..57892bac1ba717 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Copy.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Copy.lean @@ -609,6 +609,7 @@ protected lemma Free.killCopies_eq_left (hHG : H.Free G) : G.killCopies H = G := · exact killCopies_bot _ · exact (killCopies_eq_left hH).2 hHG +set_option backward.isDefEq.respectTransparency false in /-- Removing an edge from `G` for each subgraph isomorphic to `H` results in a graph that doesn't contain `H`. -/ lemma free_killCopies (hH : H ≠ ⊥) : H.Free (G.killCopies H) := by diff --git a/Mathlib/Combinatorics/SimpleGraph/Dart.lean b/Mathlib/Combinatorics/SimpleGraph/Dart.lean index 651455db64474c..7dfbe134f35696 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Dart.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Dart.lean @@ -96,6 +96,7 @@ theorem Dart.symm_involutive : Function.Involutive (Dart.symm : G.Dart → G.Dar theorem Dart.symm_ne (d : G.Dart) : d.symm ≠ d := ne_of_apply_ne (Prod.snd ∘ Dart.toProd) d.adj.ne +set_option backward.isDefEq.respectTransparency false in theorem dart_edge_eq_iff : ∀ d₁ d₂ : G.Dart, d₁.edge = d₂.edge ↔ d₁ = d₂ ∨ d₁ = d₂.symm := by rintro ⟨p, hp⟩ ⟨q, hq⟩ simp diff --git a/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean b/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean index 1d145d0cf1f11e..f8f3559587ee64 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean @@ -185,6 +185,7 @@ theorem hom_refl (C : G.ComponentCompl L) : C.hom (subset_refl L) = C := by change C.map _ = C rw [induceHom_id G Lᶜ, ConnectedComponent.map_id] +set_option backward.isDefEq.respectTransparency.types false in theorem hom_trans (C : G.ComponentCompl L) (h : K ⊆ L) (h' : M ⊆ K) : C.hom (h'.trans h) = (C.hom h).hom h' := by change C.map _ = (C.map _).map _ diff --git a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean index 5cd01c2801f5b7..f6734c7785253b 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean @@ -164,7 +164,7 @@ theorem equivalence_not_adj : Equivalence (¬G.Adj · ·) where /-- The non-adjacency setoid over the vertices of a Turán-maximal graph induced by `equivalence_not_adj`. -/ -@[implicit_reducible] +@[instance_reducible] def setoid : Setoid V := ⟨_, h.equivalence_not_adj⟩ instance : DecidableRel h.setoid.r := @@ -247,6 +247,7 @@ theorem card_parts [DecidableEq V] : #h.finpartition.parts = min (card V) r := b convert! G.card_edgeFinset_sup_edge _ hn rwa [h.not_adj_iff_part_eq] +set_option backward.isDefEq.respectTransparency.types false in /-- **Turán's theorem**, forward direction. Any `r + 1`-cliquefree Turán-maximal graph on `n` vertices is isomorphic to `turanGraph n r`. -/ diff --git a/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean b/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean index b173dffc426903..95e6d5d27cf40e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean @@ -65,7 +65,7 @@ theorem IsHamiltonian.of_subsingleton [Subsingleton α] : p.IsHamiltonian := by rw [nil_iff_support_eq.mp p.nil_of_subsingleton, Subsingleton.elim v a, List.count_singleton_self] /-- If a path `p` is Hamiltonian then the graph has finitely many vertices. -/ -@[implicit_reducible] +@[instance_reducible] protected def IsHamiltonian.fintype (hp : p.IsHamiltonian) : Fintype α where elems := p.support.toFinset complete x := List.mem_toFinset.mpr (mem_support hp x) diff --git a/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean b/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean index 05fb44896d50fe..e4480b92e648e6 100644 --- a/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean +++ b/Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean @@ -108,6 +108,7 @@ theorem sum_incMatrix_apply [Fintype (Sym2 α)] [Fintype (neighborSet G a)] : ∑ e, G.incMatrix R a e = G.degree a := by simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset, card_incidenceSet_eq_degree] +set_option backward.isDefEq.respectTransparency false in theorem incMatrix_mul_transpose_diag [Fintype (Sym2 α)] [Fintype (neighborSet G a)] : (G.incMatrix R * (G.incMatrix R)ᵀ) a a = G.degree a := by rw [← sum_incMatrix_apply] diff --git a/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean b/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean index 736609b3af813f..c288b04456775e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean +++ b/Mathlib/Combinatorics/SimpleGraph/LapMatrix.lean @@ -196,6 +196,7 @@ lemma linearIndependent_lapMatrix_ker_basis_aux : obtain ⟨i, h'⟩ : ∃ i : V, G.connectedComponentMk i = c := Quot.exists_rep c exact h' ▸ congrFun h0 i +set_option backward.isDefEq.respectTransparency.types false in lemma top_le_span_range_lapMatrix_ker_basis_aux : ⊤ ≤ Submodule.span ℝ (Set.range (lapMatrix_ker_basis_aux G)) := by intro x _ diff --git a/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean b/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean index 786371783f21af..8853e874184b08 100644 --- a/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/LineGraph.lean @@ -41,6 +41,7 @@ lemma lineGraph_adj_iff_exists {e₁ e₂ : G.edgeSet} : @[simp] lemma lineGraph_bot : (⊥ : SimpleGraph V).lineGraph = ⊥ := by aesop (add simp lineGraph) +set_option backward.isDefEq.respectTransparency false in /-- Lift a copy between graphs to an embedding between their line graphs -/ def Copy.toLineGraphEmbedding (f : Copy G G') : G.lineGraph ↪g G'.lineGraph where toFun e := ⟨e.val.map f, by rcases e with ⟨⟨⟩, h⟩; exact f.toHom.map_adj h⟩ diff --git a/Mathlib/Combinatorics/SimpleGraph/Maps.lean b/Mathlib/Combinatorics/SimpleGraph/Maps.lean index 7af785dbcc4cc5..2499fe757b1731 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Maps.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Maps.lean @@ -593,6 +593,7 @@ def induceHomOfLE (h : s ≤ s') : G.induce s ↪g G.induce s' where @[simp] lemma induceHomOfLE_apply (v : s) : (G.induceHomOfLE h) v = Set.inclusion h v := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma induceHomOfLE_toHom : (G.induceHomOfLE h).toHom = induceHom (.id : G →g G) ((Set.mapsTo_id s).mono_right h) := by ext; simp @@ -736,6 +737,7 @@ theorem neighborSet_map_equiv (e : V ≃ W) (w : W) : (G.map e).neighborSet w = e.symm ⁻¹' G.neighborSet (e.symm w) := Iso.map e G |>.symm.toEmbedding.preimage_neighborSet w |>.symm +set_option backward.isDefEq.respectTransparency false in /-- The graph induced on `Set.univ` is isomorphic to the original graph. -/ @[simps!] def induceUnivIso (G : SimpleGraph V) : G.induce Set.univ ≃g G where diff --git a/Mathlib/Combinatorics/SimpleGraph/Matching.lean b/Mathlib/Combinatorics/SimpleGraph/Matching.lean index 66f717ebea5291..ad740144806c1e 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Matching.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Matching.lean @@ -70,6 +70,7 @@ def IsMatching (M : Subgraph G) : Prop := ∀ ⦃v⦄, v ∈ M.verts → ∃! w, noncomputable def IsMatching.toEdge (h : M.IsMatching) (v : M.verts) : M.edgeSet := ⟨s(v, (h v.property).choose), (h v.property).choose_spec.1⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem IsMatching.toEdge_eq_of_adj (h : M.IsMatching) (hvw : M.Adj v w) : h.toEdge ⟨v, hvw.fst_mem⟩ = ⟨s(v, w), hvw⟩ := by rw [IsMatching.toEdge, Subtype.mk_eq_mk, ← h hvw.fst_mem |>.choose_spec.right w hvw] @@ -78,6 +79,7 @@ theorem IsMatching.toEdge.surjective (h : M.IsMatching) : Surjective h.toEdge := rintro ⟨⟨x, y⟩, he⟩ exact ⟨⟨x, M.edge_vert he⟩, h.toEdge_eq_of_adj he⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem IsMatching.toEdge_eq_toEdge_of_adj (h : M.IsMatching) (ha : M.Adj v w) : h.toEdge ⟨v, ha.fst_mem⟩ = h.toEdge ⟨w, ha.snd_mem⟩ := by rw [h.toEdge_eq_of_adj ha, h.toEdge_eq_of_adj ha.symm, Subtype.mk_eq_mk, Sym2.eq_swap] @@ -86,6 +88,7 @@ theorem IsMatching.mem_coe_toEdge (h : M.IsMatching) {v : V} (hv : v ∈ M.verts v ∈ (h.toEdge ⟨v, hv⟩ : Sym2 V) := ⟨h hv |>.choose, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem IsMatching.toEdge_preimage_singleton (h : M.IsMatching) (huv : M.Adj u v) : h.toEdge ⁻¹' {⟨s(u, v), huv⟩} = {⟨u, huv.fst_mem⟩, ⟨v, huv.snd_mem⟩} := by refine Set.ext fun w ↦ ⟨fun hw ↦ ?_, fun hw ↦ ?_⟩ diff --git a/Mathlib/Combinatorics/SimpleGraph/Paths.lean b/Mathlib/Combinatorics/SimpleGraph/Paths.lean index 222fad61c84c6c..27172731ffa6d3 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Paths.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Paths.lean @@ -940,6 +940,7 @@ namespace Walk variable {G} {u v : V} {H : SimpleGraph V} variable {p : G.Walk u v} +set_option backward.isDefEq.respectTransparency.types false in protected theorem IsPath.transfer (hp) (pp : p.IsPath) : (p.transfer H hp).IsPath := by induction p with @@ -948,6 +949,7 @@ protected theorem IsPath.transfer (hp) (pp : p.IsPath) : simp only [Walk.transfer, cons_isPath_iff, support_transfer _] at pp ⊢ exact ⟨ih _ pp.1, pp.2⟩ +set_option backward.isDefEq.respectTransparency.types false in protected theorem IsCycle.transfer {q : G.Walk u u} (qc : q.IsCycle) (hq) : (q.transfer H hq).IsCycle := by cases q with diff --git a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean index 540d7006005681..1eee649249ff09 100644 --- a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean +++ b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean @@ -95,6 +95,7 @@ theorem IsSRGWith.top : of_adj _ _ := card_commonNeighbors_top of_not_adj v w h h' := (h' ((top_adj v w).2 h)).elim +set_option backward.isDefEq.respectTransparency.types false in theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k ℓ μ) : #(G.neighborFinset v ∪ G.neighborFinset w) = 2 * k - Fintype.card (G.commonNeighbors v w) := by @@ -201,6 +202,7 @@ theorem IsSRGWith.param_eq ← Set.toFinset_card] congr! +set_option backward.isDefEq.respectTransparency.types false in /-- Let `A` and `C` be the adjacency matrices of a strongly regular graph with parameters `n k ℓ μ` and its complement respectively and `I` be the identity matrix, then `A ^ 2 = k • I + ℓ • A + μ • C`. `C` is equivalent to the expression `J - I - A` diff --git a/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean b/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean index 3dde862f14c0e5..b38c92dd9851e3 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Subgraph.lean @@ -471,7 +471,7 @@ instance : BoundedOrder (Subgraph G) where bot_le _ := ⟨Set.empty_subset _, fun _ _ => False.elim⟩ /-- Note that subgraphs do not form a Boolean algebra, because of `verts`. -/ -@[implicit_reducible] +@[instance_reducible] def completelyDistribLatticeMinimalAxioms : CompletelyDistribLattice.MinimalAxioms G.Subgraph where le_top G' := ⟨Set.subset_univ _, fun _ _ => G'.adj_sub⟩ bot_le _ := ⟨Set.empty_subset _, fun _ _ => False.elim⟩ @@ -776,7 +776,7 @@ instance finiteAt {G' : Subgraph G} (v : G'.verts) [DecidableRel G'.Adj] /-- If a subgraph is locally finite at a vertex, then so are subgraphs of that subgraph. This is not an instance because `G''` cannot be inferred. -/ -@[implicit_reducible] +@[instance_reducible] def finiteAtOfSubgraph {G' G'' : Subgraph G} [DecidableRel G'.Adj] (h : G' ≤ G'') (v : G'.verts) [Fintype (G''.neighborSet v)] : Fintype (G'.neighborSet v) := Set.fintypeSubset (G''.neighborSet v) (neighborSet_subset_of_subgraph h v) @@ -1109,6 +1109,7 @@ theorem deleteEdges_spanningCoe_eq : ext simp +set_option backward.isDefEq.respectTransparency false in theorem deleteEdges_coe_eq (s : Set (Sym2 G'.verts)) : G'.coe.deleteEdges s = (G'.deleteEdges (Sym2.map (↑) '' s)).coe := by ext ⟨v, hv⟩ ⟨w, hw⟩ @@ -1125,6 +1126,7 @@ theorem deleteEdges_coe_eq (s : Set (Sym2 G'.verts)) : · intro h' hs exact h' _ hs rfl +set_option backward.isDefEq.respectTransparency false in theorem coe_deleteEdges_eq (s : Set (Sym2 V)) : (G'.deleteEdges s).coe = G'.coe.deleteEdges (Sym2.map (↑) ⁻¹' s) := by ext ⟨v, hv⟩ ⟨w, hw⟩ @@ -1149,6 +1151,7 @@ theorem deleteEdges_inter_edgeSet_right_eq : G'.deleteEdges (s ∩ G'.edgeSet) = G'.deleteEdges s := by ext <;> simp +contextual [imp_false] +set_option backward.isDefEq.respectTransparency false in theorem coe_deleteEdges_le : (G'.deleteEdges s).coe ≤ (G'.coe : SimpleGraph G'.verts) := by intro v w simp +contextual @@ -1176,6 +1179,7 @@ def induce (G' : G.Subgraph) (s : Set V) : G.Subgraph where edge_vert h := h.1 symm _ _ h := ⟨h.2.1, h.1, G'.symm h.2.2⟩ +set_option backward.isDefEq.respectTransparency false in theorem _root_.SimpleGraph.induce_eq_coe_induce_top (s : Set V) : G.induce s = ((⊤ : G.Subgraph).induce s).coe := by ext @@ -1313,6 +1317,7 @@ theorem deleteVerts_mono {G' G'' : G.Subgraph} (h : G' ≤ G'') : G'.deleteVerts s ≤ G''.deleteVerts s := induce_mono h (Set.diff_subset_diff_left h.1) +set_option backward.isDefEq.respectTransparency false in @[mono] lemma deleteVerts_mono' {G' : SimpleGraph V} (u : Set V) (h : G ≤ G') : ((⊤ : Subgraph G).deleteVerts u).coe ≤ ((⊤ : Subgraph G').deleteVerts u).coe := by diff --git a/Mathlib/Combinatorics/SimpleGraph/Sum.lean b/Mathlib/Combinatorics/SimpleGraph/Sum.lean index 23a7317dc2db8b..1602da98a47559 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Sum.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Sum.lean @@ -57,6 +57,7 @@ def Iso.sumAssoc : (G ⊕g H) ⊕g I ≃g G ⊕g (H ⊕g I) where toEquiv := .sumAssoc .. map_rel_iff' := by rintro ((u | u) | u) ((v | v) | v) <;> simp +set_option backward.isDefEq.respectTransparency.types false in /-- The embedding of `G` into `G ⊕g H`. -/ @[simps] def Embedding.sumInl : G ↪g G ⊕g H where @@ -64,6 +65,7 @@ def Embedding.sumInl : G ↪g G ⊕g H where inj' u v := by simp map_rel_iff' := by simp +set_option backward.isDefEq.respectTransparency.types false in /-- The embedding of `H` into `G ⊕g H`. -/ @[simps] def Embedding.sumInr : H ↪g G ⊕g H where @@ -86,6 +88,7 @@ lemma Hom.sum_sum_comp_sumAssoc (f : G →g G') (g : H →g H') (h : I →g I') comp (sum f (sum g h)) Iso.sumAssoc.toHom = comp Iso.sumAssoc.toHom (sum (sum f g) h) := by ext ((v | w) | u) <;> simp +set_option backward.isDefEq.respectTransparency.types false in /-- Given embeddings `f : G ↪g G'` and `g : H ↪g H'`, returns an embedding from `G ⊕g H` to `G' ⊕g H'` that applies `f` to the left component and `g` to the right component. -/ @[simps] diff --git a/Mathlib/Combinatorics/SimpleGraph/Trails.lean b/Mathlib/Combinatorics/SimpleGraph/Trails.lean index 303e89003e5a02..aee32736da11d1 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Trails.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Trails.lean @@ -91,8 +91,9 @@ theorem IsEulerian.mem_edges_iff {u v : V} {p : G.Walk u v} (h : p.IsEulerian) { ⟨fun h => p.edges_subset_edgeSet h, fun he => by simpa [Nat.succ_le_iff] using (h e he).ge⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- The edge set of an Eulerian graph is finite. -/ -@[implicit_reducible] +@[instance_reducible] def IsEulerian.fintypeEdgeSet {u v : V} {p : G.Walk u v} (h : p.IsEulerian) : Fintype G.edgeSet := Fintype.ofFinset h.isTrail.edgesFinset fun e => by @@ -119,6 +120,7 @@ theorem IsEulerian.edgeSet_eq {u v : V} {p : G.Walk u v} (h : p.IsEulerian) : p.edgeSet = G.edgeSet := by rwa [← h.isTrail.isEulerian_iff] +set_option backward.isDefEq.respectTransparency.types false in theorem IsEulerian.edgesFinset_eq [Fintype G.edgeSet] {u v : V} {p : G.Walk u v} (h : p.IsEulerian) : h.isTrail.edgesFinset = G.edgeFinset := by ext e diff --git a/Mathlib/Combinatorics/SimpleGraph/Tutte.lean b/Mathlib/Combinatorics/SimpleGraph/Tutte.lean index 00b2ed126db5b8..158c0597d700ab 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Tutte.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Tutte.lean @@ -265,6 +265,7 @@ private theorem tutte_exists_isPerfectMatching_of_near_matchings {x a b c : V} exact tutte_exists_isAlternating_isCycles p hp hcalt (hnM2 _ hnbc) hpac hnpxb hM2ac hab.symm hnbc hxa.ne.symm hle (aux (by simp)) +set_option backward.isDefEq.respectTransparency.types false in /-- From a graph on an even number of vertices with no perfect matching, we can remove an odd number of vertices such that there are more odd components in the resulting graph than vertices we removed. diff --git a/Mathlib/Combinatorics/SimpleGraph/Walk/Basic.lean b/Mathlib/Combinatorics/SimpleGraph/Walk/Basic.lean index cbe2ca93a6f5ea..41238405e647e3 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Walk/Basic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Walk/Basic.lean @@ -457,6 +457,7 @@ theorem ofSupport_cons_cons {l : List V} (hchain : u :: v :: l |>.IsChain G.Adj) .cons hchain.rel (.ofSupport (v :: l) (l.cons_ne_nil v) hchain.of_cons) := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem support_ofSupport {l : List V} (hne : l ≠ []) (hchain : l.IsChain G.Adj) : (ofSupport l hne hchain).support = l := by @@ -492,6 +493,7 @@ theorem ofDarts_cons_cons {d₁ d₂ : G.Dart} {l : List G.Dart} .cons (hchain.rel ▸ d₁.adj) (ofDarts (d₂ :: l) (l.cons_ne_nil d₂) hchain.of_cons) := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem darts_ofDarts {l : List G.Dart} (hne : l ≠ []) (hchain : l.IsChain G.DartAdj) : (ofDarts l hne hchain).darts = l := by diff --git a/Mathlib/Combinatorics/SimpleGraph/Walk/Counting.lean b/Mathlib/Combinatorics/SimpleGraph/Walk/Counting.lean index 5a6b2dbe9779a9..fbf2a8a6b82c40 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Walk/Counting.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Walk/Counting.lean @@ -69,6 +69,7 @@ section LocallyFinite variable [DecidableEq V] [LocallyFinite G] +set_option backward.isDefEq.respectTransparency.types false in /-- The `Finset` of length-`n` walks from `u` to `v`. This is used to give `{p : G.walk u v | p.length = n}` a `Fintype` instance, and it can also be useful as a recursive description of this set when `V` is finite. @@ -111,6 +112,7 @@ def finsetWalkLengthLT (n : ℕ) (u v : V) : Finset (G.Walk u v) := have hl' : p.length = l' := mem_finsetWalkLength_iff.mp (hsl' hp) False.elim <| hne <| hl.symm.trans hl') +set_option backward.isDefEq.respectTransparency.types false in open Finset in theorem coe_finsetWalkLengthLT_eq (n : ℕ) (u v : V) : (G.finsetWalkLengthLT n u v : Set (G.Walk u v)) = {p : G.Walk u v | p.length < n} := by diff --git a/Mathlib/Combinatorics/SimpleGraph/Walk/Decomp.lean b/Mathlib/Combinatorics/SimpleGraph/Walk/Decomp.lean index db3f99b494339a..bb1c1bf0ed06e6 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Walk/Decomp.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Walk/Decomp.lean @@ -58,6 +58,7 @@ lemma takeUntil_first (p : G.Walk u v) : lemma nil_takeUntil (p : G.Walk u v) (hwp : w ∈ p.support) : (p.takeUntil w hwp).Nil ↔ u = w := ⟨Nil.eq, (by cases ·; simp)⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma takeUntil_eq_take (p : G.Walk u v) (h : w ∈ p.support) : p.takeUntil w h = (p.take <| p.support.idxOf w).copy rfl (p.getVert_support_idxOf h) := by apply ext_support @@ -105,6 +106,7 @@ lemma dropUntil_first (p : G.Walk u v) (h : u ∈ p.support) : p.dropUntil u h = unfold dropUntil split <;> simp +set_option backward.isDefEq.respectTransparency.types false in lemma dropUntil_eq_drop (p : G.Walk u v) (h : w ∈ p.support) : p.dropUntil w h = (p.drop <| p.support.idxOf w).copy (p.getVert_support_idxOf h) rfl := by apply ext_support diff --git a/Mathlib/Combinatorics/SimpleGraph/Walk/Maps.lean b/Mathlib/Combinatorics/SimpleGraph/Walk/Maps.lean index c56126739d8339..37dd109e6997b4 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Walk/Maps.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Walk/Maps.lean @@ -159,6 +159,7 @@ variable {H : SimpleGraph V} theorem transfer_eq_map_ofLE (hp) (GH : G ≤ H) : p.transfer H hp = p.map (.ofLE GH) := by induction p <;> simp [*] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem edges_transfer (hp) : (p.transfer H hp).edges = p.edges := by induction p <;> simp [*] @@ -166,10 +167,12 @@ theorem edges_transfer (hp) : (p.transfer H hp).edges = p.edges := by @[simp] theorem edgeSet_transfer (hp) : (p.transfer H hp).edgeSet = p.edgeSet := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem support_transfer (hp) : (p.transfer H hp).support = p.support := by induction p <;> simp [*] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem length_transfer (hp) : (p.transfer H hp).length = p.length := by induction p <;> simp [*] @@ -179,6 +182,7 @@ theorem transfer_transfer (hp) {K : SimpleGraph V} (hp') : (p.transfer H hp).transfer K hp' = p.transfer K (p.edges_transfer hp ▸ hp') := by induction p <;> simp [*] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transfer_append {w : V} (q : G.Walk v w) (hpq) : (p.append q).transfer H hpq = @@ -186,6 +190,7 @@ theorem transfer_append {w : V} (q : G.Walk v w) (hpq) : (q.transfer H fun e he => hpq _ (by simp [he])) := by induction p <;> simp [*] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem reverse_transfer (hp) : (p.transfer H hp).reverse = @@ -219,6 +224,7 @@ protected def induce {u v : V} : | .nil, hw => rfl | .cons (v := u') huu' w, hw => by simp [map_induce] +set_option backward.isDefEq.respectTransparency.types false in lemma map_induce_induceHomOfLE (hs : s ⊆ s') {u v : V} : ∀ (w : G.Walk u v) (hw), (w.induce s hw).map (G.induceHomOfLE hs).toHom = w.induce s' (subset_trans hw hs) | .nil, hw => rfl diff --git a/Mathlib/Combinatorics/SimpleGraph/Walk/Operations.lean b/Mathlib/Combinatorics/SimpleGraph/Walk/Operations.lean index 438a69ca13e225..6582dde9a83b7d 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Walk/Operations.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Walk/Operations.lean @@ -28,6 +28,8 @@ Operations on walks that produce a new walk in the same graph. walks -/ +set_option backward.isDefEq.respectTransparency.types false + @[expose] public section open Function @@ -282,6 +284,7 @@ def concatRec {u v : V} (p : G.Walk u v) : motive u v p := theorem concatRec_nil (u : V) : @concatRec _ _ motive @Hnil @Hconcat _ _ (nil : G.Walk u u) = Hnil := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem concatRec_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) : @concatRec _ _ motive @Hnil @Hconcat _ _ (p.concat h) = @@ -399,6 +402,7 @@ theorem coe_support_append' [DecidableEq V] {u v w : V} (p : G.Walk u v) (p' : G simp_rw [support_append, ← Multiset.coe_add, coe_support, add_comm ({v} : Multiset V), ← add_assoc, add_tsub_cancel_right] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ofSupport_support {u v : V} (p : G.Walk u v) : ofSupport _ p.support_ne_nil p.isChain_adj_support = p.copy (by simp) (by simp) := by @@ -434,6 +438,7 @@ theorem darts_reverse {u v : V} (p : G.Walk u v) : theorem mem_darts_reverse {u v : V} {d : G.Dart} {p : G.Walk u v} : d ∈ p.reverse.darts ↔ d.symm ∈ p.darts := by simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ofDarts_darts {u v : V} {p : G.Walk u v} (hp : ¬p.Nil) : ofDarts _ (darts_eq_nil.not.mpr hp) p.isChain_dartAdj_darts = p.copy (by simp) (by simp) := by diff --git a/Mathlib/Combinatorics/Young/YoungDiagram.lean b/Mathlib/Combinatorics/Young/YoungDiagram.lean index df7fa4f351b824..92ec2e1a5b52d0 100644 --- a/Mathlib/Combinatorics/Young/YoungDiagram.lean +++ b/Mathlib/Combinatorics/Young/YoungDiagram.lean @@ -229,6 +229,7 @@ theorem transpose_le_iff {μ ν : YoungDiagram} : μ.transpose ≤ ν.transpose protected theorem transpose_mono {μ ν : YoungDiagram} (h_le : μ ≤ ν) : μ.transpose ≤ ν.transpose := transpose_le_iff.mpr h_le +set_option backward.isDefEq.respectTransparency false in /-- Transposing Young diagrams is an `OrderIso`. -/ @[simps] def transposeOrderIso : YoungDiagram ≃o YoungDiagram := @@ -259,6 +260,7 @@ theorem mem_row_iff {μ : YoungDiagram} {i : ℕ} {c : ℕ × ℕ} : c ∈ μ.ro theorem mk_mem_row_iff {μ : YoungDiagram} {i j : ℕ} : (i, j) ∈ μ.row i ↔ (i, j) ∈ μ := by simp [row] +set_option backward.isDefEq.respectTransparency false in protected theorem exists_notMem_row (μ : YoungDiagram) (i : ℕ) : ∃ j, (i, j) ∉ μ := by obtain ⟨j, hj⟩ := Infinite.exists_notMem_finset diff --git a/Mathlib/Computability/Ackermann.lean b/Mathlib/Computability/Ackermann.lean index d100c4f3290f01..ab7886f873d6e0 100644 --- a/Mathlib/Computability/Ackermann.lean +++ b/Mathlib/Computability/Ackermann.lean @@ -358,10 +358,12 @@ lemma primrec_pappAck_step : Primrec pappAck.step := by [Code.primrec₂_curry.comp, Code.primrec₂_prec.comp, Code.primrec₂_comp.comp, _root_.Primrec.id, Primrec.const] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma eval_pappAck_step_zero (c : Code) : (pappAck.step c).eval 0 = c.eval 1 := by simp [pappAck.step, Code.eval] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma eval_pappAck_step_succ (c : Code) (n) : (pappAck.step c).eval (n + 1) = ((pappAck.step c).eval n).bind c.eval := by @@ -372,6 +374,7 @@ lemma primrec_pappAck : Primrec pappAck := by convert! this using 2 with n; induction n <;> simp [pappAck, *] apply_rules [Primrec.nat_rec₁, primrec_pappAck_step.comp, Primrec.snd] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma eval_pappAck (m n) : (pappAck m).eval n = Part.some (ack m n) := by induction m, n using ack.induct with diff --git a/Mathlib/Computability/ContextFreeGrammar.lean b/Mathlib/Computability/ContextFreeGrammar.lean index afc77c897f18a9..d1e1f2ca738942 100644 --- a/Mathlib/Computability/ContextFreeGrammar.lean +++ b/Mathlib/Computability/ContextFreeGrammar.lean @@ -318,6 +318,7 @@ protected lemma Derives.reverse (hg : g.Derives u v) : g.reverse.Derives u.rever | tail _ orig ih => exact ih.trans_produces orig.reverse set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in lemma derives_reverse : g.reverse.Derives u.reverse v.reverse ↔ g.Derives u v := ⟨fun h ↦ by convert! h.reverse <;> simp, .reverse⟩ diff --git a/Mathlib/Computability/DFA.lean b/Mathlib/Computability/DFA.lean index 36ca475da8505c..8af953f2b0186c 100644 --- a/Mathlib/Computability/DFA.lean +++ b/Mathlib/Computability/DFA.lean @@ -262,6 +262,7 @@ theorem accepts_reindex (g : σ ≃ σ') : (reindex g M).accepts = M.accepts := ext x simp [mem_accepts] +set_option backward.isDefEq.respectTransparency false in theorem comap_reindex (f : α' → α) (g : σ ≃ σ') : (reindex g M).comap f = reindex g (M.comap f) := by simp [comap, reindex] diff --git a/Mathlib/Computability/Encoding.lean b/Mathlib/Computability/Encoding.lean index 38066ea8ffc561..abbbac8a1ed1d8 100644 --- a/Mathlib/Computability/Encoding.lean +++ b/Mathlib/Computability/Encoding.lean @@ -226,6 +226,7 @@ def finEncodingList (α : Type) [Fintype α] : FinEncoding (List α) where decode_encode _ := rfl ΓFin := inferInstance +set_option backward.isDefEq.respectTransparency false in /-- Given `FinEncoding` of `α` and `β`, constructs a `FinEncoding` of `α × β` by concatenating the encodings, diff --git a/Mathlib/Computability/Language.lean b/Mathlib/Computability/Language.lean index 3a80d48bde0824..0573a4afc18ce0 100644 --- a/Mathlib/Computability/Language.lean +++ b/Mathlib/Computability/Language.lean @@ -157,6 +157,7 @@ theorem nil_mem_kstar (l : Language α) : [] ∈ l∗ := instance : OrderedSub (Language α) where tsub_le_iff_right _ _ _ := sdiff_le_iff' +set_option backward.isDefEq.respectTransparency false in instance instSemiring : Semiring (Language α) where add_assoc := union_assoc zero_add := empty_union @@ -186,9 +187,11 @@ def map (f : α → β) : Language α →+* Language β where map_add' := image_union _ map_mul' _ _ := image_image2_distrib <| fun _ _ => map_append +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_id (l : Language α) : map id l = l := by simp [map] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_map (g : β → γ) (f : α → β) (l : Language α) : map g (map f l) = map (g ∘ f) l := by simp [map, image_image] @@ -363,6 +366,7 @@ lemma reverse_reverse (l : Language α) : l.reverse.reverse = l := reverse_invol @[simp] lemma reverse_add (l m : Language α) : (l + m).reverse = l.reverse + m.reverse := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma reverse_mul (l m : Language α) : (l * m).reverse = m.reverse * l.reverse := by simp only [mul_def, reverse_eq_image, image2_image_left, image2_image_right, image_image2, diff --git a/Mathlib/Computability/NFA.lean b/Mathlib/Computability/NFA.lean index ec0693bc70abda..08b81149ff175f 100644 --- a/Mathlib/Computability/NFA.lean +++ b/Mathlib/Computability/NFA.lean @@ -221,6 +221,7 @@ theorem acceptsFrom_iUnion {ι : Sort*} (s : ι → Set σ) : simp only [acceptsFrom, evalFrom_iUnion, mem_iUnion] simp_rw [↑mem_iUnion, ↑mem_setOf_eq]; tauto +set_option backward.isDefEq.respectTransparency false in variable (M) in theorem acceptsFrom_iUnion₂ {ι : Sort*} {κ : ι → Sort*} (f : ∀ i, κ i → Set σ) : M.acceptsFrom (⋃ (i) (j), f i j) = ⋃ (i) (j), M.acceptsFrom (f i j) := by diff --git a/Mathlib/Computability/Partrec.lean b/Mathlib/Computability/Partrec.lean index 43697b6b771a02..3a29882f20912c 100644 --- a/Mathlib/Computability/Partrec.lean +++ b/Mathlib/Computability/Partrec.lean @@ -178,6 +178,7 @@ theorem of_eq_tot {f : ℕ →. ℕ} {g : ℕ → ℕ} (hf : Nat.Partrec f) (H : Nat.Partrec g := hf.of_eq fun n => eq_some_iff.2 (H n) +set_option backward.isDefEq.respectTransparency false in theorem of_primrec {f : ℕ → ℕ} (hf : Nat.Primrec f) : Nat.Partrec f := by induction hf with | zero => exact zero @@ -201,6 +202,7 @@ theorem of_primrec {f : ℕ → ℕ} (hf : Nat.Primrec f) : Nat.Partrec f := by protected theorem some : Nat.Partrec some := of_primrec Primrec.id +set_option backward.isDefEq.respectTransparency false in theorem none : Nat.Partrec fun _ => none := (of_primrec (Nat.Primrec.const 1)).rfind.of_eq fun _ => eq_none_iff.2 fun _ ⟨h, _⟩ => by simp at h @@ -211,6 +213,7 @@ theorem prec' {f g h} (hf : Nat.Partrec f) (hg : Nat.Partrec g) (hh : Nat.Partre ((prec hg hh).comp (pair Partrec.some hf)).of_eq fun a => ext fun s => by simp [Seq.seq] +set_option backward.isDefEq.respectTransparency false in theorem ppred : Nat.Partrec fun n => ppred n := have : Primrec₂ fun n m => if n = Nat.succ m then 0 else 1 := (Primrec.ite @@ -397,6 +400,7 @@ theorem const' (s : Part σ) : Partrec fun _ : α => s := haveI := Classical.dec s.Dom Decidable.Partrec.const' s +set_option backward.isDefEq.respectTransparency false in protected theorem bind {f : α →. β} {g : α → β →. σ} (hf : Partrec f) (hg : Partrec₂ g) : Partrec fun a => (f a).bind (g a) := (hg.comp (Nat.Partrec.some.pair hf)).of_eq fun n => by @@ -490,6 +494,7 @@ variable {α : Type*} {σ : Type*} [Primcodable α] [Primcodable σ] open Computable +set_option backward.isDefEq.respectTransparency false in theorem rfind {p : α → ℕ →. Bool} (hp : Partrec₂ p) : Partrec fun a => Nat.rfind (p a) := (Nat.Partrec.rfind <| hp.map ((Primrec.dom_bool fun b => cond b 0 1).comp Primrec.snd).to₂.to_comp).of_eq @@ -551,6 +556,7 @@ variable [Primcodable α] [Primcodable β] [Primcodable γ] [Primcodable σ] theorem option_some_iff {f : α → σ} : (Computable fun a => Option.some (f a)) ↔ Computable f := ⟨fun h => encode_iff.1 <| Primrec.pred.to_comp.comp <| encode_iff.2 h, option_some.comp⟩ +set_option backward.isDefEq.respectTransparency false in theorem bind_decode_iff {f : α → β → Option σ} : (Computable₂ fun a n => (decode (α := β) n).bind (f a)) ↔ Computable₂ f := ⟨fun hf => @@ -676,6 +682,7 @@ theorem option_some_iff {f : α →. σ} : (Partrec fun a => (f a).map Option.so ⟨fun h => (Nat.Partrec.ppred.comp h).of_eq fun n => by simp [Part.bind_assoc, bind_some_eq_map], fun hf => hf.map (option_some.comp snd).to₂⟩ +set_option backward.isDefEq.respectTransparency false in theorem optionCasesOn_right {o : α → Option β} {f : α → σ} {g : α → β →. σ} (ho : Computable o) (hf : Computable f) (hg : Partrec₂ g) : @Partrec _ σ _ _ fun a => Option.casesOn (o a) (Part.some (f a)) (g a) := @@ -757,6 +764,7 @@ theorem fix_aux {α σ} (f : α →. σ ⊕ α) (a : α) (b : σ) : clear_value F grind +set_option backward.isDefEq.respectTransparency false in theorem fix {f : α →. σ ⊕ α} (hf : Partrec f) : Partrec (PFun.fix f) := by let F : α → ℕ →. σ ⊕ α := fun a n => n.rec (some (Sum.inr a)) fun _ IH => IH.bind fun s => Sum.casesOn s (fun _ => Part.some s) f diff --git a/Mathlib/Computability/PartrecBasis.lean b/Mathlib/Computability/PartrecBasis.lean index b8ac24de132123..d53427a3ce5e66 100644 --- a/Mathlib/Computability/PartrecBasis.lean +++ b/Mathlib/Computability/PartrecBasis.lean @@ -64,11 +64,13 @@ theorem of_prim {n} {f : List.Vector ℕ n → ℕ} (hf : Primrec f) : @Partrec' theorem head {n : ℕ} : @Partrec' n.succ (@head ℕ n) := prim Nat.Primrec'.head +set_option backward.isDefEq.respectTransparency.types false in theorem tail {n f} (hf : @Partrec' n f) : @Partrec' n.succ fun v => f v.tail := (hf.comp _ fun i => @prim _ _ <| Nat.Primrec'.get i.succ).of_eq fun v => by rw [← ofFn_get v.tail, funext (get_tail_succ v)] simp +set_option backward.isDefEq.respectTransparency.types false in protected theorem bind {n f g} (hf : @Partrec' n f) (hg : @Partrec' (n + 1) g) : @Partrec' n fun v => (f v).bind fun a => g (a ::ᵥ v) := (@comp n (n + 1) g (Fin.cases f (fun i v => some (v.get i))) hg <| @@ -95,6 +97,7 @@ protected theorem cons {n m} {f : List.Vector ℕ n → ℕ} {g} (hf : @Partrec' theorem idv {n} : @Vec n n id := Vec.prim Nat.Primrec'.idv +set_option backward.isDefEq.respectTransparency.types false in theorem comp' {n m f g} (hf : @Partrec' m f) (hg : @Vec n m g) : Partrec' fun v => f (g v) := (hf.comp _ hg).of_eq fun v => by simp diff --git a/Mathlib/Computability/PartrecCode.lean b/Mathlib/Computability/PartrecCode.lean index 28d51e727e65df..c1730eb40c5c3b 100644 --- a/Mathlib/Computability/PartrecCode.lean +++ b/Mathlib/Computability/PartrecCode.lean @@ -493,6 +493,7 @@ theorem eval_prec_succ (cf cg : Code) (a k : ℕ) : instance : Membership (ℕ →. ℕ) Code := ⟨fun c f => eval c = f⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem eval_const : ∀ n m, eval (Code.const n) m = Part.some n | 0, _ => rfl @@ -501,6 +502,7 @@ theorem eval_const : ∀ n m, eval (Code.const n) m = Part.some n @[simp] theorem eval_id (n) : eval Code.id n = Part.some n := by simp! [Seq.seq, Code.id] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem eval_curry (c n x) : eval (curry c n) x = eval c (Nat.pair n x) := by simp! [Seq.seq, curry] @@ -528,6 +530,7 @@ theorem smn : ∃ f : Code → ℕ → Code, Computable₂ f ∧ ∀ c n x, eval (f c n) x = eval c (Nat.pair n x) := ⟨curry, Primrec₂.to_comp primrec₂_curry, eval_curry⟩ +set_option backward.isDefEq.respectTransparency false in /-- A function is partial recursive if and only if there is a code implementing it. Therefore, `eval` is a **universal partial recursive function**. -/ theorem exists_code {f : ℕ →. ℕ} : Nat.Partrec f ↔ ∃ c : Code, eval c = f := by @@ -647,6 +650,7 @@ theorem evaln_mono : ∀ {k₁ k₂ c n x}, k₁ ≤ k₂ → x ∈ evaln k₁ c by_cases x0 : x = 0 <;> simp [x0] exact evaln_mono hl' +set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in -- TODO: revisit this after #13791 is merged theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n | 0, _, n, x, h => by simp [evaln] at h @@ -686,6 +690,7 @@ theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n · rcases hy₂ (Nat.lt_of_succ_lt_succ im) with ⟨z, hz, z0⟩ exact ⟨z, by simpa [add_comm, add_left_comm] using hz, z0⟩ +set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in -- TODO: revisit this after #13791 is merged theorem evaln_complete {c n x} : x ∈ eval c n ↔ ∃ k, x ∈ evaln k c n := by refine ⟨fun h => ?_, fun ⟨k, h⟩ => evaln_sound h⟩ @@ -1031,6 +1036,7 @@ instance : Countable {f : ℕ →. ℕ // Partrec f} := by apply Function.Surjective.countable (f := fun c => ⟨eval c, eval_part.comp (.const c) .id⟩) intro ⟨f, hf⟩; simpa using! exists_code.1 hf +set_option backward.isDefEq.respectTransparency false in /-- There are only countably many computable functions `ℕ → ℕ`. -/ instance : Countable {f : ℕ → ℕ // Computable f} := @Function.Injective.countable {f : ℕ → ℕ // Computable f} {f : ℕ →. ℕ // Partrec f} _ diff --git a/Mathlib/Computability/Primrec/Basic.lean b/Mathlib/Computability/Primrec/Basic.lean index dc474f44f6090d..cab20400869385 100644 --- a/Mathlib/Computability/Primrec/Basic.lean +++ b/Mathlib/Computability/Primrec/Basic.lean @@ -140,7 +140,7 @@ instance (priority := 10) ofDenumerable (α) [Denumerable α] : Primcodable α : ⟨Nat.Primrec.succ.of_eq <| by simp⟩ /-- Builds a `Primcodable` instance from an equivalence to a `Primcodable` type. -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv (α) {β} [Primcodable α] (e : β ≃ α) : Primcodable β := { __ := Encodable.ofEquiv α e prim := (Primcodable.prim α).of_eq fun n => by @@ -811,7 +811,7 @@ variable {α : Type*} [Primcodable α] open Primrec /-- A subtype of a primitive recursive predicate is `Primcodable`. -/ -@[implicit_reducible] +@[instance_reducible] def subtype {p : α → Prop} [DecidablePred p] (hp : PrimrecPred p) : Primcodable (Subtype p) := ⟨have : Primrec fun n => (@decode α _ n).bind fun a => Option.guard p a := option_bind .decode (option_guard (hp.comp snd).primrecRel snd) diff --git a/Mathlib/Computability/Primrec/List.lean b/Mathlib/Computability/Primrec/List.lean index d27fe68baba292..fe22bcd70ed950 100644 --- a/Mathlib/Computability/Primrec/List.lean +++ b/Mathlib/Computability/Primrec/List.lean @@ -35,7 +35,7 @@ variable (H : Nat.Primrec fun n => Encodable.encode (@decode (List β) _ n)) open Primrec set_option backward.privateInPublic true in -@[implicit_reducible] +@[instance_reducible] private def prim : Primcodable (List β) := ⟨H⟩ private theorem list_casesOn' {f : α → List β} {g : α → σ} {h : α → β × List β → σ} diff --git a/Mathlib/Computability/RE.lean b/Mathlib/Computability/RE.lean index 57421b1b04ab98..16aebb86bd055e 100644 --- a/Mathlib/Computability/RE.lean +++ b/Mathlib/Computability/RE.lean @@ -171,6 +171,7 @@ theorem ComputablePred.of_eq {α} [Primcodable α] {p q : α → Prop} (hp : Com namespace Computable +set_option backward.isDefEq.respectTransparency.types false in /-- If `P` is computable, and if for every `x` there exists an `n` such that `P x n` holds, then the function mapping `x` to the minimal such `n` (using `Nat.find`) is computable. This formally bridges `Partrec.rfind` with total unbounded search. -/ diff --git a/Mathlib/Computability/Reduce.lean b/Mathlib/Computability/Reduce.lean index c7f16ff4f494d8..57283d7201ffe4 100644 --- a/Mathlib/Computability/Reduce.lean +++ b/Mathlib/Computability/Reduce.lean @@ -369,10 +369,12 @@ instance instLE : LE ManyOneDegree := theorem of_le_of {p : α → Prop} {q : β → Prop} : of p ≤ of q ↔ p ≤₀ q := manyOneReducible_toNat_toNat +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in private theorem le_refl (d : ManyOneDegree) : d ≤ d := by induction d using ManyOneDegree.ind_on; simp; rfl +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in private theorem le_antisymm {d₁ d₂ : ManyOneDegree} : d₁ ≤ d₂ → d₂ ≤ d₁ → d₁ = d₂ := by induction d₁ using ManyOneDegree.ind_on @@ -417,6 +419,7 @@ theorem add_of (p : Set α) (q : Set β) : of (p ⊕' q) = of p + of q := (toNat_manyOneReducible.trans OneOneReducible.disjoin_left.to_many_one) (toNat_manyOneReducible.trans OneOneReducible.disjoin_right.to_many_one)⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] protected theorem add_le {d₁ d₂ d₃ : ManyOneDegree} : d₁ + d₂ ≤ d₃ ↔ d₁ ≤ d₃ ∧ d₂ ≤ d₃ := by induction d₁ using ManyOneDegree.ind_on diff --git a/Mathlib/Computability/TuringMachine/Config.lean b/Mathlib/Computability/TuringMachine/Config.lean index 71099a475e9c7f..7e3cbccc14e442 100644 --- a/Mathlib/Computability/TuringMachine/Config.lean +++ b/Mathlib/Computability/TuringMachine/Config.lean @@ -124,24 +124,30 @@ def Code.eval : Code → List ℕ →. List ℕ namespace Code +set_option backward.isDefEq.respectTransparency false in @[simp] theorem zero'_eval : zero'.eval = fun v => pure (0 :: v) := by simp [eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem succ_eval : succ.eval = fun v => pure [v.headI.succ] := by simp [eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem tail_eval : tail.eval = fun v => pure v.tail := by simp [eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem cons_eval (f fs) : (cons f fs).eval = fun v => do { let n ← Code.eval f v let ns ← Code.eval fs v pure (n.headI :: ns) } := by simp [eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval := by simp [eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem case_eval (f g) : (case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) := by @@ -237,6 +243,7 @@ def prec (f g : Code) : Code := attribute [-simp] Part.bind_eq_bind Part.map_eq_map Part.pure_eq_some +set_option backward.isDefEq.respectTransparency false in theorem exists_code.comp {m n} {f : List.Vector ℕ n →. ℕ} {g : Fin n → List.Vector ℕ m →. ℕ} (hf : ∃ c : Code, ∀ v : List.Vector ℕ n, c.eval v.1 = pure <$> f v) (hg : ∀ i, ∃ c : Code, ∀ v : List.Vector ℕ m, c.eval v.1 = pure <$> g i v) : @@ -517,6 +524,7 @@ def Cont.then : Cont → Cont → Cont | Cont.comp f k => fun k' => Cont.comp f (k.then k') | Cont.fix f k => fun k' => Cont.fix f (k.then k') +set_option backward.isDefEq.respectTransparency false in theorem Cont.then_eval {k k' : Cont} {v} : (k.then k').eval v = k.eval v >>= k'.eval := by induction k generalizing v with | halt => simp only [Cont.eval, Cont.then, pure_bind] @@ -664,6 +672,7 @@ theorem cont_eval_fix {f k v} (fok : Code.Ok f) : rw [stepRet, if_neg h] exact IH v₁.tail ((Part.mem_map_iff _).2 ⟨_, he₁, if_neg h⟩) +set_option backward.isDefEq.respectTransparency false in theorem code_is_ok (c) : Code.Ok c := by induction c with (intro k v; rw [stepNormal]) | cons f fs IHf IHfs => @@ -689,6 +698,7 @@ theorem code_is_ok (c) : Code.Ok c := by theorem stepNormal_eval (c v) : eval step (stepNormal c Cont.halt v) = Cfg.halt <$> c.eval v := (code_is_ok c).zero +set_option backward.isDefEq.respectTransparency false in theorem stepRet_eval {k v} : eval step (stepRet k v) = Cfg.halt <$> k.eval v := by induction k generalizing v with | halt => diff --git a/Mathlib/Computability/TuringMachine/StackTuringMachine.lean b/Mathlib/Computability/TuringMachine/StackTuringMachine.lean index 0e1a5b29264881..20eb92de6a5bb7 100644 --- a/Mathlib/Computability/TuringMachine/StackTuringMachine.lean +++ b/Mathlib/Computability/TuringMachine/StackTuringMachine.lean @@ -383,10 +383,12 @@ theorem addBottom_nth_snd (L : ListBlank (∀ k, Option (Γ k))) (n : ℕ) : ((addBottom L).nth n).2 = L.nth n := by conv => rhs; rw [← addBottom_map L, ListBlank.nth_map] +set_option backward.isDefEq.respectTransparency false in theorem addBottom_nth_succ_fst (L : ListBlank (∀ k, Option (Γ k))) (n : ℕ) : ((addBottom L).nth (n + 1)).1 = false := by rw [ListBlank.nth_succ, addBottom, ListBlank.tail_cons, ListBlank.nth_map] +set_option backward.isDefEq.respectTransparency false in theorem addBottom_head_fst (L : ListBlank (∀ k, Option (Γ k))) : (addBottom L).head.1 = true := by rw [addBottom, ListBlank.head_cons] @@ -580,7 +582,7 @@ theorem tr_respects_aux₂ [DecidableEq K] {k : K} {q : TM1.Stmt (Γ' K Γ) (Λ' | pop f => rcases e : S k with - | ⟨hd, tl⟩ · simp only [Tape.mk'_head, ListBlank.head_cons, Tape.move_left_mk', List.length, - Tape.write_mk', List.head?, iterate_zero_apply, List.tail_nil] + List.head?, iterate_zero_apply, List.tail_nil] rw [← e, Function.update_eq_self] exact ⟨L, hL, by rw [addBottom_head_fst, cond]⟩ · refine @@ -704,6 +706,7 @@ theorem tr_respects : Respects (TM2.step M) (TM1.step (tr M)) TrCfg := by section variable [Inhabited Λ] [Inhabited σ] +set_option backward.isDefEq.respectTransparency false in theorem trCfg_init (k) (L : List (Γ k)) : TrCfg (TM2.init k L) (TM1.init (trInit k L) : TM1.Cfg (Γ' K Γ) (Λ' K Γ Λ σ) σ) := by rw [(_ : TM1.init _ = _)] diff --git a/Mathlib/Computability/TuringMachine/Tape.lean b/Mathlib/Computability/TuringMachine/Tape.lean index 22ad98a2f1fb51..6263e04e12114b 100644 --- a/Mathlib/Computability/TuringMachine/Tape.lean +++ b/Mathlib/Computability/TuringMachine/Tape.lean @@ -115,7 +115,7 @@ theorem BlankRel.equivalence (Γ) [Inhabited Γ] : Equivalence (@BlankRel Γ _) ⟨BlankRel.refl, @BlankRel.symm _ _, @BlankRel.trans _ _⟩ /-- Construct a setoid instance for `BlankRel`. -/ -@[implicit_reducible] +@[instance_reducible] def BlankRel.setoid (Γ) [Inhabited Γ] : Setoid (List Γ) := ⟨_, BlankRel.equivalence _⟩ diff --git a/Mathlib/Computability/TuringMachine/ToPartrec.lean b/Mathlib/Computability/TuringMachine/ToPartrec.lean index 161c480fb874ac..b4854519e3bd01 100644 --- a/Mathlib/Computability/TuringMachine/ToPartrec.lean +++ b/Mathlib/Computability/TuringMachine/ToPartrec.lean @@ -154,6 +154,7 @@ section open ToPartrec +set_option backward.isDefEq.respectTransparency false in /-- The alphabet for the stacks in the program. `bit0` and `bit1` are used to represent `ℕ` values as lists of binary digits, `cons` is used to separate `List ℕ` values, and `consₗ` is used to separate `List (List ℕ)` values. See the section documentation. -/ @@ -663,6 +664,7 @@ theorem clear_ok {p k q s L₁ o L₂} {S : K' → List Γ'} (e : splitAtPred p simp only [List.head?_cons, e₂, List.tail_cons, cond_false] convert! @IH _ (update S k Sk) _ using 2 <;> simp [e₃] +set_option backward.isDefEq.respectTransparency false in theorem copy_ok (q s a b c d) : Reaches₁ (TM2.step tr) ⟨some (Λ'.copy q), s, K'.elim a b c d⟩ ⟨some q, none, K'.elim (List.reverseAux b a) [] c (List.reverseAux b d)⟩ := by @@ -751,6 +753,7 @@ theorem head_stack_ok {q s L₁ L₂ L₃} : convert! unrev_ok using 2 simp [List.reverseAux_eq] +set_option backward.isDefEq.respectTransparency false in theorem succ_ok {q s n} {c d : List Γ'} : Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩ ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by @@ -787,6 +790,7 @@ theorem succ_ok {q s n} {c d : List Γ'} : elim_rev, elim_update_rev, Function.update_self, Option.mem_def, Option.some.injEq] rfl +set_option backward.isDefEq.respectTransparency false in theorem pred_ok (q₁ q₂ s v) (c d : List Γ') : ∃ s', Reaches₁ (TM2.step tr) ⟨some (Λ'.pred q₁ q₂), s, K'.elim (trList v) [] c d⟩ (v.headI.rec ⟨some q₁, s', K'.elim (trList v.tail) [] c d⟩ fun n _ => @@ -833,6 +837,7 @@ theorem pred_ok (q₁ q₂ s v) (c d : List Γ') : ∃ s', Option.getD, -natEnd] rfl +set_option backward.isDefEq.respectTransparency false in theorem trNormal_respects (c k v s) : ∃ b₂, TrCfg (stepNormal c k v) b₂ ∧ diff --git a/Mathlib/Condensed/Discrete/Colimit.lean b/Mathlib/Condensed/Discrete/Colimit.lean index 3644a930d60a4c..725f56403ba3fa 100644 --- a/Mathlib/Condensed/Discrete/Colimit.lean +++ b/Mathlib/Condensed/Discrete/Colimit.lean @@ -59,9 +59,10 @@ noncomputable def isColimitLocallyConstantPresheaf (hc : IsLimit c) [∀ i, Epi change fi ((c.π.app k ≫ (F ⋙ toProfinite).map _) x) = fj ((c.π.app k ≫ (F ⋙ toProfinite).map _) x) have h := LocallyConstant.congr_fun h x - dsimp + dsimp [- CompHausLike.coe_comp] rwa [dsimp% c.w, dsimp% c.w] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma isColimitLocallyConstantPresheaf_desc_apply (hc : IsLimit c) [∀ i, Epi (c.π.app i)] (s : Cocone ((F ⋙ toProfinite).op ⋙ locallyConstantPresheaf X)) @@ -71,7 +72,6 @@ lemma isColimitLocallyConstantPresheaf_desc_apply (hc : IsLimit c) [∀ i, Epi ( change ((((locallyConstantPresheaf X).mapCocone c.op).ι.app ⟨i⟩) ≫ (isColimitLocallyConstantPresheaf c X hc).desc s) _ = _ rw [(isColimitLocallyConstantPresheaf c X hc).fac] - rfl /-- `isColimitLocallyConstantPresheaf` in the case of `S.asLimit`. -/ noncomputable def isColimitLocallyConstantPresheafDiagram (S : Profinite) : @@ -129,6 +129,7 @@ variable {S : Profinite.{u}} {F : Profinite.{u}ᵒᵖ ⥤ Type (u + 1)} instance : Final <| Profinite.Extend.functorOp S.asLimitCone := Profinite.Extend.functorOp_final S.asLimitCone S.asLimit +set_option backward.isDefEq.respectTransparency.types false in /-- A presheaf, which takes a profinite set written as a cofiltered limit to the corresponding colimit, agrees with the left Kan extension of its restriction. @@ -152,6 +153,7 @@ def lanPresheafNatIso (hF : ∀ S : Profinite, IsColimit <| F.mapCocone S.asLimi NatIso.ofComponents (fun ⟨S⟩ ↦ (lanPresheafIso (hF S))) fun _ ↦ (by simpa using colimit.hom_ext fun _ ↦ (by simp)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lanPresheafNatIso_hom_app (hF : ∀ S : Profinite, IsColimit <| F.mapCocone S.asLimitCone.op) (S : Profiniteᵒᵖ) : (lanPresheafNatIso hF).hom.app S = @@ -246,6 +248,7 @@ lemma isoFinYonedaComponents_inv_comp {X Y : Profinite.{u}} [Finite X] [Finite Y attribute [local simp] toProfinite_obj +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The restriction of a finite-product-preserving presheaf `F` on `Profinite` to the category of @@ -346,9 +349,10 @@ noncomputable def isColimitLocallyConstantPresheaf (hc : IsLimit c) [∀ i, Epi change fi ((c.π.app k ≫ (F ⋙ toLightProfinite).map _) x) = fj ((c.π.app k ≫ (F ⋙ toLightProfinite).map _) x) have h := LocallyConstant.congr_fun h x - dsimp + dsimp [- CompHausLike.coe_comp] rwa [dsimp% c.w, dsimp% c.w] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma isColimitLocallyConstantPresheaf_desc_apply (hc : IsLimit c) [∀ i, Epi (c.π.app i)] (s : Cocone ((F ⋙ toLightProfinite).op ⋙ locallyConstantPresheaf X)) @@ -358,7 +362,6 @@ lemma isColimitLocallyConstantPresheaf_desc_apply (hc : IsLimit c) [∀ i, Epi ( change ((((locallyConstantPresheaf X).mapCocone c.op).ι.app ⟨n⟩) ≫ (isColimitLocallyConstantPresheaf c X hc).desc s) _ = _ rw [(isColimitLocallyConstantPresheaf c X hc).fac] - rfl /-- `isColimitLocallyConstantPresheaf` in the case of `S.asLimit`. -/ noncomputable def isColimitLocallyConstantPresheafDiagram (S : LightProfinite) : @@ -366,6 +369,7 @@ noncomputable def isColimitLocallyConstantPresheafDiagram (S : LightProfinite) : (Functor.Final.isColimitWhiskerEquiv (opOpEquivalence ℕ).inverse _).symm (isColimitLocallyConstantPresheaf _ _ S.asLimit) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma isColimitLocallyConstantPresheafDiagram_desc_apply (S : LightProfinite) (s : Cocone (S.diagram.rightOp ⋙ locallyConstantPresheaf X)) @@ -375,7 +379,6 @@ lemma isColimitLocallyConstantPresheafDiagram_desc_apply (S : LightProfinite) change ((((locallyConstantPresheaf X).mapCocone (coconeRightOpOfCone S.asLimitCone)).ι.app n) ≫ (isColimitLocallyConstantPresheafDiagram X S).desc s) _ = _ rw [(isColimitLocallyConstantPresheafDiagram X S).fac] - rfl end LocallyConstantAsColimit @@ -424,6 +427,7 @@ variable {S : LightProfinite.{u}} {F : LightProfinite.{u}ᵒᵖ ⥤ Type u} instance : Final <| LightProfinite.Extend.functorOp S.asLimitCone := LightProfinite.Extend.functorOp_final S.asLimitCone S.asLimit +set_option backward.isDefEq.respectTransparency.types false in /-- A presheaf, which takes a light profinite set written as a sequential limit to the corresponding colimit, agrees with the left Kan extension of its restriction. @@ -451,6 +455,7 @@ def lanPresheafNatIso lanPresheafIso_hom, Opposite.op_unop] exact colimit.hom_ext fun _ ↦ (by simp) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma lanPresheafNatIso_hom_app (hF : ∀ S : LightProfinite, IsColimit <| F.mapCocone (coconeRightOpOfCone S.asLimitCone)) @@ -536,6 +541,7 @@ lemma isoFinYonedaComponents_inv_comp {X Y : LightProfinite.{u}} [Finite X] [Fin attribute [local simp] toLightProfinite_obj +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The restriction of a finite-product-preserving presheaf `F` on `Profinite` to the category of diff --git a/Mathlib/Condensed/Discrete/LocallyConstant.lean b/Mathlib/Condensed/Discrete/LocallyConstant.lean index aeadb3ecb9f5d6..f0e3f0aae3b228 100644 --- a/Mathlib/Condensed/Discrete/LocallyConstant.lean +++ b/Mathlib/Condensed/Discrete/LocallyConstant.lean @@ -201,6 +201,7 @@ lemma incl_comap {S T : (CompHausLike P)ᵒᵖ} (sigmaIncl f _).op ≫ (componentHom f g.unop a).op := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The counit is natural in `S : CompHausLike P` -/ @[simps! app] @@ -311,6 +312,7 @@ noncomputable def unitIso : 𝟭 (Type (max u w)) ≅ functor.{u, w} P hs ⋙ hom := unit P hs inv := { app _ := ↾fun f ↦ f.toFun PUnit.unit } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma adjunction_left_triangle [HasExplicitFiniteCoproducts.{u} P] (X : Type (max u w)) : functorToPresheaves.{u, w}.map ((unit P hs).app X) ≫ @@ -334,6 +336,7 @@ lemma adjunction_left_triangle [HasExplicitFiniteCoproducts.{u} P] erw [← map_eq_image _ a x] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `CompHausLike.LocallyConstant.functor` is left adjoint to the forgetful functor. -/ diff --git a/Mathlib/Condensed/Light/Epi.lean b/Mathlib/Condensed/Light/Epi.lean index a6bd9883808a2f..d107ab6e9d6635 100644 --- a/Mathlib/Condensed/Light/Epi.lean +++ b/Mathlib/Condensed/Light/Epi.lean @@ -34,6 +34,11 @@ variable [∀ X Y, FunLike (FA X Y) (CA X) (CA Y)] [ConcreteCategory.{w} A FA] variable {X Y : LightCondensed.{u} A} (f : X ⟶ Y) +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + InducedCategory + ObjectProperty.FullSubcategory.category._aux_1 + lemma isLocallySurjective_iff_locallySurjective_on_lightProfinite : IsLocallySurjective f ↔ ∀ (S : LightProfinite) (y : ToType (Y.obj.obj ⟨S⟩)), (∃ (S' : LightProfinite) (φ : S' ⟶ S) (_ : Function.Surjective φ) diff --git a/Mathlib/Condensed/Light/Functors.lean b/Mathlib/Condensed/Light/Functors.lean index 89af9f8e80c9ab..33e8b2d440f636 100644 --- a/Mathlib/Condensed/Light/Functors.lean +++ b/Mathlib/Condensed/Light/Functors.lean @@ -48,6 +48,7 @@ instance : lightProfiniteToLightCondSet.Full := instance : lightProfiniteToLightCondSet.Faithful := inferInstanceAs ((coherentTopology LightProfinite).yoneda).Faithful +set_option backward.isDefEq.respectTransparency.types false in /-- The functor from `LightProfinite` to `LightCondSet` factors through `TopCat`. -/ diff --git a/Mathlib/Condensed/Light/Small.lean b/Mathlib/Condensed/Light/Small.lean index d76fa6a788764a..bcb82788ab4460 100644 --- a/Mathlib/Condensed/Light/Small.lean +++ b/Mathlib/Condensed/Light/Small.lean @@ -39,6 +39,7 @@ instance (X Y : LightCondensed.{u} C) : Small.{max u v} (X ⟶ Y) where ⟨(equivSmall C).functor.obj X ⟶ (equivSmall C).functor.obj Y, ⟨(equivSmall C).fullyFaithfulFunctor.homEquiv⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Sheafifying is preserved under conjugating with the equivalence between light condensed objects diff --git a/Mathlib/Condensed/Light/TopCatAdjunction.lean b/Mathlib/Condensed/Light/TopCatAdjunction.lean index af443af3c6f7c4..729cc4bed72ad9 100644 --- a/Mathlib/Condensed/Light/TopCatAdjunction.lean +++ b/Mathlib/Condensed/Light/TopCatAdjunction.lean @@ -81,6 +81,7 @@ def _root_.lightCondSetToTopCat : LightCondSet.{u} ⥤ TopCat.{u} where obj X := X.toTopCat map f := toTopCatMap f +set_option backward.isDefEq.respectTransparency.types false in /-- The counit of the adjunction `lightCondSetToTopCat ⊣ topCatToLightCondSet` -/ noncomputable def topCatAdjunctionCounit (X : TopCat.{u}) : X.toLightCondSet.toTopCat ⟶ X := TopCat.ofHom @@ -89,6 +90,7 @@ noncomputable def topCatAdjunctionCounit (X : TopCat.{u}) : X.toLightCondSet.toT rw [continuous_coinduced_dom] continuity } +set_option backward.isDefEq.respectTransparency.types false in /-- The counit of the adjunction `lightCondSetToTopCat ⊣ topCatToLightCondSet` is always bijective, but not an isomorphism in general (the inverse isn't continuous unless `X` is sequential). -/ @@ -100,6 +102,7 @@ lemma topCatAdjunctionCounit_bijective (X : TopCat.{u}) : Function.Bijective (topCatAdjunctionCounit X) := (topCatAdjunctionCounitEquiv X).bijective +set_option backward.isDefEq.respectTransparency.types false in /-- The unit of the adjunction `lightCondSetToTopCat ⊣ topCatToLightCondSet` -/ @[simps hom_app] noncomputable def topCatAdjunctionUnit (X : LightCondSet.{u}) : X ⟶ X.toTopCat.toLightCondSet where @@ -129,6 +132,7 @@ noncomputable def topCatAdjunction : lightCondSetToTopCat.{u} ⊣ topCatToLightC change Y.obj.map (𝟙 _) _ = _ simp +set_option backward.isDefEq.respectTransparency.types false in instance (X : TopCat) : Epi (topCatAdjunction.counit.app X) := by rw [TopCat.epi_iff_surjective] exact (topCatAdjunctionCounit_bijective _).2 diff --git a/Mathlib/Condensed/TopCatAdjunction.lean b/Mathlib/Condensed/TopCatAdjunction.lean index bff73e2c99cbb5..e5935ba3873401 100644 --- a/Mathlib/Condensed/TopCatAdjunction.lean +++ b/Mathlib/Condensed/TopCatAdjunction.lean @@ -82,6 +82,7 @@ def condensedSetToTopCat : CondensedSet.{u} ⥤ TopCat.{u + 1} where namespace CondensedSet +set_option backward.isDefEq.respectTransparency.types false in /-- The counit of the adjunction `condensedSetToTopCat ⊣ topCatToCondensedSet` -/ noncomputable def topCatAdjunctionCounit (X : TopCat.{u + 1}) : X.toCondensedSet.toTopCat ⟶ X := TopCat.ofHom @@ -90,6 +91,7 @@ noncomputable def topCatAdjunctionCounit (X : TopCat.{u + 1}) : X.toCondensedSet rw [continuous_coinduced_dom] continuity } +set_option backward.isDefEq.respectTransparency.types false in /-- `simp`-normal form of the lemma that `@[simps]` would generate. -/ @[simp] lemma topCatAdjunctionCounit_hom_apply (X : TopCat) (x) : -- We have to specify here to not infer the `TopologicalSpace` instance on `C(PUnit, X)`, @@ -98,6 +100,7 @@ noncomputable def topCatAdjunctionCounit (X : TopCat.{u + 1}) : X.toCondensedSet (TopCat.Hom.hom (topCatAdjunctionCounit X)) x = x PUnit.unit := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The counit of the adjunction `condensedSetToTopCat ⊣ topCatToCondensedSet` is always bijective, but not an isomorphism in general (the inverse isn't continuous unless `X` is compactly generated). -/ @@ -110,6 +113,7 @@ lemma topCatAdjunctionCounit_bijective (X : TopCat.{u + 1}) : Function.Bijective (topCatAdjunctionCounit X) := (topCatAdjunctionCounitEquiv X).bijective +set_option backward.isDefEq.respectTransparency.types false in /-- The unit of the adjunction `condensedSetToTopCat ⊣ topCatToCondensedSet` -/ @[simps hom_app] noncomputable def topCatAdjunctionUnit (X : CondensedSet.{u}) : X ⟶ X.toTopCat.toCondensedSet where @@ -139,6 +143,7 @@ noncomputable def topCatAdjunction : condensedSetToTopCat.{u} ⊣ topCatToConden change Y.obj.map (𝟙 _) _ = _ simp +set_option backward.isDefEq.respectTransparency.types false in instance (X : TopCat) : Epi (topCatAdjunction.counit.app X) := by rw [TopCat.epi_iff_surjective] exact (topCatAdjunctionCounit_bijective _).2 diff --git a/Mathlib/Control/Applicative.lean b/Mathlib/Control/Applicative.lean index e2441e2eeb7c3d..344c7abf37345a 100644 --- a/Mathlib/Control/Applicative.lean +++ b/Mathlib/Control/Applicative.lean @@ -120,6 +120,7 @@ theorem applicative_comp_id {F} [AF : Applicative F] [LawfulApplicative F] : open CommApplicative +set_option backward.isDefEq.respectTransparency false in instance {f : Type u → Type w} {g : Type v → Type u} [Applicative f] [Applicative g] [CommApplicative f] [CommApplicative g] : CommApplicative (Comp f g) where commutative_prod _ _ := by @@ -152,6 +153,7 @@ instance {α} [One α] [Mul α] : Applicative (Const α) where -- Porting note: `(· <*> ·)` needed to change to `Seq.seq` in the `simp`. -- Also, `simp` didn't close `refl` goals. +set_option backward.isDefEq.respectTransparency false in instance {α} [Monoid α] : LawfulApplicative (Const α) where map_pure _ _ := rfl seq_pure _ _ := by simp [Const.map, map, Seq.seq, pure, mul_one] @@ -164,6 +166,7 @@ instance {α} [Zero α] [Add α] : Applicative (AddConst α) where pure _ := (0 : α) seq f x := (show α from f) + (show α from x Unit.unit) +set_option backward.isDefEq.respectTransparency false in instance {α} [AddMonoid α] : LawfulApplicative (AddConst α) where map_pure _ _ := rfl seq_pure _ _ := by simp [Const.map, map, Seq.seq, pure, add_zero] diff --git a/Mathlib/Control/Bifunctor.lean b/Mathlib/Control/Bifunctor.lean index 3082728a59b19c..b23610b989ced6 100644 --- a/Mathlib/Control/Bifunctor.lean +++ b/Mathlib/Control/Bifunctor.lean @@ -114,6 +114,7 @@ instance LawfulBifunctor.const : LawfulBifunctor Const where instance Bifunctor.flip : Bifunctor (flip F) where bimap {_α α' _β β'} f f' x := (bimap f' f x : F β' α') +set_option backward.isDefEq.respectTransparency false in instance LawfulBifunctor.flip [LawfulBifunctor F] : LawfulBifunctor (flip F) where id_bimap := by simp [bimap, functor_norm] bimap_bimap := by simp [bimap, functor_norm] @@ -141,6 +142,7 @@ variable (G : Type* → Type u₀) (H : Type* → Type u₁) [Functor G] [Functo instance Function.bicompl.bifunctor : Bifunctor (bicompl F G H) where bimap {_α α' _β β'} f f' x := (bimap (map f) (map f') x : F (G α') (H β')) +set_option backward.isDefEq.respectTransparency false in instance Function.bicompl.lawfulBifunctor [LawfulFunctor G] [LawfulFunctor H] [LawfulBifunctor F] : LawfulBifunctor (bicompl F G H) := by constructor <;> intros <;> simp [bimap, map_id, map_comp_map, functor_norm] @@ -154,6 +156,7 @@ variable (G : Type u₂ → Type*) [Functor G] instance Function.bicompr.bifunctor : Bifunctor (bicompr G F) where bimap {_α α' _β β'} f f' x := (map (bimap f f') x : G (F α' β')) +set_option backward.isDefEq.respectTransparency false in instance Function.bicompr.lawfulBifunctor [LawfulFunctor G] [LawfulBifunctor F] : LawfulBifunctor (bicompr G F) := by constructor <;> intros <;> simp [bimap, functor_norm] diff --git a/Mathlib/Control/EquivFunctor.lean b/Mathlib/Control/EquivFunctor.lean index 2f8a214334db27..0700a48ebb99db 100644 --- a/Mathlib/Control/EquivFunctor.lean +++ b/Mathlib/Control/EquivFunctor.lean @@ -72,6 +72,7 @@ theorem mapEquiv_refl (α) : mapEquiv f (Equiv.refl α) = Equiv.refl (f α) := b theorem mapEquiv_symm : (mapEquiv f e).symm = mapEquiv f e.symm := Equiv.ext <| mapEquiv_symm_apply f e +set_option backward.isDefEq.respectTransparency false in /-- The composition of `mapEquiv`s is carried over the `EquivFunctor`. For plain `Functor`s, this lemma is named `map_map` when applied or `map_comp_map` when not applied. diff --git a/Mathlib/Control/Fold.lean b/Mathlib/Control/Fold.lean index 13a306db3fc76f..8bdf8e17fddb73 100644 --- a/Mathlib/Control/Fold.lean +++ b/Mathlib/Control/Fold.lean @@ -234,6 +234,7 @@ variable {α β γ : Type u} open Function hiding const +set_option backward.isDefEq.respectTransparency.types false in def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β) where app _ := f preserves_seq' := by intros; simp only [Seq.seq, map_mul] @@ -286,6 +287,7 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) : Foldr.ofFreeMonoid f ∘ FreeMonoid.of = Foldr.mk ∘ f := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) : foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by @@ -295,6 +297,7 @@ theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β foldlM.mk, op_inj] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) : foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by @@ -317,6 +320,7 @@ theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMon simp only [toList, foldl, Foldl.get, foldl.ofFreeMonoid_comp_of, Function.comp_apply] +set_option backward.isDefEq.respectTransparency.types false in theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) : foldMap g (f <$> xs) = foldMap (g ∘ f) xs := by simp only [foldMap, traverse_map, Function.comp_def] diff --git a/Mathlib/Control/Functor.lean b/Mathlib/Control/Functor.lean index f428d9e905aa0c..59d944a66186ec 100644 --- a/Mathlib/Control/Functor.lean +++ b/Mathlib/Control/Functor.lean @@ -173,9 +173,11 @@ protected theorem run_map {α β} (h : α → β) (x : Comp F G α) : variable [LawfulFunctor F] [LawfulFunctor G] variable {α β γ : Type v} +set_option backward.isDefEq.respectTransparency false in protected theorem id_map : ∀ x : Comp F G α, Comp.map id x = x | Comp.mk x => by simp only [Comp.map, id_map, id_map']; rfl +set_option backward.isDefEq.respectTransparency false in protected theorem comp_map (g' : α → β) (h : β → γ) : ∀ x : Comp F G α, Comp.map (h ∘ g') x = Comp.map h (Comp.map g' x) | Comp.mk x => by simp [Comp.map, Comp.mk, functor_norm, Function.comp_def] diff --git a/Mathlib/Control/Functor/Multivariate.lean b/Mathlib/Control/Functor/Multivariate.lean index 493f39fa6c8857..e0cf9fa0535114 100644 --- a/Mathlib/Control/Functor/Multivariate.lean +++ b/Mathlib/Control/Functor/Multivariate.lean @@ -121,9 +121,11 @@ theorem exists_iff_exists_of_mono {P : F α → Prop} {q : F β → Prop} rw [h₁] simp only [MvFunctor.map_map, h₀, LawfulMvFunctor.id_map, h₂] +set_option backward.isDefEq.respectTransparency false in theorem LiftP_def (x : F α) : LiftP' P x ↔ ∃ u : F (Subtype_ P), subtypeVal P <$$> u = x := exists_iff_exists_of_mono F _ _ (toSubtype_of_subtype P) (by simp [MvFunctor.map_map]) +set_option backward.isDefEq.respectTransparency false in theorem LiftR_def (x y : F α) : LiftR' R x y ↔ ∃ u : F (Subtype_ R), @@ -154,6 +156,7 @@ private def f : ⟨x.val, cast (by grind [PredLast]) x.property⟩ | _, _, Fin2.fz, x => ⟨x.val, x.property⟩ +set_option backward.isDefEq.respectTransparency false in private def g : ∀ n α, (fun i : Fin2 (n + 1) => { p_1 : (α ::: β) i // PredLast α pp p_1 }) ⟹ fun i : Fin2 (n + 1) => @@ -162,6 +165,7 @@ private def g : ⟨x.val, cast (by simp only [PredLast]; erw [const_iff_true]) x.property⟩ | _, _, Fin2.fz, x => ⟨x.val, x.property⟩ +set_option backward.isDefEq.respectTransparency false in theorem LiftP_PredLast_iff {β} (P : β → Prop) (x : F (α ::: β)) : LiftP' (PredLast' _ P) x ↔ LiftP (PredLast _ P) x := by dsimp only [LiftP, LiftP'] @@ -197,6 +201,7 @@ private def g' : ⟨x.val, cast (by simp only [RelLast]; erw [repeatEq_iff_eq]) x.property⟩ | _, _, Fin2.fz, x => ⟨x.val, x.property⟩ +set_option backward.isDefEq.respectTransparency false in theorem LiftR_RelLast_iff (x y : F (α ::: β)) : LiftR' (RelLast' _ rr) x y ↔ LiftR (RelLast _ rr) x y := by dsimp only [LiftR, LiftR'] @@ -211,7 +216,7 @@ theorem LiftR_RelLast_iff (x y : F (α ::: β)) : end LiftPLastPredIff /-- Any type function that is (extensionally) equivalent to a functor, is itself a functor -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv {F F' : TypeVec.{u} n → Type*} [MvFunctor F'] (eqv : ∀ α, F α ≃ F' α) : MvFunctor F where map f x := (eqv _).symm <| f <$$> eqv _ x diff --git a/Mathlib/Control/Monad/Writer.lean b/Mathlib/Control/Monad/Writer.lean index bf1fa7e748b7b7..8a879a7109098a 100644 --- a/Mathlib/Control/Monad/Writer.lean +++ b/Mathlib/Control/Monad/Writer.lean @@ -110,7 +110,7 @@ theorem run_bind (empty : ω) (append : ω → ω → ω) rfl /-- Lift an `M` to a `WriterT ω M`, using the given `empty` as the monoid unit. -/ -@[inline, implicit_reducible] +@[inline, instance_reducible] protected def liftTell (empty : ω) : MonadLift M (WriterT ω M) where monadLift := fun cmd ↦ WriterT.mk <| (fun a ↦ (a, empty)) <$> cmd diff --git a/Mathlib/Control/Traversable/Equiv.lean b/Mathlib/Control/Traversable/Equiv.lean index bd4e588afce6ab..1f6550e5e8f7a7 100644 --- a/Mathlib/Control/Traversable/Equiv.lean +++ b/Mathlib/Control/Traversable/Equiv.lean @@ -50,7 +50,7 @@ protected def map {α β : Type u} (f : α → β) (x : t' α) : t' β := /-- The function `Equiv.map` transfers the functoriality of `t` to `t'` using the equivalences `eqv`. -/ -@[implicit_reducible] +@[instance_reducible] protected def functor : Functor t' where map := Equiv.map eqv variable [LawfulFunctor t] @@ -103,7 +103,7 @@ theorem traverse_def (f : α → m β) (x : t' α) : /-- The function `Equiv.traverse` transfers a traversable functor instance across the equivalences `eqv`. -/ -@[implicit_reducible] +@[instance_reducible] protected def traversable : Traversable t' where toFunctor := Equiv.functor eqv traverse := Equiv.traverse eqv diff --git a/Mathlib/Control/ULiftable.lean b/Mathlib/Control/ULiftable.lean index 95571f205712d2..c08919f44a86fd 100644 --- a/Mathlib/Control/ULiftable.lean +++ b/Mathlib/Control/ULiftable.lean @@ -121,7 +121,7 @@ instance instULiftableId : ULiftable Id Id where congr F := F /-- for specific state types, this function helps to create a uliftable instance -/ -@[implicit_reducible] +@[instance_reducible] def StateT.uliftable' {m : Type u₀ → Type v₀} {m' : Type u₁ → Type v₁} [ULiftable m m'] (F : s ≃ s') : ULiftable (StateT s m) (StateT s' m') where congr G := @@ -135,7 +135,7 @@ instance StateT.instULiftableULiftULift {m m'} [ULiftable m m'] : StateT.uliftable' <| Equiv.ulift.trans Equiv.ulift.symm /-- for specific reader monads, this function helps to create a uliftable instance -/ -@[implicit_reducible] +@[instance_reducible] def ReaderT.uliftable' {m m'} [ULiftable m m'] (F : s ≃ s') : ULiftable (ReaderT s m) (ReaderT s' m') where congr G := ReaderT.equiv <| Equiv.piCongr F fun _ => ULiftable.congr G @@ -148,7 +148,7 @@ instance ReaderT.instULiftableULiftULift {m m'} [ULiftable m m'] : ReaderT.uliftable' <| Equiv.ulift.trans Equiv.ulift.symm /-- for specific continuation passing monads, this function helps to create a uliftable instance -/ -@[implicit_reducible] +@[instance_reducible] def ContT.uliftable' {m m'} [ULiftable m m'] (F : r ≃ r') : ULiftable (ContT r m) (ContT r' m') where congr := ContT.equiv (ULiftable.congr F) @@ -161,7 +161,7 @@ instance ContT.instULiftableULiftULift {m m'} [ULiftable m m'] : ContT.uliftable' <| Equiv.ulift.trans Equiv.ulift.symm /-- for specific writer monads, this function helps to create a uliftable instance -/ -@[implicit_reducible] +@[instance_reducible] def WriterT.uliftable' {m m'} [ULiftable m m'] (F : w ≃ w') : ULiftable (WriterT w m) (WriterT w' m') where congr G := WriterT.equiv <| ULiftable.congr <| Equiv.prodCongr G F diff --git a/Mathlib/Data/Analysis/Filter.lean b/Mathlib/Data/Analysis/Filter.lean index d8ccd2d4605e3c..8556317e26d07f 100644 --- a/Mathlib/Data/Analysis/Filter.lean +++ b/Mathlib/Data/Analysis/Filter.lean @@ -214,6 +214,7 @@ protected def comap (m : α → β) {f : Filter β} (F : f.Realizer) : (comap m exact ⟨fun ⟨s, h⟩ ↦ ⟨_, ⟨s, Subset.refl _⟩, h⟩, fun ⟨_, ⟨s, h⟩, h₂⟩ ↦ ⟨s, Subset.trans (preimage_mono h) h₂⟩⟩⟩ +set_option backward.isDefEq.respectTransparency false in /-- Construct a realizer for the sup of two filters -/ protected def sup {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f ⊔ g).Realizer := ⟨F.σ × G.σ, @@ -242,6 +243,7 @@ protected def inf {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f ⊓ g · rintro ⟨_, ⟨a, ha⟩, _, ⟨b, hb⟩, rfl⟩ exact ⟨a, b, inter_subset_inter ha hb⟩⟩ +set_option backward.isDefEq.respectTransparency false in /-- Construct a realizer for the cofinite filter -/ protected def cofinite [DecidableEq α] : (@cofinite α).Realizer := ⟨Finset α, diff --git a/Mathlib/Data/Analysis/Topology.lean b/Mathlib/Data/Analysis/Topology.lean index 8af8bb6e22b76f..a07f7cd146e4ee 100644 --- a/Mathlib/Data/Analysis/Topology.lean +++ b/Mathlib/Data/Analysis/Topology.lean @@ -80,7 +80,7 @@ theorem ofEquiv_val (E : σ ≃ τ) (F : Ctop α σ) (a : τ) : F.ofEquiv E a = end /-- Every `Ctop` is a topological space. -/ -@[implicit_reducible] +@[instance_reducible] def toTopsp (F : Ctop α σ) : TopologicalSpace α := TopologicalSpace.generateFrom (Set.range F.f) theorem toTopsp_isTopologicalBasis (F : Ctop α σ) : diff --git a/Mathlib/Data/Complex/Basic.lean b/Mathlib/Data/Complex/Basic.lean index 36982101ed7b6e..011ea32bf98872 100644 --- a/Mathlib/Data/Complex/Basic.lean +++ b/Mathlib/Data/Complex/Basic.lean @@ -77,7 +77,7 @@ theorem range_im : range im = univ := im_surjective.range_eq /-- The natural inclusion of the real numbers into the complex numbers. -/ -@[coe, implicit_reducible] +@[coe, instance_reducible] def ofReal (r : ℝ) : ℂ := ⟨r, 0⟩ instance : Coe ℝ ℂ := @@ -270,6 +270,7 @@ theorem I_mul_re (z : ℂ) : (I * z).re = -z.im := by simp theorem I_mul_im (z : ℂ) : (I * z).im = z.re := by simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem equivRealProd_symm_apply (p : ℝ × ℝ) : equivRealProd.symm p = p.1 + p.2 * I := by ext <;> simp [Complex.equivRealProd, ofReal] @@ -574,7 +575,7 @@ theorem add_conj (z : ℂ) : z + conj z = (2 * z.re : ℝ) := Complex.ext_iff.2 <| by simp [two_mul, ofReal] /-- The coercion `ℝ → ℂ` as a `RingHom`. -/ -@[implicit_reducible] +@[instance_reducible] def ofRealHom : ℝ →+* ℂ where toFun x := (x : ℂ) map_one' := ofReal_one diff --git a/Mathlib/Data/DFinsupp/BigOperators.lean b/Mathlib/Data/DFinsupp/BigOperators.lean index a155007e0af723..1f1853eb1d50fe 100644 --- a/Mathlib/Data/DFinsupp/BigOperators.lean +++ b/Mathlib/Data/DFinsupp/BigOperators.lean @@ -285,6 +285,7 @@ theorem sumZeroHom_single [∀ i, Zero (β i)] [AddCommMonoid γ] (φ : ∀ i, Z dsimp [sumZeroHom, single, Trunc.lift_mk] rw [Multiset.toFinset_singleton, Finset.sum_singleton, Pi.single_eq_same] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem sumZeroHom_piSingle [∀ i, Zero (β i)] [AddCommMonoid γ] (i) (φ : ZeroHom (β i) γ) : sumZeroHom (Pi.single i φ) = φ.comp { toFun := (· i), map_zero' := rfl } := by @@ -308,6 +309,7 @@ theorem sumZeroHom_apply [∀ i, AddZeroClass (β i)] [∀ (i) (x : β i), Decid · rfl · rw [not_not.mp h, map_zero] +set_option backward.isDefEq.respectTransparency false in /-- When summing over an `AddMonoidHom`, the decidability assumption is not needed, and the result is also an `AddMonoidHom`. diff --git a/Mathlib/Data/DFinsupp/Defs.lean b/Mathlib/Data/DFinsupp/Defs.lean index 74c32fdb7b332e..ca11ab364e3ef6 100644 --- a/Mathlib/Data/DFinsupp/Defs.lean +++ b/Mathlib/Data/DFinsupp/Defs.lean @@ -926,6 +926,7 @@ theorem mapRange_injective (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = classical exact ⟨fun h i x y eq ↦ single_injective (@h (single i x) (single i y) <| by simpa using congr_arg _ eq), fun h _ _ eq ↦ DFinsupp.ext fun i ↦ h i congr($eq i)⟩ +set_option backward.isDefEq.respectTransparency false in omit [DecidableEq ι] in theorem mapRange_surjective (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0) : Function.Surjective (mapRange f hf) ↔ ∀ i, Function.Surjective (f i) := by @@ -1104,6 +1105,7 @@ theorem comapDomain'_single [DecidableEq ι] [DecidableEq κ] [∀ i, Zero (β i comapDomain' h hh' (single (h k) x) = single k x := by grind +set_option backward.isDefEq.respectTransparency false in /-- Reindexing terms of a dfinsupp. This is the dfinsupp version of `Equiv.piCongrLeft'`. -/ diff --git a/Mathlib/Data/DFinsupp/Lex.lean b/Mathlib/Data/DFinsupp/Lex.lean index a701e03d918e5a..68de823916445e 100644 --- a/Mathlib/Data/DFinsupp/Lex.lean +++ b/Mathlib/Data/DFinsupp/Lex.lean @@ -50,6 +50,7 @@ instance [LT ι] [∀ i, LT (α i)] : LT (Lex (Π₀ i, α i)) := instance [LT ι] [∀ i, LT (α i)] : LT (Colex (Π₀ i, α i)) := ⟨fun f g ↦ DFinsupp.Lex (· > ·) (fun _ ↦ (· < ·)) (ofColex f) (ofColex g)⟩ +set_option backward.isDefEq.respectTransparency false in theorem Lex.lt_iff [LT ι] [∀ i, LT (α i)] {a b : Lex (Π₀ i, α i)} : a < b ↔ ∃ i, (∀ j, j < i → a j = b j) ∧ a i < b i := .rfl @@ -57,6 +58,7 @@ theorem Lex.lt_iff [LT ι] [∀ i, LT (α i)] {a b : Lex (Π₀ i, α i)} : @[deprecated (since := "2025-11-29")] alias lex_lt_iff := Lex.lt_iff +set_option backward.isDefEq.respectTransparency false in theorem Colex.lt_iff [LT ι] [∀ i, LT (α i)] {a b : Colex (Π₀ i, α i)} : a < b ↔ ∃ i, (∀ j, i < j → a j = b j) ∧ a i < b i := .rfl @@ -79,6 +81,7 @@ theorem lex_iff_of_unique [Unique ι] [∀ i, LT (α i)] {r} [Std.Irrefl r] {x y DFinsupp.Lex r (fun _ ↦ (· < ·)) x y ↔ x default < y default := Pi.lex_iff_of_unique +set_option backward.isDefEq.respectTransparency false in theorem Lex.lt_iff_of_unique [Unique ι] [∀ i, LT (α i)] [Preorder ι] {x y : Lex (Π₀ i, α i)} : x < y ↔ x default < y default := lex_iff_of_unique @@ -86,6 +89,7 @@ theorem Lex.lt_iff_of_unique [Unique ι] [∀ i, LT (α i)] [Preorder ι] {x y : @[deprecated (since := "2025-11-29")] alias lex_lt_iff_of_unique := Lex.lt_iff_of_unique +set_option backward.isDefEq.respectTransparency false in theorem colex_lt_iff_of_unique [Unique ι] [∀ i, LT (α i)] [Preorder ι] {x y : Colex (Π₀ i, α i)} : x < y ↔ x default < y default := lex_iff_of_unique @@ -97,6 +101,7 @@ instance Lex.isStrictOrder [∀ i, PartialOrder (α i)] : irrefl _ := lt_irrefl (α := Lex (∀ i, α i)) _ trans _ _ _ := lt_trans (α := Lex (∀ i, α i)) +set_option backward.isDefEq.respectTransparency false in instance Colex.isStrictOrder [∀ i, PartialOrder (α i)] : IsStrictOrder (Colex (Π₀ i, α i)) (· < ·) := Lex.isStrictOrder (ι := ιᵒᵈ) @@ -115,6 +120,7 @@ instance Colex.partialOrder [∀ i, PartialOrder (α i)] : PartialOrder (Colex ( __ := PartialOrder.lift (fun x : Colex (Π₀ i, α i) ↦ toColex (⇑(ofColex x))) (DFunLike.coe_injective (F := DFinsupp α)) +set_option backward.isDefEq.respectTransparency false in theorem Lex.le_iff_of_unique [Unique ι] [∀ i, PartialOrder (α i)] {x y : Lex (Π₀ i, α i)} : x ≤ y ↔ x default ≤ y default := Pi.lex_le_iff_of_unique @@ -122,6 +128,7 @@ theorem Lex.le_iff_of_unique [Unique ι] [∀ i, PartialOrder (α i)] {x y : Lex @[deprecated (since := "2025-11-29")] alias lex_le_iff_of_unique := Lex.le_iff_of_unique +set_option backward.isDefEq.respectTransparency false in theorem Colex.le_iff_of_unique [Unique ι] [∀ i, PartialOrder (α i)] {x y : Colex (Π₀ i, α i)} : x ≤ y ↔ x default ≤ y default := Lex.le_iff_of_unique (ι := ιᵒᵈ) @@ -148,6 +155,7 @@ private def lt_trichotomy_rec {P : Lex (Π₀ i, α i) → Lex (Π₀ i, α i) instance Lex.total_le : @Std.Total (Lex (Π₀ i, α i)) (· ≤ ·) where total := lt_trichotomy_rec (fun h ↦ Or.inl h.le) (fun h ↦ Or.inl h.le) fun h ↦ Or.inr h.le +set_option backward.isDefEq.respectTransparency false in instance Colex.total_le : @Std.Total (Colex (Π₀ i, α i)) (· ≤ ·) := Lex.total_le (ι := ιᵒᵈ) @@ -159,6 +167,7 @@ instance Lex.decidableLE : DecidableLE (Lex (Π₀ i, α i)) := (fun h ↦ isTrue <| Or.inl <| congr_arg _ h) fun h ↦ isFalse fun h' ↦ lt_irrefl _ (h.trans_le h') +set_option backward.isDefEq.respectTransparency false in /-- The less-or-equal relation for the colexicographic ordering is decidable. -/ instance Colex.decidableLE : DecidableLE (Colex (Π₀ i, α i)) := Lex.decidableLE (ι := ιᵒᵈ) @@ -169,6 +178,7 @@ set_option backward.privateInPublic.warn false in instance Lex.decidableLT : DecidableLT (Lex (Π₀ i, α i)) := lt_trichotomy_rec (fun h ↦ isTrue h) (fun h ↦ isFalse h.not_lt) fun h ↦ isFalse h.asymm +set_option backward.isDefEq.respectTransparency false in /-- The less-than relation for the colexicographic ordering is decidable. -/ instance Colex.decidableLT : DecidableLT (Colex (Π₀ i, α i)) := Lex.decidableLT (ι := ιᵒᵈ) @@ -199,6 +209,7 @@ theorem toLex_monotone : Monotone (@toLex (Π₀ i, α i)) := by fun j hj ↦ notMem_neLocus.1 fun h ↦ (Finset.min'_le _ _ h).not_gt hj, (h _).lt_of_ne (mem_neLocus.1 <| Finset.min'_mem _ _)⟩ +set_option backward.isDefEq.respectTransparency false in theorem toColex_monotone : Monotone (@toColex (Π₀ i, α i)) := toLex_monotone (ι := ιᵒᵈ) @@ -221,6 +232,7 @@ set_option backward.defeqAttrib.useBackward true in instance Lex.addLeftStrictMono : AddLeftStrictMono (Lex (Π₀ i, α i)) := ⟨fun _ _ _ ⟨a, lta, ha⟩ ↦ ⟨a, fun j ja ↦ congr_arg _ (lta j ja), by dsimp; gcongr⟩⟩ +set_option backward.isDefEq.respectTransparency false in instance Colex.addLeftStrictMono : AddLeftStrictMono (Colex (Π₀ i, α i)) := Lex.addLeftStrictMono (ι := ιᵒᵈ) @@ -228,6 +240,7 @@ set_option backward.isDefEq.respectTransparency false in instance Lex.addLeftMono : AddLeftMono (Lex (Π₀ i, α i)) := addLeftMono_of_addLeftStrictMono _ +set_option backward.isDefEq.respectTransparency false in instance Colex.addLeftMono : AddLeftMono (Colex (Π₀ i, α i)) := Lex.addLeftMono (ι := ιᵒᵈ) @@ -242,6 +255,7 @@ instance Lex.addRightStrictMono : AddRightStrictMono (Lex (Π₀ i, α i)) := ⟨fun f _ _ ⟨a, lta, ha⟩ ↦ ⟨a, fun j ja ↦ congr_arg (· + ofLex f j) (lta j ja), by dsimp; gcongr⟩⟩ +set_option backward.isDefEq.respectTransparency false in instance Colex.addRightStrictMono : AddRightStrictMono (Colex (Π₀ i, α i)) := Lex.addRightStrictMono (ι := ιᵒᵈ) @@ -249,6 +263,7 @@ set_option backward.isDefEq.respectTransparency false in instance Lex.addRightMono : AddRightMono (Lex (Π₀ i, α i)) := addRightMono_of_addRightStrictMono _ +set_option backward.isDefEq.respectTransparency false in instance Colex.addRightMono : AddRightMono (Colex (Π₀ i, α i)) := Lex.addRightMono (ι := ιᵒᵈ) @@ -288,6 +303,7 @@ instance Lex.isOrderedCancelAddMonoid [∀ i, AddCommMonoid (α i)] [∀ i, Part add_le_add_left _ _ h _ := add_le_add_left (α := Lex (∀ i, α i)) h _ le_of_add_le_add_left _ _ _ := le_of_add_le_add_left (α := Lex (∀ i, α i)) +set_option backward.isDefEq.respectTransparency false in instance Colex.isOrderedCancelAddMonoid [∀ i, AddCommMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsOrderedCancelAddMonoid (α i)] : IsOrderedCancelAddMonoid (Colex (Π₀ i, α i)) := @@ -298,6 +314,7 @@ instance Lex.isOrderedAddMonoid [∀ i, AddCommGroup (α i)] [∀ i, PartialOrde IsOrderedAddMonoid (Lex (Π₀ i, α i)) where add_le_add_left _ _ := add_le_add_left +set_option backward.isDefEq.respectTransparency false in instance Colex.isOrderedAddMonoid [∀ i, AddCommGroup (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsOrderedAddMonoid (α i)] : IsOrderedAddMonoid (Colex (Π₀ i, α i)) := diff --git a/Mathlib/Data/DFinsupp/Multiset.lean b/Mathlib/Data/DFinsupp/Multiset.lean index 311952cbde2959..d63838359e132c 100644 --- a/Mathlib/Data/DFinsupp/Multiset.lean +++ b/Mathlib/Data/DFinsupp/Multiset.lean @@ -60,6 +60,7 @@ theorem toDFinsupp_apply (s : Multiset α) (a : α) : Multiset.toDFinsupp s a = theorem toDFinsupp_support (s : Multiset α) : s.toDFinsupp.support = s.toFinset := Finset.filter_true_of_mem fun _ hx ↦ count_ne_zero.mpr <| Multiset.mem_toFinset.1 hx +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toDFinsupp_replicate (a : α) (n : ℕ) : toDFinsupp (Multiset.replicate n a) = DFinsupp.single a n := by diff --git a/Mathlib/Data/DFinsupp/WellFounded.lean b/Mathlib/Data/DFinsupp/WellFounded.lean index 9826cab5551827..3e42cfca399ffd 100644 --- a/Mathlib/Data/DFinsupp/WellFounded.lean +++ b/Mathlib/Data/DFinsupp/WellFounded.lean @@ -60,6 +60,7 @@ section Zero variable [∀ i, Zero (α i)] (r : ι → ι → Prop) (s : ∀ i, α i → α i → Prop) +set_option backward.isDefEq.respectTransparency false in /-- This key lemma says that if a finitely supported dependent function `x₀` is obtained by merging two such functions `x₁` and `x₂`, and if we evolve `x₀` down the `DFinsupp.Lex` relation one step and get `x`, we can always evolve one of `x₁` and `x₂` down the `DFinsupp.Lex` relation @@ -173,6 +174,7 @@ instance Lex.wellFoundedLT [LT ι] [@Std.Trichotomous ι (· < ·)] [hι : WellF WellFoundedLT (Lex (Π₀ i, α i)) := ⟨Lex.wellFounded' (fun _ _ => not_lt_zero) (fun i => (hα i).wf) hι.wf⟩ +set_option backward.isDefEq.respectTransparency false in instance Colex.wellFoundedLT [LT ι] [@Std.Trichotomous ι (· < ·)] [WellFoundedLT ι] [∀ i, AddMonoid (α i)] [∀ i, PartialOrder (α i)] [∀ i, IsBotZeroClass (α i)] [∀ i, WellFoundedLT (α i)] : @@ -198,6 +200,7 @@ instance Pi.Lex.wellFoundedLT [LinearOrder ι] [Finite ι] [∀ i, LT (α i)] [hwf : ∀ i, WellFoundedLT (α i)] : WellFoundedLT (Lex (∀ i, α i)) := ⟨Pi.Lex.wellFounded (· < ·) fun i => (hwf i).1⟩ +set_option backward.isDefEq.respectTransparency false in instance Pi.Colex.wellFoundedLT [LinearOrder ι] [Finite ι] [∀ i, LT (α i)] [∀ i, WellFoundedLT (α i)] : WellFoundedLT (Colex (∀ i, α i)) := Pi.Lex.wellFoundedLT (ι := ιᵒᵈ) @@ -215,6 +218,7 @@ instance DFinsupp.Lex.wellFoundedLT_of_finite [LinearOrder ι] [Finite ι] [∀ [∀ i, LT (α i)] [hwf : ∀ i, WellFoundedLT (α i)] : WellFoundedLT (Lex (Π₀ i, α i)) := ⟨DFinsupp.Lex.wellFounded_of_finite (· < ·) fun i => (hwf i).1⟩ +set_option backward.isDefEq.respectTransparency false in instance DFinsupp.Colex.wellFoundedLT_of_finite [LinearOrder ι] [Finite ι] [∀ i, Zero (α i)] [∀ i, LT (α i)] [hwf : ∀ i, WellFoundedLT (α i)] : WellFoundedLT (Colex (Π₀ i, α i)) := DFinsupp.Lex.wellFoundedLT_of_finite (ι := ιᵒᵈ) diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index d6ba39d13c1c4c..d1f0d178c6777f 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -57,6 +57,7 @@ noncomputable instance {M : Type*} [AddMonoid M] [DistribMulAction ℝ≥0∞ M] noncomputable instance {M : Type*} [AddCommMonoid M] [Module ℝ≥0∞ M] : Module ℝ≥0 M := fast_instance% Module.compHom M ofNNRealHom +set_option backward.isDefEq.respectTransparency false in /-- An `Algebra` over `ℝ≥0∞` restricts to an `Algebra` over `ℝ≥0`. -/ noncomputable instance {A : Type*} [Semiring A] [Algebra ℝ≥0∞ A] : Algebra ℝ≥0 A where commutes' r x := by simp [Algebra.commutes] diff --git a/Mathlib/Data/ENNReal/Inv.lean b/Mathlib/Data/ENNReal/Inv.lean index 5793d3e229d2bb..972e97e91e6a0c 100644 --- a/Mathlib/Data/ENNReal/Inv.lean +++ b/Mathlib/Data/ENNReal/Inv.lean @@ -599,6 +599,7 @@ lemma le_mul_of_forall_lt {a b c : ℝ≥0∞} (h₁ : a ≠ 0 ∨ b ≠ ∞) (h (h _ (ENNReal.lt_inv_iff_lt_inv.1 ha') _ (ENNReal.lt_inv_iff_lt_inv.1 hb')).trans_eq (ENNReal.mul_inv (Or.inr hb'.ne_top) (Or.inl ha'.ne_top)).symm +set_option backward.isDefEq.respectTransparency false in /-- The birational order isomorphism between `ℝ≥0∞` and the unit interval `Set.Iic (1 : ℝ≥0∞)`. -/ @[simps! apply_coe] def orderIsoIicOneBirational : ℝ≥0∞ ≃o Iic (1 : ℝ≥0∞) := by @@ -614,6 +615,7 @@ theorem orderIsoIicOneBirational_symm_apply (x : Iic (1 : ℝ≥0∞)) : orderIsoIicOneBirational.symm x = (x.1⁻¹ - 1)⁻¹ := rfl +set_option backward.isDefEq.respectTransparency false in /-- Order isomorphism between an initial interval in `ℝ≥0∞` and an initial interval in `ℝ≥0`. -/ @[simps! apply_coe] def orderIsoIicCoe (a : ℝ≥0) : Iic (a : ℝ≥0∞) ≃o Iic a := diff --git a/Mathlib/Data/ENNReal/Operations.lean b/Mathlib/Data/ENNReal/Operations.lean index 6b159c27b59719..b3fb23059c6c88 100644 --- a/Mathlib/Data/ENNReal/Operations.lean +++ b/Mathlib/Data/ENNReal/Operations.lean @@ -518,6 +518,7 @@ theorem toNNReal_sInf (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) : theorem toReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toReal = ⨅ i, (f i).toReal := by simp only [ENNReal.toReal, toNNReal_iInf hf, NNReal.coe_iInf] +set_option backward.isDefEq.respectTransparency false in theorem toReal_sInf (s : Set ℝ≥0∞) (hf : ∀ r ∈ s, r ≠ ∞) : (sInf s).toReal = sInf (ENNReal.toReal '' s) := by simp only [ENNReal.toReal, toNNReal_sInf s hf, NNReal.coe_sInf, Set.image_image] @@ -617,6 +618,7 @@ theorem toNNReal_sSup (s : Set ℝ≥0∞) (hs : ∀ r ∈ s, r ≠ ∞) : theorem toReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toReal = ⨆ i, (f i).toReal := by simp only [ENNReal.toReal, toNNReal_iSup hf, NNReal.coe_iSup] +set_option backward.isDefEq.respectTransparency false in theorem toReal_sSup (s : Set ℝ≥0∞) (hf : ∀ r ∈ s, r ≠ ∞) : (sSup s).toReal = sSup (ENNReal.toReal '' s) := by simp only [ENNReal.toReal, toNNReal_sSup s hf, NNReal.coe_sSup, Set.image_image] diff --git a/Mathlib/Data/EReal/Inv.lean b/Mathlib/Data/EReal/Inv.lean index 26d1a3cc43c590..004aad658eeb31 100644 --- a/Mathlib/Data/EReal/Inv.lean +++ b/Mathlib/Data/EReal/Inv.lean @@ -87,6 +87,7 @@ theorem sign_top : sign (⊤ : EReal) = 1 := rfl theorem sign_bot : sign (⊥ : EReal) = -1 := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem sign_coe (x : ℝ) : sign (x : EReal) = sign x := by simp only [sign, OrderHom.coe_mk, EReal.coe_pos, EReal.coe_neg'] diff --git a/Mathlib/Data/EReal/Operations.lean b/Mathlib/Data/EReal/Operations.lean index 1d3cea1bfb2454..851abae8f7ad5c 100644 --- a/Mathlib/Data/EReal/Operations.lean +++ b/Mathlib/Data/EReal/Operations.lean @@ -490,11 +490,13 @@ lemma sub_lt_of_lt_add' {a b c : EReal} (h : a < b + c) : a - b < c := /-! ### Addition and order -/ +set_option backward.isDefEq.respectTransparency false in lemma le_of_forall_lt_iff_le {x y : EReal} : (∀ z : ℝ, x < z → y ≤ z) ↔ y ≤ x := by refine ⟨fun h ↦ WithBot.le_of_forall_lt_iff_le.1 ?_, fun h _ x_z ↦ h.trans x_z.le⟩ rw [WithTop.forall] aesop +set_option backward.isDefEq.respectTransparency false in lemma ge_of_forall_gt_iff_ge {x y : EReal} : (∀ z : ℝ, z < y → z ≤ x) ↔ y ≤ x := by refine ⟨fun h ↦ WithBot.ge_of_forall_gt_iff_ge.1 ?_, fun h _ x_z ↦ x_z.le.trans h⟩ rw [WithTop.forall] diff --git a/Mathlib/Data/Fin/Fin2.lean b/Mathlib/Data/Fin/Fin2.lean index 067362c5e5cdb8..6fdea26246ae97 100644 --- a/Mathlib/Data/Fin/Fin2.lean +++ b/Mathlib/Data/Fin/Fin2.lean @@ -149,6 +149,7 @@ theorem rev_involutive {n} : Function.Involutive (@rev n) := rev_rev instance : Inhabited (Fin2 1) := ⟨fz⟩ +set_option backward.isDefEq.respectTransparency false in set_option linter.style.whitespace false in -- manual alignment is not recognised instance instFintype : ∀ n, Fintype (Fin2 n) | 0 => ⟨∅, Fin2.elim0⟩ diff --git a/Mathlib/Data/Fin/Tuple/Basic.lean b/Mathlib/Data/Fin/Tuple/Basic.lean index 8dda5f5800debb..c84ee68eba4823 100644 --- a/Mathlib/Data/Fin/Tuple/Basic.lean +++ b/Mathlib/Data/Fin/Tuple/Basic.lean @@ -409,6 +409,7 @@ theorem append_comp_sumElim {xs : Fin m → α} {ys : Fin n → α} : Fin.append xs ys ∘ Sum.elim (Fin.castAdd _) (Fin.natAdd _) = Sum.elim xs ys := by ext (i | j) <;> simp +set_option backward.isDefEq.respectTransparency false in theorem append_injective_iff {xs : Fin m → α} {ys : Fin n → α} : Function.Injective (Fin.append xs ys) ↔ Function.Injective xs ∧ Function.Injective ys ∧ ∀ i j, xs i ≠ ys j := by @@ -665,6 +666,7 @@ theorem append_right_cons {n m} {α : Sort*} (xs : Fin n → α) (y : α) (ys : Fin.append (Fin.snoc xs y) ys ∘ Fin.cast (Nat.succ_add_eq_add_succ ..).symm := by rw [append_left_snoc]; rfl +set_option backward.isDefEq.respectTransparency false in theorem append_cons {α : Sort*} (a : α) (as : Fin n → α) (bs : Fin m → α) : Fin.append (cons a as) bs = cons a (Fin.append as bs) ∘ (Fin.cast <| Nat.add_right_comm n 1 m) := by @@ -679,6 +681,7 @@ theorem append_cons {α : Sort*} (a : α) (as : Fin n → α) (bs : Fin m → α · have : ¬i < n := Nat.not_le_of_gt <| Nat.le_of_lt_succ <| Nat.gt_of_not_le h simp [addCases, this] +set_option backward.isDefEq.respectTransparency false in theorem append_snoc {α : Sort*} (as : Fin n → α) (bs : Fin m → α) (b : α) : Fin.append as (snoc bs b) = snoc (Fin.append as bs) b := by funext i @@ -716,6 +719,7 @@ def snocCases {motive : (∀ i : Fin n.succ, α i) → Sort*} (x : ∀ i : Fin n.succ, α i) : motive x := _root_.cast (by rw [Fin.snoc_init_self]) <| snoc (Fin.init x) (x <| Fin.last _) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma snocCases_snoc {motive : (∀ i : Fin (n + 1), α i) → Sort*} (snoc : ∀ x x₀, motive (Fin.snoc x x₀)) (x : ∀ i : Fin n, (Fin.init α) i) (x₀ : α (Fin.last _)) : diff --git a/Mathlib/Data/Fin/Tuple/Embedding.lean b/Mathlib/Data/Fin/Tuple/Embedding.lean index 663ec83b9a0a30..832da015637320 100644 --- a/Mathlib/Data/Fin/Tuple/Embedding.lean +++ b/Mathlib/Data/Fin/Tuple/Embedding.lean @@ -93,6 +93,7 @@ namespace Function.Embedding variable {α : Type*} +set_option backward.isDefEq.respectTransparency false in /-- The natural equivalence of `Fin 2 ↪ α` with pairs `(a, b)` of distinct elements of `α`. -/ def twoEmbeddingEquiv : (Fin 2 ↪ α) ≃ {(a, b) : α × α | a ≠ b} where toFun e := ⟨(e 0, e 1), by diff --git a/Mathlib/Data/Fin/Tuple/Sort.lean b/Mathlib/Data/Fin/Tuple/Sort.lean index fc5b8b090beaa8..72c8d02bf9c1e2 100644 --- a/Mathlib/Data/Fin/Tuple/Sort.lean +++ b/Mathlib/Data/Fin/Tuple/Sort.lean @@ -56,6 +56,7 @@ theorem graph.card (f : Fin n → α) : (graph f).card = n := by rw [Prod.ext_iff] simp +set_option backward.isDefEq.respectTransparency false in /-- `graphEquiv₁ f` is the natural equivalence between `Fin n` and `graph f`, mapping `i` to `(f i, i)`. -/ def graphEquiv₁ (f : Fin n → α) : Fin n ≃ graph f where diff --git a/Mathlib/Data/Fin/Tuple/Take.lean b/Mathlib/Data/Fin/Tuple/Take.lean index c311b581f4204f..f542aea28f6e86 100644 --- a/Mathlib/Data/Fin/Tuple/Take.lean +++ b/Mathlib/Data/Fin/Tuple/Take.lean @@ -66,6 +66,7 @@ theorem take_repeat {α : Type*} {n' : ℕ} (m : ℕ) (h : m ≤ n) (a : Fin n' ext i simp only [take, repeat_apply, modNat, val_castLE] +set_option backward.isDefEq.respectTransparency false in /-- Taking `m + 1` elements is equal to taking `m` elements and adding the `(m + 1)`th one. -/ theorem take_succ_eq_snoc (m : ℕ) (h : m < n) (v : (i : Fin n) → α i) : take m.succ h v = snoc (take m h.le v) (v ⟨m, h⟩) := by diff --git a/Mathlib/Data/FinEnum.lean b/Mathlib/Data/FinEnum.lean index 09265e1c0735ac..ec344f04cf535b 100644 --- a/Mathlib/Data/FinEnum.lean +++ b/Mathlib/Data/FinEnum.lean @@ -40,14 +40,14 @@ namespace FinEnum variable {α : Type u} {β : α → Type v} /-- transport a `FinEnum` instance across an equivalence -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv (α) {β} [FinEnum α] (h : β ≃ α) : FinEnum β where card := card α equiv := h.trans (equiv) decEq := (h.trans (equiv)).decidableEq /-- create a `FinEnum` instance from an exhaustive list without duplicates -/ -@[implicit_reducible] +@[instance_reducible] def ofNodupList [DecidableEq α] (xs : List α) (h : ∀ x : α, x ∈ xs) (h' : List.Nodup xs) : FinEnum α where card := xs.length @@ -56,7 +56,7 @@ def ofNodupList [DecidableEq α] (xs : List α) (h : ∀ x : α, x ∈ xs) (h' : fun i => by ext; simp [h'.idxOf_getElem]⟩ /-- create a `FinEnum` instance from an exhaustive list; duplicates are removed -/ -@[implicit_reducible] +@[instance_reducible] def ofList [DecidableEq α] (xs : List α) (h : ∀ x : α, x ∈ xs) : FinEnum α := ofNodupList xs.dedup (by simp [*]) (List.nodup_dedup _) @@ -78,12 +78,12 @@ theorem nodup_toList [FinEnum α] : List.Nodup (toList α) := by simp only [toList]; apply List.Nodup.map <;> [apply Equiv.injective; apply List.nodup_finRange] /-- create a `FinEnum` instance using a surjection -/ -@[implicit_reducible] +@[instance_reducible] def ofSurjective {β} (f : β → α) [DecidableEq α] [FinEnum β] (h : Surjective f) : FinEnum α := ofList ((toList β).map f) (by intro; simpa using h _) /-- create a `FinEnum` instance using an injection -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofInjective {α β} (f : α → β) [DecidableEq α] [FinEnum β] (h : Injective f) : FinEnum α := ofList ((toList β).filterMap (partialInv f)) @@ -242,7 +242,7 @@ instance [IsEmpty α] : Unique (FinEnum α) where /-- An empty type has a trivial enumeration. Not registered as an instance, to make sure that there aren't two definitionally differing instances around. -/ -@[implicit_reducible] +@[instance_reducible] def ofIsEmpty [IsEmpty α] : FinEnum α := default instance [Unique α] : Unique (FinEnum α) where @@ -257,7 +257,7 @@ instance [Unique α] : Unique (FinEnum α) where /-- A type with unique inhabitant has a trivial enumeration. Not registered as an instance, to make sure that there aren't two definitionally differing instances around. -/ -@[implicit_reducible] +@[instance_reducible] def ofUnique [Unique α] : FinEnum α := default instance : FinEnum UInt8 where diff --git a/Mathlib/Data/FinEnum/Option.lean b/Mathlib/Data/FinEnum/Option.lean index 41be5993f77b7c..e4011c9e70fa35 100644 --- a/Mathlib/Data/FinEnum/Option.lean +++ b/Mathlib/Data/FinEnum/Option.lean @@ -24,7 +24,7 @@ namespace FinEnum universe u v /-- Inserting an `Option.none` anywhere in an enumeration yields another enumeration. -/ -@[implicit_reducible] +@[instance_reducible] def insertNone (α : Type u) [FinEnum α] (i : Fin (card α + 1)) : FinEnum (Option α) where card := card α + 1 equiv := equiv.optionCongr.trans <| finSuccEquiv' i |>.symm diff --git a/Mathlib/Data/Finmap.lean b/Mathlib/Data/Finmap.lean index ec4dbcdbc01e22..3d003bd90f79d9 100644 --- a/Mathlib/Data/Finmap.lean +++ b/Mathlib/Data/Finmap.lean @@ -80,6 +80,7 @@ def AList.toFinmap (s : AList β) : Finmap β := -- for `Quotient.mk` local notation:arg "⟦" a "⟧" => AList.toFinmap a +set_option backward.isDefEq.respectTransparency false in theorem AList.toFinmap_eq {s₁ s₂ : AList β} : toFinmap s₁ = toFinmap s₂ ↔ s₁.entries ~ s₂.entries := by cases s₁ diff --git a/Mathlib/Data/Finset/Defs.lean b/Mathlib/Data/Finset/Defs.lean index 5c5a5cc14de580..f3b2f52989453f 100644 --- a/Mathlib/Data/Finset/Defs.lean +++ b/Mathlib/Data/Finset/Defs.lean @@ -342,6 +342,7 @@ section DecidablePiExists variable {s : Finset α} +set_option backward.isDefEq.respectTransparency false in instance decidableDforallFinset {p : ∀ a ∈ s, Prop} [_hp : ∀ (a) (h : a ∈ s), Decidable (p a h)] : Decidable (∀ (a) (h : a ∈ s), p a h) := Multiset.decidableDforallMultiset @@ -358,6 +359,7 @@ instance instDecidableLE [DecidableEq α] : DecidableLE (Finset α) := instance instDecidableLT [DecidableEq α] : DecidableLT (Finset α) := instDecidableRelSSubset +set_option backward.isDefEq.respectTransparency false in instance decidableDExistsFinset {p : ∀ a ∈ s, Prop} [_hp : ∀ (a) (h : a ∈ s), Decidable (p a h)] : Decidable (∃ (a : _) (h : a ∈ s), p a h) := Multiset.decidableDexistsMultiset diff --git a/Mathlib/Data/Finset/Image.lean b/Mathlib/Data/Finset/Image.lean index 772ed9d8904f07..66e44e55647ab6 100644 --- a/Mathlib/Data/Finset/Image.lean +++ b/Mathlib/Data/Finset/Image.lean @@ -178,6 +178,7 @@ lemma map_filter' (p : α → Prop) [DecidablePred p] (f : α ↪ β) (s : Finse (s.filter p).map f = (s.map f).filter fun b => ∃ a, p a ∧ f a = b := by simp [filter_map] +set_option backward.isDefEq.respectTransparency false in lemma filter_attach' [DecidableEq α] (s : Finset α) (p : s → Prop) [DecidablePred p] : s.attach.filter p = (s.filter fun x => ∃ h, p ⟨x, h⟩).attach.map @@ -255,6 +256,7 @@ theorem attach_map_val {s : Finset α} : s.attach.map (Embedding.subtype _) = s end Map +set_option backward.isDefEq.respectTransparency false in theorem range_add_one' (n : ℕ) : range (n + 1) = insert 0 ((range n).map ⟨fun i => i + 1, fun i j => by simp⟩) := by ext (⟨⟩ | ⟨n⟩) <;> simp [Nat.zero_lt_succ n] @@ -300,6 +302,7 @@ theorem mem_image_const : c ∈ s.image (const α b) ↔ s.Nonempty ∧ b = c := theorem mem_image_const_self : b ∈ s.image (const α b) ↔ s.Nonempty := mem_image_const.trans <| and_iff_left rfl +set_option backward.isDefEq.respectTransparency false in instance canLift (c) (p) [CanLift β α c p] : CanLift (Finset β) (Finset α) (image c) fun s => ∀ x ∈ s, p x where prf := by @@ -504,6 +507,7 @@ set_option backward.isDefEq.respectTransparency false in theorem attach_image_val [DecidableEq α] {s : Finset α} : s.attach.image Subtype.val = s := eq_of_veq <| by rw [image_val, attach_val, Multiset.attach_map_val, dedup_eq_self] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma attach_cons (a : α) (s : Finset α) (ha) : attach (cons a s ha) = @@ -597,6 +601,7 @@ protected def subtype {α} (p : α → Prop) [DecidablePred p] (s : Finset α) : ⟨fun x => ⟨x.1, by simpa using (Finset.mem_filter.1 x.2).2⟩, fun _ _ H => Subtype.ext <| Subtype.mk.inj H⟩ +set_option backward.isDefEq.respectTransparency false in @[simp, grind =] theorem mem_subtype {p : α → Prop} [DecidablePred p] {s : Finset α} : ∀ {a : Subtype p}, a ∈ s.subtype p ↔ (a : α) ∈ s @@ -727,6 +732,7 @@ theorem finsetCongr_toEmbedding (e : α ≃ β) : e.finsetCongr.toEmbedding = (Finset.mapEmbedding e.toEmbedding).toEmbedding := rfl +set_option backward.isDefEq.respectTransparency false in /-- Given a predicate `p : α → Prop`, produces an equivalence between `Finset {a : α // p a}` and `{s : Finset α // ∀ a ∈ s, p a}`. -/ @[simps] diff --git a/Mathlib/Data/Finset/Insert.lean b/Mathlib/Data/Finset/Insert.lean index fbaa3b4dc10377..5b7fe9bc395c8d 100644 --- a/Mathlib/Data/Finset/Insert.lean +++ b/Mathlib/Data/Finset/Insert.lean @@ -285,6 +285,7 @@ theorem cons_nonempty (h : a ∉ s) : (cons a s h).Nonempty := @[simp] theorem cons_ne_empty (h : a ∉ s) : cons a s h ≠ ∅ := (cons_nonempty _).ne_empty +set_option backward.isDefEq.respectTransparency false in @[simp] theorem nonempty_mk {m : Multiset α} {hm} : (⟨m, hm⟩ : Finset α).Nonempty ↔ m ≠ 0 := by induction m using Multiset.induction_on <;> simp diff --git a/Mathlib/Data/Finset/Lattice/Prod.lean b/Mathlib/Data/Finset/Lattice/Prod.lean index 0b9096a0ef3882..0511defb7b136e 100644 --- a/Mathlib/Data/Finset/Lattice/Prod.lean +++ b/Mathlib/Data/Finset/Lattice/Prod.lean @@ -90,6 +90,7 @@ theorem sup'_product_right {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × section Prod variable {ι κ α β : Type*} [SemilatticeSup α] [SemilatticeSup β] {s : Finset ι} {t : Finset κ} +set_option backward.isDefEq.respectTransparency false in /-- See also `Finset.sup'_prodMap`. -/ @[to_dual /-- See also `Finset.inf'_prodMap`. -/] lemma prodMk_sup'_sup' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : diff --git a/Mathlib/Data/Finset/NatAntidiagonal.lean b/Mathlib/Data/Finset/NatAntidiagonal.lean index a9bc329d17e3ee..8c301ccc9aa340 100644 --- a/Mathlib/Data/Finset/NatAntidiagonal.lean +++ b/Mathlib/Data/Finset/NatAntidiagonal.lean @@ -48,10 +48,12 @@ lemma antidiagonal_eq_map' (n : ℕ) : (range (n + 1)).map ⟨fun i ↦ (n - i, i), fun _ _ h ↦ (Prod.ext_iff.1 h).2⟩ := by rw [← map_swap_antidiagonal, antidiagonal_eq_map, map_map]; rfl +set_option backward.isDefEq.respectTransparency false in lemma antidiagonal_eq_image (n : ℕ) : antidiagonal n = (range (n + 1)).image fun i ↦ (i, n - i) := by simp only [antidiagonal_eq_map, map_eq_image, Function.Embedding.coeFn_mk] +set_option backward.isDefEq.respectTransparency false in lemma antidiagonal_eq_image' (n : ℕ) : antidiagonal n = (range (n + 1)).image fun i ↦ (n - i, i) := by simp only [antidiagonal_eq_map', map_eq_image, Function.Embedding.coeFn_mk] @@ -123,7 +125,8 @@ theorem antidiagonal.snd_lt {n : ℕ} {kl : ℕ × ℕ} (hlk : kl ∈ antidiagon ∃ a b, a + b = k ∧ a = i ∧ b + (n - k) = j := fun i j ↦ by rw [exists_comm]; exact exists₂_congr (fun a b ↦ by rw [add_comm]) rw [← map_prodComm_antidiagonal] - simp_rw [aux₁, ← map_filter, antidiagonal_filter_snd_le_of_le h, map_map] + simp_rw [aux₁, ← map_filter (p := fun a : ℕ × ℕ ↦ a.2 ≤ k), antidiagonal_filter_snd_le_of_le h, + map_map] ext ⟨i, j⟩ simpa using aux₂ i j @@ -147,7 +150,8 @@ theorem antidiagonal.snd_lt {n : ℕ} {kl : ℕ × ℕ} (hlk : kl ∈ antidiagon ∃ a b, a + b = n - k ∧ a = i ∧ b + k = j := fun i j ↦ by rw [exists_comm]; exact exists₂_congr (fun a b ↦ by rw [add_comm]) rw [← map_prodComm_antidiagonal] - simp_rw [aux₁, ← map_filter, antidiagonal_filter_le_fst_of_le h, map_map] + simp_rw [aux₁, ← map_filter (p := fun a : ℕ × ℕ ↦ k ≤ a.fst), antidiagonal_filter_le_fst_of_le h, + map_map] ext ⟨i, j⟩ simpa using aux₂ i j diff --git a/Mathlib/Data/Finset/NoncommProd.lean b/Mathlib/Data/Finset/NoncommProd.lean index 5244f0d8a1901a..2d18281b38e4bc 100644 --- a/Mathlib/Data/Finset/NoncommProd.lean +++ b/Mathlib/Data/Finset/NoncommProd.lean @@ -82,6 +82,7 @@ def noncommFold (s : Multiset α) (comm : { x | x ∈ s }.Pairwise fun x y => op α → α := noncommFoldr op s fun x hx y hy h b => by rw [← assoc.assoc, comm hx hy h, assoc.assoc] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem noncommFold_coe (l : List α) (comm) (a : α) : noncommFold op (l : Multiset α) comm a = l.foldr op a := by simp [noncommFold] @@ -112,6 +113,7 @@ on all elements `x ∈ s`. -/ def noncommProd (s : Multiset α) (comm : { x | x ∈ s }.Pairwise Commute) : α := s.noncommFold (· * ·) comm 1 +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem noncommProd_coe (l : List α) (comm) : noncommProd (l : Multiset α) comm = l.prod := by rw [noncommProd] @@ -289,6 +291,7 @@ theorem noncommProd_cons' (s : Finset α) (a : α) (f : α → β) noncommProd s f (comm.mono fun _ => Finset.mem_cons.2 ∘ .inr) * f a := by simp_rw [noncommProd, Finset.cons_val, Multiset.map_cons, Multiset.noncommProd_cons'] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem noncommProd_insert_of_notMem [DecidableEq α] (s : Finset α) (a : α) (f : α → β) (comm) (ha : a ∉ s) : @@ -296,6 +299,7 @@ theorem noncommProd_insert_of_notMem [DecidableEq α] (s : Finset α) (a : α) ( f a * noncommProd s f (comm.mono fun _ => mem_insert_of_mem) := by simp only [← cons_eq_insert _ _ ha, noncommProd_cons] +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem noncommProd_insert_of_notMem' [DecidableEq α] (s : Finset α) (a : α) (f : α → β) (comm) (ha : a ∉ s) : @@ -349,6 +353,7 @@ theorem noncommProd_erase_mul [DecidableEq α] (s : Finset α) {a : α} (h : a simpa only [← Multiset.map_erase_of_mem _ _ h] using! Multiset.noncommProd_erase_mul (s.1.map f) (Multiset.mem_map_of_mem f h) _ +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem noncommProd_eq_prod {β : Type*} [CommMonoid β] (s : Finset α) (f : α → β) : (noncommProd s f fun _ _ _ _ _ => Commute.all _ _) = s.prod f := by @@ -381,6 +386,7 @@ theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → · exact comm_gf hx hy h · exact comm_gg.of_refl hx hy +set_option backward.isDefEq.respectTransparency false in /-- The non-commutative version of `Finset.prod_mul_distrib` -/ @[to_additive /-- The non-commutative version of `Finset.sum_add_distrib` -/] theorem noncommProd_mul_distrib {s : Finset α} (f : α → β) (g : α → β) (comm_ff comm_gg comm_gf) : @@ -399,6 +405,7 @@ section FinitePi variable {M : ι → Type*} [∀ i, Monoid (M i)] +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem noncommProd_mulSingle [Fintype ι] [DecidableEq ι] (x : ∀ i, M i) : (univ.noncommProd (fun i => Pi.mulSingle i (x i)) fun i _ j _ _ => @@ -424,6 +431,7 @@ alias noncommProd_mul_single := noncommProd_mulSingle @[deprecated (since := "2025-12-09")] alias noncommSum_add_single := noncommSum_single +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem _root_.MonoidHom.pi_ext [Finite ι] [DecidableEq ι] {f g : (∀ i, M i) →* γ} (h : ∀ i x, f (Pi.mulSingle i x) = g (Pi.mulSingle i x)) : f = g := by diff --git a/Mathlib/Data/Finset/PImage.lean b/Mathlib/Data/Finset/PImage.lean index 2fbaff8f420f9f..590697e155001f 100644 --- a/Mathlib/Data/Finset/PImage.lean +++ b/Mathlib/Data/Finset/PImage.lean @@ -66,6 +66,7 @@ theorem mem_pimage : b ∈ s.pimage f ↔ ∃ a ∈ s, b ∈ f a := by theorem coe_pimage : (s.pimage f : Set β) = f.image s := Set.ext fun _ => mem_pimage +set_option backward.isDefEq.respectTransparency false in @[simp] theorem pimage_some (s : Finset α) (f : α → β) [∀ x, Decidable (Part.some <| f x).Dom] : (s.pimage fun x => Part.some (f x)) = s.image f := by diff --git a/Mathlib/Data/Finset/Powerset.lean b/Mathlib/Data/Finset/Powerset.lean index 4c49c337576199..3577d047a37a69 100644 --- a/Mathlib/Data/Finset/Powerset.lean +++ b/Mathlib/Data/Finset/Powerset.lean @@ -301,6 +301,7 @@ theorem pairwise_disjoint_powersetCard (s : Finset α) : Finset.disjoint_left.mpr fun _x hi hj => hij <| (mem_powersetCard.mp hi).2.symm.trans (mem_powersetCard.mp hj).2 +set_option backward.isDefEq.respectTransparency false in theorem powerset_card_disjiUnion (s : Finset α) : Finset.powerset s = (range (s.card + 1)).disjiUnion (fun i => powersetCard i s) @@ -313,6 +314,7 @@ theorem powerset_card_disjiUnion (s : Finset α) : · rcases mem_disjiUnion.mp ha with ⟨i, _hi, ha⟩ exact mem_powerset.mpr (mem_powersetCard.mp ha).1 +set_option backward.isDefEq.respectTransparency false in theorem powerset_card_biUnion [DecidableEq (Finset α)] (s : Finset α) : Finset.powerset s = (range (s.card + 1)).biUnion fun i => powersetCard i s := by simpa only [disjiUnion_eq_biUnion] using powerset_card_disjiUnion s diff --git a/Mathlib/Data/Finset/Preimage.lean b/Mathlib/Data/Finset/Preimage.lean index ce8b341335b897..90fa60aa2f0b13 100644 --- a/Mathlib/Data/Finset/Preimage.lean +++ b/Mathlib/Data/Finset/Preimage.lean @@ -55,6 +55,7 @@ theorem disjoint_preimage {f : α → β} {s t : Finset β} Disjoint (s.preimage f hs) (t.preimage f ht) := by grind [not_disjoint_iff, mem_preimage] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem preimage_inter [DecidableEq α] [DecidableEq β] {f : α → β} {s t : Finset β} (hs : Set.InjOn f (f ⁻¹' ↑s)) (ht : Set.InjOn f (f ⁻¹' ↑t)) : @@ -63,6 +64,7 @@ theorem preimage_inter [DecidableEq α] [DecidableEq β] {f : α → β} {s t : preimage s f hs ∩ preimage t f ht := Finset.coe_injective (by simp) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem preimage_union [DecidableEq α] [DecidableEq β] {f : α → β} {s t : Finset β} (hst) : preimage (s ∪ t) f hst = diff --git a/Mathlib/Data/Finset/Sum.lean b/Mathlib/Data/Finset/Sum.lean index c5da1287f1d90f..047def625ffb40 100644 --- a/Mathlib/Data/Finset/Sum.lean +++ b/Mathlib/Data/Finset/Sum.lean @@ -224,6 +224,7 @@ lemma toRight_sdiff : (u \ v).toRight = u.toRight \ v.toRight := by ext x; simp end +set_option backward.isDefEq.respectTransparency false in /-- Finsets on sum types are equivalent to pairs of finsets on each summand. -/ @[simps apply_fst apply_snd] def sumEquiv {α β : Type*} : Finset (α ⊕ β) ≃o Finset α × Finset β where diff --git a/Mathlib/Data/Finset/Union.lean b/Mathlib/Data/Finset/Union.lean index 47dbea95f95245..09a5bdd73dafd9 100644 --- a/Mathlib/Data/Finset/Union.lean +++ b/Mathlib/Data/Finset/Union.lean @@ -146,11 +146,13 @@ theorem filter_disjiUnion (s : Finset α) (f : α → Finset β) (h) (p : β → (s.disjiUnion f h).filter p = s.disjiUnion (fun a ↦ (f a).filter p) (pairwiseDisjoint_filter h p) := by grind +set_option backward.isDefEq.respectTransparency false in theorem disjiUnion_singleton {f : α → β} (hf : f.Injective) : s.disjiUnion (fun a ↦ {f a}) (fun _ _ _ _ ↦ disjoint_singleton.mpr ∘ hf.ne) = s.map ⟨f, hf⟩ := by ext; simp [eq_comm] +set_option backward.isDefEq.respectTransparency false in lemma disjoint_disjiUnion_left (s : Finset α) (f : α → Finset β) (hf : Set.PairwiseDisjoint s f) (t : Finset β) : Disjoint (s.disjiUnion f hf) t ↔ ∀ i ∈ s, Disjoint (f i) t := by diff --git a/Mathlib/Data/Finsupp/Basic.lean b/Mathlib/Data/Finsupp/Basic.lean index 682adeef183b67..5a5b81a8485a68 100644 --- a/Mathlib/Data/Finsupp/Basic.lean +++ b/Mathlib/Data/Finsupp/Basic.lean @@ -81,6 +81,7 @@ theorem apply_eq_of_mem_graph {a : α} {m : M} {f : α →₀ M} (h : (a, m) ∈ theorem notMem_graph_snd_zero (a : α) (f : α →₀ M) : (a, (0 : M)) ∉ f.graph := fun h => (mem_graph_iff.1 h).2.irrefl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem image_fst_graph [DecidableEq α] (f : α →₀ M) : f.graph.image Prod.fst = f.support := by classical @@ -1249,6 +1250,7 @@ the type of finitely supported functions from `s`. -/ letI := Classical.decPred (· ∈ s); Subtype.ext <| extendDomain_subtypeDomain f.1 f.prop right_inv _ := letI := Classical.decPred (· ∈ s); subtypeDomain_extendDomain _ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma restrictSupportEquiv_symm_apply_coe (s : Set α) (M : Type*) [AddCommMonoid M] [DecidablePred (· ∈ s)] (f : s →₀ M) : (restrictSupportEquiv s M).symm f = f.extendDomain := by @@ -1312,6 +1314,7 @@ This is the `Finsupp` version of `Sigma.curry`. def split (i : ι) : αs i →₀ M := l.comapDomain (Sigma.mk i) fun _ _ _ _ hx => heq_iff_eq.1 (Sigma.mk.inj hx).2 +set_option backward.isDefEq.respectTransparency false in theorem split_apply (i : ι) (x : αs i) : split l i x = l ⟨i, x⟩ := by rw [split, comapDomain_apply] @@ -1321,6 +1324,7 @@ def splitSupport (l : (Σ i, αs i) →₀ M) : Finset ι := haveI := Classical.decEq ι l.support.image Sigma.fst +set_option backward.isDefEq.respectTransparency false in theorem mem_splitSupport_iff_nonzero (i : ι) : i ∈ splitSupport l ↔ split l i ≠ 0 := by classical rw [splitSupport, mem_image, Ne, ← support_eq_empty, ← Ne, ← Finset.nonempty_iff_ne_empty, split, comapDomain, Finset.Nonempty] @@ -1338,6 +1342,7 @@ def splitComp [Zero N] (g : ∀ i, (αs i →₀ M) → N) (hg : ∀ i x, x = 0 intro i rw [mem_splitSupport_iff_nonzero, not_iff_not, hg] +set_option backward.isDefEq.respectTransparency false in theorem sigma_support : l.support = l.splitSupport.sigma fun i => (l.split i).support := by simp_rw [Finset.ext_iff, splitSupport, split, comapDomain, Sigma.forall, mem_sigma, mem_image, mem_preimage] @@ -1349,6 +1354,7 @@ theorem sigma_sum [AddCommMonoid N] (f : (Σ i : ι, αs i) → M → N) : variable {η : Type*} [Fintype η] {ιs : η → Type*} [Zero α] +set_option backward.isDefEq.respectTransparency false in /-- On a `Fintype η`, `Finsupp.split` is an equivalence between `(Σ (j : η), ιs j) →₀ α` and `Π j, (ιs j →₀ α)`. diff --git a/Mathlib/Data/Finsupp/Defs.lean b/Mathlib/Data/Finsupp/Defs.lean index 2b2ed3a0d43935..1b78f02de7c2d6 100644 --- a/Mathlib/Data/Finsupp/Defs.lean +++ b/Mathlib/Data/Finsupp/Defs.lean @@ -383,6 +383,7 @@ def mapRange.equiv (e : M ≃ N) (hf : e 0 = 0) : (ι →₀ M) ≃ (ι →₀ N left_inv x := by ext; simp right_inv x := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mapRange.equiv_refl : mapRange.equiv (.refl M) rfl = .refl (ι →₀ M) := by ext; simp lemma mapRange.equiv_trans (e : M ≃ N) (hf) (f₂ : N ≃ O) (hf₂) : diff --git a/Mathlib/Data/Finsupp/Lex.lean b/Mathlib/Data/Finsupp/Lex.lean index 3aa7a80b5988c4..5d742347a84e40 100644 --- a/Mathlib/Data/Finsupp/Lex.lean +++ b/Mathlib/Data/Finsupp/Lex.lean @@ -52,6 +52,7 @@ instance [LT α] [LT N] : LT (Lex (α →₀ N)) := instance [LT α] [LT N] : LT (Colex (α →₀ N)) := ⟨fun f g ↦ Finsupp.Lex (· > ·) (· < ·) (ofColex f) (ofColex g)⟩ +set_option backward.isDefEq.respectTransparency false in theorem Lex.lt_iff [LT α] [LT N] {a b : Lex (α →₀ N)} : a < b ↔ ∃ i, (∀ j, j < i → a j = b j) ∧ a i < b i := .rfl @@ -59,6 +60,7 @@ theorem Lex.lt_iff [LT α] [LT N] {a b : Lex (α →₀ N)} : @[deprecated (since := "2025-11-29")] alias lex_lt_iff := Lex.lt_iff +set_option backward.isDefEq.respectTransparency false in theorem Colex.lt_iff [LT α] [LT N] {a b : Colex (α →₀ N)} : a < b ↔ ∃ i, (∀ j, i < j → a j = b j) ∧ a i < b i := .rfl @@ -75,6 +77,7 @@ theorem lex_iff_of_unique [Unique α] [LT N] {r} [Std.Irrefl r] {x y : α →₀ Finsupp.Lex r (· < ·) x y ↔ x default < y default := Pi.lex_iff_of_unique +set_option backward.isDefEq.respectTransparency false in theorem Lex.lt_iff_of_unique [Unique α] [LT N] [Preorder α] {x y : Lex (α →₀ N)} : x < y ↔ x default < y default := lex_iff_of_unique @@ -82,6 +85,7 @@ theorem Lex.lt_iff_of_unique [Unique α] [LT N] [Preorder α] {x y : Lex (α → @[deprecated (since := "2025-11-29")] alias lex_lt_iff_of_unique := Lex.lt_iff_of_unique +set_option backward.isDefEq.respectTransparency false in theorem Colex.lt_iff_of_unique [Unique α] [LT N] [Preorder α] {x y : Colex (α →₀ N)} : x < y ↔ x default < y default := Lex.lt_iff_of_unique (α := αᵒᵈ) @@ -122,6 +126,7 @@ instance Colex.linearOrder [LinearOrder N] : LinearOrder (Colex (α →₀ N)) w le := (· ≤ ·) __ := LinearOrder.lift' (toColex ∘ toDFinsupp ∘ ofColex) finsuppEquivDFinsupp.injective +set_option backward.isDefEq.respectTransparency false in theorem Lex.le_iff_of_unique [Unique α] [PartialOrder N] {x y : Lex (α →₀ N)} : x ≤ y ↔ x default ≤ y default := Pi.lex_le_iff_of_unique @@ -129,6 +134,7 @@ theorem Lex.le_iff_of_unique [Unique α] [PartialOrder N] {x y : Lex (α →₀ @[deprecated (since := "2025-11-29")] alias lex_le_iff_of_unique := Lex.le_iff_of_unique +set_option backward.isDefEq.respectTransparency false in theorem Colex.le_iff_of_unique [Unique α] [PartialOrder N] {x y : Colex (α →₀ N)} : x ≤ y ↔ x default ≤ y default := Lex.le_iff_of_unique (α := αᵒᵈ) @@ -202,6 +208,7 @@ section Right variable [AddRightStrictMono N] +set_option backward.isDefEq.respectTransparency false in instance Lex.addRightStrictMono : AddRightStrictMono (Lex (α →₀ N)) := ⟨fun f _ _ ⟨a, lta, ha⟩ ↦ ⟨a, fun j ja ↦ congr($(lta j ja) + f j), add_lt_add_left ha _⟩⟩ diff --git a/Mathlib/Data/Finsupp/ToDFinsupp.lean b/Mathlib/Data/Finsupp/ToDFinsupp.lean index 9241f486d17237..8989f05d0f8a00 100644 --- a/Mathlib/Data/Finsupp/ToDFinsupp.lean +++ b/Mathlib/Data/Finsupp/ToDFinsupp.lean @@ -251,6 +251,7 @@ variable {η : ι → Type*} {N : Type*} [Semiring R] open Finsupp +set_option backward.isDefEq.respectTransparency false in /-- `Finsupp.split` is an equivalence between `(Σ i, η i) →₀ N` and `Π₀ i, (η i →₀ N)`. -/ def sigmaFinsuppEquivDFinsupp [Zero N] : ((Σ i, η i) →₀ N) ≃ Π₀ i, η i →₀ N where toFun f := ⟨split f, Trunc.mk ⟨(splitSupport f : Finset ι).val, fun i => by diff --git a/Mathlib/Data/Finsupp/Weight.lean b/Mathlib/Data/Finsupp/Weight.lean index d6cc5fd6d7ee35..1d26393f83f3e7 100644 --- a/Mathlib/Data/Finsupp/Weight.lean +++ b/Mathlib/Data/Finsupp/Weight.lean @@ -265,6 +265,7 @@ lemma range_single_one : obtain ⟨a, rfl⟩ := (Finsupp.sum_eq_one_iff _).mp hp use a +set_option backward.isDefEq.respectTransparency false in -- TODO? @[simp] theorem degree_mapDomain {τ : Type*} (f : σ → τ) [AddCommMonoid M] (x : σ →₀ M) : degree (x.mapDomain f) = degree x := by @@ -274,6 +275,7 @@ theorem degree_mapDomain {τ : Type*} (f : σ → τ) [AddCommMonoid M] (x : σ @[deprecated (since := "2026-04-27")] alias degree_mapDomain_eq_of_subsingletonAddUnits := degree_mapDomain +set_option backward.isDefEq.respectTransparency false in theorem degree_comapDomain_le_of_canonicallyOrderedAdd {τ : Type*} {f : σ → τ} [AddCommMonoid M] [PartialOrder M] [CanonicallyOrderedAdd M] {x : τ →₀ M} (hf : Set.InjOn f (f ⁻¹' x.support)) : degree (x.comapDomain f hf) ≤ degree x := by @@ -326,6 +328,7 @@ lemma nsmul_single_one_image {α : Type*} {n : ℕ} {s : Set α} : (show single i 1 ≤ f by simpa [Nat.one_le_iff_ne_zero] using hi) exact ⟨x, by aesop (add simp Set.subset_def), _, ⟨_, f_supp (by simp_all), rfl⟩, hx.symm⟩ +set_option backward.isDefEq.respectTransparency false in open scoped Pointwise in theorem image_pow_eq_finsuppProd_image {α β : Type*} [CommMonoid β] {f : α → β} {n} {s : Set α} : (f '' s) ^ n = (·.prod (f · ^ ·)) '' {x : α →₀ ℕ | x.degree = n ∧ ↑x.support ⊆ s} := by diff --git a/Mathlib/Data/Fintype/Basic.lean b/Mathlib/Data/Fintype/Basic.lean index 67f724a64a660c..dfffdca072f2c3 100644 --- a/Mathlib/Data/Fintype/Basic.lean +++ b/Mathlib/Data/Fintype/Basic.lean @@ -148,12 +148,12 @@ theorem Fintype.univ_bool : @univ Bool _ = {true, false} := rfl /-- Given that `α × β` is a fintype, `α` is also a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def Fintype.prodLeft {α β} [DecidableEq α] [Fintype (α × β)] [Nonempty β] : Fintype α := ⟨(@univ (α × β) _).image Prod.fst, fun a => by simp⟩ /-- Given that `α × β` is a fintype, `β` is also a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def Fintype.prodRight {α β} [DecidableEq β] [Fintype (α × β)] [Nonempty α] : Fintype β := ⟨(@univ (α × β) _).image Prod.snd, fun b => by simp⟩ diff --git a/Mathlib/Data/Fintype/Card.lean b/Mathlib/Data/Fintype/Card.lean index 92b0c19123219c..891ce64e697d4a 100644 --- a/Mathlib/Data/Fintype/Card.lean +++ b/Mathlib/Data/Fintype/Card.lean @@ -211,13 +211,13 @@ theorem Fintype.card_subtype_true [Fintype α] {h : Fintype {_a : α // True}} : /-- Given that `α ⊕ β` is a fintype, `α` is also a fintype. This is non-computable as it uses that `Sum.inl` is an injection, but there's no clear inverse if `α` is empty. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Fintype.sumLeft {α β} [Fintype (α ⊕ β)] : Fintype α := Fintype.ofInjective (Sum.inl : α → α ⊕ β) Sum.inl_injective /-- Given that `α ⊕ β` is a fintype, `β` is also a fintype. This is non-computable as it uses that `Sum.inr` is an injection, but there's no clear inverse if `β` is empty. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Fintype.sumRight {α β} [Fintype (α ⊕ β)] : Fintype β := Fintype.ofInjective (Sum.inr : β → α ⊕ β) Sum.inr_injective @@ -261,6 +261,7 @@ theorem card_lt_of_injective_not_surjective (f : α → β) (h : Function.Inject theorem card_le_of_surjective (f : α → β) (h : Function.Surjective f) : card β ≤ card α := card_le_of_injective _ (Function.injective_surjInv h) +set_option backward.isDefEq.respectTransparency false in theorem card_range_le {α β : Type*} (f : α → β) [Fintype α] [Fintype (Set.range f)] : Fintype.card (Set.range f) ≤ Fintype.card α := Fintype.card_le_of_surjective (fun a => ⟨f a, by simp⟩) fun ⟨_, a, ha⟩ => ⟨a, by simpa using ha⟩ diff --git a/Mathlib/Data/Fintype/Defs.lean b/Mathlib/Data/Fintype/Defs.lean index 7fc7c24f360dd6..c9fab2c73ea097 100644 --- a/Mathlib/Data/Fintype/Defs.lean +++ b/Mathlib/Data/Fintype/Defs.lean @@ -262,14 +262,14 @@ instance (α : Type*) : Lean.Meta.FastSubsingleton (Fintype α) := {} /-- Given a predicate that can be represented by a finset, the subtype associated to the predicate is a fintype. -/ -@[implicit_reducible] +@[instance_reducible] protected def subtype {p : α → Prop} (s : Finset α) (H : ∀ x : α, x ∈ s ↔ p x) : Fintype { x // p x } := ⟨⟨s.1.pmap Subtype.mk fun x => (H x).1, s.nodup.pmap fun _ _ _ _ => congr_arg Subtype.val⟩, fun ⟨x, px⟩ => Multiset.mem_pmap.2 ⟨x, (H x).2 px, rfl⟩⟩ /-- Construct a fintype from a finset with the same elements. -/ -@[implicit_reducible] +@[instance_reducible] def ofFinset {p : Set α} (s : Finset α) (H : ∀ x, x ∈ s ↔ x ∈ p) : Fintype p := Fintype.subtype s H diff --git a/Mathlib/Data/Fintype/EquivFin.lean b/Mathlib/Data/Fintype/EquivFin.lean index 9a81740a1fb9f1..d71f57cc84c3a7 100644 --- a/Mathlib/Data/Fintype/EquivFin.lean +++ b/Mathlib/Data/Fintype/EquivFin.lean @@ -409,7 +409,7 @@ theorem isEmpty_fintype {α : Type*} : IsEmpty (Fintype α) ↔ Infinite α := ⟨fun ⟨h⟩ => ⟨fun h' => (@nonempty_fintype α h').elim h⟩, fun ⟨h⟩ => ⟨fun h' => h h'.finite⟩⟩ /-- A non-infinite type is a fintype. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfNotInfinite {α : Type*} (h : ¬Infinite α) : Fintype α := @Fintype.ofFinite _ (not_infinite_iff_finite.mp h) @@ -576,7 +576,7 @@ theorem exists_superset_card_eq [Infinite α] (s : Finset α) (n : ℕ) (hn : #s end Infinite /-- If every finset in a type has bounded cardinality, that type is finite. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfFinsetCardLe {ι : Type*} (n : ℕ) (w : ∀ s : Finset ι, #s ≤ n) : Fintype ι := by apply fintypeOfNotInfinite diff --git a/Mathlib/Data/Fintype/OfMap.lean b/Mathlib/Data/Fintype/OfMap.lean index 3ce4dfb8d64892..30f53d2f7f648b 100644 --- a/Mathlib/Data/Fintype/OfMap.lean +++ b/Mathlib/Data/Fintype/OfMap.lean @@ -37,24 +37,24 @@ open Finset namespace Fintype /-- Construct a proof of `Fintype α` from a universal multiset -/ -@[implicit_reducible] +@[instance_reducible] def ofMultiset [DecidableEq α] (s : Multiset α) (H : ∀ x : α, x ∈ s) : Fintype α := ⟨s.toFinset, by simpa using H⟩ /-- Construct a proof of `Fintype α` from a universal list -/ -@[implicit_reducible] +@[instance_reducible] def ofList [DecidableEq α] (l : List α) (H : ∀ x : α, x ∈ l) : Fintype α := ⟨l.toFinset, by simpa using H⟩ /-- If `f : α → β` is a bijection and `α` is a fintype, then `β` is also a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def ofBijective [Fintype α] (f : α → β) (H : Function.Bijective f) : Fintype β := ⟨univ.map ⟨f, H.1⟩, fun b => let ⟨_, e⟩ := H.2 b e ▸ mem_map_of_mem _ (mem_univ _)⟩ /-- If `f : α → β` is a surjection and `α` is a fintype, then `β` is also a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def ofSurjective [DecidableEq β] [Fintype α] (f : α → β) (H : Function.Surjective f) : Fintype β := ⟨univ.image f, fun b => let ⟨_, e⟩ := H b @@ -63,7 +63,7 @@ def ofSurjective [DecidableEq β] [Fintype α] (f : α → β) (H : Function.Sur /-- Given an injective function to a fintype, the domain is also a fintype. This is noncomputable because injectivity alone cannot be used to construct preimages. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofInjective [Fintype β] (f : α → β) (H : Function.Injective f) : Fintype α := letI := Classical.dec if hα : Nonempty α then @@ -72,12 +72,12 @@ noncomputable def ofInjective [Fintype β] (f : α → β) (H : Function.Injecti else ⟨∅, fun x => (hα ⟨x⟩).elim⟩ /-- If `f : α ≃ β` and `α` is a fintype, then `β` is also a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv (α : Type*) [Fintype α] (f : α ≃ β) : Fintype β := ofBijective _ f.bijective /-- Any subsingleton type with a witness is a fintype (with one term). -/ -@[implicit_reducible] +@[instance_reducible] def ofSubsingleton (a : α) [Subsingleton α] : Fintype α := ⟨{a}, fun _ => Finset.mem_singleton.2 (Subsingleton.elim _ _)⟩ @@ -88,7 +88,7 @@ theorem univ_ofSubsingleton (a : α) [Subsingleton α] : @univ _ (ofSubsingleton /-- An empty type is a fintype. Not registered as an instance, to make sure that there aren't two conflicting `Fintype ι` instances around when casing over whether a fintype `ι` is empty or not. -/ -@[implicit_reducible] +@[instance_reducible] def ofIsEmpty [IsEmpty α] : Fintype α := ⟨∅, isEmptyElim⟩ diff --git a/Mathlib/Data/Fintype/Option.lean b/Mathlib/Data/Fintype/Option.lean index 8fc9cd0d1c2da6..9c26723393dcda 100644 --- a/Mathlib/Data/Fintype/Option.lean +++ b/Mathlib/Data/Fintype/Option.lean @@ -42,13 +42,13 @@ theorem Fintype.card_option {α : Type*} [Fintype α] : (Finset.card_cons (by simp)).trans <| congr_arg₂ _ (card_map _) rfl /-- If `Option α` is a `Fintype` then so is `α` -/ -@[implicit_reducible] +@[instance_reducible] def fintypeOfOption {α : Type*} [Fintype (Option α)] : Fintype α := ⟨Finset.eraseNone (Fintype.elems (α := Option α)), fun x => mem_eraseNone.mpr (Fintype.complete (some x))⟩ /-- A type is a `Fintype` if its successor (using `Option`) is a `Fintype`. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeOfOptionEquiv [Fintype α] (f : α ≃ Option β) : Fintype β := haveI := Fintype.ofEquiv _ f fintypeOfOption diff --git a/Mathlib/Data/Fintype/Perm.lean b/Mathlib/Data/Fintype/Perm.lean index b95edc60fd9ac5..3ff1a1badcb1c0 100644 --- a/Mathlib/Data/Fintype/Perm.lean +++ b/Mathlib/Data/Fintype/Perm.lean @@ -121,6 +121,7 @@ theorem nodup_permsOfList : ∀ {l : List α}, l.Nodup → (permsOfList l).Nodup have hxa : x ≠ g.symm x := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx) exact (List.nodup_cons.1 hl).1 <| mem_of_mem_permsOfList hg.1 (by simpa using hxa) +set_option backward.isDefEq.respectTransparency false in /-- Given a finset, produce the finset of all permutations of its elements. -/ def permsOfFinset (s : Finset α) : Finset (Perm α) := Quotient.hrecOn s.1 (fun l hl => ⟨permsOfList l, nodup_permsOfList hl⟩) @@ -137,7 +138,7 @@ theorem card_perms_of_finset : ∀ s : Finset α, #(permsOfFinset s) = (#s)! := rintro ⟨⟨l⟩, hs⟩; exact length_permsOfList l /-- The collection of permutations of a fintype is a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def fintypePerm [Fintype α] : Fintype (Perm α) := ⟨permsOfFinset (@Finset.univ α _), by simp [mem_perms_of_finset_iff]⟩ diff --git a/Mathlib/Data/Fintype/Quotient.lean b/Mathlib/Data/Fintype/Quotient.lean index 8e49465af83b43..dd2be3dc1aa9a9 100644 --- a/Mathlib/Data/Fintype/Quotient.lean +++ b/Mathlib/Data/Fintype/Quotient.lean @@ -240,6 +240,7 @@ def finRecOn {C : (∀ i, Trunc (α i)) → Sort*} C q := Quotient.finRecOn q (f ·) (fun _ _ _ ↦ h _ _) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma finRecOn_mk {C : (∀ i, Trunc (α i)) → Sort*} (a : ∀ i, α i) : diff --git a/Mathlib/Data/Fintype/Sets.lean b/Mathlib/Data/Fintype/Sets.lean index ff1de4545097ef..8c7abba21cdb72 100644 --- a/Mathlib/Data/Fintype/Sets.lean +++ b/Mathlib/Data/Fintype/Sets.lean @@ -252,6 +252,7 @@ instance FinsetCoe.fintype (s : Finset α) : Fintype (↑s : Set α) := theorem Finset.attach_eq_univ {s : Finset α} : s.attach = Finset.univ := rfl +set_option backward.isDefEq.respectTransparency false in instance Prop.fintype : Fintype Prop := ⟨⟨{True, False}, by simp⟩, by simpa using em⟩ @@ -263,7 +264,7 @@ instance Subtype.fintype (p : α → Prop) [DecidablePred p] [Fintype α] : Fint Fintype.subtype (univ.filter p) (by simp) /-- A set on a fintype, when coerced to a type, is a fintype. -/ -@[implicit_reducible] +@[instance_reducible] def setFintype [Fintype α] (s : Set α) [DecidablePred (· ∈ s)] : Fintype s := Subtype.fintype fun x => x ∈ s @@ -282,6 +283,7 @@ noncomputable def finsetEquivSet : Finset α ≃ Set α where @[simp] lemma finsetEquivSet_apply (s : Finset α) : finsetEquivSet s = s := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma finsetEquivSet_symm_apply (s : Set α) [Fintype s] : finsetEquivSet.symm s = s.toFinset := by simp [finsetEquivSet] diff --git a/Mathlib/Data/Fintype/Sum.lean b/Mathlib/Data/Fintype/Sum.lean index 8cdff49ee8cfac..f81e74ea2f2cfc 100644 --- a/Mathlib/Data/Fintype/Sum.lean +++ b/Mathlib/Data/Fintype/Sum.lean @@ -65,7 +65,7 @@ theorem Fintype.card_sum [Fintype α] [Fintype β] : card_disjSum _ _ /-- If the subtype of all-but-one elements is a `Fintype` then the type itself is a `Fintype`. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeOfFintypeNe (a : α) (_ : Fintype { b // b ≠ a }) : Fintype α := Fintype.ofBijective (Sum.elim ((↑) : { b // b = a } → α) ((↑) : { b // b ≠ a } → α)) <| by classical exact (Equiv.sumCompl (· = a)).bijective diff --git a/Mathlib/Data/FunLike/Fintype.lean b/Mathlib/Data/FunLike/Fintype.lean index 1934baab8c283f..2435449f1e1318 100644 --- a/Mathlib/Data/FunLike/Fintype.lean +++ b/Mathlib/Data/FunLike/Fintype.lean @@ -41,7 +41,7 @@ This is not an instance because specific `DFunLike` types might have a better-su See also `DFunLike.finite`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def DFunLike.fintype [DecidableEq α] [Fintype α] [∀ i, Fintype (β i)] : Fintype F := Fintype.ofInjective _ DFunLike.coe_injective @@ -50,7 +50,7 @@ noncomputable def DFunLike.fintype [DecidableEq α] [Fintype α] [∀ i, Fintype Non-dependent version of `DFunLike.fintype` that might be easier to infer. This is not an instance because specific `FunLike` types might have a better-suited definition. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def FunLike.fintype [DecidableEq α] [Fintype α] [Fintype γ] : Fintype G := DFunLike.fintype G diff --git a/Mathlib/Data/Holor.lean b/Mathlib/Data/Holor.lean index 0e22f8fdc84e3d..1ba51ea15bd6f1 100644 --- a/Mathlib/Data/Holor.lean +++ b/Mathlib/Data/Holor.lean @@ -144,6 +144,7 @@ def assocRight : Holor α (ds₁ ++ ds₂ ++ ds₃) → Holor α (ds₁ ++ (ds def assocLeft : Holor α (ds₁ ++ (ds₂ ++ ds₃)) → Holor α (ds₁ ++ ds₂ ++ ds₃) := cast (congr_arg (Holor α) (append_assoc ds₁ ds₂ ds₃).symm) +set_option backward.isDefEq.respectTransparency false in theorem mul_assoc0 [Semigroup α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₃) : x ⊗ y ⊗ z = (x ⊗ (y ⊗ z)).assocLeft := funext fun t : HolorIndex (ds₁ ++ ds₂ ++ ds₃) => by @@ -171,6 +172,7 @@ nonrec theorem zero_mul {α : Type} [MulZeroClass α] (x : Holor α ds₂) : (0 nonrec theorem mul_zero {α : Type} [MulZeroClass α] (x : Holor α ds₁) : x ⊗ (0 : Holor α ds₂) = 0 := funext fun t => mul_zero (x (HolorIndex.take t)) +set_option backward.isDefEq.respectTransparency false in theorem mul_scalar_mul [Mul α] (x : Holor α []) (y : Holor α ds) : x ⊗ y = x ⟨[], Forall₂.nil⟩ • y := by simp +unfoldPartialApp [mul, SMul.smul, HolorIndex.take, HolorIndex.drop, @@ -203,6 +205,7 @@ theorem slice_eq (x : Holor α (d :: ds)) (y : Holor α (d :: ds)) (h : slice x _ = slice y i hid ⟨is, hisds⟩ := by rw [h] _ = y ⟨i :: is, _⟩ := congr_arg y (Subtype.ext rfl) +set_option backward.isDefEq.respectTransparency false in theorem slice_unitVec_mul [Semiring α] {i : ℕ} {j : ℕ} (hid : i < d) (x : Holor α ds) : slice (unitVec d j ⊗ x) i hid = if i = j then x else 0 := funext fun t : HolorIndex ds => diff --git a/Mathlib/Data/Int/Cast/Lemmas.lean b/Mathlib/Data/Int/Cast/Lemmas.lean index 5424d8197d4f5e..cb70fc85a314bd 100644 --- a/Mathlib/Data/Int/Cast/Lemmas.lean +++ b/Mathlib/Data/Int/Cast/Lemmas.lean @@ -81,7 +81,7 @@ variable [NonAssocRing α] variable (α) in /-- `coe : ℤ → α` as a `RingHom`. -/ -@[implicit_reducible] +@[instance_reducible] def castRingHom : ℤ →+* α where toFun := Int.cast map_zero' := cast_zero diff --git a/Mathlib/Data/Int/ConditionallyCompleteOrder.lean b/Mathlib/Data/Int/ConditionallyCompleteOrder.lean index 80503f26eb3e2a..f1b8ad3fea6b95 100644 --- a/Mathlib/Data/Int/ConditionallyCompleteOrder.lean +++ b/Mathlib/Data/Int/ConditionallyCompleteOrder.lean @@ -22,6 +22,7 @@ open Int noncomputable section +set_option backward.isDefEq.respectTransparency false in open scoped Classical in instance instConditionallyCompleteLinearOrder : ConditionallyCompleteLinearOrder ℤ where __ := instLinearOrder @@ -45,6 +46,7 @@ instance instConditionallyCompleteLinearOrder : ConditionallyCompleteLinearOrder namespace Int +set_option backward.isDefEq.respectTransparency false in theorem csSup_eq_greatestOfBdd {s : Set ℤ} [DecidablePred (· ∈ s)] (b : ℤ) (Hb : ∀ z ∈ s, z ≤ b) (Hinh : ∃ z : ℤ, z ∈ s) : sSup s = greatestOfBdd b Hb Hinh := by have : s.Nonempty ∧ BddAbove s := ⟨Hinh, b, Hb⟩ @@ -62,6 +64,7 @@ theorem csSup_of_not_bddAbove {s : Set ℤ} (h : ¬BddAbove s) : sSup s = 0 := @[deprecated (since := "2025-12-24")] alias csSup_of_not_bdd_above := csSup_of_not_bddAbove +set_option backward.isDefEq.respectTransparency false in theorem csInf_eq_leastOfBdd {s : Set ℤ} [DecidablePred (· ∈ s)] (b : ℤ) (Hb : ∀ z ∈ s, b ≤ z) (Hinh : ∃ z : ℤ, z ∈ s) : sInf s = leastOfBdd b Hb Hinh := by have : s.Nonempty ∧ BddBelow s := ⟨Hinh, b, Hb⟩ diff --git a/Mathlib/Data/Int/WithZero.lean b/Mathlib/Data/Int/WithZero.lean index 5bd61516eecf67..6b9c0ff9905f39 100644 --- a/Mathlib/Data/Int/WithZero.lean +++ b/Mathlib/Data/Int/WithZero.lean @@ -62,6 +62,7 @@ theorem toNNReal_pos_apply {e : ℝ≥0} (he : e ≠ 0) {x : ℤᵐ⁰} (hx : x toNNReal he x = 0 := by simp [toNNReal, hx] +set_option backward.isDefEq.respectTransparency false in theorem toNNReal_neg_apply {e : ℝ≥0} (he : e ≠ 0) {x : ℤᵐ⁰} (hx : x ≠ 0) : toNNReal he x = e ^ (WithZero.unzero hx).toAdd := by simp [toNNReal, hx] @@ -74,6 +75,7 @@ theorem toNNReal_ne_zero {e : ℝ≥0} {m : ℤᵐ⁰} (he : e ≠ 0) (hm : m theorem toNNReal_pos {e : ℝ≥0} {m : ℤᵐ⁰} (he : e ≠ 0) (hm : m ≠ 0) : 0 < toNNReal he m := lt_of_le_of_ne zero_le' (toNNReal_ne_zero he hm).symm +set_option backward.isDefEq.respectTransparency false in /-- The map `toNNReal` is strictly monotone whenever `1 < e`. -/ theorem toNNReal_strictMono {e : ℝ≥0} (he : 1 < e) : StrictMono (toNNReal he.ne_zero) := by diff --git a/Mathlib/Data/List/Cycle.lean b/Mathlib/Data/List/Cycle.lean index 05afb88727f8f8..25a557dc287a2c 100644 --- a/Mathlib/Data/List/Cycle.lean +++ b/Mathlib/Data/List/Cycle.lean @@ -660,6 +660,7 @@ def lists (s : Cycle α) : Multiset (List α) := theorem lists_coe (l : List α) : lists (l : Cycle α) = ↑l.cyclicPermutations := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mem_lists_iff_coe_eq {s : Cycle α} {l : List α} : l ∈ s.lists ↔ (l : Cycle α) = s := Quotient.inductionOn' s fun l => by diff --git a/Mathlib/Data/List/GetD.lean b/Mathlib/Data/List/GetD.lean index 79a0bd6ef01c46..3ec66caacee9ec 100644 --- a/Mathlib/Data/List/GetD.lean +++ b/Mathlib/Data/List/GetD.lean @@ -52,7 +52,7 @@ theorem getD_reverse {l : List α} (i) (h : i < length l) : /-- An empty list can always be decidably checked for the presence of an element. Not an instance because it would clash with `DecidableEq α`. -/ -@[implicit_reducible] +@[instance_reducible] def decidableGetDNilNe (a : α) : DecidablePred fun i : ℕ => getD ([] : List α) i a ≠ a := fun _ => isFalse fun H => H getD_nil diff --git a/Mathlib/Data/List/NodupEquivFin.lean b/Mathlib/Data/List/NodupEquivFin.lean index b83f749ef874f6..4f9d7d18d104e9 100644 --- a/Mathlib/Data/List/NodupEquivFin.lean +++ b/Mathlib/Data/List/NodupEquivFin.lean @@ -133,6 +133,7 @@ theorem sublist_of_orderEmbedding_getElem?_eq {l l' : List α} (f : ℕ ↪o ℕ rw [List.singleton_sublist, ← h, l'.getElem_take' _ (Nat.lt_succ_self _)] exact List.getElem_mem _ +set_option backward.isDefEq.respectTransparency.types false in /-- A `l : List α` is `Sublist l l'` for `l' : List α` iff there is `f`, an order-preserving embedding of `ℕ` into `ℕ` such that any element of `l` found at index `ix` can be found at index `f ix` in `l'`. diff --git a/Mathlib/Data/List/Rotate.lean b/Mathlib/Data/List/Rotate.lean index a1d807b280cad2..cccd7bf7284920 100644 --- a/Mathlib/Data/List/Rotate.lean +++ b/Mathlib/Data/List/Rotate.lean @@ -396,7 +396,7 @@ theorem IsRotated.eqv : Equivalence (@IsRotated α) := Equivalence.mk IsRotated.refl IsRotated.symm IsRotated.trans /-- The relation `List.IsRotated l l'` forms a `Setoid` of cycles. -/ -@[implicit_reducible] +@[instance_reducible] def IsRotated.setoid (α : Type*) : Setoid (List α) where r := IsRotated iseqv := IsRotated.eqv diff --git a/Mathlib/Data/Matrix/Basic.lean b/Mathlib/Data/Matrix/Basic.lean index fdb89e65825736..342baebb06d6c9 100644 --- a/Mathlib/Data/Matrix/Basic.lean +++ b/Mathlib/Data/Matrix/Basic.lean @@ -653,6 +653,7 @@ def mopMatrix {α} [Mul α] [AddCommMonoid α] : Matrix m m αᵐᵒᵖ ≃+* (M end RingEquiv +set_option backward.isDefEq.respectTransparency false in instance (α) [MulOne α] [AddCommMonoid α] [IsStablyFiniteRing α] : IsStablyFiniteRing αᵐᵒᵖ where isDedekindFiniteMonoid n := .of_injective (MonoidHom.mk ⟨RingEquiv.mopMatrix, by simp⟩ RingEquiv.mopMatrix.map_mul) (RingEquiv.injective _) diff --git a/Mathlib/Data/Matrix/Basis.lean b/Mathlib/Data/Matrix/Basis.lean index e150be477dc323..5c3b1f6b1c6d68 100644 --- a/Mathlib/Data/Matrix/Basis.lean +++ b/Mathlib/Data/Matrix/Basis.lean @@ -258,6 +258,7 @@ theorem liftLinear_apply (f : m → n → α →ₗ[R] β) (M : Matrix m n α) : simp [liftLinear, map_sum, LinearEquiv.congrLeft] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] theorem liftLinear_single (f : m → n → α →ₗ[R] β) (i : m) (j : n) (a : α) : liftLinear S f (Matrix.single i j a) = f i j a := by diff --git a/Mathlib/Data/Matrix/Block.lean b/Mathlib/Data/Matrix/Block.lean index 6b9a81d797763e..e6be70f2f30805 100644 --- a/Mathlib/Data/Matrix/Block.lean +++ b/Mathlib/Data/Matrix/Block.lean @@ -858,6 +858,7 @@ lemma Matrix.comp_toSquareBlock {b : m → α} variable [Zero R] [DecidableEq m] +set_option backward.isDefEq.respectTransparency false in lemma Matrix.comp_diagonal (d) : comp m m n n R (diagonal d) = (blockDiagonal d).reindex (.prodComm ..) (.prodComm ..) := by diff --git a/Mathlib/Data/Matrix/Cartan.lean b/Mathlib/Data/Matrix/Cartan.lean index deafc0acc08bcd..eac28be80f7fe6 100644 --- a/Mathlib/Data/Matrix/Cartan.lean +++ b/Mathlib/Data/Matrix/Cartan.lean @@ -272,6 +272,7 @@ proof_wanted E₈_det : E₈.det = 1 def _root_.Matrix.IsSimplyLaced {ι : Type*} (A : Matrix ι ι ℤ) : Prop := Pairwise fun i j ↦ A i j = 0 ∨ A i j = -1 +set_option backward.isDefEq.respectTransparency false in instance {ι : Type*} [Fintype ι] [DecidableEq ι] : DecidablePred (Matrix.IsSimplyLaced (ι := ι)) := inferInstanceAs <| DecidablePred fun A : Matrix ι ι ℤ ↦ ∀ ⦃i j : ι⦄, i ≠ j → (fun i j ↦ A i j = 0 ∨ A i j = -1) i j @@ -302,12 +303,15 @@ theorem isSimplyLaced_D (n : ℕ) : IsSimplyLaced (D n) := by simp only [D, of_apply] grind +set_option backward.isDefEq.respectTransparency false in theorem isSimplyLaced_E₆ : IsSimplyLaced E₆ := by rw [Matrix.isSimplyLaced_iff_of_linearOrder E₆ E₆_isSymm]; decide +set_option backward.isDefEq.respectTransparency false in theorem isSimplyLaced_E₇ : IsSimplyLaced E₇ := by rw [Matrix.isSimplyLaced_iff_of_linearOrder E₇ E₇_isSymm]; decide +set_option backward.isDefEq.respectTransparency false in theorem isSimplyLaced_E₈ : IsSimplyLaced E₈ := by rw [Matrix.isSimplyLaced_iff_of_linearOrder E₈ E₈_isSymm]; decide diff --git a/Mathlib/Data/Matrix/ColumnRowPartitioned.lean b/Mathlib/Data/Matrix/ColumnRowPartitioned.lean index a8a5d1df9f9d36..b4ef363c5412f2 100644 --- a/Mathlib/Data/Matrix/ColumnRowPartitioned.lean +++ b/Mathlib/Data/Matrix/ColumnRowPartitioned.lean @@ -189,6 +189,7 @@ lemma vecMul_fromCols [Fintype m] (B₁ : Matrix m n₁ R) (B₂ : Matrix m n₂ v ᵥ* fromCols B₁ B₂ = Sum.elim (v ᵥ* B₁) (v ᵥ* B₂) := by ext (_ | _) <;> rfl +set_option backward.isDefEq.respectTransparency false in lemma sumElim_vecMul_fromRows [Fintype m₁] [Fintype m₂] (B₁ : Matrix m₁ n R) (B₂ : Matrix m₂ n R) (v₁ : m₁ → R) (v₂ : m₂ → R) : Sum.elim v₁ v₂ ᵥ* fromRows B₁ B₂ = v₁ ᵥ* B₁ + v₂ ᵥ* B₂ := by diff --git a/Mathlib/Data/Matrix/Composition.lean b/Mathlib/Data/Matrix/Composition.lean index 779704cb57bfd1..ff6cffa09c5c68 100644 --- a/Mathlib/Data/Matrix/Composition.lean +++ b/Mathlib/Data/Matrix/Composition.lean @@ -41,6 +41,7 @@ def comp : Matrix I J (Matrix K L R) ≃ Matrix (I × K) (J × L) R where section Basic variable {R I J K L} +set_option backward.isDefEq.respectTransparency false in theorem comp_one [DecidableEq I] [DecidableEq J] [Zero R] [One R] : comp I I J J R 1 = 1 := by ext; simp only [comp, Equiv.coe_fn_mk, one_apply, apply_ite]; aesop diff --git a/Mathlib/Data/Matrix/DualNumber.lean b/Mathlib/Data/Matrix/DualNumber.lean index 38cf082d72fc1e..ba7d8136bcf062 100644 --- a/Mathlib/Data/Matrix/DualNumber.lean +++ b/Mathlib/Data/Matrix/DualNumber.lean @@ -22,6 +22,7 @@ variable {R n : Type} [CommSemiring R] [Fintype n] [DecidableEq n] open Matrix TrivSqZeroExt +set_option backward.isDefEq.respectTransparency false in /-- Matrices over dual numbers and dual numbers over matrices are isomorphic. -/ @[simps] def Matrix.dualNumberEquiv : Matrix n n (DualNumber R) ≃ₐ[R] DualNumber (Matrix n n R) where diff --git a/Mathlib/Data/Matrix/Invertible.lean b/Mathlib/Data/Matrix/Invertible.lean index 1ddc70e5caf5e9..781eb7326ddabf 100644 --- a/Mathlib/Data/Matrix/Invertible.lean +++ b/Mathlib/Data/Matrix/Invertible.lean @@ -89,7 +89,7 @@ instance invertibleConjTranspose [Invertible A] : Invertible Aᴴ := Invertible. lemma conjTranspose_invOf [Invertible A] [Invertible Aᴴ] : (⅟A)ᴴ = ⅟(Aᴴ) := star_invOf _ /-- A matrix is invertible if the conjugate transpose is invertible. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfInvertibleConjTranspose [Invertible Aᴴ] : Invertible A := by rw [← conjTranspose_conjTranspose A, ← star_eq_conjTranspose] infer_instance @@ -115,7 +115,7 @@ lemma transpose_invOf [Invertible A] [Invertible Aᵀ] : (⅟A)ᵀ = ⅟(Aᵀ) : convert! (rfl : _ = ⅟(Aᵀ)) /-- `Aᵀ` is invertible when `A` is. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfInvertibleTranspose [Invertible Aᵀ] : Invertible A where invOf := (⅟(Aᵀ))ᵀ invOf_mul_self := by rw [← transpose_one, ← mul_invOf_self Aᵀ, transpose_mul, transpose_transpose] @@ -187,7 +187,7 @@ lemma add_mul_mul_invOf_mul_eq_one' : abel /-- If matrices `A`, `C`, and `C⁻¹ + V * A⁻¹ * U` are invertible, then so is `A + U * C * V`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleAddMulMul : Invertible (A + U * C * V) where invOf := ⅟A - ⅟A * U * ⅟(⅟C + V * ⅟A * U) * V * ⅟A invOf_mul_self := add_mul_mul_invOf_mul_eq_one' _ _ _ _ @@ -231,7 +231,7 @@ lemma add_mul_mul_mul_invOf_eq_one' : simp only [Matrix.mul_assoc] /-- If matrices `A` and `C + C * V * A⁻¹ * U * C` are invertible, then so is `A + U * C * V`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleAddMulMul' : Invertible (A + U * C * V) where invOf := ⅟A - ⅟A * U * C * ⅟(C + C * V * ⅟A * U * C) * C * V * ⅟A invOf_mul_self := add_mul_mul_mul_invOf_eq_one' A U C V diff --git a/Mathlib/Data/Matrix/Mul.lean b/Mathlib/Data/Matrix/Mul.lean index 5cdb2a47f5e0a5..0521bb69ce552e 100644 --- a/Mathlib/Data/Matrix/Mul.lean +++ b/Mathlib/Data/Matrix/Mul.lean @@ -929,9 +929,11 @@ section NonAssocSemiring variable [NonAssocSemiring α] +set_option backward.isDefEq.respectTransparency false in theorem mulVec_one [Fintype n] (A : Matrix m n α) : A *ᵥ 1 = ∑ j, Aᵀ j := by ext; simp [mulVec, dotProduct] +set_option backward.isDefEq.respectTransparency false in theorem one_vecMul [Fintype m] (A : Matrix m n α) : 1 ᵥ* A = ∑ i, A i := by ext; simp [vecMul, dotProduct] diff --git a/Mathlib/Data/Matrix/PEquiv.lean b/Mathlib/Data/Matrix/PEquiv.lean index 62da4f09a7f69c..600815c340908a 100644 --- a/Mathlib/Data/Matrix/PEquiv.lean +++ b/Mathlib/Data/Matrix/PEquiv.lean @@ -156,6 +156,7 @@ theorem toMatrix_injective [DecidableEq n] [MulZeroOneClass α] [Nontrivial α] · use fi simp [hf.symm, Ne.symm hi] +set_option backward.isDefEq.respectTransparency false in theorem toMatrix_swap [DecidableEq n] [AddGroupWithOne α] (i j : n) : (Equiv.swap i j).toPEquiv.toMatrix = (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix + diff --git a/Mathlib/Data/Matrix/Reflection.lean b/Mathlib/Data/Matrix/Reflection.lean index 2c82f38918ffcc..0b8a9fec8e2d1e 100644 --- a/Mathlib/Data/Matrix/Reflection.lean +++ b/Mathlib/Data/Matrix/Reflection.lean @@ -91,6 +91,7 @@ def transposeᵣ : ∀ {m n}, Matrix (Fin m) (Fin n) α → Matrix (Fin n) (Fin | _, _ + 1, A => of <| vecCons (FinVec.map (fun v : Fin _ → α => v 0) A) (transposeᵣ (A.submatrix id Fin.succ)) +set_option backward.isDefEq.respectTransparency false in /-- This can be used to prove ```lean example (a b c d : α) : transpose !![a, b; c, d] = !![a, c; b, d] := (transposeᵣ_eq _).symm @@ -136,6 +137,7 @@ def mulᵣ [Mul α] [Add α] [Zero α] (A : Matrix (Fin l) (Fin m) α) (B : Matr Matrix (Fin l) (Fin n) α := of <| FinVec.map (fun v₁ => FinVec.map (fun v₂ => dotProductᵣ v₁ v₂) Bᵀ) A +set_option backward.isDefEq.respectTransparency false in /-- This can be used to prove ```lean example [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) : @@ -163,6 +165,7 @@ example [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b def mulVecᵣ [Mul α] [Add α] [Zero α] (A : Matrix (Fin l) (Fin m) α) (v : Fin m → α) : Fin l → α := FinVec.map (fun a => dotProductᵣ a v) A +set_option backward.isDefEq.respectTransparency false in /-- This can be used to prove ```lean example [NonUnitalNonAssocSemiring α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁ b₂ : α) : @@ -185,6 +188,7 @@ example [NonUnitalNonAssocSemiring α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁ b def vecMulᵣ [Mul α] [Add α] [Zero α] (v : Fin l → α) (A : Matrix (Fin l) (Fin m) α) : Fin m → α := FinVec.map (fun a => dotProductᵣ v a) Aᵀ +set_option backward.isDefEq.respectTransparency false in /-- This can be used to prove ```lean example [NonUnitalNonAssocSemiring α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁ b₂ : α) : diff --git a/Mathlib/Data/Multiset/Bind.lean b/Mathlib/Data/Multiset/Bind.lean index 7354530d689a16..b21eed395e23f8 100644 --- a/Mathlib/Data/Multiset/Bind.lean +++ b/Mathlib/Data/Multiset/Bind.lean @@ -342,6 +342,7 @@ variable {s t} protected theorem Nodup.product : Nodup s → Nodup t → Nodup (s ×ˢ t) := Quotient.inductionOn₂ s t fun l₁ l₂ d₁ d₂ => by simp [List.Nodup.product d₁ d₂] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma map_swap_product (s : Multiset α) (t : Multiset β) : (s ×ˢ t).map Prod.swap = t ×ˢ s := by induction s using Multiset.induction <;> simp_all diff --git a/Mathlib/Data/Multiset/Filter.lean b/Mathlib/Data/Multiset/Filter.lean index 4cbbb1ef3cc715..b921fe0cd5676c 100644 --- a/Mathlib/Data/Multiset/Filter.lean +++ b/Mathlib/Data/Multiset/Filter.lean @@ -414,11 +414,11 @@ for more discussion. @[simp] theorem map_count_True_eq_filter_card (s : Multiset α) (p : α → Prop) [DecidablePred p] : (s.map p).count True = card (s.filter p) := by - simp only [count_eq_card_filter_eq, filter_map, card_map, Function.id_comp, - eq_true_eq_id, Function.comp_apply] + simp only [count_eq_card_filter_eq, eq_iff_iff, true_iff, filter_map, comp_apply, card_map] section Map +set_option backward.isDefEq.respectTransparency false in lemma filter_attach' (s : Multiset α) (p : {a // a ∈ s} → Prop) [DecidableEq α] [DecidablePred p] : s.attach.filter p = @@ -426,8 +426,8 @@ lemma filter_attach' (s : Multiset α) (p : {a // a ∈ s} → Prop) [DecidableE classical refine Multiset.map_injective Subtype.val_injective ?_ rw [map_filter' _ Subtype.val_injective] - simp only [Function.comp, Subtype.exists, Subtype.map, - exists_and_right, exists_eq_right, attach_map_val, map_map, id] + simp only [Subtype.exists, exists_and_right, exists_eq_right, attach_map_val, Subtype.map, id, + map_map, comp] end Map diff --git a/Mathlib/Data/Multiset/Fintype.lean b/Mathlib/Data/Multiset/Fintype.lean index e447b437ff83b2..df4b500f571bd0 100644 --- a/Mathlib/Data/Multiset/Fintype.lean +++ b/Mathlib/Data/Multiset/Fintype.lean @@ -78,6 +78,7 @@ protected theorem exists_coe (p : m → Prop) : (∃ x : m, p x) ↔ ∃ (x : α) (i : Fin (m.count x)), p ⟨x, i⟩ := Sigma.exists +set_option backward.isDefEq.respectTransparency false in instance : Fintype { p : α × ℕ | p.2 < m.count p.1 } := Fintype.ofFinset (m.toFinset.disjiUnion @@ -194,6 +195,7 @@ theorem map_univ_comp_coe {β : Type*} (m : Multiset α) (f : α → β) : ((Finset.univ : Finset m).val.map (f ∘ (fun x : m ↦ (x : α)))) = m.map f := by rw [← Multiset.map_map, Multiset.map_univ_coe] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_univ {β : Type*} (m : Multiset α) (f : α → β) : ((Finset.univ : Finset m).val.map fun (x : m) ↦ f (x : α)) = m.map f := by @@ -242,6 +244,7 @@ instance : IsEmpty (0 : Multiset α) := Fintype.card_eq_zero_iff.mp (by simp) instance : IsEmpty (∅ : Multiset α) := Fintype.card_eq_zero_iff.mp (by simp) +set_option backward.isDefEq.respectTransparency false in /-- `v ::ₘ m` is equivalent to `Option m` by mapping one `v` to `none` and everything else to `m`. -/ diff --git a/Mathlib/Data/Multiset/Functor.lean b/Mathlib/Data/Multiset/Functor.lean index 8eebd63ab65db1..40e512c34cade4 100644 --- a/Mathlib/Data/Multiset/Functor.lean +++ b/Mathlib/Data/Multiset/Functor.lean @@ -95,6 +95,7 @@ theorem id_traverse {α : Type*} (x : Multiset α) : traverse (pure : α → Id induction x using Quotient.inductionOn simp [traverse] +set_option backward.isDefEq.respectTransparency false in theorem comp_traverse {G H : Type _ → Type _} [Applicative G] [Applicative H] [CommApplicative G] [CommApplicative H] {α β γ : Type _} (g : α → G β) (h : β → H γ) (x : Multiset α) : traverse (Comp.mk ∘ Functor.map h ∘ g) x = diff --git a/Mathlib/Data/Multiset/MapFold.lean b/Mathlib/Data/Multiset/MapFold.lean index f343e6abbee27c..5a5c1a67137aec 100644 --- a/Mathlib/Data/Multiset/MapFold.lean +++ b/Mathlib/Data/Multiset/MapFold.lean @@ -342,6 +342,7 @@ theorem attach_map_val' (s : Multiset α) (f : α → β) : (s.attach.map fun i theorem attach_map_val (s : Multiset α) : s.attach.map Subtype.val = s := (attach_map_val' _ _).trans s.map_id +set_option backward.isDefEq.respectTransparency false in theorem attach_cons (a : α) (m : Multiset α) : (a ::ₘ m).attach = ⟨a, mem_cons_self a m⟩ ::ₘ m.attach.map fun p => ⟨p.1, mem_cons_of_mem p.2⟩ := diff --git a/Mathlib/Data/Multiset/Powerset.lean b/Mathlib/Data/Multiset/Powerset.lean index ca861d006ad89e..09168113cb07a5 100644 --- a/Mathlib/Data/Multiset/Powerset.lean +++ b/Mathlib/Data/Multiset/Powerset.lean @@ -300,6 +300,7 @@ theorem powersetCard_self (s : Multiset α) : powersetCard s.card s = {s} := by | empty => simp | cons _ _ ih => simp [ih] +set_option backward.isDefEq.respectTransparency false in theorem powersetCard_map {β : Type*} (f : α → β) (n : ℕ) (s : Multiset α) : powersetCard n (s.map f) = (powersetCard n s).map (map f) := by induction s using Multiset.induction generalizing n with diff --git a/Mathlib/Data/NNRat/Defs.lean b/Mathlib/Data/NNRat/Defs.lean index 45c0f1a44c6012..776ba33529f3a0 100644 --- a/Mathlib/Data/NNRat/Defs.lean +++ b/Mathlib/Data/NNRat/Defs.lean @@ -253,6 +253,7 @@ theorem toNNRat_zero : toNNRat 0 = 0 := rfl @[simp] theorem toNNRat_one : toNNRat 1 = 1 := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toNNRat_pos : 0 < toNNRat q ↔ 0 < q := by simp [toNNRat, ← coe_lt_coe] @@ -262,10 +263,12 @@ theorem toNNRat_eq_zero : toNNRat q = 0 ↔ q ≤ 0 := by alias ⟨_, toNNRat_of_nonpos⟩ := toNNRat_eq_zero +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toNNRat_le_toNNRat_iff (hp : 0 ≤ p) : toNNRat q ≤ toNNRat p ↔ q ≤ p := by simp [← coe_le_coe, toNNRat, hp] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toNNRat_lt_toNNRat_iff' : toNNRat q < toNNRat p ↔ q < p ∧ 0 < p := by simp [← coe_lt_coe, toNNRat] @@ -276,6 +279,7 @@ theorem toNNRat_lt_toNNRat_iff (h : 0 < p) : toNNRat q < toNNRat p ↔ q < p := theorem toNNRat_lt_toNNRat_iff_of_nonneg (hq : 0 ≤ q) : toNNRat q < toNNRat p ↔ q < p := toNNRat_lt_toNNRat_iff'.trans ⟨And.left, fun h ↦ ⟨h, hq.trans_lt h⟩⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toNNRat_add (hq : 0 ≤ q) (hp : 0 ≤ p) : toNNRat (q + p) = toNNRat q + toNNRat p := NNRat.ext <| by simp [toNNRat, hq, hp, add_nonneg] @@ -299,6 +303,7 @@ theorem toNNRat_lt_iff_lt_coe {p : ℚ≥0} (hq : 0 ≤ q) : toNNRat q < p ↔ q theorem lt_toNNRat_iff_coe_lt {q : ℚ≥0} : q < toNNRat p ↔ ↑q < p := NNRat.gi.gc.lt_iff_lt +set_option backward.isDefEq.respectTransparency false in theorem toNNRat_mul (hp : 0 ≤ p) : toNNRat (p * q) = toNNRat p * toNNRat q := by rcases le_total 0 q with hq | hq · ext; simp [toNNRat, hp, hq, mul_nonneg] diff --git a/Mathlib/Data/Nat/Cast/Basic.lean b/Mathlib/Data/Nat/Cast/Basic.lean index 6e4afd091dc4ba..5a263f821b04ef 100644 --- a/Mathlib/Data/Nat/Cast/Basic.lean +++ b/Mathlib/Data/Nat/Cast/Basic.lean @@ -58,7 +58,7 @@ variable [NonAssocSemiring α] variable (α) in /-- `Nat.cast : ℕ → α` as a `RingHom` -/ -@[implicit_reducible] +@[instance_reducible] def castRingHom : ℕ →+* α := { castAddMonoidHom α with toFun := Nat.cast, map_one' := cast_one, map_mul' := cast_mul } diff --git a/Mathlib/Data/Nat/Choose/Multinomial.lean b/Mathlib/Data/Nat/Choose/Multinomial.lean index a9ed09a52cd00c..947f4244d3b8ff 100644 --- a/Mathlib/Data/Nat/Choose/Multinomial.lean +++ b/Mathlib/Data/Nat/Choose/Multinomial.lean @@ -264,6 +264,7 @@ variable [Semiring R] open scoped Function -- required for scoped `on` notation +set_option backward.isDefEq.respectTransparency false in -- TODO: Can we prove one of the following two from the other one? /-- The **multinomial theorem**. -/ lemma sum_pow_eq_sum_piAntidiag_of_commute (s : Finset α) (f : α → R) diff --git a/Mathlib/Data/Nat/Factorization/PrimePow.lean b/Mathlib/Data/Nat/Factorization/PrimePow.lean index 50d7b3f79a6823..b8246b11737b65 100644 --- a/Mathlib/Data/Nat/Factorization/PrimePow.lean +++ b/Mathlib/Data/Nat/Factorization/PrimePow.lean @@ -146,6 +146,7 @@ theorem Nat.mul_divisors_filter_prime_pow {a b : ℕ} (hab : a.Coprime b) : and_congr_left_iff, not_false_iff, Nat.mem_divisors, or_self_iff] apply hab.isPrimePow_dvd_mul +set_option backward.isDefEq.respectTransparency false in /-- The canonical equivalence between pairs `(p, k)` with `p` a prime and `k : ℕ` and the set of prime powers given by `(p, k) ↦ p^(k+1)`. -/ def Nat.Primes.prodNatEquiv : Nat.Primes × ℕ ≃ {n : ℕ // IsPrimePow n} where diff --git a/Mathlib/Data/Nat/Lattice.lean b/Mathlib/Data/Nat/Lattice.lean index 1c215c142aa6ef..9ffa4cc9738507 100644 --- a/Mathlib/Data/Nat/Lattice.lean +++ b/Mathlib/Data/Nat/Lattice.lean @@ -53,6 +53,7 @@ theorem sSup_of_not_bddAbove {s : Set ℕ} (h : ¬BddAbove s) : sSup s = 0 := lemma iSup_of_not_bddAbove {ι : Sort*} {f : ι → ℕ} (h : ¬ BddAbove (Set.range f)) : (⨆ i, f i : ℕ) = 0 := Nat.sSup_of_not_bddAbove h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem sInf_eq_zero {s : Set ℕ} : sInf s = 0 ↔ 0 ∈ s ∨ s = ∅ := by cases eq_empty_or_nonempty s with diff --git a/Mathlib/Data/Nat/Nth.lean b/Mathlib/Data/Nat/Nth.lean index 11e306887a5938..dc1a9f1689c9c4 100644 --- a/Mathlib/Data/Nat/Nth.lean +++ b/Mathlib/Data/Nat/Nth.lean @@ -235,6 +235,7 @@ theorem nth_zero : nth p 0 = sInf (setOf p) := by rw [nth_eq_sInf]; simp @[simp] theorem nth_zero_of_zero (h : p 0) : nth p 0 = 0 := by simp [nth_zero, h] +set_option backward.isDefEq.respectTransparency false in theorem nth_zero_of_exists [DecidablePred p] (h : ∃ n, p n) : nth p 0 = Nat.find h := by rw [nth_zero]; convert! Nat.sInf_def h diff --git a/Mathlib/Data/Nat/Totient.lean b/Mathlib/Data/Nat/Totient.lean index b49ccd4787777e..836bfd7490a0b9 100644 --- a/Mathlib/Data/Nat/Totient.lean +++ b/Mathlib/Data/Nat/Totient.lean @@ -55,7 +55,7 @@ theorem totient_eq_card_lt_and_coprime (n : ℕ) : φ n = Nat.card { m | m < n { toFun := fun m => ⟨m, by simpa only [Finset.mem_filter, Finset.mem_range] using! m.property⟩ invFun := fun m => ⟨m, by simpa only [Finset.mem_filter, Finset.mem_range] using! m.property⟩ left_inv := fun m => by simp only [Subtype.coe_eta] - right_inv := fun m => by simp only [Subtype.coe_eta] } + right_inv := fun m => by simp only } rw [totient_eq_card_coprime, card_congr e, card_eq_fintype_card, Fintype.card_coe] theorem totient_le (n : ℕ) : φ n ≤ n := @@ -235,6 +235,7 @@ theorem card_units_zmod_lt_sub_one {p : ℕ} (hp : 1 < p) [Fintype (ZMod p)ˣ] : rw [ZMod.card_units_eq_totient p] exact Nat.le_sub_one_of_lt (Nat.totient_lt p hp) +set_option backward.isDefEq.respectTransparency false in theorem prime_iff_card_units (p : ℕ) [Fintype (ZMod p)ˣ] : p.Prime ↔ Fintype.card (ZMod p)ˣ = p - 1 := by rcases eq_zero_or_neZero p with rfl | hp diff --git a/Mathlib/Data/Ordmap/Invariants.lean b/Mathlib/Data/Ordmap/Invariants.lean index eaa66d0a90a320..88e8f969e186aa 100644 --- a/Mathlib/Data/Ordmap/Invariants.lean +++ b/Mathlib/Data/Ordmap/Invariants.lean @@ -553,6 +553,7 @@ theorem dual_insert [LE α] [@Std.Total α (· ≤ ·)] [DecidableLE α] (x : α /-! ### `balance` properties -/ +set_option backward.isDefEq.respectTransparency false in theorem balance_eq_balance' {l x r} (hl : Balanced l) (hr : Balanced r) (sl : Sized l) (sr : Sized r) : @balance α l x r = balance' l x r := by obtain - | ⟨ls, ll, lx, lr⟩ := l diff --git a/Mathlib/Data/Ordmap/Ordset.lean b/Mathlib/Data/Ordmap/Ordset.lean index b3eef1d9dc8794..0b0671f9574e4a 100644 --- a/Mathlib/Data/Ordmap/Ordset.lean +++ b/Mathlib/Data/Ordmap/Ordset.lean @@ -387,6 +387,7 @@ theorem Valid'.eraseMax_aux {s l x r o₁ o₂} (H : Valid' o₁ (.node s l x r) rw [eraseMax, size_balanceL H.3.2.1 h.3 H.2.2.1 h.2 (Or.inr ⟨_, Or.inr e, H.3.1⟩)] rw [size_node, e]; rfl +set_option backward.isDefEq.respectTransparency false in theorem Valid'.eraseMin_aux {s l} {x : α} {r o₁ o₂} (H : Valid' o₁ (.node s l x r) o₂) : Valid' ↑(findMin' l x) (@eraseMin α (.node' l x r)) o₂ ∧ size (.node' l x r) = size (eraseMin (.node' l x r)) + 1 := by @@ -459,6 +460,7 @@ theorem Valid'.merge_aux₁ {o₁ o₂ ls ll lx lr rs rl rx rr t} · rw [e, add_right_comm]; rintro ⟨⟩ intro _ _; rw [e]; unfold delta at hr₂ ⊢; lia +set_option backward.isDefEq.respectTransparency false in theorem Valid'.merge_aux {l r o₁ o₂} (hl : Valid' o₁ l o₂) (hr : Valid' o₁ r o₂) (sep : l.All fun x => r.All fun y => x < y) : Valid' o₁ (@merge α l r) o₂ ∧ size (merge l r) = size l + size r := by diff --git a/Mathlib/Data/PEquiv.lean b/Mathlib/Data/PEquiv.lean index 60185b53dffc31..4621b286d77692 100644 --- a/Mathlib/Data/PEquiv.lean +++ b/Mathlib/Data/PEquiv.lean @@ -154,6 +154,7 @@ theorem trans_eq_none (f : α ≃. β) (g : β ≃. γ) (a : α) : theorem refl_trans (f : α ≃. β) : (PEquiv.refl α).trans f = f := by ext; dsimp [PEquiv.trans]; rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem trans_refl (f : α ≃. β) : f.trans (PEquiv.refl β) = f := by ext; dsimp [PEquiv.trans]; simp @@ -235,6 +236,7 @@ end OfSet theorem symm_trans_rev (f : α ≃. β) (g : β ≃. γ) : (f.trans g).symm = g.symm.trans f.symm := rfl +set_option backward.isDefEq.respectTransparency false in theorem self_trans_symm (f : α ≃. β) : f.trans f.symm = ofSet { a | (f a).isSome } := by ext dsimp [PEquiv.trans] diff --git a/Mathlib/Data/PFun.lean b/Mathlib/Data/PFun.lean index ac172bc651d0b5..aa1790226278c8 100644 --- a/Mathlib/Data/PFun.lean +++ b/Mathlib/Data/PFun.lean @@ -156,6 +156,7 @@ def ran (f : α →. β) : Set β := def restrict (f : α →. β) {p : Set α} (H : p ⊆ f.Dom) : α →. β := fun x => (f x).restrict (x ∈ p) (@H x) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mem_restrict {f : α →. β} {s : Set α} (h : s ⊆ f.Dom) (a : α) (b : β) : b ∈ f.restrict h a ↔ a ∈ s ∧ b ∈ f a := by simp [restrict] @@ -164,6 +165,7 @@ theorem mem_restrict {f : α →. β} {s : Set α} (h : s ⊆ f.Dom) (a : α) (b def res (f : α → β) (s : Set α) : α →. β := (PFun.lift f).restrict s.subset_univ +set_option backward.isDefEq.respectTransparency false in theorem mem_res (f : α → β) (s : Set α) (a : α) (b : β) : b ∈ res f s a ↔ a ∈ s ∧ f a = b := by simp [res, @eq_comm _ b] @@ -479,14 +481,17 @@ def comp (f : β →. γ) (g : α →. β) : α →. γ := fun a => (g a).bind f theorem comp_apply (f : β →. γ) (g : α →. β) (a : α) : f.comp g a = (g a).bind f := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem id_comp (f : α →. β) : (PFun.id β).comp f = f := ext fun _ _ => by simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem comp_id (f : α →. β) : f.comp (PFun.id α) = f := ext fun _ _ => by simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem dom_comp (f : β →. γ) (g : α →. β) : (f.comp g).Dom = g.preimage f.Dom := by ext @@ -508,6 +513,7 @@ theorem Part.bind_comp (f : β →. γ) (g : α →. β) (a : Part α) : theorem comp_assoc (f : γ →. δ) (g : β →. γ) (h : α →. β) : (f.comp g).comp h = f.comp (g.comp h) := ext fun _ _ => by simp only [comp_apply, Part.bind_comp] +set_option backward.isDefEq.respectTransparency false in -- This can't be `simp` theorem coe_comp (g : β → γ) (f : α → β) : ((g ∘ f : α → γ) : α →. γ) = (g : β →. γ).comp f := ext fun _ _ => by simp only [coe_val, comp_apply, Function.comp, Part.bind_some] @@ -560,6 +566,7 @@ theorem mem_prodMap {f : α →. γ} {g : β →. δ} {x : α × β} {y : γ × · simp only [prodMap, Part.mem_mk_iff, And.exists, Prod.ext_iff] · simp only [exists_and_left, exists_and_right, Membership.mem, Part.Mem] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem prodLift_fst_comp_snd_comp (f : α →. γ) (g : β →. δ) : prodLift (f.comp ((Prod.fst : α × β → α) : α × β →. α)) diff --git a/Mathlib/Data/PFunctor/Multivariate/Basic.lean b/Mathlib/Data/PFunctor/Multivariate/Basic.lean index 76e39bff9afce8..4264be645cc75a 100644 --- a/Mathlib/Data/PFunctor/Multivariate/Basic.lean +++ b/Mathlib/Data/PFunctor/Multivariate/Basic.lean @@ -137,6 +137,7 @@ theorem comp.get_mk (x : P (fun i => Q i α)) : comp.get (comp.mk x) = x := by theorem comp.mk_get (x : comp P Q α) : comp.mk (comp.get x) = x := by rfl +set_option backward.isDefEq.respectTransparency false in /- lifting predicates and relations -/ @@ -152,6 +153,7 @@ theorem liftP_iff {α : TypeVec n} (p : ∀ ⦃i⦄, α i → Prop) (x : P α) : use ⟨a, fun i j => ⟨f i j, pf i j⟩⟩ rw [xeq]; rfl +set_option backward.isDefEq.respectTransparency false in theorem liftP_iff' {α : TypeVec n} (p : ∀ ⦃i⦄, α i → Prop) (a : P.A) (f : P.B a ⟹ α) : @LiftP.{u} _ P.Obj _ α p ⟨a, f⟩ ↔ ∀ i x, p (f i x) := by simp only [liftP_iff]; constructor diff --git a/Mathlib/Data/PFunctor/Multivariate/M.lean b/Mathlib/Data/PFunctor/Multivariate/M.lean index 18d4c2a48b49c4..c10bcb9c5d9c6a 100644 --- a/Mathlib/Data/PFunctor/Multivariate/M.lean +++ b/Mathlib/Data/PFunctor/Multivariate/M.lean @@ -117,6 +117,7 @@ def castDropB {a a' : P.A} (h : a = a') : P.drop.B a ⟹ P.drop.B a' := fun _i b /-- Proof of type equality as a function -/ def castLastB {a a' : P.A} (h : a = a') : P.last.B a → P.last.B a' := fun b => Eq.recOn h b +set_option backward.isDefEq.respectTransparency false in /-- Using corecursion, construct the contents of an M-type -/ def M.corecContents {α : TypeVec.{u} n} {β : Type v} @@ -191,6 +192,7 @@ theorem M.dest_corec' {α : TypeVec.{u} n} {β : Type v} (g₀ : β → P.A) M.dest P (M.corec' P g₀ g₁ g₂ x) = ⟨g₀ x, splitFun (g₁ x) (M.corec' P g₀ g₁ g₂ ∘ g₂ x)⟩ := rfl +set_option backward.isDefEq.respectTransparency false in theorem M.dest_corec {α : TypeVec n} {β : Type u} (g : β → P (α.append1 β)) (x : β) : M.dest P (M.corec P g x) = appendFun id (M.corec P g) <$$> g x := by trans @@ -200,6 +202,7 @@ theorem M.dest_corec {α : TypeVec n} {β : Type u} (g : β → P (α.append1 β conv_rhs => rw [← split_dropFun_lastFun f, appendFun_comp_splitFun] rfl +set_option backward.isDefEq.respectTransparency false in theorem M.bisim_lemma {α : TypeVec n} {a₁ : (mp P).A} {f₁ : (mp P).B a₁ ⟹ α} {a' : P.A} {f' : (P.B a').drop ⟹ α} {f₁' : (P.B a').last → M P α} (e₁ : M.dest P ⟨a₁, f₁⟩ = ⟨a', splitFun f' f₁'⟩) : @@ -246,6 +249,7 @@ theorem M.bisim {α : TypeVec n} (R : P.M α → P.M α → Prop) | child x a f h' i c p IH => exact IH _ _ (h'' _) +set_option backward.isDefEq.respectTransparency false in theorem M.bisim₀ {α : TypeVec n} (R : P.M α → P.M α → Prop) (h₀ : Equivalence R) (h : ∀ x y, R x y → (id ::: Quot.mk R) <$$> M.dest _ x = (id ::: Quot.mk R) <$$> M.dest _ y) (x y) (r : R x y) : x = y := by diff --git a/Mathlib/Data/PFunctor/Multivariate/W.lean b/Mathlib/Data/PFunctor/Multivariate/W.lean index ad4f0e0c736dd9..fea39e1d7e2610 100644 --- a/Mathlib/Data/PFunctor/Multivariate/W.lean +++ b/Mathlib/Data/PFunctor/Multivariate/W.lean @@ -239,6 +239,7 @@ abbrev objAppend1 {α : TypeVec n} {β : Type u} (a : P.A) (f' : P.drop.B a ⟹ (f : P.last.B a → β) : P (α ::: β) := ⟨a, splitFun f' f⟩ +set_option backward.isDefEq.respectTransparency false in theorem map_objAppend1 {α γ : TypeVec n} (g : α ⟹ γ) (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) : appendFun g (P.wMap g) <$$> P.objAppend1 a f' f = @@ -260,9 +261,11 @@ def wMk' {α : TypeVec n} : P (α ::: P.W α) → P.W α def wDest' {α : TypeVec.{u} n} : P.W α → P (α.append1 (P.W α)) := P.wRec fun a f' f _ => ⟨a, splitFun f' f⟩ +set_option backward.isDefEq.respectTransparency false in theorem wDest'_wMk {α : TypeVec n} (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) : P.wDest' (P.wMk a f' f) = ⟨a, splitFun f' f⟩ := by rw [wDest', wRec_eq] +set_option backward.isDefEq.respectTransparency false in theorem wDest'_wMk' {α : TypeVec n} (x : P (α.append1 (P.W α))) : P.wDest' (P.wMk' x) = x := by obtain ⟨a, f⟩ := x; rw [wMk', wDest'_wMk, split_dropFun_lastFun] diff --git a/Mathlib/Data/PFunctor/Univariate/Basic.lean b/Mathlib/Data/PFunctor/Univariate/Basic.lean index 536ed9683b7150..ee6bef44b17a44 100644 --- a/Mathlib/Data/PFunctor/Univariate/Basic.lean +++ b/Mathlib/Data/PFunctor/Univariate/Basic.lean @@ -170,6 +170,7 @@ variable {P : PFunctor.{uA, uB}} open Functor +set_option backward.isDefEq.respectTransparency false in theorem liftp_iff {α : Type u} (p : α → Prop) (x : P α) : Liftp p x ↔ ∃ a f, x = ⟨a, f⟩ ∧ ∀ i, p (f i) := by constructor @@ -182,6 +183,7 @@ theorem liftp_iff {α : Type u} (p : α → Prop) (x : P α) : use ⟨a, fun i => ⟨f i, pf i⟩⟩ rw [xeq]; rfl +set_option backward.isDefEq.respectTransparency false in theorem liftp_iff' {α : Type u} (p : α → Prop) (a : P.A) (f : P.B a → α) : @Liftp.{u} P.Obj _ α p ⟨a, f⟩ ↔ ∀ i, p (f i) := by simp only [liftp_iff]; constructor <;> intro h diff --git a/Mathlib/Data/PFunctor/Univariate/M.lean b/Mathlib/Data/PFunctor/Univariate/M.lean index ed201bd32b8416..099adfe4d329ac 100644 --- a/Mathlib/Data/PFunctor/Univariate/M.lean +++ b/Mathlib/Data/PFunctor/Univariate/M.lean @@ -413,6 +413,7 @@ theorem head_mk (x : F (M F)) : head (M.mk x) = x.1 := x.1 = (dest (M.mk x)).1 := by rw [dest_mk] _ = head (M.mk x) := rfl +set_option backward.isDefEq.respectTransparency false in theorem children_mk {a} (x : F.B a → M F) (i : F.B (head (M.mk ⟨a, x⟩))) : children (M.mk ⟨a, x⟩) i = x (cast (by rw [head_mk]) i) := by apply ext'; intro n; rfl @@ -511,6 +512,7 @@ structure IsBisimulation : Prop where /-- The tails are equal -/ tail : ∀ {a} {f f' : F.B a → M F}, M.mk ⟨a, f⟩ ~ M.mk ⟨a, f'⟩ → ∀ i : F.B a, f i ~ f' i +set_option backward.isDefEq.respectTransparency false in theorem nth_of_bisim [Inhabited (M F)] [DecidableEq F.A] (bisim : IsBisimulation R) (s₁ s₂) (ps : Path F) : (R s₁ s₂) → @@ -566,6 +568,7 @@ variable {P : PFunctor.{uA, uB}} {α : Type*} theorem dest_corec (g : α → P α) (x : α) : M.dest (M.corec g x) = P.map (M.corec g) (g x) := by rw [corec_def, dest_mk] +set_option backward.isDefEq.respectTransparency false in theorem bisim (R : M P → M P → Prop) (h : ∀ x y, R x y → ∃ a f f', M.dest x = ⟨a, f⟩ ∧ M.dest y = ⟨a, f'⟩ ∧ ∀ i, R (f i) (f' i)) : ∀ x y, R x y → x = y := by diff --git a/Mathlib/Data/PNat/Basic.lean b/Mathlib/Data/PNat/Basic.lean index 9cef2a5e8a7b2d..583ecd30f57286 100644 --- a/Mathlib/Data/PNat/Basic.lean +++ b/Mathlib/Data/PNat/Basic.lean @@ -316,6 +316,7 @@ theorem mod_le (m k : ℕ+) : mod m k ≤ m ∧ mod m k ≤ k := by exact ⟨h₂, le_refl (k : ℕ)⟩ · exact ⟨Nat.mod_le (m : ℕ) (k : ℕ), (Nat.mod_lt (m : ℕ) k.pos).le⟩ +set_option backward.isDefEq.respectTransparency false in theorem dvd_iff {k m : ℕ+} : k ∣ m ↔ (k : ℕ) ∣ (m : ℕ) := by constructor <;> intro h · rcases h with ⟨_, rfl⟩ diff --git a/Mathlib/Data/PNat/Factors.lean b/Mathlib/Data/PNat/Factors.lean index 5c553ce6068c32..e35d35233de7c5 100644 --- a/Mathlib/Data/PNat/Factors.lean +++ b/Mathlib/Data/PNat/Factors.lean @@ -116,6 +116,7 @@ theorem coePNat_nat (v : PrimeMultiset) : ((v : Multiset ℕ+) : Multiset ℕ) = def prod (v : PrimeMultiset) : ℕ+ := (v : Multiset PNat).prod +set_option backward.isDefEq.respectTransparency false in theorem coe_prod (v : PrimeMultiset) : (v.prod : ℕ) = (v : Multiset ℕ).prod := by have h : (v.prod : ℕ) = ((v.map (↑) : Multiset ℕ+).map (↑)).prod := PNat.coeMonoidHom.map_multiset_prod v.toPNatMultiset @@ -128,6 +129,7 @@ theorem prod_ofPrime (p : Nat.Primes) : (ofPrime p).prod = (p : ℕ+) := def ofNatMultiset (v : Multiset ℕ) (h : ∀ p : ℕ, p ∈ v → p.Prime) : PrimeMultiset := @Multiset.pmap ℕ Nat.Primes Nat.Prime (fun p hp => ⟨p, hp⟩) v h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mem_ofNatMultiset {p : ℕ+} {s : Multiset ℕ} (hs) : p ∈ (ofNatMultiset s hs : Multiset ℕ+) ↔ (p : ℕ) ∈ s := by @@ -135,6 +137,7 @@ theorem mem_ofNatMultiset {p : ℕ+} {s : Multiset ℕ} (hs) : ← PNat.coe_inj] simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem to_ofNatMultiset (v : Multiset ℕ) (h) : (ofNatMultiset v h : Multiset ℕ) = v := by dsimp [ofNatMultiset, toNatMultiset] @@ -148,6 +151,7 @@ theorem prod_ofNatMultiset (v : Multiset ℕ) (h) : def ofPNatMultiset (v : Multiset ℕ+) (h : ∀ p : ℕ+, p ∈ v → p.Prime) : PrimeMultiset := @Multiset.pmap ℕ+ Nat.Primes PNat.Prime (fun p hp => ⟨(p : ℕ), hp⟩) v h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem to_ofPNatMultiset (v : Multiset ℕ+) (h) : (ofPNatMultiset v h : Multiset ℕ+) = v := by dsimp [ofPNatMultiset, toPNatMultiset] @@ -167,6 +171,7 @@ about how this interacts with our constructions on multisets. -/ def ofNatList (l : List ℕ) (h : ∀ p : ℕ, p ∈ l → p.Prime) : PrimeMultiset := ofNatMultiset (l : Multiset ℕ) h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mem_ofNatList {p : ℕ+} {l : List ℕ} (hl) : p ∈ (ofNatList l hl : Multiset ℕ+) ↔ (p : ℕ) ∈ l := by @@ -183,6 +188,7 @@ the coercion from lists to multisets. -/ def ofPNatList (l : List ℕ+) (h : ∀ p : ℕ+, p ∈ l → p.Prime) : PrimeMultiset := ofPNatMultiset (l : Multiset ℕ+) h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toPNatMultiset_ofPNatList {l : List ℕ+} (hl) : (ofPNatList l hl : Multiset ℕ+) = l := by simp [ofPNatList] @@ -239,6 +245,7 @@ end PNat namespace PrimeMultiset +set_option backward.isDefEq.respectTransparency false in /-- If we start with a multiset of primes, take the product and then factor it, we get back the original multiset. -/ @[simp] diff --git a/Mathlib/Data/PNat/Find.lean b/Mathlib/Data/PNat/Find.lean index 95d8d885c510da..8185ec6de99ec3 100644 --- a/Mathlib/Data/PNat/Find.lean +++ b/Mathlib/Data/PNat/Find.lean @@ -22,6 +22,7 @@ namespace PNat variable {p q : ℕ+ → Prop} [DecidablePred p] [DecidablePred q] (h : ∃ n, p n) +set_option backward.isDefEq.respectTransparency false in instance decidablePredExistsNat : DecidablePred fun n' : ℕ => ∃ (n : ℕ+) (_ : n' = n), p n := fun n' => decidable_of_iff' (∃ h : 0 < n', p ⟨n', h⟩) <| diff --git a/Mathlib/Data/PNat/Interval.lean b/Mathlib/Data/PNat/Interval.lean index cfd0da464606a9..a7c741d2582014 100644 --- a/Mathlib/Data/PNat/Interval.lean +++ b/Mathlib/Data/PNat/Interval.lean @@ -81,18 +81,23 @@ set_option backward.isDefEq.respectTransparency false in theorem card_uIcc : #(uIcc a b) = (b - a : ℤ).natAbs + 1 := by rw [← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map] +set_option backward.isDefEq.respectTransparency false in theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = b + 1 - a := by rw [← card_Icc, Fintype.card_ofFinset] +set_option backward.isDefEq.respectTransparency false in theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a := by rw [← card_Ico, Fintype.card_ofFinset] +set_option backward.isDefEq.respectTransparency false in theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = b - a := by rw [← card_Ioc, Fintype.card_ofFinset] +set_option backward.isDefEq.respectTransparency false in theorem card_fintype_Ioo : Fintype.card (Set.Ioo a b) = b - a - 1 := by rw [← card_Ioo, Fintype.card_ofFinset] +set_option backward.isDefEq.respectTransparency false in theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a : ℤ).natAbs + 1 := by rw [← card_uIcc, Fintype.card_ofFinset] diff --git a/Mathlib/Data/PNat/Prime.lean b/Mathlib/Data/PNat/Prime.lean index 25d7addd95f1ba..24daab82f83604 100644 --- a/Mathlib/Data/PNat/Prime.lean +++ b/Mathlib/Data/PNat/Prime.lean @@ -143,6 +143,7 @@ theorem Prime.not_dvd_one {p : ℕ+} : p.Prime → ¬p ∣ 1 := fun pp : p.Prime rw [dvd_iff] apply Nat.Prime.not_dvd_one pp +set_option backward.isDefEq.respectTransparency false in theorem exists_prime_and_dvd {n : ℕ+} (hn : n ≠ 1) : ∃ p : ℕ+, p.Prime ∧ p ∣ n := by obtain ⟨p, hp⟩ := Nat.exists_prime_and_dvd (mt coe_eq_one_iff.mp hn) exists (⟨p, Nat.Prime.pos hp.left⟩ : ℕ+); rw [dvd_iff]; apply hp diff --git a/Mathlib/Data/PNat/Xgcd.lean b/Mathlib/Data/PNat/Xgcd.lean index 50e8f38e63f284..2ed35dc2c80789 100644 --- a/Mathlib/Data/PNat/Xgcd.lean +++ b/Mathlib/Data/PNat/Xgcd.lean @@ -135,6 +135,7 @@ def IsSpecial : Prop := def IsSpecial' : Prop := u.w * u.z = succPNat (u.x * u.y) +set_option backward.isDefEq.respectTransparency false in theorem isSpecial_iff : u.IsSpecial ↔ u.IsSpecial' := by dsimp [IsSpecial, IsSpecial'] let ⟨wp, x, y, zp, ap, bp⟩ := u diff --git a/Mathlib/Data/Part.lean b/Mathlib/Data/Part.lean index 43f8168da87f14..c993ad28abf834 100644 --- a/Mathlib/Data/Part.lean +++ b/Mathlib/Data/Part.lean @@ -497,10 +497,10 @@ instance : LawfulMonad map_const := by simp [Functor.mapConst, Functor.map] --Porting TODO : In Lean3 these were automatic by a tactic seqLeft_eq x y := ext' - (by simp [SeqLeft.seqLeft, Part.bind, assert, Seq.seq, const, (· <$> ·), and_comm]) + (by simp [SeqLeft.seqLeft, Part.bind, assert, Seq.seq, (· <$> ·), and_comm]) (fun _ _ => rfl) seqRight_eq x y := ext' - (by simp [SeqRight.seqRight, Part.bind, assert, Seq.seq, const, (· <$> ·)]) + (by simp [SeqRight.seqRight, Part.bind, assert, Seq.seq, (· <$> ·)]) (fun _ _ => rfl) pure_seq x y := ext' (by simp [Seq.seq, Part.bind, assert, (· <$> ·), pure]) diff --git a/Mathlib/Data/QPF/Multivariate/Basic.lean b/Mathlib/Data/QPF/Multivariate/Basic.lean index 07695fc6ffe451..1deb05fd27c844 100644 --- a/Mathlib/Data/QPF/Multivariate/Basic.lean +++ b/Mathlib/Data/QPF/Multivariate/Basic.lean @@ -119,6 +119,7 @@ instance (priority := 100) lawfulMvFunctor : LawfulMvFunctor F where id_map := @MvQPF.id_map n F _ comp_map := @comp_map n F _ +set_option backward.isDefEq.respectTransparency false in -- Lifting predicates and relations theorem liftP_iff {α : TypeVec n} (p : ∀ ⦃i⦄, α i → Prop) (x : F α) : LiftP p x ↔ ∃ a f, x = abs ⟨a, f⟩ ∧ ∀ i j, p (f i j) := by @@ -134,6 +135,7 @@ theorem liftP_iff {α : TypeVec n} (p : ∀ ⦃i⦄, α i → Prop) (x : F α) : use abs ⟨a, fun i j => ⟨f i j, h₁ i j⟩⟩ rw [← abs_map, h₀]; rfl +set_option backward.isDefEq.respectTransparency false in theorem liftR_iff {α : TypeVec n} (r : ∀ ⦃i⦄, α i → α i → Prop) (x y : F α) : LiftR r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i j, r (f₀ i j) (f₁ i j) := by constructor @@ -169,6 +171,7 @@ theorem mem_supp {α : TypeVec n} (x : F α) (i) (u : α i) : theorem supp_eq {α : TypeVec n} {i} (x : F α) : supp x i = { u | ∀ a f, abs ⟨a, f⟩ = x → u ∈ f i '' univ } := by ext; apply mem_supp +set_option backward.isDefEq.respectTransparency false in theorem has_good_supp_iff {α : TypeVec n} (x : F α) : (∀ p, LiftP p x ↔ ∀ (i), ∀ u ∈ supp x i, p i u) ↔ ∃ a f, abs ⟨a, f⟩ = x ∧ ∀ i a' f', abs ⟨a', f'⟩ = x → f i '' univ ⊆ f' i '' univ := by @@ -230,12 +233,14 @@ theorem liftP_iff_of_isUniform (h : q.IsUniform) {α : TypeVec n} (x : F α) (p rw [supp_eq_of_isUniform h] exact ⟨i, mem_univ i, rfl⟩ +set_option backward.isDefEq.respectTransparency false in theorem supp_map (h : q.IsUniform) {α β : TypeVec n} (g : α ⟹ β) (x : F α) (i) : supp (g <$$> x) i = g i '' supp x i := by rw [← abs_repr x]; obtain ⟨a, f⟩ := repr x; rw [← abs_map, MvPFunctor.map_eq] rw [supp_eq_of_isUniform h, supp_eq_of_isUniform h, ← image_comp] rfl +set_option backward.isDefEq.respectTransparency false in theorem suppPreservation_iff_isUniform : q.SuppPreservation ↔ q.IsUniform := by constructor · intro h α a a' f f' h' i @@ -244,6 +249,7 @@ theorem suppPreservation_iff_isUniform : q.SuppPreservation ↔ q.IsUniform := b ext rwa [supp_eq_of_isUniform, MvPFunctor.supp_eq] +set_option backward.isDefEq.respectTransparency false in theorem suppPreservation_iff_liftpPreservation : q.SuppPreservation ↔ q.LiftPPreservation := by constructor <;> intro h · rintro α p ⟨a, f⟩ @@ -264,7 +270,7 @@ theorem liftpPreservation_iff_uniform : q.LiftPPreservation ↔ q.IsUniform := b set_option linter.style.whitespace false in -- manual alignment is not recognised /-- Any type function `F` that is (extensionally) equivalent to a QPF, is itself a QPF, assuming that the functorial map of `F` behaves similar to `MvFunctor.ofEquiv eqv` -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv {F F' : TypeVec.{u} n → Type*} [q : MvQPF F'] [MvFunctor F] (eqv : ∀ α, F α ≃ F' α) (map_eq : ∀ (α β : TypeVec n) (f : α ⟹ β) (a : F α), diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean index 55f0f8ac5728be..ce814602d36fd3 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Cofix.lean @@ -164,6 +164,7 @@ def Cofix.corec₁ {α : TypeVec n} {β : Type u} (g : ∀ {X}, (Cofix F α → X) → (β → X) → β → F (α ::: X)) (x : β) : Cofix F α := Cofix.corec' (fun x => g Sum.inl Sum.inr x) x +set_option backward.isDefEq.respectTransparency false in theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) : Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by conv => @@ -192,6 +193,7 @@ A bisimulation relation `R` for values `x y : Cofix F α`: -/ +set_option backward.isDefEq.respectTransparency false in private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x) (h : ∀ x y, r x y → appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) : @@ -397,6 +399,7 @@ end LiftRMap variable {F : TypeVec (n + 1) → Type u} [q : MvQPF F] +set_option backward.isDefEq.respectTransparency false in theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by let R := fun x y : Cofix F α => abs (repr y) = x refine Cofix.bisim₂ R ?_ _ _ rfl diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean index 94e05c04a5c13e..93bab0b692c8ce 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Comp.lean @@ -71,6 +71,7 @@ theorem get_map (x : Comp F G α) : end +set_option backward.isDefEq.respectTransparency false in instance [MvQPF F] [∀ i, MvQPF <| G i] : MvQPF (Comp F G) where P := MvPFunctor.comp (P F) fun i ↦ P <| G i abs := Comp.mk ∘ (map fun _ ↦ abs) ∘ abs ∘ MvPFunctor.comp.get diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean index 9747c992028db5..9426b4aaae015c 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean @@ -84,6 +84,7 @@ inductive WEquiv {α : TypeVec n} : q.P.W α → q.P.W α → Prop WEquiv (q.P.wMk a₀ f'₀ f₀) (q.P.wMk a₁ f'₁ f₁) | trans (u v w : q.P.W α) : WEquiv u v → WEquiv v w → WEquiv u w +set_option backward.isDefEq.respectTransparency false in theorem recF_eq_of_wEquiv (α : TypeVec n) {β : Type u} (u : F (α.append1 β) → β) (x y : q.P.W α) : WEquiv x y → recF u x = recF u y := by induction x using q.P.wCases @@ -192,6 +193,7 @@ def Fix.mk (x : F (append1 α (Fix F α))) : Fix F α := def Fix.dest : Fix F α → F (append1 α (Fix F α)) := Fix.rec (MvFunctor.map (appendFun id Fix.mk)) +set_option backward.isDefEq.respectTransparency false in theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1 α (Fix F α))) : Fix.rec g (Fix.mk x) = g (appendFun id (Fix.rec g) <$$> x) := by have : recF g ∘ fixToW = Fix.rec g := by @@ -208,6 +210,7 @@ theorem Fix.rec_eq {β : Type u} (g : F (append1 α β) → β) (x : F (append1 rw [MvPFunctor.map_eq, recF_eq', ← MvPFunctor.map_eq, MvPFunctor.wDest'_wMk'] rw [← MvPFunctor.comp_map, abs_map, ← h, abs_repr, ← appendFun_comp, id_comp, this] +set_option backward.isDefEq.respectTransparency false in theorem Fix.ind_aux (a : q.P.A) (f' : q.P.drop.B a ⟹ α) (f : q.P.last.B a → q.P.W α) : Fix.mk (abs ⟨a, q.P.appendContents f' fun x => ⟦f x⟧⟩) = ⟦q.P.wMk a f' f⟧ := by have : Fix.mk (abs ⟨a, q.P.appendContents f' fun x => ⟦f x⟧⟩) = ⟦wrepr (q.P.wMk a f' f)⟧ := by diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean index 3fff9c46592de7..f015577fd3dbe0 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Quot.lean @@ -37,7 +37,7 @@ variable {FG_repr : ∀ {α}, G α → F α} /-- If `F` is a QPF then `G` is a QPF as well. Can be used to construct `MvQPF` instances by transporting them across surjective functions -/ -@[implicit_reducible] +@[instance_reducible] def quotientQPF (FG_abs_repr : ∀ {α} (x : G α), FG_abs (FG_repr x) = x) (FG_abs_map : ∀ {α β} (f : α ⟹ β) (x : F α), FG_abs (f <$$> x) = f <$$> FG_abs x) : MvQPF G where @@ -69,7 +69,7 @@ def Quot1.map ⦃α β⦄ (f : α ⟹ β) : Quot1.{u} R α → Quot1.{u} R β := Quot.lift (fun x : F α => Quot.mk _ (f <$$> x : F β)) fun a b h => Quot.sound <| Hfunc a b _ h /-- `mvFunctor` instance for `Quot1` with well-behaved `R` -/ -@[implicit_reducible] +@[instance_reducible] def Quot1.mvFunctor : MvFunctor (Quot1 R) where map := @Quot1.map _ _ R _ Hfunc end @@ -79,7 +79,7 @@ section variable [q : MvQPF F] (Hfunc : ∀ ⦃α β⦄ (a b : F α) (f : α ⟹ β), R a b → R (f <$$> a) (f <$$> b)) /-- `Quot1` is a QPF -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def relQuot : @MvQPF _ (Quot1 R) := @quotientQPF n F q _ (MvQPF.Quot1.mvFunctor R Hfunc) (fun x => Quot.mk _ x) Quot.out (fun _x => Quot.out_eq _) fun _f _x => rfl diff --git a/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean b/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean index f2a256ebff7647..d7f2fc072a9ec4 100644 --- a/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean +++ b/Mathlib/Data/QPF/Multivariate/Constructions/Sigma.lean @@ -91,6 +91,7 @@ protected def abs ⦃α⦄ : Pi.P F α → Pi F α protected def repr ⦃α⦄ : Pi F α → Pi.P F α | f => ⟨fun a => (MvQPF.repr (f a)).1, fun _i a => (MvQPF.repr (f _)).2 _ a.2⟩ +set_option backward.isDefEq.respectTransparency false in instance : MvQPF (Pi F) where P := Pi.P F abs := @Pi.abs _ _ F _ diff --git a/Mathlib/Data/QPF/Univariate/Basic.lean b/Mathlib/Data/QPF/Univariate/Basic.lean index 86ffd37c8f889c..f5dfdfdb724c04 100644 --- a/Mathlib/Data/QPF/Univariate/Basic.lean +++ b/Mathlib/Data/QPF/Univariate/Basic.lean @@ -63,6 +63,7 @@ variable {F : Type u → Type v} [q : QPF F] open Functor (Liftp Liftr) +set_option backward.isDefEq.respectTransparency false in /- Show that every qpf is a lawful functor. @@ -95,6 +96,7 @@ section open Functor +set_option backward.isDefEq.respectTransparency false in theorem liftp_iff {α : Type u} (p : α → Prop) (x : F α) : Liftp p x ↔ ∃ a f, x = abs ⟨a, f⟩ ∧ ∀ i, p (f i) := by constructor @@ -110,6 +112,7 @@ theorem liftp_iff {α : Type u} (p : α → Prop) (x : F α) : use abs ⟨a, fun i => ⟨f i, h₁ i⟩⟩ rw [← abs_map, h₀]; rfl +set_option backward.isDefEq.respectTransparency false in theorem liftp_iff' {α : Type u} (p : α → Prop) (x : F α) : Liftp p x ↔ ∃ u : q.P α, abs u = x ∧ ∀ i, p (u.snd i) := by constructor @@ -126,6 +129,7 @@ theorem liftp_iff' {α : Type u} (p : α → Prop) (x : F α) : use abs ⟨a, fun i => ⟨f i, h₁ i⟩⟩ rw [← abs_map, ← h₀]; rfl +set_option backward.isDefEq.respectTransparency false in theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : F α) : Liftr r x y ↔ ∃ a f₀ f₁, x = abs ⟨a, f₀⟩ ∧ y = abs ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i) := by constructor @@ -174,6 +178,7 @@ inductive Wequiv : q.P.W → q.P.W → Prop abs ⟨a, f⟩ = abs ⟨a', f'⟩ → Wequiv ⟨a, f⟩ ⟨a', f'⟩ | trans (u v w : q.P.W) : Wequiv u v → Wequiv v w → Wequiv u w +set_option backward.isDefEq.respectTransparency false in /-- `recF` is insensitive to the representation -/ theorem recF_eq_of_Wequiv {α : Type u} (u : F α → α) (x y : q.P.W) : Wequiv x y → recF u x = recF u y := by @@ -242,6 +247,7 @@ def Fix.mk (x : F (Fix F)) : Fix F := def Fix.dest : Fix F → F (Fix F) := Fix.rec (Functor.map Fix.mk) +set_option backward.isDefEq.respectTransparency false in theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) : Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by have : recF g ∘ fixToW = Fix.rec g := by @@ -257,6 +263,7 @@ theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) : rw [PFunctor.map_eq, recF_eq, ← PFunctor.map_eq, PFunctor.W.dest_mk, PFunctor.map_map, abs_map, ← h, abs_repr, this] +set_option backward.isDefEq.respectTransparency false in theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by @@ -268,6 +275,7 @@ theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) : apply Quot.sound apply Wrepr_equiv +set_option backward.isDefEq.respectTransparency false in theorem Fix.ind_rec {α : Type u} (g₁ g₂ : Fix F → α) (h : ∀ x : F (Fix F), g₁ <$> x = g₂ <$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) : ∀ x, g₁ x = g₂ x := by @@ -365,6 +373,7 @@ def Cofix.dest : Cofix F → F (Cofix F) := lhs rw [comp_map, ← abs_map, pr rxy, abs_map, ← comp_map]) +set_option backward.isDefEq.respectTransparency false in theorem Cofix.dest_corec {α : Type u} (g : α → F α) (x : α) : Cofix.dest (Cofix.corec g x) = Cofix.corec g <$> g x := by conv => @@ -373,6 +382,7 @@ theorem Cofix.dest_corec {α : Type u} (g : α → F α) (x : α) : dsimp rw [corecF_eq, abs_map, abs_repr, ← comp_map]; rfl +set_option backward.isDefEq.respectTransparency false in private theorem Cofix.bisim_aux (r : Cofix F → Cofix F → Prop) (h' : ∀ x, r x x) (h : ∀ x y, r x y → Quot.mk r <$> Cofix.dest x = Quot.mk r <$> Cofix.dest y) : ∀ x y, r x y → x = y := by @@ -420,6 +430,7 @@ theorem Cofix.bisim_rel (r : Cofix F → Cofix F → Prop) rw [h _ _ r'xy] right; exact rxy +set_option backward.isDefEq.respectTransparency false in theorem Cofix.bisim (r : Cofix F → Cofix F → Prop) (h : ∀ x y, r x y → Liftr r (Cofix.dest x) (Cofix.dest y)) : ∀ x y, r x y → x = y := by apply Cofix.bisim_rel @@ -452,8 +463,9 @@ namespace QPF variable {F₂ : Type u → Type u} [q₂ : QPF F₂] variable {F₁ : Type u → Type u} [q₁ : QPF F₁] +set_option backward.isDefEq.respectTransparency false in /-- composition of qpfs gives another qpf -/ -@[implicit_reducible] +@[instance_reducible] def comp : QPF (Functor.Comp F₂ F₁) where P := PFunctor.comp q₂.P q₁.P abs {α} := by @@ -513,7 +525,7 @@ variable {FG_repr : ∀ {α}, G α → F α} functor `G α`, `G` is a qpf. We can consider `G` a quotient on `F` where elements `x y : F α` are in the same equivalence class if `FG_abs x = FG_abs y`. -/ -@[implicit_reducible] +@[instance_reducible] def quotientQPF (FG_abs_repr : ∀ {α} (x : G α), FG_abs (FG_repr x) = x) (FG_abs_map : ∀ {α β} (f : α → β) (x : F α), FG_abs (f <$> x) = f <$> FG_abs x) : QPF G where P := q.P @@ -614,11 +626,13 @@ theorem liftp_iff_of_isUniform (h : q.IsUniform) {α : Type u} (x : F α) (p : rw [supp_eq_of_isUniform h] exact ⟨i, mem_univ i, rfl⟩ +set_option backward.isDefEq.respectTransparency false in theorem supp_map (h : q.IsUniform) {α β : Type u} (g : α → β) (x : F α) : supp (g <$> x) = g '' supp x := by rw [← abs_repr x]; obtain ⟨a, f⟩ := repr x; rw [← abs_map, PFunctor.map_eq] rw [supp_eq_of_isUniform h, supp_eq_of_isUniform h, image_comp] +set_option backward.isDefEq.respectTransparency false in theorem suppPreservation_iff_uniform : q.SuppPreservation ↔ q.IsUniform := by constructor · intro h α a a' f f' h' @@ -626,6 +640,7 @@ theorem suppPreservation_iff_uniform : q.SuppPreservation ↔ q.IsUniform := by · rintro h α ⟨a, f⟩ rwa [supp_eq_of_isUniform, PFunctor.supp_eq] +set_option backward.isDefEq.respectTransparency false in theorem suppPreservation_iff_liftpPreservation : q.SuppPreservation ↔ q.LiftpPreservation := by constructor <;> intro h · rintro α p ⟨a, f⟩ diff --git a/Mathlib/Data/Quot.lean b/Mathlib/Data/Quot.lean index 6276672bffea6b..6b58acd862e270 100644 --- a/Mathlib/Data/Quot.lean +++ b/Mathlib/Data/Quot.lean @@ -455,7 +455,7 @@ theorem true_equivalence : @Equivalence α fun _ _ ↦ True := /-- Always-true relation as a `Setoid`. Note that in later files the preferred spelling is `⊤ : Setoid α`. -/ -@[implicit_reducible] +@[instance_reducible] def trueSetoid : Setoid α := ⟨_, true_equivalence⟩ diff --git a/Mathlib/Data/Rat/Cast/Defs.lean b/Mathlib/Data/Rat/Cast/Defs.lean index a7d30f76b99d40..b853ac3c91fb5f 100644 --- a/Mathlib/Data/Rat/Cast/Defs.lean +++ b/Mathlib/Data/Rat/Cast/Defs.lean @@ -50,6 +50,7 @@ lemma commute_cast (a : α) (q : ℚ≥0) : Commute a q := (cast_commute ..).sym lemma cast_comm (q : ℚ≥0) (a : α) : q * a = a * q := cast_commute _ _ +set_option backward.isDefEq.respectTransparency false in @[norm_cast] lemma cast_divNat_of_ne_zero (a : ℕ) {b : ℕ} (hb : (b : α) ≠ 0) : divNat a b = (a / b : α) := by rcases e : divNat a b with ⟨⟨n, d, h, c⟩, hn⟩ @@ -175,6 +176,7 @@ lemma cast_add_of_ne_zero {q r : ℚ} (hq : (q.den : α) ≠ 0) (hr : (r.den : @[simp, norm_cast] lemma cast_neg (q : ℚ) : ↑(-q) = (-q : α) := by simp [cast_def, neg_div] +set_option backward.isDefEq.respectTransparency false in @[norm_cast] lemma cast_sub_of_ne_zero (hp : (p.den : α) ≠ 0) (hq : (q.den : α) ≠ 0) : ↑(p - q) = (p - q : α) := by simp [sub_eq_add_neg, cast_add_of_ne_zero, hp, hq] diff --git a/Mathlib/Data/Rat/Cast/Lemmas.lean b/Mathlib/Data/Rat/Cast/Lemmas.lean index b74fcebed8f8cf..377b561a9cdc4b 100644 --- a/Mathlib/Data/Rat/Cast/Lemmas.lean +++ b/Mathlib/Data/Rat/Cast/Lemmas.lean @@ -78,6 +78,7 @@ theorem cast_zpow_of_ne_zero {K} [DivisionSemiring K] (q : ℚ≥0) (z : ℤ) (h congr rw [cast_inv_of_ne_zero hq] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem cast_mk {K} [DivisionRing K] (q : ℚ) (h : 0 ≤ q) : (NNRat.cast ⟨q, h⟩ : K) = (q : K) := by diff --git a/Mathlib/Data/Rat/Cast/OfScientific.lean b/Mathlib/Data/Rat/Cast/OfScientific.lean index 5fed7d8bbc9081..bf991855643130 100644 --- a/Mathlib/Data/Rat/Cast/OfScientific.lean +++ b/Mathlib/Data/Rat/Cast/OfScientific.lean @@ -18,6 +18,7 @@ to make this more general, but it's not needed at present. @[expose] public section +set_option backward.isDefEq.respectTransparency false in open Lean.Grind in instance {K : Type*} [_root_.Field K] [CharZero K] : LawfulOfScientific K where ofScientific_def {m s e} := by diff --git a/Mathlib/Data/Rat/Lemmas.lean b/Mathlib/Data/Rat/Lemmas.lean index 5e7016ec9f7af6..05bca52a7ccdc2 100644 --- a/Mathlib/Data/Rat/Lemmas.lean +++ b/Mathlib/Data/Rat/Lemmas.lean @@ -313,6 +313,7 @@ theorem inv_ofNat_num (a : ℕ) [a.AtLeastTwo] : (ofNat(a) : ℚ)⁻¹.num = 1 : change 0 < (a : ℤ) lia +set_option backward.isDefEq.respectTransparency false in theorem inv_intCast_den (a : ℤ) : (a : ℚ)⁻¹.den = if a = 0 then 1 else a.natAbs := by simp theorem inv_natCast_den (a : ℕ) : (a : ℚ)⁻¹.den = if a = 0 then 1 else a := by simp diff --git a/Mathlib/Data/Semiquot.lean b/Mathlib/Data/Semiquot.lean index efd7d634dc36bb..97f9238f6e2748 100644 --- a/Mathlib/Data/Semiquot.lean +++ b/Mathlib/Data/Semiquot.lean @@ -178,6 +178,7 @@ def IsPure (q : Semiquot α) : Prop := def get (q : Semiquot α) (h : q.IsPure) : α := liftOn q id h +set_option backward.isDefEq.respectTransparency false in theorem get_mem {q : Semiquot α} (p) : get q p ∈ q := by let ⟨a, h⟩ := exists_mem q unfold get; rw [liftOn_ofMem q _ _ a h]; exact h diff --git a/Mathlib/Data/Seq/Basic.lean b/Mathlib/Data/Seq/Basic.lean index 64dcab304b8fa6..f4fdba6a19e65b 100644 --- a/Mathlib/Data/Seq/Basic.lean +++ b/Mathlib/Data/Seq/Basic.lean @@ -37,6 +37,7 @@ theorem length'_of_not_terminates {s : Seq α} (h : ¬ s.Terminates) : s.length' = ⊤ := by simp [length', h] +set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in -- simp followed by exact rfl @[simp] theorem length_nil : length (nil : Seq α) terminates_nil = 0 := by simp [length]; exact rfl @@ -57,6 +58,7 @@ theorem length'_cons (x : α) (s : Seq α) : · simp [length'_of_terminates h, length'_of_terminates h', length_cons h'] · simp [length'_of_not_terminates h, length'_of_not_terminates h'] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem length_eq_zero {s : Seq α} {h : s.Terminates} : s.length h = 0 ↔ s = nil := by @@ -71,6 +73,7 @@ theorem length'_ne_zero_iff_cons (s : Seq α) : s.length' ≠ 0 ↔ ∃ x s', s = cons x s' := by cases s <;> simp +set_option backward.isDefEq.respectTransparency false in /-- The statement of `length_le_iff'` does not assume that the sequence terminates. For a simpler statement of the theorem where the sequence is known to terminate see `length_le_iff`. -/ theorem length_le_iff' {s : Seq α} {n : ℕ} : @@ -94,6 +97,7 @@ theorem length'_le_iff {s : Seq α} {n : ℕ} : · simpa [length'_of_terminates h] using length_le_iff · simpa [length'_of_not_terminates h] using forall_not_of_not_exists h n +set_option backward.isDefEq.respectTransparency false in /-- The statement of `lt_length_iff'` does not assume that the sequence terminates. For a simpler statement of the theorem where the sequence is known to terminate see `lt_length_iff`. -/ theorem lt_length_iff' {s : Seq α} {n : ℕ} : @@ -133,6 +137,7 @@ end OfStream section OfList +set_option backward.isDefEq.respectTransparency false in theorem terminatedAt_ofList (l : List α) : (ofList l).TerminatedAt l.length := by simp [ofList, TerminatedAt] @@ -204,6 +209,7 @@ theorem length_take_le {s : Seq α} {n : ℕ} : (s.take n).length ≤ n := by obtain ⟨x, r⟩ := v simpa using ih +set_option backward.isDefEq.respectTransparency false in theorem length_take_of_le_length {s : Seq α} {n : ℕ} (hle : ∀ h : s.Terminates, n ≤ s.length h) : (s.take n).length = n := by induction n generalizing s with @@ -231,6 +237,7 @@ theorem length_toList (s : Seq α) (h : s.Terminates) : (toList s h).length = le intro _ exact le_rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem getElem?_toList (s : Seq α) (h : s.Terminates) (n : ℕ) : (toList s h)[n]? = s.get? n := by ext k @@ -240,6 +247,7 @@ theorem getElem?_toList (s : Seq α) (h : s.Terminates) (n : ℕ) : (toList s h) let ⟨a, ha⟩ := ge_stable s hmn h simp [ha] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ofList_toList (s : Seq α) (h : s.Terminates) : ofList (toList s h) = s := by @@ -249,6 +257,7 @@ theorem ofList_toList (s : Seq α) (h : s.Terminates) : theorem toList_ofList (l : List α) : toList (ofList l) (terminates_ofList l) = l := ofList_injective (by simp) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toList_nil : toList (nil : Seq α) ⟨0, terminatedAt_zero_iff.2 rfl⟩ = [] := by ext; simp [nil, toList, const] @@ -432,10 +441,12 @@ section Join theorem join_nil : join nil = (nil : Seq α) := destruct_eq_none rfl +set_option backward.isDefEq.respectTransparency false in -- Not a simp lemmas as `join_cons` is more general theorem join_cons_nil (a : α) (S) : join (cons (a, nil) S) = cons a (join S) := destruct_eq_cons <| by simp [join] +set_option backward.isDefEq.respectTransparency false in -- Not a simp lemmas as `join_cons` is more general theorem join_cons_cons (a b : α) (s S) : join (cons (a, cons b s) S) = cons a (join (cons (b, s) S)) := @@ -650,6 +661,7 @@ end ZipWith section Fold +set_option backward.isDefEq.respectTransparency false in @[simp] theorem fold_nil (init : β) (f : β → α → β) : nil.fold init f = cons init nil := by @@ -676,6 +688,7 @@ section Update variable (hd x : α) (tl : Seq α) (f : α → α) +set_option backward.isDefEq.respectTransparency false in theorem get?_update (s : Seq α) (n : ℕ) (m : ℕ) : (s.update n f).get? m = if m = n then (s.get? m).map f else s.get? m := by simp [update, Function.update] @@ -709,6 +722,7 @@ theorem update_cons_succ (n : ℕ) : (cons hd tl).update (n + 1) f = cons hd (tl theorem set_cons_succ (n : ℕ) : (cons hd tl).set (n + 1) x = cons hd (tl.set n x) := update_cons_succ _ _ _ _ +set_option backward.isDefEq.respectTransparency false in theorem get?_set_of_not_terminatedAt {s : Seq α} {n : ℕ} (h_not_terminated : ¬ s.TerminatedAt n) : (s.set n x).get? n = x := by simpa [set, update, ← Option.ne_none_iff_exists'] using! h_not_terminated @@ -970,6 +984,7 @@ def map (f : α → β) : Seq1 α → Seq1 β theorem map_pair {f : α → β} {a s} : map f (a, s) = (f a, Seq.map f s) := rfl +set_option backward.isDefEq.respectTransparency false in theorem map_id : ∀ s : Seq1 α, map id s = s | ⟨a, s⟩ => by simp [map] @@ -1008,10 +1023,12 @@ def bind (s : Seq1 α) (f : α → Seq1 β) : Seq1 β := theorem join_map_ret (s : Seq α) : Seq.join (Seq.map ret s) = s := by apply coinduction2 s; intro s; cases s <;> simp [ret] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem bind_ret (f : α → β) : ∀ s, bind s (ret ∘ f) = map f s | ⟨a, s⟩ => by simp [bind, map, map_comp, ret] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ret_bind (a : α) (f : α → Seq1 β) : bind (ret a) f = f a := by simp only [bind, map, ret.eq_1, map_nil] @@ -1038,10 +1055,12 @@ theorem map_join' (f : α → β) (S) : Seq.map f (Seq.join S) = Seq.join (Seq.m case cons _ s => exact ⟨s, S, rfl, rfl⟩ · refine ⟨nil, S, ?_, ?_⟩ <;> simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_join (f : α → β) : ∀ S, map f (join S) = join (map (map f) S) | ((a, s), S) => by cases s <;> simp [map] +set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in -- TODO: fix non-terminal simp @[simp] theorem join_join (SS : Seq (Seq1 (Seq1 α))) : @@ -1066,6 +1085,7 @@ theorem join_join (SS : Seq (Seq1 (Seq1 α))) : case cons _ s => exact ⟨s, SS, rfl, rfl⟩ · refine ⟨nil, SS, ?_, ?_⟩ <;> simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem bind_assoc (s : Seq1 α) (f : α → Seq1 β) (g : β → Seq1 γ) : bind (bind s f) g = bind s fun x : α => bind (f x) g := by diff --git a/Mathlib/Data/Seq/Defs.lean b/Mathlib/Data/Seq/Defs.lean index ccf969fb98ccdb..7447cf4f90f055 100644 --- a/Mathlib/Data/Seq/Defs.lean +++ b/Mathlib/Data/Seq/Defs.lean @@ -307,6 +307,7 @@ def corec (f : β → Option (α × β)) (b : β) : Seq α := by rw [Stream'.corec'_eq (Corec.f f) (Corec.f f o).2, Stream'.corec'_eq (Corec.f f) o] exact IH (Corec.f f o).2 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem corec_eq (f : β → Option (α × β)) (b : β) : destruct (corec f b) = omap (corec f) (f b) := by @@ -327,6 +328,7 @@ theorem corec_nil (f : β → Option (α × β)) (b : β) apply destruct_eq_none simp [h] +set_option backward.isDefEq.respectTransparency false in theorem corec_cons {f : β → Option (α × β)} {b : β} {x : α} {s : β} (h : f b = .some (x, s)) : corec f b = cons x (corec f s) := by apply destruct_eq_cons diff --git a/Mathlib/Data/Set/Card.lean b/Mathlib/Data/Set/Card.lean index 7e9587dc428e1d..049b3e3f927915 100644 --- a/Mathlib/Data/Set/Card.lean +++ b/Mathlib/Data/Set/Card.lean @@ -512,6 +512,7 @@ open Notation in lemma encard_preimage_val_le_encard_left (P Q : Set α) : (P ↓∩ Q).encard ≤ P.encard := (Function.Embedding.subtype _).encard_le +set_option backward.isDefEq.respectTransparency false in open Notation in lemma encard_preimage_val_le_encard_right (P Q : Set α) : (P ↓∩ Q).encard ≤ Q.encard := Function.Embedding.encard_le ⟨fun ⟨⟨x, _⟩, hx⟩ ↦ ⟨x, hx⟩, fun _ _ h ↦ by diff --git a/Mathlib/Data/Set/Countable.lean b/Mathlib/Data/Set/Countable.lean index 40b88ff70a0d59..316310ffdedc11 100644 --- a/Mathlib/Data/Set/Countable.lean +++ b/Mathlib/Data/Set/Countable.lean @@ -72,7 +72,7 @@ theorem countable_iff_nonempty_encodable {s : Set α} : s.Countable ↔ Nonempty alias ⟨Countable.nonempty_encodable, _⟩ := countable_iff_nonempty_encodable /-- Convert `Set.Countable s` to `Encodable s` (noncomputable). -/ -@[implicit_reducible] +@[instance_reducible] protected def Countable.toEncodable {s : Set α} (hs : s.Countable) : Encodable s := Classical.choice hs.nonempty_encodable diff --git a/Mathlib/Data/Set/Defs.lean b/Mathlib/Data/Set/Defs.lean index cd1214aa75db2a..9a1287801d0e10 100644 --- a/Mathlib/Data/Set/Defs.lean +++ b/Mathlib/Data/Set/Defs.lean @@ -61,12 +61,14 @@ But we would like to dualize set intervals such that e.g. `Ico a b` is dual to ` attribute [to_dual_dont_translate] Set /-- Turn a predicate `p : α → Prop` into a set, also written as `{x | p x}` -/ +@[implicit_reducible] def setOf {α : Type u} (p : α → Prop) : Set α := p namespace Set /-- Membership in a set -/ +@[implicit_reducible] protected def Mem (s : Set α) (a : α) : Prop := s a diff --git a/Mathlib/Data/Set/Finite/Basic.lean b/Mathlib/Data/Set/Finite/Basic.lean index c5427640cea460..f3ffbef3116597 100644 --- a/Mathlib/Data/Set/Finite/Basic.lean +++ b/Mathlib/Data/Set/Finite/Basic.lean @@ -67,7 +67,7 @@ This is the `Fintype` projection for a `Set.Finite`. Note that because `Finite` isn't a typeclass, this definition will not fire if it is made into an instance -/ -@[implicit_reducible] +@[instance_reducible] protected noncomputable def Finite.fintype {s : Set α} (h : s.Finite) : Fintype s := h.nonempty_fintype.some @@ -238,7 +238,7 @@ instance fintypeUniv [Fintype α] : Fintype (@univ α) := instance fintypeTop [Fintype α] : Fintype (⊤ : Set α) := inferInstanceAs (Fintype (univ : Set α)) /-- If `(Set.univ : Set α)` is finite then `α` is a finite type. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfFiniteUniv (H : (univ (α := α)).Finite) : Fintype α := @Fintype.ofEquiv _ (univ : Set α) H.fintype (Equiv.Set.univ _) @@ -265,7 +265,7 @@ instance fintypeInterOfRight (s t : Set α) [Fintype t] [DecidablePred (· ∈ s Fintype.ofFinset {a ∈ t.toFinset | a ∈ s} <| by simp [and_comm] /-- A `Fintype` structure on a set defines a `Fintype` structure on its subset. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeSubset (s : Set α) {t : Set α} [Fintype s] [DecidablePred (· ∈ t)] (h : t ⊆ s) : Fintype t := by rw [← inter_eq_self_of_subset_right h] @@ -292,14 +292,15 @@ instance fintypeInsert (a : α) (s : Set α) [DecidableEq α] [Fintype s] : Fintype (insert a s : Set α) := Fintype.ofFinset (insert a s.toFinset) <| by simp +set_option backward.isDefEq.respectTransparency false in /-- A `Fintype` structure on `insert a s` when inserting a new element. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeInsertOfNotMem {a : α} (s : Set α) [Fintype s] (h : a ∉ s) : Fintype (insert a s : Set α) := Fintype.ofFinset ⟨a ::ₘ s.toFinset.1, s.toFinset.nodup.cons (by simp [h])⟩ <| by simp /-- A `Fintype` structure on `insert a s` when inserting a pre-existing element. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeInsertOfMem {a : α} (s : Set α) [Fintype s] (h : a ∈ s) : Fintype (insert a s : Set α) := Fintype.ofFinset s.toFinset <| by simp [h] @@ -320,7 +321,7 @@ instance fintypeImage [DecidableEq β] (s : Set α) (f : α → β) [Fintype s] /-- If a function `f` has a partial inverse `g` and the image of `s` under `f` is a set with a `Fintype` instance, then `s` has a `Fintype` structure as well. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeOfFintypeImage (s : Set α) {f : α → β} {g} (I : IsPartialInv f g) [Fintype (f '' s)] : Fintype s := Fintype.ofFinset ⟨_, (f '' s).toFinset.2.filterMap g <| injective_of_isPartialInv_right I⟩ @@ -755,6 +756,7 @@ end theorem card_empty : Fintype.card (∅ : Set α) = 0 := rfl +set_option backward.isDefEq.respectTransparency false in theorem card_fintypeInsertOfNotMem {a : α} (s : Set α) [Fintype s] (h : a ∉ s) : @Fintype.card _ (fintypeInsertOfNotMem s h) = Fintype.card s + 1 := by simp [Fintype.card_ofFinset] @@ -890,6 +892,7 @@ theorem infinite_of_injective_forall_mem [Infinite α] {s : Set β} {f : α → rw [← range_subset_iff] at hf exact (infinite_range_of_injective hi).mono hf +set_option backward.isDefEq.respectTransparency false in theorem not_injOn_infinite_finite_image {f : α → β} {s : Set α} (h_inf : s.Infinite) (h_fin : (f '' s).Finite) : ¬InjOn f s := by have : Finite (f '' s) := finite_coe_iff.mpr h_fin diff --git a/Mathlib/Data/Set/Finite/Lattice.lean b/Mathlib/Data/Set/Finite/Lattice.lean index f80b70384d7299..7d88a55849d5ec 100644 --- a/Mathlib/Data/Set/Finite/Lattice.lean +++ b/Mathlib/Data/Set/Finite/Lattice.lean @@ -61,7 +61,7 @@ lemma toFinset_iUnion [Fintype β] [DecidableEq α] (f : β → Set α) /-- A union of sets with `Fintype` structure over a set with `Fintype` structure has a `Fintype` structure. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeBiUnion [DecidableEq α] {ι : Type*} (s : Set ι) [Fintype s] (t : ι → Set α) (H : ∀ i ∈ s, Fintype (t i)) : Fintype (⋃ x ∈ s, t x) := haveI : ∀ i : toFinset s, Fintype (t i) := fun i => H i (mem_toFinset.1 i.2) diff --git a/Mathlib/Data/Set/Finite/Monad.lean b/Mathlib/Data/Set/Finite/Monad.lean index 206b0c7e0cc284..69fa3987ab35dd 100644 --- a/Mathlib/Data/Set/Finite/Monad.lean +++ b/Mathlib/Data/Set/Finite/Monad.lean @@ -41,7 +41,7 @@ attribute [local instance] Set.monad /-- If `s : Set α` is a set with `Fintype` instance and `f : α → Set β` is a function such that each `f a`, `a ∈ s`, has a `Fintype` structure, then `s >>= f` has a `Fintype` structure. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeBind {α β} [DecidableEq β] (s : Set α) [Fintype s] (f : α → Set β) (H : ∀ a ∈ s, Fintype (f a)) : Fintype (s >>= f) := Set.fintypeBiUnion s f H diff --git a/Mathlib/Data/Set/NAry.lean b/Mathlib/Data/Set/NAry.lean index 46fe4f361a25b2..300f488f76fb39 100644 --- a/Mathlib/Data/Set/NAry.lean +++ b/Mathlib/Data/Set/NAry.lean @@ -78,6 +78,7 @@ lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t : @[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t := ext <| by simp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) : image2 (fun a b ↦ f (a, b)) s t = f '' s ×ˢ t := by diff --git a/Mathlib/Data/Set/Operations.lean b/Mathlib/Data/Set/Operations.lean index 200a2cd117025b..b109745b03b94d 100644 --- a/Mathlib/Data/Set/Operations.lean +++ b/Mathlib/Data/Set/Operations.lean @@ -115,6 +115,7 @@ theorem mem_diff_of_mem {s t : Set α} {x : α} (h1 : x ∈ s) (h2 : x ∉ t) : /-- The preimage of `s : Set β` by `f : α → β`, written `f ⁻¹' s`, is the set of `x : α` such that `f x ∈ s`. -/ +@[implicit_reducible] def preimage (f : α → β) (s : Set β) : Set α := {x | f x ∈ s} /-- `f ⁻¹' t` denotes the preimage of `t : Set β` under the function `f : α → β`. -/ diff --git a/Mathlib/Data/Set/Pairwise/Lattice.lean b/Mathlib/Data/Set/Pairwise/Lattice.lean index fbf4ab64e45cfb..6418fada52c2b2 100644 --- a/Mathlib/Data/Set/Pairwise/Lattice.lean +++ b/Mathlib/Data/Set/Pairwise/Lattice.lean @@ -149,6 +149,7 @@ lemma coe_biUnionEqSigmaOfDisjoint_symm_apply {α ι : Type*} {s : Set ι} ((Set.biUnionEqSigmaOfDisjoint h).symm x : α) = x.2 := by rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma coe_snd_biUnionEqSigmaOfDisjoint {α ι : Type*} {s : Set ι} {f : ι → Set α} (h : s.PairwiseDisjoint f) (x : ⋃ i ∈ s, f i) : diff --git a/Mathlib/Data/Set/Restrict.lean b/Mathlib/Data/Set/Restrict.lean index 760decf0155693..ee0b8bf15ece28 100644 --- a/Mathlib/Data/Set/Restrict.lean +++ b/Mathlib/Data/Set/Restrict.lean @@ -273,6 +273,7 @@ theorem injOn_iff_injective : InjOn f s ↔ Injective (s.restrict f) := alias ⟨InjOn.injective, _⟩ := Set.injOn_iff_injective +set_option backward.isDefEq.respectTransparency false in theorem MapsTo.restrict_inj (h : MapsTo f s t) : Injective (h.restrict f s t) ↔ InjOn f s := by rw [h.restrict_eq_codRestrict, injective_codRestrict, injOn_iff_injective] diff --git a/Mathlib/Data/Setoid/Basic.lean b/Mathlib/Data/Setoid/Basic.lean index 0547b8285f1049..2939e2b7dbe92e 100644 --- a/Mathlib/Data/Setoid/Basic.lean +++ b/Mathlib/Data/Setoid/Basic.lean @@ -70,7 +70,7 @@ theorem comm' (s : Setoid α) {x y} : s x y ↔ s y x := open scoped Function -- required for scoped `on` notation /-- The kernel of a function is an equivalence relation. -/ -@[implicit_reducible] +@[instance_reducible] def ker (f : α → β) : Setoid α := ⟨(· = ·) on f, eq_equivalence.comap f⟩ @@ -89,7 +89,7 @@ theorem ker_def {f : α → β} {x y : α} : ker f x y ↔ f x = f y := /-- Given types `α`, `β`, the product of two equivalence relations `r` on `α` and `s` on `β`: `(x₁, x₂), (y₁, y₂) ∈ α × β` are related by `r.prod s` iff `x₁` is related to `y₁` by `r` and `x₂` is related to `y₂` by `s`. -/ -@[implicit_reducible] +@[instance_reducible] protected def prod (r : Setoid α) (s : Setoid β) : Setoid (α × β) where r x y := r x.1 y.1 ∧ s x.2 y.2 @@ -397,14 +397,14 @@ variable {r f} /-- Given a function `f : α → β` and equivalence relation `r` on `α`, the equivalence closure of the relation on `f`'s image defined by '`x ≈ y` iff the elements of `f⁻¹(x)` are related to the elements of `f⁻¹(y)` by `r`.' -/ -@[implicit_reducible] +@[instance_reducible] def map (r : Setoid α) (f : α → β) : Setoid β := Relation.EqvGen.setoid (Relation.Map r f f) /-- Given a surjective function f whose kernel is contained in an equivalence relation r, the equivalence relation on f's codomain defined by x ≈ y ↔ the elements of f⁻¹(x) are related to the elements of f⁻¹(y) by r. -/ -@[implicit_reducible] +@[instance_reducible] def mapOfSurjective (r : Setoid α) (f : α → β) (h : ker f ≤ r) (hf : Surjective f) : Setoid β := ⟨Relation.Map r f f, Relation.map_equivalence r.iseqv f hf h⟩ diff --git a/Mathlib/Data/Setoid/Partition.lean b/Mathlib/Data/Setoid/Partition.lean index 8f1be76aad388c..1f05a5c9fde272 100644 --- a/Mathlib/Data/Setoid/Partition.lean +++ b/Mathlib/Data/Setoid/Partition.lean @@ -47,7 +47,7 @@ theorem eq_of_mem_eqv_class {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b (H x).unique ⟨hc, hb⟩ ⟨hc', hb'⟩ /-- Makes an equivalence relation from a set of sets partitioning α. -/ -@[implicit_reducible] +@[instance_reducible] def mkClasses (c : Set (Set α)) (H : ∀ a, ∃! b ∈ c, a ∈ b) : Setoid α where r x y := ∀ s ∈ c, x ∈ s → y ∈ s iseqv.refl := fun _ _ _ hx => hx @@ -143,7 +143,7 @@ theorem eqv_classes_of_disjoint_union {c : Set (Set α)} (hu : Set.sUnion c = @S ExistsUnique.intro b ⟨hc, ha⟩ fun _ hc' => H.elim_set hc'.1 hc _ hc'.2 ha /-- Makes an equivalence relation from a set of disjoints sets covering α. -/ -@[implicit_reducible] +@[instance_reducible] def setoidOfDisjointUnion {c : Set (Set α)} (hu : Set.sUnion c = @Set.univ α) (H : c.PairwiseDisjoint id) : Setoid α := Setoid.mkClasses c <| eqv_classes_of_disjoint_union hu H @@ -266,6 +266,7 @@ instance Partition.partialOrder : PartialOrder (Partitions α) where rw [Partitions.ext_iff, ← classes_mkClasses x.toSet x.isPartition, ← classes_mkClasses y.toSet y.isPartition, h] +set_option backward.isDefEq.respectTransparency.types false in variable (α) in /-- The order-preserving bijection between equivalence relations on a type `α`, and partitions of `α` into subsets. -/ @@ -447,7 +448,7 @@ theorem class_of {x : α} : setOf (hs.setoid x) = s (hs.index x) := theorem proj_fiber (x : hs.Quotient) : hs.proj ⁻¹' {x} = s (hs.equivQuotient.symm x) := Quotient.inductionOn' x fun x => by ext y - simp only [Set.mem_preimage, Set.mem_singleton_iff, hs.mem_iff_index_eq] + simp only [Set.mem_preimage, hs.mem_iff_index_eq] exact Quotient.eq'' /-- Combine functions with disjoint domains into a new function. diff --git a/Mathlib/Data/Sign/Basic.lean b/Mathlib/Data/Sign/Basic.lean index 681ed9c3fd2ee6..0d12dfc2f4b7aa 100644 --- a/Mathlib/Data/Sign/Basic.lean +++ b/Mathlib/Data/Sign/Basic.lean @@ -180,6 +180,7 @@ theorem exists_signed_sum [DecidableEq α] (s : Finset α) (f : α → ℤ) : ⟨t, inferInstance, fun b => sgn b, fun b => g b, fun b => hg b, by simp [ht], fun a ha => (sum_attach t fun b ↦ ite (g b = a) (sgn b : ℤ) 0).trans <| hf _ ha⟩ +set_option backward.isDefEq.respectTransparency false in /-- We can decompose a sum of absolute value less than `n` into a sum of at most `n` signs. -/ theorem exists_signed_sum' [Nonempty α] [DecidableEq α] (s : Finset α) (f : α → ℤ) (n : ℕ) (h : (∑ i ∈ s, (f i).natAbs) ≤ n) : diff --git a/Mathlib/Data/Sign/Defs.lean b/Mathlib/Data/Sign/Defs.lean index dd542a5dbcf3f1..6eb898882195d2 100644 --- a/Mathlib/Data/Sign/Defs.lean +++ b/Mathlib/Data/Sign/Defs.lean @@ -22,6 +22,7 @@ This file defines the type of signs $\{-1, 0, 1\}$ and its basic arithmetic inst @[expose] public section +set_option backward.isDefEq.respectTransparency false in -- Don't generate unnecessary `sizeOf_spec` lemmas which the `simpNF` linter will complain about. set_option genSizeOfSpec false in /-- The type of signs. -/ diff --git a/Mathlib/Data/String/Basic.lean b/Mathlib/Data/String/Basic.lean index 4a98547e1c2e22..1cd20af0a8fecd 100644 --- a/Mathlib/Data/String/Basic.lean +++ b/Mathlib/Data/String/Basic.lean @@ -62,6 +62,7 @@ instance decidableLT' : DecidableLT String := by else base₁ it₁.s it₂.s it₁.i it₂.i h₂ h₁ else base₂ it₁.s it₂.s it₁.i it₂.i h₂ +set_option backward.isDefEq.respectTransparency false in theorem ltb_cons_addChar' (c : Char) (s₁ s₂ : Legacy.Iterator) : ltb ⟨ofList (c :: s₁.s.toList), s₁.i + c⟩ ⟨ofList (c :: s₂.s.toList), s₂.i + c⟩ = ltb s₁ s₂ := by @@ -75,7 +76,7 @@ theorem ltb_cons_addChar' (c : Char) (s₁ s₂ : Legacy.Iterator) : | case2 s₁ s₂ h₁ h₂ h => rw [ltb, Legacy.Iterator.hasNext_cons_addChar, Legacy.Iterator.hasNext_cons_addChar, if_pos (by simpa using h₁), if_pos (by simpa using h₂), if_neg] - · simp only [Legacy.Iterator.curr, get_cons_addChar, ofList_toList, decide_eq_decide] + · simp only [Legacy.Iterator.curr, get_cons_addChar, ofList_toList] · simpa only [Legacy.Iterator.curr, get_cons_addChar, ofList_toList] using h | case3 s₁ s₂ h₁ h₂ => rw [ltb, Legacy.Iterator.hasNext_cons_addChar, Legacy.Iterator.hasNext_cons_addChar, diff --git a/Mathlib/Data/Sum/Basic.lean b/Mathlib/Data/Sum/Basic.lean index df94f81721431c..16c06d49f4f0fd 100644 --- a/Mathlib/Data/Sum/Basic.lean +++ b/Mathlib/Data/Sum/Basic.lean @@ -50,9 +50,11 @@ section get variable {x : α ⊕ β} +set_option backward.isDefEq.respectTransparency false in theorem eq_left_iff_getLeft_eq {a : α} : x = inl a ↔ ∃ h, x.getLeft h = a := by cases x <;> simp +set_option backward.isDefEq.respectTransparency false in theorem eq_right_iff_getRight_eq {b : β} : x = inr b ↔ ∃ h, x.getRight h = b := by cases x <;> simp diff --git a/Mathlib/Data/Sym/Basic.lean b/Mathlib/Data/Sym/Basic.lean index df918acd8a60df..bd3c5d8e2f6dd2 100644 --- a/Mathlib/Data/Sym/Basic.lean +++ b/Mathlib/Data/Sym/Basic.lean @@ -160,10 +160,12 @@ instance decidableMem [DecidableEq α] (a : α) (s : Sym α n) : Decidable (a theorem mem_mk (a : α) (s : Multiset α) (h : Multiset.card s = n) : a ∈ mk s h ↔ a ∈ s := Iff.rfl +set_option backward.isDefEq.respectTransparency false in lemma «forall» {p : Sym α n → Prop} : (∀ s : Sym α n, p s) ↔ ∀ (s : Multiset α) (hs : Multiset.card s = n), p (Sym.mk s hs) := by simp [Sym] +set_option backward.isDefEq.respectTransparency false in lemma «exists» {p : Sym α n → Prop} : (∃ s : Sym α n, p s) ↔ ∃ (s : Multiset α) (hs : Multiset.card s = n), p (Sym.mk s hs) := by simp [Sym] @@ -345,11 +347,13 @@ theorem mem_map {n : ℕ} {f : α → β} {b : β} {l : Sym α n} : b ∈ Sym.map f l ↔ ∃ a, a ∈ l ∧ f a = b := Multiset.mem_map +set_option backward.isDefEq.respectTransparency false in /-- Note: `Sym.map_id` is not simp-normal, as simp ends up unfolding `id` with `Sym.map_congr` -/ @[simp] theorem map_id' {α : Type*} {n : ℕ} (s : Sym α n) : Sym.map (fun x : α => x) s = s := by ext; simp only [map, Multiset.map_id', ← val_eq_coe] +set_option backward.isDefEq.respectTransparency false in theorem map_id {α : Type*} {n : ℕ} (s : Sym α n) : Sym.map id s = s := by ext; simp only [map, id_eq, Multiset.map_id', ← val_eq_coe] @@ -459,6 +463,7 @@ theorem append_inj_right (s : Sym α n) {t t' : Sym α n'} : s.append t = s.appe theorem append_inj_left {s s' : Sym α n} (t : Sym α n') : s.append t = s'.append t ↔ s = s' := Subtype.ext_iff.trans <| (add_left_inj _).trans Subtype.ext_iff.symm +set_option backward.isDefEq.respectTransparency false in theorem append_comm (s : Sym α n') (s' : Sym α n') : s.append s' = Sym.cast (add_comm _ _) (s'.append s) := by simp [append, add_comm] @@ -470,6 +475,7 @@ theorem coe_append (s : Sym α n) (s' : Sym α n') : (s.append s' : Multiset α) theorem mem_append_iff {s' : Sym α m} : a ∈ s.append s' ↔ a ∈ s ∨ a ∈ s' := Multiset.mem_add +set_option backward.isDefEq.respectTransparency false in /-- `a ↦ {a}` as an equivalence between `α` and `Sym α 1`. -/ @[simps apply] def oneEquiv : α ≃ Sym α 1 where diff --git a/Mathlib/Data/Sym/Sym2.lean b/Mathlib/Data/Sym/Sym2.lean index a32398745d5635..d29b3724580b57 100644 --- a/Mathlib/Data/Sym/Sym2.lean +++ b/Mathlib/Data/Sym/Sym2.lean @@ -585,6 +585,7 @@ theorem fromRel_mono_iff (sym₁ : Symmetric r₁) (sym₂ : Symmetric r₂) : @[gcongr] alias ⟨_, fromRel_mono⟩ := fromRel_mono_iff +set_option backward.isDefEq.respectTransparency false in theorem fromRel_bot : fromRel (α := α) (r := ⊥) (fun _ _ ↦ id) = ∅ := Set.eq_empty_of_forall_notMem <| Sym2.ind <| by simp @@ -594,6 +595,7 @@ theorem fromRel_bot_iff {sym : Symmetric r} : fromRel sym = ∅ ↔ r = ⊥ := b ext x y simpa [h] using fromRel_prop (sym := sym) +set_option backward.isDefEq.respectTransparency false in theorem fromRel_top : fromRel (α := α) (r := ⊤) (fun _ _ ↦ id) = .univ := Set.eq_univ_of_forall <| Sym2.ind <| by simp @@ -603,12 +605,14 @@ theorem fromRel_top_iff {sym : Symmetric r} : fromRel sym = .univ ↔ r = ⊤ := ext x y simpa [h] using fromRel_prop (sym := sym) +set_option backward.isDefEq.respectTransparency false in theorem fromRel_ne : fromRel (fun (_ _ : α) z => z.symm : Symmetric Ne) = {z | ¬IsDiag z} := by ext z; exact z.ind (by simp) lemma diagSet_eq_fromRel_eq : diagSet = fromRel (α := α) eq_equivalence.symmetric := by ext ⟨a, b⟩; simp +set_option backward.isDefEq.respectTransparency false in lemma diagSet_compl_eq_fromRel_ne : diagSetᶜ = fromRel (α := α) (r := Ne) (fun _ _ ↦ Ne.symm) := by ext ⟨a, b⟩; simp @@ -679,6 +683,7 @@ variable (α) in def toRelOrderEmbedding : Set (Sym2 α) ↪o (α → α → Prop) := .ofMapLEIff ToRel toRel_mono_iff +set_option backward.isDefEq.respectTransparency false in variable (α) in /-- `fromRel`/`ToRel` induce an order isomorphism between symmetric relations and `Sym2` sets -/ @[simps] diff --git a/Mathlib/Data/TypeVec.lean b/Mathlib/Data/TypeVec.lean index faf2abfe4dfdc1..545b1731af319a 100644 --- a/Mathlib/Data/TypeVec.lean +++ b/Mathlib/Data/TypeVec.lean @@ -453,6 +453,7 @@ def prod.mk : ∀ {n} {α β : TypeVec.{u} n} (i : Fin2 n), α i → β i → ( end +set_option backward.isDefEq.respectTransparency false in @[simp] theorem prod_fst_mk {α β : TypeVec n} (i : Fin2 n) (a : α i) (b : β i) : TypeVec.prod.fst i (prod.mk i a b) = a := by @@ -460,6 +461,7 @@ theorem prod_fst_mk {α β : TypeVec n} (i : Fin2 n) (a : α i) (b : β i) : | fz => simp_all only [prod.fst, prod.mk] | fs _ i_ih => apply i_ih +set_option backward.isDefEq.respectTransparency false in @[simp] theorem prod_snd_mk {α β : TypeVec n} (i : Fin2 n) (a : α i) (b : β i) : TypeVec.prod.snd i (prod.mk i a b) = b := by @@ -555,6 +557,7 @@ theorem subtypeVal_nil {α : TypeVec.{u} 0} (ps : α ⟹ «repeat» 0 Prop) : TypeVec.subtypeVal ps = nilFun := funext <| by rintro ⟨⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem diag_sub_val {n} {α : TypeVec.{u} n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by ext i x @@ -641,6 +644,7 @@ theorem dropFun_id {α : TypeVec (n + 1)} : dropFun (@TypeVec.id _ α) = id := @[simp] theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := prod_id +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) : toSubtype p ⊚ ofSubtype p = id := by @@ -648,6 +652,7 @@ theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) : induction i <;> simp only [id, toSubtype, comp, ofSubtype] at * simp [*] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) : subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val := by @@ -655,12 +660,14 @@ theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) : induction i <;> simp only [toSubtype, comp, subtypeVal] at * simp [*] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toSubtype_of_subtype_assoc {α β : TypeVec n} (p : α ⟹ «repeat» n Prop) (f : β ⟹ Subtype_ p) : @toSubtype n _ p ⊚ ofSubtype _ ⊚ f = f := by rw [← comp_assoc, toSubtype_of_subtype]; simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) : toSubtype' r ⊚ ofSubtype' r = id := by diff --git a/Mathlib/Data/Vector/Basic.lean b/Mathlib/Data/Vector/Basic.lean index 7ceba21415a26f..684a95af8e150d 100644 --- a/Mathlib/Data/Vector/Basic.lean +++ b/Mathlib/Data/Vector/Basic.lean @@ -149,6 +149,7 @@ theorem get_eq_get_toList (v : Vector α n) (i : Fin n) : theorem get_replicate (a : α) (i : Fin n) : (Vector.replicate n a).get i = a := by apply List.getElem_replicate +set_option backward.isDefEq.respectTransparency false in @[simp] theorem get_map {β : Type*} (v : Vector α n) (f : α → β) (i : Fin n) : (v.map f).get i = f (v.get i) := by @@ -253,6 +254,7 @@ to the `List.reverse` after retrieving a vector's `toList`. -/ theorem toList_reverse {v : Vector α n} : v.reverse.toList = v.toList.reverse := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem reverse_reverse {v : Vector α n} : v.reverse.reverse = v := by cases v @@ -287,6 +289,7 @@ def last (v : Vector α (n + 1)) : α := theorem last_def {v : Vector α (n + 1)} : v.last = v.get (Fin.last n) := rfl +set_option backward.isDefEq.respectTransparency false in /-- The `last` element of a vector is the `head` of the `reverse` vector. -/ theorem reverse_get_zero {v : Vector α (n + 1)} : v.reverse.head = v.last := by rw [← get_zero, last_def, get_eq_get_toList, get_eq_get_toList] @@ -310,6 +313,7 @@ def scanl : Vector β (n + 1) := theorem scanl_nil : scanl f b nil = b ::ᵥ nil := by ext; simp [scanl, get] +set_option backward.isDefEq.respectTransparency false in /-- The recursive step of `scanl` splits a vector `x ::ᵥ v : Vector α (n + 1)` into the provided starting value `b : β` and the recursed `scanl` `f b x : β` as the starting value. @@ -593,10 +597,12 @@ theorem toList_set (v : Vector α n) (i : Fin n) (a : α) : (v.set i a).toList = v.toList.set i a := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem get_set_same (v : Vector α n) (i : Fin n) (a : α) : (v.set i a).get i = a := by cases v; cases i; simp [Vector.set, get_eq_get_toList] +set_option backward.isDefEq.respectTransparency false in theorem get_set_of_ne {v : Vector α n} {i j : Fin n} (h : i ≠ j) (a : α) : (v.set i a).get j = v.get j := by cases v; cases i; cases j @@ -656,6 +662,7 @@ protected theorem traverse_def (f : α → F β) (x : α) : ∀ xs : Vector α n, (x ::ᵥ xs).traverse f = cons <$> f x <*> xs.traverse f := by rintro ⟨xs, rfl⟩; rfl +set_option backward.isDefEq.respectTransparency false in protected theorem id_traverse : ∀ x : Vector α n, x.traverse (pure : _ → Id _) = pure x := by rintro ⟨x, rfl⟩; dsimp [Vector.traverse, cast] induction x with | nil => rfl | cons x xs IH => simp! [IH] @@ -681,6 +688,7 @@ protected theorem comp_traverse (f : β → F γ) (g : α → G β) (x : Vector rw [Vector.traverse_def, ih] simp [functor_norm, Function.comp_def] +set_option backward.isDefEq.respectTransparency false in protected theorem traverse_eq_map_id {α β} (f : α → β) : ∀ x : Vector α n, x.traverse ((pure : _ → Id _) ∘ f) = pure (map f x) := by rintro ⟨x, rfl⟩ @@ -704,6 +712,7 @@ instance : Traversable.{u} (flip Vector n) where traverse := @Vector.traverse n map {α β} := @Vector.map.{u, u} α β n +set_option backward.isDefEq.respectTransparency false in instance : LawfulTraversable.{u} (flip Vector n) where id_traverse := @Vector.id_traverse n comp_traverse := Vector.comp_traverse @@ -732,6 +741,7 @@ theorem get_append_cons_succ {i : Fin (n + m)} {h} : get (x ::ᵥ xs ++ ys) ⟨i+1, h⟩ = get (xs ++ ys) i := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem append_nil : xs ++ (nil : Vector α 0) = xs := by cases xs; simp only [append_def, append_nil] diff --git a/Mathlib/Data/Vector/Defs.lean b/Mathlib/Data/Vector/Defs.lean index 89bab3a49148cd..d8d1e7526b95df 100644 --- a/Mathlib/Data/Vector/Defs.lean +++ b/Mathlib/Data/Vector/Defs.lean @@ -121,6 +121,7 @@ theorem map_nil (f : α → β) : map f nil = nil := theorem map_cons (f : α → β) (a : α) : ∀ v : Vector α n, map f (cons a v) = cons (f a) (map f v) | ⟨_, _⟩ => rfl +set_option backward.isDefEq.respectTransparency false in /-- Map a vector under a partial function. -/ def pmap (f : (a : α) → p a → β) : (v : Vector α n) → (∀ x ∈ v.toList, p x) → Vector β n diff --git a/Mathlib/Data/W/Basic.lean b/Mathlib/Data/W/Basic.lean index 81c5d481441c4d..61ec70328fcd8e 100644 --- a/Mathlib/Data/W/Basic.lean +++ b/Mathlib/Data/W/Basic.lean @@ -136,7 +136,7 @@ private abbrev WType' {α : Type*} (β : α → Type*) [∀ a : α, Fintype (β variable [∀ a : α, Encodable (β a)] set_option backward.privateInPublic true in -@[implicit_reducible] +@[instance_reducible] private def encodable_zero : Encodable (WType' β 0) := let f : WType' β 0 → Empty := fun ⟨_, h⟩ => False.elim <| not_lt_of_ge h (WType.depth_pos _) let finv : Empty → WType' β 0 := by @@ -161,7 +161,7 @@ private def finv (n : ℕ) : (Σ a : α, β a → WType' β n) → WType' β (n variable [Encodable α] set_option backward.privateInPublic true in -@[implicit_reducible] +@[instance_reducible] private def encodable_succ (n : Nat) (_ : Encodable (WType' β n)) : Encodable (WType' β (n + 1)) := Encodable.ofLeftInverse (f n) (finv n) (by diff --git a/Mathlib/Data/W/Constructions.lean b/Mathlib/Data/W/Constructions.lean index 8dc05293a2f845..2067c3a93ca2df 100644 --- a/Mathlib/Data/W/Constructions.lean +++ b/Mathlib/Data/W/Constructions.lean @@ -148,6 +148,7 @@ def toList : WType (Listβ γ) → List γ | WType.mk Listα.nil _ => [] | WType.mk (Listα.cons hd) f => hd :: (f PUnit.unit).toList +set_option backward.isDefEq.respectTransparency false in theorem leftInverse_list : Function.LeftInverse (ofList γ) (toList _) | WType.mk Listα.nil f => by simp only [toList, ofList, mk.injEq, heq_eq_eq, true_and] diff --git a/Mathlib/Data/WSeq/Basic.lean b/Mathlib/Data/WSeq/Basic.lean index 541d96d8d3bff7..136e69b9d202b5 100644 --- a/Mathlib/Data/WSeq/Basic.lean +++ b/Mathlib/Data/WSeq/Basic.lean @@ -185,10 +185,12 @@ open Computation theorem destruct_nil : destruct (nil : WSeq α) = Computation.pure none := Computation.destruct_eq_pure rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem destruct_cons (a : α) (s) : destruct (cons a s) = Computation.pure (some (a, s)) := Computation.destruct_eq_pure <| by simp [destruct, cons, Computation.rmap] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem destruct_think (s : WSeq α) : destruct (think s) = (destruct s).think := Computation.destruct_eq_think <| by simp [destruct, think, Computation.rmap] @@ -214,6 +216,7 @@ theorem head_cons (a : α) (s) : head (cons a s) = Computation.pure (some a) := @[simp] theorem head_think (s : WSeq α) : head (think s) = (head s).think := by simp [head] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem flatten_pure (s : WSeq α) : flatten (Computation.pure s) = s := by refine Seq.eq_of_bisim (fun s1 s2 => flatten (Computation.pure s2) = s1) ?_ rfl @@ -226,6 +229,7 @@ theorem flatten_pure (s : WSeq α) : flatten (Computation.pure s) = s := by obtain ⟨o, s'⟩ := val simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem flatten_think (c : Computation (WSeq α)) : flatten c.think = think (flatten c) := Seq.destruct_eq_cons <| by simp [flatten] @@ -290,12 +294,14 @@ theorem get?_tail (s : WSeq α) (n) : get? (tail s) n = get? s (n + 1) := theorem join_nil : join nil = (nil : WSeq α) := Seq.join_nil +set_option backward.isDefEq.respectTransparency false in @[simp] theorem join_think (S : WSeq (WSeq α)) : join (think S) = think (join S) := by simp only [join, think] dsimp only [(· <$> ·)] simp [Seq1.ret] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem join_cons (s : WSeq α) (S) : join (cons s S) = think (append s (join S)) := by simp only [join, think] @@ -550,6 +556,7 @@ theorem toList'_nil (l : List α) : | some (some a, s') => Sum.inr (a::l, s')) (l, nil) = Computation.pure l.reverse := destruct_eq_pure rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toList'_cons (l : List α) (s : WSeq α) (a : α) : Computation.corec (fun ⟨l, s⟩ => @@ -564,6 +571,7 @@ theorem toList'_cons (l : List α) (s : WSeq α) (a : α) : | some (some a, s') => Sum.inr (a::l, s')) (a::l, s)).think := destruct_eq_think <| by simp [cons] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toList'_think (l : List α) (s : WSeq α) : Computation.corec (fun ⟨l, s⟩ => @@ -623,6 +631,7 @@ theorem toList_ofList (l : List α) : l ∈ toList (ofList l) := by | nil => simp | cons a l IH => simpa [ret_mem] using! think_mem (Computation.mem_map _ IH) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem destruct_ofSeq (s : Seq α) : destruct (ofSeq s) = Computation.pure (s.head.map fun a => (a, ofSeq s.tail)) := @@ -640,6 +649,7 @@ theorem head_ofSeq (s : Seq α) : head (ofSeq s) = Computation.pure s.head := by simp only [head, Option.map_eq_map, destruct_ofSeq, Computation.map_pure, Option.map_map] cases Seq.head s <;> rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem tail_ofSeq (s : Seq α) : tail (ofSeq s) = ofSeq s.tail := by simp only [tail, destruct_ofSeq, map_pure', flatten_pure] @@ -669,6 +679,7 @@ theorem map_cons (f : α → β) (a s) : map f (cons a s) = cons (f a) (map f s) theorem map_think (f : α → β) (s) : map f (think s) = think (map f s) := Seq.map_cons _ _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_id (s : WSeq α) : map id s = s := by simp [map] @@ -679,6 +690,7 @@ theorem map_ret (f : α → β) (a) : map f (ret a) = ret (f a) := by simp [ret] theorem map_append (f : α → β) (s t) : map f (append s t) = append (map f s) (map f t) := Seq.map_append _ _ _ +set_option backward.isDefEq.respectTransparency false in theorem map_comp (f : α → β) (g : β → γ) (s : WSeq α) : map (g ∘ f) s = map g (map f s) := by dsimp [map]; rw [← Seq.map_comp] apply congr_fun; apply congr_arg @@ -789,6 +801,7 @@ theorem destruct_join (S : WSeq (WSeq α)) : case nil | cons => simp case think S => exact Or.inr ⟨S, by simp⟩ +set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in -- TODO: fix non-terminal simp @[simp] theorem map_join (f : α → β) (S) : map f (join S) = join (map (map f) S) := by diff --git a/Mathlib/Data/ZMod/Aut.lean b/Mathlib/Data/ZMod/Aut.lean index 6513919ba3f4a4..14e064c9320f45 100644 --- a/Mathlib/Data/ZMod/Aut.lean +++ b/Mathlib/Data/ZMod/Aut.lean @@ -20,6 +20,7 @@ namespace ZMod variable (n : ℕ) +set_option backward.isDefEq.respectTransparency.types false in /-- The automorphism group of `ZMod n` is isomorphic to the group of units of `ZMod n`. -/ @[simps] def AddAutEquivUnits : AddAut (ZMod n) ≃+ Additive (ZMod n)ˣ := diff --git a/Mathlib/Data/ZMod/Basic.lean b/Mathlib/Data/ZMod/Basic.lean index 57dbf86f636350..a85b6c2a80ca14 100644 --- a/Mathlib/Data/ZMod/Basic.lean +++ b/Mathlib/Data/ZMod/Basic.lean @@ -249,6 +249,7 @@ theorem natCast_comp_val [NeZero n] : ((↑) : ℕ → R) ∘ (val : ZMod n → · cases NeZero.ne 0 rfl rfl +set_option backward.isDefEq.respectTransparency false in /-- The coercions are respectively `Int.cast`, `ZMod.cast`, and `ZMod.cast`. -/ @[simp] theorem intCast_comp_cast : ((↑) : ℤ → R) ∘ (cast : ZMod n → ℤ) = cast := by @@ -876,6 +877,7 @@ def unitsEquivCoprime {n : ℕ} [NeZero n] : (ZMod n)ˣ ≃ { x : ZMod n // Nat. left_inv := fun ⟨_, _, _, _⟩ => Units.ext (natCast_zmod_val _) right_inv := fun ⟨_, _⟩ => by simp +set_option backward.isDefEq.respectTransparency false in /-- The **Chinese remainder theorem**. For a pair of coprime natural numbers, `m` and `n`, the rings `ZMod (m * n)` and `ZMod m × ZMod n` are isomorphic. @@ -1112,6 +1114,7 @@ instance subsingleton_ringEquiv [Semiring R] : Subsingleton (ZMod n ≃+* R) := rw [RingEquiv.coe_ringHom_inj_iff] apply RingHom.ext_zmod _ _⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ringHom_map_cast [NonAssocRing R] (f : R →+* ZMod n) (k : ZMod n) : f (cast k) = k := by cases n diff --git a/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean b/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean index 8195b4682da87c..23329dafb47755 100644 --- a/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean +++ b/Mathlib/Dynamics/Circle/RotationNumber/TranslationNumber.lean @@ -196,6 +196,7 @@ theorem units_inv_apply_apply (f : CircleDeg1Liftˣ) (x : ℝ) : theorem units_apply_inv_apply (f : CircleDeg1Liftˣ) (x : ℝ) : f ((f⁻¹ : CircleDeg1Liftˣ) x) = x := by simp only [← mul_apply, f.mul_inv, coe_one, id] +set_option backward.isDefEq.respectTransparency false in /-- If a lift of a circle map is bijective, then it is an order automorphism of the line. -/ def toOrderIso : CircleDeg1Liftˣ →* ℝ ≃o ℝ where toFun f := diff --git a/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean b/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean index 4387e479b994e7..85530fc09bd5a8 100644 --- a/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean +++ b/Mathlib/Dynamics/Ergodic/Action/OfMinimal.lean @@ -124,6 +124,7 @@ theorem aeconst_of_dense_aestabilizer_smul (hsm : NullMeasurableSet s μ) aeconst_of_dense_setOf_preimage_smul_ae hsm <| (hd.preimage (isOpenMap_inv _)).mono fun g hg ↦ by simpa only [preimage_smul] using! hg +set_option backward.isDefEq.respectTransparency.types false in /-- If a monoid `M` continuously acts on an R₁ topological space `X`, `g` is an element of `M` such that its integer powers are dense in `M`, and `μ` is a finite inner regular measure on `X` which is ergodic with respect to the action of `M`, diff --git a/Mathlib/Dynamics/Ergodic/AddCircle.lean b/Mathlib/Dynamics/Ergodic/AddCircle.lean index 18cc7d4d865a22..c9104d3a6f682c 100644 --- a/Mathlib/Dynamics/Ergodic/AddCircle.lean +++ b/Mathlib/Dynamics/Ergodic/AddCircle.lean @@ -102,6 +102,7 @@ theorem ae_empty_or_univ_of_forall_vadd_ae_eq_self {s : Set <| AddCircle T} volume_of_add_preimage_eq s _ (u j) d huj (hu₁ j) closedBall_ae_eq_ball, nsmul_eq_mul, ← mul_assoc, this, hI₂] +set_option backward.isDefEq.respectTransparency.types false in theorem ergodic_zsmul {n : ℤ} (hn : 1 < |n|) : Ergodic fun y : AddCircle T => n • y := { measurePreserving_zsmul volume (abs_pos.mp <| lt_trans zero_lt_one hn) with aeconst_set := fun s hs hs' => by diff --git a/Mathlib/Dynamics/Ergodic/Ergodic.lean b/Mathlib/Dynamics/Ergodic/Ergodic.lean index bf33a3b58de71f..0693fa279128ed 100644 --- a/Mathlib/Dynamics/Ergodic/Ergodic.lean +++ b/Mathlib/Dynamics/Ergodic/Ergodic.lean @@ -83,6 +83,7 @@ theorem smul_measure {R : Type*} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ (hf : PreErgodic f μ) (c : R) : PreErgodic f (c • μ) where aeconst_set _s hs hfs := (hf.aeconst_set hs hfs).anti <| ae_smul_measure_le _ +set_option backward.isDefEq.respectTransparency false in theorem zero_measure (f : α → α) : @PreErgodic α m f 0 where aeconst_set _ _ _ := by simp diff --git a/Mathlib/Dynamics/Flow.lean b/Mathlib/Dynamics/Flow.lean index 45bfb976fdfda6..4a3d4de6a7fae4 100644 --- a/Mathlib/Dynamics/Flow.lean +++ b/Mathlib/Dynamics/Flow.lean @@ -152,7 +152,7 @@ theorem coe_restrict_apply {s : Set α} (h : IsInvariant ϕ s) (t : τ) (x : s) set_option linter.style.whitespace false in -- manual alignment is not recognised /-- Convert a flow to an additive monoid action. -/ -@[implicit_reducible] +@[instance_reducible] def toAddAction : AddAction τ α where vadd := ϕ add_vadd := ϕ.map_add' diff --git a/Mathlib/FieldTheory/CardinalEmb.lean b/Mathlib/FieldTheory/CardinalEmb.lean index 55b85ffa1f09af..b6400af34c7b71 100644 --- a/Mathlib/FieldTheory/CardinalEmb.lean +++ b/Mathlib/FieldTheory/CardinalEmb.lean @@ -281,6 +281,7 @@ lemma eq_bot_of_not_nonempty (hi : ¬ Nonempty (Iio i)) : filtration i = ⊥ := rw [← range_coe] at hi; exact (hi inferInstance).elim · exact bot_unique <| adjoin_le_iff.mpr fun _ ⟨j, hj, _⟩ ↦ (hi ⟨j, coe_lt_coe.mpr hj⟩).elim +set_option backward.isDefEq.respectTransparency.types false in open Classical in /-- If `i` is a limit, the type of embeddings of `E⟮ Polynomial.Splits.X_sub_C _ +set_option backward.isDefEq.respectTransparency.types false in instance isSeparable : Algebra.IsSeparable (FixedPoints.subfield G F) F := by classical exact ⟨fun x => by diff --git a/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean b/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean index 54329fa3fe8621..eb6ba9256e5fd7 100644 --- a/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean +++ b/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean @@ -395,6 +395,7 @@ noncomputable def intermediateFieldEquivSubgroup [Finite G] : theorem ofDual_intermediateFieldEquivSubgroup_apply [Finite G] {F} : (intermediateFieldEquivSubgroup G K L F).ofDual = fixingSubgroup G (F : Set L) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem intermediateFieldEquivSubgroup_symm_apply [Finite G] {H} : (intermediateFieldEquivSubgroup G K L).symm H = FixedPoints.intermediateField H.ofDual := by obtain ⟨H, rfl⟩ := OrderDual.toDual.surjective H diff --git a/Mathlib/FieldTheory/Galois/Profinite.lean b/Mathlib/FieldTheory/Galois/Profinite.lean index 6fe509a206fbe2..c8ae02ab25c78d 100644 --- a/Mathlib/FieldTheory/Galois/Profinite.lean +++ b/Mathlib/FieldTheory/Galois/Profinite.lean @@ -61,8 +61,14 @@ variable {k K : Type*} [Field k] [Field K] [Algebra k K] section Profinite +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + FiniteGrp.of + Set + /-- The (finite) Galois group `Gal(L / k)` associated to a `L : FiniteGaloisIntermediateField k K` `L`. -/ +@[local implicit_reducible] def FiniteGaloisIntermediateField.finGaloisGroup (L : FiniteGaloisIntermediateField k K) : FiniteGrp := letI := AlgEquiv.fintype k L @@ -105,6 +111,7 @@ end finGaloisGroupMap variable (k K) in /-- The functor from `FiniteGaloisIntermediateField` (ordered by reverse inclusion) to `FiniteGrp`, mapping each `FiniteGaloisIntermediateField` `L` to `Gal (L/k)` -/ +@[local implicit_reducible] noncomputable def finGaloisGroupFunctor : (FiniteGaloisIntermediateField k K)ᵒᵖ ⥤ FiniteGrp where obj L := L.unop.finGaloisGroup map := finGaloisGroupMap diff --git a/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean b/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean index 3a118004d1cb36..c18716d368c5c5 100644 --- a/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean @@ -598,7 +598,7 @@ lemma algHomAdjoinIntegralEquiv_symm_apply_gen (h : IsIntegral F α) rw [adjoin.powerBasis_gen, minpoly_gen]; exact (mem_aroots.mp x.2).2 /-- Fintype of algebra homomorphism `F⟮α⟯ →ₐ[F] K` -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfAlgHomAdjoinIntegral (h : IsIntegral F α) : Fintype (F⟮α⟯ →ₐ[F] K) := PowerBasis.AlgHom.fintype (adjoin.powerBasis h) diff --git a/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean b/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean index addd091a272214..0cbee446b533d7 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean @@ -82,6 +82,7 @@ def toSplittingField (s : Finset (Monics k)) : MvPolynomial.aeval fun fi ↦ if hf : fi.1 ∈ s then (finEquivRoots (Monics.splits_finsetProd hf) fi.2).1.1 else 37 +set_option backward.isDefEq.respectTransparency.types false in theorem toSplittingField_coeff {s : Finset (Monics k)} {f} (h : f ∈ s) (n) : toSplittingField s ((subProdXSubC f).coeff n) = 0 := by classical @@ -190,6 +191,7 @@ instance isAlgebraic : Algebra.IsAlgebraic k (AlgebraicClosure k) := erw [eval_C] simp⟩ +set_option backward.isDefEq.respectTransparency.types false in instance : IsAlgClosure k (AlgebraicClosure k) := .of_splits fun f hf _ ↦ by rw [show f = (⟨f, hf⟩ : Monics k) from rfl, Monics.map_eq_prod] exact Splits.prod fun _ _ ↦ (Splits.X_sub_C _).map _ diff --git a/Mathlib/FieldTheory/Isaacs.lean b/Mathlib/FieldTheory/Isaacs.lean index 3f214bd9523737..1e91a760ccfefc 100644 --- a/Mathlib/FieldTheory/Isaacs.lean +++ b/Mathlib/FieldTheory/Isaacs.lean @@ -38,6 +38,7 @@ open Polynomial IntermediateField variable {F E K : Type*} [Field F] [Field E] [Field K] [Algebra F E] [Algebra F K] variable [alg : Algebra.IsAlgebraic F E] +set_option backward.isDefEq.respectTransparency.types false in theorem nonempty_algHom_of_exists_root (h : ∀ x : E, ∃ y : K, aeval y (minpoly F x) = 0) : Nonempty (E →ₐ[F] K) := by refine Lifts.nonempty_algHom_of_exist_lifts_finset fun S ↦ ⟨⟨adjoin F S, ?_⟩, subset_adjoin _ _⟩ diff --git a/Mathlib/FieldTheory/KrullTopology.lean b/Mathlib/FieldTheory/KrullTopology.lean index 2388afc6796f00..b93776b39fd271 100644 --- a/Mathlib/FieldTheory/KrullTopology.lean +++ b/Mathlib/FieldTheory/KrullTopology.lean @@ -100,7 +100,7 @@ theorem mem_galBasis_iff (K L : Type*) [Field K] [Field L] [Algebra K L] (U : Se /-- For a field extension `L/K`, `galGroupBasis K L` is the group filter basis on `Gal(L/K)` whose sets are `Gal(L/E)` for finite subextensions `E/K`. -/ -@[implicit_reducible] +@[instance_reducible] def galGroupBasis (K L : Type*) [Field K] [Field L] [Algebra K L] : GroupFilterBasis Gal(L/K) where toFilterBasis := galBasis K L diff --git a/Mathlib/FieldTheory/KummerExtension.lean b/Mathlib/FieldTheory/KummerExtension.lean index f0a84824ce5962..c1644edaae8ed9 100644 --- a/Mathlib/FieldTheory/KummerExtension.lean +++ b/Mathlib/FieldTheory/KummerExtension.lean @@ -208,6 +208,7 @@ def autAdjoinRootXPowSubC : variable {n} +set_option backward.isDefEq.respectTransparency.types false in lemma autAdjoinRootXPowSubC_root (η) : autAdjoinRootXPowSubC n a η (root _) = ((η : Kˣ) : K) • root _ := by dsimp [autAdjoinRootXPowSubC, autAdjoinRootXPowSubCHom, AlgEquiv.algHomUnitsEquiv] diff --git a/Mathlib/FieldTheory/Minpoly/Field.lean b/Mathlib/FieldTheory/Minpoly/Field.lean index a530c39880c1a3..25c64aeff60fcf 100644 --- a/Mathlib/FieldTheory/Minpoly/Field.lean +++ b/Mathlib/FieldTheory/Minpoly/Field.lean @@ -216,7 +216,7 @@ section AlgHomFintype open scoped Classical in /-- A technical finiteness result. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Fintype.subtypeProd {E : Type*} {X : Set E} (hX : X.Finite) {L : Type*} (F : E → Multiset L) : Fintype (∀ x : X, { l : L // l ∈ F x }) := @Pi.instFintype _ _ _ (Finite.fintype hX) _ diff --git a/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean b/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean index 05bd01e589e60e..2f800421e5c2c9 100644 --- a/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean +++ b/Mathlib/FieldTheory/Minpoly/IsConjRoot.lean @@ -82,7 +82,7 @@ variable (R A) in /-- The setoid structure on `A` defined by the equivalence relation of `IsConjRoot R · ·`. -/ -@[implicit_reducible] +@[instance_reducible] def setoid : Setoid A where r := IsConjRoot R iseqv := ⟨fun _ => refl, symm, trans⟩ diff --git a/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean b/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean index 98287a725d13c4..6a4a871ae1fac2 100644 --- a/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean +++ b/Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean @@ -230,6 +230,7 @@ def _root_.Algebra.adjoin.powerBasis' (hx : IsIntegral R x) : theorem _root_.Algebra.adjoin.powerBasis'_dim (hx : IsIntegral R x) : (Algebra.adjoin.powerBasis' hx).dim = (minpoly R x).natDegree := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem _root_.Algebra.adjoin.powerBasis'_gen (hx : IsIntegral R x) : (adjoin.powerBasis' hx).gen = ⟨x, SetLike.mem_coe.1 <| subset_adjoin <| mem_singleton x⟩ := by diff --git a/Mathlib/FieldTheory/Perfect.lean b/Mathlib/FieldTheory/Perfect.lean index ae5491f0357ba2..8ef933b40fa987 100644 --- a/Mathlib/FieldTheory/Perfect.lean +++ b/Mathlib/FieldTheory/Perfect.lean @@ -314,6 +314,7 @@ instance ofFinite [Finite K] : PerfectField K := by variable [PerfectField K] +set_option backward.isDefEq.respectTransparency.types false in /-- A perfect field of characteristic `p` (prime) is a perfect ring. -/ instance toPerfectRing (p : ℕ) [hp : ExpChar K p] : PerfectRing K p := by refine PerfectRing.ofSurjective _ _ fun y ↦ ?_ diff --git a/Mathlib/FieldTheory/PolynomialGaloisGroup.lean b/Mathlib/FieldTheory/PolynomialGaloisGroup.lean index fc229f5e2f5dd5..768a8313aba85a 100644 --- a/Mathlib/FieldTheory/PolynomialGaloisGroup.lean +++ b/Mathlib/FieldTheory/PolynomialGaloisGroup.lean @@ -66,8 +66,9 @@ theorem ext {σ τ : p.Gal} (h : ∀ x ∈ p.rootSet p.SplittingField, σ x = τ ((SetLike.ext_iff.mp ?_ x).mpr Algebra.mem_top) rwa [eq_top_iff, ← SplittingField.adjoin_rootSet, Algebra.adjoin_le_iff] +set_option backward.isDefEq.respectTransparency.types false in /-- If `p` splits in `F` then the `p.gal` is trivial. -/ -@[implicit_reducible] +@[instance_reducible] def uniqueGalOfSplits (h : p.Splits) : Unique p.Gal where default := 1 uniq f := @@ -77,24 +78,31 @@ def uniqueGalOfSplits (h : p.Splits) : Unique p.Gal where ((SetLike.ext_iff.mp ((IsSplittingField.splits_iff _ p).mp h) x).mp Algebra.mem_top) rw [AlgEquiv.commutes, AlgEquiv.commutes] +set_option backward.isDefEq.respectTransparency.types false in instance [h : Fact p.Splits] : Unique p.Gal := uniqueGalOfSplits _ h.1 +set_option backward.isDefEq.respectTransparency.types false in instance uniqueGalZero : Unique (0 : F[X]).Gal := uniqueGalOfSplits _ (by simp) +set_option backward.isDefEq.respectTransparency.types false in instance uniqueGalOne : Unique (1 : F[X]).Gal := uniqueGalOfSplits _ Splits.one +set_option backward.isDefEq.respectTransparency.types false in instance uniqueGalC (x : F) : Unique (C x).Gal := uniqueGalOfSplits _ (by simp) +set_option backward.isDefEq.respectTransparency.types false in instance uniqueGalX : Unique (X : F[X]).Gal := uniqueGalOfSplits _ Splits.X +set_option backward.isDefEq.respectTransparency.types false in instance uniqueGalXSubC (x : F) : Unique (X - C x).Gal := uniqueGalOfSplits _ (Splits.X_sub_C _) +set_option backward.isDefEq.respectTransparency.types false in instance uniqueGalXPow (n : ℕ) : Unique (X ^ n : F[X]).Gal := uniqueGalOfSplits _ (Splits.X_pow _) diff --git a/Mathlib/FieldTheory/PrimitiveElement.lean b/Mathlib/FieldTheory/PrimitiveElement.lean index 7808f3e877d094..93e5ba8ab8a692 100644 --- a/Mathlib/FieldTheory/PrimitiveElement.lean +++ b/Mathlib/FieldTheory/PrimitiveElement.lean @@ -83,6 +83,7 @@ section PrimitiveElementInf variable {F : Type*} [Field F] [Infinite F] {E : Type*} [Field E] (ϕ : F →+* E) (α β : E) +set_option backward.isDefEq.respectTransparency.types false in theorem primitive_element_inf_aux_exists_c (f g : F[X]) : ∃ c : F, ∀ α' ∈ (f.map ϕ).roots, ∀ β' ∈ (g.map ϕ).roots, -(α' - α) / (β' - β) ≠ ϕ c := by classical diff --git a/Mathlib/FieldTheory/PurelyInseparable/Basic.lean b/Mathlib/FieldTheory/PurelyInseparable/Basic.lean index 97a3281f2fcf14..989a06e5823031 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/Basic.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/Basic.lean @@ -612,6 +612,7 @@ lemma adjoin_eq_of_isAlgebraic_of_isSeparable [Algebra.IsAlgebraic F E] obtain ⟨y, rfl⟩ := IsPurelyInseparable.surjective_algebraMap_of_isSeparable L K x exact y.2 +set_option backward.isDefEq.respectTransparency.types false in /-- If `K / E / F` is a field extension tower, such that `E / F` is algebraic, then `E` adjoin `separableClosure F K` is equal to `separableClosure E K`. -/ theorem adjoin_eq_of_isAlgebraic [Algebra.IsAlgebraic F E] : diff --git a/Mathlib/FieldTheory/RatFunc/Basic.lean b/Mathlib/FieldTheory/RatFunc/Basic.lean index fb732adde49cc6..f1bef19ebde35f 100644 --- a/Mathlib/FieldTheory/RatFunc/Basic.lean +++ b/Mathlib/FieldTheory/RatFunc/Basic.lean @@ -270,7 +270,7 @@ variable (K) [CommRing K] This is an intermediate step on the way to the full instance `RatFunc.instCommRing`. -/ -@[implicit_reducible] +@[instance_reducible] def instCommMonoid : CommMonoid K⟮X⟯ where mul_assoc := by frac_tac mul_comm := by frac_tac @@ -282,7 +282,7 @@ def instCommMonoid : CommMonoid K⟮X⟯ where This is an intermediate step on the way to the full instance `RatFunc.instCommRing`. -/ -@[implicit_reducible] +@[instance_reducible] def instAddCommGroup : AddCommGroup K⟮X⟯ where add_assoc := by frac_tac add_comm := by frac_tac @@ -363,6 +363,7 @@ theorem map_injective [MonoidHomClass F R[X] S[X]] (φ : F) (hφ : R[X]⁰ ≤ S Localization.mk_eq_mk_iff, Localization.r_iff_exists, mul_cancel_left_coe_nonZeroDivisors, exists_const, ← map_mul, hf.eq_iff] using h +set_option backward.isDefEq.respectTransparency.types false in /-- Lift a ring homomorphism that maps polynomials `φ : R[X] →+* S[X]` to a `R⟮X⟯ →+* S⟮X⟯`, on the condition that `φ` maps non-zero-divisors to non-zero-divisors, @@ -432,6 +433,7 @@ theorem liftMonoidWithZeroHom_injective [Nontrivial R] (φ : R[X] →*₀ G₀) · rwa [← map_mul, ← map_mul, hφ.eq_iff, mul_comm, mul_comm a'.fst] at this all_goals exact map_ne_zero_of_mem_nonZeroDivisors _ hφ (SetLike.coe_mem _) +set_option backward.isDefEq.respectTransparency.types false in /-- Lift an injective ring homomorphism `R[X] →+* L` to a `R⟮X⟯ →+* L` by mapping both the numerator and denominator and quotienting them. -/ def liftRingHom (φ : R[X] →+* L) (hφ : R[X]⁰ ≤ L⁰.comap φ) : R⟮X⟯ →+* L := @@ -456,10 +458,12 @@ def liftRingHom (φ : R[X] →+* L) (hφ : R[X]⁰ ≤ L⁰.comap φ) : R⟮X⟯ try simp only [← map_mul, ← Submonoid.coe_mul] exact nonZeroDivisors.ne_zero (hφ (SetLike.coe_mem _)) } +set_option backward.isDefEq.respectTransparency.types false in theorem liftRingHom_apply_ofFractionRing_mk (φ : R[X] →+* L) (hφ : R[X]⁰ ≤ L⁰.comap φ) (n : R[X]) (d : R[X]⁰) : liftRingHom φ hφ (ofFractionRing (Localization.mk n d)) = φ n / φ d := liftMonoidWithZeroHom_apply_ofFractionRing_mk _ hφ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma liftRingHom_ofFractionRing_algebraMap (φ : R[X] →+* L) (hφ : R[X]⁰ ≤ L⁰.comap φ) (x : R[X]) : @@ -467,6 +471,7 @@ lemma liftRingHom_ofFractionRing_algebraMap rw [← Localization.mk_one_eq_algebraMap, liftRingHom_apply_ofFractionRing_mk] simp +set_option backward.isDefEq.respectTransparency.types false in theorem liftRingHom_injective [Nontrivial R] (φ : R[X] →+* L) (hφ : Function.Injective φ) (hφ' : R[X]⁰ ≤ L⁰.comap φ := nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ hφ) : Function.Injective (liftRingHom φ hφ') := @@ -590,20 +595,24 @@ theorem liftMonoidWithZeroHom_apply_div' {L : Type*} [CommGroupWithZero L] φ p / φ q := by rw [← map_div₀, liftMonoidWithZeroHom_apply_div] +set_option backward.isDefEq.respectTransparency.types false in theorem liftRingHom_apply_div {L : Type*} [Field L] (φ : K[X] →+* L) (hφ : K[X]⁰ ≤ L⁰.comap φ) (p q : K[X]) : liftRingHom φ hφ (algebraMap _ _ p / algebraMap _ _ q) = φ p / φ q := liftMonoidWithZeroHom_apply_div _ hφ _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem liftRingHom_apply_div' {L : Type*} [Field L] (φ : K[X] →+* L) (hφ : K[X]⁰ ≤ L⁰.comap φ) (p q : K[X]) : liftRingHom φ hφ (algebraMap _ _ p) / liftRingHom φ hφ (algebraMap _ _ q) = φ p / φ q := liftMonoidWithZeroHom_apply_div' _ hφ _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma liftRingHom_algebraMap {L : Type*} [Field L] (φ : K[X] →+* L) (hφ : K[X]⁰ ≤ L⁰.comap φ) (x : K[X]) : liftRingHom φ hφ (algebraMap K[X] _ x) = φ x := by simpa using liftRingHom_apply_div' φ hφ x 1 +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma liftRingHom_comp_algebraMap {L : Type*} [Field L] (φ : K[X] →+* L) (hφ : K[X]⁰ ≤ L⁰.comap φ) : (liftRingHom φ hφ).comp (algebraMap K[X] _) = φ := @@ -640,6 +649,7 @@ theorem coe_mapAlgHom_eq_coe_map (φ : K[X] →ₐ[S] R[X]) (hφ : K[X]⁰ ≤ R (mapAlgHom φ hφ : K⟮X⟯ → R⟮X⟯) = map φ hφ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Lift an injective algebra homomorphism `K[X] →ₐ[S] L` to a `K⟮X⟯ →ₐ[S] L` by mapping both the numerator and denominator and quotienting them. -/ def liftAlgHom : K⟮X⟯ →ₐ[S] L := @@ -648,20 +658,24 @@ def liftAlgHom : K⟮X⟯ →ₐ[S] L := simp_rw [RingHom.toFun_eq_coe, AlgHom.toRingHom_eq_coe, algebraMap_apply r, liftRingHom_apply_div, AlgHom.coe_toRingHom, map_one, div_one, AlgHom.commutes] } +set_option backward.isDefEq.respectTransparency.types false in theorem liftAlgHom_apply_ofFractionRing_mk (n : K[X]) (d : K[X]⁰) : liftAlgHom φ hφ (ofFractionRing (Localization.mk n d)) = φ n / φ d := liftMonoidWithZeroHom_apply_ofFractionRing_mk _ hφ _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem liftAlgHom_injective (φ : K[X] →ₐ[S] L) (hφ : Function.Injective φ) (hφ' : K[X]⁰ ≤ L⁰.comap φ := nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ hφ) : Function.Injective (liftAlgHom φ hφ') := liftMonoidWithZeroHom_injective _ hφ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem liftAlgHom_apply_div' (p q : K[X]) : liftAlgHom φ hφ (algebraMap _ _ p) / liftAlgHom φ hφ (algebraMap _ _ q) = φ p / φ q := liftMonoidWithZeroHom_apply_div' _ hφ _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem liftAlgHom_apply_div (p q : K[X]) : liftAlgHom φ hφ (algebraMap _ _ p / algebraMap _ _ q) = φ p / φ q := liftMonoidWithZeroHom_apply_div _ hφ _ _ @@ -723,6 +737,7 @@ theorem mk_eq_mk' (f : Polynomial K) {g : Polynomial K} (hg : g ≠ 0) : ⟨g, mem_nonZeroDivisors_iff_ne_zero.2 hg⟩ := by simp only [mk_eq_div, IsFractionRing.mk'_eq_div] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem ofFractionRing_eq : (ofFractionRing : FractionRing K[X] → K⟮X⟯) = IsLocalization.algEquiv K[X]⁰ _ _ := @@ -731,6 +746,7 @@ theorem ofFractionRing_eq : simp only [Localization.mk_eq_mk'_apply, ofFractionRing_mk', IsLocalization.algEquiv_apply, IsLocalization.map_mk', RingHom.id_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toFractionRing_eq : (toFractionRing : K⟮X⟯ → FractionRing K[X]) = IsLocalization.algEquiv K[X]⁰ _ _ := @@ -739,6 +755,7 @@ theorem toFractionRing_eq : simp only [Localization.mk_eq_mk'_apply, ofFractionRing_mk', IsLocalization.algEquiv_apply, IsLocalization.map_mk', RingHom.id_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toFractionRingRingEquiv_symm_eq : (toFractionRingRingEquiv K).symm = (IsLocalization.algEquiv K[X]⁰ _ _).toRingEquiv := by @@ -1109,10 +1126,12 @@ theorem liftMonoidWithZeroHom_apply {L : Type*} [CommGroupWithZero L] (φ : K[X] liftMonoidWithZeroHom φ hφ f = φ f.num / φ f.denom := by rw [← num_div_denom f, liftMonoidWithZeroHom_apply_div, num_div_denom] +set_option backward.isDefEq.respectTransparency.types false in theorem liftRingHom_apply {L : Type*} [Field L] (φ : K[X] →+* L) (hφ : K[X]⁰ ≤ L⁰.comap φ) (f : K⟮X⟯) : liftRingHom φ hφ f = φ f.num / φ f.denom := liftMonoidWithZeroHom_apply _ hφ _ +set_option backward.isDefEq.respectTransparency.types false in theorem liftAlgHom_apply {L S : Type*} [Field L] [CommSemiring S] [Algebra S K[X]] [Algebra S L] (φ : K[X] →ₐ[S] L) (hφ : K[X]⁰ ≤ L⁰.comap φ) (f : K⟮X⟯) : liftAlgHom φ hφ f = φ f.num / φ f.denom := diff --git a/Mathlib/FieldTheory/RatFunc/IntermediateField.lean b/Mathlib/FieldTheory/RatFunc/IntermediateField.lean index c91f95b5d33eab..4c383ac3e84ad4 100644 --- a/Mathlib/FieldTheory/RatFunc/IntermediateField.lean +++ b/Mathlib/FieldTheory/RatFunc/IntermediateField.lean @@ -122,6 +122,7 @@ theorem transcendental_of_ne_C (hf : ¬∃ c, f = C c) : Transcendental K f := b rw [Algebra.transcendental_iff_not_isAlgebraic] at tr exact tr <| Algebra.IsAlgebraic.trans _ _ _ (alg := f.isAlgebraic_adjoin_simple_X' hf) +set_option backward.isDefEq.respectTransparency.types false in theorem irreducible_minpolyX' (hf : ¬∃ c, f = C c) : Irreducible (f.minpolyX K[f]) := by let e := Polynomial.algEquivOfTranscendental K f (f.transcendental_of_ne_C hf) let φ : K[X][X] := f.num.map (algebraMap ..) - diff --git a/Mathlib/FieldTheory/RatFunc/Valuation.lean b/Mathlib/FieldTheory/RatFunc/Valuation.lean index 7f9ec8ae069657..ad340c2f547df2 100644 --- a/Mathlib/FieldTheory/RatFunc/Valuation.lean +++ b/Mathlib/FieldTheory/RatFunc/Valuation.lean @@ -114,7 +114,7 @@ instance : Valuation.IsTrivialOn F (inftyValuation F) := ⟨fun _ hx ↦ by simp [inftyValuation.C _ hx]⟩ /-- The valued field `F(t)` with the valuation at infinity. -/ -@[implicit_reducible] +@[instance_reducible] def inftyValued : Valued (RatFunc F) ℤᵐ⁰ := Valued.mk' <| inftyValuation F diff --git a/Mathlib/FieldTheory/SeparablyGenerated.lean b/Mathlib/FieldTheory/SeparablyGenerated.lean index 5301cf752be973..ceff7cad7746bb 100644 --- a/Mathlib/FieldTheory/SeparablyGenerated.lean +++ b/Mathlib/FieldTheory/SeparablyGenerated.lean @@ -304,6 +304,7 @@ lemma exists_isTranscendenceBasis_and_isSeparable_of_linearIndepOn_pow_of_essFin end +set_option backward.isDefEq.respectTransparency.types false in variable (k K) in /-- Any finitely generated extension over perfect fields are separably generated. -/ lemma exists_isTranscendenceBasis_and_isSeparable_of_perfectField diff --git a/Mathlib/Geometry/Convex/Cone/Basic.lean b/Mathlib/Geometry/Convex/Cone/Basic.lean index e733dc49d29151..a6b16c05cee8ee 100644 --- a/Mathlib/Geometry/Convex/Cone/Basic.lean +++ b/Mathlib/Geometry/Convex/Cone/Basic.lean @@ -316,7 +316,7 @@ theorem Blunt.salient : C.Blunt → C.Salient := by exact mt Flat.pointed /-- A pointed convex cone defines a preorder. -/ -@[implicit_reducible] +@[instance_reducible] def toPreorder (C : ConvexCone R G) (h₁ : C.Pointed) : Preorder G where le x y := y - x ∈ C le_refl x := by rw [sub_self x]; exact h₁ diff --git a/Mathlib/Geometry/Convex/Cone/Pointed.lean b/Mathlib/Geometry/Convex/Cone/Pointed.lean index 20cf10a6fe2f59..55d925222efddf 100644 --- a/Mathlib/Geometry/Convex/Cone/Pointed.lean +++ b/Mathlib/Geometry/Convex/Cone/Pointed.lean @@ -113,9 +113,11 @@ def toConvexCone (C : PointedCone R E) : ConvexCone R E where instance : Coe (PointedCone R E) (ConvexCone R E) where coe := toConvexCone +set_option backward.isDefEq.respectTransparency false in theorem toConvexCone_injective : Injective ((↑) : PointedCone R E → ConvexCone R E) := fun _ _ => by simp [toConvexCone] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem pointed_toConvexCone (C : PointedCone R E) : (C : ConvexCone R E).Pointed := by simp [toConvexCone, ConvexCone.Pointed] @@ -340,6 +342,7 @@ def lineal (C : PointedCone R E) : Submodule R E where @[simp] theorem support_eq (C : PointedCone R E) : C.support = C.lineal.toAddSubgroup := rfl +set_option backward.isDefEq.respectTransparency false in /-- The lineality space of a cone is the largest submodule contained in the cone. -/ theorem gc_ofSubmodule_lineal : GaloisConnection (α := Submodule R E) ofSubmodule lineal := diff --git a/Mathlib/Geometry/Convex/ConvexSpace/AffineSpace.lean b/Mathlib/Geometry/Convex/ConvexSpace/AffineSpace.lean index 1b9dadd35db131..1e4d0432be7f76 100644 --- a/Mathlib/Geometry/Convex/ConvexSpace/AffineSpace.lean +++ b/Mathlib/Geometry/Convex/ConvexSpace/AffineSpace.lean @@ -130,6 +130,7 @@ theorem iConvexComb_eq_affineCombination (s : StdSimplex R I) (f : I → P) : s.weights.sum fun x r ↦ r • (f x -ᵥ p) by simpa simp [Finsupp.sum_mapDomain_index, add_smul] +set_option backward.isDefEq.respectTransparency.types false in /-- `convexCombPair` in an affine space is the affine line map. -/ theorem convexCombPair_eq_lineMap (s t : R) (hs : 0 ≤ s) (ht : 0 ≤ t) (h : s + t = 1) (x y : P) : diff --git a/Mathlib/Geometry/Convex/ConvexSpace/Defs.lean b/Mathlib/Geometry/Convex/ConvexSpace/Defs.lean index 9f7e74f57e4fd9..e3a7dffccc8d4a 100644 --- a/Mathlib/Geometry/Convex/ConvexSpace/Defs.lean +++ b/Mathlib/Geometry/Convex/ConvexSpace/Defs.lean @@ -487,6 +487,7 @@ lemma IsAffineMap.map_convexCombPair {f : M → N} (hf : IsAffineMap R f) f (convexCombPair s t hs ht h x y) = convexCombPair s t hs ht h (f x) (f y) := by simp [hf.map_sConvexComb, convexCombPair] +set_option backward.isDefEq.respectTransparency.types false in /-- Flattening with the outer combination specialized to `convexCombPair`. -/ lemma convexCombPair_iConvexComb_iConvexComb {J₁ : Type u₁} {J₂ : Type u₂} (g₁ : StdSimplex R J₁) (g₂ : StdSimplex R J₂) diff --git a/Mathlib/Geometry/Convex/Set.lean b/Mathlib/Geometry/Convex/Set.lean index 71d316bcad1392..3c34eaf413c6be 100644 --- a/Mathlib/Geometry/Convex/Set.lean +++ b/Mathlib/Geometry/Convex/Set.lean @@ -182,6 +182,7 @@ section Field variable [Field K] [LinearOrder K] [IsStrictOrderedRing K] [ConvexSpace K X] {w : StdSimplex K X} {s t : Set X} {x y : X} +set_option backward.isDefEq.respectTransparency.types false in /-- Convexity of a set can be checked via binary combinations if the scalars form a field. -/ lemma IsConvexSet.of_convexCombPair_mem (hs : ∀ a b : K, ∀ ha hb hab, ∀ x ∈ s, ∀ y ∈ s, convexCombPair a b ha hb hab x y ∈ s) : diff --git a/Mathlib/Geometry/Diffeology/Basic.lean b/Mathlib/Geometry/Diffeology/Basic.lean index 8262d574912185..782b94d1601eed 100644 --- a/Mathlib/Geometry/Diffeology/Basic.lean +++ b/Mathlib/Geometry/Diffeology/Basic.lean @@ -266,7 +266,7 @@ namespace DiffeologicalSpace /-- Replaces the D-topology of a diffeology with another topology equal to it. Useful to construct diffeologies with better definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def replaceDTopology {X : Type*} (d : DiffeologicalSpace X) (t : TopologicalSpace X) (h : @dTopology _ d = t) : DiffeologicalSpace X where dTopology := t @@ -313,7 +313,7 @@ structure CorePlotsOn (X : Type*) where organised in the form of the auxiliary `CorePlotsOn` structure. This is more involved in most regards, but also often makes it quite a lot easier to prove the locality condition. -/ -@[implicit_reducible] +@[instance_reducible] def ofCorePlotsOn {X : Type*} (d : DiffeologicalSpace.CorePlotsOn X) : DiffeologicalSpace X where plots _ := {p | d.isPlot p} @@ -478,7 +478,7 @@ lemma injective_toPlots : Function.Injective (@toPlots X) := fun d d' h ↦ by ext n p; exact Set.ext_iff.1 h ⟨n, p⟩ /-- The diffeology generated by a set `g` of plots. -/ -@[implicit_reducible] +@[instance_reducible] def generateFrom (g : Set ((n : ℕ) × (𝔼ⁿ → X))) : DiffeologicalSpace X where plots n := {p | ∀ (d : DiffeologicalSpace X), g ⊆ d.toPlots → ⟨n, p⟩ ∈ d.toPlots} constant_plots {n} x := fun _ _ ↦ constant_plots x @@ -517,7 +517,7 @@ lemma generateFrom_le_iff {g : Set ((n : ℕ) × (𝔼ⁿ → X))} {d : Diffeolo /-- The diffeology defined by `g`. Same as `generateFrom g`, except that its set of plots is definitionally equal to `g`. -/ -@[implicit_reducible] +@[instance_reducible] protected def mkOfClosure (g : Set ((n : ℕ) × (𝔼ⁿ → X))) (hg : (generateFrom g).toPlots = g) : DiffeologicalSpace X where plots n := {p | ⟨n, p⟩ ∈ g} diff --git a/Mathlib/Geometry/Euclidean/Altitude.lean b/Mathlib/Geometry/Euclidean/Altitude.lean index bf6cf086d411e9..0aba743e493ee2 100644 --- a/Mathlib/Geometry/Euclidean/Altitude.lean +++ b/Mathlib/Geometry/Euclidean/Altitude.lean @@ -57,6 +57,7 @@ theorem altitude_def {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) : affineSpan ℝ (Set.range s.points) := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma altitude_reindex {m n : ℕ} (s : Simplex ℝ P n) (e : Fin (n + 1) ≃ Fin (m + 1)) : (s.reindex e).altitude = s.altitude ∘ e.symm := by ext i diff --git a/Mathlib/Geometry/Euclidean/Incenter.lean b/Mathlib/Geometry/Euclidean/Incenter.lean index 2d2c443c690725..1f20a0788e4860 100644 --- a/Mathlib/Geometry/Euclidean/Incenter.lean +++ b/Mathlib/Geometry/Euclidean/Incenter.lean @@ -1034,6 +1034,7 @@ lemma touchpoint_empty_notMem_affineSpan_of_ne {i j : Fin (n + 1)} (hne : i ≠ s.touchpoint ∅ i ∉ affineSpan ℝ (Set.range (s.faceOpposite j).points) := s.excenterExists_empty.touchpoint_notMem_affineSpan_of_ne hne +set_option backward.isDefEq.respectTransparency false in variable {s} in lemma ExcenterExists.sign_signedInfDist_lineMap_excenter_touchpoint {signs : Finset (Fin (n + 1))} (h : s.ExcenterExists signs) {i j : Fin (n + 1)} (hne : i ≠ j) {r : ℝ} (hr : r ∈ Set.Icc 0 1) : @@ -1068,6 +1069,7 @@ lemma ExcenterExists.sign_signedInfDist_lineMap_excenter_touchpoint {signs : Fin convert! Set.mem_image_of_mem _ (Set.left_mem_Icc.2 (zero_le_one' ℝ)) simp +set_option backward.isDefEq.respectTransparency false in lemma sign_signedInfDist_lineMap_incenter_touchpoint {i j : Fin (n + 1)} (hne : i ≠ j) {r : ℝ} (hr : r ∈ Set.Icc 0 1) : SignType.sign diff --git a/Mathlib/Geometry/Euclidean/Inversion/Basic.lean b/Mathlib/Geometry/Euclidean/Inversion/Basic.lean index 257a3c57a22969..08b9868f5dffbc 100644 --- a/Mathlib/Geometry/Euclidean/Inversion/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Inversion/Basic.lean @@ -56,6 +56,7 @@ sphere `Metric.sphere c R`. We also prove that the distance to the center of the this inversion is given by `R ^ 2 / dist x c`. -/ +set_option backward.isDefEq.respectTransparency false in theorem inversion_eq_lineMap (c : P) (R : ℝ) (x : P) : inversion c R x = lineMap c x ((R / dist x c) ^ 2) := rfl diff --git a/Mathlib/Geometry/Euclidean/MongePoint.lean b/Mathlib/Geometry/Euclidean/MongePoint.lean index e75eae0305c8d2..0d27efbce7b010 100644 --- a/Mathlib/Geometry/Euclidean/MongePoint.lean +++ b/Mathlib/Geometry/Euclidean/MongePoint.lean @@ -93,6 +93,7 @@ theorem mongePoint_eq_smul_vsub_vadd_circumcenter {n : ℕ} (s : Simplex ℝ P n congr 3 convert! Finset.univ.affineCombination_map e.toEmbedding _ _ <;> simp [Function.comp_assoc] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mongePoint_map {V₂ P₂ : Type*} [NormedAddCommGroup V₂] [InnerProductSpace ℝ V₂] [MetricSpace P₂] [NormedAddTorsor V₂ P₂] diff --git a/Mathlib/Geometry/Euclidean/PerpBisector.lean b/Mathlib/Geometry/Euclidean/PerpBisector.lean index edf5f73730f982..1f144b0b6b1bae 100644 --- a/Mathlib/Geometry/Euclidean/PerpBisector.lean +++ b/Mathlib/Geometry/Euclidean/PerpBisector.lean @@ -165,6 +165,7 @@ theorem dist_lt_of_sbtw_of_mem_perpBisector {a b c p : P} rw [right_vsub_midpoint, inner_smul_right, mem_perpBisector_iff_inner_eq_zero.mp hp, invOf_eq_inv, mul_zero] +set_option backward.isDefEq.respectTransparency false in /-- If `p` lies on the perpendicular bisector of `ab` and `b` is weakly between `a` and `c`, then `p` is at least as close to `b` as to `c`. -/ theorem dist_le_of_wbtw_of_mem_perpBisector {a b c p : P} diff --git a/Mathlib/Geometry/Euclidean/SignedDist.lean b/Mathlib/Geometry/Euclidean/SignedDist.lean index 37621c1f735dee..b29055e7d8916c 100644 --- a/Mathlib/Geometry/Euclidean/SignedDist.lean +++ b/Mathlib/Geometry/Euclidean/SignedDist.lean @@ -205,6 +205,7 @@ lemma signedDist_eq_dist_iff_vsub_mem_span : signedDist v p q = dist p q ↔ q - rw [← neg_eq_iff_eq_neg, ← signedDist_neg, neg_vsub_eq_vsub_rev] apply signedDist_vsub_self +set_option backward.isDefEq.respectTransparency false in lemma signedDist_lineMap_lineMap (c₁ c₂ : ℝ) : signedDist v (AffineMap.lineMap p q c₁) (AffineMap.lineMap p q c₂) = (c₂ - c₁) * signedDist v p q := by @@ -212,18 +213,22 @@ lemma signedDist_lineMap_lineMap (c₁ c₂ : ℝ) : · simp [AffineMap.lineMap_apply_ring'] · rw [sub_mul, ← signedDist_anticomm v p, mul_neg, sub_eq_add_neg] +set_option backward.isDefEq.respectTransparency false in lemma signedDist_lineMap_left (c : ℝ) : signedDist v (AffineMap.lineMap p q c) p = -c * signedDist v p q := by simpa using signedDist_lineMap_lineMap v p q c 0 +set_option backward.isDefEq.respectTransparency false in lemma signedDist_left_lineMap (c : ℝ) : signedDist v p (AffineMap.lineMap p q c) = c * signedDist v p q := by simpa using signedDist_lineMap_lineMap v p q 0 c +set_option backward.isDefEq.respectTransparency false in lemma signedDist_lineMap_right (c : ℝ) : signedDist v (AffineMap.lineMap p q c) q = (1 - c) * signedDist v p q := by simpa using signedDist_lineMap_lineMap v p q c 1 +set_option backward.isDefEq.respectTransparency false in lemma signedDist_right_lineMap (c : ℝ) : signedDist v q (AffineMap.lineMap p q c) = (c - 1) * signedDist v p q := by simpa using signedDist_lineMap_lineMap v p q 1 c @@ -299,6 +304,7 @@ trilinear coordinates; in a tetrahedron, they are quadriplanar coordinates. -/ noncomputable def signedInfDist : P →ᴬ[ℝ] ℝ := AffineSubspace.signedInfDist (affineSpan ℝ (s.points '' {i}ᶜ)) (s.points i) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma signedInfDist_reindex {m : ℕ} [NeZero m] (e : Fin (n + 1) ≃ Fin (m + 1)) (j : Fin (m + 1)) : (s.reindex e).signedInfDist j = s.signedInfDist (e.symm j) := by simp_rw [signedInfDist, reindex_points, Set.image_comp, Set.image_compl_eq e.symm.bijective, diff --git a/Mathlib/Geometry/Euclidean/Sphere/Basic.lean b/Mathlib/Geometry/Euclidean/Sphere/Basic.lean index e641855739337f..4fe149a6b8aef4 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Basic.lean @@ -444,6 +444,7 @@ theorem Sphere.inner_vsub_center_midpoint_vsub {p₁ p₂ : P} {s : Sphere P} (dist_left_midpoint_eq_dist_right_midpoint p₁ p₂) (dist_center_eq_dist_center_of_mem_sphere hp₁ hp₂) +set_option backward.isDefEq.respectTransparency false in /-- The distance from the center of a sphere to any point strictly between two points on the sphere is strictly less than the radius. -/ theorem Sphere.dist_center_lt_radius_of_sbtw {p₁ p₂ p : P} {s : Sphere P} diff --git a/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean b/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean index 8b4dbdca401b76..f9a599cc8a6ef8 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/SecondInter.lean @@ -43,6 +43,7 @@ the second intersection with the sphere through `p` and with center `s.center`. def Sphere.secondInter (s : Sphere P) (p : P) (v : V) : P := (-2 * ⟪v, p -ᵥ s.center⟫ / ⟪v, v⟫) • v +ᵥ p +set_option backward.isDefEq.respectTransparency false in @[simp] lemma Sphere.secondInter_map (s : Sphere P) (p : P) (v : V) (f : P →ᵃⁱ[ℝ] P₂) : Sphere.secondInter ⟨f s.center, s.radius⟩ (f p) (f.linearIsometry v) = f (s.secondInter p v) := by @@ -144,6 +145,7 @@ theorem Sphere.secondInter_secondInter (s : Sphere P) (p : P) (v : V) : convert! zero_div (G₀ := ℝ) _ ring +set_option backward.isDefEq.respectTransparency false in /-- If the vector passed to `secondInter` is given by a subtraction involving the point in `secondInter`, the result of `secondInter` may be expressed using `lineMap`. -/ theorem Sphere.secondInter_eq_lineMap (s : Sphere P) (p p' : P) : @@ -212,6 +214,7 @@ lemma Sphere.sOppSide_faceOpposite_secondInter_of_mem_interior_faceOpposite {s : attribute [local instance] Nat.AtLeastTwo.neZero_sub_one +set_option backward.isDefEq.respectTransparency false in /-- If the point passed to `secondInter` is a vertex of a simplex, lying on the sphere, and all vertices lie on or inside the sphere, and the vector passed to `secondInter` is given by a subtraction involving that vertex and a point in the interior of the simplex, the given vertex diff --git a/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean b/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean index 44141b8669e0c3..3b20ce9f999210 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Tangent.lean @@ -427,6 +427,7 @@ lemma IsIntTangent.dist_center {s₁ s₂ : Sphere P} (h : s₁.IsIntTangent s rw [← dist_add_dist_eq_iff, mem_sphere'.1 h₁, mem_sphere'.1 h₂] at h simp [← h, dist_comm] +set_option backward.isDefEq.respectTransparency false in lemma isExtTangent_iff_dist_center {s₁ s₂ : Sphere P} : s₁.IsExtTangent s₂ ↔ dist s₁.center s₂.center = s₁.radius + s₂.radius ∧ 0 ≤ s₁.radius ∧ 0 ≤ s₂.radius := by refine ⟨fun h ↦ ⟨h.dist_center, ?_⟩, ?_⟩ @@ -451,6 +452,7 @@ lemma isExtTangent_iff_dist_center {s₁ s₂ : Sphere P} : s₁.IsExtTangent s · rw [div_le_one (by positivity)] linarith +set_option backward.isDefEq.respectTransparency false in lemma isIntTangent_iff_dist_center [Nontrivial V] {s₁ s₂ : Sphere P} : s₁.IsIntTangent s₂ ↔ dist s₁.center s₂.center = s₂.radius - s₁.radius ∧ 0 ≤ s₁.radius ∧ 0 ≤ s₂.radius := by refine ⟨fun h ↦ ⟨h.dist_center, ?_⟩, ?_⟩ diff --git a/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean b/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean index fe8fdffe336de7..e2398d93e9d60a 100644 --- a/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean +++ b/Mathlib/Geometry/Manifold/Algebra/LeftInvariantDerivation.lean @@ -101,6 +101,7 @@ protected theorem map_neg : X (-f) = -X f := by simp protected theorem map_sub : X (f - f') = X f - X f' := by simp +set_option backward.isDefEq.respectTransparency false in protected theorem map_smul : X (r • f) = r • X f := by simp @[simp] @@ -214,6 +215,7 @@ theorem comp_L : (X f).comp (𝑳 I g) = X (f.comp (𝑳 I g)) := by rw [ContMDiffMap.comp_apply, L_apply, ← evalAt_apply, evalAt_mul, hfdifferential_apply, fdifferential_apply, evalAt_apply] +set_option backward.isDefEq.respectTransparency false in instance : Bracket (LeftInvariantDerivation I G) (LeftInvariantDerivation I G) where bracket X Y := ⟨⁅(X : Derivation 𝕜 C^∞⟮I, G; 𝕜⟯ C^∞⟮I, G; 𝕜⟯), Y⁆, fun g => by @@ -252,6 +254,7 @@ instance : LieRing (LeftInvariantDerivation I G) where simp only [commutator_apply, coe_add, map_sub, Pi.add_apply] ring +set_option backward.isDefEq.respectTransparency false in instance : LieAlgebra 𝕜 (LeftInvariantDerivation I G) where lie_smul r Y Z := by ext1 diff --git a/Mathlib/Geometry/Manifold/ChartedSpace.lean b/Mathlib/Geometry/Manifold/ChartedSpace.lean index da6ab6a1bf0368..001d95756d838b 100644 --- a/Mathlib/Geometry/Manifold/ChartedSpace.lean +++ b/Mathlib/Geometry/Manifold/ChartedSpace.lean @@ -282,7 +282,7 @@ theorem ChartedSpace.locPathConnectedSpace [LocPathConnectedSpace H] : LocPathCo /-- If `M` is modelled on `H'` and `H'` is itself modelled on `H`, then we can consider `M` as being modelled on `H`. -/ -@[implicit_reducible] +@[instance_reducible] def ChartedSpace.comp (H : Type*) [TopologicalSpace H] (H' : Type*) [TopologicalSpace H'] (M : Type*) [TopologicalSpace M] [ChartedSpace H H'] [ChartedSpace H' M] : ChartedSpace H M where @@ -324,7 +324,7 @@ end section Constructions /-- An empty type is a charted space over any topological space. -/ -@[implicit_reducible] +@[instance_reducible] def ChartedSpace.empty (H : Type*) [TopologicalSpace H] (M : Type*) [TopologicalSpace M] [IsEmpty M] : ChartedSpace H M where atlas := ∅ @@ -491,7 +491,7 @@ variable [TopologicalSpace H] [TopologicalSpace M] [TopologicalSpace M'] /-- The disjoint union of two charted spaces modelled on a non-empty space `H` is a charted space over `H`. -/ -@[implicit_reducible] +@[instance_reducible] def ChartedSpace.sum_of_nonempty [Nonempty H] : ChartedSpace H (M ⊕ M') where atlas := ((fun e ↦ e.lift_openEmbedding IsOpenEmbedding.inl) '' cm.atlas) ∪ ((fun e ↦ e.lift_openEmbedding IsOpenEmbedding.inr) '' cm'.atlas) @@ -572,7 +572,7 @@ variable [TopologicalSpace M] [TopologicalSpace M'] [TopologicalSpace H] [Charte /-- Given a right inverse for a local homeomorphism `f : M → M'`, endow `M'` with a `ChartedSpace` structure by pushing forward the `ChartedSpace` structure from `M`. -/ -@[implicit_reducible] +@[instance_reducible] def IsLocalHomeomorph.chartedSpaceOfRightInverse {f : M → M'} (hf : IsLocalHomeomorph f) {g : M' → M} (hg : Function.RightInverse g f) : ChartedSpace H M' where @@ -585,7 +585,7 @@ def IsLocalHomeomorph.chartedSpaceOfRightInverse /-- Given a surjective local homeomorphism `f : M → M'`, endow `M'` with a `ChartedSpace` structure by pushing forward the `ChartedSpace` structure from `M`. -/ -@[implicit_reducible] +@[instance_reducible] def IsLocalHomeomorph.chartedSpace {f : M → M'} (hf : IsLocalHomeomorph f) (hf' : Function.Surjective f) : ChartedSpace H M' := @@ -619,7 +619,7 @@ namespace ChartedSpaceCore variable [TopologicalSpace H] (c : ChartedSpaceCore H M) {e : PartialEquiv M H} /-- Topology generated by a set of charts on a Type. -/ -@[implicit_reducible] +@[instance_reducible] protected def toTopologicalSpace : TopologicalSpace M := TopologicalSpace.generateFrom <| ⋃ (e : PartialEquiv M H) (_ : e ∈ c.atlas) (s : Set H) (_ : IsOpen s), @@ -674,7 +674,7 @@ protected def openPartialHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) /-- Given a charted space without topology, endow it with a genuine charted space structure with respect to the topology constructed from the atlas. -/ -@[implicit_reducible] +@[instance_reducible] def toChartedSpace : @ChartedSpace H _ M c.toTopologicalSpace := { __ := c.toTopologicalSpace atlas := ⋃ (e : PartialEquiv M H) (he : e ∈ c.atlas), {c.openPartialHomeomorph e he} diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean b/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean index d27801c0c92d47..162a101adc8444 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean @@ -46,6 +46,7 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] section Atlas +set_option backward.isDefEq.respectTransparency false in theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by intro x refine contMDiffAt_iff.mpr ⟨I.continuousAt, ?_⟩ @@ -54,6 +55,7 @@ theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by · exact Filter.eventuallyEq_of_mem self_mem_nhdsWithin fun x₂ => I.right_inv simp_rw [Function.comp_apply, I.left_inv, Function.id_def] +set_option backward.isDefEq.respectTransparency false in theorem contMDiffOn_model_symm : ContMDiffOn 𝓘(𝕜, E) I n I.symm (range I) := by rw [contMDiffOn_iff] refine ⟨I.continuousOn_symm, fun x y => ?_⟩ diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean b/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean index fa43fc3ba3dfaa..8fe58930ae4372 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean @@ -411,6 +411,7 @@ section variable {e : M → H} (h : IsOpenEmbedding e) {n : ℕ∞ω} +set_option backward.isDefEq.respectTransparency false in /-- If the `ChartedSpace` structure on a manifold `M` is given by an open embedding `e : M → H`, then `e` is `C^n`. -/ lemma contMDiff_isOpenEmbedding [Nonempty M] : @@ -436,6 +437,7 @@ lemma contMDiff_isOpenEmbedding [Nonempty M] : h.toOpenPartialHomeomorph_target] at this exact this +set_option backward.isDefEq.respectTransparency false in /-- If the `ChartedSpace` structure on a manifold `M` is given by an open embedding `e : M → H`, then the inverse of `e` is `C^n`. -/ lemma contMDiffOn_isOpenEmbedding_symm [Nonempty M] : diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean b/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean index 224c9ebd3782a3..48953978e1e4d5 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Defs.lean @@ -280,6 +280,7 @@ theorem contMDiffAt_iff_target {x : M} : ContinuousAt f x ∧ ContMDiffAt I 𝓘(𝕜, E') n (extChartAt I' (f x) ∘ f) x := by rw [ContMDiffAt, ContMDiffAt, contMDiffWithinAt_iff_target, continuousWithinAt_univ] +set_option backward.isDefEq.respectTransparency false in /-- One can reformulate being `Cⁿ` within a set at a point as being `Cⁿ` in the source space when composing with the extended chart. -/ theorem contMDiffWithinAt_iff_source : diff --git a/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean b/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean index b2e65680f331a9..fbd11cd84596ac 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean @@ -42,6 +42,7 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] section Module +set_option backward.isDefEq.respectTransparency false in theorem contMDiffWithinAt_iff_contDiffWithinAt {f : E → E'} {s : Set E} {x : E} : ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ ContDiffWithinAt 𝕜 n f s x := by simp +contextual only [ContMDiffWithinAt, liftPropWithinAt_iff', diff --git a/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean b/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean index 010d41d7d763a8..8f4477ca514496 100644 --- a/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean +++ b/Mathlib/Geometry/Manifold/GroupLieAlgebra.lean @@ -142,6 +142,7 @@ lemma mulInvariantVectorField_eq_mpullback (g : G) (V : Π (g : G), TangentSpace simp set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem contMDiff_mulInvariantVectorField (v : GroupLieAlgebra I G) : CMDiff (minSmoothness 𝕜 2) diff --git a/Mathlib/Geometry/Manifold/HasGroupoid.lean b/Mathlib/Geometry/Manifold/HasGroupoid.lean index 3a379fc2555dab..ef0a0288d1863b 100644 --- a/Mathlib/Geometry/Manifold/HasGroupoid.lean +++ b/Mathlib/Geometry/Manifold/HasGroupoid.lean @@ -201,7 +201,7 @@ variable (e : OpenPartialHomeomorph α H) whole space `α`, then that open partial homeomorphism induces an `H`-charted space structure on `α`. (This condition is equivalent to `e` being an open embedding of `α` into `H`; see `IsOpenEmbedding.singletonChartedSpace`.) -/ -@[implicit_reducible] +@[instance_reducible] def singletonChartedSpace (h : e.source = Set.univ) : ChartedSpace H α where atlas := {e} chartAt _ := e @@ -243,7 +243,7 @@ variable [Nonempty α] /-- An open embedding of `α` into `H` induces an `H`-charted space structure on `α`. See `OpenPartialHomeomorph.singletonChartedSpace`. -/ -@[implicit_reducible] +@[instance_reducible] def singletonChartedSpace {f : α → H} (h : IsOpenEmbedding f) : ChartedSpace H α := (h.toOpenPartialHomeomorph f).singletonChartedSpace (toOpenPartialHomeomorph_source _ _) diff --git a/Mathlib/Geometry/Manifold/Immersion.lean b/Mathlib/Geometry/Manifold/Immersion.lean index e3d7a87d24183f..dcd6719cd4cc08 100644 --- a/Mathlib/Geometry/Manifold/Immersion.lean +++ b/Mathlib/Geometry/Manifold/Immersion.lean @@ -522,6 +522,7 @@ lemma congr_iff (hfg : f =ᶠ[𝓝 x] g) : IsImmersionAt I J n f x ↔ IsImmersionAt I J n g x := ⟨fun h ↦ h.congr_of_eventuallyEq hfg, fun h ↦ h.congr_of_eventuallyEq hfg.symm⟩ +set_option backward.isDefEq.respectTransparency false in /- The set of points where `IsImmersionAt` holds is open. -/ lemma _root_.IsOpen.isImmersionAt : IsOpen {x | IsImmersionAt I J n f x} := by diff --git a/Mathlib/Geometry/Manifold/Instances/Icc.lean b/Mathlib/Geometry/Manifold/Instances/Icc.lean index ac1cf5c733ae4a..7a645b14a81349 100644 --- a/Mathlib/Geometry/Manifold/Instances/Icc.lean +++ b/Mathlib/Geometry/Manifold/Instances/Icc.lean @@ -107,6 +107,7 @@ lemma contMDiff_subtype_coe_Icc : CMDiff n (fun (z : Icc x y) ↦ (z : ℝ)) := rw [max_eq_left hw, max_eq_left] linarith +set_option backward.isDefEq.respectTransparency false in /-- The projection from `ℝ` to a closed segment is smooth on the segment, in the manifold sense. -/ lemma contMDiffOn_projIcc : CMDiff[Icc x y] n (Set.projIcc x y h.out.le) := by intro z hz diff --git a/Mathlib/Geometry/Manifold/Instances/Real.lean b/Mathlib/Geometry/Manifold/Instances/Real.lean index 58ddadb55a4e91..6f54d90a07e87a 100644 --- a/Mathlib/Geometry/Manifold/Instances/Real.lean +++ b/Mathlib/Geometry/Manifold/Instances/Real.lean @@ -309,6 +309,7 @@ end Fact.Manifold open Fact.Manifold +set_option backward.isDefEq.respectTransparency false in lemma IccLeftChart_extend_bot : (IccLeftChart x y).extend (𝓡∂ 1) ⊥ = 0 := by norm_num [IccLeftChart, modelWithCornersEuclideanHalfSpace_zero] congr @@ -366,6 +367,7 @@ def IccRightChart (x y : ℝ) [h : Fact (x < y)] : continuousOn_toFun := by fun_prop continuousOn_invFun := by fun_prop +set_option backward.isDefEq.respectTransparency false in lemma IccRightChart_extend_top : (IccRightChart x y).extend (𝓡∂ 1) ⊤ = 0 := by norm_num [IccRightChart, modelWithCornersEuclideanHalfSpace_zero] @@ -443,6 +445,7 @@ lemma boundary_product [I.Boundaryless] : (I.prod (𝓡∂ 1)).boundary (M × Icc x y) = Set.prod univ {⊥, ⊤} := by rw [I.boundary_of_boundaryless_left, boundary_Icc] +set_option backward.isDefEq.respectTransparency false in /-- The manifold structure on `[x, y]` is smooth. -/ instance instIsManifoldIcc (x y : ℝ) [Fact (x < y)] {n : ℕ∞ω} : IsManifold (𝓡∂ 1) n (Icc x y) := by diff --git a/Mathlib/Geometry/Manifold/Instances/Sphere.lean b/Mathlib/Geometry/Manifold/Instances/Sphere.lean index 236d499e2f8132..9bff266253ba4b 100644 --- a/Mathlib/Geometry/Manifold/Instances/Sphere.lean +++ b/Mathlib/Geometry/Manifold/Instances/Sphere.lean @@ -232,6 +232,7 @@ theorem stereo_left_inv (hv : ‖v‖ = 1) {x : sphere (0 : E) 1} (hx : (x : E) · field_simp linear_combination 4 * (a - 1) * pythag +set_option backward.isDefEq.respectTransparency false in theorem stereo_right_inv (hv : ‖v‖ = 1) (w : (ℝ ∙ v)ᗮ) : stereoToFun v (stereoInvFun hv w) = w := by simp only [stereoToFun, stereoInvFun, stereoInvFunAux, smul_add, map_add, map_smul, innerSL_apply_apply, Submodule.orthogonalProjection_mem_subspace_eq_self] @@ -340,10 +341,12 @@ def stereographic' (n : ℕ) [Fact (finrank ℝ E = n + 1)] (v : sphere (0 : E) (OrthonormalBasis.fromOrthogonalSpanSingleton n (ne_zero_of_mem_unit_sphere v)).repr.toHomeomorph.toOpenPartialHomeomorph +set_option backward.isDefEq.respectTransparency false in @[simp] theorem stereographic'_source {n : ℕ} [Fact (finrank ℝ E = n + 1)] (v : sphere (0 : E) 1) : (stereographic' n v).source = {v}ᶜ := by simp [stereographic'] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem stereographic'_target {n : ℕ} [Fact (finrank ℝ E = n + 1)] (v : sphere (0 : E) 1) : (stereographic' n v).target = Set.univ := by simp [stereographic'] diff --git a/Mathlib/Geometry/Manifold/IsManifold/Basic.lean b/Mathlib/Geometry/Manifold/IsManifold/Basic.lean index b3a41ea3b8d56c..3e2b9987b1c1b4 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/Basic.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/Basic.lean @@ -614,6 +614,7 @@ instance modelWithCornersSelf_boundaryless (𝕜 : Type*) [NontriviallyNormedFie [NormedAddCommGroup E] [NormedSpace 𝕜 E] : (modelWithCornersSelf 𝕜 E).Boundaryless := ⟨by simp⟩ +set_option backward.isDefEq.respectTransparency false in /-- If two model with corners are boundaryless, their product also is -/ instance ModelWithCorners.range_eq_univ_prod {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Type v} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type w} [TopologicalSpace H] @@ -744,6 +745,7 @@ theorem symm_trans_mem_contDiffGroupoid (e : OpenPartialHomeomorph M H) : variable {E' H' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] [TopologicalSpace H'] +set_option backward.isDefEq.respectTransparency false in /-- The product of two `C^n` open partial homeomorphisms is `C^n`. -/ theorem contDiffGroupoid_prod {I : ModelWithCorners 𝕜 E H} {I' : ModelWithCorners 𝕜 E' H'} {e : OpenPartialHomeomorph H H} {e' : OpenPartialHomeomorph H' H'} diff --git a/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean b/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean index b2581f57d9c419..e9f5db0d1e9a47 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean @@ -801,17 +801,21 @@ The manifold derivative of `f` will just be the derivative of this conjugated fu def writtenInExtChartAt (x : M) (f : M → M') : E → E' := extChartAt I' (f x) ∘ f ∘ (extChartAt I x).symm +set_option backward.isDefEq.respectTransparency false in theorem writtenInExtChartAt_chartAt {x : M} {y : E} (h : y ∈ (extChartAt I x).target) : writtenInExtChartAt I I x (chartAt H x) y = y := by simp_all only [mfld_simps] +set_option backward.isDefEq.respectTransparency false in theorem writtenInExtChartAt_chartAt_symm {x : M} {y : E} (h : y ∈ (extChartAt I x).target) : writtenInExtChartAt I I (chartAt H x x) (chartAt H x).symm y = y := by simp_all only [mfld_simps] +set_option backward.isDefEq.respectTransparency false in theorem writtenInExtChartAt_extChartAt {x : M} {y : E} (h : y ∈ (extChartAt I x).target) : writtenInExtChartAt I 𝓘(𝕜, E) x (extChartAt I x) y = y := by simp_all only [mfld_simps] +set_option backward.isDefEq.respectTransparency false in theorem writtenInExtChartAt_extChartAt_symm {x : M} {y : E} (h : y ∈ (extChartAt I x).target) : writtenInExtChartAt 𝓘(𝕜, E) I (extChartAt I x x) (extChartAt I x).symm y = y := by simp_all only [mfld_simps] @@ -850,6 +854,7 @@ theorem extChartAt_self_eq {x : H} : ⇑(extChartAt I x) = I := theorem extChartAt_self_apply {x y : H} : extChartAt I x y = I y := rfl +set_option backward.isDefEq.respectTransparency false in /-- In the case of the manifold structure on a vector space, the extended charts are just the identity. -/ theorem extChartAt_model_space_eq_id (x : E) : extChartAt 𝓘(𝕜, E) x = PartialEquiv.refl E := by diff --git a/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean b/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean index d41debe9ebc44d..c1977e92f0fe04 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/InteriorBoundary.lean @@ -360,7 +360,7 @@ lemma MDifferentiableAt.isInteriorPoint_of_surjective_mfderiv {f : M → N} {x : let _ : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 E let _ : NormedSpace ℝ E' := NormedSpace.restrictScalars ℝ 𝕜 E' -- Write everything in terms of extended charts around `x` and `f x`. - simp only [mfderiv, hf, ite_true] at hf' + simp only [mfderiv, hf] at hf' have hf'' := hf.differentiableWithinAt_writtenInExtChartAt.differentiableAt <| by simpa [← mem_interior_iff_mem_nhds] using! hx rw [fderivWithin_eq_fderiv (I.uniqueDiffOn _ <| by simp) hf''] at hf' diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean b/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean index 70a61d9b9c7dba..6a1be9ecad3ff8 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean @@ -285,6 +285,7 @@ lemma mfderiv_extChartAt_comp_mfderivWithin_extChartAt_symm {x : M} simp only [Function.comp_def, PartialEquiv.right_inv (extChartAt I x) hz, id_eq] · simp only [Function.comp_def, PartialEquiv.right_inv (extChartAt I x) hy, id_eq] +set_option backward.isDefEq.respectTransparency false in /-- The composition of the derivative of `extChartAt` with the derivative of the inverse of `extChartAt` gives the identity. Version where the basepoint belongs to `(extChartAt I x).source`. -/ diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean b/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean index 40e6c12f40a815..9954e9c2833ed8 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Basic.lean @@ -537,10 +537,12 @@ theorem mfderivWithin_univ : mfderivWithin I I' f univ = mfderiv I I' f := by simp only [mfderivWithin, mfderiv, mfld_simps] rw [mdifferentiableWithinAt_univ] +set_option backward.isDefEq.respectTransparency false in theorem mfderivWithin_zero_of_not_mdifferentiableWithinAt (h : ¬MDifferentiableWithinAt I I' f s x) : mfderivWithin I I' f s x = 0 := by simp only [mfderivWithin, h, if_neg, not_false_iff] +set_option backward.isDefEq.respectTransparency false in theorem mfderiv_zero_of_not_mdifferentiableAt (h : ¬MDifferentiableAt I I' f x) : mfderiv I I' f x = 0 := by simp only [mfderiv, h, if_neg, not_false_iff] @@ -610,12 +612,14 @@ theorem hasMFDerivAt_unique (h₀ : HasMFDerivAt I I' f x f₀') (h₁ : HasMFDe rw [← hasMFDerivWithinAt_univ] at h₀ h₁ exact (uniqueMDiffWithinAt_univ I).eq h₀ h₁ +set_option backward.isDefEq.respectTransparency false in theorem hasMFDerivWithinAt_inter' (h : t ∈ 𝓝[s] x) : HasMFDerivWithinAt I I' f (s ∩ t) x f' ↔ HasMFDerivWithinAt I I' f s x f' := by rw [HasMFDerivWithinAt, HasMFDerivWithinAt, extChartAt_preimage_inter_eq, hasFDerivWithinAt_inter', continuousWithinAt_inter' h] exact extChartAt_preimage_mem_nhdsWithin h +set_option backward.isDefEq.respectTransparency false in theorem hasMFDerivWithinAt_inter (h : t ∈ 𝓝 x) : HasMFDerivWithinAt I I' f (s ∩ t) x f' ↔ HasMFDerivWithinAt I I' f s x f' := by rw [HasMFDerivWithinAt, HasMFDerivWithinAt, extChartAt_preimage_inter_eq, hasFDerivWithinAt_inter, @@ -641,7 +645,7 @@ theorem HasMFDerivWithinAt.hasMFDerivAt (h : HasMFDerivWithinAt I I' f s x f') ( theorem MDifferentiableWithinAt.hasMFDerivWithinAt (h : MDifferentiableWithinAt I I' f s x) : HasMFDerivWithinAt I I' f s x (mfderivWithin I I' f s x) := by refine ⟨h.1, ?_⟩ - simp only [mfderivWithin, h, if_pos, mfld_simps] + simp only [mfderivWithin, h, mfld_simps] exact DifferentiableWithinAt.hasFDerivWithinAt h.2 theorem mdifferentiableWithinAt_iff_exists_hasMFDerivWithinAt : @@ -663,6 +667,7 @@ theorem mdifferentiableWithinAt_congr_nhds {t : Set M} (hst : 𝓝[s] x = 𝓝[t MDifferentiableWithinAt I I' f s x ↔ MDifferentiableWithinAt I I' f t x := ⟨fun h => h.congr_nhds hst, fun h => h.congr_nhds hst.symm⟩ +set_option backward.isDefEq.respectTransparency false in protected theorem MDifferentiableWithinAt.mfderivWithin (h : MDifferentiableWithinAt I I' f s x) : mfderivWithin I I' f s x = fderivWithin 𝕜 (writtenInExtChartAt I I' x f :) ((extChartAt I x).symm ⁻¹' s ∩ range I) @@ -672,9 +677,10 @@ protected theorem MDifferentiableWithinAt.mfderivWithin (h : MDifferentiableWith theorem MDifferentiableAt.hasMFDerivAt (h : MDifferentiableAt I I' f x) : HasMFDerivAt I I' f x (mfderiv I I' f x) := by refine ⟨h.continuousAt, ?_⟩ - simp only [mfderiv, h, if_pos, mfld_simps] + simp only [mfderiv, h, mfld_simps] exact DifferentiableWithinAt.hasFDerivWithinAt h.differentiableWithinAt_writtenInExtChartAt +set_option backward.isDefEq.respectTransparency false in protected theorem MDifferentiableAt.mfderiv (h : MDifferentiableAt I I' f x) : mfderiv I I' f x = fderivWithin 𝕜 (writtenInExtChartAt I I' x f :) (range I) ((extChartAt I x) x) := by @@ -973,6 +979,7 @@ theorem HasMFDerivWithinAt.congr_mono (h : HasMFDerivWithinAt I I' f s x f') (ht : ∀ x ∈ t, f₁ x = f x) (hx : f₁ x = f x) (h₁ : t ⊆ s) : HasMFDerivWithinAt I I' f₁ t x f' := (h.mono h₁).congr_of_eventuallyEq (Filter.mem_inf_of_right ht) hx +set_option backward.isDefEq.respectTransparency false in theorem HasMFDerivAt.congr_of_eventuallyEq (h : HasMFDerivAt I I' f x f') (h₁ : f₁ =ᶠ[𝓝 x] f) : HasMFDerivAt I I' f₁ x f' := by rw [← hasMFDerivWithinAt_univ] at h ⊢ diff --git a/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean b/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean index 453ec2e412a4a7..9fb0751a83fac5 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/FDeriv.lean @@ -28,6 +28,7 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCom section MFDerivFDeriv +set_option backward.isDefEq.respectTransparency false in theorem uniqueMDiffWithinAt_iff_uniqueDiffWithinAt : UniqueMDiffWithinAt 𝓘(𝕜, E) s x ↔ UniqueDiffWithinAt 𝕜 s x := by simp only [UniqueMDiffWithinAt, mfld_simps] @@ -57,6 +58,7 @@ theorem hasMFDerivWithinAt_iff_hasFDerivWithinAt {f'} : alias ⟨HasMFDerivWithinAt.hasFDerivWithinAt, HasFDerivWithinAt.hasMFDerivWithinAt⟩ := hasMFDerivWithinAt_iff_hasFDerivWithinAt +set_option backward.isDefEq.respectTransparency false in theorem hasMFDerivAt_iff_hasFDerivAt {f'} : HasMFDerivAt 𝓘(𝕜, E) 𝓘(𝕜, E') f x f' ↔ HasFDerivAt f f' x := by rw [← hasMFDerivWithinAt_univ, hasMFDerivWithinAt_iff_hasFDerivWithinAt, hasFDerivWithinAt_univ] @@ -99,6 +101,7 @@ theorem mdifferentiable_iff_differentiable : MDiff f ↔ Differentiable 𝕜 f : alias ⟨MDifferentiable.differentiable, Differentiable.mdifferentiable⟩ := mdifferentiable_iff_differentiable +set_option backward.isDefEq.respectTransparency false in /-- For maps between vector spaces, `mfderivWithin` and `fderivWithin` coincide -/ @[simp] theorem mfderivWithin_eq_fderivWithin : diff --git a/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean b/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean index 45d29f5f4da141..4f5a03eb68e6e0 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean @@ -91,6 +91,7 @@ section extChartAt variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {f : M → F} +set_option backward.isDefEq.respectTransparency.types false in -- TODO: add pre-composition version also theorem MDifferentiableWithinAt.differentiableWithinAt_comp_extChartAt_symm (hf : MDiffAt[s] f x) : letI φ := extChartAt I x diff --git a/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean b/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean index f48ea76e9d1234..51f4dc67008c3e 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean @@ -557,7 +557,7 @@ theorem mfderiv_prod_left {x₀ : M} {y₀ : M'} : theorem tangentMap_prod_left {p : TangentBundle I M} {y₀ : M'} : tangentMap I (I.prod I') (fun x ↦ (x, y₀)) p = ⟨(p.1, y₀), (p.2, 0)⟩ := by - simp only [tangentMap, mfderiv_prod_left, TotalSpace.mk_inj] + simp only [tangentMap, mfderiv_prod_left] rfl set_option backward.isDefEq.respectTransparency false in @@ -569,7 +569,7 @@ theorem mfderiv_prod_right {x₀ : M} {y₀ : M'} : theorem tangentMap_prod_right {p : TangentBundle I' M'} {x₀ : M} : tangentMap I' (I.prod I') (fun y ↦ (x₀, y)) p = ⟨(x₀, p.1), (0, p.2)⟩ := by - simp only [tangentMap, mfderiv_prod_right, TotalSpace.mk_inj] + simp only [tangentMap, mfderiv_prod_right] rfl /-- The total derivative of a function in two variables is the sum of the partial derivatives. @@ -603,13 +603,13 @@ theorem mfderiv_prod_eq_add_comp {f : M × M' → M''} {p : M × M'} (hf : MDiff congr · have : (fun z : M × M' ↦ f (z.1, p.2)) = (fun z : M ↦ f (z, p.2)) ∘ Prod.fst := rfl rw [this, mfderiv_comp (I' := I)] - · simp only [mfderiv_fst, id_eq] + · simp only [mfderiv_fst] rfl · exact hf.comp _ (mdifferentiableAt_id.prodMk mdifferentiableAt_const) · exact mdifferentiableAt_fst · have : (fun z : M × M' ↦ f (p.1, z.2)) = (fun z : M' ↦ f (p.1, z)) ∘ Prod.snd := rfl rw [this, mfderiv_comp (I' := I')] - · simp only [mfderiv_snd, id_eq] + · simp only [mfderiv_snd] rfl · exact hf.comp _ (mdifferentiableAt_const.prodMk mdifferentiableAt_id) · exact mdifferentiableAt_snd @@ -714,6 +714,7 @@ theorem hasMFDerivWithinAt_inl : exact (hasFDerivWithinAt_id (extChartAt I q q) _).congr_of_eventuallyEq this (by simp [writtenInExtChartAt, extChartAt]) +set_option backward.isDefEq.respectTransparency false in theorem hasMFDerivAt_inl : HasMFDerivAt% (@Sum.inl M M') q (ContinuousLinearMap.id 𝕜 (TangentSpace I p)) := by simpa [HasMFDerivAt, hasMFDerivWithinAt_univ] using! hasMFDerivWithinAt_inl (s := Set.univ) @@ -727,6 +728,7 @@ theorem hasMFDerivWithinAt_inr {t : Set M'} : exact (hasFDerivWithinAt_id (extChartAt I q' q') _).congr_of_eventuallyEq this (by simp [writtenInExtChartAt, extChartAt]) +set_option backward.isDefEq.respectTransparency false in theorem hasMFDerivAt_inr : HasMFDerivAt% (@Sum.inr M M') q' (ContinuousLinearMap.id 𝕜 (TangentSpace I p)) := by simpa [HasMFDerivAt, hasMFDerivWithinAt_univ] using! hasMFDerivWithinAt_inr (t := Set.univ) @@ -806,6 +808,7 @@ lemma HasMFDerivWithinAt.sum (hf : ∀ i ∈ t, HasMFDerivAt[s] (f i) z (f' i)) | empty => simpa using! hasMFDerivWithinAt_const .. | insert i s hi IH => grind [HasMFDerivWithinAt.add] +set_option backward.isDefEq.respectTransparency false in lemma HasMFDerivAt.sum (hf : ∀ i ∈ t, HasMFDerivAt% (f i) z (f' i)) : HasMFDerivAt% (∑ i ∈ t, f i) z (∑ i ∈ t, f' i) := by simp_all only [← hasMFDerivWithinAt_univ] @@ -857,6 +860,7 @@ theorem HasMFDerivWithinAt.neg {s : Set M} (hf : HasMFDerivAt[s] f z f') : theorem HasMFDerivAt.neg (hf : HasMFDerivAt% f z f') : HasMFDerivAt% (-f) z (-f') := ⟨hf.1.neg, hf.2.neg⟩ +set_option backward.isDefEq.respectTransparency false in theorem hasMFDerivAt_neg : HasMFDerivAt% (-f) z (-f') ↔ HasMFDerivAt% f z f' := ⟨fun hf ↦ by convert! hf.neg <;> rw [neg_neg], fun hf ↦ hf.neg⟩ @@ -1010,6 +1014,7 @@ lemma HasMFDerivWithinAt.prod [DecidableEq ι] rw [t.erase_insert_of_ne (by grind), Finset.prod_insert (by grind)] · simp +set_option backward.isDefEq.respectTransparency false in lemma HasMFDerivAt.prod [DecidableEq ι] (hf : ∀ i ∈ t, HasMFDerivAt I 𝓘(𝕜, F') (f i) z (f' i)) : HasMFDerivAt I 𝓘(𝕜, F') (∏ i ∈ t, f i) z (∑ i ∈ t, (∏ j ∈ t.erase i, f j z) • (f' i)) := by @@ -1097,6 +1102,7 @@ section Field variable {z : M} {F' : Type*} [NormedField F'] [NormedAlgebra 𝕜 F'] {p q : M → F'} {p' q' : TangentSpace I z →L[𝕜] F'} +set_option backward.isDefEq.respectTransparency.types false in lemma HasMFDerivWithinAt.inv (hp : HasMFDerivWithinAt I 𝓘(𝕜, F') p s z p') (hp_ne : p z ≠ 0) : HasMFDerivWithinAt I 𝓘(𝕜, F') (p⁻¹) s z (-(p z ^ 2)⁻¹ • p' : E →L[𝕜] F') := by convert! hp.inv' hp_ne @@ -1108,6 +1114,7 @@ lemma HasMFDerivAt.inv (hp : HasMFDerivAt I 𝓘(𝕜, F') p z p') (hp_ne : p z HasMFDerivAt I 𝓘(𝕜, F') (p⁻¹) z (-(p z ^ 2)⁻¹ • p' : E →L[𝕜] F') := hasMFDerivWithinAt_univ.mp <| hp.hasMFDerivWithinAt.inv hp_ne +set_option backward.isDefEq.respectTransparency.types false in lemma HasMFDerivWithinAt.div (hp : HasMFDerivWithinAt I 𝓘(𝕜, F') p s z p') (hq : HasMFDerivWithinAt I 𝓘(𝕜, F') q s z q') (hq_ne : q z ≠ 0) : HasMFDerivWithinAt I 𝓘(𝕜, F') (p / q) s z diff --git a/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean b/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean index bbde671e83da07..0f3a7916534483 100644 --- a/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean +++ b/Mathlib/Geometry/Manifold/MFDeriv/Tangent.lean @@ -58,6 +58,7 @@ theorem tangentMap_chart_symm {p : TangentBundle I M} {q : TangentBundle I H} congr exact ((chartAt H (TotalSpace.proj p)).right_inv h).symm +set_option backward.isDefEq.respectTransparency false in lemma mfderiv_chartAt_eq_tangentCoordChange {x y : M} (hsrc : x ∈ (chartAt H y).source) : mfderiv% (chartAt H y) x = tangentCoordChange I x y x := by have := mdifferentiableAt_atlas (I := I) (ChartedSpace.chart_mem_atlas _) hsrc @@ -69,6 +70,7 @@ theorem UniqueMDiffOn.tangentBundle_proj_preimage {s : Set M} (hs : UniqueMDiffO UniqueMDiffOn I.tangent (π E (TangentSpace I) ⁻¹' s) := hs.bundle_preimage _ +set_option backward.isDefEq.respectTransparency false in /-- To write a linear map between tangent spaces in coordinates amounts to precomposing and postcomposing it with derivatives of extended charts. Concrete version of `inTangentCoordinates_eq`. -/ diff --git a/Mathlib/Geometry/Manifold/PartitionOfUnity.lean b/Mathlib/Geometry/Manifold/PartitionOfUnity.lean index ec739e2089af22..299705f13982c5 100644 --- a/Mathlib/Geometry/Manifold/PartitionOfUnity.lean +++ b/Mathlib/Geometry/Manifold/PartitionOfUnity.lean @@ -418,7 +418,7 @@ theorem mem_extChartAt_ind_source (x : M) (hx : x ∈ s) : fs.mem_extChartAt_source_of_eq_one (fs.apply_ind x hx) /-- The index type of a `SmoothBumpCovering` of a compact manifold is finite. -/ -@[implicit_reducible] +@[instance_reducible] protected def fintype [CompactSpace M] : Fintype ι := fs.locallyFinite.fintypeOfCompact fun i => (fs i).nonempty_support diff --git a/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean b/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean index 31a4874663c1bd..1933e856a715f8 100644 --- a/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean +++ b/Mathlib/Geometry/Manifold/Sheaf/LocallyRingedSpace.lean @@ -51,6 +51,7 @@ variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] open AlgebraicGeometry Manifold TopologicalSpace Topology +set_option backward.isDefEq.respectTransparency.types false in /-- The units of the stalk at `x` of the sheaf of smooth functions from `M` to `𝕜`, considered as a sheaf of commutative rings, are the functions whose values at `x` are nonzero. -/ theorem smoothSheafCommRing.isUnit_stalk_iff {x : M} @@ -130,6 +131,7 @@ instance smoothSheafCommRing.instLocalRing_stalk (x : M) : variable (M) /-- A smooth manifold can be considered as a locally ringed space. -/ +@[implicit_reducible] def ChartedSpace.locallyRingedSpace : LocallyRingedSpace where carrier := TopCat.of M presheaf := smoothPresheafCommRing IM 𝓘(𝕜) M 𝕜 @@ -150,6 +152,7 @@ def ChartedSpace.locallyRingedSpaceMapAux (f : M → N) (hf : ContMDiff IM IN base := TopCat.ofHom ⟨f, hf.continuous⟩ c := (hf.smoothSheafCommRingHom _ _ f).hom +set_option backward.isDefEq.respectTransparency.types false in /-- (Implementation): Use `ChartedSpace.stalkMap_locallyRingedSpaceMap_evalHom`. -/ lemma ChartedSpace.stalkMap_locallyRingedSpaceMapAux (f : M → N) (hf : ContMDiff IM IN ∞ f) (x : M) : diff --git a/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean b/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean index 8d6122641d7aeb..d190a071cae380 100644 --- a/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean +++ b/Mathlib/Geometry/Manifold/Sheaf/Smooth.lean @@ -153,6 +153,7 @@ lemma smoothSheaf.contMDiff_section {U : (Opens (TopCat.of M))ᵒᵖ} ContMDiff IM I ∞ f := (contDiffWithinAt_localInvariantProp ∞).section_spec _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- A smooth function `f : M → N` induces a morphism of sheaves (of types) `𝒪_N ⟶ f_* 𝒪_M` by pre-composing with `f`. -/ @[simps! -isSimp hom_app_hom] @@ -290,6 +291,7 @@ def smoothPresheafCommRing : TopCat.Presheaf CommRingCat.{u} (TopCat.of M) := /-- The sheaf of smooth functions from `M` to `R`, for `R` a smooth commutative ring, as a sheaf of commutative rings. -/ +@[implicit_reducible] def smoothSheafCommRing : TopCat.Sheaf CommRingCat.{u} (TopCat.of M) where obj := smoothPresheafCommRing IM I M R property := by @@ -315,12 +317,14 @@ def smoothSheafCommRing.forgetStalk (x : TopCat.of M) : (smoothSheaf IM I M R).presheaf.stalk x := preservesColimitIso (forget CommRingCat) _ +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc, elementwise] lemma smoothSheafCommRing.ι_forgetStalk_hom (x : TopCat.of M) (U) : dsimp% ↾(colimit.ι ((OpenNhds.inclusion x).op ⋙ (smoothSheafCommRing IM I M R).presheaf) U).hom ≫ (forgetStalk IM I M R x).hom = colimit.ι ((OpenNhds.inclusion x).op ⋙ (smoothSheaf IM I M R).presheaf) U := ι_preservesColimitIso_hom (forget CommRingCat) _ _ +set_option backward.isDefEq.respectTransparency.types false in @[simp, reassoc, elementwise] lemma smoothSheafCommRing.ι_forgetStalk_inv (x : TopCat.of M) (U) : colimit.ι ((OpenNhds.inclusion x).op ⋙ (smoothSheaf IM I M R).presheaf) U ≫ (smoothSheafCommRing.forgetStalk IM I M R x).inv = @@ -400,6 +404,7 @@ variable {IM I M R} = f ⟨x, hx⟩ := smoothSheafCommRing.evalHom_germ IM I M R U x hx f +set_option backward.isDefEq.respectTransparency.types false in /-- A smooth function `f : M → N` induces a morphism of sheaves (of rings) `𝒪_N ⟶ f_* 𝒪_M`, by pre-composing with `f`. -/ @[simps! -isSimp hom_app_hom_apply] diff --git a/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean b/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean index 072f427a8e17a2..46bca234d070a3 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean @@ -172,7 +172,7 @@ lemma toBasisAt_coe (hs : IsLocalFrameOn I F n s u) (hx : x ∈ u) (i : ι) : /-- If `{sᵢ}` is a local frame on a vector bundle, `F` being finite-dimensional implies the indexing set being finite. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfFiniteDimensional [VectorBundle 𝕜 F V] [FiniteDimensional 𝕜 F] (hs : IsLocalFrameOn I F n s u) (hx : x ∈ u) : Fintype ι := by have : FiniteDimensional 𝕜 (V x) := by @@ -451,6 +451,7 @@ variable [VectorBundle 𝕜 F V] [ContMDiffVectorBundle 1 F V I] {ι : Type*} (b : Basis ι 𝕜 F) {s : Π x : M, V x} {t : Set M} {k : ℕ∞ω} {x x' : M} [FiniteDimensional 𝕜 F] [CompleteSpace 𝕜] [ContMDiffVectorBundle k F V I] +set_option backward.isDefEq.respectTransparency false in /-- If `s` is `C^k` at `x`, so is its coefficient `b.localFrame_coeff e i` in the local frame near `x` induced by `e` and `b` -/ lemma contMDiffAt_localFrame_coeff (hxe : x ∈ e.baseSet) (hs : CMDiffAt k (T% s) x) (i : ι) : @@ -518,6 +519,7 @@ lemma contMDiffOn_baseSet_iff_localFrame_coeff : -- Differentiability of a section can be checked in terms of its local frame coefficients section MDifferentiable +set_option backward.isDefEq.respectTransparency false in /-- If `s` is differentiable at `x`, so is its coefficient `b.localFrame_coeff e i` in the local frame near `x` induced by `e` and `b` -/ lemma mdifferentiableAt_localFrame_coeff diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean b/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean index dca14ad793ab9f..5125728e7a56fa 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Tangent.lean @@ -472,6 +472,7 @@ lemma contMDiffWithinAt_vectorSpace_iff_contDiffWithinAt convert! h.contMDiffWithinAt with y simp +set_option backward.isDefEq.respectTransparency false in /-- A vector field on a vector space is `C^n` in the manifold sense iff it is `C^n` in the vector space sense. -/ lemma contMDiffAt_vectorSpace_iff_contDiffAt @@ -487,6 +488,7 @@ lemma contMDiffOn_vectorSpace_iff_contDiffOn CMDiff[s] n (T% V) ↔ ContDiffOn 𝕜 n V s := by simp only [ContMDiffOn, ContDiffOn, contMDiffWithinAt_vectorSpace_iff_contDiffWithinAt] +set_option backward.isDefEq.respectTransparency false in /-- A vector field on a vector space is `C^n` in the manifold sense iff it is `C^n` in the vector space sense. -/ lemma contMDiff_vectorSpace_iff_contDiff {V : Π (x : E), TangentSpace 𝓘(𝕜, E) x} : diff --git a/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean b/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean index 113f49fce6bf19..98a6f68175b10a 100644 --- a/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean +++ b/Mathlib/Geometry/Manifold/VectorField/LieBracket.lean @@ -327,6 +327,7 @@ lemma mfderiv_extChartAt_inverse_comp_mfderivWithin_extChartAT_symm (Y : Tangent mfderivWithin_extChartAt_symm_comp_mfderiv_extChartAt' (mem_extChartAt_source x)] exact isInvertible_mfderivWithin_extChartAt_symm (mem_extChartAt_target x) +set_option backward.isDefEq.respectTransparency false in variable (x W) in private lemma mfderiv_extChart_inverse_comp_aux : letI φ := extChartAt I x @@ -472,6 +473,7 @@ lemma mlieBracket_add_right (hW : MDiffAt (T% W) x) (hW₁ : MDiffAt (T% W₁) x simp only [← mlieBracketWithin_univ] at hW hW₁ ⊢ exact mlieBracketWithin_add_right hW hW₁ (uniqueMDiffWithinAt_univ _) +set_option backward.isDefEq.respectTransparency false in theorem mlieBracketWithin_of_mem_nhdsWithin (st : t ∈ 𝓝[s] x) (hs : UniqueMDiffWithinAt I s x) (hV : MDiffAt[t] (T% V) x) (hW : MDiffAt[t] (T% W) x) : mlieBracketWithin I V W s x = mlieBracketWithin I V W t x := by @@ -922,6 +924,7 @@ section Leibniz variable [IsManifold I (minSmoothness 𝕜 3) M] [CompleteSpace E] +set_option backward.isDefEq.respectTransparency false in /-- The Lie bracket of vector fields in manifolds satisfies the Leibniz identity `[U, [V, W]] = [[U, V], W] + [V, [U, W]]` (also called Jacobi identity). -/ theorem leibniz_identity_mlieBracketWithin_apply diff --git a/Mathlib/Geometry/Manifold/VectorField/Pullback.lean b/Mathlib/Geometry/Manifold/VectorField/Pullback.lean index 18412f5efb87b9..df83c86f52c500 100644 --- a/Mathlib/Geometry/Manifold/VectorField/Pullback.lean +++ b/Mathlib/Geometry/Manifold/VectorField/Pullback.lean @@ -210,6 +210,7 @@ lemma mpullbackWithin_eq_pullbackWithin {f : E → E'} {V : E' → E'} {s : Set simp only [mpullbackWithin, mfderivWithin_eq_fderivWithin, pullbackWithin] rfl +set_option backward.isDefEq.respectTransparency false in lemma mpullback_eq_pullback {f : E → E'} {V : E' → E'} : mpullback 𝓘(𝕜, E) 𝓘(𝕜, E') f V = pullback 𝕜 f V := by simp only [← mpullbackWithin_univ, ← pullbackWithin_univ, mpullbackWithin_eq_pullbackWithin] @@ -641,6 +642,7 @@ lemma eventually_contMDiffWithinAt_mpullbackWithin_extChartAt_symm simp only [mfld_simps] at hy h'y simp [hy, h'y] +set_option backward.isDefEq.respectTransparency false in omit [CompleteSpace E] in lemma eventuallyEq_mpullback_mpullbackWithin_extChartAt (V : Π (x : M), TangentSpace I x) : V =ᶠ[𝓝[s] x] mpullback I 𝓘(𝕜, E) (extChartAt I x) diff --git a/Mathlib/Geometry/RingedSpace/Basic.lean b/Mathlib/Geometry/RingedSpace/Basic.lean index ce4c5879fe072e..6207002a64b94f 100644 --- a/Mathlib/Geometry/RingedSpace/Basic.lean +++ b/Mathlib/Geometry/RingedSpace/Basic.lean @@ -68,6 +68,7 @@ lemma exists_res_eq_zero_of_germ_eq_zero (U : Opens X) (f : X.presheaf.obj (op U use V, i, hv simpa using hv4 +set_option backward.isDefEq.respectTransparency.types false in /-- If the germ of a section `f` is a unit in the stalk at `x`, then `f` must be a unit on some small neighborhood around `x`. diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean index 029ee73888b237..fd9cc156dd5388 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean @@ -57,6 +57,7 @@ abbrev toRingedSpace : RingedSpace := X.toSheafedSpace /-- The underlying topological space of a locally ringed space. -/ +@[implicit_reducible] def toTopCat : TopCat := X.1.carrier @@ -385,6 +386,7 @@ lemma stalkSpecializes_stalkMap_apply (x x' : X) (h : x ⤳ x') (y) : (X.presheaf.stalkSpecializes h (f.stalkMap x' y)) := DFunLike.congr_fun (CommRingCat.hom_ext_iff.mp (stalkSpecializes_stalkMap f x x' h)) y +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma stalkMap_congr (f g : X ⟶ Y) (hfg : f = g) (x x' : X) (hxx' : x = x') : f.stalkMap x ≫ X.presheaf.stalkSpecializes (specializes_of_eq hxx'.symm) = @@ -400,6 +402,7 @@ lemma stalkMap_congr_hom (f g : X ⟶ Y) (hfg : f = g) (x : X) : subst hfg simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma stalkMap_congr_point {X Y : LocallyRingedSpace.{u}} (f : X ⟶ Y) (x x' : X) (hxx' : x = x') : f.stalkMap x ≫ X.presheaf.stalkSpecializes (specializes_of_eq hxx'.symm) = @@ -407,6 +410,7 @@ lemma stalkMap_congr_point {X Y : LocallyRingedSpace.{u}} (f : X ⟶ Y) (x x' : subst hxx' simp +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma stalkMap_hom_inv (e : X ≅ Y) (y : Y) : e.hom.stalkMap (e.inv.base y) ≫ e.inv.stalkMap y = @@ -414,12 +418,14 @@ lemma stalkMap_hom_inv (e : X ≅ Y) (y : Y) : rw [← stalkMap_comp, LocallyRingedSpace.stalkMap_congr_hom (e.inv ≫ e.hom) (𝟙 _) (by simp)] simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma stalkMap_hom_inv_apply (e : X ≅ Y) (y : Y) (z) : e.inv.stalkMap y (e.hom.stalkMap (e.inv.base y) z) = Y.presheaf.stalkSpecializes (specializes_of_eq <| by simp) z := DFunLike.congr_fun (CommRingCat.hom_ext_iff.mp (stalkMap_hom_inv e y)) z +set_option backward.isDefEq.respectTransparency.types false in @[reassoc (attr := simp)] lemma stalkMap_inv_hom (e : X ≅ Y) (x : X) : e.inv.stalkMap (e.hom.base x) ≫ e.hom.stalkMap x = @@ -427,6 +433,7 @@ lemma stalkMap_inv_hom (e : X ≅ Y) (x : X) : rw [← stalkMap_comp, LocallyRingedSpace.stalkMap_congr_hom (e.hom ≫ e.inv) (𝟙 _) (by simp)] simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma stalkMap_inv_hom_apply (e : X ≅ Y) (x : X) (y) : e.hom.stalkMap x (e.inv.stalkMap (e.hom.base x) y) = @@ -444,6 +451,7 @@ lemma stalkMap_germ_apply (U : Opens Y) (x : X) (hx : f.base x ∈ U) (y) : X.presheaf.germ ((Opens.map f.base).obj U) x hx (f.c.app (op U) y) := PresheafedSpace.stalkMap_germ_apply f.toHom U x hx y +set_option backward.isDefEq.respectTransparency.types false in theorem preimage_basicOpen {X Y : LocallyRingedSpace.{u}} (f : X ⟶ Y) {U : Opens Y} (s : Y.presheaf.obj (op U)) : (Opens.map f.base).obj (Y.toRingedSpace.basicOpen s) = diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean index aa7cc3a65ffbc6..bc948018e53a58 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean @@ -254,6 +254,7 @@ theorem coequalizer_π_stalk_isLocalHom (x : Y) : end HasCoequalizer +set_option backward.isDefEq.respectTransparency.types false in /-- The coequalizer of two locally ringed spaces in the category of sheafed spaces is a locally ringed space. -/ noncomputable def coequalizer : LocallyRingedSpace where diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean index 07e65e02bcb462..e89c4a259fad8b 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean @@ -111,6 +111,7 @@ lemma residueFieldMap_id (x : X) : simp only [residueFieldMap, stalkMap_id] apply IsLocalRing.ResidueField.map_id +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma residueFieldMap_comp {Z : LocallyRingedSpace.{u}} (g : Y ⟶ Z) (x : X) : residueFieldMap (f ≫ g) x = residueFieldMap g (f.base x) ≫ residueFieldMap f x := by @@ -118,6 +119,7 @@ lemma residueFieldMap_comp {Z : LocallyRingedSpace.{u}} (g : Y ⟶ Z) (x : X) : simp only [residueFieldMap, stalkMap_comp] apply IsLocalRing.ResidueField.map_comp (Hom.stalkMap g (f.base x)).hom (Hom.stalkMap f x).hom +set_option backward.isDefEq.respectTransparency.types false in @[reassoc] lemma evaluation_naturality {V : Opens Y} (x : (Opens.map f.base).obj V) : Y.evaluation ⟨f.base x, x.property⟩ ≫ residueFieldMap f x.val = diff --git a/Mathlib/Geometry/RingedSpace/OpenImmersion.lean b/Mathlib/Geometry/RingedSpace/OpenImmersion.lean index efbd32c40d3cd3..7e2d95a2b66b39 100644 --- a/Mathlib/Geometry/RingedSpace/OpenImmersion.lean +++ b/Mathlib/Geometry/RingedSpace/OpenImmersion.lean @@ -194,8 +194,10 @@ theorem inv_naturality {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) : TopCat.Presheaf.pushforward_obj_map] congr 1 +set_option backward.isDefEq.respectTransparency.types false in instance (U : Opens X) : IsIso (invApp f U) := by delta invApp; infer_instance +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem inv_invApp (U : Opens X) : inv (H.invApp _ U) = @@ -249,6 +251,7 @@ instance (priority := 100) ofIsIso {X Y : PresheafedSpace C} (f : X ⟶ Y) [IsIs IsOpenImmersion f := AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.ofIso (asIso f) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance ofRestrict {X : TopCat} (Y : PresheafedSpace C) {f : X ⟶ Y.carrier} (hf : IsOpenEmbedding f) : IsOpenImmersion (Y.ofRestrict hf) where @@ -368,6 +371,7 @@ def pullbackConeOfLeft : PullbackCone f g := variable (s : PullbackCone f g) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- (Implementation.) Any cone over `cospan f g` indeed factors through the constructed cone. -/ @@ -587,6 +591,7 @@ section ToLocallyRingedSpace variable {X : PresheafedSpace CommRingCat} (Y : LocallyRingedSpace) variable (f : X ⟶ Y.toPresheafedSpace) [H : IsOpenImmersion f] +set_option backward.isDefEq.respectTransparency.types false in /-- If `X ⟶ Y` is an open immersion, and `Y` is a LocallyRingedSpace, then so is `X`. -/ def toLocallyRingedSpace : LocallyRingedSpace where toSheafedSpace := toSheafedSpace Y.toSheafedSpace f @@ -695,6 +700,7 @@ instance forgetCreatesPullbackOfRight : CreatesLimit (cospan g f) forget := (eqToIso (show pullback _ _ = pullback _ _ by congr) ≪≫ HasLimit.isoOfNatIso (diagramIsoCospan _).symm) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance sheafedSpace_forgetPreserves_of_left : PreservesLimit (cospan f g) (SheafedSpace.forget C) := @@ -1093,6 +1099,7 @@ instance forgetToPresheafedSpacePreservesOpenImmersion : ((LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map f) := H +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance forgetToTop_preservesPullback_of_left : PreservesLimit (cospan f g) diff --git a/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean b/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean index 57306bd71776d9..6044e49aa4469c 100644 --- a/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean +++ b/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean @@ -145,6 +145,7 @@ theorem id_c (X : PresheafedSpace C) : (𝟙 X : X ⟶ X).c = 𝟙 X.presheaf := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem id_c_app (X : PresheafedSpace C) (U) : (𝟙 X : X ⟶ X).c.app U = X.presheaf.map (𝟙 U) := by @@ -177,6 +178,7 @@ theorem comp_c_app {X Y Z : PresheafedSpace C} (α : X ⟶ Y) (β : Y ⟶ Z) (U) (α ≫ β).c.app U = β.c.app U ≫ α.c.app (op ((Opens.map β.base).obj (unop U))) := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem congr_app {X Y : PresheafedSpace C} {α β : X ⟶ Y} (h : α = β) (U) : α.c.app U = β.c.app U ≫ X.presheaf.map (eqToHom (by subst h; rfl)) := by diff --git a/Mathlib/Geometry/RingedSpace/PresheafedSpace/Gluing.lean b/Mathlib/Geometry/RingedSpace/PresheafedSpace/Gluing.lean index 9f8d7b72bc12d0..2346d4dfb8e117 100644 --- a/Mathlib/Geometry/RingedSpace/PresheafedSpace/Gluing.lean +++ b/Mathlib/Geometry/RingedSpace/PresheafedSpace/Gluing.lean @@ -462,6 +462,7 @@ theorem π_ιInvApp_π (i j : D.J) (U : Opens (D.U i).carrier) : · have : IsIso (D.t i j).c := by apply c_isIso_of_iso infer_instance +set_option backward.isDefEq.respectTransparency.types false in /-- `ιInvApp` is the inverse of `D.ι i` on `U`. -/ theorem π_ιInvApp_eq_id (i : D.J) (U : Opens (D.U i).carrier) : D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U = 𝟙 _ := by @@ -478,6 +479,7 @@ theorem π_ιInvApp_eq_id (i : D.J) (U : Opens (D.U i).carrier) : rw [Category.id_comp] apply π_ιInvApp_π +set_option backward.isDefEq.respectTransparency.types false in instance componentwise_diagram_π_isIso (i : D.J) (U : Opens (D.U i).carrier) : IsIso (D.diagramOverOpenπ U i) := by use D.ιInvAppπEqMap U ≫ D.ιInvApp U diff --git a/Mathlib/Geometry/RingedSpace/PresheafedSpace/HasColimits.lean b/Mathlib/Geometry/RingedSpace/PresheafedSpace/HasColimits.lean index 9f189b5ed5d928..c9b686ba7e0471 100644 --- a/Mathlib/Geometry/RingedSpace/PresheafedSpace/HasColimits.lean +++ b/Mathlib/Geometry/RingedSpace/PresheafedSpace/HasColimits.lean @@ -55,6 +55,7 @@ attribute [local simp] eqToHom_map -- attribute [local aesop safe cases (rule_sets := [CategoryTheory])] Opens -- although it doesn't appear to help in this file, in any case. +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem map_id_c_app (F : J ⥤ PresheafedSpace.{_, _, v} C) (j) (U) : @@ -63,6 +64,7 @@ theorem map_id_c_app (F : J ⥤ PresheafedSpace.{_, _, v} C) (j) (U) : (pushforwardEq (by simp) (F.obj j).presheaf).hom.app U := by simp [PresheafedSpace.congr_app (F.map_id j)] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem map_comp_c_app (F : J ⥤ PresheafedSpace.{_, _, v} C) {j₁ j₂ j₃} @@ -273,6 +275,7 @@ def colimitCoconeIsColimit (F : J ⥤ PresheafedSpace.{_, _, v} C) : instance : HasColimitsOfShape J (PresheafedSpace.{_, _, v} C) where has_colimit F := ⟨colimitCocone F, colimitCoconeIsColimit F⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance : PreservesColimitsOfShape J (PresheafedSpace.forget.{v, u, v} C) := ⟨fun {F} => preservesColimit_of_preserves_colimit_cocone (colimitCoconeIsColimit F) <| by diff --git a/Mathlib/Geometry/RingedSpace/SheafedSpace.lean b/Mathlib/Geometry/RingedSpace/SheafedSpace.lean index b3dbb9eeab7721..a967a99c72c0fd 100644 --- a/Mathlib/Geometry/RingedSpace/SheafedSpace.lean +++ b/Mathlib/Geometry/RingedSpace/SheafedSpace.lean @@ -245,6 +245,7 @@ variable [PreservesLimits (CategoryTheory.forget C)] variable [PreservesFilteredColimits (CategoryTheory.forget C)] variable [(CategoryTheory.forget C).ReflectsIsomorphisms] +set_option backward.isDefEq.respectTransparency.types false in attribute [local ext] DFunLike.ext in include instCC in lemma hom_stalk_ext {X Y : SheafedSpace C} (f g : X ⟶ Y) (h : f.hom.base = g.hom.base) @@ -274,6 +275,7 @@ lemma mono_of_base_injective_of_stalk_epi {X Y : SheafedSpace C} (f : X ⟶ Y) replace e := congr_arg InducedCategory.Hom.hom e congr 1 +set_option backward.isDefEq.respectTransparency.types false in attribute [local ext] DFunLike.ext in include instCC in lemma epi_of_base_surjective_of_stalk_mono {X Y : SheafedSpace C} (f : X ⟶ Y) diff --git a/Mathlib/Geometry/RingedSpace/Stalks.lean b/Mathlib/Geometry/RingedSpace/Stalks.lean index 993d7b930ffa23..3da3328029fe0b 100644 --- a/Mathlib/Geometry/RingedSpace/Stalks.lean +++ b/Mathlib/Geometry/RingedSpace/Stalks.lean @@ -83,6 +83,7 @@ theorem restrictStalkIso_inv_eq_germ {U : TopCat.{v}} (X : PresheafedSpace.{_, _ (X.restrict h).presheaf.germ _ x hx := by rw [← restrictStalkIso_hom_eq_germ, Category.assoc, Iso.hom_inv_id, Category.comp_id] +set_option backward.isDefEq.respectTransparency.types false in theorem restrictStalkIso_inv_eq_ofRestrict {U : TopCat.{v}} (X : PresheafedSpace.{_, _, v} C) {f : U ⟶ (X : TopCat.{v})} (h : IsOpenEmbedding f) (x : U) : (X.restrictStalkIso h x).inv = (X.ofRestrict h).stalkMap x := by @@ -98,6 +99,7 @@ theorem restrictStalkIso_inv_eq_ofRestrict {U : TopCat.{v}} (X : PresheafedSpace erw [← X.presheaf.map_comp_assoc] exact (colimit.w ((OpenNhds.inclusion (f x)).op ⋙ X.presheaf) i.op).symm +set_option backward.isDefEq.respectTransparency.types false in instance ofRestrict_stalkMap_isIso {U : TopCat.{v}} (X : PresheafedSpace.{_, _, v} C) {f : U ⟶ (X : TopCat.{v})} (h : IsOpenEmbedding f) (x : U) : IsIso ((X.ofRestrict h).stalkMap x) := by diff --git a/Mathlib/GroupTheory/ArchimedeanDensely.lean b/Mathlib/GroupTheory/ArchimedeanDensely.lean index 946cec75b71f37..e8608b5c0f31e8 100644 --- a/Mathlib/GroupTheory/ArchimedeanDensely.lean +++ b/Mathlib/GroupTheory/ArchimedeanDensely.lean @@ -202,6 +202,7 @@ noncomputable def LinearOrderedAddCommGroup.int_orderAddMonoidIso_of_isLeast_pos let f := closure_equiv_closure x (1 : ℤ) (by simp [h.left.ne']) exact ((((e.trans e').trans f).trans g').trans g : G ≃+o ℤ) +set_option backward.isDefEq.respectTransparency false in /-- If an element of a linearly ordered mul-archimedean group is the least element greater than 1, then the whole group is isomorphic (and order-isomorphic) to the multiplicative integers. -/ noncomputable def LinearOrderedCommGroup.multiplicative_int_orderMonoidIso_of_isLeast_one_lt @@ -266,6 +267,7 @@ lemma LinearOrderedAddCommGroup.isAddCyclic_iff_not_denselyOrdered {A : Type*} IsAddCyclic A ↔ ¬ DenselyOrdered A := by rw [← discrete_iff_not_denselyOrdered, isAddCyclic_iff_nonempty_equiv_int] +set_option backward.isDefEq.respectTransparency false in variable (G) in /-- Any linearly ordered mul-archimedean group is either isomorphic (and order-isomorphic) to the multiplicative integers, or is densely ordered. -/ @@ -274,6 +276,7 @@ lemma LinearOrderedCommGroup.discrete_or_denselyOrdered : rw [← OrderAddMonoidIso.toMultiplicativeRight.nonempty_congr] exact LinearOrderedAddCommGroup.discrete_or_denselyOrdered (Additive G) +set_option backward.isDefEq.respectTransparency false in variable (G) in /-- Any linearly ordered mul-archimedean group is either isomorphic (and order-isomorphic) to the multiplicative integers, or is densely ordered, exclusively. @@ -286,6 +289,7 @@ lemma LinearOrderedCommGroup.discrete_iff_not_denselyOrdered : LinearOrderedAddCommGroup.discrete_iff_not_denselyOrdered, denselyOrdered_iff_of_orderIsoClass e] +set_option backward.isDefEq.respectTransparency false in /-- Any non-trivial linearly ordered mul-archimedean group is either cyclic, or densely ordered, exclusively. -/ @[to_additive existing] @@ -305,6 +309,7 @@ lemma LinearOrderedCommGroupWithZero.discrete_or_denselyOrdered (G : Type*) intro ⟨f⟩ exact ⟨OrderMonoidIso.withZeroUnits.symm.trans f.withZero⟩ +set_option backward.isDefEq.respectTransparency false in open WithZero in /-- Any nontrivial (has other than 0 and 1) linearly ordered mul-archimedean group with zero is either isomorphic (and order-isomorphic) to `ℤᵐ⁰`, or is densely ordered, exclusively -/ @@ -374,6 +379,7 @@ lemma LinearOrderedAddCommGroup.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete · intro simp [Function.onFun, neg_le] +set_option backward.isDefEq.respectTransparency false in lemma LinearOrderedCommGroup.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete {G : Type*} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] [Nontrivial G] {g : G} : Set.WellFoundedOn {x : G | g ≤ x} (· < ·) ↔ Nonempty (G ≃*o Multiplicative ℤ) := by @@ -393,6 +399,7 @@ lemma LinearOrderedCommGroup.wellFoundedOn_setOf_ge_gt_iff_nonempty_discrete · intro simp [Function.onFun, inv_le'] +set_option backward.isDefEq.respectTransparency false in lemma LinearOrderedCommGroupWithZero.wellFoundedOn_setOf_le_lt_iff_nonempty_discrete_of_ne_zero {G₀ : Type*} [LinearOrderedCommGroupWithZero G₀] [Nontrivial G₀ˣ] {g : G₀} (hg : g ≠ 0) : Set.WellFoundedOn {x : G₀ | g ≤ x} (· < ·) ↔ Nonempty (G₀ ≃*o ℤᵐ⁰) := by diff --git a/Mathlib/GroupTheory/ClassEquation.lean b/Mathlib/GroupTheory/ClassEquation.lean index 0cb1257151298e..6a4fda33a8de2e 100644 --- a/Mathlib/GroupTheory/ClassEquation.lean +++ b/Mathlib/GroupTheory/ClassEquation.lean @@ -44,6 +44,7 @@ theorem Group.sum_card_conj_classes_eq_card [Finite G] : cases nonempty_fintype G simp [← sum_conjClasses_card_eq_card, finsum_eq_sum_of_fintype] +set_option backward.isDefEq.respectTransparency false in /-- The **class equation** for finite groups. The cardinality of a group is equal to the size of its center plus the sum of the size of all its nontrivial conjugacy classes. -/ theorem Group.nat_card_center_add_sum_card_noncenter_eq_card [Finite G] : diff --git a/Mathlib/GroupTheory/Complement.lean b/Mathlib/GroupTheory/Complement.lean index 1a64cb08eb93a1..e1edad9ebe2972 100644 --- a/Mathlib/GroupTheory/Complement.lean +++ b/Mathlib/GroupTheory/Complement.lean @@ -383,12 +383,14 @@ theorem rightCosetEquivalence_equiv_snd (g : G) : -- This used to be `simp [...]` before https://github.com/leanprover/lean4/pull/2644 rw [RightCosetEquivalence, rightCoset_eq_iff, equiv_snd_eq_inv_mul]; simp +set_option backward.isDefEq.respectTransparency false in theorem equiv_fst_eq_self_of_mem_of_one_mem {g : G} (h1 : 1 ∈ T) (hg : g ∈ S) : (hST.equiv g).fst = ⟨g, hg⟩ := by have : hST.equiv.symm (⟨g, hg⟩, ⟨1, h1⟩) = g := by rw [equiv, Equiv.ofBijective]; simp conv_lhs => rw [← this, Equiv.apply_symm_apply] +set_option backward.isDefEq.respectTransparency false in theorem equiv_snd_eq_self_of_mem_of_one_mem {g : G} (h1 : 1 ∈ S) (hg : g ∈ T) : (hST.equiv g).snd = ⟨g, hg⟩ := by have : hST.equiv.symm (⟨1, h1⟩, ⟨g, hg⟩) = g := by @@ -430,6 +432,7 @@ theorem equiv_mul_left_of_mem {h g : G} (hh : h ∈ H) : hHT.equiv (h * g) = (⟨h, hh⟩ * (hHT.equiv g).fst, (hHT.equiv g).snd) := equiv_mul_left _ ⟨h, hh⟩ g +set_option backward.isDefEq.respectTransparency false in theorem equiv_one (hs1 : 1 ∈ S) (ht1 : 1 ∈ T) : hST.equiv 1 = (⟨1, hs1⟩, ⟨1, ht1⟩) := by rw [Equiv.apply_eq_iff_eq_symm_apply]; simp [equiv] diff --git a/Mathlib/GroupTheory/Congruence/Basic.lean b/Mathlib/GroupTheory/Congruence/Basic.lean index 407821655bdedd..8598a01b751b7b 100644 --- a/Mathlib/GroupTheory/Congruence/Basic.lean +++ b/Mathlib/GroupTheory/Congruence/Basic.lean @@ -251,6 +251,7 @@ lemma comapQuotientEquivOfSurj_symm_mk (c : Con M) {f : N →* M} (hf) (x : N) : (comapQuotientEquivOfSurj c f hf).symm (f x) = x := (MulEquiv.symm_apply_eq (c.comapQuotientEquivOfSurj f hf)).mpr rfl +set_option backward.isDefEq.respectTransparency false in /-- This version infers the surjectivity of the function from a MulEquiv function -/ @[to_additive (attr := simp) /-- This version infers the surjectivity of the function from a MulEquiv function -/] diff --git a/Mathlib/GroupTheory/Congruence/Hom.lean b/Mathlib/GroupTheory/Congruence/Hom.lean index 0e04ceff448309..27fc0d4c85c422 100644 --- a/Mathlib/GroupTheory/Congruence/Hom.lean +++ b/Mathlib/GroupTheory/Congruence/Hom.lean @@ -182,6 +182,7 @@ theorem comap_eq {f : N →* M} : comap f f.map_mul c = ker (c.mk'.comp f) := variable (c) (f : M →* P) +set_option backward.isDefEq.respectTransparency false in /-- The homomorphism on the quotient of a monoid by a congruence relation `c` induced by a homomorphism constant on `c`'s equivalence classes. -/ @[to_additive /-- The homomorphism on the quotient of an `AddMonoid` by an additive congruence diff --git a/Mathlib/GroupTheory/CoprodI.lean b/Mathlib/GroupTheory/CoprodI.lean index cdd1fd75c9f311..a771736442612f 100644 --- a/Mathlib/GroupTheory/CoprodI.lean +++ b/Mathlib/GroupTheory/CoprodI.lean @@ -459,6 +459,7 @@ theorem mem_of_mem_equivPair_tail {i j : ι} {w : Word M} (m : M i) : · revert h; cases w.toList <;> simp +contextual set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in theorem equivPair_head {i : ι} {w : Word M} : (equivPair i w).head = if h : ∃ (h : w.toList ≠ []), (w.toList.head h).1 = i @@ -886,6 +887,7 @@ theorem empty_of_word_prod_eq_one {w : Word H} (h : lift f w.prod = 1) : obtain ⟨i, j, w, rfl⟩ := NeWord.of_word w hnotempty exact lift_word_prod_nontrivial_of_not_empty f hcard X hXnonempty hXdisj hpp w h +set_option backward.isDefEq.respectTransparency false in include hcard in /-- The **Ping-Pong-Lemma**. @@ -958,6 +960,7 @@ variable (hXYdisj : ∀ i j, Disjoint (X i) (Y j)) variable (hX : ∀ i, a i • (Y i)ᶜ ⊆ X i) variable (hY : ∀ i, a⁻¹ i • (X i)ᶜ ⊆ Y i) +set_option backward.isDefEq.respectTransparency false in include hXnonempty hXdisj hYdisj hXYdisj hX hY in /-- The Ping-Pong-Lemma. diff --git a/Mathlib/GroupTheory/Coset/Defs.lean b/Mathlib/GroupTheory/Coset/Defs.lean index 05e7df77897d42..fb031cb8eb3610 100644 --- a/Mathlib/GroupTheory/Coset/Defs.lean +++ b/Mathlib/GroupTheory/Coset/Defs.lean @@ -60,7 +60,7 @@ variable [Group α] (s : Subgroup α) /-- The equivalence relation corresponding to the partition of a group by left cosets of a subgroup. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The equivalence relation corresponding to the partition of a group by left cosets of a subgroup. -/] def leftRel : Setoid α := @@ -100,7 +100,7 @@ instance [DecidablePred (· ∈ s)] : DecidableEq (α ⧸ s) := /-- The equivalence relation corresponding to the partition of a group by right cosets of a subgroup. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The equivalence relation corresponding to the partition of a group by right cosets of a subgroup. -/] def rightRel : Setoid α := diff --git a/Mathlib/GroupTheory/Coxeter/Basic.lean b/Mathlib/GroupTheory/Coxeter/Basic.lean index ec6e35fce15be0..9d635425464da8 100644 --- a/Mathlib/GroupTheory/Coxeter/Basic.lean +++ b/Mathlib/GroupTheory/Coxeter/Basic.lean @@ -199,6 +199,7 @@ theorem _root_.CoxeterMatrix.toCoxeterSystem_simple (M : CoxeterMatrix B) : local prefix:100 "s" => cs.simple +set_option backward.isDefEq.respectTransparency false in @[simp] theorem simple_mul_simple_self (i : B) : s i * s i = 1 := by have : (FreeGroup.of i) * (FreeGroup.of i) ∈ M.relationsSet := ⟨(i, i), by simp [relation]⟩ @@ -222,6 +223,7 @@ theorem simple_mul_simple_cancel_left {w : W} (i : B) : s i * (s i * w) = w := b theorem inv_simple (i : B) : (s i)⁻¹ = s i := (eq_inv_of_mul_eq_one_right (cs.simple_mul_simple_self i)).symm +set_option backward.isDefEq.respectTransparency false in @[simp] theorem simple_mul_simple_pow (i i' : B) : (s i * s i') ^ M i i' = 1 := by have : (FreeGroup.of i * FreeGroup.of i') ^ M i i' ∈ M.relationsSet := ⟨(i, i'), rfl⟩ @@ -314,6 +316,7 @@ private def restrictUnit {G : Type*} [Monoid G] {f : B → G} (hf : IsLiftable M val_inv := pow_one (f i * f i) ▸ M.diagonal i ▸ hf i i inv_val := pow_one (f i * f i) ▸ M.diagonal i ▸ hf i i +set_option backward.isDefEq.respectTransparency false in private theorem toMonoidHom_apply_symm_apply (a : PresentedGroup (M.relationsSet)) : (MulEquiv.toMonoidHom cs.mulEquiv : W →* PresentedGroup (M.relationsSet)) ((MulEquiv.symm cs.mulEquiv) a) = a := calc @@ -349,6 +352,7 @@ def lift {G : Type*} [Monoid G] : {f : B → G // IsLiftable M f} ≃ (W →* G) theorem lift_apply_simple {G : Type*} [Monoid G] {f : B → G} (hf : IsLiftable M f) (i : B) : cs.lift ⟨f, hf⟩ (s i) = f i := congrFun (congrArg Subtype.val (cs.lift.left_inv ⟨f, hf⟩)) i +set_option backward.isDefEq.respectTransparency false in /-- If two Coxeter systems on the same group `W` have the same Coxeter matrix `M : Matrix B B ℕ` and the same simple reflection map `B → W`, then they are identical. -/ theorem simple_determines_coxeterSystem : diff --git a/Mathlib/GroupTheory/Coxeter/Inversion.lean b/Mathlib/GroupTheory/Coxeter/Inversion.lean index 43ab142b541a9a..f6da05161685be 100644 --- a/Mathlib/GroupTheory/Coxeter/Inversion.lean +++ b/Mathlib/GroupTheory/Coxeter/Inversion.lean @@ -220,7 +220,7 @@ theorem rightInvSeq_concat (ω : List B) (i : B) : dsimp [rightInvSeq, concat] rw [ih] simp only [concat_eq_append, wordProd_append, wordProd_cons, wordProd_nil, mul_one, mul_inv_rev, - inv_simple, cons.injEq, and_true] + inv_simple, map_cons, MulAut.conj_apply, cons_append, cons.injEq, and_true] group private theorem leftInvSeq_eq_reverse_rightInvSeq_reverse (ω : List B) : diff --git a/Mathlib/GroupTheory/Coxeter/Matrix.lean b/Mathlib/GroupTheory/Coxeter/Matrix.lean index 48e73a06beccca..7d452c40fd0ac9 100644 --- a/Mathlib/GroupTheory/Coxeter/Matrix.lean +++ b/Mathlib/GroupTheory/Coxeter/Matrix.lean @@ -63,6 +63,10 @@ a Coxeter matrix and the standard geometric representation of a Coxeter group. @[expose] public section +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Matrix + /-- A *Coxeter matrix* is a symmetric matrix of natural numbers whose diagonal entries are equal to 1 and whose off-diagonal entries are not equal to 1. -/ @[ext] @@ -171,6 +175,7 @@ protected def I (m : ℕ) : CoxeterMatrix (Fin 2) where @[deprecated (since := "2026-03-25")] alias I₂ₙ := CoxeterMatrix.I +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type E₆. The corresponding Coxeter-Dynkin diagram is: @@ -188,6 +193,7 @@ def E₆ : CoxeterMatrix (Fin 6) where 2, 2, 2, 3, 1, 3; 2, 2, 2, 2, 3, 1] +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type E₇. The corresponding Coxeter-Dynkin diagram is: @@ -206,6 +212,7 @@ def E₇ : CoxeterMatrix (Fin 7) where 2, 2, 2, 2, 3, 1, 3; 2, 2, 2, 2, 2, 3, 1] +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type E₈. The corresponding Coxeter-Dynkin diagram is: @@ -225,6 +232,7 @@ def E₈ : CoxeterMatrix (Fin 8) where 2, 2, 2, 2, 2, 3, 1, 3; 2, 2, 2, 2, 2, 2, 3, 1] +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type F₄. The corresponding Coxeter-Dynkin diagram is: @@ -239,6 +247,7 @@ def F₄ : CoxeterMatrix (Fin 4) where 2, 4, 1, 3; 2, 2, 3, 1] +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type G₂. The corresponding Coxeter-Dynkin diagram is: @@ -251,6 +260,7 @@ def G₂ : CoxeterMatrix (Fin 2) where M := !![1, 6; 6, 1] +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type H₃. The corresponding Coxeter-Dynkin diagram is: @@ -264,6 +274,7 @@ def H₃ : CoxeterMatrix (Fin 3) where 3, 1, 5; 2, 5, 1] +set_option backward.isDefEq.respectTransparency false in /-- The Coxeter matrix of type H₄. The corresponding Coxeter-Dynkin diagram is: diff --git a/Mathlib/GroupTheory/Divisible.lean b/Mathlib/GroupTheory/Divisible.lean index 7c7bd39ddc27ab..5cdf5651696006 100644 --- a/Mathlib/GroupTheory/Divisible.lean +++ b/Mathlib/GroupTheory/Divisible.lean @@ -125,7 +125,7 @@ theorem RootableBy.surjective_pow [RootableBy A α] {n : α} (hn : n ≠ 0) : A `Monoid A` is `α`-rootable iff the `pow _ n` function is surjective, i.e. the constructive version implies the textbook approach. -/ -@[to_additive (attr := implicit_reducible) divisibleByOfSMulRightSurj +@[to_additive (attr := instance_reducible) divisibleByOfSMulRightSurj /-- An `AddMonoid A` is `α`-divisible iff `n • _` is a surjective function, i.e. the constructive version implies the textbook approach. -/] noncomputable def rootableByOfPowLeftSurj @@ -185,7 +185,7 @@ theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n /-- If for all `n ≠ 0 ∈ ℤ`, `n • A = A`, then `A` is divisible. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def divisibleByIntOfSMulTopEqTop (H : ∀ {n : ℤ} (_hn : n ≠ 0), n • (⊤ : AddSubgroup A) = ⊤) : DivisibleBy A ℤ where div a n := @@ -212,7 +212,7 @@ variable (A : Type*) [Group A] open Int in /-- A group is `ℤ`-rootable if it is `ℕ`-rootable. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive group is `ℤ`-divisible if it is `ℕ`-divisible. -/] def rootableByIntOfRootableByNat [RootableBy A ℕ] : RootableBy A ℤ where root a z := @@ -228,7 +228,7 @@ def rootableByIntOfRootableByNat [RootableBy A ℕ] : RootableBy A ℤ where /-- A group is `ℕ`-rootable if it is `ℤ`-rootable -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive group is `ℕ`-divisible if it `ℤ`-divisible. -/] def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ where root a n := RootableBy.root a (n : ℤ) @@ -248,7 +248,7 @@ variable (f : A → B) /-- If `f : A → B` is a surjective homomorphism and `A` is `α`-rootable, then `B` is also `α`-rootable. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If `f : A → B` is a surjective homomorphism and `A` is `α`-divisible, then `B` is also `α`-divisible. -/] noncomputable def Function.Surjective.rootableBy (hf : Function.Surjective f) diff --git a/Mathlib/GroupTheory/DivisibleHull.lean b/Mathlib/GroupTheory/DivisibleHull.lean index 30100ec81adb44..ccf545609caf85 100644 --- a/Mathlib/GroupTheory/DivisibleHull.lean +++ b/Mathlib/GroupTheory/DivisibleHull.lean @@ -196,6 +196,7 @@ theorem qsmul_of_nonpos {a : ℚ} (h : a ≤ 0) (x : DivisibleHull M) : have := h.eq_or_lt aesop (add simp [qsmul_def, abs_of_neg]) +set_option backward.isDefEq.respectTransparency false in theorem qsmul_mk (a : ℚ) (m : M) (s : ℕ+) : a • mk m s = mk (a.num • m) (⟨a.den, a.den_pos⟩ * s) := by obtain h | h := le_total 0 a @@ -209,6 +210,7 @@ theorem qsmul_mk (a : ℚ) (m : M) (s : ℕ+) : simpa using h simp [nnqsmul_mk, this, ← neg_mk] +set_option backward.isDefEq.respectTransparency false in noncomputable instance : Module ℚ (DivisibleHull M) where one_smul x := by @@ -268,6 +270,7 @@ instance : LE (DivisibleHull M) where theorem mk_le_mk {m m' : M} {s s' : ℕ+} : mk m s ≤ mk m' s' ↔ s'.val • m ≤ s.val • m' := by rfl +set_option backward.isDefEq.respectTransparency false in instance : LinearOrder (DivisibleHull M) where le_refl a := by induction a with | mk m s @@ -312,6 +315,7 @@ instance : IsOrderedCancelAddMonoid (DivisibleHull M) := simp_rw [PNat.mul_coe, smul_smul] at this convert! this using 3 <;> ring) +set_option backward.isDefEq.respectTransparency false in instance : IsStrictOrderedModule ℚ≥0 (DivisibleHull M) where smul_lt_smul_of_pos_left a ha b c h := by induction b with | mk mb sb @@ -333,6 +337,7 @@ end LinearOrder section OrderedGroup variable {M : Type*} [AddCommGroup M] [LinearOrder M] [IsOrderedAddMonoid M] +set_option backward.isDefEq.respectTransparency false in instance : IsStrictOrderedModule ℚ (DivisibleHull M) where smul_lt_smul_of_pos_left a ha b c h := by simp_rw [qsmul_of_nonneg ha.le] diff --git a/Mathlib/GroupTheory/DoubleCoset.lean b/Mathlib/GroupTheory/DoubleCoset.lean index 1b34f4dec5c52d..d6e8aeecbd926e 100644 --- a/Mathlib/GroupTheory/DoubleCoset.lean +++ b/Mathlib/GroupTheory/DoubleCoset.lean @@ -71,7 +71,7 @@ lemma eq_of_not_disjoint {H K : Subgroup G} {a b : G} apply doubleCoset_eq_of_mem ha /-- The setoid defined by the `doubleCoset` relation -/ -@[implicit_reducible] +@[instance_reducible] def setoid (H K : Set G) : Setoid G := Setoid.ker fun x => doubleCoset x H K @@ -140,6 +140,7 @@ lemma mk_eq_of_doubleCoset_eq {H K : Subgroup G} {a b : G} rw [eq] exact mem_doubleCoset.mp (h.symm ▸ mem_doubleCoset_self H K b) +set_option backward.isDefEq.respectTransparency false in lemma mem_quotToDoubleCoset_iff {H K : Subgroup G} (i : Quotient (H : Set G) K) (a : G) : a ∈ quotToDoubleCoset H K i ↔ mk H K a = i := by refine ⟨fun hg ↦ by simp [mk_eq_of_doubleCoset_eq (doubleCoset_eq_of_mem hg)], fun hg ↦ ?_⟩ diff --git a/Mathlib/GroupTheory/Exponent.lean b/Mathlib/GroupTheory/Exponent.lean index 370941c0f6b2b0..9e67ec75566da9 100644 --- a/Mathlib/GroupTheory/Exponent.lean +++ b/Mathlib/GroupTheory/Exponent.lean @@ -84,6 +84,7 @@ theorem _root_.AddMonoid.exponent_additive : theorem exponent_multiplicative {G : Type*} [AddMonoid G] : exponent (Multiplicative G) = AddMonoid.exponent G := rfl +set_option backward.isDefEq.respectTransparency false in open MulOpposite in @[to_additive (attr := simp)] theorem _root_.MulOpposite.exponent : exponent (MulOpposite G) = exponent G := by @@ -99,6 +100,7 @@ theorem ExponentExists.isOfFinOrder (h : ExponentExists G) {g : G} : IsOfFinOrde theorem ExponentExists.orderOf_pos (h : ExponentExists G) (g : G) : 0 < orderOf g := h.isOfFinOrder.orderOf_pos +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem exponent_ne_zero : exponent G ≠ 0 ↔ ExponentExists G := by rw [exponent] @@ -506,6 +508,7 @@ section CancelCommMonoid variable [CancelCommMonoid G] +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem exponent_eq_max'_orderOf [Fintype G] : exponent G = ((@Finset.univ G _).image orderOf).max' ⟨1, by simp⟩ := by diff --git a/Mathlib/GroupTheory/FixedPointFree.lean b/Mathlib/GroupTheory/FixedPointFree.lean index 0667459f420b41..31f2ea235c2006 100644 --- a/Mathlib/GroupTheory/FixedPointFree.lean +++ b/Mathlib/GroupTheory/FixedPointFree.lean @@ -71,7 +71,7 @@ theorem commute_all_of_involutive (hφ : FixedPointFree φ) (h2 : Function.Invol rwa [hφ.coe_eq_inv_of_involutive h2, inv_eq_iff_eq_inv, mul_inv_rev, inv_inv, inv_inv] at key /-- If a finite group admits a fixed-point-free involution, then it is commutative. -/ -@[implicit_reducible] +@[instance_reducible] def commGroupOfInvolutive (hφ : FixedPointFree φ) (h2 : Function.Involutive φ) : CommGroup G := .mk (hφ.commute_all_of_involutive h2) diff --git a/Mathlib/GroupTheory/FreeGroup/Basic.lean b/Mathlib/GroupTheory/FreeGroup/Basic.lean index 95fd9a588f7de9..93055b19b303bc 100644 --- a/Mathlib/GroupTheory/FreeGroup/Basic.lean +++ b/Mathlib/GroupTheory/FreeGroup/Basic.lean @@ -671,6 +671,7 @@ def Lift.aux : List (α × Bool) → β := fun L => theorem Red.Step.lift {f : α → β} (H : Red.Step L₁ L₂) : Lift.aux f L₁ = Lift.aux f L₂ := by obtain @⟨_, _, _, b⟩ := H; cases b <;> simp [Lift.aux, List.prod_append] +set_option backward.isDefEq.respectTransparency false in /-- If `β` is a group, then any function from `α` to `β` extends uniquely to a group homomorphism from the free group over `α` to `β` -/ @[to_additive (attr := simps symm_apply) @@ -738,6 +739,7 @@ section Map variable {β : Type v} (f : α → β) {x y : FreeGroup α} +set_option backward.isDefEq.respectTransparency false in /-- Any function from `α` to `β` extends uniquely to a group homomorphism from the free group over `α` to the free group over `β`. -/ @[to_additive /-- Any function from `α` to `β` extends uniquely to an additive group homomorphism @@ -957,6 +959,7 @@ def equivIntOfUnique [Unique α] : FreeGroup α ≃ ℤ where | succ x hx => simpa [zpow_add_one] using hx | pred x hx => simpa [zpow_sub_one, ← sub_eq_add_neg] using hx +set_option backward.isDefEq.respectTransparency false in /-- The isomorphism between the free group on a unique type and the integers. -/ def mulEquivIntOfUnique [Unique α] : FreeGroup α ≃* Multiplicative ℤ where toFun := Multiplicative.ofAdd ∘ equivIntOfUnique diff --git a/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean b/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean index cdd0050b96e0d8..b2e0e8cc01d7b6 100644 --- a/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean +++ b/Mathlib/GroupTheory/FreeGroup/NielsenSchreier.lean @@ -96,6 +96,7 @@ theorem ext_functor {G} [Groupoid.{v} G] [IsFreeGroupoid G] {X : Type v} [Group let ⟨_, _, u⟩ := @unique_lift G _ _ X _ fun (a b : Generators G) (e : a ⟶ b) => g.map (of e) _root_.trans (u _ h) (u _ fun _ _ _ => rfl).symm +set_option backward.isDefEq.respectTransparency.types false in /-- An action groupoid over a free group is free. More generally, one could show that the groupoid of elements over a free groupoid is free, but this version is easier to prove and suffices for our purposes. @@ -155,6 +156,7 @@ private def root' : G := -- this has to be marked noncomputable, see issue https://github.com/leanprover-community/mathlib4/pull/451. -- It might be nicer to define this in terms of `composePath` +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- A path in the tree gives a hom, by composition. -/ @@ -162,12 +164,14 @@ def homOfPath : ∀ {a : G}, Path (root T) a → (root' T ⟶ a) | _, Path.nil => 𝟙 _ | _, Path.cons p f => homOfPath p ≫ Sum.recOn f.val (fun e => of e) fun e => inv (of e) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- For every vertex `a`, there is a canonical hom from the root, given by the path in the tree. -/ def treeHom (a : G) : root' T ⟶ a := homOfPath T default +set_option backward.isDefEq.respectTransparency.types false in /-- Any path to `a` gives `treeHom T a`, since paths in the tree are unique. -/ theorem treeHom_eq {a : G} (p : Path (root T) a) : treeHom T a = homOfPath T p := by rw [treeHom, Unique.default_eq] @@ -199,6 +203,7 @@ theorem loopOfHom_eq_id {a b : Generators G} (e) (H : e ∈ wideSubquiverSymmetr · rw [treeHom_eq T (Path.cons default ⟨Sum.inr e, H⟩), homOfPath] simp only [IsIso.inv_hom_id, Category.comp_id, Category.assoc, treeHom] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Since a hom gives a loop, any homomorphism from the vertex group at the root @@ -272,6 +277,7 @@ private def symgen {G : Type u} [Groupoid.{v} G] [IsFreeGroupoid G] : G → Symmetrify (Generators G) := id +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- If there exists a morphism `a → b` in a free groupoid, then there also exists a zigzag diff --git a/Mathlib/GroupTheory/GroupAction/Blocks.lean b/Mathlib/GroupTheory/GroupAction/Blocks.lean index acb6b45fc25ac4..d871112e0e7924 100644 --- a/Mathlib/GroupTheory/GroupAction/Blocks.lean +++ b/Mathlib/GroupTheory/GroupAction/Blocks.lean @@ -580,7 +580,7 @@ def block_stabilizerOrderIso [htGX : IsPretransitive G X] (a : X) : (id (propext Subtype.mk_eq_mk)).mpr (stabilizer_orbit_eq hH) map_rel_iff' := by rintro ⟨B, ha, hB⟩; rintro ⟨B', ha', hB'⟩ - simp only [Equiv.coe_fn_mk, Subtype.mk_le_mk, Set.le_eq_subset] + simp only [Subtype.mk_le_mk, Set.le_eq_subset] constructor · rintro hBB' b hb obtain ⟨k, rfl⟩ := htGX.exists_smul_eq a b diff --git a/Mathlib/GroupTheory/GroupAction/CardCommute.lean b/Mathlib/GroupTheory/GroupAction/CardCommute.lean index a3d60864ae084c..d714e5be99c14a 100644 --- a/Mathlib/GroupTheory/GroupAction/CardCommute.lean +++ b/Mathlib/GroupTheory/GroupAction/CardCommute.lean @@ -66,6 +66,7 @@ theorem card_eq_sum_card_group_div_card_stabilizer [Fintype α] [Fintype β] [Fi end MulAction +set_option backward.isDefEq.respectTransparency false in instance instInfiniteProdSubtypeCommute [Mul α] [Infinite α] : Infinite { p : α × α // Commute p.1 p.2 } := Infinite.of_injective (fun a => ⟨⟨a, a⟩, rfl⟩) (by intro; simp) diff --git a/Mathlib/GroupTheory/GroupAction/ConjAct.lean b/Mathlib/GroupTheory/GroupAction/ConjAct.lean index f6243e6eabcb82..1a1cc7868e231e 100644 --- a/Mathlib/GroupTheory/GroupAction/ConjAct.lean +++ b/Mathlib/GroupTheory/GroupAction/ConjAct.lean @@ -252,6 +252,7 @@ theorem _root_.MulAut.conjNormal_apply {H : Subgroup G} [H.Normal] (g : G) (h : ↑(MulAut.conjNormal g h) = g * h * g⁻¹ := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem _root_.MulAut.conjNormal_symm_apply {H : Subgroup G} [H.Normal] (g : G) (h : H) : ↑((MulAut.conjNormal g).symm h) = g⁻¹ * h * g := by diff --git a/Mathlib/GroupTheory/GroupAction/Hom.lean b/Mathlib/GroupTheory/GroupAction/Hom.lean index e10c5e860767a4..906c5a3af5952d 100644 --- a/Mathlib/GroupTheory/GroupAction/Hom.lean +++ b/Mathlib/GroupTheory/GroupAction/Hom.lean @@ -228,7 +228,7 @@ lemma _root_.FaithfulSMul.of_injective variable {ψ χ} (M N) /-- The identity map as an equivariant map. -/ -@[to_additive (attr := implicit_reducible) /-- The identity map as an equivariant map. -/] +@[to_additive (attr := instance_reducible) /-- The identity map as an equivariant map. -/] protected def id : X →[M] X := ⟨fun x ↦ x, fun _ _ => rfl⟩ @@ -249,7 +249,7 @@ variable {φ ψ χ X Y Z} -- attribute [instance] CompTriple.id_comp CompTriple.comp_id /-- Composition of two equivariant maps. -/ -@[to_additive (attr := implicit_reducible) /-- Composition of two equivariant maps. -/] +@[to_additive (attr := instance_reducible) /-- Composition of two equivariant maps. -/] def comp (g : Y →ₑ[ψ] Z) (f : X →ₑ[φ] Y) [κ : CompTriple φ ψ χ] : X →ₑ[χ] Z := ⟨fun x ↦ g (f x), fun m x => @@ -734,7 +734,7 @@ protected theorem map_smulₑ (f : A →ₑ*[φ] B) (m : M) (x : A) : f (m • x variable (M) /-- The identity map as an equivariant monoid homomorphism. -/ -@[to_additive (dont_translate := M) (attr := implicit_reducible) +@[to_additive (dont_translate := M) (attr := instance_reducible) /-- The identity map as an equivariant additive monoid homomorphism. -/] protected def id : A →*[M] A := ⟨MulActionHom.id _, rfl, fun _ _ => rfl⟩ @@ -776,7 +776,7 @@ instance {A : Type*} [AddMonoid A] [DistribMulAction M A] ⟨0⟩ /-- Composition of two equivariant monoid homomorphisms. -/ -@[to_additive (dont_translate := M N P) (attr := implicit_reducible) +@[to_additive (dont_translate := M N P) (attr := instance_reducible) /-- Composition of two equivariant additive monoid homomorphisms. -/] def comp [κ : MonoidHom.CompTriple φ ψ χ] (g : B →ₑ*[ψ] C) (f : A →ₑ*[φ] B) : A →ₑ*[χ] C := @@ -952,7 +952,7 @@ namespace MulSemiringActionHom variable (M) {R} /-- The identity map as an equivariant ring homomorphism. -/ -@[implicit_reducible] +@[instance_reducible] protected def id : R →+*[M] R := ⟨DistribMulActionHom.id _, rfl, (fun _ _ => rfl)⟩ @@ -971,7 +971,7 @@ variable {R S T} variable {φ φ' ψ χ} /-- Composition of two equivariant additive ring homomorphisms. -/ -@[implicit_reducible] +@[instance_reducible] def comp (g : S →ₑ+*[ψ] T) (f : R →ₑ+*[φ] S) [κ : MonoidHom.CompTriple φ ψ χ] : R →ₑ+*[χ] T := { DistribMulActionHom.comp (g : S →ₑ+[ψ] T) (f : R →ₑ+[φ] S), RingHom.comp (g : S →+* T) (f : R →+* S) with } diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction/Combination.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction/Combination.lean index 4b5b94fee86bf1..0bb856ce1729f3 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction/Combination.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction/Combination.lean @@ -135,6 +135,7 @@ attribute [to_additive existing] faithfulSMul variable (α G) +set_option backward.isDefEq.respectTransparency false in variable (n) in /-- The equivariant map from embeddings of `Fin n` (aka arrangement) to combinations. -/ @[to_additive /-- The equivariant map from embeddings of `Fin n` diff --git a/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean b/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean index 206f4857e73736..43154cd87e9f22 100644 --- a/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean +++ b/Mathlib/GroupTheory/GroupAction/SubMulAction/OfFixingSubgroup.lean @@ -221,6 +221,7 @@ theorem _root_.Set.conj_mem_fixingSubgroup (hg : g • t = s) {k : M} (hk : k rw [← Set.mem_smul_set_iff_inv_smul_mem, hg] exact hy +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem fixingSubgroup_map_conj_eq (hg : g • t = s) : (fixingSubgroup M t).map (MulAut.conj g).toMonoidHom = fixingSubgroup M s := by @@ -384,6 +385,7 @@ lemma ofFixingSubgroup_of_inclusion_injective {hst : t ⊆ s} : rw [← SetLike.coe_eq_coe] at hxy ⊢ exact hxy +set_option backward.isDefEq.respectTransparency false in variable (M) in /-- The equivariant map between `SubMulAction.ofStabilizer M a` and `ofFixingSubgroup M {a}`. -/ diff --git a/Mathlib/GroupTheory/GroupExtension/Basic.lean b/Mathlib/GroupTheory/GroupExtension/Basic.lean index df1a5fed32cf62..2a43655d815a4c 100644 --- a/Mathlib/GroupTheory/GroupExtension/Basic.lean +++ b/Mathlib/GroupTheory/GroupExtension/Basic.lean @@ -148,6 +148,7 @@ variable (s : S.Splitting) /-- `G` acts on `N` by conjugation. -/ noncomputable def conjAct : G →* MulAut N := S.conjAct.comp s +set_option backward.isDefEq.respectTransparency false in /-- A split group extension is equivalent to the extension associated to a semidirect product. -/ noncomputable def semidirectProductToGroupExtensionEquiv : (SemidirectProduct.toGroupExtension s.conjAct).Equiv S where diff --git a/Mathlib/GroupTheory/HNNExtension.lean b/Mathlib/GroupTheory/HNNExtension.lean index ffa74f4db313e0..367b564b798def 100644 --- a/Mathlib/GroupTheory/HNNExtension.lean +++ b/Mathlib/GroupTheory/HNNExtension.lean @@ -118,6 +118,7 @@ theorem hom_ext {f g : HNNExtension G A B φ →* M} (MonoidHom.cancel_right Con.mk'_surjective).mp <| Coprod.hom_ext hg (MonoidHom.ext_mint ht) +set_option backward.isDefEq.respectTransparency false in @[elab_as_elim] theorem induction_on {motive : HNNExtension G A B φ → Prop} (x : HNNExtension G A B φ) (of : ∀ g, motive (of g)) @@ -401,6 +402,7 @@ theorem not_cancels_of_cons_hyp (u : ℤˣ) (w : NormalWord d) rw [hx] at h2 simpa using h2 (-u) rfl hw +set_option backward.isDefEq.respectTransparency false in theorem unitsSMul_cancels_iff (u : ℤˣ) (w : NormalWord d) : Cancels (-u) (unitsSMul φ u w) ↔ ¬ Cancels u w := by by_cases h : Cancels u w @@ -418,12 +420,12 @@ theorem unitsSMul_cancels_iff (u : ℤˣ) (w : NormalWord d) : · simp only [unitsSMul, dif_neg h] simpa [Cancels] using h -set_option backward.defeqAttrib.useBackward true in theorem unitsSMul_neg (u : ℤˣ) (w : NormalWord d) : unitsSMul φ (-u) (unitsSMul φ u w) = w := by rw [unitsSMul] split_ifs with hcan - · have hncan : ¬ Cancels u w := (unitsSMul_cancels_iff _ _ _).1 hcan + · set_option backward.isDefEq.respectTransparency false in + have hncan : ¬ Cancels u w := (unitsSMul_cancels_iff _ _ _).1 hcan unfold unitsSMul simp only [dif_neg hncan] simp [unitsSMulWithCancel, unitsSMulGroup, (d.compl u).equiv_snd_eq_inv_mul, @@ -435,7 +437,7 @@ theorem unitsSMul_neg (u : ℤˣ) (w : NormalWord d) : | ofGroup => simp [Cancels] at hcan2 | cons g u' w h1 h2 ih => clear ih - simp only [unitsSMulGroup, SetLike.coe_sort_coe, unitsSMulWithCancel, id_eq, consRecOn_cons, + simp only [unitsSMulGroup, SetLike.coe_sort_coe, unitsSMulWithCancel, consRecOn_cons, group_smul_head, mul_inv_rev] cases hcan2.2 @@ -492,14 +494,17 @@ theorem prod_group_smul (g : G) (w : NormalWord d) : (g • w).prod φ = of g * (w.prod φ) := by simp [ReducedWord.prod, mul_assoc] +set_option backward.isDefEq.respectTransparency false in theorem of_smul_eq_smul (g : G) (w : NormalWord d) : (of g : HNNExtension G A B φ) • w = g • w := by simp +instances [instHSMul, SMul.smul, MulAction.toEndHom] +set_option backward.isDefEq.respectTransparency false in theorem t_smul_eq_unitsSMul (w : NormalWord d) : (t : HNNExtension G A B φ) • w = unitsSMul φ 1 w := by simp +instances [instHSMul, SMul.smul, MulAction.toEndHom] +set_option backward.isDefEq.respectTransparency false in theorem t_pow_smul_eq_unitsSMul (u : ℤˣ) (w : NormalWord d) : (t ^ (u : ℤ) : HNNExtension G A B φ) • w = unitsSMul φ u w := by rcases Int.units_eq_one_or u with (rfl | rfl) <;> diff --git a/Mathlib/GroupTheory/Index.lean b/Mathlib/GroupTheory/Index.lean index a0bf0a289123cc..0138fb6559a386 100644 --- a/Mathlib/GroupTheory/Index.lean +++ b/Mathlib/GroupTheory/Index.lean @@ -527,7 +527,7 @@ theorem index_ne_zero_of_finite [hH : Finite (G ⧸ H)] : H.index ≠ 0 := by exact Nat.card_pos.ne' /-- Finite index implies finite quotient. -/ -@[to_additive (attr := implicit_reducible) /-- Finite index implies finite quotient. -/] +@[to_additive (attr := instance_reducible) /-- Finite index implies finite quotient. -/] noncomputable def fintypeOfIndexNeZero (hH : H.index ≠ 0) : Fintype (G ⧸ H) := @Fintype.ofFinite _ (Nat.finite_of_card_ne_zero hH) @@ -557,6 +557,7 @@ lemma finite_quotient_of_pretransitive_of_index_ne_zero {X : Type*} [MulAction G have := (MulAction.pretransitive_iff_subsingleton_quotient G X).1 inferInstance exact finite_quotient_of_finite_quotient_of_index_ne_zero hi +set_option backward.isDefEq.respectTransparency false in @[to_additive] lemma exists_pow_mem_of_index_ne_zero (h : H.index ≠ 0) (a : G) : ∃ n, 0 < n ∧ n ≤ H.index ∧ a ^ n ∈ H := by @@ -703,7 +704,7 @@ lemma isFiniteRelIndex_top_iff : H.IsFiniteRelIndex ⊤ ↔ H.FiniteIndex := by rw [finiteIndex_iff, isFiniteRelIndex_iff_relIndex_ne_zero, relIndex_top_right] /-- A finite index subgroup has finite quotient. -/ -@[to_additive (attr := implicit_reducible) /-- A finite index subgroup has finite quotient -/] +@[to_additive (attr := instance_reducible) /-- A finite index subgroup has finite quotient -/] noncomputable def fintypeQuotientOfFiniteIndex [FiniteIndex H] : Fintype (G ⧸ H) := fintypeOfIndexNeZero FiniteIndex.index_ne_zero @@ -839,11 +840,13 @@ variable {G H : Type*} [Group H] (h : H) -- NB: `to_additive` does not work to generate the second lemma from the first here, because it -- would need to additivize `G`, but not `H`. +set_option backward.isDefEq.respectTransparency false in lemma Subgroup.relIndex_pointwise_smul [Group G] [MulDistribMulAction H G] (J K : Subgroup G) : (h • J).relIndex (h • K) = J.relIndex K := by rw [pointwise_smul_def K, ← relIndex_comap, pointwise_smul_def, comap_map_eq_self_of_injective (by intro a b; simp)] +set_option backward.isDefEq.respectTransparency false in lemma AddSubgroup.relIndex_pointwise_smul [AddGroup G] [DistribMulAction H G] (J K : AddSubgroup G) : (h • J).relIndex (h • K) = J.relIndex K := by rw [pointwise_smul_def K, ← relIndex_comap, pointwise_smul_def, diff --git a/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean b/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean index 4fe295b7bccc1a..9cae4988c9d3ad 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/GrothendieckGroup.lean @@ -84,6 +84,7 @@ noncomputable def lift : (M →* G) ≃ (GrothendieckGroup M →* G) where left_inv f := by ext; simp right_inv f := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[to_additive] lemma lift_apply (f : M →* G) (x : GrothendieckGroup M) : lift f x = f ((monoidOf ⊤).sec x).1 / f ((monoidOf ⊤).sec x).2 := by diff --git a/Mathlib/GroupTheory/MonoidLocalization/Maps.lean b/Mathlib/GroupTheory/MonoidLocalization/Maps.lean index c0564258bd4786..12536603c78734 100644 --- a/Mathlib/GroupTheory/MonoidLocalization/Maps.lean +++ b/Mathlib/GroupTheory/MonoidLocalization/Maps.lean @@ -143,6 +143,7 @@ theorem lift_spec_mul (z w v) : f.lift hg z * w = v ↔ g (f.sec z).1 * w = g (f theorem lift_mk'_spec (x v) (y : S) : f.lift hg (f.mk' x y) = v ↔ g x = g y * v := by rw [f.lift_mk' hg]; exact mul_inv_left hg _ _ _ +set_option backward.isDefEq.respectTransparency false in /-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, if a `CommMonoid` map `g : M →* P` induces a map `f.lift hg : N →* P` then for all `z : N`, we have `f.lift hg z * g y = g x`, where `x : M, y ∈ S` are such that `z * f y = f x`. -/ @@ -280,6 +281,7 @@ theorem map_eq (x) : f.map hy k (f x) = k (g x) := theorem map_comp : (f.map hy k).comp f.toMonoidHom = k.toMonoidHom.comp g := f.lift_comp fun y ↦ k.map_units ⟨g y, hy y⟩ +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem map_mk' (x) (y : S) : f.map hy k (f.mk' x y) = k.mk' (g x) ⟨g y, hy y⟩ := by rw [map, lift_mk', mul_inv_left] @@ -327,6 +329,7 @@ theorem map_mul_left (z) : k (g (f.sec z).2) * f.map hy k z = k (g (f.sec z).1) theorem map_id (z : N) : f.map (fun y ↦ show MonoidHom.id M y ∈ S from y.2) f z = z := f.lift_id z +set_option backward.isDefEq.respectTransparency false in /-- If `CommMonoid` homs `g : M →* P, l : P →* A` induce maps of localizations, the composition of the induced maps equals the map of localizations induced by `l ∘ g`. -/ @[to_additive diff --git a/Mathlib/GroupTheory/NoncommCoprod.lean b/Mathlib/GroupTheory/NoncommCoprod.lean index 164b867def0ad8..caf4e012fe070f 100644 --- a/Mathlib/GroupTheory/NoncommCoprod.lean +++ b/Mathlib/GroupTheory/NoncommCoprod.lean @@ -103,6 +103,7 @@ theorem noncommCoprod_comp_inl : (f.noncommCoprod g comm).comp (inl M N) = f := theorem noncommCoprod_comp_inr : (f.noncommCoprod g comm).comp (inr M N) = g := ext fun x => by simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem noncommCoprod_unique (f : M × N →* P) : (f.comp (inl M N)).noncommCoprod (f.comp (inr M N)) (fun _ _ => (commute_inl_inr _ _).map f) @@ -114,6 +115,7 @@ theorem noncommCoprod_inl_inr {M N : Type*} [Monoid M] [Monoid N] : (inl M N).noncommCoprod (inr M N) commute_inl_inr = id (M × N) := noncommCoprod_unique <| .id (M × N) +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem comp_noncommCoprod {Q : Type*} [Monoid Q] (h : P →* Q) : h.comp (f.noncommCoprod g comm) = diff --git a/Mathlib/GroupTheory/NoncommPiCoprod.lean b/Mathlib/GroupTheory/NoncommPiCoprod.lean index bf213e8c34802c..59fd117e351a84 100644 --- a/Mathlib/GroupTheory/NoncommPiCoprod.lean +++ b/Mathlib/GroupTheory/NoncommPiCoprod.lean @@ -98,6 +98,7 @@ variable (hcomm : Pairwise fun i j => ∀ x y, Commute (ϕ i x) (ϕ j y)) namespace MonoidHom +set_option backward.isDefEq.respectTransparency false in /-- The canonical homomorphism from a family of monoids. -/ @[to_additive /-- The canonical homomorphism from a family of additive monoids. See also `LinearMap.lsum` for a linear version without the commutativity assumption. -/] @@ -115,6 +116,7 @@ def noncommPiCoprod : (∀ i : ι, N i) →* M where variable {hcomm} +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem noncommPiCoprod_mulSingle [DecidableEq ι] (i : ι) (y : N i) : noncommPiCoprod ϕ hcomm (Pi.mulSingle i y) = ϕ i y := by @@ -184,6 +186,7 @@ lemma noncommPiCoprod_apply (h : (i : ι) → N i) : (Pairwise.set_pairwise (fun ⦃i j⦄ a ↦ hcomm a (h i) (h j)) _) := by dsimp only [MonoidHom.noncommPiCoprod, MonoidHom.coe_mk, OneHom.coe_mk] +set_option backward.isDefEq.respectTransparency false in /-- Given monoid morphisms `φᵢ : Nᵢ → M` and `f : M → P`, if we have sufficient commutativity, then `f ∘ (∐ᵢ φᵢ) = ∐ᵢ (f ∘ φᵢ)` -/ @@ -326,6 +329,7 @@ theorem noncommPiCoprod_mulSingle [DecidableEq ι] {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y} (i : ι) (y : H i) : noncommPiCoprod hcomm (Pi.mulSingle i y) = y := by apply MonoidHom.noncommPiCoprod_mulSingle +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem noncommPiCoprod_range {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y} : diff --git a/Mathlib/GroupTheory/OrderOfElement.lean b/Mathlib/GroupTheory/OrderOfElement.lean index a3c866e905e6ff..4c7892c5683aaa 100644 --- a/Mathlib/GroupTheory/OrderOfElement.lean +++ b/Mathlib/GroupTheory/OrderOfElement.lean @@ -222,6 +222,7 @@ lemma orderOf_zero (M₀ : Type*) [MonoidWithZero M₀] [Nontrivial M₀] : orde rw [orderOf_eq_zero_iff, isOfFinOrder_iff_pow_eq_one] simp +contextual [ne_of_gt] +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem orderOf_eq_iff {n} (h : 0 < n) : orderOf x = n ↔ x ^ n = 1 ∧ ∀ m, m < n → 0 < m → x ^ m ≠ 1 := by @@ -567,6 +568,7 @@ noncomputable def finEquivPowers {x : G} (hx : IsOfFinOrder x) : Fin (orderOf x) lemma finEquivPowers_apply {x : G} (hx : IsOfFinOrder x) {n : Fin (orderOf x)} : finEquivPowers hx n = ⟨x ^ (n : ℕ), n, rfl⟩ := rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma finEquivPowers_symm_apply {x : G} (hx : IsOfFinOrder x) (n : ℕ) : (finEquivPowers hx).symm ⟨x ^ n, _, rfl⟩ = ⟨n % orderOf x, Nat.mod_lt _ hx.orderOf_pos⟩ := by @@ -954,7 +956,7 @@ lemma isOfFinOrder_of_finite (x : G) : IsOfFinOrder x := by by_contra h; exact infinite_not_isOfFinOrder h <| Set.toFinite _ /-- Every finite left cancellative monoid is a group. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Every finite left cancellative additive monoid is an additive group. -/] noncomputable def LeftCancelMonoid.groupOfFinite : Group G where inv x := x ^ (orderOf x - 1) @@ -963,7 +965,7 @@ noncomputable def LeftCancelMonoid.groupOfFinite : Group G where exact (isOfFinOrder_of_finite x).orderOf_pos /-- Every finite right cancellative monoid is a group. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Every finite right cancellative additive monoid is an additive group. -/] noncomputable def RightCancelMonoid.groupOfFinite {H : Type*} [RightCancelMonoid H] [Finite H] : Group H := by diff --git a/Mathlib/GroupTheory/OreLocalization/Basic.lean b/Mathlib/GroupTheory/OreLocalization/Basic.lean index 56ee05112b88b1..3ae3d1b39227be 100644 --- a/Mathlib/GroupTheory/OreLocalization/Basic.lean +++ b/Mathlib/GroupTheory/OreLocalization/Basic.lean @@ -59,7 +59,7 @@ namespace OreLocalization variable {R : Type*} [Monoid R] (S : Submonoid R) [OreSet S] (X) [MulAction R X] /-- The setoid on `R × S` used for the Ore localization. -/ -@[to_additive (attr := implicit_reducible) AddOreLocalization.oreEqv +@[to_additive (attr := instance_reducible) AddOreLocalization.oreEqv /-- The setoid on `R × S` used for the Ore localization. -/] def oreEqv : Setoid (X × S) where r rs rs' := ∃ (u : S) (v : R), u • rs'.1 = v • rs.1 ∧ u * rs'.2 = v * rs.2 diff --git a/Mathlib/GroupTheory/PGroup.lean b/Mathlib/GroupTheory/PGroup.lean index 86024127dfa148..8ce858f41382a7 100644 --- a/Mathlib/GroupTheory/PGroup.lean +++ b/Mathlib/GroupTheory/PGroup.lean @@ -247,6 +247,7 @@ theorem map {H : Subgroup G} (hH : IsPGroup p H) {K : Type*} [Group K] (ϕ : G rw [← H.range_subtype, MonoidHom.map_range] exact hH.of_surjective (ϕ.restrict H).rangeRestrict (ϕ.restrict H).rangeRestrict_surjective +set_option backward.isDefEq.respectTransparency false in theorem comap_of_ker_isPGroup {H : Subgroup G} (hH : IsPGroup p H) {K : Type*} [Group K] (ϕ : K →* G) (hϕ : IsPGroup p ϕ.ker) : IsPGroup p (H.comap ϕ) := by intro g @@ -366,7 +367,7 @@ theorem cyclic_center_quotient_of_card_eq_prime_sq (hG : Nat.card G = p ^ 2) : /-- A group of order `p ^ 2` is commutative. See also `IsPGroup.commutative_of_card_eq_prime_sq` for just the proof that `∀ a b, a * b = b * a` -/ -@[implicit_reducible] +@[instance_reducible] def commGroupOfCardEqPrimeSq (hG : Nat.card G = p ^ 2) : CommGroup G := @commGroupOfCyclicCenterQuotient _ _ _ _ (cyclic_center_quotient_of_card_eq_prime_sq hG) _ (QuotientGroup.ker_mk' (center G)).le diff --git a/Mathlib/GroupTheory/Perm/Centralizer.lean b/Mathlib/GroupTheory/Perm/Centralizer.lean index 170e2579f1fa8e..7ebc99f5685813 100644 --- a/Mathlib/GroupTheory/Perm/Centralizer.lean +++ b/Mathlib/GroupTheory/Perm/Centralizer.lean @@ -128,7 +128,7 @@ lemma Subgroup.Centralizer.toConjAct_smul_mem_cycleFactorsFinset {k c : Perm α} /-- The action by conjugation of `Subgroup.centralizer {g}` on the cycles of a given permutation -/ -@[implicit_reducible] +@[instance_reducible] def Subgroup.Centralizer.cycleFactorsFinset_mulAction : MulAction (centralizer {g}) g.cycleFactorsFinset where smul k c := ⟨ConjAct.toConjAct (k : Perm α) • c.val, @@ -345,6 +345,7 @@ theorem ofPermHomFun_one (x : α) : (ofPermHomFun a 1) x = x := by · rw [ofPermHomFun_apply_of_mem_fixedPoints a _ hx] · rw [ofPermHomFun_apply_of_cycleOf_mem a _ hc hm, OneMemClass.coe_one, coe_one, id_eq, hm] +set_option backward.isDefEq.respectTransparency false in /-- Given `a : g.Basis` and a permutation of `g.cycleFactorsFinset` that preserve the lengths of the cycles, a permutation of `α` that moves the `Basis` and commutes with `g` -/ @@ -458,6 +459,7 @@ theorem range_toPermHom_eq_range_toPermHom' : ext τ rw [mem_range_toPermHom_iff, mem_range_toPermHom'_iff] +set_option backward.isDefEq.respectTransparency false in theorem nat_card_range_toPermHom : Nat.card (toPermHom g).range = ∏ n ∈ g.cycleType.toFinset, (g.cycleType.count n)! := by @@ -488,6 +490,7 @@ def kerParam : (Perm (Function.fixedPoints g)) × MonoidHom.noncommCoprod ofSubtype (Subgroup.noncommPiCoprod g.pairwise_commute_of_mem_zpowers) g.commute_ofSubtype_noncommPiCoprod +set_option backward.isDefEq.respectTransparency false in theorem kerParam_apply {u : Perm (Function.fixedPoints g)} {v : (c : g.cycleFactorsFinset) → Subgroup.zpowers c.val} {x : α} : kerParam g (u, v) x = @@ -596,6 +599,7 @@ open Function variable {a : Type*} (g : Perm α) (k : Perm (fixedPoints g)) (v : (c : g.cycleFactorsFinset) → Subgroup.zpowers (c : Perm α)) +set_option backward.isDefEq.respectTransparency false in theorem sign_kerParam_apply_apply : sign (kerParam g ⟨k, v⟩) = sign k * ∏ c, sign (v c).val := by rw [kerParam, MonoidHom.noncommCoprod_apply, ← Prod.fst_mul_snd ⟨k, v⟩, Prod.mk_mul_mk, mul_one, diff --git a/Mathlib/GroupTheory/Perm/Cycle/Basic.lean b/Mathlib/GroupTheory/Perm/Cycle/Basic.lean index 4b876072012319..35a653ff9e68a2 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Basic.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Basic.lean @@ -78,7 +78,7 @@ theorem SameCycle.equivalence : Equivalence (SameCycle f) := ⟨SameCycle.refl f, SameCycle.symm, SameCycle.trans⟩ /-- The setoid defined by the `SameCycle` relation. -/ -@[implicit_reducible] +@[instance_reducible] def SameCycle.setoid (f : Perm α) : Setoid α where r := f.SameCycle iseqv := SameCycle.equivalence f @@ -323,6 +323,7 @@ variable [Fintype α] theorem IsCycle.two_le_card_support (h : IsCycle f) : 2 ≤ #f.support := two_le_card_support_of_ne_one h.ne_one +set_option backward.isDefEq.respectTransparency false in /-- The subgroup generated by a cycle is in bijection with its support -/ noncomputable def IsCycle.zpowersEquivSupport {σ : Perm α} (hσ : IsCycle σ) : (Subgroup.zpowers σ) ≃ σ.support := @@ -898,6 +899,7 @@ namespace Finset variable {f : Perm α} {s : Finset α} +set_option backward.isDefEq.respectTransparency false in theorem product_self_eq_disjiUnion_perm_aux (hf : f.IsCycleOn s) : (range #s : Set ℕ).PairwiseDisjoint fun k => s.map ⟨fun i => (i, (f ^ k) i), fun _ _ => congr_arg Prod.fst⟩ := by @@ -945,6 +947,7 @@ namespace Finset variable [Semiring α] [AddCommMonoid β] [Module α β] {s : Finset ι} {σ : Perm ι} +set_option backward.isDefEq.respectTransparency false in theorem sum_smul_sum_eq_sum_perm (hσ : σ.IsCycleOn s) (f : ι → α) (g : ι → β) : (∑ i ∈ s, f i) • ∑ i ∈ s, g i = ∑ k ∈ range #s, ∑ i ∈ s, f i • g ((σ ^ k) i) := by rw [sum_smul_sum, ← sum_product'] diff --git a/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean b/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean index 8cb2d346aea3a7..14a488c67598bf 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Concrete.lean @@ -138,6 +138,7 @@ def formPerm : ∀ s : Cycle α, Nodup s → Equiv.Perm α := theorem formPerm_coe (l : List α) (hl : l.Nodup) : formPerm (l : Cycle α) hl = l.formPerm := rfl +set_option backward.isDefEq.respectTransparency false in theorem formPerm_subsingleton (s : Cycle α) (h : Subsingleton s) : formPerm s h.nodup = 1 := by obtain ⟨s⟩ := s simp only [formPerm_coe, mk_eq_coe] @@ -159,6 +160,7 @@ theorem support_formPerm [Fintype α] (s : Cycle α) (h : Nodup s) (hn : Nontriv rintro _ rfl simpa [Nat.succ_le_succ_iff] using length_nontrivial hn +set_option backward.isDefEq.respectTransparency.types false in theorem formPerm_eq_self_of_notMem (s : Cycle α) (h : Nodup s) (x : α) (hx : x ∉ s) : formPerm s h x = x := by induction s using Quot.inductionOn @@ -169,11 +171,13 @@ theorem formPerm_apply_mem_eq_next (s : Cycle α) (h : Nodup s) (x : α) (hx : x induction s using Quot.inductionOn simpa using! List.formPerm_apply_mem_eq_next h _ (by simp_all) +set_option backward.isDefEq.respectTransparency.types false in nonrec theorem formPerm_reverse (s : Cycle α) (h : Nodup s) : formPerm s.reverse (nodup_reverse_iff.mpr h) = (formPerm s h)⁻¹ := by induction s using Quot.inductionOn simpa using formPerm_reverse _ +set_option backward.isDefEq.respectTransparency.types false in nonrec theorem formPerm_eq_formPerm_iff {α : Type*} [DecidableEq α] {s s' : Cycle α} {hs : s.Nodup} {hs' : s'.Nodup} : s.formPerm hs = s'.formPerm hs' ↔ s = s' ∨ s.Subsingleton ∧ s'.Subsingleton := by @@ -360,6 +364,7 @@ def toCycle (f : Perm α) (hf : IsCycle f) : Cycle α := have hc : SameCycle f x y := IsCycle.sameCycle hf hx hy exact Quotient.sound' hc.toList_isRotated) +set_option backward.isDefEq.respectTransparency false in theorem toCycle_eq_toList (f : Perm α) (hf : IsCycle f) (x : α) (hx : f x ≠ x) : toCycle f hf = toList f x := by have key : (Finset.univ : Finset α).val = x ::ₘ Finset.univ.val.erase x := by simp @@ -397,6 +402,7 @@ theorem toCycle_next (f : Perm α) (hf : f.IsCycle) (hx : x ∈ toCycle f hf) : simp only [hl, Cycle.mem_coe_iff] at ⊢ hx exact Equiv.Perm.next_toList_eq_apply f l x hx +set_option backward.isDefEq.respectTransparency false in /-- Any cyclic `f : Perm α` is isomorphic to the nontrivial `Cycle α` that corresponds to repeated application of `f`. The forward direction is implemented by `Equiv.Perm.toCycle`. @@ -431,6 +437,7 @@ section Finite variable [Finite α] [DecidableEq α] +set_option backward.isDefEq.respectTransparency false in theorem IsCycle.existsUnique_cycle {f : Perm α} (hf : IsCycle f) : ∃! s : Cycle α, ∃ h : s.Nodup, s.formPerm h = f := by cases nonempty_fintype α diff --git a/Mathlib/GroupTheory/Perm/Cycle/Factors.lean b/Mathlib/GroupTheory/Perm/Cycle/Factors.lean index 96cf6d1f99a917..2465fcdb3c0f33 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Factors.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Factors.lean @@ -484,6 +484,7 @@ def cycleFactorsFinset : Finset (Perm α) := list_cycles_perm_list_cycles (hl'.left.symm ▸ hl.left) hl.right.left hl'.right.left hl.right.right hl'.right.right +set_option backward.isDefEq.respectTransparency false in open scoped List in theorem cycleFactorsFinset_eq_list_toFinset {σ : Perm α} {l : List (Perm α)} (hn : l.Nodup) : σ.cycleFactorsFinset = l.toFinset ↔ @@ -508,6 +509,7 @@ theorem cycleFactorsFinset_eq_list_toFinset {σ : Perm α} {l : List (Perm α)} refine list_cycles_perm_list_cycles ?_ hc' hc hd' hd rw [hp, hp'] +set_option backward.isDefEq.respectTransparency false in theorem cycleFactorsFinset_eq_finset {σ : Perm α} {s : Finset (Perm α)} : σ.cycleFactorsFinset = s ↔ (∀ f : Perm α, f ∈ s → f.IsCycle) ∧ @@ -626,6 +628,7 @@ theorem mem_support_iff_mem_support_of_mem_cycleFactorsFinset {g : Equiv.Perm α · rintro ⟨c, hc, hx⟩ exact mem_cycleFactorsFinset_support_le hc hx +set_option backward.isDefEq.respectTransparency.types false in theorem cycleFactorsFinset_eq_empty_iff {f : Perm α} : cycleFactorsFinset f = ∅ ↔ f = 1 := by simpa [cycleFactorsFinset_eq_finset] using eq_comm diff --git a/Mathlib/GroupTheory/Perm/Cycle/Type.lean b/Mathlib/GroupTheory/Perm/Cycle/Type.lean index c2311e5ec621c3..39544c1b3e6114 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Type.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Type.lean @@ -66,6 +66,7 @@ theorem cycleType_eq' {σ : Perm α} (s : Finset (Perm α)) (h1 : ∀ f : Perm rw [cycleFactorsFinset_eq_finset] exact ⟨h1, h2, h0⟩ +set_option backward.isDefEq.respectTransparency false in theorem cycleType_eq {σ : Perm α} (l : List (Perm α)) (h0 : l.prod = σ) (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) : σ.cycleType = l.map (Finset.card ∘ support) := by @@ -76,6 +77,7 @@ theorem cycleType_eq {σ : Perm α} (l : List (Perm α)) (h0 : l.prod = σ) · simpa [hl] using h2 · simp [hl, h0] +set_option backward.isDefEq.respectTransparency false in theorem CycleType.count_def {σ : Perm α} (n : ℕ) : σ.cycleType.count n = Fintype.card {c : σ.cycleFactorsFinset // #(c : Perm α).support = n } := by @@ -368,6 +370,7 @@ theorem card_compl_support_modEq [DecidableEq α] {p n : ℕ} [hp : Fact p.Prime exact dvd_pow_self _ fun h => (one_lt_of_mem_cycleType hk).ne <| by rw [h, pow_zero] · exact Finset.card_le_univ _ +set_option backward.isDefEq.respectTransparency false in open Function in /-- The number of fixed points of a `p ^ n`-th root of the identity function over a finite set and the set's cardinality have the same residue modulo `p`, where `p` is a prime. -/ diff --git a/Mathlib/GroupTheory/Perm/Fin.lean b/Mathlib/GroupTheory/Perm/Fin.lean index e13b1af86ec985..229799f3cb3b4a 100644 --- a/Mathlib/GroupTheory/Perm/Fin.lean +++ b/Mathlib/GroupTheory/Perm/Fin.lean @@ -218,6 +218,7 @@ theorem cycleRange_mk_zero (h : 0 < n) : cycleRange ⟨0, h⟩ = 1 := have : NeZero n := .of_pos h cycleRange_zero n +set_option backward.isDefEq.respectTransparency false in @[simp] theorem sign_cycleRange (i : Fin n) : Perm.sign (cycleRange i) = (-1) ^ (i : ℕ) := by simp [cycleRange] @@ -288,6 +289,7 @@ theorem isCycle_cycleRange [NeZero n] (h0 : i ≠ 0) : IsCycle (cycleRange i) := · exact (h0 rfl).elim exact isCycle_finRotate.extendDomain _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem cycleType_cycleRange [NeZero n] (h0 : i ≠ 0) : cycleType (cycleRange i) = {(i + 1 : ℕ)} := by diff --git a/Mathlib/GroupTheory/Perm/Finite.lean b/Mathlib/GroupTheory/Perm/Finite.lean index 929c5833c09478..9fc620ab6a07f9 100644 --- a/Mathlib/GroupTheory/Perm/Finite.lean +++ b/Mathlib/GroupTheory/Perm/Finite.lean @@ -171,6 +171,7 @@ theorem Disjoint.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Su · left rw [extendDomain_apply_not_subtype _ _ pb] +set_option backward.isDefEq.respectTransparency false in theorem Disjoint.isConj_mul [Finite α] {σ τ π ρ : Perm α} (hc1 : IsConj σ π) (hc2 : IsConj τ ρ) (hd1 : Disjoint σ τ) (hd2 : Disjoint π ρ) : IsConj (σ * τ) (π * ρ) := by classical diff --git a/Mathlib/GroupTheory/Perm/Sign.lean b/Mathlib/GroupTheory/Perm/Sign.lean index 8de73eddc5837f..8141fcb1b167af 100644 --- a/Mathlib/GroupTheory/Perm/Sign.lean +++ b/Mathlib/GroupTheory/Perm/Sign.lean @@ -44,7 +44,7 @@ namespace Equiv.Perm We use this to partition permutations in `Matrix.det_zero_of_row_eq`, such that each partition sums up to `0`. -/ -@[implicit_reducible] +@[instance_reducible] def modSwap (i j : α) : Setoid (Perm α) := ⟨fun σ τ => σ = τ ∨ σ = swap i j * τ, fun σ => Or.inl (refl σ), fun {σ τ} h => Or.casesOn h (fun h => Or.inl h.symm) fun h => Or.inr (by rw [h, swap_mul_self_mul]), @@ -274,7 +274,7 @@ theorem signAux_swap : ∀ {n : ℕ} {x y : Fin n} (_hxy : x ≠ y), signAux (sw | 0, x, y => by intro; exact Fin.elim0 x | 1, x, y => by dsimp [signAux, swap, swapCore] - simp only [eq_iff_true_of_subsingleton, not_true, ite_true, le_refl, prod_const, + simp only [eq_iff_true_of_subsingleton, not_true, IsEmpty.forall_iff] | n + 2, x, y => fun hxy => by have h2n : 2 ≤ n + 2 := by exact le_add_self @@ -288,6 +288,7 @@ def signAux2 : List α → Perm α → ℤˣ | [], _ => 1 | x::l, f => if x = f x then signAux2 l f else -signAux2 l (swap x (f x) * f) +set_option backward.isDefEq.respectTransparency false in theorem signAux_eq_signAux2 {n : ℕ} : ∀ (l : List α) (f : Perm α) (e : α ≃ Fin n) (_h : ∀ x, f x ≠ x → x ∈ l), signAux ((e.symm.trans f).trans e) = signAux2 l f diff --git a/Mathlib/GroupTheory/Perm/Support.lean b/Mathlib/GroupTheory/Perm/Support.lean index 0f670d4667e4ac..8176a5469193a5 100644 --- a/Mathlib/GroupTheory/Perm/Support.lean +++ b/Mathlib/GroupTheory/Perm/Support.lean @@ -575,6 +575,7 @@ theorem card_support_swap_mul {f : Perm α} {x : α} (hx : f x ≠ x) : ⟨fun _ hz => (mem_support_swap_mul_imp_mem_support_ne hz).left, fun h => absurd (h (mem_support.2 hx)) (mt mem_support.1 (by simp))⟩ +set_option backward.isDefEq.respectTransparency false in theorem card_support_swap {x y : α} (hxy : x ≠ y) : #(swap x y).support = 2 := show #(swap x y).support = #⟨x ::ₘ y ::ₘ 0, by simp [hxy]⟩ from congr_arg card <| by simp [support_swap hxy, *, Finset.ext_iff] diff --git a/Mathlib/GroupTheory/PushoutI.lean b/Mathlib/GroupTheory/PushoutI.lean index 31d04e07702548..b77f2136bd459e 100644 --- a/Mathlib/GroupTheory/PushoutI.lean +++ b/Mathlib/GroupTheory/PushoutI.lean @@ -330,6 +330,7 @@ theorem prod_cons {i} (g : G i) (w : NormalWord d) (hmw : w.fstIdx ≠ some i) variable [DecidableEq ι] [∀ i, DecidableEq (G i)] +set_option backward.isDefEq.respectTransparency.types false in /-- Given a word in `CoprodI`, if every letter is in the transversal and when we multiply by an element of the base group it still has this property, then the element of the base group we multiplied by was one. -/ @@ -453,6 +454,7 @@ theorem summand_smul_def' {i : ι} (g : G i) (w : NormalWord d) : { equivPair i w with head := g * (equivPair i w).head } := rfl +set_option backward.isDefEq.respectTransparency false in noncomputable instance mulAction : MulAction (PushoutI φ) (NormalWord d) := MulAction.ofEndHom <| lift @@ -517,6 +519,7 @@ noncomputable def consRecOn {motive : NormalWord d → Sort _} (w : NormalWord d (h3 _ _ List.mem_cons_self)] +set_option backward.isDefEq.respectTransparency false in theorem cons_eq_smul {i : ι} (g : G i) (w : NormalWord d) (hmw : w.fstIdx ≠ some i) (hgr : g ∉ (φ i).range) : cons g w hmw hgr = of (φ := φ) i g • w := by diff --git a/Mathlib/GroupTheory/QuotientGroup/Basic.lean b/Mathlib/GroupTheory/QuotientGroup/Basic.lean index 43921ef5032ee4..f33b0ae1de988c 100644 --- a/Mathlib/GroupTheory/QuotientGroup/Basic.lean +++ b/Mathlib/GroupTheory/QuotientGroup/Basic.lean @@ -319,6 +319,7 @@ instance map_normal : (M.map (QuotientGroup.mk' N)).Normal := variable (h : N ≤ M) +set_option backward.isDefEq.respectTransparency false in /-- The map from the third isomorphism theorem for groups: `(G / N) / (M / N) → G / M`. -/ @[to_additive /-- The map from the third isomorphism theorem for additive groups: `(A / N) / (M / N) → A / M`. -/] @@ -339,6 +340,7 @@ theorem quotientQuotientEquivQuotientAux_mk_mk (x : G) : quotientQuotientEquivQuotientAux N M h (x : G ⧸ N) = x := QuotientGroup.lift_mk' (M.map (mk' N)) _ x +set_option backward.isDefEq.respectTransparency false in /-- **Noether's third isomorphism theorem** for groups: `(G / N) / (M / N) ≃* G / M`. -/ @[to_additive /-- **Noether's third isomorphism theorem** for additive groups: `(A / N) / (M / N) ≃+ A / M`. -/] diff --git a/Mathlib/GroupTheory/QuotientGroup/Finite.lean b/Mathlib/GroupTheory/QuotientGroup/Finite.lean index 0b1c080b3cbfd0..2289fe7e0bcb28 100644 --- a/Mathlib/GroupTheory/QuotientGroup/Finite.lean +++ b/Mathlib/GroupTheory/QuotientGroup/Finite.lean @@ -27,7 +27,7 @@ namespace Group open scoped Classical in /-- If `F` and `H` are finite such that `ker(G →* H) ≤ im(F →* G)`, then `G` is finite. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If `F` and `H` are finite such that `ker(G →+ H) ≤ im(F →+ G)`, then `G` is finite. -/] noncomputable def fintypeOfKerLeRange (h : g.ker ≤ f.range) : Fintype G := @Fintype.ofEquiv _ _ @@ -36,20 +36,20 @@ noncomputable def fintypeOfKerLeRange (h : g.ker ≤ f.range) : Fintype G := groupEquivQuotientProdSubgroup.symm /-- If `F` and `H` are finite such that `ker(G →* H) = im(F →* G)`, then `G` is finite. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If `F` and `H` are finite such that `ker(G →+ H) = im(F →+ G)`, then `G` is finite. -/] noncomputable def fintypeOfKerEqRange (h : g.ker = f.range) : Fintype G := fintypeOfKerLeRange _ _ h.le /-- If `ker(G →* H)` and `H` are finite, then `G` is finite. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If `ker(G →+ H)` and `H` are finite, then `G` is finite. -/] noncomputable def fintypeOfKerOfCodom [Fintype g.ker] : Fintype G := fintypeOfKerLeRange ((topEquiv : _ ≃* G).toMonoidHom.comp <| inclusion le_top) g fun x hx => ⟨⟨x, hx⟩, rfl⟩ /-- If `F` and `coker(F →* G)` are finite, then `G` is finite. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- If `F` and `coker(F →+ G)` are finite, then `G` is finite. -/] noncomputable def fintypeOfDomOfCoker [Normal f.range] [Fintype <| G ⧸ f.range] : Fintype G := fintypeOfKerLeRange _ (mk' f.range) fun x => (eq_one_iff x).mp diff --git a/Mathlib/GroupTheory/SpecificGroups/Alternating/Simple.lean b/Mathlib/GroupTheory/SpecificGroups/Alternating/Simple.lean index 47abda9765ffbc..1970ffeef55f6f 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Alternating/Simple.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Alternating/Simple.lean @@ -67,6 +67,7 @@ namespace Equiv.Perm variable {α : Type*} [Finite α] [DecidableEq α] +set_option backward.isDefEq.respectTransparency.types false in /-- The Iwasawa structure of `Perm α` acting on `Set.powersetCard α 2`. -/ def iwasawaStructure_two [∀ s : Set α, DecidablePred fun x ↦ x ∈ s] : IwasawaStructure (Perm α) (Set.powersetCard α 2) where diff --git a/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean b/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean index a9638eae66bc91..f273f2f2fd3fa1 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Cyclic.lean @@ -197,7 +197,7 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic G'] (f : G →* G') (hf _ = b * a := by group /-- A group is commutative if the quotient by the center is cyclic. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- A group is commutative if the quotient by the center is cyclic. -/] def commGroupOfCyclicCenterQuotient [IsCyclic G'] (f : G →* G') (hf : f.ker ≤ center G) : CommGroup G where @@ -293,6 +293,7 @@ lemma LinearOrderedAddCommGroup.isAddCyclic_iff_nonempty_equiv_int {A : Type*} map_add' := add_zsmul g map_le_map_iff' := zsmul_le_zsmul_iff_left hg' }⟩ +set_option backward.isDefEq.respectTransparency false in /-- A linearly-ordered abelian group is cyclic iff it is isomorphic to `Multiplicative ℤ` as an ordered monoid. -/ lemma LinearOrderedCommGroup.isCyclic_iff_nonempty_equiv_int {G : Type*} diff --git a/Mathlib/GroupTheory/SpecificGroups/Cyclic/Basic.lean b/Mathlib/GroupTheory/SpecificGroups/Cyclic/Basic.lean index cfd567da7754a6..56c9bcae07d07b 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Cyclic/Basic.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Cyclic/Basic.lean @@ -85,7 +85,7 @@ alias IsCyclic.commutative := IsCyclic.isMulCommutative open scoped IsMulCommutative in /-- A cyclic group is always commutative. This is not an `instance` because often we have a better proof of `CommGroup`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- A cyclic group is always commutative. This is not an `instance` because often we have a better proof of `AddCommGroup`. -/] def IsCyclic.commGroup [Group α] [IsCyclic α] : CommGroup α := diff --git a/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean b/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean index abea98a604b6d9..eaf024520c0f1c 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Dihedral.lean @@ -250,6 +250,7 @@ instance : IsKleinFour (DihedralGroup 2) where card_four := DihedralGroup.nat_card exponent_two := DihedralGroup.exponent +set_option backward.isDefEq.respectTransparency false in /-- If n is odd, then the Dihedral group of order $2n$ has $n(n+3)$ pairs (represented as $n + n + n + n*n$) of commuting elements. -/ @[simps] diff --git a/Mathlib/GroupTheory/Subgroup/Center.lean b/Mathlib/GroupTheory/Subgroup/Center.lean index 4b4b52e6db3a3d..03e7a3a23f424c 100644 --- a/Mathlib/GroupTheory/Subgroup/Center.lean +++ b/Mathlib/GroupTheory/Subgroup/Center.lean @@ -129,6 +129,7 @@ end IsConj namespace ConjClasses +set_option backward.isDefEq.respectTransparency false in theorem mk_bijOn (G : Type*) [Group G] : Set.BijOn ConjClasses.mk (↑(Subgroup.center G)) (noncenter G)ᶜ := by refine ⟨fun g hg ↦ ?_, fun x hx y _ H ↦ ?_, ?_⟩ diff --git a/Mathlib/GroupTheory/Submonoid/Inverses.lean b/Mathlib/GroupTheory/Submonoid/Inverses.lean index 847d5ddb31f104..c6a55c01c70355 100644 --- a/Mathlib/GroupTheory/Submonoid/Inverses.lean +++ b/Mathlib/GroupTheory/Submonoid/Inverses.lean @@ -139,6 +139,7 @@ noncomputable def fromCommLeftInv : S.leftInv →* S where variable (hS : S ≤ IsUnit.submonoid M) +set_option backward.isDefEq.respectTransparency false in /-- The submonoid of pointwise inverse of `S` is `MulEquiv` to `S`. -/ @[to_additive (attr := simps apply) /-- The additive submonoid of pointwise additive inverse of `S` is `AddEquiv` to `S`. -/] diff --git a/Mathlib/GroupTheory/Sylow.lean b/Mathlib/GroupTheory/Sylow.lean index ebef395a7a17db..7c55b2677ef494 100644 --- a/Mathlib/GroupTheory/Sylow.lean +++ b/Mathlib/GroupTheory/Sylow.lean @@ -475,6 +475,7 @@ theorem mapSurjective_surjective (p : ℕ) [Fact p.Prime] : end mapSurjective +set_option backward.isDefEq.respectTransparency false in /-- **Frattini's Argument**: If `N` is a normal subgroup of `G`, and if `P` is a Sylow `p`-subgroup of `N`, then `N_G(P) ⊔ N = G`. -/ theorem normalizer_sup_eq_top {p : ℕ} [Fact p.Prime] {N : Subgroup G} [N.Normal] @@ -718,7 +719,7 @@ theorem card_eq_multiplicity [Finite G] {p : ℕ} [hp : Fact p.Prime] (P : Sylow exact P.1.card_subgroup_dvd_card /-- If `G` has a normal Sylow `p`-subgroup, then it is the only Sylow `p`-subgroup. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def unique_of_normal {p : ℕ} [Fact p.Prime] [Finite (Sylow p G)] (P : Sylow p G) (h : P.Normal) : Unique (Sylow p G) := by refine { uniq := fun Q ↦ ?_ } diff --git a/Mathlib/GroupTheory/Torsion.lean b/Mathlib/GroupTheory/Torsion.lean index 123b45aeb5b047..ac9656b6ee4327 100644 --- a/Mathlib/GroupTheory/Torsion.lean +++ b/Mathlib/GroupTheory/Torsion.lean @@ -194,6 +194,7 @@ lemma torsion_prod : torsion (G × H) = (torsion G).prod (torsion H) := by variable {G} +set_option backward.isDefEq.respectTransparency false in /-- Torsion submonoids are torsion. -/ @[to_additive /-- Additive torsion submonoids are additively torsion. -/] theorem torsion.isTorsion : IsTorsion <| torsion G := fun ⟨x, n, npos, hn⟩ ↦ diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean index 05e9a6328155cd..208b21ec9351ca 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean @@ -136,6 +136,7 @@ theorem toEquiv_inj {e e' : P₁ ≃ᵃ[k] P₂} : e.toEquiv = e'.toEquiv ↔ e theorem coe_mk (e : P₁ ≃ P₂) (e' : V₁ ≃ₗ[k] V₂) (h) : ((⟨e, e', h⟩ : P₁ ≃ᵃ[k] P₂) : P₁ → P₂) = e := rfl +set_option backward.isDefEq.respectTransparency false in /-- Construct an affine equivalence by verifying the relation between the map and its linear part at one base point. Namely, this function takes a map `e : P₁ → P₂`, a linear equivalence `e' : V₁ ≃ₗ[k] V₂`, and a point `p` such that for any other point `p'` we have @@ -309,6 +310,7 @@ theorem self_trans_symm (e : P₁ ≃ᵃ[k] P₂) : e.trans e.symm = refl k P₁ theorem symm_trans_self (e : P₁ ≃ᵃ[k] P₂) : e.symm.trans e = refl k P₂ := ext e.apply_symm_apply +set_option backward.isDefEq.respectTransparency false in @[simp] theorem apply_lineMap (e : P₁ ≃ᵃ[k] P₂) (a b : P₁) (c : k) : e (AffineMap.lineMap a b c) = AffineMap.lineMap (e a) (e b) c := @@ -648,6 +650,7 @@ section arrowCongrₗ variable (e₁ : P₁ ≃ᵃ[R] P₂) (e₂ : V₃ ≃ₗ[R] V₄) +set_option backward.isDefEq.respectTransparency false in /-- An affine isomorphism between the domains and a linear isomorphism between the codomains of two spaces of affine maps give a linear isomorphism between the two function spaces. @@ -742,18 +745,22 @@ namespace AffineMap open AffineEquiv +set_option backward.isDefEq.respectTransparency false in theorem lineMap_vadd (v v' : V₁) (p : P₁) (c : k) : lineMap v v' c +ᵥ p = lineMap (v +ᵥ p) (v' +ᵥ p) c := (vaddConst k p).apply_lineMap v v' c +set_option backward.isDefEq.respectTransparency false in theorem lineMap_vsub (p₁ p₂ p₃ : P₁) (c : k) : lineMap p₁ p₂ c -ᵥ p₃ = lineMap (p₁ -ᵥ p₃) (p₂ -ᵥ p₃) c := (vaddConst k p₃).symm.apply_lineMap p₁ p₂ c +set_option backward.isDefEq.respectTransparency false in theorem vsub_lineMap (p₁ p₂ p₃ : P₁) (c : k) : p₁ -ᵥ lineMap p₂ p₃ c = lineMap (p₁ -ᵥ p₂) (p₁ -ᵥ p₃) c := (constVSub k p₁).apply_lineMap p₂ p₃ c +set_option backward.isDefEq.respectTransparency false in theorem vadd_lineMap (v : V₁) (p₁ p₂ : P₁) (c : k) : v +ᵥ lineMap p₁ p₂ c = lineMap (v +ᵥ p₁) (v +ᵥ p₂) c := (constVAdd k P₁ v).apply_lineMap p₁ p₂ c diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean index 1fc8959ff57ebb..6bd525f5495324 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean @@ -482,24 +482,31 @@ theorem prodMap_apply (f : P1 →ᵃ[k] P2) (g : P3 →ᵃ[k] P4) (x) : f.prodMa def lineMap (p₀ p₁ : P1) : k →ᵃ[k] P1 := ((LinearMap.id : k →ₗ[k] k).smulRight (p₁ -ᵥ p₀)).toAffineMap +ᵥ const k k p₀ +set_option backward.isDefEq.respectTransparency false in theorem coe_lineMap (p₀ p₁ : P1) : (lineMap p₀ p₁ : k → P1) = fun c => c • (p₁ -ᵥ p₀) +ᵥ p₀ := rfl +set_option backward.isDefEq.respectTransparency false in theorem lineMap_apply (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ c = c • (p₁ -ᵥ p₀) +ᵥ p₀ := rfl +set_option backward.isDefEq.respectTransparency false in theorem lineMap_apply_module' (p₀ p₁ : V1) (c : k) : lineMap p₀ p₁ c = c • (p₁ - p₀) + p₀ := rfl +set_option backward.isDefEq.respectTransparency false in theorem lineMap_apply_module (p₀ p₁ : V1) (c : k) : lineMap p₀ p₁ c = (1 - c) • p₀ + c • p₁ := by simp [lineMap_apply_module', smul_sub, sub_smul]; abel +set_option backward.isDefEq.respectTransparency false in theorem lineMap_apply_ring' (a b c : k) : lineMap a b c = c * (b - a) + a := rfl +set_option backward.isDefEq.respectTransparency false in theorem lineMap_apply_ring (a b c : k) : lineMap a b c = (1 - c) * a + c * b := lineMap_apply_module a b c +set_option backward.isDefEq.respectTransparency false in theorem lineMap_vadd_apply (p : P1) (v : V1) (c : k) : lineMap p (v +ᵥ p) c = c • v +ᵥ p := by rw [lineMap_apply, vadd_vsub] @@ -508,6 +515,7 @@ theorem lineMap_linear (p₀ p₁ : P1) : (lineMap p₀ p₁ : k →ᵃ[k] P1).linear = LinearMap.id.smulRight (p₁ -ᵥ p₀) := add_zero _ +set_option backward.isDefEq.respectTransparency false in theorem lineMap_same_apply (p : P1) (c : k) : lineMap p p c = p := by simp [lineMap_apply] @@ -515,35 +523,42 @@ theorem lineMap_same_apply (p : P1) (c : k) : lineMap p p c = p := by theorem lineMap_same (p : P1) : lineMap p p = const k k p := ext <| lineMap_same_apply p +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_apply_zero (p₀ p₁ : P1) : lineMap p₀ p₁ (0 : k) = p₀ := by simp [lineMap_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_apply_one (p₀ p₁ : P1) : lineMap p₀ p₁ (1 : k) = p₁ := by simp [lineMap_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_eq_lineMap_iff [IsDomain k] [IsTorsionFree k V1] {p₀ p₁ : P1} {c₁ c₂ : k} : lineMap p₀ p₁ c₁ = lineMap p₀ p₁ c₂ ↔ p₀ = p₁ ∨ c₁ = c₂ := by rw [lineMap_apply, lineMap_apply, ← @vsub_eq_zero_iff_eq V1, vadd_vsub_vadd_cancel_right, ← sub_smul, smul_eq_zero, sub_eq_zero, vsub_eq_zero_iff_eq, or_comm, eq_comm] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_eq_left_iff [IsDomain k] [IsTorsionFree k V1] {p₀ p₁ : P1} {c : k} : lineMap p₀ p₁ c = p₀ ↔ p₀ = p₁ ∨ c = 0 := by rw [← @lineMap_eq_lineMap_iff k V1, lineMap_apply_zero] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_eq_right_iff [IsDomain k] [IsTorsionFree k V1] {p₀ p₁ : P1} {c : k} : lineMap p₀ p₁ c = p₁ ↔ p₀ = p₁ ∨ c = 1 := by rw [← @lineMap_eq_lineMap_iff k V1, lineMap_apply_one] +set_option backward.isDefEq.respectTransparency false in variable (k) in theorem lineMap_injective [IsDomain k] [IsTorsionFree k V1] {p₀ p₁ : P1} (h : p₀ ≠ p₁) : Function.Injective (lineMap p₀ p₁ : k → P1) := fun _c₁ _c₂ hc => (lineMap_eq_lineMap_iff.mp hc).resolve_left h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem apply_lineMap (f : P1 →ᵃ[k] P2) (p₀ p₁ : P1) (c : k) : f (lineMap p₀ p₁ c) = lineMap (f p₀) (f p₁) c := by @@ -554,10 +569,12 @@ theorem comp_lineMap (f : P1 →ᵃ[k] P2) (p₀ p₁ : P1) : f.comp (lineMap p₀ p₁) = lineMap (f p₀) (f p₁) := ext <| f.apply_lineMap p₀ p₁ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem fst_lineMap (p₀ p₁ : P1 × P2) (c : k) : (lineMap p₀ p₁ c).1 = lineMap p₀.1 p₁.1 c := fst.apply_lineMap p₀ p₁ c +set_option backward.isDefEq.respectTransparency false in @[simp] theorem snd_lineMap (p₀ p₁ : P1 × P2) (c : k) : (lineMap p₀ p₁ c).2 = lineMap p₀.2 p₁.2 c := snd.apply_lineMap p₀ p₁ c @@ -566,39 +583,48 @@ theorem lineMap_symm (p₀ p₁ : P1) : lineMap p₀ p₁ = (lineMap p₁ p₀).comp (lineMap (1 : k) (0 : k)) := by simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_apply_one_sub (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ (1 - c) = lineMap p₁ p₀ c := by rw [lineMap_symm p₀, comp_apply] congr simp [lineMap_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_vsub_left (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ c -ᵥ p₀ = c • (p₁ -ᵥ p₀) := vadd_vsub _ _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem left_vsub_lineMap (p₀ p₁ : P1) (c : k) : p₀ -ᵥ lineMap p₀ p₁ c = c • (p₀ -ᵥ p₁) := by rw [← neg_vsub_eq_vsub_rev, lineMap_vsub_left, ← smul_neg, neg_vsub_eq_vsub_rev] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lineMap_vsub_right (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ c -ᵥ p₁ = (1 - c) • (p₀ -ᵥ p₁) := by rw [← lineMap_apply_one_sub, lineMap_vsub_left] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem right_vsub_lineMap (p₀ p₁ : P1) (c : k) : p₁ -ᵥ lineMap p₀ p₁ c = (1 - c) • (p₁ -ᵥ p₀) := by rw [← lineMap_apply_one_sub, left_vsub_lineMap] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_vadd_lineMap (v₁ v₂ : V1) (p₁ p₂ : P1) (c : k) : lineMap v₁ v₂ c +ᵥ lineMap p₁ p₂ c = lineMap (v₁ +ᵥ p₁) (v₂ +ᵥ p₂) c := ((fst : V1 × P1 →ᵃ[k] V1) +ᵥ (snd : V1 × P1 →ᵃ[k] P1)).apply_lineMap (v₁, p₁) (v₂, p₂) c +set_option backward.isDefEq.respectTransparency false in theorem lineMap_vsub_lineMap (p₁ p₂ p₃ p₄ : P1) (c : k) : lineMap p₁ p₂ c -ᵥ lineMap p₃ p₄ c = lineMap (p₁ -ᵥ p₃) (p₂ -ᵥ p₄) c := ((fst : P1 × P1 →ᵃ[k] P1) -ᵥ (snd : P1 × P1 →ᵃ[k] P1)).apply_lineMap (_, _) (_, _) c +set_option backward.isDefEq.respectTransparency false in @[simp] lemma lineMap_lineMap_right (p₀ p₁ : P1) (c d : k) : lineMap p₀ (lineMap p₀ p₁ c) d = lineMap p₀ p₁ (d * c) := by simp [lineMap_apply, mul_smul] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma lineMap_lineMap_left (p₀ p₁ : P1) (c d : k) : lineMap (lineMap p₀ p₁ c) p₁ d = lineMap p₀ p₁ (1 - (1 - d) * (1 - c)) := by simp_rw [lineMap_apply_one_sub, ← lineMap_apply_one_sub p₁, lineMap_lineMap_right] @@ -664,6 +690,7 @@ theorem proj_apply (i : ι) (f : ∀ i, P i) : @proj k _ ι V P _ _ _ i f = f i theorem proj_linear (i : ι) : (@proj k _ ι V P _ _ _ i).linear = @LinearMap.proj k ι _ V _ _ i := rfl +set_option backward.isDefEq.respectTransparency false in theorem pi_lineMap_apply (f g : ∀ i, P i) (c : k) (i : ι) : lineMap f g c i = lineMap (f i) (g i) c := (proj i : (∀ i, P i) →ᵃ[k] P i).apply_lineMap f g c @@ -725,6 +752,7 @@ def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) w end Module +set_option backward.isDefEq.respectTransparency false in /-- Interpolating between affine maps with `lineMap` commutes with evaluation. -/ @[simp] lemma lineMap_apply' [SMulCommClass k k V2] (f g : P1 →ᵃ[k] P2) (c : k) @@ -835,6 +863,7 @@ theorem homothety_apply (c : P1) (r : k) (p : P1) : homothety c r p = r • (p - theorem homothety_linear (c : P1) (r : k) : (homothety c r).linear = r • LinearMap.id := by simp [homothety] +set_option backward.isDefEq.respectTransparency false in theorem homothety_eq_lineMap (c : P1) (r : k) (p : P1) : homothety c r p = lineMap c p r := rfl diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean index 57492f70f5b998..37ef7651efc696 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Basic.lean @@ -113,6 +113,7 @@ theorem coe_subtype (s : AffineSubspace k P) [Nonempty s] : (s.subtype : s → P end AffineSubspace +set_option backward.isDefEq.respectTransparency false in theorem AffineMap.lineMap_mem {k V P : Type*} [Ring k] [AddCommGroup V] [Module k V] [AddTorsor V P] {Q : AffineSubspace k P} {p₀ p₁ : P} (c : k) (h₀ : p₀ ∈ Q) (h₁ : p₁ ∈ Q) : AffineMap.lineMap p₀ p₁ c ∈ Q := by @@ -367,11 +368,13 @@ theorem mem_vectorSpan_pair_rev {p₁ p₂ : P} {v : V} : rw [vectorSpan_pair_rev, Submodule.mem_span_singleton] +set_option backward.isDefEq.respectTransparency false in /-- A combination of two points expressed with `lineMap` lies in their affine span. -/ theorem AffineMap.lineMap_mem_affineSpan_pair (r : k) (p₁ p₂ : P) : AffineMap.lineMap p₁ p₂ r ∈ line[k, p₁, p₂] := AffineMap.lineMap_mem _ (left_mem_affineSpan_pair _ _ _) (right_mem_affineSpan_pair _ _ _) +set_option backward.isDefEq.respectTransparency false in /-- A combination of two points expressed with `lineMap` (with the two points reversed) lies in their affine span. -/ theorem AffineMap.lineMap_rev_mem_affineSpan_pair (r : k) (p₁ p₂ : P) : @@ -404,6 +407,7 @@ theorem vadd_right_mem_affineSpan_pair {p₁ p₂ : P} {v : V} : rw [vadd_mem_iff_mem_direction _ (right_mem_affineSpan_pair _ _ _), direction_affineSpan, mem_vectorSpan_pair] +set_option backward.isDefEq.respectTransparency false in lemma mem_affineSpan_pair_iff_exists_lineMap_eq {p p₁ p₂ : P} : p ∈ line[k, p₁, p₂] ↔ ∃ r : k, AffineMap.lineMap p₁ p₂ r = p := by constructor @@ -415,6 +419,7 @@ lemma mem_affineSpan_pair_iff_exists_lineMap_eq {p p₁ p₂ : P} : · rintro ⟨r, rfl⟩ exact AffineMap.lineMap_mem_affineSpan_pair _ _ _ +set_option backward.isDefEq.respectTransparency false in lemma mem_affineSpan_pair_iff_exists_lineMap_rev_eq {p p₁ p₂ : P} : p ∈ line[k, p₁, p₂] ↔ ∃ r : k, AffineMap.lineMap p₂ p₁ r = p := by rw [Set.pair_comm, mem_affineSpan_pair_iff_exists_lineMap_eq] diff --git a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Shift.lean b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Shift.lean index 37edd698fd6839..b8fcc640b73928 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Shift.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/AffineSubspace/Shift.lean @@ -59,6 +59,7 @@ theorem direction_shift (s : AffineSubspace k P) (c : P) (r : k) : have h : Nonempty s := by simpa using! h simp [shift, h] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem shift_top (c : P) (r : k) : shift ⊤ c r = ⊤ := by simp [shift, AffineEquiv.surjective] diff --git a/Mathlib/LinearAlgebra/AffineSpace/Ceva.lean b/Mathlib/LinearAlgebra/AffineSpace/Ceva.lean index 535f636e0a744e..02187a0cbcaa4a 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Ceva.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Ceva.lean @@ -29,6 +29,7 @@ namespace AffineIndependent variable [Ring k] [AddCommGroup V] [Module k V] [AffineSpace V P] +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary lemma for `exists_affineCombination_eq_smul_eq`. -/ private lemma exists_affineCombination_eq_smul_eq_aux {p : ι → P} (hp : AffineIndependent k p) {s : Set ι} (hs : s.Nonempty) {fs : s → Finset ι} (hfs : ∀ i, (i : ι) ∈ fs i) {w : s → ι → k} @@ -131,6 +132,7 @@ section CommRing variable [CommRing k] [NoZeroDivisors k] [AddCommGroup V] [Module k V] [AffineSpace V P] +set_option backward.isDefEq.respectTransparency false in /-- **Ceva's theorem** for a triangle, expressed in terms of multiplying weights. -/ lemma prod_eq_prod_one_sub_of_mem_line_point_lineMap {t : Triangle k P} {r : Fin 3 → k} {p' : P} (hp' : ∀ i : Fin 3, p' ∈ @@ -200,6 +202,7 @@ section Field variable [Field k] [AddCommGroup V] [Module k V] [AffineSpace V P] +set_option backward.isDefEq.respectTransparency false in /-- **Ceva's theorem** for a triangle, expressed using division. -/ lemma prod_div_one_sub_eq_one_of_mem_line_point_lineMap {t : Triangle k P} {r : Fin 3 → k} (hr0 : ∀ i, r i ≠ 0) {p' : P} (hp' : ∀ i : Fin 3, p' ∈ diff --git a/Mathlib/LinearAlgebra/AffineSpace/Combination.lean b/Mathlib/LinearAlgebra/AffineSpace/Combination.lean index 78843dcbb221d9..03b34039190bd7 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Combination.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Combination.lean @@ -580,6 +580,7 @@ theorem map_affineCombination {V₂ P₂ : Type*} [AddCommGroup V₂] [Module k simp only [weightedVSubOfPoint_apply, RingHom.id_apply, AffineMap.map_vadd, map_smulₛₗ, AffineMap.linearMap_vsub, map_sum, Function.comp_apply] +set_option backward.isDefEq.respectTransparency false in /-- The value of `affineCombination`, where the given points take only two values. -/ lemma affineCombination_apply_eq_lineMap_sum [DecidableEq ι] (w : ι → k) (p : ι → P) (p₁ p₂ : P) (s' : Finset ι) (h : ∑ i ∈ s, w i = 1) (hp₂ : ∀ i ∈ s ∩ s', p i = p₂) @@ -593,6 +594,7 @@ lemma affineCombination_apply_eq_lineMap_sum [DecidableEq ι] (w : ι → k) (p simp [hp₁ i hi] · exact (hp₂ i hi).symm +set_option backward.isDefEq.respectTransparency false in /-- Applying `AffineMap.lineMap` on two `Finset.affineCombination` over the same set of points is equivalent to applying `AffineMap.lineMap` to the weights. -/ theorem lineMap_affineCombination (w₁ : ι → k) (w₂ : ι → k) (r : k) (p : ι → P) : @@ -709,6 +711,7 @@ theorem weightedVSub_weightedVSubVSubWeights [DecidableEq ι] (p : ι → P) {i variable {k} +set_option backward.isDefEq.respectTransparency false in /-- An affine combination with `affineCombinationLineMapWeights` gives the result of `line_map`. -/ @[simp] @@ -720,6 +723,7 @@ theorem affineCombination_affineCombinationLineMapWeights [DecidableEq ι] (p : weightedVSub_const_smul, s.affineCombination_piSingle k p hi, s.weightedVSub_weightedVSubVSubWeights k p hj hi, AffineMap.lineMap_apply] +set_option backward.isDefEq.respectTransparency false in /-- Applying `AffineMap.homothety` on `Finset.affineCombination` towards one of the weighted points is equivalent to moving the weights towards `Finset.affineCombinationSingleWeights`. -/ -- Redeclaring all variables because `AffineMap.homothety` requires `[CommRing k]` @@ -953,6 +957,7 @@ theorem mem_affineSpan_iff_eq_weightedVSubOfPoint_vadd [Nontrivial k] (p : ι variable {k V} +set_option backward.isDefEq.respectTransparency false in /-- Given a set of points, together with a chosen base point in this set, if we affinely transport all other members of the set along the line joining them to this base point, the affine span is unchanged. -/ diff --git a/Mathlib/LinearAlgebra/AffineSpace/Independent.lean b/Mathlib/LinearAlgebra/AffineSpace/Independent.lean index b0263fcdcb10c4..22c05b7ea558ab 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Independent.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Independent.lean @@ -248,6 +248,7 @@ theorem LinearIndependent.affineIndependent variable {k} +set_option backward.isDefEq.respectTransparency false in /-- If we single out one member of an affine-independent family of points and affinely transport all others along the line joining them to this member, the resulting new family of points is affine- independent. @@ -315,6 +316,7 @@ protected theorem AffineIndependent.subtype {p : ι → P} (ha : AffineIndepende AffineIndependent k fun i : s => p i := ha.comp_embedding (Embedding.subtype _) +set_option backward.isDefEq.respectTransparency false in /-- If an indexed family of points is affinely independent, so is the corresponding set of points. -/ protected theorem AffineIndependent.range {p : ι → P} (ha : AffineIndependent k p) : @@ -701,6 +703,7 @@ theorem affineCombination_mem_affineSpan_pair {p : ι → P} (h : AffineIndepend · simp only [Pi.sub_apply, sub_eq_iff_eq_add] · simp_all only [Pi.sub_apply, Finset.sum_sub_distrib, sub_self] +set_option backward.isDefEq.respectTransparency false in /-- Given an affinely independent family of points, an affine combination (with sum of weights 1) equals the line map of two affine combination points if and only if its weights are given pointwise by the line map of the corresponding weights. -/ @@ -721,6 +724,7 @@ section DivisionRing variable {k : Type*} {V : Type*} {P : Type*} [DivisionRing k] [AddCommGroup V] [Module k V] variable [AffineSpace V P] {ι : Type*} +set_option backward.isDefEq.respectTransparency false in /-- An affinely independent set of points can be extended to such a set that spans the whole space. -/ theorem exists_subset_affineIndependent_affineSpan_eq_top {s : Set P} @@ -918,6 +922,7 @@ theorem sign_eq_of_affineCombination_mem_affineSpan_pair {p : ι → P} (h : Aff rcases hs with ⟨r, hr⟩ rw [hr i hi, hr j hj, hi0, hj0, add_zero, add_zero, sub_zero, sub_zero, sign_mul, sign_mul, hij] +set_option backward.isDefEq.respectTransparency false in /-- Given an affinely independent family of points, suppose that an affine combination lies in the span of one point of that family and a combination of another two points of that family given by `lineMap` with coefficient between 0 and 1. Then the coefficients of those two points in the diff --git a/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean b/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean index 73715697973e15..418a3f9feaf275 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Midpoint.lean @@ -42,6 +42,7 @@ section variable (R : Type*) {V V' P P' : Type*} [Ring R] [Invertible (2 : R)] [AddCommGroup V] [Module R V] [AddTorsor V P] [AddCommGroup V'] [Module R V'] [AddTorsor V' P'] +set_option backward.isDefEq.respectTransparency false in /-- `midpoint x y` is the midpoint of the segment `[x, y]`. -/ def midpoint (x y : P) : P := lineMap x y (⅟2 : R) diff --git a/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean b/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean index 6d6c7e4ad6068b..f30e4644a62930 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/MidpointZero.lean @@ -23,10 +23,12 @@ public section open AffineMap AffineEquiv +set_option backward.isDefEq.respectTransparency false in theorem lineMap_inv_two {R : Type*} {V P : Type*} [DivisionRing R] [CharZero R] [AddCommGroup V] [Module R V] [AddTorsor V P] (a b : P) : lineMap a b (2⁻¹ : R) = midpoint R a b := rfl +set_option backward.isDefEq.respectTransparency false in theorem lineMap_one_half {R : Type*} {V P : Type*} [DivisionRing R] [CharZero R] [AddCommGroup V] [Module R V] [AddTorsor V P] (a b : P) : lineMap a b (1 / 2 : R) = midpoint R a b := by rw [one_div, lineMap_inv_two] diff --git a/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean b/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean index 3a35cf018129fe..48960c7e040b7f 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Ordered.lean @@ -49,29 +49,35 @@ variable [Ring k] [PartialOrder k] [IsOrderedRing k] [AddCommGroup E] [PartialOrder E] [IsOrderedAddMonoid E] [Module k E] [IsStrictOrderedModule k E] variable {a a' b b' : E} {r r' : k} +set_option backward.isDefEq.respectTransparency false in theorem lineMap_mono_left (ha : a ≤ a') (hr : r ≤ 1) : lineMap a b r ≤ lineMap a' b r := by simp only [lineMap_apply_module] gcongr exact sub_nonneg.2 hr +set_option backward.isDefEq.respectTransparency false in theorem lineMap_strict_mono_left (ha : a < a') (hr : r < 1) : lineMap a b r < lineMap a' b r := by simp only [lineMap_apply_module] gcongr exact sub_pos.2 hr +set_option backward.isDefEq.respectTransparency false in omit [IsOrderedRing k] in theorem lineMap_mono_right (hb : b ≤ b') (hr : 0 ≤ r) : lineMap a b r ≤ lineMap a b' r := by simp only [lineMap_apply_module] gcongr +set_option backward.isDefEq.respectTransparency false in omit [IsOrderedRing k] in theorem lineMap_strict_mono_right (hb : b < b') (hr : 0 < r) : lineMap a b r < lineMap a b' r := by simp only [lineMap_apply_module]; gcongr +set_option backward.isDefEq.respectTransparency false in theorem lineMap_mono_endpoints (ha : a ≤ a') (hb : b ≤ b') (h₀ : 0 ≤ r) (h₁ : r ≤ 1) : lineMap a b r ≤ lineMap a' b' r := (lineMap_mono_left ha h₁).trans (lineMap_mono_right hb h₀) +set_option backward.isDefEq.respectTransparency false in theorem lineMap_strict_mono_endpoints (ha : a < a') (hb : b < b') (h₀ : 0 ≤ r) (h₁ : r ≤ 1) : lineMap a b r < lineMap a' b' r := by rcases h₀.eq_or_lt with (rfl | h₀); · simpa @@ -79,20 +85,25 @@ theorem lineMap_strict_mono_endpoints (ha : a < a') (hb : b < b') (h₀ : 0 ≤ variable [PosSMulReflectLT k E] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_lt_lineMap_iff_of_lt (h : r < r') : lineMap a b r < lineMap a b r' ↔ a < b := by simp only [lineMap_apply_module] rw [← lt_sub_iff_add_lt, add_sub_assoc, ← sub_lt_iff_lt_add', ← sub_smul, ← sub_smul, sub_sub_sub_cancel_left, smul_lt_smul_iff_of_pos_left (sub_pos.2 h)] +set_option backward.isDefEq.respectTransparency false in theorem left_lt_lineMap_iff_lt (h : 0 < r) : a < lineMap a b r ↔ a < b := Iff.trans (by rw [lineMap_apply_zero]) (lineMap_lt_lineMap_iff_of_lt h) +set_option backward.isDefEq.respectTransparency false in theorem lineMap_lt_left_iff_lt (h : 0 < r) : lineMap a b r < a ↔ b < a := left_lt_lineMap_iff_lt (E := Eᵒᵈ) h +set_option backward.isDefEq.respectTransparency false in theorem lineMap_lt_right_iff_lt (h : r < 1) : lineMap a b r < b ↔ a < b := Iff.trans (by rw [lineMap_apply_one]) (lineMap_lt_lineMap_iff_of_lt h) +set_option backward.isDefEq.respectTransparency false in theorem right_lt_lineMap_iff_lt (h : r < 1) : b < lineMap a b r ↔ b < a := lineMap_lt_right_iff_lt (E := Eᵒᵈ) h @@ -104,35 +115,45 @@ variable [Ring k] [LinearOrder k] [IsStrictOrderedRing k] [AddCommGroup E] [PartialOrder E] [IsOrderedAddMonoid E] [Module k E] [IsStrictOrderedModule k E] {a a' b b' : E} {r r' : k} +set_option backward.isDefEq.respectTransparency false in theorem lineMap_le_lineMap_iff_of_lt' (h : a < b) : lineMap a b r ≤ lineMap a b r' ↔ r ≤ r' := by simp only [lineMap_apply_module'] rw [add_le_add_iff_right, smul_le_smul_iff_of_pos_right (sub_pos.mpr h)] +set_option backward.isDefEq.respectTransparency false in theorem left_le_lineMap_iff_nonneg (h : a < b) : a ≤ lineMap a b r ↔ 0 ≤ r := by rw [← lineMap_le_lineMap_iff_of_lt' h, lineMap_apply_zero] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_le_left_iff_nonpos (h : a < b) : lineMap a b r ≤ a ↔ r ≤ 0 := by rw [← lineMap_le_lineMap_iff_of_lt' h, lineMap_apply_zero] +set_option backward.isDefEq.respectTransparency false in theorem right_le_lineMap_iff_one_le (h : a < b) : b ≤ lineMap a b r ↔ 1 ≤ r := by rw [← lineMap_le_lineMap_iff_of_lt' h, lineMap_apply_one] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_le_right_iff_le_one (h : a < b) : lineMap a b r ≤ b ↔ r ≤ 1 := by rw [← lineMap_le_lineMap_iff_of_lt' h, lineMap_apply_one] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_lt_lineMap_iff_of_lt' (h : a < b) : lineMap a b r < lineMap a b r' ↔ r < r' := by simp only [lineMap_apply_module'] rw [add_lt_add_iff_right, smul_lt_smul_iff_of_pos_right (sub_pos.mpr h)] +set_option backward.isDefEq.respectTransparency false in theorem left_lt_lineMap_iff_pos (h : a < b) : a < lineMap a b r ↔ 0 < r := by rw [← lineMap_lt_lineMap_iff_of_lt' h, lineMap_apply_zero] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_lt_left_iff_neg (h : a < b) : lineMap a b r < a ↔ r < 0 := by rw [← lineMap_lt_lineMap_iff_of_lt' h, lineMap_apply_zero] +set_option backward.isDefEq.respectTransparency false in theorem right_lt_lineMap_iff_one_lt (h : a < b) : b < lineMap a b r ↔ 1 < r := by rw [← lineMap_lt_lineMap_iff_of_lt' h, lineMap_apply_one] +set_option backward.isDefEq.respectTransparency false in theorem lineMap_lt_right_iff_lt_one (h : a < b) : lineMap a b r < b ↔ r < 1 := by rw [← lineMap_lt_lineMap_iff_of_lt' h, lineMap_apply_one] @@ -152,11 +173,13 @@ section variable {a b : E} {r r' : k} +set_option backward.isDefEq.respectTransparency false in theorem lineMap_le_lineMap_iff_of_lt (h : r < r') : lineMap a b r ≤ lineMap a b r' ↔ a ≤ b := by simp only [lineMap_apply_module] rw [← le_sub_iff_add_le, add_sub_assoc, ← sub_le_iff_le_add', ← sub_smul, ← sub_smul, sub_sub_sub_cancel_left, smul_le_smul_iff_of_pos_left (sub_pos.2 h)] +set_option backward.isDefEq.respectTransparency false in theorem left_le_lineMap_iff_le (h : 0 < r) : a ≤ lineMap a b r ↔ a ≤ b := Iff.trans (by rw [lineMap_apply_zero]) (lineMap_le_lineMap_iff_of_lt h) @@ -164,6 +187,7 @@ theorem left_le_lineMap_iff_le (h : 0 < r) : a ≤ lineMap a b r ↔ a ≤ b := theorem left_le_midpoint : a ≤ midpoint k a b ↔ a ≤ b := left_le_lineMap_iff_le <| inv_pos.2 zero_lt_two +set_option backward.isDefEq.respectTransparency false in theorem lineMap_le_left_iff_le (h : 0 < r) : lineMap a b r ≤ a ↔ b ≤ a := left_le_lineMap_iff_le (E := Eᵒᵈ) h @@ -171,12 +195,14 @@ theorem lineMap_le_left_iff_le (h : 0 < r) : lineMap a b r ≤ a ↔ b ≤ a := theorem midpoint_le_left : midpoint k a b ≤ a ↔ b ≤ a := lineMap_le_left_iff_le <| inv_pos.2 zero_lt_two +set_option backward.isDefEq.respectTransparency false in theorem lineMap_le_right_iff_le (h : r < 1) : lineMap a b r ≤ b ↔ a ≤ b := Iff.trans (by rw [lineMap_apply_one]) (lineMap_le_lineMap_iff_of_lt h) @[simp] theorem midpoint_le_right : midpoint k a b ≤ b ↔ a ≤ b := lineMap_le_right_iff_le two_inv_lt_one +set_option backward.isDefEq.respectTransparency false in theorem right_le_lineMap_iff_le (h : r < 1) : b ≤ lineMap a b r ↔ b ≤ a := lineMap_le_right_iff_le (E := Eᵒᵈ) h @@ -221,6 +247,7 @@ local notation "c" => lineMap a b r section omit [IsStrictOrderedRing k] +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is non-strictly below the segment `[(a, f a), (b, f b)]` if and only if `slope f a c ≤ slope f a b`. -/ theorem map_le_lineMap_iff_slope_le_slope_left (h : 0 < r * (b - a)) : @@ -232,12 +259,14 @@ theorem map_le_lineMap_iff_slope_le_slope_left (h : 0 < r * (b - a)) : mul_inv_cancel_right₀ (right_ne_zero_of_mul h.ne'), smul_add, smul_inv_smul₀ (left_ne_zero_of_mul h.ne')] +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is non-strictly above the segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f a c`. -/ theorem lineMap_le_map_iff_slope_le_slope_left (h : 0 < r * (b - a)) : lineMap (f a) (f b) r ≤ f c ↔ slope f a b ≤ slope f a c := map_le_lineMap_iff_slope_le_slope_left (E := Eᵒᵈ) (f := f) (a := a) (b := b) (r := r) h +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is strictly below the segment `[(a, f a), (b, f b)]` if and only if `slope f a c < slope f a b`. -/ theorem map_lt_lineMap_iff_slope_lt_slope_left (h : 0 < r * (b - a)) : @@ -245,12 +274,14 @@ theorem map_lt_lineMap_iff_slope_lt_slope_left (h : 0 < r * (b - a)) : lt_iff_lt_of_le_iff_le' (lineMap_le_map_iff_slope_le_slope_left h) (map_le_lineMap_iff_slope_le_slope_left h) +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is strictly above the segment `[(a, f a), (b, f b)]` if and only if `slope f a b < slope f a c`. -/ theorem lineMap_lt_map_iff_slope_lt_slope_left (h : 0 < r * (b - a)) : lineMap (f a) (f b) r < f c ↔ slope f a b < slope f a c := map_lt_lineMap_iff_slope_lt_slope_left (E := Eᵒᵈ) (f := f) (a := a) (b := b) (r := r) h +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/ theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) : @@ -263,12 +294,14 @@ theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) : smul_neg, neg_add_eq_sub] · exact right_ne_zero_of_mul h.ne' +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly above the segment `[(a, f a), (b, f b)]` if and only if `slope f c b ≤ slope f a b`. -/ theorem lineMap_le_map_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) : lineMap (f a) (f b) r ≤ f c ↔ slope f c b ≤ slope f a b := map_le_lineMap_iff_slope_le_slope_right (E := Eᵒᵈ) (f := f) (a := a) (b := b) (r := r) h +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is strictly below the segment `[(a, f a), (b, f b)]` if and only if `slope f a b < slope f c b`. -/ theorem map_lt_lineMap_iff_slope_lt_slope_right (h : 0 < (1 - r) * (b - a)) : @@ -276,6 +309,7 @@ theorem map_lt_lineMap_iff_slope_lt_slope_right (h : 0 < (1 - r) * (b - a)) : lt_iff_lt_of_le_iff_le' (lineMap_le_map_iff_slope_le_slope_right h) (map_le_lineMap_iff_slope_le_slope_right h) +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is strictly above the segment `[(a, f a), (b, f b)]` if and only if `slope f c b < slope f a b`. -/ theorem lineMap_lt_map_iff_slope_lt_slope_right (h : 0 < (1 - r) * (b - a)) : @@ -284,6 +318,7 @@ theorem lineMap_lt_map_iff_slope_lt_slope_right (h : 0 < (1 - r) * (b - a)) : end +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is non-strictly below the segment `[(a, f a), (b, f b)]` if and only if `slope f a c ≤ slope f c b`. -/ theorem map_le_lineMap_iff_slope_le_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) : @@ -291,12 +326,14 @@ theorem map_le_lineMap_iff_slope_le_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r rw [map_le_lineMap_iff_slope_le_slope_left (mul_pos h₀ (sub_pos.2 hab)), ← lineMap_slope_lineMap_slope_lineMap f a b r, right_le_lineMap_iff_le h₁] +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is non-strictly above the segment `[(a, f a), (b, f b)]` if and only if `slope f c b ≤ slope f a c`. -/ theorem lineMap_le_map_iff_slope_le_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) : lineMap (f a) (f b) r ≤ f c ↔ slope f c b ≤ slope f a c := map_le_lineMap_iff_slope_le_slope (E := Eᵒᵈ) hab h₀ h₁ +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is strictly below the segment `[(a, f a), (b, f b)]` if and only if `slope f a c < slope f c b`. -/ theorem map_lt_lineMap_iff_slope_lt_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) : @@ -304,6 +341,7 @@ theorem map_lt_lineMap_iff_slope_lt_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r lt_iff_lt_of_le_iff_le' (lineMap_le_map_iff_slope_le_slope hab h₀ h₁) (map_le_lineMap_iff_slope_le_slope hab h₀ h₁) +set_option backward.isDefEq.respectTransparency false in /-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is strictly above the segment `[(a, f a), (b, f b)]` if and only if `slope f c b < slope f a c`. -/ theorem lineMap_lt_map_iff_slope_lt_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) : diff --git a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean index 45f78f328edcd5..817bbe80c65e1e 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean @@ -275,6 +275,7 @@ theorem reindex_map {m n : ℕ} (s : Simplex k P m) (e : Fin (m + 1) ≃ Fin (n (s.map f hf).reindex e = (s.reindex e).map f hf := rfl +set_option backward.isDefEq.respectTransparency false in lemma range_face_reindex {m n : ℕ} (s : Simplex k P m) (e : Fin (m + 1) ≃ Fin (n + 1)) {fs : Finset (Fin (n + 1))} {n' : ℕ} (h : #fs = n' + 1) : Set.range ((s.reindex e).face h).points = diff --git a/Mathlib/LinearAlgebra/AffineSpace/Slope.lean b/Mathlib/LinearAlgebra/AffineSpace/Slope.lean index e000e52df3486c..842a16bed8502c 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Slope.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Slope.lean @@ -112,6 +112,7 @@ theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k → PE) (a b c smul_inv_smul₀ (sub_ne_zero.2 <| Ne.symm hab), smul_inv_smul₀ (sub_ne_zero.2 <| Ne.symm hbc), vsub_add_vsub_cancel] +set_option backward.isDefEq.respectTransparency false in /-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses `lineMap` to express this property. -/ theorem lineMap_slope_slope_sub_div_sub (f : k → PE) (a b c : k) (h : a ≠ c) : @@ -121,6 +122,7 @@ theorem lineMap_slope_slope_sub_div_sub (f : k → PE) (a b c : k) (h : a ≠ c) match_scalars field [sub_ne_zero.2 h.symm] +set_option backward.isDefEq.respectTransparency false in /-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and `slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/ theorem lineMap_slope_lineMap_slope_lineMap (f : k → PE) (a b r : k) : diff --git a/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean b/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean index 0c4d075e3d76a9..92569659d76d29 100644 --- a/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean +++ b/Mathlib/LinearAlgebra/Alternating/DomCoprod.lean @@ -198,6 +198,7 @@ theorem MultilinearMap.domCoprod_alternization_coe [DecidableEq ιa] [DecidableE open AlternatingMap +set_option backward.isDefEq.respectTransparency.types false in open Perm in /-- Computing the `MultilinearMap.alternatization` of the `MultilinearMap.domCoprod` is the same as computing the `AlternatingMap.domCoprod` of the `MultilinearMap.alternatization`s. diff --git a/Mathlib/LinearAlgebra/Basis/Basic.lean b/Mathlib/LinearAlgebra/Basis/Basic.lean index 9bf07fec3e2dbe..b0fa1439a882d2 100644 --- a/Mathlib/LinearAlgebra/Basis/Basic.lean +++ b/Mathlib/LinearAlgebra/Basis/Basic.lean @@ -210,6 +210,7 @@ lemma span_neg {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] end Span +set_option backward.isDefEq.respectTransparency false in /-- Any basis is a maximal linear independent set. -/ theorem maximal [Nontrivial R] (b : Basis ι R M) : b.linearIndependent.Maximal := fun w hi h => by @@ -253,10 +254,12 @@ protected def singleton (ι R : Type*) [Unique ι] [Semiring R] : Basis ι R R : map_add' := fun x y => by simp map_smul' := fun c x => by simp } +set_option backward.isDefEq.respectTransparency false in @[simp] theorem singleton_apply (ι R : Type*) [Unique ι] [Semiring R] (i) : Basis.singleton ι R i = 1 := apply_eq_iff.mpr (by simp [Basis.singleton]) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem singleton_repr (ι R : Type*) [Unique ι] [Semiring R] (x i) : (Basis.singleton ι R).repr x i = x := by simp [Basis.singleton, Unique.eq_default i] @@ -284,6 +287,7 @@ end Empty section Module.IsTorsionFree +set_option backward.isDefEq.respectTransparency false in -- Can't be an instance because the basis can't be inferred. protected lemma isTorsionFree (b : Basis ι R M) : Module.IsTorsionFree R M := b.repr.injective.moduleIsTorsionFree _ (by simp) diff --git a/Mathlib/LinearAlgebra/Basis/Bilinear.lean b/Mathlib/LinearAlgebra/Basis/Bilinear.lean index d7c4bc115f0dae..e2172eaa7f4941 100644 --- a/Mathlib/LinearAlgebra/Basis/Bilinear.lean +++ b/Mathlib/LinearAlgebra/Basis/Bilinear.lean @@ -49,6 +49,7 @@ theorem sum_repr_mul_repr_mulₛₗ {B : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁ conv_rhs => rw [← b₁.linearCombination_repr x, ← b₂.linearCombination_repr y] simp_rw [Finsupp.linearCombination_apply, Finsupp.sum, map_sum₂, map_sum, map_smulₛₗ₂, map_smulₛₗ] +set_option backward.isDefEq.respectTransparency false in /-- Write out `B x y` as a sum over `B (b i) (b j)` if `b` is a basis. Version for bilinear maps, see `sum_repr_mul_repr_mulₛₗ` for the semi-bilinear version. -/ diff --git a/Mathlib/LinearAlgebra/Basis/Cardinality.lean b/Mathlib/LinearAlgebra/Basis/Cardinality.lean index e111ee2dcdf5b8..e20820b2e4a26a 100644 --- a/Mathlib/LinearAlgebra/Basis/Cardinality.lean +++ b/Mathlib/LinearAlgebra/Basis/Cardinality.lean @@ -63,6 +63,7 @@ section Ring variable [Semiring R] [AddCommMonoid M] [Nontrivial R] [Module R M] +set_option backward.isDefEq.respectTransparency false in -- From [Les familles libres maximales d'un module ont-elles le meme cardinal?][lazarus1973] /-- Over any ring `R`, if `b` is a basis for a module `M`, and `s` is a maximal linearly independent set, diff --git a/Mathlib/LinearAlgebra/Basis/Defs.lean b/Mathlib/LinearAlgebra/Basis/Defs.lean index d4733103787f0c..7486eef39fc905 100644 --- a/Mathlib/LinearAlgebra/Basis/Defs.lean +++ b/Mathlib/LinearAlgebra/Basis/Defs.lean @@ -229,11 +229,12 @@ def Basis.equivFun [Finite ι] (b : Basis ι R M) : M ≃ₗ[R] ι → R := (ι →₀ R) ≃ₗ[R] ι → R) /-- A module over a finite ring that admits a finite basis is finite. -/ -@[implicit_reducible] +@[instance_reducible] def fintypeOfFintype [Fintype ι] (b : Basis ι R M) [Fintype R] : Fintype M := haveI := Classical.decEq ι Fintype.ofEquiv _ b.equivFun.toEquiv.symm +set_option backward.isDefEq.respectTransparency false in /-- Given a basis `v` indexed by `ι`, the canonical linear equivalence between `ι → R` and `M` maps a function `x : ι → R` to the linear combination `∑_i x i • v i`. -/ @[simp] @@ -431,6 +432,7 @@ theorem reindexRange_apply (x : range b) : b.reindexRange x = x := by rcases x with ⟨bi, ⟨i, rfl⟩⟩ exact b.reindexRange_self i +set_option backward.isDefEq.respectTransparency false in theorem reindexRange_repr' (x : M) {bi : M} {i : ι} (h : b i = bi) : b.reindexRange.repr x ⟨bi, ⟨i, h⟩⟩ = b.repr x i := by nontriviality @@ -640,6 +642,7 @@ theorem equiv'_symm_apply (f : M → M') (g : M' → M) (hf hg hgf hfg) (i : ι' (b.equiv' b' f g hf hg hgf hfg).symm (b' i) = g (b' i) := b'.constr_basis R _ _ +set_option backward.isDefEq.respectTransparency false in theorem sum_repr_mul_repr {ι'} [Fintype ι'] (b' : Basis ι' R M) (x : M) (i : ι) : (∑ j : ι', b.repr (b' j) i * b'.repr x j) = b.repr x i := by conv_rhs => rw [← b'.sum_repr x] diff --git a/Mathlib/LinearAlgebra/Basis/Exact.lean b/Mathlib/LinearAlgebra/Basis/Exact.lean index ac5abfe05976d1..71dfb5f5b78a7d 100644 --- a/Mathlib/LinearAlgebra/Basis/Exact.lean +++ b/Mathlib/LinearAlgebra/Basis/Exact.lean @@ -52,6 +52,7 @@ lemma LinearIndependent.linearIndependent_of_exact_of_retraction simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.id_coe, id_eq] at hs rw [← hs, hz, map_zero] +set_option backward.isDefEq.respectTransparency false in private lemma top_le_span_of_aux (v : κ ⊕ σ → M) (hg : Function.Surjective g) (hslzero : ∀ i, s (v (.inl i)) = 0) (hli : LinearIndependent R (s ∘ v ∘ .inr)) (hsp : ⊤ ≤ Submodule.span R (Set.range v)) : diff --git a/Mathlib/LinearAlgebra/Basis/Fin.lean b/Mathlib/LinearAlgebra/Basis/Fin.lean index c2cc98a0e87750..1320a0a72144a3 100644 --- a/Mathlib/LinearAlgebra/Basis/Fin.lean +++ b/Mathlib/LinearAlgebra/Basis/Fin.lean @@ -124,10 +124,12 @@ theorem coe_mkFinSnocOfLE {n : ℕ} {N O : Submodule R M} (b : Basis (Fin n) R N protected def finTwoProd (R : Type*) [Semiring R] : Basis (Fin 2) R (R × R) := Basis.ofEquivFun (LinearEquiv.finTwoArrow R R).symm +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem finTwoProd_zero (R : Type*) [Semiring R] : Basis.finTwoProd R 0 = (1, 0) := by simp [Basis.finTwoProd, LinearEquiv.finTwoArrow] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem finTwoProd_one (R : Type*) [Semiring R] : Basis.finTwoProd R 1 = (0, 1) := by simp [Basis.finTwoProd, LinearEquiv.finTwoArrow] diff --git a/Mathlib/LinearAlgebra/Basis/SMul.lean b/Mathlib/LinearAlgebra/Basis/SMul.lean index 091b29649fb93c..d48b6c6be61b07 100644 --- a/Mathlib/LinearAlgebra/Basis/SMul.lean +++ b/Mathlib/LinearAlgebra/Basis/SMul.lean @@ -110,6 +110,7 @@ theorem unitsSMul_apply {v : Basis ι R M} {w : ι → Rˣ} (i : ι) : unitsSMul variable [CommSemiring R₂] [Module R₂ M] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem coord_unitsSMul (e : Basis ι R₂ M) (w : ι → R₂ˣ) (i : ι) : (unitsSMul e w).coord i = (w i)⁻¹ • e.coord i := by diff --git a/Mathlib/LinearAlgebra/Basis/Submodule.lean b/Mathlib/LinearAlgebra/Basis/Submodule.lean index aa9d6ba203ab18..66a6b48206518a 100644 --- a/Mathlib/LinearAlgebra/Basis/Submodule.lean +++ b/Mathlib/LinearAlgebra/Basis/Submodule.lean @@ -37,6 +37,7 @@ theorem mem_submodule_iff {P : Submodule R M} (b : Basis ι R P) {x : M} : ← Finsupp.range_linearCombination] simp [@eq_comm _ x, Function.comp, Finsupp.linearCombination_apply] +set_option backward.isDefEq.respectTransparency false in /-- If the submodule `P` has a finite basis, `x ∈ P` iff it is a linear combination of basis vectors. -/ theorem mem_submodule_iff' [Fintype ι] {P : Submodule R M} (b : Basis ι R P) {x : M} : diff --git a/Mathlib/LinearAlgebra/Basis/VectorSpace.lean b/Mathlib/LinearAlgebra/Basis/VectorSpace.lean index ecba99c0e53472..5b9d3493f59d39 100644 --- a/Mathlib/LinearAlgebra/Basis/VectorSpace.lean +++ b/Mathlib/LinearAlgebra/Basis/VectorSpace.lean @@ -341,6 +341,7 @@ variable {K : Type*} {V : Type*} [Field K] [AddCommGroup V] [Module K V] variable {f : V →ₗ[K] K} {v : V} +set_option backward.isDefEq.respectTransparency false in /-- In a vector space, given a nonzero linear form `f`, a nonzero vector `v` such that `f v ≠ 0`, there exists a basis `b` with an index `i` @@ -425,7 +426,7 @@ theorem exists_basis_of_pairing_eq_zero · apply b.ext intro i rw [Basis.coord_apply, Basis.repr_self] - simp only [b, Basis.mk_apply] + simp only [b] rcases i with ⟨x, rfl | ⟨x, hx, rfl⟩⟩ · simp [hw] · suffices x ≠ w by simp [this] diff --git a/Mathlib/LinearAlgebra/BilinearForm/Properties.lean b/Mathlib/LinearAlgebra/BilinearForm/Properties.lean index 5f791c917facf3..fa737f807f92ad 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/Properties.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/Properties.lean @@ -157,6 +157,7 @@ lemma ext_iff_of_isSymm (hB : IsSymm B) (hC : IsSymm C) : end polarization +set_option backward.isDefEq.respectTransparency false in lemma isSymm_iff_basis {ι : Type*} (b : Basis ι R M) : IsSymm B ↔ ∀ i j, B (b i) (b j) = B (b j) (b i) where mp := fun ⟨h⟩ i j ↦ h _ _ diff --git a/Mathlib/LinearAlgebra/BilinearMap.lean b/Mathlib/LinearAlgebra/BilinearMap.lean index 444fe1ed5f8bb4..2e69802b24b089 100644 --- a/Mathlib/LinearAlgebra/BilinearMap.lean +++ b/Mathlib/LinearAlgebra/BilinearMap.lean @@ -569,6 +569,7 @@ noncomputable def restrictScalarsRange : M' →ₗ[S] P' := ((f.restrictScalars S).comp i).codLift k hk hf +set_option backward.isDefEq.respectTransparency false in @[simp] lemma restrictScalarsRange_apply (m : M') : k (restrictScalarsRange i k hk f hf m) = f (i m) := by @@ -608,6 +609,7 @@ noncomputable def restrictScalarsRange₂ : (((LinearMap.restrictScalarsₗ S R _ _ _).comp (B.restrictScalars S)).compl₁₂ i j).codRestrict₂ k hk hB +set_option backward.isDefEq.respectTransparency false in @[simp] lemma restrictScalarsRange₂_apply (m : M') (n : N') : k (restrictScalarsRange₂ i j k hk B hB m n) = B (i m) (j n) := by simp [restrictScalarsRange₂] diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean index df8a439744af44..4c8d60d1b3df1f 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean @@ -343,6 +343,7 @@ theorem ι_mul_ι (r₁ r₂) : ι (0 : QuadraticForm R R) r₁ * ι (0 : Quadra rw [← mul_one r₁, ← mul_one r₂, ← smul_eq_mul r₁, ← smul_eq_mul r₂, map_smul, map_smul, smul_mul_smul_comm, ι_sq_scalar, QuadraticMap.zero_apply, map_zero, smul_zero] +set_option backward.isDefEq.respectTransparency.types false in /-- The clifford algebra over a 1-dimensional vector space with 0 quadratic form is isomorphic to the dual numbers. -/ protected def equiv : CliffordAlgebra (0 : QuadraticForm R R) ≃ₐ[R] R[ε] := diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean index 3a80fba3ee6387..fc30d6145d90b5 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/EvenEquiv.lean @@ -106,6 +106,7 @@ end EquivEven open EquivEven +set_option backward.isDefEq.respectTransparency.types false in /-- The embedding from the smaller algebra into the new larger one. -/ def toEven : CliffordAlgebra Q →ₐ[R] CliffordAlgebra.even (Q' Q) := by refine CliffordAlgebra.lift Q ⟨?_, fun m => ?_⟩ @@ -118,6 +119,7 @@ def toEven : CliffordAlgebra Q →ₐ[R] CliffordAlgebra.even (Q' Q) := by rw [LinearMap.codRestrict_apply] simp [← mul_assoc, v_sq_scalar] +set_option backward.isDefEq.respectTransparency.types false in theorem toEven_ι (m : M) : (toEven Q (ι Q m) : CliffordAlgebra (Q' Q)) = e0 Q * v Q m := by simp only [toEven, CliffordAlgebra.lift_ι_apply, ← even_toSubmodule] rw [LinearMap.codRestrict_apply, LinearMap.coe_comp, Function.comp_apply, LinearMap.mulLeft_apply] diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean index c9dfc7c666d345..15c0ee7ccbeedd 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean @@ -23,7 +23,7 @@ namespace CliffordAlgebra variable (Q) /-- If the quadratic form of a vector is invertible, then so is that vector. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleιOfInvertible (m : M) [Invertible (Q m)] : Invertible (ι Q m) where invOf := ι Q (⅟(Q m) • m) invOf_mul_self := by @@ -58,7 +58,7 @@ section variable [Invertible (2 : R)] /-- Over a ring where `2` is invertible, `Q m` is invertible whenever `ι Q m`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfInvertibleι (m : M) [Invertible (ι Q m)] : Invertible (Q m) := ExteriorAlgebra.invertibleAlgebraMapEquiv M (Q m) <| .algebraMapOfInvertibleAlgebraMap (equivExterior Q).toLinearMap (by simp) <| diff --git a/Mathlib/LinearAlgebra/Complex/Module.lean b/Mathlib/LinearAlgebra/Complex/Module.lean index a949334ea2415c..dab62dfded39bc 100644 --- a/Mathlib/LinearAlgebra/Complex/Module.lean +++ b/Mathlib/LinearAlgebra/Complex/Module.lean @@ -495,6 +495,7 @@ lemma ComplexStarModule.ext_iff {x y : A} : x = y ↔ ℜ x = ℜ y ∧ ℑ x = mp := by grind mpr h := ext h.1 h.2 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ker_imaginaryPart : imaginaryPart.ker = selfAdjoint.submodule ℝ A := by ext x diff --git a/Mathlib/LinearAlgebra/Contraction.lean b/Mathlib/LinearAlgebra/Contraction.lean index 8f247cdbdc15bc..7c836c55ed1772 100644 --- a/Mathlib/LinearAlgebra/Contraction.lean +++ b/Mathlib/LinearAlgebra/Contraction.lean @@ -103,6 +103,7 @@ theorem map_dualTensorHom (f : Module.Dual R M) (p : P) (g : Module.Dual R N) (q simp only [compr₂ₛₗ_apply, mk_apply, map_tmul, dualTensorHom_apply, dualDistrib_apply, ← smul_tmul_smul] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem comp_dualTensorHom (f : Module.Dual R M) (n : N) (g : Module.Dual R N) (p : P) : dualTensorHom R N P (g ⊗ₜ[R] p) ∘ₗ dualTensorHom R M N (f ⊗ₜ[R] n) = @@ -111,6 +112,7 @@ theorem comp_dualTensorHom (f : Module.Dual R M) (n : N) (g : Module.Dual R N) ( simp only [coe_comp, Function.comp_apply, dualTensorHom_apply, map_smul, LinearMap.smul_apply] rw [smul_comm] +set_option backward.isDefEq.respectTransparency false in /-- As a matrix, `dualTensorHom` evaluated on a basis element of `M* ⊗ N` is a matrix with a single one and zeros elsewhere -/ theorem toMatrix_dualTensorHom {m : Type*} {n : Type*} [Fintype m] [Finite n] [DecidableEq m] diff --git a/Mathlib/LinearAlgebra/CrossProduct.lean b/Mathlib/LinearAlgebra/CrossProduct.lean index 7a8bae94b922cf..c66be92dbb904e 100644 --- a/Mathlib/LinearAlgebra/CrossProduct.lean +++ b/Mathlib/LinearAlgebra/CrossProduct.lean @@ -100,6 +100,7 @@ theorem triple_product_permutation (u v w : Fin 3 → R) : u ⬝ᵥ v ⨯₃ w = dsimp only [Matrix.cons_val] ring +set_option backward.isDefEq.respectTransparency false in /-- The triple product of `u`, `v`, and `w` is equal to the determinant of the matrix with those vectors as its rows. -/ theorem triple_product_eq_det (u v w : Fin 3 → R) : u ⬝ᵥ v ⨯₃ w = Matrix.det ![u, v, w] := by diff --git a/Mathlib/LinearAlgebra/DFinsupp.lean b/Mathlib/LinearAlgebra/DFinsupp.lean index ef9d52a6fb11d6..c8d1c85aeba6fe 100644 --- a/Mathlib/LinearAlgebra/DFinsupp.lean +++ b/Mathlib/LinearAlgebra/DFinsupp.lean @@ -147,6 +147,7 @@ def linearEquivFunOnFintype [Fintype ι] : (Π₀ i, M i) ≃ₗ[R] (Π i, M i) map_add' _ _ := by ext; rfl map_smul' _ _ := by ext; rfl +set_option backward.isDefEq.respectTransparency false in /-- The `DFinsupp` version of `Finsupp.lsum`. See note [bundled maps over different rings] for why separate `R` and `S` semirings are used. -/ @@ -210,6 +211,7 @@ section AddCommMonoid variable [∀ i, AddCommMonoid (β i)] [∀ i, AddCommMonoid (β₁ i)] [∀ i, AddCommMonoid (β₂ i)] variable [∀ i, Module R (β i)] [∀ i, Module R (β₁ i)] [∀ i, Module R (β₂ i)] +set_option backward.isDefEq.respectTransparency false in lemma mker_mapRangeAddMonoidHom (f : ∀ i, β₁ i →+ β₂ i) : AddMonoidHom.mker (mapRange.addMonoidHom f) = (AddSubmonoid.pi Set.univ (fun i ↦ AddMonoidHom.mker (f i))).comap coeFnAddMonoidHom := by @@ -245,6 +247,7 @@ def mapRange.linearMap (f : ∀ i, β₁ i →ₗ[R] β₂ i) : (Π₀ i, β₁ toFun := mapRange (fun i x => f i x) fun i => (f i).map_zero map_smul' := fun r => mapRange_smul _ (fun i => (f i).map_zero) _ fun i => (f i).map_smul r } +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mapRange.linearMap_id : (mapRange.linearMap fun i => (LinearMap.id : β₂ i →ₗ[R] _)) = LinearMap.id := by @@ -630,6 +633,7 @@ theorem iSupIndep_iff_dfinsuppSumAddHom_injective (p : ι → AddSubgroup N) : .ofBijective _ ⟨ind.dfinsupp_lsum_injective, by rwa [← LinearMap.range_eq_top, ← Submodule.iSup_eq_range_dfinsupp_lsum]⟩ +set_option backward.isDefEq.respectTransparency false in theorem iSupIndep.linearEquiv_symm_apply {p : ι → Submodule R N} (ind : iSupIndep p) (iSup_top : ⨆ i, p i = ⊤) {i : ι} {x : N} (h : x ∈ p i) : (ind.linearEquiv iSup_top).symm x = .single i ⟨x, h⟩ := by diff --git a/Mathlib/LinearAlgebra/Determinant.lean b/Mathlib/LinearAlgebra/Determinant.lean index 80c91075db806c..3fac3a2c338e84 100644 --- a/Mathlib/LinearAlgebra/Determinant.lean +++ b/Mathlib/LinearAlgebra/Determinant.lean @@ -250,6 +250,7 @@ theorem det_comp (f g : M →ₗ[A] M) : theorem det_id : LinearMap.det (LinearMap.id : M →ₗ[A] M) = 1 := LinearMap.det.map_one +set_option backward.isDefEq.respectTransparency false in /-- Multiplying a map by a scalar `c` multiplies its determinant by `c ^ dim M`. -/ @[simp] theorem det_smul [Module.Free A M] (c : A) (f : M →ₗ[A] M) : @@ -342,6 +343,7 @@ theorem finite_of_det_ne_one {f : M →ₗ[R] M} (hf : f.det ≠ 1) : Module.Fin exact Module.Finite.of_basis hs · classical simp [LinearMap.coe_det, H] at hf +set_option backward.isDefEq.respectTransparency false in /-- If the determinant of a map vanishes, then the map is not injective. -/ theorem bot_lt_ker_of_det_eq_zero [IsDomain R] [Free R M] {f : M →ₗ[R] M} (hf : f.det = 0) : ⊥ < ker f := by @@ -595,6 +597,7 @@ theorem LinearMap.associated_det_comp_equiv {N : Type*} [AddCommGroup N] [Module namespace Module.Basis set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- The determinant of a family of vectors with respect to some basis, as an alternating multilinear map. -/ nonrec def det : M [⋀^ι]→ₗ[R] R where @@ -734,6 +737,7 @@ theorem det_map' (b : Basis ι R M) (f : M ≃ₗ[R] M') : end Module.Basis +set_option backward.isDefEq.respectTransparency false in @[simp] theorem Pi.basisFun_det : (Pi.basisFun R ι).det = Matrix.detRowAlternating := by ext M diff --git a/Mathlib/LinearAlgebra/Dimension/Basic.lean b/Mathlib/LinearAlgebra/Dimension/Basic.lean index 824dc4f9b01d3a..1f9110bef6d342 100644 --- a/Mathlib/LinearAlgebra/Dimension/Basic.lean +++ b/Mathlib/LinearAlgebra/Dimension/Basic.lean @@ -244,6 +244,7 @@ theorem rank_eq_of_equiv_equiv (i : R → R') (j : M ≃+ M₁) end end Semiring +set_option backward.isDefEq.respectTransparency false in /-- TODO: prove that nontrivial commutative semirings satisfy the strong rank condition, following *Free sets and free subsemimodules in a semimodule* by Yi-Jia Tan, Theorem 3.2. diff --git a/Mathlib/LinearAlgebra/Dimension/Constructions.lean b/Mathlib/LinearAlgebra/Dimension/Constructions.lean index 349ee1030152c1..b3f30440e9fa01 100644 --- a/Mathlib/LinearAlgebra/Dimension/Constructions.lean +++ b/Mathlib/LinearAlgebra/Dimension/Constructions.lean @@ -48,6 +48,7 @@ section Quotient variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] +set_option backward.isDefEq.respectTransparency false in theorem LinearIndependent.sumElim_of_quotient {M' : Submodule R M} {ι₁ ι₂} {f : ι₁ → M'} (hf : LinearIndependent R f) (g : ι₂ → M) (hg : LinearIndependent R (Submodule.Quotient.mk (p := M') ∘ g)) : @@ -603,6 +604,7 @@ theorem sumQuot_repr_left (i : m) : (sumQuot bW bQ).repr (bW i) = Finsupp.single (Sum.inl i) 1 := by rw [← Module.Basis.apply_eq_iff, sumQuot_inl] +set_option backward.isDefEq.respectTransparency false in theorem sumQuot_repr_inl (w : W) (i : m) : (sumQuot bW bQ).repr w (Sum.inl i) = bW.repr w i := by classical diff --git a/Mathlib/LinearAlgebra/Dimension/Finite.lean b/Mathlib/LinearAlgebra/Dimension/Finite.lean index d08c8e0cf7ff44..7ac6884e0d8141 100644 --- a/Mathlib/LinearAlgebra/Dimension/Finite.lean +++ b/Mathlib/LinearAlgebra/Dimension/Finite.lean @@ -138,7 +138,7 @@ theorem Module.Basis.nonempty_fintype_index_of_rank_lt_aleph0 {ι : Type*} (b : Cardinal.lt_aleph0_iff_fintype] at h /-- If a module has a finite dimension, all bases are indexed by a finite type. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def Module.Basis.fintypeIndexOfRankLtAleph0 {ι : Type*} (b : Basis ι R M) (h : Module.rank R M < ℵ₀) : Fintype ι := Classical.choice (b.nonempty_fintype_index_of_rank_lt_aleph0 h) @@ -266,7 +266,7 @@ theorem iSupIndep.subtype_ne_bot_le_finrank_aux /-- If `p` is an independent family of submodules of an `R`-finite module `M`, then the number of nontrivial subspaces in the family `p` is finite. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def iSupIndep.fintypeNeBotOfFiniteDimensional {p : ι → Submodule R M} (hp : iSupIndep p) : Fintype { i : ι // p i ≠ ⊥ } := by diff --git a/Mathlib/LinearAlgebra/Dimension/Free.lean b/Mathlib/LinearAlgebra/Dimension/Free.lean index 9a6ff3562f240a..240073d304ce25 100644 --- a/Mathlib/LinearAlgebra/Dimension/Free.lean +++ b/Mathlib/LinearAlgebra/Dimension/Free.lean @@ -331,6 +331,7 @@ theorem basisUnique_repr_eq_zero_iff {ι : Type*} [Unique ι] variable {R : Type*} [CommSemiring R] [StrongRankCondition R] {M : Type*} [AddCommMonoid M] [Module R M] [Module.Free R M] +set_option backward.isDefEq.respectTransparency false in theorem _root_.LinearMap.existsUnique_eq_smul_id_of_finrank_eq_one (d1 : Module.finrank R M = 1) (u : M →ₗ[R] M) : ∃! c : R, u = c • LinearMap.id := by diff --git a/Mathlib/LinearAlgebra/Dimension/RankNullity.lean b/Mathlib/LinearAlgebra/Dimension/RankNullity.lean index 9f6f1ba0053b2f..3c7e276801463f 100644 --- a/Mathlib/LinearAlgebra/Dimension/RankNullity.lean +++ b/Mathlib/LinearAlgebra/Dimension/RankNullity.lean @@ -187,6 +187,7 @@ theorem exists_linearIndependent_pair_of_one_lt_rank [IsDomain R] [StrongRankCon rw [this] at hy exact ⟨y, hy⟩ +set_option backward.isDefEq.respectTransparency false in theorem Submodule.exists_smul_notMem_of_rank_lt {N : Submodule R M} (h : Module.rank R N < Module.rank R M) : ∃ m : M, ∀ r : R, r ≠ 0 → r • m ∉ N := by have : Module.rank R (M ⧸ N) ≠ 0 := by diff --git a/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean b/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean index 368c32cb3e9fed..a4632fd891324c 100644 --- a/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean +++ b/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean @@ -496,7 +496,7 @@ theorem rank_of_bijective_algebraMap {R S : Type*} [CommSemiring R] [Semiring S] rw [rank_eq_one_iff_finrank_eq_one, finrank_of_bijective_algebraMap h] /-- Given a basis of a ring over itself indexed by a type `ι`, then `ι` is `Unique`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def _root_.Module.Basis.unique {ι : Type*} (b : Basis ι R R) : Unique ι := by have : Cardinal.mk ι = ↑(Module.finrank R R) := (Module.mk_finrank_eq_card_basis b).symm have : Subsingleton ι ∧ Nonempty ι := by simpa [Cardinal.eq_one_iff_unique] diff --git a/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean b/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean index 077a92a57870b4..785c49b4a6ce72 100644 --- a/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean +++ b/Mathlib/LinearAlgebra/Dimension/Torsion/Basic.lean @@ -21,6 +21,7 @@ public section open Submodule +set_option backward.isDefEq.respectTransparency false in theorem rank_quotient_eq_of_le_torsion {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] {M' : Submodule R M} (hN : M' ≤ torsion R M) : Module.rank R (M ⧸ M') = Module.rank R M := (rank_quotient_le M').antisymm <| by diff --git a/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean b/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean index f9f45ce304e736..d20ee75742b565 100644 --- a/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean +++ b/Mathlib/LinearAlgebra/DirectSum/Finsupp.lean @@ -124,6 +124,7 @@ lemma finsuppRight_symm_apply_single (i : ι) (m : M) (n : N) : m ⊗ₜ[R] Finsupp.single i n := by simp [LinearEquiv.symm_apply_eq] +set_option backward.isDefEq.respectTransparency false in lemma finsuppLeft_smul' (s : S) (t : (ι →₀ M) ⊗[R] N) : finsuppLeft R S M N ι (s • t) = s • finsuppLeft R S M N ι t := by simp @@ -189,6 +190,7 @@ lemma finsuppScalarRight_symm_apply_single (i : ι) (m : M) : m ⊗ₜ[R] (Finsupp.single i 1) := by simp [finsuppScalarRight, finsuppRight_symm_apply_single] +set_option backward.isDefEq.respectTransparency false in theorem finsuppScalarRight_smul (s : S) (t) : finsuppScalarRight R S M ι (s • t) = s • finsuppScalarRight R S M ι t := by simp diff --git a/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean b/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean index c881518d4189a0..15174666a8cd4d 100644 --- a/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/DirectSum/TensorProduct.lean @@ -92,6 +92,7 @@ theorem directSum_symm_lof_tmul (i₁ : ι₁) (m₁ : M₁ i₁) (i₂ : ι₂) (DirectSum.lof S ι₁ M₁ i₁ m₁ ⊗ₜ DirectSum.lof R ι₂ M₂ i₂ m₂) := by rw [LinearEquiv.symm_apply_eq, directSum_lof_tmul_lof] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem directSumLeft_tmul_lof (i : ι₁) (x : M₁ i) (y : M₂') : directSumLeft R S M₁ M₂' (DirectSum.lof S _ _ i x ⊗ₜ[R] y) = @@ -104,6 +105,7 @@ theorem directSumLeft_symm_lof_tmul (i : ι₁) (x : M₁ i) (y : M₂') : DirectSum.lof S _ _ i x ⊗ₜ[R] y := by rw [LinearEquiv.symm_apply_eq, directSumLeft_tmul_lof] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma directSumLeft_tmul (m : ⨁ i, M₁ i) (n : M₂') (i : ι₁) : directSumLeft R S M₁ M₂' (m ⊗ₜ[R] n) i = (m i) ⊗ₜ[R] n := by @@ -116,6 +118,7 @@ lemma directSumLeft_tmul (m : ⨁ i, M₁ i) (n : M₂') (i : ι₁) : · subst hj; simp · simp [DirectSum.component.of, hj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem directSumRight_tmul_lof (x : M₁') (i : ι₂) (y : M₂ i) : directSumRight R S M₁' M₂ (x ⊗ₜ[R] DirectSum.lof R _ _ i y) = @@ -149,6 +152,7 @@ lemma directSumRight_tmul (m : M₁') (n : ⨁ i, M₂ i) (i : ι₂) : variable (S₀ : Type*) [CommSemiring S₀] [Algebra R S₀] [Algebra S₀ S] [Module S₀ M₁'] [IsScalarTower R S₀ M₁'] [IsScalarTower S₀ S M₁'] +set_option backward.isDefEq.respectTransparency false in lemma restrictScalar_directSumRight : (directSumRight R S M₁' M₂).restrictScalars S₀ = directSumRight R S₀ M₁' M₂ := LinearEquiv.restrictScalars_injective R <| LinearEquiv.toLinearMap_injective <| by ext; simp [lof] diff --git a/Mathlib/LinearAlgebra/Dual/BaseChange.lean b/Mathlib/LinearAlgebra/Dual/BaseChange.lean index 5ef30558e89e42..9375d138441363 100644 --- a/Mathlib/LinearAlgebra/Dual/BaseChange.lean +++ b/Mathlib/LinearAlgebra/Dual/BaseChange.lean @@ -84,6 +84,7 @@ theorem toDual_apply (f : Dual R V) : intro v simp [toDual_comp_apply, Algebra.algebraMap_eq_smul_one] +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in /-- The linear map underlying `IsBaseChange.toDualBaseChangeLinearEquiv`. -/ private noncomputable def toDualBaseChangeAux : @@ -98,6 +99,7 @@ private noncomputable def toDualBaseChangeAux : | add x y hx hy => aesop | tmul b f => simp [TensorProduct.smul_tmul', mul_smul] +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in private theorem toDualBaseChangeAux_tmul (a : A) (f : Dual R V) (v : V) : (ibc.toDualBaseChangeAux (a ⊗ₜ[R] f)) (j v) = a * algebraMap R A (f v) := by @@ -133,6 +135,7 @@ theorem toDualBaseChange_tmul (a : A) (f : Dual R V) (v : V) : (ibc.toDualBaseChange (a ⊗ₜ[R] f)) (j v) = a * algebraMap R A (f v) := toDualBaseChangeAux_tmul ibc a f v +set_option backward.isDefEq.respectTransparency false in theorem dual : IsBaseChange A (ibc.toDual) := by apply of_equiv (toDualBaseChange ibc) intro f diff --git a/Mathlib/LinearAlgebra/Dual/Basis.lean b/Mathlib/LinearAlgebra/Dual/Basis.lean index 8c652b22e163be..d84bde960835f0 100644 --- a/Mathlib/LinearAlgebra/Dual/Basis.lean +++ b/Mathlib/LinearAlgebra/Dual/Basis.lean @@ -57,6 +57,7 @@ theorem toDual_apply (i j : ι) : b.toDual (b i) (b j) = if i = j then 1 else 0 rw [toDual, constr_basis b, constr_basis b] simp only [eq_comm] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toDual_linearCombination_left (f : ι →₀ R) (i : ι) : b.toDual (Finsupp.linearCombination R b f) (b i) = f i := by @@ -64,6 +65,7 @@ theorem toDual_linearCombination_left (f : ι →₀ R) (i : ι) : simp_rw [map_smul, LinearMap.smul_apply, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq', Finsupp.if_mem_support] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toDual_linearCombination_right (f : ι →₀ R) (i : ι) : b.toDual (b i) (Finsupp.linearCombination R b f) = f i := by diff --git a/Mathlib/LinearAlgebra/Eigenspace/Basic.lean b/Mathlib/LinearAlgebra/Eigenspace/Basic.lean index 7dc1121ef6347e..facb0301fe54ae 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Basic.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Basic.lean @@ -74,6 +74,7 @@ def genEigenspace (f : End R M) (μ : R) : ℕ∞ →o Submodule R M where toFun k := ⨆ l : ℕ, ⨆ _ : l ≤ k, LinearMap.ker ((f - μ • 1) ^ l) monotone' _ _ hkl := biSup_mono fun _ hi ↦ hi.trans hkl +set_option backward.isDefEq.respectTransparency false in lemma mem_genEigenspace {f : End R M} {μ : R} {k : ℕ∞} {x : M} : x ∈ f.genEigenspace μ k ↔ ∃ l : ℕ, l ≤ k ∧ x ∈ LinearMap.ker ((f - μ • 1) ^ l) := by have : Nonempty {l : ℕ // l ≤ k} := ⟨⟨0, zero_le⟩⟩ @@ -105,6 +106,7 @@ lemma genEigenspace_nat {f : End R M} {μ : R} {k : ℕ} : f.genEigenspace μ k = LinearMap.ker ((f - μ • 1) ^ k) := by ext; simp [mem_genEigenspace_nat] +set_option backward.isDefEq.respectTransparency false in lemma genEigenspace_eq_iSup_genEigenspace_nat (f : End R M) (μ : R) (k : ℕ∞) : f.genEigenspace μ k = ⨆ l : {l : ℕ // l ≤ k}, f.genEigenspace μ l := by simp_rw [genEigenspace_nat, genEigenspace, OrderHom.coe_mk, iSup_subtype] @@ -274,6 +276,7 @@ meaningful. -/ noncomputable def maxUnifEigenspaceIndex (f : End R M) (μ : R) := monotonicSequenceLimitIndex <| (f.genEigenspace μ).comp <| WithTop.coeOrderHom.toOrderHom +set_option backward.isDefEq.respectTransparency false in /-- For an endomorphism of a Noetherian module, the maximal eigenspace is always of the form kernel `(f - μ • id) ^ k` for some `k`. -/ lemma genEigenspace_top_eq_maxUnifEigenspaceIndex [IsNoetherian R M] (f : End R M) (μ : R) : @@ -372,6 +375,7 @@ lemma mapsTo_genEigenspace_of_comm {f g : End R M} (h : Commute f g) (μ : R) (k rw [← LinearMap.comp_apply, ← Module.End.mul_eq_comp, h.eq, Module.End.mul_eq_comp, LinearMap.comp_apply, hx, map_zero] +set_option backward.isDefEq.respectTransparency false in /-- The restriction of `f - μ • 1` to the `k`-fold generalized `μ`-eigenspace is nilpotent. -/ lemma isNilpotent_restrict_genEigenspace_nat (f : End R M) (μ : R) (k : ℕ) (h : MapsTo (f - μ • (1 : End R M)) @@ -624,6 +628,7 @@ lemma isNilpotent_restrict_maxGenEigenspace_sub_algebraMap [IsNoetherian R M] (f _ (isNilpotent_restrict_genEigenspace_nat f μ (maxUnifEigenspaceIndex f μ)) rw [maxGenEigenspace_eq] +set_option backward.isDefEq.respectTransparency false in lemma disjoint_genEigenspace [IsDomain R] [IsTorsionFree R M] (f : End R M) {μ₁ μ₂ : R} (hμ : μ₁ ≠ μ₂) (k l : ℕ∞) : Disjoint (f.genEigenspace μ₁ k) (f.genEigenspace μ₂ l) := by @@ -735,6 +740,7 @@ theorem eigenvectors_linearIndependent [IsDomain R] [IsTorsionFree R M] (h_eigenvec : ∀ μ : μs, f.HasEigenvector μ (xs μ)) : LinearIndependent R xs := f.eigenvectors_linearIndependent' (fun μ : μs ↦ μ) Subtype.coe_injective _ h_eigenvec +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/ theorem genEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ∞) (μ : R) @@ -758,6 +764,7 @@ lemma _root_.Submodule.inf_genEigenspace (f : End R M) (p : Submodule R M) {k : (genEigenspace (LinearMap.restrict f hfp) μ k).map p.subtype := by rw [f.genEigenspace_restrict _ _ _ hfp, Submodule.map_comap_eq, Submodule.range_subtype] +set_option backward.isDefEq.respectTransparency false in lemma mapsTo_restrict_maxGenEigenspace_restrict_of_mapsTo {p : Submodule R M} (f g : End R M) (hf : MapsTo f p p) (hg : MapsTo g p p) {μ₁ μ₂ : R} (h : MapsTo f (g.maxGenEigenspace μ₁) (g.maxGenEigenspace μ₂)) : diff --git a/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean b/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean index 595b618e461c91..7f9b7cc5c7a720 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Matrix.lean @@ -89,6 +89,7 @@ lemma iSup_eigenspace_toLin'_diagonal_eq_top : ⨆ μ, eigenspace (diagonal d).toLin' μ = ⊤ := iSup_eigenspace_toLin_diagonal_eq_top d <| Pi.basisFun R n +set_option backward.isDefEq.respectTransparency false in @[simp] lemma maxGenEigenspace_toLin_diagonal_eq_eigenspace [IsDomain R] : maxGenEigenspace ((diagonal d).toLin b b) μ = eigenspace ((diagonal d).toLin b b) μ := by diff --git a/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean b/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean index e3e6ed43a718f9..404843b420bb82 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean @@ -97,6 +97,7 @@ theorem hasEigenvalue_iff_isRoot : f.HasEigenvalue μ ↔ (minpoly R f).IsRoot variable (f) +set_option backward.isDefEq.respectTransparency.types false in lemma finite_hasEigenvalue : Set.Finite f.HasEigenvalue := by have h : minpoly R f ≠ 0 := minpoly.ne_zero (Algebra.IsIntegral.isIntegral (R := R) f) convert! (minpoly R f).rootSet_finite R @@ -136,6 +137,7 @@ end Module section FiniteSpectrum +set_option backward.isDefEq.respectTransparency.types false in /-- An endomorphism of a finite-dimensional vector space has a finite spectrum. -/ theorem Module.End.finite_spectrum {K : Type v} {V : Type w} [Field K] [AddCommGroup V] [Module K V] [FiniteDimensional K V] (f : Module.End K V) : diff --git a/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean b/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean index 64142e4c03f3db..a271192e6211b6 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Semisimple.lean @@ -34,6 +34,7 @@ namespace Module.End variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] {f g : End R M} +set_option backward.isDefEq.respectTransparency.types false in lemma apply_eq_of_mem_of_comm_of_isFinitelySemisimple_of_isNil {μ : R} {k : ℕ∞} {m : M} (hm : m ∈ f.genEigenspace μ k) (hfg : Commute f g) (hss : g.IsFinitelySemisimple) (hnil : IsNilpotent (f - g)) : diff --git a/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean b/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean index 909bb28e8236b7..0b7b8bd08ee2eb 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean @@ -142,6 +142,7 @@ namespace Submodule variable {p : Submodule K V} {f : Module.End K V} +set_option backward.isDefEq.respectTransparency.types false in theorem inf_iSup_genEigenspace [FiniteDimensional K V] (h : ∀ x ∈ p, f x ∈ p) (k : ℕ∞) : p ⊓ ⨆ μ, f.genEigenspace μ k = ⨆ μ, p ⊓ f.genEigenspace μ k := by refine le_antisymm (fun m hm ↦ ?_) diff --git a/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean b/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean index ee7293cc18b41c..871394de762e87 100644 --- a/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean +++ b/Mathlib/LinearAlgebra/ExteriorPower/Basic.lean @@ -179,6 +179,7 @@ noncomputable def relationsSolutionEquiv {ι : Type*} [DecidableEq ι] {M : Type · simp · simpa using f.map_eq_zero_of_eq v hm hij } +set_option backward.isDefEq.respectTransparency.types false in /-- The universal property of the exterior power. -/ noncomputable def isPresentationCore : (relationsSolutionEquiv.symm (ιMulti R n (M := M))).IsPresentationCore where diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean index ee2d03392f3e52..ee25b41dd3de56 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean @@ -124,6 +124,7 @@ theorem exists_relation_sum_zero_pos_coefficient_of_finrank_succ_lt_card [Finite end +set_option backward.isDefEq.respectTransparency false in /-- In a vector space with dimension 1, each set `{v}` is a basis for `v ≠ 0`. -/ @[simps repr_apply] noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V) @@ -147,6 +148,7 @@ noncomputable def basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) RingHom.id_apply, smul_eq_mul, Pi.smul_apply] exact mul_div_cancel_right₀ _ h } +set_option backward.isDefEq.respectTransparency false in @[simp] theorem basisSingleton_apply (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V) (hv : v ≠ 0) (i : ι) : basisSingleton ι h v hv i = v := by @@ -510,7 +512,7 @@ lemma FiniteDimensional.exists_mul_eq_one (F : Type*) {K : Type*} [Field F] [Rin exact this 1 /-- A domain that is module-finite as an algebra over a field is a division ring. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def divisionRingOfFiniteDimensional (F K : Type*) [Field F] [Ring K] [IsDomain K] [Algebra F K] [FiniteDimensional F K] : DivisionRing K where __ := ‹IsDomain K› @@ -531,7 +533,7 @@ lemma FiniteDimensional.isUnit (F : Type*) {K : Type*} [Field F] [Ring K] [IsDom let _ := divisionRingOfFiniteDimensional F K; H.isUnit /-- An integral domain that is module-finite as an algebra over a field is a field. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fieldOfFiniteDimensional (F K : Type*) [Field F] [h : CommRing K] [IsDomain K] [Algebra F K] [FiniteDimensional F K] : Field K := { divisionRingOfFiniteDimensional F K with diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean index 04ec06610c7c8a..36d8240417d671 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Defs.lean @@ -108,7 +108,7 @@ theorem _root_.Module.Basis.finiteDimensional_of_finite {ι : Type w} [Finite ι Module.Finite.of_basis h /-- If a vector space is `FiniteDimensional`, all bases are indexed by a finite type -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeBasisIndex {ι : Type*} [FiniteDimensional K V] (b : Basis ι K V) : Fintype ι := @Fintype.ofFinite _ (Module.Finite.finite_basis b) diff --git a/Mathlib/LinearAlgebra/FiniteSpan.lean b/Mathlib/LinearAlgebra/FiniteSpan.lean index 97be471f0fb99c..bf11e98548a74e 100644 --- a/Mathlib/LinearAlgebra/FiniteSpan.lean +++ b/Mathlib/LinearAlgebra/FiniteSpan.lean @@ -20,6 +20,7 @@ public section open Set Function open Submodule (span) +set_option backward.isDefEq.respectTransparency false in /-- A linear equivalence which preserves a finite spanning set must have finite order. -/ lemma LinearEquiv.isOfFinOrder_of_finite_of_span_eq_top_of_mapsTo {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] diff --git a/Mathlib/LinearAlgebra/Finsupp/LSum.lean b/Mathlib/LinearAlgebra/Finsupp/LSum.lean index 8c750fbab1c821..d910e7ca703258 100644 --- a/Mathlib/LinearAlgebra/Finsupp/LSum.lean +++ b/Mathlib/LinearAlgebra/Finsupp/LSum.lean @@ -89,6 +89,7 @@ section LSum variable (S) variable [Module S N] [SMulCommClass R₂ S N] +set_option backward.isDefEq.respectTransparency false in /-- Lift a family of linear maps `M →ₗ[R] N` indexed by `x : α` to a linear map from `α →₀ M` to `N` using `Finsupp.sum`. This is an upgraded version of `Finsupp.liftAddHom`. diff --git a/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean b/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean index 925148ef6dc70f..a1610642fa82e8 100644 --- a/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean +++ b/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean @@ -250,6 +250,7 @@ theorem linearCombinationOn_range (s : Set α) : range_subtype] exact (span_image_eq_map_linearCombination _ _).le +set_option backward.isDefEq.respectTransparency false in theorem linearCombination_restrict (s : Set α) : linearCombination R (s.restrict v) = Submodule.subtype _ ∘ₗ linearCombinationOn α M R v s ∘ₗ (supportedEquivFinsupp s).symm.toLinearMap := by diff --git a/Mathlib/LinearAlgebra/Finsupp/Pi.lean b/Mathlib/LinearAlgebra/Finsupp/Pi.lean index 53c2c596785cfe..ac87085093bc8c 100644 --- a/Mathlib/LinearAlgebra/Finsupp/Pi.lean +++ b/Mathlib/LinearAlgebra/Finsupp/Pi.lean @@ -63,6 +63,7 @@ theorem LinearEquiv.finsuppUnique_apply (α : Type*) [Unique α] (f : α →₀ LinearEquiv.finsuppUnique R M α f = f default := rfl +set_option backward.isDefEq.respectTransparency.types false in set_option linter.deprecated false in @[deprecated uniqueLinearEquiv_symm_apply (since := "2026-05-06")] theorem LinearEquiv.finsuppUnique_symm_apply (α : Type*) [Unique α] (m : M) : diff --git a/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean b/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean index 5193b3d60d253c..ffe81886d5b94e 100644 --- a/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean +++ b/Mathlib/LinearAlgebra/Finsupp/VectorSpace.lean @@ -148,6 +148,7 @@ lemma linearIndependent_single_of_ne_zero [IsDomain R] [Module R M] [IsTorsionFr rw [← linearIndependent_equiv (Equiv.sigmaPUnit ι)] exact linearIndependent_single (f := fun i (_ : Unit) ↦ v i) <| by simp +contextual [hv] +set_option backward.isDefEq.respectTransparency false in lemma lcomapDomain_eq_linearProjOfIsCompl {α β : Type*} {u : α → ι} {v : β → ι} (hu : u.Injective) (h : IsCompl (Set.range u) (Set.range v)) : lcomapDomain u hu = diff --git a/Mathlib/LinearAlgebra/FixedSubmodule.lean b/Mathlib/LinearAlgebra/FixedSubmodule.lean index 7c2f16459b9abf..95824678c59e01 100644 --- a/Mathlib/LinearAlgebra/FixedSubmodule.lean +++ b/Mathlib/LinearAlgebra/FixedSubmodule.lean @@ -104,6 +104,7 @@ theorem map_eq_of_mem_fixingSubgroup (W : Submodule R V) variable {R V : Type*} [Ring R] [AddCommGroup V] [Module R V] +set_option backward.isDefEq.respectTransparency false in /-- When `u : V ≃ₗ[R] V` maps a submodule `W` into itself, this is the induced linear equivalence of `V ⧸ W`, as a group homomorphism. -/ def reduce (W : Submodule R V) : stabilizer (V ≃ₗ[R] V) W →* (V ⧸ W) ≃ₗ[R] (V ⧸ W) where diff --git a/Mathlib/LinearAlgebra/FreeModule/Basic.lean b/Mathlib/LinearAlgebra/FreeModule/Basic.lean index 4e9d8b89e6b7bf..5c47077d9ce7c4 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Basic.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Basic.lean @@ -178,6 +178,7 @@ open Finset variable {S : Type*} [CommRing R] [Ring S] [Algebra R S] +set_option backward.isDefEq.respectTransparency false in variable {R} in /-- If `B` is a basis of the `R`-algebra `S` such that `B i = 1` for some index `i`, then each `r : R` gets represented as `s • B i` as an element of `S`. -/ diff --git a/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean b/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean index 49c112d32c4a6e..d553504c27f687 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Finite/CardQuotient.lean @@ -110,6 +110,7 @@ theorem AddSubgroup.relIndex_eq_natAbs_det {E : Type*} [AddCommGroup E] rw [relIndex, index_eq_natAbs_det b₂ _ (b₁.map (addSubgroupOfEquivOfLe H).toIntLinearEquiv.symm)] rfl +set_option backward.isDefEq.respectTransparency false in theorem AddSubgroup.relIndex_eq_abs_det {E : Type*} [AddCommGroup E] [Module ℚ E] (L₁ L₂ : AddSubgroup E) (H : L₁ ≤ L₂) {ι : Type*} [DecidableEq ι] [Fintype ι] (b₁ b₂ : Basis ι ℚ E) (h₁ : L₁ = .closure (Set.range b₁)) (h₂ : L₂ = .closure (Set.range b₂)) : diff --git a/Mathlib/LinearAlgebra/FreeModule/Int.lean b/Mathlib/LinearAlgebra/FreeModule/Int.lean index f48d41c34c3581..4edf34a66dda0f 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Int.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Int.lean @@ -26,6 +26,7 @@ namespace Module.Basis.SmithNormalForm variable [Fintype ι] +set_option backward.isDefEq.respectTransparency false in /-- Given a submodule `N` in Smith normal form of a free `R`-module, its index as an additive subgroup is an appropriate power of the cardinality of `R` multiplied by the product of the indexes of the ideals generated by each basis vector. -/ diff --git a/Mathlib/LinearAlgebra/FreeModule/PID.lean b/Mathlib/LinearAlgebra/FreeModule/PID.lean index 52b563a86523fb..708fb3aba41803 100644 --- a/Mathlib/LinearAlgebra/FreeModule/PID.lean +++ b/Mathlib/LinearAlgebra/FreeModule/PID.lean @@ -138,6 +138,7 @@ theorem generator_maximal_submoduleImage_dvd {N O : Submodule R M} (hNO : N ≤ variable [IsDomain R] +set_option backward.isDefEq.respectTransparency false in /-- The induction hypothesis of `Submodule.basisOfPid` and `Submodule.smithNormalForm`. Basically, it says: let `N ≤ M` be a pair of submodules, then we can find a pair of @@ -421,6 +422,7 @@ namespace Module.Basis.SmithNormalForm variable {n : ℕ} {N : Submodule R M} (snf : Basis.SmithNormalForm N ι n) (m : N) +set_option backward.isDefEq.respectTransparency false in lemma repr_eq_zero_of_notMem_range {i : ι} (hi : i ∉ Set.range snf.f) : snf.bM.repr m i = 0 := by obtain ⟨m, hm⟩ := m @@ -432,6 +434,7 @@ lemma le_ker_coord_of_notMem_range {i : ι} (hi : i ∉ Set.range snf.f) : N ≤ LinearMap.ker (snf.bM.coord i) := fun m hm ↦ snf.repr_eq_zero_of_notMem_range ⟨m, hm⟩ hi +set_option backward.isDefEq.respectTransparency false in @[simp] lemma repr_apply_embedding_eq_repr_smul {i : Fin n} : snf.bM.repr m (snf.f i) = snf.bN.repr (snf.a i • m) i := by obtain ⟨m, hm⟩ := m @@ -447,11 +450,13 @@ lemma le_ker_coord_of_notMem_range {i : ι} (hi : i ∉ Set.range snf.f) : Finsupp.mem_support_iff, ite_not, mul_comm, ite_eq_right_iff] exact fun a ↦ (mul_eq_zero_of_right _ a).symm +set_option backward.isDefEq.respectTransparency false in @[simp] lemma repr_comp_embedding_eq_smul : snf.bM.repr m ∘ snf.f = snf.a • (snf.bN.repr m : Fin n → R) := by ext i simp [Pi.smul_apply (snf.a i)] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma coord_apply_embedding_eq_smul_coord {i : Fin n} : snf.bM.coord (snf.f i) ∘ₗ N.subtype = snf.a i • snf.bN.coord i := by ext m diff --git a/Mathlib/LinearAlgebra/FreeProduct/Basic.lean b/Mathlib/LinearAlgebra/FreeProduct/Basic.lean index 48423cfb9ad65b..22d38b28e86fc3 100644 --- a/Mathlib/LinearAlgebra/FreeProduct/Basic.lean +++ b/Mathlib/LinearAlgebra/FreeProduct/Basic.lean @@ -211,6 +211,7 @@ irreducible_def ι (i : I) : A i →ₐ[R] FreeProduct R A := irreducible_def of {i : I} : A i →ₐ[R] FreeProduct R A := ι R A i +set_option backward.isDefEq.respectTransparency false in /-- Universal property of the free product of algebras: for every `R`-algebra `B`, every family of maps `maps : (i : I) → (A i →ₐ[R] B)` lifts to a unique arrow `π` from `FreeProduct R A` such that `π ∘ ι i = maps i`. -/ @@ -232,6 +233,7 @@ to a unique arrow `π` from `FreeProduct R A` such that `π ∘ ι i = maps i`. ext i a aesop (add simp [ι, ι']) +set_option backward.isDefEq.respectTransparency false in /-- Universal property of the free product of algebras, property: for every `R`-algebra `B`, every family of maps `maps : (i : I) → (A i →ₐ[R] B)` lifts to a unique arrow `π` from `FreeProduct R A` such that `π ∘ ι i = maps i`. -/ @@ -242,6 +244,7 @@ to a unique arrow `π` from `FreeProduct R A` such that `π ∘ ι i = maps i`. @[simp↓] theorem lift_algebraMap (r : R) : lift R A maps (algebraMap R _ r) = algebraMap R _ r := by rw [lift_apply, AlgHom.commutes] +set_option backward.isDefEq.respectTransparency false in @[aesop safe destruct] theorem lift_unique (f : FreeProduct R A →ₐ[R] B) (h : ∀ i, f ∘ₐ ι R A i = maps) : f = lift R A maps := by diff --git a/Mathlib/LinearAlgebra/GeneralLinearGroup/AlgEquiv.lean b/Mathlib/LinearAlgebra/GeneralLinearGroup/AlgEquiv.lean index fa47df6f0fe93a..27ba036b5d0b88 100644 --- a/Mathlib/LinearAlgebra/GeneralLinearGroup/AlgEquiv.lean +++ b/Mathlib/LinearAlgebra/GeneralLinearGroup/AlgEquiv.lean @@ -28,6 +28,7 @@ open Module LinearMap LinearEquiv variable {K V W : Type*} [Semifield K] [AddCommMonoid V] [Module K V] [Projective K V] [AddCommMonoid W] [Module K W] [Projective K W] +set_option backward.isDefEq.respectTransparency false in /-- Given an algebra isomorphism `f : End K V ≃ₐ[K] End K W`, there exists a linear isomorphism `T` such that `f` is given by `x ↦ T ∘ₗ x ∘ₗ T.symm`. -/ public theorem AlgEquiv.eq_linearEquivConjAlgEquiv (f : End K V ≃ₐ[K] End K W) : diff --git a/Mathlib/LinearAlgebra/Isomorphisms.lean b/Mathlib/LinearAlgebra/Isomorphisms.lean index 578dbff5593052..593c0d47e65f79 100644 --- a/Mathlib/LinearAlgebra/Isomorphisms.lean +++ b/Mathlib/LinearAlgebra/Isomorphisms.lean @@ -155,6 +155,7 @@ namespace Submodule variable (S T : Submodule R M) (h : S ≤ T) +set_option backward.isDefEq.respectTransparency false in /-- The map from the third isomorphism theorem for modules: `(M / S) / (T / S) → M / T`. -/ def quotientQuotientEquivQuotientAux (h : S ≤ T) : (M ⧸ S) ⧸ T.map S.mkQ →ₗ[R] M ⧸ T := liftQ _ (mapQ S T LinearMap.id h) @@ -172,6 +173,7 @@ theorem quotientQuotientEquivQuotientAux_mk (x : M ⧸ S) : theorem quotientQuotientEquivQuotientAux_mk_mk (x : M) : quotientQuotientEquivQuotientAux S T h (Quotient.mk (Quotient.mk x)) = Quotient.mk x := rfl +set_option backward.isDefEq.respectTransparency false in /-- **Noether's third isomorphism theorem** for modules: `(M / S) / (T / S) ≃ M / T`. -/ def quotientQuotientEquivQuotient : ((M ⧸ S) ⧸ T.map S.mkQ) ≃ₗ[R] M ⧸ T := { quotientQuotientEquivQuotientAux S T h with diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean b/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean index 4ed7daffa65bde..d0b62dfa121801 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean @@ -294,6 +294,7 @@ theorem surjective_of_linearIndependent_of_span [Nontrivial R] (hv : LinearIndep use i' exact hi'.2 +set_option backward.isDefEq.respectTransparency false in theorem eq_of_linearIndepOn_id_of_span_subtype [Nontrivial R] {s t : Set M} (hs : LinearIndepOn R id s) (h : t ⊆ s) (hst : s ⊆ span R t) : s = t := by let f : t ↪ s := diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean b/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean index 3c442a78e950be..b005a41f02329a 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean @@ -298,6 +298,7 @@ theorem linearIndependent_iff_finset_linearIndependent : Fintype.linearIndependent_iffₛ.1 (H s) (f ∘ Subtype.val) (g ∘ Subtype.val) (by simpa only [← s.sum_coe_sort] using! eq) ⟨i, hi⟩⟩ +set_option backward.isDefEq.respectTransparency false in lemma linearIndepOn_iff_linearIndepOn_finset : LinearIndepOn R v s ↔ ∀ t : Finset ι, ↑t ⊆ s → LinearIndepOn R v t where mp hv t hts := hv.mono hts @@ -663,6 +664,7 @@ theorem Fintype.not_linearIndependent_iffₒₛ [DecidableEq ι] [Fintype ι] : · refine ⟨tᶜ, f, ?_, i, Finset.mem_compl.2 hi', hfi⟩ simp [heq] +set_option backward.isDefEq.respectTransparency false in lemma linearIndepOn_finset_iffₒₛ [DecidableEq ι] {s : Finset ι} : LinearIndepOn R v s ↔ ∀ t ⊆ s, ∀ (f : ι → R), ∑ i ∈ t, f i • v i = ∑ i ∈ s \ t, f i • v i → ∀ i ∈ s, f i = 0 := by diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean b/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean index 72d202fb91cc25..8e3a1d13579002 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean @@ -478,6 +478,7 @@ lemma linearIndependent_algHom_toLinearMap' (K M L) [CommRing K] [IsDomain K] LinearIndependent K (AlgHom.toLinearMap : (M →ₐ[K] L) → M →ₗ[K] L) := (linearIndependent_algHom_toLinearMap K M L).restrict_scalars' K +set_option backward.isDefEq.respectTransparency false in lemma LinearMap.injective_of_linearIndependent {N : Type*} [AddCommGroup N] [Module R N] {f : M →ₗ[R] N} {ι : Type*} {v : ι → M} (hv : Submodule.span R (.range v) = ⊤) (hli : LinearIndependent R (f ∘ v)) : diff --git a/Mathlib/LinearAlgebra/LinearPMap.lean b/Mathlib/LinearAlgebra/LinearPMap.lean index 236586e4664d36..b314e097a396a6 100644 --- a/Mathlib/LinearAlgebra/LinearPMap.lean +++ b/Mathlib/LinearAlgebra/LinearPMap.lean @@ -542,6 +542,7 @@ theorem domain_supSpanSingleton (f : E →ₛₗ.[σ] F) (x : E) (y : F) (hx : x (f.supSpanSingleton x y hx).domain = f.domain ⊔ K ∙ x := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem supSpanSingleton_apply_mk (f : E →ₛₗ.[σ] F) (x : E) (y : F) (hx : x ∉ f.domain) (x' : E) (hx' : x' ∈ f.domain) (c : K) : @@ -565,6 +566,7 @@ theorem supSpanSingleton_apply_self (f : E →ₛₗ.[σ] F) {x : E} (y : F) (hx f.supSpanSingleton x y hx ⟨x, mem_sup_right <| mem_span_singleton_self _⟩ = y := by simpa using supSpanSingleton_apply_smul_self f y hx 1 +set_option backward.isDefEq.respectTransparency.types false in theorem supSpanSingleton_apply_of_mem (f : E →ₛₗ.[σ] F) {x : E} (y : F) (hx : x ∉ f.domain) (x' : (f.supSpanSingleton x y hx).domain) (hx' : (x' : E) ∈ f.domain) : f.supSpanSingleton x y hx x' = f ⟨x', hx'⟩ := by @@ -965,6 +967,7 @@ theorem mem_graph_toLinearPMap {g : Submodule R (E × F)} rw [toLinearPMap_apply_aux hg] exact valFromGraph_mem hg x.2 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem toLinearPMap_graph_eq (g : Submodule R (E × F)) (hg : ∀ (x : E × F) (_hx : x ∈ g) (_hx' : x.fst = 0), x.snd = 0) : diff --git a/Mathlib/LinearAlgebra/Matrix/Basis.lean b/Mathlib/LinearAlgebra/Matrix/Basis.lean index d747e568327aab..4bbd652b78d98d 100644 --- a/Mathlib/LinearAlgebra/Matrix/Basis.lean +++ b/Mathlib/LinearAlgebra/Matrix/Basis.lean @@ -83,6 +83,7 @@ theorem toMatrix_update [DecidableEq ι'] (x : M) : · rw [h, update_self j x v] · rw [update_of_ne h] +set_option backward.isDefEq.respectTransparency false in /-- The basis constructed by `unitsSMul` has vectors given by a diagonal matrix. -/ @[simp] theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) : @@ -257,7 +258,7 @@ theorem toMatrix_mul_toMatrix_flip [DecidableEq ι] [Fintype ι'] : b.toMatrix b' * b'.toMatrix b = 1 := by rw [toMatrix_mul_toMatrix, toMatrix_self] /-- A matrix whose columns form a basis `b'`, expressed w.r.t. a basis `b`, is invertible. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleToMatrix [DecidableEq ι] [Fintype ι] (b b' : Basis ι R₂ M₂) : Invertible (b.toMatrix b') := ⟨b'.toMatrix b, toMatrix_mul_toMatrix_flip _ _, toMatrix_mul_toMatrix_flip _ _⟩ diff --git a/Mathlib/LinearAlgebra/Matrix/Block.lean b/Mathlib/LinearAlgebra/Matrix/Block.lean index 33723314f1fcab..6a18a61eff7a8e 100644 --- a/Mathlib/LinearAlgebra/Matrix/Block.lean +++ b/Mathlib/LinearAlgebra/Matrix/Block.lean @@ -247,7 +247,8 @@ theorem equiv_block_det (M : Matrix m m R) {p q : m → Prop} [DecidablePred p] -- Removed `@[simp]` attribute, -- as the LHS simplifies already to `M.toSquareBlock id i ⟨i, ⋯⟩ ⟨i, ⋯⟩` -theorem det_toSquareBlock_id (M : Matrix m m R) (i : m) : (M.toSquareBlock id i).det = M i i := +theorem det_toSquareBlock_id (M : Matrix m m R) (i : m) : + (M.toSquareBlock id i).det = M i i := letI : Unique { a // id a = i } := ⟨⟨⟨i, rfl⟩⟩, fun j => Subtype.ext j.property⟩ (det_unique _).trans rfl @@ -375,7 +376,7 @@ theorem BlockTriangular.inv_toBlock [LinearOrder α] [Invertible M] (hM : BlockT inv_eq_left_inv <| hM.toBlock_inverse_mul_toBlock_eq_one k /-- An upper-left subblock of an invertible block-triangular matrix is invertible. -/ -@[implicit_reducible] +@[instance_reducible] def BlockTriangular.invertibleToBlock [LinearOrder α] [Invertible M] (hM : BlockTriangular M b) (k : α) : Invertible (M.toBlock (fun i => b i < k) fun i => b i < k) := invertibleOfLeftInverse _ ((⅟M).toBlock (fun i => b i < k) fun i => b i < k) <| by diff --git a/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean b/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean index bb576bab423ae3..6b4614ce1fcb6b 100644 --- a/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean +++ b/Mathlib/LinearAlgebra/Matrix/Determinant/Basic.lean @@ -606,6 +606,7 @@ theorem det_eq_of_forall_col_eq_smul_add_pred {n : ℕ} {A B : Matrix (Fin (n + end DetEq +set_option backward.isDefEq.respectTransparency false in @[simp] theorem det_blockDiagonal {o : Type*} [Fintype o] [DecidableEq o] (M : o → Matrix n n R) : (blockDiagonal M).det = ∏ k, (M k).det := by @@ -665,6 +666,7 @@ theorem det_blockDiagonal {o : Type*} [Fintype o] [DecidableEq o] (M : o → Mat rw [blockDiagonal_apply_ne] exact hkx +set_option backward.isDefEq.respectTransparency false in /-- The determinant of a 2×2 block matrix with the lower-left block equal to zero is the product of the determinants of the diagonal blocks. For the generalization to any number of blocks, see `Matrix.det_of_upperTriangular`. -/ diff --git a/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean b/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean index c075db0faa1a25..69de68bcf32c58 100644 --- a/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean +++ b/Mathlib/LinearAlgebra/Matrix/Determinant/Misc.lean @@ -22,6 +22,7 @@ namespace Matrix variable {R : Type*} [CommRing R] +set_option backward.isDefEq.respectTransparency false in /-- Let `M` be a `(n+1) × n` matrix whose row sums to zero. Then all the matrices obtained by deleting one row have the same determinant up to a sign. -/ theorem submatrix_succAbove_det_eq_negOnePow_submatrix_succAbove_det {n : ℕ} @@ -52,6 +53,7 @@ theorem submatrix_succAbove_det_eq_negOnePow_submatrix_succAbove_det {n : ℕ} Fin.succAbove_of_succ_le _ _ (Fin.succ_lt_succ_iff.mpr h).le] · rw [Fin.succAbove_succ_of_lt _ _ h, Fin.succAbove_castSucc_of_le _ _ h.le] +set_option backward.isDefEq.respectTransparency false in /-- Let `M` be a `(n+1) × n` matrix whose column sums to zero. Then all the matrices obtained by deleting one column have the same determinant up to a sign. -/ theorem submatrix_succAbove_det_eq_negOnePow_submatrix_succAbove_det' {n : ℕ} @@ -64,6 +66,7 @@ theorem submatrix_succAbove_det_eq_negOnePow_submatrix_succAbove_det' {n : ℕ} ext simp_rw [Finset.sum_apply, transpose_apply, hv, Pi.zero_apply] +set_option backward.isDefEq.respectTransparency false in /-- Let `M` be a `(n+1) × (n+1)` matrix. Assume that all columns, but the `j₀`-column, sums to zero. Then its determinant is, up to sign, the sum of the `j₀`-column times the determinant of the matrix obtained by deleting any row and the `j₀`-column. -/ diff --git a/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean b/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean index 26dda03ca30597..722bcfe58c88a3 100644 --- a/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean +++ b/Mathlib/LinearAlgebra/Matrix/Determinant/TotallyUnimodular.lean @@ -102,6 +102,7 @@ lemma reindex_isTotallyUnimodular (A : Matrix m n R) (em : m ≃ m') (en : n ≃ ⟨fun hA => by simpa [Equiv.symm_apply_eq] using hA.reindex em.symm en.symm, fun hA => hA.reindex _ _⟩ +set_option backward.isDefEq.respectTransparency false in /-- If `A` has no rows, then it is totally unimodular. -/ @[simp] lemma emptyRows_isTotallyUnimodular [IsEmpty m] (A : Matrix m n R) : @@ -117,6 +118,7 @@ lemma emptyCols_isTotallyUnimodular [IsEmpty n] (A : Matrix m n R) : A.IsTotallyUnimodular := A.transpose.emptyRows_isTotallyUnimodular.transpose +set_option backward.isDefEq.respectTransparency false in /-- If `A` is totally unimodular and each row of `B` is all zeros except for at most a single `1` or a single `-1` then `fromRows A B` is totally unimodular. -/ lemma IsTotallyUnimodular.fromRows_unitlike [DecidableEq n] {A : Matrix m n R} {B : Matrix m' n R} diff --git a/Mathlib/LinearAlgebra/Matrix/Dual.lean b/Mathlib/LinearAlgebra/Matrix/Dual.lean index 869b2e3ad83f1a..7cca7027e5c97e 100644 --- a/Mathlib/LinearAlgebra/Matrix/Dual.lean +++ b/Mathlib/LinearAlgebra/Matrix/Dual.lean @@ -45,6 +45,7 @@ theorem Matrix.toLin_transpose (M : Matrix ι₁ ι₂ K) : Matrix.toLin B₁.du end Transpose +set_option backward.isDefEq.respectTransparency false in /-- The dot product as a linear equivalence to the dual. -/ @[simps] def dotProductEquiv (R n : Type*) [CommSemiring R] [Fintype n] [DecidableEq n] : (n → R) ≃ₗ[R] Module.Dual R (n → R) where diff --git a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean index 3eae7751699643..8278edc557a2b2 100644 --- a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean +++ b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean @@ -51,6 +51,7 @@ lemma smul_def (m : R) (g : SpecialLinearGroup n R) (A : (FixedDetMatrix n R m)) g • A = ⟨g * A.1, by simp only [det_mul, SpecialLinearGroup.det_coe, A.2, one_mul]⟩ := rfl +set_option backward.isDefEq.respectTransparency false in instance (m : R) : MulAction (SpecialLinearGroup n R) (FixedDetMatrix n R m) where one_smul b := by rw [smul_def]; simp only [coe_one, one_mul, Subtype.coe_eta] mul_smul x y b := by simp_rw [smul_def, ← mul_assoc, coe_mul] @@ -164,6 +165,7 @@ noncomputable instance repsFintype (k : ℤ) : Fintype (reps k) := by ext i j simpa only [Subtype.mk.injEq] using congrFun₂ h i j +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma S_smul_four (A : Δ m) : S • S • S • S • A = A := by simp only [smul_def, ← mul_assoc, S_mul_S_eq, neg_mul, one_mul, mul_neg, neg_neg, Subtype.coe_eta] @@ -172,6 +174,7 @@ lemma S_smul_four (A : Δ m) : S • S • S • S • A = A := by lemma T_S_rel_smul (A : Δ m) : S • S • S • T • S • T • S • A = T⁻¹ • A := by simp_rw [← T_S_rel, ← smul_assoc] +set_option backward.isDefEq.respectTransparency false in lemma reduce_mem_reps {m : ℤ} (hm : m ≠ 0) (A : Δ m) : reduce A ∈ reps m := by induction A using reduce_rec with | step A h1 h2 => simpa only [reduce_reduceStep h1] using h2 diff --git a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Projective.lean b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Projective.lean index 5127ad2bb5304d..6558b69d387e0f 100644 --- a/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Projective.lean +++ b/Mathlib/LinearAlgebra/Matrix/GeneralLinearGroup/Projective.lean @@ -81,7 +81,7 @@ theorem lift_comp_mk {f : GL n R →* M} (hf) : (lift f hf).comp mk = f := by /-- Given an action of `GL n R` such that the scalar matrices act trivially, define an action of `PGL n R`. -/ -@[implicit_reducible] +@[instance_reducible] def mulActionOfGL {α : Type*} [MulAction (GL n R) α] (h : ∀ (u : Rˣ) (a : α), GeneralLinearGroup.scalar n u • a = a) : MulAction (PGL(n, R)) α := diff --git a/Mathlib/LinearAlgebra/Matrix/Hadamard.lean b/Mathlib/LinearAlgebra/Matrix/Hadamard.lean index 084efc89a15b7e..2eb9a3e4f0cd1f 100644 --- a/Mathlib/LinearAlgebra/Matrix/Hadamard.lean +++ b/Mathlib/LinearAlgebra/Matrix/Hadamard.lean @@ -193,6 +193,7 @@ variable (R) [NonUnitalSemiring α] theorem sum_hadamard_eq : (∑ i : m, ∑ j : n, (A ⊙ B) i j) = trace (A * Bᵀ) := rfl +set_option backward.isDefEq.respectTransparency false in theorem dotProduct_vecMul_hadamard [DecidableEq m] [DecidableEq n] (v : m → α) (w : n → α) : v ᵥ* (A ⊙ B) ⬝ᵥ w = trace (diagonal v * A * (B * diagonal w)ᵀ) := by rw [← sum_hadamard_eq, Finset.sum_comm] diff --git a/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean b/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean index 7fc5956245a24c..ff223f9dc9ef87 100644 --- a/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean +++ b/Mathlib/LinearAlgebra/Matrix/InvariantBasisNumber.lean @@ -53,6 +53,7 @@ theorem invariantBasisNumber_iff_matrix : InvariantBasisNumber R ↔ ∀ n m h (toLinearEquivRight'OfInv hfg hgf).symm) fun h n m e ↦ h n m (toMatrixRight' e) (toMatrixRight' e.symm) (by simp [← toMatrixRight'_comp]) (by simp [← toMatrixRight'_comp]) +set_option backward.isDefEq.respectTransparency false in /-- The rank condition is left-right symmetric. Note that the strong rank condition is not left-right symmetric, see Remark (1.32) in §1.1D of [lam_1999]. -/ protected theorem MulOpposite.rankCondition_iff : RankCondition Rᵐᵒᵖ ↔ RankCondition R := by @@ -66,6 +67,7 @@ protected theorem MulOpposite.rankCondition_iff : RankCondition Rᵐᵒᵖ ↔ R · ext; simp [map, mul_apply] · simp +set_option backward.isDefEq.respectTransparency false in /-- Invariant basis number is left-right symmetric. -/ protected theorem MulOpposite.invariantBasisNumber_iff : InvariantBasisNumber Rᵐᵒᵖ ↔ InvariantBasisNumber R := by diff --git a/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean b/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean index 550c4f6b503a3d..bee16910ace3db 100644 --- a/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean +++ b/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean @@ -73,7 +73,7 @@ variable {n R : Type*} [Ring R] [LinearOrder R] /-- The directed graph (quiver) associated with a matrix `A`, with an edge `i ⟶ j` iff `0 < A i j`. -/ -@[implicit_reducible] +@[instance_reducible] def toQuiver (A : Matrix n n R) : Quiver n := ⟨fun i j => PLift (0 < A i j)⟩ @@ -201,6 +201,7 @@ def transposePath {i j : n} (p : @Quiver.Path n A.toQuiver i j) : exact (@Quiver.Path.comp n (toQuiver Aᵀ) c b i (@Quiver.Hom.toPath n (toQuiver Aᵀ) c b (PLift.up eT)) ih) +set_option backward.isDefEq.respectTransparency false in /-- Irreducibility is invariant under transpose. -/ theorem IsIrreducible.transpose (hA : IsIrreducible A) : IsIrreducible Aᵀ := by have hA_T_nonneg : ∀ i j, 0 ≤ Aᵀ i j := fun i j => by diff --git a/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean b/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean index a87d7dce5146b7..137231d9e57cd1 100644 --- a/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean +++ b/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean @@ -75,7 +75,7 @@ variable [Fintype n] [DecidableEq n] [CommRing α] variable (A : Matrix n n α) (B : Matrix n n α) /-- If `A.det` has a constructive inverse, produce one for `A`. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfDetInvertible [Invertible A.det] : Invertible A where invOf := ⅟A.det • A.adjugate mul_invOf_self := by @@ -88,21 +88,21 @@ theorem invOf_eq [Invertible A.det] [Invertible A] : ⅟A = ⅟A.det • A.adjug convert! (rfl : ⅟A = _) /-- `A.det` is invertible if `A` has a left inverse. -/ -@[implicit_reducible] +@[instance_reducible] def detInvertibleOfLeftInverse (h : B * A = 1) : Invertible A.det where invOf := B.det mul_invOf_self := by rw [mul_comm, ← det_mul, h, det_one] invOf_mul_self := by rw [← det_mul, h, det_one] /-- `A.det` is invertible if `A` has a right inverse. -/ -@[implicit_reducible] +@[instance_reducible] def detInvertibleOfRightInverse (h : A * B = 1) : Invertible A.det where invOf := B.det mul_invOf_self := by rw [← det_mul, h, det_one] invOf_mul_self := by rw [mul_comm, ← det_mul, h, det_one] /-- If `A` has a constructive inverse, produce one for `A.det`. -/ -@[implicit_reducible] +@[instance_reducible] def detInvertibleOfInvertible [Invertible A] : Invertible A.det := detInvertibleOfLeftInverse A (⅟A) (invOf_mul_self _) @@ -439,7 +439,7 @@ theorem isUnit_nonsing_inv_iff {A : Matrix n n α} : IsUnit A⁻¹ ↔ IsUnit A -- `IsUnit.invertible` lifts the proposition `IsUnit A` to a constructive inverse of `A`. /-- A version of `Matrix.invertibleOfDetInvertible` with the inverse defeq to `A⁻¹` that is therefore noncomputable. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def invertibleOfIsUnitDet (h : IsUnit A.det) : Invertible A := ⟨A⁻¹, nonsing_inv_mul A h, mul_nonsing_inv A h⟩ @@ -519,7 +519,7 @@ section Diagonal attribute [local instance] Invertible.map in /-- `diagonal v` is invertible if `v` is -/ -@[implicit_reducible] +@[instance_reducible] def diagonalInvertible {α} [NonAssocSemiring α] (v : n → α) [Invertible v] : Invertible (diagonal v) := inferInstanceAs <| Invertible (diagonalRingHom n α v) @@ -530,7 +530,7 @@ theorem invOf_diagonal_eq {α} [Semiring α] (v : n → α) [Invertible v] [Inve rfl /-- `v` is invertible if `diagonal v` is -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfDiagonalInvertible (v : n → α) [Invertible (diagonal v)] : Invertible v where invOf := diag (⅟(diagonal v)) invOf_mul_self := @@ -678,14 +678,14 @@ variable [Fintype m] variable [DecidableEq m] /-- `A.submatrix e₁ e₂` is invertible if `A` is -/ -@[implicit_reducible] +@[instance_reducible] def submatrixEquivInvertible (A : Matrix m m α) (e₁ e₂ : n ≃ m) [Invertible A] : Invertible (A.submatrix e₁ e₂) := invertibleOfRightInverse _ ((⅟A).submatrix e₂ e₁) <| by rw [Matrix.submatrix_mul_equiv, mul_invOf_self, submatrix_one_equiv] /-- `A` is invertible if `A.submatrix e₁ e₂` is -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfSubmatrixEquivInvertible (A : Matrix m m α) (e₁ e₂ : n ≃ m) [Invertible (A.submatrix e₁ e₂)] : Invertible A := invertibleOfRightInverse _ ((⅟(A.submatrix e₁ e₂)).submatrix e₂.symm e₁.symm) <| by diff --git a/Mathlib/LinearAlgebra/Matrix/Notation.lean b/Mathlib/LinearAlgebra/Matrix/Notation.lean index b941bb86d1476d..d0b88f3a65b8dc 100644 --- a/Mathlib/LinearAlgebra/Matrix/Notation.lean +++ b/Mathlib/LinearAlgebra/Matrix/Notation.lean @@ -231,6 +231,7 @@ variable {ι : Type*} theorem replicateCol_empty (v : Fin 0 → α) : replicateCol ι v = vecEmpty := empty_eq _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem replicateCol_cons (x : α) (u : Fin m → α) : replicateCol ι (vecCons x u) = of (vecCons (fun _ => x) (replicateCol ι u)) := by @@ -257,6 +258,7 @@ theorem transpose_empty_rows (A : Matrix m' (Fin 0) α) : Aᵀ = of ![] := theorem transpose_empty_cols (A : Matrix (Fin 0) m' α) : Aᵀ = of fun _ => ![] := funext fun _ => empty_eq _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) : (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by @@ -373,6 +375,7 @@ theorem empty_vecMulVec (v : Fin 0 → α) (w : n' → α) : vecMulVec v w = ![] theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = of fun _ => ![] := funext fun _ => empty_eq _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) : vecMulVec (vecCons x v) w = vecCons (x • w) (vecMulVec v w) := by @@ -401,6 +404,7 @@ theorem submatrix_empty (A : Matrix m' n' α) (row : Fin 0 → m') (col : o' → submatrix A row col = ![] := empty_eq _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (col : o' → n') : submatrix A (vecCons i row) col = vecCons (fun j => A i (col j)) (submatrix A row col) := by diff --git a/Mathlib/LinearAlgebra/Matrix/Rank.lean b/Mathlib/LinearAlgebra/Matrix/Rank.lean index 8a378a3de7921e..457b044c3c03d8 100644 --- a/Mathlib/LinearAlgebra/Matrix/Rank.lean +++ b/Mathlib/LinearAlgebra/Matrix/Rank.lean @@ -53,6 +53,7 @@ theorem cRank_subsingleton [Subsingleton R] (A : Matrix m n R) : A.cRank = 1 := lemma cRank_toNat_eq_finrank (A : Matrix m n R) : A.cRank.toNat = Module.finrank R (span R (range A.col)) := rfl +set_option backward.isDefEq.respectTransparency false in lemma lift_cRank_submatrix_le (A : Matrix m n R) (r : m₀ → m) (c : n₀ → n) : lift.{um} (A.submatrix r c).cRank ≤ lift.{um₀} A.cRank := by have h : ((A.submatrix r id).submatrix id c).cRank ≤ (A.submatrix r id).cRank := @@ -126,6 +127,7 @@ noncomputable def rank (A : Matrix m n R) : ℕ := theorem rank_subsingleton [Subsingleton R] (A : Matrix m n R) : A.rank = 1 := finrank_subsingleton +set_option backward.isDefEq.respectTransparency false in @[simp] theorem cRank_one [Nontrivial R] [DecidableEq m] : (cRank (1 : Matrix m m R)) = lift.{uR} #m := by @@ -282,6 +284,7 @@ theorem eRank_reindex {m₀ : Type um} {n : Type un} (A : Matrix m n R) (em : m eRank (A.reindex em en) = eRank A := eRank_submatrix .. +set_option backward.isDefEq.respectTransparency false in theorem rank_eq_finrank_range_toLin [Finite m] [DecidableEq n] {M₁ M₂ : Type*} [AddCommGroup M₁] [AddCommGroup M₂] [Module R M₁] [Module R M₂] (A : Matrix m n R) (v₁ : Basis m R M₁) (v₂ : Basis n R M₂) : A.rank = finrank R (LinearMap.range (toLin v₂ v₁ A)) := by @@ -333,6 +336,7 @@ theorem rank_diagonal [Fintype m] [DecidableEq m] [DecidableEq R] (w : m → R) rw [Matrix.rank, ← Matrix.toLin'_apply', Module.finrank, ← LinearMap.rank, LinearMap.rank_diagonal, Cardinal.toNat_natCast] +set_option backward.isDefEq.respectTransparency false in theorem cRank_diagonal [DecidableEq m] (w : m → R) : (diagonal w).cRank = lift.{uR} #{i // (w i) ≠ 0} := by classical diff --git a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean index 6d108691f2d1be..bef863c47e88c1 100644 --- a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean +++ b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean @@ -74,7 +74,7 @@ section Triangular /-- An upper-block-triangular matrix is invertible if its diagonal is. -/ -@[implicit_reducible] +@[instance_reducible] def fromBlocksZero₂₁Invertible (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) [Invertible A] [Invertible D] : Invertible (fromBlocks A B 0 D) := invertibleOfLeftInverse _ (fromBlocks (⅟A) (-(⅟A * B * ⅟D)) 0 (⅟D)) <| by @@ -83,7 +83,7 @@ def fromBlocksZero₂₁Invertible (A : Matrix m m α) (B : Matrix m n α) (D : fromBlocks_one] /-- A lower-block-triangular matrix is invertible if its diagonal is. -/ -@[implicit_reducible] +@[instance_reducible] def fromBlocksZero₁₂Invertible (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible D] : Invertible (fromBlocks A 0 C D) := invertibleOfLeftInverse _ @@ -229,7 +229,7 @@ section Block /-- A block matrix is invertible if the bottom right corner and the corresponding Schur complement is. -/ -@[implicit_reducible] +@[instance_reducible] def fromBlocks₂₂Invertible (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] [Invertible (A - B * ⅟D * C)] : Invertible (fromBlocks A B C D) := by @@ -259,7 +259,7 @@ def fromBlocks₂₂Invertible (A : Matrix m m α) (B : Matrix m n α) (C : Matr /-- A block matrix is invertible if the top left corner and the corresponding Schur complement is. -/ -@[implicit_reducible] +@[instance_reducible] def fromBlocks₁₁Invertible (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible (D - C * ⅟A * B)] : Invertible (fromBlocks A B C D) := by @@ -294,7 +294,7 @@ theorem invOf_fromBlocks₁₁_eq (A : Matrix m m α) (B : Matrix m n α) (C : M /-- If a block matrix is invertible and so is its bottom left element, then so is the corresponding Schur complement. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfFromBlocks₂₂Invertible (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] [Invertible (fromBlocks A B C D)] : Invertible (A - B * ⅟D * C) := by @@ -312,7 +312,7 @@ def invertibleOfFromBlocks₂₂Invertible (A : Matrix m m α) (B : Matrix m n /-- If a block matrix is invertible and so is its bottom left element, then so is the corresponding Schur complement. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfFromBlocks₁₁Invertible (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible (fromBlocks A B C D)] : Invertible (D - C * ⅟A * B) := by diff --git a/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean b/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean index 70a23cc12f3139..e8cbd19ccd23f3 100644 --- a/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean +++ b/Mathlib/LinearAlgebra/Matrix/SemiringInverse.lean @@ -237,12 +237,12 @@ instance (priority := low) instIsStablyFiniteRingOfCommSemiring : IsStablyFinite variable (A B) /-- We can construct an instance of invertible A if A has a left inverse. -/ -@[deprecated invertibleOfLeftInverse (since := "2025-12-06"), implicit_reducible] +@[deprecated invertibleOfLeftInverse (since := "2025-12-06"), instance_reducible] protected def invertibleOfLeftInverse (h : B * A = 1) : Invertible A := invertibleOfLeftInverse _ _ h /-- We can construct an instance of invertible A if A has a right inverse. -/ -@[deprecated invertibleOfRightInverse (since := "2025-12-06"), implicit_reducible] +@[deprecated invertibleOfRightInverse (since := "2025-12-06"), instance_reducible] protected def invertibleOfRightInverse (h : A * B = 1) : Invertible A := invertibleOfRightInverse _ _ h diff --git a/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean b/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean index 6d74085bad5fd2..36c4d91eaa8ae1 100644 --- a/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean +++ b/Mathlib/LinearAlgebra/Matrix/SesquilinearForm.lean @@ -169,6 +169,7 @@ theorem Matrix.toLinearMapₛₗ₂'_aux_eq (M : Matrix n m N₂) : Matrix.toLinearMap₂'Aux σ₁ σ₂ M = Matrix.toLinearMapₛₗ₂' R σ₁ σ₂ M := rfl +set_option backward.isDefEq.respectTransparency false in theorem Matrix.toLinearMapₛₗ₂'_apply (M : Matrix n m N₂) (x : n → R₁) (y : m → R₂) : -- porting note: we don't seem to have `∑ i j` as valid notation yet Matrix.toLinearMapₛₗ₂' R σ₁ σ₂ M x y = ∑ i, ∑ j, σ₁ (x i) • σ₂ (y j) • M i j := by @@ -252,6 +253,7 @@ variable [DecidableEq n] [DecidableEq m] variable [Fintype n'] [Fintype m'] variable [DecidableEq n'] [DecidableEq m'] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem LinearMap.toMatrix₂'_compl₁₂ (B : (n → R) →ₗ[R] (m → R) →ₗ[R] R) (l : (n' → R) →ₗ[R] n → R) (r : (m' → R) →ₗ[R] m → R) : diff --git a/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean b/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean index de533d3426e996..c05698bface375 100644 --- a/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean +++ b/Mathlib/LinearAlgebra/Matrix/SpecialLinearGroup.lean @@ -263,6 +263,7 @@ theorem mem_center_iff {A : SpecialLinearGroup n R} : · suffices ↑ₘ(B * A) = ↑ₘ(A * B) from Subtype.val_injective this simpa only [coe_mul, ← hr] using! (scalar_commute (n := n) r (Commute.all r) B).symm +set_option backward.isDefEq.respectTransparency false in /-- An equivalence of groups, from the center of the special linear group to the roots of unity. -/ @[simps] def center_equiv_rootsOfUnity' (i : n) : @@ -370,6 +371,7 @@ section SpecialCases open scoped MatrixGroups +set_option backward.isDefEq.respectTransparency false in theorem SL2_inv_expl_det (A : SL(2, R)) : det ![![A.1 1 1, -A.1 0 1], ![-A.1 1 0, A.1 0 0]] = 1 := by simpa [-det_coe, Matrix.det_fin_two, mul_comm] using A.2 @@ -381,6 +383,7 @@ theorem SL2_inv_expl (A : SL(2, R)) : rw [coe_inv, this] simp +set_option backward.isDefEq.respectTransparency false in theorem fin_two_induction (P : SL(2, R) → Prop) (h : ∀ (a b c d : R) (hdet : a * d - b * c = 1), P ⟨!![a, b; c, d], by rwa [det_fin_two_of]⟩) (g : SL(2, R)) : P g := by @@ -388,6 +391,7 @@ theorem fin_two_induction (P : SL(2, R) → Prop) convert! h (m 0 0) (m 0 1) (m 1 0) (m 1 1) (by rwa [det_fin_two] at hm) ext i j; fin_cases i <;> fin_cases j <;> rfl +set_option backward.isDefEq.respectTransparency false in theorem fin_two_exists_eq_mk_of_apply_zero_one_eq_zero {R : Type*} [Field R] (g : SL(2, R)) (hg : g 1 0 = 0) : ∃ (a b : R) (h : a ≠ 0), g = (⟨!![a, b; 0, a⁻¹], by simp [h]⟩ : SL(2, R)) := by diff --git a/Mathlib/LinearAlgebra/Matrix/ToLin.lean b/Mathlib/LinearAlgebra/Matrix/ToLin.lean index cf711039ba3e98..debab32595d86b 100644 --- a/Mathlib/LinearAlgebra/Matrix/ToLin.lean +++ b/Mathlib/LinearAlgebra/Matrix/ToLin.lean @@ -171,6 +171,7 @@ theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) : variable [Fintype m] +set_option backward.isDefEq.respectTransparency false in theorem range_vecMulLinear (M : Matrix m n R) : LinearMap.range M.vecMulLinear = span R (range M.row) := by letI := Classical.decEq m @@ -194,6 +195,7 @@ lemma Matrix.linearIndependent_rows_of_isUnit {A : Matrix m m R} section +set_option backward.isDefEq.respectTransparency false in /-- Linear maps `(m → R) →ₗ[R] (n → R)` are linearly equivalent over `Rᵐᵒᵖ` to `Matrix m n R`, by having matrices act by right multiplication. -/ @@ -476,6 +478,7 @@ theorem LinearMap.toMatrix'_mul [Fintype m] [DecidableEq m] (f g : (m → R) → LinearMap.toMatrix' (f * g) = LinearMap.toMatrix' f * LinearMap.toMatrix' g := LinearMap.toMatrix'_comp f g +set_option backward.isDefEq.respectTransparency false in @[simp] theorem LinearMap.toMatrix'_algebraMap (x : R) : LinearMap.toMatrix' (algebraMap R (Module.End R (n → R)) x) = scalar n x := by @@ -649,6 +652,7 @@ lemma LinearMap.toMatrix_singleton {ι : Type*} [Unique ι] (f : R →ₗ[R] R) theorem Matrix.toLin_one : Matrix.toLin v₁ v₁ 1 = LinearMap.id := by rw [← LinearMap.toMatrix_id v₁, Matrix.toLin_toMatrix] +set_option backward.isDefEq.respectTransparency false in theorem Matrix.toLin_scalar (r : R) : Matrix.toLin v₁ v₁ (scalar n r) = r • LinearMap.id := (LinearMap.toMatrix v₁ v₁).injective (by simp [toMatrix_id, smul_one_eq_diagonal]) @@ -658,6 +662,7 @@ theorem LinearMap.toMatrix_reindexRange [DecidableEq M₁] (f : M₁ →ₗ[R] M LinearMap.toMatrix v₁ v₂ f k i := by simp_rw [LinearMap.toMatrix_apply, Basis.reindexRange_self, Basis.reindexRange_repr] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem LinearMap.toMatrix_algebraMap (x : R) : LinearMap.toMatrix v₁ v₁ (algebraMap R (Module.End R M₁) x) = scalar n x := by @@ -711,6 +716,7 @@ variable {l m n : Type*} [Fintype n] [DecidableEq n] variable {M₁ M₂ : Type*} [AddCommMonoid M₁] [AddCommMonoid M₂] [Module R M₁] [Module R M₂] variable (v₁ : Basis n R M₁) (v₂ : Basis m R M₂) +set_option backward.isDefEq.respectTransparency false in /-- The matrix of `toSpanSingleton R M₂ x` given by bases `v₁` and `v₂` is equal to `vecMulVec (v₂.repr x) v₁`. When `v₁ = Module.Basis.singleton` then this is the column matrix of `v₂.repr x`. -/ @@ -718,6 +724,7 @@ theorem LinearMap.toMatrix_toSpanSingleton [Finite m] (v₁ : Basis n R R) (v₂ (x : M₂) : (toSpanSingleton R M₂ x).toMatrix v₁ v₂ = vecMulVec (v₂.repr x) v₁ := by ext; simp [toMatrix_apply, vecMulVec_apply, mul_comm] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma LinearMap.toMatrix_smulRight [Finite m] (f : M₁ →ₗ[R] R) (x : M₂) : toMatrix v₁ v₂ (f.smulRight x) = vecMulVec (v₂.repr x) (f ∘ v₁) := by @@ -995,6 +1002,7 @@ variable {A M n : Type*} [Fintype n] [DecidableEq n] [CommSemiring A] [AddCommMonoid M] [Module R M] [Module A M] [Algebra R A] [IsScalarTower R A M] (bA : Basis m R A) (bM : Basis n A M) +set_option backward.isDefEq.respectTransparency false in lemma _root_.LinearMap.restrictScalars_toMatrix (f : M →ₗ[A] M) : (f.restrictScalars R).toMatrix (bA.smulTower' bM) (bA.smulTower' bM) = ((f.toMatrix bM bM).map (leftMulMatrix bA)).comp _ _ _ _ _ := by @@ -1010,6 +1018,7 @@ variable [Algebra R S] [Algebra S T] [Algebra R T] [IsScalarTower R S T] variable {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] variable (b : Basis m R S) (c : Basis n S T) +set_option backward.isDefEq.respectTransparency false in theorem smulTower_leftMulMatrix (x) (ik jk) : leftMulMatrix (b.smulTower c) x ik jk = leftMulMatrix b (leftMulMatrix c x ik.2 jk.2) ik.1 jk.1 := by @@ -1129,6 +1138,7 @@ variable (R : Type*) [CommSemiring R] variable (A : Type*) [Semiring A] [Algebra R A] variable (M : Type*) [AddCommMonoid M] [Module R M] [Module A M] [IsScalarTower R A M] +set_option backward.isDefEq.respectTransparency false in /-- Let `M` be an `A`-module. Every `A`-linear map `Mⁿ → Mⁿ` corresponds to a `n×n`-matrix whose entries are `A`-linear maps `M → M`. In another word, we have `End(Mⁿ) ≅ Matₙₓₙ(End(M))` defined by: @@ -1162,6 +1172,7 @@ def endVecRingEquivMatrixEnd : exact congr_arg₂ _ (by aesop) rfl map_add' f g := by ext; simp +set_option backward.isDefEq.respectTransparency false in /-- Let `M` be an `A`-module. Every `A`-linear map `Mⁿ → Mⁿ` corresponds to a `n×n`-matrix whose entries are `R`-linear maps `M → M`. In another word, we have `End(Mⁿ) ≅ Matₙₓₙ(End(M))` defined by: diff --git a/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean b/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean index c94c0e36a851c3..c246005765dadd 100644 --- a/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean +++ b/Mathlib/LinearAlgebra/Multilinear/DFinsupp.lean @@ -269,6 +269,7 @@ theorem freeDFinsuppEquiv_def (f : Π₀ (_ : (Π i, κ i) × ι'), R) : (DFinsupp.domLCongr (R := R) (Equiv.sigmaEquivProd _ _).symm) f) := rfl +set_option backward.isDefEq.respectTransparency false in /-- When `freeDFinsuppEquiv` is applied to a map with a single value of one the resulting multilinear map sends inputs to a single value in the codomain, taking a product over images from each diff --git a/Mathlib/LinearAlgebra/Orientation.lean b/Mathlib/LinearAlgebra/Orientation.lean index 197742e8649f8b..d7ec0c74e7b383 100644 --- a/Mathlib/LinearAlgebra/Orientation.lean +++ b/Mathlib/LinearAlgebra/Orientation.lean @@ -201,6 +201,7 @@ variable {ι : Type*} namespace Orientation +set_option backward.isDefEq.respectTransparency false in /-- A module `M` over a linearly ordered commutative ring has precisely two "orientations" with respect to an empty index type. (Note that these are only orientations of `M` of in the conventional mathematical sense if `M` is zero-dimensional.) -/ diff --git a/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean b/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean index 45a4ac8ce887f9..17729c9f9986c3 100644 --- a/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean +++ b/Mathlib/LinearAlgebra/PerfectPairing/Restrict.lean @@ -84,6 +84,7 @@ variable {S M' N' : Type*} [AddCommGroup M'] [Module S M'] [AddCommGroup N'] [Module S N'] (i : M' →ₗ[S] M) (j : N' →ₗ[S] N) +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in private lemma restrictScalars_injective_aux (hi : Injective i) @@ -108,6 +109,7 @@ private lemma restrictScalars_injective_aux ext n simpa using hx n +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in private lemma restrictScalars_surjective_aux (h : ∀ g : Module.Dual S N', ∃ m, diff --git a/Mathlib/LinearAlgebra/Pi.lean b/Mathlib/LinearAlgebra/Pi.lean index 177c793ab94b68..7142f304c71b77 100644 --- a/Mathlib/LinearAlgebra/Pi.lean +++ b/Mathlib/LinearAlgebra/Pi.lean @@ -459,6 +459,7 @@ variable [(i : ι) → AddCommMonoid (φ i)] [(i : ι) → Module R (φ i)] variable [(i : ι) → AddCommMonoid (ψ i)] [(i : ι) → Module R (ψ i)] variable [(i : ι) → AddCommMonoid (χ i)] [(i : ι) → Module R (χ i)] +set_option backward.isDefEq.respectTransparency false in /-- Combine a family of linear equivalences into a linear equivalence of `pi`-types. This is `Equiv.piCongrRight` as a `LinearEquiv` -/ diff --git a/Mathlib/LinearAlgebra/PiTensorProduct.lean b/Mathlib/LinearAlgebra/PiTensorProduct.lean index 01f6e08a3a1838..b24173f2b84ce4 100644 --- a/Mathlib/LinearAlgebra/PiTensorProduct.lean +++ b/Mathlib/LinearAlgebra/PiTensorProduct.lean @@ -318,6 +318,7 @@ lemma mem_lifts_iff (x : ⨂[R] i, s i) (p : FreeAddMonoid (R × Π i, s i)) : p ∈ lifts x ↔ List.sum (List.map (fun x ↦ x.1 • ⨂ₜ[R] i, x.2 i) p.toList) = x := by simp only [lifts, Set.mem_setOf_eq, FreeAddMonoid.toPiTensorProduct] +set_option backward.isDefEq.respectTransparency false in /-- Every element of `⨂[R] i, s i` has a lift in `FreeAddMonoid (R × Π i, s i)`. -/ lemma nonempty_lifts (x : ⨂[R] i, s i) : Set.Nonempty (lifts x) := by @@ -643,6 +644,7 @@ theorem piTensorHomMapFun₂_add (φ ψ : ⨂[R] i, s i →ₗ[R] t i →ₗ[R] dsimp [piTensorHomMapFun₂]; ext; simp only [map_add, LinearMap.compMultilinearMap_apply, lift.tprod, add_apply, LinearMap.add_apply] +set_option backward.isDefEq.respectTransparency false in theorem piTensorHomMapFun₂_smul (r : R) (φ : ⨂[R] i, s i →ₗ[R] t i →ₗ[R] t' i) : piTensorHomMapFun₂ (r • φ) = r • piTensorHomMapFun₂ φ := by dsimp [piTensorHomMapFun₂]; ext; simp only [map_smul, LinearMap.compMultilinearMap_apply, @@ -661,6 +663,7 @@ def piTensorHomMap₂ : (⨂[R] i, s i →ₗ[R] t i →ₗ[R] t' i) →ₗ[R] map_add' x y := piTensorHomMapFun₂_add x y map_smul' x y := piTensorHomMapFun₂_smul x y +set_option backward.isDefEq.respectTransparency false in @[simp] lemma piTensorHomMap₂_tprod_tprod_tprod (f : ∀ i, s i →ₗ[R] t i →ₗ[R] t' i) (a : ∀ i, s i) (b : ∀ i, t i) : piTensorHomMap₂ (tprod R f) (tprod R a) (tprod R b) = tprod R (fun i ↦ f i (a i) (b i)) := by @@ -836,6 +839,7 @@ section tmulEquivDep variable (N : ι ⊕ ι₂ → Type*) [∀ i, AddCommMonoid (N i)] [∀ i, Module R (N i)] +set_option backward.isDefEq.respectTransparency false in /-- Equivalence between a `TensorProduct` of `PiTensorProduct`s and a single `PiTensorProduct` indexed by a `Sum` type. If `N` is a constant family of modules, use the non-dependent version `PiTensorProduct.tmulEquiv` instead. -/ diff --git a/Mathlib/LinearAlgebra/Prod.lean b/Mathlib/LinearAlgebra/Prod.lean index 21f532a1db5fc0..14dddbe30abf71 100644 --- a/Mathlib/LinearAlgebra/Prod.lean +++ b/Mathlib/LinearAlgebra/Prod.lean @@ -90,6 +90,7 @@ theorem fst_surjective : Function.Surjective (fst R M M₂) := fun x => ⟨(x, 0 theorem snd_surjective : Function.Surjective (snd R M M₂) := fun x => ⟨(0, x), rfl⟩ +set_option backward.isDefEq.respectTransparency false in /-- The prod of two linear maps is a linear map. -/ @[simps] def prod (f : M →ₗ[R] M₂) (g : M →ₗ[R] M₃) : M →ₗ[R] M₂ × M₃ where @@ -477,6 +478,7 @@ theorem ker_coprod_of_disjoint_range {M₂ : Type*} [AddCommGroup M₂] [Module rw [this] at h simpa [this] using h +set_option backward.isDefEq.respectTransparency false in /-- Given a linear map `f : E →ₗ[R] F` and a complement `C` of its kernel, we get a linear equivalence between `C` and `range f`. -/ @[simps!] @@ -814,6 +816,7 @@ variable [Semiring R] variable [AddCommMonoid M] [AddCommMonoid M₂] variable [Module R M] [Module R M₂] [Unique M₂] +set_option backward.isDefEq.respectTransparency false in /-- Multiplying by the trivial module from the left does not change the structure. This is the `LinearEquiv` version of `AddEquiv.uniqueProd`. -/ @[simps!] @@ -823,6 +826,7 @@ def uniqueProd : (M₂ × M) ≃ₗ[R] M := lemma coe_uniqueProd : (uniqueProd (R := R) (M := M) (M₂ := M₂) : (M₂ × M) ≃ M) = Equiv.uniqueProd M M₂ := rfl +set_option backward.isDefEq.respectTransparency false in /-- Multiplying by the trivial module from the right does not change the structure. This is the `LinearEquiv` version of `AddEquiv.prodUnique`. -/ @[simps!] diff --git a/Mathlib/LinearAlgebra/Projectivization/Action.lean b/Mathlib/LinearAlgebra/Projectivization/Action.lean index d51fd56fb02048..e3b8be48167f40 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Action.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Action.lean @@ -36,6 +36,7 @@ section DivisionRing variable {G K V : Type*} [AddCommGroup V] [DivisionRing K] [Module K V] [Group G] [DistribMulAction G V] [SMulCommClass G K V] +set_option backward.isDefEq.respectTransparency false in /-- Any group acting `K`-linearly on `V` (such as the general linear group) acts on `ℙ V`. -/ @[simps -isSimp] instance : MulAction G (ℙ K V) where diff --git a/Mathlib/LinearAlgebra/Projectivization/Basic.lean b/Mathlib/LinearAlgebra/Projectivization/Basic.lean index c691128f5015f6..a9756e01023a8b 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Basic.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Basic.lean @@ -39,7 +39,7 @@ We have three ways to construct terms of `ℙ K V`: variable (K V : Type*) [DivisionRing K] [AddCommGroup V] [Module K V] /-- The setoid whose quotient is the projectivization of `V`. -/ -@[implicit_reducible] +@[instance_reducible] def projectivizationSetoid : Setoid { v : V // v ≠ 0 } := (MulAction.orbitRel Kˣ V).comap (↑) diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean b/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean index 643c1bc55fa545..ccbbc6f062c081 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean @@ -572,6 +572,7 @@ section Comp variable [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] variable [AddCommMonoid P] [Module R P] +set_option backward.isDefEq.respectTransparency false in /-- Compose the quadratic map with a linear function on the right. -/ def comp (Q : QuadraticMap R N P) (f : M →ₗ[R] N) : QuadraticMap R M P where toFun x := Q (f x) @@ -584,6 +585,7 @@ def comp (Q : QuadraticMap R N P) (f : M →ₗ[R] N) : QuadraticMap R M P where theorem comp_apply (Q : QuadraticMap R N P) (f : M →ₗ[R] N) (x : M) : (Q.comp f) x = Q (f x) := rfl +set_option backward.isDefEq.respectTransparency false in /-- Compose a quadratic map with a linear function on the left. -/ @[simps +simpRhs] def _root_.LinearMap.compQuadraticMap (f : N →ₗ[R] P) (Q : QuadraticMap R M N) : @@ -707,6 +709,7 @@ section Semiring variable [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] variable {N' : Type*} [AddCommMonoid N'] [Module R N'] +set_option backward.isDefEq.respectTransparency false in /-- A bilinear map gives a quadratic map by applying the argument twice. -/ def toQuadraticMap (B : BilinMap R M N) : QuadraticMap R M N where toFun x := B x x diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean b/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean index 3344cb5b23f2f6..2ac119635d4e2c 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean @@ -91,6 +91,7 @@ theorem toBilin_apply (Q : QuadraticMap R M N) (bm : Basis ι R M) (i j : ι) : if i = j then Q (bm i) else if i < j then polar Q (bm i) (bm j) else 0 := by simp [toBilin] +set_option backward.isDefEq.respectTransparency false in theorem toQuadraticMap_toBilin (Q : QuadraticMap R M N) (bm : Basis ι R M) : (Q.toBilin bm).toQuadraticMap = Q := by ext x diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean b/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean index 9e90735a51ef7d..f7b1c2eb255cdf 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Dual.lean @@ -48,6 +48,7 @@ section Ring variable [CommRing R] [AddCommGroup M] [Module R M] +set_option backward.isDefEq.respectTransparency false in theorem separatingLeft_dualProd : (dualProd R M).SeparatingLeft ↔ Function.Injective (Module.Dual.eval R M) := by classical diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Signature.lean b/Mathlib/LinearAlgebra/QuadraticForm/Signature.lean index 9a26d36b877fdb..78252acce522f7 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Signature.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Signature.lean @@ -117,6 +117,7 @@ variable {Q} @[simp] lemma sigNeg_neg : sigNeg (-Q) = sigPos Q := by rw [← sigPos_neg, neg_neg] +set_option backward.isDefEq.respectTransparency false in lemma QuadraticMap.Equivalent.sigPos_eq (h : Equivalent Q Q') : sigPos Q = sigPos Q' := by obtain ⟨e⟩ := h unfold sigPos diff --git a/Mathlib/LinearAlgebra/Quotient/Basic.lean b/Mathlib/LinearAlgebra/Quotient/Basic.lean index 2c4fd2b848e099..fecb31bc3246b4 100644 --- a/Mathlib/LinearAlgebra/Quotient/Basic.lean +++ b/Mathlib/LinearAlgebra/Quotient/Basic.lean @@ -188,6 +188,7 @@ theorem mapQ_zero (h : p ≤ q.comap (0 : M →ₛₗ[τ₁₂] M₂) := (by sim ext simp +set_option backward.isDefEq.respectTransparency false in /-- Given submodules `p ⊆ M`, `p₂ ⊆ M₂`, `p₃ ⊆ M₃` and maps `f : M → M₂`, `g : M₂ → M₃` inducing `mapQ f : M ⧸ p → M₂ ⧸ p₂` and `mapQ g : M₂ ⧸ p₂ → M₃ ⧸ p₃` then `mapQ (g ∘ f) = (mapQ g) ∘ (mapQ f)`. -/ @@ -257,6 +258,8 @@ please refer to the dedicated version `Submodule.factorPow`. -/ abbrev factor (H : p ≤ p') : M ⧸ p →ₗ[R] M ⧸ p' := mapQ _ _ LinearMap.id H +-- TODO: produces `simpNF` linter error without making `Set.Mem` implicit-reducible (as it is now), +-- but doing so causes other issues (search for `Set.Mem` todos) @[simp] theorem factor_mk (H : p ≤ p') (x : M) : factor H (mkQ p x) = mkQ p' x := rfl @@ -266,6 +269,7 @@ theorem factor_comp_mk (H : p ≤ p') : (factor H).comp (mkQ p) = mkQ p' := by ext x rw [LinearMap.comp_apply, factor_mk] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem factor_comp (H1 : p ≤ p') (H2 : p' ≤ p'') : (factor H2).comp (factor H1) = factor (H1.trans H2) := by diff --git a/Mathlib/LinearAlgebra/Ray.lean b/Mathlib/LinearAlgebra/Ray.lean index e857c07e686827..40a0a9fcd80d69 100644 --- a/Mathlib/LinearAlgebra/Ray.lean +++ b/Mathlib/LinearAlgebra/Ray.lean @@ -176,6 +176,7 @@ theorem map (f : M →ₗ[R] N) (h : SameRay R x y) : SameRay R (f x) (f y) := Or.imp (fun hy => by rw [hy, map_zero]) fun ⟨r₁, r₂, hr₁, hr₂, h⟩ => ⟨r₁, r₂, hr₁, hr₂, by rw [← f.map_smul, ← f.map_smul, h]⟩ +set_option backward.isDefEq.respectTransparency false in /-- The images of two vectors under an injective linear map are on the same ray if and only if the original vectors are on the same ray. -/ theorem _root_.Function.Injective.sameRay_map_iff diff --git a/Mathlib/LinearAlgebra/Reflection.lean b/Mathlib/LinearAlgebra/Reflection.lean index f79b24d5238189..806fe891785fb7 100644 --- a/Mathlib/LinearAlgebra/Reflection.lean +++ b/Mathlib/LinearAlgebra/Reflection.lean @@ -85,6 +85,7 @@ lemma involutive_preReflection (h : f x = 2) : Involutive (preReflection x f) := fun y ↦ by simp [map_sub, h, two_smul, preReflection_apply] +set_option backward.isDefEq.respectTransparency false in lemma preReflection_preReflection (g : Dual R M) (h : f x = 2) : preReflection (preReflection x f y) (preReflection f (Dual.eval R M x) g) = (preReflection x f) ∘ₗ (preReflection y g) ∘ₗ (preReflection x f) := by @@ -179,6 +180,7 @@ open Int Polynomial.Chebyshev variable {x y : M} {f g : Dual R M} (hf : f x = 2) (hg : g y = 2) +set_option backward.isDefEq.respectTransparency false in /-- A formula for $(r_1 r_2)^m z$, where $m$ is a natural number and $z \in M$. -/ lemma reflection_mul_reflection_pow_apply (m : ℕ) (z : M) (t : R := f y * g x - 2) (ht : t = f y * g x - 2 := by rfl) : @@ -272,6 +274,7 @@ lemma reflection_mul_reflection_zpow (m : ℤ) ext z simpa using reflection_mul_reflection_zpow_apply hf hg m z t ht +set_option backward.isDefEq.respectTransparency false in /-- A formula for $(r_1 r_2)^m x$, where $m$ is an integer. This is the special case of `Module.reflection_mul_reflection_zpow_apply` with $z = x$. -/ lemma reflection_mul_reflection_zpow_apply_self (m : ℤ) @@ -313,6 +316,7 @@ lemma reflection_mul_reflection_pow_apply_self (m : ℕ) ((S R m).eval t + (S R (m - 1)).eval t) • x + ((S R (m - 1)).eval t * -g x) • y := mod_cast reflection_mul_reflection_zpow_apply_self hf hg m t ht +set_option backward.isDefEq.respectTransparency false in /-- A formula for $r_2 (r_1 r_2)^m x$, where $m$ is an integer. -/ lemma reflection_mul_reflection_mul_reflection_zpow_apply_self (m : ℤ) (t : R := f y * g x - 2) (ht : t = f y * g x - 2 := by rfl) : @@ -335,6 +339,7 @@ end /-! ### Lemmas used to prove uniqueness results for root data -/ +set_option backward.isDefEq.respectTransparency false in /-- See also `Module.Dual.eq_of_preReflection_mapsTo'` for a variant of this lemma which applies when `Φ` does not span. @@ -401,6 +406,7 @@ lemma Dual.eq_of_preReflection_mapsTo' [CharZero R] [IsDomain R] [IsTorsionFree variable {y} variable {g : Dual R M} +set_option backward.isDefEq.respectTransparency false in /-- Composite of reflections in "parallel" hyperplanes is a shear (special case). -/ lemma reflection_reflection_iterate (hfx : f x = 2) (hgy : g y = 2) (hgxfy : f y * g x = 4) (n : ℕ) : diff --git a/Mathlib/LinearAlgebra/RootSystem/Base.lean b/Mathlib/LinearAlgebra/RootSystem/Base.lean index 7d1254a4259060..dcae05e4496480 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Base.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Base.lean @@ -149,6 +149,7 @@ lemma span_coroot_support : span R (P.coroot '' b.support) = P.corootSpan R := b.flip.span_root_support +set_option backward.isDefEq.respectTransparency.types false in open Finsupp in lemma eq_one_or_neg_one_of_mem_support_of_smul_mem_aux [Finite ι] [IsAddTorsionFree M] [IsAddTorsionFree N] diff --git a/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean b/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean index b72ee38e87d3ff..93819892cef487 100644 --- a/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean +++ b/Mathlib/LinearAlgebra/RootSystem/BaseChange.lean @@ -64,6 +64,7 @@ section SubfieldValued variable [P.IsValuedIn K] +set_option backward.isDefEq.respectTransparency.types false in /-- Restriction of scalars for a root pairing taking values in a subfield. See also `RootPairing.restrictScalars`. -/ @@ -87,6 +88,7 @@ def restrictScalars' : reflectionPerm_coroot i j := by ext; simpa [algebra_compatible_smul L] using P.reflectionPerm_coroot i j +set_option backward.isDefEq.respectTransparency.types false in instance : (P.restrictScalars' K).IsRootSystem where span_root_eq_top := by rw [← span_setOf_mem_eq_top] @@ -99,6 +101,7 @@ instance : (P.restrictScalars' K).IsRootSystem where ext ⟨x, hx⟩ simp [restrictScalars'] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma restrictScalars_toLinearMap_apply_apply (x : span K (range P.root)) (y : span K (range P.coroot)) : algebraMap K L ((P.restrictScalars' K).toLinearMap x y) = P.toLinearMap x y := by diff --git a/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean b/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean index d367432da18e79..9c0de31345f14d 100644 --- a/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean +++ b/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean @@ -113,6 +113,7 @@ section Field variable [Field R] [CharZero R] [Module R M] [Module R N] (P : RootPairing ι R M N) [P.IsRootSystem] [P.IsCrystallographic] +set_option backward.isDefEq.respectTransparency.types false in lemma linearIndepOn_root_baseOf (f : M →+ ℚ) (hf : ∀ i, f (P.root i) ≠ 0) : LinearIndepOn R P.root (baseOf P.root f) := by let _i : Module ℚ M := Module.compHom M (algebraMap ℚ R) diff --git a/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean b/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean index 5f6d9bf5bb259d..4755b16d9824f8 100644 --- a/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean +++ b/Mathlib/LinearAlgebra/RootSystem/CartanMatrix.lean @@ -126,6 +126,7 @@ lemma cartanMatrix_le_zero_of_ne b.cartanMatrix i j ≤ 0 := b.pairingIn_le_zero_of_ne (by rwa [ne_eq, ← Subtype.ext_iff]) i.property j.property +set_option backward.isDefEq.respectTransparency.types false in lemma cartanMatrix_mem_of_ne {i j : b.support} (hij : i ≠ j) : b.cartanMatrix i j ∈ ({-3, -2, -1, 0} : Set ℤ) := by have : Module.IsReflexive R M := .of_isPerfPair P.toLinearMap @@ -207,6 +208,7 @@ lemma induction_on_cartanMatrix [P.IsReduced] [P.IsIrreducible] simp [← hq_mem, IsIrreducible.eq_top_of_invtSubmodule_reflection q hq hq₀] -- TODO Derive from `LinearIndependent.injective` +set_option backward.isDefEq.respectTransparency.types false in open scoped Matrix in lemma injective_pairingIn {P : RootPairing ι R M N} [P.IsRootSystem] [P.IsCrystallographic] (b : P.Base) : @@ -296,6 +298,7 @@ lemma apply_mem_range_root_of_cartanMatrixEq rw [root_reflectionPerm, this, ← hl, ← root_reflectionPerm] exact mem_range_self _ +set_option backward.isDefEq.respectTransparency.types false in /-- A root system is determined by its Cartan matrix. -/ def equivOfCartanMatrixEq [Finite ι₂] [P₂.IsRootSystem] [P₂.IsReduced] (he : ∀ i j, b₂.cartanMatrix (e i) (e j) = b.cartanMatrix i j) : diff --git a/Mathlib/LinearAlgebra/RootSystem/Defs.lean b/Mathlib/LinearAlgebra/RootSystem/Defs.lean index 1b5b341eac3111..ba505e700e944e 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Defs.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Defs.lean @@ -209,6 +209,7 @@ lemma pairing_eq_add_of_root_eq_add {i j k l : ι} (h : P.root k = P.root i + P. P.pairing k l = P.pairing i l + P.pairing j l := by simp only [← root_coroot_eq_pairing, h, map_add, LinearMap.add_apply] +set_option backward.isDefEq.respectTransparency false in variable {P} in lemma pairing_eq_add_of_root_eq_smul_add_smul {i j k l : ι} {x y : R} (h : P.root k = x • P.root i + y • P.root l) : @@ -398,9 +399,10 @@ lemma pairing_reflectionPerm_self_right (i j : ι) : rw [pairing, ← reflectionPerm_coroot, root_coroot_eq_pairing, pairing_same, two_smul, sub_add_cancel_left, map_neg, root_coroot_eq_pairing] +set_option backward.isDefEq.respectTransparency false in /-- The indexing set of a root pairing carries an involutive negation, corresponding to the negation of a root / coroot. -/ -@[simps, implicit_reducible] def indexNeg : InvolutiveNeg ι where +@[simps, instance_reducible] def indexNeg : InvolutiveNeg ι where neg i := P.reflectionPerm i i neg_neg i := by apply P.root.injective @@ -522,6 +524,7 @@ lemma reflectionPerm_eq_reflectionPerm_iff_of_isSMulRegular (h2 : IsSMulRegular replace h2 : IsSMulRegular (M → M) 2 := IsSMulRegular.pi fun _ ↦ h2 exact h2 <| P.two_nsmul_reflection_eq_of_perm_eq i j h +set_option backward.isDefEq.respectTransparency false in lemma reflectionPerm_eq_reflectionPerm_iff_of_span : P.reflectionPerm i = P.reflectionPerm j ↔ ∀ x ∈ span R (range P.root), P.reflection i x = P.reflection j x := by @@ -568,6 +571,7 @@ def IsOrthogonal : Prop := pairing P i j = 0 ∧ pairing P j i = 0 lemma isOrthogonal_symm : IsOrthogonal P i j ↔ IsOrthogonal P j i := by simp only [IsOrthogonal, and_comm] +set_option backward.isDefEq.respectTransparency false in lemma isOrthogonal_comm (h : IsOrthogonal P i j) : Commute (P.reflection i) (P.reflection j) := by rw [commute_iff_eq] ext @@ -656,6 +660,7 @@ section Map variable {ι₂ M₂ N₂ : Type*} [AddCommGroup M₂] [Module R M₂] [AddCommGroup N₂] [Module R N₂] +set_option backward.isDefEq.respectTransparency false in /-- Push forward a root pairing along linear equivalences, also reindexing the (co)roots. -/ protected def map (e : ι ≃ ι₂) (f : M ≃ₗ[R] M₂) (g : N ≃ₗ[R] N₂) : RootPairing ι₂ R M₂ N₂ where diff --git a/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean b/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean index e557a7f8d6b6e1..0049ca9b0c41c7 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean @@ -78,7 +78,7 @@ section IsG2 /-- By making an arbitrary choice of roots pairing to `-3`, we can obtain an embedded `𝔤₂` root system just from the knowledge that such a pairs exists. -/ -@[implicit_reducible] +@[instance_reducible] def IsG2.toEmbeddedG2 [P.IsG2] : P.EmbeddedG2 where long := (IsG2.exists_pairingIn_neg_three (P := P)).choose short := (IsG2.exists_pairingIn_neg_three (P := P)).choose_spec.choose @@ -200,7 +200,7 @@ end IsNotG2 namespace EmbeddedG2 /-- A pair of roots which pair to `+3` are also sufficient to distinguish an embedded `𝔤₂`. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def ofPairingInThree [CharZero R] [P.IsCrystallographic] [P.IsReduced] (long short : ι) (h : P.pairingIn ℤ long short = 3) : P.EmbeddedG2 where long := P.reflectionPerm long long diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean index 35ff42cd370184..f61b2ad268d0fc 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean @@ -65,6 +65,17 @@ variable {ι R M N : Type*} [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] {P : RootPairing ι R M N} [P.IsCrystallographic] {b : P.Base} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + LieSubalgebra.comap + LieSubalgebra.incl + Matrix + Set + Submodule.subtype + iInf + iInter + span + /-- Part of an `sl₂` triple used in Geck's construction of a Lie algebra from a root system. -/ def h (i : b.support) : Matrix (b.support ⊕ ι) (b.support ⊕ ι) R := @@ -177,6 +188,7 @@ def lieAlgebra [Fintype ι] [DecidableEq ι] : /-- A distinguished subalgebra corresponding to a Cartan subalgebra of the Geck construction. See also `RootPairing.GeckConstruction.cartanSubalgebra'`. -/ +@[local implicit_reducible] def cartanSubalgebra [Fintype ι] [DecidableEq ι] : LieSubalgebra R (Matrix (b.support ⊕ ι) (b.support ⊕ ι) R) where __ := Submodule.span R (range h) diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean index f5504e6ef84b64..1f6397b2575aa9 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean @@ -262,6 +262,7 @@ private lemma chainBotCoeff_mul_chainTopCoeff.aux_1 simp only [P.chainBotCoeff_if_one_zero, hik_mem, him_mem, hjl_mem, hjk_mem] simp [key₁, key₂, key₃, key₄] +set_option backward.isDefEq.respectTransparency.types false in /- An auxiliary result en route to `RootPairing.chainBotCoeff_mul_chainTopCoeff`. -/ open RootPositiveForm in private lemma chainBotCoeff_mul_chainTopCoeff.aux_2 diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean index 2aa7cfcb58a5c3..c973b0aa422c5c 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean @@ -41,6 +41,10 @@ variable {ι R M N : Type*} [Finite ι] [CommRing R] [IsDomain R] [CharZero R] attribute [local simp] Ring.lie_def Matrix.mul_apply Matrix.one_apply Matrix.diagonal_apply +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Matrix + /-- Lemma 3.3 (a) from [Geck](Geck2017). -/ lemma lie_h_e : ⁅h j, e i⁆ = b.cartanMatrix i j • e i := by diff --git a/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean b/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean index f8087ae9fc9cca..60e5282a1b0ebc 100644 --- a/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean +++ b/Mathlib/LinearAlgebra/RootSystem/IsValuedIn.lean @@ -201,6 +201,7 @@ def root'In [Module S N] [IsScalarTower S R N] [FaithfulSMul S R] [P.IsValuedIn (FaithfulSMul.algebraMap_injective S R) (P.root' i) (fun m ↦ P.root'_apply_apply_mem_of_mem_span S m.2 i) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma algebraMap_root'In_apply [Module S N] [IsScalarTower S R N] [FaithfulSMul S R] [P.IsValuedIn S] (i : ι) (x : P.corootSpan S) : diff --git a/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean b/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean index 6e3c62637c840b..472d625b5c05a5 100644 --- a/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean +++ b/Mathlib/LinearAlgebra/RootSystem/OfBilinear.lean @@ -79,6 +79,7 @@ lemma smul_coroot : B x x • coroot B hx = 2 • B x := by lemma coroot_apply_self : coroot B hx x = 2 := hx.regular.left <| by simp [mul_comm _ (B x x)] +set_option backward.isDefEq.respectTransparency false in lemma isOrthogonal_reflection (hSB : LinearMap.IsSymm B) : B.IsOrthogonal (Module.reflection (coroot_apply_self B hx)) := by intro y z diff --git a/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean b/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean index 7a9f6fa2405a7b..e016f9d502c40a 100644 --- a/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean +++ b/Mathlib/LinearAlgebra/RootSystem/RootPositive.lean @@ -139,11 +139,13 @@ def posForm : · simpa · simpa) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma algebraMap_posForm {x y : span S (range P.root)} : algebraMap S R (B.posForm x y) = B.form x y := by change Algebra.linearMap S R _ = _ simp [posForm] +set_option backward.isDefEq.respectTransparency.types false in lemma algebraMap_apply_eq_form_iff {x y : span S (range P.root)} {s : S} : algebraMap S R s = B.form x y ↔ s = B.posForm x y := by simp [RootPositiveForm.posForm] diff --git a/Mathlib/LinearAlgebra/Semisimple.lean b/Mathlib/LinearAlgebra/Semisimple.lean index b1866db02932fd..b78ec16721a518 100644 --- a/Mathlib/LinearAlgebra/Semisimple.lean +++ b/Mathlib/LinearAlgebra/Semisimple.lean @@ -139,6 +139,7 @@ lemma eq_zero_of_isNilpotent_isSemisimple (hn : IsNilpotent f) (hs : f.IsSemisim rw [← RingHom.mem_ker, ← AEval.annihilator_eq_ker_aeval (M := M)] at h0 ⊢ exact hs.annihilator_isRadical _ _ ⟨n, h0⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma eq_zero_of_isNilpotent_of_isFinitelySemisimple (hn : IsNilpotent f) (hs : IsFinitelySemisimple f) : f = 0 := by have (p) (hp₁ : p ∈ f.invtSubmodule) (hp₂ : Module.Finite R p) : f.restrict hp₁ = 0 := by diff --git a/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean b/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean index 5f7722a73daba4..a4fe7891d356c7 100644 --- a/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean +++ b/Mathlib/LinearAlgebra/SesquilinearForm/Basic.lean @@ -919,6 +919,7 @@ end Nondegenerate namespace BilinForm +set_option backward.isDefEq.respectTransparency false in lemma apply_smul_sub_smul_sub_eq [CommRing R] [AddCommGroup M] [Module R M] (B : LinearMap.BilinForm R M) (x y : M) : B ((B x y) • x - (B x x) • y) ((B x y) • x - (B x x) • y) = @@ -1009,6 +1010,7 @@ lemma nondegenerate_restrict_iff_disjoint_ker (hs : ∀ x, 0 ≤ B x x) (hB : B. variable [IsTorsionFree R M] +set_option backward.isDefEq.respectTransparency false in /-- Strict **Cauchy-Schwarz** is equivalent to linear independence for positive definite forms. -/ lemma apply_mul_apply_lt_iff_linearIndependent (hp : ∀ x, x ≠ 0 → 0 < B x x) (x y : M) : B x y * B y x < B x x * B y y ↔ LinearIndependent R ![x, y] := by diff --git a/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean b/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean index 44d8d1e7433628..b2fc28e057fb37 100644 --- a/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean +++ b/Mathlib/LinearAlgebra/SesquilinearForm/Star.lean @@ -22,6 +22,7 @@ variable {R M n : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid M] [Module [Fintype n] [DecidableEq n] {B : M →ₗ⋆[R] M →ₗ[R] R} (b : Basis n R M) +set_option backward.isDefEq.respectTransparency false in lemma LinearMap.isSymm_iff_basis {ι : Type*} (b : Basis ι R M) : IsSymm B ↔ ∀ i j, star (B (b i) (b j)) = B (b j) (b i) where mp h i j := h.eq _ _ diff --git a/Mathlib/LinearAlgebra/Span/Basic.lean b/Mathlib/LinearAlgebra/Span/Basic.lean index 8869671a304345..2504e96e74e05d 100644 --- a/Mathlib/LinearAlgebra/Span/Basic.lean +++ b/Mathlib/LinearAlgebra/Span/Basic.lean @@ -173,8 +173,14 @@ variable [Semiring S] [SMul R S] [Module S M] [IsScalarTower R S M] (p : Submodu @[simps] def inclusionSpan : p →ₗ[R] span S (p : Set M) where toFun x := ⟨x, subset_span x.property⟩ - map_add' x y := by simp - map_smul' t x := by simp + map_add' x y := by + -- TODO: This could be replaced with `simp` if `backward.isDefEq.respectTransparency false` + -- Underlying problem: `Set.Mem` being `implicit_reducible` makes unification get stuck on a + -- metavariable + simp only [coe_add, AddMemClass.mk_add_mk (A := Submodule S M)] + map_smul' t x := by + -- TODO: same problem + simp only [SetLike.val_smul, RingHom.id_apply, SetLike.mk_smul_of_tower_mk (S := Submodule S M)] lemma injective_inclusionSpan : Injective (p.inclusionSpan S) := by diff --git a/Mathlib/LinearAlgebra/Span/Defs.lean b/Mathlib/LinearAlgebra/Span/Defs.lean index 294fcbbaa076c9..f1e7055fc54fcb 100644 --- a/Mathlib/LinearAlgebra/Span/Defs.lean +++ b/Mathlib/LinearAlgebra/Span/Defs.lean @@ -679,6 +679,7 @@ theorem Module.isPrincipal_submodule_iff {p : Submodule R M} : have ⟨r, hr⟩ := mem_span_singleton.mp (ha.le x.2) exact mem_span_singleton.mpr ⟨r, Subtype.ext hr⟩ +set_option backward.isDefEq.respectTransparency false in theorem Module.IsPrincipal.of_surjective (f : M →ₗ[R] M₂) (hf : Function.Surjective f) [IsPrincipal R M] : IsPrincipal R M₂ where principal := by diff --git a/Mathlib/LinearAlgebra/SpecialLinearGroup.lean b/Mathlib/LinearAlgebra/SpecialLinearGroup.lean index 5c8c3afb9c550b..5401c68d59c058 100644 --- a/Mathlib/LinearAlgebra/SpecialLinearGroup.lean +++ b/Mathlib/LinearAlgebra/SpecialLinearGroup.lean @@ -70,6 +70,7 @@ theorem ext (u v : SpecialLinearGroup R V) : (∀ x, u x = v x) → u = v := section rankOne +set_option backward.isDefEq.respectTransparency.types false in /-- If a free module has `Module.finrank` equal to `1`, then its special linear group is trivial. -/ theorem subsingleton_of_finrank_eq_one [Module.Free R V] (d1 : Module.finrank R V = 1) : Subsingleton (SpecialLinearGroup R V) where @@ -523,6 +524,7 @@ theorem centerEquivRootsOfUnity_apply_of_finrank_le_one apply rootsOfUnity.eq_one rw [Nat.max_eq_right d1] +set_option backward.isDefEq.respectTransparency.types false in theorem centerEquivRootsOfUnity_symm_apply (r : rootsOfUnity (max (Module.finrank R V) 1) R) : (centerEquivRootsOfUnity.symm r : V →ₗ[R] V) = r • LinearMap.id := by diff --git a/Mathlib/LinearAlgebra/StdBasis.lean b/Mathlib/LinearAlgebra/StdBasis.lean index 843555ee5da950..6e83f65a5ce362 100644 --- a/Mathlib/LinearAlgebra/StdBasis.lean +++ b/Mathlib/LinearAlgebra/StdBasis.lean @@ -80,6 +80,7 @@ protected noncomputable def basis (s : ∀ j, Basis (ιs j) R (Ms j)) : ((LinearEquiv.piCongrRight fun j => (s j).repr) ≪≫ₗ (Finsupp.sigmaFinsuppLEquivPiFinsupp R).symm) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem basis_repr_single [DecidableEq η] (s : ∀ j, Basis (ιs j) R (Ms j)) (j i) : (Pi.basis s).repr (Pi.single j (s j i)) = Finsupp.single ⟨j, i⟩ 1 := by diff --git a/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean b/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean index a8e63217d9d82c..6b9897f9b1af5b 100644 --- a/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean @@ -154,6 +154,7 @@ theorem lift_ι_apply {A : Type*} [Semiring A] [Algebra R A] (f : M →ₗ[R] A) conv_rhs => rw [← ι_comp_lift f] rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lift_unique {A : Type*} [Semiring A] [Algebra R A] (f : M →ₗ[R] A) (g : TensorAlgebra R M →ₐ[R] A) : g.toLinearMap.comp (ι R) = f ↔ g = lift R f := by diff --git a/Mathlib/LinearAlgebra/TensorPower/Basic.lean b/Mathlib/LinearAlgebra/TensorPower/Basic.lean index 99590b87b2047a..91ca4bab6d29c0 100644 --- a/Mathlib/LinearAlgebra/TensorPower/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorPower/Basic.lean @@ -45,6 +45,7 @@ variable {R : Type*} {M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] namespace PiTensorProduct +set_option backward.isDefEq.respectTransparency false in /-- Two dependent pairs of tensor products are equal if their index is equal and the contents are equal after a canonical reindexing. -/ @[ext (iff := false)] @@ -133,6 +134,7 @@ theorem cast_eq_cast {i j} (h : i = j) : rw [cast_refl] rfl +set_option backward.isDefEq.respectTransparency false in variable (R) in theorem tprod_mul_tprod {na nb} (a : Fin na → M) (b : Fin nb → M) : tprod R a ₜ* tprod R b = tprod R (Fin.append a b) := by @@ -234,6 +236,7 @@ instance gsemiring : DirectSum.GSemiring fun i => ⨂[R]^i M := example : Semiring (⨁ n : ℕ, ⨂[R]^n M) := by infer_instance +set_option backward.isDefEq.respectTransparency false in /-- The tensor powers form a graded algebra. Note that this instance implies `Algebra R (⨁ n : ℕ, ⨂[R]^n M)` via `DirectSum.Algebra`. -/ diff --git a/Mathlib/LinearAlgebra/TensorProduct/Basic.lean b/Mathlib/LinearAlgebra/TensorProduct/Basic.lean index 3cfbd2f7f2c570..d3f55b484e5091 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Basic.lean @@ -308,6 +308,7 @@ variable (R) (A S M N : Type*) [AddCommMonoid M] [AddCommMonoid N] [Module R M] [CommSemiring S] [Module S M] [SMulCommClass R S M] [SMulCommClass A S M] [CompatibleSMul R A M N] +set_option backward.isDefEq.respectTransparency false in /-- If M and N are both R- and A-modules and their actions on them commute, and if the A-action on `M ⊗[R] N` can switch between the two factors, then there is a canonical S-linear map from `M ⊗[A] N` to `M ⊗[R] N`, diff --git a/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean b/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean index f4c22833bc685d..b26fafbc838363 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Graded/External.lean @@ -237,6 +237,7 @@ theorem gradedMul_one (x : (⨁ i, 𝒜 i) ⊗[R] (⨁ i, ℬ i)) : simpa only [RingHom.map_one, one_smul] using! gradedMul_algebraMap 𝒜 ℬ x 1 set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in theorem gradedMul_assoc (x y z : DirectSum _ 𝒜 ⊗[R] DirectSum _ ℬ) : gradedMul R 𝒜 ℬ (gradedMul R 𝒜 ℬ x y) z = gradedMul R 𝒜 ℬ x (gradedMul R 𝒜 ℬ y z) := by let mA := gradedMul R 𝒜 ℬ @@ -256,6 +257,7 @@ theorem gradedMul_assoc (x y z : DirectSum _ 𝒜 ⊗[R] DirectSum _ ℬ) : abel set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in theorem gradedComm_gradedMul (x y : DirectSum _ 𝒜 ⊗[R] DirectSum _ ℬ) : gradedComm R 𝒜 ℬ (gradedMul R 𝒜 ℬ x y) = gradedMul R ℬ 𝒜 (gradedComm R 𝒜 ℬ x) (gradedComm R 𝒜 ℬ y) := by diff --git a/Mathlib/LinearAlgebra/TensorProduct/Pi.lean b/Mathlib/LinearAlgebra/TensorProduct/Pi.lean index e897dd3604541f..2ee2ca073f77c4 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Pi.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Pi.lean @@ -156,6 +156,7 @@ def piScalarRightInv : (ι → N) →ₗ[S] N ⊗[R] (ι → R) := map_smul' := fun _ _ ↦ rfl } +set_option backward.isDefEq.respectTransparency false in @[simp] private lemma piScalarRightInv_single (x : N) (i : ι) : piScalarRightInv R S N ι (Pi.single i x) = x ⊗ₜ Pi.single i 1 := by diff --git a/Mathlib/LinearAlgebra/TensorProduct/Prod.lean b/Mathlib/LinearAlgebra/TensorProduct/Prod.lean index 09ae19c0dfb30d..ef54c68077180f 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Prod.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Prod.lean @@ -36,6 +36,7 @@ variable [Module R M₁] [Module S M₁] [IsScalarTower R S M₁] [Module R M₂ attribute [ext] TensorProduct.ext +set_option backward.isDefEq.respectTransparency false in /-- Tensor products distribute over a product on the right. -/ def prodRight : M₁ ⊗[R] (M₂ × M₃) ≃ₗ[S] (M₁ ⊗[R] M₂) × (M₁ ⊗[R] M₃) := LinearEquiv.ofLinear diff --git a/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean b/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean index 53349052145c1f..496e7e1550f558 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean @@ -204,6 +204,7 @@ noncomputable def lTensor.toFun (hfg : Exact f g) : rw [LinearMap.range_le_iff_comap, ← LinearMap.ker_comp, ← lTensor_comp, hfg.linearMap_comp_eq_zero, lTensor_zero, ker_zero] +set_option backward.isDefEq.respectTransparency false in /-- The inverse map in `lTensor.equiv_of_rightInverse` (computably, given a right inverse) -/ noncomputable def lTensor.inverse_of_rightInverse {h : P → N} (hfg : Exact f g) (hgh : Function.RightInverse h g) : @@ -311,6 +312,7 @@ noncomputable def rTensor.toFun (hfg : Exact f g) : rw [range_le_iff_comap, ← ker_comp, ← rTensor_comp, hfg.linearMap_comp_eq_zero, rTensor_zero, ker_zero] +set_option backward.isDefEq.respectTransparency false in /-- The inverse map in `rTensor.equiv_of_rightInverse` (computably, given a right inverse) -/ noncomputable def rTensor.inverse_of_rightInverse {h : P → N} (hfg : Exact f g) (hgh : Function.RightInverse h g) : diff --git a/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean b/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean index 7ec7f4c133f8f9..c4aed7c31ee8e3 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Subalgebra.lean @@ -129,6 +129,7 @@ namespace Algebra.TensorProduct variable (R S T) +set_option backward.isDefEq.respectTransparency false in /-- Given `R`-algebras `S,T`, there is a natural `R`-linear isomorphism from `S ⊗[R] T` to `S' ⊗[R] T'` where `S',T'` are the images of `S,T` in `S ⊗[R] T` respectively. This is promoted to an `R`-algebra isomorphism `Algebra.TensorProduct.algEquivIncludeRange`. -/ diff --git a/Mathlib/LinearAlgebra/TensorProduct/Tower.lean b/Mathlib/LinearAlgebra/TensorProduct/Tower.lean index c71de9452136f5..1a388d0358d181 100644 --- a/Mathlib/LinearAlgebra/TensorProduct/Tower.lean +++ b/Mathlib/LinearAlgebra/TensorProduct/Tower.lean @@ -519,6 +519,7 @@ section rightComm variable [CommSemiring S] [Module S M] [Module S P] [Algebra S B] [IsScalarTower S B M] [SMulCommClass R S M] [SMulCommClass S R M] +set_option backward.isDefEq.respectTransparency false in variable (S) in /-- A tensor product analogue of `mul_right_comm`. diff --git a/Mathlib/LinearAlgebra/UnitaryGroup.lean b/Mathlib/LinearAlgebra/UnitaryGroup.lean index 22e5dd7e6da820..2bc60a3c9927cd 100644 --- a/Mathlib/LinearAlgebra/UnitaryGroup.lean +++ b/Mathlib/LinearAlgebra/UnitaryGroup.lean @@ -324,6 +324,7 @@ theorem mem_specialOrthogonalGroup_iff : A ∈ specialOrthogonalGroup n R ↔ A ∈ orthogonalGroup n R ∧ A.det = 1 := Iff.rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma of_mem_specialOrthogonalGroup_fin_two_iff {a b c d : R} : !![a, b; c, d] ∈ Matrix.specialOrthogonalGroup (Fin 2) R ↔ diff --git a/Mathlib/Logic/Basic.lean b/Mathlib/Logic/Basic.lean index 482715df4ee0f9..dc6c53c90b2797 100644 --- a/Mathlib/Logic/Basic.lean +++ b/Mathlib/Logic/Basic.lean @@ -765,15 +765,15 @@ noncomputable def dec (p : Prop) : Decidable p := by infer_instance variable {α : Sort*} /-- Any predicate `p` is decidable classically. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def decPred (p : α → Prop) : DecidablePred p := by infer_instance /-- Any relation `p` is decidable classically. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def decRel (p : α → α → Prop) : DecidableRel p := by infer_instance /-- Any type `α` has decidable equality classically. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def decEq (α : Sort*) : DecidableEq α := by infer_instance /-- Construct a function from a default value `H0`, and a function to use if there exists a value diff --git a/Mathlib/Logic/Denumerable.lean b/Mathlib/Logic/Denumerable.lean index 64df6daf6dd46f..14704c6118997c 100644 --- a/Mathlib/Logic/Denumerable.lean +++ b/Mathlib/Logic/Denumerable.lean @@ -76,7 +76,7 @@ instance (priority := 100) : Infinite α := Infinite.of_surjective _ (eqv α).surjective /-- A type equivalent to `ℕ` is denumerable. -/ -@[implicit_reducible] +@[instance_reducible] def mk' {α} (e : α ≃ ℕ) : Denumerable α where encode := e decode := some ∘ e.symm @@ -85,7 +85,7 @@ def mk' {α} (e : α ≃ ℕ) : Denumerable α where /-- Denumerability is conserved by equivalences. This is transitivity of equivalence the denumerable way. -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv (α) {β} [Denumerable α] (e : β ≃ α) : Denumerable β := { Encodable.ofEquiv _ e with decode_inv := fun n => by @@ -297,7 +297,7 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Any infinite set of naturals is denumerable. -/ -@[implicit_reducible] +@[instance_reducible] def denumerable (s : Set ℕ) [DecidablePred (· ∈ s)] [Infinite s] : Denumerable s := Denumerable.ofEquiv ℕ { toFun := toFunAux @@ -312,7 +312,7 @@ namespace Denumerable open Encodable /-- An infinite encodable type is denumerable. -/ -@[implicit_reducible] +@[instance_reducible] def ofEncodableOfInfinite (α : Type*) [Encodable α] [Infinite α] : Denumerable α := by letI := @decidableRangeEncode α _ letI : Infinite (Set.range (@encode α _)) := diff --git a/Mathlib/Logic/Embedding/Set.lean b/Mathlib/Logic/Embedding/Set.lean index d0136440aafa1c..ab78cd95916d76 100644 --- a/Mathlib/Logic/Embedding/Set.lean +++ b/Mathlib/Logic/Embedding/Set.lean @@ -45,6 +45,7 @@ namespace Embedding def optionElim {α β} (f : α ↪ β) (x : β) (h : x ∉ Set.range f) : Option α ↪ β := ⟨Option.elim' x f, Option.injective_iff.2 ⟨f.2, h⟩⟩ +set_option backward.isDefEq.respectTransparency false in /-- Equivalence between embeddings of `Option α` and a sigma type over the embeddings of `α`. -/ @[simps] def optionEmbeddingEquiv (α β) : (Option α ↪ β) ≃ Σ f : α ↪ β, ↥(Set.range f)ᶜ where diff --git a/Mathlib/Logic/Encodable/Basic.lean b/Mathlib/Logic/Encodable/Basic.lean index 33da624467b19e..3387a71bde9395 100644 --- a/Mathlib/Logic/Encodable/Basic.lean +++ b/Mathlib/Logic/Encodable/Basic.lean @@ -93,20 +93,20 @@ def decidableEqOfEncodable (α) [Encodable α] : DecidableEq α | _, _ => decidable_of_iff _ encode_inj /-- If `α` is encodable and there is an injection `f : β → α`, then `β` is encodable as well. -/ -@[implicit_reducible] +@[instance_reducible] def ofLeftInjection [Encodable α] (f : β → α) (finv : α → Option β) (linv : ∀ b, finv (f b) = some b) : Encodable β := ⟨fun b => encode (f b), fun n => (decode n).bind finv, fun b => by simp [Encodable.encodek, linv]⟩ /-- If `α` is encodable and `f : β → α` is invertible, then `β` is encodable as well. -/ -@[implicit_reducible] +@[instance_reducible] def ofLeftInverse [Encodable α] (f : β → α) (finv : α → β) (linv : ∀ b, finv (f b) = b) : Encodable β := ofLeftInjection f (some ∘ finv) fun b => congr_arg some (linv b) /-- Encodability is preserved by equivalence. -/ -@[implicit_reducible] +@[instance_reducible] def ofEquiv (α) [Encodable α] (e : β ≃ α) : Encodable β := ofLeftInverse e e.symm e.left_inv @@ -226,7 +226,7 @@ def equivRangeEncode (α : Type*) [Encodable α] : α ≃ Set.range (@encode α right_inv _ := Subtype.ext <| decode₂_isPartialInv.get_eq _ _ /-- A type with unique element is encodable. This is not an instance to avoid diamonds. -/ -@[implicit_reducible] +@[instance_reducible] def _root_.Unique.encodable [Unique α] : Encodable α := ⟨fun _ => 0, fun _ => some default, Unique.forall_iff.2 rfl⟩ @@ -387,12 +387,12 @@ instance _root_.PLift.encodable [Encodable α] : Encodable (PLift α) := ofEquiv _ Equiv.plift /-- If `β` is encodable and there is an injection `f : α → β`, then `α` is encodable as well. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofInj [Encodable β] (f : α → β) (hf : Injective f) : Encodable α := ofLeftInjection f (partialInv f) hf.isPartialInv.eq /-- If `α` is countable, then it has a (non-canonical) `Encodable` structure. -/ -@[no_expose, implicit_reducible] +@[no_expose, instance_reducible] noncomputable def ofCountable (α : Type*) [Countable α] : Encodable α := Nonempty.some <| let ⟨f, hf⟩ := exists_injective_nat α @@ -615,7 +615,7 @@ theorem Quotient.rep_spec (q : Quotient s) : ⟦q.rep⟧ = q := choose_spec (exists_rep q) /-- The quotient of an encodable space by a decidable equivalence relation is encodable. -/ -@[implicit_reducible] +@[instance_reducible] def encodableQuotient : Encodable (Quotient s) := ⟨fun q => encode q.rep, fun n => Quotient.mk'' <$> decode n, by rintro ⟨l⟩; dsimp; rw [encodek]; exact congr_arg some ⟦l⟧.rep_spec⟩ diff --git a/Mathlib/Logic/Equiv/Basic.lean b/Mathlib/Logic/Equiv/Basic.lean index 71f756841ff173..6073fbca15a213 100644 --- a/Mathlib/Logic/Equiv/Basic.lean +++ b/Mathlib/Logic/Equiv/Basic.lean @@ -442,6 +442,7 @@ def sigmaSubtype {α : Type*} {β : α → Type*} (a : α) : section attribute [local simp] Trans.trans sigmaAssoc subtypeSigmaEquiv uniqueSigma eqRec_eq_cast +set_option backward.isDefEq.respectTransparency.types false in /-- A subtype of a dependent triple which pins down both bases is equivalent to the respective fiber. -/ @[simps! +simpRhs apply] @@ -456,6 +457,7 @@ def sigmaSigmaSubtype {α : Type*} {β : α → Type*} {γ : (a : α) → β a _ ≃ γ a b := Equiv.cast <| by rw [← show ⟨⟨a, b⟩, h⟩ = uniq.default from uniq.uniq _] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma sigmaSigmaSubtype_symm_apply {α : Type*} {β : α → Type*} {γ : (a : α) → β a → Type*} (p : (a : α) × β a → Prop) [uniq : Unique {ab // p ab}] @@ -474,6 +476,7 @@ def sigmaSigmaSubtypeEq {α β : Type*} {γ : α → β → Type*} (a : α) (b : sigmaSigmaSubtype (fun ⟨a', b'⟩ ↦ a' = a ∧ b' = b) ⟨rfl, rfl⟩ set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma sigmaSigmaSubtypeEq_apply {α β : Type*} {γ : α → β → Type*} {a : α} {b : β} (s : {s : (a : α) × (b : β) × γ a b // s.1 = a ∧ s.2.1 = b}) : @@ -813,6 +816,7 @@ LHS would have type `P a` while the RHS would have type `P (e.symm (e a))`. For we have to explicitly substitute along `e.symm (e a) = a` in the statement of this lemma. -/ add_decl_doc Equiv.piCongrLeft'_symm_apply +set_option backward.isDefEq.respectTransparency.types false in /-- This lemma is impractical to state in the dependent case. -/ @[simp] theorem piCongrLeft'_symm (P : Sort*) (e : α ≃ β) : diff --git a/Mathlib/Logic/Equiv/Defs.lean b/Mathlib/Logic/Equiv/Defs.lean index fccce9f90c4a52..c7a8e1589a9b8b 100644 --- a/Mathlib/Logic/Equiv/Defs.lean +++ b/Mathlib/Logic/Equiv/Defs.lean @@ -143,7 +143,7 @@ protected theorem Perm.congr_fun {f g : Equiv.Perm α} (h : f = g) (x : α) : f instance inhabited' : Inhabited (α ≃ α) := ⟨Equiv.refl α⟩ /-- Inverse of an equivalence `e : α ≃ β`. -/ -@[symm] +@[symm, implicit_reducible] protected def symm (e : α ≃ β) : β ≃ α := ⟨e.invFun, e.toFun, e.right_inv, e.left_inv⟩ /-- See Note [custom simps projection] -/ diff --git a/Mathlib/Logic/Equiv/Embedding.lean b/Mathlib/Logic/Equiv/Embedding.lean index 0567b1ccbfbf6b..5c6c7979d37b0b 100644 --- a/Mathlib/Logic/Equiv/Embedding.lean +++ b/Mathlib/Logic/Equiv/Embedding.lean @@ -81,6 +81,7 @@ def sumEmbeddingEquivSigmaEmbeddingRestricted {α β γ : Type*} : Equiv.trans sumEmbeddingEquivProdEmbeddingDisjoint prodEmbeddingDisjointEquivSigmaEmbeddingRestricted +set_option backward.isDefEq.respectTransparency false in /-- Embeddings from a single-member type are equivalent to members of the target type. -/ def uniqueEmbeddingEquivResult {α β : Type*} [Unique α] : (α ↪ β) ≃ β where diff --git a/Mathlib/Logic/Equiv/Fin/Basic.lean b/Mathlib/Logic/Equiv/Fin/Basic.lean index 341c95b6f54503..6b5a49569b846e 100644 --- a/Mathlib/Logic/Equiv/Fin/Basic.lean +++ b/Mathlib/Logic/Equiv/Fin/Basic.lean @@ -29,6 +29,7 @@ variable {m n : ℕ} This is currently not very sorted. PRs welcome! -/ +set_option backward.isDefEq.respectTransparency false in theorem Fin.preimage_apply_01_prod {α : Fin 2 → Type u} (s : Set (α 0)) (t : Set (α 1)) : (fun f : ∀ i, α i => (f 0, f 1)) ⁻¹' s ×ˢ t = Set.pi Set.univ (Fin.cons s <| Fin.cons t finZeroElim) := by @@ -61,6 +62,7 @@ def finSuccEquiv' (i : Fin (n + 1)) : Fin (n + 1) ≃ Option (Fin n) where left_inv x := Fin.succAboveCases i (by simp) (fun j => by simp) x right_inv x := by cases x <;> simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem finSuccEquiv'_at (i : Fin (n + 1)) : (finSuccEquiv' i) i = none := by simp [finSuccEquiv'] diff --git a/Mathlib/Logic/Equiv/Fintype.lean b/Mathlib/Logic/Equiv/Fintype.lean index 6005758b19ffc1..4f479569a17086 100644 --- a/Mathlib/Logic/Equiv/Fintype.lean +++ b/Mathlib/Logic/Equiv/Fintype.lean @@ -135,6 +135,7 @@ Note that when `p = q`, `Equiv.Perm.subtypeCongr e (Equiv.refl _)` can be used i noncomputable abbrev extendSubtype (e : { x // p x } ≃ { x // q x }) : Perm α := subtypeCongr e e.toCompl +set_option backward.isDefEq.respectTransparency false in theorem extendSubtype_apply_of_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : e.extendSubtype x = e ⟨x, hx⟩ := by simp [extendSubtype, subtypeCongr, sumCompl_symm_apply_of_pos hx] @@ -145,8 +146,8 @@ theorem extendSubtype_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : theorem extendSubtype_apply_of_not_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : ¬p x) : e.extendSubtype x = e.toCompl ⟨x, hx⟩ := by - simp only [extendSubtype, subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply, - sumCompl_symm_apply_of_neg hx, Sum.map_inr, sumCompl_apply_inr] + simp only [extendSubtype, subtypeCongr, Equiv.trans_apply, + sumCompl_symm_apply_of_neg hx] rfl theorem extendSubtype_not_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : ¬p x) : diff --git a/Mathlib/Logic/Equiv/List.lean b/Mathlib/Logic/Equiv/List.lean index 06a9ad7ac808f8..f20f7fb0ed6bd7 100644 --- a/Mathlib/Logic/Equiv/List.lean +++ b/Mathlib/Logic/Equiv/List.lean @@ -106,7 +106,7 @@ instance _root_.Finset.countable [Countable α] : Countable (Finset α) := Finset.val_injective.countable /-- A listable type with decidable equality is encodable. -/ -@[implicit_reducible] +@[instance_reducible] def encodableOfList [DecidableEq α] (l : List α) (H : ∀ x, x ∈ l) : Encodable α := ⟨fun a => idxOf a l, (l[·]?), fun _ => getElem?_idxOf (H _)⟩ @@ -119,7 +119,7 @@ def _root_.Fintype.truncEncodable (α : Type*) [DecidableEq α] [Fintype α] : T /-- A noncomputable way to arbitrarily choose an ordering on a finite type. It is not made into a global instance, since it involves an arbitrary choice. This can be locally made into an instance with `attribute [local instance] Fintype.toEncodable`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def _root_.Fintype.toEncodable (α : Type*) [Fintype α] : Encodable α := by classical exact (Fintype.truncEncodable α).out diff --git a/Mathlib/Logic/Equiv/Option.lean b/Mathlib/Logic/Equiv/Option.lean index 7da0084a1b0c6f..fa1523dc0f1646 100644 --- a/Mathlib/Logic/Equiv/Option.lean +++ b/Mathlib/Logic/Equiv/Option.lean @@ -145,6 +145,7 @@ end RemoveNone theorem optionCongr_injective : Function.Injective (optionCongr : α ≃ β → Option α ≃ Option β) := Function.LeftInverse.injective removeNone_optionCongr +set_option backward.isDefEq.respectTransparency false in /-- Equivalences between `Option α` and `β` that send `none` to `x` are equivalent to equivalences between `α` and `{y : β // y ≠ x}`. -/ def optionSubtype [DecidableEq β] (x : β) : @@ -198,6 +199,7 @@ theorem coe_optionSubtype_apply_apply (e : { e : Option α ≃ β // e none = x }) (a : α) : ↑(optionSubtype x e a) = (e : Option α ≃ β) a := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem optionSubtype_apply_symm_apply [DecidableEq β] (x : β) @@ -226,6 +228,7 @@ theorem optionSubtype_symm_apply_apply_none (e : α ≃ { y : β // y ≠ x }) : ((optionSubtype x).symm e : Option α ≃ β) none = x := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem optionSubtype_symm_apply_symm_apply [DecidableEq β] (x : β) (e : α ≃ { y : β // y ≠ x }) (b : { y : β // y ≠ x }) : ((optionSubtype x).symm e : Option α ≃ β).symm b = e.symm b := by diff --git a/Mathlib/Logic/Equiv/Set.lean b/Mathlib/Logic/Equiv/Set.lean index 138daff2d913d2..db241ea275713f 100644 --- a/Mathlib/Logic/Equiv/Set.lean +++ b/Mathlib/Logic/Equiv/Set.lean @@ -340,7 +340,7 @@ theorem sumDiffSubset_symm_apply_of_mem {α} {s t : Set α} (h : s ⊆ t) [Decid theorem sumDiffSubset_symm_apply_of_notMem {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)] {x : t} (hx : x.1 ∉ s) : (Equiv.Set.sumDiffSubset h).symm x = Sum.inr ⟨x, ⟨x.2, hx⟩⟩ := by apply (Equiv.Set.sumDiffSubset h).injective - simp only [apply_symm_apply, sumDiffSubset_apply_inr, Set.inclusion_mk] + simp only [apply_symm_apply, sumDiffSubset_apply_inr] /-- If `s` is a set with decidable membership, then the sum of `s ∪ t` and `s ∩ t` is equivalent to `s ⊕ t`. -/ @@ -361,6 +361,7 @@ protected def unionSumInter {α : Type u} (s t : Set α) [DecidablePred (· ∈ { rw [(_ : t \ s ∪ s ∩ t = t)] rw [union_comm, inter_comm, inter_union_diff] } +set_option backward.isDefEq.respectTransparency false in /-- Given an equivalence `e₀` between sets `s : Set α` and `t : Set β`, the set of equivalences `e : α ≃ β` such that `e ↑x = ↑(e₀ x)` for each `x : s` is equivalent to the set of equivalences between `sᶜ` and `tᶜ`. -/ @@ -428,6 +429,7 @@ protected theorem image_symm_apply {α β} (f : α → β) (s : Set α) (H : Inj (h : f x ∈ f '' s) : (Set.image f s H).symm ⟨f x, h⟩ = ⟨x, H.mem_set_image.1 h⟩ := (Equiv.symm_apply_eq _).2 rfl +set_option backward.isDefEq.respectTransparency false in theorem image_symm_preimage {α β} {f : α → β} (hf : Injective f) (u s : Set α) : (fun x => (Set.image f s hf).symm x : f '' s → α) ⁻¹' u = Subtype.val ⁻¹' f '' u := by ext ⟨b, a, has, rfl⟩ diff --git a/Mathlib/Logic/Relation.lean b/Mathlib/Logic/Relation.lean index 8b73307272bbb7..6a9ba13e32be32 100644 --- a/Mathlib/Logic/Relation.lean +++ b/Mathlib/Logic/Relation.lean @@ -787,7 +787,7 @@ theorem is_equivalence : Equivalence (@EqvGen α r) := The motivation for this definition is that `Quot r` behaves like `Quotient (EqvGen.setoid r)`, see for example `Quot.eqvGen_exact` and `Quot.eqvGen_sound`. -/ -@[implicit_reducible] +@[instance_reducible] def setoid : Setoid α := Setoid.mk _ (EqvGen.is_equivalence r) diff --git a/Mathlib/Logic/Small/Defs.lean b/Mathlib/Logic/Small/Defs.lean index 0699f6fceed2b8..3bea24e2b35134 100644 --- a/Mathlib/Logic/Small/Defs.lean +++ b/Mathlib/Logic/Small/Defs.lean @@ -118,6 +118,7 @@ instance small_sigma {α} (β : α → Type*) [Small.{w} α] [∀ a, Small.{w} ( ⟨⟨Σ a' : Shrink α, Shrink (β ((equivShrink α).symm a')), ⟨Equiv.sigmaCongr (equivShrink α) fun a => by simpa using equivShrink (β a)⟩⟩⟩ +set_option backward.isDefEq.respectTransparency false in theorem not_small_type : ¬Small.{u} (Type max u v) | ⟨⟨S, ⟨e⟩⟩⟩ => @Function.cantor_injective (Σ α, e.symm α) (fun a => ⟨_, cast (e.3 _).symm a⟩) fun a b e => by diff --git a/Mathlib/Logic/Unique.lean b/Mathlib/Logic/Unique.lean index e58e08169f6e71..dae1020bde6485 100644 --- a/Mathlib/Logic/Unique.lean +++ b/Mathlib/Logic/Unique.lean @@ -89,7 +89,7 @@ theorem PUnit.default_eq_unit : (default : PUnit) = PUnit.unit := rfl /-- Every provable proposition is unique, as all proofs are equal. -/ -@[implicit_reducible] +@[instance_reducible] def uniqueProp {p : Prop} (h : p) : Unique.{0} p where default := h uniq _ := rfl @@ -198,18 +198,18 @@ protected theorem Surjective.subsingleton [Subsingleton α] (hf : Surjective f) /-- If the domain of a surjective function is a singleton, then the codomain is a singleton as well. -/ -@[implicit_reducible] +@[instance_reducible] protected def Surjective.unique {α : Sort u} (f : α → β) (hf : Surjective f) [Unique.{u} α] : Unique β := @Unique.mk' _ ⟨f default⟩ hf.subsingleton /-- If `α` is inhabited and admits an injective map to a subsingleton type, then `α` is `Unique`. -/ -@[implicit_reducible] +@[instance_reducible] protected def Injective.unique [Inhabited α] [Subsingleton β] (hf : Injective f) : Unique α := @Unique.mk' _ _ hf.subsingleton /-- If a constant function is surjective, then the codomain is a singleton. -/ -@[implicit_reducible] +@[instance_reducible] def Surjective.uniqueOfSurjectiveConst (α : Type*) {β : Type*} (b : β) (h : Function.Surjective (Function.const α b)) : Unique β := @uniqueOfSubsingleton _ (subsingleton_of_forall_eq b <| h.forall.mpr fun _ ↦ rfl) b diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean index f5041396f674c9..5c72db98c67204 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean @@ -49,7 +49,7 @@ variable {α β γ γ₂ δ : Type*} {ι : Sort y} {s t u : Set α} open MeasurableSpace TopologicalSpace /-- `MeasurableSpace` structure generated by `TopologicalSpace`. -/ -@[implicit_reducible] +@[instance_reducible] def borel (α : Type u) [TopologicalSpace α] : MeasurableSpace α := generateFrom { s : Set α | IsOpen s } diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 238655e953b34e..12ef9cc575b51c 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -393,7 +393,7 @@ variable {α ι : Type*} {X : ι → Type*} {mα : MeasurableSpace α} [m : ∀ /-- The σ-algebra of cylinder events on `Δ`. It is the smallest σ-algebra making the projections on the `i`-th coordinate measurable for all `i ∈ Δ`. -/ -@[implicit_reducible] +@[instance_reducible] def cylinderEvents (Δ : Set ι) : MeasurableSpace (∀ i, X i) := ⨆ i ∈ Δ, (m i).comap fun σ ↦ σ i @[simp] lemma cylinderEvents_univ : cylinderEvents (X := X) univ = MeasurableSpace.pi := by diff --git a/Mathlib/MeasureTheory/Constructions/Pi.lean b/Mathlib/MeasureTheory/Constructions/Pi.lean index 787ddf9fd15e72..59575560c8a56a 100644 --- a/Mathlib/MeasureTheory/Constructions/Pi.lean +++ b/Mathlib/MeasureTheory/Constructions/Pi.lean @@ -164,7 +164,7 @@ theorem tprod_tprod (l : List δ) (μ : ∀ i, Measure (X i)) [∀ i, SigmaFinit | nil => simp | cons a l ih => rw [tprod_cons, Set.tprod] - dsimp only [foldr_cons, map_cons, prod_cons] + simp only [foldr_cons, prod_cons, map_cons] rw [prod_prod, ih] end Tprod @@ -918,6 +918,7 @@ theorem volume_preserving_pi {α' β' : ι → Type*} [∀ i, MeasureSpace (α' MeasurePreserving (fun (a : (i : ι) → α' i) (i : ι) ↦ (f i) (a i)) := measurePreserving_pi _ _ hf +set_option backward.isDefEq.respectTransparency.types false in /-- The measurable equiv `(α₁ → β₁) ≃ᵐ (α₂ → β₂)` induced by `α₁ ≃ α₂` and `β₁ ≃ᵐ β₂` is measure preserving. -/ theorem measurePreserving_arrowCongr' {α₁ β₁ α₂ β₂ : Type*} [Fintype α₁] [Fintype α₂] diff --git a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean index 58e8299525bb86..a2e9f47aeb6cb8 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean @@ -91,7 +91,7 @@ a compatible Polish topology. Warning: following this with `borelize α` will cause an error. Instead, one can rewrite with `eq_borel_upgradeStandardBorel α`. TODO: fix the corresponding bug in `borelize`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def upgradeStandardBorel [MeasurableSpace α] [h : StandardBorelSpace α] : UpgradedStandardBorel α := by diff --git a/Mathlib/MeasureTheory/Constructions/UnitInterval.lean b/Mathlib/MeasureTheory/Constructions/UnitInterval.lean index b84fdf2a05dbae..8f99b89ab86a1b 100644 --- a/Mathlib/MeasureTheory/Constructions/UnitInterval.lean +++ b/Mathlib/MeasureTheory/Constructions/UnitInterval.lean @@ -49,6 +49,7 @@ instance : NoAtoms (volume : Measure I) where @[fun_prop] theorem measurable_symm : Measurable σ := continuous_symm.measurable +set_option backward.isDefEq.respectTransparency.types false in /-- `unitInterval.symm` bundled as a measurable equivalence. -/ @[simps apply] def symmMeasurableEquiv : I ≃ᵐ I where @@ -57,12 +58,15 @@ def symmMeasurableEquiv : I ≃ᵐ I where left_inv := symm_symm right_inv := symm_symm +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma symm_symmMeasurableEquiv : symmMeasurableEquiv.symm = symmMeasurableEquiv := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma coe_symmMeasurableEquiv : symmMeasurableEquiv = σ := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma measurePreserving_symm : MeasurePreserving symm volume volume where measurable := measurable_symm map_eq := by diff --git a/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean b/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean index a645729572b49b..a1dbc80dda9621 100644 --- a/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean +++ b/Mathlib/MeasureTheory/Covering/LiminfLimsup.lean @@ -227,6 +227,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M blimsup_congr (Eventually.of_forall h₂)] exact ae_eq_set_union (this (fun i => p i ∧ 0 < r i) hr') (ae_eq_refl _) +set_option backward.isDefEq.respectTransparency.types false in theorem blimsup_cthickening_ae_eq_blimsup_thickening {p : ℕ → Prop} {s : ℕ → Set α} {r : ℕ → ℝ} (hr : Tendsto r atTop (𝓝 0)) (hr' : ∀ᶠ i in atTop, p i → 0 < r i) : (blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) =ᵐ[μ] diff --git a/Mathlib/MeasureTheory/Function/AEEqFun.lean b/Mathlib/MeasureTheory/Function/AEEqFun.lean index 506c28877e204b..20c8788674dbc6 100644 --- a/Mathlib/MeasureTheory/Function/AEEqFun.lean +++ b/Mathlib/MeasureTheory/Function/AEEqFun.lean @@ -90,7 +90,7 @@ variable (β) /-- The equivalence relation of being almost everywhere equal for almost everywhere strongly measurable functions. -/ -@[implicit_reducible] +@[instance_reducible] def Measure.aeEqSetoid (μ : Measure α) : Setoid { f : α → β // AEStronglyMeasurable f μ } := ⟨fun f g => (f : α → β) =ᵐ[μ] g, fun {f} => ae_eq_refl f.val, fun {_ _} => ae_eq_symm, fun {_ _ _} => ae_eq_trans⟩ @@ -515,10 +515,12 @@ theorem compMeasurable_toGerm [MeasurableSpace β] [BorelSpace β] [PseudoMetriz (compMeasurable g hg f).toGerm = f.toGerm.map g := induction_on f fun f _ => by simp +set_option backward.isDefEq.respectTransparency false in theorem comp₂_toGerm (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α →ₘ[μ] β) (f₂ : α →ₘ[μ] γ) : (comp₂ g hg f₁ f₂).toGerm = f₁.toGerm.map₂ g f₂.toGerm := induction_on₂ f₁ f₂ fun f₁ _ f₂ _ => by simp +set_option backward.isDefEq.respectTransparency false in theorem comp₂Measurable_toGerm [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] [PseudoMetrizableSpace γ] [SecondCountableTopologyEither β γ] [MeasurableSpace γ] [BorelSpace γ] [PseudoMetrizableSpace δ] [SecondCountableTopology δ] @@ -647,6 +649,7 @@ def const (b : β) : α →ₘ[μ] β := theorem coeFn_const (b : β) : (const α b : α →ₘ[μ] β) =ᵐ[μ] Function.const α b := coeFn_mk _ _ +set_option backward.isDefEq.respectTransparency false in /-- If the measure is nonzero, we can strengthen `coeFn_const` to get an equality. -/ @[simp] theorem coeFn_const_eq [NeZero μ] (b : β) (x : α) : (const α b : α →ₘ[μ] β) x = b := by diff --git a/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean b/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean index 63e8007d1a8fa5..c69a951cce9074 100644 --- a/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean +++ b/Mathlib/MeasureTheory/Function/ConvergenceInDistribution.lean @@ -75,6 +75,7 @@ lemma tendstoInDistribution_const [OpensMeasurableSpace E] (hZ : AEMeasurable Z forall_aemeasurable := fun _ ↦ by fun_prop tendsto := tendsto_const_nhds +set_option backward.isDefEq.respectTransparency.types false in lemma tendstoInDistribution_of_identDistrib [OpensMeasurableSpace E] (i : ι) (hX : ∀ j, IdentDistrib (X i) (X j) (μ i) (μ j)) (hZ : IdentDistrib (X i) Z (μ i) μ') : TendstoInDistribution X l Z μ μ' where @@ -84,6 +85,7 @@ lemma tendstoInDistribution_of_identDistrib [OpensMeasurableSpace E] (i : ι) convert! tendsto_const_nhds with j exact (hX j).map_eq.symm.trans hZ.map_eq +set_option backward.isDefEq.respectTransparency.types false in protected lemma TendstoInDistribution.congr [OpensMeasurableSpace E] {T : Ω' → E} (hXY : ∀ i, X i =ᵐ[μ i] Y i) (hZT : Z =ᵐ[μ'] T) (h : TendstoInDistribution X l Z μ μ') : TendstoInDistribution Y l T μ μ' where @@ -113,6 +115,7 @@ lemma tendstoInDistribution_unique [HasOuterApproxClosed E] [BorelSpace E] rw [Subtype.ext_iff] at h_eq simpa using h_eq +set_option backward.isDefEq.respectTransparency.types false in /-- **Continuous mapping theorem**: if `X n` tends to `Z` in distribution and `g` is continuous, then `g ∘ X n` tends to `g ∘ Z` in distribution. -/ theorem TendstoInDistribution.continuous_comp {F : Type*} [OpensMeasurableSpace E] @@ -265,6 +268,7 @@ lemma TendstoInMeasure.tendstoInDistribution [l.NeBot] [l.IsCountablyGenerated] TendstoInDistribution X l Z (fun _ ↦ μ') μ' := h.tendstoInDistribution_of_aemeasurable hX (h.aemeasurable hX) +set_option backward.isDefEq.respectTransparency.types false in /-- **Slutsky's theorem**: if `X n` converges in distribution to `Z`, and `Y n` converges in probability to a constant `c`, then the pair `(X n, Y n)` converges in distribution to `(Z, c)`. -/ theorem TendstoInDistribution.prodMk_of_tendstoInMeasure_const diff --git a/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean b/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean index 14d1260b68cf3c..15b011b75b94d9 100644 --- a/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean +++ b/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean @@ -661,16 +661,19 @@ theorem MonotoneOn.memLp_isCompact [IsFiniteMeasureOnCompacts μ] (hs : IsCompac · exact hmono.memLp_of_measure_ne_top (hs.isLeast_sInf h) (hs.isGreatest_sSup h) hs.measure_lt_top.ne hs.measurableSet +set_option backward.isDefEq.respectTransparency.types false in theorem AntitoneOn.memLp_top (hanti : AntitoneOn f s) {a b : X} (ha : IsLeast s a) (hb : IsGreatest s b) (h's : MeasurableSet s) : MemLp f ∞ (μ.restrict s) := MonotoneOn.memLp_top (E := Eᵒᵈ) hanti ha hb h's +set_option backward.isDefEq.respectTransparency.types false in theorem AntitoneOn.memLp_of_measure_ne_top (hanti : AntitoneOn f s) {a b : X} (ha : IsLeast s a) (hb : IsGreatest s b) (hs : μ s ≠ ∞) (h's : MeasurableSet s) : MemLp f p (μ.restrict s) := MonotoneOn.memLp_of_measure_ne_top (E := Eᵒᵈ) hanti ha hb hs h's +set_option backward.isDefEq.respectTransparency.types false in theorem AntitoneOn.memLp_isCompact [IsFiniteMeasureOnCompacts μ] (hs : IsCompact s) (hanti : AntitoneOn f s) : MemLp f p (μ.restrict s) := MonotoneOn.memLp_isCompact (E := Eᵒᵈ) hs hanti @@ -705,6 +708,7 @@ theorem Monotone.locallyIntegrable [IsLocallyFiniteMeasure μ] (hmono : Monotone (hmono.monotoneOn _).integrableOn_of_measure_ne_top (isLeast_Icc ab) (isGreatest_Icc ab) ((measure_mono abU).trans_lt h'U).ne measurableSet_Icc +set_option backward.isDefEq.respectTransparency.types false in theorem Antitone.locallyIntegrable [IsLocallyFiniteMeasure μ] (hanti : Antitone f) : LocallyIntegrable f μ := hanti.dual_right.locallyIntegrable diff --git a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean index b1fa212defe3a1..3d73d760ee510f 100644 --- a/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean +++ b/Mathlib/MeasureTheory/Function/LpSpace/Basic.lean @@ -111,9 +111,11 @@ theorem toLp_val {f : α → E} (h : MemLp f p μ) : (toLp f h).1 = AEEqFun.mk f theorem coeFn_toLp {f : α → E} (hf : MemLp f p μ) : hf.toLp f =ᵐ[μ] f := AEEqFun.coeFn_mk _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem toLp_congr {f g : α → E} (hf : MemLp f p μ) (hg : MemLp g p μ) (hfg : f =ᵐ[μ] g) : hf.toLp f = hg.toLp g := by simp [toLp, hfg] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toLp_eq_toLp_iff {f g : α → E} (hf : MemLp f p μ) (hg : MemLp g p μ) : hf.toLp f = hg.toLp g ↔ f =ᵐ[μ] g := by simp [toLp] diff --git a/Mathlib/MeasureTheory/Function/SimpleFunc.lean b/Mathlib/MeasureTheory/Function/SimpleFunc.lean index a4fe1848af01bc..0e1fba6f0e05f8 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFunc.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFunc.lean @@ -225,6 +225,7 @@ theorem support_indicator [Zero β] {s : Set α} (hs : MeasurableSet s) (f : α Function.support (f.piecewise s hs (SimpleFunc.const α 0)) = s ∩ Function.support f := Set.support_indicator +set_option backward.isDefEq.respectTransparency false in open scoped Classical in theorem range_indicator {s : Set α} (hs : MeasurableSet s) (hs_nonempty : s.Nonempty) (hs_ne_univ : s ≠ univ) (x y : β) : diff --git a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean index 06aa99056c5bee..503596a70bb8cb 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean @@ -488,6 +488,7 @@ theorem toLp_add (f g : α →ₛ E) (hf : MemLp f p μ) (hg : MemLp g p μ) : theorem toLp_neg (f : α →ₛ E) (hf : MemLp f p μ) : toLp (-f) hf.neg = -toLp f hf := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem toLp_sub (f g : α →ₛ E) (hf : MemLp f p μ) (hg : MemLp g p μ) : toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg := by simp only [sub_eq_add_neg, ← toLp_neg, ← toLp_add] diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean index c1922da0f15b03..d5b68de4f13143 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean @@ -427,6 +427,7 @@ theorem div₀ [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] (hf : ⟨fun n => hf.approx n / hg.approx n, fun x => (hf.tendsto_approx x).div (hg.tendsto_approx x) (h₀ x)⟩ +set_option backward.isDefEq.respectTransparency false in @[fun_prop] theorem div [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] [MeasurableSingletonClass β] (hf : StronglyMeasurable f) diff --git a/Mathlib/MeasureTheory/Group/AEStabilizer.lean b/Mathlib/MeasureTheory/Group/AEStabilizer.lean index 974575ccfaa36c..5d7e4e3693a204 100644 --- a/Mathlib/MeasureTheory/Group/AEStabilizer.lean +++ b/Mathlib/MeasureTheory/Group/AEStabilizer.lean @@ -39,6 +39,7 @@ variable (G : Type*) {α : Type*} [Group G] [MulAction G α] namespace MulAction +set_option backward.isDefEq.respectTransparency false in /-- A.e. stabilizer of a set under a group action. -/ @[to_additive (attr := simps) /-- A.e. stabilizer of a set under an additive group action. -/] def aestabilizer (s : Set α) : Subgroup G where @@ -54,6 +55,7 @@ variable {g : G} {s t : Set α} @[to_additive (attr := simp)] lemma mem_aestabilizer : g ∈ aestabilizer G μ s ↔ g • s =ᵐ[μ] s := .rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive] lemma stabilizer_le_aestabilizer (s : Set α) : stabilizer G s ≤ aestabilizer G μ s := by intro g hg @@ -65,6 +67,7 @@ lemma aestabilizer_empty : aestabilizer G μ ∅ = ⊤ := top_unique fun _ _ ↦ @[to_additive (attr := simp)] lemma aestabilizer_univ : aestabilizer G μ univ = ⊤ := top_unique fun _ _ ↦ by simp +set_option backward.isDefEq.respectTransparency false in @[to_additive] lemma aestabilizer_congr (h : s =ᵐ[μ] t) : aestabilizer G μ s = aestabilizer G μ t := by ext g diff --git a/Mathlib/MeasureTheory/Group/Action.lean b/Mathlib/MeasureTheory/Group/Action.lean index 1c421500555465..0f0c2fb09f3780 100644 --- a/Mathlib/MeasureTheory/Group/Action.lean +++ b/Mathlib/MeasureTheory/Group/Action.lean @@ -165,6 +165,7 @@ theorem eventuallyConst_smul_set_ae (c : G) {s : Set α} : theorem smul_set_ae_le (c : G) {s t : Set α} : c • s ≤ᵐ[μ] c • t ↔ s ≤ᵐ[μ] t := by simp only [ae_le_set, ← smul_set_sdiff, measure_smul_eq_zero_iff] +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem smul_set_ae_eq (c : G) {s t : Set α} : c • s =ᵐ[μ] c • t ↔ s =ᵐ[μ] t := by simp only [Filter.eventuallyLE_antisymm_iff, smul_set_ae_le] diff --git a/Mathlib/MeasureTheory/Integral/Average.lean b/Mathlib/MeasureTheory/Integral/Average.lean index ca8f317c0a3bf5..23c34c1b63b7d5 100644 --- a/Mathlib/MeasureTheory/Integral/Average.lean +++ b/Mathlib/MeasureTheory/Integral/Average.lean @@ -187,6 +187,7 @@ theorem laverage_union_mem_openSegment (hd : AEDisjoint μ s t) (ht : NullMeasur rw [← ENNReal.add_div, ENNReal.div_self (add_eq_zero.not.2 fun h => hs₀ h.1) (add_ne_top.2 ⟨hsμ, htμ⟩)] +set_option backward.isDefEq.respectTransparency.types false in theorem laverage_union_mem_segment (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) : ⨍⁻ x in s ∪ t, f x ∂μ ∈ [⨍⁻ x in s, f x ∂μ -[ℝ≥0∞] ⨍⁻ x in t, f x ∂μ] := by @@ -400,6 +401,7 @@ theorem average_union_mem_openSegment {f : α → E} {s t : Set α} (hd : AEDisj exact mem_openSegment_iff_div.mpr ⟨μ.real s, μ.real t, hs₀, ht₀, (average_union hd ht hsμ htμ hfs hft).symm⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem average_union_mem_segment {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) : diff --git a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean index 4d7d68eff2b176..374fac39a298e0 100644 --- a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean @@ -287,12 +287,14 @@ theorem curveIntegral_trans (h₁ : CurveIntegrable ω γab) (h₂ : CurveIntegr simp only [curveIntegral_def] norm_num +set_option backward.isDefEq.respectTransparency.types false in theorem curveIntegralFun_segment [NormedSpace ℝ E] (ω : E → E →L[𝕜] F) (a b : E) {t : ℝ} (ht : t ∈ I) : curveIntegralFun ω (.segment a b) t = ω (lineMap a b t) (b - a) := by have := Path.eqOn_extend_segment a b simp only [curveIntegralFun_def, this ht, derivWithin_congr this (this ht), (hasDerivWithinAt_lineMap ..).derivWithin (uniqueDiffOn_Icc_zero_one t ht)] +set_option backward.isDefEq.respectTransparency.types false in theorem curveIntegrable_segment [NormedSpace ℝ E] : CurveIntegrable ω (.segment a b) ↔ IntervalIntegrable (fun t ↦ ω (lineMap a b t) (b - a)) volume 0 1 := by @@ -300,6 +302,7 @@ theorem curveIntegrable_segment [NormedSpace ℝ E] : rw [uIoc_of_le zero_le_one] exact .mono Ioc_subset_Icc_self fun _t ↦ curveIntegralFun_segment ω a b +set_option backward.isDefEq.respectTransparency.types false in theorem curveIntegral_segment [NormedSpace ℝ E] [NormedSpace ℝ F] (ω : E → E →L[𝕜] F) (a b : E) : ∫ᶜ x in .segment a b, ω x = ∫ t in 0..1, ω (lineMap a b t) (b - a) := by rw [curveIntegral_def] @@ -313,6 +316,7 @@ theorem curveIntegral_segment_const [NormedSpace ℝ E] [CompleteSpace F] (ω : letI : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F simp [curveIntegral_segment] +set_option backward.isDefEq.respectTransparency.types false in /-- If `‖ω z‖ ≤ C` at all points of the segment `[a -[ℝ] b]`, then the curve integral `∫ᶜ x in .segment a b, ω x` has norm at most `C * ‖b - a‖`. -/ theorem norm_curveIntegral_segment_le [NormedSpace ℝ E] {C : ℝ} (h : ∀ z ∈ [a -[ℝ] b], ‖ω z‖ ≤ C) : diff --git a/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean b/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean index 1379a65a6b58b6..2b052b962a6a7e 100644 --- a/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean +++ b/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean @@ -290,6 +290,7 @@ namespace Convex variable [NormedSpace ℝ E] [NormedSpace ℝ F] {a b c : E} {s : Set E} {ω : E → E →L[𝕜] F} {dω : E → E →L[ℝ] E →L[𝕜] F} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `ω` is a closed `1`-form on a convex set, then `∫ᶜ x in Path.segment a b, ω x + ∫ᶜ x in Path.segment b c, ω x = ∫ᶜ x in Path.segment a c, ω x` diff --git a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean index fd834e157bc946..10878710bf6b3a 100644 --- a/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean +++ b/Mathlib/MeasureTheory/Integral/DominatedConvergence.lean @@ -336,6 +336,7 @@ open scoped Interval variable {E X : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [TopologicalSpace X] {a b b₀ b₁ b₂ : ℝ} {μ : Measure ℝ} {f : ℝ → E} +set_option backward.isDefEq.respectTransparency.types false in theorem continuousWithinAt_primitive (hb₀ : μ {b₀} = 0) (h_int : IntervalIntegrable f μ (min a b₁) (max a b₂)) : ContinuousWithinAt (fun b => ∫ x in a..b, f x ∂μ) (Icc b₁ b₂) b₀ := by diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean index e441fe251bab87..6276e4030fc9f4 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Basic.lean @@ -519,6 +519,7 @@ theorem MonotoneOn.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : Monotone rw [intervalIntegrable_iff] exact (hu.integrableOn_isCompact isCompact_uIcc).mono_set Ioc_subset_Icc_self +set_option backward.isDefEq.respectTransparency.types false in theorem AntitoneOn.intervalIntegrable {u : ℝ → E} {a b : ℝ} (hu : AntitoneOn u (uIcc a b)) : IntervalIntegrable u μ a b := hu.dual_right.intervalIntegrable diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/DistLEIntegral.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/DistLEIntegral.lean index 734ba83cf45c3e..4ef0d22f5e9666 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/DistLEIntegral.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/DistLEIntegral.lean @@ -115,6 +115,7 @@ section NormedSpace open AffineMap variable {f : E → F} {a b : E} {C r : ℝ} {s : Set E} +set_option backward.isDefEq.respectTransparency.types false in /-- Consider a function `f : E → F` continuous on a segment `[a, b]` and line differentiable in the direction `b - a` at all points of the open segment `(a, b)`. @@ -144,6 +145,7 @@ lemma norm_sub_le_mul_volume_of_norm_lineDeriv_le · exact fun t ht ↦ (hdg t ht).differentiableAt.differentiableWithinAt · exact hf'.mono fun t ht ht_mem ↦ by simpa only [(hdg t ht_mem).deriv] using ht ht_mem +set_option backward.isDefEq.respectTransparency.types false in /-- Let `f : E → F` be a function differentiable on a set `s` and continuous on its closure. Let `a`, `b` be two points such that the open segment connecting `a` to `b` is a subset of `s`. diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean index aff2bfe9a88a46..5e96b403462158 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean @@ -162,6 +162,7 @@ lemma measurePreserving_equivIoc {a : ℝ} : congr! with hx rw [equivIoc_coe_eq hx] +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] Subtype.measureSpace in /-- The lower integral of a function over `AddCircle T` is equal to the lower integral over an interval $(t, t + T]$ in `ℝ` of its lift to `ℝ`. -/ @@ -184,6 +185,7 @@ protected theorem lintegral_preimage (t : ℝ) (f : AddCircle T → ℝ≥0∞) variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] Subtype.measureSpace in /-- The integral of an almost-everywhere strongly measurable function over `AddCircle T` is equal to the integral over an interval $(t, t + T]$ in `ℝ` of its lift to `ℝ`. -/ diff --git a/Mathlib/MeasureTheory/Integral/Layercake.lean b/Mathlib/MeasureTheory/Integral/Layercake.lean index 2b8ae5e039c6a2..19315b4e778a84 100644 --- a/Mathlib/MeasureTheory/Integral/Layercake.lean +++ b/Mathlib/MeasureTheory/Integral/Layercake.lean @@ -97,6 +97,7 @@ section Layercake variable {α : Type*} [MeasurableSpace α] {f : α → ℝ} {g : ℝ → ℝ} +set_option backward.isDefEq.respectTransparency.types false in /-- An auxiliary version of the layer cake formula (Cavalieri's principle, tail probability formula), with a measurability assumption that would also essentially follow from the integrability assumptions, and a sigma-finiteness assumption. diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean index d7c476b5600c03..f4cb2b30725142 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean @@ -416,6 +416,7 @@ theorem lintegral_zero_measure {m : MeasurableSpace α} (f : α → ℝ≥0∞) ∫⁻ a, f a ∂(0 : Measure α) = 0 := by simp [lintegral] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lintegral_add_measure (f : α → ℝ≥0∞) (μ ν : Measure α) : ∫⁻ a, f a ∂(μ + ν) = ∫⁻ a, f a ∂μ + ∫⁻ a, f a ∂ν := by diff --git a/Mathlib/MeasureTheory/Integral/Pi.lean b/Mathlib/MeasureTheory/Integral/Pi.lean index be5a1cca66f96d..b3c25bf06d8f65 100644 --- a/Mathlib/MeasureTheory/Integral/Pi.lean +++ b/Mathlib/MeasureTheory/Integral/Pi.lean @@ -42,7 +42,7 @@ theorem fin_nat_prod {n : ℕ} {E : Fin n → Type*} rw [← this.integrable_comp_emb (MeasurableEquiv.measurableEmbedding _)] simp_rw [MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv, Fin.prod_univ_succ, Fin.insertNth_zero] - simp only [Fin.zero_succAbove, cast_eq, Function.comp_def] + simp only [Fin.zero_succAbove, Function.comp_def] have : Integrable (fun (x : (j : Fin n) → E (Fin.succ j)) ↦ ∏ j, f (Fin.succ j) (x j)) (Measure.pi (fun i ↦ μ i.succ)) := n_ih (fun i ↦ hf _) diff --git a/Mathlib/MeasureTheory/Integral/Prod.lean b/Mathlib/MeasureTheory/Integral/Prod.lean index de59485ec6289f..dcd83f200e063d 100644 --- a/Mathlib/MeasureTheory/Integral/Prod.lean +++ b/Mathlib/MeasureTheory/Integral/Prod.lean @@ -70,6 +70,7 @@ section variable [NormedSpace ℝ E] +set_option backward.isDefEq.respectTransparency.types false in /-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. This version has `f` in curried form. -/ diff --git a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean index 0ca50c305d8d76..3a73e6791a7700 100644 --- a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Basic.lean @@ -278,8 +278,9 @@ noncomputable def rieszContent (Λ : C_c(X, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) : sup_le' := rieszContentAux_sup_le Λ lemma rieszContent_ne_top {K : Compacts X} : rieszContent Λ K ≠ ⊤ := by - simp [rieszContent, ne_eq, ENNReal.coe_ne_top, not_false_eq_true] + simp [rieszContent, ne_eq, not_false_eq_true] +set_option backward.isDefEq.respectTransparency false in lemma contentRegular_rieszContent : (rieszContent Λ).ContentRegular := by intro K simp only [rieszContent, le_antisymm_iff, le_iInf_iff, ENNReal.coe_le_coe, Content.mk_apply] @@ -321,6 +322,7 @@ promoted to a measure. It will be later shown that `∫ (x : X), f x ∂(rieszMeasure Λ hΛ) = Λ f` for all `f : C_c(X, ℝ≥0)`. -/ def rieszMeasure := (rieszContent Λ).measure +set_option backward.isDefEq.respectTransparency false in lemma le_rieszMeasure_of_isCompact_tsupport_subset {f : C_c(X, ℝ≥0)} (hf : ∀ x, f x ≤ 1) {K : Set X} (hK : IsCompact K) (h : tsupport f ⊆ K) : .ofNNReal (Λ f) ≤ rieszMeasure Λ K := by rw [← TopologicalSpace.Compacts.coe_mk K hK] diff --git a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean index f7835beb238390..09bed36fdb622a 100644 --- a/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean +++ b/Mathlib/MeasureTheory/Integral/RieszMarkovKakutani/Real.lean @@ -64,6 +64,7 @@ and the `NNReal`-version of `rieszContent`. This is under the namespace `RealRMK `rieszMeasure` without namespace is for `NNReal`-linear `Λ`. -/ noncomputable def rieszMeasure := (rieszContent (toNNRealLinear Λ)).measure +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` assumes values between `0` and `1` and the support is contained in `V`, then `Λ f ≤ rieszMeasure V`. -/ lemma le_rieszMeasure_tsupport_subset {f : C_c(X, ℝ)} (hf : ∀ (x : X), 0 ≤ f x ∧ f x ≤ 1) diff --git a/Mathlib/MeasureTheory/Integral/TorusIntegral.lean b/Mathlib/MeasureTheory/Integral/TorusIntegral.lean index e008fbecf59ce4..c2eed8b1d5cb55 100644 --- a/Mathlib/MeasureTheory/Integral/TorusIntegral.lean +++ b/Mathlib/MeasureTheory/Integral/TorusIntegral.lean @@ -210,6 +210,7 @@ theorem torusIntegral_dim1 (f : ℂ¹ → E) (c : ℂ¹) (R : ℝ¹) : (MeasurableEquiv.measurableEmbedding _), H₁, H₂] simp [circleMap_zero] +set_option backward.isDefEq.respectTransparency.types false in /-- Recurrent formula for `torusIntegral`, see also `torusIntegral_succ`. -/ theorem torusIntegral_succAbove {f : ℂⁿ⁺¹ → E} {c : ℂⁿ⁺¹} {R : ℝⁿ⁺¹} (hf : TorusIntegrable f c R) diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean b/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean index 17120f3d3b87ae..f9fa1c03834de2 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Basic.lean @@ -59,7 +59,7 @@ variable {m m₁ m₂ : MeasurableSpace α} {m' : MeasurableSpace β} {f : α /-- The forward image of a measurable space under a function. `map f m` contains the sets `s : Set β` whose preimage under `f` is measurable. -/ -@[implicit_reducible] +@[instance_reducible] protected def map (f : α → β) (m : MeasurableSpace α) : MeasurableSpace β where MeasurableSet' s := MeasurableSet[m] <| f ⁻¹' s measurableSet_empty := m.measurableSet_empty @@ -78,7 +78,7 @@ theorem map_comp {f : α → β} {g : β → γ} : (m.map f).map g = m.map (g /-- The reverse image of a measurable space under a function. `comap f m` contains the sets `s : Set α` such that `s` is the `f`-preimage of a measurable set in `β`. -/ -@[implicit_reducible] +@[instance_reducible] protected def comap (f : α → β) (m : MeasurableSpace β) : MeasurableSpace α where MeasurableSet' s := ∃ s', MeasurableSet[m] s' ∧ f ⁻¹' s' = s measurableSet_empty := ⟨∅, m.measurableSet_empty, rfl⟩ diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean b/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean index d776ff14272271..bde96191f048ef 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Constructions.lean @@ -363,7 +363,7 @@ end Atoms section Prod /-- A `MeasurableSpace` structure on the product of two measurable spaces. -/ -@[implicit_reducible] +@[instance_reducible] def MeasurableSpace.prod {α β} (m₁ : MeasurableSpace α) (m₂ : MeasurableSpace β) : MeasurableSpace (α × β) := m₁.comap Prod.fst ⊔ m₂.comap Prod.snd @@ -767,6 +767,7 @@ theorem measurable_tProd_mk (l : List δ) : Measurable (@TProd.mk δ X l) := by | nil => exact measurable_const | cons i l ih => exact (measurable_pi_apply i).prodMk ih +set_option backward.isDefEq.respectTransparency false in theorem measurable_tProd_elim [DecidableEq δ] : ∀ {l : List δ} {i : δ} (hi : i ∈ l), Measurable fun v : TProd X l => v.elim hi | i::is, j, hj => by diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean b/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean index e6ff0587739901..1521e98d26ddb8 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Defs.lean @@ -289,7 +289,7 @@ namespace MeasurableSpace /-- Copy of a `MeasurableSpace` with a new `MeasurableSet` equal to the old one. Useful to fix definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] protected def copy (m : MeasurableSpace α) (p : Set α → Prop) (h : ∀ s, p s ↔ MeasurableSet[m] s) : MeasurableSpace α where MeasurableSet' := p @@ -326,7 +326,7 @@ inductive GenerateMeasurable (s : Set (Set α)) : Set α → Prop GenerateMeasurable s (⋃ i, f i) /-- Construct the smallest measure space containing a collection of basic sets -/ -@[implicit_reducible] +@[instance_reducible] def generateFrom (s : Set (Set α)) : MeasurableSpace α where MeasurableSet' := GenerateMeasurable s measurableSet_empty := .empty @@ -373,7 +373,7 @@ theorem forall_generateFrom_mem_iff_mem_iff {S : Set (Set α)} {x y : α} : /-- If `g` is a collection of subsets of `α` such that the `σ`-algebra generated from `g` contains the same sets as `g`, then `g` was already a `σ`-algebra. -/ -@[implicit_reducible] +@[instance_reducible] protected def mkOfClosure (g : Set (Set α)) (hg : { t | MeasurableSet[generateFrom g] t } = g) : MeasurableSpace α := (generateFrom g).copy (· ∈ g) <| Set.ext_iff.1 hg.symm diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean b/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean index 7d72ab51e1f10c..9d79f628502a43 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Embedding.lean @@ -501,6 +501,7 @@ lemma piCongrLeft_apply_apply {ι ι' : Type*} (e : ι ≃ ι') {β : ι' → Ty piCongrLeft (fun i' ↦ β i') e x (e i) = x i := by rw [piCongrLeft, coe_mk, Equiv.piCongrLeft_apply_apply] +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism `(γ → α × β) ≃ (γ → α) × (γ → β)` as a measurable equivalence. -/ def arrowProdEquivProdArrow (α β γ : Type*) [MeasurableSpace α] [MeasurableSpace β] : (γ → α × β) ≃ᵐ (γ → α) × (γ → β) where @@ -638,6 +639,7 @@ def ofInvolutive (f : α → α) (hf : Involutive f) (hf' : Measurable f) : α @[simp] theorem ofInvolutive_symm (f : α → α) (hf : Involutive f) (hf' : Measurable f) : (ofInvolutive f hf hf').symm = ofInvolutive f hf hf' := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `setOf` as a `MeasurableEquiv`. -/ @[simps] protected def setOf {α : Type*} : (α → Prop) ≃ᵐ Set α where @@ -747,6 +749,7 @@ noncomputable def schroederBernstein {f : α → β} {g : β → α} (hf : Measu apply hx exact ⟨y, h, rfl⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma equivRange_apply (hf : MeasurableEmbedding f) (x : α) : hf.equivRange x = ⟨f x, mem_range_self x⟩ := by diff --git a/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean b/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean index e199fd48bbffd0..8b3c28066e7e00 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/EventuallyMeasurable.lean @@ -40,7 +40,7 @@ variable {α : Type*} (m : MeasurableSpace α) {s t : Set α} /-- The `MeasurableSpace` of sets which are measurable with respect to a given σ-algebra `m` on `α`, modulo a given σ-filter `l` on `α`. -/ -@[implicit_reducible] +@[instance_reducible] def eventuallyMeasurableSpace (l : Filter α) [CountableInterFilter l] : MeasurableSpace α where MeasurableSet' s := ∃ t, MeasurableSet t ∧ s =ᶠ[l] t measurableSet_empty := ⟨∅, MeasurableSet.empty, EventuallyEq.refl _ _ ⟩ diff --git a/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean b/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean index e734734a824530..0dde46333a71a7 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean @@ -29,7 +29,7 @@ variable {α : Type*} A set `s` is `(invariants f)`-measurable iff it is measurable w.r.t. the canonical σ-algebra on `α` and `f ⁻¹' s = s`. -/ -@[implicit_reducible] +@[instance_reducible] def invariants [m : MeasurableSpace α] (f : α → α) : MeasurableSpace α := { m ⊓ ⟨fun s ↦ f ⁻¹' s = s, by simp, by simp, fun f hf ↦ by simp [hf]⟩ with MeasurableSet' := fun s ↦ MeasurableSet[m] s ∧ f ⁻¹' s = s } diff --git a/Mathlib/MeasureTheory/Measure/CharacteristicFunction/Basic.lean b/Mathlib/MeasureTheory/Measure/CharacteristicFunction/Basic.lean index eadd8784b638d6..6b024da3da7af0 100644 --- a/Mathlib/MeasureTheory/Measure/CharacteristicFunction/Basic.lean +++ b/Mathlib/MeasureTheory/Measure/CharacteristicFunction/Basic.lean @@ -69,6 +69,7 @@ def innerProbChar (t : E) : E →ᵇ ℂ := lemma innerProbChar_apply (t x : E) : innerProbChar t x = exp (⟪x, t⟫ * I) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma innerProbChar_zero : innerProbChar (0 : E) = 1 := by simp [innerProbChar] @@ -81,6 +82,7 @@ def probCharDual (L : StrongDual ℝ F) : F →ᵇ ℂ := lemma probCharDual_apply (L : StrongDual ℝ F) (x : F) : probCharDual L x = exp (L x * I) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma probCharDual_zero : probCharDual (0 : StrongDual ℝ F) = 1 := by simp [probCharDual] diff --git a/Mathlib/MeasureTheory/Measure/Comap.lean b/Mathlib/MeasureTheory/Measure/Comap.lean index 0eecd3822606ab..7d0fd2c300b93a 100644 --- a/Mathlib/MeasureTheory/Measure/Comap.lean +++ b/Mathlib/MeasureTheory/Measure/Comap.lean @@ -48,6 +48,7 @@ def comapₗ [MeasurableSpace α] [MeasurableSpace β] (f : α → β) : Measure exact hf.2 s hs else 0 +set_option backward.isDefEq.respectTransparency false in theorem comapₗ_apply {_ : MeasurableSpace α} {_ : MeasurableSpace β} (f : α → β) (hfi : Injective f) (hf : ∀ s, MeasurableSet s → MeasurableSet (f '' s)) (μ : Measure β) (hs : MeasurableSet s) : comapₗ f μ s = μ (f '' s) := by @@ -107,6 +108,7 @@ theorem measure_image_eq_zero_of_comap_eq_zero (f : α → β) (μ : Measure β) rw [← nonpos_iff_eq_zero] exact (le_comap_apply f μ hfi hf s).trans hs.le +set_option backward.isDefEq.respectTransparency false in theorem ae_eq_image_of_ae_eq_comap (f : α → β) (μ : Measure β) (hfi : Injective f) (hf : ∀ s, MeasurableSet s → NullMeasurableSet (f '' s) μ) {s t : Set α} (hst : s =ᵐ[comap f μ] t) : f '' s =ᵐ[μ] f '' t := by diff --git a/Mathlib/MeasureTheory/Measure/Complex.lean b/Mathlib/MeasureTheory/Measure/Complex.lean index 1e2398ec74cb9a..5d7316aa466f35 100644 --- a/Mathlib/MeasureTheory/Measure/Complex.lean +++ b/Mathlib/MeasureTheory/Measure/Complex.lean @@ -94,6 +94,7 @@ section variable {R : Type*} [Semiring R] [Module R ℝ] variable [ContinuousConstSMul R ℝ] [ContinuousConstSMul R ℂ] +set_option backward.isDefEq.respectTransparency false in /-- The complex measures form a linear isomorphism to the type of pairs of signed measures. -/ @[simps] def equivSignedMeasureₗ : ComplexMeasure α ≃ₗ[R] SignedMeasure α × SignedMeasure α := @@ -108,6 +109,7 @@ def equivSignedMeasureₗ : ComplexMeasure α ≃ₗ[R] SignedMeasure α × Sign end +set_option backward.isDefEq.respectTransparency false in theorem absolutelyContinuous_ennreal_iff (c : ComplexMeasure α) (μ : VectorMeasure α ℝ≥0∞) : c ≪ᵥ μ ↔ ComplexMeasure.re c ≪ᵥ μ ∧ ComplexMeasure.im c ≪ᵥ μ := by constructor <;> intro h diff --git a/Mathlib/MeasureTheory/Measure/Content.lean b/Mathlib/MeasureTheory/Measure/Content.lean index f542176289b271..b498585713899d 100644 --- a/Mathlib/MeasureTheory/Measure/Content.lean +++ b/Mathlib/MeasureTheory/Measure/Content.lean @@ -196,7 +196,7 @@ theorem innerContent_comap (f : G ≃ₜ G) (h : ∀ ⦃K : Compacts G⦄, μ (K (U : Opens G) : μ.innerContent (Opens.comap f U) = μ.innerContent U := by refine (Compacts.equiv f).surjective.iSup_congr _ fun K => iSup_congr_Prop image_subset_iff ?_ intro hK - simp only [Equiv.coe_fn_mk, Compacts.equiv] + simp only [Compacts.equiv] apply h @[to_additive] @@ -244,6 +244,7 @@ theorem outerMeasure_le (U : Opens G) (K : Compacts G) (hUK : (U : Set G) ⊆ K) μ.outerMeasure U ≤ μ K := (μ.outerMeasure_opens U).le.trans <| μ.innerContent_le U K hUK +set_option backward.isDefEq.respectTransparency false in theorem le_outerMeasure_compacts (K : Compacts G) : μ K ≤ μ.outerMeasure K := by rw [Content.outerMeasure, inducedOuterMeasure_eq_iInf] · exact le_iInf fun U => le_iInf fun hU => le_iInf <| μ.le_innerContent K ⟨U, hU⟩ diff --git a/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean b/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean index 07447493d65ace..3bfc26a5d5beca 100644 --- a/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean +++ b/Mathlib/MeasureTheory/Measure/ContinuousPreimage.lean @@ -98,6 +98,7 @@ theorem tendsto_measure_symmDiff_preimage_nhds_zero ← hg.measure_preimage hs, ← measure_diff_le_iff_le_add hKm hKg.subset_preimage hK'] exact hKμ.le +set_option backward.isDefEq.respectTransparency false in /-- Let `f : Z → C(X, Y)` be a continuous (in the compact open topology) family of continuous measure-preserving maps. Let `t : Set Y` be a null measurable set of finite measure. diff --git a/Mathlib/MeasureTheory/Measure/DiracProba.lean b/Mathlib/MeasureTheory/Measure/DiracProba.lean index a2189b3c2f9972..87e3e6ac897330 100644 --- a/Mathlib/MeasureTheory/Measure/DiracProba.lean +++ b/Mathlib/MeasureTheory/Measure/DiracProba.lean @@ -137,6 +137,7 @@ noncomputable def diracProbaEquiv [T0Space X] : X ≃ range (diracProba (X := X) left_inv x := by apply diracProbaInverse_eq; rfl right_inv μ := Subtype.ext (by simp only [diracProba_diracProbaInverse]) +set_option backward.isDefEq.respectTransparency.types false in /-- The composition of `diracProbaEquiv.symm` and `diracProba` is the subtype inclusion. -/ lemma diracProba_comp_diracProbaEquiv_symm_eq_val [T0Space X] : diracProba ∘ (diracProbaEquiv (X := X)).symm = fun μ ↦ μ.val := by diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean index 8e29372f27bdc1..247995a901c6bc 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean @@ -745,6 +745,7 @@ theorem tendsto_iff_forall_integral_tendsto {γ : Type*} {F : Filter γ} {μs : simp_rw [aux, BoundedContinuousFunction.toReal_lintegral_coe_eq_integral] at tends_pos tends_neg exact Tendsto.sub tends_pos tends_neg +set_option backward.isDefEq.respectTransparency.types false in theorem tendsto_iff_forall_integral_rclike_tendsto {γ : Type*} (𝕜 : Type*) [RCLike 𝕜] {F : Filter γ} {μs : γ → FiniteMeasure Ω} {μ : FiniteMeasure Ω} : Tendsto μs F (𝓝 μ) ↔ diff --git a/Mathlib/MeasureTheory/Measure/Haar/Basic.lean b/Mathlib/MeasureTheory/Measure/Haar/Basic.lean index 1f5b9c8cb6be7f..0fa30d8e44569c 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Basic.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Basic.lean @@ -172,6 +172,7 @@ theorem le_index_mul (K₀ : PositiveCompacts G) (K : Compacts G) {V : Set G} rcases this with ⟨_, ⟨g₃, rfl⟩, A, ⟨hg₃, rfl⟩, h2V⟩; rw [mem_preimage, ← mul_assoc] at h2V exact mem_biUnion (Finset.mul_mem_mul hg₃ hg₁) h2V +set_option backward.isDefEq.respectTransparency false in @[to_additive addIndex_pos] theorem index_pos (K : PositiveCompacts G) {V : Set G} (hV : (interior V).Nonempty) : 0 < index (K : Set G) V := by @@ -457,6 +458,7 @@ theorem is_left_invariant_chaar {K₀ : PositiveCompacts G} (g : G) (K : Compact apply is_left_invariant_prehaar; rw [h2U.interior_eq]; exact ⟨1, h3U⟩ · apply continuous_iff_isClosed.mp this; exact isClosed_singleton +set_option backward.isDefEq.respectTransparency false in /-- The function `chaar` interpreted in `ℝ≥0`, as a content -/ @[to_additive /-- additive version of `MeasureTheory.Measure.haar.haarContent` -/] noncomputable def haarContent (K₀ : PositiveCompacts G) : Content G where @@ -475,11 +477,13 @@ theorem haarContent_apply (K₀ : PositiveCompacts G) (K : Compacts G) : haarContent K₀ K = show NNReal from ⟨chaar K₀ K, chaar_nonneg _ _⟩ := rfl +set_option backward.isDefEq.respectTransparency false in /-- The variant of `chaar_self` for `haarContent` -/ @[to_additive /-- The variant of `addCHaar_self` for `addHaarContent`. -/] theorem haarContent_self {K₀ : PositiveCompacts G} : haarContent K₀ K₀.toCompacts = 1 := by simp_rw [← ENNReal.coe_one, haarContent_apply, ENNReal.coe_inj, chaar_self]; rfl +set_option backward.isDefEq.respectTransparency false in /-- The variant of `is_left_invariant_chaar` for `haarContent` -/ @[to_additive /-- The variant of `is_left_invariant_addCHaar` for `addHaarContent` -/] theorem is_left_invariant_haarContent {K₀ : PositiveCompacts G} (g : G) (K : Compacts G) : diff --git a/Mathlib/MeasureTheory/Measure/Haar/Extension.lean b/Mathlib/MeasureTheory/Measure/Haar/Extension.lean index 5b48903ac5d26f..46f941f0ec7f2f 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Extension.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Extension.lean @@ -231,6 +231,7 @@ instance isHaarMeasure_inducedMeasure : IsHaarMeasure (inducedMeasure H μA μC) exact (pullback H ⟨f, hf2⟩ _).continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero (pullback H ⟨f, hf2⟩ _).hasCompactSupport (fun x ↦ (hf4 _).1) ha +set_option backward.isDefEq.respectTransparency.types false in /-- If `φ : A →* B` and `ψ : B →* C` define a short exact sequence of topological groups, and if `ψ` is injective on an open set `U`, then the induced measure on `U` is bounded above by `μC Set.univ * μA {1}` (possibly infinite). -/ diff --git a/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean b/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean index 7d99663857af69..7c394e6dd3b6fb 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/OfBasis.lean @@ -54,6 +54,7 @@ theorem mem_parallelepiped_iff (v : ι → E) (x : E) : x ∈ parallelepiped v ↔ ∃ t ∈ Icc (0 : ι → ℝ) 1, x = ∑ i, t i • v i := by simp [parallelepiped, eq_comm] +set_option backward.isDefEq.respectTransparency false in theorem parallelepiped_basis_eq (b : Basis ι ℝ E) : parallelepiped b = {x | ∀ i, b.repr x i ∈ Set.Icc 0 1} := by classical diff --git a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean index 0b9ccc2c11c785..0a6eb192f3123f 100644 --- a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean +++ b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosedProd.lean @@ -204,6 +204,7 @@ lemma eq_prod_of_integral_prod_mul_prod_boundedContinuousFunction {μ : Measure ξ = μ.prod ν := ext_of_integral_prod_mul_prod_boundedContinuousFunction fun f g ↦ by rw [h, ← integral_prod_mul] +set_option backward.isDefEq.respectTransparency.types false in set_option linter.flexible false in -- simp followed by fun_prop lemma ext_of_integral_prod_mul_boundedContinuousFunction {μ ν : Measure ((Π i, X i) × T)} [IsFiniteMeasure μ] [IsFiniteMeasure ν] diff --git a/Mathlib/MeasureTheory/Measure/Hausdorff.lean b/Mathlib/MeasureTheory/Measure/Hausdorff.lean index a76e46243c6fbf..01a12edef1bcd6 100644 --- a/Mathlib/MeasureTheory/Measure/Hausdorff.lean +++ b/Mathlib/MeasureTheory/Measure/Hausdorff.lean @@ -1076,6 +1076,7 @@ section RealAffine variable [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace P] variable [MetricSpace P] [NormedAddTorsor E P] [BorelSpace P] +set_option backward.isDefEq.respectTransparency.types false in /-- Mapping a set of reals along a line segment scales the measure by the length of a segment. This is an auxiliary result used to prove `hausdorffMeasure_affineSegment`. -/ @@ -1087,6 +1088,7 @@ theorem hausdorffMeasure_lineMap_image (x y : P) (s : Set ℝ) : rw [IsometryEquiv.hausdorffMeasure_image, hausdorffMeasure_smul_right_image, nndist_eq_nnnorm_vsub' E] +set_option backward.isDefEq.respectTransparency.types false in /-- The measure of a segment is the distance between its endpoints. -/ @[simp] theorem hausdorffMeasure_affineSegment (x y : P) : μH[1] (affineSegment ℝ x y) = edist x y := by diff --git a/Mathlib/MeasureTheory/Measure/LevyConvergence.lean b/Mathlib/MeasureTheory/Measure/LevyConvergence.lean index 9d6a3d1213e098..2f9aa8307a54d3 100644 --- a/Mathlib/MeasureTheory/Measure/LevyConvergence.lean +++ b/Mathlib/MeasureTheory/Measure/LevyConvergence.lean @@ -173,6 +173,7 @@ lemma ProbabilityMeasure.tendsto_of_tight_of_separatesPoints (𝕜 : Type*) [RCL variable {ι : Type*} {𝓕 : Filter ι} {μ₀ : ProbabilityMeasure E} +set_option backward.isDefEq.respectTransparency.types false in omit [FiniteDimensional ℝ E] in lemma ProbabilityMeasure.tendsto_charPoly_of_tendsto_charFun {μ : ι → ProbabilityMeasure E} (h : ∀ t : E, Tendsto (fun n ↦ charFun (μ n) t) 𝓕 (𝓝 (charFun μ₀ t))) diff --git a/Mathlib/MeasureTheory/Measure/Map.lean b/Mathlib/MeasureTheory/Measure/Map.lean index 71761db206640f..aa7999d9762ff4 100644 --- a/Mathlib/MeasureTheory/Measure/Map.lean +++ b/Mathlib/MeasureTheory/Measure/Map.lean @@ -77,6 +77,7 @@ def mapₗ [MeasurableSpace α] [MeasurableSpace β] (f : α → β) : Measure le_toOuterMeasure_caratheodory μ _ (hf hs) (f ⁻¹' t) else 0 +set_option backward.isDefEq.respectTransparency false in theorem mapₗ_congr {f g : α → β} (hf : Measurable f) (hg : Measurable g) (h : f =ᵐ[μ] g) : mapₗ f μ = mapₗ g μ := by ext1 s hs diff --git a/Mathlib/MeasureTheory/Measure/OpenPos.lean b/Mathlib/MeasureTheory/Measure/OpenPos.lean index d5e7375f730923..b364e66e182c86 100644 --- a/Mathlib/MeasureTheory/Measure/OpenPos.lean +++ b/Mathlib/MeasureTheory/Measure/OpenPos.lean @@ -86,6 +86,7 @@ theorem _root_.IsOpen.ae_eq_empty_iff_eq (hU : IsOpen U) : theorem _root_.IsOpen.eq_empty_of_measure_zero (hU : IsOpen U) (h₀ : μ U = 0) : U = ∅ := (hU.measure_eq_zero_iff μ).mp h₀ +set_option backward.isDefEq.respectTransparency false in theorem _root_.IsClosed.ae_eq_univ_iff_eq (hF : IsClosed F) : F =ᵐ[μ] univ ↔ F = univ := by refine ⟨fun h ↦ ?_, fun h ↦ by rw [h]⟩ diff --git a/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean b/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean index 035919f433237c..bcddc2513a22b3 100644 --- a/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/ProbabilityMeasure.lean @@ -231,6 +231,7 @@ theorem eq_of_forall_apply_eq (μ ν : ProbabilityMeasure Ω) theorem mass_toFiniteMeasure (μ : ProbabilityMeasure Ω) : μ.toFiniteMeasure.mass = 1 := μ.coeFn_univ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma range_toFiniteMeasure : range toFiniteMeasure = {μ : FiniteMeasure Ω | μ.mass = 1} := by ext μ @@ -457,6 +458,7 @@ def normalize : ProbabilityMeasure Ω := rw [← Ne, ← ENNReal.coe_ne_zero, ennreal_mass] at zero exact ENNReal.inv_mul_cancel zero μ.prop.measure_univ_lt_top.ne } +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem self_eq_mass_mul_normalize (s : Set Ω) : μ s = μ.mass * μ.normalize s := by obtain rfl | h := eq_or_ne μ 0 diff --git a/Mathlib/MeasureTheory/Measure/Prokhorov.lean b/Mathlib/MeasureTheory/Measure/Prokhorov.lean index ef2a4d67380aca..28dd6ca30e480d 100644 --- a/Mathlib/MeasureTheory/Measure/Prokhorov.lean +++ b/Mathlib/MeasureTheory/Measure/Prokhorov.lean @@ -57,6 +57,7 @@ open Filter Function Set Topology TopologicalSpace MeasureTheory BoundedContinuo variable {E : Type*} [MeasurableSpace E] [TopologicalSpace E] [T2Space E] [BorelSpace E] +set_option backward.isDefEq.respectTransparency.types false in variable (E) in /-- In a compact space, the set of finite measures with mass at most `C` is compact. -/ theorem isCompact_setOf_finiteMeasure_le_of_compactSpace [CompactSpace E] (C : ℝ≥0) : diff --git a/Mathlib/MeasureTheory/Measure/ResolventTransform.lean b/Mathlib/MeasureTheory/Measure/ResolventTransform.lean index 6cf81e33017e89..6fd7d22cf63abf 100644 --- a/Mathlib/MeasureTheory/Measure/ResolventTransform.lean +++ b/Mathlib/MeasureTheory/Measure/ResolventTransform.lean @@ -55,6 +55,7 @@ section resolvent variable [NontriviallyNormedField 𝕜] [MeasurableSpace 𝕜] +set_option backward.isDefEq.respectTransparency.types false in @[fun_prop] theorem measurable_resolvent {a : A} [OpensMeasurableSpace 𝕜] [NormedRing A] [NormedAlgebra 𝕜 A] [CompleteSpace A] [MeasurableSpace A] [BorelSpace A] : diff --git a/Mathlib/MeasureTheory/Measure/Restrict.lean b/Mathlib/MeasureTheory/Measure/Restrict.lean index 6471e0ddc668d0..89917fd68fd4c5 100644 --- a/Mathlib/MeasureTheory/Measure/Restrict.lean +++ b/Mathlib/MeasureTheory/Measure/Restrict.lean @@ -55,6 +55,7 @@ theorem restrictₗ_apply {_m0 : MeasurableSpace α} (s : Set α) (μ : Measure restrictₗ s μ = μ.restrict s := rfl +set_option backward.isDefEq.respectTransparency false in /-- This lemma shows that `restrict` and `toOuterMeasure` commute. Note that the LHS has a restrict on measures and the RHS has a restrict on outer measures. -/ theorem restrict_toOuterMeasure_eq_toOuterMeasure_restrict (h : MeasurableSet s) : diff --git a/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean b/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean index 87c37a04356ea5..d5a78b592cab1a 100644 --- a/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/SeparableMeasure.lean @@ -109,6 +109,7 @@ theorem measureDense_measurableSet : μ.MeasureDense {s | MeasurableSet s} where measurable _ h := h approx s hs _ ε ε_pos := ⟨s, hs, by simpa⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem Measure.MeasureDense.completion (h𝒜 : μ.MeasureDense 𝒜) : μ.completion.MeasureDense 𝒜 where measurable s hs := (h𝒜.measurable s hs).nullMeasurableSet approx s hs hμs ε ε_pos := by @@ -262,6 +263,7 @@ theorem Measure.MeasureDense.of_generateFrom_isSetAlgebra_finite [IsFiniteMeasur rcases this.2 ε ε_pos with ⟨t, t_mem, hμst⟩ exact ⟨t, t_mem, (lt_ofReal_iff_toReal_lt (measure_ne_top _ _)).2 hμst⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- If a measure space `X` is generated by an algebra of sets which contains a monotone countable family of sets with finite measure spanning `X` (thus the measure is `σ`-finite), then this algebra of sets is measure-dense. -/ diff --git a/Mathlib/MeasureTheory/Measure/Sub.lean b/Mathlib/MeasureTheory/Measure/Sub.lean index 3696b15fd5c557..161a90f4e3b456 100644 --- a/Mathlib/MeasureTheory/Measure/Sub.lean +++ b/Mathlib/MeasureTheory/Measure/Sub.lean @@ -60,6 +60,7 @@ protected theorem zero_sub : 0 - μ = 0 := protected theorem sub_self : μ - μ = 0 := sub_eq_zero_of_le le_rfl +set_option backward.isDefEq.respectTransparency false in @[simp] protected theorem sub_zero : μ - 0 = μ := by rw [sub_def] diff --git a/Mathlib/MeasureTheory/OuterMeasure/AE.lean b/Mathlib/MeasureTheory/OuterMeasure/AE.lean index 62350704d6900c..8a6792a5e97520 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/AE.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/AE.lean @@ -158,16 +158,19 @@ theorem ae_le_set_union {s' t' : Set α} (h : s ≤ᵐ[μ] t) (h' : s' ≤ᵐ[μ (s ∪ s' : Set α) ≤ᵐ[μ] (t ∪ t' : Set α) := h.union h' +set_option backward.isDefEq.respectTransparency false in theorem union_ae_eq_right : (s ∪ t : Set α) =ᵐ[μ] t ↔ μ (s \ t) = 0 := by simp [eventuallyLE_antisymm_iff, ae_le_set, union_diff_right, diff_eq_empty.2 Set.subset_union_right] +set_option backward.isDefEq.respectTransparency false in theorem diff_ae_eq_self : (s \ t : Set α) =ᵐ[μ] s ↔ μ (s ∩ t) = 0 := by simp [eventuallyLE_antisymm_iff, ae_le_set] theorem diff_null_ae_eq_self (ht : μ t = 0) : (s \ t : Set α) =ᵐ[μ] s := diff_ae_eq_self.mpr (measure_mono_null inter_subset_right ht) +set_option backward.isDefEq.respectTransparency false in theorem ae_eq_set {s t : Set α} : s =ᵐ[μ] t ↔ μ (s \ t) = 0 ∧ μ (t \ s) = 0 := by simp [eventuallyLE_antisymm_iff, ae_le_set] @@ -181,6 +184,7 @@ set_option backward.isDefEq.respectTransparency false in theorem ae_eq_set_compl_compl {s t : Set α} : sᶜ =ᵐ[μ] tᶜ ↔ s =ᵐ[μ] t := by simp only [← measure_symmDiff_eq_zero_iff, compl_symmDiff_compl] +set_option backward.isDefEq.respectTransparency false in theorem ae_eq_set_compl {s t : Set α} : sᶜ =ᵐ[μ] t ↔ s =ᵐ[μ] tᶜ := by rw [← ae_eq_set_compl_compl, compl_compl] @@ -201,6 +205,7 @@ theorem ae_eq_set_symmDiff {s' t' : Set α} (h : s =ᵐ[μ] t) (h' : s' =ᵐ[μ] s ∆ s' =ᵐ[μ] t ∆ t' := h.symmDiff h' +set_option backward.isDefEq.respectTransparency false in theorem union_ae_eq_univ_of_ae_eq_univ_left (h : s =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ := (ae_eq_set_union h (ae_eq_refl t)).trans <| by rw [univ_union] @@ -244,6 +249,7 @@ theorem ae_eq_set_biUnion {s : Set β} (hs : s.Countable) {t t' : β → Set α} (⋃ b ∈ s, t b : Set α) =ᵐ[μ] (⋃ b ∈ s, t' b : Set α) := .countable_bUnion hs h +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem _root_.Set.mulIndicator_ae_eq_one {M : Type*} [One M] {f : α → M} {s : Set α} : s.mulIndicator f =ᵐ[μ] 1 ↔ μ (s ∩ f.mulSupport) = 0 := by diff --git a/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean b/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean index e20d3217288305..29ecabd251772f 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean @@ -169,7 +169,7 @@ def caratheodoryDynkin : MeasurableSpace.DynkinSystem α where /-- Given an outer measure `μ`, the Carathéodory-measurable space is defined such that `s` is measurable if `∀ t, μ t = μ (t ∩ s) + μ (t \ s)`. -/ -@[implicit_reducible] +@[instance_reducible] protected def caratheodory : MeasurableSpace α := by apply MeasurableSpace.DynkinSystem.toMeasurableSpace (caratheodoryDynkin m) intro s₁ s₂ diff --git a/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean b/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean index fefaacfe9ab7dd..89817cdbe1e8ea 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/OfAddContent.lean @@ -168,6 +168,7 @@ noncomputable def measure [mα : MeasurableSpace α] (m : AddContent ℝ≥0∞ (m.measureCaratheodory hC m_sigma_subadd).trim <| fun s a ↦ isCaratheodory_inducedOuterMeasure hC m s (hC_gen s a) +set_option backward.isDefEq.respectTransparency false in /-- The measure defined through a sigma-subadditive content on a semiring coincides with the content on the semiring. -/ theorem measure_eq [mα : MeasurableSpace α] (m : AddContent ℝ≥0∞ C) (hC : IsSetSemiring C) diff --git a/Mathlib/MeasureTheory/PiSystem.lean b/Mathlib/MeasureTheory/PiSystem.lean index 7fc58eae97e538..e495da02e570b1 100644 --- a/Mathlib/MeasureTheory/PiSystem.lean +++ b/Mathlib/MeasureTheory/PiSystem.lean @@ -308,6 +308,7 @@ theorem mem_generatePiSystem_iUnion_elim {α β} {g : β → Set (Set α)} (h_pi · rw [Finset.mem_union] at h_b apply False.elim (h_b.elim hbs hbt) +set_option backward.isDefEq.respectTransparency false in /-- Every element of the π-system generated by an indexed union of a family of π-systems is a finite intersection of elements from the π-systems. For a total union version, see `mem_generatePiSystem_iUnion_elim`. -/ @@ -608,7 +609,7 @@ instance : Inhabited (DynkinSystem α) := ⟨generate univ⟩ /-- If a Dynkin system is closed under binary intersection, then it forms a `σ`-algebra. -/ -@[implicit_reducible] +@[instance_reducible] def toMeasurableSpace (h_inter : ∀ s₁ s₂, d.Has s₁ → d.Has s₂ → d.Has (s₁ ∩ s₂)) : MeasurableSpace α where MeasurableSet' := d.Has diff --git a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean index 4be9bc31b31ebd..4939999ce513bb 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/AddContent.lean @@ -83,6 +83,7 @@ def of_additive_of_le_measure open scoped ENNReal +set_option backward.isDefEq.respectTransparency.types false in /-- Consider an additive content on a dense ring of sets. Assume that it is dominated by a finite positive measure. Then it extends to a countably additive vector measure. -/ lemma exists_extension_of_isSetRing_of_le_measure_of_dense [IsFiniteMeasure μ] diff --git a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean index 9e55f34abbfee5..6107c4bccb3e43 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Basic.lean @@ -255,7 +255,7 @@ variable {R : Type*} [Semiring R] [DistribMulAction R M] [ContinuousConstSMul R /-- Given a scalar `r` and a vector measure `v`, `smul r v` is the vector measure corresponding to the set function `s : Set α => r • (v s)`. -/ -@[implicit_reducible] +@[instance_reducible] def smul (r : R) (v : VectorMeasure α M) : VectorMeasure α M where measureOf' := r • ⇑v empty' := by rw [Pi.smul_apply, empty, smul_zero] @@ -650,6 +650,7 @@ section Module variable {R : Type*} [Semiring R] [Module R M] [Module R N] variable [ContinuousAdd M] [ContinuousAdd N] [ContinuousConstSMul R M] [ContinuousConstSMul R N] +set_option backward.isDefEq.respectTransparency false in /-- Given a continuous linear map `f : M → N`, `mapRangeₗ` is the linear map mapping the vector measure `v` on `M` to the vector measure `f ∘ v` on `N`. -/ def mapRangeₗ (f : M →ₗ[R] N) (hf : Continuous f) : VectorMeasure α M →ₗ[R] VectorMeasure α N where diff --git a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean index 2ba1edc57d435d..22fad6acba168e 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Integral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Integral.lean @@ -142,6 +142,7 @@ notation3 "∫ᵛ "(...)", "r:60:(scoped f => f)" ∂•"μ:70 => integral μ r variable {f g : X → E} {μ ν : VectorMeasure X F} {B C : E →L[ℝ] F →L[ℝ] G} +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_zero_vectorMeasure (B : E →L[ℝ] F →L[ℝ] G) : (0 : VectorMeasure X F).transpose B = 0 := by @@ -153,11 +154,13 @@ theorem transpose_zero_cbm (μ : VectorMeasure X F) : ext simp [transpose] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_add_vectorMeasure (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : (μ + ν).transpose B = μ.transpose B + ν.transpose B := by simp [transpose] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_add_cbm (μ : VectorMeasure X F) (B C : E →L[ℝ] F →L[ℝ] G) : μ.transpose (B + C) = μ.transpose B + μ.transpose C := by @@ -181,24 +184,28 @@ theorem transpose_finsetSum_cbm (μ : VectorMeasure X F) (B : ι → E →L[ℝ] | empty => simp | insert i s his ih => simp [Finset.sum_insert, his, ih] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_neg_vectorMeasure (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : (-μ).transpose B = - (μ.transpose B) := by ext simp [transpose] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_neg_cbm (μ : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : μ.transpose (-B) = - (μ.transpose B) := by ext simp [transpose] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_sub_vectorMeasure (μ ν : VectorMeasure X F) (B : E →L[ℝ] F →L[ℝ] G) : (μ - ν).transpose B = μ.transpose B - ν.transpose B := by ext simp [transpose] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem transpose_sub_cbm (μ : VectorMeasure X F) (B C : E →L[ℝ] F →L[ℝ] G) : μ.transpose (B - C) = μ.transpose B - μ.transpose C := by @@ -207,6 +214,7 @@ theorem transpose_sub_cbm (μ : VectorMeasure X F) (B C : E →L[ℝ] F →L[ℝ section Function +set_option backward.isDefEq.respectTransparency.types false in theorem integral_undef (h : ¬ μ.Integrable f B) : ∫ᵛ x, f x ∂[B; μ] = 0 := by by_cases hG : CompleteSpace G @@ -324,6 +332,7 @@ theorem integral_finsetSum_vectorMeasure {μ : ι → VectorMeasure X F} · simp_all · simp [integral, hG] +set_option backward.isDefEq.respectTransparency.types false in variable (f μ B) in @[integral_simps] theorem integral_neg_vectorMeasure : @@ -379,6 +388,7 @@ theorem integral_finsetSum_cbm {B : ι → E →L[ℝ] F →L[ℝ] G} · simp_all · simp [integral, hG] +set_option backward.isDefEq.respectTransparency.types false in @[integral_simps] theorem integral_neg_cbm : ∫ᵛ x, f x ∂[-B; μ] = -∫ᵛ x, f x ∂[B; μ] := by diff --git a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean index 3722e32704c756..4778df3fc31e01 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Variation/Basic.lean @@ -73,6 +73,10 @@ lemma le_variation (μ : VectorMeasure X V) {s : Set X} (hs : MeasurableSet s) { simp only [sup_set_eq_biUnion, id_eq] exact hs.diff <| .biUnion (Finset.countable_toSet _) (by simp) +section +set_option allowUnsafeReducibility true -- TODO! +attribute [local semireducible] LE.le +-- set_option backward.isDefEq.respectTransparency false theorem enorm_measure_le_variation (μ : VectorMeasure X V) (E : Set X) : ‖μ E‖ₑ ≤ variation μ E := by by_cases hE : MeasurableSet E @@ -83,6 +87,7 @@ theorem enorm_measure_le_variation (μ : VectorMeasure X V) (E : Set X) : calc ‖μ E‖ₑ = ∑ p ∈ (Finpartition.indiscrete hE').parts, ‖μ p‖ₑ := by simp _ ≤ preVariationFun (‖μ ·‖ₑ) E := by apply preVariation.sum_le +end @[simp] lemma variation_zero : (0 : VectorMeasure X V).variation = 0 := by diff --git a/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean b/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean index 7e2c2bc1ec3093..51f9013516f1c3 100644 --- a/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean +++ b/Mathlib/ModelTheory/Algebra/Field/IsAlgClosed.lean @@ -61,6 +61,7 @@ for `X`. -/ noncomputable def genericMonicPoly (n : ℕ) : FreeCommRing (Fin (n + 1)) := of (Fin.last _) ^ n + ∑ i : Fin n, of i.castSucc * of (Fin.last _) ^ (i : ℕ) +set_option backward.isDefEq.respectTransparency.types false in theorem lift_genericMonicPoly [CommRing K] [Nontrivial K] {n : ℕ} (v : Fin (n + 1) → K) : FreeCommRing.lift v (genericMonicPoly n) = (((monicEquivDegreeLT n).trans (degreeLTEquiv K n).toEquiv).symm (v ∘ Fin.castSucc)).1.eval @@ -175,6 +176,7 @@ theorem ACF_isComplete {p : ℕ} (hp : p.Prime ∨ p = 0) : have := isAlgClosed_of_model_ACF p M infer_instance +set_option backward.isDefEq.respectTransparency.types false in theorem finite_ACF_prime_not_realize_of_ACF_zero_realize (φ : Language.ring.Sentence) (h : Theory.ACF 0 ⊨ᵇ φ) : Set.Finite { p : Nat.Primes | ¬ Theory.ACF p ⊨ᵇ φ } := by diff --git a/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean b/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean index 804fbd743e1a2d..7de52dd23340d8 100644 --- a/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean +++ b/Mathlib/ModelTheory/Algebra/Ring/FreeCommRing.lean @@ -54,6 +54,7 @@ noncomputable def termOfFreeCommRing (p : FreeCommRing α) : Language.ring.Term variable {R : Type*} [CommRing R] [CompatibleRing R] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem realize_termOfFreeCommRing (p : FreeCommRing α) (v : α → R) : (termOfFreeCommRing p).realize v = FreeCommRing.lift v p := by diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean index dbdb246371611b..3f4a559e7b3808 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean @@ -109,6 +109,7 @@ lemma term_realize_eq_add_dotProduct [Fintype α] (t : presburger[[A]].Term α) variable [Finite α] +set_option backward.isDefEq.respectTransparency false in lemma isSemilinearSet_boundedFormula_realize {n} (φ : presburger[[A]].BoundedFormula α n) : IsSemilinearSet {v : α ⊕ Fin n → ℕ | φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr)} := by haveI := Fintype.ofFinite α diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean index 0759840f7cca0c..38473162ccfa29 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean @@ -201,6 +201,7 @@ public theorem Nat.isLinearSet_iff_exists_matrix {s : Set (ι → ℕ)} : refine exists₂_congr fun v n => ⟨fun ⟨f, hf⟩ => ⟨f.toNatLinearMap.toMatrix', ?_⟩, fun ⟨A, hA⟩ => ⟨A.mulVecLin, ?_⟩⟩ <;> ext <;> simp [*, mem_vadd_set] +set_option backward.isDefEq.respectTransparency false in private lemma Nat.isSemilinearSet_preimage_of_isLinearSet [Finite ι] {F : Type*} [FunLike F (ι → ℕ) M] [AddMonoidHomClass F (ι → ℕ) M] {s : Set M} (hs : IsLinearSet s) (f : F) : IsSemilinearSet (f ⁻¹' s) := by @@ -432,6 +433,7 @@ private theorem span_basisSet : span ℚ (toRatVec '' hs.basisSet) = ⊤ := by private noncomputable def basis : Basis hs.basisSet ℚ (ι → ℚ) := Basis.mk hs.linearIndepOn_basisSet (image_eq_range _ _ ▸ top_le_iff.2 hs.span_basisSet) +set_option backward.isDefEq.respectTransparency false in private theorem basis_apply (i) : hs.basis i = toRatVec i.1 := by simp [basis] @@ -548,6 +550,7 @@ private theorem fract_add_of_mem_closure {x y} (hy : y ∈ closure hs.basisSet) rw [map_add, ← sub_add_eq_add_sub] simp [-nsmul_eq_mul, ← hs.basis_apply, Finsupp.single_apply] +set_option backward.isDefEq.respectTransparency false in private theorem fract_mem_fundamentalDomain (x) : hs.fract x ∈ hs.fundamentalDomain := by classical intro i diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean index 3cceccbb2e484a..b2cac15217f2ea 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Defs.lean @@ -207,6 +207,7 @@ theorem isSemilinearSet_image_iff {F : Type*} [EquivLike F M N] [AddEquivClass F simp [image_image] · exact h.image f +set_option backward.isDefEq.respectTransparency false in /-- Semilinear sets are closed under projection (from `ι ⊕ κ → M` to `ι → M` by taking `Sum.inl` on the index). It is a special case of `IsSemilinearSet.image`. -/ theorem IsSemilinearSet.proj {s : Set (ι ⊕ κ → M)} (hs : IsSemilinearSet s) : diff --git a/Mathlib/ModelTheory/Basic.lean b/Mathlib/ModelTheory/Basic.lean index 4d6a39769479f4..99d663b998dc87 100644 --- a/Mathlib/ModelTheory/Basic.lean +++ b/Mathlib/ModelTheory/Basic.lean @@ -763,7 +763,7 @@ end SumStructure section Empty /-- Any type can be made uniquely into a structure over the empty language. -/ -@[implicit_reducible] +@[instance_reducible] def emptyStructure : Language.empty.Structure M where instance : Unique (Language.empty.Structure M) := @@ -807,7 +807,7 @@ open FirstOrder FirstOrder.Language FirstOrder.Language.Structure variable {L : Language} {M : Type*} {N : Type*} [L.Structure M] /-- A structure induced by a bijection. -/ -@[simps!, implicit_reducible] +@[simps!, instance_reducible] def inducedStructure (e : M ≃ N) : L.Structure N := ⟨fun f x => e (funMap f (e.symm ∘ x)), fun r x => RelMap r (e.symm ∘ x)⟩ diff --git a/Mathlib/ModelTheory/Definability.lean b/Mathlib/ModelTheory/Definability.lean index 0dcf15839fed42..b9fb40abf407c3 100644 --- a/Mathlib/ModelTheory/Definability.lean +++ b/Mathlib/ModelTheory/Definability.lean @@ -71,7 +71,7 @@ theorem definable_iff_exists_formula_sum : refine exists_congr (fun φ => iff_iff_eq.2 (congr_arg (s = ·) ?_)) ext simp only [BoundedFormula.constantsVarsEquiv, constantsOn, - BoundedFormula.mapTermRelEquiv_symm_apply, mem_setOf_eq, Formula.Realize] + mem_setOf_eq, Formula.Realize] refine BoundedFormula.realize_mapTermRel_id ?_ (fun _ _ _ => rfl) intros simp only [Term.constantsVarsEquivLeft_symm_apply, Term.realize_varsToConstants, diff --git a/Mathlib/ModelTheory/DirectLimit.lean b/Mathlib/ModelTheory/DirectLimit.lean index 1574327f4418e6..e4f84402dfea00 100644 --- a/Mathlib/ModelTheory/DirectLimit.lean +++ b/Mathlib/ModelTheory/DirectLimit.lean @@ -99,6 +99,7 @@ def unify {α : Type*} (x : α → Σˣ f) (i : ι) (h : i ∈ upperBounds (rang variable [DirectedSystem G fun i j h => f i j h] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem unify_sigma_mk_self {α : Type*} {i : ι} {x : α → G i} : (unify f (fun a => .mk f i (x a)) i fun _ ⟨_, hj⟩ => @@ -294,6 +295,7 @@ theorem of_f {i j : ι} {hij : i ≤ j} {x : G i} : of L ι G f j (f i j hij x) refine Setoid.symm ⟨j, hij, refl j, ?_⟩ simp only [DirectedSystem.map_self] +set_option backward.isDefEq.respectTransparency.types false in /-- Every element of the direct limit corresponds to some element in some component of the directed system. -/ theorem exists_of (z : DirectLimit G f) : ∃ i x, of L ι G f i x = z := @@ -309,6 +311,7 @@ theorem iSup_range_of_eq_top : ⨆ i, (of L ι G f i).toHom.range = ⊤ := eq_top_iff.2 (fun x _ ↦ DirectLimit.inductionOn x (fun i _ ↦ le_iSup (fun i ↦ Hom.range (Embedding.toHom (of L ι G f i))) i (mem_range_self _))) +set_option backward.isDefEq.respectTransparency.types false in /-- Every finitely generated substructure of the direct limit corresponds to some substructure in some component of the directed system. -/ theorem exists_fg_substructure_in_Sigma (S : L.Substructure (DirectLimit G f)) (S_fg : S.FG) : @@ -404,6 +407,7 @@ theorem equiv_lift_of {i : ι} (x : G i) : variable {L ι G f} +set_option backward.isDefEq.respectTransparency.types false in /-- The direct limit of countably many countably generated structures is countably generated. -/ theorem cg {ι : Type*} [Countable ι] [Preorder ι] [IsDirectedOrder ι] [Nonempty ι] {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j) @@ -450,6 +454,7 @@ theorem liftInclusion_of {i : ι} (x : S i) : (liftInclusion S) (of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i x) = Substructure.subtype (S i) x := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma rangeLiftInclusion : (liftInclusion S).toHom.range = ⨆ i, S i := by simp_rw [liftInclusion, range_lift, Substructure.range_subtype] diff --git a/Mathlib/ModelTheory/Equivalence.lean b/Mathlib/ModelTheory/Equivalence.lean index 770411c75d26af..c06e80f564f593 100644 --- a/Mathlib/ModelTheory/Equivalence.lean +++ b/Mathlib/ModelTheory/Equivalence.lean @@ -201,7 +201,7 @@ protected theorem imp {φ ψ φ' ψ' : L.BoundedFormula α n} (h : φ ⇔[T] ψ) end Iff /-- Semantic equivalence forms an equivalence relation on formulas. -/ -@[implicit_reducible] +@[instance_reducible] def iffSetoid (T : L.Theory) : Setoid (L.BoundedFormula α n) where r := T.Iff iseqv := ⟨fun _ => refl _, fun {_ _} h => h.symm, fun {_ _ _} h1 h2 => h1.trans h2⟩ diff --git a/Mathlib/ModelTheory/FinitelyGenerated.lean b/Mathlib/ModelTheory/FinitelyGenerated.lean index d5341b1c86ea86..c6ef65e598e357 100644 --- a/Mathlib/ModelTheory/FinitelyGenerated.lean +++ b/Mathlib/ModelTheory/FinitelyGenerated.lean @@ -97,6 +97,7 @@ theorem FG.of_map_embedding {N : Type*} [L.Structure N] (f : M ↪[L] N) {s : L. rw [h] at h' exact Hom.map_le_range h' +set_option backward.isDefEq.respectTransparency false in theorem FG.of_finite {s : L.Substructure M} [h : Finite s] : s.FG := ⟨Set.Finite.toFinset h, by simp only [Finite.coe_toFinset, closure_eq]⟩ diff --git a/Mathlib/ModelTheory/Fraisse.lean b/Mathlib/ModelTheory/Fraisse.lean index 9b89473fed2ffe..014226e3ce4a5e 100644 --- a/Mathlib/ModelTheory/Fraisse.lean +++ b/Mathlib/ModelTheory/Fraisse.lean @@ -327,6 +327,7 @@ theorem isUltrahomogeneous_iff_IsExtensionPair (M_CG : CG L M) : L.IsUltrahomoge ext rfl +set_option backward.isDefEq.respectTransparency.types false in theorem IsUltrahomogeneous.amalgamation_age (h : L.IsUltrahomogeneous M) : Amalgamation (L.age M) := by rintro N P Q NP NQ ⟨Nfg, ⟨-⟩⟩ ⟨Pfg, ⟨PM⟩⟩ ⟨Qfg, ⟨QM⟩⟩ @@ -404,6 +405,7 @@ end IsFraisseLimit namespace empty +set_option backward.isDefEq.respectTransparency.types false in /-- Any countable infinite structure in the empty language is a Fraïssé limit of the class of finite structures. -/ theorem isFraisseLimit_of_countable_infinite diff --git a/Mathlib/ModelTheory/Graph.lean b/Mathlib/ModelTheory/Graph.lean index 98dc597999ec1d..aa36f5ca3b32a5 100644 --- a/Mathlib/ModelTheory/Graph.lean +++ b/Mathlib/ModelTheory/Graph.lean @@ -53,7 +53,7 @@ protected def graph : Language := ⟨fun _ => Empty, graphRel⟩ abbrev adj : Language.graph.Relations 2 := .adj /-- Any simple graph can be thought of as a structure in the language of graphs. -/ -@[implicit_reducible] +@[instance_reducible] def _root_.SimpleGraph.structure (G : SimpleGraph V) : Language.graph.Structure V where RelMap | .adj => (fun x => G.Adj (x 0) (x 1)) diff --git a/Mathlib/ModelTheory/LanguageMap.lean b/Mathlib/ModelTheory/LanguageMap.lean index 19a26d6160d725..0a32a9695efd29 100644 --- a/Mathlib/ModelTheory/LanguageMap.lean +++ b/Mathlib/ModelTheory/LanguageMap.lean @@ -65,7 +65,7 @@ namespace LHom variable (ϕ : L →ᴸ L') /-- Pulls a structure back along a language map. -/ -@[implicit_reducible] +@[instance_reducible] def reduct (M : Type*) [L'.Structure M] : L.Structure M where funMap f xs := funMap (ϕ.onFunction f) xs RelMap r xs := RelMap (ϕ.onRelation r) xs @@ -182,7 +182,7 @@ protected structure Injective : Prop where /-- Pulls an `L`-structure along a language map `ϕ : L →ᴸ L'`, and then expands it to an `L'`-structure arbitrarily. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def defaultExpansion (ϕ : L →ᴸ L') [∀ (n) (f : L'.Functions n), Decidable (f ∈ Set.range fun f : L.Functions n => onFunction ϕ f)] [∀ (n) (r : L'.Relations n), Decidable (r ∈ Set.range fun r : L.Relations n => onRelation ϕ r)] @@ -344,7 +344,7 @@ theorem card_constantsOn : (constantsOn α).card = #α := by simp [card_eq_card_functions_add_card_relations, sum_nat_eq_add_sum_succ] /-- Gives a `constantsOn α` structure to a type by assigning each constant a value. -/ -@[implicit_reducible] +@[instance_reducible] def constantsOn.structure (f : α → M) : (constantsOn α).Structure M where funMap := fun {n} c _ => match n, c with diff --git a/Mathlib/ModelTheory/Order.lean b/Mathlib/ModelTheory/Order.lean index 0b85297e2ca919..d63b41f7d589f5 100644 --- a/Mathlib/ModelTheory/Order.lean +++ b/Mathlib/ModelTheory/Order.lean @@ -205,7 +205,7 @@ variable (L M) /-- Any linearly-ordered type is naturally a structure in the language `Language.order`. This is not an instance, because sometimes the `Language.order.Structure` is defined first. -/ -@[implicit_reducible] +@[instance_reducible] def orderStructure [LE M] : Language.order.Structure M where RelMap | .le => (fun x => x 0 ≤ x 1) @@ -234,6 +234,7 @@ instance [Language.order.Structure M] [Language.order.OrderedStructure M] variable [L.OrderedStructure M] +set_option backward.isDefEq.respectTransparency.types false in instance [Language.order.Structure M] [Language.order.OrderedStructure M] : LHom.IsExpansionOn (orderLHom L) M where map_onRelation := by simp [order.relation_eq_leSymb] @@ -354,7 +355,7 @@ section structure_to_order variable (L) [IsOrdered L] (M) [L.Structure M] /-- Any structure in an ordered language can be ordered correspondingly. -/ -@[implicit_reducible] +@[instance_reducible] def leOfStructure : LE M where le a b := Structure.RelMap (leSymb : L.Relations 2) ![a, b] @@ -375,7 +376,7 @@ def decidableLEOfStructure DecidableLE M := h /-- Any model of a theory of preorders is a preorder. -/ -@[implicit_reducible] +@[instance_reducible] def preorderOfModels [h : M ⊨ L.preorderTheory] : Preorder M where __ := L.leOfStructure M le_refl := (Relations.realize_reflexive.mp <| @@ -384,14 +385,14 @@ def preorderOfModels [h : M ⊨ L.preorderTheory] : Preorder M where Theory.model_iff _ |>.mp h _ <| by simp [preorderTheory]).trans /-- Any model of a theory of partial orders is a partial order. -/ -@[implicit_reducible] +@[instance_reducible] def partialOrderOfModels [h : M ⊨ L.partialOrderTheory] : PartialOrder M where __ := L.preorderOfModels M le_antisymm := (Relations.realize_antisymmetric.mp <| Theory.model_iff _ |>.mp h _ <| by simp [partialOrderTheory]).antisymm /-- Any model of a theory of linear orders is a linear order. -/ -@[implicit_reducible] +@[instance_reducible] def linearOrderOfModels [h : M ⊨ L.linearOrderTheory] [DecidableRel (fun (a b : M) => Structure.RelMap (leSymb : L.Relations 2) ![a, b])] : LinearOrder M where @@ -408,6 +409,7 @@ variable [Language.order.Structure M] [LE M] [Language.order.OrderedStructure M] {N : Type*} [Language.order.Structure N] [LE N] [Language.order.OrderedStructure N] {F : Type*} +set_option backward.isDefEq.respectTransparency.types false in instance [FunLike F M N] [OrderHomClass F M N] : Language.order.HomClass F M N := ⟨fun _ => isEmptyElim, by simp only [forall_relations, relation_eq_leSymb, relMap_leSymb, Fin.isValue, @@ -415,11 +417,13 @@ instance [FunLike F M N] [OrderHomClass F M N] : Language.order.HomClass F M N : exact fun φ x => map_rel φ⟩ -- If `OrderEmbeddingClass` or `RelEmbeddingClass` is defined, this should be generalized. +set_option backward.isDefEq.respectTransparency.types false in instance : Language.order.StrongHomClass (M ↪o N) M N := ⟨fun _ => isEmptyElim, by simp only [order.forall_relations, order.relation_eq_leSymb, relMap_leSymb, Fin.isValue, Function.comp_apply, RelEmbedding.map_rel_iff, implies_true]⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [EquivLike F M N] [OrderIsoClass F M N] : Language.order.StrongHomClass F M N := ⟨fun _ => isEmptyElim, by simp only [order.forall_relations, order.relation_eq_leSymb, relMap_leSymb, Fin.isValue, diff --git a/Mathlib/ModelTheory/PartialEquiv.lean b/Mathlib/ModelTheory/PartialEquiv.lean index 972b174ab5080c..e72d932c40654e 100644 --- a/Mathlib/ModelTheory/PartialEquiv.lean +++ b/Mathlib/ModelTheory/PartialEquiv.lean @@ -160,6 +160,7 @@ instance : PartialOrder (M ≃ₚ[L] N) where le_trans := le_trans le_antisymm := private le_antisymm +set_option backward.isDefEq.respectTransparency.types false in @[gcongr] lemma symm_le_symm {f g : M ≃ₚ[L] N} (hfg : f ≤ g) : f.symm ≤ g.symm := by rw [le_iff] refine ⟨cod_le_cod hfg, dom_le_dom hfg, ?_⟩ @@ -439,7 +440,7 @@ theorem isExtensionPair_iff_exists_embedding_closure_singleton_sup : and_self] · ext ⟨x, hx⟩ rw [Embedding.subtype_equivRange] at ff'2 - simp only [← ff'2, Embedding.comp_apply, Substructure.coe_inclusion, inclusion_mk, + simp only [← ff'2, Embedding.comp_apply, Substructure.coe_inclusion, Equiv.coe_toEmbedding, coe_subtype, PartialEquiv.toEmbedding_apply] · obtain ⟨f', eq_f'⟩ := h f.dom f_FG f.toEmbedding m refine ⟨⟨⟨closure L {m} ⊔ f.dom, f'.toHom.range, f'.equivRange⟩, diff --git a/Mathlib/ModelTheory/Semantics.lean b/Mathlib/ModelTheory/Semantics.lean index 740b4b574b525e..e6f0529cef8a9d 100644 --- a/Mathlib/ModelTheory/Semantics.lean +++ b/Mathlib/ModelTheory/Semantics.lean @@ -135,6 +135,7 @@ theorem realize_substFunc [L'.Structure M] {c : {n : ℕ} → L.Functions n → | var => simp | func f ts ih => simp [← ih, ← hc] +set_option backward.isDefEq.respectTransparency false in theorem realize_restrictVar [DecidableEq α] {t : L.Term α} {f : t.varFinset → β} {v : β → M} (v' : α → M) (hv' : ∀ a, v (f a) = v' a) : (t.restrictVar f).realize v = t.realize v' := by @@ -150,6 +151,7 @@ theorem realize_restrictVar' [DecidableEq α] {t : L.Term α} {s : Set α} (h : {v : α → M} : (t.restrictVar (Set.inclusion h)).realize (v ∘ (↑)) = t.realize v := realize_restrictVar _ (by simp) +set_option backward.isDefEq.respectTransparency false in theorem realize_restrictVarLeft [DecidableEq α] {γ : Type*} {t : L.Term (α ⊕ γ)} {f : t.varFinsetLeft → β} {xs : β ⊕ γ → M} (xs' : α → M) (hxs' : ∀ a, xs (Sum.inl (f a)) = xs' a) : @@ -437,6 +439,7 @@ theorem realize_subst {φ : L.BoundedFormula α n} {tf : α → L.Term β} {v : · rfl) (by simp) +set_option backward.isDefEq.respectTransparency false in theorem realize_restrictFreeVar [DecidableEq α] {n : ℕ} {φ : L.BoundedFormula α n} {f : φ.freeVarFinset → β} {v : β → M} {xs : Fin n → M} (v' : α → M) (hv' : ∀ a, v (f a) = v' a) : diff --git a/Mathlib/ModelTheory/Substructures.lean b/Mathlib/ModelTheory/Substructures.lean index a7039badaf7741..d8fca8c27bfed7 100644 --- a/Mathlib/ModelTheory/Substructures.lean +++ b/Mathlib/ModelTheory/Substructures.lean @@ -686,6 +686,7 @@ namespace LHom variable {L' : Language} [L'.Structure M] +set_option backward.isDefEq.respectTransparency false in /-- Reduces the language of a substructure along a language hom. -/ def substructureReduct (φ : L →ᴸ L') [φ.IsExpansionOn M] : L'.Substructure M ↪o L.Substructure M where @@ -866,6 +867,7 @@ def domRestrict (f : M ↪[L] N) (p : L.Substructure M) : p ↪[L] N := theorem domRestrict_apply (f : M ↪[L] N) (p : L.Substructure M) (x : p) : f.domRestrict p x = f x := rfl +set_option backward.isDefEq.respectTransparency false in /-- A first-order embedding `f : M → N` whose values lie in a substructure `p ⊆ N` can be restricted to an embedding `M → p`. -/ def codRestrict (p : L.Substructure N) (f : M ↪[L] N) (h : ∀ c, f c ∈ p) : M ↪[L] p where diff --git a/Mathlib/ModelTheory/Syntax.lean b/Mathlib/ModelTheory/Syntax.lean index 1b7dfa56d6698b..f791cf50feb02e 100644 --- a/Mathlib/ModelTheory/Syntax.lean +++ b/Mathlib/ModelTheory/Syntax.lean @@ -197,6 +197,7 @@ def varsToConstants : L.Term (γ ⊕ α) → L[[γ]].Term α | var (Sum.inl c) => Constants.term (Sum.inr c) | func f ts => func (Sum.inl f) fun i => (ts i).varsToConstants +set_option backward.isDefEq.respectTransparency false in /-- A bijection between terms with constants and terms with extra variables. -/ @[simps] def constantsVarsEquiv : L[[γ]].Term α ≃ L.Term (γ ⊕ α) := diff --git a/Mathlib/NumberTheory/ArithmeticFunction/Defs.lean b/Mathlib/NumberTheory/ArithmeticFunction/Defs.lean index f7387bd07f224d..f85046a66b2312 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction/Defs.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction/Defs.lean @@ -187,6 +187,7 @@ instance instAddMonoid : AddMonoid (ArithmeticFunction R) where end AddMonoid +set_option backward.isDefEq.respectTransparency false in instance instAddMonoidWithOne [AddMonoidWithOne R] : AddMonoidWithOne (ArithmeticFunction R) where natCast n := ⟨fun x ↦ if x = 1 then (n : R) else 0, by simp⟩ natCast_zero := by ext; simp @@ -397,6 +398,7 @@ theorem dirichletInverseFun_apply_ne {n : ℕ} (hn0 : n ≠ 0) (hn1 : n ≠ 1) : def dirichletInverse : ArithmeticFunction R := ⟨dirichletInverseFun f hf, dirichletInverseFun_apply_zero f hf⟩ +set_option backward.isDefEq.respectTransparency false in theorem self_mul_dirichletInverse (f : ArithmeticFunction R) (hf : Invertible (f 1)) : f * dirichletInverse f hf = 1 := by ext n diff --git a/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean b/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean index 15a06a3780598d..a4d20f9ecefd69 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean @@ -57,6 +57,7 @@ section CommSemiring variable [CommSemiring R] +set_option backward.isDefEq.respectTransparency.types false in /-- The arithmetic function corresponding to the Dirichlet series `f(q⁻ˢ)`. For example, if `f = 1 + X + X² + ...` and `q = p`, then `f(q⁻ˢ) = 1 + p⁻ˢ + p⁻²ˢ + ...`. @@ -129,6 +130,7 @@ noncomputable def ofPowerSeries (q : ℕ) : PowerSeries R →ₐ[R] ArithmeticFu exact ⟨0, by simp [hn]⟩ · simp +set_option backward.isDefEq.respectTransparency.types false in theorem ofPowerSeries_apply {q : ℕ} (hq : 1 < q) (f : PowerSeries R) (n : ℕ) : ofPowerSeries q f n = Function.extend (q ^ ·) (f.coeff ·) 0 n := by simp [ofPowerSeries, dif_pos hq] @@ -140,6 +142,7 @@ theorem ofPowerSeries_apply_pow {q : ℕ} (hq : 1 < q) (f : PowerSeries R) (k : theorem ofPowerSeries_apply_zero (q : ℕ) (f : PowerSeries R) : ofPowerSeries q f 0 = 0 := by simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] -- note that `ofPowerSeries_apply_one` relies on the junk value `f.constantCoeff`. theorem ofPowerSeries_apply_one (q : ℕ) (f : PowerSeries R) : diff --git a/Mathlib/NumberTheory/ArithmeticFunction/Moebius.lean b/Mathlib/NumberTheory/ArithmeticFunction/Moebius.lean index 3ec37887bb0a1e..9e6355da4e175f 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction/Moebius.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction/Moebius.lean @@ -203,6 +203,7 @@ theorem inv_zetaUnit : ((zetaUnit⁻¹ : (ArithmeticFunction R)ˣ) : ArithmeticF end CommRing +set_option backward.isDefEq.respectTransparency false in /-- Möbius inversion for functions to an `AddCommGroup`. -/ theorem sum_eq_iff_sum_smul_moebius_eq [AddCommGroup R] {f g : ℕ → R} : (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔ diff --git a/Mathlib/NumberTheory/ArithmeticFunction/Zeta.lean b/Mathlib/NumberTheory/ArithmeticFunction/Zeta.lean index a7320c6d952dbd..b3db3bd5127a49 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction/Zeta.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction/Zeta.lean @@ -52,10 +52,12 @@ theorem zeta_apply {x : ℕ} : ζ x = if x = 0 then 0 else 1 := theorem zeta_apply_ne {x : ℕ} (h : x ≠ 0) : ζ x = 1 := if_neg h +set_option backward.isDefEq.respectTransparency false in theorem zeta_eq_zero {x : ℕ} : ζ x = 0 ↔ x = 0 := by simp [zeta] theorem zeta_pos {x : ℕ} : 0 < ζ x ↔ 0 < x := by simp [pos_iff_ne_zero] +set_option backward.isDefEq.respectTransparency false in theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [MulAction R M] {f : ArithmeticFunction M} {x : ℕ} : ((↑ζ : ArithmeticFunction R) • f) x = ∑ i ∈ divisors x, f i := by @@ -83,6 +85,7 @@ theorem coe_zeta_mul_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} : (ζ * f) x = ∑ i ∈ divisors x, f i := coe_zeta_smul_apply +set_option backward.isDefEq.respectTransparency false in theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} : (f * ζ) x = ∑ i ∈ divisors x, f i := by rw [← coe_zeta_mul_comm, coe_zeta_mul_apply] @@ -141,6 +144,7 @@ open scoped zeta def ppow (f : ArithmeticFunction R) (k : ℕ) : ArithmeticFunction R := if h0 : k = 0 then ζ else ⟨fun x ↦ f x ^ k, by simp_rw [map_zero, zero_pow h0]⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ppow_zero {f : ArithmeticFunction R} : f.ppow 0 = ζ := by rw [ppow, dif_pos rfl] @@ -148,6 +152,7 @@ theorem ppow_zero {f : ArithmeticFunction R} : f.ppow 0 = ζ := by rw [ppow, dif theorem ppow_one {f : ArithmeticFunction R} : f.ppow 1 = f := by ext; simp [ppow] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ppow_apply {f : ArithmeticFunction R} {k x : ℕ} (kpos : 0 < k) : f.ppow k x = f x ^ k := by rw [ppow, dif_neg (Nat.ne_of_gt kpos), coe_mk] diff --git a/Mathlib/NumberTheory/Chebyshev.lean b/Mathlib/NumberTheory/Chebyshev.lean index 2049e11cbe46e0..c37b90eec44eef 100644 --- a/Mathlib/NumberTheory/Chebyshev.lean +++ b/Mathlib/NumberTheory/Chebyshev.lean @@ -480,6 +480,7 @@ theorem integrableOn_theta_div_id_mul_log_sq (x : ℝ) : have : x * log x ^ 2 ≠ 0 := mul_ne_zero this <| by simp; grind fun_prop +set_option backward.isDefEq.respectTransparency.types false in /-- Expresses the prime counting function `π` in terms of `θ` by using Abel summation. -/ theorem primeCounting_eq_theta_div_log_add_integral {x : ℝ} (hx : 2 ≤ x) : π ⌊x⌋₊ = θ x / log x + ∫ t in 2..x, θ t / (t * log t ^ 2) := by @@ -516,6 +517,7 @@ theorem primeCounting_eq_theta_div_log_add_integral {x : ℝ} (hx : 2 ≤ x) : refine pow_ne_zero 2 <| log_ne_zero_of_pos_of_ne_one ?_ ?_ <;> linarith exact ContinuousAt.continuousWithinAt <| by fun_prop +set_option backward.isDefEq.respectTransparency.types false in /-- Expresses the Chebyshev theta function `ϑ` in terms of `π` by using Abel summation. -/ theorem theta_eq_primeCounting_mul_log_sub_integral {x : ℝ} (hx : 2 ≤ x) : θ x = π ⌊x⌋₊ * log x - ∫ t in 2..x, π ⌊t⌋₊ / t := by diff --git a/Mathlib/NumberTheory/ClassNumber/Finite.lean b/Mathlib/NumberTheory/ClassNumber/Finite.lean index 9ececd2e0e3e3c..79f919d6cf4394 100644 --- a/Mathlib/NumberTheory/ClassNumber/Finite.lean +++ b/Mathlib/NumberTheory/ClassNumber/Finite.lean @@ -184,6 +184,7 @@ open Real attribute [-instance] Real.decidableEq +set_option backward.isDefEq.respectTransparency.types false in /-- We can approximate `a / b : L` with `q / r`, where `r` has finitely many options for `L`. -/ theorem exists_mem_finsetApprox (a : S) {b} (hb : b ≠ (0 : R)) : ∃ q : S, @@ -325,7 +326,7 @@ algebraic extension `L` is finite if there is an admissible absolute value. See also `ClassGroup.fintypeOfAdmissibleOfFinite` where `L` is a finite extension of `K = Frac(R)`, supplying most of the required assumptions automatically. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfAdmissibleOfAlgebraic [IsDedekindDomain S] [Algebra.IsAlgebraic R S] : Fintype (ClassGroup S) := @Fintype.ofSurjective _ _ _ @@ -347,7 +348,7 @@ absolute value. See also `ClassGroup.fintypeOfAdmissibleOfAlgebraic` where `L` is an algebraic extension of `R`, that includes some extra assumptions. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfAdmissibleOfFinite [IsIntegralClosure S R L] : Fintype (ClassGroup S) := by letI := Classical.decEq L diff --git a/Mathlib/NumberTheory/Dioph.lean b/Mathlib/NumberTheory/Dioph.lean index 585cda8b56ae2d..00b5e723a5fbca 100644 --- a/Mathlib/NumberTheory/Dioph.lean +++ b/Mathlib/NumberTheory/Dioph.lean @@ -443,6 +443,7 @@ theorem diophFn_vec (f : Vector3 ℕ n → ℕ) : DiophFn f ↔ Dioph {v | f (v theorem diophPFun_vec (f : Vector3 ℕ n →. ℕ) : DiophPFun f ↔ Dioph {v | (v ∘ fs, v fz) ∈ f.graph} := ⟨reindex_dioph _ (fz ::ₒ fs), reindex_dioph _ (none::some)⟩ +set_option backward.isDefEq.respectTransparency false in theorem diophFn_compn : ∀ {n} {S : Set (α ⊕ (Fin2 n) → ℕ)} (_ : Dioph S) {f : Vector3 ((α → ℕ) → ℕ) n} (_ : VectorAllP DiophFn f), Dioph {v : α → ℕ | (v ⊗ fun i => f i v) ∈ S} @@ -476,6 +477,7 @@ theorem dioph_comp {S : Set (Vector3 ℕ n)} (d : Dioph S) (f : Vector3 ((α → (df : VectorAllP DiophFn f) : Dioph {v | (fun i => f i v) ∈ S} := diophFn_compn (reindex_dioph _ inr d) df +set_option backward.isDefEq.respectTransparency false in theorem diophFn_comp {f : Vector3 ℕ n → ℕ} (df : DiophFn f) (g : Vector3 ((α → ℕ) → ℕ) n) (dg : VectorAllP DiophFn g) : DiophFn fun v => f fun i => g i v := dioph_comp ((diophFn_vec _).1 df) ((fun v ↦ v none) :: fun i v ↦ g i (v ∘ some)) <| by diff --git a/Mathlib/NumberTheory/Divisors.lean b/Mathlib/NumberTheory/Divisors.lean index f618c255395e35..5104bf5c778833 100644 --- a/Mathlib/NumberTheory/Divisors.lean +++ b/Mathlib/NumberTheory/Divisors.lean @@ -367,6 +367,7 @@ theorem image_snd_divisorsAntidiagonal : (divisorsAntidiagonal n).image Prod.snd rw [← map_swap_divisorsAntidiagonal, map_eq_image, image_image] exact image_fst_divisorsAntidiagonal +set_option backward.isDefEq.respectTransparency false in theorem map_div_right_divisors : n.divisors.map ⟨fun d => (d, n / d), fun _ _ => congr_arg Prod.fst⟩ = n.divisorsAntidiagonal := by @@ -380,6 +381,7 @@ theorem map_div_right_divisors : · rintro ⟨rfl, hn⟩ exact ⟨⟨dvd_mul_right _ _, hn⟩, Nat.mul_div_cancel_left _ (left_ne_zero_of_mul hn).bot_lt⟩ +set_option backward.isDefEq.respectTransparency false in theorem map_div_left_divisors : n.divisors.map ⟨fun d => (n / d, d), fun _ _ => congr_arg Prod.snd⟩ = n.divisorsAntidiagonal := by diff --git a/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean b/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean index 903184cf97c479..46f260fc0add57 100644 --- a/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean +++ b/Mathlib/NumberTheory/EulerProduct/DirichletLSeries.lean @@ -184,7 +184,7 @@ lemma DirichletCharacter.LSeries_changeLevel {M N : ℕ} [NeZero N] · exact multipliable_subtype_iff_mulIndicator.mp Multipliable.of_finite · congr 1 with p simp only [Set.mulIndicator_apply, Set.mem_setOf_eq, Finset.mem_coe, Nat.mem_primeFactors, - ne_eq, mul_ite, ite_mul, one_mul, mul_one] + ne_eq, mul_ite, mul_one] by_cases h : p.Prime; swap · simp only [h, false_and, if_false] simp only [h, true_and, if_true] diff --git a/Mathlib/NumberTheory/EulerProduct/ExpLog.lean b/Mathlib/NumberTheory/EulerProduct/ExpLog.lean index ac23af5df1ea45..1b4c7927bf8b3c 100644 --- a/Mathlib/NumberTheory/EulerProduct/ExpLog.lean +++ b/Mathlib/NumberTheory/EulerProduct/ExpLog.lean @@ -35,6 +35,7 @@ lemma Summable.clog_one_sub {α : Type*} {f : α → ℂ} (hsum : Summable f) : namespace EulerProduct +set_option backward.isDefEq.respectTransparency false in /-- A variant of the Euler Product formula in terms of the exponential of a sum of logarithms. -/ theorem exp_tsum_primes_log_eq_tsum {f : ℕ →*₀ ℂ} (hsum : Summable (‖f ·‖)) : exp (∑' p : Nat.Primes, -log (1 - f p)) = ∑' n : ℕ, f n := by diff --git a/Mathlib/NumberTheory/Height/NumberField.lean b/Mathlib/NumberTheory/Height/NumberField.lean index b2d76f256baf5c..3f679abc543857 100644 --- a/Mathlib/NumberTheory/Height/NumberField.lean +++ b/Mathlib/NumberTheory/Height/NumberField.lean @@ -52,6 +52,7 @@ lemma count_multisetInfinitePlace_eq_mult [DecidableEq (AbsoluteValue K ℝ)] (v simpa only [multisetInfinitePlace, Multiset.count_bind, Finset.sum_map_val, Multiset.count_replicate, ← Subtype.ext_iff] using Fintype.sum_ite_eq' v .. +set_option backward.isDefEq.respectTransparency.types false in -- For the user-facing version, see `prod_archAbsVal_eq` below. private lemma prod_multisetInfinitePlace_eq {M : Type*} [CommMonoid M] (f : AbsoluteValue K ℝ → M) : ((multisetInfinitePlace K).map f).prod = ∏ v : InfinitePlace K, f v.val ^ v.mult := by @@ -79,6 +80,7 @@ lemma prod_nonarchAbsVal_eq {M : Type*} [CommMonoid M] (f : AbsoluteValue K ℝ (∏ᶠ v : nonarchAbsVal, f v.val) = ∏ᶠ v : FinitePlace K, f v.val := rfl +set_option backward.isDefEq.respectTransparency.types false in open Finset Multiset in lemma sum_archAbsVal_eq {M : Type*} [AddCommMonoid M] (f : AbsoluteValue K ℝ → M) : (archAbsVal.map f).sum = ∑ v : InfinitePlace K, v.mult • f v.val := by diff --git a/Mathlib/NumberTheory/LSeries/Convolution.lean b/Mathlib/NumberTheory/LSeries/Convolution.lean index 8a6c97a19d2c94..10963919cba3d5 100644 --- a/Mathlib/NumberTheory/LSeries/Convolution.lean +++ b/Mathlib/NumberTheory/LSeries/Convolution.lean @@ -41,12 +41,14 @@ def toArithmeticFunction {R : Type*} [Zero R] (f : ℕ → R) : ArithmeticFuncti toFun n := if n = 0 then 0 else f n map_zero' := rfl +set_option backward.isDefEq.respectTransparency false in lemma toArithmeticFunction_congr {R : Type*} [Zero R] {f f' : ℕ → R} (h : ∀ {n}, n ≠ 0 → f n = f' n) : toArithmeticFunction f = toArithmeticFunction f' := by ext simp_all [toArithmeticFunction] +set_option backward.isDefEq.respectTransparency false in /-- If we consider an arithmetic function just as a function and turn it back into an arithmetic function, it is the same as before. -/ @[simp] @@ -78,6 +80,7 @@ lemma ArithmeticFunction.coe_mul {R : Type*} [Semiring R] (f g : ArithmeticFunct namespace LSeries +set_option backward.isDefEq.respectTransparency false in lemma convolution_def {R : Type*} [Semiring R] (f g : ℕ → R) : f ⍟ g = fun n ↦ ∑ p ∈ n.divisorsAntidiagonal, f p.1 * g p.2 := by ext n diff --git a/Mathlib/NumberTheory/LSeries/Dirichlet.lean b/Mathlib/NumberTheory/LSeries/Dirichlet.lean index adc4d5b6a96f5f..b520ffa4266f26 100644 --- a/Mathlib/NumberTheory/LSeries/Dirichlet.lean +++ b/Mathlib/NumberTheory/LSeries/Dirichlet.lean @@ -59,6 +59,7 @@ open scoped Moebius open LSeries Nat Complex +set_option backward.isDefEq.respectTransparency.types false in lemma not_LSeriesSummable_moebius_at_one : ¬ LSeriesSummable ↗μ 1 := by refine fun h ↦ not_summable_one_div_on_primes <| summable_ofReal.mp <| .of_neg ?_ refine (h.indicator {n | n.Prime}).congr fun n ↦ ?_ @@ -170,6 +171,7 @@ lemma modOne_eq_one {R : Type*} [CommMonoidWithZero R] {χ : DirichletCharacter lemma LSeries_modOne_eq : L ↗χ₁ = L 1 := congr_arg L modOne_eq_one +set_option backward.isDefEq.respectTransparency.types false in /-- The L-series of a Dirichlet character mod `N > 0` does not converge absolutely at `s = 1`. -/ lemma not_LSeriesSummable_at_one {N : ℕ} (hN : N ≠ 0) (χ : DirichletCharacter ℂ N) : ¬ LSeriesSummable ↗χ 1 := by diff --git a/Mathlib/NumberTheory/LSeries/Injectivity.lean b/Mathlib/NumberTheory/LSeries/Injectivity.lean index 029dc04d8f0a10..ce52398f832e09 100644 --- a/Mathlib/NumberTheory/LSeries/Injectivity.lean +++ b/Mathlib/NumberTheory/LSeries/Injectivity.lean @@ -50,6 +50,7 @@ lemma cpow_mul_div_cpow_eq_div_div_cpow (m n : ℕ) (z : ℂ) (x : ℝ) : rw [← cpow_neg, show (-x : ℂ) = (-1 : ℝ) * x by simp, cpow_mul_ofReal_nonneg Hn, Real.rpow_neg_one, inv_inv] +set_option backward.isDefEq.respectTransparency false in open Filter Real in /-- If the coefficients `f m` of an L-series are zero for `m ≤ n` and the L-series converges at some point, then `f (n+1)` is the limit of `(n+1)^x * LSeries f x` as `x → ∞`. -/ diff --git a/Mathlib/NumberTheory/LSeries/Nonvanishing.lean b/Mathlib/NumberTheory/LSeries/Nonvanishing.lean index ddcc011f4f95d2..610bd56365d49c 100644 --- a/Mathlib/NumberTheory/LSeries/Nonvanishing.lean +++ b/Mathlib/NumberTheory/LSeries/Nonvanishing.lean @@ -86,6 +86,7 @@ lemma LSeriesSummable_zetaMul (χ : DirichletCharacter ℂ N) {s : ℂ} (hs : 1 simpa only [toArithmeticFunction, coe_mk, hn, ↓reduceIte] using norm_le_one χ _ +set_option backward.isDefEq.respectTransparency.types false in lemma zetaMul_prime_pow_nonneg {χ : DirichletCharacter ℂ N} (hχ : χ ^ 2 = 1) {p : ℕ} (hp : p.Prime) (k : ℕ) : 0 ≤ zetaMul χ (p ^ k) := by diff --git a/Mathlib/NumberTheory/LucasLehmer.lean b/Mathlib/NumberTheory/LucasLehmer.lean index a381274bed4c81..e837b14ef0afab 100644 --- a/Mathlib/NumberTheory/LucasLehmer.lean +++ b/Mathlib/NumberTheory/LucasLehmer.lean @@ -352,6 +352,7 @@ def ω : X q := (2, 1) /-- We define `ωb = 2 - √3`, which is the inverse of `ω`. -/ def ωb : X q := (2, -1) +set_option backward.isDefEq.respectTransparency.types false in theorem ω_mul_ωb : (ω : X q) * ωb = 1 := by dsimp [ω, ωb] ext <;> simp; ring @@ -359,6 +360,7 @@ theorem ω_mul_ωb : (ω : X q) * ωb = 1 := by theorem ωb_mul_ω : (ωb : X q) * ω = 1 := by rw [mul_comm, ω_mul_ωb] +set_option backward.isDefEq.respectTransparency.types false in /-- A closed form for the recurrence relation. -/ theorem closed_form (i : ℕ) : (s i : X q) = (ω : X q) ^ 2 ^ i + (ωb : X q) ^ 2 ^ i := by induction i with @@ -378,9 +380,11 @@ theorem closed_form (i : ℕ) : (s i : X q) = (ω : X q) ^ 2 ^ i + (ωb : X q) ^ /-- We define `α = √3`. -/ def α : X q := (0, 1) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma α_sq : (α ^ 2 : X q) = 3 := by ext <;> simp [α, sq] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma one_add_α_sq : ((1 + α) ^ 2 : X q) = 2 * ω := by ext <;> simp [α, ω, sq] <;> norm_num diff --git a/Mathlib/NumberTheory/Modular.lean b/Mathlib/NumberTheory/Modular.lean index 3c3c0964047d25..c66c68c0ce44eb 100644 --- a/Mathlib/NumberTheory/Modular.lean +++ b/Mathlib/NumberTheory/Modular.lean @@ -82,6 +82,11 @@ variable {g : SL(2, ℤ)} (z : ℍ) section BottomRow +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Matrix + SpecialLinearGroup + /-- The two numbers `c`, `d` in the "bottom row" of `g=[[*,*],[c,d]]` in `SL(2, ℤ)` are coprime. -/ theorem bottom_row_coprime {R : Type*} [CommRing R] (g : SL(2, R)) : IsCoprime ((↑g : Matrix (Fin 2) (Fin 2) R) 1 0) ((↑g : Matrix (Fin 2) (Fin 2) R) 1 1) := @@ -184,6 +189,7 @@ def lcRow0Extend {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) : rw [neg_sq] exact hcd.sq_add_sq_ne_zero, LinearEquiv.refl ℝ (Fin 2 → ℝ)] +set_option backward.isDefEq.respectTransparency false in /-- The map `lcRow0` is proper, that is, preimages of cocompact sets are finite in `[[* , *], [c, d]]`. -/ theorem tendsto_lcRow0 {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) : @@ -654,6 +660,7 @@ private lemma case_c_one_d_neg_one (hz : z ∈ 𝒟) (hg : g • z ∈ 𝒟) (hg rw [← Int.cast_one, ← Int.cast_neg, Int.cast_le] at this grind +set_option backward.isDefEq.respectTransparency false in private lemma serreTheorem_im_eq (hz : z ∈ 𝒟) (hg : g • z ∈ 𝒟) : (g • z).im = z.im := by wlog hden : z.im ≤ (g • z).im · rw [← this (g := g⁻¹) hg (by simpa using hz) (by simpa using le_of_not_ge hden)] diff --git a/Mathlib/NumberTheory/ModularForms/Bounds.lean b/Mathlib/NumberTheory/ModularForms/Bounds.lean index e890fa454354eb..98e86ddf4c42ff 100644 --- a/Mathlib/NumberTheory/ModularForms/Bounds.lean +++ b/Mathlib/NumberTheory/ModularForms/Bounds.lean @@ -120,7 +120,7 @@ lemma exists_bound_of_subgroup_invariant_of_isBigO exact ⟨g⁻¹ * h, hgh, (mul_inv_cancel_left g h).symm⟩ simp [-sl_moeb, hj', mul_smul, hf_inv j⁻¹ (inv_mem hj)] have hf'_cont γ : Continuous (f' · γ) := QuotientGroup.induction_on γ fun g ↦ by - simp only [sl_moeb, Quotient.lift_mk, f'] + simp only [sl_moeb, f'] fun_prop have hf'_inv τ (g : SL(2, ℤ)) γ : f' (g • τ) (g • γ) = f' τ γ := by induction γ using QuotientGroup.induction_on diff --git a/Mathlib/NumberTheory/ModularForms/Cusps.lean b/Mathlib/NumberTheory/ModularForms/Cusps.lean index 102372815d0acd..4e7910d430eda3 100644 --- a/Mathlib/NumberTheory/ModularForms/Cusps.lean +++ b/Mathlib/NumberTheory/ModularForms/Cusps.lean @@ -433,18 +433,22 @@ open Subgroup namespace CongruenceSubgroup +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma strictPeriods_Gamma0 (N : ℕ) : strictPeriods (Gamma0 N : Subgroup (GL (Fin 2) ℝ)) = AddSubgroup.zmultiples 1 := strictPeriods_eq_zmultiples_one_of_T_mem <| by simp [ModularGroup.T] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma strictPeriods_Gamma1 (N : ℕ) : strictPeriods (Gamma1 N : Subgroup (GL (Fin 2) ℝ)) = AddSubgroup.zmultiples 1 := strictPeriods_eq_zmultiples_one_of_T_mem <| by simp [ModularGroup.T] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma strictWidthInfty_Gamma0 (N : ℕ) : strictWidthInfty (Gamma0 N : Subgroup (GL (Fin 2) ℝ)) = 1 := strictWidthInfty_eq_one_of_T_mem <| by simp [ModularGroup.T] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma strictWidthInfty_Gamma1 (N : ℕ) : strictWidthInfty (Gamma1 N : Subgroup (GL (Fin 2) ℝ)) = 1 := strictWidthInfty_eq_one_of_T_mem <| by simp [ModularGroup.T] diff --git a/Mathlib/NumberTheory/ModularForms/Discriminant.lean b/Mathlib/NumberTheory/ModularForms/Discriminant.lean index 910454dce5a432..7d1e6283ff3946 100644 --- a/Mathlib/NumberTheory/ModularForms/Discriminant.lean +++ b/Mathlib/NumberTheory/ModularForms/Discriminant.lean @@ -123,6 +123,7 @@ lemma discriminant_eq_q_prod (z : ℍ) : Δ z = 𝕢 1 z * ∏' n, (1 - eta_q n lemma discriminant_ne_zero (z : ℍ) : Δ z ≠ 0 := by simpa [discriminant] using eta_ne_zero z.2 +set_option backward.isDefEq.respectTransparency.types false in /-- The discriminant is invariant under `T : z ↦ z + 1`, i.e., `Δ(z + 1) = Δ(z)`. -/ lemma discriminant_T_invariant : (Δ ∣[(12 : ℤ)] ModularGroup.T) = Δ := by ext z @@ -138,6 +139,7 @@ lemma eta_comp_eq_csqrt_I_inv : upperHalfPlaneSet.EqOn have h3 : η I = z * sqrt I * η I := by simpa [← mul_assoc] using h (show I ∈ _ by simp) grind [sqrt, eta_ne_zero (show 0 < I.im by simp)] +set_option backward.isDefEq.respectTransparency.types false in /-- The discriminant satisfies the modular transformation for `S : z ↦ -1 / z`: we have `Δ(-1 / z) = z ^ 12 · Δ(z)`. -/ lemma discriminant_S_invariant : (Δ ∣[(12 : ℤ)] ModularGroup.S) = Δ := by diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Defs.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Defs.lean index 6aeb4fd7759199..833b05a3c81309 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Defs.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Defs.lean @@ -98,6 +98,7 @@ lemma D2_T : D2 ModularGroup.T = 0 := by ext z simp [D2, ModularGroup.T] +set_option backward.isDefEq.respectTransparency.types false in lemma D2_S (z : ℍ) : D2 ModularGroup.S z = 2 * π * I / z := by simp [D2, ModularGroup.S, ModularGroup.denom_apply] diff --git a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Transform.lean b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Transform.lean index f8f56c73da9b4a..bc4a77977e1f31 100644 --- a/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Transform.lean +++ b/Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Transform.lean @@ -189,6 +189,7 @@ lemma G2_S_transform (z : ℍ) : G2 z = ((z : ℂ) ^ 2)⁻¹ * G2 (S • z) - -2 rw [G2_S_action_eq_tsum_G2Term, G2_eq_tsum_G2Term z, ← tsum_G2Term_eq_tsum', tsum_G2Term_eq_tsum] +set_option backward.isDefEq.respectTransparency.types false in lemma G2_T_transform : G2 ∣[(2 : ℤ)] T = G2 := by ext z simp_rw [SL_slash_def, modular_T_smul z] diff --git a/Mathlib/NumberTheory/ModularForms/Identities.lean b/Mathlib/NumberTheory/ModularForms/Identities.lean index cb7050cefd69fd..891340fa358862 100644 --- a/Mathlib/NumberTheory/ModularForms/Identities.lean +++ b/Mathlib/NumberTheory/ModularForms/Identities.lean @@ -44,6 +44,7 @@ theorem T_zpow_width_invariant (N : ℕ) (k n : ℤ) (f : SlashInvariantForm (Ga rw [modular_T_zpow_smul z (N * n)] simpa only [Int.cast_mul, Int.cast_natCast] using vAdd_width_periodic N k n f z +set_option backward.isDefEq.respectTransparency.types false in lemma slash_S_apply (f : ℍ → ℂ) (k : ℤ) (z : ℍ) : (f ∣[k] ModularGroup.S) z = f (.mk _ z.im_inv_neg_coe_pos) * z ^ (-k) := by rw [SL_slash_apply, modular_S_smul] diff --git a/Mathlib/NumberTheory/ModularForms/SlashActions.lean b/Mathlib/NumberTheory/ModularForms/SlashActions.lean index 8a70bf98a4e524..dc666c4dae75c6 100644 --- a/Mathlib/NumberTheory/ModularForms/SlashActions.lean +++ b/Mathlib/NumberTheory/ModularForms/SlashActions.lean @@ -61,7 +61,7 @@ attribute [simp] SlashAction.zero_slash SlashAction.slash_one SlashAction.add_sl | insert i t hi IH => simp [hi, IH] /-- `SlashAction` induced by a monoid homomorphism. -/ -@[implicit_reducible] +@[instance_reducible] def monoidHomSlashAction {β G H α : Type*} [Monoid G] [AddMonoid α] [Monoid H] [SlashAction β G α] (h : H →* G) : SlashAction β H α where map k g := SlashAction.map k (h g) diff --git a/Mathlib/NumberTheory/NumberField/Basic.lean b/Mathlib/NumberTheory/NumberField/Basic.lean index 14a4d13f5d746f..62f6ef0510a94a 100644 --- a/Mathlib/NumberTheory/NumberField/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Basic.lean @@ -172,6 +172,7 @@ lemma mk_eq_mk (x y : K) (hx hy) : (⟨x, hx⟩ : 𝓞 K) = ⟨y, hy⟩ ↔ x = @[simp] lemma neg_mk (x : K) (hx) : (-⟨x, hx⟩ : 𝓞 K) = ⟨-x, neg_mem hx⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The ring homomorphism `(𝓞 K) →+* (𝓞 L)` given by restricting a ring homomorphism `f : K →+* L` to `𝓞 K`. -/ def mapRingHom {K L : Type*} [Field K] [Field L] (f : K →+* L) : (𝓞 K) →+* (𝓞 L) where diff --git a/Mathlib/NumberTheory/NumberField/CMField.lean b/Mathlib/NumberTheory/NumberField/CMField.lean index 191bb7493b7c67..53e5c880420530 100644 --- a/Mathlib/NumberTheory/NumberField/CMField.lean +++ b/Mathlib/NumberTheory/NumberField/CMField.lean @@ -204,6 +204,7 @@ theorem complexConj_eq_self_iff (x : K) : · rw [IsGalois.fixedField_top, IntermediateField.mem_bot] aesop +set_option backward.isDefEq.respectTransparency.types false in protected theorem RingOfIntegers.complexConj_eq_self_iff (x : 𝓞 K) : complexConj K x = x ↔ ∃ y : 𝓞 K⁺, algebraMap (𝓞 K⁺) K y = x := by rw [complexConj_eq_self_iff] diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean index fca12cda01748c..9afe80b250a2d7 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean @@ -160,6 +160,7 @@ theorem mem_rat_span_latticeBasis [NumberField K] (x : K) : rw [← latticeBasis_apply] exact Set.mem_range_self i +set_option backward.isDefEq.respectTransparency.types false in theorem integralBasis_repr_apply [NumberField K] (x : K) (i : Free.ChooseBasisIndex ℤ (𝓞 K)) : (latticeBasis K).repr (canonicalEmbedding K x) i = (integralBasis K).repr x i := by rw [← Basis.restrictScalars_repr_apply ℚ _ ⟨_, mem_rat_span_latticeBasis K x⟩, eq_ratCast, @@ -240,6 +241,7 @@ instance : NoAtoms (volume : Measure (mixedSpace K)) := by pi_noAtoms ⟨w, not_isReal_iff_isComplex.mp hw⟩ exact prod.instNoAtoms_snd +set_option backward.isDefEq.respectTransparency.types false in variable {K} in open Classical in /-- The set of points in the mixedSpace that are equal to `0` at a fixed (real) place has @@ -694,6 +696,7 @@ theorem mem_rat_span_latticeBasis (x : K) : rw [← latticeBasis_apply] exact Set.mem_range_self i +set_option backward.isDefEq.respectTransparency.types false in theorem latticeBasis_repr_apply (x : K) (i : ChooseBasisIndex ℤ (𝓞 K)) : (latticeBasis K).repr (mixedEmbedding K x) i = (integralBasis K).repr x i := by rw [← Basis.restrictScalars_repr_apply ℚ _ ⟨_, mem_rat_span_latticeBasis K x⟩, eq_ratCast, @@ -1103,6 +1106,7 @@ abbrev realSpace := InfinitePlace K → ℝ variable {K} +set_option backward.isDefEq.respectTransparency.types false in /-- The set of points in the `realSpace` that are equal to `0` at a fixed place has volume zero. -/ theorem realSpace.volume_eq_zero [NumberField K] (w : InfinitePlace K) : volume ({x : realSpace K | x w = 0}) = 0 := by diff --git a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean index bea0228933450b..81b0870e3e6d25 100644 --- a/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean +++ b/Mathlib/NumberTheory/NumberField/CanonicalEmbedding/FundamentalCone.lean @@ -226,6 +226,7 @@ theorem smul_mem_iff_mem (hc : c ≠ 0) : convert! smul_mem_of_mem h (inv_ne_zero hc) rw [eq_inv_smul_iff₀ hc] +set_option backward.isDefEq.respectTransparency.types false in theorem exists_unit_smul_mem (hx : mixedEmbedding.norm x ≠ 0) : ∃ u : (𝓞 K)ˣ, u • x ∈ fundamentalCone K := by classical @@ -480,6 +481,7 @@ the integral ideal `J`. -/ def idealSet : Set (mixedSpace K) := fundamentalCone K ∩ (mixedEmbedding.idealLattice K (FractionalIdeal.mk0 K J)) +set_option backward.isDefEq.respectTransparency.types false in variable {K J} in theorem mem_idealSet : x ∈ idealSet K J ↔ x ∈ fundamentalCone K ∧ ∃ a : (𝓞 K), (a : 𝓞 K) ∈ (J : Set (𝓞 K)) ∧ @@ -521,6 +523,7 @@ variable {K J} theorem idealSetEquiv_apply (a : idealSet K J) : (idealSetEquiv K J a : mixedSpace K) = a := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem idealSetEquiv_symm_apply (a : {a : integerSet K // (preimageOfMemIntegerSet a : 𝓞 K) ∈ (J : Set (𝓞 K)) }) : ((idealSetEquiv K J).symm a : mixedSpace K) = a := by diff --git a/Mathlib/NumberTheory/NumberField/Completion/FinitePlace.lean b/Mathlib/NumberTheory/NumberField/Completion/FinitePlace.lean index a9df5a2c6bf8e4..7cc158a81861d2 100644 --- a/Mathlib/NumberTheory/NumberField/Completion/FinitePlace.lean +++ b/Mathlib/NumberTheory/NumberField/Completion/FinitePlace.lean @@ -236,6 +236,7 @@ end HeightOneSpectrum open HeightOneSpectrum Valuation.IsRankOneDiscrete +set_option backward.isDefEq.respectTransparency.types false in /-- The norm of an element in the `v`-adic completion of `K`. See `FinitePlace.norm_embedding` for the equality involving `‖embedding v x‖` on the LHS. -/ theorem FinitePlace.norm_def (x : v.adicCompletion K) : diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean index 53274992995071..078e6c4925f112 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean @@ -229,6 +229,7 @@ theorem integralPowerBasisOfPrimePow_dim [hcycl : IsCyclotomicExtension {p ^ k} simp [integralPowerBasisOfPrimePow, ← cyclotomic_eq_minpoly hζ (NeZero.pos _), natDegree_cyclotomic] +set_option backward.isDefEq.respectTransparency.types false in /-- The integral `PowerBasis` of `𝓞 K` given by `ζ - 1`, where `K` is a `p ^ k` cyclotomic extension of `ℚ`. -/ noncomputable def subOneIntegralPowerBasisOfPrimePow [IsCyclotomicExtension {p ^ k} ℚ K] @@ -239,6 +240,7 @@ noncomputable def subOneIntegralPowerBasisOfPrimePow [IsCyclotomicExtension {p ^ convert! Subalgebra.add_mem _ (self_mem_adjoin_singleton ℤ _) (Subalgebra.one_mem _) simp [RingOfIntegers.ext_iff, integralPowerBasisOfPrimePow_gen, toInteger]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem subOneIntegralPowerBasisOfPrimePow_gen [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ (p ^ k)) : @@ -246,6 +248,7 @@ theorem subOneIntegralPowerBasisOfPrimePow_gen [IsCyclotomicExtension {p ^ k} ⟨ζ - 1, Subalgebra.sub_mem _ (hζ.isIntegral (NeZero.pos _)) (Subalgebra.one_mem _)⟩ := by simp [subOneIntegralPowerBasisOfPrimePow] +set_option backward.isDefEq.respectTransparency.types false in /-- `ζ - 1` is prime if `p ≠ 2` and `ζ` is a primitive `p ^ (k + 1)`-th root of unity. See `zeta_sub_one_prime` for a general statement. -/ theorem zeta_sub_one_prime_of_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] @@ -264,6 +267,7 @@ theorem zeta_sub_one_prime_of_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] simp only [algebraMap_int_eq, map_natCast] exact hζ.norm_sub_one_of_prime_ne_two (Polynomial.cyclotomic.irreducible_rat (NeZero.pos _)) hodd +set_option backward.isDefEq.respectTransparency.types false in /-- `ζ - 1` is prime if `ζ` is a primitive `2 ^ (k + 1)`-th root of unity. See `zeta_sub_one_prime` for a general statement. -/ theorem zeta_sub_one_prime_of_two_pow [IsCyclotomicExtension {2 ^ (k + 1)} ℚ K] @@ -309,6 +313,7 @@ theorem subOneIntegralPowerBasisOfPrimePow_gen_prime [IsCyclotomicExtension {p ^ Prime hζ.subOneIntegralPowerBasisOfPrimePow.gen := by simpa only [subOneIntegralPowerBasisOfPrimePow_gen] using! hζ.zeta_sub_one_prime +set_option backward.isDefEq.respectTransparency.types false in /-- The norm, relative to `ℤ`, of `ζ - 1` in an `n`-th cyclotomic extension of `ℚ` where `n` is not a power of a prime number is `1`. @@ -324,6 +329,7 @@ theorem norm_toInteger_sub_one_eq_one {n : ℕ} [IsCyclotomicExtension {n} ℚ K sub_one_norm_eq_eval_cyclotomic hζ h₁ (cyclotomic.irreducible_rat (NeZero.pos _)), eval_one_cyclotomic_not_prime_pow h₂, Int.cast_one] +set_option backward.isDefEq.respectTransparency.types false in /-- The norm, relative to `ℤ`, of `ζ ^ p ^ s - 1` in a `p ^ (k + 1)`-th cyclotomic extension of `ℚ` is `p ^ p ^ s` if `s ≤ k` and `p ^ (k - s + 1) ≠ 2`. -/ lemma norm_toInteger_pow_sub_one_of_prime_pow_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] @@ -333,6 +339,7 @@ lemma norm_toInteger_pow_sub_one_of_prime_pow_ne_two [IsCyclotomicExtension {p ^ rw [Algebra.norm_eq_iff ℤ (Sₘ := K) (Rₘ := ℚ) le_rfl] simp [hζ.norm_pow_sub_one_of_prime_pow_ne_two (cyclotomic.irreducible_rat (NeZero.pos _)) hs htwo] +set_option backward.isDefEq.respectTransparency.types false in /-- The norm, relative to `ℤ`, of `ζ ^ 2 ^ k - 1` in a `2 ^ (k + 1)`-th cyclotomic extension of `ℚ` is `(-2) ^ 2 ^ k`. -/ lemma norm_toInteger_pow_sub_one_of_two [IsCyclotomicExtension {2 ^ (k + 1)} ℚ K] @@ -351,6 +358,7 @@ lemma norm_toInteger_pow_sub_one_of_prime_ne_two [IsCyclotomicExtension {p ^ (k apply eq_of_prime_pow_eq hp.out.prime Nat.prime_two.prime (k - s).succ_pos rwa [pow_one] +set_option backward.isDefEq.respectTransparency.types false in /-- The norm, relative to `ℤ`, of `ζ - 1` in a `2 ^ (k + 2)`-th cyclotomic extension of `ℚ` is `2`. -/ @@ -533,6 +541,7 @@ lemma toInteger_sub_one_not_dvd_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] · rw [hζ.norm_toInteger_sub_one_of_prime_ne_two hodd] exact Nat.prime_iff_prime_int.1 hp.1 +set_option backward.isDefEq.respectTransparency.types false in open IntermediateField in /-- Let `ζ` be a primitive root of unity of order `n` with `2 ≤ n`. Any prime number that divides the @@ -791,6 +800,7 @@ theorem adjoin_singleton_eq_top [hK : IsCyclotomicExtension {n} ℚ K] exact isCyclotomicExtension_eq {n₁ * n₂} ℚ K _ _ exact adjoin_singleton_eq_top_aux K ℚ⟮ζ ^ n₂⟯ ℚ⟮ζ ^ n₁⟯ hζ₁ hK₁ hζ₂ hK₂ h h_top hζ +set_option backward.isDefEq.respectTransparency.types false in open Algebra in theorem isIntegralClosure_adjoin_singleton {ζ : K} [hcycl : IsCyclotomicExtension {n} ℚ K] (hζ : IsPrimitiveRoot ζ n) : @@ -861,6 +871,7 @@ theorem integralPowerBasis_dim [IsCyclotomicExtension {n} ℚ K] (hζ : IsPrimit hζ.integralPowerBasis.dim = φ n := by simp [integralPowerBasis, ← cyclotomic_eq_minpoly hζ (NeZero.pos _), natDegree_cyclotomic] +set_option backward.isDefEq.respectTransparency.types false in /-- The integral `PowerBasis` of `𝓞 K` given by `ζ - 1`, where `K` is a cyclotomic extension of `ℚ`. -/ noncomputable def subOneIntegralPowerBasis [IsCyclotomicExtension {n} ℚ K] @@ -871,6 +882,7 @@ noncomputable def subOneIntegralPowerBasis [IsCyclotomicExtension {n} ℚ K] convert! Subalgebra.add_mem _ (self_mem_adjoin_singleton ℤ _) (Subalgebra.one_mem _) simp [RingOfIntegers.ext_iff, integralPowerBasis_gen, toInteger]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem subOneIntegralPowerBasis_gen [IsCyclotomicExtension {n} ℚ K] (hζ : IsPrimitiveRoot ζ n) : diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean index 6a23ec72c2d291..0b89927350fc2f 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Ideal.lean @@ -235,6 +235,7 @@ open NumberField.Ideal Polynomial variable {m} [NeZero m] [hK : IsCyclotomicExtension {m} ℚ K] +set_option backward.isDefEq.respectTransparency.types false in theorem inertiaDeg_eq_of_not_dvd (hm : ¬ p ∣ m) : inertiaDeg 𝒑 P = orderOf (p : ZMod m) := by replace hm : p.Coprime m := hp.out.coprime_iff_not_dvd.mpr hm diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean index c352aef3079703..262bf273fd9c3e 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Three.lean @@ -77,19 +77,22 @@ theorem Units.mem [NumberField K] [IsCyclotomicExtension {3} ℚ K] : · right; ext; exact h fin_cases hr <;> rcases hru with h | h <;> simp [h] +set_option backward.isDefEq.respectTransparency.types false in /-- We have that `λ ^ 2 = -3 * η`. -/ private lemma lambda_sq : λ ^ 2 = -3 * η := by ext calc (λ ^ 2 : K) = η ^ 2 + η + 1 - 3 * η := by - simp only [RingOfIntegers.map_mk, IsUnit.unit_spec]; ring + simp only [IsUnit.unit_spec]; ring _ = 0 - 3 * η := by simpa using hζ.isRoot_cyclotomic (by decide) _ = -3 * η := by ring +set_option backward.isDefEq.respectTransparency.types false in /-- We have that `η ^ 2 = -η - 1`. -/ lemma eta_sq : (η ^ 2 : 𝓞 K) = -η - 1 := by rw [← neg_add', ← add_eq_zero_iff_eq_neg, ← add_assoc] ext; simpa using hζ.isRoot_cyclotomic (by decide) +set_option backward.isDefEq.respectTransparency.types false in /-- If a unit `u` is congruent to an integer modulo `λ ^ 2`, then `u = 1` or `u = -1`. This is a special case of the so-called *Kummer's lemma*. -/ diff --git a/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean b/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean index ea87dce51ac262..d03e7118d65270 100644 --- a/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean +++ b/Mathlib/NumberTheory/NumberField/Discriminant/Different.lean @@ -40,6 +40,10 @@ variable [Module.Finite ℤ 𝒪] open nonZeroDivisors IntermediateField Module +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Matrix + lemma absNorm_differentIdeal : (differentIdeal ℤ 𝒪).absNorm = (discr K).natAbs := by refine (differentIdeal ℤ 𝒪).toAddSubgroup.relIndex_top_right.symm.trans ?_ rw [← Submodule.comap_map_eq_of_injective (f := Algebra.linearMap 𝒪 K) diff --git a/Mathlib/NumberTheory/NumberField/House.lean b/Mathlib/NumberTheory/NumberField/House.lean index 403ac21e762d0f..a83047202b7a7a 100644 --- a/Mathlib/NumberTheory/NumberField/House.lean +++ b/Mathlib/NumberTheory/NumberField/House.lean @@ -84,6 +84,7 @@ lemma norm_embedding_le_house (α : K) (σ : K →+* ℂ) : ‖σ α‖ ≤ hous rw [house_eq_sup'] exact Finset.le_sup' (f := (‖· α‖₊)) (Finset.mem_univ σ) +set_option backward.isDefEq.respectTransparency.types false in lemma one_le_house_of_isIntegral {α : K} (hα : IsIntegral ℤ α) (hα0 : α ≠ 0) : 1 ≤ house α := by have ⟨σ, hσ⟩ : ∃ σ : K →+* ℂ, 1 ≤ ‖σ α‖ := by diff --git a/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean b/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean index aa4c253c42aaef..a2fa40329e2486 100644 --- a/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean +++ b/Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean @@ -183,6 +183,7 @@ theorem primesOverSpanEquivMonicFactorsMod_symm_apply (hp : ¬ p ∣ exponent θ rw [← primesOverSpanEquivMonicFactorsModAux_symm_apply] exact ((primesOverSpanEquivMonicFactorsModAux _).symm ⟨Q, hQ⟩).prop⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The ideal corresponding to the class of `Q ∈ ℤ[X]` modulo `p` via `NumberField.Ideal.primesOverSpanEquivMonicFactorsMod` is spanned by `p` and `Q(θ)`. diff --git a/Mathlib/NumberTheory/NumberField/InfiniteAdeleRing.lean b/Mathlib/NumberTheory/NumberField/InfiniteAdeleRing.lean index 1813f5a678c2f4..51cdaee769ab12 100644 --- a/Mathlib/NumberTheory/NumberField/InfiniteAdeleRing.lean +++ b/Mathlib/NumberTheory/NumberField/InfiniteAdeleRing.lean @@ -48,7 +48,12 @@ infinite places. See `NumberField.InfinitePlace` for the definition of an infini `NumberField.InfinitePlace.Completion` for the associated completion. -/ +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + InfinitePlace + /-- The infinite adele ring of a number field. -/ +@[local implicit_reducible] def InfiniteAdeleRing (K : Type*) [Field K] := (v : InfinitePlace K) → v.Completion deriving CommRing, Inhabited, TopologicalSpace, IsTopologicalRing, Algebra K diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean index 8a5ba37de10e61..a7b266c21842fb 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean @@ -327,6 +327,7 @@ theorem sum_mult_eq [NumberField K] : exact Finset.sum_congr rfl (fun _ _ => by rw [Finset.sum_const, smul_eq_mul, mul_one, card_filter_mk_eq]) +set_option backward.isDefEq.respectTransparency.types false in /-- The map from real embeddings to real infinite places as an equiv -/ noncomputable def mkReal : { φ : K →+* ℂ // ComplexEmbedding.IsReal φ } ≃ { w : InfinitePlace K // IsReal w } := by @@ -438,6 +439,7 @@ theorem card_eq_nrRealPlaces_add_nrComplexPlaces : (disjoint_isReal_isComplex K) using 1 exact (Fintype.card_of_subtype _ (fun w ↦ ⟨fun _ ↦ isReal_or_isComplex w, fun _ ↦ by simp⟩)).symm +set_option backward.isDefEq.respectTransparency.types false in open scoped Classical in theorem card_complex_embeddings : card { φ : K →+* ℂ // ¬ComplexEmbedding.IsReal φ } = 2 * nrComplexPlaces K := by @@ -558,16 +560,19 @@ namespace NumberField.InfinitePlace variable {K : Type*} [Field K] {v w : InfinitePlace K} +set_option backward.isDefEq.respectTransparency.types false in @[simp] protected theorem map_ratCast (v : InfinitePlace K) (x : ℚ) : v x = ‖x‖ := by rcases v with ⟨_, _⟩ aesop (add simp [coe_apply]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] protected theorem map_natCast (v : InfinitePlace K) (n : ℕ) : v n = n := by rcases v with ⟨_, _⟩ aesop (add simp [coe_apply]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] protected theorem map_intCast (v : InfinitePlace K) (z : ℤ) : v z = ‖z‖ := by rcases v with ⟨_, _⟩ diff --git a/Mathlib/NumberTheory/NumberField/Norm.lean b/Mathlib/NumberTheory/NumberField/Norm.lean index 5b6a741f521008..c08c2a415dd424 100644 --- a/Mathlib/NumberTheory/NumberField/Norm.lean +++ b/Mathlib/NumberTheory/NumberField/Norm.lean @@ -69,6 +69,7 @@ theorem norm_algebraMap (x : 𝓞 K) : norm K (algebraMap (𝓞 K) (𝓞 L) x) = RingOfIntegers.algebraMap_norm_algebraMap, Algebra.norm_algebraMap, RingOfIntegers.coe_eq_algebraMap, map_pow] +set_option backward.isDefEq.respectTransparency.types false in /-- If `L/K` is a finite Galois extension of fields, then, for all `(x : 𝓞 L)` we have that `x ∣ algebraMap (𝓞 K) (𝓞 L) (norm K x)`. -/ theorem dvd_norm [FiniteDimensional K L] [IsGalois K L] (x : 𝓞 L) : diff --git a/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean b/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean index 6ab0a6f37e2f00..02db03e0b8d2c7 100644 --- a/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean +++ b/Mathlib/NumberTheory/NumberField/Units/DirichletTheorem.lean @@ -138,6 +138,7 @@ theorem logEmbedding_component_le {r : ℝ} {x : (𝓞 K)ˣ} (hr : 0 ≤ r) (h : simp_rw [Pi.norm_def, NNReal.coe_le_coe, Finset.sup_le_iff, ← NNReal.coe_le_coe] at h exact h w (mem_univ _) +set_option backward.isDefEq.respectTransparency.types false in open scoped Classical in theorem log_le_of_logEmbedding_le {r : ℝ} {x : (𝓞 K)ˣ} (hr : 0 ≤ r) (h : ‖logEmbedding K (Additive.ofMul x)‖ ≤ r) (w : InfinitePlace K) : @@ -311,6 +312,7 @@ theorem exists_unit (w₁ : InfinitePlace K) : rw [Set.mem_setOf_eq, Ideal.absNorm_span_singleton] exact seq_norm_le K w₁ hB n +set_option backward.isDefEq.respectTransparency.types false in theorem unitLattice_span_eq_top : Submodule.span ℝ (unitLattice K : Set (logSpace K)) = ⊤ := by classical @@ -406,6 +408,7 @@ theorem logEmbeddingQuot_injective : Function.comp_apply, EmbeddingLike.apply_eq_iff_eq] at h exact (EmbeddingLike.apply_eq_iff_eq _).mp <| (QuotientGroup.kerLift_injective _).eq_iff.mp h +set_option backward.isDefEq.respectTransparency.types false in /-- The linear equivalence between `(𝓞 K)ˣ ⧸ (torsion K)` as an additive `ℤ`-module and `unitLattice` . -/ def logEmbeddingEquiv : diff --git a/Mathlib/NumberTheory/Padics/HeightOneSpectrum.lean b/Mathlib/NumberTheory/Padics/HeightOneSpectrum.lean index 3423a432f69de3..f0f812b7ecffa0 100644 --- a/Mathlib/NumberTheory/Padics/HeightOneSpectrum.lean +++ b/Mathlib/NumberTheory/Padics/HeightOneSpectrum.lean @@ -55,6 +55,45 @@ equivalent. It is best to do this after `Valued` has been refactored, or at leas open IsDedekindDomain UniformSpace.Completion NumberField PadicInt +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Classical.choose + Classical.indefiniteDescription + HeightOneSpectrum.intValuation + HeightOneSpectrum.valuation + IsUnit.liftRight + MonoidHom.mk' + MonoidHom.restrict + MonoidHomClass.toMonoidHom + MonoidWithZeroHom.ValueGroup₀.embedding + MonoidWithZeroHom.comp + MonoidWithZeroHom.valueGroup + MonoidWithZeroHom.valueMonoid + MonoidWithZeroHomClass.toMonoidWithZeroHom + MulEquiv.symm + MulHomClass.toMulHom + Nat.Primes + PadicInt + RingEquiv.symm + RingHomClass.toRingHom + Set + Subgroup.closure + Subgroup.subtype + Submonoid.LocalizationMap.lift + Submonoid.LocalizationMap.sec + Submonoid.copy + SubmonoidClass.subtype + UniformEquiv.symm + Units.liftRight + Units.map + WithVal.congr + WithVal.equiv + WithVal.valuation + WithZero.coeMonoidHom + WithZero.lift' + WithZero.map' + WithZero.withZeroUnitsEquiv + local instance (p : Nat.Primes) : Fact p.1.Prime := ⟨p.2⟩ variable (R : Type*) [CommRing R] [Algebra R ℚ] @@ -126,6 +165,7 @@ noncomputable def primesEquiv : HeightOneSpectrum R ≃ Nat.Primes where simp [Ideal.map_comap_of_surjective _ (IsIntegralClosure.intEquiv R).surjective, Int.associated_iff_natAbs.1 (Submodule.IsPrincipal.associated_generator_span_self _)] +set_option backward.isDefEq.respectTransparency.types false in theorem valuation_equiv_padicValuation (v : HeightOneSpectrum R) : (v.valuation ℚ).IsEquiv (padicValuation (primesEquiv v)) := by simp [primesEquiv, Valuation.isEquiv_iff_val_le_one, valuation_le_one_iff_den, @@ -138,6 +178,7 @@ open Valuation `HeightOneSpectrum.valuation ℚ v` and the RHS has uniformity from `Rat.padicValuation (natGenerator v)`, for a height-one prime ideal `v : HeightOneSpectrum R`. -/ +@[local implicit_reducible] noncomputable def withValEquiv (v : HeightOneSpectrum R) : WithVal (v.valuation ℚ) ≃ᵤ WithVal (padicValuation (primesEquiv v)) := (valuation_equiv_padicValuation v).uniformEquiv @@ -228,6 +269,7 @@ noncomputable def adicCompletionIntegersEquiv (p : Nat.Primes) : apply (ContinuousAlgEquiv.cast (primesEquiv.apply_symm_apply p).symm).trans (adicCompletionIntegers.padicIntEquiv (primesEquiv.symm p)).symm +set_option backward.isDefEq.respectTransparency.types false in /-- The diagram ``` ℤ_[p] --------> (primesEquiv.symm p).adicCompletionIntegers ℚ @@ -247,6 +289,7 @@ theorem coe_adicCompletionIntegersEquiv_apply (p : Nat.Primes) (x : ℤ_[p]) : (by rw [primesEquiv.apply_symm_apply])] exact cast_heq _ _ +set_option backward.isDefEq.respectTransparency.types false in /-- The diagram ``` ℤ_[p] <-------- (primesEquiv.symm p).adicCompletionIntegers ℚ diff --git a/Mathlib/NumberTheory/Padics/Hensel.lean b/Mathlib/NumberTheory/Padics/Hensel.lean index 98571de58969ce..0a6b802aea7b67 100644 --- a/Mathlib/NumberTheory/Padics/Hensel.lean +++ b/Mathlib/NumberTheory/Padics/Hensel.lean @@ -208,6 +208,7 @@ private theorem calc_deriv_dist {z z' z1 : ℤ_[p]} (hz' : z' = z - z1) (T_pow' hnorm _) +set_option backward.isDefEq.respectTransparency false in private def calc_eval_z' {z z' z1 : ℤ_[p]} (hz' : z' = z - z1) {n} (hz : ih n z) (h1 : ‖(↑(F.aeval z) : ℚ_[p]) / ↑(F.derivative.aeval z)‖ ≤ 1) (hzeq : z1 = ⟨_, h1⟩) : { q : ℤ_[p] // F.aeval z' = q * z1 ^ 2 } := by @@ -279,6 +280,7 @@ private theorem newton_seq_norm_le (n : ℕ) : ‖F.aeval (newton_seq n)‖ ≤ ‖F.derivative.aeval a‖ ^ 2 * T ^ 2 ^ n := (newton_seq_aux hnorm n).2.2 +set_option backward.isDefEq.respectTransparency false in private theorem newton_seq_norm_eq (n : ℕ) : ‖newton_seq (n + 1) - newton_seq n‖ = ‖F.aeval (newton_seq n)‖ / ‖F.derivative.aeval (newton_seq n)‖ := by @@ -399,6 +401,7 @@ private theorem newton_seq_succ_dist_weak (n : ℕ) : apply mul_div_mul_left apply deriv_norm_ne_zero; assumption +set_option backward.isDefEq.respectTransparency false in private theorem newton_seq_dist_to_a : ∀ n : ℕ, 0 < n → ‖newton_seq n - a‖ = ‖F.aeval a‖ / ‖F.derivative.aeval a‖ | 1, _h => by simp [sub_eq_add_neg, add_assoc, newton_seq_gen, newton_seq_aux, ih_n] diff --git a/Mathlib/NumberTheory/Padics/MahlerBasis.lean b/Mathlib/NumberTheory/Padics/MahlerBasis.lean index 6761863dcfab02..e993aea0275587 100644 --- a/Mathlib/NumberTheory/Padics/MahlerBasis.lean +++ b/Mathlib/NumberTheory/Padics/MahlerBasis.lean @@ -348,6 +348,7 @@ lemma hasSum_mahler (f : C(ℤ_[p], E)) : HasSum (fun n ↦ mahlerTerm (Δ_[1]^[ simpa [mahlerSeries_apply_nat (fwdDiff_tendsto_zero f) le_rfl] using shift_eq_sum_fwdDiff_iter 1 f n 0 +set_option backward.isDefEq.respectTransparency false in variable (E) in /-- The isometric equivalence from `C(ℤ_[p], E)` to the space of sequences in `E` tending to `0` given diff --git a/Mathlib/NumberTheory/Padics/PadicIntegers.lean b/Mathlib/NumberTheory/Padics/PadicIntegers.lean index e2c1898445b28f..d4a8e052267511 100644 --- a/Mathlib/NumberTheory/Padics/PadicIntegers.lean +++ b/Mathlib/NumberTheory/Padics/PadicIntegers.lean @@ -132,8 +132,10 @@ def Coe.ringHom : ℤ_[p] →+* ℚ_[p] := (subring p).subtype @[simp, norm_cast] theorem coe_pow (x : ℤ_[p]) (n : ℕ) : (↑(x ^ n) : ℚ_[p]) = (↑x : ℚ_[p]) ^ n := rfl +set_option backward.isDefEq.respectTransparency false in theorem mk_coe (k : ℤ_[p]) : (⟨k, k.2⟩ : ℤ_[p]) = k := by simp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma coe_sum {α : Type*} (s : Finset α) (f : α → ℤ_[p]) : (((∑ z ∈ s, f z) : ℤ_[p]) : ℚ_[p]) = ∑ z ∈ s, (f z : ℚ_[p]) := by @@ -158,6 +160,7 @@ instance : CharZero ℤ_[p] where @[norm_cast] theorem intCast_eq (z1 z2 : ℤ) : (z1 : ℤ_[p]) = z2 ↔ z1 = z2 := by simp +set_option backward.isDefEq.respectTransparency false in /-- A sequence of integers that is Cauchy with respect to the `p`-adic norm converges to a `p`-adic integer. -/ def ofIntSeq (seq : ℕ → ℤ) (h : IsCauSeq (padicNorm p) fun n => seq n) : ℤ_[p] := @@ -351,6 +354,7 @@ section Units /-! ### Units of `ℤ_[p]` -/ +set_option backward.isDefEq.respectTransparency false in theorem mul_inv : ∀ {z : ℤ_[p]}, ‖z‖ = 1 → z * z.inv = 1 | ⟨k, _⟩, h => by have hk : k ≠ 0 := fun h' => zero_ne_one' ℚ_[p] (by simp [h'] at h) @@ -561,6 +565,7 @@ instance algebra : Algebra ℤ_[p] ℚ_[p] := theorem algebraMap_apply (x : ℤ_[p]) : algebraMap ℤ_[p] ℚ_[p] x = x := rfl +set_option backward.isDefEq.respectTransparency false in instance isFractionRing : IsFractionRing ℤ_[p] ℚ_[p] where map_units := fun ⟨x, hx⟩ => by rwa [algebraMap_apply, isUnit_iff_ne_zero, PadicInt.coe_ne_zero, ← diff --git a/Mathlib/NumberTheory/Padics/RingHoms.lean b/Mathlib/NumberTheory/Padics/RingHoms.lean index 7c697875793946..1e1c7ed159d34d 100644 --- a/Mathlib/NumberTheory/Padics/RingHoms.lean +++ b/Mathlib/NumberTheory/Padics/RingHoms.lean @@ -99,6 +99,7 @@ theorem norm_sub_modPart_aux (r : ℚ) (h : ‖(r : ℚ_[p])‖ ≤ 1) : rw [← isUnit_iff] exact isUnit_den r h +set_option backward.isDefEq.respectTransparency false in theorem norm_sub_modPart (h : ‖(r : ℚ_[p])‖ ≤ 1) : ‖(⟨r, h⟩ - modPart p r : ℤ_[p])‖ < 1 := by let n := modPart p r rw [norm_lt_one_iff_dvd, ← (isUnit_den r h).dvd_mul_right] @@ -143,6 +144,7 @@ theorem zmod_congr_of_sub_mem_max_ideal (x : ℤ_[p]) (m n : ℕ) (hm : x - m variable (x : ℤ_[p]) +set_option backward.isDefEq.respectTransparency.types false in theorem exists_mem_range : ∃ n : ℕ, n < p ∧ x - n ∈ maximalIdeal ℤ_[p] := by simp only [maximalIdeal_eq_span_p, Ideal.mem_span_singleton, ← norm_lt_one_iff_dvd] obtain ⟨r, hr⟩ := rat_dense p (x : ℚ_[p]) zero_lt_one @@ -574,6 +576,7 @@ The `n`th value of the sequence is `((f n r).val : ℚ)`. def nthHomSeq (r : R) : PadicSeq p := ⟨fun n => nthHom f r n, isCauSeq_nthHom f_compat r⟩ +set_option backward.isDefEq.respectTransparency false in -- this lemma ran into issues after changing to `NeZero` and I'm not sure why. theorem nthHomSeq_one : nthHomSeq f_compat 1 ≈ 1 := by intro ε hε @@ -584,6 +587,7 @@ theorem nthHomSeq_one : nthHomSeq f_compat 1 ≈ 1 := by suffices (ZMod.cast (1 : ZMod (p ^ j)) : ℚ) = 1 by simp [nthHomSeq, nthHom, this, hε] rw [ZMod.cast_eq_val, ZMod.val_one, Nat.cast_one] +set_option backward.isDefEq.respectTransparency false in theorem nthHomSeq_add (r s : R) : nthHomSeq f_compat (r + s) ≈ nthHomSeq f_compat r + nthHomSeq f_compat s := by intro ε hε @@ -599,6 +603,7 @@ theorem nthHomSeq_add (r s : R) : rw [ZMod.cast_add (show p ^ n ∣ p ^ j from pow_dvd_pow _ hj)] simp only [sub_self] +set_option backward.isDefEq.respectTransparency false in theorem nthHomSeq_mul (r s : R) : nthHomSeq f_compat (r * s) ≈ nthHomSeq f_compat r * nthHomSeq f_compat s := by intro ε hε diff --git a/Mathlib/NumberTheory/Padics/WithVal.lean b/Mathlib/NumberTheory/Padics/WithVal.lean index ca5674928bc063..1aed46d73cdb6f 100644 --- a/Mathlib/NumberTheory/Padics/WithVal.lean +++ b/Mathlib/NumberTheory/Padics/WithVal.lean @@ -35,6 +35,7 @@ variable {p : ℕ} [Fact p.Prime] open NNReal WithZero UniformSpace +set_option backward.isDefEq.respectTransparency.types false in open MonoidWithZeroHom.ValueGroup₀ in lemma isUniformInducing_cast_withVal : IsUniformInducing ((Rat.castHom ℚ_[p]).comp (WithVal.equiv (Rat.padicValuation p)).toRingHom) := by diff --git a/Mathlib/NumberTheory/RamificationInertia/Basic.lean b/Mathlib/NumberTheory/RamificationInertia/Basic.lean index 7a88c4a6d1dee8..672acf453f6c44 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Basic.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Basic.lean @@ -363,6 +363,7 @@ theorem quotientToQuotientRangePowQuotSucc_mk {i : ℕ} {a : S} (a_mem : a ∈ P Submodule.Quotient.mk ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩ := quotientToQuotientRangePowQuotSuccAux_mk p P a_mem x +set_option backward.isDefEq.respectTransparency.types false in theorem quotientToQuotientRangePowQuotSucc_injective [IsDedekindDomain S] [P.IsPrime] {i : ℕ} (hi : i < e) {a : S} (a_mem : a ∈ P ^ i) (a_notMem : a ∉ P ^ (i + 1)) : Function.Injective (quotientToQuotientRangePowQuotSucc p P a_mem) := fun x => diff --git a/Mathlib/NumberTheory/RamificationInertia/Ramification.lean b/Mathlib/NumberTheory/RamificationInertia/Ramification.lean index 7013facf35c31a..ca3eabfffdcfc8 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Ramification.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Ramification.lean @@ -68,6 +68,7 @@ noncomputable def ramificationIdx : ℕ := sSup {n | map f p ≤ P ^ n} variable {p P} +set_option backward.isDefEq.respectTransparency.types false in theorem ramificationIdx_eq_find [DecidablePred fun n ↦ ∀ (k : ℕ), map f p ≤ P ^ k → k ≤ n] (h : ∃ n, ∀ k, map f p ≤ P ^ k → k ≤ n) : ramificationIdx p P = Nat.find h := by @@ -256,6 +257,7 @@ theorem ramificationIdx_ne_zero_of_liesOver [IsDomain R] [IsTorsionFree R S] IsDedekindDomain.ramificationIdx_ne_zero (map_ne_bot_of_ne_bot hp) hP <| map_le_iff_le_comap.mpr <| le_of_eq <| (liesOver_iff _ _).mp hPp +set_option backward.isDefEq.respectTransparency.types false in open IsLocalRing in lemma ramificationIdx_eq_one_iff {p : Ideal R} {P : Ideal S} [P.IsPrime] diff --git a/Mathlib/NumberTheory/SmoothNumbers.lean b/Mathlib/NumberTheory/SmoothNumbers.lean index 68e8e8966278fd..94de05799e8ea3 100644 --- a/Mathlib/NumberTheory/SmoothNumbers.lean +++ b/Mathlib/NumberTheory/SmoothNumbers.lean @@ -189,6 +189,7 @@ lemma factoredNumbers.map_prime_pow_mul {F : Type*} [Mul F] {f : ℕ → F} f (p ^ e * m) = f (p ^ e) * f m := hmul <| Coprime.pow_left _ <| hp.factoredNumbers_coprime hs <| Subtype.mem m +set_option backward.isDefEq.respectTransparency false in open List Perm in /-- We establish the bijection from `ℕ × factoredNumbers s` to `factoredNumbers (s ∪ {p})` given by `(e, n) ↦ p^e * n` when `p ∉ s` is a prime. See `Nat.factoredNumbers_insert` for diff --git a/Mathlib/NumberTheory/TsumDivisorsAntidiagonal.lean b/Mathlib/NumberTheory/TsumDivisorsAntidiagonal.lean index dd5fa835b1b52d..9223bc16237832 100644 --- a/Mathlib/NumberTheory/TsumDivisorsAntidiagonal.lean +++ b/Mathlib/NumberTheory/TsumDivisorsAntidiagonal.lean @@ -43,6 +43,7 @@ lemma divisorsAntidiagonalFactors_one (x : Nat.divisorsAntidiagonal 1) : simp only [mul_eq_one, ne_eq, one_ne_zero, not_false_eq_true, and_true] at h simp [divisorsAntidiagonalFactors, h.1, h.2] +set_option backward.isDefEq.respectTransparency false in /-- The equivalence from the union over `n` of `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` to `(a, b)`. -/ def sigmaAntidiagonalEquivProd : (Σ n : ℕ+, Nat.divisorsAntidiagonal n) ≃ ℕ+ × ℕ+ where diff --git a/Mathlib/NumberTheory/WellApproximable.lean b/Mathlib/NumberTheory/WellApproximable.lean index 51f2d6e1ac8f88..611934b157504d 100644 --- a/Mathlib/NumberTheory/WellApproximable.lean +++ b/Mathlib/NumberTheory/WellApproximable.lean @@ -187,6 +187,7 @@ local notation a "∣∣" b => a ∣ b ∧ (a * a)∤b local notation "𝕊" => AddCircle T +set_option backward.isDefEq.respectTransparency.types false in /-- **Gallagher's ergodic theorem** on Diophantine approximation. -/ theorem addWellApproximable_ae_empty_or_univ (δ : ℕ → ℝ) (hδ : Tendsto δ atTop (𝓝 0)) : (∀ᵐ x, ¬addWellApproximable 𝕊 δ x) ∨ ∀ᵐ x, addWellApproximable 𝕊 δ x := by diff --git a/Mathlib/Order/Antisymmetrization.lean b/Mathlib/Order/Antisymmetrization.lean index b978a8279572cb..d2cb28765f230b 100644 --- a/Mathlib/Order/Antisymmetrization.lean +++ b/Mathlib/Order/Antisymmetrization.lean @@ -121,7 +121,7 @@ section IsPreorder variable (α) (r : α → α → Prop) [IsPreorder α r] /-- The antisymmetrization relation as an equivalence relation. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def AntisymmRel.setoid : Setoid α := ⟨AntisymmRel r, .refl r, .symm, .trans⟩ @@ -304,6 +304,7 @@ instance [WellFoundedLT α] : WellFoundedLT (Antisymmetrization α (· ≤ ·)) instance [WellFoundedGT α] : WellFoundedGT (Antisymmetrization α (· ≤ ·)) := wellFoundedGT_antisymmetrization_iff.mpr ‹_› +set_option backward.isDefEq.respectTransparency false in instance [DecidableLE α] [DecidableLT α] [@Std.Total α (· ≤ ·)] : LinearOrder (Antisymmetrization α (· ≤ ·)) := { instPartialOrderAntisymmetrization with diff --git a/Mathlib/Order/Atoms.lean b/Mathlib/Order/Atoms.lean index 2eaea790ae9e8e..4e792ff9905e18 100644 --- a/Mathlib/Order/Atoms.lean +++ b/Mathlib/Order/Atoms.lean @@ -700,6 +700,7 @@ lemma eq_setOf_le_sSup_and_isAtom {α} [CompleteAtomicBooleanAlgebra α] {S : Se · simpa using hatom.1 assumption +set_option backward.isDefEq.respectTransparency false in /-- Representation theorem for complete atomic boolean algebras: For a complete atomic Boolean algebra `α`, `toSetOfIsAtom` is an order isomorphism @@ -758,7 +759,7 @@ instance OrderDual.instIsSimpleOrder {α} [LE α] [BoundedOrder α] [IsSimpleOrd IsSimpleOrder αᵒᵈ := isSimpleOrder_iff_isSimpleOrder_orderDual.1 (by infer_instance) /-- A simple `BoundedOrder` induces a preorder. This is not an instance to prevent loops. -/ -@[implicit_reducible] +@[instance_reducible] protected def IsSimpleOrder.preorder {α} [LE α] [BoundedOrder α] [IsSimpleOrder α] : Preorder α where le_refl a := by rcases eq_bot_or_eq_top a with (rfl | rfl) <;> simp @@ -771,7 +772,7 @@ protected def IsSimpleOrder.preorder {α} [LE α] [BoundedOrder α] [IsSimpleOrd /-- A simple partial ordered `BoundedOrder` induces a linear order. This is not an instance to prevent loops. -/ -@[implicit_reducible] +@[instance_reducible] protected def IsSimpleOrder.linearOrder [DecidableEq α] : LinearOrder α := { (inferInstance : PartialOrder α) with le_total := fun a b => by rcases eq_bot_or_eq_top a with (rfl | rfl) <;> simp @@ -828,14 +829,14 @@ variable [Lattice α] [BoundedOrder α] [IsSimpleOrder α] /-- A simple partial ordered `BoundedOrder` induces a lattice. This is not an instance to prevent loops -/ -@[implicit_reducible] +@[instance_reducible] protected def lattice {α} [DecidableEq α] [PartialOrder α] [BoundedOrder α] [IsSimpleOrder α] : Lattice α := @LinearOrder.toLattice α IsSimpleOrder.linearOrder /-- A lattice that is a `BoundedOrder` is a distributive lattice. This is not an instance to prevent loops -/ -@[implicit_reducible] +@[instance_reducible] protected def distribLattice : DistribLattice α := { (inferInstance : Lattice α) with le_sup_inf := fun x y z => by rcases eq_bot_or_eq_top x with (rfl | rfl) <;> simp } @@ -874,7 +875,7 @@ def orderIsoBool : α ≃o Bool := · simp } /-- A simple `BoundedOrder` is also a `BooleanAlgebra`. -/ -@[implicit_reducible] +@[instance_reducible] protected def booleanAlgebra {α} [DecidableEq α] [Lattice α] [BoundedOrder α] [IsSimpleOrder α] : BooleanAlgebra α := { (inferInstance : BoundedOrder α), IsSimpleOrder.distribLattice with @@ -894,7 +895,7 @@ variable [Lattice α] [BoundedOrder α] [IsSimpleOrder α] open Classical in /-- A simple `BoundedOrder` is also complete. -/ -@[implicit_reducible] +@[instance_reducible] protected noncomputable def completeLattice : CompleteLattice α := { (inferInstance : Lattice α), (inferInstance : BoundedOrder α) with @@ -923,7 +924,7 @@ protected noncomputable def completeLattice : CompleteLattice α := open Classical in /-- A simple `BoundedOrder` is also a `CompleteBooleanAlgebra`. -/ -@[implicit_reducible] +@[instance_reducible] protected noncomputable def completeBooleanAlgebra : CompleteBooleanAlgebra α := { __ := IsSimpleOrder.completeLattice __ := IsSimpleOrder.booleanAlgebra } @@ -1171,6 +1172,7 @@ theorem isAtomic_iff_isCoatomic : IsAtomic α ↔ IsCoatomic α := ⟨fun _ => isCoatomic_of_isAtomic_of_complementedLattice_of_isModular, fun _ => isAtomic_of_isCoatomic_of_complementedLattice_of_isModular⟩ +set_option backward.isDefEq.respectTransparency false in /-- A complemented modular atomic lattice is strongly atomic. Not an instance to prevent loops. -/ theorem ComplementedLattice.isStronglyAtomic [IsAtomic α] : IsStronglyAtomic α where diff --git a/Mathlib/Order/Birkhoff.lean b/Mathlib/Order/Birkhoff.lean index 694621681cc97b..429d2af3ca9643 100644 --- a/Mathlib/Order/Birkhoff.lean +++ b/Mathlib/Order/Birkhoff.lean @@ -105,6 +105,7 @@ end LowerSet namespace OrderEmbedding +set_option backward.isDefEq.respectTransparency false in /-- The **Birkhoff Embedding** of a finite partial order as sup-irreducible elements in its lattice of lower sets. -/ def supIrredLowerSet : α ↪o {s : LowerSet α // SupIrred s} where @@ -112,6 +113,7 @@ def supIrredLowerSet : α ↪o {s : LowerSet α // SupIrred s} where inj' _ := by simp map_rel_iff' := by simp +set_option backward.isDefEq.respectTransparency false in /-- The **Birkhoff Embedding** of a finite partial order as inf-irreducible elements in its lattice of lower sets. -/ def infIrredUpperSet : α ↪o {s : UpperSet α // InfIrred s} where @@ -155,6 +157,7 @@ namespace OrderIso section SemilatticeSup variable [SemilatticeSup α] [OrderBot α] [Finite α] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma supIrredLowerSet_symm_apply (s : {s : LowerSet α // SupIrred s}) [Fintype s] : supIrredLowerSet.symm s = (s.1 : Set α).toFinset.sup id := by classical @@ -169,6 +172,7 @@ end SemilatticeSup section SemilatticeInf variable [SemilatticeInf α] [OrderTop α] [Finite α] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma infIrredUpperSet_symm_apply (s : {s : UpperSet α // InfIrred s}) [Fintype s] : infIrredUpperSet.symm s = (s.1 : Set α).toFinset.inf id := by classical diff --git a/Mathlib/Order/BooleanAlgebra/Defs.lean b/Mathlib/Order/BooleanAlgebra/Defs.lean index 07301aafade5a2..be7f6b1654a89b 100644 --- a/Mathlib/Order/BooleanAlgebra/Defs.lean +++ b/Mathlib/Order/BooleanAlgebra/Defs.lean @@ -161,7 +161,7 @@ a distributive lattice that is complemented is a Boolean algebra. This is not an instance, because it creates data using choice. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def booleanAlgebraOfComplemented [BoundedOrder α] [ComplementedLattice α] : BooleanAlgebra α where __ := ((inferInstance : BoundedOrder α)) diff --git a/Mathlib/Order/BooleanGenerators.lean b/Mathlib/Order/BooleanGenerators.lean index 63bd704640ce36..f9eb50e0efb6f3 100644 --- a/Mathlib/Order/BooleanGenerators.lean +++ b/Mathlib/Order/BooleanGenerators.lean @@ -139,7 +139,7 @@ lemma sSup_inter (hS : BooleanGenerators S) {T₁ T₂ : Set α} (hT₁ : T₁ · exact (_root_.le_sSup hI).trans (hX'.ge.trans inf_le_right) /-- A lattice generated by Boolean generators is a distributive lattice. -/ -@[implicit_reducible] +@[instance_reducible] def distribLattice_of_sSup_eq_top (hS : BooleanGenerators S) (h : sSup S = ⊤) : DistribLattice α where le_sup_inf a b c := by @@ -160,7 +160,7 @@ lemma complementedLattice_of_sSup_eq_top (hS : BooleanGenerators S) (h : sSup S apply complementedLattice_of_isAtomistic /-- A compactly generated complete lattice generated by Boolean generators is a Boolean algebra. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def booleanAlgebra_of_sSup_eq_top (hS : BooleanGenerators S) (h : sSup S = ⊤) : BooleanAlgebra α := let _i := hS.distribLattice_of_sSup_eq_top h diff --git a/Mathlib/Order/BooleanSubalgebra.lean b/Mathlib/Order/BooleanSubalgebra.lean index 4ff2728db07ba2..a611d6bf0071b3 100644 --- a/Mathlib/Order/BooleanSubalgebra.lean +++ b/Mathlib/Order/BooleanSubalgebra.lean @@ -19,6 +19,11 @@ open Function Set variable {ι : Sort*} {α β γ : Type*} +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + InfClosed + SupClosed + variable (α) in /-- A Boolean subalgebra of a Boolean algebra is a set containing the bottom and top elements, and closed under suprema, infima and complements. -/ diff --git a/Mathlib/Order/Bounds/Basic.lean b/Mathlib/Order/Bounds/Basic.lean index bdd91821551caa..2c077b8717be93 100644 --- a/Mathlib/Order/Bounds/Basic.lean +++ b/Mathlib/Order/Bounds/Basic.lean @@ -880,7 +880,7 @@ instance Nat.instDecidableIsLeast (p : ℕ → Prop) (n : ℕ) [DecidablePred p] simp [mem_lowerBounds, @imp_not_comm _ (p _)] /-- An alternative constructor for `SemilatticeSup` using `IsLUB`. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- An alternative constructor for `SemilatticeInf` using `IsGLB`. -/] def SemilatticeSup.ofIsLUB [PartialOrder α] (sup : α → α → α) (isLUB_pair : ∀ a b, IsLUB {a, b} (sup a b)) : @@ -891,7 +891,7 @@ def SemilatticeSup.ofIsLUB [PartialOrder α] (sup : α → α → α) sup_le a b _ hac hbc := (isLUB_pair a b).2 (forall_insert_of_forall (forall_eq.mpr hbc) hac) /-- An alternative constructor for `Lattice` using `IsLUB` and `IsGLB`. -/ -@[implicit_reducible, to_dual self (reorder := 3 4, 5 6)] +@[instance_reducible, to_dual self (reorder := 3 4, 5 6)] def Lattice.ofIsLUBofIsGLB [PartialOrder α] (sup inf : α → α → α) (isLUB_pair : ∀ a b, IsLUB {a, b} (sup a b)) (isGLB_pair : ∀ a b, IsGLB {a, b} (inf a b)) : Lattice α where diff --git a/Mathlib/Order/BourbakiWitt.lean b/Mathlib/Order/BourbakiWitt.lean index e2a00d5bc15611..8144c6ebd608ca 100644 --- a/Mathlib/Order/BourbakiWitt.lean +++ b/Mathlib/Order/BourbakiWitt.lean @@ -251,6 +251,13 @@ lemma ωScottContinuous.sup (hf : ωScottContinuous f) (hg : ωScottContinuous g apply ωScottContinuous.sSup rintro f (rfl | rfl | _) <;> assumption +/- +The statement of this lemma involves a very subtle form of abuse of definitional equality. +`monotone_const` is only applicable if `Top.top` (`⊤`) can be unfolded to see that it's constant. +However, `Top.top` is semireducible. +This mismatch is problematic because `simp` works at implicit transparency. +-/ +set_option backward.isDefEq.respectTransparency.types false in lemma ωScottContinuous.top : ωScottContinuous (⊤ : α → β) := ωScottContinuous.of_monotone_map_ωSup ⟨monotone_const, fun c ↦ eq_of_forall_ge_iff fun a ↦ by simp⟩ diff --git a/Mathlib/Order/Category/NonemptyFinLinOrd.lean b/Mathlib/Order/Category/NonemptyFinLinOrd.lean index ed2d2b2d98e1c1..0e905ab3a80ad8 100644 --- a/Mathlib/Order/Category/NonemptyFinLinOrd.lean +++ b/Mathlib/Order/Category/NonemptyFinLinOrd.lean @@ -142,6 +142,7 @@ theorem mono_iff_injective {A B : NonemptyFinLinOrd.{u}} (f : A ⟶ B) : rw [cancel_mono] at eq rw [eq] +set_option backward.isDefEq.respectTransparency.types false in theorem epi_iff_surjective {A B : NonemptyFinLinOrd.{u}} (f : A ⟶ B) : Epi f ↔ Function.Surjective f := by constructor diff --git a/Mathlib/Order/CompactlyGenerated/Intervals.lean b/Mathlib/Order/CompactlyGenerated/Intervals.lean index 8f74c0d3c20efe..bdfb6023b0d61d 100644 --- a/Mathlib/Order/CompactlyGenerated/Intervals.lean +++ b/Mathlib/Order/CompactlyGenerated/Intervals.lean @@ -27,6 +27,7 @@ theorem isCompactElement {a : α} {b : Iic a} (h : IsCompactElement (b : α)) : obtain ⟨t, ht⟩ := h ι ((↑) ∘ s) hb exact ⟨t, (by simpa using ht : (b : α) ≤ _)⟩ +set_option backward.isDefEq.respectTransparency false in instance instIsCompactlyGenerated [IsCompactlyGenerated α] {a : α} : IsCompactlyGenerated (Iic a) := by refine ⟨fun ⟨x, (hx : x ≤ a)⟩ ↦ ?_⟩ diff --git a/Mathlib/Order/Comparable.lean b/Mathlib/Order/Comparable.lean index 7d69e586ef42fe..b2c7727b2c6c9f 100644 --- a/Mathlib/Order/Comparable.lean +++ b/Mathlib/Order/Comparable.lean @@ -199,7 +199,7 @@ theorem AntisymmRel.compRel_congr_right (h : AntisymmRel (· ≤ ·) b c) : end Preorder /-- A partial order where any two elements are comparable is a linear order. -/ -@[implicit_reducible] +@[instance_reducible] def Relation.linearOrderOfSymmGen [PartialOrder α] [decLE : DecidableLE α] [decLT : DecidableLT α] [decEq : DecidableEq α] (h : ∀ a b : α, Relation.SymmGen (· ≤ ·) a b) : LinearOrder α where @@ -210,7 +210,7 @@ def Relation.linearOrderOfSymmGen [PartialOrder α] set_option linter.deprecated false in /-- A partial order where any two elements are comparable is a linear order. -/ -@[deprecated linearOrderOfSymmGen (since := "2026-01-25"), implicit_reducible] +@[deprecated linearOrderOfSymmGen (since := "2026-01-25"), instance_reducible] def linearOrderOfComprel [PartialOrder α] [decLE : DecidableLE α] [decLT : DecidableLT α] [decEq : DecidableEq α] (h : ∀ a b : α, CompRel (· ≤ ·) a b) : LinearOrder α := diff --git a/Mathlib/Order/Compare.lean b/Mathlib/Order/Compare.lean index 29da3037a99a1f..de59b5764b6096 100644 --- a/Mathlib/Order/Compare.lean +++ b/Mathlib/Order/Compare.lean @@ -148,7 +148,7 @@ theorem cmp_ofDual [LT α] [DecidableLT α] (x y : αᵒᵈ) : cmp (ofDual x) (o rfl /-- Generate a linear order structure from a preorder and `cmp` function. -/ -@[implicit_reducible] +@[instance_reducible] def linearOrderOfCompares [Preorder α] (cmp : α → α → Ordering) (h : ∀ a b, (cmp a b).Compares a b) : LinearOrder α := let H : DecidableLE α := fun a b => decidable_of_iff _ (h a b).ne_gt diff --git a/Mathlib/Order/CompleteBooleanAlgebra.lean b/Mathlib/Order/CompleteBooleanAlgebra.lean index e27eaa794629f0..7eda8fddf13375 100644 --- a/Mathlib/Order/CompleteBooleanAlgebra.lean +++ b/Mathlib/Order/CompleteBooleanAlgebra.lean @@ -158,7 +158,7 @@ lemma inf_iSup₂_eq {f : ∀ i, κ i → α} (a : α) : (a ⊓ ⨆ i, ⨆ j, f simp only [inf_iSup_eq] /-- The `Order.Frame.MinimalAxioms` element corresponding to a frame. -/ -@[implicit_reducible] +@[instance_reducible] def of [Frame α] : MinimalAxioms α where __ := ‹Frame α› inf_sSup_le_iSup_inf a s := _root_.inf_sSup_eq.le @@ -198,7 +198,7 @@ lemma sup_iInf₂_eq {f : ∀ i, κ i → α} (a : α) : (a ⊔ ⨅ i, ⨅ j, f simp only [sup_iInf_eq] /-- The `Order.Coframe.MinimalAxioms` element corresponding to a frame. -/ -@[implicit_reducible] +@[instance_reducible] def of [Coframe α] : MinimalAxioms α where __ := ‹Coframe α› iInf_sup_le_sup_sInf a s := _root_.sup_sInf_eq.ge @@ -224,7 +224,7 @@ variable (minAx : MinimalAxioms α) /-- The `CompleteDistribLattice.MinimalAxioms` element corresponding to a complete distrib lattice. -/ -@[implicit_reducible] +@[instance_reducible] def of [CompleteDistribLattice α] : MinimalAxioms α where __ := ‹CompleteDistribLattice α› inf_sSup_le_iSup_inf a s := inf_sSup_eq.le @@ -309,7 +309,7 @@ abbrev toCompleteDistribLattice : CompleteDistribLattice.MinimalAxioms α where _ = _ := by simp [sInf_eq_iInf', iInf_unique, iSup_bool_eq] /-- The `CompletelyDistribLattice.MinimalAxioms` element corresponding to a frame. -/ -@[implicit_reducible] +@[instance_reducible] def of [CompletelyDistribLattice α] : MinimalAxioms α := { ‹CompletelyDistribLattice α› with } end MinimalAxioms diff --git a/Mathlib/Order/CompleteLattice/Defs.lean b/Mathlib/Order/CompleteLattice/Defs.lean index 0752929adea1bf..18741feeb3b5e3 100644 --- a/Mathlib/Order/CompleteLattice/Defs.lean +++ b/Mathlib/Order/CompleteLattice/Defs.lean @@ -162,7 +162,7 @@ instance : CompleteLattice my_T where __ := completeLatticeOfInf my_T _ ``` -/ -@[implicit_reducible] +@[instance_reducible] def completeLatticeOfInf (α : Type*) [H1 : PartialOrder α] [H2 : InfSet α] (isGLB_sInf : ∀ s : Set α, IsGLB s (sInf s)) : CompleteLattice α where __ := H1; __ := H2 @@ -189,7 +189,7 @@ def completeLatticeOfInf (α : Type*) [H1 : PartialOrder α] [H2 : InfSet α] Note that this construction has bad definitional properties: see the doc-string on `completeLatticeOfInf`. -/ -@[implicit_reducible] +@[instance_reducible] def completeLatticeOfCompleteSemilatticeInf (α : Type*) [CompleteSemilatticeInf α] : CompleteLattice α := completeLatticeOfInf α fun s => isGLB_sInf s @@ -209,7 +209,7 @@ instance : CompleteLattice my_T where __ := completeLatticeOfSup my_T _ ``` -/ -@[implicit_reducible] +@[instance_reducible] def completeLatticeOfSup (α : Type*) [H1 : PartialOrder α] [H2 : SupSet α] (isLUB_sSup : ∀ s : Set α, IsLUB s (sSup s)) : CompleteLattice α where __ := H1; __ := H2 @@ -234,7 +234,7 @@ def completeLatticeOfSup (α : Type*) [H1 : PartialOrder α] [H2 : SupSet α] Note that this construction has bad definitional properties: see the doc-string on `completeLatticeOfSup`. -/ -@[implicit_reducible] +@[instance_reducible] def completeLatticeOfCompleteSemilatticeSup (α : Type*) [CompleteSemilatticeSup α] : CompleteLattice α := completeLatticeOfSup α fun s => isLUB_sSup s diff --git a/Mathlib/Order/CompleteLattice/PiLex.lean b/Mathlib/Order/CompleteLattice/PiLex.lean index a19760b411479a..df0503f3078abd 100644 --- a/Mathlib/Order/CompleteLattice/PiLex.lean +++ b/Mathlib/Order/CompleteLattice/PiLex.lean @@ -105,36 +105,44 @@ end Lex namespace Colex variable [WellFoundedGT ι] +set_option backward.isDefEq.respectTransparency false in @[no_expose] instance : InfSet (Colex ((i : ι) → α i)) where sInf s := sInf (α := Πₗ i : ιᵒᵈ, α i) s +set_option backward.isDefEq.respectTransparency false in theorem sInf_apply (s : Set (Colex ((i : ι) → α i))) (i : ι) : sInf s i = ⨅ e : {e ∈ s | ∀ j > i, e j = sInf s j}, e.1 i := Lex.sInf_apply (ι := ιᵒᵈ) s i +set_option backward.isDefEq.respectTransparency false in theorem sInf_apply_le {s : Set (Colex ((i : ι) → α i))} {i : ι} {e : Colex ((i : ι) → α i)} (he : e ∈ s) (h : ∀ j > i, e j = sInf s j) : sInf s i ≤ e i := Lex.sInf_apply_le (ι := ιᵒᵈ) he h +set_option backward.isDefEq.respectTransparency false in theorem le_sInf_apply {s : Set (Colex ((i : ι) → α i))} {i : ι} {e : Colex ((i : ι) → α i)} (h : ∀ f ∈ s, (∀ j > i, f j = sInf s j) → e i ≤ f i) : e i ≤ sInf s i := Lex.le_sInf_apply (ι := ιᵒᵈ) h -- TODO: figure out how to use `to_dual` here +set_option backward.isDefEq.respectTransparency false in @[no_expose] instance : SupSet (Colex ((i : ι) → α i)) where sSup s := sSup (α := Πₗ i : ιᵒᵈ, α i) s +set_option backward.isDefEq.respectTransparency false in theorem sSup_apply (s : Set (Colex ((i : ι) → α i))) (i : ι) : sSup s i = ⨆ e : {e ∈ s | ∀ j > i, e j = sSup s j}, e.1 i := Lex.sSup_apply (ι := ιᵒᵈ) s i +set_option backward.isDefEq.respectTransparency false in theorem le_sSup_apply {s : Set (Colex ((i : ι) → α i))} {i : ι} {e : Colex ((i : ι) → α i)} (he : e ∈ s) (h : ∀ j > i, e j = sSup s j) : e i ≤ sSup s i := Lex.le_sSup_apply (ι := ιᵒᵈ) he h +set_option backward.isDefEq.respectTransparency false in theorem sSup_apply_le {s : Set (Colex ((i : ι) → α i))} {i : ι} {e : Colex ((i : ι) → α i)} (h : ∀ f ∈ s, (∀ j > i, f j = sSup s j) → f i ≤ e i) : sSup s i ≤ e i := Lex.sSup_apply_le (ι := ιᵒᵈ) h diff --git a/Mathlib/Order/Completion.lean b/Mathlib/Order/Completion.lean index 29fcdcd7773dcd..c7c1f6dc338621 100644 --- a/Mathlib/Order/Completion.lean +++ b/Mathlib/Order/Completion.lean @@ -175,6 +175,7 @@ theorem principalEmbedding_trans_factorEmbedding (f : β ↪o α) : principalEmbedding.trans (factorEmbedding f) = f := by ext; simp +set_option backward.isDefEq.respectTransparency false in /-- `DedekindCut.principal` as an `OrderIso`. This provides the second half of the **fundamental theorem of concept lattices**: every complete @@ -188,6 +189,7 @@ def principalIso : α ≃o DedekindCut α where right_inv x := by simp [factorEmbedding] __ := principalEmbedding +set_option backward.isDefEq.respectTransparency false in theorem principalIso_symm_apply (A : DedekindCut α) : principalIso.symm A = sSup A.left := (factorEmbedding_apply ..).trans <| by simp diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean b/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean index d6858e8a17a9bf..57b7624b40b3e7 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Defs.lean @@ -112,7 +112,7 @@ instance : ConditionallyCompleteLattice my_T where __ := conditionallyCompleteLatticeOfsSup my_T ... ``` -/ -@[to_dual (attr := implicit_reducible) (reorder := 4 5) +@[to_dual (attr := instance_reducible) (reorder := 4 5) /-- Create a `ConditionallyCompleteLattice` from a `PartialOrder` and `sInf` function that returns the greatest lower bound of a nonempty set which is bounded below. Usually this constructor provides poor definitional equalities. If other fields are known explicitly, they @@ -145,7 +145,7 @@ def conditionallyCompleteLatticeOfsSup (α : Type*) [H1 : PartialOrder α] [H2 : /-- A version of `conditionallyCompleteLatticeOfsSup` when we already know that `α` is a lattice. This should only be used when it is both hard and unnecessary to provide `sInf` explicitly. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- A version of `conditionallyCompleteLatticeOfsInf` when we already know that `α` is a lattice. This should only be used when it is both hard and unnecessary to provide `sSup` explicitly. -/] diff --git a/Mathlib/Order/Copy.lean b/Mathlib/Order/Copy.lean index a84a6fcf7de773..d4925479a59fe9 100644 --- a/Mathlib/Order/Copy.lean +++ b/Mathlib/Order/Copy.lean @@ -26,7 +26,7 @@ variable {α : Type u} /-- A function to create a provable equal copy of a top order with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def OrderTop.copy {h : LE α} {h' : LE α} (c : @OrderTop α h') (top : α) (eq_top : top = (by infer_instance : Top α).top) (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @OrderTop α h := @@ -34,7 +34,7 @@ def OrderTop.copy {h : LE α} {h' : LE α} (c : @OrderTop α h') /-- A function to create a provable equal copy of a bottom order with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def OrderBot.copy {h : LE α} {h' : LE α} (c : @OrderBot α h') (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @OrderBot α h := @@ -42,7 +42,7 @@ def OrderBot.copy {h : LE α} {h' : LE α} (c : @OrderBot α h') /-- A function to create a provable equal copy of a bounded order with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def BoundedOrder.copy {h : LE α} {h' : LE α} (c : @BoundedOrder α h') (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) @@ -52,7 +52,7 @@ def BoundedOrder.copy {h : LE α} {h' : LE α} (c : @BoundedOrder α h') /-- A function to create a provable equal copy of a lattice with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def Lattice.copy (c : Lattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) @@ -73,7 +73,7 @@ def Lattice.copy (c : Lattice α) /-- A function to create a provable equal copy of a distributive lattice with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def DistribLattice.copy (c : DistribLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) @@ -83,7 +83,7 @@ def DistribLattice.copy (c : DistribLattice α) /-- A function to create a provable equal copy of a generalised heyting algebra with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def GeneralizedHeytingAlgebra.copy (c : GeneralizedHeytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) @@ -99,7 +99,7 @@ def GeneralizedHeytingAlgebra.copy (c : GeneralizedHeytingAlgebra α) /-- A function to create a provable equal copy of a generalised co-Heyting algebra with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def GeneralizedCoheytingAlgebra.copy (c : GeneralizedCoheytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) @@ -115,7 +115,7 @@ def GeneralizedCoheytingAlgebra.copy (c : GeneralizedCoheytingAlgebra α) /-- A function to create a provable equal copy of a heyting algebra with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def HeytingAlgebra.copy (c : HeytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) @@ -135,7 +135,7 @@ def HeytingAlgebra.copy (c : HeytingAlgebra α) /-- A function to create a provable equal copy of a co-Heyting algebra with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def CoheytingAlgebra.copy (c : CoheytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) @@ -155,7 +155,7 @@ def CoheytingAlgebra.copy (c : CoheytingAlgebra α) /-- A function to create a provable equal copy of a bi-Heyting algebra with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def BiheytingAlgebra.copy (c : BiheytingAlgebra α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) @@ -174,7 +174,7 @@ def BiheytingAlgebra.copy (c : BiheytingAlgebra α) /-- A function to create a provable equal copy of a complete lattice with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def CompleteLattice.copy (c : CompleteLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) @@ -196,7 +196,7 @@ def CompleteLattice.copy (c : CompleteLattice α) /-- A function to create a provable equal copy of a frame with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def Frame.copy (c : Frame α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) @@ -213,7 +213,7 @@ def Frame.copy (c : Frame α) (le : α → α → Prop) (eq_le : le = (by infer_ /-- A function to create a provable equal copy of a coframe with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def Coframe.copy (c : Coframe α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot) @@ -230,7 +230,7 @@ def Coframe.copy (c : Coframe α) (le : α → α → Prop) (eq_le : le = (by in /-- A function to create a provable equal copy of a complete distributive lattice with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def CompleteDistribLattice.copy (c : CompleteDistribLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (top : α) (eq_top : top = (by infer_instance : Top α).top) @@ -251,7 +251,7 @@ def CompleteDistribLattice.copy (c : CompleteDistribLattice α) /-- A function to create a provable equal copy of a conditionally complete lattice with possibly different definitional equalities. -/ -@[implicit_reducible] +@[instance_reducible] def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α) (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le) (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max) diff --git a/Mathlib/Order/CountableDenseLinearOrder.lean b/Mathlib/Order/CountableDenseLinearOrder.lean index 3b331237fdc464..8c8362243f5455 100644 --- a/Mathlib/Order/CountableDenseLinearOrder.lean +++ b/Mathlib/Order/CountableDenseLinearOrder.lean @@ -65,6 +65,7 @@ theorem exists_between_finsets [DenselyOrdered α] [NoMinOrder α] nonem.elim fun m ↦ ⟨m, fun x hx ↦ (nlo ⟨x, hx⟩).elim, fun y hy ↦ (nhi ⟨y, hy⟩).elim⟩ +set_option backward.isDefEq.respectTransparency false in lemma exists_orderEmbedding_insert [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [nonem : Nonempty β] (S : Finset α) (f : S ↪o β) (a : α) : ∃ (g : (insert a S : Finset α) ↪o β), diff --git a/Mathlib/Order/Defs/PartialOrder.lean b/Mathlib/Order/Defs/PartialOrder.lean index 010158276785fa..8d02ae3604eebb 100644 --- a/Mathlib/Order/Defs/PartialOrder.lean +++ b/Mathlib/Order/Defs/PartialOrder.lean @@ -139,7 +139,7 @@ instance instTransGTGE : @Trans α α α GT.gt GE.ge GT.gt := ⟨lt_of_lt_of_le' instance instTransGEGT : @Trans α α α GE.ge GT.gt GT.gt := ⟨lt_of_le_of_lt'⟩ /-- `<` is decidable if `≤` is. -/ -@[implicit_reducible] +@[instance_reducible] def decidableLTOfDecidableLE [DecidableLE α] : DecidableLT α := fun _ _ => decidable_of_iff _ lt_iff_le_not_ge.symm diff --git a/Mathlib/Order/DirectedInverseSystem.lean b/Mathlib/Order/DirectedInverseSystem.lean index 9e545d0689ec88..4cdd7e14054ca0 100644 --- a/Mathlib/Order/DirectedInverseSystem.lean +++ b/Mathlib/Order/DirectedInverseSystem.lean @@ -96,7 +96,7 @@ open DirectedSystem variable [IsDirectedOrder ι] /-- The setoid on the sigma type defining the direct limit. -/ -@[implicit_reducible] +@[instance_reducible] def setoid : Setoid (Σ i, F i) where r x y := ∃ᵉ (i) (hx : x.1 ≤ i) (hy : y.1 ≤ i), f _ _ hx x.2 = f _ _ hy y.2 iseqv := ⟨fun x ↦ ⟨x.1, le_rfl, le_rfl, rfl⟩, fun ⟨i, hx, hy, eq⟩ ↦ ⟨i, hy, hx, eq.symm⟩, @@ -327,6 +327,7 @@ def piSplitLE : piLT X i × X i ≃ ∀ j : Iic i, X j where left_inv f := by ext j; exacts [dif_neg j.2.ne, dif_pos rfl] right_inv f := by grind +set_option backward.isDefEq.respectTransparency false in @[simp] theorem piSplitLE_eq {f : piLT X i × X i} : piSplitLE f ⟨i, le_rfl⟩ = f.2 := by simp [piSplitLE] @@ -356,6 +357,8 @@ theorem piEquivSucc_self {x} : simp [piEquivSucc] variable {equiv e} + +set_option backward.isDefEq.respectTransparency.types false in theorem isNatEquiv_piEquivSucc [InverseSystem f] (H : ∀ x, (e x).1 = f (le_succ i) x) (nat : IsNatEquiv f equiv) : IsNatEquiv f (piEquivSucc equiv e hi) := fun j k hj hk h x ↦ by have lt_succ {j} := (lt_succ_iff_of_not_isMax (b := j) hi).mpr @@ -451,6 +454,7 @@ theorem pEquivOn_apply_eq (h : IsLowerSet (s ∩ t)) (e₂.restrict inter_subset_right).equiv ⟨i, his, hit⟩ from congr_fun (congr_arg _ <| unique_pEquivOn h) _ +set_option backward.isDefEq.respectTransparency.types false in /-- Extend a partial family of bijections by one step. -/ def pEquivOnSucc [InverseSystem f] (hi : ¬IsMax i) (e : PEquivOn f equivSucc (Iic i)) (H : ∀ ⦃i⦄ (hi : ¬ IsMax i) x, (equivSucc hi x).1 = f (le_succ i) x) : diff --git a/Mathlib/Order/Disjointed.lean b/Mathlib/Order/Disjointed.lean index d91009ae59eaf2..9b50a1305c087e 100644 --- a/Mathlib/Order/Disjointed.lean +++ b/Mathlib/Order/Disjointed.lean @@ -211,6 +211,7 @@ theorem disjointed_unique' {f d : ι → α} (hdisj : Pairwise (Disjoint on d)) (hsups : partialSups d = partialSups f) : d = disjointed f := disjointed_unique (fun hij ↦ hdisj hij.ne) hsups +set_option backward.isDefEq.respectTransparency false in omit [GeneralizedBooleanAlgebra α] in lemma Finset.disjiUnion_Iic_disjointed [DecidableEq α] (n : ι) (t : ι → Finset α) : (Iic n).disjiUnion (disjointed t) ((disjoint_disjointed t).set_pairwise _) = diff --git a/Mathlib/Order/Extension/Well.lean b/Mathlib/Order/Extension/Well.lean index ad30f3594daafe..b4f0871f829686 100644 --- a/Mathlib/Order/Extension/Well.lean +++ b/Mathlib/Order/Extension/Well.lean @@ -56,7 +56,7 @@ By taking the lexicographic product of the two, we get both properties, so we ca get a well-order that extend our original order `r`. Another way to view this is that we choose an arbitrary well-order to serve as a tiebreak between two elements of same rank. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def wellOrderExtension : LinearOrder α := @LinearOrder.lift' α (Ordinal ×ₗ Cardinal) _ (fun a : α => (rank r a, embeddingToCardinal a)) fun _ _ h => embeddingToCardinal.injective <| congr_arg Prod.snd h diff --git a/Mathlib/Order/Filter/Basic.lean b/Mathlib/Order/Filter/Basic.lean index 697f0f5cf1b15d..2ad8e2474407c2 100644 --- a/Mathlib/Order/Filter/Basic.lean +++ b/Mathlib/Order/Filter/Basic.lean @@ -1219,6 +1219,7 @@ theorem set_eventuallyLE_iff_inf_principal_le {s t : Set α} {l : Filter α} : set_eventuallyLE_iff_mem_inf_principal.trans <| by simp only [le_inf_iff, inf_le_left, true_and, le_principal_iff] +set_option backward.isDefEq.respectTransparency false in theorem set_eventuallyEq_iff_inf_principal {s t : Set α} {l : Filter α} : s =ᶠ[l] t ↔ l ⊓ 𝓟 s = l ⊓ 𝓟 t := by simp only [eventuallyLE_antisymm_iff, le_antisymm_iff, set_eventuallyLE_iff_inf_principal_le] diff --git a/Mathlib/Order/Filter/CountableInter.lean b/Mathlib/Order/Filter/CountableInter.lean index d8b3c95ba95775..be94e8091d73b1 100644 --- a/Mathlib/Order/Filter/CountableInter.lean +++ b/Mathlib/Order/Filter/CountableInter.lean @@ -259,6 +259,7 @@ inductive CountableGenerateSets : Set α → Prop | sInter {S : Set (Set α)} : S.Countable → (∀ s ∈ S, CountableGenerateSets s) → CountableGenerateSets (⋂₀ S) +set_option backward.isDefEq.respectTransparency false in /-- `Filter.countableGenerate g` is the greatest `countableInterFilter` containing `g`. -/ def countableGenerate : Filter α := ofCountableInter (CountableGenerateSets g) (fun _ => CountableGenerateSets.sInter) fun _ _ => diff --git a/Mathlib/Order/Filter/Finite.lean b/Mathlib/Order/Filter/Finite.lean index 9a83bbff60523e..5afec5dd9bff0d 100644 --- a/Mathlib/Order/Filter/Finite.lean +++ b/Mathlib/Order/Filter/Finite.lean @@ -83,6 +83,7 @@ theorem mem_iInf_of_iInter {ι} {s : ι → Filter α} {U : Set α} {I : Set ι} refine mem_of_superset (iInter_mem.2 fun i => ?_) hU exact mem_iInf_of_mem (i : ι) (hV _) +set_option backward.isDefEq.respectTransparency false in theorem mem_iInf {ι} {s : ι → Filter α} {U : Set α} : (U ∈ ⨅ i, s i) ↔ ∃ I : Set ι, I.Finite ∧ ∃ V : I → Set α, (∀ (i : I), V i ∈ s i) ∧ U = ⋂ i, V i := by @@ -132,6 +133,7 @@ theorem mem_iInf_of_finite {ι : Sort*} [Finite ι] {α : Type*} {f : ι → Fil rintro ⟨t, ht, rfl⟩ exact iInter_mem.2 fun i => mem_iInf_of_mem i (ht i) +set_option backward.isDefEq.respectTransparency false in theorem mem_biInf_principal {ι : Type*} {p : ι → Prop} {s : ι → Set α} {t : Set α} : t ∈ ⨅ (i : ι) (_ : p i), 𝓟 (s i) ↔ ∃ I : Set ι, I.Finite ∧ (∀ i ∈ I, p i) ∧ ⋂ i ∈ I, s i ⊆ t := by diff --git a/Mathlib/Order/Filter/Germ/Basic.lean b/Mathlib/Order/Filter/Germ/Basic.lean index 7390a26c100c7e..af4f3c14045c3e 100644 --- a/Mathlib/Order/Filter/Germ/Basic.lean +++ b/Mathlib/Order/Filter/Germ/Basic.lean @@ -70,7 +70,7 @@ theorem const_eventuallyEq' [NeBot l] {a b : β} : (∀ᶠ _ in l, a = b) ↔ a @const_eventuallyEq' _ _ _ _ a b /-- Setoid used to define the space of germs. -/ -@[implicit_reducible] +@[instance_reducible] def germSetoid (l : Filter α) (β : Type*) : Setoid (α → β) where r := EventuallyEq l iseqv := ⟨EventuallyEq.refl _, EventuallyEq.symm, EventuallyEq.trans⟩ @@ -81,7 +81,7 @@ def Germ (l : Filter α) (β : Type*) : Type _ := /-- Setoid used to define the filter product. This is a dependent version of `Filter.germSetoid`. -/ -@[implicit_reducible] +@[instance_reducible] def productSetoid (l : Filter α) (ε : α → Type*) : Setoid ((a : _) → ε a) where r f g := ∀ᶠ a in l, f a = g a iseqv := diff --git a/Mathlib/Order/Filter/Partial.lean b/Mathlib/Order/Filter/Partial.lean index 1b50ff84afc531..f77074f13693f2 100644 --- a/Mathlib/Order/Filter/Partial.lean +++ b/Mathlib/Order/Filter/Partial.lean @@ -122,6 +122,7 @@ theorem rcomap_compose (r : SetRel α β) (s : SetRel β γ) : rcomap r ∘ rcomap s = rcomap (r.comp s) := funext <| rcomap_rcomap _ _ +set_option backward.isDefEq.respectTransparency false in theorem rtendsto_iff_le_rcomap (r : SetRel α β) (l₁ : Filter α) (l₂ : Filter β) : RTendsto r l₁ l₂ ↔ l₁ ≤ l₂.rcomap r := by rw [rtendsto_def] @@ -175,6 +176,7 @@ theorem rcomap'_compose (r : SetRel α β) (s : SetRel β γ) : def RTendsto' (r : SetRel α β) (l₁ : Filter α) (l₂ : Filter β) := l₁ ≤ l₂.rcomap' r +set_option backward.isDefEq.respectTransparency false in theorem rtendsto'_def (r : SetRel α β) (l₁ : Filter α) (l₂ : Filter β) : RTendsto' r l₁ l₂ ↔ ∀ s ∈ l₂, r.preimage s ∈ l₁ := by unfold RTendsto' rcomap'; constructor diff --git a/Mathlib/Order/Filter/Pointwise.lean b/Mathlib/Order/Filter/Pointwise.lean index bfe4f7a6c88cfa..436fb1c429bdfa 100644 --- a/Mathlib/Order/Filter/Pointwise.lean +++ b/Mathlib/Order/Filter/Pointwise.lean @@ -78,7 +78,7 @@ section One variable [One α] {f : Filter α} {s : Set α} /-- `1 : Filter α` is defined as the filter of sets containing `1 : α` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `0 : Filter α` is defined as the filter of sets containing `0 : α` in scope `Pointwise`. -/] protected def instOne : One (Filter α) := ⟨pure 1⟩ @@ -170,7 +170,7 @@ section Inv variable [Inv α] {f g : Filter α} {s : Set α} {a : α} /-- The inverse of a filter is the pointwise preimage under `⁻¹` of its sets. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The negation of a filter is the pointwise preimage under `-` of its sets. -/] def instInv : Inv (Filter α) := ⟨map Inv.inv⟩ @@ -236,7 +236,7 @@ protected theorem HasBasis.inv {ι : Sort*} {p : ι → Prop} {s : ι → Set α simpa using h.map Inv.inv /-- Inversion is involutive on `Filter α` if it is on `α`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- Negation is involutive on `Filter α` if it is on `α`. -/] protected def instInvolutiveInv : InvolutiveInv (Filter α) := { Filter.instInv with @@ -269,7 +269,7 @@ section Mul variable [Mul α] [Mul β] {f f₁ f₂ g g₁ g₂ h : Filter α} {s t : Set α} {a b : α} /-- The filter `f * g` is generated by `{s * t | s ∈ f, t ∈ g}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The filter `f + g` is generated by `{s + t | s ∈ f, t ∈ g}` in scope `Pointwise`. -/] protected def instMul : Mul (Filter α) := ⟨/- This is defeq to `map₂ (· * ·) f g`, but the hypothesis unfolds to `t₁ * t₂ ⊆ s` rather @@ -379,7 +379,7 @@ section Div variable [Div α] {f f₁ f₂ g g₁ g₂ h : Filter α} {s t : Set α} {a b : α} /-- The filter `f / g` is generated by `{s / t | s ∈ f, t ∈ g}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The filter `f - g` is generated by `{s - t | s ∈ f, t ∈ g}` in scope `Pointwise`. -/] protected def instDiv : Div (Filter α) := ⟨/- This is defeq to `map₂ (· / ·) f g`, but the hypothesis unfolds to `t₁ / t₂ ⊆ s` @@ -496,13 +496,13 @@ scoped[Pointwise] attribute [instance] Filter.instNSMul Filter.instNPow Filter.instZSMul Filter.instZPow /-- `Filter α` is a `Semigroup` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Filter α` is an `AddSemigroup` under pointwise operations if `α` is. -/] protected def semigroup [Semigroup α] : Semigroup (Filter α) where mul_assoc _ _ _ := map₂_assoc mul_assoc /-- `Filter α` is a `CommSemigroup` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Filter α` is an `AddCommSemigroup` under pointwise operations if `α` is. -/] protected def commSemigroup [CommSemigroup α] : CommSemigroup (Filter α) := { Filter.semigroup with mul_comm := fun _ _ => map₂_comm mul_comm } @@ -512,7 +512,7 @@ section MulOneClass variable [MulOneClass α] [MulOneClass β] /-- `Filter α` is a `MulOneClass` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Filter α` is an `AddZeroClass` under pointwise operations if `α` is. -/] protected def mulOneClass : MulOneClass (Filter α) where one_mul := map₂_left_identity one_mul @@ -564,7 +564,7 @@ section Monoid variable [Monoid α] {f g : Filter α} {s : Set α} {a : α} {m n : ℕ} /-- `Filter α` is a `Monoid` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Filter α` is an `AddMonoid` under pointwise operations if `α` is. -/] protected def monoid : Monoid (Filter α) := { Filter.mulOneClass, Filter.semigroup, @Filter.instNPow α _ _ with } @@ -615,7 +615,7 @@ protected theorem _root_.IsUnit.filter : IsUnit a → IsUnit (pure a : Filter α end Monoid /-- `Filter α` is a `CommMonoid` under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Filter α` is an `AddCommMonoid` under pointwise operations if `α` is. -/] protected def commMonoid [CommMonoid α] : CommMonoid (Filter α) := { Filter.mulOneClass, Filter.commSemigroup with } @@ -638,7 +638,7 @@ protected theorem mul_eq_one_iff : f * g = 1 ↔ ∃ a b, f = pure a ∧ g = pur rw [pure_mul_pure, h, pure_one] /-- `Filter α` is a division monoid under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `Filter α` is a subtraction monoid under pointwise operations if `α` is. -/] protected def divisionMonoid : DivisionMonoid (Filter α) := { Filter.monoid, Filter.instInvolutiveInv, Filter.instDiv, Filter.instZPow (α := α) with @@ -662,7 +662,7 @@ theorem isUnit_iff : IsUnit f ↔ ∃ a, f = pure a ∧ IsUnit a := by end DivisionMonoid /-- `Filter α` is a commutative division monoid under pointwise operations if `α` is. -/ -@[to_additive (attr := implicit_reducible) subtractionCommMonoid +@[to_additive (attr := instance_reducible) subtractionCommMonoid /-- `Filter α` is a commutative subtraction monoid under pointwise operations if `α` is. -/] protected def divisionCommMonoid [DivisionCommMonoid α] : DivisionCommMonoid (Filter α) := { Filter.divisionMonoid, Filter.commSemigroup with } @@ -788,7 +788,7 @@ variable [SMul α β] {f f₁ f₂ : Filter α} {g g₁ g₂ h : Filter β} {s : {b : β} /-- The filter `f • g` is generated by `{s • t | s ∈ f, t ∈ g}` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The filter `f +ᵥ g` is generated by `{s +ᵥ t | s ∈ f, t ∈ g}` in locale `Pointwise`. -/] protected def instSMul : SMul (Filter α) (Filter β) := @@ -971,7 +971,7 @@ section SMul variable [SMul α β] {f f₁ f₂ : Filter β} {s : Set β} {a : α} /-- `a • f` is the map of `f` under `a •` in scope `Pointwise`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `a +ᵥ f` is the map of `f` under `a +ᵥ` in scope `Pointwise`. -/] protected def instSMulFilter : SMul α (Filter β) := ⟨fun a => map (a • ·)⟩ @@ -1076,7 +1076,7 @@ instance isCentralScalar [SMul α β] [SMul αᵐᵒᵖ β] [IsCentralScalar α /-- A multiplicative action of a monoid `α` on a type `β` gives a multiplicative action of `Filter α` on `Filter β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive action of an additive monoid `α` on a type `β` gives an additive action of `Filter α` on `Filter β`. -/] protected def mulAction [Monoid α] [MulAction α β] : MulAction (Filter α) (Filter β) where @@ -1085,7 +1085,7 @@ protected def mulAction [Monoid α] [MulAction α β] : MulAction (Filter α) (F /-- A multiplicative action of a monoid on a type `β` gives a multiplicative action on `Filter β`. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- An additive action of an additive monoid on a type `β` gives an additive action on `Filter β`. -/] protected def mulActionFilter [Monoid α] [MulAction α β] : MulAction α (Filter β) where diff --git a/Mathlib/Order/Filter/Prod.lean b/Mathlib/Order/Filter/Prod.lean index e6f62fd24324e3..3f0414dad957ea 100644 --- a/Mathlib/Order/Filter/Prod.lean +++ b/Mathlib/Order/Filter/Prod.lean @@ -110,6 +110,7 @@ theorem sup_prod (f₁ f₂ : Filter α) (g : Filter β) : (f₁ ⊔ f₂) ×ˢ theorem prod_sup (f : Filter α) (g₁ g₂ : Filter β) : f ×ˢ (g₁ ⊔ g₂) = (f ×ˢ g₁) ⊔ (f ×ˢ g₂) := by simp only [prod_eq_inf, comap_sup, inf_sup_left] +set_option backward.isDefEq.respectTransparency false in theorem eventually_prod_iff {p : α × β → Prop} : (∀ᶠ x in f ×ˢ g, p x) ↔ ∃ pa : α → Prop, (∀ᶠ x in f, pa x) ∧ ∃ pb : β → Prop, (∀ᶠ y in g, pb y) ∧ diff --git a/Mathlib/Order/Filter/Ultrafilter/Basic.lean b/Mathlib/Order/Filter/Ultrafilter/Basic.lean index 43971b62f5fbe5..be4726c37ad990 100644 --- a/Mathlib/Order/Filter/Ultrafilter/Basic.lean +++ b/Mathlib/Order/Filter/Ultrafilter/Basic.lean @@ -39,6 +39,7 @@ theorem finite_biUnion_mem_iff {is : Set β} {s : β → Set α} (his : is.Finit (⋃ i ∈ is, s i) ∈ f ↔ ∃ i ∈ is, s i ∈ f := by simp only [← sUnion_image, finite_sUnion_mem_iff (his.image s), exists_mem_image] +set_option backward.isDefEq.respectTransparency false in lemma eventually_exists_mem_iff {is : Set β} {P : β → α → Prop} (his : is.Finite) : (∀ᶠ i in f, ∃ a ∈ is, P a i) ↔ ∃ a ∈ is, ∀ᶠ i in f, P a i := by simp only [Filter.Eventually, Ultrafilter.mem_coe] diff --git a/Mathlib/Order/Fin/Tuple.lean b/Mathlib/Order/Fin/Tuple.lean index 3c596a6acf48a0..488e6c08581a3e 100644 --- a/Mathlib/Order/Fin/Tuple.lean +++ b/Mathlib/Order/Fin/Tuple.lean @@ -179,6 +179,7 @@ lemma finSuccAboveOrderIso_symm_apply_ne_last {p : Fin (n + 1)} (h : p ≠ Fin.l rw [← Option.some_inj] simpa [finSuccAboveEquiv, OrderIso.symm] using finSuccEquiv'_ne_last_apply h x.property +set_option backward.isDefEq.respectTransparency false in /-- Promote a `Fin n` into a larger `Fin m`, as a subtype where the underlying values are retained. This is the `OrderIso` version of `Fin.castLE`. -/ @[simps apply symm_apply] diff --git a/Mathlib/Order/GaloisConnection/Defs.lean b/Mathlib/Order/GaloisConnection/Defs.lean index 41dc65626f235d..4ab966280e4dd1 100644 --- a/Mathlib/Order/GaloisConnection/Defs.lean +++ b/Mathlib/Order/GaloisConnection/Defs.lean @@ -248,7 +248,7 @@ def GaloisConnection.toGaloisInsertion {α β : Type*} [Preorder α] [Preorder choice_eq := fun _ _ => rfl } /-- Lift the bottom along a Galois connection -/ -@[to_dual (attr := implicit_reducible) /-- Lift the top along a Galois connection -/] +@[to_dual (attr := instance_reducible) /-- Lift the top along a Galois connection -/] def GaloisConnection.liftOrderBot {α β : Type*} [Preorder α] [OrderBot α] [PartialOrder β] {l : α → β} {u : β → α} (gc : GaloisConnection l u) : OrderBot β where diff --git a/Mathlib/Order/Height.lean b/Mathlib/Order/Height.lean index 0436ec08dcce35..a33329b6a3ecec 100644 --- a/Mathlib/Order/Height.lean +++ b/Mathlib/Order/Height.lean @@ -160,6 +160,7 @@ theorem chainHeight_eq_of_relIso (e : r ≃r r') : (e '' s).chainHeight r' = s.c end Rel +set_option backward.isDefEq.respectTransparency false in @[simp] theorem chainHeight_coe_univ : (@Set.univ ↑s).chainHeight (r ↑· ↑·) = s.chainHeight r := by have hc := Set.chainHeight_eq_of_relEmbedding univ <| Subtype.relEmbedding (r · ·) (· ∈ s) diff --git a/Mathlib/Order/Hom/Basic.lean b/Mathlib/Order/Hom/Basic.lean index e2b2ed52abb9a1..dc9366a72c84fc 100644 --- a/Mathlib/Order/Hom/Basic.lean +++ b/Mathlib/Order/Hom/Basic.lean @@ -308,6 +308,7 @@ theorem mk_le_mk {f g : α → β} {hf hg} : mk f hf ≤ mk g hg ↔ f ≤ g := theorem apply_mono {f g : α →o β} {x y : α} (h₁ : f ≤ g) (h₂ : x ≤ y) : f x ≤ g y := (h₁ x).trans <| g.mono h₂ +set_option backward.isDefEq.respectTransparency false in /-- Curry/uncurry as an order isomorphism between `α × β →o γ` and `α →o β →o γ`. -/ def curry : (α × β →o γ) ≃o (α →o β →o γ) where toFun f := ⟨fun x ↦ ⟨Function.curry f x, fun _ _ h ↦ f.mono ⟨le_rfl, h⟩⟩, fun _ _ h _ => @@ -903,6 +904,7 @@ theorem trans_assoc (f : α ≃o β) (g : β ≃o γ) (h : γ ≃o δ) : (f.trans g).trans h = f.trans (g.trans h) := rfl +set_option backward.isDefEq.respectTransparency false in /-- An order isomorphism between the domains and codomains of two prosets of order homomorphisms gives an order isomorphism between the two function prosets. -/ @[simps apply symm_apply] @@ -934,6 +936,7 @@ def prodComm : α × β ≃o β × α where toEquiv := Equiv.prodComm α β map_rel_iff' := Prod.swap_le_swap +set_option backward.isDefEq.respectTransparency false in /-- `Equiv.prodAssoc` promoted to an order isomorphism. -/ @[simps! (attr := grind =)] def prodAssoc (α β γ : Type*) [LE α] [LE β] [LE γ] : diff --git a/Mathlib/Order/Hom/CompleteLattice.lean b/Mathlib/Order/Hom/CompleteLattice.lean index 6eb8d8de416946..be8f55fb5d21fc 100644 --- a/Mathlib/Order/Hom/CompleteLattice.lean +++ b/Mathlib/Order/Hom/CompleteLattice.lean @@ -656,6 +656,7 @@ def sSupHom.setImage (f : α → β) : sSupHom (Set α) (Set β) where toFun := image f map_sSup' := Set.image_sSup +set_option backward.isDefEq.respectTransparency false in /-- An equivalence of types yields an order isomorphism between their lattices of subsets. -/ @[simps] def Equiv.toOrderIsoSet (e : α ≃ β) : Set α ≃o Set β where diff --git a/Mathlib/Order/Hom/Lex.lean b/Mathlib/Order/Hom/Lex.lean index 6b647e3087261a..57057ea3f5713a 100644 --- a/Mathlib/Order/Hom/Lex.lean +++ b/Mathlib/Order/Hom/Lex.lean @@ -150,6 +150,7 @@ end OrderIso namespace Prod.Lex variable (α β : Type*) +set_option backward.isDefEq.respectTransparency.types false in /-- Lexicographic product type with `Unique` type on the right is `OrderIso` to the left. -/ def prodUnique [PartialOrder α] [Preorder β] [Unique β] : α ×ₗ β ≃o α where toFun x := (ofLex x).1 @@ -164,6 +165,7 @@ variable {α β} in theorem prodUnique_apply [PartialOrder α] [Preorder β] [Unique β] (x : α ×ₗ β) : prodUnique α β x = (ofLex x).1 := rfl +set_option backward.isDefEq.respectTransparency false in /-- Lexicographic product type with `Unique` type on the left is `OrderIso` to the right. -/ def uniqueProd [Preorder α] [Unique α] [LE β] : α ×ₗ β ≃o β where toFun x := (ofLex x).2 diff --git a/Mathlib/Order/Hom/PowersetCard.lean b/Mathlib/Order/Hom/PowersetCard.lean index 4ebe7ddeb2b7b4..217cf1333e2c2a 100644 --- a/Mathlib/Order/Hom/PowersetCard.lean +++ b/Mathlib/Order/Hom/PowersetCard.lean @@ -32,6 +32,7 @@ section order variable {n : ℕ} {I : Type*} [LinearOrder I] +set_option backward.isDefEq.respectTransparency false in /-- The isomorphism of `OrderEmbedding`s from `Fin n` into `I` with `Set.powersetCard I n` when `I` is linearly ordered. -/ def ofFinEmbEquiv : (Fin n ↪o I) ≃ powersetCard I n where @@ -52,6 +53,7 @@ lemma mem_ofFinEmbEquiv_iff_mem_range (f : Fin n ↪o I) (i : I) : i ∈ ofFinEmbEquiv f ↔ i ∈ range f := by simp [ofFinEmbEquiv_apply] +set_option backward.isDefEq.respectTransparency false in lemma mem_range_ofFinEmbEquiv_symm_iff_mem (s : powersetCard I n) (i : I) : i ∈ range (ofFinEmbEquiv.symm s) ↔ i ∈ s := by simp [ofFinEmbEquiv_symm_apply] diff --git a/Mathlib/Order/Hom/Set.lean b/Mathlib/Order/Hom/Set.lean index f5ee2e213809b7..697e985d89be04 100644 --- a/Mathlib/Order/Hom/Set.lean +++ b/Mathlib/Order/Hom/Set.lean @@ -24,6 +24,7 @@ variable {α β γ : Type*} namespace Set +set_option backward.isDefEq.respectTransparency false in /-- Sets on sum types are order-equivalent to pairs of sets on each summand. -/ @[simps apply] def sumEquiv : Set (α ⊕ β) ≃o Set α × Set β where @@ -192,6 +193,7 @@ instance subsingleton_of_wellFoundedGT' [LinearOrder β] [WellFoundedGT β] [Pre instance unique_of_wellFoundedGT [LinearOrder α] [WellFoundedGT α] : Unique (α ≃o α) := Unique.mk' _ +set_option backward.isDefEq.respectTransparency false in /-- An order isomorphism between lattices induces an order isomorphism between corresponding interval sublattices. -/ protected def Iic [Lattice α] [Lattice β] (e : α ≃o β) (x : α) : @@ -202,6 +204,7 @@ protected def Iic [Lattice α] [Lattice β] (e : α ≃o β) (x : α) : right_inv y := by simp map_rel_iff' := by simp +set_option backward.isDefEq.respectTransparency false in /-- An order isomorphism between lattices induces an order isomorphism between corresponding interval sublattices. -/ protected def Ici [Lattice α] [Lattice β] (e : α ≃o β) (x : α) : @@ -212,6 +215,7 @@ protected def Ici [Lattice α] [Lattice β] (e : α ≃o β) (x : α) : right_inv y := by simp map_rel_iff' := by simp +set_option backward.isDefEq.respectTransparency false in /-- An order isomorphism between lattices induces an order isomorphism between corresponding interval sublattices. -/ protected def Icc [Lattice α] [Lattice β] (e : α ≃o β) (x y : α) : diff --git a/Mathlib/Order/Interval/Finset/Basic.lean b/Mathlib/Order/Interval/Finset/Basic.lean index a45126b49ce983..7bedfe39d2b28a 100644 --- a/Mathlib/Order/Interval/Finset/Basic.lean +++ b/Mathlib/Order/Interval/Finset/Basic.lean @@ -264,7 +264,7 @@ theorem Ioo_self : Ioo a a = ∅ := variable {a} /-- A set with upper and lower bounds in a locally finite order is a fintype -/ -@[implicit_reducible] +@[instance_reducible] def _root_.Set.fintypeOfMemBounds {s : Set α} [DecidablePred (· ∈ s)] (ha : a ∈ lowerBounds s) (hb : b ∈ upperBounds s) : Fintype s := Set.fintypeSubset (Set.Icc a b) fun _ hx => ⟨ha hx, hb hx⟩ diff --git a/Mathlib/Order/Interval/Finset/Defs.lean b/Mathlib/Order/Interval/Finset/Defs.lean index 8eb21b9f6320a4..6812c6a1d19b51 100644 --- a/Mathlib/Order/Interval/Finset/Defs.lean +++ b/Mathlib/Order/Interval/Finset/Defs.lean @@ -169,7 +169,7 @@ class LocallyFiniteOrderBot (α : Type*) [Preorder α] where /-- A constructor from a definition of `Finset.Icc` alone, the other ones being derived by removing the ends. As opposed to `LocallyFiniteOrder.ofIcc`, this one requires `DecidableLE` but only `Preorder`. -/ -@[implicit_reducible] +@[instance_reducible] def LocallyFiniteOrder.ofIcc' (α : Type*) [Preorder α] [DecidableLE α] (finsetIcc : α → α → Finset α) (mem_Icc : ∀ a b x, x ∈ finsetIcc a b ↔ a ≤ x ∧ x ≤ b) : LocallyFiniteOrder α where @@ -186,7 +186,7 @@ def LocallyFiniteOrder.ofIcc' (α : Type*) [Preorder α] [DecidableLE α] /-- A constructor from a definition of `Finset.Icc` alone, the other ones being derived by removing the ends. As opposed to `LocallyFiniteOrder.ofIcc'`, this one requires `PartialOrder` but only `DecidableEq`. -/ -@[implicit_reducible] +@[instance_reducible] def LocallyFiniteOrder.ofIcc (α : Type*) [PartialOrder α] [DecidableEq α] (finsetIcc : α → α → Finset α) (mem_Icc : ∀ a b x, x ∈ finsetIcc a b ↔ a ≤ x ∧ x ≤ b) : LocallyFiniteOrder α where @@ -203,7 +203,7 @@ def LocallyFiniteOrder.ofIcc (α : Type*) [PartialOrder α] [DecidableEq α] /-- A constructor from a definition of `Finset.Ici` alone, the other ones being derived by removing the ends. As opposed to `LocallyFiniteOrderTop.ofIci`, this one requires `DecidableLE` but only `Preorder`. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- A constructor from a definition of `Finset.Iic` alone, the other ones being derived by removing the ends. As opposed to `LocallyFiniteOrderBot.ofIic`, this one requires `DecidableLE` but only `Preorder`. -/] @@ -218,7 +218,7 @@ def LocallyFiniteOrderTop.ofIci' (α : Type*) [Preorder α] [DecidableLE α] /-- A constructor from a definition of `Finset.Ici` alone, the other ones being derived by removing the ends. As opposed to `LocallyFiniteOrderTop.ofIci'`, this one requires `PartialOrder` but only `DecidableEq`. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- A constructor from a definition of `Finset.Iic` alone, the other ones being derived by removing the ends. As opposed to `LocallyFiniteOrderBot.ofIic'`, this one requires `PartialOrder` but only `DecidableEq`. -/] @@ -555,7 +555,7 @@ section Preorder variable [Preorder α] [Preorder β] /-- A noncomputable constructor from the finiteness of all closed intervals. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def LocallyFiniteOrder.ofFiniteIcc (h : ∀ a b : α, (Set.Icc a b).Finite) : LocallyFiniteOrder α := @LocallyFiniteOrder.ofIcc' α _ (Classical.decRel _) (fun a b => (h a b).toFinset) fun a b x => by @@ -612,7 +612,7 @@ instance : Subsingleton (LocallyFiniteOrderTop α) := -- Should this be called `LocallyFiniteOrder.lift`? /-- Given an order embedding `α ↪o β`, pulls back the `LocallyFiniteOrder` on `β` to `α`. -/ -@[implicit_reducible] +@[instance_reducible] protected noncomputable def OrderEmbedding.locallyFiniteOrder [LocallyFiniteOrder β] (f : α ↪o β) : LocallyFiniteOrder α where finsetIcc a b := (Icc (f a) (f b)).preimage f f.toEmbedding.injective.injOn diff --git a/Mathlib/Order/Interval/Finset/Fin.lean b/Mathlib/Order/Interval/Finset/Fin.lean index 9e0e5d705b0a65..83637368d55007 100644 --- a/Mathlib/Order/Interval/Finset/Fin.lean +++ b/Mathlib/Order/Interval/Finset/Fin.lean @@ -393,46 +393,55 @@ theorem finsetImage_cast_Iio (h : n = m) (i : Fin n) : ### `Finset.map` along `finCongr` -/ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Icc (h : n = m) (i j : Fin n) : (Icc i j).map (finCongr h).toEmbedding = Icc (i.cast h) (j.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Ico (h : n = m) (i j : Fin n) : (Ico i j).map (finCongr h).toEmbedding = Ico (i.cast h) (j.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Ioc (h : n = m) (i j : Fin n) : (Ioc i j).map (finCongr h).toEmbedding = Ioc (i.cast h) (j.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Ioo (h : n = m) (i j : Fin n) : (Ioo i j).map (finCongr h).toEmbedding = Ioo (i.cast h) (j.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_uIcc (h : n = m) (i j : Fin n) : (uIcc i j).map (finCongr h).toEmbedding = uIcc (i.cast h) (j.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Ici (h : n = m) (i : Fin n) : (Ici i).map (finCongr h).toEmbedding = Ici (i.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Ioi (h : n = m) (i : Fin n) : (Ioi i).map (finCongr h).toEmbedding = Ioi (i.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Iic (h : n = m) (i : Fin n) : (Iic i).map (finCongr h).toEmbedding = Iic (i.cast h) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_finCongr_Iio (h : n = m) (i : Fin n) : (Iio i).map (finCongr h).toEmbedding = Iio (i.cast h) := by @@ -577,35 +586,42 @@ theorem finsetImage_natAdd_Ioi (m) (i : Fin n) : (Ioi i).image (natAdd m) = Ioi ### `Finset.map` along `Fin.natAddEmb` -/ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_Icc (m) (i j : Fin n) : (Icc i j).map (natAddEmb m) = Icc (natAdd m i) (natAdd m j) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_Ico (m) (i j : Fin n) : (Ico i j).map (natAddEmb m) = Ico (natAdd m i) (natAdd m j) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_Ioc (m) (i j : Fin n) : (Ioc i j).map (natAddEmb m) = Ioc (natAdd m i) (natAdd m j) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_Ioo (m) (i j : Fin n) : (Ioo i j).map (natAddEmb m) = Ioo (natAdd m i) (natAdd m j) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_uIcc (m) (i j : Fin n) : (uIcc i j).map (natAddEmb m) = uIcc (natAdd m i) (natAdd m j) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_Ici (m) (i : Fin n) : (Ici i).map (natAddEmb m) = Ici (natAdd m i) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_natAddEmb_Ioi (m) (i : Fin n) : (Ioi i).map (natAddEmb m) = Ioi (natAdd m i) := by simp [← coe_inj] @@ -655,35 +671,42 @@ theorem finsetImage_addNat_Ioi (m) (i : Fin n) : (Ioi i).image (addNat · m) = I ### `Finset.map` along `Fin.addNatEmb` -/ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_Icc (m) (i j : Fin n) : (Icc i j).map (addNatEmb m) = Icc (i.addNat m) (j.addNat m) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_Ico (m) (i j : Fin n) : (Ico i j).map (addNatEmb m) = Ico (i.addNat m) (j.addNat m) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_Ioc (m) (i j : Fin n) : (Ioc i j).map (addNatEmb m) = Ioc (i.addNat m) (j.addNat m) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_Ioo (m) (i j : Fin n) : (Ioo i j).map (addNatEmb m) = Ioo (i.addNat m) (j.addNat m) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_uIcc (m) (i j : Fin n) : (uIcc i j).map (addNatEmb m) = uIcc (i.addNat m) (j.addNat m) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_Ici (m) (i : Fin n) : (Ici i).map (addNatEmb m) = Ici (i.addNat m) := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_addNatEmb_Ioi (m) (i : Fin n) : (Ioi i).map (addNatEmb m) = Ioi (i.addNat m) := by simp [← coe_inj] @@ -816,38 +839,47 @@ theorem finsetImage_rev_Iio (i : Fin n) : (Iio i).image rev = Ioi i.rev := by si ### `Finset.map` along `revPerm` -/ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Icc (i j : Fin n) : (Icc i j).map revPerm.toEmbedding = Icc j.rev i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Ico (i j : Fin n) : (Ico i j).map revPerm.toEmbedding = Ioc j.rev i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Ioc (i j : Fin n) : (Ioc i j).map revPerm.toEmbedding = Ico j.rev i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Ioo (i j : Fin n) : (Ioo i j).map revPerm.toEmbedding = Ioo j.rev i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_uIcc (i j : Fin n) : (uIcc i j).map revPerm.toEmbedding = uIcc i.rev j.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Ici (i : Fin n) : (Ici i).map revPerm.toEmbedding = Iic i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Ioi (i : Fin n) : (Ioi i).map revPerm.toEmbedding = Iio i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Iic (i : Fin n) : (Iic i).map revPerm.toEmbedding = Ici i.rev := by simp [← coe_inj] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_revPerm_Iio (i : Fin n) : (Iio i).map revPerm.toEmbedding = Ioi i.rev := by simp [← coe_inj] diff --git a/Mathlib/Order/Interval/Finset/Gaps.lean b/Mathlib/Order/Interval/Finset/Gaps.lean index 921d06491ca0b7..b08c7057fcf6e9 100644 --- a/Mathlib/Order/Interval/Finset/Gaps.lean +++ b/Mathlib/Order/Interval/Finset/Gaps.lean @@ -100,7 +100,7 @@ theorem intervalGapsWithin_mapsTo : (Set.Iio k).MapsTo intro j hj rw [mem_Iio] at hj simp only [intervalGapsWithin_snd_of_lt, intervalGapsWithin_succ_fst_of_lt, - Prod.mk.eta, SetLike.mem_coe, hj] + SetLike.mem_coe, hj] convert! F.orderEmbOfFin_mem h ⟨j, hj⟩ using 1 theorem intervalGapsWithin_injOn : (Set.Iio k).InjOn diff --git a/Mathlib/Order/Interval/Finset/Nat.lean b/Mathlib/Order/Interval/Finset/Nat.lean index 1430402996192c..e9602d0411c791 100644 --- a/Mathlib/Order/Interval/Finset/Nat.lean +++ b/Mathlib/Order/Interval/Finset/Nat.lean @@ -30,6 +30,7 @@ variable (a b c : ℕ) namespace Nat +set_option backward.isDefEq.respectTransparency false in instance instLocallyFiniteOrder : LocallyFiniteOrder ℕ where finsetIcc a b := ⟨List.range' a (b + 1 - a), List.nodup_range'⟩ finsetIco a b := ⟨List.range' a (b - a), List.nodup_range'⟩ diff --git a/Mathlib/Order/Interval/Set/InitialSeg.lean b/Mathlib/Order/Interval/Set/InitialSeg.lean index 5c92457ef9835a..df412c57cd4758 100644 --- a/Mathlib/Order/Interval/Set/InitialSeg.lean +++ b/Mathlib/Order/Interval/Set/InitialSeg.lean @@ -20,6 +20,7 @@ namespace Set variable {α : Type*} [Preorder α] {i j : α} +set_option backward.isDefEq.respectTransparency false in /-- `Iic j` is an initial segment. -/ @[simps] def initialSegIic (j : α) : Iic j ≤i α where @@ -44,6 +45,7 @@ lemma principalSegIio_apply (k : Iio j) : principalSegIio j k = k.1 := @[deprecated (since := "2026-04-12")] alias principalSegIio_toRelEmbedding := principalSegIio_apply +set_option backward.isDefEq.respectTransparency false in /-- If `i ≤ j`, then `Iic i` is an initial segment of `Iic j`. -/ @[simps] def initialSegIicIicOfLE (h : i ≤ j) : Iic i ≤i Iic j where @@ -52,6 +54,7 @@ def initialSegIicIicOfLE (h : i ≤ j) : Iic i ≤i Iic j where map_rel_iff' := by aesop mem_range_of_rel' x k h := ⟨⟨k.1, (Subtype.coe_le_coe.2 h.le).trans x.2⟩, rfl⟩ +set_option backward.isDefEq.respectTransparency false in /-- If `i ≤ j`, then `Iio i` is a principal segment of `Iic j`. -/ @[simps top] def principalSegIioIicOfLE (h : i ≤ j) : Iio i simp [*, s.last_mem] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem snoc_eraseLast_last {s : CompositionSeries X} (h : IsMaximal s.eraseLast.last s.last) : s.eraseLast.snoc s.last h = s := @@ -391,6 +394,7 @@ theorem eq_of_head_eq_head_of_last_eq_last_of_length_eq_zero {s₁ s₂ : Compos ext simp [*] +set_option backward.isDefEq.respectTransparency false in /-- Given a `CompositionSeries`, `s`, and an element `x` such that `x` is maximal inside `s.last` there is a series, `t`, such that `t.last = x`, `t.head = s.head` diff --git a/Mathlib/Order/KrullDimension.lean b/Mathlib/Order/KrullDimension.lean index 7053dd35d3f121..67cf3dc7cde7e1 100644 --- a/Mathlib/Order/KrullDimension.lean +++ b/Mathlib/Order/KrullDimension.lean @@ -137,6 +137,7 @@ lemma coheight_le_iff {a : α} {n : ℕ∞} : coheight a ≤ n ↔ ∀ ⦃p : LTSeries α⦄, a ≤ p.head → p.length ≤ n := by rw [coheight_eq, iSup₂_le_iff] +set_option backward.isDefEq.respectTransparency false in lemma height_le {a : α} {n : ℕ∞} (h : ∀ (p : LTSeries α), p.last = a → p.length ≤ n) : height a ≤ n := by apply height_le_iff.mpr @@ -192,6 +193,7 @@ lemma coheight_le {a : α} {n : ℕ∞} (h : ∀ (p : LTSeries α), p.head = a coheight a ≤ n := coheight_le_iff'.mpr h +set_option backward.isDefEq.respectTransparency false in lemma length_le_height {p : LTSeries α} {x : α} (hlast : p.last ≤ x) : p.length ≤ height x := by by_cases hlen0 : p.length ≠ 0 @@ -1007,6 +1009,7 @@ lemma coheight_int (n : ℤ) : coheight n = ⊤ := coheight_of_noMaxOrder .. lemma krullDim_int : krullDim ℤ = ⊤ := krullDim_of_noMaxOrder .. +set_option backward.isDefEq.respectTransparency false in @[simp] lemma height_coe_withBot (x : α) : height (x : WithBot α) = height x + 1 := by apply le_antisymm · apply height_le diff --git a/Mathlib/Order/Lattice.lean b/Mathlib/Order/Lattice.lean index 30b497c015d384..364f90ff3d37b8 100644 --- a/Mathlib/Order/Lattice.lean +++ b/Mathlib/Order/Lattice.lean @@ -100,7 +100,7 @@ join-semilattice. The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`. -/ -@[implicit_reducible] +@[instance_reducible] def SemilatticeSup.mk' {α : Type*} [Max α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a) (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (sup_idem : ∀ a : α, a ⊔ a = a) : SemilatticeSup α where @@ -119,7 +119,7 @@ meet-semilattice. The partial order is defined so that `a ≤ b` unfolds to `b ⊓ a = a`; cf. `inf_eq_right`. -/ -@[implicit_reducible] +@[instance_reducible] def SemilatticeInf.mk' {α : Type*} [Min α] (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a) (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (inf_idem : ∀ a : α, a ⊓ a = a) : SemilatticeInf α where @@ -373,7 +373,7 @@ laws relating the two operations has the structure of a lattice. The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`. -/ -@[implicit_reducible] +@[instance_reducible] def Lattice.mk' {α : Type*} [Max α] [Min α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a) (sup_assoc : ∀ a b c : α, a ⊔ b ⊔ c = a ⊔ (b ⊔ c)) (inf_comm : ∀ a b : α, a ⊓ b = b ⊓ a) (inf_assoc : ∀ a b c : α, a ⊓ b ⊓ c = a ⊓ (b ⊓ c)) (sup_inf_self : ∀ a b : α, a ⊔ a ⊓ b = a) diff --git a/Mathlib/Order/LiminfLimsup.lean b/Mathlib/Order/LiminfLimsup.lean index ced0b4283c41ca..f0d47b153aba55 100644 --- a/Mathlib/Order/LiminfLimsup.lean +++ b/Mathlib/Order/LiminfLimsup.lean @@ -444,6 +444,7 @@ theorem bliminf_congr' {f : Filter β} {p q : β → Prop} {u : β → α} (h : ∀ᶠ x in f, u x ≠ ⊤ → (p x ↔ q x)) : bliminf u f p = bliminf u f q := blimsup_congr' (α := αᵒᵈ) h +set_option backward.isDefEq.respectTransparency false in lemma HasBasis.blimsup_eq_iInf_iSup {p : ι → Prop} {s : ι → Set β} {f : Filter β} {u : β → α} (hf : f.HasBasis p s) {q : β → Prop} : blimsup u f q = ⨅ (i) (_ : p i), ⨆ a ∈ s i, ⨆ (_ : q a), u a := by diff --git a/Mathlib/Order/ModularLattice.lean b/Mathlib/Order/ModularLattice.lean index 4702db1d0bd2d3..65d8c0b321cc1d 100644 --- a/Mathlib/Order/ModularLattice.lean +++ b/Mathlib/Order/ModularLattice.lean @@ -220,6 +220,7 @@ theorem wellFounded_gt_exact_sequence {β γ : Type*} [Preorder β] [Preorder γ wellFounded_lt_exact_sequence (α := αᵒᵈ) (β := γᵒᵈ) (γ := βᵒᵈ) K g₁ g₂ f₁ f₂ gi.dual gci.dual hg hf +set_option backward.isDefEq.respectTransparency false in /-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/ @[simps] def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b) where diff --git a/Mathlib/Order/Monotone/Basic.lean b/Mathlib/Order/Monotone/Basic.lean index 28ca5109531328..6f5f7842929426 100644 --- a/Mathlib/Order/Monotone/Basic.lean +++ b/Mathlib/Order/Monotone/Basic.lean @@ -144,9 +144,11 @@ theorem monotone_dual_iff : Monotone (toDual ∘ f ∘ ofDual : αᵒᵈ → β theorem antitone_dual_iff : Antitone (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) ↔ Antitone f := by rw [antitone_toDual_comp_iff, monotone_comp_ofDual_iff] +set_option backward.isDefEq.respectTransparency false in theorem monotoneOn_dual_iff : MonotoneOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ MonotoneOn f s := by rw [monotoneOn_toDual_comp_iff, antitoneOn_comp_ofDual_iff] +set_option backward.isDefEq.respectTransparency false in theorem antitoneOn_dual_iff : AntitoneOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ AntitoneOn f s := by rw [antitoneOn_toDual_comp_iff, monotoneOn_comp_ofDual_iff] @@ -156,10 +158,12 @@ theorem strictMono_dual_iff : StrictMono (toDual ∘ f ∘ ofDual : αᵒᵈ → theorem strictAnti_dual_iff : StrictAnti (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) ↔ StrictAnti f := by rw [strictAnti_toDual_comp_iff, strictMono_comp_ofDual_iff] +set_option backward.isDefEq.respectTransparency false in theorem strictMonoOn_dual_iff : StrictMonoOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ StrictMonoOn f s := by rw [strictMonoOn_toDual_comp_iff, strictAntiOn_comp_ofDual_iff] +set_option backward.isDefEq.respectTransparency false in theorem strictAntiOn_dual_iff : StrictAntiOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ StrictAntiOn f s := by rw [strictAntiOn_toDual_comp_iff, strictMonoOn_comp_ofDual_iff] diff --git a/Mathlib/Order/OmegaCompletePartialOrder.lean b/Mathlib/Order/OmegaCompletePartialOrder.lean index 96885c5e6febc9..ed9556f046c8f0 100644 --- a/Mathlib/Order/OmegaCompletePartialOrder.lean +++ b/Mathlib/Order/OmegaCompletePartialOrder.lean @@ -244,7 +244,7 @@ lemma ωSup_eq_of_isLUB {c : Chain α} {a : α} (h : IsLUB (Set.range c) a) : a /-- A subset `p : α → Prop` of the type closed under `ωSup` induces an `OmegaCompletePartialOrder` on the subtype `{a : α // p a}`. -/ -@[implicit_reducible] +@[instance_reducible] def subtype {α : Type*} [OmegaCompletePartialOrder α] (p : α → Prop) (hp : ∀ c : Chain α, (∀ i ∈ c, p i) → p (ωSup c)) : OmegaCompletePartialOrder (Subtype p) := OmegaCompletePartialOrder.lift (OrderHom.Subtype.val p) diff --git a/Mathlib/Order/OrderDual.lean b/Mathlib/Order/OrderDual.lean index 5526530a62c3c4..b54748e384550d 100644 --- a/Mathlib/Order/OrderDual.lean +++ b/Mathlib/Order/OrderDual.lean @@ -85,6 +85,7 @@ instance (α : Type*) [LT α] [h : DecidableLT α] : DecidableLT (αᵒᵈ) := instance (α : Type*) [LE α] [h : DecidableLE α] : DecidableLE (αᵒᵈ) := fun a b ↦ h b a +set_option backward.isDefEq.respectTransparency false in instance (α : Type*) [LinearOrder α] : LinearOrder αᵒᵈ where le_total a b := le_total (α := α) b a min_def := max_def' (α := α) @@ -99,7 +100,7 @@ instance (α : Type*) [LinearOrder α] : LinearOrder αᵒᵈ where set_option linter.style.setOption false in set_option backward.inferInstanceAs.wrap.reuseSubInstances false in -- otherwise we get an identity! /-- The opposite linear order to a given linear order -/ -@[implicit_reducible, deprecated "This declaration shouldn't have existed" (since := "2026-04-08")] +@[instance_reducible, deprecated "This declaration shouldn't have existed" (since := "2026-04-08")] def _root_.LinearOrder.swap (α : Type*) (_ : LinearOrder α) : LinearOrder α := inferInstanceAs <| LinearOrder (OrderDual α) diff --git a/Mathlib/Order/OrderIsoNat.lean b/Mathlib/Order/OrderIsoNat.lean index aeb157c2b355e4..b7c7af7393ef92 100644 --- a/Mathlib/Order/OrderIsoNat.lean +++ b/Mathlib/Order/OrderIsoNat.lean @@ -117,6 +117,7 @@ theorem orderEmbeddingOfSet_apply [DecidablePred (· ∈ s)] {n : ℕ} : orderEmbeddingOfSet s n = Subtype.ofNat s n := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem Subtype.orderIsoOfNat_apply [dP : DecidablePred (· ∈ s)] {n : ℕ} : Subtype.orderIsoOfNat s n = Subtype.ofNat s n := by diff --git a/Mathlib/Order/PartialSups.lean b/Mathlib/Order/PartialSups.lean index 21e73fa49fdb86..ba84f81e3d5b53 100644 --- a/Mathlib/Order/PartialSups.lean +++ b/Mathlib/Order/PartialSups.lean @@ -132,6 +132,7 @@ protected lemma Pi.partialSups_apply {τ : Type*} {π : τ → Type*} [∀ t, Se partialSups f i t = partialSups (f · t) i := by simp only [partialSups_apply, Finset.sup'_apply] +set_option backward.isDefEq.respectTransparency false in lemma comp_partialSups {F : Type*} [FunLike F α β] [SupHomClass F α β] (f : ι → α) (g : F) : partialSups (g ∘ f) = g ∘ partialSups f := by funext _; simp [partialSups] diff --git a/Mathlib/Order/Partition/Finpartition.lean b/Mathlib/Order/Partition/Finpartition.lean index 0fc8a2a365f444..ff6c0fc818bcc4 100644 --- a/Mathlib/Order/Partition/Finpartition.lean +++ b/Mathlib/Order/Partition/Finpartition.lean @@ -733,6 +733,7 @@ def equivSigmaParts : s ≃ Σ t : P.parts, t.1 where rw [P.part_eq_of_mem mp mf] · simp +set_option backward.isDefEq.respectTransparency false in lemma exists_enumeration : ∃ f : s ≃ Σ t : P.parts, Fin #t.1, ∀ a b : s, P.part a = P.part b ↔ (f a).1 = (f b).1 := by use P.equivSigmaParts.trans ((Equiv.refl _).sigmaCongr (fun t ↦ t.1.equivFin)) diff --git a/Mathlib/Order/PiLex.lean b/Mathlib/Order/PiLex.lean index 11683b0a6d28d9..ab7f58a6207aa5 100644 --- a/Mathlib/Order/PiLex.lean +++ b/Mathlib/Order/PiLex.lean @@ -75,7 +75,7 @@ theorem trichotomous_lex [∀ i, Std.Trichotomous (α := β i) s] (wf : WellFoun by_contra! h rw [Function.ne_iff] at h let i := wf.min {i | a i ≠ b i} h - have hri j (hr : r j i) : a j = b j := not_not.mp (wf.not_lt_min _ · hr) + have hri j (hr : r j i) : a j = b j := not_not.mp (fun h => wf.not_lt_min _ (by grind) hr) have := Std.Trichotomous.trichotomous (a i) (b i) (hab ⟨i, hri, ·⟩) exact hba ⟨i, (hri · · |>.symm), Not.imp_symm this <| wf.min_mem {i | a i ≠ b i} h⟩ } @@ -121,6 +121,7 @@ instance Lex.isStrictOrder [LinearOrder ι] [∀ a, PartialOrder (β a)] : ⟨N₁, fun j hj => (lt_N₁ _ hj).trans (lt_N₂ _ hj), a_lt_b.trans b_lt_c⟩, ⟨N₂, fun j hj => (lt_N₁ _ (hj.trans H)).trans (lt_N₂ _ hj), (lt_N₁ _ H).symm ▸ b_lt_c⟩] +set_option backward.isDefEq.respectTransparency.types false in instance Colex.isStrictOrder [LinearOrder ι] [∀ a, PartialOrder (β a)] : IsStrictOrder (Colex (∀ i, β i)) (· < ·) := Lex.isStrictOrder (ι := ιᵒᵈ) @@ -137,6 +138,7 @@ noncomputable instance Lex.linearOrder [LinearOrder ι] [WellFoundedLT ι] @linearOrderOfSTO (Πₗ i, β i) (· < ·) { trichotomous := (trichotomous_lex _ _ IsWellFounded.wf).1 } (Classical.decRel _) +set_option backward.isDefEq.respectTransparency.types false in /-- `Colex (∀ i, α i)` is a linear order if the original order has well-founded `>`. -/ noncomputable instance Colex.linearOrder [LinearOrder ι] [WellFoundedGT ι] [∀ a, LinearOrder (β a)] : LinearOrder (Colex (∀ i, β i)) := @@ -214,24 +216,30 @@ end Lex section Colex variable [WellFoundedGT ι] +set_option backward.isDefEq.respectTransparency.types false in theorem toColex_monotone : Monotone (@toColex (∀ i, β i)) := toLex_monotone (ι := ιᵒᵈ) +set_option backward.isDefEq.respectTransparency.types false in theorem toColex_strictMono : StrictMono (@toColex (∀ i, β i)) := toLex_strictMono (ι := ιᵒᵈ) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem lt_toColex_update_self_iff : toColex x < toColex (update x i a) ↔ x i < a := lt_toLex_update_self_iff (ι := ιᵒᵈ) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toColex_update_lt_self_iff : toColex (update x i a) < toColex x ↔ a < x i := toLex_update_lt_self_iff (ι := ιᵒᵈ) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem le_toColex_update_self_iff : toColex x ≤ toColex (update x i a) ↔ x i ≤ a := le_toLex_update_self_iff (ι := ιᵒᵈ) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem toColex_update_le_self_iff : toColex (update x i a) ≤ toColex x ↔ a ≤ x i := toLex_update_le_self_iff (ι := ιᵒᵈ) @@ -291,6 +299,7 @@ instance [LinearOrder ι] [WellFoundedLT ι] [∀ a, PartialOrder (β a)] instance [LinearOrder ι] [WellFoundedGT ι] [∀ a, PartialOrder (β a)] [∀ a, BoundedOrder (β a)] : BoundedOrder (Colex (∀ a, β a)) where +set_option backward.isDefEq.respectTransparency.types false in instance [Preorder ι] [∀ i, LT (β i)] [∀ i, DenselyOrdered (β i)] : DenselyOrdered (Lex (∀ i, β i)) := ⟨by @@ -305,10 +314,12 @@ instance [Preorder ι] [∀ i, LT (β i)] [∀ i, DenselyOrdered (β i)] : · rw [Function.update_of_ne hj.ne a] · rwa [Function.update_self i a]⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [Preorder ι] [∀ i, LT (β i)] [∀ i, DenselyOrdered (β i)] : DenselyOrdered (Colex (∀ i, β i)) := inferInstanceAs (DenselyOrdered (Lex (∀ i : ιᵒᵈ, β (OrderDual.toDual i)))) +set_option backward.isDefEq.respectTransparency.types false in theorem Lex.noMaxOrder' [Preorder ι] [∀ i, LT (β i)] (i : ι) [NoMaxOrder (β i)] : NoMaxOrder (Lex (∀ i, β i)) := ⟨fun a => by @@ -317,6 +328,7 @@ theorem Lex.noMaxOrder' [Preorder ι] [∀ i, LT (β i)] (i : ι) [NoMaxOrder ( exact ⟨Function.update a i b, i, fun j hj => (Function.update_of_ne hj.ne b a).symm, by rwa [Function.update_self i b]⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem Colex.noMaxOrder' [Preorder ι] [∀ i, LT (β i)] (i : ι) [NoMaxOrder (β i)] : NoMaxOrder (Colex (∀ i, β i)) := Lex.noMaxOrder' (ι := ιᵒᵈ) i @@ -327,6 +339,7 @@ instance [LinearOrder ι] [WellFoundedLT ι] [Nonempty ι] [∀ i, PartialOrder let ⟨_, hb⟩ := exists_gt (ofLex a) ⟨_, toLex_strictMono hb⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [LinearOrder ι] [WellFoundedGT ι] [Nonempty ι] [∀ i, PartialOrder (β i)] [∀ i, NoMaxOrder (β i)] : NoMaxOrder (Colex (∀ i, β i)) := inferInstanceAs (NoMaxOrder (Lex (∀ i : ιᵒᵈ, β (OrderDual.toDual i)))) @@ -337,6 +350,7 @@ instance [LinearOrder ι] [WellFoundedLT ι] [Nonempty ι] [∀ i, PartialOrder let ⟨_, hb⟩ := exists_lt (ofLex a) ⟨_, toLex_strictMono hb⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in instance [LinearOrder ι] [WellFoundedGT ι] [Nonempty ι] [∀ i, PartialOrder (β i)] [∀ i, NoMinOrder (β i)] : NoMinOrder (Colex (∀ i, β i)) := inferInstanceAs (NoMinOrder (Lex (∀ i : ιᵒᵈ, β (OrderDual.toDual i)))) diff --git a/Mathlib/Order/RelClasses.lean b/Mathlib/Order/RelClasses.lean index d91f6c50cd389b..c132c2158239d7 100644 --- a/Mathlib/Order/RelClasses.lean +++ b/Mathlib/Order/RelClasses.lean @@ -310,7 +310,7 @@ theorem fix_eq {motive : α → Sort*} (ind : ∀ x : α, (∀ y : α, y < x → IsWellFounded.fix_eq _ ind /-- Derive a `WellFoundedRelation` instance from a `WellFoundedLT` instance. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- Derive a `WellFoundedRelation` instance from a `WellFoundedGT` instance. -/] def toWellFoundedRelation : WellFoundedRelation α := IsWellFounded.toWellFoundedRelation (· < ·) @@ -319,7 +319,7 @@ end WellFoundedLT open Classical in /-- Construct a decidable linear order from a well-founded linear order. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsWellOrder.linearOrder (r : α → α → Prop) [IsWellOrder α r] : LinearOrder α := linearOrderOfSTO r diff --git a/Mathlib/Order/RelSeries.lean b/Mathlib/Order/RelSeries.lean index 01a34f7302ff15..609aa90e54c5df 100644 --- a/Mathlib/Order/RelSeries.lean +++ b/Mathlib/Order/RelSeries.lean @@ -120,6 +120,7 @@ def fromListIsChain (x : List α) (x_ne_nil : x ≠ []) (hx : x.IsChain (· ~[r] toFun i := x[Fin.cast (Nat.succ_pred_eq_of_pos <| List.length_pos_iff.mpr x_ne_nil) i] step i := List.isChain_iff_getElem.mp hx i _ +set_option backward.isDefEq.respectTransparency false in /-- Relation series of `r` and nonempty list of `α` satisfying `r`-chain condition bijectively corresponds to each other. -/ protected def Equiv : RelSeries r ≃ {x : List α | x ≠ [] ∧ x.IsChain (· ~[r] ·)} where @@ -271,6 +272,7 @@ lemma toList_fromListIsChain (l : List α) (l_ne_nil : l ≠ []) (hl : l.IsChain (fromListIsChain l l_ne_nil hl).toList = l := Subtype.ext_iff.mp <| RelSeries.Equiv.right_inv ⟨l, ⟨l_ne_nil, hl⟩⟩ +set_option backward.isDefEq.respectTransparency false in @[simp] lemma head_fromListIsChain (l : List α) (l_ne_nil : l ≠ []) (hl : l.IsChain (· ~[r] ·)) : (fromListIsChain l l_ne_nil hl).head = l.head l_ne_nil := by @@ -341,6 +343,7 @@ lemma append_apply_right (p q : RelSeries r) (connect : p.last ~[r] q.head) append_apply_left p q connect 0 set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma last_append (p q : RelSeries r) (connect : p.last ~[r] q.head) : (p.append q connect).last = q.last := by delta last @@ -349,6 +352,7 @@ set_option backward.defeqAttrib.useBackward true in dsimp lia +set_option backward.isDefEq.respectTransparency false in lemma append_assoc (p q w : RelSeries r) (hpq : p.last ~[r] q.head) (hqw : q.last ~[r] w.head) : (p.append q hpq).append w (by simpa) = p.append (q.append w hqw) (by simpa) := by ext @@ -357,6 +361,7 @@ lemma append_assoc (p q w : RelSeries r) (hpq : p.last ~[r] q.head) (hqw : q.las · simp [append, Fin.append_assoc] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma toList_append (p q : RelSeries r) (connect : p.last ~[r] q.head) : (p.append q connect).toList = p.toList ++ q.toList := by @@ -381,6 +386,7 @@ def map (p : RelSeries r) (f : r.Hom s) : RelSeries s where @[simp] lemma last_map (p : RelSeries r) (f : r.Hom s) : (p.map f).last = f p.last := rfl +set_option backward.isDefEq.respectTransparency false in /-- If `a₀ -r→ a₁ -r→ ... -r→ aₙ` is an `r`-series and `a` is such that `aᵢ -r→ a -r→ a_ᵢ₊₁`, then @@ -469,6 +475,7 @@ set_option backward.isDefEq.respectTransparency false in simp [RelSeries.last, RelSeries.head] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma reverse_reverse {r : SetRel α α} (p : RelSeries r) : p.reverse.reverse = p := by ext <;> simp @@ -483,11 +490,13 @@ def cons (p : RelSeries r) (newHead : α) (rel : newHead ~[r] p.head) : RelSerie @[simp] lemma head_cons (p : RelSeries r) (newHead : α) (rel : newHead ~[r] p.head) : (p.cons newHead rel).head = newHead := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma last_cons (p : RelSeries r) (newHead : α) (rel : newHead ~[r] p.head) : (p.cons newHead rel).last = p.last := by delta cons rw [last_append] +set_option backward.isDefEq.respectTransparency false in lemma cons_cast_succ (s : RelSeries r) (a : α) (h : a ~[r] s.head) (i : Fin (s.length + 1)) : (s.cons a h) (.cast (by simp) (.succ i)) = s i := by simp [cons, Fin.append, Fin.addCases, Fin.subNat] @@ -497,6 +506,7 @@ lemma append_singleton_left (p : RelSeries r) (x : α) (hx : x ~[r] p.head) : (singleton r x).append p hx = p.cons x hx := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma toList_cons (p : RelSeries r) (x : α) (hx : x ~[r] p.head) : (p.cons x hx).toList = x :: p.toList := by @@ -510,6 +520,7 @@ lemma fromListIsChain_cons (l : List α) (l_ne_nil : l ≠ []) apply toList_injective simp +set_option backward.isDefEq.respectTransparency false in lemma append_cons {p q : RelSeries r} {x : α} (hx : x ~[r] p.head) (hq : p.last ~[r] q.head) : (p.cons x hx).append q (by simpa) = (p.append q hq).cons x (by simpa) := by simp only [cons] @@ -523,6 +534,7 @@ a series of length `n+1`: `a₀ -r→ a₁ -r→ ... -r→ aₙ -r→ a`. def snoc (p : RelSeries r) (newLast : α) (rel : p.last ~[r] newLast) : RelSeries r := p.append (singleton r newLast) rel +set_option backward.isDefEq.respectTransparency false in @[simp] lemma head_snoc (p : RelSeries r) (newLast : α) (rel : p.last ~[r] newLast) : (p.snoc newLast rel).head = p.head := by delta snoc; rw [head_append] @@ -544,6 +556,7 @@ lemma snoc_cast_castSucc (s : RelSeries r) (a : α) (h : s.last ~[r] a) (i : Fin (i : Fin (s.length + 1)) : snoc s a connect (Fin.castSucc i) = s i := Fin.append_left _ _ i +set_option backward.isDefEq.respectTransparency false in lemma mem_snoc {p : RelSeries r} {newLast : α} {rel : p.last ~[r] newLast} {x : α} : x ∈ p.snoc newLast rel ↔ x ∈ p ∨ x = newLast := by simp only [snoc, append, mem_def, Set.mem_range] @@ -579,10 +592,11 @@ def tail (p : RelSeries r) (len_pos : p.length ≠ 0) : RelSeries r where change p _ = p _ congr ext - simp only [tail_length, Fin.val_succ, Fin.val_cast, Fin.val_last] + simp only [Fin.val_succ, Fin.val_last] exact Nat.succ_pred_eq_of_pos (by simpa [Nat.pos_iff_ne_zero] using len_pos) set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma toList_tail {p : RelSeries r} (hp : p.length ≠ 0) : (p.tail hp).toList = p.toList.tail := by refine List.ext_getElem ?_ fun i h1 h2 ↦ ?_ @@ -601,6 +615,7 @@ lemma cons_self_tail {p : RelSeries r} (hp : p.length ≠ 0) : apply toList_injective simp [← head_toList] +set_option backward.isDefEq.respectTransparency false in /-- To show a proposition `p` for `xs : RelSeries r` it suffices to show it for all singletons and to show that when `p` holds for `xs` it also holds for `xs` prepended with one element. @@ -630,6 +645,7 @@ def inductionOn (motive : RelSeries r → Sort*) exact (p.cons_self_tail (heq ▸ d.zero_ne_add_one.symm)).symm exact this rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma toList_snoc (p : RelSeries r) (newLast : α) (rel : p.last ~[r] newLast) : (p.snoc newLast rel).toList = p.toList ++ [newLast] := by @@ -649,6 +665,7 @@ def eraseLast (p : RelSeries r) : RelSeries r where @[simp] lemma last_eraseLast (p : RelSeries r) : p.eraseLast.last = p ⟨p.length.pred, Nat.lt_succ_iff.2 (Nat.pred_le _)⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- In a non-trivial series `p`, the last element of `p.eraseLast` is related to `p.last` -/ lemma eraseLast_last_rel_last (p : RelSeries r) (h : p.length ≠ 0) : p.eraseLast.last ~[r] p.last := by @@ -656,6 +673,7 @@ lemma eraseLast_last_rel_last (p : RelSeries r) (h : p.length ≠ 0) : convert! p.step ⟨p.length - 1, by lia⟩ simp only [Fin.succ_mk]; lia +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma toList_eraseLast (p : RelSeries r) (hp : p.length ≠ 0) : p.eraseLast.toList = p.toList.dropLast := by @@ -669,6 +687,7 @@ lemma snoc_self_eraseLast (p : RelSeries r) (h : p.length ≠ 0) : apply toList_injective rw [toList_snoc, ← getLast_toList, toList_eraseLast _ h, List.dropLast_append_getLast] +set_option backward.isDefEq.respectTransparency false in /-- To show a proposition `p` for `xs : RelSeries r` it suffices to show it for all singletons and to show that when `p` holds for `xs` it also holds for `xs` appended with one element. @@ -911,6 +930,7 @@ def mk (length : ℕ) (toFun : Fin (length + 1) → α) (strictMono : StrictMono step i := strictMono <| lt_add_one i.1 set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- An injection from the type of strictly monotone functions with limited length to `LTSeries`. -/ def injStrictMono (n : ℕ) : {f : (l : Fin n) × (Fin (l + 1) → α) // StrictMono f.2} ↪ LTSeries α where @@ -1000,6 +1020,7 @@ theorem exists_relSeries_covBy simp [RelSeries.smash_castLE] all_goals simp [Fin.snoc, Fin.castPred_zero, hi₁] +set_option backward.isDefEq.respectTransparency false in theorem exists_relSeries_covBy_and_head_eq_bot_and_last_eq_bot {α} [PartialOrder α] [BoundedOrder α] [WellFoundedLT α] [WellFoundedGT α] (s : LTSeries α) : ∃ (t : RelSeries {(a, b) : α × α | a ⋖ b}) (i : Fin (s.length + 1) ↪ Fin (t.length + 1)), diff --git a/Mathlib/Order/Sublocale.lean b/Mathlib/Order/Sublocale.lean index 7b7dc841703f19..5c0419d8c0a4e6 100644 --- a/Mathlib/Order/Sublocale.lean +++ b/Mathlib/Order/Sublocale.lean @@ -121,6 +121,7 @@ private def restrictAux (S : Sublocale X) (a : X) : S := sInf {s : S | a ≤ s} private lemma le_restrictAux : a ≤ S.restrictAux a := by simp +contextual [restrictAux] +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in /-- See `Sublocale.giRestrict` for the public-facing version. -/ private def giAux (S : Sublocale X) : GaloisInsertion S.restrictAux Subtype.val where @@ -214,6 +215,7 @@ lemma mem_toSublocale {n : Nucleus X} {x : X} : x ∈ n.toSublocale ↔ ∃ y, n end Nucleus +set_option backward.isDefEq.respectTransparency false in /-- The nuclei on a frame corresponds exactly to the sublocales on this frame. The sublocales are ordered dually to the nuclei. -/ def nucleusIsoSublocale : (Nucleus X)ᵒᵈ ≃o Sublocale X where @@ -230,6 +232,7 @@ lemma nucleusIsoSublocale.symm_eq_toNucleus : instance Sublocale.instCompleteLattice : CompleteLattice (Sublocale X) := nucleusIsoSublocale.toGaloisInsertion.liftCompleteLattice +set_option backward.isDefEq.respectTransparency false in instance Sublocale.instCoframeMinimalAxioms : Order.Coframe.MinimalAxioms (Sublocale X) where iInf_sup_le_sup_sInf a s := by simp [← toNucleus_le_toNucleus, nucleusIsoSublocale.symm_eq_toNucleus, nucleusIsoSublocale.symm.map_sup, diff --git a/Mathlib/Order/SuccPred/Basic.lean b/Mathlib/Order/SuccPred/Basic.lean index 6536f5edf298ea..f84e3c3b6ac1ee 100644 --- a/Mathlib/Order/SuccPred/Basic.lean +++ b/Mathlib/Order/SuccPred/Basic.lean @@ -83,7 +83,7 @@ section Preorder variable [Preorder α] /-- A constructor for `SuccOrder α` usable when `α` has no maximal element. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- A constructor for `PredOrder α` usable when `α` has no minimal element. -/] def SuccOrder.ofSuccLeIff (succ : α → α) (hsucc_le_iff : ∀ {a b}, succ a ≤ b ↔ a < b) : SuccOrder α where @@ -99,7 +99,7 @@ section LinearOrder variable [LinearOrder α] /-- A constructor for `SuccOrder α` for `α` a linear order. -/ -@[to_dual (attr := simps, implicit_reducible) +@[to_dual (attr := simps, instance_reducible) /-- A constructor for `PredOrder α` for `α` a linear order. -/] def SuccOrder.ofCore (succ : α → α) (hn : ∀ {a}, ¬IsMax a → ∀ b, a < b ↔ succ a ≤ b) (hm : ∀ a, IsMax a → succ a = a) : SuccOrder α where @@ -110,9 +110,10 @@ def SuccOrder.ofCore (succ : α → α) (hn : ∀ {a}, ¬IsMax a → ∀ b, a < variable (α) +set_option backward.isDefEq.respectTransparency false in open Classical in /-- A well-order is a `SuccOrder`. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- A linear order with well-founded greater-than relation is a `PredOrder`. -/] noncomputable def SuccOrder.ofLinearWellFoundedLT [WellFoundedLT α] : SuccOrder α := ofCore (fun a ↦ if h : (Ioi a).Nonempty then wellFounded_lt.min _ h else a) @@ -899,12 +900,14 @@ noncomputable instance Set.OrdConnected.succOrder [SuccOrder α] : letI : PredOrder sᵒᵈ := inferInstanceAs (PredOrder (OrderDual.ofDual ⁻¹' s)) inferInstanceAs (SuccOrder sᵒᵈᵒᵈ) +set_option backward.isDefEq.respectTransparency false in @[simp, norm_cast] lemma coe_succ_of_mem [SuccOrder α] {a : s} (h : succ ↑a ∈ s) : (succ a).1 = succ ↑a := by classical change Subtype.val (dite ..) = _ split_ifs <;> trivial +set_option backward.isDefEq.respectTransparency false in lemma isMax_of_succ_notMem [SuccOrder α] {a : s} (h : succ ↑a ∉ s) : IsMax a := by classical rw [← succ_eq_iff_isMax] diff --git a/Mathlib/Order/SuccPred/CompleteLinearOrder.lean b/Mathlib/Order/SuccPred/CompleteLinearOrder.lean index 218f8cf3801e0d..4ce61b9f8f9376 100644 --- a/Mathlib/Order/SuccPred/CompleteLinearOrder.lean +++ b/Mathlib/Order/SuccPred/CompleteLinearOrder.lean @@ -62,7 +62,7 @@ lemma IsGLB.exists_of_nonempty_of_not_isPredPrelimit open Classical in /-- Every conditionally complete linear order with well-founded `<` is a successor order, by setting the successor of an element to be the infimum of all larger elements. -/ -@[implicit_reducible, deprecated SuccOrder.ofLinearWellFoundedLT (since := "2026-04-12")] +@[instance_reducible, deprecated SuccOrder.ofLinearWellFoundedLT (since := "2026-04-12")] noncomputable def ConditionallyCompleteLinearOrder.toSuccOrder [WellFoundedLT α] : SuccOrder α := .ofLinearWellFoundedLT _ diff --git a/Mathlib/Order/SuccPred/LinearLocallyFinite.lean b/Mathlib/Order/SuccPred/LinearLocallyFinite.lean index c4ff141f244e3d..20c07a049918b8 100644 --- a/Mathlib/Order/SuccPred/LinearLocallyFinite.lean +++ b/Mathlib/Order/SuccPred/LinearLocallyFinite.lean @@ -148,7 +148,7 @@ variable (ι) in /-- A locally finite order is a `SuccOrder`. This is not an instance, because its `succ` field conflicts with computable `SuccOrder` structures on `ℕ` and `ℤ`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def succOrder [LocallyFiniteOrder ι] : SuccOrder ι where succ := succFn le_succ := le_succFn @@ -159,7 +159,7 @@ variable (ι) in /-- A locally finite order is a `PredOrder`. This is not an instance, because its `succ` field conflicts with computable `PredOrder` structures on `ℕ` and `ℤ`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def predOrder [LocallyFiniteOrder ι] : PredOrder ι := letI := succOrder (ι := ιᵒᵈ) inferInstanceAs (PredOrder ιᵒᵈᵒᵈ) @@ -339,6 +339,7 @@ section OrderIso variable [SuccOrder ι] [PredOrder ι] [IsSuccArchimedean ι] +set_option backward.isDefEq.respectTransparency.types false in /-- `toZ` defines an `OrderIso` between `ι` and its range. -/ noncomputable def orderIsoRangeToZOfLinearSuccPredArch [hι : Nonempty ι] : ι ≃o Set.range (toZ hι.some) where @@ -350,6 +351,7 @@ instance (priority := 100) countable_of_linear_succ_pred_arch : Countable ι := · infer_instance · exact Countable.of_equiv _ orderIsoRangeToZOfLinearSuccPredArch.symm.toEquiv +set_option backward.isDefEq.respectTransparency.types false in /-- If the order has neither bot nor top, `toZ` defines an `OrderIso` between `ι` and `ℤ`. -/ noncomputable def orderIsoIntOfLinearSuccPredArch [NoMaxOrder ι] [NoMinOrder ι] [hι : Nonempty ι] : ι ≃o ℤ where @@ -373,6 +375,7 @@ noncomputable def orderIsoIntOfLinearSuccPredArch [NoMaxOrder ι] [NoMinOrder ι simp only [hn.le, Int.toNat_of_nonneg, Int.neg_nonneg_of_nonpos, Int.neg_neg] map_rel_iff' := by simp +set_option backward.isDefEq.respectTransparency false in /-- If the order has a bot but no top, `toZ` defines an `OrderIso` between `ι` and `ℕ`. -/ def orderIsoNatOfLinearSuccPredArch [NoMaxOrder ι] [OrderBot ι] : ι ≃o ℕ where toFun i := (toZ ⊥ i).toNat @@ -389,6 +392,7 @@ def orderIsoNatOfLinearSuccPredArch [NoMaxOrder ι] [OrderBot ι] : ι ≃o ℕ simp only [Equiv.coe_fn_mk, Int.toNat_le] rw [← toZ_le_toZ (i0 := (⊥ : ι)), Int.toNat_of_nonneg (toZ_nonneg bot_le)] +set_option backward.isDefEq.respectTransparency false in /-- If the order has both a bot and a top, `toZ` gives an `OrderIso` between `ι` and `Finset.range n` for some `n`. -/ def orderIsoRangeOfLinearSuccPredArch [OrderBot ι] [OrderTop ι] : diff --git a/Mathlib/Order/SupClosed.lean b/Mathlib/Order/SupClosed.lean index 085f024623b7af..46f19e6bce5663 100644 --- a/Mathlib/Order/SupClosed.lean +++ b/Mathlib/Order/SupClosed.lean @@ -483,6 +483,7 @@ lemma image_latticeClosure (s : Set α) (f : α → β) · rintro _ - _ - ⟨a, ha, rfl⟩ ⟨b, hb, rfl⟩ exact ⟨a ⊓ b, isSublattice_latticeClosure.infClosed ha hb, map_inf ..⟩ +set_option backward.isDefEq.respectTransparency false in lemma ofDual_preimage_latticeClosure (s : Set α) : ofDual ⁻¹' latticeClosure s = latticeClosure (ofDual ⁻¹' s) := by ext @@ -532,7 +533,7 @@ end DistribLattice /-- A join-semilattice where every sup-closed set has a least upper bound is automatically complete. -/ -@[implicit_reducible] +@[instance_reducible] def SemilatticeSup.toCompleteSemilatticeSup [SemilatticeSup α] (sSup : Set α → α) (h : ∀ s, SupClosed s → IsLUB s (sSup s)) : CompleteSemilatticeSup α where sSup := fun s => sSup (supClosure s) @@ -540,7 +541,7 @@ def SemilatticeSup.toCompleteSemilatticeSup [SemilatticeSup α] (sSup : Set α /-- A meet-semilattice where every inf-closed set has a greatest lower bound is automatically complete. -/ -@[implicit_reducible] +@[instance_reducible] def SemilatticeInf.toCompleteSemilatticeInf [SemilatticeInf α] (sInf : Set α → α) (h : ∀ s, InfClosed s → IsGLB s (sInf s)) : CompleteSemilatticeInf α where sInf := fun s => sInf (infClosure s) diff --git a/Mathlib/Order/Types/Defs.lean b/Mathlib/Order/Types/Defs.lean index 82c08e974b1ee4..9561500cb57c8e 100644 --- a/Mathlib/Order/Types/Defs.lean +++ b/Mathlib/Order/Types/Defs.lean @@ -49,7 +49,7 @@ variable {α β : Type u} [LinearOrder α] [LinearOrder β] {δ : Sort v} /-- Equivalence relation on linear orders on arbitrary types in universe `u`, given by order isomorphism. -/ -@[implicit_reducible] +@[instance_reducible] def OrderType.instSetoid : Setoid LinOrd where r := fun lin_ord₁ lin_ord₂ ↦ Nonempty (lin_ord₁ ≃o lin_ord₂) iseqv := ⟨fun _ ↦ ⟨.refl _⟩, fun ⟨e⟩ ↦ ⟨e.symm⟩, fun ⟨e₁⟩ ⟨e₂⟩ ↦ ⟨e₁.trans e₂⟩⟩ diff --git a/Mathlib/Order/UpperLower/Closure.lean b/Mathlib/Order/UpperLower/Closure.lean index c0ff7ff6e8e0b6..51822f9ec5afb4 100644 --- a/Mathlib/Order/UpperLower/Closure.lean +++ b/Mathlib/Order/UpperLower/Closure.lean @@ -193,7 +193,7 @@ variable [PartialOrder α] {s : Set α} {x : α} lemma IsAntichain.minimal_mem_upperClosure_iff_mem (hs : IsAntichain (· ≤ ·) s) : Minimal (· ∈ upperClosure s) x ↔ x ∈ s := by - simp only [upperClosure, UpperSet.mem_mk, mem_setOf_eq] + simp only [upperClosure] refine ⟨fun h ↦ ?_, fun h ↦ ⟨⟨x, h, rfl.le⟩, fun b ⟨a, has, hab⟩ hbx ↦ ?_⟩⟩ · obtain ⟨a, has, hax⟩ := h.prop rwa [h.eq_of_ge ⟨a, has, rfl.le⟩ hax] diff --git a/Mathlib/Order/UpperLower/CompleteLattice.lean b/Mathlib/Order/UpperLower/CompleteLattice.lean index 9d7b3c87b5881a..c8e9c7883c384a 100644 --- a/Mathlib/Order/UpperLower/CompleteLattice.lean +++ b/Mathlib/Order/UpperLower/CompleteLattice.lean @@ -335,6 +335,7 @@ def map (f : α ≃o β) : UpperSet α ≃o UpperSet β where right_inv _ := ext <| f.image_preimage _ map_rel_iff' := image_subset_image_iff f.injective +set_option backward.isDefEq.respectTransparency false in @[to_dual (attr := simp)] theorem symm_map (f : α ≃o β) : (map f).symm = map f.symm := by ext; simp [map, OrderIso.symm_apply_eq] diff --git a/Mathlib/Order/WellFounded.lean b/Mathlib/Order/WellFounded.lean index aa94d70693c099..2990690d2b3e09 100644 --- a/Mathlib/Order/WellFounded.lean +++ b/Mathlib/Order/WellFounded.lean @@ -359,7 +359,7 @@ theorem WellFounded.induction_bot {α} {r : α → α → Prop} (hwf : WellFound end Induction /-- A nonempty linear order with well-founded `<` has a bottom element. -/ -@[to_dual (attr := implicit_reducible) +@[to_dual (attr := instance_reducible) /-- A nonempty linear order with well-founded `>` has a top element. -/] noncomputable def WellFoundedLT.toOrderBot (α) [LinearOrder α] [Nonempty α] [h : WellFoundedLT α] : OrderBot α where diff --git a/Mathlib/Probability/Distributions/Fernique.lean b/Mathlib/Probability/Distributions/Fernique.lean index 1169d3975a23d1..6cd176b362f18a 100644 --- a/Mathlib/Probability/Distributions/Fernique.lean +++ b/Mathlib/Probability/Distributions/Fernique.lean @@ -373,6 +373,7 @@ lemma lintegral_closedBall_diff_exp_logRatio_mul_sq_le [IsProbabilityMeasure μ] simp only [Nat.cast_pow, Nat.cast_ofNat, ENNReal.toReal_div] ring +set_option backward.isDefEq.respectTransparency.types false in open Metric in lemma lintegral_exp_mul_sq_norm_le_mul [IsProbabilityMeasure μ] (h_rot : (μ.prod μ).map (ContinuousLinearMap.rotation (-(π / 4))) = μ.prod μ) diff --git a/Mathlib/Probability/Distributions/Gaussian/CharFun.lean b/Mathlib/Probability/Distributions/Gaussian/CharFun.lean index ae1c907ba4b830..82d54b8d6c3a54 100644 --- a/Mathlib/Probability/Distributions/Gaussian/CharFun.lean +++ b/Mathlib/Probability/Distributions/Gaussian/CharFun.lean @@ -141,6 +141,7 @@ lemma IsGaussian.charFun_eq' [IsGaussian μ] (t : E) : · exact IsGaussian.integrable_id · exact IsGaussian.memLp_two_id +set_option backward.isDefEq.respectTransparency.types false in /-- The measure `μ` is Gaussian if and only if there exist `m : E` and `f : E →L[ℝ] E →L[ℝ] ℝ` satisfying `f.toBilinForm.IsPosSemidef` and `charFun μ t = exp (⟪t, m⟫ * I - f t t / 2)`. -/ @@ -162,6 +163,7 @@ lemma isGaussian_iff_gaussian_charFun [IsFiniteMeasure μ] : · simp [charFun_eq_charFunDual_toDualMap, h, -InnerProductSpace.toContinuousLinearMap_toDualMap] · simp [← charFun_toDual_symm_eq_charFunDual, h] +set_option backward.isDefEq.respectTransparency.types false in /-- If the characteristic function of `μ` takes the form of a gaussian characteristic function, then the parameters have to be the expectation and the covariance bilinear form. -/ lemma gaussian_charFun_congr [IsFiniteMeasure μ] (m : E) (f : E →L[ℝ] E →L[ℝ] ℝ) diff --git a/Mathlib/Probability/Distributions/Gaussian/Real.lean b/Mathlib/Probability/Distributions/Gaussian/Real.lean index 15d942cbe71fd2..73b9c906c3379f 100644 --- a/Mathlib/Probability/Distributions/Gaussian/Real.lean +++ b/Mathlib/Probability/Distributions/Gaussian/Real.lean @@ -295,6 +295,7 @@ lemma gaussianReal_map_const_add (y : ℝ) : simp_rw [add_comm y] exact gaussianReal_map_add_const y +set_option backward.isDefEq.respectTransparency.types false in /-- The map of a Gaussian distribution by multiplication by a constant is a Gaussian. -/ lemma gaussianReal_map_const_mul (c : ℝ) : (gaussianReal μ v).map (c * ·) = gaussianReal (c * μ) (.mk (c ^ 2) (sq_nonneg _) * v) := by diff --git a/Mathlib/Probability/Distributions/Uniform.lean b/Mathlib/Probability/Distributions/Uniform.lean index 8b7c5c9ba316a5..b27b621d83ea8d 100644 --- a/Mathlib/Probability/Distributions/Uniform.lean +++ b/Mathlib/Probability/Distributions/Uniform.lean @@ -235,6 +235,7 @@ theorem uniformOfFinset_apply_of_mem (ha : a ∈ s) : uniformOfFinset s hs a = ( theorem uniformOfFinset_apply_of_notMem (ha : a ∉ s) : uniformOfFinset s hs a = 0 := by simp [ha] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem support_uniformOfFinset : (uniformOfFinset s hs).support = s := Set.ext diff --git a/Mathlib/Probability/Kernel/Composition/CompProd.lean b/Mathlib/Probability/Kernel/Composition/CompProd.lean index 399b39d718dd7c..4e4042ce94256a 100644 --- a/Mathlib/Probability/Kernel/Composition/CompProd.lean +++ b/Mathlib/Probability/Kernel/Composition/CompProd.lean @@ -86,6 +86,7 @@ theorem compProd_of_not_isSFiniteKernel_right (κ : Kernel α β) (η : Kernel ( κ ⊗ₖ η = 0 := by simp [compProd, h] +set_option backward.isDefEq.respectTransparency false in theorem compProd_apply (hs : MeasurableSet s) (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α) : (κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) (Prod.mk b ⁻¹' s) ∂κ a := by diff --git a/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean b/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean index 9f51f0ecb5e416..ddc1b92a3a98a3 100644 --- a/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean +++ b/Mathlib/Probability/Kernel/Disintegration/MeasurableStieltjes.lean @@ -191,6 +191,7 @@ lemma tendsto_defaultRatCDF_atBot : Tendsto defaultRatCDF atBot (𝓝 0) := by refine ⟨-1, fun q hq => (if_pos (hq.trans_lt ?_)).symm⟩ linarith +set_option backward.isDefEq.respectTransparency false in lemma iInf_rat_gt_defaultRatCDF (t : ℚ) : ⨅ r : Ioi t, defaultRatCDF r = defaultRatCDF t := by simp only [defaultRatCDF] @@ -290,6 +291,7 @@ lemma IsMeasurableRatCDF.stieltjesFunctionAux_unit_prod {f : α → ℚ → ℝ} variable {f : α → ℚ → ℝ} [MeasurableSpace α] (hf : IsMeasurableRatCDF f) include hf +set_option backward.isDefEq.respectTransparency false in lemma IsMeasurableRatCDF.stieltjesFunctionAux_eq (a : α) (r : ℚ) : IsMeasurableRatCDF.stieltjesFunctionAux f a r = f a r := by rw [← hf.iInf_rat_gt_eq a r, IsMeasurableRatCDF.stieltjesFunctionAux] diff --git a/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean b/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean index 83efa31050eeba..b0c4f3a7f4d977 100644 --- a/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean +++ b/Mathlib/Probability/Kernel/IonescuTulcea/Maps.lean @@ -89,6 +89,7 @@ lemma measurable_IicProdIoc {m n : ι} : Measurable (IicProdIoc (X := X) m n) := namespace MeasurableEquiv +set_option backward.isDefEq.respectTransparency false in /-- Gluing `Iic a` and `Ioc a b` into `Iic b`. This version requires `a ≤ b` to get a measurable equivalence. -/ def IicProdIoc {a b : ι} (hab : a ≤ b) : @@ -115,6 +116,7 @@ lemma coe_IicProdIoc_symm {a b : ι} (hab : a ≤ b) : ⇑(IicProdIoc (X := X) hab).symm = fun x ↦ (frestrictLe₂ hab x, restrict₂ Ioc_subset_Iic_self x) := rfl +set_option backward.isDefEq.respectTransparency false in /-- Gluing `Iic a` and `Ioi a` into `ℕ`, version as a measurable equivalence on dependent functions. -/ def IicProdIoi (a : ι) : @@ -142,6 +144,7 @@ section Nat variable {X : ℕ → Type*} [∀ n, MeasurableSpace (X n)] +set_option backward.isDefEq.respectTransparency false in /-- Identifying `{a + 1}` with `Ioc a (a + 1)`, as a measurable equiv on dependent functions. -/ def MeasurableEquiv.piSingleton (a : ℕ) : X (a + 1) ≃ᵐ Π i : Ioc a (a + 1), X i where toFun x i := (Nat.mem_Ioc_succ.1 i.2).symm ▸ x diff --git a/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean b/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean index 6d5e942b747a1c..595a2bf39787e4 100644 --- a/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean +++ b/Mathlib/Probability/Kernel/IonescuTulcea/PartialTraj.lean @@ -243,6 +243,7 @@ lemma partialTraj_eq_prod [∀ n, IsSFiniteKernel (κ n)] (a b : ℕ) : variable [∀ n, IsMarkovKernel (κ n)] +set_option backward.isDefEq.respectTransparency false in /-- The pushforward of `partialTraj κ a (a + 1)` along the the point at time `a + 1` is `κ a`. -/ lemma map_partialTraj_succ_self (a : ℕ) : (partialTraj κ a (a + 1)).map (fun x ↦ x ⟨a + 1, mem_Iic.2 le_rfl⟩) = κ a := by @@ -346,7 +347,7 @@ lemma lmarginalPartialTraj_succ [∀ n, IsSFiniteKernel (κ n)] (a : ℕ) rw [lmarginalPartialTraj, partialTraj_succ_self, lintegral_map, lintegral_id_prod, lintegral_map] · congrm ∫⁻ x, f (fun i ↦ ?_) ∂_ simp only [updateFinset, mem_Iic, IicProdIoc_def, frestrictLe_apply, piSingleton, - MeasurableEquiv.coe_mk, Equiv.coe_fn_mk, update] + MeasurableEquiv.coe_mk, update] split_ifs with h1 h2 h3 <;> try rfl all_goals lia all_goals fun_prop diff --git a/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean b/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean index e5c7bf015a6e5e..798e49785745c3 100644 --- a/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean +++ b/Mathlib/Probability/Kernel/IonescuTulcea/Traj.lean @@ -184,6 +184,8 @@ instance [∀ n, IsProbabilityMeasure (μ n)] (I : Finset ℕ) : rw [inducedFamily] exact Measure.isProbabilityMeasure_map (measurable_restrict₂ _).aemeasurable +-- TODO: `respectTransparency.types false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in /-- Given a family of measures `μ : (n : ℕ) → Measure (Π i : Iic n, X i)`, the induced family equals `μ` over the intervals `Iic n`. -/ theorem inducedFamily_Iic (n : ℕ) : inducedFamily μ (Iic n) = μ n := by @@ -594,6 +596,7 @@ theorem traj_eq_prod (a : ℕ) : all_goals fun_prop all_goals fun_prop +set_option backward.isDefEq.respectTransparency.types false in theorem traj_map_updateFinset {n : ℕ} (x : Π i : Iic n, X i) : (traj κ n x).map (updateFinset · (Iic n) x) = traj κ n x := by nth_rw 2 [traj_eq_prod] diff --git a/Mathlib/Probability/Kernel/MeasurableIntegral.lean b/Mathlib/Probability/Kernel/MeasurableIntegral.lean index 8e8545a71131ec..f8f57d4b942ec6 100644 --- a/Mathlib/Probability/Kernel/MeasurableIntegral.lean +++ b/Mathlib/Probability/Kernel/MeasurableIntegral.lean @@ -50,6 +50,7 @@ namespace MeasureTheory variable [NormedSpace ℝ E] +set_option backward.isDefEq.respectTransparency.types false in omit [IsSFiniteKernel κ] in theorem StronglyMeasurable.integral_kernel ⦃f : β → E⦄ (hf : StronglyMeasurable f) : StronglyMeasurable fun x ↦ ∫ y, f y ∂κ x := by @@ -74,6 +75,7 @@ theorem StronglyMeasurable.integral_kernel ⦃f : β → E⦄ exact subset_rfl · simp [f', hfx, integral_undef] +set_option backward.isDefEq.respectTransparency.types false in theorem StronglyMeasurable.integral_kernel_prod_right ⦃f : α → β → E⦄ (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun x => ∫ y, f x y ∂κ x := by classical diff --git a/Mathlib/Probability/Martingale/OptionalStopping.lean b/Mathlib/Probability/Martingale/OptionalStopping.lean index ffd7a0c4fa5013..e340024219f05b 100644 --- a/Mathlib/Probability/Martingale/OptionalStopping.lean +++ b/Mathlib/Probability/Martingale/OptionalStopping.lean @@ -37,6 +37,7 @@ namespace MeasureTheory variable {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {𝒢 : Filtration ℕ m0} {f : ℕ → Ω → ℝ} {τ π : Ω → ℕ∞} +set_option backward.isDefEq.respectTransparency.types false in /-- Given a submartingale `f` and bounded stopping times `τ` and `π` such that `τ ≤ π`, the expectation of `stoppedValue f τ` is less than or equal to the expectation of `stoppedValue f π`. This is the forward direction of the optional stopping theorem. -/ diff --git a/Mathlib/Probability/Moments/ComplexMGF.lean b/Mathlib/Probability/Moments/ComplexMGF.lean index e779d0be17f9b7..9a48e888c2ecc6 100644 --- a/Mathlib/Probability/Moments/ComplexMGF.lean +++ b/Mathlib/Probability/Moments/ComplexMGF.lean @@ -313,6 +313,7 @@ section ext variable {Ω' : Type*} {mΩ' : MeasurableSpace Ω'} {Y : Ω' → ℝ} {μ' : Measure Ω'} +set_option backward.isDefEq.respectTransparency.types false in /-- If the complex moment-generating functions of two random variables `X` and `Y` with respect to the finite measures `μ`, `μ'`, respectively, coincide, then `μ.map X = μ'.map Y`. In other words, complex moment-generating functions separate the distributions of random variables. -/ diff --git a/Mathlib/Probability/Moments/CovarianceBilin.lean b/Mathlib/Probability/Moments/CovarianceBilin.lean index 96ba36fdb87bff..a3271bda1e0f02 100644 --- a/Mathlib/Probability/Moments/CovarianceBilin.lean +++ b/Mathlib/Probability/Moments/CovarianceBilin.lean @@ -51,6 +51,7 @@ def covarianceBilin (μ : Measure E) : E →L[ℝ] E →L[ℝ] ℝ := ContinuousLinearMap.bilinearComp (covarianceBilinDual μ) (toDualMap ℝ E).toContinuousLinearMap (toDualMap ℝ E).toContinuousLinearMap +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma covarianceBilin_zero : covarianceBilin (0 : Measure E) = 0 := by rw [covarianceBilin] @@ -65,6 +66,7 @@ lemma covarianceBilin_of_not_memLp (h : ¬MemLp id 2 μ) : ext simp [covarianceBilin_eq_covarianceBilinDual, h] +set_option backward.isDefEq.respectTransparency.types false in lemma covarianceBilin_apply [CompleteSpace E] [IsFiniteMeasure μ] (h : MemLp id 2 μ) (x y : E) : covarianceBilin μ x y = ∫ z, ⟪x, z - μ[id]⟫ * ⟪y, z - μ[id]⟫ ∂μ := by simp [covarianceBilin, covarianceBilinDual_apply' h] @@ -97,6 +99,7 @@ lemma covarianceBilin_real_self {μ : Measure ℝ} [IsFiniteMeasure μ] (x : ℝ covarianceBilin μ x x = x ^ 2 * Var[id; μ] := by rw [covarianceBilin_real, pow_two] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma covarianceBilin_self_nonneg (x : E) : 0 ≤ covarianceBilin μ x x := by @@ -193,10 +196,12 @@ noncomputable def covarianceOperator (μ : Measure E) : E →L[ℝ] E := continuousLinearMapOfBilin <| ContinuousLinearMap.bilinearComp (uncenteredCovarianceBilinDual μ) (toDualMap ℝ E).toContinuousLinearMap (toDualMap ℝ E).toContinuousLinearMap +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma covarianceOperator_zero : covarianceOperator (0 : Measure E) = 0 := by simp [covarianceOperator] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma covarianceOperator_of_not_memLp (hμ : ¬MemLp id 2 μ) : covarianceOperator μ = 0 := by @@ -204,6 +209,7 @@ lemma covarianceOperator_of_not_memLp (hμ : ¬MemLp id 2 μ) : refine (unique_continuousLinearMapOfBilin _ fun y ↦ ?_).symm simp [hμ, uncenteredCovarianceBilinDual_of_not_memLp] +set_option backward.isDefEq.respectTransparency.types false in lemma covarianceOperator_inner (hμ : MemLp id 2 μ) (x y : E) : ⟪covarianceOperator μ x, y⟫ = ∫ z, ⟪x, z⟫ * ⟪y, z⟫ ∂μ := by simp [covarianceOperator, uncenteredCovarianceBilinDual_apply hμ] diff --git a/Mathlib/Probability/ProbabilityMassFunction/Monad.lean b/Mathlib/Probability/ProbabilityMassFunction/Monad.lean index 13abad136fb9ac..75f5e5ef6a3576 100644 --- a/Mathlib/Probability/ProbabilityMassFunction/Monad.lean +++ b/Mathlib/Probability/ProbabilityMassFunction/Monad.lean @@ -243,6 +243,7 @@ theorem pure_bindOnSupport (a : α) (f : ∀ (a' : α) (_ : a' ∈ (pure a).supp theorem bindOnSupport_pure (p : PMF α) : (p.bindOnSupport fun a _ => pure a) = p := by simp only [PMF.bind_pure, PMF.bindOnSupport_eq_bind] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem bindOnSupport_bindOnSupport (p : PMF α) (f : ∀ a ∈ p.support, PMF β) (g : ∀ b ∈ (p.bindOnSupport f).support, PMF γ) : diff --git a/Mathlib/Probability/Process/Filtration.lean b/Mathlib/Probability/Process/Filtration.lean index 17e0f30939b6f9..342d00c3fbc613 100644 --- a/Mathlib/Probability/Process/Filtration.lean +++ b/Mathlib/Probability/Process/Filtration.lean @@ -409,6 +409,7 @@ section open MeasurableSpace +set_option backward.isDefEq.respectTransparency.types false in theorem filtrationOfSet_eq_natural [∀ i, MulZeroOneClass (β i)] [∀ i, Nontrivial (β i)] {s : ι → Set Ω} (hsm : ∀ i, MeasurableSet[m] (s i)) : filtrationOfSet hsm = natural (fun i => (s i).indicator (fun _ => 1 : Ω → β i)) fun i => @@ -498,6 +499,7 @@ def piLE : @Filtration (Π i, X i) ι _ pi where variable [LocallyFiniteOrderBot ι] +set_option backward.isDefEq.respectTransparency.types false in lemma piLE_eq_comap_frestrictLe (i : ι) : piLE (X := X) i = pi.comap (frestrictLe i) := by apply le_antisymm · simp_rw [piLE, ← piCongrLeft_comp_frestrictLe, ← MeasurableEquiv.coe_piCongrLeft, ← comap_comp] diff --git a/Mathlib/Probability/Process/Predictable.lean b/Mathlib/Probability/Process/Predictable.lean index 77cc5d0db4b418..fa97f787dc1323 100644 --- a/Mathlib/Probability/Process/Predictable.lean +++ b/Mathlib/Probability/Process/Predictable.lean @@ -48,7 +48,7 @@ namespace Filtration /-- Given a filtration `𝓕`, the predictable σ-algebra is the σ-algebra on `ι × Ω` generated by sets of the form `(t, ∞) × A` for `t ∈ ι` and `A ∈ 𝓕 t` and `{⊥} × A` for `A ∈ 𝓕 ⊥`. -/ -@[implicit_reducible] +@[instance_reducible] def predictable [Preorder ι] [OrderBot ι] (𝓕 : Filtration ι m) : MeasurableSpace (ι × Ω) := MeasurableSpace.generateFrom <| {s | ∃ A, MeasurableSet[𝓕 ⊥] A ∧ s = {⊥} ×ˢ A} ∪ diff --git a/Mathlib/Probability/Process/Stopping.lean b/Mathlib/Probability/Process/Stopping.lean index a5bd5032c6a113..90b5ac925131a2 100644 --- a/Mathlib/Probability/Process/Stopping.lean +++ b/Mathlib/Probability/Process/Stopping.lean @@ -440,7 +440,7 @@ section Preorder variable [Preorder ι] {f : Filtration ι m} {τ π : Ω → WithTop ι} /-- The associated σ-algebra with a stopping time. -/ -@[implicit_reducible] +@[instance_reducible] protected def measurableSpace (hτ : IsStoppingTime f τ) : MeasurableSpace Ω where MeasurableSet' s := MeasurableSet s ∧ ∀ i : ι, MeasurableSet[f i] (s ∩ {ω | τ ω ≤ i}) measurableSet_empty := by simp @@ -1026,6 +1026,7 @@ section StoppedValueOfMemFinset variable [Nonempty ι] {μ : Measure Ω} {τ : Ω → WithTop ι} {E : Type*} {p : ℝ≥0∞} {u : ι → Ω → E} +set_option backward.isDefEq.respectTransparency.types false in theorem stoppedValue_eq_of_mem_finset [AddCommMonoid E] {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ (WithTop.some '' s)) : stoppedValue u τ = ∑ i ∈ s, Set.indicator {ω | τ ω = i} (u i) := by @@ -1247,7 +1248,7 @@ theorem stoppedValue_sub_eq_sum' [AddCommGroup β] (hle : τ ≤ π) {N : ℕ} ( simp only [Finset.sum_apply, Finset.sum_indicator_eq_sum_filter] refine Finset.sum_congr ?_ fun _ _ => rfl ext i - simp only [Finset.mem_filter, Set.mem_setOf_eq, Finset.mem_range, Finset.mem_Ico] + simp only [Set.mem_setOf_eq, Finset.mem_Ico] specialize hbdd ω lift τ ω to ℕ using hτ_top ω with t ht lift π ω to ℕ using hπ_top ω with b hb @@ -1271,6 +1272,7 @@ theorem stoppedValue_eq {N : ℕ} (hbdd : ∀ ω, τ ω ≤ N) : stoppedValue u exists_eq_right, gt_iff_lt] grind +set_option backward.isDefEq.respectTransparency.types false in theorem stoppedProcess_eq (n : ℕ) : stoppedProcess u τ n = Set.indicator {a | n ≤ τ a} (u n) + ∑ i ∈ Finset.range n, Set.indicator {ω | τ ω = i} (u i) := by rw [stoppedProcess_eq'' n] diff --git a/Mathlib/Probability/ProductMeasure.lean b/Mathlib/Probability/ProductMeasure.lean index fd74a8110084c3..d794815f67ec67 100644 --- a/Mathlib/Probability/ProductMeasure.lean +++ b/Mathlib/Probability/ProductMeasure.lean @@ -81,6 +81,7 @@ lemma piContent_cylinder {I : Finset ι} {S : Set (Π i : I, X i)} (hS : Measura piContent μ (cylinder I S) = Measure.pi (fun i : I ↦ μ i) S := projectiveFamilyContent_cylinder _ hS +set_option backward.isDefEq.respectTransparency.types false in theorem piContent_eq_measure_pi [Fintype ι] {s : Set (Π i, X i)} (hs : MeasurableSet s) : piContent μ s = Measure.pi μ s := by let e : @Finset.univ ι _ ≃ ι := @@ -257,6 +258,7 @@ lemma Measure.infinitePiNat_map_piCongrLeft (e : ℕ ≃ ι) {s : Set (Π i, X i any_goals fun_prop exact hS.preimage (by fun_prop) +set_option backward.isDefEq.respectTransparency.types false in /-- This is the key theorem to build the product of an arbitrary family of probability measures: the `piContent` of a decreasing sequence of cylinders with empty intersection converges to `0`. diff --git a/Mathlib/RepresentationTheory/Action.lean b/Mathlib/RepresentationTheory/Action.lean index 96ef0236cad67e..bfa016fcd2c842 100644 --- a/Mathlib/RepresentationTheory/Action.lean +++ b/Mathlib/RepresentationTheory/Action.lean @@ -154,6 +154,16 @@ lemma μ_comp_assoc : ((linearizeMap (α_ X Y Z).hom).comp TensorProduct.assoc_tmul, LinearMap.lTensor_tmul, toLinearMap_apply] -- after fixing the defeq problems in `Action` and in the monoidal category structure of `types` -- this line should close the goal so this is left as an indicator. + -- TODO: The previously used + -- `with_reducible dsimp% linearizeMap_single (α_ X Y Z).hom ((x, y), z) (1 : k)` + -- does not work anymore because it relied on a transparency bump for implicit outParam arguments. + -- This bump was not done pre-`respectTransparency true`. + -- Arguably, using `with_reducible` when we rely on things being bumped might not be the right + -- approach here? + -- with_reducible + -- have := linearizeMap_single (α_ X Y Z).hom ((x, y), z) (1 : k) + -- dsimp only [Action.tensorObj_V, types_tensorObj_def] at this + -- convert! this <;> simp with_reducible convert! dsimp% linearizeMap_single (α_ X Y Z).hom ((x, y), z) (1 : k) all_goals with_reducible simp @@ -233,6 +243,7 @@ end comm end LinearizeMonoidal +set_option backward.isDefEq.respectTransparency.types false in lemma linearizeTrivial_def (X : Type w) (g : G) : linearize k G (Action.trivial _ X) g = LinearMap.id := by ext (x : X) : 2 diff --git a/Mathlib/RepresentationTheory/Basic.lean b/Mathlib/RepresentationTheory/Basic.lean index c872f345fd9762..e7537ded351696 100644 --- a/Mathlib/RepresentationTheory/Basic.lean +++ b/Mathlib/RepresentationTheory/Basic.lean @@ -221,6 +221,7 @@ we have `Module k[G] (restrictScalars k k[G] M)`. -/ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ofModule_asAlgebraHom_apply_apply (r : k[G]) (m : RestrictScalars k k[G] M) : @@ -306,6 +307,7 @@ section Subrepresentation variable {k G V : Type*} [Semiring k] [Monoid G] [AddCommMonoid V] [Module k V] (ρ : Representation k G V) +set_option backward.isDefEq.respectTransparency false in /-- Given a `k`-linear `G`-representation `(V, ρ)`, this is the representation defined by restricting `ρ` to a `G`-invariant `k`-submodule of `V`. -/ @[simps] @@ -629,6 +631,7 @@ local notation ρV " ⊗ " ρW => tprod ρV ρW theorem tprod_apply (g : G) : (ρV ⊗ ρW) g = TensorProduct.map (ρV g) (ρW g) := rfl +set_option backward.isDefEq.respectTransparency false in theorem smul_tprod_one_asModule (r : k[G]) (x : V) (y : W) : r • (show (ρV.tprod 1).asModule from x ⊗ₜ y) = (r • show ρV.asModule from x) ⊗ₜ y := by change asAlgebraHom (ρV ⊗ 1) _ _ = asAlgebraHom ρV _ _ ⊗ₜ _ @@ -637,6 +640,7 @@ theorem smul_tprod_one_asModule (r : k[G]) (x : V) (y : W) : simp only [Finsupp.sum, TensorProduct.sum_tmul] rfl +set_option backward.isDefEq.respectTransparency false in theorem smul_one_tprod_asModule (r : k[G]) (x : V) (y : W) : r • (show (1 ⊗ ρW).asModule from x ⊗ₜ y) = x ⊗ₜ (r • show ρW.asModule from y) := by change asAlgebraHom (1 ⊗ ρW) _ _ = _ ⊗ₜ asAlgebraHom ρW _ _ diff --git a/Mathlib/RepresentationTheory/Coinduced.lean b/Mathlib/RepresentationTheory/Coinduced.lean index e23be2bcc66fa5..c1467de52268b7 100644 --- a/Mathlib/RepresentationTheory/Coinduced.lean +++ b/Mathlib/RepresentationTheory/Coinduced.lean @@ -69,6 +69,7 @@ def coindV : Submodule k (H → A) where lemma mem_coindV (f : H → A) : f ∈ coindV φ σ ↔ ∀ (g : G) (h : H), f (φ g * h) = σ g (f h) := Iff.rfl +set_option backward.isDefEq.respectTransparency.types false in /-- If `ρ : Representation k G A` and `φ : G →* H` then `coind φ ρ` is the representation coinduced by `ρ` along `φ`, defined as the following action of `H` on the submodule `coindV φ ρ` @@ -84,6 +85,7 @@ def coind : Representation k H (coindV φ ρ) where map_one' := by ext; simp map_mul' _ _ := by ext; simp [mul_assoc] +set_option backward.isDefEq.respectTransparency.types false in variable {σ ρ} in /-- Given a monoid homomorphism `φ : G →* H` and an intertwining map `f : σ ⟶ ρ`, there is a natural intertwining map `coind φ σ ⟶ coind φ ρ` given by postcomposition by `f`. -/ @@ -156,6 +158,7 @@ instance {G : Type v'} [Group G] (S : Subgroup G) : end Coind section Coind' +set_option backward.isDefEq.respectTransparency.types false in /-- If `φ : G →* H` and `A : Rep k G` then `coind' φ A`, the coinduction of `A` along `φ`, is defined as an `H`-action on `Hom_{k[G]}(k[H], A)`. If `f : k[H] → A` is `G`-equivariant @@ -223,6 +226,7 @@ noncomputable def coindVEquiv : left_inv x := by simp right_inv x := coind'_ext φ fun _ => by simp +set_option backward.isDefEq.respectTransparency.types false in /-- `coind φ A` and `coind' φ A` are isomorphic representations, with the underlying `k`-linear equivalence given by `coindVEquiv`. -/ noncomputable def coindIso : coind φ A ≅ coind' φ A := @@ -243,6 +247,7 @@ end CoindIso noncomputable section Adjunction +set_option backward.isDefEq.respectTransparency.types false in /-- The morphism induced by the adjunction between `res φ` and `coind φ` sending a morphism `f : res φ B ⟶ A` to the morphism `B ⟶ coind φ A` given by the underlying linear map sending `b : B.V` to the function sending `h : H` to `f ((B.ρ h) b)`. -/ @@ -269,6 +274,7 @@ info: _.1 (@DFunLike.coe _ _.1 _ _ (@ConcreteCategory.hom (Rep _ _ _ _) _ _ _ _ attribute [pp_with_univ] Rep coind +set_option backward.isDefEq.respectTransparency.types false in /-- Given a monoid homomorphism `φ : G →* H`, an `H`-representation `B`, and a `G`-representation `A`, there is a `k`-linear equivalence between the `G`-representation morphisms `res φ B ⟶ A` and the `H`-representation morphisms `B ⟶ coind φ A`. diff --git a/Mathlib/RepresentationTheory/Coinvariants.lean b/Mathlib/RepresentationTheory/Coinvariants.lean index 93c225bec61f57..5bf4eaddf90a0e 100644 --- a/Mathlib/RepresentationTheory/Coinvariants.lean +++ b/Mathlib/RepresentationTheory/Coinvariants.lean @@ -318,6 +318,7 @@ abbrev toCoinvariantsMkQ : A ⟶ toCoinvariants A S := the coinvariants of `ρ|_S`. -/ abbrev quotientToCoinvariants : Rep k (G ⧸ S) := Rep.ofQuotient (Rep.toCoinvariants A S) S +set_option backward.isDefEq.respectTransparency.types false in /-- Given a normal subgroup `S ≤ G`, a `G`-representation `A` induces a short exact sequence of `G`-representations `0 ⟶ Ker(mk) ⟶ A ⟶ A_S ⟶ 0` where `mk` is the quotient map to the `S`-coinvariants `A_S`. -/ diff --git a/Mathlib/RepresentationTheory/Equiv.lean b/Mathlib/RepresentationTheory/Equiv.lean index 16045234dbd2f6..e38138e8d768ce 100644 --- a/Mathlib/RepresentationTheory/Equiv.lean +++ b/Mathlib/RepresentationTheory/Equiv.lean @@ -169,6 +169,7 @@ def leftRegularMapEquiv : ((leftRegular k G).IntertwiningMap σ) ≃ₗ[k] V whe left_inv x := by ext; simp [← x.isIntertwining] right_inv v := by simp +set_option backward.isDefEq.respectTransparency false in lemma leftRegularMapEquiv_symm_single (g : G) (v : V) : ((leftRegularMapEquiv σ).symm v) (Finsupp.single g 1) = σ g v := by simp diff --git a/Mathlib/RepresentationTheory/FDRep.lean b/Mathlib/RepresentationTheory/FDRep.lean index 2948477a662e19..b4265bd71953c2 100644 --- a/Mathlib/RepresentationTheory/FDRep.lean +++ b/Mathlib/RepresentationTheory/FDRep.lean @@ -109,6 +109,7 @@ lemma hom_hom_action_ρ (V : FDRep R G) (g : G) : (Action.ρ V g).hom.hom = (ρ def isoToLinearEquiv {V W : FDRep R G} (i : V ≅ W) : V ≃ₗ[R] W := FGModuleCat.isoToLinearEquiv ((Action.forget (FGModuleCat R) G).mapIso i) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem Iso.conj_ρ {V W : FDRep R G} (i : V ≅ W) (g : G) : W.ρ g = (FDRep.isoToLinearEquiv i).conj (V.ρ g) := by @@ -168,8 +169,7 @@ def forget₂HomLinearEquiv (X Y : FDRep R G) : (forget₂ (FDRep R G) (Rep R G)).obj Y) ≃ₗ[R] X ⟶ Y where toFun f := ⟨InducedCategory.homMk (ModuleCat.ofHom <| f.hom.toLinearMap), fun g ↦ by ext1 - simp only [FGModuleCat.obj_carrier, ObjectProperty.FullSubcategory.comp_hom, - InducedCategory.homMk_hom, ModuleCat.hom_comp, hom_hom_action_ρ] + simp only [FGModuleCat.obj_carrier] exact f.hom.2 g⟩ map_add' _ _ := rfl map_smul' _ _ := rfl diff --git a/Mathlib/RepresentationTheory/FiniteIndex.lean b/Mathlib/RepresentationTheory/FiniteIndex.lean index 8e0ccd7172bf78..92a6e53a9f753c 100644 --- a/Mathlib/RepresentationTheory/FiniteIndex.lean +++ b/Mathlib/RepresentationTheory/FiniteIndex.lean @@ -99,6 +99,7 @@ lemma indToCoindAux_comm {A B : Rep k S} (f : A ⟶ B) (g₁ g₂ : G) (a : A) : · simp [S.1.smul_def, hom_comm_apply] · simp [indToCoindAux_of_not_rel (h := h)] +set_option backward.isDefEq.respectTransparency.types false in variable (A) in /-- Let `S ≤ G` be a subgroup and `A` a `k`-linear `S`-representation. This is the `k`-linear map `Ind_S^G(A) →ₗ[k] Coind_S^G(A)` sending `(⟦g ⊗ₜ[k] a⟧, sg) ↦ ρ(s)(a)`. -/ @@ -143,6 +144,7 @@ lemma coindToInd_of_support_subset_orbit (g : G) (f : coind S.subtype A) variable (A) +set_option backward.isDefEq.respectTransparency.types false in lemma coindToInd_indToCoind : A.indToCoind ∘ₗ A.coindToInd = LinearMap.id := by ext g a simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.id_coe, id_eq] @@ -155,6 +157,7 @@ lemma coindToInd_indToCoind : A.indToCoind ∘ₗ A.coindToInd = LinearMap.id := simpa using indToCoindAux_of_not_rel b a (g.1 b) (mt Quotient.sound hb.symm) · simp +set_option backward.isDefEq.respectTransparency.types false in lemma indToCoind_coindToInd : A.coindToInd ∘ₗ A.indToCoind = LinearMap.id := by ext g a simp only [LinearMap.comp_apply, AlgebraTensorModule.curry_apply, @@ -165,6 +168,7 @@ lemma indToCoind_coindToInd : A.coindToInd ∘ₗ A.indToCoind = LinearMap.id := contrapose hx simpa using indToCoindAux_of_not_rel g x a hx +set_option backward.isDefEq.respectTransparency.types false in /-- Let `S ≤ G` be a finite index subgroup, `g₁, ..., gₙ` a set of right coset representatives of `S`, and `A` a `k`-linear `S`-representation. This is an isomorphism `Ind_S^G(A) ≅ Coind_S^G(A)`. The forward map sends `(⟦g ⊗ₜ[k] a⟧, sg) ↦ ρ(s)(a)`, and the inverse sends `f : G → A` to @@ -177,6 +181,7 @@ noncomputable def indCoindIso (A : Rep.{max w u} k S) : variable (k S) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- Given a finite index subgroup `S ≤ G`, this is a natural isomorphism between the `Ind_S^G` and `Coind_G^S` functors `Rep k S ⥤ Rep k G`. -/ diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean index a85d2297e3e728..df0992b440be46 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LongExactSequence.lean @@ -136,6 +136,7 @@ theorem mem_cocycles₁_of_comp_eq_d₀₁ have := congr($((mapShortComplexH1 (MonoidHom.id G) X.f).comm₂₃.symm) x) simp_all [shortComplexH1, LinearMap.compLeft] +set_option backward.isDefEq.respectTransparency.types false in theorem δ₀_apply -- Let `0 ⟶ X₁ ⟶f X₂ ⟶g X₃ ⟶ 0` be a short exact sequence of `G`-representations. -- Let `z : X₃ᴳ` and `y : X₂` be such that `g(y) = z`. diff --git a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean index 6329e353639620..4269b864c302e9 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupCohomology/LowDegree.lean @@ -769,6 +769,7 @@ def cocyclesIso₀ : cocycles A 0 ≅ ModuleCat.of k A.ρ.invariants := ((inhomogeneousCochains A).cyclesIsKernel 0 1 (by simp)) (shortComplexH0_exact A).fIsKernel (dArrowIso₀₁ A) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp), elementwise (attr := simp)] lemma cocyclesIso₀_hom_comp_f : diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean index 90993978ab1507..e8b0e294983cb5 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/Functoriality.lean @@ -293,6 +293,7 @@ theorem mapShortComplexH1_zero : theorem mapShortComplexH1_id : mapShortComplexH1 (MonoidHom.id G) (𝟙 A) = 𝟙 _ := by ext <;> simp [shortComplexH1] +set_option backward.isDefEq.respectTransparency.types false in theorem mapShortComplexH1_comp {G H K : Type u} [Group G] [Group H] [Group K] {A : Rep k G} {B : Rep k H} {C : Rep k K} (f : G →* H) (g : H →* K) (φ : A ⟶ res f B) (ψ : B ⟶ res g C) : @@ -510,6 +511,7 @@ previous assumptions. -/ end OfTrivial +set_option backward.isDefEq.respectTransparency.types false in /-- The short complex `H₁(S, A) ⟶ H₁(G, A) ⟶ H₁(G ⧸ S, A_S)`. The first map is the "corestriction" map induced by the inclusion `ι : S →* G` and the identity on `Res(ι)(A)`, and the second map is the "coinflation" map induced by the quotient maps `G →* G ⧸ S` and `A →ₗ A_S`. -/ @@ -713,6 +715,7 @@ theorem mapShortComplexH2_id : mapShortComplexH2 (MonoidHom.id _) (𝟙 A) = ext simp } +set_option backward.isDefEq.respectTransparency.types false in theorem mapShortComplexH2_comp {G H K : Type u} [Group G] [Group H] [Group K] {A : Rep k G} {B : Rep k H} {C : Rep k K} (f : G →* H) (g : H →* K) (φ : A ⟶ res f B) (ψ : B ⟶ res g C) : diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean index 49a799908c8e95..35f9af85166214 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/LongExactSequence.lean @@ -131,6 +131,7 @@ theorem δ_apply {i j : ℕ} (hij : j + 1 = i) π X.X₁ j (cyclesMkOfCompEqD hX hx) := by exact (map_chainsFunctor_shortExact hX).δ_apply i j hij z hz y hy x (by simpa using! hx) _ rfl +set_option backward.isDefEq.respectTransparency.types false in theorem δ₀_apply -- Let `0 ⟶ X₁ ⟶f X₂ ⟶g X₃ ⟶ 0` be a short exact sequence of `G`-representations. -- Let `z` by a 1-cycle for `X₃` and `y` a 1-chain for `X₂` such that `g ∘ y = z`. @@ -157,6 +158,7 @@ theorem mem_cycles₁_of_comp_eq_d₂₁ have := congr($((mapShortComplexH1 (MonoidHom.id G) X.f).comm₂₃.symm) x) simp_all [shortComplexH1] +set_option backward.isDefEq.respectTransparency.types false in theorem δ₁_apply -- Let `0 ⟶ X₁ ⟶f X₂ ⟶g X₃ ⟶ 0` be a short exact sequence of `G`-representations. -- Let `z` by a 2-cycle for `X₃` and `y` a 2-chain for `X₂` such that `g ∘ y = z`. diff --git a/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean b/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean index 8c863ab81a5d93..1e24da70c217b9 100644 --- a/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean +++ b/Mathlib/RepresentationTheory/Homological/GroupHomology/LowDegree.lean @@ -773,6 +773,7 @@ lemma toCycles_comp_isoCycles₁_hom : simp [← cancel_mono (shortComplexH1 A).moduleCatLeftHomologyData.i, comp_d₂₁_eq, shortComplexH1_f] +set_option backward.isDefEq.respectTransparency.types false in lemma cyclesMk₁_eq (x : cycles₁ A) : cyclesMk 1 0 (by simp) ((chainsIso₁ A).inv x) (by rw [← LinearMap.comp_apply, ← ModuleCat.hom_comp, eq_d₁₀_comp_inv]; simp) = @@ -821,6 +822,7 @@ lemma toCycles_comp_isoCycles₂_hom : simp [← cancel_mono (shortComplexH2 A).moduleCatLeftHomologyData.i, comp_d₃₂_eq, shortComplexH2_f] +set_option backward.isDefEq.respectTransparency.types false in lemma cyclesMk₂_eq (x : cycles₂ A) : cyclesMk 2 1 (by simp) ((chainsIso₂ A).inv x) (by rw [← LinearMap.comp_apply, ← ModuleCat.hom_comp, eq_d₂₁_comp_inv] diff --git a/Mathlib/RepresentationTheory/Homological/Resolution.lean b/Mathlib/RepresentationTheory/Homological/Resolution.lean index e21a60eb83e1c0..b17e4b185da61b 100644 --- a/Mathlib/RepresentationTheory/Homological/Resolution.lean +++ b/Mathlib/RepresentationTheory/Homological/Resolution.lean @@ -222,6 +222,7 @@ theorem d_eq (n : ℕ) : ((standardComplex k G).d (n + 1) n).hom.toLinearMap = Representation.IntertwiningMap.smul_apply, (Representation.linearizeMap_single), smul_single, smul_eq_mul, mul_one] +set_option backward.isDefEq.respectTransparency.types false in lemma d_apply {n : ℕ} (f : (Fin (n + 1 + 1) → G) →₀ k) : ((standardComplex k G).d (n + 1) n).hom f = d k G (n + 1) f := by rw [← Representation.IntertwiningMap.toLinearMap_apply, d_eq]; rfl diff --git a/Mathlib/RepresentationTheory/Intertwining.lean b/Mathlib/RepresentationTheory/Intertwining.lean index c8cf9de8b9ea5b..3887c04b40aa47 100644 --- a/Mathlib/RepresentationTheory/Intertwining.lean +++ b/Mathlib/RepresentationTheory/Intertwining.lean @@ -429,6 +429,7 @@ def equivLinearMapAsModule : left_inv f := rfl right_inv f := rfl +set_option backward.isDefEq.respectTransparency false in /-- Composition of intertwining maps. -/ def llcomp : IntertwiningMap σ τ →ₗ[A] IntertwiningMap ρ σ →ₗ[A] IntertwiningMap ρ τ where toFun f := diff --git a/Mathlib/RepresentationTheory/Invariants.lean b/Mathlib/RepresentationTheory/Invariants.lean index f6394781abb975..41d98f25d72876 100644 --- a/Mathlib/RepresentationTheory/Invariants.lean +++ b/Mathlib/RepresentationTheory/Invariants.lean @@ -38,6 +38,7 @@ variable [Fintype G] [Invertible (Fintype.card G : k)] /-- The average of all elements of the group `G`, considered as an element of `k[G]`. -/ noncomputable def average : k[G] := ⅟(Fintype.card G : k) • ∑ g : G, of k G g +set_option backward.isDefEq.respectTransparency.types false in /-- `average k G` is invariant under left multiplication by elements of `G`. -/ @[simp] theorem mul_average_left (g : G) : ↑(Finsupp.single g 1) * average k G = average k G := by @@ -47,6 +48,7 @@ theorem mul_average_left (g : G) : ↑(Finsupp.single g 1) * average k G = avera change ⅟(Fintype.card G : k) • ∑ x : G, f (g * x) = ⅟(Fintype.card G : k) • ∑ x : G, f x rw [Function.Bijective.sum_comp (Group.mulLeft_bijective g) _] +set_option backward.isDefEq.respectTransparency.types false in /-- `average k G` is invariant under right multiplication by elements of `G`. -/ @[simp] diff --git a/Mathlib/RepresentationTheory/Maschke.lean b/Mathlib/RepresentationTheory/Maschke.lean index 9c70fc1fa34db6..b0e581b791c011 100644 --- a/Mathlib/RepresentationTheory/Maschke.lean +++ b/Mathlib/RepresentationTheory/Maschke.lean @@ -180,6 +180,7 @@ variable {G k V : Type*} [Group G] [Field k] [Finite G] [NeZero (Nat.card G : k) open Representation +set_option backward.isDefEq.respectTransparency false in instance : IsSemisimpleRepresentation ρ := by rw [isSemisimpleRepresentation_iff_isSemisimpleModule_asModule] infer_instance diff --git a/Mathlib/RepresentationTheory/Rep/Basic.lean b/Mathlib/RepresentationTheory/Rep/Basic.lean index fdbabd2bf828ba..4cd380df32fdbd 100644 --- a/Mathlib/RepresentationTheory/Rep/Basic.lean +++ b/Mathlib/RepresentationTheory/Rep/Basic.lean @@ -481,6 +481,7 @@ section Action variable (k G) +set_option backward.isDefEq.respectTransparency.types false in /-- Every object in `Rep k G` naturally correspond to an object in `Action`. -/ @[simps] def RepToAction : Rep.{w} k G ⥤ Action (ModuleCat.{w} k) G where @@ -1004,6 +1005,7 @@ representation morphisms `Hom(k[G], A)` and `A`. -/ abbrev leftRegularHomEquiv (A : Rep k G) : (leftRegular k G ⟶ A) ≃ₗ[k] A := homLinearEquiv _ _ ≪≫ₗ Representation.leftRegularMapEquiv A.ρ +set_option backward.isDefEq.respectTransparency.types false in theorem leftRegularHomEquiv_symm_single {A : Rep k G} (x : A) (g : G) : ((leftRegularHomEquiv A).symm x).hom (.single g 1) = A.ρ g x := by simp [homEquiv] diff --git a/Mathlib/RepresentationTheory/Submodule.lean b/Mathlib/RepresentationTheory/Submodule.lean index dae58013ec3545..34683e1791abe2 100644 --- a/Mathlib/RepresentationTheory/Submodule.lean +++ b/Mathlib/RepresentationTheory/Submodule.lean @@ -60,6 +60,7 @@ instance [Nontrivial V] : Nontrivial ρ.invtSubmodule := end invtSubmodule +set_option backward.isDefEq.respectTransparency false in lemma asAlgebraHom_mem_of_forall_mem (p : Submodule k V) (hp : ∀ g, ∀ v ∈ p, ρ g v ∈ p) (v : V) (hv : v ∈ p) (x : k[G]) : ρ.asAlgebraHom x v ∈ p := by diff --git a/Mathlib/RepresentationTheory/Tannaka.lean b/Mathlib/RepresentationTheory/Tannaka.lean index 25535f9cb14c12..baca199d9aaa22 100644 --- a/Mathlib/RepresentationTheory/Tannaka.lean +++ b/Mathlib/RepresentationTheory/Tannaka.lean @@ -50,6 +50,7 @@ def forget := LaxMonoidalFunctor.of (forget₂ (FDRep k G) (FGModuleCat k)) @[simp] lemma forget_map (X Y : FDRep k G) (f : X ⟶ Y) : (forget k G).map f = f.hom := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Definition of `equivHom g : Aut (forget k G)` by its components. -/ @[simps] def equivApp (g : G) (X : FDRep k G) : X.V ≅ X.V where @@ -62,6 +63,7 @@ def equivApp (g : G) (X : FDRep k G) : X.V ≅ X.V where ext x simp +set_option backward.isDefEq.respectTransparency.types false in variable (k G) in /-- The group homomorphism `G →* Aut (forget k G)` shown to be an isomorphism. -/ @[simps] @@ -213,6 +215,7 @@ lemma toRightFDRepComp_in_rightRegular [IsDomain k] (η : Aut (forget k G)) : congr($hs (leftRegular t⁻¹ (single u 1))) _ = _ := by by_cases u = t * s <;> simp_all [single_apply] +set_option backward.isDefEq.respectTransparency.types false in lemma equivHom_surjective [IsDomain k] : Function.Surjective (equivHom k G) := by intro η obtain ⟨s, h⟩ := toRightFDRepComp_in_rightRegular η diff --git a/Mathlib/RingTheory/AdicCompletion/Algebra.lean b/Mathlib/RingTheory/AdicCompletion/Algebra.lean index 1e0a44aef7ebf6..610d132a8c9444 100644 --- a/Mathlib/RingTheory/AdicCompletion/Algebra.lean +++ b/Mathlib/RingTheory/AdicCompletion/Algebra.lean @@ -135,14 +135,17 @@ def evalₐ (n : ℕ) : AdicCompletion I R →ₐ[R] R ⧸ I ^ n := (Ideal.quotientEquivAlgOfEq R h) (AlgHom.ofLinearMap (eval I R n) rfl (fun _ _ ↦ rfl)) +set_option backward.isDefEq.respectTransparency false in theorem factor_evalₐ_eq_eval {n : ℕ} (x : AdicCompletion I R) (h : I ^ n ≤ I ^ n • ⊤) : Ideal.Quotient.factor h (evalₐ I n x) = eval I R n x := by simp [evalₐ] +set_option backward.isDefEq.respectTransparency false in theorem factor_eval_eq_evalₐ {n : ℕ} (x : AdicCompletion I R) (h : I ^ n • ⊤ ≤ I ^ n) : factor h (eval I R n x) = evalₐ I n x := by simp [evalₐ] +set_option backward.isDefEq.respectTransparency false in /-- The composition map `R →+* AdicCompletion I R →+* R ⧸ I ^ n` equals to the natural quotient map. -/ @@ -158,6 +161,7 @@ theorem surjective_evalₐ (n : ℕ) : Function.Surjective (evalₐ I n) := by · exact factor_surjective Ideal.mul_le_right · exact eval_surjective I R n +set_option backward.isDefEq.respectTransparency false in @[simp] theorem evalₐ_mk (n : ℕ) (x : AdicCauchySequence I R) : evalₐ I n (mk I R x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by @@ -242,6 +246,7 @@ theorem mul_apply (n : ℕ) (f g : AdicCauchySequence I R) : (f * g) n = f n * g def mkₐ : AdicCauchySequence I R →ₐ[R] AdicCompletion I R := AlgHom.ofLinearMap (mk I R) rfl (fun _ _ ↦ rfl) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem evalₐ_mkₐ (n : ℕ) (x : AdicCauchySequence I R) : evalₐ I n (mkₐ I x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by @@ -294,6 +299,7 @@ instance : IsScalarTower R (R ⧸ (I • ⊤ : Ideal R)) (M ⧸ (I • ⊤ : Sub rw [← Submodule.Quotient.mk_smul, Ideal.Quotient.mk_eq_mk, mk_smul_mk, smul_assoc] rfl +set_option backward.isDefEq.respectTransparency false in instance smul : SMul (AdicCompletion I R) (AdicCompletion I M) where smul r x := { val := fun n ↦ eval I R n r • eval I M n x @@ -341,6 +347,7 @@ open Ideal Quotient variable {R S : Type*} [NonAssocSemiring R] [CommRing S] (I : Ideal S) +set_option backward.isDefEq.respectTransparency false in /-- The universal property of `AdicCompletion` for rings. The lift ring map `R →+* AdicCompletion I S` of a compatible family of @@ -367,10 +374,12 @@ def liftRingHom (f : (n : ℕ) → R →+* S ⧸ I ^ n) variable (f : (n : ℕ) → R →+* S ⧸ I ^ n) (hf : ∀ {m n : ℕ} (hle : m ≤ n), (Ideal.Quotient.factorPow I hle).comp (f n) = f m) +set_option backward.isDefEq.respectTransparency false in theorem factor_eval_liftRingHom (n : ℕ) (x : R) (h : I ^ n • ⊤ ≤ I ^ n) : factor h (eval I S n (liftRingHom I f hf x)) = f n x := by simp [liftRingHom, eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem evalₐ_liftRingHom (n : ℕ) (x : R) : evalₐ I n (liftRingHom I f hf x) = f n x := by @@ -426,21 +435,25 @@ noncomputable def ofAlgEquiv : S ≃ₐ[S] AdicCompletion I S where theorem ofAlgEquiv_apply (x : S) : ofAlgEquiv I x = of I S x := by rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem of_ofAlgEquiv_symm (x : AdicCompletion I S) : of I S ((ofAlgEquiv I).symm x) = x := by simp [ofAlgEquiv] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ofAlgEquiv_symm_of (x : S) : (ofAlgEquiv I).symm (of I S x) = x := by simp [ofAlgEquiv] +set_option backward.isDefEq.respectTransparency false in theorem mk_smul_top_ofAlgEquiv_symm (n : ℕ) (x : AdicCompletion I S) : Ideal.Quotient.mk (I ^ n • ⊤) ((ofAlgEquiv I).symm x) = eval I S n x := by nth_rw 2 [← of_ofAlgEquiv_symm I x] simp [-of_ofAlgEquiv_symm, eval] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mk_ofAlgEquiv_symm (n : ℕ) (x : AdicCompletion I S) : Ideal.Quotient.mk (I ^ n) ((ofAlgEquiv I).symm x) = evalₐ I n x := by diff --git a/Mathlib/RingTheory/AdicCompletion/Basic.lean b/Mathlib/RingTheory/AdicCompletion/Basic.lean index 321f6e4604b43d..48c570d3a4bad3 100644 --- a/Mathlib/RingTheory/AdicCompletion/Basic.lean +++ b/Mathlib/RingTheory/AdicCompletion/Basic.lean @@ -550,6 +550,7 @@ theorem mk_zero_of (f : AdicCauchySequence I M) ← AdicCauchySequence.mk_eq_mk (show n ≤ m by lia)] simpa using (Submodule.smul_mono_left (Ideal.pow_le_pow_right (by lia))) hl +set_option backward.isDefEq.respectTransparency false in /-- Every element in the adic completion is represented by a Cauchy sequence. -/ theorem mk_surjective : Function.Surjective (mk I M) := by intro x @@ -622,6 +623,7 @@ theorem of_injective [IsHausdorff I M] : Function.Injective (of I M) := theorem of_inj [IsHausdorff I M] {a b : M} : of I M a = of I M b ↔ a = b := (of_injective I M).eq_iff +set_option backward.isDefEq.respectTransparency false in theorem of_surjective_iff : Function.Surjective (of I M) ↔ IsPrecomplete I M := by constructor · refine fun h ↦ ⟨fun f hmn ↦ ?_⟩ @@ -676,12 +678,14 @@ theorem of_ofLinearEquiv_symm (x : AdicCompletion I M) : end Bijective +set_option backward.isDefEq.respectTransparency false in theorem pow_smul_top_le_ker_eval (n : ℕ) : I ^ n • ⊤ ≤ (eval I M n).ker := by simp only [smul_le, mem_top, LinearMap.mem_ker, map_smul, coe_eval, forall_const] intro r r_in x rw [← Submodule.Quotient.mk_out (x.val n), ← Quotient.mk_smul, Quotient.mk_eq_zero] exact smul_mem_smul r_in mem_top +set_option backward.isDefEq.respectTransparency false in lemma val_apply_mem_smul_top_iff {m n : ℕ} {x : AdicCompletion I M} (m_ge : n ≤ m) : x.val m ∈ I ^ n • (⊤ : Submodule R (M ⧸ I ^ m • ⊤)) ↔ x.val n = 0 := by refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ diff --git a/Mathlib/RingTheory/AdicCompletion/Completeness.lean b/Mathlib/RingTheory/AdicCompletion/Completeness.lean index 7741dfcf62e02a..9af6366bc65895 100644 --- a/Mathlib/RingTheory/AdicCompletion/Completeness.lean +++ b/Mathlib/RingTheory/AdicCompletion/Completeness.lean @@ -59,6 +59,7 @@ the adic completion of `M`. -/ abbrev ofPowSMul (n : ℕ) : AdicCompletion I ↥(I ^ n • ⊤ : Submodule R M) →ₗ[AdicCompletion I R] AdicCompletion I M := map I (I ^ n • ⊤ : Submodule R M).subtype +set_option backward.isDefEq.respectTransparency.types false in theorem ofPowSMul_val_apply (h : c = b + a) {x : AdicCompletion I ↥(I ^ a • ⊤ : Submodule R M)} : (ofPowSMul I M a x).val c = powSMulQuotInclusion I M h ⊤ (x.val b) := by rw [← x.prop (show b ≤ c by lia), map_val_apply] @@ -148,6 +149,7 @@ private lemma lsum_smul_comp_finsuppLEquivDirectSum_symm {ι : Type*} [Decidable sumEquivOfFintype_apply, sum_lof, map_mk, AdicCauchySequence.map_apply_coe, map_smul] rw [← Ideal.Quotient.algebraMap_eq, algebraMap_smul] +set_option backward.isDefEq.respectTransparency.types false in variable {I} in @[stacks 05GG "(2)"] theorem pow_smul_top_eq_ker_eval {n : ℕ} (h : I.FG) : I ^ n • ⊤ = (eval I M n).ker := by @@ -176,6 +178,7 @@ theorem pow_smul_top_eq_ker_eval {n : ℕ} (h : I.FG) : I ^ n • ⊤ = (eval I rcases map_surjective I this x with ⟨x, rfl⟩ exact ⟨x, by rw [← LinearMap.comp_apply, map_comp, LinearMap.subtype_comp_codRestrict]⟩ +set_option backward.isDefEq.respectTransparency.types false in variable {I} in /-- `AdicCompletion I M` is adic complete when `I` is finitely generated. -/ @[stacks 05GG "(1)"] diff --git a/Mathlib/RingTheory/AdicCompletion/Functoriality.lean b/Mathlib/RingTheory/AdicCompletion/Functoriality.lean index be3e95310e9ebd..fa6e85c52187ef 100644 --- a/Mathlib/RingTheory/AdicCompletion/Functoriality.lean +++ b/Mathlib/RingTheory/AdicCompletion/Functoriality.lean @@ -61,6 +61,7 @@ namespace AdicCompletion open LinearMap +set_option backward.isDefEq.respectTransparency false in theorem transitionMap_comp_reduceModIdeal (f : M →ₗ[R] N) {m n : ℕ} (hmn : m ≤ n) : transitionMap I N hmn ∘ₗ f.reduceModIdeal (I ^ n) = (f.reduceModIdeal (I ^ m) : _ →ₗ[R] _) ∘ₗ transitionMap I M hmn := by @@ -69,6 +70,7 @@ theorem transitionMap_comp_reduceModIdeal (f : M →ₗ[R] N) {m n : ℕ} namespace AdicCauchySequence +set_option backward.isDefEq.respectTransparency false in /-- A linear map induces a linear map on adic Cauchy sequences. -/ @[simps] def map (f : M →ₗ[R] N) : AdicCauchySequence I M →ₗ[R] AdicCauchySequence I N where @@ -357,6 +359,7 @@ open Submodule variable {I} +set_option backward.isDefEq.respectTransparency false in theorem exists_smodEq_pow_add_one_smul {f : M →ₗ[R] N} (h : Function.Surjective (mkQ (I • ⊤) ∘ₗ f)) {y : N} {n : ℕ} (hy : y ∈ (I ^ n • ⊤ : Submodule R N)) : @@ -401,6 +404,7 @@ theorem exists_smodEq_pow_smul_top_and_mkQ_eq {f : M →ₗ[R] N} use x', hxx' rwa [mkQ_apply, hx'y0] +set_option backward.isDefEq.respectTransparency false in theorem map_surjective_of_mkQ_comp_surjective {f : M →ₗ[R] N} (h : Function.Surjective (mkQ (I • ⊤) ∘ₗ f)) : Function.Surjective (map I f) := by intro y diff --git a/Mathlib/RingTheory/Adjoin/FG.lean b/Mathlib/RingTheory/Adjoin/FG.lean index 2b10eab1dc4ab5..d07893b5078e1e 100644 --- a/Mathlib/RingTheory/Adjoin/FG.lean +++ b/Mathlib/RingTheory/Adjoin/FG.lean @@ -141,6 +141,7 @@ theorem FG.map {S : Subalgebra R A} (f : A →ₐ[R] B) (hs : S.FG) : (S.map f). end +set_option backward.isDefEq.respectTransparency false in theorem fg_of_fg_map (S : Subalgebra R A) (f : A →ₐ[R] B) (hf : Function.Injective f) (hs : (S.map f).FG) : S.FG := let ⟨s, hs⟩ := hs diff --git a/Mathlib/RingTheory/Adjoin/PowerBasis.lean b/Mathlib/RingTheory/Adjoin/PowerBasis.lean index 22eea1d4c8c47c..1bd2536c513f02 100644 --- a/Mathlib/RingTheory/Adjoin/PowerBasis.lean +++ b/Mathlib/RingTheory/Adjoin/PowerBasis.lean @@ -47,6 +47,7 @@ noncomputable def adjoin.powerBasisAux {x : S} (hx : IsIntegral K x) : ext exact aeval_algebraMap_apply S (⟨x, _⟩ : K[x]) _ +set_option backward.isDefEq.respectTransparency.types false in /-- The power basis `1, x, ..., x ^ (d - 1)` for `K[x]`, where `d` is the degree of the minimal polynomial of `x`. See `Algebra.adjoin.powerBasis'` for a version over a more general base ring. -/ @@ -66,10 +67,12 @@ noncomputable def _root_.PowerBasis.ofAdjoinEqTop {x : S} (hx : IsIntegral K x) (hx' : K[x] = ⊤) : PowerBasis K S := (adjoin.powerBasis hx).map ((Subalgebra.equivOfEq _ _ hx').trans Subalgebra.topEquiv) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem _root_.PowerBasis.ofAdjoinEqTop_gen {x : S} (hx : IsIntegral K x) (hx' : K[x] = ⊤) : (PowerBasis.ofAdjoinEqTop hx hx').gen = x := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem _root_.PowerBasis.ofAdjoinEqTop_dim {x : S} (hx : IsIntegral K x) (hx' : K[x] = ⊤) : diff --git a/Mathlib/RingTheory/AdjoinRoot.lean b/Mathlib/RingTheory/AdjoinRoot.lean index 829bc3c3d9bc5b..6669506e446fe6 100644 --- a/Mathlib/RingTheory/AdjoinRoot.lean +++ b/Mathlib/RingTheory/AdjoinRoot.lean @@ -332,6 +332,7 @@ theorem aeval_algHom_eq_zero (ϕ : AdjoinRoot f →ₐ[R] S) : aeval (ϕ (root f rw [aeval_def, ← h, ← map_zero ϕ.toRingHom, ← eval₂_root f, hom_eval₂] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem liftAlgHom_eq_algHom (ϕ : AdjoinRoot f →ₐ[R] S) : liftAlgHom f (Algebra.ofId R S) (ϕ (root f)) (aeval_algHom_eq_zero f ϕ) = ϕ := by @@ -422,6 +423,7 @@ lemma mapAlgHom_comp_mapAlghom (f : S →ₐ[R] T) (g : T →ₐ[R] U) (p : S[X] (hg.trans <| by simpa [Polynomial.map_map] using! Polynomial.map_dvd g.toRingHom hf) := by aesop +set_option backward.isDefEq.respectTransparency.types false in /-- `AdjoinRoot.map` as an `AlgEquiv`. -/ def mapAlgEquiv (f : S ≃ₐ[R] T) (p : S[X]) (q : T[X]) (h : Associated (p.map f) q) : AdjoinRoot p ≃ₐ[R] AdjoinRoot q := @@ -619,6 +621,7 @@ theorem powerBasisAux'_repr_apply_to_fun (hg : g.Monic) (f : AdjoinRoot g) (i : (powerBasisAux' hg).repr f i = (modByMonicHom hg f).coeff ↑i := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The power basis `1, root g, ..., root g ^ (d - 1)` for `AdjoinRoot g`, where `g` is a monic polynomial of degree `d`. -/ @[simps] @@ -658,6 +661,7 @@ variable [Field K] {f : K[X]} theorem isIntegral_root (hf : f ≠ 0) : IsIntegral K (root f) := (isAlgebraic_root hf).isIntegral +set_option backward.isDefEq.respectTransparency.types false in theorem minpoly_root (hf : f ≠ 0) : minpoly K (root f) = f * C f.leadingCoeff⁻¹ := by have f'_monic : Monic _ := monic_mul_leadingCoeff_inv hf refine (minpoly.unique K _ f'_monic ?_ ?_).symm @@ -764,6 +768,7 @@ section Equiv' variable [CommRing R] [CommRing S] [Algebra R S] variable (g : R[X]) (pb : PowerBasis R S) +set_option backward.isDefEq.respectTransparency.types false in /-- If `S` is an extension of `R` with power basis `pb` and `g` is a monic polynomial over `R` such that `pb.gen` has a minimal polynomial `g`, then `S` is isomorphic to `AdjoinRoot g`. @@ -784,11 +789,13 @@ def equiv' (h₁ : aeval (root g) (minpoly R pb.gen) = 0) (h₂ : aeval pb.gen g rw [pb.lift_aeval, aeval_eq, liftAlgHom_mk, Polynomial.aeval_def, Algebra.toRingHom_ofId] -- This lemma should have the simp tag but this causes a lint issue. +set_option backward.isDefEq.respectTransparency.types false in theorem equiv'_toAlgHom (h₁ : aeval (root g) (minpoly R pb.gen) = 0) (h₂ : aeval pb.gen g = 0) : (equiv' g pb h₁ h₂).toAlgHom = AdjoinRoot.liftAlgHom g _ pb.gen h₂ := rfl -- This lemma should have the simp tag but this causes a lint issue. +set_option backward.isDefEq.respectTransparency.types false in theorem equiv'_symm_toAlgHom (h₁ : aeval (root g) (minpoly R pb.gen) = 0) (h₂ : aeval pb.gen g = 0) : (equiv' g pb h₁ h₂).symm.toAlgHom = pb.lift (root g) h₁ := rfl @@ -823,6 +830,7 @@ open Ideal DoubleQuot Polynomial variable [CommRing R] (I : Ideal R) (f : R[X]) +set_option backward.isDefEq.respectTransparency.types false in /-- The natural isomorphism `R[α]/(I[α]) ≅ R[α]/((I[x] ⊔ (f)) / (f))` for `α` a root of `f : R[X]` and `I : Ideal R`. @@ -833,9 +841,11 @@ def quotMapOfEquivQuotMapCMapMk : AdjoinRoot f ⧸ (I.map (C : R →+* R[X])).map (AdjoinRoot.mk f) := Ideal.quotEquivOfEq (by rw [of, AdjoinRoot.mk, Ideal.map_map]) +set_option backward.isDefEq.respectTransparency.types false in @[deprecated (since := "2026-03-02")] alias quotMapOfEquivQuotMapCMapSpanMk := quotMapOfEquivQuotMapCMapMk +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem quotMapOfEquivQuotMapCMapMk_mk (x : AdjoinRoot f) : quotMapOfEquivQuotMapCMapMk I f (Ideal.Quotient.mk (I.map (of f)) x) = @@ -845,6 +855,7 @@ theorem quotMapOfEquivQuotMapCMapMk_mk (x : AdjoinRoot f) : alias quotMapOfEquivQuotMapCMapSpanMk_mk := quotMapOfEquivQuotMapCMapMk_mk --this lemma should have the simp tag but this causes a lint issue +set_option backward.isDefEq.respectTransparency.types false in theorem quotMapOfEquivQuotMapCMapMk_symm_mk (x : AdjoinRoot f) : (quotMapOfEquivQuotMapCMapMk I f).symm (Ideal.Quotient.mk ((I.map (C : R →+* R[X])).map (Ideal.Quotient.mk (span {f}))) x) = @@ -923,6 +934,7 @@ def quotAdjoinRootEquivQuotPolynomialQuot : ((Ideal.quotEquivOfEq (by rw [map_span, Set.image_singleton])).trans (Polynomial.quotQuotEquivComm I f).symm)) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem quotAdjoinRootEquivQuotPolynomialQuot_mk_of (p : R[X]) : quotAdjoinRootEquivQuotPolynomialQuot I f (Ideal.Quotient.mk (I.map (of f)) (mk f p)) = @@ -980,6 +992,7 @@ open AdjoinRoot AlgEquiv variable [CommRing R] [CommRing S] [Algebra R S] +set_option backward.isDefEq.respectTransparency.types false in /-- Let `α` have minimal polynomial `f` over `R` and `I` be an ideal of `R`, then `R[α] / (I) = (R[x] / (f)) / pS = (R/p)[x] / (f mod p)`. -/ @[simps!] @@ -1013,6 +1026,7 @@ theorem quotientEquivQuotientMinpolyMap_apply_mk (pb : PowerBasis R S) (I : Idea AdjoinRoot.aeval_eq, AdjoinRoot.quotEquivQuotMap_apply_mk] -- This lemma should have the simp tag but this causes a lint issue. +set_option backward.isDefEq.respectTransparency.types false in theorem quotientEquivQuotientMinpolyMap_symm_apply_mk (pb : PowerBasis R S) (I : Ideal R) (g : R[X]) : (pb.quotientEquivQuotientMinpolyMap I).symm (Ideal.Quotient.mk (Ideal.span diff --git a/Mathlib/RingTheory/AlgebraTower.lean b/Mathlib/RingTheory/AlgebraTower.lean index c8ffbf2770592f..c9e8f6aaf7621d 100644 --- a/Mathlib/RingTheory/AlgebraTower.lean +++ b/Mathlib/RingTheory/AlgebraTower.lean @@ -42,7 +42,7 @@ variable [IsScalarTower R S A] [IsScalarTower R S B] /-- Suppose that `R → S → A` is a tower of algebras. If an element `r : R` is invertible in `S`, then it is invertible in `A`. -/ -@[implicit_reducible] +@[instance_reducible] def Invertible.algebraTower (r : R) [Invertible (algebraMap R S r)] : Invertible (algebraMap R A r) := Invertible.copy (Invertible.map (algebraMap S A) (algebraMap R S r)) (algebraMap R A r) @@ -50,7 +50,7 @@ def Invertible.algebraTower (r : R) [Invertible (algebraMap R S r)] : /-- A natural number that is invertible when coerced to `R` is also invertible when coerced to any `R`-algebra. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleAlgebraCoeNat (n : ℕ) [inv : Invertible (n : R)] : Invertible (n : A) := haveI : Invertible (algebraMap ℕ R n) := inv fast_instance% Invertible.algebraTower ℕ R A n diff --git a/Mathlib/RingTheory/Algebraic/Integral.lean b/Mathlib/RingTheory/Algebraic/Integral.lean index 7cf576e5fdc5b7..7093c6be1a8e4e 100644 --- a/Mathlib/RingTheory/Algebraic/Integral.lean +++ b/Mathlib/RingTheory/Algebraic/Integral.lean @@ -248,6 +248,7 @@ theorem restrictScalars_of_isIntegral [int : Algebra.IsIntegral R S] e, ← Algebra.smul_def, mul_comm, mul_smul] exact isIntegral_trans _ (int_s.smul _) +set_option backward.isDefEq.respectTransparency.types false in theorem restrictScalars [Algebra.IsAlgebraic R S] {a : A} (h : IsAlgebraic S a) : IsAlgebraic R a := by have ⟨p, hp, eval0⟩ := h diff --git a/Mathlib/RingTheory/Algebraic/MvPolynomial.lean b/Mathlib/RingTheory/Algebraic/MvPolynomial.lean index 632a314528adee..99c22200f9bff8 100644 --- a/Mathlib/RingTheory/Algebraic/MvPolynomial.lean +++ b/Mathlib/RingTheory/Algebraic/MvPolynomial.lean @@ -26,6 +26,7 @@ namespace MvPolynomial variable {σ : Type*} (R : Type*) [CommRing R] +set_option backward.isDefEq.respectTransparency false in theorem transcendental_supported_polynomial_aeval_X {i : σ} {s : Set σ} (h : i ∉ s) {f : R[X]} (hf : Transcendental R f) : Transcendental (supported R s) (Polynomial.aeval (X i : MvPolynomial σ R) f) := by diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean b/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean index b7bfb4a3f0bd0c..82d1e10c550e61 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Adjoin.lean @@ -35,6 +35,7 @@ variable {ι : Type*} variable {F E : Type*} {x : ι → E} [Field F] [Field E] [Algebra F E] (hx : AlgebraicIndependent F x) include hx +set_option backward.isDefEq.respectTransparency.types false in /-- Canonical isomorphism between rational function field and the intermediate field generated by algebraically independent elements. -/ def aevalEquivField : diff --git a/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean b/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean index fe8b9ca1b8d885..386a53e5daea89 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean @@ -47,6 +47,17 @@ variable [Algebra R S] [Algebra R A] [Algebra S A] [IsScalarTower R S A] open AlgebraicIndependent +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Set + Set.Subset + Set.diff + Set.insert + Subsemiring.closure + Subsemiring.mk' + adjoin + range + variable {R} in theorem exists_isTranscendenceBasis_superset {s : Set A} (hs : AlgebraicIndepOn R id s) : diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean b/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean index 9266cdcd630040..8affd7d367f242 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Transcendental.lean @@ -129,6 +129,7 @@ protected theorem AlgebraicIndepOn.insert {s : Set ι} {i : ι} (hs : AlgebraicI exact (insert_iff fun h ↦ hi <| isAlgebraic_algebraMap (⟨_, subset_adjoin ⟨i, h, rfl⟩⟩ : adjoin R (x '' s))).mpr ⟨hs, hi⟩ +set_option backward.isDefEq.respectTransparency false in theorem algebraicIndependent_of_set_of_finite (s : Set ι) (ind : AlgebraicIndependent R fun i : s ↦ x i) (H : ∀ t : Set ι, t.Finite → AlgebraicIndependent R (fun i : t ↦ x i) → diff --git a/Mathlib/RingTheory/Bezout.lean b/Mathlib/RingTheory/Bezout.lean index f3674690560a5f..2ec7ac95780d38 100644 --- a/Mathlib/RingTheory/Bezout.lean +++ b/Mathlib/RingTheory/Bezout.lean @@ -52,6 +52,7 @@ theorem _root_.Function.Surjective.isBezout {S : Type v} [CommRing S] (f : R → · rw [span_gcd, Ideal.map_span, Set.image_insert_eq, Set.image_singleton] · rw [Ideal.map_span, Set.image_singleton] +set_option backward.isDefEq.respectTransparency false in theorem TFAE [IsBezout R] [IsDomain R] : List.TFAE [IsNoetherianRing R, IsPrincipalIdealRing R, UniqueFactorizationMonoid R, WfDvdMonoid R] := by diff --git a/Mathlib/RingTheory/Bialgebra/Basic.lean b/Mathlib/RingTheory/Bialgebra/Basic.lean index 323f33e19674de..ccd0f9ab6c34f6 100644 --- a/Mathlib/RingTheory/Bialgebra/Basic.lean +++ b/Mathlib/RingTheory/Bialgebra/Basic.lean @@ -103,7 +103,7 @@ is an `R`-algebra with a coalgebra structure, then `Bialgebra.mk'` consumes proofs that the counit and comultiplication preserve the identity and multiplication, and produces a bialgebra structure on `A`. -/ -@[implicit_reducible] +@[instance_reducible] def mk' (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] [Algebra R A] [C : Coalgebra R A] (counit_one : C.counit 1 = 1) (counit_mul : ∀ {a b}, C.counit (a * b) = C.counit a * C.counit b) diff --git a/Mathlib/RingTheory/Bialgebra/Equiv.lean b/Mathlib/RingTheory/Bialgebra/Equiv.lean index 8aabbb7b9cbad0..5f12855e9796ec 100644 --- a/Mathlib/RingTheory/Bialgebra/Equiv.lean +++ b/Mathlib/RingTheory/Bialgebra/Equiv.lean @@ -324,6 +324,7 @@ variable [Semiring A] [Semiring B] [Bialgebra R A] [Bialgebra R B] lemma toLinearMap_ofAlgEquiv (f : A ≃ₐ[R] B) (counit_comp map_comp_comul) : (ofAlgEquiv f counit_comp map_comp_comul : A →ₗ[R] B) = f := rfl +set_option backward.isDefEq.respectTransparency false in /-- Promotes a bijective bialgebra homomorphism to a bialgebra equivalence. -/ @[simps! apply] noncomputable def ofBijective (f : A →ₐc[R] B) (hf : Bijective f) : A ≃ₐc[R] B := diff --git a/Mathlib/RingTheory/Bialgebra/Hom.lean b/Mathlib/RingTheory/Bialgebra/Hom.lean index 1c65b1dafdaf2d..9a164268f3d857 100644 --- a/Mathlib/RingTheory/Bialgebra/Hom.lean +++ b/Mathlib/RingTheory/Bialgebra/Hom.lean @@ -65,6 +65,7 @@ variable [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [CoalgebraStruct R A] [CoalgebraStruct R B] [FunLike F A B] [BialgHomClass F R A B] +set_option backward.isDefEq.respectTransparency false in instance (priority := 100) toAlgHomClass : AlgHomClass F R A B where map_mul := map_mul map_one := map_one diff --git a/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean b/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean index fb4f490cda5313..9dbe2b156ccb53 100644 --- a/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean +++ b/Mathlib/RingTheory/Bialgebra/MonoidAlgebra.lean @@ -52,6 +52,7 @@ instance instBialgebra : Bialgebra R A[M] where LinearMap.compl₁₂_apply, LinearMap.coe_sum, Finset.sum_apply, Finset.sum_comm (s := (Coalgebra.Repr.arbitrary R b).index)] +set_option backward.isDefEq.respectTransparency false in -- TODO: Generalise to `A[M] →ₐc[R] A[N]` under `Bialgebra R A` variable (R) [AddMonoid M] [AddMonoid N] in /-- If `f : M → N` is a monoid hom, then `AddMonoidAlgebra.mapDomain f` is a bialgebra hom between @@ -60,6 +61,7 @@ noncomputable def _root_.AddMonoidAlgebra.mapDomainBialgHom (f : M →+ N) : AddMonoidAlgebra R M →ₐc[R] AddMonoidAlgebra R N := .ofAlgHom (AddMonoidAlgebra.mapDomainAlgHom R R f) (by ext; simp) (by ext; simp) +set_option backward.isDefEq.respectTransparency false in -- TODO: Generalise to `A[M] →ₐc[R] A[N]` under `Bialgebra R A` variable (R) in /-- If `f : M → N` is a monoid hom, then `MonoidAlgebra.mapDomain f` is a bialgebra hom between @@ -68,9 +70,11 @@ their monoid algebras. -/ noncomputable def mapDomainBialgHom (f : M →* N) : R[M] →ₐc[R] R[N] := .ofAlgHom (mapDomainAlgHom R R f) (by ext; simp) (by ext; simp) +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainBialgHom_id : mapDomainBialgHom R (.id M) = .id R R[M] := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] lemma mapDomainBialgHom_comp (f : N →* O) (g : M →* N) : mapDomainBialgHom R (f.comp g) = (mapDomainBialgHom R f).comp (mapDomainBialgHom R g) := by diff --git a/Mathlib/RingTheory/ChainOfDivisors.lean b/Mathlib/RingTheory/ChainOfDivisors.lean index 9a0b005f8e0073..b164f14a13a444 100644 --- a/Mathlib/RingTheory/ChainOfDivisors.lean +++ b/Mathlib/RingTheory/ChainOfDivisors.lean @@ -244,8 +244,10 @@ variable [UniqueFactorizationMonoid N] [UniqueFactorizationMonoid M] open DivisorChain + set_option linter.overlappingInstances false +set_option backward.isDefEq.respectTransparency false in theorem pow_image_of_prime_by_factor_orderIso_dvd {m p : Associates M} {n : Associates N} (hn : n ≠ 0) (hp : p ∈ normalizedFactors m) (d : Set.Iic m ≃o Set.Iic n) {s : ℕ} (hs' : p ^ s ≤ m) : diff --git a/Mathlib/RingTheory/Congruence/Hom.lean b/Mathlib/RingTheory/Congruence/Hom.lean index 24730a89106c74..4a46f34f2b4a46 100644 --- a/Mathlib/RingTheory/Congruence/Hom.lean +++ b/Mathlib/RingTheory/Congruence/Hom.lean @@ -127,6 +127,7 @@ theorem mapGen_apply_apply_of_surjective refine ⟨fun ⟨a, b, h₁, h₂, h₃⟩ ↦ ?_, by grind⟩ exact c.trans (h h₂.symm) <| c.trans h₁ <| h h₃ +set_option backward.isDefEq.respectTransparency false in /-- Given a ring congruence relation `c` on a semiring `M`, the order-preserving bijection between the set of ring congruence relations containing `c` and the ring congruence relations on the quotient of `M` by `c`. -/ @@ -336,6 +337,7 @@ noncomputable def comapQuotientEquivOfSurj (c.comapQuotientEquivOfSurj f hf hcd).symm (f x) = x := by rw [← c.comapQuotientEquivOfSurj_mk hf hcd x, RingEquiv.symm_apply_apply] +set_option backward.isDefEq.respectTransparency false in /-- This version infers the surjectivity of the function from a RingEquiv function -/ @[simp] lemma comapQuotientEquivOfSurj_symm_mk' (c : RingCon M) (f : N ≃+* M) {d : RingCon N} (hcd : d = c.comap f) (x : N) : diff --git a/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean b/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean index 41a036799faf36..fcd1adc681f95a 100644 --- a/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean +++ b/Mathlib/RingTheory/DedekindDomain/AdicValuation.lean @@ -236,6 +236,7 @@ theorem intValuation_lt_one_iff_mem (r : R) : v.intValuation r < 1 ↔ r ∈ v.asIdeal := by rw [intValuation_lt_one_iff_dvd, Ideal.dvd_span_singleton] +set_option backward.isDefEq.respectTransparency.types false in /-- The `v`-adic valuation of `r : R` is equal to 1 if and only if `r ∈ vᶜ`. -/ theorem intValuation_eq_one_iff_mem_primeCompl (r : R) : v.intValuation r = 1 ↔ r ∈ v.asIdeal.primeCompl := by @@ -327,12 +328,14 @@ theorem valuation_def (x : K) : (fun r hr => Set.mem_compl (v.intValuation_ne_zero' ⟨r, hr⟩)) K x := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The `v`-adic valuation of `r / s : K` is the valuation of `r` divided by the valuation of `s`. -/ theorem valuation_of_mk' {r : R} {s : nonZeroDivisors R} : v.valuation K (IsLocalization.mk' K r s) = v.intValuation r / v.intValuation s := by rw [valuation_def, Valuation.extendToLocalization_mk', div_eq_mul_inv] +set_option backward.isDefEq.respectTransparency.types false in open scoped algebraMap in /-- The `v`-adic valuation on `K` extends the `v`-adic valuation on `R`. -/ theorem valuation_of_algebraMap (r : R) : v.valuation K r = v.intValuation r := by @@ -579,7 +582,7 @@ ring of integers, denoted `v.adicCompletionIntegers`. -/ /-- `K` as a valued field with the `v`-adic valuation. -/ -@[implicit_reducible] +@[instance_reducible] def adicValued : Valued K ℤᵐ⁰ := Valued.mk' (v.valuation K) diff --git a/Mathlib/RingTheory/DedekindDomain/Different.lean b/Mathlib/RingTheory/DedekindDomain/Different.lean index e0189143a01d15..da915ac3ad0639 100644 --- a/Mathlib/RingTheory/DedekindDomain/Different.lean +++ b/Mathlib/RingTheory/DedekindDomain/Different.lean @@ -150,8 +150,7 @@ lemma map_equiv_traceDual [IsDomain A] [IsFractionRing B L] [IsDomain B] traceDual A K (I.map (FractionRing.algEquiv B L).toLinearEquiv.toLinearMap) rw [Submodule.map_equiv_eq_comap_symm, Submodule.map_equiv_eq_comap_symm] ext x - simp only [traceDual, Submodule.mem_comap, - Submodule.mem_mk] + simp only [traceDual, Submodule.mem_comap] apply (FractionRing.algEquiv B L).forall_congr simp only [restrictScalars_mem, LinearEquiv.coe_coe, AlgEquiv.coe_symm_toLinearEquiv, traceForm_apply, mem_one, AlgEquiv.toEquiv_eq_coe, EquivLike.coe_coe, mem_comap, @@ -261,6 +260,7 @@ local notation:max I:max "ᵛ" => Submodule.traceDual A K I variable [IsDedekindDomain B] {I J : FractionalIdeal B⁰ L} +set_option backward.isDefEq.respectTransparency.types false in lemma coe_dual (hI : I ≠ 0) : (dual A K I : Submodule B L) = Iᵛ := by rw [dual, dif_neg hI, coe_mk] @@ -272,12 +272,14 @@ lemma coe_dual_one : rw [← coe_one, coe_dual] exact one_ne_zero +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma dual_zero : dual A K (0 : FractionalIdeal B⁰ L) = 0 := by rw [dual, dif_pos rfl] variable {A K L B} +set_option backward.isDefEq.respectTransparency.types false in lemma mem_dual (hI : I ≠ 0) {x} : x ∈ dual A K I ↔ ∀ a ∈ I, traceForm K L x a ∈ (algebraMap A K).range := by rw [dual, dif_neg hI]; exact forall₂_congr fun _ _ ↦ mem_one @@ -314,6 +316,7 @@ lemma dual_ne_zero_iff : variable (A K) +set_option backward.isDefEq.respectTransparency.types false in lemma le_dual_inv_aux (hI : I ≠ 0) (hIJ : I * J ≤ 1) : J ≤ dual A K I := by rw [dual, dif_neg hI] diff --git a/Mathlib/RingTheory/DedekindDomain/Factorization.lean b/Mathlib/RingTheory/DedekindDomain/Factorization.lean index bcbafee9cef0a0..d8877b60583d1b 100644 --- a/Mathlib/RingTheory/DedekindDomain/Factorization.lean +++ b/Mathlib/RingTheory/DedekindDomain/Factorization.lean @@ -66,6 +66,17 @@ variable {R : Type*} [CommRing R] {K : Type*} [Field K] [Algebra R K] [IsFractio variable [IsDedekindDomain R] (v : HeightOneSpectrum R) +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Algebra.lsmul + DistribSMul.toLinearMap + Filter.Eventually + Filter.cofinite + Filter.comk + HasFiniteMulSupport + Set + Set.Finite + open scoped Classical in /-- Given a maximal ideal `v` and an ideal `I` of `R`, `maxPowDividing` returns the maximal power of `v` dividing `I`. -/ @@ -214,6 +225,7 @@ theorem finprod_heightOneSpectrum_factorization {I : Ideal R} (hI : I ≠ 0) : apply Ideal.finprod_count ⟨J, Ideal.isPrime_of_prime (irreducible_iff_prime.mp hv), Irreducible.ne_zero hv⟩ I hI +set_option backward.isDefEq.respectTransparency.types false in /-- The ideal `I` equals the inf `⨅_v v^(val_v(I))`. -/ theorem iInf_maxPowDividing_eq {I : Ideal R} (h0 : I ≠ 0) : ⨅ i : HeightOneSpectrum R, i.maxPowDividing I = I := by @@ -528,6 +540,7 @@ theorem count_finsuppProd (exps : HeightOneSpectrum R →₀ ℤ) : exps.mem_support_iff, ne_eq, ite_not, ite_eq_right_iff, @eq_comm ℤ 0, imp_self] · exact fun v hv ↦ zpow_ne_zero _ (coeIdeal_ne_zero.mpr v.ne_bot) +set_option backward.isDefEq.respectTransparency.types false in /-- If `exps` is finitely supported, then `val_v(∏_w w^{exps w}) = exps v`. -/ theorem count_finprod (exps : HeightOneSpectrum R → ℤ) (h_exps : ∀ᶠ v : HeightOneSpectrum R in Filter.cofinite, exps v = 0) : diff --git a/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean b/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean index 0091ef4e0d94a1..61dd0114ec668d 100644 --- a/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean +++ b/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean @@ -591,6 +591,7 @@ def comap (f : R →+* S) (hf : Function.Surjective f) (v : HeightOneSpectrum S) isPrime := v.asIdeal.comap_isPrime f ne_bot := (Ideal.eq_bot_of_comap_eq_bot' hf).mt v.ne_bot +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism between `HeightOneSpectrum`s of isomorphic rings. -/ @[simps] def equivOfRingEquiv (e : R ≃+* S) : (HeightOneSpectrum R) ≃ (HeightOneSpectrum S) where @@ -697,6 +698,7 @@ theorem idealFactorsEquivOfQuotEquiv_symm : @[deprecated (since := "2026-04-16")] alias _root_.idealFactorsEquivOfQuotEquiv_symm := idealFactorsEquivOfQuotEquiv_symm +set_option backward.isDefEq.respectTransparency.types false in theorem idealFactorsEquivOfQuotEquiv_is_dvd_iso {L M : Ideal R} (hL : L ∣ I) (hM : M ∣ I) : (idealFactorsEquivOfQuotEquiv f ⟨L, hL⟩ : Ideal A) ∣ idealFactorsEquivOfQuotEquiv f ⟨M, hM⟩ ↔ L ∣ M := by @@ -757,6 +759,7 @@ theorem normalizedFactorsEquivOfQuotEquiv_symm (hI : I ≠ ⊥) (hJ : J ≠ ⊥) @[deprecated (since := "2026-04-16")] alias _root_.normalizedFactorsEquivOfQuotEquiv_symm := normalizedFactorsEquivOfQuotEquiv_symm +set_option backward.isDefEq.respectTransparency.types false in /-- The map `normalizedFactorsEquivOfQuotEquiv` preserves multiplicities. -/ theorem normalizedFactorsEquivOfQuotEquiv_emultiplicity_eq_emultiplicity (hI : I ≠ ⊥) (hJ : J ≠ ⊥) (L : Ideal R) (hL : L ∈ normalizedFactors I) : @@ -1057,6 +1060,7 @@ alias _root_.emultiplicity_eq_emultiplicity_span := emultiplicity_eq_emultiplici section NormalizationMonoid variable [NormalizationMonoid R] +set_option backward.isDefEq.respectTransparency.types false in /-- The bijection between the (normalized) prime factors of `r` and the (normalized) prime factors of `span {r}` -/ noncomputable def normalizedFactorsEquivSpanNormalizedFactors {r : R} (hr : r ≠ 0) : @@ -1087,6 +1091,7 @@ noncomputable def normalizedFactorsEquivSpanNormalizedFactors {r : R} (hr : r alias _root_.normalizedFactorsEquivSpanNormalizedFactors := normalizedFactorsEquivSpanNormalizedFactors +set_option backward.isDefEq.respectTransparency.types false in /-- The bijection `normalizedFactorsEquivSpanNormalizedFactors` between the set of prime factors of `r` and the set of prime factors of the ideal `⟨r⟩` preserves multiplicities. See `count_normalizedFactorsSpan_eq_count` for the version stated in terms of multisets `count`. -/ diff --git a/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean b/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean index 7e8ffa3eefa9d3..150fb2e01fbd77 100644 --- a/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean +++ b/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean @@ -57,6 +57,7 @@ variable [Algebra K L] [Algebra A L] [IsScalarTower A K L] variable [Algebra C L] [IsIntegralClosure C A L] [Algebra A C] [IsScalarTower A C L] include K L +set_option backward.isDefEq.respectTransparency.types false in /-- If `L` is an algebraic extension of `K = Frac(A)` and `L` has no zero smul divisors by `A`, then `L` is the localization of the integral closure `C` of `A` in `L` at `A⁰`. -/ theorem IsIntegralClosure.isLocalization [IsDomain A] [Algebra.IsAlgebraic K L] : diff --git a/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean b/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean index 78804ef7d5efc4..b989f4feb4b639 100644 --- a/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean +++ b/Mathlib/RingTheory/DedekindDomain/SelmerGroup.lean @@ -93,6 +93,7 @@ def valuationOfNeZeroToFun (x : Kˣ) : Multiplicative ℤ := (-(Associates.mk v.asIdeal).count (Associates.mk <| Ideal.span {hx.fst}).factors : ℤ) - (-(Associates.mk v.asIdeal).count (Associates.mk <| Ideal.span {(hx.snd : R)}).factors : ℤ) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem valuationOfNeZeroToFun_eq (x : Kˣ) : (v.valuationOfNeZeroToFun x : ℤᵐ⁰) = v.valuation K x := by diff --git a/Mathlib/RingTheory/Derivation/Basic.lean b/Mathlib/RingTheory/Derivation/Basic.lean index 4473baba2d14ad..ee9975ceb09a21 100644 --- a/Mathlib/RingTheory/Derivation/Basic.lean +++ b/Mathlib/RingTheory/Derivation/Basic.lean @@ -264,6 +264,7 @@ variable {N : Type*} [AddCommMonoid N] [Module A N] [Module R N] [IsScalarTower variable (f : M →ₗ[A] N) (e : M ≃ₗ[A] N) +set_option backward.isDefEq.respectTransparency false in /-- We can push forward derivations using linear maps, i.e., the composition of a derivation with a linear map is a derivation. Furthermore, this operation is linear on the spaces of derivations. -/ def _root_.LinearMap.compDer : Derivation R A M →ₗ[A] Derivation R A N where @@ -360,6 +361,7 @@ variable [CommSemiring R] [CommRing A] [CommRing M] variable [Algebra R A] [Algebra R M] variable {F : Type*} [FunLike F A M] [AlgHomClass F R A M] +set_option backward.isDefEq.respectTransparency false in /-- Lift a derivation via an algebra homomorphism `f` with a right inverse such that `f(x) = 0 → f(d(x)) = 0`. This gives the derivation `f ∘ d ∘ f⁻¹`. diff --git a/Mathlib/RingTheory/Derivation/MapCoeffs.lean b/Mathlib/RingTheory/Derivation/MapCoeffs.lean index 22a21b6dbe2b30..c575960de6dcc7 100644 --- a/Mathlib/RingTheory/Derivation/MapCoeffs.lean +++ b/Mathlib/RingTheory/Derivation/MapCoeffs.lean @@ -67,10 +67,12 @@ def mapCoeffs : Derivation R A[X] (PolynomialModule A M) where lemma mapCoeffs_apply (p : A[X]) (i) : d.mapCoeffs p i = d (coeff p i) := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mapCoeffs_monomial (n : ℕ) (x : A) : d.mapCoeffs (monomial n x) = .single A n (d x) := Finsupp.ext fun _ ↦ by - simp [coeff_monomial, apply_ite d, PolynomialModule.single_apply] + -- TODO: This should work: `simp [coeff_monomial, apply_ite d, PolynomialModule.single_apply]` + rw [PolynomialModule.single_apply, mapCoeffs_apply, coeff_monomial, apply_ite d, map_zero] @[simp] lemma mapCoeffs_X : @@ -96,6 +98,7 @@ theorem apply_aeval_eq' (d' : Derivation R B M') (f : M →ₗ[A] M') rw [add_comm, ← smul_smul, ← smul_smul, Nat.cast_smul_eq_nsmul] +set_option backward.isDefEq.respectTransparency.types false in theorem apply_aeval_eq [IsScalarTower R A B] [IsScalarTower A B M'] (d : Derivation R B M') (x : B) (p : A[X]) : d (aeval x p) = PolynomialModule.eval x ((d.compAlgebraMap A).mapCoeffs p) + @@ -128,6 +131,7 @@ def mapCoeffs : Derivation ℤ A[X] A[X] := lemma coeff_mapCoeffs (p : A[X]) (i) : coeff (mapCoeffs p) i = (coeff p i)′ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma mapCoeffs_monomial (n : ℕ) (x : A) : mapCoeffs (monomial n x) = monomial n x′ := by @@ -143,6 +147,7 @@ lemma mapCoeffs_C (x : A) : variable {R : Type*} [CommRing R] [Differential R] [Algebra A R] [DifferentialAlgebra A R] +set_option backward.isDefEq.respectTransparency.types false in theorem deriv_aeval_eq (x : R) (p : A[X]) : (aeval x p)′ = aeval x (mapCoeffs p) + aeval x (derivative p) * x′ := by convert! Derivation.apply_aeval_eq' Differential.deriv _ (Algebra.linearMap A R) .. diff --git a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean index 5f1afd7e13874c..609a8d80b6523d 100644 --- a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean +++ b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean @@ -511,6 +511,7 @@ lemma addVal_eq_iff_associated (x y : R) : variable (R) +set_option backward.isDefEq.respectTransparency.types false in /-- The ideals of a discrete valuation ring are exactly the powers of the maximal ideal. -/ @[simps apply] noncomputable def idealOrderIsoENat : Ideal R ≃o ENatᵒᵈ where @@ -549,6 +550,7 @@ theorem idealOrderIsoENat_symm_apply_coe_of_irreducible (n : ℕ) {ϖ : R} (hϖ (idealOrderIsoENat R).symm n = Ideal.span {ϖ ^ n} := by rw [idealOrderIsoENat_symm_apply_coe, hϖ.maximalIdeal_eq, span_singleton_pow] +set_option backward.isDefEq.respectTransparency.types false in theorem coheight_pow_maximalIdeal (n : ℕ) : Order.coheight (maximalIdeal R ^ n) = n := by simpa only [Order.coheight_toDual, Order.height_enat] using! Order.coheight_orderIso (idealOrderIsoENat R).symm (.toDual n) @@ -621,7 +623,7 @@ variable (R) in only takes two steps to terminate. Given `GCD(x,y)`, if `x ∣ y` then `y%x = 0` so we're done in one step; otherwise `y%x = y` and then `GCD(x,y) = GCD(y,x)` which brings us back to the first case. See `EuclideanDomain.to_principal_ideal_domain` for EuclideanDomain ⇒ PID. -/ -@[implicit_reducible] +@[instance_reducible] def toEuclideanDomain : EuclideanDomain R where quotient := quotient quotient_zero x := by simp [quotient] diff --git a/Mathlib/RingTheory/DividedPowers/Padic.lean b/Mathlib/RingTheory/DividedPowers/Padic.lean index bc8abcc6e1c6b7..6e292fb25236ae 100644 --- a/Mathlib/RingTheory/DividedPowers/Padic.lean +++ b/Mathlib/RingTheory/DividedPowers/Padic.lean @@ -133,6 +133,7 @@ private theorem dpow'_mem {n : ℕ} {x : ℤ_[p]} (hm : n ≠ 0) (hx : x ∈ Ide simp only [cast_one, zpow_neg_one] exact dpow'_norm_le_of_ne_zero p hm hx +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- The family `ℕ → Ideal.span {(p : ℤ_[p])} → ℤ_[p]` given by `dpow n x = x ^ n / n!` is a @@ -152,6 +153,7 @@ noncomputable def dividedPowers : DividedPowers (Ideal.span {(p : ℤ_[p])}) := open Function +set_option backward.isDefEq.respectTransparency false in private lemma dividedPowers_eq (n : ℕ) (x : ℤ_[p]) : (dividedPowers p).dpow n x = open Classical in if hx : x ∈ Ideal.span {(p : ℤ_[p])} then ⟨dpow' p n x, dpow'_int p n hx⟩ else 0 := by @@ -166,6 +168,7 @@ private lemma dividedPowers_eq (n : ℕ) (x : ℤ_[p]) : RatAlgebra.dpow_apply, Submodule.mem_top] using! heq.symm · rfl +set_option backward.isDefEq.respectTransparency false in lemma coe_dpow_eq (n : ℕ) (x : ℤ_[p]) : ((dividedPowers p).dpow n x : ℚ_[p]) = open Classical in if _ : x ∈ Ideal.span {(p : ℤ_[p])} then inverse (n ! : ℚ_[p]) * x ^ n else 0 := by diff --git a/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean b/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean index 84457d0550feaa..5c0ee3330e1063 100644 --- a/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean +++ b/Mathlib/RingTheory/DividedPowers/SubDPIdeal.lean @@ -345,6 +345,7 @@ instance : SupSet (SubDPIdeal hI) := theorem sSup_carrier_def (S : Set (SubDPIdeal hI)) : (sSup S).carrier = sSup ((toIdeal) '' S) := rfl +set_option backward.isDefEq.respectTransparency false in instance : CompleteLattice (SubDPIdeal hI) := by refine Function.Injective.completeLattice (fun J : SubDPIdeal hI ↦ (J : Set.Iic I)) (fun J J' h ↦ by simpa only [SubDPIdeal.ext_iff, Subtype.mk.injEq] using h) diff --git a/Mathlib/RingTheory/Etale/Kaehler.lean b/Mathlib/RingTheory/Etale/Kaehler.lean index 90b4de8ee12988..236b663af8133a 100644 --- a/Mathlib/RingTheory/Etale/Kaehler.lean +++ b/Mathlib/RingTheory/Etale/Kaehler.lean @@ -230,6 +230,7 @@ def tensorCotangent [alg : Algebra P.Ring Q.Ring] (halg : algebraMap P.Ring Q.Ri simp only [LinearMap.liftBaseChange_tmul, map_smul] simp [Hom.mapKer, tensorCotangentInvFun_smul_mk] } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `J ≃ Q ⊗ₚ I`, `S → T` is flat and `P → Q` is formally étale, then `T ⊗ H¹(L_P) ≃ H¹(L_Q)`. -/ noncomputable diff --git a/Mathlib/RingTheory/Etale/QuasiFinite.lean b/Mathlib/RingTheory/Etale/QuasiFinite.lean index 41233a5afde995..32fc22a34cf120 100644 --- a/Mathlib/RingTheory/Etale/QuasiFinite.lean +++ b/Mathlib/RingTheory/Etale/QuasiFinite.lean @@ -44,6 +44,7 @@ def Ideal.fiberIsoOfBijectiveResidueField (PrimeSpectrum.primesOverOrderIsoFiber ..).trans <| (PrimeSpectrum.comapEquiv e.toRingEquiv).trans (PrimeSpectrum.primesOverOrderIsoFiber ..).symm +set_option backward.isDefEq.respectTransparency.types false in lemma Ideal.comap_fiberIsoOfBijectiveResidueField_symm (H : Function.Bijective (Ideal.ResidueField.mapₐ p q (Algebra.ofId _ _) (q.over_def p))) (Q : p.primesOver S) : @@ -162,7 +163,7 @@ lemma Algebra.exists_notMem_and_isIntegral_forall_mem_of_ne_of_liesOver wlog hm0 : 0 < m generalizing m · refine this (m + 1) (by grind) (by simp) have hs₃q : s₃.1 ∉ q := fun h ↦ (show ↑s₂ ^ m * (s₁ * ↑s₂ ^ n) ∉ q from q.primeCompl.mul_mem - (pow_mem hs₂q _) (mul_mem hs₁q (pow_mem hs₂q _))) (hm ▸ Ideal.mul_mem_left _ _ h) + (pow_mem hs₂q _) (mul_mem hs₁q (pow_mem hs₂q _))) (hm ▸ Ideal.mul_mem_left _ _ h) refine ⟨↑s₂ ^ m * ↑s₃, q.primeCompl.mul_mem (pow_mem hs₂q _) hs₃q, (s₂ ^ m * s₃).2, fun q' _ hq'q _ ↦ hm ▸ Ideal.mul_mem_left _ _ (Ideal.mul_mem_right _ _ (hs₁ q' ‹_› hq'q ‹_›)), fun q' _ hq'q _ ↦ ?_⟩ diff --git a/Mathlib/RingTheory/Etale/StandardEtale.lean b/Mathlib/RingTheory/Etale/StandardEtale.lean index f245cc4c4dc149..273fb8ef80bd67 100644 --- a/Mathlib/RingTheory/Etale/StandardEtale.lean +++ b/Mathlib/RingTheory/Etale/StandardEtale.lean @@ -196,6 +196,7 @@ to not abuse the defeq between the two. -/ def equivPolynomialQuotient : P.Ring ≃ₐ[R] R[X][Y] ⧸ Ideal.span {C P.f, Y * C P.g - 1} := .refl .. +set_option backward.isDefEq.respectTransparency.types false in /-- `R[X][Y]/⟨f, Yg-1⟩ ≃ (R[X]/f)[1/g]` -/ def equivAwayAdjoinRoot : P.Ring ≃ₐ[R] Localization.Away (AdjoinRoot.mk P.f P.g) := by @@ -210,6 +211,7 @@ def equivAwayAdjoinRoot : · ext; simp [Algebra.algHom] · ext; simp +set_option backward.isDefEq.respectTransparency.types false in /-- `R[X][Y]/⟨f, Yg-1⟩ ≃ R[X][1/g]/f` -/ def equivAwayQuotient : P.Ring ≃ₐ[R] Localization.Away P.g ⧸ Ideal.span {algebraMap _ (Localization.Away P.g) P.f} := by @@ -284,6 +286,7 @@ lemma StandardEtalePresentation.equivRing_symm_X : P.equivRing.symm P.X = P.x := lemma StandardEtalePresentation.equivRing_x : P.equivRing P.x = P.X := (P.equivRing.symm_apply_eq.mp P.equivRing_symm_X).symm +set_option backward.isDefEq.respectTransparency.types false in /-- The `Algebra.Presentation` associated to a standard etale presentation. -/ @[simps! relation val] def StandardEtalePresentation.toPresentation : Algebra.Presentation R S (Fin 2) (Fin 2) where @@ -300,6 +303,7 @@ def StandardEtalePresentation.toPresentation : Algebra.Presentation R S (Fin 2) RingHom.ker_comp_of_injective _ (by exact P.equivMvPolynomialQuotient.symm.injective)] simp [Set.pair_comm] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma StandardEtalePresentation.aeval_val_equivMvPolynomial (p : R[X]) : MvPolynomial.aeval P.toPresentation.val (Bivariate.equivMvPolynomial R (.C p)) = p.aeval P.x := by @@ -313,6 +317,7 @@ attribute [local simp] Algebra.PreSubmersivePresentation.jacobian_eq_jacobiMatri Polynomial.Bivariate.pderiv_zero_equivMvPolynomial Polynomial.Bivariate.pderiv_one_equivMvPolynomial +set_option backward.isDefEq.respectTransparency.types false in /-- The `Algebra.SubmersivePresentation` associated to a standard etale presentation. -/ @[simps map toPreSubmersivePresentation_toPresentation] def StandardEtalePresentation.toSubmersivePresentation : @@ -322,10 +327,12 @@ def StandardEtalePresentation.toSubmersivePresentation : map_inj := Function.injective_id jacobian_isUnit := by simp [P.hasMap.2, P.hasMap.isUnit_derivative_f] +set_option backward.isDefEq.respectTransparency.types false in lemma StandardEtalePresentation.toSubmersivePresentation_jacobian : P.toSubmersivePresentation.jacobian = aeval P.x P.f.derivative * aeval P.x P.g := by simp [StandardEtalePresentation.toSubmersivePresentation] +set_option backward.isDefEq.respectTransparency.types false in lemma StandardEtalePresentation.exists_mul_aeval_x_g_pow_eq_aeval_x (x : S) : ∃ p : R[X], ∃ n, x * P.g.aeval P.x ^ n = p.aeval P.x := by obtain ⟨x, rfl⟩ := (P.equivRing.trans P.P.equivAwayAdjoinRoot).symm.surjective x @@ -335,6 +342,7 @@ lemma StandardEtalePresentation.exists_mul_aeval_x_g_pow_eq_aeval_x (x : S) : simpa [← aeval_algHom_apply, StandardEtalePair.equivAwayAdjoinRoot, ← aeval_def] using congr(P.equivAwayAdjoinRoot.symm $e) +set_option backward.isDefEq.respectTransparency.types false in /-- Mapping `StandardEtalePresentation` under `AlgEquiv`s. -/ def StandardEtalePresentation.mapEquiv (e : S ≃ₐ[R] T) : StandardEtalePresentation R T where P := P.P @@ -352,6 +360,7 @@ lemma StandardEtalePresentation.hom_ext {f₁ f₂ : S →ₐ[R] T} (h : f₁ P. open scoped TensorProduct +set_option backward.isDefEq.respectTransparency.types false in /-- The base change of a standard etale algebra is standard etale. -/ noncomputable def StandardEtalePresentation.baseChange : @@ -398,6 +407,7 @@ instance : IsStandardEtale R R := (by ext) (by ext; simp [this]) exact e.bijective⟩⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma IsStandardEtale.of_isLocalizationAway [IsStandardEtale R S] {Sₛ : Type*} [CommRing Sₛ] [Algebra S Sₛ] [Algebra R Sₛ] [IsScalarTower R S Sₛ] (s : S) [IsLocalization.Away s Sₛ] : diff --git a/Mathlib/RingTheory/Etale/Weakly.lean b/Mathlib/RingTheory/Etale/Weakly.lean index a9d2e767e8f96d..eaca184bed284e 100644 --- a/Mathlib/RingTheory/Etale/Weakly.lean +++ b/Mathlib/RingTheory/Etale/Weakly.lean @@ -42,6 +42,7 @@ attribute [instance] WeaklyEtale.flat namespace WeaklyEtale +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] ULift.algebra' in lemma ulift_iff : WeaklyEtale (ULift.{u₁} R) (ULift.{u₂} S) ↔ WeaklyEtale R S := by rw [weaklyEtale_iff, weaklyEtale_iff, Module.Flat.ulift_left_iff, Module.Flat.ulift_right_iff] diff --git a/Mathlib/RingTheory/EuclideanDomain.lean b/Mathlib/RingTheory/EuclideanDomain.lean index 4a4886ca992141..5cb9cba539d06d 100644 --- a/Mathlib/RingTheory/EuclideanDomain.lean +++ b/Mathlib/RingTheory/EuclideanDomain.lean @@ -69,7 +69,7 @@ end GCDMonoid namespace EuclideanDomain /-- Create a `GCDMonoid` whose `GCDMonoid.gcd` matches `EuclideanDomain.gcd`. -/ -@[implicit_reducible] +@[instance_reducible] def gcdMonoid (R) [EuclideanDomain R] [DecidableEq R] : GCDMonoid R where gcd := gcd lcm := lcm diff --git a/Mathlib/RingTheory/Extension/Basic.lean b/Mathlib/RingTheory/Extension/Basic.lean index a8dfd5bfca222c..4dcb76764e85e4 100644 --- a/Mathlib/RingTheory/Extension/Basic.lean +++ b/Mathlib/RingTheory/Extension/Basic.lean @@ -359,6 +359,7 @@ lemma Cotangent.smul_eq_zero_of_mem (p : P.Ring) (hp : p ∈ P.ker) (m : P.ker.C attribute [local simp] RingHom.mem_ker +set_option backward.isDefEq.respectTransparency.types false in noncomputable instance Cotangent.module : Module S P.Cotangent where smul := fun r s ↦ .of (P.σ r • s.val) @@ -387,10 +388,12 @@ instance {R₁ R₂} [CommRing R₁] [CommRing R₂] [Algebra R₁ S] [Algebra R change algebraMap R₂ S (r • s) • m = (algebraMap _ S r) • (algebraMap _ S s) • m rw [Algebra.smul_def, map_mul, mul_smul, ← IsScalarTower.algebraMap_apply] +set_option backward.isDefEq.respectTransparency.types false in /-- The action of `R₀` on `P.Cotangent` for an extension `P → S`, if `S` is an `R₀` algebra. -/ lemma Cotangent.val_smul''' {R₀} [CommRing R₀] [Algebra R₀ S] (r : R₀) (x : P.Cotangent) : (r • x).val = P.σ (algebraMap R₀ S r) • x.val := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- The action of `S` on `P.Cotangent` for an extension `P → S`. -/ @[simp] lemma Cotangent.val_smul (r : S) (x : P.Cotangent) : (r • x).val = P.σ r • x.val := rfl diff --git a/Mathlib/RingTheory/Extension/Cotangent/BaseChange.lean b/Mathlib/RingTheory/Extension/Cotangent/BaseChange.lean index 18941666d8d90e..25e66b707a6f95 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/BaseChange.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/BaseChange.lean @@ -67,6 +67,7 @@ def tensorCotangentSpace (P : Extension.{u} R S) (T : Type*) [CommRing T] [Algeb (AlgebraTensorModule.congr (LinearEquiv.refl PT.Ring (T ⊗[R] S)) (KaehlerDifferential.tensorKaehlerEquiv R T P.Ring PT.Ring)).restrictScalars T +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] algebraBaseChange in lemma tensorCotangentSpace_tmul_tmul (t : T) (s : S) (x : Ω[P.Ring⁄R]) : P.tensorCotangentSpace T (t ⊗ₜ (s ⊗ₜ x)) = t ⊗ₜ s ⊗ₜ KaehlerDifferential.map _ _ _ _ x := by @@ -101,6 +102,7 @@ lemma tensorCotangentSpace_tmul (t : T) (x : P.CotangentSpace) : simp [tensorCotangentSpace_tmul_tmul, CotangentSpace.map_tmul_eq_tmul_map, smul_tmul', Algebra.smul_def, RingHom.algebraMap_toAlgebra] +set_option backward.isDefEq.respectTransparency.types false in /-- If `T` is flat over `R`, there is a `T`-linear isomorphism `T ⊗[R] P.Cotangent ≃ₗ[T] (P.baseChange).Cotangent`. -/ noncomputable def tensorCotangentOfFlat [Module.Flat R T] : @@ -110,6 +112,7 @@ noncomputable def tensorCotangentOfFlat [Module.Flat R T] : (Ideal.Cotangent.equivOfEq _ _ (P.ker_baseChange T).symm).restrictScalars T ≪≫ₗ (P.baseChange (T := T)).cotangentEquivCotangentKer.symm.restrictScalars T +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] Algebra.TensorProduct.rightAlgebra in @[simp] lemma tensorCotangentOfFlat_tmul [Module.Flat R T] (t : T) (x : P.Cotangent) : @@ -135,6 +138,7 @@ lemma tensorToH1Cotangent_tmul (t : T) (x : P.H1Cotangent) : (P.tensorToH1Cotangent T (t ⊗ₜ x)).val = t • Cotangent.map (P.toBaseChange T) x.val := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- If `T` is `R`-flat, the canonical map `T ⊗[R] P.H1Cotangent →ₗ[T] (P.baseChange T).H1Cotangent` is bijective. -/ lemma tensorToH1Cotangent_bijective_of_flat [Module.Flat R T] : @@ -201,6 +205,7 @@ noncomputable def tensorH1CotangentOfFlat (T : Type*) [CommRing T] [Algebra R T] ((Generators.self R S).baseChangeToBaseChange T)).restrictScalars T ≪≫ₗ ((Generators.self R S).baseChange (T := T)).equivH1Cotangent.restrictScalars T +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] TensorProduct.rightAlgebra in lemma tensorH1CotangentOfFlat_tmul (T : Type*) [CommRing T] [Algebra R T] [Module.Flat R T] (t : T) (x : H1Cotangent R S) : diff --git a/Mathlib/RingTheory/Extension/Cotangent/Basic.lean b/Mathlib/RingTheory/Extension/Cotangent/Basic.lean index e389a24689ec0e..63c7c570861213 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/Basic.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/Basic.lean @@ -397,6 +397,7 @@ def H1Cotangent.map (f : Hom P P') : P.H1Cotangent →ₗ[S] P'.H1Cotangent := b rw [hx] exact LinearMap.map_zero _ +set_option backward.isDefEq.respectTransparency.types false in lemma H1Cotangent.map_eq (f g : Hom P P') : map f = map g := by ext x simp only [map_apply_coe] @@ -404,8 +405,10 @@ lemma H1Cotangent.map_eq (f g : Hom P P') : map f = map g := by simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.map_coe_ker, map_zero, Cotangent.val_zero] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma H1Cotangent.map_id : map (.id P) = LinearMap.id := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in omit [IsScalarTower R S S'] in lemma H1Cotangent.map_comp (f : Hom P P') (g : Hom P' P'') : diff --git a/Mathlib/RingTheory/Extension/Cotangent/Basis.lean b/Mathlib/RingTheory/Extension/Cotangent/Basis.lean index 12b5e8d9e02e2a..1bf3ec252dceb9 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/Basis.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/Basis.lean @@ -161,6 +161,7 @@ lemma tensorCotangentInv_apply (i : σ) : D.tensorCotangentInv (b i) = 1 ⊗ₜ Extension.Cotangent.mk (D.kerGen i) := Module.Basis.constr_basis _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma span_range_mk_kerGen : Submodule.span D.T (Set.range fun i ↦ Extension.Cotangent.mk (D.kerGen i)) = ⊤ := by @@ -240,6 +241,7 @@ set_option backward.isDefEq.respectTransparency false in def basisRight : Module.Basis Unit S D.presRight.toExtension.Cotangent := Generators.basisCotangentAway S D.gbar +set_option backward.isDefEq.respectTransparency.types false in /-- The basis on the cotangent space of the constructed presentation. -/ def basis [Nontrivial S] : Module.Basis (Unit ⊕ σ) S D.pres.toExtension.Cotangent := (Module.Basis.prod D.basisRight D.basisLeft).map D.cotangentEquivProd.symm @@ -250,6 +252,7 @@ lemma basis_inl [Nontrivial S] : D.cotangentEquivProd.symm (Generators.cMulXSubOneCotangent S D.gbar, 0) := by simpa [basis] using! Generators.basisCotangentAway_apply _ _ +set_option backward.isDefEq.respectTransparency.types false in lemma basis_inr [Nontrivial S] (i : σ) : D.basis (.inr i) = D.cotangentEquivProd.symm (0, D.basisLeft i) := by simp [basis] diff --git a/Mathlib/RingTheory/Extension/Cotangent/Free.lean b/Mathlib/RingTheory/Extension/Cotangent/Free.lean index 6a27f477ff4d8d..498f2ed6acd904 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/Free.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/Free.lean @@ -111,6 +111,7 @@ open Generators variable (P : PreSubmersivePresentation R S ι σ) [Finite σ] +set_option backward.isDefEq.respectTransparency.types false in /-- To show a pre-submersive presentation with kernel `I = (fᵢ)` is submersive, it suffices to show that the images of the `fᵢ` form a basis of `I/I²` and that the restricted cotangent complex `I/I² → S ⊗[R] (Ω[R[Xᵢ]⁄R]) = ⊕ᵢ S → ⊕ⱼ S` is bijective. -/ diff --git a/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean b/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean index 49004817c1c0a8..0afd7ec2764651 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/LocalizationAway.lean @@ -204,6 +204,7 @@ def cotangentCompLocalizationAwayEquiv : (liftBaseChange_injective_of_isLocalizationAway _ P) ⟨cotangentCompAwaySec g P x, map_comp_cotangentCompAwaySec g P hx⟩).1 +set_option backward.isDefEq.respectTransparency.types false in lemma cotangentCompLocalizationAwayEquiv_symm_inr : (cotangentCompLocalizationAwayEquiv g P hx).symm (0, cMulXSubOneCotangent T g) = x := by diff --git a/Mathlib/RingTheory/Extension/Generators.lean b/Mathlib/RingTheory/Extension/Generators.lean index a165eabc2a2ff7..8e8de207e7a48a 100644 --- a/Mathlib/RingTheory/Extension/Generators.lean +++ b/Mathlib/RingTheory/Extension/Generators.lean @@ -223,6 +223,7 @@ end Localization variable {ι' : Type*} {T} [CommRing T] [Algebra R T] +set_option backward.isDefEq.respectTransparency.types false in /-- Given two families of generators `S[X] → T` and `R[Y] → S`, we may construct the family of generators `R[X, Y] → T`. -/ @[simps val, simps -isSimp σ] @@ -558,6 +559,7 @@ lemma toAlgHom_ofComp_rename (Q : Generators S T ι') (P : Generators R S ι) (p (IsScalarTower.toAlgHom R S Q.Ring).comp (IsScalarTower.toAlgHom R P.Ring S) := by ext; simp DFunLike.congr_fun this p +set_option backward.isDefEq.respectTransparency.types false in lemma toAlgHom_ofComp_surjective (Q : Generators S T ι') (P : Generators R S ι) : Function.Surjective (Q.ofComp P).toAlgHom := by intro p @@ -658,6 +660,7 @@ lemma ker_ofAlgEquiv (P : Generators R S ι) {T : Type*} [CommRing T] [Algebra R AlgHomClass.toRingHom_toAlgHom, AlgHom.ker_coe_equiv, ← RingHom.ker_eq_comap_bot, ← ker_eq_ker_aeval_val] +set_option backward.isDefEq.respectTransparency.types false in lemma map_toComp_ker (Q : Generators S T ι') (P : Generators R S ι) : P.ker.map (Q.toComp P).toAlgHom = RingHom.ker (Q.ofComp P).toAlgHom := by letI : DecidableEq (ι' →₀ ℕ) := Classical.decEq _ @@ -749,6 +752,7 @@ def kerCompPreimage (Q : Generators S T ι') (P : Generators R S ι) (x : Q.ker) simp_rw [← IsScalarTower.toAlgHom_apply R, ← comp_aeval, AlgHom.comp_apply, P.aeval_val_σ, coeff] +set_option backward.isDefEq.respectTransparency.types false in lemma ofComp_kerCompPreimage (Q : Generators S T ι') (P : Generators R S ι) (x : Q.ker) : (Q.ofComp P).toAlgHom (kerCompPreimage Q P x) = x := by conv_rhs => rw [← x.1.support_sum_monomial_coeff] diff --git a/Mathlib/RingTheory/Extension/Presentation/Basic.lean b/Mathlib/RingTheory/Extension/Presentation/Basic.lean index 20b88f8700f9c0..7f75cc06de04bd 100644 --- a/Mathlib/RingTheory/Extension/Presentation/Basic.lean +++ b/Mathlib/RingTheory/Extension/Presentation/Basic.lean @@ -359,6 +359,7 @@ noncomputable def compRelationAux (r : σ') : MvPolynomial (ι' ⊕ ι) R := private lemma aux_X (i : ι' ⊕ ι) : (Q.aux P) (X i) = Sum.elim X (C ∘ P.val) i := aeval_X (Sum.elim X (C ∘ P.val)) i +set_option backward.isDefEq.respectTransparency.types false in /-- The pre-images constructed in `compRelationAux` are indeed pre-images under `aux`. -/ private lemma compRelationAux_map (r : σ') : (Q.aux P) (Q.compRelationAux P r) = Q.relation r := by diff --git a/Mathlib/RingTheory/Extension/Presentation/Core.lean b/Mathlib/RingTheory/Extension/Presentation/Core.lean index 9ed6f073826e2c..9be42d52a2b8aa 100644 --- a/Mathlib/RingTheory/Extension/Presentation/Core.lean +++ b/Mathlib/RingTheory/Extension/Presentation/Core.lean @@ -165,6 +165,7 @@ noncomputable def tensorModelOfHasCoeffsInv : S →ₐ[R] R ⊗[R₀] P.ModelOfH Ideal.Quotient.mk_span_range, tmul_zero]).comp (P.quotientEquiv.restrictScalars R).symm.toAlgHom +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma tensorModelOfHasCoeffsInv_aeval_val (x : MvPolynomial ι R₀) : P.tensorModelOfHasCoeffsInv R₀ (MvPolynomial.aeval P.val x) = @@ -172,6 +173,7 @@ lemma tensorModelOfHasCoeffsInv_aeval_val (x : MvPolynomial ι R₀) : rw [← MvPolynomial.aeval_map_algebraMap R, ← Generators.algebraMap_apply, ← quotientEquiv_mk] simp [tensorModelOfHasCoeffsInv, -quotientEquiv_symm, -quotientEquiv_mk] +set_option backward.isDefEq.respectTransparency.types false in lemma tensorModelOfHasCoeffsHom_comp : (P.tensorModelOfHasCoeffsHom R₀).comp (P.tensorModelOfHasCoeffsInv R₀) = AlgHom.id R S := by have h : Function.Surjective diff --git a/Mathlib/RingTheory/Extension/Presentation/Submersive.lean b/Mathlib/RingTheory/Extension/Presentation/Submersive.lean index 98b855e0765b18..9584780cddcc2d 100644 --- a/Mathlib/RingTheory/Extension/Presentation/Submersive.lean +++ b/Mathlib/RingTheory/Extension/Presentation/Submersive.lean @@ -352,7 +352,7 @@ private lemma jacobiMatrix_comp_₂₂_det : simp only [Matrix.toBlocks₂₂, AlgHom.mapMatrix_apply, Matrix.map_apply, Matrix.of_apply, RingHom.mapMatrix_apply, Generators.algebraMap_apply, map_aeval, coe_eval₂Hom] rw [jacobiMatrix_comp_inr_inr, ← IsScalarTower.algebraMap_eq] - simp only [aeval, AlgHom.coe_mk, coe_eval₂Hom] + simp only [aeval] generalize P.jacobiMatrix i j = p induction p using MvPolynomial.induction_on with | C a => diff --git a/Mathlib/RingTheory/Filtration.lean b/Mathlib/RingTheory/Filtration.lean index 2015d7408e6eb3..082f03e1c5163f 100644 --- a/Mathlib/RingTheory/Filtration.lean +++ b/Mathlib/RingTheory/Filtration.lean @@ -331,6 +331,7 @@ theorem submodule_eq_span_le_iff_stable_ge (n₀ : ℕ) : · rw [map_add] exact F'.add_mem hx hy +set_option backward.isDefEq.respectTransparency.types false in /-- If the components of a filtration are finitely generated, then the filtration is stable iff its associated submodule of is finitely generated. -/ theorem submodule_fg_iff_stable (hF' : ∀ i, (F.N i).FG) : F.submodule.FG ↔ F.Stable := by diff --git a/Mathlib/RingTheory/FiniteType.lean b/Mathlib/RingTheory/FiniteType.lean index 3748e2ff54e2fb..98e805ee294824 100644 --- a/Mathlib/RingTheory/FiniteType.lean +++ b/Mathlib/RingTheory/FiniteType.lean @@ -131,6 +131,8 @@ theorem iff_quotient_freeAlgebra : · rintro ⟨s, f, hsur⟩ exact .of_surjective f hsur +-- TODO: `respectTransparency.types false` is necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in /-- A commutative algebra is finitely generated if and only if it is a quotient of a polynomial ring whose variables are indexed by a finset. -/ theorem iff_quotient_mvPolynomial : diff --git a/Mathlib/RingTheory/Finiteness/Basic.lean b/Mathlib/RingTheory/Finiteness/Basic.lean index 1044b0ae92511e..4d32d77d40d7f2 100644 --- a/Mathlib/RingTheory/Finiteness/Basic.lean +++ b/Mathlib/RingTheory/Finiteness/Basic.lean @@ -93,6 +93,7 @@ theorem FG.map {N : Submodule R M} (hs : N.FG) : (N.map f).FG := rw [LinearMap.range_eq_map] exact Module.Finite.fg_top.map f +set_option backward.isDefEq.respectTransparency false in theorem fg_of_fg_map_injective (hf : Function.Injective f) {N : Submodule R M} (hfn : (N.map f).FG) : N.FG := let ⟨t, ht⟩ := hfn diff --git a/Mathlib/RingTheory/Finiteness/FinitePresentationLocal.lean b/Mathlib/RingTheory/Finiteness/FinitePresentationLocal.lean index 0b759d65bcc3dc..7559dae28ba442 100644 --- a/Mathlib/RingTheory/Finiteness/FinitePresentationLocal.lean +++ b/Mathlib/RingTheory/Finiteness/FinitePresentationLocal.lean @@ -56,6 +56,7 @@ lemma of_span_eq_top_target_aux {A : Type*} [CommRing A] [Algebra R A] universe u +set_option backward.isDefEq.respectTransparency.types false in /-- Finite-presentation can be checked on a standard covering of the target. -/ lemma of_span_eq_top_target (s : Set S) (hs : Ideal.span (s : Set S) = ⊤) (h : ∀ i ∈ s, Algebra.FinitePresentation R (Localization.Away i)) : diff --git a/Mathlib/RingTheory/Flat/Equalizer.lean b/Mathlib/RingTheory/Flat/Equalizer.lean index 07fbc4cd1d5ead..766fec0bfe871c 100644 --- a/Mathlib/RingTheory/Flat/Equalizer.lean +++ b/Mathlib/RingTheory/Flat/Equalizer.lean @@ -109,6 +109,7 @@ def LinearMap.tensorKerInv [Module.Flat R M] : (Module.Flat.lTensor_preserves_injective_linearMap (ker f).subtype (ker f).injective_subtype) (by simp [Module.Flat.ker_lTensor_eq]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] private lemma LinearMap.lTensor_ker_subtype_tensorKerInv [Module.Flat R M] (x : ker (AlgebraTensorModule.lTensor S M f)) : @@ -127,6 +128,7 @@ def LinearMap.tensorEqLocusInv [Module.Flat R M] : (Module.Flat.lTensor_preserves_injective_linearMap (eqLocus f g).subtype (eqLocus f g).injective_subtype) (by simp [Module.Flat.eqLocus_lTensor_eq]) +set_option backward.isDefEq.respectTransparency.types false in @[simp] private lemma LinearMap.lTensor_eqLocus_subtype_tensorEqLocusInv [Module.Flat R M] (x : eqLocus (AlgebraTensorModule.lTensor S M f) (AlgebraTensorModule.lTensor S M g)) : diff --git a/Mathlib/RingTheory/Flat/Localization.lean b/Mathlib/RingTheory/Flat/Localization.lean index 1b54ac43aa720a..7e563a6e72d6a0 100644 --- a/Mathlib/RingTheory/Flat/Localization.lean +++ b/Mathlib/RingTheory/Flat/Localization.lean @@ -32,6 +32,7 @@ variable {R : Type*} (S : Type*) [CommSemiring R] [CommSemiring S] [Algebra R S] variable (p : Submonoid R) [IsLocalization p S] variable (M : Type*) [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] +set_option backward.isDefEq.respectTransparency.types false in include p in theorem IsLocalization.flat : Module.Flat R S := by refine Module.Flat.iff_lTensor_injectiveₛ.mpr fun P _ _ N ↦ ?_ diff --git a/Mathlib/RingTheory/FractionalIdeal/Basic.lean b/Mathlib/RingTheory/FractionalIdeal/Basic.lean index 710502fca68f68..68a4236a40e5f0 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Basic.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Basic.lean @@ -182,6 +182,7 @@ theorem coe_ext_iff {I J : FractionalIdeal S P} : theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J := SetLike.ext +set_option backward.isDefEq.respectTransparency false in @[simp] theorem equivNum_apply [IsDomain R] [Module.IsTorsionFree R P] [Nontrivial P] {I : FractionalIdeal S P} (h_nz : (I.den : R) ≠ 0) (x : I) : @@ -557,6 +558,7 @@ instance : Mul (FractionalIdeal S P) := theorem mul_eq_mul (I J : FractionalIdeal S P) : mul I J = I * J := rfl +set_option backward.isDefEq.respectTransparency false in theorem mul_def (I J : FractionalIdeal S P) : I * J = ⟨I * J, I.isFractional.mul J.isFractional⟩ := by simp only [← mul_eq_mul, mul_def'] diff --git a/Mathlib/RingTheory/FractionalIdeal/Operations.lean b/Mathlib/RingTheory/FractionalIdeal/Operations.lean index 236098adb9e8d8..196cce67ceae42 100644 --- a/Mathlib/RingTheory/FractionalIdeal/Operations.lean +++ b/Mathlib/RingTheory/FractionalIdeal/Operations.lean @@ -183,6 +183,7 @@ lemma _root_.Units.submodule_isFractional [IsLocalization S P] (I : (Submodule R IsFractional S I.1 := FractionalIdeal.isFractional_of_fg (fg_unit _) +set_option backward.isDefEq.respectTransparency false in /-- If P is a localization of R, invertible R-submodules of P are all fractional (expressed as an isomorphism of groups). -/ def unitsMulEquivSubmodule [IsLocalization S P] : @@ -243,6 +244,7 @@ theorem canonicalEquiv_symm : (canonicalEquiv S P P').symm = canonicalEquiv S P' theorem canonicalEquiv_flip (I) : canonicalEquiv S P P' (canonicalEquiv S P' P I) = I := by rw [← canonicalEquiv_symm, RingEquiv.symm_apply_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem canonicalEquiv_canonicalEquiv (P'' : Type*) [CommRing P''] [Algebra R P''] [IsLocalization S P''] (I : FractionalIdeal S P) : @@ -255,6 +257,7 @@ theorem canonicalEquiv_trans_canonicalEquiv (P'' : Type*) [CommRing P''] [Algebr (canonicalEquiv S P P').trans (canonicalEquiv S P' P'') = canonicalEquiv S P P'' := RingEquiv.ext (canonicalEquiv_canonicalEquiv S P P' P'') +set_option backward.isDefEq.respectTransparency false in @[simp] theorem canonicalEquiv_coeIdeal (I : Ideal R) : canonicalEquiv S P P' I = I := by ext @@ -472,6 +475,7 @@ theorem mul_div_self_cancel_iff {I : FractionalIdeal R₁⁰ K} : I * (1 / I) = variable {K' : Type*} [Field K'] [Algebra R₁ K'] [IsFractionRing R₁ K'] +set_option backward.isDefEq.respectTransparency false in @[simp] protected theorem map_div (I J : FractionalIdeal R₁⁰ K) (h : K ≃ₐ[R₁] K') : (I / J).map (h : K →ₐ[R₁] K') = I.map h / J.map h := by @@ -604,6 +608,7 @@ theorem spanSingleton_eq_spanSingleton [IsDomain R] [Module.IsTorsionFree R P] { rw [← Submodule.span_singleton_eq_span_singleton, spanSingleton, spanSingleton] exact Subtype.mk_eq_mk +set_option backward.isDefEq.respectTransparency false in theorem eq_spanSingleton_of_principal (I : FractionalIdeal S P) [IsPrincipal (I : Submodule R P)] : I = spanSingleton S (generator (I : Submodule R P)) := by -- Porting note: this used to be `coeToSubmodule_injective (span_singleton_generator ↑I).symm` @@ -661,6 +666,7 @@ theorem coeIdeal_span_singleton (x : R) : refine ⟨y' * x, Submodule.mem_span_singleton.mpr ⟨y', rfl⟩, ?_⟩ rw [map_mul, Algebra.smul_def] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem canonicalEquiv_spanSingleton {P'} [CommRing P'] [Algebra R P'] [IsLocalization S P'] (x : P) : @@ -940,6 +946,7 @@ theorem _root_.IsFractional.mapEquiv {I : Submodule R K} (hI : IsFractional R⁰ rw [Algebra.smul_def, ← ringEquivOfRingEquiv_algebraMap f (K := K) (L := L) r, ← map_mul, ← Algebra.smul_def, ← hr', ringEquivOfRingEquiv_algebraMap] +set_option backward.isDefEq.respectTransparency.types false in /-- The equiv `FractionalIdeal R⁰ K ≃+* FractionalIdeal S⁰ L` induced by a ring isomorphism `f : R ≃+* S`. -/ @[simps -isSimp] @@ -968,15 +975,18 @@ noncomputable def ringEquivOfRingEquiv : convert! Submodule.map_id _ ext; simp [semilinearEquivOfRingEquiv, IsLocalization.map_map]} +set_option backward.isDefEq.respectTransparency.types false in lemma ringEquivOfRingEquiv_apply (f : R ≃+* S) (I : FractionalIdeal (nonZeroDivisors R) K) : ringEquivOfRingEquiv K L f I = ⟨Submodule.map (semilinearEquivOfRingEquiv _ _ f).toLinearMap I.val, IsFractional.mapEquiv K L f I.prop⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma ringEquivOfRingEquiv_apply_val (f : R ≃+* S) (I : FractionalIdeal R⁰ K) : (ringEquivOfRingEquiv K L f I).val = I.val.map (semilinearEquivOfRingEquiv _ _ f).toLinearMap := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma ringEquivOfRingEquiv_trans {T : Type*} [CommRing T] [IsDomain T] (M : Type*) [CommRing M] [Algebra T M] [IsFractionRing T M] (f : R ≃+* S) (g : S ≃+* T) : ringEquivOfRingEquiv K M (f.trans g) = @@ -994,6 +1004,7 @@ lemma ringEquivOfRingEquiv_trans_apply {T : Type*} [CommRing T] [IsDomain T] (M ringEquivOfRingEquiv L M g (ringEquivOfRingEquiv K L f I) := by simp [ringEquivOfRingEquiv_trans K L M] +set_option backward.isDefEq.respectTransparency.types false in lemma ringEquivOfRingEquiv_refl : ringEquivOfRingEquiv K K (RingEquiv.refl R) = RingEquiv.refl (FractionalIdeal R⁰ K) := by ext I x @@ -1001,6 +1012,7 @@ lemma ringEquivOfRingEquiv_refl : val_eq_coe, RingEquiv.refl_apply, ← mem_coe] simp [semilinearEquivOfRingEquiv] +set_option backward.isDefEq.respectTransparency.types false in lemma ringEquivOfRingEquiv_spanSingleton (x : K) : FractionalIdeal.ringEquivOfRingEquiv K L f (spanSingleton R⁰ x) = spanSingleton S⁰ (IsFractionRing.ringEquivOfRingEquiv (L := L) f x) := by @@ -1019,6 +1031,7 @@ lemma ringEquivOfRingEquiv_spanSingleton (x : K) : simp only [Algebra.smul_def, semilinearEquivOfRingEquiv_apply, map_mul, map_eq, RingHom.coe_coe, IsFractionRing.ringEquivOfRingEquiv_apply, RingEquiv.apply_symm_apply] +set_option backward.isDefEq.respectTransparency.types false in lemma ringEquivOfRingEquiv_symm_eq : (FractionalIdeal.ringEquivOfRingEquiv K L f).symm = FractionalIdeal.ringEquivOfRingEquiv L K f.symm := by diff --git a/Mathlib/RingTheory/FreeCommRing.lean b/Mathlib/RingTheory/FreeCommRing.lean index d04ee6c24b36e5..1cef23d858f68d 100644 --- a/Mathlib/RingTheory/FreeCommRing.lean +++ b/Mathlib/RingTheory/FreeCommRing.lean @@ -128,6 +128,7 @@ section lift variable {R : Type v} [CommRing R] (f : α → R) +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in /-- A helper to implement `lift`. This is essentially `FreeCommMonoid.lift`, but this does not currently exist. -/ diff --git a/Mathlib/RingTheory/Frobenius.lean b/Mathlib/RingTheory/Frobenius.lean index e0b10ae2bb310e..adc4bf50a7d2eb 100644 --- a/Mathlib/RingTheory/Frobenius.lean +++ b/Mathlib/RingTheory/Frobenius.lean @@ -128,6 +128,7 @@ lemma apply_of_pow_eq_one [IsDomain S] {ζ : S} {m : ℕ} (hζ : ζ ^ m = 1) (hk rw [one_mul, ← pow_add, tsub_add_cancel_of_le (by linarith), pow_add, hζ.1, mul_one] at h₂ rw [h₂, e] +set_option backward.isDefEq.respectTransparency.types false in /-- A Frobenius element at `Q` restricts to an automorphism of `S_Q`. -/ noncomputable def localize [Q.IsPrime] : Localization.AtPrime Q →ₐ[R] Localization.AtPrime Q where @@ -143,6 +144,7 @@ lemma localize_algebraMap [Q.IsPrime] (x : S) : open IsLocalRing nonZeroDivisors +set_option backward.isDefEq.respectTransparency.types false in lemma isArithFrobAt_localize [Q.IsPrime] : H.localize.IsArithFrobAt (maximalIdeal _) := by have h : Nat.card (R ⧸ (maximalIdeal _).comap (algebraMap R (Localization.AtPrime Q))) = Nat.card (R ⧸ Q.under R) := by diff --git a/Mathlib/RingTheory/GradedAlgebra/Basic.lean b/Mathlib/RingTheory/GradedAlgebra/Basic.lean index 44a6e7d096a021..153d00659bf66d 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Basic.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Basic.lean @@ -351,6 +351,7 @@ variable {ι : Type*} [DecidableEq ι] [AddMonoid ι] variable {M : ι → Submodule R A} [SetLike.GradedMonoid M] -- The following lines were given on Zulip by Adam Topaz +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical isomorphism of an internal direct sum with the ambient algebra -/ noncomputable def coeAlgEquiv (hM : DirectSum.IsInternal M) : (DirectSum ι fun i => ↥(M i)) ≃ₐ[R] A := @@ -362,7 +363,7 @@ and satisfying `SetLike.GradedMonoid M` (essentially, is multiplicative) such that `DirectSum.IsInternal M` (`A` is the direct sum of the `M i`), we endow `A` with the structure of a graded algebra. The submodules are the *homogeneous* parts. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def gradedAlgebra (hM : DirectSum.IsInternal M) : GradedAlgebra M := { (inferInstance : SetLike.GradedMonoid M) with decompose' := hM.coeAlgEquiv.symm diff --git a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean index 6bb4bfed265a05..fd5440a3dc7696 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean @@ -595,6 +595,7 @@ lemma mem_irrelevant_of_mem {x : A} {i : ι} (hi : 0 < i) (hx : x ∈ 𝒜 i) : rw [mem_irrelevant_iff, GradedRing.proj_apply, DirectSum.decompose_of_mem _ hx, DirectSum.of_eq_of_ne _ _ _ (by aesop), ZeroMemClass.coe_zero] +set_option backward.isDefEq.respectTransparency false in /-- `irrelevant 𝒜 = ⨁_{i>0} 𝒜ᵢ` -/ lemma irrelevant_eq_iSup : 𝒜₊.toAddSubmonoid = ⨆ i > 0, .ofClass (𝒜 i) := by refine le_antisymm (fun x hx ↦ ?_) <| iSup₂_le fun i hi x hx ↦ mem_irrelevant_of_mem _ hi hx diff --git a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean index c21556a6b458a4..bc5755468bf5da 100644 --- a/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean +++ b/Mathlib/RingTheory/GradedAlgebra/Homogeneous/Subsemiring.lean @@ -95,7 +95,12 @@ theorem IsHomogeneous.subsemiringClosure {s : Set A} refine sum_mem fun j _ ↦ ?_ rw [DFinsupp.sum_apply, DFinsupp.sum, AddSubmonoidClass.coe_finsetSum] refine sum_mem fun k _ ↦ ?_ - obtain rfl | h := eq_or_ne i (j + k) <;> simp [of_eq_of_ne, mul_mem, *] + obtain rfl | h := eq_or_ne i (j + k) + -- TODO: should be closed by `<;> simp [of_eq_of_ne, mul_mem, *]` + · rw [of_eq_same] + simp only [coe_gMul, mul_mem, h₁, h₂] + · rw [of_eq_of_ne _ _ _ (by simp only [ne_eq, not_false_eq_true, h])] + simp only [ZeroMemClass.coe_zero, zero_mem] theorem IsHomogeneous.subsemiringClosure_of_isHomogeneousElem {s : Set A} (h : ∀ x ∈ s, IsHomogeneousElem 𝒜 x) : diff --git a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean index 3a02d3896d7e81..47d7a3ac87b439 100644 --- a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean +++ b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean @@ -663,6 +663,7 @@ open Graded num := f.gradedAddHom _ c.num den_mem := hw c.den_mem +set_option backward.isDefEq.respectTransparency.types false in /-- Let `A, B` be two graded rings with the same indexing set and `g : 𝒜 →+*ᵍ ℬ` be a graded ring homomorphism. Let `P ≤ A` be a submonoid and `Q ≤ B` be a submonoid such that `P ≤ g⁻¹ Q`, then `g` @@ -695,10 +696,12 @@ abbrev mapId {P Q : Submonoid A} (h : P ≤ Q) : HomogeneousLocalization 𝒜 P →+* HomogeneousLocalization 𝒜 Q := map (.id _) h +set_option backward.isDefEq.respectTransparency.types false in lemma map_mk (g : 𝒜 →+*ᵍ ℬ) (comap_le : P ≤ Q.comap g) (x) : map g comap_le (mk x) = mk ⟨x.1, ⟨_, map_mem g x.2.2⟩, ⟨_, map_mem g x.3.2⟩, comap_le x.4⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in variable (𝒜) in @[simp] theorem map_id (P : Submonoid A) : map (.id 𝒜) (P := P) (Q := P) le_rfl = .id _ := by ext x @@ -754,11 +757,13 @@ noncomputable def localRingHom : AtPrime 𝒜 I →+* AtPrime ℬ J := variable {f I J hIJ} +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma val_localRingHom (x : AtPrime 𝒜 I) : (localRingHom f I J hIJ x).val = Localization.localRingHom _ _ f hIJ x.val := by obtain ⟨⟨i, x, s, hs⟩, rfl⟩ := x.mk_surjective simp [localRingHom, map_mk] +set_option backward.isDefEq.respectTransparency.types false in instance : IsLocalHom (localRingHom f I J hIJ) where map_nonunit x hx := by rw [← isUnit_iff_isUnit_val] at hx ⊢ @@ -842,8 +847,7 @@ lemma val_awayMap (a) : (awayMap 𝒜 hg hx a).val = Localization.awayLift (alge lemma awayMap_fromZeroRingHom (a) : awayMap 𝒜 hg hx (fromZeroRingHom 𝒜 _ a) = fromZeroRingHom 𝒜 _ a := by ext - simp only [fromZeroRingHom, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, - val_awayMap, val_mk] + simp only [fromZeroRingHom, val_awayMap] convert! IsLocalization.lift_eq _ _ lemma val_awayMap_mk (n a i hi) : (awayMap 𝒜 hg hx (mk ⟨n, a, ⟨f ^ i, hi⟩, ⟨i, rfl⟩⟩)).val = @@ -934,6 +938,7 @@ end isLocalization section span +set_option backward.isDefEq.respectTransparency.types false in variable [AddSubgroupClass σ A] [AddCommMonoid ι] [DecidableEq ι] {𝒜 : ι → σ} [GradedRing 𝒜] in /-- Let `𝒜` be a graded ring, finitely generated (as an algebra) over `𝒜₀` by `{ vᵢ }`, diff --git a/Mathlib/RingTheory/GradedAlgebra/TensorProduct.lean b/Mathlib/RingTheory/GradedAlgebra/TensorProduct.lean index 46e82e06a69fe6..9299dde70f77ce 100644 --- a/Mathlib/RingTheory/GradedAlgebra/TensorProduct.lean +++ b/Mathlib/RingTheory/GradedAlgebra/TensorProduct.lean @@ -33,6 +33,7 @@ variable [CommSemiring R] [CommSemiring S] [Algebra R S] variable [DecidableEq ι] [AddMonoid ι] variable [Semiring A] [Algebra R A] (𝒜 : ι → Submodule R A) [GradedAlgebra 𝒜] +set_option backward.isDefEq.respectTransparency.types false in instance baseChange : GradedAlgebra fun i ↦ (𝒜 i).baseChange S where one_mem := tmul_mem_baseChange_of_mem _ <| one_mem_graded 𝒜 mul_mem i j := by diff --git a/Mathlib/RingTheory/HahnSeries/Addition.lean b/Mathlib/RingTheory/HahnSeries/Addition.lean index 3980046d3b6e78..698242fe21daf6 100644 --- a/Mathlib/RingTheory/HahnSeries/Addition.lean +++ b/Mathlib/RingTheory/HahnSeries/Addition.lean @@ -157,6 +157,7 @@ lemma addOppositeEquiv_symm_support (x : R⟦Γ⟧ᵃᵒᵖ) : (addOppositeEquiv.symm x).support = x.unop.support := by rw [← addOppositeEquiv_support, AddEquiv.apply_symm_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma addOppositeEquiv_orderTop (x : Rᵃᵒᵖ⟦Γ⟧) : (addOppositeEquiv x).unop.orderTop = x.orderTop := by @@ -172,6 +173,7 @@ lemma addOppositeEquiv_symm_orderTop (x : R⟦Γ⟧ᵃᵒᵖ) : (addOppositeEquiv.symm x).orderTop = x.unop.orderTop := by rw [← addOppositeEquiv_orderTop, AddEquiv.apply_symm_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma addOppositeEquiv_leadingCoeff (x : Rᵃᵒᵖ⟦Γ⟧) : (addOppositeEquiv x).unop.leadingCoeff = x.leadingCoeff.unop := by diff --git a/Mathlib/RingTheory/HahnSeries/Basic.lean b/Mathlib/RingTheory/HahnSeries/Basic.lean index 6a2b2eef284373..7e84b60b498182 100644 --- a/Mathlib/RingTheory/HahnSeries/Basic.lean +++ b/Mathlib/RingTheory/HahnSeries/Basic.lean @@ -166,6 +166,7 @@ def ofIterate [PartialOrder Γ'] (x : R⟦Γ'⟧⟦Γ⟧) : R⟦Γ ×ₗ Γ'⟧ lemma mk_eq_zero (f : Γ → R) (h) : HahnSeries.mk f h = 0 ↔ f = 0 := by simp_rw [HahnSeries.ext_iff, funext_iff, coeff_zero, Pi.zero_apply] +set_option backward.isDefEq.respectTransparency false in /-- Change a `HahnSeries` on a Lex product to a `HahnSeries` with coefficients in a `HahnSeries`. -/ def toIterate [PartialOrder Γ'] (x : R⟦Γ ×ₗ Γ'⟧) : R⟦Γ'⟧⟦Γ⟧ where coeff := fun g => { diff --git a/Mathlib/RingTheory/HahnSeries/HEval.lean b/Mathlib/RingTheory/HahnSeries/HEval.lean index c5d26e685b07bb..39cfa244614248 100644 --- a/Mathlib/RingTheory/HahnSeries/HEval.lean +++ b/Mathlib/RingTheory/HahnSeries/HEval.lean @@ -83,6 +83,7 @@ theorem powerSeriesFamily_smul {x : V⟦Γ⟧} (f : PowerSeries R) (r : R) : ext1 n simp [mul_smul] +set_option backward.isDefEq.respectTransparency false in theorem support_powerSeriesFamily_subset {x : V⟦Γ⟧} (a b : PowerSeries R) (g : Γ) : ((powerSeriesFamily x (a * b)).coeff g).support ⊆ (((powerSeriesFamily x a).mul (powerSeriesFamily x b)).coeff g).support.image diff --git a/Mathlib/RingTheory/HahnSeries/Multiplication.lean b/Mathlib/RingTheory/HahnSeries/Multiplication.lean index b79bc4fe3c4980..eef3504b221c53 100644 --- a/Mathlib/RingTheory/HahnSeries/Multiplication.lean +++ b/Mathlib/RingTheory/HahnSeries/Multiplication.lean @@ -984,7 +984,7 @@ instance [IsCancelAdd R] [IsCancelMulZero R] : IsCancelMulZero R⟦Γ⟧ where rintro b c hxb - hbc hbc' contrapose! hbc' rwa [eq_comm, eq_comm (a := c), ← add_eq_add_iff_eq_and_eq (order_le_of_coeff_ne_zero hxb) - (Set.IsWF.min_le _ _ hbc'), eq_comm] + (Set.IsWF.min_le this hyz hbc'), eq_comm] · simp +contextual [← and_or_left, ← or_and_right] · simp +contextual [← and_or_left, ← or_and_right] mul_right_cancel_of_ne_zero {x} hx y z hyz := by @@ -1006,7 +1006,8 @@ instance [IsCancelAdd R] [IsCancelMulZero R] : IsCancelMulZero R⟦Γ⟧ where rintro b c - hxb hbc hbc' contrapose! hbc' rwa [eq_comm, eq_comm (a := c), ← add_eq_add_iff_eq_and_eq - (Set.IsWF.min_le _ _ hbc') (order_le_of_coeff_ne_zero hxb), eq_comm] + (Set.IsWF.min_le this hyz ((Set.mem_setOf (p := fun a => y.coeff a ≠ z.coeff a)).mpr hbc')) + (order_le_of_coeff_ne_zero hxb), eq_comm] · simp +contextual [← or_and_right] · simp +contextual [← or_and_right] diff --git a/Mathlib/RingTheory/HahnSeries/Summable.lean b/Mathlib/RingTheory/HahnSeries/Summable.lean index d5c8c3a494d7e6..7b3c7370672f98 100644 --- a/Mathlib/RingTheory/HahnSeries/Summable.lean +++ b/Mathlib/RingTheory/HahnSeries/Summable.lean @@ -167,6 +167,7 @@ end SMul instance : AddCommMonoid (SummableFamily Γ R α) := fast_instance% DFunLike.coe_injective.addCommMonoid _ coe_zero coe_add (fun _ _ => coe_smul' _ _) +set_option backward.isDefEq.respectTransparency false in /-- The coefficient function of a summable family, as a finsupp on the parameter type. -/ @[simps] def coeff (s : SummableFamily Γ R α) (g : Γ) : α →₀ R where @@ -211,6 +212,7 @@ theorem hsum_add {s t : SummableFamily Γ R α} : (s + t).hsum = s.hsum + t.hsum simp only [coeff_hsum, coeff_add, add_apply] exact finsum_add_distrib (s.finite_co_support _) (t.finite_co_support _) +set_option backward.isDefEq.respectTransparency false in theorem coeff_hsum_eq_sum_of_subset {s : SummableFamily Γ R α} {g : Γ} {t : Finset α} (h : { a | (s a).coeff g ≠ 0 } ⊆ t) : s.hsum.coeff g = ∑ i ∈ t, (s i).coeff g := by simp only [coeff_hsum, finsum_eq_sum _ (s.finite_co_support _)] @@ -463,6 +465,7 @@ theorem coeff_smul {R} {V} [Semiring R] [AddCommMonoid V] [Module R V] Set.mem_setOf_eq, Prod.forall, coeff_support, mem_product] exact hsupp ab.1 ab.2 hab +set_option backward.isDefEq.respectTransparency false in theorem smul_hsum {R} {V} [Semiring R] [AddCommMonoid V] [Module R V] (s : SummableFamily Γ R α) (t : SummableFamily Γ' V β) : (smul s t).hsum = (of R).symm (s.hsum • (of R) (t.hsum)) := by diff --git a/Mathlib/RingTheory/HopfAlgebra/Basic.lean b/Mathlib/RingTheory/HopfAlgebra/Basic.lean index 5358ec8038142a..9c0b2d74c93895 100644 --- a/Mathlib/RingTheory/HopfAlgebra/Basic.lean +++ b/Mathlib/RingTheory/HopfAlgebra/Basic.lean @@ -116,6 +116,7 @@ lemma sum_mul_antipode_eq_smul (repr : Repr R a) : counit (R := R) a • 1 := by rw [sum_mul_antipode_eq_algebraMap_counit, Algebra.smul_def, mul_one] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma counit_antipode (a : A) : counit (R := R) (antipode R a) = counit a := by calc counit (antipode R a) diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean index 6366f48dec47be..1d79edf76927f0 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean @@ -118,6 +118,7 @@ theorem isAssociatedPrime_iff [IsNoetherianRing R] : IsAssociatedPrime I M ↔ I.IsPrime ∧ ∃ x : M, I = colon ⊥ {x} := (⊥ : Submodule R M).isAssociatedPrime_iff +set_option backward.isDefEq.respectTransparency false in theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) : IsAssociatedPrime I M' := by obtain ⟨x, rfl⟩ := h.2 diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean index 91c6a9966c74c6..d939305ccd8d56 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Localization.lean @@ -127,6 +127,7 @@ lemma preimage_comap_associatedPrimes_eq_associatedPrimes_of_isLocalizedModule fun h ↦ comap_mem_associatedPrimes_of_mem_associatedPrimes_of_isLocalizedModule_of_fg S f p h ((isNoetherianRing_iff_ideal_fg R).mp ‹_› _)⟩ +set_option backward.isDefEq.respectTransparency.types false in variable (R M) in lemma minimalPrimes_annihilator_subset_associatedPrimes [IsNoetherianRing R] [Module.Finite R M] : (Module.annihilator R M).minimalPrimes ⊆ associatedPrimes R M := by diff --git a/Mathlib/RingTheory/Ideal/Basis.lean b/Mathlib/RingTheory/Ideal/Basis.lean index 1b4d72f90a4e7d..2643b71a0214e5 100644 --- a/Mathlib/RingTheory/Ideal/Basis.lean +++ b/Mathlib/RingTheory/Ideal/Basis.lean @@ -35,6 +35,7 @@ noncomputable def basisSpanSingleton (b : Basis ι R S) {x : S} (hx : x ≠ 0) : simp [mem_span_singleton', mul_comm]) ≪≫ₗ (Submodule.restrictScalarsEquiv R S S (Ideal.span ({x} : Set S))).restrictScalars R +set_option backward.isDefEq.respectTransparency false in @[simp] theorem basisSpanSingleton_apply (b : Basis ι R S) {x : S} (hx : x ≠ 0) (i : ι) : (basisSpanSingleton b hx i : S) = x * b i := by diff --git a/Mathlib/RingTheory/Ideal/Cotangent.lean b/Mathlib/RingTheory/Ideal/Cotangent.lean index 038cde5ec87e77..e504ed7d7706b7 100644 --- a/Mathlib/RingTheory/Ideal/Cotangent.lean +++ b/Mathlib/RingTheory/Ideal/Cotangent.lean @@ -167,6 +167,7 @@ theorem cotangentEquivIdeal_symm_apply (x : R) (hx : x ∈ I) : variable {A B : Type*} [CommRing A] [CommRing B] [Algebra R A] [Algebra R B] +set_option backward.isDefEq.respectTransparency.types false in /-- The lift of `f : A →ₐ[R] B` to `A ⧸ J ^ 2 →ₐ[R] B` with `J` being the kernel of `f`. -/ def _root_.AlgHom.kerSquareLift (f : A →ₐ[R] B) : A ⧸ RingHom.ker f.toRingHom ^ 2 →ₐ[R] B := by refine { Ideal.Quotient.lift (RingHom.ker f.toRingHom ^ 2) f.toRingHom ?_ with commutes' := ?_ } @@ -202,6 +203,7 @@ def quotCotangent : (R ⧸ I ^ 2) ⧸ I.cotangentIdeal ≃+* R ⧸ I := by refine (DoubleQuot.quotQuotEquivQuotSup _ _).trans ?_ exact Ideal.quotEquivOfEq (sup_eq_right.mpr <| Ideal.pow_le_self two_ne_zero) +set_option backward.isDefEq.respectTransparency.types false in /-- The map `I/I² → J/J²` if `I ≤ f⁻¹(J)`. -/ def mapCotangent (I₁ : Ideal A) (I₂ : Ideal B) (f : A →ₐ[R] B) (h : I₁ ≤ I₂.comap f) : I₁.Cotangent →ₗ[R] I₂.Cotangent := by @@ -253,6 +255,7 @@ lemma lift_comp_toCotangent (f : I →ₗ[R] M) (hf : ∀ (x y : I), f (x * y) = Cotangent.lift f hf ∘ₗ I.toCotangent = f := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma lift_surjective_iff (f : I →ₗ[R] M) (hf : ∀ (x y : I), f (x * y) = 0) : Function.Surjective (Cotangent.lift f hf) ↔ Function.Surjective f := by refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ @@ -369,6 +372,7 @@ lemma Ideal.mapCotangent_surjective_of_comap_eq (surj : Function.Surjective (alg use J.toCotangent ⟨y', mem⟩ simpa using I.toCotangent.congr_arg (SetCoe.ext hy') +set_option backward.isDefEq.respectTransparency.types false in lemma Ideal.mapCotangent_ker_of_surjective (surj : Function.Surjective (algebraMap A B)) {I : Ideal B} {J : Ideal A} (eq : I.comap (algebraMap A B) = RingHom.ker (algebraMap A B) ⊔ J) : (Ideal.mapCotangent J I (Algebra.ofId A B) (le_of_le_of_eq le_sup_right eq.symm)).ker = diff --git a/Mathlib/RingTheory/Ideal/CotangentBaseChange.lean b/Mathlib/RingTheory/Ideal/CotangentBaseChange.lean index 4d8e34836ce1f6..f7481be783eb09 100644 --- a/Mathlib/RingTheory/Ideal/CotangentBaseChange.lean +++ b/Mathlib/RingTheory/Ideal/CotangentBaseChange.lean @@ -61,6 +61,7 @@ lemma tensorCotangentHom_tmul (t : T) (x : I) : ⟨1 ⊗ₜ x, Ideal.mem_map_of_mem _ x.2⟩ := by rfl +set_option backward.isDefEq.respectTransparency.types false in lemma tensorCotangentHom_surjective : Function.Surjective (I.tensorCotangentHom R T) := by let a : S →+* T ⊗[R] S := Algebra.TensorProduct.includeRight.toRingHom @@ -80,6 +81,7 @@ lemma tensorCotangentHom_surjective : simp [-AlgHom.toRingHom_eq_coe, tensorCotangentHom_tmul, Algebra.smul_def, ← Ideal.Quotient.mk_algebraMap, ← map_mul] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `T` is a flat `R`-module, the canonical map `tensorCotangentHom R T I` is injective. -/ lemma tensorCotangentHom_injective_of_flat [Module.Flat R T] : diff --git a/Mathlib/RingTheory/Ideal/GoingDown.lean b/Mathlib/RingTheory/Ideal/GoingDown.lean index 1337409a5cc4c5..a41d8ed15b1ab8 100644 --- a/Mathlib/RingTheory/Ideal/GoingDown.lean +++ b/Mathlib/RingTheory/Ideal/GoingDown.lean @@ -68,6 +68,7 @@ lemma Ideal.exists_ideal_lt_liesOver_of_lt [Algebra.HasGoingDown R S] subst this simp [P.over_def p, P.over_def q] at hpq +set_option backward.isDefEq.respectTransparency.types false in lemma Ideal.exists_ltSeries_of_hasGoingDown [Algebra.HasGoingDown R S] (l : LTSeries (PrimeSpectrum R)) (P : Ideal S) [P.IsPrime] [lo : P.LiesOver l.last.asIdeal] : ∃ (L : LTSeries (PrimeSpectrum S)), diff --git a/Mathlib/RingTheory/Ideal/Height.lean b/Mathlib/RingTheory/Ideal/Height.lean index 457a89a3fc05a2..3bf932f03416db 100644 --- a/Mathlib/RingTheory/Ideal/Height.lean +++ b/Mathlib/RingTheory/Ideal/Height.lean @@ -37,6 +37,7 @@ private noncomputable def Ideal.primeHeight [hI : I.IsPrime] : ℕ∞ := noncomputable def Ideal.height : ℕ∞ := ⨅ J ∈ I.minimalPrimes, @Ideal.primeHeight _ _ J ‹J ∈ I.minimalPrimes›.isPrime +set_option backward.isDefEq.respectTransparency.types false in /-- For a prime ideal, its height equals its prime height. -/ private lemma Ideal.height_eq_primeHeight [I.IsPrime] : I.height = I.primeHeight := by simp [height, primeHeight, Ideal.minimalPrimes_eq_subsingleton_self] diff --git a/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean b/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean index a03040a6daaa96..d993a418c757e3 100644 --- a/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean +++ b/Mathlib/RingTheory/Ideal/KrullsHeightTheorem.lean @@ -56,6 +56,7 @@ lemma IsLocalRing.quotient_artinian_of_mem_minimalPrimes_of_isLocalRing exact hp.eq_of_le ⟨this, .trans (by simp) (Ideal.ker_le_comap _)⟩ (le_maximalIdeal this.1) IsNoetherianRing.isArtinianRing_of_krullDimLE_zero +set_option backward.isDefEq.respectTransparency.types false in lemma Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes_of_isLocalRing [IsLocalRing R] (I : Ideal R) [I.IsPrincipal] (hp : (IsLocalRing.maximalIdeal R) ∈ I.minimalPrimes) : diff --git a/Mathlib/RingTheory/Ideal/Maps.lean b/Mathlib/RingTheory/Ideal/Maps.lean index afe878699af1dc..32fac4738aa1be 100644 --- a/Mathlib/RingTheory/Ideal/Maps.lean +++ b/Mathlib/RingTheory/Ideal/Maps.lean @@ -518,6 +518,7 @@ section Bijective variable (hf : Function.Bijective f) {I : Ideal R} {K : Ideal S} include hf +set_option backward.isDefEq.respectTransparency false in /-- Special case of the correspondence theorem for isomorphic rings -/ def relIsoOfBijective : Ideal S ≃o Ideal R where toFun := comap f @@ -652,6 +653,7 @@ def mapHom : Ideal R →+* Ideal S where protected theorem map_pow (n : ℕ) : map f (I ^ n) = map f I ^ n := map_pow (mapHom f) I n +set_option backward.isDefEq.respectTransparency false in theorem comap_radical : comap f (radical K) = radical (comap f K) := by ext simp [radical] @@ -1236,6 +1238,7 @@ theorem eq_liftOfSurjective (hf : Function.Surjective f) (g : A →+* C) end RingHom +set_option backward.isDefEq.respectTransparency false in /-- Any ring isomorphism induces an order isomorphism of ideals. -/ @[simps apply] def RingEquiv.idealComapOrderIso {R S : Type*} [Semiring R] [Semiring S] (e : R ≃+* S) : diff --git a/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean b/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean index 74b68815f1914c..6e70e825655244 100644 --- a/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean +++ b/Mathlib/RingTheory/Ideal/Norm/RelNorm.lean @@ -103,6 +103,7 @@ theorem map_spanIntNorm (I : Ideal S) {T : Type*} [Semiring T] (f : R →+* T) : theorem spanNorm_mono {I J : Ideal S} (h : I ≤ J) : spanNorm R I ≤ spanNorm R J := Ideal.span_mono (Set.monotone_image h) +set_option backward.isDefEq.respectTransparency.types false in theorem spanIntNorm_localization (I : Ideal S) (M : Submonoid R) (hM : M ≤ R⁰) {Rₘ : Type*} (Sₘ : Type*) [CommRing Rₘ] [Algebra R Rₘ] [CommRing Sₘ] [Algebra S Sₘ] [Algebra Rₘ Sₘ] [Algebra R Sₘ] [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ] diff --git a/Mathlib/RingTheory/Ideal/Operations.lean b/Mathlib/RingTheory/Ideal/Operations.lean index e0824b1e53b0ca..081155ba212c0d 100644 --- a/Mathlib/RingTheory/Ideal/Operations.lean +++ b/Mathlib/RingTheory/Ideal/Operations.lean @@ -30,6 +30,11 @@ open scoped Pointwise namespace Submodule +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + Set + Set.range + lemma coe_span_smul {R' M' : Type*} [CommSemiring R'] [AddCommMonoid M'] [Module R' M'] (s : Set R') (N : Submodule R' M') : (Ideal.span s : Set R') • N = s • N := @@ -1299,6 +1304,7 @@ noncomputable def finsuppTotal : (ι →₀ I) →ₗ[R] M := variable {ι M v} set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in theorem finsuppTotal_apply (f : ι →₀ I) : finsuppTotal ι M I v f = f.sum fun i x => (x : R) • v i := by dsimp [finsuppTotal] diff --git a/Mathlib/RingTheory/Ideal/Prod.lean b/Mathlib/RingTheory/Ideal/Prod.lean index a35ddec7659af5..bc01f5d870852f 100644 --- a/Mathlib/RingTheory/Ideal/Prod.lean +++ b/Mathlib/RingTheory/Ideal/Prod.lean @@ -91,6 +91,7 @@ theorem map_prodComm_prod : refine Trans.trans (ideal_prod_eq _) ?_ simp [map_map] +set_option backward.isDefEq.respectTransparency false in /-- Ideals of `R × S` are in one-to-one correspondence with pairs of ideals of `R` and ideals of `S`. -/ def idealProdEquiv : Ideal (R × S) ≃o Ideal R × Ideal S where diff --git a/Mathlib/RingTheory/Ideal/Quotient/Basic.lean b/Mathlib/RingTheory/Ideal/Quotient/Basic.lean index 6d3fa90bb8b0d5..0107e643eb8490 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Basic.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Basic.lean @@ -201,6 +201,7 @@ noncomputable def piQuotEquiv [I.IsTwoSided] : ((ι → R) ⧸ pi fun _ ↦ I) exact Ideal.Quotient.eq.2 fun i ↦ Ideal.Quotient.eq.1 (Quotient.out_eq' _) right_inv x := funext fun i ↦ Quotient.out_eq' (x i) +set_option backward.isDefEq.respectTransparency false in /-- If `f : R^n → R^m` is an `R`-linear map and `I ⊆ R` is an ideal, then the image of `I^n` is contained in `I^m`. -/ theorem map_pi [I.IsTwoSided] [Finite ι] (x : ι → R) (hi : ∀ i, x i ∈ I) diff --git a/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean b/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean index 366453b7edab6c..7d3aa0d34aceae 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/ChineseRemainder.lean @@ -24,6 +24,7 @@ namespace Ideal open TensorProduct LinearMap +set_option backward.isDefEq.respectTransparency.types false in lemma pi_mkQ_rTensor [Fintype ι] [DecidableEq ι] : (LinearMap.pi fun i ↦ (I i).mkQ).rTensor M = (piLeft ..).symm.toLinearMap ∘ₗ .pi (fun i ↦ TensorProduct.mk R (R ⧸ I i) M 1) ∘ₗ TensorProduct.lid R M := by diff --git a/Mathlib/RingTheory/Ideal/Quotient/Index.lean b/Mathlib/RingTheory/Ideal/Quotient/Index.lean index ad8ffac0b28bd3..dda8ff5885814d 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Index.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Index.lean @@ -55,6 +55,8 @@ lemma Submodule.finite_quotient_smul [Finite (R ⧸ I)] [Finite (M ⧸ N)] (hN : have : Finite ((R ⧸ I) ⊗[R] N) := Module.finite_of_finite (R ⧸ I) exact Nat.card_pos.ne' +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in -- We have `hs` and `N` instead of using `span R s` in the goal to make it easier to use. -- Usually we would like to bound the index of some abstract `I • N`, and we may construct `s` while -- applying this lemma instead of having to provide it beforehand. diff --git a/Mathlib/RingTheory/Ideal/Quotient/Operations.lean b/Mathlib/RingTheory/Ideal/Quotient/Operations.lean index 8a5d73d16743ff..6b982c5257a89b 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Operations.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Operations.lean @@ -139,6 +139,7 @@ theorem map_mk_eq_bot_of_le {I J : Ideal R} [J.IsTwoSided] (h : I ≤ J) : rw [map_eq_bot_iff_le_ker, mk_ker] exact h +set_option backward.isDefEq.respectTransparency false in theorem ker_quotient_lift {I : Ideal R} [I.IsTwoSided] (f : R →+* S) (H : I ≤ ker f) : ker (Ideal.Quotient.lift I f H) = (RingHom.ker f).map (Quotient.mk I) := by @@ -156,6 +157,7 @@ theorem ker_quotient_lift {I : Ideal R} [I.IsTwoSided] (f : R →+* S) rw [mem_ker, ← hy.right, Ideal.Quotient.lift_mk] exact hy.left +set_option backward.isDefEq.respectTransparency false in lemma injective_lift_iff {I : Ideal R} [I.IsTwoSided] {f : R →+* S} (H : ∀ (a : R), a ∈ I → f a = 0) : Injective (Quotient.lift I f H) ↔ ker f = I := by @@ -463,6 +465,7 @@ section variable [Semiring B] [Algebra R₁ B] +set_option backward.isDefEq.respectTransparency false in /-- `Ideal.quotient.lift` as an `AlgHom`. -/ def Quotient.liftₐ (I : Ideal A) [I.IsTwoSided] (f : A →ₐ[R₁] B) (hI : ∀ a : A, a ∈ I → f a = 0) : A ⧸ I →ₐ[R₁] B := @@ -560,6 +563,7 @@ def _root_.AlgHom.liftOfSurjective (f : A →ₐ[R] B) (hf : Function.Surjective (g : A →ₐ[R] C) (H : RingHom.ker f.toRingHom ≤ RingHom.ker g.toRingHom) : B →ₐ[R] C := .comp (Ideal.Quotient.liftₐ _ g H) (Ideal.quotientKerAlgEquivOfSurjective hf).symm.toAlgHom +set_option backward.isDefEq.respectTransparency false in @[simp] lemma _root_.AlgHom.liftOfSurjective_apply (f : A →ₐ[R] B) (hf : Function.Surjective f) (g : A →ₐ[R] C) (H : RingHom.ker f.toRingHom ≤ RingHom.ker g.toRingHom) (x) : @@ -610,6 +614,7 @@ theorem quotientMap_comp_mk {J : Ideal R} {I : Ideal S} [I.IsTwoSided] [J.IsTwoS (quotientMap I f H).comp (Quotient.mk J) = (Quotient.mk I).comp f := RingHom.ext fun x => by simp only [Function.comp_apply, RingHom.coe_comp, Ideal.quotientMap_mk] +set_option backward.isDefEq.respectTransparency false in lemma ker_quotientMap_mk {I J : Ideal R} [I.IsTwoSided] [J.IsTwoSided] : RingHom.ker (quotientMap (J.map _) (Quotient.mk I) le_comap_map) = I.map (Quotient.mk J) := by rw [Ideal.quotientMap, Ideal.ker_quotient_lift, ← RingHom.comap_ker, Ideal.mk_ker, @@ -688,6 +693,7 @@ section variable [Ring B] [Algebra R₁ B] {I : Ideal A} (J : Ideal B) [I.IsTwoSided] [J.IsTwoSided] +set_option backward.isDefEq.respectTransparency false in /-- The algebra hom `A/I →+* B/J` induced by an algebra hom `f : A →ₐ[R₁] B` with `I ≤ f⁻¹(J)`. -/ def quotientMapₐ (f : A →ₐ[R₁] B) (hIJ : I ≤ J.comap f) : A ⧸ I →ₐ[R₁] B ⧸ J := @@ -703,6 +709,7 @@ theorem quotient_map_comp_mkₐ (f : A →ₐ[R₁] B) (H : I ≤ J.comap f) : (quotientMapₐ J f H).comp (Quotient.mkₐ R₁ I) = (Quotient.mkₐ R₁ J).comp f := AlgHom.ext fun x => by simp only [quotient_map_mkₐ, Quotient.mkₐ_eq_mk, AlgHom.comp_apply] +set_option backward.isDefEq.respectTransparency false in variable (I) in /-- The algebra equiv `A/I ≃ₐ[R] B/J` induced by an algebra equiv `f : A ≃ₐ[R] B`, where `J = f(I)`. -/ @@ -861,6 +868,7 @@ variable [CommRing R] (I J : Ideal R) def quotLeftToQuotSup : R ⧸ I →+* R ⧸ I ⊔ J := Ideal.Quotient.factor le_sup_left +set_option backward.isDefEq.respectTransparency false in /-- The kernel of `quotLeftToQuotSup` -/ theorem ker_quotLeftToQuotSup : RingHom.ker (quotLeftToQuotSup I J) = J.map (Ideal.Quotient.mk I) := by diff --git a/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean b/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean index 24de176f9eea4d..627c8d4d425f24 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/PowTransition.lean @@ -54,6 +54,7 @@ lemma Ideal.Quotient.factor_ker (H : I ≤ J) [I.IsTwoSided] [J.IsTwoSided] : · rcases mem_image_of_mem_map_of_surjective _ Ideal.Quotient.mk_surjective h with ⟨r, hr, eq⟩ simpa [← eq, Ideal.Quotient.eq_zero_iff_mem] using hr +set_option backward.isDefEq.respectTransparency false in lemma Submodule.eq_factor_of_eq_factor_succ {p : ℕ → Submodule R M} (hp : Antitone p) (x : (n : ℕ) → M ⧸ (p n)) (h : ∀ m, x m = factor (hp m.le_succ) (x (m + 1))) {m n : ℕ} (g : m ≤ n) : x m = factor (hp g) (x n) := by diff --git a/Mathlib/RingTheory/IdealFilter/Topology.lean b/Mathlib/RingTheory/IdealFilter/Topology.lean index 09c597b7fe4503..2606328390d38f 100644 --- a/Mathlib/RingTheory/IdealFilter/Topology.lean +++ b/Mathlib/RingTheory/IdealFilter/Topology.lean @@ -43,7 +43,7 @@ open scoped Pointwise Topology namespace IdealFilter /-- The additive-group filter basis whose sets are the ideals belonging to the ideal filter `F`. -/ -@[implicit_reducible] +@[instance_reducible] def addGroupFilterBasis {A : Type*} [Ring A] (F : IdealFilter A) : AddGroupFilterBasis A where sets := {(I : Set A) | I ∈ F} nonempty := ⟨_, ⟨_, F.nonempty.choose_spec, rfl⟩⟩ @@ -56,7 +56,7 @@ def addGroupFilterBasis {A : Type*} [Ring A] (F : IdealFilter A) : AddGroupFilte conj' := by aesop /-- Under `[F.IsUniform]`, the ring filter basis obtained from `addGroupFilterBasis`. -/ -@[simps! -isSimp sets, implicit_reducible] +@[simps! -isSimp sets, instance_reducible] def ringFilterBasis {A : Type*} [Ring A] {F : IdealFilter A} [F.IsUniform] : RingFilterBasis A where __ := F.addGroupFilterBasis diff --git a/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean b/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean index 4632e56e931129..a3d82ffedd47c6 100644 --- a/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean +++ b/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean @@ -56,6 +56,7 @@ def galRestrict' (f : L →ₐ[K] L₂) : (B →ₐ[A] B₂) := (((f.restrictScalars A).comp (IsScalarTower.toAlgHom A B L)).codRestrict (integralClosure A L₂) (fun x ↦ IsIntegral.map _ (IsIntegralClosure.isIntegral A L x))) +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma algebraMap_galRestrict'_apply (σ : L →ₐ[K] L₂) (x : B) : algebraMap B₂ L₂ (galRestrict' A B B₂ σ x) = σ (algebraMap B L x) := by @@ -67,6 +68,7 @@ theorem galRestrict'_id : galRestrict' A B B (.id K L) = .id A B := by apply IsIntegralClosure.algebraMap_injective B A L simp +set_option backward.isDefEq.respectTransparency.types false in theorem galRestrict'_comp (σ : L →ₐ[K] L₂) (σ' : L₂ →ₐ[K] L₃) : galRestrict' A B B₃ (σ'.comp σ) = (galRestrict' A B₂ B₃ σ').comp (galRestrict' A B B₂ σ) := by ext x @@ -121,6 +123,7 @@ theorem galLift_comp [Algebra.IsAlgebraic K L₂] (σ : B →ₐ[A] B₂) (σ' : AlgHom.coe_ringHom_injective <| IsLocalization.ringHom_ext (Algebra.algebraMapSubmonoid B A⁰) <| RingHom.ext fun x ↦ by simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem galLift_galRestrict' (σ : L →ₐ[K] L₂) : galLift K L L₂ (galRestrict' A B B₂ σ) = σ := @@ -321,6 +324,7 @@ open nonZeroDivisors variable [IsDomain Aₘ] [IsIntegrallyClosed Aₘ] [IsDomain Bₘ] [IsIntegrallyClosed Bₘ] variable [IsTorsionFree Aₘ Bₘ] [Module.Finite Aₘ Bₘ] +set_option backward.isDefEq.respectTransparency.types false in include M in lemma Algebra.intTrace_eq_of_isLocalization (x : B) : @@ -472,6 +476,7 @@ lemma Algebra.intNorm_ne_zero [FiniteDimensional (FractionRing A) (FractionRing variable [IsDomain Aₘ] [IsIntegrallyClosed Aₘ] [IsDomain Bₘ] [IsIntegrallyClosed Bₘ] variable [IsTorsionFree Aₘ Bₘ] [Algebra.IsIntegral Aₘ Bₘ] +set_option backward.isDefEq.respectTransparency.types false in include M in lemma Algebra.intNorm_eq_of_isLocalization [FiniteDimensional (FractionRing A) (FractionRing B)] (x : B) : diff --git a/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean b/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean index 1d3a91951ec546..3eba187f75d466 100644 --- a/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean +++ b/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean @@ -375,6 +375,7 @@ section localization variable {R : Type*} (S : Type*) [CommRing R] [CommRing S] [Algebra R S] +set_option backward.isDefEq.respectTransparency.types false in lemma isIntegrallyClosed_of_isLocalization [IsIntegrallyClosed R] [IsDomain R] (M : Submonoid R) (hM : M ≤ R⁰) [IsLocalization M S] : IsIntegrallyClosed S := by let K := FractionRing R diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean index 13ef5f6e66b7ec..312dd709151ffa 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean @@ -574,6 +574,7 @@ theorem Algebra.IsIntegral.tower_top [Algebra R S] [Algebra R T] [Algebra S T] [ rw [← IsScalarTower.algebraMap_eq R S T] exact h.isIntegral +set_option backward.isDefEq.respectTransparency.types false in theorem RingHom.IsIntegral.quotient {I : Ideal S} (hf : f.IsIntegral) : (Ideal.quotientMap I f le_rfl).IsIntegral := by rintro ⟨x⟩ diff --git a/Mathlib/RingTheory/IntegralDomain.lean b/Mathlib/RingTheory/IntegralDomain.lean index 952c02b282160e..e9b649f867cb37 100644 --- a/Mathlib/RingTheory/IntegralDomain.lean +++ b/Mathlib/RingTheory/IntegralDomain.lean @@ -51,7 +51,7 @@ theorem mul_left_bijective_of_finite₀ [IsRightCancelMulZero M] {a : M} (ha : a Finite.injective_iff_bijective.1 <| mul_left_injective₀ ha /-- Every finite nontrivial cancellative monoid with zero is a group with zero. -/ -@[implicit_reducible] +@[instance_reducible] def Fintype.groupWithZeroOfCancel (M : Type*) [MonoidWithZero M] [IsLeftCancelMulZero M] [DecidableEq M] [Fintype M] [Nontrivial M] : GroupWithZero M := { ‹Nontrivial M›, @@ -93,7 +93,7 @@ section Ring /-- Every finite domain is a division ring. More generally, they are fields; this can be found in `Mathlib/RingTheory/LittleWedderburn.lean`. -/ -@[implicit_reducible] +@[instance_reducible] def Fintype.divisionRingOfIsDomain (R : Type*) [Ring R] [IsDomain R] [DecidableEq R] [Fintype R] : DivisionRing R where __ := (‹Ring R› :) -- this also works without the `( :)`, but it's slightly slow @@ -105,7 +105,7 @@ def Fintype.divisionRingOfIsDomain (R : Type*) [Ring R] [IsDomain R] [DecidableE /-- Every finite commutative domain is a field. More generally, commutativity is not required: this can be found in `Mathlib/RingTheory/LittleWedderburn.lean`. -/ -@[implicit_reducible] +@[instance_reducible] def Fintype.fieldOfDomain (R) [CommRing R] [IsDomain R] [DecidableEq R] [Fintype R] : Field R := { Fintype.divisionRingOfIsDomain R, ‹CommRing R› with } diff --git a/Mathlib/RingTheory/Invariant/Basic.lean b/Mathlib/RingTheory/Invariant/Basic.lean index 111c62aa77d081..d6bcfcf2b930ca 100644 --- a/Mathlib/RingTheory/Invariant/Basic.lean +++ b/Mathlib/RingTheory/Invariant/Basic.lean @@ -50,7 +50,7 @@ variable (A K L B : Type*) [CommRing A] [CommRing B] [Field K] [Field L] [IsIntegrallyClosed A] [IsIntegralClosure B A L] /-- In the AKLB setup, the Galois group of `L/K` acts on `B`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def IsIntegralClosure.MulSemiringAction [Algebra.IsAlgebraic K L] : MulSemiringAction Gal(L/K) B := MulSemiringAction.compHom B (galRestrict A K L B).toMonoidHom @@ -94,6 +94,7 @@ section Quotient variable {A B : Type*} [CommRing A] [CommRing B] [Algebra A B] variable {G : Type*} [Group G] [MulSemiringAction G B] [SMulCommClass G A B] +set_option backward.isDefEq.respectTransparency.types false in instance (H : Subgroup G) [H.Normal] : MulSemiringAction (G ⧸ H) (FixedPoints.subring B H) where smul := Quotient.lift (fun g x ↦ ⟨g • x, fun h ↦ by @@ -112,10 +113,12 @@ instance (H : Subgroup G) [H.Normal] : MulSemiringAction (G ⧸ H) (FixedPoints.subalgebra A B H) := inferInstanceAs (MulSemiringAction (G ⧸ H) (FixedPoints.subring B H)) +set_option backward.isDefEq.respectTransparency.types false in instance (H : Subgroup G) [H.Normal] : SMulCommClass (G ⧸ H) A (FixedPoints.subalgebra A B H) where smul_comm := Quotient.ind fun g r h ↦ Subtype.ext (smul_comm g r h.1) +set_option backward.isDefEq.respectTransparency.types false in instance (H : Subgroup G) [H.Normal] [Algebra.IsInvariant A B G] : Algebra.IsInvariant A (FixedPoints.subalgebra A B H) (G ⧸ H) where isInvariant x hx := by diff --git a/Mathlib/RingTheory/IsAdjoinRoot.lean b/Mathlib/RingTheory/IsAdjoinRoot.lean index eb6034e89f1241..526c51f0d91f61 100644 --- a/Mathlib/RingTheory/IsAdjoinRoot.lean +++ b/Mathlib/RingTheory/IsAdjoinRoot.lean @@ -317,10 +317,12 @@ theorem coe_liftHom : (h.liftHom x hx' : S →+* T) = h.lift (algebraMap R T) x theorem lift_algebraMap_apply (z : S) : h.lift (algebraMap R T) x hx' z = h.liftHom x hx' z := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem liftHom_map (z : R[X]) : h.liftHom x hx' (h.map z) = aeval x z := by rw [← lift_algebraMap_apply, lift_map, aeval_def] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem liftHom_root : h.liftHom x hx' h.root = x := by rw [← lift_algebraMap_apply, lift_root] @@ -410,6 +412,7 @@ theorem modByMonicHom_root_pow {n : ℕ} (hdeg : n < natDegree f) : theorem modByMonicHom_root (hdeg : 1 < natDegree f) : h.modByMonicHom h.root = X := by simpa using modByMonicHom_root_pow h hdeg +set_option backward.isDefEq.respectTransparency.types false in /-- The basis on `S` generated by powers of `h.root`. Auxiliary definition for `IsAdjoinRootMonic.powerBasis`. -/ @@ -446,6 +449,7 @@ def basis : Basis (Fin (natDegree f)) R S where repr.map_add' := by simp [Finsupp.comapDomain_add_of_injective Fin.val_injective] repr.map_smul' := by simp [Finsupp.comapDomain_smul_of_injective Fin.val_injective] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem basis_apply (i) : h.basis i = h.root ^ (i : ℕ) := Basis.apply_eq_iff.mpr <| by @@ -467,6 +471,7 @@ def powerBasis : PowerBasis R S where basis := h.basis basis_eq_pow := h.basis_apply +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem basis_repr (x : S) (i : Fin (natDegree f)) : h.basis.repr x i = (h.modByMonicHom x).coeff (i : ℕ) := by @@ -578,6 +583,7 @@ variable (h : IsAdjoinRoot S f) section lift +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem lift_self_apply (x : S) : h.lift (algebraMap R S) h.root h.aeval_root_self x = x := by rw [← h.map_repr x, lift_map, ← aeval_def, h.aeval_root_eq_map] @@ -645,6 +651,7 @@ theorem minpoly_eq [IsDomain R] [IsDomain S] [IsTorsionFree R S] [IsIntegrallyCl (hirr.isUnit_or_isUnit hq).resolve_left <| minpoly.not_isUnit R h.root rw [mul_one] +set_option backward.isDefEq.respectTransparency.types false in /-- If `α` generates `S` as an algebra and `S` is free and finite, then `S` is given by adjoining a root of `minpoly R α`. Does not require that `R` is an integral domain, unlike `mkOfAdjoinEqTop`. -/ diff --git a/Mathlib/RingTheory/IsPrimary.lean b/Mathlib/RingTheory/IsPrimary.lean index ddb0173fd381ee..c69a3f4707ecdb 100644 --- a/Mathlib/RingTheory/IsPrimary.lean +++ b/Mathlib/RingTheory/IsPrimary.lean @@ -114,6 +114,7 @@ section CommRing variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] {S : Submodule R M} +set_option backward.isDefEq.respectTransparency false in lemma isPrimary_iff_zero_divisor_quotient_imp_nilpotent_smul : S.IsPrimary ↔ S ≠ ⊤ ∧ ∀ (r : R) (x : M ⧸ S), x ≠ 0 → r • x = 0 → ∃ n : ℕ, r ^ n • (⊤ : Submodule R (M ⧸ S)) = ⊥ := by diff --git a/Mathlib/RingTheory/IsTensorProduct.lean b/Mathlib/RingTheory/IsTensorProduct.lean index 279ad1ec69a96c..21b69bf60664ab 100644 --- a/Mathlib/RingTheory/IsTensorProduct.lean +++ b/Mathlib/RingTheory/IsTensorProduct.lean @@ -175,6 +175,7 @@ variable {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S] [Module R M₂₃] [Module S M₂₃] [IsScalarTower R S M₂₃] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- (Implementation): Use the more linear `IsTensorProduct.assoc`. -/ private noncomputable def assocAux (f : M₁ →ₗ[R] M₂ →ₗ[S] M₁₂) (hf : IsTensorProduct (f.restrictScalars₁₂ R R)) @@ -208,6 +209,7 @@ private lemma assocAux_symm_tmul (x₁ : M₁) (x₂ : M₂) (x₃ : M₃) : (IsTensorProduct.assocAux f hf g hg).symm (x₁ ⊗ₜ g x₂ x₃) = f x₁ x₂ ⊗ₜ x₃ := by simp [IsTensorProduct.assocAux] +set_option backward.isDefEq.respectTransparency.types false in @[simp] private lemma assocAux_tmul (x₁ : M₁) (x₂ : M₂) (x₃ : M₃) : IsTensorProduct.assocAux f hf g hg (f x₁ x₂ ⊗ₜ x₃) = x₁ ⊗ₜ g x₂ x₃ := by @@ -215,6 +217,7 @@ private lemma assocAux_tmul (x₁ : M₁) (x₂ : M₂) (x₃ : M₃) : simp [IsTensorProduct.assocAux, this] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- This is the canonical isomorphism `(M₁ ⊗[R] M₂) ⊗[S] M₃ ≃ₗ[T] M₁ ⊗[R] (M₂ ⊗[S] M₃)`. We state this for a general `M₁₂ = M₁ ⊗[R] M₂` and `M₂₃ = M₂ ⊗[R] M₃`. @@ -396,6 +399,7 @@ theorem TensorProduct.isBaseChange : IsBaseChange S (TensorProduct.mk R S M 1) : variable {R M N S} +set_option backward.isDefEq.respectTransparency false in /-- The base change of `M` along `R → S` is linearly equivalent to `S ⊗[R] M`. -/ noncomputable nonrec def IsBaseChange.equiv : S ⊗[R] M ≃ₗ[S] N := { h.equiv with @@ -416,6 +420,7 @@ theorem IsBaseChange.equiv_tmul (s : S) (m : M) : h.equiv (s ⊗ₜ m) = s • f theorem IsBaseChange.equiv_symm_apply (m : M) : h.equiv.symm (f m) = 1 ⊗ₜ m := by rw [h.equiv.symm_apply_eq, h.equiv_tmul, one_smul] +set_option backward.isDefEq.respectTransparency false in lemma IsBaseChange.of_equiv (e : S ⊗[R] M ≃ₗ[S] N) (he : ∀ x, e (1 ⊗ₜ x) = f x) : IsBaseChange S f := by apply IsTensorProduct.of_equiv (e.restrictScalars R) @@ -702,6 +707,7 @@ noncomputable def Algebra.pushoutDesc [H : Algebra.IsPushout R S R' S'] {A : Typ (Algebra.TensorProduct.lift f g hf).comp ((Algebra.IsPushout.equiv R S R' S').symm.toAlgHom.restrictScalars R) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem Algebra.pushoutDesc_left [Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A] [Algebra R A] (f : S →ₐ[R] A) (g : R' →ₐ[R] A) (H) (x : S) : @@ -713,6 +719,7 @@ theorem Algebra.lift_algHom_comp_left [Algebra.IsPushout R S R' S'] {A : Type*} (Algebra.pushoutDesc S' f g H).comp (toAlgHom R S S') = f := AlgHom.ext fun x => (Algebra.pushoutDesc_left S' f g H x :) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem Algebra.pushoutDesc_right [Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A] [Algebra R A] (f : S →ₐ[R] A) (g : R' →ₐ[R] A) (H) (x : R') : @@ -847,6 +854,7 @@ lemma IsPushout.cancelBaseChangeAlg_tmul (c : C) : IsPushout.cancelBaseChangeAlg R S A B C (1 ⊗ₜ c) = 1 ⊗ₜ c := by simp [cancelBaseChangeAlg] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma IsPushout.cancelBaseChangeAlg_symm_tmul (s : S) (c : C) : (IsPushout.cancelBaseChangeAlg R S A B C).symm (s ⊗ₜ c) = algebraMap S B s ⊗ₜ c := by diff --git a/Mathlib/RingTheory/Kaehler/Basic.lean b/Mathlib/RingTheory/Kaehler/Basic.lean index 74ff2b9b6aa8c8..38eb3e2791ded3 100644 --- a/Mathlib/RingTheory/Kaehler/Basic.lean +++ b/Mathlib/RingTheory/Kaehler/Basic.lean @@ -509,6 +509,7 @@ theorem KaehlerDifferential.kerTotal_mkQ_single_smul (r : R) (x y) : (y𝖣r • KaehlerDifferential.kerTotal_mkQ_single_algebraMap, add_zero, ← LinearMap.map_smul_of_tower, Finsupp.smul_single, mul_comm, Algebra.smul_def] +set_option backward.isDefEq.respectTransparency.types false in /-- The (universal) derivation into `(S →₀ S) ⧸ KaehlerDifferential.kerTotal R S`. -/ noncomputable def KaehlerDifferential.derivationQuotKerTotal : Derivation R S ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) where diff --git a/Mathlib/RingTheory/Kaehler/JacobiZariski.lean b/Mathlib/RingTheory/Kaehler/JacobiZariski.lean index c8d9068390f620..4dd855d8999326 100644 --- a/Mathlib/RingTheory/Kaehler/JacobiZariski.lean +++ b/Mathlib/RingTheory/Kaehler/JacobiZariski.lean @@ -378,6 +378,7 @@ lemma δ_eq (x : Q.toExtension.H1Cotangent) (y) apply SnakeLemma.δ_eq exacts [hy, hz] +set_option backward.isDefEq.respectTransparency.types false in lemma δ_eq_δAux (x : Q.ker) (hx) : δ Q P ⟨.mk x, hx⟩ = δAux R Q x.1 := by let y := Extension.Cotangent.mk (P := (Q.comp P).toExtension) (Q.kerCompPreimage P x) @@ -401,6 +402,7 @@ lemma δ_eq_δAux (x : Q.ker) (hx) : ((Q.comp P).toExtension.cotangentComplex y) rw [CotangentSpace.fst_compEquiv, Extension.CotangentSpace.map_cotangentComplex, hy, hx] +set_option backward.isDefEq.respectTransparency.types false in lemma δ_eq_δ : δ Q P = δ Q P' := by ext ⟨x, hx⟩ obtain ⟨x, rfl⟩ := Extension.Cotangent.mk_surjective x diff --git a/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean b/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean index f9485349cf4bc1..fe0d9806f7800c 100644 --- a/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean +++ b/Mathlib/RingTheory/KrullDimension/NonZeroDivisors.lean @@ -33,6 +33,7 @@ lemma ringKrullDim_quotient (I : Ideal R) : ringKrullDim (R ⧸ I) = Order.krullDim (PrimeSpectrum.zeroLocus (R := R) I) := by rw [ringKrullDim, Order.krullDim_eq_of_orderIso I.primeSpectrumQuotientOrderIsoZeroLocus] +set_option backward.isDefEq.respectTransparency false in lemma ringKrullDim_quotient_succ_le_of_nonZeroDivisor {r : R} (hr : r ∈ R⁰) : ringKrullDim (R ⧸ Ideal.span {r}) + 1 ≤ ringKrullDim R := by diff --git a/Mathlib/RingTheory/KrullDimension/Regular.lean b/Mathlib/RingTheory/KrullDimension/Regular.lean index 28d87d1a5cc7ca..7428318395e51b 100644 --- a/Mathlib/RingTheory/KrullDimension/Regular.lean +++ b/Mathlib/RingTheory/KrullDimension/Regular.lean @@ -30,6 +30,7 @@ variable {R : Type*} [CommRing R] [IsNoetherianRing R] open RingTheory Sequence IsLocalRing Ideal PrimeSpectrum Pointwise +set_option backward.isDefEq.respectTransparency.types false in omit [IsNoetherianRing R] [Module.Finite R M] in lemma exists_ltSeries_support_isMaximal_last_of_ltSeries_support (q : LTSeries (support R M)) : ∃ p : LTSeries (support R M), q.length ≤ p.length ∧ p.last.1.1.IsMaximal := by @@ -73,6 +74,7 @@ theorem supportDim_le_supportDim_quotSMulTop_succ_of_mem_jacobson {x : R} grw [le_tsub_add (b := p.length) (a := 1), Nat.cast_add_one, supportDim, Order.krullDim, ← le_iSup _ q'] +set_option backward.isDefEq.respectTransparency.types false in omit [IsNoetherianRing R] in /-- If `M` is a finite module over a commutative ring `R`, `x ∈ M` is not in any minimal prime of `M`, then `dim M/xM + 1 ≤ dim M`. -/ diff --git a/Mathlib/RingTheory/LaurentSeries.lean b/Mathlib/RingTheory/LaurentSeries.lean index cb41da8dfeb24f..fa05101b83b3c5 100644 --- a/Mathlib/RingTheory/LaurentSeries.lean +++ b/Mathlib/RingTheory/LaurentSeries.lean @@ -905,6 +905,7 @@ lemma exists_ratFunc_eq_v (x : K⸨X⸩) : ∃ f : K⟮X⟯, Valued.v f = Valued open MonoidWithZeroHom.ValueGroup₀ +set_option backward.isDefEq.respectTransparency.types false in theorem inducing_coe : IsUniformInducing ((↑) : K⟮X⟯ → K⸨X⸩) := by rw [isUniformInducing_iff, Filter.comap] ext S @@ -1060,6 +1061,7 @@ theorem valuation_LaurentSeries_equal_extension : rfl · exact Valued.continuous_valuation_of_surjective (valuation_surjective K) +set_option backward.isDefEq.respectTransparency.types false in theorem tendsto_valuation (a : (idealX K).adicCompletion K⟮X⟯) : Tendsto (Valued.v : K⟮X⟯ → ℤᵐ⁰) (comap (↑) (𝓝 a)) (𝓝 (Valued.v a : ℤᵐ⁰)) := by have := Valued.is_topological_valuation (R := (idealX K).adicCompletion K⟮X⟯) @@ -1130,6 +1132,7 @@ lemma powerSeriesEquivSubring_coe_apply (f : K⟦X⟧) : (powerSeriesEquivSubring K f : K⸨X⸩) = ofPowerSeries ℤ K f := rfl +set_option backward.isDefEq.respectTransparency.types false in /- Through the isomorphism `LaurentSeriesRingEquiv`, power series land in the unit ball inside the completion of `K⟮X⟯`. -/ theorem mem_integers_of_powerSeries (F : K⟦X⟧) : diff --git a/Mathlib/RingTheory/LittleWedderburn.lean b/Mathlib/RingTheory/LittleWedderburn.lean index 20425e0914f877..a13c3a9210d5fa 100644 --- a/Mathlib/RingTheory/LittleWedderburn.lean +++ b/Mathlib/RingTheory/LittleWedderburn.lean @@ -55,13 +55,14 @@ open Module Polynomial variable {D} -@[implicit_reducible] +@[instance_reducible] private def field (hD : InductionHyp D) {R : Subring D} (hR : R < ⊤) [Fintype D] [DecidableEq D] [DecidablePred (· ∈ R)] : Field R := { show DivisionRing R from Fintype.divisionRingOfIsDomain R with mul_comm := fun x y ↦ Subtype.ext <| hD hR x.2 y.2 } +set_option backward.isDefEq.respectTransparency.types false in /-- We prove that if every subring of `D` is central, then so is `D`. -/ private theorem center_eq_top [Finite D] (hD : InductionHyp D) : Subring.center D = ⊤ := by classical diff --git a/Mathlib/RingTheory/LocalProperties/Basic.lean b/Mathlib/RingTheory/LocalProperties/Basic.lean index 93684cdd70eae3..87d69baa7cbaf0 100644 --- a/Mathlib/RingTheory/LocalProperties/Basic.lean +++ b/Mathlib/RingTheory/LocalProperties/Basic.lean @@ -423,6 +423,7 @@ lemma RingHom.OfLocalizationSpan.ofIsLocalization' exact ⟨Rᵣ, Sᵣ, inferInstance, inferInstance, inferInstance, inferInstance, inferInstance, inferInstance, IsLocalization.Away.map Rᵣ Sᵣ f r, IsLocalization.map_comp _, hf⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma RingHom.OfLocalizationSpanTarget.ofIsLocalization (hP : RingHom.OfLocalizationSpanTarget P) (hP' : RingHom.RespectsIso P) {R S : Type u} [CommRing R] [CommRing S] (f : R →+* S) (s : Set S) (hs : Ideal.span s = ⊤) diff --git a/Mathlib/RingTheory/LocalProperties/Projective.lean b/Mathlib/RingTheory/LocalProperties/Projective.lean index 668948e2ba7be2..18bf928b5d04b3 100644 --- a/Mathlib/RingTheory/LocalProperties/Projective.lean +++ b/Mathlib/RingTheory/LocalProperties/Projective.lean @@ -128,6 +128,8 @@ theorem LinearMap.split_surjective_of_localization_maximal simp only [coe_comp, coe_restrictScalars, Function.comp_apply, LocalizedModule.mkLinearMap_apply, LocalizedModule.map_mk, llcomp_apply] +-- TODO: `respectTransparency.types false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in theorem Module.projective_of_localization_maximal (H : ∀ (I : Ideal R) (_ : I.IsMaximal), Module.Projective (Localization.AtPrime I) (LocalizedModule I.primeCompl M)) [Module.FinitePresentation R M] : Module.Projective R M := by @@ -159,6 +161,7 @@ variable [inst : ∀ (P : Ideal R) [P.IsMaximal], IsLocalizedModule P.primeCompl (f P)] set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in attribute [local instance] RingHomInvPair.of_ringEquiv RingHomInvPair.of_ringEquiv_symm in include f in /-- diff --git a/Mathlib/RingTheory/LocalRing/LocalSubring.lean b/Mathlib/RingTheory/LocalRing/LocalSubring.lean index 1d1c24ddd30fdb..eb50662accec03 100644 --- a/Mathlib/RingTheory/LocalRing/LocalSubring.lean +++ b/Mathlib/RingTheory/LocalRing/LocalSubring.lean @@ -83,6 +83,7 @@ section ofPrime variable (A : Subring K) (P : Ideal A) [P.IsPrime] +set_option backward.isDefEq.respectTransparency false in /-- The localization of a subring at a prime, as a local subring. Also see `Localization.subalgebra.ofField` -/ noncomputable @@ -99,6 +100,7 @@ instance : Algebra A (ofPrime A P).toSubring := (Subring.inclusion (le_ofPrime A instance : IsScalarTower A (ofPrime A P).toSubring K := .of_algebraMap_eq (fun _ ↦ rfl) +set_option backward.isDefEq.respectTransparency false in -- see https://github.com/leanprover-community/mathlib4/issues/29041 set_option linter.unusedSimpArgs false in /-- The localization of a subring at a prime is indeed isomorphic to its abstract localization. -/ diff --git a/Mathlib/RingTheory/LocalRing/Module.lean b/Mathlib/RingTheory/LocalRing/Module.lean index 6bbcdde8c76e2d..05abcaa8d6b287 100644 --- a/Mathlib/RingTheory/LocalRing/Module.lean +++ b/Mathlib/RingTheory/LocalRing/Module.lean @@ -251,6 +251,7 @@ theorem free_of_maximalIdeal_rTensor_injective [Module.FinitePresentation R M] obtain ⟨_, _, b, _⟩ := exists_basis_of_span_of_maximalIdeal_rTensor_injective H id (by simp) exact Free.of_basis b +set_option backward.isDefEq.respectTransparency.types false in theorem IsLocalRing.linearIndependent_of_flat [Flat R M] {ι : Type u} (v : ι → M) (h : LinearIndependent k (TensorProduct.mk R k M 1 ∘ v)) : LinearIndependent R v := by rw [linearIndependent_iff']; intro s f hfv i hi @@ -288,6 +289,7 @@ theorem IsLocalRing.linearIndependent_of_flat [Flat R M] {ι : Type u} (v : ι intro i hi; rw [ih i hi, zero_mul] · exact ih i hi +set_option backward.isDefEq.respectTransparency.types false in open Finsupp in theorem IsLocalRing.linearCombination_bijective_of_flat [Module.Finite R M] [Flat R M] {ι : Type u} (v : ι → M) (h : Function.Bijective (linearCombination k (TensorProduct.mk R k M 1 ∘ v))) : diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean index fd4f6027c0ad69..a5781fc8b691b0 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Ideal.lean @@ -55,6 +55,7 @@ lemma RingHom.SurjectiveOnStalks.residueFieldMap_bijective exact ⟨RingHom.injective _, Ideal.Quotient.lift_surjective_of_surjective _ _ (Ideal.Quotient.mk_surjective.comp (H J ‹_›))⟩ +set_option backward.isDefEq.respectTransparency false in /-- If `I = f⁻¹(J)`, then there is a canonical embedding `κ(I) ↪ κ(J)`. -/ noncomputable def Ideal.ResidueField.mapₐ (I : Ideal A) [I.IsPrime] (J : Ideal B) [J.IsPrime] @@ -183,6 +184,7 @@ noncomputable def Ideal.ResidueField.lift IsLocalization.lift (M := (R ⧸ I)⁰) (g := Ideal.Quotient.lift I (f := f) hf₁) <| by simpa [Ideal.Quotient.mk_surjective.forall, Ideal.Quotient.eq_zero_iff_mem] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma Ideal.ResidueField.lift_algebraMap (f : R →+* S) (hf₁ : I ≤ RingHom.ker f) (hf₂ : I.primeCompl ≤ (IsUnit.submonoid S).comap f) (r : R) : diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean index f3c37bcdb40462..f14fe053e1b458 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean @@ -27,6 +27,7 @@ variable [p.IsMaximal] [q.IsMaximal] [Algebra (Localization.AtPrime p) (Localiza attribute [local instance] Ideal.Quotient.field +set_option backward.isDefEq.respectTransparency.types false in instance [Algebra.IsSeparable (A ⧸ p) (B ⧸ q)] : Algebra.IsSeparable p.ResidueField q.ResidueField := by refine Algebra.IsSeparable.of_equiv_equiv @@ -35,6 +36,7 @@ instance [Algebra.IsSeparable (A ⧸ p) (B ⧸ q)] : ext x simp [RingHom.algebraMap_toAlgebra, ← IsScalarTower.algebraMap_apply] +set_option backward.isDefEq.respectTransparency.types false in instance [Algebra.IsSeparable p.ResidueField q.ResidueField] : Algebra.IsSeparable (A ⧸ p) (B ⧸ q) := by refine Algebra.IsSeparable.of_equiv_equiv @@ -64,6 +66,7 @@ variable [p.IsPrime] [q.IsPrime] [Algebra (Localization.AtPrime p) (Localization instance : Algebra.IsAlgebraic (A ⧸ p) p.ResidueField := IsLocalization.isAlgebraic _ (nonZeroDivisors (A ⧸ p)) +set_option backward.isDefEq.respectTransparency.types false in instance [Algebra.IsIntegral A B] : Algebra.IsAlgebraic p.ResidueField q.ResidueField := by have : Algebra.IsIntegral (A ⧸ p) (B ⧸ q) := diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean index 5f60fe7eadb146..219c1028faac83 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean @@ -29,6 +29,7 @@ variable (I : Ideal R) [I.IsPrime] (J : Ideal R[X]) [J.IsPrime] [J.LiesOver I] [Localization.AtPrime.IsLiesOverAlgebra I J] +set_option backward.isDefEq.respectTransparency.types false in /-- `κ(I[X]) ≃ₐ[κ(I)] κ(I)(X)`. -/ noncomputable def residueFieldMapCAlgEquiv (hJ : J = I.map C) : @@ -95,6 +96,7 @@ lemma residueFieldMapCAlgEquiv_symm_X (hJ : J = I.map C) : (residueFieldMapCAlgEquiv I J hJ).symm .X = algebraMap R[X] _ .X := (residueFieldMapCAlgEquiv I J hJ).injective (by simp) +set_option backward.isDefEq.respectTransparency.types false in /-- `κ(p) ⊗[R] (R[X] ⧸ I) = κ(p)[X] / I` -/ noncomputable def fiberEquivQuotient (f : R[X] →ₐ[R] S) (hf : Function.Surjective f) (p : Ideal R) [p.IsPrime] : @@ -118,6 +120,7 @@ def fiberEquivQuotient (f : R[X] →ₐ[R] S) (hf : Function.Surjective f) (p : simpa using aeval_algHom_apply ((Algebra.TensorProduct.includeRight : S →ₐ[_] p.Fiber S).comp f) X x +set_option backward.isDefEq.respectTransparency.types false in lemma fiberEquivQuotient_tmul (f : R[X] →ₐ[R] S) (hf : Function.Surjective f) (p : Ideal R) [p.IsPrime] (a b) : fiberEquivQuotient f hf p (a ⊗ₜ f b) = Ideal.Quotient.mk _ (C a * b.map (algebraMap _ _)) := by diff --git a/Mathlib/RingTheory/Localization/AtPrime/Basic.lean b/Mathlib/RingTheory/Localization/AtPrime/Basic.lean index 26d93c3732bc1d..98f6bd1896bf12 100644 --- a/Mathlib/RingTheory/Localization/AtPrime/Basic.lean +++ b/Mathlib/RingTheory/Localization/AtPrime/Basic.lean @@ -139,6 +139,7 @@ namespace AtPrime variable (I : Ideal R) [hI : I.IsPrime] [IsLocalization.AtPrime S I] +set_option backward.isDefEq.respectTransparency false in /-- The prime ideals in the localization of a commutative ring at a prime ideal I are in order-preserving bijection with the prime ideals contained in I. -/ @[simps!] @@ -355,7 +356,7 @@ variable {A B C : Type*} [CommRing A] [CommRing B] [CommRing C] [Algebra A B] [A /-- If `P` lies over `p`, then `Localization.AtPrime P` is an algebra over `Localization.AtPrime p`. This is not an instance for performance reasons and to avoid diamonds in the situation where the top ring is already an algebra over `Localization.AtPrime p` (e.g., this happens for `Ideal.Fiber`). -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def algebraOfLiesOver (p : Ideal A) [p.IsPrime] (P : Ideal B) [P.IsPrime] [P.LiesOver p] : Algebra (Localization.AtPrime p) (Localization.AtPrime P) := @@ -421,12 +422,14 @@ section variable (q : Ideal R) [q.IsPrime] (M : Submonoid R) {S : Type*} [CommSemiring S] [Algebra R S] [IsLocalization.AtPrime S q] +set_option backward.isDefEq.respectTransparency false in lemma Ideal.isPrime_map_of_isLocalizationAtPrime {p : Ideal R} [p.IsPrime] (hpq : p ≤ q) : (p.map (algebraMap R S)).IsPrime := by have disj : Disjoint (q.primeCompl : Set R) p := by simp [Ideal.primeCompl, ← le_compl_iff_disjoint_left, hpq] apply IsLocalization.isPrime_of_isPrime_disjoint q.primeCompl _ p (by simpa) disj +set_option backward.isDefEq.respectTransparency false in lemma Ideal.under_map_of_isLocalizationAtPrime {p : Ideal R} [p.IsPrime] (hpq : p ≤ q) : (p.map (algebraMap R S)).under R = p := by have disj : Disjoint (q.primeCompl : Set R) p := by @@ -560,6 +563,7 @@ theorem equivQuotMaximalIdeal_symm_apply_mk (x : R) (s : p.primeCompl) : mk'_spec, Ideal.Quotient.mk_algebraMap, equivQuotMaximalIdeal_apply_mk, Ideal.Quotient.mk_algebraMap] +set_option backward.isDefEq.respectTransparency.types false in /-- The isomorphism `R ⧸ p ^ n ≃ₐ[R] Rₚ ⧸ maximalIdeal Rₚ ^ n`, where `Rₚ` satisfies `IsLocalization.AtPrime Rₚ p`. -/ noncomputable @@ -585,6 +589,7 @@ theorem equivQuotMaximalIdealPow_apply_mk (n : ℕ) (x : R) : Ideal.Quotient.mk _ (algebraMap R Rₚ x) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem equivQuotMaximalIdealPow_symm_apply_mk_mul (n : ℕ) (x : R) (s : p.primeCompl) : (equivQuotMaximalIdealPow p Rₚ n).symm (Ideal.Quotient.mk _ (IsLocalization.mk' Rₚ x s)) * diff --git a/Mathlib/RingTheory/Localization/AtPrime/Extension.lean b/Mathlib/RingTheory/Localization/AtPrime/Extension.lean index e75652d57a4887..48f428a2150379 100644 --- a/Mathlib/RingTheory/Localization/AtPrime/Extension.lean +++ b/Mathlib/RingTheory/Localization/AtPrime/Extension.lean @@ -211,6 +211,7 @@ open IsLocalization AtPrime variable [IsDomain R] [IsDedekindDomain S] [IsTorsionFree R S] [Algebra R Sₚ] [IsScalarTower R S Sₚ] [IsScalarTower R Rₚ Sₚ] +set_option backward.isDefEq.respectTransparency.types false in /-- For `R ⊆ S` an extension of Dedekind domains and `p` a prime ideal of `R`, the bijection between the primes of `S` over `p` and the primes over the maximal ideal of `Rₚ` in `Sₚ` where diff --git a/Mathlib/RingTheory/Localization/Away/Basic.lean b/Mathlib/RingTheory/Localization/Away/Basic.lean index e6c6f68d598a64..a7450e4e8a6624 100644 --- a/Mathlib/RingTheory/Localization/Away/Basic.lean +++ b/Mathlib/RingTheory/Localization/Away/Basic.lean @@ -226,6 +226,7 @@ instance (x : R) [IsLocalization.Away (algebraMap R A x) Aₚ] : IsLocalization (Algebra.algebraMapSubmonoid A (.powers x)) Aₚ := by simpa +set_option backward.isDefEq.respectTransparency false in /-- Given an algebra map `f : A →ₐ[R] B` and an element `a : A`, we may construct a map `Aₐ →ₐ[R] Bₐ`. -/ noncomputable def mapₐ (f : A →ₐ[R] B) (a : A) [Away a Aₚ] [Away (f a) Bₚ] : Aₚ →ₐ[R] Bₚ := @@ -634,6 +635,7 @@ theorem selfZPow_of_nonpos {n : ℤ} (hn : n ≤ 0) : theorem selfZPow_neg_natCast (d : ℕ) : selfZPow x B (-d) = mk' _ (1 : R) (Submonoid.pow x d) := by simp [selfZPow_of_nonpos _ _ (neg_nonpos.mpr (Int.natCast_nonneg d))] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem selfZPow_sub_natCast {n m : ℕ} : selfZPow x B (n - m) = mk' _ (x ^ n) (Submonoid.pow x m) := by @@ -662,6 +664,7 @@ theorem selfZPow_add {n m : ℤ} : selfZPow x B (n + m) = selfZPow x B n * selfZ ext simp [pow_add] +set_option backward.isDefEq.respectTransparency false in theorem selfZPow_mul_neg (d : ℤ) : selfZPow x B d * selfZPow x B (-d) = 1 := by by_cases! hd : d ≤ 0 · rw [selfZPow_of_nonpos x B hd, selfZPow_of_nonneg, ← map_pow, Int.natAbs_neg, diff --git a/Mathlib/RingTheory/Localization/BaseChange.lean b/Mathlib/RingTheory/Localization/BaseChange.lean index 1ee7a99f5f08af..c1fd41023403ad 100644 --- a/Mathlib/RingTheory/Localization/BaseChange.lean +++ b/Mathlib/RingTheory/Localization/BaseChange.lean @@ -312,6 +312,7 @@ theorem tensorLeftAlgEquiv_apply_tmul_one (x : S) : tensorLeftAlgEquiv M S (x ⊗ₜ[R] 1) = algebraMap _ _ x := (tensorLeftAlgEquiv M S).commutes x +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem tensorLeftAlgEquiv_apply_one_tmul (x : Localization M) : tensorLeftAlgEquiv M S (1 ⊗ₜ[R] x) = algebraMap _ _ x := by diff --git a/Mathlib/RingTheory/Localization/Basic.lean b/Mathlib/RingTheory/Localization/Basic.lean index 7d43b276241bff..be819ed1e84371 100644 --- a/Mathlib/RingTheory/Localization/Basic.lean +++ b/Mathlib/RingTheory/Localization/Basic.lean @@ -130,6 +130,7 @@ section CompatibleSMul variable (N₁ N₂ : Type*) [AddCommMonoid N₁] [AddCommMonoid N₂] [Module R N₁] [Module R N₂] +set_option backward.isDefEq.respectTransparency false in variable (M S) in include M in theorem linearMap_compatibleSMul [Module S N₁] [Module S N₂] @@ -225,6 +226,7 @@ variable {A : Type*} [CommSemiring A] include H set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- If `S`, `Q` are localizations of `R` and `P` at submonoids `M`, `T` respectively, an isomorphism `h : R ≃ₐ[A] P` such that `h(M) = T` induces an isomorphism of localizations `S ≃ₐ[A] Q`. -/ @@ -241,10 +243,12 @@ theorem algEquivOfAlgEquiv_eq_map : map Q (h : R →+* P) (M.le_comap_of_map_le (le_of_eq H)) := rfl +set_option backward.isDefEq.respectTransparency false in theorem algEquivOfAlgEquiv_eq (x : R) : algEquivOfAlgEquiv S Q h H ((algebraMap R S) x) = algebraMap P Q (h x) := by simp +set_option backward.isDefEq.respectTransparency false in set_option linter.docPrime false in theorem algEquivOfAlgEquiv_mk' (x : R) (y : M) : algEquivOfAlgEquiv S Q h H (mk' S x y) = @@ -301,6 +305,7 @@ instance : IsLocalization (Algebra.algebraMapSubmonoid S (IsUnit.submonoid R)) S variable (R M) +set_option backward.isDefEq.respectTransparency false in /-- The localization at a module of units is isomorphic to the ring. -/ noncomputable def atUnits (H : M ≤ IsUnit.submonoid R) : R ≃ₐ[R] S := by refine AlgEquiv.ofBijective (Algebra.ofId R S) ⟨?_, ?_⟩ @@ -454,7 +459,7 @@ noncomputable def algEquiv : Localization M ≃ₐ[R] S := IsLocalization.algEquiv M _ _ /-- The localization of a singleton is a singleton. Cannot be an instance due to metavariables. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def _root_.IsLocalization.unique (R Rₘ) [CommSemiring R] [CommSemiring Rₘ] (M : Submonoid R) [Subsingleton R] [Algebra R Rₘ] [IsLocalization M Rₘ] : Unique Rₘ := have : Inhabited Rₘ := ⟨1⟩ @@ -525,7 +530,7 @@ This instance can be helpful if you define `Sₘ := Localization (Algebra.algebr however we will instead use the hypotheses `[Algebra Rₘ Sₘ] [IsScalarTower R Rₘ Sₘ]` in lemmas since the algebra structure may arise in different ways. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def localizationAlgebra : Algebra Rₘ Sₘ := (map Sₘ (algebraMap R S) (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map) : diff --git a/Mathlib/RingTheory/Localization/Defs.lean b/Mathlib/RingTheory/Localization/Defs.lean index 28b8aad18f29ca..d6da695251132c 100644 --- a/Mathlib/RingTheory/Localization/Defs.lean +++ b/Mathlib/RingTheory/Localization/Defs.lean @@ -313,7 +313,7 @@ theorem exists_mk'_eq (z : S) : ∃ (x : R) (y : M), mk' S x y = z := variable (S) in /-- The localization of a `Fintype` is a `Fintype`. Cannot be an instance. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintype' [Fintype R] : Fintype S := have := Classical.propDecidable .ofSurjective (Function.uncurry <| IsLocalization.mk' S) <| mk'_surjective M @@ -321,7 +321,7 @@ noncomputable def fintype' [Fintype R] : Fintype S := variable {M} /-- Localizing at a submonoid with 0 inside it leads to the trivial ring. -/ -@[implicit_reducible] +@[instance_reducible] def uniqueOfZeroMem (h : (0 : R) ∈ M) : Unique S := uniqueOfZeroEqOne <| by simpa using IsLocalization.map_units S ⟨0, h⟩ @@ -469,6 +469,7 @@ theorem mk'_add (x₁ x₂ : R) (y₁ y₂ : M) : simp only [map_add, Submonoid.coe_mul, map_mul] ring) +set_option backward.isDefEq.respectTransparency false in theorem mul_add_inv_left {g : R →+* P} (h : ∀ y : M, IsUnit (g y)) (y : M) (w z₁ z₂ : P) : w * ↑(IsUnit.liftRight (g.toMonoidHom.restrict M) h y)⁻¹ + z₁ = z₂ ↔ w + g y * z₁ = g y * z₂ := by @@ -666,6 +667,7 @@ section variable (S Q) +set_option backward.isDefEq.respectTransparency false in /-- If `S`, `Q` are localizations of `R` and `P` at submonoids `M, T` respectively, an isomorphism `j : R ≃+* P` such that `j(M) = T` induces an isomorphism of localizations `S ≃+* Q`. -/ diff --git a/Mathlib/RingTheory/Localization/Finiteness.lean b/Mathlib/RingTheory/Localization/Finiteness.lean index 47bb4f0edf9e92..789e01c7c2046c 100644 --- a/Mathlib/RingTheory/Localization/Finiteness.lean +++ b/Mathlib/RingTheory/Localization/Finiteness.lean @@ -45,6 +45,7 @@ variable {R S : Type*} [CommSemiring R] [CommSemiring S] (M : Submonoid R) (f : variable (R' S' : Type*) [CommSemiring R'] [CommSemiring S'] variable [Algebra R R'] [Algebra S S'] +set_option backward.isDefEq.respectTransparency false in open scoped Classical in /-- Let `S` be an `R`-algebra, `M` a submonoid of `R`, and `S' = M⁻¹S`. If the image of some `x : S` falls in the span of some finite `s ⊆ S'` over `R`, @@ -137,6 +138,7 @@ variable {M : Type w} [AddCommMonoid M] [Module R M] variable {Mₚ : Type t} [AddCommMonoid Mₚ] [Module R Mₚ] [Module Rₚ Mₚ] [IsScalarTower R Rₚ Mₚ] variable (f : M →ₗ[R] Mₚ) [IsLocalizedModule S f] +set_option backward.isDefEq.respectTransparency false in lemma of_isLocalization (R S) {Rₚ Sₚ : Type*} [CommSemiring R] [CommSemiring S] [CommSemiring Rₚ] [CommSemiring Sₚ] [Algebra R S] [Algebra R Rₚ] [Algebra R Sₚ] [Algebra S Sₚ] [Algebra Rₚ Sₚ] [IsScalarTower R S Sₚ] [IsScalarTower R Rₚ Sₚ] (M : Submonoid R) diff --git a/Mathlib/RingTheory/Localization/FractionRing.lean b/Mathlib/RingTheory/Localization/FractionRing.lean index 00659e147c0d83..2bb5de48588c0a 100644 --- a/Mathlib/RingTheory/Localization/FractionRing.lean +++ b/Mathlib/RingTheory/Localization/FractionRing.lean @@ -433,6 +433,7 @@ fraction rings `K ≃+* L`. -/ noncomputable def ringEquivOfRingEquiv : K ≃+* L := IsLocalization.ringEquivOfRingEquiv K L h (MulEquivClass.map_nonZeroDivisors h) +set_option backward.isDefEq.respectTransparency false in lemma ringEquivOfRingEquiv_algebraMap (a : A) : ringEquivOfRingEquiv h (algebraMap A K a) = algebraMap B L (h a) := by simp @@ -466,17 +467,21 @@ noncomputable def semilinearEquivOfRingEquiv : K ≃ₛₗ[(f : A →+* B)] L := { ringEquivOfRingEquiv f with map_smul' r x := by simp [Algebra.smul_def] } +set_option backward.isDefEq.respectTransparency.types false in lemma semilinearEquivOfRingEquiv_apply (x : K) : (semilinearEquivOfRingEquiv K L f) x = (ringEquivOfRingEquiv f) x := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma semilinearEquivOfRingEquiv_algebraMap (a : A) : semilinearEquivOfRingEquiv K L f (algebraMap A K a) = algebraMap B L (f a) := by simp [semilinearEquivOfRingEquiv, ringEquivOfRingEquiv] +set_option backward.isDefEq.respectTransparency.types false in lemma semilinearEquivOfRingEquiv_symm_apply (x : L) : (semilinearEquivOfRingEquiv K L f).symm x = (ringEquivOfRingEquiv f).symm x := rfl +set_option backward.isDefEq.respectTransparency.types false in lemma semilinearEquivOfRingEquiv_comp {C : Type*} (M : Type*) [CommRing C] [CommRing M] [Algebra C M] [IsFractionRing C M] (g : B ≃+* C) : let : RingHomCompTriple f (g : B →+* C) (f.trans g : A →+* C) := ⟨rfl⟩ @@ -504,6 +509,7 @@ fraction rings `K ≃ₐ[R] L`. -/ noncomputable def algEquivOfAlgEquiv : K ≃ₐ[R] L := IsLocalization.algEquivOfAlgEquiv K L h (MulEquivClass.map_nonZeroDivisors h) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma algEquivOfAlgEquiv_algebraMap (a : A) : algEquivOfAlgEquiv h (algebraMap A K a) = algebraMap B L (h a) := by @@ -623,7 +629,7 @@ variable (G A B K L : Type*) [Group G] [CommRing A] [CommRing B] [MulSemiringAct /-- Given a `MulSemiringAction G B`, extend the action of `G` on `B` to a `MulSemiringAction G L` on the fraction field `L` of `B`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def mulSemiringAction [SMulCommClass G A B] : MulSemiringAction G L := MulSemiringAction.compHom L diff --git a/Mathlib/RingTheory/Localization/Ideal.lean b/Mathlib/RingTheory/Localization/Ideal.lean index f2cb0211365cf5..00eff5954da292 100644 --- a/Mathlib/RingTheory/Localization/Ideal.lean +++ b/Mathlib/RingTheory/Localization/Ideal.lean @@ -102,6 +102,7 @@ lemma map_algebraMap_ne_top_iff_disjoint (I : Ideal R) : IsLocalization.algebraMap_mem_map_algebraMap_iff M] simp [Set.disjoint_left] +set_option backward.isDefEq.respectTransparency false in include M in protected theorem map_inf (I J : Ideal R) : (I ⊓ J).map (algebraMap R S) = I.map (algebraMap R S) ⊓ J.map (algebraMap R S) := by @@ -352,6 +353,7 @@ theorem bot_lt_under_prime [IsDomain R] (hM : M ≤ R⁰) (p : Ideal S) [hpp : p @[deprecated (since := "2026-04-09")] alias bot_lt_comap_prime := bot_lt_under_prime +set_option backward.isDefEq.respectTransparency false in variable (R) in lemma _root_.Module.IsTorsionFree.of_isLocalization [IsDomain R] [IsDomain S] {Rₚ Sₚ : Type*} [CommRing Rₚ] [IsDomain Rₚ] [CommRing Sₚ] [Algebra R Rₚ] [Algebra R Sₚ] [Algebra S Sₚ] diff --git a/Mathlib/RingTheory/Localization/Integral.lean b/Mathlib/RingTheory/Localization/Integral.lean index aad25a3fd1a2d0..a5af0fb2eb3024 100644 --- a/Mathlib/RingTheory/Localization/Integral.lean +++ b/Mathlib/RingTheory/Localization/Integral.lean @@ -36,6 +36,7 @@ open Polynomial variable [IsLocalization M S] +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] Polynomial.algebra Polynomial.isLocalization in private theorem exists_integer_polynomial_multiple_and_support_subset (p : S[X]) : ∃ b ∈ M, ∃ (q : R[X]), q.map (algebraMap R S) = b • p ∧ q.support ⊆ p.support := by @@ -315,6 +316,7 @@ lemma IsLocalization.Away.exists_isIntegral_mul_of_isIntegral_mk' convert! (hr.pow n).algebraMap.mul hx exact (mk'_spec'_mk ..).symm +set_option backward.isDefEq.respectTransparency.types false in /-- If `t` is integral over `R[1/t]`, then it is integral over `R`. -/ lemma isIntegral_of_isIntegral_adjoin_of_mul_eq_one (t s : S) (hst : s * t = 1) (ht : IsIntegral (Algebra.adjoin R {s}) t) : diff --git a/Mathlib/RingTheory/Localization/LocalizationLocalization.lean b/Mathlib/RingTheory/Localization/LocalizationLocalization.lean index fb4c01dd8d196d..a2708fcefcbe38 100644 --- a/Mathlib/RingTheory/Localization/LocalizationLocalization.lean +++ b/Mathlib/RingTheory/Localization/LocalizationLocalization.lean @@ -256,6 +256,7 @@ variable {R : Type*} [CommRing R] (M : Submonoid R) open IsLocalization +set_option backward.isDefEq.respectTransparency false in theorem isFractionRing_of_isLocalization (S T : Type*) [CommRing S] [CommRing T] [Algebra R S] [Algebra R T] [Algebra S T] [IsScalarTower R S T] [IsLocalization M S] [IsFractionRing R T] (hM : M ≤ nonZeroDivisors R) : IsFractionRing S T := by diff --git a/Mathlib/RingTheory/Localization/Module.lean b/Mathlib/RingTheory/Localization/Module.lean index 5dec9b809fa35c..05e0c8bd548057 100644 --- a/Mathlib/RingTheory/Localization/Module.lean +++ b/Mathlib/RingTheory/Localization/Module.lean @@ -53,6 +53,7 @@ theorem span_eq_top_of_isLocalizedModule {v : Set M} (hv : span R v = ⊤) : rw [← LinearMap.coe_restrictScalars R, ← LinearMap.map_span, hv] exact mem_map_of_mem mem_top +set_option backward.isDefEq.respectTransparency false in theorem LinearIndependent.of_isLocalizedModule {ι : Type*} {v : ι → M} (hv : LinearIndependent R v) : LinearIndependent Rₛ (f ∘ v) := by rw [linearIndependent_iff'ₛ] at hv ⊢ @@ -71,6 +72,7 @@ theorem LinearIndependent.of_isLocalizedModule {ι : Type*} {v : ι → M} simpa only [map_mul, (IsLocalization.map_units Rₛ s).mul_right_inj, hfg.1 ⟨i, hi⟩, hfg.2 ⟨i, hi⟩, Algebra.smul_def, (IsLocalization.map_units Rₛ a).mul_right_inj] using this +set_option backward.isDefEq.respectTransparency false in theorem LinearIndependent.of_isLocalizedModule_of_isRegular {ι : Type*} {v : ι → M} (hv : LinearIndependent R v) (h : ∀ s : S, IsRegular (s : R)) : LinearIndependent R (f ∘ v) := hv.map_injOn _ <| by @@ -87,6 +89,7 @@ theorem LinearIndependent.localization [Module Rₛ M] [IsScalarTower R Rₛ M] have := isLocalizedModule_id S M Rₛ exact hli.of_isLocalizedModule Rₛ S .id +set_option backward.isDefEq.respectTransparency false in include f in lemma IsLocalizedModule.linearIndependent_lift {ι} {v : ι → Mₛ} (hf : LinearIndependent R v) : ∃ w : ι → M, LinearIndependent R w := by diff --git a/Mathlib/RingTheory/Multiplicity.lean b/Mathlib/RingTheory/Multiplicity.lean index 759bfd0a7f511b..c62b9028dd298c 100644 --- a/Mathlib/RingTheory/Multiplicity.lean +++ b/Mathlib/RingTheory/Multiplicity.lean @@ -35,6 +35,10 @@ variable {α β : Type*} open Nat +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + ENat + /-- `FiniteMultiplicity a b` indicates that the multiplicity of `a` in `b` is finite. -/ abbrev FiniteMultiplicity [Monoid α] (a b : α) : Prop := ∃ n : ℕ, ¬a ^ (n + 1) ∣ b @@ -89,6 +93,7 @@ theorem FiniteMultiplicity.emultiplicity_eq_iff_multiplicity_eq {n : ℕ} (h : FiniteMultiplicity a b) : emultiplicity a b = n ↔ multiplicity a b = n := by simp [h.emultiplicity_eq_multiplicity] +set_option backward.isDefEq.respectTransparency false in theorem emultiplicity_eq_iff_multiplicity_eq_of_ne_one {n : ℕ} (h : n ≠ 1) : emultiplicity a b = n ↔ multiplicity a b = n := by constructor diff --git a/Mathlib/RingTheory/MvPolynomial/Expand.lean b/Mathlib/RingTheory/MvPolynomial/Expand.lean index e18a24c63620c7..e798dea0ddb0f3 100644 --- a/Mathlib/RingTheory/MvPolynomial/Expand.lean +++ b/Mathlib/RingTheory/MvPolynomial/Expand.lean @@ -22,6 +22,7 @@ namespace MvPolynomial variable {σ R : Type*} [CommSemiring R] (p : ℕ) [ExpChar R p] +set_option backward.isDefEq.respectTransparency.types false in theorem map_frobenius_expand {f : MvPolynomial σ R} : (f.expand p).map (frobenius R p) = f ^ p := f.induction_on' fun _ _ => by simp [monomial_pow, frobenius] diff --git a/Mathlib/RingTheory/MvPolynomial/Ideal.lean b/Mathlib/RingTheory/MvPolynomial/Ideal.lean index 48aec1bdae1c52..bffda987986bcb 100644 --- a/Mathlib/RingTheory/MvPolynomial/Ideal.lean +++ b/Mathlib/RingTheory/MvPolynomial/Ideal.lean @@ -71,6 +71,7 @@ variable (σ R) in lemma idealOfVars_fg [Finite σ] : (idealOfVars σ R).FG := Submodule.fg_span <| Set.finite_range _ +set_option backward.isDefEq.respectTransparency.types false in lemma idealOfVars_eq_restrictSupportIdeal : idealOfVars σ R = restrictSupportIdeal _ _ ((isUpperSet_Ici 1).preimage degree_mono) := by apply le_antisymm @@ -100,6 +101,7 @@ theorem pow_idealOfVars_eq_span (n) : idealOfVars σ R ^ n = image_pow_eq_finsuppProd_image] simp [monomial_eq, Set.preimage, degree] +set_option backward.isDefEq.respectTransparency.types false in theorem mem_pow_idealOfVars_iff (n : ℕ) (p : MvPolynomial σ R) : p ∈ idealOfVars σ R ^ n ↔ ∀ x ∈ p.support, n ≤ degree x := by rw [pow_idealOfVars] @@ -130,6 +132,7 @@ theorem mkₐ_eq_aeval : ext d simp +set_option backward.isDefEq.respectTransparency.types false in theorem mk_eq_eval₂ : (Ideal.Quotient.mk I).toFun = eval₂ (algebraMap A (MvPolynomial σ A ⧸ I)) fun d : σ => Ideal.Quotient.mk I (X d) := by ext d diff --git a/Mathlib/RingTheory/MvPolynomial/IrreducibleQuadratic.lean b/Mathlib/RingTheory/MvPolynomial/IrreducibleQuadratic.lean index 36ea631d502666..d44ad62eeb645b 100644 --- a/Mathlib/RingTheory/MvPolynomial/IrreducibleQuadratic.lean +++ b/Mathlib/RingTheory/MvPolynomial/IrreducibleQuadratic.lean @@ -202,6 +202,7 @@ noncomputable def sumSMulXSMulY : variable (c : n →₀ R) +set_option backward.isDefEq.respectTransparency.types false in theorem irreducible_sumSMulXSMulY [IsDomain R] (hc : c.support.Nontrivial) (h_dvd : ∀ r, (∀ i, r ∣ c i) → IsUnit r) : diff --git a/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean b/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean index a9d86dd1f031cb..b5d8e364411acf 100644 --- a/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean +++ b/Mathlib/RingTheory/MvPolynomial/Symmetric/Defs.lean @@ -173,6 +173,7 @@ end CommRing end IsSymmetric +set_option backward.isDefEq.respectTransparency false in /-- `MvPolynomial.rename` induces an isomorphism between the symmetric subalgebras. -/ @[simps!] def renameSymmetricSubalgebra [CommSemiring R] (e : σ ≃ τ) : diff --git a/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean b/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean index a20511d3dcb445..4a9bd60e9f24b3 100644 --- a/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean +++ b/Mathlib/RingTheory/MvPolynomial/Symmetric/FundamentalTheorem.lean @@ -341,6 +341,7 @@ noncomputable def esymmAlgEquiv (hn : Fintype.card σ = n) : AlgEquiv.ofBijective (esymmAlgHom σ R n) ⟨esymmAlgHom_injective R hn.ge, esymmAlgHom_surjective R hn.le⟩ +set_option backward.isDefEq.respectTransparency false in lemma esymmAlgEquiv_symm_apply (hn : Fintype.card σ = n) (i : Fin n) : (esymmAlgEquiv σ R hn).symm ⟨esymm σ R (i + 1), esymm_isSymmetric σ R _⟩ = X i := by apply_fun esymmAlgHom σ R n using esymmAlgHom_injective R hn.ge diff --git a/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean b/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean index 7f6d951a470c7c..72e045dbcdd960 100644 --- a/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean +++ b/Mathlib/RingTheory/MvPolynomial/Symmetric/NewtonIdentities.lean @@ -161,11 +161,13 @@ private theorem sum_filter_pairs_eq_sum_powersetCard_mem_filter_antidiagonal_sum have : #p.fst ≤ k := by apply le_of_lt; simp_all aesop +set_option backward.isDefEq.respectTransparency false in private lemma filter_pairs_lt (k : ℕ) : (pairs σ k).filter (fun (s, _) ↦ #s < k) = (range k).disjiUnion (powersetCard · univ) ((pairwise_disjoint_powersetCard _).set_pairwise _) ×ˢ univ := by ext; aesop (add unsafe le_of_lt) +set_option backward.isDefEq.respectTransparency false in private theorem sum_filter_pairs_eq_sum_filter_antidiagonal_powersetCard_sum (k : ℕ) (f : Finset σ × σ → MvPolynomial σ R) : ∑ t ∈ pairs σ k with #t.1 < k, f t = diff --git a/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean b/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean index d7342312ee467e..b47723401c601d 100644 --- a/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean +++ b/Mathlib/RingTheory/MvPolynomial/WeightedHomogeneous.lean @@ -407,6 +407,7 @@ theorem weightedHomogeneousComponent_finsupp : variable (w) +set_option backward.isDefEq.respectTransparency.types false in /-- Every polynomial is the sum of its weighted homogeneous components. -/ theorem sum_weightedHomogeneousComponent : (finsum fun m => weightedHomogeneousComponent w m φ) = φ := by @@ -493,6 +494,7 @@ theorem DirectSum.coeAddMonoidHom_eq_support_sum [DecidableEq σ] [DecidableEq R DFinsupp.sum x (fun _ x => ↑x) := DirectSum.coeLinearMap_eq_dfinsuppSum R w x +set_option backward.isDefEq.respectTransparency false in theorem DirectSum.coeLinearMap_eq_finsum [DecidableEq M] (x : DirectSum M fun i : M => ↥(weightedHomogeneousSubmodule R w i)) : (DirectSum.coeLinearMap fun i : M => weightedHomogeneousSubmodule R w i) x = @@ -501,6 +503,7 @@ theorem DirectSum.coeLinearMap_eq_finsum [DecidableEq M] rw [DirectSum.coeLinearMap_eq_dfinsuppSum, DFinsupp.sum, finsum_eq_sum_of_support_subset] apply DirectSum.support_subset +set_option backward.isDefEq.respectTransparency false in theorem weightedHomogeneousComponent_directSum [DecidableEq M] (x : DirectSum M fun i : M => ↥(weightedHomogeneousSubmodule R w i)) (m : M) : (weightedHomogeneousComponent w m) @@ -626,9 +629,10 @@ theorem decompose'_apply [DecidableEq M] (φ : MvPolynomial σ R) (m : M) : · rw [DirectSum.mk_apply_of_notMem hm, Submodule.coe_zero, weightedHomogeneousComponent_eq_zero_of_notMem w φ m hm] +set_option backward.isDefEq.respectTransparency false in /-- Given a weight `w`, the decomposition of `MvPolynomial σ R` into weighted homogeneous submodules -/ -@[implicit_reducible] +@[instance_reducible] def weightedDecomposition [DecidableEq M] : DirectSum.Decomposition (weightedHomogeneousSubmodule R w) where decompose' := decompose' R w @@ -654,18 +658,20 @@ def weightedDecomposition [DecidableEq M] : set_option linter.style.whitespace false in -- manual alignment is not recognised /-- Given a weight, `MvPolynomial` as a graded algebra -/ -@[implicit_reducible] +@[instance_reducible] def weightedGradedAlgebra [DecidableEq M] : GradedAlgebra (weightedHomogeneousSubmodule R w) where toDecomposition := weightedDecomposition R w toGradedMonoid := WeightedHomogeneousSubmodule.gradedMonoid +set_option backward.isDefEq.respectTransparency.types false in theorem weightedDecomposition.decompose'_eq [DecidableEq M] : (weightedDecomposition R w).decompose' = fun φ : MvPolynomial σ R => DirectSum.mk (fun i : M => ↥(weightedHomogeneousSubmodule R w i)) (Finset.image (weight w) φ.support) fun m => ⟨weightedHomogeneousComponent w m φ, weightedHomogeneousComponent_mem w φ m⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem weightedDecomposition.decompose'_apply [DecidableEq M] (φ : MvPolynomial σ R) (m : M) : ((weightedDecomposition R w).decompose' φ m : MvPolynomial σ R) = diff --git a/Mathlib/RingTheory/MvPowerSeries/Basic.lean b/Mathlib/RingTheory/MvPowerSeries/Basic.lean index 741d71157d56c1..e36fc82c59fcc3 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Basic.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Basic.lean @@ -499,6 +499,7 @@ section Map variable {S T : Type*} [Semiring R] [Semiring S] [Semiring T] variable (f : R →+* S) (g : S →+* T) +set_option backward.isDefEq.respectTransparency false in /-- The map between multivariate formal power series induced by a map on the coefficients. -/ def map : MvPowerSeries σ R →+* MvPowerSeries σ S where toFun φ n := f <| coeff n φ @@ -590,6 +591,7 @@ section Semiring variable [Semiring R] +set_option backward.isDefEq.respectTransparency false in theorem X_pow_dvd_iff {s : σ} {n : ℕ} {φ : MvPowerSeries σ R} : (X s : MvPowerSeries σ R) ^ n ∣ φ ↔ ∀ m : σ →₀ ℕ, m s < n → coeff m φ = 0 := by classical @@ -659,6 +661,7 @@ open Finset.HasAntidiagonal Finset variable {R : Type*} [CommSemiring R] {ι : Type*} +set_option backward.isDefEq.respectTransparency false in /-- Coefficients of a product of power series -/ theorem coeff_prod [DecidableEq ι] [DecidableEq σ] (f : ι → MvPowerSeries σ R) (d : σ →₀ ℕ) (s : Finset ι) : diff --git a/Mathlib/RingTheory/MvPowerSeries/Equiv.lean b/Mathlib/RingTheory/MvPowerSeries/Equiv.lean index 4dc31fa468316c..1f51936fe63f60 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Equiv.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Equiv.lean @@ -99,6 +99,7 @@ theorem coeff_toAdicCompletion_val_apply_out {x : σ →₀ ℕ} {p : MvPowerSer Ideal.Quotient.mk_out] exact hx +set_option backward.isDefEq.respectTransparency.types false in theorem toAdicCompletion_coe (p : MvPolynomial σ R) : toAdicCompletion σ R p = .of (MvPolynomial.idealOfVars σ R) (MvPolynomial σ R) p := by symm; ext n diff --git a/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean b/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean index e8d9e970f0c47b..c694da931a1948 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Evaluation.lean @@ -113,6 +113,7 @@ def hasEvalIdeal : Ideal (σ → S) where zero_mem' := HasEval.zero smul_mem' := HasEval.mul_left +set_option backward.isDefEq.respectTransparency false in theorem mem_hasEvalIdeal_iff {a : σ → S} : a ∈ hasEvalIdeal ↔ HasEval a := by simp [hasEvalIdeal] diff --git a/Mathlib/RingTheory/MvPowerSeries/Expand.lean b/Mathlib/RingTheory/MvPowerSeries/Expand.lean index 7a2504c80c23c3..84e763bb9d7029 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Expand.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Expand.lean @@ -136,6 +136,7 @@ theorem coeff_expand_of_not_dvd (φ : MvPowerSeries σ R) {m : σ →₀ ℕ} {i contradiction simp [meq] +set_option backward.isDefEq.respectTransparency.types false in theorem support_expand_subset (φ : MvPowerSeries σ R) : (expand p hp φ).support ⊆ φ.support.image (p • ·) := by intro d hd @@ -146,6 +147,7 @@ theorem support_expand_subset (φ : MvPowerSeries σ R) : coeff_apply] at hd exact ⟨m, hd, eq_aux⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem support_expand (φ : MvPowerSeries σ R) : (expand p hp φ).support = φ.support.image (p • ·) := by classical diff --git a/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean b/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean index 98896a9b9f6ff1..a8c55056895205 100644 --- a/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean +++ b/Mathlib/RingTheory/MvPowerSeries/LexOrder.lean @@ -78,7 +78,7 @@ theorem coeff_ne_zero_of_lexOrder {φ : MvPowerSeries σ R} {d : σ →₀ ℕ} rcases hφ' with ⟨ne, hφ'⟩ simp only [← h, WithTop.coe_eq_coe] at hφ' suffices toLex d ∈ toLex '' φ.support by - simp only [Set.mem_image_equiv, toLex_symm_eq, ofLex_toLex, Function.mem_support, ne_eq] at this + simp only [Set.mem_image_equiv, toLex_symm_eq, ofLex_toLex] at this apply this rw [hφ'] apply WellFounded.min_mem diff --git a/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean b/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean index b74e68083b7fd5..707c529e2b51c7 100644 --- a/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean +++ b/Mathlib/RingTheory/MvPowerSeries/LinearTopology.lean @@ -71,6 +71,7 @@ noncomputable def basis (σ : Type*) (R : Type*) [Ring R] (Jd : TwoSidedIdeal R variable {σ : Type*} {R : Type*} [Ring R] +set_option backward.isDefEq.respectTransparency false in /-- A power series `f` belongs to the two-sided ideal `basis σ R ⟨J, d⟩` if and only if `coeff e f ∈ J` for all `e ≤ d`. -/ theorem mem_basis_iff {f : MvPowerSeries σ R} {Jd : TwoSidedIdeal R × (σ →₀ ℕ)} : @@ -83,6 +84,7 @@ theorem basis_le {Jd Ke : TwoSidedIdeal R × (σ →₀ ℕ)} (hJK : Jd.1 ≤ Ke basis σ R Jd ≤ basis σ R Ke := fun _ ↦ forall_imp (fun _ h hue ↦ hJK (h (le_trans hue hed))) +set_option backward.isDefEq.respectTransparency false in /-- `basis σ R ⟨J, d⟩ ≤ basis σ R ⟨K, e⟩` if and only if `J ≤ K` and `e ≤ d`. -/ theorem basis_le_iff {J K : TwoSidedIdeal R} {d e : σ →₀ ℕ} (hK : K ≠ ⊤) : basis σ R ⟨J, d⟩ ≤ basis σ R ⟨K, e⟩ ↔ J ≤ K ∧ e ≤ d := by diff --git a/Mathlib/RingTheory/MvPowerSeries/Order.lean b/Mathlib/RingTheory/MvPowerSeries/Order.lean index bf7d747a7d0cea..9e2f8dabeae3bb 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Order.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Order.lean @@ -585,6 +585,7 @@ protected theorem IsWeightedHomogeneous.mul {f g : MvPowerSeries σ R} {p q : apply hd rw [← hx, map_add, hp, hq] +set_option backward.isDefEq.respectTransparency false in /-- The weighted homogeneous components of an `MvPowerSeries f`. -/ def weightedHomogeneousComponent (p : ℕ) : MvPowerSeries σ R →ₗ[R] MvPowerSeries σ R where toFun f d := if weight w d = p then coeff d f else 0 diff --git a/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean b/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean index 2d3a9e51657f79..06b2b400a9a2f6 100644 --- a/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean +++ b/Mathlib/RingTheory/MvPowerSeries/PiTopology.lean @@ -199,7 +199,7 @@ instance {S : Type*} [Semiring S] [TopologicalSpace S] theorem variables_tendsto_zero [Semiring R] : Tendsto (X · : σ → MvPowerSeries σ R) cofinite (nhds 0) := by classical - simp only [tendsto_iff_coeff_tendsto, ← coeff_apply, coeff_X, coeff_zero] + simp only [tendsto_iff_coeff_tendsto, coeff_X, coeff_zero] refine fun d ↦ tendsto_nhds_of_eventually_eq ?_ by_cases! h : ∃ i, d = Finsupp.single i 1 · obtain ⟨i, hi⟩ := h diff --git a/Mathlib/RingTheory/MvPowerSeries/Rename.lean b/Mathlib/RingTheory/MvPowerSeries/Rename.lean index ee1992eff03832..7b7d55d1ad8043 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Rename.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Rename.lean @@ -296,6 +296,7 @@ lemma HasSubst.X_comp : HasSubst (X ∘ f : σ → MvPowerSeries τ R) where (fun i _ ↦ TendstoCofinite.finite_preimage_singleton f i)) (fun x => by contrapose; intro _ _; classical simp_all [coeff_X]) +set_option backward.isDefEq.respectTransparency.types false in theorem rename_eq_subst : rename f p = p.subst (X ∘ f) := by classical ext n diff --git a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean index bf4f5df74bd434..15575ad319df0a 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean @@ -463,7 +463,8 @@ theorem le_weightedOrder_subst (ha : HasSubst a) (f : MvPowerSeries σ R) : by_cases hfx : f.coeff x = 0 · simp [hfx] rw [coeff_eq_zero_of_lt_weightedOrder w, smul_zero] - refine hd.trans_le (((biInf_le _ hfx).trans ?_).trans (le_weightedOrder_prod ..)) + refine hd.trans_le (((biInf_le ⇑(Finsupp.weight (weightedOrder w ∘ a)) + (s := fun d => (coeff d) f = 0 → False) hfx).trans ?_).trans (le_weightedOrder_prod ..)) simp only [Finsupp.weight_apply, Finsupp.sum, Function.comp_apply] exact Finset.sum_le_sum fun i hi ↦ .trans (by simp) (le_weightedOrder_pow ..) @@ -475,6 +476,7 @@ theorem le_weightedOrder_subst_of_forall_ne_zero refine fun i hi ↦ (weightedOrder_le _ hi).trans ?_ simp [Finsupp.weight_apply, Finsupp.sum, (ne_zero_iff_weightedOrder_finite _).mp (ha0 _)] +set_option backward.isDefEq.respectTransparency.types false in theorem le_order_subst (ha : HasSubst a) (f : MvPowerSeries σ R) : (⨅ i, (a i).order) * f.order ≤ (f.subst a).order := by refine .trans ?_ (MvPowerSeries.le_weightedOrder_subst _ ha _) @@ -498,6 +500,7 @@ variable {R : Type*} [CommSemiring R] -- To match the `PowerSeries.rescale` API which holds for `CommSemiring`, -- we redo it by hand. +set_option backward.isDefEq.respectTransparency.types false in /-- The ring homomorphism taking a multivariate power series `f(X)` to `f(aX)`. -/ noncomputable def rescale (a : σ → R) : MvPowerSeries σ R →+* MvPowerSeries σ R where toFun f := fun n ↦ (n.prod fun s m ↦ a s ^ m) * f.coeff n @@ -537,11 +540,13 @@ noncomputable def rescale (a : σ → R) : MvPowerSeries σ R →+* MvPowerSerie simp [pow_add] all_goals {simp} +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem coeff_rescale (f : MvPowerSeries σ R) (a : σ → R) (n : σ →₀ ℕ) : coeff n (rescale a f) = (n.prod fun s m ↦ a s ^ m) * f.coeff n := by simp [rescale, coeff_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem rescale_zero : (rescale 0 : MvPowerSeries σ R →+* MvPowerSeries σ R) = C.comp constantCoeff := by @@ -576,6 +581,7 @@ theorem rescale_mul (a b : σ → R) : rescale (a * b) = (rescale b).comp (resca ext simp [← rescale_rescale] +set_option backward.isDefEq.respectTransparency.types false in /-- Rescaling a homogeneous power series -/ lemma rescale_homogeneous_eq_smul {n : ℕ} {r : R} {f : MvPowerSeries σ R} (hf : ∀ d ∈ f.support, d.degree = n) : diff --git a/Mathlib/RingTheory/MvPowerSeries/Trunc.lean b/Mathlib/RingTheory/MvPowerSeries/Trunc.lean index 049b89bdfae3da..5375f0936b6228 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Trunc.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Trunc.lean @@ -311,6 +311,7 @@ theorem totalDegree_truncTotal_lt (p : MvPowerSeries σ R) (h : n ≠ 0) : apply (totalDegree_truncFinset p).trans_lt simp [Finset.sup_lt_iff (Nat.lt_of_sub_ne_zero h)] +set_option backward.isDefEq.respectTransparency.types false in theorem truncTotal_coe_eq_self_iff (p : MvPolynomial σ R) (h : n ≠ 0) : truncTotal n p = p ↔ p.totalDegree < n := by rw [truncTotal, truncFinset_coe_eq_self_iff, Set.Finite.subset_toFinset, diff --git a/Mathlib/RingTheory/Nilpotent/Lemmas.lean b/Mathlib/RingTheory/Nilpotent/Lemmas.lean index e5ab03ccb8e511..4cc84dda0850e5 100644 --- a/Mathlib/RingTheory/Nilpotent/Lemmas.lean +++ b/Mathlib/RingTheory/Nilpotent/Lemmas.lean @@ -113,6 +113,7 @@ section variable {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] +set_option backward.isDefEq.respectTransparency false in lemma isNilpotent_restrict_of_le {f : End R M} {p q : Submodule R M} {hp : MapsTo f p p} {hq : MapsTo f q q} (h : p ≤ q) (hf : IsNilpotent (f.restrict hq)) : IsNilpotent (f.restrict hp) := by @@ -125,6 +126,7 @@ lemma isNilpotent_restrict_of_le {f : End R M} {p q : Submodule R M} ext exact (congr_arg Subtype.val hn :) +set_option backward.isDefEq.respectTransparency false in lemma isNilpotent.restrict {f : M →ₗ[R] M} {p : Submodule R M} (hf : MapsTo f p p) (hnil : IsNilpotent f) : IsNilpotent (f.restrict hf) := by diff --git a/Mathlib/RingTheory/OrderOfVanishing/Basic.lean b/Mathlib/RingTheory/OrderOfVanishing/Basic.lean index ed3c503e6e705a..17545781e035cd 100644 --- a/Mathlib/RingTheory/OrderOfVanishing/Basic.lean +++ b/Mathlib/RingTheory/OrderOfVanishing/Basic.lean @@ -83,6 +83,7 @@ lemma Ideal.quotOfMul_surjective {a : R} (I : Ideal R) : exact Submodule.factor_surjective <| Submodule.singleton_set_smul I a ▸ Submodule.smul_le_span {a} I +set_option backward.isDefEq.respectTransparency.types false in /-- The sequence `R ⧸ I →ₗ[R] R ⧸ (a • I) →ₗ[R] R ⧸ (Ideal.span {a})` given by multiplication by `a` then quotienting by the ideal generated by `a` is exact. diff --git a/Mathlib/RingTheory/OreLocalization/OreSet.lean b/Mathlib/RingTheory/OreLocalization/OreSet.lean index ab74b4f90def7a..ee5370dc069b2f 100644 --- a/Mathlib/RingTheory/OreLocalization/OreSet.lean +++ b/Mathlib/RingTheory/OreLocalization/OreSet.lean @@ -29,7 +29,7 @@ namespace OreLocalization /-- Cancellability in monoids with zeros can act as a replacement for the `ore_right_cancel` condition of an ore set. -/ -@[implicit_reducible] +@[instance_reducible] def oreSetOfIsCancelMulZero {R : Type*} [MonoidWithZero R] [IsCancelMulZero R] {S : Submonoid R} (oreNum : R → S → R) (oreDenom : R → S → S) (ore_eq : ∀ (r : R) (s : S), oreDenom r s * r = oreNum r s * s) : OreSet S := @@ -42,7 +42,7 @@ def oreSetOfIsCancelMulZero {R : Type*} [MonoidWithZero R] [IsCancelMulZero R] /-- In rings without zero divisors, the first (cancellability) condition is always fulfilled, it suffices to give a proof for the Ore condition itself. -/ -@[implicit_reducible] +@[instance_reducible] def oreSetOfNoZeroDivisors {R : Type*} [Ring R] [NoZeroDivisors R] {S : Submonoid R} (oreNum : R → S → R) (oreDenom : R → S → S) (ore_eq : ∀ (r : R) (s : S), oreDenom r s * r = oreNum r s * s) : OreSet S := diff --git a/Mathlib/RingTheory/Perfection.lean b/Mathlib/RingTheory/Perfection.lean index fa2befaf444f2b..72f17af5604e90 100644 --- a/Mathlib/RingTheory/Perfection.lean +++ b/Mathlib/RingTheory/Perfection.lean @@ -149,6 +149,7 @@ theorem coeffMonoidHom_iterate_powMonoidHom' (f : Perfection M p) (n m : ℕ) (h coeffMonoidHom M p n ((powMonoidHom p)^[m] f) = coeffMonoidHom M p (n - m) f := by rw [← coeffMonoidHom_iterate_powMonoidHom f (n - m) m, Nat.sub_add_cancel hmn] +set_option backward.isDefEq.respectTransparency.types false in /-- Given monoids `M` and `N`, with `M` being perfect, any homomorphism `M →+* N` can be lifted uniquely to a homomorphism `M →* Perfection N p`. -/ @[simps! symm_apply] @@ -169,10 +170,12 @@ noncomputable def liftMonoidHom (p : ℕ) (M : Type*) [CommMonoid M] [PerfectRin rw [← coeffMonoidHom_pow_p_pow _ 0 n, ← map_pow, powMulEquiv_symm_pow_p, zero_add] map_mul' _ _ := by ext; simp +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma coeffMonoidHom_zero_liftMonoidHom (p : ℕ) {M N : Type*} [CommMonoid M] [PerfectRing M p] [CommMonoid N] (e : M →* N) (x : M) : coeffMonoidHom N p 0 (liftMonoidHom p M N e x) = e x := by simp [liftMonoidHom] +set_option backward.isDefEq.respectTransparency.types false in /-- A monoid homomorphism `M →* N` induces `Perfection M p →* Perfection N p`. -/ def mapMonoidHom (p : ℕ) {M N : Type*} [CommMonoid M] [CommMonoid N] (φ : M →* N) : Perfection M p →* Perfection N p where diff --git a/Mathlib/RingTheory/PiTensorProduct.lean b/Mathlib/RingTheory/PiTensorProduct.lean index 2543913444a0a1..3bcce74f217175 100644 --- a/Mathlib/RingTheory/PiTensorProduct.lean +++ b/Mathlib/RingTheory/PiTensorProduct.lean @@ -76,6 +76,7 @@ nonrec theorem _root_.Commute.tprod {a₁ a₂ : Π i, A i} (ha : Commute a₁ a Commute (tprod R a₁) (tprod R a₂) := ha.tprod +set_option backward.isDefEq.respectTransparency false in lemma smul_tprod_mul_smul_tprod (r s : R) (x y : Π i, A i) : (r • tprod R x) * (s • tprod R y) = (r * s) • tprod R (x * y) := by simp only [mul_def, map_smul, LinearMap.smul_apply, mul_tprod_tprod, mul_comm r s, mul_smul] diff --git a/Mathlib/RingTheory/PicardGroup.lean b/Mathlib/RingTheory/PicardGroup.lean index 18e73581861f4b..250c7f69d54c8b 100644 --- a/Mathlib/RingTheory/PicardGroup.lean +++ b/Mathlib/RingTheory/PicardGroup.lean @@ -115,6 +115,7 @@ noncomputable def rTensorInv : (P ⊗[R] M →ₗ[R] Q ⊗[R] M) →ₗ[R] (P ((rightCancelEquiv Q e).congrRight ≪≫ₗ (rightCancelEquiv P e).congrLeft _ R) ∘ₗ LinearMap.rTensorHom N +set_option backward.isDefEq.respectTransparency.types false in theorem rTensorInv_leftInverse : Function.LeftInverse (rTensorInv P Q e) (.rTensorHom M) := fun _ ↦ by simp_rw [rTensorInv, LinearEquiv.coe_trans, LinearMap.comp_apply, LinearEquiv.coe_toLinearMap] @@ -132,6 +133,7 @@ of `R`-modules. -/ left_inv := rTensorInv_leftInverse P Q e right_inv _ := rTensorInv_injective P Q e (by rw [LinearMap.toFun_eq_coe, rTensorInv_leftInverse]) +set_option backward.isDefEq.respectTransparency.types false in open LinearMap in /-- If there is an `R`-isomorphism between `M ⊗[R] N` and `R`, the induced map `M → Nᵛ` is an isomorphism. -/ @@ -427,6 +429,7 @@ noncomputable instance : CoeSort (Pic R) (Type u) := ⟨AsModule⟩ noncomputable instance (R) [CommRing R] (M : Pic R) : AddCommGroup M := Module.addCommMonoidToAddCommGroup R +set_option backward.isDefEq.respectTransparency.types false in set_option backward.privateInPublic true in private noncomputable def equivShrinkLinearEquiv (M : (Skeleton <| SemimoduleCat.{u} R)ˣ) : (id <| equivShrink _ M : Pic R) ≃ₗ[R] M := @@ -601,6 +604,7 @@ namespace Module.Invertible variable (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] [Module.Invertible R M] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in -- TODO: generalize to CommSemiring by generalizing `CommRing.Pic.instSubsingletonOfIsLocalRing` theorem tensorProductComm_eq_refl : TensorProduct.comm R M M = .refl .. := by diff --git a/Mathlib/RingTheory/Polynomial/GaussNorm.lean b/Mathlib/RingTheory/Polynomial/GaussNorm.lean index 367e10e889b2fb..7b1c9dc9030881 100644 --- a/Mathlib/RingTheory/Polynomial/GaussNorm.lean +++ b/Mathlib/RingTheory/Polynomial/GaussNorm.lean @@ -150,6 +150,7 @@ lemma gaussNorm_zero_right : p.gaussNorm v 0 = v (p.coeff 0) := by · aesop (add norm (by simp [gaussNorm, Finset.sup'_le_iff])) · grind [p.le_gaussNorm v (le_refl 0) 0] +set_option backward.isDefEq.respectTransparency false in /-- If `v` is a nonnegative function with `v 0 = 0` and `c` is nonnegative, there exists a minimal index `i` such that the Gauss norm of `p` at `c` is attained at `i`. -/ lemma exists_min_eq_gaussNorm (p : R[X]) (hc : 0 ≤ c) : diff --git a/Mathlib/RingTheory/Polynomial/Quotient.lean b/Mathlib/RingTheory/Polynomial/Quotient.lean index bfa323f1966866..6e72b702e7194c 100644 --- a/Mathlib/RingTheory/Polynomial/Quotient.lean +++ b/Mathlib/RingTheory/Polynomial/Quotient.lean @@ -136,6 +136,7 @@ def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : coe_eval₂RingHom, map_pow, eval₂_C, RingHom.coe_comp, map_mul, eval₂_X, Function.comp_apply] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by diff --git a/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean b/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean index 8ca60864c4d48a..46cc8332c71a1e 100644 --- a/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean @@ -401,6 +401,7 @@ theorem resultant_C_left (r : R) : f.resultant (X + C r) m 1 = (-1) ^ m * eval (-r) f := by rw [← resultant_X_sub_C_right f m (-r) hf, map_neg, sub_neg_eq_add] +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` and `g` are monic and splits, then `Res(f, g) = ∏ (α - β)`, where `α` and `β` runs through the roots of `f` and `g` respectively. -/ lemma resultant_eq_prod_roots_sub @@ -473,6 +474,7 @@ lemma resultant_eq_prod_roots_sub · rw [f.modByMonic_add_div, natDegree_divByMonic _ hg, Nat.sub_add_cancel hfg] · simp +set_option backward.isDefEq.respectTransparency.types false in /-- If `f` splits with leading coeff `a` and degree `n`, then `Res(f, g) = aⁿ * ∏ g(α)` where `α` runs through the roots of `f`. -/ nonrec lemma resultant_eq_prod_eval [IsDomain R] @@ -930,6 +932,7 @@ discriminant. -/ noncomputable def discr (f : R[X]) : R := f.sylvesterDeriv.det * (-1) ^ (f.natDegree * (f.natDegree - 1) / 2) +set_option backward.isDefEq.respectTransparency.types false in /-- The discriminant of a constant polynomial is `1`. -/ @[simp] lemma discr_C (r : R) : discr (C r) = 1 := by let e : Fin ((C r).natDegree - 1 + (C r).natDegree) ≃ Fin 0 := finCongr (by simp) diff --git a/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean b/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean index 2c4bffb6833eac..ccabf6438db2db 100644 --- a/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean +++ b/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean @@ -97,7 +97,7 @@ instance (priority := 100) uniqueFactorizationMonoid : UniqueFactorizationMonoid only finitely many monic factors. (Note that its factors up to unit may be more than monic factors.) See also `UniqueFactorizationMonoid.fintypeSubtypeDvd`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeSubtypeMonicDvd (f : D[X]) (hf : f ≠ 0) : Fintype { g : D[X] // g.Monic ∧ g ∣ f } := by set G := { g : D[X] // g.Monic ∧ g ∣ f } diff --git a/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean b/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean index 63f481252b374d..5bfb60d948b0ad 100644 --- a/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean +++ b/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean @@ -31,6 +31,31 @@ We construct the universal ring of the following functors on `R-Alg`: -/ +set_option allowUnsafeReducibility true +attribute [implicit_reducible] + Equiv.trans + MulEquiv.trans + RingEquiv.trans + Finsupp.sum + MvPolynomial.aeval + MvPolynomial.map + Multiset.foldr + AlgEquiv.trans + AddCon.Quotient + AddMonoidAlgebra.coeff + Multiset.map + MvPolynomial.tensorEquivSum + MvPolynomial.eval₂ + Quotient + RingHomClass.toRingHom + MonoidHomClass.toMonoidHom + MvPolynomial.eval₂Hom + AddMonoidAlgebra.mapRingHom + Finset.sum + Multiset.sum + MulHomClass.toMulHom + TensorProduct + @[expose] public section open scoped Polynomial TensorProduct @@ -89,6 +114,7 @@ open Polynomial /-- `MonicDegreeEq · n` is representable by `R[X₁,...,Xₙ]`, with the universal element being `freeMonic`. -/ +@[local implicit_reducible] def mapEquivMonic : (MvPolynomial (Fin n) R →ₐ[R] S) ≃ MonicDegreeEq S n where toFun f := .map (.freeMonic _ _) f.toRingHom invFun p := aeval (p.1.coeff ·) @@ -124,10 +150,12 @@ lemma mapEquivMonic_symm_map_algebraMap (IsScalarTower.toAlgHom R S T).comp ((mapEquivMonic R S n).symm p) := by rw [← mapEquivMonic_symm_map, IsScalarTower.coe_toAlgHom] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- In light of the fact that `MonicDegreeEq · n` is representable by `R[X₁,...,Xₙ]`, this is the map `R[X₁,...,Xₘ₊ₖ] → R[X₁,...,Xₘ] ⊗ R[X₁,...,Xₖ]` corresponding to the multiplication `MonicDegreeEq · m × MonicDegreeEq · k → MonicDegreeEq · (m + k)`. -/ +@[local implicit_reducible] def universalFactorizationMap (hn : n = m + k) : MvPolynomial (Fin n) R →ₐ[R] MvPolynomial (Fin m) R ⊗[R] MvPolynomial (Fin k) R := (mapEquivMonic R _ n).symm @@ -141,6 +169,7 @@ def universalFactorizationMap (hn : n = m + k) : rw [((monic_freeMonic R m).map _).natDegree_mul ((monic_freeMonic R k).map _)] simp_rw [(monic_freeMonic R _).natDegree_map, natDegree_freeMonic, hn]⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma universalFactorizationMap_freeMonic : (freeMonic R n).map (toRingHom <| universalFactorizationMap R n m k hn) = (freeMonic R m).map (algebraMap _ _) * @@ -149,6 +178,7 @@ lemma universalFactorizationMap_freeMonic : simp [universalFactorizationMap] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in lemma universalFactorizationMap_comp_map : (universalFactorizationMap S n m k hn).toRingHom.comp (map (algebraMap R S)) = @@ -164,6 +194,7 @@ lemma universalFactorizationMap_comp_map : Polynomial.map_map, ← map_map_freeMonic (f := algebraMap R S)] congr 2 <;> ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in /-- Lifts along `universalFactorizationMap` corresponds to factorization of `p` into monic polynomials with fixed degrees. -/ def universalFactorizationMapLiftEquiv (p : MonicDegreeEq S n) : @@ -183,6 +214,7 @@ def universalFactorizationMapLiftEquiv (p : MonicDegreeEq S n) : left_inv f := by ext <;> simp right_inv q := by ext <;> simp +set_option backward.isDefEq.respectTransparency.types false in lemma ker_eval₂Hom_universalFactorizationMap : RingHom.ker (eval₂Hom (S₁ := MvPolynomial (Fin m) R ⊗[R] MvPolynomial (Fin k) R) (universalFactorizationMap R n m k hn) (Sum.elim (.X · ⊗ₜ 1) (1 ⊗ₜ .X ·))) = @@ -239,6 +271,7 @@ set_option backward.isDefEq.respectTransparency false in map := finSumFinEquiv.symm ∘ finCongr hn map_inj := finSumFinEquiv.symm.injective.comp (finCongr hn).injective } +set_option backward.isDefEq.respectTransparency.types false in lemma pderiv_inl_universalFactorizationMap_X (i j) : pderiv (Sum.inl i) (tensorEquivSum R (Fin m) (Fin k) R (universalFactorizationMap R n m k hn (X j))) = @@ -263,6 +296,7 @@ lemma pderiv_inl_universalFactorizationMap_X (i j) : simp [show a ≠ i by lia] · simp [h] +set_option backward.isDefEq.respectTransparency.types false in lemma pderiv_inr_universalFactorizationMap_X (i j) : pderiv (Sum.inr i) (tensorEquivSum R (Fin m) (Fin k) R (universalFactorizationMap R n m k hn (X j))) = @@ -509,6 +543,7 @@ def UniversalFactorizationRing.presentation : letI := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra (MvPolynomial.universalFactorizationMapPresentation R n m k hn).baseChange _ +set_option backward.isDefEq.respectTransparency.types false in lemma UniversalFactorizationRing.jacobian_resentation : (presentation m k hn p).jacobian = (-1) ^ n * (factor₁ m k hn p).1.resultant (factor₂ m k hn p).1 := by @@ -622,6 +657,7 @@ def UniversalCoprimeFactorizationRing.homEquiv : ext simp +set_option backward.isDefEq.respectTransparency.types false in lemma UniversalCoprimeFactorizationRing.homEquiv_comp_fst {T : Type*} [CommRing T] [Algebra R T] (f : 𝓡' →ₐ[R] S) (g : S →ₐ[R] T) : (homEquiv T m k hn p (g.comp f)).1.1 = (homEquiv S m k hn p f).1.1.map g := by @@ -629,6 +665,7 @@ lemma UniversalCoprimeFactorizationRing.homEquiv_comp_fst {T : Type*} [CommRing simp [homEquiv, UniversalFactorizationRing.homEquiv, Polynomial.map_map] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma UniversalCoprimeFactorizationRing.homEquiv_comp_snd {T : Type*} [CommRing T] [Algebra R T] (f : 𝓡' →ₐ[R] S) (g : S →ₐ[R] T) : (homEquiv T m k hn p (g.comp f)).1.2 = (homEquiv S m k hn p f).1.2.map g := by @@ -636,6 +673,7 @@ lemma UniversalCoprimeFactorizationRing.homEquiv_comp_snd {T : Type*} [CommRing simp [homEquiv, UniversalFactorizationRing.homEquiv, Polynomial.map_map] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- If a monic polynomial `p : R[X]` factors into a product of coprime monic polynomials `p = f * g` in the residue field `κ(P)` of some `P : Spec R`, then there exists `Q : Spec R_univ` in the universal coprime factorization ring lying over `P`, diff --git a/Mathlib/RingTheory/PolynomialLaw/Basic.lean b/Mathlib/RingTheory/PolynomialLaw/Basic.lean index 586d31ab7c3f83..850e86557871e0 100644 --- a/Mathlib/RingTheory/PolynomialLaw/Basic.lean +++ b/Mathlib/RingTheory/PolynomialLaw/Basic.lean @@ -415,6 +415,7 @@ theorem factorsThrough_toFunLifted_π : · simp only [hq, hu, ← LinearMap.comp_apply, comp_toLinearMap, rTensor_comp] congr; ext; rfl +set_option backward.isDefEq.respectTransparency.types false in theorem toFun_eq_rTensor_φ_toFun' {t : S ⊗[R] M} {s : Finset S} {p : MvPolynomial (Fin s.card) R ⊗[R] M} (ha : π R M S (⟨s, p⟩ : lifts R M S) = t) : f.toFun S t = (φ R s).toLinearMap.rTensor N (f.toFun' _ p) := by diff --git a/Mathlib/RingTheory/PowerBasis.lean b/Mathlib/RingTheory/PowerBasis.lean index d2d640b5e11137..a3967fd218601c 100644 --- a/Mathlib/RingTheory/PowerBasis.lean +++ b/Mathlib/RingTheory/PowerBasis.lean @@ -333,7 +333,7 @@ noncomputable def liftEquiv' [IsDomain B] (pb : PowerBasis A S) : /-- There are finitely many algebra homomorphisms `S →ₐ[A] B` if `S` is of the form `A[x]` and `B` is an integral domain. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def AlgHom.fintype [IsDomain B] (pb : PowerBasis A S) : Fintype (S →ₐ[A] B) := letI := Classical.decEq B Fintype.ofEquiv _ pb.liftEquiv'.symm diff --git a/Mathlib/RingTheory/PowerSeries/Evaluation.lean b/Mathlib/RingTheory/PowerSeries/Evaluation.lean index c09f9380cc32d7..9db6b973e53d09 100644 --- a/Mathlib/RingTheory/PowerSeries/Evaluation.lean +++ b/Mathlib/RingTheory/PowerSeries/Evaluation.lean @@ -115,6 +115,7 @@ def hasEvalIdeal : Ideal S where zero_mem' := HasEval.zero smul_mem' := HasEval.mul_left +set_option backward.isDefEq.respectTransparency false in theorem mem_hasEvalIdeal_iff {a : S} : a ∈ hasEvalIdeal ↔ HasEval a := by simp [hasEvalIdeal] diff --git a/Mathlib/RingTheory/PrincipalIdealDomain.lean b/Mathlib/RingTheory/PrincipalIdealDomain.lean index f9191cf7a05d5e..30926c2deffd0d 100644 --- a/Mathlib/RingTheory/PrincipalIdealDomain.lean +++ b/Mathlib/RingTheory/PrincipalIdealDomain.lean @@ -217,7 +217,7 @@ variable (R) /-- Any Bézout domain is a GCD domain. This is not an instance since `GCDMonoid` contains data, and this might not be how we would like to construct it. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def toGCDDomain [IsBezout R] [IsDomain R] [DecidableEq R] : GCDMonoid R := gcdMonoidOfGCD (gcd · ·) (gcd_dvd_left · ·) (gcd_dvd_right · ·) dvd_gcd diff --git a/Mathlib/RingTheory/QuasiFinite/Basic.lean b/Mathlib/RingTheory/QuasiFinite/Basic.lean index 6f7f95b8d5a016..2ca69f4418c17e 100644 --- a/Mathlib/RingTheory/QuasiFinite/Basic.lean +++ b/Mathlib/RingTheory/QuasiFinite/Basic.lean @@ -294,6 +294,7 @@ lemma iff_finite_comap_preimage_singleton [FiniteType R S] : exact ⟨Algebra.FiniteType.isNoetherianRing P.ResidueField _, (PrimeSpectrum.discreteTopology_iff_finite_and_krullDimLE_zero.mp inferInstance).right⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma iff_finite_primesOver [FiniteType R S] : QuasiFinite R S ↔ ∀ I : Ideal R, I.IsPrime → (I.primesOver S).Finite := by rw [iff_finite_comap_preimage_singleton, @@ -305,6 +306,7 @@ lemma iff_finite_primesOver [FiniteType R S] : simp [(PrimeSpectrum.equivSubtype S).exists_congr_left, PrimeSpectrum.ext_iff, eq_comm, PrimeSpectrum.equivSubtype, Ideal.primesOver, and_comm, Ideal.liesOver_iff, Ideal.under] +set_option backward.isDefEq.respectTransparency.types false in /-- If `T` is both a finite type `R`-algebra, and the localization of an integral `R`-algebra (away from an element), then `T` is quasi-finite over `R` -/ lemma of_isIntegral_of_finiteType [Algebra.IsIntegral R S] [Algebra.FiniteType R T] diff --git a/Mathlib/RingTheory/QuasiFinite/Polynomial.lean b/Mathlib/RingTheory/QuasiFinite/Polynomial.lean index 3820492b52107c..e23c9320233c23 100644 --- a/Mathlib/RingTheory/QuasiFinite/Polynomial.lean +++ b/Mathlib/RingTheory/QuasiFinite/Polynomial.lean @@ -17,6 +17,7 @@ variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] namespace Polynomial +set_option backward.isDefEq.respectTransparency false in attribute [local instance] Algebra.WeaklyQuasiFiniteAt.finite_locoalization in lemma not_weaklyQuasiFiniteAt (P : Ideal R[X]) [P.IsPrime] : ¬ Algebra.WeaklyQuasiFiniteAt R P := by intro H diff --git a/Mathlib/RingTheory/QuasiFinite/Weakly.lean b/Mathlib/RingTheory/QuasiFinite/Weakly.lean index 899aaacb703f7a..32073e6d26b9bb 100644 --- a/Mathlib/RingTheory/QuasiFinite/Weakly.lean +++ b/Mathlib/RingTheory/QuasiFinite/Weakly.lean @@ -50,6 +50,7 @@ See `Algebra.QuasiFiniteAt.of_weaklyQuasiFiniteAt`. -/ abbrev Algebra.WeaklyQuasiFiniteAt := Algebra.QuasiFiniteAt R (q.map (Ideal.Quotient.mk ((q.under R).map (algebraMap R S)))) +set_option backward.isDefEq.respectTransparency.types false in lemma Algebra.weaklyQuasiFiniteAt_iff : Algebra.WeaklyQuasiFiniteAt R q ↔ Algebra.QuasiFinite R (Localization.AtPrime q ⧸ diff --git a/Mathlib/RingTheory/Regular/IsSMulRegular.lean b/Mathlib/RingTheory/Regular/IsSMulRegular.lean index ce1fd7f8a89024..8729e80c5be865 100644 --- a/Mathlib/RingTheory/Regular/IsSMulRegular.lean +++ b/Mathlib/RingTheory/Regular/IsSMulRegular.lean @@ -168,6 +168,7 @@ lemma smul_top_inf_eq_smul_of_isSMulRegular_on_quot : exact Eq.trans (congrArg (· ⊓ N) (map_top _)) (map_comap_eq _ _).symm -- Who knew this didn't rely on exactness at the right!? +set_option backward.isDefEq.respectTransparency.types false in open Function in lemma QuotSMulTop.map_first_exact_on_four_term_exact_of_isSMulRegular_last {M'''} [AddCommGroup M'''] [Module R M'''] diff --git a/Mathlib/RingTheory/Regular/RegularSequence.lean b/Mathlib/RingTheory/Regular/RegularSequence.lean index 8b2559f6416cda..9b58c8f23e80cf 100644 --- a/Mathlib/RingTheory/Regular/RegularSequence.lean +++ b/Mathlib/RingTheory/Regular/RegularSequence.lean @@ -154,6 +154,7 @@ variable {S M} [CommRing R] [CommRing S] [AddCommGroup M] [AddCommGroup M₂] [Module R M] [Module S M₂] {σ : R →+* S} {σ' : S →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ] +set_option backward.isDefEq.respectTransparency.types false in open DistribMulAction AddSubgroup in private lemma _root_.AddHom.map_smul_top_toAddSubgroup_of_surjective {f : M →+ M₂} {as : List R} {bs : List S} (hf : Function.Surjective f) @@ -570,6 +571,7 @@ lemma map_first_exact_on_four_term_right_exact_of_isSMulRegular_last section Perm +set_option backward.isDefEq.respectTransparency.types false in open _root_.LinearMap in private lemma IsWeaklyRegular.swap {a b : R} (h1 : IsWeaklyRegular M [a, b]) (h2 : torsionBy R M b = a • torsionBy R M b → torsionBy R M b = ⊥) : diff --git a/Mathlib/RingTheory/RingHom/Locally.lean b/Mathlib/RingTheory/RingHom/Locally.lean index cc1a4f61fe5336..528a8b0aa5c10d 100644 --- a/Mathlib/RingTheory/RingHom/Locally.lean +++ b/Mathlib/RingTheory/RingHom/Locally.lean @@ -176,6 +176,7 @@ end OfLocalizationSpanTarget section Stability +set_option backward.isDefEq.respectTransparency.types false in /-- If `P` respects isomorphism, so does `Locally P`. -/ lemma locally_respectsIso (hPi : RespectsIso P) : RespectsIso (Locally P) where left {R S T} _ _ _ f e := fun ⟨s, hsone, hs⟩ ↦ by diff --git a/Mathlib/RingTheory/RingHomProperties.lean b/Mathlib/RingTheory/RingHomProperties.lean index 84c8c5b3541f61..8cafd4db62b394 100644 --- a/Mathlib/RingTheory/RingHomProperties.lean +++ b/Mathlib/RingTheory/RingHomProperties.lean @@ -60,6 +60,7 @@ theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCa simp [← CommRingCat.hom_comp], hP.1 f.hom (asIso g).commRingCatIsoToRingEquiv⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem RespectsIso.isLocalization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type u} (R' S' : Type u) [CommRing R] [CommRing S] [CommRing R'] [CommRing S'] [Algebra R R'] diff --git a/Mathlib/RingTheory/SimpleModule/Basic.lean b/Mathlib/RingTheory/SimpleModule/Basic.lean index 4e8f079cd21424..5237c0778ff044 100644 --- a/Mathlib/RingTheory/SimpleModule/Basic.lean +++ b/Mathlib/RingTheory/SimpleModule/Basic.lean @@ -584,6 +584,7 @@ theorem jacobson_density (f : End (End R M) M) (s : Finset M) : have ⟨r, hr⟩ := mem_span_singleton.mp this ⟨r, fun m hm ↦ by simpa [x] using! congr($hr ⟨m, hm⟩).symm⟩ +set_option backward.isDefEq.respectTransparency false in /-- The Jacobson density theorem for a module finite over its endomorphism ring. -/ protected theorem Module.Finite.toModuleEnd_moduleEnd_surjective [Module.Finite (End R M) M] : Function.Surjective (Module.toModuleEnd (End R M) (S := R) M) := by diff --git a/Mathlib/RingTheory/SimpleModule/Isotypic.lean b/Mathlib/RingTheory/SimpleModule/Isotypic.lean index 2cf4fdeed8a309..ba6f7663184796 100644 --- a/Mathlib/RingTheory/SimpleModule/Isotypic.lean +++ b/Mathlib/RingTheory/SimpleModule/Isotypic.lean @@ -357,6 +357,7 @@ section Equiv variable {ι : Type*} [DecidableEq ι] {N : ι → Submodule R M} (ind : iSupIndep N) (iSup_top : ⨆ i, N i = ⊤) (invar : ∀ i, (N i).IsFullyInvariant) +set_option backward.isDefEq.respectTransparency.types false in /-- If an `R`-module `M` is the direct sum of fully invariant submodules `Nᵢ`, then `End R M` is isomorphic to `Πᵢ End R Nᵢ` as a ring. -/ noncomputable def iSupIndep.ringEquiv : Module.End R M ≃+* Π i, Module.End R (N i) where @@ -465,6 +466,7 @@ form a complete atomic Boolean algebra. -/ exact le_biSup _ (isFullyInvariant_iff_le_imp_isotypicComponent_le.mp m.2 _ le) map_rel_iff' := (GaloisCoinsertion.setIsotypicComponents R M).l_le_l_iff +set_option backward.isDefEq.respectTransparency.types false in theorem isFullyInvariant_iff_sSup_isotypicComponents {m : Submodule R M} : m.IsFullyInvariant ↔ ∃ s ⊆ isotypicComponents R M, m = sSup s := by refine ⟨fun h ↦ ⟨OrderIso.setIsotypicComponents.symm ⟨m, h⟩, ⟨?_, ?_⟩⟩, ?_⟩ diff --git a/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean b/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean index 060fae7d18d6f8..7f178c30214953 100644 --- a/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean +++ b/Mathlib/RingTheory/SimpleModule/WedderburnArtin.lean @@ -199,6 +199,7 @@ theorem exists_algEquiv_pi_matrix_divisionRing : have ⟨n, S, d, _, hd, ⟨e⟩⟩ := exists_algEquiv_pi_matrix_end_mulOpposite R₀ R classical exact ⟨n, _, d, inferInstance, inferInstance, hd, ⟨e⟩⟩ +set_option backward.isDefEq.respectTransparency false in /-- The **Wedderburn–Artin Theorem**, algebra form, finite case: a finite semisimple algebra is isomorphic to a product of matrix algebras over finite division algebras. -/ theorem exists_algEquiv_pi_matrix_divisionRing_finite [Module.Finite R₀ R] : diff --git a/Mathlib/RingTheory/SimpleRing/Field.lean b/Mathlib/RingTheory/SimpleRing/Field.lean index b53a900f3dcec2..4521c33877efc4 100644 --- a/Mathlib/RingTheory/SimpleRing/Field.lean +++ b/Mathlib/RingTheory/SimpleRing/Field.lean @@ -22,6 +22,7 @@ public section namespace IsSimpleRing +set_option backward.isDefEq.respectTransparency.types false in open TwoSidedIdeal in lemma isField_center (A : Type*) [Ring A] [IsSimpleRing A] : IsField (Subring.center A) where exists_pair_ne := ⟨0, 1, zero_ne_one⟩ diff --git a/Mathlib/RingTheory/Smooth/AdicCompletion.lean b/Mathlib/RingTheory/Smooth/AdicCompletion.lean index 352ee07e40cb7b..73c50d3a4cd36b 100644 --- a/Mathlib/RingTheory/Smooth/AdicCompletion.lean +++ b/Mathlib/RingTheory/Smooth/AdicCompletion.lean @@ -51,6 +51,7 @@ noncomputable def liftAdicCompletionAux : (m : ℕ) → A →ₐ[R] S ⧸ (I ^ m (Ideal.map_quotient_self _) FormallySmooth.lift J ⟨m + 1 + 1, this⟩ q +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma factorₐ_comp_liftAdicCompletionAux (m : ℕ) : (Ideal.Quotient.factorₐ _ (Ideal.pow_le_pow_right m.le_succ)).comp diff --git a/Mathlib/RingTheory/Smooth/Basic.lean b/Mathlib/RingTheory/Smooth/Basic.lean index cbdd2cf4f21bc2..76c4b65d87a353 100644 --- a/Mathlib/RingTheory/Smooth/Basic.lean +++ b/Mathlib/RingTheory/Smooth/Basic.lean @@ -306,6 +306,7 @@ theorem iff_split_injection simp [LinearMap.ext_iff] · rw [and_iff_right (by exact mapBaseChange_surjective R P A hf)] +set_option backward.isDefEq.respectTransparency.types false in /-- Given a formally smooth `R`-algebra `P` and a surjective algebra homomorphism `f : P →ₐ[R] S` with kernel `I` (typically a presentation `R[X] → S`), @@ -459,6 +460,7 @@ variable {R : Type*} [CommRing R] variable {A : Type*} [CommRing A] [Algebra R A] variable (B : Type*) [CommRing B] [Algebra R B] +set_option backward.isDefEq.respectTransparency.types false in instance [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by refine .of_comp_surjective fun C _ _ I hI f ↦ ?_ letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra @@ -501,6 +503,7 @@ instance [FormallySmooth R A] (M : Submonoid A) : FormallySmooth R (Localization have : FormallySmooth A (Localization M) := of_isLocalization M .comp _ A _ +set_option backward.isDefEq.respectTransparency.types false in theorem localization_base [FormallySmooth R Sₘ] : FormallySmooth Rₘ Sₘ := by refine .of_comp_surjective fun Q _ _ I e f ↦ ?_ letI := ((algebraMap Rₘ Q).comp (algebraMap R Rₘ)).toAlgebra diff --git a/Mathlib/RingTheory/Smooth/IntegralClosure.lean b/Mathlib/RingTheory/Smooth/IntegralClosure.lean index 667ceaa54a7970..7fc8db20c92db3 100644 --- a/Mathlib/RingTheory/Smooth/IntegralClosure.lean +++ b/Mathlib/RingTheory/Smooth/IntegralClosure.lean @@ -33,6 +33,16 @@ open Polynomial TensorProduct variable {R S B : Type*} [CommRing R] [CommRing S] [Algebra R S] [CommRing B] [Algebra R B] +set_option allowUnsafeReducibility true +attribute [local implicit_reducible] + IsIntegral + RingHom.IsIntegralElem + Set + Set.range + Submonoid.copy + Submonoid.powers + integralClosure + variable (R S) in /-- The comparison map from `S ⊗[R] integralClosure R B` to `integralClosure S (S ⊗[R] B)`. This is injective when `S` is `R`-flat, and (TODO) bijective when `S` is `R`-smooth. -/ @@ -122,6 +132,7 @@ lemma TensorProduct.toIntegralClosure_bijective_of_isLocalizationAway (AlgHom.id R (integralClosure R B))).toLinearMap) (φ r).toLinearMap (toIntegralClosure R S B).toLinearMap (1 ⊗ₜ x)).1) +set_option backward.isDefEq.respectTransparency.types false in attribute [local instance] MvPolynomial.algebraMvPolynomial in /-- Base changing to `MvPolynomial σ R` preserves integral closure. -/ lemma TensorProduct.toIntegralClosure_mvPolynomial_bijective {σ : Type*} : diff --git a/Mathlib/RingTheory/Smooth/Kaehler.lean b/Mathlib/RingTheory/Smooth/Kaehler.lean index a183f5d5c81e51..cc4e9a4950a19a 100644 --- a/Mathlib/RingTheory/Smooth/Kaehler.lean +++ b/Mathlib/RingTheory/Smooth/Kaehler.lean @@ -112,6 +112,7 @@ def retractionOfSectionOfKerSqZero : S ⊗[P] Ω[P⁄R] →ₗ[P] RingHom.ker (a (IsScalarTower.toAlgHom R P S) hf' g hg).liftKaehlerDifferential (f.liftBaseChange S).restrictScalars P +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma retractionOfSectionOfKerSqZero_tmul_D (s : S) (t : P) : retractionOfSectionOfKerSqZero g hf' hg (s ⊗ₜ .D _ _ t) = diff --git a/Mathlib/RingTheory/Smooth/Pi.lean b/Mathlib/RingTheory/Smooth/Pi.lean index 117f16bd59492d..0216b55bc1a8c0 100644 --- a/Mathlib/RingTheory/Smooth/Pi.lean +++ b/Mathlib/RingTheory/Smooth/Pi.lean @@ -46,6 +46,7 @@ theorem of_pi [FormallySmooth R (Π i, A i)] (i) : change (Pi.single i x) i = x simp +set_option backward.isDefEq.respectTransparency.types false in theorem pi_iff [Finite I] : FormallySmooth R (Π i, A i) ↔ ∀ i, FormallySmooth R (A i) := by classical diff --git a/Mathlib/RingTheory/Smooth/Quotient.lean b/Mathlib/RingTheory/Smooth/Quotient.lean index fc847cd5f77427..ab8e81d729982e 100644 --- a/Mathlib/RingTheory/Smooth/Quotient.lean +++ b/Mathlib/RingTheory/Smooth/Quotient.lean @@ -94,6 +94,7 @@ private lemma mul_le_ker_of_range_le_mul_of_sq_zero {J I : Ideal R} (sq : I ^ 2 rcases Submodule.mem_map.mp hx with ⟨x', hx', eq⟩ simpa [← eq] using this hx' +set_option backward.isDefEq.respectTransparency.types false in /-- For flat ring homomorphism `f : R →+* S`, `I` an ideal of `R` which is square zero, if `R ⧸ I →+* S ⧸ IS` is formally smooth, so is `f`. -/ @[stacks 031L] diff --git a/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean b/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean index db5e9d6d5b9f64..8e00f3df82c6ce 100644 --- a/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean +++ b/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean @@ -114,6 +114,7 @@ lemma cotangentComplexAux_injective : Function.Injective P.cotangentComplexAux : simpa using this i · exact P.relation_mem_ker i +set_option backward.isDefEq.respectTransparency.types false in lemma cotangentComplexAux_surjective : Function.Surjective P.cotangentComplexAux := by rw [← LinearMap.range_eq_top, _root_.eq_top_iff, ← P.basisDeriv.span_eq, Submodule.span_le] rintro - ⟨i, rfl⟩ diff --git a/Mathlib/RingTheory/Smooth/StandardSmoothOfFree.lean b/Mathlib/RingTheory/Smooth/StandardSmoothOfFree.lean index 947a78077c3065..e452b9b463428d 100644 --- a/Mathlib/RingTheory/Smooth/StandardSmoothOfFree.lean +++ b/Mathlib/RingTheory/Smooth/StandardSmoothOfFree.lean @@ -44,6 +44,7 @@ open KaehlerDifferential variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] +set_option backward.isDefEq.respectTransparency.types false in /-- If `H¹(S/R) = 0` and `Ω[S⁄R]` is free on `{d sᵢ}ᵢ` for some `sᵢ : S`, then `S` is `R`-standard smooth. -/ theorem IsStandardSmooth.of_basis_kaehlerDifferential [FinitePresentation R S] @@ -96,6 +97,7 @@ theorem Etale.iff_isStandardSmoothOfRelativeDimension_zero : refine ⟨inferInstance, ⟨Empty, Module.Basis.empty Ω[S⁄R], ?_⟩⟩ simp [Set.range_subset_iff] +set_option backward.isDefEq.respectTransparency.types false in variable (R) in /-- If `S` is `R`-smooth at a prime `p`, then `S` is `R`-standard-smooth in a neighbourhood of `p`: there exists a basic open `p ∈ D(f)` of `Spec S` such that `S[1/f]` is standard smooth. -/ diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean b/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean index bd4d0585ad626b..ba02b0573531f3 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Localization.lean @@ -107,6 +107,7 @@ theorem mapPiLocalization_comp : (mapPiLocalization g hg).comp (mapPiLocalization f hf) := RingHom.ext fun _ ↦ funext fun _ ↦ congr($(Localization.localRingHom_comp _ _ _ _ rfl _ rfl) _) +set_option backward.isDefEq.respectTransparency false in theorem mapPiLocalization_bijective : Function.Bijective (mapPiLocalization f hf) := by let f := RingEquiv.ofBijective f hf let e := RingEquiv.ofRingHom (mapPiLocalization f hf) @@ -147,6 +148,7 @@ theorem finite_of_toPiLocalization_pi_surjective end Pi +set_option backward.isDefEq.respectTransparency false in theorem finite_of_toPiLocalization_surjective (surj : Function.Surjective (toPiLocalization R)) : Finite (MaximalSpectrum R) := by diff --git a/Mathlib/RingTheory/Spectrum/Prime/Basic.lean b/Mathlib/RingTheory/Spectrum/Prime/Basic.lean index 16952c87a6bf42..90e759f037fdfc 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Basic.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Basic.lean @@ -187,6 +187,7 @@ theorem gc : vanishingIdeal t := fun I t => subset_zeroLocus_iff_le_vanishingIdeal t I +set_option backward.isDefEq.respectTransparency false in /-- `zeroLocus` and `vanishingIdeal` form a Galois connection. -/ theorem gc_set : @GaloisConnection (Set R) (Set (PrimeSpectrum R))ᵒᵈ _ _ (fun s => zeroLocus s) fun t => diff --git a/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean b/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean index 14cb8208459c4b..a7da4a644b47ab 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/ChevalleyComplexity.lean @@ -273,6 +273,7 @@ private lemma induction_structure (n : ℕ) exact hi h_eq -- TODO: fix non-terminal simp (large simp set) +set_option backward.isDefEq.respectTransparency.types false in set_option linter.flexible false in open IsLocalization in open Submodule hiding comap in diff --git a/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean b/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean index 75bb01ce4a37ad..245f792f2fe756 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/LTSeries.lean @@ -28,6 +28,7 @@ open Ideal IsLocalRing namespace PrimeSpectrum +set_option backward.isDefEq.respectTransparency.types false in theorem exist_mem_one_of_mem_maximal_ideal [IsLocalRing R] {p₁ p₀ : PrimeSpectrum R} (h₀ : p₀ < p₁) (h₁ : p₁ < closedPoint R) {x : R} (hx : x ∈ 𝔪) : ∃ q : PrimeSpectrum R, x ∈ q.asIdeal ∧ p₀ < q ∧ q.asIdeal < 𝔪 := by @@ -50,6 +51,7 @@ theorem exist_mem_one_of_mem_maximal_ideal [IsLocalRing R] {p₁ p₀ : PrimeSpe refine not_lt_zero (a := (e ⟨p₀, le_refl p₀⟩).1.height) (height_le_iff.mp hph _ inferInstance ?_) simpa using h₀ +set_option backward.isDefEq.respectTransparency.types false in theorem exist_mem_one_of_mem_two {p₁ p₀ p₂ : PrimeSpectrum R} (h₀ : p₀ < p₁) (h₁ : p₁ < p₂) {x : R} (hx : x ∈ p₂.asIdeal) : ∃ q : (PrimeSpectrum R), x ∈ q.asIdeal ∧ p₀ < q ∧ q < p₂ := by diff --git a/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean b/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean index 3592cf2015d84b..1ec30b200eb9e3 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/RingHom.lean @@ -266,6 +266,7 @@ alias range_specComap_of_surjective := range_comap_of_surjective variable {S} +set_option backward.isDefEq.respectTransparency false in /-- Let `f : R →+* S` be a surjective ring homomorphism, then `Spec S` is order-isomorphic to `Z(I)` where `I = ker f`. -/ noncomputable def Ideal.primeSpectrumOrderIsoZeroLocusOfSurj (hf : Surjective f) {I : Ideal R} diff --git a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean index 6a73b5aede0902..7e30d3ac8c4383 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean @@ -157,6 +157,7 @@ theorem isClosed_zeroLocus (s : Set R) : IsClosed (zeroLocus s) := by rw [isClosed_iff_zeroLocus] exact ⟨s, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem zeroLocus_vanishingIdeal_eq_closure (t : Set (PrimeSpectrum R)) : zeroLocus (vanishingIdeal t : Set R) = closure t := by rcases isClosed_iff_zeroLocus (closure t) |>.mp isClosed_closure with ⟨I, hI⟩ @@ -738,6 +739,7 @@ section DiscreteTopology variable (R) [DiscreteTopology (PrimeSpectrum R)] +set_option backward.isDefEq.respectTransparency.types false in theorem toPiLocalization_surjective_of_discreteTopology : Function.Surjective (toPiLocalization R) := fun x ↦ by have (p : PrimeSpectrum R) : ∃ f, (basicOpen f : Set _) = {p} := diff --git a/Mathlib/RingTheory/Support.lean b/Mathlib/RingTheory/Support.lean index f6dfd259672600..a458866df39e90 100644 --- a/Mathlib/RingTheory/Support.lean +++ b/Mathlib/RingTheory/Support.lean @@ -56,6 +56,7 @@ lemma Module.notMem_support_iff : p ∉ Module.support R M ↔ Subsingleton (LocalizedModule p.asIdeal.primeCompl M) := not_nontrivial_iff_subsingleton +set_option backward.isDefEq.respectTransparency.types false in lemma Module.notMem_support_iff' : p ∉ Module.support R M ↔ ∀ m : M, ∃ r ∉ p.asIdeal, r • m = 0 := by simp only [notMem_support_iff, Ideal.primeCompl, LocalizedModule.subsingleton_iff, diff --git a/Mathlib/RingTheory/TensorProduct/Basic.lean b/Mathlib/RingTheory/TensorProduct/Basic.lean index 6a088fd3ee323f..3988c596cff296 100644 --- a/Mathlib/RingTheory/TensorProduct/Basic.lean +++ b/Mathlib/RingTheory/TensorProduct/Basic.lean @@ -543,6 +543,7 @@ lemma closure_range_union_range_eq_top [CommRing R] [Ring A] [Ring B] (Subring.subset_closure (.inr ⟨_, rfl⟩)) | add x y _ _ => exact add_mem ‹_› ‹_› +set_option backward.isDefEq.respectTransparency false in /-- If `s` generates `T` as an `R`-algebra, then `{ 1 ⊗ x | x ∈ s }` generates `A ⊗[R] T` as an `A`-algebra. -/ lemma adjoin_one_tmul_image_eq_top [CommSemiring R] [CommSemiring A] diff --git a/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean b/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean index b0e8f0dcd134be..9259ca983bb9dd 100644 --- a/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean +++ b/Mathlib/RingTheory/TensorProduct/DirectLimitFG.lean @@ -61,6 +61,7 @@ instance Submodule.FG.directedSystem : map_self := fun _ _ ↦ rfl map_map := fun _ _ _ _ _ _ ↦ rfl +set_option backward.isDefEq.respectTransparency.types false in variable (R M) in /-- Any module is the direct limit of its finitely generated submodules -/ noncomputable def Submodule.FG.directLimit [DecidableEq {P : Submodule R M // P.FG}] : @@ -117,6 +118,7 @@ noncomputable def Submodule.FG.rTensor.directLimit [DecidableEq {P : Submodule R (fun ⦃P Q⦄ (h : P ≤ Q) ↦ (Submodule.inclusion h).rTensor N) ≃ₗ[R] M ⊗[R] N := (TensorProduct.directLimitLeft _ N).symm.trans ((Submodule.FG.directLimit R M).rTensor N) +set_option backward.isDefEq.respectTransparency.types false in theorem Submodule.FG.rTensor.directLimit_apply [DecidableEq {P : Submodule R M // P.FG}] {P : {P : Submodule R M // P.FG}} (u : P ⊗[R] N) : (Submodule.FG.rTensor.directLimit R M N) @@ -170,6 +172,7 @@ noncomputable def Submodule.FG.lTensor.directLimit [DecidableEq {Q : Submodule R (fun _ _ hPQ ↦ (inclusion hPQ).lTensor M) ≃ₗ[R] M ⊗[R] N := (TensorProduct.directLimitRight _ M).symm.trans ((Submodule.FG.directLimit R N).lTensor M) +set_option backward.isDefEq.respectTransparency.types false in theorem Submodule.FG.lTensor.directLimit_apply [DecidableEq {P : Submodule R N // P.FG}] (Q : {Q : Submodule R N // Q.FG}) (u : M ⊗[R] Q.val) : (Submodule.FG.lTensor.directLimit R M N) diff --git a/Mathlib/RingTheory/TensorProduct/Free.lean b/Mathlib/RingTheory/TensorProduct/Free.lean index 07083ae3549521..629a5e89a87c96 100644 --- a/Mathlib/RingTheory/TensorProduct/Free.lean +++ b/Mathlib/RingTheory/TensorProduct/Free.lean @@ -72,6 +72,7 @@ theorem basis_repr_tmul (a : A) (m : M) : (basis A b).repr (a ⊗ₜ m) = a • Finsupp.mapRange (algebraMap R A) (map_zero _) (b.repr m) := basisAux_tmul b _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem basis_repr_symm_apply (a : A) (i : ι) : (basis A b).repr.symm (Finsupp.single i a) = a ⊗ₜ b.repr.symm (Finsupp.single i 1) := by simp [basis, Equiv.uniqueProd_symm_apply, basisAux] diff --git a/Mathlib/RingTheory/TensorProduct/IsBaseChangeFree.lean b/Mathlib/RingTheory/TensorProduct/IsBaseChangeFree.lean index 38778acd846704..6d345c2ab16b79 100644 --- a/Mathlib/RingTheory/TensorProduct/IsBaseChangeFree.lean +++ b/Mathlib/RingTheory/TensorProduct/IsBaseChangeFree.lean @@ -44,6 +44,7 @@ theorem basis_apply (i) : ibc.basis b i = ε (b i) := by simp [LinearEquiv.symm_apply_eq, IsBaseChange.equiv_tmul] simp [this, IsBaseChange.equiv_tmul] +set_option backward.isDefEq.respectTransparency false in theorem basis_repr_comp_apply (v i) : (ibc.basis b).repr (ε v) i = algebraMap R S (b.repr v i) := by conv_lhs => rw [← b.linearCombination_repr v, Finsupp.linearCombination_apply, diff --git a/Mathlib/RingTheory/TensorProduct/Maps.lean b/Mathlib/RingTheory/TensorProduct/Maps.lean index d1b56d3faa6a5e..f89f437d35c6ae 100644 --- a/Mathlib/RingTheory/TensorProduct/Maps.lean +++ b/Mathlib/RingTheory/TensorProduct/Maps.lean @@ -170,6 +170,7 @@ theorem lift_tmul (f : A →ₐ[S] C) (g : B →ₐ[R] C) (hfg : ∀ x y, Commut lift f g hfg (a ⊗ₜ b) = f a * g b := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem lift_includeLeft_includeRight : lift includeLeft includeRight (fun _ _ => (Commute.one_right _).tmul (Commute.one_left _)) = diff --git a/Mathlib/RingTheory/TensorProduct/Quotient.lean b/Mathlib/RingTheory/TensorProduct/Quotient.lean index f12cad92295d8e..e208fbc1b536c6 100644 --- a/Mathlib/RingTheory/TensorProduct/Quotient.lean +++ b/Mathlib/RingTheory/TensorProduct/Quotient.lean @@ -92,6 +92,7 @@ section variable {R : Type*} (S T A : Type*) [CommRing R] [CommRing S] [Algebra R S] [CommRing T] [Algebra R T] [CommRing A] [Algebra R A] [Algebra S A] [IsScalarTower R S A] +set_option backward.isDefEq.respectTransparency false in /-- The tensor product of an `S`-algebra `A` over `R` with the quotient of `T` by an ideal `I` is isomorphic (as an `S`-algebra) to the quotient of `A ⊗[R] T` by the extended ideal. -/ noncomputable def tensorQuotientEquiv (I : Ideal T) : diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean b/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean index 11406844dcf195..80fa8def42aee5 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Lattice.lean @@ -37,6 +37,7 @@ lemma mem_sup_right {I J : TwoSidedIdeal R} {x : R} (h : x ∈ J) : x ∈ I ⊔ J := (show J ≤ I ⊔ J from le_sup_right) h +set_option backward.isDefEq.respectTransparency false in lemma mem_sup {I J : TwoSidedIdeal R} {x : R} : x ∈ I ⊔ J ↔ ∃ y ∈ I, ∃ z ∈ J, y + z = x := by constructor diff --git a/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean b/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean index b9eca70f6fb1fa..8a8539e9d6ffcd 100644 --- a/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean +++ b/Mathlib/RingTheory/TwoSidedIdeal/Operations.lean @@ -121,6 +121,7 @@ lemma map_mono {I J : TwoSidedIdeal R} (h : I ≤ J) : variable [NonUnitalRingHomClass F R S] +set_option backward.isDefEq.respectTransparency false in /-- Preimage of a two-sided ideal, as a two-sided ideal. -/ def comap : TwoSidedIdeal S →o TwoSidedIdeal R where @@ -136,6 +137,7 @@ lemma comap_le_comap {I J : TwoSidedIdeal S} (h : I ≤ J) : comap f I ≤ comap f J := (comap f).monotone h +set_option backward.isDefEq.respectTransparency false in lemma mem_comap {I : TwoSidedIdeal S} {x : R} : x ∈ I.comap f ↔ f x ∈ I := by simp [comap, RingCon.comap, mem_iff] @@ -319,6 +321,7 @@ def fromIdeal : Ideal R →o TwoSidedIdeal R where toFun I := span I monotone' _ _ := span_mono +set_option backward.isDefEq.respectTransparency false in lemma mem_fromIdeal {I : Ideal R} {x : R} : x ∈ fromIdeal I ↔ x ∈ span I := by simp [fromIdeal] @@ -331,10 +334,12 @@ def asIdeal : TwoSidedIdeal R →o Ideal R where smul_mem' := fun r x hx => I.mul_mem_left r x hx } monotone' _ _ h _ h' := h h' +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mem_asIdeal {I : TwoSidedIdeal R} {x : R} : x ∈ asIdeal I ↔ x ∈ I := by simp [asIdeal] +set_option backward.isDefEq.respectTransparency false in lemma gc : GaloisConnection fromIdeal (asIdeal (R := R)) := fun I J => ⟨fun h x hx ↦ h <| mem_span_iff.2 fun _ H ↦ H hx, fun h x hx ↦ by simp only [fromIdeal, OrderHom.coe_mk, mem_span_iff] at hx @@ -414,6 +419,7 @@ instance : CanLift (Ideal R) (TwoSidedIdeal R) TwoSidedIdeal.asIdeal (·.IsTwoSi end Ideal +set_option backward.isDefEq.respectTransparency false in /-- A two-sided ideal is simply a left ideal that is two-sided. -/ @[simps] def TwoSidedIdeal.orderIsoIsTwoSided {R : Type*} [Ring R] : TwoSidedIdeal R ≃o {I : Ideal R // I.IsTwoSided} where diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean index 6d041adb86a88a..e99e65ea515cb8 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Finite.lean @@ -27,7 +27,7 @@ namespace UniqueFactorizationMonoid /-- If `y` is a nonzero element of a unique factorization monoid with finitely many units (e.g. `ℤ`, `Ideal (ring_of_integers K)`), it has finitely many divisors. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeSubtypeDvd {M : Type*} [CommMonoidWithZero M] [UniqueFactorizationMonoid M] [Fintype Mˣ] (y : M) (hy : y ≠ 0) : Fintype { x // x ∣ y } := by haveI : Nontrivial M := ⟨⟨y, 0, hy⟩⟩ diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean index abb5e77d5c3859..9893a80a778f77 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean @@ -49,7 +49,7 @@ noncomputable def UniqueFactorizationMonoid.toGCDMonoid (α : Type*) [CommMonoid /-- `toNormalizedGCDMonoid` constructs a GCD monoid out of a normalization on a unique factorization domain. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def UniqueFactorizationMonoid.toNormalizedGCDMonoid (α : Type*) [CommMonoidWithZero α] [UniqueFactorizationMonoid α] [NormalizationMonoid α] : NormalizedGCDMonoid α := diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean index d02f959aebbcb2..470c5903304cc4 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean @@ -373,7 +373,7 @@ variable [CommMonoidWithZero α] [UniqueFactorizationMonoid α] open scoped Classical in /-- Noncomputably defines a `normalizationMonoid` structure on a `UniqueFactorizationMonoid`. -/ -@[implicit_reducible] +@[instance_reducible] protected noncomputable def normalizationMonoid : NormalizationMonoid α := normalizationMonoidOfMonoidHomRightInverse { toFun := fun a : Associates α => diff --git a/Mathlib/RingTheory/Unramified/LocalStructure.lean b/Mathlib/RingTheory/Unramified/LocalStructure.lean index e374f7419a65da..23bc018cb16f49 100644 --- a/Mathlib/RingTheory/Unramified/LocalStructure.lean +++ b/Mathlib/RingTheory/Unramified/LocalStructure.lean @@ -382,6 +382,7 @@ lemma IsEtaleAt.exists_isStandardEtale exact .trans (PrimeSpectrum.basicOpen_mul_le_left _ _) h exact ⟨f * g, ‹Q.IsPrime›.mul_notMem hfQ hgQ, (hg.of_dvd (by simp)).isStandardEtale⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Given `S` a finitely presented `R`-algebra, and `p` a prime of `S`. If `S` is smooth over `R` at `p`, then there exists `f ∉ p` such that `R → S[1/f]` factors through some `R[X₁,...,Xₙ]`, and that `S[1/f]` is standard etale over `R[X₁,...,Xₙ]`. -/ diff --git a/Mathlib/RingTheory/Valuation/Basic.lean b/Mathlib/RingTheory/Valuation/Basic.lean index 26570c1f8394cc..6a7a8a3cbf4cdc 100644 --- a/Mathlib/RingTheory/Valuation/Basic.lean +++ b/Mathlib/RingTheory/Valuation/Basic.lean @@ -198,7 +198,7 @@ protected theorem map_pow : ∀ (x) (n : ℕ), v (x ^ n) = v x ^ n := -- The following definition is not an instance, because we have more than one `v` on a given `R`. -- In addition, type class inference would not be able to infer `v`. /-- A valuation gives a preorder on the underlying ring. -/ -@[implicit_reducible] +@[instance_reducible] def toPreorder : Preorder R := Preorder.lift v @@ -351,6 +351,7 @@ theorem map_one_sub_of_lt (h : v x < 1) : v (1 - x) = 1 := by rw [sub_eq_add_neg 1 x] simpa only [v.map_one, v.map_neg] using v.map_add_eq_of_lt_left h +set_option backward.isDefEq.respectTransparency false in /-- An ordered monoid isomorphism `Γ₀ ≃ Γ'₀` induces an equivalence `Valuation R Γ₀ ≃ Valuation R Γ'₀`. -/ def congr (f : Γ₀ ≃*o Γ'₀) : Valuation R Γ₀ ≃ Valuation R Γ'₀ where @@ -474,6 +475,7 @@ def restrict : Valuation R (MonoidWithZeroHom.ValueGroup₀ (v : R →*₀ Γ₀ lemma restrict_def (x : R) : v.restrict x = restrict₀ v x := rfl +set_option backward.isDefEq.respectTransparency false in lemma restrict_eq_mk {x : R} (hx : v x ≠ 0) : v.restrict x = (valueGroup.mk v 1 x (by simp) hx : ValueGroup₀ v) := by classical @@ -896,6 +898,7 @@ theorem orderMonoidIso_symm (h : v.IsEquiv w) (h' : w.IsEquiv v) : h.orderMonoidIso.symm = h'.orderMonoidIso := by rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem orderMonoidIso_eq_refl (h : v.IsEquiv v) : h.orderMonoidIso = .refl _ := by @@ -904,6 +907,7 @@ theorem orderMonoidIso_eq_refl (h : v.IsEquiv v) : · simp · simp [orderMonoidIso, valueGroup₀Fun_spec] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem orderMonoidIso_trans (h : v.IsEquiv w) (h' : w.IsEquiv u) : h.orderMonoidIso.trans h'.orderMonoidIso = (h.trans h').orderMonoidIso := by @@ -1197,7 +1201,7 @@ theorem ext {v₁ v₂ : AddValuation R Γ₀} (h : ∀ r, v₁ r = v₂ r) : v -- The following definition is not an instance, because we have more than one `v` on a given `R`. -- In addition, type class inference would not be able to infer `v`. /-- A valuation gives a preorder on the underlying ring. -/ -@[implicit_reducible] +@[instance_reducible] def toPreorder : Preorder R := Preorder.lift v diff --git a/Mathlib/RingTheory/Valuation/Discrete/Basic.lean b/Mathlib/RingTheory/Valuation/Discrete/Basic.lean index bdf969c84ecfbb..6a9695a4a8efea 100644 --- a/Mathlib/RingTheory/Valuation/Discrete/Basic.lean +++ b/Mathlib/RingTheory/Valuation/Discrete/Basic.lean @@ -137,6 +137,7 @@ instance : IsCyclic <| valueGroup v := by rw [← generator_zpowers_eq_valueGroup] exact isCyclic_zpowers (generator v) +set_option backward.isDefEq.respectTransparency.types false in instance : v.IsNontrivial := by apply IsNontrivial.mk by_contra! h1 @@ -285,6 +286,7 @@ theorem IsUniformizer.of_associated {π₁ π₂ : K₀} (h1 : IsUniformizer v have : v (u.1 : K) = 1 := (Integers.isUnit_iff_valuation_eq_one <| integer.integers v).mp u.isUnit rwa [IsUniformizer.iff, ← hu, Subring.coe_mul, map_mul, this, mul_one, ← IsUniformizer.iff] +set_option backward.isDefEq.respectTransparency.types false in /-- If two elements of `K₀` are uniformizers, then they are associated. -/ theorem associated_of_isUniformizer {π₁ π₂ : K₀} (h1 : IsUniformizer v π₁) (h2 : IsUniformizer v π₂) : Associated π₁ π₂ := by @@ -507,6 +509,7 @@ lemma mker_valuation_eq_isUnitSubmonoid : · obtain ⟨x, h, rfl⟩ := h simpa [IsDiscreteValuationRing.maximalIdeal] using! h +set_option backward.isDefEq.respectTransparency.types false in theorem associated_of_valuation_eq (x y : K) (h : ((maximalIdeal A).valuation K) x = ((maximalIdeal A).valuation K) y) : ∃ u : Aˣ, u • x = y := by diff --git a/Mathlib/RingTheory/Valuation/Discrete/RankOne.lean b/Mathlib/RingTheory/Valuation/Discrete/RankOne.lean index a3b7eaa8198e93..e6951f4250ed59 100644 --- a/Mathlib/RingTheory/Valuation/Discrete/RankOne.lean +++ b/Mathlib/RingTheory/Valuation/Discrete/RankOne.lean @@ -66,7 +66,7 @@ lemma valueGroup₀_equiv_withZeroMulInt_strictMono : (Left.one_lt_inv_iff.mpr hv.generator'_lt_one)))).lt_iff_lt] /-- A discrete valuation has rank one. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def rankOne {e : ℝ≥0} (he : 1 < e) : v.RankOne where hom' := (toNNReal (ne_of_gt (lt_trans zero_lt_one he))).comp (valueGroup₀_equiv_withZeroMulInt v) strictMono' := (toNNReal_strictMono he).comp (valueGroup₀_equiv_withZeroMulInt_strictMono v) diff --git a/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean b/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean index 4c6b5fe08c4708..b61006718bcb2d 100644 --- a/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean +++ b/Mathlib/RingTheory/Valuation/ExtendToLocalization.lean @@ -50,6 +50,7 @@ noncomputable def Valuation.extendToLocalization : Valuation B Γ := dsimp grw [max_mul_mul_right, v.map_add a b] } +set_option backward.isDefEq.respectTransparency false in @[simp] theorem Valuation.extendToLocalization_mk' (x : A) (y : S) : (v.extendToLocalization hS B) (IsLocalization.mk' _ x y) = diff --git a/Mathlib/RingTheory/Valuation/Integers.lean b/Mathlib/RingTheory/Valuation/Integers.lean index de9982a5402457..033a20988d412f 100644 --- a/Mathlib/RingTheory/Valuation/Integers.lean +++ b/Mathlib/RingTheory/Valuation/Integers.lean @@ -247,6 +247,7 @@ lemma isPrincipal_iff_exists_eq_setOf_valuation_le (hv : Integers v O) {I : Idea · simp [hx] · simp [hx, mem_upperBounds] +set_option backward.isDefEq.respectTransparency false in lemma not_denselyOrdered_of_isPrincipalIdealRing [IsPrincipalIdealRing O] (hv : Integers v O) : ¬ DenselyOrdered (range v) := by intro H diff --git a/Mathlib/RingTheory/Valuation/LocalSubring.lean b/Mathlib/RingTheory/Valuation/LocalSubring.lean index 2b3bd4613aba31..de496303057e86 100644 --- a/Mathlib/RingTheory/Valuation/LocalSubring.lean +++ b/Mathlib/RingTheory/Valuation/LocalSubring.lean @@ -91,6 +91,7 @@ lemma ValuationSubring.isMax_toLocalSubring (R : ValuationSubring K) : have : x' = x := by simpa [Subtype.ext_iff, inv_mul_eq_iff_eq_mul₀ hx0] using hx' exact h' (this ▸ x'.2) +set_option backward.isDefEq.respectTransparency.types false in @[stacks 00IB] lemma LocalSubring.exists_valuationRing_of_isMax {R : LocalSubring K} (hR : IsMax R) : ∃ R' : ValuationSubring K, R'.toLocalSubring = R := by @@ -171,6 +172,7 @@ open Polynomial Algebra in exact ⟨V, fun r hr ↦ hV.1 (B.algebraMap_mem ⟨r, hr⟩), (V.inv_mem_nonunits_iff.mp <| hV.2 ⟨_, Ideal.subset_span rfl, rfl⟩).resolve_left hx0⟩ +set_option backward.isDefEq.respectTransparency.types false in open Polynomial Algebra in @[stacks 090P "part (2)"] lemma LocalSubring.exists_le_valuationSubring_of_isIntegrallyClosedIn {x : K} {R : LocalSubring K} (hxR : x ∉ R.toSubring) [IsIntegrallyClosedIn R.toSubring K] : @@ -223,6 +225,7 @@ lemma iInf_valuationSubring_superset {s : Set K} : rw [Subring.integralClosure_subring_le_iff] exact Subring.closure_le.symm +set_option backward.isDefEq.respectTransparency.types false in lemma bijective_rangeRestrict_comp_of_valuationRing [IsDomain R] [ValuationRing R] [IsLocalRing S] [Algebra R K] [IsFractionRing R K] (f : R →+* S) (g : S →+* K) (h : g.comp f = algebraMap R K) [IsLocalHom f] : diff --git a/Mathlib/RingTheory/Valuation/RankOne.lean b/Mathlib/RingTheory/Valuation/RankOne.lean index 430c90a331795f..3996118d08a291 100644 --- a/Mathlib/RingTheory/Valuation/RankOne.lean +++ b/Mathlib/RingTheory/Valuation/RankOne.lean @@ -175,7 +175,7 @@ variable {K : Type*} [DivisionRing K] (v : Valuation K Γ₀) [RankLeOne v] /-- If a valuation has rank at most one and is non trivial, then it has rank one -/ -@[implicit_reducible] +@[instance_reducible] def rankOne_of_exists (H : ∃ x ≠ 0, v x ≠ 1) : RankOne v where exists_val_nontrivial := by by_contra! H' @@ -184,7 +184,7 @@ def rankOne_of_exists (H : ∃ x ≠ 0, v x ≠ 1) : RankOne v where /-- If a valuation has rank at most one and is non trivial, then it has rank one -/ -@[implicit_reducible] +@[instance_reducible] def rankOne_of_nontrivial (H : Nontrivial (ValueGroup₀ v)ˣ) : RankOne v where exists_val_nontrivial := by by_contra! H' @@ -217,7 +217,7 @@ variable {R : Type*} [CommRing R] [ValuativeRel R] /-- A valuative relation has a rank one valuation when it is both nontrivial and the rank is at most one. -/ -@[implicit_reducible] +@[instance_reducible] def Valuation.RankOne.ofRankLeOneStruct [ValuativeRel.IsNontrivial R] (e : RankLeOneStruct R) : Valuation.RankOne (valuation R) where hom' := e.emb.comp embedding diff --git a/Mathlib/RingTheory/Valuation/ValuationRing.lean b/Mathlib/RingTheory/Valuation/ValuationRing.lean index 7cfc53ea0295a6..55058880542b3e 100644 --- a/Mathlib/RingTheory/Valuation/ValuationRing.lean +++ b/Mathlib/RingTheory/Valuation/ValuationRing.lean @@ -145,6 +145,7 @@ protected theorem le_total (a b : ValueGroup A K) : a ≤ b ∨ b ≤ a := by field_simp simp only [← map_mul]; congr 1; linear_combination h +set_option backward.isDefEq.respectTransparency false in noncomputable instance linearOrder : LinearOrder (ValueGroup A K) where le_refl := by rintro ⟨⟩; use 1; rw [one_smul] le_trans := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩ ⟨e, rfl⟩ ⟨f, rfl⟩; use e * f; rw [mul_smul] diff --git a/Mathlib/RingTheory/Valuation/ValuationSubring.lean b/Mathlib/RingTheory/Valuation/ValuationSubring.lean index 45541aae834f1d..e240c260761176 100644 --- a/Mathlib/RingTheory/Valuation/ValuationSubring.lean +++ b/Mathlib/RingTheory/Valuation/ValuationSubring.lean @@ -693,6 +693,7 @@ theorem coe_mem_principalUnitGroup_iff {x : A.unitGroup} : rw [← π.map_one, ← sub_eq_zero, ← π.map_sub, Ideal.Quotient.eq_zero_iff_mem, valuation_lt_one_iff] simp [mem_principalUnitGroup_iff] +set_option backward.isDefEq.respectTransparency.types false in /-- The principal unit group agrees with the kernel of the canonical map from the units of `A` to the units of the residue field of `A`. -/ def principalUnitGroupEquiv : diff --git a/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean b/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean index 4c4cd3c7c3a6c7..a4b0ceaa9d2419 100644 --- a/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean +++ b/Mathlib/RingTheory/Valuation/ValuativeRel/Basic.lean @@ -313,7 +313,7 @@ lemma val_posSubmonoid_ne_zero (x : posSubmonoid R) : (x : R) ≠ 0 := by variable (R) in /-- The setoid used to construct `ValueGroupWithZero R`. -/ -@[implicit_reducible] +@[instance_reducible] def valueSetoid : Setoid (R × posSubmonoid R) where r := fun (x, s) (y, t) => x * t ≤ᵥ y * s ∧ y * s ≤ᵥ x * t iseqv := { @@ -666,7 +666,7 @@ lemma ValueGroupWithZero.mk_eq_div (r : R) (s : posSubmonoid R) : simp [valuation, mk_eq_mk] /-- Construct a valuative relation on a ring using a valuation. -/ -@[implicit_reducible] +@[instance_reducible] def ofValuation {S Γ : Type*} [CommRing S] [LinearOrderedCommGroupWithZero Γ] @@ -1189,6 +1189,7 @@ lemma embed_strictMono [v.Compatible] : StrictMono (embed v) := by · simp [restrict₀_apply, embed] · simp [restrict₀_apply, embed] +set_option backward.isDefEq.respectTransparency false in /-- When we have `h : w.IsEquiv v`, the image group (with zero) of `v` is isomorphic to that of `w` via `h.orderMonoidIso`. Then the following diagram is commutative: diff --git a/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean b/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean index d1923deefbe89f..9160ed71d267b5 100644 --- a/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean +++ b/Mathlib/RingTheory/Valuation/ValuativeRel/Trivial.lean @@ -33,7 +33,7 @@ open WithZero /-- The trivial valuative relation on a domain `R`, such that all non-zero elements are related. The domain condition is necessary so that the relation is closed when multiplying. -/ -@[implicit_reducible] +@[instance_reducible] def trivialRel : ValuativeRel R where vle x y := if y = 0 then x = 0 else True vle_total _ _ := by split_ifs <;> simp_all diff --git a/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean b/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean index 25380ba5a64305..3a88995cbc799c 100644 --- a/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean +++ b/Mathlib/RingTheory/WittVector/FrobeniusFractionField.lean @@ -194,6 +194,7 @@ theorem frobeniusRotation_nonzero {a₁ a₂ : 𝕎 k} (ha₁ : a₁.coeff 0 ≠ apply solution_nonzero p ha₁ ha₂ simpa [← h, frobeniusRotation, frobeniusRotationCoeff] using WittVector.zero_coeff p k 0 +set_option backward.isDefEq.respectTransparency.types false in theorem frobenius_frobeniusRotation {a₁ a₂ : 𝕎 k} (ha₁ : a₁.coeff 0 ≠ 0) (ha₂ : a₂.coeff 0 ≠ 0) : frobenius (frobeniusRotation p ha₁ ha₂) * a₁ = frobeniusRotation p ha₁ ha₂ * a₂ := by ext n diff --git a/Mathlib/RingTheory/WittVector/Isocrystal.lean b/Mathlib/RingTheory/WittVector/Isocrystal.lean index a91b60b777cdcc..0e0c899245612e 100644 --- a/Mathlib/RingTheory/WittVector/Isocrystal.lean +++ b/Mathlib/RingTheory/WittVector/Isocrystal.lean @@ -127,11 +127,13 @@ def Isocrystal.frobenius : V ≃ᶠˡ[p, k] V := @[inherit_doc] scoped[Isocrystal] notation "Φ(" p ", " k ")" => WittVector.Isocrystal.frobenius p k +set_option backward.isDefEq.respectTransparency.types false in /-- A homomorphism between isocrystals respects the Frobenius map. Notation `M →ᶠⁱ [p, k]` in the `Isocrystal` namespace. -/ structure IsocrystalHom extends V →ₗ[K(p, k)] V₂ where frob_equivariant : ∀ x : V, Φ(p, k) (toLinearMap x) = toLinearMap (Φ(p, k) x) +set_option backward.isDefEq.respectTransparency.types false in /-- An isomorphism between isocrystals respects the Frobenius map. Notation `M ≃ᶠⁱ [p, k]` in the `Isocrystal` namespace. -/ @@ -168,6 +170,7 @@ instance (m : ℤ) : Isocrystal p k (StandardOneDimIsocrystal p k m) where (FractionRing.frobenius p k).toSemilinearEquiv.trans (LinearEquiv.smulOfNeZero _ _ _ (zpow_ne_zero m (WittVector.FractionRing.p_nonzero p k))) +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem StandardOneDimIsocrystal.frobenius_apply (m : ℤ) (x : StandardOneDimIsocrystal p k m) : Φ(p, k) x = (p : K(p, k)) ^ m • φ(p, k) x := rfl diff --git a/Mathlib/RingTheory/ZariskisMainTheorem.lean b/Mathlib/RingTheory/ZariskisMainTheorem.lean index 56b7325c374066..d8d1fa0063ff2a 100644 --- a/Mathlib/RingTheory/ZariskisMainTheorem.lean +++ b/Mathlib/RingTheory/ZariskisMainTheorem.lean @@ -139,6 +139,7 @@ section IsStronglyTranscendental variable (φ : R[X] →ₐ[R] S) (t : S) (p r : R[X]) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a map `φ : R[X] →ₐ[R] S`. Suppose `t = φ r / φ p` is integral over `R[X]` where `p` is monic with `deg p > deg r`, then `t` is also integral over `R`. -/ lemma isIntegral_of_isIntegralElem_of_monic_of_natDegree_lt diff --git a/Mathlib/SetTheory/Cardinal/Arithmetic.lean b/Mathlib/SetTheory/Cardinal/Arithmetic.lean index 98b12da1d49fa8..8c6f884879c78c 100644 --- a/Mathlib/SetTheory/Cardinal/Arithmetic.lean +++ b/Mathlib/SetTheory/Cardinal/Arithmetic.lean @@ -40,6 +40,7 @@ namespace Cardinal /-! ### Properties of `mul` -/ section mul +set_option backward.isDefEq.respectTransparency false in /-- If `α` is an infinite type, then `α × α` and `α` have the same cardinality. -/ theorem mul_eq_self {c : Cardinal} (hc : ℵ₀ ≤ c) : c * c = c := by -- The only nontrivial part is `c * c ≤ c`. We prove it inductively. @@ -543,6 +544,7 @@ end mul_strictMono /-! ### Properties about `power` -/ section power +set_option backward.isDefEq.respectTransparency false in theorem pow_le {κ μ : Cardinal.{u}} (H1 : ℵ₀ ≤ κ) (H2 : μ < ℵ₀) : κ ^ μ ≤ κ := let ⟨n, H3⟩ := lt_aleph0.1 H2 H3.symm ▸ diff --git a/Mathlib/SetTheory/Cardinal/Basic.lean b/Mathlib/SetTheory/Cardinal/Basic.lean index a487a36c7b89d4..0af701268cedc5 100644 --- a/Mathlib/SetTheory/Cardinal/Basic.lean +++ b/Mathlib/SetTheory/Cardinal/Basic.lean @@ -142,6 +142,7 @@ end Cardinal namespace Cardinal +set_option backward.isDefEq.respectTransparency false in instance small_Iic (a : Cardinal.{u}) : Small.{u} (Iic a) := by rw [← mk_out a] apply @small_of_surjective (Set a.out) (Iic #a.out) _ fun x => ⟨#x, mk_set_le x⟩ diff --git a/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean b/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean index 19beb23372c63a..f79cef9a727e79 100644 --- a/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean +++ b/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean @@ -250,6 +250,7 @@ alias cof_le_of_isNormal := le_cof_map_of_isNormal @[deprecated (since := "2025-12-25")] alias IsNormal.cof_le := le_cof_map_of_isNormal +set_option backward.isDefEq.respectTransparency false in theorem sSup_add_one_lt_of_lt_cof {s : Set Ordinal.{u}} {a : Ordinal.{u}} (ha : #s < (lift.{u + 1} a).cof) (hs : ∀ i ∈ s, i < a) : sSup ((· + 1) '' s) < a := by let f := OrderIso.ofRelIsoLT (enum (α := s) (· < ·)) diff --git a/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean b/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean index 99db04260f81fc..d2197340546279 100644 --- a/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean +++ b/Mathlib/SetTheory/Cardinal/HasCardinalLT.lean @@ -168,6 +168,7 @@ lemma hasCardinalLT_subtype_iSup obtain ⟨i, hi⟩ := h exact ⟨⟨i, _, hi⟩, rfl⟩) +set_option backward.isDefEq.respectTransparency false in lemma hasCardinalLT_iUnion {ι : Type*} {X : Type*} (S : ι → Set X) {κ : Cardinal} [Fact κ.IsRegular] (hι : HasCardinalLT ι κ) (hS : ∀ i, HasCardinalLT (S i) κ) : diff --git a/Mathlib/SetTheory/Cardinal/Order.lean b/Mathlib/SetTheory/Cardinal/Order.lean index dcacc324db17c9..5ba15001792ad0 100644 --- a/Mathlib/SetTheory/Cardinal/Order.lean +++ b/Mathlib/SetTheory/Cardinal/Order.lean @@ -483,6 +483,7 @@ theorem le_sum {ι : Type u} (f : ι → Cardinal.{max u v}) (i) : f i ≤ sum f theorem iSup_le_sum {ι} (f : ι → Cardinal) : iSup f ≤ sum f := ciSup_le' <| le_sum _ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem sum_add_distrib {ι} (f g : ι → Cardinal) : sum (f + g) = sum f + sum g := by have := mk_congr (Equiv.sigmaSumDistrib (Quotient.out ∘ f) (Quotient.out ∘ g)) diff --git a/Mathlib/SetTheory/Descriptive/Tree.lean b/Mathlib/SetTheory/Descriptive/Tree.lean index 68a0af8b0742a3..d6d510173376bc 100644 --- a/Mathlib/SetTheory/Descriptive/Tree.lean +++ b/Mathlib/SetTheory/Descriptive/Tree.lean @@ -101,9 +101,11 @@ def pullSub : tree A where variable {T x y} +set_option backward.isDefEq.respectTransparency false in lemma mem_pullSub_short (hl : y.length ≤ x.length) : y ∈ pullSub T x ↔ y <+: x ∧ [] ∈ T := by simp [pullSub, List.take_of_length_le hl, List.drop_eq_nil_iff.mpr hl] +set_option backward.isDefEq.respectTransparency false in lemma mem_pullSub_long (hl : x.length ≤ y.length) : y ∈ pullSub T x ↔ ∃ z ∈ T, y = x ++ z where mp := by intro ⟨h1, h2⟩; use y.drop x.length, h2 @@ -136,6 +138,7 @@ lemma pullSub_adjunction (S T : tree A) (x : List A) : pullSub S x ≤ T ↔ S @[simp] lemma pullSub_nil : pullSub T [] = T := by simp [pullSub] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma pullSub_append : pullSub (pullSub T y) x = pullSub T (x ++ y) := by ext z; rcases le_total x.length z.length with hl | hl · by_cases hp : x <+: z diff --git a/Mathlib/SetTheory/Lists.lean b/Mathlib/SetTheory/Lists.lean index 970c56cfded6fc..028bdf0aa6aabb 100644 --- a/Mathlib/SetTheory/Lists.lean +++ b/Mathlib/SetTheory/Lists.lean @@ -175,6 +175,7 @@ theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil := · rfl · rcases cons_subset.1 h with ⟨⟨_, ⟨⟩, _⟩, _⟩ +set_option backward.isDefEq.respectTransparency false in theorem mem_of_subset' {a} : ∀ {l₁ l₂ : Lists' α true} (_ : l₁ ⊆ l₂) (_ : a ∈ l₁.toList), a ∈ l₂ | nil, _, Lists'.Subset.nil, h => by cases h | cons' a0 l0, l₂, s, h => by @@ -225,6 +226,7 @@ theorem isList_toList (l : List (Lists α)) : IsList (ofList l) := theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l := by simp [ofList, of'] +set_option backward.isDefEq.respectTransparency false in theorem of_toList : ∀ {l : Lists α}, IsList l → ofList (toList l) = l | ⟨true, l⟩, _ => by simp_all [ofList, of'] @@ -324,8 +326,9 @@ theorem lt_sizeof_cons' {b} (a : Lists' α b) (l) : variable [DecidableEq α] +set_option backward.isDefEq.respectTransparency false in mutual - @[implicit_reducible] + @[instance_reducible] def Equiv.decidable : ∀ l₁ l₂ : Lists α, Decidable (l₁ ~ l₂) | ⟨false, l₁⟩, ⟨false, l₂⟩ => decidable_of_iff' (l₁ = l₂) <| by @@ -348,7 +351,7 @@ mutual Subset.decidable l₂ l₁ exact decidable_of_iff' _ Equiv.antisymm_iff termination_by x y => sizeOf x + sizeOf y - @[implicit_reducible] + @[instance_reducible] def Subset.decidable : ∀ l₁ l₂ : Lists' α true, Decidable (l₁ ⊆ l₂) | Lists'.nil, _ => isTrue Lists'.Subset.nil | @Lists'.cons' _ b a l₁, l₂ => by @@ -362,7 +365,7 @@ mutual Subset.decidable l₁ l₂ exact decidable_of_iff' _ (@Lists'.cons_subset _ ⟨_, _⟩ _ _) termination_by x y => sizeOf x + sizeOf y - @[implicit_reducible] + @[instance_reducible] def mem.decidable : ∀ (a : Lists α) (l : Lists' α true), Decidable (a ∈ l) | a, Lists'.nil => isFalse <| by rintro ⟨_, ⟨⟩, _⟩ | a, Lists'.cons' b l₂ => by diff --git a/Mathlib/SetTheory/Ordinal/Arithmetic.lean b/Mathlib/SetTheory/Ordinal/Arithmetic.lean index 13b50f9694c4cf..66db62465056eb 100644 --- a/Mathlib/SetTheory/Ordinal/Arithmetic.lean +++ b/Mathlib/SetTheory/Ordinal/Arithmetic.lean @@ -194,6 +194,7 @@ def boundedLimitRecOn {l : Ordinal} (lLim : IsSuccLimit l) {motive : Iio l → S exact succ ⟨o, ho'⟩ (IH ho') | limit o ho' IH => exact limit _ ho' fun a ha ↦ IH a.1 ha (ha.trans (c := l) ho) +set_option backward.isDefEq.respectTransparency.types false in set_option linter.deprecated false in @[deprecated limitRecOn_zero (since := "2025-12-26")] theorem boundedLimitRec_zero {l} (lLim : IsSuccLimit l) {motive} (H₁ H₂ H₃) : @@ -202,6 +203,7 @@ theorem boundedLimitRec_zero {l} (lLim : IsSuccLimit l) {motive} (H₁ H₂ H₃ dsimp rw [limitRecOn_zero] +set_option backward.isDefEq.respectTransparency.types false in set_option linter.deprecated false in @[deprecated limitRecOn_succ (since := "2025-12-26")] theorem boundedLimitRec_succ {l} (lLim : IsSuccLimit l) {motive} (o H₁ H₂ H₃) : @@ -212,6 +214,7 @@ theorem boundedLimitRec_succ {l} (lLim : IsSuccLimit l) {motive} (o H₁ H₂ H rw [limitRecOn_succ] rfl +set_option backward.isDefEq.respectTransparency.types false in set_option linter.deprecated false in @[deprecated limitRecOn_limit (since := "2025-12-26")] theorem boundedLimitRec_limit {l} (lLim : IsSuccLimit l) {motive} (o H₁ H₂ H₃ oLim) : @@ -229,6 +232,7 @@ theorem enum_succ_eq_top {o : Ordinal} : enum (α := (succ o).ToType) (· < ·) ⟨o, type_toType _ ▸ lt_succ o⟩ = ⊤ := rfl +set_option backward.isDefEq.respectTransparency false in @[deprecated isSuccPrelimit_type_lt_iff (since := "2026-04-12")] theorem has_succ_of_type_succ_lt {α} {r : α → α → Prop} [wo : IsWellOrder α r] (h : ∀ a < type r, succ a < type r) (x : α) : ∃ y, r x y := by @@ -242,6 +246,7 @@ set_option linter.deprecated false in theorem toType_noMax_of_succ_lt {o : Ordinal} (ho : ∀ a < o, succ a < o) : NoMaxOrder o.ToType := ⟨has_succ_of_type_succ_lt (type_toType _ ▸ ho)⟩ +set_option backward.isDefEq.respectTransparency false in theorem bounded_singleton {r : α → α → Prop} [IsWellOrder α r] (hr : IsSuccLimit (type r)) (x) : Bounded r {x} := by refine ⟨enum r ⟨succ (typein r x), hr.succ_lt (typein_lt_type r x)⟩, ?_⟩ @@ -599,6 +604,7 @@ theorem le_mul_right (a : Ordinal) {b : Ordinal} (hb : 0 < b) : a ≤ b * a := b convert! mul_le_mul_left (one_le_iff_pos.2 hb) a rw [one_mul a] +set_option backward.isDefEq.respectTransparency false in private theorem mul_le_of_limit_aux {α β r s} [IsWellOrder α r] [IsWellOrder β s] {c} (h : IsSuccLimit (type s)) (H : ∀ b' < type s, type r * b' ≤ c) (l : c < type r * type s) : False := by @@ -1032,6 +1038,7 @@ theorem typein_lt_fin {n : ℕ} (x : Fin n) : typein LT.lt x = x := by rw [← type_Iio_lt, type_fintype, Nat.cast_inj] exact Fintype.card_fin_lt_of_le x.is_le' +set_option backward.isDefEq.respectTransparency false in @[simp] theorem enum_lt_fin {n : ℕ} (x : Fin n) : enum LT.lt ⟨x, by simp⟩ = x := by simp [← typein_inj LT.lt] @@ -1047,6 +1054,7 @@ theorem natCast_lt_omega0 (n : ℕ) : ↑n < ω := @[deprecated (since := "2026-03-08")] alias nat_lt_omega0 := natCast_lt_omega0 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem enum_lt_nat (x : ℕ) : enum LT.lt ⟨x, by simp⟩ = x := by simp [← typein_inj LT.lt] diff --git a/Mathlib/SetTheory/Ordinal/Basic.lean b/Mathlib/SetTheory/Ordinal/Basic.lean index 1b47dfba3da250..d0a6665237f441 100644 --- a/Mathlib/SetTheory/Ordinal/Basic.lean +++ b/Mathlib/SetTheory/Ordinal/Basic.lean @@ -517,6 +517,7 @@ theorem enum_zero_le' {o : Ordinal} (h0 : 0 < o) (a : o.ToType) : rw [← not_lt] apply enum_zero_le +set_option backward.isDefEq.respectTransparency false in theorem relIso_enum' {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] (f : r ≃r s) (o : Ordinal) : ∀ (hr : o < type r) (hs : o < type s), f (enum r ⟨o, hr⟩) = enum s ⟨o, hs⟩ := by @@ -560,7 +561,7 @@ instance small_Ioo (a b : Ordinal.{u}) : Small.{u} (Ioo a b) := small_subset Ioo instance small_Ioc (a b : Ordinal.{u}) : Small.{u} (Ioc a b) := small_subset Ioc_subset_Iic_self /-- `o.ToType` is an `OrderBot` whenever `o ≠ 0`. -/ -@[implicit_reducible, deprecated WellFoundedLT.toOrderBot (since := "2026-04-12")] +@[instance_reducible, deprecated WellFoundedLT.toOrderBot (since := "2026-04-12")] def toTypeOrderBot {o : Ordinal} (ho : o ≠ 0) : OrderBot o.ToType where bot := (enum (· < ·)) ⟨0, _⟩ bot_le := enum_zero_le' (bot_lt_iff_ne_bot.2 ho) @@ -987,6 +988,7 @@ instance uniqueToTypeOne : Unique (ToType 1) where theorem one_toType_eq (x : ToType 1) : x = enum (· < ·) ⟨0, by simp⟩ := Unique.eq_default x +set_option backward.isDefEq.respectTransparency false in theorem type_lt_mem_range_succ_iff [LinearOrder α] [WellFoundedLT α] : typeLT α ∈ range succ ↔ ∃ x : α, IsMax x := by simp_rw [← isTop_iff_isMax] @@ -1020,6 +1022,7 @@ theorem isSuccPrelimit_type_lt [LinearOrder α] [WellFoundedLT α] [h : NoMaxOrd -- TODO: use `ToType.mk` for lemmas on `ToType` rather than `enum` and `typein`. +set_option backward.isDefEq.respectTransparency false in @[simp] theorem typein_one_toType (x : ToType 1) : typein (α := ToType 1) (· < ·) x = 0 := by rw [one_toType_eq x, typein_enum] @@ -1028,6 +1031,7 @@ theorem typein_le_typein' (o : Ordinal) {x y : o.ToType} : typein (α := o.ToType) (· < ·) x ≤ typein (α := o.ToType) (· < ·) y ↔ x ≤ y := by simp +set_option backward.isDefEq.respectTransparency false in theorem le_enum_succ {o : Ordinal} (a : (succ o).ToType) : a ≤ enum (α := (succ o).ToType) (· < ·) ⟨o, (type_toType _ ▸ lt_succ o)⟩ := by rw [← enum_typein (α := (succ o).ToType) (· < ·) a, enum_le_enum', Subtype.mk_le_mk, @@ -1256,7 +1260,6 @@ theorem ord_eq_omega0 {a : Cardinal} : a.ord = ω ↔ a = ℵ₀ := def ord.orderEmbedding : Cardinal ↪o Ordinal := OrderEmbedding.ofStrictMono _ fun _ _ ↦ Cardinal.ord_lt_ord.2 -set_option linter.deprecated false in @[deprecated ord (since := "2026-02-27")] theorem ord.orderEmbedding_coe : (ord.orderEmbedding : Cardinal → Ordinal) = ord := rfl diff --git a/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean b/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean index f34baf3e723b91..0efcdfec0fff1c 100644 --- a/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean +++ b/Mathlib/SetTheory/Ordinal/CantorNormalForm.lean @@ -176,6 +176,7 @@ Cantor Normal Form (`CNF`) of `o`, for each `e`. -/ def coeff (b o : Ordinal) : Ordinal →₀ Ordinal := lookupFinsupp ⟨_, nodupKeys b o⟩ +set_option backward.isDefEq.respectTransparency false in theorem support_coeff (b o : Ordinal) : (coeff b o).support = ((CNF b o).map Prod.fst).toFinset := by rw [coeff, lookupFinsupp_support, filter_eq_self.2] diff --git a/Mathlib/SetTheory/Ordinal/Family.lean b/Mathlib/SetTheory/Ordinal/Family.lean index 748e7cda02fe64..a85a44001b60b5 100644 --- a/Mathlib/SetTheory/Ordinal/Family.lean +++ b/Mathlib/SetTheory/Ordinal/Family.lean @@ -69,6 +69,7 @@ theorem bfamilyOfFamily_typein {ι} (f : ι → α) (i) : bfamilyOfFamily f (typein _ i) (typein_lt_type _ i) = f i := bfamilyOfFamily'_typein _ f i +set_option backward.isDefEq.respectTransparency false in set_option linter.deprecated false in @[deprecated "familyOfBFamily is deprecated" (since := "2026-04-06")] theorem familyOfBFamily'_enum {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o} diff --git a/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean b/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean index 52271dff07f178..d08493c9f36170 100644 --- a/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean +++ b/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean @@ -77,6 +77,7 @@ protected theorem zero (f : Iio 0 → Iio 0) : IsFundamentalSeq f where le_ord_cof := by simp isCofinal_range := .of_isEmpty +set_option backward.isDefEq.respectTransparency false in /-- The length one sequence `(o)` is a fundamental sequence for `o + 1`. -/ protected theorem add_one (o : Ordinal) : @IsFundamentalSeq 1 (o + 1) fun _ ↦ ⟨o, lt_add_one o⟩ where diff --git a/Mathlib/SetTheory/ZFC/Basic.lean b/Mathlib/SetTheory/ZFC/Basic.lean index 7fdf75bc8fa535..65553e86fc26c8 100644 --- a/Mathlib/SetTheory/ZFC/Basic.lean +++ b/Mathlib/SetTheory/ZFC/Basic.lean @@ -147,7 +147,7 @@ namespace Classical open PSet ZFSet /-- All functions are classically definable. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def allZFSetDefinable {n} (F : (Fin n → ZFSet.{u}) → ZFSet.{u}) : Definable n F where out xs := (F (mk <| xs ·)).out @@ -644,6 +644,7 @@ variable {α : Type*} [Small.{u} α] noncomputable def range (f : α → ZFSet.{u}) : ZFSet.{u} := ⟦⟨_, Quotient.out ∘ f ∘ (equivShrink α).symm⟩⟧ +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mem_range {f : α → ZFSet.{u}} {x : ZFSet.{u}} : x ∈ range f ↔ ∃ i, f i = x := Quotient.inductionOn x fun y => by diff --git a/Mathlib/SetTheory/ZFC/Class.lean b/Mathlib/SetTheory/ZFC/Class.lean index f4387a1700d944..11b52e99c97c67 100644 --- a/Mathlib/SetTheory/ZFC/Class.lean +++ b/Mathlib/SetTheory/ZFC/Class.lean @@ -281,7 +281,7 @@ theorem eq_univ_of_powerset_subset {A : Class} (hA : powerset A ⊆ A) : A = uni WellFounded.min_mem ZFSet.mem_wf _ hnA (hA fun x hx => Classical.not_not.1 fun hB => - WellFounded.not_lt_min ZFSet.mem_wf _ hB <| coe_apply.1 hx)) + WellFounded.not_lt_min ZFSet.mem_wf Aᶜ hB <| coe_apply.1 hx)) /-- The definite description operator, which is `{x}` if `{y | A y} = {x}` and `∅` otherwise. -/ def iota (A : Class) : Class := @@ -319,7 +319,8 @@ namespace ZFSet theorem map_fval {f : ZFSet.{u} → ZFSet.{u}} [Definable₁ f] {x y : ZFSet.{u}} (h : y ∈ x) : (ZFSet.map f x ′ y : Class.{u}) = f y := Class.iota_val _ _ fun z => by - rw [Class.toSet_of_ZFSet, Class.coe_apply, mem_map] + erw [Class.toSet_of_ZFSet] + rw [Class.coe_apply, mem_map] exact ⟨fun ⟨w, _, pr⟩ => by let ⟨wy, fw⟩ := ZFSet.pair_injective pr diff --git a/Mathlib/SetTheory/ZFC/Ordinal.lean b/Mathlib/SetTheory/ZFC/Ordinal.lean index 00ccaf89956172..80c4afe01bd742 100644 --- a/Mathlib/SetTheory/ZFC/Ordinal.lean +++ b/Mathlib/SetTheory/ZFC/Ordinal.lean @@ -396,6 +396,7 @@ theorem isOrdinal_iff_mem_range_toZFSet {x : ZFSet.{u}} : · rintro ⟨a, rfl⟩ exact isOrdinal_toZFSet a +set_option backward.isDefEq.respectTransparency false in /-- `Ordinal` is order-equivalent to the type of von Neumann ordinals. -/ @[simps apply symm_apply] noncomputable def _root_.Ordinal.toZFSetIso : Ordinal ≃o {x // ZFSet.IsOrdinal x} where diff --git a/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Corecursion.lean b/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Corecursion.lean index a8026834e7d9d0..5e2edc304a3555 100644 --- a/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Corecursion.lean +++ b/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Corecursion.lean @@ -83,6 +83,7 @@ noncomputable local instance : MetricSpace (Seq α) := local instance : CompleteSpace (Stream' α) := @PiNat.completeSpace _ (fun _ ↦ ⊥) (fun _ ↦ discreteTopology_bot _) +set_option backward.isDefEq.respectTransparency false in local instance : CompleteSpace (Seq α) := by suffices IsClosed (X := Stream' (Option α)) (fun x ↦ ∀ {n : ℕ}, x n = none → x (n + 1) = none) by @@ -234,6 +235,7 @@ theorem exists_fixed_point_of_contractible (F : (β →ᵤ Seq α) → (β → use f exact hF.fixedPoint_isFixedPt +set_option backward.isDefEq.respectTransparency false in /-- Main theorem of this file. It shows that there exists a function satisfying the corecursive definition of the form `def foo (x : X) := hd x :: op (foo (tlArg x))` where `f` is friendly. -/ theorem FriendlyOperation.exists_fixed_point (F : β → Option (α × γ × β)) (op : γ → Seq α → Seq α) diff --git a/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Defs.lean b/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Defs.lean index 679aeb0a673580..8ef55bfa20ae20 100644 --- a/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Defs.lean +++ b/Mathlib/Tactic/ComputeAsymptotics/Multiseries/Defs.lean @@ -131,6 +131,7 @@ def corec {β : Type*} {basis_hd} {basis_tl} Multiseries basis_hd basis_tl := Seq.corec (fun a => (f a).map (fun (exp, coef, next) => ((exp, coef), next))) b +set_option backward.isDefEq.respectTransparency false in private lemma destruct_eq_destruct_map {basis_hd basis_tl} (s : Stream'.Seq (ℝ × MultiseriesExpansion basis_tl)) : s.destruct = (Multiseries.destruct (basis_hd := basis_hd) s).map @@ -221,6 +222,7 @@ theorem destruct_eq_none {basis_hd : ℝ → ℝ} {basis_tl : Basis} {ms : Multi apply Stream'.Seq.destruct_eq_none simpa [destruct] using h +set_option backward.isDefEq.respectTransparency false in theorem destruct_eq_cons {basis_hd : ℝ → ℝ} {basis_tl : Basis} {ms : Multiseries basis_hd basis_tl} {exp : ℝ} {coef : MultiseriesExpansion basis_tl} {tl : Multiseries basis_hd basis_tl} (h : destruct ms = some (exp, coef, tl)) : ms = cons exp coef tl := by @@ -233,6 +235,7 @@ theorem head_nil {basis_hd : ℝ → ℝ} {basis_tl : Basis} : (nil : Multiseries basis_hd basis_tl).head = none := by simp [head, nil] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem head_cons {basis_hd : ℝ → ℝ} {basis_tl : Basis} {exp : ℝ} {coef : MultiseriesExpansion basis_tl} @@ -240,11 +243,13 @@ theorem head_cons {basis_hd : ℝ → ℝ} {basis_tl : Basis} {exp : ℝ} (cons exp coef tl).head = some (exp, coef) := by simp [head, cons] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem tail_nil {basis_hd : ℝ → ℝ} {basis_tl : Basis} : (nil : Multiseries basis_hd basis_tl).tail = nil := by simp [tail, nil] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem tail_cons {basis_hd : ℝ → ℝ} {basis_tl : Basis} {exp : ℝ} {coef : MultiseriesExpansion basis_tl} @@ -252,12 +257,14 @@ theorem tail_cons {basis_hd : ℝ → ℝ} {basis_tl : Basis} {exp : ℝ} (cons exp coef tl).tail = tl := by simp [tail, cons] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_nil {basis_hd basis_tl basis_hd' basis_tl'} (f : ℝ → ℝ) (g : MultiseriesExpansion basis_tl → MultiseriesExpansion basis_tl') : (nil : Multiseries basis_hd basis_tl).map f g = (nil : Multiseries basis_hd' basis_tl') := by simp [map, nil] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem map_cons {basis_hd basis_tl basis_hd' basis_tl'} (f : ℝ → ℝ) (g : MultiseriesExpansion basis_tl → MultiseriesExpansion basis_tl') {exp : ℝ} @@ -271,6 +278,7 @@ theorem map_id {basis_hd basis_tl} (ms : Multiseries basis_hd basis_tl) : ms.map (fun exp => exp) (fun coef => coef) = ms := Stream'.Seq.map_id ms +set_option backward.isDefEq.respectTransparency false in @[simp← ] theorem map_comp {b₁ b₂ b₃ bs₁ bs₂ bs₃} (f₁ : ℝ → ℝ) (g₁ : MultiseriesExpansion bs₁ → MultiseriesExpansion bs₂) @@ -514,6 +522,7 @@ theorem cons {basis_hd basis_tl} {exp : ℝ} {coef : MultiseriesExpansion basis_ · exact Seq.Pairwise_cons_nil · exact h_tl_tl.cons_cons_of_trans (by simpa [lt_iff_lt] using h_comp) +set_option backward.isDefEq.respectTransparency.types false in /-- If `cons (exp, coef) tl` is `Sorted`, then `coef` and `tl` are `Sorted`, and the leading exponent of `tl` is less than `exp`. -/ theorem elim_cons {basis_hd basis_tl} {exp : ℝ} {coef : MultiseriesExpansion basis_tl} diff --git a/Mathlib/Tactic/FieldSimp.lean b/Mathlib/Tactic/FieldSimp.lean index c1313ce98e51cb..b1b142ff47596e 100644 --- a/Mathlib/Tactic/FieldSimp.lean +++ b/Mathlib/Tactic/FieldSimp.lean @@ -124,6 +124,7 @@ def split (iM : Q(CommGroupWithZero $M)) (l : qNF M) : let r' : ℤ := -r return ⟨t_n, ((r', x), i) :: t_d, (q(NF.cons_eq_div_of_eq_div' $r' $x $pf):)⟩ +set_option backward.isDefEq.respectTransparency false in private def evalPrettyAux (iM : Q(CommGroupWithZero $M)) (l : qNF M) : MetaM (Σ e : Q($M), Q(NF.eval $(l.toNF) = $e)) := do match l with diff --git a/Mathlib/Tactic/FieldSimp/Lemmas.lean b/Mathlib/Tactic/FieldSimp/Lemmas.lean index 199a56299f0412..719d230c1c4d1e 100644 --- a/Mathlib/Tactic/FieldSimp/Lemmas.lean +++ b/Mathlib/Tactic/FieldSimp/Lemmas.lean @@ -201,6 +201,7 @@ the corresponding `ℤ` term, then multiply them all together. -/ noncomputable def eval [GroupWithZero M] (l : NF M) : M := (l.map (fun (⟨r, x⟩ : ℤ × M) ↦ zpow' x r)).prod +set_option backward.isDefEq.respectTransparency false in @[simp] theorem eval_cons [CommGroupWithZero M] (p : ℤ × M) (l : NF M) : (p ::ᵣ l).eval = l.eval * zpow' p.2 p.1 := by unfold eval cons @@ -314,6 +315,7 @@ theorem cons_zero_eq_div_of_eq_div [CommGroupWithZero M] (e : M) {t t_n t_d : NF instance : Inv (NF M) where inv l := l.map fun (a, x) ↦ (-a, x) +set_option backward.isDefEq.respectTransparency false in theorem eval_inv [CommGroupWithZero M] (l : NF M) : (l⁻¹).eval = l.eval⁻¹ := by simp +instances only [NF.eval, List.map_map, NF.instInv, List.prod_inv] congr! 2 @@ -332,6 +334,7 @@ instance : Pow (NF M) ℤ where @[simp] theorem zpow_apply (r : ℤ) (l : NF M) : l ^ r = l.map fun (a, x) ↦ (r * a, x) := rfl +set_option backward.isDefEq.respectTransparency false in theorem eval_zpow' [CommGroupWithZero M] (l : NF M) (r : ℤ) : (l ^ r).eval = zpow' l.eval r := by unfold NF.eval at ⊢ diff --git a/Mathlib/Tactic/Inhabit.lean b/Mathlib/Tactic/Inhabit.lean index 4fcfbe7af2d1b0..0e3a5d77b7ee38 100644 --- a/Mathlib/Tactic/Inhabit.lean +++ b/Mathlib/Tactic/Inhabit.lean @@ -20,13 +20,13 @@ open Lean.Meta namespace Lean.Elab.Tactic /-- Derives `Inhabited α` from `Nonempty α` with `Classical.choice`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def nonempty_to_inhabited (α : Sort*) (_ : Nonempty α) : Inhabited α := Inhabited.mk (Classical.ofNonempty) /-- Derives `Inhabited α` from `Nonempty α` without `Classical.choice` assuming `α` is of type `Prop`. -/ -@[implicit_reducible] +@[instance_reducible] def nonempty_prop_to_inhabited (α : Prop) (α_nonempty : Nonempty α) : Inhabited α := Inhabited.mk <| Nonempty.elim α_nonempty id diff --git a/Mathlib/Tactic/Module.lean b/Mathlib/Tactic/Module.lean index ea19a03a9a39ae..cf5aa2f6a6592e 100644 --- a/Mathlib/Tactic/Module.lean +++ b/Mathlib/Tactic/Module.lean @@ -138,6 +138,7 @@ theorem sub_eq_eval {R₁ R₂ S₁ S₂ : Type*} [AddCommGroup M] [Ring R] [Mod instance [Neg R] : Neg (NF R M) where neg l := l.map fun (a, x) ↦ (-a, x) +set_option backward.isDefEq.respectTransparency false in theorem eval_neg [AddCommGroup M] [Ring R] [Module R M] (l : NF R M) : (-l).eval = - l.eval := by simp +instances only [NF.eval, List.map_map, List.sum_neg, NF.instNeg] congr @@ -159,6 +160,7 @@ instance [Mul R] : SMul R (NF R M) where @[simp] theorem smul_apply [Mul R] (r : R) (l : NF R M) : r • l = l.map fun (a, x) ↦ (r * a, x) := rfl +set_option backward.isDefEq.respectTransparency false in theorem eval_smul [AddCommMonoid M] [Semiring R] [Module R M] {l : NF R M} {x : M} (h : x = l.eval) (r : R) : (r • l).eval = r • x := by unfold NF.eval at h ⊢ @@ -204,6 +206,7 @@ commutative semiring, by applying to each `S`-component the algebra-map from `S` def algebraMap [CommSemiring S] [Semiring R] [Algebra S R] (l : NF S M) : NF R M := l.map (fun ⟨s, x⟩ ↦ (Algebra.algebraMap S R s, x)) +set_option backward.isDefEq.respectTransparency false in theorem eval_algebraMap [CommSemiring S] [Semiring R] [Algebra S R] [AddMonoid M] [SMul S M] [MulAction R M] [IsScalarTower S R M] (l : NF S M) : (l.algebraMap R).eval = l.eval := by @@ -254,6 +257,7 @@ def onScalar {u₁ u₂ : Level} {R₁ : Q(Type u₁)} {R₂ : Q(Type u₂)} (l qNF R₂ M := l.map fun ((a, x), k) ↦ ((q($f $a), x), k) +set_option backward.isDefEq.respectTransparency false in /-- Given two terms `l₁`, `l₂` of type `qNF R M`, i.e. lists of `(Q($R) × Q($M)) × ℕ`s (two `Expr`s and a natural number), construct another such term `l`, which will have the property that in the `$R`-module `$M`, the sum of the "linear combinations" represented by `l₁` and `l₂` is the linear @@ -277,6 +281,7 @@ meta def add (iR : Q(Semiring $R)) : qNF R M → qNF R M → qNF R M else ((a₂, x₂), k₂) ::ᵣ add iR (((a₁, x₁), k₁) ::ᵣ t₁) t₂ +set_option backward.isDefEq.respectTransparency false in /-- Given two terms `l₁`, `l₂` of type `qNF R M`, i.e. lists of `(Q($R) × Q($M)) × ℕ`s (two `Expr`s and a natural number), recursively construct a proof that in the `$R`-module `$M`, the sum of the "linear combinations" represented by `l₁` and `l₂` is the linear combination represented by @@ -298,6 +303,7 @@ meta def mkAddProof {iR : Q(Semiring $R)} {iM : Q(AddCommMonoid $M)} (iRM : Q(Mo let pf := mkAddProof iRM (((a₁, x₁), k₁) ::ᵣ t₁) t₂ (q(NF.add_eq_eval₃ ($a₂, $x₂) $pf):) +set_option backward.isDefEq.respectTransparency false in /-- Given two terms `l₁`, `l₂` of type `qNF R M`, i.e. lists of `(Q($R) × Q($M)) × ℕ`s (two `Expr`s and a natural number), construct another such term `l`, which will have the property that in the `$R`-module `$M`, the difference of the "linear combinations" represented by `l₁` and `l₂` is the @@ -322,6 +328,7 @@ def sub (iR : Q(Ring $R)) : qNF R M → qNF R M → qNF R M else ((q(-$a₂), x₂), k₂) ::ᵣ sub iR (((a₁, x₁), k₁) ::ᵣ t₁) t₂ +set_option backward.isDefEq.respectTransparency false in /-- Given two terms `l₁`, `l₂` of type `qNF R M`, i.e. lists of `(Q($R) × Q($M)) × ℕ`s (two `Expr`s and a natural number), recursively construct a proof that in the `$R`-module `$M`, the difference of the "linear combinations" represented by `l₁` and `l₂` is the linear combination represented by diff --git a/Mathlib/Tactic/NormNum/Basic.lean b/Mathlib/Tactic/NormNum/Basic.lean index 46aa1041bbda80..75d94adc7e7ec4 100644 --- a/Mathlib/Tactic/NormNum/Basic.lean +++ b/Mathlib/Tactic/NormNum/Basic.lean @@ -32,7 +32,7 @@ universe u namespace Mathlib.Meta.NormNum /-- If `b` divides `a` and `a` is invertible, then `b` is invertible. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfMul {α} [Semiring α] (k : ℕ) (b : α) : ∀ (a : α) [Invertible a], a = k * b → Invertible b | _, ⟨c, hc1, hc2⟩, rfl => by @@ -41,7 +41,7 @@ def invertibleOfMul {α} [Semiring α] (k : ℕ) (b : α) : exact ⟨_, hc1, hc2⟩ /-- If `b` divides `a` and `a` is invertible, then `b` is invertible. -/ -@[implicit_reducible] +@[instance_reducible] def invertibleOfMul' {α} [Semiring α] {a k b : ℕ} [Invertible (a : α)] (h : a = k * b) : Invertible (b : α) := invertibleOfMul k (b:α) ↑a (by simp [h]) diff --git a/Mathlib/Tactic/NormNum/Result.lean b/Mathlib/Tactic/NormNum/Result.lean index b6490c4e9d0e69..6195bfcd8d1b34 100644 --- a/Mathlib/Tactic/NormNum/Result.lean +++ b/Mathlib/Tactic/NormNum/Result.lean @@ -41,11 +41,11 @@ variable {u : Level} /-- A shortcut (non)instance for `AddMonoidWithOne α` from `Semiring α` to shrink generated proofs. -/ -@[implicit_reducible] +@[instance_reducible] def instAddMonoidWithOne' {α : Type u} [Semiring α] : AddMonoidWithOne α := inferInstance /-- A shortcut (non)instance for `AddMonoidWithOne α` from `Ring α` to shrink generated proofs. -/ -@[implicit_reducible] +@[instance_reducible] def instAddMonoidWithOne {α : Type u} [Ring α] : AddMonoidWithOne α := inferInstance /-- A shortcut (non)instance for `Nat.AtLeastTwo (n + 2)` to shrink generated proofs. -/ diff --git a/Mathlib/Tactic/PNatToNat.lean b/Mathlib/Tactic/PNatToNat.lean index 2d53a471c69325..c4576d1f2c99b4 100644 --- a/Mathlib/Tactic/PNatToNat.lean +++ b/Mathlib/Tactic/PNatToNat.lean @@ -57,6 +57,7 @@ lemma coe_lt_coe (m n : PNat) : m < n ↔ (m : ℕ) < (n : ℕ) := by simp attribute [pnat_to_nat_coe] PNat.add_coe PNat.mul_coe PNat.val_ofNat +set_option backward.isDefEq.respectTransparency false in @[pnat_to_nat_coe] lemma sub_coe (a b : PNat) : ((a - b : PNat) : Nat) = a.val - 1 - b.val + 1 := by cases a diff --git a/Mathlib/Tactic/Simps/Basic.lean b/Mathlib/Tactic/Simps/Basic.lean index e5d66162402c6b..36af2ff5045ed2 100644 --- a/Mathlib/Tactic/Simps/Basic.lean +++ b/Mathlib/Tactic/Simps/Basic.lean @@ -1022,6 +1022,7 @@ def addProjection (declName : Name) (type lhs rhs : Expr) (args : Array Expr) throwError "simps tried to add lemma{indentD m!"{.ofConstName declName} : {declType}"}\n\ to the environment, but it already exists." trace[simps.verbose] "adding projection {declName}:{indentExpr declType}" + Mathlib.Tactic.warnIfImplicitIllTyped ref declName declType prependError "Failed to add projection lemma {declName}:" do addDecl <| .thmDecl { name := declName diff --git a/Mathlib/Tactic/Translate/Core.lean b/Mathlib/Tactic/Translate/Core.lean index cde6bf01848578..90250aba2fe49f 100644 --- a/Mathlib/Tactic/Translate/Core.lean +++ b/Mathlib/Tactic/Translate/Core.lean @@ -860,9 +860,11 @@ partial def transformDeclRec (t : TranslateData) (cfg : Config) (rootSrc rootTgt def copyInstanceAttribute (src tgt : Name) : CoreM Unit := do if let some prio ← getInstancePriority? src then let attr_kind := (← getInstanceAttrKind? src).getD .global - -- Copy implicit_reducible status before adding instance attribute - if (← getReducibilityStatus src) matches .implicitReducible then - setReducibilityStatus tgt .implicitReducible + -- Copy `instance_reducible` / `instance_reducible` status before adding instance attribute + match (← getReducibilityStatus src) with + | .implicitReducible => setReducibilityStatus tgt .implicitReducible + | .instanceReducible => setReducibilityStatus tgt .instanceReducible + | _ => pure () trace[translate_detail] "Making {tgt} an instance with priority {prio}." addInstance tgt attr_kind prio |>.run' diff --git a/Mathlib/Testing/Plausible/Functions.lean b/Mathlib/Testing/Plausible/Functions.lean index 0362f865d835e6..b5d2e6cdc9b40b 100644 --- a/Mathlib/Testing/Plausible/Functions.lean +++ b/Mathlib/Testing/Plausible/Functions.lean @@ -230,7 +230,9 @@ theorem applyId_mem_iff [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs | cons x' xs xs_ih => rcases ys with - | ⟨y, ys⟩ · cases h₃ - dsimp [List.dlookup] at h₃; split_ifs at h₃ with h + simp only [zip_cons_cons, map_cons, Prod.toSigma_mk, dlookup, eq_rec_constant, + dite_eq_ite] at h₃ + split_ifs at h₃ with h · rw [Option.some_inj] at h₃ subst x'; subst val simp only [List.mem_cons, true_or] diff --git a/Mathlib/Topology/Algebra/Affine.lean b/Mathlib/Topology/Algebra/Affine.lean index 0fc8537c1f8e89..b2bb1e59f07650 100644 --- a/Mathlib/Topology/Algebra/Affine.lean +++ b/Mathlib/Topology/Algebra/Affine.lean @@ -55,6 +55,7 @@ theorem isOpenMap_linear_iff {f : P →ᵃ[R] Q} : IsOpenMap f.linear ↔ IsOpen variable [TopologicalSpace R] [ContinuousSMul R V] +set_option backward.isDefEq.respectTransparency false in /-- The line map is continuous in all arguments. -/ @[continuity, fun_prop] theorem lineMap_continuous_uncurry : @@ -73,6 +74,7 @@ section Tendsto variable {α : Type*} {l : Filter α} +set_option backward.isDefEq.respectTransparency false in theorem _root_.Filter.Tendsto.lineMap {f₁ f₂ : α → P} {g : α → R} {p₁ p₂ : P} {c : R} (h₁ : Tendsto f₁ l (𝓝 p₁)) (h₂ : Tendsto f₂ l (𝓝 p₂)) (hg : Tendsto g l (𝓝 c)) : Tendsto (fun x => AffineMap.lineMap (f₁ x) (f₂ x) (g x)) l (𝓝 <| AffineMap.lineMap p₁ p₂ c) := @@ -87,22 +89,26 @@ end Tendsto variable {X : Type*} [TopologicalSpace X] {f₁ f₂ : X → P} {g : X → R} {s : Set X} {x : X} +set_option backward.isDefEq.respectTransparency false in @[fun_prop] theorem _root_.ContinuousWithinAt.lineMap (h₁ : ContinuousWithinAt f₁ s x) (h₂ : ContinuousWithinAt f₂ s x) (hg : ContinuousWithinAt g s x) : ContinuousWithinAt (fun x ↦ lineMap (f₁ x) (f₂ x) (g x)) s x := Tendsto.lineMap h₁ h₂ hg +set_option backward.isDefEq.respectTransparency false in theorem _root_.ContinuousAt.lineMap (h₁ : ContinuousAt f₁ x) (h₂ : ContinuousAt f₂ x) (hg : ContinuousAt g x) : ContinuousAt (fun x ↦ lineMap (f₁ x) (f₂ x) (g x)) x := by fun_prop +set_option backward.isDefEq.respectTransparency false in theorem _root_.ContinuousOn.lineMap (h₁ : ContinuousOn f₁ s) (h₂ : ContinuousOn f₂ s) (hg : ContinuousOn g s) : ContinuousOn (fun x ↦ lineMap (f₁ x) (f₂ x) (g x)) s := by fun_prop +set_option backward.isDefEq.respectTransparency false in theorem _root_.Continuous.lineMap (h₁ : Continuous f₁) (h₂ : Continuous f₂) (hg : Continuous g) : Continuous (fun x ↦ lineMap (f₁ x) (f₂ x) (g x)) := by diff --git a/Mathlib/Topology/Algebra/AffineSubspace.lean b/Mathlib/Topology/Algebra/AffineSubspace.lean index eb390c38681362..013faeb04473a8 100644 --- a/Mathlib/Topology/Algebra/AffineSubspace.lean +++ b/Mathlib/Topology/Algebra/AffineSubspace.lean @@ -51,6 +51,7 @@ instance {s : AffineSubspace R P} [Nonempty s] : IsTopologicalAddTorsor s where rw [Topology.IsEmbedding.subtypeVal.continuous_iff] fun_prop +set_option backward.isDefEq.respectTransparency false in theorem isClosed_direction_iff [T1Space V] (s : AffineSubspace R P) : IsClosed (s.direction : Set V) ↔ IsClosed (s : Set P) := by rcases s.eq_bot_or_nonempty with (rfl | ⟨x, hx⟩); · simp diff --git a/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Completion.lean b/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Completion.lean index b148f05cb044f6..43a606acf70c44 100644 --- a/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Completion.lean +++ b/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Completion.lean @@ -152,6 +152,7 @@ def lift (f : G ⟶ GrpCat.of P) : completion G ⟶ P := exact this }⟩ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma lift_eta (f : G ⟶ GrpCat.of P) : eta G ≫ (forget₂ _ _).map (lift f) = f := by diff --git a/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Limits.lean b/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Limits.lean index 8c314bc61cabf3..8f7b91938e282a 100644 --- a/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Limits.lean +++ b/Mathlib/Topology/Algebra/Category/ProfiniteGrp/Limits.lean @@ -143,6 +143,7 @@ noncomputable def isoLimittoFiniteQuotientFunctor (P : ProfiniteGrp.{u}) : P ≅ (limit <| diagram P) := ContinuousMulEquiv.toProfiniteGrpIso (continuousMulEquivLimittoFiniteQuotientFunctor P) +set_option backward.isDefEq.respectTransparency.types false in /-- The projection from `P` to the quotient by an open normal subgroup. -/ def proj {P : ProfiniteGrp.{u}} (U : OpenNormalSubgroup P) : P ⟶ (diagram P).obj U := ProfiniteGrp.ofHom (Y := (diagram P).obj U) { @@ -153,12 +154,14 @@ def proj {P : ProfiniteGrp.{u}} (U : OpenNormalSubgroup P) : P ⟶ (diagram P).o fun_prop } +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical cone over `diagram P` with point `P`. -/ @[simps] def cone (P : ProfiniteGrp.{u}) : Limits.Cone (diagram P) where pt := P π := { app := proj } +set_option backward.isDefEq.respectTransparency.types false in /-- The canonical cone over `diagram P` is a limit cone. -/ noncomputable def isLimitCone (P : ProfiniteGrp.{u}) : Limits.IsLimit P.cone := Limits.IsLimit.ofIsoLimit (limitConeIsLimit _) <| .symm <| diff --git a/Mathlib/Topology/Algebra/ContinuousAffineMap.lean b/Mathlib/Topology/Algebra/ContinuousAffineMap.lean index 7b17d45f64d353..e08661d0f94e04 100644 --- a/Mathlib/Topology/Algebra/ContinuousAffineMap.lean +++ b/Mathlib/Topology/Algebra/ContinuousAffineMap.lean @@ -149,6 +149,7 @@ theorem comp_id (f : P →ᴬ[R] Q) : f.comp (id R P) = f := theorem id_comp (f : P →ᴬ[R] Q) : (id R Q).comp f = f := ext fun _ => rfl +set_option backward.isDefEq.respectTransparency false in /-- Applying a `ContinuousAffineMap` commutes with `AffineMap.lineMap`. -/ @[simp] theorem apply_lineMap (f : P →ᴬ[R] Q) (p₀ p₁ : P) (c : R) : @@ -165,10 +166,12 @@ def lineMap (p₀ p₁ : P) [TopologicalSpace R] [TopologicalSpace V] [ContinuousSMul R V] [ContinuousVAdd V P] : (lineMap p₀ p₁).toAffineMap = AffineMap.lineMap (k := R) p₀ p₁ := rfl +set_option backward.isDefEq.respectTransparency false in lemma coe_lineMap_eq (p₀ p₁ : P) [TopologicalSpace R] [TopologicalSpace V] [ContinuousSMul R V] [ContinuousVAdd V P] : ⇑(ContinuousAffineMap.lineMap p₀ p₁) = ⇑(AffineMap.lineMap (k := R) p₀ p₁) := rfl +set_option backward.isDefEq.respectTransparency false in /-- Applying a `ContinuousAffineMap` commutes with `ContinuousAffineMap.lineMap`. -/ @[simp] theorem apply_lineMap' [TopologicalSpace R] [TopologicalSpace V] [TopologicalSpace W] @@ -367,6 +370,7 @@ instance : AddTorsor (P →ᴬ[R] W) (P →ᴬ[R] Q) where (f -ᵥ g).toAffineMap = f.toAffineMap -ᵥ g.toAffineMap := rfl +set_option backward.isDefEq.respectTransparency false in /-- Interpolating between `ContinuousAffineMap`s with `AffineMap.lineMap` commutes with evaluation. -/ @[simp] @@ -516,6 +520,7 @@ theorem decompEquiv_symm_apply (p : Q × (V →L[R] W)) (x : V) : (decompEquiv R V Q).symm p x = p.2 x +ᵥ p.1 := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem decompEquiv_symm_contLinear (p : Q × (V →L[R] W)) : ((decompEquiv R V Q).symm p).contLinear = p.2 := by @@ -551,6 +556,7 @@ theorem decompLinearEquiv_symm_apply (p : W × (V →L[R] W)) (x : V) : (decompLinearEquiv R S V W).symm p x = p.2 x + p.1 := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem decompLinearEquiv_symm_contLinear (p : W × (V →L[R] W)) : ((decompLinearEquiv R S V W).symm p).contLinear = p.2 := by diff --git a/Mathlib/Topology/Algebra/Field.lean b/Mathlib/Topology/Algebra/Field.lean index e059ae0495eff6..d845ce19acadad 100644 --- a/Mathlib/Topology/Algebra/Field.lean +++ b/Mathlib/Topology/Algebra/Field.lean @@ -125,24 +125,28 @@ def affineHomeomorph (a b : 𝕜) (h : a ≠ 0) : 𝕜 ≃ₜ 𝕜 where exact mul_div_cancel_left₀ x h right_inv y := by simp [mul_div_cancel₀ _ h] +set_option backward.isDefEq.respectTransparency false in theorem affineHomeomorph_image_Icc {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [TopologicalSpace 𝕜] [IsTopologicalRing 𝕜] (a b c d : 𝕜) (h : 0 < a) : affineHomeomorph a b h.ne' '' Set.Icc c d = Set.Icc (a * c + b) (a * d + b) := by simp [h] +set_option backward.isDefEq.respectTransparency false in theorem affineHomeomorph_image_Ico {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [TopologicalSpace 𝕜] [IsTopologicalRing 𝕜] (a b c d : 𝕜) (h : 0 < a) : affineHomeomorph a b h.ne' '' Set.Ico c d = Set.Ico (a * c + b) (a * d + b) := by simp [h] +set_option backward.isDefEq.respectTransparency false in theorem affineHomeomorph_image_Ioc {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [TopologicalSpace 𝕜] [IsTopologicalRing 𝕜] (a b c d : 𝕜) (h : 0 < a) : affineHomeomorph a b h.ne' '' Set.Ioc c d = Set.Ioc (a * c + b) (a * d + b) := by simp [h] +set_option backward.isDefEq.respectTransparency false in theorem affineHomeomorph_image_Ioo {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [TopologicalSpace 𝕜] [IsTopologicalRing 𝕜] (a b c d : 𝕜) (h : 0 < a) : diff --git a/Mathlib/Topology/Algebra/FilterBasis.lean b/Mathlib/Topology/Algebra/FilterBasis.lean index fa2f92fdcbbf81..4f5c8095cfb61e 100644 --- a/Mathlib/Topology/Algebra/FilterBasis.lean +++ b/Mathlib/Topology/Algebra/FilterBasis.lean @@ -67,7 +67,7 @@ class AddGroupFilterBasis (A : Type u) [AddGroup A] extends FilterBasis A where attribute [to_additive] GroupFilterBasis /-- `GroupFilterBasis` constructor in the commutative group case. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- `AddGroupFilterBasis` constructor in the additive commutative group case. -/] def groupFilterBasisOfComm {G : Type*} [CommGroup G] (sets : Set (Set G)) (nonempty : sets.Nonempty) (inter_sets : ∀ x y, x ∈ sets → y ∈ sets → ∃ z ∈ sets, z ⊆ x ∩ y) @@ -138,7 +138,7 @@ protected theorem hasBasis (B : GroupFilterBasis G) (x : G) : HasBasis.map (fun y ↦ x * y) toFilterBasis.hasBasis /-- The topological space structure coming from a group filter basis. -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The topological space structure coming from an additive group filter basis. -/] def topology (B : GroupFilterBasis G) : TopologicalSpace G := TopologicalSpace.mkOfNhds B.N @@ -255,7 +255,7 @@ theorem mul_right (x₀ : R) {U : Set R} (hU : U ∈ B) : ∃ V ∈ B, V ⊆ (fu /-- The topology associated to a ring filter basis. It has the given basis as a basis of neighborhoods of zero. -/ -@[implicit_reducible] +@[instance_reducible] def topology : TopologicalSpace R := B.toAddGroupFilterBasis.topology @@ -337,14 +337,14 @@ instance [DiscreteTopology R] : Inhabited (ModuleFilterBasis R M) := /-- The topology associated to a module filter basis on a module over a topological ring. It has the given basis as a basis of neighborhoods of zero. -/ -@[implicit_reducible] +@[instance_reducible] def topology : TopologicalSpace M := B.toAddGroupFilterBasis.topology /-- The topology associated to a module filter basis on a module over a topological ring. It has the given basis as a basis of neighborhoods of zero. This version gets the ring topology by unification instead of type class inference. -/ -@[implicit_reducible] +@[instance_reducible] def topology' {R M : Type*} [CommRing R] {_ : TopologicalSpace R} [AddCommGroup M] [Module R M] (B : ModuleFilterBasis R M) : TopologicalSpace M := B.toAddGroupFilterBasis.topology diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Basic.lean b/Mathlib/Topology/Algebra/InfiniteSum/Basic.lean index 78da28610a3f9e..2c8db09f1ea7ae 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Basic.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Basic.lean @@ -136,6 +136,7 @@ protected theorem Set.Finite.multipliable {s : Set β} (hs : s.Finite) (f : β have := hs.toFinset.multipliable f rwa [hs.coe_toFinset] at this +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem multipliable_of_hasFiniteMulSupport [L.HasSupport] (h : HasFiniteMulSupport f) : Multipliable f L := by diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean b/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean index 01c9ccbcfcd3fa..dd1b6e75e08cda 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean @@ -269,6 +269,7 @@ theorem Finset.hasProd_support (s : Finset β) (f : β → α) (L := uncondition (∏ b ∈ (L.support.toFinset.map <| Embedding.subtype _), f b) L := by simpa [prod_attach] using hasProd_fintype_support (f ∘ Subtype.val) L +set_option backward.isDefEq.respectTransparency false in -- note this is not deduced from `Finset.hasProd_support` to avoid needing `[DecidableEq β]` @[to_additive] protected theorem Finset.hasProd (s : Finset β) (f : β → α) diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Group.lean b/Mathlib/Topology/Algebra/InfiniteSum/Group.lean index 59d7d6eb32c464..725c5c83ccc295 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Group.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Group.lean @@ -447,6 +447,7 @@ protected lemma Multipliable.tsum_congr_cofinite₀ [T2Space K] (hc : Multipliab ∏' i, g i = ((∏' i, f i) * ((∏ i ∈ s, g i) / ∏ i ∈ s, f i)) := (hc.hasProd.congr_cofinite₀ hs hs').tprod_eq +set_option backward.isDefEq.respectTransparency false in /-- See also `Multipliable.congr_cofinite`, which does not have a non-vanishing condition, but instead requires the target to be a group under multiplication (and hence fails for infinite products in a diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Nonarchimedean.lean b/Mathlib/Topology/Algebra/InfiniteSum/Nonarchimedean.lean index 42bebd49e33c29..ed41f5f27c51fa 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Nonarchimedean.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Nonarchimedean.lean @@ -34,6 +34,7 @@ namespace NonarchimedeanGroup variable {α G : Type*} variable [CommGroup G] [UniformSpace G] [IsUniformGroup G] [NonarchimedeanGroup G] +set_option backward.isDefEq.respectTransparency false in /-- Let `G` be a nonarchimedean multiplicative abelian group, and let `f : α → G` be a function that tends to one on the filter of cofinite sets. For each finite subset of `α`, consider the partial product of `f` on that subset. These partial products form a Cauchy filter. -/ diff --git a/Mathlib/Topology/Algebra/IsUniformGroup/Defs.lean b/Mathlib/Topology/Algebra/IsUniformGroup/Defs.lean index 84a576206c5621..9b823a8c0cf450 100644 --- a/Mathlib/Topology/Algebra/IsUniformGroup/Defs.lean +++ b/Mathlib/Topology/Algebra/IsUniformGroup/Defs.lean @@ -596,7 +596,7 @@ Warning: in general the right and left uniformities do not coincide and so one d `IsUniformGroup` structure. Two important special cases where they _do_ coincide are for commutative groups (see `isUniformGroup_of_commGroup`) and for compact groups (see `IsUniformGroup.of_compactSpace`). -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The right uniformity on a topological additive group (as opposed to the left uniformity). @@ -639,7 +639,7 @@ Warning: in general the right and left uniformities do not coincide and so one d `IsUniformGroup` structure. Two important special cases where they _do_ coincide are for commutative groups (see `isUniformGroup_of_commGroup`) and for compact groups (see `IsUniformGroup.of_compactSpace`). -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The left uniformity on a topological additive group (as opposed to the right uniformity). diff --git a/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean b/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean index a77292075775c4..d2d23de4d8159a 100644 --- a/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean +++ b/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean @@ -23,6 +23,8 @@ open Filter Topology Uniformity variable {G : Type*} [Group G] [TopologicalSpace G] +-- TODO: `respectTransparency.types false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in /-- If `G` has a topology, and `H ≤ K` are subgroups, then `H` as a subgroup of `K` is isomorphic, as a topological group, to `H` as a subgroup of `G`. This is `subgroupOfEquivOfLe` upgraded to a `ContinuousMulEquiv`. -/ diff --git a/Mathlib/Topology/Algebra/LinearMapCompletion.lean b/Mathlib/Topology/Algebra/LinearMapCompletion.lean index 9506ff449605a0..d7228d4bd5b9ef 100644 --- a/Mathlib/Topology/Algebra/LinearMapCompletion.lean +++ b/Mathlib/Topology/Algebra/LinearMapCompletion.lean @@ -31,6 +31,7 @@ variable {α β : Type*} {R₁ R₂ : Type*} [UniformSpace α] [AddCommGroup α] [AddCommGroup β] [IsUniformAddGroup β] [Module R₂ β] [UniformContinuousConstSMul R₂ β] {σ : R₁ →+* R₂} +set_option backward.isDefEq.respectTransparency false in /-- Lift a continuous semilinear map to a continuous semilinear map between the `UniformSpace.Completion`s of the spaces. This is `UniformSpace.Completion.map` bundled as a diff --git a/Mathlib/Topology/Algebra/LinearTopology.lean b/Mathlib/Topology/Algebra/LinearTopology.lean index 084f5178004d5d..4281badcc5b39e 100644 --- a/Mathlib/Topology/Algebra/LinearTopology.lean +++ b/Mathlib/Topology/Algebra/LinearTopology.lean @@ -292,6 +292,7 @@ theorem hasBasis_right_ideal [IsLinearTopology Rᵐᵒᵖ R] : (𝓝 0).HasBasis (fun I : Submodule Rᵐᵒᵖ R ↦ (I : Set R) ∈ 𝓝 0) (fun I ↦ (I : Set R)) := hasBasis_submodule Rᵐᵒᵖ +set_option backward.isDefEq.respectTransparency false in open Set Pointwise in /-- If a ring `R` is linearly ordered as a left *and* right module over itself, then it has a basis of neighborhoods of zero made of *two-sided* ideals. diff --git a/Mathlib/Topology/Algebra/Module/Complement.lean b/Mathlib/Topology/Algebra/Module/Complement.lean index 86076b328f6388..6fb53eabb24e49 100644 --- a/Mathlib/Topology/Algebra/Module/Complement.lean +++ b/Mathlib/Topology/Algebra/Module/Complement.lean @@ -381,6 +381,7 @@ theorem _root_.ContinuousLinearMap.closedComplemented_ker_of_rightInverse [Conti f₁.ker.ClosedComplemented := f₂.isTopCompl_range_ker_of_leftInverse f₁ h.leftInverse |>.symm.closedComplemented +set_option backward.isDefEq.respectTransparency.types false in /-- If `p` is a closed complemented submodule, then there exists a submodule `q` and a continuous linear equivalence `M ≃L[R] (p × q)` such that `e (x : p) = (x, 0)`, `e (y : q) = (0, y)`, and `e.symm x = x.1 + x.2`. diff --git a/Mathlib/Topology/Algebra/Module/Equiv.lean b/Mathlib/Topology/Algebra/Module/Equiv.lean index 215464405d79ec..7f64ea4d794634 100644 --- a/Mathlib/Topology/Algebra/Module/Equiv.lean +++ b/Mathlib/Topology/Algebra/Module/Equiv.lean @@ -849,6 +849,7 @@ section AutRing variable (R : Type*) [Semiring R] [TopologicalSpace R] [ContinuousMul R] +set_option backward.isDefEq.respectTransparency false in /-- Continuous linear equivalences `R ≃L[R] R` are enumerated by `Rˣ`. -/ def unitsEquivAut : Rˣ ≃ R ≃L[R] R where toFun u := diff --git a/Mathlib/Topology/Algebra/Module/FiniteDimensionBilinear.lean b/Mathlib/Topology/Algebra/Module/FiniteDimensionBilinear.lean index 28992ed2ec8585..c93784a24e1779 100644 --- a/Mathlib/Topology/Algebra/Module/FiniteDimensionBilinear.lean +++ b/Mathlib/Topology/Algebra/Module/FiniteDimensionBilinear.lean @@ -33,6 +33,7 @@ variable {G : Type*} [AddCommGroup G] [Module 𝕜 G] [TopologicalSpace G] [IsTopologicalAddGroup G] [ContinuousSMul 𝕜 G] +set_option backward.isDefEq.respectTransparency false in /-- Building continuous bilinear maps from bilinear maps between finite dimensional topological vector spaces over a complete field. -/ def LinearMap.toContinuousBilinearMap (f : E →ₗ[𝕜] F →ₗ[𝕜] G) : E →L[𝕜] F →L[𝕜] G := diff --git a/Mathlib/Topology/Algebra/Module/LinearPMap.lean b/Mathlib/Topology/Algebra/Module/LinearPMap.lean index 158081fc2866f2..614110d09c3a90 100644 --- a/Mathlib/Topology/Algebra/Module/LinearPMap.lean +++ b/Mathlib/Topology/Algebra/Module/LinearPMap.lean @@ -181,6 +181,7 @@ theorem inverse_closed_iff (hf : LinearMap.ker f.toFun = ⊥) : f.inverse.IsClos variable [ContinuousAdd E] [ContinuousAdd F] variable [TopologicalSpace R] [ContinuousSMul R E] [ContinuousSMul R F] +set_option backward.isDefEq.respectTransparency false in /-- If `f` is invertible and closable as well as its closure being invertible, then the graph of the inverse of the closure is given by the closure of the graph of the inverse. -/ theorem closure_inverse_graph (hf : LinearMap.ker f.toFun = ⊥) (hf' : f.IsClosable) diff --git a/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean b/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean index 0b7fcfdc0a00d9..5ff6f000ebd11c 100644 --- a/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean +++ b/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean @@ -396,7 +396,7 @@ def linearDeriv : (∀ i, M₁ i) →L[R] M₂ := ∑ i : ι, (f.toContinuousLin lemma linearDeriv_apply : f.linearDeriv x y = ∑ i, f (Function.update x i (y i)) := by unfold linearDeriv toContinuousLinearMap simp only [ContinuousLinearMap.coe_sum', ContinuousLinearMap.coe_comp', - ContinuousLinearMap.coe_mk', Finset.sum_apply] + Finset.sum_apply] rfl end linearDeriv diff --git a/Mathlib/Topology/Algebra/Module/Spaces/CharacterSpace.lean b/Mathlib/Topology/Algebra/Module/Spaces/CharacterSpace.lean index e36caa9bf20462..7473b89278281e 100644 --- a/Mathlib/Topology/Algebra/Module/Spaces/CharacterSpace.lean +++ b/Mathlib/Topology/Algebra/Module/Spaces/CharacterSpace.lean @@ -103,6 +103,7 @@ noncomputable def toNonUnitalAlgHom (φ : characterSpace 𝕜 A) : A →ₙₐ[ theorem coe_toNonUnitalAlgHom (φ : characterSpace 𝕜 A) : ⇑(toNonUnitalAlgHom φ) = φ := rfl +set_option backward.isDefEq.respectTransparency false in instance instIsEmpty [Subsingleton A] : IsEmpty (characterSpace 𝕜 A) := ⟨fun φ => φ.prop.1 <| ContinuousLinearMap.ext fun x => by diff --git a/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean b/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean index 6cdef5c0383831..6b3dc21cb97e65 100644 --- a/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean +++ b/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean @@ -101,7 +101,7 @@ notation:25 E' " →Lᵤ[" R ", " 𝔖 "] " F => UniformConvergenceCLM (RingHom. namespace UniformConvergenceCLM /-- Reinterpret `f : E →SL[σ] F` as an element of `E →SLᵤ[σ, 𝔖] F`. -/ -@[implicit_reducible] +@[instance_reducible] def ofFun [TopologicalSpace F] (𝔖 : Set (Set E)) : (E →SL[σ] F) ≃ (E →SLᵤ[σ, 𝔖] F) := ⟨fun x => x, fun x => x, fun _ => rfl, fun _ => rfl⟩ @@ -346,6 +346,7 @@ theorem tendsto_iff_tendstoUniformlyOn {ι : Type*} {p : Filter ι} [UniformSpac rw [(isEmbedding_coeFn σ F 𝔖).tendsto_nhds_iff, UniformOnFun.tendsto_iff_tendstoUniformlyOn] rfl +set_option backward.isDefEq.respectTransparency false in variable {F} in theorem isUniformInducing_postcomp [AddCommGroup G] [UniformSpace G] [IsUniformAddGroup G] @@ -466,6 +467,7 @@ variable {𝕜₁ 𝕜₂ 𝕜₃ : Type*} [NormedField 𝕜₁] [NormedField variable (𝔖 : Set (Set E)) (𝔗 : Set (Set F)) +set_option backward.isDefEq.respectTransparency false in variable (G) in /-- Pre-composition by a *fixed* continuous linear map as a continuous linear map for the uniform convergence topology. -/ @@ -489,6 +491,7 @@ alias precomp_uniformConvergenceCLM := precompUniformConvergenceCLM @[deprecated (since := "2026-01-27")] alias precomp_uniformConvergenceCLM_apply := precompUniformConvergenceCLM_apply +set_option backward.isDefEq.respectTransparency false in /-- Post-composition by a *fixed* continuous linear map as a continuous linear map for the uniform convergence topology. -/ @[simps] @@ -527,6 +530,7 @@ variable (𝕜 : Type*) [NormedField 𝕜] {E ι : Type*} (F : ι → Type*) [∀ i, AddCommGroup (F i)] [∀ i, Module 𝕜 (F i)] [∀ i, TopologicalSpace (F i)] [∀ i, IsTopologicalAddGroup (F i)] [∀ i, ContinuousConstSMul 𝕜 (F i)] +set_option backward.isDefEq.respectTransparency.types false in /-- `ContinuousLinearMap.pi`, upgraded to a continuous linear equivalence between `Π i, E →Lᵤ[𝕜, 𝔖] F i` and `E →Lᵤ[𝕜, 𝔖] Π i, F i`. -/ def UniformConvergenceCLM.piEquivL (𝔖 : Set (Set E)) : diff --git a/Mathlib/Topology/Algebra/Module/UniformConvergence.lean b/Mathlib/Topology/Algebra/Module/UniformConvergence.lean index 998531ca974c38..99be8b5a222be2 100644 --- a/Mathlib/Topology/Algebra/Module/UniformConvergence.lean +++ b/Mathlib/Topology/Algebra/Module/UniformConvergence.lean @@ -52,6 +52,7 @@ variable (𝕜 α E H : Type*) {hom : Type*} [NormedField 𝕜] [AddCommGroup H] [ContinuousSMul 𝕜 E] {𝔖 : Set <| Set α} [FunLike hom H (α → E)] [LinearMapClass hom 𝕜 H (α → E)] +set_option backward.isDefEq.respectTransparency false in /-- Let `E` be a topological vector space over a normed field `𝕜`, let `α` be any type. Let `H` be a submodule of `α →ᵤ E` such that the range of each `f ∈ H` is von Neumann bounded. Then `H` is a topological vector space over `𝕜`, diff --git a/Mathlib/Topology/Algebra/MulAction.lean b/Mathlib/Topology/Algebra/MulAction.lean index 2b49c11881c228..de9b7c7a0cb034 100644 --- a/Mathlib/Topology/Algebra/MulAction.lean +++ b/Mathlib/Topology/Algebra/MulAction.lean @@ -95,6 +95,7 @@ instance OrderDual.instContinuousSMul_left : ContinuousSMul Mᵒᵈ X where instance (priority := 100) ContinuousSMul.continuousConstSMul : ContinuousConstSMul M X where continuous_const_smul _ := continuous_smul.comp (continuous_const.prodMk continuous_id) +set_option backward.isDefEq.respectTransparency false in theorem ContinuousSMul.induced {R : Type*} {α : Type*} {β : Type*} {F : Type*} [FunLike F α β] [Semiring R] [AddCommMonoid α] [AddCommMonoid β] [Module R α] [Module R β] [TopologicalSpace R] [LinearMapClass F R α β] [tβ : TopologicalSpace β] [ContinuousSMul R β] diff --git a/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean b/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean index f2f0b97c865a8a..7c0e7cc2c38d62 100644 --- a/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean +++ b/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean @@ -79,13 +79,13 @@ theorem adic_basis (I : Ideal R) : SubmodulesRingBasis fun n : ℕ => (I ^ n • exact (I ^ n).smul_mem x hb } /-- The adic ring filter basis associated to an ideal `I` is made of powers of `I`. -/ -@[implicit_reducible] +@[instance_reducible] def ringFilterBasis (I : Ideal R) := I.adic_basis.toRing_subgroups_basis.toRingFilterBasis /-- The adic topology associated to an ideal `I`. This topology admits powers of `I` as a basis of neighborhoods of zero. It is compatible with the ring structure and is non-archimedean. -/ -@[implicit_reducible] +@[instance_reducible] def adicTopology (I : Ideal R) : TopologicalSpace R := (adic_basis I).topology @@ -133,7 +133,7 @@ theorem adic_module_basis : /-- The topology on an `R`-module `M` associated to an ideal `M`. Submodules $I^n M$, written `I^n • ⊤` form a basis of neighborhoods of zero. -/ -@[implicit_reducible] +@[instance_reducible] def adicModuleTopology : TopologicalSpace M := @ModuleFilterBasis.topology R M _ I.adic_basis.topology _ _ (I.ringFilterBasis.moduleFilterBasis (I.adic_module_basis M)) @@ -278,7 +278,7 @@ lemma isTopologicallyNilpotent_of_mem {a : R} (ha : a ∈ i) : IsTopologicallyNi /-- The adic topology on an `R` module coming from the ideal `WithIdeal.I`. This cannot be an instance because `R` cannot be inferred from `M`. -/ -@[implicit_reducible] +@[instance_reducible] def topologicalSpaceModule (M : Type*) [AddCommGroup M] [Module R M] : TopologicalSpace M := (i : Ideal R).adicModuleTopology M diff --git a/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean b/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean index bd3527ceffa655..d3047df41e6c22 100644 --- a/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean +++ b/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean @@ -63,7 +63,7 @@ theorem of_comm {A ι : Type*} [CommRing A] (B : ι → AddSubgroup A) rightMul := fun x i ↦ (leftMul x i).imp fun j hj ↦ by simpa only [mul_comm] using hj } /-- Every subgroups basis on a ring leads to a ring filter basis. -/ -@[implicit_reducible] +@[instance_reducible] def toRingFilterBasis [Nonempty ι] {B : ι → AddSubgroup A} (hB : RingSubgroupsBasis B) : RingFilterBasis A where sets := { U | ∃ i, U = B i } @@ -133,7 +133,7 @@ theorem mem_addGroupFilterBasis (i) : (B i : Set A) ∈ hB.toRingFilterBasis.toA /-- The topology defined from a subgroups basis, admitting the given subgroups as a basis of neighborhoods of zero. -/ -@[implicit_reducible] +@[instance_reducible] def topology : TopologicalSpace A := hB.toRingFilterBasis.toAddGroupFilterBasis.topology @@ -223,7 +223,7 @@ theorem toRing_subgroups_basis (hB : SubmodulesRingBasis B) : exact hj ⟨b, b_in, rfl⟩ /-- The topology associated to a basis of submodules in an algebra. -/ -@[implicit_reducible] +@[instance_reducible] def topology [Nonempty ι] (hB : SubmodulesRingBasis B) : TopologicalSpace A := hB.toRing_subgroups_basis.topology @@ -303,7 +303,7 @@ def toModuleFilterBasis : ModuleFilterBasis R M where exact hB.smul m₀ i /-- The topology associated to a basis of submodules in a module. -/ -@[implicit_reducible] +@[instance_reducible] def topology : TopologicalSpace M := hB.toModuleFilterBasis.toAddGroupFilterBasis.topology diff --git a/Mathlib/Topology/Algebra/RestrictedProduct/Units.lean b/Mathlib/Topology/Algebra/RestrictedProduct/Units.lean index 0b0b1001a9fc3a..a01704b86194b9 100644 --- a/Mathlib/Topology/Algebra/RestrictedProduct/Units.lean +++ b/Mathlib/Topology/Algebra/RestrictedProduct/Units.lean @@ -68,6 +68,7 @@ theorem isUnit_iff {x : Πʳ i, [R i, B i]_[𝓕]} : def coeUnits : Πʳ i, [R i, B i]_[𝓕]ˣ →* (i : ι) → (R i)ˣ := MulEquiv.piUnits.toMonoidHom.comp <| Units.map coeMonoidHom +set_option backward.isDefEq.respectTransparency false in /-- Constructs a unit in a restricted product `Πʳ i, [R i, B i]_[𝓕]` given an element `x` of the usual product and the condition that `x` is eventually in the units of `B i` along `𝓕`. -/ def mkUnit (x : Π i, (R i)ˣ) (hx : ∀ᶠ i in 𝓕, x i ∈ (Submonoid.ofClass (B i)).units) : diff --git a/Mathlib/Topology/Algebra/Ring/Compact.lean b/Mathlib/Topology/Algebra/Ring/Compact.lean index 29ef1a13c75373..09dbc45255206b 100644 --- a/Mathlib/Topology/Algebra/Ring/Compact.lean +++ b/Mathlib/Topology/Algebra/Ring/Compact.lean @@ -116,6 +116,7 @@ end IsLocalRing section IsDedekindDomain +set_option backward.isDefEq.respectTransparency.types false in lemma IsDedekindDomain.isOpen_of_ne_bot [IsDedekindDomain R] {I : Ideal R} (hI : I ≠ ⊥) : IsOpen (X := R) I := by diff --git a/Mathlib/Topology/Algebra/StarSubalgebra.lean b/Mathlib/Topology/Algebra/StarSubalgebra.lean index 4f3ee1db715c13..403ae5bee60e68 100644 --- a/Mathlib/Topology/Algebra/StarSubalgebra.lean +++ b/Mathlib/Topology/Algebra/StarSubalgebra.lean @@ -257,6 +257,7 @@ theorem induction_on {x y : A} | mul u v hu_mem hv_mem hu hv => exact mul u (subset_closure hu_mem) v (subset_closure hv_mem) (hu hu_mem) (hv hv_mem) +set_option backward.isDefEq.respectTransparency false in theorem starAlgHomClass_ext [T2Space B] {F : Type*} {a : A} [FunLike F (elemental R a) B] [AlgHomClass F R _ B] [StarHomClass F _ B] {φ ψ : F} (hφ : Continuous φ) diff --git a/Mathlib/Topology/Algebra/TopologicallyNilpotent.lean b/Mathlib/Topology/Algebra/TopologicallyNilpotent.lean index d79cf54b70c6d9..6848b8d429421e 100644 --- a/Mathlib/Topology/Algebra/TopologicallyNilpotent.lean +++ b/Mathlib/Topology/Algebra/TopologicallyNilpotent.lean @@ -145,6 +145,7 @@ def _root_.topologicalNilradical : Ideal R where zero_mem' := zero smul_mem' := mul_left +set_option backward.isDefEq.respectTransparency false in theorem mem_topologicalNilradical_iff {a : R} : a ∈ topologicalNilradical R ↔ IsTopologicallyNilpotent a := by simp [topologicalNilradical] diff --git a/Mathlib/Topology/Algebra/UniformFilterBasis.lean b/Mathlib/Topology/Algebra/UniformFilterBasis.lean index 2de650e0e88f03..561d371d08e1b3 100644 --- a/Mathlib/Topology/Algebra/UniformFilterBasis.lean +++ b/Mathlib/Topology/Algebra/UniformFilterBasis.lean @@ -31,7 +31,7 @@ variable {G : Type*} [AddCommGroup G] (B : AddGroupFilterBasis G) /-- The uniform space structure associated to an abelian group filter basis via the associated topological abelian group structure. -/ -@[implicit_reducible] +@[instance_reducible] protected def uniformSpace : UniformSpace G := @IsTopologicalAddGroup.rightUniformSpace G _ B.topology B.isTopologicalAddGroup diff --git a/Mathlib/Topology/Algebra/UniformRing.lean b/Mathlib/Topology/Algebra/UniformRing.lean index b86b231883cd69..434d8d3bb1db09 100644 --- a/Mathlib/Topology/Algebra/UniformRing.lean +++ b/Mathlib/Topology/Algebra/UniformRing.lean @@ -170,6 +170,7 @@ theorem mapRingHom_comp {γ : Type*} [UniformSpace γ] [Ring γ] [IsUniformAddGr (uniformContinuous_addMonoidHom_of_continuous hg) (uniformContinuous_addMonoidHom_of_continuous hf) +set_option backward.isDefEq.respectTransparency false in @[simp] theorem mapRingHom_id : mapRingHom (.id α) continuous_id = .id (Completion α) := by simp [RingHom.ext_iff, mapRingHom_apply] diff --git a/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean b/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean index 4f98bf5ca7c270..863a2968962042 100644 --- a/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean +++ b/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean @@ -156,6 +156,7 @@ theorem hasBasis_nhds_zero : fun γ : (MonoidWithZeroHom.ValueGroup₀ v)ˣ ↦ { x | v.restrict x < γ.val } := by simp [Filter.hasBasis_iff, v.is_topological_valuation] +set_option backward.isDefEq.respectTransparency.types false in /-- The set `{ y : R | v y = v x }` is a neighbourhood of `x`. This does not imply that `v` is locally constant everywhere (since `v ⁻¹' {0}` is not open), but it is equivalent to the restriction of `v` to the complement of its support being @@ -299,6 +300,7 @@ theorem isOpen_closedBall {r : ValueGroup₀ v} (hr : r ≠ 0) : exact ⟨Units.mk0 _ hr, fun y hy ↦ (sub_add_cancel y x).symm ▸ le_trans (v.restrict.map_add _ _) (max_le (le_of_lt hy) hx)⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- For any valuation `v` compatible with the valuative relation on `R`, the closed `r`-ball around zero `{x | v.restrict x ≤ r}` is closed in the valuative topology. -/ theorem isClosed_closedBall (r : ValueGroup₀ v) : IsClosed (X := R) {x | v.restrict x ≤ r} := by @@ -316,6 +318,7 @@ theorem isClopen_closedBall {r : ValueGroup₀ v} (hr : r ≠ 0) : IsClopen (X := R) {x | v.restrict x ≤ r} := ⟨isClosed_closedBall _, isOpen_closedBall hr⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- For any valuation `v` compatible with the valuative relation on `R`, the sphere of radius `r` around zero `{x | v.restrict x = r}` is clopen in the valuative topology. -/ theorem isClopen_sphere {r : ValueGroup₀ v} (hr : r ≠ 0) : diff --git a/Mathlib/Topology/Algebra/Valued/LocallyCompact.lean b/Mathlib/Topology/Algebra/Valued/LocallyCompact.lean index af77eae286cffa..40451e16c9e4fd 100644 --- a/Mathlib/Topology/Algebra/Valued/LocallyCompact.lean +++ b/Mathlib/Topology/Algebra/Valued/LocallyCompact.lean @@ -126,6 +126,7 @@ lemma finite_quotient_maximalIdeal_pow_of_finite_residueField [IsDiscreteValuati open scoped Valued +set_option backward.isDefEq.respectTransparency.types false in lemma totallyBounded_iff_finite_residueField [(Valued.v : Valuation K Γ₀).RankOne] [IsDiscreteValuationRing 𝒪[K]] : TotallyBounded (Set.univ (α := 𝒪[K])) ↔ Finite 𝓀[K] := by diff --git a/Mathlib/Topology/Algebra/Valued/NormedValued.lean b/Mathlib/Topology/Algebra/Valued/NormedValued.lean index cc9cd5f2781c6b..41f20d14812e12 100644 --- a/Mathlib/Topology/Algebra/Valued/NormedValued.lean +++ b/Mathlib/Topology/Algebra/Valued/NormedValued.lean @@ -124,6 +124,7 @@ theorem norm_def {x : L} : v.norm x = hv.hom _ (v.restrict x) := rfl theorem norm_nonneg (x : L) : 0 ≤ v.norm x := by simp only [norm, NNReal.zero_le_coe] +set_option backward.isDefEq.respectTransparency.types false in theorem norm_add_le (x y : L) : v.norm (x + y) ≤ max (v.norm x) (v.norm y) := by simp only [norm, NNReal.coe_le_coe, le_max_iff, StrictMono.le_iff_le hv.strictMono] exact le_max_iff.mp (Valuation.map_add_le_max' v.restrict _ _) diff --git a/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean b/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean index 1d6fa7bce51937..350eb948476420 100644 --- a/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean +++ b/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean @@ -137,7 +137,7 @@ class Valued (R : Type u) [Ring R] (Γ₀ : outParam (Type v)) namespace Valued /-- Alternative `Valued` constructor for use when there is no preferred `UniformSpace` structure. -/ -@[implicit_reducible] +@[instance_reducible] def mk' (v : Valuation R Γ₀) : Valued R Γ₀ := { v toUniformSpace := @IsTopologicalAddGroup.rightUniformSpace R _ v.subgroups_basis.topology _ @@ -182,6 +182,7 @@ theorem mem_nhds_zero {s : Set R} : s ∈ 𝓝 (0 : R) ↔ ∃ γ : (MonoidWithZeroHom.ValueGroup₀ _i.v)ˣ, { x | v.restrict x < γ.1 } ⊆ s := by simp only [mem_nhds, sub_zero] +set_option backward.isDefEq.respectTransparency.types false in /-- The set `{ y : R | v y = v x }` is a neighbourhood of `x`. This does not imply that `v` is locally constant everywhere (since `v ⁻¹' {0}` is not open), but it is equivalent to the restriction of `v` to the complement of its support being @@ -266,6 +267,7 @@ theorem isOpen_closedBall {r : ValueGroup₀ _i.v} (hr : r ≠ 0) : exact ⟨Units.mk0 _ hr, fun y hy ↦ (sub_add_cancel y x).symm ▸ le_trans (v.restrict.map_add _ _) (max_le (le_of_lt hy) hx)⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- A closed ball centred at the origin in a valued ring is closed. -/ theorem isClosed_closedBall (r : ValueGroup₀ _i.v) : IsClosed (X := R) {x | v.restrict x ≤ r} := by rw [← isOpen_compl_iff, isOpen_iff_mem_nhds] @@ -281,6 +283,7 @@ theorem isClopen_closedBall {r : ValueGroup₀ _i.v} (hr : r ≠ 0) : IsClopen (X := R) {x | v.restrict x ≤ r} := ⟨isClosed_closedBall _ _, isOpen_closedBall _ hr⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- A sphere centred at the origin in a valued ring is clopen. -/ theorem isClopen_sphere {r : ValueGroup₀ _i.v} (hr : r ≠ 0) : IsClopen (X := R) {x | v.restrict x = r} := by diff --git a/Mathlib/Topology/Algebra/Valued/ValuedField.lean b/Mathlib/Topology/Algebra/Valued/ValuedField.lean index 6cd1e903fbc472..e181dcd55083c0 100644 --- a/Mathlib/Topology/Algebra/Valued/ValuedField.lean +++ b/Mathlib/Topology/Algebra/Valued/ValuedField.lean @@ -101,6 +101,7 @@ instance (priority := 100) Valued.isTopologicalDivisionRing [Valued K Γ₀] : simp only [mem_setOf_eq, Units.min_val, Units.val_mul] at y_in exact Valuation.inversion_estimate _ x_ne y_in } +set_option backward.isDefEq.respectTransparency.types false in /-- A valued division ring is separated. -/ instance (priority := 100) ValuedRing.separated [Valued K Γ₀] : T0Space K := by suffices T2Space K by infer_instance @@ -134,6 +135,7 @@ theorem Valued.continuous_valuation [hv : Valued K Γ₀] : simp_rw [v.restrict_inj] apply Valued.locally_const (by simpa [restrict₀_apply] using v_ne) +set_option backward.isDefEq.respectTransparency.types false in theorem Valued.continuous_valuation_of_surjective [hv : Valued K Γ₀] (hsurj : Function.Surjective hv.v) : Continuous hv.v := by rw [continuous_iff_continuousAt] @@ -208,6 +210,7 @@ instance (priority := 100) completable : CompletableTopField K := open MonoidWithZeroHom WithZeroTopology +set_option backward.isDefEq.respectTransparency.types false in lemma valuation_isClosedMap : IsClosedMap (v.restrict : K → (ValueGroup₀ hv.v)) := by refine IsClosedMap.of_nonempty ?_ intro U hU hU' diff --git a/Mathlib/Topology/Algebra/Valued/WithVal.lean b/Mathlib/Topology/Algebra/Valued/WithVal.lean index 16edbfada287c4..6280802297b8ff 100644 --- a/Mathlib/Topology/Algebra/Valued/WithVal.lean +++ b/Mathlib/Topology/Algebra/Valued/WithVal.lean @@ -408,6 +408,8 @@ theorem valueGroup_eq : valueGroup (instValued v).v = valueGroup v := by simp [valueGroup, valueMonoid, ← (WithVal.ofVal_surjective v).range_comp] rfl +-- TODO: `respectTransparency.types false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency.types false in /-- The multiplicative equivalence between the `valueGroup` of the valuation on `WithVal v` and the valuation `v`. -/ @[simps! apply symm_apply] @@ -421,6 +423,7 @@ theorem strictMono_valueGroupEquiv : StrictMono (valueGroupEquiv v) := theorem strictMono_valueGroupEquiv_symm : StrictMono (valueGroupEquiv v).symm := fun _ _ _ ↦ by simpa +set_option backward.isDefEq.respectTransparency.types false in /-- The order-preserving, multiplicative equivalence between the `ValueGroup₀` of the valuation on `WithVal v` and the valuation `v`. -/ @[simps!] @@ -613,6 +616,7 @@ theorem exists_div_eq_of_surjective {K : Type*} [Field K] {Γ₀ : Type*} obtain ⟨r, hr⟩ := hv γ exact ⟨r, 1, by simp [hr]⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem restrict_exists_div_eq {K : Type*} [Field K] {Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] (v : Valuation K Γ₀) (γ : (MonoidWithZeroHom.ValueGroup₀ v)ˣ) : diff --git a/Mathlib/Topology/Basic.lean b/Mathlib/Topology/Basic.lean index 3ca95a365474ce..342ef7ab77603e 100644 --- a/Mathlib/Topology/Basic.lean +++ b/Mathlib/Topology/Basic.lean @@ -39,7 +39,7 @@ universe u v /-- A constructor for topologies by specifying the closed sets, and showing that they satisfy the appropriate conditions. -/ -@[implicit_reducible] +@[instance_reducible] def TopologicalSpace.ofClosed {X : Type u} (T : Set (Set X)) (empty_mem : ∅ ∈ T) (sInter_mem : ∀ A, A ⊆ T → ⋂₀ A ∈ T) (union_mem : ∀ A, A ∈ T → ∀ B, B ∈ T → A ∪ B ∈ T) : TopologicalSpace X where diff --git a/Mathlib/Topology/Bornology/Basic.lean b/Mathlib/Topology/Bornology/Basic.lean index cdbcb463b7b8d7..bd2baf060850c2 100644 --- a/Mathlib/Topology/Bornology/Basic.lean +++ b/Mathlib/Topology/Bornology/Basic.lean @@ -64,7 +64,7 @@ lemma Bornology.ext (t t' : Bornology α) /-- A constructor for bornologies by specifying the bounded sets, and showing that they satisfy the appropriate conditions. -/ -@[simps, implicit_reducible] +@[simps, instance_reducible] def Bornology.ofBounded {α : Type*} (B : Set (Set α)) (empty_mem : ∅ ∈ B) (subset_mem : ∀ s₁ ∈ B, ∀ s₂ ⊆ s₁, s₂ ∈ B) @@ -75,7 +75,7 @@ def Bornology.ofBounded {α : Type*} (B : Set (Set α)) /-- A constructor for bornologies by specifying the bounded sets, and showing that they satisfy the appropriate conditions. -/ -@[simps! cobounded, implicit_reducible] +@[simps! cobounded, instance_reducible] def Bornology.ofBounded' {α : Type*} (B : Set (Set α)) (empty_mem : ∅ ∈ B) (subset_mem : ∀ s₁ ∈ B, ∀ s₂ ⊆ s₁, s₂ ∈ B) diff --git a/Mathlib/Topology/CWComplex/Classical/Basic.lean b/Mathlib/Topology/CWComplex/Classical/Basic.lean index cf0b4499d5b082..ad8830e9e2b9c6 100644 --- a/Mathlib/Topology/CWComplex/Classical/Basic.lean +++ b/Mathlib/Topology/CWComplex/Classical/Basic.lean @@ -164,7 +164,7 @@ instance (priority := high) CWComplex.instRelCWComplex {X : Type*} [TopologicalS union' := by simpa only [empty_union] using CWComplex.union' /-- A relative CW complex with an empty base is an absolute CW complex. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def RelCWComplex.toCWComplex {X : Type*} [TopologicalSpace X] (C : Set X) [RelCWComplex C ∅] : CWComplex C where cell := cell C diff --git a/Mathlib/Topology/CWComplex/Classical/Finite.lean b/Mathlib/Topology/CWComplex/Classical/Finite.lean index b4c1d87a7f7862..edc1df4bc95123 100644 --- a/Mathlib/Topology/CWComplex/Classical/Finite.lean +++ b/Mathlib/Topology/CWComplex/Classical/Finite.lean @@ -68,7 +68,7 @@ end CWComplex /-- If we want to construct a relative CW complex of finite type, we can add the condition `finite_cell` and relax the condition `mapsTo`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def RelCWComplex.mkFiniteType.{u} {X : Type u} [TopologicalSpace X] (C : Set X) (D : outParam (Set X)) (cell : (n : ℕ) → Type u) (map : (n : ℕ) → (i : cell n) → PartialEquiv (Fin n → ℝ) X) @@ -127,7 +127,7 @@ lemma RelCWComplex.finiteType_mkFiniteType.{u} {X : Type u} [TopologicalSpace X] /-- If we want to construct a CW complex of finite type, we can add the condition `finite_cell` and relax the condition `mapsTo`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def CWComplex.mkFiniteType.{u} {X : Type u} [TopologicalSpace X] (C : Set X) (cell : (n : ℕ) → Type u) (map : (n : ℕ) → (i : cell n) → PartialEquiv (Fin n → ℝ) X) (finite_cell : ∀ (n : ℕ), _root_.Finite (cell n)) @@ -179,7 +179,7 @@ lemma CWComplex.finiteType_mkFiniteType.{u} {X : Type u} [TopologicalSpace X] (C /-- If we want to construct a finite relative CW complex we can add the conditions `eventually_isEmpty_cell` and `finite_cell`, relax the condition `mapsTo` and remove the condition `closed'`. -/ -@[simps -isSimp, implicit_reducible] +@[simps -isSimp, instance_reducible] def RelCWComplex.mkFinite.{u} {X : Type u} [TopologicalSpace X] (C : Set X) (D : outParam (Set X)) (cell : (n : ℕ) → Type u) (map : (n : ℕ) → (i : cell n) → PartialEquiv (Fin n → ℝ) X) @@ -254,7 +254,7 @@ lemma RelCWComplex.finite_mkFinite.{u} {X : Type u} [TopologicalSpace X] (C : Se /-- If we want to construct a finite CW complex we can add the conditions `eventually_isEmpty_cell` and `finite_cell`, relax the condition `mapsTo` and remove the condition `closed'`. -/ -@[simps! -isSimp, implicit_reducible] +@[simps! -isSimp, instance_reducible] def CWComplex.mkFinite.{u} {X : Type u} [TopologicalSpace X] (C : Set X) (cell : (n : ℕ) → Type u) (map : (n : ℕ) → (i : cell n) → PartialEquiv (Fin n → ℝ) X) (eventually_isEmpty_cell : ∀ᶠ n in Filter.atTop, IsEmpty (cell n)) diff --git a/Mathlib/Topology/Category/CompHausLike/Cartesian.lean b/Mathlib/Topology/Category/CompHausLike/Cartesian.lean index 6fedbf0612828b..b6059b439972c0 100644 --- a/Mathlib/Topology/Category/CompHausLike/Cartesian.lean +++ b/Mathlib/Topology/Category/CompHausLike/Cartesian.lean @@ -59,7 +59,7 @@ This could be an instance but that causes some slowness issues with typeclass se keep it as a def and turn it on as an instance for the explicit examples of `CompHausLike` as needed. -/ -@[implicit_reducible] +@[instance_reducible] def cartesianMonoidalCategory [∀ (X Y : CompHausLike.{u} P), HasProp P (X × Y)] [HasProp P PUnit.{u + 1}] : CartesianMonoidalCategory (CompHausLike.{u} P) := .ofChosenFiniteProducts @@ -79,6 +79,7 @@ type-theoretic sums. def coproductCocone : BinaryCofan X Y := BinaryCofan.mk (P := CompHausLike.of P (X ⊕ Y)) (ofHom _ { toFun := Sum.inl }) (ofHom _ { toFun := Sum.inr }) +set_option backward.isDefEq.respectTransparency.types false in /-- When the predicate `P` is preserved under taking type-theoretic sums, that sum is a category-theoretic coproduct in `CompHausLike P`. diff --git a/Mathlib/Topology/Category/Compactum.lean b/Mathlib/Topology/Category/Compactum.lean index 3f2472926bf928..b1b2e55ada027b 100644 --- a/Mathlib/Topology/Category/Compactum.lean +++ b/Mathlib/Topology/Category/Compactum.lean @@ -109,6 +109,7 @@ def adj : free ⊣ forget := instance : CoeSort Compactum Type* := ⟨fun X => X.A⟩ +set_option backward.isDefEq.respectTransparency.types false in instance {X Y : Compactum} : FunLike (X ⟶ Y) X Y where coe f := f.f coe_injective' _ _ h := (Monad.forget_faithful β).map_injective (by aesop) @@ -133,6 +134,7 @@ def join (X : Compactum) : Ultrafilter (Ultrafilter X) → Ultrafilter X := def incl (X : Compactum) : X → Ultrafilter X := (β).η.app _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem str_incl (X : Compactum) (x : X) : X.str (X.incl x) = x := by change ((β).η.app _ ≫ X.a) _ = _ @@ -146,6 +148,7 @@ theorem str_hom_commute (X Y : Compactum) (f : X ⟶ Y) (xs : Ultrafilter X) : rw [← f.h] rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem join_distrib (X : Compactum) (uux : Ultrafilter (Ultrafilter X)) : X.str (X.join uux) = X.str (map X.str uux) := by @@ -374,6 +377,7 @@ theorem continuous_of_hom {X Y : Compactum} (f : X ⟶ Y) : Continuous f := by rw [← str_hom_commute, str_eq_of_le_nhds _ x _] apply h +set_option backward.isDefEq.respectTransparency.types false in /-- Given any compact Hausdorff space, we construct a Compactum. -/ noncomputable def ofTopologicalSpace (X : Type*) [TopologicalSpace X] [CompactSpace X] [T2Space X] : Compactum where @@ -438,6 +442,7 @@ instance faithful : compactumToCompHaus.Faithful where ext simpa using! ConcreteCategory.congr_hom h _ +set_option backward.isDefEq.respectTransparency.types false in /-- This definition is used to prove essential surjectivity of `compactumToCompHaus`. -/ noncomputable def isoOfTopologicalSpace {D : CompHaus} : compactumToCompHaus.obj (Compactum.ofTopologicalSpace D) ≅ D where diff --git a/Mathlib/Topology/Category/Profinite/AsLimit.lean b/Mathlib/Topology/Category/Profinite/AsLimit.lean index 35bdf1848b6462..f3177895c3b2ff 100644 --- a/Mathlib/Topology/Category/Profinite/AsLimit.lean +++ b/Mathlib/Topology/Category/Profinite/AsLimit.lean @@ -58,6 +58,7 @@ def asLimitCone : CategoryTheory.Limits.Cone X.diagram := π := { app := fun S => CompHausLike.ofHom (Y := X.diagram.obj S) _ ⟨S.proj, IsLocallyConstant.continuous (S.proj_isLocallyConstant)⟩ } } +set_option backward.isDefEq.respectTransparency.types false in instance isIso_asLimitCone_lift : IsIso ((limitConeIsLimit.{u, u} X.diagram).lift X.asLimitCone) := CompHausLike.isIso_of_bijective _ (by diff --git a/Mathlib/Topology/Category/Profinite/Nobeling/Basic.lean b/Mathlib/Topology/Category/Profinite/Nobeling/Basic.lean index fbc475f10b9339..b4813d826e9696 100644 --- a/Mathlib/Topology/Category/Profinite/Nobeling/Basic.lean +++ b/Mathlib/Topology/Category/Profinite/Nobeling/Basic.lean @@ -149,17 +149,20 @@ theorem continuous_projRestricts (h : ∀ i, J i → K i) : Continuous (ProjRest theorem surjective_projRestricts (h : ∀ i, J i → K i) : Function.Surjective (ProjRestricts C h) := (Homeomorph.surjective _).comp (Set.surjective_mapsTo_image_restrict _ _) +set_option backward.isDefEq.respectTransparency.types false in variable (J) in theorem projRestricts_eq_id : ProjRestricts C (fun i (h : J i) ↦ h) = id := by ext ⟨x, y, hy, rfl⟩ i simp +contextual only [π, Proj, ProjRestricts_coe, id_eq, if_true] +set_option backward.isDefEq.respectTransparency.types false in theorem projRestricts_eq_comp (hJK : ∀ i, J i → K i) (hKL : ∀ i, K i → L i) : ProjRestricts C hJK ∘ ProjRestricts C hKL = ProjRestricts C (fun i ↦ hKL i ∘ hJK i) := by ext x i simp only [π, Proj, Function.comp_apply, ProjRestricts_coe] simp_all +set_option backward.isDefEq.respectTransparency.types false in theorem projRestricts_comp_projRestrict (h : ∀ i, J i → K i) : ProjRestricts C h ∘ ProjRestrict C K = ProjRestrict C J := by ext x i @@ -396,11 +399,12 @@ theorem eval_eq (l : Products I) (x : C) : dsimp [LocallyConstant.evalMonoidHom, e] simp only [ite_eq_right_iff, one_ne_zero] +set_option backward.isDefEq.respectTransparency.types false in theorem evalFacProp {l : Products I} (J : I → Prop) (h : ∀ a, a ∈ l.val → J a) [∀ j, Decidable (J j)] : l.eval (π C J) ∘ ProjRestrict C J = l.eval C := by ext x - dsimp [ProjRestrict] + dsimp only [ProjRestrict, Function.comp_apply] rw [Products.eval_eq, Products.eval_eq] simp +contextual [h, Proj] diff --git a/Mathlib/Topology/Category/Profinite/Nobeling/Span.lean b/Mathlib/Topology/Category/Profinite/Nobeling/Span.lean index e558f4c0b1caf6..8038168748eb1d 100644 --- a/Mathlib/Topology/Category/Profinite/Nobeling/Span.lean +++ b/Mathlib/Topology/Category/Profinite/Nobeling/Span.lean @@ -50,8 +50,7 @@ def πJ : LocallyConstant (π C (· ∈ s)) ℤ →ₗ[ℤ] LocallyConstant C theorem eval_eq_πJ (l : Products I) (hl : l.isGood (π C (· ∈ s))) : l.eval C = πJ C s (l.eval (π C (· ∈ s))) := by ext f - simp only [πJ, LocallyConstant.comapₗ, LinearMap.coe_mk, AddHom.coe_mk, - LocallyConstant.coe_comap, Function.comp_apply] + simp only [πJ, LocallyConstant.comapₗ] exact (congr_fun (Products.evalFacProp C (· ∈ s) (Products.prop_of_isGood C (· ∈ s) hl)) _).symm /-- `π C (· ∈ s)` is finite for a finite set `s`. -/ diff --git a/Mathlib/Topology/Category/Profinite/Nobeling/Successor.lean b/Mathlib/Topology/Category/Profinite/Nobeling/Successor.lean index 20805f5b1e1c11..cc7a69f16ff02e 100644 --- a/Mathlib/Topology/Category/Profinite/Nobeling/Successor.lean +++ b/Mathlib/Topology/Category/Profinite/Nobeling/Successor.lean @@ -233,6 +233,7 @@ theorem C1_projOrd {x : I → Bool} (hx : x ∈ C1 C ho) : SwapTrue o (Proj (ord simp only [not_lt, Bool.not_eq_true, Order.succ_le_iff] at hsC exact (hsC h').symm +set_option backward.isDefEq.respectTransparency.types false in include hC in open scoped Classical in theorem CC_exact {f : LocallyConstant C ℤ} (hf : Linear_CC' C hsC ho f = 0) : @@ -391,6 +392,7 @@ theorem span_sum : Set.range (eval C) = Set.range (Sum.elim EquivLike.range_comp (e := sum_equiv C hsC ho)] +set_option backward.isDefEq.respectTransparency.types false in theorem square_commutes : SumEval C ho ∘ Sum.inl = ModuleCat.ofHom (πs C o) ∘ eval (π C (ord I · < o)) := by ext l @@ -416,6 +418,7 @@ theorem Products.max_eq_o_cons_tail [Inhabited I] (l : Products I) (hl : l.val rw [← List.cons_head!_tail hl, hlh] simp [Tail] +set_option backward.isDefEq.respectTransparency.types false in theorem Products.max_eq_o_cons_tail' [Inhabited I] (l : Products I) (hl : l.val ≠ []) (hlh : l.val.head! = term I ho) (hlc : List.IsChain (· > ·) (term I ho :: l.Tail.val)) : l = ⟨term I ho :: l.Tail.val, hlc⟩ := by @@ -442,11 +445,13 @@ theorem GoodProducts.max_eq_o_cons_tail (l : MaxProducts C ho) : Products.max_eq_o_cons_tail ho l.val (List.ne_nil_of_mem l.prop.2) (head!_eq_o_of_maxProducts _ hsC ho l) +set_option backward.isDefEq.respectTransparency.types false in theorem Products.evalCons {I} [LinearOrder I] {C : Set (I → Bool)} {l : List I} {a : I} (hla : (a::l).IsChain (· > ·)) : Products.eval C ⟨a::l,hla⟩ = (e C a) * Products.eval C ⟨l,List.IsChain.sublist hla (List.tail_sublist (a::l))⟩ := by simp only [eval.eq_1, List.map, List.prod_cons] +set_option backward.isDefEq.respectTransparency.types false in theorem Products.max_eq_eval [Inhabited I] (l : Products I) (hl : l.val ≠ []) (hlh : l.val.head! = term I ho) : Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by @@ -520,6 +525,7 @@ theorem good_lt_maxProducts (q : GoodProducts (π C (ord I · < o))) simp only [term, Ordinal.typein_enum] exact Products.prop_of_isGood C _ q.prop q.val.val.head! (List.head!_mem_self h) +set_option backward.isDefEq.respectTransparency.types false in include hC hsC in /-- Removing the leading `o` from a term of `MaxProducts C` yields a list which `isGood` with respect to diff --git a/Mathlib/Topology/Category/Profinite/Nobeling/ZeroLimit.lean b/Mathlib/Topology/Category/Profinite/Nobeling/ZeroLimit.lean index 8598d72a995750..07a4607f0f0dd8 100644 --- a/Mathlib/Topology/Category/Profinite/Nobeling/ZeroLimit.lean +++ b/Mathlib/Topology/Category/Profinite/Nobeling/ZeroLimit.lean @@ -50,6 +50,7 @@ theorem GoodProducts.linearIndependentEmpty {I} [LinearOrder I] : /-- The empty list as a `Products` -/ def Products.nil : Products I := ⟨[], by simp only [List.isChain_nil]⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem Products.lt_nil_empty {I} [LinearOrder I] : { m : Products I | m < Products.nil } = ∅ := by ext ⟨m, hm⟩ refine ⟨fun h ↦ ?_, by tauto⟩ @@ -58,6 +59,7 @@ theorem Products.lt_nil_empty {I} [LinearOrder I] : { m : Products I | m < Produ instance {α : Type*} [TopologicalSpace α] [Nonempty α] : Nontrivial (LocallyConstant α ℤ) := ⟨0, 1, ne_of_apply_ne DFunLike.coe <| (Function.const_injective (β := ℤ)).ne zero_ne_one⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem Products.isGood_nil {I} [LinearOrder I] : Products.isGood ({fun _ ↦ false} : Set (I → Bool)) Products.nil := by intro h @@ -74,6 +76,7 @@ theorem Products.span_nil_eq_top {I} [LinearOrder I] : obtain rfl : x = default := by simp only [Set.default_coe_singleton, eq_iff_true_of_subsingleton] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- There is a unique `GoodProducts` for the singleton `{fun _ ↦ false}`. -/ noncomputable instance : Unique { l // Products.isGood ({fun _ ↦ false} : Set (I → Bool)) l } where @@ -149,6 +152,7 @@ noncomputable def range_equiv_smaller_toFun (o : Ordinal) (x : range (π C (ord I · < o))) : smaller C o := ⟨πs C o ↑x, x.val, x.property, rfl⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem range_equiv_smaller_toFun_bijective (o : Ordinal) : Function.Bijective (range_equiv_smaller_toFun C o) := by dsimp +unfoldPartialApp [range_equiv_smaller_toFun] diff --git a/Mathlib/Topology/Category/Profinite/Product.lean b/Mathlib/Topology/Category/Profinite/Product.lean index 9867a77714c045..53f9493c34890f 100644 --- a/Mathlib/Topology/Category/Profinite/Product.lean +++ b/Mathlib/Topology/Category/Profinite/Product.lean @@ -74,8 +74,7 @@ theorem eq_of_forall_π_app_eq (a b : C) ext i specialize h ({i} : Finset ι) rw [Subtype.ext_iff] at h - simp only [π_app, ContinuousMap.precomp, ContinuousMap.coe_mk, - Set.MapsTo.val_restrict_apply] at h + simp only [π_app, ContinuousMap.precomp, ContinuousMap.coe_mk] at h exact congr_fun h ⟨i, Finset.mem_singleton.mpr rfl⟩ end IndexFunctor @@ -100,6 +99,7 @@ def indexCone (hC : IsCompact C) : Cone (indexFunctor hC) where variable (hC : IsCompact C) +set_option backward.isDefEq.respectTransparency.types false in instance isIso_indexCone_lift : IsIso ((limitConeIsLimit.{u, u} (indexFunctor hC)).lift (indexCone hC)) := haveI : CompactSpace C := by rwa [← isCompact_iff_compactSpace] diff --git a/Mathlib/Topology/Category/TopCat/Limits/Basic.lean b/Mathlib/Topology/Category/TopCat/Limits/Basic.lean index 1a991c87a70c7d..2e5322bef5807d 100644 --- a/Mathlib/Topology/Category/TopCat/Limits/Basic.lean +++ b/Mathlib/Topology/Category/TopCat/Limits/Basic.lean @@ -85,6 +85,7 @@ instance topologicalSpaceConePtOfConeForget : TopologicalSpace (conePtOfConeForget c) := (⨅ j, (F.obj j).str.induced (c.π.app j)) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a functor `F : J ⥤ TopCat` and a cone `c : Cone (F ⋙ forget)` of the underlying functor to types, this is a cone for `F` whose point is `c.pt` with the infimum of the induced topologies by the maps `c.π.app j`. -/ @@ -99,6 +100,7 @@ def coneOfConeForget : Cone F where ext apply ConcreteCategory.congr_hom (c.π.naturality φ) } +set_option backward.isDefEq.respectTransparency.types false in /-- Given a functor `F : J ⥤ TopCat` and a cone `c : Cone (F ⋙ forget)` of the underlying functor to types, the limit of `F` is `c.pt` equipped with the infimum of the induced topologies by the maps `c.π.app j`. -/ @@ -139,6 +141,7 @@ theorem induced_of_isLimit : end IsLimit +set_option backward.isDefEq.respectTransparency.types false in lemma nonempty_isLimit_iff_eq_induced {F : J ⥤ TopCat.{u}} (c : Cone F) (hc : IsLimit ((forget).mapCone c)) : Nonempty (IsLimit c) ↔ c.pt.str = ⨅ j, (F.obj j).str.induced (c.π.app j) := by @@ -156,6 +159,7 @@ theorem limit_topology [HasLimit F] : (limit F).str = ⨅ j, (F.obj j).str.induced (limit.π F j) := induced_of_isLimit _ (limit.isLimit _) +set_option backward.isDefEq.respectTransparency.types false in lemma hasLimit_iff_small_sections : HasLimit F ↔ Small.{u} ((F ⋙ forget).sections) := by rw [← Types.hasLimit_iff_small_sections] @@ -198,6 +202,7 @@ instance topologicalSpaceCoconePtOfCoconeForget : TopologicalSpace (coconePtOfCoconeForget c) := (⨆ j, (F.obj j).str.coinduced (c.ι.app j)) +set_option backward.isDefEq.respectTransparency.types false in /-- Given a functor `F : J ⥤ TopCat` and a cocone `c : Cocone (F ⋙ forget)` of the underlying cocone of types, this is a cocone for `F` whose point is `c.pt` with the supremum of the coinduced topologies by the maps `c.ι.app j`. -/ @@ -213,6 +218,7 @@ def coconeOfCoconeForget : Cocone F where ext apply ConcreteCategory.congr_hom (c.ι.naturality φ) } +set_option backward.isDefEq.respectTransparency.types false in /-- Given a functor `F : J ⥤ TopCat` and a cocone `c : Cocone (F ⋙ forget)` of the underlying cocone of types, the colimit of `F` is `c.pt` equipped with the supremum of the coinduced topologies by the maps `c.ι.app j`. -/ @@ -237,6 +243,7 @@ variable (c : Cocone F) (hc : IsColimit c) include hc +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem coinduced_of_isColimit : c.pt.str = ⨆ j, (F.obj j).str.coinduced (c.ι.app j) := by @@ -271,6 +278,7 @@ lemma continuous_iff_of_isColimit {X : Type u'} [TopologicalSpace X] (f : c.pt end IsColimit +set_option backward.isDefEq.respectTransparency.types false in lemma nonempty_isColimit_iff_eq_coinduced (c : Cocone F) (hc : IsColimit ((forget).mapCocone c)) : Nonempty (IsColimit c) ↔ c.pt.str = ⨆ j, (F.obj j).str.coinduced (c.ι.app j) := by refine ⟨fun ⟨hc⟩ ↦ coinduced_of_isColimit _ hc, fun h ↦ ⟨?_⟩⟩ @@ -292,6 +300,7 @@ theorem colimit_isOpen_iff (F : J ⥤ TopCat.{u}) [HasColimit F] IsOpen U ↔ ∀ j, IsOpen (colimit.ι F j ⁻¹' U) := by apply isOpen_iff_of_isColimit _ (colimit.isColimit _) +set_option backward.isDefEq.respectTransparency.types false in lemma hasColimit_iff_small_colimitType : HasColimit F ↔ Small.{u} (F ⋙ forget).ColimitType := by rw [← Types.hasColimit_iff_small_colimitType] diff --git a/Mathlib/Topology/Category/TopCat/Limits/Products.lean b/Mathlib/Topology/Category/TopCat/Limits/Products.lean index 1a323b92a9ab3d..94d85e659189a5 100644 --- a/Mathlib/Topology/Category/TopCat/Limits/Products.lean +++ b/Mathlib/Topology/Category/TopCat/Limits/Products.lean @@ -189,6 +189,7 @@ theorem prod_topology {X Y : TopCat.{u}} : simp [induced_compose] rfl +set_option backward.isDefEq.respectTransparency.types false in theorem range_prod_map {W X Y Z : TopCat.{u}} (f : W ⟶ Y) (g : X ⟶ Z) : Set.range (Limits.prod.map f g) = (Limits.prod.fst : Y ⨯ Z ⟶ _) ⁻¹' Set.range f ∩ @@ -232,6 +233,7 @@ end Prod protected def binaryCofan (X Y : TopCat.{u}) : BinaryCofan X Y := BinaryCofan.mk (ofHom ⟨Sum.inl, by fun_prop⟩) (ofHom ⟨Sum.inr, by fun_prop⟩) +set_option backward.isDefEq.respectTransparency.types false in /-- The constructed binary coproduct cofan in `TopCat` is the coproduct. -/ def binaryCofanIsColimit (X Y : TopCat.{u}) : IsColimit (TopCat.binaryCofan X Y) := by refine Limits.BinaryCofan.isColimitMk (fun s => ofHom diff --git a/Mathlib/Topology/Category/TopCat/OpenNhds.lean b/Mathlib/Topology/Category/TopCat/OpenNhds.lean index 14bf48f2720415..004e7899ef190e 100644 --- a/Mathlib/Topology/Category/TopCat/OpenNhds.lean +++ b/Mathlib/Topology/Category/TopCat/OpenNhds.lean @@ -59,12 +59,14 @@ instance (x : X) : Lattice (OpenNhds x) := le_sup_left := fun U V => @le_sup_left _ _ U.1.1 V.1.1 le_sup_right := fun U V => @le_sup_right _ _ U.1.1 V.1.1 } +set_option backward.isDefEq.respectTransparency.types false in instance (x : X) : OrderTop (OpenNhds x) where top := ⟨⊤, trivial⟩ le_top x := by cases x simp [le_def] +set_option backward.isDefEq.respectTransparency.types false in instance (x : X) : Inhabited (OpenNhds x) := ⟨⊤⟩ @@ -118,10 +120,12 @@ theorem map_id_obj (x : X) (U) : (map (𝟙 X) x).obj U = U := rfl theorem map_id_obj' (x : X) (U) (p) (q) : (map (𝟙 X) x).obj ⟨⟨U, p⟩, q⟩ = ⟨⟨U, p⟩, q⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem map_id_obj_unop (x : X) (U : (OpenNhds x)ᵒᵖ) : (map (𝟙 X) x).obj (unop U) = unop U := by simp +set_option backward.isDefEq.respectTransparency.types false in theorem op_map_id_obj (x : X) (U : (OpenNhds x)ᵒᵖ) : (map (𝟙 X) x).op.obj U = U := by simp /-- `Opens.map f` and `OpenNhds.map f` form a commuting square (up to natural isomorphism) diff --git a/Mathlib/Topology/Category/TopCat/Opens.lean b/Mathlib/Topology/Category/TopCat/Opens.lean index 49df66f4255fac..546b42c50ec79b 100644 --- a/Mathlib/Topology/Category/TopCat/Opens.lean +++ b/Mathlib/Topology/Category/TopCat/Opens.lean @@ -364,6 +364,7 @@ lemma mem_functorObj_iff {X Y : TopCat.{u}} {f : X ⟶ Y} (hf : IsInducing f) (U conv_rhs => rw [← hf.map_functorObj U] rfl +set_option backward.isDefEq.respectTransparency.types false in lemma le_functorObj_iff {X Y : TopCat.{u}} {f : X ⟶ Y} (hf : IsInducing f) {U : Opens X} {V : Opens Y} : V ≤ hf.functorObj U ↔ (Opens.map f).obj V ≤ U := by obtain ⟨U, hU⟩ := U diff --git a/Mathlib/Topology/Category/TopCat/ULift.lean b/Mathlib/Topology/Category/TopCat/ULift.lean index d1f4ec38a06a55..26fe7b61ac6745 100644 --- a/Mathlib/Topology/Category/TopCat/ULift.lean +++ b/Mathlib/Topology/Category/TopCat/ULift.lean @@ -56,6 +56,7 @@ with the one defined on categories of types. -/ def uliftFunctorCompForgetIso : uliftFunctor.{v, u} ⋙ forget TopCat.{max u v} ≅ forget TopCat.{u} ⋙ CategoryTheory.uliftFunctor.{v, u} := Iso.refl _ +set_option backward.isDefEq.respectTransparency.types false in /-- The `ULift` functor on categories of topological spaces is fully faithful. -/ def uliftFunctorFullyFaithful : uliftFunctor.{v, u}.FullyFaithful where preimage f := ofHom ⟨ULift.down ∘ f ∘ ULift.up, by fun_prop⟩ @@ -68,6 +69,7 @@ instance : uliftFunctor.{v, u}.Faithful := open Limits +set_option backward.isDefEq.respectTransparency.types false in instance : PreservesLimitsOfSize.{w', w} uliftFunctor.{v, u} := by refine ⟨⟨fun {K} ↦ ⟨fun {c} hc ↦ ?_⟩⟩⟩ rw [nonempty_isLimit_iff_eq_induced] diff --git a/Mathlib/Topology/Category/TopPair.lean b/Mathlib/Topology/Category/TopPair.lean index b81ecc4af21ae4..4c5742e14ab66c 100644 --- a/Mathlib/Topology/Category/TopPair.lean +++ b/Mathlib/Topology/Category/TopPair.lean @@ -100,6 +100,7 @@ abbrev diag : TopCat.{u} ⥤ TopPair.{u} where obj X := TopPair.of (𝟙 X) Topology.IsEmbedding.id map f := TopPair.ofHom f f +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The inclusion functor is left adjoint to the projection to the first component. -/ @[simps] @@ -152,6 +153,7 @@ def refl (f : X ⟶ Y) : Homotopy f f where instance : Inhabited (Homotopy (𝟙 X) (𝟙 X)) := ⟨Homotopy.refl _⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Given a `Homotopy f₀ f₁`, we can define a `Homotopy f₁ f₀` by `TopCat.Homotopy.symm` on the first and second components. -/ @@ -168,6 +170,7 @@ theorem symm_bijective {f₀ f₁ : X ⟶ Y} : Function.Bijective (Homotopy.symm : Homotopy f₀ f₁ → Homotopy f₁ f₀) := Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Given `Homotopy f₀ f₁` and `Homotopy f₁ f₂`, we can define a `Homotopy f₀ f₂` by `TopCat.Homotopy.trans` on the first and second components. diff --git a/Mathlib/Topology/Category/UniformSpace.lean b/Mathlib/Topology/Category/UniformSpace.lean index 3cfb33de484fce..cb953147e3b0ce 100644 --- a/Mathlib/Topology/Category/UniformSpace.lean +++ b/Mathlib/Topology/Category/UniformSpace.lean @@ -164,19 +164,23 @@ instance instFunLike (X Y : CpltSepUniformSpace) : coe := Subtype.val coe_injective' _ _ h := Subtype.ext h +set_option backward.isDefEq.respectTransparency.types false in /-- The concrete category instance on `CpltSepUniformSpace`. -/ instance concreteCategory : ConcreteCategory CpltSepUniformSpace ({ f : · → · // UniformContinuous f }) := inferInstanceAs <| ConcreteCategory (InducedCategory _ toUniformSpace) _ +set_option backward.isDefEq.respectTransparency.types false in instance hasForgetToUniformSpace : HasForget₂ CpltSepUniformSpace UniformSpaceCat := inferInstanceAs <| HasForget₂ (InducedCategory _ toUniformSpace) _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem hom_comp {X Y Z : CpltSepUniformSpace} (f : X ⟶ Y) (g : Y ⟶ Z) : ConcreteCategory.hom (f ≫ g) = ⟨g ∘ f, g.hom.hom.prop.comp f.hom.hom.prop⟩ := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] theorem hom_id (X : CpltSepUniformSpace) : ConcreteCategory.hom (𝟙 X : X ⟶ X) = ⟨id, uniformContinuous_id⟩ := @@ -195,6 +199,7 @@ open UniformSpace open CpltSepUniformSpace +set_option backward.isDefEq.respectTransparency.types false in /-- The functor turning uniform spaces into complete separated uniform spaces. -/ @[simps map] noncomputable def completionFunctor : UniformSpaceCat ⥤ CpltSepUniformSpace where diff --git a/Mathlib/Topology/CompactOpen.lean b/Mathlib/Topology/CompactOpen.lean index 9a93c054d8f80d..73184e5ecee98e 100644 --- a/Mathlib/Topology/CompactOpen.lean +++ b/Mathlib/Topology/CompactOpen.lean @@ -358,6 +358,7 @@ theorem tendsto_compactOpen_iff_forall {ι : Type*} {l : Filter ι} (F : ι → rw [compactOpen_eq_iInf_induced] simp [nhds_iInf, nhds_induced, Filter.tendsto_comap_iff, Function.comp_def] +set_option backward.isDefEq.respectTransparency false in /-- A family `F` of functions in `C(X, Y)` converges in the compact-open topology, if and only if it converges in the compact-open topology on each compact subset of `X`. -/ theorem exists_tendsto_compactOpen_iff_forall [WeaklyLocallyCompactSpace X] [T2Space Y] diff --git a/Mathlib/Topology/Compactification/OnePoint/ProjectiveLine.lean b/Mathlib/Topology/Compactification/OnePoint/ProjectiveLine.lean index f6aa439273720d..7272d8021ae46c 100644 --- a/Mathlib/Topology/Compactification/OnePoint/ProjectiveLine.lean +++ b/Mathlib/Topology/Compactification/OnePoint/ProjectiveLine.lean @@ -60,6 +60,7 @@ instance {S} [DistribSMul S R] [SMulCommClass R S R] : SMulCommClass (Matrix (Fin 2) (Fin 2) R) S (R × R) := (LinearEquiv.finTwoArrow R R).symm.smulCommClass _ _ +set_option backward.isDefEq.respectTransparency.types false in @[deprecated "use Fin 2 → R instead" (since := "2026-04-19")] lemma Matrix.fin_two_smul_prod (g : Matrix (Fin 2) (Fin 2) R) (v : R × R) : g • v = (g 0 0 * v.1 + g 0 1 * v.2, g 1 0 * v.1 + g 1 1 * v.2) := by @@ -111,6 +112,7 @@ lemma equivProjectivization_apply_coe (t : K) : equivProjectivization K t = mk K ![t, 1] (by simp) := rfl +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma equivProjectivization_symm_apply_mk (v : Fin 2 → K) (h : v ≠ 0) : (equivProjectivization K).symm (mk K v h) = if v 1 = 0 then ∞ else (v 1)⁻¹ * v 0 := by @@ -131,6 +133,7 @@ lemma equivProjectivization_smul {g : GL (Fin 2) K} (x : OnePoint K) : equivProjectivization K (g • x) = g • equivProjectivization K x := by rw [Equiv.smul_def, Equiv.apply_symm_apply] +set_option backward.isDefEq.respectTransparency.types false in lemma smul_infty_def {g : GL (Fin 2) K} : g • ∞ = (equivProjectivization K).symm (.mk K ![g 0 0, g 1 0] (fun h ↦ by simpa [det_fin_two, show g 0 0 = 0 from congr_fun h 0, show g 1 0 = 0 from congr_fun h 1] diff --git a/Mathlib/Topology/Compactification/StoneCech.lean b/Mathlib/Topology/Compactification/StoneCech.lean index d2e261792e3636..338e4da865d620 100644 --- a/Mathlib/Topology/Compactification/StoneCech.lean +++ b/Mathlib/Topology/Compactification/StoneCech.lean @@ -245,6 +245,7 @@ instance [Inhabited α] : Inhabited (PreStoneCech α) := def preStoneCechUnit (x : α) : PreStoneCech α := Quot.mk _ (pure x : Ultrafilter α) +set_option backward.isDefEq.respectTransparency false in theorem continuous_preStoneCechUnit : Continuous (preStoneCechUnit : α → PreStoneCech α) := continuous_iff_ultrafilter.mpr fun x g gx ↦ by have : (g.map pure).toFilter ≤ 𝓝 g := by @@ -370,6 +371,7 @@ variable [CompactSpace β] def stoneCechExtend : StoneCech α → β := T2Quotient.lift (continuous_preStoneCechExtend hg) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma stoneCechExtend_extends : stoneCechExtend hg ∘ stoneCechUnit = g := by ext x diff --git a/Mathlib/Topology/Compactness/Compact.lean b/Mathlib/Topology/Compactness/Compact.lean index 6a17ca00f6f2e4..f45ce1e5567bb9 100644 --- a/Mathlib/Topology/Compactness/Compact.lean +++ b/Mathlib/Topology/Compactness/Compact.lean @@ -671,7 +671,7 @@ variable (X) in /-- Sets that are contained in a compact set form a bornology. Its `cobounded` filter is `Filter.cocompact`. See also `Bornology.relativelyCompact` the bornology of sets with compact closure. -/ -@[implicit_reducible] +@[instance_reducible] def inCompact : Bornology X where cobounded := Filter.cocompact X le_cofinite := Filter.cocompact_le_cofinite diff --git a/Mathlib/Topology/Compactness/CompactlyCoherentSpace.lean b/Mathlib/Topology/Compactness/CompactlyCoherentSpace.lean index 18f43c237d61be..ad1d65b950c285 100644 --- a/Mathlib/Topology/Compactness/CompactlyCoherentSpace.lean +++ b/Mathlib/Topology/Compactness/CompactlyCoherentSpace.lean @@ -161,7 +161,6 @@ the intersection `K ∩ A` is closed in `K`. -/ lemma isClosed_iff {A : Set (𝐤X)} : IsClosed A ↔ ∀ (K : Set X), IsCompact K → IsClosed (K ↓∩ .mk X ⁻¹' A) := by simp_rw [isClosed_coinduced, isClosed_iSup_iff, ← isClosed_coinduced] - rfl lemma continuous_dom_iff {f : 𝐤X → Y} : Continuous f ↔ diff --git a/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean b/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean index d53c24de2df703..cd24e2b28a3f13 100644 --- a/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean +++ b/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean @@ -61,7 +61,7 @@ topology, continuous. Note: this definition should be used with an explicit universe parameter `u` for the size of the compact Hausdorff spaces mapping to `X`. -/ -@[implicit_reducible] +@[instance_reducible] def TopologicalSpace.compactlyGenerated (X : Type w) [TopologicalSpace X] : TopologicalSpace X := let f : (Σ (i : (S : CompHaus.{u}) × C(S, X)), i.fst) → X := fun ⟨⟨_, i⟩, s⟩ ↦ i s coinduced f inferInstance diff --git a/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean b/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean index 808a0556b7a8ce..a6d4c2dd914388 100644 --- a/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean +++ b/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean @@ -33,7 +33,7 @@ variable {X Y : Type*} [tX : TopologicalSpace X] [tY : TopologicalSpace Y] open TopologicalSpace Topology /-- The topology coinduced by all maps from ℝⁿ into a space. -/ -@[implicit_reducible] +@[instance_reducible] def TopologicalSpace.deltaGenerated (X : Type*) [TopologicalSpace X] : TopologicalSpace X := ⨆ f : (n : ℕ) × C(((Fin n) → ℝ), X), coinduced f.2 inferInstance diff --git a/Mathlib/Topology/Compactness/Lindelof.lean b/Mathlib/Topology/Compactness/Lindelof.lean index 1a5ec276e008cf..4f09ec7130646a 100644 --- a/Mathlib/Topology/Compactness/Lindelof.lean +++ b/Mathlib/Topology/Compactness/Lindelof.lean @@ -67,6 +67,7 @@ theorem IsLindelof.compl_mem_sets_of_nhdsWithin (hs : IsLindelof s) {f : Filter rw [← disjoint_principal_right, disjoint_right_comm, (basis_sets _).disjoint_iff_left] exact hf x hx +set_option backward.isDefEq.respectTransparency false in /-- If `p : Set X → Prop` is stable under restriction and union, and each point `x` of a Lindelöf set `s` has a neighborhood `t` within `s` such that `p t`, then `p s` holds. -/ @[elab_as_elim] diff --git a/Mathlib/Topology/Compactness/LocallyFinite.lean b/Mathlib/Topology/Compactness/LocallyFinite.lean index 8d6f5095146f22..62ecb7b52f316e 100644 --- a/Mathlib/Topology/Compactness/LocallyFinite.lean +++ b/Mathlib/Topology/Compactness/LocallyFinite.lean @@ -45,7 +45,7 @@ theorem finite_of_compact [CompactSpace X] {f : ι → Set X} /-- If `X` is a compact space, then a locally finite family of nonempty sets of `X` can have only finitely many elements, `Fintype` version. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def fintypeOfCompact [CompactSpace X] {f : ι → Set X} (hf : LocallyFinite f) (hne : ∀ i, (f i).Nonempty) : Fintype ι := fintypeOfFiniteUniv (hf.finite_of_compact hne) diff --git a/Mathlib/Topology/Compactness/SigmaCompact.lean b/Mathlib/Topology/Compactness/SigmaCompact.lean index 5973273f311ec5..689c1d9ac426b4 100644 --- a/Mathlib/Topology/Compactness/SigmaCompact.lean +++ b/Mathlib/Topology/Compactness/SigmaCompact.lean @@ -280,7 +280,7 @@ protected theorem LocallyFinite.countable_univ {f : ι → Set X} (hf : LocallyF /-- If `f : ι → Set X` is a locally finite covering of a σ-compact topological space by nonempty sets, then the index type `ι` is encodable. -/ -@[implicit_reducible] +@[instance_reducible] protected noncomputable def LocallyFinite.encodable {ι : Type*} {f : ι → Set X} (hf : LocallyFinite f) (hne : ∀ i, (f i).Nonempty) : Encodable ι := @Encodable.ofEquiv _ _ (hf.countable_univ hne).toEncodable (Equiv.Set.univ _).symm diff --git a/Mathlib/Topology/Connected/Clopen.lean b/Mathlib/Topology/Connected/Clopen.lean index 50512fbf37fee3..6500b074d59798 100644 --- a/Mathlib/Topology/Connected/Clopen.lean +++ b/Mathlib/Topology/Connected/Clopen.lean @@ -503,7 +503,7 @@ end Preconnected section connectedComponentSetoid /-- The setoid of connected components of a topological space -/ -@[implicit_reducible] +@[instance_reducible] def connectedComponentSetoid (α : Type*) [TopologicalSpace α] : Setoid α := ⟨fun x y => connectedComponent x = connectedComponent y, ⟨fun x => by trivial, fun h1 => h1.symm, fun h1 h2 => h1.trans h2⟩⟩ diff --git a/Mathlib/Topology/Connected/PathConnected.lean b/Mathlib/Topology/Connected/PathConnected.lean index d2302fd0ec8004..f9bb87d82d3afa 100644 --- a/Mathlib/Topology/Connected/PathConnected.lean +++ b/Mathlib/Topology/Connected/PathConnected.lean @@ -99,7 +99,7 @@ theorem Joined.inv {G : Type*} [Inv G] [TopologicalSpace G] [ContinuousInv G] variable (X) /-- The setoid corresponding the equivalence relation of being joined by a continuous path. -/ -@[implicit_reducible] +@[instance_reducible] def pathSetoid : Setoid X where r := Joined iseqv := Equivalence.mk Joined.refl Joined.symm Joined.trans diff --git a/Mathlib/Topology/Constructible.lean b/Mathlib/Topology/Constructible.lean index ba2cb248d539fb..79a13ca3bf6be9 100644 --- a/Mathlib/Topology/Constructible.lean +++ b/Mathlib/Topology/Constructible.lean @@ -500,6 +500,7 @@ lemma IsLocallyConstructible.inter_of_isOpen_isCompact variable {ι : Type*} {U : ι → Opens X} +set_option backward.isDefEq.respectTransparency false in lemma IsLocallyConstructible.of_isOpenCover (hU : IsOpenCover U) (H : ∀ i, IsLocallyConstructible ((U i : Set X) ↓∩ s)) : IsLocallyConstructible s := by diff --git a/Mathlib/Topology/Constructions.lean b/Mathlib/Topology/Constructions.lean index 03c4a57177fd18..072a4de1ef6869 100644 --- a/Mathlib/Topology/Constructions.lean +++ b/Mathlib/Topology/Constructions.lean @@ -299,6 +299,7 @@ def of : X ≃ CofiniteTopology X := (WithTopology.equiv _ _).symm instance [Inhabited X] : Inhabited (CofiniteTopology X) where default := of default +set_option backward.isDefEq.respectTransparency false in theorem isOpen_iff {s : Set (CofiniteTopology X)} : IsOpen s ↔ s.Nonempty → sᶜ.Finite := by simp_rw [isOpen_coinduced, TopologicalSpace.cofinite, isOpen_mk, ← Set.preimage_compl, WithTopology.preimage_toTopology, image_nonempty, diff --git a/Mathlib/Topology/ContinuousMap/CompactlySupported.lean b/Mathlib/Topology/ContinuousMap/CompactlySupported.lean index afb5c07b019946..845c660fae6ded 100644 --- a/Mathlib/Topology/ContinuousMap/CompactlySupported.lean +++ b/Mathlib/Topology/ContinuousMap/CompactlySupported.lean @@ -667,6 +667,7 @@ open NNReal namespace CompactlySupportedContinuousMap +set_option backward.isDefEq.respectTransparency.types false in protected lemma exists_add_of_le {f₁ f₂ : C_c(α, ℝ≥0)} (h : f₁ ≤ f₂) : ∃ (g : C_c(α, ℝ≥0)), f₁ + g = f₂ := by refine ⟨⟨f₂.1 - f₁.1, ?_⟩, ?_⟩ @@ -793,6 +794,7 @@ end toNNRealLinear section toRealPositiveLinear +set_option backward.isDefEq.respectTransparency false in /-- For a positive linear functional `Λ : C_c(α, ℝ≥0) → ℝ≥0`, define a positive `ℝ`-linear map. -/ noncomputable def toRealPositiveLinear (Λ : C_c(α, ℝ≥0) →ₗ[ℝ≥0] ℝ≥0) : C_c(α, ℝ) →ₚ[ℝ] ℝ := PositiveLinearMap.mk₀ diff --git a/Mathlib/Topology/ContinuousMap/ContinuousMapZero.lean b/Mathlib/Topology/ContinuousMap/ContinuousMapZero.lean index 835996f03c3541..7be8b7ac4423a1 100644 --- a/Mathlib/Topology/ContinuousMap/ContinuousMapZero.lean +++ b/Mathlib/Topology/ContinuousMap/ContinuousMapZero.lean @@ -194,6 +194,7 @@ lemma mkD_of_not_continuousOn {s : Set X} [Zero s] {f : X → R} {g : C(s, R)₀ rw [continuousOn_iff_continuous_restrict] at hf exact mkD_of_not_continuous hf +set_option backward.isDefEq.respectTransparency false in lemma mkD_apply_of_continuousOn {s : Set X} [Zero s] {f : X → R} {g : C(s, R)₀} {x : s} (hf : ContinuousOn f s) (hf₀ : f (0 : s) = 0) : mkD (s.restrict f) g x = f x := by @@ -443,6 +444,7 @@ def nonUnitalStarAlgHom_precomp (f : C(X, Y)₀) : C(Y, R)₀ →⋆ₙₐ[R] C( map_star' _ := rfl map_smul' _ _ := rfl +set_option backward.isDefEq.respectTransparency false in variable (X) in /-- The functor `C(X, ·)₀` from non-unital topological star algebras (with non-unital continuous star homomorphisms) to non-unital star algebras. -/ diff --git a/Mathlib/Topology/ContinuousMap/StoneWeierstrass.lean b/Mathlib/Topology/ContinuousMap/StoneWeierstrass.lean index a974b2c07f52cd..5d1253618b311a 100644 --- a/Mathlib/Topology/ContinuousMap/StoneWeierstrass.lean +++ b/Mathlib/Topology/ContinuousMap/StoneWeierstrass.lean @@ -110,7 +110,7 @@ theorem comp_attachBound_mem_closure (A : Subalgebra ℝ C(X, ℝ)) (f : A) _ ?_ frequently_mem_polynomials -- but need to show that those pullbacks are actually in `A`. rintro _ ⟨g, ⟨-, rfl⟩⟩ - simp only [SetLike.mem_coe, AlgHom.coe_toRingHom, compRightContinuousMap_apply, + simp only [SetLike.mem_coe, AlgHom.coe_toRingHom, Polynomial.toContinuousMapOnAlgHom_apply] apply polynomial_comp_attachBound_mem @@ -364,6 +364,7 @@ state and prove the Stone-Weierstrass theorem, in favor of using `StarSubalgebra which didn't exist at the time Stone-Weierstrass was written. -/ +set_option backward.isDefEq.respectTransparency false in /-- If a star subalgebra of `C(X, 𝕜)` separates points, then the real subalgebra of its purely real-valued elements also separates points. -/ theorem Subalgebra.SeparatesPoints.rclike_to_real {A : StarSubalgebra 𝕜 C(X, 𝕜)} @@ -392,6 +393,7 @@ theorem Subalgebra.SeparatesPoints.rclike_to_real {A : StarSubalgebra 𝕜 C(X, variable [CompactSpace X] +set_option backward.isDefEq.respectTransparency false in /-- The Stone-Weierstrass approximation theorem, `RCLike` version, that a star subalgebra `A` of `C(X, 𝕜)`, where `X` is a compact topological space and `RCLike 𝕜`, is dense if it separates points. -/ @@ -588,6 +590,7 @@ lemma ker_evalStarAlgHom_inter_adjoin_id (s : Set 𝕜) (h0 : 0 ∈ s) : refine fun hf ↦ ⟨?_, nonUnitalStarAlgebraAdjoin_id_subset_ker_evalStarAlgHom h0 hf⟩ exact adjoin_le_starAlgebra_adjoin _ _ hf +set_option backward.isDefEq.respectTransparency false in -- the statement should be in terms of nonunital subalgebras, but we lack API open RingHom Filter Topology in theorem AlgHom.closure_ker_inter {F S K A : Type*} [CommRing K] [Ring A] [Algebra K A] diff --git a/Mathlib/Topology/Convenient/GeneratedBy.lean b/Mathlib/Topology/Convenient/GeneratedBy.lean index 3dd6e77999c945..02ccb6e178dcd0 100644 --- a/Mathlib/Topology/Convenient/GeneratedBy.lean +++ b/Mathlib/Topology/Convenient/GeneratedBy.lean @@ -47,7 +47,7 @@ namespace TopologicalSpace /-- Given a family of topological spaces `X i`, the `X`-generated topology on a topological space `Y` is the topology that is coinduced by all continuous maps `X i → Y`. -/ -@[implicit_reducible] +@[instance_reducible] def generatedBy : TopologicalSpace Y := ⨆ (i : ι) (f : C(X i, Y)), coinduced f inferInstance diff --git a/Mathlib/Topology/Covering/Basic.lean b/Mathlib/Topology/Covering/Basic.lean index 45d1952f2dde26..c907185afb7270 100644 --- a/Mathlib/Topology/Covering/Basic.lean +++ b/Mathlib/Topology/Covering/Basic.lean @@ -96,6 +96,7 @@ noncomputable def toTrivialization {x : X} [Nonempty I] (h : IsEvenlyCovered f x theorem mem_toTrivialization_baseSet {x : X} [Nonempty I] (h : IsEvenlyCovered f x I) : x ∈ h.toTrivialization.baseSet := h.2.choose_spec.1 +set_option backward.isDefEq.respectTransparency.types false in theorem toTrivialization_apply {x : E} [Nonempty I] (h : IsEvenlyCovered f (f x) I) : (h.toTrivialization x).2 = ⟨x, rfl⟩ := h.fiberHomeomorph.symm.injective <| by @@ -139,6 +140,7 @@ theorem of_preimage_eq_empty [IsEmpty I] {x : X} {U : Set X} (hUx : U ∈ 𝓝 x have := Set.isEmpty_coe_sort.mpr hfV ⟨inferInstance, _, hxV, hV, hfV ▸ isOpen_empty, .empty, isEmptyElim⟩ +set_option backward.isDefEq.respectTransparency false in theorem restrictPreimage {x : X} (hxs : x ∈ s) (h : IsEvenlyCovered f x I) : IsEvenlyCovered (s.restrictPreimage f) ⟨x, hxs⟩ I := have ⟨inst, U, hxU, hU, hfU, H, hH⟩ := h diff --git a/Mathlib/Topology/Defs/Filter.lean b/Mathlib/Topology/Defs/Filter.lean index 7b96de027f3295..9739696ec74f4a 100644 --- a/Mathlib/Topology/Defs/Filter.lean +++ b/Mathlib/Topology/Defs/Filter.lean @@ -231,7 +231,7 @@ def specializationPreorder : Preorder X := lt := fun x y => y ⤳ x ∧ ¬x ⤳ y } /-- A `setoid` version of `Inseparable`, used to define the `SeparationQuotient`. -/ -@[implicit_reducible] +@[instance_reducible] def inseparableSetoid : Setoid X := { Setoid.comap 𝓝 ⊥ with r := Inseparable } /-- The quotient of a topological space by its `inseparableSetoid`. Also called the Kolmogorov diff --git a/Mathlib/Topology/Defs/Induced.lean b/Mathlib/Topology/Defs/Induced.lean index c652bd260cf68d..7526293e644df3 100644 --- a/Mathlib/Topology/Defs/Induced.lean +++ b/Mathlib/Topology/Defs/Induced.lean @@ -60,7 +60,7 @@ variable {X Y : Type*} the induced topology on `X` is the collection of sets that are preimages of some open set in `Y`. This is the coarsest topology that makes `f` continuous. -/ -@[implicit_reducible] +@[instance_reducible] def induced (f : X → Y) (t : TopologicalSpace Y) : TopologicalSpace X where IsOpen s := ∃ t, IsOpen t ∧ f ⁻¹' t = s isOpen_univ := ⟨univ, isOpen_univ, preimage_univ⟩ @@ -81,7 +81,7 @@ instance _root_.instTopologicalSpaceSubtype {p : X → Prop} [t : TopologicalSpa the coinduced topology on `Y` is defined such that `s : Set Y` is open if the preimage of `s` is open. This is the finest topology that makes `f` continuous. -/ -@[implicit_reducible] +@[instance_reducible] def coinduced (f : X → Y) (t : TopologicalSpace X) : TopologicalSpace Y where IsOpen s := IsOpen (f ⁻¹' s) isOpen_univ := t.isOpen_univ diff --git a/Mathlib/Topology/EMetricSpace/BoundedVariation.lean b/Mathlib/Topology/EMetricSpace/BoundedVariation.lean index 481d7a7d0357c3..4437f698048340 100644 --- a/Mathlib/Topology/EMetricSpace/BoundedVariation.lean +++ b/Mathlib/Topology/EMetricSpace/BoundedVariation.lean @@ -230,6 +230,7 @@ protected theorem lowerSemicontinuous (s : Set α) : simpa only [UniformOnFun.tendsto_iff_tendstoUniformlyOn, mem_image, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂, tendstoUniformlyOn_singleton_iff_tendsto] using! @tendsto_id _ (𝓝 f) +set_option backward.isDefEq.respectTransparency false in /-- The map `(eVariationOn · s)` is lower semicontinuous for uniform convergence on `s`. -/ theorem lowerSemicontinuous_uniformOn (s : Set α) : LowerSemicontinuous fun f : α →ᵤ[{s}] E => eVariationOn f s := fun f ↦ by diff --git a/Mathlib/Topology/EMetricSpace/Defs.lean b/Mathlib/Topology/EMetricSpace/Defs.lean index 44fa6e9c5e5d8f..d57ad9054044c4 100644 --- a/Mathlib/Topology/EMetricSpace/Defs.lean +++ b/Mathlib/Topology/EMetricSpace/Defs.lean @@ -472,7 +472,7 @@ theorem ordConnected_setOf_eball_subset (x : α) (s : Set α) : OrdConnected { r ⟨fun _ _ _ h₁ _ h₂ => (eball_subset_eball h₂.2).trans h₁⟩ /-- Relation “two points are at a finite edistance” is an equivalence relation. -/ -@[implicit_reducible] +@[instance_reducible] def edistLtTopSetoid : Setoid α where r x y := edist x y < ⊤ iseqv := diff --git a/Mathlib/Topology/EMetricSpace/PairReduction.lean b/Mathlib/Topology/EMetricSpace/PairReduction.lean index 25ff4e7eef21cc..cd242b7a61c0ef 100644 --- a/Mathlib/Topology/EMetricSpace/PairReduction.lean +++ b/Mathlib/Topology/EMetricSpace/PairReduction.lean @@ -243,6 +243,7 @@ lemma one_le_radius_logSizeBallSeq (hJ : J.Nonempty) (ha : 1 < a) (i : ℕ) : | 0 => exact one_le_logSizeRadius ha | i + 1 => exact one_le_logSizeRadius ha +set_option backward.isDefEq.respectTransparency false in lemma point_mem_finset_logSizeBallSeq (hJ : J.Nonempty) (i : ℕ) (h : (logSizeBallSeq J hJ a c i).finset.Nonempty) : (logSizeBallSeq J hJ a c i).point ∈ (logSizeBallSeq J hJ a c i).finset := by @@ -357,6 +358,7 @@ lemma logSizeRadius_le_card_smallBall (hJ : J.Nonempty) (i : ℕ) (ha : 1 < a) : (point_mem_finset_logSizeBallSeq hJ _ h) simp [h] +set_option backward.isDefEq.respectTransparency false in lemma card_pairSet_le (ha : 1 < a) : #(pairSet J a c) ≤ a * #J := by wlog hJ : J.Nonempty · simp [Finset.not_nonempty_iff_eq_empty.mp hJ] diff --git a/Mathlib/Topology/FiberBundle/Basic.lean b/Mathlib/Topology/FiberBundle/Basic.lean index 81c8a34b2ded66..8d81c5830236f1 100644 --- a/Mathlib/Topology/FiberBundle/Basic.lean +++ b/Mathlib/Topology/FiberBundle/Basic.lean @@ -272,6 +272,7 @@ theorem totalSpaceMk_isClosedEmbedding [T1Space B] (x : B) : rw [TotalSpace.range_mk] exact isClosed_singleton.preimage <| continuous_proj F E⟩ +set_option backward.isDefEq.respectTransparency false in /-- An arbitrary homeomorphism between any fiber and the model fiber. This is useful to transfer topological properties of the model fiber. -/ noncomputable def homeomorphAt (b : B) : E b ≃ₜ F := @@ -491,6 +492,7 @@ theorem mem_trivChange_source (i j : ι) (p : B × F) : rw [trivChange, mem_prod] simp +set_option backward.isDefEq.respectTransparency false in /-- Associate to a trivialization index `i : ι` the corresponding trivialization, i.e., a bijection between `proj ⁻¹ (baseSet i)` and `baseSet i × F`. As the fiber above `x` is `F` but read in the chart with index `index_at x`, the trivialization in the fiber above x is by definition the @@ -661,6 +663,7 @@ theorem localTriv_apply (p : Z.TotalSpace) : (Z.localTriv i) p = ⟨p.1, Z.coordChange (Z.indexAt p.1) i p.1 p.2⟩ := rfl +set_option backward.isDefEq.respectTransparency false in @[simp, mfld_simps] theorem localTrivAt_apply (p : Z.TotalSpace) : (Z.localTrivAt p.1) p = ⟨p.1, p.2⟩ := by rw [localTrivAt, localTriv_apply, coordChange_self] @@ -762,7 +765,7 @@ variable {F E} variable (a : FiberPrebundle F E) {e : Pretrivialization F (π F E)} /-- Topology on the total space that will make the prebundle into a bundle. -/ -@[implicit_reducible] +@[instance_reducible] def totalSpaceTopology (a : FiberPrebundle F E) : TopologicalSpace (TotalSpace F E) := ⨆ (e : Pretrivialization F (π F E)) (_ : e ∈ a.pretrivializationAtlas), coinduced e.setSymm instTopologicalSpaceSubtype @@ -844,7 +847,7 @@ number of "pretrivializations" identifying parts of `E` with product spaces `U establishes that for the topology constructed on the sigma-type using `FiberPrebundle.totalSpaceTopology`, these "pretrivializations" are actually "trivializations" (i.e., homeomorphisms with respect to the constructed topology). -/ -@[implicit_reducible] +@[instance_reducible] def toFiberBundle : @FiberBundle B F _ _ E a.totalSpaceTopology _ := let _ := a.totalSpaceTopology { totalSpaceMk_isInducing' := fun b ↦ a.inducing_totalSpaceMk_of_inducing_comp b diff --git a/Mathlib/Topology/FiberBundle/Constructions.lean b/Mathlib/Topology/FiberBundle/Constructions.lean index d3dca3611b0892..bba17015e32718 100644 --- a/Mathlib/Topology/FiberBundle/Constructions.lean +++ b/Mathlib/Topology/FiberBundle/Constructions.lean @@ -65,6 +65,7 @@ def trivialization : Trivialization F (π F (Bundle.Trivial B F)) where proj_toFun _ _ := rfl set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in @[simp] lemma trivialization_symm_apply [Zero F] (b : B) (f : F) : (trivialization B F).symm b f = f := by simp [trivialization, homeomorphProd, TotalSpace.toProd, Trivialization.symm, @@ -263,7 +264,7 @@ instance [∀ x : B, TopologicalSpace (E x)] : ∀ x : B', TopologicalSpace ((f variable [TopologicalSpace B'] [TopologicalSpace (TotalSpace F E)] --- adding `@[implicit_reducible]` causes downstream breakage +-- adding `@[instance_reducible]` causes downstream breakage set_option warn.classDefReducibility false in /-- Definition of `Pullback.TotalSpace.topologicalSpace`, which we make irreducible. -/ irreducible_def pullbackTopology : TopologicalSpace (TotalSpace F (f *ᵖ E)) := @@ -303,6 +304,7 @@ theorem Pullback.continuous_totalSpaceMk [∀ x, TopologicalSpace (E x)] [FiberB variable {E F} variable [∀ _b, Zero (E _b)] {K : Type U} [FunLike K B' B] [ContinuousMapClass K B' B] +set_option backward.isDefEq.respectTransparency false in /-- A fiber bundle trivialization can be pulled back to a trivialization on the pullback bundle. -/ @[simps] noncomputable def Bundle.Trivialization.pullback (e : Trivialization F (π F E)) (f : K) : diff --git a/Mathlib/Topology/FiberBundle/Trivialization.lean b/Mathlib/Topology/FiberBundle/Trivialization.lean index a3b14ce26719a8..1c6e10c4354115 100644 --- a/Mathlib/Topology/FiberBundle/Trivialization.lean +++ b/Mathlib/Topology/FiberBundle/Trivialization.lean @@ -866,6 +866,7 @@ theorem frontier_preimage (e : Trivialization F proj) (s : Set B) : rw [← (e.isImage_preimage_prod s).frontier.preimage_eq, frontier_prod_univ_eq, (e.isImage_preimage_prod _).preimage_eq, e.source_eq, preimage_inter] +set_option backward.isDefEq.respectTransparency false in open Classical in /-- Given two bundle trivializations `e`, `e'` of `proj : Z → B` and a set `s : Set B` such that the base sets of `e` and `e'` intersect `frontier s` on the same set and `e p = e' p` whenever diff --git a/Mathlib/Topology/FiberPartition.lean b/Mathlib/Topology/FiberPartition.lean index 56c7a52991016e..4f7a87c1a7db0e 100644 --- a/Mathlib/Topology/FiberPartition.lean +++ b/Mathlib/Topology/FiberPartition.lean @@ -36,6 +36,7 @@ def sigmaIsoHom : C((x : Fiber f) × x.val, S) where toFun | ⟨a, x⟩ => x.val continuous_toFun := continuous_sigma (by fun_prop) +set_option backward.isDefEq.respectTransparency false in lemma sigmaIsoHom_inj : Function.Injective (sigmaIsoHom f) := by rintro ⟨⟨_, _, rfl⟩, ⟨_, hx⟩⟩ ⟨⟨_, _, rfl⟩, ⟨_, hy⟩⟩ h refine Sigma.subtype_ext ?_ h @@ -50,6 +51,7 @@ lemma sigmaIsoHom_surj : Function.Surjective (sigmaIsoHom f) := def sigmaIncl (a : Fiber f) : C(a.val, S) where toFun x := x.val +set_option backward.isDefEq.respectTransparency false in /-- The inclusion map from a fiber of a composition into the intermediate fiber. -/ def sigmaInclIncl {X : Type*} (g : Y → X) (a : Fiber (g ∘ f)) (b : Fiber (f ∘ (sigmaIncl (g ∘ f) a))) : diff --git a/Mathlib/Topology/Filter.lean b/Mathlib/Topology/Filter.lean index e78d810e846fc9..e2118c12d7bf22 100644 --- a/Mathlib/Topology/Filter.lean +++ b/Mathlib/Topology/Filter.lean @@ -69,6 +69,7 @@ theorem isOpen_iff {s : Set (Filter α)} : IsOpen s ↔ ∃ T : Set (Set α), s isTopologicalBasis_Iic_principal.open_iff_eq_sUnion.trans <| by simp only [exists_subset_range_and_iff, sUnion_image, (· ∘ ·)] +set_option backward.isDefEq.respectTransparency false in theorem nhds_eq (l : Filter α) : 𝓝 l = l.lift' (Iic ∘ 𝓟) := nhds_generateFrom.trans <| by simp only [mem_setOf_eq, @and_comm (l ∈ _), iInf_and, iInf_range, Filter.lift', Filter.lift, diff --git a/Mathlib/Topology/Gluing.lean b/Mathlib/Topology/Gluing.lean index 7ef34eddab6686..193b58f6ab45b3 100644 --- a/Mathlib/Topology/Gluing.lean +++ b/Mathlib/Topology/Gluing.lean @@ -172,6 +172,7 @@ theorem eqvGen_of_π_eq colimit.isoColimitCocone_ι_hom, Category.id_comp] at this exact Quot.eq.1 this +set_option backward.isDefEq.respectTransparency.types false in theorem ι_eq_iff_rel (i j : D.J) (x : D.U i) (y : D.U j) : 𝖣.ι i x = 𝖣.ι j y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩ := by constructor @@ -379,6 +380,7 @@ theorem ι_fromOpenSubsetsGlue (i : J) : (ofOpenSubsets U).toGlueData.ι i ≫ fromOpenSubsetsGlue U = Opens.inclusion' _ := Multicoequalizer.π_desc _ _ _ _ _ +set_option backward.isDefEq.respectTransparency.types false in theorem fromOpenSubsetsGlue_injective : Function.Injective (fromOpenSubsetsGlue U) := by intro x y e obtain ⟨i, ⟨x, hx⟩, rfl⟩ := (ofOpenSubsets U).ι_jointly_surjective x @@ -412,6 +414,7 @@ theorem fromOpenSubsetsGlue_isOpenEmbedding : IsOpenEmbedding (fromOpenSubsetsGl .of_continuous_injective_isOpenMap (ContinuousMap.continuous_toFun _) (fromOpenSubsetsGlue_injective U) (fromOpenSubsetsGlue_isOpenMap U) +set_option backward.isDefEq.respectTransparency.types false in theorem range_fromOpenSubsetsGlue : Set.range (fromOpenSubsetsGlue U) = ⋃ i, (U i : Set α) := by ext constructor diff --git a/Mathlib/Topology/Homeomorph/Lemmas.lean b/Mathlib/Topology/Homeomorph/Lemmas.lean index 61b547cedb9a99..b9112cae23c642 100644 --- a/Mathlib/Topology/Homeomorph/Lemmas.lean +++ b/Mathlib/Topology/Homeomorph/Lemmas.lean @@ -172,6 +172,7 @@ abbrev sets {s : Set X} {t : Set Y} (h : X ≃ₜ Y) (h_eq : s = h ⁻¹' t) : s h.subtype <| Set.ext_iff.mp h_eq set_option backward.defeqAttrib.useBackward true in +set_option backward.isDefEq.respectTransparency false in /-- If two sets are equal, then they are homeomorphic. -/ def setCongr {s t : Set X} (h : s = t) : s ≃ₜ t where toEquiv := Equiv.setCongr h @@ -272,6 +273,7 @@ def piCongr {ι₁ ι₂ : Type*} {Y₁ : ι₁ → Type*} {Y₂ : ι₂ → Typ def ulift.{u, v} {X : Type v} [TopologicalSpace X] : ULift.{u, v} X ≃ₜ X where toEquiv := Equiv.ulift +set_option backward.isDefEq.respectTransparency false in /-- The natural homeomorphism `(ι ⊕ ι' → X) ≃ₜ (ι → X) × (ι' → X)`. `Equiv.sumArrowEquivProdArrow` as a homeomorphism. -/ @[simps!] diff --git a/Mathlib/Topology/Homotopy/Basic.lean b/Mathlib/Topology/Homotopy/Basic.lean index 76f25b98166ced..b6f4263caf0c03 100644 --- a/Mathlib/Topology/Homotopy/Basic.lean +++ b/Mathlib/Topology/Homotopy/Basic.lean @@ -245,6 +245,7 @@ theorem trans_apply {f₀ f₁ f₂ : C(X, Y)} (F : Homotopy f₀ f₁) (G : Hom · rw [extend, ContinuousMap.coe_IccExtend, Set.IccExtend_of_mem] rfl +set_option backward.isDefEq.respectTransparency false in theorem symm_trans {f₀ f₁ f₂ : C(X, Y)} (F : Homotopy f₀ f₁) (G : Homotopy f₁ f₂) : (F.trans G).symm = G.symm.trans F.symm := by ext ⟨t, _⟩ diff --git a/Mathlib/Topology/Homotopy/HSpaces.lean b/Mathlib/Topology/Homotopy/HSpaces.lean index 73ab1e2285b428..6ff9e9a8344ad2 100644 --- a/Mathlib/Topology/Homotopy/HSpaces.lean +++ b/Mathlib/Topology/Homotopy/HSpaces.lean @@ -113,7 +113,7 @@ namespace IsTopologicalGroup lead to a diamond since a topological field would inherit two `HSpace` structures, one from the `MulOneClass` and one from the `AddZeroClass`. In the case of a group, we make `IsTopologicalGroup.hSpace` an instance." -/ -@[to_additive (attr := implicit_reducible) +@[to_additive (attr := instance_reducible) /-- The definition `toHSpace` is not an instance because it comes together with a multiplicative version which would lead to a diamond since a topological field would inherit two `HSpace` structures, one from the `MulOneClass` and one from the `AddZeroClass`. diff --git a/Mathlib/Topology/Homotopy/HomotopyGroup.lean b/Mathlib/Topology/Homotopy/HomotopyGroup.lean index 44f28522bd4748..81af9449d84857 100644 --- a/Mathlib/Topology/Homotopy/HomotopyGroup.lean +++ b/Mathlib/Topology/Homotopy/HomotopyGroup.lean @@ -192,6 +192,7 @@ def currySum (q : Ω^ (M ⊕ N) X x) : C(I^M, Ω^ N X x) where ⟨sumArrowHomeomorphProdArrow.invFun, sumArrowHomeomorphProdArrow.continuous_invFun⟩).curry.continuous_toFun _ +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma currySum_apply_inl_inr (p : Ω^ (M ⊕ N) X x) (y : I^(M ⊕ N)) : currySum x p (y ∘ Sum.inl) (y ∘ Sum.inr) = p y := by @@ -211,6 +212,7 @@ protected def uncurry (p : Ω^ M (Ω^ N X x) const) : C((I^M) × (I^N), X) := lemma uncurry_apply (p : Ω^ M (Ω^ N X x) const) (y : (I^M) × (I^N)) : GenLoop.uncurry x p y = p y.1 y.2 := rfl +set_option backward.isDefEq.respectTransparency.types false in /-- `Ω^M (Ω^N X) ≃ₜ Ω^(M ⊕ N) X`. -/ @[simps] def genLoopGenLoopEquiv : Ω^ M (Ω^ N X x) GenLoop.const ≃ₜ Ω^ (M ⊕ N) X x where @@ -341,6 +343,7 @@ theorem homotopyTo_apply (i : N) {p q : Ω^ N X x} (H : p.1.HomotopyRel q.1 <| C homotopyTo i H t tₙ = H (t.fst, Cube.insertAt i (t.snd, tₙ)) := rfl +set_option backward.isDefEq.respectTransparency.types false in theorem homotopicTo (i : N) {p q : Ω^ N X x} : Homotopic p q → (toLoop i p).Homotopic (toLoop i q) := by refine Nonempty.map fun H ↦ ⟨⟨⟨fun t ↦ ⟨homotopyTo i H t, ?_⟩, ?_⟩, ?_, ?_⟩, ?_⟩ @@ -531,7 +534,7 @@ lemma HomotopyGroup.genLoopEquivOfUnique_transAt (N) [DecidableEq N] [Unique N] (genLoopEquivOfUnique _ q).trans (genLoopEquivOfUnique _ p) := by ext t simp only [genLoopEquivOfUnique, GenLoop.transAt, GenLoop.copy, - one_div, Equiv.coe_fn_mk, GenLoop.mk_apply, ContinuousMap.coe_mk, Path.coe_mk', Path.trans, + one_div, ContinuousMap.coe_mk, Path.coe_mk', Path.trans, Function.comp_apply] refine ite_congr rfl (fun _ ↦ congrArg q ?_) fun _ ↦ congrArg p ?_ diff --git a/Mathlib/Topology/Homotopy/Lifting.lean b/Mathlib/Topology/Homotopy/Lifting.lean index 1178bed0e81c2b..fcd25b7b570bed 100644 --- a/Mathlib/Topology/Homotopy/Lifting.lean +++ b/Mathlib/Topology/Homotopy/Lifting.lean @@ -323,6 +323,7 @@ lemma eq_liftHomotopy_iff' (H' : C(I × A, E)) : variable {f₀ f₁ : C(A, X)} {S : Set A} (F : f₀.HomotopyRel f₁ S) +set_option backward.isDefEq.respectTransparency.types false in open ContinuousMap in /-- The lift to a covering space of a homotopy between two continuous maps relative to a set given compatible lifts of the continuous maps. -/ @@ -346,6 +347,7 @@ noncomputable def liftHomotopyRel [PreconnectedSpace A] exact (congr_fun (cov.liftHomotopy_lifts F f₀' _) (1, a)).trans (F.apply_one a) prop' := rel } +set_option backward.isDefEq.respectTransparency.types false in /-- Two continuous maps from a preconnected space to the total space of a covering map are homotopic relative to a set `S` if and only if their compositions with the covering map are homotopic relative to `S`, assuming that they agree at a point in `S`. -/ @@ -354,6 +356,7 @@ theorem homotopicRel_iff_comp [PreconnectedSpace A] {f₀ f₁ : C(A, E)} {S : S (ContinuousMap.comp ⟨p, cov.continuous⟩ f₀).HomotopicRel (.comp ⟨p, cov.continuous⟩ f₁) S := ⟨fun ⟨F⟩ ↦ ⟨F.compContinuousMap _⟩, fun ⟨F⟩ ↦ ⟨cov.liftHomotopyRel F he rfl rfl⟩⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Lifting two paths that are homotopic relative to `{0,1}` starting from the same point also ends up in the same point. -/ theorem liftPath_apply_one_eq_of_homotopicRel {γ₀ γ₁ : C(I, X)} diff --git a/Mathlib/Topology/Homotopy/Path.lean b/Mathlib/Topology/Homotopy/Path.lean index 1055835b65e55b..dc3206ff5677c2 100644 --- a/Mathlib/Topology/Homotopy/Path.lean +++ b/Mathlib/Topology/Homotopy/Path.lean @@ -401,6 +401,7 @@ theorem mk_map (P₀ : Path x₀ x₁) (f : C(X, Y)) : mk (P₀.map f.continuous end Quotient +set_option backward.isDefEq.respectTransparency false in -- Porting note: we didn't previously need the `α := ...` and `β := ...` hints. theorem hpath_hext {p₁ : Path x₀ x₁} {p₂ : Path x₂ x₃} (hp : ∀ t, p₁ t = p₂ t) : HEq (α := Path.Homotopic.Quotient _ _) ⟦p₁⟧ (β := Path.Homotopic.Quotient _ _) ⟦p₂⟧ := by diff --git a/Mathlib/Topology/Homotopy/Product.lean b/Mathlib/Topology/Homotopy/Product.lean index 4c2cd1f53d3a57..1b01a8c4968163 100644 --- a/Mathlib/Topology/Homotopy/Product.lean +++ b/Mathlib/Topology/Homotopy/Product.lean @@ -119,6 +119,7 @@ def pi (γ : ∀ i, Path.Homotopic.Quotient (as i) (bs i)) : Path.Homotopic.Quot (_root_.Quotient.map Path.pi fun x y hxy => Nonempty.map (piHomotopy x y) (Classical.nonempty_pi.mpr hxy)) (Quotient.choice γ) +set_option backward.isDefEq.respectTransparency false in theorem pi_lift (γ : ∀ i, Path (as i) (bs i)) : (Path.Homotopic.pi fun i => (Quotient.mk (γ i))) = Quotient.mk (Path.pi γ) := by simp_rw [← Quotient.mk'_eq_mk, Quotient.mk', pi, Quotient.choice_eq, Quotient.map_mk] diff --git a/Mathlib/Topology/Homotopy/TopCat/Basic.lean b/Mathlib/Topology/Homotopy/TopCat/Basic.lean index 6a13a15131c4a3..f5014235193b97 100644 --- a/Mathlib/Topology/Homotopy/TopCat/Basic.lean +++ b/Mathlib/Topology/Homotopy/TopCat/Basic.lean @@ -74,6 +74,7 @@ abbrev comp {f₀ f₁ : X ⟶ Y} {g₀ g₁ : Y ⟶ Z} (G : Homotopy g₀ g₁) attribute [nolint simpNF] comp_apply +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma h_comp {f₀ f₁ : X ⟶ Y} {g₀ g₁ : Y ⟶ Z} (G : Homotopy g₀ g₁) (F : Homotopy f₀ f₁) : (G.comp F).h = X ◁ lift (𝟙 I) (𝟙 I) ≫ (α_ _ _ _).inv ≫ F.h ▷ _ ≫ G.h := by diff --git a/Mathlib/Topology/Instances/AddCircle/Defs.lean b/Mathlib/Topology/Instances/AddCircle/Defs.lean index 19d0f23e4a5ce7..f8000183174827 100644 --- a/Mathlib/Topology/Instances/AddCircle/Defs.lean +++ b/Mathlib/Topology/Instances/AddCircle/Defs.lean @@ -658,6 +658,7 @@ lemma isOfFinAddOrder_iff_exists_rat_eq_div {a : 𝕜} : variable (p) +set_option backward.isDefEq.respectTransparency false in /-- The natural bijection between points of order `n` and natural numbers less than and coprime to `n`. The inverse of the map sends `m ↦ (m/n * p : AddCircle p)` where `m` is coprime to `n` and satisfies `0 ≤ m < n`. -/ diff --git a/Mathlib/Topology/Instances/CantorSet.lean b/Mathlib/Topology/Instances/CantorSet.lean index e25462d8d148d2..61a82402ac10e1 100644 --- a/Mathlib/Topology/Instances/CantorSet.lean +++ b/Mathlib/Topology/Instances/CantorSet.lean @@ -115,6 +115,7 @@ theorem cantorSet_eq_union_halves : Function.comp_def, ← preCantorSet_succ] exact (preCantorSet_antitone.iInter_nat_add _).symm +set_option backward.isDefEq.respectTransparency false in /-- The preCantor sets are closed. -/ lemma isClosed_preCantorSet (n : ℕ) : IsClosed (preCantorSet n) := by let f := Homeomorph.mulLeft₀ (1 / 3 : ℝ) (by simp) diff --git a/Mathlib/Topology/Instances/Complex.lean b/Mathlib/Topology/Instances/Complex.lean index cab97bbcf862d4..758d20a0d16d54 100644 --- a/Mathlib/Topology/Instances/Complex.lean +++ b/Mathlib/Topology/Instances/Complex.lean @@ -47,6 +47,7 @@ theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set simp only [image_univ] rfl +set_option backward.isDefEq.respectTransparency.types false in /-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the complex conjugation. -/ diff --git a/Mathlib/Topology/Instances/ENNReal/Lemmas.lean b/Mathlib/Topology/Instances/ENNReal/Lemmas.lean index 1e3ffeaae4adad..f4e2a5b1510c11 100644 --- a/Mathlib/Topology/Instances/ENNReal/Lemmas.lean +++ b/Mathlib/Topology/Instances/ENNReal/Lemmas.lean @@ -569,7 +569,7 @@ theorem edist_ne_top_of_mem_ball {a : β} {r : ℝ≥0∞} (x y : eball a r) : e /-- Each ball in an extended metric space gives us a metric space, as the edist is everywhere finite. -/ -@[implicit_reducible] +@[instance_reducible] def metricSpaceEMetricBall (a : β) (r : ℝ≥0∞) : MetricSpace (eball a r) := EMetricSpace.toMetricSpace edist_ne_top_of_mem_ball diff --git a/Mathlib/Topology/Irreducible.lean b/Mathlib/Topology/Irreducible.lean index bc629d63d1b7bf..f114033eaa316d 100644 --- a/Mathlib/Topology/Irreducible.lean +++ b/Mathlib/Topology/Irreducible.lean @@ -499,6 +499,7 @@ lemma image_mem_irreducibleComponents_of_isPreirreducible_fiber rw [← Set.image_preimage_eq Z hf₄] exact Set.image_mono this⟩ +set_option backward.isDefEq.respectTransparency false in /-- If `f : X → Y` is continuous, open, and has irreducible fibers, then it induces an bijection between irreducible components -/ @[stacks 037A] diff --git a/Mathlib/Topology/IsClosedRestrict.lean b/Mathlib/Topology/IsClosedRestrict.lean index 8d0962c2c569c1..0c084bd1a16a3e 100644 --- a/Mathlib/Topology/IsClosedRestrict.lean +++ b/Mathlib/Topology/IsClosedRestrict.lean @@ -93,6 +93,7 @@ def _root_.Homeomorph.preimageImageRestrict (α : ι → Type*) [∀ i, Topologi exact fun _ ↦ (continuous_apply _).comp continuous_subtype_val continuous_invFun := continuous_reorderRestrictProd.subtype_mk _ +set_option backward.isDefEq.respectTransparency false in /-- The image by `preimageImageRestrict α S s` of `s` seen as a set of `Sᶜ.restrict ⁻¹' Sᶜ.restrict '' s` is a set of `Sᶜ.restrict '' s × (Π i : S, α i)`, and the image of that set by `Prod.snd` is `S.restrict '' s`. diff --git a/Mathlib/Topology/IsLocalHomeomorph.lean b/Mathlib/Topology/IsLocalHomeomorph.lean index d921565a34f7c1..ecfd4ceb5547d6 100644 --- a/Mathlib/Topology/IsLocalHomeomorph.lean +++ b/Mathlib/Topology/IsLocalHomeomorph.lean @@ -63,6 +63,7 @@ namespace IsLocalHomeomorphOn variable {f s} +set_option backward.isDefEq.respectTransparency false in theorem discreteTopology_of_image (h : IsLocalHomeomorphOn f s) [DiscreteTopology (f '' s)] : DiscreteTopology s := discreteTopology_iff_isOpen_singleton.mpr fun x ↦ by diff --git a/Mathlib/Topology/MetricSpace/CauSeqFilter.lean b/Mathlib/Topology/MetricSpace/CauSeqFilter.lean index 637290461bf182..9a3bfc8747f762 100644 --- a/Mathlib/Topology/MetricSpace/CauSeqFilter.lean +++ b/Mathlib/Topology/MetricSpace/CauSeqFilter.lean @@ -83,6 +83,7 @@ theorem isCauSeq_iff_cauchySeq {α : Type u} [NormedField α] {u : ℕ → α} : IsCauSeq norm u ↔ CauchySeq u := ⟨fun h => CauSeq.cauchySeq ⟨u, h⟩, fun h => h.isCauSeq⟩ +set_option backward.isDefEq.respectTransparency.types false in -- see Note [lower instance priority] /-- A complete normed field is complete as a metric space, as Cauchy sequences converge by assumption and this suffices to characterize completeness. -/ diff --git a/Mathlib/Topology/MetricSpace/Defs.lean b/Mathlib/Topology/MetricSpace/Defs.lean index ab9838b78440c5..ea0146125f8443 100644 --- a/Mathlib/Topology/MetricSpace/Defs.lean +++ b/Mathlib/Topology/MetricSpace/Defs.lean @@ -78,7 +78,7 @@ theorem MetricSpace.ext {α : Type*} {m m' : MetricSpace α} (h : m.toDist = m'. /-- Construct a metric space structure whose underlying topological space structure (definitionally) agrees which a pre-existing topology which is compatible with a given distance function. -/ -@[implicit_reducible] +@[instance_reducible] def MetricSpace.ofDistTopology {α : Type u} [TopologicalSpace α] (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x) (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) diff --git a/Mathlib/Topology/MetricSpace/Gluing.lean b/Mathlib/Topology/MetricSpace/Gluing.lean index b9ba57063d8c42..4441ac9c55b129 100644 --- a/Mathlib/Topology/MetricSpace/Gluing.lean +++ b/Mathlib/Topology/MetricSpace/Gluing.lean @@ -183,7 +183,7 @@ set_option backward.privateInPublic.warn false in `Φ p` and `Φ q`, and between `Ψ p` and `Ψ q`, coincide up to `2 ε` where `ε > 0`, one can almost glue the two spaces `X` and `Y` along the images of `Φ` and `Ψ`, so that `Φ p` and `Ψ p` are at distance `ε`. -/ -@[implicit_reducible] +@[instance_reducible] def glueMetricApprox [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε) (H : ∀ p q, |dist (Φ p) (Φ q) - dist (Ψ p) (Ψ q)| ≤ 2 * ε) : MetricSpace (X ⊕ Y) where dist := glueDist Φ Ψ ε @@ -468,7 +468,7 @@ set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a pseudometric space structure on `X ⊕ Y` by declaring that `Φ x` and `Ψ x` are at distance `0`. -/ -@[implicit_reducible] +@[instance_reducible] def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (X ⊕ Y) where dist := glueDist Φ Ψ 0 dist_self := glueDist_self Φ Ψ 0 diff --git a/Mathlib/Topology/MetricSpace/GromovHausdorff.lean b/Mathlib/Topology/MetricSpace/GromovHausdorff.lean index 70934af7912b61..eed14be355cac0 100644 --- a/Mathlib/Topology/MetricSpace/GromovHausdorff.lean +++ b/Mathlib/Topology/MetricSpace/GromovHausdorff.lean @@ -97,6 +97,8 @@ instance : Inhabited GHSpace := def GHSpace.Rep (p : GHSpace) : Type := (Quotient.out p : NonemptyCompacts ℓ_infty_ℝ) +-- TODO: `respectTransparency false` necessary since `Set.Mem` was made implicit-reducible +set_option backward.isDefEq.respectTransparency false in theorem eq_toGHSpace_iff {X : Type u} [MetricSpace X] [CompactSpace X] [Nonempty X] {p : NonemptyCompacts ℓ_infty_ℝ} : ⟦p⟧ = toGHSpace X ↔ ∃ Ψ : X → ℓ_infty_ℝ, Isometry Ψ ∧ range Ψ = p := by @@ -612,6 +614,7 @@ theorem ghDist_le_of_approx_subsets {s : Set X} (Φ : s → Y) {ε₁ ε₂ ε end --section +set_option backward.isDefEq.respectTransparency false in /-- The Gromov-Hausdorff space is second countable. -/ instance : SecondCountableTopology GHSpace := by refine secondCountable_of_countable_discretization fun δ δpos => ?_ diff --git a/Mathlib/Topology/MetricSpace/PiNat.lean b/Mathlib/Topology/MetricSpace/PiNat.lean index a074e24c734a3a..60021d46b4b02a 100644 --- a/Mathlib/Topology/MetricSpace/PiNat.lean +++ b/Mathlib/Topology/MetricSpace/PiNat.lean @@ -402,7 +402,7 @@ protected def metricSpace : MetricSpace (∀ n, E n) := /-- Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete uniformity, where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and `y` differ. Not registered as a global instance by default. -/ -@[implicit_reducible] +@[instance_reducible] protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type*} [∀ n, UniformSpace (E n)] (h : ∀ n, uniformity (E n) = 𝓟 SetRel.id) : MetricSpace (∀ n, E n) := haveI : ∀ n, DiscreteTopology (E n) := fun n => discreteTopology_of_discrete_uniformity (h n) @@ -438,7 +438,7 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type*} [∀ n, Unifor /-- Metric space structure on `ℕ → ℕ` where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and `y` differ. Not registered as a global instance by default. -/ -@[implicit_reducible] +@[instance_reducible] def metricSpaceNatNat : MetricSpace (ℕ → ℕ) := PiNat.metricSpaceOfDiscreteUniformity fun _ => rfl @@ -959,7 +959,7 @@ variable [∀ i, MetricSpace (F i)] It is highly non-canonical, though, and therefore not registered as a global instance. The distance we use here is `edist x y = ∑' i, min (1/2)^(encode i) (edist (x i) (y i))`. -/ -@[implicit_reducible] +@[instance_reducible] protected def metricSpace : MetricSpace (∀ i, F i) := EMetricSpace.toMetricSpaceOfDist dist (by simp) (by simp [edist_dist]) diff --git a/Mathlib/Topology/MetricSpace/Pseudo/Constructions.lean b/Mathlib/Topology/MetricSpace/Pseudo/Constructions.lean index b8c6b9bf74083b..9ae3a686395e58 100644 --- a/Mathlib/Topology/MetricSpace/Pseudo/Constructions.lean +++ b/Mathlib/Topology/MetricSpace/Pseudo/Constructions.lean @@ -40,7 +40,7 @@ abbrev PseudoMetricSpace.induced {α β} (f : α → β) (m : PseudoMetricSpace /-- Pull back a pseudometric space structure by an inducing map. This is a version of `PseudoMetricSpace.induced` useful in case if the domain already has a `TopologicalSpace` structure. -/ -@[implicit_reducible] +@[instance_reducible] def Topology.IsInducing.comapPseudoMetricSpace {α β : Type*} [TopologicalSpace α] [m : PseudoMetricSpace β] {f : α → β} (hf : IsInducing f) : PseudoMetricSpace α := .replaceTopology (.induced f m) hf.eq_induced @@ -48,7 +48,7 @@ def Topology.IsInducing.comapPseudoMetricSpace {α β : Type*} [TopologicalSpace /-- Pull back a pseudometric space structure by a uniform inducing map. This is a version of `PseudoMetricSpace.induced` useful in case if the domain already has a `UniformSpace` structure. -/ -@[implicit_reducible] +@[instance_reducible] def IsUniformInducing.comapPseudoMetricSpace {α β} [UniformSpace α] [m : PseudoMetricSpace β] (f : α → β) (h : IsUniformInducing f) : PseudoMetricSpace α := .replaceUniformity (.induced f m) h.comap_uniformity.symm diff --git a/Mathlib/Topology/MetricSpace/Pseudo/Defs.lean b/Mathlib/Topology/MetricSpace/Pseudo/Defs.lean index 068df13358486f..c9b29a9d1194ae 100644 --- a/Mathlib/Topology/MetricSpace/Pseudo/Defs.lean +++ b/Mathlib/Topology/MetricSpace/Pseudo/Defs.lean @@ -71,7 +71,7 @@ theorem UniformSpace.ofDist_aux (ε : ℝ) (hε : 0 < ε) : ∃ δ > (0 : ℝ), ⟨ε / 2, half_pos hε, fun _x hx _y hy => add_halves ε ▸ add_lt_add hx hy⟩ /-- Construct a uniform structure from a distance function and metric space axioms -/ -@[implicit_reducible] +@[instance_reducible] def UniformSpace.ofDist (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x) (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : UniformSpace α := @@ -179,7 +179,7 @@ instance (priority := 200) PseudoMetricSpace.toEDist : EDist α := /-- Construct a pseudo-metric space structure whose underlying topological space structure (definitionally) agrees which a pre-existing topology which is compatible with a given distance function. -/ -@[implicit_reducible] +@[instance_reducible] def PseudoMetricSpace.ofDistTopology {α : Type u} [TopologicalSpace α] (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x) (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) diff --git a/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean b/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean index e03365274cc588..ff8c8d1fa77527 100644 --- a/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean +++ b/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean @@ -74,7 +74,7 @@ instance (priority := 100) IsCompletelyPseudoMetrizableSpace.of_completeSpace_ps /-- Construct on a completely pseudometrizable space a pseudometric (compatible with the topology) which is complete. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def completelyPseudoMetrizableMetric (X : Type*) [TopologicalSpace X] [h : IsCompletelyPseudoMetrizableSpace X] : PseudoMetricSpace X := h.complete.choose.replaceTopology h.complete.choose_spec.1.symm @@ -87,7 +87,7 @@ theorem complete_completelyPseudoMetrizableMetric (X : Type*) [ht : TopologicalS /-- This definition endows a completely pseudometrizable space with a complete pseudometric. Use it as: `letI := upgradeIsCompletelyPseudoMetrizable X`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def upgradeIsCompletelyPseudoMetrizable (X : Type*) [TopologicalSpace X] [IsCompletelyPseudoMetrizableSpace X] : @@ -187,7 +187,7 @@ instance (priority := 100) IsCompletelyMetrizableSpace.of_completeSpace_metrizab /-- Construct on a completely metrizable space a metric (compatible with the topology) which is complete. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def completelyMetrizableMetric (X : Type*) [TopologicalSpace X] [h : IsCompletelyMetrizableSpace X] : MetricSpace X := h.complete.choose.replaceTopology h.complete.choose_spec.1.symm @@ -200,7 +200,7 @@ theorem complete_completelyMetrizableMetric (X : Type*) [ht : TopologicalSpace X /-- This definition endows a completely metrizable space with a complete metric. Use it as: `letI := upgradeIsCompletelyMetrizable X`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def upgradeIsCompletelyMetrizable (X : Type*) [TopologicalSpace X] [IsCompletelyMetrizableSpace X] : UpgradedIsCompletelyMetrizableSpace X := diff --git a/Mathlib/Topology/Metrizable/Uniformity.lean b/Mathlib/Topology/Metrizable/Uniformity.lean index 23803579b7869d..9fc0f05c499678 100644 --- a/Mathlib/Topology/Metrizable/Uniformity.lean +++ b/Mathlib/Topology/Metrizable/Uniformity.lean @@ -58,7 +58,7 @@ namespace PseudoMetricSpace /-- The maximal pseudometric space structure on `X` such that `dist x y ≤ d x y` for all `x y`, where `d : X → X → ℝ≥0` is a function such that `d x x = 0` and `d x y = d y x` for all `x`, `y`. -/ -@[implicit_reducible] +@[instance_reducible] noncomputable def ofPreNNDist (d : X → X → ℝ≥0) (dist_self : ∀ x, d x x = 0) (dist_comm : ∀ x y, d x y = d y x) : PseudoMetricSpace X where dist x y := ↑(⨅ l : List X, ((x::l).zipWith d (l ++ [y])).sum : ℝ≥0) diff --git a/Mathlib/Topology/Neighborhoods.lean b/Mathlib/Topology/Neighborhoods.lean index 67f7e7387f7058..f5ca19dad744dc 100644 --- a/Mathlib/Topology/Neighborhoods.lean +++ b/Mathlib/Topology/Neighborhoods.lean @@ -26,6 +26,7 @@ universe u v variable {X : Type u} [TopologicalSpace X] {ι : Sort v} {α : Type*} {x : X} {s t : Set X} +set_option backward.isDefEq.respectTransparency false in theorem nhds_def' (x : X) : 𝓝 x = ⨅ (s : Set X) (_ : IsOpen s) (_ : x ∈ s), 𝓟 s := by simp only [nhds_def, mem_setOf_eq, @and_comm (x ∈ _), iInf_and] diff --git a/Mathlib/Topology/NhdsWithin.lean b/Mathlib/Topology/NhdsWithin.lean index 1d466b1745e331..cb538d81a3d916 100644 --- a/Mathlib/Topology/NhdsWithin.lean +++ b/Mathlib/Topology/NhdsWithin.lean @@ -115,9 +115,11 @@ theorem mem_nhdsWithin_iff_eventuallyEq {s t : Set α} {x : α} : t ∈ 𝓝[s] x ↔ s =ᶠ[𝓝 x] (s ∩ t : Set α) := by simp_rw [mem_nhdsWithin_iff_eventually, eventuallyEq_set, mem_inter_iff, iff_self_and] +set_option backward.isDefEq.respectTransparency false in lemma mem_nhdsWithin_inter_self {s t : Set α} {x : α} : t ∈ 𝓝[s ∩ t] x := mem_nhdsWithin_iff_eventuallyEq.mpr <| by simp [inter_assoc] +set_option backward.isDefEq.respectTransparency false in lemma mem_nhdsWithin_self_inter {s t : Set α} {x : α} : s ∈ 𝓝[s ∩ t] x := mem_nhdsWithin_iff_eventuallyEq.mpr <| by simp [inter_comm s t, inter_assoc] diff --git a/Mathlib/Topology/OmegaCompletePartialOrder.lean b/Mathlib/Topology/OmegaCompletePartialOrder.lean index 009eb1cfc0a39f..7d19b3dee1ad6a 100644 --- a/Mathlib/Topology/OmegaCompletePartialOrder.lean +++ b/Mathlib/Topology/OmegaCompletePartialOrder.lean @@ -56,6 +56,7 @@ theorem isOpen_univ : IsOpen α univ := @CompleteLattice.ωScottContinuous.top theorem IsOpen.inter (s t : Set α) : IsOpen α s → IsOpen α t → IsOpen α (s ∩ t) := CompleteLattice.ωScottContinuous.inf +set_option backward.isDefEq.respectTransparency false in theorem isOpen_sUnion (s : Set (Set α)) (hs : ∀ t ∈ s, IsOpen α t) : IsOpen α (⋃₀ s) := by simp only [IsOpen] at hs ⊢ convert! CompleteLattice.ωScottContinuous.sSup hs diff --git a/Mathlib/Topology/Order.lean b/Mathlib/Topology/Order.lean index f87c4a05190af6..a613667bf3758e 100644 --- a/Mathlib/Topology/Order.lean +++ b/Mathlib/Topology/Order.lean @@ -64,7 +64,7 @@ inductive GenerateOpen (g : Set (Set α)) : Set α → Prop | sUnion : ∀ S : Set (Set α), (∀ s ∈ S, GenerateOpen g s) → GenerateOpen g (⋃₀ S) /-- The smallest topological space containing the collection `g` of basic sets -/ -@[implicit_reducible] +@[instance_reducible] def generateFrom (g : Set (Set α)) : TopologicalSpace α where IsOpen := GenerateOpen g isOpen_univ := GenerateOpen.univ @@ -95,7 +95,7 @@ lemma tendsto_nhds_generateFrom_iff {β : Type*} {m : α → β} {f : Filter α} tendsto_principal]; rfl /-- Construct a topology on α given the filter of neighborhoods of each point of α. -/ -@[implicit_reducible] +@[instance_reducible] protected def mkOfNhds (n : α → Filter α) : TopologicalSpace α where IsOpen s := ∀ a ∈ s, s ∈ n a isOpen_univ _ _ := univ_mem @@ -157,7 +157,7 @@ theorem le_generateFrom_iff_subset_isOpen {g : Set (Set α)} {t : TopologicalSpa /-- If `s` equals the collection of open sets in the topology it generates, then `s` defines a topology. -/ -@[implicit_reducible] +@[instance_reducible] protected def mkOfClosure (s : Set (Set α)) (hs : { u | GenerateOpen s u } = s) : TopologicalSpace α where IsOpen u := u ∈ s @@ -646,7 +646,7 @@ lemma generateFrom_insert_empty {α : Type*} {s : Set (Set α)} : /-- This construction is left adjoint to the operation sending a topology on `α` to its neighborhood filter at a fixed point `a : α`. -/ -@[implicit_reducible] +@[instance_reducible] def nhdsAdjoint (a : α) (f : Filter α) : TopologicalSpace α where IsOpen s := a ∈ s → s ∈ f isOpen_univ _ := univ_mem diff --git a/Mathlib/Topology/Order/Basic.lean b/Mathlib/Topology/Order/Basic.lean index 8fee46ee739770..65a764c325f826 100644 --- a/Mathlib/Topology/Order/Basic.lean +++ b/Mathlib/Topology/Order/Basic.lean @@ -66,7 +66,7 @@ variable {α : Type u} {β : Type v} {γ : Type w} `(a, ∞) = { x ∣ a < x }, (-∞, b) = {x ∣ x < b}` for all `a, b` in `α`. We do not register it as an instance as many ordered sets are already endowed with the same topology, most often in a non-defeq way though. Register as a local instance when necessary. -/ -@[implicit_reducible] +@[instance_reducible] def Preorder.topology (α : Type*) [Preorder α] : TopologicalSpace α := generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } diff --git a/Mathlib/Topology/Order/Bornology.lean b/Mathlib/Topology/Order/Bornology.lean index 5ce1ef6e561bb5..bcb58e3988f495 100644 --- a/Mathlib/Topology/Order/Bornology.lean +++ b/Mathlib/Topology/Order/Bornology.lean @@ -30,7 +30,7 @@ variable [Lattice α] [Nonempty α] /-- Order-bornology on a nonempty lattice. The bounded sets are the sets that are bounded both above and below. -/ -@[implicit_reducible] +@[instance_reducible] def orderBornology : Bornology α := .ofBounded {s | BddBelow s ∧ BddAbove s} (by simp) @@ -38,6 +38,7 @@ def orderBornology : Bornology α := .ofBounded (fun _ hs _ ht ↦ ⟨hs.1.union ht.1, hs.2.union ht.2⟩) (by simp) +set_option backward.isDefEq.respectTransparency false in @[simp] lemma orderBornology_isBounded : orderBornology.IsBounded s ↔ BddBelow s ∧ BddAbove s := by simp [IsBounded, IsCobounded, -isCobounded_compl_iff] diff --git a/Mathlib/Topology/Order/HullKernel.lean b/Mathlib/Topology/Order/HullKernel.lean index 9929a2596d6b7d..8559b998c35a86 100644 --- a/Mathlib/Topology/Order/HullKernel.lean +++ b/Mathlib/Topology/Order/HullKernel.lean @@ -181,6 +181,7 @@ def OrderGenerates := ∀ (a : α), ∃ (S : Set T), a = kernel S variable {T} +set_option backward.isDefEq.respectTransparency false in /-- When `T` is order generating, the `kernel` and the `hull` form a Galois insertion -/ diff --git a/Mathlib/Topology/Order/LawsonTopology.lean b/Mathlib/Topology/Order/LawsonTopology.lean index 778406eacc043c..7587ac84a4c8b3 100644 --- a/Mathlib/Topology/Order/LawsonTopology.lean +++ b/Mathlib/Topology/Order/LawsonTopology.lean @@ -64,7 +64,7 @@ section Preorder /-- The Lawson topology is defined as the meet of `Topology.lower` and the `Topology.scott`. -/ -@[implicit_reducible] +@[instance_reducible] def lawson (α : Type*) [Preorder α] : TopologicalSpace α := lower α ⊓ scott α univ variable (α) [Preorder α] [TopologicalSpace α] diff --git a/Mathlib/Topology/Order/LowerUpperTopology.lean b/Mathlib/Topology/Order/LowerUpperTopology.lean index dea040dc9c0ff3..e4a1e988ce99bc 100644 --- a/Mathlib/Topology/Order/LowerUpperTopology.lean +++ b/Mathlib/Topology/Order/LowerUpperTopology.lean @@ -61,14 +61,14 @@ namespace Topology The lower topology is the topology generated by the complements of the left-closed right-infinite intervals. -/ -@[implicit_reducible] +@[instance_reducible] def lower (α : Type*) [Preorder α] : TopologicalSpace α := generateFrom {s | ∃ a, (Ici a)ᶜ = s} /-- The upper topology is the topology generated by the complements of the right-closed left-infinite intervals. -/ -@[implicit_reducible] +@[instance_reducible] def upper (α : Type*) [Preorder α] : TopologicalSpace α := generateFrom {s | ∃ a, (Iic a)ᶜ = s} /-- Type synonym for a preorder equipped with the lower set topology. -/ diff --git a/Mathlib/Topology/Order/ScottTopology.lean b/Mathlib/Topology/Order/ScottTopology.lean index 8896519e0aa8e9..92e8a7aa14b6c4 100644 --- a/Mathlib/Topology/Order/ScottTopology.lean +++ b/Mathlib/Topology/Order/ScottTopology.lean @@ -162,7 +162,7 @@ section Preorder /-- The Scott topology. It is defined as the join of the topology of upper sets and the Scott-Hausdorff topology. -/ -@[implicit_reducible] +@[instance_reducible] def scott (α : Type*) (D : Set (Set α)) [Preorder α] : TopologicalSpace α := upperSet α ⊔ scottHausdorff α D diff --git a/Mathlib/Topology/Order/UpperLowerSetTopology.lean b/Mathlib/Topology/Order/UpperLowerSetTopology.lean index f5ef45ca370159..a7d97301496ba3 100644 --- a/Mathlib/Topology/Order/UpperLowerSetTopology.lean +++ b/Mathlib/Topology/Order/UpperLowerSetTopology.lean @@ -59,7 +59,7 @@ namespace Topology /-- Topology whose open sets are upper sets. Note: In general the upper set topology does not coincide with the upper topology. -/ -@[implicit_reducible] +@[instance_reducible] def upperSet (α : Type*) [Preorder α] : TopologicalSpace α where IsOpen := IsUpperSet isOpen_univ := isUpperSet_univ @@ -69,7 +69,7 @@ def upperSet (α : Type*) [Preorder α] : TopologicalSpace α where /-- Topology whose open sets are lower sets. Note: In general the lower set topology does not coincide with the lower topology. -/ -@[implicit_reducible] +@[instance_reducible] def lowerSet (α : Type*) [Preorder α] : TopologicalSpace α where IsOpen := IsLowerSet isOpen_univ := isLowerSet_univ diff --git a/Mathlib/Topology/Order/WithTop.lean b/Mathlib/Topology/Order/WithTop.lean index 4ab8d877149915..959eb19ba532f7 100644 --- a/Mathlib/Topology/Order/WithTop.lean +++ b/Mathlib/Topology/Order/WithTop.lean @@ -218,6 +218,7 @@ lemma tendsto_untopA [Nonempty ι] {a : WithTop ι} (ha : a ≠ ⊤) : lemma continuousOn_untopA [Nonempty ι] : ContinuousOn untopA { a : WithTop ι | a ≠ ⊤ } := continuousOn_untopD _ +set_option backward.isDefEq.respectTransparency false in lemma tendsto_untop (a : {a : WithTop ι | a ≠ ⊤}) : Tendsto (fun x ↦ untop x.1 x.2) (𝓝 a) (𝓝 (untop a.1 a.2)) := by have : Nonempty ι := ⟨untop a.1 a.2⟩ diff --git a/Mathlib/Topology/Separation/Basic.lean b/Mathlib/Topology/Separation/Basic.lean index b65c40056491ac..96979fd98f1705 100644 --- a/Mathlib/Topology/Separation/Basic.lean +++ b/Mathlib/Topology/Separation/Basic.lean @@ -319,7 +319,7 @@ variable (X) in /-- In an R₀ space, relatively compact sets form a bornology. Its cobounded filter is `Filter.coclosedCompact`. See also `Bornology.inCompact` the bornology of sets contained in a compact set. -/ -@[implicit_reducible] +@[instance_reducible] def Bornology.relativelyCompact : Bornology X where cobounded := Filter.coclosedCompact X le_cofinite := Filter.coclosedCompact_le_cofinite @@ -576,6 +576,7 @@ theorem Set.Subsingleton.closure [T1Space X] {s : Set X} (hs : s.Subsingleton) : theorem subsingleton_closure [T1Space X] {s : Set X} : (closure s).Subsingleton ↔ s.Subsingleton := ⟨fun h => h.anti subset_closure, fun h => h.closure⟩ +set_option backward.isDefEq.respectTransparency false in theorem isClosedMap_const {X Y} [TopologicalSpace X] [TopologicalSpace Y] [T1Space Y] {y : Y} : IsClosedMap (Function.const X y) := IsClosedMap.of_nonempty fun s _ h2s => by simp_rw [const, h2s.image_const, isClosed_singleton] diff --git a/Mathlib/Topology/Separation/CompletelyRegular.lean b/Mathlib/Topology/Separation/CompletelyRegular.lean index 383562b85614ae..4248d394d4cac6 100644 --- a/Mathlib/Topology/Separation/CompletelyRegular.lean +++ b/Mathlib/Topology/Separation/CompletelyRegular.lean @@ -199,7 +199,7 @@ theorem CompletelyRegularSpace.of_isTopologicalBasis_clopens (h : TopologicalSpace.IsTopologicalBasis {s : Set X | IsClopen s}) : CompletelyRegularSpace X where completely_regular x K hK hx := by - obtain ⟨s, hs, hx, hsK⟩ := h.exists_subset_of_mem_open hx hK.isOpen_compl + obtain ⟨s, hs, hx, hsK⟩ := h.exists_subset_of_mem_open (u := Kᶜ) hx hK.isOpen_compl refine ⟨sᶜ.indicator 1, ?_, by simpa, fun x hx ↦ indicator_of_mem ?_ _⟩ · exact hs.compl.continuous_indicator continuous_const · exact (mem_compl_iff s x).mpr fun hs ↦ hsK hs hx diff --git a/Mathlib/Topology/Separation/Hausdorff.lean b/Mathlib/Topology/Separation/Hausdorff.lean index 03e84f278b8fa2..b6581a3684e694 100644 --- a/Mathlib/Topology/Separation/Hausdorff.lean +++ b/Mathlib/Topology/Separation/Hausdorff.lean @@ -404,7 +404,7 @@ section variable (X) /-- The smallest equivalence relation on a topological space giving a T2 quotient. -/ -@[implicit_reducible] +@[instance_reducible] def t2Setoid : Setoid X := sInf {s | T2Space (Quotient s)} /-- The largest T2 quotient of a topological space. This construction is left-adjoint to the diff --git a/Mathlib/Topology/Sets/Closeds.lean b/Mathlib/Topology/Sets/Closeds.lean index 640c10845e0fe4..9530207aaa9183 100644 --- a/Mathlib/Topology/Sets/Closeds.lean +++ b/Mathlib/Topology/Sets/Closeds.lean @@ -183,7 +183,7 @@ theorem iInf_mk {ι} (s : ι → Set α) (h : ∀ i, IsClosed (s i)) : iInf_def _ /-- Closed sets in a topological space form a coframe. -/ -@[implicit_reducible] +@[instance_reducible] def coframeMinimalAxioms : Coframe.MinimalAxioms (Closeds α) where iInf_sup_le_sup_sInf a s := (SetLike.coe_injective <| by simp only [coe_sup, coe_iInf, coe_sInf, Set.union_iInter₂]).le diff --git a/Mathlib/Topology/Sets/Opens.lean b/Mathlib/Topology/Sets/Opens.lean index 6111c84201394f..20fd248b7d5b21 100644 --- a/Mathlib/Topology/Sets/Opens.lean +++ b/Mathlib/Topology/Sets/Opens.lean @@ -249,7 +249,7 @@ theorem mem_sSup {Us : Set (Opens α)} {x : α} : x ∈ sSup Us ↔ ∃ u ∈ Us simp_rw [sSup_eq_iSup, mem_iSup, exists_prop] /-- Open sets in a topological space form a frame. -/ -@[implicit_reducible] +@[instance_reducible] def frameMinimalAxioms : Frame.MinimalAxioms (Opens α) where inf_sSup_le_iSup_inf a s := (ext <| by simp only [coe_inf, coe_iSup, coe_sSup, Set.inter_iUnion₂]).le diff --git a/Mathlib/Topology/Sheaves/Alexandrov.lean b/Mathlib/Topology/Sheaves/Alexandrov.lean index 128a90ea4a520a..6d8940e2c4be17 100644 --- a/Mathlib/Topology/Sheaves/Alexandrov.lean +++ b/Mathlib/Topology/Sheaves/Alexandrov.lean @@ -167,6 +167,7 @@ def isLimit {X : TopCat.{v}} [Preorder X] [Topology.IsUpperSet X] congr apply limit.lift_π +set_option backward.isDefEq.respectTransparency.types false in theorem isSheaf_principalsKanExtension {X : TopCat.{v}} [Preorder X] [Topology.IsUpperSet X] (F : X ⥤ C) : Presheaf.IsSheaf (principalsKanExtension F) := by @@ -179,6 +180,7 @@ end Alexandrov open Alexandrov +set_option backward.isDefEq.respectTransparency.types false in /-- The main theorem of this file. If `X` is a topological space and preorder whose topology is the `UpperSet` topology associated diff --git a/Mathlib/Topology/Sheaves/Flasque.lean b/Mathlib/Topology/Sheaves/Flasque.lean index 94a820980075a8..525064cd99f159 100644 --- a/Mathlib/Topology/Sheaves/Flasque.lean +++ b/Mathlib/Topology/Sheaves/Flasque.lean @@ -52,6 +52,7 @@ namespace IsFlasque attribute [instance low] IsFlasque.epi +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in instance pushforward_isFlasque {Y : TopCat.{u}} [IsFlasque F] (f : X ⟶ Y) : IsFlasque (f _* F) where @@ -175,6 +176,7 @@ theorem epi_of_shortExact {S : ShortComplex (Sheaf AddCommGrpCat X)} (hS : S.Sho exact leOfHom ((ht t₆) this).some.right.1.unop ((le_iSup f 1) hW) exact ⟨t.right.2 |_ U, by simp [map_restrict, ← tcomp, restrict_restrict]⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- Given a short exact sequence of sheaves, `0 ⟶ 𝓕 ⟶ 𝓖 ⟶ 𝓗 ⟶ 0`, if `𝓕` and `𝓖` are flasque, then `𝓗` is flasque. -/ theorem of_shortExact_of_isFlasque₁₂ {S : ShortComplex (Sheaf AddCommGrpCat X)} diff --git a/Mathlib/Topology/Sheaves/Presheaf.lean b/Mathlib/Topology/Sheaves/Presheaf.lean index 9d0ac759394de3..a16cb318d78e24 100644 --- a/Mathlib/Topology/Sheaves/Presheaf.lean +++ b/Mathlib/Topology/Sheaves/Presheaf.lean @@ -42,6 +42,7 @@ variable (C : Type u) [Category.{v} C] namespace TopCat /-- The category of `C`-valued presheaves on a (bundled) topological space `X`. -/ +@[implicit_reducible] def Presheaf (X : TopCat.{w}) : Type max u v w := (Opens X)ᵒᵖ ⥤ C @@ -130,6 +131,7 @@ abbrev restrictOpen {F : X.Presheaf C} /-- restriction of a section to open subset -/ scoped[AlgebraicGeometry] infixl:80 " |_ " => TopCat.Presheaf.restrictOpen +set_option backward.isDefEq.respectTransparency.types false in theorem restrict_restrict {F : X.Presheaf C} {U V W : Opens X} (e₁ : U ≤ V) (e₂ : V ≤ W) (x : ToType (F.obj (op W))) : x |_ V |_ U = x |_ U := by @@ -137,12 +139,14 @@ theorem restrict_restrict rw [← ConcreteCategory.comp_apply, ← Functor.map_comp] rfl +set_option backward.isDefEq.respectTransparency.types false in theorem map_restrict {F G : X.Presheaf C} (e : F ⟶ G) {U V : Opens X} (h : U ≤ V) (x : ToType (F.obj (op V))) : e.app _ (x |_ U) = e.app _ x |_ U := by delta restrictOpen restrict rw [← ConcreteCategory.comp_apply, NatTrans.naturality, ConcreteCategory.comp_apply] +set_option backward.isDefEq.respectTransparency.types false in @[simp] lemma restrict_self {F : X.Presheaf C} {U : Opens X} (x : ToType (F.obj (op U))) : x |_ U = x := by @@ -153,7 +157,7 @@ open CategoryTheory.Limits variable (C) /-- The pushforward functor. -/ -@[simps!] +@[simps!, implicit_reducible] def pushforward {X Y : TopCat.{w}} (f : X ⟶ Y) : X.Presheaf C ⥤ Y.Presheaf C := (whiskeringLeft _ _ _).obj (Opens.map f).op @@ -216,6 +220,7 @@ def pushforwardEq {X Y : TopCat.{w}} {f g : X ⟶ Y} (h : f = g) (ℱ : X.Preshe theorem pushforward_eq' {X Y : TopCat.{w}} {f g : X ⟶ Y} (h : f = g) (ℱ : X.Presheaf C) : f _* ℱ = g _* ℱ := by rw [h] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem pushforwardEq_hom_app {X Y : TopCat.{w}} {f g : X ⟶ Y} @@ -241,6 +246,7 @@ def toPushforwardOfIso {X Y : TopCat.{w}} (H : X ≅ Y) {ℱ : X.Presheaf C} { (α : H.hom _* ℱ ⟶ 𝒢) : ℱ ⟶ H.inv _* 𝒢 := (presheafEquivOfIso _ H).toAdjunction.homEquiv ℱ 𝒢 α +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem toPushforwardOfIso_app {X Y : TopCat.{w}} (H₁ : X ≅ Y) {ℱ : X.Presheaf C} {𝒢 : Y.Presheaf C} @@ -257,6 +263,7 @@ def pushforwardToOfIso {X Y : TopCat.{w}} (H₁ : X ≅ Y) {ℱ : Y.Presheaf C} (H₂ : ℱ ⟶ H₁.hom _* 𝒢) : H₁.inv _* ℱ ⟶ 𝒢 := ((presheafEquivOfIso _ H₁.symm).toAdjunction.homEquiv ℱ 𝒢).symm H₂ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[simp] theorem pushforwardToOfIso_app {X Y : TopCat.{w}} (H₁ : X ≅ Y) {ℱ : Y.Presheaf C} {𝒢 : X.Presheaf C} diff --git a/Mathlib/Topology/Sheaves/Skyscraper.lean b/Mathlib/Topology/Sheaves/Skyscraper.lean index 1799712bd64344..b7c644818f625b 100644 --- a/Mathlib/Topology/Sheaves/Skyscraper.lean +++ b/Mathlib/Topology/Sheaves/Skyscraper.lean @@ -307,6 +307,7 @@ lemma germ_fromStalk {𝓕 : Presheaf C X} {c : C} (f : 𝓕 ⟶ skyscraperPresh 𝓕.germ U p₀ hU ≫ fromStalk p₀ f = f.app (op U) ≫ eqToHom (if_pos hU) := colimit.ι_desc _ _ +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in theorem to_skyscraper_fromStalk {𝓕 : Presheaf C X} {c : C} (f : 𝓕 ⟶ skyscraperPresheaf p₀ c) : toSkyscraperPresheaf p₀ (fromStalk _ f) = f := by @@ -317,6 +318,7 @@ theorem to_skyscraper_fromStalk {𝓕 : Presheaf C X} {c : C} (f : 𝓕 ⟶ skys · simp · exact ((if_neg h).symm.ndrec terminalIsTerminal).hom_ext .. +set_option backward.isDefEq.respectTransparency.types false in theorem fromStalk_to_skyscraper {𝓕 : Presheaf C X} {c : C} (f : 𝓕.stalk p₀ ⟶ c) : fromStalk p₀ (toSkyscraperPresheaf _ f) = f := by refine 𝓕.stalk_hom_ext fun U hxU ↦ ?_ diff --git a/Mathlib/Topology/Sheaves/Stalks.lean b/Mathlib/Topology/Sheaves/Stalks.lean index 9403faaec5932e..ba9a0f6d530c35 100644 --- a/Mathlib/Topology/Sheaves/Stalks.lean +++ b/Mathlib/Topology/Sheaves/Stalks.lean @@ -245,6 +245,7 @@ lemma germ_stalkPullbackHom ((pullback C f).obj F).germ ((Opens.map f).obj U) x hU := by simp [stalkPullbackHom, germ, stalkFunctor, stalkPushforward] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- The morphism `(f⁻¹ℱ)(U) ⟶ ℱ_{f(x)}` for some `U ∋ x`. -/ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : X) (hx : x ∈ U) : @@ -255,6 +256,7 @@ def germToPullbackStalk (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : X) ( { app := fun V => F.germ _ (f x) (V.hom.unop.le hx) naturality := fun _ _ i => by simp } } +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in variable {C} in @[ext] @@ -270,6 +272,7 @@ lemma pullback_obj_obj_ext {Z : C} {f : X ⟶ Y} {F : Y.Presheaf C} (U : (Opens simpa [pullbackPushforwardAdjunction, Functor.lanAdjunction_unit] using! h V (leOfHom b) +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma pullbackPushforwardAdjunction_unit_pullback_map_germToPullbackStalk @@ -293,6 +296,7 @@ lemma germToPullbackStalk_stalkPullbackHom simp only [pullbackPushforwardAdjunction_unit_pullback_map_germToPullbackStalk_assoc, germ_stalkPullbackHom, germ_res] +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma pullbackPushforwardAdjunction_unit_app_app_germToPullbackStalk @@ -347,6 +351,7 @@ section stalkSpecializes variable {C} +set_option backward.isDefEq.respectTransparency.types false in set_option backward.defeqAttrib.useBackward true in /-- If `x` specializes to `y`, then there is a natural map `F.stalk y ⟶ F.stalk x`. -/ noncomputable def stalkSpecializes (F : X.Presheaf C) {x y : X} (h : x ⤳ y) : @@ -396,6 +401,7 @@ theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y ext simp +set_option backward.isDefEq.respectTransparency.types false in /-- The stalks are isomorphic on inseparable points -/ @[simps] def stalkCongr (F : X.Presheaf C) {x y : X} @@ -453,6 +459,7 @@ theorem germ_eq (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : obtain ⟨W, iU, iV, e⟩ := (colimit.isColimit ((OpenNhds.inclusion x).op ⋙ F)).eq_iff.mp h exact ⟨(unop W).1, (unop W).2, iU.unop, iV.unop, e⟩ +set_option backward.isDefEq.respectTransparency.types false in theorem stalkFunctor_map_injective_of_app_injective {F G : Presheaf C X} {f : F ⟶ G} (h : ∀ U : Opens X, Function.Injective (f.app (op U))) (x : X) : Function.Injective ((stalkFunctor C x).map f) := fun s t hst => by @@ -472,12 +479,14 @@ variable {B : Set (Opens X)} (hB : Opens.IsBasis B) include hB +set_option backward.isDefEq.respectTransparency.types false in lemma exists_mem_germ_eq_of_isBasis (F : X.Presheaf C) (x : X) (t : ToType (F.stalk x)) : ∃ (U : Opens X) (m : x ∈ U) (_ : U ∈ B) (s : ToType (F.obj (op U))), F.germ _ x m s = t := by obtain ⟨U, hxU, s, rfl⟩ := F.exists_germ_eq t obtain ⟨_, ⟨V, hV, rfl⟩, hxV, hVU⟩ := hB.exists_subset_of_mem_open hxU U.2 exact ⟨V, hxV, hV, F.map (homOfLE hVU).op s, by rw [← ConcreteCategory.comp_apply, F.germ_res']⟩ +set_option backward.isDefEq.respectTransparency.types false in lemma germ_eq_of_isBasis (F : X.Presheaf C) {U V : Opens X} (x : X) (mU : x ∈ U) (mV : x ∈ V) {s : ToType (F.obj (op U))} {t : ToType (F.obj (op V))} (h : F.germ U x mU s = F.germ V x mV t) : @@ -526,6 +535,7 @@ Note that the analogous statement for surjectivity is false: Surjectivity on sta imply surjectivity of the components of a sheaf morphism. However it does imply that the morphism is an epi, but this fact is not yet formalized. -/ +set_option backward.isDefEq.respectTransparency.types false in theorem app_injective_of_stalkFunctor_map_injective {F : Sheaf C X} {G : Presheaf C X} (f : F.1 ⟶ G) (U : Opens X) (h : ∀ x ∈ U, Function.Injective ((stalkFunctor C x).map f)) : Function.Injective (f.app (op U)) := fun s t hst => @@ -572,6 +582,7 @@ theorem mono_iff_stalk_mono {F G : Sheaf C X} (f : F ⟶ G) : Mono f ↔ ∀ x, Mono ((stalkFunctor C x).map f.1) := ⟨fun _ => stalk_mono_of_mono _, fun _ => mono_of_stalk_mono _⟩ +set_option backward.isDefEq.respectTransparency.types false in /-- For surjectivity, we are given an arbitrary section `t` and need to find a preimage for it. We claim that it suffices to find preimages *locally*. That is, for each `x : U` we construct a neighborhood `V ≤ U` and a section `s : F.obj (op V))` such that `f.app (op V) s` and `t` diff --git a/Mathlib/Topology/Sober.lean b/Mathlib/Topology/Sober.lean index 30a25e0eba280b..1bd563a1fb6ff8 100644 --- a/Mathlib/Topology/Sober.lean +++ b/Mathlib/Topology/Sober.lean @@ -156,6 +156,7 @@ theorem genericPoint_specializes [QuasiSober α] [IrreducibleSpace α] (x : α) attribute [local instance] specializationOrder +set_option backward.isDefEq.respectTransparency false in /-- The closed irreducible subsets of a sober space bijects with the points of the space. -/ noncomputable def irreducibleSetEquivPoints [QuasiSober α] [T0Space α] : TopologicalSpace.IrreducibleCloseds α ≃o α where diff --git a/Mathlib/Topology/Spectral/ConstructibleTopology.lean b/Mathlib/Topology/Spectral/ConstructibleTopology.lean index 9f4d1e23436662..e7cd9956affd28 100644 --- a/Mathlib/Topology/Spectral/ConstructibleTopology.lean +++ b/Mathlib/Topology/Spectral/ConstructibleTopology.lean @@ -37,7 +37,7 @@ def constructibleTopologySubbasis (X : Type*) [TopologicalSpace X] : Set (Set X) /-- The constructible topology on a topological space `X` has as a subbasis the open and compact sets of `X` and their complements. -/ -@[implicit_reducible] +@[instance_reducible] def constructibleTopology (X : Type*) [TopologicalSpace X] : TopologicalSpace X := .generateFrom (constructibleTopologySubbasis X) diff --git a/Mathlib/Topology/Spectral/Prespectral.lean b/Mathlib/Topology/Spectral/Prespectral.lean index c259887f6e8c49..ff78a7d7b04abe 100644 --- a/Mathlib/Topology/Spectral/Prespectral.lean +++ b/Mathlib/Topology/Spectral/Prespectral.lean @@ -53,9 +53,9 @@ instance (priority := low) [PrespectralSpace X] : LocallyCompactSpace X where open PrespectralSpace in instance (priority := low) [T2Space X] [PrespectralSpace X] : TotallySeparatedSpace X := - totallySeparatedSpace_iff_exists_isClopen.mpr fun _ _ hxy ↦ + totallySeparatedSpace_iff_exists_isClopen.mpr fun _ y hxy ↦ have ⟨U, ⟨hU₁, hU₂⟩, hxU, hyU⟩ := - isTopologicalBasis.exists_subset_of_mem_open hxy isClosed_singleton.isOpen_compl + isTopologicalBasis.exists_subset_of_mem_open (u := {y}ᶜ) hxy isClosed_singleton.isOpen_compl ⟨U, ⟨hU₂.isClosed, hU₁⟩, hxU, fun h ↦ hyU h rfl⟩ lemma PrespectralSpace.of_isOpenCover diff --git a/Mathlib/Topology/TietzeExtension.lean b/Mathlib/Topology/TietzeExtension.lean index 1f18c899836993..988717457d4e58 100644 --- a/Mathlib/Topology/TietzeExtension.lean +++ b/Mathlib/Topology/TietzeExtension.lean @@ -69,6 +69,7 @@ theorem ContinuousMap.exists_restrict_eq (hs : IsClosed s) (f : C(s, Y)) : ∃ (g : C(X, Y)), g.restrict s = f := TietzeExtension.exists_restrict_eq' s hs f +set_option backward.isDefEq.respectTransparency false in /-- **Tietze extension theorem** for `TietzeExtension` spaces. Let `e` be a closed embedding of a nonempty topological space `X₁` into a normal topological space `X`. Let `f` be a continuous function on `X₁` with values in a `TietzeExtension` space `Y`. Then there exists a @@ -512,6 +513,7 @@ instance Real.instTietzeExtension : TietzeExtension ℝ where f.exists_restrict_eq_forall_mem_of_closed (fun _ => mem_univ _) univ_nonempty hs |>.imp fun _ ↦ (And.right ·) +set_option backward.isDefEq.respectTransparency false in open NNReal in /-- **Tietze extension theorem** for nonnegative real-valued continuous maps. `ℝ≥0` is a `TietzeExtension` space. -/ diff --git a/Mathlib/Topology/UniformSpace/AbsoluteValue.lean b/Mathlib/Topology/UniformSpace/AbsoluteValue.lean index ab8d8149b1dc0e..c95e2e750ae7c2 100644 --- a/Mathlib/Topology/UniformSpace/AbsoluteValue.lean +++ b/Mathlib/Topology/UniformSpace/AbsoluteValue.lean @@ -36,7 +36,7 @@ variable {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing variable {R : Type*} [CommRing R] (abv : AbsoluteValue R 𝕜) /-- The uniform structure coming from an absolute value. -/ -@[implicit_reducible] +@[instance_reducible] def uniformSpace : UniformSpace R := .ofFun (fun x y => abv (y - x)) (by simp) (fun x y => abv.map_sub y x) (fun _ _ _ => (abv.sub_le _ _ _).trans_eq (add_comm _ _)) diff --git a/Mathlib/Topology/UniformSpace/AbstractCompletion.lean b/Mathlib/Topology/UniformSpace/AbstractCompletion.lean index a17498f30017f0..d91c8c36e67f5a 100644 --- a/Mathlib/Topology/UniformSpace/AbstractCompletion.lean +++ b/Mathlib/Topology/UniformSpace/AbstractCompletion.lean @@ -373,6 +373,7 @@ end T0Space variable {f : α → β → γ} variable [CompleteSpace γ] (f) +set_option backward.isDefEq.respectTransparency false in theorem uniformContinuous_extension₂ : UniformContinuous₂ (pkg.extend₂ pkg' f) := by rw [uniformContinuous₂_def, AbstractCompletion.extend₂, uncurry_curry] apply uniformContinuous_extend diff --git a/Mathlib/Topology/UniformSpace/Defs.lean b/Mathlib/Topology/UniformSpace/Defs.lean index f23cfccc9011c6..68f49e858cccd9 100644 --- a/Mathlib/Topology/UniformSpace/Defs.lean +++ b/Mathlib/Topology/UniformSpace/Defs.lean @@ -161,7 +161,7 @@ def UniformSpace.Core.mkOfBasis {α : Type u} (B : FilterBasis (α × α)) comp := ((B.hasBasis.lift' (monotone_id.relComp monotone_id)).le_basis_iff B.hasBasis).2 comp /-- A uniform space generates a topological space -/ -@[implicit_reducible] +@[instance_reducible] def UniformSpace.Core.toTopologicalSpace {α : Type u} (u : UniformSpace.Core α) : TopologicalSpace α := .mkOfNhds fun x ↦ .comap (Prod.mk x) u.uniformity diff --git a/Mathlib/Topology/UniformSpace/OfCompactT2.lean b/Mathlib/Topology/UniformSpace/OfCompactT2.lean index 6f639c9f41ad79..7e183d7c2d1d95 100644 --- a/Mathlib/Topology/UniformSpace/OfCompactT2.lean +++ b/Mathlib/Topology/UniformSpace/OfCompactT2.lean @@ -40,7 +40,7 @@ variable {γ : Type*} /-- The unique uniform structure inducing a given compact topological structure. -/ -@[implicit_reducible] +@[instance_reducible] def uniformSpaceOfCompactR1 [TopologicalSpace γ] [CompactSpace γ] [R1Space γ] : UniformSpace γ where uniformity := 𝓝ˢ (diagonal γ) symm := continuous_swap.tendsto_nhdsSet fun _ => Eq.symm diff --git a/Mathlib/Topology/UniformSpace/OfFun.lean b/Mathlib/Topology/UniformSpace/OfFun.lean index 5cf81b8e13dbbb..d6ff09a0f4dbad 100644 --- a/Mathlib/Topology/UniformSpace/OfFun.lean +++ b/Mathlib/Topology/UniformSpace/OfFun.lean @@ -29,7 +29,7 @@ namespace UniformSpace /-- Define a `UniformSpace` using a "distance" function. The function can be, e.g., the distance in a (usual or extended) metric space or an absolute value on a ring. -/ -@[implicit_reducible] +@[instance_reducible] def ofFun [AddCommMonoid M] [PartialOrder M] (d : X → X → M) (refl : ∀ x, d x x = 0) (symm : ∀ x y, d x y = d y x) (triangle : ∀ x y z, d x z ≤ d x y + d y z) @@ -60,7 +60,7 @@ distance in a (usual or extended) metric space or an absolute value on a ring. W there is a preexisting topology, for which the neighborhoods can be expressed using the "distance", and we make sure that the uniform space structure we construct has a topology which is defeq to the original one. -/ -@[implicit_reducible] +@[instance_reducible] def ofFunOfHasBasis [t : TopologicalSpace X] [AddCommMonoid M] [LinearOrder M] (d : X → X → M) (refl : ∀ x, d x x = 0) (symm : ∀ x y, d x y = d y x) (triangle : ∀ x y z, d x z ≤ d x y + d y z) diff --git a/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean b/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean index 164ada4a32e227..dbd42adb39dc21 100644 --- a/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean +++ b/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean @@ -483,6 +483,7 @@ protected def uniformEquivProdArrow [UniformSpace γ] : (α →ᵤ β × γ) ≃ -- the relevant diagram commutes by definition variable (α) (δ : ι → Type*) [∀ i, UniformSpace (δ i)] +set_option backward.isDefEq.respectTransparency false in /-- The natural bijection between `α → Π i, δ i` and `Π i, α → δ i`, upgraded to a uniform isomorphism between `α →ᵤ (Π i, δ i)` and `Π i, α →ᵤ δ i`. -/ protected def uniformEquivPiComm : UniformEquiv (α →ᵤ ∀ i, δ i) (∀ i, α →ᵤ δ i) := @@ -623,6 +624,7 @@ protected theorem topologicalSpace_eq : simp only [UniformOnFun.topologicalSpace, UniformSpace.toTopologicalSpace_iInf] rfl +set_option backward.isDefEq.respectTransparency false in protected theorem hasBasis_uniformity_of_basis_aux₁ {p : ι → Prop} {s : ι → Set (β × β)} (hb : HasBasis (𝓤 β) p s) (S : Set α) : (@uniformity (α →ᵤ[𝔖] β) ((UniformFun.uniformSpace S β).comap S.restrict)).HasBasis p fun i => @@ -824,7 +826,7 @@ lemma uniformContinuous_ofFun_toFun (𝔗 : Set (Set α)) (h : ∀ s ∈ 𝔖, intro s hs obtain ⟨T, hT𝔗, hT, hsT⟩ := h s hs refine ⟨T, hT, hT𝔗, fun f hf ↦ ?_⟩ - simp only [UniformOnFun.gen, Set.mem_iInter, Set.mem_setOf_eq, Function.comp_apply] at hf ⊢ + simp only [UniformOnFun.gen, Set.mem_iInter, Set.mem_setOf_eq] at hf ⊢ intro x hx obtain ⟨t, ht, hxt⟩ := Set.mem_sUnion.mp <| hsT hx exact hf t ht x hxt @@ -1105,6 +1107,7 @@ theorem isClosed_setOf_continuous [TopologicalSpace α] (h : IsCoherentWith 𝔖 rw [← tendsto_id', UniformOnFun.tendsto_iff_tendstoUniformlyOn] at huf exact (huf s hs).continuousOn <| Eventually.frequently <| hu fun _ ↦ Continuous.continuousOn +set_option backward.isDefEq.respectTransparency false in variable (𝔖) in theorem uniformSpace_eq_inf_precomp_of_cover {δ₁ δ₂ : Type*} (φ₁ : δ₁ → α) (φ₂ : δ₂ → α) (𝔗₁ : Set (Set δ₁)) (𝔗₂ : Set (Set δ₂)) @@ -1131,6 +1134,7 @@ theorem uniformSpace_eq_inf_precomp_of_cover {δ₁ δ₂ : Type*} (φ₁ : δ (iInf₂_le_of_le _ (h_preimage₁ hS) le_rfl) (iInf₂_le_of_le _ (h_preimage₂ hS) le_rfl) +set_option backward.isDefEq.respectTransparency false in variable (𝔖) in theorem uniformSpace_eq_iInf_precomp_of_cover {δ : ι → Type*} (φ : Π i, δ i → α) (𝔗 : ∀ i, Set (Set (δ i))) (h_image : ∀ i, MapsTo (φ i '' ·) (𝔗 i) 𝔖) diff --git a/Mathlib/Topology/UniformSpace/UniformEmbedding.lean b/Mathlib/Topology/UniformSpace/UniformEmbedding.lean index 9a494e7eedb9ec..59f59e7cb5ef3a 100644 --- a/Mathlib/Topology/UniformSpace/UniformEmbedding.lean +++ b/Mathlib/Topology/UniformSpace/UniformEmbedding.lean @@ -417,7 +417,7 @@ theorem isUniformEmbedding_comap {α : Type*} {β : Type*} {f : α → β} [u : /-- Pull back a uniform space structure by an embedding, adjusting the new uniform structure to make sure that its topology is defeq to the original one. -/ -@[implicit_reducible] +@[instance_reducible] def Topology.IsEmbedding.comapUniformSpace {α β} [TopologicalSpace α] [u : UniformSpace β] (f : α → β) (h : IsEmbedding f) : UniformSpace α := (u.comap f).replaceTopology h.eq_induced diff --git a/Mathlib/Topology/UnitInterval.lean b/Mathlib/Topology/UnitInterval.lean index 3e370fad2d3f49..e5db2820619638 100644 --- a/Mathlib/Topology/UnitInterval.lean +++ b/Mathlib/Topology/UnitInterval.lean @@ -530,6 +530,7 @@ section variable {𝕜 : Type*} [Field 𝕜] [LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] [TopologicalSpace 𝕜] [IsTopologicalRing 𝕜] +set_option backward.isDefEq.respectTransparency false in -- We only need the ordering on `𝕜` here to avoid talking about flipping the interval over. -- At the end of the day I only care about `ℝ`, so I'm hesitant to put work into generalizing. /-- The image of `[0,1]` under the homeomorphism `fun x ↦ a * x + b` is `[b, a+b]`. diff --git a/Mathlib/Topology/VectorBundle/Basic.lean b/Mathlib/Topology/VectorBundle/Basic.lean index 2485b82762a164..351bdff18189d7 100644 --- a/Mathlib/Topology/VectorBundle/Basic.lean +++ b/Mathlib/Topology/VectorBundle/Basic.lean @@ -843,7 +843,7 @@ def toFiberPrebundle (a : VectorPrebundle R F E) : FiberPrebundle F E := rw [a.mk_coordChange _ _ hb, e'.mk_symm hb.1] } /-- Topology on the total space that will make the prebundle into a bundle. -/ -@[implicit_reducible] +@[instance_reducible] def totalSpaceTopology (a : VectorPrebundle R F E) : TopologicalSpace (TotalSpace F E) := a.toFiberPrebundle.totalSpaceTopology @@ -879,10 +879,11 @@ theorem continuous_totalSpaceMk (b : B) : /-- Make a `FiberBundle` from a `VectorPrebundle`; auxiliary construction for `VectorPrebundle.toVectorBundle`. -/ -@[implicit_reducible] +@[instance_reducible] def toFiberBundle : @FiberBundle B F _ _ _ a.totalSpaceTopology _ := a.toFiberPrebundle.toFiberBundle +set_option backward.isDefEq.respectTransparency false in /-- Make a `VectorBundle` from a `VectorPrebundle`. Concretely this means that, given a `VectorPrebundle` structure for a sigma-type `E` -- which consists of a number of "pretrivializations" identifying parts of `E` with product spaces `U × F` -- one diff --git a/Mathlib/Topology/VectorBundle/Constructions.lean b/Mathlib/Topology/VectorBundle/Constructions.lean index ab64b02686f619..2b02aa909b3249 100644 --- a/Mathlib/Topology/VectorBundle/Constructions.lean +++ b/Mathlib/Topology/VectorBundle/Constructions.lean @@ -80,6 +80,7 @@ instance vectorBundle : VectorBundle 𝕜 F (Bundle.Trivial B F) where (trivialization B F).symmL 𝕜 x = ContinuousLinearMap.id 𝕜 F := by ext; simp [trivialization_symm_apply B F] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma continuousLinearEquivAt_trivialization (x : B) : (trivialization B F).continuousLinearEquivAt 𝕜 x (mem_univ _) = ContinuousLinearEquiv.refl 𝕜 F := by diff --git a/Mathlib/Util/AddRelatedDecl.lean b/Mathlib/Util/AddRelatedDecl.lean index 83e3108d0cdc62..0c24c5ba2dfd2b 100644 --- a/Mathlib/Util/AddRelatedDecl.lean +++ b/Mathlib/Util/AddRelatedDecl.lean @@ -7,6 +7,7 @@ module public import Mathlib.Init public meta import Lean.Elab.DeclarationRange +public meta import Lean.Linter.TacticTypeCheck /-! # `addRelatedDecl` @@ -27,6 +28,60 @@ def elabOptAttrArg : TSyntax ``optAttrArg → TermElabM (Array Attribute) | `(optAttrArg| (attr := $[$attrs],*)) => elabAttrs attrs | _ => pure #[] +/-- Re-implementation of the inner loop of `Lean.Linter.tacticCheckInstances` for use on +declarations synthesized by Mathlib attributes (`@[simps]`, `@[reassoc]`, `@[elementwise]`, ...). +Returns the list of semireducible non-instance definitions that `Meta.check declType .default` +had to unfold but `Meta.check declType .implicit` would not, or `none` if `declType` already +passes the `.implicit` check. -/ +private def checkImplicitTransparency (declType : Expr) : MetaM (Option (List Name)) := do + let origDiag := (← get).diag + let result : Option (List Name) ← withOptions (diagnostics.set · true) do + try Meta.check declType .default catch _ => return none + let counterDefault := (← get).diag.unfoldCounter + modify ({ · with diag := origDiag }) + try + Meta.check declType .implicit + return none + catch _ => + let counterInst := (← get).diag.unfoldCounter + let diff := Meta.subCounters counterDefault counterInst + let env ← getEnv + return some <| diff.toList.filterMap fun (n, count) => do + guard <| count > 0 + guard <| getReducibilityStatusCore env n matches .semireducible + guard <| !Meta.isInstanceCore env n + return n + -- Always restore the original diagnostics snapshot, mirroring `tacticCheckInstances`. + modify ({ · with diag := origDiag }) + return result + +/-- Extension of `linter.tacticCheckInstances` to lemmas produced by Mathlib attributes such as +`@[simps]`, `@[reassoc]`, and `@[elementwise]`. Call sites pass the syntax of the user's +attribute (`ref`), the name of the generated lemma (`declName`), and the lemma's type +(`declType`); a warning is emitted at `ref` if `declType` is type-correct at `.default` but +not at `.implicit`, listing the semireducible definitions that would need to be +marked `@[implicit_reducible]` to fix the mismatch. + +The check is gated by the existing core option `linter.tacticCheckInstances` and is silent +otherwise; following the convention of the core linter, it does *not* participate in +`linter.all`. -/ +def warnIfImplicitIllTyped (ref : Syntax) (declName : Name) (declType : Expr) : MetaM Unit := do + -- `linter.tacticCheckInstances` is declared outside any `public section` of Lean Core, so we + -- cannot reference its option object directly. Construct an `Lean.Option Bool` whose `name` + -- matches the key under which `register_builtin_option` registers it: the short identifier + -- as written in the macro (see `Lean/Data/Options.lean:228`), not the fully qualified + -- declName. The reconstructed option is used both to gate the check and to tag the warning. + let lintOpt : Lean.Option Bool := + { name := `linter.tacticCheckInstances, defValue := false } + unless lintOpt.get (← getOptions) do return + let some candidates ← checkImplicitTransparency declType | return + if candidates.isEmpty then return + let bullets := MessageData.joinSep (candidates.map (m!"{MessageData.ofConstName ·}")) Format.line + Lean.Linter.logLint lintOpt ref + m!"generated lemma {MessageData.ofConstName declName} is not type-correct at \ + `.implicit` transparency; consider marking some of the following as \ + `@[implicit_reducible]`:{indentD bullets}" + /-- A helper function for constructing a related declaration from an existing one. This is currently used by the attributes `reassoc` and `elementwise`, @@ -71,6 +126,7 @@ def addRelatedDecl (src tgt : Name) (ref : Syntax) let newValue ← instantiateMVars newValue let newType ← instantiateMVars (← inferType newValue) unless ← isProp newType do throwError "Related declaration is not a proposition: {newType}" + warnIfImplicitIllTyped ref tgt newType addDecl <| ← mkThmOrUnsafeDef { levelParams := newLevels, type := newType, name := tgt, value := newValue } if isProtected (← getEnv) src then diff --git a/MathlibTest/DefEqAbuse.lean b/MathlibTest/DefEqAbuse.lean index 77e1a9976f4270..0db094fae6f786 100644 --- a/MathlibTest/DefEqAbuse.lean +++ b/MathlibTest/DefEqAbuse.lean @@ -128,9 +128,9 @@ def myOp {α : Type} [AddCommGroup α] [MyAction ℕ α] (x : α) : α := def testVirtualParent {G : Type} [AddCommGroup G] (s : MySub₂ G) (x : s) : s := myOp x --- The fix: marking the virtual parent `def` as `@[implicit_reducible]` makes it +-- The fix: marking the virtual parent `def` as `@[instance_reducible]` makes it -- transparent enough for instance synthesis to unify the two `AddCommMonoid` paths. -attribute [implicit_reducible] MySub₂.toAddSubgroup +attribute [instance_reducible] MySub₂.toAddSubgroup /-- info: #defeq_abuse: command succeeds with `backward.isDefEq.respectTransparency true`. No abuse detected. -/ #guard_msgs in diff --git a/MathlibTest/DeriveFintype.lean b/MathlibTest/DeriveFintype.lean index 9e18b7a194c081..15f8ff3fbe4ed4 100644 --- a/MathlibTest/DeriveFintype.lean +++ b/MathlibTest/DeriveFintype.lean @@ -12,6 +12,7 @@ namespace tests Tests that the enumerable types succeed, even with universe levels. -/ +set_option backward.isDefEq.respectTransparency false in inductive A | x | y | z deriving Fintype @@ -21,6 +22,7 @@ info: tests.A.enumList : List A #guard_msgs in #check A.enumList +set_option backward.isDefEq.respectTransparency false in inductive A' : Type u | x | y | z deriving Fintype @@ -30,6 +32,7 @@ info: tests.A'.enumList.{u} : List A' #guard_msgs in #check A'.enumList +set_option backward.isDefEq.respectTransparency false in inductive A'' : Type 1 | x | y | z deriving Fintype @@ -160,6 +163,7 @@ instance (s : Set α) [Fintype α] [DecidablePred (· ∈ s)] : Fintype (MySubty Tests from mathlib 3 -/ +set_option backward.isDefEq.respectTransparency false in inductive Alphabet | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z diff --git a/MathlibTest/FastInstance.lean b/MathlibTest/FastInstance.lean index c1e013721ebc70..5cf9c4a9bf2fea 100644 --- a/MathlibTest/FastInstance.lean +++ b/MathlibTest/FastInstance.lean @@ -62,14 +62,14 @@ instance instCommSemigroup [CommSemigroup α] : CommSemigroup (Wrapped α) := fast_instance% Function.Injective.commSemigroup _ val_injective (fun _ _ => rfl) /-- -info: @[implicit_reducible] def testing.instSemigroup.{u_1} : {α : Type u_1} → [Semigroup α] → Semigroup (Wrapped α) := +info: @[instance_reducible] def testing.instSemigroup.{u_1} : {α : Type u_1} → [Semigroup α] → Semigroup (Wrapped α) := fun {α} [inst : Semigroup α] => @Semigroup.mk (Wrapped α) (@instMulWrapped α (@Semigroup.toMul α inst)) ⋯ -/ #guard_msgs in set_option pp.explicit true in #print instSemigroup /-- -info: @[implicit_reducible] def testing.instCommSemigroup.{u_1} : {α : Type u_1} → +info: @[instance_reducible] def testing.instCommSemigroup.{u_1} : {α : Type u_1} → [CommSemigroup α] → CommSemigroup (Wrapped α) := fun {α} [inst : CommSemigroup α] => @CommSemigroup.mk (Wrapped α) (@instSemigroup α (@CommSemigroup.toSemigroup α inst)) ⋯ diff --git a/MathlibTest/FunctorCompImplicitReducible.lean b/MathlibTest/FunctorCompImplicitReducible.lean new file mode 100644 index 00000000000000..eb5dfa6cbcd11f --- /dev/null +++ b/MathlibTest/FunctorCompImplicitReducible.lean @@ -0,0 +1,105 @@ +/- +Regression test for the `[instance_reducible]` / `[implicit_reducible]` tier split +introduced in https://github.com/leanprover/lean4/pull/13637. + +Adapted from Sébastien Gouëzel's MWE: + https://leanprover.zulipchat.com/#narrow/channel/113488-general/topic/backward.2EisDefEq.2ErespectTransparency/near/592439262 + +The invariant: tagging `Functor.comp` `[implicit_reducible]` must NOT corrupt +type class search. The two instances `SGMonoidal (F ⋙ (G ⋙ H))` and +`SGMonoidal ((F ⋙ G) ⋙ H)` are mathematically distinct and must remain so. + +Pre-split, the unified `[implicit_reducible]` would have collapsed them at +`.instances` transparency, breaking instance synthesis. Post-split, +`[implicit_reducible]` is the narrower (value-defeq-only) tier and is safe; +`[instance_reducible]` is the TC tier and would (correctly, by design) +reproduce the corruption. +-/ + +import Mathlib.CategoryTheory.Monoidal.Functor + +open CategoryTheory + +namespace MathlibTest.SGMonoidal_DefEq + +variable {A : Type*} [Category A] {B : Type*} [Category B] + {C : Type*} [Category C] {D : Type*} [Category D] + (F : A ⥤ B) (G : B ⥤ C) (H : C ⥤ D) + +-- Sanity check: associativity of `⋙` itself holds by `rfl`. +example : F ⋙ (G ⋙ H) = (F ⋙ G) ⋙ H := rfl + +class SGMonoidal (F : A ⥤ B) where + n : ℕ + +instance [hF : SGMonoidal F] [hG : SGMonoidal G] : SGMonoidal (F ⋙ G) where + n := 2 ^ hF.n + hG.n + +variable [hF : SGMonoidal F] [hG : SGMonoidal G] [hH : SGMonoidal H] + +/-! ### Variant 1: `[semireducible]` on `Functor.comp` + +TC search distinguishes the two instances; `rfl` rightfully fails. -/ + +set_option allowUnsafeReducibility true in +attribute [semireducible] Functor.comp + +set_option pp.mvars.anonymous false in +/-- +error: Type mismatch + rfl +has type + ?_ = ?_ +but is expected to have type + SGMonoidal.n (F ⋙ G ⋙ H) = SGMonoidal.n ((F ⋙ G) ⋙ H) +-/ +#guard_msgs in +example : + letI : SGMonoidal ((F ⋙ G) ⋙ H) := inferInstance + SGMonoidal.n (F ⋙ (G ⋙ H)) = SGMonoidal.n ((F ⋙ G) ⋙ H) := rfl + +/-! ### Variant 2: `[implicit_reducible]` on `Functor.comp` (narrower tier) + +This is the attribute `Functor.comp` actually gets. + +Still safe: the narrower tier does not feed into TC-search defeq, so the two +instances remain distinct. -/ + +section ImplicitReducible +set_option allowUnsafeReducibility true in +attribute [local implicit_reducible] Functor.comp + +set_option pp.mvars.anonymous false in +/-- +error: Type mismatch + rfl +has type + ?_ = ?_ +but is expected to have type + SGMonoidal.n (F ⋙ G ⋙ H) = SGMonoidal.n ((F ⋙ G) ⋙ H) +-/ +#guard_msgs in +example : + letI : SGMonoidal ((F ⋙ G) ⋙ H) := inferInstance + SGMonoidal.n (F ⋙ (G ⋙ H)) = SGMonoidal.n ((F ⋙ G) ⋙ H) := rfl + +end ImplicitReducible + +/-! ### Variant 3: `[instance_reducible]` on `Functor.comp` (TC tier) + +The TC tier deliberately reproduces the pre-split corruption: `rfl` succeeds +even though the two instances are mathematically distinct. This pins the +*upper bound* of the tier hierarchy — if a future change accidentally made +`[instance_reducible]` even narrower, this test would notice. -/ + +section InstanceReducible +set_option allowUnsafeReducibility true in +attribute [local instance_reducible] Functor.comp + +example : + letI : SGMonoidal ((F ⋙ G) ⋙ H) := inferInstance + SGMonoidal.n (F ⋙ (G ⋙ H)) = SGMonoidal.n ((F ⋙ G) ⋙ H) := rfl + +end InstanceReducible + +end MathlibTest.SGMonoidal_DefEq diff --git a/MathlibTest/InferInstanceAsPercent.lean b/MathlibTest/InferInstanceAsPercent.lean index e86e263fa2b193..53bc864a9f7ccd 100644 --- a/MathlibTest/InferInstanceAsPercent.lean +++ b/MathlibTest/InferInstanceAsPercent.lean @@ -24,7 +24,7 @@ instance : MyInv Nat where def MyNat : Type := Nat -- `inferInstanceAs` leaks the source type `Nat` as the carrier -@[implicit_reducible] +@[instance_reducible] def myNatInv_leaky : MyInv MyNat := inferInstanceAs (MyInv Nat) @@ -34,7 +34,7 @@ instance myNatInv_fixed : MyInv MyNat := -- The binder type is `MyNat`: /-- -info: @[implicit_reducible] def myNatInv_fixed : MyInv MyNat := +info: @[instance_reducible] def myNatInv_fixed : MyInv MyNat := { myInv := fun (a : MyNat) => (Nat.add a 0).succ } -/ #guard_msgs in @@ -75,7 +75,7 @@ instance : TestField Nat where def TestNat := Nat -- Direct instance: all lambda domains correctly use TestNat -@[implicit_reducible] +@[instance_reducible] def testField_direct : TestField TestNat where inv n := n mul := Nat.mul @@ -83,11 +83,11 @@ def testField_direct : TestField TestNat where neg n := n -- Leaky: internal lambda domains use Nat instead of TestNat -@[implicit_reducible] +@[instance_reducible] def testField_leaky : TestField TestNat := inferInstanceAs (TestField Nat) -- Fixed: inferInstanceAs% patches lambda domains to use TestNat -@[implicit_reducible] +@[instance_reducible] def testField_fixed : TestField TestNat := inferInstanceAs% (TestField Nat) -- All three are defeq at default transparency (Nat = TestNat at this level). diff --git a/MathlibTest/InstanceDiamonds.lean b/MathlibTest/InstanceDiamonds.lean index 291be1c646dcb5..db9eb4f55be274 100644 --- a/MathlibTest/InstanceDiamonds.lean +++ b/MathlibTest/InstanceDiamonds.lean @@ -66,6 +66,7 @@ noncomputable def f : ℂ ⊗[ℝ] ℂ →ₗ[ℝ] ℝ := map_add' := fun z w => by simp [add_smul] map_smul' := fun r z => by simp [mul_smul] } +set_option backward.isDefEq.respectTransparency false in @[simp] theorem f_apply (z w : ℂ) : f (z ⊗ₜ[ℝ] w) = z.re * w.re := by simp [f] diff --git a/MathlibTest/Simproc/VecPerm.lean b/MathlibTest/Simproc/VecPerm.lean index d56611f093b1c9..e7a211320fc7cb 100644 --- a/MathlibTest/Simproc/VecPerm.lean +++ b/MathlibTest/Simproc/VecPerm.lean @@ -12,12 +12,15 @@ example : ![a, b, c] ∘ Equiv.swap 0 1 = ![b, a, c] := by example : ![a, b, c] ∘ Equiv.swap 0 2 = ![c, b, a] := by simp [vecPerm, Equiv.swap_apply_def] +set_option backward.isDefEq.respectTransparency false in example : ![a, b, c] ∘ c[0, 1] = ![b, a, c] := by simp -- this is dealt with using `Matrix.cons_cons_comp_swap_zero_one` +set_option backward.isDefEq.respectTransparency false in example : ![a, b, c] ∘ c[2, 0, 1] = ![b, c, a] := by simp [vecPerm, Equiv.swap_apply_def] +set_option backward.isDefEq.respectTransparency false in example : ![a, b, c, d] ∘ c[2, 3, 0, 1] = ![b, c, d, a] := by simp [vecPerm, Equiv.swap_apply_def] diff --git a/MathlibTest/TacticCheckInstancesReassoc.lean b/MathlibTest/TacticCheckInstancesReassoc.lean new file mode 100644 index 00000000000000..80bf729be98107 --- /dev/null +++ b/MathlibTest/TacticCheckInstancesReassoc.lean @@ -0,0 +1,45 @@ +import Mathlib.Tactic.CategoryTheory.Reassoc + +set_option linter.tacticCheckInstances true + +open CategoryTheory + +universe v u + +variable {C : Type u} [Category.{v} C] + +/-! reassoc on a clean lemma, no warning expected. -/ + +#guard_msgs in +@[reassoc] +lemma clean_lem {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (h : X ⟶ Z) (w : f ≫ g = h) : + f ≫ g = h := w + + +/-! a semireducible alias used for `.implicit`-ill-typed equation -/ + +def MyHom (X Y : C) : Type v := X ⟶ Y + +/-- +warning: generated lemma alias_lem_assoc is not type-correct at `.implicit` transparency; consider marking some of the following as `@[implicit_reducible]`: + Quiver.Hom + MyHom + +Note: This linter can be disabled with `set_option linter.tacticCheckInstances false` +-/ +#guard_msgs in +@[reassoc] +lemma alias_lem {X Y Z : C} (f : MyHom X Y) (g : Y ⟶ Z) (h : MyHom X Z) + (w : (f : X ⟶ Y) ≫ g = h) : + (f : X ⟶ Y) ≫ g = h := w + +/-! marking the offenders `@[implicit_reducible]` silences the warning -/ + +set_option allowUnsafeReducibility true +attribute [implicit_reducible] Quiver.Hom MyHom + +#guard_msgs in +@[reassoc] +lemma alias_lem2 {X Y Z : C} (f : MyHom X Y) (g : Y ⟶ Z) (h : MyHom X Z) + (w : (f : X ⟶ Y) ≫ g = h) : + (f : X ⟶ Y) ≫ g = h := w diff --git a/MathlibTest/TacticCheckInstancesSimps.lean b/MathlibTest/TacticCheckInstancesSimps.lean new file mode 100644 index 00000000000000..86abf922ba6c11 --- /dev/null +++ b/MathlibTest/TacticCheckInstancesSimps.lean @@ -0,0 +1,38 @@ +import Mathlib.Tactic.Simps.Basic + +set_option linter.tacticCheckInstances true + +/-! ## clean projection, no warning expected -/ + +structure Wrap (α : Type) where + carrier : List α + +#guard_msgs in +@[simps] +def mkWrap (s : List Nat) : Wrap Nat := { carrier := s } + +/-! a semireducible alias `.implicit`-ill-typed equation. -/ + +structure Fn where + toFun : Nat → Nat + +def MyFn : Type := Fn + +/-- +warning: generated lemma idFn_toFun is not type-correct at `.implicit` transparency; consider marking some of the following as `@[implicit_reducible]`: + MyFn + +Note: This linter can be disabled with `set_option linter.tacticCheckInstances false` +-/ +#guard_msgs in +@[simps] +def idFn : MyFn := ({ toFun := id } : Fn) + +/-! marking the offender `@[implicit_reducible]` silences the warning -/ + +set_option allowUnsafeReducibility true +attribute [implicit_reducible] MyFn + +#guard_msgs in +@[simps] +def idFn2 : MyFn := ({ toFun := id } : Fn) diff --git a/MathlibTest/depRewrite.lean b/MathlibTest/depRewrite.lean index 01bc4d43b09a81..ee9f04ab52bb46 100644 --- a/MathlibTest/depRewrite.lean +++ b/MathlibTest/depRewrite.lean @@ -250,6 +250,7 @@ theorem let_defeq_test (b : Nat) (eq : 1 = b) (f : (n : Nat) → n = 1 → Nat) exact test_sorry -- Test definitional equalities that get broken by rewriting. +set_option backward.isDefEq.respectTransparency false in example (b : Bool) (h : true = b) (s : Bool → Prop) (q : (c : Bool) → s c → Prop) @@ -260,6 +261,7 @@ example (b : Bool) (h : true = b) exact test_sorry -- As above. +set_option backward.isDefEq.respectTransparency false in example (b : Bool) (h : true = b) (s : Bool → Prop) (q : (c : Bool) → s c → Prop) @@ -272,6 +274,7 @@ example (b : Bool) (h : true = b) exact test_sorry -- As above. +set_option backward.isDefEq.respectTransparency false in example (b : Bool) (h : true = b) (s : Bool → Prop) (q : (c : Bool) → s c → Prop) diff --git a/MathlibTest/matrix.lean b/MathlibTest/matrix.lean index 88ffc5b1fc731e..e289264a57c106 100644 --- a/MathlibTest/matrix.lean +++ b/MathlibTest/matrix.lean @@ -162,6 +162,7 @@ example {α : Type _} [CommRing α] {a b c d e f g h i : α} : Finset.card_singleton, one_smul] ring +set_option backward.isDefEq.respectTransparency false in example {R : Type*} [Semiring R] {a b c d : R} : !![a, b] * (transpose !![c, d]) = !![a * c + b * d] := by ext i j diff --git a/lake-manifest.json b/lake-manifest.json index 34559b4f3ec340..824302ec36c01c 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -5,7 +5,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "a456461b368b71d2accd95234832cd9c174b5437", + "rev": "d575be693add4fe9cb996968968ce42ce75c5ccd", "name": "plausible", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -25,7 +25,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "515cf9d0c00ece5e661f6de4326a53dedc1e8ea1", + "rev": "6db47de43aa7f516708053ae2fdadd29dd9baaaa", "name": "importGraph", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -51,34 +51,34 @@ "inputRev": "nightly-testing", "inherited": false, "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/quote4", + {"url": "https://github.com/datokrat/quote4", "type": "git", "subDir": null, - "scope": "leanprover-community", - "rev": "bee778191c7fbea31864ecfe1809b8837626aba0", + "scope": "", + "rev": "e34425b4fe2dc961b817ecd45f7d9ff1b1a8f1c8", "name": "Qq", "manifestFile": "lake-manifest.json", - "inputRev": "nightly-testing", + "inputRev": "lean-pr-testing-13342", "inherited": false, "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/batteries", + {"url": "https://github.com/datokrat/batteries", "type": "git", "subDir": null, - "scope": "leanprover-community", - "rev": "05ebb4a8c61ac4c2cfc2175f90ac11f20eaf1f7b", + "scope": "", + "rev": "21321d902eb1f03a2e50a68f294b9fda7d221414", "name": "batteries", "manifestFile": "lake-manifest.json", - "inputRev": "nightly-testing", + "inputRev": "lean-pr-testing-13342-nwm", "inherited": false, "configFile": "lakefile.toml"}, {"url": "https://github.com/leanprover/lean4-cli", "type": "git", "subDir": null, "scope": "leanprover", - "rev": "6b907cf12b2e445ccb7c24bc208ef04a1f39e84c", + "rev": "48bdcff4c5fa27e09028f9f330e59baa0d4640cf", "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "v4.30.0", + "inputRev": "v4.31.0-rc1", "inherited": true, "configFile": "lakefile.toml"}], "name": "mathlib", diff --git a/lakefile.lean b/lakefile.lean index c6ef52a6ff89f8..77386d80dabb3f 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -6,8 +6,9 @@ open Lake DSL ## Mathlib dependencies on upstream projects -/ -require "leanprover-community" / "batteries" @ git "nightly-testing" -require "leanprover-community" / "Qq" @ git "nightly-testing" +require batteries from git "https://github.com/datokrat/batteries" @ "lean-pr-testing-13342-nwm" +require Qq from git "https://github.com/datokrat/quote4" @ "lean-pr-testing-13342" + require "leanprover-community" / "aesop" @ git "nightly-testing" require "leanprover-community" / "proofwidgets" @ git "v0.0.98" with NameMap.empty.insert `errorOnBuild diff --git a/lean-toolchain b/lean-toolchain index 841e0e9a2ea60a..d408d62f40cc8d 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:nightly-2026-05-28 +leanprover/lean4-pr-releases:pr-release-13919-1a3dc3a diff --git a/scripts/set_option_utils.py b/scripts/set_option_utils.py index 9b9d6c76d33681..bf6b27ca60395b 100755 --- a/scripts/set_option_utils.py +++ b/scripts/set_option_utils.py @@ -9,6 +9,7 @@ DEFAULT_OPTIONS = [ "backward.isDefEq.respectTransparency", + "backward.isDefEq.respectTransparency.types", "backward.whnf.reducibleClassField", "backward.inferInstanceAs.wrap", ]