From f5336a1547cfd2448fa8733d4739c036a418869c Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Sun, 12 Apr 2026 22:42:36 +0800 Subject: [PATCH 01/29] Merge branch 'golf_11' into gather --- Mathlib/Analysis/Analytic/Basic.lean | 24 +++++++-------- Mathlib/Analysis/Analytic/CPolynomialDef.lean | 18 +++++------ Mathlib/Analysis/Analytic/Composition.lean | 8 ++--- Mathlib/Analysis/Analytic/Constructions.lean | 7 ++--- .../Analysis/Analytic/ConvergenceRadius.lean | 8 +---- Mathlib/Analysis/Analytic/IteratedFDeriv.lean | 12 ++------ Mathlib/Analysis/Analytic/OfScalars.lean | 23 +++++--------- Mathlib/Analysis/Analytic/Order.lean | 11 ++----- Mathlib/Analysis/Analytic/Within.lean | 30 +++++++------------ .../Analysis/AperiodicOrder/Delone/Basic.lean | 13 ++------ .../Asymptotics/AsymptoticEquivalent.lean | 26 ++++++---------- 11 files changed, 56 insertions(+), 124 deletions(-) diff --git a/Mathlib/Analysis/Analytic/Basic.lean b/Mathlib/Analysis/Analytic/Basic.lean index f1a86dba16e40d..7d250d8f3dc2c0 100644 --- a/Mathlib/Analysis/Analytic/Basic.lean +++ b/Mathlib/Analysis/Analytic/Basic.lean @@ -237,20 +237,6 @@ theorem HasFPowerSeriesOnBall.mono (hf : HasFPowerSeriesOnBall f p x r) (r'_pos (hr : r' ≤ r) : HasFPowerSeriesOnBall f p x r' := ⟨le_trans hr hf.1, r'_pos, fun hy => hf.hasSum (Metric.eball_subset_eball hr hy)⟩ -lemma HasFPowerSeriesWithinOnBall.congr {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} - {s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r) - (h' : EqOn g f (s ∩ Metric.eball x r)) (h'' : g x = f x) : - HasFPowerSeriesWithinOnBall g p s x r := by - refine ⟨h.r_le, h.r_pos, ?_⟩ - intro y hy h'y - convert h.hasSum hy h'y using 1 - simp only [mem_insert_iff, add_eq_left] at hy - rcases hy with rfl | hy - · simpa using h'' - · apply h' - refine ⟨hy, ?_⟩ - simpa [edist_eq_enorm_sub] using h'y - /-- Variant of `HasFPowerSeriesWithinOnBall.congr` in which one requests equality on `insert x s` instead of separating `x` and `s`. -/ lemma HasFPowerSeriesWithinOnBall.congr' {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} @@ -261,6 +247,16 @@ lemma HasFPowerSeriesWithinOnBall.congr' {f g : E → F} {p : FormalMultilinearS convert h.hasSum hy h'y using 1 exact h' ⟨hy, by simpa [edist_eq_enorm_sub] using h'y⟩ +lemma HasFPowerSeriesWithinOnBall.congr {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} + {s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r) + (h' : EqOn g f (s ∩ Metric.eball x r)) (h'' : g x = f x) : + HasFPowerSeriesWithinOnBall g p s x r := by + refine h.congr' ?_ + rintro y ⟨hy, h'y⟩ + rcases hy with rfl | hy + · simpa using h'' + · exact h' ⟨hy, by simpa [edist_eq_enorm_sub] using h'y⟩ + lemma HasFPowerSeriesWithinAt.congr {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E} {x : E} (h : HasFPowerSeriesWithinAt f p s x) (h' : g =ᶠ[𝓝[s] x] f) (h'' : g x = f x) : HasFPowerSeriesWithinAt g p s x := by diff --git a/Mathlib/Analysis/Analytic/CPolynomialDef.lean b/Mathlib/Analysis/Analytic/CPolynomialDef.lean index c3d24a71bd6d4e..8234d9144da2db 100644 --- a/Mathlib/Analysis/Analytic/CPolynomialDef.lean +++ b/Mathlib/Analysis/Analytic/CPolynomialDef.lean @@ -233,20 +233,16 @@ the ball. -/ theorem HasFiniteFPowerSeriesOnBall.eq_zero_of_bound_zero (hf : HasFiniteFPowerSeriesOnBall f pf x 0 r) : ∀ y ∈ Metric.eball x r, f y = 0 := by intro y hy - rw [hf.eq_partialSum' y hy 0 le_rfl, FormalMultilinearSeries.partialSum] - simp only [Finset.range_zero, Finset.sum_empty] + simpa [FormalMultilinearSeries.partialSum] using hf.eq_partialSum' y hy 0 le_rfl theorem HasFiniteFPowerSeriesOnBall.bound_zero_of_eq_zero (hf : ∀ y ∈ Metric.eball x r, f y = 0) (r_pos : 0 < r) (hp : ∀ n, p n = 0) : HasFiniteFPowerSeriesOnBall f p x 0 r := by - refine ⟨⟨?_, r_pos, ?_⟩, fun n _ ↦ hp n⟩ - · rw [p.radius_eq_top_of_forall_image_add_eq_zero 0 (fun n ↦ by rw [add_zero]; exact hp n)] - exact le_top - · intro y hy - rw [hf (x + y)] - · convert hasSum_zero - rw [hp, ContinuousMultilinearMap.zero_apply] - · rwa [Metric.mem_eball, edist_eq_enorm_sub, add_comm, add_sub_cancel_right, - ← edist_zero_right, ← Metric.mem_eball] + refine HasFiniteFPowerSeriesOnBall.mk' (fun n _ ↦ hp n) r_pos ?_ + intro y hy + rw [hf (x + y)] + · simp + · rwa [Metric.mem_eball, edist_eq_enorm_sub, add_comm, add_sub_cancel_right, + ← edist_zero_right, ← Metric.mem_eball] /-- If `f` has a formal power series at `x` bounded by `0`, then `f` is equal to `0` in a neighborhood of `x`. -/ diff --git a/Mathlib/Analysis/Analytic/Composition.lean b/Mathlib/Analysis/Analytic/Composition.lean index 57015f27b54b07..2a60068e27629c 100644 --- a/Mathlib/Analysis/Analytic/Composition.lean +++ b/Mathlib/Analysis/Analytic/Composition.lean @@ -916,12 +916,8 @@ theorem HasFiniteFPowerSeriesAt.comp {m n : ℕ} {g : F → G} {f : E → F} contrapose! hi rw [← c.sum_blocksFun] rcases eq_zero_or_pos c.length with h'c | h'c - · have : ∑ j : Fin c.length, c.blocksFun j = 0 := by - apply Finset.sum_eq_zero (fun j hj ↦ ?_) - have := j.2 - grind - rw [this] - exact mul_pos (by grind) hn + · have hi0 : i = 0 := (Composition.length_eq_zero (c := c)).1 h'c + simpa [hi0, h'c] using mul_pos (Nat.zero_lt_of_lt hc) hn · calc ∑ j : Fin c.length, c.blocksFun j _ < ∑ j : Fin c.length, n := by apply Finset.sum_lt_sum (fun j hj ↦ (hi j).le) diff --git a/Mathlib/Analysis/Analytic/Constructions.lean b/Mathlib/Analysis/Analytic/Constructions.lean index 8e4a7cb6769404..99de973b0bb31f 100644 --- a/Mathlib/Analysis/Analytic/Constructions.lean +++ b/Mathlib/Analysis/Analytic/Constructions.lean @@ -927,11 +927,8 @@ lemma AnalyticWithinAt.zpow {f : E → 𝕝} {z : E} {s : Set E} {n : ℤ} @[to_fun] lemma AnalyticAt.zpow {f : E → 𝕝} {z : E} {n : ℤ} (h₁f : AnalyticAt 𝕜 f z) (h₂f : f z ≠ 0) : AnalyticAt 𝕜 (f ^ n) z := by - by_cases hn : 0 ≤ n - · exact zpow_nonneg h₁f hn - · rw [(Int.eq_neg_comm.mp rfl : n = -(-n))] - conv => arg 2; intro x; rw [zpow_neg] - exact (h₁f.zpow_nonneg (by linarith)).inv (zpow_ne_zero (-n) h₂f) + rw [← analyticWithinAt_univ] at h₁f ⊢ + exact h₁f.zpow h₂f /-- ZPowers of analytic functions (into a normed field over `𝕜`) are analytic away from the zeros. -/ diff --git a/Mathlib/Analysis/Analytic/ConvergenceRadius.lean b/Mathlib/Analysis/Analytic/ConvergenceRadius.lean index 06d1363bb19a8e..6447f3576a1073 100644 --- a/Mathlib/Analysis/Analytic/ConvergenceRadius.lean +++ b/Mathlib/Analysis/Analytic/ConvergenceRadius.lean @@ -255,13 +255,7 @@ theorem radius_eq_top_iff_summable_norm (p : FormalMultilinearSeries 𝕜 E F) : p.radius = ∞ ↔ ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n := by constructor · intro h r - obtain ⟨a, ha : a ∈ Ioo (0 : ℝ) 1, C, - : 0 < C, hp⟩ := p.norm_mul_pow_le_mul_pow_of_lt_radius - (show (r : ℝ≥0∞) < p.radius from h.symm ▸ ENNReal.coe_lt_top) - refine .of_norm_bounded - (g := fun n ↦ (C : ℝ) * a ^ n) ((summable_geometric_of_lt_one ha.1.le ha.2).mul_left _) - fun n ↦ ?_ - specialize hp n - rwa [Real.norm_of_nonneg (by positivity)] + exact p.summable_norm_mul_pow (show (r : ℝ≥0∞) < p.radius from h.symm ▸ ENNReal.coe_lt_top) · exact p.radius_eq_top_of_summable_norm /-- If the radius of `p` is positive, then `‖pₙ‖` grows at most geometrically. -/ diff --git a/Mathlib/Analysis/Analytic/IteratedFDeriv.lean b/Mathlib/Analysis/Analytic/IteratedFDeriv.lean index 3800e8c99e9a1f..a82f6110453b2f 100644 --- a/Mathlib/Analysis/Analytic/IteratedFDeriv.lean +++ b/Mathlib/Analysis/Analytic/IteratedFDeriv.lean @@ -127,17 +127,9 @@ lemma ContinuousMultilinearMap.iteratedFDeriv_comp_diagonal rw [← sum_comp (Equiv.embeddingEquivOfFinite (Fin n))] congr with σ congr with i - have A : ∃ y, σ y = i := by - have : Function.Bijective σ := (Fintype.bijective_iff_injective_and_card _).2 ⟨σ.injective, rfl⟩ - exact this.surjective i - rcases A with ⟨y, rfl⟩ - simp only [EmbeddingLike.apply_eq_iff_eq, exists_eq, ↓reduceDIte, - Function.Embedding.toEquivRange_symm_apply_self, ContinuousLinearMap.coe_pi', - ContinuousLinearMap.coe_id', id_eq, g] - congr 1 - symm + obtain ⟨y, rfl⟩ := σ.equivOfFiniteSelfEmbedding.surjective i simp [inv_apply, Perm.inv_def, - ofBijective_symm_apply_apply, Function.Embedding.equivOfFiniteSelfEmbedding] + ofBijective_symm_apply_apply, Function.Embedding.equivOfFiniteSelfEmbedding, g] private lemma HasFPowerSeriesWithinOnBall.iteratedFDerivWithin_eq_sum_of_subset (h : HasFPowerSeriesWithinOnBall f p s x r) (h' : AnalyticOn 𝕜 f s) diff --git a/Mathlib/Analysis/Analytic/OfScalars.lean b/Mathlib/Analysis/Analytic/OfScalars.lean index b84df5d936ab81..712002e39cf022 100644 --- a/Mathlib/Analysis/Analytic/OfScalars.lean +++ b/Mathlib/Analysis/Analytic/OfScalars.lean @@ -64,15 +64,9 @@ theorem ofScalars_series_of_subsingleton [Subsingleton E] : ofScalars E c = 0 := variable (𝕜) in theorem ofScalars_series_injective [Nontrivial E] : Function.Injective (ofScalars E (𝕜 := 𝕜)) := by - intro _ _ - refine Function.mtr fun h ↦ ?_ - simp_rw [FormalMultilinearSeries.ext_iff, ofScalars, ContinuousMultilinearMap.ext_iff, - ContinuousMultilinearMap.smul_apply] - push Not - obtain ⟨n, hn⟩ := Function.ne_iff.1 h - refine ⟨n, fun _ ↦ 1, ?_⟩ - simp only [mkPiAlgebraFin_apply, List.ofFn_const, List.prod_replicate, one_pow, ne_eq] - exact (smul_left_injective 𝕜 one_ne_zero).ne hn + intro c c' h + funext n + simpa [ofScalars] using congrArg (fun p => p n fun _ ↦ (1 : E)) h variable (c) @@ -91,19 +85,16 @@ lemma coeff_ofScalars {𝕜 : Type*} [NontriviallyNormedField 𝕜] {p : ℕ → (FormalMultilinearSeries.ofScalars 𝕜 p).coeff n = p n := by simp [FormalMultilinearSeries.coeff, FormalMultilinearSeries.ofScalars, List.prod_ofFn] -set_option backward.isDefEq.respectTransparency false in theorem ofScalars_add (c' : ℕ → 𝕜) : ofScalars E (c + c') = ofScalars E c + ofScalars E c' := by - unfold ofScalars - simp_rw [Pi.add_apply, Pi.add_def _ _] - exact funext fun n ↦ Module.add_smul (c n) (c' n) (ContinuousMultilinearMap.mkPiAlgebraFin 𝕜 n E) + ext n x + simp [ofScalars, add_smul] lemma ofScalars_sub (c' : ℕ → 𝕜) : ofScalars E (c - c') = ofScalars E c - ofScalars E c' := by ext; simp [ofScalars, sub_smul] -set_option backward.isDefEq.respectTransparency false in theorem ofScalars_smul (x : 𝕜) : ofScalars E (x • c) = x • ofScalars E c := by - unfold ofScalars - simp [Pi.smul_def x _, smul_smul] + ext n y + simp [ofScalars, smul_smul] theorem ofScalars_comp_neg_id : (ofScalars E c).compContinuousLinearMap (-ContinuousLinearMap.id _ _) = diff --git a/Mathlib/Analysis/Analytic/Order.lean b/Mathlib/Analysis/Analytic/Order.lean index dead0146a13100..88fdb2166c4684 100644 --- a/Mathlib/Analysis/Analytic/Order.lean +++ b/Mathlib/Analysis/Analytic/Order.lean @@ -611,14 +611,9 @@ codiscrete sets. theorem preimage_zero_mem_codiscreteWithin {x : 𝕜} (h₁f : AnalyticOnNhd 𝕜 f U) (h₂f : f x ≠ 0) (hx : x ∈ U) (hU : IsConnected U) : f ⁻¹' {0}ᶜ ∈ codiscreteWithin U := by - filter_upwards [h₁f.codiscreteWithin_setOf_analyticOrderAt_eq_zero_or_top, - self_mem_codiscreteWithin U] with a ha h₂a - rw [← (h₁f x hx).analyticOrderAt_eq_zero] at h₂f - have {u : U} : analyticOrderAt f u ≠ ⊤ := by - apply (h₁f.exists_analyticOrderAt_ne_top_iff_forall hU).1 - use ⟨x, hx⟩ - simp_all - simp_all [(h₁f a h₂a).analyticOrderAt_eq_zero] + rcases h₁f.eqOn_zero_or_eventually_ne_zero_of_preconnected hU.isPreconnected with hzero | hne + · exact (h₂f (hzero hx)).elim + · simpa [Filter.Eventually, Set.mem_setOf_eq] using hne /-- If an analytic function `f` is not constantly zero on `𝕜`, then its set of zeros is codiscrete. diff --git a/Mathlib/Analysis/Analytic/Within.lean b/Mathlib/Analysis/Analytic/Within.lean index ab7e8a9cbc5fcf..e430ff26459fcb 100644 --- a/Mathlib/Analysis/Analytic/Within.lean +++ b/Mathlib/Analysis/Analytic/Within.lean @@ -118,16 +118,10 @@ lemma hasFPowerSeriesWithinOnBall_iff_exists_hasFPowerSeriesOnBall [CompleteSpac constructor · intro h refine ⟨fun y ↦ p.sum (y - x), ?_, ?_⟩ - · intro y ⟨ys,yb⟩ - simp only [mem_eball, edist_eq_enorm_sub] at yb - have e0 := p.hasSum (x := y - x) ?_ - · have e1 := (h.hasSum (y := y - x) ?_ ?_) - · simp only [add_sub_cancel] at e1 - exact e1.unique e0 - · simpa only [add_sub_cancel] - · simpa only [mem_eball, edist_zero_right] - · simp only [mem_eball, edist_zero_right] - exact lt_of_lt_of_le yb h.r_le + · rintro y ⟨ys, yb⟩ + simpa only [add_sub_cancel] using + h.sum (y := y - x) (by simpa only [add_sub_cancel] using ys) + (by simpa only [mem_eball, edist_eq_enorm_sub, sub_zero] using yb) · refine ⟨h.r_le, h.r_pos, ?_⟩ intro y lt simp only [add_sub_cancel_left] @@ -181,19 +175,15 @@ lemma analyticWithinAt_iff_exists_analyticAt' [CompleteSpace F] {f : E → F} {s refine ⟨?_, ?_⟩ · rintro ⟨g, hf, hg⟩ rcases mem_nhdsWithin.1 hf with ⟨u, u_open, xu, hu⟩ - let g' := Set.piecewise u g f - refine ⟨g', ?_, ?_, ?_⟩ - · have : x ∈ u ∩ insert x s := ⟨xu, by simp⟩ - simpa [g', xu, this] using hu this + refine ⟨u.piecewise g f, ?_, ?_, ?_⟩ + · simpa [xu] using hu ⟨xu, by simp⟩ · intro y hy by_cases h'y : y ∈ u - · have : y ∈ u ∩ insert x s := ⟨h'y, hy⟩ - simpa [g', h'y, this] using hu this - · simp [g', h'y] - · apply hg.congr - filter_upwards [u_open.mem_nhds xu] with y hy using by simp [g', hy] + · simpa [h'y] using hu ⟨h'y, hy⟩ + · simp [h'y] + · exact hg.congr <| (Set.piecewise_eqOn u g f).symm.eventuallyEq_of_mem (u_open.mem_nhds xu) · rintro ⟨g, -, hf, hg⟩ - exact ⟨g, by filter_upwards [self_mem_nhdsWithin] using hf, hg⟩ + exact ⟨g, hf.eventuallyEq_of_mem self_mem_nhdsWithin, hg⟩ alias ⟨AnalyticWithinAt.exists_analyticAt, _⟩ := analyticWithinAt_iff_exists_analyticAt' diff --git a/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean b/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean index f3f33a2615c0b3..33ce17b89e10b2 100644 --- a/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean +++ b/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean @@ -119,14 +119,11 @@ theorem copy_eq (D : DeloneSet X) lemma packingRadius_lt_dist_of_mem_ne (D : DeloneSet X) {x y : X} (hx : x ∈ D) (hy : y ∈ D) (hne : x ≠ y) : D.packingRadius < dist x y := by - have hsep : ENNReal.ofReal D.packingRadius < ENNReal.ofReal (dist x y) := by - simpa [edist_dist] using D.isSeparated_packingRadius hx hy hne - exact (ENNReal.ofReal_lt_ofReal_iff (h := dist_pos.mpr hne)).1 hsep + simpa [edist_dist] using D.isSeparated_packingRadius hx hy hne lemma exists_dist_le_coveringRadius (D : DeloneSet X) (x : X) : ∃ y ∈ D, dist x y ≤ D.coveringRadius := by - obtain ⟨y, hy, hdist⟩ := D.isCover_coveringRadius (x := x) (by trivial) - exact ⟨y, hy, by simpa [edist_dist] using hdist⟩ + simpa [edist_dist] using D.isCover_coveringRadius (x := x) (by trivial) lemma eq_of_mem_ball (D : DeloneSet X) {r : ℝ≥0} (hr : r ≤ D.packingRadius / 2) {x y z : X} (hx : x ∈ D) (hy : y ∈ D) (hxz : x ∈ ball z r) (hyz : y ∈ ball z r) : @@ -170,11 +167,7 @@ lemma mapBilipschitz_trans {Z : Type*} [MetricSpace Z] (D : DeloneSet X) D.mapBilipschitz (f.trans g) (K₁f * K₁g) (K₂g * K₂f) (mul_pos hf₁_pos hg₁_pos) (mul_pos hg₂_pos hf₂_pos) (hg_anti.comp hf_anti) (hg_lip.comp hf_lip) := by - ext - · simp only [mapBilipschitz_carrier, Equiv.trans_apply, Set.mem_image] - exact exists_exists_and_eq_and - · simp only [mapBilipschitz_packingRadius, NNReal.coe_div, div_div] - · simp only [mapBilipschitz_coveringRadius, NNReal.coe_mul, mul_assoc] + (ext <;> simp [mapBilipschitz, Equiv.trans_apply, div_div, mul_assoc]); grind /-- 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 diff --git a/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean b/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean index 0466830fdd3bb0..528234e48e064f 100644 --- a/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean +++ b/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean @@ -118,13 +118,9 @@ theorem isEquivalent_zero_iff_isBigO_zero : u ~[l] 0 ↔ u =O[l] (0 : α → β) theorem isEquivalent_const_iff_tendsto {c : β} (h : c ≠ 0) : u ~[l] const _ c ↔ Tendsto u l (𝓝 c) := by - simp +unfoldPartialApp only [IsEquivalent, const, isLittleO_const_iff h] - constructor <;> intro h - · have := h.sub (tendsto_const_nhds (x := -c)) - simp only [Pi.sub_apply, sub_neg_eq_add, sub_add_cancel, zero_add] at this - exact this - · have := h.sub (tendsto_const_nhds (x := c)) - rwa [sub_self] at this + rw [IsEquivalent] + change (u - const α c) =o[l] (fun _ : α => c) ↔ Tendsto u l (𝓝 c) + simpa [show u - const α c = (fun x ↦ u x - c) by rfl, isLittleO_const_iff h] using (Filter.tendsto_sub_const_iff (b := c) (c := c) (f := u) (l := l)) theorem IsEquivalent.tendsto_const {c : β} (hu : u ~[l] const _ c) : Tendsto u l (𝓝 c) := by rcases em <| c = 0 with rfl | h @@ -207,16 +203,12 @@ theorem isEquivalent_of_tendsto_one (huv : Tendsto (u / v) l (𝓝 1)) : theorem isEquivalent_iff_tendsto_one (hz : ∀ᶠ x in l, v x ≠ 0) : u ~[l] v ↔ Tendsto (u / v) l (𝓝 1) := by - constructor - · intro hequiv - have := hequiv.isLittleO.tendsto_div_nhds_zero - simp only [Pi.sub_apply, sub_div] at this - have key : Tendsto (fun x ↦ v x / v x) l (𝓝 1) := - (tendsto_congr' <| hz.mono fun x hnz ↦ @div_self _ _ (v x) hnz).mpr tendsto_const_nhds - convert this.add key - · simp - · simp - · exact isEquivalent_of_tendsto_one + rw [IsEquivalent, isLittleO_iff_tendsto' (hz.mono fun x hx hx0 => (hx hx0).elim)] + change Tendsto (fun x ↦ (u x - v x) / v x) l (𝓝 0) ↔ Tendsto (u / v) l (𝓝 1) + rw [show Tendsto (fun x ↦ (u x - v x) / v x) l (𝓝 0) ↔ + Tendsto (fun x ↦ u x / v x - 1) l (𝓝 0) from + tendsto_congr' <| hz.mono fun x hx => by simp [sub_div, hx]] + simpa using (Filter.tendsto_sub_const_iff (b := (1 : β)) (c := (1 : β)) (f := u / v) (l := l)) end NormedField From 75b65a3b6aadf3d0b4382880a610d21be4c391fc Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Sun, 12 Apr 2026 23:22:59 +0800 Subject: [PATCH 02/29] linter --- Mathlib/Analysis/Analytic/ConvergenceRadius.lean | 8 +++----- Mathlib/Analysis/Analytic/Within.lean | 6 +++--- Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean | 2 +- .../Analysis/Asymptotics/AsymptoticEquivalent.lean | 11 ++++++----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Mathlib/Analysis/Analytic/ConvergenceRadius.lean b/Mathlib/Analysis/Analytic/ConvergenceRadius.lean index 6447f3576a1073..c171b75623dbde 100644 --- a/Mathlib/Analysis/Analytic/ConvergenceRadius.lean +++ b/Mathlib/Analysis/Analytic/ConvergenceRadius.lean @@ -252,11 +252,9 @@ theorem radius_eq_top_of_summable_norm (p : FormalMultilinearSeries 𝕜 E F) ENNReal.eq_top_of_forall_nnreal_le fun r => p.le_radius_of_summable_norm (hs r) theorem radius_eq_top_iff_summable_norm (p : FormalMultilinearSeries 𝕜 E F) : - p.radius = ∞ ↔ ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n := by - constructor - · intro h r - exact p.summable_norm_mul_pow (show (r : ℝ≥0∞) < p.radius from h.symm ▸ ENNReal.coe_lt_top) - · exact p.radius_eq_top_of_summable_norm + p.radius = ∞ ↔ ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n := + ⟨fun h _ ↦ p.summable_norm_mul_pow (h.symm ▸ ENNReal.coe_lt_top), + p.radius_eq_top_of_summable_norm⟩ /-- If the radius of `p` is positive, then `‖pₙ‖` grows at most geometrically. -/ theorem le_mul_pow_of_radius_pos (p : FormalMultilinearSeries 𝕜 E F) (h : 0 < p.radius) : diff --git a/Mathlib/Analysis/Analytic/Within.lean b/Mathlib/Analysis/Analytic/Within.lean index e430ff26459fcb..cea3d711a4eb5d 100644 --- a/Mathlib/Analysis/Analytic/Within.lean +++ b/Mathlib/Analysis/Analytic/Within.lean @@ -119,9 +119,9 @@ lemma hasFPowerSeriesWithinOnBall_iff_exists_hasFPowerSeriesOnBall [CompleteSpac · intro h refine ⟨fun y ↦ p.sum (y - x), ?_, ?_⟩ · rintro y ⟨ys, yb⟩ - simpa only [add_sub_cancel] using - h.sum (y := y - x) (by simpa only [add_sub_cancel] using ys) - (by simpa only [mem_eball, edist_eq_enorm_sub, sub_zero] using yb) + have : f (x + (y - x)) = p.sum (y - x) := + h.sum (y := y - x) (by simpa using ys) (by simpa [edist_eq_enorm_sub] using yb) + simpa using this · refine ⟨h.r_le, h.r_pos, ?_⟩ intro y lt simp only [add_sub_cancel_left] diff --git a/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean b/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean index 33ce17b89e10b2..98bd4bd06faac3 100644 --- a/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean +++ b/Mathlib/Analysis/AperiodicOrder/Delone/Basic.lean @@ -123,7 +123,7 @@ lemma packingRadius_lt_dist_of_mem_ne (D : DeloneSet X) {x y : X} lemma exists_dist_le_coveringRadius (D : DeloneSet X) (x : X) : ∃ y ∈ D, dist x y ≤ D.coveringRadius := by - simpa [edist_dist] using D.isCover_coveringRadius (x := x) (by trivial) + simpa [edist_dist] using D.isCover_coveringRadius (by trivial) lemma eq_of_mem_ball (D : DeloneSet X) {r : ℝ≥0} (hr : r ≤ D.packingRadius / 2) {x y z : X} (hx : x ∈ D) (hy : y ∈ D) (hxz : x ∈ ball z r) (hyz : y ∈ ball z r) : diff --git a/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean b/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean index 528234e48e064f..7683a61d99d56b 100644 --- a/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean +++ b/Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean @@ -120,7 +120,7 @@ theorem isEquivalent_const_iff_tendsto {c : β} (h : c ≠ 0) : u ~[l] const _ c ↔ Tendsto u l (𝓝 c) := by rw [IsEquivalent] change (u - const α c) =o[l] (fun _ : α => c) ↔ Tendsto u l (𝓝 c) - simpa [show u - const α c = (fun x ↦ u x - c) by rfl, isLittleO_const_iff h] using (Filter.tendsto_sub_const_iff (b := c) (c := c) (f := u) (l := l)) + simpa [isLittleO_const_iff h] using tendsto_sub_const_iff c (c := c) theorem IsEquivalent.tendsto_const {c : β} (hu : u ~[l] const _ c) : Tendsto u l (𝓝 c) := by rcases em <| c = 0 with rfl | h @@ -205,10 +205,11 @@ theorem isEquivalent_iff_tendsto_one (hz : ∀ᶠ x in l, v x ≠ 0) : u ~[l] v ↔ Tendsto (u / v) l (𝓝 1) := by rw [IsEquivalent, isLittleO_iff_tendsto' (hz.mono fun x hx hx0 => (hx hx0).elim)] change Tendsto (fun x ↦ (u x - v x) / v x) l (𝓝 0) ↔ Tendsto (u / v) l (𝓝 1) - rw [show Tendsto (fun x ↦ (u x - v x) / v x) l (𝓝 0) ↔ - Tendsto (fun x ↦ u x / v x - 1) l (𝓝 0) from - tendsto_congr' <| hz.mono fun x hx => by simp [sub_div, hx]] - simpa using (Filter.tendsto_sub_const_iff (b := (1 : β)) (c := (1 : β)) (f := u / v) (l := l)) + have : Tendsto (fun x ↦ (u x - v x) / v x) l (𝓝 0) ↔ + Tendsto (fun x ↦ u x / v x - 1) l (𝓝 0) := + tendsto_congr' <| hz.mono fun x hx => by simp [sub_div, hx] + rw [this] + exact tendsto_sub_nhds_zero_iff end NormedField From c0589d3443122bfa7ced1967c796d895296391c3 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 01:40:39 +0800 Subject: [PATCH 03/29] Merge branch 'golf_2' into golf --- Mathlib/Analysis/Asymptotics/Defs.lean | 20 ++++++++----------- Mathlib/Analysis/Asymptotics/ExpGrowth.lean | 20 ++++++------------- .../Asymptotics/SpecificAsymptotics.lean | 15 +++----------- .../Asymptotics/SuperpolynomialDecay.lean | 12 ++++------- Mathlib/Analysis/BoundedVariation.lean | 18 ++++++----------- Mathlib/Analysis/BoxIntegral/Basic.lean | 8 ++------ 6 files changed, 29 insertions(+), 64 deletions(-) diff --git a/Mathlib/Analysis/Asymptotics/Defs.lean b/Mathlib/Analysis/Asymptotics/Defs.lean index ff4cfa896e38ca..0d5d946866dfb0 100644 --- a/Mathlib/Analysis/Asymptotics/Defs.lean +++ b/Mathlib/Analysis/Asymptotics/Defs.lean @@ -897,21 +897,17 @@ section variable (l' : Filter β) -protected theorem IsBigO.comp_fst : f =O[l] g → (f ∘ Prod.fst) =O[l ×ˢ l'] (g ∘ Prod.fst) := by - simp only [isBigO_iff, eventually_prod_iff] - exact fun ⟨c, hc⟩ ↦ ⟨c, _, hc, fun _ ↦ True, eventually_true l', fun {_} h {_} _ ↦ h⟩ +protected theorem IsBigO.comp_fst : f =O[l] g → (f ∘ Prod.fst) =O[l ×ˢ l'] (g ∘ Prod.fst) := + fun h ↦ h.comp_tendsto Filter.tendsto_fst -protected theorem IsBigO.comp_snd : f =O[l] g → (f ∘ Prod.snd) =O[l' ×ˢ l] (g ∘ Prod.snd) := by - simp only [isBigO_iff, eventually_prod_iff] - exact fun ⟨c, hc⟩ ↦ ⟨c, fun _ ↦ True, eventually_true l', _, hc, fun _ ↦ id⟩ +protected theorem IsBigO.comp_snd : f =O[l] g → (f ∘ Prod.snd) =O[l' ×ˢ l] (g ∘ Prod.snd) := + fun h ↦ h.comp_tendsto Filter.tendsto_snd -protected theorem IsLittleO.comp_fst : f =o[l] g → (f ∘ Prod.fst) =o[l ×ˢ l'] (g ∘ Prod.fst) := by - simp only [isLittleO_iff, eventually_prod_iff] - exact fun h _ hc ↦ ⟨_, h hc, fun _ ↦ True, eventually_true l', fun {_} h {_} _ ↦ h⟩ +protected theorem IsLittleO.comp_fst : f =o[l] g → (f ∘ Prod.fst) =o[l ×ˢ l'] (g ∘ Prod.fst) := + fun h ↦ h.comp_tendsto Filter.tendsto_fst -protected theorem IsLittleO.comp_snd : f =o[l] g → (f ∘ Prod.snd) =o[l' ×ˢ l] (g ∘ Prod.snd) := by - simp only [isLittleO_iff, eventually_prod_iff] - exact fun h _ hc ↦ ⟨fun _ ↦ True, eventually_true l', _, h hc, fun _ ↦ id⟩ +protected theorem IsLittleO.comp_snd : f =o[l] g → (f ∘ Prod.snd) =o[l' ×ˢ l] (g ∘ Prod.snd) := + fun h ↦ h.comp_tendsto Filter.tendsto_snd end diff --git a/Mathlib/Analysis/Asymptotics/ExpGrowth.lean b/Mathlib/Analysis/Asymptotics/ExpGrowth.lean index f66f18c0270adc..cfbdb3e0386540 100644 --- a/Mathlib/Analysis/Asymptotics/ExpGrowth.lean +++ b/Mathlib/Analysis/Asymptotics/ExpGrowth.lean @@ -250,25 +250,17 @@ lemma expGrowthSup_inv : expGrowthSup u⁻¹ = - expGrowthInf u := by -- `IsBigO` property is spelt out. lemma expGrowthInf_le_of_eventually_le (hb : b ≠ ∞) (h : ∀ᶠ n in atTop, u n ≤ b * v n) : expGrowthInf u ≤ expGrowthInf v := by - apply (expGrowthInf_eventually_monotone h).trans - rcases eq_zero_or_pos b with rfl | b_pos - · simp only [zero_mul, ← Pi.zero_def, expGrowthInf_zero, bot_le] - · apply (expGrowthInf_mul_le _ _).trans_eq <;> rw [expGrowthSup_const b_pos.ne' hb] - · exact zero_add (expGrowthInf v) - · exact .inl zero_ne_bot - · exact .inl zero_ne_top + rw [expGrowthInf_def, expGrowthInf_def] + exact linearGrowthInf_le_of_eventually_le (u := log ∘ u) (v := log ∘ v) (b := log b) (by simpa) <| + h.mono fun n hn ↦ by simpa [Pi.mul_apply, log_mul_add, add_comm] using log_monotone hn -- Bound on `expGrowthSup` under a `IsBigO` hypothesis. However, `ℝ≥0∞` is not normed, so the -- `IsBigO` property is spelt out. lemma expGrowthSup_le_of_eventually_le (hb : b ≠ ∞) (h : ∀ᶠ n in atTop, u n ≤ b * v n) : expGrowthSup u ≤ expGrowthSup v := by - apply (expGrowthSup_eventually_monotone h).trans - rcases eq_zero_or_pos b with rfl | b_pos - · simp only [zero_mul, ← Pi.zero_def, expGrowthSup_zero, bot_le] - · apply (expGrowthSup_mul_le _ _).trans_eq <;> rw [expGrowthSup_const b_pos.ne' hb] - · exact zero_add (expGrowthSup v) - · exact .inl zero_ne_bot - · exact .inl zero_ne_top + rw [expGrowthSup_def, expGrowthSup_def] + exact linearGrowthSup_le_of_eventually_le (u := log ∘ u) (v := log ∘ v) (b := log b) (by simpa) <| + h.mono fun n hn ↦ by simpa [Pi.mul_apply, log_mul_add, add_comm] using log_monotone hn lemma expGrowthInf_of_eventually_ge (hb : b ≠ 0) (h : ∀ᶠ n in atTop, b * u n ≤ v n) : expGrowthInf u ≤ expGrowthInf v := by diff --git a/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean b/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean index d6333250da9147..21e956b943c81f 100644 --- a/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean +++ b/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean @@ -44,18 +44,9 @@ open Bornology theorem Asymptotics.isLittleO_pow_pow_cobounded_of_lt (hpq : p < q) : (· ^ p) =o[cobounded R] (· ^ q) := by - nontriviality R - have noc : NormOneClass R := NormMulClass.toNormOneClass - refine IsLittleO.of_bound fun c cpos ↦ ?_ - rw [← Nat.sub_add_cancel hpq.le] - simp_rw [pow_add, norm_mul, norm_pow, eventually_iff_exists_mem] - refine ⟨{y | c⁻¹ ≤ ‖y‖ ^ (q - p)}, ?_, fun y my ↦ ?_⟩ - · have key : Tendsto (‖·‖ ^ (q - p)) (cobounded R) atTop := - (tendsto_pow_atTop (Nat.sub_ne_zero_iff_lt.mpr hpq)).comp tendsto_norm_cobounded_atTop - rw [tendsto_atTop] at key - exact mem_map.mp (key c⁻¹) - · rw [← inv_mul_le_iff₀ cpos] - exact mul_le_mul_of_nonneg_right my (by positivity) + rw [← Nat.add_sub_of_le hpq.le] + simpa [pow_add] using (isBigO_refl (fun x ↦ x ^ p) (cobounded R)).mul_isLittleO + ((isLittleO_const_id_cobounded (1 : R)).pow (Nat.sub_pos_of_lt hpq)) theorem Asymptotics.isBigO_pow_pow_cobounded_of_le (hpq : p ≤ q) : (· ^ p) =O[cobounded R] (· ^ q) := by diff --git a/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean b/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean index b1001051c200d5..0979ac0f780d5c 100644 --- a/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean +++ b/Mathlib/Analysis/Asymptotics/SuperpolynomialDecay.lean @@ -158,14 +158,10 @@ variable {l k f} theorem SuperpolynomialDecay.trans_eventually_abs_le (hf : SuperpolynomialDecay l k f) (hfg : abs ∘ g ≤ᶠ[l] abs ∘ f) : SuperpolynomialDecay l k g := by - rw [superpolynomialDecay_iff_abs_tendsto_zero] at hf ⊢ - refine fun z => - tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds (hf z) - (Eventually.of_forall fun x => abs_nonneg _) (hfg.mono fun x hx => ?_) - calc - |k x ^ z * g x| = |k x ^ z| * |g x| := abs_mul (k x ^ z) (g x) - _ ≤ |k x ^ z| * |f x| := by gcongr _ * ?_; exact hx - _ = |k x ^ z * f x| := (abs_mul (k x ^ z) (f x)).symm + rw [superpolynomialDecay_iff_superpolynomialDecay_abs] at hf ⊢ + exact (superpolynomialDecay_zero l (fun a => |k a|)).trans_eventuallyLE + (Eventually.of_forall fun x => abs_nonneg (k x)) hf + (Eventually.of_forall fun x => abs_nonneg (g x)) hfg theorem SuperpolynomialDecay.trans_abs_le (hf : SuperpolynomialDecay l k f) (hfg : ∀ x, |g x| ≤ |f x|) : SuperpolynomialDecay l k g := diff --git a/Mathlib/Analysis/BoundedVariation.lean b/Mathlib/Analysis/BoundedVariation.lean index 92d3e5fdec2854..3b8f7a94d7db69 100644 --- a/Mathlib/Analysis/BoundedVariation.lean +++ b/Mathlib/Analysis/BoundedVariation.lean @@ -66,11 +66,8 @@ is differentiable almost everywhere in this set. -/ theorem ae_differentiableWithinAt_of_mem {f : ℝ → V} {s : Set ℝ} (h : LocallyBoundedVariationOn f s) : ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ f s x := by let A := (Module.Basis.ofVectorSpace ℝ V).equivFun.toContinuousLinearEquiv - suffices H : ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ (A ∘ f) s x by - filter_upwards [H] with x hx xs - exact (ContinuousLinearEquiv.comp_differentiableWithinAt_iff _).mp (hx xs) - apply ae_differentiableWithinAt_of_mem_pi - exact A.lipschitz.comp_locallyBoundedVariationOn h + exact (ae_differentiableWithinAt_of_mem_pi (A.lipschitz.comp_locallyBoundedVariationOn h)).mono + fun _ hx hs ↦ A.comp_differentiableWithinAt_iff.mp (hx hs) /-- A real function into a finite-dimensional real vector space with bounded variation on an interval is differentiable almost everywhere in this interval. This one differs from @@ -78,13 +75,10 @@ interval is differentiable almost everywhere in this interval. This one differs `DifferentiableWithinAt` in its conclusion. -/ theorem _root_.BoundedVariationOn.ae_differentiableAt_of_mem_uIcc {f : ℝ → V} {a b : ℝ} (h : BoundedVariationOn f (uIcc a b)) : ∀ᵐ x, x ∈ uIcc a b → DifferentiableAt ℝ f x := by - have h₁ : ∀ᵐ x, x ≠ min a b := by simp [ae_iff, measure_singleton] - have h₂ : ∀ᵐ x, x ≠ max a b := by simp [ae_iff, measure_singleton] - filter_upwards [h.locallyBoundedVariationOn.ae_differentiableWithinAt_of_mem, h₁, h₂] - with x hx₁ hx₂ hx₃ hx₄ - rw [uIcc, mem_Icc] at hx₄ - exact (hx₁ hx₄).differentiableAt - (Icc_mem_nhds (lt_of_le_of_ne hx₄.left hx₂.symm) (lt_of_le_of_ne hx₄.right hx₃)) + filter_upwards [h.locallyBoundedVariationOn.ae_differentiableWithinAt_of_mem, + (by simp [ae_iff, measure_singleton] : ∀ᵐ x, x ≠ min a b), + (by simp [ae_iff, measure_singleton] : ∀ᵐ x, x ≠ max a b)] with x hx hxmin hxmax hxmem + exact (hx hxmem).differentiableAt (by grind [uIcc, Icc_mem_nhds_iff]) /-- A real function into a finite-dimensional real vector space with bounded variation on a set is differentiable almost everywhere in this set. -/ diff --git a/Mathlib/Analysis/BoxIntegral/Basic.lean b/Mathlib/Analysis/BoxIntegral/Basic.lean index 907f94655b6723..4a73a24792f489 100644 --- a/Mathlib/Analysis/BoxIntegral/Basic.lean +++ b/Mathlib/Analysis/BoxIntegral/Basic.lean @@ -747,12 +747,8 @@ theorem integrable_of_continuousOn [CompleteSpace E] {I : Box ι} {f : ℝⁿ (hc : ContinuousOn f (Box.Icc I)) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] : Integrable.{u, v, v} I l f μ.toBoxAdditive.toSMul := by apply integrable_of_bounded_and_ae_continuousWithinAt - · obtain ⟨C, hC⟩ := (NormedSpace.isBounded_iff_subset_smul_closedBall ℝ).1 - (I.isCompact_Icc.image_of_continuousOn hc).isBounded - use ‖C‖, fun x hx ↦ by - simpa only [smul_unitClosedBall, mem_closedBall_zero_iff] using hC (Set.mem_image_of_mem f hx) - · refine eventually_of_mem ?_ (fun x hx ↦ hc.continuousWithinAt hx) - rw [mem_ae_iff, μ.restrict_apply] <;> simp [MeasurableSet.compl_iff.2 I.measurableSet_Icc] + · exact I.isCompact_Icc.exists_bound_of_continuousOn hc + · exact ae_restrict_of_forall_mem I.measurableSet_Icc fun x hx ↦ hc.continuousWithinAt hx variable {l} From fd887328e56f520dfd005cbe712777a84edc38fb Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 08:31:31 +0800 Subject: [PATCH 04/29] golf2: refactor Mathlib/Analysis/Complex/TaylorSeries.lean --- Mathlib/Analysis/Complex/Spectrum.lean | 6 +-- Mathlib/Analysis/Complex/Trigonometric.lean | 16 ++----- .../LogCounting/Asymptotic.lean | 42 ++++--------------- Mathlib/Analysis/Convex/Between.lean | 42 ++++--------------- Mathlib/Analysis/Convex/BetweenList.lean | 19 +++------ Mathlib/Analysis/Convex/Cone/Extension.lean | 8 +--- 6 files changed, 28 insertions(+), 105 deletions(-) diff --git a/Mathlib/Analysis/Complex/Spectrum.lean b/Mathlib/Analysis/Complex/Spectrum.lean index 168d635d3eb05a..8abea04b731c9b 100644 --- a/Mathlib/Analysis/Complex/Spectrum.lean +++ b/Mathlib/Analysis/Complex/Spectrum.lean @@ -17,13 +17,9 @@ public section namespace SpectrumRestricts variable {A : Type*} [Ring A] -set_option backward.isDefEq.respectTransparency false in lemma real_iff [Algebra ℂ A] {a : A} : SpectrumRestricts a Complex.reCLM ↔ ∀ x ∈ spectrum ℂ a, x = x.re := by - refine ⟨fun h x hx ↦ ?_, fun h ↦ ?_⟩ - · obtain ⟨x, -, rfl⟩ := h.algebraMap_image.symm ▸ hx - simp - · exact .of_subset_range_algebraMap Complex.ofReal_re fun x hx ↦ ⟨x.re, (h x hx).symm⟩ + simp [spectrumRestricts_iff, Set.LeftInvOn, Function.LeftInverse, eq_comm] end SpectrumRestricts diff --git a/Mathlib/Analysis/Complex/Trigonometric.lean b/Mathlib/Analysis/Complex/Trigonometric.lean index 9d95e54fc24346..f9def655cd0131 100644 --- a/Mathlib/Analysis/Complex/Trigonometric.lean +++ b/Mathlib/Analysis/Complex/Trigonometric.lean @@ -501,20 +501,12 @@ theorem tan_sq_div_one_add_tan_sq {x : ℂ} (hx : cos x ≠ 0) : simp only [← tan_mul_cos hx, mul_pow, ← inv_one_add_tan_sq hx, div_eq_mul_inv] theorem cos_three_mul : cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x := by - have h1 : x + 2 * x = 3 * x := by ring - rw [← h1, cos_add x (2 * x)] - simp only [cos_two_mul, sin_two_mul, mul_sub, mul_one, sq] - have h2 : 4 * cos x ^ 3 = 2 * cos x * cos x * cos x + 2 * cos x * cos x ^ 2 := by ring - rw [h2, cos_sq'] - ring + rw [← cosh_mul_I, show (3 * x) * I = 3 * (x * I) by ring, cosh_three_mul, cosh_mul_I] theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by - have h1 : x + 2 * x = 3 * x := by ring - rw [← h1, sin_add x (2 * x)] - simp only [cos_two_mul, sin_two_mul, cos_sq'] - have h2 : cos x * (2 * sin x * cos x) = 2 * sin x * cos x ^ 2 := by ring - rw [h2, cos_sq'] - ring + rw [← mul_left_inj' I_ne_zero, ← sinh_mul_I, show (3 * x) * I = 3 * (x * I) by ring, + sinh_three_mul, sinh_mul_I] + grind [I_sq] theorem exp_mul_I : exp (x * I) = cos x + sin x * I := (cos_add_sin_I _).symm diff --git a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean index 2323bd2ca1b3a5..26d186a187df70 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Asymptotic.lean @@ -46,28 +46,13 @@ is little o of the logarithmic counting function attached to `single e`. -/ lemma one_isLittleO_logCounting_single [DecidableEq E] [ProperSpace E] {e : E} : (1 : ℝ → ℝ) =o[atTop] logCounting (single e 1) := by - rw [isLittleO_iff] - intro c hc - simp only [Pi.one_apply, norm_eq_abs, eventually_atTop, abs_one] - use exp (|log ‖e‖| + c⁻¹) - intro b hb - have h₁b : 1 ≤ b := by - calc 1 - _ ≤ exp (|log ‖e‖| + c⁻¹) := one_le_exp (by positivity) - _ ≤ b := hb - have h₁c : ‖e‖ ≤ exp (|log ‖e‖| + c⁻¹) := by - calc ‖e‖ - _ ≤ exp (log ‖e‖) := le_exp_log ‖e‖ - _ ≤ exp (|log ‖e‖| + c⁻¹) := - exp_monotone (le_add_of_le_of_nonneg (le_abs_self _) (inv_pos.2 hc).le) - rw [← inv_mul_le_iff₀ hc, mul_one, abs_of_nonneg (logCounting_nonneg - (single_pos.2 Int.one_pos).le h₁b)] - calc c⁻¹ - _ ≤ logCounting (single e 1) (exp (|log ‖e‖| + c⁻¹)) := by - simp [logCounting_single_eq_log_sub_const h₁c, le_sub_iff_add_le', le_abs_self (log ‖e‖)] - _ ≤ logCounting (single e 1) b := by - apply logCounting_mono (single_pos.2 Int.one_pos).le (mem_Ioi.2 (exp_pos _)) _ hb - simpa [mem_Ioi] using one_pos.trans_le h₁b + have hΘ : (fun r : ℝ ↦ log r - log ‖e‖) =Θ[atTop] log := + (IsEquivalent.refl.sub_isLittleO (Real.isLittleO_const_log_atTop (c := log ‖e‖))).isTheta + have h₁ : (1 : ℝ → ℝ) =o[atTop] fun r : ℝ ↦ log r - log ‖e‖ := + (hΘ.isLittleO_congr_right).2 Real.isLittleO_const_log_atTop + refine h₁.congr' EventuallyEq.rfl ?_ + filter_upwards [eventually_ge_atTop ‖e‖] with r hr + simp [logCounting_single_eq_log_sub_const hr] /-- A non-negative function with locally finite support is zero if and only if its logarithmic counting @@ -124,16 +109,7 @@ theorem logCounting_isBigO_one_iff_analyticOnNhd {f : 𝕜 → E} (h : Meromorph logCounting f ⊤ =O[atTop] (1 : ℝ → ℝ) ↔ AnalyticOnNhd 𝕜 (toMeromorphicNFOn f univ) univ := by simp only [logCounting, reduceDIte] rw [← Function.locallyFinsuppWithin.zero_iff_logCounting_bounded (negPart_nonneg _)] - constructor - · intro h₁f z hz - apply (meromorphicNFOn_toMeromorphicNFOn f univ - trivial).meromorphicOrderAt_nonneg_iff_analyticAt.1 - rw [meromorphicOrderAt_toMeromorphicNFOn h.meromorphicOn (by trivial), ← WithTop.untop₀_nonneg, - ← h.meromorphicOn.divisor_apply (by trivial), ← negPart_eq_zero, - ← locallyFinsuppWithin.negPart_apply] - aesop - · intro h₁f - rwa [negPart_eq_zero, ← h.meromorphicOn.divisor_of_toMeromorphicNFOn, - (meromorphicNFOn_toMeromorphicNFOn _ _).divisor_nonneg_iff_analyticOnNhd] + rw [negPart_eq_zero, ← h.meromorphicOn.divisor_of_toMeromorphicNFOn, + (meromorphicNFOn_toMeromorphicNFOn _ _).divisor_nonneg_iff_analyticOnNhd] end ValueDistribution diff --git a/Mathlib/Analysis/Convex/Between.lean b/Mathlib/Analysis/Convex/Between.lean index 957e9d0ca4125b..e733880d9aa168 100644 --- a/Mathlib/Analysis/Convex/Between.lean +++ b/Mathlib/Analysis/Convex/Between.lean @@ -732,13 +732,8 @@ variable [CommRing R] [PartialOrder R] [IsStrictOrderedRing R] variable {R} theorem Wbtw.sameRay_vsub {x y z : P} (h : Wbtw R x y z) : SameRay R (y -ᵥ x) (z -ᵥ y) := by - rcases h with ⟨t, ⟨ht0, ht1⟩, rfl⟩ - simp_rw [lineMap_apply] - rcases ht0.lt_or_eq with (ht0' | rfl); swap; · simp - rcases ht1.lt_or_eq with (ht1' | rfl); swap; · simp - refine Or.inr (Or.inr ⟨1 - t, t, sub_pos.2 ht1', ht0', ?_⟩) - simp only [vadd_vsub, smul_smul, vsub_vadd_eq_vsub_sub, smul_sub, ← sub_smul] - ring_nf + have h' := sameRay_of_mem_segment ((mem_segment_iff_wbtw).2 (by simpa using h.vsub_const x)) + simpa [sub_zero, vsub_sub_vsub_cancel_right] using h' theorem Wbtw.sameRay_vsub_left {x y z : P} (h : Wbtw R x y z) : SameRay R (y -ᵥ x) (z -ᵥ x) := by rcases h with ⟨t, ⟨ht0, _⟩, rfl⟩ @@ -1041,17 +1036,9 @@ theorem Sbtw.trans_expand_right {w x y z : P} (h₁ : Sbtw R w x y) (h₂ : Sbtw omit [IsStrictOrderedRing R] in theorem Wbtw.collinear {x y z : P} (h : Wbtw R x y z) : Collinear R ({x, y, z} : Set P) := by - rw [collinear_iff_exists_forall_eq_smul_vadd] - refine ⟨x, z -ᵥ x, ?_⟩ - intro p hp - simp_rw [Set.mem_insert_iff, Set.mem_singleton_iff] at hp - rcases hp with (rfl | rfl | rfl) - · refine ⟨0, ?_⟩ - simp - · rcases h with ⟨t, -, rfl⟩ - exact ⟨t, rfl⟩ - · refine ⟨1, ?_⟩ - simp + simpa [Set.insert_comm] using + (collinear_insert_of_mem_affineSpan_pair (k := R) h.mem_affineSpan : + Collinear R ({y, x, z} : Set P)) theorem Collinear.wbtw_or_wbtw_or_wbtw {x y z : P} (h : Collinear R ({x, y, z} : Set P)) : Wbtw R x y z ∨ Wbtw R y z x ∨ Wbtw R z x y := by @@ -1078,23 +1065,8 @@ theorem Collinear.wbtw_or_wbtw_or_wbtw {x y z : P} (h : Collinear R ({x, y, z} : exact Or.inl (wbtw_or_wbtw_smul_vadd_of_nonneg _ _ hy0.le hz0.le) theorem wbtw_iff_sameRay_vsub {x y z : P} : Wbtw R x y z ↔ SameRay R (y -ᵥ x) (z -ᵥ y) := by - refine ⟨Wbtw.sameRay_vsub, fun h => ?_⟩ - rcases h with (h | h | ⟨r₁, r₂, hr₁, hr₂, h⟩) - · rw [vsub_eq_zero_iff_eq] at h - simp [h] - · rw [vsub_eq_zero_iff_eq] at h - simp [h] - · refine - ⟨r₂ / (r₁ + r₂), - ⟨div_nonneg hr₂.le (add_nonneg hr₁.le hr₂.le), - div_le_one_of_le₀ (le_add_of_nonneg_left hr₁.le) (add_nonneg hr₁.le hr₂.le)⟩, - ?_⟩ - have h' : z = r₂⁻¹ • r₁ • (y -ᵥ x) +ᵥ y := by simp [h, hr₂.ne'] - rw [eq_comm] - simp only [lineMap_apply, h', vadd_vsub_assoc, smul_smul, ← add_smul, eq_vadd_iff_vsub_eq, - smul_add] - convert (one_smul R (y -ᵥ x)).symm - field + rw [← wbtw_vsub_const_iff (R := R) (p := x), ← mem_segment_iff_wbtw, mem_segment_iff_sameRay] + simp [vsub_sub_vsub_cancel_right] lemma wbtw_total_of_sameRay_vsub_left {x y z : P} (h : SameRay R (y -ᵥ x) (z -ᵥ x)) : Wbtw R x y z ∨ Wbtw R x z y := by diff --git a/Mathlib/Analysis/Convex/BetweenList.lean b/Mathlib/Analysis/Convex/BetweenList.lean index 9d0b88cf71fa88..0bbf63542a44bd 100644 --- a/Mathlib/Analysis/Convex/BetweenList.lean +++ b/Mathlib/Analysis/Convex/BetweenList.lean @@ -180,20 +180,11 @@ variable [Field R] [LinearOrder R] [IsStrictOrderedRing R] variable {R} lemma SortedLE.wbtw {l : List R} (h : l.SortedLE) : l.Wbtw R := by - induction l with - | nil => simp - | cons head tail ih => - rw [wbtw_cons] - refine ⟨?_, ih h.pairwise.of_cons.sortedLE⟩ - clear ih - induction tail with - | nil => simp - | cons head' tail' ih => - rw [pairwise_cons] - refine ⟨?_, ih (h.pairwise.sublist ?_).sortedLE⟩ - · simp_rw [sortedLE_iff_pairwise, pairwise_cons_cons, pairwise_cons] at h - exact fun a ha ↦ .of_le_of_le h.1 (h.2.2.1 a ha) - · simp + rw [List.Wbtw, List.triplewise_iff_getElem] + intro i j k hij hjk hk + have hik : i < l.length := Nat.lt_trans hij (Nat.lt_trans hjk hk) + have hjl : j < l.length := Nat.lt_trans hjk hk + exact Wbtw.of_le_of_le (h.getElem_le_getElem_of_le hij.le) (h.getElem_le_getElem_of_le hjk.le) @[deprecated (since := "2025-10-13")] alias Sorted.wbtw := SortedLE.wbtw diff --git a/Mathlib/Analysis/Convex/Cone/Extension.lean b/Mathlib/Analysis/Convex/Cone/Extension.lean index b26c35dd1e1c7d..c08177d04743b2 100644 --- a/Mathlib/Analysis/Convex/Cone/Extension.lean +++ b/Mathlib/Analysis/Convex/Cone/Extension.lean @@ -121,12 +121,8 @@ theorem exists_top (p : E →ₗ.[ℝ] ℝ) (hp_nonneg : ∀ x : p.domain, (x : have hcd : DirectedOn (· ≤ ·) c := c_chain.directedOn refine ⟨LinearPMap.sSup c hcd, ?_, fun _ ↦ LinearPMap.le_sSup hcd⟩ rintro ⟨x, hx⟩ hxs - have hdir : DirectedOn (· ≤ ·) (LinearPMap.domain '' c) := - directedOn_image.2 (hcd.mono LinearPMap.domain_mono.monotone) - rcases (mem_sSup_of_directed (cne.image _) hdir).1 hx with ⟨_, ⟨f, hfc, rfl⟩, hfx⟩ - have : f ≤ LinearPMap.sSup c hcd := LinearPMap.le_sSup _ hfc - convert ← hcs hfc ⟨x, hfx⟩ hxs using 1 - exact this.2 rfl + obtain ⟨f, hfc, hfx⟩ := (LinearPMap.mem_domain_sSup_iff cne hcd).1 hx + simpa [LinearPMap.sSup_apply hcd hfc ⟨x, hfx⟩] using hcs hfc ⟨x, hfx⟩ hxs obtain ⟨q, hpq, hqs, hq⟩ := zorn_le_nonempty₀ S hSc p hp_nonneg refine ⟨q, hpq, ?_, hqs⟩ contrapose! hq From b9708ca7fd342719bec0b1f0fe765e8a2a4a77d4 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 08:55:21 +0800 Subject: [PATCH 05/29] golf --- .../Complex/UpperHalfPlane/MoebiusAction.lean | 18 ++---- .../CharacteristicFunction.lean | 52 +++++++-------- .../ValueDistribution/LogCounting/Basic.lean | 10 +-- .../ValueDistribution/Proximity/Basic.lean | 64 ++++++++----------- Mathlib/Analysis/ConstantSpeed.lean | 33 ++++------ Mathlib/Analysis/Convex/Approximation.lean | 20 ++---- Mathlib/Analysis/Convex/Basic.lean | 39 ++++------- Mathlib/Analysis/Convex/Birkhoff.lean | 13 ++-- Mathlib/Analysis/Convex/Body.lean | 21 +++--- Mathlib/Analysis/Convex/Continuous.lean | 26 ++++---- 10 files changed, 114 insertions(+), 182 deletions(-) diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean index 27f56b30eac648..b91b2caebf9309 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/MoebiusAction.lean @@ -119,13 +119,9 @@ lemma σ_im_ne_zero {g z} : (σ g z).im ≠ 0 ↔ z.im ≠ 0 := by split_ifs <;> simp lemma σ_mul (g g' : GL (Fin 2) ℝ) (z : ℂ) : σ (g * g') z = σ g (σ g' z) := by - simp only [σ, map_mul, Units.val_mul] - rcases g.det_ne_zero.lt_or_gt with (h | h) <;> - rcases g'.det_ne_zero.lt_or_gt with (h' | h') - · simp [mul_pos_of_neg_of_neg h h', h.not_gt, h'.not_gt] - · simp [(mul_neg_of_neg_of_pos h h').not_gt, h.not_gt, h'] - · simp [(mul_neg_of_pos_of_neg h h').not_gt, h, h'.not_gt] - · simp [mul_pos h h', h, h'] + simp only [σ, map_mul, Units.val_mul, mul_pos_iff] + rcases g.det_ne_zero.lt_or_gt with h | h <;> rcases g'.det_ne_zero.lt_or_gt with h' | h' <;> + simp [h, h', h.not_gt, h'.not_gt] lemma σ_mul_comm (g h : GL (Fin 2) ℝ) (z : ℂ) : σ g (σ h z) = σ h (σ g z) := by simp only [σ] @@ -154,13 +150,7 @@ def smulAux (g : GL (Fin 2) ℝ) (z : ℍ) : ℍ := lemma denom_cocycle' (g h : GL (Fin 2) ℝ) (z : ℍ) : denom (g * h) z = σ h (denom g (smulAux h z)) * denom h z := by - simp only [smulAux, smulAux', coe_mk, map_div₀, σ_num, σ_denom, σ_sq] - change _ = (_ * (_ / _) + _) * _ - field_simp [denom_ne_zero h z] - simp only [denom, Units.val_mul, mul_apply, Fin.sum_univ_succ, Finset.univ_unique, - Fin.default_eq_zero, Finset.sum_singleton, Fin.succ_zero_eq_one, Complex.ofReal_add, - Complex.ofReal_mul, num] - ring + simpa [smulAux, smulAux', denom, σ_sq] using denom_cocycle g h z.im_ne_zero theorem mul_smul' (g h : GL (Fin 2) ℝ) (z : ℍ) : smulAux (g * h) z = smulAux g (smulAux h z) := by diff --git a/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean b/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean index 0d572c9cf9cba0..17f877b91f8cd2 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean @@ -97,36 +97,6 @@ theorem characteristic_eventually_nonneg : ## Behaviour under Arithmetic Operations -/ -/-- -For `1 ≤ r`, the characteristic function of `f + g` at `⊤` is less than or equal to the sum of the -characteristic functions of `f` and `g`, respectively, plus `log 2` (where `2` is the number of -summands). --/ -theorem characteristic_add_top_le {f₁ f₂ : ℂ → E} {r : ℝ} (h₁f₁ : Meromorphic f₁) - (h₁f₂ : Meromorphic f₂) (hr : 1 ≤ r) : - characteristic (f₁ + f₂) ⊤ r ≤ characteristic f₁ ⊤ r + characteristic f₂ ⊤ r + log 2 := by - simp only [characteristic] - calc proximity (f₁ + f₂) ⊤ r + logCounting (f₁ + f₂) ⊤ r - _ ≤ (proximity f₁ ⊤ r + proximity f₂ ⊤ r + log 2) - + (logCounting f₁ ⊤ r + logCounting f₂ ⊤ r) := by - gcongr - · apply proximity_add_top_le h₁f₁ h₁f₂ - · exact logCounting_add_top_le h₁f₁ h₁f₂ hr - _ = proximity f₁ ⊤ r + logCounting f₁ ⊤ r + (proximity f₂ ⊤ r + logCounting f₂ ⊤ r) - + log 2 := by - ring - -/-- -Asymptotically, the characteristic function of `f + g` at `⊤` is less than or equal to the sum of -the characteristic functions of `f` and `g`, respectively. --/ -theorem characteristic_add_top_eventuallyLE {f₁ f₂ : ℂ → E} (h₁f₁ : Meromorphic f₁) - (h₁f₂ : Meromorphic f₂) : - characteristic (f₁ + f₂) ⊤ - ≤ᶠ[Filter.atTop] characteristic f₁ ⊤ + characteristic f₂ ⊤ + fun _ ↦ log 2 := by - filter_upwards [Filter.eventually_ge_atTop 1] with r hr - using characteristic_add_top_le h₁f₁ h₁f₂ hr - /-- For `1 ≤ r`, the characteristic function of a sum `∑ a, f a` at `⊤` is less than or equal to the sum of the characteristic functions of `f ·`, plus `log s.card`. @@ -156,6 +126,28 @@ theorem characteristic_sum_top_eventuallyLE {α : Type*} (s : Finset α) (f : α filter_upwards [Filter.eventually_ge_atTop 1] using fun _ hr ↦ characteristic_sum_top_le s f hf hr +/-- +For `1 ≤ r`, the characteristic function of `f + g` at `⊤` is less than or equal to the sum of the +characteristic functions of `f` and `g`, respectively, plus `log 2` (where `2` is the number of +summands). +-/ +theorem characteristic_add_top_le {f₁ f₂ : ℂ → E} {r : ℝ} (h₁f₁ : Meromorphic f₁) + (h₁f₂ : Meromorphic f₂) (hr : 1 ≤ r) : + characteristic (f₁ + f₂) ⊤ r ≤ characteristic f₁ ⊤ r + characteristic f₂ ⊤ r + log 2 := by + simpa using characteristic_sum_top_le (s := Finset.univ) (f := ![f₁, f₂]) + (by simpa using ⟨h₁f₁, h₁f₂⟩) hr + +/-- +Asymptotically, the characteristic function of `f + g` at `⊤` is less than or equal to the sum of +the characteristic functions of `f` and `g`, respectively. +-/ +theorem characteristic_add_top_eventuallyLE {f₁ f₂ : ℂ → E} (h₁f₁ : Meromorphic f₁) + (h₁f₂ : Meromorphic f₂) : + characteristic (f₁ + f₂) ⊤ + ≤ᶠ[Filter.atTop] characteristic f₁ ⊤ + characteristic f₂ ⊤ + fun _ ↦ log 2 := by + filter_upwards [Filter.eventually_ge_atTop 1] with r hr + using characteristic_add_top_le h₁f₁ h₁f₂ hr + /-- For `1 ≤ r`, the characteristic function for the zeros of `f * g` is less than or equal to the sum of the characteristic functions for the zeros of `f` and `g`, respectively. diff --git a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean index 046f13fb0925fa..af43e219f0e555 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/LogCounting/Basic.lean @@ -589,13 +589,9 @@ theorem Function.locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_c {f : ℂ → ℂ} (h : Meromorphic f) (hR : R ≠ 0) : logCounting (divisor f ⊤) R = circleAverage (log ‖f ·‖) 0 R - log ‖meromorphicTrailingCoeffAt f 0‖ := by - have h₁f : MeromorphicOn f (closedBall 0 |R|) := by tauto - simp only [MeromorphicOn.circleAverage_log_norm hR h₁f, logCounting, top_eq_univ, - AddMonoidHom.coe_mk, ZeroHom.coe_mk, zero_sub, norm_neg, add_sub_cancel_right] - congr 1 - · simp_all - · rw [divisor_apply, divisor_apply] - all_goals aesop + rw [eq_sub_iff_add_eq] + simpa [logCounting, top_eq_univ, locallyFinsuppWithin.toClosedBall_divisor h] using + (MeromorphicOn.circleAverage_log_norm hR (by tauto : MeromorphicOn f (closedBall 0 |R|))).symm /-- Variant of `locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_const`, using diff --git a/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean b/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean index dbaf8e2d7296ba..0eabb757c80725 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean @@ -163,26 +163,22 @@ proximity functions of the summand, plus `log` of the number of summands. theorem proximity_sum_top_le [NormedSpace ℂ E] {α : Type*} (s : Finset α) (f : α → ℂ → E) (hf : ∀ a ∈ s, Meromorphic (f a)) : proximity (∑ a ∈ s, f a) ⊤ ≤ ∑ a ∈ s, (proximity (f a) ⊤) + (fun _ ↦ log s.card) := by - simp only [proximity_top, Finset.sum_apply] intro r + simp [proximity_top] have h₂f : ∀ i ∈ s, CircleIntegrable (log⁺ ‖f i ·‖) 0 r := fun i hi ↦ MeromorphicOn.circleIntegrable_posLog_norm (fun x hx ↦ hf i hi x) - simp only [Pi.add_apply, Finset.sum_apply] - calc circleAverage (log⁺ ‖∑ c ∈ s, f c ·‖) 0 r - _ ≤ circleAverage (∑ c ∈ s, log⁺ ‖f c ·‖ + log s.card) 0 r := by - apply circleAverage_mono - · apply (Meromorphic.fun_sum hf).meromorphicOn.circleIntegrable_posLog_norm - · apply (CircleIntegrable.fun_sum s h₂f).add (circleIntegrable_const _ _ _) - · intro x hx - rw [add_comm] - apply posLog_norm_sum_le - _ = ∑ c ∈ s, circleAverage (log⁺ ‖f c ·‖) 0 r + log s.card := by - nth_rw 2 [← circleAverage_const (log s.card) 0 r] - rw [← circleAverage_sum h₂f, ← circleAverage_add (CircleIntegrable.sum s h₂f) - (circleIntegrable_const (log s.card) 0 r)] - congr 1 - ext x - simp + calc + circleAverage (log⁺ ‖∑ c ∈ s, f c ·‖) 0 r + ≤ circleAverage ((fun x ↦ ∑ c ∈ s, log⁺ ‖f c x‖) + fun _ ↦ log s.card) 0 r := by + apply circleAverage_mono + · apply (Meromorphic.fun_sum hf).meromorphicOn.circleIntegrable_posLog_norm + · exact (CircleIntegrable.fun_sum s h₂f).add (circleIntegrable_const _ _ _) + · intro x hx; simpa [add_comm] using (posLog_norm_sum_le s (fun c ↦ f c x)) + _ = (∑ c ∈ s, circleAverage (log⁺ ‖f c ·‖) 0 r) + log s.card := by + change circleAverage (fun z ↦ (∑ c ∈ s, log⁺ ‖f c z‖) + log s.card) 0 r = _ + rw [circleAverage_fun_add (CircleIntegrable.fun_sum s h₂f) + (circleIntegrable_const (log s.card) 0 r), circleAverage_const] + simpa using (circleAverage_fun_sum (c := 0) (R := r) (f := fun c x ↦ log⁺ ‖f c x‖) (h := h₂f)) /-- The proximity function of `f + g` at `⊤` is less than or equal to the sum of the proximity functions @@ -200,25 +196,21 @@ The proximity function `f * g` at `⊤` is less than or equal to the sum of the -/ theorem proximity_mul_top_le {f₁ f₂ : ℂ → ℂ} (h₁f₁ : Meromorphic f₁) (h₁f₂ : Meromorphic f₂) : proximity (f₁ * f₂) ⊤ ≤ proximity f₁ ⊤ + proximity f₂ ⊤ := by - calc proximity (f₁ * f₂) ⊤ - _ = circleAverage (fun x ↦ log⁺ (‖f₁ x‖ * ‖f₂ x‖)) 0 := by - simp [proximity] - _ ≤ circleAverage (fun x ↦ log⁺ ‖f₁ x‖ + log⁺ ‖f₂ x‖) 0 := by - intro r - apply circleAverage_mono - · simp_rw [← norm_mul] - apply MeromorphicOn.circleIntegrable_posLog_norm - apply Meromorphic.meromorphicOn - fun_prop - · apply (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x)).add - (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x)) - · exact fun _ _ ↦ posLog_mul - _ = circleAverage (log⁺ ‖f₁ ·‖) 0 + circleAverage (log⁺ ‖f₂ ·‖) 0 := by - ext r - apply circleAverage_add - · exact MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x) - · exact MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x) - _ = proximity f₁ ⊤ + proximity f₂ ⊤ := by simp [proximity] + intro r + simp [proximity_top] + calc + circleAverage (fun x ↦ log⁺ (‖f₁ x‖ * ‖f₂ x‖)) 0 r + ≤ circleAverage (fun x ↦ log⁺ ‖f₁ x‖ + log⁺ ‖f₂ x‖) 0 r := by + apply circleAverage_mono + · simpa [norm_mul] using + ((h₁f₁.mul h₁f₂).meromorphicOn.circleIntegrable_posLog_norm (c := 0) (R := r)) + · exact (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x)).add + (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x)) + · intro x hx + exact posLog_mul + _ = circleAverage (log⁺ ‖f₁ ·‖) 0 r + circleAverage (log⁺ ‖f₂ ·‖) 0 r := by + exact circleAverage_add (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x)) + (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x)) @[deprecated (since := "2025-12-11")] alias proximity_top_mul_le := proximity_mul_top_le diff --git a/Mathlib/Analysis/ConstantSpeed.lean b/Mathlib/Analysis/ConstantSpeed.lean index d7ab627aaaba27..3c196e44047805 100644 --- a/Mathlib/Analysis/ConstantSpeed.lean +++ b/Mathlib/Analysis/ConstantSpeed.lean @@ -151,19 +151,16 @@ theorem HasConstantSpeedOnWith.Icc_Icc {x y z : ℝ} (hfs : HasConstantSpeedOnWi theorem hasConstantSpeedOnWith_zero_iff : HasConstantSpeedOnWith f s 0 ↔ ∀ᵉ (x ∈ s) (y ∈ s), edist (f x) (f y) = 0 := by - dsimp [HasConstantSpeedOnWith] - simp only [zero_mul, ENNReal.ofReal_zero, ← eVariationOn.eq_zero_iff] + rw [hasConstantSpeedOnWith_iff_variationOnFromTo_eq] constructor - · by_contra! ⟨h, hfs⟩ - simp_rw [ne_eq, eVariationOn.eq_zero_iff] at hfs h - push Not at hfs - obtain ⟨x, xs, y, ys, hxy⟩ := hfs - rcases le_total x y with (xy | yx) - · exact hxy (h xs ys x ⟨xs, le_rfl, xy⟩ y ⟨ys, xy, le_rfl⟩) - · rw [edist_comm] at hxy - exact hxy (h ys xs y ⟨ys, le_rfl, yx⟩ x ⟨xs, yx, le_rfl⟩) - · rintro h x _ y _ - simpa [h] using eVariationOn.mono (s := s) f inter_subset_left + · rintro ⟨hf, h0⟩ x xs y ys + simpa using variationOnFromTo.edist_zero_of_eq_zero hf xs ys (by simpa using h0 xs ys) + · intro h + have hf : LocallyBoundedVariationOn f s := fun x y xs ys ↦ + ((eVariationOn.eq_zero_iff f).2 fun a ha b hb ↦ h a ha.1 b hb.1).trans_lt + ENNReal.zero_lt_top |>.ne + exact ⟨hf, fun x xs y ys ↦ by + simpa using (variationOnFromTo.eq_zero_iff hf xs ys).2 fun a ha b hb ↦ h a ha.1 b hb.1⟩ theorem HasConstantSpeedOnWith.ratio {l' : ℝ≥0} (hl' : l' ≠ 0) {φ : ℝ → ℝ} (φm : MonotoneOn φ s) (hfφ : HasConstantSpeedOnWith (f ∘ φ) s l) (hf : HasConstantSpeedOnWith f (φ '' s) l') ⦃x : ℝ⦄ @@ -212,14 +209,10 @@ theorem unique_unit_speed_on_Icc_zero {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) EqOn φ id (Icc 0 s) := by rw [← φst] at hf convert unique_unit_speed φm hfφ hf ⟨le_rfl, hs⟩ using 1 - have : φ 0 = 0 := by - have hm : 0 ∈ φ '' Icc 0 s := by simp only [φst, ht, mem_Icc, le_refl, and_self] - obtain ⟨x, xs, hx⟩ := hm - apply le_antisymm ((φm ⟨le_rfl, hs⟩ xs xs.1).trans_eq hx) _ - have := φst ▸ mapsTo_image φ (Icc 0 s) - exact (mem_Icc.mp (@this 0 (by rw [mem_Icc]; exact ⟨le_rfl, hs⟩))).1 - simp only [tsub_zero, this, add_zero] - rfl + have hφ0 : φ 0 = 0 := + (φm.map_isLeast (isLeast_Icc hs)).unique <| by + simpa [φst] using (isLeast_Icc ht : IsLeast (Icc 0 t) 0) + exact funext fun y => by simp [hφ0] /-- The natural parameterization of `f` on `s`, which, if `f` has locally bounded variation on `s`, * has unit speed on `s` (by `has_unit_speed_naturalParameterization`). diff --git a/Mathlib/Analysis/Convex/Approximation.lean b/Mathlib/Analysis/Convex/Approximation.lean index cfc8bd5556a13f..4c7fca57290943 100644 --- a/Mathlib/Analysis/Convex/Approximation.lean +++ b/Mathlib/Analysis/Convex/Approximation.lean @@ -220,19 +220,13 @@ theorem univ_sSup_of_nat_affine_eq [HereditarilyLindelofSpace E] (hφc : LowerSemicontinuous φ) (hφcv : ConvexOn ℝ univ φ) : ∃ (l : ℕ → E →L[𝕜] 𝕜) (c : ℕ → ℝ), (∀ i, re ∘ (l i) + const E (c i) ≤ φ) ∧ ⨆ i, re ∘ (l i) + const E (c i) = φ := by - obtain ⟨𝓕', h𝓕'⟩ := hφcv.univ_sSup_of_countable_affine_eq (𝕜 := 𝕜) hφc - by_cases! he : 𝓕'.Nonempty - · obtain ⟨f, hf⟩ := h𝓕'.1.exists_eq_range he - have (i : ℕ) : ∃ (l : E →L[𝕜] 𝕜) (c : ℝ), f i = re ∘ l + const E c := by simp_all - choose l c hlc using this - refine ⟨l, c, fun i => (hlc i) ▸ (h𝓕'.2.2 (f i) (hf ▸ mem_range_self i)).1, ?_⟩ - calc - _ = ⨆ i, f i := by congr with i x; exact congrFun (hlc i).symm x - _ = _ := by rw [← sSup_range, ← hf, h𝓕'.2.1] - · refine ⟨fun _ => 0, fun _ => 0, fun i x => ?_, ?_⟩ - · simp_all [← congrFun h𝓕'.2.1 x] - · ext x - simp_all [← congrFun h𝓕'.2.1 x] + obtain ⟨l, c, hle, hsup⟩ := hφcv.sSup_of_nat_affine_eq (𝕜 := 𝕜) (s := univ) isClosed_univ + (lowerSemicontinuousOn_univ_iff.2 hφc) + refine ⟨l, c, ?_, ?_⟩ + · intro i x + simpa using hle i ⟨x, trivial⟩ + · ext x + simpa using congrFun hsup ⟨x, trivial⟩ end RCLike diff --git a/Mathlib/Analysis/Convex/Basic.lean b/Mathlib/Analysis/Convex/Basic.lean index 98f83341bcb4f5..8d9aa2b8dfc563 100644 --- a/Mathlib/Analysis/Convex/Basic.lean +++ b/Mathlib/Analysis/Convex/Basic.lean @@ -228,15 +228,13 @@ theorem Convex.translate (hs : Convex 𝕜 s) (z : E) : Convex 𝕜 ((fun x => z /-- The translation of a convex set is also convex. -/ theorem Convex.translate_preimage_right (hs : Convex 𝕜 s) (z : E) : - Convex 𝕜 ((fun x => z + x) ⁻¹' s) := by - intro x hx y hy a b ha hb hab - have h := hs hx hy ha hb hab - rwa [smul_add, smul_add, add_add_add_comm, ← add_smul, hab, one_smul] at h + Convex 𝕜 ((fun x => z + x) ⁻¹' s) := + fun x hx => (hs (show z + x ∈ s from hx)).preimage_add_right /-- The translation of a convex set is also convex. -/ theorem Convex.translate_preimage_left (hs : Convex 𝕜 s) (z : E) : - Convex 𝕜 ((fun x => x + z) ⁻¹' s) := by - simpa only [add_comm] using hs.translate_preimage_right z + Convex 𝕜 ((fun x => x + z) ⁻¹' s) := + fun x hx => (hs (show x + z ∈ s from hx)).preimage_add_left section OrderedAddCommMonoid @@ -468,14 +466,12 @@ theorem Convex.sub (hs : Convex 𝕜 s) (ht : Convex 𝕜 t) : Convex 𝕜 (s - variable [AddRightMono 𝕜] theorem Convex.add_smul_mem (hs : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : x + y ∈ s) {t : 𝕜} - (ht : t ∈ Icc (0 : 𝕜) 1) : x + t • y ∈ s := by - have h : x + t • y = (1 - t) • x + t • (x + y) := by match_scalars <;> noncomm_ring - rw [h] - exact hs hx hy (sub_nonneg_of_le ht.2) ht.1 (sub_add_cancel _ _) + (ht : t ∈ Icc (0 : 𝕜) 1) : x + t • y ∈ s := + (hs hx).add_smul_mem hy ht.1 ht.2 theorem Convex.smul_mem_of_zero_mem (hs : Convex 𝕜 s) {x : E} (zero_mem : (0 : E) ∈ s) (hx : x ∈ s) - {t : 𝕜} (ht : t ∈ Icc (0 : 𝕜) 1) : t • x ∈ s := by - simpa using hs.add_smul_mem zero_mem (by simpa using hx) ht + {t : 𝕜} (ht : t ∈ Icc (0 : 𝕜) 1) : t • x ∈ s := + (hs zero_mem).smul_mem hx ht.1 ht.2 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 @@ -486,9 +482,8 @@ theorem Convex.lineMap_mem (h : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : y h.mapsTo_lineMap hx hy ht theorem Convex.add_smul_sub_mem (h : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) {t : 𝕜} - (ht : t ∈ Icc (0 : 𝕜) 1) : x + t • (y - x) ∈ s := by - rw [add_comm] - exact h.lineMap_mem hx hy ht + (ht : t ∈ Icc (0 : 𝕜) 1) : x + t • (y - x) ∈ s := + (h hx).add_smul_sub_mem hy ht.1 ht.2 end AddCommGroup @@ -550,10 +545,8 @@ theorem convex_iff_div : forall₂_congr fun _ _ => starConvex_iff_div theorem Convex.mem_smul_of_zero_mem (h : Convex 𝕜 s) {x : E} (zero_mem : (0 : E) ∈ s) (hx : x ∈ s) - {t : 𝕜} (ht : 1 ≤ t) : x ∈ t • s := by - rw [mem_smul_set_iff_inv_smul_mem₀ (zero_lt_one.trans_le ht).ne'] - exact h.smul_mem_of_zero_mem zero_mem hx - ⟨inv_nonneg.2 (zero_le_one.trans ht), inv_le_one_of_one_le₀ ht⟩ + {t : 𝕜} (ht : 1 ≤ t) : x ∈ t • s := + (h zero_mem).mem_smul hx ht theorem Convex.exists_mem_add_smul_eq (h : Convex 𝕜 s) {x y : E} {p q : 𝕜} (hx : x ∈ s) (hy : y ∈ s) (hp : 0 ≤ p) (hq : 0 ≤ q) : ∃ z ∈ s, (p + q) • z = p • x + q • y := by @@ -584,12 +577,8 @@ section theorem Set.OrdConnected.convex_of_chain [Semiring 𝕜] [PartialOrder 𝕜] [AddCommMonoid E] [PartialOrder E] [IsOrderedAddMonoid E] [Module 𝕜 E] [PosSMulMono 𝕜 E] {s : Set E} - (hs : s.OrdConnected) (h : IsChain (· ≤ ·) s) : Convex 𝕜 s := by - refine convex_iff_segment_subset.mpr fun x hx y hy => ?_ - obtain hxy | hyx := h.total hx hy - · exact (segment_subset_Icc hxy).trans (hs.out hx hy) - · rw [segment_symm] - exact (segment_subset_Icc hyx).trans (hs.out hy hx) + (hs : s.OrdConnected) (h : IsChain (· ≤ ·) s) : Convex 𝕜 s := + fun x hx => hs.starConvex hx fun y hy => show x ≤ y ∨ y ≤ x from h.total hx hy theorem Set.OrdConnected.convex [Semiring 𝕜] [PartialOrder 𝕜] [AddCommMonoid E] [LinearOrder E] [IsOrderedAddMonoid E] [Module 𝕜 E] [PosSMulMono 𝕜 E] {s : Set E} (hs : s.OrdConnected) : diff --git a/Mathlib/Analysis/Convex/Birkhoff.lean b/Mathlib/Analysis/Convex/Birkhoff.lean index 7be75ff975a0dc..2083948fd5b2da 100644 --- a/Mathlib/Analysis/Convex/Birkhoff.lean +++ b/Mathlib/Analysis/Convex/Birkhoff.lean @@ -11,7 +11,6 @@ public import Mathlib.Analysis.Convex.Jensen public import Mathlib.Analysis.Normed.Module.Convex public import Mathlib.Combinatorics.Hall.Basic public import Mathlib.Analysis.Convex.DoublyStochasticMatrix -public import Mathlib.Tactic.Linarith /-! # Birkhoff's theorem @@ -126,15 +125,11 @@ private lemma doublyStochastic_sum_perm_aux (M : Matrix n n R) gcongr rw [ssubset_iff_of_subset (monotone_filter_right _ _)] · simp_rw [mem_filter_univ, not_not, Prod.exists] - refine ⟨i, σ i, hMi'.ne', ?_⟩ - simp [N, Equiv.toPEquiv_apply] + exact ⟨i, σ i, hMi'.ne', by simp [N, Equiv.toPEquiv_apply]⟩ · rintro ⟨i', j'⟩ _ hN' hM' - dsimp at hN' hM' - simp only [sub_apply, hM', smul_apply, PEquiv.toMatrix_apply, Equiv.toPEquiv_apply, - Option.mem_def, Option.some.injEq, smul_eq_mul, mul_ite, mul_one, mul_zero, zero_sub, - neg_eq_zero, ite_eq_right_iff, Classical.not_imp, N] at hN' - obtain ⟨rfl, _⟩ := hN' - linarith [hi' i' (by simp)] + have hσ' : σ i' ≠ j' := by + simpa [Equiv.toPEquiv_apply] using hσ i' j' hM' + exact hN' <| by simp [N, hM', hσ', Equiv.toPEquiv_apply] obtain ⟨w, hw, hw'⟩ := ih _ hd' _ s' hs' this rfl refine ⟨w + fun σ' => if σ' = σ then M i (σ i) else 0, ?_⟩ simp only [Pi.add_apply, add_smul, sum_add_distrib, hw', ite_smul, zero_smul, diff --git a/Mathlib/Analysis/Convex/Body.lean b/Mathlib/Analysis/Convex/Body.lean index cab013db4efe56..bfddd47b9e9065 100644 --- a/Mathlib/Analysis/Convex/Body.lean +++ b/Mathlib/Analysis/Convex/Body.lean @@ -213,19 +213,14 @@ theorem iInter_smul_eq_self [T2Space V] {u : ℕ → ℝ≥0} (K : ConvexBody V) ⋂ n : ℕ, (1 + (u n : ℝ)) • (K : Set V) = K := by ext x refine ⟨fun h => ?_, fun h => ?_⟩ - · obtain ⟨C, hC_pos, hC_bdd⟩ := K.isBounded.exists_pos_norm_le - rw [← K.isClosed.closure_eq, SeminormedAddCommGroup.mem_closure_iff] - rw [← NNReal.tendsto_coe, NormedAddCommGroup.tendsto_atTop] at hu - intro ε hε - obtain ⟨n, hn⟩ := hu (ε / C) (div_pos hε hC_pos) - obtain ⟨y, hyK, rfl⟩ := Set.mem_smul_set.mp (Set.mem_iInter.mp h n) - refine ⟨y, hyK, ?_⟩ - rw [show (1 + u n : ℝ) • y - y = (u n : ℝ) • y by rw [add_smul, one_smul, add_sub_cancel_left], - norm_smul, Real.norm_eq_abs] - specialize hn n le_rfl - rw [lt_div_iff₀' hC_pos, mul_comm, NNReal.coe_zero, sub_zero, Real.norm_eq_abs] at hn - refine lt_of_le_of_lt ?_ hn - exact mul_le_mul_of_nonneg_left (hC_bdd _ hyK) (abs_nonneg _) + · have hu' : Tendsto (fun n ↦ (u n : ℝ)) atTop (𝓝 0) := NNReal.tendsto_coe.2 hu + have hx : ∀ᶠ n in atTop, ((1 + (u n : ℝ))⁻¹ : ℝ) • x ∈ (K : Set V) := by + refine Filter.Eventually.of_forall fun n => ?_ + rw [← Set.mem_smul_set_iff_inv_smul_mem₀ (by positivity : (1 + (u n : ℝ)) ≠ 0) (K : Set V) x] + exact Set.mem_iInter.mp h n + have htx : Tendsto (fun n ↦ ((1 + (u n : ℝ))⁻¹ : ℝ) • x) atTop (𝓝 x) := by + simpa using ((tendsto_const_nhds.add hu').inv₀ (by norm_num : (1 + 0 : ℝ) ≠ 0)).smul_const x + exact K.isClosed.mem_of_tendsto htx hx · refine Set.mem_iInter.mpr (fun n => Convex.mem_smul_of_zero_mem K.convex h_zero h ?_) exact le_add_of_nonneg_right (by positivity) diff --git a/Mathlib/Analysis/Convex/Continuous.lean b/Mathlib/Analysis/Convex/Continuous.lean index 60510a54c5e82e..e09378279c0a53 100644 --- a/Mathlib/Analysis/Convex/Continuous.lean +++ b/Mathlib/Analysis/Convex/Continuous.lean @@ -89,22 +89,18 @@ lemma ConvexOn.isBoundedUnder_abs (hf : ConvexOn ℝ C f) {x₀ : E} (hC : C ∈ (𝓝 x₀).IsBoundedUnder (· ≤ ·) |f| ↔ (𝓝 x₀).IsBoundedUnder (· ≤ ·) f := by refine ⟨fun h ↦ h.mono_le <| .of_forall fun x ↦ le_abs_self _, ?_⟩ rintro ⟨r, hr⟩ - refine ⟨|r| + 2 * |f x₀|, ?_⟩ - have : (𝓝 x₀).Tendsto (fun y => 2 • x₀ - y) (𝓝 x₀) := + have hflip : (𝓝 x₀).Tendsto (fun y => 2 • x₀ - y) (𝓝 x₀) := tendsto_nhds_nhds.2 (⟨·, ·, by simp [two_nsmul, dist_comm]⟩) - simp only [Filter.eventually_map, Pi.abs_apply, abs_le'] at hr ⊢ - filter_upwards [this.eventually_mem hC, hC, hr, this.eventually hr] with y hx hx' hfr hfr' - refine ⟨hfr.trans <| (le_abs_self _).trans <| by simp, ?_⟩ - rw [← sub_le_iff_le_add, neg_sub_comm, sub_le_iff_le_add', ← abs_two, ← abs_mul] - calc - -|2 * f x₀| ≤ 2 * f x₀ := neg_abs_le _ - _ ≤ f y + f (2 • x₀ - y) := by - have := hf.2 hx' hx (by positivity) (by positivity) (add_halves _) - simp only [one_div, ← Nat.cast_smul_eq_nsmul ℝ, Nat.cast_ofNat, smul_sub, ne_eq, - OfNat.ofNat_ne_zero, not_false_eq_true, inv_smul_smul₀, add_sub_cancel, smul_eq_mul] at this - cancel_denoms at this - rwa [← Nat.cast_two, Nat.cast_smul_eq_nsmul] at this - _ ≤ f y + |r| := by gcongr; exact hfr'.trans (le_abs_self _) + have hge : (𝓝 x₀).IsBoundedUnder (· ≥ ·) f := by + refine Filter.isBoundedUnder_of_eventually_ge (a := 2 * f x₀ - |r|) ?_ + filter_upwards [hflip.eventually_mem hC, hC, hr, hflip.eventually hr] with y hy hy' hfy hfy' + have hmid := hf.2 hy' hy (show 0 ≤ (1 / 2 : ℝ) by positivity) + (show 0 ≤ (1 / 2 : ℝ) by positivity) (add_halves (1 : ℝ)) + rw [show (1 / 2 : ℝ) • y + (1 / 2 : ℝ) • (2 • x₀ - y) = x₀ by module] at hmid + simp [smul_eq_mul, one_div] at hmid + nlinarith [hmid, hfy'.trans (le_abs_self r)] + simpa [Pi.abs_def] using + (Filter.isBoundedUnder_le_abs (f := 𝓝 x₀) (u := f)).2 ⟨⟨r, hr⟩, hge⟩ lemma ConcaveOn.isBoundedUnder_abs (hf : ConcaveOn ℝ C f) {x₀ : E} (hC : C ∈ 𝓝 x₀) : (𝓝 x₀).IsBoundedUnder (· ≤ ·) |f| ↔ (𝓝 x₀).IsBoundedUnder (· ≥ ·) f := by From b36b8f3b2ce4a0d3b9566a4c623b954addca742d Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 09:38:02 +0800 Subject: [PATCH 06/29] fix errors --- Mathlib/Analysis/BoundedVariation.lean | 18 ++++++++++++------ .../ValueDistribution/Proximity/Basic.lean | 7 +++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Mathlib/Analysis/BoundedVariation.lean b/Mathlib/Analysis/BoundedVariation.lean index 3b8f7a94d7db69..92d3e5fdec2854 100644 --- a/Mathlib/Analysis/BoundedVariation.lean +++ b/Mathlib/Analysis/BoundedVariation.lean @@ -66,8 +66,11 @@ is differentiable almost everywhere in this set. -/ theorem ae_differentiableWithinAt_of_mem {f : ℝ → V} {s : Set ℝ} (h : LocallyBoundedVariationOn f s) : ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ f s x := by let A := (Module.Basis.ofVectorSpace ℝ V).equivFun.toContinuousLinearEquiv - exact (ae_differentiableWithinAt_of_mem_pi (A.lipschitz.comp_locallyBoundedVariationOn h)).mono - fun _ hx hs ↦ A.comp_differentiableWithinAt_iff.mp (hx hs) + suffices H : ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ (A ∘ f) s x by + filter_upwards [H] with x hx xs + exact (ContinuousLinearEquiv.comp_differentiableWithinAt_iff _).mp (hx xs) + apply ae_differentiableWithinAt_of_mem_pi + exact A.lipschitz.comp_locallyBoundedVariationOn h /-- A real function into a finite-dimensional real vector space with bounded variation on an interval is differentiable almost everywhere in this interval. This one differs from @@ -75,10 +78,13 @@ interval is differentiable almost everywhere in this interval. This one differs `DifferentiableWithinAt` in its conclusion. -/ theorem _root_.BoundedVariationOn.ae_differentiableAt_of_mem_uIcc {f : ℝ → V} {a b : ℝ} (h : BoundedVariationOn f (uIcc a b)) : ∀ᵐ x, x ∈ uIcc a b → DifferentiableAt ℝ f x := by - filter_upwards [h.locallyBoundedVariationOn.ae_differentiableWithinAt_of_mem, - (by simp [ae_iff, measure_singleton] : ∀ᵐ x, x ≠ min a b), - (by simp [ae_iff, measure_singleton] : ∀ᵐ x, x ≠ max a b)] with x hx hxmin hxmax hxmem - exact (hx hxmem).differentiableAt (by grind [uIcc, Icc_mem_nhds_iff]) + have h₁ : ∀ᵐ x, x ≠ min a b := by simp [ae_iff, measure_singleton] + have h₂ : ∀ᵐ x, x ≠ max a b := by simp [ae_iff, measure_singleton] + filter_upwards [h.locallyBoundedVariationOn.ae_differentiableWithinAt_of_mem, h₁, h₂] + with x hx₁ hx₂ hx₃ hx₄ + rw [uIcc, mem_Icc] at hx₄ + exact (hx₁ hx₄).differentiableAt + (Icc_mem_nhds (lt_of_le_of_ne hx₄.left hx₂.symm) (lt_of_le_of_ne hx₄.right hx₃)) /-- A real function into a finite-dimensional real vector space with bounded variation on a set is differentiable almost everywhere in this set. -/ diff --git a/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean b/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean index 0eabb757c80725..938f85cc292a59 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean @@ -164,7 +164,7 @@ theorem proximity_sum_top_le [NormedSpace ℂ E] {α : Type*} (s : Finset α) (f (hf : ∀ a ∈ s, Meromorphic (f a)) : proximity (∑ a ∈ s, f a) ⊤ ≤ ∑ a ∈ s, (proximity (f a) ⊤) + (fun _ ↦ log s.card) := by intro r - simp [proximity_top] + simp only [proximity_top, Finset.sum_apply, Pi.add_apply] have h₂f : ∀ i ∈ s, CircleIntegrable (log⁺ ‖f i ·‖) 0 r := fun i hi ↦ MeromorphicOn.circleIntegrable_posLog_norm (fun x hx ↦ hf i hi x) calc @@ -197,9 +197,8 @@ The proximity function `f * g` at `⊤` is less than or equal to the sum of the theorem proximity_mul_top_le {f₁ f₂ : ℂ → ℂ} (h₁f₁ : Meromorphic f₁) (h₁f₂ : Meromorphic f₂) : proximity (f₁ * f₂) ⊤ ≤ proximity f₁ ⊤ + proximity f₂ ⊤ := by intro r - simp [proximity_top] - calc - circleAverage (fun x ↦ log⁺ (‖f₁ x‖ * ‖f₂ x‖)) 0 r + simp only [proximity_top, Pi.mul_apply, Complex.norm_mul, Pi.add_apply] + calc circleAverage (fun x ↦ log⁺ (‖f₁ x‖ * ‖f₂ x‖)) 0 r ≤ circleAverage (fun x ↦ log⁺ ‖f₁ x‖ + log⁺ ‖f₂ x‖) 0 r := by apply circleAverage_mono · simpa [norm_mul] using From 5a25d459cb107fab61e7650c44df92e22167b5bf Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 10:18:17 +0800 Subject: [PATCH 07/29] Merge branch 'golf_27' --- .../Analysis/BoxIntegral/Partition/Split.lean | 8 ++--- .../Isometric.lean | 12 ++----- .../ContinuousFunctionalCalculus/Order.lean | 32 ++++++------------- .../ContinuousFunctionalCalculus/Range.lean | 22 ++++--------- .../Analysis/CStarAlgebra/Exponential.lean | 15 +++------ .../Analysis/CStarAlgebra/Module/Synonym.lean | 12 +++---- Mathlib/Analysis/CStarAlgebra/Spectrum.lean | 8 ++--- 7 files changed, 30 insertions(+), 79 deletions(-) diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index 64048745bab0a2..dee1534aca942e 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -187,12 +187,8 @@ theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : /-- If `x ∉ (I.lower i, I.upper i)`, then the hyperplane `{y | y i = x}` does not split `I`. -/ theorem split_of_notMem_Ioo (h : x ∉ Ioo (I.lower i) (I.upper i)) : split I i x = ⊤ := by refine ((isPartitionTop I).eq_of_boxes_subset fun J hJ => ?_).symm - rcases mem_top.1 hJ with rfl; clear hJ - rw [mem_boxes, mem_split_iff] - rw [mem_Ioo, not_and_or, not_lt, not_lt] at h - cases h <;> [right; left] - · rwa [eq_comm, Box.splitUpper_eq_self] - · rwa [eq_comm, Box.splitLower_eq_self] + rcases mem_top.1 hJ with rfl + grind [Box.splitUpper_eq_self, Box.splitLower_eq_self, mem_boxes, mem_split_iff, not_lt] theorem coe_eq_of_mem_split_of_mem_le {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J) (h₃ : y i ≤ x) : (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index f95ff5e2884ecd..5fc929c0bfb683 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -458,11 +458,7 @@ lemma IsGreatest.nnnorm_cfc_nnreal [Nontrivial A] (f : ℝ≥0 → ℝ≥0) (a : convert IsGreatest.nnnorm_cfc (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - ext x - constructor - all_goals rintro ⟨x, hx, rfl⟩ - · exact ⟨x, spectrum.algebraMap_mem ℝ hx, by simp⟩ - · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ + simp [Set.image_image, ← ha'.image] lemma apply_le_nnnorm_cfc_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σ ℝ≥0 a) (hf : ContinuousOn f (σ ℝ≥0 a) := by cfc_cont_tac) (ha : 0 ≤ a := by cfc_tac) : @@ -536,11 +532,7 @@ lemma IsGreatest.nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) convert IsGreatest.nnnorm_cfcₙ (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont (by simpa) case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - ext x - constructor - all_goals rintro ⟨x, hx, rfl⟩ - · exact ⟨x, quasispectrum.algebraMap_mem ℝ hx, by simp⟩ - · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ + simp [Set.image_image, ← ha'.image] lemma apply_le_nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σₙ ℝ≥0 a) (hf : ContinuousOn f (σₙ ℝ≥0 a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index d2c1d46f0f2fcd..aa2ab470e02e56 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -292,15 +292,11 @@ lemma CFC.conjugate_rpow_neg_one_half (a : A) (ha : IsStrictlyPositive a := by c invertible. -/ lemma CStarAlgebra.isUnit_of_le (a : A) {b : A} (hab : a ≤ b) (h : IsStrictlyPositive a := by cfc_tac) : IsUnit b := by - have h₀ := h.isUnit - have ha := h.nonneg - rw [← spectrum.zero_notMem_iff ℝ≥0] at h₀ ⊢ - nontriviality A - have hb := (show 0 ≤ a from ha).trans hab - rw [zero_notMem_iff, SpectrumRestricts.nnreal_lt_iff (.nnreal_of_nonneg ‹_›), - NNReal.coe_zero, ← CFC.exists_pos_algebraMap_le_iff (.of_nonneg ‹_›)] at h₀ ⊢ - peel h₀ with r hr _ - exact this.trans hab + nontriviality A; rw [← spectrum.zero_notMem_iff ℝ]; intro h0 + obtain ⟨r, hr, hr_le⟩ := (CFC.exists_pos_algebraMap_le_iff h.isSelfAdjoint).2 fun x hx ↦ + h.spectrum_pos hx + exact not_le_of_gt hr ((algebraMap_le_iff_le_spectrum (a := b) (ha := .of_nonneg + (h.nonneg.trans hab))).1 (hr_le.trans hab) 0 h0) lemma le_iff_norm_sqrt_mul_rpow (a b : A) (ha : 0 ≤ a := by cfc_tac) (hb : IsStrictlyPositive b := by cfc_tac) : @@ -441,23 +437,13 @@ instance instNonnegSpectrumClassComplexNonUnital : NonnegSpectrumClass ℂ A whe lemma norm_le_norm_of_nonneg_of_le {a b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖ ≤ ‖b‖ := by suffices ∀ a b : A⁺¹, 0 ≤ a → a ≤ b → ‖a‖ ≤ ‖b‖ by - have hb := ha.trans hab + have hb : 0 ≤ b := ha.trans hab simpa only [ge_iff_le, Unitization.norm_inr] using - this a b (by simpa) (by rwa [Unitization.inr_le_iff a b]) + this a b (by simpa) (by rwa [Unitization.inr_le_iff a b (.of_nonneg ha) (.of_nonneg hb)]) intro a b ha hab have hb : 0 ≤ b := ha.trans hab - -- these two `have`s are just for performance - have := IsSelfAdjoint.of_nonneg ha; have := IsSelfAdjoint.of_nonneg hb - have h₂ : cfc (id : ℝ → ℝ) a ≤ cfc (fun _ => ‖b‖) a := by - calc _ = a := by rw [cfc_id ℝ a] - _ ≤ cfc id b := (cfc_id ℝ b) ▸ hab - _ ≤ cfc (fun _ => ‖b‖) b := by - refine cfc_mono fun x hx => ?_ - calc x = ‖x‖ := (Real.norm_of_nonneg (spectrum_nonneg_of_nonneg hb hx)).symm - _ ≤ ‖b‖ := spectrum.norm_le_norm_of_mem hx - _ = _ := by rw [cfc_const _ _, cfc_const _ _] - rw [cfc_le_iff id (fun _ => ‖b‖) a] at h₂ - exact h₂ ‖a‖ <| norm_mem_spectrum_of_nonneg ha + exact (CStarAlgebra.norm_le_iff_le_algebraMap a (norm_nonneg _) ha).2 <| + hab.trans <| IsSelfAdjoint.le_algebraMap_norm_self (.of_nonneg hb) theorem nnnorm_le_nnnorm_of_nonneg_of_le {a : A} {b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖₊ ≤ ‖b‖₊ := diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean index d402b443a6ad3f..ecc3522cb35215 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean @@ -136,13 +136,9 @@ lemma range_cfc_nnreal rw [range_cfc_nnreal_eq_image_cfc_real a ha, Set.setOf_and, SetLike.setOf_mem_eq, ← range_cfc _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] rintro _ ⟨f, hf, rfl⟩ - simp only [Set.preimage_setOf_eq, Set.mem_setOf_eq, Set.mem_image] at hf ⊢ - obtain (⟨h₁, h₂⟩ | h | h) := by - simpa only [not_and_or] using em (ContinuousOn f (spectrum ℝ a) ∧ IsSelfAdjoint a) - · refine ⟨f, ?_, rfl⟩ - rwa [cfc_nonneg_iff f a] at hf - · exact ⟨0, by simp, by simp [cfc_apply_of_not_continuousOn a h]⟩ - · exact ⟨0, by simp, by simp [cfc_apply_of_not_predicate a h]⟩ + exact cfc_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' ha' ↦ + ⟨f, (cfc_nonneg_iff f a hf' ha').mp (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), + by simp [cfc_apply f a ha' hf']⟩ end Unital @@ -253,14 +249,8 @@ lemma range_cfcₙ_nnreal [NonUnitalClosedEmbeddingContinuousFunctionalCalculus ← range_cfcₙ _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] refine Set.Subset.antisymm (Set.image_mono (fun _ ↦ cfcₙ_nonneg)) ?_ rintro _ ⟨f, hf, rfl⟩ - simp only [Set.preimage_setOf_eq, Set.mem_setOf_eq, Set.mem_image] at hf ⊢ - obtain (⟨h₁, h₂, h₃⟩ | h | h | h) := by - simpa only [not_and_or] using - em (ContinuousOn f (quasispectrum ℝ a) ∧ f 0 = 0 ∧ IsSelfAdjoint a) - · refine ⟨f, ?_, rfl⟩ - rwa [cfcₙ_nonneg_iff f a] at hf - · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_continuousOn a h]⟩ - · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_map_zero a h]⟩ - · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_predicate a h]⟩ + exact cfcₙ_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' h0 ha' ↦ + ⟨f, (cfcₙ_nonneg_iff f a hf' h0 ha').mp + (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), by simp [cfcₙ_apply f a hf' h0 ha']⟩ end NonUnital diff --git a/Mathlib/Analysis/CStarAlgebra/Exponential.lean b/Mathlib/Analysis/CStarAlgebra/Exponential.lean index 2bef6805c902c6..f5f709d3b023ff 100644 --- a/Mathlib/Analysis/CStarAlgebra/Exponential.lean +++ b/Mathlib/Analysis/CStarAlgebra/Exponential.lean @@ -55,17 +55,12 @@ lemma selfAdjoint.continuous_expUnitary : Continuous (expUnitary : selfAdjoint A theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : expUnitary (a + b) = expUnitary a * expUnitary b := by let +nondep : NormedAlgebra ℚ A := .restrictScalars ℚ ℂ A - ext - have hcomm : Commute (I • (a : A)) (I • (b : A)) := by - unfold Commute SemiconjBy - simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm] - simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm + simpa only [Subtype.ext_iff, expUnitary_coe, AddSubgroup.coe_add, smul_add] using + exp_add_of_commute ((h.smul_left I).smul_right I) theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : - Commute (expUnitary a) (expUnitary b) := - calc - selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = - selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by - rw [← h.expUnitary_add, ← h.symm.expUnitary_add, add_comm] + Commute (expUnitary a) (expUnitary b) := by + simpa only [Commute, SemiconjBy, Subtype.ext_iff, expUnitary_coe] using + ((h.smul_left I).smul_right I).exp end Star diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean index dd10e630df16d7..910af77d7b6fa7 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean @@ -8,7 +8,7 @@ module public import Mathlib.RingTheory.Finiteness.Defs public import Mathlib.Topology.Bornology.Constructions public import Mathlib.Topology.UniformSpace.Equiv -public import Mathlib.Topology.Algebra.Module.Equiv +public import Mathlib.Topology.Algebra.Module.TransferInstance public import Mathlib.Topology.Algebra.IsUniformGroup.Constructions /-! # Type synonym for types with a `CStarModule` structure @@ -162,16 +162,12 @@ end Equiv /-- `WithCStarModule.equiv` as an additive equivalence. -/ def addEquiv [AddCommGroup E] : C⋆ᵐᵒᵈ(A, E) ≃+ E := - { AddEquiv.refl _ with - toFun := equiv _ _ - invFun := (equiv _ _).symm } + Equiv.addEquiv (equiv A E) /-- `WithCStarModule.equiv` as a linear equivalence. -/ -@[simps -fullyApplied] +@[simps! -fullyApplied] def linearEquiv [Semiring R] [AddCommGroup E] [Module R E] : C⋆ᵐᵒᵈ(A, E) ≃ₗ[R] E := - { LinearEquiv.refl _ _ with - toFun := equiv _ _ - invFun := (equiv _ _).symm } + (addEquiv A E).toLinearEquiv fun _ _ ↦ rfl lemma map_top_submodule {R : Type*} [Semiring R] [AddCommGroup E] [Module R E] : (⊤ : Submodule R E).map (linearEquiv R A E).symm.toLinearMap = ⊤ := diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index d716c1e4af8af6..4c143a3ca4ca7a 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -313,12 +313,8 @@ noncomputable instance (priority := 100) Complex.instStarHomClass : StarHomClass rw [← realPart_add_I_smul_imaginaryPart a] simp only [map_add, map_smul, star_add, star_smul, hsa, selfAdjoint.star_val_eq] intro s - have := AlgHom.apply_mem_spectrum φ (s : A) - rw [selfAdjoint.val_re_map_spectrum s] at this - rcases this with ⟨⟨_, _⟩, _, heq⟩ - simp only [Function.comp_apply] at heq - rw [← heq, RCLike.star_def] - exact RCLike.conj_ofReal _ + rw [selfAdjoint.mem_spectrum_eq_re s (AlgHom.apply_mem_spectrum φ (s : A))] + simp /-- This is not an instance to avoid type class inference loops. See `WeakDual.Complex.instStarHomClass`. -/ From 0915ed3b1c13fe5f2220be6acab06f57a9ba69df Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 10:19:19 +0800 Subject: [PATCH 08/29] Revert "Merge branch 'golf_27'" This reverts commit 5a25d459cb107fab61e7650c44df92e22167b5bf. --- .../Analysis/BoxIntegral/Partition/Split.lean | 8 +++-- .../Isometric.lean | 12 +++++-- .../ContinuousFunctionalCalculus/Order.lean | 32 +++++++++++++------ .../ContinuousFunctionalCalculus/Range.lean | 22 +++++++++---- .../Analysis/CStarAlgebra/Exponential.lean | 15 ++++++--- .../Analysis/CStarAlgebra/Module/Synonym.lean | 12 ++++--- Mathlib/Analysis/CStarAlgebra/Spectrum.lean | 8 +++-- 7 files changed, 79 insertions(+), 30 deletions(-) diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index dee1534aca942e..64048745bab0a2 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -187,8 +187,12 @@ theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : /-- If `x ∉ (I.lower i, I.upper i)`, then the hyperplane `{y | y i = x}` does not split `I`. -/ theorem split_of_notMem_Ioo (h : x ∉ Ioo (I.lower i) (I.upper i)) : split I i x = ⊤ := by refine ((isPartitionTop I).eq_of_boxes_subset fun J hJ => ?_).symm - rcases mem_top.1 hJ with rfl - grind [Box.splitUpper_eq_self, Box.splitLower_eq_self, mem_boxes, mem_split_iff, not_lt] + rcases mem_top.1 hJ with rfl; clear hJ + rw [mem_boxes, mem_split_iff] + rw [mem_Ioo, not_and_or, not_lt, not_lt] at h + cases h <;> [right; left] + · rwa [eq_comm, Box.splitUpper_eq_self] + · rwa [eq_comm, Box.splitLower_eq_self] theorem coe_eq_of_mem_split_of_mem_le {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J) (h₃ : y i ≤ x) : (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index 5fc929c0bfb683..f95ff5e2884ecd 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -458,7 +458,11 @@ lemma IsGreatest.nnnorm_cfc_nnreal [Nontrivial A] (f : ℝ≥0 → ℝ≥0) (a : convert IsGreatest.nnnorm_cfc (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - simp [Set.image_image, ← ha'.image] + ext x + constructor + all_goals rintro ⟨x, hx, rfl⟩ + · exact ⟨x, spectrum.algebraMap_mem ℝ hx, by simp⟩ + · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ lemma apply_le_nnnorm_cfc_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σ ℝ≥0 a) (hf : ContinuousOn f (σ ℝ≥0 a) := by cfc_cont_tac) (ha : 0 ≤ a := by cfc_tac) : @@ -532,7 +536,11 @@ lemma IsGreatest.nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) convert IsGreatest.nnnorm_cfcₙ (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont (by simpa) case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - simp [Set.image_image, ← ha'.image] + ext x + constructor + all_goals rintro ⟨x, hx, rfl⟩ + · exact ⟨x, quasispectrum.algebraMap_mem ℝ hx, by simp⟩ + · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ lemma apply_le_nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σₙ ℝ≥0 a) (hf : ContinuousOn f (σₙ ℝ≥0 a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index aa2ab470e02e56..d2c1d46f0f2fcd 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -292,11 +292,15 @@ lemma CFC.conjugate_rpow_neg_one_half (a : A) (ha : IsStrictlyPositive a := by c invertible. -/ lemma CStarAlgebra.isUnit_of_le (a : A) {b : A} (hab : a ≤ b) (h : IsStrictlyPositive a := by cfc_tac) : IsUnit b := by - nontriviality A; rw [← spectrum.zero_notMem_iff ℝ]; intro h0 - obtain ⟨r, hr, hr_le⟩ := (CFC.exists_pos_algebraMap_le_iff h.isSelfAdjoint).2 fun x hx ↦ - h.spectrum_pos hx - exact not_le_of_gt hr ((algebraMap_le_iff_le_spectrum (a := b) (ha := .of_nonneg - (h.nonneg.trans hab))).1 (hr_le.trans hab) 0 h0) + have h₀ := h.isUnit + have ha := h.nonneg + rw [← spectrum.zero_notMem_iff ℝ≥0] at h₀ ⊢ + nontriviality A + have hb := (show 0 ≤ a from ha).trans hab + rw [zero_notMem_iff, SpectrumRestricts.nnreal_lt_iff (.nnreal_of_nonneg ‹_›), + NNReal.coe_zero, ← CFC.exists_pos_algebraMap_le_iff (.of_nonneg ‹_›)] at h₀ ⊢ + peel h₀ with r hr _ + exact this.trans hab lemma le_iff_norm_sqrt_mul_rpow (a b : A) (ha : 0 ≤ a := by cfc_tac) (hb : IsStrictlyPositive b := by cfc_tac) : @@ -437,13 +441,23 @@ instance instNonnegSpectrumClassComplexNonUnital : NonnegSpectrumClass ℂ A whe lemma norm_le_norm_of_nonneg_of_le {a b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖ ≤ ‖b‖ := by suffices ∀ a b : A⁺¹, 0 ≤ a → a ≤ b → ‖a‖ ≤ ‖b‖ by - have hb : 0 ≤ b := ha.trans hab + have hb := ha.trans hab simpa only [ge_iff_le, Unitization.norm_inr] using - this a b (by simpa) (by rwa [Unitization.inr_le_iff a b (.of_nonneg ha) (.of_nonneg hb)]) + this a b (by simpa) (by rwa [Unitization.inr_le_iff a b]) intro a b ha hab have hb : 0 ≤ b := ha.trans hab - exact (CStarAlgebra.norm_le_iff_le_algebraMap a (norm_nonneg _) ha).2 <| - hab.trans <| IsSelfAdjoint.le_algebraMap_norm_self (.of_nonneg hb) + -- these two `have`s are just for performance + have := IsSelfAdjoint.of_nonneg ha; have := IsSelfAdjoint.of_nonneg hb + have h₂ : cfc (id : ℝ → ℝ) a ≤ cfc (fun _ => ‖b‖) a := by + calc _ = a := by rw [cfc_id ℝ a] + _ ≤ cfc id b := (cfc_id ℝ b) ▸ hab + _ ≤ cfc (fun _ => ‖b‖) b := by + refine cfc_mono fun x hx => ?_ + calc x = ‖x‖ := (Real.norm_of_nonneg (spectrum_nonneg_of_nonneg hb hx)).symm + _ ≤ ‖b‖ := spectrum.norm_le_norm_of_mem hx + _ = _ := by rw [cfc_const _ _, cfc_const _ _] + rw [cfc_le_iff id (fun _ => ‖b‖) a] at h₂ + exact h₂ ‖a‖ <| norm_mem_spectrum_of_nonneg ha theorem nnnorm_le_nnnorm_of_nonneg_of_le {a : A} {b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖₊ ≤ ‖b‖₊ := diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean index ecc3522cb35215..d402b443a6ad3f 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean @@ -136,9 +136,13 @@ lemma range_cfc_nnreal rw [range_cfc_nnreal_eq_image_cfc_real a ha, Set.setOf_and, SetLike.setOf_mem_eq, ← range_cfc _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] rintro _ ⟨f, hf, rfl⟩ - exact cfc_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' ha' ↦ - ⟨f, (cfc_nonneg_iff f a hf' ha').mp (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), - by simp [cfc_apply f a ha' hf']⟩ + simp only [Set.preimage_setOf_eq, Set.mem_setOf_eq, Set.mem_image] at hf ⊢ + obtain (⟨h₁, h₂⟩ | h | h) := by + simpa only [not_and_or] using em (ContinuousOn f (spectrum ℝ a) ∧ IsSelfAdjoint a) + · refine ⟨f, ?_, rfl⟩ + rwa [cfc_nonneg_iff f a] at hf + · exact ⟨0, by simp, by simp [cfc_apply_of_not_continuousOn a h]⟩ + · exact ⟨0, by simp, by simp [cfc_apply_of_not_predicate a h]⟩ end Unital @@ -249,8 +253,14 @@ lemma range_cfcₙ_nnreal [NonUnitalClosedEmbeddingContinuousFunctionalCalculus ← range_cfcₙ _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] refine Set.Subset.antisymm (Set.image_mono (fun _ ↦ cfcₙ_nonneg)) ?_ rintro _ ⟨f, hf, rfl⟩ - exact cfcₙ_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' h0 ha' ↦ - ⟨f, (cfcₙ_nonneg_iff f a hf' h0 ha').mp - (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), by simp [cfcₙ_apply f a hf' h0 ha']⟩ + simp only [Set.preimage_setOf_eq, Set.mem_setOf_eq, Set.mem_image] at hf ⊢ + obtain (⟨h₁, h₂, h₃⟩ | h | h | h) := by + simpa only [not_and_or] using + em (ContinuousOn f (quasispectrum ℝ a) ∧ f 0 = 0 ∧ IsSelfAdjoint a) + · refine ⟨f, ?_, rfl⟩ + rwa [cfcₙ_nonneg_iff f a] at hf + · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_continuousOn a h]⟩ + · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_map_zero a h]⟩ + · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_predicate a h]⟩ end NonUnital diff --git a/Mathlib/Analysis/CStarAlgebra/Exponential.lean b/Mathlib/Analysis/CStarAlgebra/Exponential.lean index f5f709d3b023ff..2bef6805c902c6 100644 --- a/Mathlib/Analysis/CStarAlgebra/Exponential.lean +++ b/Mathlib/Analysis/CStarAlgebra/Exponential.lean @@ -55,12 +55,17 @@ lemma selfAdjoint.continuous_expUnitary : Continuous (expUnitary : selfAdjoint A theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : expUnitary (a + b) = expUnitary a * expUnitary b := by let +nondep : NormedAlgebra ℚ A := .restrictScalars ℚ ℂ A - simpa only [Subtype.ext_iff, expUnitary_coe, AddSubgroup.coe_add, smul_add] using - exp_add_of_commute ((h.smul_left I).smul_right I) + ext + have hcomm : Commute (I • (a : A)) (I • (b : A)) := by + unfold Commute SemiconjBy + simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm] + simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : - Commute (expUnitary a) (expUnitary b) := by - simpa only [Commute, SemiconjBy, Subtype.ext_iff, expUnitary_coe] using - ((h.smul_left I).smul_right I).exp + Commute (expUnitary a) (expUnitary b) := + calc + selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = + selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by + rw [← h.expUnitary_add, ← h.symm.expUnitary_add, add_comm] end Star diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean index 910af77d7b6fa7..dd10e630df16d7 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean @@ -8,7 +8,7 @@ module public import Mathlib.RingTheory.Finiteness.Defs public import Mathlib.Topology.Bornology.Constructions public import Mathlib.Topology.UniformSpace.Equiv -public import Mathlib.Topology.Algebra.Module.TransferInstance +public import Mathlib.Topology.Algebra.Module.Equiv public import Mathlib.Topology.Algebra.IsUniformGroup.Constructions /-! # Type synonym for types with a `CStarModule` structure @@ -162,12 +162,16 @@ end Equiv /-- `WithCStarModule.equiv` as an additive equivalence. -/ def addEquiv [AddCommGroup E] : C⋆ᵐᵒᵈ(A, E) ≃+ E := - Equiv.addEquiv (equiv A E) + { AddEquiv.refl _ with + toFun := equiv _ _ + invFun := (equiv _ _).symm } /-- `WithCStarModule.equiv` as a linear equivalence. -/ -@[simps! -fullyApplied] +@[simps -fullyApplied] def linearEquiv [Semiring R] [AddCommGroup E] [Module R E] : C⋆ᵐᵒᵈ(A, E) ≃ₗ[R] E := - (addEquiv A E).toLinearEquiv fun _ _ ↦ rfl + { LinearEquiv.refl _ _ with + toFun := equiv _ _ + invFun := (equiv _ _).symm } lemma map_top_submodule {R : Type*} [Semiring R] [AddCommGroup E] [Module R E] : (⊤ : Submodule R E).map (linearEquiv R A E).symm.toLinearMap = ⊤ := diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index 4c143a3ca4ca7a..d716c1e4af8af6 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -313,8 +313,12 @@ noncomputable instance (priority := 100) Complex.instStarHomClass : StarHomClass rw [← realPart_add_I_smul_imaginaryPart a] simp only [map_add, map_smul, star_add, star_smul, hsa, selfAdjoint.star_val_eq] intro s - rw [selfAdjoint.mem_spectrum_eq_re s (AlgHom.apply_mem_spectrum φ (s : A))] - simp + have := AlgHom.apply_mem_spectrum φ (s : A) + rw [selfAdjoint.val_re_map_spectrum s] at this + rcases this with ⟨⟨_, _⟩, _, heq⟩ + simp only [Function.comp_apply] at heq + rw [← heq, RCLike.star_def] + exact RCLike.conj_ofReal _ /-- This is not an instance to avoid type class inference loops. See `WeakDual.Complex.instStarHomClass`. -/ From 8fbc503b3150eeb95ca37529393e5863ef88028b Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 10:38:32 +0800 Subject: [PATCH 09/29] fix errors and linters --- .../ContinuousFunctionalCalculus/Order.lean | 12 ++++++------ Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean | 12 ++++++++---- Mathlib/Analysis/ConstantSpeed.lean | 4 ++-- Mathlib/Analysis/Convex/Between.lean | 7 ++----- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index aa2ab470e02e56..ad939d877fdea7 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -293,10 +293,10 @@ invertible. -/ lemma CStarAlgebra.isUnit_of_le (a : A) {b : A} (hab : a ≤ b) (h : IsStrictlyPositive a := by cfc_tac) : IsUnit b := by nontriviality A; rw [← spectrum.zero_notMem_iff ℝ]; intro h0 - obtain ⟨r, hr, hr_le⟩ := (CFC.exists_pos_algebraMap_le_iff h.isSelfAdjoint).2 fun x hx ↦ - h.spectrum_pos hx - exact not_le_of_gt hr ((algebraMap_le_iff_le_spectrum (a := b) (ha := .of_nonneg - (h.nonneg.trans hab))).1 (hr_le.trans hab) 0 h0) + obtain ⟨r, hr, hr_le⟩ : ∃ r > 0, (algebraMap ℝ A) r ≤ a := + (exists_pos_algebraMap_le_iff h.isSelfAdjoint).2 fun x hx ↦ h.spectrum_pos hx + exact not_le_of_gt hr <| (algebraMap_le_iff_le_spectrum <| .of_nonneg <| h.nonneg.trans hab).1 + (hr_le.trans hab) 0 h0 lemma le_iff_norm_sqrt_mul_rpow (a b : A) (ha : 0 ≤ a := by cfc_tac) (hb : IsStrictlyPositive b := by cfc_tac) : @@ -442,8 +442,8 @@ lemma norm_le_norm_of_nonneg_of_le {a b : A} (ha : 0 ≤ a := by cfc_tac) (hab : this a b (by simpa) (by rwa [Unitization.inr_le_iff a b (.of_nonneg ha) (.of_nonneg hb)]) intro a b ha hab have hb : 0 ≤ b := ha.trans hab - exact (CStarAlgebra.norm_le_iff_le_algebraMap a (norm_nonneg _) ha).2 <| - hab.trans <| IsSelfAdjoint.le_algebraMap_norm_self (.of_nonneg hb) + exact (norm_le_iff_le_algebraMap a (norm_nonneg _) ha).2 <| hab.trans <| + IsSelfAdjoint.le_algebraMap_norm_self (.of_nonneg hb) theorem nnnorm_le_nnnorm_of_nonneg_of_le {a : A} {b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖₊ ≤ ‖b‖₊ := diff --git a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean index 910af77d7b6fa7..dd10e630df16d7 100644 --- a/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean +++ b/Mathlib/Analysis/CStarAlgebra/Module/Synonym.lean @@ -8,7 +8,7 @@ module public import Mathlib.RingTheory.Finiteness.Defs public import Mathlib.Topology.Bornology.Constructions public import Mathlib.Topology.UniformSpace.Equiv -public import Mathlib.Topology.Algebra.Module.TransferInstance +public import Mathlib.Topology.Algebra.Module.Equiv public import Mathlib.Topology.Algebra.IsUniformGroup.Constructions /-! # Type synonym for types with a `CStarModule` structure @@ -162,12 +162,16 @@ end Equiv /-- `WithCStarModule.equiv` as an additive equivalence. -/ def addEquiv [AddCommGroup E] : C⋆ᵐᵒᵈ(A, E) ≃+ E := - Equiv.addEquiv (equiv A E) + { AddEquiv.refl _ with + toFun := equiv _ _ + invFun := (equiv _ _).symm } /-- `WithCStarModule.equiv` as a linear equivalence. -/ -@[simps! -fullyApplied] +@[simps -fullyApplied] def linearEquiv [Semiring R] [AddCommGroup E] [Module R E] : C⋆ᵐᵒᵈ(A, E) ≃ₗ[R] E := - (addEquiv A E).toLinearEquiv fun _ _ ↦ rfl + { LinearEquiv.refl _ _ with + toFun := equiv _ _ + invFun := (equiv _ _).symm } lemma map_top_submodule {R : Type*} [Semiring R] [AddCommGroup E] [Module R E] : (⊤ : Submodule R E).map (linearEquiv R A E).symm.toLinearMap = ⊤ := diff --git a/Mathlib/Analysis/ConstantSpeed.lean b/Mathlib/Analysis/ConstantSpeed.lean index 3c196e44047805..cdc430df5d4d60 100644 --- a/Mathlib/Analysis/ConstantSpeed.lean +++ b/Mathlib/Analysis/ConstantSpeed.lean @@ -153,8 +153,8 @@ theorem hasConstantSpeedOnWith_zero_iff : HasConstantSpeedOnWith f s 0 ↔ ∀ᵉ (x ∈ s) (y ∈ s), edist (f x) (f y) = 0 := by rw [hasConstantSpeedOnWith_iff_variationOnFromTo_eq] constructor - · rintro ⟨hf, h0⟩ x xs y ys - simpa using variationOnFromTo.edist_zero_of_eq_zero hf xs ys (by simpa using h0 xs ys) + · intro ⟨hf, h0⟩ x xs y ys + exact variationOnFromTo.edist_zero_of_eq_zero hf xs ys (by simp [h0 xs ys]) · intro h have hf : LocallyBoundedVariationOn f s := fun x y xs ys ↦ ((eVariationOn.eq_zero_iff f).2 fun a ha b hb ↦ h a ha.1 b hb.1).trans_lt diff --git a/Mathlib/Analysis/Convex/Between.lean b/Mathlib/Analysis/Convex/Between.lean index e733880d9aa168..d681b1f8f235af 100644 --- a/Mathlib/Analysis/Convex/Between.lean +++ b/Mathlib/Analysis/Convex/Between.lean @@ -1036,9 +1036,7 @@ theorem Sbtw.trans_expand_right {w x y z : P} (h₁ : Sbtw R w x y) (h₂ : Sbtw omit [IsStrictOrderedRing R] in theorem Wbtw.collinear {x y z : P} (h : Wbtw R x y z) : Collinear R ({x, y, z} : Set P) := by - simpa [Set.insert_comm] using - (collinear_insert_of_mem_affineSpan_pair (k := R) h.mem_affineSpan : - Collinear R ({y, x, z} : Set P)) + simpa [Set.insert_comm] using collinear_insert_of_mem_affineSpan_pair h.mem_affineSpan theorem Collinear.wbtw_or_wbtw_or_wbtw {x y z : P} (h : Collinear R ({x, y, z} : Set P)) : Wbtw R x y z ∨ Wbtw R y z x ∨ Wbtw R z x y := by @@ -1065,8 +1063,7 @@ theorem Collinear.wbtw_or_wbtw_or_wbtw {x y z : P} (h : Collinear R ({x, y, z} : exact Or.inl (wbtw_or_wbtw_smul_vadd_of_nonneg _ _ hy0.le hz0.le) theorem wbtw_iff_sameRay_vsub {x y z : P} : Wbtw R x y z ↔ SameRay R (y -ᵥ x) (z -ᵥ y) := by - rw [← wbtw_vsub_const_iff (R := R) (p := x), ← mem_segment_iff_wbtw, mem_segment_iff_sameRay] - simp [vsub_sub_vsub_cancel_right] + simp [← wbtw_vsub_const_iff x, ← mem_segment_iff_wbtw, mem_segment_iff_sameRay] lemma wbtw_total_of_sameRay_vsub_left {x y z : P} (h : SameRay R (y -ᵥ x) (z -ᵥ x)) : Wbtw R x y z ∨ Wbtw R x z y := by From 3352092cc105001599be6f490ae3292dedef5add Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 10:51:20 +0800 Subject: [PATCH 10/29] Revert "Merge branch 'golf_27'" --- Mathlib/Analysis/CStarAlgebra/Basic.lean | 22 ++++---------- .../CStarAlgebra/CompletelyPositiveMap.lean | 14 ++------- .../ContinuousFunctionalCalculus/Pi.lean | 14 ++++----- .../Restrict.lean | 29 +++++++------------ .../ContinuousFunctionalCalculus/Unique.lean | 29 ++++--------------- Mathlib/Analysis/CStarAlgebra/Projection.lean | 23 +++++---------- 6 files changed, 38 insertions(+), 93 deletions(-) diff --git a/Mathlib/Analysis/CStarAlgebra/Basic.lean b/Mathlib/Analysis/CStarAlgebra/Basic.lean index 6f16799c72c023..e3b4adc91021b1 100644 --- a/Mathlib/Analysis/CStarAlgebra/Basic.lean +++ b/Mathlib/Analysis/CStarAlgebra/Basic.lean @@ -225,16 +225,10 @@ theorem norm_of_mem_unitary [Nontrivial E] {U : E} (hU : U ∈ unitary E) : ‖U @[simp] theorem norm_coe_unitary_mul (U : unitary E) (A : E) : ‖(U : E) * A‖ = ‖A‖ := by nontriviality E - refine le_antisymm ?_ ?_ - · calc - _ ≤ ‖(U : E)‖ * ‖A‖ := norm_mul_le _ _ - _ = ‖A‖ := by rw [norm_coe_unitary, one_mul] - · calc - _ = ‖(U : E)⋆ * U * A‖ := by rw [Unitary.coe_star_mul_self U, one_mul] - _ ≤ ‖(U : E)⋆‖ * ‖(U : E) * A‖ := by - rw [mul_assoc] - exact norm_mul_le _ _ - _ = ‖(U : E) * A‖ := by rw [norm_star, norm_coe_unitary, one_mul] + rw [← sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _), sq, sq, + ← CStarRing.norm_star_mul_self (x := (U : E) * A), ← CStarRing.norm_star_mul_self (x := A)] + congr 1 + grind [star_mul, mul_assoc, Unitary.coe_star_mul_self, one_mul] @[simp] theorem norm_unitary_smul (U : unitary E) (A : E) : ‖U • A‖ = ‖A‖ := @@ -244,12 +238,8 @@ theorem norm_mem_unitary_mul {U : E} (A : E) (hU : U ∈ unitary E) : ‖U * A norm_coe_unitary_mul ⟨U, hU⟩ A @[simp] -theorem norm_mul_coe_unitary (A : E) (U : unitary E) : ‖A * U‖ = ‖A‖ := - calc - _ = ‖((U : E)⋆ * A⋆)⋆‖ := by simp only [star_star, star_mul] - _ = ‖(U : E)⋆ * A⋆‖ := by rw [norm_star] - _ = ‖A⋆‖ := norm_mem_unitary_mul (star A) (Unitary.star_mem U.prop) - _ = ‖A‖ := norm_star _ +theorem norm_mul_coe_unitary (A : E) (U : unitary E) : ‖A * U‖ = ‖A‖ := by + simpa [← norm_star (A * U)] using norm_coe_unitary_mul (star U) (star A) theorem norm_mul_mem_unitary (A : E) {U : E} (hU : U ∈ unitary E) : ‖A * U‖ = ‖A‖ := norm_mul_coe_unitary A ⟨U, hU⟩ diff --git a/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean b/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean index 3986f7d880ec3e..a10dfaabab10dd 100644 --- a/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean +++ b/Mathlib/Analysis/CStarAlgebra/CompletelyPositiveMap.lean @@ -97,12 +97,8 @@ lemma _root_.OrderHomClass.of_map_cstarMatrix_nonneg (h : ∀ (φ : F) (k : ℕ) (M : CStarMatrix (Fin k) (Fin k) A₁), 0 ≤ M → 0 ≤ M.map φ) : OrderHomClass F A₁ A₂ := .of_addMonoidHom <| by intro φ a ha - let Ma := toOneByOne (Fin 1) ℂ A₁ a - have h₁ : 0 ≤ Ma := map_nonneg (toOneByOne (Fin 1) ℂ A₁) ha - have h₂ : 0 ≤ Ma.map φ := h φ 1 Ma h₁ - have h₃ : φ a = (toOneByOne (Fin 1) ℂ A₂).symm (toOneByOne (Fin 1) ℂ A₂ (φ a)) := rfl - rw [h₃] - exact map_nonneg (toOneByOne (Fin 1) ℂ A₂).symm h₂ + simpa using map_nonneg (toOneByOne (Fin 1) ℂ A₂).symm <| + h φ 1 _ <| map_nonneg (toOneByOne (Fin 1) ℂ A₁) ha instance [CompletelyPositiveMapClass F A₁ A₂] : OrderHomClass F A₁ A₂ := .of_map_cstarMatrix_nonneg CompletelyPositiveMapClass.map_cstarMatrix_nonneg' @@ -140,11 +136,7 @@ lemma map_cstarMatrix_nonneg {n : Type*} [Fintype n] (φ : A₁ →CP A₂) (M : simp only [mapₗ, LinearMap.coe_coe, LinearMap.coe_mk, AddHom.coe_mk] exact CompletelyPositiveMapClass.map_cstarMatrix_nonneg' _ k _ (map_nonneg _ hM) rw [← mapₗ_reindexₐ] at hmain - have hrw : - reindexₐ ℂ A₂ e.symm ((reindexₐ ℂ A₂ e) (M.map (φ : A₁ → A₂))) = M.map (φ : A₁ → A₂) := by - simp - rw [← hrw] - exact map_nonneg _ hmain + simpa [reindexₐ_symm] using map_nonneg (reindexₐ ℂ A₂ e).symm hmain end CompletelyPositiveMap diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean index f108df8a89dcab..6d35885632201d 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Pi.lean @@ -42,15 +42,11 @@ lemma cfcₙ_map_pi (f : R → R) (a : ∀ i, A i) (hf : ContinuousOn f (⋃ i, quasispectrum R (a i)) := by cfc_cont_tac) (ha : p a := by cfc_tac) (ha' : ∀ i, q i (a i) := by cfc_tac) : cfcₙ f a = fun i => cfcₙ f (a i) := by - cases isEmpty_or_nonempty ι with - | inr h => - by_cases hf₀ : f 0 = 0 - · ext i - let φ := Pi.evalNonUnitalStarAlgHom S A i - exact φ.map_cfcₙ f a (by rwa [Pi.quasispectrum_eq]) hf₀ (continuous_apply i) ha (ha' i) - · simp only [cfcₙ_apply_of_not_map_zero _ hf₀, Pi.zero_def] - | inl h => - exact Subsingleton.elim _ _ + by_cases hf₀ : f 0 = 0 + · ext i; letI : Nonempty ι := ⟨i⟩ + exact (Pi.evalNonUnitalStarAlgHom S A i).map_cfcₙ f a (by rwa [Pi.quasispectrum_eq]) hf₀ + (continuous_apply i) ha (ha' i) + · simp only [cfcₙ_apply_of_not_map_zero _ hf₀, Pi.zero_def] end nonunital_pi diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean index 3207104f131533..69d1c499aee8c8 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Restrict.lean @@ -136,18 +136,14 @@ protected theorem cfc (f : C(S, R)) (halg : IsClosedEmbedding (algebraMap R S)) rw [SpectrumRestricts.starAlgHom_apply] simp only [← @spectrum.preimage_algebraMap (R := R) S, cfcHom_map_spectrum] ext x + simp only [Set.mem_preimage, Set.mem_range, ContinuousMap.comp_apply] constructor · rintro ⟨y, hy⟩ - have := congr_arg f hy - simp only [ContinuousMap.coe_mk, ContinuousMap.comp_apply, StarAlgHom.ofId_apply] at this - rw [((h a).mp ha).2.left_inv _, ((h a).mp ha).2.left_inv _] at this - exact ⟨_, this⟩ + exact ⟨((h a).mp ha).2.homeomorph y, halg.injective hy⟩ · rintro ⟨y, rfl⟩ - rw [Set.mem_preimage] - refine ⟨⟨algebraMap R S y, spectrum.algebraMap_mem S y.prop⟩, ?_⟩ - simp only [ContinuousMap.coe_mk, ContinuousMap.comp_apply, StarAlgHom.ofId_apply] - congr - exact Subtype.ext (((h a).mp ha).2.left_inv y) + refine ⟨((h a).mp ha).2.homeomorph.symm y, ?_⟩ + exact + congrArg (fun z => algebraMap R S (g z)) (((h a).mp ha).2.homeomorph.apply_symm_apply y) case predicate_hom => intro g rw [h] @@ -313,19 +309,14 @@ protected theorem cfc (f : C(S, R)) (halg : IsClosedEmbedding (algebraMap R S)) rw [nonUnitalStarAlgHom_apply] simp only [← @quasispectrum.preimage_algebraMap (R := R) S, cfcₙHom_map_quasispectrum] ext x + simp only [Set.mem_preimage, Set.mem_range] constructor · rintro ⟨y, hy⟩ - have := congr_arg f hy - simp only [comp_apply, coe_mk, ContinuousMap.coe_mk, StarAlgHom.ofId_apply] - at this - rw [((h a).mp ha).2.left_inv _, ((h a).mp ha).2.left_inv _] at this - exact ⟨_, this⟩ + exact ⟨((h a).mp ha).2.homeomorph y, halg.injective hy⟩ · rintro ⟨y, rfl⟩ - rw [Set.mem_preimage] - refine ⟨⟨algebraMap R S y, quasispectrum.algebraMap_mem S y.prop⟩, ?_⟩ - simp only [comp_apply, coe_mk, ContinuousMap.coe_mk, StarAlgHom.ofId_apply] - congr - exact Subtype.ext (((h a).mp ha).2.left_inv y) + refine ⟨((h a).mp ha).2.homeomorph.symm y, ?_⟩ + exact + congrArg (fun z => algebraMap R S (g z)) (((h a).mp ha).2.homeomorph.apply_symm_apply y) case predicate_hom => intro g rw [h] diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean index 7a4bde8b827ad5..6a0168f60c3620 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Unique.lean @@ -177,16 +177,7 @@ instance NNReal.instContinuousMap.UniqueHom [T2Space A] : ContinuousMap.UniqueHom ℝ≥0 A where eq_of_continuous_of_map_id s hs φ ψ hφ hψ h := by let s' : Set ℝ := (↑) '' s - let e : s ≃ₜ s' := - { toFun := Subtype.map (↑) (by simp [s']) - invFun := Subtype.map Real.toNNReal (by simp [s']) - left_inv := fun _ ↦ by ext; simp - right_inv := fun x ↦ by - ext - obtain ⟨y, -, hy⟩ := x.2 - simpa using hy ▸ NNReal.coe_nonneg y - continuous_toFun := continuous_coe.subtype_map (by simp [s']) - continuous_invFun := continuous_real_toNNReal.subtype_map (by simp [s']) } + let e : s ≃ₜ s' := NNReal.isEmbedding_coe.homeomorphImage s have (ξ : C(s, ℝ≥0) →⋆ₐ[ℝ≥0] A) (hξ : Continuous ξ) : (let ξ' := ξ.realContinuousMapOfNNReal.comp <| ContinuousMap.compStarAlgHom' ℝ ℝ e Continuous ξ' ∧ ξ' (.restrict s' <| .id ℝ) = ξ (.restrict s <| .id ℝ≥0)) := by @@ -265,7 +256,7 @@ lemma toNNReal_smul (r : ℝ≥0) (f : C(X, ℝ)₀) : (r • f).toNNReal = r @[simp] lemma toNNReal_neg_smul (r : ℝ≥0) (f : C(X, ℝ)₀) : (-(r • f)).toNNReal = r • (-f).toNNReal := by - rw [NNReal.smul_def, ← smul_neg, ← NNReal.smul_def, toNNReal_smul] + simpa [smul_neg] using (toNNReal_smul (X := X) r (-f)) lemma toNNReal_mul_add_neg_mul_add_mul_neg_eq (f g : C(X, ℝ)₀) : ((f * g).toNNReal + (-f).toNNReal * g.toNNReal + f.toNNReal * (-g).toNNReal) = @@ -366,18 +357,10 @@ instance NNReal.instContinuousMapZero.UniqueHom ContinuousMapZero.UniqueHom ℝ≥0 A where eq_of_continuous_of_map_id s hs h0 φ ψ hφ hψ h := by let s' : Set ℝ := (↑) '' s - let e : s ≃ₜ s' := - { toFun := Subtype.map (↑) (by simp [s']) - invFun := Subtype.map Real.toNNReal (by simp [s']) - left_inv := fun _ ↦ by ext; simp - right_inv := fun x ↦ by - ext - obtain ⟨y, -, hy⟩ := x.2 - simpa using hy ▸ NNReal.coe_nonneg y - continuous_toFun := continuous_coe.subtype_map (by simp [s']) - continuous_invFun := continuous_real_toNNReal.subtype_map (by simp [s']) } - have : Fact (0 ∈ s') := ⟨0, Fact.out, coe_zero⟩ - have e0 : e 0 = 0 := by ext; simp [e]; rfl + let e : s ≃ₜ s' := NNReal.isEmbedding_coe.homeomorphImage s + have hs' : Fact (0 ∈ s') := ⟨0, Fact.out, coe_zero⟩ + have e0 : e ⟨0, Fact.out⟩ = ⟨0, hs'.out⟩ := by + rfl have e0' : e.symm 0 = 0 := by simpa only [Homeomorph.symm_apply_apply] using congr(e.symm $(e0)).symm have (ξ : C(s, ℝ≥0)₀ →⋆ₙₐ[ℝ≥0] A) (hξ : Continuous ξ) : diff --git a/Mathlib/Analysis/CStarAlgebra/Projection.lean b/Mathlib/Analysis/CStarAlgebra/Projection.lean index 78faea065bd0c1..2d914f7b61eead 100644 --- a/Mathlib/Analysis/CStarAlgebra/Projection.lean +++ b/Mathlib/Analysis/CStarAlgebra/Projection.lean @@ -97,21 +97,14 @@ lemma le_tfae (hp : IsStarProjection p) (hq : IsStarProjection q) : p * q = p, IsStarProjection (q - p), IsIdempotentElem (q - p)] := by - tfae_have 1 → 2 := fun h ↦ by - have key : p * (q - p) * p = 0 := by - simp only [sub_mul, mul_sub, hp.isIdempotentElem.eq, sub_eq_zero] - refine le_antisymm ?_ <| by - simpa [hp.isIdempotentElem.eq] using conjugate_le_conjugate_of_nonneg h hp.nonneg - have := by simpa [hp.inr.isIdempotentElem.eq, ← Unitization.inr_mul] - using conjugate_le_conjugate_of_nonneg hq.inr.le_one (hp.inr (R := ℂ)).nonneg - rwa [← Unitization.inr_le_iff (p * q * p) p ?_ hp.isSelfAdjoint] - exact hp.isSelfAdjoint.conjugate_nonneg hq.nonneg |>.isSelfAdjoint - rw [← norm_eq_zero, hp.isSelfAdjoint.norm_mul_mul_self_of_nonneg _ (by simpa), - sq_eq_zero_iff, norm_eq_zero] at key - simpa [← mul_assoc, CFC.sqrt_mul_sqrt_self (q - p) (by simpa), - sub_mul, sub_eq_zero, hp.isIdempotentElem.eq] using congr(CFC.sqrt (q - p) * $key) - tfae_have 2 → 3 := fun h ↦ by - simpa [hp.isSelfAdjoint.star_eq, hq.isSelfAdjoint.star_eq] using congr(star $h) + tfae_have 1 ↔ 2 := by + constructor + · intro h + exact (hq.mul_right_and_mul_left_of_nonneg_of_le hp.nonneg h).2 + · exact hp.le_of_mul_eq_right hq + tfae_have 2 ↔ 3 := by + constructor <;> intro h <;> + simpa [hp.isSelfAdjoint.star_eq, hq.isSelfAdjoint.star_eq] using congr(star $h) tfae_have 3 → 4 := hp.sub_of_mul_eq_left hq tfae_have 4 → 1 := fun h ↦ by simpa using h.nonneg tfae_have 4 ↔ 5 := by simp [isStarProjection_iff, hq.isSelfAdjoint.sub hp.isSelfAdjoint] From 8813b2a5e1e40c6bfb19f12ffb0967905ba7e681 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 11:36:27 +0800 Subject: [PATCH 11/29] fix linter --- .../ContinuousFunctionalCalculus/Order.lean | 7 ++- .../ContinuousFunctionalCalculus/Range.lean | 5 +- .../CharacteristicFunction.lean | 3 +- .../ValueDistribution/Proximity/Basic.lean | 63 +++++++++++-------- 4 files changed, 43 insertions(+), 35 deletions(-) diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index ad939d877fdea7..3d0cc4368c4d0b 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -292,11 +292,12 @@ lemma CFC.conjugate_rpow_neg_one_half (a : A) (ha : IsStrictlyPositive a := by c invertible. -/ lemma CStarAlgebra.isUnit_of_le (a : A) {b : A} (hab : a ≤ b) (h : IsStrictlyPositive a := by cfc_tac) : IsUnit b := by - nontriviality A; rw [← spectrum.zero_notMem_iff ℝ]; intro h0 + nontriviality A + rw [← spectrum.zero_notMem_iff ℝ] obtain ⟨r, hr, hr_le⟩ : ∃ r > 0, (algebraMap ℝ A) r ≤ a := (exists_pos_algebraMap_le_iff h.isSelfAdjoint).2 fun x hx ↦ h.spectrum_pos hx - exact not_le_of_gt hr <| (algebraMap_le_iff_le_spectrum <| .of_nonneg <| h.nonneg.trans hab).1 - (hr_le.trans hab) 0 h0 + exact fun h0 ↦ not_le_of_gt hr <| (algebraMap_le_iff_le_spectrum <| .of_nonneg <| + h.nonneg.trans hab).1 (hr_le.trans hab) 0 h0 lemma le_iff_norm_sqrt_mul_rpow (a b : A) (ha : 0 ≤ a := by cfc_tac) (hb : IsStrictlyPositive b := by cfc_tac) : diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean index ecc3522cb35215..580b1d7dec275a 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean @@ -136,9 +136,8 @@ lemma range_cfc_nnreal rw [range_cfc_nnreal_eq_image_cfc_real a ha, Set.setOf_and, SetLike.setOf_mem_eq, ← range_cfc _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] rintro _ ⟨f, hf, rfl⟩ - exact cfc_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' ha' ↦ - ⟨f, (cfc_nonneg_iff f a hf' ha').mp (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), - by simp [cfc_apply f a ha' hf']⟩ + exact cfc_cases _ a f ⟨0, by simp, by simp⟩ fun hf' ha' ↦ + ⟨f, (cfc_nonneg_iff f a hf' ha').mp (by simpa), by simp [cfc_apply f a ha' hf']⟩ end Unital diff --git a/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean b/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean index 17f877b91f8cd2..ce797250e1aab4 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/CharacteristicFunction.lean @@ -134,8 +134,7 @@ summands). theorem characteristic_add_top_le {f₁ f₂ : ℂ → E} {r : ℝ} (h₁f₁ : Meromorphic f₁) (h₁f₂ : Meromorphic f₂) (hr : 1 ≤ r) : characteristic (f₁ + f₂) ⊤ r ≤ characteristic f₁ ⊤ r + characteristic f₂ ⊤ r + log 2 := by - simpa using characteristic_sum_top_le (s := Finset.univ) (f := ![f₁, f₂]) - (by simpa using ⟨h₁f₁, h₁f₂⟩) hr + simpa using characteristic_sum_top_le Finset.univ ![f₁, f₂] (by simpa using ⟨h₁f₁, h₁f₂⟩) hr /-- Asymptotically, the characteristic function of `f + g` at `⊤` is less than or equal to the sum of diff --git a/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean b/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean index 938f85cc292a59..dbaf8e2d7296ba 100644 --- a/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean +++ b/Mathlib/Analysis/Complex/ValueDistribution/Proximity/Basic.lean @@ -163,22 +163,26 @@ proximity functions of the summand, plus `log` of the number of summands. theorem proximity_sum_top_le [NormedSpace ℂ E] {α : Type*} (s : Finset α) (f : α → ℂ → E) (hf : ∀ a ∈ s, Meromorphic (f a)) : proximity (∑ a ∈ s, f a) ⊤ ≤ ∑ a ∈ s, (proximity (f a) ⊤) + (fun _ ↦ log s.card) := by + simp only [proximity_top, Finset.sum_apply] intro r - simp only [proximity_top, Finset.sum_apply, Pi.add_apply] have h₂f : ∀ i ∈ s, CircleIntegrable (log⁺ ‖f i ·‖) 0 r := fun i hi ↦ MeromorphicOn.circleIntegrable_posLog_norm (fun x hx ↦ hf i hi x) - calc - circleAverage (log⁺ ‖∑ c ∈ s, f c ·‖) 0 r - ≤ circleAverage ((fun x ↦ ∑ c ∈ s, log⁺ ‖f c x‖) + fun _ ↦ log s.card) 0 r := by - apply circleAverage_mono - · apply (Meromorphic.fun_sum hf).meromorphicOn.circleIntegrable_posLog_norm - · exact (CircleIntegrable.fun_sum s h₂f).add (circleIntegrable_const _ _ _) - · intro x hx; simpa [add_comm] using (posLog_norm_sum_le s (fun c ↦ f c x)) - _ = (∑ c ∈ s, circleAverage (log⁺ ‖f c ·‖) 0 r) + log s.card := by - change circleAverage (fun z ↦ (∑ c ∈ s, log⁺ ‖f c z‖) + log s.card) 0 r = _ - rw [circleAverage_fun_add (CircleIntegrable.fun_sum s h₂f) - (circleIntegrable_const (log s.card) 0 r), circleAverage_const] - simpa using (circleAverage_fun_sum (c := 0) (R := r) (f := fun c x ↦ log⁺ ‖f c x‖) (h := h₂f)) + simp only [Pi.add_apply, Finset.sum_apply] + calc circleAverage (log⁺ ‖∑ c ∈ s, f c ·‖) 0 r + _ ≤ circleAverage (∑ c ∈ s, log⁺ ‖f c ·‖ + log s.card) 0 r := by + apply circleAverage_mono + · apply (Meromorphic.fun_sum hf).meromorphicOn.circleIntegrable_posLog_norm + · apply (CircleIntegrable.fun_sum s h₂f).add (circleIntegrable_const _ _ _) + · intro x hx + rw [add_comm] + apply posLog_norm_sum_le + _ = ∑ c ∈ s, circleAverage (log⁺ ‖f c ·‖) 0 r + log s.card := by + nth_rw 2 [← circleAverage_const (log s.card) 0 r] + rw [← circleAverage_sum h₂f, ← circleAverage_add (CircleIntegrable.sum s h₂f) + (circleIntegrable_const (log s.card) 0 r)] + congr 1 + ext x + simp /-- The proximity function of `f + g` at `⊤` is less than or equal to the sum of the proximity functions @@ -196,20 +200,25 @@ The proximity function `f * g` at `⊤` is less than or equal to the sum of the -/ theorem proximity_mul_top_le {f₁ f₂ : ℂ → ℂ} (h₁f₁ : Meromorphic f₁) (h₁f₂ : Meromorphic f₂) : proximity (f₁ * f₂) ⊤ ≤ proximity f₁ ⊤ + proximity f₂ ⊤ := by - intro r - simp only [proximity_top, Pi.mul_apply, Complex.norm_mul, Pi.add_apply] - calc circleAverage (fun x ↦ log⁺ (‖f₁ x‖ * ‖f₂ x‖)) 0 r - ≤ circleAverage (fun x ↦ log⁺ ‖f₁ x‖ + log⁺ ‖f₂ x‖) 0 r := by - apply circleAverage_mono - · simpa [norm_mul] using - ((h₁f₁.mul h₁f₂).meromorphicOn.circleIntegrable_posLog_norm (c := 0) (R := r)) - · exact (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x)).add - (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x)) - · intro x hx - exact posLog_mul - _ = circleAverage (log⁺ ‖f₁ ·‖) 0 r + circleAverage (log⁺ ‖f₂ ·‖) 0 r := by - exact circleAverage_add (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x)) - (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x)) + calc proximity (f₁ * f₂) ⊤ + _ = circleAverage (fun x ↦ log⁺ (‖f₁ x‖ * ‖f₂ x‖)) 0 := by + simp [proximity] + _ ≤ circleAverage (fun x ↦ log⁺ ‖f₁ x‖ + log⁺ ‖f₂ x‖) 0 := by + intro r + apply circleAverage_mono + · simp_rw [← norm_mul] + apply MeromorphicOn.circleIntegrable_posLog_norm + apply Meromorphic.meromorphicOn + fun_prop + · apply (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x)).add + (MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x)) + · exact fun _ _ ↦ posLog_mul + _ = circleAverage (log⁺ ‖f₁ ·‖) 0 + circleAverage (log⁺ ‖f₂ ·‖) 0 := by + ext r + apply circleAverage_add + · exact MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₁ x) + · exact MeromorphicOn.circleIntegrable_posLog_norm (fun x a ↦ h₁f₂ x) + _ = proximity f₁ ⊤ + proximity f₂ ⊤ := by simp [proximity] @[deprecated (since := "2025-12-11")] alias proximity_top_mul_le := proximity_mul_top_le From 9b892e5b5a13dc81f2b16e645805240db9f8383c Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 17:43:23 +0800 Subject: [PATCH 12/29] golf Mathlib/Analysis/Convex/Approximation.lean --- Mathlib/Analysis/Convex/Approximation.lean | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Mathlib/Analysis/Convex/Approximation.lean b/Mathlib/Analysis/Convex/Approximation.lean index cfc8bd5556a13f..4c7fca57290943 100644 --- a/Mathlib/Analysis/Convex/Approximation.lean +++ b/Mathlib/Analysis/Convex/Approximation.lean @@ -220,19 +220,13 @@ theorem univ_sSup_of_nat_affine_eq [HereditarilyLindelofSpace E] (hφc : LowerSemicontinuous φ) (hφcv : ConvexOn ℝ univ φ) : ∃ (l : ℕ → E →L[𝕜] 𝕜) (c : ℕ → ℝ), (∀ i, re ∘ (l i) + const E (c i) ≤ φ) ∧ ⨆ i, re ∘ (l i) + const E (c i) = φ := by - obtain ⟨𝓕', h𝓕'⟩ := hφcv.univ_sSup_of_countable_affine_eq (𝕜 := 𝕜) hφc - by_cases! he : 𝓕'.Nonempty - · obtain ⟨f, hf⟩ := h𝓕'.1.exists_eq_range he - have (i : ℕ) : ∃ (l : E →L[𝕜] 𝕜) (c : ℝ), f i = re ∘ l + const E c := by simp_all - choose l c hlc using this - refine ⟨l, c, fun i => (hlc i) ▸ (h𝓕'.2.2 (f i) (hf ▸ mem_range_self i)).1, ?_⟩ - calc - _ = ⨆ i, f i := by congr with i x; exact congrFun (hlc i).symm x - _ = _ := by rw [← sSup_range, ← hf, h𝓕'.2.1] - · refine ⟨fun _ => 0, fun _ => 0, fun i x => ?_, ?_⟩ - · simp_all [← congrFun h𝓕'.2.1 x] - · ext x - simp_all [← congrFun h𝓕'.2.1 x] + obtain ⟨l, c, hle, hsup⟩ := hφcv.sSup_of_nat_affine_eq (𝕜 := 𝕜) (s := univ) isClosed_univ + (lowerSemicontinuousOn_univ_iff.2 hφc) + refine ⟨l, c, ?_, ?_⟩ + · intro i x + simpa using hle i ⟨x, trivial⟩ + · ext x + simpa using congrFun hsup ⟨x, trivial⟩ end RCLike From be09512c7539914e006c7f9eac2a1a2a6c276e47 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 18:00:19 +0800 Subject: [PATCH 13/29] apply suggestions --- Mathlib/Analysis/Convex/Approximation.lean | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mathlib/Analysis/Convex/Approximation.lean b/Mathlib/Analysis/Convex/Approximation.lean index 4c7fca57290943..dd5fa60e8fc6e0 100644 --- a/Mathlib/Analysis/Convex/Approximation.lean +++ b/Mathlib/Analysis/Convex/Approximation.lean @@ -222,9 +222,8 @@ theorem univ_sSup_of_nat_affine_eq [HereditarilyLindelofSpace E] ∧ ⨆ i, re ∘ (l i) + const E (c i) = φ := by obtain ⟨l, c, hle, hsup⟩ := hφcv.sSup_of_nat_affine_eq (𝕜 := 𝕜) (s := univ) isClosed_univ (lowerSemicontinuousOn_univ_iff.2 hφc) - refine ⟨l, c, ?_, ?_⟩ - · intro i x - simpa using hle i ⟨x, trivial⟩ + refine ⟨l, c, fun i x ↦ ?_, ?_⟩ + · exact hle i ⟨x, trivial⟩ · ext x simpa using congrFun hsup ⟨x, trivial⟩ From f75f96a69ce16adf3cf6f0d8efb88892759f9997 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 18:03:53 +0800 Subject: [PATCH 14/29] Revert "Merge branch 'golf_45' into golf" This reverts commit ba6196abe28d8e5780901c57e68cfe798fd7bf67, reversing changes made to 8813b2a5e1e40c6bfb19f12ffb0967905ba7e681. --- Archive/Imo/Imo1962Q1.lean | 4 +- Archive/Imo/Imo1962Q4.lean | 3 +- Archive/Imo/Imo2019Q4.lean | 3 +- .../OxfordInvariants/Summer2021/Week3P1.lean | 4 +- Mathlib.lean | 16 ++++ Mathlib/Algebra/ArithmeticGeometric.lean | 8 ++ .../Category/ModuleCat/Topology/Basic.lean | 2 + .../Homology/DerivedCategory/Basic.lean | 1 + Mathlib/Algebra/Lie/Abelian.lean | 1 + Mathlib/Algebra/Lie/Classical.lean | 1 + Mathlib/Algebra/Lie/Extension.lean | 8 ++ Mathlib/Algebra/Lie/Ideal.lean | 3 + Mathlib/Algebra/Lie/Killing.lean | 3 + Mathlib/Algebra/Lie/LieTheorem.lean | 1 + Mathlib/Algebra/Lie/Nilpotent.lean | 6 ++ Mathlib/Algebra/Lie/Semisimple/Basic.lean | 1 + Mathlib/Algebra/Lie/TensorProduct.lean | 1 + Mathlib/Algebra/Lie/TraceForm.lean | 1 + Mathlib/Algebra/Module/LinearMap/Defs.lean | 8 +- Mathlib/Algebra/MvPolynomial/Eval.lean | 1 + .../Algebra/MvPolynomial/NoZeroDivisors.lean | 1 + Mathlib/Algebra/Ring/BooleanRing.lean | 3 +- Mathlib/AlgebraicGeometry/AffineScheme.lean | 7 ++ .../GammaSpecAdjunction.lean | 1 + .../Geometrically/Basic.lean | 1 + Mathlib/AlgebraicGeometry/Gluing.lean | 2 + .../AlgebraicGeometry/IdealSheaf/Basic.lean | 4 + .../IdealSheaf/Subscheme.lean | 2 + Mathlib/AlgebraicGeometry/Limits.lean | 7 ++ Mathlib/AlgebraicGeometry/Modules/Tilde.lean | 2 + .../AlgebraicGeometry/Morphisms/Affine.lean | 2 + .../AlgebraicGeometry/Morphisms/Basic.lean | 2 + .../Morphisms/Constructors.lean | 2 + Mathlib/AlgebraicGeometry/Morphisms/Flat.lean | 1 + .../Morphisms/FormallyUnramified.lean | 1 + .../Morphisms/Immersion.lean | 1 + .../AlgebraicGeometry/Morphisms/Proper.lean | 1 + .../Morphisms/QuasiCompact.lean | 4 + .../Morphisms/QuasiSeparated.lean | 1 + .../Morphisms/RingHomProperties.lean | 4 + .../AlgebraicGeometry/Morphisms/Smooth.lean | 1 + Mathlib/AlgebraicGeometry/OpenImmersion.lean | 1 + .../ProjectiveSpectrum/Basic.lean | 3 + .../ProjectiveSpectrum/Scheme.lean | 1 + .../ProjectiveSpectrum/Topology.lean | 1 + Mathlib/AlgebraicGeometry/Properties.lean | 1 + Mathlib/AlgebraicGeometry/QuasiAffine.lean | 2 + Mathlib/AlgebraicGeometry/RationalMap.lean | 1 + Mathlib/AlgebraicGeometry/Restrict.lean | 5 + Mathlib/AlgebraicGeometry/Scheme.lean | 1 + Mathlib/AlgebraicGeometry/Spec.lean | 1 + Mathlib/AlgebraicGeometry/Stalk.lean | 1 + Mathlib/AlgebraicGeometry/StructureSheaf.lean | 3 + .../ZariskisMainTheorem.lean | 2 + .../AlgebraicTopology/ExtraDegeneracy.lean | 1 + .../SimplexCategory/Augmented/Monoidal.lean | 2 + .../SimplexCategory/Basic.lean | 16 ++++ .../SimplexCategory/ToMkOne.lean | 5 + .../SimplicialSet/Degenerate.lean | 2 + .../AlgebraicTopology/SimplicialSet/Horn.lean | 1 + .../SimplicialSet/NerveAdjunction.lean | 1 + .../AlgebraicTopology/SimplicialSet/Path.lean | 2 + .../SimplicialSet/ProdStdSimplex.lean | 1 + .../SimplicialSet/StdSimplex.lean | 9 ++ .../SimplicialSet/StrictSegal.lean | 7 ++ .../Analysis/BoxIntegral/Partition/Split.lean | 8 +- .../ContinuousFunctionalCalculus/Basic.lean | 1 + .../Isometric.lean | 12 +-- .../ContinuousFunctionalCalculus/Order.lean | 4 +- .../ContinuousFunctionalCalculus/Range.lean | 12 +-- .../Analysis/CStarAlgebra/Exponential.lean | 15 +-- Mathlib/Analysis/CStarAlgebra/Spectrum.lean | 8 +- Mathlib/Analysis/Complex/Hadamard.lean | 3 +- Mathlib/Analysis/Convex/Approximation.lean | 5 +- .../Analysis/Distribution/TestFunction.lean | 1 + .../InnerProductSpace/Harmonic/Analytic.lean | 6 ++ Mathlib/Analysis/MeanInequalities.lean | 3 +- Mathlib/Analysis/Normed/Algebra/Basic.lean | 1 + Mathlib/Analysis/Normed/Field/Basic.lean | 6 +- Mathlib/Analysis/Normed/Group/Basic.lean | 9 +- Mathlib/Analysis/Normed/Group/Subgroup.lean | 16 ++-- Mathlib/Analysis/Normed/Group/Submodule.lean | 2 +- .../Normed/Module/Ball/Pointwise.lean | 1 + Mathlib/Analysis/Normed/Module/Basic.lean | 4 +- Mathlib/Analysis/Normed/Ring/Basic.lean | 26 +++--- .../NormedSpace/ConformalLinearMap.lean | 7 ++ Mathlib/Analysis/NormedSpace/Extend.lean | 10 ++ .../SpecialFunctions/Complex/Arctan.lean | 3 +- .../SpecialFunctions/Integrability/Basic.lean | 3 +- .../Trigonometric/Arctan.lean | 3 +- Mathlib/CategoryTheory/Abelian/Basic.lean | 3 + Mathlib/CategoryTheory/Abelian/Images.lean | 1 + .../CategoryTheory/Adjunction/Opposites.lean | 2 - .../Bicategory/Functor/Strict.lean | 8 ++ Mathlib/CategoryTheory/Bicategory/Strict.lean | 5 + Mathlib/CategoryTheory/CatCommSq.lean | 4 +- .../CategoryTheory/Comma/CardinalArrow.lean | 2 + Mathlib/CategoryTheory/Functor/Category.lean | 2 +- Mathlib/CategoryTheory/Functor/TwoSquare.lean | 4 +- Mathlib/CategoryTheory/Galois/EssSurj.lean | 1 + Mathlib/CategoryTheory/Iso.lean | 1 + Mathlib/CategoryTheory/Limits/Cones.lean | 2 +- .../CategoryTheory/Limits/Shapes/Images.lean | 8 ++ .../CategoryTheory/Limits/Shapes/Kernels.lean | 2 + .../Shapes/Pullback/PullbackObjObj.lean | 8 ++ .../CategoryTheory/Limits/Types/Images.lean | 1 + .../MorphismProperty/Factorization.lean | 1 + .../MorphismProperty/IsSmall.lean | 1 + .../MorphismProperty/Limits.lean | 2 + .../CategoryTheory/Shift/ShiftSequence.lean | 2 +- .../CategoryTheory/Sites/Grothendieck.lean | 1 + .../Sites/PrecoverageToGrothendieck.lean | 3 + Mathlib/CategoryTheory/Sites/Pretopology.lean | 1 + Mathlib/CategoryTheory/Sites/Spaces.lean | 3 + .../IsCardinalForSmallObjectArgument.lean | 1 + .../Extremal/RuzsaSzemeredi.lean | 5 +- .../Combinatorics/SimpleGraph/Acyclic.lean | 1 + Mathlib/Combinatorics/SimpleGraph/Cayley.lean | 2 + .../SimpleGraph/Connectivity/Finite.lean | 1 + .../SimpleGraph/Extremal/Turan.lean | 1 + .../SimpleGraph/Regularity/Chunk.lean | 10 +- .../SimpleGraph/StronglyRegular.lean | 1 + Mathlib/Data/ENNReal/Action.lean | 1 + Mathlib/Data/Finset/Lattice/Prod.lean | 93 ++++++++++++++++--- Mathlib/Data/Nat/PowModTotient.lean | 8 ++ Mathlib/Data/Real/Irrational.lean | 5 + Mathlib/Data/Set/Finite/Lattice.lean | 71 +++++++++++--- Mathlib/Deprecated/Sort.lean | 72 ++++++++++++++ Mathlib/FieldTheory/Perfect.lean | 4 - .../Angle/Unoriented/TriangleInequality.lean | 6 +- Mathlib/Geometry/Euclidean/Projection.lean | 3 +- Mathlib/Geometry/RingedSpace/Basic.lean | 1 + .../RingedSpace/LocallyRingedSpace.lean | 1 + .../LocallyRingedSpace/ResidueField.lean | 1 + Mathlib/GroupTheory/Coprod/Basic.lean | 3 + Mathlib/GroupTheory/Coxeter/Basic.lean | 5 +- Mathlib/GroupTheory/Divisible.lean | 3 +- Mathlib/GroupTheory/Perm/Cycle/Type.lean | 1 + .../SpecificGroups/Alternating.lean | 3 +- .../SpecificGroups/Quaternion.lean | 2 +- .../Coding/KraftMcMillan.lean | 4 +- .../KullbackLeibler/Basic.lean | 5 + .../LinearAlgebra/AffineSpace/Centroid.lean | 3 +- .../AffineSpace/ContinuousAffineEquiv.lean | 8 ++ .../FiniteDimensional/Basic.lean | 7 -- .../LinearAlgebra/Matrix/Charpoly/Coeff.lean | 1 + .../Matrix/FixedDetMatrices.lean | 1 + .../LinearAlgebra/Matrix/SchurComplement.lean | 1 + Mathlib/LinearAlgebra/Multilinear/Basic.lean | 4 - .../RootSystem/GeckConstruction/Basic.lean | 1 + Mathlib/LinearAlgebra/SesquilinearForm.lean | 10 ++ Mathlib/LinearAlgebra/SymplecticGroup.lean | 4 + .../Function/LpSeminorm/LpNorm.lean | 2 + .../Group/GeometryOfNumbers.lean | 3 +- .../Measure/Decomposition/Lebesgue.lean | 12 +++ .../MeasureTheory/Measure/FiniteMeasure.lean | 1 + .../MeasureTheory/Measure/Haar/Unique.lean | 1 + Mathlib/MeasureTheory/Measure/Hausdorff.lean | 2 + .../Measure/Typeclasses/Finite.lean | 1 + .../Measure/Typeclasses/Probability.lean | 1 + .../ArithmeticFunction/LFunction.lean | 1 + .../NumberTheory/Cyclotomic/Discriminant.lean | 5 +- .../NumberTheory/Cyclotomic/Embeddings.lean | 8 ++ Mathlib/NumberTheory/Cyclotomic/PID.lean | 9 ++ Mathlib/NumberTheory/Cyclotomic/Rat.lean | 9 ++ Mathlib/NumberTheory/Cyclotomic/Three.lean | 9 ++ Mathlib/NumberTheory/Harmonic/GammaDeriv.lean | 2 +- .../NumberTheory/NumberField/Completion.lean | 7 ++ .../NumberField/InfinitePlace/Basic.lean | 1 + Mathlib/NumberTheory/ZetaValues.lean | 3 +- Mathlib/Order/CompleteBooleanAlgebra.lean | 1 - .../Distributions/SetBernoulli.lean | 2 + .../RingTheory/AdicCompletion/LocalRing.lean | 70 ++++++++++++-- Mathlib/RingTheory/Artinian/Module.lean | 41 +++----- Mathlib/RingTheory/Extension/Generators.lean | 1 + Mathlib/RingTheory/Flat/Rank.lean | 1 + Mathlib/RingTheory/Jacobson/Ring.lean | 6 +- .../MvPowerSeries/Substitution.lean | 1 + Mathlib/RingTheory/Nilpotent/Exp.lean | 3 +- .../RingTheory/Spectrum/Maximal/Basic.lean | 4 - .../RingTheory/Spectrum/Prime/Topology.lean | 6 ++ Mathlib/Tactic/NormNum/Prime.lean | 4 +- Mathlib/Tactic/Translate/Core.lean | 5 +- Mathlib/Topology/AlexandrovDiscrete.lean | 1 + Mathlib/Topology/Algebra/Constructions.lean | 1 + .../Topology/Algebra/Group/GroupTopology.lean | 1 + .../Topology/Algebra/Module/LinearMap.lean | 13 +-- .../Algebra/Module/Multilinear/Basic.lean | 4 - .../RestrictedProduct/TopologicalSpace.lean | 1 + .../Category/TopCat/Limits/Basic.lean | 2 + Mathlib/Topology/Category/TopCat/Opens.lean | 2 + Mathlib/Topology/Category/TopCat/ULift.lean | 1 + .../Compactness/CompactlyGeneratedSpace.lean | 1 + .../Compactness/DeltaGeneratedSpace.lean | 1 + Mathlib/Topology/Constructions.lean | 1 + Mathlib/Topology/ContinuousMap/Ideals.lean | 1 + .../Topology/ContinuousMap/T0Sierpinski.lean | 1 + Mathlib/Topology/LocalAtTarget.lean | 1 + Mathlib/Topology/MetricSpace/Polish.lean | 1 + Mathlib/Topology/NoetherianSpace.lean | 2 + Mathlib/Topology/Order.lean | 13 +++ Mathlib/Topology/Sets/OpenCover.lean | 4 + Mathlib/Topology/Sheaves/CommRingCat.lean | 1 + Mathlib/Topology/Sheaves/MayerVietoris.lean | 1 + Mathlib/Topology/Sheaves/PUnit.lean | 1 + Mathlib/Topology/Sheaves/Points.lean | 2 + .../Sheaves/SheafCondition/OpensLeCover.lean | 1 + .../SheafCondition/PairwiseIntersections.lean | 3 + .../Sheaves/SheafCondition/Sites.lean | 1 + .../Sheaves/SheafCondition/UniqueGluing.lean | 1 + Mathlib/Topology/Spectral/Prespectral.lean | 1 + 211 files changed, 842 insertions(+), 231 deletions(-) create mode 100644 Mathlib/Algebra/ArithmeticGeometric.lean create mode 100644 Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean create mode 100644 Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean create mode 100644 Mathlib/Analysis/NormedSpace/Extend.lean create mode 100644 Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean create mode 100644 Mathlib/CategoryTheory/Bicategory/Strict.lean create mode 100644 Mathlib/Data/Nat/PowModTotient.lean create mode 100644 Mathlib/Data/Real/Irrational.lean create mode 100644 Mathlib/Deprecated/Sort.lean create mode 100644 Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean create mode 100644 Mathlib/LinearAlgebra/SesquilinearForm.lean create mode 100644 Mathlib/NumberTheory/Cyclotomic/Embeddings.lean create mode 100644 Mathlib/NumberTheory/Cyclotomic/PID.lean create mode 100644 Mathlib/NumberTheory/Cyclotomic/Rat.lean create mode 100644 Mathlib/NumberTheory/Cyclotomic/Three.lean create mode 100644 Mathlib/NumberTheory/NumberField/Completion.lean diff --git a/Archive/Imo/Imo1962Q1.lean b/Archive/Imo/Imo1962Q1.lean index a2af69b60fc5db..fac8ebd6533e12 100644 --- a/Archive/Imo/Imo1962Q1.lean +++ b/Archive/Imo/Imo1962Q1.lean @@ -105,7 +105,9 @@ lemma case_more_digits {c n : ℕ} (hc : (digits 10 c).length ≥ 6) (hpp : Prob Now we combine these cases to show that 153846 is the smallest solution. -/ -lemma satisfied_by_153846 : ProblemPredicate 153846 := by simp +decide [ProblemPredicate] +lemma satisfied_by_153846 : ProblemPredicate 153846 := by + norm_num [ProblemPredicate] + decide lemma no_smaller_solutions (n : ℕ) (hn : ProblemPredicate n) : n ≥ 153846 := by have ⟨c, hcn⟩ := without_digits hn diff --git a/Archive/Imo/Imo1962Q4.lean b/Archive/Imo/Imo1962Q4.lean index 82fbe1939e0283..4bf3c118bd02e1 100644 --- a/Archive/Imo/Imo1962Q4.lean +++ b/Archive/Imo/Imo1962Q4.lean @@ -59,7 +59,8 @@ Now we can solve for `x` using basic-ish trigonometry. -/ theorem solve_cos2_half {x : ℝ} : cos x ^ 2 = 1 / 2 ↔ ∃ k : ℤ, x = (2 * ↑k + 1) * π / 4 := by rw [cos_sq] - simp only [add_eq_left, div_eq_zero_iff, OfNat.ofNat_ne_zero, or_false] + simp only [add_eq_left, div_eq_zero_iff] + norm_num rw [cos_eq_zero_iff] constructor <;> · rintro ⟨k, h⟩ diff --git a/Archive/Imo/Imo2019Q4.lean b/Archive/Imo/Imo2019Q4.lean index 653d7ab691f109..de9e6e56811471 100644 --- a/Archive/Imo/Imo2019Q4.lean +++ b/Archive/Imo/Imo2019Q4.lean @@ -75,7 +75,6 @@ theorem upper_bound {k n : ℕ} (hk : k > 0) end Imo2019Q4 -set_option linter.flexible false in -- TODO: fix non-terminal simp theorem imo2019_q4 {k n : ℕ} (hk : 0 < k) (hn : 0 < n) : (k ! : ℤ) = ∏ i ∈ range n, ((2 : ℤ) ^ n - (2 : ℤ) ^ i) ↔ (k, n) = (1, 1) ∨ (k, n) = (3, 2) := by -- The implication `←` holds. @@ -91,7 +90,7 @@ theorem imo2019_q4 {k n : ℕ} (hk : 0 < k) (hn : 0 < n) : -- n = 2 · right; congr; norm_num [prod_range_succ] at h; norm_cast at h; rwa [← factorial_inj'] norm_num - all_goals exfalso; simp [prod_range_succ] at h; norm_cast at h + all_goals exfalso; norm_num [prod_range_succ] at h; norm_cast at h -- n = 3 · refine monotone_factorial.ne_of_lt_of_lt_nat 5 ?_ ?_ _ h <;> decide -- n = 4 diff --git a/Archive/OxfordInvariants/Summer2021/Week3P1.lean b/Archive/OxfordInvariants/Summer2021/Week3P1.lean index 40e5284282b69e..8738e6d536e1f2 100644 --- a/Archive/OxfordInvariants/Summer2021/Week3P1.lean +++ b/Archive/OxfordInvariants/Summer2021/Week3P1.lean @@ -95,7 +95,9 @@ theorem OxfordInvariants.Week3P1 (n : ℕ) (a : ℕ → ℕ) (a_pos : ∀ i ≤ Claim that the sum equals `1` -/ refine ⟨1, ?_, ?_⟩ -- Check that this indeed equals the sum - · rw [Nat.cast_one, Finset.sum_range_one, zero_add, div_self] + · rw [Nat.cast_one, Finset.sum_range_one] + norm_num + rw [div_self] exact (mul_pos (a_pos 0 (Nat.zero_le _)) (a_pos 1 (Nat.zero_lt_succ _))).ne' -- Check the divisibility condition · rw [mul_one, tsub_self] diff --git a/Mathlib.lean b/Mathlib.lean index 2cd2bf5ca6d5cc..b24cfc4d0f2227 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -52,6 +52,7 @@ public import Mathlib.Algebra.Algebra.TransferInstance public import Mathlib.Algebra.Algebra.Unitization public import Mathlib.Algebra.Algebra.ZMod public import Mathlib.Algebra.AlgebraicCard +public import Mathlib.Algebra.ArithmeticGeometric public import Mathlib.Algebra.Azumaya.Basic public import Mathlib.Algebra.Azumaya.Defs public import Mathlib.Algebra.Azumaya.Matrix @@ -1951,6 +1952,7 @@ public import Mathlib.Analysis.InnerProductSpace.Dual public import Mathlib.Analysis.InnerProductSpace.EuclideanDist public import Mathlib.Analysis.InnerProductSpace.GramMatrix public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho +public import Mathlib.Analysis.InnerProductSpace.Harmonic.Analytic public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic public import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions public import Mathlib.Analysis.InnerProductSpace.Harmonic.HarmonicContOnCl @@ -2184,8 +2186,10 @@ public import Mathlib.Analysis.Normed.Unbundled.SpectralNorm public import Mathlib.Analysis.NormedSpace.Alternating.Basic public import Mathlib.Analysis.NormedSpace.Alternating.Curry public import Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin +public import Mathlib.Analysis.NormedSpace.ConformalLinearMap public import Mathlib.Analysis.NormedSpace.Connected public import Mathlib.Analysis.NormedSpace.ENormedSpace +public import Mathlib.Analysis.NormedSpace.Extend public import Mathlib.Analysis.NormedSpace.Extr public import Mathlib.Analysis.NormedSpace.HahnBanach.Extension public import Mathlib.Analysis.NormedSpace.HahnBanach.SeparatingDual @@ -2448,6 +2452,7 @@ public import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete public import Mathlib.CategoryTheory.Bicategory.Functor.Oplax public import Mathlib.CategoryTheory.Bicategory.Functor.Prelax public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor +public import Mathlib.CategoryTheory.Bicategory.Functor.Strict public import Mathlib.CategoryTheory.Bicategory.Functor.StrictPseudofunctor public import Mathlib.CategoryTheory.Bicategory.Functor.StrictlyUnitary public import Mathlib.CategoryTheory.Bicategory.FunctorBicategory.Lax @@ -2470,6 +2475,7 @@ public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Pseudo public import Mathlib.CategoryTheory.Bicategory.Opposites public import Mathlib.CategoryTheory.Bicategory.Product public import Mathlib.CategoryTheory.Bicategory.SingleObj +public import Mathlib.CategoryTheory.Bicategory.Strict public import Mathlib.CategoryTheory.Bicategory.Strict.Basic public import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor public import Mathlib.CategoryTheory.Bicategory.Yoneda @@ -4075,6 +4081,7 @@ public import Mathlib.Data.Nat.Order.Lemmas public import Mathlib.Data.Nat.PSub public import Mathlib.Data.Nat.Pairing public import Mathlib.Data.Nat.Periodic +public import Mathlib.Data.Nat.PowModTotient public import Mathlib.Data.Nat.Prime.Basic public import Mathlib.Data.Nat.Prime.Defs public import Mathlib.Data.Nat.Prime.Factorial @@ -4163,6 +4170,7 @@ public import Mathlib.Data.Real.ConjExponents public import Mathlib.Data.Real.ENatENNReal public import Mathlib.Data.Real.Embedding public import Mathlib.Data.Real.Hom +public import Mathlib.Data.Real.Irrational public import Mathlib.Data.Real.Pointwise public import Mathlib.Data.Real.Sign public import Mathlib.Data.Real.Sqrt @@ -4292,6 +4300,7 @@ public import Mathlib.Data.ZMod.QuotientRing public import Mathlib.Data.ZMod.Units public import Mathlib.Data.ZMod.ValMinAbs public import Mathlib.Deprecated.Aliases +public import Mathlib.Deprecated.Sort public import Mathlib.Dynamics.BirkhoffSum.Average public import Mathlib.Dynamics.BirkhoffSum.Basic public import Mathlib.Dynamics.BirkhoffSum.NormedSpace @@ -4743,6 +4752,7 @@ public import Mathlib.LinearAlgebra.AffineSpace.Basis public import Mathlib.LinearAlgebra.AffineSpace.Centroid public import Mathlib.LinearAlgebra.AffineSpace.Ceva public import Mathlib.LinearAlgebra.AffineSpace.Combination +public import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv public import Mathlib.LinearAlgebra.AffineSpace.Defs public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional public import Mathlib.LinearAlgebra.AffineSpace.Independent @@ -5043,6 +5053,7 @@ public import Mathlib.LinearAlgebra.SModEq.Basic public import Mathlib.LinearAlgebra.SModEq.Pointwise public import Mathlib.LinearAlgebra.SModEq.Pow public import Mathlib.LinearAlgebra.Semisimple +public import Mathlib.LinearAlgebra.SesquilinearForm public import Mathlib.LinearAlgebra.SesquilinearForm.Basic public import Mathlib.LinearAlgebra.SesquilinearForm.Star public import Mathlib.LinearAlgebra.Span.Basic @@ -5503,8 +5514,12 @@ public import Mathlib.NumberTheory.ClassNumber.FunctionField public import Mathlib.NumberTheory.Cyclotomic.Basic public import Mathlib.NumberTheory.Cyclotomic.CyclotomicCharacter public import Mathlib.NumberTheory.Cyclotomic.Discriminant +public import Mathlib.NumberTheory.Cyclotomic.Embeddings public import Mathlib.NumberTheory.Cyclotomic.Gal +public import Mathlib.NumberTheory.Cyclotomic.PID public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots +public import Mathlib.NumberTheory.Cyclotomic.Rat +public import Mathlib.NumberTheory.Cyclotomic.Three public import Mathlib.NumberTheory.Dioph public import Mathlib.NumberTheory.DiophantineApproximation.Basic public import Mathlib.NumberTheory.DiophantineApproximation.ContinuedFractions @@ -5622,6 +5637,7 @@ public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCon public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.PolarCoord public import Mathlib.NumberTheory.NumberField.ClassNumber +public import Mathlib.NumberTheory.NumberField.Completion public import Mathlib.NumberTheory.NumberField.Completion.FinitePlace public import Mathlib.NumberTheory.NumberField.Completion.InfinitePlace public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic diff --git a/Mathlib/Algebra/ArithmeticGeometric.lean b/Mathlib/Algebra/ArithmeticGeometric.lean new file mode 100644 index 00000000000000..dbdbfcf009a3b3 --- /dev/null +++ b/Mathlib/Algebra/ArithmeticGeometric.lean @@ -0,0 +1,8 @@ +module -- shake: keep-all + +public import Mathlib.Algebra.Order.Module.Field +public import Mathlib.Data.EReal.Inv +public import Mathlib.Topology.Algebra.InfiniteSum.Order +public import Mathlib.Topology.MetricSpace.Bounded + +deprecated_module (since := "2025-09-17") diff --git a/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean index dfaf716fa6de94..d6a77cc877f003 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean @@ -369,6 +369,7 @@ def withModuleTopologyAdj : withModuleTopology R ⊣ forget₂ (TopModuleCat R) instance : (forget₂ (TopModuleCat R) (ModuleCat R)).IsRightAdjoint := ⟨_, ⟨withModuleTopologyAdj R⟩⟩ instance : (withModuleTopology R).IsLeftAdjoint := ⟨_, ⟨withModuleTopologyAdj R⟩⟩ +set_option backward.isDefEq.respectTransparency false in /-- The functor equipping a module with the indiscrete topology. This is right adjoint to the forgetful functor. -/ def indiscrete : ModuleCat.{v} R ⥤ TopModuleCat.{v} R where @@ -383,6 +384,7 @@ def indiscrete : ModuleCat.{v} R ⥤ TopModuleCat.{v} R where ConcreteCategory.ofHom (C := TopModuleCat R) ⟨f.hom, by rw [continuous_iff_coinduced_le]; exact le_top⟩ +set_option backward.isDefEq.respectTransparency false in /-- The adjunction between the forgetful functor and the indiscrete topology functor. -/ def indiscreteAdj : forget₂ (TopModuleCat.{v} R) (ModuleCat.{v} R) ⊣ indiscrete.{v} R where counit := 𝟙 _ diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean index 5113b5c5311b34..b91944017e2a75 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean @@ -264,6 +264,7 @@ lemma singleFunctorsPostcompQIso_hom_hom (n : ℤ) : erw [Category.id_comp] rfl +set_option backward.isDefEq.respectTransparency false in lemma singleFunctorsPostcompQIso_inv_hom (n : ℤ) : (singleFunctorsPostcompQIso C).inv.hom n = 𝟙 _ := by ext X diff --git a/Mathlib/Algebra/Lie/Abelian.lean b/Mathlib/Algebra/Lie/Abelian.lean index 4d0b6d5f4c5ba1..00ab6cd7c847c1 100644 --- a/Mathlib/Algebra/Lie/Abelian.lean +++ b/Mathlib/Algebra/Lie/Abelian.lean @@ -143,6 +143,7 @@ protected theorem mem_ker (x : L) : x ∈ LieModule.ker R L M ↔ ∀ m : M, ⁅ simp only [LieModule.ker, LieHom.mem_ker, LinearMap.ext_iff, LinearMap.zero_apply, toEnd_apply_apply] +set_option backward.isDefEq.respectTransparency false in lemma _root_.LieIdeal.isLieAbelian_iff {I : LieIdeal R L} : IsLieAbelian I ↔ I ≤ LieModule.ker R L I := by refine ⟨fun hI x hx ↦ LieHom.mem_ker.mpr ?_, fun h ↦ ⟨fun ⟨x, hx⟩ ⟨y, hy⟩ ↦ ?_⟩⟩ diff --git a/Mathlib/Algebra/Lie/Classical.lean b/Mathlib/Algebra/Lie/Classical.lean index 187f88e27ac47f..7801f11fc75b2a 100644 --- a/Mathlib/Algebra/Lie/Classical.lean +++ b/Mathlib/Algebra/Lie/Classical.lean @@ -276,6 +276,7 @@ theorem jd_transform [Fintype l] : (PD l R)ᵀ * JD l R * PD l R = (2 : R) • S rw [h, PD, s_as_blocks, Matrix.fromBlocks_multiply, Matrix.fromBlocks_smul] simp [two_smul] +set_option backward.isDefEq.respectTransparency false in theorem pd_inv [Fintype l] [Invertible (2 : R)] : PD l R * ⅟(2 : R) • (PD l R)ᵀ = 1 := by rw [PD, Matrix.fromBlocks_transpose, Matrix.fromBlocks_smul, Matrix.fromBlocks_multiply] diff --git a/Mathlib/Algebra/Lie/Extension.lean b/Mathlib/Algebra/Lie/Extension.lean index c039d3d598dfd3..85c91ade1fe3df 100644 --- a/Mathlib/Algebra/Lie/Extension.lean +++ b/Mathlib/Algebra/Lie/Extension.lean @@ -319,6 +319,7 @@ noncomputable def toKer (E : Extension R M L) : instance [IsLieAbelian M] (E : Extension R M L) : IsLieAbelian E.proj.ker := (lie_abelian_iff_equiv_lie_abelian E.toKer.symm).mpr inferInstance +set_option backward.isDefEq.respectTransparency false in /-- 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. -/ @@ -338,6 +339,7 @@ noncomputable def ringModuleOf [IsLieAbelian M] (E : Extension R M L) : LieRingM rw [← map_add, EquivLike.apply_eq_iff_eq, LieEquiv.apply_symm_apply, LieEquiv.apply_symm_apply, leibniz_lie, aux] +set_option backward.isDefEq.respectTransparency false in lemma ringModuleOf_bracket_proj [IsLieAbelian M] (E : Extension R M L) (y : M) (z : E.L) : letI := E.ringModuleOf ⁅E.proj z, y⁆ = E.toKer.symm ⁅z, E.toKer y⁆ := by @@ -349,6 +351,7 @@ lemma ringModuleOf_bracket_proj [IsLieAbelian M] (E : Extension R M L) (y : M) ( Subtype.ext_iff, LieSubmodule.coe_bracket, lie_toKer_apply, ZeroMemClass.coe_zero, ← hx, LieHom.coe_toLinearMap, ← LieHom.map_lie, trivial_lie_zero M M x y, map_zero] +set_option backward.isDefEq.respectTransparency false in /-- Given an extension of `L` by `M` whose kernel `M` is abelian, the kernel `M` gets an `R`-linear `L`-module structure. We do not make this an instance, because we may have to work with more than one extension. -/ @@ -369,12 +372,14 @@ lemma toKer_bracket [IsLieAbelian M] (E : Extension R M L) (x : E.proj.ker) (y : E.toKer ⁅y, E.toKer.symm x⁆ = ⁅E.proj_surjective.hasRightInverse.choose y, x⁆ := by simp +set_option backward.isDefEq.respectTransparency false in lemma lie_apply_proj_of_leftInverse_eq [IsLieAbelian M] (E : Extension R M L) {s : L →ₗ[R] E.L} (hs : LeftInverse E.proj s) (x : E.L) (y : E.proj.ker) : ⁅s (E.proj x), y⁆ = ⁅x, y⁆ := by rw [← sub_eq_zero, ← sub_lie] exact trivial_lie_zero E.proj.ker E.proj.ker ⟨_, (by simp [hs.eq])⟩ y +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in /-- A preparatory function for making a 2-cocycle from a linear splitting of an extension. -/ private abbrev twoCocycleAux (E : Extension R M L) {s : L →ₗ[R] E.L} @@ -387,6 +392,7 @@ private abbrev twoCocycleAux (E : Extension R M L) {s : L →ₗ[R] E.L} map_add' x y := by ext; simp; abel map_smul' _ _ := by ext; simp [smul_sub] +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- The 2-cocycle attached to an extension with a linear section. -/ @@ -421,6 +427,7 @@ noncomputable def twoCocycleOf [IsLieAbelian M] (E : Extension R M L) {s : L → sub_add_cancel_right, map_add, neg_add_rev] abel_nf +set_option backward.isDefEq.respectTransparency false in /-- The 1-cochain attached to a pair of splittings of an extension. -/ @[simps] noncomputable def oneCochainOfTwoSplitting (E : Extension R M L) {s₁ s₂ : L →ₗ[R] E.L} @@ -435,6 +442,7 @@ noncomputable def oneCochainOfTwoSplitting (E : Extension R M L) {s₁ s₂ : L rw [RingHom.id_apply, ← map_smul, EquivLike.apply_eq_iff_eq, SetLike.mk_smul_of_tower_mk, Subtype.mk_eq_mk, LinearMap.map_smul_of_tower, smul_sub, LinearMap.map_smul_of_tower] +set_option backward.isDefEq.respectTransparency false in lemma d₁₂_oneCochainOfTwoSplitting [IsLieAbelian M] (E : Extension R M L) {s₁ s₂ : L →ₗ[R] E.L} (hs₁ : LeftInverse E.proj s₁) (hs₂ : LeftInverse E.proj s₂) : letI := E.ringModuleOf diff --git a/Mathlib/Algebra/Lie/Ideal.lean b/Mathlib/Algebra/Lie/Ideal.lean index c7bdf292d59f00..f127d8f4d03f53 100644 --- a/Mathlib/Algebra/Lie/Ideal.lean +++ b/Mathlib/Algebra/Lie/Ideal.lean @@ -450,6 +450,7 @@ lemma incl_injective (I : LieIdeal R L) : Function.Injective I.incl := @[simp] theorem comap_incl_self : comap I.incl I = ⊤ := by ext; simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem ker_incl : I.incl.ker = ⊥ := by ext; simp @@ -466,12 +467,14 @@ theorem incl_isIdealMorphism : I.incl.IsIdealMorphism := by variable {I} +set_option backward.isDefEq.respectTransparency false in @[simp] theorem comap_incl_eq_top : I₂.comap I.incl = ⊤ ↔ I ≤ I₂ := by rw [← LieSubmodule.toSubmodule_inj, LieIdeal.comap_toSubmodule, LieSubmodule.top_toSubmodule, incl_coe] simp_rw [toLieSubalgebra_toSubmodule] rw [Submodule.comap_subtype_eq_top, LieSubmodule.toSubmodule_le_toSubmodule] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem comap_incl_eq_bot : I₂.comap I.incl = ⊥ ↔ Disjoint I I₂ := by rw [disjoint_iff, ← LieSubmodule.toSubmodule_inj, LieIdeal.comap_toSubmodule, LieSubmodule.bot_toSubmodule, ← LieSubmodule.toSubmodule_inj, LieSubmodule.inf_toSubmodule, diff --git a/Mathlib/Algebra/Lie/Killing.lean b/Mathlib/Algebra/Lie/Killing.lean index 5b6e21ed72a0d0..2f9344549acd3e 100644 --- a/Mathlib/Algebra/Lie/Killing.lean +++ b/Mathlib/Algebra/Lie/Killing.lean @@ -71,6 +71,7 @@ lemma killingForm_nondegenerate : refine (LieModule.traceForm_isSymm R L L).isRefl.nondegenerate_iff_separatingLeft.mpr ?_ simp [LinearMap.separatingLeft_iff_ker_eq_bot] +set_option backward.isDefEq.respectTransparency false in variable {R L} in lemma ideal_eq_bot_of_isLieAbelian [Module.Free R L] [Module.Finite R L] [IsDomain R] [IsPrincipalIdealRing R] @@ -78,6 +79,7 @@ lemma ideal_eq_bot_of_isLieAbelian rw [eq_bot_iff, ← killingCompl_top_eq_bot] exact I.le_killingCompl_top_of_isLieAbelian +set_option backward.isDefEq.respectTransparency false in instance instSemisimple [IsKilling K L] [Module.Finite K L] : IsSemisimple K L := by apply InvariantForm.isSemisimple_of_nondegenerate (Φ := killingForm K L) · exact IsKilling.killingForm_nondegenerate _ _ @@ -140,6 +142,7 @@ end LieEquiv end LieAlgebra +set_option backward.isDefEq.respectTransparency false in open LieAlgebra in variable {K L} in lemma LieIdeal.isCompl_killingCompl [IsKilling K L] [Module.Finite K L] (I : LieIdeal K L) : diff --git a/Mathlib/Algebra/Lie/LieTheorem.lean b/Mathlib/Algebra/Lie/LieTheorem.lean index 36f81c5494f71f..79ed22d2228b67 100644 --- a/Mathlib/Algebra/Lie/LieTheorem.lean +++ b/Mathlib/Algebra/Lie/LieTheorem.lean @@ -206,6 +206,7 @@ variable [Nontrivial V] open LieAlgebra +set_option backward.isDefEq.respectTransparency false in -- This lemma is the central inductive argument in the proof of Lie's theorem below. -- The statement is identical to `LieModule.exists_forall_lie_eq_smul_of_isSolvable` -- except that it additionally assumes a finiteness hypothesis. diff --git a/Mathlib/Algebra/Lie/Nilpotent.lean b/Mathlib/Algebra/Lie/Nilpotent.lean index 45dc61da8b14e4..cab53cfc052ddf 100644 --- a/Mathlib/Algebra/Lie/Nilpotent.lean +++ b/Mathlib/Algebra/Lie/Nilpotent.lean @@ -788,6 +788,7 @@ theorem coe_lowerCentralSeries_ideal_quot_eq {I : LieIdeal R L} (k : ℕ) : rw [← LieSubmodule.mem_toSubmodule, ← ih, LieSubmodule.mem_toSubmodule] at hz exact ⟨⟨y, LieSubmodule.mem_top _⟩, ⟨z, hz⟩, rfl⟩ +set_option backward.isDefEq.respectTransparency false in /-- Note that the below inequality can be strict. For example the ideal of strictly-upper-triangular 2x2 matrices inside the Lie algebra of upper-triangular 2x2 matrices with `k = 1`. -/ -- Porting note: added `LieSubmodule.toSubmodule` in the statement @@ -913,6 +914,7 @@ theorem coe_lcs_eq [LieModule R L M] : true_and, (I : LieSubalgebra R L).coe_bracket_of_module] simp +set_option backward.isDefEq.respectTransparency false in instance [IsNilpotent L I] : LieRing.IsNilpotent I := by let f : I →ₗ⁅R⁆ L := I.incl let g : I →ₗ⁅R⁆ I := LieHom.id @@ -956,17 +958,21 @@ variable [CommRing R] [LieRing L] [LieAlgebra R L] `L` under the adjoint action. -/ def maxNilpotentIdeal := maxNilpotentSubmodule R L L +set_option backward.isDefEq.respectTransparency false in instance maxNilpotentIdealIsNilpotent [IsNoetherian R L] : IsNilpotent L (maxNilpotentIdeal R L) := instMaxNilpotentSubmoduleIsNilpotent R L L +set_option backward.isDefEq.respectTransparency false in theorem LieIdeal.isNilpotent_iff_le_maxNilpotentIdeal [IsNoetherian R L] (I : LieIdeal R L) : IsNilpotent L I ↔ I ≤ maxNilpotentIdeal R L := isNilpotent_iff_le_maxNilpotentSubmodule R L L I +set_option backward.isDefEq.respectTransparency false in theorem center_le_maxNilpotentIdeal : center R L ≤ maxNilpotentIdeal R L := le_sSup (trivialIsNilpotent L (center R L)) +set_option backward.isDefEq.respectTransparency false in theorem maxNilpotentIdeal_le_radical : maxNilpotentIdeal R L ≤ radical R L := sSup_le_sSup fun I (_ : IsNilpotent L I) ↦ isSolvable_of_isNilpotent I diff --git a/Mathlib/Algebra/Lie/Semisimple/Basic.lean b/Mathlib/Algebra/Lie/Semisimple/Basic.lean index ca03a9c20385d5..991c6fb46004d3 100644 --- a/Mathlib/Algebra/Lie/Semisimple/Basic.lean +++ b/Mathlib/Algebra/Lie/Semisimple/Basic.lean @@ -279,6 +279,7 @@ noncomputable instance (priority := 100) instBooleanAlgebra : BooleanAlgebra (LieIdeal R L) := (booleanGenerators R L).booleanAlgebra_of_sSup_eq_top sSup_atoms_eq_top +set_option backward.isDefEq.respectTransparency false in /-- A semisimple Lie algebra has trivial radical. -/ instance (priority := 100) instHasTrivialRadical : HasTrivialRadical R L := by rw [hasTrivialRadical_iff_no_abelian_ideals] diff --git a/Mathlib/Algebra/Lie/TensorProduct.lean b/Mathlib/Algebra/Lie/TensorProduct.lean index 0e93db76c1bb43..341e1c5ac4bf18 100644 --- a/Mathlib/Algebra/Lie/TensorProduct.lean +++ b/Mathlib/Algebra/Lie/TensorProduct.lean @@ -187,6 +187,7 @@ variable [LieRing L] [LieAlgebra R L] variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] variable (I : LieIdeal R L) (N : LieSubmodule R L M) +set_option backward.isDefEq.respectTransparency false in /-- A useful alternative characterisation of Lie ideal operations on Lie submodules. Given a Lie ideal `I ⊆ L` and a Lie submodule `N ⊆ M`, by tensoring the inclusion maps and then diff --git a/Mathlib/Algebra/Lie/TraceForm.lean b/Mathlib/Algebra/Lie/TraceForm.lean index 8230f5a6ccf8e1..21dfe6219bdb0b 100644 --- a/Mathlib/Algebra/Lie/TraceForm.lean +++ b/Mathlib/Algebra/Lie/TraceForm.lean @@ -387,6 +387,7 @@ lemma killingForm_eq : killingForm R I = (killingForm R L).restrict I := LieSubmodule.traceForm_eq_of_le_idealizer I I <| by simp +set_option backward.isDefEq.respectTransparency false in @[simp] lemma le_killingCompl_top_of_isLieAbelian [IsLieAbelian I] : I ≤ LieIdeal.killingCompl R L ⊤ := by intro x (hx : x ∈ I) diff --git a/Mathlib/Algebra/Module/LinearMap/Defs.lean b/Mathlib/Algebra/Module/LinearMap/Defs.lean index 6c5fd23457c978..5a80c98d719e03 100644 --- a/Mathlib/Algebra/Module/LinearMap/Defs.lean +++ b/Mathlib/Algebra/Module/LinearMap/Defs.lean @@ -840,12 +840,8 @@ theorem comp_add (f g : M →ₛₗ[σ₁₂] M₂) (h : M₂ →ₛₗ[σ₂₃ (h.comp (f + g) : M →ₛₗ[σ₁₃] M₃) = h.comp f + h.comp g := ext fun _ ↦ h.map_add _ _ --- The `AddMonoid` instance exists to help speedup unification -instance addMonoid : AddMonoid (M →ₛₗ[σ₁₂] M₂) := fast_instance% - DFunLike.coe_injective.addMonoid _ rfl (fun _ _ ↦ rfl) fun _ _ ↦ rfl - /-- The type of linear maps is an additive monoid. -/ -instance addCommMonoid : AddCommMonoid (M →ₛₗ[σ₁₂] M₂) := fast_instance% +instance addCommMonoid : AddCommMonoid (M →ₛₗ[σ₁₂] M₂) := DFunLike.coe_injective.addCommMonoid _ rfl (fun _ _ ↦ rfl) fun _ _ ↦ rfl /-- The negation of a linear map is linear. -/ @@ -889,7 +885,7 @@ theorem comp_sub (f g : M →ₛₗ[σ₁₂] N₂) (h : N₂ →ₛₗ[σ₂₃ ext fun _ ↦ h.map_sub _ _ /-- The type of linear maps is an additive group. -/ -instance addCommGroup : AddCommGroup (M →ₛₗ[σ₁₂] N₂) := fast_instance% +instance addCommGroup : AddCommGroup (M →ₛₗ[σ₁₂] N₂) := DFunLike.coe_injective.addCommGroup _ rfl (fun _ _ ↦ rfl) (fun _ ↦ rfl) (fun _ _ ↦ rfl) (fun _ _ ↦ rfl) fun _ _ ↦ rfl diff --git a/Mathlib/Algebra/MvPolynomial/Eval.lean b/Mathlib/Algebra/MvPolynomial/Eval.lean index f26569ae329f9d..f972ab97852bc2 100644 --- a/Mathlib/Algebra/MvPolynomial/Eval.lean +++ b/Mathlib/Algebra/MvPolynomial/Eval.lean @@ -344,6 +344,7 @@ theorem map_id : ∀ p : MvPolynomial σ R, map (RingHom.id R) p = p := AddMonoi theorem map_map [CommSemiring S₂] (g : S₁ →+* S₂) (p : MvPolynomial σ R) : map g (map f p) = map (g.comp f) p := AddMonoidAlgebra.map_map .. +set_option backward.isDefEq.respectTransparency false in theorem eval₂_eq_eval_map (g : σ → S₁) (p : MvPolynomial σ R) : p.eval₂ f g = eval g (map f p) := by simp [eval₂, eval]; simp [map, MvPolynomial, Finsupp.sum_mapRange_index, mapRingHom] diff --git a/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean b/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean index 5949040d22d7ec..1dda887242ce50 100644 --- a/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean +++ b/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean @@ -77,6 +77,7 @@ lemma degrees_mul_eq (hp : p ≠ 0) (hq : q ≠ 0) : end Degrees +set_option backward.isDefEq.respectTransparency false in theorem totalDegree_mul_of_isDomain {f g : MvPolynomial σ R} (hf : f ≠ 0) (hg : g ≠ 0) : totalDegree (f * g) = totalDegree f + totalDegree g := by diff --git a/Mathlib/Algebra/Ring/BooleanRing.lean b/Mathlib/Algebra/Ring/BooleanRing.lean index dcce2efdba5ba0..98c5eed4cfbfe8 100644 --- a/Mathlib/Algebra/Ring/BooleanRing.lean +++ b/Mathlib/Algebra/Ring/BooleanRing.lean @@ -205,7 +205,6 @@ theorem le_sup_inf (a b c : α) : (a ⊔ b) ⊓ (a ⊔ c) ⊔ (a ⊔ b ⊓ c) = dsimp only [(· ⊔ ·), (· ⊓ ·)] rw [le_sup_inf_aux, add_self, mul_self, zero_add] -set_option linter.flexible false in -- TODO: fix non-terminal simp /-- The Boolean algebra structure on a Boolean ring. The data is defined so that: @@ -233,7 +232,7 @@ def toBooleanAlgebra : BooleanAlgebra α := change 1 + (a + (1 + a) + a * (1 + a)) + 1 * (a + (1 + a) + a * (1 + a)) = a + (1 + a) + a * (1 + a) - simp [mul_add, mul_self, add_self] + norm_num [mul_add, mul_self, add_self] rw [← add_assoc, add_self] } scoped[BooleanAlgebraOfBooleanRing] attribute [instance 100] BooleanRing.toBooleanAlgebra diff --git a/Mathlib/AlgebraicGeometry/AffineScheme.lean b/Mathlib/AlgebraicGeometry/AffineScheme.lean index 1a164f6577c345..52504eb4d26076 100644 --- a/Mathlib/AlgebraicGeometry/AffineScheme.lean +++ b/Mathlib/AlgebraicGeometry/AffineScheme.lean @@ -447,6 +447,7 @@ theorem range_fromSpec : rw [← TopCat.coe_comp, ← TopCat.epi_iff_surjective] infer_instance +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma fromSpec_toSpecΓ {X : Scheme} {U : X.Opens} (hU : IsAffineOpen U) : hU.fromSpec ≫ X.toSpecΓ = Spec.map (X.presheaf.map (homOfLE le_top).op) := by @@ -565,6 +566,7 @@ theorem fromSpec_preimage_self : hU.fromSpec ⁻¹ᵁ U = ⊤ := by simp_rw [← hU.opensRange_fromSpec, Scheme.Hom.preimage_opensRange] +set_option backward.isDefEq.respectTransparency false in theorem ΓSpecIso_hom_fromSpec_app : (Scheme.ΓSpecIso Γ(X, U)).hom ≫ hU.fromSpec.app U = (Spec Γ(X, U)).presheaf.map (eqToHom hU.fromSpec_preimage_self).op := by @@ -614,6 +616,7 @@ lemma Spec_basicOpen {R : CommRingCat} (f : R) : instance [IsAffine X] (r : Γ(X, ⊤)) : IsAffine (X.basicOpen r) := (isAffineOpen_top X).basicOpen _ +set_option backward.isDefEq.respectTransparency false in include hU in theorem ι_basicOpen_preimage (r : Γ(X, ⊤)) : IsAffineOpen ((X.basicOpen r).ι ⁻¹ᵁ U) := by @@ -638,6 +641,7 @@ noncomputable instance {R : CommRingCat} {U} : Algebra R Γ(Spec R, U) := inferInstanceAs (Algebra R ((Spec.structureSheaf R).presheaf.obj _)) +set_option backward.isDefEq.respectTransparency false in @[simp] 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 @@ -680,6 +684,7 @@ instance _root_.AlgebraicGeometry.isLocalization_away_of_isAffine IsLocalization.Away r Γ(X, X.basicOpen r) := isLocalization_basicOpen (isAffineOpen_top X) r +set_option backward.isDefEq.respectTransparency false in lemma appLE_eq_away_map {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (hU : IsAffineOpen U) {V : X.Opens} (hV : IsAffineOpen V) (e) (r : Γ(Y, U)) : letI := hU.isLocalization_basicOpen r @@ -937,6 +942,7 @@ theorem iSup_basicOpen_eq_self_iff {s : Set Γ(X, U)} : @[deprecated (since := "2025-10-07")] alias basicOpen_union_eq_self_iff := iSup_basicOpen_eq_self_iff +set_option backward.isDefEq.respectTransparency false in include hU in theorem self_le_iSup_basicOpen_iff {s : Set Γ(X, U)} : (U ≤ ⨆ f : s, X.basicOpen f.1) ↔ Ideal.span s = ⊤ := by @@ -1002,6 +1008,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 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. diff --git a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean index dba7d4e2d58dca..0839481209f75c 100644 --- a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean +++ b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean @@ -252,6 +252,7 @@ lemma toΓSpec_preimage_zeroLocus_eq {X : LocallyRingedSpace.{u}} rw [← PrimeSpectrum.zeroLocus_iUnion₂] simp +set_option backward.isDefEq.respectTransparency 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) diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean b/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean index d3eb8af73b44f4..b2e47dd4ae323f 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean @@ -69,6 +69,7 @@ instance : (geometrically P).IsStableUnderBaseChange := by rw [geometrically_eq_universally] infer_instance +set_option backward.isDefEq.respectTransparency false in instance [P.IsClosedUnderIsomorphisms] : IsZariskiLocalAtTarget (geometrically P) := by rw [geometrically_eq_universally] refine universally_isZariskiLocalAtTarget _ fun {X} Y f ι U hU H _ _ ↦ ?_ diff --git a/Mathlib/AlgebraicGeometry/Gluing.lean b/Mathlib/AlgebraicGeometry/Gluing.lean index 0c9a711608f717..6c5e3c42655e8b 100644 --- a/Mathlib/AlgebraicGeometry/Gluing.lean +++ b/Mathlib/AlgebraicGeometry/Gluing.lean @@ -524,6 +524,7 @@ The intersection `V` in the glue data associated to a locally directed diagram. noncomputable def V (i j : J) : (F.obj i).Opens := ⨆ (k : Σ k, (k ⟶ i) × (k ⟶ j)), (F.map k.2.1).opensRange +set_option backward.isDefEq.respectTransparency false in lemma V_self (i) : V F i i = ⊤ := top_le_iff.mp (le_iSup_of_le ⟨i, 𝟙 _, 𝟙 _⟩ (by simp [Scheme.Hom.opensRange_of_isIso])) @@ -694,6 +695,7 @@ def glueData : Scheme.GlueData where ← Iso.inv_comp_eq, Scheme.Hom.isoOpensRange_inv_comp] exact (Scheme.homOfLE_ι _ _).symm +set_option backward.isDefEq.respectTransparency 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 diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean index 1fc0aa23ea3f12..4aeb3a45b24ad7 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean @@ -459,6 +459,7 @@ end Semiring section IsAffine +set_option backward.isDefEq.respectTransparency false in /-- The ideal sheaf induced by an ideal of the global sections. -/ @[simps! ideal coe_support] def ofIdealTop (I : Ideal Γ(X, ⊤)) : IdealSheafData X := @@ -470,6 +471,7 @@ def ofIdealTop (I : Ideal Γ(X, ⊤)) : IdealSheafData X := simp only [Ideal.map, zeroLocus_span, zeroLocus_map, Set.mem_union, Set.mem_compl_iff, SetLike.mem_coe, hxU, not_true_eq_false, iff_self_or, IsEmpty.forall_iff]) +set_option backward.isDefEq.respectTransparency false in lemma le_of_isAffine [IsAffine X] {I J : IdealSheafData X} (H : I.ideal ⟨⊤, isAffineOpen_top X⟩ ≤ J.ideal ⟨⊤, isAffineOpen_top X⟩) : I ≤ J := by intro U @@ -638,6 +640,7 @@ lemma vanishingIdeal_support {I : IdealSheafData X} : rw [Set.image_preimage_eq_inter_range, IsAffineOpen.range_fromSpec, IsAffineOpen.fromSpec_image_zeroLocus, coe_support_inter] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma vanishingIdeal_bot : vanishingIdeal (X := X) ⊥ = ⊤ := gc.u_top @[simp] lemma vanishingIdeal_top : vanishingIdeal (X := X) ⊤ = X.nilradical := by @@ -670,6 +673,7 @@ section IsReduced lemma nilradical_eq_bot [IsReduced X] : X.nilradical = ⊥ := by ext; simp [nilradical, Ideal.radical_eq_iff.mpr (Ideal.isRadical_bot)] +set_option backward.isDefEq.respectTransparency false in lemma IdealSheafData.support_eq_top_iff [IsReduced X] {I : X.IdealSheafData} : I.support = ⊤ ↔ I = ⊥ := by rw [← top_le_iff, le_support_iff_le_vanishingIdeal, diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean index 04b6c3ca926b37..7c96cfc7ed1485 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean @@ -219,6 +219,7 @@ def glueDataT (U V : X.affineOpens) : rw [Scheme.Hom.liftQuotient_comp_assoc, Category.assoc, Category.assoc, Iso.hom_inv_id, Category.comp_id, Category.assoc, X.homOfLE_homOfLE] +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] private lemma glueDataT_snd (U V : X.affineOpens) : I.glueDataT U V ≫ pullback.snd _ _ = pullback.snd _ _ ≫ X.homOfLE (by simp) := @@ -332,6 +333,7 @@ private lemma ι_gluedTo (U : X.affineOpens) : I.glueData.ι U ≫ I.gluedTo = I.glueDataObjι U ≫ U.1.ι := Multicoequalizer.π_desc _ _ _ _ _ +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] private lemma glueDataObjMap_ι (U V : X.affineOpens) (h : U ≤ V) : I.glueDataObjMap h ≫ I.glueData.ι V = I.glueData.ι U := by diff --git a/Mathlib/AlgebraicGeometry/Limits.lean b/Mathlib/AlgebraicGeometry/Limits.lean index 2a63763f30703c..0a14ec1212ae93 100644 --- a/Mathlib/AlgebraicGeometry/Limits.lean +++ b/Mathlib/AlgebraicGeometry/Limits.lean @@ -350,6 +350,7 @@ lemma isCompl_range_inl_inr : ((TopCat.binaryCofan_isColimit_iff _).mp ⟨mapIsColimitOfPreservesOfIsColimit Scheme.forgetToTop.{u} _ _ (coprodIsCoprod X Y)⟩).2.2 +set_option backward.isDefEq.respectTransparency false in lemma isCompl_opensRange_inl_inr : IsCompl (coprod.inl : X ⟶ X ⨿ Y).opensRange (coprod.inr : Y ⟶ X ⨿ Y).opensRange := by convert isCompl_range_inl_inr X Y @@ -409,6 +410,7 @@ def coprodOpenCover.{w} : (X ⨿ Y).OpenCover where · simp only [Sum.elim_inr, coprodMk_inr, exists_apply_eq_apply] -- TODO: should infer_instance be considered normalising? +set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in /-- If `X` and `Y` are open disjoint and covering open subschemes of `S`, `S` is the disjoint union of `X` and `Y`. -/ @@ -471,6 +473,7 @@ instance : FinitaryExtensive Scheme where variable {X Y} +set_option backward.isDefEq.respectTransparency false in /-- The sections on coproducts of schemes are the (categorical) product of the sections on the components -/ noncomputable def Scheme.coprodPresheafObjIso (U : (X ⨿ Y).Opens) : @@ -666,6 +669,7 @@ private lemma IsAffineOpen.iSup_of_disjoint_aux [Finite ι] {U : ι → X.Opens} · have (i : _) : IsAffine _ := hU i infer_instance +set_option backward.isDefEq.respectTransparency false in open scoped Function in lemma IsAffineOpen.iSup_of_disjoint [Finite σ] {U : σ → X.Opens} (hU : ∀ i, IsAffineOpen (U i)) (hU' : Pairwise (Disjoint on U)) : @@ -675,6 +679,7 @@ lemma IsAffineOpen.iSup_of_disjoint [Finite σ] {U : σ → X.Opens} rw [← e.symm.iSup_congr fun _ ↦ rfl] exact .iSup_of_disjoint_aux (by simp [*]) fun i j h ↦ hU' (e.symm.injective.ne h) +set_option backward.isDefEq.respectTransparency false in open scoped Function in lemma IsAffineOpen.biSup_of_disjoint {s : Set σ} (hs : s.Finite) {U : σ → X.Opens} (hU : ∀ i ∈ s, IsAffineOpen (U i)) (hU' : s.Pairwise (Disjoint on U)) : @@ -683,6 +688,7 @@ lemma IsAffineOpen.biSup_of_disjoint {s : Set σ} (hs : s.Finite) have := hs.to_subtype exact .iSup_of_disjoint (by simpa) fun i j e ↦ hU' i.2 j.2 (by aesop) +set_option backward.isDefEq.respectTransparency false in lemma IsAffineOpen.sup_of_disjoint {U V : X.Opens} (hU : IsAffineOpen U) (hV : IsAffineOpen V) (H : Disjoint U V) : IsAffineOpen (U ⊔ V) := by @@ -690,6 +696,7 @@ lemma IsAffineOpen.sup_of_disjoint {U V : X.Opens} (hU : IsAffineOpen U) (hV : I (by simp_all [_root_.Pairwise, Unique.forall_iff, ← Opens.coe_disjoint, disjoint_comm]) aesop +set_option backward.isDefEq.respectTransparency false in instance (priority := low) [Finite X] [DiscreteTopology X] : IsAffine X := have : IsAffineOpen (⨆ (x : X), (⟨{x}, isOpen_discrete _⟩ : X.Opens)) := .iSup_of_disjoint (fun i ↦ .of_subsingleton Set.subsingleton_singleton) diff --git a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean index 28f7e535af5a2b..58acd4d6baa4bf 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 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) := @@ -391,6 +392,7 @@ def presentationTilde (s : Set M) (hs : Submodule.span R s = ⊤) refine IsCokernel.ofIso _ (CokernelCofork.mapIsColimit _ h₁ (tilde.functor R)) _ (tildeFinsupp t) (tildeFinsupp s) (.refl _) (by simp) (by simp) +set_option backward.isDefEq.respectTransparency false in instance : (tilde M).IsQuasicoherent := (presentationTilde.{u} _ .univ (by simp) _ (Submodule.span_eq _)).isQuasicoherent diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean index c7fffc0d8e7c41..aac9623e576342 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean @@ -86,6 +86,7 @@ instance {X : Scheme} (r : Γ(X, ⊤)) : lemma isRetrocompact_basicOpen (s : Γ(X, ⊤)) : IsRetrocompact (X := X) (X.basicOpen s) := IsRetrocompact_iff_isSpectralMap_subtypeVal.mpr (X.basicOpen s).ι.isSpectralMap +set_option backward.isDefEq.respectTransparency false in /-- Superseded by `isAffine_of_isAffineOpen_basicOpen`. -/ private lemma isAffine_of_isAffineOpen_basicOpen_aux (s : Set Γ(X, ⊤)) (hs : Ideal.span s = ⊤) (hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)) : @@ -184,6 +185,7 @@ instance (priority := 100) isAffineHom_of_isAffine [IsAffine X] [IsAffine Y] : I 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 false in lemma isAffineHom_of_forall_exists_isAffineOpen (H : ∀ x : Y, ∃ U : Y.Opens, x ∈ U ∧ IsAffineOpen U ∧ IsAffineOpen (f ⁻¹ᵁ U)) : IsAffineHom f := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean index 9adb601ec5e3f8..601194e106b2e5 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean @@ -183,6 +183,7 @@ lemma of_range_subset_iSup [P.RespectsRight @IsOpenImmersion] {ι : Type*} (U : rw [Scheme.Hom.image_iSup, Scheme.Hom.image_top_eq_opensRange, Scheme.Opens.opensRange_ι] simp [Scheme.Hom.image_preimage_eq_opensRange_inf, le_iSup U] +set_option backward.isDefEq.respectTransparency false in lemma of_forall_exists_morphismRestrict (H : ∀ x, ∃ U : Y.Opens, x ∈ U ∧ P (f ∣_ U)) : P f := by choose U hxU hU using H refine IsZariskiLocalAtTarget.of_iSup_eq_top U (top_le_iff.mp fun x _ ↦ ?_) hU @@ -312,6 +313,7 @@ lemma resLE [IsZariskiLocalAtTarget P] {U : Y.Opens} {V : X.Opens} (hf : P f) : P (f.resLE U V e) := IsZariskiLocalAtSource.comp (IsZariskiLocalAtTarget.restrict hf U) _ +set_option backward.isDefEq.respectTransparency false in /-- If `P` is local at the source, local at the target and is stable under post-composition with open immersions, then `P` can be checked locally around points. -/ lemma iff_exists_resLE [IsZariskiLocalAtTarget P] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean index 38b9a1245d45d3..73d4f8eb2bba41 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean @@ -305,6 +305,7 @@ lemma topologically_isZariskiLocalAtTarget [(topologically P).RespectsIso] @[deprecated (since := "2025-10-07")] alias topologically_isLocalAtTarget := topologically_isZariskiLocalAtTarget +set_option backward.isDefEq.respectTransparency false in /-- A variant of `topologically_isZariskiLocalAtTarget` that takes one iff statement instead of two implications. -/ lemma topologically_isZariskiLocalAtTarget' [(topologically P).RespectsIso] @@ -337,6 +338,7 @@ lemma topologically_isZariskiLocalAtSource [(topologically P).RespectsIso] @[deprecated (since := "2025-10-07")] alias topologically_isLocalAtSource := topologically_isZariskiLocalAtSource +set_option backward.isDefEq.respectTransparency false in /-- A variant of `topologically_isZariskiLocalAtSource` that takes one iff statement instead of two implications. -/ lemma topologically_isZariskiLocalAtSource' [(topologically P).RespectsIso] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean index 31b91efa22434f..41b8b4fbdf6180 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean @@ -210,6 +210,7 @@ variable {X Y S T : Scheme.{u}} {f : T ⟶ S} {g : Y ⟶ X} {iX : X ⟶ S} {iY : {UX : X.Opens} (hUST : UT ≤ f ⁻¹ᵁ US) (hUSX : UX ≤ iX ⁻¹ᵁ US) {UY : Y.Opens} (hUY : UY = g ⁻¹ᵁ UX ⊓ iY ⁻¹ᵁ UT) +set_option backward.isDefEq.respectTransparency false in /-- The canonical map `Γ(X, Uₓ) ⊗[Γ(S, Uₛ)] Γ(T, Uₜ) ⟶ Γ(X ×ₛ T, pr₁ ⁻¹ Uₓ ∩ pr₂ ⁻¹ Uₜ)`. This is an isomorphism under various circumstances. -/ abbrev pushoutSection : pushout (iX.appLE US UX hUSX) (f.appLE US UT hUST) ⟶ Γ(Y, UY) := diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean index 23958cee9ad107..d8bb67df98d4d2 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean @@ -175,6 +175,7 @@ instance [FormallyUnramified f] [LocallyOfFiniteType f] (x : X) : exact stalkMap f x infer_instance +set_option backward.isDefEq.respectTransparency false in /-- Given any commuting diagram ``` diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean index c586ee106540ff..ece67bbd17be42 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean @@ -187,6 +187,7 @@ instance (priority := 900) (f : X ⟶ Y) [IsImmersion f] : LocallyOfFiniteType f rw [← f.liftCoborder_ι] infer_instance +set_option backward.isDefEq.respectTransparency false in open Limits Scheme.Pullback in /-- The diagonal morphism is always an immersion. -/ @[stacks 01KJ] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean index 37564230fcb350..5eb5c0e0c9b90c 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean @@ -151,6 +151,7 @@ theorem isField_of_universallyClosed (f : X ⟶ (Spec <| .of K)) algebraize [F.hom] exact isField_of_isIntegral_of_isField' (Field.toIsField K) +set_option backward.isDefEq.respectTransparency false in /-- If `X` is an integral scheme that is universally closed and of finite type over `Spec K`, then `Γ(X, ⊤)` is a finite field extension over `K`. -/ theorem finite_appTop_of_universallyClosed (f : X ⟶ (Spec <| .of K)) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean index a84bd402fe851b..ce9e9730918f75 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean @@ -117,6 +117,7 @@ theorem quasiCompact_iff_forall_isAffineOpen : @[deprecated (since := "2025-10-14")] alias quasiCompact_iff_forall_affine := quasiCompact_iff_forall_isAffineOpen +set_option backward.isDefEq.respectTransparency false in theorem isCompact_basicOpen (X : Scheme) {U : X.Opens} (hU : IsCompact (U : Set X)) (f : Γ(X, U)) : IsCompact (X.basicOpen f : Set X) := by classical @@ -263,6 +264,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch obtain ⟨n, e⟩ := (hU.isLocalization_basicOpen f).exists_of_eq _ H exact ⟨n, by simpa [mul_comm x] using e⟩ +set_option backward.isDefEq.respectTransparency false in /-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then `f ^ n * x = 0` for some `n`. -/ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u}) @@ -306,6 +308,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme rwa [mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn apply Finset.le_sup (Finset.mem_univ i) +set_option backward.isDefEq.respectTransparency false in /-- A section over a compact open of a scheme is nilpotent if and only if its associated basic open is empty. -/ lemma Scheme.isNilpotent_iff_basicOpen_eq_bot_of_isCompact {X : Scheme.{u}} @@ -329,6 +332,7 @@ lemma Scheme.isNilpotent_iff_basicOpen_eq_bot {X : Scheme.{u}} IsNilpotent f ↔ X.basicOpen f = ⊥ := isNilpotent_iff_basicOpen_eq_bot_of_isCompact (U := ⊤) (CompactSpace.isCompact_univ) f +set_option backward.isDefEq.respectTransparency false in /-- The zero locus of a set of sections over a compact open of a scheme is `X` if and only if `s` is contained in the nilradical of `Γ(X, U)`. -/ lemma Scheme.zeroLocus_eq_univ_iff_subset_nilradical_of_isCompact {X : Scheme.{u}} {U : X.Opens} diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean index 20b213ee98519e..d976844290e32a 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean @@ -56,6 +56,7 @@ attribute [instance] QuasiSeparated.quasiCompact_diagonal @[deprecated (since := "2025-10-15")] alias QuasiSeparated.diagonalQuasiCompact := QuasiSeparated.quasiCompact_diagonal +set_option backward.isDefEq.respectTransparency false in theorem quasiSeparatedSpace_iff_forall_affineOpens {X : Scheme} : QuasiSeparatedSpace X ↔ ∀ U V : X.affineOpens, IsCompact (U ∩ V : Set X) := by rw [quasiSeparatedSpace_iff] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean index cd4407b7daf65a..fb5d811a36cf2f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean @@ -98,6 +98,7 @@ section affineLocally variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop) +set_option backward.isDefEq.respectTransparency false in /-- For `P` a property of ring homomorphisms, `sourceAffineLocally P` holds for `f : X ⟶ Y` whenever `P` holds for the restriction of `f` on every affine open subset of `X`. -/ def sourceAffineLocally : AffineTargetMorphismProperty := fun X _ f _ => @@ -109,6 +110,7 @@ Also see `affineLocally_iff_affineOpens_le`. -/ abbrev affineLocally : MorphismProperty Scheme.{u} := targetAffineLocally (sourceAffineLocally P) +set_option backward.isDefEq.respectTransparency false in theorem sourceAffineLocally_respectsIso (h₁ : RingHom.RespectsIso P) : (sourceAffineLocally P).toProperty.RespectsIso := by apply AffineTargetMorphismProperty.respectsIso_mk @@ -188,6 +190,7 @@ open RingHom variable {X Y : Scheme.{u}} {f : X ⟶ Y} +set_option backward.isDefEq.respectTransparency 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₁`). -/ @@ -366,6 +369,7 @@ theorem of_iSup_eq_top [IsAffine Y] {ι : Type*} refine of_source_openCover (X.openCoverOfIsOpenCover _ hU) fun i ↦ ?_ simpa [Scheme.Hom.app_eq_appLE] using (f.appLE_congr _ rfl (by simp) (fun f => Q f.hom)).mp (H i) +set_option backward.isDefEq.respectTransparency false in theorem iff_of_iSup_eq_top [IsAffine Y] {ι : Type*} (U : ι → X.affineOpens) (hU : ⨆ i, (U i : Opens X) = ⊤) : P f ↔ ∀ i, Q (f.appLE ⊤ (U i).1 le_top).hom := diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean index 0ddb9562d5e0d0..7b0d9e9958838f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean @@ -302,6 +302,7 @@ def Scheme.Hom.smoothLocus (f : X ⟶ Y) [LocallyOfFinitePresentation f] : X.Ope lemma Scheme.Hom.mem_smoothLocus {f : X ⟶ Y} [LocallyOfFinitePresentation f] {x : X} : x ∈ f.smoothLocus ↔ (f.stalkMap x).hom.FormallySmooth := .rfl +set_option backward.isDefEq.respectTransparency false in lemma Scheme.Hom.smoothLocus_eq_top (f : X ⟶ Y) [Smooth f] : f.smoothLocus = ⊤ := by rw [← top_le_iff] diff --git a/Mathlib/AlgebraicGeometry/OpenImmersion.lean b/Mathlib/AlgebraicGeometry/OpenImmersion.lean index a68af7a9b675b8..bd186319dda55b 100644 --- a/Mathlib/AlgebraicGeometry/OpenImmersion.lean +++ b/Mathlib/AlgebraicGeometry/OpenImmersion.lean @@ -123,6 +123,7 @@ lemma opensRange_comp_of_isIso {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso f] [IsOpenImmersion g] : (f ≫ g).opensRange = g.opensRange := by rw [opensRange_comp, opensRange_of_isIso, image_top_eq_opensRange] +set_option backward.isDefEq.respectTransparency false in lemma image_le_opensRange (U : X.Opens) : f ''ᵁ U ≤ f.opensRange := by simpa using f.image_mono le_top diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean index fa425bf50243af..252009564d4d59 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean @@ -82,6 +82,7 @@ theorem isBasis_basicOpen : convert ProjectiveSpectrum.isTopologicalBasis_basic_opens 𝒜 exact (Set.range_comp _ _).symm +set_option backward.isDefEq.respectTransparency false in /-- If `{ xᵢ }` spans the irrelevant ideal of `A`, then `D₊(xᵢ)` covers `Proj A`. -/ lemma iSup_basicOpen_eq_top {ι : Type*} (f : ι → A) (hf : (HomogeneousIdeal.irrelevant 𝒜).toIdeal ≤ Ideal.span (Set.range f)) : @@ -205,6 +206,7 @@ lemma isAffineOpen_basicOpen : IsAffineOpen (basicOpen 𝒜 f) := by rw [← opensRange_awayι 𝒜 f f_deg hm] exact isAffineOpen_opensRange (awayι _ _ _ _) +set_option backward.isDefEq.respectTransparency false in @[reassoc] lemma awayι_toSpecZero : awayι 𝒜 f f_deg hm ≫ toSpecZero 𝒜 = Spec.map (CommRingCat.ofHom (fromZeroRingHom 𝒜 _)) := by @@ -381,6 +383,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 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'} diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean index 5729a1fd2ccd52..fb170237b195e1 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean @@ -697,6 +697,7 @@ lemma toSpec_preimage_basicOpen {f} convert (ProjIsoSpecTopComponent.ToSpec.preimage_basicOpen f t) exact funext fun _ => toSpec_base_apply_eq _ _ +set_option backward.isDefEq.respectTransparency false in @[reassoc] lemma toOpen_toSpec_val_c_app (f) (U) : (Scheme.ΓSpecIso _).inv ≫ (Spec A⁰_ f).presheaf.map (homOfLE le_top).op ≫ diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean index b756f0661b51ec..af1970b610af97 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean @@ -353,6 +353,7 @@ theorem basicOpen_eq_zeroLocus_compl (r : A) : theorem basicOpen_one : basicOpen 𝒜 (1 : A) = ⊤ := TopologicalSpace.Opens.ext <| by simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem basicOpen_zero : basicOpen 𝒜 (0 : A) = ⊥ := TopologicalSpace.Opens.ext <| by simp diff --git a/Mathlib/AlgebraicGeometry/Properties.lean b/Mathlib/AlgebraicGeometry/Properties.lean index 8696f73585e826..35c57e8db9b0f7 100644 --- a/Mathlib/AlgebraicGeometry/Properties.lean +++ b/Mathlib/AlgebraicGeometry/Properties.lean @@ -246,6 +246,7 @@ instance Scheme.component_nontrivial (X : Scheme.{u}) (U : X.Opens) [Nonempty U] Nontrivial Γ(X, U) := LocallyRingedSpace.component_nontrivial (hU := ‹_›) +set_option backward.isDefEq.respectTransparency false in instance irreducibleSpace_of_isIntegral [IsIntegral X] : IrreducibleSpace X := by by_contra H replace H : ¬IsPreirreducible .univ := fun h => diff --git a/Mathlib/AlgebraicGeometry/QuasiAffine.lean b/Mathlib/AlgebraicGeometry/QuasiAffine.lean index b90fc50db99ff3..285a35af48be79 100644 --- a/Mathlib/AlgebraicGeometry/QuasiAffine.lean +++ b/Mathlib/AlgebraicGeometry/QuasiAffine.lean @@ -69,6 +69,7 @@ lemma IsQuasiAffine.isBasis_basicOpen (X : Scheme.{u}) [IsQuasiAffine X] : exact SetLike.coe_injective (Set.image_preimage_eq_of_subset (hrU.trans (Set.image_subset_range _ _))) +set_option backward.isDefEq.respectTransparency false in /-- A quasi-compact scheme is quasi-affine if it can be covered by affine basic opens of global sections. -/ lemma IsQuasiAffine.of_forall_exists_mem_basicOpen (X : Scheme.{u}) [CompactSpace X] @@ -98,6 +99,7 @@ lemma IsQuasiAffine.of_isAffineHom [IsAffineHom f] [Y.IsQuasiAffine] : X.IsQuasi rw [← preimage_basicOpen_top] exact ⟨hr.preimage _, hxr⟩ +set_option backward.isDefEq.respectTransparency false in /-- The affine basic opens of a quasi-affine scheme form an open cover. -/ @[simps! f] def openCoverBasicOpenTop (X : Scheme.{u}) [X.IsQuasiAffine] : X.OpenCover := diff --git a/Mathlib/AlgebraicGeometry/RationalMap.lean b/Mathlib/AlgebraicGeometry/RationalMap.lean index 544ec61227ea2c..4ecab327a4480a 100644 --- a/Mathlib/AlgebraicGeometry/RationalMap.lean +++ b/Mathlib/AlgebraicGeometry/RationalMap.lean @@ -446,6 +446,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 false in /-- Given `S`-schemes `X` and `Y` such that `Y` is locally of finite type and `X` is integral, `S`-morphisms `Spec K(X) ⟶ Y` correspond bijectively to `S`-rational maps from `X` to `Y`. diff --git a/Mathlib/AlgebraicGeometry/Restrict.lean b/Mathlib/AlgebraicGeometry/Restrict.lean index fa541cb92a1c80..d4fe105073dabb 100644 --- a/Mathlib/AlgebraicGeometry/Restrict.lean +++ b/Mathlib/AlgebraicGeometry/Restrict.lean @@ -82,6 +82,7 @@ lemma ι_app (V) : U.ι.app V = X.presheaf.map (homOfLE (x := U.ι ''ᵁ U.ι ⁻¹ᵁ V) (Set.image_preimage_subset _ _)).op := rfl +set_option backward.isDefEq.respectTransparency false in @[simp] lemma ι_appTop : U.ι.appTop = X.presheaf.map (homOfLE (x := U.ι ''ᵁ ⊤) le_top).op := @@ -111,6 +112,7 @@ lemma range_ι : Set.range U.ι = U := lemma ι_image_top : U.ι ''ᵁ ⊤ = U := U.isOpenEmbedding_obj_top +set_option backward.isDefEq.respectTransparency false in lemma ι_image_le (W : U.toScheme.Opens) : U.ι ''ᵁ W ≤ U := by simp_rw [← U.ι_image_top] exact U.ι.image_mono le_top @@ -307,6 +309,7 @@ instance (X : Scheme.{u}) {U V : X.Opens} (e : U ≤ V) : IsOpenImmersion (X.hom delta Scheme.homOfLE infer_instance +set_option backward.isDefEq.respectTransparency false in @[simp] lemma Scheme.opensRange_homOfLE {U V : X.Opens} (e : U ≤ V) : (X.homOfLE e).opensRange = V.ι ⁻¹ᵁ U := @@ -747,6 +750,7 @@ lemma resLE_preimage (f : X ⟶ Y) {U : Y.Opens} {V : X.Opens} (e : V ≤ f ⁻ f.resLE U V e ⁻¹ᵁ O = V.ι ⁻¹ᵁ (f ⁻¹ᵁ U.ι ''ᵁ O) := by rw [← comp_preimage, ← resLE_comp_ι f e, comp_preimage, preimage_image_eq] +set_option backward.isDefEq.respectTransparency false in lemma le_resLE_preimage_iff {U : Y.Opens} {V : X.Opens} (e : V ≤ f ⁻¹ᵁ U) (O : U.toScheme.Opens) (W : V.toScheme.Opens) : W ≤ (f.resLE U V e) ⁻¹ᵁ O ↔ V.ι ''ᵁ W ≤ f ⁻¹ᵁ U.ι ''ᵁ O := by @@ -797,6 +801,7 @@ noncomputable def arrowResLEAppIso (f : X ⟶ Y) (U : Y.Opens) (V : X.Opens) (e 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 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 be048eecd52731..cb9a5366b2cee8 100644 --- a/Mathlib/AlgebraicGeometry/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/Scheme.lean @@ -653,6 +653,7 @@ lemma ΓSpecIso_inv_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) : -- This is not marked simp to respect the abstraction lemma ΓSpecIso_inv : (ΓSpecIso R).inv = CommRingCat.ofHom (algebraMap _ _) := rfl +set_option backward.isDefEq.respectTransparency 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 diff --git a/Mathlib/AlgebraicGeometry/Spec.lean b/Mathlib/AlgebraicGeometry/Spec.lean index 22e0e1536d40a3..16798ced3d3dfc 100644 --- a/Mathlib/AlgebraicGeometry/Spec.lean +++ b/Mathlib/AlgebraicGeometry/Spec.lean @@ -357,6 +357,7 @@ def toPushforwardStalkAlgHom : { (StructureSheaf.toPushforwardStalk (CommRingCat.ofHom (algebraMap R S)) p).hom with commutes' := fun _ => rfl } +set_option backward.isDefEq.respectTransparency 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.germ_exist _ _ y diff --git a/Mathlib/AlgebraicGeometry/Stalk.lean b/Mathlib/AlgebraicGeometry/Stalk.lean index b6be60615bf41a..9af5d6fc6254d8 100644 --- a/Mathlib/AlgebraicGeometry/Stalk.lean +++ b/Mathlib/AlgebraicGeometry/Stalk.lean @@ -119,6 +119,7 @@ lemma fromSpecStalk_app {x : X} (hxU : x ∈ U) : hV.fromSpec_app_of_le _ hVU, ← X.presheaf.germ_res (homOfLE hVU) x hxV] simp [Category.assoc, ← ΓSpecIso_inv_naturality_assoc] +set_option backward.isDefEq.respectTransparency false in lemma fromSpecStalk_appTop {x : X} : (X.fromSpecStalk x).appTop = X.presheaf.germ ⊤ x trivial ≫ diff --git a/Mathlib/AlgebraicGeometry/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/StructureSheaf.lean index c1655ed34a5f77..065ae6ec40b900 100644 --- a/Mathlib/AlgebraicGeometry/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/StructureSheaf.lean @@ -550,6 +550,7 @@ the stalk of `structureSheaf R` at `x`. -/ CommRingCat.of R ⟶ (structurePresheafInCommRingCat R).stalk x := CommRingCat.ofHom (algebraMap _ _) ≫ (structurePresheafInCommRingCat R).germ ⊤ x trivial +set_option backward.isDefEq.respectTransparency false in @[elementwise, reassoc] public lemma algebraMap_germ (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.Top R) (hxU : x ∈ U) : @@ -641,6 +642,7 @@ theorem toOpenₗ_germ (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.Top rw [toStalkₗ', ← Presheaf.germ_res _ (homOfLE le_top) _ hx, ← Category.assoc] rfl +set_option backward.isDefEq.respectTransparency false in theorem isUnit_toStalk (x : PrimeSpectrum.Top R) (f : R) (hf : x ∈ basicOpen f) : IsUnit (toStalk R x f) := by convert (isUnit_basicOpen f).map ((structurePresheafInCommRingCat R).germ _ x hf).hom @@ -810,6 +812,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 false in variable (R) in /-- The stalk of `Spec R` at `x` is isomorphic to the stalk of `R^~` at `x`. -/ @[expose] public diff --git a/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean b/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean index 43c1de99f1bc83..456bdb3b19e84f 100644 --- a/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean +++ b/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean @@ -187,6 +187,7 @@ lemma Scheme.Hom.exists_mem_and_isIso_morphismRestrict_toNormalization (Q := @Surjective ⊓ @Flat ⊓ @LocallyOfFinitePresentation) this ⟨⟨‹_›, inferInstance⟩, inferInstance⟩ ‹_› +set_option backward.isDefEq.respectTransparency false in /-- **Zariski's main theorem** @@ -325,6 +326,7 @@ instance [LocallyOfFiniteType f] [IsSeparated f] [QuasiCompact f] : (SetLike.coe_injective e.symm)).hom ≫ f.toNormalization ∣_ U ≫ U.ι)) using 1 simp +set_option backward.isDefEq.respectTransparency false in lemma Scheme.Hom.quasiFiniteLocus_eq_top [LocallyQuasiFinite f] [LocallyOfFiniteType f] : f.quasiFiniteLocus = ⊤ := top_le_iff.mp fun x _ ↦ f.quasiFiniteAt x diff --git a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean index b398c3ec3e810c..c15c5ba2fd0336 100644 --- a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean +++ b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean @@ -245,6 +245,7 @@ variable {C : Type*} [Category* C] (f : Arrow C) [∀ n : ℕ, HasWidePullback f.right (fun _ : Fin (n + 1) => f.left) fun _ => f.hom] (S : SplitEpi f.hom) +set_option backward.isDefEq.respectTransparency false in /-- The extra degeneracy map on the Čech nerve of a split epi. It is given on the `0`-projection by the given section of the split epi, and by shifting the indices on the other projections. -/ diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean index 76e79afdb35092..8b98670f95fa1d 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean @@ -219,6 +219,7 @@ theorem tensorObj_hom_ext {x y z : AugmentedSimplexCategory} (f g : x ⊗ y ⟶ | .star, .star, .of z, f, g => rfl | .star, .star, .star, f, g => rfl +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma inl_comp_tensorHom {x₁ y₁ x₂ y₂ : AugmentedSimplexCategory} (f₁ : x₁ ⟶ y₁) (f₂ : x₂ ⟶ y₂) : inl x₁ x₂ ≫ (f₁ ⊗ₘ f₂) = f₁ ≫ inl y₁ y₂ := @@ -244,6 +245,7 @@ lemma inl_comp_tensorHom {x₁ y₁ x₂ y₂ : AugmentedSimplexCategory} | _, _, .star, _, f₁, f₂ => by cat_disch | .star, _, _, _, _, _ => rfl +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma inr_comp_tensorHom {x₁ y₁ x₂ y₂ : AugmentedSimplexCategory} (f₁ : x₁ ⟶ y₁) (f₂ : x₂ ⟶ y₂) : inr x₁ x₂ ≫ (f₁ ⊗ₘ f₂) = f₂ ≫ inr y₁ y₂ := diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean index 6568f0be4f567d..a98b1c9731e957 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean @@ -87,6 +87,7 @@ theorem Hom.ext_one_left {n : SimplexCategory} (f g : ⦋1⦌ ⟶ n) | 0 => exact h0 ▸ rfl | 1 => exact h1 ▸ rfl +set_option backward.isDefEq.respectTransparency false in theorem eq_of_one_to_one (f : ⦋1⦌ ⟶ ⦋1⦌) : (∃ a, f = const ⦋1⦌ _ a) ∨ f = 𝟙 _ := by match e0 : f.toOrderHom 0, e1 : f.toOrderHom 1 with @@ -176,6 +177,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 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 +187,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 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 +196,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 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 @@ -232,6 +236,7 @@ def δ {n} (i : Fin (n + 2)) : ⦋n⦌ ⟶ ⦋n + 1⦌ := def σ {n} (i : Fin (n + 1)) : ⦋n + 1⦌ ⟶ ⦋n⦌ := mkHom i.predAboveOrderHom +set_option backward.isDefEq.respectTransparency false in /-- The generic case of the first simplicial identity -/ theorem δ_comp_δ {n} {i j : Fin (n + 2)} (H : i ≤ j) : δ i ≫ δ j.succ = δ j ≫ δ i.castSucc := by @@ -269,6 +274,7 @@ theorem δ_comp_δ_self' {n} {i : Fin (n + 2)} {j : Fin (n + 3)} (H : j = i.cast subst H rw [δ_comp_δ_self] +set_option backward.isDefEq.respectTransparency false in /-- The second simplicial identity -/ @[reassoc] theorem δ_comp_σ_of_le {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : i ≤ j.castSucc) : @@ -290,6 +296,7 @@ theorem δ_comp_σ_of_le {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : i ≤ j.ca Fin.castSucc_castPred] rwa [Fin.castSucc_castPred] +set_option backward.isDefEq.respectTransparency false in /-- The first part of the third simplicial identity -/ @[reassoc] theorem δ_comp_σ_self {n} {i : Fin (n + 1)} : @@ -308,6 +315,7 @@ theorem δ_comp_σ_self' {n} {j : Fin (n + 2)} {i : Fin (n + 1)} (H : j = i.cast subst H rw [δ_comp_σ_self] +set_option backward.isDefEq.respectTransparency false in /-- The second part of the third simplicial identity -/ @[reassoc] theorem δ_comp_σ_succ {n} {i : Fin (n + 1)} : δ i.succ ≫ σ i = 𝟙 ⦋n⦌ := by @@ -323,6 +331,7 @@ theorem δ_comp_σ_succ' {n} {j : Fin (n + 2)} {i : Fin (n + 1)} (H : j = i.succ subst H rw [δ_comp_σ_succ] +set_option backward.isDefEq.respectTransparency false in /-- The fourth simplicial identity -/ @[reassoc] theorem δ_comp_σ_of_gt {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : j.castSucc < i) : @@ -357,6 +366,7 @@ theorem δ_comp_σ_of_gt' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : j.succ < · rw [Fin.castSucc_castLT, ← Fin.succ_lt_succ_iff, Fin.succ_pred] exact H +set_option backward.isDefEq.respectTransparency false in /-- The fifth simplicial identity -/ @[reassoc] theorem σ_comp_σ {n} {i j : Fin (n + 1)} (H : i ≤ j) : @@ -403,6 +413,7 @@ then `factor_δ f j` is a morphism `⦋m⦌ ⟶ ⦋n⦌` such that def factor_δ {m n : ℕ} (f : ⦋m⦌ ⟶ ⦋n + 1⦌) (j : Fin (n + 2)) : ⦋m⦌ ⟶ ⦋n⦌ := f ≫ σ (Fin.predAbove 0 j) +set_option backward.isDefEq.respectTransparency false in lemma factor_δ_spec {m n : ℕ} (f : ⦋m⦌ ⟶ ⦋n + 1⦌) (j : Fin (n + 2)) (hj : ∀ (k : Fin (m + 1)), f.toOrderHom k ≠ j) : factor_δ f j ≫ δ j = f := by @@ -423,6 +434,7 @@ lemma δ_one_mkOfSucc {n : ℕ} (i : Fin n) : fin_cases x rfl +set_option backward.isDefEq.respectTransparency false in /-- If `i + 1 < j`, `mkOfSucc i ≫ δ j` is the morphism `⦋1⦌ ⟶ ⦋n⦌` that sends `0` and `1` to `i` and `i + 1`, respectively. -/ lemma mkOfSucc_δ_lt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} @@ -433,6 +445,7 @@ lemma mkOfSucc_δ_lt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} · simp [δ, Fin.succAbove_of_castSucc_lt _ _ (Nat.lt_trans _ h)] · simp [δ, Fin.succAbove_of_castSucc_lt _ _ h] +set_option backward.isDefEq.respectTransparency false in /-- If `i + 1 > j`, `mkOfSucc i ≫ δ j` is the morphism `⦋1⦌ ⟶ ⦋n⦌` that sends `0` and `1` to `i + 1` and `i + 2`, respectively. -/ lemma mkOfSucc_δ_gt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} @@ -447,6 +460,7 @@ lemma mkOfSucc_δ_gt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} · rfl · exact Nat.le_of_lt h +set_option backward.isDefEq.respectTransparency false in /-- If `i + 1 = j`, `mkOfSucc i ≫ δ j` is the morphism `⦋1⦌ ⟶ ⦋n⦌` that sends `0` and `1` to `i` and `i + 2`, respectively. -/ lemma mkOfSucc_δ_eq {n : ℕ} {i : Fin n} {j : Fin (n + 2)} @@ -719,6 +733,7 @@ theorem iso_eq_iso_refl {x : SimplexCategory} (e : x ≅ x) : e = Iso.refl x := theorem eq_id_of_isIso {x : SimplexCategory} (f : x ⟶ x) [IsIso f] : f = 𝟙 _ := congr_arg (fun φ : _ ≅ _ => φ.hom) (iso_eq_iso_refl (asIso f)) +set_option backward.isDefEq.respectTransparency false in theorem eq_σ_comp_of_not_injective' {n : ℕ} {Δ' : SimplexCategory} (θ : ⦋n + 1⦌ ⟶ Δ') (i : Fin (n + 1)) (hi : θ.toOrderHom (Fin.castSucc i) = θ.toOrderHom i.succ) : ∃ θ' : ⦋n⦌ ⟶ Δ', θ = σ i ≫ θ' := by @@ -750,6 +765,7 @@ theorem eq_σ_comp_of_not_injective' {n : ℕ} {Δ' : SimplexCategory} (θ : ⦋ Nat.lt_succ_iff, Fin.ext_iff] at h' h'' ⊢ lia +set_option backward.isDefEq.respectTransparency false in theorem eq_σ_comp_of_not_injective {n : ℕ} {Δ' : SimplexCategory} (θ : ⦋n + 1⦌ ⟶ Δ') (hθ : ¬Function.Injective θ.toOrderHom) : ∃ (i : Fin (n + 1)) (θ' : ⦋n⦌ ⟶ Δ'), θ = σ i ≫ θ' := by diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean b/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean index 33c05e69edb54c..0438d4febeaac8 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean @@ -59,6 +59,7 @@ lemma toMk₁_of_le_castSucc {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : dsimp% toMk₁ i j = 1 := by simpa [toMk₁_apply] +set_option backward.isDefEq.respectTransparency false in lemma δ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : i ≤ j.castSucc) : δ j ≫ toMk₁ i = toMk₁ (i.castPred (Fin.ne_last_of_lt (lt_of_le_of_lt h j.castSucc_lt_succ))) := by @@ -72,6 +73,7 @@ lemma δ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : i rw [Fin.eq_iff_eq_zero_iff, toMk₁_apply_eq_zero_iff, toMk₁_apply_eq_zero_iff] grind [Fin.succAbove] +set_option backward.isDefEq.respectTransparency false in lemma δ_comp_toMk₁_of_lt {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : j.castSucc < i) : δ j ≫ toMk₁ i = toMk₁ (i.pred (Fin.ne_zero_of_lt h)) := by obtain ⟨i, rfl⟩ := Fin.eq_succ_of_ne_zero (Fin.ne_zero_of_lt h) @@ -82,6 +84,7 @@ lemma δ_comp_toMk₁_of_lt {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : j rw [Fin.eq_iff_eq_zero_iff, toMk₁_apply_eq_zero_iff, toMk₁_apply_eq_zero_iff] grind [Fin.succAbove] +set_option backward.isDefEq.respectTransparency false in lemma σ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : i ≤ j.castSucc) : σ j ≫ toMk₁ i = toMk₁ i.castSucc := by refine ConcreteCategory.hom_ext _ _ (fun k ↦ ?_) @@ -99,6 +102,7 @@ lemma σ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : i · rwa [Fin.predAbove_of_le_castSucc _ _ hk', Fin.castSucc_castPred] · grind [Fin.predAbove] +set_option backward.isDefEq.respectTransparency false in lemma σ_comp_toMk₁_of_lt {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : j.castSucc < i) : σ j ≫ toMk₁ i = toMk₁ i.succ := by refine ConcreteCategory.hom_ext _ _ (fun k ↦ ?_) @@ -125,6 +129,7 @@ lemma toMk₁_injective {n : ℕ} : Function.Injective (toMk₁ (n := n)) := by have := ConcreteCategory.congr_hom h ⟨i.1, lt_of_lt_of_le hij (by dsimp; lia)⟩ simp [toMk₁_apply, if_pos hij] at this +set_option backward.isDefEq.respectTransparency false in lemma toMk₁_surjective {n : ℕ} : Function.Surjective (toMk₁ (n := n)) := by intro f let S : Finset (Fin (n + 1)) := { i | f i = 1} diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean index d7b8f6ac3e415a..4e2f6d12f366f0 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean @@ -64,6 +64,7 @@ lemma σ_mem_degenerate (i : Fin (n + 1)) (x : X _⦋n⦌) : X.σ i x ∈ X.degenerate (n + 1) := ⟨n, by lia, SimplexCategory.σ i, Set.mem_range_self x⟩ +set_option backward.isDefEq.respectTransparency false in lemma mem_degenerate_iff (x : X _⦋n⦌) : x ∈ X.degenerate n ↔ ∃ (m : ℕ) (_ : m < n) (f : ⦋n⦌ ⟶ ⦋m⦌) (_ : Epi f), x ∈ Set.range (X.map f.op) := by @@ -211,6 +212,7 @@ lemma unique_nonDegenerate_simplex (x : X _⦋n⦌) {m : ℕ} ext simpa [g_eq_id hy₁ hy₂ hf₁] using (map_g_op_y₂ hf₁ hy₁ hy₂).symm +set_option backward.isDefEq.respectTransparency false in lemma unique_nonDegenerate_map (x : X _⦋n⦌) {m : ℕ} (f₁ : ⦋n⦌ ⟶ ⦋m⦌) [Epi f₁] (y₁ : X.nonDegenerate m) (hy₁ : x = X.map f₁.op y₁) (f₂ : ⦋n⦌ ⟶ ⦋m⦌) (y₂ : X.nonDegenerate m) (hy₂ : x = X.map f₂.op y₂) : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean index cdb454ac2d71e2..17211cc2814e1b 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean @@ -39,6 +39,7 @@ def horn (n : ℕ) (i : Fin (n + 1)) : (Δ[n] : SSet.{u}).Subcomplex where /-- The `i`-th horn `Λ[n, i]` of the standard `n`-simplex -/ scoped[Simplicial] notation3 "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i +set_option backward.isDefEq.respectTransparency false in lemma horn_eq_iSup (n : ℕ) (i : Fin (n + 1)) : horn.{u} n i = ⨆ (j : ({i}ᶜ : Set (Fin (n + 1)))), stdSimplex.face {j.1}ᶜ := by diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean index 050d495128def9..1ce7c3daacc12f 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean @@ -64,6 +64,7 @@ variable {n : ℕ} {X Y : Truncated.{u} 2} (f₀ : X _⦋0⦌₂ → Y _⦋0⦌ namespace liftOfStrictSegal +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `SSet.Truncated.liftOfStrictSegal`. -/ def f₂ (x : X _⦋2⦌₂) : Y _⦋2⦌₂ := (hY.spineEquiv 2).symm diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean index c77dd4558c6054..5f2e3021bd87f7 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean @@ -191,6 +191,7 @@ lemma spine_map_vertex (Δ : X _⦋m⦌ₙ₊₁) (a : ℕ) (hₐ : a ≤ n + 1) rw [← FunctorToTypes.map_comp_apply, ← op_comp, ← tr_comp', SimplexCategory.const_comp] +set_option backward.isDefEq.respectTransparency false in lemma spine_map_subinterval (j l : ℕ) (h : j + l ≤ m) (Δ : X _⦋m⦌ₙ₊₁) : X.spine l (by lia) (X.map (tr (subinterval j l h)).op Δ) = (X.spine m hₘ Δ).interval j l h := by @@ -305,6 +306,7 @@ lemma spine_arrow (Δ : X _⦋n⦌) (i : Fin n) : (X.spine n Δ).arrow i = X.map (mkOfSucc i).op Δ := rfl +set_option backward.isDefEq.respectTransparency false in lemma spine_δ₀ {m : ℕ} (x : X _⦋m + 1⦌) : X.spine m (X.δ 0 x) = (X.spine (m + 1) x).interval 1 m := by obtain _ | m := m diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean index c65dea8df9db1d..cae299764eed23 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean @@ -34,6 +34,7 @@ namespace prodStdSimplex variable {p q : ℕ} +set_option backward.isDefEq.respectTransparency false in /-- `n`-simplices in `Δ[p] ⊗ Δ[q]` identify to order preserving maps `Fin (n + 1) →o Fin (p + 1) × Fin (q + 1)`. -/ def objEquiv {n : ℕ} : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean index ed561f768b2577..ebebb6ea85e658 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean @@ -235,6 +235,7 @@ lemma coe_edge_down_toOrderHom (n : ℕ) (a b : Fin (n + 1)) (hab : a ≤ b) : ↑(edge n a b hab).down.toOrderHom = ![a, b] := rfl +set_option backward.isDefEq.respectTransparency false in /-- The triangle in the standard simplex with vertices `a`, `b`, and `c`. -/ def triangle {n : ℕ} (a b c : Fin (n + 1)) (hab : a ≤ b) (hbc : b ≤ c) : Δ[n] _⦋2⦌ := by refine objMk ⟨![a, b, c], ?_⟩ @@ -249,6 +250,7 @@ lemma coe_triangle_down_toOrderHom {n : ℕ} (a b c : Fin (n + 1)) (hab : a ≤ attribute [local simp] image_subset_iff +set_option backward.isDefEq.respectTransparency false in /-- Given `S : Finset (Fin (n + 1))`, this is the corresponding face of `Δ[n]`, as a subcomplex. -/ @[simps -isSimp obj] @@ -258,15 +260,18 @@ def face {n : ℕ} (S : Finset (Fin (n + 1))) : (Δ[n] : SSet.{u}).Subcomplex wh attribute [local simp] face_obj +set_option backward.isDefEq.respectTransparency false in @[simp] lemma mem_face_iff {n : ℕ} (S : Finset (Fin (n + 1))) {d : ℕ} (x : (Δ[n] : SSet.{u}) _⦋d⦌) : x ∈ (face S).obj _ ↔ ∀ (i : Fin (d + 1)), x i ∈ S := by simp +set_option backward.isDefEq.respectTransparency false in lemma face_inter_face {n : ℕ} (S₁ S₂ : Finset (Fin (n + 1))) : face S₁ ⊓ face S₂ = face (S₁ ⊓ S₂) := by aesop +set_option backward.isDefEq.respectTransparency false in @[simp] lemma face_empty (n : ℕ) : face.{u} (∅ : Finset (Fin (n + 1))) = ⊥ := by @@ -321,6 +326,7 @@ lemma face_le_face_iff {n : ℕ} (S₁ S₂ : Finset (Fin (n + 1))) : simp only [← obj₀Equiv_symm_mem_face_iff.{u}] at hi ⊢ exact h _ hi +set_option backward.isDefEq.respectTransparency false in lemma face_eq_ofSimplex {n : ℕ} (S : Finset (Fin (n + 1))) (m : ℕ) (e : Fin (m + 1) ≃o S) : face.{u} S = Subcomplex.ofSimplex (X := Δ[n]) @@ -339,6 +345,7 @@ lemma face_eq_ofSimplex {n : ℕ} (S : Finset (Fin (n + 1))) (m : ℕ) (e : Fin simpa only [Subtype.ext_iff] using e.apply_symm_apply ⟨_, hx j⟩ · simp +set_option backward.isDefEq.respectTransparency false in /-- If `S : Finset (Fin (n + 1))` is order isomorphic to `Fin (m + 1)`, then the face `face S` of `Δ[n]` is representable by `m`, i.e. `face S` is isomorphic to `Δ[m]`, see `stdSimplex.isoOfRepresentableBy`. -/ @@ -494,6 +501,7 @@ noncomputable def facePairIso {n : ℕ} (i j : Fin (n + 1)) (hij : i < j) : stdSimplex.isoOfRepresentableBy (stdSimplex.faceRepresentableBy.{u} _ _ (Fin.orderIsoPair i j hij)) +set_option backward.isDefEq.respectTransparency false in variable (n) in private lemma bijective_image_objEquiv_toOrderHom_univ (m : ℕ) : Function.Bijective (fun (⟨x, hx⟩ : (Δ[n] : SSet.{u}).nonDegenerate m) ↦ @@ -536,6 +544,7 @@ lemma nonDegenerateEquiv'_iff {n d : ℕ} (x : (Δ[n] : SSet.{u}).nonDegenerate dsimp [nonDegenerateEquiv'] aesop +set_option backward.isDefEq.respectTransparency false 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`. -/ @[no_expose] noncomputable def orderIsoOfNonDegenerate diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean index ffc5916eb1992c..a2a9f55a6ec72b 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean @@ -77,6 +77,7 @@ lemma IsStrictSegal.ext [X.IsStrictSegal] {d : ℕ} {hd} {x y : X _⦋d + 1⦌ x = y := X.spine_injective (by ext i; apply h) +set_option backward.isDefEq.respectTransparency false in variable {X} in lemma IsStrictSegal.hom_ext {Y : SSet.Truncated.{u} (n + 1)} [Y.IsStrictSegal] {f g : X ⟶ Y} (h : ∀ (x : X _⦋1⦌ₙ₊₁), f.app _ x = g.app _ x) : f = g := by @@ -197,6 +198,7 @@ section spine_δ variable (m : ℕ) (h : m ≤ n) (f : Path X (m + 1)) variable {i : Fin (m + 1)} {j : Fin (m + 2)} +set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, the common vertices will agree with those of the original path `f`. In particular, a vertex `i` with `i < j` can be identified with the same vertex in `f`. -/ @@ -209,6 +211,7 @@ lemma spine_δ_vertex_lt (hij : i.castSucc < j) : Fin.succAboveOrderEmb_apply, OrderEmbedding.toOrderHom_coe] rw [Fin.succAbove_of_castSucc_lt j i hij] +set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, a vertex `i` with `j ≤ i` can be identified with vertex `i + 1` in the original path. -/ @@ -378,6 +381,7 @@ lemma spineToSimplex_map {X Y : SSet.{u}} (sx : StrictSegal X) variable (f : Path X (n + 1)) variable {i : Fin (n + 1)} {j : Fin (n + 2)} +set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, the common vertices will agree with those of the original path `f`. In particular, a vertex `i` with `i < j` can be identified with the same vertex in `f`. -/ @@ -391,6 +395,7 @@ lemma spine_δ_vertex_lt (h : i.castSucc < j) : OrderEmbedding.toOrderHom_coe, Fin.succAboveOrderEmb_apply] rw [Fin.succAbove_of_castSucc_lt j i h] +set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, a vertex `i` with `i ≥ j` can be identified with vertex `i + 1` in the original path. -/ @@ -450,6 +455,7 @@ namespace StrictSegalCore variable {X} (h : ∀ n, X.StrictSegalCore n) {n : ℕ} (p : X.Path n) +set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `StrictSegalCore.spineToSimplex`. -/ def spineToSimplexAux : { s : X _⦋n⦌ // X.spine _ s = p } := by induction n with @@ -489,6 +495,7 @@ lemma δ₀_spineToSimplex (p : X.Path (n + 1)) : X.δ 0 (spineToSimplex h p) = spineToSimplex h (p.interval 1 n) := by rw [spineToSimplex_succ, δ₀_concat] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma spineToSimplex_spine (s : X _⦋n⦌) : spineToSimplex h (X.spine _ s) = s := by induction n with diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index 64048745bab0a2..dee1534aca942e 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -187,12 +187,8 @@ theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : /-- If `x ∉ (I.lower i, I.upper i)`, then the hyperplane `{y | y i = x}` does not split `I`. -/ theorem split_of_notMem_Ioo (h : x ∉ Ioo (I.lower i) (I.upper i)) : split I i x = ⊤ := by refine ((isPartitionTop I).eq_of_boxes_subset fun J hJ => ?_).symm - rcases mem_top.1 hJ with rfl; clear hJ - rw [mem_boxes, mem_split_iff] - rw [mem_Ioo, not_and_or, not_lt, not_lt] at h - cases h <;> [right; left] - · rwa [eq_comm, Box.splitUpper_eq_self] - · rwa [eq_comm, Box.splitLower_eq_self] + rcases mem_top.1 hJ with rfl + grind [Box.splitUpper_eq_self, Box.splitLower_eq_self, mem_boxes, mem_split_iff, not_lt] theorem coe_eq_of_mem_split_of_mem_le {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J) (h₃ : y i ≤ x) : (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean index a743f3426a5e5d..be1b0e5e0de697 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean @@ -149,6 +149,7 @@ section Unital variable [CStarAlgebra A] +set_option backward.isDefEq.respectTransparency false in theorem IsStarNormal.instContinuousFunctionalCalculus : ContinuousFunctionalCalculus ℂ A IsStarNormal where predicate_zero := .zero diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index f95ff5e2884ecd..5fc929c0bfb683 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -458,11 +458,7 @@ lemma IsGreatest.nnnorm_cfc_nnreal [Nontrivial A] (f : ℝ≥0 → ℝ≥0) (a : convert IsGreatest.nnnorm_cfc (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - ext x - constructor - all_goals rintro ⟨x, hx, rfl⟩ - · exact ⟨x, spectrum.algebraMap_mem ℝ hx, by simp⟩ - · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ + simp [Set.image_image, ← ha'.image] lemma apply_le_nnnorm_cfc_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σ ℝ≥0 a) (hf : ContinuousOn f (σ ℝ≥0 a) := by cfc_cont_tac) (ha : 0 ≤ a := by cfc_tac) : @@ -536,11 +532,7 @@ lemma IsGreatest.nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) convert IsGreatest.nnnorm_cfcₙ (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont (by simpa) case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - ext x - constructor - all_goals rintro ⟨x, hx, rfl⟩ - · exact ⟨x, quasispectrum.algebraMap_mem ℝ hx, by simp⟩ - · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ + simp [Set.image_image, ← ha'.image] lemma apply_le_nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σₙ ℝ≥0 a) (hf : ContinuousOn f (σₙ ℝ≥0 a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index 5cc34ccc55b266..3d0cc4368c4d0b 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -438,9 +438,9 @@ instance instNonnegSpectrumClassComplexNonUnital : NonnegSpectrumClass ℂ A whe lemma norm_le_norm_of_nonneg_of_le {a b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖ ≤ ‖b‖ := by suffices ∀ a b : A⁺¹, 0 ≤ a → a ≤ b → ‖a‖ ≤ ‖b‖ by - have hb := ha.trans hab + have hb : 0 ≤ b := ha.trans hab simpa only [ge_iff_le, Unitization.norm_inr] using - this a b (by simpa) (by rwa [Unitization.inr_le_iff a b]) + this a b (by simpa) (by rwa [Unitization.inr_le_iff a b (.of_nonneg ha) (.of_nonneg hb)]) intro a b ha hab have hb : 0 ≤ b := ha.trans hab exact (norm_le_iff_le_algebraMap a (norm_nonneg _) ha).2 <| hab.trans <| diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean index ee21d6a921125a..580b1d7dec275a 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean @@ -248,14 +248,8 @@ lemma range_cfcₙ_nnreal [NonUnitalClosedEmbeddingContinuousFunctionalCalculus ← range_cfcₙ _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] refine Set.Subset.antisymm (Set.image_mono (fun _ ↦ cfcₙ_nonneg)) ?_ rintro _ ⟨f, hf, rfl⟩ - simp only [Set.preimage_setOf_eq, Set.mem_setOf_eq, Set.mem_image] at hf ⊢ - obtain (⟨h₁, h₂, h₃⟩ | h | h | h) := by - simpa only [not_and_or] using - em (ContinuousOn f (quasispectrum ℝ a) ∧ f 0 = 0 ∧ IsSelfAdjoint a) - · refine ⟨f, ?_, rfl⟩ - rwa [cfcₙ_nonneg_iff f a] at hf - · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_continuousOn a h]⟩ - · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_map_zero a h]⟩ - · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_predicate a h]⟩ + exact cfcₙ_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' h0 ha' ↦ + ⟨f, (cfcₙ_nonneg_iff f a hf' h0 ha').mp + (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), by simp [cfcₙ_apply f a hf' h0 ha']⟩ end NonUnital diff --git a/Mathlib/Analysis/CStarAlgebra/Exponential.lean b/Mathlib/Analysis/CStarAlgebra/Exponential.lean index 2bef6805c902c6..f5f709d3b023ff 100644 --- a/Mathlib/Analysis/CStarAlgebra/Exponential.lean +++ b/Mathlib/Analysis/CStarAlgebra/Exponential.lean @@ -55,17 +55,12 @@ lemma selfAdjoint.continuous_expUnitary : Continuous (expUnitary : selfAdjoint A theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : expUnitary (a + b) = expUnitary a * expUnitary b := by let +nondep : NormedAlgebra ℚ A := .restrictScalars ℚ ℂ A - ext - have hcomm : Commute (I • (a : A)) (I • (b : A)) := by - unfold Commute SemiconjBy - simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm] - simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm + simpa only [Subtype.ext_iff, expUnitary_coe, AddSubgroup.coe_add, smul_add] using + exp_add_of_commute ((h.smul_left I).smul_right I) theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : - Commute (expUnitary a) (expUnitary b) := - calc - selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = - selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by - rw [← h.expUnitary_add, ← h.symm.expUnitary_add, add_comm] + Commute (expUnitary a) (expUnitary b) := by + simpa only [Commute, SemiconjBy, Subtype.ext_iff, expUnitary_coe] using + ((h.smul_left I).smul_right I).exp end Star diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index d716c1e4af8af6..4c143a3ca4ca7a 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -313,12 +313,8 @@ noncomputable instance (priority := 100) Complex.instStarHomClass : StarHomClass rw [← realPart_add_I_smul_imaginaryPart a] simp only [map_add, map_smul, star_add, star_smul, hsa, selfAdjoint.star_val_eq] intro s - have := AlgHom.apply_mem_spectrum φ (s : A) - rw [selfAdjoint.val_re_map_spectrum s] at this - rcases this with ⟨⟨_, _⟩, _, heq⟩ - simp only [Function.comp_apply] at heq - rw [← heq, RCLike.star_def] - exact RCLike.conj_ofReal _ + rw [selfAdjoint.mem_spectrum_eq_re s (AlgHom.apply_mem_spectrum φ (s : A))] + simp /-- This is not an instance to avoid type class inference loops. See `WeakDual.Complex.instStarHomClass`. -/ diff --git a/Mathlib/Analysis/Complex/Hadamard.lean b/Mathlib/Analysis/Complex/Hadamard.lean index b356efc20a437b..014859cb2f7222 100644 --- a/Mathlib/Analysis/Complex/Hadamard.lean +++ b/Mathlib/Analysis/Complex/Hadamard.lean @@ -227,7 +227,8 @@ theorem norm_mul_invInterpStrip_le_one_of_mem_verticalClosedStrip (f : ℂ → E rw [eventually_inf_principal] apply Eventually.of_forall intro x hx - simpa using (hBF x ((preimage_mono Ioo_subset_Icc_self) hx)).trans + norm_num + exact (hBF x ((preimage_mono Ioo_subset_Icc_self) hx)).trans ((le_of_lt (lt_add_one BF)).trans (Real.add_one_le_exp BF)) end invInterpStrip diff --git a/Mathlib/Analysis/Convex/Approximation.lean b/Mathlib/Analysis/Convex/Approximation.lean index dd5fa60e8fc6e0..4c7fca57290943 100644 --- a/Mathlib/Analysis/Convex/Approximation.lean +++ b/Mathlib/Analysis/Convex/Approximation.lean @@ -222,8 +222,9 @@ theorem univ_sSup_of_nat_affine_eq [HereditarilyLindelofSpace E] ∧ ⨆ i, re ∘ (l i) + const E (c i) = φ := by obtain ⟨l, c, hle, hsup⟩ := hφcv.sSup_of_nat_affine_eq (𝕜 := 𝕜) (s := univ) isClosed_univ (lowerSemicontinuousOn_univ_iff.2 hφc) - refine ⟨l, c, fun i x ↦ ?_, ?_⟩ - · exact hle i ⟨x, trivial⟩ + refine ⟨l, c, ?_, ?_⟩ + · intro i x + simpa using hle i ⟨x, trivial⟩ · ext x simpa using congrFun hsup ⟨x, trivial⟩ diff --git a/Mathlib/Analysis/Distribution/TestFunction.lean b/Mathlib/Analysis/Distribution/TestFunction.lean index d510289fabf406..d393bdf14fcb40 100644 --- a/Mathlib/Analysis/Distribution/TestFunction.lean +++ b/Mathlib/Analysis/Distribution/TestFunction.lean @@ -316,6 +316,7 @@ noncomputable def ofSupportedInCLM [SMulCommClass ℝ 𝕜 F] {K : Compacts E} @[deprecated (since := "2025-12-10")] alias coe_ofSupportedInLM := coe_ofSupportedInCLM +set_option backward.isDefEq.respectTransparency false in /-- The **universal property** of the topology on `𝓓^{n}(Ω, F)`: a **linear** map from `𝓓^{n}(Ω, F)` to a locally convex topological vector space is continuous if and only if its precomposition with the inclusion `ofSupportedIn K_sub_Ω : 𝓓^{n}_{K}(E, F) → 𝓓^{n}(Ω, F)` is diff --git a/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean b/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean new file mode 100644 index 00000000000000..a3c0692410b13d --- /dev/null +++ b/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean @@ -0,0 +1,6 @@ +module -- shake: keep-all + +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Tactic.Positivity + +deprecated_module (since := "2025-09-16") diff --git a/Mathlib/Analysis/MeanInequalities.lean b/Mathlib/Analysis/MeanInequalities.lean index a8e0accc00bc4c..b9822d2e022748 100644 --- a/Mathlib/Analysis/MeanInequalities.lean +++ b/Mathlib/Analysis/MeanInequalities.lean @@ -350,7 +350,8 @@ theorem harm_mean_le_geom_mean_weighted (w z : ι → ℝ) (hs : s.Nonempty) (hw prod_pos fun i hi => rpow_pos_of_pos (inv_pos.2 (hz i hi)) _ have s_pos : 0 < ∑ i ∈ s, w i * (z i)⁻¹ := sum_pos (fun i hi => mul_pos (hw i hi) (inv_pos.2 (hz i hi))) hs - simp only [Pi.div_apply, Pi.one_apply, one_div, ← inv_le_inv₀ s_pos p_pos] at this + norm_num at this + rw [← inv_le_inv₀ s_pos p_pos] at this apply le_trans this have p_pos₂ : 0 < (∏ i ∈ s, (z i) ^ w i)⁻¹ := inv_pos.2 (prod_pos fun i hi => rpow_pos_of_pos ((hz i hi)) _) diff --git a/Mathlib/Analysis/Normed/Algebra/Basic.lean b/Mathlib/Analysis/Normed/Algebra/Basic.lean index 007f8496840ef6..c3ed7104b81bd2 100644 --- a/Mathlib/Analysis/Normed/Algebra/Basic.lean +++ b/Mathlib/Analysis/Normed/Algebra/Basic.lean @@ -34,6 +34,7 @@ namespace IntermediateField variable {K L : Type*} [NontriviallyNormedField K] [NormedField L] [NormedAlgebra K L] +set_option backward.isDefEq.respectTransparency false in instance (F : IntermediateField K L) : NontriviallyNormedField F where __ := SubfieldClass.toNormedField F non_trivial := by diff --git a/Mathlib/Analysis/Normed/Field/Basic.lean b/Mathlib/Analysis/Normed/Field/Basic.lean index 45afd0c3c88723..723c9f6c4f2f3f 100644 --- a/Mathlib/Analysis/Normed/Field/Basic.lean +++ b/Mathlib/Analysis/Normed/Field/Basic.lean @@ -325,7 +325,7 @@ variable {F : Type*} (R S : Type*) [FunLike F R S] See note [reducible non-instances] -/ abbrev NormedDivisionRing.induced [DivisionRing R] [NormedDivisionRing S] [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NormedDivisionRing R := - fast_instance% { NormedAddCommGroup.induced R S f hf, ‹DivisionRing R› with + { NormedAddCommGroup.induced R S f hf, ‹DivisionRing R› with norm_mul x y := show ‖f _‖ = _ from (map_mul f x y).symm ▸ norm_mul (f x) (f y) } /-- An injective non-unital ring homomorphism from a `Field` to a `NormedRing` induces a @@ -334,7 +334,7 @@ abbrev NormedDivisionRing.induced [DivisionRing R] [NormedDivisionRing S] See note [reducible non-instances] -/ abbrev NormedField.induced [Field R] [NormedField S] [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NormedField R := - fast_instance% { NormedDivisionRing.induced R S f hf with + { NormedDivisionRing.induced R S f hf with mul_comm := mul_comm } end Induced @@ -348,7 +348,7 @@ If `s` is a subfield of a normed field `F`, then `s` is equipped with an induced field structure. -/ instance toNormedField [NormedField F] [SubfieldClass S F] (s : S) : NormedField s := - fast_instance% NormedField.induced s F (SubringClass.subtype s) Subtype.val_injective + NormedField.induced s F (SubringClass.subtype s) Subtype.val_injective end SubfieldClass diff --git a/Mathlib/Analysis/Normed/Group/Basic.lean b/Mathlib/Analysis/Normed/Group/Basic.lean index a84822245f2c57..b71de6533d7fdd 100644 --- a/Mathlib/Analysis/Normed/Group/Basic.lean +++ b/Mathlib/Analysis/Normed/Group/Basic.lean @@ -713,7 +713,7 @@ structure on the domain. -/ `SeminormedAddGroup` induces a `SeminormedAddGroup` structure on the domain. -/] abbrev SeminormedGroup.induced [Group E] [SeminormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) : SeminormedGroup E := - fast_instance% { PseudoMetricSpace.induced f toPseudoMetricSpace with + { PseudoMetricSpace.induced f toPseudoMetricSpace with norm := fun x => ‖f x‖ dist_eq := fun x y => by simp only [map_mul, map_inv, ← dist_eq_norm_inv_mul]; rfl } @@ -725,7 +725,7 @@ abbrev SeminormedGroup.induced [Group E] [SeminormedGroup F] [MonoidHomClass abbrev SeminormedCommGroup.induced [CommGroup E] [SeminormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) : SeminormedCommGroup E := - fast_instance% { SeminormedGroup.induced E F f with + { SeminormedGroup.induced E F f with mul_comm := mul_comm } -- See note [reducible non-instances]. @@ -736,7 +736,7 @@ structure on the domain. -/ abbrev NormedGroup.induced [Group E] [NormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) (h : Injective f) : NormedGroup E := - fast_instance% { SeminormedGroup.induced E F f, MetricSpace.induced f h _ with } + { SeminormedGroup.induced E F f, MetricSpace.induced f h _ with } -- See note [reducible non-instances]. /-- An injective group homomorphism from a `CommGroup` to a `NormedGroup` induces a @@ -745,7 +745,8 @@ abbrev NormedGroup.induced `NormedCommGroup` induces a `NormedCommGroup` structure on the domain. -/] abbrev NormedCommGroup.induced [CommGroup E] [NormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) (h : Injective f) : NormedCommGroup E := - fast_instance% { SeminormedCommGroup.induced E F f, MetricSpace.induced f h _ with } + { SeminormedGroup.induced E F f, MetricSpace.induced f h _ with + mul_comm := mul_comm } end Induced diff --git a/Mathlib/Analysis/Normed/Group/Subgroup.lean b/Mathlib/Analysis/Normed/Group/Subgroup.lean index 8fc9fda8d199f3..de640b93cfcaff 100644 --- a/Mathlib/Analysis/Normed/Group/Subgroup.lean +++ b/Mathlib/Analysis/Normed/Group/Subgroup.lean @@ -39,7 +39,7 @@ with the restriction of the norm. -/ @[to_additive /-- A subgroup of a seminormed group is also a seminormed group, with the restriction of the norm. -/] instance seminormedGroup : SeminormedGroup s := - fast_instance% SeminormedGroup.induced _ _ s.subtype + SeminormedGroup.induced _ _ s.subtype /-- If `x` is an element of a subgroup `s` of a seminormed group `E`, its norm in `s` is equal to its norm in `E`. -/ @@ -63,15 +63,15 @@ end SeminormedGroup @[to_additive] instance seminormedCommGroup [SeminormedCommGroup E] {s : Subgroup E} : SeminormedCommGroup s := - fast_instance% SeminormedCommGroup.induced _ _ s.subtype + SeminormedCommGroup.induced _ _ s.subtype @[to_additive] instance normedGroup [NormedGroup E] {s : Subgroup E} : NormedGroup s := - fast_instance% NormedGroup.induced _ _ s.subtype Subtype.coe_injective + NormedGroup.induced _ _ s.subtype Subtype.coe_injective @[to_additive] instance normedCommGroup [NormedCommGroup E] {s : Subgroup E} : NormedCommGroup s := - fast_instance% NormedCommGroup.induced _ _ s.subtype Subtype.coe_injective + NormedCommGroup.induced _ _ s.subtype Subtype.coe_injective end Subgroup @@ -89,7 +89,7 @@ with the restriction of the norm. -/ @[to_additive /-- A subgroup of a seminormed additive group is also a seminormed additive group, with the restriction of the norm. -/] instance (priority := 75) seminormedGroup : SeminormedGroup s := - fast_instance% SeminormedGroup.induced _ _ (SubgroupClass.subtype s) + SeminormedGroup.induced _ _ (SubgroupClass.subtype s) /-- If `x` is an element of a subgroup `s` of a seminormed group `E`, its norm in `s` is equal to its norm in `E`. -/ @@ -103,16 +103,16 @@ end SeminormedGroup @[to_additive] instance (priority := 75) seminormedCommGroup [SeminormedCommGroup E] {S : Type*} [SetLike S E] [SubgroupClass S E] (s : S) : SeminormedCommGroup s := - fast_instance% SeminormedCommGroup.induced _ _ (SubgroupClass.subtype s) + SeminormedCommGroup.induced _ _ (SubgroupClass.subtype s) @[to_additive] instance (priority := 75) normedGroup [NormedGroup E] {S : Type*} [SetLike S E] [SubgroupClass S E] (s : S) : NormedGroup s := - fast_instance% NormedGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective + NormedGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective @[to_additive] instance (priority := 75) normedCommGroup [NormedCommGroup E] {S : Type*} [SetLike S E] [SubgroupClass S E] (s : S) : NormedCommGroup s := - fast_instance% NormedCommGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective + NormedCommGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective end SubgroupClass diff --git a/Mathlib/Analysis/Normed/Group/Submodule.lean b/Mathlib/Analysis/Normed/Group/Submodule.lean index be5466c4162457..dc2c4f9ef9abe2 100644 --- a/Mathlib/Analysis/Normed/Group/Submodule.lean +++ b/Mathlib/Analysis/Normed/Group/Submodule.lean @@ -20,7 +20,7 @@ namespace Submodule -/ instance seminormedAddCommGroup [Ring 𝕜] [SeminormedAddCommGroup E] [Module 𝕜 E] (s : Submodule 𝕜 E) : SeminormedAddCommGroup s := - fast_instance% SeminormedAddCommGroup.induced _ _ s.subtype.toAddMonoidHom + SeminormedAddCommGroup.induced _ _ s.subtype.toAddMonoidHom /-- If `x` is an element of a submodule `s` of a normed group `E`, its norm in `s` is equal to its norm in `E`. -/ diff --git a/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean b/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean index 87bffe90dbca5d..6b8f964ee829e9 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean @@ -40,6 +40,7 @@ section DivisionRing variable [NormedDivisionRing 𝕜] [SeminormedAddCommGroup E] variable [Module 𝕜 E] [NormSMulClass 𝕜 E] +set_option backward.isDefEq.respectTransparency false in theorem ediam_smul₀ (c : 𝕜) (s : Set E) : ediam (c • s) = ‖c‖₊ • ediam s := by refine le_antisymm (ediam_smul_le c s) ?_ obtain rfl | hc := eq_or_ne c 0 diff --git a/Mathlib/Analysis/Normed/Module/Basic.lean b/Mathlib/Analysis/Normed/Module/Basic.lean index f8ffe68e9838f7..40c1d561c78384 100644 --- a/Mathlib/Analysis/Normed/Module/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Basic.lean @@ -189,8 +189,8 @@ See note [reducible non-instances] -/ abbrev NormedSpace.induced {F : Type*} (𝕜 E G : Type*) [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] [SeminormedAddCommGroup G] [NormedSpace 𝕜 G] [FunLike F E G] [LinearMapClass F 𝕜 E G] (f : F) : @NormedSpace 𝕜 E _ (SeminormedAddCommGroup.induced E G f) := - letI := SeminormedAddCommGroup.induced E G f - { norm_smul_le a b := by simpa only [← map_smul f a b] using norm_smul_le a (f b) } + let _ := SeminormedAddCommGroup.induced E G f + ⟨fun a b ↦ by simpa only [← map_smul f a b] using norm_smul_le a (f b)⟩ section NontriviallyNormedSpace diff --git a/Mathlib/Analysis/Normed/Ring/Basic.lean b/Mathlib/Analysis/Normed/Ring/Basic.lean index 47955ce9681e21..c3067e14f6c874 100644 --- a/Mathlib/Analysis/Normed/Ring/Basic.lean +++ b/Mathlib/Analysis/Normed/Ring/Basic.lean @@ -803,7 +803,7 @@ induces a `NonUnitalSeminormedRing` structure on the domain. See note [reducible non-instances] -/ abbrev NonUnitalSeminormedRing.induced [NonUnitalRing R] [NonUnitalSeminormedRing S] - [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedRing R := fast_instance% + [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedRing R := { SeminormedAddCommGroup.induced R S f, ‹NonUnitalRing R› with norm_mul_le x y := show ‖f _‖ ≤ _ from (map_mul f x y).symm ▸ norm_mul_le (f x) (f y) } @@ -812,8 +812,7 @@ abbrev NonUnitalSeminormedRing.induced [NonUnitalRing R] [NonUnitalSeminormedRin See note [reducible non-instances] -/ abbrev NonUnitalNormedRing.induced [NonUnitalRing R] [NonUnitalNormedRing S] - [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : - NonUnitalNormedRing R := fast_instance% + [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NonUnitalNormedRing R := { NonUnitalSeminormedRing.induced R S f, NormedAddCommGroup.induced R S f hf with } /-- A non-unital ring homomorphism from a `Ring` to a `SeminormedRing` induces a @@ -821,7 +820,7 @@ abbrev NonUnitalNormedRing.induced [NonUnitalRing R] [NonUnitalNormedRing S] See note [reducible non-instances] -/ abbrev SeminormedRing.induced [Ring R] [SeminormedRing S] [NonUnitalRingHomClass F R S] (f : F) : - SeminormedRing R := fast_instance% + SeminormedRing R := { NonUnitalSeminormedRing.induced R S f, SeminormedAddCommGroup.induced R S f, ‹Ring R› with } /-- An injective non-unital ring homomorphism from a `Ring` to a `NormedRing` induces a @@ -829,7 +828,7 @@ abbrev SeminormedRing.induced [Ring R] [SeminormedRing S] [NonUnitalRingHomClass See note [reducible non-instances] -/ abbrev NormedRing.induced [Ring R] [NormedRing S] [NonUnitalRingHomClass F R S] (f : F) - (hf : Function.Injective f) : NormedRing R := fast_instance% + (hf : Function.Injective f) : NormedRing R := { NonUnitalSeminormedRing.induced R S f, NormedAddCommGroup.induced R S f hf, ‹Ring R› with } /-- A non-unital ring homomorphism from a `NonUnitalCommRing` to a `NonUnitalSeminormedCommRing` @@ -837,7 +836,7 @@ induces a `NonUnitalSeminormedCommRing` structure on the domain. See note [reducible non-instances] -/ abbrev NonUnitalSeminormedCommRing.induced [NonUnitalCommRing R] [NonUnitalSeminormedCommRing S] - [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedCommRing R := fast_instance% + [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedCommRing R := { NonUnitalSeminormedRing.induced R S f, ‹NonUnitalCommRing R› with } /-- An injective non-unital ring homomorphism from a `NonUnitalCommRing` to a @@ -845,15 +844,14 @@ abbrev NonUnitalSeminormedCommRing.induced [NonUnitalCommRing R] [NonUnitalSemin See note [reducible non-instances] -/ abbrev NonUnitalNormedCommRing.induced [NonUnitalCommRing R] [NonUnitalNormedCommRing S] - [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : - NonUnitalNormedCommRing R := fast_instance% + [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NonUnitalNormedCommRing R := { NonUnitalNormedRing.induced R S f hf, ‹NonUnitalCommRing R› with } /-- A non-unital ring homomorphism from a `CommRing` to a `SeminormedRing` induces a `SeminormedCommRing` structure on the domain. See note [reducible non-instances] -/ abbrev SeminormedCommRing.induced [CommRing R] [SeminormedRing S] [NonUnitalRingHomClass F R S] - (f : F) : SeminormedCommRing R := fast_instance% + (f : F) : SeminormedCommRing R := { NonUnitalSeminormedRing.induced R S f, SeminormedAddCommGroup.induced R S f, ‹CommRing R› with } /-- An injective non-unital ring homomorphism from a `CommRing` to a `NormedRing` induces a @@ -861,7 +859,7 @@ abbrev SeminormedCommRing.induced [CommRing R] [SeminormedRing S] [NonUnitalRing See note [reducible non-instances] -/ abbrev NormedCommRing.induced [CommRing R] [NormedRing S] [NonUnitalRingHomClass F R S] (f : F) - (hf : Function.Injective f) : NormedCommRing R := fast_instance% + (hf : Function.Injective f) : NormedCommRing R := { SeminormedCommRing.induced R S f, NormedAddCommGroup.induced R S f hf with } /-- A ring homomorphism from a `Ring R` to a `SeminormedRing S` which induces the norm structure @@ -887,17 +885,17 @@ namespace SubringClass variable {S R : Type*} [SetLike S R] instance toSeminormedRing [SeminormedRing R] [SubringClass S R] (s : S) : SeminormedRing s := - fast_instance% SeminormedRing.induced s R (SubringClass.subtype s) + SeminormedRing.induced s R (SubringClass.subtype s) instance toNormedRing [NormedRing R] [SubringClass S R] (s : S) : NormedRing s := - fast_instance% NormedRing.induced s R (SubringClass.subtype s) Subtype.val_injective + NormedRing.induced s R (SubringClass.subtype s) Subtype.val_injective instance toSeminormedCommRing [SeminormedCommRing R] [_h : SubringClass S R] (s : S) : SeminormedCommRing s := - fast_instance% SeminormedCommRing.induced s R (SubringClass.subtype s) + { SubringClass.toSeminormedRing s with mul_comm := mul_comm } instance toNormedCommRing [NormedCommRing R] [SubringClass S R] (s : S) : NormedCommRing s := - fast_instance% NormedCommRing.induced s R (SubringClass.subtype s) Subtype.val_injective + { SubringClass.toNormedRing s with mul_comm := mul_comm } instance toNormOneClass [SeminormedRing R] [NormOneClass R] [SubringClass S R] (s : S) : NormOneClass s := diff --git a/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean b/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean new file mode 100644 index 00000000000000..4d72d233d1067c --- /dev/null +++ b/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean @@ -0,0 +1,7 @@ +module -- shake: keep-all + +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Data.EReal.Operations +public import Mathlib.Topology.MetricSpace.Bounded + +deprecated_module (since := "2025-09-16") diff --git a/Mathlib/Analysis/NormedSpace/Extend.lean b/Mathlib/Analysis/NormedSpace/Extend.lean new file mode 100644 index 00000000000000..39f8e831289bef --- /dev/null +++ b/Mathlib/Analysis/NormedSpace/Extend.lean @@ -0,0 +1,10 @@ +module -- shake: keep-all + +public import Mathlib.Algebra.Order.Algebra +public import Mathlib.Algebra.Order.BigOperators.Expect +public import Mathlib.Analysis.Normed.Group.Basic +public import Mathlib.Data.EReal.Inv +public import Mathlib.Data.Real.Sqrt +public import Mathlib.Tactic.ContinuousFunctionalCalculus + +deprecated_module (since := "2025-09-18") diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean index cfe072fa878d43..afa2cee31dc46a 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean @@ -66,7 +66,6 @@ lemma cos_ne_zero_of_arctan_bounds {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π rwa [show 2 * k + 1 = 1 by lia, Int.cast_one, one_mul] at nr · exact Or.inr ni -set_option linter.flexible false in -- TODO: fix non-terminal simp theorem arctan_tan {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π / 2) < z.re) (h₂ : z.re ≤ π / 2) : arctan (tan z) = z := by have h := cos_ne_zero_of_arctan_bounds h₀ h₁ h₂ @@ -78,7 +77,7 @@ theorem arctan_tan {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π / 2) < z.re) (h rw [sub_eq_add_neg, ← neg_mul, ← sin_neg, ← cos_neg] rw [← exp_mul_I, ← exp_mul_I, ← exp_sub, show z * I - -z * I = 2 * (I * z) by ring, log_exp, show -I / 2 * (2 * (I * z)) = -(I * I) * z by ring, I_mul_I, neg_neg, one_mul] - all_goals simp + all_goals norm_num · rwa [← div_lt_iff₀' two_pos, neg_div] · rwa [← le_div_iff₀' two_pos] diff --git a/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean index 96f7c817bb4104..eebd2299889ae1 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean @@ -222,7 +222,6 @@ hypothesis on the interval, but assuming the measure is the volume. theorem intervalIntegrable_log (h : (0 : ℝ) ∉ [[a, b]]) : IntervalIntegrable log μ a b := IntervalIntegrable.log continuousOn_id fun _ hx => ne_of_mem_of_not_mem hx h -set_option linter.flexible false in -- TODO: fix non-terminal simp /-- The real logarithm is interval integrable (with respect to the volume measure) on every interval. See `intervalIntegrable_log` for a version applying to any locally finite measure, but with an @@ -244,7 +243,7 @@ theorem intervalIntegrable_log' : IntervalIntegrable log volume a b := by norm_num at * simpa using (hasDerivAt_id s).sub (hasDerivAt_mul_log hs.ne.symm) · intro s ⟨hs₁, hs₂⟩ - simp at * + norm_num at * exact (log_nonpos_iff hs₁.le).mpr hs₂.le · -- Show integrability on [1…t] by continuity apply ContinuousOn.intervalIntegrable diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean index 641a97b51d9aad..3aa15a92e4cb0e 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean @@ -263,7 +263,8 @@ theorem arccos_eq_arctan (h : 0 < x) : arccos x = arctan (√(1 - x ^ 2) / x) := theorem arctan_inv_of_pos (h : 0 < x) : arctan x⁻¹ = π / 2 - arctan x := by rw [← arctan_tan (x := _ - _), tan_pi_div_two_sub, tan_arctan] - · simpa using (arctan_lt_pi_div_two x).trans (half_lt_self_iff.mpr pi_pos) + · norm_num + exact (arctan_lt_pi_div_two x).trans (half_lt_self_iff.mpr pi_pos) · rw [sub_lt_self_iff, ← arctan_zero] exact tanOrderIso.symm.strictMono h diff --git a/Mathlib/CategoryTheory/Abelian/Basic.lean b/Mathlib/CategoryTheory/Abelian/Basic.lean index 38d5733628c607..e0b738a47948b4 100644 --- a/Mathlib/CategoryTheory/Abelian/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Basic.lean @@ -421,6 +421,7 @@ variable {Z : C} (g : Y ⟶ Z) @[simp] lemma coimage.comp_π_eq_zero : f ≫ coimage.π g = 0 ↔ f ≫ g = 0 := by simp [← cancel_mono (Abelian.factorThruCoimage _)] +set_option backward.isDefEq.respectTransparency false in /-- `Abelian.image` as a functor from the arrow category. -/ @[simps] def im : Arrow C ⥤ C where @@ -429,6 +430,7 @@ def im : Arrow C ⥤ C where @[deprecated (since := "2025-10-31")] noncomputable alias imageFunctor := im +set_option backward.isDefEq.respectTransparency false in /-- `Abelian.coimage` as a functor from the arrow category. -/ @[simps] def coim : Arrow C ⥤ C where @@ -438,6 +440,7 @@ def coim : Arrow C ⥤ C where @[deprecated (since := "2025-10-31")] noncomputable alias coimageFunctor := coim +set_option backward.isDefEq.respectTransparency false in /-- The image and coimage of an arrow are naturally isomorphic. -/ @[simps!] def coimIsoIm : coim (C := C) ≅ im := diff --git a/Mathlib/CategoryTheory/Abelian/Images.lean b/Mathlib/CategoryTheory/Abelian/Images.lean index d5d83a3243edcd..00fbcfc98d6636 100644 --- a/Mathlib/CategoryTheory/Abelian/Images.lean +++ b/Mathlib/CategoryTheory/Abelian/Images.lean @@ -120,6 +120,7 @@ end Comparison variable [HasKernels C] [HasCokernels C] +set_option backward.isDefEq.respectTransparency false in /-- The coimage-image comparison morphism is functorial. -/ @[simps! obj map] def coimageImageComparisonFunctor : Arrow C ⥤ Arrow C where diff --git a/Mathlib/CategoryTheory/Adjunction/Opposites.lean b/Mathlib/CategoryTheory/Adjunction/Opposites.lean index e099420d6e8123..3991d70b08ecd0 100644 --- a/Mathlib/CategoryTheory/Adjunction/Opposites.lean +++ b/Mathlib/CategoryTheory/Adjunction/Opposites.lean @@ -78,14 +78,12 @@ set_option backward.isDefEq.respectTransparency false in `F.op ⋙ coyoneda ≅ F'.op ⋙ coyoneda`. We use this in combination with `fullyFaithfulCancelRight` to show left adjoints are unique. -/ -@[deprecated "No replacement" (since := "2026-04-11")] def leftAdjointsCoyonedaEquiv {F F' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G) : F.op ⋙ coyoneda ≅ F'.op ⋙ coyoneda := NatIso.ofComponents fun X => NatIso.ofComponents fun Y => ((adj1.homEquiv X.unop Y).trans (adj2.homEquiv X.unop Y).symm).toIso -set_option linter.deprecated false in /-- Deprecated: prefer `(Adjunction.conjugateIsoEquiv adj1 adj2).symm`. -/ @[deprecated "Use `(Adjunction.conjugateIsoEquiv adj1 adj2).symm` \ (requires `import Mathlib.CategoryTheory.Adjunction.Mates`)." (since := "2026-01-31")] diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean new file mode 100644 index 00000000000000..68499bb72dece0 --- /dev/null +++ b/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean @@ -0,0 +1,8 @@ +module -- shake: keep-all + +public import Mathlib.CategoryTheory.Category.Init +public import Mathlib.Tactic.Common +public import Mathlib.Tactic.Finiteness.Attr +public import Mathlib.Util.CompileInductive + +deprecated_module (since := "2025-10-02") diff --git a/Mathlib/CategoryTheory/Bicategory/Strict.lean b/Mathlib/CategoryTheory/Bicategory/Strict.lean new file mode 100644 index 00000000000000..047ff3cc8b9465 --- /dev/null +++ b/Mathlib/CategoryTheory/Bicategory/Strict.lean @@ -0,0 +1,5 @@ +module -- shake: keep-all + +public import Mathlib.CategoryTheory.Bicategory.Strict.Basic + +deprecated_module (since := "2025-10-02") diff --git a/Mathlib/CategoryTheory/CatCommSq.lean b/Mathlib/CategoryTheory/CatCommSq.lean index 8cdd0124163386..7901ff1fb7cd09 100644 --- a/Mathlib/CategoryTheory/CatCommSq.lean +++ b/Mathlib/CategoryTheory/CatCommSq.lean @@ -46,12 +46,12 @@ namespace CatCommSq /-- The vertical identity `CatCommSq` -/ @[instance_reducible, simps!] def vId : CatCommSq T (𝟭 C₁) (𝟭 C₂) T where - iso := Functor.rightUnitor _ ≪≫ (Functor.leftUnitor _).symm + iso := (Functor.leftUnitor _) ≪≫ (Functor.rightUnitor _).symm /-- The horizontal identity `CatCommSq` -/ @[simps!, implicit_reducible] def hId : CatCommSq (𝟭 C₁) L L (𝟭 C₃) where - iso := Functor.leftUnitor _ ≪≫ (Functor.rightUnitor _).symm + iso := (Functor.rightUnitor _) ≪≫ (Functor.leftUnitor _).symm @[reassoc (attr := simp)] lemma iso_hom_naturality [h : CatCommSq T L R B] {x y : C₁} (f : x ⟶ y) : diff --git a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean index e3f7f3cfac935e..eb9054caf414a6 100644 --- a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean +++ b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean @@ -25,6 +25,7 @@ universe w w' v u namespace CategoryTheory +set_option backward.isDefEq.respectTransparency false in lemma Arrow.finite_iff (C : Type u) [SmallCategory C] : Finite (Arrow C) ↔ Nonempty (FinCategory C) := by constructor @@ -69,6 +70,7 @@ lemma small_of_small_arrow (C : Type u) [Category.{v} C] [Small.{w} (Arrow C)] : Small.{w} C := small_of_injective (f := fun X ↦ Arrow.mk (𝟙 X)) (fun _ _ h ↦ congr_arg Comma.left h) +set_option backward.isDefEq.respectTransparency false in lemma locallySmall_of_small_arrow (C : Type u) [Category.{v} C] [Small.{w} (Arrow C)] : LocallySmall.{w} C where hom_small X Y := diff --git a/Mathlib/CategoryTheory/Functor/Category.lean b/Mathlib/CategoryTheory/Functor/Category.lean index 217c5ec85576be..361c8a7b89e484 100644 --- a/Mathlib/CategoryTheory/Functor/Category.lean +++ b/Mathlib/CategoryTheory/Functor/Category.lean @@ -113,7 +113,7 @@ def hcomp {H I : D ⥤ E} (α : F ⟶ G) (β : H ⟶ I) : F ⋙ H ⟶ G ⋙ I wh -- Horizontal composition has two possible definitions that are dual to each other, -- and we need to prove to `to_dual` that these are equivalent. -attribute [to_dual none] hcomp._proof_2 hcomp._proof_3 +attribute [to_dual none] CategoryStruct.comp.hcongr_7 hcomp._proof_2 hcomp._proof_3 to_dual_insert_cast hcomp := by ext x; exact β.naturality' (α.app x) /-- Notation for horizontal composition of natural transformations. -/ diff --git a/Mathlib/CategoryTheory/Functor/TwoSquare.lean b/Mathlib/CategoryTheory/Functor/TwoSquare.lean index 74399495305683..f1cfcac03cea96 100644 --- a/Mathlib/CategoryTheory/Functor/TwoSquare.lean +++ b/Mathlib/CategoryTheory/Functor/TwoSquare.lean @@ -82,7 +82,7 @@ lemma ext (w w' : TwoSquare T L R B) (h : ∀ (X : C₁), w.natTrans.app X = w'. /-- The horizontal identity 2-square. -/ @[simps!] def hId (L : C₁ ⥤ C₃) : TwoSquare (𝟭 _) L L (𝟭 _) := - (Functor.leftUnitor L).hom ≫ (Functor.rightUnitor L).inv + 𝟙 _ /-- Notation for the horizontal identity 2-square. -/ scoped notation "𝟙ₕ" => hId -- type as \b1\_h @@ -90,7 +90,7 @@ scoped notation "𝟙ₕ" => hId -- type as \b1\_h /-- The vertical identity 2-square. -/ @[simps!] def vId (T : C₁ ⥤ C₂) : TwoSquare T (𝟭 _) (𝟭 _) T := - (Functor.rightUnitor T).hom ≫ (Functor.leftUnitor T).inv + 𝟙 _ /-- Notation for the vertical identity 2-square. -/ scoped notation "𝟙ᵥ" => vId -- type as \b1\_v diff --git a/Mathlib/CategoryTheory/Galois/EssSurj.lean b/Mathlib/CategoryTheory/Galois/EssSurj.lean index fdf261307e9855..930acfe88ab4eb 100644 --- a/Mathlib/CategoryTheory/Galois/EssSurj.lean +++ b/Mathlib/CategoryTheory/Galois/EssSurj.lean @@ -67,6 +67,7 @@ private local instance fintypeQuotientStabilizer {X : Type*} [MulAction G X] Fintype (G ⧸ (MulAction.stabilizer (G) x)) := fintypeQuotient ⟨MulAction.stabilizer (G) x, stabilizer_isOpen (G) x⟩ +set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- If `X` is a finite discrete `G`-set, it can be written as the finite disjoint union diff --git a/Mathlib/CategoryTheory/Iso.lean b/Mathlib/CategoryTheory/Iso.lean index 7b379668d96b5a..567a64a98c6f08 100644 --- a/Mathlib/CategoryTheory/Iso.lean +++ b/Mathlib/CategoryTheory/Iso.lean @@ -63,6 +63,7 @@ structure Iso {C : Type u} [Category.{v} C] (X Y : C) where attribute [to_dual existing inv] Iso.hom attribute [to_dual self] Iso.mk Iso.casesOn +attribute [to_dual none] Iso.mk.hcongr_8 -- needed in `Iso.ext` attribute [reassoc +to_dual (attr := simp), grind =] Iso.hom_inv_id Iso.inv_hom_id diff --git a/Mathlib/CategoryTheory/Limits/Cones.lean b/Mathlib/CategoryTheory/Limits/Cones.lean index 94aef55cb0f8e2..ca7f0422ce00d3 100644 --- a/Mathlib/CategoryTheory/Limits/Cones.lean +++ b/Mathlib/CategoryTheory/Limits/Cones.lean @@ -244,7 +244,7 @@ structure CoconeMorphism (A B : Cocone F) where w (j : J) : dsimp% A.ι.app j ≫ hom = B.ι.app j := by cat_disch attribute [reassoc (attr := simp)] ConeMorphism.w CoconeMorphism.w -attribute [to_dual existing] ConeMorphism.casesOn +attribute [to_dual existing] ConeMorphism.mk.congr_simp ConeMorphism.casesOn @[to_dual] instance inhabitedConeMorphism (A : Cone F) : Inhabited (ConeMorphism A A) := diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean index 190f58032e2c49..aaee3fe1f2c589 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean @@ -146,6 +146,7 @@ def ofIsoComp {X' : C} (g : X' ⟶ X) [IsIso g] (F : MonoFactorisation (g ≫ f) m := F.m e := inv g ≫ F.e +set_option backward.isDefEq.respectTransparency false in /-- If `f` and `g` are isomorphic arrows, then a mono factorisation of `f` gives a mono factorisation of `g` -/ @[simps] @@ -697,6 +698,7 @@ instance inhabitedImageMap {f : Arrow C} [HasImage f.hom] : Inhabited (ImageMap attribute [reassoc (attr := simp)] ImageMap.map_ι +set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] theorem ImageMap.factor_map {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g) (m : ImageMap sq) : factorThruImage f.hom ≫ m.map = sq.left ≫ factorThruImage g.hom := @@ -732,6 +734,7 @@ def HasImageMap.imageMap {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : [HasImageMap sq] : ImageMap sq := Classical.choice <| @HasImageMap.has_image_map _ _ _ _ _ _ sq _ +set_option backward.isDefEq.respectTransparency false in -- see Note [lower instance priority] instance (priority := 100) hasImageMapOfIsIso {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g) [IsIso sq] : HasImageMap sq := @@ -742,6 +745,7 @@ instance (priority := 100) hasImageMapOfIsIso {f g : Arrow C} [HasImage f.hom] [ image.lift_fac, Category.assoc, ← Comma.comp_right, IsIso.hom_inv_id, Comma.id_right, Category.comp_id] } +set_option backward.isDefEq.respectTransparency false in instance HasImageMap.comp {f g h : Arrow C} [HasImage f.hom] [HasImage g.hom] [HasImage h.hom] (sq1 : f ⟶ g) (sq2 : g ⟶ h) [HasImageMap sq1] [HasImageMap sq2] : HasImageMap (sq1 ≫ sq2) := HasImageMap.mk @@ -782,9 +786,11 @@ variable [HasImageMap sq] abbrev image.map : image f.hom ⟶ image g.hom := (HasImageMap.imageMap sq).map +set_option backward.isDefEq.respectTransparency false in theorem image.factor_map : factorThruImage f.hom ≫ image.map sq = sq.left ≫ factorThruImage g.hom := by simp +set_option backward.isDefEq.respectTransparency false in theorem image.map_ι : image.map sq ≫ image.ι g.hom = image.ι f.hom ≫ sq.right := by simp theorem image.map_homMk'_ι {X Y P Q : C} {k : X ⟶ Y} [HasImage k] {l : P ⟶ Q} [HasImage l] @@ -797,6 +803,7 @@ section variable {h : Arrow C} [HasImage h.hom] (sq' : g ⟶ h) variable [HasImageMap sq'] +set_option backward.isDefEq.respectTransparency false in /-- Image maps for composable commutative squares induce an image map in the composite square. -/ def imageMapComp : ImageMap (sq ≫ sq') where map := image.map sq ≫ image.map sq' @@ -940,6 +947,7 @@ section HasStrongEpiImages variable [HasImages C] +set_option backward.isDefEq.respectTransparency false in /-- A category with strong epi images has image maps. -/ instance (priority := 100) hasImageMapsOfHasStrongEpiImages [HasStrongEpiImages C] : HasImageMaps C where diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean index 84f3d879002cd1..d57e5e570447a1 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean @@ -1280,6 +1280,7 @@ instance (priority := 100) hasCokernels_of_hasCoequalizers [HasCoequalizers C] : section HasKernels variable [HasKernels C] +set_option backward.isDefEq.respectTransparency false in /-- The kernel of an arrow is natural. -/ @[simps] noncomputable def ker : Arrow C ⥤ C where @@ -1296,6 +1297,7 @@ end HasKernels section HasCokernels variable [HasCokernels C] +set_option backward.isDefEq.respectTransparency false in /-- The cokernel of an arrow is natural. -/ @[simps] noncomputable def coker : Arrow C ⥤ C where diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean index 4b9d7d20fba518..cd81d84b77070f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean @@ -137,6 +137,7 @@ variable {f₁ f₁' : Arrow C₁} {f₂ : Arrow C₂} (sq₁₂ : F.PushoutObjObj f₁.hom f₂.hom) (sq₁₂' : F.PushoutObjObj f₁'.hom f₂.hom) +set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁'` and `f₂ : Arrow C₂`, and a morphism `f₁ ⟶ f₁'`, this defines a morphism between the induced pushout maps. -/ @@ -168,6 +169,7 @@ lemma mapArrowLeft_comp {f₁'' : Arrow C₁} (sq₁₂'' : F.PushoutObjObj f₁ mapArrowLeft sq₁₂ sq₁₂' sq ≫ mapArrowLeft sq₁₂' sq₁₂'' sq' = mapArrowLeft sq₁₂ sq₁₂'' (sq ≫ sq') := by cat_disch +set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁'` and `f₂ : Arrow C₂`, and an isomorphism `f₁ ≅ f₁'`, this defines an isomorphism of the induced pushout maps. -/ @@ -181,6 +183,7 @@ variable {f₁ : Arrow C₁} {f₂ f₂' : Arrow C₂} (sq₁₂ : F.PushoutObjObj f₁.hom f₂.hom) (sq₁₂' : F.PushoutObjObj f₁.hom f₂'.hom) +set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁` and `f₂' : Arrow C₂`, and a morphism `f₂ ⟶ f₂'`, this defines a morphism between the induced pushout maps. -/ @@ -213,6 +216,7 @@ lemma mapArrowRight_comp {f₂'' : Arrow C₂} (sq₁₂'' : F.PushoutObjObj f mapArrowRight sq₁₂ sq₁₂' sq ≫ mapArrowRight sq₁₂' sq₁₂'' sq' = mapArrowRight sq₁₂ sq₁₂'' (sq ≫ sq') := by cat_disch +set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁` and `f₂' : Arrow C₂`, and an isomorphism `f₂ ≅ f₂'`, this defines an isomorphism of the induced pushout maps. -/ @@ -315,6 +319,7 @@ variable {f₁ f₁' : Arrow C₁} {f₃ : Arrow C₃} (sq₁₃ : G.PullbackObjObj f₁.hom f₃.hom) (sq₁₃' : G.PullbackObjObj f₁'.hom f₃.hom) +set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁'` and `f₃ : Arrow C₃`, and a morphism `f₁' ⟶ f₁`, this defines a morphism between the induced pullback maps. -/ @@ -347,6 +352,7 @@ lemma mapArrowLeft_comp {f₁'' : Arrow C₁} (sq₁₃'' : G.PullbackObjObj f mapArrowLeft sq₁₃ sq₁₃' sq ≫ mapArrowLeft sq₁₃' sq₁₃'' sq' = mapArrowLeft sq₁₃ sq₁₃'' (sq' ≫ sq) := by cat_disch +set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁'` and `f₃ : Arrow C₃`, and an isomorphism `f₁ ≅ f₁'`, this defines an isomorphism of the induced pullback maps. -/ @@ -360,6 +366,7 @@ variable {f₁ : Arrow C₁} {f₃ f₃' : Arrow C₃} (sq₁₃ : G.PullbackObjObj f₁.hom f₃.hom) (sq₁₃' : G.PullbackObjObj f₁.hom f₃'.hom) +set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁` and `f₃' : Arrow C₃`, and a morphism `f₃ ⟶ f₃'`, this defines a morphism between the induced pullback maps. -/ @@ -391,6 +398,7 @@ lemma mapArrowRight_comp {f₃'' : Arrow C₃} (sq₁₃'' : G.PullbackObjObj f mapArrowRight sq₁₃ sq₁₃' sq ≫ mapArrowRight sq₁₃' sq₁₃'' sq' = mapArrowRight sq₁₃ sq₁₃'' (sq ≫ sq') := by cat_disch +set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁` and `f₃' : Arrow C₃`, and an isomorphism `f₃ ≅ f₃'`, this defines an isomorphism of the induced pullback maps. -/ diff --git a/Mathlib/CategoryTheory/Limits/Types/Images.lean b/Mathlib/CategoryTheory/Limits/Types/Images.lean index 77857c6f55e2d7..34d258191eede6 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Images.lean @@ -71,6 +71,7 @@ instance : HasImage f := instance : HasImages (Type u) where has_image := by infer_instance +set_option backward.isDefEq.respectTransparency false in instance : HasImageMaps (Type u) where has_image_map {f g} st := HasImageMap.transport st (monoFactorisation f.hom) (isImage g.hom) diff --git a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean index 2f07fd2269e5b9..3694912a8b4857 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 false in /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/ @[simps] def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C where diff --git a/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean b/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean index bbb73d9a63bff0..6799b2bee8a431 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean @@ -44,6 +44,7 @@ instance isSmall_ofHoms {ι : Type t} [Small.{w} ι] {A B : ι → C} (f : ∀ i exact ⟨i, rfl⟩ exact ⟨small_of_surjective hφ⟩ +set_option backward.isDefEq.respectTransparency false in lemma isSmall_iff_eq_ofHoms : IsSmall.{w} W ↔ ∃ (ι : Type w) (A B : ι → C) (f : ∀ i, A i ⟶ B i), W = ofHoms f := by diff --git a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean index 4ede1bf09046c6..1e467fe9450af8 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean @@ -82,12 +82,14 @@ lemma pushouts_monotone : Monotone (pushouts (C := C)) := by rintro _ _ h _ _ _ ⟨_, _, _, _, _, hp, sq⟩ exact ⟨_, _, _, _, _, h _ hp, sq⟩ +set_option backward.isDefEq.respectTransparency false in instance : P.pushouts.RespectsIso := RespectsIso.of_respects_arrow_iso _ (by rintro q q' e ⟨A, B, p, f, g, hp, h⟩ exact ⟨A, B, p, f ≫ e.hom.left, g ≫ e.hom.right, hp, IsPushout.paste_horiz h (IsPushout.of_horiz_isIso ⟨e.hom.w⟩)⟩) +set_option backward.isDefEq.respectTransparency false in instance : P.pullbacks.RespectsIso := RespectsIso.of_respects_arrow_iso _ (by rintro q q' e ⟨X, Y, p, f, g, hp, h⟩ diff --git a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean index c3209cc29684a2..95110fe29d5c97 100644 --- a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean +++ b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean @@ -60,7 +60,7 @@ class ShiftSequence where @[implicit_reducible] noncomputable def ShiftSequence.tautological : ShiftSequence F M where sequence n := shiftFunctor C n ⋙ F - isoZero := isoWhiskerRight (shiftFunctorZero C M) F ≪≫ F.leftUnitor + isoZero := isoWhiskerRight (shiftFunctorZero C M) F ≪≫ F.rightUnitor shiftIso n a a' ha' := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (shiftFunctorAdd' C n a a' ha').symm _ shiftIso_zero a := by diff --git a/Mathlib/CategoryTheory/Sites/Grothendieck.lean b/Mathlib/CategoryTheory/Sites/Grothendieck.lean index c990e6239237d3..087d5427a22a7c 100644 --- a/Mathlib/CategoryTheory/Sites/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Sites/Grothendieck.lean @@ -347,6 +347,7 @@ theorem bot_covers (S : Sieve X) (f : Y ⟶ X) : (⊥ : GrothendieckTopology C). theorem top_covers (S : Sieve X) (f : Y ⟶ X) : (⊤ : GrothendieckTopology C).Covers S f := by simp [covers_iff] +set_option backward.isDefEq.respectTransparency false in lemma eq_top_iff (J : GrothendieckTopology C) : J = ⊤ ↔ ∀ X, ⊥ ∈ J X := by refine ⟨fun h ↦ h ▸ by simp, fun h ↦ ?_⟩ rw [_root_.eq_top_iff] diff --git a/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean b/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean index 9ac93937563bb8..dec9f482d85eb1 100644 --- a/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean +++ b/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean @@ -72,6 +72,7 @@ lemma generate_mem_toGrothendieck {X : C} {R : Presieve X} (hR : R ∈ J X) : Sieve.generate R ∈ J.toGrothendieck X := .of _ _ hR +set_option backward.isDefEq.respectTransparency false in /-- An alternative characterization of the Grothendieck topology associated to a precoverage `J`: it is the infimum of all Grothendieck topologies containing `Sieve.generate S` for all presieves @@ -311,10 +312,12 @@ lemma galoisConnection_toGrothendieck_toPrecoverage : end Precoverage +set_option backward.isDefEq.respectTransparency false in @[simp, grind =] lemma Precoverage.toGrothendieck_bot : toGrothendieck (⊥ : Precoverage C) = ⊥ := (galoisConnection_toGrothendieck_toPrecoverage C).l_bot +set_option backward.isDefEq.respectTransparency false in @[simp, grind =] lemma GrothendieckTopology.toPrecoverage_top : toPrecoverage (⊤ : GrothendieckTopology C) = ⊤ := (Precoverage.galoisConnection_toGrothendieck_toPrecoverage C).u_top diff --git a/Mathlib/CategoryTheory/Sites/Pretopology.lean b/Mathlib/CategoryTheory/Sites/Pretopology.lean index 2092307cd57d1d..0b7b1da9024d33 100644 --- a/Mathlib/CategoryTheory/Sites/Pretopology.lean +++ b/Mathlib/CategoryTheory/Sites/Pretopology.lean @@ -212,6 +212,7 @@ instance orderBot : OrderBot (Pretopology C) where rintro ⟨Y, f, hf, rfl⟩ exact K.has_isos f +set_option backward.isDefEq.respectTransparency false in /-- The trivial pretopology induces the trivial Grothendieck topology. -/ theorem toGrothendieck_bot : toGrothendieck (C := C) ⊥ = ⊥ := (gi C).gc.l_bot diff --git a/Mathlib/CategoryTheory/Sites/Spaces.lean b/Mathlib/CategoryTheory/Sites/Spaces.lean index 9f424a1beef31f..6a7400bad5b23c 100644 --- a/Mathlib/CategoryTheory/Sites/Spaces.lean +++ b/Mathlib/CategoryTheory/Sites/Spaces.lean @@ -57,6 +57,7 @@ def grothendieckTopology : GrothendieckTopology (Opens T) where rcases hR hf _ hU with ⟨V, g, hg, hV⟩ exact ⟨_, g ≫ f, hg, hV⟩ +set_option backward.isDefEq.respectTransparency false in /-- The Grothendieck pretopology associated to a topological space. -/ def pretopology : Pretopology (Opens T) where coverings X := {R | ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), R f ∧ x ∈ U} @@ -72,6 +73,7 @@ def pretopology : Pretopology (Opens T) where rcases hTi f hf x hU with ⟨V, g, hg, hV⟩ exact ⟨_, _, ⟨_, g, f, hf, hg, rfl⟩, hV⟩ +set_option backward.isDefEq.respectTransparency false in /-- The pretopology associated to a space is the largest pretopology that generates the Grothendieck topology associated to the space. -/ @[simp] @@ -85,6 +87,7 @@ theorem toPretopology_grothendieckTopology : rcases hR x hx with ⟨U, f, hf, hU⟩ exact ⟨U, f, Sieve.le_generate R U _ hf, hU⟩ +set_option backward.isDefEq.respectTransparency false in /-- The pretopology associated to a space induces the Grothendieck topology associated to the space. -/ @[simp] diff --git a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean index e2b7aac1f7a85b..b53c3e024b96f3 100644 --- a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean +++ b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean @@ -442,6 +442,7 @@ lemma πObj_naturality {f g : Arrow C} (φ : f ⟶ g) : rw [← assoc] apply comp_id +set_option backward.isDefEq.respectTransparency false 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`. -/ @[simps] diff --git a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean index 84f32407b32c63..8cecbd6f36a64c 100644 --- a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean +++ b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean @@ -212,9 +212,10 @@ theorem rothNumberNat_le_ruzsaSzemerediNumberNat' : mul_le_mul_of_nonneg_right ?_ (Nat.cast_nonneg _) _ ≤ (ruzsaSzemerediNumberNat (6 * (n / 6) + 3) : ℝ) := ?_ _ ≤ _ := by grw [Nat.mul_div_le] - · simp only [cast_add, cast_ofNat, cast_mul, cast_one, tsub_le_iff_right] + · norm_num rw [← div_add_one (three_ne_zero' ℝ), ← le_sub_iff_add_le, div_le_iff₀ (zero_lt_three' ℝ), - add_assoc, add_sub_assoc, add_mul, mul_right_comm, add_sub_cancel_left] + add_assoc, add_sub_assoc, add_mul, mul_right_comm] + norm_num norm_cast rw [← mul_add_one] exact (Nat.lt_mul_div_succ _ <| by simp).le diff --git a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean index dc25d0afbcfa1a..a8976fcfe16ed7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean @@ -491,6 +491,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 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/Cayley.lean b/Mathlib/Combinatorics/SimpleGraph/Cayley.lean index 2fe8715424ccea..b686ebd9e34893 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Cayley.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Cayley.lean @@ -64,6 +64,7 @@ instance [Fintype M] [DecidableEq M] [DecidablePred (· ∈ s)] : DecidableRel (mulCayley s).Adj := fun u v => decidable_of_iff (u ≠ v ∧ ∃ g ∈ s, u * g = v ∨ u = v * g) (mulCayley_adj' s u v).symm +set_option backward.isDefEq.respectTransparency false in variable (M) in /-- `mulCayley` is a left (order-)adjoint. -/ @[to_additive] @@ -80,6 +81,7 @@ theorem mulCayley_monotone : Monotone (mulCayley (M := M) ·) := theorem mulCayley_mono {U V : Set M} (hUV : U ⊆ V) : mulCayley U ≤ mulCayley V := mulCayley_monotone hUV +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem mulCayley_empty : mulCayley (∅ : Set M) = ⊥ := (mulCayley_gc M).l_bot diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean index b85ac2497786bf..c0f5e2e8dc798d 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean @@ -85,6 +85,7 @@ end Fintype infinite components. -/ abbrev oddComponents : Set G.ConnectedComponent := {c : G.ConnectedComponent | Odd c.supp.ncard} +set_option backward.isDefEq.respectTransparency 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 diff --git a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean index fc80ac86a5696c..fc400244654d42 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean @@ -181,6 +181,7 @@ lemma not_adj_iff_part_eq [DecidableEq V] : change t ∈ fp.part s ↔ fp.part s = fp.part t rw [fp.mem_part_iff_part_eq_part (mem_univ t) (mem_univ s), eq_comm] +set_option backward.isDefEq.respectTransparency false in lemma degree_eq_card_sub_part_card [DecidableEq V] : G.degree s = card V - #(h.finpartition.part s) := calc diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean index 17cbb462f70343..3b7f1e38303a4a 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean @@ -442,12 +442,13 @@ private theorem edgeDensity_star_not_uniform [Nonempty α] have hqt : |q - t| ≤ ε ^ 5 / 49 := by have := average_density_near_total_density hPα hPε hε₁ (Subset.refl (chunk hP G ε hU).parts) (Subset.refl (chunk hP G ε hV).parts) - simpa [← sup_eq_biUnion, sup_parts, card_chunk (m_pos hPα).ne'] + simp_rw [← sup_eq_biUnion, sup_parts, card_chunk (m_pos hPα).ne', cast_pow] at this + norm_num at this + exact this have hε' : ε ^ 5 ≤ ε := by simpa using pow_le_pow_of_le_one (by sz_positivity) hε₁ (show 1 ≤ 5 by simp) grind -set_option linter.flexible false in -- TODO: fix non-terminal simp /-- Lower bound on the edge densities between non-uniform parts of `SzemerediRegularity.increment`. -/ theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : #P.parts * 16 ^ #P.parts ≤ card α) @@ -476,7 +477,7 @@ theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : #P.parts * 16 ^ #P.p refine le_trans ?_ (mul_le_mul_of_nonneg_right UVl ?_) · norm_num nlinarith - · simp + · norm_num positivity _ ≤ (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts, (G.edgeDensity ab.1 ab.2 : ℝ) ^ 2) / ↑16 ^ #P.parts := by @@ -492,7 +493,8 @@ theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : #P.parts * 16 ^ #P.p norm_num at this exact this · simp_rw [sp, card_product, card_chunk (m_pos hPα).ne', ← mul_pow] - simpa using edgeDensity_star_not_uniform hPα hPε hε₁ hUVne hUV + norm_num + exact edgeDensity_star_not_uniform hPα hPε hε₁ hUVne hUV · rw [sp, card_product] apply (edgeDensity_chunk_aux hP hPα hPε hU hV).trans · rw [card_chunk (m_pos hPα).ne', card_chunk (m_pos hPα).ne', ← mul_pow] diff --git a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean index d53e9234cef80d..811941d32904b9 100644 --- a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean +++ b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean @@ -54,6 +54,7 @@ structure IsSRGWith (n k ℓ μ : ℕ) : Prop where variable {G} {n k ℓ μ : ℕ} +set_option backward.isDefEq.respectTransparency false in /-- Empty graphs are strongly regular. Note that `ℓ` can take any value for empty graphs, since there are no pairs of adjacent vertices. -/ theorem bot_strongly_regular : (⊥ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 ℓ 0 where diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index 079af559e8e417..ae5bfd71d5d8bd 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -79,6 +79,7 @@ theorem smul_top {R : Type*} [Semiring R] [IsDomain R] [Module R ℝ≥0∞] [Is lemma nnreal_smul_lt_top {x : ℝ≥0} {y : ℝ≥0∞} (hy : y < ⊤) : x • y < ⊤ := mul_lt_top (by simp) hy lemma nnreal_smul_ne_top {x : ℝ≥0} {y : ℝ≥0∞} (hy : y ≠ ⊤) : x • y ≠ ⊤ := mul_ne_top (by simp) hy +set_option backward.isDefEq.respectTransparency false in lemma nnreal_smul_ne_top_iff {x : ℝ≥0} {y : ℝ≥0∞} (hx : x ≠ 0) : x • y ≠ ⊤ ↔ y ≠ ⊤ := ⟨by rintro h rfl; simp [smul_top (R := ℝ≥0), hx] at h, nnreal_smul_ne_top⟩ diff --git a/Mathlib/Data/Finset/Lattice/Prod.lean b/Mathlib/Data/Finset/Lattice/Prod.lean index 0b9096a0ef3882..4f66e2d5f7d4ba 100644 --- a/Mathlib/Data/Finset/Lattice/Prod.lean +++ b/Mathlib/Data/Finset/Lattice/Prod.lean @@ -24,6 +24,8 @@ variable {F α β γ ι κ : Type*} namespace Finset +/-! ### sup -/ + section Sup @@ -31,12 +33,10 @@ section Sup variable [SemilatticeSup α] [OrderBot α] /-- See also `Finset.product_biUnion`. -/ -@[to_dual inf_product_left] theorem sup_product_left (s : Finset β) (t : Finset γ) (f : β × γ → α) : (s ×ˢ t).sup f = s.sup fun i => t.sup fun i' => f ⟨i, i'⟩ := eq_of_forall_ge_iff fun a => by simp [@forall_comm _ γ] -@[to_dual inf_product_right] theorem sup_product_right (s : Finset β) (t : Finset γ) (f : β × γ → α) : (s ×ˢ t).sup f = t.sup fun i' => s.sup fun i => f ⟨i, i'⟩ := by rw [sup_product_left, Finset.sup_comm] @@ -45,8 +45,7 @@ section Prod variable {ι κ α β : Type*} [SemilatticeSup α] [SemilatticeSup β] [OrderBot α] [OrderBot β] {s : Finset ι} {t : Finset κ} -@[to_dual (attr := simp)] -lemma sup_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : +@[simp] lemma sup_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : sup (s ×ˢ t) (Prod.map f g) = (sup s f, sup t g) := eq_of_forall_ge_iff fun i ↦ by obtain ⟨a, ha⟩ := hs @@ -58,17 +57,58 @@ end Prod end Sup +/-! ### inf -/ + + +section Inf + +-- TODO: define with just `[Top α]` where some lemmas hold without requiring `[OrderTop α]` +variable [SemilatticeInf α] [OrderTop α] + +theorem inf_product_left (s : Finset β) (t : Finset γ) (f : β × γ → α) : + (s ×ˢ t).inf f = s.inf fun i => t.inf fun i' => f ⟨i, i'⟩ := + @sup_product_left αᵒᵈ _ _ _ _ _ _ _ + +theorem inf_product_right (s : Finset β) (t : Finset γ) (f : β × γ → α) : + (s ×ˢ t).inf f = t.inf fun i' => s.inf fun i => f ⟨i, i'⟩ := + @sup_product_right αᵒᵈ _ _ _ _ _ _ _ + +section Prod +variable {ι κ α β : Type*} [SemilatticeInf α] [SemilatticeInf β] [OrderTop α] [OrderTop β] + {s : Finset ι} {t : Finset κ} + +@[simp] lemma inf_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : + inf (s ×ˢ t) (Prod.map f g) = (inf s f, inf t g) := + sup_prodMap (α := αᵒᵈ) (β := βᵒᵈ) hs ht _ _ + +end Prod + +end Inf + section DistribLattice variable [DistribLattice α] +section OrderBot + variable [OrderBot α] {s : Finset ι} {t : Finset κ} {f : ι → α} {g : κ → α} {a : α} -@[to_dual] theorem sup_inf_sup (s : Finset ι) (t : Finset κ) (f : ι → α) (g : κ → α) : s.sup f ⊓ t.sup g = (s ×ˢ t).sup fun i => f i.1 ⊓ g i.2 := by simp_rw [Finset.sup_inf_distrib_right, Finset.sup_inf_distrib_left, sup_product_left] +end OrderBot + +section OrderTop + +variable [OrderTop α] {f : ι → α} {g : κ → α} {s : Finset ι} {t : Finset κ} {a : α} + +theorem inf_sup_inf (s : Finset ι) (t : Finset κ) (f : ι → α) (g : κ → α) : + s.inf f ⊔ t.inf g = (s ×ˢ t).inf fun i => f i.1 ⊔ g i.2 := + @sup_inf_sup αᵒᵈ _ _ _ _ _ _ _ _ + +end OrderTop + end DistribLattice section Sup' @@ -77,12 +117,10 @@ variable [SemilatticeSup α] variable {s : Finset β} (H : s.Nonempty) (f : β → α) -@[to_dual inf'_product_left] theorem sup'_product_left {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : (s ×ˢ t).sup' h f = s.sup' h.fst fun i => t.sup' h.snd fun i' => f ⟨i, i'⟩ := eq_of_forall_ge_iff fun a => by simp [@forall_comm _ γ] -@[to_dual inf'_product_right] theorem sup'_product_right {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : (s ×ˢ t).sup' h f = t.sup' h.snd fun i' => s.sup' h.fst fun i => f ⟨i, i'⟩ := by rw [sup'_product_left, Finset.sup'_comm] @@ -91,7 +129,6 @@ section Prod variable {ι κ α β : Type*} [SemilatticeSup α] [SemilatticeSup β] {s : Finset ι} {t : Finset κ} /-- See also `Finset.sup'_prodMap`. -/ -@[to_dual /-- See also `Finset.inf'_prodMap`. -/] lemma prodMk_sup'_sup' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : (sup' s hs f, sup' t ht g) = sup' (s ×ˢ t) (hs.product ht) (Prod.map f g) := eq_of_forall_ge_iff fun i ↦ by @@ -101,8 +138,7 @@ lemma prodMk_sup'_sup' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : exact ⟨by simp_all, fun h ↦ ⟨fun i hi ↦ (h _ _ hi hb).1, fun j hj ↦ (h _ _ ha hj).2⟩⟩ /-- See also `Finset.prodMk_sup'_sup'`. -/ -@[to_dual -- (attr := simp) -- TODO: Why does `Prod.map_apply` simplify the LHS? -/-- See also `Finset.prodMk_inf'_inf'`. -/] +-- @[simp] -- TODO: Why does `Prod.map_apply` simplify the LHS? lemma sup'_prodMap (hst : (s ×ˢ t).Nonempty) (f : ι → α) (g : κ → β) : sup' (s ×ˢ t) hst (Prod.map f g) = (sup' s hst.fst f, sup' t hst.snd g) := (prodMk_sup'_sup' _ _ _ _).symm @@ -111,15 +147,50 @@ end Prod end Sup' +section Inf' + +variable [SemilatticeInf α] + +variable {s : Finset β} (H : s.Nonempty) (f : β → α) + +theorem inf'_product_left {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : + (s ×ˢ t).inf' h f = s.inf' h.fst fun i => t.inf' h.snd fun i' => f ⟨i, i'⟩ := + sup'_product_left (α := αᵒᵈ) h f + +theorem inf'_product_right {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : + (s ×ˢ t).inf' h f = t.inf' h.snd fun i' => s.inf' h.fst fun i => f ⟨i, i'⟩ := + sup'_product_right (α := αᵒᵈ) h f + +section Prod +variable {ι κ α β : Type*} [SemilatticeInf α] [SemilatticeInf β] {s : Finset ι} {t : Finset κ} + +/-- See also `Finset.inf'_prodMap`. -/ +lemma prodMk_inf'_inf' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : + (inf' s hs f, inf' t ht g) = inf' (s ×ˢ t) (hs.product ht) (Prod.map f g) := + prodMk_sup'_sup' (α := αᵒᵈ) (β := βᵒᵈ) hs ht _ _ + +/-- See also `Finset.prodMk_inf'_inf'`. -/ +-- @[simp] -- TODO: Why does `Prod.map_apply` simplify the LHS? +lemma inf'_prodMap (hst : (s ×ˢ t).Nonempty) (f : ι → α) (g : κ → β) : + inf' (s ×ˢ t) hst (Prod.map f g) = (inf' s hst.fst f, inf' t hst.snd g) := + (prodMk_inf'_inf' _ _ _ _).symm + +end Prod + +end Inf' + section DistribLattice variable [DistribLattice α] {s : Finset ι} {t : Finset κ} (hs : s.Nonempty) (ht : t.Nonempty) {f : ι → α} {g : κ → α} {a : α} -@[to_dual] theorem sup'_inf_sup' (f : ι → α) (g : κ → α) : s.sup' hs f ⊓ t.sup' ht g = (s ×ˢ t).sup' (hs.product ht) fun i => f i.1 ⊓ g i.2 := by simp_rw [Finset.sup'_inf_distrib_right, Finset.sup'_inf_distrib_left, sup'_product_left] +theorem inf'_sup_inf' (f : ι → α) (g : κ → α) : + s.inf' hs f ⊔ t.inf' ht g = (s ×ˢ t).inf' (hs.product ht) fun i => f i.1 ⊔ g i.2 := + @sup'_inf_sup' αᵒᵈ _ _ _ _ _ hs ht _ _ + end DistribLattice end Finset diff --git a/Mathlib/Data/Nat/PowModTotient.lean b/Mathlib/Data/Nat/PowModTotient.lean new file mode 100644 index 00000000000000..d6f75577e89ada --- /dev/null +++ b/Mathlib/Data/Nat/PowModTotient.lean @@ -0,0 +1,8 @@ +module -- shake: keep-all + +public import Mathlib.Data.Nat.Totient +public import Mathlib.Data.Sym.Sym2 +public import Mathlib.Tactic.NormNum.GCD +public import Mathlib.Tactic.Positivity + +deprecated_module (since := "2025-09-19") diff --git a/Mathlib/Data/Real/Irrational.lean b/Mathlib/Data/Real/Irrational.lean new file mode 100644 index 00000000000000..e3386c4f2cdc1d --- /dev/null +++ b/Mathlib/Data/Real/Irrational.lean @@ -0,0 +1,5 @@ +module -- shake: keep-all + +public import Mathlib.Data.Real.Sqrt + +deprecated_module (since := "2025-10-13") diff --git a/Mathlib/Data/Set/Finite/Lattice.lean b/Mathlib/Data/Set/Finite/Lattice.lean index eb09529ebba061..2d7257d8473a03 100644 --- a/Mathlib/Data/Set/Finite/Lattice.lean +++ b/Mathlib/Data/Set/Finite/Lattice.lean @@ -282,7 +282,6 @@ theorem Infinite.sUnion {s : Set (Set α)} (hs : s.Infinite) : (⋃₀ s).Infini /-! ### Order properties -/ -@[to_dual] lemma map_finite_biSup {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] [SupBotHomClass F α β] {s : Set ι} (hs : s.Finite) (f : F) (g : ι → α) : f (⨆ x ∈ s, g x) = ⨆ x ∈ s, f (g x) := by @@ -290,14 +289,25 @@ lemma map_finite_biSup {F ι : Type*} [CompleteLattice α] [CompleteLattice β] simp only [Finset.sup_eq_iSup, hs.mem_toFinset, comp_apply] at this exact this -@[to_dual] +lemma map_finite_biInf {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] + [InfTopHomClass F α β] {s : Set ι} (hs : s.Finite) (f : F) (g : ι → α) : + f (⨅ x ∈ s, g x) = ⨅ x ∈ s, f (g x) := by + have := map_finset_inf f hs.toFinset g + simp only [Finset.inf_eq_iInf, hs.mem_toFinset, comp_apply] at this + exact this + lemma map_finite_iSup {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] [SupBotHomClass F α β] [Finite ι] (f : F) (g : ι → α) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [← iSup_univ (f := g), ← iSup_univ (f := fun i ↦ f (g i))] exact map_finite_biSup finite_univ f g -@[to_dual] +lemma map_finite_iInf {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] + [InfTopHomClass F α β] [Finite ι] (f : F) (g : ι → α) : + f (⨅ i, g i) = ⨅ i, f (g i) := by + rw [← iInf_univ (f := g), ← iInf_univ (f := fun i ↦ f (g i))] + exact map_finite_biInf finite_univ f g + theorem Finite.iSup_biInf_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι'] [Order.Frame α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} (hf : ∀ i ∈ s, Monotone (f i)) : ⨆ j, ⨅ i ∈ s, f i j = ⨅ i ∈ s, ⨆ j, f i j := by @@ -308,24 +318,41 @@ theorem Finite.iSup_biInf_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonemp simp only [iInf_insert, ← ihs hf.2] exact iSup_inf_of_monotone hf.1 fun j₁ j₂ hj => iInf₂_mono fun i hi => hf.2 i hi hj -@[to_dual] theorem Finite.iSup_biInf_of_antitone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι'] [Order.Frame α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} (hf : ∀ i ∈ s, Antitone (f i)) : ⨆ j, ⨅ i ∈ s, f i j = ⨅ i ∈ s, ⨆ j, f i j := @Finite.iSup_biInf_of_monotone ι ι'ᵒᵈ α _ _ _ _ _ hs _ fun i hi => (hf i hi).dual_left -@[to_dual] +theorem Finite.iInf_biSup_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] + [IsCodirectedOrder ι'] [Order.Coframe α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} + (hf : ∀ i ∈ s, Monotone (f i)) : ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j := + hs.iSup_biInf_of_antitone (α := αᵒᵈ) fun i hi => (hf i hi).dual_right + +theorem Finite.iInf_biSup_of_antitone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] + [IsDirectedOrder ι'] [Order.Coframe α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} + (hf : ∀ i ∈ s, Antitone (f i)) : ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j := + hs.iSup_biInf_of_monotone (α := αᵒᵈ) fun i hi => (hf i hi).dual_right + theorem _root_.iSup_iInf_of_monotone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι'] [Order.Frame α] {f : ι → ι' → α} (hf : ∀ i, Monotone (f i)) : ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j := by simpa only [iInf_univ] using finite_univ.iSup_biInf_of_monotone fun i _ => hf i -@[to_dual] theorem _root_.iSup_iInf_of_antitone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι'] [Order.Frame α] {f : ι → ι' → α} (hf : ∀ i, Antitone (f i)) : ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j := @iSup_iInf_of_monotone ι ι'ᵒᵈ α _ _ _ _ _ _ fun i => (hf i).dual_left +theorem _root_.iInf_iSup_of_monotone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] + [IsCodirectedOrder ι'] [Order.Coframe α] {f : ι → ι' → α} (hf : ∀ i, Monotone (f i)) : + ⨅ j, ⨆ i, f i j = ⨆ i, ⨅ j, f i j := + iSup_iInf_of_antitone (α := αᵒᵈ) fun i => (hf i).dual_right + +theorem _root_.iInf_iSup_of_antitone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] + [IsDirectedOrder ι'] [Order.Coframe α] {f : ι → ι' → α} (hf : ∀ i, Antitone (f i)) : + ⨅ j, ⨆ i, f i j = ⨆ i, ⨅ j, f i j := + iSup_iInf_of_monotone (α := αᵒᵈ) fun i => (hf i).dual_right + @[deprecated (since := "2026-02-03")] protected alias iSup_iInf_of_monotone := iSup_iInf_of_monotone @[deprecated (since := "2026-02-03")] protected alias iSup_iInf_of_antitone := iSup_iInf_of_antitone @[deprecated (since := "2026-02-03")] protected alias iInf_iSup_of_monotone := iInf_iSup_of_monotone @@ -373,32 +400,52 @@ section variable [Preorder α] [IsDirectedOrder α] [Nonempty α] {s : Set α} /-- A finite set is bounded above. -/ -@[to_dual /-- A finite set is bounded below. -/] protected theorem Finite.bddAbove (hs : s.Finite) : BddAbove s := Finite.induction_on _ hs bddAbove_empty fun _ _ h => h.insert _ /-- A finite union of sets which are all bounded above is still bounded above. -/ -@[to_dual /-- A finite union of sets which are all bounded below is still bounded below. -/] theorem Finite.bddAbove_biUnion {I : Set β} {S : β → Set α} (H : I.Finite) : BddAbove (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddAbove (S i) := by induction I, H using Set.Finite.induction_on with | empty => simp only [biUnion_empty, bddAbove_empty, forall_mem_empty] | insert _ _ hs => simp only [biUnion_insert, forall_mem_insert, bddAbove_union, hs] -@[to_dual] theorem infinite_of_not_bddAbove : ¬BddAbove s → s.Infinite := mt Finite.bddAbove end +section + +variable [Preorder α] [IsCodirectedOrder α] [Nonempty α] {s : Set α} + +/-- A finite set is bounded below. -/ +protected theorem Finite.bddBelow (hs : s.Finite) : BddBelow s := + Finite.bddAbove (α := αᵒᵈ) hs + +/-- A finite union of sets which are all bounded below is still bounded below. -/ +theorem Finite.bddBelow_biUnion {I : Set β} {S : β → Set α} (H : I.Finite) : + BddBelow (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddBelow (S i) := + Finite.bddAbove_biUnion (α := αᵒᵈ) H + +theorem infinite_of_not_bddBelow : ¬BddBelow s → s.Infinite := mt Finite.bddBelow + +end + end Set +namespace Finset + /-- A finset is bounded above. -/ -@[to_dual /-- A finset is bounded below. -/] -protected theorem Finset.bddAbove [SemilatticeSup α] [Nonempty α] (s : Finset α) : - BddAbove (↑s : Set α) := +protected theorem bddAbove [SemilatticeSup α] [Nonempty α] (s : Finset α) : BddAbove (↑s : Set α) := s.finite_toSet.bddAbove +/-- A finset is bounded below. -/ +protected theorem bddBelow [SemilatticeInf α] [Nonempty α] (s : Finset α) : BddBelow (↑s : Set α) := + s.finite_toSet.bddBelow + +end Finset + section LinearOrder variable [LinearOrder α] {s : Set α} diff --git a/Mathlib/Deprecated/Sort.lean b/Mathlib/Deprecated/Sort.lean new file mode 100644 index 00000000000000..3878104b79bcc4 --- /dev/null +++ b/Mathlib/Deprecated/Sort.lean @@ -0,0 +1,72 @@ +/- +Copyright (c) 2016 Jeremy Avigad. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Jeremy Avigad +-/ +module + +public import Mathlib.Init +public import Batteries.Tactic.Alias + +/-! +### The predicate `List.Sorted` (now deprecated). +-/ + +@[expose] public section + +namespace List + +universe u v + +section Sorted + +variable {α : Type u} {r : α → α → Prop} {a : α} {l : List α} + +/-- `Sorted r l` is the same as `List.Pairwise r l` and has been deprecated. +Consider using any of `SortedLE`, `SortedLT`, `SortedGE`, or `SortedGT` if the relation you're + using is a preorder. -/ +@[deprecated (since := "2025-10-11")] +alias Sorted := Pairwise + +set_option linter.deprecated false + +/-- Deprecated decidable instance for `Sorted`. -/ +@[deprecated List.instDecidablePairwise (since := "2025-10-11")] +def decidableSorted [DecidableRel r] (l : List α) : Decidable (Sorted r l) := + List.instDecidablePairwise l + +@[deprecated Pairwise.nil (since := "2025-10-11")] +theorem sorted_nil : Sorted r [] := Pairwise.nil + +@[deprecated Pairwise.of_cons (since := "2025-10-11")] +theorem Sorted.of_cons (p : Sorted r (a :: l)) : + Sorted r l := Pairwise.of_cons p + +@[deprecated Pairwise.tail (since := "2025-10-11")] +theorem Sorted.tail (h : Sorted r l) : Sorted r l.tail := Pairwise.tail h + +@[deprecated rel_of_pairwise_cons (since := "2025-10-11")] +theorem rel_of_sorted_cons (p : Sorted r (a :: l)) + {a' : α} : a' ∈ l → r a a' := rel_of_pairwise_cons p + +@[deprecated pairwise_cons (since := "2025-10-11")] +theorem sorted_cons : Sorted r (a :: l) ↔ (∀ a' ∈ l, r a a') ∧ Sorted r l := pairwise_cons + +@[deprecated Pairwise.filter (since := "2025-10-11")] +theorem Sorted.filter (p : α → Bool) : Sorted r l → Sorted r (filter p l) := Pairwise.filter p + +@[deprecated pairwise_singleton (since := "2025-10-11")] +theorem sorted_singleton (r) (a : α) : Sorted r [a] := pairwise_singleton r a + +@[deprecated Pairwise.rel_of_mem_take_of_mem_drop (since := "2025-10-11")] +theorem Sorted.rel_of_mem_take_of_mem_drop {x y i} (h : Sorted r l) + (hx : x ∈ take i l) (hy : y ∈ drop i l) : r x y := Pairwise.rel_of_mem_take_of_mem_drop h hx hy + +@[deprecated Pairwise.filterMap (since := "2025-10-11")] +theorem Sorted.filterMap (f) {s : α → α → Prop} + (H : ∀ (a a' : α), r a a' → ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → s b b') : + Sorted r l → Sorted s (filterMap f l) := Pairwise.filterMap f H + +end Sorted + +end List diff --git a/Mathlib/FieldTheory/Perfect.lean b/Mathlib/FieldTheory/Perfect.lean index 3e55bcb56a8448..ba19ea9f9b42ac 100644 --- a/Mathlib/FieldTheory/Perfect.lean +++ b/Mathlib/FieldTheory/Perfect.lean @@ -52,8 +52,6 @@ section PerfectRing section Monoid variable (M : Type*) (p q : ℕ) [CommMonoid M] [PerfectRing M p] [PerfectRing M q] -namespace PerfectRing - instance one : PerfectRing M 1 := ⟨by simpa using bijective_id⟩ @@ -63,8 +61,6 @@ instance mul : PerfectRing M (p * q) := instance pow (n : ℕ) : PerfectRing M (p ^ n) := n.recOn (inferInstanceAs (PerfectRing M 1)) fun n _ ↦ inferInstanceAs (PerfectRing M (p ^ n * p)) -end PerfectRing - /-- The `p`-th power automorphism for a perfect monoid. -/ @[simps! apply] noncomputable def powMulEquiv : M ≃* M := diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean index 495960d7bbe65b..e4898d122d1f44 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean @@ -91,7 +91,7 @@ lemma angle_le_angle_add_angle_aux : · simp [hxy, real_inner_comm, ← sub_eq_zero] rw [NormedSpace.normalize, real_inner_smul_right, inner_sub_right, real_inner_smul_right, real_inner_self_eq_norm_sq, hx, real_inner_comm y, ← sq, mul_smul, ← smul_assoc] - simp only [one_pow, smul_eq_mul] + norm_num have H : 1 - ⟪x, y⟫ ^ 2 ≠ 0 := by rw [sub_ne_zero, ne_comm, sq_ne_one_iff] constructor <;> contrapose! hxy @@ -123,7 +123,7 @@ lemma angle_le_angle_add_angle_of_norm_eq_one : angle x z ≤ angle x y + angle simp only [inner_add_left, inner_add_right, real_inner_smul_left, real_inner_smul_right, real_inner_comm y (normalize _), real_inner_self_eq_norm_sq, hy, angle_comm z y, inner_normalize_ortho] at H1 - simp only [one_pow, mul_one, mul_zero, add_zero, zero_add] at H1 + norm_num at H1 rw [mul_comm (Real.cos (angle y z))] at H1 rw [Real.cos_add, ← inner_eq_cos_angle_of_norm_eq_one hx hz, H1] have H2 : -1 ≤ ⟪normalize (ortho y x), normalize (ortho y z)⟫ := by @@ -169,7 +169,7 @@ lemma angle_expression_of_angle_eq_angle_sum : simp only [inner_add_left, inner_add_right, real_inner_smul_left, real_inner_smul_right, real_inner_comm y (normalize _), real_inner_self_eq_norm_sq, hy, angle_comm z y, inner_normalize_ortho] at H6 - simp only [one_pow, mul_one, mul_zero, add_zero, zero_add] at H6 + norm_num at H6 rw [inner_eq_cos_angle_of_norm_eq_one hx hz, H0, Real.cos_add] at H6 ring_nf at H6 have Hw : Real.sin (angle x y) * Real.sin (angle y z) ≠ 0 := by diff --git a/Mathlib/Geometry/Euclidean/Projection.lean b/Mathlib/Geometry/Euclidean/Projection.lean index da214a27239471..1946864ca8e160 100644 --- a/Mathlib/Geometry/Euclidean/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Projection.lean @@ -478,7 +478,8 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace rw [← @vsub_eq_zero_iff_eq V, vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, add_comm, add_sub_assoc, vsub_sub_vsub_cancel_right, ← two_smul 𝕜 ((orthogonalProjection s₁ p : P) -ᵥ orthogonalProjection s₂ p), smul_eq_zero] at h - simpa using h + norm_num at h + exact h · intro h rw [h] diff --git a/Mathlib/Geometry/RingedSpace/Basic.lean b/Mathlib/Geometry/RingedSpace/Basic.lean index 693eca7ce19b68..fd4768f7d3bbdc 100644 --- a/Mathlib/Geometry/RingedSpace/Basic.lean +++ b/Mathlib/Geometry/RingedSpace/Basic.lean @@ -197,6 +197,7 @@ theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) : · simp [mem_basicOpen (hx := hx)] · simp [mt (basicOpen_le X _ ·) hx] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma basicOpen_pow {U : Opens X} (f : X.presheaf.obj (op U)) (n : ℕ) (h : 0 < n) : X.basicOpen (f ^ n) = X.basicOpen f := by diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean index 7bbc6186be85c5..9368ba12de37e7 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean @@ -309,6 +309,7 @@ instance {X : LocallyRingedSpace.{u}} : Unique (∅ ⟶ X) where noncomputable def emptyIsInitial : Limits.IsInitial (∅ : LocallyRingedSpace.{u}) := Limits.IsInitial.ofUnique _ +set_option backward.isDefEq.respectTransparency false in -- This actually holds for all ringed spaces with nontrivial stalks. theorem basicOpen_zero (X : LocallyRingedSpace.{u}) (U : Opens X.carrier) : X.toRingedSpace.basicOpen (0 : X.presheaf.obj <| op U) = ⊥ := by diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean index 3ee14943016d9b..0cb1ff85945054 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean @@ -75,6 +75,7 @@ lemma evaluation_ne_zero_iff_mem_basicOpen (x : U) (f : X.presheaf.obj (op U)) : X.evaluation x f ≠ 0 ↔ x.val ∈ X.toRingedSpace.basicOpen f := by simp +set_option backward.isDefEq.respectTransparency false in lemma basicOpen_eq_bot_iff_forall_evaluation_eq_zero (f : X.presheaf.obj (op U)) : X.toRingedSpace.basicOpen f = ⊥ ↔ ∀ (x : U), X.evaluation x f = 0 := by simp only [evaluation_eq_zero_iff_notMem_basicOpen, Subtype.forall] diff --git a/Mathlib/GroupTheory/Coprod/Basic.lean b/Mathlib/GroupTheory/Coprod/Basic.lean index 2cdc9c603dd46e..ca31e9d9f13434 100644 --- a/Mathlib/GroupTheory/Coprod/Basic.lean +++ b/Mathlib/GroupTheory/Coprod/Basic.lean @@ -604,6 +604,7 @@ theorem closure_range_inl_union_inr : Subgroup.closure (range (inl : G →* G ∗ H) ∪ range inr) = ⊤ := Subgroup.closure_eq_top_of_mclosure_eq_top mclosure_range_inl_union_inr +set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem range_inl_sup_range_inr : MonoidHom.range (inl : G →* G ∗ H) ⊔ MonoidHom.range inr = ⊤ := by rw [← closure_range_inl_union_inr, Subgroup.closure_union, ← MonoidHom.coe_range, @@ -619,6 +620,7 @@ theorem codisjoint_range_inl_range_inr : variable {K : Type*} [Group K] +set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem range_eq (f : G ∗ H →* K) : MonoidHom.range f = MonoidHom.range (f.comp inl) ⊔ MonoidHom.range (f.comp inr) := by rw [MonoidHom.range_eq_map, ← range_inl_sup_range_inr, Subgroup.map_sup, MonoidHom.map_range, @@ -663,6 +665,7 @@ end MulOneClass variable (M N P : Type*) [Monoid M] [Monoid N] [Monoid P] +set_option backward.isDefEq.respectTransparency false in /-- A multiplicative equivalence between `(M ∗ N) ∗ P` and `M ∗ (N ∗ P)`. -/ @[to_additive /-- An additive equivalence between `AddMonoid.Coprod (AddMonoid.Coprod M N) P` and `AddMonoid.Coprod M (AddMonoid.Coprod N P)`. -/] diff --git a/Mathlib/GroupTheory/Coxeter/Basic.lean b/Mathlib/GroupTheory/Coxeter/Basic.lean index 5b42e6b920c943..3b7c50514bef1d 100644 --- a/Mathlib/GroupTheory/Coxeter/Basic.lean +++ b/Mathlib/GroupTheory/Coxeter/Basic.lean @@ -507,7 +507,10 @@ theorem prod_alternatingWord_eq_prod_alternatingWord_sub (i i' : B) (m : ℕ) (h rw [(by ring : ↑(M i i') * 2 - (2 * k + 1) = -1 + (-k + ↑(M i i')) * 2), (by ring : 2 * k + 1 = 1 + k * 2)] repeat rw [Int.add_mul_ediv_right _ _ (by simp)] - simp [zpow_add, simple_mul_simple_pow', ← inv_zpow, ← mul_assoc] + norm_num + rw [zpow_add, zpow_add, zpow_natCast, simple_mul_simple_pow', zpow_neg, ← inv_zpow, zpow_neg, + ← inv_zpow] + simp [← mul_assoc] /-- The two words of length `M i i'` that alternate between `i` and `i'` have the same product. This is known as the "braid relation" or "Artin-Tits relation". -/ diff --git a/Mathlib/GroupTheory/Divisible.lean b/Mathlib/GroupTheory/Divisible.lean index 85487cdc631b7b..355c4303a28933 100644 --- a/Mathlib/GroupTheory/Divisible.lean +++ b/Mathlib/GroupTheory/Divisible.lean @@ -229,7 +229,8 @@ def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ where root_zero a := RootableBy.root_zero a root_cancel {n} a hn := by have := RootableBy.root_cancel a (show (n : ℤ) ≠ 0 from mod_cast hn) - simpa + norm_num at this + exact this end Group diff --git a/Mathlib/GroupTheory/Perm/Cycle/Type.lean b/Mathlib/GroupTheory/Perm/Cycle/Type.lean index aeed8b9e53c3c8..ff5929640215ee 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Type.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Type.lean @@ -154,6 +154,7 @@ theorem sum_cycleType (σ : Perm α) : σ.cycleType.sum = #σ.support := by theorem sum_cycleType_le (σ : Perm α) : σ.cycleType.sum ≤ Fintype.card α := σ.sum_cycleType ▸ Finset.card_le_univ σ.support +set_option backward.isDefEq.respectTransparency false in theorem card_fixedPoints (σ : Equiv.Perm α) : Fintype.card (Function.fixedPoints σ) = Fintype.card α - σ.cycleType.sum := by rw [Equiv.Perm.sum_cycleType, ← Finset.card_compl, Fintype.card_ofFinset] diff --git a/Mathlib/GroupTheory/SpecificGroups/Alternating.lean b/Mathlib/GroupTheory/SpecificGroups/Alternating.lean index ca9655387bac24..020a65a4e3df45 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Alternating.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Alternating.lean @@ -352,7 +352,6 @@ theorem normalClosure_swap_mul_swap_five : SetLike.mem_coe.1 (subset_normalClosure (Set.mem_singleton _)) exact mul_mem (Subgroup.normalClosure_normal.conj_mem _ h g1) (inv_mem h) -set_option linter.flexible false in -- TODO: fix non-terminal simp /-- Shows that any non-identity element of $A_5$ whose cycle decomposition consists only of swaps is conjugate to $(04)(13)$. This is used to show that the normal closure of such a permutation in $A_5$ is $A_5$. -/ @@ -365,7 +364,7 @@ theorem isConj_swap_mul_swap_of_cycleType_two {g : Perm (Fin 5)} (ha : g ∈ alt have h : Multiset.card g.cycleType ≤ 3 := le_of_mul_le_mul_right (le_trans h (by norm_num only [card_fin])) (by simp) rw [mem_alternatingGroup, sign_of_cycleType, h2] at ha - simp at ha + norm_num at ha rw [pow_add, pow_mul, Int.units_pow_two, one_mul, neg_one_pow_eq_one_iff_even] at ha swap; · decide rw [isConj_iff_cycleType_eq, h2] diff --git a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean index 42b73e2c582a4a..87721d871d20ed 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean @@ -249,7 +249,7 @@ theorem orderOf_a [NeZero n] (i : ZMod (2 * n)) : theorem exponent : Monoid.exponent (QuaternionGroup n) = 2 * lcm n 2 := by rw [← normalize_eq 2, ← lcm_mul_left, normalize_eq] - simp only [Nat.reduceMul] + norm_num rcases eq_zero_or_neZero n with rfl | hn · simp only [lcm_zero_left, mul_zero] exact Monoid.exponent_eq_zero_of_order_zero orderOf_a_one diff --git a/Mathlib/InformationTheory/Coding/KraftMcMillan.lean b/Mathlib/InformationTheory/Coding/KraftMcMillan.lean index d0e594ee4cf964..4b76217a5faf4d 100644 --- a/Mathlib/InformationTheory/Coding/KraftMcMillan.lean +++ b/Mathlib/InformationTheory/Coding/KraftMcMillan.lean @@ -91,7 +91,6 @@ private lemma concatFn_length_mem_Icc {S : Finset (List α)} · -- upper bound exact (Finset.sum_le_sum (fun i _ => Finset.le_sup (w i).prop)).trans_eq (by simp) -set_option linter.flexible false in -- TODO: fix non-terminal simp /-- Auxiliary bound for Kraft–McMillan. If `S` is a finite uniquely decodable code and `1 ≤ r`, then the `r`-th power of its Kraft sum @@ -137,8 +136,7 @@ private lemma kraft_mcmillan_inequality_aux {S : Finset (List α)} [Fintype α] apply le_trans (Finset.sum_le_sum (fun _ _ => sum_pow_length_filter_eq_le_card_mul)) -- Summing these bounds over the interval s ∈ [r, r * maxLen] multiplies the term -- by the number of lengths. Since r ≥ 1, this count is at most r * maxLen. - rcases r with (_ | _ | r) <;> rcases maxLen with (_ | _ | maxLen) - all_goals try simp at * + rcases r with (_ | _ | r) <;> rcases maxLen with (_ | _ | maxLen) <;> norm_num at * · positivity · rw [Nat.cast_sub] <;> push_cast <;> nlinarith only diff --git a/Mathlib/InformationTheory/KullbackLeibler/Basic.lean b/Mathlib/InformationTheory/KullbackLeibler/Basic.lean index e3318363356624..20050c76e33c9d 100644 --- a/Mathlib/InformationTheory/KullbackLeibler/Basic.lean +++ b/Mathlib/InformationTheory/KullbackLeibler/Basic.lean @@ -176,6 +176,7 @@ lemma toReal_klDiv_eq_integral_klFun (h : μ ≪ ν) : · rw [klDiv_of_not_integrable h_int, ENNReal.toReal_top] · rwa [integrable_klFun_rnDeriv_iff h] +set_option backward.isDefEq.respectTransparency false in lemma toReal_klDiv_smul_left (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) μ) (c : ℝ≥0) : (klDiv (c • μ) ν).toReal = c * (klDiv μ ν).toReal + (1 - c) * ν.real univ + c * log c * μ.real univ := by @@ -193,6 +194,7 @@ lemma toReal_klDiv_smul_left (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) simp [h_smul] ring +set_option backward.isDefEq.respectTransparency false in lemma toReal_klDiv_smul_right_eq_smul_left (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) μ) (c : ℝ≥0) : (klDiv μ (c • ν)).toReal = c * (klDiv (c⁻¹ • μ) ν).toReal := by @@ -225,6 +227,7 @@ lemma toReal_klDiv_smul_right (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν simp only [NNReal.coe_inv, log_inv, mul_neg, neg_mul, ← sub_eq_add_neg] field_simp +set_option backward.isDefEq.respectTransparency false in lemma toReal_klDiv_smul_same (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) μ) (c : ℝ≥0) : (klDiv (c • μ) (c • ν)).toReal = c * (klDiv μ ν).toReal := by by_cases hc : c = 0 @@ -237,6 +240,7 @@ lemma toReal_klDiv_smul_same (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) end Real +set_option backward.isDefEq.respectTransparency false in lemma klDiv_smul_right_eq_smul_left [IsFiniteMeasure μ] [IsFiniteMeasure ν] {c : ℝ≥0} (hc : c ≠ 0) : klDiv μ (c • ν) = c * klDiv (c⁻¹ • μ) ν := by have hc' : (c : ℝ≥0∞) ≠ 0 := by simpa @@ -283,6 +287,7 @@ lemma klDiv_smul_right_eq_smul_left [IsFiniteMeasure μ] [IsFiniteMeasure ν] {c rw [ENNReal.ofReal_toReal] exact klDiv_ne_top (hμν.smul_left _) h_int_left +set_option backward.isDefEq.respectTransparency false in lemma klDiv_smul_same [IsFiniteMeasure μ] [IsFiniteMeasure ν] (c : ℝ≥0) : klDiv (c • μ) (c • ν) = c * klDiv μ ν := by by_cases hc : c = 0 diff --git a/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean b/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean index ecd3e30bc7f9cc..cc1acbf774506a 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean @@ -102,7 +102,8 @@ theorem centroid_pair [DecidableEq ι] [Invertible (2 : k)] (p : ι → P) (i₁ · simp [h] · have hc : (#{i₁, i₂} : k) ≠ 0 := by rw [card_insert_of_notMem (notMem_singleton.2 h), card_singleton] - simpa using Invertible.ne_zero _ + norm_num + exact Invertible.ne_zero _ rw [centroid_def, affineCombination_eq_weightedVSubOfPoint_vadd_of_sum_eq_one _ _ _ (sum_centroidWeights_eq_one_of_cast_card_ne_zero _ hc) (p i₁)] diff --git a/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean b/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean new file mode 100644 index 00000000000000..b0eda0d48da491 --- /dev/null +++ b/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean @@ -0,0 +1,8 @@ +module -- shake: keep-all + +public import Mathlib.Algebra.Order.AbsoluteValue.Basic +public import Mathlib.Data.Finset.Attr +public import Mathlib.Data.Rat.Floor +public import Mathlib.Tactic.Continuity + +deprecated_module (since := "2025-09-20") diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean index 45e9669a3e8f3b..73105823b2759d 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean @@ -312,13 +312,6 @@ instance (priority := low) : IsStablyFiniteRing K := by have : f * (g * i) = f * 1 := congr_arg _ hi rw [← mul_assoc, hfg, one_mul, mul_one] at this; rwa [← this] -/-- A domain finitely generated as a module over a field is a field. -/ -theorem _root_.IsField.of_isDomain_of_finite (K L : Type*) [Field K] [CommRing L] [IsDomain L] - [Algebra K L] [Module.Finite K L] : IsField L where - exists_pair_ne := Nontrivial.exists_pair_ne - mul_comm := mul_comm - mul_inv_cancel {x} hx := (mulLeft K x).surjective_of_injective (mul_right_injective₀ hx) 1 - section Semiring variable (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M] [Free R M] [Module.Finite R M] diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean index 9e26360ce1f368..40550e66ad1ea9 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean @@ -144,6 +144,7 @@ theorem trace_eq_neg_charpoly_nextCoeff (M : Matrix n n R) : M.trace = -M.charpo nontriviality simp [trace_eq_neg_charpoly_coeff, nextCoeff] +set_option backward.isDefEq.respectTransparency false in theorem det_eq_sign_charpoly_coeff (M : Matrix n n R) : M.det = (-1) ^ Fintype.card n * M.charpoly.coeff 0 := by rw [coeff_zero_eq_eval_zero, charpoly, eval_det, matPolyEquiv_charmatrix, ← det_smul] diff --git a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean index b5560bee09abec..f3f113c67d8023 100644 --- a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean +++ b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean @@ -164,6 +164,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 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] diff --git a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean index 8e12547a8067d1..a1e5a74dfbef92 100644 --- a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean +++ b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean @@ -227,6 +227,7 @@ section Block /-! #### General 2×2 block matrices -/ +set_option backward.isDefEq.respectTransparency false in /-- A block matrix is invertible if the bottom right corner and the corresponding Schur complement is. -/ @[implicit_reducible] diff --git a/Mathlib/LinearAlgebra/Multilinear/Basic.lean b/Mathlib/LinearAlgebra/Multilinear/Basic.lean index 866b95e89382c1..0e0d89523ded39 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Basic.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Basic.lean @@ -214,10 +214,6 @@ theorem coe_smul (c : S) (f : MultilinearMap R M₁ M₂) : ⇑(c • f) = c • end SMul --- The `AddMonoid` instance exists to help speedup unification -instance : AddMonoid (MultilinearMap R M₁ M₂) := fast_instance% - coe_injective.addMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl - instance addCommMonoid : AddCommMonoid (MultilinearMap R M₁ M₂) := fast_instance% coe_injective.addCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean index 2c9902f05e2f61..133dfb5d6f9c5b 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean @@ -391,6 +391,7 @@ variable (b) in simp only [← mul_assoc, ω_mul_ω, one_mul] simp [mul_assoc] +set_option backward.isDefEq.respectTransparency false in lemma ωConj_mem_of_mem {x : Matrix (b.support ⊕ ι) (b.support ⊕ ι) R} (hx : x ∈ lieAlgebra b) : ωConj b x ∈ lieAlgebra b := by diff --git a/Mathlib/LinearAlgebra/SesquilinearForm.lean b/Mathlib/LinearAlgebra/SesquilinearForm.lean new file mode 100644 index 00000000000000..a7663c16f4108f --- /dev/null +++ b/Mathlib/LinearAlgebra/SesquilinearForm.lean @@ -0,0 +1,10 @@ +/- +Copyright (c) 2018 Andreas Swerdlow. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Andreas Swerdlow +-/ +module -- shake: keep-all + +public import Mathlib.LinearAlgebra.SesquilinearForm.Basic + +deprecated_module (since := "2025-10-06") diff --git a/Mathlib/LinearAlgebra/SymplecticGroup.lean b/Mathlib/LinearAlgebra/SymplecticGroup.lean index f45df9b46ce4d0..c53e3309b1b9b0 100644 --- a/Mathlib/LinearAlgebra/SymplecticGroup.lean +++ b/Mathlib/LinearAlgebra/SymplecticGroup.lean @@ -39,6 +39,7 @@ section JMatrixLemmas def J : Matrix (l ⊕ l) (l ⊕ l) R := Matrix.fromBlocks 0 (-1) 1 0 +set_option backward.isDefEq.respectTransparency false in @[simp] theorem J_transpose : (J l R)ᵀ = -J l R := by rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l ⊕ l) (l ⊕ l) R), @@ -97,6 +98,7 @@ section SymplecticJ variable (l) (R) +set_option backward.isDefEq.respectTransparency false in theorem J_mem : J l R ∈ symplecticGroup l R := by rw [mem_iff, J, fromBlocks_multiply, fromBlocks_transpose, fromBlocks_multiply] simp @@ -114,6 +116,7 @@ end SymplecticJ variable {A : Matrix (l ⊕ l) (l ⊕ l) R} +set_option backward.isDefEq.respectTransparency false in theorem neg_mem (h : A ∈ symplecticGroup l R) : -A ∈ symplecticGroup l R := by rw [mem_iff] at h ⊢ simp [h] @@ -129,6 +132,7 @@ theorem symplectic_det (hA : A ∈ symplecticGroup l R) : IsUnit <| det A := by rw [mul_comm A.det, mul_assoc] at hA exact hA +set_option backward.isDefEq.respectTransparency false in theorem transpose_mem (hA : A ∈ symplecticGroup l R) : Aᵀ ∈ symplecticGroup l R := by rw [mem_iff] at hA ⊢ rw [transpose_transpose] diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean index 4aefe699e07b76..bc7236b725bc93 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean @@ -231,6 +231,7 @@ lemma lpNorm_mono_real {g : α → ℝ} (hg : MemLp g p μ) (h : ∀ x, ‖f x exact ENNReal.toNNReal_mono (hg.eLpNorm_ne_top) (eLpNorm_mono_real h) · simp [hf] +set_option backward.isDefEq.respectTransparency false in lemma lpNorm_smul_measure_of_ne_zero {f : α → E} {c : ℝ≥0} (hc : c ≠ 0) : lpNorm f p (c • μ) = c ^ p.toReal⁻¹ • lpNorm f p μ := by by_cases hf : AEStronglyMeasurable f μ @@ -240,6 +241,7 @@ lemma lpNorm_smul_measure_of_ne_zero {f : α → E} {c : ℝ≥0} (hc : c ≠ 0) simpa [hc] using h.smul_measure c⁻¹] simp +set_option backward.isDefEq.respectTransparency false in lemma lpNorm_smul_measure_of_ne_top (hp : p ≠ ∞) {f : α → E} (c : ℝ≥0) : lpNorm f p (c • μ) = c ^ p.toReal⁻¹ • lpNorm f p μ := by by_cases hf : AEStronglyMeasurable f μ diff --git a/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean b/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean index b0eef7a4e5160f..344cdfe1635ac0 100644 --- a/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean +++ b/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean @@ -71,7 +71,8 @@ theorem exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure [NormedAddC rw [addHaar_smul_of_nonneg μ (by simp : 0 ≤ (2 : ℝ)⁻¹) s, ← ENNReal.mul_lt_mul_iff_left (pow_ne_zero (finrank ℝ E) (two_ne_zero' _)) (by finiteness), mul_right_comm, ofReal_pow (by simp : 0 ≤ (2 : ℝ)⁻¹), ofReal_inv_of_pos zero_lt_two] - simpa [← mul_pow, ENNReal.inv_mul_cancel two_ne_zero ofNat_ne_top] + norm_num + rwa [← mul_pow, ENNReal.inv_mul_cancel two_ne_zero ofNat_ne_top, one_pow, one_mul] obtain ⟨x, y, hxy, h⟩ := exists_pair_mem_lattice_not_disjoint_vadd fund ((h_conv.smul _).nullMeasurableSet _) h_vol obtain ⟨_, ⟨v, hv, rfl⟩, w, hw, hvw⟩ := Set.not_disjoint_iff.mp h diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean b/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean index e9d5dbdd582477..de2f5d6fc94e69 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean @@ -160,10 +160,12 @@ instance haveLebesgueDecompositionSMul' (μ ν : Measure α) [HaveLebesgueDecomp simp only rw [withDensity_smul _ hmeas, ← smul_add, ← hadd] +set_option backward.isDefEq.respectTransparency false in instance haveLebesgueDecompositionSMul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν := by rw [ENNReal.smul_def]; infer_instance +set_option backward.isDefEq.respectTransparency false in instance haveLebesgueDecompositionSMulRight (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) : μ.HaveLebesgueDecomposition (r • ν) where @@ -434,6 +436,7 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl exact hT₂ ▸ measure_mono (inter_subset_right.trans inter_subset_right) rw [heq' A hA, heq, restrict_apply hA, ← diff_eq, AEDisjoint.measure_diff_left hμinter] +set_option backward.isDefEq.respectTransparency false in theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) : (r • μ).singularPart ν = r • μ.singularPart ν := by by_cases hr : r = 0 @@ -448,6 +451,7 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) : rw [← inv_smul_smul₀ hr μ] infer_instance +set_option backward.isDefEq.respectTransparency false in theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) : μ.singularPart (r • ν) = μ.singularPart ν := by by_cases hl : HaveLebesgueDecomposition μ ν @@ -606,6 +610,7 @@ theorem rnDeriv_restrict_self (ν : Measure α) [SigmaFinite ν] {s : Set α} (h rw [← withDensity_indicator_one hs] exact rnDeriv_withDensity _ (measurable_one.indicator hs) +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν] @@ -623,6 +628,7 @@ theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν] · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _ · exact (lintegral_rnDeriv_lt_top (r • ν) μ).ne +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_left_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν] @@ -632,6 +638,7 @@ theorem rnDeriv_smul_left_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν] rnDeriv_smul_left ν μ r.toNNReal simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν] @@ -654,6 +661,7 @@ theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν] smul_eq_mul, inv_mul_cancel₀ hr, one_smul] exact ν.haveLebesgueDecomposition_add μ +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_right_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν] @@ -981,6 +989,7 @@ nonrec instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite section rnDeriv +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_left' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] (r : ℝ≥0) : @@ -996,6 +1005,7 @@ theorem rnDeriv_smul_left' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ · exact (measurable_rnDeriv _ _).aemeasurable · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _ +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] @@ -1005,6 +1015,7 @@ theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [Sigm rnDeriv_smul_left' ν μ r.toNNReal simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] @@ -1025,6 +1036,7 @@ theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite · exact (measurable_rnDeriv _ _).aemeasurable · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _ +set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_right_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean index 8040779246a4a4..ed99748e3bcf25 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean @@ -259,6 +259,7 @@ theorem coeFn_smul [IsScalarTower R ℝ≥0 ℝ≥0] (c : R) (μ : FiniteMeasure (⇑(c • μ) : Set Ω → ℝ≥0) = c • (⇑μ : Set Ω → ℝ≥0) := by funext; simp [← ENNReal.coe_inj, ENNReal.coe_smul] +set_option backward.isDefEq.respectTransparency false in instance instAddCommMonoid : AddCommMonoid (FiniteMeasure Ω) := fast_instance% toMeasure_injective.addCommMonoid _ toMeasure_zero toMeasure_add fun _ _ ↦ toMeasure_smul _ _ diff --git a/Mathlib/MeasureTheory/Measure/Haar/Unique.lean b/Mathlib/MeasureTheory/Measure/Haar/Unique.lean index b40539a128167c..b53259ff7397ea 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Unique.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Unique.lean @@ -920,6 +920,7 @@ theorem absolutelyContinuous_isHaarMeasure [LocallyCompactSpace G] rw [haarMeasure_unique μ K, h, smul_smul] exact smul_absolutelyContinuous +set_option backward.isDefEq.respectTransparency false in /-- A continuous surjective monoid homomorphism of topological groups with compact codomain is measure preserving, provided that the Haar measures on the domain and on the codomain have the same total mass. diff --git a/Mathlib/MeasureTheory/Measure/Hausdorff.lean b/Mathlib/MeasureTheory/Measure/Hausdorff.lean index ba8cfd7c3442cd..0e37cee102a96c 100644 --- a/Mathlib/MeasureTheory/Measure/Hausdorff.lean +++ b/Mathlib/MeasureTheory/Measure/Hausdorff.lean @@ -368,6 +368,7 @@ theorem mkMetric_smul (m : ℝ≥0∞ → ℝ≥0∞) {c : ℝ≥0∞} (hc : c simp only [mkMetric, mkMetric', mkMetric'.pre] simp_rw [smul_iSup, smul_boundedBy hc, ennreal_smul_extend _ hc', Pi.smul_apply] +set_option backward.isDefEq.respectTransparency false in theorem mkMetric_nnreal_smul (m : ℝ≥0∞ → ℝ≥0∞) {c : ℝ≥0} (hc : c ≠ 0) : (mkMetric (c • m) : OuterMeasure X) = c • mkMetric m := by rw [ENNReal.smul_def, ENNReal.smul_def, @@ -740,6 +741,7 @@ end LipschitzWith open scoped Pointwise +set_option backward.isDefEq.respectTransparency false in theorem MeasureTheory.Measure.hausdorffMeasure_smul₀ {𝕜 E : Type*} [NormedAddCommGroup E] [NormedDivisionRing 𝕜] [Module 𝕜 E] [NormSMulClass 𝕜 E] [MeasurableSpace E] [BorelSpace E] {d : ℝ} (hd : 0 ≤ d) {r : 𝕜} (hr : r ≠ 0) (s : Set E) : diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean index e9996b15827733..710c7c77bc670c 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean @@ -107,6 +107,7 @@ instance IsFiniteMeasure.average : IsFiniteMeasure ((μ univ)⁻¹ • μ) where rw [smul_apply, smul_eq_mul, ← ENNReal.div_eq_inv_mul] exact ENNReal.div_self_le_one.trans_lt ENNReal.one_lt_top +set_option backward.isDefEq.respectTransparency false in instance isFiniteMeasureSMulOfNNRealTower {R} [SMul R ℝ≥0] [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0 ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [IsFiniteMeasure μ] {r : R} : IsFiniteMeasure (r • μ) := by rw [← smul_one_smul ℝ≥0 r μ] diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean index a39384c9f0525f..a8f31fc33bfe16 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean @@ -107,6 +107,7 @@ instance isProbabilityMeasure_ite {p : Prop} [Decidable p] {μ ν : Measure α} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : IsProbabilityMeasure (ite p μ ν) := by split <;> infer_instance +set_option backward.isDefEq.respectTransparency false in open unitInterval in instance {μ ν : Measure α} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {p : I} : IsProbabilityMeasure (toNNReal p • μ + toNNReal (σ p) • ν) where diff --git a/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean b/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean index c3e3173b676083..1c1429d4e1ae33 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean @@ -56,6 +56,7 @@ section PowerSeries variable {R : Type*} [CommSemiring R] +set_option backward.isDefEq.respectTransparency 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⁻²ˢ + ...`. diff --git a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean index d2db272a7cfcb1..c81e82dd632b24 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean @@ -157,10 +157,7 @@ theorem discr_prime_pow [hcycl : IsCyclotomicExtension {p ^ k} K L] [hp : Fact p minpoly.eq_X_sub_C_of_algebraMap_inj _ (FaithfulSMul.algebraMap_injective K L)] exact natDegree_X_sub_C (-1) rcases Fin.equiv_iff_eq.2 this with ⟨e⟩ - rw [← Algebra.discr_reindex K (hζ.powerBasis K).basis e, coe_basis, powerBasis_gen] - simp only [powerBasis_dim, - zero_add, pow_one, totient_two, reduceDiv, pow_zero, cast_ofNat, tsub_self, - Nat.add_one_sub_one, mul_one, mul_zero] + rw [← Algebra.discr_reindex K (hζ.powerBasis K).basis e, coe_basis, powerBasis_gen]; norm_num simp_rw [hζ.eq_neg_one_of_two_right, show (-1 : L) = algebraMap K L (-1) by simp] convert_to (discr K fun i : Fin 1 ↦ (algebraMap K L) (-1) ^ ↑i) = _ · congr 1 diff --git a/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean b/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean new file mode 100644 index 00000000000000..ca9aa8d1554ab1 --- /dev/null +++ b/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean @@ -0,0 +1,8 @@ +module -- shake: keep-all + +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.NumberTheory.ArithmeticFunction.Misc +public import Mathlib.Tactic.Positivity + +deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/PID.lean b/Mathlib/NumberTheory/Cyclotomic/PID.lean new file mode 100644 index 00000000000000..3868d0fa9dbcd6 --- /dev/null +++ b/Mathlib/NumberTheory/Cyclotomic/PID.lean @@ -0,0 +1,9 @@ +module -- shake: keep-all + +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +public import Mathlib.CategoryTheory.Category.Init +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.Data.Nat.Factorial.DoubleFactorial +public import Mathlib.NumberTheory.ArithmeticFunction.Misc + +deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/Rat.lean b/Mathlib/NumberTheory/Cyclotomic/Rat.lean new file mode 100644 index 00000000000000..3868d0fa9dbcd6 --- /dev/null +++ b/Mathlib/NumberTheory/Cyclotomic/Rat.lean @@ -0,0 +1,9 @@ +module -- shake: keep-all + +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +public import Mathlib.CategoryTheory.Category.Init +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.Data.Nat.Factorial.DoubleFactorial +public import Mathlib.NumberTheory.ArithmeticFunction.Misc + +deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/Three.lean b/Mathlib/NumberTheory/Cyclotomic/Three.lean new file mode 100644 index 00000000000000..3868d0fa9dbcd6 --- /dev/null +++ b/Mathlib/NumberTheory/Cyclotomic/Three.lean @@ -0,0 +1,9 @@ +module -- shake: keep-all + +public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic +public import Mathlib.CategoryTheory.Category.Init +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.Data.Nat.Factorial.DoubleFactorial +public import Mathlib.NumberTheory.ArithmeticFunction.Misc + +deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean b/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean index 85e673aef46de0..74266cec9a12c1 100644 --- a/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean +++ b/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean @@ -141,7 +141,7 @@ lemma hasDerivAt_Gamma_one_half : HasDerivAt Gamma (-√π * (γ + 2 * log 2)) ( apply HasDerivAt.deriv have := HasDerivAt.rpow (hasDerivAt_const (1 / 2 : ℝ) (2 : ℝ)) (?_ : HasDerivAt (fun s : ℝ ↦ 1 - 2 * s) (-2) (1 / 2)) two_pos - · simpa + · norm_num at this; exact this simp_rw [mul_comm (2 : ℝ) _] apply HasDerivAt.const_sub exact hasDerivAt_mul_const (2 : ℝ) diff --git a/Mathlib/NumberTheory/NumberField/Completion.lean b/Mathlib/NumberTheory/NumberField/Completion.lean new file mode 100644 index 00000000000000..3798cf6143d8fc --- /dev/null +++ b/Mathlib/NumberTheory/NumberField/Completion.lean @@ -0,0 +1,7 @@ +module -- shake: keep-all + +public import Mathlib.Combinatorics.Matroid.Init +public import Mathlib.MeasureTheory.Integral.Bochner.Basic +public import Mathlib.Tactic.Positivity + +deprecated_module (since := "2025-09-24") diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean index 4de2e92d4e5bc1..05ca4a86b144c4 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean @@ -592,6 +592,7 @@ theorem isNontrivial : v.1.IsNontrivial := by variable {v} (K) +set_option backward.isDefEq.respectTransparency false in open Filter in /-- *Weak approximation for infinite places* diff --git a/Mathlib/NumberTheory/ZetaValues.lean b/Mathlib/NumberTheory/ZetaValues.lean index 157aefbc6fd5ae..3665ef381fc19b 100644 --- a/Mathlib/NumberTheory/ZetaValues.lean +++ b/Mathlib/NumberTheory/ZetaValues.lean @@ -459,8 +459,7 @@ theorem hasSum_zeta_two : HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 2) (π simp [Nat.factorial]; ring theorem hasSum_zeta_four : HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 4) (π ^ 4 / 90) := by - convert hasSum_zeta_nat two_ne_zero using 1 - simp only [Nat.reduceAdd, Nat.reduceMul, Nat.add_one_sub_one] + convert hasSum_zeta_nat two_ne_zero using 1; norm_num rw [bernoulli_eq_bernoulli'_of_ne_one, bernoulli'_four] · simp [Nat.factorial]; ring · decide diff --git a/Mathlib/Order/CompleteBooleanAlgebra.lean b/Mathlib/Order/CompleteBooleanAlgebra.lean index 28dcd06b40ded0..ba87d1961f3c6b 100644 --- a/Mathlib/Order/CompleteBooleanAlgebra.lean +++ b/Mathlib/Order/CompleteBooleanAlgebra.lean @@ -529,7 +529,6 @@ theorem biInf_sup_biInf {ι ι' : Type*} {f : ι → α} {g : ι' → α} {s : S theorem sInf_sup_sInf : sInf s ⊔ sInf t = ⨅ p ∈ s ×ˢ t, (p : α × α).1 ⊔ p.2 := @sSup_inf_sSup αᵒᵈ _ _ _ -@[to_dual existing] theorem iInf_sup_of_monotone {ι : Type*} [Preorder ι] [IsCodirectedOrder ι] {f g : ι → α} (hf : Monotone f) (hg : Monotone g) : ⨅ i, f i ⊔ g i = (⨅ i, f i) ⊔ ⨅ i, g i := @iSup_inf_of_antitone αᵒᵈ _ _ _ _ _ _ hf.dual_right hg.dual_right diff --git a/Mathlib/Probability/Distributions/SetBernoulli.lean b/Mathlib/Probability/Distributions/SetBernoulli.lean index 784338a37661f5..5a948791339d2e 100644 --- a/Mathlib/Probability/Distributions/SetBernoulli.lean +++ b/Mathlib/Probability/Distributions/SetBernoulli.lean @@ -63,9 +63,11 @@ lemma setBernoulli_apply' (S : Set (Set ι)) : setBer(u, p) S = (infinitePi fun i ↦ toNNReal p • dirac (i ∈ u) + toNNReal (σ p) • dirac False) ((fun p ↦ {i | p i}) ⁻¹' S) := MeasurableEquiv.setOf.symm.comap_apply .. +set_option backward.isDefEq.respectTransparency false in variable (u) in @[simp] lemma setBernoulli_zero : setBer(u, 0) = dirac ∅ := by simp [setBernoulli_eq_map] +set_option backward.isDefEq.respectTransparency false in variable (u) in @[simp] lemma setBernoulli_one : setBer(u, 1) = dirac u := by simp [setBernoulli_eq_map] diff --git a/Mathlib/RingTheory/AdicCompletion/LocalRing.lean b/Mathlib/RingTheory/AdicCompletion/LocalRing.lean index 9586a62be9ee90..e3984424a03fdb 100644 --- a/Mathlib/RingTheory/AdicCompletion/LocalRing.lean +++ b/Mathlib/RingTheory/AdicCompletion/LocalRing.lean @@ -6,7 +6,7 @@ Authors: Nailin Guan module public import Mathlib.RingTheory.AdicCompletion.Basic -public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic +public import Mathlib.RingTheory.LocalRing.Defs /-! # Basic Properties of Complete Local Ring @@ -18,9 +18,67 @@ ia a local ring (complete local ring). public section -variable {R : Type*} [CommRing R] (m : Ideal R) [m.IsMaximal] +variable {R : Type*} [CommRing R] (m : Ideal R) [hmax : m.IsMaximal] -theorem isLocalRing_of_isAdicComplete_maximal [IsAdicComplete m R] : IsLocalRing R := - IsLocalRing.of_unique_max_ideal ⟨m, ‹m.IsMaximal›, fun _ hJ ↦ - (‹m.IsMaximal›.eq_of_le hJ.ne_top <| - (IsAdicComplete.le_jacobson_bot m).trans <| sInf_le ⟨bot_le, hJ⟩).symm⟩ +open Ideal Quotient + +lemma isUnit_iff_notMem_of_isAdicComplete_maximal [IsAdicComplete m R] (r : R) : + IsUnit r ↔ r ∉ m := by + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · by_contra mem + rcases IsUnit.exists_left_inv h with ⟨s, hs⟩ + absurd m.ne_top_iff_one.mp (Ideal.IsMaximal.ne_top hmax) + simp [← hs, Ideal.mul_mem_left m s mem] + · have mapu {n : ℕ} (npos : 0 < n) : IsUnit (Ideal.Quotient.mk (m ^ n) r) := by + induction n with + | zero => + absurd npos + exact Nat.not_lt_zero 0 + | succ n ih => + by_cases neq0 : n = 0 + · let max' : (m ^ (n + 1)).IsMaximal := by simpa only [neq0, zero_add, pow_one] using hmax + let hField : Field (R ⧸ m ^ (n + 1)) := Ideal.Quotient.field (m ^ (n + 1)) + simpa [isUnit_iff_ne_zero, ne_eq, Ideal.Quotient.eq_zero_iff_mem.not, neq0] using h + · apply factorPowSucc.isUnit_of_isUnit_image (Nat.zero_lt_of_ne_zero neq0) + simpa using (ih (Nat.zero_lt_of_ne_zero neq0)) + choose invSeries' invSeries_spec' using fun (n : {n : ℕ // 0 < n}) ↦ + (IsUnit.exists_left_inv (mapu n.2)) + let invSeries : ℕ → R := fun n ↦ if h : n = 0 then 0 else Classical.choose <| + Ideal.Quotient.mk_surjective <| invSeries' ⟨n, (Nat.zero_lt_of_ne_zero h)⟩ + have invSeries_spec {n : ℕ} (npos : 0 < n) : (Ideal.Quotient.mk (m ^ n)) (invSeries n) = + invSeries' ⟨n, npos⟩ := by + simpa only [Nat.ne_zero_of_lt npos, invSeries] + using Classical.choose_spec (Ideal.Quotient.mk_surjective (invSeries' ⟨n, npos⟩)) + have mod {a b : ℕ} (le : a ≤ b) : + invSeries a ≡ invSeries b [SMOD m ^ a • (⊤ : Submodule R R)] := by + by_cases apos : 0 < a + · simp only [smul_eq_mul, Ideal.mul_top] + rw [SModEq.sub_mem, ← eq_zero_iff_mem, map_sub, ← (mapu apos).mul_right_inj, + mul_zero, mul_sub] + nth_rw 3 [← factor_mk (pow_le_pow_right le), ← factor_mk (pow_le_pow_right le)] + simp only [invSeries_spec apos, invSeries_spec (Nat.lt_of_lt_of_le apos le)] + rw [← map_mul, mul_comm, invSeries_spec', mul_comm, invSeries_spec', + map_one, sub_self] + · simp [Nat.eq_zero_of_not_pos apos] + rcases IsAdicComplete.toIsPrecomplete.prec mod with ⟨inv, hinv⟩ + have eq (n : ℕ) : inv * r - 1 ≡ 0 [SMOD m ^ n • (⊤ : Submodule R R)] := by + by_cases npos : 0 < n + · apply SModEq.sub_mem.mpr + simp only [smul_eq_mul, Ideal.mul_top, sub_zero, ← eq_zero_iff_mem] + rw [map_sub, map_one, map_mul, ← sub_add_cancel inv (invSeries n), map_add] + have := SModEq.sub_mem.mp (hinv n).symm + simp only [smul_eq_mul, Ideal.mul_top] at this + simp [Ideal.Quotient.eq_zero_iff_mem.mpr this, invSeries_spec npos, invSeries_spec'] + · simp [Nat.eq_zero_of_not_pos npos] + apply isUnit_iff_exists_inv'.mpr + use inv + exact sub_eq_zero.mp <| IsHausdorff.haus IsAdicComplete.toIsHausdorff (inv * r - 1) eq + +theorem isLocalRing_of_isAdicComplete_maximal [IsAdicComplete m R] : IsLocalRing R where + exists_pair_ne := ⟨0, 1, ne_of_mem_of_not_mem m.zero_mem + (m.ne_top_iff_one.mp (Ideal.IsMaximal.ne_top hmax))⟩ + isUnit_or_isUnit_of_add_one {a b} hab := by + simp only [isUnit_iff_notMem_of_isAdicComplete_maximal m] + by_contra! h + absurd m.add_mem h.1 h.2 + simpa [hab] using m.ne_top_iff_one.mp (Ideal.IsMaximal.ne_top hmax) diff --git a/Mathlib/RingTheory/Artinian/Module.lean b/Mathlib/RingTheory/Artinian/Module.lean index 3ac44944cc6451..71ccefc72e4a92 100644 --- a/Mathlib/RingTheory/Artinian/Module.lean +++ b/Mathlib/RingTheory/Artinian/Module.lean @@ -576,18 +576,6 @@ lemma primeSpectrum_asIdeal_range_eq : variable (R) -theorem nilradical_pow_eq_iInf (n : ℕ) : - nilradical R ^ n = iInf fun I : MaximalSpectrum R ↦ I.1 ^ n := by - have : Fintype (MaximalSpectrum R) := Fintype.ofFinite (MaximalSpectrum R) - rw [← iInf_univ, ← Finset.coe_univ, PrimeSpectrum.nilradical_eq_iInf] - simp only [Finset.mem_coe] - rw [← Ideal.prod_eq_iInf_of_pairwise_isCoprime fun I _ _ _ ↦ .pow ∘ I.isCoprime_of_ne, - Finset.prod_pow, Ideal.prod_eq_iInf_of_pairwise_isCoprime fun I _ _ _ ↦ I.isCoprime_of_ne] - simp [Finset.mem_univ, iInf, IsArtinianRing.primeSpectrum_asIdeal_range_eq] - -theorem nilradical_eq_iInf : nilradical R = iInf MaximalSpectrum.asIdeal := by - simpa using nilradical_pow_eq_iInf R 1 - lemma setOf_isPrime_finite : {I : Ideal R | I.IsPrime}.Finite := by simpa only [isPrime_iff_isMaximal] using setOf_isMaximal_finite R @@ -602,27 +590,22 @@ instance : Finite (PrimeSpectrum R) := /-- The quotient of a commutative Artinian ring by its nilradical is isomorphic to a finite product of fields, namely the quotients by the maximal ideals. -/ -@[simps!] noncomputable def quotNilradicalEquivPi : - (R ⧸ nilradical R) ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal := - (Ideal.quotientEquivAlgOfEq R (nilradical_eq_iInf R)).trans - { __ := Ideal.quotientInfRingEquivPiQuotient _ fun I _ ↦ I.isCoprime_of_ne - commutes' _ := rfl} - -/-- The quotient of a commutative Artinian ring by a power of its nilradical is isomorphic to -a finite product of local rings, namely the quotients by the powers of the maximal ideals. -/ -@[simps!] -noncomputable def quotNilradicalPowEquivPi (n : ℕ) : - (R ⧸ nilradical R ^ n) ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal ^ n := - (Ideal.quotientEquivAlgOfEq R (nilradical_pow_eq_iInf R n)).trans - { __ := Ideal.quotientInfRingEquivPiQuotient _ fun I _ ↦ .pow ∘ I.isCoprime_of_ne - commutes' _ := rfl} + R ⧸ nilradical R ≃+* ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal := + let f := MaximalSpectrum.asIdeal (R := R) + .trans + (Ideal.quotEquivOfEq <| ext fun x ↦ by + rw [PrimeSpectrum.nilradical_eq_iInf, iInf, primeSpectrum_asIdeal_range_eq]; rfl) + (Ideal.quotientInfRingEquivPiQuotient f <| fun I J h ↦ + Ideal.isCoprime_iff_sup_eq.mpr <| I.2.coprime_of_ne J.2 <| + fun hIJ ↦ h <| MaximalSpectrum.ext hIJ) /-- A reduced commutative Artinian ring is isomorphic to a finite product of fields, namely the quotients by the maximal ideals. -/ -noncomputable def equivPi [IsReduced R] : R ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal := - .trans (.symm <| .quotientBot R R) <| .trans - (Ideal.quotientEquivAlgOfEq R (nilradical_eq_zero R).symm) (quotNilradicalEquivPi R) +noncomputable def equivPi [IsReduced R] : R ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal where + __ := RingEquiv.trans (.symm <| .quotientBot R) <| .trans + (Ideal.quotEquivOfEq (nilradical_eq_zero R).symm) (quotNilradicalEquivPi R) + commutes' _ := rfl set_option backward.isDefEq.respectTransparency false in theorem isSemisimpleRing_of_isReduced [IsReduced R] : IsSemisimpleRing R := diff --git a/Mathlib/RingTheory/Extension/Generators.lean b/Mathlib/RingTheory/Extension/Generators.lean index 5ea6b2b1bdedfd..1ac169351c37f1 100644 --- a/Mathlib/RingTheory/Extension/Generators.lean +++ b/Mathlib/RingTheory/Extension/Generators.lean @@ -295,6 +295,7 @@ noncomputable def baseChangeToBaseChange : ext simp [RingHom.algebraMap_toAlgebra] +set_option backward.isDefEq.respectTransparency false in @[simp] lemma baseChangeToBaseChange_apply (x : (baseChange T P).toExtension.Ring) : dsimp% (P.baseChangeToBaseChange T).toRingHom x = diff --git a/Mathlib/RingTheory/Flat/Rank.lean b/Mathlib/RingTheory/Flat/Rank.lean index a7a380d3a50fdb..7f5eae009c9a13 100644 --- a/Mathlib/RingTheory/Flat/Rank.lean +++ b/Mathlib/RingTheory/Flat/Rank.lean @@ -36,6 +36,7 @@ attribute [local instance] Module.free_of_flat_of_isLocalRing variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] [Module.Flat R S] [Module.Finite R S] +set_option backward.isDefEq.respectTransparency false in lemma PrimeSpectrum.rankAtStalk_pos_iff_mem_range_comap (p : PrimeSpectrum R) : 0 < Module.rankAtStalk (R := R) S p ↔ p ∈ Set.range (PrimeSpectrum.comap (algebraMap R S)) := by rw [Module.rankAtStalk_eq, Module.finrank_pos_iff, p.nontrivial_iff_mem_rangeComap] diff --git a/Mathlib/RingTheory/Jacobson/Ring.lean b/Mathlib/RingTheory/Jacobson/Ring.lean index 183d937c3bbb4b..96112c6da11e22 100644 --- a/Mathlib/RingTheory/Jacobson/Ring.lean +++ b/Mathlib/RingTheory/Jacobson/Ring.lean @@ -553,7 +553,8 @@ theorem comp_C_integral_of_surjective_of_isJacobsonRing {S : Type*} [Field S] (f rw [← hfg, RingHom.comp_assoc] refine (quotient_mk_comp_C_isIntegral_of_isJacobsonRing (RingHom.ker f)).trans _ g (g.isIntegral_of_surjective ?_) - rw [← hfg, RingHom.coe_comp] at hf + rw [← hfg] at hf + norm_num at hf exact Function.Surjective.of_comp hf end @@ -656,7 +657,8 @@ theorem comp_C_integral_of_surjective_of_isJacobsonRing {R : Type*} [CommRing R] rw [← hfg, RingHom.comp_assoc] refine (quotient_mk_comp_C_isIntegral_of_isJacobsonRing (RingHom.ker f')).trans _ g (g.isIntegral_of_surjective ?_) - rw [← hfg, coe_comp] at hf' + rw [← hfg] at hf' + norm_num at hf' exact Function.Surjective.of_comp hf' rw [RingHom.comp_assoc] at this convert this diff --git a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean index 401b4e2fd9f36f..2af79104fea0a8 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean @@ -93,6 +93,7 @@ lemma hasSubst_iff_hasEval_of_discreteTopology [TopologicalSpace S] [DiscreteTop simp_rw [hasSubst_def, hasEval_def, coeff_zero_iff, isTopologicallyNilpotent_iff_constantCoeff_isNilpotent] +set_option backward.isDefEq.respectTransparency false in theorem HasSubst.hasEval [TopologicalSpace S] (ha : HasSubst a) : HasEval a := HasEval.mono (instTopologicalSpace_mono τ bot_le) <| (@hasSubst_iff_hasEval_of_discreteTopology σ τ _ _ a ⊥ (@DiscreteTopology.mk S ⊥ rfl)).mp ha diff --git a/Mathlib/RingTheory/Nilpotent/Exp.lean b/Mathlib/RingTheory/Nilpotent/Exp.lean index 401f9271de2a1a..b75084b8c2d4b7 100644 --- a/Mathlib/RingTheory/Nilpotent/Exp.lean +++ b/Mathlib/RingTheory/Nilpotent/Exp.lean @@ -199,11 +199,10 @@ theorem exp_smul {G : Type*} [Monoid G] [MulSemiringAction G A] exp (g • a) = g • exp a := (map_exp ha (MulSemiringAction.toRingHom G A g)).symm -set_option linter.flexible false in -- TODO: fix non-terminal simp theorem isNilpotent_exp_sub_one {a : A} (ha : IsNilpotent a) : IsNilpotent (exp a - 1) := by nontriviality A rw [exp, ← Nat.sub_add_cancel (pos_nilpotencyClass_iff.2 ha), Finset.sum_range_succ'] - simp + norm_num apply Commute.isNilpotent_sum fun _ _ ↦ smul (pow_of_pos ha <| by positivity) _ simp [Nat.factorial_ne_zero] diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean b/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean index cf0414e67b6202..2d6b6a16a80779 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean @@ -5,7 +5,6 @@ Authors: David Kurniadi Angdinata -/ module -public import Mathlib.RingTheory.Ideal.Operations public import Mathlib.RingTheory.Spectrum.Maximal.Defs public import Mathlib.RingTheory.Spectrum.Prime.Defs @@ -47,7 +46,4 @@ def toPrimeSpectrum (x : MaximalSpectrum R) : PrimeSpectrum R := theorem toPrimeSpectrum_injective : (@toPrimeSpectrum R _).Injective := fun ⟨_, _⟩ ⟨_, _⟩ h => by simpa only [MaximalSpectrum.mk.injEq] using PrimeSpectrum.ext_iff.mp h -theorem isCoprime_of_ne {I J : MaximalSpectrum R} (h : I ≠ J) : IsCoprime I.1 J.1 := - Ideal.isCoprime_iff_sup_eq.mpr <| I.2.coprime_of_ne J.2 <| mt MaximalSpectrum.ext h - end MaximalSpectrum diff --git a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean index 8654ec4f0b46da..025a4f7500ca4f 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean @@ -535,6 +535,7 @@ theorem basicOpen_eq_zeroLocus_compl (r : R) : theorem basicOpen_one : basicOpen (1 : R) = ⊤ := TopologicalSpace.Opens.ext <| by simp +set_option backward.isDefEq.respectTransparency false in @[simp] theorem basicOpen_zero : basicOpen (0 : R) = ⊥ := TopologicalSpace.Opens.ext <| by simp @@ -590,6 +591,7 @@ theorem isBasis_basic_opens : TopologicalSpace.Opens.IsBasis (Set.range (@basicO rw [← Set.range_comp] rfl +set_option backward.isDefEq.respectTransparency false in @[simp] theorem basicOpen_eq_bot_iff (f : R) : basicOpen f = ⊥ ↔ IsNilpotent f := by rw [← TopologicalSpace.Opens.coe_inj, basicOpen_eq_zeroLocus_compl] @@ -679,6 +681,7 @@ section DiscreteTopology variable (R) [DiscreteTopology (PrimeSpectrum R)] +set_option backward.isDefEq.respectTransparency false in theorem toPiLocalization_surjective_of_discreteTopology : Function.Surjective (toPiLocalization R) := fun x ↦ by have (p : PrimeSpectrum R) : ∃ f, (basicOpen f : Set _) = {p} := @@ -1030,6 +1033,7 @@ lemma isClopen_iff_mul_add_zeroLocus {s : Set (PrimeSpectrum R)} : open TopologicalSpace (Clopens) +set_option backward.isDefEq.respectTransparency false in /-- Clopen subsets in the prime spectrum of a commutative semiring are in order-preserving bijection with pairs of elements with product 0 and sum 1. (By definition, `(e₁, f₁) ≤ (e₂, f₂)` iff `e₁ * e₂ = e₁`.) Both elements in such pairs must be idempotents, but there may exists @@ -1253,6 +1257,7 @@ theorem comap_closedPoint {S : Type v} [CommSemiring S] [IsLocalRing S] (f : R theorem specializes_closedPoint (x : PrimeSpectrum R) : x ⤳ closedPoint R := (PrimeSpectrum.le_iff_specializes _ _).mp (IsLocalRing.le_maximalIdeal x.2.1) +set_option backward.isDefEq.respectTransparency false in theorem closedPoint_mem_iff (U : TopologicalSpace.Opens <| PrimeSpectrum R) : closedPoint R ∈ U ↔ U = ⊤ := by constructor @@ -1261,6 +1266,7 @@ theorem closedPoint_mem_iff (U : TopologicalSpace.Opens <| PrimeSpectrum R) : · rintro rfl exact TopologicalSpace.Opens.mem_top _ +set_option backward.isDefEq.respectTransparency false in lemma closed_point_mem_iff {U : TopologicalSpace.Opens (PrimeSpectrum R)} : closedPoint R ∈ U ↔ U = ⊤ := ⟨(eq_top_iff.mpr fun x _ ↦ (specializes_closedPoint x).mem_open U.2 ·), (· ▸ trivial)⟩ diff --git a/Mathlib/Tactic/NormNum/Prime.lean b/Mathlib/Tactic/NormNum/Prime.lean index adf338a09b55aa..a1ba75a4938757 100644 --- a/Mathlib/Tactic/NormNum/Prime.lean +++ b/Mathlib/Tactic/NormNum/Prime.lean @@ -80,7 +80,9 @@ theorem minFacHelper_1 {n k k' : ℕ} (e : k + 2 = k') (h : MinFacHelper n k) · refine ((h.1.trans_le h.2.2).ne ?_).elim have h3 : 2 ∣ minFac n := by rw [Nat.dvd_iff_mod_eq_zero, ← h2, succ_eq_add_one, add_mod, h.2.1] - simpa [dvd_prime <| minFac_prime h.one_lt.ne'] using h3 + rw [dvd_prime <| minFac_prime h.one_lt.ne'] at h3 + norm_num at h3 + exact h3 exact h2 theorem minFacHelper_2 {n k k' : ℕ} (e : k + 2 = k') (nk : ¬ Nat.Prime k) diff --git a/Mathlib/Tactic/Translate/Core.lean b/Mathlib/Tactic/Translate/Core.lean index 8fd6b0360b0567..e4fc6a4f15f19f 100644 --- a/Mathlib/Tactic/Translate/Core.lean +++ b/Mathlib/Tactic/Translate/Core.lean @@ -680,14 +680,13 @@ def updateAndAddDecl (t : TranslateData) (tgt : Name) (srcDecl : ConstantInfo) {ex.toMessageData}" throwError "@[{t.attrName}] failed. Nested error message:\n{ex.toMessageData}" -/-- Unfold `simp`, `gcongr` and `hcongr`/`congr_simp` auxlemmas in the type and value. +/-- Unfold `simp` and `gcongr` auxlemmas in the type and value. The reason why we can't just translate them is that they are generated by the `@[simp]` attribute, so it would require a change in the implementation of `@[simp]` to add these translations. Additionally, these lemmas have very short proofs, so unfolding them is not costly. -/ def declUnfoldSimpAuxLemmas (decl : ConstantInfo) : MetaM ConstantInfo := do let unfold (e : Expr) := deltaExpand e (allowOpaque := true) fun - | .str _ s => "_simp_".isPrefixOf s || "_gcongr_".isPrefixOf s || - isHCongrReservedNameSuffix s || s == congrSimpSuffix + | .str _ s => "_simp_".isPrefixOf s || "_gcongr_".isPrefixOf s | _ => false let mut decl := decl decl := decl.updateType <| ← unfold decl.type diff --git a/Mathlib/Topology/AlexandrovDiscrete.lean b/Mathlib/Topology/AlexandrovDiscrete.lean index 9799f371a38440..23402f7cf8601d 100644 --- a/Mathlib/Topology/AlexandrovDiscrete.lean +++ b/Mathlib/Topology/AlexandrovDiscrete.lean @@ -127,6 +127,7 @@ lemma Topology.IsInducing.alexandrovDiscrete [AlexandrovDiscrete α] {f : β → end +set_option backward.isDefEq.respectTransparency false in lemma AlexandrovDiscrete.sup {t₁ t₂ : TopologicalSpace α} (_ : @AlexandrovDiscrete α t₁) (_ : @AlexandrovDiscrete α t₂) : @AlexandrovDiscrete α (t₁ ⊔ t₂) := diff --git a/Mathlib/Topology/Algebra/Constructions.lean b/Mathlib/Topology/Algebra/Constructions.lean index 9931bf339adab6..6b661609b7b65e 100644 --- a/Mathlib/Topology/Algebra/Constructions.lean +++ b/Mathlib/Topology/Algebra/Constructions.lean @@ -121,6 +121,7 @@ instance instDiscreteTopology [DiscreteTopology M] : DiscreteTopology Mˣ := simp only [isInducing_embedProduct.1, instTopologicalSpaceProd, induced_inf, instTopologicalSpaceMulOpposite, induced_compose]; rfl +set_option backward.isDefEq.respectTransparency false in /-- An auxiliary lemma that can be used to prove that coercion `Mˣ → M` is a topological embedding. Use `Units.isEmbedding_val₀`, `Units.isEmbedding_val`, or `toUnits_homeomorph` instead. -/ @[to_additive /-- An auxiliary lemma that can be used to prove that coercion `AddUnits M → M` is a diff --git a/Mathlib/Topology/Algebra/Group/GroupTopology.lean b/Mathlib/Topology/Algebra/Group/GroupTopology.lean index 43dfdcf1f08f9c..226a125b64d81d 100644 --- a/Mathlib/Topology/Algebra/Group/GroupTopology.lean +++ b/Mathlib/Topology/Algebra/Group/GroupTopology.lean @@ -110,6 +110,7 @@ instance : Bot (GroupTopology α) := theorem toTopologicalSpace_bot : (⊥ : GroupTopology α).toTopologicalSpace = ⊥ := rfl +set_option backward.isDefEq.respectTransparency false in @[to_additive] instance : BoundedOrder (GroupTopology α) where le_top x := show x.toTopologicalSpace ≤ ⊤ from le_top diff --git a/Mathlib/Topology/Algebra/Module/LinearMap.lean b/Mathlib/Topology/Algebra/Module/LinearMap.lean index f7860d68752d09..36d583593b3886 100644 --- a/Mathlib/Topology/Algebra/Module/LinearMap.lean +++ b/Mathlib/Topology/Algebra/Module/LinearMap.lean @@ -405,8 +405,7 @@ theorem coe_add' (f g : M₁ →SL[σ₁₂] M₂) : ⇑(f + g) = f + g := theorem toContinuousAddMonoidHom_add (f g : M₁ →SL[σ₁₂] M₂) : ↑(f + g) = (f + g : ContinuousAddMonoidHom M₁ M₂) := rfl --- The `AddMonoid` instance exists to help speedup unification -instance : AddMonoid (M₁ →SL[σ₁₂] M₂) where +instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where zero_add := by intros ext @@ -415,6 +414,10 @@ instance : AddMonoid (M₁ →SL[σ₁₂] M₂) where intros ext apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm] + add_comm := by + intros + ext + apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm] add_assoc := by intros ext @@ -427,12 +430,6 @@ instance : AddMonoid (M₁ →SL[σ₁₂] M₂) where ext simp [add_smul] -instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where - add_comm := by - intros - ext - apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm] - @[simp, norm_cast] theorem coe_sum {ι : Type*} (t : Finset ι) (f : ι → M₁ →SL[σ₁₂] M₂) : ↑(∑ d ∈ t, f d) = (∑ d ∈ t, f d : M₁ →ₛₗ[σ₁₂] M₂) := diff --git a/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean b/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean index 3323e718e788c2..ff28a1bd2c434b 100644 --- a/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean +++ b/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean @@ -192,10 +192,6 @@ theorem toMultilinearMap_add (f g : ContinuousMultilinearMap R M₁ M₂) : (f + g).toMultilinearMap = f.toMultilinearMap + g.toMultilinearMap := rfl --- The `AddMonoid` instance exists to help speedup unification -instance : AddMonoid (ContinuousMultilinearMap R M₁ M₂) := fast_instance% - toMultilinearMap_injective.addMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl - instance addCommMonoid : AddCommMonoid (ContinuousMultilinearMap R M₁ M₂) := fast_instance% toMultilinearMap_injective.addCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl diff --git a/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean b/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean index cdc8dd7ddb8d8d..48adc6568dacf4 100644 --- a/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean +++ b/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean @@ -181,6 +181,7 @@ section principal variable {S : Set ι} +set_option backward.isDefEq.respectTransparency false in theorem topologicalSpace_eq_of_principal : topologicalSpace R A (𝓟 S) = .induced ((↑) : Πʳ i, [R i, A i]_[𝓟 S] → Π i, R i) inferInstance := diff --git a/Mathlib/Topology/Category/TopCat/Limits/Basic.lean b/Mathlib/Topology/Category/TopCat/Limits/Basic.lean index 9e4cd38cc6bc6b..4078b3ef6e4669 100644 --- a/Mathlib/Topology/Category/TopCat/Limits/Basic.lean +++ b/Mathlib/Topology/Category/TopCat/Limits/Basic.lean @@ -99,6 +99,7 @@ def coneOfConeForget : Cone F where ext apply congr_fun (c.π.naturality φ) } +set_option backward.isDefEq.respectTransparency 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`. -/ @@ -210,6 +211,7 @@ def coconeOfCoconeForget : Cocone F where ext apply congr_fun (c.ι.naturality φ) } +set_option backward.isDefEq.respectTransparency 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`. -/ diff --git a/Mathlib/Topology/Category/TopCat/Opens.lean b/Mathlib/Topology/Category/TopCat/Opens.lean index cddecfc9fdfde0..43d688164d1292 100644 --- a/Mathlib/Topology/Category/TopCat/Opens.lean +++ b/Mathlib/Topology/Category/TopCat/Opens.lean @@ -84,11 +84,13 @@ noncomputable def infLERight (U V : Opens X) : U ⊓ V ⟶ V := noncomputable def leSupr {ι : Type*} (U : ι → Opens X) (i : ι) : U i ⟶ iSup U := (le_iSup U i).hom +set_option backward.isDefEq.respectTransparency false in /-- The inclusion `⊥ ⟶ U` as a morphism in the category of open sets. -/ noncomputable def botLE (U : Opens X) : ⊥ ⟶ U := bot_le.hom +set_option backward.isDefEq.respectTransparency false in /-- The inclusion `U ⟶ ⊤` as a morphism in the category of open sets. -/ noncomputable def leTop (U : Opens X) : U ⟶ ⊤ := diff --git a/Mathlib/Topology/Category/TopCat/ULift.lean b/Mathlib/Topology/Category/TopCat/ULift.lean index d1f4ec38a06a55..8e584508bacac7 100644 --- a/Mathlib/Topology/Category/TopCat/ULift.lean +++ b/Mathlib/Topology/Category/TopCat/ULift.lean @@ -68,6 +68,7 @@ instance : uliftFunctor.{v, u}.Faithful := open Limits +set_option backward.isDefEq.respectTransparency 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/Compactness/CompactlyGeneratedSpace.lean b/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean index 896c2d06bfa1f1..d0ca3bc174ac75 100644 --- a/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean +++ b/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean @@ -97,6 +97,7 @@ lemma eq_compactlyGenerated [t : TopologicalSpace X] [UCompactlyGeneratedSpace.{ Sigma.forall] exact fun S f ↦ f.2 +set_option backward.isDefEq.respectTransparency false in instance (X : Type v) [t : TopologicalSpace X] [DiscreteTopology X] : UCompactlyGeneratedSpace.{u} X where le_compactlyGenerated := by diff --git a/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean b/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean index 808a0556b7a8ce..8cd5b7b2637872 100644 --- a/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean +++ b/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean @@ -86,6 +86,7 @@ lemma DeltaGeneratedSpace.isOpen_iff [DeltaGeneratedSpace X] {u : Set X} : IsOpen u ↔ ∀ (n : ℕ) (p : ContinuousMap ((Fin n) → ℝ) X), IsOpen (p ⁻¹' u) := by nth_rewrite 1 [eq_deltaGenerated (X := X)]; exact isOpen_deltaGenerated_iff +set_option backward.isDefEq.respectTransparency false in /-- A map out of a delta-generated space is continuous iff it preserves continuity of maps from ℝⁿ into X. -/ lemma DeltaGeneratedSpace.continuous_iff [DeltaGeneratedSpace X] {f : X → Y} : diff --git a/Mathlib/Topology/Constructions.lean b/Mathlib/Topology/Constructions.lean index 6f88474bbad152..77b2a5ce7c205e 100644 --- a/Mathlib/Topology/Constructions.lean +++ b/Mathlib/Topology/Constructions.lean @@ -196,6 +196,7 @@ theorem continuous_map_sInf {α : Type*} [TopologicalSpace α] {S : Set (Setoid α)} {s : Setoid α} (h : s ∈ S) : Continuous (Setoid.map_sInf h) := continuous_coinduced_rng +set_option backward.isDefEq.respectTransparency false in instance {p : X → Prop} [TopologicalSpace X] [DiscreteTopology X] : DiscreteTopology (Subtype p) := ⟨bot_unique fun s _ => ⟨(↑) '' s, isOpen_discrete _, preimage_image_eq _ Subtype.val_injective⟩⟩ diff --git a/Mathlib/Topology/ContinuousMap/Ideals.lean b/Mathlib/Topology/ContinuousMap/Ideals.lean index b825b255512213..4db32c186e83c3 100644 --- a/Mathlib/Topology/ContinuousMap/Ideals.lean +++ b/Mathlib/Topology/ContinuousMap/Ideals.lean @@ -335,6 +335,7 @@ def idealOpensGI : (isClosed_of_closure_subset <| (idealOfSet_ofIdeal_eq_closure I ▸ hI : I.closure ≤ I)).closure_eq) +set_option backward.isDefEq.respectTransparency false in theorem idealOfSet_isMaximal_iff (s : Opens X) : (idealOfSet 𝕜 (s : Set X)).IsMaximal ↔ IsCoatom s := by rw [Ideal.isMaximal_def] diff --git a/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean b/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean index 3271ee7a3bf687..a54dda01b8f9ac 100644 --- a/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean +++ b/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean @@ -28,6 +28,7 @@ noncomputable section namespace TopologicalSpace +set_option backward.isDefEq.respectTransparency false in theorem eq_induced_by_maps_to_sierpinski (X : Type*) [t : TopologicalSpace X] : t = ⨅ u : Opens X, sierpinskiSpace.induced (· ∈ u) := by apply le_antisymm diff --git a/Mathlib/Topology/LocalAtTarget.lean b/Mathlib/Topology/LocalAtTarget.lean index f82289f50e31c8..46dbdaaaea0cd5 100644 --- a/Mathlib/Topology/LocalAtTarget.lean +++ b/Mathlib/Topology/LocalAtTarget.lean @@ -235,6 +235,7 @@ end LocalAtSource end TopologicalSpace.IsOpenCover +set_option backward.isDefEq.respectTransparency false in /-- Given a continuous map `f : X → Y` between topological spaces. Suppose we have an open cover `U i` of the range of `f`, and a family of continuous maps `V i → X` diff --git a/Mathlib/Topology/MetricSpace/Polish.lean b/Mathlib/Topology/MetricSpace/Polish.lean index d42f8b1fadc484..d3afa2a2fb992e 100644 --- a/Mathlib/Topology/MetricSpace/Polish.lean +++ b/Mathlib/Topology/MetricSpace/Polish.lean @@ -262,6 +262,7 @@ but this is nontrivial (see `isClopenable_iff_measurableSet`). -/ def IsClopenable [t : TopologicalSpace α] (s : Set α) : Prop := ∃ t' : TopologicalSpace α, t' ≤ t ∧ @PolishSpace α t' ∧ IsClosed[t'] s ∧ IsOpen[t'] s +set_option backward.isDefEq.respectTransparency false in /-- Given a closed set `s` in a Polish space, one can construct a finer Polish topology for which `s` is both open and closed. -/ theorem _root_.IsClosed.isClopenable [TopologicalSpace α] [PolishSpace α] {s : Set α} diff --git a/Mathlib/Topology/NoetherianSpace.lean b/Mathlib/Topology/NoetherianSpace.lean index 672735be24df71..d71c0a5c11fbaa 100644 --- a/Mathlib/Topology/NoetherianSpace.lean +++ b/Mathlib/Topology/NoetherianSpace.lean @@ -51,6 +51,7 @@ namespace TopologicalSpace /-- Type class for Noetherian spaces. It is defined to be spaces whose open sets satisfies ACC. -/ abbrev NoetherianSpace : Prop := WellFoundedGT (Opens α) +set_option backward.isDefEq.respectTransparency false in theorem noetherianSpace_iff_opens : NoetherianSpace α ↔ ∀ s : Opens α, IsCompact (s : Set α) := by rw [NoetherianSpace, CompleteLattice.wellFoundedGT_iff_isSupFiniteCompact, CompleteLattice.isSupFiniteCompact_iff_all_elements_compact] @@ -136,6 +137,7 @@ theorem NoetherianSpace.iUnion {ι : Type*} (f : ι → Set α) [Finite ι] rw [← Set.inter_eq_left.mpr ht, Set.inter_iUnion] exact isCompact_iUnion fun i => hf i _ Set.inter_subset_right +set_option backward.isDefEq.respectTransparency false in -- This is not an instance since it makes a loop with `t2_space_discrete`. theorem NoetherianSpace.discrete [NoetherianSpace α] [T2Space α] : DiscreteTopology α := ⟨eq_bot_iff.mpr fun _ _ => isClosed_compl_iff.mp (NoetherianSpace.isCompact _).isClosed⟩ diff --git a/Mathlib/Topology/Order.lean b/Mathlib/Topology/Order.lean index 952d2240c7876d..78fad609e951b2 100644 --- a/Mathlib/Topology/Order.lean +++ b/Mathlib/Topology/Order.lean @@ -347,6 +347,7 @@ theorem le_of_nhds_le_nhds (h : ∀ x, @nhds α t₁ x ≤ @nhds α t₂ x) : t rw [@isOpen_iff_mem_nhds _ t₁, @isOpen_iff_mem_nhds _ t₂] exact fun hs a ha => h _ (hs _ ha) +set_option backward.isDefEq.respectTransparency false in theorem eq_bot_of_singletons_open {t : TopologicalSpace α} (h : ∀ x, IsOpen[t] {x}) : t = ⊥ := bot_unique fun s _ => biUnion_of_singleton s ▸ isOpen_biUnion fun x _ => h x @@ -459,6 +460,7 @@ theorem induced_mono (h : t₁ ≤ t₂) : t₁.induced g ≤ t₂.induced g := theorem coinduced_mono (h : t₁ ≤ t₂) : t₁.coinduced f ≤ t₂.coinduced f := (gc_coinduced_induced f).monotone_l h +set_option backward.isDefEq.respectTransparency false in @[simp] theorem induced_top : (⊤ : TopologicalSpace α).induced g = ⊤ := (gc_coinduced_induced g).u_top @@ -477,6 +479,7 @@ theorem induced_sInf {s : Set (TopologicalSpace α)} : TopologicalSpace.induced g (sInf s) = sInf (TopologicalSpace.induced g '' s) := by rw [sInf_eq_iInf', sInf_image', induced_iInf] +set_option backward.isDefEq.respectTransparency false in @[simp] theorem coinduced_bot : (⊥ : TopologicalSpace α).coinduced f = ⊥ := (gc_coinduced_induced f).l_bot @@ -506,6 +509,7 @@ theorem induced_compose {tγ : TopologicalSpace γ} {f : α → β} {g : β → ⟨fun ⟨_, ⟨s, hs, h₂⟩, h₁⟩ => h₁ ▸ h₂ ▸ ⟨s, hs, rfl⟩, fun ⟨s, hs, h⟩ => ⟨preimage g s, ⟨s, hs, rfl⟩, h ▸ rfl⟩⟩ +set_option backward.isDefEq.respectTransparency false in theorem induced_const [t : TopologicalSpace α] {x : α} : (t.induced fun _ : β => x) = ⊤ := le_antisymm le_top (@continuous_const β α ⊤ t x).le_induced @@ -692,6 +696,7 @@ theorem nhds_inf {t₁ t₂ : TopologicalSpace α} {a : α} : @nhds α (t₁ ⊓ t₂) a = @nhds α t₁ a ⊓ @nhds α t₂ a := (gc_nhds a).u_inf (b₁ := t₁) +set_option backward.isDefEq.respectTransparency false in theorem nhds_top {a : α} : @nhds α ⊤ a = ⊤ := (gc_nhds a).u_top @@ -790,6 +795,7 @@ theorem continuous_le_rng {t₁ : TopologicalSpace α} {t₂ t₃ : TopologicalS rw [continuous_iff_coinduced_le] at h₂ ⊢ exact le_trans h₂ h₁ +set_option backward.isDefEq.respectTransparency false in theorem continuous_sup_dom {t₁ t₂ : TopologicalSpace α} {t₃ : TopologicalSpace β} : Continuous[t₁ ⊔ t₂, t₃] f ↔ Continuous[t₁, t₃] f ∧ Continuous[t₂, t₃] f := by simp only [continuous_iff_le_induced, sup_le_iff] @@ -802,6 +808,7 @@ theorem continuous_sup_rng_right {t₁ : TopologicalSpace α} {t₃ t₂ : Topol Continuous[t₁, t₃] f → Continuous[t₁, t₂ ⊔ t₃] f := continuous_le_rng le_sup_right +set_option backward.isDefEq.respectTransparency false in theorem continuous_sSup_dom {T : Set (TopologicalSpace α)} {t₂ : TopologicalSpace β} : Continuous[sSup T, t₂] f ↔ ∀ t ∈ T, Continuous[t, t₂] f := by simp only [continuous_iff_le_induced, sSup_le_iff] @@ -811,6 +818,7 @@ theorem continuous_sSup_rng {t₁ : TopologicalSpace α} {t₂ : Set (Topologica Continuous[t₁, sSup t₂] f := continuous_iff_coinduced_le.2 <| le_sSup_of_le h₁ <| continuous_iff_coinduced_le.1 hf +set_option backward.isDefEq.respectTransparency false in theorem continuous_iSup_dom {t₁ : ι → TopologicalSpace α} {t₂ : TopologicalSpace β} : Continuous[iSup t₁, t₂] f ↔ ∀ i, Continuous[t₁ i, t₂] f := by simp only [continuous_iff_le_induced, iSup_le_iff] @@ -819,6 +827,7 @@ theorem continuous_iSup_rng {t₁ : TopologicalSpace α} {t₂ : ι → Topologi (h : Continuous[t₁, t₂ i] f) : Continuous[t₁, iSup t₂] f := continuous_sSup_rng ⟨i, rfl⟩ h +set_option backward.isDefEq.respectTransparency false in theorem continuous_inf_rng {t₁ : TopologicalSpace α} {t₂ t₃ : TopologicalSpace β} : Continuous[t₁, t₂ ⊓ t₃] f ↔ Continuous[t₁, t₂] f ∧ Continuous[t₁, t₃] f := by simp only [continuous_iff_coinduced_le, le_inf_iff] @@ -836,6 +845,7 @@ theorem continuous_sInf_dom {t₁ : Set (TopologicalSpace α)} {t₂ : Topologic Continuous[t, t₂] f → Continuous[sInf t₁, t₂] f := continuous_le_dom <| sInf_le h₁ +set_option backward.isDefEq.respectTransparency false in theorem continuous_sInf_rng {t₁ : TopologicalSpace α} {T : Set (TopologicalSpace β)} : Continuous[t₁, sInf T] f ↔ ∀ t ∈ T, Continuous[t₁, t] f := by simp only [continuous_iff_coinduced_le, le_sInf_iff] @@ -844,14 +854,17 @@ theorem continuous_iInf_dom {t₁ : ι → TopologicalSpace α} {t₂ : Topologi Continuous[t₁ i, t₂] f → Continuous[iInf t₁, t₂] f := continuous_le_dom <| iInf_le _ _ +set_option backward.isDefEq.respectTransparency false in theorem continuous_iInf_rng {t₁ : TopologicalSpace α} {t₂ : ι → TopologicalSpace β} : Continuous[t₁, iInf t₂] f ↔ ∀ i, Continuous[t₁, t₂ i] f := by simp only [continuous_iff_coinduced_le, le_iInf_iff] +set_option backward.isDefEq.respectTransparency false in @[continuity, fun_prop] theorem continuous_bot {t : TopologicalSpace β} : Continuous[⊥, t] f := continuous_iff_le_induced.2 bot_le +set_option backward.isDefEq.respectTransparency false in @[continuity, fun_prop] theorem continuous_top {t : TopologicalSpace α} : Continuous[t, ⊤] f := continuous_iff_coinduced_le.2 le_top diff --git a/Mathlib/Topology/Sets/OpenCover.lean b/Mathlib/Topology/Sets/OpenCover.lean index e821d5edeb2b03..8c1bb493d3cfb5 100644 --- a/Mathlib/Topology/Sets/OpenCover.lean +++ b/Mathlib/Topology/Sets/OpenCover.lean @@ -63,10 +63,12 @@ lemma isTopologicalBasis (hu : IsOpenCover u) end IsOpenCover +set_option backward.isDefEq.respectTransparency false in lemma Opens.IsBasis.isOpenCover {S : Set (Opens X)} (hS : Opens.IsBasis S) : IsOpenCover (fun U : S ↦ (U : Opens X)) := top_le_iff.mp (subset_trans hS.2.superset (by simp)) +set_option backward.isDefEq.respectTransparency false in /-- Given an open cover and a basis, the set of basis elements contained in any of the covers is still a cover. -/ lemma Opens.IsBasis.isOpenCover_mem_and_le {S : Set (Opens X)} (hS : Opens.IsBasis S) @@ -84,6 +86,7 @@ section Irreducible open TopologicalSpace Function +set_option backward.isDefEq.respectTransparency false in /-- (Pre)Irreducibility of an open set can be checked on a cover by opens with pairwise non-empty intersections. -/ theorem IsPreirreducible.of_subset_iUnion {X ι : Type*} [TopologicalSpace X] @@ -110,6 +113,7 @@ theorem IsPreirreducible.of_subset_iUnion {X ι : Type*} [TopologicalSpace X] with ⟨x, hx₁, hx₂⟩ exfalso; exact hx₂ <| hUu hx₁ +set_option backward.isDefEq.respectTransparency false in /-- (Pre)Irreducibility can be checked on an open cover with pairwise non-empty intersections. -/ theorem PreirreducibleSpace.of_isOpenCover {X ι : Type*} [TopologicalSpace X] {U : ι → Opens X} (hn : Pairwise ((¬ Disjoint · ·) on U)) (hU : IsOpenCover U) diff --git a/Mathlib/Topology/Sheaves/CommRingCat.lean b/Mathlib/Topology/Sheaves/CommRingCat.lean index 2e6247a95937b2..f222b7cd85cdef 100644 --- a/Mathlib/Topology/Sheaves/CommRingCat.lean +++ b/Mathlib/Topology/Sheaves/CommRingCat.lean @@ -336,6 +336,7 @@ theorem objSupIsoProdEqLocus_inv_snd {X : TopCat} (F : X.Sheaf CommRingCat) (U V (CommRingCat.pullbackConeIsLimit _ _) WalkingCospan.right) x +set_option backward.isDefEq.respectTransparency false in theorem objSupIsoProdEqLocus_inv_eq_iff {X : TopCat.{u}} (F : X.Sheaf CommRingCat.{u}) {U V W UW VW : Opens X} (e : W ≤ U ⊔ V) (x) (y : F.1.obj (op W)) (h₁ : UW = U ⊓ W) (h₂ : VW = V ⊓ W) : diff --git a/Mathlib/Topology/Sheaves/MayerVietoris.lean b/Mathlib/Topology/Sheaves/MayerVietoris.lean index a603bb367bb331..ad6ac294ae220a 100644 --- a/Mathlib/Topology/Sheaves/MayerVietoris.lean +++ b/Mathlib/Topology/Sheaves/MayerVietoris.lean @@ -32,6 +32,7 @@ open CategoryTheory Limits TopologicalSpace variable {T : Type u} [TopologicalSpace T] +set_option backward.isDefEq.respectTransparency false in /-- A square consisting of opens `X₂ ⊓ X₃`, `X₂`, `X₃` and `X₂ ⊔ X₃` is a Mayer-Vietoris square. -/ @[simps! toSquare] diff --git a/Mathlib/Topology/Sheaves/PUnit.lean b/Mathlib/Topology/Sheaves/PUnit.lean index 38c225801bf182..575844cec785ee 100644 --- a/Mathlib/Topology/Sheaves/PUnit.lean +++ b/Mathlib/Topology/Sheaves/PUnit.lean @@ -24,6 +24,7 @@ open CategoryTheory CategoryTheory.Limits TopCat Opposite variable {C : Type u} [Category.{v} C] +set_option backward.isDefEq.respectTransparency false in theorem isSheaf_of_isTerminal_of_indiscrete {X : TopCat.{w}} (hind : X.str = ⊤) (F : Presheaf C X) (it : IsTerminal <| F.obj <| op ⊥) : F.IsSheaf := fun c U s hs => by have : IndiscreteTopology X := ⟨hind⟩ diff --git a/Mathlib/Topology/Sheaves/Points.lean b/Mathlib/Topology/Sheaves/Points.lean index d54ecab23db30a..571125691e2e77 100644 --- a/Mathlib/Topology/Sheaves/Points.lean +++ b/Mathlib/Topology/Sheaves/Points.lean @@ -32,6 +32,7 @@ open CategoryTheory GrothendieckTopology TopologicalSpace variable {X : Type u} [TopologicalSpace X] (x : X) +set_option backward.isDefEq.respectTransparency false in /-- Given a topological space `X` and `x : X`, this is the point of the site `(Opens X, Opens.grothendieckTopology X)` corresponding to `x`. -/ def pointGrothendieckTopology : Point.{u} (grothendieckTopology X) where @@ -68,6 +69,7 @@ instance : HasEnoughPoints.{u} (grothendieckTopology X) where exists_objectProperty := ⟨_, inferInstance, isConservativeFamilyOfPoints_pointsGrothendieckTopology X⟩ +set_option backward.isDefEq.respectTransparency false in instance (U : Opens X) (Φ : Point.{u} (grothendieckTopology X)) : Subsingleton (Φ.fiber.obj U) := Φ.subsingleton_fiber_obj (homOfLE le_top) Limits.isTerminalTop diff --git a/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean b/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean index f1e2bd07e5aca1..e016b662e37149 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean @@ -56,6 +56,7 @@ def OpensLeCover : Type w := ObjectProperty.FullSubcategory fun V : Opens X ↦ ∃ i, V ≤ U i deriving Category +set_option backward.isDefEq.respectTransparency false in instance [h : Nonempty ι] : Inhabited (OpensLeCover U) := ⟨⟨⊥, let ⟨i⟩ := h; ⟨i, bot_le⟩⟩⟩ diff --git a/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean b/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean index eaab0810122e68..9d72abd8a7ef28 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean @@ -112,6 +112,7 @@ def pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U where instance (V : OpensLeCover U) : Nonempty (StructuredArrow V (pairwiseToOpensLeCover U)) := ⟨StructuredArrow.mk (Y := single V.index) (ObjectProperty.homMk V.homToIndex)⟩ +set_option backward.isDefEq.respectTransparency false in -- This is a case bash: for each pair of types of objects in `Pairwise ι`, -- we have to explicitly construct a zigzag. /-- The diagram consisting of the `U i` and `U i ⊓ U j` is cofinal in the diagram @@ -286,6 +287,7 @@ theorem IsSheaf.isSheafPreservesLimitPairwiseIntersections (h : F.IsSheaf) : preservesLimit_of_preserves_limit_cone (Pairwise.coconeIsColimit U).op (h.isSheafPairwiseIntersections U).some +set_option backward.isDefEq.respectTransparency false in /-- The sheaf condition in terms of an equalizer diagram is equivalent to the reformulation in terms of the presheaf preserving the limit of the diagram consisting of the `U i` and `U i ⊓ U j`. @@ -332,6 +334,7 @@ variable (s : PullbackCone (F.1.map (homOfLE inf_le_left : U ⊓ V ⟶ _).op) (F.1.map (homOfLE inf_le_right).op)) +set_option backward.isDefEq.respectTransparency false in /-- (Implementation). Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`. -/ diff --git a/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean b/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean index 4654b86cc7705a..1c5680b1d6bfa8 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean @@ -176,6 +176,7 @@ theorem TopCat.Presheaf.isSheaf_of_isOpenEmbedding (h : IsOpenEmbedding f) (hF : variable (f) +set_option backward.isDefEq.respectTransparency false in instance : RepresentablyFlat (Opens.map f) := by constructor intro U diff --git a/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean b/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean index b87a68a1ea4ff8..619c67fadf604c 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean @@ -234,6 +234,7 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : rw [← ConcreteCategory.comp_apply, ← ConcreteCategory.comp_apply, ← F.1.map_comp] exact h i +set_option backward.isDefEq.respectTransparency false in theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂) (s t : ToType (F.1.obj (op V))) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t) (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by diff --git a/Mathlib/Topology/Spectral/Prespectral.lean b/Mathlib/Topology/Spectral/Prespectral.lean index ae29626e43db41..971e2e08e827e0 100644 --- a/Mathlib/Topology/Spectral/Prespectral.lean +++ b/Mathlib/Topology/Spectral/Prespectral.lean @@ -107,6 +107,7 @@ lemma PrespectralSpace.isBasis_opens [PrespectralSpace X] : ext s exact ⟨fun ⟨V, hV, heq⟩ ↦ heq ▸ ⟨V.2, hV⟩, fun h ↦ ⟨⟨s, h.1⟩, h.2, rfl⟩⟩ +set_option backward.isDefEq.respectTransparency false in /-- In a prespectral space, the lattice of opens is determined by its lattice of compact opens. -/ def PrespectralSpace.opensEquiv [PrespectralSpace X] : Opens X ≃o Order.Ideal (CompactOpens X) where From 2db4d25b1c72bf656656ac0223ae2245c806cb47 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 18:04:34 +0800 Subject: [PATCH 15/29] Reapply "Merge branch 'golf_45' into golf" This reverts commit f75f96a69ce16adf3cf6f0d8efb88892759f9997. --- Archive/Imo/Imo1962Q1.lean | 4 +- Archive/Imo/Imo1962Q4.lean | 3 +- Archive/Imo/Imo2019Q4.lean | 3 +- .../OxfordInvariants/Summer2021/Week3P1.lean | 4 +- Mathlib.lean | 16 ---- Mathlib/Algebra/ArithmeticGeometric.lean | 8 -- .../Category/ModuleCat/Topology/Basic.lean | 2 - .../Homology/DerivedCategory/Basic.lean | 1 - Mathlib/Algebra/Lie/Abelian.lean | 1 - Mathlib/Algebra/Lie/Classical.lean | 1 - Mathlib/Algebra/Lie/Extension.lean | 8 -- Mathlib/Algebra/Lie/Ideal.lean | 3 - Mathlib/Algebra/Lie/Killing.lean | 3 - Mathlib/Algebra/Lie/LieTheorem.lean | 1 - Mathlib/Algebra/Lie/Nilpotent.lean | 6 -- Mathlib/Algebra/Lie/Semisimple/Basic.lean | 1 - Mathlib/Algebra/Lie/TensorProduct.lean | 1 - Mathlib/Algebra/Lie/TraceForm.lean | 1 - Mathlib/Algebra/Module/LinearMap/Defs.lean | 8 +- Mathlib/Algebra/MvPolynomial/Eval.lean | 1 - .../Algebra/MvPolynomial/NoZeroDivisors.lean | 1 - Mathlib/Algebra/Ring/BooleanRing.lean | 3 +- Mathlib/AlgebraicGeometry/AffineScheme.lean | 7 -- .../GammaSpecAdjunction.lean | 1 - .../Geometrically/Basic.lean | 1 - Mathlib/AlgebraicGeometry/Gluing.lean | 2 - .../AlgebraicGeometry/IdealSheaf/Basic.lean | 4 - .../IdealSheaf/Subscheme.lean | 2 - Mathlib/AlgebraicGeometry/Limits.lean | 7 -- Mathlib/AlgebraicGeometry/Modules/Tilde.lean | 2 - .../AlgebraicGeometry/Morphisms/Affine.lean | 2 - .../AlgebraicGeometry/Morphisms/Basic.lean | 2 - .../Morphisms/Constructors.lean | 2 - Mathlib/AlgebraicGeometry/Morphisms/Flat.lean | 1 - .../Morphisms/FormallyUnramified.lean | 1 - .../Morphisms/Immersion.lean | 1 - .../AlgebraicGeometry/Morphisms/Proper.lean | 1 - .../Morphisms/QuasiCompact.lean | 4 - .../Morphisms/QuasiSeparated.lean | 1 - .../Morphisms/RingHomProperties.lean | 4 - .../AlgebraicGeometry/Morphisms/Smooth.lean | 1 - Mathlib/AlgebraicGeometry/OpenImmersion.lean | 1 - .../ProjectiveSpectrum/Basic.lean | 3 - .../ProjectiveSpectrum/Scheme.lean | 1 - .../ProjectiveSpectrum/Topology.lean | 1 - Mathlib/AlgebraicGeometry/Properties.lean | 1 - Mathlib/AlgebraicGeometry/QuasiAffine.lean | 2 - Mathlib/AlgebraicGeometry/RationalMap.lean | 1 - Mathlib/AlgebraicGeometry/Restrict.lean | 5 - Mathlib/AlgebraicGeometry/Scheme.lean | 1 - Mathlib/AlgebraicGeometry/Spec.lean | 1 - Mathlib/AlgebraicGeometry/Stalk.lean | 1 - Mathlib/AlgebraicGeometry/StructureSheaf.lean | 3 - .../ZariskisMainTheorem.lean | 2 - .../AlgebraicTopology/ExtraDegeneracy.lean | 1 - .../SimplexCategory/Augmented/Monoidal.lean | 2 - .../SimplexCategory/Basic.lean | 16 ---- .../SimplexCategory/ToMkOne.lean | 5 - .../SimplicialSet/Degenerate.lean | 2 - .../AlgebraicTopology/SimplicialSet/Horn.lean | 1 - .../SimplicialSet/NerveAdjunction.lean | 1 - .../AlgebraicTopology/SimplicialSet/Path.lean | 2 - .../SimplicialSet/ProdStdSimplex.lean | 1 - .../SimplicialSet/StdSimplex.lean | 9 -- .../SimplicialSet/StrictSegal.lean | 7 -- .../Analysis/BoxIntegral/Partition/Split.lean | 8 +- .../ContinuousFunctionalCalculus/Basic.lean | 1 - .../Isometric.lean | 12 ++- .../ContinuousFunctionalCalculus/Order.lean | 4 +- .../ContinuousFunctionalCalculus/Range.lean | 12 ++- .../Analysis/CStarAlgebra/Exponential.lean | 15 ++- Mathlib/Analysis/CStarAlgebra/Spectrum.lean | 8 +- Mathlib/Analysis/Complex/Hadamard.lean | 3 +- Mathlib/Analysis/Convex/Approximation.lean | 5 +- .../Analysis/Distribution/TestFunction.lean | 1 - .../InnerProductSpace/Harmonic/Analytic.lean | 6 -- Mathlib/Analysis/MeanInequalities.lean | 3 +- Mathlib/Analysis/Normed/Algebra/Basic.lean | 1 - Mathlib/Analysis/Normed/Field/Basic.lean | 6 +- Mathlib/Analysis/Normed/Group/Basic.lean | 9 +- Mathlib/Analysis/Normed/Group/Subgroup.lean | 16 ++-- Mathlib/Analysis/Normed/Group/Submodule.lean | 2 +- .../Normed/Module/Ball/Pointwise.lean | 1 - Mathlib/Analysis/Normed/Module/Basic.lean | 4 +- Mathlib/Analysis/Normed/Ring/Basic.lean | 26 +++--- .../NormedSpace/ConformalLinearMap.lean | 7 -- Mathlib/Analysis/NormedSpace/Extend.lean | 10 -- .../SpecialFunctions/Complex/Arctan.lean | 3 +- .../SpecialFunctions/Integrability/Basic.lean | 3 +- .../Trigonometric/Arctan.lean | 3 +- Mathlib/CategoryTheory/Abelian/Basic.lean | 3 - Mathlib/CategoryTheory/Abelian/Images.lean | 1 - .../CategoryTheory/Adjunction/Opposites.lean | 2 + .../Bicategory/Functor/Strict.lean | 8 -- Mathlib/CategoryTheory/Bicategory/Strict.lean | 5 - Mathlib/CategoryTheory/CatCommSq.lean | 4 +- .../CategoryTheory/Comma/CardinalArrow.lean | 2 - Mathlib/CategoryTheory/Functor/Category.lean | 2 +- Mathlib/CategoryTheory/Functor/TwoSquare.lean | 4 +- Mathlib/CategoryTheory/Galois/EssSurj.lean | 1 - Mathlib/CategoryTheory/Iso.lean | 1 - Mathlib/CategoryTheory/Limits/Cones.lean | 2 +- .../CategoryTheory/Limits/Shapes/Images.lean | 8 -- .../CategoryTheory/Limits/Shapes/Kernels.lean | 2 - .../Shapes/Pullback/PullbackObjObj.lean | 8 -- .../CategoryTheory/Limits/Types/Images.lean | 1 - .../MorphismProperty/Factorization.lean | 1 - .../MorphismProperty/IsSmall.lean | 1 - .../MorphismProperty/Limits.lean | 2 - .../CategoryTheory/Shift/ShiftSequence.lean | 2 +- .../CategoryTheory/Sites/Grothendieck.lean | 1 - .../Sites/PrecoverageToGrothendieck.lean | 3 - Mathlib/CategoryTheory/Sites/Pretopology.lean | 1 - Mathlib/CategoryTheory/Sites/Spaces.lean | 3 - .../IsCardinalForSmallObjectArgument.lean | 1 - .../Extremal/RuzsaSzemeredi.lean | 5 +- .../Combinatorics/SimpleGraph/Acyclic.lean | 1 - Mathlib/Combinatorics/SimpleGraph/Cayley.lean | 2 - .../SimpleGraph/Connectivity/Finite.lean | 1 - .../SimpleGraph/Extremal/Turan.lean | 1 - .../SimpleGraph/Regularity/Chunk.lean | 10 +- .../SimpleGraph/StronglyRegular.lean | 1 - Mathlib/Data/ENNReal/Action.lean | 1 - Mathlib/Data/Finset/Lattice/Prod.lean | 93 +++---------------- Mathlib/Data/Nat/PowModTotient.lean | 8 -- Mathlib/Data/Real/Irrational.lean | 5 - Mathlib/Data/Set/Finite/Lattice.lean | 71 +++----------- Mathlib/Deprecated/Sort.lean | 72 -------------- Mathlib/FieldTheory/Perfect.lean | 4 + .../Angle/Unoriented/TriangleInequality.lean | 6 +- Mathlib/Geometry/Euclidean/Projection.lean | 3 +- Mathlib/Geometry/RingedSpace/Basic.lean | 1 - .../RingedSpace/LocallyRingedSpace.lean | 1 - .../LocallyRingedSpace/ResidueField.lean | 1 - Mathlib/GroupTheory/Coprod/Basic.lean | 3 - Mathlib/GroupTheory/Coxeter/Basic.lean | 5 +- Mathlib/GroupTheory/Divisible.lean | 3 +- Mathlib/GroupTheory/Perm/Cycle/Type.lean | 1 - .../SpecificGroups/Alternating.lean | 3 +- .../SpecificGroups/Quaternion.lean | 2 +- .../Coding/KraftMcMillan.lean | 4 +- .../KullbackLeibler/Basic.lean | 5 - .../LinearAlgebra/AffineSpace/Centroid.lean | 3 +- .../AffineSpace/ContinuousAffineEquiv.lean | 8 -- .../FiniteDimensional/Basic.lean | 7 ++ .../LinearAlgebra/Matrix/Charpoly/Coeff.lean | 1 - .../Matrix/FixedDetMatrices.lean | 1 - .../LinearAlgebra/Matrix/SchurComplement.lean | 1 - Mathlib/LinearAlgebra/Multilinear/Basic.lean | 4 + .../RootSystem/GeckConstruction/Basic.lean | 1 - Mathlib/LinearAlgebra/SesquilinearForm.lean | 10 -- Mathlib/LinearAlgebra/SymplecticGroup.lean | 4 - .../Function/LpSeminorm/LpNorm.lean | 2 - .../Group/GeometryOfNumbers.lean | 3 +- .../Measure/Decomposition/Lebesgue.lean | 12 --- .../MeasureTheory/Measure/FiniteMeasure.lean | 1 - .../MeasureTheory/Measure/Haar/Unique.lean | 1 - Mathlib/MeasureTheory/Measure/Hausdorff.lean | 2 - .../Measure/Typeclasses/Finite.lean | 1 - .../Measure/Typeclasses/Probability.lean | 1 - .../ArithmeticFunction/LFunction.lean | 1 - .../NumberTheory/Cyclotomic/Discriminant.lean | 5 +- .../NumberTheory/Cyclotomic/Embeddings.lean | 8 -- Mathlib/NumberTheory/Cyclotomic/PID.lean | 9 -- Mathlib/NumberTheory/Cyclotomic/Rat.lean | 9 -- Mathlib/NumberTheory/Cyclotomic/Three.lean | 9 -- Mathlib/NumberTheory/Harmonic/GammaDeriv.lean | 2 +- .../NumberTheory/NumberField/Completion.lean | 7 -- .../NumberField/InfinitePlace/Basic.lean | 1 - Mathlib/NumberTheory/ZetaValues.lean | 3 +- Mathlib/Order/CompleteBooleanAlgebra.lean | 1 + .../Distributions/SetBernoulli.lean | 2 - .../RingTheory/AdicCompletion/LocalRing.lean | 70 ++------------ Mathlib/RingTheory/Artinian/Module.lean | 41 +++++--- Mathlib/RingTheory/Extension/Generators.lean | 1 - Mathlib/RingTheory/Flat/Rank.lean | 1 - Mathlib/RingTheory/Jacobson/Ring.lean | 6 +- .../MvPowerSeries/Substitution.lean | 1 - Mathlib/RingTheory/Nilpotent/Exp.lean | 3 +- .../RingTheory/Spectrum/Maximal/Basic.lean | 4 + .../RingTheory/Spectrum/Prime/Topology.lean | 6 -- Mathlib/Tactic/NormNum/Prime.lean | 4 +- Mathlib/Tactic/Translate/Core.lean | 5 +- Mathlib/Topology/AlexandrovDiscrete.lean | 1 - Mathlib/Topology/Algebra/Constructions.lean | 1 - .../Topology/Algebra/Group/GroupTopology.lean | 1 - .../Topology/Algebra/Module/LinearMap.lean | 13 ++- .../Algebra/Module/Multilinear/Basic.lean | 4 + .../RestrictedProduct/TopologicalSpace.lean | 1 - .../Category/TopCat/Limits/Basic.lean | 2 - Mathlib/Topology/Category/TopCat/Opens.lean | 2 - Mathlib/Topology/Category/TopCat/ULift.lean | 1 - .../Compactness/CompactlyGeneratedSpace.lean | 1 - .../Compactness/DeltaGeneratedSpace.lean | 1 - Mathlib/Topology/Constructions.lean | 1 - Mathlib/Topology/ContinuousMap/Ideals.lean | 1 - .../Topology/ContinuousMap/T0Sierpinski.lean | 1 - Mathlib/Topology/LocalAtTarget.lean | 1 - Mathlib/Topology/MetricSpace/Polish.lean | 1 - Mathlib/Topology/NoetherianSpace.lean | 2 - Mathlib/Topology/Order.lean | 13 --- Mathlib/Topology/Sets/OpenCover.lean | 4 - Mathlib/Topology/Sheaves/CommRingCat.lean | 1 - Mathlib/Topology/Sheaves/MayerVietoris.lean | 1 - Mathlib/Topology/Sheaves/PUnit.lean | 1 - Mathlib/Topology/Sheaves/Points.lean | 2 - .../Sheaves/SheafCondition/OpensLeCover.lean | 1 - .../SheafCondition/PairwiseIntersections.lean | 3 - .../Sheaves/SheafCondition/Sites.lean | 1 - .../Sheaves/SheafCondition/UniqueGluing.lean | 1 - Mathlib/Topology/Spectral/Prespectral.lean | 1 - 211 files changed, 231 insertions(+), 842 deletions(-) delete mode 100644 Mathlib/Algebra/ArithmeticGeometric.lean delete mode 100644 Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean delete mode 100644 Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean delete mode 100644 Mathlib/Analysis/NormedSpace/Extend.lean delete mode 100644 Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean delete mode 100644 Mathlib/CategoryTheory/Bicategory/Strict.lean delete mode 100644 Mathlib/Data/Nat/PowModTotient.lean delete mode 100644 Mathlib/Data/Real/Irrational.lean delete mode 100644 Mathlib/Deprecated/Sort.lean delete mode 100644 Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean delete mode 100644 Mathlib/LinearAlgebra/SesquilinearForm.lean delete mode 100644 Mathlib/NumberTheory/Cyclotomic/Embeddings.lean delete mode 100644 Mathlib/NumberTheory/Cyclotomic/PID.lean delete mode 100644 Mathlib/NumberTheory/Cyclotomic/Rat.lean delete mode 100644 Mathlib/NumberTheory/Cyclotomic/Three.lean delete mode 100644 Mathlib/NumberTheory/NumberField/Completion.lean diff --git a/Archive/Imo/Imo1962Q1.lean b/Archive/Imo/Imo1962Q1.lean index fac8ebd6533e12..a2af69b60fc5db 100644 --- a/Archive/Imo/Imo1962Q1.lean +++ b/Archive/Imo/Imo1962Q1.lean @@ -105,9 +105,7 @@ lemma case_more_digits {c n : ℕ} (hc : (digits 10 c).length ≥ 6) (hpp : Prob Now we combine these cases to show that 153846 is the smallest solution. -/ -lemma satisfied_by_153846 : ProblemPredicate 153846 := by - norm_num [ProblemPredicate] - decide +lemma satisfied_by_153846 : ProblemPredicate 153846 := by simp +decide [ProblemPredicate] lemma no_smaller_solutions (n : ℕ) (hn : ProblemPredicate n) : n ≥ 153846 := by have ⟨c, hcn⟩ := without_digits hn diff --git a/Archive/Imo/Imo1962Q4.lean b/Archive/Imo/Imo1962Q4.lean index 4bf3c118bd02e1..82fbe1939e0283 100644 --- a/Archive/Imo/Imo1962Q4.lean +++ b/Archive/Imo/Imo1962Q4.lean @@ -59,8 +59,7 @@ Now we can solve for `x` using basic-ish trigonometry. -/ theorem solve_cos2_half {x : ℝ} : cos x ^ 2 = 1 / 2 ↔ ∃ k : ℤ, x = (2 * ↑k + 1) * π / 4 := by rw [cos_sq] - simp only [add_eq_left, div_eq_zero_iff] - norm_num + simp only [add_eq_left, div_eq_zero_iff, OfNat.ofNat_ne_zero, or_false] rw [cos_eq_zero_iff] constructor <;> · rintro ⟨k, h⟩ diff --git a/Archive/Imo/Imo2019Q4.lean b/Archive/Imo/Imo2019Q4.lean index de9e6e56811471..653d7ab691f109 100644 --- a/Archive/Imo/Imo2019Q4.lean +++ b/Archive/Imo/Imo2019Q4.lean @@ -75,6 +75,7 @@ theorem upper_bound {k n : ℕ} (hk : k > 0) end Imo2019Q4 +set_option linter.flexible false in -- TODO: fix non-terminal simp theorem imo2019_q4 {k n : ℕ} (hk : 0 < k) (hn : 0 < n) : (k ! : ℤ) = ∏ i ∈ range n, ((2 : ℤ) ^ n - (2 : ℤ) ^ i) ↔ (k, n) = (1, 1) ∨ (k, n) = (3, 2) := by -- The implication `←` holds. @@ -90,7 +91,7 @@ theorem imo2019_q4 {k n : ℕ} (hk : 0 < k) (hn : 0 < n) : -- n = 2 · right; congr; norm_num [prod_range_succ] at h; norm_cast at h; rwa [← factorial_inj'] norm_num - all_goals exfalso; norm_num [prod_range_succ] at h; norm_cast at h + all_goals exfalso; simp [prod_range_succ] at h; norm_cast at h -- n = 3 · refine monotone_factorial.ne_of_lt_of_lt_nat 5 ?_ ?_ _ h <;> decide -- n = 4 diff --git a/Archive/OxfordInvariants/Summer2021/Week3P1.lean b/Archive/OxfordInvariants/Summer2021/Week3P1.lean index 8738e6d536e1f2..40e5284282b69e 100644 --- a/Archive/OxfordInvariants/Summer2021/Week3P1.lean +++ b/Archive/OxfordInvariants/Summer2021/Week3P1.lean @@ -95,9 +95,7 @@ theorem OxfordInvariants.Week3P1 (n : ℕ) (a : ℕ → ℕ) (a_pos : ∀ i ≤ Claim that the sum equals `1` -/ refine ⟨1, ?_, ?_⟩ -- Check that this indeed equals the sum - · rw [Nat.cast_one, Finset.sum_range_one] - norm_num - rw [div_self] + · rw [Nat.cast_one, Finset.sum_range_one, zero_add, div_self] exact (mul_pos (a_pos 0 (Nat.zero_le _)) (a_pos 1 (Nat.zero_lt_succ _))).ne' -- Check the divisibility condition · rw [mul_one, tsub_self] diff --git a/Mathlib.lean b/Mathlib.lean index b24cfc4d0f2227..2cd2bf5ca6d5cc 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -52,7 +52,6 @@ public import Mathlib.Algebra.Algebra.TransferInstance public import Mathlib.Algebra.Algebra.Unitization public import Mathlib.Algebra.Algebra.ZMod public import Mathlib.Algebra.AlgebraicCard -public import Mathlib.Algebra.ArithmeticGeometric public import Mathlib.Algebra.Azumaya.Basic public import Mathlib.Algebra.Azumaya.Defs public import Mathlib.Algebra.Azumaya.Matrix @@ -1952,7 +1951,6 @@ public import Mathlib.Analysis.InnerProductSpace.Dual public import Mathlib.Analysis.InnerProductSpace.EuclideanDist public import Mathlib.Analysis.InnerProductSpace.GramMatrix public import Mathlib.Analysis.InnerProductSpace.GramSchmidtOrtho -public import Mathlib.Analysis.InnerProductSpace.Harmonic.Analytic public import Mathlib.Analysis.InnerProductSpace.Harmonic.Basic public import Mathlib.Analysis.InnerProductSpace.Harmonic.Constructions public import Mathlib.Analysis.InnerProductSpace.Harmonic.HarmonicContOnCl @@ -2186,10 +2184,8 @@ public import Mathlib.Analysis.Normed.Unbundled.SpectralNorm public import Mathlib.Analysis.NormedSpace.Alternating.Basic public import Mathlib.Analysis.NormedSpace.Alternating.Curry public import Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin -public import Mathlib.Analysis.NormedSpace.ConformalLinearMap public import Mathlib.Analysis.NormedSpace.Connected public import Mathlib.Analysis.NormedSpace.ENormedSpace -public import Mathlib.Analysis.NormedSpace.Extend public import Mathlib.Analysis.NormedSpace.Extr public import Mathlib.Analysis.NormedSpace.HahnBanach.Extension public import Mathlib.Analysis.NormedSpace.HahnBanach.SeparatingDual @@ -2452,7 +2448,6 @@ public import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete public import Mathlib.CategoryTheory.Bicategory.Functor.Oplax public import Mathlib.CategoryTheory.Bicategory.Functor.Prelax public import Mathlib.CategoryTheory.Bicategory.Functor.Pseudofunctor -public import Mathlib.CategoryTheory.Bicategory.Functor.Strict public import Mathlib.CategoryTheory.Bicategory.Functor.StrictPseudofunctor public import Mathlib.CategoryTheory.Bicategory.Functor.StrictlyUnitary public import Mathlib.CategoryTheory.Bicategory.FunctorBicategory.Lax @@ -2475,7 +2470,6 @@ public import Mathlib.CategoryTheory.Bicategory.NaturalTransformation.Pseudo public import Mathlib.CategoryTheory.Bicategory.Opposites public import Mathlib.CategoryTheory.Bicategory.Product public import Mathlib.CategoryTheory.Bicategory.SingleObj -public import Mathlib.CategoryTheory.Bicategory.Strict public import Mathlib.CategoryTheory.Bicategory.Strict.Basic public import Mathlib.CategoryTheory.Bicategory.Strict.Pseudofunctor public import Mathlib.CategoryTheory.Bicategory.Yoneda @@ -4081,7 +4075,6 @@ public import Mathlib.Data.Nat.Order.Lemmas public import Mathlib.Data.Nat.PSub public import Mathlib.Data.Nat.Pairing public import Mathlib.Data.Nat.Periodic -public import Mathlib.Data.Nat.PowModTotient public import Mathlib.Data.Nat.Prime.Basic public import Mathlib.Data.Nat.Prime.Defs public import Mathlib.Data.Nat.Prime.Factorial @@ -4170,7 +4163,6 @@ public import Mathlib.Data.Real.ConjExponents public import Mathlib.Data.Real.ENatENNReal public import Mathlib.Data.Real.Embedding public import Mathlib.Data.Real.Hom -public import Mathlib.Data.Real.Irrational public import Mathlib.Data.Real.Pointwise public import Mathlib.Data.Real.Sign public import Mathlib.Data.Real.Sqrt @@ -4300,7 +4292,6 @@ public import Mathlib.Data.ZMod.QuotientRing public import Mathlib.Data.ZMod.Units public import Mathlib.Data.ZMod.ValMinAbs public import Mathlib.Deprecated.Aliases -public import Mathlib.Deprecated.Sort public import Mathlib.Dynamics.BirkhoffSum.Average public import Mathlib.Dynamics.BirkhoffSum.Basic public import Mathlib.Dynamics.BirkhoffSum.NormedSpace @@ -4752,7 +4743,6 @@ public import Mathlib.LinearAlgebra.AffineSpace.Basis public import Mathlib.LinearAlgebra.AffineSpace.Centroid public import Mathlib.LinearAlgebra.AffineSpace.Ceva public import Mathlib.LinearAlgebra.AffineSpace.Combination -public import Mathlib.LinearAlgebra.AffineSpace.ContinuousAffineEquiv public import Mathlib.LinearAlgebra.AffineSpace.Defs public import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional public import Mathlib.LinearAlgebra.AffineSpace.Independent @@ -5053,7 +5043,6 @@ public import Mathlib.LinearAlgebra.SModEq.Basic public import Mathlib.LinearAlgebra.SModEq.Pointwise public import Mathlib.LinearAlgebra.SModEq.Pow public import Mathlib.LinearAlgebra.Semisimple -public import Mathlib.LinearAlgebra.SesquilinearForm public import Mathlib.LinearAlgebra.SesquilinearForm.Basic public import Mathlib.LinearAlgebra.SesquilinearForm.Star public import Mathlib.LinearAlgebra.Span.Basic @@ -5514,12 +5503,8 @@ public import Mathlib.NumberTheory.ClassNumber.FunctionField public import Mathlib.NumberTheory.Cyclotomic.Basic public import Mathlib.NumberTheory.Cyclotomic.CyclotomicCharacter public import Mathlib.NumberTheory.Cyclotomic.Discriminant -public import Mathlib.NumberTheory.Cyclotomic.Embeddings public import Mathlib.NumberTheory.Cyclotomic.Gal -public import Mathlib.NumberTheory.Cyclotomic.PID public import Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots -public import Mathlib.NumberTheory.Cyclotomic.Rat -public import Mathlib.NumberTheory.Cyclotomic.Three public import Mathlib.NumberTheory.Dioph public import Mathlib.NumberTheory.DiophantineApproximation.Basic public import Mathlib.NumberTheory.DiophantineApproximation.ContinuedFractions @@ -5637,7 +5622,6 @@ public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.FundamentalCon public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.NormLeOne public import Mathlib.NumberTheory.NumberField.CanonicalEmbedding.PolarCoord public import Mathlib.NumberTheory.NumberField.ClassNumber -public import Mathlib.NumberTheory.NumberField.Completion public import Mathlib.NumberTheory.NumberField.Completion.FinitePlace public import Mathlib.NumberTheory.NumberField.Completion.InfinitePlace public import Mathlib.NumberTheory.NumberField.Cyclotomic.Basic diff --git a/Mathlib/Algebra/ArithmeticGeometric.lean b/Mathlib/Algebra/ArithmeticGeometric.lean deleted file mode 100644 index dbdbfcf009a3b3..00000000000000 --- a/Mathlib/Algebra/ArithmeticGeometric.lean +++ /dev/null @@ -1,8 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Algebra.Order.Module.Field -public import Mathlib.Data.EReal.Inv -public import Mathlib.Topology.Algebra.InfiniteSum.Order -public import Mathlib.Topology.MetricSpace.Bounded - -deprecated_module (since := "2025-09-17") diff --git a/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean index d6a77cc877f003..dfaf716fa6de94 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean @@ -369,7 +369,6 @@ def withModuleTopologyAdj : withModuleTopology R ⊣ forget₂ (TopModuleCat R) instance : (forget₂ (TopModuleCat R) (ModuleCat R)).IsRightAdjoint := ⟨_, ⟨withModuleTopologyAdj R⟩⟩ instance : (withModuleTopology R).IsLeftAdjoint := ⟨_, ⟨withModuleTopologyAdj R⟩⟩ -set_option backward.isDefEq.respectTransparency false in /-- The functor equipping a module with the indiscrete topology. This is right adjoint to the forgetful functor. -/ def indiscrete : ModuleCat.{v} R ⥤ TopModuleCat.{v} R where @@ -384,7 +383,6 @@ def indiscrete : ModuleCat.{v} R ⥤ TopModuleCat.{v} R where ConcreteCategory.ofHom (C := TopModuleCat R) ⟨f.hom, by rw [continuous_iff_coinduced_le]; exact le_top⟩ -set_option backward.isDefEq.respectTransparency false in /-- The adjunction between the forgetful functor and the indiscrete topology functor. -/ def indiscreteAdj : forget₂ (TopModuleCat.{v} R) (ModuleCat.{v} R) ⊣ indiscrete.{v} R where counit := 𝟙 _ diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean index b91944017e2a75..5113b5c5311b34 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Basic.lean @@ -264,7 +264,6 @@ lemma singleFunctorsPostcompQIso_hom_hom (n : ℤ) : erw [Category.id_comp] rfl -set_option backward.isDefEq.respectTransparency false in lemma singleFunctorsPostcompQIso_inv_hom (n : ℤ) : (singleFunctorsPostcompQIso C).inv.hom n = 𝟙 _ := by ext X diff --git a/Mathlib/Algebra/Lie/Abelian.lean b/Mathlib/Algebra/Lie/Abelian.lean index 00ab6cd7c847c1..4d0b6d5f4c5ba1 100644 --- a/Mathlib/Algebra/Lie/Abelian.lean +++ b/Mathlib/Algebra/Lie/Abelian.lean @@ -143,7 +143,6 @@ protected theorem mem_ker (x : L) : x ∈ LieModule.ker R L M ↔ ∀ m : M, ⁅ simp only [LieModule.ker, LieHom.mem_ker, LinearMap.ext_iff, LinearMap.zero_apply, toEnd_apply_apply] -set_option backward.isDefEq.respectTransparency false in lemma _root_.LieIdeal.isLieAbelian_iff {I : LieIdeal R L} : IsLieAbelian I ↔ I ≤ LieModule.ker R L I := by refine ⟨fun hI x hx ↦ LieHom.mem_ker.mpr ?_, fun h ↦ ⟨fun ⟨x, hx⟩ ⟨y, hy⟩ ↦ ?_⟩⟩ diff --git a/Mathlib/Algebra/Lie/Classical.lean b/Mathlib/Algebra/Lie/Classical.lean index 7801f11fc75b2a..187f88e27ac47f 100644 --- a/Mathlib/Algebra/Lie/Classical.lean +++ b/Mathlib/Algebra/Lie/Classical.lean @@ -276,7 +276,6 @@ theorem jd_transform [Fintype l] : (PD l R)ᵀ * JD l R * PD l R = (2 : R) • S rw [h, PD, s_as_blocks, Matrix.fromBlocks_multiply, Matrix.fromBlocks_smul] simp [two_smul] -set_option backward.isDefEq.respectTransparency false in theorem pd_inv [Fintype l] [Invertible (2 : R)] : PD l R * ⅟(2 : R) • (PD l R)ᵀ = 1 := by rw [PD, Matrix.fromBlocks_transpose, Matrix.fromBlocks_smul, Matrix.fromBlocks_multiply] diff --git a/Mathlib/Algebra/Lie/Extension.lean b/Mathlib/Algebra/Lie/Extension.lean index 85c91ade1fe3df..c039d3d598dfd3 100644 --- a/Mathlib/Algebra/Lie/Extension.lean +++ b/Mathlib/Algebra/Lie/Extension.lean @@ -319,7 +319,6 @@ noncomputable def toKer (E : Extension R M L) : instance [IsLieAbelian M] (E : Extension R M L) : IsLieAbelian E.proj.ker := (lie_abelian_iff_equiv_lie_abelian E.toKer.symm).mpr inferInstance -set_option backward.isDefEq.respectTransparency false in /-- 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. -/ @@ -339,7 +338,6 @@ noncomputable def ringModuleOf [IsLieAbelian M] (E : Extension R M L) : LieRingM rw [← map_add, EquivLike.apply_eq_iff_eq, LieEquiv.apply_symm_apply, LieEquiv.apply_symm_apply, leibniz_lie, aux] -set_option backward.isDefEq.respectTransparency false in lemma ringModuleOf_bracket_proj [IsLieAbelian M] (E : Extension R M L) (y : M) (z : E.L) : letI := E.ringModuleOf ⁅E.proj z, y⁆ = E.toKer.symm ⁅z, E.toKer y⁆ := by @@ -351,7 +349,6 @@ lemma ringModuleOf_bracket_proj [IsLieAbelian M] (E : Extension R M L) (y : M) ( Subtype.ext_iff, LieSubmodule.coe_bracket, lie_toKer_apply, ZeroMemClass.coe_zero, ← hx, LieHom.coe_toLinearMap, ← LieHom.map_lie, trivial_lie_zero M M x y, map_zero] -set_option backward.isDefEq.respectTransparency false in /-- Given an extension of `L` by `M` whose kernel `M` is abelian, the kernel `M` gets an `R`-linear `L`-module structure. We do not make this an instance, because we may have to work with more than one extension. -/ @@ -372,14 +369,12 @@ lemma toKer_bracket [IsLieAbelian M] (E : Extension R M L) (x : E.proj.ker) (y : E.toKer ⁅y, E.toKer.symm x⁆ = ⁅E.proj_surjective.hasRightInverse.choose y, x⁆ := by simp -set_option backward.isDefEq.respectTransparency false in lemma lie_apply_proj_of_leftInverse_eq [IsLieAbelian M] (E : Extension R M L) {s : L →ₗ[R] E.L} (hs : LeftInverse E.proj s) (x : E.L) (y : E.proj.ker) : ⁅s (E.proj x), y⁆ = ⁅x, y⁆ := by rw [← sub_eq_zero, ← sub_lie] exact trivial_lie_zero E.proj.ker E.proj.ker ⟨_, (by simp [hs.eq])⟩ y -set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in /-- A preparatory function for making a 2-cocycle from a linear splitting of an extension. -/ private abbrev twoCocycleAux (E : Extension R M L) {s : L →ₗ[R] E.L} @@ -392,7 +387,6 @@ private abbrev twoCocycleAux (E : Extension R M L) {s : L →ₗ[R] E.L} map_add' x y := by ext; simp; abel map_smul' _ _ := by ext; simp [smul_sub] -set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- The 2-cocycle attached to an extension with a linear section. -/ @@ -427,7 +421,6 @@ noncomputable def twoCocycleOf [IsLieAbelian M] (E : Extension R M L) {s : L → sub_add_cancel_right, map_add, neg_add_rev] abel_nf -set_option backward.isDefEq.respectTransparency false in /-- The 1-cochain attached to a pair of splittings of an extension. -/ @[simps] noncomputable def oneCochainOfTwoSplitting (E : Extension R M L) {s₁ s₂ : L →ₗ[R] E.L} @@ -442,7 +435,6 @@ noncomputable def oneCochainOfTwoSplitting (E : Extension R M L) {s₁ s₂ : L rw [RingHom.id_apply, ← map_smul, EquivLike.apply_eq_iff_eq, SetLike.mk_smul_of_tower_mk, Subtype.mk_eq_mk, LinearMap.map_smul_of_tower, smul_sub, LinearMap.map_smul_of_tower] -set_option backward.isDefEq.respectTransparency false in lemma d₁₂_oneCochainOfTwoSplitting [IsLieAbelian M] (E : Extension R M L) {s₁ s₂ : L →ₗ[R] E.L} (hs₁ : LeftInverse E.proj s₁) (hs₂ : LeftInverse E.proj s₂) : letI := E.ringModuleOf diff --git a/Mathlib/Algebra/Lie/Ideal.lean b/Mathlib/Algebra/Lie/Ideal.lean index f127d8f4d03f53..c7bdf292d59f00 100644 --- a/Mathlib/Algebra/Lie/Ideal.lean +++ b/Mathlib/Algebra/Lie/Ideal.lean @@ -450,7 +450,6 @@ lemma incl_injective (I : LieIdeal R L) : Function.Injective I.incl := @[simp] theorem comap_incl_self : comap I.incl I = ⊤ := by ext; simp -set_option backward.isDefEq.respectTransparency false in @[simp] theorem ker_incl : I.incl.ker = ⊥ := by ext; simp @@ -467,14 +466,12 @@ theorem incl_isIdealMorphism : I.incl.IsIdealMorphism := by variable {I} -set_option backward.isDefEq.respectTransparency false in @[simp] theorem comap_incl_eq_top : I₂.comap I.incl = ⊤ ↔ I ≤ I₂ := by rw [← LieSubmodule.toSubmodule_inj, LieIdeal.comap_toSubmodule, LieSubmodule.top_toSubmodule, incl_coe] simp_rw [toLieSubalgebra_toSubmodule] rw [Submodule.comap_subtype_eq_top, LieSubmodule.toSubmodule_le_toSubmodule] -set_option backward.isDefEq.respectTransparency false in @[simp] theorem comap_incl_eq_bot : I₂.comap I.incl = ⊥ ↔ Disjoint I I₂ := by rw [disjoint_iff, ← LieSubmodule.toSubmodule_inj, LieIdeal.comap_toSubmodule, LieSubmodule.bot_toSubmodule, ← LieSubmodule.toSubmodule_inj, LieSubmodule.inf_toSubmodule, diff --git a/Mathlib/Algebra/Lie/Killing.lean b/Mathlib/Algebra/Lie/Killing.lean index 2f9344549acd3e..5b6e21ed72a0d0 100644 --- a/Mathlib/Algebra/Lie/Killing.lean +++ b/Mathlib/Algebra/Lie/Killing.lean @@ -71,7 +71,6 @@ lemma killingForm_nondegenerate : refine (LieModule.traceForm_isSymm R L L).isRefl.nondegenerate_iff_separatingLeft.mpr ?_ simp [LinearMap.separatingLeft_iff_ker_eq_bot] -set_option backward.isDefEq.respectTransparency false in variable {R L} in lemma ideal_eq_bot_of_isLieAbelian [Module.Free R L] [Module.Finite R L] [IsDomain R] [IsPrincipalIdealRing R] @@ -79,7 +78,6 @@ lemma ideal_eq_bot_of_isLieAbelian rw [eq_bot_iff, ← killingCompl_top_eq_bot] exact I.le_killingCompl_top_of_isLieAbelian -set_option backward.isDefEq.respectTransparency false in instance instSemisimple [IsKilling K L] [Module.Finite K L] : IsSemisimple K L := by apply InvariantForm.isSemisimple_of_nondegenerate (Φ := killingForm K L) · exact IsKilling.killingForm_nondegenerate _ _ @@ -142,7 +140,6 @@ end LieEquiv end LieAlgebra -set_option backward.isDefEq.respectTransparency false in open LieAlgebra in variable {K L} in lemma LieIdeal.isCompl_killingCompl [IsKilling K L] [Module.Finite K L] (I : LieIdeal K L) : diff --git a/Mathlib/Algebra/Lie/LieTheorem.lean b/Mathlib/Algebra/Lie/LieTheorem.lean index 79ed22d2228b67..36f81c5494f71f 100644 --- a/Mathlib/Algebra/Lie/LieTheorem.lean +++ b/Mathlib/Algebra/Lie/LieTheorem.lean @@ -206,7 +206,6 @@ variable [Nontrivial V] open LieAlgebra -set_option backward.isDefEq.respectTransparency false in -- This lemma is the central inductive argument in the proof of Lie's theorem below. -- The statement is identical to `LieModule.exists_forall_lie_eq_smul_of_isSolvable` -- except that it additionally assumes a finiteness hypothesis. diff --git a/Mathlib/Algebra/Lie/Nilpotent.lean b/Mathlib/Algebra/Lie/Nilpotent.lean index cab53cfc052ddf..45dc61da8b14e4 100644 --- a/Mathlib/Algebra/Lie/Nilpotent.lean +++ b/Mathlib/Algebra/Lie/Nilpotent.lean @@ -788,7 +788,6 @@ theorem coe_lowerCentralSeries_ideal_quot_eq {I : LieIdeal R L} (k : ℕ) : rw [← LieSubmodule.mem_toSubmodule, ← ih, LieSubmodule.mem_toSubmodule] at hz exact ⟨⟨y, LieSubmodule.mem_top _⟩, ⟨z, hz⟩, rfl⟩ -set_option backward.isDefEq.respectTransparency false in /-- Note that the below inequality can be strict. For example the ideal of strictly-upper-triangular 2x2 matrices inside the Lie algebra of upper-triangular 2x2 matrices with `k = 1`. -/ -- Porting note: added `LieSubmodule.toSubmodule` in the statement @@ -914,7 +913,6 @@ theorem coe_lcs_eq [LieModule R L M] : true_and, (I : LieSubalgebra R L).coe_bracket_of_module] simp -set_option backward.isDefEq.respectTransparency false in instance [IsNilpotent L I] : LieRing.IsNilpotent I := by let f : I →ₗ⁅R⁆ L := I.incl let g : I →ₗ⁅R⁆ I := LieHom.id @@ -958,21 +956,17 @@ variable [CommRing R] [LieRing L] [LieAlgebra R L] `L` under the adjoint action. -/ def maxNilpotentIdeal := maxNilpotentSubmodule R L L -set_option backward.isDefEq.respectTransparency false in instance maxNilpotentIdealIsNilpotent [IsNoetherian R L] : IsNilpotent L (maxNilpotentIdeal R L) := instMaxNilpotentSubmoduleIsNilpotent R L L -set_option backward.isDefEq.respectTransparency false in theorem LieIdeal.isNilpotent_iff_le_maxNilpotentIdeal [IsNoetherian R L] (I : LieIdeal R L) : IsNilpotent L I ↔ I ≤ maxNilpotentIdeal R L := isNilpotent_iff_le_maxNilpotentSubmodule R L L I -set_option backward.isDefEq.respectTransparency false in theorem center_le_maxNilpotentIdeal : center R L ≤ maxNilpotentIdeal R L := le_sSup (trivialIsNilpotent L (center R L)) -set_option backward.isDefEq.respectTransparency false in theorem maxNilpotentIdeal_le_radical : maxNilpotentIdeal R L ≤ radical R L := sSup_le_sSup fun I (_ : IsNilpotent L I) ↦ isSolvable_of_isNilpotent I diff --git a/Mathlib/Algebra/Lie/Semisimple/Basic.lean b/Mathlib/Algebra/Lie/Semisimple/Basic.lean index 991c6fb46004d3..ca03a9c20385d5 100644 --- a/Mathlib/Algebra/Lie/Semisimple/Basic.lean +++ b/Mathlib/Algebra/Lie/Semisimple/Basic.lean @@ -279,7 +279,6 @@ noncomputable instance (priority := 100) instBooleanAlgebra : BooleanAlgebra (LieIdeal R L) := (booleanGenerators R L).booleanAlgebra_of_sSup_eq_top sSup_atoms_eq_top -set_option backward.isDefEq.respectTransparency false in /-- A semisimple Lie algebra has trivial radical. -/ instance (priority := 100) instHasTrivialRadical : HasTrivialRadical R L := by rw [hasTrivialRadical_iff_no_abelian_ideals] diff --git a/Mathlib/Algebra/Lie/TensorProduct.lean b/Mathlib/Algebra/Lie/TensorProduct.lean index 341e1c5ac4bf18..0e93db76c1bb43 100644 --- a/Mathlib/Algebra/Lie/TensorProduct.lean +++ b/Mathlib/Algebra/Lie/TensorProduct.lean @@ -187,7 +187,6 @@ variable [LieRing L] [LieAlgebra R L] variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] variable (I : LieIdeal R L) (N : LieSubmodule R L M) -set_option backward.isDefEq.respectTransparency false in /-- A useful alternative characterisation of Lie ideal operations on Lie submodules. Given a Lie ideal `I ⊆ L` and a Lie submodule `N ⊆ M`, by tensoring the inclusion maps and then diff --git a/Mathlib/Algebra/Lie/TraceForm.lean b/Mathlib/Algebra/Lie/TraceForm.lean index 21dfe6219bdb0b..8230f5a6ccf8e1 100644 --- a/Mathlib/Algebra/Lie/TraceForm.lean +++ b/Mathlib/Algebra/Lie/TraceForm.lean @@ -387,7 +387,6 @@ lemma killingForm_eq : killingForm R I = (killingForm R L).restrict I := LieSubmodule.traceForm_eq_of_le_idealizer I I <| by simp -set_option backward.isDefEq.respectTransparency false in @[simp] lemma le_killingCompl_top_of_isLieAbelian [IsLieAbelian I] : I ≤ LieIdeal.killingCompl R L ⊤ := by intro x (hx : x ∈ I) diff --git a/Mathlib/Algebra/Module/LinearMap/Defs.lean b/Mathlib/Algebra/Module/LinearMap/Defs.lean index 5a80c98d719e03..6c5fd23457c978 100644 --- a/Mathlib/Algebra/Module/LinearMap/Defs.lean +++ b/Mathlib/Algebra/Module/LinearMap/Defs.lean @@ -840,8 +840,12 @@ theorem comp_add (f g : M →ₛₗ[σ₁₂] M₂) (h : M₂ →ₛₗ[σ₂₃ (h.comp (f + g) : M →ₛₗ[σ₁₃] M₃) = h.comp f + h.comp g := ext fun _ ↦ h.map_add _ _ +-- The `AddMonoid` instance exists to help speedup unification +instance addMonoid : AddMonoid (M →ₛₗ[σ₁₂] M₂) := fast_instance% + DFunLike.coe_injective.addMonoid _ rfl (fun _ _ ↦ rfl) fun _ _ ↦ rfl + /-- The type of linear maps is an additive monoid. -/ -instance addCommMonoid : AddCommMonoid (M →ₛₗ[σ₁₂] M₂) := +instance addCommMonoid : AddCommMonoid (M →ₛₗ[σ₁₂] M₂) := fast_instance% DFunLike.coe_injective.addCommMonoid _ rfl (fun _ _ ↦ rfl) fun _ _ ↦ rfl /-- The negation of a linear map is linear. -/ @@ -885,7 +889,7 @@ theorem comp_sub (f g : M →ₛₗ[σ₁₂] N₂) (h : N₂ →ₛₗ[σ₂₃ ext fun _ ↦ h.map_sub _ _ /-- The type of linear maps is an additive group. -/ -instance addCommGroup : AddCommGroup (M →ₛₗ[σ₁₂] N₂) := +instance addCommGroup : AddCommGroup (M →ₛₗ[σ₁₂] N₂) := fast_instance% DFunLike.coe_injective.addCommGroup _ rfl (fun _ _ ↦ rfl) (fun _ ↦ rfl) (fun _ _ ↦ rfl) (fun _ _ ↦ rfl) fun _ _ ↦ rfl diff --git a/Mathlib/Algebra/MvPolynomial/Eval.lean b/Mathlib/Algebra/MvPolynomial/Eval.lean index f972ab97852bc2..f26569ae329f9d 100644 --- a/Mathlib/Algebra/MvPolynomial/Eval.lean +++ b/Mathlib/Algebra/MvPolynomial/Eval.lean @@ -344,7 +344,6 @@ theorem map_id : ∀ p : MvPolynomial σ R, map (RingHom.id R) p = p := AddMonoi theorem map_map [CommSemiring S₂] (g : S₁ →+* S₂) (p : MvPolynomial σ R) : map g (map f p) = map (g.comp f) p := AddMonoidAlgebra.map_map .. -set_option backward.isDefEq.respectTransparency false in theorem eval₂_eq_eval_map (g : σ → S₁) (p : MvPolynomial σ R) : p.eval₂ f g = eval g (map f p) := by simp [eval₂, eval]; simp [map, MvPolynomial, Finsupp.sum_mapRange_index, mapRingHom] diff --git a/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean b/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean index 1dda887242ce50..5949040d22d7ec 100644 --- a/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean +++ b/Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean @@ -77,7 +77,6 @@ lemma degrees_mul_eq (hp : p ≠ 0) (hq : q ≠ 0) : end Degrees -set_option backward.isDefEq.respectTransparency false in theorem totalDegree_mul_of_isDomain {f g : MvPolynomial σ R} (hf : f ≠ 0) (hg : g ≠ 0) : totalDegree (f * g) = totalDegree f + totalDegree g := by diff --git a/Mathlib/Algebra/Ring/BooleanRing.lean b/Mathlib/Algebra/Ring/BooleanRing.lean index 98c5eed4cfbfe8..dcce2efdba5ba0 100644 --- a/Mathlib/Algebra/Ring/BooleanRing.lean +++ b/Mathlib/Algebra/Ring/BooleanRing.lean @@ -205,6 +205,7 @@ theorem le_sup_inf (a b c : α) : (a ⊔ b) ⊓ (a ⊔ c) ⊔ (a ⊔ b ⊓ c) = dsimp only [(· ⊔ ·), (· ⊓ ·)] rw [le_sup_inf_aux, add_self, mul_self, zero_add] +set_option linter.flexible false in -- TODO: fix non-terminal simp /-- The Boolean algebra structure on a Boolean ring. The data is defined so that: @@ -232,7 +233,7 @@ def toBooleanAlgebra : BooleanAlgebra α := change 1 + (a + (1 + a) + a * (1 + a)) + 1 * (a + (1 + a) + a * (1 + a)) = a + (1 + a) + a * (1 + a) - norm_num [mul_add, mul_self, add_self] + simp [mul_add, mul_self, add_self] rw [← add_assoc, add_self] } scoped[BooleanAlgebraOfBooleanRing] attribute [instance 100] BooleanRing.toBooleanAlgebra diff --git a/Mathlib/AlgebraicGeometry/AffineScheme.lean b/Mathlib/AlgebraicGeometry/AffineScheme.lean index 52504eb4d26076..1a164f6577c345 100644 --- a/Mathlib/AlgebraicGeometry/AffineScheme.lean +++ b/Mathlib/AlgebraicGeometry/AffineScheme.lean @@ -447,7 +447,6 @@ theorem range_fromSpec : rw [← TopCat.coe_comp, ← TopCat.epi_iff_surjective] infer_instance -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma fromSpec_toSpecΓ {X : Scheme} {U : X.Opens} (hU : IsAffineOpen U) : hU.fromSpec ≫ X.toSpecΓ = Spec.map (X.presheaf.map (homOfLE le_top).op) := by @@ -566,7 +565,6 @@ theorem fromSpec_preimage_self : hU.fromSpec ⁻¹ᵁ U = ⊤ := by simp_rw [← hU.opensRange_fromSpec, Scheme.Hom.preimage_opensRange] -set_option backward.isDefEq.respectTransparency false in theorem ΓSpecIso_hom_fromSpec_app : (Scheme.ΓSpecIso Γ(X, U)).hom ≫ hU.fromSpec.app U = (Spec Γ(X, U)).presheaf.map (eqToHom hU.fromSpec_preimage_self).op := by @@ -616,7 +614,6 @@ lemma Spec_basicOpen {R : CommRingCat} (f : R) : instance [IsAffine X] (r : Γ(X, ⊤)) : IsAffine (X.basicOpen r) := (isAffineOpen_top X).basicOpen _ -set_option backward.isDefEq.respectTransparency false in include hU in theorem ι_basicOpen_preimage (r : Γ(X, ⊤)) : IsAffineOpen ((X.basicOpen r).ι ⁻¹ᵁ U) := by @@ -641,7 +638,6 @@ noncomputable instance {R : CommRingCat} {U} : Algebra R Γ(Spec R, U) := inferInstanceAs (Algebra R ((Spec.structureSheaf R).presheaf.obj _)) -set_option backward.isDefEq.respectTransparency false in @[simp] 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 @@ -684,7 +680,6 @@ instance _root_.AlgebraicGeometry.isLocalization_away_of_isAffine IsLocalization.Away r Γ(X, X.basicOpen r) := isLocalization_basicOpen (isAffineOpen_top X) r -set_option backward.isDefEq.respectTransparency false in lemma appLE_eq_away_map {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (hU : IsAffineOpen U) {V : X.Opens} (hV : IsAffineOpen V) (e) (r : Γ(Y, U)) : letI := hU.isLocalization_basicOpen r @@ -942,7 +937,6 @@ theorem iSup_basicOpen_eq_self_iff {s : Set Γ(X, U)} : @[deprecated (since := "2025-10-07")] alias basicOpen_union_eq_self_iff := iSup_basicOpen_eq_self_iff -set_option backward.isDefEq.respectTransparency false in include hU in theorem self_le_iSup_basicOpen_iff {s : Set Γ(X, U)} : (U ≤ ⨆ f : s, X.basicOpen f.1) ↔ Ideal.span s = ⊤ := by @@ -1008,7 +1002,6 @@ 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 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. diff --git a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean index 0839481209f75c..dba7d4e2d58dca 100644 --- a/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean +++ b/Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean @@ -252,7 +252,6 @@ lemma toΓSpec_preimage_zeroLocus_eq {X : LocallyRingedSpace.{u}} rw [← PrimeSpectrum.zeroLocus_iUnion₂] simp -set_option backward.isDefEq.respectTransparency 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) diff --git a/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean b/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean index b2e47dd4ae323f..d3eb8af73b44f4 100644 --- a/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Geometrically/Basic.lean @@ -69,7 +69,6 @@ instance : (geometrically P).IsStableUnderBaseChange := by rw [geometrically_eq_universally] infer_instance -set_option backward.isDefEq.respectTransparency false in instance [P.IsClosedUnderIsomorphisms] : IsZariskiLocalAtTarget (geometrically P) := by rw [geometrically_eq_universally] refine universally_isZariskiLocalAtTarget _ fun {X} Y f ι U hU H _ _ ↦ ?_ diff --git a/Mathlib/AlgebraicGeometry/Gluing.lean b/Mathlib/AlgebraicGeometry/Gluing.lean index 6c5e3c42655e8b..0c9a711608f717 100644 --- a/Mathlib/AlgebraicGeometry/Gluing.lean +++ b/Mathlib/AlgebraicGeometry/Gluing.lean @@ -524,7 +524,6 @@ The intersection `V` in the glue data associated to a locally directed diagram. noncomputable def V (i j : J) : (F.obj i).Opens := ⨆ (k : Σ k, (k ⟶ i) × (k ⟶ j)), (F.map k.2.1).opensRange -set_option backward.isDefEq.respectTransparency false in lemma V_self (i) : V F i i = ⊤ := top_le_iff.mp (le_iSup_of_le ⟨i, 𝟙 _, 𝟙 _⟩ (by simp [Scheme.Hom.opensRange_of_isIso])) @@ -695,7 +694,6 @@ def glueData : Scheme.GlueData where ← Iso.inv_comp_eq, Scheme.Hom.isoOpensRange_inv_comp] exact (Scheme.homOfLE_ι _ _).symm -set_option backward.isDefEq.respectTransparency 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 diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean index 4aeb3a45b24ad7..1fc0aa23ea3f12 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean @@ -459,7 +459,6 @@ end Semiring section IsAffine -set_option backward.isDefEq.respectTransparency false in /-- The ideal sheaf induced by an ideal of the global sections. -/ @[simps! ideal coe_support] def ofIdealTop (I : Ideal Γ(X, ⊤)) : IdealSheafData X := @@ -471,7 +470,6 @@ def ofIdealTop (I : Ideal Γ(X, ⊤)) : IdealSheafData X := simp only [Ideal.map, zeroLocus_span, zeroLocus_map, Set.mem_union, Set.mem_compl_iff, SetLike.mem_coe, hxU, not_true_eq_false, iff_self_or, IsEmpty.forall_iff]) -set_option backward.isDefEq.respectTransparency false in lemma le_of_isAffine [IsAffine X] {I J : IdealSheafData X} (H : I.ideal ⟨⊤, isAffineOpen_top X⟩ ≤ J.ideal ⟨⊤, isAffineOpen_top X⟩) : I ≤ J := by intro U @@ -640,7 +638,6 @@ lemma vanishingIdeal_support {I : IdealSheafData X} : rw [Set.image_preimage_eq_inter_range, IsAffineOpen.range_fromSpec, IsAffineOpen.fromSpec_image_zeroLocus, coe_support_inter] -set_option backward.isDefEq.respectTransparency false in @[simp] lemma vanishingIdeal_bot : vanishingIdeal (X := X) ⊥ = ⊤ := gc.u_top @[simp] lemma vanishingIdeal_top : vanishingIdeal (X := X) ⊤ = X.nilradical := by @@ -673,7 +670,6 @@ section IsReduced lemma nilradical_eq_bot [IsReduced X] : X.nilradical = ⊥ := by ext; simp [nilradical, Ideal.radical_eq_iff.mpr (Ideal.isRadical_bot)] -set_option backward.isDefEq.respectTransparency false in lemma IdealSheafData.support_eq_top_iff [IsReduced X] {I : X.IdealSheafData} : I.support = ⊤ ↔ I = ⊥ := by rw [← top_le_iff, le_support_iff_le_vanishingIdeal, diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean index 7c96cfc7ed1485..04b6c3ca926b37 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean @@ -219,7 +219,6 @@ def glueDataT (U V : X.affineOpens) : rw [Scheme.Hom.liftQuotient_comp_assoc, Category.assoc, Category.assoc, Iso.hom_inv_id, Category.comp_id, Category.assoc, X.homOfLE_homOfLE] -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] private lemma glueDataT_snd (U V : X.affineOpens) : I.glueDataT U V ≫ pullback.snd _ _ = pullback.snd _ _ ≫ X.homOfLE (by simp) := @@ -333,7 +332,6 @@ private lemma ι_gluedTo (U : X.affineOpens) : I.glueData.ι U ≫ I.gluedTo = I.glueDataObjι U ≫ U.1.ι := Multicoequalizer.π_desc _ _ _ _ _ -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] private lemma glueDataObjMap_ι (U V : X.affineOpens) (h : U ≤ V) : I.glueDataObjMap h ≫ I.glueData.ι V = I.glueData.ι U := by diff --git a/Mathlib/AlgebraicGeometry/Limits.lean b/Mathlib/AlgebraicGeometry/Limits.lean index 0a14ec1212ae93..2a63763f30703c 100644 --- a/Mathlib/AlgebraicGeometry/Limits.lean +++ b/Mathlib/AlgebraicGeometry/Limits.lean @@ -350,7 +350,6 @@ lemma isCompl_range_inl_inr : ((TopCat.binaryCofan_isColimit_iff _).mp ⟨mapIsColimitOfPreservesOfIsColimit Scheme.forgetToTop.{u} _ _ (coprodIsCoprod X Y)⟩).2.2 -set_option backward.isDefEq.respectTransparency false in lemma isCompl_opensRange_inl_inr : IsCompl (coprod.inl : X ⟶ X ⨿ Y).opensRange (coprod.inr : Y ⟶ X ⨿ Y).opensRange := by convert isCompl_range_inl_inr X Y @@ -410,7 +409,6 @@ def coprodOpenCover.{w} : (X ⨿ Y).OpenCover where · simp only [Sum.elim_inr, coprodMk_inr, exists_apply_eq_apply] -- TODO: should infer_instance be considered normalising? -set_option backward.isDefEq.respectTransparency false in set_option linter.flexible false in /-- If `X` and `Y` are open disjoint and covering open subschemes of `S`, `S` is the disjoint union of `X` and `Y`. -/ @@ -473,7 +471,6 @@ instance : FinitaryExtensive Scheme where variable {X Y} -set_option backward.isDefEq.respectTransparency false in /-- The sections on coproducts of schemes are the (categorical) product of the sections on the components -/ noncomputable def Scheme.coprodPresheafObjIso (U : (X ⨿ Y).Opens) : @@ -669,7 +666,6 @@ private lemma IsAffineOpen.iSup_of_disjoint_aux [Finite ι] {U : ι → X.Opens} · have (i : _) : IsAffine _ := hU i infer_instance -set_option backward.isDefEq.respectTransparency false in open scoped Function in lemma IsAffineOpen.iSup_of_disjoint [Finite σ] {U : σ → X.Opens} (hU : ∀ i, IsAffineOpen (U i)) (hU' : Pairwise (Disjoint on U)) : @@ -679,7 +675,6 @@ lemma IsAffineOpen.iSup_of_disjoint [Finite σ] {U : σ → X.Opens} rw [← e.symm.iSup_congr fun _ ↦ rfl] exact .iSup_of_disjoint_aux (by simp [*]) fun i j h ↦ hU' (e.symm.injective.ne h) -set_option backward.isDefEq.respectTransparency false in open scoped Function in lemma IsAffineOpen.biSup_of_disjoint {s : Set σ} (hs : s.Finite) {U : σ → X.Opens} (hU : ∀ i ∈ s, IsAffineOpen (U i)) (hU' : s.Pairwise (Disjoint on U)) : @@ -688,7 +683,6 @@ lemma IsAffineOpen.biSup_of_disjoint {s : Set σ} (hs : s.Finite) have := hs.to_subtype exact .iSup_of_disjoint (by simpa) fun i j e ↦ hU' i.2 j.2 (by aesop) -set_option backward.isDefEq.respectTransparency false in lemma IsAffineOpen.sup_of_disjoint {U V : X.Opens} (hU : IsAffineOpen U) (hV : IsAffineOpen V) (H : Disjoint U V) : IsAffineOpen (U ⊔ V) := by @@ -696,7 +690,6 @@ lemma IsAffineOpen.sup_of_disjoint {U V : X.Opens} (hU : IsAffineOpen U) (hV : I (by simp_all [_root_.Pairwise, Unique.forall_iff, ← Opens.coe_disjoint, disjoint_comm]) aesop -set_option backward.isDefEq.respectTransparency false in instance (priority := low) [Finite X] [DiscreteTopology X] : IsAffine X := have : IsAffineOpen (⨆ (x : X), (⟨{x}, isOpen_discrete _⟩ : X.Opens)) := .iSup_of_disjoint (fun i ↦ .of_subsingleton Set.subsingleton_singleton) diff --git a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean index 58acd4d6baa4bf..28f7e535af5a2b 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean @@ -38,7 +38,6 @@ namespace AlgebraicGeometry open _root_.PrimeSpectrum -set_option backward.isDefEq.respectTransparency 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) := @@ -392,7 +391,6 @@ def presentationTilde (s : Set M) (hs : Submodule.span R s = ⊤) refine IsCokernel.ofIso _ (CokernelCofork.mapIsColimit _ h₁ (tilde.functor R)) _ (tildeFinsupp t) (tildeFinsupp s) (.refl _) (by simp) (by simp) -set_option backward.isDefEq.respectTransparency false in instance : (tilde M).IsQuasicoherent := (presentationTilde.{u} _ .univ (by simp) _ (Submodule.span_eq _)).isQuasicoherent diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean index aac9623e576342..c7fffc0d8e7c41 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean @@ -86,7 +86,6 @@ instance {X : Scheme} (r : Γ(X, ⊤)) : lemma isRetrocompact_basicOpen (s : Γ(X, ⊤)) : IsRetrocompact (X := X) (X.basicOpen s) := IsRetrocompact_iff_isSpectralMap_subtypeVal.mpr (X.basicOpen s).ι.isSpectralMap -set_option backward.isDefEq.respectTransparency false in /-- Superseded by `isAffine_of_isAffineOpen_basicOpen`. -/ private lemma isAffine_of_isAffineOpen_basicOpen_aux (s : Set Γ(X, ⊤)) (hs : Ideal.span s = ⊤) (hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)) : @@ -185,7 +184,6 @@ instance (priority := 100) isAffineHom_of_isAffine [IsAffine X] [IsAffine Y] : I 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 false in lemma isAffineHom_of_forall_exists_isAffineOpen (H : ∀ x : Y, ∃ U : Y.Opens, x ∈ U ∧ IsAffineOpen U ∧ IsAffineOpen (f ⁻¹ᵁ U)) : IsAffineHom f := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean index 601194e106b2e5..9adb601ec5e3f8 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean @@ -183,7 +183,6 @@ lemma of_range_subset_iSup [P.RespectsRight @IsOpenImmersion] {ι : Type*} (U : rw [Scheme.Hom.image_iSup, Scheme.Hom.image_top_eq_opensRange, Scheme.Opens.opensRange_ι] simp [Scheme.Hom.image_preimage_eq_opensRange_inf, le_iSup U] -set_option backward.isDefEq.respectTransparency false in lemma of_forall_exists_morphismRestrict (H : ∀ x, ∃ U : Y.Opens, x ∈ U ∧ P (f ∣_ U)) : P f := by choose U hxU hU using H refine IsZariskiLocalAtTarget.of_iSup_eq_top U (top_le_iff.mp fun x _ ↦ ?_) hU @@ -313,7 +312,6 @@ lemma resLE [IsZariskiLocalAtTarget P] {U : Y.Opens} {V : X.Opens} (hf : P f) : P (f.resLE U V e) := IsZariskiLocalAtSource.comp (IsZariskiLocalAtTarget.restrict hf U) _ -set_option backward.isDefEq.respectTransparency false in /-- If `P` is local at the source, local at the target and is stable under post-composition with open immersions, then `P` can be checked locally around points. -/ lemma iff_exists_resLE [IsZariskiLocalAtTarget P] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean index 73d4f8eb2bba41..38b9a1245d45d3 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean @@ -305,7 +305,6 @@ lemma topologically_isZariskiLocalAtTarget [(topologically P).RespectsIso] @[deprecated (since := "2025-10-07")] alias topologically_isLocalAtTarget := topologically_isZariskiLocalAtTarget -set_option backward.isDefEq.respectTransparency false in /-- A variant of `topologically_isZariskiLocalAtTarget` that takes one iff statement instead of two implications. -/ lemma topologically_isZariskiLocalAtTarget' [(topologically P).RespectsIso] @@ -338,7 +337,6 @@ lemma topologically_isZariskiLocalAtSource [(topologically P).RespectsIso] @[deprecated (since := "2025-10-07")] alias topologically_isLocalAtSource := topologically_isZariskiLocalAtSource -set_option backward.isDefEq.respectTransparency false in /-- A variant of `topologically_isZariskiLocalAtSource` that takes one iff statement instead of two implications. -/ lemma topologically_isZariskiLocalAtSource' [(topologically P).RespectsIso] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean index 41b8b4fbdf6180..31b91efa22434f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Flat.lean @@ -210,7 +210,6 @@ variable {X Y S T : Scheme.{u}} {f : T ⟶ S} {g : Y ⟶ X} {iX : X ⟶ S} {iY : {UX : X.Opens} (hUST : UT ≤ f ⁻¹ᵁ US) (hUSX : UX ≤ iX ⁻¹ᵁ US) {UY : Y.Opens} (hUY : UY = g ⁻¹ᵁ UX ⊓ iY ⁻¹ᵁ UT) -set_option backward.isDefEq.respectTransparency false in /-- The canonical map `Γ(X, Uₓ) ⊗[Γ(S, Uₛ)] Γ(T, Uₜ) ⟶ Γ(X ×ₛ T, pr₁ ⁻¹ Uₓ ∩ pr₂ ⁻¹ Uₜ)`. This is an isomorphism under various circumstances. -/ abbrev pushoutSection : pushout (iX.appLE US UX hUSX) (f.appLE US UT hUST) ⟶ Γ(Y, UY) := diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean index d8bb67df98d4d2..23958cee9ad107 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean @@ -175,7 +175,6 @@ instance [FormallyUnramified f] [LocallyOfFiniteType f] (x : X) : exact stalkMap f x infer_instance -set_option backward.isDefEq.respectTransparency false in /-- Given any commuting diagram ``` diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean index ece67bbd17be42..c586ee106540ff 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Immersion.lean @@ -187,7 +187,6 @@ instance (priority := 900) (f : X ⟶ Y) [IsImmersion f] : LocallyOfFiniteType f rw [← f.liftCoborder_ι] infer_instance -set_option backward.isDefEq.respectTransparency false in open Limits Scheme.Pullback in /-- The diagonal morphism is always an immersion. -/ @[stacks 01KJ] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean index 5eb5c0e0c9b90c..37564230fcb350 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean @@ -151,7 +151,6 @@ theorem isField_of_universallyClosed (f : X ⟶ (Spec <| .of K)) algebraize [F.hom] exact isField_of_isIntegral_of_isField' (Field.toIsField K) -set_option backward.isDefEq.respectTransparency false in /-- If `X` is an integral scheme that is universally closed and of finite type over `Spec K`, then `Γ(X, ⊤)` is a finite field extension over `K`. -/ theorem finite_appTop_of_universallyClosed (f : X ⟶ (Spec <| .of K)) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean index ce9e9730918f75..a84bd402fe851b 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean @@ -117,7 +117,6 @@ theorem quasiCompact_iff_forall_isAffineOpen : @[deprecated (since := "2025-10-14")] alias quasiCompact_iff_forall_affine := quasiCompact_iff_forall_isAffineOpen -set_option backward.isDefEq.respectTransparency false in theorem isCompact_basicOpen (X : Scheme) {U : X.Opens} (hU : IsCompact (U : Set X)) (f : Γ(X, U)) : IsCompact (X.basicOpen f : Set X) := by classical @@ -264,7 +263,6 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch obtain ⟨n, e⟩ := (hU.isLocalization_basicOpen f).exists_of_eq _ H exact ⟨n, by simpa [mul_comm x] using e⟩ -set_option backward.isDefEq.respectTransparency false in /-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then `f ^ n * x = 0` for some `n`. -/ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u}) @@ -308,7 +306,6 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme rwa [mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn apply Finset.le_sup (Finset.mem_univ i) -set_option backward.isDefEq.respectTransparency false in /-- A section over a compact open of a scheme is nilpotent if and only if its associated basic open is empty. -/ lemma Scheme.isNilpotent_iff_basicOpen_eq_bot_of_isCompact {X : Scheme.{u}} @@ -332,7 +329,6 @@ lemma Scheme.isNilpotent_iff_basicOpen_eq_bot {X : Scheme.{u}} IsNilpotent f ↔ X.basicOpen f = ⊥ := isNilpotent_iff_basicOpen_eq_bot_of_isCompact (U := ⊤) (CompactSpace.isCompact_univ) f -set_option backward.isDefEq.respectTransparency false in /-- The zero locus of a set of sections over a compact open of a scheme is `X` if and only if `s` is contained in the nilradical of `Γ(X, U)`. -/ lemma Scheme.zeroLocus_eq_univ_iff_subset_nilradical_of_isCompact {X : Scheme.{u}} {U : X.Opens} diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean index d976844290e32a..20b213ee98519e 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean @@ -56,7 +56,6 @@ attribute [instance] QuasiSeparated.quasiCompact_diagonal @[deprecated (since := "2025-10-15")] alias QuasiSeparated.diagonalQuasiCompact := QuasiSeparated.quasiCompact_diagonal -set_option backward.isDefEq.respectTransparency false in theorem quasiSeparatedSpace_iff_forall_affineOpens {X : Scheme} : QuasiSeparatedSpace X ↔ ∀ U V : X.affineOpens, IsCompact (U ∩ V : Set X) := by rw [quasiSeparatedSpace_iff] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean index fb5d811a36cf2f..cd4407b7daf65a 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean @@ -98,7 +98,6 @@ section affineLocally variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop) -set_option backward.isDefEq.respectTransparency false in /-- For `P` a property of ring homomorphisms, `sourceAffineLocally P` holds for `f : X ⟶ Y` whenever `P` holds for the restriction of `f` on every affine open subset of `X`. -/ def sourceAffineLocally : AffineTargetMorphismProperty := fun X _ f _ => @@ -110,7 +109,6 @@ Also see `affineLocally_iff_affineOpens_le`. -/ abbrev affineLocally : MorphismProperty Scheme.{u} := targetAffineLocally (sourceAffineLocally P) -set_option backward.isDefEq.respectTransparency false in theorem sourceAffineLocally_respectsIso (h₁ : RingHom.RespectsIso P) : (sourceAffineLocally P).toProperty.RespectsIso := by apply AffineTargetMorphismProperty.respectsIso_mk @@ -190,7 +188,6 @@ open RingHom variable {X Y : Scheme.{u}} {f : X ⟶ Y} -set_option backward.isDefEq.respectTransparency 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₁`). -/ @@ -369,7 +366,6 @@ theorem of_iSup_eq_top [IsAffine Y] {ι : Type*} refine of_source_openCover (X.openCoverOfIsOpenCover _ hU) fun i ↦ ?_ simpa [Scheme.Hom.app_eq_appLE] using (f.appLE_congr _ rfl (by simp) (fun f => Q f.hom)).mp (H i) -set_option backward.isDefEq.respectTransparency false in theorem iff_of_iSup_eq_top [IsAffine Y] {ι : Type*} (U : ι → X.affineOpens) (hU : ⨆ i, (U i : Opens X) = ⊤) : P f ↔ ∀ i, Q (f.appLE ⊤ (U i).1 le_top).hom := diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean index 7b0d9e9958838f..0ddb9562d5e0d0 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean @@ -302,7 +302,6 @@ def Scheme.Hom.smoothLocus (f : X ⟶ Y) [LocallyOfFinitePresentation f] : X.Ope lemma Scheme.Hom.mem_smoothLocus {f : X ⟶ Y} [LocallyOfFinitePresentation f] {x : X} : x ∈ f.smoothLocus ↔ (f.stalkMap x).hom.FormallySmooth := .rfl -set_option backward.isDefEq.respectTransparency false in lemma Scheme.Hom.smoothLocus_eq_top (f : X ⟶ Y) [Smooth f] : f.smoothLocus = ⊤ := by rw [← top_le_iff] diff --git a/Mathlib/AlgebraicGeometry/OpenImmersion.lean b/Mathlib/AlgebraicGeometry/OpenImmersion.lean index bd186319dda55b..a68af7a9b675b8 100644 --- a/Mathlib/AlgebraicGeometry/OpenImmersion.lean +++ b/Mathlib/AlgebraicGeometry/OpenImmersion.lean @@ -123,7 +123,6 @@ lemma opensRange_comp_of_isIso {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso f] [IsOpenImmersion g] : (f ≫ g).opensRange = g.opensRange := by rw [opensRange_comp, opensRange_of_isIso, image_top_eq_opensRange] -set_option backward.isDefEq.respectTransparency false in lemma image_le_opensRange (U : X.Opens) : f ''ᵁ U ≤ f.opensRange := by simpa using f.image_mono le_top diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean index 252009564d4d59..fa425bf50243af 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean @@ -82,7 +82,6 @@ theorem isBasis_basicOpen : convert ProjectiveSpectrum.isTopologicalBasis_basic_opens 𝒜 exact (Set.range_comp _ _).symm -set_option backward.isDefEq.respectTransparency false in /-- If `{ xᵢ }` spans the irrelevant ideal of `A`, then `D₊(xᵢ)` covers `Proj A`. -/ lemma iSup_basicOpen_eq_top {ι : Type*} (f : ι → A) (hf : (HomogeneousIdeal.irrelevant 𝒜).toIdeal ≤ Ideal.span (Set.range f)) : @@ -206,7 +205,6 @@ lemma isAffineOpen_basicOpen : IsAffineOpen (basicOpen 𝒜 f) := by rw [← opensRange_awayι 𝒜 f f_deg hm] exact isAffineOpen_opensRange (awayι _ _ _ _) -set_option backward.isDefEq.respectTransparency false in @[reassoc] lemma awayι_toSpecZero : awayι 𝒜 f f_deg hm ≫ toSpecZero 𝒜 = Spec.map (CommRingCat.ofHom (fromZeroRingHom 𝒜 _)) := by @@ -383,7 +381,6 @@ 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 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'} diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean index fb170237b195e1..5729a1fd2ccd52 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean @@ -697,7 +697,6 @@ lemma toSpec_preimage_basicOpen {f} convert (ProjIsoSpecTopComponent.ToSpec.preimage_basicOpen f t) exact funext fun _ => toSpec_base_apply_eq _ _ -set_option backward.isDefEq.respectTransparency false in @[reassoc] lemma toOpen_toSpec_val_c_app (f) (U) : (Scheme.ΓSpecIso _).inv ≫ (Spec A⁰_ f).presheaf.map (homOfLE le_top).op ≫ diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean index af1970b610af97..b756f0661b51ec 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean @@ -353,7 +353,6 @@ theorem basicOpen_eq_zeroLocus_compl (r : A) : theorem basicOpen_one : basicOpen 𝒜 (1 : A) = ⊤ := TopologicalSpace.Opens.ext <| by simp -set_option backward.isDefEq.respectTransparency false in @[simp] theorem basicOpen_zero : basicOpen 𝒜 (0 : A) = ⊥ := TopologicalSpace.Opens.ext <| by simp diff --git a/Mathlib/AlgebraicGeometry/Properties.lean b/Mathlib/AlgebraicGeometry/Properties.lean index 35c57e8db9b0f7..8696f73585e826 100644 --- a/Mathlib/AlgebraicGeometry/Properties.lean +++ b/Mathlib/AlgebraicGeometry/Properties.lean @@ -246,7 +246,6 @@ instance Scheme.component_nontrivial (X : Scheme.{u}) (U : X.Opens) [Nonempty U] Nontrivial Γ(X, U) := LocallyRingedSpace.component_nontrivial (hU := ‹_›) -set_option backward.isDefEq.respectTransparency false in instance irreducibleSpace_of_isIntegral [IsIntegral X] : IrreducibleSpace X := by by_contra H replace H : ¬IsPreirreducible .univ := fun h => diff --git a/Mathlib/AlgebraicGeometry/QuasiAffine.lean b/Mathlib/AlgebraicGeometry/QuasiAffine.lean index 285a35af48be79..b90fc50db99ff3 100644 --- a/Mathlib/AlgebraicGeometry/QuasiAffine.lean +++ b/Mathlib/AlgebraicGeometry/QuasiAffine.lean @@ -69,7 +69,6 @@ lemma IsQuasiAffine.isBasis_basicOpen (X : Scheme.{u}) [IsQuasiAffine X] : exact SetLike.coe_injective (Set.image_preimage_eq_of_subset (hrU.trans (Set.image_subset_range _ _))) -set_option backward.isDefEq.respectTransparency false in /-- A quasi-compact scheme is quasi-affine if it can be covered by affine basic opens of global sections. -/ lemma IsQuasiAffine.of_forall_exists_mem_basicOpen (X : Scheme.{u}) [CompactSpace X] @@ -99,7 +98,6 @@ lemma IsQuasiAffine.of_isAffineHom [IsAffineHom f] [Y.IsQuasiAffine] : X.IsQuasi rw [← preimage_basicOpen_top] exact ⟨hr.preimage _, hxr⟩ -set_option backward.isDefEq.respectTransparency false in /-- The affine basic opens of a quasi-affine scheme form an open cover. -/ @[simps! f] def openCoverBasicOpenTop (X : Scheme.{u}) [X.IsQuasiAffine] : X.OpenCover := diff --git a/Mathlib/AlgebraicGeometry/RationalMap.lean b/Mathlib/AlgebraicGeometry/RationalMap.lean index 4ecab327a4480a..544ec61227ea2c 100644 --- a/Mathlib/AlgebraicGeometry/RationalMap.lean +++ b/Mathlib/AlgebraicGeometry/RationalMap.lean @@ -446,7 +446,6 @@ 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 false in /-- Given `S`-schemes `X` and `Y` such that `Y` is locally of finite type and `X` is integral, `S`-morphisms `Spec K(X) ⟶ Y` correspond bijectively to `S`-rational maps from `X` to `Y`. diff --git a/Mathlib/AlgebraicGeometry/Restrict.lean b/Mathlib/AlgebraicGeometry/Restrict.lean index d4fe105073dabb..fa541cb92a1c80 100644 --- a/Mathlib/AlgebraicGeometry/Restrict.lean +++ b/Mathlib/AlgebraicGeometry/Restrict.lean @@ -82,7 +82,6 @@ lemma ι_app (V) : U.ι.app V = X.presheaf.map (homOfLE (x := U.ι ''ᵁ U.ι ⁻¹ᵁ V) (Set.image_preimage_subset _ _)).op := rfl -set_option backward.isDefEq.respectTransparency false in @[simp] lemma ι_appTop : U.ι.appTop = X.presheaf.map (homOfLE (x := U.ι ''ᵁ ⊤) le_top).op := @@ -112,7 +111,6 @@ lemma range_ι : Set.range U.ι = U := lemma ι_image_top : U.ι ''ᵁ ⊤ = U := U.isOpenEmbedding_obj_top -set_option backward.isDefEq.respectTransparency false in lemma ι_image_le (W : U.toScheme.Opens) : U.ι ''ᵁ W ≤ U := by simp_rw [← U.ι_image_top] exact U.ι.image_mono le_top @@ -309,7 +307,6 @@ instance (X : Scheme.{u}) {U V : X.Opens} (e : U ≤ V) : IsOpenImmersion (X.hom delta Scheme.homOfLE infer_instance -set_option backward.isDefEq.respectTransparency false in @[simp] lemma Scheme.opensRange_homOfLE {U V : X.Opens} (e : U ≤ V) : (X.homOfLE e).opensRange = V.ι ⁻¹ᵁ U := @@ -750,7 +747,6 @@ lemma resLE_preimage (f : X ⟶ Y) {U : Y.Opens} {V : X.Opens} (e : V ≤ f ⁻ f.resLE U V e ⁻¹ᵁ O = V.ι ⁻¹ᵁ (f ⁻¹ᵁ U.ι ''ᵁ O) := by rw [← comp_preimage, ← resLE_comp_ι f e, comp_preimage, preimage_image_eq] -set_option backward.isDefEq.respectTransparency false in lemma le_resLE_preimage_iff {U : Y.Opens} {V : X.Opens} (e : V ≤ f ⁻¹ᵁ U) (O : U.toScheme.Opens) (W : V.toScheme.Opens) : W ≤ (f.resLE U V e) ⁻¹ᵁ O ↔ V.ι ''ᵁ W ≤ f ⁻¹ᵁ U.ι ''ᵁ O := by @@ -801,7 +797,6 @@ noncomputable def arrowResLEAppIso (f : X ⟶ Y) (U : Y.Opens) (V : X.Opens) (e 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 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 cb9a5366b2cee8..be048eecd52731 100644 --- a/Mathlib/AlgebraicGeometry/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/Scheme.lean @@ -653,7 +653,6 @@ lemma ΓSpecIso_inv_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) : -- This is not marked simp to respect the abstraction lemma ΓSpecIso_inv : (ΓSpecIso R).inv = CommRingCat.ofHom (algebraMap _ _) := rfl -set_option backward.isDefEq.respectTransparency 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 diff --git a/Mathlib/AlgebraicGeometry/Spec.lean b/Mathlib/AlgebraicGeometry/Spec.lean index 16798ced3d3dfc..22e0e1536d40a3 100644 --- a/Mathlib/AlgebraicGeometry/Spec.lean +++ b/Mathlib/AlgebraicGeometry/Spec.lean @@ -357,7 +357,6 @@ def toPushforwardStalkAlgHom : { (StructureSheaf.toPushforwardStalk (CommRingCat.ofHom (algebraMap R S)) p).hom with commutes' := fun _ => rfl } -set_option backward.isDefEq.respectTransparency 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.germ_exist _ _ y diff --git a/Mathlib/AlgebraicGeometry/Stalk.lean b/Mathlib/AlgebraicGeometry/Stalk.lean index 9af5d6fc6254d8..b6be60615bf41a 100644 --- a/Mathlib/AlgebraicGeometry/Stalk.lean +++ b/Mathlib/AlgebraicGeometry/Stalk.lean @@ -119,7 +119,6 @@ lemma fromSpecStalk_app {x : X} (hxU : x ∈ U) : hV.fromSpec_app_of_le _ hVU, ← X.presheaf.germ_res (homOfLE hVU) x hxV] simp [Category.assoc, ← ΓSpecIso_inv_naturality_assoc] -set_option backward.isDefEq.respectTransparency false in lemma fromSpecStalk_appTop {x : X} : (X.fromSpecStalk x).appTop = X.presheaf.germ ⊤ x trivial ≫ diff --git a/Mathlib/AlgebraicGeometry/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/StructureSheaf.lean index 065ae6ec40b900..c1655ed34a5f77 100644 --- a/Mathlib/AlgebraicGeometry/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/StructureSheaf.lean @@ -550,7 +550,6 @@ the stalk of `structureSheaf R` at `x`. -/ CommRingCat.of R ⟶ (structurePresheafInCommRingCat R).stalk x := CommRingCat.ofHom (algebraMap _ _) ≫ (structurePresheafInCommRingCat R).germ ⊤ x trivial -set_option backward.isDefEq.respectTransparency false in @[elementwise, reassoc] public lemma algebraMap_germ (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.Top R) (hxU : x ∈ U) : @@ -642,7 +641,6 @@ theorem toOpenₗ_germ (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.Top rw [toStalkₗ', ← Presheaf.germ_res _ (homOfLE le_top) _ hx, ← Category.assoc] rfl -set_option backward.isDefEq.respectTransparency false in theorem isUnit_toStalk (x : PrimeSpectrum.Top R) (f : R) (hf : x ∈ basicOpen f) : IsUnit (toStalk R x f) := by convert (isUnit_basicOpen f).map ((structurePresheafInCommRingCat R).germ _ x hf).hom @@ -812,7 +810,6 @@ instance (x : PrimeSpectrum.Top R) : IsLocalizedModule x.asIdeal.primeCompl (toS Limits.colimit.isoColimitCocone_ι_hom (C := Ab) .. exact congr($this _) -set_option backward.isDefEq.respectTransparency false in variable (R) in /-- The stalk of `Spec R` at `x` is isomorphic to the stalk of `R^~` at `x`. -/ @[expose] public diff --git a/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean b/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean index 456bdb3b19e84f..43c1de99f1bc83 100644 --- a/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean +++ b/Mathlib/AlgebraicGeometry/ZariskisMainTheorem.lean @@ -187,7 +187,6 @@ lemma Scheme.Hom.exists_mem_and_isIso_morphismRestrict_toNormalization (Q := @Surjective ⊓ @Flat ⊓ @LocallyOfFinitePresentation) this ⟨⟨‹_›, inferInstance⟩, inferInstance⟩ ‹_› -set_option backward.isDefEq.respectTransparency false in /-- **Zariski's main theorem** @@ -326,7 +325,6 @@ instance [LocallyOfFiniteType f] [IsSeparated f] [QuasiCompact f] : (SetLike.coe_injective e.symm)).hom ≫ f.toNormalization ∣_ U ≫ U.ι)) using 1 simp -set_option backward.isDefEq.respectTransparency false in lemma Scheme.Hom.quasiFiniteLocus_eq_top [LocallyQuasiFinite f] [LocallyOfFiniteType f] : f.quasiFiniteLocus = ⊤ := top_le_iff.mp fun x _ ↦ f.quasiFiniteAt x diff --git a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean index c15c5ba2fd0336..b398c3ec3e810c 100644 --- a/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean +++ b/Mathlib/AlgebraicTopology/ExtraDegeneracy.lean @@ -245,7 +245,6 @@ variable {C : Type*} [Category* C] (f : Arrow C) [∀ n : ℕ, HasWidePullback f.right (fun _ : Fin (n + 1) => f.left) fun _ => f.hom] (S : SplitEpi f.hom) -set_option backward.isDefEq.respectTransparency false in /-- The extra degeneracy map on the Čech nerve of a split epi. It is given on the `0`-projection by the given section of the split epi, and by shifting the indices on the other projections. -/ diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean index 8b98670f95fa1d..76e79afdb35092 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Augmented/Monoidal.lean @@ -219,7 +219,6 @@ theorem tensorObj_hom_ext {x y z : AugmentedSimplexCategory} (f g : x ⊗ y ⟶ | .star, .star, .of z, f, g => rfl | .star, .star, .star, f, g => rfl -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma inl_comp_tensorHom {x₁ y₁ x₂ y₂ : AugmentedSimplexCategory} (f₁ : x₁ ⟶ y₁) (f₂ : x₂ ⟶ y₂) : inl x₁ x₂ ≫ (f₁ ⊗ₘ f₂) = f₁ ≫ inl y₁ y₂ := @@ -245,7 +244,6 @@ lemma inl_comp_tensorHom {x₁ y₁ x₂ y₂ : AugmentedSimplexCategory} | _, _, .star, _, f₁, f₂ => by cat_disch | .star, _, _, _, _, _ => rfl -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] lemma inr_comp_tensorHom {x₁ y₁ x₂ y₂ : AugmentedSimplexCategory} (f₁ : x₁ ⟶ y₁) (f₂ : x₂ ⟶ y₂) : inr x₁ x₂ ≫ (f₁ ⊗ₘ f₂) = f₂ ≫ inr y₁ y₂ := diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean index a98b1c9731e957..6568f0be4f567d 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean @@ -87,7 +87,6 @@ theorem Hom.ext_one_left {n : SimplexCategory} (f g : ⦋1⦌ ⟶ n) | 0 => exact h0 ▸ rfl | 1 => exact h1 ▸ rfl -set_option backward.isDefEq.respectTransparency false in theorem eq_of_one_to_one (f : ⦋1⦌ ⟶ ⦋1⦌) : (∃ a, f = const ⦋1⦌ _ a) ∨ f = 𝟙 _ := by match e0 : f.toOrderHom 0, e1 : f.toOrderHom 1 with @@ -177,7 +176,6 @@ 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 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 @@ -187,7 +185,6 @@ 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 false in @[simp] lemma mkOfSucc_subinterval_eq {n} (j l : ℕ) (hjl : j + l ≤ n) (i : Fin l) : mkOfSucc i ≫ subinterval j l hjl = @@ -196,7 +193,6 @@ 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 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 @@ -236,7 +232,6 @@ def δ {n} (i : Fin (n + 2)) : ⦋n⦌ ⟶ ⦋n + 1⦌ := def σ {n} (i : Fin (n + 1)) : ⦋n + 1⦌ ⟶ ⦋n⦌ := mkHom i.predAboveOrderHom -set_option backward.isDefEq.respectTransparency false in /-- The generic case of the first simplicial identity -/ theorem δ_comp_δ {n} {i j : Fin (n + 2)} (H : i ≤ j) : δ i ≫ δ j.succ = δ j ≫ δ i.castSucc := by @@ -274,7 +269,6 @@ theorem δ_comp_δ_self' {n} {i : Fin (n + 2)} {j : Fin (n + 3)} (H : j = i.cast subst H rw [δ_comp_δ_self] -set_option backward.isDefEq.respectTransparency false in /-- The second simplicial identity -/ @[reassoc] theorem δ_comp_σ_of_le {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : i ≤ j.castSucc) : @@ -296,7 +290,6 @@ theorem δ_comp_σ_of_le {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : i ≤ j.ca Fin.castSucc_castPred] rwa [Fin.castSucc_castPred] -set_option backward.isDefEq.respectTransparency false in /-- The first part of the third simplicial identity -/ @[reassoc] theorem δ_comp_σ_self {n} {i : Fin (n + 1)} : @@ -315,7 +308,6 @@ theorem δ_comp_σ_self' {n} {j : Fin (n + 2)} {i : Fin (n + 1)} (H : j = i.cast subst H rw [δ_comp_σ_self] -set_option backward.isDefEq.respectTransparency false in /-- The second part of the third simplicial identity -/ @[reassoc] theorem δ_comp_σ_succ {n} {i : Fin (n + 1)} : δ i.succ ≫ σ i = 𝟙 ⦋n⦌ := by @@ -331,7 +323,6 @@ theorem δ_comp_σ_succ' {n} {j : Fin (n + 2)} {i : Fin (n + 1)} (H : j = i.succ subst H rw [δ_comp_σ_succ] -set_option backward.isDefEq.respectTransparency false in /-- The fourth simplicial identity -/ @[reassoc] theorem δ_comp_σ_of_gt {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : j.castSucc < i) : @@ -366,7 +357,6 @@ theorem δ_comp_σ_of_gt' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : j.succ < · rw [Fin.castSucc_castLT, ← Fin.succ_lt_succ_iff, Fin.succ_pred] exact H -set_option backward.isDefEq.respectTransparency false in /-- The fifth simplicial identity -/ @[reassoc] theorem σ_comp_σ {n} {i j : Fin (n + 1)} (H : i ≤ j) : @@ -413,7 +403,6 @@ then `factor_δ f j` is a morphism `⦋m⦌ ⟶ ⦋n⦌` such that def factor_δ {m n : ℕ} (f : ⦋m⦌ ⟶ ⦋n + 1⦌) (j : Fin (n + 2)) : ⦋m⦌ ⟶ ⦋n⦌ := f ≫ σ (Fin.predAbove 0 j) -set_option backward.isDefEq.respectTransparency false in lemma factor_δ_spec {m n : ℕ} (f : ⦋m⦌ ⟶ ⦋n + 1⦌) (j : Fin (n + 2)) (hj : ∀ (k : Fin (m + 1)), f.toOrderHom k ≠ j) : factor_δ f j ≫ δ j = f := by @@ -434,7 +423,6 @@ lemma δ_one_mkOfSucc {n : ℕ} (i : Fin n) : fin_cases x rfl -set_option backward.isDefEq.respectTransparency false in /-- If `i + 1 < j`, `mkOfSucc i ≫ δ j` is the morphism `⦋1⦌ ⟶ ⦋n⦌` that sends `0` and `1` to `i` and `i + 1`, respectively. -/ lemma mkOfSucc_δ_lt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} @@ -445,7 +433,6 @@ lemma mkOfSucc_δ_lt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} · simp [δ, Fin.succAbove_of_castSucc_lt _ _ (Nat.lt_trans _ h)] · simp [δ, Fin.succAbove_of_castSucc_lt _ _ h] -set_option backward.isDefEq.respectTransparency false in /-- If `i + 1 > j`, `mkOfSucc i ≫ δ j` is the morphism `⦋1⦌ ⟶ ⦋n⦌` that sends `0` and `1` to `i + 1` and `i + 2`, respectively. -/ lemma mkOfSucc_δ_gt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} @@ -460,7 +447,6 @@ lemma mkOfSucc_δ_gt {n : ℕ} {i : Fin n} {j : Fin (n + 2)} · rfl · exact Nat.le_of_lt h -set_option backward.isDefEq.respectTransparency false in /-- If `i + 1 = j`, `mkOfSucc i ≫ δ j` is the morphism `⦋1⦌ ⟶ ⦋n⦌` that sends `0` and `1` to `i` and `i + 2`, respectively. -/ lemma mkOfSucc_δ_eq {n : ℕ} {i : Fin n} {j : Fin (n + 2)} @@ -733,7 +719,6 @@ theorem iso_eq_iso_refl {x : SimplexCategory} (e : x ≅ x) : e = Iso.refl x := theorem eq_id_of_isIso {x : SimplexCategory} (f : x ⟶ x) [IsIso f] : f = 𝟙 _ := congr_arg (fun φ : _ ≅ _ => φ.hom) (iso_eq_iso_refl (asIso f)) -set_option backward.isDefEq.respectTransparency false in theorem eq_σ_comp_of_not_injective' {n : ℕ} {Δ' : SimplexCategory} (θ : ⦋n + 1⦌ ⟶ Δ') (i : Fin (n + 1)) (hi : θ.toOrderHom (Fin.castSucc i) = θ.toOrderHom i.succ) : ∃ θ' : ⦋n⦌ ⟶ Δ', θ = σ i ≫ θ' := by @@ -765,7 +750,6 @@ theorem eq_σ_comp_of_not_injective' {n : ℕ} {Δ' : SimplexCategory} (θ : ⦋ Nat.lt_succ_iff, Fin.ext_iff] at h' h'' ⊢ lia -set_option backward.isDefEq.respectTransparency false in theorem eq_σ_comp_of_not_injective {n : ℕ} {Δ' : SimplexCategory} (θ : ⦋n + 1⦌ ⟶ Δ') (hθ : ¬Function.Injective θ.toOrderHom) : ∃ (i : Fin (n + 1)) (θ' : ⦋n⦌ ⟶ Δ'), θ = σ i ≫ θ' := by diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean b/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean index 0438d4febeaac8..33c05e69edb54c 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/ToMkOne.lean @@ -59,7 +59,6 @@ lemma toMk₁_of_le_castSucc {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : dsimp% toMk₁ i j = 1 := by simpa [toMk₁_apply] -set_option backward.isDefEq.respectTransparency false in lemma δ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : i ≤ j.castSucc) : δ j ≫ toMk₁ i = toMk₁ (i.castPred (Fin.ne_last_of_lt (lt_of_le_of_lt h j.castSucc_lt_succ))) := by @@ -73,7 +72,6 @@ lemma δ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : i rw [Fin.eq_iff_eq_zero_iff, toMk₁_apply_eq_zero_iff, toMk₁_apply_eq_zero_iff] grind [Fin.succAbove] -set_option backward.isDefEq.respectTransparency false in lemma δ_comp_toMk₁_of_lt {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : j.castSucc < i) : δ j ≫ toMk₁ i = toMk₁ (i.pred (Fin.ne_zero_of_lt h)) := by obtain ⟨i, rfl⟩ := Fin.eq_succ_of_ne_zero (Fin.ne_zero_of_lt h) @@ -84,7 +82,6 @@ lemma δ_comp_toMk₁_of_lt {n : ℕ} (i : Fin (n + 3)) (j : Fin (n + 2)) (h : j rw [Fin.eq_iff_eq_zero_iff, toMk₁_apply_eq_zero_iff, toMk₁_apply_eq_zero_iff] grind [Fin.succAbove] -set_option backward.isDefEq.respectTransparency false in lemma σ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : i ≤ j.castSucc) : σ j ≫ toMk₁ i = toMk₁ i.castSucc := by refine ConcreteCategory.hom_ext _ _ (fun k ↦ ?_) @@ -102,7 +99,6 @@ lemma σ_comp_toMk₁_of_le {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : i · rwa [Fin.predAbove_of_le_castSucc _ _ hk', Fin.castSucc_castPred] · grind [Fin.predAbove] -set_option backward.isDefEq.respectTransparency false in lemma σ_comp_toMk₁_of_lt {n : ℕ} (i : Fin (n + 2)) (j : Fin (n + 1)) (h : j.castSucc < i) : σ j ≫ toMk₁ i = toMk₁ i.succ := by refine ConcreteCategory.hom_ext _ _ (fun k ↦ ?_) @@ -129,7 +125,6 @@ lemma toMk₁_injective {n : ℕ} : Function.Injective (toMk₁ (n := n)) := by have := ConcreteCategory.congr_hom h ⟨i.1, lt_of_lt_of_le hij (by dsimp; lia)⟩ simp [toMk₁_apply, if_pos hij] at this -set_option backward.isDefEq.respectTransparency false in lemma toMk₁_surjective {n : ℕ} : Function.Surjective (toMk₁ (n := n)) := by intro f let S : Finset (Fin (n + 1)) := { i | f i = 1} diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean index 4e2f6d12f366f0..d7b8f6ac3e415a 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Degenerate.lean @@ -64,7 +64,6 @@ lemma σ_mem_degenerate (i : Fin (n + 1)) (x : X _⦋n⦌) : X.σ i x ∈ X.degenerate (n + 1) := ⟨n, by lia, SimplexCategory.σ i, Set.mem_range_self x⟩ -set_option backward.isDefEq.respectTransparency false in lemma mem_degenerate_iff (x : X _⦋n⦌) : x ∈ X.degenerate n ↔ ∃ (m : ℕ) (_ : m < n) (f : ⦋n⦌ ⟶ ⦋m⦌) (_ : Epi f), x ∈ Set.range (X.map f.op) := by @@ -212,7 +211,6 @@ lemma unique_nonDegenerate_simplex (x : X _⦋n⦌) {m : ℕ} ext simpa [g_eq_id hy₁ hy₂ hf₁] using (map_g_op_y₂ hf₁ hy₁ hy₂).symm -set_option backward.isDefEq.respectTransparency false in lemma unique_nonDegenerate_map (x : X _⦋n⦌) {m : ℕ} (f₁ : ⦋n⦌ ⟶ ⦋m⦌) [Epi f₁] (y₁ : X.nonDegenerate m) (hy₁ : x = X.map f₁.op y₁) (f₂ : ⦋n⦌ ⟶ ⦋m⦌) (y₂ : X.nonDegenerate m) (hy₂ : x = X.map f₂.op y₂) : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean index 17211cc2814e1b..cdb454ac2d71e2 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Horn.lean @@ -39,7 +39,6 @@ def horn (n : ℕ) (i : Fin (n + 1)) : (Δ[n] : SSet.{u}).Subcomplex where /-- The `i`-th horn `Λ[n, i]` of the standard `n`-simplex -/ scoped[Simplicial] notation3 "Λ[" n ", " i "]" => SSet.horn (n : ℕ) i -set_option backward.isDefEq.respectTransparency false in lemma horn_eq_iSup (n : ℕ) (i : Fin (n + 1)) : horn.{u} n i = ⨆ (j : ({i}ᶜ : Set (Fin (n + 1)))), stdSimplex.face {j.1}ᶜ := by diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean index 1ce7c3daacc12f..050d495128def9 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/NerveAdjunction.lean @@ -64,7 +64,6 @@ variable {n : ℕ} {X Y : Truncated.{u} 2} (f₀ : X _⦋0⦌₂ → Y _⦋0⦌ namespace liftOfStrictSegal -set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `SSet.Truncated.liftOfStrictSegal`. -/ def f₂ (x : X _⦋2⦌₂) : Y _⦋2⦌₂ := (hY.spineEquiv 2).symm diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean b/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean index 5f2e3021bd87f7..c77dd4558c6054 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/Path.lean @@ -191,7 +191,6 @@ lemma spine_map_vertex (Δ : X _⦋m⦌ₙ₊₁) (a : ℕ) (hₐ : a ≤ n + 1) rw [← FunctorToTypes.map_comp_apply, ← op_comp, ← tr_comp', SimplexCategory.const_comp] -set_option backward.isDefEq.respectTransparency false in lemma spine_map_subinterval (j l : ℕ) (h : j + l ≤ m) (Δ : X _⦋m⦌ₙ₊₁) : X.spine l (by lia) (X.map (tr (subinterval j l h)).op Δ) = (X.spine m hₘ Δ).interval j l h := by @@ -306,7 +305,6 @@ lemma spine_arrow (Δ : X _⦋n⦌) (i : Fin n) : (X.spine n Δ).arrow i = X.map (mkOfSucc i).op Δ := rfl -set_option backward.isDefEq.respectTransparency false in lemma spine_δ₀ {m : ℕ} (x : X _⦋m + 1⦌) : X.spine m (X.δ 0 x) = (X.spine (m + 1) x).interval 1 m := by obtain _ | m := m diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean index cae299764eed23..c65dea8df9db1d 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/ProdStdSimplex.lean @@ -34,7 +34,6 @@ namespace prodStdSimplex variable {p q : ℕ} -set_option backward.isDefEq.respectTransparency false in /-- `n`-simplices in `Δ[p] ⊗ Δ[q]` identify to order preserving maps `Fin (n + 1) →o Fin (p + 1) × Fin (q + 1)`. -/ def objEquiv {n : ℕ} : diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean index ebebb6ea85e658..ed561f768b2577 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StdSimplex.lean @@ -235,7 +235,6 @@ lemma coe_edge_down_toOrderHom (n : ℕ) (a b : Fin (n + 1)) (hab : a ≤ b) : ↑(edge n a b hab).down.toOrderHom = ![a, b] := rfl -set_option backward.isDefEq.respectTransparency false in /-- The triangle in the standard simplex with vertices `a`, `b`, and `c`. -/ def triangle {n : ℕ} (a b c : Fin (n + 1)) (hab : a ≤ b) (hbc : b ≤ c) : Δ[n] _⦋2⦌ := by refine objMk ⟨![a, b, c], ?_⟩ @@ -250,7 +249,6 @@ lemma coe_triangle_down_toOrderHom {n : ℕ} (a b c : Fin (n + 1)) (hab : a ≤ attribute [local simp] image_subset_iff -set_option backward.isDefEq.respectTransparency false in /-- Given `S : Finset (Fin (n + 1))`, this is the corresponding face of `Δ[n]`, as a subcomplex. -/ @[simps -isSimp obj] @@ -260,18 +258,15 @@ def face {n : ℕ} (S : Finset (Fin (n + 1))) : (Δ[n] : SSet.{u}).Subcomplex wh attribute [local simp] face_obj -set_option backward.isDefEq.respectTransparency false in @[simp] lemma mem_face_iff {n : ℕ} (S : Finset (Fin (n + 1))) {d : ℕ} (x : (Δ[n] : SSet.{u}) _⦋d⦌) : x ∈ (face S).obj _ ↔ ∀ (i : Fin (d + 1)), x i ∈ S := by simp -set_option backward.isDefEq.respectTransparency false in lemma face_inter_face {n : ℕ} (S₁ S₂ : Finset (Fin (n + 1))) : face S₁ ⊓ face S₂ = face (S₁ ⊓ S₂) := by aesop -set_option backward.isDefEq.respectTransparency false in @[simp] lemma face_empty (n : ℕ) : face.{u} (∅ : Finset (Fin (n + 1))) = ⊥ := by @@ -326,7 +321,6 @@ lemma face_le_face_iff {n : ℕ} (S₁ S₂ : Finset (Fin (n + 1))) : simp only [← obj₀Equiv_symm_mem_face_iff.{u}] at hi ⊢ exact h _ hi -set_option backward.isDefEq.respectTransparency false in lemma face_eq_ofSimplex {n : ℕ} (S : Finset (Fin (n + 1))) (m : ℕ) (e : Fin (m + 1) ≃o S) : face.{u} S = Subcomplex.ofSimplex (X := Δ[n]) @@ -345,7 +339,6 @@ lemma face_eq_ofSimplex {n : ℕ} (S : Finset (Fin (n + 1))) (m : ℕ) (e : Fin simpa only [Subtype.ext_iff] using e.apply_symm_apply ⟨_, hx j⟩ · simp -set_option backward.isDefEq.respectTransparency false in /-- If `S : Finset (Fin (n + 1))` is order isomorphic to `Fin (m + 1)`, then the face `face S` of `Δ[n]` is representable by `m`, i.e. `face S` is isomorphic to `Δ[m]`, see `stdSimplex.isoOfRepresentableBy`. -/ @@ -501,7 +494,6 @@ noncomputable def facePairIso {n : ℕ} (i j : Fin (n + 1)) (hij : i < j) : stdSimplex.isoOfRepresentableBy (stdSimplex.faceRepresentableBy.{u} _ _ (Fin.orderIsoPair i j hij)) -set_option backward.isDefEq.respectTransparency false in variable (n) in private lemma bijective_image_objEquiv_toOrderHom_univ (m : ℕ) : Function.Bijective (fun (⟨x, hx⟩ : (Δ[n] : SSet.{u}).nonDegenerate m) ↦ @@ -544,7 +536,6 @@ lemma nonDegenerateEquiv'_iff {n d : ℕ} (x : (Δ[n] : SSet.{u}).nonDegenerate dsimp [nonDegenerateEquiv'] aesop -set_option backward.isDefEq.respectTransparency false 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`. -/ @[no_expose] noncomputable def orderIsoOfNonDegenerate diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean index a2a9f55a6ec72b..ffc5916eb1992c 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/StrictSegal.lean @@ -77,7 +77,6 @@ lemma IsStrictSegal.ext [X.IsStrictSegal] {d : ℕ} {hd} {x y : X _⦋d + 1⦌ x = y := X.spine_injective (by ext i; apply h) -set_option backward.isDefEq.respectTransparency false in variable {X} in lemma IsStrictSegal.hom_ext {Y : SSet.Truncated.{u} (n + 1)} [Y.IsStrictSegal] {f g : X ⟶ Y} (h : ∀ (x : X _⦋1⦌ₙ₊₁), f.app _ x = g.app _ x) : f = g := by @@ -198,7 +197,6 @@ section spine_δ variable (m : ℕ) (h : m ≤ n) (f : Path X (m + 1)) variable {i : Fin (m + 1)} {j : Fin (m + 2)} -set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, the common vertices will agree with those of the original path `f`. In particular, a vertex `i` with `i < j` can be identified with the same vertex in `f`. -/ @@ -211,7 +209,6 @@ lemma spine_δ_vertex_lt (hij : i.castSucc < j) : Fin.succAboveOrderEmb_apply, OrderEmbedding.toOrderHom_coe] rw [Fin.succAbove_of_castSucc_lt j i hij] -set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, a vertex `i` with `j ≤ i` can be identified with vertex `i + 1` in the original path. -/ @@ -381,7 +378,6 @@ lemma spineToSimplex_map {X Y : SSet.{u}} (sx : StrictSegal X) variable (f : Path X (n + 1)) variable {i : Fin (n + 1)} {j : Fin (n + 2)} -set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, the common vertices will agree with those of the original path `f`. In particular, a vertex `i` with `i < j` can be identified with the same vertex in `f`. -/ @@ -395,7 +391,6 @@ lemma spine_δ_vertex_lt (h : i.castSucc < j) : OrderEmbedding.toOrderHom_coe, Fin.succAboveOrderEmb_apply] rw [Fin.succAbove_of_castSucc_lt j i h] -set_option backward.isDefEq.respectTransparency false in /-- If we take the path along the spine of the `j`th face of a `spineToSimplex`, a vertex `i` with `i ≥ j` can be identified with vertex `i + 1` in the original path. -/ @@ -455,7 +450,6 @@ namespace StrictSegalCore variable {X} (h : ∀ n, X.StrictSegalCore n) {n : ℕ} (p : X.Path n) -set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `StrictSegalCore.spineToSimplex`. -/ def spineToSimplexAux : { s : X _⦋n⦌ // X.spine _ s = p } := by induction n with @@ -495,7 +489,6 @@ lemma δ₀_spineToSimplex (p : X.Path (n + 1)) : X.δ 0 (spineToSimplex h p) = spineToSimplex h (p.interval 1 n) := by rw [spineToSimplex_succ, δ₀_concat] -set_option backward.isDefEq.respectTransparency false in @[simp] lemma spineToSimplex_spine (s : X _⦋n⦌) : spineToSimplex h (X.spine _ s) = s := by induction n with diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index dee1534aca942e..64048745bab0a2 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -187,8 +187,12 @@ theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : /-- If `x ∉ (I.lower i, I.upper i)`, then the hyperplane `{y | y i = x}` does not split `I`. -/ theorem split_of_notMem_Ioo (h : x ∉ Ioo (I.lower i) (I.upper i)) : split I i x = ⊤ := by refine ((isPartitionTop I).eq_of_boxes_subset fun J hJ => ?_).symm - rcases mem_top.1 hJ with rfl - grind [Box.splitUpper_eq_self, Box.splitLower_eq_self, mem_boxes, mem_split_iff, not_lt] + rcases mem_top.1 hJ with rfl; clear hJ + rw [mem_boxes, mem_split_iff] + rw [mem_Ioo, not_and_or, not_lt, not_lt] at h + cases h <;> [right; left] + · rwa [eq_comm, Box.splitUpper_eq_self] + · rwa [eq_comm, Box.splitLower_eq_self] theorem coe_eq_of_mem_split_of_mem_le {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J) (h₃ : y i ≤ x) : (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean index be1b0e5e0de697..a743f3426a5e5d 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Basic.lean @@ -149,7 +149,6 @@ section Unital variable [CStarAlgebra A] -set_option backward.isDefEq.respectTransparency false in theorem IsStarNormal.instContinuousFunctionalCalculus : ContinuousFunctionalCalculus ℂ A IsStarNormal where predicate_zero := .zero diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index 5fc929c0bfb683..f95ff5e2884ecd 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -458,7 +458,11 @@ lemma IsGreatest.nnnorm_cfc_nnreal [Nontrivial A] (f : ℝ≥0 → ℝ≥0) (a : convert IsGreatest.nnnorm_cfc (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - simp [Set.image_image, ← ha'.image] + ext x + constructor + all_goals rintro ⟨x, hx, rfl⟩ + · exact ⟨x, spectrum.algebraMap_mem ℝ hx, by simp⟩ + · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ lemma apply_le_nnnorm_cfc_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σ ℝ≥0 a) (hf : ContinuousOn f (σ ℝ≥0 a) := by cfc_cont_tac) (ha : 0 ≤ a := by cfc_tac) : @@ -532,7 +536,11 @@ lemma IsGreatest.nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) convert IsGreatest.nnnorm_cfcₙ (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont (by simpa) case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - simp [Set.image_image, ← ha'.image] + ext x + constructor + all_goals rintro ⟨x, hx, rfl⟩ + · exact ⟨x, quasispectrum.algebraMap_mem ℝ hx, by simp⟩ + · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ lemma apply_le_nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σₙ ℝ≥0 a) (hf : ContinuousOn f (σₙ ℝ≥0 a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean index 3d0cc4368c4d0b..5cc34ccc55b266 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Order.lean @@ -438,9 +438,9 @@ instance instNonnegSpectrumClassComplexNonUnital : NonnegSpectrumClass ℂ A whe lemma norm_le_norm_of_nonneg_of_le {a b : A} (ha : 0 ≤ a := by cfc_tac) (hab : a ≤ b) : ‖a‖ ≤ ‖b‖ := by suffices ∀ a b : A⁺¹, 0 ≤ a → a ≤ b → ‖a‖ ≤ ‖b‖ by - have hb : 0 ≤ b := ha.trans hab + have hb := ha.trans hab simpa only [ge_iff_le, Unitization.norm_inr] using - this a b (by simpa) (by rwa [Unitization.inr_le_iff a b (.of_nonneg ha) (.of_nonneg hb)]) + this a b (by simpa) (by rwa [Unitization.inr_le_iff a b]) intro a b ha hab have hb : 0 ≤ b := ha.trans hab exact (norm_le_iff_le_algebraMap a (norm_nonneg _) ha).2 <| hab.trans <| diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean index 580b1d7dec275a..ee21d6a921125a 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Range.lean @@ -248,8 +248,14 @@ lemma range_cfcₙ_nnreal [NonUnitalClosedEmbeddingContinuousFunctionalCalculus ← range_cfcₙ _ ha.isSelfAdjoint, Set.inter_comm, ← Set.image_preimage_eq_inter_range] refine Set.Subset.antisymm (Set.image_mono (fun _ ↦ cfcₙ_nonneg)) ?_ rintro _ ⟨f, hf, rfl⟩ - exact cfcₙ_cases (p := IsSelfAdjoint) _ a f ⟨0, by simp, by simp⟩ fun hf' h0 ha' ↦ - ⟨f, (cfcₙ_nonneg_iff f a hf' h0 ha').mp - (by simpa [Set.mem_preimage, Set.mem_setOf_eq] using hf), by simp [cfcₙ_apply f a hf' h0 ha']⟩ + simp only [Set.preimage_setOf_eq, Set.mem_setOf_eq, Set.mem_image] at hf ⊢ + obtain (⟨h₁, h₂, h₃⟩ | h | h | h) := by + simpa only [not_and_or] using + em (ContinuousOn f (quasispectrum ℝ a) ∧ f 0 = 0 ∧ IsSelfAdjoint a) + · refine ⟨f, ?_, rfl⟩ + rwa [cfcₙ_nonneg_iff f a] at hf + · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_continuousOn a h]⟩ + · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_map_zero a h]⟩ + · exact ⟨0, by simp, by simp [cfcₙ_apply_of_not_predicate a h]⟩ end NonUnital diff --git a/Mathlib/Analysis/CStarAlgebra/Exponential.lean b/Mathlib/Analysis/CStarAlgebra/Exponential.lean index f5f709d3b023ff..2bef6805c902c6 100644 --- a/Mathlib/Analysis/CStarAlgebra/Exponential.lean +++ b/Mathlib/Analysis/CStarAlgebra/Exponential.lean @@ -55,12 +55,17 @@ lemma selfAdjoint.continuous_expUnitary : Continuous (expUnitary : selfAdjoint A theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : expUnitary (a + b) = expUnitary a * expUnitary b := by let +nondep : NormedAlgebra ℚ A := .restrictScalars ℚ ℂ A - simpa only [Subtype.ext_iff, expUnitary_coe, AddSubgroup.coe_add, smul_add] using - exp_add_of_commute ((h.smul_left I).smul_right I) + ext + have hcomm : Commute (I • (a : A)) (I • (b : A)) := by + unfold Commute SemiconjBy + simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm] + simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : - Commute (expUnitary a) (expUnitary b) := by - simpa only [Commute, SemiconjBy, Subtype.ext_iff, expUnitary_coe] using - ((h.smul_left I).smul_right I).exp + Commute (expUnitary a) (expUnitary b) := + calc + selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = + selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by + rw [← h.expUnitary_add, ← h.symm.expUnitary_add, add_comm] end Star diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index 4c143a3ca4ca7a..d716c1e4af8af6 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -313,8 +313,12 @@ noncomputable instance (priority := 100) Complex.instStarHomClass : StarHomClass rw [← realPart_add_I_smul_imaginaryPart a] simp only [map_add, map_smul, star_add, star_smul, hsa, selfAdjoint.star_val_eq] intro s - rw [selfAdjoint.mem_spectrum_eq_re s (AlgHom.apply_mem_spectrum φ (s : A))] - simp + have := AlgHom.apply_mem_spectrum φ (s : A) + rw [selfAdjoint.val_re_map_spectrum s] at this + rcases this with ⟨⟨_, _⟩, _, heq⟩ + simp only [Function.comp_apply] at heq + rw [← heq, RCLike.star_def] + exact RCLike.conj_ofReal _ /-- This is not an instance to avoid type class inference loops. See `WeakDual.Complex.instStarHomClass`. -/ diff --git a/Mathlib/Analysis/Complex/Hadamard.lean b/Mathlib/Analysis/Complex/Hadamard.lean index 014859cb2f7222..b356efc20a437b 100644 --- a/Mathlib/Analysis/Complex/Hadamard.lean +++ b/Mathlib/Analysis/Complex/Hadamard.lean @@ -227,8 +227,7 @@ theorem norm_mul_invInterpStrip_le_one_of_mem_verticalClosedStrip (f : ℂ → E rw [eventually_inf_principal] apply Eventually.of_forall intro x hx - norm_num - exact (hBF x ((preimage_mono Ioo_subset_Icc_self) hx)).trans + simpa using (hBF x ((preimage_mono Ioo_subset_Icc_self) hx)).trans ((le_of_lt (lt_add_one BF)).trans (Real.add_one_le_exp BF)) end invInterpStrip diff --git a/Mathlib/Analysis/Convex/Approximation.lean b/Mathlib/Analysis/Convex/Approximation.lean index 4c7fca57290943..dd5fa60e8fc6e0 100644 --- a/Mathlib/Analysis/Convex/Approximation.lean +++ b/Mathlib/Analysis/Convex/Approximation.lean @@ -222,9 +222,8 @@ theorem univ_sSup_of_nat_affine_eq [HereditarilyLindelofSpace E] ∧ ⨆ i, re ∘ (l i) + const E (c i) = φ := by obtain ⟨l, c, hle, hsup⟩ := hφcv.sSup_of_nat_affine_eq (𝕜 := 𝕜) (s := univ) isClosed_univ (lowerSemicontinuousOn_univ_iff.2 hφc) - refine ⟨l, c, ?_, ?_⟩ - · intro i x - simpa using hle i ⟨x, trivial⟩ + refine ⟨l, c, fun i x ↦ ?_, ?_⟩ + · exact hle i ⟨x, trivial⟩ · ext x simpa using congrFun hsup ⟨x, trivial⟩ diff --git a/Mathlib/Analysis/Distribution/TestFunction.lean b/Mathlib/Analysis/Distribution/TestFunction.lean index d393bdf14fcb40..d510289fabf406 100644 --- a/Mathlib/Analysis/Distribution/TestFunction.lean +++ b/Mathlib/Analysis/Distribution/TestFunction.lean @@ -316,7 +316,6 @@ noncomputable def ofSupportedInCLM [SMulCommClass ℝ 𝕜 F] {K : Compacts E} @[deprecated (since := "2025-12-10")] alias coe_ofSupportedInLM := coe_ofSupportedInCLM -set_option backward.isDefEq.respectTransparency false in /-- The **universal property** of the topology on `𝓓^{n}(Ω, F)`: a **linear** map from `𝓓^{n}(Ω, F)` to a locally convex topological vector space is continuous if and only if its precomposition with the inclusion `ofSupportedIn K_sub_Ω : 𝓓^{n}_{K}(E, F) → 𝓓^{n}(Ω, F)` is diff --git a/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean b/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean deleted file mode 100644 index a3c0692410b13d..00000000000000 --- a/Mathlib/Analysis/InnerProductSpace/Harmonic/Analytic.lean +++ /dev/null @@ -1,6 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.MeasureTheory.Integral.Bochner.Basic -public import Mathlib.Tactic.Positivity - -deprecated_module (since := "2025-09-16") diff --git a/Mathlib/Analysis/MeanInequalities.lean b/Mathlib/Analysis/MeanInequalities.lean index b9822d2e022748..a8e0accc00bc4c 100644 --- a/Mathlib/Analysis/MeanInequalities.lean +++ b/Mathlib/Analysis/MeanInequalities.lean @@ -350,8 +350,7 @@ theorem harm_mean_le_geom_mean_weighted (w z : ι → ℝ) (hs : s.Nonempty) (hw prod_pos fun i hi => rpow_pos_of_pos (inv_pos.2 (hz i hi)) _ have s_pos : 0 < ∑ i ∈ s, w i * (z i)⁻¹ := sum_pos (fun i hi => mul_pos (hw i hi) (inv_pos.2 (hz i hi))) hs - norm_num at this - rw [← inv_le_inv₀ s_pos p_pos] at this + simp only [Pi.div_apply, Pi.one_apply, one_div, ← inv_le_inv₀ s_pos p_pos] at this apply le_trans this have p_pos₂ : 0 < (∏ i ∈ s, (z i) ^ w i)⁻¹ := inv_pos.2 (prod_pos fun i hi => rpow_pos_of_pos ((hz i hi)) _) diff --git a/Mathlib/Analysis/Normed/Algebra/Basic.lean b/Mathlib/Analysis/Normed/Algebra/Basic.lean index c3ed7104b81bd2..007f8496840ef6 100644 --- a/Mathlib/Analysis/Normed/Algebra/Basic.lean +++ b/Mathlib/Analysis/Normed/Algebra/Basic.lean @@ -34,7 +34,6 @@ namespace IntermediateField variable {K L : Type*} [NontriviallyNormedField K] [NormedField L] [NormedAlgebra K L] -set_option backward.isDefEq.respectTransparency false in instance (F : IntermediateField K L) : NontriviallyNormedField F where __ := SubfieldClass.toNormedField F non_trivial := by diff --git a/Mathlib/Analysis/Normed/Field/Basic.lean b/Mathlib/Analysis/Normed/Field/Basic.lean index 723c9f6c4f2f3f..45afd0c3c88723 100644 --- a/Mathlib/Analysis/Normed/Field/Basic.lean +++ b/Mathlib/Analysis/Normed/Field/Basic.lean @@ -325,7 +325,7 @@ variable {F : Type*} (R S : Type*) [FunLike F R S] See note [reducible non-instances] -/ abbrev NormedDivisionRing.induced [DivisionRing R] [NormedDivisionRing S] [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NormedDivisionRing R := - { NormedAddCommGroup.induced R S f hf, ‹DivisionRing R› with + fast_instance% { NormedAddCommGroup.induced R S f hf, ‹DivisionRing R› with norm_mul x y := show ‖f _‖ = _ from (map_mul f x y).symm ▸ norm_mul (f x) (f y) } /-- An injective non-unital ring homomorphism from a `Field` to a `NormedRing` induces a @@ -334,7 +334,7 @@ abbrev NormedDivisionRing.induced [DivisionRing R] [NormedDivisionRing S] See note [reducible non-instances] -/ abbrev NormedField.induced [Field R] [NormedField S] [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NormedField R := - { NormedDivisionRing.induced R S f hf with + fast_instance% { NormedDivisionRing.induced R S f hf with mul_comm := mul_comm } end Induced @@ -348,7 +348,7 @@ If `s` is a subfield of a normed field `F`, then `s` is equipped with an induced field structure. -/ instance toNormedField [NormedField F] [SubfieldClass S F] (s : S) : NormedField s := - NormedField.induced s F (SubringClass.subtype s) Subtype.val_injective + fast_instance% NormedField.induced s F (SubringClass.subtype s) Subtype.val_injective end SubfieldClass diff --git a/Mathlib/Analysis/Normed/Group/Basic.lean b/Mathlib/Analysis/Normed/Group/Basic.lean index b71de6533d7fdd..a84822245f2c57 100644 --- a/Mathlib/Analysis/Normed/Group/Basic.lean +++ b/Mathlib/Analysis/Normed/Group/Basic.lean @@ -713,7 +713,7 @@ structure on the domain. -/ `SeminormedAddGroup` induces a `SeminormedAddGroup` structure on the domain. -/] abbrev SeminormedGroup.induced [Group E] [SeminormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) : SeminormedGroup E := - { PseudoMetricSpace.induced f toPseudoMetricSpace with + fast_instance% { PseudoMetricSpace.induced f toPseudoMetricSpace with norm := fun x => ‖f x‖ dist_eq := fun x y => by simp only [map_mul, map_inv, ← dist_eq_norm_inv_mul]; rfl } @@ -725,7 +725,7 @@ abbrev SeminormedGroup.induced [Group E] [SeminormedGroup F] [MonoidHomClass abbrev SeminormedCommGroup.induced [CommGroup E] [SeminormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) : SeminormedCommGroup E := - { SeminormedGroup.induced E F f with + fast_instance% { SeminormedGroup.induced E F f with mul_comm := mul_comm } -- See note [reducible non-instances]. @@ -736,7 +736,7 @@ structure on the domain. -/ abbrev NormedGroup.induced [Group E] [NormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) (h : Injective f) : NormedGroup E := - { SeminormedGroup.induced E F f, MetricSpace.induced f h _ with } + fast_instance% { SeminormedGroup.induced E F f, MetricSpace.induced f h _ with } -- See note [reducible non-instances]. /-- An injective group homomorphism from a `CommGroup` to a `NormedGroup` induces a @@ -745,8 +745,7 @@ abbrev NormedGroup.induced `NormedCommGroup` induces a `NormedCommGroup` structure on the domain. -/] abbrev NormedCommGroup.induced [CommGroup E] [NormedGroup F] [MonoidHomClass 𝓕 E F] (f : 𝓕) (h : Injective f) : NormedCommGroup E := - { SeminormedGroup.induced E F f, MetricSpace.induced f h _ with - mul_comm := mul_comm } + fast_instance% { SeminormedCommGroup.induced E F f, MetricSpace.induced f h _ with } end Induced diff --git a/Mathlib/Analysis/Normed/Group/Subgroup.lean b/Mathlib/Analysis/Normed/Group/Subgroup.lean index de640b93cfcaff..8fc9fda8d199f3 100644 --- a/Mathlib/Analysis/Normed/Group/Subgroup.lean +++ b/Mathlib/Analysis/Normed/Group/Subgroup.lean @@ -39,7 +39,7 @@ with the restriction of the norm. -/ @[to_additive /-- A subgroup of a seminormed group is also a seminormed group, with the restriction of the norm. -/] instance seminormedGroup : SeminormedGroup s := - SeminormedGroup.induced _ _ s.subtype + fast_instance% SeminormedGroup.induced _ _ s.subtype /-- If `x` is an element of a subgroup `s` of a seminormed group `E`, its norm in `s` is equal to its norm in `E`. -/ @@ -63,15 +63,15 @@ end SeminormedGroup @[to_additive] instance seminormedCommGroup [SeminormedCommGroup E] {s : Subgroup E} : SeminormedCommGroup s := - SeminormedCommGroup.induced _ _ s.subtype + fast_instance% SeminormedCommGroup.induced _ _ s.subtype @[to_additive] instance normedGroup [NormedGroup E] {s : Subgroup E} : NormedGroup s := - NormedGroup.induced _ _ s.subtype Subtype.coe_injective + fast_instance% NormedGroup.induced _ _ s.subtype Subtype.coe_injective @[to_additive] instance normedCommGroup [NormedCommGroup E] {s : Subgroup E} : NormedCommGroup s := - NormedCommGroup.induced _ _ s.subtype Subtype.coe_injective + fast_instance% NormedCommGroup.induced _ _ s.subtype Subtype.coe_injective end Subgroup @@ -89,7 +89,7 @@ with the restriction of the norm. -/ @[to_additive /-- A subgroup of a seminormed additive group is also a seminormed additive group, with the restriction of the norm. -/] instance (priority := 75) seminormedGroup : SeminormedGroup s := - SeminormedGroup.induced _ _ (SubgroupClass.subtype s) + fast_instance% SeminormedGroup.induced _ _ (SubgroupClass.subtype s) /-- If `x` is an element of a subgroup `s` of a seminormed group `E`, its norm in `s` is equal to its norm in `E`. -/ @@ -103,16 +103,16 @@ end SeminormedGroup @[to_additive] instance (priority := 75) seminormedCommGroup [SeminormedCommGroup E] {S : Type*} [SetLike S E] [SubgroupClass S E] (s : S) : SeminormedCommGroup s := - SeminormedCommGroup.induced _ _ (SubgroupClass.subtype s) + fast_instance% SeminormedCommGroup.induced _ _ (SubgroupClass.subtype s) @[to_additive] instance (priority := 75) normedGroup [NormedGroup E] {S : Type*} [SetLike S E] [SubgroupClass S E] (s : S) : NormedGroup s := - NormedGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective + fast_instance% NormedGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective @[to_additive] instance (priority := 75) normedCommGroup [NormedCommGroup E] {S : Type*} [SetLike S E] [SubgroupClass S E] (s : S) : NormedCommGroup s := - NormedCommGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective + fast_instance% NormedCommGroup.induced _ _ (SubgroupClass.subtype s) Subtype.coe_injective end SubgroupClass diff --git a/Mathlib/Analysis/Normed/Group/Submodule.lean b/Mathlib/Analysis/Normed/Group/Submodule.lean index dc2c4f9ef9abe2..be5466c4162457 100644 --- a/Mathlib/Analysis/Normed/Group/Submodule.lean +++ b/Mathlib/Analysis/Normed/Group/Submodule.lean @@ -20,7 +20,7 @@ namespace Submodule -/ instance seminormedAddCommGroup [Ring 𝕜] [SeminormedAddCommGroup E] [Module 𝕜 E] (s : Submodule 𝕜 E) : SeminormedAddCommGroup s := - SeminormedAddCommGroup.induced _ _ s.subtype.toAddMonoidHom + fast_instance% SeminormedAddCommGroup.induced _ _ s.subtype.toAddMonoidHom /-- If `x` is an element of a submodule `s` of a normed group `E`, its norm in `s` is equal to its norm in `E`. -/ diff --git a/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean b/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean index 6b8f964ee829e9..87bffe90dbca5d 100644 --- a/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean +++ b/Mathlib/Analysis/Normed/Module/Ball/Pointwise.lean @@ -40,7 +40,6 @@ section DivisionRing variable [NormedDivisionRing 𝕜] [SeminormedAddCommGroup E] variable [Module 𝕜 E] [NormSMulClass 𝕜 E] -set_option backward.isDefEq.respectTransparency false in theorem ediam_smul₀ (c : 𝕜) (s : Set E) : ediam (c • s) = ‖c‖₊ • ediam s := by refine le_antisymm (ediam_smul_le c s) ?_ obtain rfl | hc := eq_or_ne c 0 diff --git a/Mathlib/Analysis/Normed/Module/Basic.lean b/Mathlib/Analysis/Normed/Module/Basic.lean index 40c1d561c78384..f8ffe68e9838f7 100644 --- a/Mathlib/Analysis/Normed/Module/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Basic.lean @@ -189,8 +189,8 @@ See note [reducible non-instances] -/ abbrev NormedSpace.induced {F : Type*} (𝕜 E G : Type*) [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] [SeminormedAddCommGroup G] [NormedSpace 𝕜 G] [FunLike F E G] [LinearMapClass F 𝕜 E G] (f : F) : @NormedSpace 𝕜 E _ (SeminormedAddCommGroup.induced E G f) := - let _ := SeminormedAddCommGroup.induced E G f - ⟨fun a b ↦ by simpa only [← map_smul f a b] using norm_smul_le a (f b)⟩ + letI := SeminormedAddCommGroup.induced E G f + { norm_smul_le a b := by simpa only [← map_smul f a b] using norm_smul_le a (f b) } section NontriviallyNormedSpace diff --git a/Mathlib/Analysis/Normed/Ring/Basic.lean b/Mathlib/Analysis/Normed/Ring/Basic.lean index c3067e14f6c874..47955ce9681e21 100644 --- a/Mathlib/Analysis/Normed/Ring/Basic.lean +++ b/Mathlib/Analysis/Normed/Ring/Basic.lean @@ -803,7 +803,7 @@ induces a `NonUnitalSeminormedRing` structure on the domain. See note [reducible non-instances] -/ abbrev NonUnitalSeminormedRing.induced [NonUnitalRing R] [NonUnitalSeminormedRing S] - [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedRing R := + [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedRing R := fast_instance% { SeminormedAddCommGroup.induced R S f, ‹NonUnitalRing R› with norm_mul_le x y := show ‖f _‖ ≤ _ from (map_mul f x y).symm ▸ norm_mul_le (f x) (f y) } @@ -812,7 +812,8 @@ abbrev NonUnitalSeminormedRing.induced [NonUnitalRing R] [NonUnitalSeminormedRin See note [reducible non-instances] -/ abbrev NonUnitalNormedRing.induced [NonUnitalRing R] [NonUnitalNormedRing S] - [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NonUnitalNormedRing R := + [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : + NonUnitalNormedRing R := fast_instance% { NonUnitalSeminormedRing.induced R S f, NormedAddCommGroup.induced R S f hf with } /-- A non-unital ring homomorphism from a `Ring` to a `SeminormedRing` induces a @@ -820,7 +821,7 @@ abbrev NonUnitalNormedRing.induced [NonUnitalRing R] [NonUnitalNormedRing S] See note [reducible non-instances] -/ abbrev SeminormedRing.induced [Ring R] [SeminormedRing S] [NonUnitalRingHomClass F R S] (f : F) : - SeminormedRing R := + SeminormedRing R := fast_instance% { NonUnitalSeminormedRing.induced R S f, SeminormedAddCommGroup.induced R S f, ‹Ring R› with } /-- An injective non-unital ring homomorphism from a `Ring` to a `NormedRing` induces a @@ -828,7 +829,7 @@ abbrev SeminormedRing.induced [Ring R] [SeminormedRing S] [NonUnitalRingHomClass See note [reducible non-instances] -/ abbrev NormedRing.induced [Ring R] [NormedRing S] [NonUnitalRingHomClass F R S] (f : F) - (hf : Function.Injective f) : NormedRing R := + (hf : Function.Injective f) : NormedRing R := fast_instance% { NonUnitalSeminormedRing.induced R S f, NormedAddCommGroup.induced R S f hf, ‹Ring R› with } /-- A non-unital ring homomorphism from a `NonUnitalCommRing` to a `NonUnitalSeminormedCommRing` @@ -836,7 +837,7 @@ induces a `NonUnitalSeminormedCommRing` structure on the domain. See note [reducible non-instances] -/ abbrev NonUnitalSeminormedCommRing.induced [NonUnitalCommRing R] [NonUnitalSeminormedCommRing S] - [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedCommRing R := + [NonUnitalRingHomClass F R S] (f : F) : NonUnitalSeminormedCommRing R := fast_instance% { NonUnitalSeminormedRing.induced R S f, ‹NonUnitalCommRing R› with } /-- An injective non-unital ring homomorphism from a `NonUnitalCommRing` to a @@ -844,14 +845,15 @@ abbrev NonUnitalSeminormedCommRing.induced [NonUnitalCommRing R] [NonUnitalSemin See note [reducible non-instances] -/ abbrev NonUnitalNormedCommRing.induced [NonUnitalCommRing R] [NonUnitalNormedCommRing S] - [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : NonUnitalNormedCommRing R := + [NonUnitalRingHomClass F R S] (f : F) (hf : Function.Injective f) : + NonUnitalNormedCommRing R := fast_instance% { NonUnitalNormedRing.induced R S f hf, ‹NonUnitalCommRing R› with } /-- A non-unital ring homomorphism from a `CommRing` to a `SeminormedRing` induces a `SeminormedCommRing` structure on the domain. See note [reducible non-instances] -/ abbrev SeminormedCommRing.induced [CommRing R] [SeminormedRing S] [NonUnitalRingHomClass F R S] - (f : F) : SeminormedCommRing R := + (f : F) : SeminormedCommRing R := fast_instance% { NonUnitalSeminormedRing.induced R S f, SeminormedAddCommGroup.induced R S f, ‹CommRing R› with } /-- An injective non-unital ring homomorphism from a `CommRing` to a `NormedRing` induces a @@ -859,7 +861,7 @@ abbrev SeminormedCommRing.induced [CommRing R] [SeminormedRing S] [NonUnitalRing See note [reducible non-instances] -/ abbrev NormedCommRing.induced [CommRing R] [NormedRing S] [NonUnitalRingHomClass F R S] (f : F) - (hf : Function.Injective f) : NormedCommRing R := + (hf : Function.Injective f) : NormedCommRing R := fast_instance% { SeminormedCommRing.induced R S f, NormedAddCommGroup.induced R S f hf with } /-- A ring homomorphism from a `Ring R` to a `SeminormedRing S` which induces the norm structure @@ -885,17 +887,17 @@ namespace SubringClass variable {S R : Type*} [SetLike S R] instance toSeminormedRing [SeminormedRing R] [SubringClass S R] (s : S) : SeminormedRing s := - SeminormedRing.induced s R (SubringClass.subtype s) + fast_instance% SeminormedRing.induced s R (SubringClass.subtype s) instance toNormedRing [NormedRing R] [SubringClass S R] (s : S) : NormedRing s := - NormedRing.induced s R (SubringClass.subtype s) Subtype.val_injective + fast_instance% NormedRing.induced s R (SubringClass.subtype s) Subtype.val_injective instance toSeminormedCommRing [SeminormedCommRing R] [_h : SubringClass S R] (s : S) : SeminormedCommRing s := - { SubringClass.toSeminormedRing s with mul_comm := mul_comm } + fast_instance% SeminormedCommRing.induced s R (SubringClass.subtype s) instance toNormedCommRing [NormedCommRing R] [SubringClass S R] (s : S) : NormedCommRing s := - { SubringClass.toNormedRing s with mul_comm := mul_comm } + fast_instance% NormedCommRing.induced s R (SubringClass.subtype s) Subtype.val_injective instance toNormOneClass [SeminormedRing R] [NormOneClass R] [SubringClass S R] (s : S) : NormOneClass s := diff --git a/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean b/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean deleted file mode 100644 index 4d72d233d1067c..00000000000000 --- a/Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean +++ /dev/null @@ -1,7 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Analysis.Normed.Group.Basic -public import Mathlib.Data.EReal.Operations -public import Mathlib.Topology.MetricSpace.Bounded - -deprecated_module (since := "2025-09-16") diff --git a/Mathlib/Analysis/NormedSpace/Extend.lean b/Mathlib/Analysis/NormedSpace/Extend.lean deleted file mode 100644 index 39f8e831289bef..00000000000000 --- a/Mathlib/Analysis/NormedSpace/Extend.lean +++ /dev/null @@ -1,10 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Algebra.Order.Algebra -public import Mathlib.Algebra.Order.BigOperators.Expect -public import Mathlib.Analysis.Normed.Group.Basic -public import Mathlib.Data.EReal.Inv -public import Mathlib.Data.Real.Sqrt -public import Mathlib.Tactic.ContinuousFunctionalCalculus - -deprecated_module (since := "2025-09-18") diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean index afa2cee31dc46a..cfe072fa878d43 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean @@ -66,6 +66,7 @@ lemma cos_ne_zero_of_arctan_bounds {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π rwa [show 2 * k + 1 = 1 by lia, Int.cast_one, one_mul] at nr · exact Or.inr ni +set_option linter.flexible false in -- TODO: fix non-terminal simp theorem arctan_tan {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π / 2) < z.re) (h₂ : z.re ≤ π / 2) : arctan (tan z) = z := by have h := cos_ne_zero_of_arctan_bounds h₀ h₁ h₂ @@ -77,7 +78,7 @@ theorem arctan_tan {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π / 2) < z.re) (h rw [sub_eq_add_neg, ← neg_mul, ← sin_neg, ← cos_neg] rw [← exp_mul_I, ← exp_mul_I, ← exp_sub, show z * I - -z * I = 2 * (I * z) by ring, log_exp, show -I / 2 * (2 * (I * z)) = -(I * I) * z by ring, I_mul_I, neg_neg, one_mul] - all_goals norm_num + all_goals simp · rwa [← div_lt_iff₀' two_pos, neg_div] · rwa [← le_div_iff₀' two_pos] diff --git a/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean index eebd2299889ae1..96f7c817bb4104 100644 --- a/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Integrability/Basic.lean @@ -222,6 +222,7 @@ hypothesis on the interval, but assuming the measure is the volume. theorem intervalIntegrable_log (h : (0 : ℝ) ∉ [[a, b]]) : IntervalIntegrable log μ a b := IntervalIntegrable.log continuousOn_id fun _ hx => ne_of_mem_of_not_mem hx h +set_option linter.flexible false in -- TODO: fix non-terminal simp /-- The real logarithm is interval integrable (with respect to the volume measure) on every interval. See `intervalIntegrable_log` for a version applying to any locally finite measure, but with an @@ -243,7 +244,7 @@ theorem intervalIntegrable_log' : IntervalIntegrable log volume a b := by norm_num at * simpa using (hasDerivAt_id s).sub (hasDerivAt_mul_log hs.ne.symm) · intro s ⟨hs₁, hs₂⟩ - norm_num at * + simp at * exact (log_nonpos_iff hs₁.le).mpr hs₂.le · -- Show integrability on [1…t] by continuity apply ContinuousOn.intervalIntegrable diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean index 3aa15a92e4cb0e..641a97b51d9aad 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean @@ -263,8 +263,7 @@ theorem arccos_eq_arctan (h : 0 < x) : arccos x = arctan (√(1 - x ^ 2) / x) := theorem arctan_inv_of_pos (h : 0 < x) : arctan x⁻¹ = π / 2 - arctan x := by rw [← arctan_tan (x := _ - _), tan_pi_div_two_sub, tan_arctan] - · norm_num - exact (arctan_lt_pi_div_two x).trans (half_lt_self_iff.mpr pi_pos) + · simpa using (arctan_lt_pi_div_two x).trans (half_lt_self_iff.mpr pi_pos) · rw [sub_lt_self_iff, ← arctan_zero] exact tanOrderIso.symm.strictMono h diff --git a/Mathlib/CategoryTheory/Abelian/Basic.lean b/Mathlib/CategoryTheory/Abelian/Basic.lean index e0b738a47948b4..38d5733628c607 100644 --- a/Mathlib/CategoryTheory/Abelian/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Basic.lean @@ -421,7 +421,6 @@ variable {Z : C} (g : Y ⟶ Z) @[simp] lemma coimage.comp_π_eq_zero : f ≫ coimage.π g = 0 ↔ f ≫ g = 0 := by simp [← cancel_mono (Abelian.factorThruCoimage _)] -set_option backward.isDefEq.respectTransparency false in /-- `Abelian.image` as a functor from the arrow category. -/ @[simps] def im : Arrow C ⥤ C where @@ -430,7 +429,6 @@ def im : Arrow C ⥤ C where @[deprecated (since := "2025-10-31")] noncomputable alias imageFunctor := im -set_option backward.isDefEq.respectTransparency false in /-- `Abelian.coimage` as a functor from the arrow category. -/ @[simps] def coim : Arrow C ⥤ C where @@ -440,7 +438,6 @@ def coim : Arrow C ⥤ C where @[deprecated (since := "2025-10-31")] noncomputable alias coimageFunctor := coim -set_option backward.isDefEq.respectTransparency false in /-- The image and coimage of an arrow are naturally isomorphic. -/ @[simps!] def coimIsoIm : coim (C := C) ≅ im := diff --git a/Mathlib/CategoryTheory/Abelian/Images.lean b/Mathlib/CategoryTheory/Abelian/Images.lean index 00fbcfc98d6636..d5d83a3243edcd 100644 --- a/Mathlib/CategoryTheory/Abelian/Images.lean +++ b/Mathlib/CategoryTheory/Abelian/Images.lean @@ -120,7 +120,6 @@ end Comparison variable [HasKernels C] [HasCokernels C] -set_option backward.isDefEq.respectTransparency false in /-- The coimage-image comparison morphism is functorial. -/ @[simps! obj map] def coimageImageComparisonFunctor : Arrow C ⥤ Arrow C where diff --git a/Mathlib/CategoryTheory/Adjunction/Opposites.lean b/Mathlib/CategoryTheory/Adjunction/Opposites.lean index 3991d70b08ecd0..e099420d6e8123 100644 --- a/Mathlib/CategoryTheory/Adjunction/Opposites.lean +++ b/Mathlib/CategoryTheory/Adjunction/Opposites.lean @@ -78,12 +78,14 @@ set_option backward.isDefEq.respectTransparency false in `F.op ⋙ coyoneda ≅ F'.op ⋙ coyoneda`. We use this in combination with `fullyFaithfulCancelRight` to show left adjoints are unique. -/ +@[deprecated "No replacement" (since := "2026-04-11")] def leftAdjointsCoyonedaEquiv {F F' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G) : F.op ⋙ coyoneda ≅ F'.op ⋙ coyoneda := NatIso.ofComponents fun X => NatIso.ofComponents fun Y => ((adj1.homEquiv X.unop Y).trans (adj2.homEquiv X.unop Y).symm).toIso +set_option linter.deprecated false in /-- Deprecated: prefer `(Adjunction.conjugateIsoEquiv adj1 adj2).symm`. -/ @[deprecated "Use `(Adjunction.conjugateIsoEquiv adj1 adj2).symm` \ (requires `import Mathlib.CategoryTheory.Adjunction.Mates`)." (since := "2026-01-31")] diff --git a/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean b/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean deleted file mode 100644 index 68499bb72dece0..00000000000000 --- a/Mathlib/CategoryTheory/Bicategory/Functor/Strict.lean +++ /dev/null @@ -1,8 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.CategoryTheory.Category.Init -public import Mathlib.Tactic.Common -public import Mathlib.Tactic.Finiteness.Attr -public import Mathlib.Util.CompileInductive - -deprecated_module (since := "2025-10-02") diff --git a/Mathlib/CategoryTheory/Bicategory/Strict.lean b/Mathlib/CategoryTheory/Bicategory/Strict.lean deleted file mode 100644 index 047ff3cc8b9465..00000000000000 --- a/Mathlib/CategoryTheory/Bicategory/Strict.lean +++ /dev/null @@ -1,5 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.CategoryTheory.Bicategory.Strict.Basic - -deprecated_module (since := "2025-10-02") diff --git a/Mathlib/CategoryTheory/CatCommSq.lean b/Mathlib/CategoryTheory/CatCommSq.lean index 7901ff1fb7cd09..8cdd0124163386 100644 --- a/Mathlib/CategoryTheory/CatCommSq.lean +++ b/Mathlib/CategoryTheory/CatCommSq.lean @@ -46,12 +46,12 @@ namespace CatCommSq /-- The vertical identity `CatCommSq` -/ @[instance_reducible, simps!] def vId : CatCommSq T (𝟭 C₁) (𝟭 C₂) T where - iso := (Functor.leftUnitor _) ≪≫ (Functor.rightUnitor _).symm + iso := Functor.rightUnitor _ ≪≫ (Functor.leftUnitor _).symm /-- The horizontal identity `CatCommSq` -/ @[simps!, implicit_reducible] def hId : CatCommSq (𝟭 C₁) L L (𝟭 C₃) where - iso := (Functor.rightUnitor _) ≪≫ (Functor.leftUnitor _).symm + iso := Functor.leftUnitor _ ≪≫ (Functor.rightUnitor _).symm @[reassoc (attr := simp)] lemma iso_hom_naturality [h : CatCommSq T L R B] {x y : C₁} (f : x ⟶ y) : diff --git a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean index eb9054caf414a6..e3f7f3cfac935e 100644 --- a/Mathlib/CategoryTheory/Comma/CardinalArrow.lean +++ b/Mathlib/CategoryTheory/Comma/CardinalArrow.lean @@ -25,7 +25,6 @@ universe w w' v u namespace CategoryTheory -set_option backward.isDefEq.respectTransparency false in lemma Arrow.finite_iff (C : Type u) [SmallCategory C] : Finite (Arrow C) ↔ Nonempty (FinCategory C) := by constructor @@ -70,7 +69,6 @@ lemma small_of_small_arrow (C : Type u) [Category.{v} C] [Small.{w} (Arrow C)] : Small.{w} C := small_of_injective (f := fun X ↦ Arrow.mk (𝟙 X)) (fun _ _ h ↦ congr_arg Comma.left h) -set_option backward.isDefEq.respectTransparency false in lemma locallySmall_of_small_arrow (C : Type u) [Category.{v} C] [Small.{w} (Arrow C)] : LocallySmall.{w} C where hom_small X Y := diff --git a/Mathlib/CategoryTheory/Functor/Category.lean b/Mathlib/CategoryTheory/Functor/Category.lean index 361c8a7b89e484..217c5ec85576be 100644 --- a/Mathlib/CategoryTheory/Functor/Category.lean +++ b/Mathlib/CategoryTheory/Functor/Category.lean @@ -113,7 +113,7 @@ def hcomp {H I : D ⥤ E} (α : F ⟶ G) (β : H ⟶ I) : F ⋙ H ⟶ G ⋙ I wh -- Horizontal composition has two possible definitions that are dual to each other, -- and we need to prove to `to_dual` that these are equivalent. -attribute [to_dual none] CategoryStruct.comp.hcongr_7 hcomp._proof_2 hcomp._proof_3 +attribute [to_dual none] hcomp._proof_2 hcomp._proof_3 to_dual_insert_cast hcomp := by ext x; exact β.naturality' (α.app x) /-- Notation for horizontal composition of natural transformations. -/ diff --git a/Mathlib/CategoryTheory/Functor/TwoSquare.lean b/Mathlib/CategoryTheory/Functor/TwoSquare.lean index f1cfcac03cea96..74399495305683 100644 --- a/Mathlib/CategoryTheory/Functor/TwoSquare.lean +++ b/Mathlib/CategoryTheory/Functor/TwoSquare.lean @@ -82,7 +82,7 @@ lemma ext (w w' : TwoSquare T L R B) (h : ∀ (X : C₁), w.natTrans.app X = w'. /-- The horizontal identity 2-square. -/ @[simps!] def hId (L : C₁ ⥤ C₃) : TwoSquare (𝟭 _) L L (𝟭 _) := - 𝟙 _ + (Functor.leftUnitor L).hom ≫ (Functor.rightUnitor L).inv /-- Notation for the horizontal identity 2-square. -/ scoped notation "𝟙ₕ" => hId -- type as \b1\_h @@ -90,7 +90,7 @@ scoped notation "𝟙ₕ" => hId -- type as \b1\_h /-- The vertical identity 2-square. -/ @[simps!] def vId (T : C₁ ⥤ C₂) : TwoSquare T (𝟭 _) (𝟭 _) T := - 𝟙 _ + (Functor.rightUnitor T).hom ≫ (Functor.leftUnitor T).inv /-- Notation for the vertical identity 2-square. -/ scoped notation "𝟙ᵥ" => vId -- type as \b1\_v diff --git a/Mathlib/CategoryTheory/Galois/EssSurj.lean b/Mathlib/CategoryTheory/Galois/EssSurj.lean index 930acfe88ab4eb..fdf261307e9855 100644 --- a/Mathlib/CategoryTheory/Galois/EssSurj.lean +++ b/Mathlib/CategoryTheory/Galois/EssSurj.lean @@ -67,7 +67,6 @@ private local instance fintypeQuotientStabilizer {X : Type*} [MulAction G X] Fintype (G ⧸ (MulAction.stabilizer (G) x)) := fintypeQuotient ⟨MulAction.stabilizer (G) x, stabilizer_isOpen (G) x⟩ -set_option backward.isDefEq.respectTransparency false in set_option backward.privateInPublic true in set_option backward.privateInPublic.warn false in /-- If `X` is a finite discrete `G`-set, it can be written as the finite disjoint union diff --git a/Mathlib/CategoryTheory/Iso.lean b/Mathlib/CategoryTheory/Iso.lean index 567a64a98c6f08..7b379668d96b5a 100644 --- a/Mathlib/CategoryTheory/Iso.lean +++ b/Mathlib/CategoryTheory/Iso.lean @@ -63,7 +63,6 @@ structure Iso {C : Type u} [Category.{v} C] (X Y : C) where attribute [to_dual existing inv] Iso.hom attribute [to_dual self] Iso.mk Iso.casesOn -attribute [to_dual none] Iso.mk.hcongr_8 -- needed in `Iso.ext` attribute [reassoc +to_dual (attr := simp), grind =] Iso.hom_inv_id Iso.inv_hom_id diff --git a/Mathlib/CategoryTheory/Limits/Cones.lean b/Mathlib/CategoryTheory/Limits/Cones.lean index ca7f0422ce00d3..94aef55cb0f8e2 100644 --- a/Mathlib/CategoryTheory/Limits/Cones.lean +++ b/Mathlib/CategoryTheory/Limits/Cones.lean @@ -244,7 +244,7 @@ structure CoconeMorphism (A B : Cocone F) where w (j : J) : dsimp% A.ι.app j ≫ hom = B.ι.app j := by cat_disch attribute [reassoc (attr := simp)] ConeMorphism.w CoconeMorphism.w -attribute [to_dual existing] ConeMorphism.mk.congr_simp ConeMorphism.casesOn +attribute [to_dual existing] ConeMorphism.casesOn @[to_dual] instance inhabitedConeMorphism (A : Cone F) : Inhabited (ConeMorphism A A) := diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean index aaee3fe1f2c589..190f58032e2c49 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean @@ -146,7 +146,6 @@ def ofIsoComp {X' : C} (g : X' ⟶ X) [IsIso g] (F : MonoFactorisation (g ≫ f) m := F.m e := inv g ≫ F.e -set_option backward.isDefEq.respectTransparency false in /-- If `f` and `g` are isomorphic arrows, then a mono factorisation of `f` gives a mono factorisation of `g` -/ @[simps] @@ -698,7 +697,6 @@ instance inhabitedImageMap {f : Arrow C} [HasImage f.hom] : Inhabited (ImageMap attribute [reassoc (attr := simp)] ImageMap.map_ι -set_option backward.isDefEq.respectTransparency false in @[reassoc (attr := simp)] theorem ImageMap.factor_map {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g) (m : ImageMap sq) : factorThruImage f.hom ≫ m.map = sq.left ≫ factorThruImage g.hom := @@ -734,7 +732,6 @@ def HasImageMap.imageMap {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : [HasImageMap sq] : ImageMap sq := Classical.choice <| @HasImageMap.has_image_map _ _ _ _ _ _ sq _ -set_option backward.isDefEq.respectTransparency false in -- see Note [lower instance priority] instance (priority := 100) hasImageMapOfIsIso {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g) [IsIso sq] : HasImageMap sq := @@ -745,7 +742,6 @@ instance (priority := 100) hasImageMapOfIsIso {f g : Arrow C} [HasImage f.hom] [ image.lift_fac, Category.assoc, ← Comma.comp_right, IsIso.hom_inv_id, Comma.id_right, Category.comp_id] } -set_option backward.isDefEq.respectTransparency false in instance HasImageMap.comp {f g h : Arrow C} [HasImage f.hom] [HasImage g.hom] [HasImage h.hom] (sq1 : f ⟶ g) (sq2 : g ⟶ h) [HasImageMap sq1] [HasImageMap sq2] : HasImageMap (sq1 ≫ sq2) := HasImageMap.mk @@ -786,11 +782,9 @@ variable [HasImageMap sq] abbrev image.map : image f.hom ⟶ image g.hom := (HasImageMap.imageMap sq).map -set_option backward.isDefEq.respectTransparency false in theorem image.factor_map : factorThruImage f.hom ≫ image.map sq = sq.left ≫ factorThruImage g.hom := by simp -set_option backward.isDefEq.respectTransparency false in theorem image.map_ι : image.map sq ≫ image.ι g.hom = image.ι f.hom ≫ sq.right := by simp theorem image.map_homMk'_ι {X Y P Q : C} {k : X ⟶ Y} [HasImage k] {l : P ⟶ Q} [HasImage l] @@ -803,7 +797,6 @@ section variable {h : Arrow C} [HasImage h.hom] (sq' : g ⟶ h) variable [HasImageMap sq'] -set_option backward.isDefEq.respectTransparency false in /-- Image maps for composable commutative squares induce an image map in the composite square. -/ def imageMapComp : ImageMap (sq ≫ sq') where map := image.map sq ≫ image.map sq' @@ -947,7 +940,6 @@ section HasStrongEpiImages variable [HasImages C] -set_option backward.isDefEq.respectTransparency false in /-- A category with strong epi images has image maps. -/ instance (priority := 100) hasImageMapsOfHasStrongEpiImages [HasStrongEpiImages C] : HasImageMaps C where diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean index d57e5e570447a1..84f3d879002cd1 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Kernels.lean @@ -1280,7 +1280,6 @@ instance (priority := 100) hasCokernels_of_hasCoequalizers [HasCoequalizers C] : section HasKernels variable [HasKernels C] -set_option backward.isDefEq.respectTransparency false in /-- The kernel of an arrow is natural. -/ @[simps] noncomputable def ker : Arrow C ⥤ C where @@ -1297,7 +1296,6 @@ end HasKernels section HasCokernels variable [HasCokernels C] -set_option backward.isDefEq.respectTransparency false in /-- The cokernel of an arrow is natural. -/ @[simps] noncomputable def coker : Arrow C ⥤ C where diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean index cd81d84b77070f..4b9d7d20fba518 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Pullback/PullbackObjObj.lean @@ -137,7 +137,6 @@ variable {f₁ f₁' : Arrow C₁} {f₂ : Arrow C₂} (sq₁₂ : F.PushoutObjObj f₁.hom f₂.hom) (sq₁₂' : F.PushoutObjObj f₁'.hom f₂.hom) -set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁'` and `f₂ : Arrow C₂`, and a morphism `f₁ ⟶ f₁'`, this defines a morphism between the induced pushout maps. -/ @@ -169,7 +168,6 @@ lemma mapArrowLeft_comp {f₁'' : Arrow C₁} (sq₁₂'' : F.PushoutObjObj f₁ mapArrowLeft sq₁₂ sq₁₂' sq ≫ mapArrowLeft sq₁₂' sq₁₂'' sq' = mapArrowLeft sq₁₂ sq₁₂'' (sq ≫ sq') := by cat_disch -set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁'` and `f₂ : Arrow C₂`, and an isomorphism `f₁ ≅ f₁'`, this defines an isomorphism of the induced pushout maps. -/ @@ -183,7 +181,6 @@ variable {f₁ : Arrow C₁} {f₂ f₂' : Arrow C₂} (sq₁₂ : F.PushoutObjObj f₁.hom f₂.hom) (sq₁₂' : F.PushoutObjObj f₁.hom f₂'.hom) -set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁` and `f₂' : Arrow C₂`, and a morphism `f₂ ⟶ f₂'`, this defines a morphism between the induced pushout maps. -/ @@ -216,7 +213,6 @@ lemma mapArrowRight_comp {f₂'' : Arrow C₂} (sq₁₂'' : F.PushoutObjObj f mapArrowRight sq₁₂ sq₁₂' sq ≫ mapArrowRight sq₁₂' sq₁₂'' sq' = mapArrowRight sq₁₂ sq₁₂'' (sq ≫ sq') := by cat_disch -set_option backward.isDefEq.respectTransparency false in /-- Given a `PushoutObjObj` of `f₁ : Arrow C₁` and `f₂ : Arrow C₂`, a `PushoutObjObj` of `f₁` and `f₂' : Arrow C₂`, and an isomorphism `f₂ ≅ f₂'`, this defines an isomorphism of the induced pushout maps. -/ @@ -319,7 +315,6 @@ variable {f₁ f₁' : Arrow C₁} {f₃ : Arrow C₃} (sq₁₃ : G.PullbackObjObj f₁.hom f₃.hom) (sq₁₃' : G.PullbackObjObj f₁'.hom f₃.hom) -set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁'` and `f₃ : Arrow C₃`, and a morphism `f₁' ⟶ f₁`, this defines a morphism between the induced pullback maps. -/ @@ -352,7 +347,6 @@ lemma mapArrowLeft_comp {f₁'' : Arrow C₁} (sq₁₃'' : G.PullbackObjObj f mapArrowLeft sq₁₃ sq₁₃' sq ≫ mapArrowLeft sq₁₃' sq₁₃'' sq' = mapArrowLeft sq₁₃ sq₁₃'' (sq' ≫ sq) := by cat_disch -set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁'` and `f₃ : Arrow C₃`, and an isomorphism `f₁ ≅ f₁'`, this defines an isomorphism of the induced pullback maps. -/ @@ -366,7 +360,6 @@ variable {f₁ : Arrow C₁} {f₃ f₃' : Arrow C₃} (sq₁₃ : G.PullbackObjObj f₁.hom f₃.hom) (sq₁₃' : G.PullbackObjObj f₁.hom f₃'.hom) -set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁` and `f₃' : Arrow C₃`, and a morphism `f₃ ⟶ f₃'`, this defines a morphism between the induced pullback maps. -/ @@ -398,7 +391,6 @@ lemma mapArrowRight_comp {f₃'' : Arrow C₃} (sq₁₃'' : G.PullbackObjObj f mapArrowRight sq₁₃ sq₁₃' sq ≫ mapArrowRight sq₁₃' sq₁₃'' sq' = mapArrowRight sq₁₃ sq₁₃'' (sq ≫ sq') := by cat_disch -set_option backward.isDefEq.respectTransparency false in /-- Given a `PullbackObjObj` of `f₁ : Arrow C₁` and `f₃ : Arrow C₃`, a `PullbackObjObj` of `f₁` and `f₃' : Arrow C₃`, and an isomorphism `f₃ ≅ f₃'`, this defines an isomorphism of the induced pullback maps. -/ diff --git a/Mathlib/CategoryTheory/Limits/Types/Images.lean b/Mathlib/CategoryTheory/Limits/Types/Images.lean index 34d258191eede6..77857c6f55e2d7 100644 --- a/Mathlib/CategoryTheory/Limits/Types/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Types/Images.lean @@ -71,7 +71,6 @@ instance : HasImage f := instance : HasImages (Type u) where has_image := by infer_instance -set_option backward.isDefEq.respectTransparency false in instance : HasImageMaps (Type u) where has_image_map {f g} st := HasImageMap.transport st (monoFactorisation f.hom) (isImage g.hom) diff --git a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean index 3694912a8b4857..2f07fd2269e5b9 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Factorization.lean @@ -183,7 +183,6 @@ section variable (J : Type*) [Category* J] -set_option backward.isDefEq.respectTransparency false in /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/ @[simps] def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C where diff --git a/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean b/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean index 6799b2bee8a431..bbb73d9a63bff0 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/IsSmall.lean @@ -44,7 +44,6 @@ instance isSmall_ofHoms {ι : Type t} [Small.{w} ι] {A B : ι → C} (f : ∀ i exact ⟨i, rfl⟩ exact ⟨small_of_surjective hφ⟩ -set_option backward.isDefEq.respectTransparency false in lemma isSmall_iff_eq_ofHoms : IsSmall.{w} W ↔ ∃ (ι : Type w) (A B : ι → C) (f : ∀ i, A i ⟶ B i), W = ofHoms f := by diff --git a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean index 1e467fe9450af8..4ede1bf09046c6 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean @@ -82,14 +82,12 @@ lemma pushouts_monotone : Monotone (pushouts (C := C)) := by rintro _ _ h _ _ _ ⟨_, _, _, _, _, hp, sq⟩ exact ⟨_, _, _, _, _, h _ hp, sq⟩ -set_option backward.isDefEq.respectTransparency false in instance : P.pushouts.RespectsIso := RespectsIso.of_respects_arrow_iso _ (by rintro q q' e ⟨A, B, p, f, g, hp, h⟩ exact ⟨A, B, p, f ≫ e.hom.left, g ≫ e.hom.right, hp, IsPushout.paste_horiz h (IsPushout.of_horiz_isIso ⟨e.hom.w⟩)⟩) -set_option backward.isDefEq.respectTransparency false in instance : P.pullbacks.RespectsIso := RespectsIso.of_respects_arrow_iso _ (by rintro q q' e ⟨X, Y, p, f, g, hp, h⟩ diff --git a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean index 95110fe29d5c97..c3209cc29684a2 100644 --- a/Mathlib/CategoryTheory/Shift/ShiftSequence.lean +++ b/Mathlib/CategoryTheory/Shift/ShiftSequence.lean @@ -60,7 +60,7 @@ class ShiftSequence where @[implicit_reducible] noncomputable def ShiftSequence.tautological : ShiftSequence F M where sequence n := shiftFunctor C n ⋙ F - isoZero := isoWhiskerRight (shiftFunctorZero C M) F ≪≫ F.rightUnitor + isoZero := isoWhiskerRight (shiftFunctorZero C M) F ≪≫ F.leftUnitor shiftIso n a a' ha' := (Functor.associator _ _ _).symm ≪≫ isoWhiskerRight (shiftFunctorAdd' C n a a' ha').symm _ shiftIso_zero a := by diff --git a/Mathlib/CategoryTheory/Sites/Grothendieck.lean b/Mathlib/CategoryTheory/Sites/Grothendieck.lean index 087d5427a22a7c..c990e6239237d3 100644 --- a/Mathlib/CategoryTheory/Sites/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Sites/Grothendieck.lean @@ -347,7 +347,6 @@ theorem bot_covers (S : Sieve X) (f : Y ⟶ X) : (⊥ : GrothendieckTopology C). theorem top_covers (S : Sieve X) (f : Y ⟶ X) : (⊤ : GrothendieckTopology C).Covers S f := by simp [covers_iff] -set_option backward.isDefEq.respectTransparency false in lemma eq_top_iff (J : GrothendieckTopology C) : J = ⊤ ↔ ∀ X, ⊥ ∈ J X := by refine ⟨fun h ↦ h ▸ by simp, fun h ↦ ?_⟩ rw [_root_.eq_top_iff] diff --git a/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean b/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean index dec9f482d85eb1..9ac93937563bb8 100644 --- a/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean +++ b/Mathlib/CategoryTheory/Sites/PrecoverageToGrothendieck.lean @@ -72,7 +72,6 @@ lemma generate_mem_toGrothendieck {X : C} {R : Presieve X} (hR : R ∈ J X) : Sieve.generate R ∈ J.toGrothendieck X := .of _ _ hR -set_option backward.isDefEq.respectTransparency false in /-- An alternative characterization of the Grothendieck topology associated to a precoverage `J`: it is the infimum of all Grothendieck topologies containing `Sieve.generate S` for all presieves @@ -312,12 +311,10 @@ lemma galoisConnection_toGrothendieck_toPrecoverage : end Precoverage -set_option backward.isDefEq.respectTransparency false in @[simp, grind =] lemma Precoverage.toGrothendieck_bot : toGrothendieck (⊥ : Precoverage C) = ⊥ := (galoisConnection_toGrothendieck_toPrecoverage C).l_bot -set_option backward.isDefEq.respectTransparency false in @[simp, grind =] lemma GrothendieckTopology.toPrecoverage_top : toPrecoverage (⊤ : GrothendieckTopology C) = ⊤ := (Precoverage.galoisConnection_toGrothendieck_toPrecoverage C).u_top diff --git a/Mathlib/CategoryTheory/Sites/Pretopology.lean b/Mathlib/CategoryTheory/Sites/Pretopology.lean index 0b7b1da9024d33..2092307cd57d1d 100644 --- a/Mathlib/CategoryTheory/Sites/Pretopology.lean +++ b/Mathlib/CategoryTheory/Sites/Pretopology.lean @@ -212,7 +212,6 @@ instance orderBot : OrderBot (Pretopology C) where rintro ⟨Y, f, hf, rfl⟩ exact K.has_isos f -set_option backward.isDefEq.respectTransparency false in /-- The trivial pretopology induces the trivial Grothendieck topology. -/ theorem toGrothendieck_bot : toGrothendieck (C := C) ⊥ = ⊥ := (gi C).gc.l_bot diff --git a/Mathlib/CategoryTheory/Sites/Spaces.lean b/Mathlib/CategoryTheory/Sites/Spaces.lean index 6a7400bad5b23c..9f424a1beef31f 100644 --- a/Mathlib/CategoryTheory/Sites/Spaces.lean +++ b/Mathlib/CategoryTheory/Sites/Spaces.lean @@ -57,7 +57,6 @@ def grothendieckTopology : GrothendieckTopology (Opens T) where rcases hR hf _ hU with ⟨V, g, hg, hV⟩ exact ⟨_, g ≫ f, hg, hV⟩ -set_option backward.isDefEq.respectTransparency false in /-- The Grothendieck pretopology associated to a topological space. -/ def pretopology : Pretopology (Opens T) where coverings X := {R | ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), R f ∧ x ∈ U} @@ -73,7 +72,6 @@ def pretopology : Pretopology (Opens T) where rcases hTi f hf x hU with ⟨V, g, hg, hV⟩ exact ⟨_, _, ⟨_, g, f, hf, hg, rfl⟩, hV⟩ -set_option backward.isDefEq.respectTransparency false in /-- The pretopology associated to a space is the largest pretopology that generates the Grothendieck topology associated to the space. -/ @[simp] @@ -87,7 +85,6 @@ theorem toPretopology_grothendieckTopology : rcases hR x hx with ⟨U, f, hf, hU⟩ exact ⟨U, f, Sieve.le_generate R U _ hf, hU⟩ -set_option backward.isDefEq.respectTransparency false in /-- The pretopology associated to a space induces the Grothendieck topology associated to the space. -/ @[simp] diff --git a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean index b53c3e024b96f3..e2b7aac1f7a85b 100644 --- a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean +++ b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean @@ -442,7 +442,6 @@ lemma πObj_naturality {f g : Arrow C} (φ : f ⟶ g) : rw [← assoc] apply comp_id -set_option backward.isDefEq.respectTransparency false 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`. -/ @[simps] diff --git a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean index 8cecbd6f36a64c..84f32407b32c63 100644 --- a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean +++ b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean @@ -212,10 +212,9 @@ theorem rothNumberNat_le_ruzsaSzemerediNumberNat' : mul_le_mul_of_nonneg_right ?_ (Nat.cast_nonneg _) _ ≤ (ruzsaSzemerediNumberNat (6 * (n / 6) + 3) : ℝ) := ?_ _ ≤ _ := by grw [Nat.mul_div_le] - · norm_num + · simp only [cast_add, cast_ofNat, cast_mul, cast_one, tsub_le_iff_right] rw [← div_add_one (three_ne_zero' ℝ), ← le_sub_iff_add_le, div_le_iff₀ (zero_lt_three' ℝ), - add_assoc, add_sub_assoc, add_mul, mul_right_comm] - norm_num + add_assoc, add_sub_assoc, add_mul, mul_right_comm, add_sub_cancel_left] norm_cast rw [← mul_add_one] exact (Nat.lt_mul_div_succ _ <| by simp).le diff --git a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean index a8976fcfe16ed7..dc25d0afbcfa1a 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Acyclic.lean @@ -491,7 +491,6 @@ 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 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/Cayley.lean b/Mathlib/Combinatorics/SimpleGraph/Cayley.lean index b686ebd9e34893..2fe8715424ccea 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Cayley.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Cayley.lean @@ -64,7 +64,6 @@ instance [Fintype M] [DecidableEq M] [DecidablePred (· ∈ s)] : DecidableRel (mulCayley s).Adj := fun u v => decidable_of_iff (u ≠ v ∧ ∃ g ∈ s, u * g = v ∨ u = v * g) (mulCayley_adj' s u v).symm -set_option backward.isDefEq.respectTransparency false in variable (M) in /-- `mulCayley` is a left (order-)adjoint. -/ @[to_additive] @@ -81,7 +80,6 @@ theorem mulCayley_monotone : Monotone (mulCayley (M := M) ·) := theorem mulCayley_mono {U V : Set M} (hUV : U ⊆ V) : mulCayley U ≤ mulCayley V := mulCayley_monotone hUV -set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem mulCayley_empty : mulCayley (∅ : Set M) = ⊥ := (mulCayley_gc M).l_bot diff --git a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean index c0f5e2e8dc798d..b85ac2497786bf 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Connectivity/Finite.lean @@ -85,7 +85,6 @@ end Fintype infinite components. -/ abbrev oddComponents : Set G.ConnectedComponent := {c : G.ConnectedComponent | Odd c.supp.ncard} -set_option backward.isDefEq.respectTransparency 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 diff --git a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean index fc400244654d42..fc80ac86a5696c 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Extremal/Turan.lean @@ -181,7 +181,6 @@ lemma not_adj_iff_part_eq [DecidableEq V] : change t ∈ fp.part s ↔ fp.part s = fp.part t rw [fp.mem_part_iff_part_eq_part (mem_univ t) (mem_univ s), eq_comm] -set_option backward.isDefEq.respectTransparency false in lemma degree_eq_card_sub_part_card [DecidableEq V] : G.degree s = card V - #(h.finpartition.part s) := calc diff --git a/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean b/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean index 3b7f1e38303a4a..17cbb462f70343 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Regularity/Chunk.lean @@ -442,13 +442,12 @@ private theorem edgeDensity_star_not_uniform [Nonempty α] have hqt : |q - t| ≤ ε ^ 5 / 49 := by have := average_density_near_total_density hPα hPε hε₁ (Subset.refl (chunk hP G ε hU).parts) (Subset.refl (chunk hP G ε hV).parts) - simp_rw [← sup_eq_biUnion, sup_parts, card_chunk (m_pos hPα).ne', cast_pow] at this - norm_num at this - exact this + simpa [← sup_eq_biUnion, sup_parts, card_chunk (m_pos hPα).ne'] have hε' : ε ^ 5 ≤ ε := by simpa using pow_le_pow_of_le_one (by sz_positivity) hε₁ (show 1 ≤ 5 by simp) grind +set_option linter.flexible false in -- TODO: fix non-terminal simp /-- Lower bound on the edge densities between non-uniform parts of `SzemerediRegularity.increment`. -/ theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : #P.parts * 16 ^ #P.parts ≤ card α) @@ -477,7 +476,7 @@ theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : #P.parts * 16 ^ #P.p refine le_trans ?_ (mul_le_mul_of_nonneg_right UVl ?_) · norm_num nlinarith - · norm_num + · simp positivity _ ≤ (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts, (G.edgeDensity ab.1 ab.2 : ℝ) ^ 2) / ↑16 ^ #P.parts := by @@ -493,8 +492,7 @@ theorem edgeDensity_chunk_not_uniform [Nonempty α] (hPα : #P.parts * 16 ^ #P.p norm_num at this exact this · simp_rw [sp, card_product, card_chunk (m_pos hPα).ne', ← mul_pow] - norm_num - exact edgeDensity_star_not_uniform hPα hPε hε₁ hUVne hUV + simpa using edgeDensity_star_not_uniform hPα hPε hε₁ hUVne hUV · rw [sp, card_product] apply (edgeDensity_chunk_aux hP hPα hPε hU hV).trans · rw [card_chunk (m_pos hPα).ne', card_chunk (m_pos hPα).ne', ← mul_pow] diff --git a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean index 811941d32904b9..d53e9234cef80d 100644 --- a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean +++ b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean @@ -54,7 +54,6 @@ structure IsSRGWith (n k ℓ μ : ℕ) : Prop where variable {G} {n k ℓ μ : ℕ} -set_option backward.isDefEq.respectTransparency false in /-- Empty graphs are strongly regular. Note that `ℓ` can take any value for empty graphs, since there are no pairs of adjacent vertices. -/ theorem bot_strongly_regular : (⊥ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 ℓ 0 where diff --git a/Mathlib/Data/ENNReal/Action.lean b/Mathlib/Data/ENNReal/Action.lean index ae5bfd71d5d8bd..079af559e8e417 100644 --- a/Mathlib/Data/ENNReal/Action.lean +++ b/Mathlib/Data/ENNReal/Action.lean @@ -79,7 +79,6 @@ theorem smul_top {R : Type*} [Semiring R] [IsDomain R] [Module R ℝ≥0∞] [Is lemma nnreal_smul_lt_top {x : ℝ≥0} {y : ℝ≥0∞} (hy : y < ⊤) : x • y < ⊤ := mul_lt_top (by simp) hy lemma nnreal_smul_ne_top {x : ℝ≥0} {y : ℝ≥0∞} (hy : y ≠ ⊤) : x • y ≠ ⊤ := mul_ne_top (by simp) hy -set_option backward.isDefEq.respectTransparency false in lemma nnreal_smul_ne_top_iff {x : ℝ≥0} {y : ℝ≥0∞} (hx : x ≠ 0) : x • y ≠ ⊤ ↔ y ≠ ⊤ := ⟨by rintro h rfl; simp [smul_top (R := ℝ≥0), hx] at h, nnreal_smul_ne_top⟩ diff --git a/Mathlib/Data/Finset/Lattice/Prod.lean b/Mathlib/Data/Finset/Lattice/Prod.lean index 4f66e2d5f7d4ba..0b9096a0ef3882 100644 --- a/Mathlib/Data/Finset/Lattice/Prod.lean +++ b/Mathlib/Data/Finset/Lattice/Prod.lean @@ -24,8 +24,6 @@ variable {F α β γ ι κ : Type*} namespace Finset -/-! ### sup -/ - section Sup @@ -33,10 +31,12 @@ section Sup variable [SemilatticeSup α] [OrderBot α] /-- See also `Finset.product_biUnion`. -/ +@[to_dual inf_product_left] theorem sup_product_left (s : Finset β) (t : Finset γ) (f : β × γ → α) : (s ×ˢ t).sup f = s.sup fun i => t.sup fun i' => f ⟨i, i'⟩ := eq_of_forall_ge_iff fun a => by simp [@forall_comm _ γ] +@[to_dual inf_product_right] theorem sup_product_right (s : Finset β) (t : Finset γ) (f : β × γ → α) : (s ×ˢ t).sup f = t.sup fun i' => s.sup fun i => f ⟨i, i'⟩ := by rw [sup_product_left, Finset.sup_comm] @@ -45,7 +45,8 @@ section Prod variable {ι κ α β : Type*} [SemilatticeSup α] [SemilatticeSup β] [OrderBot α] [OrderBot β] {s : Finset ι} {t : Finset κ} -@[simp] lemma sup_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : +@[to_dual (attr := simp)] +lemma sup_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : sup (s ×ˢ t) (Prod.map f g) = (sup s f, sup t g) := eq_of_forall_ge_iff fun i ↦ by obtain ⟨a, ha⟩ := hs @@ -57,58 +58,17 @@ end Prod end Sup -/-! ### inf -/ - - -section Inf - --- TODO: define with just `[Top α]` where some lemmas hold without requiring `[OrderTop α]` -variable [SemilatticeInf α] [OrderTop α] - -theorem inf_product_left (s : Finset β) (t : Finset γ) (f : β × γ → α) : - (s ×ˢ t).inf f = s.inf fun i => t.inf fun i' => f ⟨i, i'⟩ := - @sup_product_left αᵒᵈ _ _ _ _ _ _ _ - -theorem inf_product_right (s : Finset β) (t : Finset γ) (f : β × γ → α) : - (s ×ˢ t).inf f = t.inf fun i' => s.inf fun i => f ⟨i, i'⟩ := - @sup_product_right αᵒᵈ _ _ _ _ _ _ _ - -section Prod -variable {ι κ α β : Type*} [SemilatticeInf α] [SemilatticeInf β] [OrderTop α] [OrderTop β] - {s : Finset ι} {t : Finset κ} - -@[simp] lemma inf_prodMap (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : - inf (s ×ˢ t) (Prod.map f g) = (inf s f, inf t g) := - sup_prodMap (α := αᵒᵈ) (β := βᵒᵈ) hs ht _ _ - -end Prod - -end Inf - section DistribLattice variable [DistribLattice α] -section OrderBot - variable [OrderBot α] {s : Finset ι} {t : Finset κ} {f : ι → α} {g : κ → α} {a : α} +@[to_dual] theorem sup_inf_sup (s : Finset ι) (t : Finset κ) (f : ι → α) (g : κ → α) : s.sup f ⊓ t.sup g = (s ×ˢ t).sup fun i => f i.1 ⊓ g i.2 := by simp_rw [Finset.sup_inf_distrib_right, Finset.sup_inf_distrib_left, sup_product_left] -end OrderBot - -section OrderTop - -variable [OrderTop α] {f : ι → α} {g : κ → α} {s : Finset ι} {t : Finset κ} {a : α} - -theorem inf_sup_inf (s : Finset ι) (t : Finset κ) (f : ι → α) (g : κ → α) : - s.inf f ⊔ t.inf g = (s ×ˢ t).inf fun i => f i.1 ⊔ g i.2 := - @sup_inf_sup αᵒᵈ _ _ _ _ _ _ _ _ - -end OrderTop - end DistribLattice section Sup' @@ -117,10 +77,12 @@ variable [SemilatticeSup α] variable {s : Finset β} (H : s.Nonempty) (f : β → α) +@[to_dual inf'_product_left] theorem sup'_product_left {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : (s ×ˢ t).sup' h f = s.sup' h.fst fun i => t.sup' h.snd fun i' => f ⟨i, i'⟩ := eq_of_forall_ge_iff fun a => by simp [@forall_comm _ γ] +@[to_dual inf'_product_right] theorem sup'_product_right {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : (s ×ˢ t).sup' h f = t.sup' h.snd fun i' => s.sup' h.fst fun i => f ⟨i, i'⟩ := by rw [sup'_product_left, Finset.sup'_comm] @@ -129,6 +91,7 @@ section Prod variable {ι κ α β : Type*} [SemilatticeSup α] [SemilatticeSup β] {s : Finset ι} {t : Finset κ} /-- See also `Finset.sup'_prodMap`. -/ +@[to_dual /-- See also `Finset.inf'_prodMap`. -/] lemma prodMk_sup'_sup' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : (sup' s hs f, sup' t ht g) = sup' (s ×ˢ t) (hs.product ht) (Prod.map f g) := eq_of_forall_ge_iff fun i ↦ by @@ -138,7 +101,8 @@ lemma prodMk_sup'_sup' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : exact ⟨by simp_all, fun h ↦ ⟨fun i hi ↦ (h _ _ hi hb).1, fun j hj ↦ (h _ _ ha hj).2⟩⟩ /-- See also `Finset.prodMk_sup'_sup'`. -/ --- @[simp] -- TODO: Why does `Prod.map_apply` simplify the LHS? +@[to_dual -- (attr := simp) -- TODO: Why does `Prod.map_apply` simplify the LHS? +/-- See also `Finset.prodMk_inf'_inf'`. -/] lemma sup'_prodMap (hst : (s ×ˢ t).Nonempty) (f : ι → α) (g : κ → β) : sup' (s ×ˢ t) hst (Prod.map f g) = (sup' s hst.fst f, sup' t hst.snd g) := (prodMk_sup'_sup' _ _ _ _).symm @@ -147,50 +111,15 @@ end Prod end Sup' -section Inf' - -variable [SemilatticeInf α] - -variable {s : Finset β} (H : s.Nonempty) (f : β → α) - -theorem inf'_product_left {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : - (s ×ˢ t).inf' h f = s.inf' h.fst fun i => t.inf' h.snd fun i' => f ⟨i, i'⟩ := - sup'_product_left (α := αᵒᵈ) h f - -theorem inf'_product_right {t : Finset γ} (h : (s ×ˢ t).Nonempty) (f : β × γ → α) : - (s ×ˢ t).inf' h f = t.inf' h.snd fun i' => s.inf' h.fst fun i => f ⟨i, i'⟩ := - sup'_product_right (α := αᵒᵈ) h f - -section Prod -variable {ι κ α β : Type*} [SemilatticeInf α] [SemilatticeInf β] {s : Finset ι} {t : Finset κ} - -/-- See also `Finset.inf'_prodMap`. -/ -lemma prodMk_inf'_inf' (hs : s.Nonempty) (ht : t.Nonempty) (f : ι → α) (g : κ → β) : - (inf' s hs f, inf' t ht g) = inf' (s ×ˢ t) (hs.product ht) (Prod.map f g) := - prodMk_sup'_sup' (α := αᵒᵈ) (β := βᵒᵈ) hs ht _ _ - -/-- See also `Finset.prodMk_inf'_inf'`. -/ --- @[simp] -- TODO: Why does `Prod.map_apply` simplify the LHS? -lemma inf'_prodMap (hst : (s ×ˢ t).Nonempty) (f : ι → α) (g : κ → β) : - inf' (s ×ˢ t) hst (Prod.map f g) = (inf' s hst.fst f, inf' t hst.snd g) := - (prodMk_inf'_inf' _ _ _ _).symm - -end Prod - -end Inf' - section DistribLattice variable [DistribLattice α] {s : Finset ι} {t : Finset κ} (hs : s.Nonempty) (ht : t.Nonempty) {f : ι → α} {g : κ → α} {a : α} +@[to_dual] theorem sup'_inf_sup' (f : ι → α) (g : κ → α) : s.sup' hs f ⊓ t.sup' ht g = (s ×ˢ t).sup' (hs.product ht) fun i => f i.1 ⊓ g i.2 := by simp_rw [Finset.sup'_inf_distrib_right, Finset.sup'_inf_distrib_left, sup'_product_left] -theorem inf'_sup_inf' (f : ι → α) (g : κ → α) : - s.inf' hs f ⊔ t.inf' ht g = (s ×ˢ t).inf' (hs.product ht) fun i => f i.1 ⊔ g i.2 := - @sup'_inf_sup' αᵒᵈ _ _ _ _ _ hs ht _ _ - end DistribLattice end Finset diff --git a/Mathlib/Data/Nat/PowModTotient.lean b/Mathlib/Data/Nat/PowModTotient.lean deleted file mode 100644 index d6f75577e89ada..00000000000000 --- a/Mathlib/Data/Nat/PowModTotient.lean +++ /dev/null @@ -1,8 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Data.Nat.Totient -public import Mathlib.Data.Sym.Sym2 -public import Mathlib.Tactic.NormNum.GCD -public import Mathlib.Tactic.Positivity - -deprecated_module (since := "2025-09-19") diff --git a/Mathlib/Data/Real/Irrational.lean b/Mathlib/Data/Real/Irrational.lean deleted file mode 100644 index e3386c4f2cdc1d..00000000000000 --- a/Mathlib/Data/Real/Irrational.lean +++ /dev/null @@ -1,5 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Data.Real.Sqrt - -deprecated_module (since := "2025-10-13") diff --git a/Mathlib/Data/Set/Finite/Lattice.lean b/Mathlib/Data/Set/Finite/Lattice.lean index 2d7257d8473a03..eb09529ebba061 100644 --- a/Mathlib/Data/Set/Finite/Lattice.lean +++ b/Mathlib/Data/Set/Finite/Lattice.lean @@ -282,6 +282,7 @@ theorem Infinite.sUnion {s : Set (Set α)} (hs : s.Infinite) : (⋃₀ s).Infini /-! ### Order properties -/ +@[to_dual] lemma map_finite_biSup {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] [SupBotHomClass F α β] {s : Set ι} (hs : s.Finite) (f : F) (g : ι → α) : f (⨆ x ∈ s, g x) = ⨆ x ∈ s, f (g x) := by @@ -289,25 +290,14 @@ lemma map_finite_biSup {F ι : Type*} [CompleteLattice α] [CompleteLattice β] simp only [Finset.sup_eq_iSup, hs.mem_toFinset, comp_apply] at this exact this -lemma map_finite_biInf {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] - [InfTopHomClass F α β] {s : Set ι} (hs : s.Finite) (f : F) (g : ι → α) : - f (⨅ x ∈ s, g x) = ⨅ x ∈ s, f (g x) := by - have := map_finset_inf f hs.toFinset g - simp only [Finset.inf_eq_iInf, hs.mem_toFinset, comp_apply] at this - exact this - +@[to_dual] lemma map_finite_iSup {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] [SupBotHomClass F α β] [Finite ι] (f : F) (g : ι → α) : f (⨆ i, g i) = ⨆ i, f (g i) := by rw [← iSup_univ (f := g), ← iSup_univ (f := fun i ↦ f (g i))] exact map_finite_biSup finite_univ f g -lemma map_finite_iInf {F ι : Type*} [CompleteLattice α] [CompleteLattice β] [FunLike F α β] - [InfTopHomClass F α β] [Finite ι] (f : F) (g : ι → α) : - f (⨅ i, g i) = ⨅ i, f (g i) := by - rw [← iInf_univ (f := g), ← iInf_univ (f := fun i ↦ f (g i))] - exact map_finite_biInf finite_univ f g - +@[to_dual] theorem Finite.iSup_biInf_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι'] [Order.Frame α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} (hf : ∀ i ∈ s, Monotone (f i)) : ⨆ j, ⨅ i ∈ s, f i j = ⨅ i ∈ s, ⨆ j, f i j := by @@ -318,41 +308,24 @@ theorem Finite.iSup_biInf_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonemp simp only [iInf_insert, ← ihs hf.2] exact iSup_inf_of_monotone hf.1 fun j₁ j₂ hj => iInf₂_mono fun i hi => hf.2 i hi hj +@[to_dual] theorem Finite.iSup_biInf_of_antitone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι'] [Order.Frame α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} (hf : ∀ i ∈ s, Antitone (f i)) : ⨆ j, ⨅ i ∈ s, f i j = ⨅ i ∈ s, ⨆ j, f i j := @Finite.iSup_biInf_of_monotone ι ι'ᵒᵈ α _ _ _ _ _ hs _ fun i hi => (hf i hi).dual_left -theorem Finite.iInf_biSup_of_monotone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] - [IsCodirectedOrder ι'] [Order.Coframe α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} - (hf : ∀ i ∈ s, Monotone (f i)) : ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j := - hs.iSup_biInf_of_antitone (α := αᵒᵈ) fun i hi => (hf i hi).dual_right - -theorem Finite.iInf_biSup_of_antitone {ι ι' α : Type*} [Preorder ι'] [Nonempty ι'] - [IsDirectedOrder ι'] [Order.Coframe α] {s : Set ι} (hs : s.Finite) {f : ι → ι' → α} - (hf : ∀ i ∈ s, Antitone (f i)) : ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j := - hs.iSup_biInf_of_monotone (α := αᵒᵈ) fun i hi => (hf i hi).dual_right - +@[to_dual] theorem _root_.iSup_iInf_of_monotone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι'] [Order.Frame α] {f : ι → ι' → α} (hf : ∀ i, Monotone (f i)) : ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j := by simpa only [iInf_univ] using finite_univ.iSup_biInf_of_monotone fun i _ => hf i +@[to_dual] theorem _root_.iSup_iInf_of_antitone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι'] [Order.Frame α] {f : ι → ι' → α} (hf : ∀ i, Antitone (f i)) : ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j := @iSup_iInf_of_monotone ι ι'ᵒᵈ α _ _ _ _ _ _ fun i => (hf i).dual_left -theorem _root_.iInf_iSup_of_monotone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] - [IsCodirectedOrder ι'] [Order.Coframe α] {f : ι → ι' → α} (hf : ∀ i, Monotone (f i)) : - ⨅ j, ⨆ i, f i j = ⨆ i, ⨅ j, f i j := - iSup_iInf_of_antitone (α := αᵒᵈ) fun i => (hf i).dual_right - -theorem _root_.iInf_iSup_of_antitone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι'] - [IsDirectedOrder ι'] [Order.Coframe α] {f : ι → ι' → α} (hf : ∀ i, Antitone (f i)) : - ⨅ j, ⨆ i, f i j = ⨆ i, ⨅ j, f i j := - iSup_iInf_of_monotone (α := αᵒᵈ) fun i => (hf i).dual_right - @[deprecated (since := "2026-02-03")] protected alias iSup_iInf_of_monotone := iSup_iInf_of_monotone @[deprecated (since := "2026-02-03")] protected alias iSup_iInf_of_antitone := iSup_iInf_of_antitone @[deprecated (since := "2026-02-03")] protected alias iInf_iSup_of_monotone := iInf_iSup_of_monotone @@ -400,52 +373,32 @@ section variable [Preorder α] [IsDirectedOrder α] [Nonempty α] {s : Set α} /-- A finite set is bounded above. -/ +@[to_dual /-- A finite set is bounded below. -/] protected theorem Finite.bddAbove (hs : s.Finite) : BddAbove s := Finite.induction_on _ hs bddAbove_empty fun _ _ h => h.insert _ /-- A finite union of sets which are all bounded above is still bounded above. -/ +@[to_dual /-- A finite union of sets which are all bounded below is still bounded below. -/] theorem Finite.bddAbove_biUnion {I : Set β} {S : β → Set α} (H : I.Finite) : BddAbove (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddAbove (S i) := by induction I, H using Set.Finite.induction_on with | empty => simp only [biUnion_empty, bddAbove_empty, forall_mem_empty] | insert _ _ hs => simp only [biUnion_insert, forall_mem_insert, bddAbove_union, hs] +@[to_dual] theorem infinite_of_not_bddAbove : ¬BddAbove s → s.Infinite := mt Finite.bddAbove end -section - -variable [Preorder α] [IsCodirectedOrder α] [Nonempty α] {s : Set α} - -/-- A finite set is bounded below. -/ -protected theorem Finite.bddBelow (hs : s.Finite) : BddBelow s := - Finite.bddAbove (α := αᵒᵈ) hs - -/-- A finite union of sets which are all bounded below is still bounded below. -/ -theorem Finite.bddBelow_biUnion {I : Set β} {S : β → Set α} (H : I.Finite) : - BddBelow (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddBelow (S i) := - Finite.bddAbove_biUnion (α := αᵒᵈ) H - -theorem infinite_of_not_bddBelow : ¬BddBelow s → s.Infinite := mt Finite.bddBelow - -end - end Set -namespace Finset - /-- A finset is bounded above. -/ -protected theorem bddAbove [SemilatticeSup α] [Nonempty α] (s : Finset α) : BddAbove (↑s : Set α) := +@[to_dual /-- A finset is bounded below. -/] +protected theorem Finset.bddAbove [SemilatticeSup α] [Nonempty α] (s : Finset α) : + BddAbove (↑s : Set α) := s.finite_toSet.bddAbove -/-- A finset is bounded below. -/ -protected theorem bddBelow [SemilatticeInf α] [Nonempty α] (s : Finset α) : BddBelow (↑s : Set α) := - s.finite_toSet.bddBelow - -end Finset - section LinearOrder variable [LinearOrder α] {s : Set α} diff --git a/Mathlib/Deprecated/Sort.lean b/Mathlib/Deprecated/Sort.lean deleted file mode 100644 index 3878104b79bcc4..00000000000000 --- a/Mathlib/Deprecated/Sort.lean +++ /dev/null @@ -1,72 +0,0 @@ -/- -Copyright (c) 2016 Jeremy Avigad. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Jeremy Avigad --/ -module - -public import Mathlib.Init -public import Batteries.Tactic.Alias - -/-! -### The predicate `List.Sorted` (now deprecated). --/ - -@[expose] public section - -namespace List - -universe u v - -section Sorted - -variable {α : Type u} {r : α → α → Prop} {a : α} {l : List α} - -/-- `Sorted r l` is the same as `List.Pairwise r l` and has been deprecated. -Consider using any of `SortedLE`, `SortedLT`, `SortedGE`, or `SortedGT` if the relation you're - using is a preorder. -/ -@[deprecated (since := "2025-10-11")] -alias Sorted := Pairwise - -set_option linter.deprecated false - -/-- Deprecated decidable instance for `Sorted`. -/ -@[deprecated List.instDecidablePairwise (since := "2025-10-11")] -def decidableSorted [DecidableRel r] (l : List α) : Decidable (Sorted r l) := - List.instDecidablePairwise l - -@[deprecated Pairwise.nil (since := "2025-10-11")] -theorem sorted_nil : Sorted r [] := Pairwise.nil - -@[deprecated Pairwise.of_cons (since := "2025-10-11")] -theorem Sorted.of_cons (p : Sorted r (a :: l)) : - Sorted r l := Pairwise.of_cons p - -@[deprecated Pairwise.tail (since := "2025-10-11")] -theorem Sorted.tail (h : Sorted r l) : Sorted r l.tail := Pairwise.tail h - -@[deprecated rel_of_pairwise_cons (since := "2025-10-11")] -theorem rel_of_sorted_cons (p : Sorted r (a :: l)) - {a' : α} : a' ∈ l → r a a' := rel_of_pairwise_cons p - -@[deprecated pairwise_cons (since := "2025-10-11")] -theorem sorted_cons : Sorted r (a :: l) ↔ (∀ a' ∈ l, r a a') ∧ Sorted r l := pairwise_cons - -@[deprecated Pairwise.filter (since := "2025-10-11")] -theorem Sorted.filter (p : α → Bool) : Sorted r l → Sorted r (filter p l) := Pairwise.filter p - -@[deprecated pairwise_singleton (since := "2025-10-11")] -theorem sorted_singleton (r) (a : α) : Sorted r [a] := pairwise_singleton r a - -@[deprecated Pairwise.rel_of_mem_take_of_mem_drop (since := "2025-10-11")] -theorem Sorted.rel_of_mem_take_of_mem_drop {x y i} (h : Sorted r l) - (hx : x ∈ take i l) (hy : y ∈ drop i l) : r x y := Pairwise.rel_of_mem_take_of_mem_drop h hx hy - -@[deprecated Pairwise.filterMap (since := "2025-10-11")] -theorem Sorted.filterMap (f) {s : α → α → Prop} - (H : ∀ (a a' : α), r a a' → ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → s b b') : - Sorted r l → Sorted s (filterMap f l) := Pairwise.filterMap f H - -end Sorted - -end List diff --git a/Mathlib/FieldTheory/Perfect.lean b/Mathlib/FieldTheory/Perfect.lean index ba19ea9f9b42ac..3e55bcb56a8448 100644 --- a/Mathlib/FieldTheory/Perfect.lean +++ b/Mathlib/FieldTheory/Perfect.lean @@ -52,6 +52,8 @@ section PerfectRing section Monoid variable (M : Type*) (p q : ℕ) [CommMonoid M] [PerfectRing M p] [PerfectRing M q] +namespace PerfectRing + instance one : PerfectRing M 1 := ⟨by simpa using bijective_id⟩ @@ -61,6 +63,8 @@ instance mul : PerfectRing M (p * q) := instance pow (n : ℕ) : PerfectRing M (p ^ n) := n.recOn (inferInstanceAs (PerfectRing M 1)) fun n _ ↦ inferInstanceAs (PerfectRing M (p ^ n * p)) +end PerfectRing + /-- The `p`-th power automorphism for a perfect monoid. -/ @[simps! apply] noncomputable def powMulEquiv : M ≃* M := diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean index e4898d122d1f44..495960d7bbe65b 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/TriangleInequality.lean @@ -91,7 +91,7 @@ lemma angle_le_angle_add_angle_aux : · simp [hxy, real_inner_comm, ← sub_eq_zero] rw [NormedSpace.normalize, real_inner_smul_right, inner_sub_right, real_inner_smul_right, real_inner_self_eq_norm_sq, hx, real_inner_comm y, ← sq, mul_smul, ← smul_assoc] - norm_num + simp only [one_pow, smul_eq_mul] have H : 1 - ⟪x, y⟫ ^ 2 ≠ 0 := by rw [sub_ne_zero, ne_comm, sq_ne_one_iff] constructor <;> contrapose! hxy @@ -123,7 +123,7 @@ lemma angle_le_angle_add_angle_of_norm_eq_one : angle x z ≤ angle x y + angle simp only [inner_add_left, inner_add_right, real_inner_smul_left, real_inner_smul_right, real_inner_comm y (normalize _), real_inner_self_eq_norm_sq, hy, angle_comm z y, inner_normalize_ortho] at H1 - norm_num at H1 + simp only [one_pow, mul_one, mul_zero, add_zero, zero_add] at H1 rw [mul_comm (Real.cos (angle y z))] at H1 rw [Real.cos_add, ← inner_eq_cos_angle_of_norm_eq_one hx hz, H1] have H2 : -1 ≤ ⟪normalize (ortho y x), normalize (ortho y z)⟫ := by @@ -169,7 +169,7 @@ lemma angle_expression_of_angle_eq_angle_sum : simp only [inner_add_left, inner_add_right, real_inner_smul_left, real_inner_smul_right, real_inner_comm y (normalize _), real_inner_self_eq_norm_sq, hy, angle_comm z y, inner_normalize_ortho] at H6 - norm_num at H6 + simp only [one_pow, mul_one, mul_zero, add_zero, zero_add] at H6 rw [inner_eq_cos_angle_of_norm_eq_one hx hz, H0, Real.cos_add] at H6 ring_nf at H6 have Hw : Real.sin (angle x y) * Real.sin (angle y z) ≠ 0 := by diff --git a/Mathlib/Geometry/Euclidean/Projection.lean b/Mathlib/Geometry/Euclidean/Projection.lean index 1946864ca8e160..da214a27239471 100644 --- a/Mathlib/Geometry/Euclidean/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Projection.lean @@ -478,8 +478,7 @@ theorem reflection_eq_iff_orthogonalProjection_eq (s₁ s₂ : AffineSubspace rw [← @vsub_eq_zero_iff_eq V, vsub_vadd_eq_vsub_sub, vadd_vsub_assoc, add_comm, add_sub_assoc, vsub_sub_vsub_cancel_right, ← two_smul 𝕜 ((orthogonalProjection s₁ p : P) -ᵥ orthogonalProjection s₂ p), smul_eq_zero] at h - norm_num at h - exact h + simpa using h · intro h rw [h] diff --git a/Mathlib/Geometry/RingedSpace/Basic.lean b/Mathlib/Geometry/RingedSpace/Basic.lean index fd4768f7d3bbdc..693eca7ce19b68 100644 --- a/Mathlib/Geometry/RingedSpace/Basic.lean +++ b/Mathlib/Geometry/RingedSpace/Basic.lean @@ -197,7 +197,6 @@ theorem basicOpen_mul {U : Opens X} (f g : X.presheaf.obj (op U)) : · simp [mem_basicOpen (hx := hx)] · simp [mt (basicOpen_le X _ ·) hx] -set_option backward.isDefEq.respectTransparency false in @[simp] lemma basicOpen_pow {U : Opens X} (f : X.presheaf.obj (op U)) (n : ℕ) (h : 0 < n) : X.basicOpen (f ^ n) = X.basicOpen f := by diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean index 9368ba12de37e7..7bbc6186be85c5 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace.lean @@ -309,7 +309,6 @@ instance {X : LocallyRingedSpace.{u}} : Unique (∅ ⟶ X) where noncomputable def emptyIsInitial : Limits.IsInitial (∅ : LocallyRingedSpace.{u}) := Limits.IsInitial.ofUnique _ -set_option backward.isDefEq.respectTransparency false in -- This actually holds for all ringed spaces with nontrivial stalks. theorem basicOpen_zero (X : LocallyRingedSpace.{u}) (U : Opens X.carrier) : X.toRingedSpace.basicOpen (0 : X.presheaf.obj <| op U) = ⊥ := by diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean index 0cb1ff85945054..3ee14943016d9b 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/ResidueField.lean @@ -75,7 +75,6 @@ lemma evaluation_ne_zero_iff_mem_basicOpen (x : U) (f : X.presheaf.obj (op U)) : X.evaluation x f ≠ 0 ↔ x.val ∈ X.toRingedSpace.basicOpen f := by simp -set_option backward.isDefEq.respectTransparency false in lemma basicOpen_eq_bot_iff_forall_evaluation_eq_zero (f : X.presheaf.obj (op U)) : X.toRingedSpace.basicOpen f = ⊥ ↔ ∀ (x : U), X.evaluation x f = 0 := by simp only [evaluation_eq_zero_iff_notMem_basicOpen, Subtype.forall] diff --git a/Mathlib/GroupTheory/Coprod/Basic.lean b/Mathlib/GroupTheory/Coprod/Basic.lean index ca31e9d9f13434..2cdc9c603dd46e 100644 --- a/Mathlib/GroupTheory/Coprod/Basic.lean +++ b/Mathlib/GroupTheory/Coprod/Basic.lean @@ -604,7 +604,6 @@ theorem closure_range_inl_union_inr : Subgroup.closure (range (inl : G →* G ∗ H) ∪ range inr) = ⊤ := Subgroup.closure_eq_top_of_mclosure_eq_top mclosure_range_inl_union_inr -set_option backward.isDefEq.respectTransparency false in @[to_additive (attr := simp)] theorem range_inl_sup_range_inr : MonoidHom.range (inl : G →* G ∗ H) ⊔ MonoidHom.range inr = ⊤ := by rw [← closure_range_inl_union_inr, Subgroup.closure_union, ← MonoidHom.coe_range, @@ -620,7 +619,6 @@ theorem codisjoint_range_inl_range_inr : variable {K : Type*} [Group K] -set_option backward.isDefEq.respectTransparency false in @[to_additive] theorem range_eq (f : G ∗ H →* K) : MonoidHom.range f = MonoidHom.range (f.comp inl) ⊔ MonoidHom.range (f.comp inr) := by rw [MonoidHom.range_eq_map, ← range_inl_sup_range_inr, Subgroup.map_sup, MonoidHom.map_range, @@ -665,7 +663,6 @@ end MulOneClass variable (M N P : Type*) [Monoid M] [Monoid N] [Monoid P] -set_option backward.isDefEq.respectTransparency false in /-- A multiplicative equivalence between `(M ∗ N) ∗ P` and `M ∗ (N ∗ P)`. -/ @[to_additive /-- An additive equivalence between `AddMonoid.Coprod (AddMonoid.Coprod M N) P` and `AddMonoid.Coprod M (AddMonoid.Coprod N P)`. -/] diff --git a/Mathlib/GroupTheory/Coxeter/Basic.lean b/Mathlib/GroupTheory/Coxeter/Basic.lean index 3b7c50514bef1d..5b42e6b920c943 100644 --- a/Mathlib/GroupTheory/Coxeter/Basic.lean +++ b/Mathlib/GroupTheory/Coxeter/Basic.lean @@ -507,10 +507,7 @@ theorem prod_alternatingWord_eq_prod_alternatingWord_sub (i i' : B) (m : ℕ) (h rw [(by ring : ↑(M i i') * 2 - (2 * k + 1) = -1 + (-k + ↑(M i i')) * 2), (by ring : 2 * k + 1 = 1 + k * 2)] repeat rw [Int.add_mul_ediv_right _ _ (by simp)] - norm_num - rw [zpow_add, zpow_add, zpow_natCast, simple_mul_simple_pow', zpow_neg, ← inv_zpow, zpow_neg, - ← inv_zpow] - simp [← mul_assoc] + simp [zpow_add, simple_mul_simple_pow', ← inv_zpow, ← mul_assoc] /-- The two words of length `M i i'` that alternate between `i` and `i'` have the same product. This is known as the "braid relation" or "Artin-Tits relation". -/ diff --git a/Mathlib/GroupTheory/Divisible.lean b/Mathlib/GroupTheory/Divisible.lean index 355c4303a28933..85487cdc631b7b 100644 --- a/Mathlib/GroupTheory/Divisible.lean +++ b/Mathlib/GroupTheory/Divisible.lean @@ -229,8 +229,7 @@ def rootableByNatOfRootableByInt [RootableBy A ℤ] : RootableBy A ℕ where root_zero a := RootableBy.root_zero a root_cancel {n} a hn := by have := RootableBy.root_cancel a (show (n : ℤ) ≠ 0 from mod_cast hn) - norm_num at this - exact this + simpa end Group diff --git a/Mathlib/GroupTheory/Perm/Cycle/Type.lean b/Mathlib/GroupTheory/Perm/Cycle/Type.lean index ff5929640215ee..aeed8b9e53c3c8 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Type.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Type.lean @@ -154,7 +154,6 @@ theorem sum_cycleType (σ : Perm α) : σ.cycleType.sum = #σ.support := by theorem sum_cycleType_le (σ : Perm α) : σ.cycleType.sum ≤ Fintype.card α := σ.sum_cycleType ▸ Finset.card_le_univ σ.support -set_option backward.isDefEq.respectTransparency false in theorem card_fixedPoints (σ : Equiv.Perm α) : Fintype.card (Function.fixedPoints σ) = Fintype.card α - σ.cycleType.sum := by rw [Equiv.Perm.sum_cycleType, ← Finset.card_compl, Fintype.card_ofFinset] diff --git a/Mathlib/GroupTheory/SpecificGroups/Alternating.lean b/Mathlib/GroupTheory/SpecificGroups/Alternating.lean index 020a65a4e3df45..ca9655387bac24 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Alternating.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Alternating.lean @@ -352,6 +352,7 @@ theorem normalClosure_swap_mul_swap_five : SetLike.mem_coe.1 (subset_normalClosure (Set.mem_singleton _)) exact mul_mem (Subgroup.normalClosure_normal.conj_mem _ h g1) (inv_mem h) +set_option linter.flexible false in -- TODO: fix non-terminal simp /-- Shows that any non-identity element of $A_5$ whose cycle decomposition consists only of swaps is conjugate to $(04)(13)$. This is used to show that the normal closure of such a permutation in $A_5$ is $A_5$. -/ @@ -364,7 +365,7 @@ theorem isConj_swap_mul_swap_of_cycleType_two {g : Perm (Fin 5)} (ha : g ∈ alt have h : Multiset.card g.cycleType ≤ 3 := le_of_mul_le_mul_right (le_trans h (by norm_num only [card_fin])) (by simp) rw [mem_alternatingGroup, sign_of_cycleType, h2] at ha - norm_num at ha + simp at ha rw [pow_add, pow_mul, Int.units_pow_two, one_mul, neg_one_pow_eq_one_iff_even] at ha swap; · decide rw [isConj_iff_cycleType_eq, h2] diff --git a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean index 87721d871d20ed..42b73e2c582a4a 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean @@ -249,7 +249,7 @@ theorem orderOf_a [NeZero n] (i : ZMod (2 * n)) : theorem exponent : Monoid.exponent (QuaternionGroup n) = 2 * lcm n 2 := by rw [← normalize_eq 2, ← lcm_mul_left, normalize_eq] - norm_num + simp only [Nat.reduceMul] rcases eq_zero_or_neZero n with rfl | hn · simp only [lcm_zero_left, mul_zero] exact Monoid.exponent_eq_zero_of_order_zero orderOf_a_one diff --git a/Mathlib/InformationTheory/Coding/KraftMcMillan.lean b/Mathlib/InformationTheory/Coding/KraftMcMillan.lean index 4b76217a5faf4d..d0e594ee4cf964 100644 --- a/Mathlib/InformationTheory/Coding/KraftMcMillan.lean +++ b/Mathlib/InformationTheory/Coding/KraftMcMillan.lean @@ -91,6 +91,7 @@ private lemma concatFn_length_mem_Icc {S : Finset (List α)} · -- upper bound exact (Finset.sum_le_sum (fun i _ => Finset.le_sup (w i).prop)).trans_eq (by simp) +set_option linter.flexible false in -- TODO: fix non-terminal simp /-- Auxiliary bound for Kraft–McMillan. If `S` is a finite uniquely decodable code and `1 ≤ r`, then the `r`-th power of its Kraft sum @@ -136,7 +137,8 @@ private lemma kraft_mcmillan_inequality_aux {S : Finset (List α)} [Fintype α] apply le_trans (Finset.sum_le_sum (fun _ _ => sum_pow_length_filter_eq_le_card_mul)) -- Summing these bounds over the interval s ∈ [r, r * maxLen] multiplies the term -- by the number of lengths. Since r ≥ 1, this count is at most r * maxLen. - rcases r with (_ | _ | r) <;> rcases maxLen with (_ | _ | maxLen) <;> norm_num at * + rcases r with (_ | _ | r) <;> rcases maxLen with (_ | _ | maxLen) + all_goals try simp at * · positivity · rw [Nat.cast_sub] <;> push_cast <;> nlinarith only diff --git a/Mathlib/InformationTheory/KullbackLeibler/Basic.lean b/Mathlib/InformationTheory/KullbackLeibler/Basic.lean index 20050c76e33c9d..e3318363356624 100644 --- a/Mathlib/InformationTheory/KullbackLeibler/Basic.lean +++ b/Mathlib/InformationTheory/KullbackLeibler/Basic.lean @@ -176,7 +176,6 @@ lemma toReal_klDiv_eq_integral_klFun (h : μ ≪ ν) : · rw [klDiv_of_not_integrable h_int, ENNReal.toReal_top] · rwa [integrable_klFun_rnDeriv_iff h] -set_option backward.isDefEq.respectTransparency false in lemma toReal_klDiv_smul_left (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) μ) (c : ℝ≥0) : (klDiv (c • μ) ν).toReal = c * (klDiv μ ν).toReal + (1 - c) * ν.real univ + c * log c * μ.real univ := by @@ -194,7 +193,6 @@ lemma toReal_klDiv_smul_left (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) simp [h_smul] ring -set_option backward.isDefEq.respectTransparency false in lemma toReal_klDiv_smul_right_eq_smul_left (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) μ) (c : ℝ≥0) : (klDiv μ (c • ν)).toReal = c * (klDiv (c⁻¹ • μ) ν).toReal := by @@ -227,7 +225,6 @@ lemma toReal_klDiv_smul_right (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν simp only [NNReal.coe_inv, log_inv, mul_neg, neg_mul, ← sub_eq_add_neg] field_simp -set_option backward.isDefEq.respectTransparency false in lemma toReal_klDiv_smul_same (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) μ) (c : ℝ≥0) : (klDiv (c • μ) (c • ν)).toReal = c * (klDiv μ ν).toReal := by by_cases hc : c = 0 @@ -240,7 +237,6 @@ lemma toReal_klDiv_smul_same (hμν : μ ≪ ν) (h_int : Integrable (llr μ ν) end Real -set_option backward.isDefEq.respectTransparency false in lemma klDiv_smul_right_eq_smul_left [IsFiniteMeasure μ] [IsFiniteMeasure ν] {c : ℝ≥0} (hc : c ≠ 0) : klDiv μ (c • ν) = c * klDiv (c⁻¹ • μ) ν := by have hc' : (c : ℝ≥0∞) ≠ 0 := by simpa @@ -287,7 +283,6 @@ lemma klDiv_smul_right_eq_smul_left [IsFiniteMeasure μ] [IsFiniteMeasure ν] {c rw [ENNReal.ofReal_toReal] exact klDiv_ne_top (hμν.smul_left _) h_int_left -set_option backward.isDefEq.respectTransparency false in lemma klDiv_smul_same [IsFiniteMeasure μ] [IsFiniteMeasure ν] (c : ℝ≥0) : klDiv (c • μ) (c • ν) = c * klDiv μ ν := by by_cases hc : c = 0 diff --git a/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean b/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean index cc1acbf774506a..ecd3e30bc7f9cc 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Centroid.lean @@ -102,8 +102,7 @@ theorem centroid_pair [DecidableEq ι] [Invertible (2 : k)] (p : ι → P) (i₁ · simp [h] · have hc : (#{i₁, i₂} : k) ≠ 0 := by rw [card_insert_of_notMem (notMem_singleton.2 h), card_singleton] - norm_num - exact Invertible.ne_zero _ + simpa using Invertible.ne_zero _ rw [centroid_def, affineCombination_eq_weightedVSubOfPoint_vadd_of_sum_eq_one _ _ _ (sum_centroidWeights_eq_one_of_cast_card_ne_zero _ hc) (p i₁)] diff --git a/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean b/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean deleted file mode 100644 index b0eda0d48da491..00000000000000 --- a/Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean +++ /dev/null @@ -1,8 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Algebra.Order.AbsoluteValue.Basic -public import Mathlib.Data.Finset.Attr -public import Mathlib.Data.Rat.Floor -public import Mathlib.Tactic.Continuity - -deprecated_module (since := "2025-09-20") diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean index 73105823b2759d..45e9669a3e8f3b 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean @@ -312,6 +312,13 @@ instance (priority := low) : IsStablyFiniteRing K := by have : f * (g * i) = f * 1 := congr_arg _ hi rw [← mul_assoc, hfg, one_mul, mul_one] at this; rwa [← this] +/-- A domain finitely generated as a module over a field is a field. -/ +theorem _root_.IsField.of_isDomain_of_finite (K L : Type*) [Field K] [CommRing L] [IsDomain L] + [Algebra K L] [Module.Finite K L] : IsField L where + exists_pair_ne := Nontrivial.exists_pair_ne + mul_comm := mul_comm + mul_inv_cancel {x} hx := (mulLeft K x).surjective_of_injective (mul_right_injective₀ hx) 1 + section Semiring variable (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M] [Free R M] [Module.Finite R M] diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean index 40550e66ad1ea9..9e26360ce1f368 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/Coeff.lean @@ -144,7 +144,6 @@ theorem trace_eq_neg_charpoly_nextCoeff (M : Matrix n n R) : M.trace = -M.charpo nontriviality simp [trace_eq_neg_charpoly_coeff, nextCoeff] -set_option backward.isDefEq.respectTransparency false in theorem det_eq_sign_charpoly_coeff (M : Matrix n n R) : M.det = (-1) ^ Fintype.card n * M.charpoly.coeff 0 := by rw [coeff_zero_eq_eval_zero, charpoly, eval_det, matPolyEquiv_charmatrix, ← det_smul] diff --git a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean index f3f113c67d8023..b5560bee09abec 100644 --- a/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean +++ b/Mathlib/LinearAlgebra/Matrix/FixedDetMatrices.lean @@ -164,7 +164,6 @@ 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 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] diff --git a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean index a1e5a74dfbef92..8e12547a8067d1 100644 --- a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean +++ b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean @@ -227,7 +227,6 @@ section Block /-! #### General 2×2 block matrices -/ -set_option backward.isDefEq.respectTransparency false in /-- A block matrix is invertible if the bottom right corner and the corresponding Schur complement is. -/ @[implicit_reducible] diff --git a/Mathlib/LinearAlgebra/Multilinear/Basic.lean b/Mathlib/LinearAlgebra/Multilinear/Basic.lean index 0e0d89523ded39..866b95e89382c1 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Basic.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Basic.lean @@ -214,6 +214,10 @@ theorem coe_smul (c : S) (f : MultilinearMap R M₁ M₂) : ⇑(c • f) = c • end SMul +-- The `AddMonoid` instance exists to help speedup unification +instance : AddMonoid (MultilinearMap R M₁ M₂) := fast_instance% + coe_injective.addMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl + instance addCommMonoid : AddCommMonoid (MultilinearMap R M₁ M₂) := fast_instance% coe_injective.addCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean index 133dfb5d6f9c5b..2c9902f05e2f61 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean @@ -391,7 +391,6 @@ variable (b) in simp only [← mul_assoc, ω_mul_ω, one_mul] simp [mul_assoc] -set_option backward.isDefEq.respectTransparency false in lemma ωConj_mem_of_mem {x : Matrix (b.support ⊕ ι) (b.support ⊕ ι) R} (hx : x ∈ lieAlgebra b) : ωConj b x ∈ lieAlgebra b := by diff --git a/Mathlib/LinearAlgebra/SesquilinearForm.lean b/Mathlib/LinearAlgebra/SesquilinearForm.lean deleted file mode 100644 index a7663c16f4108f..00000000000000 --- a/Mathlib/LinearAlgebra/SesquilinearForm.lean +++ /dev/null @@ -1,10 +0,0 @@ -/- -Copyright (c) 2018 Andreas Swerdlow. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Andreas Swerdlow --/ -module -- shake: keep-all - -public import Mathlib.LinearAlgebra.SesquilinearForm.Basic - -deprecated_module (since := "2025-10-06") diff --git a/Mathlib/LinearAlgebra/SymplecticGroup.lean b/Mathlib/LinearAlgebra/SymplecticGroup.lean index c53e3309b1b9b0..f45df9b46ce4d0 100644 --- a/Mathlib/LinearAlgebra/SymplecticGroup.lean +++ b/Mathlib/LinearAlgebra/SymplecticGroup.lean @@ -39,7 +39,6 @@ section JMatrixLemmas def J : Matrix (l ⊕ l) (l ⊕ l) R := Matrix.fromBlocks 0 (-1) 1 0 -set_option backward.isDefEq.respectTransparency false in @[simp] theorem J_transpose : (J l R)ᵀ = -J l R := by rw [J, fromBlocks_transpose, ← neg_one_smul R (fromBlocks _ _ _ _ : Matrix (l ⊕ l) (l ⊕ l) R), @@ -98,7 +97,6 @@ section SymplecticJ variable (l) (R) -set_option backward.isDefEq.respectTransparency false in theorem J_mem : J l R ∈ symplecticGroup l R := by rw [mem_iff, J, fromBlocks_multiply, fromBlocks_transpose, fromBlocks_multiply] simp @@ -116,7 +114,6 @@ end SymplecticJ variable {A : Matrix (l ⊕ l) (l ⊕ l) R} -set_option backward.isDefEq.respectTransparency false in theorem neg_mem (h : A ∈ symplecticGroup l R) : -A ∈ symplecticGroup l R := by rw [mem_iff] at h ⊢ simp [h] @@ -132,7 +129,6 @@ theorem symplectic_det (hA : A ∈ symplecticGroup l R) : IsUnit <| det A := by rw [mul_comm A.det, mul_assoc] at hA exact hA -set_option backward.isDefEq.respectTransparency false in theorem transpose_mem (hA : A ∈ symplecticGroup l R) : Aᵀ ∈ symplecticGroup l R := by rw [mem_iff] at hA ⊢ rw [transpose_transpose] diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean index bc7236b725bc93..4aefe699e07b76 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/LpNorm.lean @@ -231,7 +231,6 @@ lemma lpNorm_mono_real {g : α → ℝ} (hg : MemLp g p μ) (h : ∀ x, ‖f x exact ENNReal.toNNReal_mono (hg.eLpNorm_ne_top) (eLpNorm_mono_real h) · simp [hf] -set_option backward.isDefEq.respectTransparency false in lemma lpNorm_smul_measure_of_ne_zero {f : α → E} {c : ℝ≥0} (hc : c ≠ 0) : lpNorm f p (c • μ) = c ^ p.toReal⁻¹ • lpNorm f p μ := by by_cases hf : AEStronglyMeasurable f μ @@ -241,7 +240,6 @@ lemma lpNorm_smul_measure_of_ne_zero {f : α → E} {c : ℝ≥0} (hc : c ≠ 0) simpa [hc] using h.smul_measure c⁻¹] simp -set_option backward.isDefEq.respectTransparency false in lemma lpNorm_smul_measure_of_ne_top (hp : p ≠ ∞) {f : α → E} (c : ℝ≥0) : lpNorm f p (c • μ) = c ^ p.toReal⁻¹ • lpNorm f p μ := by by_cases hf : AEStronglyMeasurable f μ diff --git a/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean b/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean index 344cdfe1635ac0..b0eef7a4e5160f 100644 --- a/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean +++ b/Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean @@ -71,8 +71,7 @@ theorem exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure [NormedAddC rw [addHaar_smul_of_nonneg μ (by simp : 0 ≤ (2 : ℝ)⁻¹) s, ← ENNReal.mul_lt_mul_iff_left (pow_ne_zero (finrank ℝ E) (two_ne_zero' _)) (by finiteness), mul_right_comm, ofReal_pow (by simp : 0 ≤ (2 : ℝ)⁻¹), ofReal_inv_of_pos zero_lt_two] - norm_num - rwa [← mul_pow, ENNReal.inv_mul_cancel two_ne_zero ofNat_ne_top, one_pow, one_mul] + simpa [← mul_pow, ENNReal.inv_mul_cancel two_ne_zero ofNat_ne_top] obtain ⟨x, y, hxy, h⟩ := exists_pair_mem_lattice_not_disjoint_vadd fund ((h_conv.smul _).nullMeasurableSet _) h_vol obtain ⟨_, ⟨v, hv, rfl⟩, w, hw, hvw⟩ := Set.not_disjoint_iff.mp h diff --git a/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean b/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean index de2f5d6fc94e69..e9d5dbdd582477 100644 --- a/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean +++ b/Mathlib/MeasureTheory/Measure/Decomposition/Lebesgue.lean @@ -160,12 +160,10 @@ instance haveLebesgueDecompositionSMul' (μ ν : Measure α) [HaveLebesgueDecomp simp only rw [withDensity_smul _ hmeas, ← smul_add, ← hadd] -set_option backward.isDefEq.respectTransparency false in instance haveLebesgueDecompositionSMul (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) : (r • μ).HaveLebesgueDecomposition ν := by rw [ENNReal.smul_def]; infer_instance -set_option backward.isDefEq.respectTransparency false in instance haveLebesgueDecompositionSMulRight (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] (r : ℝ≥0) : μ.HaveLebesgueDecomposition (r • ν) where @@ -436,7 +434,6 @@ theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurabl exact hT₂ ▸ measure_mono (inter_subset_right.trans inter_subset_right) rw [heq' A hA, heq, restrict_apply hA, ← diff_eq, AEDisjoint.measure_diff_left hμinter] -set_option backward.isDefEq.respectTransparency false in theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) : (r • μ).singularPart ν = r • μ.singularPart ν := by by_cases hr : r = 0 @@ -451,7 +448,6 @@ theorem singularPart_smul (μ ν : Measure α) (r : ℝ≥0) : rw [← inv_smul_smul₀ hr μ] infer_instance -set_option backward.isDefEq.respectTransparency false in theorem singularPart_smul_right (μ ν : Measure α) (r : ℝ≥0) (hr : r ≠ 0) : μ.singularPart (r • ν) = μ.singularPart ν := by by_cases hl : HaveLebesgueDecomposition μ ν @@ -610,7 +606,6 @@ theorem rnDeriv_restrict_self (ν : Measure α) [SigmaFinite ν] {s : Set α} (h rw [← withDensity_indicator_one hs] exact rnDeriv_withDensity _ (measurable_one.indicator hs) -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν] @@ -628,7 +623,6 @@ theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν] · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _ · exact (lintegral_rnDeriv_lt_top (r • ν) μ).ne -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_left_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν] @@ -638,7 +632,6 @@ theorem rnDeriv_smul_left_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν] rnDeriv_smul_left ν μ r.toNNReal simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν] @@ -661,7 +654,6 @@ theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν] smul_eq_mul, inv_mul_cancel₀ hr, one_smul] exact ν.haveLebesgueDecomposition_add μ -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right_of_ne_top'`, which requires sigma-finite `ν` and `μ`. -/ theorem rnDeriv_smul_right_of_ne_top (ν μ : Measure α) [IsFiniteMeasure ν] @@ -989,7 +981,6 @@ nonrec instance (priority := 100) haveLebesgueDecomposition_of_sigmaFinite section rnDeriv -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_left' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] (r : ℝ≥0) : @@ -1005,7 +996,6 @@ theorem rnDeriv_smul_left' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ · exact (measurable_rnDeriv _ _).aemeasurable · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _ -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative of the scalar multiple of a measure. See also `rnDeriv_smul_left_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] @@ -1015,7 +1005,6 @@ theorem rnDeriv_smul_left_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [Sigm rnDeriv_smul_left' ν μ r.toNNReal simpa [ENNReal.smul_def, ENNReal.coe_toNNReal hr] using h -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] @@ -1036,7 +1025,6 @@ theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite · exact (measurable_rnDeriv _ _).aemeasurable · exact (measurable_rnDeriv _ _).aemeasurable.const_smul _ -set_option backward.isDefEq.respectTransparency false in /-- Radon-Nikodym derivative with respect to the scalar multiple of a measure. See also `rnDeriv_smul_right_of_ne_top`, which has no hypothesis on `μ` but requires finite `ν`. -/ theorem rnDeriv_smul_right_of_ne_top' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ] diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean index ed99748e3bcf25..8040779246a4a4 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasure.lean @@ -259,7 +259,6 @@ theorem coeFn_smul [IsScalarTower R ℝ≥0 ℝ≥0] (c : R) (μ : FiniteMeasure (⇑(c • μ) : Set Ω → ℝ≥0) = c • (⇑μ : Set Ω → ℝ≥0) := by funext; simp [← ENNReal.coe_inj, ENNReal.coe_smul] -set_option backward.isDefEq.respectTransparency false in instance instAddCommMonoid : AddCommMonoid (FiniteMeasure Ω) := fast_instance% toMeasure_injective.addCommMonoid _ toMeasure_zero toMeasure_add fun _ _ ↦ toMeasure_smul _ _ diff --git a/Mathlib/MeasureTheory/Measure/Haar/Unique.lean b/Mathlib/MeasureTheory/Measure/Haar/Unique.lean index b53259ff7397ea..b40539a128167c 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Unique.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Unique.lean @@ -920,7 +920,6 @@ theorem absolutelyContinuous_isHaarMeasure [LocallyCompactSpace G] rw [haarMeasure_unique μ K, h, smul_smul] exact smul_absolutelyContinuous -set_option backward.isDefEq.respectTransparency false in /-- A continuous surjective monoid homomorphism of topological groups with compact codomain is measure preserving, provided that the Haar measures on the domain and on the codomain have the same total mass. diff --git a/Mathlib/MeasureTheory/Measure/Hausdorff.lean b/Mathlib/MeasureTheory/Measure/Hausdorff.lean index 0e37cee102a96c..ba8cfd7c3442cd 100644 --- a/Mathlib/MeasureTheory/Measure/Hausdorff.lean +++ b/Mathlib/MeasureTheory/Measure/Hausdorff.lean @@ -368,7 +368,6 @@ theorem mkMetric_smul (m : ℝ≥0∞ → ℝ≥0∞) {c : ℝ≥0∞} (hc : c simp only [mkMetric, mkMetric', mkMetric'.pre] simp_rw [smul_iSup, smul_boundedBy hc, ennreal_smul_extend _ hc', Pi.smul_apply] -set_option backward.isDefEq.respectTransparency false in theorem mkMetric_nnreal_smul (m : ℝ≥0∞ → ℝ≥0∞) {c : ℝ≥0} (hc : c ≠ 0) : (mkMetric (c • m) : OuterMeasure X) = c • mkMetric m := by rw [ENNReal.smul_def, ENNReal.smul_def, @@ -741,7 +740,6 @@ end LipschitzWith open scoped Pointwise -set_option backward.isDefEq.respectTransparency false in theorem MeasureTheory.Measure.hausdorffMeasure_smul₀ {𝕜 E : Type*} [NormedAddCommGroup E] [NormedDivisionRing 𝕜] [Module 𝕜 E] [NormSMulClass 𝕜 E] [MeasurableSpace E] [BorelSpace E] {d : ℝ} (hd : 0 ≤ d) {r : 𝕜} (hr : r ≠ 0) (s : Set E) : diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean index 710c7c77bc670c..e9996b15827733 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean @@ -107,7 +107,6 @@ instance IsFiniteMeasure.average : IsFiniteMeasure ((μ univ)⁻¹ • μ) where rw [smul_apply, smul_eq_mul, ← ENNReal.div_eq_inv_mul] exact ENNReal.div_self_le_one.trans_lt ENNReal.one_lt_top -set_option backward.isDefEq.respectTransparency false in instance isFiniteMeasureSMulOfNNRealTower {R} [SMul R ℝ≥0] [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0 ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] [IsFiniteMeasure μ] {r : R} : IsFiniteMeasure (r • μ) := by rw [← smul_one_smul ℝ≥0 r μ] diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean index a8f31fc33bfe16..a39384c9f0525f 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Probability.lean @@ -107,7 +107,6 @@ instance isProbabilityMeasure_ite {p : Prop} [Decidable p] {μ ν : Measure α} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : IsProbabilityMeasure (ite p μ ν) := by split <;> infer_instance -set_option backward.isDefEq.respectTransparency false in open unitInterval in instance {μ ν : Measure α} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {p : I} : IsProbabilityMeasure (toNNReal p • μ + toNNReal (σ p) • ν) where diff --git a/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean b/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean index 1c1429d4e1ae33..c3e3173b676083 100644 --- a/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean +++ b/Mathlib/NumberTheory/ArithmeticFunction/LFunction.lean @@ -56,7 +56,6 @@ section PowerSeries variable {R : Type*} [CommSemiring R] -set_option backward.isDefEq.respectTransparency 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⁻²ˢ + ...`. diff --git a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean index c81e82dd632b24..d2db272a7cfcb1 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean @@ -157,7 +157,10 @@ theorem discr_prime_pow [hcycl : IsCyclotomicExtension {p ^ k} K L] [hp : Fact p minpoly.eq_X_sub_C_of_algebraMap_inj _ (FaithfulSMul.algebraMap_injective K L)] exact natDegree_X_sub_C (-1) rcases Fin.equiv_iff_eq.2 this with ⟨e⟩ - rw [← Algebra.discr_reindex K (hζ.powerBasis K).basis e, coe_basis, powerBasis_gen]; norm_num + rw [← Algebra.discr_reindex K (hζ.powerBasis K).basis e, coe_basis, powerBasis_gen] + simp only [powerBasis_dim, + zero_add, pow_one, totient_two, reduceDiv, pow_zero, cast_ofNat, tsub_self, + Nat.add_one_sub_one, mul_one, mul_zero] simp_rw [hζ.eq_neg_one_of_two_right, show (-1 : L) = algebraMap K L (-1) by simp] convert_to (discr K fun i : Fin 1 ↦ (algebraMap K L) (-1) ^ ↑i) = _ · congr 1 diff --git a/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean b/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean deleted file mode 100644 index ca9aa8d1554ab1..00000000000000 --- a/Mathlib/NumberTheory/Cyclotomic/Embeddings.lean +++ /dev/null @@ -1,8 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Combinatorics.Matroid.Init -public import Mathlib.MeasureTheory.Integral.Bochner.Basic -public import Mathlib.NumberTheory.ArithmeticFunction.Misc -public import Mathlib.Tactic.Positivity - -deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/PID.lean b/Mathlib/NumberTheory/Cyclotomic/PID.lean deleted file mode 100644 index 3868d0fa9dbcd6..00000000000000 --- a/Mathlib/NumberTheory/Cyclotomic/PID.lean +++ /dev/null @@ -1,9 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -public import Mathlib.CategoryTheory.Category.Init -public import Mathlib.Combinatorics.Matroid.Init -public import Mathlib.Data.Nat.Factorial.DoubleFactorial -public import Mathlib.NumberTheory.ArithmeticFunction.Misc - -deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/Rat.lean b/Mathlib/NumberTheory/Cyclotomic/Rat.lean deleted file mode 100644 index 3868d0fa9dbcd6..00000000000000 --- a/Mathlib/NumberTheory/Cyclotomic/Rat.lean +++ /dev/null @@ -1,9 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -public import Mathlib.CategoryTheory.Category.Init -public import Mathlib.Combinatorics.Matroid.Init -public import Mathlib.Data.Nat.Factorial.DoubleFactorial -public import Mathlib.NumberTheory.ArithmeticFunction.Misc - -deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Cyclotomic/Three.lean b/Mathlib/NumberTheory/Cyclotomic/Three.lean deleted file mode 100644 index 3868d0fa9dbcd6..00000000000000 --- a/Mathlib/NumberTheory/Cyclotomic/Three.lean +++ /dev/null @@ -1,9 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -public import Mathlib.CategoryTheory.Category.Init -public import Mathlib.Combinatorics.Matroid.Init -public import Mathlib.Data.Nat.Factorial.DoubleFactorial -public import Mathlib.NumberTheory.ArithmeticFunction.Misc - -deprecated_module (since := "2025-10-14") diff --git a/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean b/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean index 74266cec9a12c1..85e673aef46de0 100644 --- a/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean +++ b/Mathlib/NumberTheory/Harmonic/GammaDeriv.lean @@ -141,7 +141,7 @@ lemma hasDerivAt_Gamma_one_half : HasDerivAt Gamma (-√π * (γ + 2 * log 2)) ( apply HasDerivAt.deriv have := HasDerivAt.rpow (hasDerivAt_const (1 / 2 : ℝ) (2 : ℝ)) (?_ : HasDerivAt (fun s : ℝ ↦ 1 - 2 * s) (-2) (1 / 2)) two_pos - · norm_num at this; exact this + · simpa simp_rw [mul_comm (2 : ℝ) _] apply HasDerivAt.const_sub exact hasDerivAt_mul_const (2 : ℝ) diff --git a/Mathlib/NumberTheory/NumberField/Completion.lean b/Mathlib/NumberTheory/NumberField/Completion.lean deleted file mode 100644 index 3798cf6143d8fc..00000000000000 --- a/Mathlib/NumberTheory/NumberField/Completion.lean +++ /dev/null @@ -1,7 +0,0 @@ -module -- shake: keep-all - -public import Mathlib.Combinatorics.Matroid.Init -public import Mathlib.MeasureTheory.Integral.Bochner.Basic -public import Mathlib.Tactic.Positivity - -deprecated_module (since := "2025-09-24") diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean index 05ca4a86b144c4..4de2e92d4e5bc1 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Basic.lean @@ -592,7 +592,6 @@ theorem isNontrivial : v.1.IsNontrivial := by variable {v} (K) -set_option backward.isDefEq.respectTransparency false in open Filter in /-- *Weak approximation for infinite places* diff --git a/Mathlib/NumberTheory/ZetaValues.lean b/Mathlib/NumberTheory/ZetaValues.lean index 3665ef381fc19b..157aefbc6fd5ae 100644 --- a/Mathlib/NumberTheory/ZetaValues.lean +++ b/Mathlib/NumberTheory/ZetaValues.lean @@ -459,7 +459,8 @@ theorem hasSum_zeta_two : HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 2) (π simp [Nat.factorial]; ring theorem hasSum_zeta_four : HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 4) (π ^ 4 / 90) := by - convert hasSum_zeta_nat two_ne_zero using 1; norm_num + convert hasSum_zeta_nat two_ne_zero using 1 + simp only [Nat.reduceAdd, Nat.reduceMul, Nat.add_one_sub_one] rw [bernoulli_eq_bernoulli'_of_ne_one, bernoulli'_four] · simp [Nat.factorial]; ring · decide diff --git a/Mathlib/Order/CompleteBooleanAlgebra.lean b/Mathlib/Order/CompleteBooleanAlgebra.lean index ba87d1961f3c6b..28dcd06b40ded0 100644 --- a/Mathlib/Order/CompleteBooleanAlgebra.lean +++ b/Mathlib/Order/CompleteBooleanAlgebra.lean @@ -529,6 +529,7 @@ theorem biInf_sup_biInf {ι ι' : Type*} {f : ι → α} {g : ι' → α} {s : S theorem sInf_sup_sInf : sInf s ⊔ sInf t = ⨅ p ∈ s ×ˢ t, (p : α × α).1 ⊔ p.2 := @sSup_inf_sSup αᵒᵈ _ _ _ +@[to_dual existing] theorem iInf_sup_of_monotone {ι : Type*} [Preorder ι] [IsCodirectedOrder ι] {f g : ι → α} (hf : Monotone f) (hg : Monotone g) : ⨅ i, f i ⊔ g i = (⨅ i, f i) ⊔ ⨅ i, g i := @iSup_inf_of_antitone αᵒᵈ _ _ _ _ _ _ hf.dual_right hg.dual_right diff --git a/Mathlib/Probability/Distributions/SetBernoulli.lean b/Mathlib/Probability/Distributions/SetBernoulli.lean index 5a948791339d2e..784338a37661f5 100644 --- a/Mathlib/Probability/Distributions/SetBernoulli.lean +++ b/Mathlib/Probability/Distributions/SetBernoulli.lean @@ -63,11 +63,9 @@ lemma setBernoulli_apply' (S : Set (Set ι)) : setBer(u, p) S = (infinitePi fun i ↦ toNNReal p • dirac (i ∈ u) + toNNReal (σ p) • dirac False) ((fun p ↦ {i | p i}) ⁻¹' S) := MeasurableEquiv.setOf.symm.comap_apply .. -set_option backward.isDefEq.respectTransparency false in variable (u) in @[simp] lemma setBernoulli_zero : setBer(u, 0) = dirac ∅ := by simp [setBernoulli_eq_map] -set_option backward.isDefEq.respectTransparency false in variable (u) in @[simp] lemma setBernoulli_one : setBer(u, 1) = dirac u := by simp [setBernoulli_eq_map] diff --git a/Mathlib/RingTheory/AdicCompletion/LocalRing.lean b/Mathlib/RingTheory/AdicCompletion/LocalRing.lean index e3984424a03fdb..9586a62be9ee90 100644 --- a/Mathlib/RingTheory/AdicCompletion/LocalRing.lean +++ b/Mathlib/RingTheory/AdicCompletion/LocalRing.lean @@ -6,7 +6,7 @@ Authors: Nailin Guan module public import Mathlib.RingTheory.AdicCompletion.Basic -public import Mathlib.RingTheory.LocalRing.Defs +public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic /-! # Basic Properties of Complete Local Ring @@ -18,67 +18,9 @@ ia a local ring (complete local ring). public section -variable {R : Type*} [CommRing R] (m : Ideal R) [hmax : m.IsMaximal] +variable {R : Type*} [CommRing R] (m : Ideal R) [m.IsMaximal] -open Ideal Quotient - -lemma isUnit_iff_notMem_of_isAdicComplete_maximal [IsAdicComplete m R] (r : R) : - IsUnit r ↔ r ∉ m := by - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · by_contra mem - rcases IsUnit.exists_left_inv h with ⟨s, hs⟩ - absurd m.ne_top_iff_one.mp (Ideal.IsMaximal.ne_top hmax) - simp [← hs, Ideal.mul_mem_left m s mem] - · have mapu {n : ℕ} (npos : 0 < n) : IsUnit (Ideal.Quotient.mk (m ^ n) r) := by - induction n with - | zero => - absurd npos - exact Nat.not_lt_zero 0 - | succ n ih => - by_cases neq0 : n = 0 - · let max' : (m ^ (n + 1)).IsMaximal := by simpa only [neq0, zero_add, pow_one] using hmax - let hField : Field (R ⧸ m ^ (n + 1)) := Ideal.Quotient.field (m ^ (n + 1)) - simpa [isUnit_iff_ne_zero, ne_eq, Ideal.Quotient.eq_zero_iff_mem.not, neq0] using h - · apply factorPowSucc.isUnit_of_isUnit_image (Nat.zero_lt_of_ne_zero neq0) - simpa using (ih (Nat.zero_lt_of_ne_zero neq0)) - choose invSeries' invSeries_spec' using fun (n : {n : ℕ // 0 < n}) ↦ - (IsUnit.exists_left_inv (mapu n.2)) - let invSeries : ℕ → R := fun n ↦ if h : n = 0 then 0 else Classical.choose <| - Ideal.Quotient.mk_surjective <| invSeries' ⟨n, (Nat.zero_lt_of_ne_zero h)⟩ - have invSeries_spec {n : ℕ} (npos : 0 < n) : (Ideal.Quotient.mk (m ^ n)) (invSeries n) = - invSeries' ⟨n, npos⟩ := by - simpa only [Nat.ne_zero_of_lt npos, invSeries] - using Classical.choose_spec (Ideal.Quotient.mk_surjective (invSeries' ⟨n, npos⟩)) - have mod {a b : ℕ} (le : a ≤ b) : - invSeries a ≡ invSeries b [SMOD m ^ a • (⊤ : Submodule R R)] := by - by_cases apos : 0 < a - · simp only [smul_eq_mul, Ideal.mul_top] - rw [SModEq.sub_mem, ← eq_zero_iff_mem, map_sub, ← (mapu apos).mul_right_inj, - mul_zero, mul_sub] - nth_rw 3 [← factor_mk (pow_le_pow_right le), ← factor_mk (pow_le_pow_right le)] - simp only [invSeries_spec apos, invSeries_spec (Nat.lt_of_lt_of_le apos le)] - rw [← map_mul, mul_comm, invSeries_spec', mul_comm, invSeries_spec', - map_one, sub_self] - · simp [Nat.eq_zero_of_not_pos apos] - rcases IsAdicComplete.toIsPrecomplete.prec mod with ⟨inv, hinv⟩ - have eq (n : ℕ) : inv * r - 1 ≡ 0 [SMOD m ^ n • (⊤ : Submodule R R)] := by - by_cases npos : 0 < n - · apply SModEq.sub_mem.mpr - simp only [smul_eq_mul, Ideal.mul_top, sub_zero, ← eq_zero_iff_mem] - rw [map_sub, map_one, map_mul, ← sub_add_cancel inv (invSeries n), map_add] - have := SModEq.sub_mem.mp (hinv n).symm - simp only [smul_eq_mul, Ideal.mul_top] at this - simp [Ideal.Quotient.eq_zero_iff_mem.mpr this, invSeries_spec npos, invSeries_spec'] - · simp [Nat.eq_zero_of_not_pos npos] - apply isUnit_iff_exists_inv'.mpr - use inv - exact sub_eq_zero.mp <| IsHausdorff.haus IsAdicComplete.toIsHausdorff (inv * r - 1) eq - -theorem isLocalRing_of_isAdicComplete_maximal [IsAdicComplete m R] : IsLocalRing R where - exists_pair_ne := ⟨0, 1, ne_of_mem_of_not_mem m.zero_mem - (m.ne_top_iff_one.mp (Ideal.IsMaximal.ne_top hmax))⟩ - isUnit_or_isUnit_of_add_one {a b} hab := by - simp only [isUnit_iff_notMem_of_isAdicComplete_maximal m] - by_contra! h - absurd m.add_mem h.1 h.2 - simpa [hab] using m.ne_top_iff_one.mp (Ideal.IsMaximal.ne_top hmax) +theorem isLocalRing_of_isAdicComplete_maximal [IsAdicComplete m R] : IsLocalRing R := + IsLocalRing.of_unique_max_ideal ⟨m, ‹m.IsMaximal›, fun _ hJ ↦ + (‹m.IsMaximal›.eq_of_le hJ.ne_top <| + (IsAdicComplete.le_jacobson_bot m).trans <| sInf_le ⟨bot_le, hJ⟩).symm⟩ diff --git a/Mathlib/RingTheory/Artinian/Module.lean b/Mathlib/RingTheory/Artinian/Module.lean index 71ccefc72e4a92..3ac44944cc6451 100644 --- a/Mathlib/RingTheory/Artinian/Module.lean +++ b/Mathlib/RingTheory/Artinian/Module.lean @@ -576,6 +576,18 @@ lemma primeSpectrum_asIdeal_range_eq : variable (R) +theorem nilradical_pow_eq_iInf (n : ℕ) : + nilradical R ^ n = iInf fun I : MaximalSpectrum R ↦ I.1 ^ n := by + have : Fintype (MaximalSpectrum R) := Fintype.ofFinite (MaximalSpectrum R) + rw [← iInf_univ, ← Finset.coe_univ, PrimeSpectrum.nilradical_eq_iInf] + simp only [Finset.mem_coe] + rw [← Ideal.prod_eq_iInf_of_pairwise_isCoprime fun I _ _ _ ↦ .pow ∘ I.isCoprime_of_ne, + Finset.prod_pow, Ideal.prod_eq_iInf_of_pairwise_isCoprime fun I _ _ _ ↦ I.isCoprime_of_ne] + simp [Finset.mem_univ, iInf, IsArtinianRing.primeSpectrum_asIdeal_range_eq] + +theorem nilradical_eq_iInf : nilradical R = iInf MaximalSpectrum.asIdeal := by + simpa using nilradical_pow_eq_iInf R 1 + lemma setOf_isPrime_finite : {I : Ideal R | I.IsPrime}.Finite := by simpa only [isPrime_iff_isMaximal] using setOf_isMaximal_finite R @@ -590,22 +602,27 @@ instance : Finite (PrimeSpectrum R) := /-- The quotient of a commutative Artinian ring by its nilradical is isomorphic to a finite product of fields, namely the quotients by the maximal ideals. -/ +@[simps!] noncomputable def quotNilradicalEquivPi : - R ⧸ nilradical R ≃+* ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal := - let f := MaximalSpectrum.asIdeal (R := R) - .trans - (Ideal.quotEquivOfEq <| ext fun x ↦ by - rw [PrimeSpectrum.nilradical_eq_iInf, iInf, primeSpectrum_asIdeal_range_eq]; rfl) - (Ideal.quotientInfRingEquivPiQuotient f <| fun I J h ↦ - Ideal.isCoprime_iff_sup_eq.mpr <| I.2.coprime_of_ne J.2 <| - fun hIJ ↦ h <| MaximalSpectrum.ext hIJ) + (R ⧸ nilradical R) ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal := + (Ideal.quotientEquivAlgOfEq R (nilradical_eq_iInf R)).trans + { __ := Ideal.quotientInfRingEquivPiQuotient _ fun I _ ↦ I.isCoprime_of_ne + commutes' _ := rfl} + +/-- The quotient of a commutative Artinian ring by a power of its nilradical is isomorphic to +a finite product of local rings, namely the quotients by the powers of the maximal ideals. -/ +@[simps!] +noncomputable def quotNilradicalPowEquivPi (n : ℕ) : + (R ⧸ nilradical R ^ n) ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal ^ n := + (Ideal.quotientEquivAlgOfEq R (nilradical_pow_eq_iInf R n)).trans + { __ := Ideal.quotientInfRingEquivPiQuotient _ fun I _ ↦ .pow ∘ I.isCoprime_of_ne + commutes' _ := rfl} /-- A reduced commutative Artinian ring is isomorphic to a finite product of fields, namely the quotients by the maximal ideals. -/ -noncomputable def equivPi [IsReduced R] : R ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal where - __ := RingEquiv.trans (.symm <| .quotientBot R) <| .trans - (Ideal.quotEquivOfEq (nilradical_eq_zero R).symm) (quotNilradicalEquivPi R) - commutes' _ := rfl +noncomputable def equivPi [IsReduced R] : R ≃ₐ[R] ∀ I : MaximalSpectrum R, R ⧸ I.asIdeal := + .trans (.symm <| .quotientBot R R) <| .trans + (Ideal.quotientEquivAlgOfEq R (nilradical_eq_zero R).symm) (quotNilradicalEquivPi R) set_option backward.isDefEq.respectTransparency false in theorem isSemisimpleRing_of_isReduced [IsReduced R] : IsSemisimpleRing R := diff --git a/Mathlib/RingTheory/Extension/Generators.lean b/Mathlib/RingTheory/Extension/Generators.lean index 1ac169351c37f1..5ea6b2b1bdedfd 100644 --- a/Mathlib/RingTheory/Extension/Generators.lean +++ b/Mathlib/RingTheory/Extension/Generators.lean @@ -295,7 +295,6 @@ noncomputable def baseChangeToBaseChange : ext simp [RingHom.algebraMap_toAlgebra] -set_option backward.isDefEq.respectTransparency false in @[simp] lemma baseChangeToBaseChange_apply (x : (baseChange T P).toExtension.Ring) : dsimp% (P.baseChangeToBaseChange T).toRingHom x = diff --git a/Mathlib/RingTheory/Flat/Rank.lean b/Mathlib/RingTheory/Flat/Rank.lean index 7f5eae009c9a13..a7a380d3a50fdb 100644 --- a/Mathlib/RingTheory/Flat/Rank.lean +++ b/Mathlib/RingTheory/Flat/Rank.lean @@ -36,7 +36,6 @@ attribute [local instance] Module.free_of_flat_of_isLocalRing variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] [Module.Flat R S] [Module.Finite R S] -set_option backward.isDefEq.respectTransparency false in lemma PrimeSpectrum.rankAtStalk_pos_iff_mem_range_comap (p : PrimeSpectrum R) : 0 < Module.rankAtStalk (R := R) S p ↔ p ∈ Set.range (PrimeSpectrum.comap (algebraMap R S)) := by rw [Module.rankAtStalk_eq, Module.finrank_pos_iff, p.nontrivial_iff_mem_rangeComap] diff --git a/Mathlib/RingTheory/Jacobson/Ring.lean b/Mathlib/RingTheory/Jacobson/Ring.lean index 96112c6da11e22..183d937c3bbb4b 100644 --- a/Mathlib/RingTheory/Jacobson/Ring.lean +++ b/Mathlib/RingTheory/Jacobson/Ring.lean @@ -553,8 +553,7 @@ theorem comp_C_integral_of_surjective_of_isJacobsonRing {S : Type*} [Field S] (f rw [← hfg, RingHom.comp_assoc] refine (quotient_mk_comp_C_isIntegral_of_isJacobsonRing (RingHom.ker f)).trans _ g (g.isIntegral_of_surjective ?_) - rw [← hfg] at hf - norm_num at hf + rw [← hfg, RingHom.coe_comp] at hf exact Function.Surjective.of_comp hf end @@ -657,8 +656,7 @@ theorem comp_C_integral_of_surjective_of_isJacobsonRing {R : Type*} [CommRing R] rw [← hfg, RingHom.comp_assoc] refine (quotient_mk_comp_C_isIntegral_of_isJacobsonRing (RingHom.ker f')).trans _ g (g.isIntegral_of_surjective ?_) - rw [← hfg] at hf' - norm_num at hf' + rw [← hfg, coe_comp] at hf' exact Function.Surjective.of_comp hf' rw [RingHom.comp_assoc] at this convert this diff --git a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean index 2af79104fea0a8..401b4e2fd9f36f 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean @@ -93,7 +93,6 @@ lemma hasSubst_iff_hasEval_of_discreteTopology [TopologicalSpace S] [DiscreteTop simp_rw [hasSubst_def, hasEval_def, coeff_zero_iff, isTopologicallyNilpotent_iff_constantCoeff_isNilpotent] -set_option backward.isDefEq.respectTransparency false in theorem HasSubst.hasEval [TopologicalSpace S] (ha : HasSubst a) : HasEval a := HasEval.mono (instTopologicalSpace_mono τ bot_le) <| (@hasSubst_iff_hasEval_of_discreteTopology σ τ _ _ a ⊥ (@DiscreteTopology.mk S ⊥ rfl)).mp ha diff --git a/Mathlib/RingTheory/Nilpotent/Exp.lean b/Mathlib/RingTheory/Nilpotent/Exp.lean index b75084b8c2d4b7..401f9271de2a1a 100644 --- a/Mathlib/RingTheory/Nilpotent/Exp.lean +++ b/Mathlib/RingTheory/Nilpotent/Exp.lean @@ -199,10 +199,11 @@ theorem exp_smul {G : Type*} [Monoid G] [MulSemiringAction G A] exp (g • a) = g • exp a := (map_exp ha (MulSemiringAction.toRingHom G A g)).symm +set_option linter.flexible false in -- TODO: fix non-terminal simp theorem isNilpotent_exp_sub_one {a : A} (ha : IsNilpotent a) : IsNilpotent (exp a - 1) := by nontriviality A rw [exp, ← Nat.sub_add_cancel (pos_nilpotencyClass_iff.2 ha), Finset.sum_range_succ'] - norm_num + simp apply Commute.isNilpotent_sum fun _ _ ↦ smul (pow_of_pos ha <| by positivity) _ simp [Nat.factorial_ne_zero] diff --git a/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean b/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean index 2d6b6a16a80779..cf0414e67b6202 100644 --- a/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean +++ b/Mathlib/RingTheory/Spectrum/Maximal/Basic.lean @@ -5,6 +5,7 @@ Authors: David Kurniadi Angdinata -/ module +public import Mathlib.RingTheory.Ideal.Operations public import Mathlib.RingTheory.Spectrum.Maximal.Defs public import Mathlib.RingTheory.Spectrum.Prime.Defs @@ -46,4 +47,7 @@ def toPrimeSpectrum (x : MaximalSpectrum R) : PrimeSpectrum R := theorem toPrimeSpectrum_injective : (@toPrimeSpectrum R _).Injective := fun ⟨_, _⟩ ⟨_, _⟩ h => by simpa only [MaximalSpectrum.mk.injEq] using PrimeSpectrum.ext_iff.mp h +theorem isCoprime_of_ne {I J : MaximalSpectrum R} (h : I ≠ J) : IsCoprime I.1 J.1 := + Ideal.isCoprime_iff_sup_eq.mpr <| I.2.coprime_of_ne J.2 <| mt MaximalSpectrum.ext h + end MaximalSpectrum diff --git a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean index 025a4f7500ca4f..8654ec4f0b46da 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean @@ -535,7 +535,6 @@ theorem basicOpen_eq_zeroLocus_compl (r : R) : theorem basicOpen_one : basicOpen (1 : R) = ⊤ := TopologicalSpace.Opens.ext <| by simp -set_option backward.isDefEq.respectTransparency false in @[simp] theorem basicOpen_zero : basicOpen (0 : R) = ⊥ := TopologicalSpace.Opens.ext <| by simp @@ -591,7 +590,6 @@ theorem isBasis_basic_opens : TopologicalSpace.Opens.IsBasis (Set.range (@basicO rw [← Set.range_comp] rfl -set_option backward.isDefEq.respectTransparency false in @[simp] theorem basicOpen_eq_bot_iff (f : R) : basicOpen f = ⊥ ↔ IsNilpotent f := by rw [← TopologicalSpace.Opens.coe_inj, basicOpen_eq_zeroLocus_compl] @@ -681,7 +679,6 @@ section DiscreteTopology variable (R) [DiscreteTopology (PrimeSpectrum R)] -set_option backward.isDefEq.respectTransparency false in theorem toPiLocalization_surjective_of_discreteTopology : Function.Surjective (toPiLocalization R) := fun x ↦ by have (p : PrimeSpectrum R) : ∃ f, (basicOpen f : Set _) = {p} := @@ -1033,7 +1030,6 @@ lemma isClopen_iff_mul_add_zeroLocus {s : Set (PrimeSpectrum R)} : open TopologicalSpace (Clopens) -set_option backward.isDefEq.respectTransparency false in /-- Clopen subsets in the prime spectrum of a commutative semiring are in order-preserving bijection with pairs of elements with product 0 and sum 1. (By definition, `(e₁, f₁) ≤ (e₂, f₂)` iff `e₁ * e₂ = e₁`.) Both elements in such pairs must be idempotents, but there may exists @@ -1257,7 +1253,6 @@ theorem comap_closedPoint {S : Type v} [CommSemiring S] [IsLocalRing S] (f : R theorem specializes_closedPoint (x : PrimeSpectrum R) : x ⤳ closedPoint R := (PrimeSpectrum.le_iff_specializes _ _).mp (IsLocalRing.le_maximalIdeal x.2.1) -set_option backward.isDefEq.respectTransparency false in theorem closedPoint_mem_iff (U : TopologicalSpace.Opens <| PrimeSpectrum R) : closedPoint R ∈ U ↔ U = ⊤ := by constructor @@ -1266,7 +1261,6 @@ theorem closedPoint_mem_iff (U : TopologicalSpace.Opens <| PrimeSpectrum R) : · rintro rfl exact TopologicalSpace.Opens.mem_top _ -set_option backward.isDefEq.respectTransparency false in lemma closed_point_mem_iff {U : TopologicalSpace.Opens (PrimeSpectrum R)} : closedPoint R ∈ U ↔ U = ⊤ := ⟨(eq_top_iff.mpr fun x _ ↦ (specializes_closedPoint x).mem_open U.2 ·), (· ▸ trivial)⟩ diff --git a/Mathlib/Tactic/NormNum/Prime.lean b/Mathlib/Tactic/NormNum/Prime.lean index a1ba75a4938757..adf338a09b55aa 100644 --- a/Mathlib/Tactic/NormNum/Prime.lean +++ b/Mathlib/Tactic/NormNum/Prime.lean @@ -80,9 +80,7 @@ theorem minFacHelper_1 {n k k' : ℕ} (e : k + 2 = k') (h : MinFacHelper n k) · refine ((h.1.trans_le h.2.2).ne ?_).elim have h3 : 2 ∣ minFac n := by rw [Nat.dvd_iff_mod_eq_zero, ← h2, succ_eq_add_one, add_mod, h.2.1] - rw [dvd_prime <| minFac_prime h.one_lt.ne'] at h3 - norm_num at h3 - exact h3 + simpa [dvd_prime <| minFac_prime h.one_lt.ne'] using h3 exact h2 theorem minFacHelper_2 {n k k' : ℕ} (e : k + 2 = k') (nk : ¬ Nat.Prime k) diff --git a/Mathlib/Tactic/Translate/Core.lean b/Mathlib/Tactic/Translate/Core.lean index e4fc6a4f15f19f..8fd6b0360b0567 100644 --- a/Mathlib/Tactic/Translate/Core.lean +++ b/Mathlib/Tactic/Translate/Core.lean @@ -680,13 +680,14 @@ def updateAndAddDecl (t : TranslateData) (tgt : Name) (srcDecl : ConstantInfo) {ex.toMessageData}" throwError "@[{t.attrName}] failed. Nested error message:\n{ex.toMessageData}" -/-- Unfold `simp` and `gcongr` auxlemmas in the type and value. +/-- Unfold `simp`, `gcongr` and `hcongr`/`congr_simp` auxlemmas in the type and value. The reason why we can't just translate them is that they are generated by the `@[simp]` attribute, so it would require a change in the implementation of `@[simp]` to add these translations. Additionally, these lemmas have very short proofs, so unfolding them is not costly. -/ def declUnfoldSimpAuxLemmas (decl : ConstantInfo) : MetaM ConstantInfo := do let unfold (e : Expr) := deltaExpand e (allowOpaque := true) fun - | .str _ s => "_simp_".isPrefixOf s || "_gcongr_".isPrefixOf s + | .str _ s => "_simp_".isPrefixOf s || "_gcongr_".isPrefixOf s || + isHCongrReservedNameSuffix s || s == congrSimpSuffix | _ => false let mut decl := decl decl := decl.updateType <| ← unfold decl.type diff --git a/Mathlib/Topology/AlexandrovDiscrete.lean b/Mathlib/Topology/AlexandrovDiscrete.lean index 23402f7cf8601d..9799f371a38440 100644 --- a/Mathlib/Topology/AlexandrovDiscrete.lean +++ b/Mathlib/Topology/AlexandrovDiscrete.lean @@ -127,7 +127,6 @@ lemma Topology.IsInducing.alexandrovDiscrete [AlexandrovDiscrete α] {f : β → end -set_option backward.isDefEq.respectTransparency false in lemma AlexandrovDiscrete.sup {t₁ t₂ : TopologicalSpace α} (_ : @AlexandrovDiscrete α t₁) (_ : @AlexandrovDiscrete α t₂) : @AlexandrovDiscrete α (t₁ ⊔ t₂) := diff --git a/Mathlib/Topology/Algebra/Constructions.lean b/Mathlib/Topology/Algebra/Constructions.lean index 6b661609b7b65e..9931bf339adab6 100644 --- a/Mathlib/Topology/Algebra/Constructions.lean +++ b/Mathlib/Topology/Algebra/Constructions.lean @@ -121,7 +121,6 @@ instance instDiscreteTopology [DiscreteTopology M] : DiscreteTopology Mˣ := simp only [isInducing_embedProduct.1, instTopologicalSpaceProd, induced_inf, instTopologicalSpaceMulOpposite, induced_compose]; rfl -set_option backward.isDefEq.respectTransparency false in /-- An auxiliary lemma that can be used to prove that coercion `Mˣ → M` is a topological embedding. Use `Units.isEmbedding_val₀`, `Units.isEmbedding_val`, or `toUnits_homeomorph` instead. -/ @[to_additive /-- An auxiliary lemma that can be used to prove that coercion `AddUnits M → M` is a diff --git a/Mathlib/Topology/Algebra/Group/GroupTopology.lean b/Mathlib/Topology/Algebra/Group/GroupTopology.lean index 226a125b64d81d..43dfdcf1f08f9c 100644 --- a/Mathlib/Topology/Algebra/Group/GroupTopology.lean +++ b/Mathlib/Topology/Algebra/Group/GroupTopology.lean @@ -110,7 +110,6 @@ instance : Bot (GroupTopology α) := theorem toTopologicalSpace_bot : (⊥ : GroupTopology α).toTopologicalSpace = ⊥ := rfl -set_option backward.isDefEq.respectTransparency false in @[to_additive] instance : BoundedOrder (GroupTopology α) where le_top x := show x.toTopologicalSpace ≤ ⊤ from le_top diff --git a/Mathlib/Topology/Algebra/Module/LinearMap.lean b/Mathlib/Topology/Algebra/Module/LinearMap.lean index 36d583593b3886..f7860d68752d09 100644 --- a/Mathlib/Topology/Algebra/Module/LinearMap.lean +++ b/Mathlib/Topology/Algebra/Module/LinearMap.lean @@ -405,7 +405,8 @@ theorem coe_add' (f g : M₁ →SL[σ₁₂] M₂) : ⇑(f + g) = f + g := theorem toContinuousAddMonoidHom_add (f g : M₁ →SL[σ₁₂] M₂) : ↑(f + g) = (f + g : ContinuousAddMonoidHom M₁ M₂) := rfl -instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where +-- The `AddMonoid` instance exists to help speedup unification +instance : AddMonoid (M₁ →SL[σ₁₂] M₂) where zero_add := by intros ext @@ -414,10 +415,6 @@ instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where intros ext apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm] - add_comm := by - intros - ext - apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm] add_assoc := by intros ext @@ -430,6 +427,12 @@ instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where ext simp [add_smul] +instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where + add_comm := by + intros + ext + apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm] + @[simp, norm_cast] theorem coe_sum {ι : Type*} (t : Finset ι) (f : ι → M₁ →SL[σ₁₂] M₂) : ↑(∑ d ∈ t, f d) = (∑ d ∈ t, f d : M₁ →ₛₗ[σ₁₂] M₂) := diff --git a/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean b/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean index ff28a1bd2c434b..3323e718e788c2 100644 --- a/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean +++ b/Mathlib/Topology/Algebra/Module/Multilinear/Basic.lean @@ -192,6 +192,10 @@ theorem toMultilinearMap_add (f g : ContinuousMultilinearMap R M₁ M₂) : (f + g).toMultilinearMap = f.toMultilinearMap + g.toMultilinearMap := rfl +-- The `AddMonoid` instance exists to help speedup unification +instance : AddMonoid (ContinuousMultilinearMap R M₁ M₂) := fast_instance% + toMultilinearMap_injective.addMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl + instance addCommMonoid : AddCommMonoid (ContinuousMultilinearMap R M₁ M₂) := fast_instance% toMultilinearMap_injective.addCommMonoid _ rfl (fun _ _ => rfl) fun _ _ => rfl diff --git a/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean b/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean index 48adc6568dacf4..cdc8dd7ddb8d8d 100644 --- a/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean +++ b/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean @@ -181,7 +181,6 @@ section principal variable {S : Set ι} -set_option backward.isDefEq.respectTransparency false in theorem topologicalSpace_eq_of_principal : topologicalSpace R A (𝓟 S) = .induced ((↑) : Πʳ i, [R i, A i]_[𝓟 S] → Π i, R i) inferInstance := diff --git a/Mathlib/Topology/Category/TopCat/Limits/Basic.lean b/Mathlib/Topology/Category/TopCat/Limits/Basic.lean index 4078b3ef6e4669..9e4cd38cc6bc6b 100644 --- a/Mathlib/Topology/Category/TopCat/Limits/Basic.lean +++ b/Mathlib/Topology/Category/TopCat/Limits/Basic.lean @@ -99,7 +99,6 @@ def coneOfConeForget : Cone F where ext apply congr_fun (c.π.naturality φ) } -set_option backward.isDefEq.respectTransparency 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`. -/ @@ -211,7 +210,6 @@ def coconeOfCoconeForget : Cocone F where ext apply congr_fun (c.ι.naturality φ) } -set_option backward.isDefEq.respectTransparency 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`. -/ diff --git a/Mathlib/Topology/Category/TopCat/Opens.lean b/Mathlib/Topology/Category/TopCat/Opens.lean index 43d688164d1292..cddecfc9fdfde0 100644 --- a/Mathlib/Topology/Category/TopCat/Opens.lean +++ b/Mathlib/Topology/Category/TopCat/Opens.lean @@ -84,13 +84,11 @@ noncomputable def infLERight (U V : Opens X) : U ⊓ V ⟶ V := noncomputable def leSupr {ι : Type*} (U : ι → Opens X) (i : ι) : U i ⟶ iSup U := (le_iSup U i).hom -set_option backward.isDefEq.respectTransparency false in /-- The inclusion `⊥ ⟶ U` as a morphism in the category of open sets. -/ noncomputable def botLE (U : Opens X) : ⊥ ⟶ U := bot_le.hom -set_option backward.isDefEq.respectTransparency false in /-- The inclusion `U ⟶ ⊤` as a morphism in the category of open sets. -/ noncomputable def leTop (U : Opens X) : U ⟶ ⊤ := diff --git a/Mathlib/Topology/Category/TopCat/ULift.lean b/Mathlib/Topology/Category/TopCat/ULift.lean index 8e584508bacac7..d1f4ec38a06a55 100644 --- a/Mathlib/Topology/Category/TopCat/ULift.lean +++ b/Mathlib/Topology/Category/TopCat/ULift.lean @@ -68,7 +68,6 @@ instance : uliftFunctor.{v, u}.Faithful := open Limits -set_option backward.isDefEq.respectTransparency 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/Compactness/CompactlyGeneratedSpace.lean b/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean index d0ca3bc174ac75..896c2d06bfa1f1 100644 --- a/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean +++ b/Mathlib/Topology/Compactness/CompactlyGeneratedSpace.lean @@ -97,7 +97,6 @@ lemma eq_compactlyGenerated [t : TopologicalSpace X] [UCompactlyGeneratedSpace.{ Sigma.forall] exact fun S f ↦ f.2 -set_option backward.isDefEq.respectTransparency false in instance (X : Type v) [t : TopologicalSpace X] [DiscreteTopology X] : UCompactlyGeneratedSpace.{u} X where le_compactlyGenerated := by diff --git a/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean b/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean index 8cd5b7b2637872..808a0556b7a8ce 100644 --- a/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean +++ b/Mathlib/Topology/Compactness/DeltaGeneratedSpace.lean @@ -86,7 +86,6 @@ lemma DeltaGeneratedSpace.isOpen_iff [DeltaGeneratedSpace X] {u : Set X} : IsOpen u ↔ ∀ (n : ℕ) (p : ContinuousMap ((Fin n) → ℝ) X), IsOpen (p ⁻¹' u) := by nth_rewrite 1 [eq_deltaGenerated (X := X)]; exact isOpen_deltaGenerated_iff -set_option backward.isDefEq.respectTransparency false in /-- A map out of a delta-generated space is continuous iff it preserves continuity of maps from ℝⁿ into X. -/ lemma DeltaGeneratedSpace.continuous_iff [DeltaGeneratedSpace X] {f : X → Y} : diff --git a/Mathlib/Topology/Constructions.lean b/Mathlib/Topology/Constructions.lean index 77b2a5ce7c205e..6f88474bbad152 100644 --- a/Mathlib/Topology/Constructions.lean +++ b/Mathlib/Topology/Constructions.lean @@ -196,7 +196,6 @@ theorem continuous_map_sInf {α : Type*} [TopologicalSpace α] {S : Set (Setoid α)} {s : Setoid α} (h : s ∈ S) : Continuous (Setoid.map_sInf h) := continuous_coinduced_rng -set_option backward.isDefEq.respectTransparency false in instance {p : X → Prop} [TopologicalSpace X] [DiscreteTopology X] : DiscreteTopology (Subtype p) := ⟨bot_unique fun s _ => ⟨(↑) '' s, isOpen_discrete _, preimage_image_eq _ Subtype.val_injective⟩⟩ diff --git a/Mathlib/Topology/ContinuousMap/Ideals.lean b/Mathlib/Topology/ContinuousMap/Ideals.lean index 4db32c186e83c3..b825b255512213 100644 --- a/Mathlib/Topology/ContinuousMap/Ideals.lean +++ b/Mathlib/Topology/ContinuousMap/Ideals.lean @@ -335,7 +335,6 @@ def idealOpensGI : (isClosed_of_closure_subset <| (idealOfSet_ofIdeal_eq_closure I ▸ hI : I.closure ≤ I)).closure_eq) -set_option backward.isDefEq.respectTransparency false in theorem idealOfSet_isMaximal_iff (s : Opens X) : (idealOfSet 𝕜 (s : Set X)).IsMaximal ↔ IsCoatom s := by rw [Ideal.isMaximal_def] diff --git a/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean b/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean index a54dda01b8f9ac..3271ee7a3bf687 100644 --- a/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean +++ b/Mathlib/Topology/ContinuousMap/T0Sierpinski.lean @@ -28,7 +28,6 @@ noncomputable section namespace TopologicalSpace -set_option backward.isDefEq.respectTransparency false in theorem eq_induced_by_maps_to_sierpinski (X : Type*) [t : TopologicalSpace X] : t = ⨅ u : Opens X, sierpinskiSpace.induced (· ∈ u) := by apply le_antisymm diff --git a/Mathlib/Topology/LocalAtTarget.lean b/Mathlib/Topology/LocalAtTarget.lean index 46dbdaaaea0cd5..f82289f50e31c8 100644 --- a/Mathlib/Topology/LocalAtTarget.lean +++ b/Mathlib/Topology/LocalAtTarget.lean @@ -235,7 +235,6 @@ end LocalAtSource end TopologicalSpace.IsOpenCover -set_option backward.isDefEq.respectTransparency false in /-- Given a continuous map `f : X → Y` between topological spaces. Suppose we have an open cover `U i` of the range of `f`, and a family of continuous maps `V i → X` diff --git a/Mathlib/Topology/MetricSpace/Polish.lean b/Mathlib/Topology/MetricSpace/Polish.lean index d3afa2a2fb992e..d42f8b1fadc484 100644 --- a/Mathlib/Topology/MetricSpace/Polish.lean +++ b/Mathlib/Topology/MetricSpace/Polish.lean @@ -262,7 +262,6 @@ but this is nontrivial (see `isClopenable_iff_measurableSet`). -/ def IsClopenable [t : TopologicalSpace α] (s : Set α) : Prop := ∃ t' : TopologicalSpace α, t' ≤ t ∧ @PolishSpace α t' ∧ IsClosed[t'] s ∧ IsOpen[t'] s -set_option backward.isDefEq.respectTransparency false in /-- Given a closed set `s` in a Polish space, one can construct a finer Polish topology for which `s` is both open and closed. -/ theorem _root_.IsClosed.isClopenable [TopologicalSpace α] [PolishSpace α] {s : Set α} diff --git a/Mathlib/Topology/NoetherianSpace.lean b/Mathlib/Topology/NoetherianSpace.lean index d71c0a5c11fbaa..672735be24df71 100644 --- a/Mathlib/Topology/NoetherianSpace.lean +++ b/Mathlib/Topology/NoetherianSpace.lean @@ -51,7 +51,6 @@ namespace TopologicalSpace /-- Type class for Noetherian spaces. It is defined to be spaces whose open sets satisfies ACC. -/ abbrev NoetherianSpace : Prop := WellFoundedGT (Opens α) -set_option backward.isDefEq.respectTransparency false in theorem noetherianSpace_iff_opens : NoetherianSpace α ↔ ∀ s : Opens α, IsCompact (s : Set α) := by rw [NoetherianSpace, CompleteLattice.wellFoundedGT_iff_isSupFiniteCompact, CompleteLattice.isSupFiniteCompact_iff_all_elements_compact] @@ -137,7 +136,6 @@ theorem NoetherianSpace.iUnion {ι : Type*} (f : ι → Set α) [Finite ι] rw [← Set.inter_eq_left.mpr ht, Set.inter_iUnion] exact isCompact_iUnion fun i => hf i _ Set.inter_subset_right -set_option backward.isDefEq.respectTransparency false in -- This is not an instance since it makes a loop with `t2_space_discrete`. theorem NoetherianSpace.discrete [NoetherianSpace α] [T2Space α] : DiscreteTopology α := ⟨eq_bot_iff.mpr fun _ _ => isClosed_compl_iff.mp (NoetherianSpace.isCompact _).isClosed⟩ diff --git a/Mathlib/Topology/Order.lean b/Mathlib/Topology/Order.lean index 78fad609e951b2..952d2240c7876d 100644 --- a/Mathlib/Topology/Order.lean +++ b/Mathlib/Topology/Order.lean @@ -347,7 +347,6 @@ theorem le_of_nhds_le_nhds (h : ∀ x, @nhds α t₁ x ≤ @nhds α t₂ x) : t rw [@isOpen_iff_mem_nhds _ t₁, @isOpen_iff_mem_nhds _ t₂] exact fun hs a ha => h _ (hs _ ha) -set_option backward.isDefEq.respectTransparency false in theorem eq_bot_of_singletons_open {t : TopologicalSpace α} (h : ∀ x, IsOpen[t] {x}) : t = ⊥ := bot_unique fun s _ => biUnion_of_singleton s ▸ isOpen_biUnion fun x _ => h x @@ -460,7 +459,6 @@ theorem induced_mono (h : t₁ ≤ t₂) : t₁.induced g ≤ t₂.induced g := theorem coinduced_mono (h : t₁ ≤ t₂) : t₁.coinduced f ≤ t₂.coinduced f := (gc_coinduced_induced f).monotone_l h -set_option backward.isDefEq.respectTransparency false in @[simp] theorem induced_top : (⊤ : TopologicalSpace α).induced g = ⊤ := (gc_coinduced_induced g).u_top @@ -479,7 +477,6 @@ theorem induced_sInf {s : Set (TopologicalSpace α)} : TopologicalSpace.induced g (sInf s) = sInf (TopologicalSpace.induced g '' s) := by rw [sInf_eq_iInf', sInf_image', induced_iInf] -set_option backward.isDefEq.respectTransparency false in @[simp] theorem coinduced_bot : (⊥ : TopologicalSpace α).coinduced f = ⊥ := (gc_coinduced_induced f).l_bot @@ -509,7 +506,6 @@ theorem induced_compose {tγ : TopologicalSpace γ} {f : α → β} {g : β → ⟨fun ⟨_, ⟨s, hs, h₂⟩, h₁⟩ => h₁ ▸ h₂ ▸ ⟨s, hs, rfl⟩, fun ⟨s, hs, h⟩ => ⟨preimage g s, ⟨s, hs, rfl⟩, h ▸ rfl⟩⟩ -set_option backward.isDefEq.respectTransparency false in theorem induced_const [t : TopologicalSpace α] {x : α} : (t.induced fun _ : β => x) = ⊤ := le_antisymm le_top (@continuous_const β α ⊤ t x).le_induced @@ -696,7 +692,6 @@ theorem nhds_inf {t₁ t₂ : TopologicalSpace α} {a : α} : @nhds α (t₁ ⊓ t₂) a = @nhds α t₁ a ⊓ @nhds α t₂ a := (gc_nhds a).u_inf (b₁ := t₁) -set_option backward.isDefEq.respectTransparency false in theorem nhds_top {a : α} : @nhds α ⊤ a = ⊤ := (gc_nhds a).u_top @@ -795,7 +790,6 @@ theorem continuous_le_rng {t₁ : TopologicalSpace α} {t₂ t₃ : TopologicalS rw [continuous_iff_coinduced_le] at h₂ ⊢ exact le_trans h₂ h₁ -set_option backward.isDefEq.respectTransparency false in theorem continuous_sup_dom {t₁ t₂ : TopologicalSpace α} {t₃ : TopologicalSpace β} : Continuous[t₁ ⊔ t₂, t₃] f ↔ Continuous[t₁, t₃] f ∧ Continuous[t₂, t₃] f := by simp only [continuous_iff_le_induced, sup_le_iff] @@ -808,7 +802,6 @@ theorem continuous_sup_rng_right {t₁ : TopologicalSpace α} {t₃ t₂ : Topol Continuous[t₁, t₃] f → Continuous[t₁, t₂ ⊔ t₃] f := continuous_le_rng le_sup_right -set_option backward.isDefEq.respectTransparency false in theorem continuous_sSup_dom {T : Set (TopologicalSpace α)} {t₂ : TopologicalSpace β} : Continuous[sSup T, t₂] f ↔ ∀ t ∈ T, Continuous[t, t₂] f := by simp only [continuous_iff_le_induced, sSup_le_iff] @@ -818,7 +811,6 @@ theorem continuous_sSup_rng {t₁ : TopologicalSpace α} {t₂ : Set (Topologica Continuous[t₁, sSup t₂] f := continuous_iff_coinduced_le.2 <| le_sSup_of_le h₁ <| continuous_iff_coinduced_le.1 hf -set_option backward.isDefEq.respectTransparency false in theorem continuous_iSup_dom {t₁ : ι → TopologicalSpace α} {t₂ : TopologicalSpace β} : Continuous[iSup t₁, t₂] f ↔ ∀ i, Continuous[t₁ i, t₂] f := by simp only [continuous_iff_le_induced, iSup_le_iff] @@ -827,7 +819,6 @@ theorem continuous_iSup_rng {t₁ : TopologicalSpace α} {t₂ : ι → Topologi (h : Continuous[t₁, t₂ i] f) : Continuous[t₁, iSup t₂] f := continuous_sSup_rng ⟨i, rfl⟩ h -set_option backward.isDefEq.respectTransparency false in theorem continuous_inf_rng {t₁ : TopologicalSpace α} {t₂ t₃ : TopologicalSpace β} : Continuous[t₁, t₂ ⊓ t₃] f ↔ Continuous[t₁, t₂] f ∧ Continuous[t₁, t₃] f := by simp only [continuous_iff_coinduced_le, le_inf_iff] @@ -845,7 +836,6 @@ theorem continuous_sInf_dom {t₁ : Set (TopologicalSpace α)} {t₂ : Topologic Continuous[t, t₂] f → Continuous[sInf t₁, t₂] f := continuous_le_dom <| sInf_le h₁ -set_option backward.isDefEq.respectTransparency false in theorem continuous_sInf_rng {t₁ : TopologicalSpace α} {T : Set (TopologicalSpace β)} : Continuous[t₁, sInf T] f ↔ ∀ t ∈ T, Continuous[t₁, t] f := by simp only [continuous_iff_coinduced_le, le_sInf_iff] @@ -854,17 +844,14 @@ theorem continuous_iInf_dom {t₁ : ι → TopologicalSpace α} {t₂ : Topologi Continuous[t₁ i, t₂] f → Continuous[iInf t₁, t₂] f := continuous_le_dom <| iInf_le _ _ -set_option backward.isDefEq.respectTransparency false in theorem continuous_iInf_rng {t₁ : TopologicalSpace α} {t₂ : ι → TopologicalSpace β} : Continuous[t₁, iInf t₂] f ↔ ∀ i, Continuous[t₁, t₂ i] f := by simp only [continuous_iff_coinduced_le, le_iInf_iff] -set_option backward.isDefEq.respectTransparency false in @[continuity, fun_prop] theorem continuous_bot {t : TopologicalSpace β} : Continuous[⊥, t] f := continuous_iff_le_induced.2 bot_le -set_option backward.isDefEq.respectTransparency false in @[continuity, fun_prop] theorem continuous_top {t : TopologicalSpace α} : Continuous[t, ⊤] f := continuous_iff_coinduced_le.2 le_top diff --git a/Mathlib/Topology/Sets/OpenCover.lean b/Mathlib/Topology/Sets/OpenCover.lean index 8c1bb493d3cfb5..e821d5edeb2b03 100644 --- a/Mathlib/Topology/Sets/OpenCover.lean +++ b/Mathlib/Topology/Sets/OpenCover.lean @@ -63,12 +63,10 @@ lemma isTopologicalBasis (hu : IsOpenCover u) end IsOpenCover -set_option backward.isDefEq.respectTransparency false in lemma Opens.IsBasis.isOpenCover {S : Set (Opens X)} (hS : Opens.IsBasis S) : IsOpenCover (fun U : S ↦ (U : Opens X)) := top_le_iff.mp (subset_trans hS.2.superset (by simp)) -set_option backward.isDefEq.respectTransparency false in /-- Given an open cover and a basis, the set of basis elements contained in any of the covers is still a cover. -/ lemma Opens.IsBasis.isOpenCover_mem_and_le {S : Set (Opens X)} (hS : Opens.IsBasis S) @@ -86,7 +84,6 @@ section Irreducible open TopologicalSpace Function -set_option backward.isDefEq.respectTransparency false in /-- (Pre)Irreducibility of an open set can be checked on a cover by opens with pairwise non-empty intersections. -/ theorem IsPreirreducible.of_subset_iUnion {X ι : Type*} [TopologicalSpace X] @@ -113,7 +110,6 @@ theorem IsPreirreducible.of_subset_iUnion {X ι : Type*} [TopologicalSpace X] with ⟨x, hx₁, hx₂⟩ exfalso; exact hx₂ <| hUu hx₁ -set_option backward.isDefEq.respectTransparency false in /-- (Pre)Irreducibility can be checked on an open cover with pairwise non-empty intersections. -/ theorem PreirreducibleSpace.of_isOpenCover {X ι : Type*} [TopologicalSpace X] {U : ι → Opens X} (hn : Pairwise ((¬ Disjoint · ·) on U)) (hU : IsOpenCover U) diff --git a/Mathlib/Topology/Sheaves/CommRingCat.lean b/Mathlib/Topology/Sheaves/CommRingCat.lean index f222b7cd85cdef..2e6247a95937b2 100644 --- a/Mathlib/Topology/Sheaves/CommRingCat.lean +++ b/Mathlib/Topology/Sheaves/CommRingCat.lean @@ -336,7 +336,6 @@ theorem objSupIsoProdEqLocus_inv_snd {X : TopCat} (F : X.Sheaf CommRingCat) (U V (CommRingCat.pullbackConeIsLimit _ _) WalkingCospan.right) x -set_option backward.isDefEq.respectTransparency false in theorem objSupIsoProdEqLocus_inv_eq_iff {X : TopCat.{u}} (F : X.Sheaf CommRingCat.{u}) {U V W UW VW : Opens X} (e : W ≤ U ⊔ V) (x) (y : F.1.obj (op W)) (h₁ : UW = U ⊓ W) (h₂ : VW = V ⊓ W) : diff --git a/Mathlib/Topology/Sheaves/MayerVietoris.lean b/Mathlib/Topology/Sheaves/MayerVietoris.lean index ad6ac294ae220a..a603bb367bb331 100644 --- a/Mathlib/Topology/Sheaves/MayerVietoris.lean +++ b/Mathlib/Topology/Sheaves/MayerVietoris.lean @@ -32,7 +32,6 @@ open CategoryTheory Limits TopologicalSpace variable {T : Type u} [TopologicalSpace T] -set_option backward.isDefEq.respectTransparency false in /-- A square consisting of opens `X₂ ⊓ X₃`, `X₂`, `X₃` and `X₂ ⊔ X₃` is a Mayer-Vietoris square. -/ @[simps! toSquare] diff --git a/Mathlib/Topology/Sheaves/PUnit.lean b/Mathlib/Topology/Sheaves/PUnit.lean index 575844cec785ee..38c225801bf182 100644 --- a/Mathlib/Topology/Sheaves/PUnit.lean +++ b/Mathlib/Topology/Sheaves/PUnit.lean @@ -24,7 +24,6 @@ open CategoryTheory CategoryTheory.Limits TopCat Opposite variable {C : Type u} [Category.{v} C] -set_option backward.isDefEq.respectTransparency false in theorem isSheaf_of_isTerminal_of_indiscrete {X : TopCat.{w}} (hind : X.str = ⊤) (F : Presheaf C X) (it : IsTerminal <| F.obj <| op ⊥) : F.IsSheaf := fun c U s hs => by have : IndiscreteTopology X := ⟨hind⟩ diff --git a/Mathlib/Topology/Sheaves/Points.lean b/Mathlib/Topology/Sheaves/Points.lean index 571125691e2e77..d54ecab23db30a 100644 --- a/Mathlib/Topology/Sheaves/Points.lean +++ b/Mathlib/Topology/Sheaves/Points.lean @@ -32,7 +32,6 @@ open CategoryTheory GrothendieckTopology TopologicalSpace variable {X : Type u} [TopologicalSpace X] (x : X) -set_option backward.isDefEq.respectTransparency false in /-- Given a topological space `X` and `x : X`, this is the point of the site `(Opens X, Opens.grothendieckTopology X)` corresponding to `x`. -/ def pointGrothendieckTopology : Point.{u} (grothendieckTopology X) where @@ -69,7 +68,6 @@ instance : HasEnoughPoints.{u} (grothendieckTopology X) where exists_objectProperty := ⟨_, inferInstance, isConservativeFamilyOfPoints_pointsGrothendieckTopology X⟩ -set_option backward.isDefEq.respectTransparency false in instance (U : Opens X) (Φ : Point.{u} (grothendieckTopology X)) : Subsingleton (Φ.fiber.obj U) := Φ.subsingleton_fiber_obj (homOfLE le_top) Limits.isTerminalTop diff --git a/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean b/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean index e016b662e37149..f1e2bd07e5aca1 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/OpensLeCover.lean @@ -56,7 +56,6 @@ def OpensLeCover : Type w := ObjectProperty.FullSubcategory fun V : Opens X ↦ ∃ i, V ≤ U i deriving Category -set_option backward.isDefEq.respectTransparency false in instance [h : Nonempty ι] : Inhabited (OpensLeCover U) := ⟨⟨⊥, let ⟨i⟩ := h; ⟨i, bot_le⟩⟩⟩ diff --git a/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean b/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean index 9d72abd8a7ef28..eaab0810122e68 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean @@ -112,7 +112,6 @@ def pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U where instance (V : OpensLeCover U) : Nonempty (StructuredArrow V (pairwiseToOpensLeCover U)) := ⟨StructuredArrow.mk (Y := single V.index) (ObjectProperty.homMk V.homToIndex)⟩ -set_option backward.isDefEq.respectTransparency false in -- This is a case bash: for each pair of types of objects in `Pairwise ι`, -- we have to explicitly construct a zigzag. /-- The diagram consisting of the `U i` and `U i ⊓ U j` is cofinal in the diagram @@ -287,7 +286,6 @@ theorem IsSheaf.isSheafPreservesLimitPairwiseIntersections (h : F.IsSheaf) : preservesLimit_of_preserves_limit_cone (Pairwise.coconeIsColimit U).op (h.isSheafPairwiseIntersections U).some -set_option backward.isDefEq.respectTransparency false in /-- The sheaf condition in terms of an equalizer diagram is equivalent to the reformulation in terms of the presheaf preserving the limit of the diagram consisting of the `U i` and `U i ⊓ U j`. @@ -334,7 +332,6 @@ variable (s : PullbackCone (F.1.map (homOfLE inf_le_left : U ⊓ V ⟶ _).op) (F.1.map (homOfLE inf_le_right).op)) -set_option backward.isDefEq.respectTransparency false in /-- (Implementation). Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`. -/ diff --git a/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean b/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean index 1c5680b1d6bfa8..4654b86cc7705a 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean @@ -176,7 +176,6 @@ theorem TopCat.Presheaf.isSheaf_of_isOpenEmbedding (h : IsOpenEmbedding f) (hF : variable (f) -set_option backward.isDefEq.respectTransparency false in instance : RepresentablyFlat (Opens.map f) := by constructor intro U diff --git a/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean b/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean index 619c67fadf604c..b87a68a1ea4ff8 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/UniqueGluing.lean @@ -234,7 +234,6 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : rw [← ConcreteCategory.comp_apply, ← ConcreteCategory.comp_apply, ← F.1.map_comp] exact h i -set_option backward.isDefEq.respectTransparency false in theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂) (s t : ToType (F.1.obj (op V))) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t) (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by diff --git a/Mathlib/Topology/Spectral/Prespectral.lean b/Mathlib/Topology/Spectral/Prespectral.lean index 971e2e08e827e0..ae29626e43db41 100644 --- a/Mathlib/Topology/Spectral/Prespectral.lean +++ b/Mathlib/Topology/Spectral/Prespectral.lean @@ -107,7 +107,6 @@ lemma PrespectralSpace.isBasis_opens [PrespectralSpace X] : ext s exact ⟨fun ⟨V, hV, heq⟩ ↦ heq ▸ ⟨V.2, hV⟩, fun h ↦ ⟨⟨s, h.1⟩, h.2, rfl⟩⟩ -set_option backward.isDefEq.respectTransparency false in /-- In a prespectral space, the lattice of opens is determined by its lattice of compact opens. -/ def PrespectralSpace.opensEquiv [PrespectralSpace X] : Opens X ≃o Order.Ideal (CompactOpens X) where From ffe171fe742aacae83687bb94b5d6538f8f55a15 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 13 Apr 2026 18:11:10 +0800 Subject: [PATCH 16/29] golf Mathlib/Analysis/CStarAlgebra --- Mathlib/Analysis/BoxIntegral/Partition/Split.lean | 8 ++------ .../ContinuousFunctionalCalculus/Isometric.lean | 12 ++---------- Mathlib/Analysis/CStarAlgebra/Exponential.lean | 15 +++++---------- Mathlib/Analysis/CStarAlgebra/Spectrum.lean | 8 ++------ 4 files changed, 11 insertions(+), 32 deletions(-) diff --git a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean index 64048745bab0a2..dee1534aca942e 100644 --- a/Mathlib/Analysis/BoxIntegral/Partition/Split.lean +++ b/Mathlib/Analysis/BoxIntegral/Partition/Split.lean @@ -187,12 +187,8 @@ theorem sum_split_boxes {M : Type*} [AddCommMonoid M] (I : Box ι) (i : ι) (x : /-- If `x ∉ (I.lower i, I.upper i)`, then the hyperplane `{y | y i = x}` does not split `I`. -/ theorem split_of_notMem_Ioo (h : x ∉ Ioo (I.lower i) (I.upper i)) : split I i x = ⊤ := by refine ((isPartitionTop I).eq_of_boxes_subset fun J hJ => ?_).symm - rcases mem_top.1 hJ with rfl; clear hJ - rw [mem_boxes, mem_split_iff] - rw [mem_Ioo, not_and_or, not_lt, not_lt] at h - cases h <;> [right; left] - · rwa [eq_comm, Box.splitUpper_eq_self] - · rwa [eq_comm, Box.splitLower_eq_self] + rcases mem_top.1 hJ with rfl + grind [Box.splitUpper_eq_self, Box.splitLower_eq_self, mem_boxes, mem_split_iff, not_lt] theorem coe_eq_of_mem_split_of_mem_le {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J) (h₃ : y i ≤ x) : (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean index f95ff5e2884ecd..5fc929c0bfb683 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Isometric.lean @@ -458,11 +458,7 @@ lemma IsGreatest.nnnorm_cfc_nnreal [Nontrivial A] (f : ℝ≥0 → ℝ≥0) (a : convert IsGreatest.nnnorm_cfc (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - ext x - constructor - all_goals rintro ⟨x, hx, rfl⟩ - · exact ⟨x, spectrum.algebraMap_mem ℝ hx, by simp⟩ - · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ + simp [Set.image_image, ← ha'.image] lemma apply_le_nnnorm_cfc_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σ ℝ≥0 a) (hf : ContinuousOn f (σ ℝ≥0 a) := by cfc_cont_tac) (ha : 0 ≤ a := by cfc_tac) : @@ -536,11 +532,7 @@ lemma IsGreatest.nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) convert IsGreatest.nnnorm_cfcₙ (fun x : ℝ ↦ (f x.toNNReal : ℝ)) a ?hf_cont (by simpa) case hf_cont => exact continuous_subtype_val.comp_continuousOn <| ContinuousOn.comp ‹_› continuous_real_toNNReal.continuousOn <| ha'.image ▸ Set.mapsTo_image .. - ext x - constructor - all_goals rintro ⟨x, hx, rfl⟩ - · exact ⟨x, quasispectrum.algebraMap_mem ℝ hx, by simp⟩ - · exact ⟨x.toNNReal, ha'.apply_mem hx, by simp⟩ + simp [Set.image_image, ← ha'.image] lemma apply_le_nnnorm_cfcₙ_nnreal (f : ℝ≥0 → ℝ≥0) (a : A) ⦃x : ℝ≥0⦄ (hx : x ∈ σₙ ℝ≥0 a) (hf : ContinuousOn f (σₙ ℝ≥0 a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) diff --git a/Mathlib/Analysis/CStarAlgebra/Exponential.lean b/Mathlib/Analysis/CStarAlgebra/Exponential.lean index 2bef6805c902c6..50d283af4ff1b5 100644 --- a/Mathlib/Analysis/CStarAlgebra/Exponential.lean +++ b/Mathlib/Analysis/CStarAlgebra/Exponential.lean @@ -55,17 +55,12 @@ lemma selfAdjoint.continuous_expUnitary : Continuous (expUnitary : selfAdjoint A theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : expUnitary (a + b) = expUnitary a * expUnitary b := by let +nondep : NormedAlgebra ℚ A := .restrictScalars ℚ ℂ A - ext - have hcomm : Commute (I • (a : A)) (I • (b : A)) := by - unfold Commute SemiconjBy - simp only [h.eq, Algebra.smul_mul_assoc, Algebra.mul_smul_comm] - simpa only [expUnitary_coe, AddSubgroup.coe_add, smul_add] using exp_add_of_commute hcomm + simpa only [Subtype.ext_iff, expUnitary_coe, AddSubgroup.coe_add, smul_add] using + exp_add_of_commute ((h.smul_left I).smul_right I) theorem Commute.expUnitary {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) : - Commute (expUnitary a) (expUnitary b) := - calc - selfAdjoint.expUnitary a * selfAdjoint.expUnitary b = - selfAdjoint.expUnitary b * selfAdjoint.expUnitary a := by - rw [← h.expUnitary_add, ← h.symm.expUnitary_add, add_comm] + Commute (expUnitary a) (expUnitary b) := by + simpa only [Commute, SemiconjBy, Subtype.ext_iff, expUnitary_coe] using + ((h.smul_left I).smul_right I).exp end Star diff --git a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean index d716c1e4af8af6..4c143a3ca4ca7a 100644 --- a/Mathlib/Analysis/CStarAlgebra/Spectrum.lean +++ b/Mathlib/Analysis/CStarAlgebra/Spectrum.lean @@ -313,12 +313,8 @@ noncomputable instance (priority := 100) Complex.instStarHomClass : StarHomClass rw [← realPart_add_I_smul_imaginaryPart a] simp only [map_add, map_smul, star_add, star_smul, hsa, selfAdjoint.star_val_eq] intro s - have := AlgHom.apply_mem_spectrum φ (s : A) - rw [selfAdjoint.val_re_map_spectrum s] at this - rcases this with ⟨⟨_, _⟩, _, heq⟩ - simp only [Function.comp_apply] at heq - rw [← heq, RCLike.star_def] - exact RCLike.conj_ofReal _ + rw [selfAdjoint.mem_spectrum_eq_re s (AlgHom.apply_mem_spectrum φ (s : A))] + simp /-- This is not an instance to avoid type class inference loops. See `WeakDual.Complex.instStarHomClass`. -/ From 705d4a90e491f74429c65f714c10a023cc3a529c Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Tue, 14 Apr 2026 22:20:32 +0800 Subject: [PATCH 17/29] golf Mathlib/Analysis/CStarAlgebra/Unitization.lean --- Mathlib/Analysis/CStarAlgebra/Unitization.lean | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Mathlib/Analysis/CStarAlgebra/Unitization.lean b/Mathlib/Analysis/CStarAlgebra/Unitization.lean index 6e789d584bd5a7..ce0740ce76a961 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitization.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitization.lean @@ -167,12 +167,7 @@ instance Unitization.instCStarRing : CStarRing (Unitization 𝕜 E) where simp only [Unitization.splitMul_apply, Unitization.fst_mul, Unitization.fst_star, norm_mul, norm_star, sq] rw [h₂, h₃] - /- use the definition of the norm, and split into cases based on whether the norm in the first - coordinate is bigger or smaller than the norm in the second coordinate. -/ - by_cases! h : ‖(Unitization.splitMul 𝕜 E x).fst‖ ≤ ‖(Unitization.splitMul 𝕜 E x).snd‖ - · rw [sq, sq, sup_eq_right.mpr h, sup_eq_right.mpr (mul_self_le_mul_self (norm_nonneg _) h)] - · replace h := h.le - rw [sq, sq, sup_eq_left.mpr h, sup_eq_left.mpr (mul_self_le_mul_self (norm_nonneg _) h)] + grind /-- The minimal unitization (over `ℂ`) of a C⋆-algebra, equipped with the C⋆-norm. When `A` is unital, `A⁺¹ ≃⋆ₐ[ℂ] (ℂ × A)`. -/ From 33396e176e3e1d20bc2df794eb28738b4898b29e Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Wed, 15 Apr 2026 22:47:23 +0800 Subject: [PATCH 18/29] golf SpecialFunctions --- .../SpecialFunctions/Complex/Arg.lean | 12 +++---- .../SpecialFunctions/Complex/LogBounds.lean | 23 +++++-------- .../ExpLog/Order.lean | 32 ++++++++---------- .../Rpow/IntegralRepresentation.lean | 17 +++------- .../Elliptic/Weierstrass.lean | 20 ++++------- .../SpecialFunctions/Gamma/Basic.lean | 16 ++------- .../SpecialFunctions/Gamma/BohrMollerup.lean | 22 ++++--------- .../Gaussian/FourierTransform.lean | 8 +---- .../Gaussian/GaussianIntegral.lean | 33 ++++++++----------- .../Gaussian/PoissonSummation.lean | 28 +++++++--------- 10 files changed, 75 insertions(+), 136 deletions(-) diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean b/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean index 051504c48d205e..8d1b4db879ce2d 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean @@ -325,16 +325,12 @@ theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x := by -- TODO: Replace the next two lemmas by general facts about periodic functions lemma norm_eq_one_iff' : ‖x‖ = 1 ↔ ∃ θ ∈ Set.Ioc (-π) π, exp (θ * I) = x := by - rw [norm_eq_one_iff] constructor - · rintro ⟨θ, rfl⟩ - refine ⟨toIocMod (mul_pos two_pos Real.pi_pos) (-π) θ, ?_, ?_⟩ - · convert toIocMod_mem_Ioc _ _ _ - ring - · rw [eq_sub_of_add_eq <| toIocMod_add_toIocDiv_zsmul _ _ θ, ofReal_sub, - ofReal_zsmul, ofReal_mul, ofReal_ofNat, exp_mul_I_periodic.sub_zsmul_eq] + · intro hx + refine ⟨arg x, arg_mem_Ioc x, ?_⟩ + simpa [hx] using norm_mul_exp_arg_mul_I x · rintro ⟨θ, _, rfl⟩ - exact ⟨θ, rfl⟩ + exact Complex.norm_exp_ofReal_mul_I θ lemma image_exp_Ioc_eq_sphere : (fun θ : ℝ ↦ exp (θ * I)) '' Set.Ioc (-π) π = sphere 0 1 := by ext; simpa using norm_eq_one_iff'.symm diff --git a/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean b/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean index 73583e431cf8f6..9306b58f0281a7 100644 --- a/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean +++ b/Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean @@ -211,20 +211,15 @@ lemma norm_log_one_add_le {z : ℂ} (hz : ‖z‖ < 1) : /-- For `‖z‖ ≤ 1/2`, the complex logarithm is bounded by `(3/2) * ‖z‖`. -/ lemma norm_log_one_add_half_le_self {z : ℂ} (hz : ‖z‖ ≤ 1 / 2) : ‖log (1 + z)‖ ≤ (3 / 2) * ‖z‖ := by - apply le_trans (norm_log_one_add_le (lt_of_le_of_lt hz one_half_lt_one)) - have hz3 : (1 - ‖z‖)⁻¹ ≤ 2 := by - rw [inv_eq_one_div, div_le_iff₀] - · linarith - · linarith - have hz4 : ‖z‖ ^ 2 * (1 - ‖z‖)⁻¹ / 2 ≤ ‖z‖ / 2 * 2 / 2 := by - gcongr - · rw [inv_nonneg] - linarith - · rw [sq, div_eq_mul_one_div] - gcongr - simp only [isUnit_iff_ne_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, - IsUnit.div_mul_cancel] at hz4 - linarith + refine (norm_log_one_add_le (lt_of_le_of_lt hz one_half_lt_one)).trans ?_ + have hz0 : 0 ≤ ‖z‖ := norm_nonneg z + have hdiv : (1 - ‖z‖)⁻¹ / 2 ≤ (1 : ℝ) := by + have h1 : (1 - ‖z‖)⁻¹ ≤ 2 := by + rw [inv_eq_one_div, div_le_iff₀] <;> linarith + linarith + have hquad : ‖z‖ ^ 2 * (1 - ‖z‖)⁻¹ / 2 ≤ ‖z‖ ^ 2 := by + nlinarith [sq_nonneg ‖z‖, hdiv] + nlinarith [hz, hz0, hquad] /-- The difference of `log (1-z)⁻¹` and its `(n+1)`st Taylor polynomial can be bounded in terms of `‖z‖`. -/ diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Order.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Order.lean index 26af4b4eabcfc6..6bf23f409bd6e2 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Order.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/ExpLog/Order.lean @@ -56,31 +56,27 @@ lemma CFC.log_monotoneOn : MonotoneOn log {a : A | IsStrictlyPositive a} := by by the continuity of the continuous functional calculus (`tendsto_cfc_fun`). Then, we use the fact that `x^p` is monotone for `p ∈ [0,1]` (`CFC.monotone_nnrpow`) and that the set of monotone functions is closed (`isClosed_monotoneOn`) to conclude the proof. -/ - let s := {a : A | IsStrictlyPositive a} - let f (p : ℝ) := fun a => if a ∈ s then cfc (A := A) (fun x => p⁻¹ * (x ^ p - 1)) a else 0 - let g := fun a => if a ∈ s then log (A := A) a else 0 - have hg : s.EqOn g (log (A := A)) := by simp +contextual [g, Set.EqOn] - refine MonotoneOn.congr ?_ hg - refine isClosed_monotoneOn.mem_of_tendsto (f := f) (b := (𝓝[>] 0)) ?tendsto ?eventually + rw [Set.monotoneOn_iff_monotone] + let f (p : ℝ) (a : {a : A | IsStrictlyPositive a}) := + cfc (A := A) (fun x => p⁻¹ * (x ^ p - 1)) a + refine isClosed_monotone.mem_of_tendsto (f := f) (b := 𝓝[>] 0) ?tendsto ?eventually case tendsto => rw [tendsto_pi_nhds] intro a - by_cases ha : a ∈ s - · have hf : ∀ p, cfc (fun x => p⁻¹ * (x ^ p - 1)) a = f p a := by simp [f, ha] - exact (hg ha ▸ tendsto_cfc_rpow_sub_one_log ha).congr hf - · simp [g, f, ha] + simpa [f] using (tendsto_cfc_rpow_sub_one_log (A := A) (a := a) a.2) case eventually => - have h₁ : ∀ᶠ (p : ℝ) in 𝓝[>] 0, 0 < p ∧ p < 1 := nhdsGT_basis 0 |>.mem_of_mem zero_lt_one - filter_upwards [h₁] with p ⟨hp, hp'⟩ - have hf : s.EqOn (fun a : A => p⁻¹ • (a ^ p - 1)) (f p) := by - intro a ha - simp only [ha, ↓reduceIte, f, ← smul_eq_mul] + filter_upwards [nhdsGT_basis 0 |>.mem_of_mem zero_lt_one] with p hp + have hf (a : {a : A | IsStrictlyPositive a}) : f p a = p⁻¹ • ((a : A) ^ p - 1) := by + simp only [f, ← smul_eq_mul] rw [cfc_smul _ (hf := by fun_prop (disch := grind -abstractProof)), cfc_sub _ _ (hf := by fun_prop (disch := grind -abstractProof)), cfc_const_one .., rpow_eq_cfc_real ..] - refine MonotoneOn.congr (fun a ha b hb hab ↦ ?_) hf - gcongr - grind + intro a b hab + rw [hf a, hf b] + have hp0 : 0 ≤ p⁻¹ := by simpa [one_div] using (_root_.inv_nonneg.mpr hp.1.le) + exact smul_le_smul_of_nonneg_left + (sub_le_sub_right (CFC.monotone_rpow ⟨hp.1.le, hp.2.le⟩ (show (a : A) ≤ b from hab)) (1 : A)) + hp0 @[gcongr] lemma CFC.log_le_log {a b : A} (hab : a ≤ b) (ha : IsStrictlyPositive a := by cfc_tac) : diff --git a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean index df50737a2cf908..ca08e2ff009a26 100644 --- a/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean +++ b/Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/IntegralRepresentation.lean @@ -391,23 +391,16 @@ lemma monotoneOn_rpowIntegrand₁₂ (hp : p ∈ Ioo 1 2) (ht : 0 < t) : lemma integrableOn_rpowIntegrand₁₂ (hp : p ∈ Ioo 1 2) (hx : 0 ≤ x) : IntegrableOn (rpowIntegrand₁₂ p · x) (Ioi 0) := by - have hmain : (rpowIntegrand₁₂ p · x) - =ᵐ[volume.restrict (Ioi 0)] (x * rpowIntegrand₀₁ (p-1) · x) := by - filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha - rw [rpowIntegrand₁₂_eq_mul_rpowIntegrand₀₁ hx ha] - rw [integrableOn_congr_fun_ae hmain] - refine Integrable.const_mul ?_ _ - exact integrableOn_rpowIntegrand₀₁_Ioi (by grind) hx + exact (integrableOn_congr_fun (fun t ht ↦ rpowIntegrand₁₂_eq_mul_rpowIntegrand₀₁ hx ht) + measurableSet_Ioi).2 <| + Integrable.const_mul (integrableOn_rpowIntegrand₀₁_Ioi (by grind) hx) _ /-- The integral representation of the function `x ↦ x^p` (where `p ∈ (1, 2)`) . -/ lemma rpow_eq_const_mul_integral_rpowIntegrand₁₂ (hp : p ∈ Ioo 1 2) (hx : 0 ≤ x) : x ^ p = (∫ t in Ioi 0, rpowIntegrand₀₁ (p - 1) t 1)⁻¹ * ∫ t in Ioi 0, rpowIntegrand₁₂ p t x := by - have hmain : (rpowIntegrand₁₂ p · x) - =ᵐ[volume.restrict (Ioi 0)] (x * rpowIntegrand₀₁ (p-1) · x) := by - filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha - rw [rpowIntegrand₁₂_eq_mul_rpowIntegrand₀₁ hx ha] - rw [integral_congr_ae hmain, integral_const_mul_of_integrable + rw [setIntegral_congr_fun measurableSet_Ioi (fun t ht ↦ + rpowIntegrand₁₂_eq_mul_rpowIntegrand₀₁ hx ht), integral_const_mul_of_integrable (integrableOn_rpowIntegrand₀₁_Ioi (by grind) hx)] have h₁ : x ^ p = x * x ^ (p - 1) := by rw [mul_comm, ← rpow_add_one' hx (by grind)] diff --git a/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean b/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean index cc0c17dd90b56f..b5f0a06ff844c4 100644 --- a/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean +++ b/Mathlib/Analysis/SpecialFunctions/Elliptic/Weierstrass.lean @@ -479,19 +479,13 @@ private lemma weierstrassP_add_coe_aux (z : ℂ) (l : L.lattice) (hl : l.1 / 2 @[simp] lemma weierstrassP_add_coe (z : ℂ) (l : L.lattice) : ℘[L] (z + l) = ℘[L] z := by - let G : AddSubgroup ℂ := - { carrier := { z | (℘[L] <| · + z) = ℘[L] } - add_mem' := by simp_all [funext_iff, ← add_assoc] - zero_mem' := by simp - neg_mem' {z} hz := funext fun i ↦ by conv_lhs => rw [← hz]; simp } - have : L.lattice ≤ G.toIntSubmodule := by - rw [lattice, Submodule.span_le] - rintro _ (rfl | rfl) - · ext i - exact L.weierstrassP_add_coe_aux _ ⟨_, L.ω₁_mem_lattice⟩ L.ω₁_div_two_notMem_lattice - · ext i - exact L.weierstrassP_add_coe_aux _ ⟨_, L.ω₂_mem_lattice⟩ L.ω₂_div_two_notMem_lattice - exact congr_fun (this l.2) _ + obtain ⟨m, n, hmn⟩ := L.mem_lattice.mp l.2 + have hω₁ : ℘[L].Periodic L.ω₁ := fun w ↦ + L.weierstrassP_add_coe_aux w ⟨_, L.ω₁_mem_lattice⟩ L.ω₁_div_two_notMem_lattice + have hω₂ : ℘[L].Periodic L.ω₂ := fun w ↦ + L.weierstrassP_add_coe_aux w ⟨_, L.ω₂_mem_lattice⟩ L.ω₂_div_two_notMem_lattice + rw [← hmn] + simpa [add_assoc] using (hω₁.int_mul m).add_period (hω₂.int_mul n) z lemma periodic_weierstrassP (l : L.lattice) : ℘[L].Periodic l := (L.weierstrassP_add_coe · l) diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean index 14d25fb22eb80f..ce181deffc97b1 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean @@ -408,18 +408,8 @@ def Gamma (s : ℝ) : ℝ := set_option backward.isDefEq.respectTransparency false in theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) : Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by - rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)] - dsimp only [Complex.GammaIntegral] - simp_rw [← Complex.ofReal_one, ← Complex.ofReal_sub] - suffices ∫ x : ℝ in Ioi 0, ↑(exp (-x)) * (x : ℂ) ^ ((s - 1 : ℝ) : ℂ) = - ∫ x : ℝ in Ioi 0, ((exp (-x) * x ^ (s - 1) : ℝ) : ℂ) by - have cc : ∀ r : ℝ, Complex.ofReal r = @RCLike.ofReal ℂ _ r := fun r => rfl - conv_lhs => rw [this]; enter [1, 2, x]; rw [cc] - rw [_root_.integral_ofReal, ← cc, Complex.ofReal_re] - refine setIntegral_congr_fun measurableSet_Ioi fun x hx => ?_ - push_cast - rw [Complex.ofReal_cpow (le_of_lt hx)] - push_cast; rfl + rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s), + Complex.GammaIntegral_ofReal, Complex.ofReal_re] theorem Gamma_add_one {s : ℝ} (hs : s ≠ 0) : Gamma (s + 1) = s * Gamma s := by simp_rw [Gamma] @@ -521,7 +511,7 @@ theorem Gamma_ne_zero {s : ℝ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := apply n_ih · intro m specialize hs (1 + m) - contrapose hs + contrapose! hs rw [← eq_sub_iff_add_eq] at hs rw [hs] push_cast diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean index 53ea0ff4d7ae44..eee1e639cc2855 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean @@ -271,21 +271,13 @@ theorem tendsto_logGammaSeq (hf_conv : ConvexOn ℝ (Ioi 0) f) rw [sub_add_cancel, Nat.sub_add_cancel hn] at this rw [this] ring - replace hm := - ((Tendsto.congr' this hm).add (tendsto_const_nhds : Tendsto (fun _ => log (x - 1)) _ _)).comp - (tendsto_add_atTop_nat 1) - have : - ((fun x_1 : ℕ => - (fun n : ℕ => - logGammaSeq x (n - 1) + x * (log (↑(n - 1) + 1) - log ↑(n - 1)) - log (x - 1)) - x_1 + - (fun b : ℕ => log (x - 1)) x_1) ∘ - fun a : ℕ => a + 1) = - fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n) := by - ext1 n - dsimp only [Function.comp_apply] - rw [sub_add_cancel, Nat.add_sub_cancel] - rw [this] at hm + replace hm : + Tendsto (fun n => logGammaSeq x n + x * (log (↑n + 1) - log ↑n)) atTop + (𝓝 (f (x - 1) - f 1 + log (x - 1))) := by + simpa [Function.comp_def, Nat.add_sub_cancel] using + (((Tendsto.congr' this hm).add + (tendsto_const_nhds : Tendsto (fun _ => log (x - 1)) _ _)).comp + (tendsto_add_atTop_nat 1)) convert hm.sub (tendsto_log_nat_add_one_sub_log.const_mul x) using 2 · ring · have := hf_feq ((Nat.cast_nonneg m).trans_lt hy) diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean index f6c3cacfd22085..3f43294b09daeb 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean @@ -97,13 +97,7 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤ rw [mul_assoc] · intro y hy have absy : |y| ≤ |c| := by - rcases le_or_gt 0 c with (h | h) - · rw [uIoc_of_le h] at hy - rw [abs_of_nonneg h, abs_of_pos hy.1] - exact hy.2 - · rw [uIoc_of_ge h.le] at hy - rw [abs_of_neg h, abs_of_nonpos hy.2, neg_le_neg_iff] - exact hy.1.le + simpa using Set.abs_sub_left_of_mem_uIcc (Set.uIoc_subset_uIcc hy) rw [norm_mul, norm_I, one_mul, two_mul] refine (norm_sub_le _ _).trans (add_le_add (vert_norm_bound hT absy) ?_) rw [← abs_neg y] at absy diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean index 9337e217183da0..36369ef668f727 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean @@ -288,27 +288,20 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) : -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for complex `b`. theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) : ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 := by + let f : ℝ → ℂ := fun x => cexp (-b * (x : ℂ) ^ 2) have full_integral := integral_gaussian_complex hb - have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi - rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral - suffices ∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) by - rw [this, ← mul_two] at full_integral - rwa [eq_div_iff]; exact two_ne_zero - have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) = - ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by - intro c - have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c) - (fun x => cexp (-b * (x : ℂ) ^ 2)) 0 - simpa [zero_sub, neg_sq, neg_zero] using this - have t1 := - intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id - have t2 : - Tendsto (fun c : ℝ => ∫ x : ℝ in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2)) atTop - (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * (x : ℂ) ^ 2))) := by - simp_rw [this] - refine intervalIntegral_tendsto_integral_Iic _ ?_ tendsto_neg_atTop_atBot - apply (integrable_cexp_neg_mul_sq hb).integrableOn - exact tendsto_nhds_unique t2 t1 + have h_eq : ∫ x : ℝ in Iic 0, f x = ∫ x : ℝ in Ioi 0, f x := by + calc + ∫ x : ℝ in Iic 0, f x = ∫ x : ℝ in Ioi 0, f (-x) := by + simpa [f] using (integral_comp_neg_Ioi (c := 0) (f := f)).symm + _ = ∫ x : ℝ in Ioi 0, f x := by + refine setIntegral_congr_fun measurableSet_Ioi ?_ + intro x hx + simp [f] + have hmeas : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi + rw [← integral_add_compl hmeas (integrable_cexp_neg_mul_sq hb), compl_Ioi, h_eq, ← mul_two] + at full_integral + exact (eq_div_iff two_ne_zero).2 (by simpa [mul_comm] using full_integral) -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for real `b`. theorem integral_gaussian_Ioi (b : ℝ) : diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean index 8289d76547c935..a63812929e6ee4 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/PoissonSummation.lean @@ -88,22 +88,14 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) : 1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n + I * b) ^ 2) := by let f : ℝ → ℂ := fun x ↦ cexp (-π * a * x ^ 2 + 2 * π * b * x) have hCf : Continuous f := by - refine Complex.continuous_exp.comp (Continuous.add ?_ ?_) - · exact continuous_const.mul (Complex.continuous_ofReal.pow 2) - · exact continuous_const.mul Complex.continuous_ofReal + fun_prop have hFf : 𝓕 f = fun x : ℝ ↦ 1 / a ^ (1 / 2 : ℂ) * cexp (-π / a * (x + I * b) ^ 2) := fourier_gaussian_pi' ha b - have h1 : 0 < (↑π * a).re := by - rw [re_ofReal_mul] - exact mul_pos pi_pos ha - have h2 : 0 < (↑π / a).re := by - rw [div_eq_mul_inv, re_ofReal_mul, inv_re] - refine mul_pos pi_pos (div_pos ha <| normSq_pos.mpr ?_) - contrapose! ha - rw [ha, zero_re] have f_bd : f =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ)) := by - convert (cexp_neg_quadratic_isLittleO_abs_rpow_cocompact ?_ _ (-2)).isBigO - rwa [neg_mul, neg_re, neg_lt_zero] + convert + (cexp_neg_quadratic_isLittleO_abs_rpow_cocompact (a := -π * a) (b := 2 * π * b) + (by simpa [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos ha) + (-2)).isBigO have Ff_bd : (𝓕 f) =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ)) := by rw [hFf] have : ∀ (x : ℝ), -↑π / a * (↑x + I * b) ^ 2 = @@ -111,9 +103,13 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) : intro x; ring_nf; rw [I_sq]; ring simp_rw [this] conv => enter [2, x]; rw [Complex.exp_add, ← mul_assoc _ _ (Complex.exp _), mul_comm] - refine ((cexp_neg_quadratic_isLittleO_abs_rpow_cocompact - (?_) (-2 * ↑π * I * b / a) (-2)).isBigO.const_mul_left _).const_mul_left _ - rwa [neg_div, neg_re, neg_lt_zero] + refine ((cexp_neg_quadratic_isLittleO_abs_rpow_cocompact (a := -π / a) + (b := (-2 * ↑π * I * b) / a) + (by + rw [neg_div, neg_re, neg_lt_zero, div_eq_mul_inv, re_ofReal_mul, inv_re] + refine mul_pos pi_pos (div_pos ha <| normSq_pos.mpr ?_) + contrapose! ha + rw [ha, zero_re]) (-2)).isBigO.const_mul_left _).const_mul_left _ convert Real.tsum_eq_tsum_fourier_of_rpow_decay hCf one_lt_two f_bd Ff_bd 0 using 1 · simp only [f, zero_add, ofReal_intCast] · rw [← tsum_mul_left] From 518b836de421a352bdc3454d1debff206e649f66 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Wed, 15 Apr 2026 22:50:34 +0800 Subject: [PATCH 19/29] Apply suggestions from code review Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com> --- Mathlib/Analysis/Complex/Trigonometric.lean | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mathlib/Analysis/Complex/Trigonometric.lean b/Mathlib/Analysis/Complex/Trigonometric.lean index f9def655cd0131..a7ec01f9021317 100644 --- a/Mathlib/Analysis/Complex/Trigonometric.lean +++ b/Mathlib/Analysis/Complex/Trigonometric.lean @@ -501,11 +501,10 @@ theorem tan_sq_div_one_add_tan_sq {x : ℂ} (hx : cos x ≠ 0) : simp only [← tan_mul_cos hx, mul_pow, ← inv_one_add_tan_sq hx, div_eq_mul_inv] theorem cos_three_mul : cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x := by - rw [← cosh_mul_I, show (3 * x) * I = 3 * (x * I) by ring, cosh_three_mul, cosh_mul_I] + rw [← cosh_mul_I, mul_assoc, cosh_three_mul, cosh_mul_I] theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by - rw [← mul_left_inj' I_ne_zero, ← sinh_mul_I, show (3 * x) * I = 3 * (x * I) by ring, - sinh_three_mul, sinh_mul_I] + rw [← mul_left_inj' I_ne_zero, ← sinh_mul_I, mul_assoc, sinh_three_mul, sinh_mul_I] grind [I_sq] theorem exp_mul_I : exp (x * I) = cos x + sin x * I := From a1fe78b0814defdbd836c4ef5af9d6dcf71e5d98 Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Thu, 16 Apr 2026 07:20:36 +0800 Subject: [PATCH 20/29] golf Analysis/Normed --- Mathlib/Analysis/Normed/Lp/SmoothApprox.lean | 12 ++---- Mathlib/Analysis/Normed/Lp/WithLp.lean | 12 ++---- Mathlib/Analysis/Normed/Lp/lpSpace.lean | 13 +------ .../Normed/Module/ContinuousInverse.lean | 7 +--- Mathlib/Analysis/Normed/Module/Convex.lean | 9 +---- Mathlib/Analysis/Normed/Module/Dual.lean | 17 ++------ .../Analysis/Normed/Module/RieszLemma.lean | 10 +---- .../SpecialFunctions/Log/Monotone.lean | 21 ++++------ .../SpecialFunctions/Log/Summable.lean | 39 ++++--------------- .../SpecialFunctions/Pow/Continuity.lean | 22 ++++------- .../SpecialFunctions/Trigonometric/Angle.lean | 22 ++++------- 11 files changed, 48 insertions(+), 136 deletions(-) diff --git a/Mathlib/Analysis/Normed/Lp/SmoothApprox.lean b/Mathlib/Analysis/Normed/Lp/SmoothApprox.lean index db401a5fba0e7a..0859333ff0af25 100644 --- a/Mathlib/Analysis/Normed/Lp/SmoothApprox.lean +++ b/Mathlib/Analysis/Normed/Lp/SmoothApprox.lean @@ -97,13 +97,9 @@ theorem _root_.MeasureTheory.Lp.dense_hasCompactSupport_contDiff {p : ℝ≥0∞ refine (mem_closure_iff_nhds_basis Metric.nhds_basis_closedBall).2 fun ε hε ↦ ?_ obtain ⟨g, hg₁, hg₂, hg₃⟩ := exist_eLpNorm_sub_le hp hp₂.out (Lp.memLp f) hε have hg₄ : MemLp g p μ := hg₂.continuous.memLp_of_hasCompactSupport hg₁ - use hg₄.toLp - use ⟨g, hg₄.coeFn_toLp, hg₁, hg₂⟩ - rw [Metric.mem_closedBall, dist_comm, Lp.dist_def, - ← le_ofReal_iff_toReal_le ((Lp.memLp f).sub (Lp.memLp hg₄.toLp)).eLpNorm_ne_top hε.le] - convert hg₃ using 1 - apply eLpNorm_congr_ae - gcongr - exact hg₄.coeFn_toLp + refine ⟨hg₄.toLp, ⟨g, hg₄.coeFn_toLp, hg₁, hg₂⟩, ?_⟩ + rw [Metric.mem_closedBall, dist_comm, ← Lp.toLp_coeFn f (Lp.memLp f), Lp.dist_edist, + Lp.edist_toLp_toLp _ _ (Lp.memLp f) hg₄] + exact ENNReal.toReal_le_of_le_ofReal hε.le hg₃ end MeasureTheory.MemLp diff --git a/Mathlib/Analysis/Normed/Lp/WithLp.lean b/Mathlib/Analysis/Normed/Lp/WithLp.lean index 6eaa39716ce974..847baeb70474e4 100644 --- a/Mathlib/Analysis/Normed/Lp/WithLp.lean +++ b/Mathlib/Analysis/Normed/Lp/WithLp.lean @@ -177,17 +177,13 @@ end AddCommGroup @[to_additive] instance instIsScalarTower [SMul K K'] [SMul K V] [SMul K' V] [IsScalarTower K K' V] : - IsScalarTower K K' (WithLp p V) where - smul_assoc x y z := by - change toLp p ((x • y) • (ofLp z)) = toLp p (x • y • ofLp z) - simp + IsScalarTower K K' (WithLp p V) := + (WithLp.equiv p V).isScalarTower K K' @[to_additive] instance instSMulCommClass [SMul K V] [SMul K' V] [SMulCommClass K K' V] : - SMulCommClass K K' (WithLp p V) where - smul_comm x y z := by - change toLp p (x • y • ofLp z) = toLp p (y • x • ofLp z) - rw [smul_comm] + SMulCommClass K K' (WithLp p V) := + (WithLp.equiv p V).smulCommClass K K' variable (K V) diff --git a/Mathlib/Analysis/Normed/Lp/lpSpace.lean b/Mathlib/Analysis/Normed/Lp/lpSpace.lean index 40298d3fbf4fd9..51d46ffa1880ec 100644 --- a/Mathlib/Analysis/Normed/Lp/lpSpace.lean +++ b/Mathlib/Analysis/Normed/Lp/lpSpace.lean @@ -1259,17 +1259,8 @@ open scoped Topology uniformity /-- 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) := by - have hp : p ≠ 0 := (zero_lt_one.trans_le _i.elim).ne' - rw [uniformContinuous_pi] - intro i - rw [NormedAddCommGroup.uniformity_basis_dist.uniformContinuous_iff - NormedAddCommGroup.uniformity_basis_dist] - intro ε hε - refine ⟨ε, hε, ?_⟩ - rintro f g (hfg : ‖f - g‖ < ε) - have : ‖f i - g i‖ ≤ ‖f - g‖ := norm_apply_le_norm hp (f - g) i - exact this.trans_lt hfg + UniformContinuous (α := lp E p) ((↑) : lp E p → ∀ i, E i) := + uniformContinuous_pi.2 fun i => (lipschitzWith_one_eval (E := E) p i).uniformContinuous variable {ι : Type*} {l : Filter ι} [Filter.NeBot l] diff --git a/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean b/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean index 08fe0ab7ababd0..3ca48242396651 100644 --- a/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean +++ b/Mathlib/Analysis/Normed/Module/ContinuousInverse.lean @@ -219,11 +219,8 @@ section variable [T1Space F] lemma isClosed_range (hf : f.HasLeftInverse) [IsTopologicalAddGroup F] : - IsClosed (range f) := by - -- `range f = ker (f ∘ g - id)` is closed since `f ∘ g - id` is continuous. - rw [← f.range_toLinearMap, ← f.coe_range, - f.range_eq_ker_of_leftInverse (hf.leftInverse_leftInverse)] - exact ((f.comp hf.leftInverse) - (ContinuousLinearMap.id R F)).isClosed_ker + IsClosed (range f) := + hf.leftInverse_leftInverse.isClosed_range hf.leftInverse.continuous f.continuous /-- Choice of a closed complement of `range f` -/ def complement (h : f.HasLeftInverse) : Submodule R F := diff --git a/Mathlib/Analysis/Normed/Module/Convex.lean b/Mathlib/Analysis/Normed/Module/Convex.lean index e2ea87ddaa3fc8..02dfd7f2f6fd4e 100644 --- a/Mathlib/Analysis/Normed/Module/Convex.lean +++ b/Mathlib/Analysis/Normed/Module/Convex.lean @@ -182,13 +182,8 @@ theorem isConnected_setOf_sameRay_and_ne_zero {x : E} (hx : x ≠ 0) : lemma norm_sub_le_of_mem_segment {x y z : E} (hy : y ∈ segment ℝ x z) : ‖y - x‖ ≤ ‖z - x‖ := by - rw [segment_eq_image'] at hy - simp only [mem_image, mem_Icc] at hy - obtain ⟨u, ⟨hu_nonneg, hu_le_one⟩, rfl⟩ := hy - simp only [add_sub_cancel_left, norm_smul, Real.norm_eq_abs] - rw [abs_of_nonneg hu_nonneg] - conv_rhs => rw [← one_mul (‖z - x‖)] - gcongr + simpa [mem_closedBall, dist_eq_norm, dist_comm, norm_sub_rev] using + (segment_subset_closedBall_left x z hy) namespace Filter diff --git a/Mathlib/Analysis/Normed/Module/Dual.lean b/Mathlib/Analysis/Normed/Module/Dual.lean index 45de9937f53299..063417bde36ea3 100644 --- a/Mathlib/Analysis/Normed/Module/Dual.lean +++ b/Mathlib/Analysis/Normed/Module/Dual.lean @@ -117,20 +117,9 @@ theorem polar_closedBall {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [ theorem polar_ball {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] {r : ℝ} (hr : 0 < r) : StrongDual.polar 𝕜 (ball (0 : E) r) = closedBall (0 : StrongDual 𝕜 E) r⁻¹ := by - apply le_antisymm - · intro x hx - rw [mem_closedBall_zero_iff] - apply le_of_forall_gt_imp_ge_of_dense - intro a ha - rw [← mem_closedBall_zero_iff, ← (mul_div_cancel_left₀ a (Ne.symm (ne_of_lt hr)))] - rw [← RCLike.norm_of_nonneg (K := 𝕜) (le_trans zero_le_one - (le_of_lt ((inv_lt_iff_one_lt_mul₀' hr).mp ha)))] - apply polar_ball_subset_closedBall_div _ hr hx - rw [RCLike.norm_of_nonneg (K := 𝕜) (le_trans zero_le_one - (le_of_lt ((inv_lt_iff_one_lt_mul₀' hr).mp ha)))] - exact (inv_lt_iff_one_lt_mul₀' hr).mp ha - · rw [← polar_closedBall hr] - exact LinearMap.polar_antitone _ ball_subset_closedBall + letI : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E + rw [← polar_closure (𝕜 := 𝕜) (s := ball (0 : E) r), closure_ball (0 : E) hr.ne', + polar_closedBall hr] /-- Given a neighborhood `s` of the origin in a normed space `E`, the dual norms of all elements of the polar `polar 𝕜 s` are bounded by a constant. -/ diff --git a/Mathlib/Analysis/Normed/Module/RieszLemma.lean b/Mathlib/Analysis/Normed/Module/RieszLemma.lean index 2344fefa388518..9020023265d17f 100644 --- a/Mathlib/Analysis/Normed/Module/RieszLemma.lean +++ b/Mathlib/Analysis/Normed/Module/RieszLemma.lean @@ -52,9 +52,7 @@ theorem riesz_lemma {F : Subspace 𝕜 E} (hFc : IsClosed (F : Set E)) (hF : ∃ obtain ⟨x, hx⟩ : ∃ x : E, x ∉ F := hF let d := Metric.infDist x F have hFn : (F : Set E).Nonempty := ⟨_, F.zero_mem⟩ - have hdp : 0 < d := - lt_of_le_of_ne Metric.infDist_nonneg fun heq => - hx ((hFc.mem_iff_infDist_zero hFn).2 heq.symm) + have hdp : 0 < d := (hFc.notMem_iff_infDist_pos hFn).1 hx let r' := max r 2⁻¹ have hr' : r' < 1 := by simp only [r', max_lt_iff, hr, true_and] @@ -62,11 +60,7 @@ theorem riesz_lemma {F : Subspace 𝕜 E} (hFc : IsClosed (F : Set E)) (hF : ∃ have hlt : 0 < r' := lt_of_lt_of_le (by simp) (le_max_right r 2⁻¹) have hdlt : d < d / r' := (lt_div_iff₀ hlt).mpr ((mul_lt_iff_lt_one_right hdp).2 hr') obtain ⟨y₀, hy₀F, hxy₀⟩ : ∃ y ∈ F, dist x y < d / r' := (Metric.infDist_lt_iff hFn).mp hdlt - have x_ne_y₀ : x - y₀ ∉ F := by - by_contra h - have : x - y₀ + y₀ ∈ F := F.add_mem h hy₀F - simp only [neg_add_cancel_right, sub_eq_add_neg] at this - exact hx this + have x_ne_y₀ : x - y₀ ∉ F := by rwa [F.sub_mem_iff_left hy₀F] refine ⟨x - y₀, x_ne_y₀, fun y hy => le_of_lt ?_⟩ have hy₀y : y₀ + y ∈ F := F.add_mem hy₀F hy calc diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean b/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean index 1040d2f6ccd5c3..412d2657479703 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Monotone.lean @@ -54,6 +54,13 @@ theorem log_div_self_antitoneOn : AntitoneOn (fun x : ℝ => log x / x) { x | ex theorem log_div_self_rpow_antitoneOn {a : ℝ} (ha : 0 < a) : AntitoneOn (fun x : ℝ => log x / x ^ a) { x | exp (1 / a) ≤ x } := by simp only [AntitoneOn, mem_setOf_eq] + have hbound : ∀ {z : ℝ}, exp (1 / a) ≤ z → exp 1 ≤ z ^ a := by + intro z hz + convert rpow_le_rpow _ hz (le_of_lt ha) using 1 + · rw [← exp_mul] + simp only [Real.exp_eq_exp] + field + · positivity intro x hex y _ hxy have x_pos : 0 < x := lt_of_lt_of_le (exp_pos (1 / a)) hex have y_pos : 0 < y := by linarith @@ -62,19 +69,7 @@ theorem log_div_self_rpow_antitoneOn {a : ℝ} (ha : 0 < a) : rw [← div_self (ne_of_lt ha).symm, div_eq_mul_one_div a a, rpow_mul y_pos.le, rpow_mul x_pos.le, log_rpow (rpow_pos_of_pos y_pos a), log_rpow (rpow_pos_of_pos x_pos a), mul_div_assoc, mul_div_assoc, mul_le_mul_iff_right₀ (one_div_pos.mpr ha)] - refine log_div_self_antitoneOn ?_ ?_ ?_ - · simp only [Set.mem_setOf_eq] - convert rpow_le_rpow _ hex (le_of_lt ha) using 1 - · rw [← exp_mul] - simp only [Real.exp_eq_exp] - field - positivity - · simp only [Set.mem_setOf_eq] - convert rpow_le_rpow _ (_root_.trans hex hxy) (le_of_lt ha) using 1 - · rw [← exp_mul] - simp only [Real.exp_eq_exp] - field - positivity + refine log_div_self_antitoneOn (hbound hex) (hbound (_root_.trans hex hxy)) ?_ gcongr theorem log_div_sqrt_antitoneOn : AntitoneOn (fun x : ℝ => log x / √x) { x | exp 2 ≤ x } := by diff --git a/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean b/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean index 607d174bc9b38a..b058d52dec6308 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/Summable.lean @@ -158,43 +158,18 @@ lemma prod_vanishing_of_summable_norm (hf : Summable fun i ↦ ‖f i‖) {ε : have : Set.Iio ε ∈ nhds (f 0) := by simpa [f] using Iio_mem_nhds hε exact ContinuousAt.preimage_mem_nhds (by fun_prop) this -open Finset in -/-- In a complete normed ring, `∏' i, (1 + f i)` is convergent if the sum of real numbers -`∑' i, ‖f i‖` is convergent. -/ -lemma multipliable_one_add_of_summable [CompleteSpace R] - (hf : Summable fun i ↦ ‖f i‖) : Multipliable fun i ↦ (1 + f i) := by - classical - refine CompleteSpace.complete <| Metric.cauchy_iff.mpr ⟨by infer_instance, fun ε hε ↦ ?_⟩ - obtain ⟨r₁, hr₁, s₁, hs₁⟩ := - (multipliable_norm_one_add_of_summable_norm hf).eventually_bounded_finset_prod - obtain ⟨s₂, hs₂⟩ := prod_vanishing_of_summable_norm hf (show 0 < ε / (2 * r₁) by positivity) - simp only [unconditional, Filter.mem_map, mem_atTop_sets, ge_iff_le, le_eq_subset, - Set.mem_preimage] - let s := s₁ ∪ s₂ - -- The idea here is that if `s` is a large enough finset, then the product over `s` is bounded - -- by some `r`, and the product over finsets disjoint from `s` is within `ε / (2 * r)` of 1. - -- From this it follows that the products over any two finsets containing `s` are within `ε` of - -- each other. - -- Here `s₁ ⊆ s` guarantees that the product over `s` is bounded, and `s₂ ⊆ s` guarantees that - -- the product over terms not in `s` is small. - refine ⟨Metric.ball (∏ i ∈ s, (1 + f i)) (ε / 2), ⟨s, fun b hb ↦ ?_⟩, ?_⟩ - · rw [← union_sdiff_of_subset hb, prod_union sdiff_disjoint.symm, - Metric.mem_ball, dist_eq_norm_sub, ← mul_sub_one, - show ε / 2 = r₁ * (ε / (2 * r₁)) by field] - apply (norm_mul_le _ _).trans_lt - refine lt_of_le_of_lt (b := r₁ * ‖∏ x ∈ b \ s, (1 + f x) - 1‖) ?_ ?_ - · refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _) - exact (Finset.norm_prod_le _ _).trans (hs₁ _ subset_union_left) - · refine mul_lt_mul_of_pos_left (hs₂ _ ?_) hr₁ - simp [s, sdiff_union_distrib, disjoint_iff_inter_eq_empty] - · intro x hx y hy - exact (dist_triangle_right _ _ (∏ i ∈ s, (1 + f i))).trans_lt (add_halves ε ▸ add_lt_add hx hy) - lemma summable_finset_prod_of_summable_norm [CompleteSpace R] (hf : Summable (fun i ↦ ‖f i‖)) : Summable (fun s ↦ ∏ i ∈ s, f i) := (summable_finset_prod_of_summable_nonneg (fun _ ↦ norm_nonneg _) hf).of_norm_bounded fun _ ↦ Finset.norm_prod_le _ _ +open Finset in +/-- In a complete normed ring, `∏' i, (1 + f i)` is convergent if the sum of real numbers +`∑' i, ‖f i‖` is convergent. -/ +lemma multipliable_one_add_of_summable [CompleteSpace R] + (hf : Summable fun i ↦ ‖f i‖) : Multipliable fun i ↦ (1 + f i) := + multipliable_one_add_of_summable_prod (summable_finset_prod_of_summable_norm hf) + lemma Summable.summable_log_norm_one_add (hu : Summable fun n ↦ ‖f n‖) : Summable fun i ↦ Real.log ‖1 + f i‖ := by suffices Summable (‖1 + f ·‖ - 1) from diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean index b87c2190a169b8..d632e86a22a4bd 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean @@ -53,18 +53,13 @@ theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) : this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] - refine IsOpen.eventually_mem ?_ hp_fst - change IsOpen { x : ℂ × ℂ | x.1 = 0 }ᶜ - rw [isOpen_compl_iff] - exact isClosed_eq continuous_fst continuous_const + exact (isOpen_ne.preimage continuous_fst).eventually_mem hp_fst -- Continuity of `fun x => a ^ x`: union of these two lemmas is optimal. theorem continuousAt_const_cpow {a b : ℂ} (ha : a ≠ 0) : ContinuousAt (fun x : ℂ => a ^ x) b := by - have cpow_eq : (fun x : ℂ => a ^ x) = fun x => exp (log a * x) := by - ext1 b - rw [cpow_def_of_ne_zero ha] - rw [cpow_eq] - exact continuous_exp.continuousAt.comp (ContinuousAt.mul continuousAt_const continuousAt_id) + simpa [cpow_def_of_ne_zero ha] using + (Complex.continuous_exp.continuousAt.comp + (ContinuousAt.mul continuousAt_const continuousAt_id)) theorem continuousAt_const_cpow' {a b : ℂ} (h : b ≠ 0) : ContinuousAt (fun x : ℂ => a ^ x) b := by by_cases ha : a = 0 @@ -345,12 +340,9 @@ theorem continuousAt_ofReal_cpow (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0) refine (continuousAt_cpow (Or.inl ?_)).comp this rwa [ofReal_re] · -- x = 0 : reduce to continuousAt_cpow_zero_of_re_pos - have A : ContinuousAt (fun p => p.1 ^ p.2 : ℂ × ℂ → ℂ) ⟨↑(0 : ℝ), y⟩ := by - rw [ofReal_zero] - apply continuousAt_cpow_zero_of_re_pos - tauto - have B : ContinuousAt (fun p => ⟨↑p.1, p.2⟩ : ℝ × ℂ → ℂ × ℂ) ⟨0, y⟩ := by fun_prop - exact A.comp_of_eq B rfl + have hcoe : ContinuousAt (fun p : ℝ × ℂ => (↑p.1, p.2) : ℝ × ℂ → ℂ × ℂ) (0, y) := by + fun_prop + exact (continuousAt_cpow_zero_of_re_pos (z := y) (by tauto)).comp_of_eq hcoe rfl · -- x < 0 : difficult case suffices ContinuousAt (fun p => (-(p.1 : ℂ)) ^ p.2 * exp (π * I * p.2) : ℝ × ℂ → ℂ) (x, y) by refine this.congr (eventually_of_mem (prod_mem_nhds (Iio_mem_nhds hx) univ_mem) ?_) diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean index af25e8269cbe74..a9b844a4d204ea 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean @@ -545,12 +545,7 @@ theorem abs_toReal_coe_eq_self_iff {θ : ℝ} : |(θ : Angle).toReal| = θ ↔ 0 abs_eq_self.2 h.1⟩ theorem abs_toReal_neg_coe_eq_self_iff {θ : ℝ} : |(-θ : Angle).toReal| = θ ↔ 0 ≤ θ ∧ θ ≤ π := by - refine ⟨fun h => h ▸ ⟨abs_nonneg _, abs_toReal_le_pi _⟩, fun h => ?_⟩ - by_cases hnegpi : θ = π; · simp [hnegpi, Real.pi_pos.le] - rw [← coe_neg, - toReal_coe_eq_self_iff.2 - ⟨neg_lt_neg (lt_of_le_of_ne h.2 hnegpi), (neg_nonpos.2 h.1).trans Real.pi_pos.le⟩, - abs_neg, abs_eq_self.2 h.1] + simpa [coe_neg] using (abs_toReal_coe_eq_self_iff (θ := θ)) theorem abs_toReal_eq_pi_div_two_iff {θ : Angle} : |θ.toReal| = π / 2 ↔ θ = (π / 2 : ℝ) ∨ θ = (-π / 2 : ℝ) := by @@ -862,15 +857,12 @@ theorem two_zsmul_eq_iff_eq {a b : Real.Angle} (ha : a.sign ≠ 0) (h : a.sign = (2 : ℤ) • a = (2 : ℤ) • b ↔ a = b := by rw [Real.Angle.two_zsmul_eq_iff] constructor - · intro h - rcases h with h1 | h2 - · exact h1 - · have : a.sign = (b + π).sign := by aesop - rw [Real.Angle.sign_add_pi] at this - have := congr_arg (· = b.sign) this - aesop - · intro h - aesop + · intro h' + have hb : b.sign ≠ 0 := by simpa [h] using ha + exact h'.resolve_right <| by + simpa [sub_eq_iff_eq_add, add_comm] using sub_ne_pi_of_sign_eq_of_sign_ne_zero a b h hb + · rintro rfl + exact Or.inl rfl lemma abs_toReal_add_abs_toReal_eq_pi_of_two_nsmul_add_eq_zero_of_sign_eq {θ ψ : Angle} (h : (2 : ℕ) • (θ + ψ) = 0) (hs : θ.sign = ψ.sign) (h0 : θ.sign ≠ 0) : From 2d73ec919a50849545b8e7f1a65d19f939691636 Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Thu, 16 Apr 2026 10:10:08 +0800 Subject: [PATCH 21/29] golf Analysis/Normed --- .../Normed/Module/FiniteDimension.lean | 141 +++++++----------- .../Normed/Operator/BoundedLinearMaps.lean | 8 +- Mathlib/Analysis/Normed/Operator/Extend.lean | 11 +- .../Normed/Operator/LinearIsometry.lean | 8 +- Mathlib/Analysis/Normed/Operator/NNNorm.lean | 11 +- 5 files changed, 60 insertions(+), 119 deletions(-) diff --git a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean index 099e03c86b446d..e5f5f1d5f06996 100644 --- a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean +++ b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean @@ -259,30 +259,55 @@ theorem ContinuousLinearMap.isOpen_injective [FiniteDimensional 𝕜 E] : exact ⟨(K⁻¹ - ‖φ - φ₀‖₊)⁻¹, inv_pos_of_pos (tsub_pos_of_lt hφ), H.add_sub_lipschitzWith (φ - φ₀).lipschitz hφ⟩ +open ContinuousLinearMap + +/-- Continuous linear equivalence between continuous linear functions `𝕜ⁿ → E` and `Eⁿ`. +The spaces `𝕜ⁿ` and `Eⁿ` are represented as `ι → 𝕜` and `ι → E`, respectively, +where `ι` is a finite type. -/ +def ContinuousLinearEquiv.piRing (ι : Type*) [Fintype ι] [DecidableEq ι] : + ((ι → 𝕜) →L[𝕜] E) ≃L[𝕜] ι → E := + { LinearMap.toContinuousLinearMap.symm.trans (LinearEquiv.piRing 𝕜 E ι 𝕜) with + continuous_toFun := by + refine continuous_pi fun i => ?_ + exact (ContinuousLinearMap.apply 𝕜 E (Pi.single i 1)).continuous + continuous_invFun := by + simp_rw [LinearEquiv.invFun_eq_symm, LinearEquiv.trans_symm, LinearEquiv.symm_symm] + -- Note: added explicit type and removed `change` that tried to achieve the same + refine AddMonoidHomClass.continuous_of_bound + (LinearMap.toContinuousLinearMap.toLinearMap.comp + (LinearEquiv.piRing 𝕜 E ι 𝕜).symm.toLinearMap) + (Fintype.card ι : ℝ) fun g => ?_ + rw [← nsmul_eq_mul] + refine opNorm_le_bound _ (nsmul_nonneg (norm_nonneg g) (Fintype.card ι)) fun t => ?_ + simp_rw [LinearMap.coe_comp, LinearEquiv.coe_toLinearMap, Function.comp_apply, + LinearMap.coe_toContinuousLinearMap', LinearEquiv.piRing_symm_apply] + apply le_trans (norm_sum_le _ _) + rw [smul_mul_assoc] + refine Finset.sum_le_card_nsmul _ _ _ fun i _ => ?_ + rw [norm_smul, mul_comm] + gcongr <;> apply norm_le_pi_norm } + protected theorem LinearIndependent.eventually {ι} [Finite ι] {f : ι → E} (hf : LinearIndependent 𝕜 f) : ∀ᶠ g in 𝓝 f, LinearIndependent 𝕜 g := by cases nonempty_fintype ι classical - simp only [Fintype.linearIndependent_iff'] at hf ⊢ - rcases LinearMap.exists_antilipschitzWith _ hf with ⟨K, K0, hK⟩ - have : Tendsto (fun g : ι → E => ∑ i, ‖g i - f i‖) (𝓝 f) (𝓝 <| ∑ i, ‖f i - f i‖) := - tendsto_finset_sum _ fun i _ => - Tendsto.norm <| ((continuous_apply i).tendsto _).sub tendsto_const_nhds - simp only [sub_self, norm_zero, Finset.sum_const_zero] at this - refine (this.eventually (gt_mem_nhds <| inv_pos.2 K0)).mono fun g hg => ?_ - replace hg : ∑ i, ‖g i - f i‖₊ < K⁻¹ := by - rw [← NNReal.coe_lt_coe] - push_cast - exact hg - rw [LinearMap.ker_eq_bot] - refine (hK.add_sub_lipschitzWith (LipschitzWith.of_dist_le_mul fun v u => ?_) hg).injective - simp only [dist_eq_norm, LinearMap.lsum_apply, Pi.sub_apply, LinearMap.sum_apply, - LinearMap.comp_apply, LinearMap.proj_apply, LinearMap.smulRight_apply, LinearMap.id_apply, ← - Finset.sum_sub_distrib, ← smul_sub, ← sub_smul, NNReal.coe_sum, coe_nnnorm, Finset.sum_mul] - refine norm_sum_le_of_le _ fun i _ => ?_ - rw [norm_smul, mul_comm] - gcongr - exact norm_le_pi_norm (v - u) i + let e : ((ι → 𝕜) →L[𝕜] E) ≃L[𝕜] ι → E := ContinuousLinearEquiv.piRing (𝕜 := 𝕜) (E := E) ι + have hopen : IsOpen {g : ι → E | LinearIndependent 𝕜 g} := by + convert + ContinuousLinearMap.isOpen_injective (𝕜 := 𝕜) (E := ι → 𝕜) (F := E) |>.preimage + e.symm.continuous using 1 + ext g + change LinearIndependent 𝕜 g ↔ Function.Injective ⇑(e.symm g) + let L : (ι → 𝕜) →ₗ[𝕜] E := + LinearMap.lsum 𝕜 (fun _ ↦ 𝕜) ℕ fun i ↦ LinearMap.id.smulRight (g i) + have hL : (e.symm g : (ι → 𝕜) →L[𝕜] E) = L.toContinuousLinearMap := by + ext c + change (LinearEquiv.piRing 𝕜 E ι 𝕜).symm g c = _ + rw [LinearEquiv.piRing_symm_apply] + simp [L] + rw [show LinearIndependent 𝕜 g ↔ Function.Injective L from Fintype.linearIndependent_iff'ₛ] + simp [hL] + exact IsOpen.mem_nhds hopen hf theorem isOpen_setOf_linearIndependent {ι : Type*} [Finite ι] : IsOpen { f : ι → E | LinearIndependent 𝕜 f } := @@ -355,48 +380,12 @@ end Module.Basis instance [FiniteDimensional 𝕜 E] [SecondCountableTopology F] : SecondCountableTopology (E →L[𝕜] F) := by - set d := Module.finrank 𝕜 E - suffices - ∀ ε > (0 : ℝ), ∃ n : (E →L[𝕜] F) → Fin d → ℕ, ∀ f g : E →L[𝕜] F, n f = n g → dist f g ≤ ε from - Metric.secondCountable_of_countable_discretization fun ε ε_pos => - ⟨Fin d → ℕ, by infer_instance, this ε ε_pos⟩ - intro ε ε_pos - obtain ⟨u : ℕ → F, hu : DenseRange u⟩ := exists_dense_seq F - let v := Module.finBasis 𝕜 E - obtain - ⟨C : ℝ, C_pos : 0 < C, hC : - ∀ {φ : E →L[𝕜] F} {M : ℝ}, 0 ≤ M → (∀ i, ‖φ (v i)‖ ≤ M) → ‖φ‖ ≤ C * M⟩ := - v.exists_opNorm_le (E := E) (F := F) - have h_2C : 0 < 2 * C := mul_pos zero_lt_two C_pos - have hε2C : 0 < ε / (2 * C) := div_pos ε_pos h_2C - have : ∀ φ : E →L[𝕜] F, ∃ n : Fin d → ℕ, ‖φ - (v.constrL <| u ∘ n)‖ ≤ ε / 2 := by - intro φ - have : ∀ i, ∃ n, ‖φ (v i) - u n‖ ≤ ε / (2 * C) := by - simp only [norm_sub_rev] - intro i - have : φ (v i) ∈ closure (range u) := hu _ - obtain ⟨n, hn⟩ : ∃ n, ‖u n - φ (v i)‖ < ε / (2 * C) := by - rw [mem_closure_iff_nhds_basis Metric.nhds_basis_ball] at this - specialize this (ε / (2 * C)) hε2C - simpa [dist_eq_norm] - exact ⟨n, le_of_lt hn⟩ - choose n hn using this - use n - replace hn : ∀ i : Fin d, ‖(φ - (v.constrL <| u ∘ n)) (v i)‖ ≤ ε / (2 * C) := by simp [hn] - have : C * (ε / (2 * C)) = ε / 2 := by - rw [eq_div_iff (two_ne_zero : (2 : ℝ) ≠ 0), mul_comm, ← mul_assoc, - mul_div_cancel₀ _ (ne_of_gt h_2C)] - specialize hC (le_of_lt hε2C) hn - rwa [this] at hC - choose n hn using this - set Φ := fun φ : E →L[𝕜] F => v.constrL <| u ∘ n φ - simp_rw [← dist_eq_norm] at hn - use n - intro x y hxy - calc - dist x y ≤ dist x (Φ x) + dist (Φ x) y := dist_triangle _ _ _ - _ = dist x (Φ x) + dist y (Φ y) := by simp [Φ, hxy, dist_comm] - _ ≤ ε := by linarith [hn x, hn y] + let d := Module.finrank 𝕜 E + let e₁ : E ≃L[𝕜] Fin d → 𝕜 := + ContinuousLinearEquiv.ofFinrankEq (@Module.finrank_fin_fun 𝕜 _ _ d).symm + let e₂ : (E →L[𝕜] F) ≃L[𝕜] Fin d → F := + (e₁.arrowCongr (1 : F ≃L[𝕜] F)).trans (ContinuousLinearEquiv.piRing (Fin d)) + exact e₂.toHomeomorph.secondCountableTopology theorem AffineSubspace.closed_of_finiteDimensional {P : Type*} [MetricSpace P] [NormedAddTorsor E P] (s : AffineSubspace 𝕜 P) [FiniteDimensional 𝕜 s.direction] : @@ -508,34 +497,6 @@ lemma FiniteDimensional.of_isCompactOperator_id (h : IsCompactOperator (id : E end Riesz -open ContinuousLinearMap - -/-- Continuous linear equivalence between continuous linear functions `𝕜ⁿ → E` and `Eⁿ`. -The spaces `𝕜ⁿ` and `Eⁿ` are represented as `ι → 𝕜` and `ι → E`, respectively, -where `ι` is a finite type. -/ -def ContinuousLinearEquiv.piRing (ι : Type*) [Fintype ι] [DecidableEq ι] : - ((ι → 𝕜) →L[𝕜] E) ≃L[𝕜] ι → E := - { LinearMap.toContinuousLinearMap.symm.trans (LinearEquiv.piRing 𝕜 E ι 𝕜) with - continuous_toFun := by - refine continuous_pi fun i => ?_ - exact (ContinuousLinearMap.apply 𝕜 E (Pi.single i 1)).continuous - continuous_invFun := by - simp_rw [LinearEquiv.invFun_eq_symm, LinearEquiv.trans_symm, LinearEquiv.symm_symm] - -- Note: added explicit type and removed `change` that tried to achieve the same - refine AddMonoidHomClass.continuous_of_bound - (LinearMap.toContinuousLinearMap.toLinearMap.comp - (LinearEquiv.piRing 𝕜 E ι 𝕜).symm.toLinearMap) - (Fintype.card ι : ℝ) fun g => ?_ - rw [← nsmul_eq_mul] - refine opNorm_le_bound _ (nsmul_nonneg (norm_nonneg g) (Fintype.card ι)) fun t => ?_ - simp_rw [LinearMap.coe_comp, LinearEquiv.coe_toLinearMap, Function.comp_apply, - LinearMap.coe_toContinuousLinearMap', LinearEquiv.piRing_symm_apply] - apply le_trans (norm_sum_le _ _) - rw [smul_mul_assoc] - refine Finset.sum_le_card_nsmul _ _ _ fun i _ => ?_ - rw [norm_smul, mul_comm] - gcongr <;> apply norm_le_pi_norm } - /-- A family of continuous linear maps is continuous on `s` if all its applications are. -/ theorem continuousOn_clm_apply {X : Type*} [TopologicalSpace X] [FiniteDimensional 𝕜 E] {f : X → E →L[𝕜] F} {s : Set X} : ContinuousOn f s ↔ ∀ y, ContinuousOn (fun x => f x y) s := by diff --git a/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean b/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean index a44502c3cae6be..8e1023910d43e0 100644 --- a/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean +++ b/Mathlib/Analysis/Normed/Operator/BoundedLinearMaps.lean @@ -86,12 +86,8 @@ lemma isBoundedLinearMap_iff {f : E → F} : theorem IsLinearMap.with_bound {f : E → F} (hf : IsLinearMap 𝕜 f) (M : ℝ) (h : ∀ x : E, ‖f x‖ ≤ M * ‖x‖) : IsBoundedLinearMap 𝕜 f := - ⟨hf, - by_cases - (fun (this : M ≤ 0) => - ⟨1, zero_lt_one, fun x => - (h x).trans <| mul_le_mul_of_nonneg_right (this.trans zero_le_one) (norm_nonneg x)⟩) - fun (this : ¬M ≤ 0) => ⟨M, lt_of_not_ge this, h⟩⟩ + ⟨hf, ⟨max M 1, lt_of_lt_of_le zero_lt_one (le_max_right _ _), fun x => + (h x).trans <| mul_le_mul_of_nonneg_right (le_max_left _ _) (norm_nonneg x)⟩⟩ namespace IsBoundedLinearMap diff --git a/Mathlib/Analysis/Normed/Operator/Extend.lean b/Mathlib/Analysis/Normed/Operator/Extend.lean index 647e36ecb281b3..15638c1fbf6de9 100644 --- a/Mathlib/Analysis/Normed/Operator/Extend.lean +++ b/Mathlib/Analysis/Normed/Operator/Extend.lean @@ -118,15 +118,10 @@ theorem opNorm_extend_le (h_dense : DenseRange e) (h_e : ∀ x, ‖x‖ ≤ N * ‖f.extend e‖ ≤ N * ‖f‖ := by -- Add `opNorm_le_of_dense`? refine opNorm_le_bound _ ?_ (isClosed_property h_dense (isClosed_le ?_ (by fun_prop)) fun x ↦ ?_) - · cases le_total 0 N with - | inl hN => exact mul_nonneg hN (norm_nonneg _) - | inr hN => - have : Unique E := ⟨⟨0⟩, fun x ↦ norm_le_zero_iff.mp <| - (h_e x).trans (mul_nonpos_of_nonpos_of_nonneg hN (norm_nonneg _))⟩ - obtain rfl : f = 0 := Subsingleton.elim .. - simp + · exact mul_nonneg N.2 (norm_nonneg _) · exact (cont _).norm - · rw [extend_eq _ h_dense (isUniformEmbedding_of_bound _ h_e).isUniformInducing] + · rw [extend_eq _ h_dense + (ContinuousLinearMap.isUniformEmbedding_of_bound _ h_e).isUniformInducing] calc ‖f x‖ ≤ ‖f‖ * ‖x‖ := le_opNorm _ _ _ ≤ ‖f‖ * (N * ‖e x‖) := by gcongr; exact h_e x diff --git a/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean b/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean index 7da83abfe03fff..d72c6757a382ad 100644 --- a/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean +++ b/Mathlib/Analysis/Normed/Operator/LinearIsometry.lean @@ -486,13 +486,7 @@ theorem toLinearEquiv_inj {f g : E ≃ₛₗᵢ[σ₁₂] E₂} : f.toLinearEqui instance instEquivLike : EquivLike (E ≃ₛₗᵢ[σ₁₂] E₂) E E₂ where coe e := e.toFun inv e := e.invFun - coe_injective' f g h₁ h₂ := by - obtain ⟨f', _⟩ := f - obtain ⟨g', _⟩ := g - cases f' - cases g' - simp only [AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, DFunLike.coe_fn_eq] at h₁ - congr + coe_injective' _ _ h _ := toLinearEquiv_injective <| DFunLike.ext' h left_inv e := e.left_inv right_inv e := e.right_inv diff --git a/Mathlib/Analysis/Normed/Operator/NNNorm.lean b/Mathlib/Analysis/Normed/Operator/NNNorm.lean index a2353bc31cbb66..61b458e39c8318 100644 --- a/Mathlib/Analysis/Normed/Operator/NNNorm.lean +++ b/Mathlib/Analysis/Normed/Operator/NNNorm.lean @@ -181,14 +181,9 @@ theorem sSup_unitClosedBall_eq_norm (f : E →SL[σ₁₂] F) : theorem exists_nnnorm_eq_one_lt_apply_of_lt_opNNNorm [NormedAlgebra ℝ 𝕜] (f : E →SL[σ₁₂] F) {r : ℝ≥0} (hr : r < ‖f‖₊) : ∃ x : E, ‖x‖₊ = 1 ∧ r < ‖f x‖₊ := by - obtain ⟨x, hlt, hr⟩ := exists_lt_apply_of_lt_opNNNorm f hr - obtain rfl | hx0 := eq_zero_or_nnnorm_pos x - · simp at hr - use algebraMap ℝ 𝕜 ‖x‖⁻¹ • x - suffices r < ‖x‖₊⁻¹ * ‖f x‖₊ by simpa [nnnorm_smul, inv_mul_cancel₀ hx0.ne'] using this - calc - r < 1⁻¹ * ‖f x‖₊ := by simpa - _ < ‖x‖₊⁻¹ * ‖f x‖₊ := by gcongr; exact (zero_le r).trans_lt hr + by_contra h + push Not at h + exact not_lt_of_ge (opNNNorm_le_of_unit_nnnorm h) hr /-- When the domain is a real normed space, `ContinuousLinearMap.sSup_unitClosedBall_eq_nnnorm` can be tightened to take the supremum over only the `Metric.sphere`. -/ From 730e2ed1d50eb10a9ed9f2be8a026c0f76791016 Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Thu, 16 Apr 2026 20:06:04 +0800 Subject: [PATCH 22/29] golf --- Mathlib/Analysis/Normed/Module/Basic.lean | 9 ++-- .../Normed/Operator/ContinuousLinearMap.lean | 23 +++----- Mathlib/Analysis/Normed/Operator/Mul.lean | 17 ++---- Mathlib/Analysis/Normed/Ring/Basic.lean | 4 -- Mathlib/Analysis/Normed/Ring/Lemmas.lean | 18 +------ .../Normed/Unbundled/AlgebraNorm.lean | 6 +-- .../Normed/Unbundled/FiniteExtension.lean | 20 ++----- .../Normed/Unbundled/SpectralNorm.lean | 53 ++++++++----------- .../SpecialFunctions/Log/ENNRealLog.lean | 34 +++++------- .../Analysis/SpecialFunctions/Log/PosLog.lean | 18 ++----- .../SpecialFunctions/Log/RpowTendsto.lean | 35 +++++------- 11 files changed, 71 insertions(+), 166 deletions(-) diff --git a/Mathlib/Analysis/Normed/Module/Basic.lean b/Mathlib/Analysis/Normed/Module/Basic.lean index f8ffe68e9838f7..5a1a8224bf56bf 100644 --- a/Mathlib/Analysis/Normed/Module/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Basic.lean @@ -332,12 +332,9 @@ open Filter Bornology in @[simp] theorem tendsto_algebraMap_cobounded (𝕜 𝕜' : Type*) [NormedField 𝕜] [SeminormedRing 𝕜'] [NormedAlgebra 𝕜 𝕜'] [NormOneClass 𝕜'] : - Tendsto (algebraMap 𝕜 𝕜') (cobounded 𝕜) (cobounded 𝕜') := by - intro c hc - rw [mem_map] - rw [← isCobounded_def, ← isBounded_compl_iff, isBounded_iff_forall_norm_le] at hc ⊢ - obtain ⟨s, hs⟩ := hc - exact ⟨s, fun x hx ↦ by simpa using hs (algebraMap 𝕜 𝕜' x) hx⟩ + Tendsto (algebraMap 𝕜 𝕜') (cobounded 𝕜) (cobounded 𝕜') := + ((AddMonoidHomClass.isometry_of_norm (algebraMap 𝕜 𝕜') + (norm_algebraMap' (𝕜' := 𝕜'))).antilipschitz).tendsto_cobounded @[deprecated (since := "2025-11-04")] alias algebraMap_cobounded_le_cobounded := tendsto_algebraMap_cobounded diff --git a/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean b/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean index 5eaecf831a2ed2..46f2e524d34aba 100644 --- a/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean +++ b/Mathlib/Analysis/Normed/Operator/ContinuousLinearMap.lean @@ -65,21 +65,14 @@ def LinearMap.mkContinuousOfExistsBound (h : ∃ C, ∀ x, ‖f x‖ ≤ C * ‖ theorem continuous_of_linear_of_boundₛₗ {f : E → F} (h_add : ∀ x y, f (x + y) = f x + f y) (h_smul : ∀ (c : 𝕜) (x), f (c • x) = σ c • f x) {C : ℝ} (h_bound : ∀ x, ‖f x‖ ≤ C * ‖x‖) : - Continuous f := - let φ : E →ₛₗ[σ] F := - { toFun := f - map_add' := h_add - map_smul' := h_smul } - AddMonoidHomClass.continuous_of_bound φ C h_bound + Continuous f := by + let φ : E →ₛₗ[σ] F := LinearMap.mk ⟨f, h_add⟩ h_smul + exact (φ.mkContinuous C h_bound).continuous theorem continuous_of_linear_of_bound {f : E → G} (h_add : ∀ x y, f (x + y) = f x + f y) (h_smul : ∀ (c : 𝕜) (x), f (c • x) = c • f x) {C : ℝ} (h_bound : ∀ x, ‖f x‖ ≤ C * ‖x‖) : - Continuous f := - let φ : E →ₗ[𝕜] G := - { toFun := f - map_add' := h_add - map_smul' := h_smul } - AddMonoidHomClass.continuous_of_bound φ C h_bound + Continuous f := by + simpa using (continuous_of_linear_of_boundₛₗ (σ := RingHom.id 𝕜) h_add h_smul h_bound) @[simp, norm_cast] theorem LinearMap.mkContinuous_coe (C : ℝ) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) : @@ -186,11 +179,7 @@ variable {σ₂₁ : 𝕜₂ →+* 𝕜} [RingHomInvPair σ σ₂₁] [RingHomIn theorem ContinuousLinearEquiv.homothety_inverse (a : ℝ) (ha : 0 < a) (f : E ≃ₛₗ[σ] F) : (∀ x : E, ‖f x‖ = a * ‖x‖) → ∀ y : F, ‖f.symm y‖ = a⁻¹ * ‖y‖ := by intro hf y - calc - ‖f.symm y‖ = a⁻¹ * (a * ‖f.symm y‖) := by - rw [← mul_assoc, inv_mul_cancel₀ (ne_of_lt ha).symm, one_mul] - _ = a⁻¹ * ‖f (f.symm y)‖ := by rw [hf] - _ = a⁻¹ * ‖y‖ := by simp + simpa [eq_inv_mul_iff_mul_eq₀ (ne_of_gt ha)] using (hf (f.symm y)).symm /-- A linear equivalence which is a homothety is a continuous linear equivalence. -/ noncomputable def ContinuousLinearEquiv.ofHomothety (f : E ≃ₛₗ[σ] F) (a : ℝ) (ha : 0 < a) diff --git a/Mathlib/Analysis/Normed/Operator/Mul.lean b/Mathlib/Analysis/Normed/Operator/Mul.lean index a7a789021e55a6..4ed36b9561d0f8 100644 --- a/Mathlib/Analysis/Normed/Operator/Mul.lean +++ b/Mathlib/Analysis/Normed/Operator/Mul.lean @@ -158,24 +158,15 @@ variable (𝕜 E) /-- If `M` is a normed space over `𝕜`, then the space of maps `𝕜 →L[𝕜] M` is linearly equivalent to `M`. (See `ring_lmap_equiv_self` for a stronger statement.) -/ -def ring_lmap_equiv_selfₗ : (𝕜 →L[𝕜] E) ≃ₗ[𝕜] E where - toFun := fun f ↦ f 1 - invFun := (ContinuousLinearMap.id 𝕜 𝕜).smulRight - map_smul' := fun a f ↦ by simp only [coe_smul', Pi.smul_apply, RingHom.id_apply] - map_add' := fun f g ↦ by simp only [add_apply] - left_inv := fun f ↦ by ext; simp only [smulRight_apply, coe_id', _root_.id, one_smul] - right_inv := fun m ↦ by simp only [smulRight_apply, id_apply, one_smul] +def ring_lmap_equiv_selfₗ : (𝕜 →L[𝕜] E) ≃ₗ[𝕜] E := + (ContinuousLinearMap.toSpanSingletonLE 𝕜 𝕜 E).symm /-- If `M` is a normed space over `𝕜`, then the space of maps `𝕜 →L[𝕜] M` is linearly isometrically equivalent to `M`. -/ def ring_lmap_equiv_self : (𝕜 →L[𝕜] E) ≃ₗᵢ[𝕜] E where toLinearEquiv := ring_lmap_equiv_selfₗ 𝕜 E - norm_map' := by - refine fun f ↦ le_antisymm ?_ ?_ - · simpa only [norm_one, mul_one] using le_opNorm f 1 - · refine opNorm_le_bound' f (norm_nonneg <| f 1) (fun x _ ↦ ?_) - rw [(by rw [smul_eq_mul, mul_one] : f x = f (x • 1)), map_smul, - norm_smul, mul_comm, (by rfl : ring_lmap_equiv_selfₗ 𝕜 E f = f 1)] + norm_map' f := by + simpa using (ContinuousLinearMap.norm_toSpanSingleton (𝕜 := 𝕜) (x := f 1)).symm end RingEquiv diff --git a/Mathlib/Analysis/Normed/Ring/Basic.lean b/Mathlib/Analysis/Normed/Ring/Basic.lean index 47955ce9681e21..5631689976de81 100644 --- a/Mathlib/Analysis/Normed/Ring/Basic.lean +++ b/Mathlib/Analysis/Normed/Ring/Basic.lean @@ -943,10 +943,6 @@ variable {R ι ι' : Type*} [Semiring R] [Finite ι] [Finite ι'] lemma iSup_fun_mul_eq_iSup_mul_iSup_of_nonneg {F : Type*} [FunLike F R ℝ] [NonnegHomClass F R ℝ] [MulHomClass F R ℝ] (v : F) (x : ι → R) (y : ι' → R) : ⨆ a : ι × ι', v (x a.1 * y a.2) = (⨆ i, v (x i)) * ⨆ j, v (y j) := by - rcases isEmpty_or_nonempty ι - · simp - rcases isEmpty_or_nonempty ι' - · simp simp_rw [Real.iSup_mul_of_nonneg (iSup_nonneg fun i ↦ apply_nonneg v (y i)), Real.mul_iSup_of_nonneg (apply_nonneg v _), map_mul, Finite.ciSup_prod] diff --git a/Mathlib/Analysis/Normed/Ring/Lemmas.lean b/Mathlib/Analysis/Normed/Ring/Lemmas.lean index a775053172d046..879c4736d52415 100644 --- a/Mathlib/Analysis/Normed/Ring/Lemmas.lean +++ b/Mathlib/Analysis/Normed/Ring/Lemmas.lean @@ -9,6 +9,7 @@ public import Mathlib.Algebra.Order.GroupWithZero.Finset public import Mathlib.Analysis.Normed.Group.Bounded public import Mathlib.Analysis.Normed.Group.Int public import Mathlib.Analysis.Normed.Group.Uniform +public import Mathlib.Analysis.Normed.MulAction public import Mathlib.Analysis.Normed.Ring.Basic public import Mathlib.Topology.MetricSpace.Dilation @@ -157,22 +158,7 @@ end NormedCommRing -- see Note [lower instance priority] instance (priority := 100) NonUnitalSeminormedRing.toContinuousMul [NonUnitalSeminormedRing α] : ContinuousMul α := - ⟨continuous_iff_continuousAt.2 fun x => - tendsto_iff_norm_sub_tendsto_zero.2 <| by - have : ∀ e : α × α, - ‖e.1 * e.2 - x.1 * x.2‖ ≤ ‖e.1‖ * ‖e.2 - x.2‖ + ‖e.1 - x.1‖ * ‖x.2‖ := by - intro e - calc - ‖e.1 * e.2 - x.1 * x.2‖ ≤ ‖e.1 * (e.2 - x.2) + (e.1 - x.1) * x.2‖ := by - rw [mul_sub, sub_mul, sub_add_sub_cancel] - _ ≤ ‖e.1‖ * ‖e.2 - x.2‖ + ‖e.1 - x.1‖ * ‖x.2‖ := - norm_add_le_of_le (norm_mul_le _ _) (norm_mul_le _ _) - refine squeeze_zero (fun e => norm_nonneg _) this ?_ - convert - ((continuous_fst.tendsto x).norm.mul - ((continuous_snd.tendsto x).sub tendsto_const_nhds).norm).add - (((continuous_fst.tendsto x).sub tendsto_const_nhds).norm.mul tendsto_const_nhds) - simp⟩ + ⟨show Continuous fun p : α × α => p.1 • p.2 from continuous_smul⟩ -- see Note [lower instance priority] /-- A seminormed ring is a topological ring. -/ diff --git a/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean b/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean index fe5e0f748292e6..eafa8a4c0d88bf 100644 --- a/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/AlgebraNorm.lean @@ -214,12 +214,8 @@ variable {R : Type*} [NonAssocRing R] set_option linter.style.whitespace false in -- manual alignment is not recognised /-- The ring norm underlying a multiplicative ring norm. -/ def toRingNorm (f : MulRingNorm R) : RingNorm R where - toFun := f - map_zero' := f.map_zero' - add_le' := f.add_le' - neg' := f.neg' + __ := f mul_le' x y := le_of_eq (f.map_mul' x y) - eq_zero_of_map_eq_zero' := f.eq_zero_of_map_eq_zero' /-- A multiplicative ring norm is power-multiplicative. -/ theorem isPowMul {A : Type*} [Ring A] (f : MulRingNorm A) : IsPowMul f := fun x n hn => by diff --git a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean index 9c5736d180782e..752e6be1670a13 100644 --- a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean +++ b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean @@ -153,21 +153,11 @@ theorem norm_mul_le_const_mul_norm {i : ι} (hBi : B i = (1 : L)) theorem norm_smul {ι : Type*} [Fintype ι] [Nonempty ι] {B : Basis ι K L} {i : ι} (hBi : B i = (1 : L)) (k : K) (y : L) : B.norm ((algebraMap K L) k * y) = B.norm ((algebraMap K L) k) * B.norm y := by - by_cases hk : k = 0 - · rw [hk, map_zero, zero_mul, B.norm_zero, zero_mul] - · rw [norm_extends hBi] - obtain ⟨i, _, hi⟩ := exists_mem_eq_sup' univ_nonempty (fun i ↦ ‖B.repr y i‖) - obtain ⟨j, _, hj⟩ := exists_mem_eq_sup' univ_nonempty - (fun i ↦ ‖B.repr ((algebraMap K L) k * y) i‖) - have hij : ‖B.repr y i‖ = ‖B.repr y j‖ := by - rw [← hi] - apply le_antisymm _ (norm_repr_le_norm B j) - have hj' := Finset.le_sup' (fun i ↦ ‖B.repr ((algebraMap K L) k * y) i‖) (mem_univ i) - simp only [repr_smul', norm_mul, ← hi] at hj hj' - exact (mul_le_mul_iff_right₀ (lt_of_le_of_ne (norm_nonneg _) - (Ne.symm (norm_ne_zero_iff.mpr hk)))).mp (hj ▸ hj') - simp only [norm, hj] - rw [repr_smul', norm_mul, hi, hij] + rw [norm_extends hBi, Basis.norm, Basis.norm] + rw [Finset.mul₀_sup' (ha := norm_nonneg _) (f := fun j : ι ↦ ‖B.repr y j‖) (s := univ) + (hs := univ_nonempty)] + congr with j + rw [repr_smul', norm_mul] end Module.Basis diff --git a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean index 53cd91e2385c3f..df5b62b4db8fda 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean @@ -182,23 +182,14 @@ variable [NormedRing R] theorem spectralValue_eq_zero_iff [Nontrivial R] {p : R[X]} (hp : p.Monic) : spectralValue p = 0 ↔ p = X ^ p.natDegree := by refine ⟨fun h ↦ ?_, fun h ↦ h ▸ spectralValue_X_pow p.natDegree⟩ - rw [spectralValue] at h - ext n - rw [coeff_X_pow] - split_ifs with hn - · rw [hn, coeff_natDegree]; exact hp - · by_cases hn' : n < p.natDegree - · have h_le : iSup (spectralValueTerms p) ≤ 0 := h.le - have h_exp : 0 < 1 / ((p.natDegree : ℝ) - n) := by - rw [one_div_pos, ← cast_sub (le_of_lt hn'), cast_pos] - exact Nat.sub_pos_of_lt hn' - have h0 : (0 : ℝ) = 0 ^ (1 / ((p.natDegree : ℝ) - n)) := by rw [zero_rpow (ne_of_gt h_exp)] - rw [iSup, csSup_le_iff (spectralValueTerms_bddAbove p) (Set.range_nonempty _)] at h_le - specialize h_le (spectralValueTerms p n) ⟨n, rfl⟩ - simp only [spectralValueTerms, if_pos hn'] at h_le - rw [h0, rpow_le_rpow_iff (norm_nonneg _) (le_refl _) h_exp] at h_le - exact norm_eq_zero.mp (le_antisymm h_le (norm_nonneg _)) - · exact coeff_eq_zero_of_natDegree_lt (lt_of_le_of_ne (le_of_not_gt hn') (ne_comm.mpr hn)) + refine hp.eq_X_pow_iff_natDegree_le_natTrailingDegree.mpr <| + le_natTrailingDegree hp.ne_zero fun n hn ↦ ?_ + have h0 : spectralValueTerms p n = 0 := by + apply le_antisymm ((le_ciSup (spectralValueTerms_bddAbove p) n).trans h.le) + exact spectralValueTerms_nonneg _ _ + rw [spectralValueTerms_of_lt_natDegree _ hn, + Real.rpow_eq_zero_iff_of_nonneg (norm_nonneg _)] at h0 + exact norm_eq_zero.mp h0.1 end Normed @@ -406,12 +397,9 @@ theorem spectralNorm.eq_of_normalClosure' (x : E) : spectralNorm K (normalClosure K E (AlgebraicClosure E)) (algebraMap E (normalClosure K E (AlgebraicClosure E)) x) = spectralNorm K L (algebraMap E L x) := by - simp only [spectralNorm, spectralValue] - have h_min : minpoly K (algebraMap (↥E) (↥(normalClosure K (↥E) (AlgebraicClosure ↥E))) x) = - minpoly K (algebraMap (↥E) L x) := by - rw [minpoly.algebraMap_eq (algebraMap (↥E) ↥(normalClosure K E (AlgebraicClosure E))).injective - x, ← minpoly.algebraMap_eq (algebraMap (↥E) L).injective x] - simp_rw [h_min] + rw [← spectralNorm.eq_of_tower (K := K) (E := E) + (L := normalClosure K E (AlgebraicClosure E)) x, + ← spectralNorm.eq_of_tower (K := K) (E := E) (L := L) x] /-- If `L/E/K` is a tower of fields and `x = algebraMap E L g`, then the spectral norm of `g : E` when regarded as an element of the normal closure of `E` equals the spectral norm @@ -703,6 +691,7 @@ 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 backward.inferInstanceAs.wrap.data false 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. -/ @@ -710,9 +699,9 @@ theorem spectralNorm_unique [CompleteSpace K] {f : AlgebraNorm K L} (hf_pm : IsP f = spectralAlgNorm K L := by apply eq_of_powMul_faithful f hf_pm _ spectralAlgNorm_isPowMul intro x - let E : Type v := id K⟮x⟯ - let : Field E := show Field K⟮x⟯ by infer_instance - let : Module K E := show Module K K⟮x⟯ by infer_instance + set E : Type v := id K⟮x⟯ + letI hE : Field E := inferInstanceAs (Field K⟮x⟯) + letI : Algebra K E := inferInstanceAs (Algebra K K⟮x⟯) let id1 : K⟮x⟯ →ₗ[K] E := LinearMap.id let id2 : E →ₗ[K] K⟮x⟯ := LinearMap.id set hs_norm : RingNorm E := @@ -728,8 +717,8 @@ theorem spectralNorm_unique [CompleteSpace K] {f : AlgebraNorm K L} (hf_pm : IsP eq_zero_of_map_eq_zero' a ha := by simpa [id_eq, eq_mpr_eq_cast, cast_eq, LinearMap.coe_mk, ← spectralAlgNorm_def, map_eq_zero_iff_eq_zero, ZeroMemClass.coe_eq_zero] using ha } - let n1 : NormedRing E := RingNorm.toNormedRing hs_norm - let N1 : NormedSpace K E := + letI n1 : NormedRing E := RingNorm.toNormedRing hs_norm + letI N1 : NormedSpace K E := { one_smul e := by simp [one_smul] mul_smul k1 k2 e := by simp [mul_smul] smul_zero e := by simp @@ -748,8 +737,8 @@ theorem spectralNorm_unique [CompleteSpace K] {f : AlgebraNorm K L} (hf_pm : IsP mul_le' a b := map_mul_le_mul _ _ _ eq_zero_of_map_eq_zero' a ha := by simpa [map_eq_zero_iff_eq_zero, map_eq_zero] using ha } - let n2 : NormedRing K⟮x⟯ := RingNorm.toNormedRing hf_norm - let N2 : NormedSpace K K⟮x⟯ := + letI n2 : NormedRing K⟮x⟯ := RingNorm.toNormedRing hf_norm + letI N2 : NormedSpace K K⟮x⟯ := { one_smul e := by simp [one_smul] mul_smul k1 k2 e := by simp [mul_smul] smul_zero e := by simp @@ -761,9 +750,9 @@ theorem spectralNorm_unique [CompleteSpace K] {f : AlgebraNorm K L} (hf_pm : IsP have : (algebraMap (↥K⟮x⟯) L) (k • y) = k • algebraMap (↥K⟮x⟯) L y := by simp [IntermediateField.algebraMap_apply] rw [this, map_smul_eq_mul] } - have hKx_fin : FiniteDimensional K ↥K⟮x⟯ := + haveI hKx_fin : FiniteDimensional K ↥K⟮x⟯ := IntermediateField.adjoin.finiteDimensional (Algebra.IsAlgebraic.isAlgebraic x).isIntegral - have : FiniteDimensional K E := hKx_fin + haveI : FiniteDimensional K E := hKx_fin set Id1 : K⟮x⟯ →L[K] E := ⟨id1, id1.continuous_of_finiteDimensional⟩ set Id2 : E →L[K] K⟮x⟯ := ⟨id2, id2.continuous_of_finiteDimensional⟩ obtain ⟨C1, hC1_pos, hC1⟩ : ∃ C1 : ℝ, 0 < C1 ∧ ∀ y : K⟮x⟯, ‖id1 y‖ ≤ C1 * ‖y‖ := diff --git a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean index 5be24a87bf35ec..23552b861040a9 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/ENNRealLog.lean @@ -151,27 +151,19 @@ theorem log_mul_add {x y : ℝ≥0∞} : log (x * y) = log x + log y := by positivity theorem log_rpow {x : ℝ≥0∞} {y : ℝ} : log (x ^ y) = y * log x := by - rcases lt_trichotomy y 0 with (y_neg | rfl | y_pos) - · rcases ENNReal.trichotomy x with (rfl | rfl | x_real) - · simp only [ENNReal.zero_rpow_def y, not_lt_of_gt y_neg, y_neg.ne, if_false, log_top, - log_zero, EReal.coe_mul_bot_of_neg y_neg] - · rw [ENNReal.top_rpow_of_neg y_neg, log_zero, log_top, EReal.coe_mul_top_of_neg y_neg] - · have x_ne_zero := (ENNReal.toReal_pos_iff.1 x_real).1.ne' - have x_ne_top := (ENNReal.toReal_pos_iff.1 x_real).2.ne - simp only [log, rpow_eq_zero_iff, x_ne_zero, false_and, x_ne_top, or_self, ↓reduceIte, - rpow_eq_top_iff] - norm_cast - exact ENNReal.toReal_rpow x y ▸ Real.log_rpow x_real y - · simp - · rcases ENNReal.trichotomy x with (rfl | rfl | x_real) - · rw [ENNReal.zero_rpow_of_pos y_pos, log_zero, EReal.mul_bot_of_pos]; norm_cast - · rw [ENNReal.top_rpow_of_pos y_pos, log_top, EReal.mul_top_of_pos]; norm_cast - · have x_ne_zero := (ENNReal.toReal_pos_iff.1 x_real).1.ne' - have x_ne_top := (ENNReal.toReal_pos_iff.1 x_real).2.ne - simp only [log, rpow_eq_zero_iff, x_ne_zero, false_and, x_ne_top, or_self, ↓reduceIte, - rpow_eq_top_iff] - norm_cast - exact ENNReal.toReal_rpow x y ▸ Real.log_rpow x_real y + rcases ENNReal.trichotomy x with (rfl | rfl | x_real) + · rcases lt_trichotomy y 0 with (y_neg | rfl | y_pos) + · simp [y_neg, EReal.coe_mul_bot_of_neg] + · simp + · simp [y_pos, EReal.coe_mul_bot_of_pos] + · rcases lt_trichotomy y 0 with (y_neg | rfl | y_pos) + · simp [y_neg, EReal.coe_mul_top_of_neg] + · simp + · simp [y_pos, EReal.coe_mul_top_of_pos] + · rw [log_pos_real' (by rw [← ENNReal.toReal_rpow]; positivity), log_pos_real' x_real] + norm_cast + rw [← ENNReal.toReal_rpow] + exact Real.log_rpow x_real y theorem log_pow {x : ℝ≥0∞} {n : ℕ} : log (x ^ n) = n * log x := by rw [← rpow_natCast, log_rpow, EReal.coe_natCast] diff --git a/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean b/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean index afeed57a6af872..b83c1ef068f222 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/PosLog.lean @@ -47,10 +47,7 @@ theorem posLog_def : log⁺ x = max 0 (log x) := rfl /-- Presentation of `log` in terms of its positive part. -/ theorem posLog_sub_posLog_inv : log⁺ x - log⁺ x⁻¹ = log x := by - rw [posLog_def, posLog_def, log_inv] - by_cases! h : 0 ≤ log x - · simp [h] - · simp [neg_nonneg.1 (Left.nonneg_neg_iff.2 h.le)] + simpa [posLog_def, log_inv, max_comm] using max_zero_sub_eq_self (log x) /-- Presentation of `log⁺` in terms of `log`. -/ theorem half_mul_log_add_log_abs : 2⁻¹ * (log x + |log x|) = log⁺ x := by @@ -79,9 +76,7 @@ theorem posLog_eq_zero_iff (x : ℝ) : log⁺ x = 0 ↔ |x| ≤ 1 := by /-- The function `log⁺` equals `log` outside of the interval (-1,1). -/ theorem posLog_eq_log (hx : 1 ≤ |x|) : log⁺ x = log x := by - simp only [posLog, sup_eq_right] - rw [← log_abs] - apply log_nonneg hx + simpa [posLog_def, ← log_abs] using max_eq_right (log_nonneg hx) /-- The function `log⁺` equals `log` for all natural numbers. -/ theorem log_of_nat_eq_posLog {n : ℕ} : log⁺ n = log n := by @@ -96,13 +91,8 @@ theorem posLog_eq_log_max_one (hx : 0 ≤ x) : log⁺ x = log (max 1 x) := by /-- The function `log⁺` is monotone on the positive axis. -/ theorem monotoneOn_posLog : MonotoneOn log⁺ (Set.Ici 0) := by intro x hx y hy hxy - simp only [posLog, le_sup_iff, sup_le_iff, le_refl, true_and] - by_cases! h : log x ≤ 0 - · tauto - · right - have := log_le_log (lt_trans Real.zero_lt_one ((log_pos_iff hx).1 h)) hxy - simp only [this, and_true, ge_iff_le] - linarith + rw [posLog_eq_log_max_one hx, posLog_eq_log_max_one hy] + exact log_le_log (by positivity) (max_le_max le_rfl hxy) @[gcongr] lemma posLog_le_posLog (hx : 0 ≤ x) (hxy : x ≤ y) : log⁺ x ≤ log⁺ y := diff --git a/Mathlib/Analysis/SpecialFunctions/Log/RpowTendsto.lean b/Mathlib/Analysis/SpecialFunctions/Log/RpowTendsto.lean index b0a5a23a3c0171..20fd4d039e15f2 100644 --- a/Mathlib/Analysis/SpecialFunctions/Log/RpowTendsto.lean +++ b/Mathlib/Analysis/SpecialFunctions/Log/RpowTendsto.lean @@ -50,43 +50,32 @@ lemma Real.tendstoLocallyUniformlyOn_rpow_sub_one_log : intro s hs hs' rw [Metric.uniformity_basis_dist_le.tendstoUniformlyOn_iff_of_uniformity] intro ε hε - let pbound : ℝ := ε / (sSup ((fun x => ‖log x‖ ^ 2) '' s) + 1) - have hxs : ∀ x ∈ s, x ≠ 0 := by grind - have sSup_nonneg : 0 ≤ sSup ((fun x => ‖log x‖ ^ 2) '' s) := by - refine Real.sSup_nonneg ?_ - grind [← sq_nonneg] - have sSup_nonneg' : 0 ≤ sSup ((fun x => ‖log x‖) '' s) := by - refine Real.sSup_nonneg ?_ - grind [← sq_nonneg] + obtain ⟨logbound, hlogbound⟩ := hs'.exists_bound_of_continuousOn (f := Real.log) + (Real.continuousOn_log.mono fun _ hx => ne_of_gt (hs hx)) + let logbound : ℝ := max logbound 0 + let pbound : ℝ := ε / (logbound ^ 2 + 1) have pbound_pos : 0 < pbound := by positivity have h₁ : ∀ᶠ p : ℝ in 𝓝[>] 0, 0 < p ∧ p < pbound := nhdsGT_basis 0 |>.mem_of_mem pbound_pos - have h₂ : ∀ᶠ p : ℝ in 𝓝[>] 0, p ≤ 1 / (sSup ((fun x => ‖log x‖) '' s) + 1) := + have h₂ : ∀ᶠ p : ℝ in 𝓝[>] 0, p ≤ 1 / (logbound + 1) := Eventually.filter_mono nhdsWithin_le_nhds <| eventually_le_nhds (by positivity) - have hcont : ContinuousOn (fun x => ‖log x‖ ^ 2) s := by - fun_prop (disch := assumption) - have hcont' : ContinuousOn (fun x => ‖log x‖) s := by - fun_prop (disch := assumption) filter_upwards [h₁, h₂] with p ⟨hp₁,hp₂⟩ hp₃ intro x hx + have hxlog : ‖log x‖ ≤ logbound := (hlogbound x hx).trans (le_max_left _ _) have hx' : ‖p * log x‖ ≤ 1 := calc _ = p * ‖log x‖ := by grind [norm_mul, Real.norm_of_nonneg] - _ ≤ 1 / (sSup ((fun y => ‖log y‖) '' s) + 1) * ‖log x‖ := by gcongr + _ ≤ 1 / (logbound + 1) * ‖log x‖ := by gcongr _ ≤ 1 / (‖log x‖ + 1) * ‖log x‖ := by gcongr - refine le_csSup ?_ (by grind) - grind [IsCompact.bddAbove, ← IsCompact.image_of_continuousOn] _ = ‖log x‖ / (‖log x‖ + 1) := by grind _ ≤ 1 := by rw [div_le_one₀] <;> grind [norm_nonneg] - have pinv_nonneg : 0 ≤ p⁻¹ := by grind [_root_.inv_nonneg] rw [dist_eq_norm'] calc _ ≤ p * ‖log x‖ ^ 2 := Real.norm_inv_mul_rpow_sub_one_sub_log_le hp₁ (hs hx) hx' - _ ≤ p * sSup ((fun x => ‖log x‖ ^ 2) '' s) := by - gcongr - refine le_csSup ?_ (by grind) - grind [IsCompact.bddAbove, ← IsCompact.image_of_continuousOn] - _ ≤ pbound * (sSup ((fun x => ‖log x‖ ^ 2) '' s) + 1) := by gcongr; grind - _ = ε := by grind + _ ≤ p * logbound ^ 2 := by gcongr + _ ≤ pbound * (logbound ^ 2 + 1) := by gcongr; grind + _ = ε := by + dsimp [pbound] + field_simp lemma tendsto_rpow_sub_one_log {x : ℝ} (hx : 0 < x) : Tendsto (fun p => p⁻¹ * (x ^ p - 1)) (𝓝[>] 0) (𝓝 (log x)) := From 66d3817090688432884111cf9c1b6c408c198a83 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Thu, 16 Apr 2026 20:36:28 +0800 Subject: [PATCH 23/29] fix error --- Mathlib/Analysis/Normed/Ring/Lemmas.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib/Analysis/Normed/Ring/Lemmas.lean b/Mathlib/Analysis/Normed/Ring/Lemmas.lean index 879c4736d52415..fc9b48ce9054cb 100644 --- a/Mathlib/Analysis/Normed/Ring/Lemmas.lean +++ b/Mathlib/Analysis/Normed/Ring/Lemmas.lean @@ -214,7 +214,7 @@ instance Int.instNormOneClass : NormOneClass ℤ := ⟨by simp [← Int.norm_cast_real]⟩ instance Int.instNormMulClass : NormMulClass ℤ := - ⟨fun a b ↦ by simp [← Int.norm_cast_real, abs_mul]⟩ + ⟨fun a b ↦ by simp [← Int.norm_cast_real]⟩ section NonUnitalNormedRing variable [NonUnitalNormedRing α] [NormMulClass α] {a : α} From 473001837db4db0b78e3ffe528617e2100ebc9a0 Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Thu, 16 Apr 2026 20:38:02 +0800 Subject: [PATCH 24/29] golf --- .../Analysis/Normed/Module/HahnBanach.lean | 14 +++++--------- .../Analysis/Normed/Module/MStructure.lean | 16 ++++++---------- .../Module/MultipliableUniformlyOn.lean | 10 +++------- .../Analysis/Normed/Operator/Bilinear.lean | 11 +++-------- .../Normed/Unbundled/SeminormFromBounded.lean | 16 ++++------------ .../Normed/Unbundled/SeminormFromConst.lean | 15 +++++---------- .../MulExpNegMulSqIntegral.lean | 19 +++++++------------ .../Trigonometric/EulerSineProd.lean | 13 ++----------- 8 files changed, 35 insertions(+), 79 deletions(-) diff --git a/Mathlib/Analysis/Normed/Module/HahnBanach.lean b/Mathlib/Analysis/Normed/Module/HahnBanach.lean index 2b067977fae59b..47e3898f6b7201 100644 --- a/Mathlib/Analysis/Normed/Module/HahnBanach.lean +++ b/Mathlib/Analysis/Normed/Module/HahnBanach.lean @@ -94,15 +94,11 @@ theorem exists_extension_norm_eq (p : Subspace 𝕜 E) (f : StrongDual 𝕜 p) : rw [g.extendRCLike_apply, ← Submodule.coe_smul, hextends, hextends] simp [fr, RCLike.algebraMap_eq_ofReal, mul_comm I, RCLike.re_add_im] - -- And we derive the equality of the norms by bounding on both sides. - refine ⟨h, le_antisymm ?_ ?_⟩ - · calc - ‖g.extendRCLike‖ = ‖g‖ := g.norm_extendRCLike - _ = ‖fr‖ := hnormeq - _ ≤ ‖reCLM‖ * ‖f‖ := ContinuousLinearMap.opNorm_comp_le _ _ - _ = ‖f‖ := by rw [reCLM_norm, one_mul] - · exact f.opNorm_le_bound (g.extendRCLike (𝕜 := 𝕜)).opNorm_nonneg - fun x ↦ h x ▸ (g.extendRCLike (𝕜 := 𝕜) |>.le_opNorm x) + -- `StrongDual.extendRCLikeₗᵢ` is an isometric equivalence, so the norm is preserved outright. + refine ⟨h, by + rw [g.norm_extendRCLike, hnormeq] + change ‖reCLM.comp (f.restrictScalars ℝ)‖ = ‖f‖ + exact (StrongDual.extendRCLikeₗᵢ (𝕜 := 𝕜)).symm.norm_map f⟩ open Module diff --git a/Mathlib/Analysis/Normed/Module/MStructure.lean b/Mathlib/Analysis/Normed/Module/MStructure.lean index 6ab84d6521d7e5..93c2b9e6157737 100644 --- a/Mathlib/Analysis/Normed/Module/MStructure.lean +++ b/Mathlib/Analysis/Normed/Module/MStructure.lean @@ -121,18 +121,14 @@ theorem commute [FaithfulSMul M X] {P Q : M} (h₁ : IsLprojection X P) (h₂ : have := add_le_add_left (norm_le_insert' (R • x) (R • P • R • x)) (2 • ‖(1 - R) • P • R • x‖) simpa only [mul_smul, sub_smul, one_smul] using this - rw [ge_iff_le] at e1 - nth_rewrite 2 [← add_zero ‖R • x‖] at e1 - rw [add_le_add_iff_left, two_smul, ← two_mul] at e1 - rw [le_antisymm_iff] - refine ⟨?_, norm_nonneg _⟩ - rwa [← mul_zero (2 : ℝ), mul_le_mul_iff_right₀ (show (0 : ℝ) < 2 by simp)] at e1 + rw [two_smul] at e1 + nlinarith [e1, norm_nonneg ((P * R) • x - (R * P * R) • x)] have QP_eq_QPQ : Q * P = Q * P * Q := by - have e1 : P * (1 - Q) = P * (1 - Q) - (Q * P - Q * P * Q) := + have e1 : Q * P - Q * P * Q = 0 := by calc - P * (1 - Q) = (1 - Q) * P * (1 - Q) := by rw [PR_eq_RPR (1 - Q) h₂.Lcomplement] - _ = P * (1 - Q) - (Q * P - Q * P * Q) := by noncomm_ring - rwa [eq_sub_iff_add_eq, add_eq_left, sub_eq_zero] at e1 + Q * P - Q * P * Q = P * (1 - Q) - (1 - Q) * P * (1 - Q) := by noncomm_ring + _ = 0 := sub_eq_zero.mpr (PR_eq_RPR (1 - Q) h₂.Lcomplement) + simpa [sub_eq_zero] using e1 change P * Q = Q * P rw [QP_eq_QPQ, PR_eq_RPR Q h₂] diff --git a/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean b/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean index 2151c22bcd0467..bf791ff3f031bb 100644 --- a/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean +++ b/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean @@ -61,13 +61,9 @@ lemma hasProdUniformlyOn_of_clog (hf : SummableUniformlyOn (fun i x ↦ log (f i (hg : BddAbove <| (fun x ↦ (∑' i, log (f i x)).re) '' s) : HasProdUniformlyOn f (fun x ↦ ∏' i, f i x) s := by simp only [hasProdUniformlyOn_iff_tendstoUniformlyOn] - obtain ⟨r, hr⟩ := hf.exists - suffices H : TendstoUniformlyOn (fun s x ↦ ∏ i ∈ s, f i x) (cexp ∘ r) atTop s by - refine H.congr_right (hr.tsum_eqOn.comp_left.symm.trans ?_) - exact fun x hx ↦ (cexp_tsum_eq_tprod (hfn x hx) (hf.summable hx)) - refine (hr.tendstoUniformlyOn.comp_cexp ?_).congr ?_ - · simpa +contextual [← hr.tsum_eqOn _] using hg - · filter_upwards with s i hi using by simp [exp_sum, fun y ↦ exp_log (hfn i hi y)] + refine ((hf.hasSumUniformlyOn.tendstoUniformlyOn.comp_cexp hg).congr ?_).congr_right ?_ + · filter_upwards with t x hx using by simp [exp_sum, fun y ↦ exp_log (hfn x hx y)] + · exact fun x hx ↦ cexp_tsum_eq_tprod (hfn x hx) (hf.summable hx) lemma multipliableUniformlyOn_of_clog (hf : SummableUniformlyOn (fun i x ↦ log (f i x)) s) (hfn : ∀ x ∈ s, ∀ i, f i x ≠ 0) diff --git a/Mathlib/Analysis/Normed/Operator/Bilinear.lean b/Mathlib/Analysis/Normed/Operator/Bilinear.lean index cc211b219e4955..1cfe2be1d895c7 100644 --- a/Mathlib/Analysis/Normed/Operator/Bilinear.lean +++ b/Mathlib/Analysis/Normed/Operator/Bilinear.lean @@ -205,14 +205,9 @@ variable (𝕜 E Fₗ Gₗ) /-- Flip the order of arguments of a continuous bilinear map. This is a version bundled as a `LinearIsometryEquiv`. For an unbundled version see `ContinuousLinearMap.flip`. -/ -def flipₗᵢ : (E →L[𝕜] Fₗ →L[𝕜] Gₗ) ≃ₗᵢ[𝕜] Fₗ →L[𝕜] E →L[𝕜] Gₗ where - toFun := flip - invFun := flip - map_add' := flip_add - map_smul' := flip_smul - left_inv := flip_flip - right_inv := flip_flip - norm_map' := opNorm_flip +def flipₗᵢ : (E →L[𝕜] Fₗ →L[𝕜] Gₗ) ≃ₗᵢ[𝕜] Fₗ →L[𝕜] E →L[𝕜] Gₗ := + (flipₗᵢ' E Fₗ Gₗ (RingHom.id 𝕜) (RingHom.id 𝕜) : + (E →L[𝕜] Fₗ →L[𝕜] Gₗ) ≃ₗᵢ[𝕜] Fₗ →L[𝕜] E →L[𝕜] Gₗ) variable {𝕜 E Fₗ Gₗ} diff --git a/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean b/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean index 93fd45b5db61ff..73d659d794abad 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SeminormFromBounded.lean @@ -212,13 +212,9 @@ theorem seminormFromBounded_one (f_ne_zero : f ≠ 0) (f_nonneg : 0 ≤ f) · rw [hx, div_zero]; exact zero_le_one · rw [div_self hx] · rw [← div_self (map_one_ne_zero f_ne_zero f_nonneg f_mul)] - have h_bdd : BddAbove (Set.range fun y ↦ f y / f y) := by - use (1 : ℝ) - rintro r ⟨y, rfl⟩ - by_cases hy : f y = 0 - · simp only [hy, div_zero, zero_le_one] - · simp only [div_self hy, le_refl] - exact le_ciSup h_bdd (1 : R) + exact le_ciSup + (by simpa [one_mul] using seminormFromBounded_bddAbove_range f_nonneg f_mul (1 : R)) + (1 : R) /-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then `seminormFromBounded' f 1 ≤ 1`. -/ @@ -332,11 +328,7 @@ theorem seminormFromBounded_of_mul_le (f_nonneg : 0 ≤ f) {x : R} theorem seminormFromBounded_nonzero (f_ne_zero : f ≠ 0) (f_nonneg : 0 ≤ f) (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) : seminormFromBounded' f ≠ 0 := by - obtain ⟨x, hx⟩ := Function.ne_iff.mp f_ne_zero - rw [Function.ne_iff] - use x - rw [ne_eq, Pi.zero_apply, seminormFromBounded_eq_zero_iff f_nonneg f_mul x] - exact hx + simpa [Function.ne_iff, seminormFromBounded_eq_zero_iff f_nonneg f_mul] using f_ne_zero /-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then the kernel of `seminormFromBounded' f` equals the kernel of `f`. -/ diff --git a/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean b/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean index 8131a0a5890ab7..aca33dc755c3d5 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SeminormFromConst.lean @@ -151,10 +151,8 @@ def seminormFromConst : RingSeminorm R where mul_le' x y := by have hlim : Tendsto (fun n ↦ seminormFromConst_seq c f (x * y) (2 * n)) atTop (𝓝 (seminormFromConst' c f (x * y))) := by - apply (tendsto_seminormFromConst_seq_atTop hf1 hc hpm (x * y)).comp - (tendsto_atTop_atTop_of_monotone (fun _ _ hnm ↦ by - simp only [mul_le_mul_iff_right₀, Nat.succ_pos', hnm]) _) - · rintro n; use n; lia + exact (tendsto_seminormFromConst_seq_atTop hf1 hc hpm (x * y)).comp + (tendsto_id.const_mul_atTop' zero_lt_two) refine le_of_tendsto_of_tendsto' hlim ((tendsto_seminormFromConst_seq_atTop hf1 hc hpm x).mul (tendsto_seminormFromConst_seq_atTop hf1 hc hpm y)) (fun n ↦ ?_) simp only [seminormFromConst_seq] @@ -186,9 +184,8 @@ theorem seminormFromConst_isPowMul : IsPowMul (seminormFromConst' c f) := fun x simp only [seminormFromConst'] have hlim : Tendsto (fun n ↦ seminormFromConst_seq c f (x ^ m) (m * n)) atTop (𝓝 (seminormFromConst' c f (x ^ m))) := by - apply (tendsto_seminormFromConst_seq_atTop hf1 hc hpm (x ^ m)).comp - (tendsto_atTop_atTop_of_monotone (fun _ _ hnk ↦ mul_le_mul_right hnk m) _) - rintro n; use n; exact le_mul_of_one_le_left' hm + exact (tendsto_seminormFromConst_seq_atTop hf1 hc hpm (x ^ m)).comp + (tendsto_id.const_mul_atTop' (lt_of_lt_of_le zero_lt_one hm)) apply tendsto_nhds_unique hlim convert (tendsto_seminormFromConst_seq_atTop hf1 hc hpm x).pow m using 1 ext n @@ -248,9 +245,7 @@ theorem seminormFromConst_const_mul (x : R) : seminormFromConst' c f c * seminormFromConst' c f x := by have hlim : Tendsto (fun n ↦ seminormFromConst_seq c f x (n + 1)) atTop (𝓝 (seminormFromConst' c f x)) := by - apply (tendsto_seminormFromConst_seq_atTop hf1 hc hpm x).comp - (tendsto_atTop_atTop_of_monotone add_left_mono _) - rintro n; use n; lia + exact (tendsto_seminormFromConst_seq_atTop hf1 hc hpm x).comp (tendsto_add_atTop_nat 1) rw [seminormFromConst_apply_c hf1 hc hpm] apply tendsto_nhds_unique (tendsto_seminormFromConst_seq_atTop hf1 hc hpm (c * x)) have hterm : seminormFromConst_seq c f (c * x) = diff --git a/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean b/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean index d4077946464477..b9902482119075 100644 --- a/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean +++ b/Mathlib/Analysis/SpecialFunctions/MulExpNegMulSqIntegral.lean @@ -175,18 +175,13 @@ theorem dist_integral_mulExpNegMulSq_comp_le (f : E →ᵇ ℝ) (toReal_pos ((Measure.measure_univ_ne_zero).mpr hP'0) (by finiteness)) -- obtain K, a compact and closed set, which covers E up to a small area of measure at most ε -- w.r.t. both P and P' - obtain ⟨KP, _, hKPco, hKPcl, hKP⟩ := MeasurableSet.exists_isCompact_isClosed_diff_lt - (MeasurableSet.univ) (measure_ne_top P Set.univ) (ofReal_pos.mpr hε).ne' - obtain ⟨KP', _, hKP'co, hKP'cl, hKP'⟩ := MeasurableSet.exists_isCompact_isClosed_diff_lt - (MeasurableSet.univ) (measure_ne_top P' Set.univ) (ofReal_pos.mpr hε).ne' - let K := KP ∪ KP' - have hKco := IsCompact.union hKPco hKP'co - have hKcl := IsClosed.union hKPcl hKP'cl - simp only [← Set.compl_eq_univ_diff] at hKP hKP' - have hKPbound : P (KP ∪ KP')ᶜ < ε.toNNReal := lt_of_le_of_lt - (measure_mono (Set.compl_subset_compl_of_subset (Set.subset_union_left))) hKP - have hKP'bound : P' (KP ∪ KP')ᶜ < ε.toNNReal := lt_of_le_of_lt - (measure_mono (Set.compl_subset_compl_of_subset (Set.subset_union_right))) hKP' + obtain ⟨K, _, hKco, hKcl, hK⟩ := MeasurableSet.exists_isCompact_isClosed_diff_lt + (μ := P + P') (MeasurableSet.univ) (measure_ne_top (P + P') Set.univ) (ofReal_pos.mpr hε).ne' + simp only [← Set.compl_eq_univ_diff] at hK + have hKPbound : P Kᶜ < ε.toNNReal := + lt_of_le_of_lt ((Measure.le_add_right (ν := P) (ν' := P') le_rfl) _) hK + have hKP'bound : P' Kᶜ < ε.toNNReal := + lt_of_le_of_lt ((Measure.le_add_left (ν := P') (ν' := P) le_rfl) _) hK -- Stone-Weierstrass approximation of f on K obtain ⟨g', hg'A, hg'approx⟩ := ContinuousMap.exists_mem_subalgebra_near_continuous_of_isCompact_of_separatesPoints diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean index b553a8cd6e44ca..11fd4c27dbf82f 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean @@ -203,19 +203,10 @@ theorem sin_pi_mul_eq (z : ℂ) (n : ℕ) : set A := ∏ j ∈ Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2) set B := ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n) set C := ∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n) - have aux' : 2 * n.succ = 2 * n + 2 := by rw [Nat.succ_eq_add_one, mul_add, mul_one] have : (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n.succ)) = (2 * (n : ℝ) + 1) / (2 * n + 2) * C := by - rw [integral_cos_pow_eq] - dsimp only [C] - rw [integral_cos_pow_eq, aux', integral_sin_pow, sin_zero, sin_pi, pow_succ', - zero_mul, zero_mul, zero_mul, sub_zero, zero_div, - zero_add, ← mul_assoc, ← mul_assoc, mul_comm (1 / 2 : ℝ) _, Nat.cast_mul, Nat.cast_ofNat] + simpa [C, Nat.cast_mul, Nat.cast_ofNat, cos_pi_div_two, sin_zero] using + (integral_cos_pow (a := (0 : ℝ)) (b := π / 2) (n := 2 * n)) rw [this] - change - π * z * A * B / C = - (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) * - ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) / - ((2 * n + 1) / (2 * n + 2) * C : ℝ) have : (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) * ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) = From 321bec15ea4f3eae21fd16d48026426b5905b18c Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Thu, 16 Apr 2026 23:07:34 +0800 Subject: [PATCH 25/29] golf --- .../Trigonometric/EulerSineProd.lean | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean index 11fd4c27dbf82f..b553a8cd6e44ca 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/EulerSineProd.lean @@ -203,10 +203,19 @@ theorem sin_pi_mul_eq (z : ℂ) (n : ℕ) : set A := ∏ j ∈ Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2) set B := ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n) set C := ∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n) + have aux' : 2 * n.succ = 2 * n + 2 := by rw [Nat.succ_eq_add_one, mul_add, mul_one] have : (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n.succ)) = (2 * (n : ℝ) + 1) / (2 * n + 2) * C := by - simpa [C, Nat.cast_mul, Nat.cast_ofNat, cos_pi_div_two, sin_zero] using - (integral_cos_pow (a := (0 : ℝ)) (b := π / 2) (n := 2 * n)) + rw [integral_cos_pow_eq] + dsimp only [C] + rw [integral_cos_pow_eq, aux', integral_sin_pow, sin_zero, sin_pi, pow_succ', + zero_mul, zero_mul, zero_mul, sub_zero, zero_div, + zero_add, ← mul_assoc, ← mul_assoc, mul_comm (1 / 2 : ℝ) _, Nat.cast_mul, Nat.cast_ofNat] rw [this] + change + π * z * A * B / C = + (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) * + ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) / + ((2 * n + 1) / (2 * n + 2) * C : ℝ) have : (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) * ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) = From 90ac1e1c0ea47112c31c785fefcdbef911c082fa Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Thu, 16 Apr 2026 23:08:21 +0800 Subject: [PATCH 26/29] Apply suggestion from @Parcly-Taxel Co-authored-by: Jeremy Tan Jie Rui --- Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean b/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean index 21e956b943c81f..e9d6760992c10a 100644 --- a/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean +++ b/Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean @@ -45,8 +45,8 @@ open Bornology theorem Asymptotics.isLittleO_pow_pow_cobounded_of_lt (hpq : p < q) : (· ^ p) =o[cobounded R] (· ^ q) := by rw [← Nat.add_sub_of_le hpq.le] - simpa [pow_add] using (isBigO_refl (fun x ↦ x ^ p) (cobounded R)).mul_isLittleO - ((isLittleO_const_id_cobounded (1 : R)).pow (Nat.sub_pos_of_lt hpq)) + simpa [pow_add] using (isBigO_refl (· ^ p) (cobounded R)).mul_isLittleO + ((isLittleO_const_id_cobounded 1).pow (Nat.sub_pos_of_lt hpq)) theorem Asymptotics.isBigO_pow_pow_cobounded_of_le (hpq : p ≤ q) : (· ^ p) =O[cobounded R] (· ^ q) := by From 7e5eeae8675218a2e188c1bed22b8f37e453106a Mon Sep 17 00:00:00 2001 From: yuanyi-350 Date: Fri, 17 Apr 2026 10:20:26 +0800 Subject: [PATCH 27/29] golf --- Mathlib/Analysis/Complex/CauchyIntegral.lean | 16 +++---------- Mathlib/Analysis/Complex/Exponential.lean | 14 ++--------- Mathlib/Analysis/Complex/Hadamard.lean | 25 ++++---------------- Mathlib/Analysis/Complex/Isometry.lean | 17 +++++-------- Mathlib/Analysis/Complex/Liouville.lean | 6 +---- Mathlib/Analysis/Complex/OperatorNorm.lean | 13 ++++------ Mathlib/Analysis/ODE/Transform.lean | 10 +++----- 7 files changed, 24 insertions(+), 77 deletions(-) diff --git a/Mathlib/Analysis/Complex/CauchyIntegral.lean b/Mathlib/Analysis/Complex/CauchyIntegral.lean index 75a9ab01cb8d82..fb25951480ffb2 100644 --- a/Mathlib/Analysis/Complex/CauchyIntegral.lean +++ b/Mathlib/Analysis/Complex/CauchyIntegral.lean @@ -14,6 +14,7 @@ public import Mathlib.Analysis.Real.Cardinality public import Mathlib.MeasureTheory.Integral.CircleIntegral public import Mathlib.MeasureTheory.Integral.DivergenceTheorem public import Mathlib.MeasureTheory.Measure.Lebesgue.Complex +public import Mathlib.Topology.Algebra.Module.Cardinality /-! # Cauchy integral formula @@ -516,19 +517,8 @@ theorem two_pi_I_inv_smul_circleIntegral_sub_inv_smul_of_differentiable_on_off_c rw [circleIntegral_sub_inv_smul_of_differentiable_on_off_countable_aux hs hz hc hd, inv_smul_smul₀] simp [Real.pi_ne_zero, I_ne_zero] - refine mem_closure_iff_nhds.2 fun t ht => ?_ - -- TODO: generalize to any vector space over `ℝ` - set g : ℝ → ℂ := fun x => w + ofReal x - have : Tendsto g (𝓝 0) (𝓝 w) := Continuous.tendsto' (by fun_prop) 0 w (add_zero _) - rcases mem_nhds_iff_exists_Ioo_subset.1 (this <| inter_mem ht <| isOpen_ball.mem_nhds hw) with - ⟨l, u, hlu₀, hlu_sub⟩ - obtain ⟨x, hx⟩ : (Ioo l u \ g ⁻¹' s).Nonempty := by - refine diff_nonempty.2 fun hsub => ?_ - have : (Ioo l u).Countable := - (hs.preimage ((add_right_injective w).comp ofReal_injective)).mono hsub - rw [← Cardinal.le_aleph0_iff_set_countable, Cardinal.mk_Ioo_real (hlu₀.1.trans hlu₀.2)] at this - exact this.not_gt Cardinal.aleph0_lt_continuum - exact ⟨g x, (hlu_sub hx.1).1, (hlu_sub hx.1).2, hx.2⟩ + simpa [diff_eq, inter_comm] using + (hs.dense_compl (𝕜 := ℝ)).open_subset_closure_inter isOpen_ball hw /-- **Cauchy integral formula**: if `f : ℂ → E` is continuous on a closed disc of radius `R` and is complex differentiable at all but countably many points of its interior, then for any `w` in this diff --git a/Mathlib/Analysis/Complex/Exponential.lean b/Mathlib/Analysis/Complex/Exponential.lean index 885cb26e092d48..71a23ba92fdb20 100644 --- a/Mathlib/Analysis/Complex/Exponential.lean +++ b/Mathlib/Analysis/Complex/Exponential.lean @@ -505,18 +505,8 @@ lemma norm_exp_sub_sum_le_norm_mul_exp (x : ℂ) (n : ℕ) : rw [← mul_sum] _ = ‖x‖ ^ n * ∑ m ∈ range (j - n), (‖x‖ ^ m / m.factorial) := by congr 1 - refine (sum_bij (fun m hm ↦ m + n) ?_ ?_ ?_ ?_).symm - · grind - · intro a ha b hb hab - simpa using hab - · intro b hb - simp only [mem_range, exists_prop] - simp only [mem_filter, mem_range] at hb - refine ⟨b - n, ?_, ?_⟩ - · rw [tsub_lt_tsub_iff_right hb.2] - exact hb.1 - · rw [tsub_add_cancel_of_le hb.2] - · simp + refine sum_nbij' (· - n) (· + n) ?_ ?_ ?_ ?_ ?_ <;> + simp +contextual [lt_tsub_iff_right, tsub_add_cancel_of_le] _ ≤ ‖x‖ ^ n * Real.exp ‖x‖ := by gcongr refine Real.sum_le_exp_of_nonneg ?_ _ diff --git a/Mathlib/Analysis/Complex/Hadamard.lean b/Mathlib/Analysis/Complex/Hadamard.lean index 86c6f1243347e7..d87e22e88eaaad 100644 --- a/Mathlib/Analysis/Complex/Hadamard.lean +++ b/Mathlib/Analysis/Complex/Hadamard.lean @@ -311,31 +311,16 @@ def scale (f : ℂ → E) (l u : ℝ) : ℂ → E := fun z ↦ f (l + z • (u - lemma scale_id_mem_verticalClosedStrip_of_mem_verticalClosedStrip {l u : ℝ} (hul : l < u) {z : ℂ} (hz : z ∈ verticalClosedStrip 0 1) : l + z * (u - l) ∈ verticalClosedStrip l u := by simp only [verticalClosedStrip, mem_preimage, add_re, ofReal_re, mul_re, sub_re, sub_im, - ofReal_im, sub_self, mul_zero, sub_zero, mem_Icc, le_add_iff_nonneg_right] - simp only [verticalClosedStrip, mem_preimage, mem_Icc] at hz - obtain ⟨hz₁, hz₂⟩ := hz - simp only [sub_pos, hul, mul_nonneg_iff_of_pos_right, hz₁, true_and] - rw [add_comm, ← sub_le_sub_iff_right l, add_sub_assoc, sub_self, add_zero] - nth_rewrite 2 [← one_mul (u - l)] - have := sub_nonneg.2 hul.le - gcongr + ofReal_im, sub_self, mul_zero, sub_zero, mem_Icc] at hz ⊢ + constructor <;> nlinarith [hz.1, hz.2, hul] /-- The norm of the function `scale f l u` is bounded above on the closed strip `re⁻¹' [0, 1]`. -/ lemma scale_bddAbove {f : ℂ → E} {l u : ℝ} (hul : l < u) (hB : BddAbove ((norm ∘ f) '' verticalClosedStrip l u)) : BddAbove ((norm ∘ scale f l u) '' verticalClosedStrip 0 1) := by - obtain ⟨R, hR⟩ := bddAbove_def.mp hB - rw [bddAbove_def] - use R - intro r hr - obtain ⟨w, hw₁, hw₂, _⟩ := hr - simp only [comp_apply, scale, smul_eq_mul] - have : ‖f (↑l + w * (↑u - ↑l))‖ ∈ norm ∘ f '' verticalClosedStrip l u := by - simp only [comp_apply, mem_image] - use ↑l + w * (↑u - ↑l) - simp only [and_true] - exact scale_id_mem_verticalClosedStrip_of_mem_verticalClosedStrip hul hw₁ - exact hR ‖f (↑l + w * (↑u - ↑l))‖ this + refine hB.mono ?_ + rintro _ ⟨z, hz, rfl⟩ + exact ⟨l + z * (u - l), scale_id_mem_verticalClosedStrip_of_mem_verticalClosedStrip hul hz, rfl⟩ /-- A bound to the norm of `f` on the line `z.re = l` induces a bound to the norm of `scale f l u z` on the line `z.re = 0`. -/ diff --git a/Mathlib/Analysis/Complex/Isometry.lean b/Mathlib/Analysis/Complex/Isometry.lean index 2464ae8171d33a..75a1cff27abb17 100644 --- a/Mathlib/Analysis/Complex/Isometry.lean +++ b/Mathlib/Analysis/Complex/Isometry.lean @@ -102,17 +102,12 @@ theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : ℂ →ₗ theorem LinearIsometry.im_apply_eq_im {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) : z + conj z = f z + conj (f z) := by - have : ‖f z - 1‖ = ‖z - 1‖ := by rw [← f.norm_map (z - 1), f.map_sub, h] - apply_fun fun x => x ^ 2 at this - simp only [← normSq_eq_norm_sq] at this - rw [← ofReal_inj, ← mul_conj, ← mul_conj] at this - rw [map_sub, map_sub] at this - simp only [sub_mul, mul_sub, one_mul] at this - rw [mul_conj, normSq_eq_norm_sq, LinearIsometry.norm_map] at this - rw [mul_conj, normSq_eq_norm_sq] at this - simp only [sub_sub, sub_right_inj, mul_one, ofReal_pow, map_one] at this - simp only [add_sub, sub_left_inj] at this - rw [add_comm, ← this, add_comm] + have hdist : ‖f z - 1‖ = ‖z - 1‖ := by simpa [f.map_sub, h] using f.norm_map (z - 1) + have hsq : ‖f z - 1‖ ^ 2 = ‖z - 1‖ ^ 2 := congrArg (fun x : ℝ => x ^ 2) hdist + rw [← normSq_eq_norm_sq, ← normSq_eq_norm_sq, Complex.normSq_sub, Complex.normSq_sub, + normSq_eq_norm_sq, normSq_eq_norm_sq, LinearIsometry.norm_map] at hsq + have hre : (f z).re = z.re := by simpa [normSq_eq_norm_sq] using hsq + simp [Complex.add_conj, hre] theorem LinearIsometry.re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ} (h : f 1 = 1) (z : ℂ) : (f z).re = z.re := by apply LinearIsometry.re_apply_eq_re_of_add_conj_eq diff --git a/Mathlib/Analysis/Complex/Liouville.lean b/Mathlib/Analysis/Complex/Liouville.lean index 9a89efdcaef4d2..fb4fabd031b9f4 100644 --- a/Mathlib/Analysis/Complex/Liouville.lean +++ b/Mathlib/Analysis/Complex/Liouville.lean @@ -93,11 +93,7 @@ theorem liouville_theorem_aux {f : ℂ → F} (hf : Differentiable ℂ f) (hb : (z w : ℂ) : f z = f w := by suffices ∀ c, deriv f c = 0 from is_const_of_deriv_eq_zero hf this z w clear z w; intro c - obtain ⟨C, C₀, hC⟩ : ∃ C > (0 : ℝ), ∀ z, ‖f z‖ ≤ C := by - rcases isBounded_iff_forall_norm_le.1 hb with ⟨C, hC⟩ - exact - ⟨max C 1, lt_max_iff.2 (Or.inr zero_lt_one), fun z => - (hC (f z) (mem_range_self _)).trans (le_max_left _ _)⟩ + obtain ⟨C, C₀, hC⟩ := hb.exists_pos_norm_le refine norm_le_zero_iff.1 (le_of_forall_gt_imp_ge_of_dense fun ε ε₀ => ?_) calc ‖deriv f c‖ ≤ C / (C / ε) := diff --git a/Mathlib/Analysis/Complex/OperatorNorm.lean b/Mathlib/Analysis/Complex/OperatorNorm.lean index 45e5dec65b350e..6ed435f33afd92 100644 --- a/Mathlib/Analysis/Complex/OperatorNorm.lean +++ b/Mathlib/Analysis/Complex/OperatorNorm.lean @@ -7,6 +7,7 @@ module public import Mathlib.Analysis.Complex.Basic public import Mathlib.Analysis.Normed.Operator.NormedSpace +public import Mathlib.Analysis.RCLike.Lemmas public import Mathlib.LinearAlgebra.Complex.Determinant /-! # The basic continuous linear maps associated to `ℂ` @@ -34,11 +35,7 @@ theorem linearEquiv_det_conjLIE : LinearEquiv.det conjLIE.toLinearEquiv = -1 := linearEquiv_det_conjAe @[simp] -theorem reCLM_norm : ‖reCLM‖ = 1 := - le_antisymm (LinearMap.mkContinuous_norm_le _ zero_le_one _) <| - calc - 1 = ‖reCLM 1‖ := by simp - _ ≤ ‖reCLM‖ := unit_le_opNorm _ _ (by simp) +theorem reCLM_norm : ‖reCLM‖ = 1 := RCLike.reCLM_norm @[simp] theorem reCLM_enorm : ‖reCLM‖ₑ = 1 := by simp [← ofReal_norm] @@ -62,8 +59,7 @@ theorem imCLM_nnnorm : ‖imCLM‖₊ = 1 := Subtype.ext imCLM_norm @[simp] -theorem conjCLE_norm : ‖(conjCLE : ℂ →L[ℝ] ℂ)‖ = 1 := - conjLIE.toLinearIsometry.norm_toContinuousLinearMap +theorem conjCLE_norm : ‖(conjCLE : ℂ →L[ℝ] ℂ)‖ = 1 := RCLike.conjCLE_norm @[simp] theorem conjCLE_enorm : ‖(conjCLE : ℂ →L[ℝ] ℂ)‖ₑ = 1 := by simp [← ofReal_norm] @@ -73,8 +69,7 @@ theorem conjCLE_nnorm : ‖(conjCLE : ℂ →L[ℝ] ℂ)‖₊ = 1 := Subtype.ext conjCLE_norm @[simp] -theorem ofRealCLM_norm : ‖ofRealCLM‖ = 1 := - ofRealLI.norm_toContinuousLinearMap +theorem ofRealCLM_norm : ‖ofRealCLM‖ = 1 := RCLike.ofRealCLM_norm @[simp] theorem ofRealCLM_enorm : ‖ofRealCLM‖ₑ = 1 := by simp [← ofReal_norm] diff --git a/Mathlib/Analysis/ODE/Transform.lean b/Mathlib/Analysis/ODE/Transform.lean index 67c3e7922fd91c..3812b9890840be 100644 --- a/Mathlib/Analysis/ODE/Transform.lean +++ b/Mathlib/Analysis/ODE/Transform.lean @@ -154,13 +154,9 @@ lemma IsIntegralCurve.comp_mul (hγ : IsIntegralCurve γ v) (a : ℝ) : lemma isIntegralCurve_comp_mul_ne_zero {a : ℝ} (ha : a ≠ 0) : IsIntegralCurve (γ ∘ (· * a)) (a • v ∘ (· * a)) ↔ IsIntegralCurve γ v := by - refine ⟨fun hγ ↦ ?_, fun hγ ↦ hγ.comp_mul _⟩ - convert hγ.comp_mul a⁻¹ - · ext t - simp only [comp_apply, mul_assoc, inv_mul_eq_div, div_self ha, mul_one] - · ext t - simp only [comp_apply, Pi.smul_apply, mul_assoc, inv_mul_eq_div, div_self ha, mul_one, - smul_smul, one_smul] + have huniv : a⁻¹ • (univ : Set ℝ) = univ := by ext t; simp [Set.mem_inv_smul_set_iff₀, ha] + simpa [← isIntegralCurveOn_univ, huniv] using + (isIntegralCurveOn_comp_mul_ne_zero (γ := γ) (v := v) (s := (univ : Set ℝ)) ha) /-- If the vector field `v` vanishes at `x₀` for all times, then the constant curve at `x₀` is a global integral curve of `v`. -/ From 7989c3a2f874ce61299bb4b9eba5c14b9a8b3629 Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Sat, 18 Apr 2026 17:07:09 +0800 Subject: [PATCH 28/29] fix ci --- .../Normed/Module/FiniteDimension.lean | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean index f67994a598afca..2cf27c82dbf1b5 100644 --- a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean +++ b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean @@ -499,32 +499,6 @@ end Riesz open ContinuousLinearMap -/-- Continuous linear equivalence between continuous linear functions `𝕜ⁿ → E` and `Eⁿ`. -The spaces `𝕜ⁿ` and `Eⁿ` are represented as `ι → 𝕜` and `ι → E`, respectively, -where `ι` is a finite type. -/ -def ContinuousLinearEquiv.piRing (ι : Type*) [Fintype ι] [DecidableEq ι] : - ((ι → 𝕜) →L[𝕜] E) ≃L[𝕜] ι → E := - { LinearMap.toContinuousLinearMap.symm.trans (LinearEquiv.piRing 𝕜 E ι 𝕜) with - continuous_toFun := by - refine continuous_pi fun i => ?_ - exact (ContinuousLinearMap.apply 𝕜 E (Pi.single i 1)).continuous - continuous_invFun := by - simp_rw [LinearEquiv.invFun_eq_symm, LinearEquiv.trans_symm, LinearEquiv.symm_symm] - -- Note: added explicit type and removed `change` that tried to achieve the same - refine AddMonoidHomClass.continuous_of_bound - (LinearMap.toContinuousLinearMap.toLinearMap.comp - (LinearEquiv.piRing 𝕜 E ι 𝕜).symm.toLinearMap) - (Fintype.card ι : ℝ) fun g => ?_ - rw [← nsmul_eq_mul] - refine opNorm_le_bound _ (nsmul_nonneg (norm_nonneg g) (Fintype.card ι)) fun t => ?_ - simp_rw [LinearMap.coe_comp, LinearEquiv.coe_toLinearMap, Function.comp_apply, - LinearMap.coe_toContinuousLinearMap', LinearEquiv.piRing_symm_apply] - apply le_trans (norm_sum_le _ _) - rw [smul_mul_assoc] - refine Finset.sum_le_card_nsmul _ _ _ fun i _ => ?_ - rw [norm_smul, mul_comm] - gcongr <;> apply norm_le_pi_norm } - /-- A family of continuous linear maps is continuous within `s` at `x` iff all its applications are. -/ theorem continuousWithinAt_clm_apply {X : Type*} [TopologicalSpace X] [FiniteDimensional 𝕜 E] From a9d6ceb7f3b1429dda4c46b0925b60ea995e7dbc Mon Sep 17 00:00:00 2001 From: "Yi.Yuan" Date: Mon, 20 Apr 2026 13:33:07 +0800 Subject: [PATCH 29/29] sync from sub-pr s --- .../Analysis/CStarAlgebra/Unitization.lean | 8 +++- .../Analysis/Calculus/FDeriv/Measurable.lean | 12 +----- Mathlib/Analysis/Complex/Liouville.lean | 6 ++- Mathlib/Analysis/Complex/Trigonometric.lean | 4 +- .../InnerProductSpace/LinearPMap.lean | 27 +++++--------- Mathlib/Analysis/PSeries.lean | 37 ++++++------------- .../SpecialFunctions/Gamma/Basic.lean | 4 +- 7 files changed, 39 insertions(+), 59 deletions(-) diff --git a/Mathlib/Analysis/CStarAlgebra/Unitization.lean b/Mathlib/Analysis/CStarAlgebra/Unitization.lean index ce0740ce76a961..0830c1c2a863ea 100644 --- a/Mathlib/Analysis/CStarAlgebra/Unitization.lean +++ b/Mathlib/Analysis/CStarAlgebra/Unitization.lean @@ -167,7 +167,13 @@ instance Unitization.instCStarRing : CStarRing (Unitization 𝕜 E) where simp only [Unitization.splitMul_apply, Unitization.fst_mul, Unitization.fst_star, norm_mul, norm_star, sq] rw [h₂, h₃] - grind + /- use the definition of the norm, and split into cases based on whether the norm in the first + coordinate is bigger or smaller than the norm in the second coordinate. -/ + -- `grind` works here but is much slower + by_cases! h : ‖(Unitization.splitMul 𝕜 E x).fst‖ ≤ ‖(Unitization.splitMul 𝕜 E x).snd‖ + · rw [sq, sq, sup_eq_right.mpr h, sup_eq_right.mpr (mul_self_le_mul_self (norm_nonneg _) h)] + · replace h := h.le + rw [sq, sq, sup_eq_left.mpr h, sup_eq_left.mpr (mul_self_le_mul_self (norm_nonneg _) h)] /-- The minimal unitization (over `ℂ`) of a C⋆-algebra, equipped with the C⋆-norm. When `A` is unital, `A⁺¹ ≃⋆ₐ[ℂ] (ℂ × A)`. -/ diff --git a/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean b/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean index b6863131993544..5aad9a30dce5a0 100644 --- a/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean +++ b/Mathlib/Analysis/Calculus/FDeriv/Measurable.lean @@ -688,11 +688,8 @@ variable (f) set, is Borel-measurable. -/ theorem measurableSet_of_differentiableWithinAt_Ici_of_isComplete {K : Set F} (hK : IsComplete K) : MeasurableSet { x | DifferentiableWithinAt ℝ f (Ici x) x ∧ derivWithin f (Ici x) x ∈ K } := by - -- simp [differentiable_set_eq_d K hK, D, measurableSet_b, MeasurableSet.iInter, - -- MeasurableSet.iUnion] simp only [differentiable_set_eq_D K hK, D] - repeat apply_rules [MeasurableSet.iUnion, MeasurableSet.iInter] <;> intro - exact measurableSet_B + grind [MeasurableSet.iUnion, MeasurableSet.iInter, measurableSet_B] variable [CompleteSpace F] @@ -877,12 +874,7 @@ theorem measurableSet_of_differentiableAt_of_isComplete_with_param rw [this] simp only [D, mem_iInter, mem_iUnion] simp only [setOf_forall, setOf_exists] - refine MeasurableSet.iInter (fun _ ↦ ?_) - refine MeasurableSet.iUnion (fun _ ↦ ?_) - refine MeasurableSet.iInter (fun _ ↦ ?_) - refine MeasurableSet.iInter (fun _ ↦ ?_) - refine MeasurableSet.iInter (fun _ ↦ ?_) - refine MeasurableSet.iInter (fun _ ↦ ?_) + repeat apply_rules [MeasurableSet.iUnion, MeasurableSet.iInter] <;> intro have : ProperSpace E := .of_locallyCompactSpace 𝕜 exact (isOpen_B_with_param hf K).measurableSet diff --git a/Mathlib/Analysis/Complex/Liouville.lean b/Mathlib/Analysis/Complex/Liouville.lean index fb4fabd031b9f4..9a89efdcaef4d2 100644 --- a/Mathlib/Analysis/Complex/Liouville.lean +++ b/Mathlib/Analysis/Complex/Liouville.lean @@ -93,7 +93,11 @@ theorem liouville_theorem_aux {f : ℂ → F} (hf : Differentiable ℂ f) (hb : (z w : ℂ) : f z = f w := by suffices ∀ c, deriv f c = 0 from is_const_of_deriv_eq_zero hf this z w clear z w; intro c - obtain ⟨C, C₀, hC⟩ := hb.exists_pos_norm_le + obtain ⟨C, C₀, hC⟩ : ∃ C > (0 : ℝ), ∀ z, ‖f z‖ ≤ C := by + rcases isBounded_iff_forall_norm_le.1 hb with ⟨C, hC⟩ + exact + ⟨max C 1, lt_max_iff.2 (Or.inr zero_lt_one), fun z => + (hC (f z) (mem_range_self _)).trans (le_max_left _ _)⟩ refine norm_le_zero_iff.1 (le_of_forall_gt_imp_ge_of_dense fun ε ε₀ => ?_) calc ‖deriv f c‖ ≤ C / (C / ε) := diff --git a/Mathlib/Analysis/Complex/Trigonometric.lean b/Mathlib/Analysis/Complex/Trigonometric.lean index a7ec01f9021317..aed73f44f005ac 100644 --- a/Mathlib/Analysis/Complex/Trigonometric.lean +++ b/Mathlib/Analysis/Complex/Trigonometric.lean @@ -504,8 +504,8 @@ theorem cos_three_mul : cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x := by rw [← cosh_mul_I, mul_assoc, cosh_three_mul, cosh_mul_I] theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by - rw [← mul_left_inj' I_ne_zero, ← sinh_mul_I, mul_assoc, sinh_three_mul, sinh_mul_I] - grind [I_sq] + rw [← two_add_one_eq_three, add_one_mul, sin_add (2 * x) x] + grind [cos_two_mul, sin_two_mul, cos_sq'] theorem exp_mul_I : exp (x * I) = cos x + sin x * I := (cos_add_sin_I _).symm diff --git a/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean b/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean index 09cae9864a61a1..09f70f5d02342f 100644 --- a/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean +++ b/Mathlib/Analysis/InnerProductSpace/LinearPMap.lean @@ -277,12 +277,8 @@ theorem mem_adjoint_iff (g : Submodule 𝕜 (E × F)) (x : F × E) : LinearEquiv.trans_apply, LinearEquiv.skewSwap_symm_apply, coe_symm_linearEquiv, Prod.exists, prod_inner_apply, ofLp_fst, ofLp_snd, forall_exists_index, and_imp, coe_linearEquiv] constructor - · rintro ⟨y, h1, h2⟩ a b hab - rw [← h2, WithLp.ofLp_fst, WithLp.ofLp_snd] - specialize h1 (toLp 2 (b, -a)) a b hab rfl - dsimp at h1 - simp only [inner_neg_left, ← sub_eq_add_neg] at h1 - exact h1 + · rintro ⟨_, h, rfl⟩ a b hab + simpa [sub_eq_add_neg] using h (toLp 2 (b, -a)) a b hab rfl · intro h refine ⟨toLp 2 x, ?_, rfl⟩ intro u a b hab hu @@ -296,19 +292,14 @@ theorem _root_.LinearPMap.adjoint_graph_eq_graph_adjoint (hT : Dense (T.domain : simp only [mem_graph_iff, Subtype.exists, exists_and_left, exists_eq_left, mem_adjoint_iff, forall_exists_index, forall_apply_eq_imp_iff] constructor - · rintro ⟨hx, h⟩ a ha - rw [← h, (adjoint_isFormalAdjoint hT).symm ⟨a, ha⟩ ⟨x.fst, hx⟩, sub_self] + · rintro ⟨hx, hTx⟩ a ha + rw [← hTx, (adjoint_isFormalAdjoint hT).symm ⟨a, ha⟩ ⟨x.fst, hx⟩, sub_self] · intro h - simp_rw [sub_eq_zero] at h - have hx : x.fst ∈ T†.domain := by - apply mem_adjoint_domain_of_exists - use x.snd - rintro ⟨a, ha⟩ - rw [← inner_conj_symm, ← h a ha, inner_conj_symm] - use hx - apply hT.eq_of_inner_right 𝕜 - rintro a ha - rw [← h a ha, (adjoint_isFormalAdjoint hT).symm ⟨a, ha⟩ ⟨x.fst, hx⟩] + simp only [sub_eq_zero] at h + refine ⟨?_, adjoint_apply_eq hT _ fun a ↦ by + rw [← inner_conj_symm, ← h a.1 a.2, inner_conj_symm]⟩ + exact mem_adjoint_domain_of_exists _ ⟨x.2, fun a ↦ by + rw [← inner_conj_symm, ← h a.1 a.2, inner_conj_symm]⟩ @[simp] theorem _root_.LinearPMap.graph_adjoint_toLinearPMap_eq_adjoint (hT : Dense (T.domain : Set E)) : diff --git a/Mathlib/Analysis/PSeries.lean b/Mathlib/Analysis/PSeries.lean index ffdf8264c6785e..39c8120face63a 100644 --- a/Mathlib/Analysis/PSeries.lean +++ b/Mathlib/Analysis/PSeries.lean @@ -5,10 +5,12 @@ Authors: Yury Kudryashov -/ module -public import Mathlib.Analysis.SpecialFunctions.Pow.NNReal public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity public import Mathlib.Analysis.SumOverResidueClass +import Mathlib.Analysis.Asymptotics.SpecificAsymptotics +import Mathlib.Analysis.Normed.Module.FiniteDimension + /-! # Convergence of `p`-series @@ -444,32 +446,17 @@ section shifted open Filter Asymptotics Topology --- see https://github.com/leanprover-community/mathlib4/issues/29041 -set_option linter.unusedSimpArgs false in lemma Real.summable_one_div_nat_add_rpow (a : ℝ) (s : ℝ) : Summable (fun n : ℕ ↦ 1 / |n + a| ^ s) ↔ 1 < s := by - suffices ∀ (b c : ℝ), Summable (fun n : ℕ ↦ 1 / |n + b| ^ s) → - Summable (fun n : ℕ ↦ 1 / |n + c| ^ s) by - simp_rw [← summable_one_div_nat_rpow, Iff.intro (this a 0) (this 0 a), add_zero, Nat.abs_cast] - refine fun b c h ↦ summable_of_isBigO_nat h (isBigO_of_div_tendsto_nhds ?_ 1 ?_) - · filter_upwards [eventually_gt_atTop (Nat.ceil |b|)] with n hn hx - have hna : 0 < n + b := by linarith [lt_of_abs_lt ((abs_neg b).symm ▸ Nat.lt_of_ceil_lt hn)] - exfalso - revert hx - positivity - · simp_rw [Pi.div_def, div_div, mul_one_div, one_div_div] - refine (?_ : Tendsto (fun x : ℝ ↦ |x + b| ^ s / |x + c| ^ s) atTop (𝓝 1)).comp - tendsto_natCast_atTop_atTop - have : Tendsto (fun x : ℝ ↦ 1 + (b - c) / x) atTop (𝓝 1) := by - simpa using tendsto_const_nhds.add ((tendsto_const_nhds (X := ℝ)).div_atTop tendsto_id) - have : Tendsto (fun x ↦ (x + b) / (x + c)) atTop (𝓝 1) := by - refine (this.comp (tendsto_id.atTop_add (tendsto_const_nhds (x := c)))).congr' ?_ - filter_upwards [eventually_gt_atTop (-c)] with x hx - simp [field, (by linarith : 0 < x + c).ne'] - apply (one_rpow s ▸ (continuousAt_rpow_const _ s (by simp)).tendsto.comp this).congr' - filter_upwards [eventually_gt_atTop (-b), eventually_gt_atTop (-c)] with x hb hc - rw [neg_lt_iff_pos_add] at hb hc - rw [Function.comp_apply, div_rpow hb.le hc.le, abs_of_pos hb, abs_of_pos hc] + have hnorm : Tendsto (fun n : ℕ ↦ ‖(n : ℝ)‖) atTop atTop := + Tendsto.congr' (by simp) tendsto_natCast_atTop_atTop + have h_abs : (fun n : ℕ ↦ |n + a|) ~[atTop] (·) := by + apply (IsEquivalent.add_const_of_norm_tendsto_atTop IsEquivalent.refl hnorm).congr_left + · filter_upwards [eventually_gt_atTop (Nat.ceil |a|)] with _ hn + rw [abs_of_pos] + linarith [lt_of_abs_lt ((abs_neg a).symm ▸ Nat.lt_of_ceil_lt hn)] + rw [← summable_one_div_nat_rpow, Asymptotics.IsEquivalent.summable_iff_nat] + simpa [one_div] using (IsEquivalent.rpow (fun n ↦ by positivity) h_abs).inv lemma Real.summable_one_div_int_add_rpow (a : ℝ) (s : ℝ) : Summable (fun n : ℤ ↦ 1 / |n + a| ^ s) ↔ 1 < s := by diff --git a/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean b/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean index ce181deffc97b1..77e13d24a2726b 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gamma/Basic.lean @@ -408,8 +408,8 @@ def Gamma (s : ℝ) : ℝ := set_option backward.isDefEq.respectTransparency false in theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) : Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by - rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s), - Complex.GammaIntegral_ofReal, Complex.ofReal_re] + rw [Gamma, Complex.Gamma_eq_integral (RCLike.ofReal_pos.mp hs), Complex.GammaIntegral_ofReal, + Complex.ofReal_re] theorem Gamma_add_one {s : ℝ} (hs : s ≠ 0) : Gamma (s + 1) = s * Gamma s := by simp_rw [Gamma]