Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.57k
proof
stringlengths
5
7.36k
hint
bool
2 classes
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {α β γ δ : Type*} {ι : Sort y} {s t u : Set α} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : ℚ) (b : ℚ) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : ℚ → ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp)
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
56
66
theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Ioi (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : ℚ → ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp)
false
import Mathlib.SetTheory.Cardinal.Finite #align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8" noncomputable section open scoped Classical variable {α β γ : Type*} def Finite.equivFin (α : Type*) [Finite α] : α ≃ Fin (Nat.card α) := by have := (Finite.exists_equiv_fin α).choose_spec.some rwa [Nat.card_eq_of_equiv_fin this] #align finite.equiv_fin Finite.equivFin def Finite.equivFinOfCardEq [Finite α] {n : ℕ} (h : Nat.card α = n) : α ≃ Fin n := by subst h apply Finite.equivFin #align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq theorem Nat.card_eq (α : Type*) : Nat.card α = if h : Finite α then @Fintype.card α (Fintype.ofFinite α) else 0 := by cases finite_or_infinite α · letI := Fintype.ofFinite α simp only [*, Nat.card_eq_fintype_card, dif_pos] · simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false] #align nat.card_eq Nat.card_eq theorem Finite.card_pos_iff [Finite α] : 0 < Nat.card α ↔ Nonempty α := by haveI := Fintype.ofFinite α rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff] #align finite.card_pos_iff Finite.card_pos_iff theorem Finite.card_pos [Finite α] [h : Nonempty α] : 0 < Nat.card α := Finite.card_pos_iff.mpr h #align finite.card_pos Finite.card_pos namespace Finite theorem cast_card_eq_mk {α : Type*} [Finite α] : ↑(Nat.card α) = Cardinal.mk α := Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite α) #align finite.cast_card_eq_mk Finite.cast_card_eq_mk theorem card_eq [Finite α] [Finite β] : Nat.card α = Nat.card β ↔ Nonempty (α ≃ β) := by haveI := Fintype.ofFinite α haveI := Fintype.ofFinite β simp only [Nat.card_eq_fintype_card, Fintype.card_eq] #align finite.card_eq Finite.card_eq theorem card_le_one_iff_subsingleton [Finite α] : Nat.card α ≤ 1 ↔ Subsingleton α := by haveI := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton] #align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
Mathlib/Data/Finite/Card.lean
83
85
theorem one_lt_card_iff_nontrivial [Finite α] : 1 < Nat.card α ↔ Nontrivial α := by
haveI := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
false
import Mathlib.Algebra.Algebra.Bilinear import Mathlib.RingTheory.Localization.Basic #align_import algebra.module.localized_module from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" section IsLocalizedModule universe u v variable {R : Type*} [CommSemiring R] (S : Submonoid R) variable {M M' M'' : Type*} [AddCommMonoid M] [AddCommMonoid M'] [AddCommMonoid M''] variable {A : Type*} [CommSemiring A] [Algebra R A] [Module A M'] [IsLocalization S A] variable [Module R M] [Module R M'] [Module R M''] [IsScalarTower R A M'] variable (f : M →ₗ[R] M') (g : M →ₗ[R] M'') @[mk_iff] class IsLocalizedModule : Prop where map_units : ∀ x : S, IsUnit (algebraMap R (Module.End R M') x) surj' : ∀ y : M', ∃ x : M × S, x.2 • y = f x.1 exists_of_eq : ∀ {x₁ x₂}, f x₁ = f x₂ → ∃ c : S, c • x₁ = c • x₂ #align is_localized_module IsLocalizedModule attribute [nolint docBlame] IsLocalizedModule.map_units IsLocalizedModule.surj' IsLocalizedModule.exists_of_eq -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.surj [IsLocalizedModule S f] (y : M') : ∃ x : M × S, x.2 • y = f x.1 := surj' y -- Porting note: Manually added to make `S` and `f` explicit. lemma IsLocalizedModule.eq_iff_exists [IsLocalizedModule S f] {x₁ x₂} : f x₁ = f x₂ ↔ ∃ c : S, c • x₁ = c • x₂ := Iff.intro exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun f at h simp_rw [f.map_smul_of_tower, Submonoid.smul_def, ← Module.algebraMap_end_apply R R] at h exact ((Module.End_isUnit_iff _).mp <| map_units f c).1 h
Mathlib/Algebra/Module/LocalizedModule.lean
574
588
theorem IsLocalizedModule.of_linearEquiv (e : M' ≃ₗ[R] M'') [hf : IsLocalizedModule S f] : IsLocalizedModule S (e ∘ₗ f : M →ₗ[R] M'') where map_units s := by
rw [show algebraMap R (Module.End R M'') s = e ∘ₗ (algebraMap R (Module.End R M') s) ∘ₗ e.symm by ext; simp, Module.End_isUnit_iff, LinearMap.coe_comp, LinearMap.coe_comp, LinearEquiv.coe_coe, LinearEquiv.coe_coe, EquivLike.comp_bijective, EquivLike.bijective_comp] exact (Module.End_isUnit_iff _).mp <| hf.map_units s surj' x := by obtain ⟨p, h⟩ := hf.surj' (e.symm x) exact ⟨p, by rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, ← e.congr_arg h, Submonoid.smul_def, Submonoid.smul_def, LinearEquiv.map_smul, LinearEquiv.apply_symm_apply]⟩ exists_of_eq h := by simp_rw [LinearMap.coe_comp, LinearEquiv.coe_coe, Function.comp_apply, EmbeddingLike.apply_eq_iff_eq] at h exact hf.exists_of_eq h
false
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.GroupWithZero.Units.Equiv import Mathlib.Algebra.Order.Field.Defs import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Order.Bounds.OrderIso import Mathlib.Tactic.Positivity.Core #align_import algebra.order.field.basic from "leanprover-community/mathlib"@"84771a9f5f0bd5e5d6218811556508ddf476dcbd" open Function OrderDual variable {ι α β : Type*} section LinearOrderedSemifield variable [LinearOrderedSemifield α] {a b c d e : α} {m n : ℤ} @[simps! (config := { simpRhs := true })] def OrderIso.mulLeft₀ (a : α) (ha : 0 < a) : α ≃o α := { Equiv.mulLeft₀ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_left ha } #align order_iso.mul_left₀ OrderIso.mulLeft₀ #align order_iso.mul_left₀_symm_apply OrderIso.mulLeft₀_symm_apply #align order_iso.mul_left₀_apply OrderIso.mulLeft₀_apply @[simps! (config := { simpRhs := true })] def OrderIso.mulRight₀ (a : α) (ha : 0 < a) : α ≃o α := { Equiv.mulRight₀ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_right ha } #align order_iso.mul_right₀ OrderIso.mulRight₀ #align order_iso.mul_right₀_symm_apply OrderIso.mulRight₀_symm_apply #align order_iso.mul_right₀_apply OrderIso.mulRight₀_apply theorem le_div_iff (hc : 0 < c) : a ≤ b / c ↔ a * c ≤ b := ⟨fun h => div_mul_cancel₀ b (ne_of_lt hc).symm ▸ mul_le_mul_of_nonneg_right h hc.le, fun h => calc a = a * c * (1 / c) := mul_mul_div a (ne_of_lt hc).symm _ ≤ b * (1 / c) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hc).le _ = b / c := (div_eq_mul_one_div b c).symm ⟩ #align le_div_iff le_div_iff theorem le_div_iff' (hc : 0 < c) : a ≤ b / c ↔ c * a ≤ b := by rw [mul_comm, le_div_iff hc] #align le_div_iff' le_div_iff' theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b := ⟨fun h => calc a = a / b * b := by rw [div_mul_cancel₀ _ (ne_of_lt hb).symm] _ ≤ c * b := mul_le_mul_of_nonneg_right h hb.le , fun h => calc a / b = a * (1 / b) := div_eq_mul_one_div a b _ ≤ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le _ = c * b / b := (div_eq_mul_one_div (c * b) b).symm _ = c := by refine (div_eq_iff (ne_of_gt hb)).mpr rfl ⟩ #align div_le_iff div_le_iff theorem div_le_iff' (hb : 0 < b) : a / b ≤ c ↔ a ≤ b * c := by rw [mul_comm, div_le_iff hb] #align div_le_iff' div_le_iff' lemma div_le_comm₀ (hb : 0 < b) (hc : 0 < c) : a / b ≤ c ↔ a / c ≤ b := by rw [div_le_iff hb, div_le_iff' hc] theorem lt_div_iff (hc : 0 < c) : a < b / c ↔ a * c < b := lt_iff_lt_of_le_iff_le <| div_le_iff hc #align lt_div_iff lt_div_iff
Mathlib/Algebra/Order/Field/Basic.lean
86
86
theorem lt_div_iff' (hc : 0 < c) : a < b / c ↔ c * a < b := by
rw [mul_comm, lt_div_iff hc]
false
import Mathlib.CategoryTheory.Limits.Types import Mathlib.CategoryTheory.IsConnected import Mathlib.CategoryTheory.Limits.Final import Mathlib.CategoryTheory.Conj universe w v u namespace CategoryTheory.Limits.Types variable (C : Type u) [Category.{v} C] def constPUnitFunctor : C ⥤ Type w := (Functor.const C).obj PUnit.{w + 1} @[simps] def pUnitCocone : Cocone (constPUnitFunctor.{w} C) where pt := PUnit ι := { app := fun X => id } noncomputable def isColimitPUnitCocone [IsConnected C] : IsColimit (pUnitCocone.{w} C) where desc s := s.ι.app Classical.ofNonempty fac s j := by ext ⟨⟩ apply constant_of_preserves_morphisms (s.ι.app · PUnit.unit) intros X Y f exact congrFun (s.ι.naturality f).symm PUnit.unit uniq s m h := by ext ⟨⟩ simp [← h Classical.ofNonempty] instance instHasColimitConstPUnitFunctor [IsConnected C] : HasColimit (constPUnitFunctor.{w} C) := ⟨_, isColimitPUnitCocone _⟩ instance instSubsingletonColimitPUnit [IsPreconnected C] [HasColimit (constPUnitFunctor.{w} C)] : Subsingleton (colimit (constPUnitFunctor.{w} C)) where allEq a b := by obtain ⟨c, ⟨⟩, rfl⟩ := jointly_surjective' a obtain ⟨d, ⟨⟩, rfl⟩ := jointly_surjective' b apply constant_of_preserves_morphisms (colimit.ι (constPUnitFunctor C) · PUnit.unit) exact fun c d f => colimit_sound f rfl noncomputable def colimitConstPUnitIsoPUnit [IsConnected C] : colimit (constPUnitFunctor.{w} C) ≅ PUnit.{w + 1} := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (isColimitPUnitCocone.{w} C)
Mathlib/CategoryTheory/Limits/IsConnected.lean
87
93
theorem zigzag_of_eqvGen_quot_rel (F : C ⥤ Type w) (c d : Σ j, F.obj j) (h : EqvGen (Quot.Rel F) c d) : Zigzag c.1 d.1 := by
induction h with | rel _ _ h => exact Zigzag.of_hom <| Exists.choose h | refl _ => exact Zigzag.refl _ | symm _ _ _ ih => exact zigzag_symmetric ih | trans _ _ _ _ _ ih₁ ih₂ => exact ih₁.trans ih₂
false
import Mathlib.Combinatorics.SetFamily.Shadow #align_import combinatorics.set_family.compression.uv from "leanprover-community/mathlib"@"6f8ab7de1c4b78a68ab8cf7dd83d549eb78a68a1" open Finset variable {α : Type*}
Mathlib/Combinatorics/SetFamily/Compression/UV.lean
57
64
theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra α] (u v : α) : { x | Disjoint u x ∧ v ≤ x }.InjOn fun x => (x ⊔ u) \ v := by
rintro a ha b hb hab have h : ((a ⊔ u) \ v) \ u ⊔ v = ((b ⊔ u) \ v) \ u ⊔ v := by dsimp at hab rw [hab] rwa [sdiff_sdiff_comm, ha.1.symm.sup_sdiff_cancel_right, sdiff_sdiff_comm, hb.1.symm.sup_sdiff_cancel_right, sdiff_sup_cancel ha.2, sdiff_sup_cancel hb.2] at h
false
import Mathlib.Algebra.Order.Ring.Int import Mathlib.Data.Nat.SuccPred #align_import data.int.succ_pred from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Function Order namespace Int -- so that Lean reads `Int.succ` through `SuccOrder.succ` @[instance] abbrev instSuccOrder : SuccOrder ℤ := { SuccOrder.ofSuccLeIff succ fun {_ _} => Iff.rfl with succ := succ } -- so that Lean reads `Int.pred` through `PredOrder.pred` @[instance] abbrev instPredOrder : PredOrder ℤ where pred := pred pred_le _ := (sub_one_lt_of_le le_rfl).le min_of_le_pred ha := ((sub_one_lt_of_le le_rfl).not_le ha).elim le_pred_of_lt {_ _} := le_sub_one_of_lt le_of_pred_lt {_ _} := le_of_sub_one_lt @[simp] theorem succ_eq_succ : Order.succ = succ := rfl #align int.succ_eq_succ Int.succ_eq_succ @[simp] theorem pred_eq_pred : Order.pred = pred := rfl #align int.pred_eq_pred Int.pred_eq_pred theorem pos_iff_one_le {a : ℤ} : 0 < a ↔ 1 ≤ a := Order.succ_le_iff.symm #align int.pos_iff_one_le Int.pos_iff_one_le theorem succ_iterate (a : ℤ) : ∀ n, succ^[n] a = a + n | 0 => (add_zero a).symm | n + 1 => by rw [Function.iterate_succ', Int.ofNat_succ, ← add_assoc] exact congr_arg _ (succ_iterate a n) #align int.succ_iterate Int.succ_iterate theorem pred_iterate (a : ℤ) : ∀ n, pred^[n] a = a - n | 0 => (sub_zero a).symm | n + 1 => by rw [Function.iterate_succ', Int.ofNat_succ, ← sub_sub] exact congr_arg _ (pred_iterate a n) #align int.pred_iterate Int.pred_iterate instance : IsSuccArchimedean ℤ := ⟨fun {a b} h => ⟨(b - a).toNat, by rw [succ_eq_succ, succ_iterate, toNat_sub_of_le h, ← add_sub_assoc, add_sub_cancel_left]⟩⟩ instance : IsPredArchimedean ℤ := ⟨fun {a b} h => ⟨(b - a).toNat, by rw [pred_eq_pred, pred_iterate, toNat_sub_of_le h, sub_sub_cancel]⟩⟩ protected theorem covBy_iff_succ_eq {m n : ℤ} : m ⋖ n ↔ m + 1 = n := succ_eq_iff_covBy.symm #align int.covby_iff_succ_eq Int.covBy_iff_succ_eq @[simp]
Mathlib/Data/Int/SuccPred.lean
79
79
theorem sub_one_covBy (z : ℤ) : z - 1 ⋖ z := by
rw [Int.covBy_iff_succ_eq, sub_add_cancel]
false
import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer import Mathlib.CategoryTheory.Limits.Constructions.EpiMono import Mathlib.CategoryTheory.Limits.Preserves.Limits import Mathlib.CategoryTheory.Limits.Shapes.Types #align_import category_theory.glue_data from "leanprover-community/mathlib"@"14b69e9f3c16630440a2cbd46f1ddad0d561dee7" noncomputable section open CategoryTheory.Limits namespace CategoryTheory universe v u₁ u₂ variable (C : Type u₁) [Category.{v} C] {C' : Type u₂} [Category.{v} C'] -- Porting note(#5171): linter not ported yet -- @[nolint has_nonempty_instance] structure GlueData where J : Type v U : J → C V : J × J → C f : ∀ i j, V (i, j) ⟶ U i f_mono : ∀ i j, Mono (f i j) := by infer_instance f_hasPullback : ∀ i j k, HasPullback (f i j) (f i k) := by infer_instance f_id : ∀ i, IsIso (f i i) := by infer_instance t : ∀ i j, V (i, j) ⟶ V (j, i) t_id : ∀ i, t i i = 𝟙 _ t' : ∀ i j k, pullback (f i j) (f i k) ⟶ pullback (f j k) (f j i) t_fac : ∀ i j k, t' i j k ≫ pullback.snd = pullback.fst ≫ t i j cocycle : ∀ i j k, t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _ #align category_theory.glue_data CategoryTheory.GlueData attribute [simp] GlueData.t_id attribute [instance] GlueData.f_id GlueData.f_mono GlueData.f_hasPullback attribute [reassoc] GlueData.t_fac GlueData.cocycle namespace GlueData variable {C} variable (D : GlueData C) @[simp] theorem t'_iij (i j : D.J) : D.t' i i j = (pullbackSymmetry _ _).hom := by have eq₁ := D.t_fac i i j have eq₂ := (IsIso.eq_comp_inv (D.f i i)).mpr (@pullback.condition _ _ _ _ _ _ (D.f i j) _) rw [D.t_id, Category.comp_id, eq₂] at eq₁ have eq₃ := (IsIso.eq_comp_inv (D.f i i)).mp eq₁ rw [Category.assoc, ← pullback.condition, ← Category.assoc] at eq₃ exact Mono.right_cancellation _ _ ((Mono.right_cancellation _ _ eq₃).trans (pullbackSymmetry_hom_comp_fst _ _).symm) #align category_theory.glue_data.t'_iij CategoryTheory.GlueData.t'_iij theorem t'_jii (i j : D.J) : D.t' j i i = pullback.fst ≫ D.t j i ≫ inv pullback.snd := by rw [← Category.assoc, ← D.t_fac] simp #align category_theory.glue_data.t'_jii CategoryTheory.GlueData.t'_jii theorem t'_iji (i j : D.J) : D.t' i j i = pullback.fst ≫ D.t i j ≫ inv pullback.snd := by rw [← Category.assoc, ← D.t_fac] simp #align category_theory.glue_data.t'_iji CategoryTheory.GlueData.t'_iji @[reassoc, elementwise (attr := simp)]
Mathlib/CategoryTheory/GlueData.lean
99
105
theorem t_inv (i j : D.J) : D.t i j ≫ D.t j i = 𝟙 _ := by
have eq : (pullbackSymmetry (D.f i i) (D.f i j)).hom = pullback.snd ≫ inv pullback.fst := by simp have := D.cocycle i j i rw [D.t'_iij, D.t'_jii, D.t'_iji, fst_eq_snd_of_mono_eq, eq] at this simp only [Category.assoc, IsIso.inv_hom_id_assoc] at this rw [← IsIso.eq_inv_comp, ← Category.assoc, IsIso.comp_inv_eq] at this simpa using this
false
import Mathlib.MeasureTheory.PiSystem import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.MeasurableSpace.Basic open Set namespace MeasureTheory variable {ι : Type _} {α : ι → Type _} section cylinder def cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) : Set (∀ i, α i) := (fun (f : ∀ i, α i) (i : s) ↦ f i) ⁻¹' S @[simp] theorem mem_cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) (f : ∀ i, α i) : f ∈ cylinder s S ↔ (fun i : s ↦ f i) ∈ S := mem_preimage @[simp]
Mathlib/MeasureTheory/Constructions/Cylinders.lean
161
162
theorem cylinder_empty (s : Finset ι) : cylinder s (∅ : Set (∀ i : s, α i)) = ∅ := by
rw [cylinder, preimage_empty]
false
import Mathlib.CategoryTheory.Closed.Cartesian import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts import Mathlib.CategoryTheory.Adjunction.FullyFaithful #align_import category_theory.closed.functor from "leanprover-community/mathlib"@"cea27692b3fdeb328a2ddba6aabf181754543184" noncomputable section namespace CategoryTheory open Category Limits CartesianClosed universe v u u' variable {C : Type u} [Category.{v} C] variable {D : Type u'} [Category.{v} D] variable [HasFiniteProducts C] [HasFiniteProducts D] variable (F : C ⥤ D) {L : D ⥤ C} def frobeniusMorphism (h : L ⊣ F) (A : C) : prod.functor.obj (F.obj A) ⋙ L ⟶ L ⋙ prod.functor.obj A := prodComparisonNatTrans L (F.obj A) ≫ whiskerLeft _ (prod.functor.map (h.counit.app _)) #align category_theory.frobenius_morphism CategoryTheory.frobeniusMorphism instance frobeniusMorphism_iso_of_preserves_binary_products (h : L ⊣ F) (A : C) [PreservesLimitsOfShape (Discrete WalkingPair) L] [F.Full] [F.Faithful] : IsIso (frobeniusMorphism F h A) := suffices ∀ (X : D), IsIso ((frobeniusMorphism F h A).app X) from NatIso.isIso_of_isIso_app _ fun B ↦ by dsimp [frobeniusMorphism]; infer_instance #align category_theory.frobenius_morphism_iso_of_preserves_binary_products CategoryTheory.frobeniusMorphism_iso_of_preserves_binary_products variable [CartesianClosed C] [CartesianClosed D] variable [PreservesLimitsOfShape (Discrete WalkingPair) F] def expComparison (A : C) : exp A ⋙ F ⟶ F ⋙ exp (F.obj A) := transferNatTrans (exp.adjunction A) (exp.adjunction (F.obj A)) (prodComparisonNatIso F A).inv #align category_theory.exp_comparison CategoryTheory.expComparison theorem expComparison_ev (A B : C) : Limits.prod.map (𝟙 (F.obj A)) ((expComparison F A).app B) ≫ (exp.ev (F.obj A)).app (F.obj B) = inv (prodComparison F _ _) ≫ F.map ((exp.ev _).app _) := by convert transferNatTrans_counit _ _ (prodComparisonNatIso F A).inv B using 2 apply IsIso.inv_eq_of_hom_inv_id -- Porting note: was `ext` simp only [Limits.prodComparisonNatIso_inv, asIso_inv, NatIso.isIso_inv_app, IsIso.hom_inv_id] #align category_theory.exp_comparison_ev CategoryTheory.expComparison_ev theorem coev_expComparison (A B : C) : F.map ((exp.coev A).app B) ≫ (expComparison F A).app (A ⨯ B) = (exp.coev _).app (F.obj B) ≫ (exp (F.obj A)).map (inv (prodComparison F A B)) := by convert unit_transferNatTrans _ _ (prodComparisonNatIso F A).inv B using 3 apply IsIso.inv_eq_of_hom_inv_id -- Porting note: was `ext` dsimp simp #align category_theory.coev_exp_comparison CategoryTheory.coev_expComparison theorem uncurry_expComparison (A B : C) : CartesianClosed.uncurry ((expComparison F A).app B) = inv (prodComparison F _ _) ≫ F.map ((exp.ev _).app _) := by rw [uncurry_eq, expComparison_ev] #align category_theory.uncurry_exp_comparison CategoryTheory.uncurry_expComparison theorem expComparison_whiskerLeft {A A' : C} (f : A' ⟶ A) : expComparison F A ≫ whiskerLeft _ (pre (F.map f)) = whiskerRight (pre f) _ ≫ expComparison F A' := by ext B dsimp apply uncurry_injective rw [uncurry_natural_left, uncurry_natural_left, uncurry_expComparison, uncurry_pre, prod.map_swap_assoc, ← F.map_id, expComparison_ev, ← F.map_id, ← prodComparison_inv_natural_assoc, ← prodComparison_inv_natural_assoc, ← F.map_comp, ← F.map_comp, prod_map_pre_app_comp_ev] #align category_theory.exp_comparison_whisker_left CategoryTheory.expComparison_whiskerLeft class CartesianClosedFunctor : Prop where comparison_iso : ∀ A, IsIso (expComparison F A) #align category_theory.cartesian_closed_functor CategoryTheory.CartesianClosedFunctor attribute [instance] CartesianClosedFunctor.comparison_iso theorem frobeniusMorphism_mate (h : L ⊣ F) (A : C) : transferNatTransSelf (h.comp (exp.adjunction A)) ((exp.adjunction (F.obj A)).comp h) (frobeniusMorphism F h A) = expComparison F A := by rw [← Equiv.eq_symm_apply] ext B : 2 dsimp [frobeniusMorphism, transferNatTransSelf, transferNatTrans, Adjunction.comp] simp only [id_comp, comp_id] rw [← L.map_comp_assoc, prod.map_id_comp, assoc] -- Porting note: need to use `erw` here. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [expComparison_ev] rw [prod.map_id_comp, assoc, ← F.map_id, ← prodComparison_inv_natural_assoc, ← F.map_comp] -- Porting note: need to use `erw` here. -- https://github.com/leanprover-community/mathlib4/issues/5164 erw [exp.ev_coev] rw [F.map_id (A ⨯ L.obj B), comp_id] ext · rw [assoc, assoc, ← h.counit_naturality, ← L.map_comp_assoc, assoc, inv_prodComparison_map_fst] simp · rw [assoc, assoc, ← h.counit_naturality, ← L.map_comp_assoc, assoc, inv_prodComparison_map_snd] simp #align category_theory.frobenius_morphism_mate CategoryTheory.frobeniusMorphism_mate theorem frobeniusMorphism_iso_of_expComparison_iso (h : L ⊣ F) (A : C) [i : IsIso (expComparison F A)] : IsIso (frobeniusMorphism F h A) := by rw [← frobeniusMorphism_mate F h] at i exact @transferNatTransSelf_of_iso _ _ _ _ _ _ _ _ _ _ _ i #align category_theory.frobenius_morphism_iso_of_exp_comparison_iso CategoryTheory.frobeniusMorphism_iso_of_expComparison_iso
Mathlib/CategoryTheory/Closed/Functor.lean
166
168
theorem expComparison_iso_of_frobeniusMorphism_iso (h : L ⊣ F) (A : C) [i : IsIso (frobeniusMorphism F h A)] : IsIso (expComparison F A) := by
rw [← frobeniusMorphism_mate F h]; infer_instance
false
import Mathlib.Algebra.Group.Subgroup.Pointwise import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.GroupAction.ConjAct import Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup #align_import number_theory.modular_forms.congruence_subgroups from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" local notation "SL(" n ", " R ")" => Matrix.SpecialLinearGroup (Fin n) R attribute [-instance] Matrix.SpecialLinearGroup.instCoeFun local notation:1024 "↑ₘ" A:1024 => ((A : SL(2, ℤ)) : Matrix (Fin 2) (Fin 2) ℤ) open Matrix.SpecialLinearGroup Matrix variable (N : ℕ) local notation "SLMOD(" N ")" => @Matrix.SpecialLinearGroup.map (Fin 2) _ _ _ _ _ _ (Int.castRingHom (ZMod N)) set_option linter.uppercaseLean3 false @[simp] theorem SL_reduction_mod_hom_val (N : ℕ) (γ : SL(2, ℤ)) : ∀ i j : Fin 2, (SLMOD(N) γ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((↑ₘγ i j : ℤ) : ZMod N) := fun _ _ => rfl #align SL_reduction_mod_hom_val SL_reduction_mod_hom_val def Gamma (N : ℕ) : Subgroup SL(2, ℤ) := SLMOD(N).ker #align Gamma Gamma theorem Gamma_mem' (N : ℕ) (γ : SL(2, ℤ)) : γ ∈ Gamma N ↔ SLMOD(N) γ = 1 := Iff.rfl #align Gamma_mem' Gamma_mem' @[simp] theorem Gamma_mem (N : ℕ) (γ : SL(2, ℤ)) : γ ∈ Gamma N ↔ ((↑ₘγ 0 0 : ℤ) : ZMod N) = 1 ∧ ((↑ₘγ 0 1 : ℤ) : ZMod N) = 0 ∧ ((↑ₘγ 1 0 : ℤ) : ZMod N) = 0 ∧ ((↑ₘγ 1 1 : ℤ) : ZMod N) = 1 := by rw [Gamma_mem'] constructor · intro h simp [← SL_reduction_mod_hom_val N γ, h] · intro h ext i j rw [SL_reduction_mod_hom_val N γ] fin_cases i <;> fin_cases j <;> simp only [h] exacts [h.1, h.2.1, h.2.2.1, h.2.2.2] #align Gamma_mem Gamma_mem theorem Gamma_normal (N : ℕ) : Subgroup.Normal (Gamma N) := SLMOD(N).normal_ker #align Gamma_normal Gamma_normal
Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean
73
75
theorem Gamma_one_top : Gamma 1 = ⊤ := by
ext simp [eq_iff_true_of_subsingleton]
false
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] theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥ := by rw [coeSubmodule, Submodule.map_bot] #align is_localization.coe_submodule_bot IsLocalization.coeSubmodule_bot @[simp] theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1 := by rw [coeSubmodule, Submodule.map_top, Submodule.one_eq_range] #align is_localization.coe_submodule_top IsLocalization.coeSubmodule_top @[simp] theorem coeSubmodule_sup (I J : Ideal R) : coeSubmodule S (I ⊔ J) = coeSubmodule S I ⊔ coeSubmodule S J := Submodule.map_sup _ _ _ #align is_localization.coe_submodule_sup IsLocalization.coeSubmodule_sup @[simp] theorem coeSubmodule_mul (I J : Ideal R) : coeSubmodule S (I * J) = coeSubmodule S I * coeSubmodule S J := Submodule.map_mul _ _ (Algebra.ofId R S) #align is_localization.coe_submodule_mul IsLocalization.coeSubmodule_mul theorem coeSubmodule_fg (hS : Function.Injective (algebraMap R S)) (I : Ideal R) : Submodule.FG (coeSubmodule S I) ↔ Submodule.FG I := ⟨Submodule.fg_of_fg_map _ (LinearMap.ker_eq_bot.mpr hS), Submodule.FG.map _⟩ #align is_localization.coe_submodule_fg IsLocalization.coeSubmodule_fg @[simp] theorem coeSubmodule_span (s : Set R) : coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s) := by rw [IsLocalization.coeSubmodule, Ideal.span, Submodule.map_span] rfl #align is_localization.coe_submodule_span IsLocalization.coeSubmodule_span -- @[simp] -- Porting note (#10618): simp can prove this theorem coeSubmodule_span_singleton (x : R) : coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x} := by rw [coeSubmodule_span, Set.image_singleton] #align is_localization.coe_submodule_span_singleton IsLocalization.coeSubmodule_span_singleton variable {g : R →+* P} variable {T : Submonoid P} (hy : M ≤ T.comap g) {Q : Type*} [CommRing Q] variable [Algebra P Q] [IsLocalization T Q] variable [IsLocalization M S] section theorem isNoetherianRing (h : IsNoetherianRing R) : IsNoetherianRing S := by rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (IsLocalization.orderEmbedding M S).dual h #align is_localization.is_noetherian_ring IsLocalization.isNoetherianRing end variable {S M} @[mono] theorem coeSubmodule_le_coeSubmodule (h : M ≤ nonZeroDivisors R) {I J : Ideal R} : coeSubmodule S I ≤ coeSubmodule S J ↔ I ≤ J := -- Note: #8386 had to specify the value of `f` here: Submodule.map_le_map_iff_of_injective (f := Algebra.linearMap R S) (IsLocalization.injective _ h) _ _ #align is_localization.coe_submodule_le_coe_submodule IsLocalization.coeSubmodule_le_coeSubmodule @[mono] theorem coeSubmodule_strictMono (h : M ≤ nonZeroDivisors R) : StrictMono (coeSubmodule S : Ideal R → Submodule R S) := strictMono_of_le_iff_le fun _ _ => (coeSubmodule_le_coeSubmodule h).symm #align is_localization.coe_submodule_strict_mono IsLocalization.coeSubmodule_strictMono variable (S) theorem coeSubmodule_injective (h : M ≤ nonZeroDivisors R) : Function.Injective (coeSubmodule S : Ideal R → Submodule R S) := injective_of_le_imp_le _ fun hl => (coeSubmodule_le_coeSubmodule h).mp hl #align is_localization.coe_submodule_injective IsLocalization.coeSubmodule_injective
Mathlib/RingTheory/Localization/Submodule.lean
125
133
theorem coeSubmodule_isPrincipal {I : Ideal R} (h : M ≤ nonZeroDivisors R) : (coeSubmodule S I).IsPrincipal ↔ I.IsPrincipal := by
constructor <;> rintro ⟨⟨x, hx⟩⟩ · have x_mem : x ∈ coeSubmodule S I := hx.symm ▸ Submodule.mem_span_singleton_self x obtain ⟨x, _, rfl⟩ := (mem_coeSubmodule _ _).mp x_mem refine ⟨⟨x, coeSubmodule_injective S h ?_⟩⟩ rw [Ideal.submodule_span_eq, hx, coeSubmodule_span_singleton] · refine ⟨⟨algebraMap R S x, ?_⟩⟩ rw [hx, Ideal.submodule_span_eq, coeSubmodule_span_singleton]
false
import Mathlib.RingTheory.Ideal.Cotangent import Mathlib.RingTheory.QuotientNilpotent import Mathlib.RingTheory.TensorProduct.Basic import Mathlib.RingTheory.FinitePresentation import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Away.AdjoinRoot #align_import ring_theory.etale from "leanprover-community/mathlib"@"73f96237417835f148a1f7bc1ff55f67119b7166" -- Porting note: added to make the syntax work below. open scoped TensorProduct universe u namespace Algebra section variable (R : Type u) [CommSemiring R] variable (A : Type u) [Semiring A] [Algebra R A] @[mk_iff] class FormallySmooth : Prop where comp_surjective : ∀ ⦃B : Type u⦄ [CommRing B], ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥), Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) #align algebra.formally_smooth Algebra.FormallySmooth end namespace FormallySmooth section variable {R : Type u} [CommSemiring R] variable {A : Type u} [Semiring A] [Algebra R A] variable {B : Type u} [CommRing B] [Algebra R B] (I : Ideal B) theorem exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B] [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g := by revert g change Function.Surjective (Ideal.Quotient.mkₐ R I).comp revert _RB apply Ideal.IsNilpotent.induction_on (R := B) I hI · intro B _ I hI _; exact FormallySmooth.comp_surjective I hI · intro B _ I J hIJ h₁ h₂ _ g let this : ((B ⧸ I) ⧸ J.map (Ideal.Quotient.mk I)) ≃ₐ[R] B ⧸ J := { (DoubleQuot.quotQuotEquivQuotSup I J).trans (Ideal.quotEquivOfEq (sup_eq_right.mpr hIJ)) with commutes' := fun x => rfl } obtain ⟨g', e⟩ := h₂ (this.symm.toAlgHom.comp g) obtain ⟨g', rfl⟩ := h₁ g' replace e := congr_arg this.toAlgHom.comp e conv_rhs at e => rw [← AlgHom.comp_assoc, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgEquiv.comp_symm, AlgHom.id_comp] exact ⟨g', e⟩ #align algebra.formally_smooth.exists_lift Algebra.FormallySmooth.exists_lift noncomputable def lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : A →ₐ[R] B := (FormallySmooth.exists_lift I hI g).choose #align algebra.formally_smooth.lift Algebra.FormallySmooth.lift @[simp] theorem comp_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) : (Ideal.Quotient.mkₐ R I).comp (FormallySmooth.lift I hI g) = g := (FormallySmooth.exists_lift I hI g).choose_spec #align algebra.formally_smooth.comp_lift Algebra.FormallySmooth.comp_lift @[simp] theorem mk_lift [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) (x : A) : Ideal.Quotient.mk I (FormallySmooth.lift I hI g x) = g x := AlgHom.congr_fun (FormallySmooth.comp_lift I hI g : _) x #align algebra.formally_smooth.mk_lift Algebra.FormallySmooth.mk_lift variable {C : Type u} [CommRing C] [Algebra R C] noncomputable def liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : A →ₐ[R] B := FormallySmooth.lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) #align algebra.formally_smooth.lift_of_surjective Algebra.FormallySmooth.liftOfSurjective @[simp] theorem liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) : g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x := by apply (Ideal.quotientKerAlgEquivOfSurjective hg).symm.injective change _ = ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f) x -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [← FormallySmooth.mk_lift _ hg' ((Ideal.quotientKerAlgEquivOfSurjective hg).symm.toAlgHom.comp f)] apply (Ideal.quotientKerAlgEquivOfSurjective hg).injective simp only [liftOfSurjective, AlgEquiv.apply_symm_apply, AlgEquiv.toAlgHom_eq_coe, Ideal.quotientKerAlgEquivOfSurjective_apply, RingHom.kerLift_mk, RingHom.coe_coe] #align algebra.formally_smooth.lift_of_surjective_apply Algebra.FormallySmooth.liftOfSurjective_apply @[simp] theorem comp_liftOfSurjective [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) : g.comp (FormallySmooth.liftOfSurjective f g hg hg') = f := AlgHom.ext (FormallySmooth.liftOfSurjective_apply f g hg hg') #align algebra.formally_smooth.comp_lift_of_surjective Algebra.FormallySmooth.comp_liftOfSurjective end section Comp variable (R : Type u) [CommSemiring R] variable (A : Type u) [CommSemiring A] [Algebra R A] variable (B : Type u) [Semiring B] [Algebra R B] [Algebra A B] [IsScalarTower R A B]
Mathlib/RingTheory/Smooth/Basic.lean
188
196
theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by
constructor intro C _ _ I hI f obtain ⟨f', e⟩ := FormallySmooth.comp_surjective I hI (f.comp (IsScalarTower.toAlgHom R A B)) letI := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := FormallySmooth.comp_surjective I hI { f.toRingHom with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩
false
import Mathlib.Order.Filter.Bases #align_import order.filter.pi from "leanprover-community/mathlib"@"ce64cd319bb6b3e82f31c2d38e79080d377be451" open Set Function open scoped Classical open Filter namespace Filter variable {ι : Type*} {α : ι → Type*} {f f₁ f₂ : (i : ι) → Filter (α i)} {s : (i : ι) → Set (α i)} {p : ∀ i, α i → Prop} section CoprodCat -- for "Coprod" set_option linter.uppercaseLean3 false protected def coprodᵢ (f : ∀ i, Filter (α i)) : Filter (∀ i, α i) := ⨆ i : ι, comap (eval i) (f i) #align filter.Coprod Filter.coprodᵢ theorem mem_coprodᵢ_iff {s : Set (∀ i, α i)} : s ∈ Filter.coprodᵢ f ↔ ∀ i : ι, ∃ t₁ ∈ f i, eval i ⁻¹' t₁ ⊆ s := by simp [Filter.coprodᵢ] #align filter.mem_Coprod_iff Filter.mem_coprodᵢ_iff
Mathlib/Order/Filter/Pi.lean
233
235
theorem compl_mem_coprodᵢ {s : Set (∀ i, α i)} : sᶜ ∈ Filter.coprodᵢ f ↔ ∀ i, (eval i '' s)ᶜ ∈ f i := by
simp only [Filter.coprodᵢ, mem_iSup, compl_mem_comap]
false
import Mathlib.MeasureTheory.Integral.IntervalIntegral import Mathlib.MeasureTheory.Integral.Average #align_import measure_theory.integral.interval_average from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open MeasureTheory Set TopologicalSpace open scoped Interval variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] notation3 "⨍ "(...)" in "a".."b", "r:60:(scoped f => average (Measure.restrict volume (uIoc a b)) f) => r
Mathlib/MeasureTheory/Integral/IntervalAverage.lean
39
40
theorem interval_average_symm (f : ℝ → E) (a b : ℝ) : (⨍ x in a..b, f x) = ⨍ x in b..a, f x := by
rw [setAverage_eq, setAverage_eq, uIoc_comm]
false
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 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] #align continuous_map.polynomial_comp_attach_bound ContinuousMap.polynomial_comp_attachBound theorem polynomial_comp_attachBound_mem (A : Subalgebra ℝ C(X, ℝ)) (f : A) (g : ℝ[X]) : (g.toContinuousMapOn (Set.Icc (-‖f‖) ‖f‖)).comp (f : C(X, ℝ)).attachBound ∈ A := by rw [polynomial_comp_attachBound] apply SetLike.coe_mem #align continuous_map.polynomial_comp_attach_bound_mem ContinuousMap.polynomial_comp_attachBound_mem
Mathlib/Topology/ContinuousFunction/StoneWeierstrass.lean
94
113
theorem comp_attachBound_mem_closure (A : Subalgebra ℝ C(X, ℝ)) (f : A) (p : C(Set.Icc (-‖f‖) ‖f‖, ℝ)) : p.comp (attachBound (f : C(X, ℝ))) ∈ A.topologicalClosure := by
-- `p` itself is in the closure of polynomials, by the Weierstrass theorem, have mem_closure : p ∈ (polynomialFunctions (Set.Icc (-‖f‖) ‖f‖)).topologicalClosure := continuousMap_mem_polynomialFunctions_closure _ _ p -- and so there are polynomials arbitrarily close. have frequently_mem_polynomials := mem_closure_iff_frequently.mp mem_closure -- To prove `p.comp (attachBound f)` is in the closure of `A`, -- we show there are elements of `A` arbitrarily close. apply mem_closure_iff_frequently.mpr -- To show that, we pull back the polynomials close to `p`, refine ((compRightContinuousMap ℝ (attachBound (f : C(X, ℝ)))).continuousAt p).tendsto.frequently_map _ ?_ frequently_mem_polynomials -- but need to show that those pullbacks are actually in `A`. rintro _ ⟨g, ⟨-, rfl⟩⟩ simp only [SetLike.mem_coe, AlgHom.coe_toRingHom, compRightContinuousMap_apply, Polynomial.toContinuousMapOnAlgHom_apply] apply polynomial_comp_attachBound_mem
false
import Mathlib.Algebra.Order.Monoid.Defs import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Util.AssertExists #align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce" open Function universe u variable {α : Type u} class OrderedAddCommGroup (α : Type u) extends AddCommGroup α, PartialOrder α where protected add_le_add_left : ∀ a b : α, a ≤ b → ∀ c : α, c + a ≤ c + b #align ordered_add_comm_group OrderedAddCommGroup class OrderedCommGroup (α : Type u) extends CommGroup α, PartialOrder α where protected mul_le_mul_left : ∀ a b : α, a ≤ b → ∀ c : α, c * a ≤ c * b #align ordered_comm_group OrderedCommGroup attribute [to_additive] OrderedCommGroup @[to_additive] instance OrderedCommGroup.to_covariantClass_left_le (α : Type u) [OrderedCommGroup α] : CovariantClass α α (· * ·) (· ≤ ·) where elim a b c bc := OrderedCommGroup.mul_le_mul_left b c bc a #align ordered_comm_group.to_covariant_class_left_le OrderedCommGroup.to_covariantClass_left_le #align ordered_add_comm_group.to_covariant_class_left_le OrderedAddCommGroup.to_covariantClass_left_le -- See note [lower instance priority] @[to_additive OrderedAddCommGroup.toOrderedCancelAddCommMonoid] instance (priority := 100) OrderedCommGroup.toOrderedCancelCommMonoid [OrderedCommGroup α] : OrderedCancelCommMonoid α := { ‹OrderedCommGroup α› with le_of_mul_le_mul_left := fun a b c ↦ le_of_mul_le_mul_left' } #align ordered_comm_group.to_ordered_cancel_comm_monoid OrderedCommGroup.toOrderedCancelCommMonoid #align ordered_add_comm_group.to_ordered_cancel_add_comm_monoid OrderedAddCommGroup.toOrderedCancelAddCommMonoid example (α : Type u) [OrderedAddCommGroup α] : CovariantClass α α (swap (· + ·)) (· < ·) := IsRightCancelAdd.covariant_swap_add_lt_of_covariant_swap_add_le α -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- It was introduced in https://github.com/leanprover-community/mathlib/pull/17564 -- but without the motivation clearly explained. @[to_additive "A choice-free shortcut instance."]
Mathlib/Algebra/Order/Group/Defs.lean
71
73
theorem OrderedCommGroup.to_contravariantClass_left_le (α : Type u) [OrderedCommGroup α] : ContravariantClass α α (· * ·) (· ≤ ·) where elim a b c bc := by
simpa using mul_le_mul_left' bc a⁻¹
false
import Mathlib.Algebra.NeZero import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Lifts import Mathlib.Algebra.Polynomial.Splits import Mathlib.RingTheory.RootsOfUnity.Complex import Mathlib.NumberTheory.ArithmeticFunction import Mathlib.RingTheory.RootsOfUnity.Basic import Mathlib.FieldTheory.RatFunc.AsPolynomial #align_import ring_theory.polynomial.cyclotomic.basic from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" open scoped Polynomial noncomputable section universe u namespace Polynomial section Cyclotomic' section IsDomain variable {R : Type*} [CommRing R] [IsDomain R] def cyclotomic' (n : ℕ) (R : Type*) [CommRing R] [IsDomain R] : R[X] := ∏ μ ∈ primitiveRoots n R, (X - C μ) #align polynomial.cyclotomic' Polynomial.cyclotomic' @[simp] theorem cyclotomic'_zero (R : Type*) [CommRing R] [IsDomain R] : cyclotomic' 0 R = 1 := by simp only [cyclotomic', Finset.prod_empty, primitiveRoots_zero] #align polynomial.cyclotomic'_zero Polynomial.cyclotomic'_zero @[simp] theorem cyclotomic'_one (R : Type*) [CommRing R] [IsDomain R] : cyclotomic' 1 R = X - 1 := by simp only [cyclotomic', Finset.prod_singleton, RingHom.map_one, IsPrimitiveRoot.primitiveRoots_one] #align polynomial.cyclotomic'_one Polynomial.cyclotomic'_one @[simp] theorem cyclotomic'_two (R : Type*) [CommRing R] [IsDomain R] (p : ℕ) [CharP R p] (hp : p ≠ 2) : cyclotomic' 2 R = X + 1 := by rw [cyclotomic'] have prim_root_two : primitiveRoots 2 R = {(-1 : R)} := by simp only [Finset.eq_singleton_iff_unique_mem, mem_primitiveRoots two_pos] exact ⟨IsPrimitiveRoot.neg_one p hp, fun x => IsPrimitiveRoot.eq_neg_one_of_two_right⟩ simp only [prim_root_two, Finset.prod_singleton, RingHom.map_neg, RingHom.map_one, sub_neg_eq_add] #align polynomial.cyclotomic'_two Polynomial.cyclotomic'_two theorem cyclotomic'.monic (n : ℕ) (R : Type*) [CommRing R] [IsDomain R] : (cyclotomic' n R).Monic := monic_prod_of_monic _ _ fun _ _ => monic_X_sub_C _ #align polynomial.cyclotomic'.monic Polynomial.cyclotomic'.monic theorem cyclotomic'_ne_zero (n : ℕ) (R : Type*) [CommRing R] [IsDomain R] : cyclotomic' n R ≠ 0 := (cyclotomic'.monic n R).ne_zero #align polynomial.cyclotomic'_ne_zero Polynomial.cyclotomic'_ne_zero
Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean
107
114
theorem natDegree_cyclotomic' {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) : (cyclotomic' n R).natDegree = Nat.totient n := by
rw [cyclotomic'] rw [natDegree_prod (primitiveRoots n R) fun z : R => X - C z] · simp only [IsPrimitiveRoot.card_primitiveRoots h, mul_one, natDegree_X_sub_C, Nat.cast_id, Finset.sum_const, nsmul_eq_mul] intro z _ exact X_sub_C_ne_zero z
false
import Mathlib.Algebra.ModEq import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Order.Archimedean import Mathlib.Algebra.Periodic import Mathlib.Data.Int.SuccPred import Mathlib.GroupTheory.QuotientGroup import Mathlib.Order.Circular import Mathlib.Data.List.TFAE import Mathlib.Data.Set.Lattice #align_import algebra.order.to_interval_mod from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" noncomputable section section LinearOrderedAddCommGroup variable {α : Type*} [LinearOrderedAddCommGroup α] [hα : Archimedean α] {p : α} (hp : 0 < p) {a b c : α} {n : ℤ} def toIcoDiv (a b : α) : ℤ := (existsUnique_sub_zsmul_mem_Ico hp b a).choose #align to_Ico_div toIcoDiv theorem sub_toIcoDiv_zsmul_mem_Ico (a b : α) : b - toIcoDiv hp a b • p ∈ Set.Ico a (a + p) := (existsUnique_sub_zsmul_mem_Ico hp b a).choose_spec.1 #align sub_to_Ico_div_zsmul_mem_Ico sub_toIcoDiv_zsmul_mem_Ico theorem toIcoDiv_eq_of_sub_zsmul_mem_Ico (h : b - n • p ∈ Set.Ico a (a + p)) : toIcoDiv hp a b = n := ((existsUnique_sub_zsmul_mem_Ico hp b a).choose_spec.2 _ h).symm #align to_Ico_div_eq_of_sub_zsmul_mem_Ico toIcoDiv_eq_of_sub_zsmul_mem_Ico def toIocDiv (a b : α) : ℤ := (existsUnique_sub_zsmul_mem_Ioc hp b a).choose #align to_Ioc_div toIocDiv theorem sub_toIocDiv_zsmul_mem_Ioc (a b : α) : b - toIocDiv hp a b • p ∈ Set.Ioc a (a + p) := (existsUnique_sub_zsmul_mem_Ioc hp b a).choose_spec.1 #align sub_to_Ioc_div_zsmul_mem_Ioc sub_toIocDiv_zsmul_mem_Ioc theorem toIocDiv_eq_of_sub_zsmul_mem_Ioc (h : b - n • p ∈ Set.Ioc a (a + p)) : toIocDiv hp a b = n := ((existsUnique_sub_zsmul_mem_Ioc hp b a).choose_spec.2 _ h).symm #align to_Ioc_div_eq_of_sub_zsmul_mem_Ioc toIocDiv_eq_of_sub_zsmul_mem_Ioc def toIcoMod (a b : α) : α := b - toIcoDiv hp a b • p #align to_Ico_mod toIcoMod def toIocMod (a b : α) : α := b - toIocDiv hp a b • p #align to_Ioc_mod toIocMod theorem toIcoMod_mem_Ico (a b : α) : toIcoMod hp a b ∈ Set.Ico a (a + p) := sub_toIcoDiv_zsmul_mem_Ico hp a b #align to_Ico_mod_mem_Ico toIcoMod_mem_Ico theorem toIcoMod_mem_Ico' (b : α) : toIcoMod hp 0 b ∈ Set.Ico 0 p := by convert toIcoMod_mem_Ico hp 0 b exact (zero_add p).symm #align to_Ico_mod_mem_Ico' toIcoMod_mem_Ico' theorem toIocMod_mem_Ioc (a b : α) : toIocMod hp a b ∈ Set.Ioc a (a + p) := sub_toIocDiv_zsmul_mem_Ioc hp a b #align to_Ioc_mod_mem_Ioc toIocMod_mem_Ioc theorem left_le_toIcoMod (a b : α) : a ≤ toIcoMod hp a b := (Set.mem_Ico.1 (toIcoMod_mem_Ico hp a b)).1 #align left_le_to_Ico_mod left_le_toIcoMod theorem left_lt_toIocMod (a b : α) : a < toIocMod hp a b := (Set.mem_Ioc.1 (toIocMod_mem_Ioc hp a b)).1 #align left_lt_to_Ioc_mod left_lt_toIocMod theorem toIcoMod_lt_right (a b : α) : toIcoMod hp a b < a + p := (Set.mem_Ico.1 (toIcoMod_mem_Ico hp a b)).2 #align to_Ico_mod_lt_right toIcoMod_lt_right theorem toIocMod_le_right (a b : α) : toIocMod hp a b ≤ a + p := (Set.mem_Ioc.1 (toIocMod_mem_Ioc hp a b)).2 #align to_Ioc_mod_le_right toIocMod_le_right @[simp] theorem self_sub_toIcoDiv_zsmul (a b : α) : b - toIcoDiv hp a b • p = toIcoMod hp a b := rfl #align self_sub_to_Ico_div_zsmul self_sub_toIcoDiv_zsmul @[simp] theorem self_sub_toIocDiv_zsmul (a b : α) : b - toIocDiv hp a b • p = toIocMod hp a b := rfl #align self_sub_to_Ioc_div_zsmul self_sub_toIocDiv_zsmul @[simp] theorem toIcoDiv_zsmul_sub_self (a b : α) : toIcoDiv hp a b • p - b = -toIcoMod hp a b := by rw [toIcoMod, neg_sub] #align to_Ico_div_zsmul_sub_self toIcoDiv_zsmul_sub_self @[simp] theorem toIocDiv_zsmul_sub_self (a b : α) : toIocDiv hp a b • p - b = -toIocMod hp a b := by rw [toIocMod, neg_sub] #align to_Ioc_div_zsmul_sub_self toIocDiv_zsmul_sub_self @[simp] theorem toIcoMod_sub_self (a b : α) : toIcoMod hp a b - b = -toIcoDiv hp a b • p := by rw [toIcoMod, sub_sub_cancel_left, neg_smul] #align to_Ico_mod_sub_self toIcoMod_sub_self @[simp]
Mathlib/Algebra/Order/ToIntervalMod.lean
138
139
theorem toIocMod_sub_self (a b : α) : toIocMod hp a b - b = -toIocDiv hp a b • p := by
rw [toIocMod, sub_sub_cancel_left, neg_smul]
false
set_option autoImplicit true namespace Array @[simp] theorem extract_eq_nil_of_start_eq_end {a : Array α} : a.extract i i = #[] := by refine extract_empty_of_stop_le_start a ?h exact Nat.le_refl i theorem extract_append_left {a b : Array α} {i j : Nat} (h : j ≤ a.size) : (a ++ b).extract i j = a.extract i j := by apply ext · simp only [size_extract, size_append] omega · intro h1 h2 h3 rw [get_extract, get_append_left, get_extract] theorem extract_append_right {a b : Array α} {i j : Nat} (h : a.size ≤ i) : (a ++ b).extract i j = b.extract (i - a.size) (j - a.size) := by apply ext · rw [size_extract, size_extract, size_append] omega · intro k hi h2 rw [get_extract, get_extract, get_append_right (show size a ≤ i + k by omega)] congr omega
Mathlib/Data/Array/ExtractLemmas.lean
40
42
theorem extract_eq_of_size_le_end {a : Array α} (h : a.size ≤ l) : a.extract p l = a.extract p a.size := by
simp only [extract, Nat.min_eq_right h, Nat.sub_eq, mkEmpty_eq, Nat.min_self]
false
import Mathlib.Analysis.InnerProductSpace.Dual import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.Data.Complex.Orientation import Mathlib.Tactic.LinearCombination #align_import analysis.inner_product_space.two_dim from "leanprover-community/mathlib"@"cd8fafa2fac98e1a67097e8a91ad9901cfde48af" noncomputable section open scoped RealInnerProductSpace ComplexConjugate open FiniteDimensional lemma FiniteDimensional.of_fact_finrank_eq_two {K V : Type*} [DivisionRing K] [AddCommGroup V] [Module K V] [Fact (finrank K V = 2)] : FiniteDimensional K V := .of_fact_finrank_eq_succ 1 attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two @[deprecated (since := "2024-02-02")] alias FiniteDimensional.finiteDimensional_of_fact_finrank_eq_two := FiniteDimensional.of_fact_finrank_eq_two variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [Fact (finrank ℝ E = 2)] (o : Orientation ℝ E (Fin 2)) namespace Orientation irreducible_def areaForm : E →ₗ[ℝ] E →ₗ[ℝ] ℝ := by let z : E [⋀^Fin 0]→ₗ[ℝ] ℝ ≃ₗ[ℝ] ℝ := AlternatingMap.constLinearEquivOfIsEmpty.symm let y : E [⋀^Fin 1]→ₗ[ℝ] ℝ →ₗ[ℝ] E →ₗ[ℝ] ℝ := LinearMap.llcomp ℝ E (E [⋀^Fin 0]→ₗ[ℝ] ℝ) ℝ z ∘ₗ AlternatingMap.curryLeftLinearMap exact y ∘ₗ AlternatingMap.curryLeftLinearMap (R' := ℝ) o.volumeForm #align orientation.area_form Orientation.areaForm local notation "ω" => o.areaForm theorem areaForm_to_volumeForm (x y : E) : ω x y = o.volumeForm ![x, y] := by simp [areaForm] #align orientation.area_form_to_volume_form Orientation.areaForm_to_volumeForm @[simp] theorem areaForm_apply_self (x : E) : ω x x = 0 := by rw [areaForm_to_volumeForm] refine o.volumeForm.map_eq_zero_of_eq ![x, x] ?_ (?_ : (0 : Fin 2) ≠ 1) · simp · norm_num #align orientation.area_form_apply_self Orientation.areaForm_apply_self theorem areaForm_swap (x y : E) : ω x y = -ω y x := by simp only [areaForm_to_volumeForm] convert o.volumeForm.map_swap ![y, x] (_ : (0 : Fin 2) ≠ 1) · ext i fin_cases i <;> rfl · norm_num #align orientation.area_form_swap Orientation.areaForm_swap @[simp] theorem areaForm_neg_orientation : (-o).areaForm = -o.areaForm := by ext x y simp [areaForm_to_volumeForm] #align orientation.area_form_neg_orientation Orientation.areaForm_neg_orientation def areaForm' : E →L[ℝ] E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap (↑(LinearMap.toContinuousLinearMap : (E →ₗ[ℝ] ℝ) ≃ₗ[ℝ] E →L[ℝ] ℝ) ∘ₗ o.areaForm) #align orientation.area_form' Orientation.areaForm' @[simp] theorem areaForm'_apply (x : E) : o.areaForm' x = LinearMap.toContinuousLinearMap (o.areaForm x) := rfl #align orientation.area_form'_apply Orientation.areaForm'_apply theorem abs_areaForm_le (x y : E) : |ω x y| ≤ ‖x‖ * ‖y‖ := by simpa [areaForm_to_volumeForm, Fin.prod_univ_succ] using o.abs_volumeForm_apply_le ![x, y] #align orientation.abs_area_form_le Orientation.abs_areaForm_le theorem areaForm_le (x y : E) : ω x y ≤ ‖x‖ * ‖y‖ := by simpa [areaForm_to_volumeForm, Fin.prod_univ_succ] using o.volumeForm_apply_le ![x, y] #align orientation.area_form_le Orientation.areaForm_le theorem abs_areaForm_of_orthogonal {x y : E} (h : ⟪x, y⟫ = 0) : |ω x y| = ‖x‖ * ‖y‖ := by rw [o.areaForm_to_volumeForm, o.abs_volumeForm_apply_of_pairwise_orthogonal] · simp [Fin.prod_univ_succ] intro i j hij fin_cases i <;> fin_cases j · simp_all · simpa using h · simpa [real_inner_comm] using h · simp_all #align orientation.abs_area_form_of_orthogonal Orientation.abs_areaForm_of_orthogonal
Mathlib/Analysis/InnerProductSpace/TwoDim.lean
161
168
theorem areaForm_map {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] [hF : Fact (finrank ℝ F = 2)] (φ : E ≃ₗᵢ[ℝ] F) (x y : F) : (Orientation.map (Fin 2) φ.toLinearEquiv o).areaForm x y = o.areaForm (φ.symm x) (φ.symm y) := by
have : φ.symm ∘ ![x, y] = ![φ.symm x, φ.symm y] := by ext i fin_cases i <;> rfl simp [areaForm_to_volumeForm, volumeForm_map, this]
false
import Mathlib.Order.SuccPred.Basic import Mathlib.Order.BoundedOrder #align_import order.succ_pred.limit from "leanprover-community/mathlib"@"1e05171a5e8cf18d98d9cf7b207540acb044acae" variable {α : Type*} namespace Order open Function Set OrderDual section LT variable [LT α] def IsSuccLimit (a : α) : Prop := ∀ b, ¬b ⋖ a #align order.is_succ_limit Order.IsSuccLimit
Mathlib/Order/SuccPred/Limit.lean
46
47
theorem not_isSuccLimit_iff_exists_covBy (a : α) : ¬IsSuccLimit a ↔ ∃ b, b ⋖ a := by
simp [IsSuccLimit]
false
import Mathlib.Algebra.BigOperators.Group.Finset #align_import data.nat.gcd.big_operators from "leanprover-community/mathlib"@"008205aa645b3f194c1da47025c5f110c8406eab" namespace Nat variable {ι : Type*} theorem coprime_list_prod_left_iff {l : List ℕ} {k : ℕ} : Coprime l.prod k ↔ ∀ n ∈ l, Coprime n k := by induction l <;> simp [Nat.coprime_mul_iff_left, *] theorem coprime_list_prod_right_iff {k : ℕ} {l : List ℕ} : Coprime k l.prod ↔ ∀ n ∈ l, Coprime k n := by simp_rw [coprime_comm (n := k), coprime_list_prod_left_iff] theorem coprime_multiset_prod_left_iff {m : Multiset ℕ} {k : ℕ} : Coprime m.prod k ↔ ∀ n ∈ m, Coprime n k := by induction m using Quotient.inductionOn; simpa using coprime_list_prod_left_iff theorem coprime_multiset_prod_right_iff {k : ℕ} {m : Multiset ℕ} : Coprime k m.prod ↔ ∀ n ∈ m, Coprime k n := by induction m using Quotient.inductionOn; simpa using coprime_list_prod_right_iff theorem coprime_prod_left_iff {t : Finset ι} {s : ι → ℕ} {x : ℕ} : Coprime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, Coprime (s i) x := by simpa using coprime_multiset_prod_left_iff (m := t.val.map s) theorem coprime_prod_right_iff {x : ℕ} {t : Finset ι} {s : ι → ℕ} : Coprime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, Coprime x (s i) := by simpa using coprime_multiset_prod_right_iff (m := t.val.map s) alias ⟨_, Coprime.prod_left⟩ := coprime_prod_left_iff #align nat.coprime_prod_left Nat.Coprime.prod_left alias ⟨_, Coprime.prod_right⟩ := coprime_prod_right_iff #align nat.coprime_prod_right Nat.Coprime.prod_right theorem coprime_fintype_prod_left_iff [Fintype ι] {s : ι → ℕ} {x : ℕ} : Coprime (∏ i, s i) x ↔ ∀ i, Coprime (s i) x := by simp [coprime_prod_left_iff]
Mathlib/Data/Nat/GCD/BigOperators.lean
56
58
theorem coprime_fintype_prod_right_iff [Fintype ι] {x : ℕ} {s : ι → ℕ} : Coprime x (∏ i, s i) ↔ ∀ i, Coprime x (s i) := by
simp [coprime_prod_right_iff]
false
import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.GroupTheory.MonoidLocalization import Mathlib.RingTheory.Ideal.Basic import Mathlib.GroupTheory.GroupAction.Ring #align_import ring_theory.localization.basic from "leanprover-community/mathlib"@"b69c9a770ecf37eb21f7b8cf4fa00de3b62694ec" open Function section CommSemiring variable {R : Type*} [CommSemiring R] (M : Submonoid R) (S : Type*) [CommSemiring S] variable [Algebra R S] {P : Type*} [CommSemiring P] @[mk_iff] class IsLocalization : Prop where -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit. map_units' : ∀ y : M, IsUnit (algebraMap R S y) surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1 exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y #align is_localization IsLocalization variable {M} namespace IsLocalization section IsLocalization variable [IsLocalization M S] section @[inherit_doc IsLocalization.map_units'] theorem map_units : ∀ y : M, IsUnit (algebraMap R S y) := IsLocalization.map_units' variable (M) {S} @[inherit_doc IsLocalization.surj'] theorem surj : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1 := IsLocalization.surj' variable (S) @[inherit_doc IsLocalization.exists_of_eq] theorem eq_iff_exists {x y} : algebraMap R S x = algebraMap R S y ↔ ∃ c : M, ↑c * x = ↑c * y := Iff.intro IsLocalization.exists_of_eq fun ⟨c, h⟩ ↦ by apply_fun algebraMap R S at h rw [map_mul, map_mul] at h exact (IsLocalization.map_units S c).mul_right_inj.mp h variable {S}
Mathlib/RingTheory/Localization/Basic.lean
135
144
theorem of_le (N : Submonoid R) (h₁ : M ≤ N) (h₂ : ∀ r ∈ N, IsUnit (algebraMap R S r)) : IsLocalization N S where map_units' r := h₂ r r.2 surj' s := have ⟨⟨x, y, hy⟩, H⟩ := IsLocalization.surj M s ⟨⟨x, y, h₁ hy⟩, H⟩ exists_of_eq {x y} := by
rw [IsLocalization.eq_iff_exists M] rintro ⟨c, hc⟩ exact ⟨⟨c, h₁ c.2⟩, hc⟩
false
import Mathlib.MeasureTheory.Measure.VectorMeasure import Mathlib.MeasureTheory.Function.AEEqOfIntegral #align_import measure_theory.measure.with_density_vector_measure from "leanprover-community/mathlib"@"d1bd9c5df2867c1cb463bc6364446d57bdd9f7f1" noncomputable section open scoped Classical MeasureTheory NNReal ENNReal variable {α β : Type*} {m : MeasurableSpace α} namespace MeasureTheory open TopologicalSpace variable {μ ν : Measure α} variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] def Measure.withDensityᵥ {m : MeasurableSpace α} (μ : Measure α) (f : α → E) : VectorMeasure α E := if hf : Integrable f μ then { measureOf' := fun s => if MeasurableSet s then ∫ x in s, f x ∂μ else 0 empty' := by simp not_measurable' := fun s hs => if_neg hs m_iUnion' := fun s hs₁ hs₂ => by dsimp only convert hasSum_integral_iUnion hs₁ hs₂ hf.integrableOn with n · rw [if_pos (hs₁ n)] · rw [if_pos (MeasurableSet.iUnion hs₁)] } else 0 #align measure_theory.measure.with_densityᵥ MeasureTheory.Measure.withDensityᵥ open Measure variable {f g : α → E} theorem withDensityᵥ_apply (hf : Integrable f μ) {s : Set α} (hs : MeasurableSet s) : μ.withDensityᵥ f s = ∫ x in s, f x ∂μ := by rw [withDensityᵥ, dif_pos hf]; exact dif_pos hs #align measure_theory.with_densityᵥ_apply MeasureTheory.withDensityᵥ_apply @[simp]
Mathlib/MeasureTheory/Measure/WithDensityVectorMeasure.lean
64
65
theorem withDensityᵥ_zero : μ.withDensityᵥ (0 : α → E) = 0 := by
ext1 s hs; erw [withDensityᵥ_apply (integrable_zero α E μ) hs]; simp
false
import Mathlib.ModelTheory.Satisfiability import Mathlib.Combinatorics.SimpleGraph.Basic #align_import model_theory.graph from "leanprover-community/mathlib"@"e56b8fea84d60fe434632b9d3b829ee685fb0c8f" set_option linter.uppercaseLean3 false universe u v w w' namespace FirstOrder namespace Language open FirstOrder open Structure variable {L : Language.{u, v}} {α : Type w} {V : Type w'} {n : ℕ} protected def graph : Language := Language.mk₂ Empty Empty Empty Empty Unit #align first_order.language.graph FirstOrder.Language.graph def adj : Language.graph.Relations 2 := Unit.unit #align first_order.language.adj FirstOrder.Language.adj def _root_.SimpleGraph.structure (G : SimpleGraph V) : Language.graph.Structure V := Structure.mk₂ Empty.elim Empty.elim Empty.elim Empty.elim fun _ => G.Adj #align simple_graph.Structure SimpleGraph.structure protected def Theory.simpleGraph : Language.graph.Theory := {adj.irreflexive, adj.symmetric} #align first_order.language.Theory.simple_graph FirstOrder.Language.Theory.simpleGraph @[simp] theorem Theory.simpleGraph_model_iff [Language.graph.Structure V] : V ⊨ Theory.simpleGraph ↔ (Irreflexive fun x y : V => RelMap adj ![x, y]) ∧ Symmetric fun x y : V => RelMap adj ![x, y] := by simp [Theory.simpleGraph] #align first_order.language.Theory.simple_graph_model_iff FirstOrder.Language.Theory.simpleGraph_model_iff instance simpleGraph_model (G : SimpleGraph V) : @Theory.Model _ V G.structure Theory.simpleGraph := by simp only [@Theory.simpleGraph_model_iff _ G.structure, relMap_apply₂] exact ⟨G.loopless, G.symm⟩ #align first_order.language.simple_graph_model FirstOrder.Language.simpleGraph_model variable (V) @[simps] def simpleGraphOfStructure [Language.graph.Structure V] [V ⊨ Theory.simpleGraph] : SimpleGraph V where Adj x y := RelMap adj ![x, y] symm := Relations.realize_symmetric.1 (Theory.realize_sentence_of_mem Theory.simpleGraph (Set.mem_insert_of_mem _ (Set.mem_singleton _))) loopless := Relations.realize_irreflexive.1 (Theory.realize_sentence_of_mem Theory.simpleGraph (Set.mem_insert _ _)) #align first_order.language.simple_graph_of_structure FirstOrder.Language.simpleGraphOfStructure variable {V} @[simp]
Mathlib/ModelTheory/Graph.lean
107
110
theorem _root_.SimpleGraph.simpleGraphOfStructure (G : SimpleGraph V) : @simpleGraphOfStructure V G.structure _ = G := by
ext rfl
false
import Mathlib.Analysis.Seminorm import Mathlib.Topology.Algebra.Equicontinuity import Mathlib.Topology.MetricSpace.Equicontinuity import Mathlib.Topology.Algebra.FilterBasis import Mathlib.Topology.Algebra.Module.LocallyConvex #align_import analysis.locally_convex.with_seminorms from "leanprover-community/mathlib"@"b31173ee05c911d61ad6a05bd2196835c932e0ec" open NormedField Set Seminorm TopologicalSpace Filter List open NNReal Pointwise Topology Uniformity variable {𝕜 𝕜₂ 𝕝 𝕝₂ E F G ι ι' : Type*} section FilterBasis variable [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E] variable (𝕜 E ι) abbrev SeminormFamily := ι → Seminorm 𝕜 E #align seminorm_family SeminormFamily variable {𝕜 E ι} namespace SeminormFamily def basisSets (p : SeminormFamily 𝕜 E ι) : Set (Set E) := ⋃ (s : Finset ι) (r) (_ : 0 < r), singleton (ball (s.sup p) (0 : E) r) #align seminorm_family.basis_sets SeminormFamily.basisSets variable (p : SeminormFamily 𝕜 E ι) theorem basisSets_iff {U : Set E} : U ∈ p.basisSets ↔ ∃ (i : Finset ι) (r : ℝ), 0 < r ∧ U = ball (i.sup p) 0 r := by simp only [basisSets, mem_iUnion, exists_prop, mem_singleton_iff] #align seminorm_family.basis_sets_iff SeminormFamily.basisSets_iff theorem basisSets_mem (i : Finset ι) {r : ℝ} (hr : 0 < r) : (i.sup p).ball 0 r ∈ p.basisSets := (basisSets_iff _).mpr ⟨i, _, hr, rfl⟩ #align seminorm_family.basis_sets_mem SeminormFamily.basisSets_mem theorem basisSets_singleton_mem (i : ι) {r : ℝ} (hr : 0 < r) : (p i).ball 0 r ∈ p.basisSets := (basisSets_iff _).mpr ⟨{i}, _, hr, by rw [Finset.sup_singleton]⟩ #align seminorm_family.basis_sets_singleton_mem SeminormFamily.basisSets_singleton_mem theorem basisSets_nonempty [Nonempty ι] : p.basisSets.Nonempty := by let i := Classical.arbitrary ι refine nonempty_def.mpr ⟨(p i).ball 0 1, ?_⟩ exact p.basisSets_singleton_mem i zero_lt_one #align seminorm_family.basis_sets_nonempty SeminormFamily.basisSets_nonempty theorem basisSets_intersect (U V : Set E) (hU : U ∈ p.basisSets) (hV : V ∈ p.basisSets) : ∃ z ∈ p.basisSets, z ⊆ U ∩ V := by classical rcases p.basisSets_iff.mp hU with ⟨s, r₁, hr₁, hU⟩ rcases p.basisSets_iff.mp hV with ⟨t, r₂, hr₂, hV⟩ use ((s ∪ t).sup p).ball 0 (min r₁ r₂) refine ⟨p.basisSets_mem (s ∪ t) (lt_min_iff.mpr ⟨hr₁, hr₂⟩), ?_⟩ rw [hU, hV, ball_finset_sup_eq_iInter _ _ _ (lt_min_iff.mpr ⟨hr₁, hr₂⟩), ball_finset_sup_eq_iInter _ _ _ hr₁, ball_finset_sup_eq_iInter _ _ _ hr₂] exact Set.subset_inter (Set.iInter₂_mono' fun i hi => ⟨i, Finset.subset_union_left hi, ball_mono <| min_le_left _ _⟩) (Set.iInter₂_mono' fun i hi => ⟨i, Finset.subset_union_right hi, ball_mono <| min_le_right _ _⟩) #align seminorm_family.basis_sets_intersect SeminormFamily.basisSets_intersect theorem basisSets_zero (U) (hU : U ∈ p.basisSets) : (0 : E) ∈ U := by rcases p.basisSets_iff.mp hU with ⟨ι', r, hr, hU⟩ rw [hU, mem_ball_zero, map_zero] exact hr #align seminorm_family.basis_sets_zero SeminormFamily.basisSets_zero theorem basisSets_add (U) (hU : U ∈ p.basisSets) : ∃ V ∈ p.basisSets, V + V ⊆ U := by rcases p.basisSets_iff.mp hU with ⟨s, r, hr, hU⟩ use (s.sup p).ball 0 (r / 2) refine ⟨p.basisSets_mem s (div_pos hr zero_lt_two), ?_⟩ refine Set.Subset.trans (ball_add_ball_subset (s.sup p) (r / 2) (r / 2) 0 0) ?_ rw [hU, add_zero, add_halves'] #align seminorm_family.basis_sets_add SeminormFamily.basisSets_add theorem basisSets_neg (U) (hU' : U ∈ p.basisSets) : ∃ V ∈ p.basisSets, V ⊆ (fun x : E => -x) ⁻¹' U := by rcases p.basisSets_iff.mp hU' with ⟨s, r, _, hU⟩ rw [hU, neg_preimage, neg_ball (s.sup p), neg_zero] exact ⟨U, hU', Eq.subset hU⟩ #align seminorm_family.basis_sets_neg SeminormFamily.basisSets_neg protected def addGroupFilterBasis [Nonempty ι] : AddGroupFilterBasis E := addGroupFilterBasisOfComm p.basisSets p.basisSets_nonempty p.basisSets_intersect p.basisSets_zero p.basisSets_add p.basisSets_neg #align seminorm_family.add_group_filter_basis SeminormFamily.addGroupFilterBasis
Mathlib/Analysis/LocallyConvex/WithSeminorms.lean
143
153
theorem basisSets_smul_right (v : E) (U : Set E) (hU : U ∈ p.basisSets) : ∀ᶠ x : 𝕜 in 𝓝 0, x • v ∈ U := by
rcases p.basisSets_iff.mp hU with ⟨s, r, hr, hU⟩ rw [hU, Filter.eventually_iff] simp_rw [(s.sup p).mem_ball_zero, map_smul_eq_mul] by_cases h : 0 < (s.sup p) v · simp_rw [(lt_div_iff h).symm] rw [← _root_.ball_zero_eq] exact Metric.ball_mem_nhds 0 (div_pos hr h) simp_rw [le_antisymm (not_lt.mp h) (apply_nonneg _ v), mul_zero, hr] exact IsOpen.mem_nhds isOpen_univ (mem_univ 0)
false
import Mathlib.Analysis.NormedSpace.ContinuousAffineMap import Mathlib.Analysis.Calculus.ContDiff.Basic #align_import analysis.calculus.affine_map from "leanprover-community/mathlib"@"839b92fedff9981cf3fe1c1f623e04b0d127f57c" namespace ContinuousAffineMap variable {𝕜 V W : Type*} [NontriviallyNormedField 𝕜] variable [NormedAddCommGroup V] [NormedSpace 𝕜 V] variable [NormedAddCommGroup W] [NormedSpace 𝕜 W]
Mathlib/Analysis/Calculus/AffineMap.lean
30
33
theorem contDiff {n : ℕ∞} (f : V →ᴬ[𝕜] W) : ContDiff 𝕜 n f := by
rw [f.decomp] apply f.contLinear.contDiff.add exact contDiff_const
false
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order import Mathlib.Topology.Order.LeftRightLim #align_import measure_theory.measure.stieltjes from "leanprover-community/mathlib"@"20d5763051978e9bc6428578ed070445df6a18b3" noncomputable section open scoped Classical open Set Filter Function ENNReal NNReal Topology MeasureTheory open ENNReal (ofReal) structure StieltjesFunction where toFun : ℝ → ℝ mono' : Monotone toFun right_continuous' : ∀ x, ContinuousWithinAt toFun (Ici x) x #align stieltjes_function StieltjesFunction #align stieltjes_function.to_fun StieltjesFunction.toFun #align stieltjes_function.mono' StieltjesFunction.mono' #align stieltjes_function.right_continuous' StieltjesFunction.right_continuous' namespace StieltjesFunction attribute [coe] toFun instance instCoeFun : CoeFun StieltjesFunction fun _ => ℝ → ℝ := ⟨toFun⟩ #align stieltjes_function.has_coe_to_fun StieltjesFunction.instCoeFun initialize_simps_projections StieltjesFunction (toFun → apply) @[ext] lemma ext {f g : StieltjesFunction} (h : ∀ x, f x = g x) : f = g := by exact (StieltjesFunction.mk.injEq ..).mpr (funext (by exact h)) variable (f : StieltjesFunction) theorem mono : Monotone f := f.mono' #align stieltjes_function.mono StieltjesFunction.mono theorem right_continuous (x : ℝ) : ContinuousWithinAt f (Ici x) x := f.right_continuous' x #align stieltjes_function.right_continuous StieltjesFunction.right_continuous theorem rightLim_eq (f : StieltjesFunction) (x : ℝ) : Function.rightLim f x = f x := by rw [← f.mono.continuousWithinAt_Ioi_iff_rightLim_eq, continuousWithinAt_Ioi_iff_Ici] exact f.right_continuous' x #align stieltjes_function.right_lim_eq StieltjesFunction.rightLim_eq
Mathlib/MeasureTheory/Measure/Stieltjes.lean
76
80
theorem iInf_Ioi_eq (f : StieltjesFunction) (x : ℝ) : ⨅ r : Ioi x, f r = f x := by
suffices Function.rightLim f x = ⨅ r : Ioi x, f r by rw [← this, f.rightLim_eq] rw [f.mono.rightLim_eq_sInf, sInf_image'] rw [← neBot_iff] infer_instance
false
import Mathlib.Analysis.Calculus.Deriv.Inv import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Analysis.SpecialFunctions.ExpDeriv import Mathlib.Analysis.SpecialFunctions.PolynomialExp #align_import analysis.calculus.bump_function_inner from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Topology open Polynomial Real Filter Set Function open scoped Polynomial def expNegInvGlue (x : ℝ) : ℝ := if x ≤ 0 then 0 else exp (-x⁻¹) #align exp_neg_inv_glue expNegInvGlue namespace expNegInvGlue
Mathlib/Analysis/SpecialFunctions/SmoothTransition.lean
46
46
theorem zero_of_nonpos {x : ℝ} (hx : x ≤ 0) : expNegInvGlue x = 0 := by
simp [expNegInvGlue, hx]
false
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs #align_import analysis.calculus.iterated_deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Topology open Filter Asymptotics Set variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] def iteratedDeriv (n : ℕ) (f : 𝕜 → F) (x : 𝕜) : F := (iteratedFDeriv 𝕜 n f x : (Fin n → 𝕜) → F) fun _ : Fin n => 1 #align iterated_deriv iteratedDeriv def iteratedDerivWithin (n : ℕ) (f : 𝕜 → F) (s : Set 𝕜) (x : 𝕜) : F := (iteratedFDerivWithin 𝕜 n f s x : (Fin n → 𝕜) → F) fun _ : Fin n => 1 #align iterated_deriv_within iteratedDerivWithin variable {n : ℕ} {f : 𝕜 → F} {s : Set 𝕜} {x : 𝕜} theorem iteratedDerivWithin_univ : iteratedDerivWithin n f univ = iteratedDeriv n f := by ext x rw [iteratedDerivWithin, iteratedDeriv, iteratedFDerivWithin_univ] #align iterated_deriv_within_univ iteratedDerivWithin_univ theorem iteratedDerivWithin_eq_iteratedFDerivWithin : iteratedDerivWithin n f s x = (iteratedFDerivWithin 𝕜 n f s x : (Fin n → 𝕜) → F) fun _ : Fin n => 1 := rfl #align iterated_deriv_within_eq_iterated_fderiv_within iteratedDerivWithin_eq_iteratedFDerivWithin theorem iteratedDerivWithin_eq_equiv_comp : iteratedDerivWithin n f s = (ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F).symm ∘ iteratedFDerivWithin 𝕜 n f s := by ext x; rfl #align iterated_deriv_within_eq_equiv_comp iteratedDerivWithin_eq_equiv_comp
Mathlib/Analysis/Calculus/IteratedDeriv/Defs.lean
91
95
theorem iteratedFDerivWithin_eq_equiv_comp : iteratedFDerivWithin 𝕜 n f s = ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F ∘ iteratedDerivWithin n f s := by
rw [iteratedDerivWithin_eq_equiv_comp, ← Function.comp.assoc, LinearIsometryEquiv.self_comp_symm, Function.id_comp]
false
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.BigOperators import Mathlib.Algebra.Polynomial.Degree.Lemmas import Mathlib.Algebra.Polynomial.Div #align_import data.polynomial.ring_division from "leanprover-community/mathlib"@"8efcf8022aac8e01df8d302dcebdbc25d6a886c8" noncomputable section open Polynomial open Finset namespace Polynomial universe u v w z variable {R : Type u} {S : Type v} {T : Type w} {a b : R} {n : ℕ} section NoZeroDivisors variable [Semiring R] [NoZeroDivisors R] {p q : R[X]} instance : NoZeroDivisors R[X] where eq_zero_or_eq_zero_of_mul_eq_zero h := by rw [← leadingCoeff_eq_zero, ← leadingCoeff_eq_zero] refine eq_zero_or_eq_zero_of_mul_eq_zero ?_ rw [← leadingCoeff_zero, ← leadingCoeff_mul, h]
Mathlib/Algebra/Polynomial/RingDivision.lean
124
126
theorem natDegree_mul (hp : p ≠ 0) (hq : q ≠ 0) : (p*q).natDegree = p.natDegree + q.natDegree := by
rw [← Nat.cast_inj (R := WithBot ℕ), ← degree_eq_natDegree (mul_ne_zero hp hq), Nat.cast_add, ← degree_eq_natDegree hp, ← degree_eq_natDegree hq, degree_mul]
false
import Mathlib.Algebra.IsPrimePow import Mathlib.Algebra.Squarefree.Basic import Mathlib.Order.Hom.Bounded import Mathlib.Algebra.GCDMonoid.Basic #align_import ring_theory.chain_of_divisors from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" variable {M : Type*} [CancelCommMonoidWithZero M] theorem Associates.isAtom_iff {p : Associates M} (h₁ : p ≠ 0) : IsAtom p ↔ Irreducible p := ⟨fun hp => ⟨by simpa only [Associates.isUnit_iff_eq_one] using hp.1, fun a b h => (hp.le_iff.mp ⟨_, h⟩).casesOn (fun ha => Or.inl (a.isUnit_iff_eq_one.mpr ha)) fun ha => Or.inr (show IsUnit b by rw [ha] at h apply isUnit_of_associated_mul (show Associated (p * b) p by conv_rhs => rw [h]) h₁)⟩, fun hp => ⟨by simpa only [Associates.isUnit_iff_eq_one, Associates.bot_eq_one] using hp.1, fun b ⟨⟨a, hab⟩, hb⟩ => (hp.isUnit_or_isUnit hab).casesOn (fun hb => show b = ⊥ by rwa [Associates.isUnit_iff_eq_one, ← Associates.bot_eq_one] at hb) fun ha => absurd (show p ∣ b from ⟨(ha.unit⁻¹ : Units _), by rw [hab, mul_assoc, IsUnit.mul_val_inv ha, mul_one]⟩) hb⟩⟩ #align associates.is_atom_iff Associates.isAtom_iff open UniqueFactorizationMonoid multiplicity Irreducible Associates variable {N : Type*} [CancelCommMonoidWithZero N]
Mathlib/RingTheory/ChainOfDivisors.lean
224
231
theorem factor_orderIso_map_one_eq_bot {m : Associates M} {n : Associates N} (d : { l : Associates M // l ≤ m } ≃o { l : Associates N // l ≤ n }) : (d ⟨1, one_dvd m⟩ : Associates N) = 1 := by
letI : OrderBot { l : Associates M // l ≤ m } := Subtype.orderBot bot_le letI : OrderBot { l : Associates N // l ≤ n } := Subtype.orderBot bot_le simp only [← Associates.bot_eq_one, Subtype.mk_bot, bot_le, Subtype.coe_eq_bot_iff] letI : BotHomClass ({ l // l ≤ m } ≃o { l // l ≤ n }) _ _ := OrderIsoClass.toBotHomClass exact map_bot d
false
import Mathlib.CategoryTheory.Equivalence #align_import algebraic_topology.dold_kan.compatibility from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category namespace AlgebraicTopology namespace DoldKan namespace Compatibility variable {A A' B B' : Type*} [Category A] [Category A'] [Category B] [Category B'] (eA : A ≌ A') (eB : B ≌ B') (e' : A' ≌ B') {F : A ⥤ B'} (hF : eA.functor ⋙ e'.functor ≅ F) {G : B ⥤ A} (hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor) @[simps! functor inverse unitIso_hom_app] def equivalence₀ : A ≌ B' := eA.trans e' #align algebraic_topology.dold_kan.compatibility.equivalence₀ AlgebraicTopology.DoldKan.Compatibility.equivalence₀ variable {eA} {e'} @[simps! functor] def equivalence₁ : A ≌ B' := (equivalence₀ eA e').changeFunctor hF #align algebraic_topology.dold_kan.compatibility.equivalence₁ AlgebraicTopology.DoldKan.Compatibility.equivalence₁ theorem equivalence₁_inverse : (equivalence₁ hF).inverse = e'.inverse ⋙ eA.inverse := rfl #align algebraic_topology.dold_kan.compatibility.equivalence₁_inverse AlgebraicTopology.DoldKan.Compatibility.equivalence₁_inverse @[simps!] def equivalence₁CounitIso : (e'.inverse ⋙ eA.inverse) ⋙ F ≅ 𝟭 B' := calc (e'.inverse ⋙ eA.inverse) ⋙ F ≅ (e'.inverse ⋙ eA.inverse) ⋙ eA.functor ⋙ e'.functor := isoWhiskerLeft _ hF.symm _ ≅ e'.inverse ⋙ (eA.inverse ⋙ eA.functor) ⋙ e'.functor := Iso.refl _ _ ≅ e'.inverse ⋙ 𝟭 _ ⋙ e'.functor := isoWhiskerLeft _ (isoWhiskerRight eA.counitIso _) _ ≅ e'.inverse ⋙ e'.functor := Iso.refl _ _ ≅ 𝟭 B' := e'.counitIso #align algebraic_topology.dold_kan.compatibility.equivalence₁_counit_iso AlgebraicTopology.DoldKan.Compatibility.equivalence₁CounitIso theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by ext Y simp [equivalence₁, equivalence₀] #align algebraic_topology.dold_kan.compatibility.equivalence₁_counit_iso_eq AlgebraicTopology.DoldKan.Compatibility.equivalence₁CounitIso_eq @[simps!] def equivalence₁UnitIso : 𝟭 A ≅ F ⋙ e'.inverse ⋙ eA.inverse := calc 𝟭 A ≅ eA.functor ⋙ eA.inverse := eA.unitIso _ ≅ eA.functor ⋙ 𝟭 A' ⋙ eA.inverse := Iso.refl _ _ ≅ eA.functor ⋙ (e'.functor ⋙ e'.inverse) ⋙ eA.inverse := isoWhiskerLeft _ (isoWhiskerRight e'.unitIso _) _ ≅ (eA.functor ⋙ e'.functor) ⋙ e'.inverse ⋙ eA.inverse := Iso.refl _ _ ≅ F ⋙ e'.inverse ⋙ eA.inverse := isoWhiskerRight hF _ #align algebraic_topology.dold_kan.compatibility.equivalence₁_unit_iso AlgebraicTopology.DoldKan.Compatibility.equivalence₁UnitIso
Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean
103
105
theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by
ext X simp [equivalence₁]
false
import Mathlib.Data.PFunctor.Univariate.M #align_import data.qpf.univariate.basic from "leanprover-community/mathlib"@"14b69e9f3c16630440a2cbd46f1ddad0d561dee7" universe u class QPF (F : Type u → Type u) [Functor F] where P : PFunctor.{u} abs : ∀ {α}, P α → F α repr : ∀ {α}, F α → P α abs_repr : ∀ {α} (x : F α), abs (repr x) = x abs_map : ∀ {α β} (f : α → β) (p : P α), abs (P.map f p) = f <$> abs p #align qpf QPF namespace QPF variable {F : Type u → Type u} [Functor F] [q : QPF F] open Functor (Liftp Liftr) def corecF {α : Type _} (g : α → F α) : α → q.P.M := PFunctor.M.corec fun x => repr (g x) set_option linter.uppercaseLean3 false in #align qpf.corecF QPF.corecF
Mathlib/Data/QPF/Univariate/Basic.lean
377
379
theorem corecF_eq {α : Type _} (g : α → F α) (x : α) : PFunctor.M.dest (corecF g x) = q.P.map (corecF g) (repr (g x)) := by
rw [corecF, PFunctor.M.dest_corec]
false
import Mathlib.FieldTheory.RatFunc.AsPolynomial import Mathlib.RingTheory.EuclideanDomain import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Polynomial.Content noncomputable section universe u variable {K : Type u} namespace RatFunc section IntDegree open Polynomial variable [Field K] def intDegree (x : RatFunc K) : ℤ := natDegree x.num - natDegree x.denom #align ratfunc.int_degree RatFunc.intDegree @[simp] theorem intDegree_zero : intDegree (0 : RatFunc K) = 0 := by rw [intDegree, num_zero, natDegree_zero, denom_zero, natDegree_one, sub_self] #align ratfunc.int_degree_zero RatFunc.intDegree_zero @[simp] theorem intDegree_one : intDegree (1 : RatFunc K) = 0 := by rw [intDegree, num_one, denom_one, sub_self] #align ratfunc.int_degree_one RatFunc.intDegree_one @[simp] theorem intDegree_C (k : K) : intDegree (C k) = 0 := by rw [intDegree, num_C, natDegree_C, denom_C, natDegree_one, sub_self] set_option linter.uppercaseLean3 false in #align ratfunc.int_degree_C RatFunc.intDegree_C @[simp] theorem intDegree_X : intDegree (X : RatFunc K) = 1 := by rw [intDegree, num_X, Polynomial.natDegree_X, denom_X, Polynomial.natDegree_one, Int.ofNat_one, Int.ofNat_zero, sub_zero] set_option linter.uppercaseLean3 false in #align ratfunc.int_degree_X RatFunc.intDegree_X @[simp]
Mathlib/FieldTheory/RatFunc/Degree.lean
65
68
theorem intDegree_polynomial {p : K[X]} : intDegree (algebraMap K[X] (RatFunc K) p) = natDegree p := by
rw [intDegree, RatFunc.num_algebraMap, RatFunc.denom_algebraMap, Polynomial.natDegree_one, Int.ofNat_zero, sub_zero]
false
import Mathlib.Algebra.BigOperators.Module import Mathlib.Algebra.Order.Field.Basic import Mathlib.Order.Filter.ModEq import Mathlib.Analysis.Asymptotics.Asymptotics import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.List.TFAE import Mathlib.Analysis.NormedSpace.Basic #align_import analysis.specific_limits.normed from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Classical open Set Function Filter Finset Metric Asymptotics open scoped Classical open Topology Nat uniformity NNReal ENNReal variable {α : Type*} {β : Type*} {ι : Type*} theorem tendsto_norm_atTop_atTop : Tendsto (norm : ℝ → ℝ) atTop atTop := tendsto_abs_atTop_atTop #align tendsto_norm_at_top_at_top tendsto_norm_atTop_atTop theorem summable_of_absolute_convergence_real {f : ℕ → ℝ} : (∃ r, Tendsto (fun n ↦ ∑ i ∈ range n, |f i|) atTop (𝓝 r)) → Summable f | ⟨r, hr⟩ => by refine .of_norm ⟨r, (hasSum_iff_tendsto_nat_of_nonneg ?_ _).2 ?_⟩ · exact fun i ↦ norm_nonneg _ · simpa only using hr #align summable_of_absolute_convergence_real summable_of_absolute_convergence_real theorem tendsto_norm_zero' {𝕜 : Type*} [NormedAddCommGroup 𝕜] : Tendsto (norm : 𝕜 → ℝ) (𝓝[≠] 0) (𝓝[>] 0) := tendsto_norm_zero.inf <| tendsto_principal_principal.2 fun _ hx ↦ norm_pos_iff.2 hx #align tendsto_norm_zero' tendsto_norm_zero' theorem isLittleO_pow_pow_of_lt_left {r₁ r₂ : ℝ} (h₁ : 0 ≤ r₁) (h₂ : r₁ < r₂) : (fun n : ℕ ↦ r₁ ^ n) =o[atTop] fun n ↦ r₂ ^ n := have H : 0 < r₂ := h₁.trans_lt h₂ (isLittleO_of_tendsto fun _ hn ↦ False.elim <| H.ne' <| pow_eq_zero hn) <| (tendsto_pow_atTop_nhds_zero_of_lt_one (div_nonneg h₁ (h₁.trans h₂.le)) ((div_lt_one H).2 h₂)).congr fun _ ↦ div_pow _ _ _ #align is_o_pow_pow_of_lt_left isLittleO_pow_pow_of_lt_left theorem isBigO_pow_pow_of_le_left {r₁ r₂ : ℝ} (h₁ : 0 ≤ r₁) (h₂ : r₁ ≤ r₂) : (fun n : ℕ ↦ r₁ ^ n) =O[atTop] fun n ↦ r₂ ^ n := h₂.eq_or_lt.elim (fun h ↦ h ▸ isBigO_refl _ _) fun h ↦ (isLittleO_pow_pow_of_lt_left h₁ h).isBigO set_option linter.uppercaseLean3 false in #align is_O_pow_pow_of_le_left isBigO_pow_pow_of_le_left
Mathlib/Analysis/SpecificLimits/Normed.lean
111
114
theorem isLittleO_pow_pow_of_abs_lt_left {r₁ r₂ : ℝ} (h : |r₁| < |r₂|) : (fun n : ℕ ↦ r₁ ^ n) =o[atTop] fun n ↦ r₂ ^ n := by
refine (IsLittleO.of_norm_left ?_).of_norm_right exact (isLittleO_pow_pow_of_lt_left (abs_nonneg r₁) h).congr (pow_abs r₁) (pow_abs r₂)
false
import Mathlib.Analysis.SpecialFunctions.Pow.Complex import Qq #align_import analysis.special_functions.pow.real from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8" noncomputable section open scoped Classical open Real ComplexConjugate open Finset Set namespace Real variable {x y z : ℝ} noncomputable def rpow (x y : ℝ) := ((x : ℂ) ^ (y : ℂ)).re #align real.rpow Real.rpow noncomputable instance : Pow ℝ ℝ := ⟨rpow⟩ @[simp] theorem rpow_eq_pow (x y : ℝ) : rpow x y = x ^ y := rfl #align real.rpow_eq_pow Real.rpow_eq_pow theorem rpow_def (x y : ℝ) : x ^ y = ((x : ℂ) ^ (y : ℂ)).re := rfl #align real.rpow_def Real.rpow_def theorem rpow_def_of_nonneg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) := by simp only [rpow_def, Complex.cpow_def]; split_ifs <;> simp_all [(Complex.ofReal_log hx).symm, -Complex.ofReal_mul, -RCLike.ofReal_mul, (Complex.ofReal_mul _ _).symm, Complex.exp_ofReal_re, Complex.ofReal_eq_zero] #align real.rpow_def_of_nonneg Real.rpow_def_of_nonneg theorem rpow_def_of_pos {x : ℝ} (hx : 0 < x) (y : ℝ) : x ^ y = exp (log x * y) := by rw [rpow_def_of_nonneg (le_of_lt hx), if_neg (ne_of_gt hx)] #align real.rpow_def_of_pos Real.rpow_def_of_pos theorem exp_mul (x y : ℝ) : exp (x * y) = exp x ^ y := by rw [rpow_def_of_pos (exp_pos _), log_exp] #align real.exp_mul Real.exp_mul @[simp, norm_cast] theorem rpow_intCast (x : ℝ) (n : ℤ) : x ^ (n : ℝ) = x ^ n := by simp only [rpow_def, ← Complex.ofReal_zpow, Complex.cpow_intCast, Complex.ofReal_intCast, Complex.ofReal_re] #align real.rpow_int_cast Real.rpow_intCast @[deprecated (since := "2024-04-17")] alias rpow_int_cast := rpow_intCast @[simp, norm_cast] theorem rpow_natCast (x : ℝ) (n : ℕ) : x ^ (n : ℝ) = x ^ n := by simpa using rpow_intCast x n #align real.rpow_nat_cast Real.rpow_natCast @[deprecated (since := "2024-04-17")] alias rpow_nat_cast := rpow_natCast @[simp] theorem exp_one_rpow (x : ℝ) : exp 1 ^ x = exp x := by rw [← exp_mul, one_mul] #align real.exp_one_rpow Real.exp_one_rpow @[simp] lemma exp_one_pow (n : ℕ) : exp 1 ^ n = exp n := by rw [← rpow_natCast, exp_one_rpow] theorem rpow_eq_zero_iff_of_nonneg (hx : 0 ≤ x) : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0 := by simp only [rpow_def_of_nonneg hx] split_ifs <;> simp [*, exp_ne_zero] #align real.rpow_eq_zero_iff_of_nonneg Real.rpow_eq_zero_iff_of_nonneg @[simp] lemma rpow_eq_zero (hx : 0 ≤ x) (hy : y ≠ 0) : x ^ y = 0 ↔ x = 0 := by simp [rpow_eq_zero_iff_of_nonneg, *] @[simp] lemma rpow_ne_zero (hx : 0 ≤ x) (hy : y ≠ 0) : x ^ y ≠ 0 ↔ x ≠ 0 := Real.rpow_eq_zero hx hy |>.not open Real
Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
100
112
theorem rpow_def_of_neg {x : ℝ} (hx : x < 0) (y : ℝ) : x ^ y = exp (log x * y) * cos (y * π) := by
rw [rpow_def, Complex.cpow_def, if_neg] · have : Complex.log x * y = ↑(log (-x) * y) + ↑(y * π) * Complex.I := by simp only [Complex.log, abs_of_neg hx, Complex.arg_ofReal_of_neg hx, Complex.abs_ofReal, Complex.ofReal_mul] ring rw [this, Complex.exp_add_mul_I, ← Complex.ofReal_exp, ← Complex.ofReal_cos, ← Complex.ofReal_sin, mul_add, ← Complex.ofReal_mul, ← mul_assoc, ← Complex.ofReal_mul, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.ofReal_im, Real.log_neg_eq_log] ring · rw [Complex.ofReal_eq_zero] exact ne_of_lt hx
false
import Mathlib.Data.List.Basic #align_import data.list.lattice from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" open Nat namespace List variable {α : Type*} {l l₁ l₂ : List α} {p : α → Prop} {a : α} variable [DecidableEq α] section BagInter @[simp] theorem nil_bagInter (l : List α) : [].bagInter l = [] := by cases l <;> rfl #align list.nil_bag_inter List.nil_bagInter @[simp] theorem bagInter_nil (l : List α) : l.bagInter [] = [] := by cases l <;> rfl #align list.bag_inter_nil List.bagInter_nil @[simp] theorem cons_bagInter_of_pos (l₁ : List α) (h : a ∈ l₂) : (a :: l₁).bagInter l₂ = a :: l₁.bagInter (l₂.erase a) := by cases l₂ · exact if_pos h · simp only [List.bagInter, if_pos (elem_eq_true_of_mem h)] #align list.cons_bag_inter_of_pos List.cons_bagInter_of_pos @[simp]
Mathlib/Data/List/Lattice.lean
211
214
theorem cons_bagInter_of_neg (l₁ : List α) (h : a ∉ l₂) : (a :: l₁).bagInter l₂ = l₁.bagInter l₂ := by
cases l₂; · simp only [bagInter_nil] simp only [erase_of_not_mem h, List.bagInter, if_neg (mt mem_of_elem_eq_true h)]
false
import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Algebra.Order.Ring.Nat import Mathlib.Tactic.NthRewrite #align_import data.nat.gcd.basic from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" namespace Nat theorem gcd_greatest {a b d : ℕ} (hda : d ∣ a) (hdb : d ∣ b) (hd : ∀ e : ℕ, e ∣ a → e ∣ b → e ∣ d) : d = a.gcd b := (dvd_antisymm (hd _ (gcd_dvd_left a b) (gcd_dvd_right a b)) (dvd_gcd hda hdb)).symm #align nat.gcd_greatest Nat.gcd_greatest @[simp] theorem gcd_add_mul_right_right (m n k : ℕ) : gcd m (n + k * m) = gcd m n := by simp [gcd_rec m (n + k * m), gcd_rec m n] #align nat.gcd_add_mul_right_right Nat.gcd_add_mul_right_right @[simp] theorem gcd_add_mul_left_right (m n k : ℕ) : gcd m (n + m * k) = gcd m n := by simp [gcd_rec m (n + m * k), gcd_rec m n] #align nat.gcd_add_mul_left_right Nat.gcd_add_mul_left_right @[simp] theorem gcd_mul_right_add_right (m n k : ℕ) : gcd m (k * m + n) = gcd m n := by simp [add_comm _ n] #align nat.gcd_mul_right_add_right Nat.gcd_mul_right_add_right @[simp] theorem gcd_mul_left_add_right (m n k : ℕ) : gcd m (m * k + n) = gcd m n := by simp [add_comm _ n] #align nat.gcd_mul_left_add_right Nat.gcd_mul_left_add_right @[simp] theorem gcd_add_mul_right_left (m n k : ℕ) : gcd (m + k * n) n = gcd m n := by rw [gcd_comm, gcd_add_mul_right_right, gcd_comm] #align nat.gcd_add_mul_right_left Nat.gcd_add_mul_right_left @[simp] theorem gcd_add_mul_left_left (m n k : ℕ) : gcd (m + n * k) n = gcd m n := by rw [gcd_comm, gcd_add_mul_left_right, gcd_comm] #align nat.gcd_add_mul_left_left Nat.gcd_add_mul_left_left @[simp] theorem gcd_mul_right_add_left (m n k : ℕ) : gcd (k * n + m) n = gcd m n := by rw [gcd_comm, gcd_mul_right_add_right, gcd_comm] #align nat.gcd_mul_right_add_left Nat.gcd_mul_right_add_left @[simp]
Mathlib/Data/Nat/GCD/Basic.lean
68
69
theorem gcd_mul_left_add_left (m n k : ℕ) : gcd (n * k + m) n = gcd m n := by
rw [gcd_comm, gcd_mul_left_add_right, gcd_comm]
false
import Mathlib.Analysis.Normed.Group.InfiniteSum import Mathlib.Analysis.Normed.MulAction import Mathlib.Topology.Algebra.Order.LiminfLimsup import Mathlib.Topology.PartialHomeomorph #align_import analysis.asymptotics.asymptotics from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Filter Set open scoped Classical open Topology Filter NNReal namespace Asymptotics set_option linter.uppercaseLean3 false variable {α : Type*} {β : Type*} {E : Type*} {F : Type*} {G : Type*} {E' : Type*} {F' : Type*} {G' : Type*} {E'' : Type*} {F'' : Type*} {G'' : Type*} {E''' : Type*} {R : Type*} {R' : Type*} {𝕜 : Type*} {𝕜' : Type*} variable [Norm E] [Norm F] [Norm G] variable [SeminormedAddCommGroup E'] [SeminormedAddCommGroup F'] [SeminormedAddCommGroup G'] [NormedAddCommGroup E''] [NormedAddCommGroup F''] [NormedAddCommGroup G''] [SeminormedRing R] [SeminormedAddGroup E'''] [SeminormedRing R'] variable [NormedDivisionRing 𝕜] [NormedDivisionRing 𝕜'] variable {c c' c₁ c₂ : ℝ} {f : α → E} {g : α → F} {k : α → G} variable {f' : α → E'} {g' : α → F'} {k' : α → G'} variable {f'' : α → E''} {g'' : α → F''} {k'' : α → G''} variable {l l' : Filter α} section Defs irreducible_def IsBigOWith (c : ℝ) (l : Filter α) (f : α → E) (g : α → F) : Prop := ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ #align asymptotics.is_O_with Asymptotics.IsBigOWith theorem isBigOWith_iff : IsBigOWith c l f g ↔ ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by rw [IsBigOWith_def] #align asymptotics.is_O_with_iff Asymptotics.isBigOWith_iff alias ⟨IsBigOWith.bound, IsBigOWith.of_bound⟩ := isBigOWith_iff #align asymptotics.is_O_with.bound Asymptotics.IsBigOWith.bound #align asymptotics.is_O_with.of_bound Asymptotics.IsBigOWith.of_bound irreducible_def IsBigO (l : Filter α) (f : α → E) (g : α → F) : Prop := ∃ c : ℝ, IsBigOWith c l f g #align asymptotics.is_O Asymptotics.IsBigO @[inherit_doc] notation:100 f " =O[" l "] " g:100 => IsBigO l f g theorem isBigO_iff_isBigOWith : f =O[l] g ↔ ∃ c : ℝ, IsBigOWith c l f g := by rw [IsBigO_def] #align asymptotics.is_O_iff_is_O_with Asymptotics.isBigO_iff_isBigOWith theorem isBigO_iff : f =O[l] g ↔ ∃ c : ℝ, ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by simp only [IsBigO_def, IsBigOWith_def] #align asymptotics.is_O_iff Asymptotics.isBigO_iff theorem isBigO_iff' {g : α → E'''} : f =O[l] g ↔ ∃ c > 0, ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by refine ⟨fun h => ?mp, fun h => ?mpr⟩ case mp => rw [isBigO_iff] at h obtain ⟨c, hc⟩ := h refine ⟨max c 1, zero_lt_one.trans_le (le_max_right _ _), ?_⟩ filter_upwards [hc] with x hx apply hx.trans gcongr exact le_max_left _ _ case mpr => rw [isBigO_iff] obtain ⟨c, ⟨_, hc⟩⟩ := h exact ⟨c, hc⟩
Mathlib/Analysis/Asymptotics/Asymptotics.lean
135
149
theorem isBigO_iff'' {g : α → E'''} : f =O[l] g ↔ ∃ c > 0, ∀ᶠ x in l, c * ‖f x‖ ≤ ‖g x‖ := by
refine ⟨fun h => ?mp, fun h => ?mpr⟩ case mp => rw [isBigO_iff'] at h obtain ⟨c, ⟨hc_pos, hc⟩⟩ := h refine ⟨c⁻¹, ⟨by positivity, ?_⟩⟩ filter_upwards [hc] with x hx rwa [inv_mul_le_iff (by positivity)] case mpr => rw [isBigO_iff'] obtain ⟨c, ⟨hc_pos, hc⟩⟩ := h refine ⟨c⁻¹, ⟨by positivity, ?_⟩⟩ filter_upwards [hc] with x hx rwa [← inv_inv c, inv_mul_le_iff (by positivity)] at hx
false
import Mathlib.RingTheory.IntegrallyClosed import Mathlib.RingTheory.Trace import Mathlib.RingTheory.Norm #align_import ring_theory.discriminant from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z open scoped Matrix open Matrix FiniteDimensional Fintype Polynomial Finset IntermediateField namespace Algebra variable (A : Type u) {B : Type v} (C : Type z) {ι : Type w} [DecidableEq ι] variable [CommRing A] [CommRing B] [Algebra A B] [CommRing C] [Algebra A C] section Discr -- Porting note: using `[DecidableEq ι]` instead of `by classical...` did not work in -- mathlib3. noncomputable def discr (A : Type u) {B : Type v} [CommRing A] [CommRing B] [Algebra A B] [Fintype ι] (b : ι → B) := (traceMatrix A b).det #align algebra.discr Algebra.discr theorem discr_def [Fintype ι] (b : ι → B) : discr A b = (traceMatrix A b).det := rfl variable {A C} in theorem discr_eq_discr_of_algEquiv [Fintype ι] (b : ι → B) (f : B ≃ₐ[A] C) : Algebra.discr A b = Algebra.discr A (f ∘ b) := by rw [discr_def]; congr; ext simp_rw [traceMatrix_apply, traceForm_apply, Function.comp, ← map_mul f, trace_eq_of_algEquiv] #align algebra.discr_def Algebra.discr_def variable {ι' : Type*} [Fintype ι'] [Fintype ι] [DecidableEq ι'] section Basic @[simp] theorem discr_reindex (b : Basis ι A B) (f : ι ≃ ι') : discr A (b ∘ ⇑f.symm) = discr A b := by classical rw [← Basis.coe_reindex, discr_def, traceMatrix_reindex, det_reindex_self, ← discr_def] #align algebra.discr_reindex Algebra.discr_reindex theorem discr_zero_of_not_linearIndependent [IsDomain A] {b : ι → B} (hli : ¬LinearIndependent A b) : discr A b = 0 := by classical obtain ⟨g, hg, i, hi⟩ := Fintype.not_linearIndependent_iff.1 hli have : (traceMatrix A b) *ᵥ g = 0 := by ext i have : ∀ j, (trace A B) (b i * b j) * g j = (trace A B) (g j • b j * b i) := by intro j; simp [mul_comm] simp only [mulVec, dotProduct, traceMatrix_apply, Pi.zero_apply, traceForm_apply, fun j => this j, ← map_sum, ← sum_mul, hg, zero_mul, LinearMap.map_zero] by_contra h rw [discr_def] at h simp [Matrix.eq_zero_of_mulVec_eq_zero h this] at hi #align algebra.discr_zero_of_not_linear_independent Algebra.discr_zero_of_not_linearIndependent variable {A}
Mathlib/RingTheory/Discriminant.lean
113
116
theorem discr_of_matrix_vecMul (b : ι → B) (P : Matrix ι ι A) : discr A (b ᵥ* P.map (algebraMap A B)) = P.det ^ 2 * discr A b := by
rw [discr_def, traceMatrix_of_matrix_vecMul, det_mul, det_mul, det_transpose, mul_comm, ← mul_assoc, discr_def, pow_two]
false
import Batteries.Data.List.Count import Batteries.Data.Fin.Lemmas open Nat Function namespace List theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' := (pairwise_cons.1 p).1 _ theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l := (pairwise_cons.1 p).2 theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail | [], h => h | _ :: _, h => h.of_cons theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n) | _, 0, h => h | [], _ + 1, _ => List.Pairwise.nil | _ :: _, n + 1, h => Pairwise.drop (n := n) (pairwise_cons.mp h).right theorem Pairwise.imp_of_mem {S : α → α → Prop} (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l := by induction p with | nil => constructor | @cons a l r _ ih => constructor · exact fun x h => H (mem_cons_self ..) (mem_cons_of_mem _ h) <| r x h · exact ih fun m m' => H (mem_cons_of_mem _ m) (mem_cons_of_mem _ m') theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) : l.Pairwise fun a b => R a b ∧ S a b := by induction hR with | nil => simp only [Pairwise.nil] | cons R1 _ IH => simp only [Pairwise.nil, pairwise_cons] at hS ⊢ exact ⟨fun b bl => ⟨R1 b bl, hS.1 b bl⟩, IH hS.2⟩ theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l := ⟨fun h => ⟨h.imp fun h => h.1, h.imp fun h => h.2⟩, fun ⟨hR, hS⟩ => hR.and hS⟩ theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b) (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T := (hR.and hS).imp fun ⟨h₁, h₂⟩ => H _ _ h₁ h₂ theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α} (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l := ⟨Pairwise.imp_of_mem fun m m' => (H m m').1, Pairwise.imp_of_mem fun m m' => (H m m').2⟩ theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} : Pairwise R l ↔ Pairwise S l := Pairwise.iff_of_mem fun _ _ => H .. theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l := by induction l <;> simp [*] theorem Pairwise.and_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.imp_mem {l : List α} : Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l := Pairwise.iff_of_mem <| by simp (config := { contextual := true }) theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l) (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y := by induction l with | nil => exact forall_mem_nil _ | cons a l ih => rw [pairwise_cons] at h₂ h₃ simp only [mem_cons] rintro x (rfl | hx) y (rfl | hy) · exact h₁ _ (l.mem_cons_self _) · exact h₂.1 _ hy · exact h₃.1 _ hx · exact ih (fun x hx => h₁ _ <| mem_cons_of_mem _ hx) h₂.2 h₃.2 hx hy theorem pairwise_singleton (R) (a : α) : Pairwise R [a] := by simp theorem pairwise_pair {a b : α} : Pairwise R [a, b] ↔ R a b := by simp
.lake/packages/batteries/Batteries/Data/List/Pairwise.lean
108
112
theorem pairwise_append_comm {R : α → α → Prop} (s : ∀ {x y}, R x y → R y x) {l₁ l₂ : List α} : Pairwise R (l₁ ++ l₂) ↔ Pairwise R (l₂ ++ l₁) := by
have (l₁ l₂ : List α) (H : ∀ x : α, x ∈ l₁ → ∀ y : α, y ∈ l₂ → R x y) (x : α) (xm : x ∈ l₂) (y : α) (ym : y ∈ l₁) : R x y := s (H y ym x xm) simp only [pairwise_append, and_left_comm]; rw [Iff.intro (this l₁ l₂) (this l₂ l₁)]
false
import Mathlib.Topology.UniformSpace.CompleteSeparated import Mathlib.Topology.EMetricSpace.Lipschitz import Mathlib.Topology.MetricSpace.Basic import Mathlib.Topology.MetricSpace.Bounded #align_import topology.metric_space.antilipschitz from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328" variable {α β γ : Type*} open scoped NNReal ENNReal Uniformity Topology open Set Filter Bornology def AntilipschitzWith [PseudoEMetricSpace α] [PseudoEMetricSpace β] (K : ℝ≥0) (f : α → β) := ∀ x y, edist x y ≤ K * edist (f x) (f y) #align antilipschitz_with AntilipschitzWith theorem AntilipschitzWith.edist_lt_top [PseudoEMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0} {f : α → β} (h : AntilipschitzWith K f) (x y : α) : edist x y < ⊤ := (h x y).trans_lt <| ENNReal.mul_lt_top ENNReal.coe_ne_top (edist_ne_top _ _) #align antilipschitz_with.edist_lt_top AntilipschitzWith.edist_lt_top theorem AntilipschitzWith.edist_ne_top [PseudoEMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0} {f : α → β} (h : AntilipschitzWith K f) (x y : α) : edist x y ≠ ⊤ := (h.edist_lt_top x y).ne #align antilipschitz_with.edist_ne_top AntilipschitzWith.edist_ne_top section Metric variable [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0} {f : α → β} theorem antilipschitzWith_iff_le_mul_nndist : AntilipschitzWith K f ↔ ∀ x y, nndist x y ≤ K * nndist (f x) (f y) := by simp only [AntilipschitzWith, edist_nndist] norm_cast #align antilipschitz_with_iff_le_mul_nndist antilipschitzWith_iff_le_mul_nndist alias ⟨AntilipschitzWith.le_mul_nndist, AntilipschitzWith.of_le_mul_nndist⟩ := antilipschitzWith_iff_le_mul_nndist #align antilipschitz_with.le_mul_nndist AntilipschitzWith.le_mul_nndist #align antilipschitz_with.of_le_mul_nndist AntilipschitzWith.of_le_mul_nndist theorem antilipschitzWith_iff_le_mul_dist : AntilipschitzWith K f ↔ ∀ x y, dist x y ≤ K * dist (f x) (f y) := by simp only [antilipschitzWith_iff_le_mul_nndist, dist_nndist] norm_cast #align antilipschitz_with_iff_le_mul_dist antilipschitzWith_iff_le_mul_dist alias ⟨AntilipschitzWith.le_mul_dist, AntilipschitzWith.of_le_mul_dist⟩ := antilipschitzWith_iff_le_mul_dist #align antilipschitz_with.le_mul_dist AntilipschitzWith.le_mul_dist #align antilipschitz_with.of_le_mul_dist AntilipschitzWith.of_le_mul_dist namespace AntilipschitzWith
Mathlib/Topology/MetricSpace/Antilipschitz.lean
77
79
theorem mul_le_nndist (hf : AntilipschitzWith K f) (x y : α) : K⁻¹ * nndist x y ≤ nndist (f x) (f y) := by
simpa only [div_eq_inv_mul] using NNReal.div_le_of_le_mul' (hf.le_mul_nndist x y)
false
import Mathlib.RepresentationTheory.Action.Limits import Mathlib.RepresentationTheory.Action.Concrete import Mathlib.CategoryTheory.Monoidal.FunctorCategory import Mathlib.CategoryTheory.Monoidal.Transport import Mathlib.CategoryTheory.Monoidal.Rigid.OfEquivalence import Mathlib.CategoryTheory.Monoidal.Rigid.FunctorCategory import Mathlib.CategoryTheory.Monoidal.Linear import Mathlib.CategoryTheory.Monoidal.Braided.Basic import Mathlib.CategoryTheory.Monoidal.Types.Basic universe u v open CategoryTheory Limits variable {V : Type (u + 1)} [LargeCategory V] {G : MonCat.{u}} namespace Action section Monoidal open MonoidalCategory variable [MonoidalCategory V] instance instMonoidalCategory : MonoidalCategory (Action V G) := Monoidal.transport (Action.functorCategoryEquivalence _ _).symm @[simp] theorem tensorUnit_v : (𝟙_ (Action V G)).V = 𝟙_ V := rfl set_option linter.uppercaseLean3 false in #align Action.tensor_unit_V Action.tensorUnit_v -- Porting note: removed @[simp] as the simpNF linter complains theorem tensorUnit_rho {g : G} : (𝟙_ (Action V G)).ρ g = 𝟙 (𝟙_ V) := rfl set_option linter.uppercaseLean3 false in #align Action.tensor_unit_rho Action.tensorUnit_rho @[simp] theorem tensor_v {X Y : Action V G} : (X ⊗ Y).V = X.V ⊗ Y.V := rfl set_option linter.uppercaseLean3 false in #align Action.tensor_V Action.tensor_v -- Porting note: removed @[simp] as the simpNF linter complains theorem tensor_rho {X Y : Action V G} {g : G} : (X ⊗ Y).ρ g = X.ρ g ⊗ Y.ρ g := rfl set_option linter.uppercaseLean3 false in #align Action.tensor_rho Action.tensor_rho @[simp] theorem tensor_hom {W X Y Z : Action V G} (f : W ⟶ X) (g : Y ⟶ Z) : (f ⊗ g).hom = f.hom ⊗ g.hom := rfl set_option linter.uppercaseLean3 false in #align Action.tensor_hom Action.tensor_hom @[simp] theorem whiskerLeft_hom (X : Action V G) {Y Z : Action V G} (f : Y ⟶ Z) : (X ◁ f).hom = X.V ◁ f.hom := rfl @[simp] theorem whiskerRight_hom {X Y : Action V G} (f : X ⟶ Y) (Z : Action V G) : (f ▷ Z).hom = f.hom ▷ Z.V := rfl -- Porting note: removed @[simp] as the simpNF linter complains theorem associator_hom_hom {X Y Z : Action V G} : Hom.hom (α_ X Y Z).hom = (α_ X.V Y.V Z.V).hom := by dsimp simp set_option linter.uppercaseLean3 false in #align Action.associator_hom_hom Action.associator_hom_hom -- Porting note: removed @[simp] as the simpNF linter complains theorem associator_inv_hom {X Y Z : Action V G} : Hom.hom (α_ X Y Z).inv = (α_ X.V Y.V Z.V).inv := by dsimp simp set_option linter.uppercaseLean3 false in #align Action.associator_inv_hom Action.associator_inv_hom -- Porting note: removed @[simp] as the simpNF linter complains
Mathlib/RepresentationTheory/Action/Monoidal.lean
98
100
theorem leftUnitor_hom_hom {X : Action V G} : Hom.hom (λ_ X).hom = (λ_ X.V).hom := by
dsimp simp
false
import Mathlib.Data.Fintype.Basic import Mathlib.ModelTheory.Substructures #align_import model_theory.elementary_maps from "leanprover-community/mathlib"@"d11893b411025250c8e61ff2f12ccbd7ee35ab15" open FirstOrder namespace FirstOrder namespace Language open Structure variable (L : Language) (M : Type*) (N : Type*) {P : Type*} {Q : Type*} variable [L.Structure M] [L.Structure N] [L.Structure P] [L.Structure Q] structure ElementaryEmbedding where toFun : M → N -- Porting note: -- The autoparam here used to be `obviously`. We would like to replace it with `aesop` -- but that isn't currently sufficient. -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases -- If that can be improved, we should change this to `by aesop` and remove the proofs below. map_formula' : ∀ ⦃n⦄ (φ : L.Formula (Fin n)) (x : Fin n → M), φ.Realize (toFun ∘ x) ↔ φ.Realize x := by intros; trivial #align first_order.language.elementary_embedding FirstOrder.Language.ElementaryEmbedding #align first_order.language.elementary_embedding.to_fun FirstOrder.Language.ElementaryEmbedding.toFun #align first_order.language.elementary_embedding.map_formula' FirstOrder.Language.ElementaryEmbedding.map_formula' @[inherit_doc FirstOrder.Language.ElementaryEmbedding] scoped[FirstOrder] notation:25 A " ↪ₑ[" L "] " B => FirstOrder.Language.ElementaryEmbedding L A B variable {L} {M} {N} namespace ElementaryEmbedding attribute [coe] toFun instance instFunLike : FunLike (M ↪ₑ[L] N) M N where coe f := f.toFun coe_injective' f g h := by cases f cases g simp only [ElementaryEmbedding.mk.injEq] ext x exact Function.funext_iff.1 h x #align first_order.language.elementary_embedding.fun_like FirstOrder.Language.ElementaryEmbedding.instFunLike instance : CoeFun (M ↪ₑ[L] N) fun _ => M → N := DFunLike.hasCoeToFun @[simp] theorem map_boundedFormula (f : M ↪ₑ[L] N) {α : Type*} {n : ℕ} (φ : L.BoundedFormula α n) (v : α → M) (xs : Fin n → M) : φ.Realize (f ∘ v) (f ∘ xs) ↔ φ.Realize v xs := by classical rw [← BoundedFormula.realize_restrictFreeVar Set.Subset.rfl, Set.inclusion_eq_id, iff_eq_eq] have h := f.map_formula' ((φ.restrictFreeVar id).toFormula.relabel (Fintype.equivFin _)) (Sum.elim (v ∘ (↑)) xs ∘ (Fintype.equivFin _).symm) simp only [Formula.realize_relabel, BoundedFormula.realize_toFormula, iff_eq_eq] at h rw [← Function.comp.assoc _ _ (Fintype.equivFin _).symm, Function.comp.assoc _ (Fintype.equivFin _).symm (Fintype.equivFin _), _root_.Equiv.symm_comp_self, Function.comp_id, Function.comp.assoc, Sum.elim_comp_inl, Function.comp.assoc _ _ Sum.inr, Sum.elim_comp_inr, ← Function.comp.assoc] at h refine h.trans ?_ erw [Function.comp.assoc _ _ (Fintype.equivFin _), _root_.Equiv.symm_comp_self, Function.comp_id, Sum.elim_comp_inl, Sum.elim_comp_inr (v ∘ Subtype.val) xs, ← Set.inclusion_eq_id (s := (BoundedFormula.freeVarFinset φ : Set α)) Set.Subset.rfl, BoundedFormula.realize_restrictFreeVar Set.Subset.rfl] #align first_order.language.elementary_embedding.map_bounded_formula FirstOrder.Language.ElementaryEmbedding.map_boundedFormula @[simp]
Mathlib/ModelTheory/ElementaryMaps.lean
98
100
theorem map_formula (f : M ↪ₑ[L] N) {α : Type*} (φ : L.Formula α) (x : α → M) : φ.Realize (f ∘ x) ↔ φ.Realize x := by
rw [Formula.Realize, Formula.Realize, ← f.map_boundedFormula, Unique.eq_default (f ∘ default)]
false
import Mathlib.Order.Cover import Mathlib.Order.Interval.Finset.Defs #align_import data.finset.locally_finite from "leanprover-community/mathlib"@"442a83d738cb208d3600056c489be16900ba701d" assert_not_exists MonoidWithZero assert_not_exists Finset.sum open Function OrderDual open FinsetInterval variable {ι α : Type*} namespace Finset section Preorder variable [Preorder α] section LocallyFiniteOrder variable [LocallyFiniteOrder α] {a a₁ a₂ b b₁ b₂ c x : α} @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem nonempty_Icc : (Icc a b).Nonempty ↔ a ≤ b := by rw [← coe_nonempty, coe_Icc, Set.nonempty_Icc] #align finset.nonempty_Icc Finset.nonempty_Icc @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem nonempty_Ico : (Ico a b).Nonempty ↔ a < b := by rw [← coe_nonempty, coe_Ico, Set.nonempty_Ico] #align finset.nonempty_Ico Finset.nonempty_Ico @[simp, aesop safe apply (rule_sets := [finsetNonempty])] theorem nonempty_Ioc : (Ioc a b).Nonempty ↔ a < b := by rw [← coe_nonempty, coe_Ioc, Set.nonempty_Ioc] #align finset.nonempty_Ioc Finset.nonempty_Ioc -- TODO: This is nonsense. A locally finite order is never densely ordered @[simp] theorem nonempty_Ioo [DenselyOrdered α] : (Ioo a b).Nonempty ↔ a < b := by rw [← coe_nonempty, coe_Ioo, Set.nonempty_Ioo] #align finset.nonempty_Ioo Finset.nonempty_Ioo @[simp] theorem Icc_eq_empty_iff : Icc a b = ∅ ↔ ¬a ≤ b := by rw [← coe_eq_empty, coe_Icc, Set.Icc_eq_empty_iff] #align finset.Icc_eq_empty_iff Finset.Icc_eq_empty_iff @[simp] theorem Ico_eq_empty_iff : Ico a b = ∅ ↔ ¬a < b := by rw [← coe_eq_empty, coe_Ico, Set.Ico_eq_empty_iff] #align finset.Ico_eq_empty_iff Finset.Ico_eq_empty_iff @[simp] theorem Ioc_eq_empty_iff : Ioc a b = ∅ ↔ ¬a < b := by rw [← coe_eq_empty, coe_Ioc, Set.Ioc_eq_empty_iff] #align finset.Ioc_eq_empty_iff Finset.Ioc_eq_empty_iff -- TODO: This is nonsense. A locally finite order is never densely ordered @[simp] theorem Ioo_eq_empty_iff [DenselyOrdered α] : Ioo a b = ∅ ↔ ¬a < b := by rw [← coe_eq_empty, coe_Ioo, Set.Ioo_eq_empty_iff] #align finset.Ioo_eq_empty_iff Finset.Ioo_eq_empty_iff alias ⟨_, Icc_eq_empty⟩ := Icc_eq_empty_iff #align finset.Icc_eq_empty Finset.Icc_eq_empty alias ⟨_, Ico_eq_empty⟩ := Ico_eq_empty_iff #align finset.Ico_eq_empty Finset.Ico_eq_empty alias ⟨_, Ioc_eq_empty⟩ := Ioc_eq_empty_iff #align finset.Ioc_eq_empty Finset.Ioc_eq_empty @[simp] theorem Ioo_eq_empty (h : ¬a < b) : Ioo a b = ∅ := eq_empty_iff_forall_not_mem.2 fun _ hx => h ((mem_Ioo.1 hx).1.trans (mem_Ioo.1 hx).2) #align finset.Ioo_eq_empty Finset.Ioo_eq_empty @[simp] theorem Icc_eq_empty_of_lt (h : b < a) : Icc a b = ∅ := Icc_eq_empty h.not_le #align finset.Icc_eq_empty_of_lt Finset.Icc_eq_empty_of_lt @[simp] theorem Ico_eq_empty_of_le (h : b ≤ a) : Ico a b = ∅ := Ico_eq_empty h.not_lt #align finset.Ico_eq_empty_of_le Finset.Ico_eq_empty_of_le @[simp] theorem Ioc_eq_empty_of_le (h : b ≤ a) : Ioc a b = ∅ := Ioc_eq_empty h.not_lt #align finset.Ioc_eq_empty_of_le Finset.Ioc_eq_empty_of_le @[simp] theorem Ioo_eq_empty_of_le (h : b ≤ a) : Ioo a b = ∅ := Ioo_eq_empty h.not_lt #align finset.Ioo_eq_empty_of_le Finset.Ioo_eq_empty_of_le -- porting note (#10618): simp can prove this -- @[simp] theorem left_mem_Icc : a ∈ Icc a b ↔ a ≤ b := by simp only [mem_Icc, true_and_iff, le_rfl] #align finset.left_mem_Icc Finset.left_mem_Icc -- porting note (#10618): simp can prove this -- @[simp] theorem left_mem_Ico : a ∈ Ico a b ↔ a < b := by simp only [mem_Ico, true_and_iff, le_refl] #align finset.left_mem_Ico Finset.left_mem_Ico -- porting note (#10618): simp can prove this -- @[simp] theorem right_mem_Icc : b ∈ Icc a b ↔ a ≤ b := by simp only [mem_Icc, and_true_iff, le_rfl] #align finset.right_mem_Icc Finset.right_mem_Icc -- porting note (#10618): simp can prove this -- @[simp]
Mathlib/Order/Interval/Finset/Basic.lean
149
149
theorem right_mem_Ioc : b ∈ Ioc a b ↔ a < b := by
simp only [mem_Ioc, and_true_iff, le_rfl]
false
import Mathlib.Algebra.Order.Monoid.Defs import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Util.AssertExists #align_import algebra.order.group.defs from "leanprover-community/mathlib"@"b599f4e4e5cf1fbcb4194503671d3d9e569c1fce" open Function universe u variable {α : Type u} class OrderedAddCommGroup (α : Type u) extends AddCommGroup α, PartialOrder α where protected add_le_add_left : ∀ a b : α, a ≤ b → ∀ c : α, c + a ≤ c + b #align ordered_add_comm_group OrderedAddCommGroup class OrderedCommGroup (α : Type u) extends CommGroup α, PartialOrder α where protected mul_le_mul_left : ∀ a b : α, a ≤ b → ∀ c : α, c * a ≤ c * b #align ordered_comm_group OrderedCommGroup attribute [to_additive] OrderedCommGroup @[to_additive] instance OrderedCommGroup.to_covariantClass_left_le (α : Type u) [OrderedCommGroup α] : CovariantClass α α (· * ·) (· ≤ ·) where elim a b c bc := OrderedCommGroup.mul_le_mul_left b c bc a #align ordered_comm_group.to_covariant_class_left_le OrderedCommGroup.to_covariantClass_left_le #align ordered_add_comm_group.to_covariant_class_left_le OrderedAddCommGroup.to_covariantClass_left_le -- See note [lower instance priority] @[to_additive OrderedAddCommGroup.toOrderedCancelAddCommMonoid] instance (priority := 100) OrderedCommGroup.toOrderedCancelCommMonoid [OrderedCommGroup α] : OrderedCancelCommMonoid α := { ‹OrderedCommGroup α› with le_of_mul_le_mul_left := fun a b c ↦ le_of_mul_le_mul_left' } #align ordered_comm_group.to_ordered_cancel_comm_monoid OrderedCommGroup.toOrderedCancelCommMonoid #align ordered_add_comm_group.to_ordered_cancel_add_comm_monoid OrderedAddCommGroup.toOrderedCancelAddCommMonoid example (α : Type u) [OrderedAddCommGroup α] : CovariantClass α α (swap (· + ·)) (· < ·) := IsRightCancelAdd.covariant_swap_add_lt_of_covariant_swap_add_le α -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- It was introduced in https://github.com/leanprover-community/mathlib/pull/17564 -- but without the motivation clearly explained. @[to_additive "A choice-free shortcut instance."] theorem OrderedCommGroup.to_contravariantClass_left_le (α : Type u) [OrderedCommGroup α] : ContravariantClass α α (· * ·) (· ≤ ·) where elim a b c bc := by simpa using mul_le_mul_left' bc a⁻¹ #align ordered_comm_group.to_contravariant_class_left_le OrderedCommGroup.to_contravariantClass_left_le #align ordered_add_comm_group.to_contravariant_class_left_le OrderedAddCommGroup.to_contravariantClass_left_le -- Porting note: this instance is not used, -- and causes timeouts after lean4#2210. -- See further explanation on `OrderedCommGroup.to_contravariantClass_left_le`. @[to_additive "A choice-free shortcut instance."] theorem OrderedCommGroup.to_contravariantClass_right_le (α : Type u) [OrderedCommGroup α] : ContravariantClass α α (swap (· * ·)) (· ≤ ·) where elim a b c bc := by simpa using mul_le_mul_right' bc a⁻¹ #align ordered_comm_group.to_contravariant_class_right_le OrderedCommGroup.to_contravariantClass_right_le #align ordered_add_comm_group.to_contravariant_class_right_le OrderedAddCommGroup.to_contravariantClass_right_le section Group variable [Group α] section TypeclassesLeftLT variable [LT α] [CovariantClass α α (· * ·) (· < ·)] {a b c : α} @[to_additive (attr := simp) Left.neg_pos_iff "Uses `left` co(ntra)variant."] theorem Left.one_lt_inv_iff : 1 < a⁻¹ ↔ a < 1 := by rw [← mul_lt_mul_iff_left a, mul_inv_self, mul_one] #align left.one_lt_inv_iff Left.one_lt_inv_iff #align left.neg_pos_iff Left.neg_pos_iff @[to_additive (attr := simp) "Uses `left` co(ntra)variant."]
Mathlib/Algebra/Order/Group/Defs.lean
165
166
theorem Left.inv_lt_one_iff : a⁻¹ < 1 ↔ 1 < a := by
rw [← mul_lt_mul_iff_left a, mul_inv_self, mul_one]
false
import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.RingTheory.Coprime.Basic import Mathlib.Tactic.AdaptationNote #align_import ring_theory.polynomial.scale_roots from "leanprover-community/mathlib"@"40ac1b258344e0c2b4568dc37bfad937ec35a727" variable {R S A K : Type*} namespace Polynomial open Polynomial section Semiring variable [Semiring R] [Semiring S] noncomputable def scaleRoots (p : R[X]) (s : R) : R[X] := ∑ i ∈ p.support, monomial i (p.coeff i * s ^ (p.natDegree - i)) #align polynomial.scale_roots Polynomial.scaleRoots @[simp] theorem coeff_scaleRoots (p : R[X]) (s : R) (i : ℕ) : (scaleRoots p s).coeff i = coeff p i * s ^ (p.natDegree - i) := by simp (config := { contextual := true }) [scaleRoots, coeff_monomial] #align polynomial.coeff_scale_roots Polynomial.coeff_scaleRoots theorem coeff_scaleRoots_natDegree (p : R[X]) (s : R) : (scaleRoots p s).coeff p.natDegree = p.leadingCoeff := by rw [leadingCoeff, coeff_scaleRoots, tsub_self, pow_zero, mul_one] #align polynomial.coeff_scale_roots_nat_degree Polynomial.coeff_scaleRoots_natDegree @[simp] theorem zero_scaleRoots (s : R) : scaleRoots 0 s = 0 := by ext simp #align polynomial.zero_scale_roots Polynomial.zero_scaleRoots theorem scaleRoots_ne_zero {p : R[X]} (hp : p ≠ 0) (s : R) : scaleRoots p s ≠ 0 := by intro h have : p.coeff p.natDegree ≠ 0 := mt leadingCoeff_eq_zero.mp hp have : (scaleRoots p s).coeff p.natDegree = 0 := congr_fun (congr_arg (coeff : R[X] → ℕ → R) h) p.natDegree rw [coeff_scaleRoots_natDegree] at this contradiction #align polynomial.scale_roots_ne_zero Polynomial.scaleRoots_ne_zero theorem support_scaleRoots_le (p : R[X]) (s : R) : (scaleRoots p s).support ≤ p.support := by intro simpa using left_ne_zero_of_mul #align polynomial.support_scale_roots_le Polynomial.support_scaleRoots_le theorem support_scaleRoots_eq (p : R[X]) {s : R} (hs : s ∈ nonZeroDivisors R) : (scaleRoots p s).support = p.support := le_antisymm (support_scaleRoots_le p s) (by intro i simp only [coeff_scaleRoots, Polynomial.mem_support_iff] intro p_ne_zero ps_zero have := pow_mem hs (p.natDegree - i) _ ps_zero contradiction) #align polynomial.support_scale_roots_eq Polynomial.support_scaleRoots_eq @[simp] theorem degree_scaleRoots (p : R[X]) {s : R} : degree (scaleRoots p s) = degree p := by haveI := Classical.propDecidable by_cases hp : p = 0 · rw [hp, zero_scaleRoots] refine le_antisymm (Finset.sup_mono (support_scaleRoots_le p s)) (degree_le_degree ?_) rw [coeff_scaleRoots_natDegree] intro h have := leadingCoeff_eq_zero.mp h contradiction #align polynomial.degree_scale_roots Polynomial.degree_scaleRoots @[simp] theorem natDegree_scaleRoots (p : R[X]) (s : R) : natDegree (scaleRoots p s) = natDegree p := by simp only [natDegree, degree_scaleRoots] #align polynomial.nat_degree_scale_roots Polynomial.natDegree_scaleRoots theorem monic_scaleRoots_iff {p : R[X]} (s : R) : Monic (scaleRoots p s) ↔ Monic p := by simp only [Monic, leadingCoeff, natDegree_scaleRoots, coeff_scaleRoots_natDegree] #align polynomial.monic_scale_roots_iff Polynomial.monic_scaleRoots_iff
Mathlib/RingTheory/Polynomial/ScaleRoots.lean
98
101
theorem map_scaleRoots (p : R[X]) (x : R) (f : R →+* S) (h : f p.leadingCoeff ≠ 0) : (p.scaleRoots x).map f = (p.map f).scaleRoots (f x) := by
ext simp [Polynomial.natDegree_map_of_leadingCoeff_ne_zero _ h]
false
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 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] #align basis.to_dual_apply Basis.toDual_apply @[simp] theorem toDual_total_left (f : ι →₀ R) (i : ι) : b.toDual (Finsupp.total ι M R b f) (b i) = f i := by rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum, LinearMap.sum_apply] simp_rw [LinearMap.map_smul, LinearMap.smul_apply, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq'] split_ifs with h · rfl · rw [Finsupp.not_mem_support_iff.mp h] #align basis.to_dual_total_left Basis.toDual_total_left @[simp]
Mathlib/LinearAlgebra/Dual.lean
320
326
theorem toDual_total_right (f : ι →₀ R) (i : ι) : b.toDual (b i) (Finsupp.total ι M R b f) = f i := by
rw [Finsupp.total_apply, Finsupp.sum, _root_.map_sum] simp_rw [LinearMap.map_smul, toDual_apply, smul_eq_mul, mul_boole, Finset.sum_ite_eq] split_ifs with h · rfl · rw [Finsupp.not_mem_support_iff.mp h]
false
import Mathlib.CategoryTheory.Sites.Plus import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory #align_import category_theory.sites.sheafification from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace CategoryTheory open CategoryTheory.Limits Opposite universe w v u variable {C : Type u} [Category.{v} C] {J : GrothendieckTopology C} variable {D : Type w} [Category.{max v u} D] section variable [ConcreteCategory.{max v u} D] attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike -- porting note (#5171): removed @[nolint has_nonempty_instance] def Meq {X : C} (P : Cᵒᵖ ⥤ D) (S : J.Cover X) := { x : ∀ I : S.Arrow, P.obj (op I.Y) // ∀ I : S.Relation, P.map I.g₁.op (x I.fst) = P.map I.g₂.op (x I.snd) } #align category_theory.meq CategoryTheory.Meq end namespace GrothendieckTopology variable (J) variable [∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : J.Cover X), HasMultiequalizer (S.index P)] [∀ X : C, HasColimitsOfShape (J.Cover X)ᵒᵖ D] noncomputable def sheafify (P : Cᵒᵖ ⥤ D) : Cᵒᵖ ⥤ D := J.plusObj (J.plusObj P) #align category_theory.grothendieck_topology.sheafify CategoryTheory.GrothendieckTopology.sheafify noncomputable def toSheafify (P : Cᵒᵖ ⥤ D) : P ⟶ J.sheafify P := J.toPlus P ≫ J.plusMap (J.toPlus P) #align category_theory.grothendieck_topology.to_sheafify CategoryTheory.GrothendieckTopology.toSheafify noncomputable def sheafifyMap {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) : J.sheafify P ⟶ J.sheafify Q := J.plusMap <| J.plusMap η #align category_theory.grothendieck_topology.sheafify_map CategoryTheory.GrothendieckTopology.sheafifyMap @[simp] theorem sheafifyMap_id (P : Cᵒᵖ ⥤ D) : J.sheafifyMap (𝟙 P) = 𝟙 (J.sheafify P) := by dsimp [sheafifyMap, sheafify] simp #align category_theory.grothendieck_topology.sheafify_map_id CategoryTheory.GrothendieckTopology.sheafifyMap_id @[simp]
Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean
483
486
theorem sheafifyMap_comp {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) : J.sheafifyMap (η ≫ γ) = J.sheafifyMap η ≫ J.sheafifyMap γ := by
dsimp [sheafifyMap, sheafify] simp
false
import Mathlib.RingTheory.WittVector.Frobenius import Mathlib.RingTheory.WittVector.Verschiebung import Mathlib.RingTheory.WittVector.MulP #align_import ring_theory.witt_vector.identities from "leanprover-community/mathlib"@"0798037604b2d91748f9b43925fb7570a5f3256c" namespace WittVector variable {p : ℕ} {R : Type*} [hp : Fact p.Prime] [CommRing R] -- type as `\bbW` local notation "𝕎" => WittVector p noncomputable section -- Porting note: `ghost_calc` failure: `simp only []` and the manual instances had to be added. theorem frobenius_verschiebung (x : 𝕎 R) : frobenius (verschiebung x) = x * p := by have : IsPoly p fun {R} [CommRing R] x ↦ frobenius (verschiebung x) := IsPoly.comp (hg := frobenius_isPoly p) (hf := verschiebung_isPoly) have : IsPoly p fun {R} [CommRing R] x ↦ x * p := mulN_isPoly p p ghost_calc x ghost_simp [mul_comm] #align witt_vector.frobenius_verschiebung WittVector.frobenius_verschiebung theorem verschiebung_zmod (x : 𝕎 (ZMod p)) : verschiebung x = x * p := by rw [← frobenius_verschiebung, frobenius_zmodp] #align witt_vector.verschiebung_zmod WittVector.verschiebung_zmod variable (p R)
Mathlib/RingTheory/WittVector/Identities.lean
57
61
theorem coeff_p_pow [CharP R p] (i : ℕ) : ((p : 𝕎 R) ^ i).coeff i = 1 := by
induction' i with i h · simp only [Nat.zero_eq, one_coeff_zero, Ne, pow_zero] · rw [pow_succ, ← frobenius_verschiebung, coeff_frobenius_charP, verschiebung_coeff_succ, h, one_pow]
false
import Mathlib.RingTheory.Localization.FractionRing import Mathlib.Algebra.Polynomial.RingDivision #align_import field_theory.ratfunc from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6" noncomputable section open scoped Classical open scoped nonZeroDivisors Polynomial universe u v variable (K : Type u) structure RatFunc [CommRing K] : Type u where ofFractionRing :: toFractionRing : FractionRing K[X] #align ratfunc RatFunc #align ratfunc.of_fraction_ring RatFunc.ofFractionRing #align ratfunc.to_fraction_ring RatFunc.toFractionRing namespace RatFunc section CommRing variable {K} variable [CommRing K] section Rec theorem ofFractionRing_injective : Function.Injective (ofFractionRing : _ → RatFunc K) := fun _ _ => ofFractionRing.inj #align ratfunc.of_fraction_ring_injective RatFunc.ofFractionRing_injective theorem toFractionRing_injective : Function.Injective (toFractionRing : _ → FractionRing K[X]) -- Porting note: the `xy` input was `rfl` and then there was no need for the `subst` | ⟨x⟩, ⟨y⟩, xy => by subst xy; rfl #align ratfunc.to_fraction_ring_injective RatFunc.toFractionRing_injective protected irreducible_def liftOn {P : Sort v} (x : RatFunc K) (f : K[X] → K[X] → P) (H : ∀ {p q p' q'} (_hq : q ∈ K[X]⁰) (_hq' : q' ∈ K[X]⁰), q' * p = q * p' → f p q = f p' q') : P := by refine Localization.liftOn (toFractionRing x) (fun p q => f p q) ?_ intros p p' q q' h exact H q.2 q'.2 (let ⟨⟨c, hc⟩, mul_eq⟩ := Localization.r_iff_exists.mp h mul_cancel_left_coe_nonZeroDivisors.mp mul_eq) -- Porting note: the definition above was as follows -- (-- Fix timeout by manipulating elaboration order -- fun p q => f p q) -- fun p p' q q' h => by -- exact H q.2 q'.2 -- (let ⟨⟨c, hc⟩, mul_eq⟩ := Localization.r_iff_exists.mp h -- mul_cancel_left_coe_nonZeroDivisors.mp mul_eq) #align ratfunc.lift_on RatFunc.liftOn theorem liftOn_ofFractionRing_mk {P : Sort v} (n : K[X]) (d : K[X]⁰) (f : K[X] → K[X] → P) (H : ∀ {p q p' q'} (_hq : q ∈ K[X]⁰) (_hq' : q' ∈ K[X]⁰), q' * p = q * p' → f p q = f p' q') : RatFunc.liftOn (ofFractionRing (Localization.mk n d)) f @H = f n d := by rw [RatFunc.liftOn] exact Localization.liftOn_mk _ _ _ _ #align ratfunc.lift_on_of_fraction_ring_mk RatFunc.liftOn_ofFractionRing_mk theorem liftOn_condition_of_liftOn'_condition {P : Sort v} {f : K[X] → K[X] → P} (H : ∀ {p q a} (hq : q ≠ 0) (_ha : a ≠ 0), f (a * p) (a * q) = f p q) ⦃p q p' q' : K[X]⦄ (hq : q ≠ 0) (hq' : q' ≠ 0) (h : q' * p = q * p') : f p q = f p' q' := calc f p q = f (q' * p) (q' * q) := (H hq hq').symm _ = f (q * p') (q * q') := by rw [h, mul_comm q'] _ = f p' q' := H hq' hq #align ratfunc.lift_on_condition_of_lift_on'_condition RatFunc.liftOn_condition_of_liftOn'_condition section IsDomain variable [IsDomain K] protected irreducible_def mk (p q : K[X]) : RatFunc K := ofFractionRing (algebraMap _ _ p / algebraMap _ _ q) #align ratfunc.mk RatFunc.mk theorem mk_eq_div' (p q : K[X]) : RatFunc.mk p q = ofFractionRing (algebraMap _ _ p / algebraMap _ _ q) := by rw [RatFunc.mk] #align ratfunc.mk_eq_div' RatFunc.mk_eq_div' theorem mk_zero (p : K[X]) : RatFunc.mk p 0 = ofFractionRing (0 : FractionRing K[X]) := by rw [mk_eq_div', RingHom.map_zero, div_zero] #align ratfunc.mk_zero RatFunc.mk_zero theorem mk_coe_def (p : K[X]) (q : K[X]⁰) : -- Porting note: filled in `(FractionRing K[X])` that was an underscore. RatFunc.mk p q = ofFractionRing (IsLocalization.mk' (FractionRing K[X]) p q) := by simp only [mk_eq_div', ← Localization.mk_eq_mk', FractionRing.mk_eq_div] #align ratfunc.mk_coe_def RatFunc.mk_coe_def theorem mk_def_of_mem (p : K[X]) {q} (hq : q ∈ K[X]⁰) : RatFunc.mk p q = ofFractionRing (IsLocalization.mk' (FractionRing K[X]) p ⟨q, hq⟩) := by -- Porting note: there was an `[anonymous]` in the simp set simp only [← mk_coe_def] #align ratfunc.mk_def_of_mem RatFunc.mk_def_of_mem theorem mk_def_of_ne (p : K[X]) {q : K[X]} (hq : q ≠ 0) : RatFunc.mk p q = ofFractionRing (IsLocalization.mk' (FractionRing K[X]) p ⟨q, mem_nonZeroDivisors_iff_ne_zero.mpr hq⟩) := mk_def_of_mem p _ #align ratfunc.mk_def_of_ne RatFunc.mk_def_of_ne
Mathlib/FieldTheory/RatFunc/Defs.lean
181
185
theorem mk_eq_localization_mk (p : K[X]) {q : K[X]} (hq : q ≠ 0) : RatFunc.mk p q = ofFractionRing (Localization.mk p ⟨q, mem_nonZeroDivisors_iff_ne_zero.mpr hq⟩) := by
-- Porting note: the original proof, did not need to pass `hq` rw [mk_def_of_ne _ hq, Localization.mk_eq_mk']
false
import Mathlib.Data.Matrix.Basic import Mathlib.Data.PEquiv #align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" namespace PEquiv open Matrix universe u v variable {k l m n : Type*} variable {α : Type v} open Matrix def toMatrix [DecidableEq n] [Zero α] [One α] (f : m ≃. n) : Matrix m n α := of fun i j => if j ∈ f i then (1 : α) else 0 #align pequiv.to_matrix PEquiv.toMatrix -- TODO: set as an equation lemma for `toMatrix`, see mathlib4#3024 @[simp] theorem toMatrix_apply [DecidableEq n] [Zero α] [One α] (f : m ≃. n) (i j) : toMatrix f i j = if j ∈ f i then (1 : α) else 0 := rfl #align pequiv.to_matrix_apply PEquiv.toMatrix_apply theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring α] (f : l ≃. m) (M : Matrix m n α) (i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j := by dsimp [toMatrix, Matrix.mul_apply] cases' h : f i with fi · simp [h] · rw [Finset.sum_eq_single fi] <;> simp (config := { contextual := true }) [h, eq_comm] #align pequiv.mul_matrix_apply PEquiv.mul_matrix_apply theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero α] [One α] (f : m ≃. n) : (f.symm.toMatrix : Matrix n m α) = f.toMatrixᵀ := by ext simp only [transpose, mem_iff_mem f, toMatrix_apply] congr #align pequiv.to_matrix_symm PEquiv.toMatrix_symm @[simp] theorem toMatrix_refl [DecidableEq n] [Zero α] [One α] : ((PEquiv.refl n).toMatrix : Matrix n n α) = 1 := by ext simp [toMatrix_apply, one_apply] #align pequiv.to_matrix_refl PEquiv.toMatrix_refl theorem matrix_mul_apply [Fintype m] [Semiring α] [DecidableEq n] (M : Matrix l m α) (f : m ≃. n) (i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj := by dsimp [toMatrix, Matrix.mul_apply] cases' h : f.symm j with fj · simp [h, ← f.eq_some_iff] · rw [Finset.sum_eq_single fj] · simp [h, ← f.eq_some_iff] · rintro b - n simp [h, ← f.eq_some_iff, n.symm] · simp #align pequiv.matrix_mul_apply PEquiv.matrix_mul_apply theorem toPEquiv_mul_matrix [Fintype m] [DecidableEq m] [Semiring α] (f : m ≃ m) (M : Matrix m n α) : f.toPEquiv.toMatrix * M = M.submatrix f id := by ext i j rw [mul_matrix_apply, Equiv.toPEquiv_apply, submatrix_apply, id] #align pequiv.to_pequiv_mul_matrix PEquiv.toPEquiv_mul_matrix theorem mul_toPEquiv_toMatrix {m n α : Type*} [Fintype n] [DecidableEq n] [Semiring α] (f : n ≃ n) (M : Matrix m n α) : M * f.toPEquiv.toMatrix = M.submatrix id f.symm := Matrix.ext fun i j => by rw [PEquiv.matrix_mul_apply, ← Equiv.toPEquiv_symm, Equiv.toPEquiv_apply, Matrix.submatrix_apply, id] #align pequiv.mul_to_pequiv_to_matrix PEquiv.mul_toPEquiv_toMatrix theorem toMatrix_trans [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring α] (f : l ≃. m) (g : m ≃. n) : ((f.trans g).toMatrix : Matrix l n α) = f.toMatrix * g.toMatrix := by ext i j rw [mul_matrix_apply] dsimp [toMatrix, PEquiv.trans] cases f i <;> simp #align pequiv.to_matrix_trans PEquiv.toMatrix_trans @[simp] theorem toMatrix_bot [DecidableEq n] [Zero α] [One α] : ((⊥ : PEquiv m n).toMatrix : Matrix m n α) = 0 := rfl #align pequiv.to_matrix_bot PEquiv.toMatrix_bot theorem toMatrix_injective [DecidableEq n] [MonoidWithZero α] [Nontrivial α] : Function.Injective (@toMatrix m n α _ _ _) := by classical intro f g refine not_imp_not.1 ?_ simp only [Matrix.ext_iff.symm, toMatrix_apply, PEquiv.ext_iff, not_forall, exists_imp] intro i hi use i cases' hf : f i with fi · cases' hg : g i with gi -- Porting note: was `cc` · rw [hf, hg] at hi exact (hi rfl).elim · use gi simp · use fi simp [hf.symm, Ne.symm hi] #align pequiv.to_matrix_injective PEquiv.toMatrix_injective theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) : (Equiv.swap i j).toPEquiv.toMatrix = (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix + (single j i).toMatrix := by ext dsimp [toMatrix, single, Equiv.swap_apply_def, Equiv.toPEquiv, one_apply] split_ifs <;> simp_all #align pequiv.to_matrix_swap PEquiv.toMatrix_swap @[simp]
Mathlib/Data/Matrix/PEquiv.lean
152
155
theorem single_mul_single [Fintype n] [DecidableEq k] [DecidableEq m] [DecidableEq n] [Semiring α] (a : m) (b : n) (c : k) : ((single a b).toMatrix : Matrix _ _ α) * (single b c).toMatrix = (single a c).toMatrix := by
rw [← toMatrix_trans, single_trans_single]
false
import Mathlib.GroupTheory.GroupAction.BigOperators import Mathlib.Logic.Equiv.Fin import Mathlib.Algebra.BigOperators.Pi import Mathlib.Algebra.Module.Prod import Mathlib.Algebra.Module.Submodule.Ker #align_import linear_algebra.pi from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe u v w x y z u' v' w' x' y' variable {R : Type u} {K : Type u'} {M : Type v} {V : Type v'} {M₂ : Type w} {V₂ : Type w'} variable {M₃ : Type y} {V₃ : Type y'} {M₄ : Type z} {ι : Type x} {ι' : Type x'} open Function Submodule namespace LinearMap universe i variable [Semiring R] [AddCommMonoid M₂] [Module R M₂] [AddCommMonoid M₃] [Module R M₃] {φ : ι → Type i} [(i : ι) → AddCommMonoid (φ i)] [(i : ι) → Module R (φ i)] def pi (f : (i : ι) → M₂ →ₗ[R] φ i) : M₂ →ₗ[R] (i : ι) → φ i := { Pi.addHom fun i => (f i).toAddHom with toFun := fun c i => f i c map_smul' := fun _ _ => funext fun i => (f i).map_smul _ _ } #align linear_map.pi LinearMap.pi @[simp] theorem pi_apply (f : (i : ι) → M₂ →ₗ[R] φ i) (c : M₂) (i : ι) : pi f c i = f i c := rfl #align linear_map.pi_apply LinearMap.pi_apply theorem ker_pi (f : (i : ι) → M₂ →ₗ[R] φ i) : ker (pi f) = ⨅ i : ι, ker (f i) := by ext c; simp [funext_iff] #align linear_map.ker_pi LinearMap.ker_pi
Mathlib/LinearAlgebra/Pi.lean
64
66
theorem pi_eq_zero (f : (i : ι) → M₂ →ₗ[R] φ i) : pi f = 0 ↔ ∀ i, f i = 0 := by
simp only [LinearMap.ext_iff, pi_apply, funext_iff]; exact ⟨fun h a b => h b a, fun h a b => h b a⟩
false
import Mathlib.Order.Interval.Set.OrdConnected import Mathlib.Data.Set.Lattice #align_import data.set.intervals.ord_connected_component from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Interval Function OrderDual namespace Set variable {α : Type*} [LinearOrder α] {s t : Set α} {x y z : α} def ordConnectedComponent (s : Set α) (x : α) : Set α := { y | [[x, y]] ⊆ s } #align set.ord_connected_component Set.ordConnectedComponent theorem mem_ordConnectedComponent : y ∈ ordConnectedComponent s x ↔ [[x, y]] ⊆ s := Iff.rfl #align set.mem_ord_connected_component Set.mem_ordConnectedComponent theorem dual_ordConnectedComponent : ordConnectedComponent (ofDual ⁻¹' s) (toDual x) = ofDual ⁻¹' ordConnectedComponent s x := ext <| (Surjective.forall toDual.surjective).2 fun x => by rw [mem_ordConnectedComponent, dual_uIcc] rfl #align set.dual_ord_connected_component Set.dual_ordConnectedComponent theorem ordConnectedComponent_subset : ordConnectedComponent s x ⊆ s := fun _ hy => hy right_mem_uIcc #align set.ord_connected_component_subset Set.ordConnectedComponent_subset theorem subset_ordConnectedComponent {t} [h : OrdConnected s] (hs : x ∈ s) (ht : s ⊆ t) : s ⊆ ordConnectedComponent t x := fun _ hy => (h.uIcc_subset hs hy).trans ht #align set.subset_ord_connected_component Set.subset_ordConnectedComponent @[simp] theorem self_mem_ordConnectedComponent : x ∈ ordConnectedComponent s x ↔ x ∈ s := by rw [mem_ordConnectedComponent, uIcc_self, singleton_subset_iff] #align set.self_mem_ord_connected_component Set.self_mem_ordConnectedComponent @[simp] theorem nonempty_ordConnectedComponent : (ordConnectedComponent s x).Nonempty ↔ x ∈ s := ⟨fun ⟨_, hy⟩ => hy <| left_mem_uIcc, fun h => ⟨x, self_mem_ordConnectedComponent.2 h⟩⟩ #align set.nonempty_ord_connected_component Set.nonempty_ordConnectedComponent @[simp] theorem ordConnectedComponent_eq_empty : ordConnectedComponent s x = ∅ ↔ x ∉ s := by rw [← not_nonempty_iff_eq_empty, nonempty_ordConnectedComponent] #align set.ord_connected_component_eq_empty Set.ordConnectedComponent_eq_empty @[simp] theorem ordConnectedComponent_empty : ordConnectedComponent ∅ x = ∅ := ordConnectedComponent_eq_empty.2 (not_mem_empty x) #align set.ord_connected_component_empty Set.ordConnectedComponent_empty @[simp] theorem ordConnectedComponent_univ : ordConnectedComponent univ x = univ := by simp [ordConnectedComponent] #align set.ord_connected_component_univ Set.ordConnectedComponent_univ theorem ordConnectedComponent_inter (s t : Set α) (x : α) : ordConnectedComponent (s ∩ t) x = ordConnectedComponent s x ∩ ordConnectedComponent t x := by simp [ordConnectedComponent, setOf_and] #align set.ord_connected_component_inter Set.ordConnectedComponent_inter theorem mem_ordConnectedComponent_comm : y ∈ ordConnectedComponent s x ↔ x ∈ ordConnectedComponent s y := by rw [mem_ordConnectedComponent, mem_ordConnectedComponent, uIcc_comm] #align set.mem_ord_connected_component_comm Set.mem_ordConnectedComponent_comm theorem mem_ordConnectedComponent_trans (hxy : y ∈ ordConnectedComponent s x) (hyz : z ∈ ordConnectedComponent s y) : z ∈ ordConnectedComponent s x := calc [[x, z]] ⊆ [[x, y]] ∪ [[y, z]] := uIcc_subset_uIcc_union_uIcc _ ⊆ s := union_subset hxy hyz #align set.mem_ord_connected_component_trans Set.mem_ordConnectedComponent_trans theorem ordConnectedComponent_eq (h : [[x, y]] ⊆ s) : ordConnectedComponent s x = ordConnectedComponent s y := ext fun _ => ⟨mem_ordConnectedComponent_trans (mem_ordConnectedComponent_comm.2 h), mem_ordConnectedComponent_trans h⟩ #align set.ord_connected_component_eq Set.ordConnectedComponent_eq instance : OrdConnected (ordConnectedComponent s x) := ordConnected_of_uIcc_subset_left fun _ hy _ hz => (uIcc_subset_uIcc_left hz).trans hy noncomputable def ordConnectedProj (s : Set α) : s → α := fun x : s => (nonempty_ordConnectedComponent.2 x.2).some #align set.ord_connected_proj Set.ordConnectedProj theorem ordConnectedProj_mem_ordConnectedComponent (s : Set α) (x : s) : ordConnectedProj s x ∈ ordConnectedComponent s x := Nonempty.some_mem _ #align set.ord_connected_proj_mem_ord_connected_component Set.ordConnectedProj_mem_ordConnectedComponent theorem mem_ordConnectedComponent_ordConnectedProj (s : Set α) (x : s) : ↑x ∈ ordConnectedComponent s (ordConnectedProj s x) := mem_ordConnectedComponent_comm.2 <| ordConnectedProj_mem_ordConnectedComponent s x #align set.mem_ord_connected_component_ord_connected_proj Set.mem_ordConnectedComponent_ordConnectedProj @[simp] theorem ordConnectedComponent_ordConnectedProj (s : Set α) (x : s) : ordConnectedComponent s (ordConnectedProj s x) = ordConnectedComponent s x := ordConnectedComponent_eq <| mem_ordConnectedComponent_ordConnectedProj _ _ #align set.ord_connected_component_ord_connected_proj Set.ordConnectedComponent_ordConnectedProj @[simp] theorem ordConnectedProj_eq {x y : s} : ordConnectedProj s x = ordConnectedProj s y ↔ [[(x : α), y]] ⊆ s := by constructor <;> intro h · rw [← mem_ordConnectedComponent, ← ordConnectedComponent_ordConnectedProj, h, ordConnectedComponent_ordConnectedProj, self_mem_ordConnectedComponent] exact y.2 · simp only [ordConnectedProj, ordConnectedComponent_eq h] #align set.ord_connected_proj_eq Set.ordConnectedProj_eq def ordConnectedSection (s : Set α) : Set α := range <| ordConnectedProj s #align set.ord_connected_section Set.ordConnectedSection
Mathlib/Order/Interval/Set/OrdConnectedComponent.lean
142
149
theorem dual_ordConnectedSection (s : Set α) : ordConnectedSection (ofDual ⁻¹' s) = ofDual ⁻¹' ordConnectedSection s := by
simp only [ordConnectedSection] simp (config := { unfoldPartialApp := true }) only [ordConnectedProj] ext x simp only [mem_range, Subtype.exists, mem_preimage, OrderDual.exists, dual_ordConnectedComponent, ofDual_toDual] tauto
false
import Mathlib.Analysis.InnerProductSpace.Orthogonal import Mathlib.Analysis.Normed.Group.AddTorsor #align_import geometry.euclidean.basic from "leanprover-community/mathlib"@"2de9c37fa71dde2f1c6feff19876dd6a7b1519f0" open Set open scoped RealInnerProductSpace variable {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] noncomputable section namespace AffineSubspace variable {c c₁ c₂ p₁ p₂ : P} def perpBisector (p₁ p₂ : P) : AffineSubspace ℝ P := .comap ((AffineEquiv.vaddConst ℝ (midpoint ℝ p₁ p₂)).symm : P →ᵃ[ℝ] V) <| (LinearMap.ker (innerₛₗ ℝ (p₂ -ᵥ p₁))).toAffineSubspace theorem mem_perpBisector_iff_inner_eq_zero' : c ∈ perpBisector p₁ p₂ ↔ ⟪p₂ -ᵥ p₁, c -ᵥ midpoint ℝ p₁ p₂⟫ = 0 := Iff.rfl theorem mem_perpBisector_iff_inner_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ midpoint ℝ p₁ p₂, p₂ -ᵥ p₁⟫ = 0 := inner_eq_zero_symm theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero : c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left, vadd_vsub_assoc] simp theorem mem_perpBisector_pointReflection_iff_inner_eq_zero : c ∈ perpBisector p₁ (Equiv.pointReflection p₂ p₁) ↔ ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ = 0 := by rw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc, inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev] theorem midpoint_mem_perpBisector (p₁ p₂ : P) : midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂ := by simp [mem_perpBisector_iff_inner_eq_zero] theorem perpBisector_nonempty : (perpBisector p₁ p₂ : Set P).Nonempty := ⟨_, midpoint_mem_perpBisector _ _⟩ @[simp] theorem direction_perpBisector (p₁ p₂ : P) : (perpBisector p₁ p₂).direction = (ℝ ∙ (p₂ -ᵥ p₁))ᗮ := by erw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction] ext x exact Submodule.mem_orthogonal_singleton_iff_inner_right.symm theorem mem_perpBisector_iff_inner_eq_inner : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫ := by rw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ← inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]; simp theorem mem_perpBisector_iff_inner_eq : c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = (dist p₁ p₂) ^ 2 / 2 := by rw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero, midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V, div_eq_inv_mul]
Mathlib/Geometry/Euclidean/PerpBisector.lean
92
95
theorem mem_perpBisector_iff_dist_eq : c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂ := by
rw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left, inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner]
false
import Mathlib.Algebra.ModEq import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Order.Archimedean import Mathlib.Algebra.Periodic import Mathlib.Data.Int.SuccPred import Mathlib.GroupTheory.QuotientGroup import Mathlib.Order.Circular import Mathlib.Data.List.TFAE import Mathlib.Data.Set.Lattice #align_import algebra.order.to_interval_mod from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" noncomputable section section LinearOrderedAddCommGroup variable {α : Type*} [LinearOrderedAddCommGroup α] [hα : Archimedean α] {p : α} (hp : 0 < p) {a b c : α} {n : ℤ} def toIcoDiv (a b : α) : ℤ := (existsUnique_sub_zsmul_mem_Ico hp b a).choose #align to_Ico_div toIcoDiv theorem sub_toIcoDiv_zsmul_mem_Ico (a b : α) : b - toIcoDiv hp a b • p ∈ Set.Ico a (a + p) := (existsUnique_sub_zsmul_mem_Ico hp b a).choose_spec.1 #align sub_to_Ico_div_zsmul_mem_Ico sub_toIcoDiv_zsmul_mem_Ico theorem toIcoDiv_eq_of_sub_zsmul_mem_Ico (h : b - n • p ∈ Set.Ico a (a + p)) : toIcoDiv hp a b = n := ((existsUnique_sub_zsmul_mem_Ico hp b a).choose_spec.2 _ h).symm #align to_Ico_div_eq_of_sub_zsmul_mem_Ico toIcoDiv_eq_of_sub_zsmul_mem_Ico def toIocDiv (a b : α) : ℤ := (existsUnique_sub_zsmul_mem_Ioc hp b a).choose #align to_Ioc_div toIocDiv theorem sub_toIocDiv_zsmul_mem_Ioc (a b : α) : b - toIocDiv hp a b • p ∈ Set.Ioc a (a + p) := (existsUnique_sub_zsmul_mem_Ioc hp b a).choose_spec.1 #align sub_to_Ioc_div_zsmul_mem_Ioc sub_toIocDiv_zsmul_mem_Ioc theorem toIocDiv_eq_of_sub_zsmul_mem_Ioc (h : b - n • p ∈ Set.Ioc a (a + p)) : toIocDiv hp a b = n := ((existsUnique_sub_zsmul_mem_Ioc hp b a).choose_spec.2 _ h).symm #align to_Ioc_div_eq_of_sub_zsmul_mem_Ioc toIocDiv_eq_of_sub_zsmul_mem_Ioc def toIcoMod (a b : α) : α := b - toIcoDiv hp a b • p #align to_Ico_mod toIcoMod def toIocMod (a b : α) : α := b - toIocDiv hp a b • p #align to_Ioc_mod toIocMod theorem toIcoMod_mem_Ico (a b : α) : toIcoMod hp a b ∈ Set.Ico a (a + p) := sub_toIcoDiv_zsmul_mem_Ico hp a b #align to_Ico_mod_mem_Ico toIcoMod_mem_Ico theorem toIcoMod_mem_Ico' (b : α) : toIcoMod hp 0 b ∈ Set.Ico 0 p := by convert toIcoMod_mem_Ico hp 0 b exact (zero_add p).symm #align to_Ico_mod_mem_Ico' toIcoMod_mem_Ico' theorem toIocMod_mem_Ioc (a b : α) : toIocMod hp a b ∈ Set.Ioc a (a + p) := sub_toIocDiv_zsmul_mem_Ioc hp a b #align to_Ioc_mod_mem_Ioc toIocMod_mem_Ioc theorem left_le_toIcoMod (a b : α) : a ≤ toIcoMod hp a b := (Set.mem_Ico.1 (toIcoMod_mem_Ico hp a b)).1 #align left_le_to_Ico_mod left_le_toIcoMod theorem left_lt_toIocMod (a b : α) : a < toIocMod hp a b := (Set.mem_Ioc.1 (toIocMod_mem_Ioc hp a b)).1 #align left_lt_to_Ioc_mod left_lt_toIocMod theorem toIcoMod_lt_right (a b : α) : toIcoMod hp a b < a + p := (Set.mem_Ico.1 (toIcoMod_mem_Ico hp a b)).2 #align to_Ico_mod_lt_right toIcoMod_lt_right theorem toIocMod_le_right (a b : α) : toIocMod hp a b ≤ a + p := (Set.mem_Ioc.1 (toIocMod_mem_Ioc hp a b)).2 #align to_Ioc_mod_le_right toIocMod_le_right @[simp] theorem self_sub_toIcoDiv_zsmul (a b : α) : b - toIcoDiv hp a b • p = toIcoMod hp a b := rfl #align self_sub_to_Ico_div_zsmul self_sub_toIcoDiv_zsmul @[simp] theorem self_sub_toIocDiv_zsmul (a b : α) : b - toIocDiv hp a b • p = toIocMod hp a b := rfl #align self_sub_to_Ioc_div_zsmul self_sub_toIocDiv_zsmul @[simp]
Mathlib/Algebra/Order/ToIntervalMod.lean
123
124
theorem toIcoDiv_zsmul_sub_self (a b : α) : toIcoDiv hp a b • p - b = -toIcoMod hp a b := by
rw [toIcoMod, neg_sub]
false
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Algebra.Group.Int import Mathlib.Data.Nat.Dist import Mathlib.Data.Ordmap.Ordnode import Mathlib.Tactic.Abel import Mathlib.Tactic.Linarith #align_import data.ordmap.ordset from "leanprover-community/mathlib"@"47b51515e69f59bca5cf34ef456e6000fe205a69" variable {α : Type*} namespace Ordnode theorem not_le_delta {s} (H : 1 ≤ s) : ¬s ≤ delta * 0 := not_le_of_gt H #align ordnode.not_le_delta Ordnode.not_le_delta theorem delta_lt_false {a b : ℕ} (h₁ : delta * a < b) (h₂ : delta * b < a) : False := not_le_of_lt (lt_trans ((mul_lt_mul_left (by decide)).2 h₁) h₂) <| by simpa [mul_assoc] using Nat.mul_le_mul_right a (by decide : 1 ≤ delta * delta) #align ordnode.delta_lt_false Ordnode.delta_lt_false def realSize : Ordnode α → ℕ | nil => 0 | node _ l _ r => realSize l + realSize r + 1 #align ordnode.real_size Ordnode.realSize def Sized : Ordnode α → Prop | nil => True | node s l _ r => s = size l + size r + 1 ∧ Sized l ∧ Sized r #align ordnode.sized Ordnode.Sized theorem Sized.node' {l x r} (hl : @Sized α l) (hr : Sized r) : Sized (node' l x r) := ⟨rfl, hl, hr⟩ #align ordnode.sized.node' Ordnode.Sized.node'
Mathlib/Data/Ordmap/Ordset.lean
114
115
theorem Sized.eq_node' {s l x r} (h : @Sized α (node s l x r)) : node s l x r = .node' l x r := by
rw [h.1]
false
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] theorem rotate_nil (n : ℕ) : ([] : List α).rotate n = [] := by simp [rotate] #align list.rotate_nil List.rotate_nil @[simp] theorem rotate_zero (l : List α) : l.rotate 0 = l := by simp [rotate] #align list.rotate_zero List.rotate_zero -- Porting note: removing simp, simp can prove it theorem rotate'_nil (n : ℕ) : ([] : List α).rotate' n = [] := by cases n <;> rfl #align list.rotate'_nil List.rotate'_nil @[simp] theorem rotate'_zero (l : List α) : l.rotate' 0 = l := by cases l <;> rfl #align list.rotate'_zero List.rotate'_zero theorem rotate'_cons_succ (l : List α) (a : α) (n : ℕ) : (a :: l : List α).rotate' n.succ = (l ++ [a]).rotate' n := by simp [rotate'] #align list.rotate'_cons_succ List.rotate'_cons_succ @[simp] theorem length_rotate' : ∀ (l : List α) (n : ℕ), (l.rotate' n).length = l.length | [], _ => by simp | a :: l, 0 => rfl | a :: l, n + 1 => by rw [List.rotate', length_rotate' (l ++ [a]) n]; simp #align list.length_rotate' List.length_rotate' theorem rotate'_eq_drop_append_take : ∀ {l : List α} {n : ℕ}, n ≤ l.length → l.rotate' n = l.drop n ++ l.take n | [], n, h => by simp [drop_append_of_le_length h] | l, 0, h => by simp [take_append_of_le_length h] | a :: l, n + 1, h => by have hnl : n ≤ l.length := le_of_succ_le_succ h have hnl' : n ≤ (l ++ [a]).length := by rw [length_append, length_cons, List.length]; exact le_of_succ_le h rw [rotate'_cons_succ, rotate'_eq_drop_append_take hnl', drop, take, drop_append_of_le_length hnl, take_append_of_le_length hnl]; simp #align list.rotate'_eq_drop_append_take List.rotate'_eq_drop_append_take theorem rotate'_rotate' : ∀ (l : List α) (n m : ℕ), (l.rotate' n).rotate' m = l.rotate' (n + m) | a :: l, 0, m => by simp | [], n, m => by simp | a :: l, n + 1, m => by rw [rotate'_cons_succ, rotate'_rotate' _ n, Nat.add_right_comm, ← rotate'_cons_succ, Nat.succ_eq_add_one] #align list.rotate'_rotate' List.rotate'_rotate' @[simp] theorem rotate'_length (l : List α) : rotate' l l.length = l := by rw [rotate'_eq_drop_append_take le_rfl]; simp #align list.rotate'_length List.rotate'_length @[simp] theorem rotate'_length_mul (l : List α) : ∀ n : ℕ, l.rotate' (l.length * n) = l | 0 => by simp | n + 1 => calc l.rotate' (l.length * (n + 1)) = (l.rotate' (l.length * n)).rotate' (l.rotate' (l.length * n)).length := by simp [-rotate'_length, Nat.mul_succ, rotate'_rotate'] _ = l := by rw [rotate'_length, rotate'_length_mul l n] #align list.rotate'_length_mul List.rotate'_length_mul theorem rotate'_mod (l : List α) (n : ℕ) : l.rotate' (n % l.length) = l.rotate' n := calc l.rotate' (n % l.length) = (l.rotate' (n % l.length)).rotate' ((l.rotate' (n % l.length)).length * (n / l.length)) := by rw [rotate'_length_mul] _ = l.rotate' n := by rw [rotate'_rotate', length_rotate', Nat.mod_add_div] #align list.rotate'_mod List.rotate'_mod theorem rotate_eq_rotate' (l : List α) (n : ℕ) : l.rotate n = l.rotate' n := if h : l.length = 0 then by simp_all [length_eq_zero] else by rw [← rotate'_mod, rotate'_eq_drop_append_take (le_of_lt (Nat.mod_lt _ (Nat.pos_of_ne_zero h)))]; simp [rotate] #align list.rotate_eq_rotate' List.rotate_eq_rotate' theorem rotate_cons_succ (l : List α) (a : α) (n : ℕ) : (a :: l : List α).rotate (n + 1) = (l ++ [a]).rotate n := by rw [rotate_eq_rotate', rotate_eq_rotate', rotate'_cons_succ] #align list.rotate_cons_succ List.rotate_cons_succ @[simp] theorem mem_rotate : ∀ {l : List α} {a : α} {n : ℕ}, a ∈ l.rotate n ↔ a ∈ l | [], _, n => by simp | a :: l, _, 0 => by simp | a :: l, _, n + 1 => by simp [rotate_cons_succ, mem_rotate, or_comm] #align list.mem_rotate List.mem_rotate @[simp] theorem length_rotate (l : List α) (n : ℕ) : (l.rotate n).length = l.length := by rw [rotate_eq_rotate', length_rotate'] #align list.length_rotate List.length_rotate @[simp] theorem rotate_replicate (a : α) (n : ℕ) (k : ℕ) : (replicate n a).rotate k = replicate n a := eq_replicate.2 ⟨by rw [length_rotate, length_replicate], fun b hb => eq_of_mem_replicate <| mem_rotate.1 hb⟩ #align list.rotate_replicate List.rotate_replicate
Mathlib/Data/List/Rotate.lean
142
144
theorem rotate_eq_drop_append_take {l : List α} {n : ℕ} : n ≤ l.length → l.rotate n = l.drop n ++ l.take n := by
rw [rotate_eq_rotate']; exact rotate'_eq_drop_append_take
false
import Mathlib.Topology.Order import Mathlib.Topology.Sets.Opens import Mathlib.Topology.ContinuousFunction.Basic #align_import topology.continuous_function.t0_sierpinski from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" noncomputable section namespace TopologicalSpace theorem eq_induced_by_maps_to_sierpinski (X : Type*) [t : TopologicalSpace X] : t = ⨅ u : Opens X, sierpinskiSpace.induced (· ∈ u) := by apply le_antisymm · rw [le_iInf_iff] exact fun u => Continuous.le_induced (isOpen_iff_continuous_mem.mp u.2) · intro u h rw [← generateFrom_iUnion_isOpen] apply isOpen_generateFrom_of_mem simp only [Set.mem_iUnion, Set.mem_setOf_eq, isOpen_induced_iff] exact ⟨⟨u, h⟩, {True}, isOpen_singleton_true, by simp [Set.preimage]⟩ #align topological_space.eq_induced_by_maps_to_sierpinski TopologicalSpace.eq_induced_by_maps_to_sierpinski variable (X : Type*) [TopologicalSpace X] def productOfMemOpens : C(X, Opens X → Prop) where toFun x u := x ∈ u continuous_toFun := continuous_pi_iff.2 fun u => continuous_Prop.2 u.isOpen #align topological_space.product_of_mem_opens TopologicalSpace.productOfMemOpens theorem productOfMemOpens_inducing : Inducing (productOfMemOpens X) := by convert inducing_iInf_to_pi fun (u : Opens X) (x : X) => x ∈ u apply eq_induced_by_maps_to_sierpinski #align topological_space.product_of_mem_opens_inducing TopologicalSpace.productOfMemOpens_inducing
Mathlib/Topology/ContinuousFunction/T0Sierpinski.lean
55
58
theorem productOfMemOpens_injective [T0Space X] : Function.Injective (productOfMemOpens X) := by
intro x1 x2 h apply Inseparable.eq rw [← Inducing.inseparable_iff (productOfMemOpens_inducing X), h]
false
import Mathlib.Algebra.Ring.InjSurj import Mathlib.Algebra.Group.Units.Hom import Mathlib.Algebra.Ring.Hom.Defs #align_import algebra.ring.units from "leanprover-community/mathlib"@"2ed7e4aec72395b6a7c3ac4ac7873a7a43ead17c" universe u v w x variable {α : Type u} {β : Type v} {γ : Type w} {R : Type x} open Function namespace Units section HasDistribNeg variable [Monoid α] [HasDistribNeg α] {a b : α} instance : Neg αˣ := ⟨fun u => ⟨-↑u, -↑u⁻¹, by simp, by simp⟩⟩ @[simp, norm_cast] protected theorem val_neg (u : αˣ) : (↑(-u) : α) = -u := rfl #align units.coe_neg Units.val_neg @[simp, norm_cast] protected theorem coe_neg_one : ((-1 : αˣ) : α) = -1 := rfl #align units.coe_neg_one Units.coe_neg_one instance : HasDistribNeg αˣ := Units.ext.hasDistribNeg _ Units.val_neg Units.val_mul @[field_simps]
Mathlib/Algebra/Ring/Units.lean
50
50
theorem neg_divp (a : α) (u : αˣ) : -(a /ₚ u) = -a /ₚ u := by
simp only [divp, neg_mul]
false
import Batteries.Data.Nat.Gcd import Mathlib.Init.Data.Nat.Notation import Mathlib.Mathport.Rename #align_import init.data.nat.gcd from "leanprover-community/lean"@"855e5b74e3a52a40552e8f067169d747d48743fd" open WellFounded namespace Nat #align nat.gcd Nat.gcd #align nat.gcd_zero_left Nat.gcd_zero_left #align nat.gcd_succ Nat.gcd_succ #align nat.gcd_one_left Nat.gcd_one_left #align nat.gcd_self Nat.gcd_self #align nat.gcd_zero_right Nat.gcd_zero_right #align nat.gcd_rec Nat.gcd_rec #align nat.gcd.induction Nat.gcd.induction #align nat.lcm Nat.lcm
Mathlib/Init/Data/Nat/GCD.lean
35
36
theorem gcd_def (x y : ℕ) : gcd x y = if x = 0 then y else gcd (y % x) x := by
cases x <;> simp [Nat.gcd_succ]
false
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
Mathlib/Algebra/ContinuedFractions/ContinuantsRecurrence.lean
33
38
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]
false
import Mathlib.SetTheory.Game.Ordinal import Mathlib.SetTheory.Ordinal.NaturalOps #align_import set_theory.game.birthday from "leanprover-community/mathlib"@"a347076985674932c0e91da09b9961ed0a79508c" universe u open Ordinal namespace SetTheory open scoped NaturalOps PGame namespace PGame noncomputable def birthday : PGame.{u} → Ordinal.{u} | ⟨_, _, xL, xR⟩ => max (lsub.{u, u} fun i => birthday (xL i)) (lsub.{u, u} fun i => birthday (xR i)) #align pgame.birthday SetTheory.PGame.birthday theorem birthday_def (x : PGame) : birthday x = max (lsub.{u, u} fun i => birthday (x.moveLeft i)) (lsub.{u, u} fun i => birthday (x.moveRight i)) := by cases x; rw [birthday]; rfl #align pgame.birthday_def SetTheory.PGame.birthday_def
Mathlib/SetTheory/Game/Birthday.lean
54
56
theorem birthday_moveLeft_lt {x : PGame} (i : x.LeftMoves) : (x.moveLeft i).birthday < x.birthday := by
cases x; rw [birthday]; exact lt_max_of_lt_left (lt_lsub _ i)
false
import Mathlib.Analysis.Calculus.FDeriv.Analytic import Mathlib.Analysis.Asymptotics.SpecificAsymptotics import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.complex.removable_singularity from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Metric Set Filter Asymptotics Function open scoped Topology Filter NNReal Real universe u variable {E : Type u} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] namespace Complex theorem analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt {f : ℂ → E} {c : ℂ} (hd : ∀ᶠ z in 𝓝[≠] c, DifferentiableAt ℂ f z) (hc : ContinuousAt f c) : AnalyticAt ℂ f c := by rcases (nhdsWithin_hasBasis nhds_basis_closedBall _).mem_iff.1 hd with ⟨R, hR0, hRs⟩ lift R to ℝ≥0 using hR0.le replace hc : ContinuousOn f (closedBall c R) := by refine fun z hz => ContinuousAt.continuousWithinAt ?_ rcases eq_or_ne z c with (rfl | hne) exacts [hc, (hRs ⟨hz, hne⟩).continuousAt] exact (hasFPowerSeriesOnBall_of_differentiable_off_countable (countable_singleton c) hc (fun z hz => hRs (diff_subset_diff_left ball_subset_closedBall hz)) hR0).analyticAt #align complex.analytic_at_of_differentiable_on_punctured_nhds_of_continuous_at Complex.analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt theorem differentiableOn_compl_singleton_and_continuousAt_iff {f : ℂ → E} {s : Set ℂ} {c : ℂ} (hs : s ∈ 𝓝 c) : DifferentiableOn ℂ f (s \ {c}) ∧ ContinuousAt f c ↔ DifferentiableOn ℂ f s := by refine ⟨?_, fun hd => ⟨hd.mono diff_subset, (hd.differentiableAt hs).continuousAt⟩⟩ rintro ⟨hd, hc⟩ x hx rcases eq_or_ne x c with (rfl | hne) · refine (analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt ?_ hc).differentiableAt.differentiableWithinAt refine eventually_nhdsWithin_iff.2 ((eventually_mem_nhds.2 hs).mono fun z hz hzx => ?_) exact hd.differentiableAt (inter_mem hz (isOpen_ne.mem_nhds hzx)) · simpa only [DifferentiableWithinAt, HasFDerivWithinAt, hne.nhdsWithin_diff_singleton] using hd x ⟨hx, hne⟩ #align complex.differentiable_on_compl_singleton_and_continuous_at_iff Complex.differentiableOn_compl_singleton_and_continuousAt_iff theorem differentiableOn_dslope {f : ℂ → E} {s : Set ℂ} {c : ℂ} (hc : s ∈ 𝓝 c) : DifferentiableOn ℂ (dslope f c) s ↔ DifferentiableOn ℂ f s := ⟨fun h => h.of_dslope, fun h => (differentiableOn_compl_singleton_and_continuousAt_iff hc).mp <| ⟨Iff.mpr (differentiableOn_dslope_of_nmem fun h => h.2 rfl) (h.mono diff_subset), continuousAt_dslope_same.2 <| h.differentiableAt hc⟩⟩ #align complex.differentiable_on_dslope Complex.differentiableOn_dslope
Mathlib/Analysis/Complex/RemovableSingularity.lean
71
87
theorem differentiableOn_update_limUnder_of_isLittleO {f : ℂ → E} {s : Set ℂ} {c : ℂ} (hc : s ∈ 𝓝 c) (hd : DifferentiableOn ℂ f (s \ {c})) (ho : (fun z => f z - f c) =o[𝓝[≠] c] fun z => (z - c)⁻¹) : DifferentiableOn ℂ (update f c (limUnder (𝓝[≠] c) f)) s := by
set F : ℂ → E := fun z => (z - c) • f z suffices DifferentiableOn ℂ F (s \ {c}) ∧ ContinuousAt F c by rw [differentiableOn_compl_singleton_and_continuousAt_iff hc, ← differentiableOn_dslope hc, dslope_sub_smul] at this have hc : Tendsto f (𝓝[≠] c) (𝓝 (deriv F c)) := continuousAt_update_same.mp (this.continuousOn.continuousAt hc) rwa [hc.limUnder_eq] refine ⟨(differentiableOn_id.sub_const _).smul hd, ?_⟩ rw [← continuousWithinAt_compl_self] have H := ho.tendsto_inv_smul_nhds_zero have H' : Tendsto (fun z => (z - c) • f c) (𝓝[≠] c) (𝓝 (F c)) := (continuousWithinAt_id.tendsto.sub tendsto_const_nhds).smul tendsto_const_nhds simpa [← smul_add, ContinuousWithinAt] using H.add H'
false
import Mathlib.Analysis.Normed.Group.InfiniteSum import Mathlib.Analysis.Normed.MulAction import Mathlib.Topology.Algebra.Order.LiminfLimsup import Mathlib.Topology.PartialHomeomorph #align_import analysis.asymptotics.asymptotics from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Filter Set open scoped Classical open Topology Filter NNReal namespace Asymptotics set_option linter.uppercaseLean3 false variable {α : Type*} {β : Type*} {E : Type*} {F : Type*} {G : Type*} {E' : Type*} {F' : Type*} {G' : Type*} {E'' : Type*} {F'' : Type*} {G'' : Type*} {E''' : Type*} {R : Type*} {R' : Type*} {𝕜 : Type*} {𝕜' : Type*} variable [Norm E] [Norm F] [Norm G] variable [SeminormedAddCommGroup E'] [SeminormedAddCommGroup F'] [SeminormedAddCommGroup G'] [NormedAddCommGroup E''] [NormedAddCommGroup F''] [NormedAddCommGroup G''] [SeminormedRing R] [SeminormedAddGroup E'''] [SeminormedRing R'] variable [NormedDivisionRing 𝕜] [NormedDivisionRing 𝕜'] variable {c c' c₁ c₂ : ℝ} {f : α → E} {g : α → F} {k : α → G} variable {f' : α → E'} {g' : α → F'} {k' : α → G'} variable {f'' : α → E''} {g'' : α → F''} {k'' : α → G''} variable {l l' : Filter α} section Defs irreducible_def IsBigOWith (c : ℝ) (l : Filter α) (f : α → E) (g : α → F) : Prop := ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ #align asymptotics.is_O_with Asymptotics.IsBigOWith theorem isBigOWith_iff : IsBigOWith c l f g ↔ ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖ := by rw [IsBigOWith_def] #align asymptotics.is_O_with_iff Asymptotics.isBigOWith_iff alias ⟨IsBigOWith.bound, IsBigOWith.of_bound⟩ := isBigOWith_iff #align asymptotics.is_O_with.bound Asymptotics.IsBigOWith.bound #align asymptotics.is_O_with.of_bound Asymptotics.IsBigOWith.of_bound irreducible_def IsBigO (l : Filter α) (f : α → E) (g : α → F) : Prop := ∃ c : ℝ, IsBigOWith c l f g #align asymptotics.is_O Asymptotics.IsBigO @[inherit_doc] notation:100 f " =O[" l "] " g:100 => IsBigO l f g
Mathlib/Analysis/Asymptotics/Asymptotics.lean
109
109
theorem isBigO_iff_isBigOWith : f =O[l] g ↔ ∃ c : ℝ, IsBigOWith c l f g := by
rw [IsBigO_def]
false
import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar import Mathlib.MeasureTheory.Integral.SetIntegral #align_import measure_theory.measure.haar.normed_space from "leanprover-community/mathlib"@"b84aee748341da06a6d78491367e2c0e9f15e8a5" noncomputable section open scoped NNReal ENNReal Pointwise Topology open Inv Set Function MeasureTheory.Measure Filter open FiniteDimensional namespace MeasureTheory namespace Measure example {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Nontrivial E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] (μ : Measure E) [IsAddHaarMeasure μ] : NoAtoms μ := by infer_instance variable {F : Type*} [NormedAddCommGroup F]
Mathlib/MeasureTheory/Measure/Haar/NormedSpace.lean
163
177
theorem integrable_comp_smul_iff {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] (μ : Measure E) [IsAddHaarMeasure μ] (f : E → F) {R : ℝ} (hR : R ≠ 0) : Integrable (fun x => f (R • x)) μ ↔ Integrable f μ := by
-- reduce to one-way implication suffices ∀ {g : E → F} (_ : Integrable g μ) {S : ℝ} (_ : S ≠ 0), Integrable (fun x => g (S • x)) μ by refine ⟨fun hf => ?_, fun hf => this hf hR⟩ convert this hf (inv_ne_zero hR) rw [← mul_smul, mul_inv_cancel hR, one_smul] -- now prove intro g hg S hS let t := ((Homeomorph.smul (isUnit_iff_ne_zero.2 hS).unit).toMeasurableEquiv : E ≃ᵐ E) refine (integrable_map_equiv t g).mp (?_ : Integrable g (map (S • ·) μ)) rwa [map_addHaar_smul μ hS, integrable_smul_measure _ ENNReal.ofReal_ne_top] simpa only [Ne, ENNReal.ofReal_eq_zero, not_le, abs_pos] using inv_ne_zero (pow_ne_zero _ hS)
false
import Mathlib.Algebra.Field.Defs import Mathlib.Algebra.GroupWithZero.Units.Lemmas import Mathlib.Algebra.Ring.Commute import Mathlib.Algebra.Ring.Invertible import Mathlib.Order.Synonym #align_import algebra.field.basic from "leanprover-community/mathlib"@"05101c3df9d9cfe9430edc205860c79b6d660102" open Function OrderDual Set universe u variable {α β K : Type*} section DivisionMonoid variable [DivisionMonoid K] [HasDistribNeg K] {a b : K} theorem one_div_neg_one_eq_neg_one : (1 : K) / -1 = -1 := have : -1 * -1 = (1 : K) := by rw [neg_mul_neg, one_mul] Eq.symm (eq_one_div_of_mul_eq_one_right this) #align one_div_neg_one_eq_neg_one one_div_neg_one_eq_neg_one
Mathlib/Algebra/Field/Basic.lean
101
106
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) := calc 1 / -a = 1 / (-1 * a) := by
rw [neg_eq_neg_one_mul] _ = 1 / a * (1 / -1) := by rw [one_div_mul_one_div_rev] _ = 1 / a * -1 := by rw [one_div_neg_one_eq_neg_one] _ = -(1 / a) := by rw [mul_neg, mul_one]
false
import Mathlib.Data.ENat.Lattice import Mathlib.Order.OrderIsoNat import Mathlib.Tactic.TFAE #align_import order.height from "leanprover-community/mathlib"@"bf27744463e9620ca4e4ebe951fe83530ae6949b" open List hiding le_antisymm open OrderDual universe u v variable {α β : Type*} namespace Set section LT variable [LT α] [LT β] (s t : Set α) def subchain : Set (List α) := { l | l.Chain' (· < ·) ∧ ∀ i ∈ l, i ∈ s } #align set.subchain Set.subchain @[simp] -- porting note: new `simp` theorem nil_mem_subchain : [] ∈ s.subchain := ⟨trivial, fun _ ↦ nofun⟩ #align set.nil_mem_subchain Set.nil_mem_subchain variable {s} {l : List α} {a : α} theorem cons_mem_subchain_iff : (a::l) ∈ s.subchain ↔ a ∈ s ∧ l ∈ s.subchain ∧ ∀ b ∈ l.head?, a < b := by simp only [subchain, mem_setOf_eq, forall_mem_cons, chain'_cons', and_left_comm, and_comm, and_assoc] #align set.cons_mem_subchain_iff Set.cons_mem_subchain_iff @[simp] -- Porting note (#10756): new lemma + `simp` theorem singleton_mem_subchain_iff : [a] ∈ s.subchain ↔ a ∈ s := by simp [cons_mem_subchain_iff] instance : Nonempty s.subchain := ⟨⟨[], s.nil_mem_subchain⟩⟩ variable (s) noncomputable def chainHeight : ℕ∞ := ⨆ l ∈ s.subchain, length l #align set.chain_height Set.chainHeight theorem chainHeight_eq_iSup_subtype : s.chainHeight = ⨆ l : s.subchain, ↑l.1.length := iSup_subtype' #align set.chain_height_eq_supr_subtype Set.chainHeight_eq_iSup_subtype theorem exists_chain_of_le_chainHeight {n : ℕ} (hn : ↑n ≤ s.chainHeight) : ∃ l ∈ s.subchain, length l = n := by rcases (le_top : s.chainHeight ≤ ⊤).eq_or_lt with ha | ha <;> rw [chainHeight_eq_iSup_subtype] at ha · obtain ⟨_, ⟨⟨l, h₁, h₂⟩, rfl⟩, h₃⟩ := not_bddAbove_iff'.mp (WithTop.iSup_coe_eq_top.1 ha) n exact ⟨l.take n, ⟨h₁.take _, fun x h ↦ h₂ _ <| take_subset _ _ h⟩, (l.length_take n).trans <| min_eq_left <| le_of_not_ge h₃⟩ · rw [ENat.iSup_coe_lt_top] at ha obtain ⟨⟨l, h₁, h₂⟩, e : l.length = _⟩ := Nat.sSup_mem (Set.range_nonempty _) ha refine ⟨l.take n, ⟨h₁.take _, fun x h ↦ h₂ _ <| take_subset _ _ h⟩, (l.length_take n).trans <| min_eq_left <| ?_⟩ rwa [e, ← Nat.cast_le (α := ℕ∞), sSup_range, ENat.coe_iSup ha, ← chainHeight_eq_iSup_subtype] #align set.exists_chain_of_le_chain_height Set.exists_chain_of_le_chainHeight
Mathlib/Order/Height.lean
109
114
theorem le_chainHeight_TFAE (n : ℕ) : TFAE [↑n ≤ s.chainHeight, ∃ l ∈ s.subchain, length l = n, ∃ l ∈ s.subchain, n ≤ length l] := by
tfae_have 1 → 2; · exact s.exists_chain_of_le_chainHeight tfae_have 2 → 3; · rintro ⟨l, hls, he⟩; exact ⟨l, hls, he.ge⟩ tfae_have 3 → 1; · rintro ⟨l, hs, hn⟩; exact le_iSup₂_of_le l hs (WithTop.coe_le_coe.2 hn) tfae_finish
false
import Mathlib.Algebra.MvPolynomial.Derivation import Mathlib.Algebra.MvPolynomial.Variables #align_import data.mv_polynomial.pderiv from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section universe u v namespace MvPolynomial open Set Function Finsupp variable {R : Type u} {σ : Type v} {a a' a₁ a₂ : R} {s : σ →₀ ℕ} section PDeriv variable [CommSemiring R] def pderiv (i : σ) : Derivation R (MvPolynomial σ R) (MvPolynomial σ R) := letI := Classical.decEq σ mkDerivation R <| Pi.single i 1 #align mv_polynomial.pderiv MvPolynomial.pderiv theorem pderiv_def [DecidableEq σ] (i : σ) : pderiv i = mkDerivation R (Pi.single i 1) := by unfold pderiv; congr! #align mv_polynomial.pderiv_def MvPolynomial.pderiv_def @[simp]
Mathlib/Algebra/MvPolynomial/PDeriv.lean
69
77
theorem pderiv_monomial {i : σ} : pderiv i (monomial s a) = monomial (s - single i 1) (a * s i) := by
classical simp only [pderiv_def, mkDerivation_monomial, Finsupp.smul_sum, smul_eq_mul, ← smul_mul_assoc, ← (monomial _).map_smul] refine (Finset.sum_eq_single i (fun j _ hne => ?_) fun hi => ?_).trans ?_ · simp [Pi.single_eq_of_ne hne] · rw [Finsupp.not_mem_support_iff] at hi; simp [hi] · simp
false
import Mathlib.CategoryTheory.Equivalence #align_import algebraic_topology.dold_kan.compatibility from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category namespace AlgebraicTopology namespace DoldKan namespace Compatibility variable {A A' B B' : Type*} [Category A] [Category A'] [Category B] [Category B'] (eA : A ≌ A') (eB : B ≌ B') (e' : A' ≌ B') {F : A ⥤ B'} (hF : eA.functor ⋙ e'.functor ≅ F) {G : B ⥤ A} (hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor) @[simps! functor inverse unitIso_hom_app] def equivalence₀ : A ≌ B' := eA.trans e' #align algebraic_topology.dold_kan.compatibility.equivalence₀ AlgebraicTopology.DoldKan.Compatibility.equivalence₀ variable {eA} {e'} @[simps! functor] def equivalence₁ : A ≌ B' := (equivalence₀ eA e').changeFunctor hF #align algebraic_topology.dold_kan.compatibility.equivalence₁ AlgebraicTopology.DoldKan.Compatibility.equivalence₁ theorem equivalence₁_inverse : (equivalence₁ hF).inverse = e'.inverse ⋙ eA.inverse := rfl #align algebraic_topology.dold_kan.compatibility.equivalence₁_inverse AlgebraicTopology.DoldKan.Compatibility.equivalence₁_inverse @[simps!] def equivalence₁CounitIso : (e'.inverse ⋙ eA.inverse) ⋙ F ≅ 𝟭 B' := calc (e'.inverse ⋙ eA.inverse) ⋙ F ≅ (e'.inverse ⋙ eA.inverse) ⋙ eA.functor ⋙ e'.functor := isoWhiskerLeft _ hF.symm _ ≅ e'.inverse ⋙ (eA.inverse ⋙ eA.functor) ⋙ e'.functor := Iso.refl _ _ ≅ e'.inverse ⋙ 𝟭 _ ⋙ e'.functor := isoWhiskerLeft _ (isoWhiskerRight eA.counitIso _) _ ≅ e'.inverse ⋙ e'.functor := Iso.refl _ _ ≅ 𝟭 B' := e'.counitIso #align algebraic_topology.dold_kan.compatibility.equivalence₁_counit_iso AlgebraicTopology.DoldKan.Compatibility.equivalence₁CounitIso theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by ext Y simp [equivalence₁, equivalence₀] #align algebraic_topology.dold_kan.compatibility.equivalence₁_counit_iso_eq AlgebraicTopology.DoldKan.Compatibility.equivalence₁CounitIso_eq @[simps!] def equivalence₁UnitIso : 𝟭 A ≅ F ⋙ e'.inverse ⋙ eA.inverse := calc 𝟭 A ≅ eA.functor ⋙ eA.inverse := eA.unitIso _ ≅ eA.functor ⋙ 𝟭 A' ⋙ eA.inverse := Iso.refl _ _ ≅ eA.functor ⋙ (e'.functor ⋙ e'.inverse) ⋙ eA.inverse := isoWhiskerLeft _ (isoWhiskerRight e'.unitIso _) _ ≅ (eA.functor ⋙ e'.functor) ⋙ e'.inverse ⋙ eA.inverse := Iso.refl _ _ ≅ F ⋙ e'.inverse ⋙ eA.inverse := isoWhiskerRight hF _ #align algebraic_topology.dold_kan.compatibility.equivalence₁_unit_iso AlgebraicTopology.DoldKan.Compatibility.equivalence₁UnitIso theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by ext X simp [equivalence₁] #align algebraic_topology.dold_kan.compatibility.equivalence₁_unit_iso_eq AlgebraicTopology.DoldKan.Compatibility.equivalence₁UnitIso_eq @[simps! functor] def equivalence₂ : A ≌ B := (equivalence₁ hF).trans eB.symm #align algebraic_topology.dold_kan.compatibility.equivalence₂ AlgebraicTopology.DoldKan.Compatibility.equivalence₂ theorem equivalence₂_inverse : (equivalence₂ eB hF).inverse = eB.functor ⋙ e'.inverse ⋙ eA.inverse := rfl #align algebraic_topology.dold_kan.compatibility.equivalence₂_inverse AlgebraicTopology.DoldKan.Compatibility.equivalence₂_inverse @[simps!] def equivalence₂CounitIso : (eB.functor ⋙ e'.inverse ⋙ eA.inverse) ⋙ F ⋙ eB.inverse ≅ 𝟭 B := calc (eB.functor ⋙ e'.inverse ⋙ eA.inverse) ⋙ F ⋙ eB.inverse ≅ eB.functor ⋙ (e'.inverse ⋙ eA.inverse ⋙ F) ⋙ eB.inverse := Iso.refl _ _ ≅ eB.functor ⋙ 𝟭 _ ⋙ eB.inverse := isoWhiskerLeft _ (isoWhiskerRight (equivalence₁CounitIso hF) _) _ ≅ eB.functor ⋙ eB.inverse := Iso.refl _ _ ≅ 𝟭 B := eB.unitIso.symm #align algebraic_topology.dold_kan.compatibility.equivalence₂_counit_iso AlgebraicTopology.DoldKan.Compatibility.equivalence₂CounitIso
Mathlib/AlgebraicTopology/DoldKan/Compatibility.lean
133
138
theorem equivalence₂CounitIso_eq : (equivalence₂ eB hF).counitIso = equivalence₂CounitIso eB hF := by
ext Y' dsimp [equivalence₂, Iso.refl] simp only [equivalence₁CounitIso_eq, equivalence₂CounitIso_hom_app, equivalence₁CounitIso_hom_app, Functor.map_comp, assoc]
false
import Mathlib.LinearAlgebra.Dimension.Free import Mathlib.Algebra.Module.Torsion #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v v' u₁' w w' variable {R S : Type u} {M : Type v} {M' : Type v'} {M₁ : Type v} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set FiniteDimensional DirectSum variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] section Finsupp variable (R M M') variable [StrongRankCondition R] [Module.Free R M] [Module.Free R M'] open Module.Free @[simp] theorem rank_finsupp (ι : Type w) : Module.rank R (ι →₀ M) = Cardinal.lift.{v} #ι * Cardinal.lift.{w} (Module.rank R M) := by obtain ⟨⟨_, bs⟩⟩ := Module.Free.exists_basis (R := R) (M := M) rw [← bs.mk_eq_rank'', ← (Finsupp.basis fun _ : ι => bs).mk_eq_rank'', Cardinal.mk_sigma, Cardinal.sum_const] #align rank_finsupp rank_finsupp theorem rank_finsupp' (ι : Type v) : Module.rank R (ι →₀ M) = #ι * Module.rank R M := by simp [rank_finsupp] #align rank_finsupp' rank_finsupp' -- Porting note, this should not be `@[simp]`, as simp can prove it. -- @[simp] theorem rank_finsupp_self (ι : Type w) : Module.rank R (ι →₀ R) = Cardinal.lift.{u} #ι := by simp [rank_finsupp] #align rank_finsupp_self rank_finsupp_self theorem rank_finsupp_self' {ι : Type u} : Module.rank R (ι →₀ R) = #ι := by simp #align rank_finsupp_self' rank_finsupp_self' @[simp] theorem rank_directSum {ι : Type v} (M : ι → Type w) [∀ i : ι, AddCommGroup (M i)] [∀ i : ι, Module R (M i)] [∀ i : ι, Module.Free R (M i)] : Module.rank R (⨁ i, M i) = Cardinal.sum fun i => Module.rank R (M i) := by let B i := chooseBasis R (M i) let b : Basis _ R (⨁ i, M i) := DFinsupp.basis fun i => B i simp [← b.mk_eq_rank'', fun i => (B i).mk_eq_rank''] #align rank_direct_sum rank_directSum @[simp] theorem rank_matrix (m : Type v) (n : Type w) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = Cardinal.lift.{max v w u, v} #m * Cardinal.lift.{max v w u, w} #n := by cases nonempty_fintype m cases nonempty_fintype n have h := (Matrix.stdBasis R m n).mk_eq_rank rw [← lift_lift.{max v w u, max v w}, lift_inj] at h simpa using h.symm #align rank_matrix rank_matrix @[simp high] theorem rank_matrix' (m n : Type v) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = Cardinal.lift.{u} (#m * #n) := by rw [rank_matrix, lift_mul, lift_umax.{v, u}] #align rank_matrix' rank_matrix' -- @[simp] -- Porting note (#10618): simp can prove this theorem rank_matrix'' (m n : Type u) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = #m * #n := by simp #align rank_matrix'' rank_matrix'' variable [Module.Finite R M] [Module.Finite R M'] open Fintype section SubalgebraRank open Module variable {F E : Type*} [CommRing F] [Ring E] [Algebra F E] @[simp] theorem Subalgebra.rank_toSubmodule (S : Subalgebra F E) : Module.rank F (Subalgebra.toSubmodule S) = Module.rank F S := rfl #align subalgebra.rank_to_submodule Subalgebra.rank_toSubmodule @[simp] theorem Subalgebra.finrank_toSubmodule (S : Subalgebra F E) : finrank F (Subalgebra.toSubmodule S) = finrank F S := rfl #align subalgebra.finrank_to_submodule Subalgebra.finrank_toSubmodule theorem subalgebra_top_rank_eq_submodule_top_rank : Module.rank F (⊤ : Subalgebra F E) = Module.rank F (⊤ : Submodule F E) := by rw [← Algebra.top_toSubmodule] rfl #align subalgebra_top_rank_eq_submodule_top_rank subalgebra_top_rank_eq_submodule_top_rank theorem subalgebra_top_finrank_eq_submodule_top_finrank : finrank F (⊤ : Subalgebra F E) = finrank F (⊤ : Submodule F E) := by rw [← Algebra.top_toSubmodule] rfl #align subalgebra_top_finrank_eq_submodule_top_finrank subalgebra_top_finrank_eq_submodule_top_finrank
Mathlib/LinearAlgebra/Dimension/Constructions.lean
550
552
theorem Subalgebra.rank_top : Module.rank F (⊤ : Subalgebra F E) = Module.rank F E := by
rw [subalgebra_top_rank_eq_submodule_top_rank] exact _root_.rank_top F E
false
import Mathlib.Data.Fintype.Card import Mathlib.Order.UpperLower.Basic #align_import combinatorics.set_family.intersecting from "leanprover-community/mathlib"@"d90e4e186f1d18e375dcd4e5b5f6364b01cb3e46" open Finset variable {α : Type*} namespace Set section SemilatticeInf variable [SemilatticeInf α] [OrderBot α] {s t : Set α} {a b c : α} def Intersecting (s : Set α) : Prop := ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → ¬Disjoint a b #align set.intersecting Set.Intersecting @[mono] theorem Intersecting.mono (h : t ⊆ s) (hs : s.Intersecting) : t.Intersecting := fun _a ha _b hb => hs (h ha) (h hb) #align set.intersecting.mono Set.Intersecting.mono theorem Intersecting.not_bot_mem (hs : s.Intersecting) : ⊥ ∉ s := fun h => hs h h disjoint_bot_left #align set.intersecting.not_bot_mem Set.Intersecting.not_bot_mem theorem Intersecting.ne_bot (hs : s.Intersecting) (ha : a ∈ s) : a ≠ ⊥ := ne_of_mem_of_not_mem ha hs.not_bot_mem #align set.intersecting.ne_bot Set.Intersecting.ne_bot theorem intersecting_empty : (∅ : Set α).Intersecting := fun _ => False.elim #align set.intersecting_empty Set.intersecting_empty @[simp] theorem intersecting_singleton : ({a} : Set α).Intersecting ↔ a ≠ ⊥ := by simp [Intersecting] #align set.intersecting_singleton Set.intersecting_singleton protected theorem Intersecting.insert (hs : s.Intersecting) (ha : a ≠ ⊥) (h : ∀ b ∈ s, ¬Disjoint a b) : (insert a s).Intersecting := by rintro b (rfl | hb) c (rfl | hc) · rwa [disjoint_self] · exact h _ hc · exact fun H => h _ hb H.symm · exact hs hb hc #align set.intersecting.insert Set.Intersecting.insert theorem intersecting_insert : (insert a s).Intersecting ↔ s.Intersecting ∧ a ≠ ⊥ ∧ ∀ b ∈ s, ¬Disjoint a b := ⟨fun h => ⟨h.mono <| subset_insert _ _, h.ne_bot <| mem_insert _ _, fun _b hb => h (mem_insert _ _) <| mem_insert_of_mem _ hb⟩, fun h => h.1.insert h.2.1 h.2.2⟩ #align set.intersecting_insert Set.intersecting_insert theorem intersecting_iff_pairwise_not_disjoint : s.Intersecting ↔ (s.Pairwise fun a b => ¬Disjoint a b) ∧ s ≠ {⊥} := by refine ⟨fun h => ⟨fun a ha b hb _ => h ha hb, ?_⟩, fun h a ha b hb hab => ?_⟩ · rintro rfl exact intersecting_singleton.1 h rfl have := h.1.eq ha hb (Classical.not_not.2 hab) rw [this, disjoint_self] at hab rw [hab] at hb exact h.2 (eq_singleton_iff_unique_mem.2 ⟨hb, fun c hc => not_ne_iff.1 fun H => h.1 hb hc H.symm disjoint_bot_left⟩) #align set.intersecting_iff_pairwise_not_disjoint Set.intersecting_iff_pairwise_not_disjoint protected theorem Subsingleton.intersecting (hs : s.Subsingleton) : s.Intersecting ↔ s ≠ {⊥} := intersecting_iff_pairwise_not_disjoint.trans <| and_iff_right <| hs.pairwise _ #align set.subsingleton.intersecting Set.Subsingleton.intersecting theorem intersecting_iff_eq_empty_of_subsingleton [Subsingleton α] (s : Set α) : s.Intersecting ↔ s = ∅ := by refine subsingleton_of_subsingleton.intersecting.trans ⟨not_imp_comm.2 fun h => subsingleton_of_subsingleton.eq_singleton_of_mem ?_, ?_⟩ · obtain ⟨a, ha⟩ := nonempty_iff_ne_empty.2 h rwa [Subsingleton.elim ⊥ a] · rintro rfl exact (Set.singleton_nonempty _).ne_empty.symm #align set.intersecting_iff_eq_empty_of_subsingleton Set.intersecting_iff_eq_empty_of_subsingleton protected theorem Intersecting.isUpperSet (hs : s.Intersecting) (h : ∀ t : Set α, t.Intersecting → s ⊆ t → s = t) : IsUpperSet s := by classical rintro a b hab ha rw [h (Insert.insert b s) _ (subset_insert _ _)] · exact mem_insert _ _ exact hs.insert (mt (eq_bot_mono hab) <| hs.ne_bot ha) fun c hc hbc => hs ha hc <| hbc.mono_left hab #align set.intersecting.is_upper_set Set.Intersecting.isUpperSet
Mathlib/Combinatorics/SetFamily/Intersecting.lean
122
130
theorem Intersecting.isUpperSet' {s : Finset α} (hs : (s : Set α).Intersecting) (h : ∀ t : Finset α, (t : Set α).Intersecting → s ⊆ t → s = t) : IsUpperSet (s : Set α) := by
classical rintro a b hab ha rw [h (Insert.insert b s) _ (Finset.subset_insert _ _)] · exact mem_insert_self _ _ rw [coe_insert] exact hs.insert (mt (eq_bot_mono hab) <| hs.ne_bot ha) fun c hc hbc => hs ha hc <| hbc.mono_left hab
false
import Mathlib.Topology.Algebra.InfiniteSum.Group import Mathlib.Logic.Encodable.Lattice noncomputable section open Filter Finset Function Encodable open scoped Topology variable {M : Type*} [CommMonoid M] [TopologicalSpace M] {m m' : M} variable {G : Type*} [CommGroup G] {g g' : G} -- don't declare [TopologicalAddGroup G] here as some results require [UniformAddGroup G] instead section Nat section Monoid namespace HasProd @[to_additive "If `f : ℕ → M` has sum `m`, then the partial sums `∑ i ∈ range n, f i` converge to `m`."] theorem tendsto_prod_nat {f : ℕ → M} (h : HasProd f m) : Tendsto (fun n ↦ ∏ i ∈ range n, f i) atTop (𝓝 m) := h.comp tendsto_finset_range #align has_sum.tendsto_sum_nat HasSum.tendsto_sum_nat @[to_additive "If `f : ℕ → M` is summable, then the partial sums `∑ i ∈ range n, f i` converge to `∑' i, f i`."] theorem Multipliable.tendsto_prod_tprod_nat {f : ℕ → M} (h : Multipliable f) : Tendsto (fun n ↦ ∏ i ∈ range n, f i) atTop (𝓝 (∏' i, f i)) := tendsto_prod_nat h.hasProd namespace Multipliable @[to_additive]
Mathlib/Topology/Algebra/InfiniteSum/NatInt.lean
88
92
theorem hasProd_iff_tendsto_nat [T2Space M] {f : ℕ → M} (hf : Multipliable f) : HasProd f m ↔ Tendsto (fun n : ℕ ↦ ∏ i ∈ range n, f i) atTop (𝓝 m) := by
refine ⟨fun h ↦ h.tendsto_prod_nat, fun h ↦ ?_⟩ rw [tendsto_nhds_unique h hf.hasProd.tendsto_prod_nat] exact hf.hasProd
false
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] 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] theorem Coprime.gcd_mul_right_cancel_right (n : Nat) (H : Coprime k m) : gcd m (n * k) = gcd m n := by rw [Nat.mul_comm n k, H.gcd_mul_left_cancel_right n] theorem coprime_div_gcd_div_gcd (H : 0 < gcd m n) : Coprime (m / gcd m n) (n / gcd m n) := by rw [coprime_iff_gcd_eq_one, gcd_div (gcd_dvd_left m n) (gcd_dvd_right m n), Nat.div_self H] theorem not_coprime_of_dvd_of_dvd (dgt1 : 1 < d) (Hm : d ∣ m) (Hn : d ∣ n) : ¬ Coprime m n := fun co => Nat.not_le_of_gt dgt1 <| Nat.le_of_dvd Nat.zero_lt_one <| by rw [← co.gcd_eq_one]; exact dvd_gcd Hm Hn theorem exists_coprime (m n : Nat) : ∃ m' n', Coprime m' n' ∧ m = m' * gcd m n ∧ n = n' * gcd m n := by cases eq_zero_or_pos (gcd m n) with | inl h0 => rw [gcd_eq_zero_iff] at h0 refine ⟨1, 1, gcd_one_left 1, ?_⟩ simp [h0] | inr hpos => exact ⟨_, _, coprime_div_gcd_div_gcd hpos, (Nat.div_mul_cancel (gcd_dvd_left m n)).symm, (Nat.div_mul_cancel (gcd_dvd_right m n)).symm⟩ theorem exists_coprime' (H : 0 < gcd m n) : ∃ g m' n', 0 < g ∧ Coprime m' n' ∧ m = m' * g ∧ n = n' * g := let ⟨m', n', h⟩ := exists_coprime m n; ⟨_, m', n', H, h⟩ theorem Coprime.mul (H1 : Coprime m k) (H2 : Coprime n k) : Coprime (m * n) k := (H1.gcd_mul_left_cancel n).trans H2 theorem Coprime.mul_right (H1 : Coprime k m) (H2 : Coprime k n) : Coprime k (m * n) := (H1.symm.mul H2.symm).symm theorem Coprime.coprime_dvd_left (H1 : m ∣ k) (H2 : Coprime k n) : Coprime m n := by apply eq_one_of_dvd_one rw [Coprime] at H2 have := Nat.gcd_dvd_gcd_of_dvd_left n H1 rwa [← H2] theorem Coprime.coprime_dvd_right (H1 : n ∣ m) (H2 : Coprime k m) : Coprime k n := (H2.symm.coprime_dvd_left H1).symm theorem Coprime.coprime_mul_left (H : Coprime (k * m) n) : Coprime m n := H.coprime_dvd_left (Nat.dvd_mul_left _ _) theorem Coprime.coprime_mul_right (H : Coprime (m * k) n) : Coprime m n := H.coprime_dvd_left (Nat.dvd_mul_right _ _) theorem Coprime.coprime_mul_left_right (H : Coprime m (k * n)) : Coprime m n := H.coprime_dvd_right (Nat.dvd_mul_left _ _) theorem Coprime.coprime_mul_right_right (H : Coprime m (n * k)) : Coprime m n := H.coprime_dvd_right (Nat.dvd_mul_right _ _)
.lake/packages/batteries/Batteries/Data/Nat/Gcd.lean
108
118
theorem Coprime.coprime_div_left (cmn : Coprime m n) (dvd : a ∣ m) : Coprime (m / a) n := by
match eq_zero_or_pos a with | .inl h0 => rw [h0] at dvd rw [Nat.eq_zero_of_zero_dvd dvd] at cmn ⊢ simp; assumption | .inr hpos => let ⟨k, hk⟩ := dvd rw [hk, Nat.mul_div_cancel_left _ hpos] rw [hk] at cmn exact cmn.coprime_mul_left
false
import Mathlib.CategoryTheory.Preadditive.Yoneda.Basic import Mathlib.CategoryTheory.Preadditive.Injective import Mathlib.Algebra.Category.GroupCat.EpiMono import Mathlib.Algebra.Category.ModuleCat.EpiMono #align_import category_theory.preadditive.yoneda.injective from "leanprover-community/mathlib"@"f8d8465c3c392a93b9ed226956e26dee00975946" universe v u open Opposite namespace CategoryTheory variable {C : Type u} [Category.{v} C] section Preadditive variable [Preadditive C] namespace Injective theorem injective_iff_preservesEpimorphisms_preadditiveYoneda_obj (J : C) : Injective J ↔ (preadditiveYoneda.obj J).PreservesEpimorphisms := by rw [injective_iff_preservesEpimorphisms_yoneda_obj] refine ⟨fun h : (preadditiveYoneda.obj J ⋙ (forget AddCommGroupCat)).PreservesEpimorphisms => ?_, ?_⟩ · exact Functor.preservesEpimorphisms_of_preserves_of_reflects (preadditiveYoneda.obj J) (forget _) · intro exact (inferInstance : (preadditiveYoneda.obj J ⋙ forget _).PreservesEpimorphisms) #align category_theory.injective.injective_iff_preserves_epimorphisms_preadditive_yoneda_obj CategoryTheory.Injective.injective_iff_preservesEpimorphisms_preadditiveYoneda_obj
Mathlib/CategoryTheory/Preadditive/Yoneda/Injective.lean
43
51
theorem injective_iff_preservesEpimorphisms_preadditive_yoneda_obj' (J : C) : Injective J ↔ (preadditiveYonedaObj J).PreservesEpimorphisms := by
rw [injective_iff_preservesEpimorphisms_yoneda_obj] refine ⟨fun h : (preadditiveYonedaObj J ⋙ (forget <| ModuleCat (End J))).PreservesEpimorphisms => ?_, ?_⟩ · exact Functor.preservesEpimorphisms_of_preserves_of_reflects (preadditiveYonedaObj J) (forget _) · intro exact (inferInstance : (preadditiveYonedaObj J ⋙ forget _).PreservesEpimorphisms)
false
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.trigonometric.inverse_deriv from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Classical Topology Filter open Set Filter open scoped Real namespace Real section Arcsin theorem deriv_arcsin_aux {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) : HasStrictDerivAt arcsin (1 / √(1 - x ^ 2)) x ∧ ContDiffAt ℝ ⊤ arcsin x := by cases' h₁.lt_or_lt with h₁ h₁ · have : 1 - x ^ 2 < 0 := by nlinarith [h₁] rw [sqrt_eq_zero'.2 this.le, div_zero] have : arcsin =ᶠ[𝓝 x] fun _ => -(π / 2) := (gt_mem_nhds h₁).mono fun y hy => arcsin_of_le_neg_one hy.le exact ⟨(hasStrictDerivAt_const _ _).congr_of_eventuallyEq this.symm, contDiffAt_const.congr_of_eventuallyEq this⟩ cases' h₂.lt_or_lt with h₂ h₂ · have : 0 < √(1 - x ^ 2) := sqrt_pos.2 (by nlinarith [h₁, h₂]) simp only [← cos_arcsin, one_div] at this ⊢ exact ⟨sinPartialHomeomorph.hasStrictDerivAt_symm ⟨h₁, h₂⟩ this.ne' (hasStrictDerivAt_sin _), sinPartialHomeomorph.contDiffAt_symm_deriv this.ne' ⟨h₁, h₂⟩ (hasDerivAt_sin _) contDiff_sin.contDiffAt⟩ · have : 1 - x ^ 2 < 0 := by nlinarith [h₂] rw [sqrt_eq_zero'.2 this.le, div_zero] have : arcsin =ᶠ[𝓝 x] fun _ => π / 2 := (lt_mem_nhds h₂).mono fun y hy => arcsin_of_one_le hy.le exact ⟨(hasStrictDerivAt_const _ _).congr_of_eventuallyEq this.symm, contDiffAt_const.congr_of_eventuallyEq this⟩ #align real.deriv_arcsin_aux Real.deriv_arcsin_aux theorem hasStrictDerivAt_arcsin {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) : HasStrictDerivAt arcsin (1 / √(1 - x ^ 2)) x := (deriv_arcsin_aux h₁ h₂).1 #align real.has_strict_deriv_at_arcsin Real.hasStrictDerivAt_arcsin theorem hasDerivAt_arcsin {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) : HasDerivAt arcsin (1 / √(1 - x ^ 2)) x := (hasStrictDerivAt_arcsin h₁ h₂).hasDerivAt #align real.has_deriv_at_arcsin Real.hasDerivAt_arcsin theorem contDiffAt_arcsin {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) {n : ℕ∞} : ContDiffAt ℝ n arcsin x := (deriv_arcsin_aux h₁ h₂).2.of_le le_top #align real.cont_diff_at_arcsin Real.contDiffAt_arcsin
Mathlib/Analysis/SpecialFunctions/Trigonometric/InverseDeriv.lean
66
71
theorem hasDerivWithinAt_arcsin_Ici {x : ℝ} (h : x ≠ -1) : HasDerivWithinAt arcsin (1 / √(1 - x ^ 2)) (Ici x) x := by
rcases eq_or_ne x 1 with (rfl | h') · convert (hasDerivWithinAt_const (1 : ℝ) _ (π / 2)).congr _ _ <;> simp (config := { contextual := true }) [arcsin_of_one_le] · exact (hasDerivAt_arcsin h h').hasDerivWithinAt
false
import Mathlib.Data.PNat.Prime import Mathlib.Algebra.IsPrimePow import Mathlib.NumberTheory.Cyclotomic.Basic import Mathlib.RingTheory.Adjoin.PowerBasis import Mathlib.RingTheory.Polynomial.Cyclotomic.Eval import Mathlib.RingTheory.Norm import Mathlib.RingTheory.Polynomial.Cyclotomic.Expand #align_import number_theory.cyclotomic.primitive_roots from "leanprover-community/mathlib"@"5bfbcca0a7ffdd21cf1682e59106d6c942434a32" open Polynomial Algebra Finset FiniteDimensional IsCyclotomicExtension Nat PNat Set open scoped IntermediateField universe u v w z variable {p n : ℕ+} (A : Type w) (B : Type z) (K : Type u) {L : Type v} (C : Type w) variable [CommRing A] [CommRing B] [Algebra A B] [IsCyclotomicExtension {n} A B] section Zeta namespace IsCyclotomicExtension variable (n) noncomputable def zeta : B := (exists_prim_root A <| Set.mem_singleton n : ∃ r : B, IsPrimitiveRoot r n).choose #align is_cyclotomic_extension.zeta IsCyclotomicExtension.zeta @[simp] theorem zeta_spec : IsPrimitiveRoot (zeta n A B) n := Classical.choose_spec (exists_prim_root A (Set.mem_singleton n) : ∃ r : B, IsPrimitiveRoot r n) #align is_cyclotomic_extension.zeta_spec IsCyclotomicExtension.zeta_spec theorem aeval_zeta [IsDomain B] [NeZero ((n : ℕ) : B)] : aeval (zeta n A B) (cyclotomic n A) = 0 := by rw [aeval_def, ← eval_map, ← IsRoot.def, map_cyclotomic, isRoot_cyclotomic_iff] exact zeta_spec n A B #align is_cyclotomic_extension.aeval_zeta IsCyclotomicExtension.aeval_zeta
Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean
98
100
theorem zeta_isRoot [IsDomain B] [NeZero ((n : ℕ) : B)] : IsRoot (cyclotomic n B) (zeta n A B) := by
convert aeval_zeta n A B using 0 rw [IsRoot.def, aeval_def, eval₂_eq_eval_map, map_cyclotomic]
false
import Mathlib.Analysis.Complex.Circle import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup #align_import analysis.complex.isometry from "leanprover-community/mathlib"@"ae690b0c236e488a0043f6faa8ce3546e7f2f9c5" noncomputable section open Complex open ComplexConjugate local notation "|" x "|" => Complex.abs x def rotation : circle →* ℂ ≃ₗᵢ[ℝ] ℂ where toFun a := { DistribMulAction.toLinearEquiv ℝ ℂ a with norm_map' := fun x => show |a * x| = |x| by rw [map_mul, abs_coe_circle, one_mul] } map_one' := LinearIsometryEquiv.ext <| one_smul circle map_mul' a b := LinearIsometryEquiv.ext <| mul_smul a b #align rotation rotation @[simp] theorem rotation_apply (a : circle) (z : ℂ) : rotation a z = a * z := rfl #align rotation_apply rotation_apply @[simp] theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹ := LinearIsometryEquiv.ext fun _ => rfl #align rotation_symm rotation_symm @[simp] theorem rotation_trans (a b : circle) : (rotation a).trans (rotation b) = rotation (b * a) := by ext1 simp #align rotation_trans rotation_trans
Mathlib/Analysis/Complex/Isometry.lean
65
71
theorem rotation_ne_conjLIE (a : circle) : rotation a ≠ conjLIE := by
intro h have h1 : rotation a 1 = conj 1 := LinearIsometryEquiv.congr_fun h 1 have hI : rotation a I = conj I := LinearIsometryEquiv.congr_fun h I rw [rotation_apply, RingHom.map_one, mul_one] at h1 rw [rotation_apply, conj_I, ← neg_one_mul, mul_left_inj' I_ne_zero, h1, eq_neg_self_iff] at hI exact one_ne_zero hI
false
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
Mathlib/NumberTheory/NumberField/Norm.lean
90
99
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)]
false
import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Data.SetLike.Fintype import Mathlib.GroupTheory.GroupAction.ConjAct import Mathlib.GroupTheory.PGroup import Mathlib.GroupTheory.NoncommPiCoprod import Mathlib.Order.Atoms.Finite import Mathlib.Data.Set.Lattice #align_import group_theory.sylow from "leanprover-community/mathlib"@"4be589053caf347b899a494da75410deb55fb3ef" open Fintype MulAction Subgroup section InfiniteSylow variable (p : ℕ) (G : Type*) [Group G] structure Sylow extends Subgroup G where isPGroup' : IsPGroup p toSubgroup is_maximal' : ∀ {Q : Subgroup G}, IsPGroup p Q → toSubgroup ≤ Q → Q = toSubgroup #align sylow Sylow variable {p} {G} open Equiv Equiv.Perm Finset Function List QuotientGroup universe u v w variable {G : Type u} {α : Type v} {β : Type w} [Group G] attribute [local instance 10] Subtype.fintype setFintype Classical.propDecidable theorem QuotientGroup.card_preimage_mk [Fintype G] (s : Subgroup G) (t : Set (G ⧸ s)) : Fintype.card (QuotientGroup.mk ⁻¹' t) = Fintype.card s * Fintype.card t := by rw [← Fintype.card_prod, Fintype.card_congr (preimageMkEquivSubgroupProdSet _ _)] #align quotient_group.card_preimage_mk QuotientGroup.card_preimage_mk namespace Sylow theorem mem_fixedPoints_mul_left_cosets_iff_mem_normalizer {H : Subgroup G} [Finite (H : Set G)] {x : G} : (x : G ⧸ H) ∈ MulAction.fixedPoints H (G ⧸ H) ↔ x ∈ normalizer H := ⟨fun hx => have ha : ∀ {y : G ⧸ H}, y ∈ orbit H (x : G ⧸ H) → y = x := mem_fixedPoints'.1 hx _ (inv_mem_iff (G := G)).1 (mem_normalizer_fintype fun n (hn : n ∈ H) => have : (n⁻¹ * x)⁻¹ * x ∈ H := QuotientGroup.eq.1 (ha ⟨⟨n⁻¹, inv_mem hn⟩, rfl⟩) show _ ∈ H by rw [mul_inv_rev, inv_inv] at this convert this rw [inv_inv]), fun hx : ∀ n : G, n ∈ H ↔ x * n * x⁻¹ ∈ H => mem_fixedPoints'.2 fun y => Quotient.inductionOn' y fun y hy => QuotientGroup.eq.2 (let ⟨⟨b, hb₁⟩, hb₂⟩ := hy have hb₂ : (b * x)⁻¹ * y ∈ H := QuotientGroup.eq.1 hb₂ (inv_mem_iff (G := G)).1 <| (hx _).2 <| (mul_mem_cancel_left (inv_mem hb₁)).1 <| by rw [hx] at hb₂; simpa [mul_inv_rev, mul_assoc] using hb₂)⟩ #align sylow.mem_fixed_points_mul_left_cosets_iff_mem_normalizer Sylow.mem_fixedPoints_mul_left_cosets_iff_mem_normalizer def fixedPointsMulLeftCosetsEquivQuotient (H : Subgroup G) [Finite (H : Set G)] : MulAction.fixedPoints H (G ⧸ H) ≃ normalizer H ⧸ Subgroup.comap ((normalizer H).subtype : normalizer H →* G) H := @subtypeQuotientEquivQuotientSubtype G (normalizer H : Set G) (_) (_) (MulAction.fixedPoints H (G ⧸ H)) (fun a => (@mem_fixedPoints_mul_left_cosets_iff_mem_normalizer _ _ _ ‹_› _).symm) (by intros unfold_projs rw [leftRel_apply (α := normalizer H), leftRel_apply] rfl) #align sylow.fixed_points_mul_left_cosets_equiv_quotient Sylow.fixedPointsMulLeftCosetsEquivQuotient theorem card_quotient_normalizer_modEq_card_quotient [Fintype G] {p : ℕ} {n : ℕ} [hp : Fact p.Prime] {H : Subgroup G} (hH : Fintype.card H = p ^ n) : Fintype.card (normalizer H ⧸ Subgroup.comap ((normalizer H).subtype : normalizer H →* G) H) ≡ card (G ⧸ H) [MOD p] := by rw [← Fintype.card_congr (fixedPointsMulLeftCosetsEquivQuotient H)] exact ((IsPGroup.of_card hH).card_modEq_card_fixedPoints _).symm #align sylow.card_quotient_normalizer_modeq_card_quotient Sylow.card_quotient_normalizer_modEq_card_quotient
Mathlib/GroupTheory/Sylow.lean
548
556
theorem card_normalizer_modEq_card [Fintype G] {p : ℕ} {n : ℕ} [hp : Fact p.Prime] {H : Subgroup G} (hH : Fintype.card H = p ^ n) : card (normalizer H) ≡ card G [MOD p ^ (n + 1)] := by
have : H.subgroupOf (normalizer H) ≃ H := (subgroupOfEquivOfLe le_normalizer).toEquiv simp only [← Nat.card_eq_fintype_card] at hH ⊢ rw [card_eq_card_quotient_mul_card_subgroup H, card_eq_card_quotient_mul_card_subgroup (H.subgroupOf (normalizer H)), Nat.card_congr this, hH, pow_succ'] simp only [Nat.card_eq_fintype_card] at hH ⊢ exact (card_quotient_normalizer_modEq_card_quotient hH).mul_right' _
false
import Mathlib.Data.Nat.Cast.WithTop import Mathlib.RingTheory.Prime import Mathlib.RingTheory.Polynomial.Content import Mathlib.RingTheory.Ideal.Quotient #align_import ring_theory.eisenstein_criterion from "leanprover-community/mathlib"@"da420a8c6dd5bdfb85c4ced85c34388f633bc6ff" open Polynomial Ideal.Quotient variable {R : Type*} [CommRing R] namespace Polynomial open Polynomial namespace EisensteinCriterionAux -- Section for auxiliary lemmas used in the proof of `irreducible_of_eisenstein_criterion` theorem map_eq_C_mul_X_pow_of_forall_coeff_mem {f : R[X]} {P : Ideal R} (hfP : ∀ n : ℕ, ↑n < f.degree → f.coeff n ∈ P) : map (mk P) f = C ((mk P) f.leadingCoeff) * X ^ f.natDegree := Polynomial.ext fun n => by by_cases hf0 : f = 0 · simp [hf0] rcases lt_trichotomy (n : WithBot ℕ) (degree f) with (h | h | h) · erw [coeff_map, eq_zero_iff_mem.2 (hfP n h), coeff_C_mul, coeff_X_pow, if_neg, mul_zero] rintro rfl exact not_lt_of_ge degree_le_natDegree h · have : natDegree f = n := natDegree_eq_of_degree_eq_some h.symm rw [coeff_C_mul, coeff_X_pow, if_pos this.symm, mul_one, leadingCoeff, this, coeff_map] · rw [coeff_eq_zero_of_degree_lt, coeff_eq_zero_of_degree_lt] · refine lt_of_le_of_lt (degree_C_mul_X_pow_le _ _) ?_ rwa [← degree_eq_natDegree hf0] · exact lt_of_le_of_lt (degree_map_le _ _) h set_option linter.uppercaseLean3 false in #align polynomial.eisenstein_criterion_aux.map_eq_C_mul_X_pow_of_forall_coeff_mem Polynomial.EisensteinCriterionAux.map_eq_C_mul_X_pow_of_forall_coeff_mem theorem le_natDegree_of_map_eq_mul_X_pow {n : ℕ} {P : Ideal R} (hP : P.IsPrime) {q : R[X]} {c : Polynomial (R ⧸ P)} (hq : map (mk P) q = c * X ^ n) (hc0 : c.degree = 0) : n ≤ q.natDegree := Nat.cast_le.1 (calc ↑n = degree (q.map (mk P)) := by rw [hq, degree_mul, hc0, zero_add, degree_pow, degree_X, nsmul_one] _ ≤ degree q := degree_map_le _ _ _ ≤ natDegree q := degree_le_natDegree ) set_option linter.uppercaseLean3 false in #align polynomial.eisenstein_criterion_aux.le_nat_degree_of_map_eq_mul_X_pow Polynomial.EisensteinCriterionAux.le_natDegree_of_map_eq_mul_X_pow theorem eval_zero_mem_ideal_of_eq_mul_X_pow {n : ℕ} {P : Ideal R} {q : R[X]} {c : Polynomial (R ⧸ P)} (hq : map (mk P) q = c * X ^ n) (hn0 : n ≠ 0) : eval 0 q ∈ P := by rw [← coeff_zero_eq_eval_zero, ← eq_zero_iff_mem, ← coeff_map, hq, coeff_zero_eq_eval_zero, eval_mul, eval_pow, eval_X, zero_pow hn0, mul_zero] set_option linter.uppercaseLean3 false in #align polynomial.eisenstein_criterion_aux.eval_zero_mem_ideal_of_eq_mul_X_pow Polynomial.EisensteinCriterionAux.eval_zero_mem_ideal_of_eq_mul_X_pow
Mathlib/RingTheory/EisensteinCriterion.lean
72
78
theorem isUnit_of_natDegree_eq_zero_of_isPrimitive {p q : R[X]} -- Porting note: stated using `IsPrimitive` which is defeq to old statement. (hu : IsPrimitive (p * q)) (hpm : p.natDegree = 0) : IsUnit p := by
rw [eq_C_of_degree_le_zero (natDegree_eq_zero_iff_degree_le_zero.1 hpm), isUnit_C] refine hu _ ?_ rw [← eq_C_of_degree_le_zero (natDegree_eq_zero_iff_degree_le_zero.1 hpm)] exact dvd_mul_right _ _
false
import Mathlib.Data.Finset.Pointwise #align_import combinatorics.additive.e_transform from "leanprover-community/mathlib"@"207c92594599a06e7c134f8d00a030a83e6c7259" open MulOpposite open Pointwise variable {α : Type*} [DecidableEq α] namespace Finset section CommGroup variable [CommGroup α] (e : α) (x : Finset α × Finset α) @[to_additive (attr := simps) "The **Dyson e-transform**. Turns `(s, t)` into `(s ∪ e +ᵥ t, t ∩ -e +ᵥ s)`. This reduces the sum of the two sets."] def mulDysonETransform : Finset α × Finset α := (x.1 ∪ e • x.2, x.2 ∩ e⁻¹ • x.1) #align finset.mul_dyson_e_transform Finset.mulDysonETransform #align finset.add_dyson_e_transform Finset.addDysonETransform @[to_additive] theorem mulDysonETransform.subset : (mulDysonETransform e x).1 * (mulDysonETransform e x).2 ⊆ x.1 * x.2 := by refine union_mul_inter_subset_union.trans (union_subset Subset.rfl ?_) rw [mul_smul_comm, smul_mul_assoc, inv_smul_smul, mul_comm] #align finset.mul_dyson_e_transform.subset Finset.mulDysonETransform.subset #align finset.add_dyson_e_transform.subset Finset.addDysonETransform.subset @[to_additive] theorem mulDysonETransform.card : (mulDysonETransform e x).1.card + (mulDysonETransform e x).2.card = x.1.card + x.2.card := by dsimp rw [← card_smul_finset e (_ ∩ _), smul_finset_inter, smul_inv_smul, inter_comm, card_union_add_card_inter, card_smul_finset] #align finset.mul_dyson_e_transform.card Finset.mulDysonETransform.card #align finset.add_dyson_e_transform.card Finset.addDysonETransform.card @[to_additive (attr := simp)] theorem mulDysonETransform_idem : mulDysonETransform e (mulDysonETransform e x) = mulDysonETransform e x := by ext : 1 <;> dsimp · rw [smul_finset_inter, smul_inv_smul, inter_comm, union_eq_left] exact inter_subset_union · rw [smul_finset_union, inv_smul_smul, union_comm, inter_eq_left] exact inter_subset_union #align finset.mul_dyson_e_transform_idem Finset.mulDysonETransform_idem #align finset.add_dyson_e_transform_idem Finset.addDysonETransform_idem variable {e x} @[to_additive]
Mathlib/Combinatorics/Additive/ETransform.lean
88
92
theorem mulDysonETransform.smul_finset_snd_subset_fst : e • (mulDysonETransform e x).2 ⊆ (mulDysonETransform e x).1 := by
dsimp rw [smul_finset_inter, smul_inv_smul, inter_comm] exact inter_subset_union
false
import Mathlib.Logic.Relation import Mathlib.Data.List.Forall2 import Mathlib.Data.List.Lex import Mathlib.Data.List.Infix #align_import data.list.chain from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" -- Make sure we haven't imported `Data.Nat.Order.Basic` assert_not_exists OrderedSub universe u v open Nat namespace List variable {α : Type u} {β : Type v} {R r : α → α → Prop} {l l₁ l₂ : List α} {a b : α} mk_iff_of_inductive_prop List.Chain List.chain_iff #align list.chain_iff List.chain_iff #align list.chain.nil List.Chain.nil #align list.chain.cons List.Chain.cons #align list.rel_of_chain_cons List.rel_of_chain_cons #align list.chain_of_chain_cons List.chain_of_chain_cons #align list.chain.imp' List.Chain.imp' #align list.chain.imp List.Chain.imp theorem Chain.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {a : α} {l : List α} : Chain R a l ↔ Chain S a l := ⟨Chain.imp fun a b => (H a b).1, Chain.imp fun a b => (H a b).2⟩ #align list.chain.iff List.Chain.iff theorem Chain.iff_mem {a : α} {l : List α} : Chain R a l ↔ Chain (fun x y => x ∈ a :: l ∧ y ∈ l ∧ R x y) a l := ⟨fun p => by induction' p with _ a b l r _ IH <;> constructor <;> [exact ⟨mem_cons_self _ _, mem_cons_self _ _, r⟩; exact IH.imp fun a b ⟨am, bm, h⟩ => ⟨mem_cons_of_mem _ am, mem_cons_of_mem _ bm, h⟩], Chain.imp fun a b h => h.2.2⟩ #align list.chain.iff_mem List.Chain.iff_mem theorem chain_singleton {a b : α} : Chain R a [b] ↔ R a b := by simp only [chain_cons, Chain.nil, and_true_iff] #align list.chain_singleton List.chain_singleton theorem chain_split {a b : α} {l₁ l₂ : List α} : Chain R a (l₁ ++ b :: l₂) ↔ Chain R a (l₁ ++ [b]) ∧ Chain R b l₂ := by induction' l₁ with x l₁ IH generalizing a <;> simp only [*, nil_append, cons_append, Chain.nil, chain_cons, and_true_iff, and_assoc] #align list.chain_split List.chain_split @[simp] theorem chain_append_cons_cons {a b c : α} {l₁ l₂ : List α} : Chain R a (l₁ ++ b :: c :: l₂) ↔ Chain R a (l₁ ++ [b]) ∧ R b c ∧ Chain R c l₂ := by rw [chain_split, chain_cons] #align list.chain_append_cons_cons List.chain_append_cons_cons theorem chain_iff_forall₂ : ∀ {a : α} {l : List α}, Chain R a l ↔ l = [] ∨ Forall₂ R (a :: dropLast l) l | a, [] => by simp | a, b :: l => by by_cases h : l = [] <;> simp [@chain_iff_forall₂ b l, dropLast, *] #align list.chain_iff_forall₂ List.chain_iff_forall₂
Mathlib/Data/List/Chain.lean
82
83
theorem chain_append_singleton_iff_forall₂ : Chain R a (l ++ [b]) ↔ Forall₂ R (a :: l) (l ++ [b]) := by
simp [chain_iff_forall₂]
false
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] 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] #align Mon_.one_mul_hom Mon_.one_mul_hom @[simp] theorem mul_one_hom {Z : C} (f : Z ⟶ M.X) : (f ⊗ M.one) ≫ M.mul = (ρ_ Z).hom ≫ f := by rw [tensorHom_def_assoc, M.mul_one, rightUnitor_naturality] #align Mon_.mul_one_hom Mon_.mul_one_hom
Mathlib/CategoryTheory/Monoidal/Mon_.lean
84
85
theorem assoc_flip : (M.X ◁ M.mul) ≫ M.mul = (α_ M.X M.X M.X).inv ≫ (M.mul ▷ M.X) ≫ M.mul := by
simp
false
import Mathlib.CategoryTheory.Subobject.Limits #align_import algebra.homology.image_to_kernel from "leanprover-community/mathlib"@"618ea3d5c99240cd7000d8376924906a148bf9ff" universe v u w open CategoryTheory CategoryTheory.Limits variable {ι : Type*} variable {V : Type u} [Category.{v} V] [HasZeroMorphisms V] open scoped Classical noncomputable section section variable {A B C : V} (f : A ⟶ B) [HasImage f] (g : B ⟶ C) [HasKernel g] theorem image_le_kernel (w : f ≫ g = 0) : imageSubobject f ≤ kernelSubobject g := imageSubobject_le_mk _ _ (kernel.lift _ _ w) (by simp) #align image_le_kernel image_le_kernel def imageToKernel (w : f ≫ g = 0) : (imageSubobject f : V) ⟶ (kernelSubobject g : V) := Subobject.ofLE _ _ (image_le_kernel _ _ w) #align image_to_kernel imageToKernel instance (w : f ≫ g = 0) : Mono (imageToKernel f g w) := by dsimp only [imageToKernel] infer_instance @[simp] theorem subobject_ofLE_as_imageToKernel (w : f ≫ g = 0) (h) : Subobject.ofLE (imageSubobject f) (kernelSubobject g) h = imageToKernel f g w := rfl #align subobject_of_le_as_image_to_kernel subobject_ofLE_as_imageToKernel attribute [local instance] ConcreteCategory.instFunLike -- Porting note: removed elementwise attribute which does not seem to be helpful here -- a more suitable lemma is added below @[reassoc (attr := simp)] theorem imageToKernel_arrow (w : f ≫ g = 0) : imageToKernel f g w ≫ (kernelSubobject g).arrow = (imageSubobject f).arrow := by simp [imageToKernel] #align image_to_kernel_arrow imageToKernel_arrow @[simp] lemma imageToKernel_arrow_apply [ConcreteCategory V] (w : f ≫ g = 0) (x : (forget V).obj (Subobject.underlying.obj (imageSubobject f))) : (kernelSubobject g).arrow (imageToKernel f g w x) = (imageSubobject f).arrow x := by rw [← comp_apply, imageToKernel_arrow] -- This is less useful as a `simp` lemma than it initially appears, -- as it "loses" the information the morphism factors through the image. theorem factorThruImageSubobject_comp_imageToKernel (w : f ≫ g = 0) : factorThruImageSubobject f ≫ imageToKernel f g w = factorThruKernelSubobject g f w := by ext simp #align factor_thru_image_subobject_comp_image_to_kernel factorThruImageSubobject_comp_imageToKernel end section variable {A B C : V} (f : A ⟶ B) (g : B ⟶ C) @[simp] theorem imageToKernel_zero_left [HasKernels V] [HasZeroObject V] {w} : imageToKernel (0 : A ⟶ B) g w = 0 := by ext simp #align image_to_kernel_zero_left imageToKernel_zero_left theorem imageToKernel_zero_right [HasImages V] {w} : imageToKernel f (0 : B ⟶ C) w = (imageSubobject f).arrow ≫ inv (kernelSubobject (0 : B ⟶ C)).arrow := by ext simp #align image_to_kernel_zero_right imageToKernel_zero_right section variable [HasKernels V] [HasImages V] theorem imageToKernel_comp_right {D : V} (h : C ⟶ D) (w : f ≫ g = 0) : imageToKernel f (g ≫ h) (by simp [reassoc_of% w]) = imageToKernel f g w ≫ Subobject.ofLE _ _ (kernelSubobject_comp_le g h) := by ext simp #align image_to_kernel_comp_right imageToKernel_comp_right theorem imageToKernel_comp_left {Z : V} (h : Z ⟶ A) (w : f ≫ g = 0) : imageToKernel (h ≫ f) g (by simp [w]) = Subobject.ofLE _ _ (imageSubobject_comp_le h f) ≫ imageToKernel f g w := by ext simp #align image_to_kernel_comp_left imageToKernel_comp_left @[simp]
Mathlib/Algebra/Homology/ImageToKernel.lean
127
132
theorem imageToKernel_comp_mono {D : V} (h : C ⟶ D) [Mono h] (w) : imageToKernel f (g ≫ h) w = imageToKernel f g ((cancel_mono h).mp (by simpa using w : (f ≫ g) ≫ h = 0 ≫ h)) ≫ (Subobject.isoOfEq _ _ (kernelSubobject_comp_mono g h)).inv := by
ext simp
false
import Mathlib.MeasureTheory.Decomposition.RadonNikodym import Mathlib.MeasureTheory.Measure.Haar.OfBasis import Mathlib.Probability.Independence.Basic #align_import probability.density from "leanprover-community/mathlib"@"c14c8fcde993801fca8946b0d80131a1a81d1520" open scoped Classical MeasureTheory NNReal ENNReal open TopologicalSpace MeasureTheory.Measure noncomputable section namespace MeasureTheory variable {Ω E : Type*} [MeasurableSpace E] class HasPDF {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E := by volume_tac) : Prop where pdf' : AEMeasurable X ℙ ∧ (map X ℙ).HaveLebesgueDecomposition μ ∧ map X ℙ ≪ μ #align measure_theory.has_pdf MeasureTheory.HasPDF section HasPDF variable {_ : MeasurableSpace Ω} theorem hasPDF_iff {X : Ω → E} {ℙ : Measure Ω} {μ : Measure E} : HasPDF X ℙ μ ↔ AEMeasurable X ℙ ∧ (map X ℙ).HaveLebesgueDecomposition μ ∧ map X ℙ ≪ μ := ⟨@HasPDF.pdf' _ _ _ _ _ _ _, HasPDF.mk⟩ #align measure_theory.pdf.has_pdf_iff MeasureTheory.hasPDF_iff theorem hasPDF_iff_of_aemeasurable {X : Ω → E} {ℙ : Measure Ω} {μ : Measure E} (hX : AEMeasurable X ℙ) : HasPDF X ℙ μ ↔ (map X ℙ).HaveLebesgueDecomposition μ ∧ map X ℙ ≪ μ := by rw [hasPDF_iff] simp only [hX, true_and] #align measure_theory.pdf.has_pdf_iff_of_measurable MeasureTheory.hasPDF_iff_of_aemeasurable @[measurability] theorem HasPDF.aemeasurable (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E) [hX : HasPDF X ℙ μ] : AEMeasurable X ℙ := hX.pdf'.1 #align measure_theory.has_pdf.measurable MeasureTheory.HasPDF.aemeasurable instance HasPDF.haveLebesgueDecomposition {X : Ω → E} {ℙ : Measure Ω} {μ : Measure E} [hX : HasPDF X ℙ μ] : (map X ℙ).HaveLebesgueDecomposition μ := hX.pdf'.2.1 #align measure_theory.pdf.have_lebesgue_decomposition_of_has_pdf MeasureTheory.HasPDF.haveLebesgueDecomposition theorem HasPDF.absolutelyContinuous {X : Ω → E} {ℙ : Measure Ω} {μ : Measure E} [hX : HasPDF X ℙ μ] : map X ℙ ≪ μ := hX.pdf'.2.2 #align measure_theory.pdf.map_absolutely_continuous MeasureTheory.HasPDF.absolutelyContinuous theorem HasPDF.quasiMeasurePreserving_of_measurable (X : Ω → E) (ℙ : Measure Ω) (μ : Measure E) [HasPDF X ℙ μ] (h : Measurable X) : QuasiMeasurePreserving X ℙ μ := { measurable := h absolutelyContinuous := HasPDF.absolutelyContinuous } #align measure_theory.pdf.to_quasi_measure_preserving MeasureTheory.HasPDF.quasiMeasurePreserving_of_measurable theorem HasPDF.congr {X Y : Ω → E} {ℙ : Measure Ω} {μ : Measure E} (hXY : X =ᵐ[ℙ] Y) [hX : HasPDF X ℙ μ] : HasPDF Y ℙ μ := ⟨(HasPDF.aemeasurable X ℙ μ).congr hXY, ℙ.map_congr hXY ▸ hX.haveLebesgueDecomposition, ℙ.map_congr hXY ▸ hX.absolutelyContinuous⟩ theorem HasPDF.congr' {X Y : Ω → E} {ℙ : Measure Ω} {μ : Measure E} (hXY : X =ᵐ[ℙ] Y) : HasPDF X ℙ μ ↔ HasPDF Y ℙ μ := ⟨fun _ ↦ HasPDF.congr hXY, fun _ ↦ HasPDF.congr hXY.symm⟩
Mathlib/Probability/Density.lean
122
128
theorem hasPDF_of_map_eq_withDensity {X : Ω → E} {ℙ : Measure Ω} {μ : Measure E} (hX : AEMeasurable X ℙ) (f : E → ℝ≥0∞) (hf : AEMeasurable f μ) (h : map X ℙ = μ.withDensity f) : HasPDF X ℙ μ := by
refine ⟨hX, ?_, ?_⟩ <;> rw [h] · rw [withDensity_congr_ae hf.ae_eq_mk] exact haveLebesgueDecomposition_withDensity μ hf.measurable_mk · exact withDensity_absolutelyContinuous μ f
false
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 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] #align polynomial.coeff_hermite_of_lt Polynomial.coeff_hermite_of_lt @[simp]
Mathlib/RingTheory/Polynomial/Hermite/Basic.lean
103
107
theorem coeff_hermite_self (n : ℕ) : coeff (hermite n) n = 1 := by
induction' n with n ih · apply coeff_C · rw [coeff_hermite_succ_succ, ih, coeff_hermite_of_lt, mul_zero, sub_zero] simp
false
import Mathlib.Analysis.Convex.Gauge import Mathlib.Analysis.Convex.Normed open Metric Bornology Filter Set open scoped NNReal Topology Pointwise noncomputable section section Module variable {E : Type*} [AddCommGroup E] [Module ℝ E] def gaugeRescale (s t : Set E) (x : E) : E := (gauge s x / gauge t x) • x theorem gaugeRescale_def (s t : Set E) (x : E) : gaugeRescale s t x = (gauge s x / gauge t x) • x := rfl @[simp] theorem gaugeRescale_zero (s t : Set E) : gaugeRescale s t 0 = 0 := smul_zero _ theorem gaugeRescale_smul (s t : Set E) {c : ℝ} (hc : 0 ≤ c) (x : E) : gaugeRescale s t (c • x) = c • gaugeRescale s t x := by simp only [gaugeRescale, gauge_smul_of_nonneg hc, smul_smul, smul_eq_mul] rw [mul_div_mul_comm, mul_right_comm, div_self_mul_self] variable [TopologicalSpace E] [T1Space E]
Mathlib/Analysis/Convex/GaugeRescale.lean
48
52
theorem gaugeRescale_self_apply {s : Set E} (hsa : Absorbent ℝ s) (hsb : IsVonNBounded ℝ s) (x : E) : gaugeRescale s s x = x := by
rcases eq_or_ne x 0 with rfl | hx; · simp rw [gaugeRescale, div_self, one_smul] exact ((gauge_pos hsa hsb).2 hx).ne'
false
import Mathlib.CategoryTheory.Sites.Sieves #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v₁ v₂ u₁ u₂ namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Presieve variable {C : Type u₁} [Category.{v₁} C] variable {P Q U : Cᵒᵖ ⥤ Type w} variable {X Y : C} {S : Sieve X} {R : Presieve X} def FamilyOfElements (P : Cᵒᵖ ⥤ Type w) (R : Presieve X) := ∀ ⦃Y : C⦄ (f : Y ⟶ X), R f → P.obj (op Y) #align category_theory.presieve.family_of_elements CategoryTheory.Presieve.FamilyOfElements instance : Inhabited (FamilyOfElements P (⊥ : Presieve X)) := ⟨fun _ _ => False.elim⟩ def FamilyOfElements.restrict {R₁ R₂ : Presieve X} (h : R₁ ≤ R₂) : FamilyOfElements P R₂ → FamilyOfElements P R₁ := fun x _ f hf => x f (h _ hf) #align category_theory.presieve.family_of_elements.restrict CategoryTheory.Presieve.FamilyOfElements.restrict def FamilyOfElements.map (p : FamilyOfElements P R) (φ : P ⟶ Q) : FamilyOfElements Q R := fun _ f hf => φ.app _ (p f hf) @[simp] lemma FamilyOfElements.map_apply (p : FamilyOfElements P R) (φ : P ⟶ Q) {Y : C} (f : Y ⟶ X) (hf : R f) : p.map φ f hf = φ.app _ (p f hf) := rfl lemma FamilyOfElements.restrict_map (p : FamilyOfElements P R) (φ : P ⟶ Q) {R' : Presieve X} (h : R' ≤ R) : (p.restrict h).map φ = (p.map φ).restrict h := rfl def FamilyOfElements.Compatible (x : FamilyOfElements P R) : Prop := ∀ ⦃Y₁ Y₂ Z⦄ (g₁ : Z ⟶ Y₁) (g₂ : Z ⟶ Y₂) ⦃f₁ : Y₁ ⟶ X⦄ ⦃f₂ : Y₂ ⟶ X⦄ (h₁ : R f₁) (h₂ : R f₂), g₁ ≫ f₁ = g₂ ≫ f₂ → P.map g₁.op (x f₁ h₁) = P.map g₂.op (x f₂ h₂) #align category_theory.presieve.family_of_elements.compatible CategoryTheory.Presieve.FamilyOfElements.Compatible def FamilyOfElements.PullbackCompatible (x : FamilyOfElements P R) [R.hasPullbacks] : Prop := ∀ ⦃Y₁ Y₂⦄ ⦃f₁ : Y₁ ⟶ X⦄ ⦃f₂ : Y₂ ⟶ X⦄ (h₁ : R f₁) (h₂ : R f₂), haveI := hasPullbacks.has_pullbacks h₁ h₂ P.map (pullback.fst : Limits.pullback f₁ f₂ ⟶ _).op (x f₁ h₁) = P.map pullback.snd.op (x f₂ h₂) #align category_theory.presieve.family_of_elements.pullback_compatible CategoryTheory.Presieve.FamilyOfElements.PullbackCompatible theorem pullbackCompatible_iff (x : FamilyOfElements P R) [R.hasPullbacks] : x.Compatible ↔ x.PullbackCompatible := by constructor · intro t Y₁ Y₂ f₁ f₂ hf₁ hf₂ apply t haveI := hasPullbacks.has_pullbacks hf₁ hf₂ apply pullback.condition · intro t Y₁ Y₂ Z g₁ g₂ f₁ f₂ hf₁ hf₂ comm haveI := hasPullbacks.has_pullbacks hf₁ hf₂ rw [← pullback.lift_fst _ _ comm, op_comp, FunctorToTypes.map_comp_apply, t hf₁ hf₂, ← FunctorToTypes.map_comp_apply, ← op_comp, pullback.lift_snd] #align category_theory.presieve.pullback_compatible_iff CategoryTheory.Presieve.pullbackCompatible_iff theorem FamilyOfElements.Compatible.restrict {R₁ R₂ : Presieve X} (h : R₁ ≤ R₂) {x : FamilyOfElements P R₂} : x.Compatible → (x.restrict h).Compatible := fun q _ _ _ g₁ g₂ _ _ h₁ h₂ comm => q g₁ g₂ (h _ h₁) (h _ h₂) comm #align category_theory.presieve.family_of_elements.compatible.restrict CategoryTheory.Presieve.FamilyOfElements.Compatible.restrict noncomputable def FamilyOfElements.sieveExtend (x : FamilyOfElements P R) : FamilyOfElements P (generate R : Presieve X) := fun _ _ hf => P.map hf.choose_spec.choose.op (x _ hf.choose_spec.choose_spec.choose_spec.1) #align category_theory.presieve.family_of_elements.sieve_extend CategoryTheory.Presieve.FamilyOfElements.sieveExtend theorem FamilyOfElements.Compatible.sieveExtend {x : FamilyOfElements P R} (hx : x.Compatible) : x.sieveExtend.Compatible := by intro _ _ _ _ _ _ _ h₁ h₂ comm iterate 2 erw [← FunctorToTypes.map_comp_apply]; rw [← op_comp] apply hx simp [comm, h₁.choose_spec.choose_spec.choose_spec.2, h₂.choose_spec.choose_spec.choose_spec.2] #align category_theory.presieve.family_of_elements.compatible.sieve_extend CategoryTheory.Presieve.FamilyOfElements.Compatible.sieveExtend
Mathlib/CategoryTheory/Sites/IsSheafFor.lean
195
202
theorem extend_agrees {x : FamilyOfElements P R} (t : x.Compatible) {f : Y ⟶ X} (hf : R f) : x.sieveExtend f (le_generate R Y hf) = x f hf := by
have h := (le_generate R Y hf).choose_spec unfold FamilyOfElements.sieveExtend rw [t h.choose (𝟙 _) _ hf _] · simp · rw [id_comp] exact h.choose_spec.choose_spec.2
false
import Mathlib.Algebra.Group.Equiv.Basic import Mathlib.Algebra.Group.Aut import Mathlib.Data.ZMod.Defs import Mathlib.Tactic.Ring #align_import algebra.quandle from "leanprover-community/mathlib"@"28aa996fc6fb4317f0083c4e6daf79878d81be33" open MulOpposite universe u v class Shelf (α : Type u) where act : α → α → α self_distrib : ∀ {x y z : α}, act x (act y z) = act (act x y) (act x z) #align shelf Shelf class UnitalShelf (α : Type u) extends Shelf α, One α := (one_act : ∀ a : α, act 1 a = a) (act_one : ∀ a : α, act a 1 = a) #align unital_shelf UnitalShelf @[ext] structure ShelfHom (S₁ : Type*) (S₂ : Type*) [Shelf S₁] [Shelf S₂] where toFun : S₁ → S₂ map_act' : ∀ {x y : S₁}, toFun (Shelf.act x y) = Shelf.act (toFun x) (toFun y) #align shelf_hom ShelfHom #align shelf_hom.ext_iff ShelfHom.ext_iff #align shelf_hom.ext ShelfHom.ext class Rack (α : Type u) extends Shelf α where invAct : α → α → α left_inv : ∀ x, Function.LeftInverse (invAct x) (act x) right_inv : ∀ x, Function.RightInverse (invAct x) (act x) #align rack Rack scoped[Quandles] infixr:65 " ◃ " => Shelf.act scoped[Quandles] infixr:65 " ◃⁻¹ " => Rack.invAct scoped[Quandles] infixr:25 " →◃ " => ShelfHom open Quandles namespace Rack variable {R : Type*} [Rack R] -- Porting note: No longer a need for `Rack.self_distrib` export Shelf (self_distrib) -- porting note, changed name to `act'` to not conflict with `Shelf.act` def act' (x : R) : R ≃ R where toFun := Shelf.act x invFun := invAct x left_inv := left_inv x right_inv := right_inv x #align rack.act Rack.act' @[simp] theorem act'_apply (x y : R) : act' x y = x ◃ y := rfl #align rack.act_apply Rack.act'_apply @[simp] theorem act'_symm_apply (x y : R) : (act' x).symm y = x ◃⁻¹ y := rfl #align rack.act_symm_apply Rack.act'_symm_apply @[simp] theorem invAct_apply (x y : R) : (act' x)⁻¹ y = x ◃⁻¹ y := rfl #align rack.inv_act_apply Rack.invAct_apply @[simp] theorem invAct_act_eq (x y : R) : x ◃⁻¹ x ◃ y = y := left_inv x y #align rack.inv_act_act_eq Rack.invAct_act_eq @[simp] theorem act_invAct_eq (x y : R) : x ◃ x ◃⁻¹ y = y := right_inv x y #align rack.act_inv_act_eq Rack.act_invAct_eq theorem left_cancel (x : R) {y y' : R} : x ◃ y = x ◃ y' ↔ y = y' := by constructor · apply (act' x).injective rintro rfl rfl #align rack.left_cancel Rack.left_cancel
Mathlib/Algebra/Quandle.lean
232
236
theorem left_cancel_inv (x : R) {y y' : R} : x ◃⁻¹ y = x ◃⁻¹ y' ↔ y = y' := by
constructor · apply (act' x).symm.injective rintro rfl rfl
false
import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.Data.Set.Finite #align_import order.conditionally_complete_lattice.finset from "leanprover-community/mathlib"@"2445c98ae4b87eabebdde552593519b9b6dc350c" open Set variable {ι α β γ : Type*} section ConditionallyCompleteLinearOrder variable [ConditionallyCompleteLinearOrder α] {s t : Set α} {a b : α} theorem Finset.Nonempty.csSup_eq_max' {s : Finset α} (h : s.Nonempty) : sSup ↑s = s.max' h := eq_of_forall_ge_iff fun _ => (csSup_le_iff s.bddAbove h.to_set).trans (s.max'_le_iff h).symm #align finset.nonempty.cSup_eq_max' Finset.Nonempty.csSup_eq_max' theorem Finset.Nonempty.csInf_eq_min' {s : Finset α} (h : s.Nonempty) : sInf ↑s = s.min' h := @Finset.Nonempty.csSup_eq_max' αᵒᵈ _ s h #align finset.nonempty.cInf_eq_min' Finset.Nonempty.csInf_eq_min'
Mathlib/Order/ConditionallyCompleteLattice/Finset.lean
33
35
theorem Finset.Nonempty.csSup_mem {s : Finset α} (h : s.Nonempty) : sSup (s : Set α) ∈ s := by
rw [h.csSup_eq_max'] exact s.max'_mem _
false
import Mathlib.Data.Nat.Lattice import Mathlib.Logic.Denumerable import Mathlib.Logic.Function.Iterate import Mathlib.Order.Hom.Basic import Mathlib.Data.Set.Subsingleton #align_import order.order_iso_nat from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" variable {α : Type*} namespace RelEmbedding variable {r : α → α → Prop} [IsStrictOrder α r] def natLT (f : ℕ → α) (H : ∀ n : ℕ, r (f n) (f (n + 1))) : ((· < ·) : ℕ → ℕ → Prop) ↪r r := ofMonotone f <| Nat.rel_of_forall_rel_succ_of_lt r H #align rel_embedding.nat_lt RelEmbedding.natLT @[simp] theorem coe_natLT {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLT f H) = f := rfl #align rel_embedding.coe_nat_lt RelEmbedding.coe_natLT def natGT (f : ℕ → α) (H : ∀ n : ℕ, r (f (n + 1)) (f n)) : ((· > ·) : ℕ → ℕ → Prop) ↪r r := haveI := IsStrictOrder.swap r RelEmbedding.swap (natLT f H) #align rel_embedding.nat_gt RelEmbedding.natGT @[simp] theorem coe_natGT {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGT f H) = f := rfl #align rel_embedding.coe_nat_gt RelEmbedding.coe_natGT
Mathlib/Order/OrderIsoNat.lean
58
62
theorem exists_not_acc_lt_of_not_acc {a : α} {r} (h : ¬Acc r a) : ∃ b, ¬Acc r b ∧ r b a := by
contrapose! h refine ⟨_, fun b hr => ?_⟩ by_contra hb exact h b hb hr
false
import Mathlib.Init.Control.Combinators import Mathlib.Init.Function import Mathlib.Tactic.CasesM import Mathlib.Tactic.Attr.Core #align_import control.basic from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" universe u v w variable {α β γ : Type u} section Monad variable {m : Type u → Type v} [Monad m] [LawfulMonad m] open List #align list.mpartition List.partitionM
Mathlib/Control/Basic.lean
83
85
theorem map_bind (x : m α) {g : α → m β} {f : β → γ} : f <$> (x >>= g) = x >>= fun a => f <$> g a := by
rw [← bind_pure_comp, bind_assoc]; simp [bind_pure_comp]
false
import Mathlib.Algebra.Group.Units.Hom import Mathlib.Algebra.GroupWithZero.Commute import Mathlib.Algebra.GroupWithZero.Hom import Mathlib.GroupTheory.GroupAction.Units #align_import algebra.group_with_zero.units.lemmas from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" assert_not_exists DenselyOrdered variable {α M₀ G₀ M₀' G₀' F F' : Type*} variable [MonoidWithZero M₀] section MonoidWithZero variable [GroupWithZero G₀] [Nontrivial M₀] [MonoidWithZero M₀'] [FunLike F G₀ M₀] [MonoidWithZeroHomClass F G₀ M₀] [FunLike F' G₀ M₀'] [MonoidWithZeroHomClass F' G₀ M₀'] (f : F) {a : G₀} theorem map_ne_zero : f a ≠ 0 ↔ a ≠ 0 := ⟨fun hfa ha => hfa <| ha.symm ▸ map_zero f, fun ha => ((IsUnit.mk0 a ha).map f).ne_zero⟩ #align map_ne_zero map_ne_zero @[simp] theorem map_eq_zero : f a = 0 ↔ a = 0 := not_iff_not.1 (map_ne_zero f) #align map_eq_zero map_eq_zero
Mathlib/Algebra/GroupWithZero/Units/Lemmas.lean
49
52
theorem eq_on_inv₀ (f g : F') (h : f a = g a) : f a⁻¹ = g a⁻¹ := by
rcases eq_or_ne a 0 with (rfl | ha) · rw [inv_zero, map_zero, map_zero] · exact (IsUnit.mk0 a ha).eq_on_inv f g h
false
import Mathlib.CategoryTheory.Sites.Subsheaf import Mathlib.CategoryTheory.Sites.CompatibleSheafification import Mathlib.CategoryTheory.Sites.LocallyInjective #align_import category_theory.sites.surjective from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe v u w v' u' w' open Opposite CategoryTheory CategoryTheory.GrothendieckTopology namespace CategoryTheory variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike variable {A : Type u'} [Category.{v'} A] [ConcreteCategory.{w'} A] namespace Presheaf @[simps (config := .lemmasOnly)] def imageSieve {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : G.obj (op U)) : Sieve U where arrows V i := ∃ t : F.obj (op V), f.app _ t = G.map i.op s downward_closed := by rintro V W i ⟨t, ht⟩ j refine ⟨F.map j.op t, ?_⟩ rw [op_comp, G.map_comp, comp_apply, ← ht, elementwise_of% f.naturality] #align category_theory.image_sieve CategoryTheory.Presheaf.imageSieve theorem imageSieve_eq_sieveOfSection {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : G.obj (op U)) : imageSieve f s = (imagePresheaf (whiskerRight f (forget A))).sieveOfSection s := rfl #align category_theory.image_sieve_eq_sieve_of_section CategoryTheory.Presheaf.imageSieve_eq_sieveOfSection theorem imageSieve_whisker_forget {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : G.obj (op U)) : imageSieve (whiskerRight f (forget A)) s = imageSieve f s := rfl #align category_theory.image_sieve_whisker_forget CategoryTheory.Presheaf.imageSieve_whisker_forget theorem imageSieve_app {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : F.obj (op U)) : imageSieve f (f.app _ s) = ⊤ := by ext V i simp only [Sieve.top_apply, iff_true_iff, imageSieve_apply] have := elementwise_of% (f.naturality i.op) exact ⟨F.map i.op s, this s⟩ #align category_theory.image_sieve_app CategoryTheory.Presheaf.imageSieve_app noncomputable def localPreimage {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : Cᵒᵖ} (s : G.obj U) {V : C} (g : V ⟶ U.unop) (hg : imageSieve f s g) : F.obj (op V) := hg.choose @[simp] lemma app_localPreimage {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : Cᵒᵖ} (s : G.obj U) {V : C} (g : V ⟶ U.unop) (hg : imageSieve f s g) : f.app _ (localPreimage f s g hg) = G.map g.op s := hg.choose_spec class IsLocallySurjective {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) : Prop where imageSieve_mem {U : C} (s : G.obj (op U)) : imageSieve f s ∈ J U #align category_theory.is_locally_surjective CategoryTheory.Presheaf.IsLocallySurjective lemma imageSieve_mem {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) [IsLocallySurjective J f] {U : Cᵒᵖ} (s : G.obj U) : imageSieve f s ∈ J U.unop := IsLocallySurjective.imageSieve_mem _ instance {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) [IsLocallySurjective J f] : IsLocallySurjective J (whiskerRight f (forget A)) where imageSieve_mem s := imageSieve_mem J f s
Mathlib/CategoryTheory/Sites/LocallySurjective.lean
101
105
theorem isLocallySurjective_iff_imagePresheaf_sheafify_eq_top {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) : IsLocallySurjective J f ↔ (imagePresheaf (whiskerRight f (forget A))).sheafify J = ⊤ := by
simp only [Subpresheaf.ext_iff, Function.funext_iff, Set.ext_iff, top_subpresheaf_obj, Set.top_eq_univ, Set.mem_univ, iff_true_iff] exact ⟨fun H _ => H.imageSieve_mem, fun H => ⟨H _⟩⟩
false
import Mathlib.FieldTheory.Minpoly.Field #align_import ring_theory.power_basis from "leanprover-community/mathlib"@"d1d69e99ed34c95266668af4e288fc1c598b9a7f" open Polynomial open Polynomial variable {R S T : Type*} [CommRing R] [Ring S] [Algebra R S] variable {A B : Type*} [CommRing A] [CommRing B] [IsDomain B] [Algebra A B] variable {K : Type*} [Field K] -- Porting note(#5171): this linter isn't ported yet. -- @[nolint has_nonempty_instance] structure PowerBasis (R S : Type*) [CommRing R] [Ring S] [Algebra R S] where gen : S dim : ℕ basis : Basis (Fin dim) R S basis_eq_pow : ∀ (i), basis i = gen ^ (i : ℕ) #align power_basis PowerBasis -- this is usually not needed because of `basis_eq_pow` but can be needed in some cases; -- in such circumstances, add it manually using `@[simps dim gen basis]`. initialize_simps_projections PowerBasis (-basis) namespace PowerBasis @[simp] theorem coe_basis (pb : PowerBasis R S) : ⇑pb.basis = fun i : Fin pb.dim => pb.gen ^ (i : ℕ) := funext pb.basis_eq_pow #align power_basis.coe_basis PowerBasis.coe_basis theorem finite (pb : PowerBasis R S) : Module.Finite R S := .of_basis pb.basis #align power_basis.finite_dimensional PowerBasis.finite @[deprecated] alias finiteDimensional := PowerBasis.finite theorem finrank [StrongRankCondition R] (pb : PowerBasis R S) : FiniteDimensional.finrank R S = pb.dim := by rw [FiniteDimensional.finrank_eq_card_basis pb.basis, Fintype.card_fin] #align power_basis.finrank PowerBasis.finrank theorem mem_span_pow' {x y : S} {d : ℕ} : y ∈ Submodule.span R (Set.range fun i : Fin d => x ^ (i : ℕ)) ↔ ∃ f : R[X], f.degree < d ∧ y = aeval x f := by have : (Set.range fun i : Fin d => x ^ (i : ℕ)) = (fun i : ℕ => x ^ i) '' ↑(Finset.range d) := by ext n simp_rw [Set.mem_range, Set.mem_image, Finset.mem_coe, Finset.mem_range] exact ⟨fun ⟨⟨i, hi⟩, hy⟩ => ⟨i, hi, hy⟩, fun ⟨i, hi, hy⟩ => ⟨⟨i, hi⟩, hy⟩⟩ simp only [this, Finsupp.mem_span_image_iff_total, degree_lt_iff_coeff_zero, support, exists_iff_exists_finsupp, coeff, aeval_def, eval₂RingHom', eval₂_eq_sum, Polynomial.sum, Finsupp.mem_supported', Finsupp.total, Finsupp.sum, Algebra.smul_def, eval₂_zero, exists_prop, LinearMap.id_coe, eval₂_one, id, not_lt, Finsupp.coe_lsum, LinearMap.coe_smulRight, Finset.mem_range, AlgHom.coe_mks, Finset.mem_coe] simp_rw [@eq_comm _ y] exact Iff.rfl #align power_basis.mem_span_pow' PowerBasis.mem_span_pow' theorem mem_span_pow {x y : S} {d : ℕ} (hd : d ≠ 0) : y ∈ Submodule.span R (Set.range fun i : Fin d => x ^ (i : ℕ)) ↔ ∃ f : R[X], f.natDegree < d ∧ y = aeval x f := by rw [mem_span_pow'] constructor <;> · rintro ⟨f, h, hy⟩ refine ⟨f, ?_, hy⟩ by_cases hf : f = 0 · simp only [hf, natDegree_zero, degree_zero] at h ⊢ first | exact lt_of_le_of_ne (Nat.zero_le d) hd.symm | exact WithBot.bot_lt_coe d simp_all only [degree_eq_natDegree hf] · first | exact WithBot.coe_lt_coe.1 h | exact WithBot.coe_lt_coe.2 h #align power_basis.mem_span_pow PowerBasis.mem_span_pow theorem dim_ne_zero [Nontrivial S] (pb : PowerBasis R S) : pb.dim ≠ 0 := fun h => not_nonempty_iff.mpr (h.symm ▸ Fin.isEmpty : IsEmpty (Fin pb.dim)) pb.basis.index_nonempty #align power_basis.dim_ne_zero PowerBasis.dim_ne_zero theorem dim_pos [Nontrivial S] (pb : PowerBasis R S) : 0 < pb.dim := Nat.pos_of_ne_zero pb.dim_ne_zero #align power_basis.dim_pos PowerBasis.dim_pos theorem exists_eq_aeval [Nontrivial S] (pb : PowerBasis R S) (y : S) : ∃ f : R[X], f.natDegree < pb.dim ∧ y = aeval pb.gen f := (mem_span_pow pb.dim_ne_zero).mp (by simpa using pb.basis.mem_span y) #align power_basis.exists_eq_aeval PowerBasis.exists_eq_aeval
Mathlib/RingTheory/PowerBasis.lean
132
135
theorem exists_eq_aeval' (pb : PowerBasis R S) (y : S) : ∃ f : R[X], y = aeval pb.gen f := by
nontriviality S obtain ⟨f, _, hf⟩ := exists_eq_aeval pb y exact ⟨f, hf⟩
false
import Mathlib.Algebra.Lie.OfAssociative import Mathlib.Algebra.Lie.IdealOperations #align_import algebra.lie.abelian from "leanprover-community/mathlib"@"8983bec7cdf6cb2dd1f21315c8a34ab00d7b2f6d" universe u v w w₁ w₂ class LieModule.IsTrivial (L : Type v) (M : Type w) [Bracket L M] [Zero M] : Prop where trivial : ∀ (x : L) (m : M), ⁅x, m⁆ = 0 #align lie_module.is_trivial LieModule.IsTrivial @[simp] theorem trivial_lie_zero (L : Type v) (M : Type w) [Bracket L M] [Zero M] [LieModule.IsTrivial L M] (x : L) (m : M) : ⁅x, m⁆ = 0 := LieModule.IsTrivial.trivial x m #align trivial_lie_zero trivial_lie_zero instance LieModule.instIsTrivialOfSubsingleton {L M : Type*} [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton L] : LieModule.IsTrivial L M := ⟨fun x m ↦ by rw [Subsingleton.eq_zero x, zero_lie]⟩ instance LieModule.instIsTrivialOfSubsingleton' {L M : Type*} [LieRing L] [AddCommGroup M] [LieRingModule L M] [Subsingleton M] : LieModule.IsTrivial L M := ⟨fun x m ↦ by simp_rw [Subsingleton.eq_zero m, lie_zero]⟩ abbrev IsLieAbelian (L : Type v) [Bracket L L] [Zero L] : Prop := LieModule.IsTrivial L L #align is_lie_abelian IsLieAbelian instance LieIdeal.isLieAbelian_of_trivial (R : Type u) (L : Type v) [CommRing R] [LieRing L] [LieAlgebra R L] (I : LieIdeal R L) [h : LieModule.IsTrivial L I] : IsLieAbelian I where trivial x y := by apply h.trivial #align lie_ideal.is_lie_abelian_of_trivial LieIdeal.isLieAbelian_of_trivial theorem Function.Injective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R] [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂} (h₁ : Function.Injective f) (_ : IsLieAbelian L₂) : IsLieAbelian L₁ := { trivial := fun x y => h₁ <| calc f ⁅x, y⁆ = ⁅f x, f y⁆ := LieHom.map_lie f x y _ = 0 := trivial_lie_zero _ _ _ _ _ = f 0 := f.map_zero.symm} #align function.injective.is_lie_abelian Function.Injective.isLieAbelian theorem Function.Surjective.isLieAbelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R] [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] {f : L₁ →ₗ⁅R⁆ L₂} (h₁ : Function.Surjective f) (h₂ : IsLieAbelian L₁) : IsLieAbelian L₂ := { trivial := fun x y => by obtain ⟨u, rfl⟩ := h₁ x obtain ⟨v, rfl⟩ := h₁ y rw [← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero] } #align function.surjective.is_lie_abelian Function.Surjective.isLieAbelian theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R] [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) : IsLieAbelian L₁ ↔ IsLieAbelian L₂ := ⟨e.symm.injective.isLieAbelian, e.injective.isLieAbelian⟩ #align lie_abelian_iff_equiv_lie_abelian lie_abelian_iff_equiv_lie_abelian theorem commutative_ring_iff_abelian_lie_ring {A : Type v} [Ring A] : Std.Commutative (α := A) (· * ·) ↔ IsLieAbelian A := by have h₁ : Std.Commutative (α := A) (· * ·) ↔ ∀ a b : A, a * b = b * a := ⟨fun h => h.1, fun h => ⟨h⟩⟩ have h₂ : IsLieAbelian A ↔ ∀ a b : A, ⁅a, b⁆ = 0 := ⟨fun h => h.1, fun h => ⟨h⟩⟩ simp only [h₁, h₂, LieRing.of_associative_ring_bracket, sub_eq_zero] #align commutative_ring_iff_abelian_lie_ring commutative_ring_iff_abelian_lie_ring section Center variable (R : Type u) (L : Type v) (M : Type w) (N : Type w₁) variable [CommRing R] [LieRing L] [LieAlgebra R L] variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M] variable [AddCommGroup N] [Module R N] [LieRingModule L N] [LieModule R L N] section IdealOperations open LieSubmodule LieSubalgebra variable {R : Type u} {L : Type v} {M : Type w} variable [CommRing R] [LieRing L] [LieAlgebra R L] [AddCommGroup M] [Module R M] variable [LieRingModule L M] [LieModule R L M] variable (N N' : LieSubmodule R L M) (I J : LieIdeal R L) @[simp] theorem LieSubmodule.trivial_lie_oper_zero [LieModule.IsTrivial L M] : ⁅I, N⁆ = ⊥ := by suffices ⁅I, N⁆ ≤ ⊥ from le_bot_iff.mp this rw [lieIdeal_oper_eq_span, LieSubmodule.lieSpan_le] rintro m ⟨x, n, h⟩; rw [trivial_lie_zero] at h; simp [← h] #align lie_submodule.trivial_lie_oper_zero LieSubmodule.trivial_lie_oper_zero
Mathlib/Algebra/Lie/Abelian.lean
318
326
theorem LieSubmodule.lie_abelian_iff_lie_self_eq_bot : IsLieAbelian I ↔ ⁅I, I⁆ = ⊥ := by
simp only [_root_.eq_bot_iff, lieIdeal_oper_eq_span, LieSubmodule.lieSpan_le, LieSubmodule.bot_coe, Set.subset_singleton_iff, Set.mem_setOf_eq, exists_imp] refine ⟨fun h z x y hz => hz.symm.trans (((I : LieSubalgebra R L).coe_bracket x y).symm.trans ((coe_zero_iff_zero _ _).mpr (by apply h.trivial))), fun h => ⟨fun x y => ((I : LieSubalgebra R L).coe_zero_iff_zero _).mp (h _ x y rfl)⟩⟩
false
import Mathlib.Data.Option.NAry import Mathlib.Data.Seq.Computation #align_import data.seq.seq from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace Stream' universe u v w def IsSeq {α : Type u} (s : Stream' (Option α)) : Prop := ∀ {n : ℕ}, s n = none → s (n + 1) = none #align stream.is_seq Stream'.IsSeq def Seq (α : Type u) : Type u := { f : Stream' (Option α) // f.IsSeq } #align stream.seq Stream'.Seq def Seq1 (α) := α × Seq α #align stream.seq1 Stream'.Seq1 namespace Seq variable {α : Type u} {β : Type v} {γ : Type w} def nil : Seq α := ⟨Stream'.const none, fun {_} _ => rfl⟩ #align stream.seq.nil Stream'.Seq.nil instance : Inhabited (Seq α) := ⟨nil⟩ def cons (a : α) (s : Seq α) : Seq α := ⟨some a::s.1, by rintro (n | _) h · contradiction · exact s.2 h⟩ #align stream.seq.cons Stream'.Seq.cons @[simp] theorem val_cons (s : Seq α) (x : α) : (cons x s).val = some x::s.val := rfl #align stream.seq.val_cons Stream'.Seq.val_cons def get? : Seq α → ℕ → Option α := Subtype.val #align stream.seq.nth Stream'.Seq.get? @[simp] theorem get?_mk (f hf) : @get? α ⟨f, hf⟩ = f := rfl #align stream.seq.nth_mk Stream'.Seq.get?_mk @[simp] theorem get?_nil (n : ℕ) : (@nil α).get? n = none := rfl #align stream.seq.nth_nil Stream'.Seq.get?_nil @[simp] theorem get?_cons_zero (a : α) (s : Seq α) : (cons a s).get? 0 = some a := rfl #align stream.seq.nth_cons_zero Stream'.Seq.get?_cons_zero @[simp] theorem get?_cons_succ (a : α) (s : Seq α) (n : ℕ) : (cons a s).get? (n + 1) = s.get? n := rfl #align stream.seq.nth_cons_succ Stream'.Seq.get?_cons_succ @[ext] protected theorem ext {s t : Seq α} (h : ∀ n : ℕ, s.get? n = t.get? n) : s = t := Subtype.eq <| funext h #align stream.seq.ext Stream'.Seq.ext theorem cons_injective2 : Function.Injective2 (cons : α → Seq α → Seq α) := fun x y s t h => ⟨by rw [← Option.some_inj, ← get?_cons_zero, h, get?_cons_zero], Seq.ext fun n => by simp_rw [← get?_cons_succ x s n, h, get?_cons_succ]⟩ #align stream.seq.cons_injective2 Stream'.Seq.cons_injective2 theorem cons_left_injective (s : Seq α) : Function.Injective fun x => cons x s := cons_injective2.left _ #align stream.seq.cons_left_injective Stream'.Seq.cons_left_injective theorem cons_right_injective (x : α) : Function.Injective (cons x) := cons_injective2.right _ #align stream.seq.cons_right_injective Stream'.Seq.cons_right_injective def TerminatedAt (s : Seq α) (n : ℕ) : Prop := s.get? n = none #align stream.seq.terminated_at Stream'.Seq.TerminatedAt instance terminatedAtDecidable (s : Seq α) (n : ℕ) : Decidable (s.TerminatedAt n) := decidable_of_iff' (s.get? n).isNone <| by unfold TerminatedAt; cases s.get? n <;> simp #align stream.seq.terminated_at_decidable Stream'.Seq.terminatedAtDecidable def Terminates (s : Seq α) : Prop := ∃ n : ℕ, s.TerminatedAt n #align stream.seq.terminates Stream'.Seq.Terminates theorem not_terminates_iff {s : Seq α} : ¬s.Terminates ↔ ∀ n, (s.get? n).isSome := by simp only [Terminates, TerminatedAt, ← Ne.eq_def, Option.ne_none_iff_isSome, not_exists, iff_self] #align stream.seq.not_terminates_iff Stream'.Seq.not_terminates_iff @[simp] def omap (f : β → γ) : Option (α × β) → Option (α × γ) | none => none | some (a, b) => some (a, f b) #align stream.seq.omap Stream'.Seq.omap def head (s : Seq α) : Option α := get? s 0 #align stream.seq.head Stream'.Seq.head def tail (s : Seq α) : Seq α := ⟨s.1.tail, fun n' => by cases' s with f al exact al n'⟩ #align stream.seq.tail Stream'.Seq.tail protected def Mem (a : α) (s : Seq α) := some a ∈ s.1 #align stream.seq.mem Stream'.Seq.Mem instance : Membership α (Seq α) := ⟨Seq.Mem⟩ theorem le_stable (s : Seq α) {m n} (h : m ≤ n) : s.get? m = none → s.get? n = none := by cases' s with f al induction' h with n _ IH exacts [id, fun h2 => al (IH h2)] #align stream.seq.le_stable Stream'.Seq.le_stable theorem terminated_stable : ∀ (s : Seq α) {m n : ℕ}, m ≤ n → s.TerminatedAt m → s.TerminatedAt n := le_stable #align stream.seq.terminated_stable Stream'.Seq.terminated_stable
Mathlib/Data/Seq/Seq.lean
174
178
theorem ge_stable (s : Seq α) {aₙ : α} {n m : ℕ} (m_le_n : m ≤ n) (s_nth_eq_some : s.get? n = some aₙ) : ∃ aₘ : α, s.get? m = some aₘ := have : s.get? n ≠ none := by
simp [s_nth_eq_some] have : s.get? m ≠ none := mt (s.le_stable m_le_n) this Option.ne_none_iff_exists'.mp this
false