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
import Mathlib.Order.Filter.Lift import Mathlib.Topology.Separation import Mathlib.Order.Interval.Set.Monotone #align_import topology.filter from "leanprover-community/mathlib"@"4c19a16e4b705bf135cf9a80ac18fcc99c438514" open Set Filter TopologicalSpace open Filter Topology variable {ι : Sort*} {α β X Y : Type*} namespace Filter instance : TopologicalSpace (Filter α) := generateFrom <| range <| Iic ∘ 𝓟 theorem isOpen_Iic_principal {s : Set α} : IsOpen (Iic (𝓟 s)) := GenerateOpen.basic _ (mem_range_self _) #align filter.is_open_Iic_principal Filter.isOpen_Iic_principal
Mathlib/Topology/Filter.lean
55
56
theorem isOpen_setOf_mem {s : Set α} : IsOpen { l : Filter α | s ∈ l } := by
simpa only [Iic_principal] using isOpen_Iic_principal
import Mathlib.Analysis.Calculus.ContDiff.RCLike import Mathlib.MeasureTheory.Measure.Hausdorff #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92" open scoped MeasureTheory ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter variable {ι X Y : Type*} [EMetricSpace X] [EMetricSpace Y] @[irreducible] noncomputable def dimH (s : Set X) : ℝ≥0∞ := by borelize X; exact ⨆ (d : ℝ≥0) (_ : @hausdorffMeasure X _ _ ⟨rfl⟩ d s = ∞), d set_option linter.uppercaseLean3 false in #align dimH dimH section Measurable variable [MeasurableSpace X] [BorelSpace X] theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (_ : μH[d] s = ∞), (d : ℝ≥0∞) := by borelize X; rw [dimH] set_option linter.uppercaseLean3 false in #align dimH_def dimH_def theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s) : μH[d] s = ∞ := by simp only [dimH_def, lt_iSup_iff] at h rcases h with ⟨d', hsd', hdd'⟩ rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd' exact top_unique (hsd' ▸ hausdorffMeasure_mono hdd'.le _) set_option linter.uppercaseLean3 false in #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH theorem dimH_le {s : Set X} {d : ℝ≥0∞} (H : ∀ d' : ℝ≥0, μH[d'] s = ∞ → ↑d' ≤ d) : dimH s ≤ d := (dimH_def s).trans_le <| iSup₂_le H set_option linter.uppercaseLean3 false in #align dimH_le dimH_le theorem dimH_le_of_hausdorffMeasure_ne_top {s : Set X} {d : ℝ≥0} (h : μH[d] s ≠ ∞) : dimH s ≤ d := le_of_not_lt <| mt hausdorffMeasure_of_lt_dimH h set_option linter.uppercaseLean3 false in #align dimH_le_of_hausdorff_measure_ne_top dimH_le_of_hausdorffMeasure_ne_top
Mathlib/Topology/MetricSpace/HausdorffDimension.lean
133
135
theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d] s = ∞) : ↑d ≤ dimH s := by
rw [dimH_def]; exact le_iSup₂ (α := ℝ≥0∞) d h
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 Assoc def transAssocReparamAux (t : I) : ℝ := if (t : ℝ) ≤ 1 / 4 then 2 * t else if (t : ℝ) ≤ 1 / 2 then t + 1 / 4 else 1 / 2 * (t + 1) #align path.homotopy.trans_assoc_reparam_aux Path.Homotopy.transAssocReparamAux @[continuity] theorem continuous_transAssocReparamAux : Continuous transAssocReparamAux := by refine continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (continuous_if_le ?_ ?_ (Continuous.continuousOn ?_) (Continuous.continuousOn ?_) ?_).continuousOn ?_ <;> [continuity; continuity; continuity; continuity; continuity; continuity; continuity; skip; skip] <;> · intro x hx set_option tactic.skipAssignedInstances false in norm_num [hx] #align path.homotopy.continuous_trans_assoc_reparam_aux Path.Homotopy.continuous_transAssocReparamAux theorem transAssocReparamAux_mem_I (t : I) : transAssocReparamAux t ∈ I := by unfold transAssocReparamAux split_ifs <;> constructor <;> linarith [unitInterval.le_one t, unitInterval.nonneg t] set_option linter.uppercaseLean3 false in #align path.homotopy.trans_assoc_reparam_aux_mem_I Path.Homotopy.transAssocReparamAux_mem_I theorem transAssocReparamAux_zero : transAssocReparamAux 0 = 0 := by set_option tactic.skipAssignedInstances false in norm_num [transAssocReparamAux] #align path.homotopy.trans_assoc_reparam_aux_zero Path.Homotopy.transAssocReparamAux_zero
Mathlib/AlgebraicTopology/FundamentalGroupoid/Basic.lean
210
211
theorem transAssocReparamAux_one : transAssocReparamAux 1 = 1 := by
set_option tactic.skipAssignedInstances false in norm_num [transAssocReparamAux]
import Mathlib.CategoryTheory.EqToHom import Mathlib.CategoryTheory.Quotient import Mathlib.Combinatorics.Quiver.Path #align_import category_theory.path_category from "leanprover-community/mathlib"@"c6dd521ebdce53bb372c527569dd7c25de53a08b" universe v₁ v₂ u₁ u₂ namespace CategoryTheory section def Paths (V : Type u₁) : Type u₁ := V #align category_theory.paths CategoryTheory.Paths instance (V : Type u₁) [Inhabited V] : Inhabited (Paths V) := ⟨(default : V)⟩ variable (V : Type u₁) [Quiver.{v₁ + 1} V] namespace Paths instance categoryPaths : Category.{max u₁ v₁} (Paths V) where Hom := fun X Y : V => Quiver.Path X Y id X := Quiver.Path.nil comp f g := Quiver.Path.comp f g #align category_theory.paths.category_paths CategoryTheory.Paths.categoryPaths variable {V} @[simps] def of : V ⥤q Paths V where obj X := X map f := f.toPath #align category_theory.paths.of CategoryTheory.Paths.of attribute [local ext] Functor.ext def lift {C} [Category C] (φ : V ⥤q C) : Paths V ⥤ C where obj := φ.obj map {X} {Y} f := @Quiver.Path.rec V _ X (fun Y _ => φ.obj X ⟶ φ.obj Y) (𝟙 <| φ.obj X) (fun _ f ihp => ihp ≫ φ.map f) Y f map_id X := rfl map_comp f g := by induction' g with _ _ g' p ih _ _ _ · rw [Category.comp_id] rfl · have : f ≫ Quiver.Path.cons g' p = (f ≫ g').cons p := by apply Quiver.Path.comp_cons rw [this] simp only at ih ⊢ rw [ih, Category.assoc] #align category_theory.paths.lift CategoryTheory.Paths.lift @[simp] theorem lift_nil {C} [Category C] (φ : V ⥤q C) (X : V) : (lift φ).map Quiver.Path.nil = 𝟙 (φ.obj X) := rfl #align category_theory.paths.lift_nil CategoryTheory.Paths.lift_nil @[simp] theorem lift_cons {C} [Category C] (φ : V ⥤q C) {X Y Z : V} (p : Quiver.Path X Y) (f : Y ⟶ Z) : (lift φ).map (p.cons f) = (lift φ).map p ≫ φ.map f := rfl #align category_theory.paths.lift_cons CategoryTheory.Paths.lift_cons @[simp] theorem lift_toPath {C} [Category C] (φ : V ⥤q C) {X Y : V} (f : X ⟶ Y) : (lift φ).map f.toPath = φ.map f := by dsimp [Quiver.Hom.toPath, lift] simp #align category_theory.paths.lift_to_path CategoryTheory.Paths.lift_toPath theorem lift_spec {C} [Category C] (φ : V ⥤q C) : of ⋙q (lift φ).toPrefunctor = φ := by fapply Prefunctor.ext · rintro X rfl · rintro X Y f rcases φ with ⟨φo, φm⟩ dsimp [lift, Quiver.Hom.toPath] simp only [Category.id_comp] #align category_theory.paths.lift_spec CategoryTheory.Paths.lift_spec
Mathlib/CategoryTheory/PathCategory.lean
103
119
theorem lift_unique {C} [Category C] (φ : V ⥤q C) (Φ : Paths V ⥤ C) (hΦ : of ⋙q Φ.toPrefunctor = φ) : Φ = lift φ := by
subst_vars fapply Functor.ext · rintro X rfl · rintro X Y f dsimp [lift] induction' f with _ _ p f' ih · simp only [Category.comp_id] apply Functor.map_id · simp only [Category.comp_id, Category.id_comp] at ih ⊢ -- Porting note: Had to do substitute `p.cons f'` and `f'.toPath` by their fully qualified -- versions in this `have` clause (elsewhere too). have : Φ.map (Quiver.Path.cons p f') = Φ.map p ≫ Φ.map (Quiver.Hom.toPath f') := by convert Functor.map_comp Φ p (Quiver.Hom.toPath f') rw [this, ih]
import Mathlib.LinearAlgebra.Basis import Mathlib.Algebra.FreeAlgebra import Mathlib.LinearAlgebra.FinsuppVectorSpace import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition import Mathlib.LinearAlgebra.Dimension.StrongRankCondition #align_import linear_algebra.free_algebra from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" universe u v namespace FreeAlgebra variable (R : Type u) (X : Type v) section variable [CommSemiring R] -- @[simps] noncomputable def basisFreeMonoid : Basis (FreeMonoid X) R (FreeAlgebra R X) := Finsupp.basisSingleOne.map (equivMonoidAlgebraFreeMonoid (R := R) (X := X)).symm.toLinearEquiv #align free_algebra.basis_free_monoid FreeAlgebra.basisFreeMonoid instance : Module.Free R (FreeAlgebra R X) := have : Module.Free R (MonoidAlgebra R (FreeMonoid X)) := Module.Free.finsupp _ _ _ Module.Free.of_equiv (equivMonoidAlgebraFreeMonoid (R := R) (X := X)).symm.toLinearEquiv end
Mathlib/LinearAlgebra/FreeAlgebra.lean
44
47
theorem rank_eq [CommRing R] [Nontrivial R] : Module.rank R (FreeAlgebra R X) = Cardinal.lift.{u} (Cardinal.mk (List X)) := by
rw [← (Basis.mk_eq_rank'.{_,_,_,u} (basisFreeMonoid R X)).trans (Cardinal.lift_id _), Cardinal.lift_umax'.{v,u}, FreeMonoid]
import Mathlib.Topology.MetricSpace.HausdorffDistance #align_import topology.metric_space.pi_nat from "leanprover-community/mathlib"@"49b7f94aab3a3bdca1f9f34c5d818afb253b3993" noncomputable section open scoped Classical open Topology Filter open TopologicalSpace Set Metric Filter Function attribute [local simp] pow_le_pow_iff_right one_lt_two inv_le_inv zero_le_two zero_lt_two variable {E : ℕ → Type*} namespace PiNat irreducible_def firstDiff (x y : ∀ n, E n) : ℕ := if h : x ≠ y then Nat.find (ne_iff.1 h) else 0 #align pi_nat.first_diff PiNat.firstDiff theorem apply_firstDiff_ne {x y : ∀ n, E n} (h : x ≠ y) : x (firstDiff x y) ≠ y (firstDiff x y) := by rw [firstDiff_def, dif_pos h] exact Nat.find_spec (ne_iff.1 h) #align pi_nat.apply_first_diff_ne PiNat.apply_firstDiff_ne
Mathlib/Topology/MetricSpace/PiNat.lean
80
85
theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDiff x y) : x n = y n := by
rw [firstDiff_def] at hn split_ifs at hn with h · convert Nat.find_min (ne_iff.1 h) hn simp · exact (not_lt_zero' hn).elim
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Nat.Choose.Sum import Mathlib.RingTheory.PowerSeries.Basic #align_import ring_theory.power_series.well_known from "leanprover-community/mathlib"@"8199f6717c150a7fe91c4534175f4cf99725978f" namespace PowerSeries section Field variable (A A' : Type*) [Ring A] [Ring A'] [Algebra ℚ A] [Algebra ℚ A'] open Nat def exp : PowerSeries A := mk fun n => algebraMap ℚ A (1 / n !) #align power_series.exp PowerSeries.exp def sin : PowerSeries A := mk fun n => if Even n then 0 else algebraMap ℚ A ((-1) ^ (n / 2) / n !) #align power_series.sin PowerSeries.sin def cos : PowerSeries A := mk fun n => if Even n then algebraMap ℚ A ((-1) ^ (n / 2) / n !) else 0 #align power_series.cos PowerSeries.cos variable {A A'} [Ring A] [Ring A'] [Algebra ℚ A] [Algebra ℚ A'] (n : ℕ) (f : A →+* A') @[simp] theorem coeff_exp : coeff A n (exp A) = algebraMap ℚ A (1 / n !) := coeff_mk _ _ #align power_series.coeff_exp PowerSeries.coeff_exp @[simp] theorem constantCoeff_exp : constantCoeff A (exp A) = 1 := by rw [← coeff_zero_eq_constantCoeff_apply, coeff_exp] simp #align power_series.constant_coeff_exp PowerSeries.constantCoeff_exp set_option linter.deprecated false in @[simp] theorem coeff_sin_bit0 : coeff A (bit0 n) (sin A) = 0 := by rw [sin, coeff_mk, if_pos (even_bit0 n)] #align power_series.coeff_sin_bit0 PowerSeries.coeff_sin_bit0 set_option linter.deprecated false in @[simp] theorem coeff_sin_bit1 : coeff A (bit1 n) (sin A) = (-1) ^ n * coeff A (bit1 n) (exp A) := by rw [sin, coeff_mk, if_neg n.not_even_bit1, Nat.bit1_div_two, ← mul_one_div, map_mul, map_pow, map_neg, map_one, coeff_exp] #align power_series.coeff_sin_bit1 PowerSeries.coeff_sin_bit1 set_option linter.deprecated false in @[simp] theorem coeff_cos_bit0 : coeff A (bit0 n) (cos A) = (-1) ^ n * coeff A (bit0 n) (exp A) := by rw [cos, coeff_mk, if_pos (even_bit0 n), Nat.bit0_div_two, ← mul_one_div, map_mul, map_pow, map_neg, map_one, coeff_exp] #align power_series.coeff_cos_bit0 PowerSeries.coeff_cos_bit0 set_option linter.deprecated false in @[simp] theorem coeff_cos_bit1 : coeff A (bit1 n) (cos A) = 0 := by rw [cos, coeff_mk, if_neg n.not_even_bit1] #align power_series.coeff_cos_bit1 PowerSeries.coeff_cos_bit1 @[simp] theorem map_exp : map (f : A →+* A') (exp A) = exp A' := by ext simp #align power_series.map_exp PowerSeries.map_exp @[simp]
Mathlib/RingTheory/PowerSeries/WellKnown.lean
212
214
theorem map_sin : map f (sin A) = sin A' := by
ext simp [sin, apply_ite f]
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Mul import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w noncomputable section open scoped Classical Topology Filter ENNReal open Filter Asymptotics Set open ContinuousLinearMap (smulRight smulRight_one_eq_iff) variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {E : Type w} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {f f₀ f₁ g : 𝕜 → F} variable {f' f₀' f₁' g' : F} variable {x : 𝕜} variable {s t : Set 𝕜} variable {L L₁ L₂ : Filter 𝕜} section SMul variable {𝕜' : Type*} [NontriviallyNormedField 𝕜'] [NormedAlgebra 𝕜 𝕜'] [NormedSpace 𝕜' F] [IsScalarTower 𝕜 𝕜' F] {c : 𝕜 → 𝕜'} {c' : 𝕜'} theorem HasDerivWithinAt.smul (hc : HasDerivWithinAt c c' s x) (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (fun y => c y • f y) (c x • f' + c' • f x) s x := by simpa using (HasFDerivWithinAt.smul hc hf).hasDerivWithinAt #align has_deriv_within_at.smul HasDerivWithinAt.smul theorem HasDerivAt.smul (hc : HasDerivAt c c' x) (hf : HasDerivAt f f' x) : HasDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x := by rw [← hasDerivWithinAt_univ] at * exact hc.smul hf #align has_deriv_at.smul HasDerivAt.smul nonrec theorem HasStrictDerivAt.smul (hc : HasStrictDerivAt c c' x) (hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x := by simpa using (hc.smul hf).hasStrictDerivAt #align has_strict_deriv_at.smul HasStrictDerivAt.smul theorem derivWithin_smul (hxs : UniqueDiffWithinAt 𝕜 s x) (hc : DifferentiableWithinAt 𝕜 c s x) (hf : DifferentiableWithinAt 𝕜 f s x) : derivWithin (fun y => c y • f y) s x = c x • derivWithin f s x + derivWithin c s x • f x := (hc.hasDerivWithinAt.smul hf.hasDerivWithinAt).derivWithin hxs #align deriv_within_smul derivWithin_smul theorem deriv_smul (hc : DifferentiableAt 𝕜 c x) (hf : DifferentiableAt 𝕜 f x) : deriv (fun y => c y • f y) x = c x • deriv f x + deriv c x • f x := (hc.hasDerivAt.smul hf.hasDerivAt).deriv #align deriv_smul deriv_smul theorem HasStrictDerivAt.smul_const (hc : HasStrictDerivAt c c' x) (f : F) : HasStrictDerivAt (fun y => c y • f) (c' • f) x := by have := hc.smul (hasStrictDerivAt_const x f) rwa [smul_zero, zero_add] at this #align has_strict_deriv_at.smul_const HasStrictDerivAt.smul_const theorem HasDerivWithinAt.smul_const (hc : HasDerivWithinAt c c' s x) (f : F) : HasDerivWithinAt (fun y => c y • f) (c' • f) s x := by have := hc.smul (hasDerivWithinAt_const x s f) rwa [smul_zero, zero_add] at this #align has_deriv_within_at.smul_const HasDerivWithinAt.smul_const
Mathlib/Analysis/Calculus/Deriv/Mul.lean
126
129
theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) : HasDerivAt (fun y => c y • f) (c' • f) x := by
rw [← hasDerivWithinAt_univ] at * exact hc.smul_const f
import Mathlib.Analysis.Calculus.FDeriv.Bilinear #align_import analysis.calculus.fderiv.mul from "leanprover-community/mathlib"@"d608fc5d4e69d4cc21885913fb573a88b0deb521" open scoped Classical open Filter Asymptotics ContinuousLinearMap Set Metric Topology NNReal ENNReal noncomputable section section variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace 𝕜 G'] variable {f f₀ f₁ g : E → F} variable {f' f₀' f₁' g' : E →L[𝕜] F} variable (e : E →L[𝕜] F) variable {x : E} variable {s t : Set E} variable {L L₁ L₂ : Filter E} section Mul variable {𝔸 𝔸' : Type*} [NormedRing 𝔸] [NormedCommRing 𝔸'] [NormedAlgebra 𝕜 𝔸] [NormedAlgebra 𝕜 𝔸'] {a b : E → 𝔸} {a' b' : E →L[𝕜] 𝔸} {c d : E → 𝔸'} {c' d' : E →L[𝕜] 𝔸'} @[fun_prop] theorem HasStrictFDerivAt.mul' {x : E} (ha : HasStrictFDerivAt a a' x) (hb : HasStrictFDerivAt b b' x) : HasStrictFDerivAt (fun y => a y * b y) (a x • b' + a'.smulRight (b x)) x := ((ContinuousLinearMap.mul 𝕜 𝔸).isBoundedBilinearMap.hasStrictFDerivAt (a x, b x)).comp x (ha.prod hb) #align has_strict_fderiv_at.mul' HasStrictFDerivAt.mul' @[fun_prop] theorem HasStrictFDerivAt.mul (hc : HasStrictFDerivAt c c' x) (hd : HasStrictFDerivAt d d' x) : HasStrictFDerivAt (fun y => c y * d y) (c x • d' + d x • c') x := by convert hc.mul' hd ext z apply mul_comm #align has_strict_fderiv_at.mul HasStrictFDerivAt.mul @[fun_prop] theorem HasFDerivWithinAt.mul' (ha : HasFDerivWithinAt a a' s x) (hb : HasFDerivWithinAt b b' s x) : HasFDerivWithinAt (fun y => a y * b y) (a x • b' + a'.smulRight (b x)) s x := ((ContinuousLinearMap.mul 𝕜 𝔸).isBoundedBilinearMap.hasFDerivAt (a x, b x)).comp_hasFDerivWithinAt x (ha.prod hb) #align has_fderiv_within_at.mul' HasFDerivWithinAt.mul' @[fun_prop] theorem HasFDerivWithinAt.mul (hc : HasFDerivWithinAt c c' s x) (hd : HasFDerivWithinAt d d' s x) : HasFDerivWithinAt (fun y => c y * d y) (c x • d' + d x • c') s x := by convert hc.mul' hd ext z apply mul_comm #align has_fderiv_within_at.mul HasFDerivWithinAt.mul @[fun_prop] theorem HasFDerivAt.mul' (ha : HasFDerivAt a a' x) (hb : HasFDerivAt b b' x) : HasFDerivAt (fun y => a y * b y) (a x • b' + a'.smulRight (b x)) x := ((ContinuousLinearMap.mul 𝕜 𝔸).isBoundedBilinearMap.hasFDerivAt (a x, b x)).comp x (ha.prod hb) #align has_fderiv_at.mul' HasFDerivAt.mul' @[fun_prop]
Mathlib/Analysis/Calculus/FDeriv/Mul.lean
405
409
theorem HasFDerivAt.mul (hc : HasFDerivAt c c' x) (hd : HasFDerivAt d d' x) : HasFDerivAt (fun y => c y * d y) (c x • d' + d x • c') x := by
convert hc.mul' hd ext z apply mul_comm
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Geometry.Euclidean.PerpBisector import Mathlib.Algebra.QuadraticDiscriminant #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" noncomputable section open scoped Classical open RealInnerProductSpace namespace EuclideanGeometry variable {V : Type*} {P : Type*} variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) : dist p1 (midpoint ℝ p1 p2) = dist p2 (midpoint ℝ p1 p2) := by rw [dist_left_midpoint (𝕜 := ℝ) p1 p2, dist_right_midpoint (𝕜 := ℝ) p1 p2] #align euclidean_geometry.dist_left_midpoint_eq_dist_right_midpoint EuclideanGeometry.dist_left_midpoint_eq_dist_right_midpoint theorem inner_weightedVSub {ι₁ : Type*} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P) (h₁ : ∑ i ∈ s₁, w₁ i = 0) {ι₂ : Type*} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P) (h₂ : ∑ i ∈ s₂, w₂ i = 0) : ⟪s₁.weightedVSub p₁ w₁, s₂.weightedVSub p₂ w₂⟫ = (-∑ i₁ ∈ s₁, ∑ i₂ ∈ s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) / 2 := by rw [Finset.weightedVSub_apply, Finset.weightedVSub_apply, inner_sum_smul_sum_smul_of_sum_eq_zero _ h₁ _ h₂] simp_rw [vsub_sub_vsub_cancel_right] rcongr (i₁ i₂) <;> rw [dist_eq_norm_vsub V (p₁ i₁) (p₂ i₂)] #align euclidean_geometry.inner_weighted_vsub EuclideanGeometry.inner_weightedVSub
Mathlib/Geometry/Euclidean/Basic.lean
93
104
theorem dist_affineCombination {ι : Type*} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P) (h₁ : ∑ i ∈ s, w₁ i = 1) (h₂ : ∑ i ∈ s, w₂ i = 1) : by have a₁ := s.affineCombination ℝ p w₁ have a₂ := s.affineCombination ℝ p w₂ exact dist a₁ a₂ * dist a₁ a₂ = (-∑ i₁ ∈ s, ∑ i₂ ∈ s, (w₁ - w₂) i₁ * (w₁ - w₂) i₂ * (dist (p i₁) (p i₂) * dist (p i₁) (p i₂))) / 2 := by
dsimp only rw [dist_eq_norm_vsub V (s.affineCombination ℝ p w₁) (s.affineCombination ℝ p w₂), ← @inner_self_eq_norm_mul_norm ℝ, Finset.affineCombination_vsub] have h : (∑ i ∈ s, (w₁ - w₂) i) = 0 := by simp_rw [Pi.sub_apply, Finset.sum_sub_distrib, h₁, h₂, sub_self] exact inner_weightedVSub p h p h
import Mathlib.Algebra.CharP.Invertible import Mathlib.Data.Real.Sqrt import Mathlib.Tactic.Polyrith #align_import algebra.star.chsh from "leanprover-community/mathlib"@"31c24aa72e7b3e5ed97a8412470e904f82b81004" universe u --@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where A₀_inv : A₀ ^ 2 = 1 A₁_inv : A₁ ^ 2 = 1 B₀_inv : B₀ ^ 2 = 1 B₁_inv : B₁ ^ 2 = 1 A₀_sa : star A₀ = A₀ A₁_sa : star A₁ = A₁ B₀_sa : star B₀ = B₀ B₁_sa : star B₁ = B₁ A₀B₀_commutes : A₀ * B₀ = B₀ * A₀ A₀B₁_commutes : A₀ * B₁ = B₁ * A₀ A₁B₀_commutes : A₁ * B₀ = B₀ * A₁ A₁B₁_commutes : A₁ * B₁ = B₁ * A₁ set_option linter.uppercaseLean3 false in #align is_CHSH_tuple IsCHSHTuple variable {R : Type u} theorem CHSH_id [CommRing R] {A₀ A₁ B₀ B₁ : R} (A₀_inv : A₀ ^ 2 = 1) (A₁_inv : A₁ ^ 2 = 1) (B₀_inv : B₀ ^ 2 = 1) (B₁_inv : B₁ ^ 2 = 1) : (2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁) * (2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁) = 4 * (2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁) := by -- polyrith suggests: linear_combination (2 * B₀ * B₁ + 2) * A₀_inv + (B₀ ^ 2 - 2 * B₀ * B₁ + B₁ ^ 2) * A₁_inv + (A₀ ^ 2 + 2 * A₀ * A₁ + 1) * B₀_inv + (A₀ ^ 2 - 2 * A₀ * A₁ + 1) * B₁_inv set_option linter.uppercaseLean3 false in #align CHSH_id CHSH_id
Mathlib/Algebra/Star/CHSH.lean
121
138
theorem CHSH_inequality_of_comm [OrderedCommRing R] [StarRing R] [StarOrderedRing R] [Algebra ℝ R] [OrderedSMul ℝ R] (A₀ A₁ B₀ B₁ : R) (T : IsCHSHTuple A₀ A₁ B₀ B₁) : A₀ * B₀ + A₀ * B₁ + A₁ * B₀ - A₁ * B₁ ≤ 2 := by
let P := 2 - A₀ * B₀ - A₀ * B₁ - A₁ * B₀ + A₁ * B₁ have i₁ : 0 ≤ P := by have idem : P * P = 4 * P := CHSH_id T.A₀_inv T.A₁_inv T.B₀_inv T.B₁_inv have idem' : P = (1 / 4 : ℝ) • (P * P) := by have h : 4 * P = (4 : ℝ) • P := by simp [Algebra.smul_def] rw [idem, h, ← mul_smul] norm_num have sa : star P = P := by dsimp [P] simp only [star_add, star_sub, star_mul, star_ofNat, star_one, T.A₀_sa, T.A₁_sa, T.B₀_sa, T.B₁_sa, mul_comm B₀, mul_comm B₁] simpa only [← idem', sa] using smul_nonneg (by norm_num : (0 : ℝ) ≤ 1 / 4) (star_mul_self_nonneg P) apply le_of_sub_nonneg simpa only [sub_add_eq_sub_sub, ← sub_add] using i₁
import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.Units import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul #align_import analysis.normed_space.bounded_linear_maps from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" noncomputable section open Topology open Filter (Tendsto) open Metric ContinuousLinearMap variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] structure IsBoundedLinearMap (𝕜 : Type*) [NormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] (f : E → F) extends IsLinearMap 𝕜 f : Prop where bound : ∃ M, 0 < M ∧ ∀ x : E, ‖f x‖ ≤ M * ‖x‖ #align is_bounded_linear_map IsBoundedLinearMap theorem IsLinearMap.with_bound {f : E → F} (hf : IsLinearMap 𝕜 f) (M : ℝ) (h : ∀ x : E, ‖f x‖ ≤ M * ‖x‖) : IsBoundedLinearMap 𝕜 f := ⟨hf, by_cases (fun (this : M ≤ 0) => ⟨1, zero_lt_one, fun x => (h x).trans <| mul_le_mul_of_nonneg_right (this.trans zero_le_one) (norm_nonneg x)⟩) fun (this : ¬M ≤ 0) => ⟨M, lt_of_not_ge this, h⟩⟩ #align is_linear_map.with_bound IsLinearMap.with_bound theorem ContinuousLinearMap.isBoundedLinearMap (f : E →L[𝕜] F) : IsBoundedLinearMap 𝕜 f := { f.toLinearMap.isLinear with bound := f.bound } #align continuous_linear_map.is_bounded_linear_map ContinuousLinearMap.isBoundedLinearMap section variable {ι : Type*} [Fintype ι] theorem isBoundedLinearMap_prod_multilinear {E : ι → Type*} [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] : IsBoundedLinearMap 𝕜 fun p : ContinuousMultilinearMap 𝕜 E F × ContinuousMultilinearMap 𝕜 E G => p.1.prod p.2 where map_add p₁ p₂ := by ext : 1; rfl map_smul c p := by ext : 1; rfl bound := by refine ⟨1, zero_lt_one, fun p ↦ ?_⟩ rw [one_mul] apply ContinuousMultilinearMap.opNorm_le_bound _ (norm_nonneg _) _ intro m rw [ContinuousMultilinearMap.prod_apply, norm_prod_le_iff] constructor · exact (p.1.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_fst_le p) <| by positivity) · exact (p.2.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_snd_le p) <| by positivity) #align is_bounded_linear_map_prod_multilinear isBoundedLinearMap_prod_multilinear
Mathlib/Analysis/NormedSpace/BoundedLinearMaps.lean
236
254
theorem isBoundedLinearMap_continuousMultilinearMap_comp_linear (g : G →L[𝕜] E) : IsBoundedLinearMap 𝕜 fun f : ContinuousMultilinearMap 𝕜 (fun _ : ι => E) F => f.compContinuousLinearMap fun _ => g := by
refine IsLinearMap.with_bound ⟨fun f₁ f₂ => by ext; rfl, fun c f => by ext; rfl⟩ (‖g‖ ^ Fintype.card ι) fun f => ?_ apply ContinuousMultilinearMap.opNorm_le_bound _ _ _ · apply_rules [mul_nonneg, pow_nonneg, norm_nonneg] intro m calc ‖f (g ∘ m)‖ ≤ ‖f‖ * ∏ i, ‖g (m i)‖ := f.le_opNorm _ _ ≤ ‖f‖ * ∏ i, ‖g‖ * ‖m i‖ := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) exact Finset.prod_le_prod (fun i _ => norm_nonneg _) fun i _ => g.le_opNorm _ _ = ‖g‖ ^ Fintype.card ι * ‖f‖ * ∏ i, ‖m i‖ := by simp only [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ] ring
import Mathlib.RingTheory.WittVector.Truncated import Mathlib.RingTheory.WittVector.Identities import Mathlib.NumberTheory.Padics.RingHoms #align_import ring_theory.witt_vector.compare from "leanprover-community/mathlib"@"168ad7fc5d8173ad38be9767a22d50b8ecf1cd00" noncomputable section variable {p : ℕ} [hp : Fact p.Prime] local notation "𝕎" => WittVector p namespace TruncatedWittVector variable (p) (n : ℕ) (R : Type*) [CommRing R] theorem eq_of_le_of_cast_pow_eq_zero [CharP R p] (i : ℕ) (hin : i ≤ n) (hpi : (p : TruncatedWittVector p n R) ^ i = 0) : i = n := by contrapose! hpi replace hin := lt_of_le_of_ne hin hpi; clear hpi have : (p : TruncatedWittVector p n R) ^ i = WittVector.truncate n ((p : 𝕎 R) ^ i) := by rw [RingHom.map_pow, map_natCast] rw [this, ne_eq, ext_iff, not_forall]; clear this use ⟨i, hin⟩ rw [WittVector.coeff_truncate, coeff_zero, Fin.val_mk, WittVector.coeff_p_pow] haveI : Nontrivial R := CharP.nontrivial_of_char_ne_one hp.1.ne_one exact one_ne_zero #align truncated_witt_vector.eq_of_le_of_cast_pow_eq_zero TruncatedWittVector.eq_of_le_of_cast_pow_eq_zero section Iso variable {R} theorem card_zmod : Fintype.card (TruncatedWittVector p n (ZMod p)) = p ^ n := by rw [card, ZMod.card] #align truncated_witt_vector.card_zmod TruncatedWittVector.card_zmod theorem charP_zmod : CharP (TruncatedWittVector p n (ZMod p)) (p ^ n) := charP_of_prime_pow_injective _ _ _ (card_zmod _ _) (eq_of_le_of_cast_pow_eq_zero p n (ZMod p)) #align truncated_witt_vector.char_p_zmod TruncatedWittVector.charP_zmod attribute [local instance] charP_zmod def zmodEquivTrunc : ZMod (p ^ n) ≃+* TruncatedWittVector p n (ZMod p) := ZMod.ringEquiv (TruncatedWittVector p n (ZMod p)) (card_zmod _ _) #align truncated_witt_vector.zmod_equiv_trunc TruncatedWittVector.zmodEquivTrunc theorem zmodEquivTrunc_apply {x : ZMod (p ^ n)} : zmodEquivTrunc p n x = ZMod.castHom (by rfl) (TruncatedWittVector p n (ZMod p)) x := rfl #align truncated_witt_vector.zmod_equiv_trunc_apply TruncatedWittVector.zmodEquivTrunc_apply theorem commutes {m : ℕ} (hm : n ≤ m) : (truncate hm).comp (zmodEquivTrunc p m).toRingHom = (zmodEquivTrunc p n).toRingHom.comp (ZMod.castHom (pow_dvd_pow p hm) _) := RingHom.ext_zmod _ _ #align truncated_witt_vector.commutes TruncatedWittVector.commutes theorem commutes' {m : ℕ} (hm : n ≤ m) (x : ZMod (p ^ m)) : truncate hm (zmodEquivTrunc p m x) = zmodEquivTrunc p n (ZMod.castHom (pow_dvd_pow p hm) _ x) := show (truncate hm).comp (zmodEquivTrunc p m).toRingHom x = _ by rw [commutes _ _ hm]; rfl #align truncated_witt_vector.commutes' TruncatedWittVector.commutes'
Mathlib/RingTheory/WittVector/Compare.lean
107
112
theorem commutes_symm' {m : ℕ} (hm : n ≤ m) (x : TruncatedWittVector p m (ZMod p)) : (zmodEquivTrunc p n).symm (truncate hm x) = ZMod.castHom (pow_dvd_pow p hm) _ ((zmodEquivTrunc p m).symm x) := by
apply (zmodEquivTrunc p n).injective rw [← commutes' _ _ hm] simp
import Mathlib.Order.SuccPred.Basic import Mathlib.Topology.Order.Basic import Mathlib.Topology.Metrizable.Uniformity #align_import topology.instances.discrete from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Order Set TopologicalSpace Filter variable {α : Type*} [TopologicalSpace α] instance (priority := 100) DiscreteTopology.firstCountableTopology [DiscreteTopology α] : FirstCountableTopology α where nhds_generated_countable := by rw [nhds_discrete]; exact isCountablyGenerated_pure #align discrete_topology.first_countable_topology DiscreteTopology.firstCountableTopology instance (priority := 100) DiscreteTopology.secondCountableTopology_of_countable [hd : DiscreteTopology α] [Countable α] : SecondCountableTopology α := haveI : ∀ i : α, SecondCountableTopology (↥({i} : Set α)) := fun i => { is_open_generated_countable := ⟨{univ}, countable_singleton _, by simp only [eq_iff_true_of_subsingleton]⟩ } secondCountableTopology_of_countable_cover (singletons_open_iff_discrete.mpr hd) (iUnion_of_singleton α) #align discrete_topology.second_countable_topology_of_encodable DiscreteTopology.secondCountableTopology_of_countable @[deprecated DiscreteTopology.secondCountableTopology_of_countable (since := "2024-03-11")] theorem DiscreteTopology.secondCountableTopology_of_encodable {α : Type*} [TopologicalSpace α] [DiscreteTopology α] [Countable α] : SecondCountableTopology α := DiscreteTopology.secondCountableTopology_of_countable #align discrete_topology.second_countable_topology_of_countable DiscreteTopology.secondCountableTopology_of_countable theorem bot_topologicalSpace_eq_generateFrom_of_pred_succOrder [PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by refine (eq_bot_of_singletons_open fun a => ?_).symm have h_singleton_eq_inter : {a} = Iio (succ a) ∩ Ioi (pred a) := by suffices h_singleton_eq_inter' : {a} = Iic a ∩ Ici a by rw [h_singleton_eq_inter', ← Ioi_pred, ← Iio_succ] rw [inter_comm, Ici_inter_Iic, Icc_self a] rw [h_singleton_eq_inter] letI := Preorder.topology α apply IsOpen.inter · exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩ · exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩ #align bot_topological_space_eq_generate_from_of_pred_succ_order bot_topologicalSpace_eq_generateFrom_of_pred_succOrder theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α := by refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩ · rw [h.eq_bot] exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder · rw [h.topology_eq_generate_intervals] exact bot_topologicalSpace_eq_generateFrom_of_pred_succOrder.symm #align discrete_topology_iff_order_topology_of_pred_succ' discreteTopology_iff_orderTopology_of_pred_succ' instance (priority := 100) DiscreteTopology.orderTopology_of_pred_succ' [h : DiscreteTopology α] [PartialOrder α] [PredOrder α] [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : OrderTopology α := discreteTopology_iff_orderTopology_of_pred_succ'.1 h #align discrete_topology.order_topology_of_pred_succ' DiscreteTopology.orderTopology_of_pred_succ' theorem LinearOrder.bot_topologicalSpace_eq_generateFrom [LinearOrder α] [PredOrder α] [SuccOrder α] : (⊥ : TopologicalSpace α) = generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a } := by refine (eq_bot_of_singletons_open fun a => ?_).symm have h_singleton_eq_inter : {a} = Iic a ∩ Ici a := by rw [inter_comm, Ici_inter_Iic, Icc_self a] by_cases ha_top : IsTop a · rw [ha_top.Iic_eq, inter_comm, inter_univ] at h_singleton_eq_inter by_cases ha_bot : IsBot a · rw [ha_bot.Ici_eq] at h_singleton_eq_inter rw [h_singleton_eq_inter] -- Porting note: Specified instance for `isOpen_univ` explicitly to fix an error. apply @isOpen_univ _ (generateFrom { s | ∃ a, s = Ioi a ∨ s = Iio a }) · rw [isBot_iff_isMin] at ha_bot rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter rw [h_singleton_eq_inter] exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩ · rw [isTop_iff_isMax] at ha_top rw [← Iio_succ_of_not_isMax ha_top] at h_singleton_eq_inter by_cases ha_bot : IsBot a · rw [ha_bot.Ici_eq, inter_univ] at h_singleton_eq_inter rw [h_singleton_eq_inter] exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩ · rw [isBot_iff_isMin] at ha_bot rw [← Ioi_pred_of_not_isMin ha_bot] at h_singleton_eq_inter rw [h_singleton_eq_inter] -- Porting note: Specified instance for `IsOpen.inter` explicitly to fix an error. letI := Preorder.topology α apply IsOpen.inter · exact isOpen_generateFrom_of_mem ⟨succ a, Or.inr rfl⟩ · exact isOpen_generateFrom_of_mem ⟨pred a, Or.inl rfl⟩ #align linear_order.bot_topological_space_eq_generate_from LinearOrder.bot_topologicalSpace_eq_generateFrom
Mathlib/Topology/Instances/Discrete.lean
111
117
theorem discreteTopology_iff_orderTopology_of_pred_succ [LinearOrder α] [PredOrder α] [SuccOrder α] : DiscreteTopology α ↔ OrderTopology α := by
refine ⟨fun h => ⟨?_⟩, fun h => ⟨?_⟩⟩ · rw [h.eq_bot] exact LinearOrder.bot_topologicalSpace_eq_generateFrom · rw [h.topology_eq_generate_intervals] exact LinearOrder.bot_topologicalSpace_eq_generateFrom.symm
import Mathlib.AlgebraicTopology.FundamentalGroupoid.FundamentalGroup import Mathlib.GroupTheory.EckmannHilton import Mathlib.Logic.Equiv.TransferInstance import Mathlib.Algebra.Group.Ext #align_import topology.homotopy.homotopy_group from "leanprover-community/mathlib"@"4c3e1721c58ef9087bbc2c8c38b540f70eda2e53" open scoped unitInterval Topology open Homeomorph noncomputable section scoped[Topology] notation "I^" N => N → I namespace Cube def boundary (N : Type*) : Set (I^N) := {y | ∃ i, y i = 0 ∨ y i = 1} #align cube.boundary Cube.boundary variable {N : Type*} [DecidableEq N] abbrev splitAt (i : N) : (I^N) ≃ₜ I × I^{ j // j ≠ i } := funSplitAt I i #align cube.split_at Cube.splitAt abbrev insertAt (i : N) : (I × I^{ j // j ≠ i }) ≃ₜ I^N := (funSplitAt I i).symm #align cube.insert_at Cube.insertAt
Mathlib/Topology/Homotopy/HomotopyGroup.lean
74
78
theorem insertAt_boundary (i : N) {t₀ : I} {t} (H : (t₀ = 0 ∨ t₀ = 1) ∨ t ∈ boundary { j // j ≠ i }) : insertAt i ⟨t₀, t⟩ ∈ boundary N := by
obtain H | ⟨j, H⟩ := H · use i; rwa [funSplitAt_symm_apply, dif_pos rfl] · use j; rwa [funSplitAt_symm_apply, dif_neg j.prop, Subtype.coe_eta]
import Mathlib.Algebra.Algebra.RestrictScalars import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.LinearAlgebra.Quotient import Mathlib.LinearAlgebra.StdBasis import Mathlib.GroupTheory.Finiteness import Mathlib.RingTheory.Ideal.Maps import Mathlib.RingTheory.Nilpotent.Defs #align_import ring_theory.finiteness from "leanprover-community/mathlib"@"c813ed7de0f5115f956239124e9b30f3a621966f" open Function (Surjective) namespace Submodule variable {R : Type*} {M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] open Set def FG (N : Submodule R M) : Prop := ∃ S : Finset M, Submodule.span R ↑S = N #align submodule.fg Submodule.FG theorem fg_def {N : Submodule R M} : N.FG ↔ ∃ S : Set M, S.Finite ∧ span R S = N := ⟨fun ⟨t, h⟩ => ⟨_, Finset.finite_toSet t, h⟩, by rintro ⟨t', h, rfl⟩ rcases Finite.exists_finset_coe h with ⟨t, rfl⟩ exact ⟨t, rfl⟩⟩ #align submodule.fg_def Submodule.fg_def theorem fg_iff_addSubmonoid_fg (P : Submodule ℕ M) : P.FG ↔ P.toAddSubmonoid.FG := ⟨fun ⟨S, hS⟩ => ⟨S, by simpa [← span_nat_eq_addSubmonoid_closure] using hS⟩, fun ⟨S, hS⟩ => ⟨S, by simpa [← span_nat_eq_addSubmonoid_closure] using hS⟩⟩ #align submodule.fg_iff_add_submonoid_fg Submodule.fg_iff_addSubmonoid_fg theorem fg_iff_add_subgroup_fg {G : Type*} [AddCommGroup G] (P : Submodule ℤ G) : P.FG ↔ P.toAddSubgroup.FG := ⟨fun ⟨S, hS⟩ => ⟨S, by simpa [← span_int_eq_addSubgroup_closure] using hS⟩, fun ⟨S, hS⟩ => ⟨S, by simpa [← span_int_eq_addSubgroup_closure] using hS⟩⟩ #align submodule.fg_iff_add_subgroup_fg Submodule.fg_iff_add_subgroup_fg theorem fg_iff_exists_fin_generating_family {N : Submodule R M} : N.FG ↔ ∃ (n : ℕ) (s : Fin n → M), span R (range s) = N := by rw [fg_def] constructor · rintro ⟨S, Sfin, hS⟩ obtain ⟨n, f, rfl⟩ := Sfin.fin_embedding exact ⟨n, f, hS⟩ · rintro ⟨n, s, hs⟩ exact ⟨range s, finite_range s, hs⟩ #align submodule.fg_iff_exists_fin_generating_family Submodule.fg_iff_exists_fin_generating_family
Mathlib/RingTheory/Finiteness.lean
82
134
theorem exists_sub_one_mem_and_smul_eq_zero_of_fg_of_le_smul {R : Type*} [CommRing R] {M : Type*} [AddCommGroup M] [Module R M] (I : Ideal R) (N : Submodule R M) (hn : N.FG) (hin : N ≤ I • N) : ∃ r : R, r - 1 ∈ I ∧ ∀ n ∈ N, r • n = (0 : M) := by
rw [fg_def] at hn rcases hn with ⟨s, hfs, hs⟩ have : ∃ r : R, r - 1 ∈ I ∧ N ≤ (I • span R s).comap (LinearMap.lsmul R M r) ∧ s ⊆ N := by refine ⟨1, ?_, ?_, ?_⟩ · rw [sub_self] exact I.zero_mem · rw [hs] intro n hn rw [mem_comap] change (1 : R) • n ∈ I • N rw [one_smul] exact hin hn · rw [← span_le, hs] clear hin hs revert this refine Set.Finite.dinduction_on _ hfs (fun H => ?_) @fun i s _ _ ih H => ?_ · rcases H with ⟨r, hr1, hrn, _⟩ refine ⟨r, hr1, fun n hn => ?_⟩ specialize hrn hn rwa [mem_comap, span_empty, smul_bot, mem_bot] at hrn apply ih rcases H with ⟨r, hr1, hrn, hs⟩ rw [← Set.singleton_union, span_union, smul_sup] at hrn rw [Set.insert_subset_iff] at hs have : ∃ c : R, c - 1 ∈ I ∧ c • i ∈ I • span R s := by specialize hrn hs.1 rw [mem_comap, mem_sup] at hrn rcases hrn with ⟨y, hy, z, hz, hyz⟩ dsimp at hyz rw [mem_smul_span_singleton] at hy rcases hy with ⟨c, hci, rfl⟩ use r - c constructor · rw [sub_right_comm] exact I.sub_mem hr1 hci · rw [sub_smul, ← hyz, add_sub_cancel_left] exact hz rcases this with ⟨c, hc1, hci⟩ refine ⟨c * r, ?_, ?_, hs.2⟩ · simpa only [mul_sub, mul_one, sub_add_sub_cancel] using I.add_mem (I.mul_mem_left c hr1) hc1 · intro n hn specialize hrn hn rw [mem_comap, mem_sup] at hrn rcases hrn with ⟨y, hy, z, hz, hyz⟩ dsimp at hyz rw [mem_smul_span_singleton] at hy rcases hy with ⟨d, _, rfl⟩ simp only [mem_comap, LinearMap.lsmul_apply] rw [mul_smul, ← hyz, smul_add, smul_smul, mul_comm, mul_smul] exact add_mem (smul_mem _ _ hci) (smul_mem _ _ hz)
import Batteries.Data.Rat.Basic import Batteries.Tactic.SeqFocus namespace Rat theorem ext : {p q : Rat} → p.num = q.num → p.den = q.den → p = q | ⟨_,_,_,_⟩, ⟨_,_,_,_⟩, rfl, rfl => rfl @[simp] theorem mk_den_one {r : Int} : ⟨r, 1, Nat.one_ne_zero, (Nat.coprime_one_right _)⟩ = (r : Rat) := rfl @[simp] theorem zero_num : (0 : Rat).num = 0 := rfl @[simp] theorem zero_den : (0 : Rat).den = 1 := rfl @[simp] theorem one_num : (1 : Rat).num = 1 := rfl @[simp] theorem one_den : (1 : Rat).den = 1 := rfl @[simp] theorem maybeNormalize_eq {num den g} (den_nz reduced) : maybeNormalize num den g den_nz reduced = { num := num.div g, den := den / g, den_nz, reduced } := by unfold maybeNormalize; split · subst g; simp · rfl theorem normalize.reduced' {num : Int} {den g : Nat} (den_nz : den ≠ 0) (e : g = num.natAbs.gcd den) : (num / g).natAbs.Coprime (den / g) := by rw [← Int.div_eq_ediv_of_dvd (e ▸ Int.ofNat_dvd_left.2 (Nat.gcd_dvd_left ..))] exact normalize.reduced den_nz e theorem normalize_eq {num den} (den_nz) : normalize num den den_nz = { num := num / num.natAbs.gcd den den := den / num.natAbs.gcd den den_nz := normalize.den_nz den_nz rfl reduced := normalize.reduced' den_nz rfl } := by simp only [normalize, maybeNormalize_eq, Int.div_eq_ediv_of_dvd (Int.ofNat_dvd_left.2 (Nat.gcd_dvd_left ..))] @[simp] theorem normalize_zero (nz) : normalize 0 d nz = 0 := by simp [normalize, Int.zero_div, Int.natAbs_zero, Nat.div_self (Nat.pos_of_ne_zero nz)]; rfl theorem mk_eq_normalize (num den nz c) : ⟨num, den, nz, c⟩ = normalize num den nz := by simp [normalize_eq, c.gcd_eq_one] theorem normalize_self (r : Rat) : normalize r.num r.den r.den_nz = r := (mk_eq_normalize ..).symm theorem normalize_mul_left {a : Nat} (d0 : d ≠ 0) (a0 : a ≠ 0) : normalize (↑a * n) (a * d) (Nat.mul_ne_zero a0 d0) = normalize n d d0 := by simp [normalize_eq, mk'.injEq, Int.natAbs_mul, Nat.gcd_mul_left, Nat.mul_div_mul_left _ _ (Nat.pos_of_ne_zero a0), Int.ofNat_mul, Int.mul_ediv_mul_of_pos _ _ (Int.ofNat_pos.2 <| Nat.pos_of_ne_zero a0)] theorem normalize_mul_right {a : Nat} (d0 : d ≠ 0) (a0 : a ≠ 0) : normalize (n * a) (d * a) (Nat.mul_ne_zero d0 a0) = normalize n d d0 := by rw [← normalize_mul_left (d0 := d0) a0]; congr 1 <;> [apply Int.mul_comm; apply Nat.mul_comm] theorem normalize_eq_iff (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) : normalize n₁ d₁ z₁ = normalize n₂ d₂ z₂ ↔ n₁ * d₂ = n₂ * d₁ := by constructor <;> intro h · simp only [normalize_eq, mk'.injEq] at h have' hn₁ := Int.ofNat_dvd_left.2 <| Nat.gcd_dvd_left n₁.natAbs d₁ have' hn₂ := Int.ofNat_dvd_left.2 <| Nat.gcd_dvd_left n₂.natAbs d₂ have' hd₁ := Int.ofNat_dvd.2 <| Nat.gcd_dvd_right n₁.natAbs d₁ have' hd₂ := Int.ofNat_dvd.2 <| Nat.gcd_dvd_right n₂.natAbs d₂ rw [← Int.ediv_mul_cancel (Int.dvd_trans hd₂ (Int.dvd_mul_left ..)), Int.mul_ediv_assoc _ hd₂, ← Int.ofNat_ediv, ← h.2, Int.ofNat_ediv, ← Int.mul_ediv_assoc _ hd₁, Int.mul_ediv_assoc' _ hn₁, Int.mul_right_comm, h.1, Int.ediv_mul_cancel hn₂] · rw [← normalize_mul_right _ z₂, ← normalize_mul_left z₂ z₁, Int.mul_comm d₁, h]
.lake/packages/batteries/Batteries/Data/Rat/Lemmas.lean
76
82
theorem maybeNormalize_eq_normalize {num : Int} {den g : Nat} (den_nz reduced) (hn : ↑g ∣ num) (hd : g ∣ den) : maybeNormalize num den g den_nz reduced = normalize num den (mt (by simp [·]) den_nz) := by
simp only [maybeNormalize_eq, mk_eq_normalize, Int.div_eq_ediv_of_dvd hn] have : g ≠ 0 := mt (by simp [·]) den_nz rw [← normalize_mul_right _ this, Int.ediv_mul_cancel hn] congr 1; exact Nat.div_mul_cancel hd
import Mathlib.Analysis.BoxIntegral.Partition.Basic #align_import analysis.box_integral.partition.split from "leanprover-community/mathlib"@"6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f" noncomputable section open scoped Classical open Filter open Function Set Filter namespace BoxIntegral variable {ι M : Type*} {n : ℕ} namespace Box variable {I : Box ι} {i : ι} {x : ℝ} {y : ι → ℝ} def splitLower (I : Box ι) (i : ι) (x : ℝ) : WithBot (Box ι) := mk' I.lower (update I.upper i (min x (I.upper i))) #align box_integral.box.split_lower BoxIntegral.Box.splitLower @[simp]
Mathlib/Analysis/BoxIntegral/Partition/Split.lean
65
70
theorem coe_splitLower : (splitLower I i x : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x } := by
rw [splitLower, coe_mk'] ext y simp only [mem_univ_pi, mem_Ioc, mem_inter_iff, mem_coe, mem_setOf_eq, forall_and, ← Pi.le_def, le_update_iff, le_min_iff, and_assoc, and_forall_ne (p := fun j => y j ≤ upper I j) i, mem_def] rw [and_comm (a := y i ≤ x)]
import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Ideal import Mathlib.RingTheory.Noetherian #align_import ring_theory.localization.submodule from "leanprover-community/mathlib"@"1ebb20602a8caef435ce47f6373e1aa40851a177" variable {R : Type*} [CommRing R] (M : Submonoid R) (S : Type*) [CommRing S] variable [Algebra R S] {P : Type*} [CommRing P] namespace IsLocalization -- This was previously a `hasCoe` instance, but if `S = R` then this will loop. -- It could be a `hasCoeT` instance, but we keep it explicit here to avoid slowing down -- the rest of the library. def coeSubmodule (I : Ideal R) : Submodule R S := Submodule.map (Algebra.linearMap R S) I #align is_localization.coe_submodule IsLocalization.coeSubmodule theorem mem_coeSubmodule (I : Ideal R) {x : S} : x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x := Iff.rfl #align is_localization.mem_coe_submodule IsLocalization.mem_coeSubmodule theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J := Submodule.map_mono h #align is_localization.coe_submodule_mono IsLocalization.coeSubmodule_mono @[simp]
Mathlib/RingTheory/Localization/Submodule.lean
48
49
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by
rw [coeSubmodule, Submodule.map_bot]
import Mathlib.Init.Data.Prod import Mathlib.Data.Seq.WSeq #align_import data.seq.parallel from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" universe u v namespace Computation open Stream' variable {α : Type u} {β : Type v} def parallel.aux2 : List (Computation α) → Sum α (List (Computation α)) := List.foldr (fun c o => match o with | Sum.inl a => Sum.inl a | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) (Sum.inr []) #align computation.parallel.aux2 Computation.parallel.aux2 def parallel.aux1 : List (Computation α) × WSeq (Computation α) → Sum α (List (Computation α) × WSeq (Computation α)) | (l, S) => rmap (fun l' => match Seq.destruct S with | none => (l', Seq.nil) | some (none, S') => (l', S') | some (some c, S') => (c :: l', S')) (parallel.aux2 l) #align computation.parallel.aux1 Computation.parallel.aux1 def parallel (S : WSeq (Computation α)) : Computation α := corec parallel.aux1 ([], S) #align computation.parallel Computation.parallel theorem terminates_parallel.aux : ∀ {l : List (Computation α)} {S c}, c ∈ l → Terminates c → Terminates (corec parallel.aux1 (l, S)) := by have lem1 : ∀ l S, (∃ a : α, parallel.aux2 l = Sum.inl a) → Terminates (corec parallel.aux1 (l, S)) := by intro l S e cases' e with a e have : corec parallel.aux1 (l, S) = return a := by apply destruct_eq_pure simp only [parallel.aux1, rmap, corec_eq] rw [e] rw [this] -- Porting note: This line is required. exact ret_terminates a intro l S c m T revert l S apply @terminatesRecOn _ _ c T _ _ · intro a l S m apply lem1 induction' l with c l IH <;> simp at m cases' m with e m · rw [← e] simp only [parallel.aux2, rmap, List.foldr_cons, destruct_pure] split <;> simp · cases' IH m with a' e simp only [parallel.aux2, rmap, List.foldr_cons] simp? [parallel.aux2] at e says simp only [parallel.aux2, rmap] at e rw [e] exact ⟨a', rfl⟩ · intro s IH l S m have H1 : ∀ l', parallel.aux2 l = Sum.inr l' → s ∈ l' := by induction' l with c l IH' <;> intro l' e' <;> simp at m cases' m with e m <;> simp [parallel.aux2] at e' · rw [← e] at e' -- Porting note: `revert e'` & `intro e'` are required. revert e' split · simp · simp only [destruct_think, Sum.inr.injEq] rintro rfl simp · induction' e : List.foldr (fun c o => match o with | Sum.inl a => Sum.inl a | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) (Sum.inr List.nil) l with a' ls <;> erw [e] at e' · contradiction have := IH' m _ e -- Porting note: `revert e'` & `intro e'` are required. revert e' cases destruct c <;> intro e' <;> [injection e'; injection e' with h'] rw [← h'] simp [this] induction' h : parallel.aux2 l with a l' · exact lem1 _ _ ⟨a, h⟩ · have H2 : corec parallel.aux1 (l, S) = think _ := destruct_eq_think (by simp only [parallel.aux1, rmap, corec_eq] rw [h]) rw [H2] refine @Computation.think_terminates _ _ ?_ have := H1 _ h rcases Seq.destruct S with (_ | ⟨_ | c, S'⟩) <;> simp [parallel.aux1] <;> apply IH <;> simp [this] #align computation.terminates_parallel.aux Computation.terminates_parallel.aux
Mathlib/Data/Seq/Parallel.lean
122
186
theorem terminates_parallel {S : WSeq (Computation α)} {c} (h : c ∈ S) [T : Terminates c] : Terminates (parallel S) := by
suffices ∀ (n) (l : List (Computation α)) (S c), c ∈ l ∨ some (some c) = Seq.get? S n → Terminates c → Terminates (corec parallel.aux1 (l, S)) from let ⟨n, h⟩ := h this n [] S c (Or.inr h) T intro n; induction' n with n IH <;> intro l S c o T · cases' o with a a · exact terminates_parallel.aux a T have H : Seq.destruct S = some (some c, Seq.tail S) := by simp [Seq.destruct, (· <$> ·), ← a] induction' h : parallel.aux2 l with a l' · have C : corec parallel.aux1 (l, S) = pure a := by apply destruct_eq_pure rw [corec_eq, parallel.aux1] dsimp only [] rw [h] simp only [rmap] rw [C] infer_instance · have C : corec parallel.aux1 (l, S) = _ := destruct_eq_think (by simp only [corec_eq, rmap, parallel.aux1.eq_1] rw [h, H]) rw [C] refine @Computation.think_terminates _ _ ?_ apply terminates_parallel.aux _ T simp · cases' o with a a · exact terminates_parallel.aux a T induction' h : parallel.aux2 l with a l' · have C : corec parallel.aux1 (l, S) = pure a := by apply destruct_eq_pure rw [corec_eq, parallel.aux1] dsimp only [] rw [h] simp only [rmap] rw [C] infer_instance · have C : corec parallel.aux1 (l, S) = _ := destruct_eq_think (by simp only [corec_eq, rmap, parallel.aux1.eq_1] rw [h]) rw [C] refine @Computation.think_terminates _ _ ?_ have TT : ∀ l', Terminates (corec parallel.aux1 (l', S.tail)) := by intro apply IH _ _ _ (Or.inr _) T rw [a] cases' S with f al rfl induction' e : Seq.get? S 0 with o · have D : Seq.destruct S = none := by dsimp [Seq.destruct] rw [e] rfl rw [D] simp only have TT := TT l' rwa [Seq.destruct_eq_nil D, Seq.tail_nil] at TT · have D : Seq.destruct S = some (o, S.tail) := by dsimp [Seq.destruct] rw [e] rfl rw [D] cases' o with c <;> simp [parallel.aux1, TT]
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.GeomSum import Mathlib.Data.Fintype.BigOperators import Mathlib.RingTheory.PowerSeries.Inverse import Mathlib.RingTheory.PowerSeries.WellKnown import Mathlib.Tactic.FieldSimp #align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Nat Finset Finset.Nat PowerSeries variable (A : Type*) [CommRing A] [Algebra ℚ A] def bernoulli' : ℕ → ℚ := WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' => 1 - ∑ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2 #align bernoulli' bernoulli' theorem bernoulli'_def' (n : ℕ) : bernoulli' n = 1 - ∑ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k := WellFounded.fix_eq _ _ _ #align bernoulli'_def' bernoulli'_def' theorem bernoulli'_def (n : ℕ) : bernoulli' n = 1 - ∑ k ∈ range n, n.choose k / (n - k + 1) * bernoulli' k := by rw [bernoulli'_def', ← Fin.sum_univ_eq_sum_range] #align bernoulli'_def bernoulli'_def theorem bernoulli'_spec (n : ℕ) : (∑ k ∈ range n.succ, (n.choose (n - k) : ℚ) / (n - k + 1) * bernoulli' k) = 1 := by rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add, div_one, cast_one, one_mul, sub_add, ← sum_sub_distrib, ← sub_eq_zero, sub_sub_cancel_left, neg_eq_zero] exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self]) #align bernoulli'_spec bernoulli'_spec theorem bernoulli'_spec' (n : ℕ) : (∑ k ∈ antidiagonal n, ((k.1 + k.2).choose k.2 : ℚ) / (k.2 + 1) * bernoulli' k.1) = 1 := by refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n) refine sum_congr rfl fun x hx => ?_ simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub] #align bernoulli'_spec' bernoulli'_spec' section Examples @[simp]
Mathlib/NumberTheory/Bernoulli.lean
104
106
theorem bernoulli'_zero : bernoulli' 0 = 1 := by
rw [bernoulli'_def] norm_num
import Mathlib.Order.Interval.Set.Monotone import Mathlib.Probability.Process.HittingTime import Mathlib.Probability.Martingale.Basic import Mathlib.Tactic.AdaptationNote #align_import probability.martingale.upcrossing from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open TopologicalSpace Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory Topology namespace MeasureTheory variable {Ω ι : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} noncomputable def lowerCrossingTimeAux [Preorder ι] [InfSet ι] (a : ℝ) (f : ι → Ω → ℝ) (c N : ι) : Ω → ι := hitting f (Set.Iic a) c N #align measure_theory.lower_crossing_time_aux MeasureTheory.lowerCrossingTimeAux noncomputable def upperCrossingTime [Preorder ι] [OrderBot ι] [InfSet ι] (a b : ℝ) (f : ι → Ω → ℝ) (N : ι) : ℕ → Ω → ι | 0 => ⊥ | n + 1 => fun ω => hitting f (Set.Ici b) (lowerCrossingTimeAux a f (upperCrossingTime a b f N n ω) N ω) N ω #align measure_theory.upper_crossing_time MeasureTheory.upperCrossingTime noncomputable def lowerCrossingTime [Preorder ι] [OrderBot ι] [InfSet ι] (a b : ℝ) (f : ι → Ω → ℝ) (N : ι) (n : ℕ) : Ω → ι := fun ω => hitting f (Set.Iic a) (upperCrossingTime a b f N n ω) N ω #align measure_theory.lower_crossing_time MeasureTheory.lowerCrossingTime section variable [Preorder ι] [OrderBot ι] [InfSet ι] variable {a b : ℝ} {f : ι → Ω → ℝ} {N : ι} {n m : ℕ} {ω : Ω} @[simp] theorem upperCrossingTime_zero : upperCrossingTime a b f N 0 = ⊥ := rfl #align measure_theory.upper_crossing_time_zero MeasureTheory.upperCrossingTime_zero @[simp] theorem lowerCrossingTime_zero : lowerCrossingTime a b f N 0 = hitting f (Set.Iic a) ⊥ N := rfl #align measure_theory.lower_crossing_time_zero MeasureTheory.lowerCrossingTime_zero theorem upperCrossingTime_succ : upperCrossingTime a b f N (n + 1) ω = hitting f (Set.Ici b) (lowerCrossingTimeAux a f (upperCrossingTime a b f N n ω) N ω) N ω := by rw [upperCrossingTime] #align measure_theory.upper_crossing_time_succ MeasureTheory.upperCrossingTime_succ theorem upperCrossingTime_succ_eq (ω : Ω) : upperCrossingTime a b f N (n + 1) ω = hitting f (Set.Ici b) (lowerCrossingTime a b f N n ω) N ω := by simp only [upperCrossingTime_succ] rfl #align measure_theory.upper_crossing_time_succ_eq MeasureTheory.upperCrossingTime_succ_eq end section ConditionallyCompleteLinearOrderBot variable [ConditionallyCompleteLinearOrderBot ι] variable {a b : ℝ} {f : ι → Ω → ℝ} {N : ι} {n m : ℕ} {ω : Ω} theorem upperCrossingTime_le : upperCrossingTime a b f N n ω ≤ N := by cases n · simp only [upperCrossingTime_zero, Pi.bot_apply, bot_le, Nat.zero_eq] · simp only [upperCrossingTime_succ, hitting_le] #align measure_theory.upper_crossing_time_le MeasureTheory.upperCrossingTime_le @[simp] theorem upperCrossingTime_zero' : upperCrossingTime a b f ⊥ n ω = ⊥ := eq_bot_iff.2 upperCrossingTime_le #align measure_theory.upper_crossing_time_zero' MeasureTheory.upperCrossingTime_zero' theorem lowerCrossingTime_le : lowerCrossingTime a b f N n ω ≤ N := by simp only [lowerCrossingTime, hitting_le ω] #align measure_theory.lower_crossing_time_le MeasureTheory.lowerCrossingTime_le
Mathlib/Probability/Martingale/Upcrossing.lean
201
203
theorem upperCrossingTime_le_lowerCrossingTime : upperCrossingTime a b f N n ω ≤ lowerCrossingTime a b f N n ω := by
simp only [lowerCrossingTime, le_hitting upperCrossingTime_le ω]
import Mathlib.MeasureTheory.MeasurableSpace.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef #align_import measure_theory.function.ae_measurable_sequence from "leanprover-community/mathlib"@"d003c55042c3cd08aefd1ae9a42ef89441cdaaf3" open MeasureTheory open scoped Classical variable {ι : Sort*} {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] {f : ι → α → β} {μ : Measure α} {p : α → (ι → β) → Prop} def aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) : Set α := (toMeasurable μ { x | (∀ i, f i x = (hf i).mk (f i) x) ∧ p x fun n => f n x }ᶜ)ᶜ #align ae_seq_set aeSeqSet noncomputable def aeSeq (hf : ∀ i, AEMeasurable (f i) μ) (p : α → (ι → β) → Prop) : ι → α → β := fun i x => ite (x ∈ aeSeqSet hf p) ((hf i).mk (f i) x) (⟨f i x⟩ : Nonempty β).some #align ae_seq aeSeq namespace aeSeq section MemAESeqSet theorem mk_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) (i : ι) : (hf i).mk (f i) x = f i x := haveI h_ss : aeSeqSet hf p ⊆ { x | ∀ i, f i x = (hf i).mk (f i) x } := by rw [aeSeqSet, ← compl_compl { x | ∀ i, f i x = (hf i).mk (f i) x }, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr fun x h => ?_) (subset_toMeasurable _ _) exact h.1 (h_ss hx i).symm #align ae_seq.mk_eq_fun_of_mem_ae_seq_set aeSeq.mk_eq_fun_of_mem_aeSeqSet theorem aeSeq_eq_mk_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) (i : ι) : aeSeq hf p i x = (hf i).mk (f i) x := by simp only [aeSeq, hx, if_true] #align ae_seq.ae_seq_eq_mk_of_mem_ae_seq_set aeSeq.aeSeq_eq_mk_of_mem_aeSeqSet theorem aeSeq_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) (i : ι) : aeSeq hf p i x = f i x := by simp only [aeSeq_eq_mk_of_mem_aeSeqSet hf hx i, mk_eq_fun_of_mem_aeSeqSet hf hx i] #align ae_seq.ae_seq_eq_fun_of_mem_ae_seq_set aeSeq.aeSeq_eq_fun_of_mem_aeSeqSet theorem prop_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) : p x fun n => aeSeq hf p n x := by simp only [aeSeq, hx, if_true] rw [funext fun n => mk_eq_fun_of_mem_aeSeqSet hf hx n] have h_ss : aeSeqSet hf p ⊆ { x | p x fun n => f n x } := by rw [← compl_compl { x | p x fun n => f n x }, aeSeqSet, Set.compl_subset_compl] refine Set.Subset.trans (Set.compl_subset_compl.mpr ?_) (subset_toMeasurable _ _) exact fun x hx => hx.2 have hx' := Set.mem_of_subset_of_mem h_ss hx exact hx' #align ae_seq.prop_of_mem_ae_seq_set aeSeq.prop_of_mem_aeSeqSet
Mathlib/MeasureTheory/Function/AEMeasurableSequence.lean
81
86
theorem fun_prop_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p) : p x fun n => f n x := by
have h_eq : (fun n => f n x) = fun n => aeSeq hf p n x := funext fun n => (aeSeq_eq_fun_of_mem_aeSeqSet hf hx n).symm rw [h_eq] exact prop_of_mem_aeSeqSet hf hx
import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Order.RelIso.Basic #align_import order.ord_continuous from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {ι : Sort x} open Function OrderDual Set def LeftOrdContinuous [Preorder α] [Preorder β] (f : α → β) := ∀ ⦃s : Set α⦄ ⦃x⦄, IsLUB s x → IsLUB (f '' s) (f x) #align left_ord_continuous LeftOrdContinuous def RightOrdContinuous [Preorder α] [Preorder β] (f : α → β) := ∀ ⦃s : Set α⦄ ⦃x⦄, IsGLB s x → IsGLB (f '' s) (f x) #align right_ord_continuous RightOrdContinuous namespace LeftOrdContinuous section SemilatticeSup variable [SemilatticeSup α] [SemilatticeSup β] {f : α → β} theorem map_sup (hf : LeftOrdContinuous f) (x y : α) : f (x ⊔ y) = f x ⊔ f y := (hf isLUB_pair).unique <| by simp only [image_pair, isLUB_pair] #align left_ord_continuous.map_sup LeftOrdContinuous.map_sup
Mathlib/Order/OrdContinuous.lean
98
99
theorem le_iff (hf : LeftOrdContinuous f) (h : Injective f) {x y} : f x ≤ f y ↔ x ≤ y := by
simp only [← sup_eq_right, ← hf.map_sup, h.eq_iff]
import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Algebra.Order.Ring.Basic import Mathlib.Algebra.Ring.Nat import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.OrderOfElement import Mathlib.RingTheory.Fintype import Mathlib.Tactic.IntervalCases #align_import number_theory.lucas_lehmer from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" def mersenne (p : ℕ) : ℕ := 2 ^ p - 1 #align mersenne mersenne theorem strictMono_mersenne : StrictMono mersenne := fun m n h ↦ (Nat.sub_lt_sub_iff_right <| Nat.one_le_pow _ _ two_pos).2 <| by gcongr; norm_num1 @[simp] theorem mersenne_lt_mersenne {p q : ℕ} : mersenne p < mersenne q ↔ p < q := strictMono_mersenne.lt_iff_lt @[gcongr] protected alias ⟨_, GCongr.mersenne_lt_mersenne⟩ := mersenne_lt_mersenne @[simp] theorem mersenne_le_mersenne {p q : ℕ} : mersenne p ≤ mersenne q ↔ p ≤ q := strictMono_mersenne.le_iff_le @[gcongr] protected alias ⟨_, GCongr.mersenne_le_mersenne⟩ := mersenne_le_mersenne @[simp] theorem mersenne_zero : mersenne 0 = 0 := rfl @[simp] theorem mersenne_pos {p : ℕ} : 0 < mersenne p ↔ 0 < p := mersenne_lt_mersenne (p := 0) #align mersenne_pos mersenne_pos @[simp] theorem one_lt_mersenne {p : ℕ} : 1 < mersenne p ↔ 1 < p := mersenne_lt_mersenne (p := 1) @[simp]
Mathlib/NumberTheory/LucasLehmer.lean
93
95
theorem succ_mersenne (k : ℕ) : mersenne k + 1 = 2 ^ k := by
rw [mersenne, tsub_add_cancel_of_le] exact one_le_pow_of_one_le (by norm_num) k
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.Order.Field.Defs import Mathlib.Data.Tree.Basic import Mathlib.Logic.Basic import Mathlib.Tactic.NormNum.Core import Mathlib.Util.SynthesizeUsing import Mathlib.Util.Qq open Lean Parser Tactic Mathlib Meta NormNum Qq initialize registerTraceClass `CancelDenoms namespace CancelDenoms theorem mul_subst {α} [CommRing α] {n1 n2 k e1 e2 t1 t2 : α} (h1 : n1 * e1 = t1) (h2 : n2 * e2 = t2) (h3 : n1 * n2 = k) : k * (e1 * e2) = t1 * t2 := by rw [← h3, mul_comm n1, mul_assoc n2, ← mul_assoc n1, h1, ← mul_assoc n2, mul_comm n2, mul_assoc, h2] #align cancel_factors.mul_subst CancelDenoms.mul_subst
Mathlib/Tactic/CancelDenoms/Core.lean
45
47
theorem div_subst {α} [Field α] {n1 n2 k e1 e2 t1 : α} (h1 : n1 * e1 = t1) (h2 : n2 / e2 = 1) (h3 : n1 * n2 = k) : k * (e1 / e2) = t1 := by
rw [← h3, mul_assoc, mul_div_left_comm, h2, ← mul_assoc, h1, mul_comm, one_mul]
import Mathlib.Data.Real.Basic #align_import data.real.sign from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" namespace Real noncomputable def sign (r : ℝ) : ℝ := if r < 0 then -1 else if 0 < r then 1 else 0 #align real.sign Real.sign theorem sign_of_neg {r : ℝ} (hr : r < 0) : sign r = -1 := by rw [sign, if_pos hr] #align real.sign_of_neg Real.sign_of_neg
Mathlib/Data/Real/Sign.lean
39
39
theorem sign_of_pos {r : ℝ} (hr : 0 < r) : sign r = 1 := by
rw [sign, if_pos hr, if_neg hr.not_lt]
import Mathlib.Algebra.GCDMonoid.Basic import Mathlib.Data.Multiset.FinsetOps import Mathlib.Data.Multiset.Fold #align_import algebra.gcd_monoid.multiset from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" namespace Multiset variable {α : Type*} [CancelCommMonoidWithZero α] [NormalizedGCDMonoid α] section gcd def gcd (s : Multiset α) : α := s.fold GCDMonoid.gcd 0 #align multiset.gcd Multiset.gcd @[simp] theorem gcd_zero : (0 : Multiset α).gcd = 0 := fold_zero _ _ #align multiset.gcd_zero Multiset.gcd_zero @[simp] theorem gcd_cons (a : α) (s : Multiset α) : (a ::ₘ s).gcd = GCDMonoid.gcd a s.gcd := fold_cons_left _ _ _ _ #align multiset.gcd_cons Multiset.gcd_cons @[simp] theorem gcd_singleton {a : α} : ({a} : Multiset α).gcd = normalize a := (fold_singleton _ _ _).trans <| gcd_zero_right _ #align multiset.gcd_singleton Multiset.gcd_singleton @[simp] theorem gcd_add (s₁ s₂ : Multiset α) : (s₁ + s₂).gcd = GCDMonoid.gcd s₁.gcd s₂.gcd := Eq.trans (by simp [gcd]) (fold_add _ _ _ _ _) #align multiset.gcd_add Multiset.gcd_add theorem dvd_gcd {s : Multiset α} {a : α} : a ∣ s.gcd ↔ ∀ b ∈ s, a ∣ b := Multiset.induction_on s (by simp) (by simp (config := { contextual := true }) [or_imp, forall_and, dvd_gcd_iff]) #align multiset.dvd_gcd Multiset.dvd_gcd theorem gcd_dvd {s : Multiset α} {a : α} (h : a ∈ s) : s.gcd ∣ a := dvd_gcd.1 dvd_rfl _ h #align multiset.gcd_dvd Multiset.gcd_dvd theorem gcd_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₂.gcd ∣ s₁.gcd := dvd_gcd.2 fun _ hb ↦ gcd_dvd (h hb) #align multiset.gcd_mono Multiset.gcd_mono @[simp 1100] theorem normalize_gcd (s : Multiset α) : normalize s.gcd = s.gcd := Multiset.induction_on s (by simp) fun a s _ ↦ by simp #align multiset.normalize_gcd Multiset.normalize_gcd theorem gcd_eq_zero_iff (s : Multiset α) : s.gcd = 0 ↔ ∀ x : α, x ∈ s → x = 0 := by constructor · intro h x hx apply eq_zero_of_zero_dvd rw [← h] apply gcd_dvd hx · refine s.induction_on ?_ ?_ · simp intro a s sgcd h simp [h a (mem_cons_self a s), sgcd fun x hx ↦ h x (mem_cons_of_mem hx)] #align multiset.gcd_eq_zero_iff Multiset.gcd_eq_zero_iff
Mathlib/Algebra/GCDMonoid/Multiset.lean
185
190
theorem gcd_map_mul (a : α) (s : Multiset α) : (s.map (a * ·)).gcd = normalize a * s.gcd := by
refine s.induction_on ?_ fun b s ih ↦ ?_ · simp_rw [map_zero, gcd_zero, mul_zero] · simp_rw [map_cons, gcd_cons, ← gcd_mul_left] rw [ih] apply ((normalize_associated a).mul_right _).gcd_eq_right
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Mul import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w noncomputable section open scoped Classical Topology Filter ENNReal open Filter Asymptotics Set open ContinuousLinearMap (smulRight smulRight_one_eq_iff) variable {𝕜 : Type u} [NontriviallyNormedField 𝕜] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {E : Type w} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {f f₀ f₁ g : 𝕜 → F} variable {f' f₀' f₁' g' : F} variable {x : 𝕜} variable {s t : Set 𝕜} variable {L L₁ L₂ : Filter 𝕜} section Prod section CLMCompApply open ContinuousLinearMap variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] {c : 𝕜 → F →L[𝕜] G} {c' : F →L[𝕜] G} {d : 𝕜 → E →L[𝕜] F} {d' : E →L[𝕜] F} {u : 𝕜 → F} {u' : F} theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) : HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by have := (hc.hasStrictFDerivAt.clm_comp hd.hasStrictFDerivAt).hasStrictDerivAt rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul, one_smul, add_comm] at this #align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWithinAt d d' s x) : HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x := by have := (hc.hasFDerivWithinAt.clm_comp hd.hasFDerivWithinAt).hasDerivWithinAt rwa [add_apply, comp_apply, comp_apply, smulRight_apply, smulRight_apply, one_apply, one_smul, one_smul, add_comm] at this #align has_deriv_within_at.clm_comp HasDerivWithinAt.clm_comp
Mathlib/Analysis/Calculus/Deriv/Mul.lean
462
465
theorem HasDerivAt.clm_comp (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) : HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x := by
rw [← hasDerivWithinAt_univ] at * exact hc.clm_comp hd
import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.RingTheory.IntegralDomain #align_import field_theory.primitive_element from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" noncomputable section open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField namespace Field section PrimitiveElementInf variable {F : Type*} [Field F] [Infinite F] {E : Type*} [Field E] (ϕ : F →+* E) (α β : E)
Mathlib/FieldTheory/PrimitiveElement.lean
86
96
theorem primitive_element_inf_aux_exists_c (f g : F[X]) : ∃ c : F, ∀ α' ∈ (f.map ϕ).roots, ∀ β' ∈ (g.map ϕ).roots, -(α' - α) / (β' - β) ≠ ϕ c := by
let sf := (f.map ϕ).roots let sg := (g.map ϕ).roots let s := (sf.bind fun α' => sg.map fun β' => -(α' - α) / (β' - β)).toFinset let s' := s.preimage ϕ fun x _ y _ h => ϕ.injective h obtain ⟨c, hc⟩ := Infinite.exists_not_mem_finset s' simp_rw [s', s, Finset.mem_preimage, Multiset.mem_toFinset, Multiset.mem_bind, Multiset.mem_map] at hc push_neg at hc exact ⟨c, hc⟩
import Batteries.Tactic.Init import Batteries.Tactic.Alias import Batteries.Tactic.Lint.Misc instance {f : α → β} [DecidablePred p] : DecidablePred (p ∘ f) := inferInstanceAs <| DecidablePred fun x => p (f x) @[deprecated] alias proofIrrel := proof_irrel theorem Function.id_def : @id α = fun x => x := rfl alias ⟨forall_not_of_not_exists, not_exists_of_forall_not⟩ := not_exists protected alias ⟨Decidable.exists_not_of_not_forall, _⟩ := Decidable.not_forall theorem heq_iff_eq : HEq a b ↔ a = b := ⟨eq_of_heq, heq_of_eq⟩ @[simp] theorem eq_rec_constant {α : Sort _} {a a' : α} {β : Sort _} (y : β) (h : a = a') : (@Eq.rec α a (fun α _ => β) y a' h) = y := by cases h; rfl
.lake/packages/batteries/Batteries/Logic.lean
42
43
theorem congrArg₂ (f : α → β → γ) {x x' : α} {y y' : β} (hx : x = x') (hy : y = y') : f x y = f x' y' := by
subst hx hy; rfl
import Mathlib.CategoryTheory.EqToHom import Mathlib.CategoryTheory.Quotient import Mathlib.Combinatorics.Quiver.Path #align_import category_theory.path_category from "leanprover-community/mathlib"@"c6dd521ebdce53bb372c527569dd7c25de53a08b" universe v₁ v₂ u₁ u₂ namespace CategoryTheory section def Paths (V : Type u₁) : Type u₁ := V #align category_theory.paths CategoryTheory.Paths instance (V : Type u₁) [Inhabited V] : Inhabited (Paths V) := ⟨(default : V)⟩ variable (V : Type u₁) [Quiver.{v₁ + 1} V] namespace Paths instance categoryPaths : Category.{max u₁ v₁} (Paths V) where Hom := fun X Y : V => Quiver.Path X Y id X := Quiver.Path.nil comp f g := Quiver.Path.comp f g #align category_theory.paths.category_paths CategoryTheory.Paths.categoryPaths variable {V} @[simps] def of : V ⥤q Paths V where obj X := X map f := f.toPath #align category_theory.paths.of CategoryTheory.Paths.of attribute [local ext] Functor.ext def lift {C} [Category C] (φ : V ⥤q C) : Paths V ⥤ C where obj := φ.obj map {X} {Y} f := @Quiver.Path.rec V _ X (fun Y _ => φ.obj X ⟶ φ.obj Y) (𝟙 <| φ.obj X) (fun _ f ihp => ihp ≫ φ.map f) Y f map_id X := rfl map_comp f g := by induction' g with _ _ g' p ih _ _ _ · rw [Category.comp_id] rfl · have : f ≫ Quiver.Path.cons g' p = (f ≫ g').cons p := by apply Quiver.Path.comp_cons rw [this] simp only at ih ⊢ rw [ih, Category.assoc] #align category_theory.paths.lift CategoryTheory.Paths.lift @[simp] theorem lift_nil {C} [Category C] (φ : V ⥤q C) (X : V) : (lift φ).map Quiver.Path.nil = 𝟙 (φ.obj X) := rfl #align category_theory.paths.lift_nil CategoryTheory.Paths.lift_nil @[simp] theorem lift_cons {C} [Category C] (φ : V ⥤q C) {X Y Z : V} (p : Quiver.Path X Y) (f : Y ⟶ Z) : (lift φ).map (p.cons f) = (lift φ).map p ≫ φ.map f := rfl #align category_theory.paths.lift_cons CategoryTheory.Paths.lift_cons @[simp]
Mathlib/CategoryTheory/PathCategory.lean
87
90
theorem lift_toPath {C} [Category C] (φ : V ⥤q C) {X Y : V} (f : X ⟶ Y) : (lift φ).map f.toPath = φ.map f := by
dsimp [Quiver.Hom.toPath, lift] simp
import Mathlib.Data.Matrix.Basic import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.Adjugate #align_import linear_algebra.matrix.nondegenerate from "leanprover-community/mathlib"@"2a32c70c78096758af93e997b978a5d461007b4f" namespace Matrix variable {m R A : Type*} [Fintype m] [CommRing R] def Nondegenerate (M : Matrix m m R) := ∀ v, (∀ w, Matrix.dotProduct v (M *ᵥ w) = 0) → v = 0 #align matrix.nondegenerate Matrix.Nondegenerate theorem Nondegenerate.eq_zero_of_ortho {M : Matrix m m R} (hM : Nondegenerate M) {v : m → R} (hv : ∀ w, Matrix.dotProduct v (M *ᵥ w) = 0) : v = 0 := hM v hv #align matrix.nondegenerate.eq_zero_of_ortho Matrix.Nondegenerate.eq_zero_of_ortho theorem Nondegenerate.exists_not_ortho_of_ne_zero {M : Matrix m m R} (hM : Nondegenerate M) {v : m → R} (hv : v ≠ 0) : ∃ w, Matrix.dotProduct v (M *ᵥ w) ≠ 0 := not_forall.mp (mt hM.eq_zero_of_ortho hv) #align matrix.nondegenerate.exists_not_ortho_of_ne_zero Matrix.Nondegenerate.exists_not_ortho_of_ne_zero variable [CommRing A] [IsDomain A]
Mathlib/LinearAlgebra/Matrix/Nondegenerate.lean
50
63
theorem nondegenerate_of_det_ne_zero [DecidableEq m] {M : Matrix m m A} (hM : M.det ≠ 0) : Nondegenerate M := by
intro v hv ext i specialize hv (M.cramer (Pi.single i 1)) refine (mul_eq_zero.mp ?_).resolve_right hM convert hv simp only [mulVec_cramer M (Pi.single i 1), dotProduct, Pi.smul_apply, smul_eq_mul] rw [Finset.sum_eq_single i, Pi.single_eq_same, mul_one] · intro j _ hj simp [hj] · intros have := Finset.mem_univ i contradiction
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
Mathlib/MeasureTheory/PiSystem.lean
79
82
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]
import Mathlib.MeasureTheory.MeasurableSpace.Defs open Set Function open scoped MeasureTheory namespace MeasurableSpace variable {α : Type*} def invariants [m : MeasurableSpace α] (f : α → α) : MeasurableSpace α := { m ⊓ ⟨fun s ↦ f ⁻¹' s = s, by simp, by simp, fun f hf ↦ by simp [hf]⟩ with MeasurableSet' := fun s ↦ MeasurableSet[m] s ∧ f ⁻¹' s = s } variable [MeasurableSpace α] theorem measurableSet_invariants {f : α → α} {s : Set α} : MeasurableSet[invariants f] s ↔ MeasurableSet s ∧ f ⁻¹' s = s := .rfl @[simp] theorem invariants_id : invariants (id : α → α) = ‹MeasurableSpace α› := ext fun _ ↦ ⟨And.left, fun h ↦ ⟨h, rfl⟩⟩ theorem invariants_le (f : α → α) : invariants f ≤ ‹MeasurableSpace α› := fun _ ↦ And.left theorem inf_le_invariants_comp (f g : α → α) : invariants f ⊓ invariants g ≤ invariants (f ∘ g) := fun s hs ↦ ⟨hs.1.1, by rw [preimage_comp, hs.1.2, hs.2.2]⟩ theorem le_invariants_iterate (f : α → α) (n : ℕ) : invariants f ≤ invariants (f^[n]) := by induction n with | zero => simp [invariants_le] | succ n ihn => exact le_trans (le_inf ihn le_rfl) (inf_le_invariants_comp _ _) variable {β : Type*} [MeasurableSpace β]
Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean
58
60
theorem measurable_invariants_dom {f : α → α} {g : α → β} : Measurable[invariants f] g ↔ Measurable g ∧ ∀ s, MeasurableSet s → (g ∘ f) ⁻¹' s = g ⁻¹' s := by
simp only [Measurable, ← forall_and]; rfl
import Mathlib.NumberTheory.NumberField.Basic import Mathlib.RingTheory.Localization.NormTrace #align_import number_theory.number_field.norm from "leanprover-community/mathlib"@"00f91228655eecdcd3ac97a7fd8dbcb139fe990a" open scoped NumberField open Finset NumberField Algebra FiniteDimensional namespace RingOfIntegers variable {L : Type*} (K : Type*) [Field K] [Field L] [Algebra K L] [FiniteDimensional K L] noncomputable def norm [IsSeparable K L] : 𝓞 L →* 𝓞 K := RingOfIntegers.restrict_monoidHom ((Algebra.norm K).comp (algebraMap (𝓞 L) L : (𝓞 L) →* L)) fun x => isIntegral_norm K x.2 #align ring_of_integers.norm RingOfIntegers.norm @[simp] lemma coe_norm [IsSeparable K L] (x : 𝓞 L) : norm K x = Algebra.norm K (x : L) := rfl theorem coe_algebraMap_norm [IsSeparable K L] (x : 𝓞 L) : (algebraMap (𝓞 K) (𝓞 L) (norm K x) : L) = algebraMap K L (Algebra.norm K (x : L)) := rfl #align ring_of_integers.coe_algebra_map_norm RingOfIntegers.coe_algebraMap_norm theorem algebraMap_norm_algebraMap [IsSeparable K L] (x : 𝓞 K) : algebraMap _ K (norm K (algebraMap (𝓞 K) (𝓞 L) x)) = Algebra.norm K (algebraMap K L (algebraMap _ _ x)) := rfl #align ring_of_integers.coe_norm_algebra_map RingOfIntegers.algebraMap_norm_algebraMap theorem norm_algebraMap [IsSeparable K L] (x : 𝓞 K) : norm K (algebraMap (𝓞 K) (𝓞 L) x) = x ^ finrank K L := by rw [RingOfIntegers.ext_iff, RingOfIntegers.coe_eq_algebraMap, RingOfIntegers.algebraMap_norm_algebraMap, Algebra.norm_algebraMap, RingOfIntegers.coe_eq_algebraMap, map_pow] #align ring_of_integers.norm_algebra_map RingOfIntegers.norm_algebraMap theorem isUnit_norm_of_isGalois [IsGalois K L] {x : 𝓞 L} : IsUnit (norm K x) ↔ IsUnit x := by classical refine ⟨fun hx => ?_, IsUnit.map _⟩ replace hx : IsUnit (algebraMap (𝓞 K) (𝓞 L) <| norm K x) := hx.map (algebraMap (𝓞 K) <| 𝓞 L) refine @isUnit_of_mul_isUnit_right (𝓞 L) _ ⟨(univ \ {AlgEquiv.refl}).prod fun σ : L ≃ₐ[K] L => σ x, prod_mem fun σ _ => x.2.map (σ : L →+* L).toIntAlgHom⟩ _ ?_ convert hx using 1 ext convert_to ((univ \ {AlgEquiv.refl}).prod fun σ : L ≃ₐ[K] L => σ x) * ∏ σ ∈ {(AlgEquiv.refl : L ≃ₐ[K] L)}, σ x = _ · rw [prod_singleton, AlgEquiv.coe_refl, _root_.id, RingOfIntegers.coe_eq_algebraMap, map_mul, RingOfIntegers.map_mk] · rw [prod_sdiff <| subset_univ _, ← norm_eq_prod_automorphisms, coe_algebraMap_norm] #align ring_of_integers.is_unit_norm_of_is_galois RingOfIntegers.isUnit_norm_of_isGalois theorem dvd_norm [IsGalois K L] (x : 𝓞 L) : x ∣ algebraMap (𝓞 K) (𝓞 L) (norm K x) := by classical have hint : IsIntegral ℤ (∏ σ ∈ univ.erase (AlgEquiv.refl : L ≃ₐ[K] L), σ x) := IsIntegral.prod _ (fun σ _ => ((RingOfIntegers.isIntegral_coe x).map σ)) refine ⟨⟨_, hint⟩, ?_⟩ ext rw [coe_algebraMap_norm K x, norm_eq_prod_automorphisms] simp [← Finset.mul_prod_erase _ _ (mem_univ AlgEquiv.refl)] #align ring_of_integers.dvd_norm RingOfIntegers.dvd_norm variable (F : Type*) [Field F] [Algebra K F] [IsSeparable K F] [FiniteDimensional K F]
Mathlib/NumberTheory/NumberField/Norm.lean
104
106
theorem norm_norm [IsSeparable K L] [Algebra F L] [IsSeparable F L] [FiniteDimensional F L] [IsScalarTower K F L] (x : 𝓞 L) : norm K (norm F x) = norm K x := by
rw [RingOfIntegers.ext_iff, coe_norm, coe_norm, coe_norm, Algebra.norm_norm]
import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.LinearAlgebra.Matrix.AbsoluteValue import Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue import Mathlib.RingTheory.ClassGroup import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.Norm #align_import number_theory.class_number.finite from "leanprover-community/mathlib"@"ea0bcd84221246c801a6f8fbe8a4372f6d04b176" open scoped nonZeroDivisors namespace ClassGroup open Ring section EuclideanDomain variable {R S : Type*} (K L : Type*) [EuclideanDomain R] [CommRing S] [IsDomain S] variable [Field K] [Field L] variable [Algebra R K] [IsFractionRing R K] variable [Algebra K L] [FiniteDimensional K L] [IsSeparable K L] variable [algRL : Algebra R L] [IsScalarTower R K L] variable [Algebra R S] [Algebra S L] variable [ist : IsScalarTower R S L] [iic : IsIntegralClosure S R L] variable (abv : AbsoluteValue R ℤ) variable {ι : Type*} [DecidableEq ι] [Fintype ι] (bS : Basis ι R S) noncomputable def normBound : ℤ := let n := Fintype.card ι let i : ι := Nonempty.some bS.index_nonempty let m : ℤ := Finset.max' (Finset.univ.image fun ijk : ι × ι × ι => abv (Algebra.leftMulMatrix bS (bS ijk.1) ijk.2.1 ijk.2.2)) ⟨_, Finset.mem_image.mpr ⟨⟨i, i, i⟩, Finset.mem_univ _, rfl⟩⟩ Nat.factorial n • (n • m) ^ n #align class_group.norm_bound ClassGroup.normBound theorem normBound_pos : 0 < normBound abv bS := by obtain ⟨i, j, k, hijk⟩ : ∃ i j k, Algebra.leftMulMatrix bS (bS i) j k ≠ 0 := by by_contra! h obtain ⟨i⟩ := bS.index_nonempty apply bS.ne_zero i apply (injective_iff_map_eq_zero (Algebra.leftMulMatrix bS)).mp (Algebra.leftMulMatrix_injective bS) ext j k simp [h, DMatrix.zero_apply] simp only [normBound, Algebra.smul_def, eq_natCast] apply mul_pos (Int.natCast_pos.mpr (Nat.factorial_pos _)) refine pow_pos (mul_pos (Int.natCast_pos.mpr (Fintype.card_pos_iff.mpr ⟨i⟩)) ?_) _ refine lt_of_lt_of_le (abv.pos hijk) (Finset.le_max' _ _ ?_) exact Finset.mem_image.mpr ⟨⟨i, j, k⟩, Finset.mem_univ _, rfl⟩ #align class_group.norm_bound_pos ClassGroup.normBound_pos theorem norm_le (a : S) {y : ℤ} (hy : ∀ k, abv (bS.repr a k) ≤ y) : abv (Algebra.norm R a) ≤ normBound abv bS * y ^ Fintype.card ι := by conv_lhs => rw [← bS.sum_repr a] rw [Algebra.norm_apply, ← LinearMap.det_toMatrix bS] simp only [Algebra.norm_apply, AlgHom.map_sum, AlgHom.map_smul, map_sum, map_smul, Algebra.toMatrix_lmul_eq, normBound, smul_mul_assoc, ← mul_pow] convert Matrix.det_sum_smul_le Finset.univ _ hy using 3 · rw [Finset.card_univ, smul_mul_assoc, mul_comm] · intro i j k apply Finset.le_max' exact Finset.mem_image.mpr ⟨⟨i, j, k⟩, Finset.mem_univ _, rfl⟩ #align class_group.norm_le ClassGroup.norm_le
Mathlib/NumberTheory/ClassNumber/Finite.lean
91
114
theorem norm_lt {T : Type*} [LinearOrderedRing T] (a : S) {y : T} (hy : ∀ k, (abv (bS.repr a k) : T) < y) : (abv (Algebra.norm R a) : T) < normBound abv bS * y ^ Fintype.card ι := by
obtain ⟨i⟩ := bS.index_nonempty have him : (Finset.univ.image fun k => abv (bS.repr a k)).Nonempty := ⟨_, Finset.mem_image.mpr ⟨i, Finset.mem_univ _, rfl⟩⟩ set y' : ℤ := Finset.max' _ him with y'_def have hy' : ∀ k, abv (bS.repr a k) ≤ y' := by intro k exact @Finset.le_max' ℤ _ _ _ (Finset.mem_image.mpr ⟨k, Finset.mem_univ _, rfl⟩) have : (y' : T) < y := by rw [y'_def, ← Finset.max'_image (show Monotone (_ : ℤ → T) from fun x y h => Int.cast_le.mpr h)] apply (Finset.max'_lt_iff _ (him.image _)).mpr simp only [Finset.mem_image, exists_prop] rintro _ ⟨x, ⟨k, -, rfl⟩, rfl⟩ exact hy k have y'_nonneg : 0 ≤ y' := le_trans (abv.nonneg _) (hy' i) apply (Int.cast_le.mpr (norm_le abv bS a hy')).trans_lt simp only [Int.cast_mul, Int.cast_pow] apply mul_lt_mul' le_rfl · exact pow_lt_pow_left this (Int.cast_nonneg.mpr y'_nonneg) (@Fintype.card_ne_zero _ _ ⟨i⟩) · exact pow_nonneg (Int.cast_nonneg.mpr y'_nonneg) _ · exact Int.cast_pos.mpr (normBound_pos abv bS)
import Mathlib.Algebra.Algebra.Subalgebra.Unitization import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.StarSubalgebra import Mathlib.Topology.ContinuousFunction.ContinuousMapZero import Mathlib.Topology.ContinuousFunction.Weierstrass #align_import topology.continuous_function.stone_weierstrass from "leanprover-community/mathlib"@"16e59248c0ebafabd5d071b1cd41743eb8698ffb" noncomputable section namespace ContinuousMap variable {X : Type*} [TopologicalSpace X] [CompactSpace X] open scoped Polynomial def attachBound (f : C(X, ℝ)) : C(X, Set.Icc (-‖f‖) ‖f‖) where toFun x := ⟨f x, ⟨neg_norm_le_apply f x, apply_le_norm f x⟩⟩ #align continuous_map.attach_bound ContinuousMap.attachBound @[simp] theorem attachBound_apply_coe (f : C(X, ℝ)) (x : X) : ((attachBound f) x : ℝ) = f x := rfl #align continuous_map.attach_bound_apply_coe ContinuousMap.attachBound_apply_coe
Mathlib/Topology/ContinuousFunction/StoneWeierstrass.lean
69
77
theorem polynomial_comp_attachBound (A : Subalgebra ℝ C(X, ℝ)) (f : A) (g : ℝ[X]) : (g.toContinuousMapOn (Set.Icc (-‖f‖) ‖f‖)).comp (f : C(X, ℝ)).attachBound = Polynomial.aeval f g := by
ext simp only [ContinuousMap.coe_comp, Function.comp_apply, ContinuousMap.attachBound_apply_coe, Polynomial.toContinuousMapOn_apply, Polynomial.aeval_subalgebra_coe, Polynomial.aeval_continuousMap_apply, Polynomial.toContinuousMap_apply] -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [ContinuousMap.attachBound_apply_coe]
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Geometry.Euclidean.PerpBisector import Mathlib.Algebra.QuadraticDiscriminant #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" noncomputable section open scoped Classical open RealInnerProductSpace namespace EuclideanGeometry variable {V : Type*} {P : Type*} variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P]
Mathlib/Geometry/Euclidean/Basic.lean
71
73
theorem dist_left_midpoint_eq_dist_right_midpoint (p1 p2 : P) : dist p1 (midpoint ℝ p1 p2) = dist p2 (midpoint ℝ p1 p2) := by
rw [dist_left_midpoint (𝕜 := ℝ) p1 p2, dist_right_midpoint (𝕜 := ℝ) p1 p2]
import Mathlib.RingTheory.AdjoinRoot import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.Polynomial.GaussLemma #align_import field_theory.minpoly.is_integrally_closed from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open scoped Classical Polynomial open Polynomial Set Function minpoly namespace minpoly variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain R] [Algebra R S] section variable (K L : Type*) [Field K] [Algebra R K] [IsFractionRing R K] [CommRing L] [Nontrivial L] [Algebra R L] [Algebra S L] [Algebra K L] [IsScalarTower R K L] [IsScalarTower R S L] variable [IsIntegrallyClosed R]
Mathlib/FieldTheory/Minpoly/IsIntegrallyClosed.lean
50
55
theorem isIntegrallyClosed_eq_field_fractions [IsDomain S] {s : S} (hs : IsIntegral R s) : minpoly K (algebraMap S L s) = (minpoly R s).map (algebraMap R K) := by
refine (eq_of_irreducible_of_monic ?_ ?_ ?_).symm · exact ((monic hs).irreducible_iff_irreducible_map_fraction_map).1 (irreducible hs) · rw [aeval_map_algebraMap, aeval_algebraMap_apply, aeval, map_zero] · exact (monic hs).map _
import Mathlib.Analysis.LocallyConvex.BalancedCoreHull import Mathlib.LinearAlgebra.FreeModule.Finite.Matrix import Mathlib.Topology.Algebra.Module.Simple import Mathlib.Topology.Algebra.Module.Determinant import Mathlib.RingTheory.Ideal.LocalRing #align_import topology.algebra.module.finite_dimension from "leanprover-community/mathlib"@"9425b6f8220e53b059f5a4904786c3c4b50fc057" universe u v w x noncomputable section open Set FiniteDimensional TopologicalSpace Filter section NormedField variable {𝕜 : Type u} [hnorm : NontriviallyNormedField 𝕜] {E : Type v} [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousSMul 𝕜 E] {F : Type w} [AddCommGroup F] [Module 𝕜 F] [TopologicalSpace F] [TopologicalAddGroup F] [ContinuousSMul 𝕜 F] {F' : Type x} [AddCommGroup F'] [Module 𝕜 F'] [TopologicalSpace F'] [TopologicalAddGroup F'] [ContinuousSMul 𝕜 F'] theorem unique_topology_of_t2 {t : TopologicalSpace 𝕜} (h₁ : @TopologicalAddGroup 𝕜 t _) (h₂ : @ContinuousSMul 𝕜 𝕜 _ hnorm.toUniformSpace.toTopologicalSpace t) (h₃ : @T2Space 𝕜 t) : t = hnorm.toUniformSpace.toTopologicalSpace := by -- Let `𝓣₀` denote the topology on `𝕜` induced by the norm, and `𝓣` be any T2 vector -- topology on `𝕜`. To show that `𝓣₀ = 𝓣`, it suffices to show that they have the same -- neighborhoods of 0. refine TopologicalAddGroup.ext h₁ inferInstance (le_antisymm ?_ ?_) · -- To show `𝓣 ≤ 𝓣₀`, we have to show that closed balls are `𝓣`-neighborhoods of 0. rw [Metric.nhds_basis_closedBall.ge_iff] -- Let `ε > 0`. Since `𝕜` is nontrivially normed, we have `0 < ‖ξ₀‖ < ε` for some `ξ₀ : 𝕜`. intro ε hε rcases NormedField.exists_norm_lt 𝕜 hε with ⟨ξ₀, hξ₀, hξ₀ε⟩ -- Since `ξ₀ ≠ 0` and `𝓣` is T2, we know that `{ξ₀}ᶜ` is a `𝓣`-neighborhood of 0. -- Porting note: added `mem_compl_singleton_iff.mpr` have : {ξ₀}ᶜ ∈ @nhds 𝕜 t 0 := IsOpen.mem_nhds isOpen_compl_singleton <| mem_compl_singleton_iff.mpr <| Ne.symm <| norm_ne_zero_iff.mp hξ₀.ne.symm -- Thus, its balanced core `𝓑` is too. Let's show that the closed ball of radius `ε` contains -- `𝓑`, which will imply that the closed ball is indeed a `𝓣`-neighborhood of 0. have : balancedCore 𝕜 {ξ₀}ᶜ ∈ @nhds 𝕜 t 0 := balancedCore_mem_nhds_zero this refine mem_of_superset this fun ξ hξ => ?_ -- Let `ξ ∈ 𝓑`. We want to show `‖ξ‖ < ε`. If `ξ = 0`, this is trivial. by_cases hξ0 : ξ = 0 · rw [hξ0] exact Metric.mem_closedBall_self hε.le · rw [mem_closedBall_zero_iff] -- Now suppose `ξ ≠ 0`. By contradiction, let's assume `ε < ‖ξ‖`, and show that -- `ξ₀ ∈ 𝓑 ⊆ {ξ₀}ᶜ`, which is a contradiction. by_contra! h suffices (ξ₀ * ξ⁻¹) • ξ ∈ balancedCore 𝕜 {ξ₀}ᶜ by rw [smul_eq_mul 𝕜, mul_assoc, inv_mul_cancel hξ0, mul_one] at this exact not_mem_compl_iff.mpr (mem_singleton ξ₀) ((balancedCore_subset _) this) -- For that, we use that `𝓑` is balanced : since `‖ξ₀‖ < ε < ‖ξ‖`, we have `‖ξ₀ / ξ‖ ≤ 1`, -- hence `ξ₀ = (ξ₀ / ξ) • ξ ∈ 𝓑` because `ξ ∈ 𝓑`. refine (balancedCore_balanced _).smul_mem ?_ hξ rw [norm_mul, norm_inv, mul_inv_le_iff (norm_pos_iff.mpr hξ0), mul_one] exact (hξ₀ε.trans h).le · -- Finally, to show `𝓣₀ ≤ 𝓣`, we simply argue that `id = (fun x ↦ x • 1)` is continuous from -- `(𝕜, 𝓣₀)` to `(𝕜, 𝓣)` because `(•) : (𝕜, 𝓣₀) × (𝕜, 𝓣) → (𝕜, 𝓣)` is continuous. calc @nhds 𝕜 hnorm.toUniformSpace.toTopologicalSpace 0 = map id (@nhds 𝕜 hnorm.toUniformSpace.toTopologicalSpace 0) := map_id.symm _ = map (fun x => id x • (1 : 𝕜)) (@nhds 𝕜 hnorm.toUniformSpace.toTopologicalSpace 0) := by conv_rhs => congr ext rw [smul_eq_mul, mul_one] _ ≤ @nhds 𝕜 t ((0 : 𝕜) • (1 : 𝕜)) := (@Tendsto.smul_const _ _ _ hnorm.toUniformSpace.toTopologicalSpace t _ _ _ _ _ tendsto_id (1 : 𝕜)) _ = @nhds 𝕜 t 0 := by rw [zero_smul] #align unique_topology_of_t2 unique_topology_of_t2
Mathlib/Topology/Algebra/Module/FiniteDimension.lean
132
173
theorem LinearMap.continuous_of_isClosed_ker (l : E →ₗ[𝕜] 𝕜) (hl : IsClosed (LinearMap.ker l : Set E)) : Continuous l := by
-- `l` is either constant or surjective. If it is constant, the result is trivial. by_cases H : finrank 𝕜 (LinearMap.range l) = 0 · rw [Submodule.finrank_eq_zero, LinearMap.range_eq_bot] at H rw [H] exact continuous_zero · -- In the case where `l` is surjective, we factor it as `φ : (E ⧸ l.ker) ≃ₗ[𝕜] 𝕜`. Note that -- `E ⧸ l.ker` is T2 since `l.ker` is closed. have : finrank 𝕜 (LinearMap.range l) = 1 := le_antisymm (finrank_self 𝕜 ▸ l.range.finrank_le) (zero_lt_iff.mpr H) have hi : Function.Injective ((LinearMap.ker l).liftQ l (le_refl _)) := by rw [← LinearMap.ker_eq_bot] exact Submodule.ker_liftQ_eq_bot _ _ _ (le_refl _) have hs : Function.Surjective ((LinearMap.ker l).liftQ l (le_refl _)) := by rw [← LinearMap.range_eq_top, Submodule.range_liftQ] exact Submodule.eq_top_of_finrank_eq ((finrank_self 𝕜).symm ▸ this) let φ : (E ⧸ LinearMap.ker l) ≃ₗ[𝕜] 𝕜 := LinearEquiv.ofBijective ((LinearMap.ker l).liftQ l (le_refl _)) ⟨hi, hs⟩ have hlφ : (l : E → 𝕜) = φ ∘ (LinearMap.ker l).mkQ := by ext; rfl -- Since the quotient map `E →ₗ[𝕜] (E ⧸ l.ker)` is continuous, the continuity of `l` will follow -- form the continuity of `φ`. suffices Continuous φ.toEquiv by rw [hlφ] exact this.comp continuous_quot_mk -- The pullback by `φ.symm` of the quotient topology is a T2 topology on `𝕜`, because `φ.symm` -- is injective. Since `φ.symm` is linear, it is also a vector space topology. -- Hence, we know that it is equal to the topology induced by the norm. have : induced φ.toEquiv.symm inferInstance = hnorm.toUniformSpace.toTopologicalSpace := by refine unique_topology_of_t2 (topologicalAddGroup_induced φ.symm.toLinearMap) (continuousSMul_induced φ.symm.toLinearMap) ?_ -- Porting note: was `rw [t2Space_iff]` refine (@t2Space_iff 𝕜 (induced (↑(LinearEquiv.toEquiv φ).symm) inferInstance)).mpr ?_ exact fun x y hxy => @separated_by_continuous _ _ (induced _ _) _ _ _ continuous_induced_dom _ _ (φ.toEquiv.symm.injective.ne hxy) -- Finally, the pullback by `φ.symm` is exactly the pushforward by `φ`, so we have to prove -- that `φ` is continuous when `𝕜` is endowed with the pushforward by `φ` of the quotient -- topology, which is trivial by definition of the pushforward. rw [this.symm, Equiv.induced_symm] exact continuous_coinduced_rng
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory variable {α E : Type*} {m : MeasurableSpace α} [NormedAddCommGroup E] {p : ℝ≥0∞} {q : ℝ} {μ : Measure α} {f g : α → E} theorem snorm'_add_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) (hq1 : 1 ≤ q) : snorm' (f + g) q μ ≤ snorm' f q μ + snorm' g q μ := calc (∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤ (∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by gcongr with a simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le] _ ≤ snorm' f q μ + snorm' g q μ := ENNReal.lintegral_Lp_add_le hf.ennnorm hg.ennnorm hq1 #align measure_theory.snorm'_add_le MeasureTheory.snorm'_add_le theorem snorm'_add_le_of_le_one {f g : α → E} (hf : AEStronglyMeasurable f μ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : snorm' (f + g) q μ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (snorm' f q μ + snorm' g q μ) := calc (∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤ (∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by gcongr with a simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le] _ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (snorm' f q μ + snorm' g q μ) := ENNReal.lintegral_Lp_add_le_of_le_one hf.ennnorm hq0 hq1 #align measure_theory.snorm'_add_le_of_le_one MeasureTheory.snorm'_add_le_of_le_one
Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean
47
51
theorem snormEssSup_add_le {f g : α → E} : snormEssSup (f + g) μ ≤ snormEssSup f μ + snormEssSup g μ := by
refine le_trans (essSup_mono_ae (eventually_of_forall fun x => ?_)) (ENNReal.essSup_add_le _ _) simp_rw [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe] exact nnnorm_add_le _ _
namespace Nat @[reducible] def Coprime (m n : Nat) : Prop := gcd m n = 1 instance (m n : Nat) : Decidable (Coprime m n) := inferInstanceAs (Decidable (_ = 1)) theorem coprime_iff_gcd_eq_one : Coprime m n ↔ gcd m n = 1 := .rfl theorem Coprime.gcd_eq_one : Coprime m n → gcd m n = 1 := id theorem Coprime.symm : Coprime n m → Coprime m n := (gcd_comm m n).trans theorem coprime_comm : Coprime n m ↔ Coprime m n := ⟨Coprime.symm, Coprime.symm⟩ theorem Coprime.dvd_of_dvd_mul_right (H1 : Coprime k n) (H2 : k ∣ m * n) : k ∣ m := by let t := dvd_gcd (Nat.dvd_mul_left k m) H2 rwa [gcd_mul_left, H1.gcd_eq_one, Nat.mul_one] at t theorem Coprime.dvd_of_dvd_mul_left (H1 : Coprime k m) (H2 : k ∣ m * n) : k ∣ n := H1.dvd_of_dvd_mul_right (by rwa [Nat.mul_comm]) theorem Coprime.gcd_mul_left_cancel (m : Nat) (H : Coprime k n) : gcd (k * m) n = gcd m n := have H1 : Coprime (gcd (k * m) n) k := by rw [Coprime, Nat.gcd_assoc, H.symm.gcd_eq_one, gcd_one_right] Nat.dvd_antisymm (dvd_gcd (H1.dvd_of_dvd_mul_left (gcd_dvd_left _ _)) (gcd_dvd_right _ _)) (gcd_dvd_gcd_mul_left _ _ _) theorem Coprime.gcd_mul_right_cancel (m : Nat) (H : Coprime k n) : gcd (m * k) n = gcd m n := by rw [Nat.mul_comm m k, H.gcd_mul_left_cancel m]
.lake/packages/batteries/Batteries/Data/Nat/Gcd.lean
49
51
theorem Coprime.gcd_mul_left_cancel_right (n : Nat) (H : Coprime k m) : gcd m (k * n) = gcd m n := by
rw [gcd_comm m n, gcd_comm m (k * n), H.gcd_mul_left_cancel n]
import Mathlib.Order.Filter.AtTopBot import Mathlib.Order.Filter.Subsingleton open Set variable {α β γ δ : Type*} {l : Filter α} {f : α → β} namespace Filter def EventuallyConst (f : α → β) (l : Filter α) : Prop := (map f l).Subsingleton theorem HasBasis.eventuallyConst_iff {ι : Sort*} {p : ι → Prop} {s : ι → Set α} (h : l.HasBasis p s) : EventuallyConst f l ↔ ∃ i, p i ∧ ∀ x ∈ s i, ∀ y ∈ s i, f x = f y := (h.map f).subsingleton_iff.trans <| by simp only [Set.Subsingleton, forall_mem_image] theorem HasBasis.eventuallyConst_iff' {ι : Sort*} {p : ι → Prop} {s : ι → Set α} {x : ι → α} (h : l.HasBasis p s) (hx : ∀ i, p i → x i ∈ s i) : EventuallyConst f l ↔ ∃ i, p i ∧ ∀ y ∈ s i, f y = f (x i) := h.eventuallyConst_iff.trans <| exists_congr fun i ↦ and_congr_right fun hi ↦ ⟨fun h ↦ (h · · (x i) (hx i hi)), fun h a ha b hb ↦ h a ha ▸ (h b hb).symm⟩ lemma eventuallyConst_iff_tendsto [Nonempty β] : EventuallyConst f l ↔ ∃ x, Tendsto f l (pure x) := subsingleton_iff_exists_le_pure alias ⟨EventuallyConst.exists_tendsto, _⟩ := eventuallyConst_iff_tendsto theorem EventuallyConst.of_tendsto {x : β} (h : Tendsto f l (pure x)) : EventuallyConst f l := have : Nonempty β := ⟨x⟩; eventuallyConst_iff_tendsto.2 ⟨x, h⟩ theorem eventuallyConst_iff_exists_eventuallyEq [Nonempty β] : EventuallyConst f l ↔ ∃ c, f =ᶠ[l] fun _ ↦ c := subsingleton_iff_exists_singleton_mem alias ⟨EventuallyConst.eventuallyEq_const, _⟩ := eventuallyConst_iff_exists_eventuallyEq theorem eventuallyConst_pred' {p : α → Prop} : EventuallyConst p l ↔ (p =ᶠ[l] fun _ ↦ False) ∨ (p =ᶠ[l] fun _ ↦ True) := by simp only [eventuallyConst_iff_exists_eventuallyEq, Prop.exists_iff] theorem eventuallyConst_pred {p : α → Prop} : EventuallyConst p l ↔ (∀ᶠ x in l, p x) ∨ (∀ᶠ x in l, ¬p x) := by simp [eventuallyConst_pred', or_comm, EventuallyEq] theorem eventuallyConst_set' {s : Set α} : EventuallyConst s l ↔ (s =ᶠ[l] (∅ : Set α)) ∨ s =ᶠ[l] univ := eventuallyConst_pred' theorem eventuallyConst_set {s : Set α} : EventuallyConst s l ↔ (∀ᶠ x in l, x ∈ s) ∨ (∀ᶠ x in l, x ∉ s) := eventuallyConst_pred theorem EventuallyEq.eventuallyConst_iff {g : α → β} (h : f =ᶠ[l] g) : EventuallyConst f l ↔ EventuallyConst g l := by simp only [EventuallyConst, map_congr h] @[simp] theorem eventuallyConst_id : EventuallyConst id l ↔ l.Subsingleton := Iff.rfl namespace EventuallyConst @[simp] protected lemma bot : EventuallyConst f ⊥ := subsingleton_bot @[simp] protected lemma const (c : β) : EventuallyConst (fun _ ↦ c) l := .of_tendsto tendsto_const_pure protected lemma congr {g} (h : EventuallyConst f l) (hg : f =ᶠ[l] g) : EventuallyConst g l := hg.eventuallyConst_iff.1 h @[nontriviality] lemma of_subsingleton_right [Subsingleton β] : EventuallyConst f l := .of_subsingleton nonrec lemma anti {l'} (h : EventuallyConst f l) (hl' : l' ≤ l) : EventuallyConst f l' := h.anti (map_mono hl') @[nontriviality] lemma of_subsingleton_left [Subsingleton α] : EventuallyConst f l := .map .of_subsingleton f lemma comp (h : EventuallyConst f l) (g : β → γ) : EventuallyConst (g ∘ f) l := h.map g @[to_additive] protected lemma inv [Inv β] (h : EventuallyConst f l) : EventuallyConst (f⁻¹) l := h.comp Inv.inv lemma comp_tendsto {lb : Filter β} {g : β → γ} (hg : EventuallyConst g lb) (hf : Tendsto f l lb) : EventuallyConst (g ∘ f) l := hg.anti hf lemma apply {ι : Type*} {p : ι → Type*} {g : α → ∀ x, p x} (h : EventuallyConst g l) (i : ι) : EventuallyConst (g · i) l := h.comp <| Function.eval i lemma comp₂ {g : α → γ} (hf : EventuallyConst f l) (op : β → γ → δ) (hg : EventuallyConst g l) : EventuallyConst (fun x ↦ op (f x) (g x)) l := ((hf.prod hg).map op.uncurry).anti <| (tendsto_map (f := op.uncurry)).comp (tendsto_map.prod_mk tendsto_map) lemma prod_mk {g : α → γ} (hf : EventuallyConst f l) (hg : EventuallyConst g l) : EventuallyConst (fun x ↦ (f x, g x)) l := hf.comp₂ Prod.mk hg @[to_additive] lemma mul [Mul β] {g : α → β} (hf : EventuallyConst f l) (hg : EventuallyConst g l) : EventuallyConst (f * g) l := hf.comp₂ (· * ·) hg variable [One β] {s : Set α} {c : β} @[to_additive] lemma of_mulIndicator_const (h : EventuallyConst (s.mulIndicator fun _ ↦ c) l) (hc : c ≠ 1) : EventuallyConst s l := by simpa [(· ∘ ·), hc, imp_false] using h.comp (· = c) @[to_additive] theorem mulIndicator_const (h : EventuallyConst s l) (c : β) : EventuallyConst (s.mulIndicator fun _ ↦ c) l := by classical exact h.comp (if · then c else 1) @[to_additive] theorem mulIndicator_const_iff_of_ne (hc : c ≠ 1) : EventuallyConst (s.mulIndicator fun _ ↦ c) l ↔ EventuallyConst s l := ⟨(of_mulIndicator_const · hc), (mulIndicator_const · c)⟩ @[to_additive (attr := simp)]
Mathlib/Order/Filter/EventuallyConst.lean
145
147
theorem mulIndicator_const_iff : EventuallyConst (s.mulIndicator fun _ ↦ c) l ↔ c = 1 ∨ EventuallyConst s l := by
rcases eq_or_ne c 1 with rfl | hc <;> simp [mulIndicator_const_iff_of_ne, *]
import Mathlib.MeasureTheory.OuterMeasure.Induced import Mathlib.MeasureTheory.OuterMeasure.AE import Mathlib.Order.Filter.CountableInter #align_import measure_theory.measure.measure_space_def from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" noncomputable section open scoped Classical open Set open Filter hiding map open Function MeasurableSpace open scoped Classical open Topology Filter ENNReal NNReal variable {α β γ δ : Type*} {ι : Sort*} namespace MeasureTheory structure Measure (α : Type*) [MeasurableSpace α] extends OuterMeasure α where m_iUnion ⦃f : ℕ → Set α⦄ : (∀ i, MeasurableSet (f i)) → Pairwise (Disjoint on f) → toOuterMeasure (⋃ i, f i) = ∑' i, toOuterMeasure (f i) trim_le : toOuterMeasure.trim ≤ toOuterMeasure #align measure_theory.measure MeasureTheory.Measure theorem Measure.toOuterMeasure_injective [MeasurableSpace α] : Injective (toOuterMeasure : Measure α → OuterMeasure α) | ⟨_, _, _⟩, ⟨_, _, _⟩, rfl => rfl #align measure_theory.measure.to_outer_measure_injective MeasureTheory.Measure.toOuterMeasure_injective instance Measure.instFunLike [MeasurableSpace α] : FunLike (Measure α) (Set α) ℝ≥0∞ where coe μ := μ.toOuterMeasure coe_injective' | ⟨_, _, _⟩, ⟨_, _, _⟩, h => toOuterMeasure_injective <| DFunLike.coe_injective h #noalign measure_theory.measure.has_coe_to_fun set_option linter.deprecated false in -- Not immediately obvious how to use `measure_empty` here. instance Measure.instOuterMeasureClass [MeasurableSpace α] : OuterMeasureClass (Measure α) α where measure_empty m := m.empty' measure_iUnion_nat_le m := m.iUnion_nat measure_mono m := m.mono section variable [MeasurableSpace α] {μ μ₁ μ₂ : Measure α} {s s₁ s₂ t : Set α} namespace Measure theorem trimmed (μ : Measure α) : μ.toOuterMeasure.trim = μ.toOuterMeasure := le_antisymm μ.trim_le μ.1.le_trim def ofMeasurable (m : ∀ s : Set α, MeasurableSet s → ℝ≥0∞) (m0 : m ∅ MeasurableSet.empty = 0) (mU : ∀ ⦃f : ℕ → Set α⦄ (h : ∀ i, MeasurableSet (f i)), Pairwise (Disjoint on f) → m (⋃ i, f i) (MeasurableSet.iUnion h) = ∑' i, m (f i) (h i)) : Measure α := { toOuterMeasure := inducedOuterMeasure m _ m0 m_iUnion := fun f hf hd => show inducedOuterMeasure m _ m0 (iUnion f) = ∑' i, inducedOuterMeasure m _ m0 (f i) by rw [inducedOuterMeasure_eq m0 mU, mU hf hd] congr; funext n; rw [inducedOuterMeasure_eq m0 mU] trim_le := le_inducedOuterMeasure.2 fun s hs ↦ by rw [OuterMeasure.trim_eq _ hs, inducedOuterMeasure_eq m0 mU hs] } #align measure_theory.measure.of_measurable MeasureTheory.Measure.ofMeasurable theorem ofMeasurable_apply {m : ∀ s : Set α, MeasurableSet s → ℝ≥0∞} {m0 : m ∅ MeasurableSet.empty = 0} {mU : ∀ ⦃f : ℕ → Set α⦄ (h : ∀ i, MeasurableSet (f i)), Pairwise (Disjoint on f) → m (⋃ i, f i) (MeasurableSet.iUnion h) = ∑' i, m (f i) (h i)} (s : Set α) (hs : MeasurableSet s) : ofMeasurable m m0 mU s = m s hs := inducedOuterMeasure_eq m0 mU hs #align measure_theory.measure.of_measurable_apply MeasureTheory.Measure.ofMeasurable_apply @[ext] theorem ext (h : ∀ s, MeasurableSet s → μ₁ s = μ₂ s) : μ₁ = μ₂ := toOuterMeasure_injective <| by rw [← trimmed, OuterMeasure.trim_congr (h _), trimmed] #align measure_theory.measure.ext MeasureTheory.Measure.ext theorem ext_iff : μ₁ = μ₂ ↔ ∀ s, MeasurableSet s → μ₁ s = μ₂ s := ⟨by rintro rfl s _hs; rfl, Measure.ext⟩ #align measure_theory.measure.ext_iff MeasureTheory.Measure.ext_iff theorem ext_iff' : μ₁ = μ₂ ↔ ∀ s, μ₁ s = μ₂ s := ⟨by rintro rfl s; rfl, fun h ↦ Measure.ext (fun s _ ↦ h s)⟩
Mathlib/MeasureTheory/Measure/MeasureSpaceDef.lean
148
149
theorem outerMeasure_le_iff {m : OuterMeasure α} : m ≤ μ.1 ↔ ∀ s, MeasurableSet s → m s ≤ μ s := by
simpa only [μ.trimmed] using OuterMeasure.le_trim_iff (m₂ := μ.1)
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ v₂ v₃ u₁ u₂ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟶ Y := by rw [p]; exact 𝟙 _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = 𝟙 X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟶ Y) (g : X ⟶ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h ▸ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟶ Y) (g : X' ⟶ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h ▸ by simp mpr := fun h => h ▸ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {β : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : β → C} (z : ∀ b, f b ⟶ g b) {j j' : β} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : β → C} (z : ∀ b, f b ≅ g b) {j j' : β} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : β → C} (z : ∀ b, f b ≅ g b) {j j' : β} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF] theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟶ Z) : cast (congrArg (fun W : C => W ⟶ Z) p.symm) q = eqToHom p ≫ q := by cases p simp theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟶ Z) : (congrArg (fun W : C => W ⟶ Z) p).mpr q = eqToHom p ≫ q := by cases p simp #align category_theory.congr_arg_mpr_hom_left CategoryTheory.congrArg_mpr_hom_left @[simp, nolint simpNF] theorem congrArg_cast_hom_right {X Y Z : C} (p : X ⟶ Y) (q : Z = Y) : cast (congrArg (fun W : C => X ⟶ W) q.symm) p = p ≫ eqToHom q.symm := by cases q simp theorem congrArg_mpr_hom_right {X Y Z : C} (p : X ⟶ Y) (q : Z = Y) : (congrArg (fun W : C => X ⟶ W) q).mpr p = p ≫ eqToHom q.symm := by cases q simp #align category_theory.congr_arg_mpr_hom_right CategoryTheory.congrArg_mpr_hom_right def eqToIso {X Y : C} (p : X = Y) : X ≅ Y := ⟨eqToHom p, eqToHom p.symm, by simp, by simp⟩ #align category_theory.eq_to_iso CategoryTheory.eqToIso @[simp] theorem eqToIso.hom {X Y : C} (p : X = Y) : (eqToIso p).hom = eqToHom p := rfl #align category_theory.eq_to_iso.hom CategoryTheory.eqToIso.hom @[simp] theorem eqToIso.inv {X Y : C} (p : X = Y) : (eqToIso p).inv = eqToHom p.symm := rfl #align category_theory.eq_to_iso.inv CategoryTheory.eqToIso.inv @[simp] theorem eqToIso_refl {X : C} (p : X = X) : eqToIso p = Iso.refl X := rfl #align category_theory.eq_to_iso_refl CategoryTheory.eqToIso_refl @[simp] theorem eqToIso_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToIso p ≪≫ eqToIso q = eqToIso (p.trans q) := by ext; simp #align category_theory.eq_to_iso_trans CategoryTheory.eqToIso_trans @[simp]
Mathlib/CategoryTheory/EqToHom.lean
174
176
theorem eqToHom_op {X Y : C} (h : X = Y) : (eqToHom h).op = eqToHom (congr_arg op h.symm) := by
cases h rfl
import Mathlib.Data.List.Basic import Mathlib.Data.Sigma.Basic #align_import data.list.prod_sigma from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" variable {α β : Type*} namespace List @[simp] theorem nil_product (l : List β) : (@nil α) ×ˢ l = [] := rfl #align list.nil_product List.nil_product @[simp] theorem product_cons (a : α) (l₁ : List α) (l₂ : List β) : (a :: l₁) ×ˢ l₂ = map (fun b => (a, b)) l₂ ++ (l₁ ×ˢ l₂) := rfl #align list.product_cons List.product_cons @[simp] theorem product_nil : ∀ l : List α, l ×ˢ (@nil β) = [] | [] => rfl | _ :: l => by simp [product_cons, product_nil l] #align list.product_nil List.product_nil @[simp]
Mathlib/Data/List/ProdSigma.lean
45
48
theorem mem_product {l₁ : List α} {l₂ : List β} {a : α} {b : β} : (a, b) ∈ l₁ ×ˢ l₂ ↔ a ∈ l₁ ∧ b ∈ l₂ := by
simp_all [SProd.sprod, product, mem_bind, mem_map, Prod.ext_iff, exists_prop, and_left_comm, exists_and_left, exists_eq_left, exists_eq_right]
import Mathlib.MeasureTheory.Constructions.Prod.Integral import Mathlib.MeasureTheory.Integral.CircleIntegral #align_import measure_theory.integral.torus_integral from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" variable {n : ℕ} variable {E : Type*} [NormedAddCommGroup E] noncomputable section open Complex Set MeasureTheory Function Filter TopologicalSpace open scoped Real -- Porting note: notation copied from `./DivergenceTheorem` local macro:arg t:term:max noWs "ⁿ⁺¹" : term => `(Fin (n + 1) → $t) local macro:arg t:term:max noWs "ⁿ" : term => `(Fin n → $t) local macro:arg t:term:max noWs "⁰" : term => `(Fin 0 → $t) local macro:arg t:term:max noWs "¹" : term => `(Fin 1 → $t) def torusMap (c : ℂⁿ) (R : ℝⁿ) : ℝⁿ → ℂⁿ := fun θ i => c i + R i * exp (θ i * I) #align torus_map torusMap theorem torusMap_sub_center (c : ℂⁿ) (R : ℝⁿ) (θ : ℝⁿ) : torusMap c R θ - c = torusMap 0 R θ := by ext1 i; simp [torusMap] #align torus_map_sub_center torusMap_sub_center theorem torusMap_eq_center_iff {c : ℂⁿ} {R : ℝⁿ} {θ : ℝⁿ} : torusMap c R θ = c ↔ R = 0 := by simp [funext_iff, torusMap, exp_ne_zero] #align torus_map_eq_center_iff torusMap_eq_center_iff @[simp] theorem torusMap_zero_radius (c : ℂⁿ) : torusMap c 0 = const ℝⁿ c := funext fun _ ↦ torusMap_eq_center_iff.2 rfl #align torus_map_zero_radius torusMap_zero_radius def TorusIntegrable (f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) : Prop := IntegrableOn (fun θ : ℝⁿ => f (torusMap c R θ)) (Icc (0 : ℝⁿ) fun _ => 2 * π) volume #align torus_integrable TorusIntegrable variable [NormedSpace ℂ E] [CompleteSpace E] {f g : (Fin n → ℂ) → E} {c : Fin n → ℂ} {R : Fin n → ℝ} def torusIntegral (f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) := ∫ θ : ℝⁿ in Icc (0 : ℝⁿ) fun _ => 2 * π, (∏ i, R i * exp (θ i * I) * I : ℂ) • f (torusMap c R θ) #align torus_integral torusIntegral @[inherit_doc torusIntegral] notation3"∯ "(...)" in ""T("c", "R")"", "r:(scoped f => torusIntegral f c R) => r
Mathlib/MeasureTheory/Integral/TorusIntegral.lean
160
163
theorem torusIntegral_radius_zero (hn : n ≠ 0) (f : ℂⁿ → E) (c : ℂⁿ) : (∯ x in T(c, 0), f x) = 0 := by
simp only [torusIntegral, Pi.zero_apply, ofReal_zero, mul_zero, zero_mul, Fin.prod_const, zero_pow hn, zero_smul, integral_zero]
import Mathlib.CategoryTheory.Monoidal.Braided.Basic import Mathlib.CategoryTheory.Monoidal.Discrete import Mathlib.CategoryTheory.Monoidal.CoherenceLemmas import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.Algebra.PUnitInstances #align_import category_theory.monoidal.Mon_ from "leanprover-community/mathlib"@"a836c6dba9bd1ee2a0cdc9af0006a596f243031c" set_option linter.uppercaseLean3 false universe v₁ v₂ u₁ u₂ u open CategoryTheory MonoidalCategory variable (C : Type u₁) [Category.{v₁} C] [MonoidalCategory.{v₁} C] structure Mon_ where X : C one : 𝟙_ C ⟶ X mul : X ⊗ X ⟶ X one_mul : (one ▷ X) ≫ mul = (λ_ X).hom := by aesop_cat mul_one : (X ◁ one) ≫ mul = (ρ_ X).hom := by aesop_cat -- Obviously there is some flexibility stating this axiom. -- This one has left- and right-hand sides matching the statement of `Monoid.mul_assoc`, -- and chooses to place the associator on the right-hand side. -- The heuristic is that unitors and associators "don't have much weight". mul_assoc : (mul ▷ X) ≫ mul = (α_ X X X).hom ≫ (X ◁ mul) ≫ mul := by aesop_cat #align Mon_ Mon_ attribute [reassoc] Mon_.one_mul Mon_.mul_one attribute [simp] Mon_.one_mul Mon_.mul_one -- We prove a more general `@[simp]` lemma below. attribute [reassoc (attr := simp)] Mon_.mul_assoc namespace Mon_ @[simps] def trivial : Mon_ C where X := 𝟙_ C one := 𝟙 _ mul := (λ_ _).hom mul_assoc := by coherence mul_one := by coherence #align Mon_.trivial Mon_.trivial instance : Inhabited (Mon_ C) := ⟨trivial C⟩ variable {C} variable {M : Mon_ C} @[simp]
Mathlib/CategoryTheory/Monoidal/Mon_.lean
75
76
theorem one_mul_hom {Z : C} (f : Z ⟶ M.X) : (M.one ⊗ f) ≫ M.mul = (λ_ Z).hom ≫ f := by
rw [tensorHom_def'_assoc, M.one_mul, leftUnitor_naturality]
import Mathlib.CategoryTheory.EqToHom import Mathlib.CategoryTheory.Bicategory.Basic #align_import category_theory.bicategory.strict from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" namespace CategoryTheory open Bicategory universe w v u variable (B : Type u) [Bicategory.{w, v} B] class Bicategory.Strict : Prop where id_comp : ∀ {a b : B} (f : a ⟶ b), 𝟙 a ≫ f = f := by aesop_cat comp_id : ∀ {a b : B} (f : a ⟶ b), f ≫ 𝟙 b = f := by aesop_cat assoc : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), (f ≫ g) ≫ h = f ≫ g ≫ h := by aesop_cat leftUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), λ_ f = eqToIso (id_comp f) := by aesop_cat rightUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), ρ_ f = eqToIso (comp_id f) := by aesop_cat associator_eqToIso : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), α_ f g h = eqToIso (assoc f g h) := by aesop_cat #align category_theory.bicategory.strict CategoryTheory.Bicategory.Strict -- Porting note: not adding simp to: -- Bicategory.Strict.id_comp -- Bicategory.Strict.comp_id -- Bicategory.Strict.assoc attribute [simp] Bicategory.Strict.leftUnitor_eqToIso Bicategory.Strict.rightUnitor_eqToIso Bicategory.Strict.associator_eqToIso -- see Note [lower instance priority] instance (priority := 100) StrictBicategory.category [Bicategory.Strict B] : Category B where id_comp := Bicategory.Strict.id_comp comp_id := Bicategory.Strict.comp_id assoc := Bicategory.Strict.assoc #align category_theory.strict_bicategory.category CategoryTheory.StrictBicategory.category namespace Bicategory variable {B} @[simp]
Mathlib/CategoryTheory/Bicategory/Strict.lean
78
81
theorem whiskerLeft_eqToHom {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g = h) : f ◁ eqToHom η = eqToHom (congr_arg₂ (· ≫ ·) rfl η) := by
cases η simp only [whiskerLeft_id, eqToHom_refl]
import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Algebra.Order.Module.Pointwise import Mathlib.Data.Real.Archimedean #align_import data.real.pointwise from "leanprover-community/mathlib"@"dde670c9a3f503647fd5bfdf1037bad526d3397a" open Set open Pointwise variable {ι : Sort*} {α : Type*} [LinearOrderedField α] section Module variable [Module α ℝ] [OrderedSMul α ℝ] {a : α}
Mathlib/Data/Real/Pointwise.lean
75
84
theorem Real.sInf_smul_of_nonpos (ha : a ≤ 0) (s : Set ℝ) : sInf (a • s) = a • sSup s := by
obtain rfl | hs := s.eq_empty_or_nonempty · rw [smul_set_empty, Real.sInf_empty, Real.sSup_empty, smul_zero] obtain rfl | ha' := ha.eq_or_lt · rw [zero_smul_set hs, zero_smul] exact csInf_singleton 0 by_cases h : BddAbove s · exact ((OrderIso.smulRightDual ℝ ha').map_csSup' hs h).symm · rw [Real.sInf_of_not_bddBelow (mt (bddBelow_smul_iff_of_neg ha').1 h), Real.sSup_of_not_bddAbove h, smul_zero]
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Sym.Card open Finset Function namespace SimpleGraph variable {V : Type*} (G : SimpleGraph V) {e : Sym2 V} section EdgeFinset variable {G₁ G₂ : SimpleGraph V} [Fintype G.edgeSet] [Fintype G₁.edgeSet] [Fintype G₂.edgeSet] abbrev edgeFinset : Finset (Sym2 V) := Set.toFinset G.edgeSet #align simple_graph.edge_finset SimpleGraph.edgeFinset @[norm_cast] theorem coe_edgeFinset : (G.edgeFinset : Set (Sym2 V)) = G.edgeSet := Set.coe_toFinset _ #align simple_graph.coe_edge_finset SimpleGraph.coe_edgeFinset variable {G} theorem mem_edgeFinset : e ∈ G.edgeFinset ↔ e ∈ G.edgeSet := Set.mem_toFinset #align simple_graph.mem_edge_finset SimpleGraph.mem_edgeFinset theorem not_isDiag_of_mem_edgeFinset : e ∈ G.edgeFinset → ¬e.IsDiag := not_isDiag_of_mem_edgeSet _ ∘ mem_edgeFinset.1 #align simple_graph.not_is_diag_of_mem_edge_finset SimpleGraph.not_isDiag_of_mem_edgeFinset theorem edgeFinset_inj : G₁.edgeFinset = G₂.edgeFinset ↔ G₁ = G₂ := by simp #align simple_graph.edge_finset_inj SimpleGraph.edgeFinset_inj theorem edgeFinset_subset_edgeFinset : G₁.edgeFinset ⊆ G₂.edgeFinset ↔ G₁ ≤ G₂ := by simp #align simple_graph.edge_finset_subset_edge_finset SimpleGraph.edgeFinset_subset_edgeFinset theorem edgeFinset_ssubset_edgeFinset : G₁.edgeFinset ⊂ G₂.edgeFinset ↔ G₁ < G₂ := by simp #align simple_graph.edge_finset_ssubset_edge_finset SimpleGraph.edgeFinset_ssubset_edgeFinset @[gcongr] alias ⟨_, edgeFinset_mono⟩ := edgeFinset_subset_edgeFinset #align simple_graph.edge_finset_mono SimpleGraph.edgeFinset_mono alias ⟨_, edgeFinset_strict_mono⟩ := edgeFinset_ssubset_edgeFinset #align simple_graph.edge_finset_strict_mono SimpleGraph.edgeFinset_strict_mono attribute [mono] edgeFinset_mono edgeFinset_strict_mono @[simp] theorem edgeFinset_bot : (⊥ : SimpleGraph V).edgeFinset = ∅ := by simp [edgeFinset] #align simple_graph.edge_finset_bot SimpleGraph.edgeFinset_bot @[simp] theorem edgeFinset_sup [Fintype (edgeSet (G₁ ⊔ G₂))] [DecidableEq V] : (G₁ ⊔ G₂).edgeFinset = G₁.edgeFinset ∪ G₂.edgeFinset := by simp [edgeFinset] #align simple_graph.edge_finset_sup SimpleGraph.edgeFinset_sup @[simp] theorem edgeFinset_inf [DecidableEq V] : (G₁ ⊓ G₂).edgeFinset = G₁.edgeFinset ∩ G₂.edgeFinset := by simp [edgeFinset] #align simple_graph.edge_finset_inf SimpleGraph.edgeFinset_inf @[simp] theorem edgeFinset_sdiff [DecidableEq V] : (G₁ \ G₂).edgeFinset = G₁.edgeFinset \ G₂.edgeFinset := by simp [edgeFinset] #align simple_graph.edge_finset_sdiff SimpleGraph.edgeFinset_sdiff theorem edgeFinset_card : G.edgeFinset.card = Fintype.card G.edgeSet := Set.toFinset_card _ #align simple_graph.edge_finset_card SimpleGraph.edgeFinset_card @[simp] theorem edgeSet_univ_card : (univ : Finset G.edgeSet).card = G.edgeFinset.card := Fintype.card_of_subtype G.edgeFinset fun _ => mem_edgeFinset #align simple_graph.edge_set_univ_card SimpleGraph.edgeSet_univ_card variable [Fintype V] @[simp] theorem edgeFinset_top [DecidableEq V] : (⊤ : SimpleGraph V).edgeFinset = univ.filter fun e => ¬e.IsDiag := by rw [← coe_inj]; simp theorem card_edgeFinset_top_eq_card_choose_two [DecidableEq V] : (⊤ : SimpleGraph V).edgeFinset.card = (Fintype.card V).choose 2 := by simp_rw [Set.toFinset_card, edgeSet_top, Set.coe_setOf, ← Sym2.card_subtype_not_diag]
Mathlib/Combinatorics/SimpleGraph/Finite.lean
130
133
theorem card_edgeFinset_le_card_choose_two : G.edgeFinset.card ≤ (Fintype.card V).choose 2 := by
classical rw [← card_edgeFinset_top_eq_card_choose_two] exact card_le_card (edgeFinset_mono le_top)
import Mathlib.MeasureTheory.Integral.SetIntegral #align_import measure_theory.integral.average from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open ENNReal MeasureTheory MeasureTheory.Measure Metric Set Filter TopologicalSpace Function open scoped Topology ENNReal Convex variable {α E F : Type*} {m0 : MeasurableSpace α} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] {μ ν : Measure α} {s t : Set α} namespace MeasureTheory section NormedAddCommGroup variable (μ) variable {f g : α → E} noncomputable def average (f : α → E) := ∫ x, f x ∂(μ univ)⁻¹ • μ #align measure_theory.average MeasureTheory.average notation3 "⨍ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => average μ r notation3 "⨍ "(...)", "r:60:(scoped f => average volume f) => r notation3 "⨍ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => average (Measure.restrict μ s) r notation3 "⨍ "(...)" in "s", "r:60:(scoped f => average (Measure.restrict volume s) f) => r @[simp] theorem average_zero : ⨍ _, (0 : E) ∂μ = 0 := by rw [average, integral_zero] #align measure_theory.average_zero MeasureTheory.average_zero @[simp] theorem average_zero_measure (f : α → E) : ⨍ x, f x ∂(0 : Measure α) = 0 := by rw [average, smul_zero, integral_zero_measure] #align measure_theory.average_zero_measure MeasureTheory.average_zero_measure @[simp] theorem average_neg (f : α → E) : ⨍ x, -f x ∂μ = -⨍ x, f x ∂μ := integral_neg f #align measure_theory.average_neg MeasureTheory.average_neg theorem average_eq' (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂(μ univ)⁻¹ • μ := rfl #align measure_theory.average_eq' MeasureTheory.average_eq' theorem average_eq (f : α → E) : ⨍ x, f x ∂μ = (μ univ).toReal⁻¹ • ∫ x, f x ∂μ := by rw [average_eq', integral_smul_measure, ENNReal.toReal_inv] #align measure_theory.average_eq MeasureTheory.average_eq theorem average_eq_integral [IsProbabilityMeasure μ] (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by rw [average, measure_univ, inv_one, one_smul] #align measure_theory.average_eq_integral MeasureTheory.average_eq_integral @[simp] theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) : (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by rcases eq_or_ne μ 0 with hμ | hμ · rw [hμ, integral_zero_measure, average_zero_measure, smul_zero] · rw [average_eq, smul_inv_smul₀] refine (ENNReal.toReal_pos ?_ <| measure_ne_top _ _).ne' rwa [Ne, measure_univ_eq_zero] #align measure_theory.measure_smul_average MeasureTheory.measure_smul_average theorem setAverage_eq (f : α → E) (s : Set α) : ⨍ x in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ x in s, f x ∂μ := by rw [average_eq, restrict_apply_univ] #align measure_theory.set_average_eq MeasureTheory.setAverage_eq theorem setAverage_eq' (f : α → E) (s : Set α) : ⨍ x in s, f x ∂μ = ∫ x, f x ∂(μ s)⁻¹ • μ.restrict s := by simp only [average_eq', restrict_apply_univ] #align measure_theory.set_average_eq' MeasureTheory.setAverage_eq' variable {μ} theorem average_congr {f g : α → E} (h : f =ᵐ[μ] g) : ⨍ x, f x ∂μ = ⨍ x, g x ∂μ := by simp only [average_eq, integral_congr_ae h] #align measure_theory.average_congr MeasureTheory.average_congr
Mathlib/MeasureTheory/Integral/Average.lean
365
366
theorem setAverage_congr (h : s =ᵐ[μ] t) : ⨍ x in s, f x ∂μ = ⨍ x in t, f x ∂μ := by
simp only [setAverage_eq, setIntegral_congr_set_ae h, measure_congr h]
import Mathlib.Geometry.Manifold.ContMDiff.Basic open Set ChartedSpace SmoothManifoldWithCorners open scoped Manifold variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] -- declare a smooth manifold `M` over the pair `(E, H)`. {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] {I : ModelWithCorners 𝕜 E H} {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] -- declare a smooth manifold `M'` over the pair `(E', H')`. {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] {I' : ModelWithCorners 𝕜 E' H'} {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [SmoothManifoldWithCorners I' M'] -- declare functions, sets, points and smoothness indices {e : PartialHomeomorph M H} {x : M} {m n : ℕ∞} section Atlas theorem contMDiff_model : ContMDiff I 𝓘(𝕜, E) n I := by intro x refine (contMDiffAt_iff _ _).mpr ⟨I.continuousAt, ?_⟩ simp only [mfld_simps] refine contDiffWithinAt_id.congr_of_eventuallyEq ?_ ?_ · exact Filter.eventuallyEq_of_mem self_mem_nhdsWithin fun x₂ => I.right_inv simp_rw [Function.comp_apply, I.left_inv, Function.id_def] #align cont_mdiff_model contMDiff_model theorem contMDiffOn_model_symm : ContMDiffOn 𝓘(𝕜, E) I n I.symm (range I) := by rw [contMDiffOn_iff] refine ⟨I.continuousOn_symm, fun x y => ?_⟩ simp only [mfld_simps] exact contDiffOn_id.congr fun x' => I.right_inv #align cont_mdiff_on_model_symm contMDiffOn_model_symm theorem contMDiffOn_of_mem_maximalAtlas (h : e ∈ maximalAtlas I M) : ContMDiffOn I I n e e.source := ContMDiffOn.of_le ((contDiffWithinAt_localInvariantProp I I ∞).liftPropOn_of_mem_maximalAtlas (contDiffWithinAtProp_id I) h) le_top #align cont_mdiff_on_of_mem_maximal_atlas contMDiffOn_of_mem_maximalAtlas theorem contMDiffOn_symm_of_mem_maximalAtlas (h : e ∈ maximalAtlas I M) : ContMDiffOn I I n e.symm e.target := ContMDiffOn.of_le ((contDiffWithinAt_localInvariantProp I I ∞).liftPropOn_symm_of_mem_maximalAtlas (contDiffWithinAtProp_id I) h) le_top #align cont_mdiff_on_symm_of_mem_maximal_atlas contMDiffOn_symm_of_mem_maximalAtlas theorem contMDiffAt_of_mem_maximalAtlas (h : e ∈ maximalAtlas I M) (hx : x ∈ e.source) : ContMDiffAt I I n e x := (contMDiffOn_of_mem_maximalAtlas h).contMDiffAt <| e.open_source.mem_nhds hx #align cont_mdiff_at_of_mem_maximal_atlas contMDiffAt_of_mem_maximalAtlas theorem contMDiffAt_symm_of_mem_maximalAtlas {x : H} (h : e ∈ maximalAtlas I M) (hx : x ∈ e.target) : ContMDiffAt I I n e.symm x := (contMDiffOn_symm_of_mem_maximalAtlas h).contMDiffAt <| e.open_target.mem_nhds hx #align cont_mdiff_at_symm_of_mem_maximal_atlas contMDiffAt_symm_of_mem_maximalAtlas theorem contMDiffOn_chart : ContMDiffOn I I n (chartAt H x) (chartAt H x).source := contMDiffOn_of_mem_maximalAtlas <| chart_mem_maximalAtlas I x #align cont_mdiff_on_chart contMDiffOn_chart theorem contMDiffOn_chart_symm : ContMDiffOn I I n (chartAt H x).symm (chartAt H x).target := contMDiffOn_symm_of_mem_maximalAtlas <| chart_mem_maximalAtlas I x #align cont_mdiff_on_chart_symm contMDiffOn_chart_symm theorem contMDiffAt_extend {x : M} (he : e ∈ maximalAtlas I M) (hx : x ∈ e.source) : ContMDiffAt I 𝓘(𝕜, E) n (e.extend I) x := (contMDiff_model _).comp x <| contMDiffAt_of_mem_maximalAtlas he hx #align cont_mdiff_at_extend contMDiffAt_extend theorem contMDiffAt_extChartAt' {x' : M} (h : x' ∈ (chartAt H x).source) : ContMDiffAt I 𝓘(𝕜, E) n (extChartAt I x) x' := contMDiffAt_extend (chart_mem_maximalAtlas I x) h #align cont_mdiff_at_ext_chart_at' contMDiffAt_extChartAt' theorem contMDiffAt_extChartAt : ContMDiffAt I 𝓘(𝕜, E) n (extChartAt I x) x := contMDiffAt_extChartAt' <| mem_chart_source H x #align cont_mdiff_at_ext_chart_at contMDiffAt_extChartAt theorem contMDiffOn_extChartAt : ContMDiffOn I 𝓘(𝕜, E) n (extChartAt I x) (chartAt H x).source := fun _x' hx' => (contMDiffAt_extChartAt' hx').contMDiffWithinAt #align cont_mdiff_on_ext_chart_at contMDiffOn_extChartAt
Mathlib/Geometry/Manifold/ContMDiff/Atlas.lean
105
110
theorem contMDiffOn_extend_symm (he : e ∈ maximalAtlas I M) : ContMDiffOn 𝓘(𝕜, E) I n (e.extend I).symm (I '' e.target) := by
refine (contMDiffOn_symm_of_mem_maximalAtlas he).comp (contMDiffOn_model_symm.mono <| image_subset_range _ _) ?_ simp_rw [image_subset_iff, PartialEquiv.restr_coe_symm, I.toPartialEquiv_coe_symm, preimage_preimage, I.left_inv, preimage_id']; rfl
import Mathlib.Algebra.IsPrimePow import Mathlib.NumberTheory.ArithmeticFunction import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import number_theory.von_mangoldt from "leanprover-community/mathlib"@"c946d6097a6925ad16d7ec55677bbc977f9846de" namespace ArithmeticFunction open Finset Nat open scoped ArithmeticFunction noncomputable def log : ArithmeticFunction ℝ := ⟨fun n => Real.log n, by simp⟩ #align nat.arithmetic_function.log ArithmeticFunction.log @[simp] theorem log_apply {n : ℕ} : log n = Real.log n := rfl #align nat.arithmetic_function.log_apply ArithmeticFunction.log_apply noncomputable def vonMangoldt : ArithmeticFunction ℝ := ⟨fun n => if IsPrimePow n then Real.log (minFac n) else 0, if_neg not_isPrimePow_zero⟩ #align nat.arithmetic_function.von_mangoldt ArithmeticFunction.vonMangoldt @[inherit_doc] scoped[ArithmeticFunction] notation "Λ" => ArithmeticFunction.vonMangoldt @[inherit_doc] scoped[ArithmeticFunction.vonMangoldt] notation "Λ" => ArithmeticFunction.vonMangoldt theorem vonMangoldt_apply {n : ℕ} : Λ n = if IsPrimePow n then Real.log (minFac n) else 0 := rfl #align nat.arithmetic_function.von_mangoldt_apply ArithmeticFunction.vonMangoldt_apply @[simp] theorem vonMangoldt_apply_one : Λ 1 = 0 := by simp [vonMangoldt_apply] #align nat.arithmetic_function.von_mangoldt_apply_one ArithmeticFunction.vonMangoldt_apply_one @[simp] theorem vonMangoldt_nonneg {n : ℕ} : 0 ≤ Λ n := by rw [vonMangoldt_apply] split_ifs · exact Real.log_nonneg (one_le_cast.2 (Nat.minFac_pos n)) rfl #align nat.arithmetic_function.von_mangoldt_nonneg ArithmeticFunction.vonMangoldt_nonneg theorem vonMangoldt_apply_pow {n k : ℕ} (hk : k ≠ 0) : Λ (n ^ k) = Λ n := by simp only [vonMangoldt_apply, isPrimePow_pow_iff hk, pow_minFac hk] #align nat.arithmetic_function.von_mangoldt_apply_pow ArithmeticFunction.vonMangoldt_apply_pow theorem vonMangoldt_apply_prime {p : ℕ} (hp : p.Prime) : Λ p = Real.log p := by rw [vonMangoldt_apply, Prime.minFac_eq hp, if_pos hp.prime.isPrimePow] #align nat.arithmetic_function.von_mangoldt_apply_prime ArithmeticFunction.vonMangoldt_apply_prime theorem vonMangoldt_ne_zero_iff {n : ℕ} : Λ n ≠ 0 ↔ IsPrimePow n := by rcases eq_or_ne n 1 with (rfl | hn); · simp [not_isPrimePow_one] exact (Real.log_pos (one_lt_cast.2 (minFac_prime hn).one_lt)).ne'.ite_ne_right_iff #align nat.arithmetic_function.von_mangoldt_ne_zero_iff ArithmeticFunction.vonMangoldt_ne_zero_iff theorem vonMangoldt_pos_iff {n : ℕ} : 0 < Λ n ↔ IsPrimePow n := vonMangoldt_nonneg.lt_iff_ne.trans (ne_comm.trans vonMangoldt_ne_zero_iff) #align nat.arithmetic_function.von_mangoldt_pos_iff ArithmeticFunction.vonMangoldt_pos_iff theorem vonMangoldt_eq_zero_iff {n : ℕ} : Λ n = 0 ↔ ¬IsPrimePow n := vonMangoldt_ne_zero_iff.not_right #align nat.arithmetic_function.von_mangoldt_eq_zero_iff ArithmeticFunction.vonMangoldt_eq_zero_iff theorem vonMangoldt_sum {n : ℕ} : ∑ i ∈ n.divisors, Λ i = Real.log n := by refine recOnPrimeCoprime ?_ ?_ ?_ n · simp · intro p k hp rw [sum_divisors_prime_pow hp, cast_pow, Real.log_pow, Finset.sum_range_succ', Nat.pow_zero, vonMangoldt_apply_one] simp [vonMangoldt_apply_pow (Nat.succ_ne_zero _), vonMangoldt_apply_prime hp] intro a b ha' hb' hab ha hb simp only [vonMangoldt_apply, ← sum_filter] at ha hb ⊢ rw [mul_divisors_filter_prime_pow hab, filter_union, sum_union (disjoint_divisors_filter_isPrimePow hab), ha, hb, Nat.cast_mul, Real.log_mul (cast_ne_zero.2 (pos_of_gt ha').ne') (cast_ne_zero.2 (pos_of_gt hb').ne')] #align nat.arithmetic_function.von_mangoldt_sum ArithmeticFunction.vonMangoldt_sum @[simp] theorem vonMangoldt_mul_zeta : Λ * ζ = log := by ext n; rw [coe_mul_zeta_apply, vonMangoldt_sum]; rfl #align nat.arithmetic_function.von_mangoldt_mul_zeta ArithmeticFunction.vonMangoldt_mul_zeta @[simp] theorem zeta_mul_vonMangoldt : (ζ : ArithmeticFunction ℝ) * Λ = log := by rw [mul_comm]; simp #align nat.arithmetic_function.zeta_mul_von_mangoldt ArithmeticFunction.zeta_mul_vonMangoldt @[simp] theorem log_mul_moebius_eq_vonMangoldt : log * μ = Λ := by rw [← vonMangoldt_mul_zeta, mul_assoc, coe_zeta_mul_coe_moebius, mul_one] #align nat.arithmetic_function.log_mul_moebius_eq_von_mangoldt ArithmeticFunction.log_mul_moebius_eq_vonMangoldt @[simp] theorem moebius_mul_log_eq_vonMangoldt : (μ : ArithmeticFunction ℝ) * log = Λ := by rw [mul_comm]; simp #align nat.arithmetic_function.moebius_mul_log_eq_von_mangoldt ArithmeticFunction.moebius_mul_log_eq_vonMangoldt
Mathlib/NumberTheory/VonMangoldt.lean
144
160
theorem sum_moebius_mul_log_eq {n : ℕ} : (∑ d ∈ n.divisors, (μ d : ℝ) * log d) = -Λ n := by
simp only [← log_mul_moebius_eq_vonMangoldt, mul_comm log, mul_apply, log_apply, intCoe_apply, ← Finset.sum_neg_distrib, neg_mul_eq_mul_neg] rw [sum_divisorsAntidiagonal fun i j => (μ i : ℝ) * -Real.log j] have : (∑ i ∈ n.divisors, (μ i : ℝ) * -Real.log (n / i : ℕ)) = ∑ i ∈ n.divisors, ((μ i : ℝ) * Real.log i - μ i * Real.log n) := by apply sum_congr rfl simp only [and_imp, Int.cast_eq_zero, mul_eq_mul_left_iff, Ne, neg_inj, mem_divisors] intro m mn hn have : (m : ℝ) ≠ 0 := by rw [cast_ne_zero] rintro rfl exact hn (by simpa using mn) rw [Nat.cast_div mn this, Real.log_div (cast_ne_zero.2 hn) this, neg_sub, mul_sub] rw [this, sum_sub_distrib, ← sum_mul, ← Int.cast_sum, ← coe_mul_zeta_apply, eq_comm, sub_eq_self, moebius_mul_coe_zeta] rcases eq_or_ne n 1 with (hn | hn) <;> simp [hn]
import Mathlib.Analysis.NormedSpace.Banach import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Topology.PartialHomeomorph #align_import analysis.calculus.inverse from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open Function Set Filter Metric open scoped Topology Classical NNReal noncomputable section variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace 𝕜 G'] variable {ε : ℝ} open Filter Metric Set open ContinuousLinearMap (id) def ApproximatesLinearOn (f : E → F) (f' : E →L[𝕜] F) (s : Set E) (c : ℝ≥0) : Prop := ∀ x ∈ s, ∀ y ∈ s, ‖f x - f y - f' (x - y)‖ ≤ c * ‖x - y‖ #align approximates_linear_on ApproximatesLinearOn @[simp] theorem approximatesLinearOn_empty (f : E → F) (f' : E →L[𝕜] F) (c : ℝ≥0) : ApproximatesLinearOn f f' ∅ c := by simp [ApproximatesLinearOn] #align approximates_linear_on_empty approximatesLinearOn_empty namespace ApproximatesLinearOn variable [CompleteSpace E] {f : E → F} section variable {f' : E →L[𝕜] F} {s t : Set E} {c c' : ℝ≥0} theorem mono_num (hc : c ≤ c') (hf : ApproximatesLinearOn f f' s c) : ApproximatesLinearOn f f' s c' := fun x hx y hy => le_trans (hf x hx y hy) (mul_le_mul_of_nonneg_right hc <| norm_nonneg _) #align approximates_linear_on.mono_num ApproximatesLinearOn.mono_num theorem mono_set (hst : s ⊆ t) (hf : ApproximatesLinearOn f f' t c) : ApproximatesLinearOn f f' s c := fun x hx y hy => hf x (hst hx) y (hst hy) #align approximates_linear_on.mono_set ApproximatesLinearOn.mono_set
Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean
101
105
theorem approximatesLinearOn_iff_lipschitzOnWith {f : E → F} {f' : E →L[𝕜] F} {s : Set E} {c : ℝ≥0} : ApproximatesLinearOn f f' s c ↔ LipschitzOnWith c (f - ⇑f') s := by
have : ∀ x y, f x - f y - f' (x - y) = (f - f') x - (f - f') y := fun x y ↦ by simp only [map_sub, Pi.sub_apply]; abel simp only [this, lipschitzOnWith_iff_norm_sub_le, ApproximatesLinearOn]
import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Rearrangement import Mathlib.Algebra.Order.Ring.Basic import Mathlib.GroupTheory.Perm.Cycle.Basic #align_import algebra.order.chebyshev from "leanprover-community/mathlib"@"b7399344324326918d65d0c74e9571e3a8cb9199" open Equiv Equiv.Perm Finset Function OrderDual variable {ι α β : Type*} section SMul variable [LinearOrderedRing α] [LinearOrderedAddCommGroup β] [Module α β] [OrderedSMul α β] {s : Finset ι} {σ : Perm ι} {f : ι → α} {g : ι → β}
Mathlib/Algebra/Order/Chebyshev.lean
57
64
theorem MonovaryOn.sum_smul_sum_le_card_smul_sum (hfg : MonovaryOn f g s) : ((∑ i ∈ s, f i) • ∑ i ∈ s, g i) ≤ s.card • ∑ i ∈ s, f i • g i := by
classical obtain ⟨σ, hσ, hs⟩ := s.countable_toSet.exists_cycleOn rw [← card_range s.card, sum_smul_sum_eq_sum_perm hσ] exact sum_le_card_nsmul _ _ _ fun n _ => hfg.sum_smul_comp_perm_le_sum_smul fun x hx => hs fun h => hx <| IsFixedPt.perm_pow h _
import Mathlib.LinearAlgebra.CliffordAlgebra.Basic import Mathlib.LinearAlgebra.Alternating.Basic #align_import linear_algebra.exterior_algebra.basic from "leanprover-community/mathlib"@"b8d2eaa69d69ce8f03179a5cda774fc0cde984e4" universe u1 u2 u3 u4 u5 variable (R : Type u1) [CommRing R] variable (M : Type u2) [AddCommGroup M] [Module R M] abbrev ExteriorAlgebra := CliffordAlgebra (0 : QuadraticForm R M) #align exterior_algebra ExteriorAlgebra namespace ExteriorAlgebra variable {M} abbrev ι : M →ₗ[R] ExteriorAlgebra R M := CliffordAlgebra.ι _ #align exterior_algebra.ι ExteriorAlgebra.ι variable {R} -- @[simp] -- Porting note (#10618): simp can prove this theorem ι_sq_zero (m : M) : ι R m * ι R m = 0 := (CliffordAlgebra.ι_sq_scalar _ m).trans <| map_zero _ #align exterior_algebra.ι_sq_zero ExteriorAlgebra.ι_sq_zero variable {A : Type*} [Semiring A] [Algebra R A] -- @[simp] -- Porting note (#10618): simp can prove this
Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean
97
98
theorem comp_ι_sq_zero (g : ExteriorAlgebra R M →ₐ[R] A) (m : M) : g (ι R m) * g (ι R m) = 0 := by
rw [← AlgHom.map_mul, ι_sq_zero, AlgHom.map_zero]
import Mathlib.Algebra.Group.Hom.Defs #align_import algebra.group.ext from "leanprover-community/mathlib"@"e574b1a4e891376b0ef974b926da39e05da12a06" assert_not_exists MonoidWithZero assert_not_exists DenselyOrdered open Function universe u @[to_additive (attr := ext)] theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂ := by have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul have h₁ : m₁.one = m₂.one := congr_arg (·.one) this let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass := @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁) (fun x y => congr_fun (congr_fun h_mul x) y) have : m₁.npow = m₂.npow := by ext n x exact @MonoidHom.map_pow M M m₁ m₂ f x n rcases m₁ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩ rcases m₂ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩ congr #align monoid.ext Monoid.ext #align add_monoid.ext AddMonoid.ext @[to_additive]
Mathlib/Algebra/Group/Ext.lean
56
59
theorem CommMonoid.toMonoid_injective {M : Type u} : Function.Injective (@CommMonoid.toMonoid M) := by
rintro ⟨⟩ ⟨⟩ h congr
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.FreeModule.Finite.Basic import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition import Mathlib.LinearAlgebra.Projection import Mathlib.LinearAlgebra.SesquilinearForm import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.RingTheory.Ideal.LocalRing #align_import linear_algebra.dual from "leanprover-community/mathlib"@"b1c017582e9f18d8494e5c18602a8cb4a6f843ac" noncomputable section namespace Module -- Porting note: max u v universe issues so name and specific below universe uR uA uM uM' uM'' variable (R : Type uR) (A : Type uA) (M : Type uM) variable [CommSemiring R] [AddCommMonoid M] [Module R M] abbrev Dual := M →ₗ[R] R #align module.dual Module.Dual def dualPairing (R M) [CommSemiring R] [AddCommMonoid M] [Module R M] : Module.Dual R M →ₗ[R] M →ₗ[R] R := LinearMap.id #align module.dual_pairing Module.dualPairing @[simp] theorem dualPairing_apply (v x) : dualPairing R M v x = v x := rfl #align module.dual_pairing_apply Module.dualPairing_apply namespace Dual instance : Inhabited (Dual R M) := ⟨0⟩ def eval : M →ₗ[R] Dual R (Dual R M) := LinearMap.flip LinearMap.id #align module.dual.eval Module.Dual.eval @[simp] theorem eval_apply (v : M) (a : Dual R M) : eval R M v a = a v := rfl #align module.dual.eval_apply Module.Dual.eval_apply variable {R M} {M' : Type uM'} variable [AddCommMonoid M'] [Module R M'] def transpose : (M →ₗ[R] M') →ₗ[R] Dual R M' →ₗ[R] Dual R M := (LinearMap.llcomp R M M' R).flip #align module.dual.transpose Module.Dual.transpose -- Porting note: with reducible def need to specify some parameters to transpose explicitly theorem transpose_apply (u : M →ₗ[R] M') (l : Dual R M') : transpose (R := R) u l = l.comp u := rfl #align module.dual.transpose_apply Module.Dual.transpose_apply variable {M'' : Type uM''} [AddCommMonoid M''] [Module R M''] -- Porting note: with reducible def need to specify some parameters to transpose explicitly theorem transpose_comp (u : M' →ₗ[R] M'') (v : M →ₗ[R] M') : transpose (R := R) (u.comp v) = (transpose (R := R) v).comp (transpose (R := R) u) := rfl #align module.dual.transpose_comp Module.Dual.transpose_comp end Dual section Prod variable (M' : Type uM') [AddCommMonoid M'] [Module R M'] @[simps!] def dualProdDualEquivDual : (Module.Dual R M × Module.Dual R M') ≃ₗ[R] Module.Dual R (M × M') := LinearMap.coprodEquiv R #align module.dual_prod_dual_equiv_dual Module.dualProdDualEquivDual @[simp] theorem dualProdDualEquivDual_apply (φ : Module.Dual R M) (ψ : Module.Dual R M') : dualProdDualEquivDual R M M' (φ, ψ) = φ.coprod ψ := rfl #align module.dual_prod_dual_equiv_dual_apply Module.dualProdDualEquivDual_apply end Prod end Module namespace Basis universe u v w open Module Module.Dual Submodule LinearMap Cardinal Function universe uR uM uK uV uι variable {R : Type uR} {M : Type uM} {K : Type uK} {V : Type uV} {ι : Type uι} section CommSemiring variable [CommSemiring R] [AddCommMonoid M] [Module R M] [DecidableEq ι] variable (b : Basis ι R M) def toDual : M →ₗ[R] Module.Dual R M := b.constr ℕ fun v => b.constr ℕ fun w => if w = v then (1 : R) else 0 #align basis.to_dual Basis.toDual
Mathlib/LinearAlgebra/Dual.lean
303
305
theorem toDual_apply (i j : ι) : b.toDual (b i) (b j) = if i = j then 1 else 0 := by
erw [constr_basis b, constr_basis b] simp only [eq_comm]
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 Pullback variable {C : Type u₁} [Category.{v₁} C] variable {D : Type u₂} [Category.{v₂} D] variable (G : C ⥤ D) variable {W X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} {h : W ⟶ X} {k : W ⟶ Y} (comm : h ≫ f = k ≫ g) def isLimitMapConePullbackConeEquiv : IsLimit (mapCone G (PullbackCone.mk h k comm)) ≃ IsLimit (PullbackCone.mk (G.map h) (G.map k) (by simp only [← G.map_comp, comm]) : PullbackCone (G.map f) (G.map g)) := (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{v₂} _) _).symm.trans <| IsLimit.equivIsoLimit <| Cones.ext (Iso.refl _) <| by rintro (_ | _ | _) <;> dsimp <;> simp only [comp_id, id_comp, G.map_comp] #align category_theory.limits.is_limit_map_cone_pullback_cone_equiv CategoryTheory.Limits.isLimitMapConePullbackConeEquiv def isLimitPullbackConeMapOfIsLimit [PreservesLimit (cospan f g) G] (l : IsLimit (PullbackCone.mk h k comm)) : have : G.map h ≫ G.map f = G.map k ≫ G.map g := by rw [← G.map_comp, ← G.map_comp,comm] IsLimit (PullbackCone.mk (G.map h) (G.map k) this) := isLimitMapConePullbackConeEquiv G comm (PreservesLimit.preserves l) #align category_theory.limits.is_limit_pullback_cone_map_of_is_limit CategoryTheory.Limits.isLimitPullbackConeMapOfIsLimit def isLimitOfIsLimitPullbackConeMap [ReflectsLimit (cospan f g) G] (l : IsLimit (PullbackCone.mk (G.map h) (G.map k) (show G.map h ≫ G.map f = G.map k ≫ G.map g from by simp only [← G.map_comp,comm]))) : IsLimit (PullbackCone.mk h k comm) := ReflectsLimit.reflects ((isLimitMapConePullbackConeEquiv G comm).symm l) #align category_theory.limits.is_limit_of_is_limit_pullback_cone_map CategoryTheory.Limits.isLimitOfIsLimitPullbackConeMap variable (f g) [PreservesLimit (cospan f g) G] def isLimitOfHasPullbackOfPreservesLimit [i : HasPullback f g] : have : G.map pullback.fst ≫ G.map f = G.map pullback.snd ≫ G.map g := by simp only [← G.map_comp, pullback.condition]; IsLimit (PullbackCone.mk (G.map (@pullback.fst _ _ _ _ _ f g i)) (G.map pullback.snd) this) := isLimitPullbackConeMapOfIsLimit G _ (pullbackIsPullback f g) #align category_theory.limits.is_limit_of_has_pullback_of_preserves_limit CategoryTheory.Limits.isLimitOfHasPullbackOfPreservesLimit def preservesPullbackSymmetry : PreservesLimit (cospan g f) G where preserves {c} hc := by apply (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{v₂} _) _).toFun apply IsLimit.ofIsoLimit _ (PullbackCone.isoMk _).symm apply PullbackCone.isLimitOfFlip apply (isLimitMapConePullbackConeEquiv _ _).toFun · refine @PreservesLimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_ · dsimp infer_instance apply PullbackCone.isLimitOfFlip apply IsLimit.ofIsoLimit _ (PullbackCone.isoMk _) exact (IsLimit.postcomposeHomEquiv (diagramIsoCospan.{v₁} _) _).invFun hc · exact (c.π.naturality WalkingCospan.Hom.inr).symm.trans (c.π.naturality WalkingCospan.Hom.inl : _) #align category_theory.limits.preserves_pullback_symmetry CategoryTheory.Limits.preservesPullbackSymmetry theorem hasPullback_of_preservesPullback [HasPullback f g] : HasPullback (G.map f) (G.map g) := ⟨⟨⟨_, isLimitPullbackConeMapOfIsLimit G _ (pullbackIsPullback _ _)⟩⟩⟩ #align category_theory.limits.has_pullback_of_preserves_pullback CategoryTheory.Limits.hasPullback_of_preservesPullback variable [HasPullback f g] [HasPullback (G.map f) (G.map g)] def PreservesPullback.iso : G.obj (pullback f g) ≅ pullback (G.map f) (G.map g) := IsLimit.conePointUniqueUpToIso (isLimitOfHasPullbackOfPreservesLimit G f g) (limit.isLimit _) #align category_theory.limits.preserves_pullback.iso CategoryTheory.Limits.PreservesPullback.iso @[simp] theorem PreservesPullback.iso_hom : (PreservesPullback.iso G f g).hom = pullbackComparison G f g := rfl #align category_theory.limits.preserves_pullback.iso_hom CategoryTheory.Limits.PreservesPullback.iso_hom @[reassoc] theorem PreservesPullback.iso_hom_fst : (PreservesPullback.iso G f g).hom ≫ pullback.fst = G.map pullback.fst := by simp [PreservesPullback.iso] #align category_theory.limits.preserves_pullback.iso_hom_fst CategoryTheory.Limits.PreservesPullback.iso_hom_fst @[reassoc] theorem PreservesPullback.iso_hom_snd : (PreservesPullback.iso G f g).hom ≫ pullback.snd = G.map pullback.snd := by simp [PreservesPullback.iso] #align category_theory.limits.preserves_pullback.iso_hom_snd CategoryTheory.Limits.PreservesPullback.iso_hom_snd @[reassoc (attr := simp)] theorem PreservesPullback.iso_inv_fst : (PreservesPullback.iso G f g).inv ≫ G.map pullback.fst = pullback.fst := by simp [PreservesPullback.iso, Iso.inv_comp_eq] #align category_theory.limits.preserves_pullback.iso_inv_fst CategoryTheory.Limits.PreservesPullback.iso_inv_fst @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean
138
140
theorem PreservesPullback.iso_inv_snd : (PreservesPullback.iso G f g).inv ≫ G.map pullback.snd = pullback.snd := by
simp [PreservesPullback.iso, Iso.inv_comp_eq]
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Reverse import Mathlib.Algebra.Polynomial.Inductions import Mathlib.RingTheory.Localization.Basic #align_import data.polynomial.laurent from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" open Polynomial Function AddMonoidAlgebra Finsupp noncomputable section variable {R : Type*} abbrev LaurentPolynomial (R : Type*) [Semiring R] := AddMonoidAlgebra R ℤ #align laurent_polynomial LaurentPolynomial @[nolint docBlame] scoped[LaurentPolynomial] notation:9000 R "[T;T⁻¹]" => LaurentPolynomial R open LaurentPolynomial -- Porting note: `ext` no longer applies `Finsupp.ext` automatically @[ext] theorem LaurentPolynomial.ext [Semiring R] {p q : R[T;T⁻¹]} (h : ∀ a, p a = q a) : p = q := Finsupp.ext h def Polynomial.toLaurent [Semiring R] : R[X] →+* R[T;T⁻¹] := (mapDomainRingHom R Int.ofNatHom).comp (toFinsuppIso R) #align polynomial.to_laurent Polynomial.toLaurent theorem Polynomial.toLaurent_apply [Semiring R] (p : R[X]) : toLaurent p = p.toFinsupp.mapDomain (↑) := rfl #align polynomial.to_laurent_apply Polynomial.toLaurent_apply def Polynomial.toLaurentAlg [CommSemiring R] : R[X] →ₐ[R] R[T;T⁻¹] := (mapDomainAlgHom R R Int.ofNatHom).comp (toFinsuppIsoAlg R).toAlgHom #align polynomial.to_laurent_alg Polynomial.toLaurentAlg @[simp] lemma Polynomial.coe_toLaurentAlg [CommSemiring R] : (toLaurentAlg : R[X] → R[T;T⁻¹]) = toLaurent := rfl theorem Polynomial.toLaurentAlg_apply [CommSemiring R] (f : R[X]) : toLaurentAlg f = toLaurent f := rfl #align polynomial.to_laurent_alg_apply Polynomial.toLaurentAlg_apply namespace LaurentPolynomial section Semiring variable [Semiring R] theorem single_zero_one_eq_one : (Finsupp.single 0 1 : R[T;T⁻¹]) = (1 : R[T;T⁻¹]) := rfl #align laurent_polynomial.single_zero_one_eq_one LaurentPolynomial.single_zero_one_eq_one def C : R →+* R[T;T⁻¹] := singleZeroRingHom set_option linter.uppercaseLean3 false in #align laurent_polynomial.C LaurentPolynomial.C theorem algebraMap_apply {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] (r : R) : algebraMap R (LaurentPolynomial A) r = C (algebraMap R A r) := rfl #align laurent_polynomial.algebra_map_apply LaurentPolynomial.algebraMap_apply theorem C_eq_algebraMap {R : Type*} [CommSemiring R] (r : R) : C r = algebraMap R R[T;T⁻¹] r := rfl set_option linter.uppercaseLean3 false in #align laurent_polynomial.C_eq_algebra_map LaurentPolynomial.C_eq_algebraMap theorem single_eq_C (r : R) : Finsupp.single 0 r = C r := rfl set_option linter.uppercaseLean3 false in #align laurent_polynomial.single_eq_C LaurentPolynomial.single_eq_C @[simp] lemma C_apply (t : R) (n : ℤ) : C t n = if n = 0 then t else 0 := by rw [← single_eq_C, Finsupp.single_apply]; aesop def T (n : ℤ) : R[T;T⁻¹] := Finsupp.single n 1 set_option linter.uppercaseLean3 false in #align laurent_polynomial.T LaurentPolynomial.T @[simp] lemma T_apply (m n : ℤ) : (T n : R[T;T⁻¹]) m = if n = m then 1 else 0 := Finsupp.single_apply @[simp] theorem T_zero : (T 0 : R[T;T⁻¹]) = 1 := rfl set_option linter.uppercaseLean3 false in #align laurent_polynomial.T_zero LaurentPolynomial.T_zero
Mathlib/Algebra/Polynomial/Laurent.lean
185
187
theorem T_add (m n : ℤ) : (T (m + n) : R[T;T⁻¹]) = T m * T n := by
-- Porting note: was `convert single_mul_single.symm` simp [T, single_mul_single]
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Monic #align_import data.polynomial.lifts from "leanprover-community/mathlib"@"63417e01fbc711beaf25fa73b6edb395c0cfddd0" open Polynomial noncomputable section namespace Polynomial universe u v w section Semiring variable {R : Type u} [Semiring R] {S : Type v} [Semiring S] {f : R →+* S} def lifts (f : R →+* S) : Subsemiring S[X] := RingHom.rangeS (mapRingHom f) #align polynomial.lifts Polynomial.lifts theorem mem_lifts (p : S[X]) : p ∈ lifts f ↔ ∃ q : R[X], map f q = p := by simp only [coe_mapRingHom, lifts, RingHom.mem_rangeS] #align polynomial.mem_lifts Polynomial.mem_lifts theorem lifts_iff_set_range (p : S[X]) : p ∈ lifts f ↔ p ∈ Set.range (map f) := by simp only [coe_mapRingHom, lifts, Set.mem_range, RingHom.mem_rangeS] #align polynomial.lifts_iff_set_range Polynomial.lifts_iff_set_range theorem lifts_iff_ringHom_rangeS (p : S[X]) : p ∈ lifts f ↔ p ∈ (mapRingHom f).rangeS := by simp only [coe_mapRingHom, lifts, Set.mem_range, RingHom.mem_rangeS] #align polynomial.lifts_iff_ring_hom_srange Polynomial.lifts_iff_ringHom_rangeS theorem lifts_iff_coeff_lifts (p : S[X]) : p ∈ lifts f ↔ ∀ n : ℕ, p.coeff n ∈ Set.range f := by rw [lifts_iff_ringHom_rangeS, mem_map_rangeS f] rfl #align polynomial.lifts_iff_coeff_lifts Polynomial.lifts_iff_coeff_lifts theorem C_mem_lifts (f : R →+* S) (r : R) : C (f r) ∈ lifts f := ⟨C r, by simp only [coe_mapRingHom, map_C, Set.mem_univ, Subsemiring.coe_top, eq_self_iff_true, and_self_iff]⟩ set_option linter.uppercaseLean3 false in #align polynomial.C_mem_lifts Polynomial.C_mem_lifts theorem C'_mem_lifts {f : R →+* S} {s : S} (h : s ∈ Set.range f) : C s ∈ lifts f := by obtain ⟨r, rfl⟩ := Set.mem_range.1 h use C r simp only [coe_mapRingHom, map_C, Set.mem_univ, Subsemiring.coe_top, eq_self_iff_true, and_self_iff] set_option linter.uppercaseLean3 false in #align polynomial.C'_mem_lifts Polynomial.C'_mem_lifts theorem X_mem_lifts (f : R →+* S) : (X : S[X]) ∈ lifts f := ⟨X, by simp only [coe_mapRingHom, Set.mem_univ, Subsemiring.coe_top, eq_self_iff_true, map_X, and_self_iff]⟩ set_option linter.uppercaseLean3 false in #align polynomial.X_mem_lifts Polynomial.X_mem_lifts theorem X_pow_mem_lifts (f : R →+* S) (n : ℕ) : (X ^ n : S[X]) ∈ lifts f := ⟨X ^ n, by simp only [coe_mapRingHom, map_pow, Set.mem_univ, Subsemiring.coe_top, eq_self_iff_true, map_X, and_self_iff]⟩ set_option linter.uppercaseLean3 false in #align polynomial.X_pow_mem_lifts Polynomial.X_pow_mem_lifts theorem base_mul_mem_lifts {p : S[X]} (r : R) (hp : p ∈ lifts f) : C (f r) * p ∈ lifts f := by simp only [lifts, RingHom.mem_rangeS] at hp ⊢ obtain ⟨p₁, rfl⟩ := hp use C r * p₁ simp only [coe_mapRingHom, map_C, map_mul] #align polynomial.base_mul_mem_lifts Polynomial.base_mul_mem_lifts theorem monomial_mem_lifts {s : S} (n : ℕ) (h : s ∈ Set.range f) : monomial n s ∈ lifts f := by obtain ⟨r, rfl⟩ := Set.mem_range.1 h use monomial n r simp only [coe_mapRingHom, Set.mem_univ, map_monomial, Subsemiring.coe_top, eq_self_iff_true, and_self_iff] #align polynomial.monomial_mem_lifts Polynomial.monomial_mem_lifts theorem erase_mem_lifts {p : S[X]} (n : ℕ) (h : p ∈ lifts f) : p.erase n ∈ lifts f := by rw [lifts_iff_ringHom_rangeS, mem_map_rangeS] at h ⊢ intro k by_cases hk : k = n · use 0 simp only [hk, RingHom.map_zero, erase_same] obtain ⟨i, hi⟩ := h k use i simp only [hi, hk, erase_ne, Ne, not_false_iff] #align polynomial.erase_mem_lifts Polynomial.erase_mem_lifts section Algebra variable {R : Type u} [CommSemiring R] {S : Type v} [Semiring S] [Algebra R S] def mapAlg (R : Type u) [CommSemiring R] (S : Type v) [Semiring S] [Algebra R S] : R[X] →ₐ[R] S[X] := @aeval _ S[X] _ _ _ (X : S[X]) #align polynomial.map_alg Polynomial.mapAlg theorem mapAlg_eq_map (p : R[X]) : mapAlg R S p = map (algebraMap R S) p := by simp only [mapAlg, aeval_def, eval₂_eq_sum, map, algebraMap_apply, RingHom.coe_comp] ext; congr #align polynomial.map_alg_eq_map Polynomial.mapAlg_eq_map
Mathlib/Algebra/Polynomial/Lifts.lean
280
282
theorem mem_lifts_iff_mem_alg (R : Type u) [CommSemiring R] {S : Type v} [Semiring S] [Algebra R S] (p : S[X]) : p ∈ lifts (algebraMap R S) ↔ p ∈ AlgHom.range (@mapAlg R _ S _ _) := by
simp only [coe_mapRingHom, lifts, mapAlg_eq_map, AlgHom.mem_range, RingHom.mem_rangeS]
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Factorial.DoubleFactorial #align_import ring_theory.polynomial.hermite.basic from "leanprover-community/mathlib"@"938d3db9c278f8a52c0f964a405806f0f2b09b74" noncomputable section open Polynomial namespace Polynomial noncomputable def hermite : ℕ → Polynomial ℤ | 0 => 1 | n + 1 => X * hermite n - derivative (hermite n) #align polynomial.hermite Polynomial.hermite @[simp] theorem hermite_succ (n : ℕ) : hermite (n + 1) = X * hermite n - derivative (hermite n) := by rw [hermite] #align polynomial.hermite_succ Polynomial.hermite_succ theorem hermite_eq_iterate (n : ℕ) : hermite n = (fun p => X * p - derivative p)^[n] 1 := by induction' n with n ih · rfl · rw [Function.iterate_succ_apply', ← ih, hermite_succ] #align polynomial.hermite_eq_iterate Polynomial.hermite_eq_iterate @[simp] theorem hermite_zero : hermite 0 = C 1 := rfl #align polynomial.hermite_zero Polynomial.hermite_zero -- Porting note (#10618): There was initially @[simp] on this line but it was removed -- because simp can prove this theorem theorem hermite_one : hermite 1 = X := by rw [hermite_succ, hermite_zero] simp only [map_one, mul_one, derivative_one, sub_zero] #align polynomial.hermite_one Polynomial.hermite_one section coeff theorem coeff_hermite_succ_zero (n : ℕ) : coeff (hermite (n + 1)) 0 = -coeff (hermite n) 1 := by simp [coeff_derivative] #align polynomial.coeff_hermite_succ_zero Polynomial.coeff_hermite_succ_zero theorem coeff_hermite_succ_succ (n k : ℕ) : coeff (hermite (n + 1)) (k + 1) = coeff (hermite n) k - (k + 2) * coeff (hermite n) (k + 2) := by rw [hermite_succ, coeff_sub, coeff_X_mul, coeff_derivative, mul_comm] norm_cast #align polynomial.coeff_hermite_succ_succ Polynomial.coeff_hermite_succ_succ
Mathlib/RingTheory/Polynomial/Hermite/Basic.lean
92
99
theorem coeff_hermite_of_lt {n k : ℕ} (hnk : n < k) : coeff (hermite n) k = 0 := by
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_lt hnk clear hnk induction' n with n ih generalizing k · apply coeff_C · have : n + k + 1 + 2 = n + (k + 2) + 1 := by ring rw [coeff_hermite_succ_succ, add_right_comm, this, ih k, ih (k + 2), mul_zero, sub_zero]
import Mathlib.Analysis.SpecialFunctions.Complex.LogBounds namespace Complex open scoped Real noncomputable def arctan (z : ℂ) : ℂ := -I / 2 * log ((1 + z * I) / (1 - z * I))
Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean
26
46
theorem tan_arctan {z : ℂ} (h₁ : z ≠ I) (h₂ : z ≠ -I) : tan (arctan z) = z := by
unfold tan sin cos rw [div_div_eq_mul_div, div_mul_cancel₀ _ two_ne_zero, ← div_mul_eq_mul_div, -- multiply top and bottom by `exp (arctan z * I)` ← mul_div_mul_right _ _ (exp_ne_zero (arctan z * I)), sub_mul, add_mul, ← exp_add, neg_mul, add_left_neg, exp_zero, ← exp_add, ← two_mul] have z₁ : 1 + z * I ≠ 0 := by contrapose! h₁ rw [add_eq_zero_iff_neg_eq, ← div_eq_iff I_ne_zero, div_I, neg_one_mul, neg_neg] at h₁ exact h₁.symm have z₂ : 1 - z * I ≠ 0 := by contrapose! h₂ rw [sub_eq_zero, ← div_eq_iff I_ne_zero, div_I, one_mul] at h₂ exact h₂.symm have key : exp (2 * (arctan z * I)) = (1 + z * I) / (1 - z * I) := by rw [arctan, ← mul_rotate, ← mul_assoc, show 2 * (I * (-I / 2)) = 1 by field_simp, one_mul, exp_log] · exact div_ne_zero z₁ z₂ -- multiply top and bottom by `1 - z * I` rw [key, ← mul_div_mul_right _ _ z₂, sub_mul, add_mul, div_mul_cancel₀ _ z₂, one_mul, show _ / _ * I = -(I * I) * z by ring, I_mul_I, neg_neg, one_mul]
import Mathlib.CategoryTheory.Galois.Basic import Mathlib.RepresentationTheory.Action.Basic import Mathlib.RepresentationTheory.Action.Concrete import Mathlib.RepresentationTheory.Action.Limits import Mathlib.CategoryTheory.Limits.FintypeCat import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Logic.Equiv.TransferInstance universe u v w namespace CategoryTheory namespace FintypeCat open Limits Functor PreGaloisCategory noncomputable def imageComplement {X Y : FintypeCat.{u}} (f : X ⟶ Y) : FintypeCat.{u} := by haveI : Fintype (↑(Set.range f)ᶜ) := Fintype.ofFinite _ exact FintypeCat.of (↑(Set.range f)ᶜ) def imageComplementIncl {X Y : FintypeCat.{u}} (f : X ⟶ Y) : imageComplement f ⟶ Y := Subtype.val variable (G : Type u) [Group G] noncomputable def Action.imageComplement {X Y : Action FintypeCat (MonCat.of G)} (f : X ⟶ Y) : Action FintypeCat (MonCat.of G) where V := FintypeCat.imageComplement f.hom ρ := MonCat.ofHom <| { toFun := fun g y ↦ Subtype.mk (Y.ρ g y.val) <| by intro ⟨x, h⟩ apply y.property use X.ρ g⁻¹ x calc (X.ρ g⁻¹ ≫ f.hom) x = (Y.ρ g⁻¹ * Y.ρ g) y.val := by rw [f.comm, FintypeCat.comp_apply, h]; rfl _ = y.val := by rw [← map_mul, mul_left_inv, Action.ρ_one, FintypeCat.id_apply] map_one' := by simp only [Action.ρ_one]; rfl map_mul' := fun g h ↦ FintypeCat.hom_ext _ _ <| fun y ↦ Subtype.ext <| by exact congrFun (MonoidHom.map_mul Y.ρ g h) y.val } def Action.imageComplementIncl {X Y : Action FintypeCat (MonCat.of G)} (f : X ⟶ Y) : Action.imageComplement G f ⟶ Y where hom := FintypeCat.imageComplementIncl f.hom comm _ := rfl instance {X Y : Action FintypeCat (MonCat.of G)} (f : X ⟶ Y) : Mono (Action.imageComplementIncl G f) := by apply Functor.mono_of_mono_map (forget _) apply ConcreteCategory.mono_of_injective exact Subtype.val_injective instance [Finite G] : HasColimitsOfShape (SingleObj G) FintypeCat.{w} := by obtain ⟨G', hg, hf, ⟨e⟩⟩ := Finite.exists_type_zero_nonempty_mulEquiv G exact Limits.hasColimitsOfShape_of_equivalence e.toSingleObjEquiv.symm noncomputable instance : PreservesFiniteLimits (forget (Action FintypeCat (MonCat.of G))) := by show PreservesFiniteLimits (Action.forget FintypeCat _ ⋙ FintypeCat.incl) apply compPreservesFiniteLimits instance : PreGaloisCategory (Action FintypeCat (MonCat.of G)) where hasQuotientsByFiniteGroups G _ _ := inferInstance monoInducesIsoOnDirectSummand {X Y} i h := ⟨Action.imageComplement G i, Action.imageComplementIncl G i, ⟨isColimitOfReflects (Action.forget _ _ ⋙ FintypeCat.incl) <| (isColimitMapCoconeBinaryCofanEquiv (forget _) i _).symm (Types.isCoprodOfMono ((forget _).map i))⟩⟩ noncomputable instance : FiberFunctor (Action.forget FintypeCat (MonCat.of G)) where preservesFiniteCoproducts := ⟨fun _ _ ↦ inferInstance⟩ preservesQuotientsByFiniteGroups _ _ _ := inferInstance reflectsIsos := ⟨fun f (h : IsIso f.hom) => inferInstance⟩ instance : GaloisCategory (Action FintypeCat (MonCat.of G)) where hasFiberFunctor := ⟨Action.forget FintypeCat (MonCat.of G), ⟨inferInstance⟩⟩
Mathlib/CategoryTheory/Galois/Examples.lean
104
124
theorem Action.pretransitive_of_isConnected (X : Action FintypeCat (MonCat.of G)) [IsConnected X] : MulAction.IsPretransitive G X.V where exists_smul_eq x y := by
/- We show that the `G`-orbit of `x` is a non-initial subobject of `X` and hence by connectedness, the orbit equals `X.V`. -/ let T : Set X.V := MulAction.orbit G x have : Fintype T := Fintype.ofFinite T letI : MulAction G (FintypeCat.of T) := inferInstanceAs <| MulAction G ↑(MulAction.orbit G x) let T' : Action FintypeCat (MonCat.of G) := Action.FintypeCat.ofMulAction G (FintypeCat.of T) let i : T' ⟶ X := ⟨Subtype.val, fun _ ↦ rfl⟩ have : Mono i := ConcreteCategory.mono_of_injective _ (Subtype.val_injective) have : IsIso i := by apply IsConnected.noTrivialComponent T' i apply (not_initial_iff_fiber_nonempty (Action.forget _ _) T').mpr exact Set.Nonempty.coe_sort (MulAction.orbit_nonempty x) have hb : Function.Bijective i.hom := by apply (ConcreteCategory.isIso_iff_bijective i.hom).mp exact map_isIso (forget₂ _ FintypeCat) i obtain ⟨⟨y', ⟨g, (hg : g • x = y')⟩⟩, (hy' : y' = y)⟩ := hb.surjective y use g exact hg.trans hy'
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Matrix.Basis import Mathlib.Data.Matrix.DMatrix import Mathlib.RingTheory.MatrixAlgebra #align_import ring_theory.polynomial_algebra from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" universe u v w open Polynomial TensorProduct open Algebra.TensorProduct (algHomOfLinearMapTensorProduct includeLeft) noncomputable section variable (R A : Type*) variable [CommSemiring R] variable [Semiring A] [Algebra R A] namespace PolyEquivTensor -- Porting note: was `@[simps apply_apply]` @[simps! apply_apply] def toFunBilinear : A →ₗ[A] R[X] →ₗ[R] A[X] := LinearMap.toSpanSingleton A _ (aeval (Polynomial.X : A[X])).toLinearMap #align poly_equiv_tensor.to_fun_bilinear PolyEquivTensor.toFunBilinear theorem toFunBilinear_apply_eq_sum (a : A) (p : R[X]) : toFunBilinear R A a p = p.sum fun n r => monomial n (a * algebraMap R A r) := by simp only [toFunBilinear_apply_apply, aeval_def, eval₂_eq_sum, Polynomial.sum, Finset.smul_sum] congr with i : 1 rw [← Algebra.smul_def, ← C_mul', mul_smul_comm, C_mul_X_pow_eq_monomial, ← Algebra.commutes, ← Algebra.smul_def, smul_monomial] #align poly_equiv_tensor.to_fun_bilinear_apply_eq_sum PolyEquivTensor.toFunBilinear_apply_eq_sum def toFunLinear : A ⊗[R] R[X] →ₗ[R] A[X] := TensorProduct.lift (toFunBilinear R A) #align poly_equiv_tensor.to_fun_linear PolyEquivTensor.toFunLinear @[simp] theorem toFunLinear_tmul_apply (a : A) (p : R[X]) : toFunLinear R A (a ⊗ₜ[R] p) = toFunBilinear R A a p := rfl #align poly_equiv_tensor.to_fun_linear_tmul_apply PolyEquivTensor.toFunLinear_tmul_apply -- We apparently need to provide the decidable instance here -- in order to successfully rewrite by this lemma.
Mathlib/RingTheory/PolynomialAlgebra.lean
80
82
theorem toFunLinear_mul_tmul_mul_aux_1 (p : R[X]) (k : ℕ) (h : Decidable ¬p.coeff k = 0) (a : A) : ite (¬coeff p k = 0) (a * (algebraMap R A) (coeff p k)) 0 = a * (algebraMap R A) (coeff p k) := by
classical split_ifs <;> simp [*]
import Mathlib.CategoryTheory.EqToHom import Mathlib.CategoryTheory.Bicategory.Basic #align_import category_theory.bicategory.strict from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" namespace CategoryTheory open Bicategory universe w v u variable (B : Type u) [Bicategory.{w, v} B] class Bicategory.Strict : Prop where id_comp : ∀ {a b : B} (f : a ⟶ b), 𝟙 a ≫ f = f := by aesop_cat comp_id : ∀ {a b : B} (f : a ⟶ b), f ≫ 𝟙 b = f := by aesop_cat assoc : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), (f ≫ g) ≫ h = f ≫ g ≫ h := by aesop_cat leftUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), λ_ f = eqToIso (id_comp f) := by aesop_cat rightUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), ρ_ f = eqToIso (comp_id f) := by aesop_cat associator_eqToIso : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), α_ f g h = eqToIso (assoc f g h) := by aesop_cat #align category_theory.bicategory.strict CategoryTheory.Bicategory.Strict -- Porting note: not adding simp to: -- Bicategory.Strict.id_comp -- Bicategory.Strict.comp_id -- Bicategory.Strict.assoc attribute [simp] Bicategory.Strict.leftUnitor_eqToIso Bicategory.Strict.rightUnitor_eqToIso Bicategory.Strict.associator_eqToIso -- see Note [lower instance priority] instance (priority := 100) StrictBicategory.category [Bicategory.Strict B] : Category B where id_comp := Bicategory.Strict.id_comp comp_id := Bicategory.Strict.comp_id assoc := Bicategory.Strict.assoc #align category_theory.strict_bicategory.category CategoryTheory.StrictBicategory.category namespace Bicategory variable {B} @[simp] theorem whiskerLeft_eqToHom {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g = h) : f ◁ eqToHom η = eqToHom (congr_arg₂ (· ≫ ·) rfl η) := by cases η simp only [whiskerLeft_id, eqToHom_refl] #align category_theory.bicategory.whisker_left_eq_to_hom CategoryTheory.Bicategory.whiskerLeft_eqToHom @[simp]
Mathlib/CategoryTheory/Bicategory/Strict.lean
85
88
theorem eqToHom_whiskerRight {a b c : B} {f g : a ⟶ b} (η : f = g) (h : b ⟶ c) : eqToHom η ▷ h = eqToHom (congr_arg₂ (· ≫ ·) η rfl) := by
cases η simp only [id_whiskerRight, eqToHom_refl]
import Mathlib.Probability.Kernel.Disintegration.Unique import Mathlib.Probability.Notation #align_import probability.kernel.cond_distrib from "leanprover-community/mathlib"@"00abe0695d8767201e6d008afa22393978bb324d" open MeasureTheory Set Filter TopologicalSpace open scoped ENNReal MeasureTheory ProbabilityTheory namespace ProbabilityTheory variable {α β Ω F : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [Nonempty Ω] [NormedAddCommGroup F] {mα : MeasurableSpace α} {μ : Measure α} [IsFiniteMeasure μ] {X : α → β} {Y : α → Ω} noncomputable irreducible_def condDistrib {_ : MeasurableSpace α} [MeasurableSpace β] (Y : α → Ω) (X : α → β) (μ : Measure α) [IsFiniteMeasure μ] : kernel β Ω := (μ.map fun a => (X a, Y a)).condKernel #align probability_theory.cond_distrib ProbabilityTheory.condDistrib instance [MeasurableSpace β] : IsMarkovKernel (condDistrib Y X μ) := by rw [condDistrib]; infer_instance variable {mβ : MeasurableSpace β} {s : Set Ω} {t : Set β} {f : β × Ω → F} lemma condDistrib_apply_of_ne_zero [MeasurableSingletonClass β] (hY : Measurable Y) (x : β) (hX : μ.map X {x} ≠ 0) (s : Set Ω) : condDistrib Y X μ x s = (μ.map X {x})⁻¹ * μ.map (fun a => (X a, Y a)) ({x} ×ˢ s) := by rw [condDistrib, Measure.condKernel_apply_of_ne_zero _ s] · rw [Measure.fst_map_prod_mk hY] · rwa [Measure.fst_map_prod_mk hY] theorem condDistrib_ae_eq_of_measure_eq_compProd (hX : Measurable X) (hY : Measurable Y) (κ : kernel β Ω) [IsFiniteKernel κ] (hκ : μ.map (fun x => (X x, Y x)) = μ.map X ⊗ₘ κ) : ∀ᵐ x ∂μ.map X, κ x = condDistrib Y X μ x := by have heq : μ.map X = (μ.map (fun x ↦ (X x, Y x))).fst := by ext s hs rw [Measure.map_apply hX hs, Measure.fst_apply hs, Measure.map_apply] exacts [rfl, Measurable.prod hX hY, measurable_fst hs] rw [heq, condDistrib] refine eq_condKernel_of_measure_eq_compProd _ ?_ convert hκ exact heq.symm theorem set_lintegral_preimage_condDistrib (hX : Measurable X) (hY : AEMeasurable Y μ) (hs : MeasurableSet s) (ht : MeasurableSet t) : ∫⁻ a in X ⁻¹' t, condDistrib Y X μ (X a) s ∂μ = μ (X ⁻¹' t ∩ Y ⁻¹' s) := by -- Porting note: need to massage the LHS integrand into the form accepted by `lintegral_comp` -- (`rw` does not see that the two forms are defeq) conv_lhs => arg 2; change (fun a => ((condDistrib Y X μ) a) s) ∘ X rw [lintegral_comp (kernel.measurable_coe _ hs) hX, condDistrib, ← Measure.restrict_map hX ht, ← Measure.fst_map_prod_mk₀ hY, Measure.set_lintegral_condKernel_eq_measure_prod ht hs, Measure.map_apply_of_aemeasurable (hX.aemeasurable.prod_mk hY) (ht.prod hs), mk_preimage_prod] #align probability_theory.set_lintegral_preimage_cond_distrib ProbabilityTheory.set_lintegral_preimage_condDistrib
Mathlib/Probability/Kernel/CondDistrib.lean
209
213
theorem set_lintegral_condDistrib_of_measurableSet (hX : Measurable X) (hY : AEMeasurable Y μ) (hs : MeasurableSet s) {t : Set α} (ht : MeasurableSet[mβ.comap X] t) : ∫⁻ a in t, condDistrib Y X μ (X a) s ∂μ = μ (t ∩ Y ⁻¹' s) := by
obtain ⟨t', ht', rfl⟩ := ht rw [set_lintegral_preimage_condDistrib hX hY hs ht']
import Mathlib.Analysis.InnerProductSpace.Projection import Mathlib.Dynamics.BirkhoffSum.NormedSpace open Filter Finset Function Bornology open scoped Topology variable {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] theorem LinearMap.tendsto_birkhoffAverage_of_ker_subset_closure [NormedSpace 𝕜 E] (f : E →ₗ[𝕜] E) (hf : LipschitzWith 1 f) (g : E →L[𝕜] LinearMap.eqLocus f 1) (hg_proj : ∀ x : LinearMap.eqLocus f 1, g x = x) (hg_ker : (LinearMap.ker g : Set E) ⊆ closure (LinearMap.range (f - 1))) (x : E) : Tendsto (birkhoffAverage 𝕜 f _root_.id · x) atTop (𝓝 (g x)) := by obtain ⟨y, hy, z, hz, rfl⟩ : ∃ y, g y = 0 ∧ ∃ z, IsFixedPt f z ∧ x = y + z := ⟨x - g x, by simp [hg_proj], g x, (g x).2, by simp⟩ suffices Tendsto (birkhoffAverage 𝕜 f _root_.id · y) atTop (𝓝 0) by have hgz : g z = z := congr_arg Subtype.val (hg_proj ⟨z, hz⟩) simpa [hy, hgz, birkhoffAverage, birkhoffSum, Finset.sum_add_distrib, smul_add] using this.add (hz.tendsto_birkhoffAverage 𝕜 _root_.id) have : IsClosed {x | Tendsto (birkhoffAverage 𝕜 f _root_.id · x) atTop (𝓝 0)} := isClosed_setOf_tendsto_birkhoffAverage 𝕜 hf uniformContinuous_id continuous_const refine closure_minimal (Set.forall_mem_range.2 fun x ↦ ?_) this (hg_ker hy) have : IsBounded (Set.range (_root_.id <| f^[·] x)) := isBounded_iff_forall_norm_le.2 ⟨‖x‖, Set.forall_mem_range.2 fun n ↦ by have H : f^[n] 0 = 0 := iterate_map_zero (f : E →+ E) n simpa [H] using (hf.iterate n).dist_le_mul x 0⟩ have H : ∀ n x y, f^[n] (x - y) = f^[n] x - f^[n] y := iterate_map_sub (f : E →+ E) simpa [birkhoffAverage, birkhoffSum, Finset.sum_sub_distrib, smul_sub, H] using tendsto_birkhoffAverage_apply_sub_birkhoffAverage 𝕜 this variable [InnerProductSpace 𝕜 E] [CompleteSpace E] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y
Mathlib/Analysis/InnerProductSpace/MeanErgodic.lean
84
103
theorem ContinuousLinearMap.tendsto_birkhoffAverage_orthogonalProjection (f : E →L[𝕜] E) (hf : ‖f‖ ≤ 1) (x : E) : Tendsto (birkhoffAverage 𝕜 f _root_.id · x) atTop (𝓝 <| orthogonalProjection (LinearMap.eqLocus f 1) x) := by
/- Due to the previous theorem, it suffices to verify that the range of `f - 1` is dense in the orthogonal complement to the submodule of fixed points of `f`. -/ apply (f : E →ₗ[𝕜] E).tendsto_birkhoffAverage_of_ker_subset_closure (f.lipschitz.weaken hf) · exact orthogonalProjection_mem_subspace_eq_self (K := LinearMap.eqLocus f 1) · clear x /- In other words, we need to verify that any vector that is orthogonal to the range of `f - 1` is a fixed point of `f`. -/ rw [ker_orthogonalProjection, ← Submodule.topologicalClosure_coe, SetLike.coe_subset_coe, ← Submodule.orthogonal_orthogonal_eq_closure] /- To verify this, we verify `‖f x‖ ≤ ‖x‖` (because `‖f‖ ≤ 1`) and `⟪f x, x⟫ = ‖x‖²`. -/ refine Submodule.orthogonal_le fun x hx ↦ eq_of_norm_le_re_inner_eq_norm_sq (𝕜 := 𝕜) ?_ ?_ · simpa using f.le_of_opNorm_le hf x · have : ∀ y, ⟪f y, x⟫ = ⟪y, x⟫ := by simpa [Submodule.mem_orthogonal, inner_sub_left, sub_eq_zero] using hx simp [this, ← norm_sq_eq_inner]
import Mathlib.GroupTheory.OrderOfElement import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Nat.GCD.BigOperators import Mathlib.Order.SupIndep #align_import group_theory.noncomm_pi_coprod from "leanprover-community/mathlib"@"6f9f36364eae3f42368b04858fd66d6d9ae730d8" section FamilyOfMonoids variable {M : Type*} [Monoid M] -- We have a family of monoids -- The fintype assumption is not always used, but declared here, to keep things in order variable {ι : Type*} [DecidableEq ι] [Fintype ι] variable {N : ι → Type*} [∀ i, Monoid (N i)] -- And morphisms ϕ into G variable (ϕ : ∀ i : ι, N i →* M) -- We assume that the elements of different morphism commute variable (hcomm : Pairwise fun i j => ∀ x y, Commute (ϕ i x) (ϕ j y)) -- We use `f` and `g` to denote elements of `Π (i : ι), N i` variable (f g : ∀ i : ι, N i) namespace Subgroup -- We have a family of subgroups variable {G : Type*} [Group G] variable {ι : Type*} [hdec : DecidableEq ι] [hfin : Fintype ι] {H : ι → Subgroup G} -- Elements of `Π (i : ι), H i` are called `f` and `g` here variable (f g : ∀ i : ι, H i) section CommutingSubgroups -- We assume that the elements of different subgroups commute variable (hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y) @[to_additive]
Mathlib/GroupTheory/NoncommPiCoprod.lean
282
285
theorem commute_subtype_of_commute (i j : ι) (hne : i ≠ j) : ∀ (x : H i) (y : H j), Commute ((H i).subtype x) ((H j).subtype y) := by
rintro ⟨x, hx⟩ ⟨y, hy⟩ exact hcomm hne x y hx hy
import Mathlib.Data.Matrix.Basic variable {l m n o : Type*} universe u v w variable {R : Type*} {α : Type v} {β : Type w} namespace Matrix def col (w : m → α) : Matrix m Unit α := of fun x _ => w x #align matrix.col Matrix.col -- TODO: set as an equation lemma for `col`, see mathlib4#3024 @[simp] theorem col_apply (w : m → α) (i j) : col w i j = w i := rfl #align matrix.col_apply Matrix.col_apply def row (v : n → α) : Matrix Unit n α := of fun _ y => v y #align matrix.row Matrix.row -- TODO: set as an equation lemma for `row`, see mathlib4#3024 @[simp] theorem row_apply (v : n → α) (i j) : row v i j = v j := rfl #align matrix.row_apply Matrix.row_apply theorem col_injective : Function.Injective (col : (m → α) → _) := fun _x _y h => funext fun i => congr_fun₂ h i () @[simp] theorem col_inj {v w : m → α} : col v = col w ↔ v = w := col_injective.eq_iff @[simp] theorem col_zero [Zero α] : col (0 : m → α) = 0 := rfl @[simp] theorem col_eq_zero [Zero α] (v : m → α) : col v = 0 ↔ v = 0 := col_inj @[simp] theorem col_add [Add α] (v w : m → α) : col (v + w) = col v + col w := by ext rfl #align matrix.col_add Matrix.col_add @[simp]
Mathlib/Data/Matrix/RowCol.lean
67
69
theorem col_smul [SMul R α] (x : R) (v : m → α) : col (x • v) = x • col v := by
ext rfl
import Mathlib.Data.List.Basic namespace List variable {α β : Type*} @[simp]
Mathlib/Data/List/ReduceOption.lean
19
21
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]
import Mathlib.Algebra.MvPolynomial.Variables #align_import data.mv_polynomial.supported from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" universe u v w namespace MvPolynomial variable {σ τ : Type*} {R : Type u} {S : Type v} {r : R} {e : ℕ} {n m : σ} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial σ R} variable (R) noncomputable def supported (s : Set σ) : Subalgebra R (MvPolynomial σ R) := Algebra.adjoin R (X '' s) #align mv_polynomial.supported MvPolynomial.supported variable {R} open Algebra theorem supported_eq_range_rename (s : Set σ) : supported R s = (rename ((↑) : s → σ)).range := by rw [supported, Set.image_eq_range, adjoin_range_eq_range_aeval, rename] congr #align mv_polynomial.supported_eq_range_rename MvPolynomial.supported_eq_range_rename noncomputable def supportedEquivMvPolynomial (s : Set σ) : supported R s ≃ₐ[R] MvPolynomial s R := (Subalgebra.equivOfEq _ _ (supported_eq_range_rename s)).trans (AlgEquiv.ofInjective (rename ((↑) : s → σ)) (rename_injective _ Subtype.val_injective)).symm #align mv_polynomial.supported_equiv_mv_polynomial MvPolynomial.supportedEquivMvPolynomial @[simp, nolint simpNF] -- Porting note: the `simpNF` linter complained about this lemma. theorem supportedEquivMvPolynomial_symm_C (s : Set σ) (x : R) : (supportedEquivMvPolynomial s).symm (C x) = algebraMap R (supported R s) x := by ext1 simp [supportedEquivMvPolynomial, MvPolynomial.algebraMap_eq] set_option linter.uppercaseLean3 false in #align mv_polynomial.supported_equiv_mv_polynomial_symm_C MvPolynomial.supportedEquivMvPolynomial_symm_C @[simp, nolint simpNF] -- Porting note: the `simpNF` linter complained about this lemma. theorem supportedEquivMvPolynomial_symm_X (s : Set σ) (i : s) : (↑((supportedEquivMvPolynomial s).symm (X i : MvPolynomial s R)) : MvPolynomial σ R) = X ↑i := by simp [supportedEquivMvPolynomial] set_option linter.uppercaseLean3 false in #align mv_polynomial.supported_equiv_mv_polynomial_symm_X MvPolynomial.supportedEquivMvPolynomial_symm_X variable {s t : Set σ} theorem mem_supported : p ∈ supported R s ↔ ↑p.vars ⊆ s := by classical rw [supported_eq_range_rename, AlgHom.mem_range] constructor · rintro ⟨p, rfl⟩ refine _root_.trans (Finset.coe_subset.2 (vars_rename _ _)) ?_ simp · intro hs exact exists_rename_eq_of_vars_subset_range p ((↑) : s → σ) Subtype.val_injective (by simpa) #align mv_polynomial.mem_supported MvPolynomial.mem_supported theorem supported_eq_vars_subset : (supported R s : Set (MvPolynomial σ R)) = { p | ↑p.vars ⊆ s } := Set.ext fun _ ↦ mem_supported #align mv_polynomial.supported_eq_vars_subset MvPolynomial.supported_eq_vars_subset @[simp] theorem mem_supported_vars (p : MvPolynomial σ R) : p ∈ supported R (↑p.vars : Set σ) := by rw [mem_supported] #align mv_polynomial.mem_supported_vars MvPolynomial.mem_supported_vars variable (s) theorem supported_eq_adjoin_X : supported R s = Algebra.adjoin R (X '' s) := rfl set_option linter.uppercaseLean3 false in #align mv_polynomial.supported_eq_adjoin_X MvPolynomial.supported_eq_adjoin_X @[simp] theorem supported_univ : supported R (Set.univ : Set σ) = ⊤ := by simp [Algebra.eq_top_iff, mem_supported] #align mv_polynomial.supported_univ MvPolynomial.supported_univ @[simp] theorem supported_empty : supported R (∅ : Set σ) = ⊥ := by simp [supported_eq_adjoin_X] #align mv_polynomial.supported_empty MvPolynomial.supported_empty variable {s} theorem supported_mono (st : s ⊆ t) : supported R s ≤ supported R t := Algebra.adjoin_mono (Set.image_subset _ st) #align mv_polynomial.supported_mono MvPolynomial.supported_mono @[simp] theorem X_mem_supported [Nontrivial R] {i : σ} : X i ∈ supported R s ↔ i ∈ s := by simp [mem_supported] set_option linter.uppercaseLean3 false in #align mv_polynomial.X_mem_supported MvPolynomial.X_mem_supported @[simp] theorem supported_le_supported_iff [Nontrivial R] : supported R s ≤ supported R t ↔ s ⊆ t := by constructor · intro h i simpa using @h (X i) · exact supported_mono #align mv_polynomial.supported_le_supported_iff MvPolynomial.supported_le_supported_iff theorem supported_strictMono [Nontrivial R] : StrictMono (supported R : Set σ → Subalgebra R (MvPolynomial σ R)) := strictMono_of_le_iff_le fun _ _ ↦ supported_le_supported_iff.symm #align mv_polynomial.supported_strict_mono MvPolynomial.supported_strictMono
Mathlib/Algebra/MvPolynomial/Supported.lean
135
141
theorem exists_restrict_to_vars (R : Type*) [CommRing R] {F : MvPolynomial σ ℤ} (hF : ↑F.vars ⊆ s) : ∃ f : (s → R) → R, ∀ x : σ → R, f (x ∘ (↑) : s → R) = aeval x F := by
rw [← mem_supported, supported_eq_range_rename, AlgHom.mem_range] at hF cases' hF with F' hF' use fun z ↦ aeval z F' intro x simp only [← hF', aeval_rename]
import Mathlib.Data.Nat.Prime import Mathlib.Data.PNat.Basic #align_import data.pnat.prime from "leanprover-community/mathlib"@"09597669f02422ed388036273d8848119699c22f" namespace PNat open Nat def gcd (n m : ℕ+) : ℕ+ := ⟨Nat.gcd (n : ℕ) (m : ℕ), Nat.gcd_pos_of_pos_left (m : ℕ) n.pos⟩ #align pnat.gcd PNat.gcd def lcm (n m : ℕ+) : ℕ+ := ⟨Nat.lcm (n : ℕ) (m : ℕ), by let h := mul_pos n.pos m.pos rw [← gcd_mul_lcm (n : ℕ) (m : ℕ), mul_comm] at h exact pos_of_dvd_of_pos (Dvd.intro (Nat.gcd (n : ℕ) (m : ℕ)) rfl) h⟩ #align pnat.lcm PNat.lcm @[simp, norm_cast] theorem gcd_coe (n m : ℕ+) : (gcd n m : ℕ) = Nat.gcd n m := rfl #align pnat.gcd_coe PNat.gcd_coe @[simp, norm_cast] theorem lcm_coe (n m : ℕ+) : (lcm n m : ℕ) = Nat.lcm n m := rfl #align pnat.lcm_coe PNat.lcm_coe theorem gcd_dvd_left (n m : ℕ+) : gcd n m ∣ n := dvd_iff.2 (Nat.gcd_dvd_left (n : ℕ) (m : ℕ)) #align pnat.gcd_dvd_left PNat.gcd_dvd_left theorem gcd_dvd_right (n m : ℕ+) : gcd n m ∣ m := dvd_iff.2 (Nat.gcd_dvd_right (n : ℕ) (m : ℕ)) #align pnat.gcd_dvd_right PNat.gcd_dvd_right theorem dvd_gcd {m n k : ℕ+} (hm : k ∣ m) (hn : k ∣ n) : k ∣ gcd m n := dvd_iff.2 (Nat.dvd_gcd (dvd_iff.1 hm) (dvd_iff.1 hn)) #align pnat.dvd_gcd PNat.dvd_gcd theorem dvd_lcm_left (n m : ℕ+) : n ∣ lcm n m := dvd_iff.2 (Nat.dvd_lcm_left (n : ℕ) (m : ℕ)) #align pnat.dvd_lcm_left PNat.dvd_lcm_left theorem dvd_lcm_right (n m : ℕ+) : m ∣ lcm n m := dvd_iff.2 (Nat.dvd_lcm_right (n : ℕ) (m : ℕ)) #align pnat.dvd_lcm_right PNat.dvd_lcm_right theorem lcm_dvd {m n k : ℕ+} (hm : m ∣ k) (hn : n ∣ k) : lcm m n ∣ k := dvd_iff.2 (@Nat.lcm_dvd (m : ℕ) (n : ℕ) (k : ℕ) (dvd_iff.1 hm) (dvd_iff.1 hn)) #align pnat.lcm_dvd PNat.lcm_dvd theorem gcd_mul_lcm (n m : ℕ+) : gcd n m * lcm n m = n * m := Subtype.eq (Nat.gcd_mul_lcm (n : ℕ) (m : ℕ)) #align pnat.gcd_mul_lcm PNat.gcd_mul_lcm
Mathlib/Data/PNat/Prime.lean
103
106
theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1 := by
intro h; apply le_antisymm; swap · apply PNat.one_le · exact PNat.lt_add_one_iff.1 h
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL1 #align_import measure_theory.function.conditional_expectation.basic from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" open TopologicalSpace MeasureTheory.Lp Filter open scoped ENNReal Topology MeasureTheory namespace MeasureTheory variable {α F F' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜] -- 𝕜 for ℝ or ℂ -- F for a Lp submodule [NormedAddCommGroup F] [NormedSpace 𝕜 F] -- F' for integrals on a Lp submodule [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F'] open scoped Classical variable {m m0 : MeasurableSpace α} {μ : Measure α} {f g : α → F'} {s : Set α} noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α} (μ : Measure α) (f : α → F') : α → F' := if hm : m ≤ m0 then if h : SigmaFinite (μ.trim hm) ∧ Integrable f μ then if StronglyMeasurable[m] f then f else (@aestronglyMeasurable'_condexpL1 _ _ _ _ _ m m0 μ hm h.1 _).mk (@condexpL1 _ _ _ _ _ _ _ hm μ h.1 f) else 0 else 0 #align measure_theory.condexp MeasureTheory.condexp -- We define notation `μ[f|m]` for the conditional expectation of `f` with respect to `m`. scoped notation μ "[" f "|" m "]" => MeasureTheory.condexp m μ f
Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean
106
106
theorem condexp_of_not_le (hm_not : ¬m ≤ m0) : μ[f|m] = 0 := by
rw [condexp, dif_neg hm_not]
import Mathlib.RepresentationTheory.FdRep import Mathlib.LinearAlgebra.Trace import Mathlib.RepresentationTheory.Invariants #align_import representation_theory.character from "leanprover-community/mathlib"@"55b3f8206b8596db8bb1804d8a92814a0b6670c9" noncomputable section universe u open CategoryTheory LinearMap CategoryTheory.MonoidalCategory Representation FiniteDimensional variable {k : Type u} [Field k] namespace FdRep set_option linter.uppercaseLean3 false -- `FdRep` section Monoid variable {G : Type u} [Monoid G] def character (V : FdRep k G) (g : G) := LinearMap.trace k V (V.ρ g) #align fdRep.character FdRep.character theorem char_mul_comm (V : FdRep k G) (g : G) (h : G) : V.character (h * g) = V.character (g * h) := by simp only [trace_mul_comm, character, map_mul] #align fdRep.char_mul_comm FdRep.char_mul_comm @[simp] theorem char_one (V : FdRep k G) : V.character 1 = FiniteDimensional.finrank k V := by simp only [character, map_one, trace_one] #align fdRep.char_one FdRep.char_one
Mathlib/RepresentationTheory/Character.lean
64
65
theorem char_tensor (V W : FdRep k G) : (V ⊗ W).character = V.character * W.character := by
ext g; convert trace_tensorProduct' (V.ρ g) (W.ρ g)
import Mathlib.Topology.Separation import Mathlib.Topology.UniformSpace.Basic import Mathlib.Topology.UniformSpace.Cauchy #align_import topology.uniform_space.uniform_convergence from "leanprover-community/mathlib"@"2705404e701abc6b3127da906f40bae062a169c9" noncomputable section open Topology Uniformity Filter Set universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {ι : Type x} [UniformSpace β] variable {F : ι → α → β} {f : α → β} {s s' : Set α} {x : α} {p : Filter ι} {p' : Filter α} {g : ι → α} def TendstoUniformlyOnFilter (F : ι → α → β) (f : α → β) (p : Filter ι) (p' : Filter α) := ∀ u ∈ 𝓤 β, ∀ᶠ n : ι × α in p ×ˢ p', (f n.snd, F n.fst n.snd) ∈ u #align tendsto_uniformly_on_filter TendstoUniformlyOnFilter theorem tendstoUniformlyOnFilter_iff_tendsto : TendstoUniformlyOnFilter F f p p' ↔ Tendsto (fun q : ι × α => (f q.2, F q.1 q.2)) (p ×ˢ p') (𝓤 β) := Iff.rfl #align tendsto_uniformly_on_filter_iff_tendsto tendstoUniformlyOnFilter_iff_tendsto def TendstoUniformlyOn (F : ι → α → β) (f : α → β) (p : Filter ι) (s : Set α) := ∀ u ∈ 𝓤 β, ∀ᶠ n in p, ∀ x : α, x ∈ s → (f x, F n x) ∈ u #align tendsto_uniformly_on TendstoUniformlyOn theorem tendstoUniformlyOn_iff_tendstoUniformlyOnFilter : TendstoUniformlyOn F f p s ↔ TendstoUniformlyOnFilter F f p (𝓟 s) := by simp only [TendstoUniformlyOn, TendstoUniformlyOnFilter] apply forall₂_congr simp_rw [eventually_prod_principal_iff] simp #align tendsto_uniformly_on_iff_tendsto_uniformly_on_filter tendstoUniformlyOn_iff_tendstoUniformlyOnFilter alias ⟨TendstoUniformlyOn.tendstoUniformlyOnFilter, TendstoUniformlyOnFilter.tendstoUniformlyOn⟩ := tendstoUniformlyOn_iff_tendstoUniformlyOnFilter #align tendsto_uniformly_on.tendsto_uniformly_on_filter TendstoUniformlyOn.tendstoUniformlyOnFilter #align tendsto_uniformly_on_filter.tendsto_uniformly_on TendstoUniformlyOnFilter.tendstoUniformlyOn theorem tendstoUniformlyOn_iff_tendsto {F : ι → α → β} {f : α → β} {p : Filter ι} {s : Set α} : TendstoUniformlyOn F f p s ↔ Tendsto (fun q : ι × α => (f q.2, F q.1 q.2)) (p ×ˢ 𝓟 s) (𝓤 β) := by simp [tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, tendstoUniformlyOnFilter_iff_tendsto] #align tendsto_uniformly_on_iff_tendsto tendstoUniformlyOn_iff_tendsto def TendstoUniformly (F : ι → α → β) (f : α → β) (p : Filter ι) := ∀ u ∈ 𝓤 β, ∀ᶠ n in p, ∀ x : α, (f x, F n x) ∈ u #align tendsto_uniformly TendstoUniformly -- Porting note: moved from below theorem tendstoUniformlyOn_univ : TendstoUniformlyOn F f p univ ↔ TendstoUniformly F f p := by simp [TendstoUniformlyOn, TendstoUniformly] #align tendsto_uniformly_on_univ tendstoUniformlyOn_univ
Mathlib/Topology/UniformSpace/UniformConvergence.lean
142
144
theorem tendstoUniformly_iff_tendstoUniformlyOnFilter : TendstoUniformly F f p ↔ TendstoUniformlyOnFilter F f p ⊤ := by
rw [← tendstoUniformlyOn_univ, tendstoUniformlyOn_iff_tendstoUniformlyOnFilter, principal_univ]
import Mathlib.Analysis.InnerProductSpace.Adjoint #align_import analysis.inner_product_space.positive from "leanprover-community/mathlib"@"caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c" open InnerProductSpace RCLike ContinuousLinearMap open scoped InnerProduct ComplexConjugate namespace ContinuousLinearMap variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [NormedAddCommGroup F] variable [InnerProductSpace 𝕜 E] [InnerProductSpace 𝕜 F] variable [CompleteSpace E] [CompleteSpace F] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y def IsPositive (T : E →L[𝕜] E) : Prop := IsSelfAdjoint T ∧ ∀ x, 0 ≤ T.reApplyInnerSelf x #align continuous_linear_map.is_positive ContinuousLinearMap.IsPositive theorem IsPositive.isSelfAdjoint {T : E →L[𝕜] E} (hT : IsPositive T) : IsSelfAdjoint T := hT.1 #align continuous_linear_map.is_positive.is_self_adjoint ContinuousLinearMap.IsPositive.isSelfAdjoint theorem IsPositive.inner_nonneg_left {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) : 0 ≤ re ⟪T x, x⟫ := hT.2 x #align continuous_linear_map.is_positive.inner_nonneg_left ContinuousLinearMap.IsPositive.inner_nonneg_left theorem IsPositive.inner_nonneg_right {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) : 0 ≤ re ⟪x, T x⟫ := by rw [inner_re_symm]; exact hT.inner_nonneg_left x #align continuous_linear_map.is_positive.inner_nonneg_right ContinuousLinearMap.IsPositive.inner_nonneg_right
Mathlib/Analysis/InnerProductSpace/Positive.lean
71
74
theorem isPositive_zero : IsPositive (0 : E →L[𝕜] E) := by
refine ⟨isSelfAdjoint_zero _, fun x => ?_⟩ change 0 ≤ re ⟪_, _⟫ rw [zero_apply, inner_zero_left, ZeroHomClass.map_zero]
import Mathlib.Data.List.Nodup import Mathlib.Data.List.Zip import Mathlib.Data.Nat.Defs import Mathlib.Data.List.Infix #align_import data.list.rotate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" universe u variable {α : Type u} open Nat Function namespace List theorem rotate_mod (l : List α) (n : ℕ) : l.rotate (n % l.length) = l.rotate n := by simp [rotate] #align list.rotate_mod List.rotate_mod @[simp]
Mathlib/Data/List/Rotate.lean
41
41
theorem rotate_nil (n : ℕ) : ([] : List α).rotate n = [] := by
simp [rotate]
import Mathlib.Algebra.BigOperators.Intervals import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Topology.Instances.NNReal #align_import analysis.normed.group.infinite_sum from "leanprover-community/mathlib"@"9a59dcb7a2d06bf55da57b9030169219980660cd" open Topology NNReal open Finset Filter Metric variable {ι α E F : Type*} [SeminormedAddCommGroup E] [SeminormedAddCommGroup F] theorem cauchySeq_finset_iff_vanishing_norm {f : ι → E} : (CauchySeq fun s : Finset ι => ∑ i ∈ s, f i) ↔ ∀ ε > (0 : ℝ), ∃ s : Finset ι, ∀ t, Disjoint t s → ‖∑ i ∈ t, f i‖ < ε := by rw [cauchySeq_finset_iff_sum_vanishing, nhds_basis_ball.forall_iff] · simp only [ball_zero_eq, Set.mem_setOf_eq] · rintro s t hst ⟨s', hs'⟩ exact ⟨s', fun t' ht' => hst <| hs' _ ht'⟩ #align cauchy_seq_finset_iff_vanishing_norm cauchySeq_finset_iff_vanishing_norm theorem summable_iff_vanishing_norm [CompleteSpace E] {f : ι → E} : Summable f ↔ ∀ ε > (0 : ℝ), ∃ s : Finset ι, ∀ t, Disjoint t s → ‖∑ i ∈ t, f i‖ < ε := by rw [summable_iff_cauchySeq_finset, cauchySeq_finset_iff_vanishing_norm] #align summable_iff_vanishing_norm summable_iff_vanishing_norm theorem cauchySeq_finset_of_norm_bounded_eventually {f : ι → E} {g : ι → ℝ} (hg : Summable g) (h : ∀ᶠ i in cofinite, ‖f i‖ ≤ g i) : CauchySeq fun s => ∑ i ∈ s, f i := by refine cauchySeq_finset_iff_vanishing_norm.2 fun ε hε => ?_ rcases summable_iff_vanishing_norm.1 hg ε hε with ⟨s, hs⟩ classical refine ⟨s ∪ h.toFinset, fun t ht => ?_⟩ have : ∀ i ∈ t, ‖f i‖ ≤ g i := by intro i hi simp only [disjoint_left, mem_union, not_or, h.mem_toFinset, Set.mem_compl_iff, Classical.not_not] at ht exact (ht hi).2 calc ‖∑ i ∈ t, f i‖ ≤ ∑ i ∈ t, g i := norm_sum_le_of_le _ this _ ≤ ‖∑ i ∈ t, g i‖ := le_abs_self _ _ < ε := hs _ (ht.mono_right le_sup_left) #align cauchy_seq_finset_of_norm_bounded_eventually cauchySeq_finset_of_norm_bounded_eventually theorem cauchySeq_finset_of_norm_bounded {f : ι → E} (g : ι → ℝ) (hg : Summable g) (h : ∀ i, ‖f i‖ ≤ g i) : CauchySeq fun s : Finset ι => ∑ i ∈ s, f i := cauchySeq_finset_of_norm_bounded_eventually hg <| eventually_of_forall h #align cauchy_seq_finset_of_norm_bounded cauchySeq_finset_of_norm_bounded
Mathlib/Analysis/Normed/Group/InfiniteSum.lean
78
89
theorem cauchySeq_range_of_norm_bounded {f : ℕ → E} (g : ℕ → ℝ) (hg : CauchySeq fun n => ∑ i ∈ range n, g i) (hf : ∀ i, ‖f i‖ ≤ g i) : CauchySeq fun n => ∑ i ∈ range n, f i := by
refine Metric.cauchySeq_iff'.2 fun ε hε => ?_ refine (Metric.cauchySeq_iff'.1 hg ε hε).imp fun N hg n hn => ?_ specialize hg n hn rw [dist_eq_norm, ← sum_Ico_eq_sub _ hn] at hg ⊢ calc ‖∑ k ∈ Ico N n, f k‖ ≤ ∑ k ∈ _, ‖f k‖ := norm_sum_le _ _ _ ≤ ∑ k ∈ _, g k := sum_le_sum fun x _ => hf x _ ≤ ‖∑ k ∈ _, g k‖ := le_abs_self _ _ < ε := hg
import Mathlib.Algebra.BigOperators.Group.Multiset import Mathlib.Data.Multiset.Dedup #align_import data.multiset.bind from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" assert_not_exists MonoidWithZero assert_not_exists MulAction universe v variable {α : Type*} {β : Type v} {γ δ : Type*} namespace Multiset def join : Multiset (Multiset α) → Multiset α := sum #align multiset.join Multiset.join theorem coe_join : ∀ L : List (List α), join (L.map ((↑) : List α → Multiset α) : Multiset (Multiset α)) = L.join | [] => rfl | l :: L => by exact congr_arg (fun s : Multiset α => ↑l + s) (coe_join L) #align multiset.coe_join Multiset.coe_join @[simp] theorem join_zero : @join α 0 = 0 := rfl #align multiset.join_zero Multiset.join_zero @[simp] theorem join_cons (s S) : @join α (s ::ₘ S) = s + join S := sum_cons _ _ #align multiset.join_cons Multiset.join_cons @[simp] theorem join_add (S T) : @join α (S + T) = join S + join T := sum_add _ _ #align multiset.join_add Multiset.join_add @[simp] theorem singleton_join (a) : join ({a} : Multiset (Multiset α)) = a := sum_singleton _ #align multiset.singleton_join Multiset.singleton_join @[simp] theorem mem_join {a S} : a ∈ @join α S ↔ ∃ s ∈ S, a ∈ s := Multiset.induction_on S (by simp) <| by simp (config := { contextual := true }) [or_and_right, exists_or] #align multiset.mem_join Multiset.mem_join @[simp] theorem card_join (S) : card (@join α S) = sum (map card S) := Multiset.induction_on S (by simp) (by simp) #align multiset.card_join Multiset.card_join @[simp] theorem map_join (f : α → β) (S : Multiset (Multiset α)) : map f (join S) = join (map (map f) S) := by induction S using Multiset.induction with | empty => simp | cons _ _ ih => simp [ih] @[to_additive (attr := simp)] theorem prod_join [CommMonoid α] {S : Multiset (Multiset α)} : prod (join S) = prod (map prod S) := by induction S using Multiset.induction with | empty => simp | cons _ _ ih => simp [ih] theorem rel_join {r : α → β → Prop} {s t} (h : Rel (Rel r) s t) : Rel r s.join t.join := by induction h with | zero => simp | cons hab hst ih => simpa using hab.add ih #align multiset.rel_join Multiset.rel_join section Bind variable (a : α) (s t : Multiset α) (f g : α → Multiset β) def bind (s : Multiset α) (f : α → Multiset β) : Multiset β := (s.map f).join #align multiset.bind Multiset.bind @[simp] theorem coe_bind (l : List α) (f : α → List β) : (@bind α β l fun a => f a) = l.bind f := by rw [List.bind, ← coe_join, List.map_map] rfl #align multiset.coe_bind Multiset.coe_bind @[simp] theorem zero_bind : bind 0 f = 0 := rfl #align multiset.zero_bind Multiset.zero_bind @[simp] theorem cons_bind : (a ::ₘ s).bind f = f a + s.bind f := by simp [bind] #align multiset.cons_bind Multiset.cons_bind @[simp]
Mathlib/Data/Multiset/Bind.lean
130
130
theorem singleton_bind : bind {a} f = f a := by
simp [bind]
import Mathlib.Data.List.Count import Mathlib.Data.List.Dedup import Mathlib.Data.List.InsertNth import Mathlib.Data.List.Lattice import Mathlib.Data.List.Permutation import Mathlib.Data.Nat.Factorial.Basic #align_import data.list.perm from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83" -- Make sure we don't import algebra assert_not_exists Monoid open Nat namespace List variable {α β : Type*} {l l₁ l₂ : List α} {a : α} #align list.perm List.Perm instance : Trans (@List.Perm α) (@List.Perm α) List.Perm where trans := @List.Perm.trans α open Perm (swap) attribute [refl] Perm.refl #align list.perm.refl List.Perm.refl lemma perm_rfl : l ~ l := Perm.refl _ -- Porting note: used rec_on in mathlib3; lean4 eqn compiler still doesn't like it attribute [symm] Perm.symm #align list.perm.symm List.Perm.symm #align list.perm_comm List.perm_comm #align list.perm.swap' List.Perm.swap' attribute [trans] Perm.trans #align list.perm.eqv List.Perm.eqv #align list.is_setoid List.isSetoid #align list.perm.mem_iff List.Perm.mem_iff #align list.perm.subset List.Perm.subset theorem Perm.subset_congr_left {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₁ ⊆ l₃ ↔ l₂ ⊆ l₃ := ⟨h.symm.subset.trans, h.subset.trans⟩ #align list.perm.subset_congr_left List.Perm.subset_congr_left theorem Perm.subset_congr_right {l₁ l₂ l₃ : List α} (h : l₁ ~ l₂) : l₃ ⊆ l₁ ↔ l₃ ⊆ l₂ := ⟨fun h' => h'.trans h.subset, fun h' => h'.trans h.symm.subset⟩ #align list.perm.subset_congr_right List.Perm.subset_congr_right #align list.perm.append_right List.Perm.append_right #align list.perm.append_left List.Perm.append_left #align list.perm.append List.Perm.append #align list.perm.append_cons List.Perm.append_cons #align list.perm_middle List.perm_middle #align list.perm_append_singleton List.perm_append_singleton #align list.perm_append_comm List.perm_append_comm #align list.concat_perm List.concat_perm #align list.perm.length_eq List.Perm.length_eq #align list.perm.eq_nil List.Perm.eq_nil #align list.perm.nil_eq List.Perm.nil_eq #align list.perm_nil List.perm_nil #align list.nil_perm List.nil_perm #align list.not_perm_nil_cons List.not_perm_nil_cons #align list.reverse_perm List.reverse_perm #align list.perm_cons_append_cons List.perm_cons_append_cons #align list.perm_replicate List.perm_replicate #align list.replicate_perm List.replicate_perm #align list.perm_singleton List.perm_singleton #align list.singleton_perm List.singleton_perm #align list.singleton_perm_singleton List.singleton_perm_singleton #align list.perm_cons_erase List.perm_cons_erase #align list.perm_induction_on List.Perm.recOnSwap' -- Porting note: used to be @[congr] #align list.perm.filter_map List.Perm.filterMap -- Porting note: used to be @[congr] #align list.perm.map List.Perm.map #align list.perm.pmap List.Perm.pmap #align list.perm.filter List.Perm.filter #align list.filter_append_perm List.filter_append_perm #align list.exists_perm_sublist List.exists_perm_sublist #align list.perm.sizeof_eq_sizeof List.Perm.sizeOf_eq_sizeOf section Rel open Relator variable {γ : Type*} {δ : Type*} {r : α → β → Prop} {p : γ → δ → Prop} local infixr:80 " ∘r " => Relation.Comp
Mathlib/Data/List/Perm.lean
142
146
theorem perm_comp_perm : (Perm ∘r Perm : List α → List α → Prop) = Perm := by
funext a c; apply propext constructor · exact fun ⟨b, hab, hba⟩ => Perm.trans hab hba · exact fun h => ⟨a, Perm.refl a, h⟩
import Mathlib.Analysis.Normed.Field.Basic import Mathlib.LinearAlgebra.SesquilinearForm import Mathlib.Topology.Algebra.Module.WeakDual #align_import analysis.locally_convex.polar from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" variable {𝕜 E F : Type*} open Topology namespace LinearMap section NormedRing variable [NormedCommRing 𝕜] [AddCommMonoid E] [AddCommMonoid F] variable [Module 𝕜 E] [Module 𝕜 F] variable (B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜) def polar (s : Set E) : Set F := { y : F | ∀ x ∈ s, ‖B x y‖ ≤ 1 } #align linear_map.polar LinearMap.polar theorem polar_mem_iff (s : Set E) (y : F) : y ∈ B.polar s ↔ ∀ x ∈ s, ‖B x y‖ ≤ 1 := Iff.rfl #align linear_map.polar_mem_iff LinearMap.polar_mem_iff theorem polar_mem (s : Set E) (y : F) (hy : y ∈ B.polar s) : ∀ x ∈ s, ‖B x y‖ ≤ 1 := hy #align linear_map.polar_mem LinearMap.polar_mem @[simp] theorem zero_mem_polar (s : Set E) : (0 : F) ∈ B.polar s := fun _ _ => by simp only [map_zero, norm_zero, zero_le_one] #align linear_map.zero_mem_polar LinearMap.zero_mem_polar theorem polar_eq_iInter {s : Set E} : B.polar s = ⋂ x ∈ s, { y : F | ‖B x y‖ ≤ 1 } := by ext simp only [polar_mem_iff, Set.mem_iInter, Set.mem_setOf_eq] #align linear_map.polar_eq_Inter LinearMap.polar_eq_iInter theorem polar_gc : GaloisConnection (OrderDual.toDual ∘ B.polar) (B.flip.polar ∘ OrderDual.ofDual) := fun _ _ => ⟨fun h _ hx _ hy => h hy _ hx, fun h _ hx _ hy => h hy _ hx⟩ #align linear_map.polar_gc LinearMap.polar_gc @[simp] theorem polar_iUnion {ι} {s : ι → Set E} : B.polar (⋃ i, s i) = ⋂ i, B.polar (s i) := B.polar_gc.l_iSup #align linear_map.polar_Union LinearMap.polar_iUnion @[simp] theorem polar_union {s t : Set E} : B.polar (s ∪ t) = B.polar s ∩ B.polar t := B.polar_gc.l_sup #align linear_map.polar_union LinearMap.polar_union theorem polar_antitone : Antitone (B.polar : Set E → Set F) := B.polar_gc.monotone_l #align linear_map.polar_antitone LinearMap.polar_antitone @[simp] theorem polar_empty : B.polar ∅ = Set.univ := B.polar_gc.l_bot #align linear_map.polar_empty LinearMap.polar_empty @[simp]
Mathlib/Analysis/LocallyConvex/Polar.lean
106
109
theorem polar_zero : B.polar ({0} : Set E) = Set.univ := by
refine Set.eq_univ_iff_forall.mpr fun y x hx => ?_ rw [Set.mem_singleton_iff.mp hx, map_zero, LinearMap.zero_apply, norm_zero] exact zero_le_one
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.CharP.ExpChar import Mathlib.FieldTheory.Separable #align_import field_theory.separable_degree from "leanprover-community/mathlib"@"d11893b411025250c8e61ff2f12ccbd7ee35ab15" noncomputable section namespace Polynomial open scoped Classical open Polynomial section CommSemiring variable {F : Type*} [CommSemiring F] (q : ℕ) def IsSeparableContraction (f : F[X]) (g : F[X]) : Prop := g.Separable ∧ ∃ m : ℕ, expand F (q ^ m) g = f #align polynomial.is_separable_contraction Polynomial.IsSeparableContraction def HasSeparableContraction (f : F[X]) : Prop := ∃ g : F[X], IsSeparableContraction q f g #align polynomial.has_separable_contraction Polynomial.HasSeparableContraction variable {q} {f : F[X]} (hf : HasSeparableContraction q f) def HasSeparableContraction.contraction : F[X] := Classical.choose hf #align polynomial.has_separable_contraction.contraction Polynomial.HasSeparableContraction.contraction def HasSeparableContraction.degree : ℕ := hf.contraction.natDegree #align polynomial.has_separable_contraction.degree Polynomial.HasSeparableContraction.degree theorem HasSeparableContraction.isSeparableContraction : IsSeparableContraction q f hf.contraction := Classical.choose_spec hf theorem IsSeparableContraction.dvd_degree' {g} (hf : IsSeparableContraction q f g) : ∃ m : ℕ, g.natDegree * q ^ m = f.natDegree := by obtain ⟨m, rfl⟩ := hf.2 use m rw [natDegree_expand] #align polynomial.is_separable_contraction.dvd_degree' Polynomial.IsSeparableContraction.dvd_degree' theorem HasSeparableContraction.dvd_degree' : ∃ m : ℕ, hf.degree * q ^ m = f.natDegree := (Classical.choose_spec hf).dvd_degree' hf #align polynomial.has_separable_contraction.dvd_degree' Polynomial.HasSeparableContraction.dvd_degree' theorem HasSeparableContraction.dvd_degree : hf.degree ∣ f.natDegree := let ⟨a, ha⟩ := hf.dvd_degree' Dvd.intro (q ^ a) ha #align polynomial.has_separable_contraction.dvd_degree Polynomial.HasSeparableContraction.dvd_degree
Mathlib/RingTheory/Polynomial/SeparableDegree.lean
96
99
theorem HasSeparableContraction.eq_degree {f : F[X]} (hf : HasSeparableContraction 1 f) : hf.degree = f.natDegree := by
let ⟨a, ha⟩ := hf.dvd_degree' rw [← ha, one_pow a, mul_one]
import Mathlib.Order.Antichain import Mathlib.Order.UpperLower.Basic import Mathlib.Order.Interval.Set.Basic import Mathlib.Order.RelIso.Set #align_import order.minimal from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" open Function Set variable {α : Type*} (r r₁ r₂ : α → α → Prop) (s t : Set α) (a b : α) def maximals : Set α := { a ∈ s | ∀ ⦃b⦄, b ∈ s → r a b → r b a } #align maximals maximals def minimals : Set α := { a ∈ s | ∀ ⦃b⦄, b ∈ s → r b a → r a b } #align minimals minimals theorem maximals_subset : maximals r s ⊆ s := sep_subset _ _ #align maximals_subset maximals_subset theorem minimals_subset : minimals r s ⊆ s := sep_subset _ _ #align minimals_subset minimals_subset @[simp] theorem maximals_empty : maximals r ∅ = ∅ := sep_empty _ #align maximals_empty maximals_empty @[simp] theorem minimals_empty : minimals r ∅ = ∅ := sep_empty _ #align minimals_empty minimals_empty @[simp] theorem maximals_singleton : maximals r {a} = {a} := (maximals_subset _ _).antisymm <| singleton_subset_iff.2 <| ⟨rfl, by rintro b (rfl : b = a) exact id⟩ #align maximals_singleton maximals_singleton @[simp] theorem minimals_singleton : minimals r {a} = {a} := maximals_singleton _ _ #align minimals_singleton minimals_singleton theorem maximals_swap : maximals (swap r) s = minimals r s := rfl #align maximals_swap maximals_swap theorem minimals_swap : minimals (swap r) s = maximals r s := rfl #align minimals_swap minimals_swap section IsAntisymm variable {r s t a b} [IsAntisymm α r] theorem eq_of_mem_maximals (ha : a ∈ maximals r s) (hb : b ∈ s) (h : r a b) : a = b := antisymm h <| ha.2 hb h #align eq_of_mem_maximals eq_of_mem_maximals theorem eq_of_mem_minimals (ha : a ∈ minimals r s) (hb : b ∈ s) (h : r b a) : a = b := antisymm (ha.2 hb h) h #align eq_of_mem_minimals eq_of_mem_minimals set_option autoImplicit true theorem mem_maximals_iff : x ∈ maximals r s ↔ x ∈ s ∧ ∀ ⦃y⦄, y ∈ s → r x y → x = y := by simp only [maximals, Set.mem_sep_iff, and_congr_right_iff] refine fun _ ↦ ⟨fun h y hys hxy ↦ antisymm hxy (h hys hxy), fun h y hys hxy ↦ ?_⟩ convert hxy <;> rw [h hys hxy] theorem mem_maximals_setOf_iff : x ∈ maximals r (setOf P) ↔ P x ∧ ∀ ⦃y⦄, P y → r x y → x = y := mem_maximals_iff theorem mem_minimals_iff : x ∈ minimals r s ↔ x ∈ s ∧ ∀ ⦃y⦄, y ∈ s → r y x → x = y := @mem_maximals_iff _ _ _ (IsAntisymm.swap r) _ theorem mem_minimals_setOf_iff : x ∈ minimals r (setOf P) ↔ P x ∧ ∀ ⦃y⦄, P y → r y x → x = y := mem_minimals_iff theorem mem_minimals_iff_forall_lt_not_mem' (rlt : α → α → Prop) [IsNonstrictStrictOrder α r rlt] : x ∈ minimals r s ↔ x ∈ s ∧ ∀ ⦃y⦄, rlt y x → y ∉ s := by simp [minimals, right_iff_left_not_left_of r rlt, not_imp_not, imp.swap (a := _ ∈ _)]
Mathlib/Order/Minimal.lean
117
119
theorem mem_maximals_iff_forall_lt_not_mem' (rlt : α → α → Prop) [IsNonstrictStrictOrder α r rlt] : x ∈ maximals r s ↔ x ∈ s ∧ ∀ ⦃y⦄, rlt x y → y ∉ s := by
simp [maximals, right_iff_left_not_left_of r rlt, not_imp_not, imp.swap (a := _ ∈ _)]
import Mathlib.Order.UpperLower.Basic import Mathlib.Data.Finset.Preimage #align_import combinatorics.young.young_diagram from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" open Function @[ext] structure YoungDiagram where cells : Finset (ℕ × ℕ) isLowerSet : IsLowerSet (cells : Set (ℕ × ℕ)) #align young_diagram YoungDiagram namespace YoungDiagram instance : SetLike YoungDiagram (ℕ × ℕ) where -- Porting note (#11215): TODO: figure out how to do this correctly coe := fun y => y.cells coe_injective' μ ν h := by rwa [YoungDiagram.ext_iff, ← Finset.coe_inj] @[simp] theorem mem_cells {μ : YoungDiagram} (c : ℕ × ℕ) : c ∈ μ.cells ↔ c ∈ μ := Iff.rfl #align young_diagram.mem_cells YoungDiagram.mem_cells @[simp] theorem mem_mk (c : ℕ × ℕ) (cells) (isLowerSet) : c ∈ YoungDiagram.mk cells isLowerSet ↔ c ∈ cells := Iff.rfl #align young_diagram.mem_mk YoungDiagram.mem_mk instance decidableMem (μ : YoungDiagram) : DecidablePred (· ∈ μ) := inferInstanceAs (DecidablePred (· ∈ μ.cells)) #align young_diagram.decidable_mem YoungDiagram.decidableMem theorem up_left_mem (μ : YoungDiagram) {i1 i2 j1 j2 : ℕ} (hi : i1 ≤ i2) (hj : j1 ≤ j2) (hcell : (i2, j2) ∈ μ) : (i1, j1) ∈ μ := μ.isLowerSet (Prod.mk_le_mk.mpr ⟨hi, hj⟩) hcell #align young_diagram.up_left_mem YoungDiagram.up_left_mem protected abbrev card (μ : YoungDiagram) : ℕ := μ.cells.card #align young_diagram.card YoungDiagram.card section Rows def row (μ : YoungDiagram) (i : ℕ) : Finset (ℕ × ℕ) := μ.cells.filter fun c => c.fst = i #align young_diagram.row YoungDiagram.row theorem mem_row_iff {μ : YoungDiagram} {i : ℕ} {c : ℕ × ℕ} : c ∈ μ.row i ↔ c ∈ μ ∧ c.fst = i := by simp [row] #align young_diagram.mem_row_iff YoungDiagram.mem_row_iff theorem mk_mem_row_iff {μ : YoungDiagram} {i j : ℕ} : (i, j) ∈ μ.row i ↔ (i, j) ∈ μ := by simp [row] #align young_diagram.mk_mem_row_iff YoungDiagram.mk_mem_row_iff protected theorem exists_not_mem_row (μ : YoungDiagram) (i : ℕ) : ∃ j, (i, j) ∉ μ := by obtain ⟨j, hj⟩ := Infinite.exists_not_mem_finset (μ.cells.preimage (Prod.mk i) fun _ _ _ _ h => by cases h rfl) rw [Finset.mem_preimage] at hj exact ⟨j, hj⟩ #align young_diagram.exists_not_mem_row YoungDiagram.exists_not_mem_row def rowLen (μ : YoungDiagram) (i : ℕ) : ℕ := Nat.find <| μ.exists_not_mem_row i #align young_diagram.row_len YoungDiagram.rowLen
Mathlib/Combinatorics/Young/YoungDiagram.lean
307
310
theorem mem_iff_lt_rowLen {μ : YoungDiagram} {i j : ℕ} : (i, j) ∈ μ ↔ j < μ.rowLen i := by
rw [rowLen, Nat.lt_find_iff] push_neg exact ⟨fun h _ hmj => μ.up_left_mem (by rfl) hmj h, fun h => h _ (by rfl)⟩
import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.Exponent #align_import group_theory.specific_groups.dihedral from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" inductive DihedralGroup (n : ℕ) : Type | r : ZMod n → DihedralGroup n | sr : ZMod n → DihedralGroup n deriving DecidableEq #align dihedral_group DihedralGroup namespace DihedralGroup variable {n : ℕ} private def mul : DihedralGroup n → DihedralGroup n → DihedralGroup n | r i, r j => r (i + j) | r i, sr j => sr (j - i) | sr i, r j => sr (i + j) | sr i, sr j => r (j - i) private def one : DihedralGroup n := r 0 instance : Inhabited (DihedralGroup n) := ⟨one⟩ private def inv : DihedralGroup n → DihedralGroup n | r i => r (-i) | sr i => sr i instance : Group (DihedralGroup n) where mul := mul mul_assoc := by rintro (a | a) (b | b) (c | c) <;> simp only [(· * ·), mul] <;> ring_nf one := one one_mul := by rintro (a | a) · exact congr_arg r (zero_add a) · exact congr_arg sr (sub_zero a) mul_one := by rintro (a | a) · exact congr_arg r (add_zero a) · exact congr_arg sr (add_zero a) inv := inv mul_left_inv := by rintro (a | a) · exact congr_arg r (neg_add_self a) · exact congr_arg r (sub_self a) @[simp] theorem r_mul_r (i j : ZMod n) : r i * r j = r (i + j) := rfl #align dihedral_group.r_mul_r DihedralGroup.r_mul_r @[simp] theorem r_mul_sr (i j : ZMod n) : r i * sr j = sr (j - i) := rfl #align dihedral_group.r_mul_sr DihedralGroup.r_mul_sr @[simp] theorem sr_mul_r (i j : ZMod n) : sr i * r j = sr (i + j) := rfl #align dihedral_group.sr_mul_r DihedralGroup.sr_mul_r @[simp] theorem sr_mul_sr (i j : ZMod n) : sr i * sr j = r (j - i) := rfl #align dihedral_group.sr_mul_sr DihedralGroup.sr_mul_sr theorem one_def : (1 : DihedralGroup n) = r 0 := rfl #align dihedral_group.one_def DihedralGroup.one_def private def fintypeHelper : Sum (ZMod n) (ZMod n) ≃ DihedralGroup n where invFun i := match i with | r j => Sum.inl j | sr j => Sum.inr j toFun i := match i with | Sum.inl j => r j | Sum.inr j => sr j left_inv := by rintro (x | x) <;> rfl right_inv := by rintro (x | x) <;> rfl instance [NeZero n] : Fintype (DihedralGroup n) := Fintype.ofEquiv _ fintypeHelper instance : Infinite (DihedralGroup 0) := DihedralGroup.fintypeHelper.infinite_iff.mp inferInstance instance : Nontrivial (DihedralGroup n) := ⟨⟨r 0, sr 0, by simp_rw [ne_eq, not_false_eq_true]⟩⟩ theorem card [NeZero n] : Fintype.card (DihedralGroup n) = 2 * n := by rw [← Fintype.card_eq.mpr ⟨fintypeHelper⟩, Fintype.card_sum, ZMod.card, two_mul] #align dihedral_group.card DihedralGroup.card theorem nat_card : Nat.card (DihedralGroup n) = 2 * n := by cases n · rw [Nat.card_eq_zero_of_infinite] · rw [Nat.card_eq_fintype_card, card] @[simp] theorem r_one_pow (k : ℕ) : (r 1 : DihedralGroup n) ^ k = r k := by induction' k with k IH · rw [Nat.cast_zero] rfl · rw [pow_succ', IH, r_mul_r] congr 1 norm_cast rw [Nat.one_add] #align dihedral_group.r_one_pow DihedralGroup.r_one_pow -- @[simp] -- Porting note: simp changes the goal to `r 0 = 1`. `r_one_pow_n` is no longer useful. theorem r_one_pow_n : r (1 : ZMod n) ^ n = 1 := by rw [r_one_pow, one_def] congr 1 exact ZMod.natCast_self _ #align dihedral_group.r_one_pow_n DihedralGroup.r_one_pow_n -- @[simp] -- Porting note: simp changes the goal to `r 0 = 1`. `sr_mul_self` is no longer useful. theorem sr_mul_self (i : ZMod n) : sr i * sr i = 1 := by rw [sr_mul_sr, sub_self, one_def] #align dihedral_group.sr_mul_self DihedralGroup.sr_mul_self @[simp]
Mathlib/GroupTheory/SpecificGroups/Dihedral.lean
159
164
theorem orderOf_sr (i : ZMod n) : orderOf (sr i) = 2 := by
apply orderOf_eq_prime · rw [sq, sr_mul_self] · -- Porting note: Previous proof was `decide` revert n simp_rw [one_def, ne_eq, forall_const, not_false_eq_true]
import Mathlib.Topology.MetricSpace.PseudoMetric #align_import topology.metric_space.basic from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328" open Set Filter Bornology open scoped NNReal Uniformity universe u v w variable {α : Type u} {β : Type v} {X ι : Type*} variable [PseudoMetricSpace α] class MetricSpace (α : Type u) extends PseudoMetricSpace α : Type u where eq_of_dist_eq_zero : ∀ {x y : α}, dist x y = 0 → x = y #align metric_space MetricSpace @[ext] theorem MetricSpace.ext {α : Type*} {m m' : MetricSpace α} (h : m.toDist = m'.toDist) : m = m' := by cases m; cases m'; congr; ext1; assumption #align metric_space.ext MetricSpace.ext def MetricSpace.ofDistTopology {α : Type u} [TopologicalSpace α] (dist : α → α → ℝ) (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x) (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) (H : ∀ s : Set α, IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s) (eq_of_dist_eq_zero : ∀ x y : α, dist x y = 0 → x = y) : MetricSpace α := { PseudoMetricSpace.ofDistTopology dist dist_self dist_comm dist_triangle H with eq_of_dist_eq_zero := eq_of_dist_eq_zero _ _ } #align metric_space.of_dist_topology MetricSpace.ofDistTopology variable {γ : Type w} [MetricSpace γ] theorem eq_of_dist_eq_zero {x y : γ} : dist x y = 0 → x = y := MetricSpace.eq_of_dist_eq_zero #align eq_of_dist_eq_zero eq_of_dist_eq_zero @[simp] theorem dist_eq_zero {x y : γ} : dist x y = 0 ↔ x = y := Iff.intro eq_of_dist_eq_zero fun this => this ▸ dist_self _ #align dist_eq_zero dist_eq_zero @[simp] theorem zero_eq_dist {x y : γ} : 0 = dist x y ↔ x = y := by rw [eq_comm, dist_eq_zero] #align zero_eq_dist zero_eq_dist theorem dist_ne_zero {x y : γ} : dist x y ≠ 0 ↔ x ≠ y := by simpa only [not_iff_not] using dist_eq_zero #align dist_ne_zero dist_ne_zero @[simp] theorem dist_le_zero {x y : γ} : dist x y ≤ 0 ↔ x = y := by simpa [le_antisymm_iff, dist_nonneg] using @dist_eq_zero _ _ x y #align dist_le_zero dist_le_zero @[simp]
Mathlib/Topology/MetricSpace/Basic.lean
87
88
theorem dist_pos {x y : γ} : 0 < dist x y ↔ x ≠ y := by
simpa only [not_le] using not_congr dist_le_zero
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 presieveOfCovering variable {ι : Type v} (U : ι → Opens X)
Mathlib/Topology/Sheaves/SheafCondition/Sites.lean
103
107
theorem mem_grothendieckTopology : Sieve.generate (presieveOfCovering U) ∈ Opens.grothendieckTopology X (iSup U) := by
intro x hx obtain ⟨i, hxi⟩ := Opens.mem_iSup.mp hx exact ⟨U i, Opens.leSupr U i, ⟨U i, 𝟙 _, Opens.leSupr U i, ⟨i, rfl⟩, Category.id_comp _⟩, hxi⟩
import Mathlib.LinearAlgebra.Matrix.Basis import Mathlib.LinearAlgebra.Matrix.Nondegenerate import Mathlib.LinearAlgebra.Matrix.NonsingularInverse import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.LinearAlgebra.BilinearForm.Properties import Mathlib.LinearAlgebra.Matrix.SesquilinearForm #align_import linear_algebra.matrix.bilinear_form from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" open LinearMap (BilinForm) variable {R : Type*} {M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] variable {R₁ : Type*} {M₁ : Type*} [CommRing R₁] [AddCommGroup M₁] [Module R₁ M₁] variable {R₂ : Type*} {M₂ : Type*} [CommSemiring R₂] [AddCommMonoid M₂] [Module R₂ M₂] variable {R₃ : Type*} {M₃ : Type*} [CommRing R₃] [AddCommGroup M₃] [Module R₃ M₃] variable {V : Type*} {K : Type*} [Field K] [AddCommGroup V] [Module K V] variable {B : BilinForm R M} {B₁ : BilinForm R₁ M₁} {B₂ : BilinForm R₂ M₂} section Matrix variable {n o : Type*} open Finset LinearMap Matrix open Matrix def Matrix.toBilin'Aux [Fintype n] (M : Matrix n n R₂) : BilinForm R₂ (n → R₂) := Matrix.toLinearMap₂'Aux _ _ M #align matrix.to_bilin'_aux Matrix.toBilin'Aux theorem Matrix.toBilin'Aux_stdBasis [Fintype n] [DecidableEq n] (M : Matrix n n R₂) (i j : n) : M.toBilin'Aux (LinearMap.stdBasis R₂ (fun _ => R₂) i 1) (LinearMap.stdBasis R₂ (fun _ => R₂) j 1) = M i j := Matrix.toLinearMap₂'Aux_stdBasis _ _ _ _ _ #align matrix.to_bilin'_aux_std_basis Matrix.toBilin'Aux_stdBasis def BilinForm.toMatrixAux (b : n → M₂) : BilinForm R₂ M₂ →ₗ[R₂] Matrix n n R₂ := LinearMap.toMatrix₂Aux b b #align bilin_form.to_matrix_aux BilinForm.toMatrixAux @[simp] theorem LinearMap.BilinForm.toMatrixAux_apply (B : BilinForm R₂ M₂) (b : n → M₂) (i j : n) : -- Porting note: had to hint the base ring even though it should be clear from context... BilinForm.toMatrixAux (R₂ := R₂) b B i j = B (b i) (b j) := LinearMap.toMatrix₂Aux_apply B _ _ _ _ #align bilin_form.to_matrix_aux_apply LinearMap.BilinForm.toMatrixAux_apply variable [Fintype n] [Fintype o]
Mathlib/LinearAlgebra/Matrix/BilinearForm.lean
88
93
theorem toBilin'Aux_toMatrixAux [DecidableEq n] (B₂ : BilinForm R₂ (n → R₂)) : -- Porting note: had to hint the base ring even though it should be clear from context... Matrix.toBilin'Aux (BilinForm.toMatrixAux (R₂ := R₂) (fun j => stdBasis R₂ (fun _ => R₂) j 1) B₂) = B₂ := by
rw [BilinForm.toMatrixAux, Matrix.toBilin'Aux, toLinearMap₂'Aux_toMatrix₂Aux]
import Mathlib.Algebra.Polynomial.RingDivision import Mathlib.RingTheory.Localization.FractionRing #align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8" noncomputable section namespace Polynomial universe u v w z variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : ℕ} section CommRing variable [CommRing R] [IsDomain R] {p q : R[X]} section Roots open Multiset Finset noncomputable def roots (p : R[X]) : Multiset R := haveI := Classical.decEq R haveI := Classical.dec (p = 0) if h : p = 0 then ∅ else Classical.choose (exists_multiset_roots h) #align polynomial.roots Polynomial.roots
Mathlib/Algebra/Polynomial/Roots.lean
55
61
theorem roots_def [DecidableEq R] (p : R[X]) [Decidable (p = 0)] : p.roots = if h : p = 0 then ∅ else Classical.choose (exists_multiset_roots h) := by
-- porting noteL `‹_›` doesn't work for instance arguments rename_i iR ip0 obtain rfl := Subsingleton.elim iR (Classical.decEq R) obtain rfl := Subsingleton.elim ip0 (Classical.dec (p = 0)) rfl
import Mathlib.Algebra.Order.Monoid.Unbundled.Basic #align_import algebra.order.monoid.min_max from "leanprover-community/mathlib"@"de87d5053a9fe5cbde723172c0fb7e27e7436473" open Function variable {α β : Type*} section CovariantClassMulLe variable [LinearOrder α] section Mul variable [Mul α] @[to_additive] theorem lt_or_lt_of_mul_lt_mul [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a₁ a₂ b₁ b₂ : α} : a₁ * b₁ < a₂ * b₂ → a₁ < a₂ ∨ b₁ < b₂ := by contrapose! exact fun h => mul_le_mul' h.1 h.2 #align lt_or_lt_of_mul_lt_mul lt_or_lt_of_mul_lt_mul #align lt_or_lt_of_add_lt_add lt_or_lt_of_add_lt_add @[to_additive] theorem le_or_lt_of_mul_le_mul [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (Function.swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} : a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ < b₂ := by contrapose! exact fun h => mul_lt_mul_of_lt_of_le h.1 h.2 #align le_or_lt_of_mul_le_mul le_or_lt_of_mul_le_mul #align le_or_lt_of_add_le_add le_or_lt_of_add_le_add @[to_additive] theorem lt_or_le_of_mul_le_mul [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a₁ a₂ b₁ b₂ : α} : a₁ * b₁ ≤ a₂ * b₂ → a₁ < a₂ ∨ b₁ ≤ b₂ := by contrapose! exact fun h => mul_lt_mul_of_le_of_lt h.1 h.2 #align lt_or_le_of_mul_le_mul lt_or_le_of_mul_le_mul #align lt_or_le_of_add_le_add lt_or_le_of_add_le_add @[to_additive]
Mathlib/Algebra/Order/Monoid/Unbundled/MinMax.lean
117
121
theorem le_or_le_of_mul_le_mul [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (Function.swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} : a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ ≤ b₂ := by
contrapose! exact fun h => mul_lt_mul_of_lt_of_lt h.1 h.2
import Mathlib.MeasureTheory.OuterMeasure.Caratheodory #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 open OuterMeasure section Extend variable {α : Type*} {P : α → Prop} variable (m : ∀ s : α, P s → ℝ≥0∞) def extend (s : α) : ℝ≥0∞ := ⨅ h : P s, m s h #align measure_theory.extend MeasureTheory.extend
Mathlib/MeasureTheory/OuterMeasure/Induced.lean
49
49
theorem extend_eq {s : α} (h : P s) : extend m s = m s h := by
simp [extend, h]
import Mathlib.Data.Stream.Init import Mathlib.Tactic.ApplyFun import Mathlib.Control.Fix import Mathlib.Order.OmegaCompletePartialOrder #align_import control.lawful_fix from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v open scoped Classical variable {α : Type*} {β : α → Type*} open OmegaCompletePartialOrder class LawfulFix (α : Type*) [OmegaCompletePartialOrder α] extends Fix α where fix_eq : ∀ {f : α →o α}, Continuous f → Fix.fix f = f (Fix.fix f) #align lawful_fix LawfulFix theorem LawfulFix.fix_eq' {α} [OmegaCompletePartialOrder α] [LawfulFix α] {f : α → α} (hf : Continuous' f) : Fix.fix f = f (Fix.fix f) := LawfulFix.fix_eq (hf.to_bundled _) #align lawful_fix.fix_eq' LawfulFix.fix_eq' namespace Part open Part Nat Nat.Upto namespace Fix variable (f : ((a : _) → Part <| β a) →o (a : _) → Part <| β a)
Mathlib/Control/LawfulFix.lean
57
60
theorem approx_mono' {i : ℕ} : Fix.approx f i ≤ Fix.approx f (succ i) := by
induction i with | zero => dsimp [approx]; apply @bot_le _ _ _ (f ⊥) | succ _ i_ih => intro; apply f.monotone; apply i_ih
import Mathlib.Algebra.Module.DedekindDomain import Mathlib.LinearAlgebra.FreeModule.PID import Mathlib.Algebra.Module.Projective import Mathlib.Algebra.Category.ModuleCat.Biproducts import Mathlib.RingTheory.SimpleModule #align_import algebra.module.pid from "leanprover-community/mathlib"@"cdc34484a07418af43daf8198beaf5c00324bca8" universe u v open scoped Classical variable {R : Type u} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] variable {M : Type v} [AddCommGroup M] [Module R M] variable {N : Type max u v} [AddCommGroup N] [Module R N] open scoped DirectSum open Submodule open UniqueFactorizationMonoid theorem Submodule.isSemisimple_torsionBy_of_irreducible {a : R} (h : Irreducible a) : IsSemisimpleModule R (torsionBy R M a) := haveI := PrincipalIdealRing.isMaximal_of_irreducible h letI := Ideal.Quotient.field (R ∙ a) (submodule_torsionBy_orderIso a).complementedLattice theorem Submodule.isInternal_prime_power_torsion_of_pid [Module.Finite R M] (hM : Module.IsTorsion R M) : DirectSum.IsInternal fun p : (factors (⊤ : Submodule R M).annihilator).toFinset => torsionBy R M (IsPrincipal.generator (p : Ideal R) ^ (factors (⊤ : Submodule R M).annihilator).count ↑p) := by convert isInternal_prime_power_torsion hM ext p : 1 rw [← torsionBySet_span_singleton_eq, Ideal.submodule_span_eq, ← Ideal.span_singleton_pow, Ideal.span_singleton_generator] #align submodule.is_internal_prime_power_torsion_of_pid Submodule.isInternal_prime_power_torsion_of_pid
Mathlib/Algebra/Module/PID.lean
89
98
theorem Submodule.exists_isInternal_prime_power_torsion_of_pid [Module.Finite R M] (hM : Module.IsTorsion R M) : ∃ (ι : Type u) (_ : Fintype ι) (_ : DecidableEq ι) (p : ι → R) (_ : ∀ i, Irreducible <| p i) (e : ι → ℕ), DirectSum.IsInternal fun i => torsionBy R M <| p i ^ e i := by
refine ⟨_, ?_, _, _, ?_, _, Submodule.isInternal_prime_power_torsion_of_pid hM⟩ · exact Finset.fintypeCoeSort _ · rintro ⟨p, hp⟩ have hP := prime_of_factor p (Multiset.mem_toFinset.mp hp) haveI := Ideal.isPrime_of_prime hP exact (IsPrincipal.prime_generator_of_isPrime p hP.ne_zero).irreducible
import Mathlib.Algebra.BigOperators.Intervals import Mathlib.Algebra.Module.Defs import Mathlib.Tactic.Abel namespace Finset variable {R M : Type*} [Ring R] [AddCommGroup M] [Module R M] (f : ℕ → R) (g : ℕ → M) {m n : ℕ} -- The partial sum of `g`, starting from zero local notation "G " n:80 => ∑ i ∈ range n, g i theorem sum_Ico_by_parts (hmn : m < n) : ∑ i ∈ Ico m n, f i • g i = f (n - 1) • G n - f m • G m - ∑ i ∈ Ico m (n - 1), (f (i + 1) - f i) • G (i + 1) := by have h₁ : (∑ i ∈ Ico (m + 1) n, f i • G i) = ∑ i ∈ Ico m (n - 1), f (i + 1) • G (i + 1) := by rw [← Nat.sub_add_cancel (Nat.one_le_of_lt hmn), ← sum_Ico_add'] simp only [ge_iff_le, tsub_le_iff_right, add_le_iff_nonpos_left, nonpos_iff_eq_zero, tsub_eq_zero_iff_le, add_tsub_cancel_right] have h₂ : (∑ i ∈ Ico (m + 1) n, f i • G (i + 1)) = (∑ i ∈ Ico m (n - 1), f i • G (i + 1)) + f (n - 1) • G n - f m • G (m + 1) := by rw [← sum_Ico_sub_bot _ hmn, ← sum_Ico_succ_sub_top _ (Nat.le_sub_one_of_lt hmn), Nat.sub_add_cancel (pos_of_gt hmn), sub_add_cancel] rw [sum_eq_sum_Ico_succ_bot hmn] -- Porting note: the following used to be done with `conv` have h₃: (Finset.sum (Ico (m + 1) n) fun i => f i • g i) = (Finset.sum (Ico (m + 1) n) fun i => f i • ((Finset.sum (Finset.range (i + 1)) g) - (Finset.sum (Finset.range i) g))) := by congr; funext; rw [← sum_range_succ_sub_sum g] rw [h₃] simp_rw [smul_sub, sum_sub_distrib, h₂, h₁] -- Porting note: the following used to be done with `conv` have h₄ : ((((Finset.sum (Ico m (n - 1)) fun i => f i • Finset.sum (range (i + 1)) fun i => g i) + f (n - 1) • Finset.sum (range n) fun i => g i) - f m • Finset.sum (range (m + 1)) fun i => g i) - Finset.sum (Ico m (n - 1)) fun i => f (i + 1) • Finset.sum (range (i + 1)) fun i => g i) = f (n - 1) • (range n).sum g - f m • (range (m + 1)).sum g + Finset.sum (Ico m (n - 1)) (fun i => f i • (range (i + 1)).sum g - f (i + 1) • (range (i + 1)).sum g) := by rw [← add_sub, add_comm, ← add_sub, ← sum_sub_distrib] rw [h₄] have : ∀ i, f i • G (i + 1) - f (i + 1) • G (i + 1) = -((f (i + 1) - f i) • G (i + 1)) := by intro i rw [sub_smul] abel simp_rw [this, sum_neg_distrib, sum_range_succ, smul_add] abel #align finset.sum_Ico_by_parts Finset.sum_Ico_by_parts variable (n)
Mathlib/Algebra/BigOperators/Module.lean
63
69
theorem sum_range_by_parts : ∑ i ∈ range n, f i • g i = f (n - 1) • G n - ∑ i ∈ range (n - 1), (f (i + 1) - f i) • G (i + 1) := by
by_cases hn : n = 0 · simp [hn] · rw [range_eq_Ico, sum_Ico_by_parts f g (Nat.pos_of_ne_zero hn), sum_range_zero, smul_zero, sub_zero, range_eq_Ico]
import Mathlib.Algebra.MvPolynomial.Rename #align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee" namespace MvPolynomial variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R] noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R := fun x i => aeval x (f (X i)) #align mv_polynomial.comap MvPolynomial.comap @[simp] theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) : comap f x i = aeval x (f (X i)) := rfl #align mv_polynomial.comap_apply MvPolynomial.comap_apply @[simp] theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by funext i simp only [comap, AlgHom.id_apply, id, aeval_X] #align mv_polynomial.comap_id_apply MvPolynomial.comap_id_apply variable (σ R) theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id := by funext x exact comap_id_apply x #align mv_polynomial.comap_id MvPolynomial.comap_id variable {σ R} theorem comap_comp_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) (x : υ → R) : comap (g.comp f) x = comap f (comap g x) := by funext i trans aeval x (aeval (fun i => g (X i)) (f (X i))) · apply eval₂Hom_congr rfl rfl rw [AlgHom.comp_apply] suffices g = aeval fun i => g (X i) by rw [← this] exact aeval_unique g · simp only [comap, aeval_eq_eval₂Hom, map_eval₂Hom, AlgHom.comp_apply] refine eval₂Hom_congr ?_ rfl rfl ext r apply aeval_C #align mv_polynomial.comap_comp_apply MvPolynomial.comap_comp_apply theorem comap_comp (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (g : MvPolynomial τ R →ₐ[R] MvPolynomial υ R) : comap (g.comp f) = comap f ∘ comap g := by funext x exact comap_comp_apply _ _ _ #align mv_polynomial.comap_comp MvPolynomial.comap_comp theorem comap_eq_id_of_eq_id (f : MvPolynomial σ R →ₐ[R] MvPolynomial σ R) (hf : ∀ φ, f φ = φ) (x : σ → R) : comap f x = x := by convert comap_id_apply x ext1 φ simp [hf, AlgHom.id_apply] #align mv_polynomial.comap_eq_id_of_eq_id MvPolynomial.comap_eq_id_of_eq_id
Mathlib/Algebra/MvPolynomial/Comap.lean
90
92
theorem comap_rename (f : σ → τ) (x : τ → R) : comap (rename f) x = x ∘ f := by
funext simp [rename_X, comap_apply, aeval_X]
import Mathlib.Algebra.ContinuedFractions.Translations #align_import algebra.continued_fractions.continuants_recurrence from "leanprover-community/mathlib"@"5f11361a98ae4acd77f5c1837686f6f0102cdc25" namespace GeneralizedContinuedFraction variable {K : Type*} {g : GeneralizedContinuedFraction K} {n : ℕ} [DivisionRing K] theorem continuantsAux_recurrence {gp ppred pred : Pair K} (nth_s_eq : g.s.get? n = some gp) (nth_conts_aux_eq : g.continuantsAux n = ppred) (succ_nth_conts_aux_eq : g.continuantsAux (n + 1) = pred) : g.continuantsAux (n + 2) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ := by simp [*, continuantsAux, nextContinuants, nextDenominator, nextNumerator] #align generalized_continued_fraction.continuants_aux_recurrence GeneralizedContinuedFraction.continuantsAux_recurrence theorem continuants_recurrenceAux {gp ppred pred : Pair K} (nth_s_eq : g.s.get? n = some gp) (nth_conts_aux_eq : g.continuantsAux n = ppred) (succ_nth_conts_aux_eq : g.continuantsAux (n + 1) = pred) : g.continuants (n + 1) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ := by simp [nth_cont_eq_succ_nth_cont_aux, continuantsAux_recurrence nth_s_eq nth_conts_aux_eq succ_nth_conts_aux_eq] #align generalized_continued_fraction.continuants_recurrence_aux GeneralizedContinuedFraction.continuants_recurrenceAux
Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean
42
46
theorem continuants_recurrence {gp ppred pred : Pair K} (succ_nth_s_eq : g.s.get? (n + 1) = some gp) (nth_conts_eq : g.continuants n = ppred) (succ_nth_conts_eq : g.continuants (n + 1) = pred) : g.continuants (n + 2) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ := by
rw [nth_cont_eq_succ_nth_cont_aux] at nth_conts_eq succ_nth_conts_eq exact continuants_recurrenceAux succ_nth_s_eq nth_conts_eq succ_nth_conts_eq
import Mathlib.Algebra.IsPrimePow import Mathlib.NumberTheory.ArithmeticFunction import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import number_theory.von_mangoldt from "leanprover-community/mathlib"@"c946d6097a6925ad16d7ec55677bbc977f9846de" namespace ArithmeticFunction open Finset Nat open scoped ArithmeticFunction noncomputable def log : ArithmeticFunction ℝ := ⟨fun n => Real.log n, by simp⟩ #align nat.arithmetic_function.log ArithmeticFunction.log @[simp] theorem log_apply {n : ℕ} : log n = Real.log n := rfl #align nat.arithmetic_function.log_apply ArithmeticFunction.log_apply noncomputable def vonMangoldt : ArithmeticFunction ℝ := ⟨fun n => if IsPrimePow n then Real.log (minFac n) else 0, if_neg not_isPrimePow_zero⟩ #align nat.arithmetic_function.von_mangoldt ArithmeticFunction.vonMangoldt @[inherit_doc] scoped[ArithmeticFunction] notation "Λ" => ArithmeticFunction.vonMangoldt @[inherit_doc] scoped[ArithmeticFunction.vonMangoldt] notation "Λ" => ArithmeticFunction.vonMangoldt theorem vonMangoldt_apply {n : ℕ} : Λ n = if IsPrimePow n then Real.log (minFac n) else 0 := rfl #align nat.arithmetic_function.von_mangoldt_apply ArithmeticFunction.vonMangoldt_apply @[simp] theorem vonMangoldt_apply_one : Λ 1 = 0 := by simp [vonMangoldt_apply] #align nat.arithmetic_function.von_mangoldt_apply_one ArithmeticFunction.vonMangoldt_apply_one @[simp] theorem vonMangoldt_nonneg {n : ℕ} : 0 ≤ Λ n := by rw [vonMangoldt_apply] split_ifs · exact Real.log_nonneg (one_le_cast.2 (Nat.minFac_pos n)) rfl #align nat.arithmetic_function.von_mangoldt_nonneg ArithmeticFunction.vonMangoldt_nonneg theorem vonMangoldt_apply_pow {n k : ℕ} (hk : k ≠ 0) : Λ (n ^ k) = Λ n := by simp only [vonMangoldt_apply, isPrimePow_pow_iff hk, pow_minFac hk] #align nat.arithmetic_function.von_mangoldt_apply_pow ArithmeticFunction.vonMangoldt_apply_pow theorem vonMangoldt_apply_prime {p : ℕ} (hp : p.Prime) : Λ p = Real.log p := by rw [vonMangoldt_apply, Prime.minFac_eq hp, if_pos hp.prime.isPrimePow] #align nat.arithmetic_function.von_mangoldt_apply_prime ArithmeticFunction.vonMangoldt_apply_prime theorem vonMangoldt_ne_zero_iff {n : ℕ} : Λ n ≠ 0 ↔ IsPrimePow n := by rcases eq_or_ne n 1 with (rfl | hn); · simp [not_isPrimePow_one] exact (Real.log_pos (one_lt_cast.2 (minFac_prime hn).one_lt)).ne'.ite_ne_right_iff #align nat.arithmetic_function.von_mangoldt_ne_zero_iff ArithmeticFunction.vonMangoldt_ne_zero_iff theorem vonMangoldt_pos_iff {n : ℕ} : 0 < Λ n ↔ IsPrimePow n := vonMangoldt_nonneg.lt_iff_ne.trans (ne_comm.trans vonMangoldt_ne_zero_iff) #align nat.arithmetic_function.von_mangoldt_pos_iff ArithmeticFunction.vonMangoldt_pos_iff theorem vonMangoldt_eq_zero_iff {n : ℕ} : Λ n = 0 ↔ ¬IsPrimePow n := vonMangoldt_ne_zero_iff.not_right #align nat.arithmetic_function.von_mangoldt_eq_zero_iff ArithmeticFunction.vonMangoldt_eq_zero_iff
Mathlib/NumberTheory/VonMangoldt.lean
111
122
theorem vonMangoldt_sum {n : ℕ} : ∑ i ∈ n.divisors, Λ i = Real.log n := by
refine recOnPrimeCoprime ?_ ?_ ?_ n · simp · intro p k hp rw [sum_divisors_prime_pow hp, cast_pow, Real.log_pow, Finset.sum_range_succ', Nat.pow_zero, vonMangoldt_apply_one] simp [vonMangoldt_apply_pow (Nat.succ_ne_zero _), vonMangoldt_apply_prime hp] intro a b ha' hb' hab ha hb simp only [vonMangoldt_apply, ← sum_filter] at ha hb ⊢ rw [mul_divisors_filter_prime_pow hab, filter_union, sum_union (disjoint_divisors_filter_isPrimePow hab), ha, hb, Nat.cast_mul, Real.log_mul (cast_ne_zero.2 (pos_of_gt ha').ne') (cast_ne_zero.2 (pos_of_gt hb').ne')]