Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
goals
listlengths
0
224
goals_before
listlengths
0
221
import Mathlib.Algebra.Polynomial.Degree.Definitions import Mathlib.Algebra.Polynomial.Eval import Mathlib.Algebra.Polynomial.Monic import Mathlib.Algebra.Polynomial.RingDivision import Mathlib.Tactic.Abel #align_import ring_theory.polynomial.pochhammer from "leanprover-community/mathlib"@"53b216bcc1146df1c4a0a86877890ea9f1f01589" universe u v open Polynomial open Polynomial section Semiring variable (S : Type u) [Semiring S] noncomputable def ascPochhammer : ℕ → S[X] | 0 => 1 | n + 1 => X * (ascPochhammer n).comp (X + 1) #align pochhammer ascPochhammer @[simp] theorem ascPochhammer_zero : ascPochhammer S 0 = 1 := rfl #align pochhammer_zero ascPochhammer_zero @[simp]
Mathlib/RingTheory/Polynomial/Pochhammer.lean
61
61
theorem ascPochhammer_one : ascPochhammer S 1 = X := by
simp [ascPochhammer]
[ " ascPochhammer S 1 = X" ]
[ " ascPochhammer S 1 = X" ]
import Mathlib.Probability.Process.HittingTime import Mathlib.Probability.Martingale.Basic #align_import probability.martingale.optional_stopping from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory variable {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {𝒢 : Filtration ℕ m0} {f : ℕ → Ω → ℝ} {τ π : Ω → ℕ} -- We may generalize the below lemma to functions taking value in a `NormedLatticeAddCommGroup`. -- Similarly, generalize `(Super/Sub)martingale.setIntegral_le`. theorem Submartingale.expected_stoppedValue_mono [SigmaFiniteFiltration μ 𝒢] (hf : Submartingale f 𝒢 μ) (hτ : IsStoppingTime 𝒢 τ) (hπ : IsStoppingTime 𝒢 π) (hle : τ ≤ π) {N : ℕ} (hbdd : ∀ ω, π ω ≤ N) : μ[stoppedValue f τ] ≤ μ[stoppedValue f π] := by rw [← sub_nonneg, ← integral_sub', stoppedValue_sub_eq_sum' hle hbdd] · simp only [Finset.sum_apply] have : ∀ i, MeasurableSet[𝒢 i] {ω : Ω | τ ω ≤ i ∧ i < π ω} := by intro i refine (hτ i).inter ?_ convert (hπ i).compl using 1 ext x simp; rfl rw [integral_finset_sum] · refine Finset.sum_nonneg fun i _ => ?_ rw [integral_indicator (𝒢.le _ _ (this _)), integral_sub', sub_nonneg] · exact hf.setIntegral_le (Nat.le_succ i) (this _) · exact (hf.integrable _).integrableOn · exact (hf.integrable _).integrableOn intro i _ exact Integrable.indicator (Integrable.sub (hf.integrable _) (hf.integrable _)) (𝒢.le _ _ (this _)) · exact hf.integrable_stoppedValue hπ hbdd · exact hf.integrable_stoppedValue hτ fun ω => le_trans (hle ω) (hbdd ω) #align measure_theory.submartingale.expected_stopped_value_mono MeasureTheory.Submartingale.expected_stoppedValue_mono
Mathlib/Probability/Martingale/OptionalStopping.lean
69
80
theorem submartingale_of_expected_stoppedValue_mono [IsFiniteMeasure μ] (hadp : Adapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ) (hf : ∀ τ π : Ω → ℕ, IsStoppingTime 𝒢 τ → IsStoppingTime 𝒢 π → τ ≤ π → (∃ N, ∀ ω, π ω ≤ N) → μ[stoppedValue f τ] ≤ μ[stoppedValue f π]) : Submartingale f 𝒢 μ := by
refine submartingale_of_setIntegral_le hadp hint fun i j hij s hs => ?_ classical specialize hf (s.piecewise (fun _ => i) fun _ => j) _ (isStoppingTime_piecewise_const hij hs) (isStoppingTime_const 𝒢 j) (fun x => (ite_le_sup _ _ (x ∈ s)).trans (max_eq_right hij).le) ⟨j, fun _ => le_rfl⟩ rwa [stoppedValue_const, stoppedValue_piecewise_const, integral_piecewise (𝒢.le _ _ hs) (hint _).integrableOn (hint _).integrableOn, ← integral_add_compl (𝒢.le _ _ hs) (hint j), add_le_add_iff_right] at hf
[ " ∫ (x : Ω), stoppedValue f τ x ∂μ ≤ ∫ (x : Ω), stoppedValue f π x ∂μ", " 0 ≤ ∫ (a : Ω), (fun ω => (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (f (i + 1) - f i)) ω) a ∂μ", " 0 ≤ ∫ (a : Ω), ∑ c ∈ Finset.range (N + 1), {ω | τ ω ≤ c ∧ c < π ω}.indicator (f (c + 1) - f c) a ∂μ", " ∀ (i : ℕ), Me...
[ " ∫ (x : Ω), stoppedValue f τ x ∂μ ≤ ∫ (x : Ω), stoppedValue f π x ∂μ", " 0 ≤ ∫ (a : Ω), (fun ω => (∑ i ∈ Finset.range (N + 1), {ω | τ ω ≤ i ∧ i < π ω}.indicator (f (i + 1) - f i)) ω) a ∂μ", " 0 ≤ ∫ (a : Ω), ∑ c ∈ Finset.range (N + 1), {ω | τ ω ≤ c ∧ c < π ω}.indicator (f (c + 1) - f c) a ∂μ", " ∀ (i : ℕ), Me...
import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.PartialSups import Mathlib.Algebra.Module.Submodule.IterateMapComap import Mathlib.RingTheory.OrzechProperty import Mathlib.RingTheory.Nilpotent.Lemmas #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" open Set Filter Pointwise -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def
Mathlib/RingTheory/Noetherian.lean
81
91
theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by
refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃)
[ " IsNoetherian R ↥N ↔ ∀ s ≤ N, s.FG", " s.FG", " Submodule.map f ⊤ = ⊤" ]
[ " IsNoetherian R ↥N ↔ ∀ s ≤ N, s.FG" ]
import Mathlib.Algebra.Order.Ring.Cast import Mathlib.Data.Int.Cast.Lemmas import Mathlib.Data.Nat.Bitwise import Mathlib.Data.Nat.PSub import Mathlib.Data.Nat.Size import Mathlib.Data.Num.Bitwise #align_import data.num.lemmas from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" set_option linter.deprecated false -- Porting note: Required for the notation `-[n+1]`. open Int Function attribute [local simp] add_assoc namespace ZNum variable {α : Type*} open PosNum @[simp, norm_cast] theorem cast_zero [Zero α] [One α] [Add α] [Neg α] : ((0 : ZNum) : α) = 0 := rfl #align znum.cast_zero ZNum.cast_zero @[simp] theorem cast_zero' [Zero α] [One α] [Add α] [Neg α] : (ZNum.zero : α) = 0 := rfl #align znum.cast_zero' ZNum.cast_zero' @[simp, norm_cast] theorem cast_one [Zero α] [One α] [Add α] [Neg α] : ((1 : ZNum) : α) = 1 := rfl #align znum.cast_one ZNum.cast_one @[simp] theorem cast_pos [Zero α] [One α] [Add α] [Neg α] (n : PosNum) : (pos n : α) = n := rfl #align znum.cast_pos ZNum.cast_pos @[simp] theorem cast_neg [Zero α] [One α] [Add α] [Neg α] (n : PosNum) : (neg n : α) = -n := rfl #align znum.cast_neg ZNum.cast_neg @[simp, norm_cast] theorem cast_zneg [AddGroup α] [One α] : ∀ n, ((-n : ZNum) : α) = -n | 0 => neg_zero.symm | pos _p => rfl | neg _p => (neg_neg _).symm #align znum.cast_zneg ZNum.cast_zneg theorem neg_zero : (-0 : ZNum) = 0 := rfl #align znum.neg_zero ZNum.neg_zero theorem zneg_pos (n : PosNum) : -pos n = neg n := rfl #align znum.zneg_pos ZNum.zneg_pos theorem zneg_neg (n : PosNum) : -neg n = pos n := rfl #align znum.zneg_neg ZNum.zneg_neg theorem zneg_zneg (n : ZNum) : - -n = n := by cases n <;> rfl #align znum.zneg_zneg ZNum.zneg_zneg
Mathlib/Data/Num/Lemmas.lean
1,056
1,056
theorem zneg_bit1 (n : ZNum) : -n.bit1 = (-n).bitm1 := by
cases n <;> rfl
[ " - -n = n", " - -zero = zero", " - -pos a✝ = pos a✝", " - -neg a✝ = neg a✝", " -n.bit1 = (-n).bitm1", " -zero.bit1 = (-zero).bitm1", " -(pos a✝).bit1 = (-pos a✝).bitm1", " -(neg a✝).bit1 = (-neg a✝).bitm1" ]
[ " - -n = n", " - -zero = zero", " - -pos a✝ = pos a✝", " - -neg a✝ = neg a✝", " -n.bit1 = (-n).bitm1" ]
import Mathlib.AlgebraicTopology.DoldKan.Faces import Mathlib.CategoryTheory.Idempotents.Basic #align_import algebraic_topology.dold_kan.projections from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive CategoryTheory.SimplicialObject Opposite CategoryTheory.Idempotents open Simplicial DoldKan noncomputable section namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] {X : SimplicialObject C} noncomputable def P : ℕ → (K[X] ⟶ K[X]) | 0 => 𝟙 _ | q + 1 => P q ≫ (𝟙 _ + Hσ q) set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P AlgebraicTopology.DoldKan.P -- Porting note: `P_zero` and `P_succ` have been added to ease the port, because -- `unfold P` would sometimes unfold to a `match` rather than the induction formula lemma P_zero : (P 0 : K[X] ⟶ K[X]) = 𝟙 _ := rfl lemma P_succ (q : ℕ) : (P (q+1) : K[X] ⟶ K[X]) = P q ≫ (𝟙 _ + Hσ q) := rfl @[simp] theorem P_f_0_eq (q : ℕ) : ((P q).f 0 : X _[0] ⟶ X _[0]) = 𝟙 _ := by induction' q with q hq · rfl · simp only [P_succ, HomologicalComplex.add_f_apply, HomologicalComplex.comp_f, HomologicalComplex.id_f, id_comp, hq, Hσ_eq_zero, add_zero] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_f_0_eq AlgebraicTopology.DoldKan.P_f_0_eq def Q (q : ℕ) : K[X] ⟶ K[X] := 𝟙 _ - P q set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q AlgebraicTopology.DoldKan.Q theorem P_add_Q (q : ℕ) : P q + Q q = 𝟙 K[X] := by rw [Q] abel set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_add_Q AlgebraicTopology.DoldKan.P_add_Q theorem P_add_Q_f (q n : ℕ) : (P q).f n + (Q q).f n = 𝟙 (X _[n]) := HomologicalComplex.congr_hom (P_add_Q q) n set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_add_Q_f AlgebraicTopology.DoldKan.P_add_Q_f @[simp] theorem Q_zero : (Q 0 : K[X] ⟶ _) = 0 := sub_self _ set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_eq_zero AlgebraicTopology.DoldKan.Q_zero
Mathlib/AlgebraicTopology/DoldKan/Projections.lean
92
94
theorem Q_succ (q : ℕ) : (Q (q + 1) : K[X] ⟶ _) = Q q - P q ≫ Hσ q := by
simp only [Q, P_succ, comp_add, comp_id] abel
[ " (P q).f 0 = 𝟙 (K[X].X 0)", " (P 0).f 0 = 𝟙 (K[X].X 0)", " (P (q + 1)).f 0 = 𝟙 (K[X].X 0)", " P q + Q q = 𝟙 K[X]", " P q + (𝟙 K[X] - P q) = 𝟙 K[X]", " Q (q + 1) = Q q - P q ≫ Hσ q", " 𝟙 K[X] - (P q + P q ≫ Hσ q) = 𝟙 K[X] - P q - P q ≫ Hσ q" ]
[ " (P q).f 0 = 𝟙 (K[X].X 0)", " (P 0).f 0 = 𝟙 (K[X].X 0)", " (P (q + 1)).f 0 = 𝟙 (K[X].X 0)", " P q + Q q = 𝟙 K[X]", " P q + (𝟙 K[X] - P q) = 𝟙 K[X]", " Q (q + 1) = Q q - P q ≫ Hσ q" ]
import Mathlib.Analysis.Convex.StrictConvexSpace #align_import analysis.convex.uniform from "leanprover-community/mathlib"@"17ef379e997badd73e5eabb4d38f11919ab3c4b3" open Set Metric open Convex Pointwise class UniformConvexSpace (E : Type*) [SeminormedAddCommGroup E] : Prop where uniform_convex : ∀ ⦃ε : ℝ⦄, 0 < ε → ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ = 1 → ∀ ⦃y⦄, ‖y‖ = 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ #align uniform_convex_space UniformConvexSpace variable {E : Type*} section SeminormedAddCommGroup variable (E) [SeminormedAddCommGroup E] [UniformConvexSpace E] {ε : ℝ} theorem exists_forall_sphere_dist_add_le_two_sub (hε : 0 < ε) : ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ = 1 → ∀ ⦃y⦄, ‖y‖ = 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ := UniformConvexSpace.uniform_convex hε #align exists_forall_sphere_dist_add_le_two_sub exists_forall_sphere_dist_add_le_two_sub variable [NormedSpace ℝ E]
Mathlib/Analysis/Convex/Uniform.lean
60
112
theorem exists_forall_closed_ball_dist_add_le_two_sub (hε : 0 < ε) : ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ 1 → ∀ ⦃y⦄, ‖y‖ ≤ 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ := by
have hε' : 0 < ε / 3 := div_pos hε zero_lt_three obtain ⟨δ, hδ, h⟩ := exists_forall_sphere_dist_add_le_two_sub E hε' set δ' := min (1 / 2) (min (ε / 3) <| δ / 3) refine ⟨δ', lt_min one_half_pos <| lt_min hε' (div_pos hδ zero_lt_three), fun x hx y hy hxy => ?_⟩ obtain hx' | hx' := le_or_lt ‖x‖ (1 - δ') · rw [← one_add_one_eq_two] exact (norm_add_le_of_le hx' hy).trans (sub_add_eq_add_sub _ _ _).le obtain hy' | hy' := le_or_lt ‖y‖ (1 - δ') · rw [← one_add_one_eq_two] exact (norm_add_le_of_le hx hy').trans (add_sub_assoc _ _ _).ge have hδ' : 0 < 1 - δ' := sub_pos_of_lt (min_lt_of_left_lt one_half_lt_one) have h₁ : ∀ z : E, 1 - δ' < ‖z‖ → ‖‖z‖⁻¹ • z‖ = 1 := by rintro z hz rw [norm_smul_of_nonneg (inv_nonneg.2 <| norm_nonneg _), inv_mul_cancel (hδ'.trans hz).ne'] have h₂ : ∀ z : E, ‖z‖ ≤ 1 → 1 - δ' ≤ ‖z‖ → ‖‖z‖⁻¹ • z - z‖ ≤ δ' := by rintro z hz hδz nth_rw 3 [← one_smul ℝ z] rwa [← sub_smul, norm_smul_of_nonneg (sub_nonneg_of_le <| one_le_inv (hδ'.trans_le hδz) hz), sub_mul, inv_mul_cancel (hδ'.trans_le hδz).ne', one_mul, sub_le_comm] set x' := ‖x‖⁻¹ • x set y' := ‖y‖⁻¹ • y have hxy' : ε / 3 ≤ ‖x' - y'‖ := calc ε / 3 = ε - (ε / 3 + ε / 3) := by ring _ ≤ ‖x - y‖ - (‖x' - x‖ + ‖y' - y‖) := by gcongr · exact (h₂ _ hx hx'.le).trans <| min_le_of_right_le <| min_le_left _ _ · exact (h₂ _ hy hy'.le).trans <| min_le_of_right_le <| min_le_left _ _ _ ≤ _ := by have : ∀ x' y', x - y = x' - y' + (x - x') + (y' - y) := fun _ _ => by abel rw [sub_le_iff_le_add, norm_sub_rev _ x, ← add_assoc, this] exact norm_add₃_le _ _ _ calc ‖x + y‖ ≤ ‖x' + y'‖ + ‖x' - x‖ + ‖y' - y‖ := by have : ∀ x' y', x + y = x' + y' + (x - x') + (y - y') := fun _ _ => by abel rw [norm_sub_rev, norm_sub_rev y', this] exact norm_add₃_le _ _ _ _ ≤ 2 - δ + δ' + δ' := (add_le_add_three (h (h₁ _ hx') (h₁ _ hy') hxy') (h₂ _ hx hx'.le) (h₂ _ hy hy'.le)) _ ≤ 2 - δ' := by dsimp [δ'] rw [← le_sub_iff_add_le, ← le_sub_iff_add_le, sub_sub, sub_sub] refine sub_le_sub_left ?_ _ ring_nf rw [← mul_div_cancel₀ δ three_ne_zero] set_option tactic.skipAssignedInstances false in norm_num -- Porting note: these three extra lines needed to make `exact` work have : 3 * (δ / 3) * (1 / 3) = δ / 3 := by linarith rw [this, mul_comm] gcongr exact min_le_of_right_le <| min_le_right _ _
[ " ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ 1 → ∀ ⦃y : E⦄, ‖y‖ ≤ 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ", " ‖x + y‖ ≤ 2 - δ'", " ‖x + y‖ ≤ 1 + 1 - δ'", " ∀ (z : E), 1 - δ' < ‖z‖ → ‖‖z‖⁻¹ • z‖ = 1", " ‖‖z‖⁻¹ • z‖ = 1", " ∀ (z : E), ‖z‖ ≤ 1 → 1 - δ' ≤ ‖z‖ → ‖‖z‖⁻¹ • z - z‖ ≤ δ'", " ‖‖z‖⁻¹ • z - z‖ ≤ δ'", " ‖‖z‖⁻¹ • z - ...
[ " ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ 1 → ∀ ⦃y : E⦄, ‖y‖ ≤ 1 → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 - δ" ]
import Mathlib.MeasureTheory.Integral.Lebesgue import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.MeanInequalitiesPow import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic #align_import measure_theory.integral.mean_inequalities from "leanprover-community/mathlib"@"13bf7613c96a9fd66a81b9020a82cad9a6ea1fcf" section LIntegral noncomputable section open scoped Classical open NNReal ENNReal MeasureTheory Finset set_option linter.uppercaseLean3 false variable {α : Type*} [MeasurableSpace α] {μ : Measure α} namespace ENNReal theorem lintegral_mul_le_one_of_lintegral_rpow_eq_one {p q : ℝ} (hpq : p.IsConjExponent q) {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hf_norm : ∫⁻ a, f a ^ p ∂μ = 1) (hg_norm : ∫⁻ a, g a ^ q ∂μ = 1) : (∫⁻ a, (f * g) a ∂μ) ≤ 1 := by calc (∫⁻ a : α, (f * g) a ∂μ) ≤ ∫⁻ a : α, f a ^ p / ENNReal.ofReal p + g a ^ q / ENNReal.ofReal q ∂μ := lintegral_mono fun a => young_inequality (f a) (g a) hpq _ = 1 := by simp only [div_eq_mul_inv] rw [lintegral_add_left'] · rw [lintegral_mul_const'' _ (hf.pow_const p), lintegral_mul_const', hf_norm, hg_norm, one_mul, one_mul, hpq.inv_add_inv_conj_ennreal] simp [hpq.symm.pos] · exact (hf.pow_const _).mul_const _ #align ennreal.lintegral_mul_le_one_of_lintegral_rpow_eq_one ENNReal.lintegral_mul_le_one_of_lintegral_rpow_eq_one def funMulInvSnorm (f : α → ℝ≥0∞) (p : ℝ) (μ : Measure α) : α → ℝ≥0∞ := fun a => f a * ((∫⁻ c, f c ^ p ∂μ) ^ (1 / p))⁻¹ #align ennreal.fun_mul_inv_snorm ENNReal.funMulInvSnorm theorem fun_eq_funMulInvSnorm_mul_snorm {p : ℝ} (f : α → ℝ≥0∞) (hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0) (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) {a : α} : f a = funMulInvSnorm f p μ a * (∫⁻ c, f c ^ p ∂μ) ^ (1 / p) := by simp [funMulInvSnorm, mul_assoc, ENNReal.inv_mul_cancel, hf_nonzero, hf_top] #align ennreal.fun_eq_fun_mul_inv_snorm_mul_snorm ENNReal.fun_eq_funMulInvSnorm_mul_snorm
Mathlib/MeasureTheory/Integral/MeanInequalities.lean
93
98
theorem funMulInvSnorm_rpow {p : ℝ} (hp0 : 0 < p) {f : α → ℝ≥0∞} {a : α} : funMulInvSnorm f p μ a ^ p = f a ^ p * (∫⁻ c, f c ^ p ∂μ)⁻¹ := by
rw [funMulInvSnorm, mul_rpow_of_nonneg _ _ (le_of_lt hp0)] suffices h_inv_rpow : ((∫⁻ c : α, f c ^ p ∂μ) ^ (1 / p))⁻¹ ^ p = (∫⁻ c : α, f c ^ p ∂μ)⁻¹ by rw [h_inv_rpow] rw [inv_rpow, ← rpow_mul, one_div_mul_cancel hp0.ne', rpow_one]
[ " ∫⁻ (a : α), (f * g) a ∂μ ≤ 1", " ∫⁻ (a : α), f a ^ p / ENNReal.ofReal p + g a ^ q / ENNReal.ofReal q ∂μ = 1", " ∫⁻ (a : α), f a ^ p * (ENNReal.ofReal p)⁻¹ + g a ^ q * (ENNReal.ofReal q)⁻¹ ∂μ = 1", " ∫⁻ (a : α), f a ^ p * (ENNReal.ofReal p)⁻¹ ∂μ + ∫⁻ (a : α), g a ^ q * (ENNReal.ofReal q)⁻¹ ∂μ = 1", " (ENNR...
[ " ∫⁻ (a : α), (f * g) a ∂μ ≤ 1", " ∫⁻ (a : α), f a ^ p / ENNReal.ofReal p + g a ^ q / ENNReal.ofReal q ∂μ = 1", " ∫⁻ (a : α), f a ^ p * (ENNReal.ofReal p)⁻¹ + g a ^ q * (ENNReal.ofReal q)⁻¹ ∂μ = 1", " ∫⁻ (a : α), f a ^ p * (ENNReal.ofReal p)⁻¹ ∂μ + ∫⁻ (a : α), g a ^ q * (ENNReal.ofReal q)⁻¹ ∂μ = 1", " (ENNR...
import Mathlib.Topology.MetricSpace.PiNat #align_import topology.metric_space.cantor_scheme from "leanprover-community/mathlib"@"49b7f94aab3a3bdca1f9f34c5d818afb253b3993" namespace CantorScheme open List Function Filter Set PiNat open scoped Classical open Topology variable {β α : Type*} (A : List β → Set α) noncomputable def inducedMap : Σs : Set (ℕ → β), s → α := ⟨fun x => Set.Nonempty (⋂ n : ℕ, A (res x n)), fun x => x.property.some⟩ #align cantor_scheme.induced_map CantorScheme.inducedMap section Topology protected def Antitone : Prop := ∀ l : List β, ∀ a : β, A (a :: l) ⊆ A l #align cantor_scheme.antitone CantorScheme.Antitone def ClosureAntitone [TopologicalSpace α] : Prop := ∀ l : List β, ∀ a : β, closure (A (a :: l)) ⊆ A l #align cantor_scheme.closure_antitone CantorScheme.ClosureAntitone protected def Disjoint : Prop := ∀ l : List β, Pairwise fun a b => Disjoint (A (a :: l)) (A (b :: l)) #align cantor_scheme.disjoint CantorScheme.Disjoint variable {A} theorem map_mem (x : (inducedMap A).1) (n : ℕ) : (inducedMap A).2 x ∈ A (res x n) := by have := x.property.some_mem rw [mem_iInter] at this exact this n #align cantor_scheme.map_mem CantorScheme.map_mem protected theorem ClosureAntitone.antitone [TopologicalSpace α] (hA : ClosureAntitone A) : CantorScheme.Antitone A := fun l a => subset_closure.trans (hA l a) #align cantor_scheme.closure_antitone.antitone CantorScheme.ClosureAntitone.antitone protected theorem Antitone.closureAntitone [TopologicalSpace α] (hanti : CantorScheme.Antitone A) (hclosed : ∀ l, IsClosed (A l)) : ClosureAntitone A := fun _ _ => (hclosed _).closure_eq.subset.trans (hanti _ _) #align cantor_scheme.antitone.closure_antitone CantorScheme.Antitone.closureAntitone
Mathlib/Topology/MetricSpace/CantorScheme.lean
99
115
theorem Disjoint.map_injective (hA : CantorScheme.Disjoint A) : Injective (inducedMap A).2 := by
rintro ⟨x, hx⟩ ⟨y, hy⟩ hxy refine Subtype.coe_injective (res_injective ?_) dsimp ext n : 1 induction' n with n ih; · simp simp only [res_succ, cons.injEq] refine ⟨?_, ih⟩ contrapose hA simp only [CantorScheme.Disjoint, _root_.Pairwise, Ne, not_forall, exists_prop] refine ⟨res x n, _, _, hA, ?_⟩ rw [not_disjoint_iff] refine ⟨(inducedMap A).2 ⟨x, hx⟩, ?_, ?_⟩ · rw [← res_succ] apply map_mem rw [hxy, ih, ← res_succ] apply map_mem
[ " (inducedMap A).snd x ∈ A (res (↑x) n)", " Injective (inducedMap A).snd", " ⟨x, hx⟩ = ⟨y, hy⟩", " res ((fun a => ↑a) ⟨x, hx⟩) = res ((fun a => ↑a) ⟨y, hy⟩)", " res x = res y", " res x n = res y n", " res x 0 = res y 0", " res x (n + 1) = res y (n + 1)", " x n = y n ∧ res x n = res y n", " x n = y...
[ " (inducedMap A).snd x ∈ A (res (↑x) n)", " Injective (inducedMap A).snd" ]
import Mathlib.Algebra.Polynomial.Module.AEval #align_import data.polynomial.module from "leanprover-community/mathlib"@"63417e01fbc711beaf25fa73b6edb395c0cfddd0" universe u v open Polynomial BigOperators @[nolint unusedArguments] def PolynomialModule (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] := ℕ →₀ M #align polynomial_module PolynomialModule variable (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] (I : Ideal R) -- Porting note: stated instead of deriving noncomputable instance : Inhabited (PolynomialModule R M) := Finsupp.instInhabited noncomputable instance : AddCommGroup (PolynomialModule R M) := Finsupp.instAddCommGroup variable {M} variable {S : Type*} [CommSemiring S] [Algebra S R] [Module S M] [IsScalarTower S R M] namespace PolynomialModule @[nolint unusedArguments] noncomputable instance : Module S (PolynomialModule R M) := Finsupp.module ℕ M instance instFunLike : FunLike (PolynomialModule R M) ℕ M := Finsupp.instFunLike instance : CoeFun (PolynomialModule R M) fun _ => ℕ → M := Finsupp.instCoeFun theorem zero_apply (i : ℕ) : (0 : PolynomialModule R M) i = 0 := Finsupp.zero_apply theorem add_apply (g₁ g₂ : PolynomialModule R M) (a : ℕ) : (g₁ + g₂) a = g₁ a + g₂ a := Finsupp.add_apply g₁ g₂ a noncomputable def single (i : ℕ) : M →+ PolynomialModule R M := Finsupp.singleAddHom i #align polynomial_module.single PolynomialModule.single theorem single_apply (i : ℕ) (m : M) (n : ℕ) : single R i m n = ite (i = n) m 0 := Finsupp.single_apply #align polynomial_module.single_apply PolynomialModule.single_apply noncomputable def lsingle (i : ℕ) : M →ₗ[R] PolynomialModule R M := Finsupp.lsingle i #align polynomial_module.lsingle PolynomialModule.lsingle theorem lsingle_apply (i : ℕ) (m : M) (n : ℕ) : lsingle R i m n = ite (i = n) m 0 := Finsupp.single_apply #align polynomial_module.lsingle_apply PolynomialModule.lsingle_apply theorem single_smul (i : ℕ) (r : R) (m : M) : single R i (r • m) = r • single R i m := (lsingle R i).map_smul r m #align polynomial_module.single_smul PolynomialModule.single_smul variable {R} theorem induction_linear {P : PolynomialModule R M → Prop} (f : PolynomialModule R M) (h0 : P 0) (hadd : ∀ f g, P f → P g → P (f + g)) (hsingle : ∀ a b, P (single R a b)) : P f := Finsupp.induction_linear f h0 hadd hsingle #align polynomial_module.induction_linear PolynomialModule.induction_linear noncomputable instance polynomialModule : Module R[X] (PolynomialModule R M) := inferInstanceAs (Module R[X] (Module.AEval' (Finsupp.lmapDomain M R Nat.succ))) #align polynomial_module.polynomial_module PolynomialModule.polynomialModule lemma smul_def (f : R[X]) (m : PolynomialModule R M) : f • m = aeval (Finsupp.lmapDomain M R Nat.succ) f m := by rfl instance (M : Type u) [AddCommGroup M] [Module R M] [Module S M] [IsScalarTower S R M] : IsScalarTower S R (PolynomialModule R M) := Finsupp.isScalarTower _ _ instance isScalarTower' (M : Type u) [AddCommGroup M] [Module R M] [Module S M] [IsScalarTower S R M] : IsScalarTower S R[X] (PolynomialModule R M) := by haveI : IsScalarTower R R[X] (PolynomialModule R M) := inferInstanceAs <| IsScalarTower R R[X] <| Module.AEval' <| Finsupp.lmapDomain M R Nat.succ constructor intro x y z rw [← @IsScalarTower.algebraMap_smul S R, ← @IsScalarTower.algebraMap_smul S R, smul_assoc] #align polynomial_module.is_scalar_tower' PolynomialModule.isScalarTower' @[simp] theorem monomial_smul_single (i : ℕ) (r : R) (j : ℕ) (m : M) : monomial i r • single R j m = single R (i + j) (r • m) := by simp only [LinearMap.mul_apply, Polynomial.aeval_monomial, LinearMap.pow_apply, Module.algebraMap_end_apply, smul_def] induction i generalizing r j m with | zero => rw [Function.iterate_zero, zero_add] exact Finsupp.smul_single r j m | succ n hn => rw [Function.iterate_succ, Function.comp_apply, add_assoc, ← hn] congr 2 rw [Nat.one_add] exact Finsupp.mapDomain_single #align polynomial_module.monomial_smul_single PolynomialModule.monomial_smul_single @[simp]
Mathlib/Algebra/Polynomial/Module/Basic.lean
139
153
theorem monomial_smul_apply (i : ℕ) (r : R) (g : PolynomialModule R M) (n : ℕ) : (monomial i r • g) n = ite (i ≤ n) (r • g (n - i)) 0 := by
induction' g using PolynomialModule.induction_linear with p q hp hq · simp only [smul_zero, zero_apply, ite_self] · simp only [smul_add, add_apply, hp, hq] split_ifs exacts [rfl, zero_add 0] · rw [monomial_smul_single, single_apply, single_apply, smul_ite, smul_zero, ← ite_and] congr rw [eq_iff_iff] constructor · rintro rfl simp · rintro ⟨e, rfl⟩ rw [add_comm, tsub_add_cancel_of_le e]
[ " f • m = ((aeval (Finsupp.lmapDomain M R Nat.succ)) f) m", " IsScalarTower S R[X] (PolynomialModule R M)", " ∀ (x : S) (y : R[X]) (z : PolynomialModule R M), (x • y) • z = x • y • z", " (x • y) • z = x • y • z", " (monomial i) r • (single R j) m = (single R (i + j)) (r • m)", " r • (⇑(Finsupp.lmapDomain ...
[ " f • m = ((aeval (Finsupp.lmapDomain M R Nat.succ)) f) m", " IsScalarTower S R[X] (PolynomialModule R M)", " ∀ (x : S) (y : R[X]) (z : PolynomialModule R M), (x • y) • z = x • y • z", " (x • y) • z = x • y • z", " (monomial i) r • (single R j) m = (single R (i + j)) (r • m)", " r • (⇑(Finsupp.lmapDomain ...
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {σ τ : Type*} {r : R} {e : ℕ} {n m : σ} {s : σ →₀ ℕ} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial σ R} section Vars def vars (p : MvPolynomial σ R) : Finset σ := letI := Classical.decEq σ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq σ] (p : MvPolynomial σ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial σ R).vars = ∅ := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r ≠ 0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial σ R).vars = ∅ := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial σ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' ℕ)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : σ) : i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial σ R} {x : σ →₀ ℕ} (H : x ∈ f.support) {v : σ} (h : v ∉ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq σ] (p q : MvPolynomial σ R) : (p + q).vars ⊆ p.vars ∪ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊢ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq σ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars ∪ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊢ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq σ] (φ ψ : MvPolynomial σ R) : (φ * ψ).vars ⊆ φ.vars ∪ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul φ ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial σ R).vars = ∅ := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (φ : MvPolynomial σ R) (n : ℕ) : (φ ^ n).vars ⊆ φ.vars := by classical induction' n with n ih · simp · rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ι : Type*} [DecidableEq σ] {s : Finset ι} (f : ι → MvPolynomial σ R) : (∏ i ∈ s, f i).vars ⊆ s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Map variable [CommSemiring S] (f : R →+* S) variable (p) theorem vars_map : (map f p).vars ⊆ p.vars := by classical simp [vars_def, degrees_map] #align mv_polynomial.vars_map MvPolynomial.vars_map variable {f} theorem vars_map_of_injective (hf : Injective f) : (map f p).vars = p.vars := by simp [vars, degrees_map_of_injective _ hf] #align mv_polynomial.vars_map_of_injective MvPolynomial.vars_map_of_injective
Mathlib/Algebra/MvPolynomial/Variables.lean
226
228
theorem vars_monomial_single (i : σ) {e : ℕ} {r : R} (he : e ≠ 0) (hr : r ≠ 0) : (monomial (Finsupp.single i e) r).vars = {i} := by
rw [vars_monomial hr, Finsupp.support_single_ne_zero _ he]
[ " p.vars = p.degrees.toFinset", " p.degrees.toFinset = p.degrees.toFinset", " vars 0 = ∅", " ((monomial s) r).vars = s.support", " (C r).vars = ∅", " (X n).vars = {n}", " i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support", " x v = 0", " v ∈ f.vars", " (p + q).vars ⊆ p.vars ∪ q.vars", " x ∈ p.vars ∪ q....
[ " p.vars = p.degrees.toFinset", " p.degrees.toFinset = p.degrees.toFinset", " vars 0 = ∅", " ((monomial s) r).vars = s.support", " (C r).vars = ∅", " (X n).vars = {n}", " i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support", " x v = 0", " v ∈ f.vars", " (p + q).vars ⊆ p.vars ∪ q.vars", " x ∈ p.vars ∪ q....
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {α Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] {γ γ₁ γ₂ : Γ₀} {l : Filter α} {f : α → Γ₀} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Γ₀ := nhdsAdjoint 0 <| ⨅ γ ≠ 0, 𝓟 (Iio γ) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace theorem nhds_eq_update : (𝓝 : Γ₀ → Filter Γ₀) = update pure 0 (⨅ γ ≠ 0, 𝓟 (Iio γ)) := by rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInf₂ fun γ hγ ↦ le_principal_iff.2 <| zero_lt_iff.2 hγ #align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update theorem nhds_zero : 𝓝 (0 : Γ₀) = ⨅ γ ≠ 0, 𝓟 (Iio γ) := by rw [nhds_eq_update, update_same] #align with_zero_topology.nhds_zero WithZeroTopology.nhds_zero theorem hasBasis_nhds_zero : (𝓝 (0 : Γ₀)).HasBasis (fun γ : Γ₀ => γ ≠ 0) Iio := by rw [nhds_zero] refine hasBasis_biInf_principal ?_ ⟨1, one_ne_zero⟩ exact directedOn_iff_directed.2 (Monotone.directed_ge fun a b hab => Iio_subset_Iio hab) #align with_zero_topology.has_basis_nhds_zero WithZeroTopology.hasBasis_nhds_zero theorem Iio_mem_nhds_zero (hγ : γ ≠ 0) : Iio γ ∈ 𝓝 (0 : Γ₀) := hasBasis_nhds_zero.mem_of_mem hγ #align with_zero_topology.Iio_mem_nhds_zero WithZeroTopology.Iio_mem_nhds_zero theorem nhds_zero_of_units (γ : Γ₀ˣ) : Iio ↑γ ∈ 𝓝 (0 : Γ₀) := Iio_mem_nhds_zero γ.ne_zero #align with_zero_topology.nhds_zero_of_units WithZeroTopology.nhds_zero_of_units theorem tendsto_zero : Tendsto f l (𝓝 (0 : Γ₀)) ↔ ∀ (γ₀) (_ : γ₀ ≠ 0), ∀ᶠ x in l, f x < γ₀ := by simp [nhds_zero] #align with_zero_topology.tendsto_zero WithZeroTopology.tendsto_zero @[simp] theorem nhds_of_ne_zero {γ : Γ₀} (h₀ : γ ≠ 0) : 𝓝 γ = pure γ := nhds_nhdsAdjoint_of_ne _ h₀ #align with_zero_topology.nhds_of_ne_zero WithZeroTopology.nhds_of_ne_zero theorem nhds_coe_units (γ : Γ₀ˣ) : 𝓝 (γ : Γ₀) = pure (γ : Γ₀) := nhds_of_ne_zero γ.ne_zero #align with_zero_topology.nhds_coe_units WithZeroTopology.nhds_coe_units theorem singleton_mem_nhds_of_units (γ : Γ₀ˣ) : ({↑γ} : Set Γ₀) ∈ 𝓝 (γ : Γ₀) := by simp #align with_zero_topology.singleton_mem_nhds_of_units WithZeroTopology.singleton_mem_nhds_of_units theorem singleton_mem_nhds_of_ne_zero (h : γ ≠ 0) : ({γ} : Set Γ₀) ∈ 𝓝 (γ : Γ₀) := by simp [h] #align with_zero_topology.singleton_mem_nhds_of_ne_zero WithZeroTopology.singleton_mem_nhds_of_ne_zero theorem hasBasis_nhds_of_ne_zero {x : Γ₀} (h : x ≠ 0) : HasBasis (𝓝 x) (fun _ : Unit => True) fun _ => {x} := by rw [nhds_of_ne_zero h] exact hasBasis_pure _ #align with_zero_topology.has_basis_nhds_of_ne_zero WithZeroTopology.hasBasis_nhds_of_ne_zero theorem hasBasis_nhds_units (γ : Γ₀ˣ) : HasBasis (𝓝 (γ : Γ₀)) (fun _ : Unit => True) fun _ => {↑γ} := hasBasis_nhds_of_ne_zero γ.ne_zero #align with_zero_topology.has_basis_nhds_units WithZeroTopology.hasBasis_nhds_units theorem tendsto_of_ne_zero {γ : Γ₀} (h : γ ≠ 0) : Tendsto f l (𝓝 γ) ↔ ∀ᶠ x in l, f x = γ := by rw [nhds_of_ne_zero h, tendsto_pure] #align with_zero_topology.tendsto_of_ne_zero WithZeroTopology.tendsto_of_ne_zero theorem tendsto_units {γ₀ : Γ₀ˣ} : Tendsto f l (𝓝 (γ₀ : Γ₀)) ↔ ∀ᶠ x in l, f x = γ₀ := tendsto_of_ne_zero γ₀.ne_zero #align with_zero_topology.tendsto_units WithZeroTopology.tendsto_units
Mathlib/Topology/Algebra/WithZeroTopology.lean
128
129
theorem Iio_mem_nhds (h : γ₁ < γ₂) : Iio γ₂ ∈ 𝓝 γ₁ := by
rcases eq_or_ne γ₁ 0 with (rfl | h₀) <;> simp [*, h.ne', Iio_mem_nhds_zero]
[ " 𝓝 = update pure 0 (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ))", " pure 0 ≤ ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)", " 𝓝 0 = ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)", " (𝓝 0).HasBasis (fun γ => γ ≠ 0) Iio", " (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)).HasBasis (fun γ => γ ≠ 0) Iio", " DirectedOn ((fun γ => Iio γ) ⁻¹'o fun x x_1 => x ≥ x_1...
[ " 𝓝 = update pure 0 (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ))", " pure 0 ≤ ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)", " 𝓝 0 = ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)", " (𝓝 0).HasBasis (fun γ => γ ≠ 0) Iio", " (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)).HasBasis (fun γ => γ ≠ 0) Iio", " DirectedOn ((fun γ => Iio γ) ⁻¹'o fun x x_1 => x ≥ x_1...
import Mathlib.Combinatorics.Quiver.Basic import Mathlib.Combinatorics.Quiver.Path #align_import combinatorics.quiver.cast from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e" universe v v₁ v₂ u u₁ u₂ variable {U : Type*} [Quiver.{u + 1} U] namespace Quiver def Hom.cast {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟶ v) : u' ⟶ v' := Eq.ndrec (motive := (· ⟶ v')) (Eq.ndrec e hv) hu #align quiver.hom.cast Quiver.Hom.cast theorem Hom.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟶ v) : e.cast hu hv = _root_.cast (by {rw [hu, hv]}) e := by subst_vars rfl #align quiver.hom.cast_eq_cast Quiver.Hom.cast_eq_cast @[simp] theorem Hom.cast_rfl_rfl {u v : U} (e : u ⟶ v) : e.cast rfl rfl = e := rfl #align quiver.hom.cast_rfl_rfl Quiver.Hom.cast_rfl_rfl @[simp] theorem Hom.cast_cast {u v u' v' u'' v'' : U} (e : u ⟶ v) (hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') : (e.cast hu hv).cast hu' hv' = e.cast (hu.trans hu') (hv.trans hv') := by subst_vars rfl #align quiver.hom.cast_cast Quiver.Hom.cast_cast theorem Hom.cast_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟶ v) : HEq (e.cast hu hv) e := by subst_vars rfl #align quiver.hom.cast_heq Quiver.Hom.cast_heq theorem Hom.cast_eq_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟶ v) (e' : u' ⟶ v') : e.cast hu hv = e' ↔ HEq e e' := by rw [Hom.cast_eq_cast] exact _root_.cast_eq_iff_heq #align quiver.hom.cast_eq_iff_heq Quiver.Hom.cast_eq_iff_heq theorem Hom.eq_cast_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟶ v) (e' : u' ⟶ v') : e' = e.cast hu hv ↔ HEq e' e := by rw [eq_comm, Hom.cast_eq_iff_heq] exact ⟨HEq.symm, HEq.symm⟩ #align quiver.hom.eq_cast_iff_heq Quiver.Hom.eq_cast_iff_heq open Path def Path.cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) : Path u' v' := Eq.ndrec (motive := (Path · v')) (Eq.ndrec p hv) hu #align quiver.path.cast Quiver.Path.cast theorem Path.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) : p.cast hu hv = _root_.cast (by rw [hu, hv]) p := by subst_vars rfl #align quiver.path.cast_eq_cast Quiver.Path.cast_eq_cast @[simp] theorem Path.cast_rfl_rfl {u v : U} (p : Path u v) : p.cast rfl rfl = p := rfl #align quiver.path.cast_rfl_rfl Quiver.Path.cast_rfl_rfl @[simp] theorem Path.cast_cast {u v u' v' u'' v'' : U} (p : Path u v) (hu : u = u') (hv : v = v') (hu' : u' = u'') (hv' : v' = v'') : (p.cast hu hv).cast hu' hv' = p.cast (hu.trans hu') (hv.trans hv') := by subst_vars rfl #align quiver.path.cast_cast Quiver.Path.cast_cast @[simp] theorem Path.cast_nil {u u' : U} (hu : u = u') : (Path.nil : Path u u).cast hu hu = Path.nil := by subst_vars rfl #align quiver.path.cast_nil Quiver.Path.cast_nil theorem Path.cast_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) : HEq (p.cast hu hv) p := by rw [Path.cast_eq_cast] exact _root_.cast_heq _ _ #align quiver.path.cast_heq Quiver.Path.cast_heq
Mathlib/Combinatorics/Quiver/Cast.lean
118
121
theorem Path.cast_eq_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) (p' : Path u' v') : p.cast hu hv = p' ↔ HEq p p' := by
rw [Path.cast_eq_cast] exact _root_.cast_eq_iff_heq
[ " (u ⟶ v) = (u' ⟶ v')", " cast hu hv e = _root_.cast ⋯ e", " cast ⋯ ⋯ e = _root_.cast ⋯ e", " cast hu' hv' (cast hu hv e) = cast ⋯ ⋯ e", " cast ⋯ ⋯ (cast ⋯ ⋯ e) = cast ⋯ ⋯ e", " HEq (cast hu hv e) e", " HEq (cast ⋯ ⋯ e) e", " cast hu hv e = e' ↔ HEq e e'", " _root_.cast ⋯ e = e' ↔ HEq e e'", " e' ...
[ " (u ⟶ v) = (u' ⟶ v')", " cast hu hv e = _root_.cast ⋯ e", " cast ⋯ ⋯ e = _root_.cast ⋯ e", " cast hu' hv' (cast hu hv e) = cast ⋯ ⋯ e", " cast ⋯ ⋯ (cast ⋯ ⋯ e) = cast ⋯ ⋯ e", " HEq (cast hu hv e) e", " HEq (cast ⋯ ⋯ e) e", " cast hu hv e = e' ↔ HEq e e'", " _root_.cast ⋯ e = e' ↔ HEq e e'", " e' ...
import Mathlib.Order.CompleteLattice import Mathlib.Order.GaloisConnection import Mathlib.Data.Set.Lattice import Mathlib.Tactic.AdaptationNote #align_import data.rel from "leanprover-community/mathlib"@"706d88f2b8fdfeb0b22796433d7a6c1a010af9f2" variable {α β γ : Type*} def Rel (α β : Type*) := α → β → Prop -- deriving CompleteLattice, Inhabited #align rel Rel -- Porting note: `deriving` above doesn't work. instance : CompleteLattice (Rel α β) := show CompleteLattice (α → β → Prop) from inferInstance instance : Inhabited (Rel α β) := show Inhabited (α → β → Prop) from inferInstance namespace Rel variable (r : Rel α β) -- Porting note: required for later theorems. @[ext] theorem ext {r s : Rel α β} : (∀ a, r a = s a) → r = s := funext def inv : Rel β α := flip r #align rel.inv Rel.inv theorem inv_def (x : α) (y : β) : r.inv y x ↔ r x y := Iff.rfl #align rel.inv_def Rel.inv_def theorem inv_inv : inv (inv r) = r := by ext x y rfl #align rel.inv_inv Rel.inv_inv def dom := { x | ∃ y, r x y } #align rel.dom Rel.dom theorem dom_mono {r s : Rel α β} (h : r ≤ s) : dom r ⊆ dom s := fun a ⟨b, hx⟩ => ⟨b, h a b hx⟩ #align rel.dom_mono Rel.dom_mono def codom := { y | ∃ x, r x y } #align rel.codom Rel.codom theorem codom_inv : r.inv.codom = r.dom := by ext x rfl #align rel.codom_inv Rel.codom_inv
Mathlib/Data/Rel.lean
91
93
theorem dom_inv : r.inv.dom = r.codom := by
ext x rfl
[ " r.inv.inv = r", " r.inv.inv x y ↔ r x y", " r.inv.codom = r.dom", " x ∈ r.inv.codom ↔ x ∈ r.dom", " r.inv.dom = r.codom", " x ∈ r.inv.dom ↔ x ∈ r.codom" ]
[ " r.inv.inv = r", " r.inv.inv x y ↔ r x y", " r.inv.codom = r.dom", " x ∈ r.inv.codom ↔ x ∈ r.dom", " r.inv.dom = r.codom" ]
import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.MeasureTheory.Integral.Pi import Mathlib.Analysis.Fourier.FourierTransform open Real Set MeasureTheory Filter Asymptotics intervalIntegral open scoped Real Topology FourierTransform RealInnerProductSpace open Complex hiding exp continuous_exp abs_of_nonneg sq_abs noncomputable section namespace GaussianFourier variable {b : ℂ} def verticalIntegral (b : ℂ) (c T : ℝ) : ℂ := ∫ y : ℝ in (0 : ℝ)..c, I * (cexp (-b * (T + y * I) ^ 2) - cexp (-b * (T - y * I) ^ 2)) #align gaussian_fourier.vertical_integral GaussianFourier.verticalIntegral
Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean
51
55
theorem norm_cexp_neg_mul_sq_add_mul_I (b : ℂ) (c T : ℝ) : ‖cexp (-b * (T + c * I) ^ 2)‖ = exp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2)) := by
rw [Complex.norm_eq_abs, Complex.abs_exp, neg_mul, neg_re, ← re_add_im b] simp only [sq, re_add_im, mul_re, mul_im, add_re, add_im, ofReal_re, ofReal_im, I_re, I_im] ring_nf
[ " ‖cexp (-b * (↑T + ↑c * I) ^ 2)‖ = rexp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2))", " rexp (-((↑b.re + ↑b.im * I) * (↑T + ↑c * I) ^ 2).re) =\n rexp (-((↑b.re + ↑b.im * I).re * T ^ 2 - 2 * (↑b.re + ↑b.im * I).im * c * T - (↑b.re + ↑b.im * I).re * c ^ 2))", " rexp\n (-(b.re * ((T + (c * 0 - 0 *...
[ " ‖cexp (-b * (↑T + ↑c * I) ^ 2)‖ = rexp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2))" ]
import Mathlib.Algebra.Homology.Homotopy import Mathlib.AlgebraicTopology.DoldKan.Notations #align_import algebraic_topology.dold_kan.homotopies from "leanprover-community/mathlib"@"b12099d3b7febf4209824444dd836ef5ad96db55" open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive CategoryTheory.SimplicialObject Homotopy Opposite Simplicial DoldKan noncomputable section namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] variable {X : SimplicialObject C} abbrev c := ComplexShape.down ℕ #align algebraic_topology.dold_kan.c AlgebraicTopology.DoldKan.c theorem c_mk (i j : ℕ) (h : j + 1 = i) : c.Rel i j := ComplexShape.down_mk i j h #align algebraic_topology.dold_kan.c_mk AlgebraicTopology.DoldKan.c_mk theorem cs_down_0_not_rel_left (j : ℕ) : ¬c.Rel 0 j := by intro hj dsimp at hj apply Nat.not_succ_le_zero j rw [Nat.succ_eq_add_one, hj] #align algebraic_topology.dold_kan.cs_down_0_not_rel_left AlgebraicTopology.DoldKan.cs_down_0_not_rel_left def hσ (q : ℕ) (n : ℕ) : X _[n] ⟶ X _[n + 1] := if n < q then 0 else (-1 : ℤ) ^ (n - q) • X.σ ⟨n - q, Nat.lt_succ_of_le (Nat.sub_le _ _)⟩ #align algebraic_topology.dold_kan.hσ AlgebraicTopology.DoldKan.hσ def hσ' (q : ℕ) : ∀ n m, c.Rel m n → (K[X].X n ⟶ K[X].X m) := fun n m hnm => hσ q n ≫ eqToHom (by congr) #align algebraic_topology.dold_kan.hσ' AlgebraicTopology.DoldKan.hσ'
Mathlib/AlgebraicTopology/DoldKan/Homotopies.lean
104
108
theorem hσ'_eq_zero {q n m : ℕ} (hnq : n < q) (hnm : c.Rel m n) : (hσ' q n m hnm : X _[n] ⟶ X _[m]) = 0 := by
simp only [hσ', hσ] split_ifs exact zero_comp
[ " ¬c.Rel 0 j", " False", " j.succ ≤ 0", " X _[n + 1] = K[X].X m", " hσ' q n m hnm = 0", " (if n < q then 0 else (-1) ^ (n - q) • X.σ ⟨n - q, ⋯⟩) ≫ eqToHom ⋯ = 0", " 0 ≫ eqToHom ⋯ = 0" ]
[ " ¬c.Rel 0 j", " False", " j.succ ≤ 0", " X _[n + 1] = K[X].X m", " hσ' q n m hnm = 0" ]
import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor import Mathlib.CategoryTheory.Linear.Basic #align_import category_theory.linear.linear_functor from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3" namespace CategoryTheory variable (R : Type*) [Semiring R] class Functor.Linear {C D : Type*} [Category C] [Category D] [Preadditive C] [Preadditive D] [Linear R C] [Linear R D] (F : C ⥤ D) [F.Additive] : Prop where map_smul : ∀ {X Y : C} (f : X ⟶ Y) (r : R), F.map (r • f) = r • F.map f := by aesop_cat #align category_theory.functor.linear CategoryTheory.Functor.Linear section Linear namespace Functor section variable {R} variable {C D : Type*} [Category C] [Category D] [Preadditive C] [Preadditive D] [CategoryTheory.Linear R C] [CategoryTheory.Linear R D] (F : C ⥤ D) [Additive F] [Linear R F] @[simp] theorem map_smul {X Y : C} (r : R) (f : X ⟶ Y) : F.map (r • f) = r • F.map f := Functor.Linear.map_smul _ _ #align category_theory.functor.map_smul CategoryTheory.Functor.map_smul @[simp]
Mathlib/CategoryTheory/Linear/LinearFunctor.lean
53
54
theorem map_units_smul {X Y : C} (r : Rˣ) (f : X ⟶ Y) : F.map (r • f) = r • F.map f := by
apply map_smul
[ " F.map (r • f) = r • F.map f" ]
[ " F.map (r • f) = r • F.map f" ]
import Mathlib.Topology.EMetricSpace.Paracompact import Mathlib.Topology.Instances.ENNReal import Mathlib.Analysis.Convex.PartitionOfUnity #align_import topology.metric_space.partition_of_unity from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Topology ENNReal NNReal Filter Set Function TopologicalSpace variable {ι X : Type*} namespace EMetric variable [EMetricSpace X] {K : ι → Set X} {U : ι → Set X} theorem eventually_nhds_zero_forall_closedBall_subset (hK : ∀ i, IsClosed (K i)) (hU : ∀ i, IsOpen (U i)) (hKU : ∀ i, K i ⊆ U i) (hfin : LocallyFinite K) (x : X) : ∀ᶠ p : ℝ≥0∞ × X in 𝓝 0 ×ˢ 𝓝 x, ∀ i, p.2 ∈ K i → closedBall p.2 p.1 ⊆ U i := by suffices ∀ i, x ∈ K i → ∀ᶠ p : ℝ≥0∞ × X in 𝓝 0 ×ˢ 𝓝 x, closedBall p.2 p.1 ⊆ U i by apply mp_mem ((eventually_all_finite (hfin.point_finite x)).2 this) (mp_mem (@tendsto_snd ℝ≥0∞ _ (𝓝 0) _ _ (hfin.iInter_compl_mem_nhds hK x)) _) apply univ_mem' rintro ⟨r, y⟩ hxy hyU i hi simp only [mem_iInter, mem_compl_iff, not_imp_not, mem_preimage] at hxy exact hyU _ (hxy _ hi) intro i hi rcases nhds_basis_closed_eball.mem_iff.1 ((hU i).mem_nhds <| hKU i hi) with ⟨R, hR₀, hR⟩ rcases ENNReal.lt_iff_exists_nnreal_btwn.mp hR₀ with ⟨r, hr₀, hrR⟩ filter_upwards [prod_mem_prod (eventually_lt_nhds hr₀) (closedBall_mem_nhds x (tsub_pos_iff_lt.2 hrR))] with p hp z hz apply hR calc edist z x ≤ edist z p.2 + edist p.2 x := edist_triangle _ _ _ _ ≤ p.1 + (R - p.1) := add_le_add hz <| le_trans hp.2 <| tsub_le_tsub_left hp.1.out.le _ _ = R := add_tsub_cancel_of_le (lt_trans (by exact hp.1) hrR).le #align emetric.eventually_nhds_zero_forall_closed_ball_subset EMetric.eventually_nhds_zero_forall_closedBall_subset
Mathlib/Topology/MetricSpace/PartitionOfUnity.lean
64
72
theorem exists_forall_closedBall_subset_aux₁ (hK : ∀ i, IsClosed (K i)) (hU : ∀ i, IsOpen (U i)) (hKU : ∀ i, K i ⊆ U i) (hfin : LocallyFinite K) (x : X) : ∃ r : ℝ, ∀ᶠ y in 𝓝 x, r ∈ Ioi (0 : ℝ) ∩ ENNReal.ofReal ⁻¹' ⋂ (i) (_ : y ∈ K i), { r | closedBall y r ⊆ U i } := by
have := (ENNReal.continuous_ofReal.tendsto' 0 0 ENNReal.ofReal_zero).eventually (eventually_nhds_zero_forall_closedBall_subset hK hU hKU hfin x).curry rcases this.exists_gt with ⟨r, hr0, hr⟩ refine ⟨r, hr.mono fun y hy => ⟨hr0, ?_⟩⟩ rwa [mem_preimage, mem_iInter₂]
[ " ∀ᶠ (p : ℝ≥0∞ × X) in 𝓝 0 ×ˢ 𝓝 x, ∀ (i : ι), p.2 ∈ K i → closedBall p.2 p.1 ⊆ U i", " {x_1 |\n x_1 ∈ Prod.snd ⁻¹' ⋂ i, ⋂ (_ : x ∉ K i), (K i)ᶜ →\n x_1 ∈\n {x_2 |\n x_2 ∈ {x_3 | (fun x_4 => ∀ i ∈ {b | x ∈ K b}, closedBall x_4.2 x_4.1 ⊆ U i) x_3} →\n x_2 ∈ {x | (fun p...
[ " ∀ᶠ (p : ℝ≥0∞ × X) in 𝓝 0 ×ˢ 𝓝 x, ∀ (i : ι), p.2 ∈ K i → closedBall p.2 p.1 ⊆ U i", " {x_1 |\n x_1 ∈ Prod.snd ⁻¹' ⋂ i, ⋂ (_ : x ∉ K i), (K i)ᶜ →\n x_1 ∈\n {x_2 |\n x_2 ∈ {x_3 | (fun x_4 => ∀ i ∈ {b | x ∈ K b}, closedBall x_4.2 x_4.1 ⊆ U i) x_3} →\n x_2 ∈ {x | (fun p...
import Mathlib.Topology.Algebra.UniformConvergence #align_import topology.algebra.equicontinuity from "leanprover-community/mathlib"@"01ad394a11bf06b950232720cf7e8fc6b22f0d6a" open Function open UniformConvergence @[to_additive]
Mathlib/Topology/Algebra/Equicontinuity.lean
20
31
theorem equicontinuous_of_equicontinuousAt_one {ι G M hom : Type*} [TopologicalSpace G] [UniformSpace M] [Group G] [Group M] [TopologicalGroup G] [UniformGroup M] [FunLike hom G M] [MonoidHomClass hom G M] (F : ι → hom) (hf : EquicontinuousAt ((↑) ∘ F) (1 : G)) : Equicontinuous ((↑) ∘ F) := by
rw [equicontinuous_iff_continuous] rw [equicontinuousAt_iff_continuousAt] at hf let φ : G →* (ι →ᵤ M) := { toFun := swap ((↑) ∘ F) map_one' := by dsimp [UniformFun]; ext; exact map_one _ map_mul' := fun a b => by dsimp [UniformFun]; ext; exact map_mul _ _ _ } exact continuous_of_continuousAt_one φ hf
[ " Equicontinuous (DFunLike.coe ∘ F)", " Continuous (⇑UniformFun.ofFun ∘ swap (DFunLike.coe ∘ F))", " swap (DFunLike.coe ∘ F) 1 = 1", " swap (DFunLike.coe ∘ F) 1 x✝ = 1 x✝", " { toFun := swap (DFunLike.coe ∘ F), map_one' := ⋯ }.toFun (a * b) =\n { toFun := swap (DFunLike.coe ∘ F), map_one' := ⋯ }.toFun a ...
[ " Equicontinuous (DFunLike.coe ∘ F)" ]
import Mathlib.Analysis.Calculus.FDeriv.Basic #align_import analysis.calculus.fderiv.restrict_scalars from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section RestrictScalars variable (𝕜 : Type*) [NontriviallyNormedField 𝕜] variable {𝕜' : Type*} [NontriviallyNormedField 𝕜'] [NormedAlgebra 𝕜 𝕜'] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedSpace 𝕜' E] variable [IsScalarTower 𝕜 𝕜' E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [NormedSpace 𝕜' F] variable [IsScalarTower 𝕜 𝕜' F] variable {f : E → F} {f' : E →L[𝕜'] F} {s : Set E} {x : E} @[fun_prop] theorem HasStrictFDerivAt.restrictScalars (h : HasStrictFDerivAt f f' x) : HasStrictFDerivAt f (f'.restrictScalars 𝕜) x := h #align has_strict_fderiv_at.restrict_scalars HasStrictFDerivAt.restrictScalars theorem HasFDerivAtFilter.restrictScalars {L} (h : HasFDerivAtFilter f f' x L) : HasFDerivAtFilter f (f'.restrictScalars 𝕜) x L := .of_isLittleO h.1 #align has_fderiv_at_filter.restrict_scalars HasFDerivAtFilter.restrictScalars @[fun_prop] theorem HasFDerivAt.restrictScalars (h : HasFDerivAt f f' x) : HasFDerivAt f (f'.restrictScalars 𝕜) x := .of_isLittleO h.1 #align has_fderiv_at.restrict_scalars HasFDerivAt.restrictScalars @[fun_prop] theorem HasFDerivWithinAt.restrictScalars (h : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt f (f'.restrictScalars 𝕜) s x := .of_isLittleO h.1 #align has_fderiv_within_at.restrict_scalars HasFDerivWithinAt.restrictScalars @[fun_prop] theorem DifferentiableAt.restrictScalars (h : DifferentiableAt 𝕜' f x) : DifferentiableAt 𝕜 f x := (h.hasFDerivAt.restrictScalars 𝕜).differentiableAt #align differentiable_at.restrict_scalars DifferentiableAt.restrictScalars @[fun_prop] theorem DifferentiableWithinAt.restrictScalars (h : DifferentiableWithinAt 𝕜' f s x) : DifferentiableWithinAt 𝕜 f s x := (h.hasFDerivWithinAt.restrictScalars 𝕜).differentiableWithinAt #align differentiable_within_at.restrict_scalars DifferentiableWithinAt.restrictScalars @[fun_prop] theorem DifferentiableOn.restrictScalars (h : DifferentiableOn 𝕜' f s) : DifferentiableOn 𝕜 f s := fun x hx => (h x hx).restrictScalars 𝕜 #align differentiable_on.restrict_scalars DifferentiableOn.restrictScalars @[fun_prop] theorem Differentiable.restrictScalars (h : Differentiable 𝕜' f) : Differentiable 𝕜 f := fun x => (h x).restrictScalars 𝕜 #align differentiable.restrict_scalars Differentiable.restrictScalars @[fun_prop] theorem HasFDerivWithinAt.of_restrictScalars {g' : E →L[𝕜] F} (h : HasFDerivWithinAt f g' s x) (H : f'.restrictScalars 𝕜 = g') : HasFDerivWithinAt f f' s x := by rw [← H] at h exact .of_isLittleO h.1 #align has_fderiv_within_at_of_restrict_scalars HasFDerivWithinAt.of_restrictScalars @[fun_prop] theorem hasFDerivAt_of_restrictScalars {g' : E →L[𝕜] F} (h : HasFDerivAt f g' x) (H : f'.restrictScalars 𝕜 = g') : HasFDerivAt f f' x := by rw [← H] at h exact .of_isLittleO h.1 #align has_fderiv_at_of_restrict_scalars hasFDerivAt_of_restrictScalars theorem DifferentiableAt.fderiv_restrictScalars (h : DifferentiableAt 𝕜' f x) : fderiv 𝕜 f x = (fderiv 𝕜' f x).restrictScalars 𝕜 := (h.hasFDerivAt.restrictScalars 𝕜).fderiv #align differentiable_at.fderiv_restrict_scalars DifferentiableAt.fderiv_restrictScalars
Mathlib/Analysis/Calculus/FDeriv/RestrictScalars.lean
110
117
theorem differentiableWithinAt_iff_restrictScalars (hf : DifferentiableWithinAt 𝕜 f s x) (hs : UniqueDiffWithinAt 𝕜 s x) : DifferentiableWithinAt 𝕜' f s x ↔ ∃ g' : E →L[𝕜'] F, g'.restrictScalars 𝕜 = fderivWithin 𝕜 f s x := by
constructor · rintro ⟨g', hg'⟩ exact ⟨g', hs.eq (hg'.restrictScalars 𝕜) hf.hasFDerivWithinAt⟩ · rintro ⟨f', hf'⟩ exact ⟨f', hf.hasFDerivWithinAt.of_restrictScalars 𝕜 hf'⟩
[ " HasFDerivWithinAt f f' s x", " HasFDerivAt f f' x", " DifferentiableWithinAt 𝕜' f s x ↔ ∃ g', restrictScalars 𝕜 g' = fderivWithin 𝕜 f s x", " DifferentiableWithinAt 𝕜' f s x → ∃ g', restrictScalars 𝕜 g' = fderivWithin 𝕜 f s x", " ∃ g', restrictScalars 𝕜 g' = fderivWithin 𝕜 f s x", " (∃ g', restr...
[ " HasFDerivWithinAt f f' s x", " HasFDerivAt f f' x", " DifferentiableWithinAt 𝕜' f s x ↔ ∃ g', restrictScalars 𝕜 g' = fderivWithin 𝕜 f s x" ]
import Mathlib.Init.Data.Nat.Notation import Mathlib.Init.Order.Defs set_option autoImplicit true structure UFModel (n) where parent : Fin n → Fin n rank : Nat → Nat rank_lt : ∀ i, (parent i).1 ≠ i → rank i < rank (parent i) structure UFNode (α : Type*) where parent : Nat value : α rank : Nat inductive UFModel.Agrees (arr : Array α) (f : α → β) : ∀ {n}, (Fin n → β) → Prop | mk : Agrees arr f fun i ↦ f (arr.get i) namespace UFModel.Agrees
Mathlib/Data/UnionFind.lean
73
77
theorem mk' {arr : Array α} {f : α → β} {n} {g : Fin n → β} (e : n = arr.size) (H : ∀ i h₁ h₂, f (arr.get ⟨i, h₁⟩) = g ⟨i, h₂⟩) : Agrees arr f g := by
cases e have : (fun i ↦ f (arr.get i)) = g := by funext ⟨i, h⟩; apply H cases this; constructor
[ " Agrees arr f g", " (fun i => f (arr.get i)) = g", " f (arr.get ⟨i, h⟩) = g ⟨i, h⟩", " Agrees arr f fun i => f (arr.get i)" ]
[ " Agrees arr f g" ]
import Mathlib.AlgebraicGeometry.Restrict import Mathlib.CategoryTheory.Adjunction.Limits import Mathlib.CategoryTheory.Adjunction.Reflective #align_import algebraic_geometry.Gamma_Spec_adjunction from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" -- Explicit universe annotations were used in this file to improve perfomance #12737 set_option linter.uppercaseLean3 false noncomputable section universe u open PrimeSpectrum namespace AlgebraicGeometry open Opposite open CategoryTheory open StructureSheaf open Spec (structureSheaf) open TopologicalSpace open AlgebraicGeometry.LocallyRingedSpace open TopCat.Presheaf open TopCat.Presheaf.SheafCondition namespace LocallyRingedSpace variable (X : LocallyRingedSpace.{u}) def ΓToStalk (x : X) : Γ.obj (op X) ⟶ X.presheaf.stalk x := X.presheaf.germ (⟨x, trivial⟩ : (⊤ : Opens X)) #align algebraic_geometry.LocallyRingedSpace.Γ_to_stalk AlgebraicGeometry.LocallyRingedSpace.ΓToStalk def toΓSpecFun : X → PrimeSpectrum (Γ.obj (op X)) := fun x => comap (X.ΓToStalk x) (LocalRing.closedPoint (X.presheaf.stalk x)) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_fun AlgebraicGeometry.LocallyRingedSpace.toΓSpecFun theorem not_mem_prime_iff_unit_in_stalk (r : Γ.obj (op X)) (x : X) : r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit (X.ΓToStalk x r) := by erw [LocalRing.mem_maximalIdeal, Classical.not_not] #align algebraic_geometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk AlgebraicGeometry.LocallyRingedSpace.not_mem_prime_iff_unit_in_stalk theorem toΓSpec_preim_basicOpen_eq (r : Γ.obj (op X)) : X.toΓSpecFun ⁻¹' (basicOpen r).1 = (X.toRingedSpace.basicOpen r).1 := by ext erw [X.toRingedSpace.mem_top_basicOpen]; apply not_mem_prime_iff_unit_in_stalk #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_preim_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpec_preim_basicOpen_eq theorem toΓSpec_continuous : Continuous X.toΓSpecFun := by rw [isTopologicalBasis_basic_opens.continuous_iff] rintro _ ⟨r, rfl⟩ erw [X.toΓSpec_preim_basicOpen_eq r] exact (X.toRingedSpace.basicOpen r).2 #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_continuous AlgebraicGeometry.LocallyRingedSpace.toΓSpec_continuous @[simps] def toΓSpecBase : X.toTopCat ⟶ Spec.topObj (Γ.obj (op X)) where toFun := X.toΓSpecFun continuous_toFun := X.toΓSpec_continuous #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_base AlgebraicGeometry.LocallyRingedSpace.toΓSpecBase -- These lemmas have always been bad (#7657), but lean4#2644 made `simp` start noticing attribute [nolint simpNF] AlgebraicGeometry.LocallyRingedSpace.toΓSpecBase_apply variable (r : Γ.obj (op X)) abbrev toΓSpecMapBasicOpen : Opens X := (Opens.map X.toΓSpecBase).obj (basicOpen r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.toΓSpecMapBasicOpen theorem toΓSpecMapBasicOpen_eq : X.toΓSpecMapBasicOpen r = X.toRingedSpace.basicOpen r := Opens.ext (X.toΓSpec_preim_basicOpen_eq r) #align algebraic_geometry.LocallyRingedSpace.to_Γ_Spec_map_basic_open_eq AlgebraicGeometry.LocallyRingedSpace.toΓSpecMapBasicOpen_eq abbrev toToΓSpecMapBasicOpen : X.presheaf.obj (op ⊤) ⟶ X.presheaf.obj (op <| X.toΓSpecMapBasicOpen r) := X.presheaf.map (X.toΓSpecMapBasicOpen r).leTop.op #align algebraic_geometry.LocallyRingedSpace.to_to_Γ_Spec_map_basic_open AlgebraicGeometry.LocallyRingedSpace.toToΓSpecMapBasicOpen
Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean
128
134
theorem isUnit_res_toΓSpecMapBasicOpen : IsUnit (X.toToΓSpecMapBasicOpen r r) := by
convert (X.presheaf.map <| (eqToHom <| X.toΓSpecMapBasicOpen_eq r).op).isUnit_map (X.toRingedSpace.isUnit_res_basicOpen r) -- Porting note: `rw [comp_apply]` to `erw [comp_apply]` erw [← comp_apply, ← Functor.map_comp] congr
[ " r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit ((X.ΓToStalk x) r)", " X.toΓSpecFun ⁻¹' (basicOpen r).carrier = (X.toRingedSpace.basicOpen r).carrier", " x✝ ∈ X.toΓSpecFun ⁻¹' (basicOpen r).carrier ↔ x✝ ∈ (X.toRingedSpace.basicOpen r).carrier", " x✝ ∈ X.toΓSpecFun ⁻¹' (basicOpen r).carrier ↔ IsUnit ((X.toRingedSpace....
[ " r ∉ (X.toΓSpecFun x).asIdeal ↔ IsUnit ((X.ΓToStalk x) r)", " X.toΓSpecFun ⁻¹' (basicOpen r).carrier = (X.toRingedSpace.basicOpen r).carrier", " x✝ ∈ X.toΓSpecFun ⁻¹' (basicOpen r).carrier ↔ x✝ ∈ (X.toRingedSpace.basicOpen r).carrier", " x✝ ∈ X.toΓSpecFun ⁻¹' (basicOpen r).carrier ↔ IsUnit ((X.toRingedSpace....
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[≠] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : ‖x‖⁻¹ • x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≤ t) (x : E) : ‖t • x‖ = t * ‖x‖ := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r • x + (1 - r) • y) x ≤ dist y x := calc dist (r • x + (1 - r) • y) x = ‖1 - r‖ * ‖x - y‖ := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≤ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul] theorem closure_ball (x : E) {r : ℝ} (hr : r ≠ 0) : closure (ball x r) = closedBall x r := by refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c • (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ · rw [one_smul, sub_add_cancel] · simp [closure_Ico zero_ne_one, zero_le_one] · rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption #align closure_ball closure_ball theorem frontier_ball (x : E) {r : ℝ} (hr : r ≠ 0) : frontier (ball x r) = sphere x r := by rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball] #align frontier_ball frontier_ball theorem interior_closedBall (x : E) {r : ℝ} (hr : r ≠ 0) : interior (closedBall x r) = ball x r := by cases' hr.lt_or_lt with hr hr · rw [closedBall_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty] refine Subset.antisymm ?_ ball_subset_interior_closedBall intro y hy rcases (mem_closedBall.1 <| interior_subset hy).lt_or_eq with (hr | rfl) · exact hr set f : ℝ → E := fun c : ℝ => c • (y - x) + x suffices f ⁻¹' closedBall x (dist y x) ⊆ Icc (-1) 1 by have hfc : Continuous f := (continuous_id.smul continuous_const).add continuous_const have hf1 : (1 : ℝ) ∈ f ⁻¹' interior (closedBall x <| dist y x) := by simpa [f] have h1 : (1 : ℝ) ∈ interior (Icc (-1 : ℝ) 1) := interior_mono this (preimage_interior_subset_interior_preimage hfc hf1) simp at h1 intro c hc rw [mem_Icc, ← abs_le, ← Real.norm_eq_abs, ← mul_le_mul_right hr] simpa [f, dist_eq_norm, norm_smul] using hc #align interior_closed_ball interior_closedBall
Mathlib/Analysis/NormedSpace/Real.lean
101
103
theorem frontier_closedBall (x : E) {r : ℝ} (hr : r ≠ 0) : frontier (closedBall x r) = sphere x r := by
rw [frontier, closure_closedBall, interior_closedBall x hr, closedBall_diff_ball]
[ " ‖x‖⁻¹ • x ∈ closedBall 0 1", " ‖t • x‖ = t * ‖x‖", " dist (r • x + (1 - r) • y) x = ‖1 - r‖ * ‖x - y‖", " ‖1 - r‖ * ‖x - y‖ = (1 - r) * dist y x", " (1 - r) * dist y x ≤ (1 - 0) * dist y x", " 0 ≤ r", " (1 - 0) * dist y x = dist y x", " closure (ball x r) = closedBall x r", " y ∈ closure (ball x r...
[ " ‖x‖⁻¹ • x ∈ closedBall 0 1", " ‖t • x‖ = t * ‖x‖", " dist (r • x + (1 - r) • y) x = ‖1 - r‖ * ‖x - y‖", " ‖1 - r‖ * ‖x - y‖ = (1 - r) * dist y x", " (1 - r) * dist y x ≤ (1 - 0) * dist y x", " 0 ≤ r", " (1 - 0) * dist y x = dist y x", " closure (ball x r) = closedBall x r", " y ∈ closure (ball x r...
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Combinatorics.SimpleGraph.Maps #align_import combinatorics.simple_graph.subgraph from "leanprover-community/mathlib"@"c6ef6387ede9983aee397d442974e61f89dfd87b" universe u v namespace SimpleGraph @[ext] structure Subgraph {V : Type u} (G : SimpleGraph V) where verts : Set V Adj : V → V → Prop adj_sub : ∀ {v w : V}, Adj v w → G.Adj v w edge_vert : ∀ {v w : V}, Adj v w → v ∈ verts symm : Symmetric Adj := by aesop_graph -- Porting note: Originally `by obviously` #align simple_graph.subgraph SimpleGraph.Subgraph initialize_simps_projections SimpleGraph.Subgraph (Adj → adj) variable {ι : Sort*} {V : Type u} {W : Type v} @[simps] protected def singletonSubgraph (G : SimpleGraph V) (v : V) : G.Subgraph where verts := {v} Adj := ⊥ adj_sub := False.elim edge_vert := False.elim symm _ _ := False.elim #align simple_graph.singleton_subgraph SimpleGraph.singletonSubgraph @[simps] def subgraphOfAdj (G : SimpleGraph V) {v w : V} (hvw : G.Adj v w) : G.Subgraph where verts := {v, w} Adj a b := s(v, w) = s(a, b) adj_sub h := by rw [← G.mem_edgeSet, ← h] exact hvw edge_vert {a b} h := by apply_fun fun e ↦ a ∈ e at h simp only [Sym2.mem_iff, true_or, eq_iff_iff, iff_true] at h exact h #align simple_graph.subgraph_of_adj SimpleGraph.subgraphOfAdj namespace Subgraph variable {G : SimpleGraph V} {G₁ G₂ : G.Subgraph} {a b : V} protected theorem loopless (G' : Subgraph G) : Irreflexive G'.Adj := fun v h ↦ G.loopless v (G'.adj_sub h) #align simple_graph.subgraph.loopless SimpleGraph.Subgraph.loopless theorem adj_comm (G' : Subgraph G) (v w : V) : G'.Adj v w ↔ G'.Adj w v := ⟨fun x ↦ G'.symm x, fun x ↦ G'.symm x⟩ #align simple_graph.subgraph.adj_comm SimpleGraph.Subgraph.adj_comm @[symm] theorem adj_symm (G' : Subgraph G) {u v : V} (h : G'.Adj u v) : G'.Adj v u := G'.symm h #align simple_graph.subgraph.adj_symm SimpleGraph.Subgraph.adj_symm protected theorem Adj.symm {G' : Subgraph G} {u v : V} (h : G'.Adj u v) : G'.Adj v u := G'.symm h #align simple_graph.subgraph.adj.symm SimpleGraph.Subgraph.Adj.symm protected theorem Adj.adj_sub {H : G.Subgraph} {u v : V} (h : H.Adj u v) : G.Adj u v := H.adj_sub h #align simple_graph.subgraph.adj.adj_sub SimpleGraph.Subgraph.Adj.adj_sub protected theorem Adj.fst_mem {H : G.Subgraph} {u v : V} (h : H.Adj u v) : u ∈ H.verts := H.edge_vert h #align simple_graph.subgraph.adj.fst_mem SimpleGraph.Subgraph.Adj.fst_mem protected theorem Adj.snd_mem {H : G.Subgraph} {u v : V} (h : H.Adj u v) : v ∈ H.verts := h.symm.fst_mem #align simple_graph.subgraph.adj.snd_mem SimpleGraph.Subgraph.Adj.snd_mem protected theorem Adj.ne {H : G.Subgraph} {u v : V} (h : H.Adj u v) : u ≠ v := h.adj_sub.ne #align simple_graph.subgraph.adj.ne SimpleGraph.Subgraph.Adj.ne @[simps] protected def coe (G' : Subgraph G) : SimpleGraph G'.verts where Adj v w := G'.Adj v w symm _ _ h := G'.symm h loopless v h := loopless G v (G'.adj_sub h) #align simple_graph.subgraph.coe SimpleGraph.Subgraph.coe @[simp] theorem coe_adj_sub (G' : Subgraph G) (u v : G'.verts) (h : G'.coe.Adj u v) : G.Adj u v := G'.adj_sub h #align simple_graph.subgraph.coe_adj_sub SimpleGraph.Subgraph.coe_adj_sub -- Given `h : H.Adj u v`, then `h.coe : H.coe.Adj ⟨u, _⟩ ⟨v, _⟩`. protected theorem Adj.coe {H : G.Subgraph} {u v : V} (h : H.Adj u v) : H.coe.Adj ⟨u, H.edge_vert h⟩ ⟨v, H.edge_vert h.symm⟩ := h #align simple_graph.subgraph.adj.coe SimpleGraph.Subgraph.Adj.coe def IsSpanning (G' : Subgraph G) : Prop := ∀ v : V, v ∈ G'.verts #align simple_graph.subgraph.is_spanning SimpleGraph.Subgraph.IsSpanning theorem isSpanning_iff {G' : Subgraph G} : G'.IsSpanning ↔ G'.verts = Set.univ := Set.eq_univ_iff_forall.symm #align simple_graph.subgraph.is_spanning_iff SimpleGraph.Subgraph.isSpanning_iff @[simps] protected def spanningCoe (G' : Subgraph G) : SimpleGraph V where Adj := G'.Adj symm := G'.symm loopless v hv := G.loopless v (G'.adj_sub hv) #align simple_graph.subgraph.spanning_coe SimpleGraph.Subgraph.spanningCoe @[simp] theorem Adj.of_spanningCoe {G' : Subgraph G} {u v : G'.verts} (h : G'.spanningCoe.Adj u v) : G.Adj u v := G'.adj_sub h #align simple_graph.subgraph.adj.of_spanning_coe SimpleGraph.Subgraph.Adj.of_spanningCoe
Mathlib/Combinatorics/SimpleGraph/Subgraph.lean
177
178
theorem spanningCoe_inj : G₁.spanningCoe = G₂.spanningCoe ↔ G₁.Adj = G₂.Adj := by
simp [Subgraph.spanningCoe]
[ " G.Adj v✝ w✝", " s(v, w) ∈ G.edgeSet", " a ∈ {v, w}", " G₁.spanningCoe = G₂.spanningCoe ↔ G₁.Adj = G₂.Adj" ]
[ " G.Adj v✝ w✝", " s(v, w) ∈ G.edgeSet", " a ∈ {v, w}", " G₁.spanningCoe = G₂.spanningCoe ↔ G₁.Adj = G₂.Adj" ]
import Mathlib.Data.Finset.Lattice #align_import combinatorics.set_family.compression.down from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" variable {α : Type*} [DecidableEq α] {𝒜 ℬ : Finset (Finset α)} {s : Finset α} {a : α} namespace Finset def nonMemberSubfamily (a : α) (𝒜 : Finset (Finset α)) : Finset (Finset α) := 𝒜.filter fun s => a ∉ s #align finset.non_member_subfamily Finset.nonMemberSubfamily def memberSubfamily (a : α) (𝒜 : Finset (Finset α)) : Finset (Finset α) := (𝒜.filter fun s => a ∈ s).image fun s => erase s a #align finset.member_subfamily Finset.memberSubfamily @[simp] theorem mem_nonMemberSubfamily : s ∈ 𝒜.nonMemberSubfamily a ↔ s ∈ 𝒜 ∧ a ∉ s := by simp [nonMemberSubfamily] #align finset.mem_non_member_subfamily Finset.mem_nonMemberSubfamily @[simp] theorem mem_memberSubfamily : s ∈ 𝒜.memberSubfamily a ↔ insert a s ∈ 𝒜 ∧ a ∉ s := by simp_rw [memberSubfamily, mem_image, mem_filter] refine ⟨?_, fun h => ⟨insert a s, ⟨h.1, by simp⟩, erase_insert h.2⟩⟩ rintro ⟨s, ⟨hs1, hs2⟩, rfl⟩ rw [insert_erase hs2] exact ⟨hs1, not_mem_erase _ _⟩ #align finset.mem_member_subfamily Finset.mem_memberSubfamily theorem nonMemberSubfamily_inter (a : α) (𝒜 ℬ : Finset (Finset α)) : (𝒜 ∩ ℬ).nonMemberSubfamily a = 𝒜.nonMemberSubfamily a ∩ ℬ.nonMemberSubfamily a := filter_inter_distrib _ _ _ #align finset.non_member_subfamily_inter Finset.nonMemberSubfamily_inter theorem memberSubfamily_inter (a : α) (𝒜 ℬ : Finset (Finset α)) : (𝒜 ∩ ℬ).memberSubfamily a = 𝒜.memberSubfamily a ∩ ℬ.memberSubfamily a := by unfold memberSubfamily rw [filter_inter_distrib, image_inter_of_injOn _ _ ((erase_injOn' _).mono _)] simp #align finset.member_subfamily_inter Finset.memberSubfamily_inter theorem nonMemberSubfamily_union (a : α) (𝒜 ℬ : Finset (Finset α)) : (𝒜 ∪ ℬ).nonMemberSubfamily a = 𝒜.nonMemberSubfamily a ∪ ℬ.nonMemberSubfamily a := filter_union _ _ _ #align finset.non_member_subfamily_union Finset.nonMemberSubfamily_union theorem memberSubfamily_union (a : α) (𝒜 ℬ : Finset (Finset α)) : (𝒜 ∪ ℬ).memberSubfamily a = 𝒜.memberSubfamily a ∪ ℬ.memberSubfamily a := by simp_rw [memberSubfamily, filter_union, image_union] #align finset.member_subfamily_union Finset.memberSubfamily_union theorem card_memberSubfamily_add_card_nonMemberSubfamily (a : α) (𝒜 : Finset (Finset α)) : (𝒜.memberSubfamily a).card + (𝒜.nonMemberSubfamily a).card = 𝒜.card := by rw [memberSubfamily, nonMemberSubfamily, card_image_of_injOn] · conv_rhs => rw [← filter_card_add_filter_neg_card_eq_card (fun s => (a ∈ s))] · apply (erase_injOn' _).mono simp #align finset.card_member_subfamily_add_card_non_member_subfamily Finset.card_memberSubfamily_add_card_nonMemberSubfamily theorem memberSubfamily_union_nonMemberSubfamily (a : α) (𝒜 : Finset (Finset α)) : 𝒜.memberSubfamily a ∪ 𝒜.nonMemberSubfamily a = 𝒜.image fun s => s.erase a := by ext s simp only [mem_union, mem_memberSubfamily, mem_nonMemberSubfamily, mem_image, exists_prop] constructor · rintro (h | h) · exact ⟨_, h.1, erase_insert h.2⟩ · exact ⟨_, h.1, erase_eq_of_not_mem h.2⟩ · rintro ⟨s, hs, rfl⟩ by_cases ha : a ∈ s · exact Or.inl ⟨by rwa [insert_erase ha], not_mem_erase _ _⟩ · exact Or.inr ⟨by rwa [erase_eq_of_not_mem ha], not_mem_erase _ _⟩ #align finset.member_subfamily_union_non_member_subfamily Finset.memberSubfamily_union_nonMemberSubfamily @[simp] theorem memberSubfamily_memberSubfamily : (𝒜.memberSubfamily a).memberSubfamily a = ∅ := by ext simp #align finset.member_subfamily_member_subfamily Finset.memberSubfamily_memberSubfamily @[simp] theorem memberSubfamily_nonMemberSubfamily : (𝒜.nonMemberSubfamily a).memberSubfamily a = ∅ := by ext simp #align finset.member_subfamily_non_member_subfamily Finset.memberSubfamily_nonMemberSubfamily @[simp] theorem nonMemberSubfamily_memberSubfamily : (𝒜.memberSubfamily a).nonMemberSubfamily a = 𝒜.memberSubfamily a := by ext simp #align finset.non_member_subfamily_member_subfamily Finset.nonMemberSubfamily_memberSubfamily @[simp]
Mathlib/Combinatorics/SetFamily/Compression/Down.lean
133
136
theorem nonMemberSubfamily_nonMemberSubfamily : (𝒜.nonMemberSubfamily a).nonMemberSubfamily a = 𝒜.nonMemberSubfamily a := by
ext simp
[ " s ∈ nonMemberSubfamily a 𝒜 ↔ s ∈ 𝒜 ∧ a ∉ s", " s ∈ memberSubfamily a 𝒜 ↔ insert a s ∈ 𝒜 ∧ a ∉ s", " (∃ a_1, (a_1 ∈ 𝒜 ∧ a ∈ a_1) ∧ a_1.erase a = s) ↔ insert a s ∈ 𝒜 ∧ a ∉ s", " a ∈ insert a s", " (∃ a_1, (a_1 ∈ 𝒜 ∧ a ∈ a_1) ∧ a_1.erase a = s) → insert a s ∈ 𝒜 ∧ a ∉ s", " insert a (s.erase a) ∈ 𝒜...
[ " s ∈ nonMemberSubfamily a 𝒜 ↔ s ∈ 𝒜 ∧ a ∉ s", " s ∈ memberSubfamily a 𝒜 ↔ insert a s ∈ 𝒜 ∧ a ∉ s", " (∃ a_1, (a_1 ∈ 𝒜 ∧ a ∈ a_1) ∧ a_1.erase a = s) ↔ insert a s ∈ 𝒜 ∧ a ∉ s", " a ∈ insert a s", " (∃ a_1, (a_1 ∈ 𝒜 ∧ a ∈ a_1) ∧ a_1.erase a = s) → insert a s ∈ 𝒜 ∧ a ∉ s", " insert a (s.erase a) ∈ 𝒜...
import Mathlib.CategoryTheory.Category.Grpd import Mathlib.CategoryTheory.Groupoid import Mathlib.Topology.Category.TopCat.Basic import Mathlib.Topology.Homotopy.Path import Mathlib.Data.Set.Subsingleton #align_import algebraic_topology.fundamental_groupoid.basic from "leanprover-community/mathlib"@"3d7987cda72abc473c7cdbbb075170e9ac620042" open CategoryTheory universe u v variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] variable {x₀ x₁ : X} noncomputable section open unitInterval namespace Path namespace Homotopy section def reflTransSymmAux (x : I × I) : ℝ := if (x.2 : ℝ) ≤ 1 / 2 then x.1 * 2 * x.2 else x.1 * (2 - 2 * x.2) #align path.homotopy.refl_trans_symm_aux Path.Homotopy.reflTransSymmAux @[continuity] theorem continuous_reflTransSymmAux : Continuous reflTransSymmAux := by refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_ · continuity · continuity · continuity · continuity intro x hx norm_num [hx, mul_assoc] #align path.homotopy.continuous_refl_trans_symm_aux Path.Homotopy.continuous_reflTransSymmAux theorem reflTransSymmAux_mem_I (x : I × I) : reflTransSymmAux x ∈ I := by dsimp only [reflTransSymmAux] split_ifs · constructor · apply mul_nonneg · apply mul_nonneg · unit_interval · norm_num · unit_interval · rw [mul_assoc] apply mul_le_one · unit_interval · apply mul_nonneg · norm_num · unit_interval · linarith · constructor · apply mul_nonneg · unit_interval linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] · apply mul_le_one · unit_interval · linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] · linarith [unitInterval.nonneg x.2, unitInterval.le_one x.2] set_option linter.uppercaseLean3 false in #align path.homotopy.refl_trans_symm_aux_mem_I Path.Homotopy.reflTransSymmAux_mem_I def reflTransSymm (p : Path x₀ x₁) : Homotopy (Path.refl x₀) (p.trans p.symm) where toFun x := p ⟨reflTransSymmAux x, reflTransSymmAux_mem_I x⟩ continuous_toFun := by continuity map_zero_left := by simp [reflTransSymmAux] map_one_left x := by dsimp only [reflTransSymmAux, Path.coe_toContinuousMap, Path.trans] change _ = ite _ _ _ split_ifs with h · rw [Path.extend, Set.IccExtend_of_mem] · norm_num · rw [unitInterval.mul_pos_mem_iff zero_lt_two] exact ⟨unitInterval.nonneg x, h⟩ · rw [Path.symm, Path.extend, Set.IccExtend_of_mem] · simp only [Set.Icc.coe_one, one_mul, coe_mk_mk, Function.comp_apply] congr 1 ext norm_num [sub_sub_eq_add_sub] · rw [unitInterval.two_mul_sub_one_mem_iff] exact ⟨(not_le.1 h).le, unitInterval.le_one x⟩ prop' t x hx := by simp only [Set.mem_singleton_iff, Set.mem_insert_iff] at hx simp only [ContinuousMap.coe_mk, coe_toContinuousMap, Path.refl_apply] cases hx with | inl hx | inr hx => set_option tactic.skipAssignedInstances false in rw [hx] norm_num [reflTransSymmAux] #align path.homotopy.refl_trans_symm Path.Homotopy.reflTransSymm def reflSymmTrans (p : Path x₀ x₁) : Homotopy (Path.refl x₁) (p.symm.trans p) := (reflTransSymm p.symm).cast rfl <| congr_arg _ (Path.symm_symm _) #align path.homotopy.refl_symm_trans Path.Homotopy.reflSymmTrans end section TransRefl def transReflReparamAux (t : I) : ℝ := if (t : ℝ) ≤ 1 / 2 then 2 * t else 1 #align path.homotopy.trans_refl_reparam_aux Path.Homotopy.transReflReparamAux @[continuity] theorem continuous_transReflReparamAux : Continuous transReflReparamAux := by refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_ <;> [continuity; continuity; continuity; continuity; skip] intro x hx simp [hx] #align path.homotopy.continuous_trans_refl_reparam_aux Path.Homotopy.continuous_transReflReparamAux theorem transReflReparamAux_mem_I (t : I) : transReflReparamAux t ∈ I := by unfold transReflReparamAux split_ifs <;> constructor <;> linarith [unitInterval.le_one t, unitInterval.nonneg t] set_option linter.uppercaseLean3 false in #align path.homotopy.trans_refl_reparam_aux_mem_I Path.Homotopy.transReflReparamAux_mem_I theorem transReflReparamAux_zero : transReflReparamAux 0 = 0 := by set_option tactic.skipAssignedInstances false in norm_num [transReflReparamAux] #align path.homotopy.trans_refl_reparam_aux_zero Path.Homotopy.transReflReparamAux_zero theorem transReflReparamAux_one : transReflReparamAux 1 = 1 := by set_option tactic.skipAssignedInstances false in norm_num [transReflReparamAux] #align path.homotopy.trans_refl_reparam_aux_one Path.Homotopy.transReflReparamAux_one
Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean
152
163
theorem trans_refl_reparam (p : Path x₀ x₁) : p.trans (Path.refl x₁) = p.reparam (fun t => ⟨transReflReparamAux t, transReflReparamAux_mem_I t⟩) (by continuity) (Subtype.ext transReflReparamAux_zero) (Subtype.ext transReflReparamAux_one) := by
ext unfold transReflReparamAux simp only [Path.trans_apply, not_le, coe_reparam, Function.comp_apply, one_div, Path.refl_apply] split_ifs · rfl · rfl · simp · simp
[ " Continuous reflTransSymmAux", " Continuous fun x => ↑x.2", " Continuous fun x => 1 / 2", " Continuous fun x => ↑x.1 * 2 * ↑x.2", " Continuous fun x => ↑x.1 * (2 - 2 * ↑x.2)", " ∀ (x : ↑I × ↑I), ↑x.2 = 1 / 2 → ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ref...
[ " Continuous reflTransSymmAux", " Continuous fun x => ↑x.2", " Continuous fun x => 1 / 2", " Continuous fun x => ↑x.1 * 2 * ↑x.2", " Continuous fun x => ↑x.1 * (2 - 2 * ↑x.2)", " ∀ (x : ↑I × ↑I), ↑x.2 = 1 / 2 → ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ↑x.1 * 2 * ↑x.2 = ↑x.1 * (2 - 2 * ↑x.2)", " ref...
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.Probability.Kernel.Disintegration.CdfToKernel #align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8" open MeasureTheory Set Filter TopologicalSpace open scoped NNReal ENNReal MeasureTheory Topology namespace MeasureTheory.Measure variable {α β : Type*} {mα : MeasurableSpace α} (ρ : Measure (α × ℝ)) noncomputable def IicSnd (r : ℝ) : Measure α := (ρ.restrict (univ ×ˢ Iic r)).fst #align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd theorem IicSnd_apply (r : ℝ) {s : Set α} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s ×ˢ Iic r) := by rw [IicSnd, fst_apply hs, restrict_apply' (MeasurableSet.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ← prod_univ, prod_inter_prod, inter_univ, univ_inter] #align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ ×ˢ Iic r) := IicSnd_apply ρ r MeasurableSet.univ #align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ theorem IicSnd_mono {r r' : ℝ} (h_le : r ≤ r') : ρ.IicSnd r ≤ ρ.IicSnd r' := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [IicSnd_apply ρ _ hs] refine measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr ?_⟩)) exact mod_cast h_le #align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≤ ρ.fst := by refine Measure.le_iff.2 fun s hs ↦ ?_ simp_rw [fst_apply hs, IicSnd_apply ρ r hs] exact measure_mono (prod_subset_preimage_fst _ _) #align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.IicSnd_le_fst theorem IicSnd_ac_fst (r : ℝ) : ρ.IicSnd r ≪ ρ.fst := Measure.absolutelyContinuous_of_le (IicSnd_le_fst ρ r) #align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.IicSnd_ac_fst theorem IsFiniteMeasure.IicSnd {ρ : Measure (α × ℝ)} [IsFiniteMeasure ρ] (r : ℝ) : IsFiniteMeasure (ρ.IicSnd r) := isFiniteMeasure_of_le _ (IicSnd_le_fst ρ _) #align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.IicSnd
Mathlib/Probability/Kernel/Disintegration/CondCdf.lean
87
89
theorem iInf_IicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMeasure ρ] : ⨅ r : { r' : ℚ // t < r' }, ρ.IicSnd r s = ρ.IicSnd t s := by
simp_rw [ρ.IicSnd_apply _ hs, Measure.iInf_rat_gt_prod_Iic hs]
[ " (ρ.IicSnd r) s = ρ (s ×ˢ Iic r)", " ρ.IicSnd r ≤ ρ.IicSnd r'", " (ρ.IicSnd r) s ≤ (ρ.IicSnd r') s", " ρ (s ×ˢ Iic r) ≤ ρ (s ×ˢ Iic r')", " r ≤ r'", " ρ.IicSnd r ≤ ρ.fst", " (ρ.IicSnd r) s ≤ ρ.fst s", " ρ (s ×ˢ Iic r) ≤ ρ (Prod.fst ⁻¹' s)", " ⨅ r, (ρ.IicSnd ↑↑r) s = (ρ.IicSnd ↑t) s" ]
[ " (ρ.IicSnd r) s = ρ (s ×ˢ Iic r)", " ρ.IicSnd r ≤ ρ.IicSnd r'", " (ρ.IicSnd r) s ≤ (ρ.IicSnd r') s", " ρ (s ×ˢ Iic r) ≤ ρ (s ×ˢ Iic r')", " r ≤ r'", " ρ.IicSnd r ≤ ρ.fst", " (ρ.IicSnd r) s ≤ ρ.fst s", " ρ (s ×ˢ Iic r) ≤ ρ (Prod.fst ⁻¹' s)", " ⨅ r, (ρ.IicSnd ↑↑r) s = (ρ.IicSnd ↑t) s" ]
import Mathlib.Mathport.Rename import Mathlib.Tactic.Lemma import Mathlib.Tactic.TypeStar #align_import data.option.defs from "leanprover-community/mathlib"@"c4658a649d216f57e99621708b09dcb3dcccbd23" namespace Option #align option.lift_or_get Option.liftOrGet protected def traverse.{u, v} {F : Type u → Type v} [Applicative F] {α : Type*} {β : Type u} (f : α → F β) : Option α → F (Option β) | none => pure none | some x => some <$> f x #align option.traverse Option.traverse #align option.maybe Option.sequence #align option.mmap Option.mapM #align option.melim Option.elimM #align option.mget_or_else Option.getDM variable {α : Type*} {β : Type*} -- Porting note: Would need to add the attribute directly in `Init.Prelude`. -- attribute [inline] Option.isSome Option.isNone protected def elim' (b : β) (f : α → β) : Option α → β | some a => f a | none => b #align option.elim Option.elim' @[simp] theorem elim'_none (b : β) (f : α → β) : Option.elim' b f none = b := rfl @[simp] theorem elim'_some {a : α} (b : β) (f : α → β) : Option.elim' b f (some a) = f a := rfl -- Porting note: this lemma was introduced because it is necessary -- in `CategoryTheory.Category.PartialFun` lemma elim'_eq_elim {α β : Type*} (b : β) (f : α → β) (a : Option α) : Option.elim' b f a = Option.elim a b f := by cases a <;> rfl theorem mem_some_iff {α : Type*} {a b : α} : a ∈ some b ↔ b = a := by simp #align option.mem_some_iff Option.mem_some_iff @[inline] def decidableEqNone {o : Option α} : Decidable (o = none) := decidable_of_decidable_of_iff isNone_iff_eq_none #align option.decidable_eq_none Option.decidableEqNone instance decidableForallMem {p : α → Prop} [DecidablePred p] : ∀ o : Option α, Decidable (∀ a ∈ o, p a) | none => isTrue (by simp [false_imp_iff]) | some a => if h : p a then isTrue fun o e ↦ some_inj.1 e ▸ h else isFalse <| mt (fun H ↦ H _ rfl) h instance decidableExistsMem {p : α → Prop} [DecidablePred p] : ∀ o : Option α, Decidable (∃ a ∈ o, p a) | none => isFalse fun ⟨a, ⟨h, _⟩⟩ ↦ by cases h | some a => if h : p a then isTrue <| ⟨_, rfl, h⟩ else isFalse fun ⟨_, ⟨rfl, hn⟩⟩ ↦ h hn abbrev iget [Inhabited α] : Option α → α | some x => x | none => default #align option.iget Option.iget theorem iget_some [Inhabited α] {a : α} : (some a).iget = a := rfl #align option.iget_some Option.iget_some @[simp]
Mathlib/Data/Option/Defs.lean
96
97
theorem mem_toList {a : α} {o : Option α} : a ∈ toList o ↔ a ∈ o := by
cases o <;> simp [toList, eq_comm]
[ " Option.elim' b f a = a.elim b f", " Option.elim' b f none = none.elim b f", " Option.elim' b f (some val✝) = (some val✝).elim b f", " a ∈ some b ↔ b = a", " ∀ (a : α), a ∈ none → p a", " False", " a ∈ o.toList ↔ a ∈ o", " a ∈ none.toList ↔ a ∈ none", " a ∈ (some val✝).toList ↔ a ∈ some val✝" ]
[ " Option.elim' b f a = a.elim b f", " Option.elim' b f none = none.elim b f", " Option.elim' b f (some val✝) = (some val✝).elim b f", " a ∈ some b ↔ b = a", " ∀ (a : α), a ∈ none → p a", " False", " a ∈ o.toList ↔ a ∈ o" ]
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {α Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] {γ γ₁ γ₂ : Γ₀} {l : Filter α} {f : α → Γ₀} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Γ₀ := nhdsAdjoint 0 <| ⨅ γ ≠ 0, 𝓟 (Iio γ) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace
Mathlib/Topology/Algebra/WithZeroTopology.lean
47
49
theorem nhds_eq_update : (𝓝 : Γ₀ → Filter Γ₀) = update pure 0 (⨅ γ ≠ 0, 𝓟 (Iio γ)) := by
rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInf₂ fun γ hγ ↦ le_principal_iff.2 <| zero_lt_iff.2 hγ
[ " 𝓝 = update pure 0 (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ))", " pure 0 ≤ ⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ)" ]
[ " 𝓝 = update pure 0 (⨅ γ, ⨅ (_ : γ ≠ 0), 𝓟 (Iio γ))" ]
import Mathlib.Data.List.Nodup #align_import data.list.duplicate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" variable {α : Type*} namespace List inductive Duplicate (x : α) : List α → Prop | cons_mem {l : List α} : x ∈ l → Duplicate x (x :: l) | cons_duplicate {y : α} {l : List α} : Duplicate x l → Duplicate x (y :: l) #align list.duplicate List.Duplicate local infixl:50 " ∈+ " => List.Duplicate variable {l : List α} {x : α} theorem Mem.duplicate_cons_self (h : x ∈ l) : x ∈+ x :: l := Duplicate.cons_mem h #align list.mem.duplicate_cons_self List.Mem.duplicate_cons_self theorem Duplicate.duplicate_cons (h : x ∈+ l) (y : α) : x ∈+ y :: l := Duplicate.cons_duplicate h #align list.duplicate.duplicate_cons List.Duplicate.duplicate_cons
Mathlib/Data/List/Duplicate.lean
46
49
theorem Duplicate.mem (h : x ∈+ l) : x ∈ l := by
induction' h with l' _ y l' _ hm · exact mem_cons_self _ _ · exact mem_cons_of_mem _ hm
[ " x ∈ l", " x ∈ x :: l'", " x ∈ y :: l'" ]
[ " x ∈ l" ]
import Mathlib.Order.Bounds.Basic import Mathlib.Order.WellFounded import Mathlib.Data.Set.Image import Mathlib.Order.Interval.Set.Basic import Mathlib.Data.Set.Lattice #align_import order.conditionally_complete_lattice.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1" open Function OrderDual Set variable {α β γ : Type*} {ι : Sort*} section variable [Preorder α] open scoped Classical noncomputable instance WithTop.instSupSet [SupSet α] : SupSet (WithTop α) := ⟨fun S => if ⊤ ∈ S then ⊤ else if BddAbove ((fun (a : α) ↦ ↑a) ⁻¹' S : Set α) then ↑(sSup ((fun (a : α) ↦ (a : WithTop α)) ⁻¹' S : Set α)) else ⊤⟩ noncomputable instance WithTop.instInfSet [InfSet α] : InfSet (WithTop α) := ⟨fun S => if S ⊆ {⊤} ∨ ¬BddBelow S then ⊤ else ↑(sInf ((fun (a : α) ↦ ↑a) ⁻¹' S : Set α))⟩ noncomputable instance WithBot.instSupSet [SupSet α] : SupSet (WithBot α) := ⟨(WithTop.instInfSet (α := αᵒᵈ)).sInf⟩ noncomputable instance WithBot.instInfSet [InfSet α] : InfSet (WithBot α) := ⟨(WithTop.instSupSet (α := αᵒᵈ)).sSup⟩ theorem WithTop.sSup_eq [SupSet α] {s : Set (WithTop α)} (hs : ⊤ ∉ s) (hs' : BddAbove ((↑) ⁻¹' s : Set α)) : sSup s = ↑(sSup ((↑) ⁻¹' s) : α) := (if_neg hs).trans <| if_pos hs' #align with_top.Sup_eq WithTop.sSup_eq theorem WithTop.sInf_eq [InfSet α] {s : Set (WithTop α)} (hs : ¬s ⊆ {⊤}) (h's : BddBelow s) : sInf s = ↑(sInf ((↑) ⁻¹' s) : α) := if_neg <| by simp [hs, h's] #align with_top.Inf_eq WithTop.sInf_eq theorem WithBot.sInf_eq [InfSet α] {s : Set (WithBot α)} (hs : ⊥ ∉ s) (hs' : BddBelow ((↑) ⁻¹' s : Set α)) : sInf s = ↑(sInf ((↑) ⁻¹' s) : α) := (if_neg hs).trans <| if_pos hs' #align with_bot.Inf_eq WithBot.sInf_eq theorem WithBot.sSup_eq [SupSet α] {s : Set (WithBot α)} (hs : ¬s ⊆ {⊥}) (h's : BddAbove s) : sSup s = ↑(sSup ((↑) ⁻¹' s) : α) := WithTop.sInf_eq (α := αᵒᵈ) hs h's #align with_bot.Sup_eq WithBot.sSup_eq @[simp] theorem WithTop.sInf_empty [InfSet α] : sInf (∅ : Set (WithTop α)) = ⊤ := if_pos <| by simp #align with_top.cInf_empty WithTop.sInf_empty @[simp] theorem WithTop.iInf_empty [IsEmpty ι] [InfSet α] (f : ι → WithTop α) : ⨅ i, f i = ⊤ := by rw [iInf, range_eq_empty, WithTop.sInf_empty] #align with_top.cinfi_empty WithTop.iInf_empty theorem WithTop.coe_sInf' [InfSet α] {s : Set α} (hs : s.Nonempty) (h's : BddBelow s) : ↑(sInf s) = (sInf ((fun (a : α) ↦ ↑a) '' s) : WithTop α) := by obtain ⟨x, hx⟩ := hs change _ = ite _ _ _ split_ifs with h · rcases h with h1 | h2 · cases h1 (mem_image_of_mem _ hx) · exact (h2 (Monotone.map_bddBelow coe_mono h's)).elim · rw [preimage_image_eq] exact Option.some_injective _ #align with_top.coe_Inf' WithTop.coe_sInf' -- Porting note: the mathlib3 proof uses `range_comp` in the opposite direction and -- does not need `rfl`. @[norm_cast] theorem WithTop.coe_iInf [Nonempty ι] [InfSet α] {f : ι → α} (hf : BddBelow (range f)) : ↑(⨅ i, f i) = (⨅ i, f i : WithTop α) := by rw [iInf, iInf, WithTop.coe_sInf' (range_nonempty f) hf, ← range_comp] rfl #align with_top.coe_infi WithTop.coe_iInf
Mathlib/Order/ConditionallyCompleteLattice/Basic.lean
116
121
theorem WithTop.coe_sSup' [SupSet α] {s : Set α} (hs : BddAbove s) : ↑(sSup s) = (sSup ((fun (a : α) ↦ ↑a) '' s) : WithTop α) := by
change _ = ite _ _ _ rw [if_neg, preimage_image_eq, if_pos hs] · exact Option.some_injective _ · rintro ⟨x, _, ⟨⟩⟩
[ " ¬(s ⊆ {⊤} ∨ ¬BddBelow s)", " ∅ ⊆ {⊤} ∨ ¬BddBelow ∅", " ⨅ i, f i = ⊤", " ↑(sInf s) = sInf ((fun a => ↑a) '' s)", " ↑(sInf s) =\n if (fun a => ↑a) '' s ⊆ {⊤} ∨ ¬BddBelow ((fun a => ↑a) '' s) then ⊤\n else ↑(sInf ((fun a => ↑a) ⁻¹' ((fun a => ↑a) '' s)))", " ↑(sInf s) = ⊤", " ↑(sInf s) = ↑(sInf ((f...
[ " ¬(s ⊆ {⊤} ∨ ¬BddBelow s)", " ∅ ⊆ {⊤} ∨ ¬BddBelow ∅", " ⨅ i, f i = ⊤", " ↑(sInf s) = sInf ((fun a => ↑a) '' s)", " ↑(sInf s) =\n if (fun a => ↑a) '' s ⊆ {⊤} ∨ ¬BddBelow ((fun a => ↑a) '' s) then ⊤\n else ↑(sInf ((fun a => ↑a) ⁻¹' ((fun a => ↑a) '' s)))", " ↑(sInf s) = ⊤", " ↑(sInf s) = ↑(sInf ((f...
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : ℕ) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "𝕎" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 × ℕ) ℤ open Finset MvPolynomial def wittPolyProd (n : ℕ) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : ℕ) : (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> · refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : ℕ) : 𝕄 := ∑ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : ℕ) : (wittPolyProdRemainder p n).vars ⊆ univ ×ˢ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ · apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : ℤ) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset · apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊢ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : ℕ) : 𝕄 := (∑ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : ℤ) ^ x))) * ∑ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : ℤ) ^ x)) #align witt_vector.remainder WittVector.remainder theorem remainder_vars (n : ℕ) : (remainder p n).vars ⊆ univ ×ˢ range (n + 1) := by rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> · refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] · apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx · apply pow_ne_zero exact mod_cast hp.out.ne_zero #align witt_vector.remainder_vars WittVector.remainder_vars def polyOfInterest (n : ℕ) : 𝕄 := wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) - X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ (n + 1)) - X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ (n + 1)) #align witt_vector.poly_of_interest WittVector.polyOfInterest theorem mul_polyOfInterest_aux1 (n : ℕ) : ∑ i ∈ range (n + 1), (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by simp only [wittPolyProd] convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1 · simp only [wittPolynomial, wittMul] rw [AlgHom.map_sum] congr 1 with i congr 1 have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by rw [Finsupp.support_eq_singleton] simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne] exact pow_ne_zero _ hp.out.ne_zero simp only [bind₁_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast, Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true, Int.cast_pow] · simp only [map_mul, bind₁_X_right] #align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1
Mathlib/RingTheory/WittVector/MulCoeff.lean
138
142
theorem mul_polyOfInterest_aux2 (n : ℕ) : (p : 𝕄) ^ n * wittMul p n + wittPolyProdRemainder p n = wittPolyProd p n := by
convert mul_polyOfInterest_aux1 p n rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one] rfl
[ " (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n) * (rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n)).vars ∪ ((rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n ...
[ " (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n) * (rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n + 1)", " ((rename (Prod.mk 0)) (wittPolynomial p ℤ n)).vars ∪ ((rename (Prod.mk 1)) (wittPolynomial p ℤ n)).vars ⊆\n univ ×ˢ range (n ...
import Mathlib.Algebra.BigOperators.WithTop import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.ENNReal.Basic #align_import data.real.ennreal from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open Set NNReal ENNReal namespace ENNReal variable {a b c d : ℝ≥0∞} {r p q : ℝ≥0} section OperationsAndInfty variable {α : Type*} @[simp] theorem add_eq_top : a + b = ∞ ↔ a = ∞ ∨ b = ∞ := WithTop.add_eq_top #align ennreal.add_eq_top ENNReal.add_eq_top @[simp] theorem add_lt_top : a + b < ∞ ↔ a < ∞ ∧ b < ∞ := WithTop.add_lt_top #align ennreal.add_lt_top ENNReal.add_lt_top theorem toNNReal_add {r₁ r₂ : ℝ≥0∞} (h₁ : r₁ ≠ ∞) (h₂ : r₂ ≠ ∞) : (r₁ + r₂).toNNReal = r₁.toNNReal + r₂.toNNReal := by lift r₁ to ℝ≥0 using h₁ lift r₂ to ℝ≥0 using h₂ rfl #align ennreal.to_nnreal_add ENNReal.toNNReal_add theorem not_lt_top {x : ℝ≥0∞} : ¬x < ∞ ↔ x = ∞ := by rw [lt_top_iff_ne_top, Classical.not_not] #align ennreal.not_lt_top ENNReal.not_lt_top theorem add_ne_top : a + b ≠ ∞ ↔ a ≠ ∞ ∧ b ≠ ∞ := by simpa only [lt_top_iff_ne_top] using add_lt_top #align ennreal.add_ne_top ENNReal.add_ne_top theorem mul_top' : a * ∞ = if a = 0 then 0 else ∞ := by convert WithTop.mul_top' a #align ennreal.mul_top ENNReal.mul_top' -- Porting note: added because `simp` no longer uses `WithTop` lemmas for `ℝ≥0∞` @[simp] theorem mul_top (h : a ≠ 0) : a * ∞ = ∞ := WithTop.mul_top h
Mathlib/Data/ENNReal/Operations.lean
212
212
theorem top_mul' : ∞ * a = if a = 0 then 0 else ∞ := by
convert WithTop.top_mul' a
[ " (r₁ + r₂).toNNReal = r₁.toNNReal + r₂.toNNReal", " (↑r₁ + r₂).toNNReal = (↑r₁).toNNReal + r₂.toNNReal", " (↑r₁ + ↑r₂).toNNReal = (↑r₁).toNNReal + (↑r₂).toNNReal", " ¬x < ⊤ ↔ x = ⊤", " a + b ≠ ⊤ ↔ a ≠ ⊤ ∧ b ≠ ⊤", " a * ⊤ = if a = 0 then 0 else ⊤", " ⊤ * a = if a = 0 then 0 else ⊤" ]
[ " (r₁ + r₂).toNNReal = r₁.toNNReal + r₂.toNNReal", " (↑r₁ + r₂).toNNReal = (↑r₁).toNNReal + r₂.toNNReal", " (↑r₁ + ↑r₂).toNNReal = (↑r₁).toNNReal + (↑r₂).toNNReal", " ¬x < ⊤ ↔ x = ⊤", " a + b ≠ ⊤ ↔ a ≠ ⊤ ∧ b ≠ ⊤", " a * ⊤ = if a = 0 then 0 else ⊤", " ⊤ * a = if a = 0 then 0 else ⊤" ]
import Mathlib.Init.Order.Defs import Mathlib.Logic.Nontrivial.Defs import Mathlib.Tactic.Attr.Register import Mathlib.Data.Prod.Basic import Mathlib.Data.Subtype import Mathlib.Logic.Function.Basic import Mathlib.Logic.Unique #align_import logic.nontrivial from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" variable {α : Type*} {β : Type*} open scoped Classical -- `x` and `y` are explicit here, as they are often needed to guide typechecking of `h`. theorem nontrivial_of_lt [Preorder α] (x y : α) (h : x < y) : Nontrivial α := ⟨⟨x, y, ne_of_lt h⟩⟩ #align nontrivial_of_lt nontrivial_of_lt theorem exists_pair_lt (α : Type*) [Nontrivial α] [LinearOrder α] : ∃ x y : α, x < y := by rcases exists_pair_ne α with ⟨x, y, hxy⟩ cases lt_or_gt_of_ne hxy <;> exact ⟨_, _, ‹_›⟩ #align exists_pair_lt exists_pair_lt theorem nontrivial_iff_lt [LinearOrder α] : Nontrivial α ↔ ∃ x y : α, x < y := ⟨fun h ↦ @exists_pair_lt α h _, fun ⟨x, y, h⟩ ↦ nontrivial_of_lt x y h⟩ #align nontrivial_iff_lt nontrivial_iff_lt theorem Subtype.nontrivial_iff_exists_ne (p : α → Prop) (x : Subtype p) : Nontrivial (Subtype p) ↔ ∃ (y : α) (_ : p y), y ≠ x := by simp only [_root_.nontrivial_iff_exists_ne x, Subtype.exists, Ne, Subtype.ext_iff] #align subtype.nontrivial_iff_exists_ne Subtype.nontrivial_iff_exists_ne noncomputable def nontrivialPSumUnique (α : Type*) [Inhabited α] : PSum (Nontrivial α) (Unique α) := if h : Nontrivial α then PSum.inl h else PSum.inr { default := default, uniq := fun x : α ↦ by by_contra H exact h ⟨_, _, H⟩ } #align nontrivial_psum_unique nontrivialPSumUnique instance Option.nontrivial [Nonempty α] : Nontrivial (Option α) := by inhabit α exact ⟨none, some default, nofun⟩ protected theorem Function.Injective.nontrivial [Nontrivial α] {f : α → β} (hf : Function.Injective f) : Nontrivial β := let ⟨x, y, h⟩ := exists_pair_ne α ⟨⟨f x, f y, hf.ne h⟩⟩ #align function.injective.nontrivial Function.Injective.nontrivial protected theorem Function.Injective.exists_ne [Nontrivial α] {f : α → β} (hf : Function.Injective f) (y : β) : ∃ x, f x ≠ y := by rcases exists_pair_ne α with ⟨x₁, x₂, hx⟩ by_cases h:f x₂ = y · exact ⟨x₁, (hf.ne_iff' h).2 hx⟩ · exact ⟨x₂, h⟩ #align function.injective.exists_ne Function.Injective.exists_ne instance nontrivial_prod_right [Nonempty α] [Nontrivial β] : Nontrivial (α × β) := Prod.snd_surjective.nontrivial instance nontrivial_prod_left [Nontrivial α] [Nonempty β] : Nontrivial (α × β) := Prod.fst_surjective.nontrivial namespace Pi variable {I : Type*} {f : I → Type*}
Mathlib/Logic/Nontrivial/Basic.lean
90
93
theorem nontrivial_at (i' : I) [inst : ∀ i, Nonempty (f i)] [Nontrivial (f i')] : Nontrivial (∀ i : I, f i) := by
letI := Classical.decEq (∀ i : I, f i) exact (Function.update_injective (fun i ↦ Classical.choice (inst i)) i').nontrivial
[ " ∃ x y, x < y", " Nontrivial (Subtype p) ↔ ∃ y x_1, y ≠ ↑x", " x = default", " False", " Nontrivial (Option α)", " ∃ x, f x ≠ y", " Nontrivial ((i : I) → f i)" ]
[ " ∃ x y, x < y", " Nontrivial (Subtype p) ↔ ∃ y x_1, y ≠ ↑x", " x = default", " False", " Nontrivial (Option α)", " ∃ x, f x ≠ y", " Nontrivial ((i : I) → f i)" ]
import Mathlib.GroupTheory.Archimedean import Mathlib.Topology.Order.Basic #align_import topology.algebra.order.archimedean from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514" open Set theorem Rat.denseRange_cast {𝕜} [LinearOrderedField 𝕜] [TopologicalSpace 𝕜] [OrderTopology 𝕜] [Archimedean 𝕜] : DenseRange ((↑) : ℚ → 𝕜) := dense_of_exists_between fun _ _ h => Set.exists_range_iff.2 <| exists_rat_btwn h #align rat.dense_range_cast Rat.denseRange_cast namespace AddSubgroup variable {G : Type*} [LinearOrderedAddCommGroup G] [TopologicalSpace G] [OrderTopology G] [Archimedean G] theorem dense_of_not_isolated_zero (S : AddSubgroup G) (hS : ∀ ε > 0, ∃ g ∈ S, g ∈ Ioo 0 ε) : Dense (S : Set G) := by cases subsingleton_or_nontrivial G · refine fun x => _root_.subset_closure ?_ rw [Subsingleton.elim x 0] exact zero_mem S refine dense_of_exists_between fun a b hlt => ?_ rcases hS (b - a) (sub_pos.2 hlt) with ⟨g, hgS, hg0, hg⟩ rcases (existsUnique_add_zsmul_mem_Ioc hg0 0 a).exists with ⟨m, hm⟩ rw [zero_add] at hm refine ⟨m • g, zsmul_mem hgS _, hm.1, hm.2.trans_lt ?_⟩ rwa [lt_sub_iff_add_lt'] at hg theorem dense_of_no_min (S : AddSubgroup G) (hbot : S ≠ ⊥) (H : ¬∃ a : G, IsLeast { g : G | g ∈ S ∧ 0 < g } a) : Dense (S : Set G) := by refine S.dense_of_not_isolated_zero fun ε ε0 => ?_ contrapose! H exact exists_isLeast_pos hbot ε0 (disjoint_left.2 H) #align real.subgroup_dense_of_no_min AddSubgroup.dense_of_no_minₓ
Mathlib/Topology/Algebra/Order/Archimedean.lean
67
71
theorem dense_or_cyclic (S : AddSubgroup G) : Dense (S : Set G) ∨ ∃ a : G, S = closure {a} := by
refine (em _).imp (dense_of_not_isolated_zero S) fun h => ?_ push_neg at h rcases h with ⟨ε, ε0, hε⟩ exact cyclic_of_isolated_zero ε0 (disjoint_left.2 hε)
[ " Dense ↑S", " x ∈ ↑S", " 0 ∈ ↑S", " ∃ c ∈ ↑S, a < c ∧ c < b", " a + g < b", " ∃ g ∈ S, g ∈ Ioo 0 ε", " ∃ a, IsLeast {g | g ∈ S ∧ 0 < g} a", " Dense ↑S ∨ ∃ a, S = closure {a}", " ∃ a, S = closure {a}" ]
[ " Dense ↑S", " x ∈ ↑S", " 0 ∈ ↑S", " ∃ c ∈ ↑S, a < c ∧ c < b", " a + g < b", " ∃ g ∈ S, g ∈ Ioo 0 ε", " ∃ a, IsLeast {g | g ∈ S ∧ 0 < g} a", " Dense ↑S ∨ ∃ a, S = closure {a}" ]
import Mathlib.Analysis.Convex.Cone.Extension import Mathlib.Analysis.Convex.Gauge import Mathlib.Topology.Algebra.Module.FiniteDimension import Mathlib.Topology.Algebra.Module.LocallyConvex #align_import analysis.normed_space.hahn_banach.separation from "leanprover-community/mathlib"@"915591b2bb3ea303648db07284a161a7f2a9e3d4" open Set open Pointwise variable {𝕜 E : Type*} theorem separate_convex_open_set [TopologicalSpace E] [AddCommGroup E] [TopologicalAddGroup E] [Module ℝ E] [ContinuousSMul ℝ E] {s : Set E} (hs₀ : (0 : E) ∈ s) (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) {x₀ : E} (hx₀ : x₀ ∉ s) : ∃ f : E →L[ℝ] ℝ, f x₀ = 1 ∧ ∀ x ∈ s, f x < 1 := by let f : E →ₗ.[ℝ] ℝ := LinearPMap.mkSpanSingleton x₀ 1 (ne_of_mem_of_not_mem hs₀ hx₀).symm have := exists_extension_of_le_sublinear f (gauge s) (fun c hc => gauge_smul_of_nonneg hc.le) (gauge_add_le hs₁ <| absorbent_nhds_zero <| hs₂.mem_nhds hs₀) ?_ · obtain ⟨φ, hφ₁, hφ₂⟩ := this have hφ₃ : φ x₀ = 1 := by rw [← f.domain.coe_mk x₀ (Submodule.mem_span_singleton_self _), hφ₁, LinearPMap.mkSpanSingleton'_apply_self] have hφ₄ : ∀ x ∈ s, φ x < 1 := fun x hx => (hφ₂ x).trans_lt (gauge_lt_one_of_mem_of_isOpen hs₂ hx) refine ⟨⟨φ, ?_⟩, hφ₃, hφ₄⟩ refine φ.continuous_of_nonzero_on_open _ (hs₂.vadd (-x₀)) (Nonempty.vadd_set ⟨0, hs₀⟩) (vadd_set_subset_iff.mpr fun x hx => ?_) change φ (-x₀ + x) ≠ 0 rw [map_add, map_neg] specialize hφ₄ x hx linarith rintro ⟨x, hx⟩ obtain ⟨y, rfl⟩ := Submodule.mem_span_singleton.1 hx rw [LinearPMap.mkSpanSingleton'_apply] simp only [mul_one, Algebra.id.smul_eq_mul, Submodule.coe_mk] obtain h | h := le_or_lt y 0 · exact h.trans (gauge_nonneg _) · rw [gauge_smul_of_nonneg h.le, smul_eq_mul, le_mul_iff_one_le_right h] exact one_le_gauge_of_not_mem (hs₁.starConvex hs₀) (absorbent_nhds_zero <| hs₂.mem_nhds hs₀).absorbs hx₀ #align separate_convex_open_set separate_convex_open_set variable [TopologicalSpace E] [AddCommGroup E] [TopologicalAddGroup E] [Module ℝ E] [ContinuousSMul ℝ E] {s t : Set E} {x y : E}
Mathlib/Analysis/NormedSpace/HahnBanach/Separation.lean
84
112
theorem geometric_hahn_banach_open (hs₁ : Convex ℝ s) (hs₂ : IsOpen s) (ht : Convex ℝ t) (disj : Disjoint s t) : ∃ (f : E →L[ℝ] ℝ) (u : ℝ), (∀ a ∈ s, f a < u) ∧ ∀ b ∈ t, u ≤ f b := by
obtain rfl | ⟨a₀, ha₀⟩ := s.eq_empty_or_nonempty · exact ⟨0, 0, by simp, fun b _hb => le_rfl⟩ obtain rfl | ⟨b₀, hb₀⟩ := t.eq_empty_or_nonempty · exact ⟨0, 1, fun a _ha => zero_lt_one, by simp⟩ let x₀ := b₀ - a₀ let C := x₀ +ᵥ (s - t) have : (0 : E) ∈ C := ⟨a₀ - b₀, sub_mem_sub ha₀ hb₀, by simp_rw [x₀, vadd_eq_add, sub_add_sub_cancel', sub_self]⟩ have : Convex ℝ C := (hs₁.sub ht).vadd _ have : x₀ ∉ C := by intro hx₀ rw [← add_zero x₀] at hx₀ exact disj.zero_not_mem_sub_set (vadd_mem_vadd_set_iff.1 hx₀) obtain ⟨f, hf₁, hf₂⟩ := separate_convex_open_set ‹0 ∈ C› ‹_› (hs₂.sub_right.vadd _) ‹x₀ ∉ C› have : f b₀ = f a₀ + 1 := by simp [x₀, ← hf₁] have forall_le : ∀ a ∈ s, ∀ b ∈ t, f a ≤ f b := by intro a ha b hb have := hf₂ (x₀ + (a - b)) (vadd_mem_vadd_set <| sub_mem_sub ha hb) simp only [f.map_add, f.map_sub, hf₁] at this linarith refine ⟨f, sInf (f '' t), image_subset_iff.1 (?_ : f '' s ⊆ Iio (sInf (f '' t))), fun b hb => ?_⟩ · rw [← interior_Iic] refine interior_maximal (image_subset_iff.2 fun a ha => ?_) (f.isOpenMap_of_ne_zero ?_ _ hs₂) · exact le_csInf (Nonempty.image _ ⟨_, hb₀⟩) (forall_mem_image.2 <| forall_le _ ha) · rintro rfl simp at hf₁ · exact csInf_le ⟨f a₀, forall_mem_image.2 <| forall_le _ ha₀⟩ (mem_image_of_mem _ hb)
[ " ∃ f, f x₀ = 1 ∧ ∀ x ∈ s, f x < 1", " φ x₀ = 1", " Continuous φ.toFun", " -x₀ +ᵥ x ∈ fun x => φ x = 0 → False", " φ (-x₀ + x) ≠ 0", " -φ x₀ + φ x ≠ 0", " ∀ (x : ↥f.domain), ↑f x ≤ gauge s ↑x", " ↑f ⟨x, hx⟩ ≤ gauge s ↑⟨x, hx⟩", " ↑f ⟨y • x₀, hx⟩ ≤ gauge s ↑⟨y • x₀, hx⟩", " y • 1 ≤ gauge s ↑⟨y • x₀...
[ " ∃ f, f x₀ = 1 ∧ ∀ x ∈ s, f x < 1", " φ x₀ = 1", " Continuous φ.toFun", " -x₀ +ᵥ x ∈ fun x => φ x = 0 → False", " φ (-x₀ + x) ≠ 0", " -φ x₀ + φ x ≠ 0", " ∀ (x : ↥f.domain), ↑f x ≤ gauge s ↑x", " ↑f ⟨x, hx⟩ ≤ gauge s ↑⟨x, hx⟩", " ↑f ⟨y • x₀, hx⟩ ≤ gauge s ↑⟨y • x₀, hx⟩", " y • 1 ≤ gauge s ↑⟨y • x₀...
import Mathlib.Logic.Encodable.Lattice import Mathlib.MeasureTheory.MeasurableSpace.Defs #align_import measure_theory.pi_system from "leanprover-community/mathlib"@"98e83c3d541c77cdb7da20d79611a780ff8e7d90" open MeasurableSpace Set open scoped Classical open MeasureTheory def IsPiSystem {α} (C : Set (Set α)) : Prop := ∀ᵉ (s ∈ C) (t ∈ C), (s ∩ t : Set α).Nonempty → s ∩ t ∈ C #align is_pi_system IsPiSystem theorem IsPiSystem.singleton {α} (S : Set α) : IsPiSystem ({S} : Set (Set α)) := by intro s h_s t h_t _ rw [Set.mem_singleton_iff.1 h_s, Set.mem_singleton_iff.1 h_t, Set.inter_self, Set.mem_singleton_iff] #align is_pi_system.singleton IsPiSystem.singleton
Mathlib/MeasureTheory/PiSystem.lean
85
92
theorem IsPiSystem.insert_empty {α} {S : Set (Set α)} (h_pi : IsPiSystem S) : IsPiSystem (insert ∅ S) := by
intro s hs t ht hst cases' hs with hs hs · simp [hs] · cases' ht with ht ht · simp [ht] · exact Set.mem_insert_of_mem _ (h_pi s hs t ht hst)
[ " IsPiSystem {S}", " s ∩ t ∈ {S}", " IsPiSystem (insert ∅ S)", " s ∩ t ∈ insert ∅ S" ]
[ " IsPiSystem {S}", " s ∩ t ∈ {S}", " IsPiSystem (insert ∅ S)" ]
import Mathlib.Algebra.Order.Ring.Abs #align_import data.int.order.lemmas from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e" open Function Nat namespace Int variable {a b : ℤ} {n : ℕ} theorem natAbs_eq_iff_mul_self_eq {a b : ℤ} : a.natAbs = b.natAbs ↔ a * a = b * b := by rw [← abs_eq_iff_mul_self_eq, abs_eq_natAbs, abs_eq_natAbs] exact Int.natCast_inj.symm #align int.nat_abs_eq_iff_mul_self_eq Int.natAbs_eq_iff_mul_self_eq #align int.eq_nat_abs_iff_mul_eq_zero Int.eq_natAbs_iff_mul_eq_zero theorem natAbs_lt_iff_mul_self_lt {a b : ℤ} : a.natAbs < b.natAbs ↔ a * a < b * b := by rw [← abs_lt_iff_mul_self_lt, abs_eq_natAbs, abs_eq_natAbs] exact Int.ofNat_lt.symm #align int.nat_abs_lt_iff_mul_self_lt Int.natAbs_lt_iff_mul_self_lt theorem natAbs_le_iff_mul_self_le {a b : ℤ} : a.natAbs ≤ b.natAbs ↔ a * a ≤ b * b := by rw [← abs_le_iff_mul_self_le, abs_eq_natAbs, abs_eq_natAbs] exact Int.ofNat_le.symm #align int.nat_abs_le_iff_mul_self_le Int.natAbs_le_iff_mul_self_le theorem dvd_div_of_mul_dvd {a b c : ℤ} (h : a * b ∣ c) : b ∣ c / a := by rcases eq_or_ne a 0 with (rfl | ha) · simp only [Int.ediv_zero, Int.dvd_zero] rcases h with ⟨d, rfl⟩ refine ⟨d, ?_⟩ rw [mul_assoc, Int.mul_ediv_cancel_left _ ha] #align int.dvd_div_of_mul_dvd Int.dvd_div_of_mul_dvd lemma pow_right_injective (h : 1 < a.natAbs) : Injective ((a ^ ·) : ℕ → ℤ) := by refine (?_ : Injective (natAbs ∘ (a ^ · : ℕ → ℤ))).of_comp convert Nat.pow_right_injective h using 2 rw [Function.comp_apply, natAbs_pow] #align int.pow_right_injective Int.pow_right_injective
Mathlib/Data/Int/Order/Lemmas.lean
62
68
theorem eq_zero_of_abs_lt_dvd {m x : ℤ} (h1 : m ∣ x) (h2 : |x| < m) : x = 0 := by
obtain rfl | hm := eq_or_ne m 0 · exact Int.zero_dvd.1 h1 rcases h1 with ⟨d, rfl⟩ apply mul_eq_zero_of_right rw [← abs_lt_one_iff, ← mul_lt_iff_lt_one_right (abs_pos.mpr hm), ← abs_mul] exact lt_of_lt_of_le h2 (le_abs_self m)
[ " a.natAbs = b.natAbs ↔ a * a = b * b", " a.natAbs = b.natAbs ↔ ↑a.natAbs = ↑b.natAbs", " a.natAbs < b.natAbs ↔ a * a < b * b", " a.natAbs < b.natAbs ↔ ↑a.natAbs < ↑b.natAbs", " a.natAbs ≤ b.natAbs ↔ a * a ≤ b * b", " a.natAbs ≤ b.natAbs ↔ ↑a.natAbs ≤ ↑b.natAbs", " b ∣ c / a", " b ∣ c / 0", " b ∣ a ...
[ " a.natAbs = b.natAbs ↔ a * a = b * b", " a.natAbs = b.natAbs ↔ ↑a.natAbs = ↑b.natAbs", " a.natAbs < b.natAbs ↔ a * a < b * b", " a.natAbs < b.natAbs ↔ ↑a.natAbs < ↑b.natAbs", " a.natAbs ≤ b.natAbs ↔ a * a ≤ b * b", " a.natAbs ≤ b.natAbs ↔ ↑a.natAbs ≤ ↑b.natAbs", " b ∣ c / a", " b ∣ c / 0", " b ∣ a ...
import Mathlib.MeasureTheory.Decomposition.SignedHahn import Mathlib.MeasureTheory.Measure.MutuallySingular #align_import measure_theory.decomposition.jordan from "leanprover-community/mathlib"@"70a4f2197832bceab57d7f41379b2592d1110570" noncomputable section open scoped Classical MeasureTheory ENNReal NNReal variable {α β : Type*} [MeasurableSpace α] namespace MeasureTheory @[ext] structure JordanDecomposition (α : Type*) [MeasurableSpace α] where (posPart negPart : Measure α) [posPart_finite : IsFiniteMeasure posPart] [negPart_finite : IsFiniteMeasure negPart] mutuallySingular : posPart ⟂ₘ negPart #align measure_theory.jordan_decomposition MeasureTheory.JordanDecomposition #align measure_theory.jordan_decomposition.pos_part MeasureTheory.JordanDecomposition.posPart #align measure_theory.jordan_decomposition.neg_part MeasureTheory.JordanDecomposition.negPart #align measure_theory.jordan_decomposition.pos_part_finite MeasureTheory.JordanDecomposition.posPart_finite #align measure_theory.jordan_decomposition.neg_part_finite MeasureTheory.JordanDecomposition.negPart_finite #align measure_theory.jordan_decomposition.mutually_singular MeasureTheory.JordanDecomposition.mutuallySingular attribute [instance] JordanDecomposition.posPart_finite attribute [instance] JordanDecomposition.negPart_finite namespace JordanDecomposition open Measure VectorMeasure variable (j : JordanDecomposition α) instance instZero : Zero (JordanDecomposition α) where zero := ⟨0, 0, MutuallySingular.zero_right⟩ #align measure_theory.jordan_decomposition.has_zero MeasureTheory.JordanDecomposition.instZero instance instInhabited : Inhabited (JordanDecomposition α) where default := 0 #align measure_theory.jordan_decomposition.inhabited MeasureTheory.JordanDecomposition.instInhabited instance instInvolutiveNeg : InvolutiveNeg (JordanDecomposition α) where neg j := ⟨j.negPart, j.posPart, j.mutuallySingular.symm⟩ neg_neg _ := JordanDecomposition.ext _ _ rfl rfl #align measure_theory.jordan_decomposition.has_involutive_neg MeasureTheory.JordanDecomposition.instInvolutiveNeg instance instSMul : SMul ℝ≥0 (JordanDecomposition α) where smul r j := ⟨r • j.posPart, r • j.negPart, MutuallySingular.smul _ (MutuallySingular.smul _ j.mutuallySingular.symm).symm⟩ #align measure_theory.jordan_decomposition.has_smul MeasureTheory.JordanDecomposition.instSMul instance instSMulReal : SMul ℝ (JordanDecomposition α) where smul r j := if 0 ≤ r then r.toNNReal • j else -((-r).toNNReal • j) #align measure_theory.jordan_decomposition.has_smul_real MeasureTheory.JordanDecomposition.instSMulReal @[simp] theorem zero_posPart : (0 : JordanDecomposition α).posPart = 0 := rfl #align measure_theory.jordan_decomposition.zero_pos_part MeasureTheory.JordanDecomposition.zero_posPart @[simp] theorem zero_negPart : (0 : JordanDecomposition α).negPart = 0 := rfl #align measure_theory.jordan_decomposition.zero_neg_part MeasureTheory.JordanDecomposition.zero_negPart @[simp] theorem neg_posPart : (-j).posPart = j.negPart := rfl #align measure_theory.jordan_decomposition.neg_pos_part MeasureTheory.JordanDecomposition.neg_posPart @[simp] theorem neg_negPart : (-j).negPart = j.posPart := rfl #align measure_theory.jordan_decomposition.neg_neg_part MeasureTheory.JordanDecomposition.neg_negPart @[simp] theorem smul_posPart (r : ℝ≥0) : (r • j).posPart = r • j.posPart := rfl #align measure_theory.jordan_decomposition.smul_pos_part MeasureTheory.JordanDecomposition.smul_posPart @[simp] theorem smul_negPart (r : ℝ≥0) : (r • j).negPart = r • j.negPart := rfl #align measure_theory.jordan_decomposition.smul_neg_part MeasureTheory.JordanDecomposition.smul_negPart theorem real_smul_def (r : ℝ) (j : JordanDecomposition α) : r • j = if 0 ≤ r then r.toNNReal • j else -((-r).toNNReal • j) := rfl #align measure_theory.jordan_decomposition.real_smul_def MeasureTheory.JordanDecomposition.real_smul_def @[simp]
Mathlib/MeasureTheory/Decomposition/Jordan.lean
135
137
theorem coe_smul (r : ℝ≥0) : (r : ℝ) • j = r • j := by
-- Porting note: replaced `show` rw [real_smul_def, if_pos (NNReal.coe_nonneg r), Real.toNNReal_coe]
[ " ↑r • j = r • j" ]
[ " ↑r • j = r • j" ]
import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.Dual #align_import linear_algebra.clifford_algebra.contraction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open LinearMap (BilinForm) universe u1 u2 u3 variable {R : Type u1} [CommRing R] variable {M : Type u2} [AddCommGroup M] [Module R M] variable (Q : QuadraticForm R M) namespace CliffordAlgebra section contractLeft variable (d d' : Module.Dual R M) @[simps!] def contractLeftAux (d : Module.Dual R M) : M →ₗ[R] CliffordAlgebra Q × CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q := haveI v_mul := (Algebra.lmul R (CliffordAlgebra Q)).toLinearMap ∘ₗ ι Q d.smulRight (LinearMap.fst _ (CliffordAlgebra Q) (CliffordAlgebra Q)) - v_mul.compl₂ (LinearMap.snd _ (CliffordAlgebra Q) _) #align clifford_algebra.contract_left_aux CliffordAlgebra.contractLeftAux theorem contractLeftAux_contractLeftAux (v : M) (x : CliffordAlgebra Q) (fx : CliffordAlgebra Q) : contractLeftAux Q d v (ι Q v * x, contractLeftAux Q d v (x, fx)) = Q v • fx := by simp only [contractLeftAux_apply_apply] rw [mul_sub, ← mul_assoc, ι_sq_scalar, ← Algebra.smul_def, ← sub_add, mul_smul_comm, sub_self, zero_add] #align clifford_algebra.contract_left_aux_contract_left_aux CliffordAlgebra.contractLeftAux_contractLeftAux variable {Q} def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0 map_add' d₁ d₂ := LinearMap.ext fun x => by dsimp only rw [LinearMap.add_apply] induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx · simp_rw [foldr'_algebraMap, smul_zero, zero_add] · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy] · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx] dsimp only [contractLeftAux_apply_apply] rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul] map_smul' c d := LinearMap.ext fun x => by dsimp only rw [LinearMap.smul_apply, RingHom.id_apply] induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx · simp_rw [foldr'_algebraMap, smul_zero] · rw [map_add, map_add, smul_add, hx, hy] · rw [foldr'_ι_mul, foldr'_ι_mul, hx] dsimp only [contractLeftAux_apply_apply] rw [LinearMap.smul_apply, smul_assoc, mul_smul_comm, smul_sub] #align clifford_algebra.contract_left CliffordAlgebra.contractLeft def contractRight : CliffordAlgebra Q →ₗ[R] Module.Dual R M →ₗ[R] CliffordAlgebra Q := LinearMap.flip (LinearMap.compl₂ (LinearMap.compr₂ contractLeft reverse) reverse) #align clifford_algebra.contract_right CliffordAlgebra.contractRight theorem contractRight_eq (x : CliffordAlgebra Q) : contractRight (Q := Q) x d = reverse (contractLeft (R := R) (M := M) d <| reverse x) := rfl #align clifford_algebra.contract_right_eq CliffordAlgebra.contractRight_eq local infixl:70 "⌋" => contractLeft (R := R) (M := M) local infixl:70 "⌊" => contractRight (R := R) (M := M) (Q := Q) -- Porting note: Lean needs to be reminded of this instance otherwise the statement of the -- next result times out instance : SMul R (CliffordAlgebra Q) := inferInstance theorem contractLeft_ι_mul (a : M) (b : CliffordAlgebra Q) : d⌋(ι Q a * b) = d a • b - ι Q a * (d⌋b) := by -- Porting note: Lean cannot figure out anymore the third argument refine foldr'_ι_mul _ _ ?_ _ _ _ exact fun m x fx ↦ contractLeftAux_contractLeftAux Q d m x fx #align clifford_algebra.contract_left_ι_mul CliffordAlgebra.contractLeft_ι_mul theorem contractRight_mul_ι (a : M) (b : CliffordAlgebra Q) : b * ι Q a⌊d = d a • b - b⌊d * ι Q a := by rw [contractRight_eq, reverse.map_mul, reverse_ι, contractLeft_ι_mul, map_sub, map_smul, reverse_reverse, reverse.map_mul, reverse_ι, contractRight_eq] #align clifford_algebra.contract_right_mul_ι CliffordAlgebra.contractRight_mul_ι theorem contractLeft_algebraMap_mul (r : R) (b : CliffordAlgebra Q) : d⌋(algebraMap _ _ r * b) = algebraMap _ _ r * (d⌋b) := by rw [← Algebra.smul_def, map_smul, Algebra.smul_def] #align clifford_algebra.contract_left_algebra_map_mul CliffordAlgebra.contractLeft_algebraMap_mul theorem contractLeft_mul_algebraMap (a : CliffordAlgebra Q) (r : R) : d⌋(a * algebraMap _ _ r) = d⌋a * algebraMap _ _ r := by rw [← Algebra.commutes, contractLeft_algebraMap_mul, Algebra.commutes] #align clifford_algebra.contract_left_mul_algebra_map CliffordAlgebra.contractLeft_mul_algebraMap theorem contractRight_algebraMap_mul (r : R) (b : CliffordAlgebra Q) : algebraMap _ _ r * b⌊d = algebraMap _ _ r * (b⌊d) := by rw [← Algebra.smul_def, LinearMap.map_smul₂, Algebra.smul_def] #align clifford_algebra.contract_right_algebra_map_mul CliffordAlgebra.contractRight_algebraMap_mul
Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean
159
161
theorem contractRight_mul_algebraMap (a : CliffordAlgebra Q) (r : R) : a * algebraMap _ _ r⌊d = a⌊d * algebraMap _ _ r := by
rw [← Algebra.commutes, contractRight_algebraMap_mul, Algebra.commutes]
[ " ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx", " d v • ((ι Q) v * x) - (ι Q) v * (d v • x - (ι Q) v * fx) = Q v • fx", " ((fun d => foldr' Q (contractLeftAux Q d) ⋯ 0) (d₁ + d₂)) x =\n ((fun d => foldr' Q (contractLeftAux Q d) ⋯ 0) d₁ + (fun d => foldr' Q (contractL...
[ " ((contractLeftAux Q d) v) ((ι Q) v * x, ((contractLeftAux Q d) v) (x, fx)) = Q v • fx", " d v • ((ι Q) v * x) - (ι Q) v * (d v • x - (ι Q) v * fx) = Q v • fx", " ((fun d => foldr' Q (contractLeftAux Q d) ⋯ 0) (d₁ + d₂)) x =\n ((fun d => foldr' Q (contractLeftAux Q d) ⋯ 0) d₁ + (fun d => foldr' Q (contractL...
import Mathlib.Probability.Notation import Mathlib.Probability.Independence.Basic import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic #align_import probability.conditional_expectation from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740" open TopologicalSpace Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory open ProbabilityTheory variable {Ω E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {m₁ m₂ m : MeasurableSpace Ω} {μ : Measure Ω} {f : Ω → E}
Mathlib/Probability/ConditionalExpectation.lean
40
77
theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinite (μ.trim hle₂)] (hf : StronglyMeasurable[m₁] f) (hindp : Indep m₁ m₂ μ) : μ[f|m₂] =ᵐ[μ] fun _ => μ[f] := by
by_cases hfint : Integrable f μ swap; · rw [condexp_undef hfint, integral_undef hfint]; rfl refine (ae_eq_condexp_of_forall_setIntegral_eq hle₂ hfint (fun s _ hs => integrableOn_const.2 (Or.inr hs)) (fun s hms hs => ?_) stronglyMeasurable_const.aeStronglyMeasurable').symm rw [setIntegral_const] rw [← memℒp_one_iff_integrable] at hfint refine Memℒp.induction_stronglyMeasurable hle₁ ENNReal.one_ne_top ?_ ?_ ?_ ?_ hfint ?_ · exact ⟨f, hf, EventuallyEq.rfl⟩ · intro c t hmt _ rw [Indep_iff] at hindp rw [integral_indicator (hle₁ _ hmt), setIntegral_const, smul_smul, ← ENNReal.toReal_mul, mul_comm, ← hindp _ _ hmt hms, setIntegral_indicator (hle₁ _ hmt), setIntegral_const, Set.inter_comm] · intro u v _ huint hvint hu hv hu_eq hv_eq rw [memℒp_one_iff_integrable] at huint hvint rw [integral_add' huint hvint, smul_add, hu_eq, hv_eq, integral_add' huint.integrableOn hvint.integrableOn] · have heq₁ : (fun f : lpMeas E ℝ m₁ 1 μ => ∫ x, (f : Ω → E) x ∂μ) = (fun f : Lp E 1 μ => ∫ x, f x ∂μ) ∘ Submodule.subtypeL _ := by refine funext fun f => integral_congr_ae ?_ simp_rw [Submodule.coe_subtypeL', Submodule.coeSubtype]; norm_cast have heq₂ : (fun f : lpMeas E ℝ m₁ 1 μ => ∫ x in s, (f : Ω → E) x ∂μ) = (fun f : Lp E 1 μ => ∫ x in s, f x ∂μ) ∘ Submodule.subtypeL _ := by refine funext fun f => integral_congr_ae (ae_restrict_of_ae ?_) simp_rw [Submodule.coe_subtypeL', Submodule.coeSubtype] exact eventually_of_forall fun _ => (by trivial) refine isClosed_eq (Continuous.const_smul ?_ _) ?_ · rw [heq₁] exact continuous_integral.comp (ContinuousLinearMap.continuous _) · rw [heq₂] exact (continuous_setIntegral _).comp (ContinuousLinearMap.continuous _) · intro u v huv _ hueq rwa [← integral_congr_ae huv, ← (setIntegral_congr_ae (hle₂ _ hms) _ : ∫ x in s, u x ∂μ = ∫ x in s, v x ∂μ)] filter_upwards [huv] with x hx _ using hx
[ " μ[f|m₂] =ᶠ[ae μ] fun x => ∫ (x : Ω), f x ∂μ", " 0 =ᶠ[ae μ] fun x => 0", " ∫ (x : Ω) in s, ∫ (x : Ω), f x ∂μ ∂μ = ∫ (x : Ω) in s, f x ∂μ", " (μ s).toReal • ∫ (x : Ω), f x ∂μ = ∫ (x : Ω) in s, f x ∂μ", " AEStronglyMeasurable' m₁ f μ", " ∀ (c : E) ⦃s_1 : Set Ω⦄,\n MeasurableSet s_1 →\n μ s_1 < ⊤ →\...
[ " μ[f|m₂] =ᶠ[ae μ] fun x => ∫ (x : Ω), f x ∂μ" ]
import Mathlib.CategoryTheory.Linear.LinearFunctor import Mathlib.CategoryTheory.Monoidal.Preadditive #align_import category_theory.monoidal.linear from "leanprover-community/mathlib"@"986c4d5761f938b2e1c43c01f001b6d9d88c2055" namespace CategoryTheory open CategoryTheory.Limits open CategoryTheory.MonoidalCategory variable (R : Type*) [Semiring R] variable (C : Type*) [Category C] [Preadditive C] [Linear R C] variable [MonoidalCategory C] -- Porting note: added `MonoidalPreadditive` as argument `` class MonoidalLinear [MonoidalPreadditive C] : Prop where whiskerLeft_smul : ∀ (X : C) {Y Z : C} (r : R) (f : Y ⟶ Z) , X ◁ (r • f) = r • (X ◁ f) := by aesop_cat smul_whiskerRight : ∀ (r : R) {Y Z : C} (f : Y ⟶ Z) (X : C), (r • f) ▷ X = r • (f ▷ X) := by aesop_cat #align category_theory.monoidal_linear CategoryTheory.MonoidalLinear attribute [simp] MonoidalLinear.whiskerLeft_smul MonoidalLinear.smul_whiskerRight variable {C} variable [MonoidalPreadditive C] [MonoidalLinear R C] instance tensorLeft_linear (X : C) : (tensorLeft X).Linear R where #align category_theory.tensor_left_linear CategoryTheory.tensorLeft_linear instance tensorRight_linear (X : C) : (tensorRight X).Linear R where #align category_theory.tensor_right_linear CategoryTheory.tensorRight_linear instance tensoringLeft_linear (X : C) : ((tensoringLeft C).obj X).Linear R where #align category_theory.tensoring_left_linear CategoryTheory.tensoringLeft_linear instance tensoringRight_linear (X : C) : ((tensoringRight C).obj X).Linear R where #align category_theory.tensoring_right_linear CategoryTheory.tensoringRight_linear
Mathlib/CategoryTheory/Monoidal/Linear.lean
58
70
theorem monoidalLinearOfFaithful {D : Type*} [Category D] [Preadditive D] [Linear R D] [MonoidalCategory D] [MonoidalPreadditive D] (F : MonoidalFunctor D C) [F.Faithful] [F.toFunctor.Additive] [F.toFunctor.Linear R] : MonoidalLinear R D := { whiskerLeft_smul := by
intros X Y Z r f apply F.toFunctor.map_injective rw [F.map_whiskerLeft] simp smul_whiskerRight := by intros r X Y f Z apply F.toFunctor.map_injective rw [F.map_whiskerRight] simp }
[ " ∀ (X : D) {Y Z : D} (r : R) (f : Y ⟶ Z), X ◁ (r • f) = r • X ◁ f", " X ◁ (r • f) = r • X ◁ f", " F.map (X ◁ (r • f)) = F.map (r • X ◁ f)", " inv (F.μ X Y) ≫ F.obj X ◁ F.map (r • f) ≫ F.μ X Z = F.map (r • X ◁ f)", " ∀ (r : R) {Y Z : D} (f : Y ⟶ Z) (X : D), (r • f) ▷ X = r • f ▷ X", " (r • f) ▷ Z = r • f ...
[ " ∀ (X : D) {Y Z : D} (r : R) (f : Y ⟶ Z), X ◁ (r • f) = r • X ◁ f" ]
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Preserves.Basic #align_import category_theory.limits.preserves.shapes.pullbacks from "leanprover-community/mathlib"@"f11e306adb9f2a393539d2bb4293bf1b42caa7ac" noncomputable section universe v₁ v₂ u₁ u₂ -- Porting note: need Functor namespace for mapCone open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Functor namespace CategoryTheory.Limits section Pushout variable {C : Type u₁} [Category.{v₁} C] variable {D : Type u₂} [Category.{v₂} D] variable (G : C ⥤ D) variable {W X Y Z : C} {h : X ⟶ Z} {k : Y ⟶ Z} {f : W ⟶ X} {g : W ⟶ Y} (comm : f ≫ h = g ≫ k) def isColimitMapCoconePushoutCoconeEquiv : IsColimit (mapCocone G (PushoutCocone.mk h k comm)) ≃ IsColimit (PushoutCocone.mk (G.map h) (G.map k) (by simp only [← G.map_comp, comm]) : PushoutCocone (G.map f) (G.map g)) := (IsColimit.precomposeHomEquiv (diagramIsoSpan.{v₂} _).symm _).symm.trans <| IsColimit.equivIsoColimit <| Cocones.ext (Iso.refl _) <| by rintro (_ | _ | _) <;> dsimp <;> simp only [Category.comp_id, Category.id_comp, ← G.map_comp] #align category_theory.limits.is_colimit_map_cocone_pushout_cocone_equiv CategoryTheory.Limits.isColimitMapCoconePushoutCoconeEquiv def isColimitPushoutCoconeMapOfIsColimit [PreservesColimit (span f g) G] (l : IsColimit (PushoutCocone.mk h k comm)) : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm] )) := isColimitMapCoconePushoutCoconeEquiv G comm (PreservesColimit.preserves l) #align category_theory.limits.is_colimit_pushout_cocone_map_of_is_colimit CategoryTheory.Limits.isColimitPushoutCoconeMapOfIsColimit def isColimitOfIsColimitPushoutCoconeMap [ReflectsColimit (span f g) G] (l : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm]))) : IsColimit (PushoutCocone.mk h k comm) := ReflectsColimit.reflects ((isColimitMapCoconePushoutCoconeEquiv G comm).symm l) #align category_theory.limits.is_colimit_of_is_colimit_pushout_cocone_map CategoryTheory.Limits.isColimitOfIsColimitPushoutCoconeMap variable (f g) [PreservesColimit (span f g) G] def isColimitOfHasPushoutOfPreservesColimit [i : HasPushout f g] : IsColimit (PushoutCocone.mk (G.map pushout.inl) (G.map (@pushout.inr _ _ _ _ _ f g i)) (show G.map f ≫ G.map pushout.inl = G.map g ≫ G.map pushout.inr from by simp only [← G.map_comp, pushout.condition])) := isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout f g) #align category_theory.limits.is_colimit_of_has_pushout_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasPushoutOfPreservesColimit def preservesPushoutSymmetry : PreservesColimit (span g f) G where preserves {c} hc := by apply (IsColimit.precomposeHomEquiv (diagramIsoSpan.{v₂} _).symm _).toFun apply IsColimit.ofIsoColimit _ (PushoutCocone.isoMk _).symm apply PushoutCocone.isColimitOfFlip apply (isColimitMapCoconePushoutCoconeEquiv _ _).toFun · refine @PreservesColimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_ -- Porting note: more TC coddling · dsimp infer_instance · exact PushoutCocone.flipIsColimit hc #align category_theory.limits.preserves_pushout_symmetry CategoryTheory.Limits.preservesPushoutSymmetry theorem hasPushout_of_preservesPushout [HasPushout f g] : HasPushout (G.map f) (G.map g) := ⟨⟨⟨_, isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout _ _)⟩⟩⟩ #align category_theory.limits.has_pushout_of_preserves_pushout CategoryTheory.Limits.hasPushout_of_preservesPushout variable [HasPushout f g] [HasPushout (G.map f) (G.map g)] def PreservesPushout.iso : pushout (G.map f) (G.map g) ≅ G.obj (pushout f g) := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (isColimitOfHasPushoutOfPreservesColimit G f g) #align category_theory.limits.preserves_pushout.iso CategoryTheory.Limits.PreservesPushout.iso @[simp] theorem PreservesPushout.iso_hom : (PreservesPushout.iso G f g).hom = pushoutComparison G f g := rfl #align category_theory.limits.preserves_pushout.iso_hom CategoryTheory.Limits.PreservesPushout.iso_hom @[reassoc] theorem PreservesPushout.inl_iso_hom : pushout.inl ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inl := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inl_iso_hom CategoryTheory.Limits.PreservesPushout.inl_iso_hom @[reassoc] theorem PreservesPushout.inr_iso_hom : pushout.inr ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inr := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inr_iso_hom CategoryTheory.Limits.PreservesPushout.inr_iso_hom @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean
239
241
theorem PreservesPushout.inl_iso_inv : G.map pushout.inl ≫ (PreservesPushout.iso G f g).inv = pushout.inl := by
simp [PreservesPushout.iso, Iso.comp_inv_eq]
[ " G.map f ≫ G.map h = G.map g ≫ G.map k", " ∀ (j : WalkingSpan),\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj (G.mapCocone (PushoutCocone.mk h k comm))).ι.app\n j ≫\n (Iso.refl\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj\n ...
[ " G.map f ≫ G.map h = G.map g ≫ G.map k", " ∀ (j : WalkingSpan),\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj (G.mapCocone (PushoutCocone.mk h k comm))).ι.app\n j ≫\n (Iso.refl\n ((Cocones.precompose (diagramIsoSpan (span f g ⋙ G)).symm.hom).obj\n ...
import Mathlib.Probability.Martingale.Basic #align_import probability.martingale.centering from "leanprover-community/mathlib"@"bea6c853b6edbd15e9d0941825abd04d77933ed0" open TopologicalSpace Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory variable {Ω E : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f : ℕ → Ω → E} {ℱ : Filtration ℕ m0} {n : ℕ} noncomputable def predictablePart {m0 : MeasurableSpace Ω} (f : ℕ → Ω → E) (ℱ : Filtration ℕ m0) (μ : Measure Ω) : ℕ → Ω → E := fun n => ∑ i ∈ Finset.range n, μ[f (i + 1) - f i|ℱ i] #align measure_theory.predictable_part MeasureTheory.predictablePart @[simp] theorem predictablePart_zero : predictablePart f ℱ μ 0 = 0 := by simp_rw [predictablePart, Finset.range_zero, Finset.sum_empty] #align measure_theory.predictable_part_zero MeasureTheory.predictablePart_zero theorem adapted_predictablePart : Adapted ℱ fun n => predictablePart f ℱ μ (n + 1) := fun _ => Finset.stronglyMeasurable_sum' _ fun _ hin => stronglyMeasurable_condexp.mono (ℱ.mono (Finset.mem_range_succ_iff.mp hin)) #align measure_theory.adapted_predictable_part MeasureTheory.adapted_predictablePart theorem adapted_predictablePart' : Adapted ℱ fun n => predictablePart f ℱ μ n := fun _ => Finset.stronglyMeasurable_sum' _ fun _ hin => stronglyMeasurable_condexp.mono (ℱ.mono (Finset.mem_range_le hin)) #align measure_theory.adapted_predictable_part' MeasureTheory.adapted_predictablePart' noncomputable def martingalePart {m0 : MeasurableSpace Ω} (f : ℕ → Ω → E) (ℱ : Filtration ℕ m0) (μ : Measure Ω) : ℕ → Ω → E := fun n => f n - predictablePart f ℱ μ n #align measure_theory.martingale_part MeasureTheory.martingalePart theorem martingalePart_add_predictablePart (ℱ : Filtration ℕ m0) (μ : Measure Ω) (f : ℕ → Ω → E) : martingalePart f ℱ μ + predictablePart f ℱ μ = f := sub_add_cancel _ _ #align measure_theory.martingale_part_add_predictable_part MeasureTheory.martingalePart_add_predictablePart theorem martingalePart_eq_sum : martingalePart f ℱ μ = fun n => f 0 + ∑ i ∈ Finset.range n, (f (i + 1) - f i - μ[f (i + 1) - f i|ℱ i]) := by unfold martingalePart predictablePart ext1 n rw [Finset.eq_sum_range_sub f n, ← add_sub, ← Finset.sum_sub_distrib] #align measure_theory.martingale_part_eq_sum MeasureTheory.martingalePart_eq_sum theorem adapted_martingalePart (hf : Adapted ℱ f) : Adapted ℱ (martingalePart f ℱ μ) := Adapted.sub hf adapted_predictablePart' #align measure_theory.adapted_martingale_part MeasureTheory.adapted_martingalePart
Mathlib/Probability/Martingale/Centering.lean
86
90
theorem integrable_martingalePart (hf_int : ∀ n, Integrable (f n) μ) (n : ℕ) : Integrable (martingalePart f ℱ μ n) μ := by
rw [martingalePart_eq_sum] exact (hf_int 0).add (integrable_finset_sum' _ fun i _ => ((hf_int _).sub (hf_int _)).sub integrable_condexp)
[ " predictablePart f ℱ μ 0 = 0", " martingalePart f ℱ μ = fun n => f 0 + ∑ i ∈ Finset.range n, (f (i + 1) - f i - μ[f (i + 1) - f i|↑ℱ i])", " (fun n => f n - ∑ i ∈ Finset.range n, μ[f (i + 1) - f i|↑ℱ i]) = fun n =>\n f 0 + ∑ i ∈ Finset.range n, (f (i + 1) - f i - μ[f (i + 1) - f i|↑ℱ i])", " f n - ∑ i ∈ F...
[ " predictablePart f ℱ μ 0 = 0", " martingalePart f ℱ μ = fun n => f 0 + ∑ i ∈ Finset.range n, (f (i + 1) - f i - μ[f (i + 1) - f i|↑ℱ i])", " (fun n => f n - ∑ i ∈ Finset.range n, μ[f (i + 1) - f i|↑ℱ i]) = fun n =>\n f 0 + ∑ i ∈ Finset.range n, (f (i + 1) - f i - μ[f (i + 1) - f i|↑ℱ i])", " f n - ∑ i ∈ F...
import Mathlib.Algebra.Group.Commute.Basic import Mathlib.Data.Fintype.Card import Mathlib.GroupTheory.Perm.Basic #align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Equiv Finset namespace Equiv.Perm variable {α : Type*} section support variable [DecidableEq α] [Fintype α] {f g : Perm α} def support (f : Perm α) : Finset α := univ.filter fun x => f x ≠ x #align equiv.perm.support Equiv.Perm.support @[simp]
Mathlib/GroupTheory/Perm/Support.lean
297
298
theorem mem_support {x : α} : x ∈ f.support ↔ f x ≠ x := by
rw [support, mem_filter, and_iff_right (mem_univ x)]
[ " x ∈ f.support ↔ f x ≠ x" ]
[ " x ∈ f.support ↔ f x ≠ x" ]
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Data.Set.Image import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp import Mathlib.MeasureTheory.Function.LpSeminorm.TriangleInequality import Mathlib.MeasureTheory.Measure.OpenPos import Mathlib.Topology.ContinuousFunction.Compact import Mathlib.Order.Filter.IndicatorFunction #align_import measure_theory.function.lp_space from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" noncomputable section set_option linter.uppercaseLean3 false open TopologicalSpace MeasureTheory Filter open scoped NNReal ENNReal Topology MeasureTheory Uniformity variable {α E F G : Type*} {m m0 : MeasurableSpace α} {p : ℝ≥0∞} {q : ℝ} {μ ν : Measure α} [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] namespace MeasureTheory @[simp] theorem snorm_aeeqFun {α E : Type*} [MeasurableSpace α] {μ : Measure α} [NormedAddCommGroup E] {p : ℝ≥0∞} {f : α → E} (hf : AEStronglyMeasurable f μ) : snorm (AEEqFun.mk f hf) p μ = snorm f p μ := snorm_congr_ae (AEEqFun.coeFn_mk _ _) #align measure_theory.snorm_ae_eq_fun MeasureTheory.snorm_aeeqFun theorem Memℒp.snorm_mk_lt_top {α E : Type*} [MeasurableSpace α] {μ : Measure α} [NormedAddCommGroup E] {p : ℝ≥0∞} {f : α → E} (hfp : Memℒp f p μ) : snorm (AEEqFun.mk f hfp.1) p μ < ∞ := by simp [hfp.2] #align measure_theory.mem_ℒp.snorm_mk_lt_top MeasureTheory.Memℒp.snorm_mk_lt_top def Lp {α} (E : Type*) {m : MeasurableSpace α} [NormedAddCommGroup E] (p : ℝ≥0∞) (μ : Measure α := by volume_tac) : AddSubgroup (α →ₘ[μ] E) where carrier := { f | snorm f p μ < ∞ } zero_mem' := by simp [snorm_congr_ae AEEqFun.coeFn_zero, snorm_zero] add_mem' {f g} hf hg := by simp [snorm_congr_ae (AEEqFun.coeFn_add f g), snorm_add_lt_top ⟨f.aestronglyMeasurable, hf⟩ ⟨g.aestronglyMeasurable, hg⟩] neg_mem' {f} hf := by rwa [Set.mem_setOf_eq, snorm_congr_ae (AEEqFun.coeFn_neg f), snorm_neg] #align measure_theory.Lp MeasureTheory.Lp -- Porting note: calling the first argument `α` breaks the `(α := ·)` notation scoped notation:25 α' " →₁[" μ "] " E => MeasureTheory.Lp (α := α') E 1 μ scoped notation:25 α' " →₂[" μ "] " E => MeasureTheory.Lp (α := α') E 2 μ namespace Memℒp def toLp (f : α → E) (h_mem_ℒp : Memℒp f p μ) : Lp E p μ := ⟨AEEqFun.mk f h_mem_ℒp.1, h_mem_ℒp.snorm_mk_lt_top⟩ #align measure_theory.mem_ℒp.to_Lp MeasureTheory.Memℒp.toLp theorem coeFn_toLp {f : α → E} (hf : Memℒp f p μ) : hf.toLp f =ᵐ[μ] f := AEEqFun.coeFn_mk _ _ #align measure_theory.mem_ℒp.coe_fn_to_Lp MeasureTheory.Memℒp.coeFn_toLp
Mathlib/MeasureTheory/Function/LpSpace.lean
126
127
theorem toLp_congr {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) (hfg : f =ᵐ[μ] g) : hf.toLp f = hg.toLp g := by
simp [toLp, hfg]
[ " snorm (↑(AEEqFun.mk f ⋯)) p μ < ⊤", " f + g ∈ {f | snorm (↑f) p μ < ⊤}", " 0 ∈ { carrier := {f | snorm (↑f) p μ < ⊤}, add_mem' := ⋯ }.carrier", " -f ∈ { carrier := {f | snorm (↑f) p μ < ⊤}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier", " toLp f hf = toLp g hg" ]
[ " snorm (↑(AEEqFun.mk f ⋯)) p μ < ⊤", " f + g ∈ {f | snorm (↑f) p μ < ⊤}", " 0 ∈ { carrier := {f | snorm (↑f) p μ < ⊤}, add_mem' := ⋯ }.carrier", " -f ∈ { carrier := {f | snorm (↑f) p μ < ⊤}, add_mem' := ⋯, zero_mem' := ⋯ }.carrier", " toLp f hf = toLp g hg" ]
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ι : Sort*} {𝕜 E : Type*} section OrderedSemiring variable (𝕜) [OrderedSemiring 𝕜] [AddCommMonoid E] [Module 𝕜 E] {s t s₁ s₂ t₁ t₂ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment 𝕜 x y #align convex_join convexJoin variable {𝕜} theorem mem_convexJoin : x ∈ convexJoin 𝕜 s t ↔ ∃ a ∈ s, ∃ b ∈ t, x ∈ segment 𝕜 a b := by simp [convexJoin] #align mem_convex_join mem_convexJoin theorem convexJoin_comm (s t : Set E) : convexJoin 𝕜 s t = convexJoin 𝕜 t s := (iUnion₂_comm _).trans <| by simp_rw [convexJoin, segment_symm] #align convex_join_comm convexJoin_comm theorem convexJoin_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : convexJoin 𝕜 s₁ t₁ ⊆ convexJoin 𝕜 s₂ t₂ := biUnion_mono hs fun _ _ => biUnion_subset_biUnion_left ht #align convex_join_mono convexJoin_mono theorem convexJoin_mono_left (hs : s₁ ⊆ s₂) : convexJoin 𝕜 s₁ t ⊆ convexJoin 𝕜 s₂ t := convexJoin_mono hs Subset.rfl #align convex_join_mono_left convexJoin_mono_left theorem convexJoin_mono_right (ht : t₁ ⊆ t₂) : convexJoin 𝕜 s t₁ ⊆ convexJoin 𝕜 s t₂ := convexJoin_mono Subset.rfl ht #align convex_join_mono_right convexJoin_mono_right @[simp] theorem convexJoin_empty_left (t : Set E) : convexJoin 𝕜 ∅ t = ∅ := by simp [convexJoin] #align convex_join_empty_left convexJoin_empty_left @[simp] theorem convexJoin_empty_right (s : Set E) : convexJoin 𝕜 s ∅ = ∅ := by simp [convexJoin] #align convex_join_empty_right convexJoin_empty_right @[simp] theorem convexJoin_singleton_left (t : Set E) (x : E) : convexJoin 𝕜 {x} t = ⋃ y ∈ t, segment 𝕜 x y := by simp [convexJoin] #align convex_join_singleton_left convexJoin_singleton_left @[simp] theorem convexJoin_singleton_right (s : Set E) (y : E) : convexJoin 𝕜 s {y} = ⋃ x ∈ s, segment 𝕜 x y := by simp [convexJoin] #align convex_join_singleton_right convexJoin_singleton_right -- Porting note (#10618): simp can prove it theorem convexJoin_singletons (x : E) : convexJoin 𝕜 {x} {y} = segment 𝕜 x y := by simp #align convex_join_singletons convexJoin_singletons @[simp] theorem convexJoin_union_left (s₁ s₂ t : Set E) : convexJoin 𝕜 (s₁ ∪ s₂) t = convexJoin 𝕜 s₁ t ∪ convexJoin 𝕜 s₂ t := by simp_rw [convexJoin, mem_union, iUnion_or, iUnion_union_distrib] #align convex_join_union_left convexJoin_union_left @[simp] theorem convexJoin_union_right (s t₁ t₂ : Set E) : convexJoin 𝕜 s (t₁ ∪ t₂) = convexJoin 𝕜 s t₁ ∪ convexJoin 𝕜 s t₂ := by simp_rw [convexJoin_comm s, convexJoin_union_left] #align convex_join_union_right convexJoin_union_right @[simp] theorem convexJoin_iUnion_left (s : ι → Set E) (t : Set E) : convexJoin 𝕜 (⋃ i, s i) t = ⋃ i, convexJoin 𝕜 (s i) t := by simp_rw [convexJoin, mem_iUnion, iUnion_exists] exact iUnion_comm _ #align convex_join_Union_left convexJoin_iUnion_left @[simp]
Mathlib/Analysis/Convex/Join.lean
98
100
theorem convexJoin_iUnion_right (s : Set E) (t : ι → Set E) : convexJoin 𝕜 s (⋃ i, t i) = ⋃ i, convexJoin 𝕜 s (t i) := by
simp_rw [convexJoin_comm s, convexJoin_iUnion_left]
[ " x ∈ convexJoin 𝕜 s t ↔ ∃ a ∈ s, ∃ b ∈ t, x ∈ segment 𝕜 a b", " ⋃ i₂ ∈ t, ⋃ i₁ ∈ s, segment 𝕜 i₁ i₂ = convexJoin 𝕜 t s", " convexJoin 𝕜 ∅ t = ∅", " convexJoin 𝕜 s ∅ = ∅", " convexJoin 𝕜 {x} t = ⋃ y ∈ t, segment 𝕜 x y", " convexJoin 𝕜 s {y} = ⋃ x ∈ s, segment 𝕜 x y", " convexJoin 𝕜 {x} {y} = ...
[ " x ∈ convexJoin 𝕜 s t ↔ ∃ a ∈ s, ∃ b ∈ t, x ∈ segment 𝕜 a b", " ⋃ i₂ ∈ t, ⋃ i₁ ∈ s, segment 𝕜 i₁ i₂ = convexJoin 𝕜 t s", " convexJoin 𝕜 ∅ t = ∅", " convexJoin 𝕜 s ∅ = ∅", " convexJoin 𝕜 {x} t = ⋃ y ∈ t, segment 𝕜 x y", " convexJoin 𝕜 s {y} = ⋃ x ∈ s, segment 𝕜 x y", " convexJoin 𝕜 {x} {y} = ...
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Monic import Mathlib.Algebra.Ring.Action.Basic import Mathlib.GroupTheory.GroupAction.Hom import Mathlib.GroupTheory.GroupAction.Quotient #align_import algebra.polynomial.group_ring_action from "leanprover-community/mathlib"@"afad8e438d03f9d89da2914aa06cb4964ba87a18" variable (M : Type*) [Monoid M] open Polynomial namespace Polynomial variable (R : Type*) [Semiring R] variable {M} -- Porting note: changed `(· • ·) m` to `HSMul.hSMul m` theorem smul_eq_map [MulSemiringAction M R] (m : M) : HSMul.hSMul m = map (MulSemiringAction.toRingHom M R m) := by suffices DistribMulAction.toAddMonoidHom R[X] m = (mapRingHom (MulSemiringAction.toRingHom M R m)).toAddMonoidHom by ext1 r exact DFunLike.congr_fun this r ext n r : 2 change m • monomial n r = map (MulSemiringAction.toRingHom M R m) (monomial n r) rw [Polynomial.map_monomial, Polynomial.smul_monomial, MulSemiringAction.toRingHom_apply] #align polynomial.smul_eq_map Polynomial.smul_eq_map variable (M) noncomputable instance [MulSemiringAction M R] : MulSemiringAction M R[X] := { Polynomial.distribMulAction with smul_one := fun m ↦ smul_eq_map R m ▸ Polynomial.map_one (MulSemiringAction.toRingHom M R m) smul_mul := fun m _ _ ↦ smul_eq_map R m ▸ Polynomial.map_mul (MulSemiringAction.toRingHom M R m) } variable {M R} variable [MulSemiringAction M R] @[simp] theorem smul_X (m : M) : (m • X : R[X]) = X := (smul_eq_map R m).symm ▸ map_X _ set_option linter.uppercaseLean3 false in #align polynomial.smul_X Polynomial.smul_X variable (S : Type*) [CommSemiring S] [MulSemiringAction M S] theorem smul_eval_smul (m : M) (f : S[X]) (x : S) : (m • f).eval (m • x) = m • f.eval x := Polynomial.induction_on f (fun r ↦ by rw [smul_C, eval_C, eval_C]) (fun f g ihf ihg ↦ by rw [smul_add, eval_add, ihf, ihg, eval_add, smul_add]) fun n r _ ↦ by rw [smul_mul', smul_pow', smul_C, smul_X, eval_mul, eval_C, eval_pow, eval_X, eval_mul, eval_C, eval_pow, eval_X, smul_mul', smul_pow'] #align polynomial.smul_eval_smul Polynomial.smul_eval_smul variable (G : Type*) [Group G] theorem eval_smul' [MulSemiringAction G S] (g : G) (f : S[X]) (x : S) : f.eval (g • x) = g • (g⁻¹ • f).eval x := by rw [← smul_eval_smul, smul_inv_smul] #align polynomial.eval_smul' Polynomial.eval_smul'
Mathlib/Algebra/Polynomial/GroupRingAction.lean
76
78
theorem smul_eval [MulSemiringAction G S] (g : G) (f : S[X]) (x : S) : (g • f).eval x = g • f.eval (g⁻¹ • x) := by
rw [← smul_eval_smul, smul_inv_smul]
[ " HSMul.hSMul m = map (MulSemiringAction.toRingHom M R m)", " m • r = map (MulSemiringAction.toRingHom M R m) r", " DistribMulAction.toAddMonoidHom R[X] m = (mapRingHom (MulSemiringAction.toRingHom M R m)).toAddMonoidHom", " ((DistribMulAction.toAddMonoidHom R[X] m).comp (monomial n).toAddMonoidHom) r =\n ...
[ " HSMul.hSMul m = map (MulSemiringAction.toRingHom M R m)", " m • r = map (MulSemiringAction.toRingHom M R m) r", " DistribMulAction.toAddMonoidHom R[X] m = (mapRingHom (MulSemiringAction.toRingHom M R m)).toAddMonoidHom", " ((DistribMulAction.toAddMonoidHom R[X] m).comp (monomial n).toAddMonoidHom) r =\n ...
import Mathlib.NumberTheory.Cyclotomic.Discriminant import Mathlib.RingTheory.Polynomial.Eisenstein.IsIntegral import Mathlib.RingTheory.Ideal.Norm #align_import number_theory.cyclotomic.rat from "leanprover-community/mathlib"@"b353176c24d96c23f0ce1cc63efc3f55019702d9" universe u open Algebra IsCyclotomicExtension Polynomial NumberField open scoped Cyclotomic Nat variable {p : ℕ+} {k : ℕ} {K : Type u} [Field K] [CharZero K] {ζ : K} [hp : Fact (p : ℕ).Prime] namespace IsCyclotomicExtension.Rat theorem discr_prime_pow_ne_two' [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) (hk : p ^ (k + 1) ≠ 2) : discr ℚ (hζ.subOnePowerBasis ℚ).basis = (-1) ^ ((p ^ (k + 1) : ℕ).totient / 2) * p ^ ((p : ℕ) ^ k * ((p - 1) * (k + 1) - 1)) := by rw [← discr_prime_pow_ne_two hζ (cyclotomic.irreducible_rat (p ^ (k + 1)).pos) hk] exact hζ.discr_zeta_eq_discr_zeta_sub_one.symm #align is_cyclotomic_extension.rat.discr_prime_pow_ne_two' IsCyclotomicExtension.Rat.discr_prime_pow_ne_two' theorem discr_odd_prime' [IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) (hodd : p ≠ 2) : discr ℚ (hζ.subOnePowerBasis ℚ).basis = (-1) ^ (((p : ℕ) - 1) / 2) * p ^ ((p : ℕ) - 2) := by rw [← discr_odd_prime hζ (cyclotomic.irreducible_rat hp.out.pos) hodd] exact hζ.discr_zeta_eq_discr_zeta_sub_one.symm #align is_cyclotomic_extension.rat.discr_odd_prime' IsCyclotomicExtension.Rat.discr_odd_prime' theorem discr_prime_pow' [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) : discr ℚ (hζ.subOnePowerBasis ℚ).basis = (-1) ^ ((p ^ k : ℕ).totient / 2) * p ^ ((p : ℕ) ^ (k - 1) * ((p - 1) * k - 1)) := by rw [← discr_prime_pow hζ (cyclotomic.irreducible_rat (p ^ k).pos)] exact hζ.discr_zeta_eq_discr_zeta_sub_one.symm #align is_cyclotomic_extension.rat.discr_prime_pow' IsCyclotomicExtension.Rat.discr_prime_pow' theorem discr_prime_pow_eq_unit_mul_pow' [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) : ∃ (u : ℤˣ) (n : ℕ), discr ℚ (hζ.subOnePowerBasis ℚ).basis = u * p ^ n := by rw [hζ.discr_zeta_eq_discr_zeta_sub_one.symm] exact discr_prime_pow_eq_unit_mul_pow hζ (cyclotomic.irreducible_rat (p ^ k).pos) #align is_cyclotomic_extension.rat.discr_prime_pow_eq_unit_mul_pow' IsCyclotomicExtension.Rat.discr_prime_pow_eq_unit_mul_pow'
Mathlib/NumberTheory/Cyclotomic/Rat.lean
74
119
theorem isIntegralClosure_adjoin_singleton_of_prime_pow [hcycl : IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) : IsIntegralClosure (adjoin ℤ ({ζ} : Set K)) ℤ K := by
refine ⟨Subtype.val_injective, @fun x => ⟨fun h => ⟨⟨x, ?_⟩, rfl⟩, ?_⟩⟩ swap · rintro ⟨y, rfl⟩ exact IsIntegral.algebraMap ((le_integralClosure_iff_isIntegral.1 (adjoin_le_integralClosure (hζ.isIntegral (p ^ k).pos))).isIntegral _) let B := hζ.subOnePowerBasis ℚ have hint : IsIntegral ℤ B.gen := (hζ.isIntegral (p ^ k).pos).sub isIntegral_one -- Porting note: the following `haveI` was not needed because the locale `cyclotomic` set it -- as instances. letI := IsCyclotomicExtension.finiteDimensional {p ^ k} ℚ K have H := discr_mul_isIntegral_mem_adjoin ℚ hint h obtain ⟨u, n, hun⟩ := discr_prime_pow_eq_unit_mul_pow' hζ rw [hun] at H replace H := Subalgebra.smul_mem _ H u.inv -- Porting note: the proof is slightly different because of coercions. rw [← smul_assoc, ← smul_mul_assoc, Units.inv_eq_val_inv, zsmul_eq_mul, ← Int.cast_mul, Units.inv_mul, Int.cast_one, one_mul, smul_def, map_pow] at H cases k · haveI : IsCyclotomicExtension {1} ℚ K := by simpa using hcycl have : x ∈ (⊥ : Subalgebra ℚ K) := by rw [singleton_one ℚ K] exact mem_top obtain ⟨y, rfl⟩ := mem_bot.1 this replace h := (isIntegral_algebraMap_iff (algebraMap ℚ K).injective).1 h obtain ⟨z, hz⟩ := IsIntegrallyClosed.isIntegral_iff.1 h rw [← hz, ← IsScalarTower.algebraMap_apply] exact Subalgebra.algebraMap_mem _ _ · have hmin : (minpoly ℤ B.gen).IsEisensteinAt (Submodule.span ℤ {((p : ℕ) : ℤ)}) := by have h₁ := minpoly.isIntegrallyClosed_eq_field_fractions' ℚ hint have h₂ := hζ.minpoly_sub_one_eq_cyclotomic_comp (cyclotomic.irreducible_rat (p ^ _).pos) rw [IsPrimitiveRoot.subOnePowerBasis_gen] at h₁ rw [h₁, ← map_cyclotomic_int, show Int.castRingHom ℚ = algebraMap ℤ ℚ by rfl, show X + 1 = map (algebraMap ℤ ℚ) (X + 1) by simp, ← map_comp] at h₂ rw [IsPrimitiveRoot.subOnePowerBasis_gen, map_injective (algebraMap ℤ ℚ) (algebraMap ℤ ℚ).injective_int h₂] exact cyclotomic_prime_pow_comp_X_add_one_isEisensteinAt p _ refine adjoin_le ?_ (mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt (n := n) (Nat.prime_iff_prime_int.1 hp.out) hint h (by simpa using H) hmin) simp only [Set.singleton_subset_iff, SetLike.mem_coe] exact Subalgebra.sub_mem _ (self_mem_adjoin_singleton ℤ _) (Subalgebra.one_mem _)
[ " Algebra.discr ℚ ⇑(IsPrimitiveRoot.subOnePowerBasis ℚ hζ).basis =\n (-1) ^ (φ (↑p ^ (k + 1)) / 2) * ↑↑p ^ (↑p ^ k * ((↑p - 1) * (k + 1) - 1))", " Algebra.discr ℚ ⇑(IsPrimitiveRoot.subOnePowerBasis ℚ hζ).basis =\n Algebra.discr ℚ ⇑(IsPrimitiveRoot.powerBasis ℚ hζ).basis", " Algebra.discr ℚ ⇑(IsPrimitiveRo...
[ " Algebra.discr ℚ ⇑(IsPrimitiveRoot.subOnePowerBasis ℚ hζ).basis =\n (-1) ^ (φ (↑p ^ (k + 1)) / 2) * ↑↑p ^ (↑p ^ k * ((↑p - 1) * (k + 1) - 1))", " Algebra.discr ℚ ⇑(IsPrimitiveRoot.subOnePowerBasis ℚ hζ).basis =\n Algebra.discr ℚ ⇑(IsPrimitiveRoot.powerBasis ℚ hζ).basis", " Algebra.discr ℚ ⇑(IsPrimitiveRo...
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Algebra.SMulWithZero import Mathlib.Data.Nat.PartENat import Mathlib.Tactic.Linarith #align_import ring_theory.multiplicity from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" variable {α β : Type*} open Nat Part def multiplicity [Monoid α] [DecidableRel ((· ∣ ·) : α → α → Prop)] (a b : α) : PartENat := PartENat.find fun n => ¬a ^ (n + 1) ∣ b #align multiplicity multiplicity namespace multiplicity section Monoid variable [Monoid α] [Monoid β] abbrev Finite (a b : α) : Prop := ∃ n : ℕ, ¬a ^ (n + 1) ∣ b #align multiplicity.finite multiplicity.Finite theorem finite_iff_dom [DecidableRel ((· ∣ ·) : α → α → Prop)] {a b : α} : Finite a b ↔ (multiplicity a b).Dom := Iff.rfl #align multiplicity.finite_iff_dom multiplicity.finite_iff_dom theorem finite_def {a b : α} : Finite a b ↔ ∃ n : ℕ, ¬a ^ (n + 1) ∣ b := Iff.rfl #align multiplicity.finite_def multiplicity.finite_def theorem not_dvd_one_of_finite_one_right {a : α} : Finite a 1 → ¬a ∣ 1 := fun ⟨n, hn⟩ ⟨d, hd⟩ => hn ⟨d ^ (n + 1), (pow_mul_pow_eq_one (n + 1) hd.symm).symm⟩ #align multiplicity.not_dvd_one_of_finite_one_right multiplicity.not_dvd_one_of_finite_one_right @[norm_cast] theorem Int.natCast_multiplicity (a b : ℕ) : multiplicity (a : ℤ) (b : ℤ) = multiplicity a b := by apply Part.ext' · rw [← @finite_iff_dom ℕ, @finite_def ℕ, ← @finite_iff_dom ℤ, @finite_def ℤ] norm_cast · intro h1 h2 apply _root_.le_antisymm <;> · apply Nat.find_mono norm_cast simp #align multiplicity.int.coe_nat_multiplicity multiplicity.Int.natCast_multiplicity @[deprecated (since := "2024-04-05")] alias Int.coe_nat_multiplicity := Int.natCast_multiplicity theorem not_finite_iff_forall {a b : α} : ¬Finite a b ↔ ∀ n : ℕ, a ^ n ∣ b := ⟨fun h n => Nat.casesOn n (by rw [_root_.pow_zero] exact one_dvd _) (by simpa [Finite, Classical.not_not] using h), by simp [Finite, multiplicity, Classical.not_not]; tauto⟩ #align multiplicity.not_finite_iff_forall multiplicity.not_finite_iff_forall theorem not_unit_of_finite {a b : α} (h : Finite a b) : ¬IsUnit a := let ⟨n, hn⟩ := h hn ∘ IsUnit.dvd ∘ IsUnit.pow (n + 1) #align multiplicity.not_unit_of_finite multiplicity.not_unit_of_finite theorem finite_of_finite_mul_right {a b c : α} : Finite a (b * c) → Finite a b := fun ⟨n, hn⟩ => ⟨n, fun h => hn (h.trans (dvd_mul_right _ _))⟩ #align multiplicity.finite_of_finite_mul_right multiplicity.finite_of_finite_mul_right variable [DecidableRel ((· ∣ ·) : α → α → Prop)] [DecidableRel ((· ∣ ·) : β → β → Prop)] theorem pow_dvd_of_le_multiplicity {a b : α} {k : ℕ} : (k : PartENat) ≤ multiplicity a b → a ^ k ∣ b := by rw [← PartENat.some_eq_natCast] exact Nat.casesOn k (fun _ => by rw [_root_.pow_zero] exact one_dvd _) fun k ⟨_, h₂⟩ => by_contradiction fun hk => Nat.find_min _ (lt_of_succ_le (h₂ ⟨k, hk⟩)) hk #align multiplicity.pow_dvd_of_le_multiplicity multiplicity.pow_dvd_of_le_multiplicity theorem pow_multiplicity_dvd {a b : α} (h : Finite a b) : a ^ get (multiplicity a b) h ∣ b := pow_dvd_of_le_multiplicity (by rw [PartENat.natCast_get]) #align multiplicity.pow_multiplicity_dvd multiplicity.pow_multiplicity_dvd theorem is_greatest {a b : α} {m : ℕ} (hm : multiplicity a b < m) : ¬a ^ m ∣ b := fun h => by rw [PartENat.lt_coe_iff] at hm; exact Nat.find_spec hm.fst ((pow_dvd_pow _ hm.snd).trans h) #align multiplicity.is_greatest multiplicity.is_greatest theorem is_greatest' {a b : α} {m : ℕ} (h : Finite a b) (hm : get (multiplicity a b) h < m) : ¬a ^ m ∣ b := is_greatest (by rwa [← PartENat.coe_lt_coe, PartENat.natCast_get] at hm) #align multiplicity.is_greatest' multiplicity.is_greatest'
Mathlib/RingTheory/Multiplicity.lean
123
126
theorem pos_of_dvd {a b : α} (hfin : Finite a b) (hdiv : a ∣ b) : 0 < (multiplicity a b).get hfin := by
refine zero_lt_iff.2 fun h => ?_ simpa [hdiv] using is_greatest' hfin (lt_one_iff.mpr h)
[ " multiplicity ↑a ↑b = multiplicity a b", " (multiplicity ↑a ↑b).Dom ↔ (multiplicity a b).Dom", " (∃ n, ¬↑a ^ (n + 1) ∣ ↑b) ↔ ∃ n, ¬a ^ (n + 1) ∣ b", " ∀ (h₁ : (multiplicity ↑a ↑b).Dom) (h₂ : (multiplicity a b).Dom),\n (multiplicity ↑a ↑b).get h₁ = (multiplicity a b).get h₂", " (multiplicity ↑a ↑b).get h...
[ " multiplicity ↑a ↑b = multiplicity a b", " (multiplicity ↑a ↑b).Dom ↔ (multiplicity a b).Dom", " (∃ n, ¬↑a ^ (n + 1) ∣ ↑b) ↔ ∃ n, ¬a ^ (n + 1) ∣ b", " ∀ (h₁ : (multiplicity ↑a ↑b).Dom) (h₂ : (multiplicity a b).Dom),\n (multiplicity ↑a ↑b).get h₁ = (multiplicity a b).get h₂", " (multiplicity ↑a ↑b).get h...
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.MvPolynomial.Variables import Mathlib.Algebra.MvPolynomial.CommRing import Mathlib.Algebra.MvPolynomial.Expand import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.ZMod.Basic #align_import ring_theory.witt_vector.witt_polynomial from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395" open MvPolynomial open Finset hiding map open Finsupp (single) --attribute [-simp] coe_eval₂_hom variable (p : ℕ) variable (R : Type*) [CommRing R] [DecidableEq R] noncomputable def wittPolynomial (n : ℕ) : MvPolynomial ℕ R := ∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i) #align witt_polynomial wittPolynomial theorem wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) : wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by apply sum_congr rfl rintro i - rw [monomial_eq, Finsupp.prod_single_index] rw [pow_zero] set_option linter.uppercaseLean3 false in #align witt_polynomial_eq_sum_C_mul_X_pow wittPolynomial_eq_sum_C_mul_X_pow -- Notation with ring of coefficients explicit set_option quotPrecheck false in @[inherit_doc] scoped[Witt] notation "W_" => wittPolynomial p -- Notation with ring of coefficients implicit set_option quotPrecheck false in @[inherit_doc] scoped[Witt] notation "W" => wittPolynomial p _ open Witt open MvPolynomial section variable {R} {S : Type*} [CommRing S] @[simp] theorem map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by rw [wittPolynomial, map_sum, wittPolynomial] refine sum_congr rfl fun i _ => ?_ rw [map_monomial, RingHom.map_pow, map_natCast] #align map_witt_polynomial map_wittPolynomial variable (R) @[simp] theorem constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) : constantCoeff (wittPolynomial p R n) = 0 := by simp only [wittPolynomial, map_sum, constantCoeff_monomial] rw [sum_eq_zero] rintro i _ rw [if_neg] rw [Finsupp.single_eq_zero] exact ne_of_gt (pow_pos hp.1.pos _) #align constant_coeff_witt_polynomial constantCoeff_wittPolynomial @[simp] theorem wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self] #align witt_polynomial_zero wittPolynomial_zero @[simp] theorem wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton, one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero] #align witt_polynomial_one wittPolynomial_one theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) : aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by simp [wittPolynomial, AlgHom.map_sum, aeval_monomial, Finsupp.prod_single_index] #align aeval_witt_polynomial aeval_wittPolynomial @[simp]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
154
163
theorem wittPolynomial_zmod_self (n : ℕ) : W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by
simp only [wittPolynomial_eq_sum_C_mul_X_pow] rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0, zero_mul, add_zero, AlgHom.map_sum, sum_congr rfl] intro k hk rw [AlgHom.map_mul, AlgHom.map_pow, expand_X, algHom_C, ← pow_mul, ← pow_succ'] congr rw [mem_range] at hk rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
[ " wittPolynomial p R n = ∑ i ∈ range (n + 1), C (↑p ^ i) * X i ^ p ^ (n - i)", " ∀ x ∈ range (n + 1), (monomial (single x (p ^ (n - x)))) (↑p ^ x) = C (↑p ^ x) * X x ^ p ^ (n - x)", " (monomial (single i (p ^ (n - i)))) (↑p ^ i) = C (↑p ^ i) * X i ^ p ^ (n - i)", " X i ^ 0 = 1", " (map f) (W_ R n) = W_ S n"...
[ " wittPolynomial p R n = ∑ i ∈ range (n + 1), C (↑p ^ i) * X i ^ p ^ (n - i)", " ∀ x ∈ range (n + 1), (monomial (single x (p ^ (n - x)))) (↑p ^ x) = C (↑p ^ x) * X x ^ p ^ (n - x)", " (monomial (single i (p ^ (n - i)))) (↑p ^ i) = C (↑p ^ i) * X i ^ p ^ (n - i)", " X i ^ 0 = 1", " (map f) (W_ R n) = W_ S n"...
import Mathlib.MeasureTheory.Function.StronglyMeasurable.Lp import Mathlib.MeasureTheory.Integral.Bochner import Mathlib.Order.Filter.IndicatorFunction import Mathlib.MeasureTheory.Function.StronglyMeasurable.Inner import Mathlib.MeasureTheory.Function.LpSeminorm.Trim #align_import measure_theory.function.conditional_expectation.ae_measurable from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" set_option linter.uppercaseLean3 false open TopologicalSpace Filter open scoped ENNReal MeasureTheory namespace MeasureTheory def AEStronglyMeasurable' {α β} [TopologicalSpace β] (m : MeasurableSpace α) {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) : Prop := ∃ g : α → β, StronglyMeasurable[m] g ∧ f =ᵐ[μ] g #align measure_theory.ae_strongly_measurable' MeasureTheory.AEStronglyMeasurable' namespace AEStronglyMeasurable' variable {α β 𝕜 : Type*} {m m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β] {f g : α → β} theorem congr (hf : AEStronglyMeasurable' m f μ) (hfg : f =ᵐ[μ] g) : AEStronglyMeasurable' m g μ := by obtain ⟨f', hf'_meas, hff'⟩ := hf; exact ⟨f', hf'_meas, hfg.symm.trans hff'⟩ #align measure_theory.ae_strongly_measurable'.congr MeasureTheory.AEStronglyMeasurable'.congr theorem mono {m'} (hf : AEStronglyMeasurable' m f μ) (hm : m ≤ m') : AEStronglyMeasurable' m' f μ := let ⟨f', hf'_meas, hff'⟩ := hf; ⟨f', hf'_meas.mono hm, hff'⟩ theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ) (hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by rcases hf with ⟨f', h_f'_meas, hff'⟩ rcases hg with ⟨g', h_g'_meas, hgg'⟩ exact ⟨f' + g', h_f'_meas.add h_g'_meas, hff'.add hgg'⟩ #align measure_theory.ae_strongly_measurable'.add MeasureTheory.AEStronglyMeasurable'.add theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) : AEStronglyMeasurable' m (-f) μ := by rcases hfm with ⟨f', hf'_meas, hf_ae⟩ refine ⟨-f', hf'_meas.neg, hf_ae.mono fun x hx => ?_⟩ simp_rw [Pi.neg_apply] rw [hx] #align measure_theory.ae_strongly_measurable'.neg MeasureTheory.AEStronglyMeasurable'.neg theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by rcases hfm with ⟨f', hf'_meas, hf_ae⟩ rcases hgm with ⟨g', hg'_meas, hg_ae⟩ refine ⟨f' - g', hf'_meas.sub hg'_meas, hf_ae.mp (hg_ae.mono fun x hx1 hx2 => ?_)⟩ simp_rw [Pi.sub_apply] rw [hx1, hx2] #align measure_theory.ae_strongly_measurable'.sub MeasureTheory.AEStronglyMeasurable'.sub theorem const_smul [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (c : 𝕜) (hf : AEStronglyMeasurable' m f μ) : AEStronglyMeasurable' m (c • f) μ := by rcases hf with ⟨f', h_f'_meas, hff'⟩ refine ⟨c • f', h_f'_meas.const_smul c, ?_⟩ exact EventuallyEq.fun_comp hff' fun x => c • x #align measure_theory.ae_strongly_measurable'.const_smul MeasureTheory.AEStronglyMeasurable'.const_smul
Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean
102
110
theorem const_inner {𝕜 β} [RCLike 𝕜] [NormedAddCommGroup β] [InnerProductSpace 𝕜 β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) (c : β) : AEStronglyMeasurable' m (fun x => (inner c (f x) : 𝕜)) μ := by
rcases hfm with ⟨f', hf'_meas, hf_ae⟩ refine ⟨fun x => (inner c (f' x) : 𝕜), (@stronglyMeasurable_const _ _ m _ c).inner hf'_meas, hf_ae.mono fun x hx => ?_⟩ dsimp only rw [hx]
[ " AEStronglyMeasurable' m g μ", " AEStronglyMeasurable' m (f + g) μ", " AEStronglyMeasurable' m (-f) μ", " (-f) x = (-f') x", " -f x = -f' x", " AEStronglyMeasurable' m (f - g) μ", " (f - g) x = (f' - g') x", " f x - g x = f' x - g' x", " AEStronglyMeasurable' m (c • f) μ", " c • f =ᶠ[ae μ] c • f'...
[ " AEStronglyMeasurable' m g μ", " AEStronglyMeasurable' m (f + g) μ", " AEStronglyMeasurable' m (-f) μ", " (-f) x = (-f') x", " -f x = -f' x", " AEStronglyMeasurable' m (f - g) μ", " (f - g) x = (f' - g') x", " f x - g x = f' x - g' x", " AEStronglyMeasurable' m (c • f) μ", " c • f =ᶠ[ae μ] c • f'...
import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Algebra.Ring.Hom.Defs import Mathlib.GroupTheory.GroupAction.Units import Mathlib.Logic.Basic import Mathlib.Tactic.Ring #align_import ring_theory.coprime.basic from "leanprover-community/mathlib"@"a95b16cbade0f938fc24abd05412bde1e84bab9b" universe u v section CommSemiring variable {R : Type u} [CommSemiring R] (x y z : R) def IsCoprime : Prop := ∃ a b, a * x + b * y = 1 #align is_coprime IsCoprime variable {x y z} @[symm] theorem IsCoprime.symm (H : IsCoprime x y) : IsCoprime y x := let ⟨a, b, H⟩ := H ⟨b, a, by rw [add_comm, H]⟩ #align is_coprime.symm IsCoprime.symm theorem isCoprime_comm : IsCoprime x y ↔ IsCoprime y x := ⟨IsCoprime.symm, IsCoprime.symm⟩ #align is_coprime_comm isCoprime_comm theorem isCoprime_self : IsCoprime x x ↔ IsUnit x := ⟨fun ⟨a, b, h⟩ => isUnit_of_mul_eq_one x (a + b) <| by rwa [mul_comm, add_mul], fun h => let ⟨b, hb⟩ := isUnit_iff_exists_inv'.1 h ⟨b, 0, by rwa [zero_mul, add_zero]⟩⟩ #align is_coprime_self isCoprime_self theorem isCoprime_zero_left : IsCoprime 0 x ↔ IsUnit x := ⟨fun ⟨a, b, H⟩ => isUnit_of_mul_eq_one x b <| by rwa [mul_zero, zero_add, mul_comm] at H, fun H => let ⟨b, hb⟩ := isUnit_iff_exists_inv'.1 H ⟨1, b, by rwa [one_mul, zero_add]⟩⟩ #align is_coprime_zero_left isCoprime_zero_left theorem isCoprime_zero_right : IsCoprime x 0 ↔ IsUnit x := isCoprime_comm.trans isCoprime_zero_left #align is_coprime_zero_right isCoprime_zero_right theorem not_isCoprime_zero_zero [Nontrivial R] : ¬IsCoprime (0 : R) 0 := mt isCoprime_zero_right.mp not_isUnit_zero #align not_coprime_zero_zero not_isCoprime_zero_zero lemma IsCoprime.intCast {R : Type*} [CommRing R] {a b : ℤ} (h : IsCoprime a b) : IsCoprime (a : R) (b : R) := by rcases h with ⟨u, v, H⟩ use u, v rw_mod_cast [H] exact Int.cast_one theorem IsCoprime.ne_zero [Nontrivial R] {p : Fin 2 → R} (h : IsCoprime (p 0) (p 1)) : p ≠ 0 := by rintro rfl exact not_isCoprime_zero_zero h #align is_coprime.ne_zero IsCoprime.ne_zero theorem IsCoprime.ne_zero_or_ne_zero [Nontrivial R] (h : IsCoprime x y) : x ≠ 0 ∨ y ≠ 0 := by apply not_or_of_imp rintro rfl rfl exact not_isCoprime_zero_zero h theorem isCoprime_one_left : IsCoprime 1 x := ⟨1, 0, by rw [one_mul, zero_mul, add_zero]⟩ #align is_coprime_one_left isCoprime_one_left theorem isCoprime_one_right : IsCoprime x 1 := ⟨0, 1, by rw [one_mul, zero_mul, zero_add]⟩ #align is_coprime_one_right isCoprime_one_right theorem IsCoprime.dvd_of_dvd_mul_right (H1 : IsCoprime x z) (H2 : x ∣ y * z) : x ∣ y := by let ⟨a, b, H⟩ := H1 rw [← mul_one y, ← H, mul_add, ← mul_assoc, mul_left_comm] exact dvd_add (dvd_mul_left _ _) (H2.mul_left _) #align is_coprime.dvd_of_dvd_mul_right IsCoprime.dvd_of_dvd_mul_right theorem IsCoprime.dvd_of_dvd_mul_left (H1 : IsCoprime x y) (H2 : x ∣ y * z) : x ∣ z := by let ⟨a, b, H⟩ := H1 rw [← one_mul z, ← H, add_mul, mul_right_comm, mul_assoc b] exact dvd_add (dvd_mul_left _ _) (H2.mul_left _) #align is_coprime.dvd_of_dvd_mul_left IsCoprime.dvd_of_dvd_mul_left
Mathlib/RingTheory/Coprime/Basic.lean
114
121
theorem IsCoprime.mul_left (H1 : IsCoprime x z) (H2 : IsCoprime y z) : IsCoprime (x * y) z := let ⟨a, b, h1⟩ := H1 let ⟨c, d, h2⟩ := H2 ⟨a * c, a * x * d + b * c * y + b * d * z, calc a * c * (x * y) + (a * x * d + b * c * y + b * d * z) * z _ = (a * x + b * z) * (c * y + d * z) := by
ring _ = 1 := by rw [h1, h2, mul_one] ⟩
[ " b * y + a * x = 1", " x * (a + b) = 1", " b * x + 0 * x = 1", " x * b = 1", " 1 * 0 + b * x = 1", " IsCoprime ↑a ↑b", " ↑u * ↑a + ↑v * ↑b = 1", " ↑1 = 1", " p ≠ 0", " False", " x ≠ 0 ∨ y ≠ 0", " x = 0 → y ≠ 0", " 1 * 1 + 0 * x = 1", " 0 * x + 1 * 1 = 1", " x ∣ y", " x ∣ y * a * x + b...
[ " b * y + a * x = 1", " x * (a + b) = 1", " b * x + 0 * x = 1", " x * b = 1", " 1 * 0 + b * x = 1", " IsCoprime ↑a ↑b", " ↑u * ↑a + ↑v * ↑b = 1", " ↑1 = 1", " p ≠ 0", " False", " x ≠ 0 ∨ y ≠ 0", " x = 0 → y ≠ 0", " 1 * 1 + 0 * x = 1", " 0 * x + 1 * 1 = 1", " x ∣ y", " x ∣ y * a * x + b...
import Mathlib.Analysis.Complex.Circle import Mathlib.MeasureTheory.Group.Integral import Mathlib.MeasureTheory.Integral.SetIntegral import Mathlib.MeasureTheory.Measure.Haar.OfBasis import Mathlib.MeasureTheory.Constructions.Prod.Integral import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.Algebra.Group.AddChar #align_import analysis.fourier.fourier_transform from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" noncomputable section local notation "𝕊" => circle open MeasureTheory Filter open scoped Topology namespace VectorFourier variable {𝕜 : Type*} [CommRing 𝕜] {V : Type*} [AddCommGroup V] [Module 𝕜 V] [MeasurableSpace V] {W : Type*} [AddCommGroup W] [Module 𝕜 W] {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] [NormedAddCommGroup G] [NormedSpace ℂ G] section Defs def fourierIntegral (e : AddChar 𝕜 𝕊) (μ : Measure V) (L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜) (f : V → E) (w : W) : E := ∫ v, e (-L v w) • f v ∂μ #align vector_fourier.fourier_integral VectorFourier.fourierIntegral theorem fourierIntegral_smul_const (e : AddChar 𝕜 𝕊) (μ : Measure V) (L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜) (f : V → E) (r : ℂ) : fourierIntegral e μ L (r • f) = r • fourierIntegral e μ L f := by ext1 w -- Porting note: was -- simp only [Pi.smul_apply, fourierIntegral, smul_comm _ r, integral_smul] simp only [Pi.smul_apply, fourierIntegral, ← integral_smul] congr 1 with v rw [smul_comm] #align vector_fourier.fourier_integral_smul_const VectorFourier.fourierIntegral_smul_const
Mathlib/Analysis/Fourier/FourierTransform.lean
96
100
theorem norm_fourierIntegral_le_integral_norm (e : AddChar 𝕜 𝕊) (μ : Measure V) (L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜) (f : V → E) (w : W) : ‖fourierIntegral e μ L f w‖ ≤ ∫ v : V, ‖f v‖ ∂μ := by
refine (norm_integral_le_integral_norm _).trans (le_of_eq ?_) simp_rw [norm_circle_smul]
[ " fourierIntegral e μ L (r • f) = r • fourierIntegral e μ L f", " fourierIntegral e μ L (r • f) w = (r • fourierIntegral e μ L f) w", " ∫ (v : V), e (-(L v) w) • r • f v ∂μ = ∫ (a : V), r • e (-(L a) w) • f a ∂μ", " e (-(L v) w) • r • f v = r • e (-(L v) w) • f v", " ‖fourierIntegral e μ L f w‖ ≤ ∫ (v : V),...
[ " fourierIntegral e μ L (r • f) = r • fourierIntegral e μ L f", " fourierIntegral e μ L (r • f) w = (r • fourierIntegral e μ L f) w", " ∫ (v : V), e (-(L v) w) • r • f v ∂μ = ∫ (a : V), r • e (-(L a) w) • f a ∂μ", " e (-(L v) w) • r • f v = r • e (-(L v) w) • f v", " ‖fourierIntegral e μ L f w‖ ≤ ∫ (v : V),...
import Mathlib.Algebra.BigOperators.Group.Multiset import Mathlib.Data.PNat.Prime import Mathlib.Data.Nat.Factors import Mathlib.Data.Multiset.Sort #align_import data.pnat.factors from "leanprover-community/mathlib"@"e3d9ab8faa9dea8f78155c6c27d62a621f4c152d" -- Porting note: `deriving` contained Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice, -- SemilatticeSup, OrderBot, Sub, OrderedSub def PrimeMultiset := Multiset Nat.Primes deriving Inhabited, CanonicallyOrderedAddCommMonoid, DistribLattice, SemilatticeSup, Sub #align prime_multiset PrimeMultiset instance : OrderBot PrimeMultiset where bot_le := by simp only [bot_le, forall_const] instance : OrderedSub PrimeMultiset where tsub_le_iff_right _ _ _ := Multiset.sub_le_iff_le_add namespace PrimeMultiset -- `@[derive]` doesn't work for `meta` instances unsafe instance : Repr PrimeMultiset := by delta PrimeMultiset; infer_instance def ofPrime (p : Nat.Primes) : PrimeMultiset := ({p} : Multiset Nat.Primes) #align prime_multiset.of_prime PrimeMultiset.ofPrime theorem card_ofPrime (p : Nat.Primes) : Multiset.card (ofPrime p) = 1 := rfl #align prime_multiset.card_of_prime PrimeMultiset.card_ofPrime def toNatMultiset : PrimeMultiset → Multiset ℕ := fun v => v.map Coe.coe #align prime_multiset.to_nat_multiset PrimeMultiset.toNatMultiset instance coeNat : Coe PrimeMultiset (Multiset ℕ) := ⟨toNatMultiset⟩ #align prime_multiset.coe_nat PrimeMultiset.coeNat def coeNatMonoidHom : PrimeMultiset →+ Multiset ℕ := { Multiset.mapAddMonoidHom Coe.coe with toFun := Coe.coe } #align prime_multiset.coe_nat_monoid_hom PrimeMultiset.coeNatMonoidHom @[simp] theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset → Multiset ℕ) = Coe.coe := rfl #align prime_multiset.coe_coe_nat_monoid_hom PrimeMultiset.coe_coeNatMonoidHom theorem coeNat_injective : Function.Injective (Coe.coe : PrimeMultiset → Multiset ℕ) := Multiset.map_injective Nat.Primes.coe_nat_injective #align prime_multiset.coe_nat_injective PrimeMultiset.coeNat_injective theorem coeNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset ℕ) = {(p : ℕ)} := rfl #align prime_multiset.coe_nat_of_prime PrimeMultiset.coeNat_ofPrime
Mathlib/Data/PNat/Factors.lean
89
91
theorem coeNat_prime (v : PrimeMultiset) (p : ℕ) (h : p ∈ (v : Multiset ℕ)) : p.Prime := by
rcases Multiset.mem_map.mp h with ⟨⟨_, hp'⟩, ⟨_, h_eq⟩⟩ exact h_eq ▸ hp'
[ " ∀ (a : PrimeMultiset), ⊥ ≤ a", " Repr PrimeMultiset", " Repr (Multiset Nat.Primes)", " p.Prime" ]
[ " ∀ (a : PrimeMultiset), ⊥ ≤ a", " Repr PrimeMultiset", " Repr (Multiset Nat.Primes)", " p.Prime" ]
import Mathlib.CategoryTheory.Balanced import Mathlib.CategoryTheory.Limits.EssentiallySmall import Mathlib.CategoryTheory.Limits.Opposites import Mathlib.CategoryTheory.Limits.Shapes.ZeroMorphisms import Mathlib.CategoryTheory.Subobject.Lattice import Mathlib.CategoryTheory.Subobject.WellPowered import Mathlib.Data.Set.Opposite import Mathlib.Data.Set.Subsingleton #align_import category_theory.generator from "leanprover-community/mathlib"@"f187f1074fa1857c94589cc653c786cadc4c35ff" universe w v₁ v₂ u₁ u₂ open CategoryTheory.Limits Opposite namespace CategoryTheory variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] def IsSeparating (𝒢 : Set C) : Prop := ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), (∀ G ∈ 𝒢, ∀ (h : G ⟶ X), h ≫ f = h ≫ g) → f = g #align category_theory.is_separating CategoryTheory.IsSeparating def IsCoseparating (𝒢 : Set C) : Prop := ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), (∀ G ∈ 𝒢, ∀ (h : Y ⟶ G), f ≫ h = g ≫ h) → f = g #align category_theory.is_coseparating CategoryTheory.IsCoseparating def IsDetecting (𝒢 : Set C) : Prop := ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ G ∈ 𝒢, ∀ (h : G ⟶ Y), ∃! h' : G ⟶ X, h' ≫ f = h) → IsIso f #align category_theory.is_detecting CategoryTheory.IsDetecting def IsCodetecting (𝒢 : Set C) : Prop := ∀ ⦃X Y : C⦄ (f : X ⟶ Y), (∀ G ∈ 𝒢, ∀ (h : X ⟶ G), ∃! h' : Y ⟶ G, f ≫ h' = h) → IsIso f #align category_theory.is_codetecting CategoryTheory.IsCodetecting section Dual theorem isSeparating_op_iff (𝒢 : Set C) : IsSeparating 𝒢.op ↔ IsCoseparating 𝒢 := by refine ⟨fun h𝒢 X Y f g hfg => ?_, fun h𝒢 X Y f g hfg => ?_⟩ · refine Quiver.Hom.op_inj (h𝒢 _ _ fun G hG h => Quiver.Hom.unop_inj ?_) simpa only [unop_comp, Quiver.Hom.unop_op] using hfg _ (Set.mem_op.1 hG) _ · refine Quiver.Hom.unop_inj (h𝒢 _ _ fun G hG h => Quiver.Hom.op_inj ?_) simpa only [op_comp, Quiver.Hom.op_unop] using hfg _ (Set.op_mem_op.2 hG) _ #align category_theory.is_separating_op_iff CategoryTheory.isSeparating_op_iff theorem isCoseparating_op_iff (𝒢 : Set C) : IsCoseparating 𝒢.op ↔ IsSeparating 𝒢 := by refine ⟨fun h𝒢 X Y f g hfg => ?_, fun h𝒢 X Y f g hfg => ?_⟩ · refine Quiver.Hom.op_inj (h𝒢 _ _ fun G hG h => Quiver.Hom.unop_inj ?_) simpa only [unop_comp, Quiver.Hom.unop_op] using hfg _ (Set.mem_op.1 hG) _ · refine Quiver.Hom.unop_inj (h𝒢 _ _ fun G hG h => Quiver.Hom.op_inj ?_) simpa only [op_comp, Quiver.Hom.op_unop] using hfg _ (Set.op_mem_op.2 hG) _ #align category_theory.is_coseparating_op_iff CategoryTheory.isCoseparating_op_iff theorem isCoseparating_unop_iff (𝒢 : Set Cᵒᵖ) : IsCoseparating 𝒢.unop ↔ IsSeparating 𝒢 := by rw [← isSeparating_op_iff, Set.unop_op] #align category_theory.is_coseparating_unop_iff CategoryTheory.isCoseparating_unop_iff
Mathlib/CategoryTheory/Generator.lean
113
114
theorem isSeparating_unop_iff (𝒢 : Set Cᵒᵖ) : IsSeparating 𝒢.unop ↔ IsCoseparating 𝒢 := by
rw [← isCoseparating_op_iff, Set.unop_op]
[ " IsSeparating 𝒢.op ↔ IsCoseparating 𝒢", " f = g", " (h ≫ f.op).unop = (h ≫ g.op).unop", " (f.unop ≫ h).op = (g.unop ≫ h).op", " IsCoseparating 𝒢.op ↔ IsSeparating 𝒢", " (f.op ≫ h).unop = (g.op ≫ h).unop", " (h ≫ f.unop).op = (h ≫ g.unop).op", " IsCoseparating 𝒢.unop ↔ IsSeparating 𝒢", " IsSep...
[ " IsSeparating 𝒢.op ↔ IsCoseparating 𝒢", " f = g", " (h ≫ f.op).unop = (h ≫ g.op).unop", " (f.unop ≫ h).op = (g.unop ≫ h).op", " IsCoseparating 𝒢.op ↔ IsSeparating 𝒢", " (f.op ≫ h).unop = (g.op ≫ h).unop", " (h ≫ f.unop).op = (h ≫ g.unop).op", " IsCoseparating 𝒢.unop ↔ IsSeparating 𝒢", " IsSep...
import Mathlib.Algebra.Group.Pi.Basic import Mathlib.Order.Interval.Set.Basic import Mathlib.Order.Interval.Set.UnorderedInterval import Mathlib.Data.Set.Lattice #align_import data.set.intervals.pi from "leanprover-community/mathlib"@"e4bc74cbaf429d706cb9140902f7ca6c431e75a4" -- Porting note: Added, since dot notation no longer works on `Function.update` open Function variable {ι : Type*} {α : ι → Type*} namespace Set section PiPreorder variable [∀ i, Preorder (α i)] (x y : ∀ i, α i) @[simp] theorem pi_univ_Ici : (pi univ fun i ↦ Ici (x i)) = Ici x := ext fun y ↦ by simp [Pi.le_def] #align set.pi_univ_Ici Set.pi_univ_Ici @[simp] theorem pi_univ_Iic : (pi univ fun i ↦ Iic (x i)) = Iic x := ext fun y ↦ by simp [Pi.le_def] #align set.pi_univ_Iic Set.pi_univ_Iic @[simp] theorem pi_univ_Icc : (pi univ fun i ↦ Icc (x i) (y i)) = Icc x y := ext fun y ↦ by simp [Pi.le_def, forall_and] #align set.pi_univ_Icc Set.pi_univ_Icc theorem piecewise_mem_Icc {s : Set ι} [∀ j, Decidable (j ∈ s)] {f₁ f₂ g₁ g₂ : ∀ i, α i} (h₁ : ∀ i ∈ s, f₁ i ∈ Icc (g₁ i) (g₂ i)) (h₂ : ∀ i ∉ s, f₂ i ∈ Icc (g₁ i) (g₂ i)) : s.piecewise f₁ f₂ ∈ Icc g₁ g₂ := ⟨le_piecewise (fun i hi ↦ (h₁ i hi).1) fun i hi ↦ (h₂ i hi).1, piecewise_le (fun i hi ↦ (h₁ i hi).2) fun i hi ↦ (h₂ i hi).2⟩ #align set.piecewise_mem_Icc Set.piecewise_mem_Icc theorem piecewise_mem_Icc' {s : Set ι} [∀ j, Decidable (j ∈ s)] {f₁ f₂ g₁ g₂ : ∀ i, α i} (h₁ : f₁ ∈ Icc g₁ g₂) (h₂ : f₂ ∈ Icc g₁ g₂) : s.piecewise f₁ f₂ ∈ Icc g₁ g₂ := piecewise_mem_Icc (fun _ _ ↦ ⟨h₁.1 _, h₁.2 _⟩) fun _ _ ↦ ⟨h₂.1 _, h₂.2 _⟩ #align set.piecewise_mem_Icc' Set.piecewise_mem_Icc' variable [DecidableEq ι] open Function (update) theorem pi_univ_Ioc_update_left {x y : ∀ i, α i} {i₀ : ι} {m : α i₀} (hm : x i₀ ≤ m) : (pi univ fun i ↦ Ioc (update x i₀ m i) (y i)) = { z | m < z i₀ } ∩ pi univ fun i ↦ Ioc (x i) (y i) := by have : Ioc m (y i₀) = Ioi m ∩ Ioc (x i₀) (y i₀) := by rw [← Ioi_inter_Iic, ← Ioi_inter_Iic, ← inter_assoc, inter_eq_self_of_subset_left (Ioi_subset_Ioi hm)] simp_rw [univ_pi_update i₀ _ _ fun i z ↦ Ioc z (y i), ← pi_inter_compl ({i₀} : Set ι), singleton_pi', ← inter_assoc, this] rfl #align set.pi_univ_Ioc_update_left Set.pi_univ_Ioc_update_left
Mathlib/Order/Interval/Set/Pi.lean
101
109
theorem pi_univ_Ioc_update_right {x y : ∀ i, α i} {i₀ : ι} {m : α i₀} (hm : m ≤ y i₀) : (pi univ fun i ↦ Ioc (x i) (update y i₀ m i)) = { z | z i₀ ≤ m } ∩ pi univ fun i ↦ Ioc (x i) (y i) := by
have : Ioc (x i₀) m = Iic m ∩ Ioc (x i₀) (y i₀) := by rw [← Ioi_inter_Iic, ← Ioi_inter_Iic, inter_left_comm, inter_eq_self_of_subset_left (Iic_subset_Iic.2 hm)] simp_rw [univ_pi_update i₀ y m fun i z ↦ Ioc (x i) z, ← pi_inter_compl ({i₀} : Set ι), singleton_pi', ← inter_assoc, this] rfl
[ " (y ∈ univ.pi fun i => Ici (x i)) ↔ y ∈ Ici x", " (y ∈ univ.pi fun i => Iic (x i)) ↔ y ∈ Iic x", " (y ∈ univ.pi fun i => Icc (x i) (y✝ i)) ↔ y ∈ Icc x y✝", " (univ.pi fun i => Ioc (update x i₀ m i) (y i)) = {z | m < z i₀} ∩ univ.pi fun i => Ioc (x i) (y i)", " Ioc m (y i₀) = Ioi m ∩ Ioc (x i₀) (y i₀)", "...
[ " (y ∈ univ.pi fun i => Ici (x i)) ↔ y ∈ Ici x", " (y ∈ univ.pi fun i => Iic (x i)) ↔ y ∈ Iic x", " (y ∈ univ.pi fun i => Icc (x i) (y✝ i)) ↔ y ∈ Icc x y✝", " (univ.pi fun i => Ioc (update x i₀ m i) (y i)) = {z | m < z i₀} ∩ univ.pi fun i => Ioc (x i) (y i)", " Ioc m (y i₀) = Ioi m ∩ Ioc (x i₀) (y i₀)", "...
import Mathlib.CategoryTheory.Sites.Spaces import Mathlib.Topology.Sheaves.Sheaf import Mathlib.CategoryTheory.Sites.DenseSubsite #align_import topology.sheaves.sheaf_condition.sites from "leanprover-community/mathlib"@"d39590fc8728fbf6743249802486f8c91ffe07bc" noncomputable section set_option linter.uppercaseLean3 false -- Porting note: Added because of too many false positives universe w v u open CategoryTheory TopologicalSpace namespace TopCat.Presheaf variable {X : TopCat.{w}} def coveringOfPresieve (U : Opens X) (R : Presieve U) : (ΣV, { f : V ⟶ U // R f }) → Opens X := fun f => f.1 #align Top.presheaf.covering_of_presieve TopCat.Presheaf.coveringOfPresieve @[simp] theorem coveringOfPresieve_apply (U : Opens X) (R : Presieve U) (f : ΣV, { f : V ⟶ U // R f }) : coveringOfPresieve U R f = f.1 := rfl #align Top.presheaf.covering_of_presieve_apply TopCat.Presheaf.coveringOfPresieve_apply def presieveOfCoveringAux {ι : Type v} (U : ι → Opens X) (Y : Opens X) : Presieve Y := fun V _ => ∃ i, V = U i #align Top.presheaf.presieve_of_covering_aux TopCat.Presheaf.presieveOfCoveringAux def presieveOfCovering {ι : Type v} (U : ι → Opens X) : Presieve (iSup U) := presieveOfCoveringAux U (iSup U) #align Top.presheaf.presieve_of_covering TopCat.Presheaf.presieveOfCovering @[simp] theorem covering_presieve_eq_self {Y : Opens X} (R : Presieve Y) : presieveOfCoveringAux (coveringOfPresieve Y R) Y = R := by funext Z ext f exact ⟨fun ⟨⟨_, f', h⟩, rfl⟩ => by rwa [Subsingleton.elim f f'], fun h => ⟨⟨Z, f, h⟩, rfl⟩⟩ #align Top.presheaf.covering_presieve_eq_self TopCat.Presheaf.covering_presieve_eq_self namespace TopCat.Opens variable {X : TopCat} {ι : Type*}
Mathlib/Topology/Sheaves/SheafCondition/Sites.lean
137
144
theorem coverDense_iff_isBasis [Category ι] (B : ι ⥤ Opens X) : B.IsCoverDense (Opens.grothendieckTopology X) ↔ Opens.IsBasis (Set.range B.obj) := by
rw [Opens.isBasis_iff_nbhd] constructor · intro hd U x hx; rcases hd.1 U x hx with ⟨V, f, ⟨i, f₁, f₂, _⟩, hV⟩ exact ⟨B.obj i, ⟨i, rfl⟩, f₁.le hV, f₂.le⟩ intro hb; constructor; intro U x hx; rcases hb hx with ⟨_, ⟨i, rfl⟩, hx, hi⟩ exact ⟨B.obj i, ⟨⟨hi⟩⟩, ⟨⟨i, 𝟙 _, ⟨⟨hi⟩⟩, rfl⟩⟩, hx⟩
[ " presieveOfCoveringAux (coveringOfPresieve Y R) Y = R", " f ∈ presieveOfCoveringAux (coveringOfPresieve Y R) Y ↔ f ∈ R", " f ∈ R", " B.IsCoverDense (Opens.grothendieckTopology ↑X) ↔ Opens.IsBasis (Set.range B.obj)", " B.IsCoverDense (Opens.grothendieckTopology ↑X) ↔\n ∀ {U : Opens ↑X} {x : ↑X}, x ∈ U → ...
[ " presieveOfCoveringAux (coveringOfPresieve Y R) Y = R", " f ∈ presieveOfCoveringAux (coveringOfPresieve Y R) Y ↔ f ∈ R", " f ∈ R", " B.IsCoverDense (Opens.grothendieckTopology ↑X) ↔ Opens.IsBasis (Set.range B.obj)" ]
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {α : Type*} section Sym2 protected def sym2 : List α → List (Sym2 α) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : α} {xs : List α} {z : Sym2 α} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (∃ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List α} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List α} {a b : α} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h · rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 · rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] · exact .inr <| ih h theorem right_mem_of_mk_mem_sym2 {xs : List α} {a b : α} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h
Mathlib/Data/List/Sym.lean
68
79
theorem mk_mem_sym2 {xs : List α} {a b : α} (ha : a ∈ xs) (hb : b ∈ xs) : s(a, b) ∈ xs.sym2 := by
induction xs with | nil => simp at ha | cons x xs ih => rw [mem_sym2_cons_iff] rw [mem_cons] at ha hb obtain (rfl | ha) := ha <;> obtain (rfl | hb) := hb · left; rfl · right; left; use b · right; left; rw [Sym2.eq_swap]; use a · right; right; exact ih ha hb
[ " z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (∃ y ∈ xs, z = s(x, y)) ∨ z ∈ xs.sym2", " z = s(x, x) ∨ (∃ a ∈ xs, s(x, a) = z) ∨ z ∈ xs.sym2 ↔ z = s(x, x) ∨ (∃ y ∈ xs, z = s(x, y)) ∨ z ∈ xs.sym2", " xs.sym2 = [] ↔ xs = []", " [].sym2 = [] ↔ [] = []", " (head✝ :: tail✝).sym2 = [] ↔ head✝ :: tail✝ = []", " a ∈ xs", ...
[ " z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (∃ y ∈ xs, z = s(x, y)) ∨ z ∈ xs.sym2", " z = s(x, x) ∨ (∃ a ∈ xs, s(x, a) = z) ∨ z ∈ xs.sym2 ↔ z = s(x, x) ∨ (∃ y ∈ xs, z = s(x, y)) ∨ z ∈ xs.sym2", " xs.sym2 = [] ↔ xs = []", " [].sym2 = [] ↔ [] = []", " (head✝ :: tail✝).sym2 = [] ↔ head✝ :: tail✝ = []", " a ∈ xs", ...
import Batteries.Data.RBMap.Basic import Mathlib.Init.Data.Nat.Notation import Mathlib.Mathport.Rename import Mathlib.Tactic.TypeStar import Mathlib.Util.CompileInductive #align_import data.tree from "leanprover-community/mathlib"@"ed989ff568099019c6533a4d94b27d852a5710d8" inductive Tree.{u} (α : Type u) : Type u | nil : Tree α | node : α → Tree α → Tree α → Tree α deriving DecidableEq, Repr -- Porting note: Removed `has_reflect`, added `Repr`. #align tree Tree namespace Tree universe u variable {α : Type u} -- Porting note: replaced with `deriving Repr` which builds a better instance anyway #noalign tree.repr instance : Inhabited (Tree α) := ⟨nil⟩ open Batteries (RBNode) def ofRBNode : RBNode α → Tree α | RBNode.nil => nil | RBNode.node _color l key r => node key (ofRBNode l) (ofRBNode r) #align tree.of_rbnode Tree.ofRBNode def map {β} (f : α → β) : Tree α → Tree β | nil => nil | node a l r => node (f a) (map f l) (map f r) #align tree.map Tree.map @[simp] def numNodes : Tree α → ℕ | nil => 0 | node _ a b => a.numNodes + b.numNodes + 1 #align tree.num_nodes Tree.numNodes @[simp] def numLeaves : Tree α → ℕ | nil => 1 | node _ a b => a.numLeaves + b.numLeaves #align tree.num_leaves Tree.numLeaves @[simp] def height : Tree α → ℕ | nil => 0 | node _ a b => max a.height b.height + 1 #align tree.height Tree.height
Mathlib/Data/Tree/Basic.lean
90
91
theorem numLeaves_eq_numNodes_succ (x : Tree α) : x.numLeaves = x.numNodes + 1 := by
induction x <;> simp [*, Nat.add_comm, Nat.add_assoc, Nat.add_left_comm]
[ " x.numLeaves = x.numNodes + 1", " nil.numLeaves = nil.numNodes + 1", " (node a✝² a✝¹ a✝).numLeaves = (node a✝² a✝¹ a✝).numNodes + 1" ]
[ " x.numLeaves = x.numNodes + 1" ]
import Mathlib.LinearAlgebra.AffineSpace.Basis import Mathlib.LinearAlgebra.Matrix.NonsingularInverse #align_import linear_algebra.affine_space.matrix from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" open Affine Matrix open Set universe u₁ u₂ u₃ u₄ variable {ι : Type u₁} {k : Type u₂} {V : Type u₃} {P : Type u₄} variable [AddCommGroup V] [AffineSpace V P] namespace AffineBasis section Ring variable [Ring k] [Module k V] (b : AffineBasis ι k P) noncomputable def toMatrix {ι' : Type*} (q : ι' → P) : Matrix ι' ι k := fun i j => b.coord j (q i) #align affine_basis.to_matrix AffineBasis.toMatrix @[simp] theorem toMatrix_apply {ι' : Type*} (q : ι' → P) (i : ι') (j : ι) : b.toMatrix q i j = b.coord j (q i) := rfl #align affine_basis.to_matrix_apply AffineBasis.toMatrix_apply @[simp] theorem toMatrix_self [DecidableEq ι] : b.toMatrix b = (1 : Matrix ι ι k) := by ext i j rw [toMatrix_apply, coord_apply, Matrix.one_eq_pi_single, Pi.single_apply] #align affine_basis.to_matrix_self AffineBasis.toMatrix_self variable {ι' : Type*} theorem toMatrix_row_sum_one [Fintype ι] (q : ι' → P) (i : ι') : ∑ j, b.toMatrix q i j = 1 := by simp #align affine_basis.to_matrix_row_sum_one AffineBasis.toMatrix_row_sum_one theorem affineIndependent_of_toMatrix_right_inv [Fintype ι] [Finite ι'] [DecidableEq ι'] (p : ι' → P) {A : Matrix ι ι' k} (hA : b.toMatrix p * A = 1) : AffineIndependent k p := by cases nonempty_fintype ι' rw [affineIndependent_iff_eq_of_fintype_affineCombination_eq] intro w₁ w₂ hw₁ hw₂ hweq have hweq' : w₁ ᵥ* b.toMatrix p = w₂ ᵥ* b.toMatrix p := by ext j change (∑ i, w₁ i • b.coord j (p i)) = ∑ i, w₂ i • b.coord j (p i) -- Porting note: Added `u` because `∘` was causing trouble have u : (fun i => b.coord j (p i)) = b.coord j ∘ p := by simp only [(· ∘ ·)] rw [← Finset.univ.affineCombination_eq_linear_combination _ _ hw₁, ← Finset.univ.affineCombination_eq_linear_combination _ _ hw₂, u, ← Finset.univ.map_affineCombination p w₁ hw₁, ← Finset.univ.map_affineCombination p w₂ hw₂, hweq] replace hweq' := congr_arg (fun w => w ᵥ* A) hweq' simpa only [Matrix.vecMul_vecMul, hA, Matrix.vecMul_one] using hweq' #align affine_basis.affine_independent_of_to_matrix_right_inv AffineBasis.affineIndependent_of_toMatrix_right_inv theorem affineSpan_eq_top_of_toMatrix_left_inv [Finite ι] [Fintype ι'] [DecidableEq ι] [Nontrivial k] (p : ι' → P) {A : Matrix ι ι' k} (hA : A * b.toMatrix p = 1) : affineSpan k (range p) = ⊤ := by cases nonempty_fintype ι suffices ∀ i, b i ∈ affineSpan k (range p) by rw [eq_top_iff, ← b.tot, affineSpan_le] rintro q ⟨i, rfl⟩ exact this i intro i have hAi : ∑ j, A i j = 1 := by calc ∑ j, A i j = ∑ j, A i j * ∑ l, b.toMatrix p j l := by simp _ = ∑ j, ∑ l, A i j * b.toMatrix p j l := by simp_rw [Finset.mul_sum] _ = ∑ l, ∑ j, A i j * b.toMatrix p j l := by rw [Finset.sum_comm] _ = ∑ l, (A * b.toMatrix p) i l := rfl _ = 1 := by simp [hA, Matrix.one_apply, Finset.filter_eq] have hbi : b i = Finset.univ.affineCombination k p (A i) := by apply b.ext_elem intro j rw [b.coord_apply, Finset.univ.map_affineCombination _ _ hAi, Finset.univ.affineCombination_eq_linear_combination _ _ hAi] change _ = (A * b.toMatrix p) i j simp_rw [hA, Matrix.one_apply, @eq_comm _ i j] rw [hbi] exact affineCombination_mem_affineSpan hAi p #align affine_basis.affine_span_eq_top_of_to_matrix_left_inv AffineBasis.affineSpan_eq_top_of_toMatrix_left_inv variable [Fintype ι] (b₂ : AffineBasis ι k P) @[simp] theorem toMatrix_vecMul_coords (x : P) : b₂.coords x ᵥ* b.toMatrix b₂ = b.coords x := by ext j change _ = b.coord j x conv_rhs => rw [← b₂.affineCombination_coord_eq_self x] rw [Finset.map_affineCombination _ _ _ (b₂.sum_coord_apply_eq_one x)] simp [Matrix.vecMul, Matrix.dotProduct, toMatrix_apply, coords] #align affine_basis.to_matrix_vec_mul_coords AffineBasis.toMatrix_vecMul_coords variable [DecidableEq ι]
Mathlib/LinearAlgebra/AffineSpace/Matrix.lean
124
127
theorem toMatrix_mul_toMatrix : b.toMatrix b₂ * b₂.toMatrix b = 1 := by
ext l m change (b.coords (b₂ l) ᵥ* b₂.toMatrix b) m = _ rw [toMatrix_vecMul_coords, coords_apply, ← toMatrix_apply, toMatrix_self]
[ " b.toMatrix ⇑b = 1", " b.toMatrix (⇑b) i j = 1 i j", " ∑ j : ι, b.toMatrix q i j = 1", " AffineIndependent k p", " ∀ (w1 w2 : ι' → k),\n ∑ i : ι', w1 i = 1 →\n ∑ i : ι', w2 i = 1 →\n (Finset.affineCombination k Finset.univ p) w1 = (Finset.affineCombination k Finset.univ p) w2 → w1 = w2", "...
[ " b.toMatrix ⇑b = 1", " b.toMatrix (⇑b) i j = 1 i j", " ∑ j : ι, b.toMatrix q i j = 1", " AffineIndependent k p", " ∀ (w1 w2 : ι' → k),\n ∑ i : ι', w1 i = 1 →\n ∑ i : ι', w2 i = 1 →\n (Finset.affineCombination k Finset.univ p) w1 = (Finset.affineCombination k Finset.univ p) w2 → w1 = w2", "...
import Mathlib.LinearAlgebra.Dimension.Free import Mathlib.Algebra.Module.Torsion #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v v' u₁' w w' variable {R S : Type u} {M : Type v} {M' : Type v'} {M₁ : Type v} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set FiniteDimensional DirectSum variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] section Quotient theorem LinearIndependent.sum_elim_of_quotient {M' : Submodule R M} {ι₁ ι₂} {f : ι₁ → M'} (hf : LinearIndependent R f) (g : ι₂ → M) (hg : LinearIndependent R (Submodule.Quotient.mk (p := M') ∘ g)) : LinearIndependent R (Sum.elim (f · : ι₁ → M) g) := by refine .sum_type (hf.map' M'.subtype M'.ker_subtype) (.of_comp M'.mkQ hg) ?_ refine disjoint_def.mpr fun x h₁ h₂ ↦ ?_ have : x ∈ M' := span_le.mpr (Set.range_subset_iff.mpr fun i ↦ (f i).prop) h₁ obtain ⟨c, rfl⟩ := Finsupp.mem_span_range_iff_exists_finsupp.mp h₂ simp_rw [← Quotient.mk_eq_zero, ← mkQ_apply, map_finsupp_sum, map_smul, mkQ_apply] at this rw [linearIndependent_iff.mp hg _ this, Finsupp.sum_zero_index]
Mathlib/LinearAlgebra/Dimension/Constructions.lean
58
64
theorem LinearIndependent.union_of_quotient {M' : Submodule R M} {s : Set M} (hs : s ⊆ M') (hs' : LinearIndependent (ι := s) R Subtype.val) {t : Set M} (ht : LinearIndependent (ι := t) R (Submodule.Quotient.mk (p := M') ∘ Subtype.val)) : LinearIndependent (ι := (s ∪ t : _)) R Subtype.val := by
refine (LinearIndependent.sum_elim_of_quotient (f := Set.embeddingOfSubset s M' hs) (of_comp M'.subtype (by simpa using hs')) Subtype.val ht).to_subtype_range' ?_ simp only [embeddingOfSubset_apply_coe, Sum.elim_range, Subtype.range_val]
[ " LinearIndependent R (Sum.elim (fun x => ↑(f x)) g)", " Disjoint (span R (range fun x => ↑(f x))) (span R (range g))", " x = 0", " (c.sum fun i a => a • g i) = 0", " LinearIndependent (ι := ↑(s ∪ t)) R Subtype.val", " LinearIndependent (ι := ↑s) R (⇑M'.subtype ∘ ⇑(s.embeddingOfSubset (↑M') hs))", " ran...
[ " LinearIndependent R (Sum.elim (fun x => ↑(f x)) g)", " Disjoint (span R (range fun x => ↑(f x))) (span R (range g))", " x = 0", " (c.sum fun i a => a • g i) = 0", " LinearIndependent (ι := ↑(s ∪ t)) R Subtype.val" ]
import Mathlib.Algebra.Quaternion import Mathlib.Tactic.Ring #align_import algebra.quaternion_basis from "leanprover-community/mathlib"@"3aa5b8a9ed7a7cabd36e6e1d022c9858ab8a8c2d" open Quaternion namespace QuaternionAlgebra structure Basis {R : Type*} (A : Type*) [CommRing R] [Ring A] [Algebra R A] (c₁ c₂ : R) where (i j k : A) i_mul_i : i * i = c₁ • (1 : A) j_mul_j : j * j = c₂ • (1 : A) i_mul_j : i * j = k j_mul_i : j * i = -k #align quaternion_algebra.basis QuaternionAlgebra.Basis variable {R : Type*} {A B : Type*} [CommRing R] [Ring A] [Ring B] [Algebra R A] [Algebra R B] variable {c₁ c₂ : R} namespace Basis @[ext] protected theorem ext ⦃q₁ q₂ : Basis A c₁ c₂⦄ (hi : q₁.i = q₂.i) (hj : q₁.j = q₂.j) : q₁ = q₂ := by cases q₁; rename_i q₁_i_mul_j _ cases q₂; rename_i q₂_i_mul_j _ congr rw [← q₁_i_mul_j, ← q₂_i_mul_j] congr #align quaternion_algebra.basis.ext QuaternionAlgebra.Basis.ext variable (R) @[simps i j k] protected def self : Basis ℍ[R,c₁,c₂] c₁ c₂ where i := ⟨0, 1, 0, 0⟩ i_mul_i := by ext <;> simp j := ⟨0, 0, 1, 0⟩ j_mul_j := by ext <;> simp k := ⟨0, 0, 0, 1⟩ i_mul_j := by ext <;> simp j_mul_i := by ext <;> simp #align quaternion_algebra.basis.self QuaternionAlgebra.Basis.self variable {R} instance : Inhabited (Basis ℍ[R,c₁,c₂] c₁ c₂) := ⟨Basis.self R⟩ variable (q : Basis A c₁ c₂) attribute [simp] i_mul_i j_mul_j i_mul_j j_mul_i @[simp] theorem i_mul_k : q.i * q.k = c₁ • q.j := by rw [← i_mul_j, ← mul_assoc, i_mul_i, smul_mul_assoc, one_mul] #align quaternion_algebra.basis.i_mul_k QuaternionAlgebra.Basis.i_mul_k @[simp] theorem k_mul_i : q.k * q.i = -c₁ • q.j := by rw [← i_mul_j, mul_assoc, j_mul_i, mul_neg, i_mul_k, neg_smul] #align quaternion_algebra.basis.k_mul_i QuaternionAlgebra.Basis.k_mul_i @[simp] theorem k_mul_j : q.k * q.j = c₂ • q.i := by rw [← i_mul_j, mul_assoc, j_mul_j, mul_smul_comm, mul_one] #align quaternion_algebra.basis.k_mul_j QuaternionAlgebra.Basis.k_mul_j @[simp] theorem j_mul_k : q.j * q.k = -c₂ • q.i := by rw [← i_mul_j, ← mul_assoc, j_mul_i, neg_mul, k_mul_j, neg_smul] #align quaternion_algebra.basis.j_mul_k QuaternionAlgebra.Basis.j_mul_k @[simp] theorem k_mul_k : q.k * q.k = -((c₁ * c₂) • (1 : A)) := by rw [← i_mul_j, mul_assoc, ← mul_assoc q.j _ _, j_mul_i, ← i_mul_j, ← mul_assoc, mul_neg, ← mul_assoc, i_mul_i, smul_mul_assoc, one_mul, neg_mul, smul_mul_assoc, j_mul_j, smul_smul] #align quaternion_algebra.basis.k_mul_k QuaternionAlgebra.Basis.k_mul_k def lift (x : ℍ[R,c₁,c₂]) : A := algebraMap R _ x.re + x.imI • q.i + x.imJ • q.j + x.imK • q.k #align quaternion_algebra.basis.lift QuaternionAlgebra.Basis.lift theorem lift_zero : q.lift (0 : ℍ[R,c₁,c₂]) = 0 := by simp [lift] #align quaternion_algebra.basis.lift_zero QuaternionAlgebra.Basis.lift_zero theorem lift_one : q.lift (1 : ℍ[R,c₁,c₂]) = 1 := by simp [lift] #align quaternion_algebra.basis.lift_one QuaternionAlgebra.Basis.lift_one theorem lift_add (x y : ℍ[R,c₁,c₂]) : q.lift (x + y) = q.lift x + q.lift y := by simp only [lift, add_re, map_add, add_imI, add_smul, add_imJ, add_imK] abel #align quaternion_algebra.basis.lift_add QuaternionAlgebra.Basis.lift_add theorem lift_mul (x y : ℍ[R,c₁,c₂]) : q.lift (x * y) = q.lift x * q.lift y := by simp only [lift, Algebra.algebraMap_eq_smul_one] simp_rw [add_mul, mul_add, smul_mul_assoc, mul_smul_comm, one_mul, mul_one, smul_smul] simp only [i_mul_i, j_mul_j, i_mul_j, j_mul_i, i_mul_k, k_mul_i, k_mul_j, j_mul_k, k_mul_k] simp only [smul_smul, smul_neg, sub_eq_add_neg, add_smul, ← add_assoc, mul_neg, neg_smul] simp only [mul_right_comm _ _ (c₁ * c₂), mul_comm _ (c₁ * c₂)] simp only [mul_comm _ c₁, mul_right_comm _ _ c₁] simp only [mul_comm _ c₂, mul_right_comm _ _ c₂] simp only [← mul_comm c₁ c₂, ← mul_assoc] simp only [mul_re, sub_eq_add_neg, add_smul, neg_smul, mul_imI, ← add_assoc, mul_imJ, mul_imK] abel #align quaternion_algebra.basis.lift_mul QuaternionAlgebra.Basis.lift_mul
Mathlib/Algebra/QuaternionBasis.lean
138
139
theorem lift_smul (r : R) (x : ℍ[R,c₁,c₂]) : q.lift (r • x) = r • q.lift x := by
simp [lift, mul_smul, ← Algebra.smul_def]
[ " q₁ = q₂", " { i := i✝, j := j✝, k := k✝, i_mul_i := i_mul_i✝, j_mul_j := j_mul_j✝, i_mul_j := i_mul_j✝, j_mul_i := j_mul_i✝ } = q₂", " { i := i✝, j := j✝, k := k✝, i_mul_i := i_mul_i✝, j_mul_j := j_mul_j✝, i_mul_j := q₁_i_mul_j, j_mul_i := j_mul_i✝ } =\n q₂", " { i := i✝¹, j := j✝¹, k := k✝¹, i_mul_i := ...
[ " q₁ = q₂", " { i := i✝, j := j✝, k := k✝, i_mul_i := i_mul_i✝, j_mul_j := j_mul_j✝, i_mul_j := i_mul_j✝, j_mul_i := j_mul_i✝ } = q₂", " { i := i✝, j := j✝, k := k✝, i_mul_i := i_mul_i✝, j_mul_j := j_mul_j✝, i_mul_j := q₁_i_mul_j, j_mul_i := j_mul_i✝ } =\n q₂", " { i := i✝¹, j := j✝¹, k := k✝¹, i_mul_i := ...
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.RingTheory.Polynomial.Bernstein import Mathlib.Topology.ContinuousFunction.Polynomial import Mathlib.Topology.ContinuousFunction.Compact #align_import analysis.special_functions.bernstein from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false -- S noncomputable section open scoped Classical BoundedContinuousFunction unitInterval def bernstein (n ν : ℕ) : C(I, ℝ) := (bernsteinPolynomial ℝ n ν).toContinuousMapOn I #align bernstein bernstein @[simp] theorem bernstein_apply (n ν : ℕ) (x : I) : bernstein n ν x = (n.choose ν : ℝ) * (x : ℝ) ^ ν * (1 - (x : ℝ)) ^ (n - ν) := by dsimp [bernstein, Polynomial.toContinuousMapOn, Polynomial.toContinuousMap, bernsteinPolynomial] simp #align bernstein_apply bernstein_apply
Mathlib/Analysis/SpecialFunctions/Bernstein.lean
67
71
theorem bernstein_nonneg {n ν : ℕ} {x : I} : 0 ≤ bernstein n ν x := by
simp only [bernstein_apply] have h₁ : (0:ℝ) ≤ x := by unit_interval have h₂ : (0:ℝ) ≤ 1 - x := by unit_interval positivity
[ " (bernstein n ν) x = ↑(n.choose ν) * ↑x ^ ν * (1 - ↑x) ^ (n - ν)", " Polynomial.eval (↑x) (↑(n.choose ν) * Polynomial.X ^ ν * (1 - Polynomial.X) ^ (n - ν)) =\n ↑(n.choose ν) * ↑x ^ ν * (1 - ↑x) ^ (n - ν)", " 0 ≤ (bernstein n ν) x", " 0 ≤ ↑(n.choose ν) * ↑x ^ ν * (1 - ↑x) ^ (n - ν)", " 0 ≤ ↑x", " 0 ≤ 1...
[ " (bernstein n ν) x = ↑(n.choose ν) * ↑x ^ ν * (1 - ↑x) ^ (n - ν)", " Polynomial.eval (↑x) (↑(n.choose ν) * Polynomial.X ^ ν * (1 - Polynomial.X) ^ (n - ν)) =\n ↑(n.choose ν) * ↑x ^ ν * (1 - ↑x) ^ (n - ν)", " 0 ≤ (bernstein n ν) x" ]
import Mathlib.Algebra.Group.Equiv.TypeTags import Mathlib.GroupTheory.FreeAbelianGroup import Mathlib.GroupTheory.FreeGroup.IsFreeGroup import Mathlib.LinearAlgebra.Dimension.StrongRankCondition #align_import group_theory.free_abelian_group_finsupp from "leanprover-community/mathlib"@"47b51515e69f59bca5cf34ef456e6000fe205a69" noncomputable section variable {X : Type*} def FreeAbelianGroup.toFinsupp : FreeAbelianGroup X →+ X →₀ ℤ := FreeAbelianGroup.lift fun x => Finsupp.single x (1 : ℤ) #align free_abelian_group.to_finsupp FreeAbelianGroup.toFinsupp def Finsupp.toFreeAbelianGroup : (X →₀ ℤ) →+ FreeAbelianGroup X := Finsupp.liftAddHom fun x => (smulAddHom ℤ (FreeAbelianGroup X)).flip (FreeAbelianGroup.of x) #align finsupp.to_free_abelian_group Finsupp.toFreeAbelianGroup open Finsupp FreeAbelianGroup @[simp] theorem Finsupp.toFreeAbelianGroup_comp_singleAddHom (x : X) : Finsupp.toFreeAbelianGroup.comp (Finsupp.singleAddHom x) = (smulAddHom ℤ (FreeAbelianGroup X)).flip (of x) := by ext simp only [AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply, one_smul, toFreeAbelianGroup, Finsupp.liftAddHom_apply_single] #align finsupp.to_free_abelian_group_comp_single_add_hom Finsupp.toFreeAbelianGroup_comp_singleAddHom @[simp] theorem FreeAbelianGroup.toFinsupp_comp_toFreeAbelianGroup : toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X →₀ ℤ) := by ext x y; simp only [AddMonoidHom.id_comp] rw [AddMonoidHom.comp_assoc, Finsupp.toFreeAbelianGroup_comp_singleAddHom] simp only [toFinsupp, AddMonoidHom.coe_comp, Finsupp.singleAddHom_apply, Function.comp_apply, one_smul, lift.of, AddMonoidHom.flip_apply, smulAddHom_apply, AddMonoidHom.id_apply] #align free_abelian_group.to_finsupp_comp_to_free_abelian_group FreeAbelianGroup.toFinsupp_comp_toFreeAbelianGroup @[simp] theorem Finsupp.toFreeAbelianGroup_comp_toFinsupp : toFreeAbelianGroup.comp toFinsupp = AddMonoidHom.id (FreeAbelianGroup X) := by ext rw [toFreeAbelianGroup, toFinsupp, AddMonoidHom.comp_apply, lift.of, liftAddHom_apply_single, AddMonoidHom.flip_apply, smulAddHom_apply, one_smul, AddMonoidHom.id_apply] #align finsupp.to_free_abelian_group_comp_to_finsupp Finsupp.toFreeAbelianGroup_comp_toFinsupp @[simp]
Mathlib/GroupTheory/FreeAbelianGroupFinsupp.lean
72
74
theorem Finsupp.toFreeAbelianGroup_toFinsupp {X} (x : FreeAbelianGroup X) : Finsupp.toFreeAbelianGroup (FreeAbelianGroup.toFinsupp x) = x := by
rw [← AddMonoidHom.comp_apply, Finsupp.toFreeAbelianGroup_comp_toFinsupp, AddMonoidHom.id_apply]
[ " toFreeAbelianGroup.comp (singleAddHom x) = (smulAddHom ℤ (FreeAbelianGroup X)).flip (of x)", " (toFreeAbelianGroup.comp (singleAddHom x)) 1 = ((smulAddHom ℤ (FreeAbelianGroup X)).flip (of x)) 1", " toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X →₀ ℤ)", " (((toFinsupp.comp toFreeAbelianGroup).comp (s...
[ " toFreeAbelianGroup.comp (singleAddHom x) = (smulAddHom ℤ (FreeAbelianGroup X)).flip (of x)", " (toFreeAbelianGroup.comp (singleAddHom x)) 1 = ((smulAddHom ℤ (FreeAbelianGroup X)).flip (of x)) 1", " toFinsupp.comp toFreeAbelianGroup = AddMonoidHom.id (X →₀ ℤ)", " (((toFinsupp.comp toFreeAbelianGroup).comp (s...
import Mathlib.Data.Matrix.Invertible import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.PosDef #align_import linear_algebra.matrix.schur_complement from "leanprover-community/mathlib"@"a176cb1219e300e85793d44583dede42377b51af" variable {l m n α : Type*} namespace Matrix open scoped Matrix section CommRing variable [Fintype l] [Fintype m] [Fintype n] variable [DecidableEq l] [DecidableEq m] [DecidableEq n] variable [CommRing α] theorem fromBlocks_eq_of_invertible₁₁ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix l m α) (D : Matrix l n α) [Invertible A] : fromBlocks A B C D = fromBlocks 1 0 (C * ⅟ A) 1 * fromBlocks A 0 0 (D - C * ⅟ A * B) * fromBlocks 1 (⅟ A * B) 0 1 := by simp only [fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add, Matrix.one_mul, Matrix.mul_one, invOf_mul_self, Matrix.mul_invOf_self_assoc, Matrix.mul_invOf_mul_self_cancel, Matrix.mul_assoc, add_sub_cancel] #align matrix.from_blocks_eq_of_invertible₁₁ Matrix.fromBlocks_eq_of_invertible₁₁ theorem fromBlocks_eq_of_invertible₂₂ (A : Matrix l m α) (B : Matrix l n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] : fromBlocks A B C D = fromBlocks 1 (B * ⅟ D) 0 1 * fromBlocks (A - B * ⅟ D * C) 0 0 D * fromBlocks 1 0 (⅟ D * C) 1 := (Matrix.reindex (Equiv.sumComm _ _) (Equiv.sumComm _ _)).injective <| by simpa [reindex_apply, Equiv.sumComm_symm, ← submatrix_mul_equiv _ _ _ (Equiv.sumComm n m), ← submatrix_mul_equiv _ _ _ (Equiv.sumComm n l), Equiv.sumComm_apply, fromBlocks_submatrix_sum_swap_sum_swap] using fromBlocks_eq_of_invertible₁₁ D C B A #align matrix.from_blocks_eq_of_invertible₂₂ Matrix.fromBlocks_eq_of_invertible₂₂ section Det theorem det_fromBlocks₁₁ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] : (Matrix.fromBlocks A B C D).det = det A * det (D - C * ⅟ A * B) := by rw [fromBlocks_eq_of_invertible₁₁ (A := A), det_mul, det_mul, det_fromBlocks_zero₂₁, det_fromBlocks_zero₂₁, det_fromBlocks_zero₁₂, det_one, det_one, one_mul, one_mul, mul_one] #align matrix.det_from_blocks₁₁ Matrix.det_fromBlocks₁₁ @[simp]
Mathlib/LinearAlgebra/Matrix/SchurComplement.lean
398
401
theorem det_fromBlocks_one₁₁ (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) : (Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by
haveI : Invertible (1 : Matrix m m α) := invertibleOne rw [det_fromBlocks₁₁, invOf_one, Matrix.mul_one, det_one, one_mul]
[ " A.fromBlocks B C D = fromBlocks 1 0 (C * ⅟A) 1 * A.fromBlocks 0 0 (D - C * ⅟A * B) * fromBlocks 1 (⅟A * B) 0 1", " (reindex (Equiv.sumComm l n) (Equiv.sumComm m n)) (A.fromBlocks B C D) =\n (reindex (Equiv.sumComm l n) (Equiv.sumComm m n))\n (fromBlocks 1 (B * ⅟D) 0 1 * (A - B * ⅟D * C).fromBlocks 0 0 D...
[ " A.fromBlocks B C D = fromBlocks 1 0 (C * ⅟A) 1 * A.fromBlocks 0 0 (D - C * ⅟A * B) * fromBlocks 1 (⅟A * B) 0 1", " (reindex (Equiv.sumComm l n) (Equiv.sumComm m n)) (A.fromBlocks B C D) =\n (reindex (Equiv.sumComm l n) (Equiv.sumComm m n))\n (fromBlocks 1 (B * ⅟D) 0 1 * (A - B * ⅟D * C).fromBlocks 0 0 D...
import Mathlib.NumberTheory.Zsqrtd.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Data.Complex.Basic import Mathlib.Data.Real.Archimedean #align_import number_theory.zsqrtd.gaussian_int from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" open Zsqrtd Complex open scoped ComplexConjugate abbrev GaussianInt : Type := Zsqrtd (-1) #align gaussian_int GaussianInt local notation "ℤ[i]" => GaussianInt namespace GaussianInt instance : Repr ℤ[i] := ⟨fun x _ => "⟨" ++ repr x.re ++ ", " ++ repr x.im ++ "⟩"⟩ instance instCommRing : CommRing ℤ[i] := Zsqrtd.commRing #align gaussian_int.comm_ring GaussianInt.instCommRing section attribute [-instance] Complex.instField -- Avoid making things noncomputable unnecessarily. def toComplex : ℤ[i] →+* ℂ := Zsqrtd.lift ⟨I, by simp⟩ #align gaussian_int.to_complex GaussianInt.toComplex end instance : Coe ℤ[i] ℂ := ⟨toComplex⟩ theorem toComplex_def (x : ℤ[i]) : (x : ℂ) = x.re + x.im * I := rfl #align gaussian_int.to_complex_def GaussianInt.toComplex_def theorem toComplex_def' (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ) = x + y * I := by simp [toComplex_def] #align gaussian_int.to_complex_def' GaussianInt.toComplex_def' theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ := by apply Complex.ext <;> simp [toComplex_def] #align gaussian_int.to_complex_def₂ GaussianInt.toComplex_def₂ @[simp] theorem to_real_re (x : ℤ[i]) : ((x.re : ℤ) : ℝ) = (x : ℂ).re := by simp [toComplex_def] #align gaussian_int.to_real_re GaussianInt.to_real_re @[simp] theorem to_real_im (x : ℤ[i]) : ((x.im : ℤ) : ℝ) = (x : ℂ).im := by simp [toComplex_def] #align gaussian_int.to_real_im GaussianInt.to_real_im @[simp] theorem toComplex_re (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ).re = x := by simp [toComplex_def] #align gaussian_int.to_complex_re GaussianInt.toComplex_re @[simp] theorem toComplex_im (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ).im = y := by simp [toComplex_def] #align gaussian_int.to_complex_im GaussianInt.toComplex_im -- Porting note (#10618): @[simp] can prove this theorem toComplex_add (x y : ℤ[i]) : ((x + y : ℤ[i]) : ℂ) = x + y := toComplex.map_add _ _ #align gaussian_int.to_complex_add GaussianInt.toComplex_add -- Porting note (#10618): @[simp] can prove this theorem toComplex_mul (x y : ℤ[i]) : ((x * y : ℤ[i]) : ℂ) = x * y := toComplex.map_mul _ _ #align gaussian_int.to_complex_mul GaussianInt.toComplex_mul -- Porting note (#10618): @[simp] can prove this theorem toComplex_one : ((1 : ℤ[i]) : ℂ) = 1 := toComplex.map_one #align gaussian_int.to_complex_one GaussianInt.toComplex_one -- Porting note (#10618): @[simp] can prove this theorem toComplex_zero : ((0 : ℤ[i]) : ℂ) = 0 := toComplex.map_zero #align gaussian_int.to_complex_zero GaussianInt.toComplex_zero -- Porting note (#10618): @[simp] can prove this theorem toComplex_neg (x : ℤ[i]) : ((-x : ℤ[i]) : ℂ) = -x := toComplex.map_neg _ #align gaussian_int.to_complex_neg GaussianInt.toComplex_neg -- Porting note (#10618): @[simp] can prove this theorem toComplex_sub (x y : ℤ[i]) : ((x - y : ℤ[i]) : ℂ) = x - y := toComplex.map_sub _ _ #align gaussian_int.to_complex_sub GaussianInt.toComplex_sub @[simp] theorem toComplex_star (x : ℤ[i]) : ((star x : ℤ[i]) : ℂ) = conj (x : ℂ) := by rw [toComplex_def₂, toComplex_def₂] exact congr_arg₂ _ rfl (Int.cast_neg _) #align gaussian_int.to_complex_star GaussianInt.toComplex_star @[simp] theorem toComplex_inj {x y : ℤ[i]} : (x : ℂ) = y ↔ x = y := by cases x; cases y; simp [toComplex_def₂] #align gaussian_int.to_complex_inj GaussianInt.toComplex_inj lemma toComplex_injective : Function.Injective GaussianInt.toComplex := fun ⦃_ _⦄ ↦ toComplex_inj.mp @[simp] theorem toComplex_eq_zero {x : ℤ[i]} : (x : ℂ) = 0 ↔ x = 0 := by rw [← toComplex_zero, toComplex_inj] #align gaussian_int.to_complex_eq_zero GaussianInt.toComplex_eq_zero @[simp]
Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean
154
155
theorem intCast_real_norm (x : ℤ[i]) : (x.norm : ℝ) = Complex.normSq (x : ℂ) := by
rw [Zsqrtd.norm, normSq]; simp
[ " I * I = ↑(-1)", " toComplex { re := x, im := y } = ↑x + ↑y * I", " toComplex x = { re := ↑x.re, im := ↑x.im }", " (toComplex x).re = { re := ↑x.re, im := ↑x.im }.re", " (toComplex x).im = { re := ↑x.re, im := ↑x.im }.im", " ↑x.re = (toComplex x).re", " ↑x.im = (toComplex x).im", " (toComplex { re :=...
[ " I * I = ↑(-1)", " toComplex { re := x, im := y } = ↑x + ↑y * I", " toComplex x = { re := ↑x.re, im := ↑x.im }", " (toComplex x).re = { re := ↑x.re, im := ↑x.im }.re", " (toComplex x).im = { re := ↑x.re, im := ↑x.im }.im", " ↑x.re = (toComplex x).re", " ↑x.im = (toComplex x).im", " (toComplex { re :=...
import Mathlib.CategoryTheory.EpiMono import Mathlib.CategoryTheory.Functor.FullyFaithful import Mathlib.Tactic.PPWithUniv import Mathlib.Data.Set.Defs #align_import category_theory.types from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace CategoryTheory -- morphism levels before object levels. See note [CategoryTheory universes]. universe v v' w u u' @[to_additive existing CategoryTheory.types] instance types : LargeCategory (Type u) where Hom a b := a → b id a := id comp f g := g ∘ f #align category_theory.types CategoryTheory.types theorem types_hom {α β : Type u} : (α ⟶ β) = (α → β) := rfl #align category_theory.types_hom CategoryTheory.types_hom -- porting note (#10688): this lemma was not here in Lean 3. Lean 3 `ext` would solve this goal -- because of its "if all else fails, apply all `ext` lemmas" policy, -- which apparently we want to move away from. @[ext] theorem types_ext {α β : Type u} (f g : α ⟶ β) (h : ∀ a : α, f a = g a) : f = g := by funext x exact h x theorem types_id (X : Type u) : 𝟙 X = id := rfl #align category_theory.types_id CategoryTheory.types_id theorem types_comp {X Y Z : Type u} (f : X ⟶ Y) (g : Y ⟶ Z) : f ≫ g = g ∘ f := rfl #align category_theory.types_comp CategoryTheory.types_comp @[simp] theorem types_id_apply (X : Type u) (x : X) : (𝟙 X : X → X) x = x := rfl #align category_theory.types_id_apply CategoryTheory.types_id_apply @[simp] theorem types_comp_apply {X Y Z : Type u} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g) x = g (f x) := rfl #align category_theory.types_comp_apply CategoryTheory.types_comp_apply @[simp] theorem hom_inv_id_apply {X Y : Type u} (f : X ≅ Y) (x : X) : f.inv (f.hom x) = x := congr_fun f.hom_inv_id x #align category_theory.hom_inv_id_apply CategoryTheory.hom_inv_id_apply @[simp] theorem inv_hom_id_apply {X Y : Type u} (f : X ≅ Y) (y : Y) : f.hom (f.inv y) = y := congr_fun f.inv_hom_id y #align category_theory.inv_hom_id_apply CategoryTheory.inv_hom_id_apply -- Unfortunately without this wrapper we can't use `CategoryTheory` idioms, such as `IsIso f`. abbrev asHom {α β : Type u} (f : α → β) : α ⟶ β := f #align category_theory.as_hom CategoryTheory.asHom @[inherit_doc] scoped notation "↾" f:200 => CategoryTheory.asHom f section -- We verify the expected type checking behaviour of `asHom` variable (α β γ : Type u) (f : α → β) (g : β → γ) example : α → γ := ↾f ≫ ↾g example [IsIso (↾f)] : Mono (↾f) := by infer_instance example [IsIso (↾f)] : ↾f ≫ inv (↾f) = 𝟙 α := by simp end def uliftTrivial (V : Type u) : ULift.{u} V ≅ V where hom a := a.1 inv a := .up a #align category_theory.ulift_trivial CategoryTheory.uliftTrivial @[pp_with_univ] def uliftFunctor : Type u ⥤ Type max u v where obj X := ULift.{v} X map {X} {Y} f := fun x : ULift.{v} X => ULift.up (f x.down) #align category_theory.ulift_functor CategoryTheory.uliftFunctor @[simp] theorem uliftFunctor_map {X Y : Type u} (f : X ⟶ Y) (x : ULift.{v} X) : uliftFunctor.map f x = ULift.up (f x.down) := rfl #align category_theory.ulift_functor_map CategoryTheory.uliftFunctor_map instance uliftFunctor_full : Functor.Full.{u} uliftFunctor where map_surjective f := ⟨fun x => (f (ULift.up x)).down, rfl⟩ #align category_theory.ulift_functor_full CategoryTheory.uliftFunctor_full instance uliftFunctor_faithful : uliftFunctor.Faithful where map_injective {_X} {_Y} f g p := funext fun x => congr_arg ULift.down (congr_fun p (ULift.up x) : ULift.up (f x) = ULift.up (g x)) #align category_theory.ulift_functor_faithful CategoryTheory.uliftFunctor_faithful def uliftFunctorTrivial : uliftFunctor.{u, u} ≅ 𝟭 _ := NatIso.ofComponents uliftTrivial #align category_theory.ulift_functor_trivial CategoryTheory.uliftFunctorTrivial -- TODO We should connect this to a general story about concrete categories -- whose forgetful functor is representable. def homOfElement {X : Type u} (x : X) : PUnit ⟶ X := fun _ => x #align category_theory.hom_of_element CategoryTheory.homOfElement theorem homOfElement_eq_iff {X : Type u} (x y : X) : homOfElement x = homOfElement y ↔ x = y := ⟨fun H => congr_fun H PUnit.unit, by aesop⟩ #align category_theory.hom_of_element_eq_iff CategoryTheory.homOfElement_eq_iff theorem mono_iff_injective {X Y : Type u} (f : X ⟶ Y) : Mono f ↔ Function.Injective f := by constructor · intro H x x' h rw [← homOfElement_eq_iff] at h ⊢ exact (cancel_mono f).mp h · exact fun H => ⟨fun g g' h => H.comp_left h⟩ #align category_theory.mono_iff_injective CategoryTheory.mono_iff_injective theorem injective_of_mono {X Y : Type u} (f : X ⟶ Y) [hf : Mono f] : Function.Injective f := (mono_iff_injective f).1 hf #align category_theory.injective_of_mono CategoryTheory.injective_of_mono
Mathlib/CategoryTheory/Types.lean
272
280
theorem epi_iff_surjective {X Y : Type u} (f : X ⟶ Y) : Epi f ↔ Function.Surjective f := by
constructor · rintro ⟨H⟩ refine Function.surjective_of_right_cancellable_Prop fun g₁ g₂ hg => ?_ rw [← Equiv.ulift.symm.injective.comp_left.eq_iff] apply H change ULift.up ∘ g₁ ∘ f = ULift.up ∘ g₂ ∘ f rw [hg] · exact fun H => ⟨fun g g' h => H.injective_comp_right h⟩
[ " f = g", " f x = g x", " Mono (↾f)", " ↾f ≫ inv (↾f) = 𝟙 α", " x = y → homOfElement x = homOfElement y", " Mono f ↔ Function.Injective f", " Mono f → Function.Injective f", " x = x'", " homOfElement x = homOfElement x'", " Function.Injective f → Mono f", " Epi f ↔ Function.Surjective f", " E...
[ " f = g", " f x = g x", " Mono (↾f)", " ↾f ≫ inv (↾f) = 𝟙 α", " x = y → homOfElement x = homOfElement y", " Mono f ↔ Function.Injective f", " Mono f → Function.Injective f", " x = x'", " homOfElement x = homOfElement x'", " Function.Injective f → Mono f", " Epi f ↔ Function.Surjective f" ]
import Mathlib.LinearAlgebra.Dimension.Finrank import Mathlib.LinearAlgebra.InvariantBasisNumber #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v w w' variable {R : Type u} {M : Type v} [Ring R] [AddCommGroup M] [Module R M] variable {ι : Type w} {ι' : Type w'} open Cardinal Basis Submodule Function Set attribute [local instance] nontrivial_of_invariantBasisNumber section StrongRankCondition variable [StrongRankCondition R] open Submodule -- An auxiliary lemma for `linearIndependent_le_span'`, -- with the additional assumption that the linearly independent family is finite.
Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean
177
191
theorem linearIndependent_le_span_aux' {ι : Type*} [Fintype ι] (v : ι → M) (i : LinearIndependent R v) (w : Set M) [Fintype w] (s : range v ≤ span R w) : Fintype.card ι ≤ Fintype.card w := by
-- We construct an injective linear map `(ι → R) →ₗ[R] (w → R)`, -- by thinking of `f : ι → R` as a linear combination of the finite family `v`, -- and expressing that (using the axiom of choice) as a linear combination over `w`. -- We can do this linearly by constructing the map on a basis. fapply card_le_of_injective' R · apply Finsupp.total exact fun i => Span.repr R w ⟨v i, s (mem_range_self i)⟩ · intro f g h apply_fun Finsupp.total w M R (↑) at h simp only [Finsupp.total_total, Submodule.coe_mk, Span.finsupp_total_repr] at h rw [← sub_eq_zero, ← LinearMap.map_sub] at h exact sub_eq_zero.mp (linearIndependent_iff.mp i _ h)
[ " Fintype.card ι ≤ Fintype.card ↑w", " (ι →₀ R) →ₗ[R] ↑w →₀ R", " ι → ↑w →₀ R", " Injective ⇑(Finsupp.total ι (↑w →₀ R) R fun i => Span.repr R w ⟨v i, ⋯⟩)", " f = g" ]
[ " Fintype.card ι ≤ Fintype.card ↑w" ]
import Mathlib.RingTheory.WittVector.StructurePolynomial #align_import ring_theory.witt_vector.defs from "leanprover-community/mathlib"@"f1944b30c97c5eb626e498307dec8b022a05bd0a" noncomputable section structure WittVector (p : ℕ) (R : Type*) where mk' :: coeff : ℕ → R #align witt_vector WittVector -- Porting note: added to make the `p` argument explicit def WittVector.mk (p : ℕ) {R : Type*} (coeff : ℕ → R) : WittVector p R := mk' coeff variable {p : ℕ} local notation "𝕎" => WittVector p -- type as `\bbW` namespace WittVector variable {R : Type*} @[ext]
Mathlib/RingTheory/WittVector/Defs.lean
74
78
theorem ext {x y : 𝕎 R} (h : ∀ n, x.coeff n = y.coeff n) : x = y := by
cases x cases y simp only at h simp [Function.funext_iff, h]
[ " x = y", " { coeff := coeff✝ } = y", " { coeff := coeff✝¹ } = { coeff := coeff✝ }" ]
[ " x = y" ]
import Mathlib.Algebra.Field.Basic import Mathlib.Deprecated.Subring #align_import deprecated.subfield from "leanprover-community/mathlib"@"bd9851ca476957ea4549eb19b40e7b5ade9428cc" variable {F : Type*} [Field F] (S : Set F) structure IsSubfield extends IsSubring S : Prop where inv_mem : ∀ {x : F}, x ∈ S → x⁻¹ ∈ S #align is_subfield IsSubfield theorem IsSubfield.div_mem {S : Set F} (hS : IsSubfield S) {x y : F} (hx : x ∈ S) (hy : y ∈ S) : x / y ∈ S := by rw [div_eq_mul_inv] exact hS.toIsSubring.toIsSubmonoid.mul_mem hx (hS.inv_mem hy) #align is_subfield.div_mem IsSubfield.div_mem theorem IsSubfield.pow_mem {a : F} {n : ℤ} {s : Set F} (hs : IsSubfield s) (h : a ∈ s) : a ^ n ∈ s := by cases' n with n n · suffices a ^ (n : ℤ) ∈ s by exact this rw [zpow_natCast] exact hs.toIsSubring.toIsSubmonoid.pow_mem h · rw [zpow_negSucc] exact hs.inv_mem (hs.toIsSubring.toIsSubmonoid.pow_mem h) #align is_subfield.pow_mem IsSubfield.pow_mem theorem Univ.isSubfield : IsSubfield (@Set.univ F) := { Univ.isSubmonoid, IsAddSubgroup.univ_addSubgroup with inv_mem := fun _ ↦ trivial } #align univ.is_subfield Univ.isSubfield theorem Preimage.isSubfield {K : Type*} [Field K] (f : F →+* K) {s : Set K} (hs : IsSubfield s) : IsSubfield (f ⁻¹' s) := { f.isSubring_preimage hs.toIsSubring with inv_mem := fun {a} (ha : f a ∈ s) ↦ show f a⁻¹ ∈ s by rw [map_inv₀] exact hs.inv_mem ha } #align preimage.is_subfield Preimage.isSubfield theorem Image.isSubfield {K : Type*} [Field K] (f : F →+* K) {s : Set F} (hs : IsSubfield s) : IsSubfield (f '' s) := { f.isSubring_image hs.toIsSubring with inv_mem := fun ⟨x, xmem, ha⟩ ↦ ⟨x⁻¹, hs.inv_mem xmem, ha ▸ map_inv₀ f x⟩ } #align image.is_subfield Image.isSubfield theorem Range.isSubfield {K : Type*} [Field K] (f : F →+* K) : IsSubfield (Set.range f) := by rw [← Set.image_univ] apply Image.isSubfield _ Univ.isSubfield #align range.is_subfield Range.isSubfield namespace Field def closure : Set F := { x | ∃ y ∈ Ring.closure S, ∃ z ∈ Ring.closure S, y / z = x } #align field.closure Field.closure variable {S} theorem ring_closure_subset : Ring.closure S ⊆ closure S := fun x hx ↦ ⟨x, hx, 1, Ring.closure.isSubring.toIsSubmonoid.one_mem, div_one x⟩ #align field.ring_closure_subset Field.ring_closure_subset theorem closure.isSubmonoid : IsSubmonoid (closure S) := { mul_mem := by rintro _ _ ⟨p, hp, q, hq, hq0, rfl⟩ ⟨r, hr, s, hs, hs0, rfl⟩ exact ⟨p * r, IsSubmonoid.mul_mem Ring.closure.isSubring.toIsSubmonoid hp hr, q * s, IsSubmonoid.mul_mem Ring.closure.isSubring.toIsSubmonoid hq hs, (div_mul_div_comm _ _ _ _).symm⟩ one_mem := ring_closure_subset <| IsSubmonoid.one_mem Ring.closure.isSubring.toIsSubmonoid } #align field.closure.is_submonoid Field.closure.isSubmonoid
Mathlib/Deprecated/Subfield.lean
102
123
theorem closure.isSubfield : IsSubfield (closure S) := { closure.isSubmonoid with add_mem := by
intro a b ha hb rcases id ha with ⟨p, hp, q, hq, rfl⟩ rcases id hb with ⟨r, hr, s, hs, rfl⟩ by_cases hq0 : q = 0 · rwa [hq0, div_zero, zero_add] by_cases hs0 : s = 0 · rwa [hs0, div_zero, add_zero] exact ⟨p * s + q * r, IsAddSubmonoid.add_mem Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid (Ring.closure.isSubring.toIsSubmonoid.mul_mem hp hs) (Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hr), q * s, Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hs, (div_add_div p r hq0 hs0).symm⟩ zero_mem := ring_closure_subset Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid.zero_mem neg_mem := by rintro _ ⟨p, hp, q, hq, rfl⟩ exact ⟨-p, Ring.closure.isSubring.toIsAddSubgroup.neg_mem hp, q, hq, neg_div q p⟩ inv_mem := by rintro _ ⟨p, hp, q, hq, rfl⟩ exact ⟨q, hq, p, hp, (inv_div _ _).symm⟩ }
[ " x / y ∈ S", " x * y⁻¹ ∈ S", " a ^ n ∈ s", " a ^ Int.ofNat n ∈ s", " a ^ ↑n ∈ s", " a ^ Int.negSucc n ∈ s", " (a ^ (n + 1))⁻¹ ∈ s", " f a⁻¹ ∈ s", " (f a)⁻¹ ∈ s", " IsSubfield (Set.range ⇑f)", " IsSubfield (⇑f '' Set.univ)", " ∀ {a b : F}, a ∈ closure S → b ∈ closure S → a * b ∈ closure S", ...
[ " x / y ∈ S", " x * y⁻¹ ∈ S", " a ^ n ∈ s", " a ^ Int.ofNat n ∈ s", " a ^ ↑n ∈ s", " a ^ Int.negSucc n ∈ s", " (a ^ (n + 1))⁻¹ ∈ s", " f a⁻¹ ∈ s", " (f a)⁻¹ ∈ s", " IsSubfield (Set.range ⇑f)", " IsSubfield (⇑f '' Set.univ)", " ∀ {a b : F}, a ∈ closure S → b ∈ closure S → a * b ∈ closure S", ...
import Mathlib.Data.Nat.Squarefree import Mathlib.NumberTheory.Zsqrtd.QuadraticReciprocity import Mathlib.Tactic.LinearCombination #align_import number_theory.sum_two_squares from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section General theorem sq_add_sq_mul {R} [CommRing R] {a b x y u v : R} (ha : a = x ^ 2 + y ^ 2) (hb : b = u ^ 2 + v ^ 2) : ∃ r s : R, a * b = r ^ 2 + s ^ 2 := ⟨x * u - y * v, x * v + y * u, by rw [ha, hb]; ring⟩ #align sq_add_sq_mul sq_add_sq_mul
Mathlib/NumberTheory/SumTwoSquares.lean
56
61
theorem Nat.sq_add_sq_mul {a b x y u v : ℕ} (ha : a = x ^ 2 + y ^ 2) (hb : b = u ^ 2 + v ^ 2) : ∃ r s : ℕ, a * b = r ^ 2 + s ^ 2 := by
zify at ha hb ⊢ obtain ⟨r, s, h⟩ := _root_.sq_add_sq_mul ha hb refine ⟨r.natAbs, s.natAbs, ?_⟩ simpa only [Int.natCast_natAbs, sq_abs]
[ " a * b = (x * u - y * v) ^ 2 + (x * v + y * u) ^ 2", " (x ^ 2 + y ^ 2) * (u ^ 2 + v ^ 2) = (x * u - y * v) ^ 2 + (x * v + y * u) ^ 2", " ∃ r s, a * b = r ^ 2 + s ^ 2", " ∃ r s, ↑a * ↑b = ↑r ^ 2 + ↑s ^ 2", " ↑a * ↑b = ↑r.natAbs ^ 2 + ↑s.natAbs ^ 2" ]
[ " a * b = (x * u - y * v) ^ 2 + (x * v + y * u) ^ 2", " (x ^ 2 + y ^ 2) * (u ^ 2 + v ^ 2) = (x * u - y * v) ^ 2 + (x * v + y * u) ^ 2", " ∃ r s, a * b = r ^ 2 + s ^ 2" ]
import Mathlib.Logic.Function.Basic import Mathlib.Tactic.MkIffOfInductiveProp #align_import data.sum.basic from "leanprover-community/mathlib"@"bd9851ca476957ea4549eb19b40e7b5ade9428cc" universe u v w x variable {α : Type u} {α' : Type w} {β : Type v} {β' : Type x} {γ δ : Type*} namespace Sum #align sum.forall Sum.forall #align sum.exists Sum.exists theorem exists_sum {γ : α ⊕ β → Sort*} (p : (∀ ab, γ ab) → Prop) : (∃ fab, p fab) ↔ (∃ fa fb, p (Sum.rec fa fb)) := by rw [← not_forall_not, forall_sum] simp theorem inl_injective : Function.Injective (inl : α → Sum α β) := fun _ _ ↦ inl.inj #align sum.inl_injective Sum.inl_injective theorem inr_injective : Function.Injective (inr : β → Sum α β) := fun _ _ ↦ inr.inj #align sum.inr_injective Sum.inr_injective theorem sum_rec_congr (P : α ⊕ β → Sort*) (f : ∀ i, P (inl i)) (g : ∀ i, P (inr i)) {x y : α ⊕ β} (h : x = y) : @Sum.rec _ _ _ f g x = cast (congr_arg P h.symm) (@Sum.rec _ _ _ f g y) := by cases h; rfl section get #align sum.is_left Sum.isLeft #align sum.is_right Sum.isRight #align sum.get_left Sum.getLeft? #align sum.get_right Sum.getRight? variable {x y : Sum α β} #align sum.get_left_eq_none_iff Sum.getLeft?_eq_none_iff #align sum.get_right_eq_none_iff Sum.getRight?_eq_none_iff theorem eq_left_iff_getLeft_eq {a : α} : x = inl a ↔ ∃ h, x.getLeft h = a := by cases x <;> simp theorem eq_right_iff_getRight_eq {b : β} : x = inr b ↔ ∃ h, x.getRight h = b := by cases x <;> simp #align sum.get_left_eq_some_iff Sum.getLeft?_eq_some_iff #align sum.get_right_eq_some_iff Sum.getRight?_eq_some_iff
Mathlib/Data/Sum/Basic.lean
63
64
theorem getLeft_eq_getLeft? (h₁ : x.isLeft) (h₂ : x.getLeft?.isSome) : x.getLeft h₁ = x.getLeft?.get h₂ := by
simp [← getLeft?_eq_some_iff]
[ " (∃ fab, p fab) ↔ ∃ fa fb, p fun t => rec fa fb t", " (¬∀ (fa : (val : α) → γ (inl val)) (fb : (val : β) → γ (inr val)), ¬p fun t => rec fa fb t) ↔\n ∃ fa fb, p fun t => rec fa fb t", " rec f g x = cast ⋯ (rec f g y)", " rec f g x = cast ⋯ (rec f g x)", " x = inl a ↔ ∃ h, x.getLeft h = a", " inl val✝ ...
[ " (∃ fab, p fab) ↔ ∃ fa fb, p fun t => rec fa fb t", " (¬∀ (fa : (val : α) → γ (inl val)) (fb : (val : β) → γ (inr val)), ¬p fun t => rec fa fb t) ↔\n ∃ fa fb, p fun t => rec fa fb t", " rec f g x = cast ⋯ (rec f g y)", " rec f g x = cast ⋯ (rec f g x)", " x = inl a ↔ ∃ h, x.getLeft h = a", " inl val✝ ...
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.Order.Invertible import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Algebra.Order.Group.Instances import Mathlib.LinearAlgebra.AffineSpace.Slope import Mathlib.LinearAlgebra.AffineSpace.Midpoint import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.ordered from "leanprover-community/mathlib"@"78261225eb5cedc61c5c74ecb44e5b385d13b733" open AffineMap variable {k E PE : Type*} section OrderedRing variable [OrderedRing k] [OrderedAddCommGroup E] [Module k E] [OrderedSMul k E] variable {a a' b b' : E} {r r' : k} theorem lineMap_mono_left (ha : a ≤ a') (hr : r ≤ 1) : lineMap a b r ≤ lineMap a' b r := by simp only [lineMap_apply_module] exact add_le_add_right (smul_le_smul_of_nonneg_left ha (sub_nonneg.2 hr)) _ #align line_map_mono_left lineMap_mono_left theorem lineMap_strict_mono_left (ha : a < a') (hr : r < 1) : lineMap a b r < lineMap a' b r := by simp only [lineMap_apply_module] exact add_lt_add_right (smul_lt_smul_of_pos_left ha (sub_pos.2 hr)) _ #align line_map_strict_mono_left lineMap_strict_mono_left theorem lineMap_mono_right (hb : b ≤ b') (hr : 0 ≤ r) : lineMap a b r ≤ lineMap a b' r := by simp only [lineMap_apply_module] exact add_le_add_left (smul_le_smul_of_nonneg_left hb hr) _ #align line_map_mono_right lineMap_mono_right
Mathlib/LinearAlgebra/AffineSpace/Ordered.lean
67
69
theorem lineMap_strict_mono_right (hb : b < b') (hr : 0 < r) : lineMap a b r < lineMap a b' r := by
simp only [lineMap_apply_module] exact add_lt_add_left (smul_lt_smul_of_pos_left hb hr) _
[ " (lineMap a b) r ≤ (lineMap a' b) r", " (1 - r) • a + r • b ≤ (1 - r) • a' + r • b", " (lineMap a b) r < (lineMap a' b) r", " (1 - r) • a + r • b < (1 - r) • a' + r • b", " (lineMap a b) r ≤ (lineMap a b') r", " (1 - r) • a + r • b ≤ (1 - r) • a + r • b'", " (lineMap a b) r < (lineMap a b') r", " (1 ...
[ " (lineMap a b) r ≤ (lineMap a' b) r", " (1 - r) • a + r • b ≤ (1 - r) • a' + r • b", " (lineMap a b) r < (lineMap a' b) r", " (1 - r) • a + r • b < (1 - r) • a' + r • b", " (lineMap a b) r ≤ (lineMap a b') r", " (1 - r) • a + r • b ≤ (1 - r) • a + r • b'", " (lineMap a b) r < (lineMap a b') r" ]
import Mathlib.Algebra.Order.Monoid.Defs import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Util.AssertExists #align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce" open Function universe u variable {α : Type u} class OrderedAddCommGroup (α : Type u) extends AddCommGroup α, PartialOrder α where protected add_le_add_left : ∀ a b : α, a ≤ b → ∀ c : α, c + a ≤ c + b #align ordered_add_comm_group OrderedAddCommGroup class OrderedCommGroup (α : Type u) extends CommGroup α, PartialOrder α where protected mul_le_mul_left : ∀ a b : α, a ≤ b → ∀ c : α, c * a ≤ c * b #align ordered_comm_group OrderedCommGroup attribute [to_additive] OrderedCommGroup @[to_additive] instance OrderedCommGroup.to_covariantClass_left_le (α : Type u) [OrderedCommGroup α] : CovariantClass α α (· * ·) (· ≤ ·) where elim a b c bc := OrderedCommGroup.mul_le_mul_left b c bc a #align ordered_comm_group.to_covariant_class_left_le OrderedCommGroup.to_covariantClass_left_le #align ordered_add_comm_group.to_covariant_class_left_le OrderedAddCommGroup.to_covariantClass_left_le -- See note [lower instance priority] @[to_additive OrderedAddCommGroup.toOrderedCancelAddCommMonoid] instance (priority := 100) OrderedCommGroup.toOrderedCancelCommMonoid [OrderedCommGroup α] : OrderedCancelCommMonoid α := { ‹OrderedCommGroup α› with le_of_mul_le_mul_left := fun a b c ↦ le_of_mul_le_mul_left' } #align ordered_comm_group.to_ordered_cancel_comm_monoid OrderedCommGroup.toOrderedCancelCommMonoid #align ordered_add_comm_group.to_ordered_cancel_add_comm_monoid OrderedAddCommGroup.toOrderedCancelAddCommMonoid example (α : Type u) [OrderedAddCommGroup α] : CovariantClass α α (swap (· + ·)) (· < ·) := IsRightCancelAdd.covariant_swap_add_lt_of_covariant_swap_add_le α -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- It was introduced in https://github.com/leanprover-community/mathlib/pull/17564 -- but without the motivation clearly explained. @[to_additive "A choice-free shortcut instance."] theorem OrderedCommGroup.to_contravariantClass_left_le (α : Type u) [OrderedCommGroup α] : ContravariantClass α α (· * ·) (· ≤ ·) where elim a b c bc := by simpa using mul_le_mul_left' bc a⁻¹ #align ordered_comm_group.to_contravariant_class_left_le OrderedCommGroup.to_contravariantClass_left_le #align ordered_add_comm_group.to_contravariant_class_left_le OrderedAddCommGroup.to_contravariantClass_left_le -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- See further explanation on `OrderedCommGroup.to_contravariantClass_left_le`. @[to_additive "A choice-free shortcut instance."] theorem OrderedCommGroup.to_contravariantClass_right_le (α : Type u) [OrderedCommGroup α] : ContravariantClass α α (swap (· * ·)) (· ≤ ·) where elim a b c bc := by simpa using mul_le_mul_right' bc a⁻¹ #align ordered_comm_group.to_contravariant_class_right_le OrderedCommGroup.to_contravariantClass_right_le #align ordered_add_comm_group.to_contravariant_class_right_le OrderedAddCommGroup.to_contravariantClass_right_le section Group variable [Group α] section Preorder variable [Preorder α] section CommGroup variable [CommGroup α] -- Most of the lemmas that are primed in this section appear in ordered_field. -- I (DT) did not try to minimise the assumptions. section Group variable [Group α] [LT α] section Right variable [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c d : α} @[to_additive (attr := simp)]
Mathlib/Algebra/Order/Group/Defs.lean
875
876
theorem div_lt_div_iff_right (c : α) : a / c < b / c ↔ a < b := by
simpa only [div_eq_mul_inv] using mul_lt_mul_iff_right _
[ " b ≤ c", " a / c < b / c ↔ a < b" ]
[ " b ≤ c", " a / c < b / c ↔ a < b" ]
import Mathlib.Data.Fintype.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.hall.finite from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce" open Finset universe u v namespace HallMarriageTheorem variable {ι : Type u} {α : Type v} [DecidableEq α] {t : ι → Finset α} section Fintype variable [Fintype ι] theorem hall_cond_of_erase {x : ι} (a : α) (ha : ∀ s : Finset ι, s.Nonempty → s ≠ univ → s.card < (s.biUnion t).card) (s' : Finset { x' : ι | x' ≠ x }) : s'.card ≤ (s'.biUnion fun x' => (t x').erase a).card := by haveI := Classical.decEq ι specialize ha (s'.image fun z => z.1) rw [image_nonempty, Finset.card_image_of_injective s' Subtype.coe_injective] at ha by_cases he : s'.Nonempty · have ha' : s'.card < (s'.biUnion fun x => t x).card := by convert ha he fun h => by simpa [← h] using mem_univ x using 2 ext x simp only [mem_image, mem_biUnion, exists_prop, SetCoe.exists, exists_and_right, exists_eq_right, Subtype.coe_mk] rw [← erase_biUnion] by_cases hb : a ∈ s'.biUnion fun x => t x · rw [card_erase_of_mem hb] exact Nat.le_sub_one_of_lt ha' · rw [erase_eq_of_not_mem hb] exact Nat.le_of_lt ha' · rw [nonempty_iff_ne_empty, not_not] at he subst s' simp #align hall_marriage_theorem.hall_cond_of_erase HallMarriageTheorem.hall_cond_of_erase
Mathlib/Combinatorics/Hall/Finite.lean
78
121
theorem hall_hard_inductive_step_A {n : ℕ} (hn : Fintype.card ι = n + 1) (ht : ∀ s : Finset ι, s.card ≤ (s.biUnion t).card) (ih : ∀ {ι' : Type u} [Fintype ι'] (t' : ι' → Finset α), Fintype.card ι' ≤ n → (∀ s' : Finset ι', s'.card ≤ (s'.biUnion t').card) → ∃ f : ι' → α, Function.Injective f ∧ ∀ x, f x ∈ t' x) (ha : ∀ s : Finset ι, s.Nonempty → s ≠ univ → s.card < (s.biUnion t).card) : ∃ f : ι → α, Function.Injective f ∧ ∀ x, f x ∈ t x := by
haveI : Nonempty ι := Fintype.card_pos_iff.mp (hn.symm ▸ Nat.succ_pos _) haveI := Classical.decEq ι -- Choose an arbitrary element `x : ι` and `y : t x`. let x := Classical.arbitrary ι have tx_ne : (t x).Nonempty := by rw [← Finset.card_pos] calc 0 < 1 := Nat.one_pos _ ≤ (Finset.biUnion {x} t).card := ht {x} _ = (t x).card := by rw [Finset.singleton_biUnion] choose y hy using tx_ne -- Restrict to everything except `x` and `y`. let ι' := { x' : ι | x' ≠ x } let t' : ι' → Finset α := fun x' => (t x').erase y have card_ι' : Fintype.card ι' = n := calc Fintype.card ι' = Fintype.card ι - 1 := Set.card_ne_eq _ _ = n := by rw [hn, Nat.add_succ_sub_one, add_zero] rcases ih t' card_ι'.le (hall_cond_of_erase y ha) with ⟨f', hfinj, hfr⟩ -- Extend the resulting function. refine ⟨fun z => if h : z = x then y else f' ⟨z, h⟩, ?_, ?_⟩ · rintro z₁ z₂ have key : ∀ {x}, y ≠ f' x := by intro x h simpa [t', ← h] using hfr x by_cases h₁ : z₁ = x <;> by_cases h₂ : z₂ = x <;> simp [h₁, h₂, hfinj.eq_iff, key, key.symm] · intro z simp only [ne_eq, Set.mem_setOf_eq] split_ifs with hz · rwa [hz] · specialize hfr ⟨z, hz⟩ rw [mem_erase] at hfr exact hfr.2
[ " s'.card ≤ (s'.biUnion fun x' => (t ↑x').erase a).card", " s'.card < (s'.biUnion fun x_1 => t ↑x_1).card", " False", " (s'.biUnion fun x_1 => t ↑x_1) = (image (fun z => ↑z) s').biUnion t", " (x ∈ s'.biUnion fun x => t ↑x) ↔ x ∈ (image (fun z => ↑z) s').biUnion t", " s'.card ≤ ((s'.biUnion fun x' => t ↑x'...
[ " s'.card ≤ (s'.biUnion fun x' => (t ↑x').erase a).card", " s'.card < (s'.biUnion fun x_1 => t ↑x_1).card", " False", " (s'.biUnion fun x_1 => t ↑x_1) = (image (fun z => ↑z) s').biUnion t", " (x ∈ s'.biUnion fun x => t ↑x) ↔ x ∈ (image (fun z => ↑z) s').biUnion t", " s'.card ≤ ((s'.biUnion fun x' => t ↑x'...
import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.GeomSum import Mathlib.LinearAlgebra.Matrix.Block import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.Nondegenerate #align_import linear_algebra.vandermonde from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" variable {R : Type*} [CommRing R] open Equiv Finset open Matrix namespace Matrix def vandermonde {n : ℕ} (v : Fin n → R) : Matrix (Fin n) (Fin n) R := fun i j => v i ^ (j : ℕ) #align matrix.vandermonde Matrix.vandermonde @[simp] theorem vandermonde_apply {n : ℕ} (v : Fin n → R) (i j) : vandermonde v i j = v i ^ (j : ℕ) := rfl #align matrix.vandermonde_apply Matrix.vandermonde_apply @[simp] theorem vandermonde_cons {n : ℕ} (v0 : R) (v : Fin n → R) : vandermonde (Fin.cons v0 v : Fin n.succ → R) = Fin.cons (fun (j : Fin n.succ) => v0 ^ (j : ℕ)) fun i => Fin.cons 1 fun j => v i * vandermonde v i j := by ext i j refine Fin.cases (by simp) (fun i => ?_) i refine Fin.cases (by simp) (fun j => ?_) j simp [pow_succ'] #align matrix.vandermonde_cons Matrix.vandermonde_cons theorem vandermonde_succ {n : ℕ} (v : Fin n.succ → R) : vandermonde v = Fin.cons (fun (j : Fin n.succ) => v 0 ^ (j : ℕ)) fun i => Fin.cons 1 fun j => v i.succ * vandermonde (Fin.tail v) i j := by conv_lhs => rw [← Fin.cons_self_tail v, vandermonde_cons] rfl #align matrix.vandermonde_succ Matrix.vandermonde_succ theorem vandermonde_mul_vandermonde_transpose {n : ℕ} (v w : Fin n → R) (i j) : (vandermonde v * (vandermonde w)ᵀ) i j = ∑ k : Fin n, (v i * w j) ^ (k : ℕ) := by simp only [vandermonde_apply, Matrix.mul_apply, Matrix.transpose_apply, mul_pow] #align matrix.vandermonde_mul_vandermonde_transpose Matrix.vandermonde_mul_vandermonde_transpose theorem vandermonde_transpose_mul_vandermonde {n : ℕ} (v : Fin n → R) (i j) : ((vandermonde v)ᵀ * vandermonde v) i j = ∑ k : Fin n, v k ^ (i + j : ℕ) := by simp only [vandermonde_apply, Matrix.mul_apply, Matrix.transpose_apply, pow_add] #align matrix.vandermonde_transpose_mul_vandermonde Matrix.vandermonde_transpose_mul_vandermonde
Mathlib/LinearAlgebra/Vandermonde.lean
77
139
theorem det_vandermonde {n : ℕ} (v : Fin n → R) : det (vandermonde v) = ∏ i : Fin n, ∏ j ∈ Ioi i, (v j - v i) := by
unfold vandermonde induction' n with n ih · exact det_eq_one_of_card_eq_zero (Fintype.card_fin 0) calc det (of fun i j : Fin n.succ => v i ^ (j : ℕ)) = det (of fun i j : Fin n.succ => Matrix.vecCons (v 0 ^ (j : ℕ)) (fun i => v (Fin.succ i) ^ (j : ℕ) - v 0 ^ (j : ℕ)) i) := det_eq_of_forall_row_eq_smul_add_const (Matrix.vecCons 0 1) 0 (Fin.cons_zero _ _) ?_ _ = det (of fun i j : Fin n => Matrix.vecCons (v 0 ^ (j.succ : ℕ)) (fun i : Fin n => v (Fin.succ i) ^ (j.succ : ℕ) - v 0 ^ (j.succ : ℕ)) (Fin.succAbove 0 i)) := by simp_rw [det_succ_column_zero, Fin.sum_univ_succ, of_apply, Matrix.cons_val_zero, submatrix, of_apply, Matrix.cons_val_succ, Fin.val_zero, pow_zero, one_mul, sub_self, mul_zero, zero_mul, Finset.sum_const_zero, add_zero] _ = det (of fun i j : Fin n => (v (Fin.succ i) - v 0) * ∑ k ∈ Finset.range (j + 1 : ℕ), v i.succ ^ k * v 0 ^ (j - k : ℕ) : Matrix _ _ R) := by congr ext i j rw [Fin.succAbove_zero, Matrix.cons_val_succ, Fin.val_succ, mul_comm] exact (geom_sum₂_mul (v i.succ) (v 0) (j + 1 : ℕ)).symm _ = (∏ i ∈ Finset.univ, (v (Fin.succ i) - v 0)) * det fun i j : Fin n => ∑ k ∈ Finset.range (j + 1 : ℕ), v i.succ ^ k * v 0 ^ (j - k : ℕ) := (det_mul_column (fun i => v (Fin.succ i) - v 0) _) _ = (∏ i ∈ Finset.univ, (v (Fin.succ i) - v 0)) * det fun i j : Fin n => v (Fin.succ i) ^ (j : ℕ) := congr_arg _ ?_ _ = ∏ i : Fin n.succ, ∏ j ∈ Ioi i, (v j - v i) := by simp_rw [Fin.prod_univ_succ, Fin.prod_Ioi_zero, Fin.prod_Ioi_succ] have h := ih (v ∘ Fin.succ) unfold Function.comp at h rw [h] · intro i j simp_rw [of_apply] rw [Matrix.cons_val_zero] refine Fin.cases ?_ (fun i => ?_) i · simp rw [Matrix.cons_val_succ, Matrix.cons_val_succ, Pi.one_apply] ring · cases n · rw [det_eq_one_of_card_eq_zero (Fintype.card_fin 0), det_eq_one_of_card_eq_zero (Fintype.card_fin 0)] apply det_eq_of_forall_col_eq_smul_add_pred fun _ => v 0 · intro j simp · intro i j simp only [smul_eq_mul, Pi.add_apply, Fin.val_succ, Fin.coe_castSucc, Pi.smul_apply] rw [Finset.sum_range_succ, add_comm, tsub_self, pow_zero, mul_one, Finset.mul_sum] congr 1 refine Finset.sum_congr rfl fun i' hi' => ?_ rw [mul_left_comm (v 0), Nat.succ_sub, pow_succ'] exact Nat.lt_succ_iff.mp (Finset.mem_range.mp hi')
[ " vandermonde (Fin.cons v0 v) = Fin.cons (fun j => v0 ^ ↑j) fun i => Fin.cons 1 fun j => v i * vandermonde v i j", " vandermonde (Fin.cons v0 v) i j =\n Fin.cons (fun j => v0 ^ ↑j) (fun i => Fin.cons 1 fun j => v i * vandermonde v i j) i j", " vandermonde (Fin.cons v0 v) 0 j =\n Fin.cons (fun j => v0 ^ ↑j...
[ " vandermonde (Fin.cons v0 v) = Fin.cons (fun j => v0 ^ ↑j) fun i => Fin.cons 1 fun j => v i * vandermonde v i j", " vandermonde (Fin.cons v0 v) i j =\n Fin.cons (fun j => v0 ^ ↑j) (fun i => Fin.cons 1 fun j => v i * vandermonde v i j) i j", " vandermonde (Fin.cons v0 v) 0 j =\n Fin.cons (fun j => v0 ^ ↑j...
import Mathlib.Logic.Relation import Mathlib.Order.GaloisConnection #align_import data.setoid.basic from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" variable {α : Type*} {β : Type*} def Setoid.Rel (r : Setoid α) : α → α → Prop := @Setoid.r _ r #align setoid.rel Setoid.Rel instance Setoid.decidableRel (r : Setoid α) [h : DecidableRel r.r] : DecidableRel r.Rel := h #align setoid.decidable_rel Setoid.decidableRel theorem Quotient.eq_rel {r : Setoid α} {x y} : (Quotient.mk' x : Quotient r) = Quotient.mk' y ↔ r.Rel x y := Quotient.eq #align quotient.eq_rel Quotient.eq_rel namespace Setoid @[ext] theorem ext' {r s : Setoid α} (H : ∀ a b, r.Rel a b ↔ s.Rel a b) : r = s := ext H #align setoid.ext' Setoid.ext' theorem ext_iff {r s : Setoid α} : r = s ↔ ∀ a b, r.Rel a b ↔ s.Rel a b := ⟨fun h _ _ => h ▸ Iff.rfl, ext'⟩ #align setoid.ext_iff Setoid.ext_iff theorem eq_iff_rel_eq {r₁ r₂ : Setoid α} : r₁ = r₂ ↔ r₁.Rel = r₂.Rel := ⟨fun h => h ▸ rfl, fun h => Setoid.ext' fun _ _ => h ▸ Iff.rfl⟩ #align setoid.eq_iff_rel_eq Setoid.eq_iff_rel_eq instance : LE (Setoid α) := ⟨fun r s => ∀ ⦃x y⦄, r.Rel x y → s.Rel x y⟩ theorem le_def {r s : Setoid α} : r ≤ s ↔ ∀ {x y}, r.Rel x y → s.Rel x y := Iff.rfl #align setoid.le_def Setoid.le_def @[refl] theorem refl' (r : Setoid α) (x) : r.Rel x x := r.iseqv.refl x #align setoid.refl' Setoid.refl' @[symm] theorem symm' (r : Setoid α) : ∀ {x y}, r.Rel x y → r.Rel y x := r.iseqv.symm #align setoid.symm' Setoid.symm' @[trans] theorem trans' (r : Setoid α) : ∀ {x y z}, r.Rel x y → r.Rel y z → r.Rel x z := r.iseqv.trans #align setoid.trans' Setoid.trans' theorem comm' (s : Setoid α) {x y} : s.Rel x y ↔ s.Rel y x := ⟨s.symm', s.symm'⟩ #align setoid.comm' Setoid.comm' def ker (f : α → β) : Setoid α := ⟨(· = ·) on f, eq_equivalence.comap f⟩ #align setoid.ker Setoid.ker @[simp] theorem ker_mk_eq (r : Setoid α) : ker (@Quotient.mk'' _ r) = r := ext' fun _ _ => Quotient.eq #align setoid.ker_mk_eq Setoid.ker_mk_eq theorem ker_apply_mk_out {f : α → β} (a : α) : f (haveI := Setoid.ker f; ⟦a⟧.out) = f a := @Quotient.mk_out _ (Setoid.ker f) a #align setoid.ker_apply_mk_out Setoid.ker_apply_mk_out theorem ker_apply_mk_out' {f : α → β} (a : α) : f (Quotient.mk _ a : Quotient <| Setoid.ker f).out' = f a := @Quotient.mk_out' _ (Setoid.ker f) a #align setoid.ker_apply_mk_out' Setoid.ker_apply_mk_out' theorem ker_def {f : α → β} {x y : α} : (ker f).Rel x y ↔ f x = f y := Iff.rfl #align setoid.ker_def Setoid.ker_def protected def prod (r : Setoid α) (s : Setoid β) : Setoid (α × β) where r x y := r.Rel x.1 y.1 ∧ s.Rel x.2 y.2 iseqv := ⟨fun x => ⟨r.refl' x.1, s.refl' x.2⟩, fun h => ⟨r.symm' h.1, s.symm' h.2⟩, fun h₁ h₂ => ⟨r.trans' h₁.1 h₂.1, s.trans' h₁.2 h₂.2⟩⟩ #align setoid.prod Setoid.prod instance : Inf (Setoid α) := ⟨fun r s => ⟨fun x y => r.Rel x y ∧ s.Rel x y, ⟨fun x => ⟨r.refl' x, s.refl' x⟩, fun h => ⟨r.symm' h.1, s.symm' h.2⟩, fun h1 h2 => ⟨r.trans' h1.1 h2.1, s.trans' h1.2 h2.2⟩⟩⟩⟩ theorem inf_def {r s : Setoid α} : (r ⊓ s).Rel = r.Rel ⊓ s.Rel := rfl #align setoid.inf_def Setoid.inf_def theorem inf_iff_and {r s : Setoid α} {x y} : (r ⊓ s).Rel x y ↔ r.Rel x y ∧ s.Rel x y := Iff.rfl #align setoid.inf_iff_and Setoid.inf_iff_and instance : InfSet (Setoid α) := ⟨fun S => { r := fun x y => ∀ r ∈ S, r.Rel x y iseqv := ⟨fun x r _ => r.refl' x, fun h r hr => r.symm' <| h r hr, fun h1 h2 r hr => r.trans' (h1 r hr) <| h2 r hr⟩ }⟩
Mathlib/Data/Setoid/Basic.lean
155
158
theorem sInf_def {s : Set (Setoid α)} : (sInf s).Rel = sInf (Rel '' s) := by
ext simp only [sInf_image, iInf_apply, iInf_Prop_eq] rfl
[ " (sInf s).Rel = sInf (Rel '' s)", " (sInf s).Rel x✝¹ x✝ ↔ sInf (Rel '' s) x✝¹ x✝", " (sInf s).Rel x✝¹ x✝ ↔ ∀ i ∈ s, i.Rel x✝¹ x✝" ]
[ " (sInf s).Rel = sInf (Rel '' s)" ]
import Mathlib.MeasureTheory.OuterMeasure.OfFunction import Mathlib.MeasureTheory.PiSystem #align_import measure_theory.measure.outer_measure from "leanprover-community/mathlib"@"343e80208d29d2d15f8050b929aa50fe4ce71b55" noncomputable section open Set Function Filter open scoped Classical NNReal Topology ENNReal namespace MeasureTheory namespace OuterMeasure section CaratheodoryMeasurable universe u variable {α : Type u} (m : OuterMeasure α) attribute [local simp] Set.inter_comm Set.inter_left_comm Set.inter_assoc variable {s s₁ s₂ : Set α} def IsCaratheodory (s : Set α) : Prop := ∀ t, m t = m (t ∩ s) + m (t \ s) #align measure_theory.outer_measure.is_caratheodory MeasureTheory.OuterMeasure.IsCaratheodory theorem isCaratheodory_iff_le' {s : Set α} : IsCaratheodory m s ↔ ∀ t, m (t ∩ s) + m (t \ s) ≤ m t := forall_congr' fun _ => le_antisymm_iff.trans <| and_iff_right <| measure_le_inter_add_diff _ _ _ #align measure_theory.outer_measure.is_caratheodory_iff_le' MeasureTheory.OuterMeasure.isCaratheodory_iff_le' @[simp] theorem isCaratheodory_empty : IsCaratheodory m ∅ := by simp [IsCaratheodory, m.empty, diff_empty] #align measure_theory.outer_measure.is_caratheodory_empty MeasureTheory.OuterMeasure.isCaratheodory_empty theorem isCaratheodory_compl : IsCaratheodory m s₁ → IsCaratheodory m s₁ᶜ := by simp [IsCaratheodory, diff_eq, add_comm] #align measure_theory.outer_measure.is_caratheodory_compl MeasureTheory.OuterMeasure.isCaratheodory_compl @[simp] theorem isCaratheodory_compl_iff : IsCaratheodory m sᶜ ↔ IsCaratheodory m s := ⟨fun h => by simpa using isCaratheodory_compl m h, isCaratheodory_compl m⟩ #align measure_theory.outer_measure.is_caratheodory_compl_iff MeasureTheory.OuterMeasure.isCaratheodory_compl_iff theorem isCaratheodory_union (h₁ : IsCaratheodory m s₁) (h₂ : IsCaratheodory m s₂) : IsCaratheodory m (s₁ ∪ s₂) := fun t => by rw [h₁ t, h₂ (t ∩ s₁), h₂ (t \ s₁), h₁ (t ∩ (s₁ ∪ s₂)), inter_diff_assoc _ _ s₁, Set.inter_assoc _ _ s₁, inter_eq_self_of_subset_right Set.subset_union_left, union_diff_left, h₂ (t ∩ s₁)] simp [diff_eq, add_assoc] #align measure_theory.outer_measure.is_caratheodory_union MeasureTheory.OuterMeasure.isCaratheodory_union theorem measure_inter_union (h : s₁ ∩ s₂ ⊆ ∅) (h₁ : IsCaratheodory m s₁) {t : Set α} : m (t ∩ (s₁ ∪ s₂)) = m (t ∩ s₁) + m (t ∩ s₂) := by rw [h₁, Set.inter_assoc, Set.union_inter_cancel_left, inter_diff_assoc, union_diff_cancel_left h] #align measure_theory.outer_measure.measure_inter_union MeasureTheory.OuterMeasure.measure_inter_union theorem isCaratheodory_iUnion_lt {s : ℕ → Set α} : ∀ {n : ℕ}, (∀ i < n, IsCaratheodory m (s i)) → IsCaratheodory m (⋃ i < n, s i) | 0, _ => by simp [Nat.not_lt_zero] | n + 1, h => by rw [biUnion_lt_succ] exact isCaratheodory_union m (isCaratheodory_iUnion_lt fun i hi => h i <| lt_of_lt_of_le hi <| Nat.le_succ _) (h n (le_refl (n + 1))) #align measure_theory.outer_measure.is_caratheodory_Union_lt MeasureTheory.OuterMeasure.isCaratheodory_iUnion_lt theorem isCaratheodory_inter (h₁ : IsCaratheodory m s₁) (h₂ : IsCaratheodory m s₂) : IsCaratheodory m (s₁ ∩ s₂) := by rw [← isCaratheodory_compl_iff, Set.compl_inter] exact isCaratheodory_union _ (isCaratheodory_compl _ h₁) (isCaratheodory_compl _ h₂) #align measure_theory.outer_measure.is_caratheodory_inter MeasureTheory.OuterMeasure.isCaratheodory_inter theorem isCaratheodory_sum {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) {t : Set α} : ∀ {n}, (∑ i ∈ Finset.range n, m (t ∩ s i)) = m (t ∩ ⋃ i < n, s i) | 0 => by simp [Nat.not_lt_zero, m.empty] | Nat.succ n => by rw [biUnion_lt_succ, Finset.sum_range_succ, Set.union_comm, isCaratheodory_sum h hd, m.measure_inter_union _ (h n), add_comm] intro a simpa using fun (h₁ : a ∈ s n) i (hi : i < n) h₂ => (hd (ne_of_gt hi)).le_bot ⟨h₁, h₂⟩ #align measure_theory.outer_measure.is_caratheodory_sum MeasureTheory.OuterMeasure.isCaratheodory_sum set_option linter.deprecated false in -- not immediately obvious how to replace `iUnion` here.
Mathlib/MeasureTheory/OuterMeasure/Caratheodory.lean
115
128
theorem isCaratheodory_iUnion_nat {s : ℕ → Set α} (h : ∀ i, IsCaratheodory m (s i)) (hd : Pairwise (Disjoint on s)) : IsCaratheodory m (⋃ i, s i) := by
apply (isCaratheodory_iff_le' m).mpr intro t have hp : m (t ∩ ⋃ i, s i) ≤ ⨆ n, m (t ∩ ⋃ i < n, s i) := by convert m.iUnion fun i => t ∩ s i using 1 · simp [inter_iUnion] · simp [ENNReal.tsum_eq_iSup_nat, isCaratheodory_sum m h hd] refine le_trans (add_le_add_right hp _) ?_ rw [ENNReal.iSup_add] refine iSup_le fun n => le_trans (add_le_add_left ?_ _) (ge_of_eq (isCaratheodory_iUnion_lt m (fun i _ => h i) _)) refine m.mono (diff_subset_diff_right ?_) exact iUnion₂_subset fun i _ => subset_iUnion _ i
[ " m.IsCaratheodory ∅", " m.IsCaratheodory s₁ → m.IsCaratheodory s₁ᶜ", " m.IsCaratheodory s", " m t = m (t ∩ (s₁ ∪ s₂)) + m (t \\ (s₁ ∪ s₂))", " m (t ∩ s₁ ∩ s₂) + m ((t ∩ s₁) \\ s₂) + (m (t \\ s₁ ∩ s₂) + m ((t \\ s₁) \\ s₂)) =\n m (t ∩ s₁ ∩ s₂) + m ((t ∩ s₁) \\ s₂) + m (t ∩ (s₂ \\ s₁)) + m (t \\ (s₁ ∪ s₂)...
[ " m.IsCaratheodory ∅", " m.IsCaratheodory s₁ → m.IsCaratheodory s₁ᶜ", " m.IsCaratheodory s", " m t = m (t ∩ (s₁ ∪ s₂)) + m (t \\ (s₁ ∪ s₂))", " m (t ∩ s₁ ∩ s₂) + m ((t ∩ s₁) \\ s₂) + (m (t \\ s₁ ∩ s₂) + m ((t \\ s₁) \\ s₂)) =\n m (t ∩ s₁ ∩ s₂) + m ((t ∩ s₁) \\ s₂) + m (t ∩ (s₂ \\ s₁)) + m (t \\ (s₁ ∪ s₂)...
import Mathlib.Algebra.ContinuedFractions.Computation.Approximations import Mathlib.Algebra.ContinuedFractions.Computation.CorrectnessTerminating import Mathlib.Data.Rat.Floor #align_import algebra.continued_fractions.computation.terminates_iff_rat from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace GeneralizedContinuedFraction open GeneralizedContinuedFraction (of) variable {K : Type*} [LinearOrderedField K] [FloorRing K] attribute [local simp] Pair.map IntFractPair.mapFr section RatTranslation -- The lifting works for arbitrary linear ordered fields with a floor function. variable {v : K} {q : ℚ} (v_eq_q : v = (↑q : K)) (n : ℕ) section TerminatesOfRat namespace IntFractPair variable {q : ℚ} {n : ℕ} theorem of_inv_fr_num_lt_num_of_pos (q_pos : 0 < q) : (IntFractPair.of q⁻¹).fr.num < q.num := Rat.fract_inv_num_lt_num_of_pos q_pos #align generalized_continued_fraction.int_fract_pair.of_inv_fr_num_lt_num_of_pos GeneralizedContinuedFraction.IntFractPair.of_inv_fr_num_lt_num_of_pos theorem stream_succ_nth_fr_num_lt_nth_fr_num_rat {ifp_n ifp_succ_n : IntFractPair ℚ} (stream_nth_eq : IntFractPair.stream q n = some ifp_n) (stream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n) : ifp_succ_n.fr.num < ifp_n.fr.num := by obtain ⟨ifp_n', stream_nth_eq', ifp_n_fract_ne_zero, IntFractPair.of_eq_ifp_succ_n⟩ : ∃ ifp_n', IntFractPair.stream q n = some ifp_n' ∧ ifp_n'.fr ≠ 0 ∧ IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n := succ_nth_stream_eq_some_iff.mp stream_succ_nth_eq have : ifp_n = ifp_n' := by injection Eq.trans stream_nth_eq.symm stream_nth_eq' cases this rw [← IntFractPair.of_eq_ifp_succ_n] cases' nth_stream_fr_nonneg_lt_one stream_nth_eq with zero_le_ifp_n_fract ifp_n_fract_lt_one have : 0 < ifp_n.fr := lt_of_le_of_ne zero_le_ifp_n_fract <| ifp_n_fract_ne_zero.symm exact of_inv_fr_num_lt_num_of_pos this #align generalized_continued_fraction.int_fract_pair.stream_succ_nth_fr_num_lt_nth_fr_num_rat GeneralizedContinuedFraction.IntFractPair.stream_succ_nth_fr_num_lt_nth_fr_num_rat
Mathlib/Algebra/ContinuedFractions/Computation/TerminatesIffRat.lean
295
312
theorem stream_nth_fr_num_le_fr_num_sub_n_rat : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - n := by
induction n with | zero => intro ifp_zero stream_zero_eq have : IntFractPair.of q = ifp_zero := by injection stream_zero_eq simp [le_refl, this.symm] | succ n IH => intro ifp_succ_n stream_succ_nth_eq suffices ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - n by rw [Int.ofNat_succ, sub_add_eq_sub_sub] solve_by_elim [le_sub_right_of_add_le] rcases succ_nth_stream_eq_some_iff.mp stream_succ_nth_eq with ⟨ifp_n, stream_nth_eq, -⟩ have : ifp_succ_n.fr.num < ifp_n.fr.num := stream_succ_nth_fr_num_lt_nth_fr_num_rat stream_nth_eq stream_succ_nth_eq have : ifp_succ_n.fr.num + 1 ≤ ifp_n.fr.num := Int.add_one_le_of_lt this exact le_trans this (IH stream_nth_eq)
[ " ifp_succ_n.fr.num < ifp_n.fr.num", " ifp_n = ifp_n'", " (IntFractPair.of ifp_n.fr⁻¹).fr.num < ifp_n.fr.num", " ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n", " ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q 0 = some ifp_n → ifp_n.fr.n...
[ " ifp_succ_n.fr.num < ifp_n.fr.num", " ifp_n = ifp_n'", " (IntFractPair.of ifp_n.fr⁻¹).fr.num < ifp_n.fr.num", " ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n" ]
import Mathlib.GroupTheory.QuotientGroup import Mathlib.RingTheory.DedekindDomain.Ideal #align_import ring_theory.class_group from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" variable {R K L : Type*} [CommRing R] variable [Field K] [Field L] [DecidableEq L] variable [Algebra R K] [IsFractionRing R K] variable [Algebra K L] [FiniteDimensional K L] variable [Algebra R L] [IsScalarTower R K L] open scoped nonZeroDivisors open IsLocalization IsFractionRing FractionalIdeal Units section variable (R K) irreducible_def toPrincipalIdeal : Kˣ →* (FractionalIdeal R⁰ K)ˣ := { toFun := fun x => ⟨spanSingleton _ x, spanSingleton _ x⁻¹, by simp only [spanSingleton_one, Units.mul_inv', spanSingleton_mul_spanSingleton], by simp only [spanSingleton_one, Units.inv_mul', spanSingleton_mul_spanSingleton]⟩ map_mul' := fun x y => ext (by simp only [Units.val_mk, Units.val_mul, spanSingleton_mul_spanSingleton]) map_one' := ext (by simp only [spanSingleton_one, Units.val_mk, Units.val_one]) } #align to_principal_ideal toPrincipalIdeal variable {R K} @[simp] theorem coe_toPrincipalIdeal (x : Kˣ) : (toPrincipalIdeal R K x : FractionalIdeal R⁰ K) = spanSingleton _ (x : K) := by simp only [toPrincipalIdeal]; rfl #align coe_to_principal_ideal coe_toPrincipalIdeal @[simp] theorem toPrincipalIdeal_eq_iff {I : (FractionalIdeal R⁰ K)ˣ} {x : Kˣ} : toPrincipalIdeal R K x = I ↔ spanSingleton R⁰ (x : K) = I := by simp only [toPrincipalIdeal]; exact Units.ext_iff #align to_principal_ideal_eq_iff toPrincipalIdeal_eq_iff
Mathlib/RingTheory/ClassGroup.lean
72
79
theorem mem_principal_ideals_iff {I : (FractionalIdeal R⁰ K)ˣ} : I ∈ (toPrincipalIdeal R K).range ↔ ∃ x : K, spanSingleton R⁰ x = I := by
simp only [MonoidHom.mem_range, toPrincipalIdeal_eq_iff] constructor <;> rintro ⟨x, hx⟩ · exact ⟨x, hx⟩ · refine ⟨Units.mk0 x ?_, hx⟩ rintro rfl simp [I.ne_zero.symm] at hx
[ " spanSingleton R⁰ ↑x * spanSingleton R⁰ (↑x)⁻¹ = 1", " spanSingleton R⁰ (↑x)⁻¹ * spanSingleton R⁰ ↑x = 1", " ↑((fun x => { val := spanSingleton R⁰ ↑x, inv := spanSingleton R⁰ (↑x)⁻¹, val_inv := ⋯, inv_val := ⋯ }) 1) = ↑1", " ↑({ toFun := fun x => { val := spanSingleton R⁰ ↑x, inv := spanSingleton R⁰ (↑x)⁻¹, ...
[ " spanSingleton R⁰ ↑x * spanSingleton R⁰ (↑x)⁻¹ = 1", " spanSingleton R⁰ (↑x)⁻¹ * spanSingleton R⁰ ↑x = 1", " ↑((fun x => { val := spanSingleton R⁰ ↑x, inv := spanSingleton R⁰ (↑x)⁻¹, val_inv := ⋯, inv_val := ⋯ }) 1) = ↑1", " ↑({ toFun := fun x => { val := spanSingleton R⁰ ↑x, inv := spanSingleton R⁰ (↑x)⁻¹, ...
import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.Diagonal import Mathlib.LinearAlgebra.Matrix.Transvection import Mathlib.MeasureTheory.Group.LIntegral import Mathlib.MeasureTheory.Integral.Marginal import Mathlib.MeasureTheory.Measure.Stieltjes import Mathlib.MeasureTheory.Measure.Haar.OfBasis #align_import measure_theory.measure.lebesgue.basic from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" assert_not_exists MeasureTheory.integral noncomputable section open scoped Classical open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace open ENNReal (ofReal) open scoped ENNReal NNReal Topology section regionBetween variable {α : Type*} def regionBetween (f g : α → ℝ) (s : Set α) : Set (α × ℝ) := { p : α × ℝ | p.1 ∈ s ∧ p.2 ∈ Ioo (f p.1) (g p.1) } #align region_between regionBetween theorem regionBetween_subset (f g : α → ℝ) (s : Set α) : regionBetween f g s ⊆ s ×ˢ univ := by simpa only [prod_univ, regionBetween, Set.preimage, setOf_subset_setOf] using fun a => And.left #align region_between_subset regionBetween_subset variable [MeasurableSpace α] {μ : Measure α} {f g : α → ℝ} {s : Set α} theorem measurableSet_regionBetween (hf : Measurable f) (hg : Measurable g) (hs : MeasurableSet s) : MeasurableSet (regionBetween f g s) := by dsimp only [regionBetween, Ioo, mem_setOf_eq, setOf_and] refine MeasurableSet.inter ?_ ((measurableSet_lt (hf.comp measurable_fst) measurable_snd).inter (measurableSet_lt measurable_snd (hg.comp measurable_fst))) exact measurable_fst hs #align measurable_set_region_between measurableSet_regionBetween theorem measurableSet_region_between_oc (hf : Measurable f) (hg : Measurable g) (hs : MeasurableSet s) : MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Ioc (f p.fst) (g p.fst) } := by dsimp only [regionBetween, Ioc, mem_setOf_eq, setOf_and] refine MeasurableSet.inter ?_ ((measurableSet_lt (hf.comp measurable_fst) measurable_snd).inter (measurableSet_le measurable_snd (hg.comp measurable_fst))) exact measurable_fst hs #align measurable_set_region_between_oc measurableSet_region_between_oc theorem measurableSet_region_between_co (hf : Measurable f) (hg : Measurable g) (hs : MeasurableSet s) : MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Ico (f p.fst) (g p.fst) } := by dsimp only [regionBetween, Ico, mem_setOf_eq, setOf_and] refine MeasurableSet.inter ?_ ((measurableSet_le (hf.comp measurable_fst) measurable_snd).inter (measurableSet_lt measurable_snd (hg.comp measurable_fst))) exact measurable_fst hs #align measurable_set_region_between_co measurableSet_region_between_co
Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean
494
502
theorem measurableSet_region_between_cc (hf : Measurable f) (hg : Measurable g) (hs : MeasurableSet s) : MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Icc (f p.fst) (g p.fst) } := by
dsimp only [regionBetween, Icc, mem_setOf_eq, setOf_and] refine MeasurableSet.inter ?_ ((measurableSet_le (hf.comp measurable_fst) measurable_snd).inter (measurableSet_le measurable_snd (hg.comp measurable_fst))) exact measurable_fst hs
[ " regionBetween f g s ⊆ s ×ˢ univ", " MeasurableSet (regionBetween f g s)", " MeasurableSet ({a | a.1 ∈ s} ∩ {a | a.2 ∈ {a_1 | f a.1 < a_1} ∩ {a_1 | a_1 < g a.1}})", " MeasurableSet {a | a.1 ∈ s}", " MeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Ioc (f p.1) (g p.1)}", " MeasurableSet ({a | a.1 ∈ s} ∩ {a | a.2 ∈ {a_1...
[ " regionBetween f g s ⊆ s ×ˢ univ", " MeasurableSet (regionBetween f g s)", " MeasurableSet ({a | a.1 ∈ s} ∩ {a | a.2 ∈ {a_1 | f a.1 < a_1} ∩ {a_1 | a_1 < g a.1}})", " MeasurableSet {a | a.1 ∈ s}", " MeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Ioc (f p.1) (g p.1)}", " MeasurableSet ({a | a.1 ∈ s} ∩ {a | a.2 ∈ {a_1...
import Mathlib.Algebra.EuclideanDomain.Defs import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Algebra.Ring.Regular import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Ring.Basic #align_import algebra.euclidean_domain.basic from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6" universe u namespace EuclideanDomain variable {R : Type u} variable [EuclideanDomain R] local infixl:50 " ≺ " => EuclideanDomain.R -- See note [lower instance priority] instance (priority := 100) toMulDivCancelClass : MulDivCancelClass R where mul_div_cancel a b hb := by refine (eq_of_sub_eq_zero ?_).symm by_contra h have := mul_right_not_lt b h rw [sub_mul, mul_comm (_ / _), sub_eq_iff_eq_add'.2 (div_add_mod (a * b) b).symm] at this exact this (mod_lt _ hb) #align euclidean_domain.mul_div_cancel_left mul_div_cancel_left₀ #align euclidean_domain.mul_div_cancel mul_div_cancel_right₀ @[simp] theorem mod_eq_zero {a b : R} : a % b = 0 ↔ b ∣ a := ⟨fun h => by rw [← div_add_mod a b, h, add_zero] exact dvd_mul_right _ _, fun ⟨c, e⟩ => by rw [e, ← add_left_cancel_iff, div_add_mod, add_zero] haveI := Classical.dec by_cases b0 : b = 0 · simp only [b0, zero_mul] · rw [mul_div_cancel_left₀ _ b0]⟩ #align euclidean_domain.mod_eq_zero EuclideanDomain.mod_eq_zero @[simp] theorem mod_self (a : R) : a % a = 0 := mod_eq_zero.2 dvd_rfl #align euclidean_domain.mod_self EuclideanDomain.mod_self theorem dvd_mod_iff {a b c : R} (h : c ∣ b) : c ∣ a % b ↔ c ∣ a := by rw [← dvd_add_right (h.mul_right _), div_add_mod] #align euclidean_domain.dvd_mod_iff EuclideanDomain.dvd_mod_iff @[simp] theorem mod_one (a : R) : a % 1 = 0 := mod_eq_zero.2 (one_dvd _) #align euclidean_domain.mod_one EuclideanDomain.mod_one @[simp] theorem zero_mod (b : R) : 0 % b = 0 := mod_eq_zero.2 (dvd_zero _) #align euclidean_domain.zero_mod EuclideanDomain.zero_mod @[simp] theorem zero_div {a : R} : 0 / a = 0 := by_cases (fun a0 : a = 0 => a0.symm ▸ div_zero 0) fun a0 => by simpa only [zero_mul] using mul_div_cancel_right₀ 0 a0 #align euclidean_domain.zero_div EuclideanDomain.zero_div @[simp] theorem div_self {a : R} (a0 : a ≠ 0) : a / a = 1 := by simpa only [one_mul] using mul_div_cancel_right₀ 1 a0 #align euclidean_domain.div_self EuclideanDomain.div_self
Mathlib/Algebra/EuclideanDomain/Basic.lean
88
89
theorem eq_div_of_mul_eq_left {a b c : R} (hb : b ≠ 0) (h : a * b = c) : a = c / b := by
rw [← h, mul_div_cancel_right₀ _ hb]
[ " a * b / b = a", " a - a * b / b = 0", " False", " b ∣ a", " b ∣ b * (a / b)", " a % b = 0", " b * c = b * (b * c / b)", " c ∣ a % b ↔ c ∣ a", " 0 / a = 0", " a / a = 1", " a = c / b" ]
[ " a * b / b = a", " a - a * b / b = 0", " False", " b ∣ a", " b ∣ b * (a / b)", " a % b = 0", " b * c = b * (b * c / b)", " c ∣ a % b ↔ c ∣ a", " 0 / a = 0", " a / a = 1", " a = c / b" ]
import Mathlib.Algebra.CharP.Invertible import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.Normed.Group.AddTorsor import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.normed_space.add_torsor from "leanprover-community/mathlib"@"837f72de63ad6cd96519cde5f1ffd5ed8d280ad0" noncomputable section open NNReal Topology open Filter variable {α V P W Q : Type*} [SeminormedAddCommGroup V] [PseudoMetricSpace P] [NormedAddTorsor V P] [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q] section NormedSpace variable {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 V] [NormedSpace 𝕜 W] open AffineMap theorem AffineSubspace.isClosed_direction_iff (s : AffineSubspace 𝕜 Q) : IsClosed (s.direction : Set W) ↔ IsClosed (s : Set Q) := by rcases s.eq_bot_or_nonempty with (rfl | ⟨x, hx⟩); · simp [isClosed_singleton] rw [← (IsometryEquiv.vaddConst x).toHomeomorph.symm.isClosed_image, AffineSubspace.coe_direction_eq_vsub_set_right hx] rfl #align affine_subspace.is_closed_direction_iff AffineSubspace.isClosed_direction_iff @[simp] theorem dist_center_homothety (p₁ p₂ : P) (c : 𝕜) : dist p₁ (homothety p₁ c p₂) = ‖c‖ * dist p₁ p₂ := by simp [homothety_def, norm_smul, ← dist_eq_norm_vsub, dist_comm] #align dist_center_homothety dist_center_homothety @[simp] theorem nndist_center_homothety (p₁ p₂ : P) (c : 𝕜) : nndist p₁ (homothety p₁ c p₂) = ‖c‖₊ * nndist p₁ p₂ := NNReal.eq <| dist_center_homothety _ _ _ #align nndist_center_homothety nndist_center_homothety @[simp]
Mathlib/Analysis/NormedSpace/AddTorsor.lean
57
58
theorem dist_homothety_center (p₁ p₂ : P) (c : 𝕜) : dist (homothety p₁ c p₂) p₁ = ‖c‖ * dist p₁ p₂ := by
rw [dist_comm, dist_center_homothety]
[ " IsClosed ↑s.direction ↔ IsClosed ↑s", " IsClosed ↑⊥.direction ↔ IsClosed ↑⊥", " IsClosed ((fun x_1 => x_1 -ᵥ x) '' ↑s) ↔ IsClosed (⇑(IsometryEquiv.vaddConst x).toHomeomorph.symm '' ↑s)", " dist p₁ ((homothety p₁ c) p₂) = ‖c‖ * dist p₁ p₂", " dist ((homothety p₁ c) p₂) p₁ = ‖c‖ * dist p₁ p₂" ]
[ " IsClosed ↑s.direction ↔ IsClosed ↑s", " IsClosed ↑⊥.direction ↔ IsClosed ↑⊥", " IsClosed ((fun x_1 => x_1 -ᵥ x) '' ↑s) ↔ IsClosed (⇑(IsometryEquiv.vaddConst x).toHomeomorph.symm '' ↑s)", " dist p₁ ((homothety p₁ c) p₂) = ‖c‖ * dist p₁ p₂", " dist ((homothety p₁ c) p₂) p₁ = ‖c‖ * dist p₁ p₂" ]
import Mathlib.Data.Set.Basic #align_import data.set.bool_indicator from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e" open Bool namespace Set variable {α : Type*} (s : Set α) noncomputable def boolIndicator (x : α) := @ite _ (x ∈ s) (Classical.propDecidable _) true false #align set.bool_indicator Set.boolIndicator theorem mem_iff_boolIndicator (x : α) : x ∈ s ↔ s.boolIndicator x = true := by unfold boolIndicator split_ifs with h <;> simp [h] #align set.mem_iff_bool_indicator Set.mem_iff_boolIndicator theorem not_mem_iff_boolIndicator (x : α) : x ∉ s ↔ s.boolIndicator x = false := by unfold boolIndicator split_ifs with h <;> simp [h] #align set.not_mem_iff_bool_indicator Set.not_mem_iff_boolIndicator theorem preimage_boolIndicator_true : s.boolIndicator ⁻¹' {true} = s := ext fun x ↦ (s.mem_iff_boolIndicator x).symm #align set.preimage_bool_indicator_true Set.preimage_boolIndicator_true theorem preimage_boolIndicator_false : s.boolIndicator ⁻¹' {false} = sᶜ := ext fun x ↦ (s.not_mem_iff_boolIndicator x).symm #align set.preimage_bool_indicator_false Set.preimage_boolIndicator_false open scoped Classical
Mathlib/Data/Set/BoolIndicator.lean
47
51
theorem preimage_boolIndicator_eq_union (t : Set Bool) : s.boolIndicator ⁻¹' t = (if true ∈ t then s else ∅) ∪ if false ∈ t then sᶜ else ∅ := by
ext x simp only [boolIndicator, mem_preimage] split_ifs <;> simp [*]
[ " x ∈ s ↔ s.boolIndicator x = true", " x ∈ s ↔ (if x ∈ s then true else false) = true", " x ∈ s ↔ true = true", " x ∈ s ↔ False", " x ∉ s ↔ s.boolIndicator x = false", " x ∉ s ↔ (if x ∈ s then true else false) = false", " x ∉ s ↔ False", " x ∉ s ↔ false = false", " s.boolIndicator ⁻¹' t = (if true ∈...
[ " x ∈ s ↔ s.boolIndicator x = true", " x ∈ s ↔ (if x ∈ s then true else false) = true", " x ∈ s ↔ true = true", " x ∈ s ↔ False", " x ∉ s ↔ s.boolIndicator x = false", " x ∉ s ↔ (if x ∈ s then true else false) = false", " x ∉ s ↔ False", " x ∉ s ↔ false = false", " s.boolIndicator ⁻¹' t = (if true ∈...
import Mathlib.Data.List.Basic namespace List variable {α β : Type*} @[simp] theorem reduceOption_cons_of_some (x : α) (l : List (Option α)) : reduceOption (some x :: l) = x :: l.reduceOption := by simp only [reduceOption, filterMap, id, eq_self_iff_true, and_self_iff] #align list.reduce_option_cons_of_some List.reduceOption_cons_of_some @[simp] theorem reduceOption_cons_of_none (l : List (Option α)) : reduceOption (none :: l) = l.reduceOption := by simp only [reduceOption, filterMap, id] #align list.reduce_option_cons_of_none List.reduceOption_cons_of_none @[simp] theorem reduceOption_nil : @reduceOption α [] = [] := rfl #align list.reduce_option_nil List.reduceOption_nil @[simp] theorem reduceOption_map {l : List (Option α)} {f : α → β} : reduceOption (map (Option.map f) l) = map f (reduceOption l) := by induction' l with hd tl hl · simp only [reduceOption_nil, map_nil] · cases hd <;> simpa [true_and_iff, Option.map_some', map, eq_self_iff_true, reduceOption_cons_of_some] using hl #align list.reduce_option_map List.reduceOption_map theorem reduceOption_append (l l' : List (Option α)) : (l ++ l').reduceOption = l.reduceOption ++ l'.reduceOption := filterMap_append l l' id #align list.reduce_option_append List.reduceOption_append theorem reduceOption_length_eq {l : List (Option α)} : l.reduceOption.length = (l.filter Option.isSome).length := by induction' l with hd tl hl · simp_rw [reduceOption_nil, filter_nil, length] · cases hd <;> simp [hl] theorem length_eq_reduceOption_length_add_filter_none {l : List (Option α)} : l.length = l.reduceOption.length + (l.filter Option.isNone).length := by simp_rw [reduceOption_length_eq, l.length_eq_length_filter_add Option.isSome, Option.bnot_isSome] theorem reduceOption_length_le (l : List (Option α)) : l.reduceOption.length ≤ l.length := by rw [length_eq_reduceOption_length_add_filter_none] apply Nat.le_add_right #align list.reduce_option_length_le List.reduceOption_length_le theorem reduceOption_length_eq_iff {l : List (Option α)} : l.reduceOption.length = l.length ↔ ∀ x ∈ l, Option.isSome x := by rw [reduceOption_length_eq, List.filter_length_eq_length] #align list.reduce_option_length_eq_iff List.reduceOption_length_eq_iff
Mathlib/Data/List/ReduceOption.lean
69
74
theorem reduceOption_length_lt_iff {l : List (Option α)} : l.reduceOption.length < l.length ↔ none ∈ l := by
rw [Nat.lt_iff_le_and_ne, and_iff_right (reduceOption_length_le l), Ne, reduceOption_length_eq_iff] induction l <;> simp [*] rw [@eq_comm _ none, ← Option.not_isSome_iff_eq_none, Decidable.imp_iff_not_or]
[ " (some x :: l).reduceOption = x :: l.reduceOption", " (none :: l).reduceOption = l.reduceOption", " (map (Option.map f) l).reduceOption = map f l.reduceOption", " (map (Option.map f) []).reduceOption = map f [].reduceOption", " (map (Option.map f) (hd :: tl)).reduceOption = map f (hd :: tl).reduceOption", ...
[ " (some x :: l).reduceOption = x :: l.reduceOption", " (none :: l).reduceOption = l.reduceOption", " (map (Option.map f) l).reduceOption = map f l.reduceOption", " (map (Option.map f) []).reduceOption = map f [].reduceOption", " (map (Option.map f) (hd :: tl)).reduceOption = map f (hd :: tl).reduceOption", ...
import Mathlib.Analysis.Calculus.BumpFunction.Basic import Mathlib.MeasureTheory.Integral.SetIntegral import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open Function Filter Set Metric MeasureTheory FiniteDimensional Measure open scoped Topology namespace ContDiffBump variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [HasContDiffBump E] [MeasurableSpace E] {c : E} (f : ContDiffBump c) {x : E} {n : ℕ∞} {μ : Measure E} protected def normed (μ : Measure E) : E → ℝ := fun x => f x / ∫ x, f x ∂μ #align cont_diff_bump.normed ContDiffBump.normed theorem normed_def {μ : Measure E} (x : E) : f.normed μ x = f x / ∫ x, f x ∂μ := rfl #align cont_diff_bump.normed_def ContDiffBump.normed_def theorem nonneg_normed (x : E) : 0 ≤ f.normed μ x := div_nonneg f.nonneg <| integral_nonneg f.nonneg' #align cont_diff_bump.nonneg_normed ContDiffBump.nonneg_normed theorem contDiff_normed {n : ℕ∞} : ContDiff ℝ n (f.normed μ) := f.contDiff.div_const _ #align cont_diff_bump.cont_diff_normed ContDiffBump.contDiff_normed theorem continuous_normed : Continuous (f.normed μ) := f.continuous.div_const _ #align cont_diff_bump.continuous_normed ContDiffBump.continuous_normed theorem normed_sub (x : E) : f.normed μ (c - x) = f.normed μ (c + x) := by simp_rw [f.normed_def, f.sub] #align cont_diff_bump.normed_sub ContDiffBump.normed_sub theorem normed_neg (f : ContDiffBump (0 : E)) (x : E) : f.normed μ (-x) = f.normed μ x := by simp_rw [f.normed_def, f.neg] #align cont_diff_bump.normed_neg ContDiffBump.normed_neg variable [BorelSpace E] [FiniteDimensional ℝ E] [IsLocallyFiniteMeasure μ] protected theorem integrable : Integrable f μ := f.continuous.integrable_of_hasCompactSupport f.hasCompactSupport #align cont_diff_bump.integrable ContDiffBump.integrable protected theorem integrable_normed : Integrable (f.normed μ) μ := f.integrable.div_const _ #align cont_diff_bump.integrable_normed ContDiffBump.integrable_normed variable [μ.IsOpenPosMeasure]
Mathlib/Analysis/Calculus/BumpFunction/Normed.lean
69
72
theorem integral_pos : 0 < ∫ x, f x ∂μ := by
refine (integral_pos_iff_support_of_nonneg f.nonneg' f.integrable).mpr ?_ rw [f.support_eq] exact measure_ball_pos μ c f.rOut_pos
[ " f.normed μ (c - x) = f.normed μ (c + x)", " f.normed μ (-x) = f.normed μ x", " 0 < ∫ (x : E), ↑f x ∂μ", " 0 < μ (support fun i => ↑f i)", " 0 < μ (ball c f.rOut)" ]
[ " f.normed μ (c - x) = f.normed μ (c + x)", " f.normed μ (-x) = f.normed μ x", " 0 < ∫ (x : E), ↑f x ∂μ" ]
import Mathlib.Analysis.NormedSpace.Star.Spectrum import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Analysis.NormedSpace.Algebra import Mathlib.Topology.ContinuousFunction.Units import Mathlib.Topology.ContinuousFunction.Compact import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.ContinuousFunction.Ideals import Mathlib.Topology.ContinuousFunction.StoneWeierstrass #align_import analysis.normed_space.star.gelfand_duality from "leanprover-community/mathlib"@"e65771194f9e923a70dfb49b6ca7be6e400d8b6f" open WeakDual open scoped NNReal section ComplexBanachAlgebra open Ideal variable {A : Type*} [NormedCommRing A] [NormedAlgebra ℂ A] [CompleteSpace A] (I : Ideal A) [Ideal.IsMaximal I] noncomputable def Ideal.toCharacterSpace : characterSpace ℂ A := CharacterSpace.equivAlgHom.symm <| ((NormedRing.algEquivComplexOfComplete (letI := Quotient.field I; isUnit_iff_ne_zero (G₀ := A ⧸ I))).symm : A ⧸ I →ₐ[ℂ] ℂ).comp <| Quotient.mkₐ ℂ I #align ideal.to_character_space Ideal.toCharacterSpace
Mathlib/Analysis/NormedSpace/Star/GelfandDuality.lean
88
94
theorem Ideal.toCharacterSpace_apply_eq_zero_of_mem {a : A} (ha : a ∈ I) : I.toCharacterSpace a = 0 := by
unfold Ideal.toCharacterSpace simp only [CharacterSpace.equivAlgHom_symm_coe, AlgHom.coe_comp, AlgHom.coe_coe, Quotient.mkₐ_eq_mk, Function.comp_apply, NormedRing.algEquivComplexOfComplete_symm_apply] simp_rw [Quotient.eq_zero_iff_mem.mpr ha, spectrum.zero_eq] exact Set.eq_of_mem_singleton (Set.singleton_nonempty (0 : ℂ)).some_mem
[ " I.toCharacterSpace a = 0", " (CharacterSpace.equivAlgHom.symm ((↑(NormedRing.algEquivComplexOfComplete ⋯).symm).comp (Quotient.mkₐ ℂ I))) a = 0", " ⋯.some = 0" ]
[ " I.toCharacterSpace a = 0" ]
import Mathlib.Topology.Algebra.Module.WeakDual import Mathlib.MeasureTheory.Integral.BoundedContinuousFunction import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed #align_import measure_theory.measure.finite_measure from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory open Set open Filter open BoundedContinuousFunction open scoped Topology ENNReal NNReal BoundedContinuousFunction namespace MeasureTheory namespace FiniteMeasure section FiniteMeasure variable {Ω : Type*} [MeasurableSpace Ω] def _root_.MeasureTheory.FiniteMeasure (Ω : Type*) [MeasurableSpace Ω] : Type _ := { μ : Measure Ω // IsFiniteMeasure μ } #align measure_theory.finite_measure MeasureTheory.FiniteMeasure -- Porting note: as with other subtype synonyms (e.g., `ℝ≥0`, we need a new function for the -- coercion instead of relying on `Subtype.val`. @[coe] def toMeasure : FiniteMeasure Ω → Measure Ω := Subtype.val instance instCoe : Coe (FiniteMeasure Ω) (MeasureTheory.Measure Ω) where coe := toMeasure instance isFiniteMeasure (μ : FiniteMeasure Ω) : IsFiniteMeasure (μ : Measure Ω) := μ.prop #align measure_theory.finite_measure.is_finite_measure MeasureTheory.FiniteMeasure.isFiniteMeasure @[simp] theorem val_eq_toMeasure (ν : FiniteMeasure Ω) : ν.val = (ν : Measure Ω) := rfl #align measure_theory.finite_measure.val_eq_to_measure MeasureTheory.FiniteMeasure.val_eq_toMeasure theorem toMeasure_injective : Function.Injective ((↑) : FiniteMeasure Ω → Measure Ω) := Subtype.coe_injective #align measure_theory.finite_measure.coe_injective MeasureTheory.FiniteMeasure.toMeasure_injective instance instFunLike : FunLike (FiniteMeasure Ω) (Set Ω) ℝ≥0 where coe μ s := ((μ : Measure Ω) s).toNNReal coe_injective' μ ν h := toMeasure_injective $ Measure.ext fun s _ ↦ by simpa [ENNReal.toNNReal_eq_toNNReal_iff, measure_ne_top] using congr_fun h s lemma coeFn_def (μ : FiniteMeasure Ω) : μ = fun s ↦ ((μ : Measure Ω) s).toNNReal := rfl #align measure_theory.finite_measure.coe_fn_eq_to_nnreal_coe_fn_to_measure MeasureTheory.FiniteMeasure.coeFn_def lemma coeFn_mk (μ : Measure Ω) (hμ) : DFunLike.coe (F := FiniteMeasure Ω) ⟨μ, hμ⟩ = fun s ↦ (μ s).toNNReal := rfl @[simp, norm_cast] lemma mk_apply (μ : Measure Ω) (hμ) (s : Set Ω) : DFunLike.coe (F := FiniteMeasure Ω) ⟨μ, hμ⟩ s = (μ s).toNNReal := rfl @[simp] theorem ennreal_coeFn_eq_coeFn_toMeasure (ν : FiniteMeasure Ω) (s : Set Ω) : (ν s : ℝ≥0∞) = (ν : Measure Ω) s := ENNReal.coe_toNNReal (measure_lt_top (↑ν) s).ne #align measure_theory.finite_measure.ennreal_coe_fn_eq_coe_fn_to_measure MeasureTheory.FiniteMeasure.ennreal_coeFn_eq_coeFn_toMeasure theorem apply_mono (μ : FiniteMeasure Ω) {s₁ s₂ : Set Ω} (h : s₁ ⊆ s₂) : μ s₁ ≤ μ s₂ := by change ((μ : Measure Ω) s₁).toNNReal ≤ ((μ : Measure Ω) s₂).toNNReal have key : (μ : Measure Ω) s₁ ≤ (μ : Measure Ω) s₂ := (μ : Measure Ω).mono h apply (ENNReal.toNNReal_le_toNNReal (measure_ne_top _ s₁) (measure_ne_top _ s₂)).mpr key #align measure_theory.finite_measure.apply_mono MeasureTheory.FiniteMeasure.apply_mono def mass (μ : FiniteMeasure Ω) : ℝ≥0 := μ univ #align measure_theory.finite_measure.mass MeasureTheory.FiniteMeasure.mass @[simp] theorem apply_le_mass (μ : FiniteMeasure Ω) (s : Set Ω) : μ s ≤ μ.mass := by simpa using apply_mono μ (subset_univ s) @[simp] theorem ennreal_mass {μ : FiniteMeasure Ω} : (μ.mass : ℝ≥0∞) = (μ : Measure Ω) univ := ennreal_coeFn_eq_coeFn_toMeasure μ Set.univ #align measure_theory.finite_measure.ennreal_mass MeasureTheory.FiniteMeasure.ennreal_mass instance instZero : Zero (FiniteMeasure Ω) where zero := ⟨0, MeasureTheory.isFiniteMeasureZero⟩ #align measure_theory.finite_measure.has_zero MeasureTheory.FiniteMeasure.instZero @[simp, norm_cast] lemma coeFn_zero : ⇑(0 : FiniteMeasure Ω) = 0 := rfl #align measure_theory.finite_measure.coe_fn_zero MeasureTheory.FiniteMeasure.coeFn_zero @[simp] theorem zero_mass : (0 : FiniteMeasure Ω).mass = 0 := rfl #align measure_theory.finite_measure.zero.mass MeasureTheory.FiniteMeasure.zero_mass @[simp] theorem mass_zero_iff (μ : FiniteMeasure Ω) : μ.mass = 0 ↔ μ = 0 := by refine ⟨fun μ_mass => ?_, fun hμ => by simp only [hμ, zero_mass]⟩ apply toMeasure_injective apply Measure.measure_univ_eq_zero.mp rwa [← ennreal_mass, ENNReal.coe_eq_zero] #align measure_theory.finite_measure.mass_zero_iff MeasureTheory.FiniteMeasure.mass_zero_iff theorem mass_nonzero_iff (μ : FiniteMeasure Ω) : μ.mass ≠ 0 ↔ μ ≠ 0 := by rw [not_iff_not] exact FiniteMeasure.mass_zero_iff μ #align measure_theory.finite_measure.mass_nonzero_iff MeasureTheory.FiniteMeasure.mass_nonzero_iff @[ext] theorem eq_of_forall_toMeasure_apply_eq (μ ν : FiniteMeasure Ω) (h : ∀ s : Set Ω, MeasurableSet s → (μ : Measure Ω) s = (ν : Measure Ω) s) : μ = ν := by apply Subtype.ext ext1 s s_mble exact h s s_mble #align measure_theory.finite_measure.eq_of_forall_measure_apply_eq MeasureTheory.FiniteMeasure.eq_of_forall_toMeasure_apply_eq
Mathlib/MeasureTheory/Measure/FiniteMeasure.lean
220
223
theorem eq_of_forall_apply_eq (μ ν : FiniteMeasure Ω) (h : ∀ s : Set Ω, MeasurableSet s → μ s = ν s) : μ = ν := by
ext1 s s_mble simpa [ennreal_coeFn_eq_coeFn_toMeasure] using congr_arg ((↑) : ℝ≥0 → ℝ≥0∞) (h s s_mble)
[ " ↑μ s = ↑ν s", " μ s₁ ≤ μ s₂", " (↑μ s₁).toNNReal ≤ (↑μ s₂).toNNReal", " μ s ≤ μ.mass", " μ.mass = 0 ↔ μ = 0", " μ.mass = 0", " μ = 0", " ↑μ = ↑0", " ↑μ univ = 0", " μ.mass ≠ 0 ↔ μ ≠ 0", " μ = ν", " ↑μ = ↑ν" ]
[ " ↑μ s = ↑ν s", " μ s₁ ≤ μ s₂", " (↑μ s₁).toNNReal ≤ (↑μ s₂).toNNReal", " μ s ≤ μ.mass", " μ.mass = 0 ↔ μ = 0", " μ.mass = 0", " μ = 0", " ↑μ = ↑0", " ↑μ univ = 0", " μ.mass ≠ 0 ↔ μ ≠ 0", " μ = ν", " ↑μ = ↑ν" ]
import Mathlib.Analysis.InnerProductSpace.Spectrum import Mathlib.Data.Matrix.Rank import Mathlib.LinearAlgebra.Matrix.Diagonal import Mathlib.LinearAlgebra.Matrix.Hermitian #align_import linear_algebra.matrix.spectrum from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" namespace Matrix variable {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] variable {A : Matrix n n 𝕜} namespace IsHermitian section DecidableEq variable [DecidableEq n] variable (hA : A.IsHermitian) noncomputable def eigenvalues₀ : Fin (Fintype.card n) → ℝ := (isHermitian_iff_isSymmetric.1 hA).eigenvalues finrank_euclideanSpace #align matrix.is_hermitian.eigenvalues₀ Matrix.IsHermitian.eigenvalues₀ noncomputable def eigenvalues : n → ℝ := fun i => hA.eigenvalues₀ <| (Fintype.equivOfCardEq (Fintype.card_fin _)).symm i #align matrix.is_hermitian.eigenvalues Matrix.IsHermitian.eigenvalues noncomputable def eigenvectorBasis : OrthonormalBasis n 𝕜 (EuclideanSpace 𝕜 n) := ((isHermitian_iff_isSymmetric.1 hA).eigenvectorBasis finrank_euclideanSpace).reindex (Fintype.equivOfCardEq (Fintype.card_fin _)) #align matrix.is_hermitian.eigenvector_basis Matrix.IsHermitian.eigenvectorBasis lemma mulVec_eigenvectorBasis (j : n) : A *ᵥ ⇑(hA.eigenvectorBasis j) = (hA.eigenvalues j) • ⇑(hA.eigenvectorBasis j) := by simpa only [eigenvectorBasis, OrthonormalBasis.reindex_apply, toEuclideanLin_apply, RCLike.real_smul_eq_coe_smul (K := 𝕜)] using congr(⇑$((isHermitian_iff_isSymmetric.1 hA).apply_eigenvectorBasis finrank_euclideanSpace ((Fintype.equivOfCardEq (Fintype.card_fin _)).symm j))) noncomputable def eigenvectorUnitary {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n]{A : Matrix n n 𝕜} [DecidableEq n] (hA : Matrix.IsHermitian A) : Matrix.unitaryGroup n 𝕜 := ⟨(EuclideanSpace.basisFun n 𝕜).toBasis.toMatrix (hA.eigenvectorBasis).toBasis, (EuclideanSpace.basisFun n 𝕜).toMatrix_orthonormalBasis_mem_unitary (eigenvectorBasis hA)⟩ #align matrix.is_hermitian.eigenvector_matrix Matrix.IsHermitian.eigenvectorUnitary lemma eigenvectorUnitary_coe {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n] {A : Matrix n n 𝕜} [DecidableEq n] (hA : Matrix.IsHermitian A) : eigenvectorUnitary hA = (EuclideanSpace.basisFun n 𝕜).toBasis.toMatrix (hA.eigenvectorBasis).toBasis := rfl @[simp] theorem eigenvectorUnitary_apply (i j : n) : eigenvectorUnitary hA i j = ⇑(hA.eigenvectorBasis j) i := rfl #align matrix.is_hermitian.eigenvector_matrix_apply Matrix.IsHermitian.eigenvectorUnitary_apply theorem eigenvectorUnitary_mulVec (j : n) : eigenvectorUnitary hA *ᵥ Pi.single j 1 = ⇑(hA.eigenvectorBasis j) := by simp only [mulVec_single, eigenvectorUnitary_apply, mul_one] theorem star_eigenvectorUnitary_mulVec (j : n) : (star (eigenvectorUnitary hA : Matrix n n 𝕜)) *ᵥ ⇑(hA.eigenvectorBasis j) = Pi.single j 1 := by rw [← eigenvectorUnitary_mulVec, mulVec_mulVec, unitary.coe_star_mul_self, one_mulVec] theorem star_mul_self_mul_eq_diagonal : (star (eigenvectorUnitary hA : Matrix n n 𝕜)) * A * (eigenvectorUnitary hA : Matrix n n 𝕜) = diagonal (RCLike.ofReal ∘ hA.eigenvalues) := by apply Matrix.toEuclideanLin.injective apply Basis.ext (EuclideanSpace.basisFun n 𝕜).toBasis intro i simp only [toEuclideanLin_apply, OrthonormalBasis.coe_toBasis, EuclideanSpace.basisFun_apply, WithLp.equiv_single, ← mulVec_mulVec, eigenvectorUnitary_mulVec, ← mulVec_mulVec, mulVec_eigenvectorBasis, Matrix.diagonal_mulVec_single, mulVec_smul, star_eigenvectorUnitary_mulVec, RCLike.real_smul_eq_coe_smul (K := 𝕜), WithLp.equiv_symm_smul, WithLp.equiv_symm_single, Function.comp_apply, mul_one, WithLp.equiv_symm_single] apply PiLp.ext intro j simp only [PiLp.smul_apply, EuclideanSpace.single_apply, smul_eq_mul, mul_ite, mul_one, mul_zero]
Mathlib/LinearAlgebra/Matrix/Spectrum.lean
106
111
theorem spectral_theorem : A = (eigenvectorUnitary hA : Matrix n n 𝕜) * diagonal (RCLike.ofReal ∘ hA.eigenvalues) * (star (eigenvectorUnitary hA : Matrix n n 𝕜)) := by
rw [← star_mul_self_mul_eq_diagonal, mul_assoc, mul_assoc, (Matrix.mem_unitaryGroup_iff).mp (eigenvectorUnitary hA).2, mul_one, ← mul_assoc, (Matrix.mem_unitaryGroup_iff).mp (eigenvectorUnitary hA).2, one_mul]
[ " A *ᵥ (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j) =\n hA.eigenvalues j • (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j)", " ↑hA.eigenvectorUnitary *ᵥ Pi.single j 1 = (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j)", " star ↑hA.eigenvectorUn...
[ " A *ᵥ (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j) =\n hA.eigenvalues j • (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j)", " ↑hA.eigenvectorUnitary *ᵥ Pi.single j 1 = (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j)", " star ↑hA.eigenvectorUn...
import Mathlib.Tactic.Ring.Basic import Mathlib.Tactic.TryThis import Mathlib.Tactic.Conv import Mathlib.Util.Qq set_option autoImplicit true -- In this file we would like to be able to use multi-character auto-implicits. set_option relaxedAutoImplicit true namespace Mathlib.Tactic open Lean hiding Rat open Qq Meta namespace RingNF open Ring inductive RingMode where | SOP | raw deriving Inhabited, BEq, Repr structure Config where red := TransparencyMode.reducible recursive := true mode := RingMode.SOP deriving Inhabited, BEq, Repr declare_config_elab elabConfig Config structure Context where ctx : Simp.Context simp : Simp.Result → SimpM Simp.Result abbrev M := ReaderT Context AtomM def rewrite (parent : Expr) (root := true) : M Simp.Result := fun nctx rctx s ↦ do let pre : Simp.Simproc := fun e => try guard <| root || parent != e -- recursion guard let e ← withReducible <| whnf e guard e.isApp -- all interesting ring expressions are applications let ⟨u, α, e⟩ ← inferTypeQ' e let sα ← synthInstanceQ (q(CommSemiring $α) : Q(Type u)) let c ← mkCache sα let ⟨a, _, pa⟩ ← match ← isAtomOrDerivable sα c e rctx s with | none => eval sα c e rctx s -- `none` indicates that `eval` will find something algebraic. | some none => failure -- No point rewriting atoms | some (some r) => pure r -- Nothing algebraic for `eval` to use, but `norm_num` simplifies. let r ← nctx.simp { expr := a, proof? := pa } if ← withReducible <| isDefEq r.expr e then return .done { expr := r.expr } pure (.done r) catch _ => pure <| .continue let post := Simp.postDefault #[] (·.1) <$> Simp.main parent nctx.ctx (methods := { pre, post }) variable [CommSemiring R] theorem add_assoc_rev (a b c : R) : a + (b + c) = a + b + c := (add_assoc ..).symm theorem mul_assoc_rev (a b c : R) : a * (b * c) = a * b * c := (mul_assoc ..).symm theorem mul_neg {R} [Ring R] (a b : R) : a * -b = -(a * b) := by simp theorem add_neg {R} [Ring R] (a b : R) : a + -b = a - b := (sub_eq_add_neg ..).symm theorem nat_rawCast_0 : (Nat.rawCast 0 : R) = 0 := by simp theorem nat_rawCast_1 : (Nat.rawCast 1 : R) = 1 := by simp theorem nat_rawCast_2 [Nat.AtLeastTwo n] : (Nat.rawCast n : R) = OfNat.ofNat n := rfl theorem int_rawCast_neg {R} [Ring R] : (Int.rawCast (.negOfNat n) : R) = -Nat.rawCast n := by simp
Mathlib/Tactic/Ring/RingNF.lean
124
125
theorem rat_rawCast_pos {R} [DivisionRing R] : (Rat.rawCast (.ofNat n) d : R) = Nat.rawCast n / Nat.rawCast d := by
simp
[ " a * -b = -(a * b)", " Nat.rawCast 0 = 0", " Nat.rawCast 1 = 1", " (Int.negOfNat n).rawCast = -n.rawCast", " Rat.rawCast (Int.ofNat n) d = n.rawCast / d.rawCast" ]
[ " a * -b = -(a * b)", " Nat.rawCast 0 = 0", " Nat.rawCast 1 = 1", " (Int.negOfNat n).rawCast = -n.rawCast", " Rat.rawCast (Int.ofNat n) d = n.rawCast / d.rawCast" ]
import Mathlib.Analysis.Convex.Body import Mathlib.Analysis.Convex.Measure import Mathlib.MeasureTheory.Group.FundamentalDomain #align_import measure_theory.group.geometry_of_numbers from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" namespace MeasureTheory open ENNReal FiniteDimensional MeasureTheory MeasureTheory.Measure Set Filter open scoped Pointwise NNReal variable {E L : Type*} [MeasurableSpace E] {μ : Measure E} {F s : Set E} theorem exists_pair_mem_lattice_not_disjoint_vadd [AddCommGroup L] [Countable L] [AddAction L E] [MeasurableSpace L] [MeasurableVAdd L E] [VAddInvariantMeasure L E μ] (fund : IsAddFundamentalDomain L F μ) (hS : NullMeasurableSet s μ) (h : μ F < μ s) : ∃ x y : L, x ≠ y ∧ ¬Disjoint (x +ᵥ s) (y +ᵥ s) := by contrapose! h exact ((fund.measure_eq_tsum _).trans (measure_iUnion₀ (Pairwise.mono h fun i j hij => (hij.mono inf_le_left inf_le_left).aedisjoint) fun _ => (hS.vadd _).inter fund.nullMeasurableSet).symm).trans_le (measure_mono <| Set.iUnion_subset fun _ => Set.inter_subset_right) #align measure_theory.exists_pair_mem_lattice_not_disjoint_vadd MeasureTheory.exists_pair_mem_lattice_not_disjoint_vadd
Mathlib/MeasureTheory/Group/GeometryOfNumbers.lean
64
83
theorem exists_ne_zero_mem_lattice_of_measure_mul_two_pow_lt_measure [NormedAddCommGroup E] [NormedSpace ℝ E] [BorelSpace E] [FiniteDimensional ℝ E] [IsAddHaarMeasure μ] {L : AddSubgroup E} [Countable L] (fund : IsAddFundamentalDomain L F μ) (h_symm : ∀ x ∈ s, -x ∈ s) (h_conv : Convex ℝ s) (h : μ F * 2 ^ finrank ℝ E < μ s) : ∃ x ≠ 0, ((x : L) : E) ∈ s := by
have h_vol : μ F < μ ((2⁻¹ : ℝ) • s) := by rw [addHaar_smul_of_nonneg μ (by norm_num : 0 ≤ (2 : ℝ)⁻¹) s, ← mul_lt_mul_right (pow_ne_zero (finrank ℝ E) (two_ne_zero' _)) (pow_ne_top two_ne_top), mul_right_comm, ofReal_pow (by norm_num : 0 ≤ (2 : ℝ)⁻¹), ofReal_inv_of_pos zero_lt_two] norm_num rwa [← mul_pow, ENNReal.inv_mul_cancel two_ne_zero two_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 refine ⟨x - y, sub_ne_zero.2 hxy, ?_⟩ rw [Set.mem_inv_smul_set_iff₀ (two_ne_zero' ℝ)] at hv hw simp_rw [AddSubgroup.vadd_def, vadd_eq_add, add_comm _ w, ← sub_eq_sub_iff_add_eq_add, ← AddSubgroup.coe_sub] at hvw rw [← hvw, ← inv_smul_smul₀ (two_ne_zero' ℝ) (_ - _), smul_sub, sub_eq_add_neg, smul_add] refine h_conv hw (h_symm _ hv) ?_ ?_ ?_ <;> norm_num
[ " ∃ x y, x ≠ y ∧ ¬Disjoint (x +ᵥ s) (y +ᵥ s)", " μ s ≤ μ F", " ∃ x, x ≠ 0 ∧ ↑x ∈ s", " μ F < μ (2⁻¹ • s)", " 0 ≤ 2⁻¹", " μ F * 2 ^ finrank ℝ E < (ENNReal.ofReal 2)⁻¹ ^ finrank ℝ E * 2 ^ finrank ℝ E * μ s", " μ F * 2 ^ finrank ℝ E < 2⁻¹ ^ finrank ℝ E * 2 ^ finrank ℝ E * μ s", " ↑(x - y) ∈ s", " 2⁻¹ •...
[ " ∃ x y, x ≠ y ∧ ¬Disjoint (x +ᵥ s) (y +ᵥ s)", " μ s ≤ μ F", " ∃ x, x ≠ 0 ∧ ↑x ∈ s" ]
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.MeasureTheory.Measure.Haar.OfBasis import Mathlib.Probability.Independence.Basic #align_import probability.density from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open scoped Classical MeasureTheory NNReal ENNReal open TopologicalSpace MeasureTheory.Measure noncomputable section namespace MeasureTheory variable {Ω E : Type*} [MeasurableSpace E] class HasPDF {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by volume_tac) : Prop where pdf' : AEMeasurable X ℙ ∧ (map X ℙ).HaveLebesgueDecomposition μ ∧ map X ℙ ≪ μ #align measure_theory.has_pdf MeasureTheory.HasPDF def pdf {_ : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by volume_tac) : E → ℝ≥0∞ := (map X ℙ).rnDeriv μ #align measure_theory.pdf MeasureTheory.pdf theorem pdf_def {_ : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E} {X : Ω → E} : pdf X ℙ μ = (map X ℙ).rnDeriv μ := rfl theorem pdf_of_not_aemeasurable {_ : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E} {X : Ω → E} (hX : ¬AEMeasurable X ℙ) : pdf X ℙ μ =ᵐ[μ] 0 := by rw [pdf_def, map_of_not_aemeasurable hX] exact rnDeriv_zero μ #align measure_theory.pdf_eq_zero_of_not_measurable MeasureTheory.pdf_of_not_aemeasurable theorem pdf_of_not_haveLebesgueDecomposition {_ : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E} {X : Ω → E} (h : ¬(map X ℙ).HaveLebesgueDecomposition μ) : pdf X ℙ μ = 0 := rnDeriv_of_not_haveLebesgueDecomposition h theorem aemeasurable_of_pdf_ne_zero {m : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E} (X : Ω → E) (h : ¬pdf X ℙ μ =ᵐ[μ] 0) : AEMeasurable X ℙ := by contrapose! h exact pdf_of_not_aemeasurable h #align measure_theory.measurable_of_pdf_ne_zero MeasureTheory.aemeasurable_of_pdf_ne_zero theorem hasPDF_of_pdf_ne_zero {m : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E} {X : Ω → E} (hac : map X ℙ ≪ μ) (hpdf : ¬pdf X ℙ μ =ᵐ[μ] 0) : HasPDF X ℙ μ := by refine ⟨?_, ?_, hac⟩ · exact aemeasurable_of_pdf_ne_zero X hpdf · contrapose! hpdf have := pdf_of_not_haveLebesgueDecomposition hpdf filter_upwards using congrFun this #align measure_theory.has_pdf_of_pdf_ne_zero MeasureTheory.hasPDF_of_pdf_ne_zero @[measurability] theorem measurable_pdf {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by volume_tac) : Measurable (pdf X ℙ μ) := by exact measurable_rnDeriv _ _ #align measure_theory.measurable_pdf MeasureTheory.measurable_pdf theorem withDensity_pdf_le_map {_ : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by volume_tac) : μ.withDensity (pdf X ℙ μ) ≤ map X ℙ := withDensity_rnDeriv_le _ _
Mathlib/Probability/Density.lean
177
181
theorem set_lintegral_pdf_le_map {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by
volume_tac) (s : Set E) : ∫⁻ x in s, pdf X ℙ μ x ∂μ ≤ map X ℙ s := by apply (withDensity_apply_le _ s).trans exact withDensity_pdf_le_map _ _ _ s
[ " pdf X ℙ μ =ᶠ[ae μ] 0", " rnDeriv 0 μ =ᶠ[ae μ] 0", " AEMeasurable X ℙ", " HasPDF X ℙ μ", " (map X ℙ).HaveLebesgueDecomposition μ", " Measurable (pdf X ℙ μ)", " ∫⁻ (x : E) in s, pdf X ℙ μ x ∂μ ≤ (map X ℙ) s", " (withDensity μ fun a => pdf X ℙ μ a) s ≤ (map X ℙ) s" ]
[ " pdf X ℙ μ =ᶠ[ae μ] 0", " rnDeriv 0 μ =ᶠ[ae μ] 0", " AEMeasurable X ℙ", " HasPDF X ℙ μ", " (map X ℙ).HaveLebesgueDecomposition μ", " Measurable (pdf X ℙ μ)" ]
import Mathlib.AlgebraicTopology.DoldKan.GammaCompN import Mathlib.AlgebraicTopology.DoldKan.NReflectsIso #align_import algebraic_topology.dold_kan.n_comp_gamma from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" noncomputable section open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Idempotents SimplexCategory Opposite SimplicialObject Simplicial DoldKan namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] theorem PInfty_comp_map_mono_eq_zero (X : SimplicialObject C) {n : ℕ} {Δ' : SimplexCategory} (i : Δ' ⟶ [n]) [hi : Mono i] (h₁ : Δ'.len ≠ n) (h₂ : ¬Isδ₀ i) : PInfty.f n ≫ X.map i.op = 0 := by induction' Δ' using SimplexCategory.rec with m obtain ⟨k, hk⟩ := Nat.exists_eq_add_of_lt (len_lt_of_mono i fun h => by rw [← h] at h₁ exact h₁ rfl) simp only [len_mk] at hk rcases k with _|k · change n = m + 1 at hk subst hk obtain ⟨j, rfl⟩ := eq_δ_of_mono i rw [Isδ₀.iff] at h₂ have h₃ : 1 ≤ (j : ℕ) := by by_contra h exact h₂ (by simpa only [Fin.ext_iff, not_le, Nat.lt_one_iff] using h) exact (HigherFacesVanish.of_P (m + 1) m).comp_δ_eq_zero j h₂ (by omega) · simp only [Nat.succ_eq_add_one, ← add_assoc] at hk clear h₂ hi subst hk obtain ⟨j₁ : Fin (_ + 1), i, rfl⟩ := eq_comp_δ_of_not_surjective i fun h => by have h' := len_le_of_epi (SimplexCategory.epi_iff_surjective.2 h) dsimp at h' omega obtain ⟨j₂, i, rfl⟩ := eq_comp_δ_of_not_surjective i fun h => by have h' := len_le_of_epi (SimplexCategory.epi_iff_surjective.2 h) dsimp at h' omega by_cases hj₁ : j₁ = 0 · subst hj₁ rw [assoc, ← SimplexCategory.δ_comp_δ'' (Fin.zero_le _)] simp only [op_comp, X.map_comp, assoc, PInfty_f] erw [(HigherFacesVanish.of_P _ _).comp_δ_eq_zero_assoc _ j₂.succ_ne_zero, zero_comp] simp only [Nat.succ_eq_add_one, Nat.add, Fin.succ] omega · simp only [op_comp, X.map_comp, assoc, PInfty_f] erw [(HigherFacesVanish.of_P _ _).comp_δ_eq_zero_assoc _ hj₁, zero_comp] by_contra exact hj₁ (by simp only [Fin.ext_iff, Fin.val_zero]; linarith) set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty_comp_map_mono_eq_zero AlgebraicTopology.DoldKan.PInfty_comp_map_mono_eq_zero @[reassoc]
Mathlib/AlgebraicTopology/DoldKan/NCompGamma.lean
83
124
theorem Γ₀_obj_termwise_mapMono_comp_PInfty (X : SimplicialObject C) {Δ Δ' : SimplexCategory} (i : Δ ⟶ Δ') [Mono i] : Γ₀.Obj.Termwise.mapMono (AlternatingFaceMapComplex.obj X) i ≫ PInfty.f Δ.len = PInfty.f Δ'.len ≫ X.map i.op := by
induction' Δ using SimplexCategory.rec with n induction' Δ' using SimplexCategory.rec with n' dsimp -- We start with the case `i` is an identity by_cases h : n = n' · subst h simp only [SimplexCategory.eq_id_of_mono i, Γ₀.Obj.Termwise.mapMono_id, op_id, X.map_id] dsimp simp only [id_comp, comp_id] by_cases hi : Isδ₀ i -- The case `i = δ 0` · have h' : n' = n + 1 := hi.left subst h' simp only [Γ₀.Obj.Termwise.mapMono_δ₀' _ i hi] dsimp rw [← PInfty.comm _ n, AlternatingFaceMapComplex.obj_d_eq] simp only [eq_self_iff_true, id_comp, if_true, Preadditive.comp_sum] rw [Finset.sum_eq_single (0 : Fin (n + 2))] rotate_left · intro b _ hb rw [Preadditive.comp_zsmul] erw [PInfty_comp_map_mono_eq_zero X (SimplexCategory.δ b) h (by rw [Isδ₀.iff] exact hb), zsmul_zero] · simp only [Finset.mem_univ, not_true, IsEmpty.forall_iff] · simp only [hi.eq_δ₀, Fin.val_zero, pow_zero, one_zsmul] rfl -- The case `i ≠ δ 0` · rw [Γ₀.Obj.Termwise.mapMono_eq_zero _ i _ hi, zero_comp] swap · by_contra h' exact h (congr_arg SimplexCategory.len h'.symm) rw [PInfty_comp_map_mono_eq_zero] · exact h · by_contra h' exact hi h'
[ " PInfty.f n ≫ X.map i.op = 0", " False", " PInfty.f (m + 1) ≫ X.map i.op = 0", " PInfty.f (m + 1) ≫ X.map (SimplexCategory.δ j).op = 0", " 1 ≤ ↑j", " j = 0", " m + 2 ≤ ↑j + (m + 1)", " PInfty.f (m + k + 1 + 1) ≫ X.map i.op = 0", " PInfty.f (m + k + 1 + 1) ≫ X.map (i ≫ SimplexCategory.δ j₁).op = 0",...
[ " PInfty.f n ≫ X.map i.op = 0", " False", " PInfty.f (m + 1) ≫ X.map i.op = 0", " PInfty.f (m + 1) ≫ X.map (SimplexCategory.δ j).op = 0", " 1 ≤ ↑j", " j = 0", " m + 2 ≤ ↑j + (m + 1)", " PInfty.f (m + k + 1 + 1) ≫ X.map i.op = 0", " PInfty.f (m + k + 1 + 1) ≫ X.map (i ≫ SimplexCategory.δ j₁).op = 0",...
import Mathlib.Algebra.GeomSum import Mathlib.Order.Filter.Archimedean import Mathlib.Order.Iterate import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.Algebra.InfiniteSum.Real #align_import analysis.specific_limits.basic from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2" noncomputable section open scoped Classical open Set Function Filter Finset Metric open scoped Classical open Topology Nat uniformity NNReal ENNReal variable {α : Type*} {β : Type*} {ι : Type*} theorem tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0) := tendsto_inv_atTop_zero.comp tendsto_natCast_atTop_atTop #align tendsto_inverse_at_top_nhds_0_nat tendsto_inverse_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_inverse_atTop_nhds_0_nat := tendsto_inverse_atTop_nhds_zero_nat theorem tendsto_const_div_atTop_nhds_zero_nat (C : ℝ) : Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0) := by simpa only [mul_zero] using tendsto_const_nhds.mul tendsto_inverse_atTop_nhds_zero_nat #align tendsto_const_div_at_top_nhds_0_nat tendsto_const_div_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_const_div_atTop_nhds_0_nat := tendsto_const_div_atTop_nhds_zero_nat theorem tendsto_one_div_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ 1/(n : ℝ)) atTop (𝓝 0) := tendsto_const_div_atTop_nhds_zero_nat 1 @[deprecated (since := "2024-01-31")] alias tendsto_one_div_atTop_nhds_0_nat := tendsto_one_div_atTop_nhds_zero_nat theorem NNReal.tendsto_inverse_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ (n : ℝ≥0)⁻¹) atTop (𝓝 0) := by rw [← NNReal.tendsto_coe] exact _root_.tendsto_inverse_atTop_nhds_zero_nat #align nnreal.tendsto_inverse_at_top_nhds_0_nat NNReal.tendsto_inverse_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias NNReal.tendsto_inverse_atTop_nhds_0_nat := NNReal.tendsto_inverse_atTop_nhds_zero_nat theorem NNReal.tendsto_const_div_atTop_nhds_zero_nat (C : ℝ≥0) : Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0) := by simpa using tendsto_const_nhds.mul NNReal.tendsto_inverse_atTop_nhds_zero_nat #align nnreal.tendsto_const_div_at_top_nhds_0_nat NNReal.tendsto_const_div_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias NNReal.tendsto_const_div_atTop_nhds_0_nat := NNReal.tendsto_const_div_atTop_nhds_zero_nat theorem tendsto_one_div_add_atTop_nhds_zero_nat : Tendsto (fun n : ℕ ↦ 1 / ((n : ℝ) + 1)) atTop (𝓝 0) := suffices Tendsto (fun n : ℕ ↦ 1 / (↑(n + 1) : ℝ)) atTop (𝓝 0) by simpa (tendsto_add_atTop_iff_nat 1).2 (_root_.tendsto_const_div_atTop_nhds_zero_nat 1) #align tendsto_one_div_add_at_top_nhds_0_nat tendsto_one_div_add_atTop_nhds_zero_nat @[deprecated (since := "2024-01-31")] alias tendsto_one_div_add_atTop_nhds_0_nat := tendsto_one_div_add_atTop_nhds_zero_nat theorem NNReal.tendsto_algebraMap_inverse_atTop_nhds_zero_nat (𝕜 : Type*) [Semiring 𝕜] [Algebra ℝ≥0 𝕜] [TopologicalSpace 𝕜] [ContinuousSMul ℝ≥0 𝕜] : Tendsto (algebraMap ℝ≥0 𝕜 ∘ fun n : ℕ ↦ (n : ℝ≥0)⁻¹) atTop (𝓝 0) := by convert (continuous_algebraMap ℝ≥0 𝕜).continuousAt.tendsto.comp tendsto_inverse_atTop_nhds_zero_nat rw [map_zero] @[deprecated (since := "2024-01-31")] alias NNReal.tendsto_algebraMap_inverse_atTop_nhds_0_nat := NNReal.tendsto_algebraMap_inverse_atTop_nhds_zero_nat theorem tendsto_algebraMap_inverse_atTop_nhds_zero_nat (𝕜 : Type*) [Semiring 𝕜] [Algebra ℝ 𝕜] [TopologicalSpace 𝕜] [ContinuousSMul ℝ 𝕜] : Tendsto (algebraMap ℝ 𝕜 ∘ fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0) := NNReal.tendsto_algebraMap_inverse_atTop_nhds_zero_nat 𝕜 @[deprecated (since := "2024-01-31")] alias tendsto_algebraMap_inverse_atTop_nhds_0_nat := _root_.tendsto_algebraMap_inverse_atTop_nhds_zero_nat
Mathlib/Analysis/SpecificLimits/Basic.lean
97
113
theorem tendsto_natCast_div_add_atTop {𝕜 : Type*} [DivisionRing 𝕜] [TopologicalSpace 𝕜] [CharZero 𝕜] [Algebra ℝ 𝕜] [ContinuousSMul ℝ 𝕜] [TopologicalDivisionRing 𝕜] (x : 𝕜) : Tendsto (fun n : ℕ ↦ (n : 𝕜) / (n + x)) atTop (𝓝 1) := by
convert Tendsto.congr' ((eventually_ne_atTop 0).mp (eventually_of_forall fun n hn ↦ _)) _ · exact fun n : ℕ ↦ 1 / (1 + x / n) · field_simp [Nat.cast_ne_zero.mpr hn] · have : 𝓝 (1 : 𝕜) = 𝓝 (1 / (1 + x * (0 : 𝕜))) := by rw [mul_zero, add_zero, div_one] rw [this] refine tendsto_const_nhds.div (tendsto_const_nhds.add ?_) (by simp) simp_rw [div_eq_mul_inv] refine tendsto_const_nhds.mul ?_ have := ((continuous_algebraMap ℝ 𝕜).tendsto _).comp tendsto_inverse_atTop_nhds_zero_nat rw [map_zero, Filter.tendsto_atTop'] at this refine Iff.mpr tendsto_atTop' ?_ intros simp_all only [comp_apply, map_inv₀, map_natCast]
[ " Tendsto (fun n => C / ↑n) atTop (𝓝 0)", " Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)", " Tendsto (fun a => ↑(↑a)⁻¹) atTop (𝓝 ↑0)", " Tendsto (fun n => 1 / (↑n + 1)) atTop (𝓝 0)", " Tendsto (⇑(algebraMap ℝ≥0 𝕜) ∘ fun n => (↑n)⁻¹) atTop (𝓝 0)", " 0 = (algebraMap ℝ≥0 𝕜) 0", " Tendsto (fun n => ↑n / (↑n...
[ " Tendsto (fun n => C / ↑n) atTop (𝓝 0)", " Tendsto (fun n => (↑n)⁻¹) atTop (𝓝 0)", " Tendsto (fun a => ↑(↑a)⁻¹) atTop (𝓝 ↑0)", " Tendsto (fun n => 1 / (↑n + 1)) atTop (𝓝 0)", " Tendsto (⇑(algebraMap ℝ≥0 𝕜) ∘ fun n => (↑n)⁻¹) atTop (𝓝 0)", " 0 = (algebraMap ℝ≥0 𝕜) 0", " Tendsto (fun n => ↑n / (↑n...
import Mathlib.GroupTheory.Perm.Cycle.Type import Mathlib.GroupTheory.Perm.Option import Mathlib.Logic.Equiv.Fin import Mathlib.Logic.Equiv.Fintype #align_import group_theory.perm.fin from "leanprover-community/mathlib"@"7e1c1263b6a25eb90bf16e80d8f47a657e403c4c" open Equiv def Equiv.Perm.decomposeFin {n : ℕ} : Perm (Fin n.succ) ≃ Fin n.succ × Perm (Fin n) := ((Equiv.permCongr <| finSuccEquiv n).trans Equiv.Perm.decomposeOption).trans (Equiv.prodCongr (finSuccEquiv n).symm (Equiv.refl _)) #align equiv.perm.decompose_fin Equiv.Perm.decomposeFin @[simp]
Mathlib/GroupTheory/Perm/Fin.lean
29
31
theorem Equiv.Perm.decomposeFin_symm_of_refl {n : ℕ} (p : Fin (n + 1)) : Equiv.Perm.decomposeFin.symm (p, Equiv.refl _) = swap 0 p := by
simp [Equiv.Perm.decomposeFin, Equiv.permCongr_def]
[ " decomposeFin.symm (p, Equiv.refl (Fin n)) = swap 0 p" ]
[ " decomposeFin.symm (p, Equiv.refl (Fin n)) = swap 0 p" ]
import Mathlib.Data.Set.Equitable import Mathlib.Logic.Equiv.Fin import Mathlib.Order.Partition.Finpartition #align_import order.partition.equipartition from "leanprover-community/mathlib"@"b363547b3113d350d053abdf2884e9850a56b205" open Finset Fintype namespace Finpartition variable {α : Type*} [DecidableEq α] {s t : Finset α} (P : Finpartition s) def IsEquipartition : Prop := (P.parts : Set (Finset α)).EquitableOn card #align finpartition.is_equipartition Finpartition.IsEquipartition theorem isEquipartition_iff_card_parts_eq_average : P.IsEquipartition ↔ ∀ a : Finset α, a ∈ P.parts → a.card = s.card / P.parts.card ∨ a.card = s.card / P.parts.card + 1 := by simp_rw [IsEquipartition, Finset.equitableOn_iff, P.sum_card_parts] #align finpartition.is_equipartition_iff_card_parts_eq_average Finpartition.isEquipartition_iff_card_parts_eq_average variable {P} lemma not_isEquipartition : ¬P.IsEquipartition ↔ ∃ a ∈ P.parts, ∃ b ∈ P.parts, b.card + 1 < a.card := Set.not_equitableOn theorem _root_.Set.Subsingleton.isEquipartition (h : (P.parts : Set (Finset α)).Subsingleton) : P.IsEquipartition := Set.Subsingleton.equitableOn h _ #align finpartition.set.subsingleton.is_equipartition Set.Subsingleton.isEquipartition theorem IsEquipartition.card_parts_eq_average (hP : P.IsEquipartition) (ht : t ∈ P.parts) : t.card = s.card / P.parts.card ∨ t.card = s.card / P.parts.card + 1 := P.isEquipartition_iff_card_parts_eq_average.1 hP _ ht #align finpartition.is_equipartition.card_parts_eq_average Finpartition.IsEquipartition.card_parts_eq_average theorem IsEquipartition.card_part_eq_average_iff (hP : P.IsEquipartition) (ht : t ∈ P.parts) : t.card = s.card / P.parts.card ↔ t.card ≠ s.card / P.parts.card + 1 := by have a := hP.card_parts_eq_average ht have b : ¬(t.card = s.card / P.parts.card ∧ t.card = s.card / P.parts.card + 1) := by by_contra h; exact absurd (h.1 ▸ h.2) (lt_add_one _).ne tauto
Mathlib/Order/Partition/Equipartition.lean
68
71
theorem IsEquipartition.average_le_card_part (hP : P.IsEquipartition) (ht : t ∈ P.parts) : s.card / P.parts.card ≤ t.card := by
rw [← P.sum_card_parts] exact Finset.EquitableOn.le hP ht
[ " P.IsEquipartition ↔ ∀ a ∈ P.parts, a.card = s.card / P.parts.card ∨ a.card = s.card / P.parts.card + 1", " t.card = s.card / P.parts.card ↔ t.card ≠ s.card / P.parts.card + 1", " ¬(t.card = s.card / P.parts.card ∧ t.card = s.card / P.parts.card + 1)", " False", " s.card / P.parts.card ≤ t.card", " (∑ i ...
[ " P.IsEquipartition ↔ ∀ a ∈ P.parts, a.card = s.card / P.parts.card ∨ a.card = s.card / P.parts.card + 1", " t.card = s.card / P.parts.card ↔ t.card ≠ s.card / P.parts.card + 1", " ¬(t.card = s.card / P.parts.card ∧ t.card = s.card / P.parts.card + 1)", " False", " s.card / P.parts.card ≤ t.card" ]
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Degree.Lemmas import Mathlib.Algebra.Polynomial.Div #align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8" noncomputable section open Polynomial open Finset namespace Polynomial universe u v w z variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : ℕ} section NoZeroDivisors variable [CommSemiring R] [NoZeroDivisors R] {p q : R[X]} theorem irreducible_of_monic (hp : p.Monic) (hp1 : p ≠ 1) : Irreducible p ↔ ∀ f g : R[X], f.Monic → g.Monic → f * g = p → f = 1 ∨ g = 1 := by refine ⟨fun h f g hf hg hp => (h.2 f g hp.symm).imp hf.eq_one_of_isUnit hg.eq_one_of_isUnit, fun h => ⟨hp1 ∘ hp.eq_one_of_isUnit, fun f g hfg => (h (g * C f.leadingCoeff) (f * C g.leadingCoeff) ?_ ?_ ?_).symm.imp (isUnit_of_mul_eq_one f _) (isUnit_of_mul_eq_one g _)⟩⟩ · rwa [Monic, leadingCoeff_mul, leadingCoeff_C, ← leadingCoeff_mul, mul_comm, ← hfg, ← Monic] · rwa [Monic, leadingCoeff_mul, leadingCoeff_C, ← leadingCoeff_mul, ← hfg, ← Monic] · rw [mul_mul_mul_comm, ← C_mul, ← leadingCoeff_mul, ← hfg, hp.leadingCoeff, C_1, mul_one, mul_comm, ← hfg] #align polynomial.irreducible_of_monic Polynomial.irreducible_of_monic theorem Monic.irreducible_iff_natDegree (hp : p.Monic) : Irreducible p ↔ p ≠ 1 ∧ ∀ f g : R[X], f.Monic → g.Monic → f * g = p → f.natDegree = 0 ∨ g.natDegree = 0 := by by_cases hp1 : p = 1; · simp [hp1] rw [irreducible_of_monic hp hp1, and_iff_right hp1] refine forall₄_congr fun a b ha hb => ?_ rw [ha.natDegree_eq_zero_iff_eq_one, hb.natDegree_eq_zero_iff_eq_one] #align polynomial.monic.irreducible_iff_nat_degree Polynomial.Monic.irreducible_iff_natDegree
Mathlib/Algebra/Polynomial/RingDivision.lean
268
279
theorem Monic.irreducible_iff_natDegree' (hp : p.Monic) : Irreducible p ↔ p ≠ 1 ∧ ∀ f g : R[X], f.Monic → g.Monic → f * g = p → g.natDegree ∉ Ioc 0 (p.natDegree / 2) := by
simp_rw [hp.irreducible_iff_natDegree, mem_Ioc, Nat.le_div_iff_mul_le zero_lt_two, mul_two] apply and_congr_right' constructor <;> intro h f g hf hg he <;> subst he · rw [hf.natDegree_mul hg, add_le_add_iff_right] exact fun ha => (h f g hf hg rfl).elim (ha.1.trans_le ha.2).ne' ha.1.ne' · simp_rw [hf.natDegree_mul hg, pos_iff_ne_zero] at h contrapose! h obtain hl | hl := le_total f.natDegree g.natDegree · exact ⟨g, f, hg, hf, mul_comm g f, h.1, add_le_add_left hl _⟩ · exact ⟨f, g, hf, hg, rfl, h.2, add_le_add_right hl _⟩
[ " Irreducible p ↔ ∀ (f g : R[X]), f.Monic → g.Monic → f * g = p → f = 1 ∨ g = 1", " (g * C f.leadingCoeff).Monic", " (f * C g.leadingCoeff).Monic", " g * C f.leadingCoeff * (f * C g.leadingCoeff) = p", " Irreducible p ↔ p ≠ 1 ∧ ∀ (f g : R[X]), f.Monic → g.Monic → f * g = p → f.natDegree = 0 ∨ g.natDegree = ...
[ " Irreducible p ↔ ∀ (f g : R[X]), f.Monic → g.Monic → f * g = p → f = 1 ∨ g = 1", " (g * C f.leadingCoeff).Monic", " (f * C g.leadingCoeff).Monic", " g * C f.leadingCoeff * (f * C g.leadingCoeff) = p", " Irreducible p ↔ p ≠ 1 ∧ ∀ (f g : R[X]), f.Monic → g.Monic → f * g = p → f.natDegree = 0 ∨ g.natDegree = ...
import Mathlib.Algebra.GCDMonoid.Basic import Mathlib.Algebra.Order.Ring.Int import Mathlib.Data.Int.GCD instance : GCDMonoid ℕ where gcd := Nat.gcd lcm := Nat.lcm gcd_dvd_left := Nat.gcd_dvd_left gcd_dvd_right := Nat.gcd_dvd_right dvd_gcd := Nat.dvd_gcd gcd_mul_lcm a b := by rw [Nat.gcd_mul_lcm]; rfl lcm_zero_left := Nat.lcm_zero_left lcm_zero_right := Nat.lcm_zero_right theorem gcd_eq_nat_gcd (m n : ℕ) : gcd m n = Nat.gcd m n := rfl #align gcd_eq_nat_gcd gcd_eq_nat_gcd theorem lcm_eq_nat_lcm (m n : ℕ) : lcm m n = Nat.lcm m n := rfl #align lcm_eq_nat_lcm lcm_eq_nat_lcm instance : NormalizedGCDMonoid ℕ := { (inferInstance : GCDMonoid ℕ), (inferInstance : NormalizationMonoid ℕ) with normalize_gcd := fun _ _ => normalize_eq _ normalize_lcm := fun _ _ => normalize_eq _ } namespace Int section NormalizationMonoid instance normalizationMonoid : NormalizationMonoid ℤ where normUnit a := if 0 ≤ a then 1 else -1 normUnit_zero := if_pos le_rfl normUnit_mul {a b} hna hnb := by cases' hna.lt_or_lt with ha ha <;> cases' hnb.lt_or_lt with hb hb <;> simp [mul_nonneg_iff, ha.le, ha.not_le, hb.le, hb.not_le] normUnit_coe_units u := (units_eq_one_or u).elim (fun eq => eq.symm ▸ if_pos zero_le_one) fun eq => eq.symm ▸ if_neg (not_le_of_gt <| show (-1 : ℤ) < 0 by decide) -- Porting note: added theorem normUnit_eq (z : ℤ) : normUnit z = if 0 ≤ z then 1 else -1 := rfl theorem normalize_of_nonneg {z : ℤ} (h : 0 ≤ z) : normalize z = z := by rw [normalize_apply, normUnit_eq, if_pos h, Units.val_one, mul_one] #align int.normalize_of_nonneg Int.normalize_of_nonneg
Mathlib/Algebra/GCDMonoid/Nat.lean
71
75
theorem normalize_of_nonpos {z : ℤ} (h : z ≤ 0) : normalize z = -z := by
obtain rfl | h := h.eq_or_lt · simp · rw [normalize_apply, normUnit_eq, if_neg (not_le_of_gt h), Units.val_neg, Units.val_one, mul_neg_one]
[ " Associated (a.gcd b * a.lcm b) (a * b)", " Associated (a * b) (a * b)", " (fun a => if 0 ≤ a then 1 else -1) (a * b) =\n (fun a => if 0 ≤ a then 1 else -1) a * (fun a => if 0 ≤ a then 1 else -1) b", " -1 < 0", " normalize z = z", " normalize z = -z", " normalize 0 = -0" ]
[ " Associated (a.gcd b * a.lcm b) (a * b)", " Associated (a * b) (a * b)", " (fun a => if 0 ≤ a then 1 else -1) (a * b) =\n (fun a => if 0 ≤ a then 1 else -1) a * (fun a => if 0 ≤ a then 1 else -1) b", " -1 < 0", " normalize z = z", " normalize z = -z" ]
import Mathlib.Algebra.Associated import Mathlib.Algebra.Group.Submonoid.Membership import Mathlib.Algebra.Ring.Opposite import Mathlib.GroupTheory.GroupAction.Opposite #align_import ring_theory.non_zero_divisors from "leanprover-community/mathlib"@"1126441d6bccf98c81214a0780c73d499f6721fe" variable (M₀ : Type*) [MonoidWithZero M₀] def nonZeroDivisorsLeft : Submonoid M₀ where carrier := {x | ∀ y, y * x = 0 → y = 0} one_mem' := by simp mul_mem' {x} {y} hx hy := fun z hz ↦ hx _ <| hy _ (mul_assoc z x y ▸ hz) @[simp] lemma mem_nonZeroDivisorsLeft_iff {x : M₀} : x ∈ nonZeroDivisorsLeft M₀ ↔ ∀ y, y * x = 0 → y = 0 := Iff.rfl lemma nmem_nonZeroDivisorsLeft_iff {r : M₀} : r ∉ nonZeroDivisorsLeft M₀ ↔ {s | s * r = 0 ∧ s ≠ 0}.Nonempty := by simpa [mem_nonZeroDivisorsLeft_iff] using Set.nonempty_def.symm def nonZeroDivisorsRight : Submonoid M₀ where carrier := {x | ∀ y, x * y = 0 → y = 0} one_mem' := by simp mul_mem' := fun {x} {y} hx hy z hz ↦ hy _ (hx _ ((mul_assoc x y z).symm ▸ hz)) @[simp] lemma mem_nonZeroDivisorsRight_iff {x : M₀} : x ∈ nonZeroDivisorsRight M₀ ↔ ∀ y, x * y = 0 → y = 0 := Iff.rfl lemma nmem_nonZeroDivisorsRight_iff {r : M₀} : r ∉ nonZeroDivisorsRight M₀ ↔ {s | r * s = 0 ∧ s ≠ 0}.Nonempty := by simpa [mem_nonZeroDivisorsRight_iff] using Set.nonempty_def.symm lemma nonZeroDivisorsLeft_eq_right (M₀ : Type*) [CommMonoidWithZero M₀] : nonZeroDivisorsLeft M₀ = nonZeroDivisorsRight M₀ := by ext x; simp [mul_comm x] @[simp] lemma coe_nonZeroDivisorsLeft_eq [NoZeroDivisors M₀] [Nontrivial M₀] : nonZeroDivisorsLeft M₀ = {x : M₀ | x ≠ 0} := by ext x simp only [SetLike.mem_coe, mem_nonZeroDivisorsLeft_iff, mul_eq_zero, forall_eq_or_imp, true_and, Set.mem_setOf_eq] refine ⟨fun h ↦ ?_, fun hx y hx' ↦ by contradiction⟩ contrapose! h exact ⟨1, h, one_ne_zero⟩ @[simp] lemma coe_nonZeroDivisorsRight_eq [NoZeroDivisors M₀] [Nontrivial M₀] : nonZeroDivisorsRight M₀ = {x : M₀ | x ≠ 0} := by ext x simp only [SetLike.mem_coe, mem_nonZeroDivisorsRight_iff, mul_eq_zero, Set.mem_setOf_eq] refine ⟨fun h ↦ ?_, fun hx y hx' ↦ by aesop⟩ contrapose! h exact ⟨1, Or.inl h, one_ne_zero⟩ def nonZeroDivisors (R : Type*) [MonoidWithZero R] : Submonoid R where carrier := { x | ∀ z, z * x = 0 → z = 0 } one_mem' _ hz := by rwa [mul_one] at hz mul_mem' hx₁ hx₂ _ hz := by rw [← mul_assoc] at hz exact hx₁ _ (hx₂ _ hz) #align non_zero_divisors nonZeroDivisors scoped[nonZeroDivisors] notation:9000 R "⁰" => nonZeroDivisors R def nonZeroSMulDivisors (R : Type*) [MonoidWithZero R] (M : Type _) [Zero M] [MulAction R M] : Submonoid R where carrier := { r | ∀ m : M, r • m = 0 → m = 0} one_mem' m h := (one_smul R m) ▸ h mul_mem' {r₁ r₂} h₁ h₂ m H := h₂ _ <| h₁ _ <| mul_smul r₁ r₂ m ▸ H scoped[nonZeroSMulDivisors] notation:9000 R "⁰[" M "]" => nonZeroSMulDivisors R M section nonZeroDivisors open nonZeroDivisors variable {M M' M₁ R R' F : Type*} [MonoidWithZero M] [MonoidWithZero M'] [CommMonoidWithZero M₁] [Ring R] [CommRing R'] theorem mem_nonZeroDivisors_iff {r : M} : r ∈ M⁰ ↔ ∀ x, x * r = 0 → x = 0 := Iff.rfl #align mem_non_zero_divisors_iff mem_nonZeroDivisors_iff lemma nmem_nonZeroDivisors_iff {r : M} : r ∉ M⁰ ↔ {s | s * r = 0 ∧ s ≠ 0}.Nonempty := by simpa [mem_nonZeroDivisors_iff] using Set.nonempty_def.symm theorem mul_right_mem_nonZeroDivisors_eq_zero_iff {x r : M} (hr : r ∈ M⁰) : x * r = 0 ↔ x = 0 := ⟨hr _, by simp (config := { contextual := true })⟩ #align mul_right_mem_non_zero_divisors_eq_zero_iff mul_right_mem_nonZeroDivisors_eq_zero_iff @[simp] theorem mul_right_coe_nonZeroDivisors_eq_zero_iff {x : M} {c : M⁰} : x * c = 0 ↔ x = 0 := mul_right_mem_nonZeroDivisors_eq_zero_iff c.prop #align mul_right_coe_non_zero_divisors_eq_zero_iff mul_right_coe_nonZeroDivisors_eq_zero_iff
Mathlib/Algebra/GroupWithZero/NonZeroDivisors.lean
129
130
theorem mul_left_mem_nonZeroDivisors_eq_zero_iff {r x : M₁} (hr : r ∈ M₁⁰) : r * x = 0 ↔ x = 0 := by
rw [mul_comm, mul_right_mem_nonZeroDivisors_eq_zero_iff hr]
[ " 1 ∈ { carrier := {x | ∀ (y : M₀), y * x = 0 → y = 0}, mul_mem' := ⋯ }.carrier", " r ∉ nonZeroDivisorsLeft M₀ ↔ {s | s * r = 0 ∧ s ≠ 0}.Nonempty", " 1 ∈ { carrier := {x | ∀ (y : M₀), x * y = 0 → y = 0}, mul_mem' := ⋯ }.carrier", " r ∉ nonZeroDivisorsRight M₀ ↔ {s | r * s = 0 ∧ s ≠ 0}.Nonempty", " nonZeroDi...
[ " 1 ∈ { carrier := {x | ∀ (y : M₀), y * x = 0 → y = 0}, mul_mem' := ⋯ }.carrier", " r ∉ nonZeroDivisorsLeft M₀ ↔ {s | s * r = 0 ∧ s ≠ 0}.Nonempty", " 1 ∈ { carrier := {x | ∀ (y : M₀), x * y = 0 → y = 0}, mul_mem' := ⋯ }.carrier", " r ∉ nonZeroDivisorsRight M₀ ↔ {s | r * s = 0 ∧ s ≠ 0}.Nonempty", " nonZeroDi...
import Mathlib.AlgebraicGeometry.Gluing import Mathlib.CategoryTheory.Limits.Opposites import Mathlib.AlgebraicGeometry.AffineScheme import Mathlib.CategoryTheory.Limits.Shapes.Diagonal #align_import algebraic_geometry.pullbacks from "leanprover-community/mathlib"@"7316286ff2942aa14e540add9058c6b0aa1c8070" set_option linter.uppercaseLean3 false universe v u noncomputable section open CategoryTheory CategoryTheory.Limits AlgebraicGeometry namespace AlgebraicGeometry.Scheme namespace Pullback variable {C : Type u} [Category.{v} C] variable {X Y Z : Scheme.{u}} (𝒰 : OpenCover.{u} X) (f : X ⟶ Z) (g : Y ⟶ Z) variable [∀ i, HasPullback (𝒰.map i ≫ f) g] def v (i j : 𝒰.J) : Scheme := pullback ((pullback.fst : pullback (𝒰.map i ≫ f) g ⟶ _) ≫ 𝒰.map i) (𝒰.map j) #align algebraic_geometry.Scheme.pullback.V AlgebraicGeometry.Scheme.Pullback.v def t (i j : 𝒰.J) : v 𝒰 f g i j ⟶ v 𝒰 f g j i := by have : HasPullback (pullback.snd ≫ 𝒰.map i ≫ f) g := hasPullback_assoc_symm (𝒰.map j) (𝒰.map i) (𝒰.map i ≫ f) g have : HasPullback (pullback.snd ≫ 𝒰.map j ≫ f) g := hasPullback_assoc_symm (𝒰.map i) (𝒰.map j) (𝒰.map j ≫ f) g refine (pullbackSymmetry ..).hom ≫ (pullbackAssoc ..).inv ≫ ?_ refine ?_ ≫ (pullbackAssoc ..).hom ≫ (pullbackSymmetry ..).hom refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_ · rw [pullbackSymmetry_hom_comp_snd_assoc, pullback.condition_assoc, Category.comp_id] · rw [Category.comp_id, Category.id_comp] #align algebraic_geometry.Scheme.pullback.t AlgebraicGeometry.Scheme.Pullback.t @[simp, reassoc] theorem t_fst_fst (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.fst = pullback.snd := by simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_fst, pullback.lift_fst_assoc, pullbackSymmetry_hom_comp_snd, pullbackAssoc_inv_fst_fst, pullbackSymmetry_hom_comp_fst] #align algebraic_geometry.Scheme.pullback.t_fst_fst AlgebraicGeometry.Scheme.Pullback.t_fst_fst @[simp, reassoc]
Mathlib/AlgebraicGeometry/Pullbacks.lean
71
74
theorem t_fst_snd (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.fst ≫ pullback.snd = pullback.fst ≫ pullback.snd := by
simp only [t, Category.assoc, pullbackSymmetry_hom_comp_fst_assoc, pullbackAssoc_hom_snd_snd, pullback.lift_snd, Category.comp_id, pullbackAssoc_inv_snd, pullbackSymmetry_hom_comp_snd_assoc]
[ " v 𝒰 f g i j ⟶ v 𝒰 f g j i", " pullback (pullback.snd ≫ 𝒰.map i ≫ f) g ⟶ v 𝒰 f g j i", " pullback (pullback.snd ≫ 𝒰.map i ≫ f) g ⟶ pullback (pullback.snd ≫ 𝒰.map j ≫ f) g", " (pullback.snd ≫ 𝒰.map i ≫ f) ≫ 𝟙 Z = (pullbackSymmetry (𝒰.map j) (𝒰.map i)).hom ≫ pullback.snd ≫ 𝒰.map j ≫ f", " g ≫ 𝟙 Z...
[ " v 𝒰 f g i j ⟶ v 𝒰 f g j i", " pullback (pullback.snd ≫ 𝒰.map i ≫ f) g ⟶ v 𝒰 f g j i", " pullback (pullback.snd ≫ 𝒰.map i ≫ f) g ⟶ pullback (pullback.snd ≫ 𝒰.map j ≫ f) g", " (pullback.snd ≫ 𝒰.map i ≫ f) ≫ 𝟙 Z = (pullbackSymmetry (𝒰.map j) (𝒰.map i)).hom ≫ pullback.snd ≫ 𝒰.map j ≫ f", " g ≫ 𝟙 Z...