Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
goals
listlengths
0
224
goals_before
listlengths
0
221
import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add import Mathlib.Analysis.Calculus.FDeriv.Mul import Mathlib.Analysis.Calculus.Deriv.Inverse #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical NNReal Nat local notation "∞" => (⊀ : β„•βˆž) universe u v w uD uE uF uG attribute [local instance 1001] NormedAddCommGroup.toAddCommGroup NormedSpace.toModule' AddCommGroup.toAddCommMonoid open Set Fin Filter Function open scoped Topology variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] {X : Type*} [NormedAddCommGroup X] [NormedSpace π•œ X] {s s₁ t u : Set E} {f f₁ : E β†’ F} {g : F β†’ G} {x xβ‚€ : E} {c : F} {b : E Γ— F β†’ G} {m n : β„•βˆž} {p : E β†’ FormalMultilinearSeries π•œ E F} @[simp] theorem iteratedFDerivWithin_zero_fun (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) {i : β„•} : iteratedFDerivWithin π•œ i (fun _ : E ↦ (0 : F)) s x = 0 := by induction i generalizing x with | zero => ext; simp | succ i IH => ext m rw [iteratedFDerivWithin_succ_apply_left, fderivWithin_congr (fun _ ↦ IH) (IH hx)] rw [fderivWithin_const_apply _ (hs x hx)] rfl @[simp] theorem iteratedFDeriv_zero_fun {n : β„•} : (iteratedFDeriv π•œ n fun _ : E ↦ (0 : F)) = 0 := funext fun x ↦ by simpa [← iteratedFDerivWithin_univ] using iteratedFDerivWithin_zero_fun uniqueDiffOn_univ (mem_univ x) #align iterated_fderiv_zero_fun iteratedFDeriv_zero_fun theorem contDiff_zero_fun : ContDiff π•œ n fun _ : E => (0 : F) := contDiff_of_differentiable_iteratedFDeriv fun m _ => by rw [iteratedFDeriv_zero_fun] exact differentiable_const (0 : E[Γ—m]β†’L[π•œ] F) #align cont_diff_zero_fun contDiff_zero_fun theorem contDiff_const {c : F} : ContDiff π•œ n fun _ : E => c := by suffices h : ContDiff π•œ ∞ fun _ : E => c from h.of_le le_top rw [contDiff_top_iff_fderiv] refine ⟨differentiable_const c, ?_⟩ rw [fderiv_const] exact contDiff_zero_fun #align cont_diff_const contDiff_const theorem contDiffOn_const {c : F} {s : Set E} : ContDiffOn π•œ n (fun _ : E => c) s := contDiff_const.contDiffOn #align cont_diff_on_const contDiffOn_const theorem contDiffAt_const {c : F} : ContDiffAt π•œ n (fun _ : E => c) x := contDiff_const.contDiffAt #align cont_diff_at_const contDiffAt_const theorem contDiffWithinAt_const {c : F} : ContDiffWithinAt π•œ n (fun _ : E => c) s x := contDiffAt_const.contDiffWithinAt #align cont_diff_within_at_const contDiffWithinAt_const @[nontriviality] theorem contDiff_of_subsingleton [Subsingleton F] : ContDiff π•œ n f := by rw [Subsingleton.elim f fun _ => 0]; exact contDiff_const #align cont_diff_of_subsingleton contDiff_of_subsingleton @[nontriviality] theorem contDiffAt_of_subsingleton [Subsingleton F] : ContDiffAt π•œ n f x := by rw [Subsingleton.elim f fun _ => 0]; exact contDiffAt_const #align cont_diff_at_of_subsingleton contDiffAt_of_subsingleton @[nontriviality] theorem contDiffWithinAt_of_subsingleton [Subsingleton F] : ContDiffWithinAt π•œ n f s x := by rw [Subsingleton.elim f fun _ => 0]; exact contDiffWithinAt_const #align cont_diff_within_at_of_subsingleton contDiffWithinAt_of_subsingleton @[nontriviality] theorem contDiffOn_of_subsingleton [Subsingleton F] : ContDiffOn π•œ n f s := by rw [Subsingleton.elim f fun _ => 0]; exact contDiffOn_const #align cont_diff_on_of_subsingleton contDiffOn_of_subsingleton
Mathlib/Analysis/Calculus/ContDiff/Basic.lean
126
132
theorem iteratedFDerivWithin_succ_const (n : β„•) (c : F) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) : iteratedFDerivWithin π•œ (n + 1) (fun _ : E ↦ c) s x = 0 := by
ext m rw [iteratedFDerivWithin_succ_apply_right hs hx] rw [iteratedFDerivWithin_congr (fun y hy ↦ fderivWithin_const_apply c (hs y hy)) hx] rw [iteratedFDerivWithin_zero_fun hs hx] simp [ContinuousMultilinearMap.zero_apply (R := π•œ)]
[ " iteratedFDerivWithin π•œ i (fun x => 0) s x = 0", " iteratedFDerivWithin π•œ 0 (fun x => 0) s x = 0", " (iteratedFDerivWithin π•œ 0 (fun x => 0) s x) x✝ = 0 x✝", " iteratedFDerivWithin π•œ (i + 1) (fun x => 0) s x = 0", " (iteratedFDerivWithin π•œ (i + 1) (fun x => 0) s x) m = 0 m", " ((fderivWithin π•œ (fun ...
[ " iteratedFDerivWithin π•œ i (fun x => 0) s x = 0", " iteratedFDerivWithin π•œ 0 (fun x => 0) s x = 0", " (iteratedFDerivWithin π•œ 0 (fun x => 0) s x) x✝ = 0 x✝", " iteratedFDerivWithin π•œ (i + 1) (fun x => 0) s x = 0", " (iteratedFDerivWithin π•œ (i + 1) (fun x => 0) s x) m = 0 m", " ((fderivWithin π•œ (fun ...
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry #align_import analysis.normed_space.conformal_linear_map from "leanprover-community/mathlib"@"d1bd9c5df2867c1cb463bc6364446d57bdd9f7f1" noncomputable section open Function LinearIsometry ContinuousLinearMap def IsConformalMap {R : Type*} {X Y : Type*} [NormedField R] [SeminormedAddCommGroup X] [SeminormedAddCommGroup Y] [NormedSpace R X] [NormedSpace R Y] (f' : X β†’L[R] Y) := βˆƒ c β‰  (0 : R), βˆƒ li : X β†’β‚—α΅’[R] Y, f' = c β€’ li.toContinuousLinearMap #align is_conformal_map IsConformalMap variable {R M N G M' : Type*} [NormedField R] [SeminormedAddCommGroup M] [SeminormedAddCommGroup N] [SeminormedAddCommGroup G] [NormedSpace R M] [NormedSpace R N] [NormedSpace R G] [NormedAddCommGroup M'] [NormedSpace R M'] {f : M β†’L[R] N} {g : N β†’L[R] G} {c : R} theorem isConformalMap_id : IsConformalMap (id R M) := ⟨1, one_ne_zero, id, by simp⟩ #align is_conformal_map_id isConformalMap_id theorem IsConformalMap.smul (hf : IsConformalMap f) {c : R} (hc : c β‰  0) : IsConformalMap (c β€’ f) := by rcases hf with ⟨c', hc', li, rfl⟩ exact ⟨c * c', mul_ne_zero hc hc', li, smul_smul _ _ _⟩ #align is_conformal_map.smul IsConformalMap.smul theorem isConformalMap_const_smul (hc : c β‰  0) : IsConformalMap (c β€’ id R M) := isConformalMap_id.smul hc #align is_conformal_map_const_smul isConformalMap_const_smul protected theorem LinearIsometry.isConformalMap (f' : M β†’β‚—α΅’[R] N) : IsConformalMap f'.toContinuousLinearMap := ⟨1, one_ne_zero, f', (one_smul _ _).symm⟩ #align linear_isometry.is_conformal_map LinearIsometry.isConformalMap @[nontriviality] theorem isConformalMap_of_subsingleton [Subsingleton M] (f' : M β†’L[R] N) : IsConformalMap f' := ⟨1, one_ne_zero, ⟨0, fun x => by simp [Subsingleton.elim x 0]⟩, Subsingleton.elim _ _⟩ #align is_conformal_map_of_subsingleton isConformalMap_of_subsingleton namespace IsConformalMap
Mathlib/Analysis/NormedSpace/ConformalLinearMap.lean
84
89
theorem comp (hg : IsConformalMap g) (hf : IsConformalMap f) : IsConformalMap (g.comp f) := by
rcases hf with ⟨cf, hcf, lif, rfl⟩ rcases hg with ⟨cg, hcg, lig, rfl⟩ refine ⟨cg * cf, mul_ne_zero hcg hcf, lig.comp lif, ?_⟩ rw [smul_comp, comp_smul, mul_smul] rfl
[ " ContinuousLinearMap.id R M = 1 β€’ LinearIsometry.id.toContinuousLinearMap", " IsConformalMap (c β€’ f)", " IsConformalMap (c β€’ c' β€’ li.toContinuousLinearMap)", " β€–0 xβ€– = β€–xβ€–", " IsConformalMap (g.comp f)", " IsConformalMap (g.comp (cf β€’ lif.toContinuousLinearMap))", " IsConformalMap ((cg β€’ lig.toContinuo...
[ " ContinuousLinearMap.id R M = 1 β€’ LinearIsometry.id.toContinuousLinearMap", " IsConformalMap (c β€’ f)", " IsConformalMap (c β€’ c' β€’ li.toContinuousLinearMap)", " β€–0 xβ€– = β€–xβ€–", " IsConformalMap (g.comp f)" ]
import Mathlib.FieldTheory.SplittingField.Construction import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Separable import Mathlib.FieldTheory.NormalClosure import Mathlib.RingTheory.Polynomial.SeparableDegree open scoped Classical Polynomial open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] namespace Field def Emb := E →ₐ[F] AlgebraicClosure E def finSepDegree : β„• := Nat.card (Emb F E) instance instInhabitedEmb : Inhabited (Emb F E) := ⟨IsScalarTower.toAlgHom F E _⟩ instance instNeZeroFinSepDegree [FiniteDimensional F E] : NeZero (finSepDegree F E) := ⟨Nat.card_ne_zero.2 ⟨inferInstance, Fintype.finite <| minpoly.AlgHom.fintype _ _ _⟩⟩ def embEquivOfEquiv (i : E ≃ₐ[F] K) : Emb F E ≃ Emb F K := AlgEquiv.arrowCongr i <| AlgEquiv.symm <| by let _ : Algebra E K := i.toAlgHom.toRingHom.toAlgebra have : Algebra.IsAlgebraic E K := by constructor intro x have h := isAlgebraic_algebraMap (R := E) (A := K) (i.symm.toAlgHom x) rw [show βˆ€ y : E, (algebraMap E K) y = i.toAlgHom y from fun y ↦ rfl] at h simpa only [AlgEquiv.toAlgHom_eq_coe, AlgHom.coe_coe, AlgEquiv.apply_symm_apply] using h apply AlgEquiv.restrictScalars (R := F) (S := E) exact IsAlgClosure.equivOfAlgebraic E K (AlgebraicClosure K) (AlgebraicClosure E) theorem finSepDegree_eq_of_equiv (i : E ≃ₐ[F] K) : finSepDegree F E = finSepDegree F K := Nat.card_congr (embEquivOfEquiv F E K i) @[simp]
Mathlib/FieldTheory/SeparableDegree.lean
168
172
theorem finSepDegree_self : finSepDegree F F = 1 := by
have : Cardinal.mk (Emb F F) = 1 := le_antisymm (Cardinal.le_one_iff_subsingleton.2 AlgHom.subsingleton) (Cardinal.one_le_iff_ne_zero.2 <| Cardinal.mk_ne_zero _) rw [finSepDegree, Nat.card, this, Cardinal.one_toNat]
[ " AlgebraicClosure K ≃ₐ[F] AlgebraicClosure E", " Algebra.IsAlgebraic E K", " βˆ€ (x : K), IsAlgebraic E x", " IsAlgebraic E x", " AlgebraicClosure K ≃ₐ[E] AlgebraicClosure E", " finSepDegree F F = 1" ]
[ " AlgebraicClosure K ≃ₐ[F] AlgebraicClosure E", " Algebra.IsAlgebraic E K", " βˆ€ (x : K), IsAlgebraic E x", " IsAlgebraic E x", " AlgebraicClosure K ≃ₐ[E] AlgebraicClosure E", " finSepDegree F F = 1" ]
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal #align_import analysis.special_functions.pow.asymptotics from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" set_option linter.uppercaseLean3 false noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate Finset Set section Limits open Real Filter theorem tendsto_rpow_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ y) atTop atTop := by rw [tendsto_atTop_atTop] intro b use max b 0 ^ (1 / y) intro x hx exact le_of_max_le_left (by convert rpow_le_rpow (rpow_nonneg (le_max_right b 0) (1 / y)) hx (le_of_lt hy) using 1 rw [← rpow_mul (le_max_right b 0), (eq_div_iff (ne_of_gt hy)).mp rfl, Real.rpow_one]) #align tendsto_rpow_at_top tendsto_rpow_atTop theorem tendsto_rpow_neg_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ (-y)) atTop (𝓝 0) := Tendsto.congr' (eventuallyEq_of_mem (Ioi_mem_atTop 0) fun _ hx => (rpow_neg (le_of_lt hx) y).symm) (tendsto_rpow_atTop hy).inv_tendsto_atTop #align tendsto_rpow_neg_at_top tendsto_rpow_neg_atTop open Asymptotics in lemma tendsto_rpow_atTop_of_base_lt_one (b : ℝ) (hbβ‚€ : -1 < b) (hb₁ : b < 1) : Tendsto (b ^ Β· : ℝ β†’ ℝ) atTop (𝓝 (0:ℝ)) := by rcases lt_trichotomy b 0 with hb|rfl|hb case inl => -- b < 0 simp_rw [Real.rpow_def_of_nonpos hb.le, hb.ne, ite_false] rw [← isLittleO_const_iff (c := (1:ℝ)) one_ne_zero, (one_mul (1 : ℝ)).symm] refine IsLittleO.mul_isBigO ?exp ?cos case exp => rw [isLittleO_const_iff one_ne_zero] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_neg ?_).mpr tendsto_id rw [← log_neg_eq_log, log_neg_iff (by linarith)] linarith case cos => rw [isBigO_iff] exact ⟨1, eventually_of_forall fun x => by simp [Real.abs_cos_le_one]⟩ case inr.inl => -- b = 0 refine Tendsto.mono_right ?_ (Iff.mpr pure_le_nhds_iff rfl) rw [tendsto_pure] filter_upwards [eventually_ne_atTop 0] with _ hx simp [hx] case inr.inr => -- b > 0 simp_rw [Real.rpow_def_of_pos hb] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_neg ?_).mpr tendsto_id exact (log_neg_iff hb).mpr hb₁ lemma tendsto_rpow_atTop_of_base_gt_one (b : ℝ) (hb : 1 < b) : Tendsto (b ^ Β· : ℝ β†’ ℝ) atBot (𝓝 (0:ℝ)) := by simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_of_pos ?_).mpr tendsto_id exact (log_pos_iff (by positivity)).mpr <| by aesop lemma tendsto_rpow_atBot_of_base_lt_one (b : ℝ) (hbβ‚€ : 0 < b) (hb₁ : b < 1) : Tendsto (b ^ Β· : ℝ β†’ ℝ) atBot atTop := by simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)] refine tendsto_exp_atTop.comp <| (tendsto_const_mul_atTop_iff_neg <| tendsto_id (Ξ± := ℝ)).mpr ?_ exact (log_neg_iff hbβ‚€).mpr hb₁ lemma tendsto_rpow_atBot_of_base_gt_one (b : ℝ) (hb : 1 < b) : Tendsto (b ^ Β· : ℝ β†’ ℝ) atBot (𝓝 0) := by simp_rw [Real.rpow_def_of_pos (by positivity : 0 < b)] refine tendsto_exp_atBot.comp <| (tendsto_const_mul_atBot_iff_pos <| tendsto_id (Ξ± := ℝ)).mpr ?_ exact (log_pos_iff (by positivity)).mpr <| by aesop theorem tendsto_rpow_div_mul_add (a b c : ℝ) (hb : 0 β‰  b) : Tendsto (fun x => x ^ (a / (b * x + c))) atTop (𝓝 1) := by refine Tendsto.congr' ?_ ((tendsto_exp_nhds_zero_nhds_one.comp (by simpa only [mul_zero, pow_one] using (tendsto_const_nhds (x := a)).mul (tendsto_div_pow_mul_exp_add_atTop b c 1 hb))).comp tendsto_log_atTop) apply eventuallyEq_of_mem (Ioi_mem_atTop (0 : ℝ)) intro x hx simp only [Set.mem_Ioi, Function.comp_apply] at hx ⊒ rw [exp_log hx, ← exp_log (rpow_pos_of_pos hx (a / (b * x + c))), log_rpow hx (a / (b * x + c))] field_simp #align tendsto_rpow_div_mul_add tendsto_rpow_div_mul_add theorem tendsto_rpow_div : Tendsto (fun x => x ^ ((1 : ℝ) / x)) atTop (𝓝 1) := by convert tendsto_rpow_div_mul_add (1 : ℝ) _ (0 : ℝ) zero_ne_one ring #align tendsto_rpow_div tendsto_rpow_div theorem tendsto_rpow_neg_div : Tendsto (fun x => x ^ (-(1 : ℝ) / x)) atTop (𝓝 1) := by convert tendsto_rpow_div_mul_add (-(1 : ℝ)) _ (0 : ℝ) zero_ne_one ring #align tendsto_rpow_neg_div tendsto_rpow_neg_div
Mathlib/Analysis/SpecialFunctions/Pow/Asymptotics.lean
132
137
theorem tendsto_exp_div_rpow_atTop (s : ℝ) : Tendsto (fun x : ℝ => exp x / x ^ s) atTop atTop := by
cases' archimedean_iff_nat_lt.1 Real.instArchimedean s with n hn refine tendsto_atTop_mono' _ ?_ (tendsto_exp_div_pow_atTop n) filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (1 : ℝ)] with x hxβ‚€ hx₁ rw [div_le_div_left (exp_pos _) (pow_pos hxβ‚€ _) (rpow_pos_of_pos hxβ‚€ _), ← Real.rpow_natCast] exact rpow_le_rpow_of_exponent_le hx₁ hn.le
[ " Tendsto (fun x => x ^ y) atTop atTop", " βˆ€ (b : ℝ), βˆƒ i, βˆ€ (a : ℝ), i ≀ a β†’ b ≀ a ^ y", " βˆƒ i, βˆ€ (a : ℝ), i ≀ a β†’ b ≀ a ^ y", " βˆ€ (a : ℝ), max b 0 ^ (1 / y) ≀ a β†’ b ≀ a ^ y", " b ≀ x ^ y", " max b ?m.800 ≀ x ^ y", " max b ?m.800 = (max b 0 ^ (1 / y)) ^ y", " Tendsto (fun x => b ^ x) atTop (𝓝 0)", ...
[ " Tendsto (fun x => x ^ y) atTop atTop", " βˆ€ (b : ℝ), βˆƒ i, βˆ€ (a : ℝ), i ≀ a β†’ b ≀ a ^ y", " βˆƒ i, βˆ€ (a : ℝ), i ≀ a β†’ b ≀ a ^ y", " βˆ€ (a : ℝ), max b 0 ^ (1 / y) ≀ a β†’ b ≀ a ^ y", " b ≀ x ^ y", " max b ?m.800 ≀ x ^ y", " max b ?m.800 = (max b 0 ^ (1 / y)) ^ y", " Tendsto (fun x => b ^ x) atTop (𝓝 0)", ...
import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Data.Nat.Factors import Mathlib.Order.Interval.Finset.Nat #align_import number_theory.divisors from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" open scoped Classical open Finset namespace Nat variable (n : β„•) def divisors : Finset β„• := Finset.filter (fun x : β„• => x ∣ n) (Finset.Ico 1 (n + 1)) #align nat.divisors Nat.divisors def properDivisors : Finset β„• := Finset.filter (fun x : β„• => x ∣ n) (Finset.Ico 1 n) #align nat.proper_divisors Nat.properDivisors def divisorsAntidiagonal : Finset (β„• Γ— β„•) := Finset.filter (fun x => x.fst * x.snd = n) (Ico 1 (n + 1) Γ—Λ’ Ico 1 (n + 1)) #align nat.divisors_antidiagonal Nat.divisorsAntidiagonal variable {n} @[simp] theorem filter_dvd_eq_divisors (h : n β‰  0) : (Finset.range n.succ).filter (Β· ∣ n) = n.divisors := by ext simp only [divisors, mem_filter, mem_range, mem_Ico, and_congr_left_iff, iff_and_self] exact fun ha _ => succ_le_iff.mpr (pos_of_dvd_of_pos ha h.bot_lt) #align nat.filter_dvd_eq_divisors Nat.filter_dvd_eq_divisors @[simp] theorem filter_dvd_eq_properDivisors (h : n β‰  0) : (Finset.range n).filter (Β· ∣ n) = n.properDivisors := by ext simp only [properDivisors, mem_filter, mem_range, mem_Ico, and_congr_left_iff, iff_and_self] exact fun ha _ => succ_le_iff.mpr (pos_of_dvd_of_pos ha h.bot_lt) #align nat.filter_dvd_eq_proper_divisors Nat.filter_dvd_eq_properDivisors theorem properDivisors.not_self_mem : Β¬n ∈ properDivisors n := by simp [properDivisors] #align nat.proper_divisors.not_self_mem Nat.properDivisors.not_self_mem @[simp] theorem mem_properDivisors {m : β„•} : n ∈ properDivisors m ↔ n ∣ m ∧ n < m := by rcases eq_or_ne m 0 with (rfl | hm); Β· simp [properDivisors] simp only [and_comm, ← filter_dvd_eq_properDivisors hm, mem_filter, mem_range] #align nat.mem_proper_divisors Nat.mem_properDivisors theorem insert_self_properDivisors (h : n β‰  0) : insert n (properDivisors n) = divisors n := by rw [divisors, properDivisors, Ico_succ_right_eq_insert_Ico (one_le_iff_ne_zero.2 h), Finset.filter_insert, if_pos (dvd_refl n)] #align nat.insert_self_proper_divisors Nat.insert_self_properDivisors
Mathlib/NumberTheory/Divisors.lean
89
91
theorem cons_self_properDivisors (h : n β‰  0) : cons n (properDivisors n) properDivisors.not_self_mem = divisors n := by
rw [cons_eq_insert, insert_self_properDivisors h]
[ " filter (fun x => x ∣ n) (range n.succ) = n.divisors", " a✝ ∈ filter (fun x => x ∣ n) (range n.succ) ↔ a✝ ∈ n.divisors", " a✝ ∣ n β†’ a✝ < n.succ β†’ 1 ≀ a✝", " filter (fun x => x ∣ n) (range n) = n.properDivisors", " a✝ ∈ filter (fun x => x ∣ n) (range n) ↔ a✝ ∈ n.properDivisors", " a✝ ∣ n β†’ a✝ < n β†’ 1 ≀ a✝...
[ " filter (fun x => x ∣ n) (range n.succ) = n.divisors", " a✝ ∈ filter (fun x => x ∣ n) (range n.succ) ↔ a✝ ∈ n.divisors", " a✝ ∣ n β†’ a✝ < n.succ β†’ 1 ≀ a✝", " filter (fun x => x ∣ n) (range n) = n.properDivisors", " a✝ ∈ filter (fun x => x ∣ n) (range n) ↔ a✝ ∈ n.properDivisors", " a✝ ∣ n β†’ a✝ < n β†’ 1 ≀ a✝...
import Mathlib.Analysis.Calculus.FDeriv.Equiv import Mathlib.Analysis.Calculus.InverseFunctionTheorem.ApproximatesLinearOn #align_import analysis.calculus.inverse from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" open Function Set Filter Metric open scoped Topology Classical NNReal noncomputable section variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π•œ G'] variable {Ξ΅ : ℝ} open Asymptotics Filter Metric Set open ContinuousLinearMap (id) namespace HasStrictFDerivAt theorem approximates_deriv_on_nhds {f : E β†’ F} {f' : E β†’L[π•œ] F} {a : E} (hf : HasStrictFDerivAt f f' a) {c : ℝβ‰₯0} (hc : Subsingleton E ∨ 0 < c) : βˆƒ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c := by cases' hc with hE hc Β· refine ⟨univ, IsOpen.mem_nhds isOpen_univ trivial, fun x _ y _ => ?_⟩ simp [@Subsingleton.elim E hE x y] have := hf.def hc rw [nhds_prod_eq, Filter.Eventually, mem_prod_same_iff] at this rcases this with ⟨s, has, hs⟩ exact ⟨s, has, fun x hx y hy => hs (mk_mem_prod hx hy)⟩ #align has_strict_fderiv_at.approximates_deriv_on_nhds HasStrictFDerivAt.approximates_deriv_on_nhds
Mathlib/Analysis/Calculus/InverseFunctionTheorem/FDeriv.lean
86
96
theorem map_nhds_eq_of_surj [CompleteSpace E] [CompleteSpace F] {f : E β†’ F} {f' : E β†’L[π•œ] F} {a : E} (hf : HasStrictFDerivAt f (f' : E β†’L[π•œ] F) a) (h : LinearMap.range f' = ⊀) : map f (𝓝 a) = 𝓝 (f a) := by
let f'symm := f'.nonlinearRightInverseOfSurjective h set c : ℝβ‰₯0 := f'symm.nnnorm⁻¹ / 2 with hc have f'symm_pos : 0 < f'symm.nnnorm := f'.nonlinearRightInverseOfSurjective_nnnorm_pos h have cpos : 0 < c := by simp [hc, half_pos, inv_pos, f'symm_pos] obtain ⟨s, s_nhds, hs⟩ : βˆƒ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c := hf.approximates_deriv_on_nhds (Or.inr cpos) apply hs.map_nhds_eq f'symm s_nhds (Or.inr (NNReal.half_lt_self _)) simp [ne_of_gt f'symm_pos]
[ " βˆƒ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c", " β€–f x - f y - f' (x - y)β€– ≀ ↑c * β€–x - yβ€–", " map f (𝓝 a) = 𝓝 (f a)", " 0 < c", " f'symm.nnnorm⁻¹ β‰  0" ]
[ " βˆƒ s ∈ 𝓝 a, ApproximatesLinearOn f f' s c", " β€–f x - f y - f' (x - y)β€– ≀ ↑c * β€–x - yβ€–", " map f (𝓝 a) = 𝓝 (f a)" ]
import Mathlib.Algebra.Lie.BaseChange import Mathlib.Algebra.Lie.Solvable import Mathlib.Algebra.Lie.Quotient import Mathlib.Algebra.Lie.Normalizer import Mathlib.LinearAlgebra.Eigenspace.Basic import Mathlib.Order.Filter.AtTopBot import Mathlib.RingTheory.Artinian import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.Tactic.Monotonicity #align_import algebra.lie.nilpotent from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w w₁ wβ‚‚ section NilpotentModules 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 (k : β„•) (N : LieSubmodule R L M) namespace LieSubmodule variable {N₁ Nβ‚‚ : LieSubmodule R L M} def ucs (k : β„•) : LieSubmodule R L M β†’ LieSubmodule R L M := normalizer^[k] #align lie_submodule.ucs LieSubmodule.ucs @[simp] theorem ucs_zero : N.ucs 0 = N := rfl #align lie_submodule.ucs_zero LieSubmodule.ucs_zero @[simp] theorem ucs_succ (k : β„•) : N.ucs (k + 1) = (N.ucs k).normalizer := Function.iterate_succ_apply' normalizer k N #align lie_submodule.ucs_succ LieSubmodule.ucs_succ theorem ucs_add (k l : β„•) : N.ucs (k + l) = (N.ucs l).ucs k := Function.iterate_add_apply normalizer k l N #align lie_submodule.ucs_add LieSubmodule.ucs_add @[mono] theorem ucs_mono (k : β„•) (h : N₁ ≀ Nβ‚‚) : N₁.ucs k ≀ Nβ‚‚.ucs k := by induction' k with k ih Β· simpa simp only [ucs_succ] -- Porting note: `mono` makes no progress apply monotone_normalizer ih #align lie_submodule.ucs_mono LieSubmodule.ucs_mono
Mathlib/Algebra/Lie/Nilpotent.lean
493
496
theorem ucs_eq_self_of_normalizer_eq_self (h : N₁.normalizer = N₁) (k : β„•) : N₁.ucs k = N₁ := by
induction' k with k ih Β· simp Β· rwa [ucs_succ, ih]
[ " ucs k N₁ ≀ ucs k Nβ‚‚", " ucs 0 N₁ ≀ ucs 0 Nβ‚‚", " ucs (k + 1) N₁ ≀ ucs (k + 1) Nβ‚‚", " (ucs k N₁).normalizer ≀ (ucs k Nβ‚‚).normalizer", " ucs k N₁ = N₁", " ucs 0 N₁ = N₁", " ucs (k + 1) N₁ = N₁" ]
[ " ucs k N₁ ≀ ucs k Nβ‚‚", " ucs 0 N₁ ≀ ucs 0 Nβ‚‚", " ucs (k + 1) N₁ ≀ ucs (k + 1) Nβ‚‚", " (ucs k N₁).normalizer ≀ (ucs k Nβ‚‚).normalizer", " ucs k N₁ = N₁" ]
import Mathlib.Data.Finset.Grade import Mathlib.Order.Interval.Finset.Basic #align_import data.finset.interval from "leanprover-community/mathlib"@"98e83c3d541c77cdb7da20d79611a780ff8e7d90" variable {Ξ± Ξ² : Type*} namespace Finset section Decidable variable [DecidableEq Ξ±] (s t : Finset Ξ±) instance instLocallyFiniteOrder : LocallyFiniteOrder (Finset Ξ±) where finsetIcc s t := t.powerset.filter (s βŠ† Β·) finsetIco s t := t.ssubsets.filter (s βŠ† Β·) finsetIoc s t := t.powerset.filter (s βŠ‚ Β·) finsetIoo s t := t.ssubsets.filter (s βŠ‚ Β·) finset_mem_Icc s t u := by rw [mem_filter, mem_powerset] exact and_comm finset_mem_Ico s t u := by rw [mem_filter, mem_ssubsets] exact and_comm finset_mem_Ioc s t u := by rw [mem_filter, mem_powerset] exact and_comm finset_mem_Ioo s t u := by rw [mem_filter, mem_ssubsets] exact and_comm theorem Icc_eq_filter_powerset : Icc s t = t.powerset.filter (s βŠ† Β·) := rfl #align finset.Icc_eq_filter_powerset Finset.Icc_eq_filter_powerset theorem Ico_eq_filter_ssubsets : Ico s t = t.ssubsets.filter (s βŠ† Β·) := rfl #align finset.Ico_eq_filter_ssubsets Finset.Ico_eq_filter_ssubsets theorem Ioc_eq_filter_powerset : Ioc s t = t.powerset.filter (s βŠ‚ Β·) := rfl #align finset.Ioc_eq_filter_powerset Finset.Ioc_eq_filter_powerset theorem Ioo_eq_filter_ssubsets : Ioo s t = t.ssubsets.filter (s βŠ‚ Β·) := rfl #align finset.Ioo_eq_filter_ssubsets Finset.Ioo_eq_filter_ssubsets theorem Iic_eq_powerset : Iic s = s.powerset := filter_true_of_mem fun t _ => empty_subset t #align finset.Iic_eq_powerset Finset.Iic_eq_powerset theorem Iio_eq_ssubsets : Iio s = s.ssubsets := filter_true_of_mem fun t _ => empty_subset t #align finset.Iio_eq_ssubsets Finset.Iio_eq_ssubsets variable {s t} theorem Icc_eq_image_powerset (h : s βŠ† t) : Icc s t = (t \ s).powerset.image (s βˆͺ Β·) := by ext u simp_rw [mem_Icc, mem_image, mem_powerset] constructor Β· rintro ⟨hs, ht⟩ exact ⟨u \ s, sdiff_le_sdiff_right ht, sup_sdiff_cancel_right hs⟩ Β· rintro ⟨v, hv, rfl⟩ exact ⟨le_sup_left, union_subset h <| hv.trans sdiff_subset⟩ #align finset.Icc_eq_image_powerset Finset.Icc_eq_image_powerset theorem Ico_eq_image_ssubsets (h : s βŠ† t) : Ico s t = (t \ s).ssubsets.image (s βˆͺ Β·) := by ext u simp_rw [mem_Ico, mem_image, mem_ssubsets] constructor Β· rintro ⟨hs, ht⟩ exact ⟨u \ s, sdiff_lt_sdiff_right ht hs, sup_sdiff_cancel_right hs⟩ Β· rintro ⟨v, hv, rfl⟩ exact ⟨le_sup_left, sup_lt_of_lt_sdiff_left hv h⟩ #align finset.Ico_eq_image_ssubsets Finset.Ico_eq_image_ssubsets
Mathlib/Data/Finset/Interval.lean
101
106
theorem card_Icc_finset (h : s βŠ† t) : (Icc s t).card = 2 ^ (t.card - s.card) := by
rw [← card_sdiff h, ← card_powerset, Icc_eq_image_powerset h, Finset.card_image_iff] rintro u hu v hv (huv : s βŠ” u = s βŠ” v) rw [mem_coe, mem_powerset] at hu hv rw [← (disjoint_sdiff.mono_right hu : Disjoint s u).sup_sdiff_cancel_left, ← (disjoint_sdiff.mono_right hv : Disjoint s v).sup_sdiff_cancel_left, huv]
[ " u ∈ (fun s t => filter (fun x => s βŠ† x) t.powerset) s t ↔ s ≀ u ∧ u ≀ t", " u βŠ† t ∧ s βŠ† u ↔ s ≀ u ∧ u ≀ t", " u ∈ (fun s t => filter (fun x => s βŠ† x) t.ssubsets) s t ↔ s ≀ u ∧ u < t", " u βŠ‚ t ∧ s βŠ† u ↔ s ≀ u ∧ u < t", " u ∈ (fun s t => filter (fun x => s βŠ‚ x) t.powerset) s t ↔ s < u ∧ u ≀ t", " u βŠ† t ∧ ...
[ " u ∈ (fun s t => filter (fun x => s βŠ† x) t.powerset) s t ↔ s ≀ u ∧ u ≀ t", " u βŠ† t ∧ s βŠ† u ↔ s ≀ u ∧ u ≀ t", " u ∈ (fun s t => filter (fun x => s βŠ† x) t.ssubsets) s t ↔ s ≀ u ∧ u < t", " u βŠ‚ t ∧ s βŠ† u ↔ s ≀ u ∧ u < t", " u ∈ (fun s t => filter (fun x => s βŠ‚ x) t.powerset) s t ↔ s < u ∧ u ≀ t", " u βŠ† t ∧ ...
import Mathlib.Algebra.Group.Submonoid.Membership import Mathlib.Algebra.Order.BigOperators.Group.List import Mathlib.Data.Set.Pointwise.SMul import Mathlib.Order.WellFoundedSet #align_import group_theory.submonoid.pointwise from "leanprover-community/mathlib"@"2bbc7e3884ba234309d2a43b19144105a753292e" open Set Pointwise variable {Ξ± : Type*} {G : Type*} {M : Type*} {R : Type*} {A : Type*} variable [Monoid M] [AddMonoid A] namespace Submonoid namespace AddSubmonoid namespace Set.IsPWO variable [OrderedCancelCommMonoid Ξ±] {s : Set Ξ±} @[to_additive]
Mathlib/Algebra/Group/Submonoid/Pointwise.lean
700
704
theorem submonoid_closure (hpos : βˆ€ x : Ξ±, x ∈ s β†’ 1 ≀ x) (h : s.IsPWO) : IsPWO (Submonoid.closure s : Set Ξ±) := by
rw [Submonoid.closure_eq_image_prod] refine (h.partiallyWellOrderedOn_sublistForallβ‚‚ (Β· ≀ Β·)).image_of_monotone_on ?_ exact fun l1 _ l2 hl2 h12 => h12.prod_le_prod' fun x hx => hpos x <| hl2 x hx
[ " (↑(closure s)).IsPWO", " (List.prod '' {l | βˆ€ x ∈ l, x ∈ s}).IsPWO", " βˆ€ a₁ ∈ {l | βˆ€ x ∈ l, x ∈ s},\n βˆ€ aβ‚‚ ∈ {l | βˆ€ x ∈ l, x ∈ s}, List.SublistForallβ‚‚ (fun x x_1 => x ≀ x_1) a₁ aβ‚‚ β†’ a₁.prod ≀ aβ‚‚.prod" ]
[ " (↑(closure s)).IsPWO" ]
import Mathlib.Data.Int.Interval import Mathlib.RingTheory.Binomial import Mathlib.RingTheory.HahnSeries.PowerSeries import Mathlib.RingTheory.HahnSeries.Summable import Mathlib.FieldTheory.RatFunc.AsPolynomial import Mathlib.RingTheory.Localization.FractionRing #align_import ring_theory.laurent_series from "leanprover-community/mathlib"@"831c494092374cfe9f50591ed0ac81a25efc5b86" universe u open scoped Classical open HahnSeries Polynomial noncomputable section abbrev LaurentSeries (R : Type u) [Zero R] := HahnSeries β„€ R #align laurent_series LaurentSeries variable {R : Type*} namespace LaurentSeries section Semiring variable [Semiring R] instance : Coe (PowerSeries R) (LaurentSeries R) := ⟨HahnSeries.ofPowerSeries β„€ R⟩ #noalign laurent_series.coe_power_series @[simp] theorem coeff_coe_powerSeries (x : PowerSeries R) (n : β„•) : HahnSeries.coeff (x : LaurentSeries R) n = PowerSeries.coeff R n x := by rw [ofPowerSeries_apply_coeff] #align laurent_series.coeff_coe_power_series LaurentSeries.coeff_coe_powerSeries def powerSeriesPart (x : LaurentSeries R) : PowerSeries R := PowerSeries.mk fun n => x.coeff (x.order + n) #align laurent_series.power_series_part LaurentSeries.powerSeriesPart @[simp] theorem powerSeriesPart_coeff (x : LaurentSeries R) (n : β„•) : PowerSeries.coeff R n x.powerSeriesPart = x.coeff (x.order + n) := PowerSeries.coeff_mk _ _ #align laurent_series.power_series_part_coeff LaurentSeries.powerSeriesPart_coeff @[simp] theorem powerSeriesPart_zero : powerSeriesPart (0 : LaurentSeries R) = 0 := by ext simp [(PowerSeries.coeff _ _).map_zero] -- Note: this doesn't get picked up any more #align laurent_series.power_series_part_zero LaurentSeries.powerSeriesPart_zero @[simp]
Mathlib/RingTheory/LaurentSeries.lean
112
121
theorem powerSeriesPart_eq_zero (x : LaurentSeries R) : x.powerSeriesPart = 0 ↔ x = 0 := by
constructor · contrapose! simp only [ne_eq] intro h rw [PowerSeries.ext_iff, not_forall] refine ⟨0, ?_⟩ simp [coeff_order_ne_zero h] · rintro rfl simp
[ " ((ofPowerSeries β„€ R) x).coeff ↑n = (PowerSeries.coeff R n) x", " powerSeriesPart 0 = 0", " (PowerSeries.coeff R n✝) (powerSeriesPart 0) = (PowerSeries.coeff R n✝) 0", " x.powerSeriesPart = 0 ↔ x = 0", " x.powerSeriesPart = 0 β†’ x = 0", " x β‰  0 β†’ x.powerSeriesPart β‰  0", " Β¬x = 0 β†’ Β¬x.powerSeriesPart = 0...
[ " ((ofPowerSeries β„€ R) x).coeff ↑n = (PowerSeries.coeff R n) x", " powerSeriesPart 0 = 0", " (PowerSeries.coeff R n✝) (powerSeriesPart 0) = (PowerSeries.coeff R n✝) 0", " x.powerSeriesPart = 0 ↔ x = 0" ]
import Mathlib.MeasureTheory.Measure.MeasureSpace import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic #align_import measure_theory.measure.open_pos from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Topology ENNReal MeasureTheory open Set Function Filter namespace MeasureTheory namespace Measure section Basic variable {X Y : Type*} [TopologicalSpace X] {m : MeasurableSpace X} [TopologicalSpace Y] [T2Space Y] (ΞΌ Ξ½ : Measure X) class IsOpenPosMeasure : Prop where open_pos : βˆ€ U : Set X, IsOpen U β†’ U.Nonempty β†’ ΞΌ U β‰  0 #align measure_theory.measure.is_open_pos_measure MeasureTheory.Measure.IsOpenPosMeasure variable [IsOpenPosMeasure ΞΌ] {s U F : Set X} {x : X} theorem _root_.IsOpen.measure_ne_zero (hU : IsOpen U) (hne : U.Nonempty) : ΞΌ U β‰  0 := IsOpenPosMeasure.open_pos U hU hne #align is_open.measure_ne_zero IsOpen.measure_ne_zero theorem _root_.IsOpen.measure_pos (hU : IsOpen U) (hne : U.Nonempty) : 0 < ΞΌ U := (hU.measure_ne_zero ΞΌ hne).bot_lt #align is_open.measure_pos IsOpen.measure_pos instance (priority := 100) [Nonempty X] : NeZero ΞΌ := ⟨measure_univ_pos.mp <| isOpen_univ.measure_pos ΞΌ univ_nonempty⟩ theorem _root_.IsOpen.measure_pos_iff (hU : IsOpen U) : 0 < ΞΌ U ↔ U.Nonempty := ⟨fun h => nonempty_iff_ne_empty.2 fun he => h.ne' <| he.symm β–Έ measure_empty, hU.measure_pos μ⟩ #align is_open.measure_pos_iff IsOpen.measure_pos_iff theorem _root_.IsOpen.measure_eq_zero_iff (hU : IsOpen U) : ΞΌ U = 0 ↔ U = βˆ… := by simpa only [not_lt, nonpos_iff_eq_zero, not_nonempty_iff_eq_empty] using not_congr (hU.measure_pos_iff ΞΌ) #align is_open.measure_eq_zero_iff IsOpen.measure_eq_zero_iff theorem measure_pos_of_nonempty_interior (h : (interior s).Nonempty) : 0 < ΞΌ s := (isOpen_interior.measure_pos ΞΌ h).trans_le (measure_mono interior_subset) #align measure_theory.measure.measure_pos_of_nonempty_interior MeasureTheory.Measure.measure_pos_of_nonempty_interior theorem measure_pos_of_mem_nhds (h : s ∈ 𝓝 x) : 0 < ΞΌ s := measure_pos_of_nonempty_interior _ ⟨x, mem_interior_iff_mem_nhds.2 h⟩ #align measure_theory.measure.measure_pos_of_mem_nhds MeasureTheory.Measure.measure_pos_of_mem_nhds theorem isOpenPosMeasure_smul {c : ℝβ‰₯0∞} (h : c β‰  0) : IsOpenPosMeasure (c β€’ ΞΌ) := ⟨fun _U Uo Une => mul_ne_zero h (Uo.measure_ne_zero ΞΌ Une)⟩ #align measure_theory.measure.is_open_pos_measure_smul MeasureTheory.Measure.isOpenPosMeasure_smul variable {ΞΌ Ξ½} protected theorem AbsolutelyContinuous.isOpenPosMeasure (h : ΞΌ β‰ͺ Ξ½) : IsOpenPosMeasure Ξ½ := ⟨fun _U ho hne hβ‚€ => ho.measure_ne_zero ΞΌ hne (h hβ‚€)⟩ #align measure_theory.measure.absolutely_continuous.is_open_pos_measure MeasureTheory.Measure.AbsolutelyContinuous.isOpenPosMeasure theorem _root_.LE.le.isOpenPosMeasure (h : ΞΌ ≀ Ξ½) : IsOpenPosMeasure Ξ½ := h.absolutelyContinuous.isOpenPosMeasure #align has_le.le.is_open_pos_measure LE.le.isOpenPosMeasure theorem _root_.IsOpen.measure_zero_iff_eq_empty (hU : IsOpen U) : ΞΌ U = 0 ↔ U = βˆ… := ⟨fun h ↦ (hU.measure_eq_zero_iff ΞΌ).mp h, fun h ↦ by simp [h]⟩ theorem _root_.IsOpen.ae_eq_empty_iff_eq (hU : IsOpen U) : U =ᡐ[ΞΌ] (βˆ… : Set X) ↔ U = βˆ… := by rw [ae_eq_empty, hU.measure_zero_iff_eq_empty] theorem _root_.IsOpen.eq_empty_of_measure_zero (hU : IsOpen U) (hβ‚€ : ΞΌ U = 0) : U = βˆ… := (hU.measure_eq_zero_iff ΞΌ).mp hβ‚€ #align is_open.eq_empty_of_measure_zero IsOpen.eq_empty_of_measure_zero
Mathlib/MeasureTheory/Measure/OpenPos.lean
97
100
theorem _root_.IsClosed.ae_eq_univ_iff_eq (hF : IsClosed F) : F =ᡐ[ΞΌ] univ ↔ F = univ := by
refine ⟨fun h ↦ ?_, fun h ↦ by rw [h]⟩ rwa [ae_eq_univ, hF.isOpen_compl.measure_eq_zero_iff ΞΌ, compl_empty_iff] at h
[ " ΞΌ U = 0 ↔ U = βˆ…", " ΞΌ U = 0", " U =αΆ [ae ΞΌ] βˆ… ↔ U = βˆ…", " F =αΆ [ae ΞΌ] univ ↔ F = univ", " F =αΆ [ae ΞΌ] univ", " F = univ" ]
[ " ΞΌ U = 0 ↔ U = βˆ…", " ΞΌ U = 0", " U =αΆ [ae ΞΌ] βˆ… ↔ U = βˆ…", " F =αΆ [ae ΞΌ] univ ↔ F = univ" ]
import Mathlib.LinearAlgebra.Basis.VectorSpace import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.Finite #align_import field_theory.finiteness from "leanprover-community/mathlib"@"039a089d2a4b93c761b234f3e5f5aeb752bac60f" universe u v open scoped Classical open Cardinal open Cardinal Submodule Module Function namespace IsNoetherian variable {K : Type u} {V : Type v} [DivisionRing K] [AddCommGroup V] [Module K V] theorem iff_rank_lt_aleph0 : IsNoetherian K V ↔ Module.rank K V < β„΅β‚€ := by let b := Basis.ofVectorSpace K V rw [← b.mk_eq_rank'', lt_aleph0_iff_set_finite] constructor Β· intro exact (Basis.ofVectorSpaceIndex.linearIndependent K V).set_finite_of_isNoetherian Β· intro hbfinite refine @isNoetherian_of_linearEquiv K (⊀ : Submodule K V) V _ _ _ _ _ (LinearEquiv.ofTop _ rfl) (id ?_) refine isNoetherian_of_fg_of_noetherian _ ⟨Set.Finite.toFinset hbfinite, ?_⟩ rw [Set.Finite.coe_toFinset, ← b.span_eq, Basis.coe_ofVectorSpace, Subtype.range_coe] #align is_noetherian.iff_rank_lt_aleph_0 IsNoetherian.iff_rank_lt_aleph0 #align is_noetherian.rank_lt_aleph_0 rank_lt_aleph0 noncomputable def fintypeBasisIndex {ΞΉ : Type*} [IsNoetherian K V] (b : Basis ΞΉ K V) : Fintype ΞΉ := b.fintypeIndexOfRankLtAleph0 (rank_lt_aleph0 K V) #align is_noetherian.fintype_basis_index IsNoetherian.fintypeBasisIndex noncomputable instance [IsNoetherian K V] : Fintype (Basis.ofVectorSpaceIndex K V) := fintypeBasisIndex (Basis.ofVectorSpace K V) theorem finite_basis_index {ΞΉ : Type*} {s : Set ΞΉ} [IsNoetherian K V] (b : Basis s K V) : s.Finite := b.finite_index_of_rank_lt_aleph0 (rank_lt_aleph0 K V) #align is_noetherian.finite_basis_index IsNoetherian.finite_basis_index variable (K V) noncomputable def finsetBasisIndex [IsNoetherian K V] : Finset V := (finite_basis_index (Basis.ofVectorSpace K V)).toFinset #align is_noetherian.finset_basis_index IsNoetherian.finsetBasisIndex @[simp] theorem coe_finsetBasisIndex [IsNoetherian K V] : (↑(finsetBasisIndex K V) : Set V) = Basis.ofVectorSpaceIndex K V := Set.Finite.coe_toFinset _ #align is_noetherian.coe_finset_basis_index IsNoetherian.coe_finsetBasisIndex @[simp] theorem coeSort_finsetBasisIndex [IsNoetherian K V] : (finsetBasisIndex K V : Type _) = Basis.ofVectorSpaceIndex K V := Set.Finite.coeSort_toFinset _ #align is_noetherian.coe_sort_finset_basis_index IsNoetherian.coeSort_finsetBasisIndex noncomputable def finsetBasis [IsNoetherian K V] : Basis (finsetBasisIndex K V) K V := (Basis.ofVectorSpace K V).reindex (by rw [coeSort_finsetBasisIndex]) #align is_noetherian.finset_basis IsNoetherian.finsetBasis @[simp] theorem range_finsetBasis [IsNoetherian K V] : Set.range (finsetBasis K V) = Basis.ofVectorSpaceIndex K V := by rw [finsetBasis, Basis.range_reindex, Basis.range_ofVectorSpace] #align is_noetherian.range_finset_basis IsNoetherian.range_finsetBasis variable {K V}
Mathlib/FieldTheory/Finiteness.lean
103
112
theorem iff_fg : IsNoetherian K V ↔ Module.Finite K V := by
constructor Β· intro h exact ⟨⟨finsetBasisIndex K V, by convert (finsetBasis K V).span_eq simp⟩⟩ Β· rintro ⟨s, hs⟩ rw [IsNoetherian.iff_rank_lt_aleph0, ← rank_top, ← hs] exact lt_of_le_of_lt (rank_span_le _) s.finite_toSet.lt_aleph0
[ " IsNoetherian K V ↔ Module.rank K V < β„΅β‚€", " IsNoetherian K V ↔ (Basis.ofVectorSpaceIndex K V).Finite", " IsNoetherian K V β†’ (Basis.ofVectorSpaceIndex K V).Finite", " (Basis.ofVectorSpaceIndex K V).Finite", " (Basis.ofVectorSpaceIndex K V).Finite β†’ IsNoetherian K V", " IsNoetherian K V", " IsNoetherian...
[ " IsNoetherian K V ↔ Module.rank K V < β„΅β‚€", " IsNoetherian K V ↔ (Basis.ofVectorSpaceIndex K V).Finite", " IsNoetherian K V β†’ (Basis.ofVectorSpaceIndex K V).Finite", " (Basis.ofVectorSpaceIndex K V).Finite", " (Basis.ofVectorSpaceIndex K V).Finite β†’ IsNoetherian K V", " IsNoetherian K V", " IsNoetherian...
import Mathlib.Data.Set.Image import Mathlib.Order.Interval.Set.Basic #align_import data.set.intervals.with_bot_top from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105" open Set variable {Ξ± : Type*} namespace WithTop @[simp] theorem preimage_coe_top : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' {⊀} = (βˆ… : Set Ξ±) := eq_empty_of_subset_empty fun _ => coe_ne_top #align with_top.preimage_coe_top WithTop.preimage_coe_top variable [Preorder Ξ±] {a b : Ξ±} theorem range_coe : range (some : Ξ± β†’ WithTop Ξ±) = Iio ⊀ := by ext x rw [mem_Iio, WithTop.lt_top_iff_ne_top, mem_range, ne_top_iff_exists] #align with_top.range_coe WithTop.range_coe @[simp] theorem preimage_coe_Ioi : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ioi a = Ioi a := ext fun _ => coe_lt_coe #align with_top.preimage_coe_Ioi WithTop.preimage_coe_Ioi @[simp] theorem preimage_coe_Ici : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ici a = Ici a := ext fun _ => coe_le_coe #align with_top.preimage_coe_Ici WithTop.preimage_coe_Ici @[simp] theorem preimage_coe_Iio : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Iio a = Iio a := ext fun _ => coe_lt_coe #align with_top.preimage_coe_Iio WithTop.preimage_coe_Iio @[simp] theorem preimage_coe_Iic : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Iic a = Iic a := ext fun _ => coe_le_coe #align with_top.preimage_coe_Iic WithTop.preimage_coe_Iic @[simp] theorem preimage_coe_Icc : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Icc a b = Icc a b := by simp [← Ici_inter_Iic] #align with_top.preimage_coe_Icc WithTop.preimage_coe_Icc @[simp] theorem preimage_coe_Ico : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ico a b = Ico a b := by simp [← Ici_inter_Iio] #align with_top.preimage_coe_Ico WithTop.preimage_coe_Ico @[simp] theorem preimage_coe_Ioc : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ioc a b = Ioc a b := by simp [← Ioi_inter_Iic] #align with_top.preimage_coe_Ioc WithTop.preimage_coe_Ioc @[simp] theorem preimage_coe_Ioo : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ioo a b = Ioo a b := by simp [← Ioi_inter_Iio] #align with_top.preimage_coe_Ioo WithTop.preimage_coe_Ioo @[simp] theorem preimage_coe_Iio_top : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Iio ⊀ = univ := by rw [← range_coe, preimage_range] #align with_top.preimage_coe_Iio_top WithTop.preimage_coe_Iio_top @[simp] theorem preimage_coe_Ico_top : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ico a ⊀ = Ici a := by simp [← Ici_inter_Iio] #align with_top.preimage_coe_Ico_top WithTop.preimage_coe_Ico_top @[simp] theorem preimage_coe_Ioo_top : (some : Ξ± β†’ WithTop Ξ±) ⁻¹' Ioo a ⊀ = Ioi a := by simp [← Ioi_inter_Iio] #align with_top.preimage_coe_Ioo_top WithTop.preimage_coe_Ioo_top
Mathlib/Order/Interval/Set/WithBotTop.lean
89
90
theorem image_coe_Ioi : (some : Ξ± β†’ WithTop Ξ±) '' Ioi a = Ioo (a : WithTop Ξ±) ⊀ := by
rw [← preimage_coe_Ioi, image_preimage_eq_inter_range, range_coe, Ioi_inter_Iio]
[ " range some = Iio ⊀", " x ∈ range some ↔ x ∈ Iio ⊀", " some ⁻¹' Icc ↑a ↑b = Icc a b", " some ⁻¹' Ico ↑a ↑b = Ico a b", " some ⁻¹' Ioc ↑a ↑b = Ioc a b", " some ⁻¹' Ioo ↑a ↑b = Ioo a b", " some ⁻¹' Iio ⊀ = univ", " some ⁻¹' Ico ↑a ⊀ = Ici a", " some ⁻¹' Ioo ↑a ⊀ = Ioi a", " some '' Ioi a = Ioo ↑a ⊀...
[ " range some = Iio ⊀", " x ∈ range some ↔ x ∈ Iio ⊀", " some ⁻¹' Icc ↑a ↑b = Icc a b", " some ⁻¹' Ico ↑a ↑b = Ico a b", " some ⁻¹' Ioc ↑a ↑b = Ioc a b", " some ⁻¹' Ioo ↑a ↑b = Ioo a b", " some ⁻¹' Iio ⊀ = univ", " some ⁻¹' Ico ↑a ⊀ = Ici a", " some ⁻¹' Ioo ↑a ⊀ = Ioi a", " some '' Ioi a = Ioo ↑a ⊀...
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] 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' theorem gaugeRescale_self {s : Set E} (hsa : Absorbent ℝ s) (hsb : IsVonNBounded ℝ s) : gaugeRescale s s = id := funext <| gaugeRescale_self_apply hsa hsb theorem gauge_gaugeRescale' (s : Set E) {t : Set E} {x : E} (hx : gauge t x β‰  0) : gauge t (gaugeRescale s t x) = gauge s x := by rw [gaugeRescale, gauge_smul_of_nonneg (div_nonneg (gauge_nonneg _) (gauge_nonneg _)), smul_eq_mul, div_mul_cancelβ‚€ _ hx]
Mathlib/Analysis/Convex/GaugeRescale.lean
63
67
theorem gauge_gaugeRescale (s : Set E) {t : Set E} (hta : Absorbent ℝ t) (htb : IsVonNBounded ℝ t) (x : E) : gauge t (gaugeRescale s t x) = gauge s x := by
rcases eq_or_ne x 0 with rfl | hx Β· simp Β· exact gauge_gaugeRescale' s ((gauge_pos hta htb).2 hx).ne'
[ " gaugeRescale s t (c β€’ x) = c β€’ gaugeRescale s t x", " (c * gauge s x / (c * gauge t x) * c) β€’ x = (c * (gauge s x / gauge t x)) β€’ x", " gaugeRescale s s x = x", " gaugeRescale s s 0 = 0", " gauge s x β‰  0", " gauge t (gaugeRescale s t x) = gauge s x", " gauge t (gaugeRescale s t 0) = gauge s 0" ]
[ " gaugeRescale s t (c β€’ x) = c β€’ gaugeRescale s t x", " (c * gauge s x / (c * gauge t x) * c) β€’ x = (c * (gauge s x / gauge t x)) β€’ x", " gaugeRescale s s x = x", " gaugeRescale s s 0 = 0", " gauge s x β‰  0", " gauge t (gaugeRescale s t x) = gauge s x" ]
import Mathlib.Data.Set.Pointwise.Interval import Mathlib.LinearAlgebra.AffineSpace.Basic import Mathlib.LinearAlgebra.BilinearMap import Mathlib.LinearAlgebra.Pi import Mathlib.LinearAlgebra.Prod #align_import linear_algebra.affine_space.affine_map from "leanprover-community/mathlib"@"bd1fc183335ea95a9519a1630bcf901fe9326d83" open Affine structure AffineMap (k : Type*) {V1 : Type*} (P1 : Type*) {V2 : Type*} (P2 : Type*) [Ring k] [AddCommGroup V1] [Module k V1] [AffineSpace V1 P1] [AddCommGroup V2] [Module k V2] [AffineSpace V2 P2] where toFun : P1 β†’ P2 linear : V1 β†’β‚—[k] V2 map_vadd' : βˆ€ (p : P1) (v : V1), toFun (v +α΅₯ p) = linear v +α΅₯ toFun p #align affine_map AffineMap notation:25 P1 " →ᡃ[" k:25 "] " P2:0 => AffineMap k P1 P2 instance AffineMap.instFunLike (k : Type*) {V1 : Type*} (P1 : Type*) {V2 : Type*} (P2 : Type*) [Ring k] [AddCommGroup V1] [Module k V1] [AffineSpace V1 P1] [AddCommGroup V2] [Module k V2] [AffineSpace V2 P2] : FunLike (P1 →ᡃ[k] P2) P1 P2 where coe := AffineMap.toFun coe_injective' := fun ⟨f, f_linear, f_add⟩ ⟨g, g_linear, g_add⟩ => fun (h : f = g) => by cases' (AddTorsor.nonempty : Nonempty P1) with p congr with v apply vadd_right_cancel (f p) erw [← f_add, h, ← g_add] #align affine_map.fun_like AffineMap.instFunLike instance AffineMap.hasCoeToFun (k : Type*) {V1 : Type*} (P1 : Type*) {V2 : Type*} (P2 : Type*) [Ring k] [AddCommGroup V1] [Module k V1] [AffineSpace V1 P1] [AddCommGroup V2] [Module k V2] [AffineSpace V2 P2] : CoeFun (P1 →ᡃ[k] P2) fun _ => P1 β†’ P2 := DFunLike.hasCoeToFun #align affine_map.has_coe_to_fun AffineMap.hasCoeToFun namespace AffineMap variable {k : Type*} {V1 : Type*} {P1 : Type*} {V2 : Type*} {P2 : Type*} {V3 : Type*} {P3 : Type*} {V4 : Type*} {P4 : Type*} [Ring k] [AddCommGroup V1] [Module k V1] [AffineSpace V1 P1] [AddCommGroup V2] [Module k V2] [AffineSpace V2 P2] [AddCommGroup V3] [Module k V3] [AffineSpace V3 P3] [AddCommGroup V4] [Module k V4] [AffineSpace V4 P4] @[simp] theorem coe_mk (f : P1 β†’ P2) (linear add) : ((mk f linear add : P1 →ᡃ[k] P2) : P1 β†’ P2) = f := rfl #align affine_map.coe_mk AffineMap.coe_mk @[simp] theorem toFun_eq_coe (f : P1 →ᡃ[k] P2) : f.toFun = ⇑f := rfl #align affine_map.to_fun_eq_coe AffineMap.toFun_eq_coe @[simp] theorem map_vadd (f : P1 →ᡃ[k] P2) (p : P1) (v : V1) : f (v +α΅₯ p) = f.linear v +α΅₯ f p := f.map_vadd' p v #align affine_map.map_vadd AffineMap.map_vadd @[simp] theorem linearMap_vsub (f : P1 →ᡃ[k] P2) (p1 p2 : P1) : f.linear (p1 -α΅₯ p2) = f p1 -α΅₯ f p2 := by conv_rhs => rw [← vsub_vadd p1 p2, map_vadd, vadd_vsub] #align affine_map.linear_map_vsub AffineMap.linearMap_vsub @[ext] theorem ext {f g : P1 →ᡃ[k] P2} (h : βˆ€ p, f p = g p) : f = g := DFunLike.ext _ _ h #align affine_map.ext AffineMap.ext theorem ext_iff {f g : P1 →ᡃ[k] P2} : f = g ↔ βˆ€ p, f p = g p := ⟨fun h _ => h β–Έ rfl, ext⟩ #align affine_map.ext_iff AffineMap.ext_iff theorem coeFn_injective : @Function.Injective (P1 →ᡃ[k] P2) (P1 β†’ P2) (⇑) := DFunLike.coe_injective #align affine_map.coe_fn_injective AffineMap.coeFn_injective protected theorem congr_arg (f : P1 →ᡃ[k] P2) {x y : P1} (h : x = y) : f x = f y := congr_arg _ h #align affine_map.congr_arg AffineMap.congr_arg protected theorem congr_fun {f g : P1 →ᡃ[k] P2} (h : f = g) (x : P1) : f x = g x := h β–Έ rfl #align affine_map.congr_fun AffineMap.congr_fun
Mathlib/LinearAlgebra/AffineSpace/AffineMap.lean
162
169
theorem ext_linear {f g : P1 →ᡃ[k] P2} (h₁ : f.linear = g.linear) {p : P1} (hβ‚‚ : f p = g p) : f = g := by
ext q have hgl : g.linear (q -α΅₯ p) = toFun g ((q -α΅₯ p) +α΅₯ q) -α΅₯ toFun g q := by simp have := f.map_vadd' q (q -α΅₯ p) rw [h₁, hgl, toFun_eq_coe, map_vadd, linearMap_vsub, hβ‚‚] at this simp at this exact this
[ " { toFun := f, linear := f_linear, map_vadd' := f_add } = { toFun := g, linear := g_linear, map_vadd' := g_add }", " f_linear v = g_linear v", " f_linear v +α΅₯ f p = g_linear v +α΅₯ f p", " f.linear (p1 -α΅₯ p2) = f p1 -α΅₯ f p2", "k : Type u_1\nV1 : Type u_2\nP1 : Type u_3\nV2 : Type u_4\nP2 : Type u_5\nV3 : Typ...
[ " { toFun := f, linear := f_linear, map_vadd' := f_add } = { toFun := g, linear := g_linear, map_vadd' := g_add }", " f_linear v = g_linear v", " f_linear v +α΅₯ f p = g_linear v +α΅₯ f p", " f.linear (p1 -α΅₯ p2) = f p1 -α΅₯ f p2", "k : Type u_1\nV1 : Type u_2\nP1 : Type u_3\nV2 : Type u_4\nP2 : Type u_5\nV3 : Typ...
import Mathlib.Data.List.Duplicate import Mathlib.Data.List.Sort #align_import data.list.nodup_equiv_fin from "leanprover-community/mathlib"@"008205aa645b3f194c1da47025c5f110c8406eab" namespace List variable {Ξ± : Type*} section Sublist
Mathlib/Data/List/NodupEquivFin.lean
116
137
theorem sublist_of_orderEmbedding_get?_eq {l l' : List Ξ±} (f : β„• β†ͺo β„•) (hf : βˆ€ ix : β„•, l.get? ix = l'.get? (f ix)) : l <+ l' := by
induction' l with hd tl IH generalizing l' f Β· simp have : some hd = _ := hf 0 rw [eq_comm, List.get?_eq_some] at this obtain ⟨w, h⟩ := this let f' : β„• β†ͺo β„• := OrderEmbedding.ofMapLEIff (fun i => f (i + 1) - (f 0 + 1)) fun a b => by dsimp only rw [Nat.sub_le_sub_iff_right, OrderEmbedding.le_iff_le, Nat.succ_le_succ_iff] rw [Nat.succ_le_iff, OrderEmbedding.lt_iff_lt] exact b.succ_pos have : βˆ€ ix, tl.get? ix = (l'.drop (f 0 + 1)).get? (f' ix) := by intro ix rw [List.get?_drop, OrderEmbedding.coe_ofMapLEIff, Nat.add_sub_cancel', ← hf, List.get?] rw [Nat.succ_le_iff, OrderEmbedding.lt_iff_lt] exact ix.succ_pos rw [← List.take_append_drop (f 0 + 1) l', ← List.singleton_append] apply List.Sublist.append _ (IH _ this) rw [List.singleton_sublist, ← h, l'.get_take _ (Nat.lt_succ_self _)] apply List.get_mem
[ " l <+ l'", " [] <+ l'", " hd :: tl <+ l'", " (fun i => f (i + 1) - (f 0 + 1)) a ≀ (fun i => f (i + 1) - (f 0 + 1)) b ↔ a ≀ b", " f (a + 1) - (f 0 + 1) ≀ f (b + 1) - (f 0 + 1) ↔ a ≀ b", " f 0 + 1 ≀ f (b + 1)", " 0 < b + 1", " βˆ€ (ix : β„•), tl.get? ix = (drop (f 0 + 1) l').get? (f' ix)", " tl.get? ix =...
[ " l <+ l'" ]
import Mathlib.Algebra.FreeMonoid.Basic import Mathlib.Algebra.Group.Submonoid.MulOpposite import Mathlib.Algebra.Group.Submonoid.Operations import Mathlib.Algebra.GroupWithZero.Divisibility import Mathlib.Data.Finset.NoncommProd import Mathlib.Data.Int.Order.Lemmas #align_import group_theory.submonoid.membership from "leanprover-community/mathlib"@"e655e4ea5c6d02854696f97494997ba4c31be802" variable {M A B : Type*} section Assoc variable [Monoid M] [SetLike B M] [SubmonoidClass B M] {S : B} section NonAssoc variable [MulOneClass M] open Set namespace Submonoid -- TODO: this section can be generalized to `[SubmonoidClass B M] [CompleteLattice B]` -- such that `CompleteLattice.LE` coincides with `SetLike.LE` @[to_additive] theorem mem_iSup_of_directed {ΞΉ} [hΞΉ : Nonempty ΞΉ] {S : ΞΉ β†’ Submonoid M} (hS : Directed (Β· ≀ Β·) S) {x : M} : (x ∈ ⨆ i, S i) ↔ βˆƒ i, x ∈ S i := by refine ⟨?_, fun ⟨i, hi⟩ ↦ le_iSup S i hi⟩ suffices x ∈ closure (⋃ i, (S i : Set M)) β†’ βˆƒ i, x ∈ S i by simpa only [closure_iUnion, closure_eq (S _)] using this refine fun hx ↦ closure_induction hx (fun _ ↦ mem_iUnion.1) ?_ ?_ Β· exact hΞΉ.elim fun i ↦ ⟨i, (S i).one_mem⟩ Β· rintro x y ⟨i, hi⟩ ⟨j, hj⟩ rcases hS i j with ⟨k, hki, hkj⟩ exact ⟨k, (S k).mul_mem (hki hi) (hkj hj)⟩ #align submonoid.mem_supr_of_directed Submonoid.mem_iSup_of_directed #align add_submonoid.mem_supr_of_directed AddSubmonoid.mem_iSup_of_directed @[to_additive] theorem coe_iSup_of_directed {ΞΉ} [Nonempty ΞΉ] {S : ΞΉ β†’ Submonoid M} (hS : Directed (Β· ≀ Β·) S) : ((⨆ i, S i : Submonoid M) : Set M) = ⋃ i, S i := Set.ext fun x ↦ by simp [mem_iSup_of_directed hS] #align submonoid.coe_supr_of_directed Submonoid.coe_iSup_of_directed #align add_submonoid.coe_supr_of_directed AddSubmonoid.coe_iSup_of_directed @[to_additive] theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (Β· ≀ Β·) S) {x : M} : x ∈ sSup S ↔ βˆƒ s ∈ S, x ∈ s := by haveI : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, Subtype.coe_mk] #align submonoid.mem_Sup_of_directed_on Submonoid.mem_sSup_of_directedOn #align add_submonoid.mem_Sup_of_directed_on AddSubmonoid.mem_sSup_of_directedOn @[to_additive] theorem coe_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (Β· ≀ Β·) S) : (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s := Set.ext fun x => by simp [mem_sSup_of_directedOn Sne hS] #align submonoid.coe_Sup_of_directed_on Submonoid.coe_sSup_of_directedOn #align add_submonoid.coe_Sup_of_directed_on AddSubmonoid.coe_sSup_of_directedOn @[to_additive]
Mathlib/Algebra/Group/Submonoid/Membership.lean
234
236
theorem mem_sup_left {S T : Submonoid M} : βˆ€ {x : M}, x ∈ S β†’ x ∈ S βŠ” T := by
rw [← SetLike.le_def] exact le_sup_left
[ " x ∈ ⨆ i, S i ↔ βˆƒ i, x ∈ S i", " x ∈ ⨆ i, S i β†’ βˆƒ i, x ∈ S i", " x ∈ closure (⋃ i, ↑(S i)) β†’ βˆƒ i, x ∈ S i", " βˆƒ i, 1 ∈ S i", " βˆ€ (x y : M), (βˆƒ i, x ∈ S i) β†’ (βˆƒ i, y ∈ S i) β†’ βˆƒ i, x * y ∈ S i", " βˆƒ i, x * y ∈ S i", " x ∈ ↑(⨆ i, S i) ↔ x ∈ ⋃ i, ↑(S i)", " x ∈ sSup S ↔ βˆƒ s ∈ S, x ∈ s", " x ∈ ↑(sSup S)...
[ " x ∈ ⨆ i, S i ↔ βˆƒ i, x ∈ S i", " x ∈ ⨆ i, S i β†’ βˆƒ i, x ∈ S i", " x ∈ closure (⋃ i, ↑(S i)) β†’ βˆƒ i, x ∈ S i", " βˆƒ i, 1 ∈ S i", " βˆ€ (x y : M), (βˆƒ i, x ∈ S i) β†’ (βˆƒ i, y ∈ S i) β†’ βˆƒ i, x * y ∈ S i", " βˆƒ i, x * y ∈ S i", " x ∈ ↑(⨆ i, S i) ↔ x ∈ ⋃ i, ↑(S i)", " x ∈ sSup S ↔ βˆƒ s ∈ S, x ∈ s", " x ∈ ↑(sSup S)...
import Mathlib.MeasureTheory.Measure.Restrict open scoped ENNReal NNReal Topology open Set MeasureTheory Measure Filter Function MeasurableSpace ENNReal variable {Ξ± Ξ² Ξ΄ ΞΉ : Type*} namespace MeasureTheory variable {m0 : MeasurableSpace Ξ±} [MeasurableSpace Ξ²] {ΞΌ Ξ½ ν₁ Ξ½β‚‚: Measure Ξ±} {s t : Set Ξ±} section IsFiniteMeasure class IsFiniteMeasure (ΞΌ : Measure Ξ±) : Prop where measure_univ_lt_top : ΞΌ univ < ∞ #align measure_theory.is_finite_measure MeasureTheory.IsFiniteMeasure #align measure_theory.is_finite_measure.measure_univ_lt_top MeasureTheory.IsFiniteMeasure.measure_univ_lt_top theorem not_isFiniteMeasure_iff : Β¬IsFiniteMeasure ΞΌ ↔ ΞΌ Set.univ = ∞ := by refine ⟨fun h => ?_, fun h => fun h' => h'.measure_univ_lt_top.ne h⟩ by_contra h' exact h ⟨lt_top_iff_ne_top.mpr h'⟩ #align measure_theory.not_is_finite_measure_iff MeasureTheory.not_isFiniteMeasure_iff instance Restrict.isFiniteMeasure (ΞΌ : Measure Ξ±) [hs : Fact (ΞΌ s < ∞)] : IsFiniteMeasure (ΞΌ.restrict s) := ⟨by simpa using hs.elim⟩ #align measure_theory.restrict.is_finite_measure MeasureTheory.Restrict.isFiniteMeasure theorem measure_lt_top (ΞΌ : Measure Ξ±) [IsFiniteMeasure ΞΌ] (s : Set Ξ±) : ΞΌ s < ∞ := (measure_mono (subset_univ s)).trans_lt IsFiniteMeasure.measure_univ_lt_top #align measure_theory.measure_lt_top MeasureTheory.measure_lt_top instance isFiniteMeasureRestrict (ΞΌ : Measure Ξ±) (s : Set Ξ±) [h : IsFiniteMeasure ΞΌ] : IsFiniteMeasure (ΞΌ.restrict s) := ⟨by simpa using measure_lt_top ΞΌ s⟩ #align measure_theory.is_finite_measure_restrict MeasureTheory.isFiniteMeasureRestrict theorem measure_ne_top (ΞΌ : Measure Ξ±) [IsFiniteMeasure ΞΌ] (s : Set Ξ±) : ΞΌ s β‰  ∞ := ne_of_lt (measure_lt_top ΞΌ s) #align measure_theory.measure_ne_top MeasureTheory.measure_ne_top theorem measure_compl_le_add_of_le_add [IsFiniteMeasure ΞΌ] (hs : MeasurableSet s) (ht : MeasurableSet t) {Ξ΅ : ℝβ‰₯0∞} (h : ΞΌ s ≀ ΞΌ t + Ξ΅) : ΞΌ tᢜ ≀ ΞΌ sᢜ + Ξ΅ := by rw [measure_compl ht (measure_ne_top ΞΌ _), measure_compl hs (measure_ne_top ΞΌ _), tsub_le_iff_right] calc ΞΌ univ = ΞΌ univ - ΞΌ s + ΞΌ s := (tsub_add_cancel_of_le <| measure_mono s.subset_univ).symm _ ≀ ΞΌ univ - ΞΌ s + (ΞΌ t + Ξ΅) := add_le_add_left h _ _ = _ := by rw [add_right_comm, add_assoc] #align measure_theory.measure_compl_le_add_of_le_add MeasureTheory.measure_compl_le_add_of_le_add theorem measure_compl_le_add_iff [IsFiniteMeasure ΞΌ] (hs : MeasurableSet s) (ht : MeasurableSet t) {Ξ΅ : ℝβ‰₯0∞} : ΞΌ sᢜ ≀ ΞΌ tᢜ + Ξ΅ ↔ ΞΌ t ≀ ΞΌ s + Ξ΅ := ⟨fun h => compl_compl s β–Έ compl_compl t β–Έ measure_compl_le_add_of_le_add hs.compl ht.compl h, measure_compl_le_add_of_le_add ht hs⟩ #align measure_theory.measure_compl_le_add_iff MeasureTheory.measure_compl_le_add_iff def measureUnivNNReal (ΞΌ : Measure Ξ±) : ℝβ‰₯0 := (ΞΌ univ).toNNReal #align measure_theory.measure_univ_nnreal MeasureTheory.measureUnivNNReal @[simp] theorem coe_measureUnivNNReal (ΞΌ : Measure Ξ±) [IsFiniteMeasure ΞΌ] : ↑(measureUnivNNReal ΞΌ) = ΞΌ univ := ENNReal.coe_toNNReal (measure_ne_top ΞΌ univ) #align measure_theory.coe_measure_univ_nnreal MeasureTheory.coe_measureUnivNNReal instance isFiniteMeasureZero : IsFiniteMeasure (0 : Measure Ξ±) := ⟨by simp⟩ #align measure_theory.is_finite_measure_zero MeasureTheory.isFiniteMeasureZero instance (priority := 50) isFiniteMeasureOfIsEmpty [IsEmpty Ξ±] : IsFiniteMeasure ΞΌ := by rw [eq_zero_of_isEmpty ΞΌ] infer_instance #align measure_theory.is_finite_measure_of_is_empty MeasureTheory.isFiniteMeasureOfIsEmpty @[simp] theorem measureUnivNNReal_zero : measureUnivNNReal (0 : Measure Ξ±) = 0 := rfl #align measure_theory.measure_univ_nnreal_zero MeasureTheory.measureUnivNNReal_zero instance isFiniteMeasureAdd [IsFiniteMeasure ΞΌ] [IsFiniteMeasure Ξ½] : IsFiniteMeasure (ΞΌ + Ξ½) where measure_univ_lt_top := by rw [Measure.coe_add, Pi.add_apply, ENNReal.add_lt_top] exact ⟨measure_lt_top _ _, measure_lt_top _ _⟩ #align measure_theory.is_finite_measure_add MeasureTheory.isFiniteMeasureAdd instance isFiniteMeasureSMulNNReal [IsFiniteMeasure ΞΌ] {r : ℝβ‰₯0} : IsFiniteMeasure (r β€’ ΞΌ) where measure_univ_lt_top := ENNReal.mul_lt_top ENNReal.coe_ne_top (measure_ne_top _ _) #align measure_theory.is_finite_measure_smul_nnreal MeasureTheory.isFiniteMeasureSMulNNReal instance IsFiniteMeasure.average : IsFiniteMeasure ((ΞΌ univ)⁻¹ β€’ ΞΌ) where measure_univ_lt_top := by rw [smul_apply, smul_eq_mul, ← ENNReal.div_eq_inv_mul] exact ENNReal.div_self_le_one.trans_lt ENNReal.one_lt_top instance isFiniteMeasureSMulOfNNRealTower {R} [SMul R ℝβ‰₯0] [SMul R ℝβ‰₯0∞] [IsScalarTower R ℝβ‰₯0 ℝβ‰₯0∞] [IsScalarTower R ℝβ‰₯0∞ ℝβ‰₯0∞] [IsFiniteMeasure ΞΌ] {r : R} : IsFiniteMeasure (r β€’ ΞΌ) := by rw [← smul_one_smul ℝβ‰₯0 r ΞΌ] infer_instance #align measure_theory.is_finite_measure_smul_of_nnreal_tower MeasureTheory.isFiniteMeasureSMulOfNNRealTower theorem isFiniteMeasure_of_le (ΞΌ : Measure Ξ±) [IsFiniteMeasure ΞΌ] (h : Ξ½ ≀ ΞΌ) : IsFiniteMeasure Ξ½ := { measure_univ_lt_top := (h Set.univ).trans_lt (measure_lt_top _ _) } #align measure_theory.is_finite_measure_of_le MeasureTheory.isFiniteMeasure_of_le @[instance]
Mathlib/MeasureTheory/Measure/Typeclasses.lean
132
139
theorem Measure.isFiniteMeasure_map {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) [IsFiniteMeasure ΞΌ] (f : Ξ± β†’ Ξ²) : IsFiniteMeasure (ΞΌ.map f) := by
by_cases hf : AEMeasurable f ΞΌ Β· constructor rw [map_apply_of_aemeasurable hf MeasurableSet.univ] exact measure_lt_top ΞΌ _ Β· rw [map_of_not_aemeasurable hf] exact MeasureTheory.isFiniteMeasureZero
[ " Β¬IsFiniteMeasure ΞΌ ↔ ΞΌ univ = ⊀", " ΞΌ univ = ⊀", " False", " (ΞΌ.restrict s) univ < ⊀", " ΞΌ tᢜ ≀ ΞΌ sᢜ + Ξ΅", " ΞΌ univ ≀ ΞΌ univ - ΞΌ s + Ξ΅ + ΞΌ t", " ΞΌ univ - ΞΌ s + (ΞΌ t + Ξ΅) = ΞΌ univ - ΞΌ s + Ξ΅ + ΞΌ t", " 0 univ < ⊀", " IsFiniteMeasure ΞΌ", " IsFiniteMeasure 0", " (ΞΌ + Ξ½) univ < ⊀", " ΞΌ univ < ⊀ ∧ ...
[ " Β¬IsFiniteMeasure ΞΌ ↔ ΞΌ univ = ⊀", " ΞΌ univ = ⊀", " False", " (ΞΌ.restrict s) univ < ⊀", " ΞΌ tᢜ ≀ ΞΌ sᢜ + Ξ΅", " ΞΌ univ ≀ ΞΌ univ - ΞΌ s + Ξ΅ + ΞΌ t", " ΞΌ univ - ΞΌ s + (ΞΌ t + Ξ΅) = ΞΌ univ - ΞΌ s + Ξ΅ + ΞΌ t", " 0 univ < ⊀", " IsFiniteMeasure ΞΌ", " IsFiniteMeasure 0", " (ΞΌ + Ξ½) univ < ⊀", " ΞΌ univ < ⊀ ∧ ...
import Mathlib.Topology.Constructions import Mathlib.Topology.ContinuousOn #align_import topology.bases from "leanprover-community/mathlib"@"bcfa726826abd57587355b4b5b7e78ad6527b7e4" open Set Filter Function Topology noncomputable section namespace TopologicalSpace universe u variable {Ξ± : Type u} {Ξ² : Type*} [t : TopologicalSpace Ξ±] {B : Set (Set Ξ±)} {s : Set Ξ±} structure IsTopologicalBasis (s : Set (Set Ξ±)) : Prop where exists_subset_inter : βˆ€ t₁ ∈ s, βˆ€ tβ‚‚ ∈ s, βˆ€ x ∈ t₁ ∩ tβ‚‚, βˆƒ t₃ ∈ s, x ∈ t₃ ∧ t₃ βŠ† t₁ ∩ tβ‚‚ sUnion_eq : ⋃₀ s = univ eq_generateFrom : t = generateFrom s #align topological_space.is_topological_basis TopologicalSpace.IsTopologicalBasis
Mathlib/Topology/Bases.lean
77
90
theorem IsTopologicalBasis.insert_empty {s : Set (Set Ξ±)} (h : IsTopologicalBasis s) : IsTopologicalBasis (insert βˆ… s) := by
refine ⟨?_, by rw [sUnion_insert, empty_union, h.sUnion_eq], ?_⟩ Β· rintro t₁ (rfl | h₁) tβ‚‚ (rfl | hβ‚‚) x ⟨hx₁, hxβ‚‚βŸ© Β· cases hx₁ Β· cases hx₁ Β· cases hxβ‚‚ Β· obtain ⟨t₃, h₃, hs⟩ := h.exists_subset_inter _ h₁ _ hβ‚‚ x ⟨hx₁, hxβ‚‚βŸ© exact ⟨t₃, .inr h₃, hs⟩ Β· rw [h.eq_generateFrom] refine le_antisymm (le_generateFrom fun t => ?_) (generateFrom_anti <| subset_insert βˆ… s) rintro (rfl | ht) Β· exact @isOpen_empty _ (generateFrom s) Β· exact .basic t ht
[ " IsTopologicalBasis (insert βˆ… s)", " ⋃₀ insert βˆ… s = univ", " βˆ€ t₁ ∈ insert βˆ… s, βˆ€ tβ‚‚ ∈ insert βˆ… s, βˆ€ x ∈ t₁ ∩ tβ‚‚, βˆƒ t₃ ∈ insert βˆ… s, x ∈ t₃ ∧ t₃ βŠ† t₁ ∩ tβ‚‚", " βˆƒ t₃ ∈ insert βˆ… s, x ∈ t₃ ∧ t₃ βŠ† βˆ… ∩ βˆ…", " βˆƒ t₃ ∈ insert βˆ… s, x ∈ t₃ ∧ t₃ βŠ† βˆ… ∩ tβ‚‚", " βˆƒ t₃ ∈ insert βˆ… s, x ∈ t₃ ∧ t₃ βŠ† t₁ ∩ βˆ…", " βˆƒ t₃ ∈ inser...
[ " IsTopologicalBasis (insert βˆ… s)" ]
import Mathlib.Analysis.Convex.Topology import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.Seminorm import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.convex.gauge from "leanprover-community/mathlib"@"373b03b5b9d0486534edbe94747f23cb3712f93d" open NormedField Set open scoped Pointwise Topology NNReal noncomputable section variable {π•œ E F : Type*} section AddCommGroup variable [AddCommGroup E] [Module ℝ E] def gauge (s : Set E) (x : E) : ℝ := sInf { r : ℝ | 0 < r ∧ x ∈ r β€’ s } #align gauge gauge variable {s t : Set E} {x : E} {a : ℝ} theorem gauge_def : gauge s x = sInf ({ r ∈ Set.Ioi (0 : ℝ) | x ∈ r β€’ s }) := rfl #align gauge_def gauge_def theorem gauge_def' : gauge s x = sInf {r ∈ Set.Ioi (0 : ℝ) | r⁻¹ β€’ x ∈ s} := by congrm sInf {r | ?_} exact and_congr_right fun hr => mem_smul_set_iff_inv_smul_memβ‚€ hr.ne' _ _ #align gauge_def' gauge_def' private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r β€’ s } := ⟨0, fun _ hr => hr.1.le⟩ theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) : { r : ℝ | 0 < r ∧ x ∈ r β€’ s }.Nonempty := let ⟨r, hr₁, hrβ‚‚βŸ© := (absorbs x).exists_pos ⟨r, hr₁, hrβ‚‚ r (Real.norm_of_nonneg hr₁.le).ge rfl⟩ #align absorbent.gauge_set_nonempty Absorbent.gauge_set_nonempty theorem gauge_mono (hs : Absorbent ℝ s) (h : s βŠ† t) : gauge t ≀ gauge s := fun _ => csInf_le_csInf gauge_set_bddBelow hs.gauge_set_nonempty fun _ hr => ⟨hr.1, smul_set_mono h hr.2⟩ #align gauge_mono gauge_mono
Mathlib/Analysis/Convex/Gauge.lean
86
89
theorem exists_lt_of_gauge_lt (absorbs : Absorbent ℝ s) (h : gauge s x < a) : βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s := by
obtain ⟨b, ⟨hb, hx⟩, hba⟩ := exists_lt_of_csInf_lt absorbs.gauge_set_nonempty h exact ⟨b, hb, hba, hx⟩
[ " gauge s x = sInf {r | r ∈ Ioi 0 ∧ r⁻¹ β€’ x ∈ s}", " 0 < r ∧ x ∈ r β€’ s ↔ r ∈ Ioi 0 ∧ r⁻¹ β€’ x ∈ s", " βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s" ]
[ " gauge s x = sInf {r | r ∈ Ioi 0 ∧ r⁻¹ β€’ x ∈ s}", " 0 < r ∧ x ∈ r β€’ s ↔ r ∈ Ioi 0 ∧ r⁻¹ β€’ x ∈ s", " βˆƒ b, 0 < b ∧ b < a ∧ x ∈ b β€’ s" ]
import Mathlib.Data.List.Join #align_import data.list.permutation from "leanprover-community/mathlib"@"dd71334db81d0bd444af1ee339a29298bef40734" -- Make sure we don't import algebra assert_not_exists Monoid open Nat variable {Ξ± Ξ² : Type*} namespace List theorem permutationsAux2_fst (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) : βˆ€ (ys : List Ξ±) (f : List Ξ± β†’ Ξ²), (permutationsAux2 t ts r ys f).1 = ys ++ ts | [], f => rfl | y :: ys, f => by simp [permutationsAux2, permutationsAux2_fst t _ _ ys] #align list.permutations_aux2_fst List.permutationsAux2_fst @[simp] theorem permutationsAux2_snd_nil (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts r [] f).2 = r := rfl #align list.permutations_aux2_snd_nil List.permutationsAux2_snd_nil @[simp] theorem permutationsAux2_snd_cons (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (y : Ξ±) (ys : List Ξ±) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x : List Ξ± => f (y :: x)).2 := by simp [permutationsAux2, permutationsAux2_fst t _ _ ys] #align list.permutations_aux2_snd_cons List.permutationsAux2_snd_cons theorem permutationsAux2_append (t : Ξ±) (ts : List Ξ±) (r : List Ξ²) (ys : List Ξ±) (f : List Ξ± β†’ Ξ²) : (permutationsAux2 t ts nil ys f).2 ++ r = (permutationsAux2 t ts r ys f).2 := by induction ys generalizing f <;> simp [*] #align list.permutations_aux2_append List.permutationsAux2_append
Mathlib/Data/List/Permutation.lean
83
87
theorem permutationsAux2_comp_append {t : Ξ±} {ts ys : List Ξ±} {r : List Ξ²} (f : List Ξ± β†’ Ξ²) : ((permutationsAux2 t [] r ys) fun x => f (x ++ ts)).2 = (permutationsAux2 t ts r ys f).2 := by
induction' ys with ys_hd _ ys_ih generalizing f Β· simp Β· simp [ys_ih fun xs => f (ys_hd :: xs)]
[ " (permutationsAux2 t ts r (y :: ys) f).1 = y :: ys ++ ts", " (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x => f (y :: x)).2", " (permutationsAux2 t ts [] ys f).2 ++ r = (permutationsAux2 t ts r ys f).2", " (permutationsAux2 t ts [] [] f).2 ++ r = (permu...
[ " (permutationsAux2 t ts r (y :: ys) f).1 = y :: ys ++ ts", " (permutationsAux2 t ts r (y :: ys) f).2 = f (t :: y :: ys ++ ts) :: (permutationsAux2 t ts r ys fun x => f (y :: x)).2", " (permutationsAux2 t ts [] ys f).2 ++ r = (permutationsAux2 t ts r ys f).2", " (permutationsAux2 t ts [] [] f).2 ++ r = (permu...
import Mathlib.Data.Set.Image #align_import order.directed from "leanprover-community/mathlib"@"ffde2d8a6e689149e44fd95fa862c23a57f8c780" open Function universe u v w variable {Ξ± : Type u} {Ξ² : Type v} {ΞΉ : Sort w} (r r' s : Ξ± β†’ Ξ± β†’ Prop) local infixl:50 " β‰Ό " => r def Directed (f : ΞΉ β†’ Ξ±) := βˆ€ x y, βˆƒ z, f x β‰Ό f z ∧ f y β‰Ό f z #align directed Directed def DirectedOn (s : Set Ξ±) := βˆ€ x ∈ s, βˆ€ y ∈ s, βˆƒ z ∈ s, x β‰Ό z ∧ y β‰Ό z #align directed_on DirectedOn variable {r r'} theorem directedOn_iff_directed {s} : @DirectedOn Ξ± r s ↔ Directed r (Subtype.val : s β†’ Ξ±) := by simp only [DirectedOn, Directed, Subtype.exists, exists_and_left, exists_prop, Subtype.forall] exact forallβ‚‚_congr fun x _ => by simp [And.comm, and_assoc] #align directed_on_iff_directed directedOn_iff_directed alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed #align directed_on.directed_coe DirectedOn.directed_val
Mathlib/Order/Directed.lean
66
67
theorem directedOn_range {f : ΞΉ β†’ Ξ±} : Directed r f ↔ DirectedOn r (Set.range f) := by
simp_rw [Directed, DirectedOn, Set.forall_mem_range, Set.exists_range_iff]
[ " DirectedOn r s ↔ Directed r Subtype.val", " (βˆ€ x ∈ s, βˆ€ y ∈ s, βˆƒ z ∈ s, r x z ∧ r y z) ↔ βˆ€ a ∈ s, βˆ€ a_1 ∈ s, βˆƒ a_2, r a a_2 ∧ a_2 ∈ s ∧ r a_1 a_2", " (βˆ€ y ∈ s, βˆƒ z ∈ s, r x z ∧ r y z) ↔ βˆ€ a ∈ s, βˆƒ a_1, r x a_1 ∧ a_1 ∈ s ∧ r a a_1", " Directed r f ↔ DirectedOn r (Set.range f)" ]
[ " DirectedOn r s ↔ Directed r Subtype.val", " (βˆ€ x ∈ s, βˆ€ y ∈ s, βˆƒ z ∈ s, r x z ∧ r y z) ↔ βˆ€ a ∈ s, βˆ€ a_1 ∈ s, βˆƒ a_2, r a a_2 ∧ a_2 ∈ s ∧ r a_1 a_2", " (βˆ€ y ∈ s, βˆƒ z ∈ s, r x z ∧ r y z) ↔ βˆ€ a ∈ s, βˆƒ a_1, r x a_1 ∧ a_1 ∈ s ∧ r a a_1", " Directed r f ↔ DirectedOn r (Set.range f)" ]
import Mathlib.Probability.ProbabilityMassFunction.Monad #align_import probability.probability_mass_function.constructions from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" universe u namespace PMF noncomputable section variable {Ξ± Ξ² Ξ³ : Type*} open scoped Classical open NNReal ENNReal section Map def map (f : Ξ± β†’ Ξ²) (p : PMF Ξ±) : PMF Ξ² := bind p (pure ∘ f) #align pmf.map PMF.map variable (f : Ξ± β†’ Ξ²) (p : PMF Ξ±) (b : Ξ²) theorem monad_map_eq_map {Ξ± Ξ² : Type u} (f : Ξ± β†’ Ξ²) (p : PMF Ξ±) : f <$> p = p.map f := rfl #align pmf.monad_map_eq_map PMF.monad_map_eq_map @[simp] theorem map_apply : (map f p) b = βˆ‘' a, if b = f a then p a else 0 := by simp [map] #align pmf.map_apply PMF.map_apply @[simp] theorem support_map : (map f p).support = f '' p.support := Set.ext fun b => by simp [map, @eq_comm Ξ² b] #align pmf.support_map PMF.support_map
Mathlib/Probability/ProbabilityMassFunction/Constructions.lean
60
60
theorem mem_support_map_iff : b ∈ (map f p).support ↔ βˆƒ a ∈ p.support, f a = b := by
simp
[ " (map f p) b = βˆ‘' (a : Ξ±), if b = f a then p a else 0", " b ∈ (map f p).support ↔ b ∈ f '' p.support", " b ∈ (map f p).support ↔ βˆƒ a ∈ p.support, f a = b" ]
[ " (map f p) b = βˆ‘' (a : Ξ±), if b = f a then p a else 0", " b ∈ (map f p).support ↔ b ∈ f '' p.support", " b ∈ (map f p).support ↔ βˆƒ a ∈ p.support, f a = b" ]
import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.Index import Mathlib.GroupTheory.GroupAction.ConjAct import Mathlib.GroupTheory.GroupAction.Quotient import Mathlib.GroupTheory.Perm.Cycle.Type import Mathlib.GroupTheory.SpecificGroups.Cyclic import Mathlib.Tactic.IntervalCases #align_import group_theory.p_group from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" open Fintype MulAction variable (p : β„•) (G : Type*) [Group G] def IsPGroup : Prop := βˆ€ g : G, βˆƒ k : β„•, g ^ p ^ k = 1 #align is_p_group IsPGroup variable {p} {G} namespace IsPGroup theorem iff_orderOf [hp : Fact p.Prime] : IsPGroup p G ↔ βˆ€ g : G, βˆƒ k : β„•, orderOf g = p ^ k := forall_congr' fun g => ⟨fun ⟨k, hk⟩ => Exists.imp (fun _ h => h.right) ((Nat.dvd_prime_pow hp.out).mp (orderOf_dvd_of_pow_eq_one hk)), Exists.imp fun k hk => by rw [← hk, pow_orderOf_eq_one]⟩ #align is_p_group.iff_order_of IsPGroup.iff_orderOf theorem of_card [Fintype G] {n : β„•} (hG : card G = p ^ n) : IsPGroup p G := fun g => ⟨n, by rw [← hG, pow_card_eq_one]⟩ #align is_p_group.of_card IsPGroup.of_card theorem of_bot : IsPGroup p (βŠ₯ : Subgroup G) := of_card (by rw [← Nat.card_eq_fintype_card, Subgroup.card_bot, pow_zero]) #align is_p_group.of_bot IsPGroup.of_bot theorem iff_card [Fact p.Prime] [Fintype G] : IsPGroup p G ↔ βˆƒ n : β„•, card G = p ^ n := by have hG : card G β‰  0 := card_ne_zero refine ⟨fun h => ?_, fun ⟨n, hn⟩ => of_card hn⟩ suffices βˆ€ q ∈ Nat.factors (card G), q = p by use (card G).factors.length rw [← List.prod_replicate, ← List.eq_replicate_of_mem this, Nat.prod_factors hG] intro q hq obtain ⟨hq1, hq2⟩ := (Nat.mem_factors hG).mp hq haveI : Fact q.Prime := ⟨hq1⟩ obtain ⟨g, hg⟩ := exists_prime_orderOf_dvd_card q hq2 obtain ⟨k, hk⟩ := (iff_orderOf.mp h) g exact (hq1.pow_eq_iff.mp (hg.symm.trans hk).symm).1.symm #align is_p_group.iff_card IsPGroup.iff_card alias ⟨exists_card_eq, _⟩ := iff_card section GIsPGroup variable (hG : IsPGroup p G) theorem of_injective {H : Type*} [Group H] (Ο• : H β†’* G) (hΟ• : Function.Injective Ο•) : IsPGroup p H := by simp_rw [IsPGroup, ← hΟ•.eq_iff, Ο•.map_pow, Ο•.map_one] exact fun h => hG (Ο• h) #align is_p_group.of_injective IsPGroup.of_injective theorem to_subgroup (H : Subgroup G) : IsPGroup p H := hG.of_injective H.subtype Subtype.coe_injective #align is_p_group.to_subgroup IsPGroup.to_subgroup theorem of_surjective {H : Type*} [Group H] (Ο• : G β†’* H) (hΟ• : Function.Surjective Ο•) : IsPGroup p H := by refine fun h => Exists.elim (hΟ• h) fun g hg => Exists.imp (fun k hk => ?_) (hG g) rw [← hg, ← Ο•.map_pow, hk, Ο•.map_one] #align is_p_group.of_surjective IsPGroup.of_surjective theorem to_quotient (H : Subgroup G) [H.Normal] : IsPGroup p (G β§Έ H) := hG.of_surjective (QuotientGroup.mk' H) Quotient.surjective_Quotient_mk'' #align is_p_group.to_quotient IsPGroup.to_quotient theorem of_equiv {H : Type*} [Group H] (Ο• : G ≃* H) : IsPGroup p H := hG.of_surjective Ο•.toMonoidHom Ο•.surjective #align is_p_group.of_equiv IsPGroup.of_equiv theorem orderOf_coprime {n : β„•} (hn : p.Coprime n) (g : G) : (orderOf g).Coprime n := let ⟨k, hk⟩ := hG g (hn.pow_left k).coprime_dvd_left (orderOf_dvd_of_pow_eq_one hk) #align is_p_group.order_of_coprime IsPGroup.orderOf_coprime noncomputable def powEquiv {n : β„•} (hn : p.Coprime n) : G ≃ G := let h : βˆ€ g : G, (Nat.card (Subgroup.zpowers g)).Coprime n := fun g => (Nat.card_zpowers g).symm β–Έ hG.orderOf_coprime hn g { toFun := (Β· ^ n) invFun := fun g => (powCoprime (h g)).symm ⟨g, Subgroup.mem_zpowers g⟩ left_inv := fun g => Subtype.ext_iff.1 <| (powCoprime (h (g ^ n))).left_inv ⟨g, _, Subtype.ext_iff.1 <| (powCoprime (h g)).left_inv ⟨g, Subgroup.mem_zpowers g⟩⟩ right_inv := fun g => Subtype.ext_iff.1 <| (powCoprime (h g)).right_inv ⟨g, Subgroup.mem_zpowers g⟩ } #align is_p_group.pow_equiv IsPGroup.powEquiv @[simp] theorem powEquiv_apply {n : β„•} (hn : p.Coprime n) (g : G) : hG.powEquiv hn g = g ^ n := rfl #align is_p_group.pow_equiv_apply IsPGroup.powEquiv_apply @[simp]
Mathlib/GroupTheory/PGroup.lean
123
124
theorem powEquiv_symm_apply {n : β„•} (hn : p.Coprime n) (g : G) : (hG.powEquiv hn).symm g = g ^ (orderOf g).gcdB n := by
rw [← Nat.card_zpowers]; rfl
[ " g ^ p ^ k = 1", " g ^ p ^ n = 1", " card β†₯βŠ₯ = p ^ ?m.2806", " IsPGroup p G ↔ βˆƒ n, card G = p ^ n", " βˆƒ n, card G = p ^ n", " card G = p ^ (card G).factors.length", " βˆ€ q ∈ (card G).factors, q = p", " q = p", " IsPGroup p H", " βˆ€ (g : H), βˆƒ k, Ο• g ^ p ^ k = 1", " h ^ p ^ k = 1", " (hG.powEqui...
[ " g ^ p ^ k = 1", " g ^ p ^ n = 1", " card β†₯βŠ₯ = p ^ ?m.2806", " IsPGroup p G ↔ βˆƒ n, card G = p ^ n", " βˆƒ n, card G = p ^ n", " card G = p ^ (card G).factors.length", " βˆ€ q ∈ (card G).factors, q = p", " q = p", " IsPGroup p H", " βˆ€ (g : H), βˆƒ k, Ο• g ^ p ^ k = 1", " h ^ p ^ k = 1", " (hG.powEqui...
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] 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' theorem gaugeRescale_self {s : Set E} (hsa : Absorbent ℝ s) (hsb : IsVonNBounded ℝ s) : gaugeRescale s s = id := funext <| gaugeRescale_self_apply hsa hsb theorem gauge_gaugeRescale' (s : Set E) {t : Set E} {x : E} (hx : gauge t x β‰  0) : gauge t (gaugeRescale s t x) = gauge s x := by rw [gaugeRescale, gauge_smul_of_nonneg (div_nonneg (gauge_nonneg _) (gauge_nonneg _)), smul_eq_mul, div_mul_cancelβ‚€ _ hx] theorem gauge_gaugeRescale (s : Set E) {t : Set E} (hta : Absorbent ℝ t) (htb : IsVonNBounded ℝ t) (x : E) : gauge t (gaugeRescale s t x) = gauge s x := by rcases eq_or_ne x 0 with rfl | hx Β· simp Β· exact gauge_gaugeRescale' s ((gauge_pos hta htb).2 hx).ne'
Mathlib/Analysis/Convex/GaugeRescale.lean
69
73
theorem gauge_gaugeRescale_le (s t : Set E) (x : E) : gauge t (gaugeRescale s t x) ≀ gauge s x := by
by_cases hx : gauge t x = 0 Β· simp [gaugeRescale, hx, gauge_nonneg] Β· exact (gauge_gaugeRescale' s hx).le
[ " gaugeRescale s t (c β€’ x) = c β€’ gaugeRescale s t x", " (c * gauge s x / (c * gauge t x) * c) β€’ x = (c * (gauge s x / gauge t x)) β€’ x", " gaugeRescale s s x = x", " gaugeRescale s s 0 = 0", " gauge s x β‰  0", " gauge t (gaugeRescale s t x) = gauge s x", " gauge t (gaugeRescale s t 0) = gauge s 0", " ga...
[ " gaugeRescale s t (c β€’ x) = c β€’ gaugeRescale s t x", " (c * gauge s x / (c * gauge t x) * c) β€’ x = (c * (gauge s x / gauge t x)) β€’ x", " gaugeRescale s s x = x", " gaugeRescale s s 0 = 0", " gauge s x β‰  0", " gauge t (gaugeRescale s t x) = gauge s x", " gauge t (gaugeRescale s t 0) = gauge s 0", " ga...
import Batteries.Data.RBMap.Alter import Batteries.Data.List.Lemmas namespace Batteries namespace RBNode open RBColor attribute [simp] fold foldl foldr Any forM foldlM Ordered @[simp] theorem min?_reverse (t : RBNode Ξ±) : t.reverse.min? = t.max? := by unfold RBNode.max?; split <;> simp [RBNode.min?] unfold RBNode.min?; rw [min?.match_1.eq_3] Β· apply min?_reverse Β· simpa [reverse_eq_iff] @[simp] theorem max?_reverse (t : RBNode Ξ±) : t.reverse.max? = t.min? := by rw [← min?_reverse, reverse_reverse] @[simp] theorem mem_nil {x} : Β¬x ∈ (.nil : RBNode Ξ±) := by simp [(·∈·), EMem] @[simp] theorem mem_node {y c a x b} : y ∈ (.node c a x b : RBNode Ξ±) ↔ y = x ∨ y ∈ a ∨ y ∈ b := by simp [(·∈·), EMem] theorem All_def {t : RBNode Ξ±} : t.All p ↔ βˆ€ x ∈ t, p x := by induction t <;> simp [or_imp, forall_and, *] theorem Any_def {t : RBNode Ξ±} : t.Any p ↔ βˆƒ x ∈ t, p x := by induction t <;> simp [or_and_right, exists_or, *] theorem memP_def : MemP cut t ↔ βˆƒ x ∈ t, cut x = .eq := Any_def theorem mem_def : Mem cmp x t ↔ βˆƒ y ∈ t, cmp x y = .eq := Any_def theorem mem_congr [@TransCmp Ξ± cmp] {t : RBNode Ξ±} (h : cmp x y = .eq) : Mem cmp x t ↔ Mem cmp y t := by simp [Mem, TransCmp.cmp_congr_left' h] theorem isOrdered_iff' [@TransCmp Ξ± cmp] {t : RBNode Ξ±} : isOrdered cmp t L R ↔ (βˆ€ a ∈ L, t.All (cmpLT cmp a Β·)) ∧ (βˆ€ a ∈ R, t.All (cmpLT cmp Β· a)) ∧ (βˆ€ a ∈ L, βˆ€ b ∈ R, cmpLT cmp a b) ∧ Ordered cmp t := by induction t generalizing L R with | nil => simp [isOrdered]; split <;> simp [cmpLT_iff] next h => intro _ ha _ hb; cases h _ _ ha hb | node _ l v r => simp [isOrdered, *] exact ⟨ fun ⟨⟨Ll, lv, Lv, ol⟩, ⟨vr, rR, vR, or⟩⟩ => ⟨ fun _ h => ⟨Lv _ h, Ll _ h, (Lv _ h).trans_l vr⟩, fun _ h => ⟨vR _ h, (vR _ h).trans_r lv, rR _ h⟩, fun _ hL _ hR => (Lv _ hL).trans (vR _ hR), lv, vr, ol, or⟩, fun ⟨hL, hR, _, lv, vr, ol, or⟩ => ⟨ ⟨fun _ h => (hL _ h).2.1, lv, fun _ h => (hL _ h).1, ol⟩, ⟨vr, fun _ h => (hR _ h).2.2, fun _ h => (hR _ h).1, or⟩⟩⟩ theorem isOrdered_iff [@TransCmp Ξ± cmp] {t : RBNode Ξ±} : isOrdered cmp t ↔ Ordered cmp t := by simp [isOrdered_iff'] instance (cmp) [@TransCmp Ξ± cmp] (t) : Decidable (Ordered cmp t) := decidable_of_iff _ isOrdered_iff class IsCut (cmp : Ξ± β†’ Ξ± β†’ Ordering) (cut : Ξ± β†’ Ordering) : Prop where le_lt_trans [TransCmp cmp] : cmp x y β‰  .gt β†’ cut x = .lt β†’ cut y = .lt le_gt_trans [TransCmp cmp] : cmp x y β‰  .gt β†’ cut y = .gt β†’ cut x = .gt theorem IsCut.lt_trans [IsCut cmp cut] [TransCmp cmp] (H : cmp x y = .lt) : cut x = .lt β†’ cut y = .lt := IsCut.le_lt_trans <| TransCmp.gt_asymm <| OrientedCmp.cmp_eq_gt.2 H theorem IsCut.gt_trans [IsCut cmp cut] [TransCmp cmp] (H : cmp x y = .lt) : cut y = .gt β†’ cut x = .gt := IsCut.le_gt_trans <| TransCmp.gt_asymm <| OrientedCmp.cmp_eq_gt.2 H
.lake/packages/batteries/Batteries/Data/RBMap/Lemmas.lean
92
100
theorem IsCut.congr [IsCut cmp cut] [TransCmp cmp] (H : cmp x y = .eq) : cut x = cut y := by
cases ey : cut y Β· exact IsCut.le_lt_trans (fun h => nomatch H.symm.trans <| OrientedCmp.cmp_eq_gt.1 h) ey Β· cases ex : cut x Β· exact IsCut.le_lt_trans (fun h => nomatch H.symm.trans h) ex |>.symm.trans ey Β· rfl Β· refine IsCut.le_gt_trans (cmp := cmp) (fun h => ?_) ex |>.symm.trans ey cases H.symm.trans <| OrientedCmp.cmp_eq_gt.1 h Β· exact IsCut.le_gt_trans (fun h => nomatch H.symm.trans h) ey
[ " t.reverse.min? = t.max?", " t.reverse.min? =\n match t with\n | nil => none\n | node c l v nil => some v\n | node c l v r => r.max?", " nil.reverse.min? = none", " (node c✝ l✝ v✝ nil).reverse.min? = some v✝", " (node c✝ l✝ v✝ r✝).reverse.min? = r✝.max?", " (node c✝ r✝.reverse v✝ l✝.reverse)....
[ " t.reverse.min? = t.max?", " t.reverse.min? =\n match t with\n | nil => none\n | node c l v nil => some v\n | node c l v r => r.max?", " nil.reverse.min? = none", " (node c✝ l✝ v✝ nil).reverse.min? = some v✝", " (node c✝ l✝ v✝ r✝).reverse.min? = r✝.max?", " (node c✝ r✝.reverse v✝ l✝.reverse)....
import Mathlib.Algebra.Group.Prod import Mathlib.Order.Cover #align_import algebra.support from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1" assert_not_exists MonoidWithZero open Set namespace Function variable {Ξ± Ξ² A B M N P G : Type*} section One variable [One M] [One N] [One P] @[to_additive "`support` of a function is the set of points `x` such that `f x β‰  0`."] def mulSupport (f : Ξ± β†’ M) : Set Ξ± := {x | f x β‰  1} #align function.mul_support Function.mulSupport #align function.support Function.support @[to_additive] theorem mulSupport_eq_preimage (f : Ξ± β†’ M) : mulSupport f = f ⁻¹' {1}ᢜ := rfl #align function.mul_support_eq_preimage Function.mulSupport_eq_preimage #align function.support_eq_preimage Function.support_eq_preimage @[to_additive] theorem nmem_mulSupport {f : Ξ± β†’ M} {x : Ξ±} : x βˆ‰ mulSupport f ↔ f x = 1 := not_not #align function.nmem_mul_support Function.nmem_mulSupport #align function.nmem_support Function.nmem_support @[to_additive] theorem compl_mulSupport {f : Ξ± β†’ M} : (mulSupport f)ᢜ = { x | f x = 1 } := ext fun _ => nmem_mulSupport #align function.compl_mul_support Function.compl_mulSupport #align function.compl_support Function.compl_support @[to_additive (attr := simp)] theorem mem_mulSupport {f : Ξ± β†’ M} {x : Ξ±} : x ∈ mulSupport f ↔ f x β‰  1 := Iff.rfl #align function.mem_mul_support Function.mem_mulSupport #align function.mem_support Function.mem_support @[to_additive (attr := simp)] theorem mulSupport_subset_iff {f : Ξ± β†’ M} {s : Set Ξ±} : mulSupport f βŠ† s ↔ βˆ€ x, f x β‰  1 β†’ x ∈ s := Iff.rfl #align function.mul_support_subset_iff Function.mulSupport_subset_iff #align function.support_subset_iff Function.support_subset_iff @[to_additive] theorem mulSupport_subset_iff' {f : Ξ± β†’ M} {s : Set Ξ±} : mulSupport f βŠ† s ↔ βˆ€ x βˆ‰ s, f x = 1 := forall_congr' fun _ => not_imp_comm #align function.mul_support_subset_iff' Function.mulSupport_subset_iff' #align function.support_subset_iff' Function.support_subset_iff' @[to_additive] theorem mulSupport_eq_iff {f : Ξ± β†’ M} {s : Set Ξ±} : mulSupport f = s ↔ (βˆ€ x, x ∈ s β†’ f x β‰  1) ∧ βˆ€ x, x βˆ‰ s β†’ f x = 1 := by simp (config := { contextual := true }) only [ext_iff, mem_mulSupport, ne_eq, iff_def, not_imp_comm, and_comm, forall_and] #align function.mul_support_eq_iff Function.mulSupport_eq_iff #align function.support_eq_iff Function.support_eq_iff @[to_additive] theorem ext_iff_mulSupport {f g : Ξ± β†’ M} : f = g ↔ f.mulSupport = g.mulSupport ∧ βˆ€ x ∈ f.mulSupport, f x = g x := ⟨fun h ↦ h β–Έ ⟨rfl, fun _ _ ↦ rfl⟩, fun ⟨h₁, hβ‚‚βŸ© ↦ funext fun x ↦ by if hx : x ∈ f.mulSupport then exact hβ‚‚ x hx else rw [nmem_mulSupport.1 hx, nmem_mulSupport.1 (mt (Set.ext_iff.1 h₁ x).2 hx)]⟩ @[to_additive] theorem mulSupport_update_of_ne_one [DecidableEq Ξ±] (f : Ξ± β†’ M) (x : Ξ±) {y : M} (hy : y β‰  1) : mulSupport (update f x y) = insert x (mulSupport f) := by ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*] @[to_additive] theorem mulSupport_update_one [DecidableEq Ξ±] (f : Ξ± β†’ M) (x : Ξ±) : mulSupport (update f x 1) = mulSupport f \ {x} := by ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*] @[to_additive] theorem mulSupport_update_eq_ite [DecidableEq Ξ±] [DecidableEq M] (f : Ξ± β†’ M) (x : Ξ±) (y : M) : mulSupport (update f x y) = if y = 1 then mulSupport f \ {x} else insert x (mulSupport f) := by rcases eq_or_ne y 1 with rfl | hy <;> simp [mulSupport_update_one, mulSupport_update_of_ne_one, *] @[to_additive] theorem mulSupport_extend_one_subset {f : Ξ± β†’ M} {g : Ξ± β†’ N} : mulSupport (f.extend g 1) βŠ† f '' mulSupport g := mulSupport_subset_iff'.mpr fun x hfg ↦ by by_cases hf : βˆƒ a, f a = x Β· rw [extend, dif_pos hf, ← nmem_mulSupport] rw [← Classical.choose_spec hf] at hfg exact fun hg ↦ hfg ⟨_, hg, rfl⟩ Β· rw [extend_apply' _ _ _ hf]; rfl @[to_additive] theorem mulSupport_extend_one {f : Ξ± β†’ M} {g : Ξ± β†’ N} (hf : f.Injective) : mulSupport (f.extend g 1) = f '' mulSupport g := mulSupport_extend_one_subset.antisymm <| by rintro _ ⟨x, hx, rfl⟩; rwa [mem_mulSupport, hf.extend_apply] @[to_additive] theorem mulSupport_disjoint_iff {f : Ξ± β†’ M} {s : Set Ξ±} : Disjoint (mulSupport f) s ↔ EqOn f 1 s := by simp_rw [← subset_compl_iff_disjoint_right, mulSupport_subset_iff', not_mem_compl_iff, EqOn, Pi.one_apply] #align function.mul_support_disjoint_iff Function.mulSupport_disjoint_iff #align function.support_disjoint_iff Function.support_disjoint_iff @[to_additive]
Mathlib/Algebra/Group/Support.lean
127
129
theorem disjoint_mulSupport_iff {f : Ξ± β†’ M} {s : Set Ξ±} : Disjoint s (mulSupport f) ↔ EqOn f 1 s := by
rw [disjoint_comm, mulSupport_disjoint_iff]
[ " mulSupport f = s ↔ (βˆ€ x ∈ s, f x β‰  1) ∧ βˆ€ x βˆ‰ s, f x = 1", " f x = g x", " mulSupport (update f x y) = insert x (mulSupport f)", " a ∈ mulSupport (update f x y) ↔ a ∈ insert x (mulSupport f)", " a ∈ mulSupport (update f a y) ↔ a ∈ insert a (mulSupport f)", " mulSupport (update f x 1) = mulSupport f \\ {...
[ " mulSupport f = s ↔ (βˆ€ x ∈ s, f x β‰  1) ∧ βˆ€ x βˆ‰ s, f x = 1", " f x = g x", " mulSupport (update f x y) = insert x (mulSupport f)", " a ∈ mulSupport (update f x y) ↔ a ∈ insert x (mulSupport f)", " a ∈ mulSupport (update f a y) ↔ a ∈ insert a (mulSupport f)", " mulSupport (update f x 1) = mulSupport f \\ {...
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
Mathlib/CategoryTheory/GlueData.lean
93
95
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
[ " D.t' i i j = (pullbackSymmetry (D.f i i) (D.f i j)).hom", " D.t' j i i = pullback.fst ≫ D.t j i ≫ inv pullback.snd", " D.t' j i i = (D.t' j i i ≫ pullback.snd) ≫ inv pullback.snd", " D.t' i j i = pullback.fst ≫ D.t i j ≫ inv pullback.snd", " D.t' i j i = (D.t' i j i ≫ pullback.snd) ≫ inv pullback.snd" ]
[ " D.t' i i j = (pullbackSymmetry (D.f i i) (D.f i j)).hom", " D.t' j i i = pullback.fst ≫ D.t j i ≫ inv pullback.snd", " D.t' j i i = (D.t' j i i ≫ pullback.snd) ≫ inv pullback.snd", " D.t' i j i = pullback.fst ≫ D.t i j ≫ inv pullback.snd" ]
import Mathlib.FieldTheory.RatFunc.Defs import Mathlib.RingTheory.EuclideanDomain import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Polynomial.Content #align_import field_theory.ratfunc from "leanprover-community/mathlib"@"bf9bbbcf0c1c1ead18280b0d010e417b10abb1b6" universe u v noncomputable section open scoped Classical open scoped nonZeroDivisors Polynomial variable {K : Type u} namespace RatFunc section Field variable [CommRing K] protected irreducible_def zero : RatFunc K := ⟨0⟩ #align ratfunc.zero RatFunc.zero instance : Zero (RatFunc K) := ⟨RatFunc.zero⟩ -- Porting note: added `OfNat.ofNat`. using `simp?` produces `simp only [zero_def]` -- that does not close the goal theorem ofFractionRing_zero : (ofFractionRing 0 : RatFunc K) = 0 := by simp only [Zero.zero, OfNat.ofNat, RatFunc.zero] #align ratfunc.of_fraction_ring_zero RatFunc.ofFractionRing_zero protected irreducible_def add : RatFunc K β†’ RatFunc K β†’ RatFunc K | ⟨p⟩, ⟨q⟩ => ⟨p + q⟩ #align ratfunc.add RatFunc.add instance : Add (RatFunc K) := ⟨RatFunc.add⟩ -- Porting note: added `HAdd.hAdd`. using `simp?` produces `simp only [add_def]` -- that does not close the goal theorem ofFractionRing_add (p q : FractionRing K[X]) : ofFractionRing (p + q) = ofFractionRing p + ofFractionRing q := by simp only [HAdd.hAdd, Add.add, RatFunc.add] #align ratfunc.of_fraction_ring_add RatFunc.ofFractionRing_add protected irreducible_def sub : RatFunc K β†’ RatFunc K β†’ RatFunc K | ⟨p⟩, ⟨q⟩ => ⟨p - q⟩ #align ratfunc.sub RatFunc.sub instance : Sub (RatFunc K) := ⟨RatFunc.sub⟩ -- Porting note: added `HSub.hSub`. using `simp?` produces `simp only [sub_def]` -- that does not close the goal theorem ofFractionRing_sub (p q : FractionRing K[X]) : ofFractionRing (p - q) = ofFractionRing p - ofFractionRing q := by simp only [Sub.sub, HSub.hSub, RatFunc.sub] #align ratfunc.of_fraction_ring_sub RatFunc.ofFractionRing_sub protected irreducible_def neg : RatFunc K β†’ RatFunc K | ⟨p⟩ => ⟨-p⟩ #align ratfunc.neg RatFunc.neg instance : Neg (RatFunc K) := ⟨RatFunc.neg⟩
Mathlib/FieldTheory/RatFunc/Basic.lean
117
118
theorem ofFractionRing_neg (p : FractionRing K[X]) : ofFractionRing (-p) = -ofFractionRing p := by
simp only [Neg.neg, RatFunc.neg]
[ " { toFractionRing := 0 } = 0", " { toFractionRing := p + q } = { toFractionRing := p } + { toFractionRing := q }", " { toFractionRing := p - q } = { toFractionRing := p } - { toFractionRing := q }", " { toFractionRing := -p } = -{ toFractionRing := p }" ]
[ " { toFractionRing := 0 } = 0", " { toFractionRing := p + q } = { toFractionRing := p } + { toFractionRing := q }", " { toFractionRing := p - q } = { toFractionRing := p } - { toFractionRing := q }", " { toFractionRing := -p } = -{ toFractionRing := p }" ]
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset import Mathlib.Data.Finite.Card import Mathlib.GroupTheory.Finiteness import Mathlib.GroupTheory.GroupAction.Quotient #align_import group_theory.index from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" namespace Subgroup open Cardinal variable {G : Type*} [Group G] (H K L : Subgroup G) @[to_additive "The index of a subgroup as a natural number, and returns 0 if the index is infinite."] noncomputable def index : β„• := Nat.card (G β§Έ H) #align subgroup.index Subgroup.index #align add_subgroup.index AddSubgroup.index @[to_additive "The relative index of a subgroup as a natural number, and returns 0 if the relative index is infinite."] noncomputable def relindex : β„• := (H.subgroupOf K).index #align subgroup.relindex Subgroup.relindex #align add_subgroup.relindex AddSubgroup.relindex @[to_additive] theorem index_comap_of_surjective {G' : Type*} [Group G'] {f : G' β†’* G} (hf : Function.Surjective f) : (H.comap f).index = H.index := by letI := QuotientGroup.leftRel H letI := QuotientGroup.leftRel (H.comap f) have key : βˆ€ x y : G', Setoid.r x y ↔ Setoid.r (f x) (f y) := by simp only [QuotientGroup.leftRel_apply] exact fun x y => iff_of_eq (congr_arg (Β· ∈ H) (by rw [f.map_mul, f.map_inv])) refine Cardinal.toNat_congr (Equiv.ofBijective (Quotient.map' f fun x y => (key x y).mp) ⟨?_, ?_⟩) Β· simp_rw [← Quotient.eq''] at key refine Quotient.ind' fun x => ?_ refine Quotient.ind' fun y => ?_ exact (key x y).mpr Β· refine Quotient.ind' fun x => ?_ obtain ⟨y, hy⟩ := hf x exact ⟨y, (Quotient.map'_mk'' f _ y).trans (congr_arg Quotient.mk'' hy)⟩ #align subgroup.index_comap_of_surjective Subgroup.index_comap_of_surjective #align add_subgroup.index_comap_of_surjective AddSubgroup.index_comap_of_surjective @[to_additive] theorem index_comap {G' : Type*} [Group G'] (f : G' β†’* G) : (H.comap f).index = H.relindex f.range := Eq.trans (congr_arg index (by rfl)) ((H.subgroupOf f.range).index_comap_of_surjective f.rangeRestrict_surjective) #align subgroup.index_comap Subgroup.index_comap #align add_subgroup.index_comap AddSubgroup.index_comap @[to_additive] theorem relindex_comap {G' : Type*} [Group G'] (f : G' β†’* G) (K : Subgroup G') : relindex (comap f H) K = relindex H (map f K) := by rw [relindex, subgroupOf, comap_comap, index_comap, ← f.map_range, K.subtype_range] #align subgroup.relindex_comap Subgroup.relindex_comap #align add_subgroup.relindex_comap AddSubgroup.relindex_comap variable {H K L} @[to_additive relindex_mul_index] theorem relindex_mul_index (h : H ≀ K) : H.relindex K * K.index = H.index := ((mul_comm _ _).trans (Cardinal.toNat_mul _ _).symm).trans (congr_arg Cardinal.toNat (Equiv.cardinal_eq (quotientEquivProdOfLE h))).symm #align subgroup.relindex_mul_index Subgroup.relindex_mul_index #align add_subgroup.relindex_mul_index AddSubgroup.relindex_mul_index @[to_additive] theorem index_dvd_of_le (h : H ≀ K) : K.index ∣ H.index := dvd_of_mul_left_eq (H.relindex K) (relindex_mul_index h) #align subgroup.index_dvd_of_le Subgroup.index_dvd_of_le #align add_subgroup.index_dvd_of_le AddSubgroup.index_dvd_of_le @[to_additive] theorem relindex_dvd_index_of_le (h : H ≀ K) : H.relindex K ∣ H.index := dvd_of_mul_right_eq K.index (relindex_mul_index h) #align subgroup.relindex_dvd_index_of_le Subgroup.relindex_dvd_index_of_le #align add_subgroup.relindex_dvd_index_of_le AddSubgroup.relindex_dvd_index_of_le @[to_additive] theorem relindex_subgroupOf (hKL : K ≀ L) : (H.subgroupOf L).relindex (K.subgroupOf L) = H.relindex K := ((index_comap (H.subgroupOf L) (inclusion hKL)).trans (congr_arg _ (inclusion_range hKL))).symm #align subgroup.relindex_subgroup_of Subgroup.relindex_subgroupOf #align add_subgroup.relindex_add_subgroup_of AddSubgroup.relindex_addSubgroupOf variable (H K L) @[to_additive relindex_mul_relindex]
Mathlib/GroupTheory/Index.lean
126
129
theorem relindex_mul_relindex (hHK : H ≀ K) (hKL : K ≀ L) : H.relindex K * K.relindex L = H.relindex L := by
rw [← relindex_subgroupOf hKL] exact relindex_mul_index fun x hx => hHK hx
[ " (comap f H).index = H.index", " βˆ€ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)", " βˆ€ (x y : G'), x⁻¹ * y ∈ comap f H ↔ (f x)⁻¹ * f y ∈ H", " f (x⁻¹ * y) = (f x)⁻¹ * f y", " Function.Injective (Quotient.map' ⇑f β‹―)", " βˆ€ ⦃aβ‚‚ : G' β§Έ comap f H⦄, Quotient.map' ⇑f β‹― (Quotient.mk'' x) = Quotient.map' ⇑f β‹― a...
[ " (comap f H).index = H.index", " βˆ€ (x y : G'), Setoid.r x y ↔ Setoid.r (f x) (f y)", " βˆ€ (x y : G'), x⁻¹ * y ∈ comap f H ↔ (f x)⁻¹ * f y ∈ H", " f (x⁻¹ * y) = (f x)⁻¹ * f y", " Function.Injective (Quotient.map' ⇑f β‹―)", " βˆ€ ⦃aβ‚‚ : G' β§Έ comap f H⦄, Quotient.map' ⇑f β‹― (Quotient.mk'' x) = Quotient.map' ⇑f β‹― a...
import Mathlib.Data.Fintype.List #align_import data.list.cycle from "leanprover-community/mathlib"@"7413128c3bcb3b0818e3e18720abc9ea3100fb49" assert_not_exists MonoidWithZero namespace List variable {Ξ± : Type*} [DecidableEq Ξ±] def nextOr : βˆ€ (_ : List Ξ±) (_ _ : Ξ±), Ξ± | [], _, default => default | [_], _, default => default -- Handles the not-found and the wraparound case | y :: z :: xs, x, default => if x = y then z else nextOr (z :: xs) x default #align list.next_or List.nextOr @[simp] theorem nextOr_nil (x d : Ξ±) : nextOr [] x d = d := rfl #align list.next_or_nil List.nextOr_nil @[simp] theorem nextOr_singleton (x y d : Ξ±) : nextOr [y] x d = d := rfl #align list.next_or_singleton List.nextOr_singleton @[simp] theorem nextOr_self_cons_cons (xs : List Ξ±) (x y d : Ξ±) : nextOr (x :: y :: xs) x d = y := if_pos rfl #align list.next_or_self_cons_cons List.nextOr_self_cons_cons theorem nextOr_cons_of_ne (xs : List Ξ±) (y x d : Ξ±) (h : x β‰  y) : nextOr (y :: xs) x d = nextOr xs x d := by cases' xs with z zs Β· rfl Β· exact if_neg h #align list.next_or_cons_of_ne List.nextOr_cons_of_ne theorem nextOr_eq_nextOr_of_mem_of_ne (xs : List Ξ±) (x d d' : Ξ±) (x_mem : x ∈ xs) (x_ne : x β‰  xs.getLast (ne_nil_of_mem x_mem)) : nextOr xs x d = nextOr xs x d' := by induction' xs with y ys IH Β· cases x_mem cases' ys with z zs Β· simp at x_mem x_ne contradiction by_cases h : x = y Β· rw [h, nextOr_self_cons_cons, nextOr_self_cons_cons] Β· rw [nextOr, nextOr, IH] Β· simpa [h] using x_mem Β· simpa using x_ne #align list.next_or_eq_next_or_of_mem_of_ne List.nextOr_eq_nextOr_of_mem_of_ne
Mathlib/Data/List/Cycle.lean
76
84
theorem mem_of_nextOr_ne {xs : List Ξ±} {x d : Ξ±} (h : nextOr xs x d β‰  d) : x ∈ xs := by
induction' xs with y ys IH Β· simp at h cases' ys with z zs Β· simp at h Β· by_cases hx : x = y Β· simp [hx] Β· rw [nextOr_cons_of_ne _ _ _ _ hx] at h simpa [hx] using IH h
[ " (y :: xs).nextOr x d = xs.nextOr x d", " [y].nextOr x d = [].nextOr x d", " (y :: z :: zs).nextOr x d = (z :: zs).nextOr x d", " xs.nextOr x d = xs.nextOr x d'", " [].nextOr x d = [].nextOr x d'", " (y :: ys).nextOr x d = (y :: ys).nextOr x d'", " [y].nextOr x d = [y].nextOr x d'", " (y :: z :: zs)....
[ " (y :: xs).nextOr x d = xs.nextOr x d", " [y].nextOr x d = [].nextOr x d", " (y :: z :: zs).nextOr x d = (z :: zs).nextOr x d", " xs.nextOr x d = xs.nextOr x d'", " [].nextOr x d = [].nextOr x d'", " (y :: ys).nextOr x d = (y :: ys).nextOr x d'", " [y].nextOr x d = [y].nextOr x d'", " (y :: z :: zs)....
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
Mathlib/Order/Height.lean
93
106
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]
[ " a :: l ∈ s.subchain ↔ a ∈ s ∧ l ∈ s.subchain ∧ βˆ€ b ∈ l.head?, a < b", " [a] ∈ s.subchain ↔ a ∈ s", " βˆƒ l ∈ s.subchain, l.length = n", " n ≀ l.length" ]
[ " a :: l ∈ s.subchain ↔ a ∈ s ∧ l ∈ s.subchain ∧ βˆ€ b ∈ l.head?, a < b", " [a] ∈ s.subchain ↔ a ∈ s", " βˆƒ l ∈ s.subchain, l.length = n" ]
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self
Mathlib/LinearAlgebra/Basis.lean
149
150
theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by
rw [repr_self, Finsupp.single_apply]
[ " { repr := b } = default", " f = g", " { repr := repr✝ } = g", " { repr := repr✝¹ } = { repr := repr✝ }", " ↑f.repr.symm = ↑g.repr.symm", " (↑f.repr.symm βˆ˜β‚— Finsupp.lsingle a✝) 1 = (↑g.repr.symm βˆ˜β‚— Finsupp.lsingle a✝) 1", " b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i 1)", " b...
[ " { repr := b } = default", " f = g", " { repr := repr✝ } = g", " { repr := repr✝¹ } = { repr := repr✝ }", " ↑f.repr.symm = ↑g.repr.symm", " (↑f.repr.symm βˆ˜β‚— Finsupp.lsingle a✝) 1 = (↑g.repr.symm βˆ˜β‚— Finsupp.lsingle a✝) 1", " b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i 1)", " b...
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Int.Basic import Mathlib.Tactic.Ring import Mathlib.Tactic.FieldSimp import Mathlib.Data.Int.NatPrime import Mathlib.Data.ZMod.Basic #align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β‰  2 := by change Fin 4 at z fin_cases z <;> decide #align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four theorem Int.sq_ne_two_mod_four (z : β„€) : z * z % 4 β‰  2 := by suffices Β¬z * z % (4 : β„•) = 2 % (4 : β„•) by exact this rw [← ZMod.intCast_eq_intCast_iff'] simpa using sq_ne_two_fin_zmod_four _ #align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four noncomputable section open scoped Classical def PythagoreanTriple (x y z : β„€) : Prop := x * x + y * y = z * z #align pythagorean_triple PythagoreanTriple
Mathlib/NumberTheory/PythagoreanTriples.lean
54
56
theorem pythagoreanTriple_comm {x y z : β„€} : PythagoreanTriple x y z ↔ PythagoreanTriple y x z := by
delta PythagoreanTriple rw [add_comm]
[ " z * z β‰  2", " ⟨0, β‹―βŸ© * ⟨0, β‹―βŸ© β‰  2", " ⟨1, β‹―βŸ© * ⟨1, β‹―βŸ© β‰  2", " ⟨2, β‹―βŸ© * ⟨2, β‹―βŸ© β‰  2", " ⟨3, β‹―βŸ© * ⟨3, β‹―βŸ© β‰  2", " z * z % 4 β‰  2", " Β¬z * z % ↑4 = 2 % ↑4", " ¬↑(z * z) = ↑2", " PythagoreanTriple x y z ↔ PythagoreanTriple y x z", " x * x + y * y = z * z ↔ y * y + x * x = z * z" ]
[ " z * z β‰  2", " ⟨0, β‹―βŸ© * ⟨0, β‹―βŸ© β‰  2", " ⟨1, β‹―βŸ© * ⟨1, β‹―βŸ© β‰  2", " ⟨2, β‹―βŸ© * ⟨2, β‹―βŸ© β‰  2", " ⟨3, β‹―βŸ© * ⟨3, β‹―βŸ© β‰  2", " z * z % 4 β‰  2", " Β¬z * z % ↑4 = 2 % ↑4", " ¬↑(z * z) = ↑2", " PythagoreanTriple x y z ↔ PythagoreanTriple y x z" ]
import Mathlib.Data.List.OfFn import Mathlib.Data.List.Range #align_import data.list.indexes from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" assert_not_exists MonoidWithZero universe u v open Function namespace List variable {Ξ± : Type u} {Ξ² : Type v} section MapIdx -- Porting note: Add back old definition because it's easier for writing proofs. protected def oldMapIdxCore (f : β„• β†’ Ξ± β†’ Ξ²) : β„• β†’ List Ξ± β†’ List Ξ² | _, [] => [] | k, a :: as => f k a :: List.oldMapIdxCore f (k + 1) as protected def oldMapIdx (f : β„• β†’ Ξ± β†’ Ξ²) (as : List Ξ±) : List Ξ² := List.oldMapIdxCore f 0 as @[simp] theorem mapIdx_nil {Ξ± Ξ²} (f : β„• β†’ Ξ± β†’ Ξ²) : mapIdx f [] = [] := rfl #align list.map_with_index_nil List.mapIdx_nil -- Porting note (#10756): new theorem. protected theorem oldMapIdxCore_eq (l : List Ξ±) (f : β„• β†’ Ξ± β†’ Ξ²) (n : β„•) : l.oldMapIdxCore f n = l.oldMapIdx fun i a ↦ f (i + n) a := by induction' l with hd tl hl generalizing f n Β· rfl Β· rw [List.oldMapIdx] simp only [List.oldMapIdxCore, hl, Nat.add_left_comm, Nat.add_comm, Nat.add_zero] #noalign list.map_with_index_core_eq -- Porting note: convert new definition to old definition. -- A few new theorems are added to achieve this -- 1. Prove that `oldMapIdxCore f (l ++ [e]) = oldMapIdxCore f l ++ [f l.length e]` -- 2. Prove that `oldMapIdx f (l ++ [e]) = oldMapIdx f l ++ [f l.length e]` -- 3. Prove list induction using `βˆ€ l e, p [] β†’ (p l β†’ p (l ++ [e])) β†’ p l` -- Porting note (#10756): new theorem. theorem list_reverse_induction (p : List Ξ± β†’ Prop) (base : p []) (ind : βˆ€ (l : List Ξ±) (e : Ξ±), p l β†’ p (l ++ [e])) : (βˆ€ (l : List Ξ±), p l) := by let q := fun l ↦ p (reverse l) have pq : βˆ€ l, p (reverse l) β†’ q l := by simp only [q, reverse_reverse]; intro; exact id have qp : βˆ€ l, q (reverse l) β†’ p l := by simp only [q, reverse_reverse]; intro; exact id intro l apply qp generalize (reverse l) = l induction' l with head tail ih Β· apply pq; simp only [reverse_nil, base] Β· apply pq; simp only [reverse_cons]; apply ind; apply qp; rw [reverse_reverse]; exact ih -- Porting note (#10756): new theorem. protected theorem oldMapIdxCore_append : βˆ€ (f : β„• β†’ Ξ± β†’ Ξ²) (n : β„•) (l₁ lβ‚‚ : List Ξ±), List.oldMapIdxCore f n (l₁ ++ lβ‚‚) = List.oldMapIdxCore f n l₁ ++ List.oldMapIdxCore f (n + l₁.length) lβ‚‚ := by intros f n l₁ lβ‚‚ generalize e : (l₁ ++ lβ‚‚).length = len revert n l₁ lβ‚‚ induction' len with len ih <;> intros n l₁ lβ‚‚ h Β· have l₁_nil : l₁ = [] := by cases l₁ Β· rfl Β· contradiction have lβ‚‚_nil : lβ‚‚ = [] := by cases lβ‚‚ Β· rfl Β· rw [List.length_append] at h; contradiction simp only [l₁_nil, lβ‚‚_nil]; rfl Β· cases' l₁ with head tail Β· rfl Β· simp only [List.oldMapIdxCore, List.append_eq, length_cons, cons_append,cons.injEq, true_and] suffices n + Nat.succ (length tail) = n + 1 + tail.length by rw [this] apply ih (n + 1) _ _ _ simp only [cons_append, length_cons, length_append, Nat.succ.injEq] at h simp only [length_append, h] rw [Nat.add_assoc]; simp only [Nat.add_comm] -- Porting note (#10756): new theorem. protected theorem oldMapIdx_append : βˆ€ (f : β„• β†’ Ξ± β†’ Ξ²) (l : List Ξ±) (e : Ξ±), List.oldMapIdx f (l ++ [e]) = List.oldMapIdx f l ++ [f l.length e] := by intros f l e unfold List.oldMapIdx rw [List.oldMapIdxCore_append f 0 l [e]] simp only [Nat.zero_add]; rfl -- Porting note (#10756): new theorem. theorem mapIdxGo_append : βˆ€ (f : β„• β†’ Ξ± β†’ Ξ²) (l₁ lβ‚‚ : List Ξ±) (arr : Array Ξ²), mapIdx.go f (l₁ ++ lβ‚‚) arr = mapIdx.go f lβ‚‚ (List.toArray (mapIdx.go f l₁ arr)) := by intros f l₁ lβ‚‚ arr generalize e : (l₁ ++ lβ‚‚).length = len revert l₁ lβ‚‚ arr induction' len with len ih <;> intros l₁ lβ‚‚ arr h Β· have l₁_nil : l₁ = [] := by cases l₁ Β· rfl Β· contradiction have lβ‚‚_nil : lβ‚‚ = [] := by cases lβ‚‚ Β· rfl Β· rw [List.length_append] at h; contradiction rw [l₁_nil, lβ‚‚_nil]; simp only [mapIdx.go, Array.toList_eq, Array.toArray_data] Β· cases' l₁ with head tail <;> simp only [mapIdx.go] Β· simp only [nil_append, Array.toList_eq, Array.toArray_data] Β· simp only [List.append_eq] rw [ih] Β· simp only [cons_append, length_cons, length_append, Nat.succ.injEq] at h simp only [length_append, h] -- Porting note (#10756): new theorem. theorem mapIdxGo_length : βˆ€ (f : β„• β†’ Ξ± β†’ Ξ²) (l : List Ξ±) (arr : Array Ξ²), length (mapIdx.go f l arr) = length l + arr.size := by intro f l induction' l with head tail ih Β· intro; simp only [mapIdx.go, Array.toList_eq, length_nil, Nat.zero_add] Β· intro; simp only [mapIdx.go]; rw [ih]; simp only [Array.size_push, length_cons]; simp only [Nat.add_succ, add_zero, Nat.add_comm] -- Porting note (#10756): new theorem.
Mathlib/Data/List/Indexes.lean
141
147
theorem mapIdx_append_one : βˆ€ (f : β„• β†’ Ξ± β†’ Ξ²) (l : List Ξ±) (e : Ξ±), mapIdx f (l ++ [e]) = mapIdx f l ++ [f l.length e] := by
intros f l e unfold mapIdx rw [mapIdxGo_append f l [e]] simp only [mapIdx.go, Array.size_toArray, mapIdxGo_length, length_nil, Nat.add_zero, Array.toList_eq, Array.push_data, Array.data_toArray]
[ " List.oldMapIdxCore f n l = List.oldMapIdx (fun i a => f (i + n) a) l", " List.oldMapIdxCore f n [] = List.oldMapIdx (fun i a => f (i + n) a) []", " List.oldMapIdxCore f n (hd :: tl) = List.oldMapIdx (fun i a => f (i + n) a) (hd :: tl)", " List.oldMapIdxCore f n (hd :: tl) = List.oldMapIdxCore (fun i a => f ...
[ " List.oldMapIdxCore f n l = List.oldMapIdx (fun i a => f (i + n) a) l", " List.oldMapIdxCore f n [] = List.oldMapIdx (fun i a => f (i + n) a) []", " List.oldMapIdxCore f n (hd :: tl) = List.oldMapIdx (fun i a => f (i + n) a) (hd :: tl)", " List.oldMapIdxCore f n (hd :: tl) = List.oldMapIdxCore (fun i a => f ...
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Preserves.Basic #align_import category_theory.limits.preserves.shapes.pullbacks from "leanprover-community/mathlib"@"f11e306adb9f2a393539d2bb4293bf1b42caa7ac" noncomputable section universe v₁ vβ‚‚ u₁ uβ‚‚ -- Porting note: need Functor namespace for mapCone open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Functor namespace CategoryTheory.Limits section Pushout variable {C : Type u₁} [Category.{v₁} C] variable {D : Type uβ‚‚} [Category.{vβ‚‚} D] variable (G : C β₯€ D) variable {W X Y Z : C} {h : X ⟢ Z} {k : Y ⟢ Z} {f : W ⟢ X} {g : W ⟢ Y} (comm : f ≫ h = g ≫ k) def isColimitMapCoconePushoutCoconeEquiv : IsColimit (mapCocone G (PushoutCocone.mk h k comm)) ≃ IsColimit (PushoutCocone.mk (G.map h) (G.map k) (by simp only [← G.map_comp, comm]) : PushoutCocone (G.map f) (G.map g)) := (IsColimit.precomposeHomEquiv (diagramIsoSpan.{vβ‚‚} _).symm _).symm.trans <| IsColimit.equivIsoColimit <| Cocones.ext (Iso.refl _) <| by rintro (_ | _ | _) <;> dsimp <;> simp only [Category.comp_id, Category.id_comp, ← G.map_comp] #align category_theory.limits.is_colimit_map_cocone_pushout_cocone_equiv CategoryTheory.Limits.isColimitMapCoconePushoutCoconeEquiv def isColimitPushoutCoconeMapOfIsColimit [PreservesColimit (span f g) G] (l : IsColimit (PushoutCocone.mk h k comm)) : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm] )) := isColimitMapCoconePushoutCoconeEquiv G comm (PreservesColimit.preserves l) #align category_theory.limits.is_colimit_pushout_cocone_map_of_is_colimit CategoryTheory.Limits.isColimitPushoutCoconeMapOfIsColimit def isColimitOfIsColimitPushoutCoconeMap [ReflectsColimit (span f g) G] (l : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm]))) : IsColimit (PushoutCocone.mk h k comm) := ReflectsColimit.reflects ((isColimitMapCoconePushoutCoconeEquiv G comm).symm l) #align category_theory.limits.is_colimit_of_is_colimit_pushout_cocone_map CategoryTheory.Limits.isColimitOfIsColimitPushoutCoconeMap variable (f g) [PreservesColimit (span f g) G] def isColimitOfHasPushoutOfPreservesColimit [i : HasPushout f g] : IsColimit (PushoutCocone.mk (G.map pushout.inl) (G.map (@pushout.inr _ _ _ _ _ f g i)) (show G.map f ≫ G.map pushout.inl = G.map g ≫ G.map pushout.inr from by simp only [← G.map_comp, pushout.condition])) := isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout f g) #align category_theory.limits.is_colimit_of_has_pushout_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasPushoutOfPreservesColimit def preservesPushoutSymmetry : PreservesColimit (span g f) G where preserves {c} hc := by apply (IsColimit.precomposeHomEquiv (diagramIsoSpan.{vβ‚‚} _).symm _).toFun apply IsColimit.ofIsoColimit _ (PushoutCocone.isoMk _).symm apply PushoutCocone.isColimitOfFlip apply (isColimitMapCoconePushoutCoconeEquiv _ _).toFun Β· refine @PreservesColimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_ -- Porting note: more TC coddling Β· dsimp infer_instance Β· exact PushoutCocone.flipIsColimit hc #align category_theory.limits.preserves_pushout_symmetry CategoryTheory.Limits.preservesPushoutSymmetry theorem hasPushout_of_preservesPushout [HasPushout f g] : HasPushout (G.map f) (G.map g) := ⟨⟨⟨_, isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout _ _)⟩⟩⟩ #align category_theory.limits.has_pushout_of_preserves_pushout CategoryTheory.Limits.hasPushout_of_preservesPushout variable [HasPushout f g] [HasPushout (G.map f) (G.map g)] def PreservesPushout.iso : pushout (G.map f) (G.map g) β‰… G.obj (pushout f g) := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (isColimitOfHasPushoutOfPreservesColimit G f g) #align category_theory.limits.preserves_pushout.iso CategoryTheory.Limits.PreservesPushout.iso @[simp] theorem PreservesPushout.iso_hom : (PreservesPushout.iso G f g).hom = pushoutComparison G f g := rfl #align category_theory.limits.preserves_pushout.iso_hom CategoryTheory.Limits.PreservesPushout.iso_hom @[reassoc] theorem PreservesPushout.inl_iso_hom : pushout.inl ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inl := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inl_iso_hom CategoryTheory.Limits.PreservesPushout.inl_iso_hom @[reassoc]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean
232
235
theorem PreservesPushout.inr_iso_hom : pushout.inr ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inr := by
delta PreservesPushout.iso simp
[ " G.map f ≫ G.map h = G.map g ≫ G.map k", " βˆ€ (j : WalkingSpan),\n ((Cocones.precompose (diagramIsoSpan (span f g β‹™ G)).symm.hom).obj (G.mapCocone (PushoutCocone.mk h k comm))).ΞΉ.app\n j ≫\n (Iso.refl\n ((Cocones.precompose (diagramIsoSpan (span f g β‹™ G)).symm.hom).obj\n ...
[ " G.map f ≫ G.map h = G.map g ≫ G.map k", " βˆ€ (j : WalkingSpan),\n ((Cocones.precompose (diagramIsoSpan (span f g β‹™ G)).symm.hom).obj (G.mapCocone (PushoutCocone.mk h k comm))).ΞΉ.app\n j ≫\n (Iso.refl\n ((Cocones.precompose (diagramIsoSpan (span f g β‹™ G)).symm.hom).obj\n ...
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Int.Basic import Mathlib.Tactic.Ring import Mathlib.Tactic.FieldSimp import Mathlib.Data.Int.NatPrime import Mathlib.Data.ZMod.Basic #align_import number_theory.pythagorean_triples from "leanprover-community/mathlib"@"e8638a0fcaf73e4500469f368ef9494e495099b3" theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z β‰  2 := by change Fin 4 at z fin_cases z <;> decide #align sq_ne_two_fin_zmod_four sq_ne_two_fin_zmod_four theorem Int.sq_ne_two_mod_four (z : β„€) : z * z % 4 β‰  2 := by suffices Β¬z * z % (4 : β„•) = 2 % (4 : β„•) by exact this rw [← ZMod.intCast_eq_intCast_iff'] simpa using sq_ne_two_fin_zmod_four _ #align int.sq_ne_two_mod_four Int.sq_ne_two_mod_four noncomputable section open scoped Classical def PythagoreanTriple (x y z : β„€) : Prop := x * x + y * y = z * z #align pythagorean_triple PythagoreanTriple theorem pythagoreanTriple_comm {x y z : β„€} : PythagoreanTriple x y z ↔ PythagoreanTriple y x z := by delta PythagoreanTriple rw [add_comm] #align pythagorean_triple_comm pythagoreanTriple_comm
Mathlib/NumberTheory/PythagoreanTriples.lean
60
61
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0 := by
simp only [PythagoreanTriple, zero_mul, zero_add]
[ " z * z β‰  2", " ⟨0, β‹―βŸ© * ⟨0, β‹―βŸ© β‰  2", " ⟨1, β‹―βŸ© * ⟨1, β‹―βŸ© β‰  2", " ⟨2, β‹―βŸ© * ⟨2, β‹―βŸ© β‰  2", " ⟨3, β‹―βŸ© * ⟨3, β‹―βŸ© β‰  2", " z * z % 4 β‰  2", " Β¬z * z % ↑4 = 2 % ↑4", " ¬↑(z * z) = ↑2", " PythagoreanTriple x y z ↔ PythagoreanTriple y x z", " x * x + y * y = z * z ↔ y * y + x * x = z * z", " PythagoreanTriple ...
[ " z * z β‰  2", " ⟨0, β‹―βŸ© * ⟨0, β‹―βŸ© β‰  2", " ⟨1, β‹―βŸ© * ⟨1, β‹―βŸ© β‰  2", " ⟨2, β‹―βŸ© * ⟨2, β‹―βŸ© β‰  2", " ⟨3, β‹―βŸ© * ⟨3, β‹―βŸ© β‰  2", " z * z % 4 β‰  2", " Β¬z * z % ↑4 = 2 % ↑4", " ¬↑(z * z) = ↑2", " PythagoreanTriple x y z ↔ PythagoreanTriple y x z", " x * x + y * y = z * z ↔ y * y + x * x = z * z", " PythagoreanTriple ...
import Mathlib.Data.Matrix.Block import Mathlib.Data.Matrix.Notation import Mathlib.LinearAlgebra.StdBasis import Mathlib.RingTheory.AlgebraTower import Mathlib.Algebra.Algebra.Subalgebra.Tower #align_import linear_algebra.matrix.to_lin from "leanprover-community/mathlib"@"0e2aab2b0d521f060f62a14d2cf2e2c54e8491d6" noncomputable section open LinearMap Matrix Set Submodule section ToMatrixRight variable {R : Type*} [Semiring R] variable {l m n : Type*} def Matrix.vecMulLinear [Fintype m] (M : Matrix m n R) : (m β†’ R) β†’β‚—[R] n β†’ R where toFun x := x α΅₯* M map_add' _ _ := funext fun _ ↦ add_dotProduct _ _ _ map_smul' _ _ := funext fun _ ↦ smul_dotProduct _ _ _ #align matrix.vec_mul_linear Matrix.vecMulLinear @[simp] theorem Matrix.vecMulLinear_apply [Fintype m] (M : Matrix m n R) (x : m β†’ R) : M.vecMulLinear x = x α΅₯* M := rfl theorem Matrix.coe_vecMulLinear [Fintype m] (M : Matrix m n R) : (M.vecMulLinear : _ β†’ _) = M.vecMul := rfl variable [Fintype m] [DecidableEq m] @[simp] theorem Matrix.vecMul_stdBasis (M : Matrix m n R) (i j) : (LinearMap.stdBasis R (fun _ ↦ R) i 1 α΅₯* M) j = M i j := by have : (βˆ‘ i', (if i = i' then 1 else 0) * M i' j) = M i j := by simp_rw [boole_mul, Finset.sum_ite_eq, Finset.mem_univ, if_true] simp only [vecMul, dotProduct] convert this split_ifs with h <;> simp only [stdBasis_apply] Β· rw [h, Function.update_same] Β· rw [Function.update_noteq (Ne.symm h), Pi.zero_apply] #align matrix.vec_mul_std_basis Matrix.vecMul_stdBasis
Mathlib/LinearAlgebra/Matrix/ToLin.lean
102
110
theorem range_vecMulLinear (M : Matrix m n R) : LinearMap.range M.vecMulLinear = span R (range M) := by
letI := Classical.decEq m simp_rw [range_eq_map, ← iSup_range_stdBasis, Submodule.map_iSup, range_eq_map, ← Ideal.span_singleton_one, Ideal.span, Submodule.map_span, image_image, image_singleton, Matrix.vecMulLinear_apply, iSup_span, range_eq_iUnion, iUnion_singleton_eq_range, LinearMap.stdBasis, coe_single] unfold vecMul simp_rw [single_dotProduct, one_mul]
[ " ((LinearMap.stdBasis R (fun x => R) i) 1 α΅₯* M) j = M i j", " βˆ‘ i' : m, (if i = i' then 1 else 0) * M i' j = M i j", " βˆ‘ x : m, (LinearMap.stdBasis R (fun x => R) i) 1 x * M x j = M i j", " (LinearMap.stdBasis R (fun x => R) i) 1 x✝ = if i = x✝ then 1 else 0", " (LinearMap.stdBasis R (fun x => R) i) 1 x✝ =...
[ " ((LinearMap.stdBasis R (fun x => R) i) 1 α΅₯* M) j = M i j", " βˆ‘ i' : m, (if i = i' then 1 else 0) * M i' j = M i j", " βˆ‘ x : m, (LinearMap.stdBasis R (fun x => R) i) 1 x * M x j = M i j", " (LinearMap.stdBasis R (fun x => R) i) 1 x✝ = if i = x✝ then 1 else 0", " (LinearMap.stdBasis R (fun x => R) i) 1 x✝ =...
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar] #align orientation.measure_eq_volume Orientation.measure_eq_volume end
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
61
66
theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ ℝ F) : volume (parallelepiped b) = 1 := by
haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b
[ " o.volumeForm.measure (parallelepiped ⇑b) = 1", " ΞΉ ≃ Fin n", " Fintype.card ΞΉ = n", " ⇑b = ⇑(b.reindex e) ∘ ⇑e", " b x = (⇑(b.reindex e) ∘ ⇑e) x", " o.volumeForm.measure = volume", " addHaarMeasure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = volume", " volume (parallelepiped ⇑b) = 1" ]
[ " o.volumeForm.measure (parallelepiped ⇑b) = 1", " ΞΉ ≃ Fin n", " Fintype.card ΞΉ = n", " ⇑b = ⇑(b.reindex e) ∘ ⇑e", " b x = (⇑(b.reindex e) ∘ ⇑e) x", " o.volumeForm.measure = volume", " addHaarMeasure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = volume", " volume (parallelepiped ⇑b) = 1" ]
import Mathlib.Data.Countable.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Order.Disjointed import Mathlib.MeasureTheory.OuterMeasure.Defs #align_import measure_theory.measure.outer_measure from "leanprover-community/mathlib"@"343e80208d29d2d15f8050b929aa50fe4ce71b55" noncomputable section open Set Function Filter open scoped Classical NNReal Topology ENNReal namespace MeasureTheory section OuterMeasureClass variable {Ξ± ΞΉ F : Type*} [FunLike F (Set Ξ±) ℝβ‰₯0∞] [OuterMeasureClass F Ξ±] {ΞΌ : F} {s t : Set Ξ±} @[simp] theorem measure_empty : ΞΌ βˆ… = 0 := OuterMeasureClass.measure_empty ΞΌ #align measure_theory.measure_empty MeasureTheory.measure_empty @[mono, gcongr] theorem measure_mono (h : s βŠ† t) : ΞΌ s ≀ ΞΌ t := OuterMeasureClass.measure_mono ΞΌ h #align measure_theory.measure_mono MeasureTheory.measure_mono theorem measure_mono_null (h : s βŠ† t) (ht : ΞΌ t = 0) : ΞΌ s = 0 := eq_bot_mono (measure_mono h) ht #align measure_theory.measure_mono_null MeasureTheory.measure_mono_null theorem measure_pos_of_superset (h : s βŠ† t) (hs : ΞΌ s β‰  0) : 0 < ΞΌ t := hs.bot_lt.trans_le (measure_mono h) theorem measure_iUnion_le [Countable ΞΉ] (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i, s i) ≀ βˆ‘' i, ΞΌ (s i) := by refine rel_iSup_tsum ΞΌ measure_empty (Β· ≀ Β·) (fun t ↦ ?_) _ calc ΞΌ (⋃ i, t i) = ΞΌ (⋃ i, disjointed t i) := by rw [iUnion_disjointed] _ ≀ βˆ‘' i, ΞΌ (disjointed t i) := OuterMeasureClass.measure_iUnion_nat_le _ _ (disjoint_disjointed _) _ ≀ βˆ‘' i, ΞΌ (t i) := by gcongr; apply disjointed_subset #align measure_theory.measure_Union_le MeasureTheory.measure_iUnion_le theorem measure_biUnion_le {I : Set ΞΉ} (ΞΌ : F) (hI : I.Countable) (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘' i : I, ΞΌ (s i) := by have := hI.to_subtype rw [biUnion_eq_iUnion] apply measure_iUnion_le #align measure_theory.measure_bUnion_le MeasureTheory.measure_biUnion_le theorem measure_biUnion_finset_le (I : Finset ΞΉ) (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘ i ∈ I, ΞΌ (s i) := (measure_biUnion_le ΞΌ I.countable_toSet s).trans_eq <| I.tsum_subtype (ΞΌ <| s Β·) #align measure_theory.measure_bUnion_finset_le MeasureTheory.measure_biUnion_finset_le theorem measure_iUnion_fintype_le [Fintype ΞΉ] (ΞΌ : F) (s : ΞΉ β†’ Set Ξ±) : ΞΌ (⋃ i, s i) ≀ βˆ‘ i, ΞΌ (s i) := by simpa using measure_biUnion_finset_le Finset.univ s #align measure_theory.measure_Union_fintype_le MeasureTheory.measure_iUnion_fintype_le theorem measure_union_le (s t : Set Ξ±) : ΞΌ (s βˆͺ t) ≀ ΞΌ s + ΞΌ t := by simpa [union_eq_iUnion] using measure_iUnion_fintype_le ΞΌ (cond Β· s t) #align measure_theory.measure_union_le MeasureTheory.measure_union_le theorem measure_le_inter_add_diff (ΞΌ : F) (s t : Set Ξ±) : ΞΌ s ≀ ΞΌ (s ∩ t) + ΞΌ (s \ t) := by simpa using measure_union_le (s ∩ t) (s \ t)
Mathlib/MeasureTheory/OuterMeasure/Basic.lean
96
100
theorem measure_diff_null (ht : ΞΌ t = 0) : ΞΌ (s \ t) = ΞΌ s := (measure_mono diff_subset).antisymm <| calc ΞΌ s ≀ ΞΌ (s ∩ t) + ΞΌ (s \ t) := measure_le_inter_add_diff _ _ _ _ ≀ ΞΌ t + ΞΌ (s \ t) := by
gcongr; apply inter_subset_right _ = ΞΌ (s \ t) := by simp [ht]
[ " ΞΌ (⋃ i, s i) ≀ βˆ‘' (i : ΞΉ), ΞΌ (s i)", " (fun x x_1 => x ≀ x_1) (ΞΌ (⨆ i, t i)) (βˆ‘' (i : β„•), ΞΌ (t i))", " ΞΌ (⋃ i, t i) = ΞΌ (⋃ i, disjointed t i)", " βˆ‘' (i : β„•), ΞΌ (disjointed t i) ≀ βˆ‘' (i : β„•), ΞΌ (t i)", " disjointed t a✝ βŠ† t a✝", " ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘' (i : ↑I), ΞΌ (s ↑i)", " ΞΌ (⋃ x, s ↑x) ≀ βˆ‘' (i : ↑I)...
[ " ΞΌ (⋃ i, s i) ≀ βˆ‘' (i : ΞΉ), ΞΌ (s i)", " (fun x x_1 => x ≀ x_1) (ΞΌ (⨆ i, t i)) (βˆ‘' (i : β„•), ΞΌ (t i))", " ΞΌ (⋃ i, t i) = ΞΌ (⋃ i, disjointed t i)", " βˆ‘' (i : β„•), ΞΌ (disjointed t i) ≀ βˆ‘' (i : β„•), ΞΌ (t i)", " disjointed t a✝ βŠ† t a✝", " ΞΌ (⋃ i ∈ I, s i) ≀ βˆ‘' (i : ↑I), ΞΌ (s ↑i)", " ΞΌ (⋃ x, s ↑x) ≀ βˆ‘' (i : ↑I)...
import Mathlib.Algebra.Order.Archimedean import Mathlib.Order.Filter.AtTopBot import Mathlib.Tactic.GCongr #align_import order.filter.archimedean from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" variable {Ξ± R : Type*} open Filter Set Function @[simp] theorem Nat.comap_cast_atTop [StrictOrderedSemiring R] [Archimedean R] : comap ((↑) : β„• β†’ R) atTop = atTop := comap_embedding_atTop (fun _ _ => Nat.cast_le) exists_nat_ge #align nat.comap_coe_at_top Nat.comap_cast_atTop theorem tendsto_natCast_atTop_iff [StrictOrderedSemiring R] [Archimedean R] {f : Ξ± β†’ β„•} {l : Filter Ξ±} : Tendsto (fun n => (f n : R)) l atTop ↔ Tendsto f l atTop := tendsto_atTop_embedding (fun _ _ => Nat.cast_le) exists_nat_ge #align tendsto_coe_nat_at_top_iff tendsto_natCast_atTop_iff @[deprecated (since := "2024-04-17")] alias tendsto_nat_cast_atTop_iff := tendsto_natCast_atTop_iff theorem tendsto_natCast_atTop_atTop [OrderedSemiring R] [Archimedean R] : Tendsto ((↑) : β„• β†’ R) atTop atTop := Nat.mono_cast.tendsto_atTop_atTop exists_nat_ge #align tendsto_coe_nat_at_top_at_top tendsto_natCast_atTop_atTop @[deprecated (since := "2024-04-17")] alias tendsto_nat_cast_atTop_atTop := tendsto_natCast_atTop_atTop theorem Filter.Eventually.natCast_atTop [OrderedSemiring R] [Archimedean R] {p : R β†’ Prop} (h : βˆ€αΆ  (x:R) in atTop, p x) : βˆ€αΆ  (n:β„•) in atTop, p n := tendsto_natCast_atTop_atTop.eventually h @[deprecated (since := "2024-04-17")] alias Filter.Eventually.nat_cast_atTop := Filter.Eventually.natCast_atTop @[simp] theorem Int.comap_cast_atTop [StrictOrderedRing R] [Archimedean R] : comap ((↑) : β„€ β†’ R) atTop = atTop := comap_embedding_atTop (fun _ _ => Int.cast_le) fun r => let ⟨n, hn⟩ := exists_nat_ge r; ⟨n, mod_cast hn⟩ #align int.comap_coe_at_top Int.comap_cast_atTop @[simp] theorem Int.comap_cast_atBot [StrictOrderedRing R] [Archimedean R] : comap ((↑) : β„€ β†’ R) atBot = atBot := comap_embedding_atBot (fun _ _ => Int.cast_le) fun r => let ⟨n, hn⟩ := exists_nat_ge (-r) ⟨-n, by simpa [neg_le] using hn⟩ #align int.comap_coe_at_bot Int.comap_cast_atBot theorem tendsto_intCast_atTop_iff [StrictOrderedRing R] [Archimedean R] {f : Ξ± β†’ β„€} {l : Filter Ξ±} : Tendsto (fun n => (f n : R)) l atTop ↔ Tendsto f l atTop := by rw [← @Int.comap_cast_atTop R, tendsto_comap_iff]; rfl #align tendsto_coe_int_at_top_iff tendsto_intCast_atTop_iff @[deprecated (since := "2024-04-17")] alias tendsto_int_cast_atTop_iff := tendsto_intCast_atTop_iff theorem tendsto_intCast_atBot_iff [StrictOrderedRing R] [Archimedean R] {f : Ξ± β†’ β„€} {l : Filter Ξ±} : Tendsto (fun n => (f n : R)) l atBot ↔ Tendsto f l atBot := by rw [← @Int.comap_cast_atBot R, tendsto_comap_iff]; rfl #align tendsto_coe_int_at_bot_iff tendsto_intCast_atBot_iff @[deprecated (since := "2024-04-17")] alias tendsto_int_cast_atBot_iff := tendsto_intCast_atBot_iff theorem tendsto_intCast_atTop_atTop [StrictOrderedRing R] [Archimedean R] : Tendsto ((↑) : β„€ β†’ R) atTop atTop := tendsto_intCast_atTop_iff.2 tendsto_id #align tendsto_coe_int_at_top_at_top tendsto_intCast_atTop_atTop @[deprecated (since := "2024-04-17")] alias tendsto_int_cast_atTop_atTop := tendsto_intCast_atTop_atTop theorem Filter.Eventually.intCast_atTop [StrictOrderedRing R] [Archimedean R] {p : R β†’ Prop} (h : βˆ€αΆ  (x:R) in atTop, p x) : βˆ€αΆ  (n:β„€) in atTop, p n := by rw [← Int.comap_cast_atTop (R := R)]; exact h.comap _ @[deprecated (since := "2024-04-17")] alias Filter.Eventually.int_cast_atTop := Filter.Eventually.intCast_atTop
Mathlib/Order/Filter/Archimedean.lean
100
102
theorem Filter.Eventually.intCast_atBot [StrictOrderedRing R] [Archimedean R] {p : R β†’ Prop} (h : βˆ€αΆ  (x:R) in atBot, p x) : βˆ€αΆ  (n:β„€) in atBot, p n := by
rw [← Int.comap_cast_atBot (R := R)]; exact h.comap _
[ " ↑(-↑n) ≀ r", " Tendsto (fun n => ↑(f n)) l atTop ↔ Tendsto f l atTop", " Tendsto (fun n => ↑(f n)) l atTop ↔ Tendsto (Int.cast ∘ f) l atTop", " Tendsto (fun n => ↑(f n)) l atBot ↔ Tendsto f l atBot", " Tendsto (fun n => ↑(f n)) l atBot ↔ Tendsto (Int.cast ∘ f) l atBot", " βˆ€αΆ  (n : β„€) in atTop, p ↑n", "...
[ " ↑(-↑n) ≀ r", " Tendsto (fun n => ↑(f n)) l atTop ↔ Tendsto f l atTop", " Tendsto (fun n => ↑(f n)) l atTop ↔ Tendsto (Int.cast ∘ f) l atTop", " Tendsto (fun n => ↑(f n)) l atBot ↔ Tendsto f l atBot", " Tendsto (fun n => ↑(f n)) l atBot ↔ Tendsto (Int.cast ∘ f) l atBot", " βˆ€αΆ  (n : β„€) in atTop, p ↑n", "...
import Mathlib.Data.Fintype.List #align_import data.list.cycle from "leanprover-community/mathlib"@"7413128c3bcb3b0818e3e18720abc9ea3100fb49" assert_not_exists MonoidWithZero open List def Cycle (Ξ± : Type*) : Type _ := Quotient (IsRotated.setoid Ξ±) #align cycle Cycle namespace Cycle variable {Ξ± : Type*} -- Porting note (#11445): new definition @[coe] def ofList : List Ξ± β†’ Cycle Ξ± := Quot.mk _ instance : Coe (List Ξ±) (Cycle Ξ±) := ⟨ofList⟩ @[simp] theorem coe_eq_coe {l₁ lβ‚‚ : List Ξ±} : (l₁ : Cycle Ξ±) = (lβ‚‚ : Cycle Ξ±) ↔ l₁ ~r lβ‚‚ := @Quotient.eq _ (IsRotated.setoid _) _ _ #align cycle.coe_eq_coe Cycle.coe_eq_coe @[simp] theorem mk_eq_coe (l : List Ξ±) : Quot.mk _ l = (l : Cycle Ξ±) := rfl #align cycle.mk_eq_coe Cycle.mk_eq_coe @[simp] theorem mk''_eq_coe (l : List Ξ±) : Quotient.mk'' l = (l : Cycle Ξ±) := rfl #align cycle.mk'_eq_coe Cycle.mk''_eq_coe theorem coe_cons_eq_coe_append (l : List Ξ±) (a : Ξ±) : (↑(a :: l) : Cycle Ξ±) = (↑(l ++ [a]) : Cycle Ξ±) := Quot.sound ⟨1, by rw [rotate_cons_succ, rotate_zero]⟩ #align cycle.coe_cons_eq_coe_append Cycle.coe_cons_eq_coe_append def nil : Cycle Ξ± := ([] : List Ξ±) #align cycle.nil Cycle.nil @[simp] theorem coe_nil : ↑([] : List Ξ±) = @nil Ξ± := rfl #align cycle.coe_nil Cycle.coe_nil @[simp] theorem coe_eq_nil (l : List Ξ±) : (l : Cycle Ξ±) = nil ↔ l = [] := coe_eq_coe.trans isRotated_nil_iff #align cycle.coe_eq_nil Cycle.coe_eq_nil instance : EmptyCollection (Cycle Ξ±) := ⟨nil⟩ @[simp] theorem empty_eq : βˆ… = @nil Ξ± := rfl #align cycle.empty_eq Cycle.empty_eq instance : Inhabited (Cycle Ξ±) := ⟨nil⟩ @[elab_as_elim] theorem induction_on {C : Cycle Ξ± β†’ Prop} (s : Cycle Ξ±) (H0 : C nil) (HI : βˆ€ (a) (l : List Ξ±), C ↑l β†’ C ↑(a :: l)) : C s := Quotient.inductionOn' s fun l => by refine List.recOn l ?_ ?_ <;> simp assumption' #align cycle.induction_on Cycle.induction_on def Mem (a : Ξ±) (s : Cycle Ξ±) : Prop := Quot.liftOn s (fun l => a ∈ l) fun _ _ e => propext <| e.mem_iff #align cycle.mem Cycle.Mem instance : Membership Ξ± (Cycle Ξ±) := ⟨Mem⟩ @[simp] theorem mem_coe_iff {a : Ξ±} {l : List Ξ±} : a ∈ (↑l : Cycle Ξ±) ↔ a ∈ l := Iff.rfl #align cycle.mem_coe_iff Cycle.mem_coe_iff @[simp] theorem not_mem_nil : βˆ€ a, a βˆ‰ @nil Ξ± := List.not_mem_nil #align cycle.not_mem_nil Cycle.not_mem_nil instance [DecidableEq Ξ±] : DecidableEq (Cycle Ξ±) := fun s₁ sβ‚‚ => Quotient.recOnSubsingletonβ‚‚' s₁ sβ‚‚ fun _ _ => decidable_of_iff' _ Quotient.eq'' instance [DecidableEq Ξ±] (x : Ξ±) (s : Cycle Ξ±) : Decidable (x ∈ s) := Quotient.recOnSubsingleton' s fun l => show Decidable (x ∈ l) from inferInstance nonrec def reverse (s : Cycle Ξ±) : Cycle Ξ± := Quot.map reverse (fun _ _ => IsRotated.reverse) s #align cycle.reverse Cycle.reverse @[simp] theorem reverse_coe (l : List Ξ±) : (l : Cycle Ξ±).reverse = l.reverse := rfl #align cycle.reverse_coe Cycle.reverse_coe @[simp] theorem mem_reverse_iff {a : Ξ±} {s : Cycle Ξ±} : a ∈ s.reverse ↔ a ∈ s := Quot.inductionOn s fun _ => mem_reverse #align cycle.mem_reverse_iff Cycle.mem_reverse_iff @[simp] theorem reverse_reverse (s : Cycle Ξ±) : s.reverse.reverse = s := Quot.inductionOn s fun _ => by simp #align cycle.reverse_reverse Cycle.reverse_reverse @[simp] theorem reverse_nil : nil.reverse = @nil Ξ± := rfl #align cycle.reverse_nil Cycle.reverse_nil def length (s : Cycle Ξ±) : β„• := Quot.liftOn s List.length fun _ _ e => e.perm.length_eq #align cycle.length Cycle.length @[simp] theorem length_coe (l : List Ξ±) : length (l : Cycle Ξ±) = l.length := rfl #align cycle.length_coe Cycle.length_coe @[simp] theorem length_nil : length (@nil Ξ±) = 0 := rfl #align cycle.length_nil Cycle.length_nil @[simp] theorem length_reverse (s : Cycle Ξ±) : s.reverse.length = s.length := Quot.inductionOn s List.length_reverse #align cycle.length_reverse Cycle.length_reverse def Subsingleton (s : Cycle Ξ±) : Prop := s.length ≀ 1 #align cycle.subsingleton Cycle.Subsingleton theorem subsingleton_nil : Subsingleton (@nil Ξ±) := Nat.zero_le _ #align cycle.subsingleton_nil Cycle.subsingleton_nil theorem length_subsingleton_iff {s : Cycle Ξ±} : Subsingleton s ↔ length s ≀ 1 := Iff.rfl #align cycle.length_subsingleton_iff Cycle.length_subsingleton_iff @[simp]
Mathlib/Data/List/Cycle.lean
601
602
theorem subsingleton_reverse_iff {s : Cycle Ξ±} : s.reverse.Subsingleton ↔ s.Subsingleton := by
simp [length_subsingleton_iff]
[ " (a :: l).rotate 1 = l ++ [a]", " C (Quotient.mk'' l)", " C (Quotient.mk'' [])", " βˆ€ (head : Ξ±) (tail : List Ξ±), C (Quotient.mk'' tail) β†’ C (Quotient.mk'' (head :: tail))", " βˆ€ (head : Ξ±) (tail : List Ξ±), C ↑tail β†’ C ↑(head :: tail)", " (reverse (Quot.mk Setoid.r x✝)).reverse = Quot.mk Setoid.r x✝", " ...
[ " (a :: l).rotate 1 = l ++ [a]", " C (Quotient.mk'' l)", " C (Quotient.mk'' [])", " βˆ€ (head : Ξ±) (tail : List Ξ±), C (Quotient.mk'' tail) β†’ C (Quotient.mk'' (head :: tail))", " βˆ€ (head : Ξ±) (tail : List Ξ±), C ↑tail β†’ C ↑(head :: tail)", " (reverse (Quot.mk Setoid.r x✝)).reverse = Quot.mk Setoid.r x✝", " ...
import Mathlib.Algebra.Divisibility.Basic import Mathlib.Algebra.Group.Equiv.Basic import Mathlib.Algebra.Group.TypeTags import Mathlib.Algebra.Ring.Hom.Defs import Mathlib.Algebra.Ring.Nat #align_import data.nat.cast.basic from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441" assert_not_exists OrderedCommGroup assert_not_exists Commute.zero_right assert_not_exists Commute.add_right assert_not_exists abs_eq_max_neg assert_not_exists natCast_ne assert_not_exists MulOpposite.natCast -- Porting note: There are many occasions below where we need `simp [map_zero f]` -- where `simp [map_zero]` should suffice. (Similarly for `map_one`.) -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/simp.20regression.20with.20MonoidHomClass open Additive Multiplicative variable {Ξ± Ξ² : Type*} namespace Nat def castAddMonoidHom (Ξ± : Type*) [AddMonoidWithOne Ξ±] : β„• β†’+ Ξ± where toFun := Nat.cast map_add' := cast_add map_zero' := cast_zero #align nat.cast_add_monoid_hom Nat.castAddMonoidHom @[simp] theorem coe_castAddMonoidHom [AddMonoidWithOne Ξ±] : (castAddMonoidHom Ξ± : β„• β†’ Ξ±) = Nat.cast := rfl #align nat.coe_cast_add_monoid_hom Nat.coe_castAddMonoidHom lemma _root_.Even.natCast [AddMonoidWithOne Ξ±] {n : β„•} (hn : Even n) : Even (n : Ξ±) := hn.map <| Nat.castAddMonoidHom Ξ± section MonoidWithZeroHomClass variable {A F : Type*} [MulZeroOneClass A] [FunLike F β„• A]
Mathlib/Data/Nat/Cast/Basic.lean
159
164
theorem ext_nat'' [MonoidWithZeroHomClass F β„• A] (f g : F) (h_pos : βˆ€ {n : β„•}, 0 < n β†’ f n = g n) : f = g := by
apply DFunLike.ext rintro (_ | n) Β· simp [map_zero f, map_zero g] Β· exact h_pos n.succ_pos
[ " f = g", " βˆ€ (x : β„•), f x = g x", " f 0 = g 0", " f (n + 1) = g (n + 1)" ]
[ " f = g" ]
import Mathlib.Algebra.Polynomial.Mirror import Mathlib.Analysis.Complex.Polynomial #align_import data.polynomial.unit_trinomial from "leanprover-community/mathlib"@"302eab4f46abb63de520828de78c04cb0f9b5836" namespace Polynomial open scoped Polynomial open Finset section Semiring variable {R : Type*} [Semiring R] (k m n : β„•) (u v w : R) noncomputable def trinomial := C u * X ^ k + C v * X ^ m + C w * X ^ n #align polynomial.trinomial Polynomial.trinomial theorem trinomial_def : trinomial k m n u v w = C u * X ^ k + C v * X ^ m + C w * X ^ n := rfl #align polynomial.trinomial_def Polynomial.trinomial_def variable {k m n u v w} theorem trinomial_leading_coeff' (hkm : k < m) (hmn : m < n) : (trinomial k m n u v w).coeff n = w := by rw [trinomial_def, coeff_add, coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X_pow, coeff_C_mul_X_pow, if_neg (hkm.trans hmn).ne', if_neg hmn.ne', if_pos rfl, zero_add, zero_add] #align polynomial.trinomial_leading_coeff' Polynomial.trinomial_leading_coeff' theorem trinomial_middle_coeff (hkm : k < m) (hmn : m < n) : (trinomial k m n u v w).coeff m = v := by rw [trinomial_def, coeff_add, coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X_pow, coeff_C_mul_X_pow, if_neg hkm.ne', if_pos rfl, if_neg hmn.ne, zero_add, add_zero] #align polynomial.trinomial_middle_coeff Polynomial.trinomial_middle_coeff theorem trinomial_trailing_coeff' (hkm : k < m) (hmn : m < n) : (trinomial k m n u v w).coeff k = u := by rw [trinomial_def, coeff_add, coeff_add, coeff_C_mul_X_pow, coeff_C_mul_X_pow, coeff_C_mul_X_pow, if_pos rfl, if_neg hkm.ne, if_neg (hkm.trans hmn).ne, add_zero, add_zero] #align polynomial.trinomial_trailing_coeff' Polynomial.trinomial_trailing_coeff' theorem trinomial_natDegree (hkm : k < m) (hmn : m < n) (hw : w β‰  0) : (trinomial k m n u v w).natDegree = n := by refine natDegree_eq_of_degree_eq_some ((Finset.sup_le fun i h => ?_).antisymm <| le_degree_of_ne_zero <| by rwa [trinomial_leading_coeff' hkm hmn]) replace h := support_trinomial' k m n u v w h rw [mem_insert, mem_insert, mem_singleton] at h rcases h with (rfl | rfl | rfl) Β· exact WithBot.coe_le_coe.mpr (hkm.trans hmn).le Β· exact WithBot.coe_le_coe.mpr hmn.le Β· exact le_rfl #align polynomial.trinomial_nat_degree Polynomial.trinomial_natDegree theorem trinomial_natTrailingDegree (hkm : k < m) (hmn : m < n) (hu : u β‰  0) : (trinomial k m n u v w).natTrailingDegree = k := by refine natTrailingDegree_eq_of_trailingDegree_eq_some ((Finset.le_inf fun i h => ?_).antisymm <| trailingDegree_le_of_ne_zero <| by rwa [trinomial_trailing_coeff' hkm hmn]).symm replace h := support_trinomial' k m n u v w h rw [mem_insert, mem_insert, mem_singleton] at h rcases h with (rfl | rfl | rfl) Β· exact le_rfl Β· exact WithTop.coe_le_coe.mpr hkm.le Β· exact WithTop.coe_le_coe.mpr (hkm.trans hmn).le #align polynomial.trinomial_nat_trailing_degree Polynomial.trinomial_natTrailingDegree
Mathlib/Algebra/Polynomial/UnitTrinomial.lean
95
97
theorem trinomial_leadingCoeff (hkm : k < m) (hmn : m < n) (hw : w β‰  0) : (trinomial k m n u v w).leadingCoeff = w := by
rw [leadingCoeff, trinomial_natDegree hkm hmn hw, trinomial_leading_coeff' hkm hmn]
[ " (trinomial k m n u v w).coeff n = w", " (trinomial k m n u v w).coeff m = v", " (trinomial k m n u v w).coeff k = u", " (trinomial k m n u v w).natDegree = n", " (trinomial k m n u v w).coeff n β‰  0", " ↑i ≀ ↑n", " ↑i ≀ ↑i", " (trinomial k m n u v w).natTrailingDegree = k", " (trinomial k m n u v w...
[ " (trinomial k m n u v w).coeff n = w", " (trinomial k m n u v w).coeff m = v", " (trinomial k m n u v w).coeff k = u", " (trinomial k m n u v w).natDegree = n", " (trinomial k m n u v w).coeff n β‰  0", " ↑i ≀ ↑n", " ↑i ≀ ↑i", " (trinomial k m n u v w).natTrailingDegree = k", " (trinomial k m n u v w...
import Mathlib.Analysis.Convex.Hull #align_import analysis.convex.join from "leanprover-community/mathlib"@"951bf1d9e98a2042979ced62c0620bcfb3587cf8" open Set variable {ΞΉ : Sort*} {π•œ E : Type*} section OrderedSemiring variable (π•œ) [OrderedSemiring π•œ] [AddCommMonoid E] [Module π•œ E] {s t s₁ sβ‚‚ t₁ tβ‚‚ u : Set E} {x y : E} def convexJoin (s t : Set E) : Set E := ⋃ (x ∈ s) (y ∈ t), segment π•œ x y #align convex_join convexJoin variable {π•œ}
Mathlib/Analysis/Convex/Join.lean
36
37
theorem mem_convexJoin : x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b := by
simp [convexJoin]
[ " x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b" ]
[ " x ∈ convexJoin π•œ s t ↔ βˆƒ a ∈ s, βˆƒ b ∈ t, x ∈ segment π•œ a b" ]
import Mathlib.GroupTheory.QuotientGroup #align_import algebra.char_zero.quotient from "leanprover-community/mathlib"@"d90e4e186f1d18e375dcd4e5b5f6364b01cb3e46" variable {R : Type*} [DivisionRing R] [CharZero R] {p : R} namespace AddSubgroup theorem zsmul_mem_zmultiples_iff_exists_sub_div {r : R} {z : β„€} (hz : z β‰  0) : z β€’ r ∈ AddSubgroup.zmultiples p ↔ βˆƒ k : Fin z.natAbs, r - (k : β„•) β€’ (p / z : R) ∈ AddSubgroup.zmultiples p := by rw [AddSubgroup.mem_zmultiples_iff] simp_rw [AddSubgroup.mem_zmultiples_iff, div_eq_mul_inv, ← smul_mul_assoc, eq_sub_iff_add_eq] have hz' : (z : R) β‰  0 := Int.cast_ne_zero.mpr hz conv_rhs => simp (config := { singlePass := true }) only [← (mul_right_injectiveβ‚€ hz').eq_iff] simp_rw [← zsmul_eq_mul, smul_add, ← mul_smul_comm, zsmul_eq_mul (z : R)⁻¹, mul_inv_cancel hz', mul_one, ← natCast_zsmul, smul_smul, ← add_smul] constructor Β· rintro ⟨k, h⟩ simp_rw [← h] refine ⟨⟨(k % z).toNat, ?_⟩, k / z, ?_⟩ Β· rw [← Int.ofNat_lt, Int.toNat_of_nonneg (Int.emod_nonneg _ hz)] exact (Int.emod_lt _ hz).trans_eq (Int.abs_eq_natAbs _) rw [Fin.val_mk, Int.toNat_of_nonneg (Int.emod_nonneg _ hz)] nth_rewrite 3 [← Int.ediv_add_emod k z] rfl Β· rintro ⟨k, n, h⟩ exact ⟨_, h⟩ #align add_subgroup.zsmul_mem_zmultiples_iff_exists_sub_div AddSubgroup.zsmul_mem_zmultiples_iff_exists_sub_div
Mathlib/Algebra/CharZero/Quotient.lean
42
47
theorem nsmul_mem_zmultiples_iff_exists_sub_div {r : R} {n : β„•} (hn : n β‰  0) : n β€’ r ∈ AddSubgroup.zmultiples p ↔ βˆƒ k : Fin n, r - (k : β„•) β€’ (p / n : R) ∈ AddSubgroup.zmultiples p := by
rw [← natCast_zsmul r, zsmul_mem_zmultiples_iff_exists_sub_div (Int.natCast_ne_zero.mpr hn), Int.cast_natCast] rfl
[ " z β€’ r ∈ zmultiples p ↔ βˆƒ k, r - ↑k β€’ (p / ↑z) ∈ zmultiples p", " (βˆƒ k, k β€’ p = z β€’ r) ↔ βˆƒ k, r - ↑k β€’ (p / ↑z) ∈ zmultiples p", " (βˆƒ k, k β€’ p = z β€’ r) ↔ βˆƒ k k_1, k_1 β€’ p + ↑k β€’ p * (↑z)⁻¹ = r", "R : Type u_1\ninst✝¹ : DivisionRing R\ninst✝ : CharZero R\np r : R\nz : β„€\nhz : z β‰  0\nhz' : ↑z β‰  0\n| βˆƒ k k_1, k...
[ " z β€’ r ∈ zmultiples p ↔ βˆƒ k, r - ↑k β€’ (p / ↑z) ∈ zmultiples p", " (βˆƒ k, k β€’ p = z β€’ r) ↔ βˆƒ k, r - ↑k β€’ (p / ↑z) ∈ zmultiples p", " (βˆƒ k, k β€’ p = z β€’ r) ↔ βˆƒ k k_1, k_1 β€’ p + ↑k β€’ p * (↑z)⁻¹ = r", "R : Type u_1\ninst✝¹ : DivisionRing R\ninst✝ : CharZero R\np r : R\nz : β„€\nhz : z β‰  0\nhz' : ↑z β‰  0\n| βˆƒ k k_1, k...
import Mathlib.Data.Set.Prod import Mathlib.Logic.Equiv.Fin import Mathlib.ModelTheory.LanguageMap #align_import model_theory.syntax from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728" universe u v w u' v' namespace FirstOrder namespace Language variable (L : Language.{u, v}) {L' : Language} variable {M : Type w} {N P : Type*} [L.Structure M] [L.Structure N] [L.Structure P] variable {Ξ± : Type u'} {Ξ² : Type v'} {Ξ³ : Type*} open FirstOrder open Structure Fin inductive Term (Ξ± : Type u') : Type max u u' | var : Ξ± β†’ Term Ξ± | func : βˆ€ {l : β„•} (_f : L.Functions l) (_ts : Fin l β†’ Term Ξ±), Term Ξ± #align first_order.language.term FirstOrder.Language.Term export Term (var func) variable {L} scoped[FirstOrder] prefix:arg "&" => FirstOrder.Language.Term.var ∘ Sum.inr namespace LHom open Term -- Porting note: universes in different order @[simp] def onTerm (Ο† : L β†’α΄Έ L') : L.Term Ξ± β†’ L'.Term Ξ± | var i => var i | func f ts => func (Ο†.onFunction f) fun i => onTerm Ο† (ts i) set_option linter.uppercaseLean3 false in #align first_order.language.LHom.on_term FirstOrder.Language.LHom.onTerm @[simp] theorem id_onTerm : ((LHom.id L).onTerm : L.Term Ξ± β†’ L.Term Ξ±) = id := by ext t induction' t with _ _ _ _ ih Β· rfl Β· simp_rw [onTerm, ih] rfl set_option linter.uppercaseLean3 false in #align first_order.language.LHom.id_on_term FirstOrder.Language.LHom.id_onTerm @[simp]
Mathlib/ModelTheory/Syntax.lean
284
290
theorem comp_onTerm {L'' : Language} (Ο† : L' β†’α΄Έ L'') (ψ : L β†’α΄Έ L') : ((Ο†.comp ψ).onTerm : L.Term Ξ± β†’ L''.Term Ξ±) = Ο†.onTerm ∘ ψ.onTerm := by
ext t induction' t with _ _ _ _ ih Β· rfl Β· simp_rw [onTerm, ih] rfl
[ " (LHom.id L).onTerm = id", " (LHom.id L).onTerm t = id t", " (LHom.id L).onTerm (var a✝) = id (var a✝)", " (LHom.id L).onTerm (func _f✝ _ts✝) = id (func _f✝ _ts✝)", " (func ((LHom.id L).onFunction _f✝) fun i => id (_ts✝ i)) = id (func _f✝ _ts✝)", " (Ο†.comp ψ).onTerm = Ο†.onTerm ∘ ψ.onTerm", " (Ο†.comp ψ)...
[ " (LHom.id L).onTerm = id", " (LHom.id L).onTerm t = id t", " (LHom.id L).onTerm (var a✝) = id (var a✝)", " (LHom.id L).onTerm (func _f✝ _ts✝) = id (func _f✝ _ts✝)", " (func ((LHom.id L).onFunction _f✝) fun i => id (_ts✝ i)) = id (func _f✝ _ts✝)", " (Ο†.comp ψ).onTerm = Ο†.onTerm ∘ ψ.onTerm" ]
import Mathlib.LinearAlgebra.Basis import Mathlib.Algebra.Module.LocalizedModule import Mathlib.RingTheory.Localization.FractionRing import Mathlib.RingTheory.Localization.Integer #align_import ring_theory.localization.module from "leanprover-community/mathlib"@"2e59a6de168f95d16b16d217b808a36290398c0a" open nonZeroDivisors section Localization variable {R : Type*} (Rβ‚› : Type*) [CommSemiring R] (S : Submonoid R) section IsLocalizedModule section AddCommMonoid open Submodule variable [CommSemiring Rβ‚›] [Algebra R Rβ‚›] [hT : IsLocalization S Rβ‚›] variable {M M' : Type*} [AddCommMonoid M] [Module R M] [Module Rβ‚› M] [IsScalarTower R Rβ‚› M] [AddCommMonoid M'] [Module R M'] [Module Rβ‚› M'] [IsScalarTower R Rβ‚› M'] (f : M β†’β‚—[R] M') [IsLocalizedModule S f] theorem span_eq_top_of_isLocalizedModule {v : Set M} (hv : span R v = ⊀) : span Rβ‚› (f '' v) = ⊀ := top_unique fun x _ ↦ by obtain ⟨⟨m, s⟩, h⟩ := IsLocalizedModule.surj S f x rw [Submonoid.smul_def, ← algebraMap_smul Rβ‚›, ← Units.smul_isUnit (IsLocalization.map_units Rβ‚› s), eq_comm, ← inv_smul_eq_iff] at h refine h β–Έ smul_mem _ _ (span_subset_span R Rβ‚› _ ?_) rw [← LinearMap.coe_restrictScalars R, ← LinearMap.map_span, hv] exact mem_map_of_mem mem_top
Mathlib/RingTheory/Localization/Module.lean
56
71
theorem LinearIndependent.of_isLocalizedModule {ΞΉ : Type*} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : LinearIndependent Rβ‚› (f ∘ v) := by
rw [linearIndependent_iff'] at hv ⊒ intro t g hg i hi choose! a g' hg' using IsLocalization.exist_integer_multiples S t g have h0 : f (βˆ‘ i ∈ t, g' i β€’ v i) = 0 := by apply_fun ((a : R) β€’ Β·) at hg rw [smul_zero, Finset.smul_sum] at hg rw [map_sum, ← hg] refine Finset.sum_congr rfl fun i hi => ?_ rw [← smul_assoc, ← hg' i hi, map_smul, Function.comp_apply, algebraMap_smul] obtain ⟨s, hs⟩ := (IsLocalizedModule.eq_zero_iff S f).mp h0 simp_rw [Finset.smul_sum, Submonoid.smul_def, smul_smul] at hs specialize hv t _ hs i hi rw [← (IsLocalization.map_units Rβ‚› a).mul_right_eq_zero, ← Algebra.smul_def, ← hg' i hi] exact (IsLocalization.map_eq_zero_iff S _ _).2 ⟨s, hv⟩
[ " x ∈ span Rβ‚› (⇑f '' v)", " f (m, s).1 ∈ ↑(span R (⇑f '' v))", " (↑R f) (m, s).1 ∈ ↑(map (↑R f) ⊀)", " LinearIndependent Rβ‚› (⇑f ∘ v)", " βˆ€ (s : Finset ΞΉ) (g : ΞΉ β†’ Rβ‚›), βˆ‘ i ∈ s, g i β€’ (⇑f ∘ v) i = 0 β†’ βˆ€ i ∈ s, g i = 0", " g i = 0", " f (βˆ‘ i ∈ t, g' i β€’ v i) = 0", " βˆ‘ x ∈ t, f (g' x β€’ v x) = βˆ‘ x ∈ t, ↑a...
[ " x ∈ span Rβ‚› (⇑f '' v)", " f (m, s).1 ∈ ↑(span R (⇑f '' v))", " (↑R f) (m, s).1 ∈ ↑(map (↑R f) ⊀)", " LinearIndependent Rβ‚› (⇑f ∘ v)" ]
import Mathlib.Algebra.DirectLimit import Mathlib.Algebra.CharP.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.FieldTheory.SplittingField.Construction #align_import field_theory.is_alg_closed.algebraic_closure from "leanprover-community/mathlib"@"df76f43357840485b9d04ed5dee5ab115d420e87" universe u v w noncomputable section open scoped Classical Polynomial open Polynomial variable (k : Type u) [Field k] namespace AlgebraicClosure open MvPolynomial abbrev MonicIrreducible : Type u := { f : k[X] // Monic f ∧ Irreducible f } #align algebraic_closure.monic_irreducible AlgebraicClosure.MonicIrreducible def evalXSelf (f : MonicIrreducible k) : MvPolynomial (MonicIrreducible k) k := Polynomial.evalβ‚‚ MvPolynomial.C (X f) f set_option linter.uppercaseLean3 false in #align algebraic_closure.eval_X_self AlgebraicClosure.evalXSelf def spanEval : Ideal (MvPolynomial (MonicIrreducible k) k) := Ideal.span <| Set.range <| evalXSelf k #align algebraic_closure.span_eval AlgebraicClosure.spanEval def toSplittingField (s : Finset (MonicIrreducible k)) : MvPolynomial (MonicIrreducible k) k →ₐ[k] SplittingField (∏ x ∈ s, x : k[X]) := MvPolynomial.aeval fun f => if hf : f ∈ s then rootOfSplits _ ((splits_prod_iff _ fun (j : MonicIrreducible k) _ => j.2.2.ne_zero).1 (SplittingField.splits _) f hf) (mt isUnit_iff_degree_eq_zero.2 f.2.2.not_unit) else 37 #align algebraic_closure.to_splitting_field AlgebraicClosure.toSplittingField theorem toSplittingField_evalXSelf {s : Finset (MonicIrreducible k)} {f} (hf : f ∈ s) : toSplittingField k s (evalXSelf k f) = 0 := by rw [toSplittingField, evalXSelf, ← AlgHom.coe_toRingHom, hom_evalβ‚‚, AlgHom.coe_toRingHom, MvPolynomial.aeval_X, dif_pos hf, ← MvPolynomial.algebraMap_eq, AlgHom.comp_algebraMap] exact map_rootOfSplits _ _ _ set_option linter.uppercaseLean3 false in #align algebraic_closure.to_splitting_field_eval_X_self AlgebraicClosure.toSplittingField_evalXSelf
Mathlib/FieldTheory/IsAlgClosed/AlgebraicClosure.lean
85
94
theorem spanEval_ne_top : spanEval k β‰  ⊀ := by
rw [Ideal.ne_top_iff_one, spanEval, Ideal.span, ← Set.image_univ, Finsupp.mem_span_image_iff_total] rintro ⟨v, _, hv⟩ replace hv := congr_arg (toSplittingField k v.support) hv rw [AlgHom.map_one, Finsupp.total_apply, Finsupp.sum, AlgHom.map_sum, Finset.sum_eq_zero] at hv Β· exact zero_ne_one hv intro j hj rw [smul_eq_mul, AlgHom.map_mul, toSplittingField_evalXSelf (s := v.support) hj, mul_zero]
[ " (toSplittingField k s) (evalXSelf k f) = 0", " Polynomial.evalβ‚‚ (algebraMap k (∏ x ∈ s, ↑x).SplittingField)\n (rootOfSplits (algebraMap k (∏ x ∈ s, ↑x).SplittingField) β‹― β‹―) ↑f =\n 0", " spanEval k β‰  ⊀", " Β¬βˆƒ l ∈ Finsupp.supported (MvPolynomial (MonicIrreducible k) k) (MvPolynomial (MonicIrreducible ...
[ " (toSplittingField k s) (evalXSelf k f) = 0", " Polynomial.evalβ‚‚ (algebraMap k (∏ x ∈ s, ↑x).SplittingField)\n (rootOfSplits (algebraMap k (∏ x ∈ s, ↑x).SplittingField) β‹― β‹―) ↑f =\n 0", " spanEval k β‰  ⊀" ]
import Mathlib.ModelTheory.FinitelyGenerated import Mathlib.ModelTheory.DirectLimit import Mathlib.ModelTheory.Bundled #align_import model_theory.fraisse from "leanprover-community/mathlib"@"0602c59878ff3d5f71dea69c2d32ccf2e93e5398" universe u v w w' open scoped FirstOrder open Set CategoryTheory namespace FirstOrder namespace Language open Structure Substructure variable (L : Language.{u, v}) def age (M : Type w) [L.Structure M] : Set (Bundled.{w} L.Structure) := {N | Structure.FG L N ∧ Nonempty (N β†ͺ[L] M)} #align first_order.language.age FirstOrder.Language.age variable {L} (K : Set (Bundled.{w} L.Structure)) def Hereditary : Prop := βˆ€ M : Bundled.{w} L.Structure, M ∈ K β†’ L.age M βŠ† K #align first_order.language.hereditary FirstOrder.Language.Hereditary def JointEmbedding : Prop := DirectedOn (fun M N : Bundled.{w} L.Structure => Nonempty (M β†ͺ[L] N)) K #align first_order.language.joint_embedding FirstOrder.Language.JointEmbedding def Amalgamation : Prop := βˆ€ (M N P : Bundled.{w} L.Structure) (MN : M β†ͺ[L] N) (MP : M β†ͺ[L] P), M ∈ K β†’ N ∈ K β†’ P ∈ K β†’ βˆƒ (Q : Bundled.{w} L.Structure) (NQ : N β†ͺ[L] Q) (PQ : P β†ͺ[L] Q), Q ∈ K ∧ NQ.comp MN = PQ.comp MP #align first_order.language.amalgamation FirstOrder.Language.Amalgamation class IsFraisse : Prop where is_nonempty : K.Nonempty FG : βˆ€ M : Bundled.{w} L.Structure, M ∈ K β†’ Structure.FG L M is_equiv_invariant : βˆ€ M N : Bundled.{w} L.Structure, Nonempty (M ≃[L] N) β†’ (M ∈ K ↔ N ∈ K) is_essentially_countable : (Quotient.mk' '' K).Countable hereditary : Hereditary K jointEmbedding : JointEmbedding K amalgamation : Amalgamation K #align first_order.language.is_fraisse FirstOrder.Language.IsFraisse variable {K} (L) (M : Type w) [Structure L M] theorem age.is_equiv_invariant (N P : Bundled.{w} L.Structure) (h : Nonempty (N ≃[L] P)) : N ∈ L.age M ↔ P ∈ L.age M := and_congr h.some.fg_iff ⟨Nonempty.map fun x => Embedding.comp x h.some.symm.toEmbedding, Nonempty.map fun x => Embedding.comp x h.some.toEmbedding⟩ #align first_order.language.age.is_equiv_invariant FirstOrder.Language.age.is_equiv_invariant variable {L} {M} {N : Type w} [Structure L N] theorem Embedding.age_subset_age (MN : M β†ͺ[L] N) : L.age M βŠ† L.age N := fun _ => And.imp_right (Nonempty.map MN.comp) #align first_order.language.embedding.age_subset_age FirstOrder.Language.Embedding.age_subset_age theorem Equiv.age_eq_age (MN : M ≃[L] N) : L.age M = L.age N := le_antisymm MN.toEmbedding.age_subset_age MN.symm.toEmbedding.age_subset_age #align first_order.language.equiv.age_eq_age FirstOrder.Language.Equiv.age_eq_age theorem Structure.FG.mem_age_of_equiv {M N : Bundled L.Structure} (h : Structure.FG L M) (MN : Nonempty (M ≃[L] N)) : N ∈ L.age M := ⟨MN.some.fg_iff.1 h, ⟨MN.some.symm.toEmbedding⟩⟩ set_option linter.uppercaseLean3 false in #align first_order.language.Structure.fg.mem_age_of_equiv FirstOrder.Language.Structure.FG.mem_age_of_equiv theorem Hereditary.is_equiv_invariant_of_fg (h : Hereditary K) (fg : βˆ€ M : Bundled.{w} L.Structure, M ∈ K β†’ Structure.FG L M) (M N : Bundled.{w} L.Structure) (hn : Nonempty (M ≃[L] N)) : M ∈ K ↔ N ∈ K := ⟨fun MK => h M MK ((fg M MK).mem_age_of_equiv hn), fun NK => h N NK ((fg N NK).mem_age_of_equiv ⟨hn.some.symm⟩)⟩ #align first_order.language.hereditary.is_equiv_invariant_of_fg FirstOrder.Language.Hereditary.is_equiv_invariant_of_fg variable (M) theorem age.nonempty : (L.age M).Nonempty := ⟨Bundled.of (Substructure.closure L (βˆ… : Set M)), (fg_iff_structure_fg _).1 (fg_closure Set.finite_empty), ⟨Substructure.subtype _⟩⟩ #align first_order.language.age.nonempty FirstOrder.Language.age.nonempty theorem age.hereditary : Hereditary (L.age M) := fun _ hN _ hP => hN.2.some.age_subset_age hP #align first_order.language.age.hereditary FirstOrder.Language.age.hereditary theorem age.jointEmbedding : JointEmbedding (L.age M) := fun _ hN _ hP => ⟨Bundled.of (β†₯(hN.2.some.toHom.range βŠ” hP.2.some.toHom.range)), ⟨(fg_iff_structure_fg _).1 ((hN.1.range hN.2.some.toHom).sup (hP.1.range hP.2.some.toHom)), ⟨Substructure.subtype _⟩⟩, ⟨Embedding.comp (inclusion le_sup_left) hN.2.some.equivRange.toEmbedding⟩, ⟨Embedding.comp (inclusion le_sup_right) hP.2.some.equivRange.toEmbedding⟩⟩ #align first_order.language.age.joint_embedding FirstOrder.Language.age.jointEmbedding
Mathlib/ModelTheory/Fraisse.lean
169
182
theorem age.countable_quotient [h : Countable M] : (Quotient.mk' '' L.age M).Countable := by
classical refine (congr_arg _ (Set.ext <| Quotient.forall.2 fun N => ?_)).mp (countable_range fun s : Finset M => ⟦⟨closure L (s : Set M), inferInstance⟩⟧) constructor Β· rintro ⟨s, hs⟩ use Bundled.of (closure L (s : Set M)) exact ⟨⟨(fg_iff_structure_fg _).1 (fg_closure s.finite_toSet), ⟨Substructure.subtype _⟩⟩, hs⟩ Β· simp only [mem_range, Quotient.eq] rintro ⟨P, ⟨⟨s, hs⟩, ⟨PM⟩⟩, hP2⟩ have : P β‰ˆ N := by apply Quotient.eq'.mp; rw [hP2]; rfl -- Porting note: added refine ⟨s.image PM, Setoid.trans (b := P) ?_ this⟩ rw [← Embedding.coe_toHom, Finset.coe_image, closure_image PM.toHom, hs, ← Hom.range_eq_map] exact ⟨PM.equivRange.symm⟩
[ " (Quotient.mk' '' L.age M).Countable", " (⟦N⟧ ∈ range fun s => ⟦{ Ξ± := β†₯((closure L).toFun ↑s), str := inferInstance }⟧) ↔ ⟦N⟧ ∈ Quotient.mk' '' L.age M", " (⟦N⟧ ∈ range fun s => ⟦{ Ξ± := β†₯((closure L).toFun ↑s), str := inferInstance }⟧) β†’ ⟦N⟧ ∈ Quotient.mk' '' L.age M", " ⟦N⟧ ∈ Quotient.mk' '' L.age M", " ...
[ " (Quotient.mk' '' L.age M).Countable" ]
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
Mathlib/Analysis/Complex/RemovableSingularity.lean
34
43
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
[ " AnalyticAt β„‚ f c", " ContinuousOn f (closedBall c ↑R)", " ContinuousAt f z" ]
[ " AnalyticAt β„‚ f c" ]
import Mathlib.AlgebraicTopology.DoldKan.Faces import Mathlib.CategoryTheory.Idempotents.Basic #align_import algebraic_topology.dold_kan.projections from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Preadditive CategoryTheory.SimplicialObject Opposite CategoryTheory.Idempotents open Simplicial DoldKan noncomputable section namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] {X : SimplicialObject C} noncomputable def P : β„• β†’ (K[X] ⟢ K[X]) | 0 => πŸ™ _ | q + 1 => P q ≫ (πŸ™ _ + HΟƒ q) set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P AlgebraicTopology.DoldKan.P -- Porting note: `P_zero` and `P_succ` have been added to ease the port, because -- `unfold P` would sometimes unfold to a `match` rather than the induction formula lemma P_zero : (P 0 : K[X] ⟢ K[X]) = πŸ™ _ := rfl lemma P_succ (q : β„•) : (P (q+1) : K[X] ⟢ K[X]) = P q ≫ (πŸ™ _ + HΟƒ q) := rfl @[simp] theorem P_f_0_eq (q : β„•) : ((P q).f 0 : X _[0] ⟢ X _[0]) = πŸ™ _ := by induction' q with q hq Β· rfl Β· simp only [P_succ, HomologicalComplex.add_f_apply, HomologicalComplex.comp_f, HomologicalComplex.id_f, id_comp, hq, HΟƒ_eq_zero, add_zero] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_f_0_eq AlgebraicTopology.DoldKan.P_f_0_eq def Q (q : β„•) : K[X] ⟢ K[X] := πŸ™ _ - P q set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q AlgebraicTopology.DoldKan.Q theorem P_add_Q (q : β„•) : P q + Q q = πŸ™ K[X] := by rw [Q] abel set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_add_Q AlgebraicTopology.DoldKan.P_add_Q theorem P_add_Q_f (q n : β„•) : (P q).f n + (Q q).f n = πŸ™ (X _[n]) := HomologicalComplex.congr_hom (P_add_Q q) n set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_add_Q_f AlgebraicTopology.DoldKan.P_add_Q_f @[simp] theorem Q_zero : (Q 0 : K[X] ⟢ _) = 0 := sub_self _ set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_eq_zero AlgebraicTopology.DoldKan.Q_zero theorem Q_succ (q : β„•) : (Q (q + 1) : K[X] ⟢ _) = Q q - P q ≫ HΟƒ q := by simp only [Q, P_succ, comp_add, comp_id] abel set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_eq AlgebraicTopology.DoldKan.Q_succ @[simp]
Mathlib/AlgebraicTopology/DoldKan/Projections.lean
100
101
theorem Q_f_0_eq (q : β„•) : ((Q q).f 0 : X _[0] ⟢ X _[0]) = 0 := by
simp only [HomologicalComplex.sub_f_apply, HomologicalComplex.id_f, Q, P_f_0_eq, sub_self]
[ " (P q).f 0 = πŸ™ (K[X].X 0)", " (P 0).f 0 = πŸ™ (K[X].X 0)", " (P (q + 1)).f 0 = πŸ™ (K[X].X 0)", " P q + Q q = πŸ™ K[X]", " P q + (πŸ™ K[X] - P q) = πŸ™ K[X]", " Q (q + 1) = Q q - P q ≫ HΟƒ q", " πŸ™ K[X] - (P q + P q ≫ HΟƒ q) = πŸ™ K[X] - P q - P q ≫ HΟƒ q", " (Q q).f 0 = 0" ]
[ " (P q).f 0 = πŸ™ (K[X].X 0)", " (P 0).f 0 = πŸ™ (K[X].X 0)", " (P (q + 1)).f 0 = πŸ™ (K[X].X 0)", " P q + Q q = πŸ™ K[X]", " P q + (πŸ™ K[X] - P q) = πŸ™ K[X]", " Q (q + 1) = Q q - P q ≫ HΟƒ q", " πŸ™ K[X] - (P q + P q ≫ HΟƒ q) = πŸ™ K[X] - P q - P q ≫ HΟƒ q", " (Q q).f 0 = 0" ]
import Mathlib.AlgebraicTopology.DoldKan.FunctorN #align_import algebraic_topology.dold_kan.normalized from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Subobject CategoryTheory.Idempotents DoldKan noncomputable section namespace AlgebraicTopology namespace DoldKan universe v variable {A : Type*} [Category A] [Abelian A] {X : SimplicialObject A} theorem HigherFacesVanish.inclusionOfMooreComplexMap (n : β„•) : HigherFacesVanish (n + 1) ((inclusionOfMooreComplexMap X).f (n + 1)) := fun j _ => by dsimp [AlgebraicTopology.inclusionOfMooreComplexMap, NormalizedMooreComplex.objX] rw [← factorThru_arrow _ _ (finset_inf_arrow_factors Finset.univ _ j (by simp only [Finset.mem_univ])), assoc, kernelSubobject_arrow_comp, comp_zero] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.higher_faces_vanish.inclusion_of_Moore_complex_map AlgebraicTopology.DoldKan.HigherFacesVanish.inclusionOfMooreComplexMap theorem factors_normalizedMooreComplex_PInfty (n : β„•) : Subobject.Factors (NormalizedMooreComplex.objX X n) (PInfty.f n) := by rcases n with _|n Β· apply top_factors Β· rw [PInfty_f, NormalizedMooreComplex.objX, finset_inf_factors] intro i _ apply kernelSubobject_factors exact (HigherFacesVanish.of_P (n + 1) n) i le_add_self set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.factors_normalized_Moore_complex_P_infty AlgebraicTopology.DoldKan.factors_normalizedMooreComplex_PInfty @[simps!] def PInftyToNormalizedMooreComplex (X : SimplicialObject A) : K[X] ⟢ N[X] := ChainComplex.ofHom _ _ _ _ _ _ (fun n => factorThru _ _ (factors_normalizedMooreComplex_PInfty n)) fun n => by rw [← cancel_mono (NormalizedMooreComplex.objX X n).arrow, assoc, assoc, factorThru_arrow, ← inclusionOfMooreComplexMap_f, ← normalizedMooreComplex_objD, ← (inclusionOfMooreComplexMap X).comm (n + 1) n, inclusionOfMooreComplexMap_f, factorThru_arrow_assoc, ← alternatingFaceMapComplex_obj_d] exact PInfty.comm (n + 1) n set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty_to_normalized_Moore_complex AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex @[reassoc (attr := simp)]
Mathlib/AlgebraicTopology/DoldKan/Normalized.lean
77
78
theorem PInftyToNormalizedMooreComplex_comp_inclusionOfMooreComplexMap (X : SimplicialObject A) : PInftyToNormalizedMooreComplex X ≫ inclusionOfMooreComplexMap X = PInfty := by
aesop_cat
[ " (AlgebraicTopology.inclusionOfMooreComplexMap X).f (n + 1) ≫ X.Ξ΄ j.succ = 0", " (Finset.univ.inf fun k => kernelSubobject (X.Ξ΄ k.succ)).arrow ≫ X.Ξ΄ j.succ = 0", " j ∈ Finset.univ", " (NormalizedMooreComplex.objX X n).Factors (PInfty.f n)", " (NormalizedMooreComplex.objX X 0).Factors (PInfty.f 0)", " (No...
[ " (AlgebraicTopology.inclusionOfMooreComplexMap X).f (n + 1) ≫ X.Ξ΄ j.succ = 0", " (Finset.univ.inf fun k => kernelSubobject (X.Ξ΄ k.succ)).arrow ≫ X.Ξ΄ j.succ = 0", " j ∈ Finset.univ", " (NormalizedMooreComplex.objX X n).Factors (PInfty.f n)", " (NormalizedMooreComplex.objX X 0).Factors (PInfty.f 0)", " (No...
import Mathlib.Dynamics.Flow import Mathlib.Tactic.Monotonicity #align_import dynamics.omega_limit from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Set Function Filter Topology section omegaLimit variable {Ο„ : Type*} {Ξ± : Type*} {Ξ² : Type*} {ΞΉ : Type*} def omegaLimit [TopologicalSpace Ξ²] (f : Filter Ο„) (Ο• : Ο„ β†’ Ξ± β†’ Ξ²) (s : Set Ξ±) : Set Ξ² := β‹‚ u ∈ f, closure (image2 Ο• u s) #align omega_limit omegaLimit @[inherit_doc] scoped[omegaLimit] notation "Ο‰" => omegaLimit scoped[omegaLimit] notation "ω⁺" => omegaLimit Filter.atTop scoped[omegaLimit] notation "ω⁻" => omegaLimit Filter.atBot variable [TopologicalSpace Ξ²] variable (f : Filter Ο„) (Ο• : Ο„ β†’ Ξ± β†’ Ξ²) (s s₁ sβ‚‚ : Set Ξ±) open omegaLimit theorem omegaLimit_def : Ο‰ f Ο• s = β‹‚ u ∈ f, closure (image2 Ο• u s) := rfl #align omega_limit_def omegaLimit_def theorem omegaLimit_subset_of_tendsto {m : Ο„ β†’ Ο„} {f₁ fβ‚‚ : Filter Ο„} (hf : Tendsto m f₁ fβ‚‚) : Ο‰ f₁ (fun t x ↦ Ο• (m t) x) s βŠ† Ο‰ fβ‚‚ Ο• s := by refine iInterβ‚‚_mono' fun u hu ↦ ⟨m ⁻¹' u, tendsto_def.mp hf _ hu, ?_⟩ rw [← image2_image_left] exact closure_mono (image2_subset (image_preimage_subset _ _) Subset.rfl) #align omega_limit_subset_of_tendsto omegaLimit_subset_of_tendsto theorem omegaLimit_mono_left {f₁ fβ‚‚ : Filter Ο„} (hf : f₁ ≀ fβ‚‚) : Ο‰ f₁ Ο• s βŠ† Ο‰ fβ‚‚ Ο• s := omegaLimit_subset_of_tendsto Ο• s (tendsto_id'.2 hf) #align omega_limit_mono_left omegaLimit_mono_left theorem omegaLimit_mono_right {s₁ sβ‚‚ : Set Ξ±} (hs : s₁ βŠ† sβ‚‚) : Ο‰ f Ο• s₁ βŠ† Ο‰ f Ο• sβ‚‚ := iInterβ‚‚_mono fun _u _hu ↦ closure_mono (image2_subset Subset.rfl hs) #align omega_limit_mono_right omegaLimit_mono_right theorem isClosed_omegaLimit : IsClosed (Ο‰ f Ο• s) := isClosed_iInter fun _u ↦ isClosed_iInter fun _hu ↦ isClosed_closure #align is_closed_omega_limit isClosed_omegaLimit theorem mapsTo_omegaLimit' {Ξ±' Ξ²' : Type*} [TopologicalSpace Ξ²'] {f : Filter Ο„} {Ο• : Ο„ β†’ Ξ± β†’ Ξ²} {Ο•' : Ο„ β†’ Ξ±' β†’ Ξ²'} {ga : Ξ± β†’ Ξ±'} {s' : Set Ξ±'} (hs : MapsTo ga s s') {gb : Ξ² β†’ Ξ²'} (hg : βˆ€αΆ  t in f, EqOn (gb ∘ Ο• t) (Ο•' t ∘ ga) s) (hgc : Continuous gb) : MapsTo gb (Ο‰ f Ο• s) (Ο‰ f Ο•' s') := by simp only [omegaLimit_def, mem_iInter, MapsTo] intro y hy u hu refine map_mem_closure hgc (hy _ (inter_mem hu hg)) (forall_image2_iff.2 fun t ht x hx ↦ ?_) calc gb (Ο• t x) = Ο•' t (ga x) := ht.2 hx _ ∈ image2 Ο•' u s' := mem_image2_of_mem ht.1 (hs hx) #align maps_to_omega_limit' mapsTo_omegaLimit' theorem mapsTo_omegaLimit {Ξ±' Ξ²' : Type*} [TopologicalSpace Ξ²'] {f : Filter Ο„} {Ο• : Ο„ β†’ Ξ± β†’ Ξ²} {Ο•' : Ο„ β†’ Ξ±' β†’ Ξ²'} {ga : Ξ± β†’ Ξ±'} {s' : Set Ξ±'} (hs : MapsTo ga s s') {gb : Ξ² β†’ Ξ²'} (hg : βˆ€ t x, gb (Ο• t x) = Ο•' t (ga x)) (hgc : Continuous gb) : MapsTo gb (Ο‰ f Ο• s) (Ο‰ f Ο•' s') := mapsTo_omegaLimit' _ hs (eventually_of_forall fun t x _hx ↦ hg t x) hgc #align maps_to_omega_limit mapsTo_omegaLimit theorem omegaLimit_image_eq {Ξ±' : Type*} (Ο• : Ο„ β†’ Ξ±' β†’ Ξ²) (f : Filter Ο„) (g : Ξ± β†’ Ξ±') : Ο‰ f Ο• (g '' s) = Ο‰ f (fun t x ↦ Ο• t (g x)) s := by simp only [omegaLimit, image2_image_right] #align omega_limit_image_eq omegaLimit_image_eq theorem omegaLimit_preimage_subset {Ξ±' : Type*} (Ο• : Ο„ β†’ Ξ±' β†’ Ξ²) (s : Set Ξ±') (f : Filter Ο„) (g : Ξ± β†’ Ξ±') : Ο‰ f (fun t x ↦ Ο• t (g x)) (g ⁻¹' s) βŠ† Ο‰ f Ο• s := mapsTo_omegaLimit _ (mapsTo_preimage _ _) (fun _t _x ↦ rfl) continuous_id #align omega_limit_preimage_subset omegaLimit_preimage_subset theorem mem_omegaLimit_iff_frequently (y : Ξ²) : y ∈ Ο‰ f Ο• s ↔ βˆ€ n ∈ 𝓝 y, βˆƒαΆ  t in f, (s ∩ Ο• t ⁻¹' n).Nonempty := by simp_rw [frequently_iff, omegaLimit_def, mem_iInter, mem_closure_iff_nhds] constructor Β· intro h _ hn _ hu rcases h _ hu _ hn with ⟨_, _, _, ht, _, hx, rfl⟩ exact ⟨_, ht, _, hx, by rwa [mem_preimage]⟩ Β· intro h _ hu _ hn rcases h _ hn hu with ⟨_, ht, _, hx, hΟ•tx⟩ exact ⟨_, hΟ•tx, _, ht, _, hx, rfl⟩ #align mem_omega_limit_iff_frequently mem_omegaLimit_iff_frequently
Mathlib/Dynamics/OmegaLimit.lean
142
144
theorem mem_omegaLimit_iff_frequentlyβ‚‚ (y : Ξ²) : y ∈ Ο‰ f Ο• s ↔ βˆ€ n ∈ 𝓝 y, βˆƒαΆ  t in f, (Ο• t '' s ∩ n).Nonempty := by
simp_rw [mem_omegaLimit_iff_frequently, image_inter_nonempty_iff]
[ " Ο‰ f₁ (fun t x => Ο• (m t) x) s βŠ† Ο‰ fβ‚‚ Ο• s", " closure (image2 (fun t x => Ο• (m t) x) (m ⁻¹' u) s) βŠ† closure (image2 Ο• u s)", " closure (image2 Ο• ((fun t => m t) '' (m ⁻¹' u)) s) βŠ† closure (image2 Ο• u s)", " MapsTo gb (Ο‰ f Ο• s) (Ο‰ f Ο•' s')", " βˆ€ ⦃x : β⦄, (βˆ€ i ∈ f, x ∈ closure (image2 Ο• i s)) β†’ βˆ€ i ∈ f, gb x...
[ " Ο‰ f₁ (fun t x => Ο• (m t) x) s βŠ† Ο‰ fβ‚‚ Ο• s", " closure (image2 (fun t x => Ο• (m t) x) (m ⁻¹' u) s) βŠ† closure (image2 Ο• u s)", " closure (image2 Ο• ((fun t => m t) '' (m ⁻¹' u)) s) βŠ† closure (image2 Ο• u s)", " MapsTo gb (Ο‰ f Ο• s) (Ο‰ f Ο•' s')", " βˆ€ ⦃x : β⦄, (βˆ€ i ∈ f, x ∈ closure (image2 Ο• i s)) β†’ βˆ€ i ∈ f, gb x...
import Mathlib.Algebra.QuadraticDiscriminant import Mathlib.Analysis.Convex.SpecificFunctions.Deriv import Mathlib.Analysis.SpecialFunctions.Pow.Complex #align_import analysis.special_functions.trigonometric.complex from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92" noncomputable section namespace Complex open Set Filter open scoped Real theorem cos_eq_zero_iff {ΞΈ : β„‚} : cos ΞΈ = 0 ↔ βˆƒ k : β„€, ΞΈ = (2 * k + 1) * Ο€ / 2 := by have h : (exp (ΞΈ * I) + exp (-ΞΈ * I)) / 2 = 0 ↔ exp (2 * ΞΈ * I) = -1 := by rw [@div_eq_iff _ _ (exp (ΞΈ * I) + exp (-ΞΈ * I)) 2 0 two_ne_zero, zero_mul, add_eq_zero_iff_eq_neg, neg_eq_neg_one_mul, ← div_eq_iff (exp_ne_zero _), ← exp_sub] ring_nf rw [cos, h, ← exp_pi_mul_I, exp_eq_exp_iff_exists_int, mul_right_comm] refine exists_congr fun x => ?_ refine (iff_of_eq <| congr_arg _ ?_).trans (mul_right_inj' <| mul_ne_zero two_ne_zero I_ne_zero) field_simp; ring #align complex.cos_eq_zero_iff Complex.cos_eq_zero_iff theorem cos_ne_zero_iff {ΞΈ : β„‚} : cos ΞΈ β‰  0 ↔ βˆ€ k : β„€, ΞΈ β‰  (2 * k + 1) * Ο€ / 2 := by rw [← not_exists, not_iff_not, cos_eq_zero_iff] #align complex.cos_ne_zero_iff Complex.cos_ne_zero_iff theorem sin_eq_zero_iff {ΞΈ : β„‚} : sin ΞΈ = 0 ↔ βˆƒ k : β„€, ΞΈ = k * Ο€ := by rw [← Complex.cos_sub_pi_div_two, cos_eq_zero_iff] constructor Β· rintro ⟨k, hk⟩ use k + 1 field_simp [eq_add_of_sub_eq hk] ring Β· rintro ⟨k, rfl⟩ use k - 1 field_simp ring #align complex.sin_eq_zero_iff Complex.sin_eq_zero_iff theorem sin_ne_zero_iff {ΞΈ : β„‚} : sin ΞΈ β‰  0 ↔ βˆ€ k : β„€, ΞΈ β‰  k * Ο€ := by rw [← not_exists, not_iff_not, sin_eq_zero_iff] #align complex.sin_ne_zero_iff Complex.sin_ne_zero_iff theorem tan_eq_zero_iff {ΞΈ : β„‚} : tan ΞΈ = 0 ↔ βˆƒ k : β„€, k * Ο€ / 2 = ΞΈ := by rw [tan, div_eq_zero_iff, ← mul_eq_zero, ← mul_right_inj' two_ne_zero, mul_zero, ← mul_assoc, ← sin_two_mul, sin_eq_zero_iff] field_simp [mul_comm, eq_comm] #align complex.tan_eq_zero_iff Complex.tan_eq_zero_iff theorem tan_ne_zero_iff {ΞΈ : β„‚} : tan ΞΈ β‰  0 ↔ βˆ€ k : β„€, (k * Ο€ / 2 : β„‚) β‰  ΞΈ := by rw [← not_exists, not_iff_not, tan_eq_zero_iff] #align complex.tan_ne_zero_iff Complex.tan_ne_zero_iff theorem tan_int_mul_pi_div_two (n : β„€) : tan (n * Ο€ / 2) = 0 := tan_eq_zero_iff.mpr (by use n) #align complex.tan_int_mul_pi_div_two Complex.tan_int_mul_pi_div_two theorem tan_eq_zero_iff' {ΞΈ : β„‚} (hΞΈ : cos ΞΈ β‰  0) : tan ΞΈ = 0 ↔ βˆƒ k : β„€, k * Ο€ = ΞΈ := by simp only [tan, hΞΈ, div_eq_zero_iff, sin_eq_zero_iff]; simp [eq_comm]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean
90
101
theorem cos_eq_cos_iff {x y : β„‚} : cos x = cos y ↔ βˆƒ k : β„€, y = 2 * k * Ο€ + x ∨ y = 2 * k * Ο€ - x := calc cos x = cos y ↔ cos x - cos y = 0 := sub_eq_zero.symm _ ↔ -2 * sin ((x + y) / 2) * sin ((x - y) / 2) = 0 := by
rw [cos_sub_cos] _ ↔ sin ((x + y) / 2) = 0 ∨ sin ((x - y) / 2) = 0 := by simp [(by norm_num : (2 : β„‚) β‰  0)] _ ↔ sin ((x - y) / 2) = 0 ∨ sin ((x + y) / 2) = 0 := or_comm _ ↔ (βˆƒ k : β„€, y = 2 * k * Ο€ + x) ∨ βˆƒ k : β„€, y = 2 * k * Ο€ - x := by apply or_congr <;> field_simp [sin_eq_zero_iff, (by norm_num : -(2 : β„‚) β‰  0), eq_sub_iff_add_eq', sub_eq_iff_eq_add, mul_comm (2 : β„‚), mul_right_comm _ (2 : β„‚)] constructor <;> Β· rintro ⟨k, rfl⟩; use -k; simp _ ↔ βˆƒ k : β„€, y = 2 * k * Ο€ + x ∨ y = 2 * k * Ο€ - x := exists_or.symm
[ " ΞΈ.cos = 0 ↔ βˆƒ k, ΞΈ = (2 * ↑k + 1) * ↑π / 2", " (cexp (ΞΈ * I) + cexp (-ΞΈ * I)) / 2 = 0 ↔ cexp (2 * ΞΈ * I) = -1", " cexp (ΞΈ * I - -ΞΈ * I) = -1 ↔ cexp (2 * ΞΈ * I) = -1", " (βˆƒ n, 2 * I * ΞΈ = ↑π * I + ↑n * (2 * ↑π * I)) ↔ βˆƒ k, ΞΈ = (2 * ↑k + 1) * ↑π / 2", " 2 * I * ΞΈ = ↑π * I + ↑x * (2 * ↑π * I) ↔ ΞΈ = (2 * ↑x +...
[ " ΞΈ.cos = 0 ↔ βˆƒ k, ΞΈ = (2 * ↑k + 1) * ↑π / 2", " (cexp (ΞΈ * I) + cexp (-ΞΈ * I)) / 2 = 0 ↔ cexp (2 * ΞΈ * I) = -1", " cexp (ΞΈ * I - -ΞΈ * I) = -1 ↔ cexp (2 * ΞΈ * I) = -1", " (βˆƒ n, 2 * I * ΞΈ = ↑π * I + ↑n * (2 * ↑π * I)) ↔ βˆƒ k, ΞΈ = (2 * ↑k + 1) * ↑π / 2", " 2 * I * ΞΈ = ↑π * I + ↑x * (2 * ↑π * I) ↔ ΞΈ = (2 * ↑x +...
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.GeomSum import Mathlib.Data.Fintype.BigOperators import Mathlib.RingTheory.PowerSeries.Inverse import Mathlib.RingTheory.PowerSeries.WellKnown import Mathlib.Tactic.FieldSimp #align_import number_theory.bernoulli from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Nat Finset Finset.Nat PowerSeries variable (A : Type*) [CommRing A] [Algebra β„š A] def bernoulli' : β„• β†’ β„š := WellFounded.fix Nat.lt_wfRel.wf fun n bernoulli' => 1 - βˆ‘ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k k.2 #align bernoulli' bernoulli' theorem bernoulli'_def' (n : β„•) : bernoulli' n = 1 - βˆ‘ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k := WellFounded.fix_eq _ _ _ #align bernoulli'_def' bernoulli'_def' theorem bernoulli'_def (n : β„•) : bernoulli' n = 1 - βˆ‘ k ∈ range n, n.choose k / (n - k + 1) * bernoulli' k := by rw [bernoulli'_def', ← Fin.sum_univ_eq_sum_range] #align bernoulli'_def bernoulli'_def theorem bernoulli'_spec (n : β„•) : (βˆ‘ k ∈ range n.succ, (n.choose (n - k) : β„š) / (n - k + 1) * bernoulli' k) = 1 := by rw [sum_range_succ_comm, bernoulli'_def n, tsub_self, choose_zero_right, sub_self, zero_add, div_one, cast_one, one_mul, sub_add, ← sum_sub_distrib, ← sub_eq_zero, sub_sub_cancel_left, neg_eq_zero] exact Finset.sum_eq_zero (fun x hx => by rw [choose_symm (le_of_lt (mem_range.1 hx)), sub_self]) #align bernoulli'_spec bernoulli'_spec theorem bernoulli'_spec' (n : β„•) : (βˆ‘ k ∈ antidiagonal n, ((k.1 + k.2).choose k.2 : β„š) / (k.2 + 1) * bernoulli' k.1) = 1 := by refine ((sum_antidiagonal_eq_sum_range_succ_mk _ n).trans ?_).trans (bernoulli'_spec n) refine sum_congr rfl fun x hx => ?_ simp only [add_tsub_cancel_of_le, mem_range_succ_iff.mp hx, cast_sub] #align bernoulli'_spec' bernoulli'_spec' @[simp]
Mathlib/NumberTheory/Bernoulli.lean
137
150
theorem sum_bernoulli' (n : β„•) : (βˆ‘ k ∈ range n, (n.choose k : β„š) * bernoulli' k) = n := by
cases' n with n Β· simp suffices ((n + 1 : β„š) * βˆ‘ k ∈ range n, ↑(n.choose k) / (n - k + 1) * bernoulli' k) = βˆ‘ x ∈ range n, ↑(n.succ.choose x) * bernoulli' x by rw_mod_cast [sum_range_succ, bernoulli'_def, ← this, choose_succ_self_right] ring simp_rw [mul_sum, ← mul_assoc] refine sum_congr rfl fun k hk => ?_ congr have : ((n - k : β„•) : β„š) + 1 β‰  0 := by norm_cast field_simp [← cast_sub (mem_range.1 hk).le, mul_comm] rw_mod_cast [tsub_add_eq_add_tsub (mem_range.1 hk).le, choose_mul_succ_eq]
[ " bernoulli' n = 1 - βˆ‘ k ∈ range n, ↑(n.choose k) / (↑n - ↑k + 1) * bernoulli' k", " βˆ‘ k ∈ range n.succ, ↑(n.choose (n - k)) / (↑n - ↑k + 1) * bernoulli' k = 1", " βˆ‘ x ∈ range n, (↑(n.choose x) / (↑n - ↑x + 1) * bernoulli' x - ↑(n.choose (n - x)) / (↑n - ↑x + 1) * bernoulli' x) = 0", " ↑(n.choose x) / (↑n - ↑...
[ " bernoulli' n = 1 - βˆ‘ k ∈ range n, ↑(n.choose k) / (↑n - ↑k + 1) * bernoulli' k", " βˆ‘ k ∈ range n.succ, ↑(n.choose (n - k)) / (↑n - ↑k + 1) * bernoulli' k = 1", " βˆ‘ x ∈ range n, (↑(n.choose x) / (↑n - ↑x + 1) * bernoulli' x - ↑(n.choose (n - x)) / (↑n - ↑x + 1) * bernoulli' x) = 0", " ↑(n.choose x) / (↑n - ↑...
import Mathlib.Algebra.Regular.Basic import Mathlib.LinearAlgebra.Matrix.MvPolynomial import Mathlib.LinearAlgebra.Matrix.Polynomial import Mathlib.RingTheory.Polynomial.Basic #align_import linear_algebra.matrix.adjugate from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a" namespace Matrix universe u v w variable {m : Type u} {n : Type v} {Ξ± : Type w} variable [DecidableEq n] [Fintype n] [DecidableEq m] [Fintype m] [CommRing Ξ±] open Matrix Polynomial Equiv Equiv.Perm Finset section Cramer variable (A : Matrix n n Ξ±) (b : n β†’ Ξ±) def cramerMap (i : n) : Ξ± := (A.updateColumn i b).det #align matrix.cramer_map Matrix.cramerMap theorem cramerMap_is_linear (i : n) : IsLinearMap Ξ± fun b => cramerMap A b i := { map_add := det_updateColumn_add _ _ map_smul := det_updateColumn_smul _ _ } #align matrix.cramer_map_is_linear Matrix.cramerMap_is_linear theorem cramer_is_linear : IsLinearMap Ξ± (cramerMap A) := by constructor <;> intros <;> ext i Β· apply (cramerMap_is_linear A i).1 Β· apply (cramerMap_is_linear A i).2 #align matrix.cramer_is_linear Matrix.cramer_is_linear def cramer (A : Matrix n n Ξ±) : (n β†’ Ξ±) β†’β‚—[Ξ±] (n β†’ Ξ±) := IsLinearMap.mk' (cramerMap A) (cramer_is_linear A) #align matrix.cramer Matrix.cramer theorem cramer_apply (i : n) : cramer A b i = (A.updateColumn i b).det := rfl #align matrix.cramer_apply Matrix.cramer_apply theorem cramer_transpose_apply (i : n) : cramer Aα΅€ b i = (A.updateRow i b).det := by rw [cramer_apply, updateColumn_transpose, det_transpose] #align matrix.cramer_transpose_apply Matrix.cramer_transpose_apply theorem cramer_transpose_row_self (i : n) : Aα΅€.cramer (A i) = Pi.single i A.det := by ext j rw [cramer_apply, Pi.single_apply] split_ifs with h Β· -- i = j: this entry should be `A.det` subst h simp only [updateColumn_transpose, det_transpose, updateRow_eq_self] Β· -- i β‰  j: this entry should be 0 rw [updateColumn_transpose, det_transpose] apply det_zero_of_row_eq h rw [updateRow_self, updateRow_ne (Ne.symm h)] #align matrix.cramer_transpose_row_self Matrix.cramer_transpose_row_self
Mathlib/LinearAlgebra/Matrix/Adjugate.lean
119
122
theorem cramer_row_self (i : n) (h : βˆ€ j, b j = A j i) : A.cramer b = Pi.single i A.det := by
rw [← transpose_transpose A, det_transpose] convert cramer_transpose_row_self Aα΅€ i exact funext h
[ " IsLinearMap Ξ± A.cramerMap", " βˆ€ (x y : n β†’ Ξ±), A.cramerMap (x + y) = A.cramerMap x + A.cramerMap y", " βˆ€ (c : Ξ±) (x : n β†’ Ξ±), A.cramerMap (c β€’ x) = c β€’ A.cramerMap x", " A.cramerMap (x✝ + y✝) = A.cramerMap x✝ + A.cramerMap y✝", " A.cramerMap (c✝ β€’ x✝) = c✝ β€’ A.cramerMap x✝", " A.cramerMap (x✝ + y✝) i = ...
[ " IsLinearMap Ξ± A.cramerMap", " βˆ€ (x y : n β†’ Ξ±), A.cramerMap (x + y) = A.cramerMap x + A.cramerMap y", " βˆ€ (c : Ξ±) (x : n β†’ Ξ±), A.cramerMap (c β€’ x) = c β€’ A.cramerMap x", " A.cramerMap (x✝ + y✝) = A.cramerMap x✝ + A.cramerMap y✝", " A.cramerMap (c✝ β€’ x✝) = c✝ β€’ A.cramerMap x✝", " A.cramerMap (x✝ + y✝) i = ...
import Mathlib.Order.Interval.Set.Basic import Mathlib.Order.Hom.Set #align_import data.set.intervals.order_iso from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105" open Set namespace OrderIso section Preorder variable {Ξ± Ξ² : Type*} [Preorder Ξ±] [Preorder Ξ²] @[simp] theorem preimage_Iic (e : Ξ± ≃o Ξ²) (b : Ξ²) : e ⁻¹' Iic b = Iic (e.symm b) := by ext x simp [← e.le_iff_le] #align order_iso.preimage_Iic OrderIso.preimage_Iic @[simp]
Mathlib/Order/Interval/Set/OrderIso.lean
30
32
theorem preimage_Ici (e : Ξ± ≃o Ξ²) (b : Ξ²) : e ⁻¹' Ici b = Ici (e.symm b) := by
ext x simp [← e.le_iff_le]
[ " ⇑e ⁻¹' Iic b = Iic (e.symm b)", " x ∈ ⇑e ⁻¹' Iic b ↔ x ∈ Iic (e.symm b)", " ⇑e ⁻¹' Ici b = Ici (e.symm b)", " x ∈ ⇑e ⁻¹' Ici b ↔ x ∈ Ici (e.symm b)" ]
[ " ⇑e ⁻¹' Iic b = Iic (e.symm b)", " x ∈ ⇑e ⁻¹' Iic b ↔ x ∈ Iic (e.symm b)", " ⇑e ⁻¹' Ici b = Ici (e.symm b)" ]
import Mathlib.Topology.Order.IsLUB open Set Filter TopologicalSpace Topology Function open OrderDual (toDual ofDual) variable {Ξ± Ξ² Ξ³ : Type*} section DenselyOrdered variable [TopologicalSpace Ξ±] [LinearOrder Ξ±] [OrderTopology Ξ±] [DenselyOrdered Ξ±] {a b : Ξ±} {s : Set Ξ±} theorem closure_Ioi' {a : Ξ±} (h : (Ioi a).Nonempty) : closure (Ioi a) = Ici a := by apply Subset.antisymm Β· exact closure_minimal Ioi_subset_Ici_self isClosed_Ici Β· rw [← diff_subset_closure_iff, Ici_diff_Ioi_same, singleton_subset_iff] exact isGLB_Ioi.mem_closure h #align closure_Ioi' closure_Ioi' @[simp] theorem closure_Ioi (a : Ξ±) [NoMaxOrder Ξ±] : closure (Ioi a) = Ici a := closure_Ioi' nonempty_Ioi #align closure_Ioi closure_Ioi theorem closure_Iio' (h : (Iio a).Nonempty) : closure (Iio a) = Iic a := closure_Ioi' (Ξ± := Ξ±α΅’α΅ˆ) h #align closure_Iio' closure_Iio' @[simp] theorem closure_Iio (a : Ξ±) [NoMinOrder Ξ±] : closure (Iio a) = Iic a := closure_Iio' nonempty_Iio #align closure_Iio closure_Iio @[simp] theorem closure_Ioo {a b : Ξ±} (hab : a β‰  b) : closure (Ioo a b) = Icc a b := by apply Subset.antisymm Β· exact closure_minimal Ioo_subset_Icc_self isClosed_Icc Β· cases' hab.lt_or_lt with hab hab Β· rw [← diff_subset_closure_iff, Icc_diff_Ioo_same hab.le] have hab' : (Ioo a b).Nonempty := nonempty_Ioo.2 hab simp only [insert_subset_iff, singleton_subset_iff] exact ⟨(isGLB_Ioo hab).mem_closure hab', (isLUB_Ioo hab).mem_closure hab'⟩ Β· rw [Icc_eq_empty_of_lt hab] exact empty_subset _ #align closure_Ioo closure_Ioo @[simp] theorem closure_Ioc {a b : Ξ±} (hab : a β‰  b) : closure (Ioc a b) = Icc a b := by apply Subset.antisymm Β· exact closure_minimal Ioc_subset_Icc_self isClosed_Icc Β· apply Subset.trans _ (closure_mono Ioo_subset_Ioc_self) rw [closure_Ioo hab] #align closure_Ioc closure_Ioc @[simp] theorem closure_Ico {a b : Ξ±} (hab : a β‰  b) : closure (Ico a b) = Icc a b := by apply Subset.antisymm Β· exact closure_minimal Ico_subset_Icc_self isClosed_Icc Β· apply Subset.trans _ (closure_mono Ioo_subset_Ico_self) rw [closure_Ioo hab] #align closure_Ico closure_Ico @[simp] theorem interior_Ici' {a : Ξ±} (ha : (Iio a).Nonempty) : interior (Ici a) = Ioi a := by rw [← compl_Iio, interior_compl, closure_Iio' ha, compl_Iic] #align interior_Ici' interior_Ici' theorem interior_Ici [NoMinOrder Ξ±] {a : Ξ±} : interior (Ici a) = Ioi a := interior_Ici' nonempty_Iio #align interior_Ici interior_Ici @[simp] theorem interior_Iic' {a : Ξ±} (ha : (Ioi a).Nonempty) : interior (Iic a) = Iio a := interior_Ici' (Ξ± := Ξ±α΅’α΅ˆ) ha #align interior_Iic' interior_Iic' theorem interior_Iic [NoMaxOrder Ξ±] {a : Ξ±} : interior (Iic a) = Iio a := interior_Iic' nonempty_Ioi #align interior_Iic interior_Iic @[simp] theorem interior_Icc [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b : Ξ±} : interior (Icc a b) = Ioo a b := by rw [← Ici_inter_Iic, interior_inter, interior_Ici, interior_Iic, Ioi_inter_Iio] #align interior_Icc interior_Icc @[simp] theorem Icc_mem_nhds_iff [NoMinOrder Ξ±] [NoMaxOrder Ξ±] {a b x : Ξ±} : Icc a b ∈ 𝓝 x ↔ x ∈ Ioo a b := by rw [← interior_Icc, mem_interior_iff_mem_nhds] @[simp]
Mathlib/Topology/Order/DenselyOrdered.lean
111
112
theorem interior_Ico [NoMinOrder Ξ±] {a b : Ξ±} : interior (Ico a b) = Ioo a b := by
rw [← Ici_inter_Iio, interior_inter, interior_Ici, interior_Iio, Ioi_inter_Iio]
[ " closure (Ioi a) = Ici a", " closure (Ioi a) βŠ† Ici a", " Ici a βŠ† closure (Ioi a)", " a ∈ closure (Ioi a)", " closure (Ioo a b) = Icc a b", " closure (Ioo a b) βŠ† Icc a b", " Icc a b βŠ† closure (Ioo a b)", " {a, b} βŠ† closure (Ioo a b)", " a ∈ closure (Ioo a b) ∧ b ∈ closure (Ioo a b)", " βˆ… βŠ† closure...
[ " closure (Ioi a) = Ici a", " closure (Ioi a) βŠ† Ici a", " Ici a βŠ† closure (Ioi a)", " a ∈ closure (Ioi a)", " closure (Ioo a b) = Icc a b", " closure (Ioo a b) βŠ† Icc a b", " Icc a b βŠ† closure (Ioo a b)", " {a, b} βŠ† closure (Ioo a b)", " a ∈ closure (Ioo a b) ∧ b ∈ closure (Ioo a b)", " βˆ… βŠ† closure...
import Mathlib.Order.Interval.Set.ProjIcc import Mathlib.Topology.Algebra.Order.Field import Mathlib.Topology.Bornology.Hom import Mathlib.Topology.EMetricSpace.Lipschitz import Mathlib.Topology.MetricSpace.Basic import Mathlib.Topology.MetricSpace.Bounded #align_import topology.metric_space.lipschitz from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328" universe u v w x open Filter Function Set Topology NNReal ENNReal Bornology variable {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {ΞΉ : Type x}
Mathlib/Topology/MetricSpace/Lipschitz.lean
41
44
theorem lipschitzWith_iff_dist_le_mul [PseudoMetricSpace Ξ±] [PseudoMetricSpace Ξ²] {K : ℝβ‰₯0} {f : Ξ± β†’ Ξ²} : LipschitzWith K f ↔ βˆ€ x y, dist (f x) (f y) ≀ K * dist x y := by
simp only [LipschitzWith, edist_nndist, dist_nndist] norm_cast
[ " LipschitzWith K f ↔ βˆ€ (x y : Ξ±), dist (f x) (f y) ≀ ↑K * dist x y", " (βˆ€ (x y : Ξ±), ↑(nndist (f x) (f y)) ≀ ↑K * ↑(nndist x y)) ↔ βˆ€ (x y : Ξ±), ↑(nndist (f x) (f y)) ≀ ↑K * ↑(nndist x y)" ]
[ " LipschitzWith K f ↔ βˆ€ (x y : Ξ±), dist (f x) (f y) ≀ ↑K * dist x y" ]
import Mathlib.Algebra.Star.Order import Mathlib.Topology.Instances.NNReal import Mathlib.Topology.Order.MonotoneContinuity #align_import data.real.sqrt from "leanprover-community/mathlib"@"31c24aa72e7b3e5ed97a8412470e904f82b81004" open Set Filter open scoped Filter NNReal Topology namespace NNReal variable {x y : ℝβ‰₯0} -- Porting note: was @[pp_nodot] noncomputable def sqrt : ℝβ‰₯0 ≃o ℝβ‰₯0 := OrderIso.symm <| powOrderIso 2 two_ne_zero #align nnreal.sqrt NNReal.sqrt @[simp] lemma sq_sqrt (x : ℝβ‰₯0) : sqrt x ^ 2 = x := sqrt.symm_apply_apply _ #align nnreal.sq_sqrt NNReal.sq_sqrt @[simp] lemma sqrt_sq (x : ℝβ‰₯0) : sqrt (x ^ 2) = x := sqrt.apply_symm_apply _ #align nnreal.sqrt_sq NNReal.sqrt_sq @[simp] lemma mul_self_sqrt (x : ℝβ‰₯0) : sqrt x * sqrt x = x := by rw [← sq, sq_sqrt] #align nnreal.mul_self_sqrt NNReal.mul_self_sqrt @[simp] lemma sqrt_mul_self (x : ℝβ‰₯0) : sqrt (x * x) = x := by rw [← sq, sqrt_sq] #align nnreal.sqrt_mul_self NNReal.sqrt_mul_self lemma sqrt_le_sqrt : sqrt x ≀ sqrt y ↔ x ≀ y := sqrt.le_iff_le #align nnreal.sqrt_le_sqrt_iff NNReal.sqrt_le_sqrt lemma sqrt_lt_sqrt : sqrt x < sqrt y ↔ x < y := sqrt.lt_iff_lt #align nnreal.sqrt_lt_sqrt_iff NNReal.sqrt_lt_sqrt lemma sqrt_eq_iff_eq_sq : sqrt x = y ↔ x = y ^ 2 := sqrt.toEquiv.apply_eq_iff_eq_symm_apply #align nnreal.sqrt_eq_iff_sq_eq NNReal.sqrt_eq_iff_eq_sq lemma sqrt_le_iff_le_sq : sqrt x ≀ y ↔ x ≀ y ^ 2 := sqrt.to_galoisConnection _ _ #align nnreal.sqrt_le_iff NNReal.sqrt_le_iff_le_sq lemma le_sqrt_iff_sq_le : x ≀ sqrt y ↔ x ^ 2 ≀ y := (sqrt.symm.to_galoisConnection _ _).symm #align nnreal.le_sqrt_iff NNReal.le_sqrt_iff_sq_le -- 2024-02-14 @[deprecated] alias sqrt_le_sqrt_iff := sqrt_le_sqrt @[deprecated] alias sqrt_lt_sqrt_iff := sqrt_lt_sqrt @[deprecated] alias sqrt_le_iff := sqrt_le_iff_le_sq @[deprecated] alias le_sqrt_iff := le_sqrt_iff_sq_le @[deprecated] alias sqrt_eq_iff_sq_eq := sqrt_eq_iff_eq_sq @[simp] lemma sqrt_eq_zero : sqrt x = 0 ↔ x = 0 := by simp [sqrt_eq_iff_eq_sq] #align nnreal.sqrt_eq_zero NNReal.sqrt_eq_zero @[simp] lemma sqrt_eq_one : sqrt x = 1 ↔ x = 1 := by simp [sqrt_eq_iff_eq_sq] @[simp] lemma sqrt_zero : sqrt 0 = 0 := by simp #align nnreal.sqrt_zero NNReal.sqrt_zero @[simp] lemma sqrt_one : sqrt 1 = 1 := by simp #align nnreal.sqrt_one NNReal.sqrt_one @[simp] lemma sqrt_le_one : sqrt x ≀ 1 ↔ x ≀ 1 := by rw [← sqrt_one, sqrt_le_sqrt, sqrt_one] @[simp] lemma one_le_sqrt : 1 ≀ sqrt x ↔ 1 ≀ x := by rw [← sqrt_one, sqrt_le_sqrt, sqrt_one]
Mathlib/Data/Real/Sqrt.lean
97
98
theorem sqrt_mul (x y : ℝβ‰₯0) : sqrt (x * y) = sqrt x * sqrt y := by
rw [sqrt_eq_iff_eq_sq, mul_pow, sq_sqrt, sq_sqrt]
[ " sqrt x * sqrt x = x", " sqrt (x * x) = x", " sqrt x = 0 ↔ x = 0", " sqrt x = 1 ↔ x = 1", " sqrt 0 = 0", " sqrt 1 = 1", " sqrt x ≀ 1 ↔ x ≀ 1", " 1 ≀ sqrt x ↔ 1 ≀ x", " sqrt (x * y) = sqrt x * sqrt y" ]
[ " sqrt x * sqrt x = x", " sqrt (x * x) = x", " sqrt x = 0 ↔ x = 0", " sqrt x = 1 ↔ x = 1", " sqrt 0 = 0", " sqrt 1 = 1", " sqrt x ≀ 1 ↔ x ≀ 1", " 1 ≀ sqrt x ↔ 1 ≀ x", " sqrt (x * y) = sqrt x * sqrt y" ]
import Mathlib.Order.Interval.Set.UnorderedInterval import Mathlib.Algebra.Order.Interval.Set.Monoid import Mathlib.Data.Set.Pointwise.Basic import Mathlib.Algebra.Order.Field.Basic import Mathlib.Algebra.Order.Group.MinMax #align_import data.set.pointwise.interval from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" open Interval Pointwise variable {Ξ± : Type*} namespace Set section OrderedAddCommGroup variable [OrderedAddCommGroup Ξ±] (a b c : Ξ±) @[simp] theorem preimage_const_add_Ici : (fun x => a + x) ⁻¹' Ici b = Ici (b - a) := ext fun _x => sub_le_iff_le_add'.symm #align set.preimage_const_add_Ici Set.preimage_const_add_Ici @[simp] theorem preimage_const_add_Ioi : (fun x => a + x) ⁻¹' Ioi b = Ioi (b - a) := ext fun _x => sub_lt_iff_lt_add'.symm #align set.preimage_const_add_Ioi Set.preimage_const_add_Ioi @[simp] theorem preimage_const_add_Iic : (fun x => a + x) ⁻¹' Iic b = Iic (b - a) := ext fun _x => le_sub_iff_add_le'.symm #align set.preimage_const_add_Iic Set.preimage_const_add_Iic @[simp] theorem preimage_const_add_Iio : (fun x => a + x) ⁻¹' Iio b = Iio (b - a) := ext fun _x => lt_sub_iff_add_lt'.symm #align set.preimage_const_add_Iio Set.preimage_const_add_Iio @[simp] theorem preimage_const_add_Icc : (fun x => a + x) ⁻¹' Icc b c = Icc (b - a) (c - a) := by simp [← Ici_inter_Iic] #align set.preimage_const_add_Icc Set.preimage_const_add_Icc @[simp] theorem preimage_const_add_Ico : (fun x => a + x) ⁻¹' Ico b c = Ico (b - a) (c - a) := by simp [← Ici_inter_Iio] #align set.preimage_const_add_Ico Set.preimage_const_add_Ico @[simp] theorem preimage_const_add_Ioc : (fun x => a + x) ⁻¹' Ioc b c = Ioc (b - a) (c - a) := by simp [← Ioi_inter_Iic] #align set.preimage_const_add_Ioc Set.preimage_const_add_Ioc @[simp] theorem preimage_const_add_Ioo : (fun x => a + x) ⁻¹' Ioo b c = Ioo (b - a) (c - a) := by simp [← Ioi_inter_Iio] #align set.preimage_const_add_Ioo Set.preimage_const_add_Ioo @[simp] theorem preimage_add_const_Ici : (fun x => x + a) ⁻¹' Ici b = Ici (b - a) := ext fun _x => sub_le_iff_le_add.symm #align set.preimage_add_const_Ici Set.preimage_add_const_Ici @[simp] theorem preimage_add_const_Ioi : (fun x => x + a) ⁻¹' Ioi b = Ioi (b - a) := ext fun _x => sub_lt_iff_lt_add.symm #align set.preimage_add_const_Ioi Set.preimage_add_const_Ioi @[simp] theorem preimage_add_const_Iic : (fun x => x + a) ⁻¹' Iic b = Iic (b - a) := ext fun _x => le_sub_iff_add_le.symm #align set.preimage_add_const_Iic Set.preimage_add_const_Iic @[simp] theorem preimage_add_const_Iio : (fun x => x + a) ⁻¹' Iio b = Iio (b - a) := ext fun _x => lt_sub_iff_add_lt.symm #align set.preimage_add_const_Iio Set.preimage_add_const_Iio @[simp] theorem preimage_add_const_Icc : (fun x => x + a) ⁻¹' Icc b c = Icc (b - a) (c - a) := by simp [← Ici_inter_Iic] #align set.preimage_add_const_Icc Set.preimage_add_const_Icc @[simp] theorem preimage_add_const_Ico : (fun x => x + a) ⁻¹' Ico b c = Ico (b - a) (c - a) := by simp [← Ici_inter_Iio] #align set.preimage_add_const_Ico Set.preimage_add_const_Ico @[simp] theorem preimage_add_const_Ioc : (fun x => x + a) ⁻¹' Ioc b c = Ioc (b - a) (c - a) := by simp [← Ioi_inter_Iic] #align set.preimage_add_const_Ioc Set.preimage_add_const_Ioc @[simp]
Mathlib/Data/Set/Pointwise/Interval.lean
207
208
theorem preimage_add_const_Ioo : (fun x => x + a) ⁻¹' Ioo b c = Ioo (b - a) (c - a) := by
simp [← Ioi_inter_Iio]
[ " (fun x => a + x) ⁻¹' Icc b c = Icc (b - a) (c - a)", " (fun x => a + x) ⁻¹' Ico b c = Ico (b - a) (c - a)", " (fun x => a + x) ⁻¹' Ioc b c = Ioc (b - a) (c - a)", " (fun x => a + x) ⁻¹' Ioo b c = Ioo (b - a) (c - a)", " (fun x => x + a) ⁻¹' Icc b c = Icc (b - a) (c - a)", " (fun x => x + a) ⁻¹' Ico b c ...
[ " (fun x => a + x) ⁻¹' Icc b c = Icc (b - a) (c - a)", " (fun x => a + x) ⁻¹' Ico b c = Ico (b - a) (c - a)", " (fun x => a + x) ⁻¹' Ioc b c = Ioc (b - a) (c - a)", " (fun x => a + x) ⁻¹' Ioo b c = Ioo (b - a) (c - a)", " (fun x => x + a) ⁻¹' Icc b c = Icc (b - a) (c - a)", " (fun x => x + a) ⁻¹' Ico b c ...
import Mathlib.Algebra.BigOperators.Associated import Mathlib.Data.ZMod.Basic import Mathlib.Data.Nat.PrimeFin import Mathlib.RingTheory.Coprime.Lemmas namespace ZMod variable {n m : β„•} def unitsMap (hm : n ∣ m) : (ZMod m)Λ£ β†’* (ZMod n)Λ£ := Units.map (castHom hm (ZMod n)) lemma unitsMap_def (hm : n ∣ m) : unitsMap hm = Units.map (castHom hm (ZMod n)) := rfl lemma unitsMap_comp {d : β„•} (hm : n ∣ m) (hd : m ∣ d) : (unitsMap hm).comp (unitsMap hd) = unitsMap (dvd_trans hm hd) := by simp only [unitsMap_def] rw [← Units.map_comp] exact congr_arg Units.map <| congr_arg RingHom.toMonoidHom <| castHom_comp hm hd @[simp] lemma unitsMap_self (n : β„•) : unitsMap (dvd_refl n) = MonoidHom.id _ := by simp [unitsMap, castHom_self] lemma IsUnit_cast_of_dvd (hm : n ∣ m) (a : Units (ZMod m)) : IsUnit (cast (a : ZMod m) : ZMod n) := Units.isUnit (unitsMap hm a)
Mathlib/Data/ZMod/Units.lean
38
63
theorem unitsMap_surjective [hm : NeZero m] (h : n ∣ m) : Function.Surjective (unitsMap h) := by
suffices βˆ€ x : β„•, x.Coprime n β†’ βˆƒ k : β„•, (x + k * n).Coprime m by intro x have ⟨k, hk⟩ := this x.val.val (val_coe_unit_coprime x) refine ⟨unitOfCoprime _ hk, Units.ext ?_⟩ have : NeZero n := ⟨fun hn ↦ hm.out (eq_zero_of_zero_dvd (hn β–Έ h))⟩ simp [unitsMap_def] intro x hx let ps := m.primeFactors.filter (fun p ↦ Β¬p ∣ x) use ps.prod id apply Nat.coprime_of_dvd intro p pp hp hpn by_cases hpx : p ∣ x Β· have h := Nat.dvd_sub' hp hpx rw [add_comm, Nat.add_sub_cancel] at h rcases pp.dvd_mul.mp h with h | h Β· have ⟨q, hq, hq'⟩ := (pp.prime.dvd_finset_prod_iff id).mp h rw [Finset.mem_filter, Nat.mem_primeFactors, ← (Nat.prime_dvd_prime_iff_eq pp hq.1.1).mp hq'] at hq exact hq.2 hpx Β· exact Nat.Prime.not_coprime_iff_dvd.mpr ⟨p, pp, hpx, h⟩ hx Β· have pps : p ∈ ps := Finset.mem_filter.mpr ⟨Nat.mem_primeFactors.mpr ⟨pp, hpn, hm.out⟩, hpx⟩ have h := Nat.dvd_sub' hp ((Finset.dvd_prod_of_mem id pps).mul_right n) rw [Nat.add_sub_cancel] at h contradiction
[ " (unitsMap hm).comp (unitsMap hd) = unitsMap β‹―", " (Units.map ↑(castHom hm (ZMod n))).comp (Units.map ↑(castHom hd (ZMod m))) = Units.map ↑(castHom β‹― (ZMod n))", " Units.map ((↑(castHom hm (ZMod n))).comp ↑(castHom hd (ZMod m))) = Units.map ↑(castHom β‹― (ZMod n))", " unitsMap β‹― = MonoidHom.id (ZMod n)Λ£", " ...
[ " (unitsMap hm).comp (unitsMap hd) = unitsMap β‹―", " (Units.map ↑(castHom hm (ZMod n))).comp (Units.map ↑(castHom hd (ZMod m))) = Units.map ↑(castHom β‹― (ZMod n))", " Units.map ((↑(castHom hm (ZMod n))).comp ↑(castHom hd (ZMod m))) = Units.map ↑(castHom β‹― (ZMod n))", " unitsMap β‹― = MonoidHom.id (ZMod n)Λ£", " ...
import Mathlib.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adjunction.Evaluation import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.CategoryTheory.Adhesive import Mathlib.CategoryTheory.Sites.ConcreteSheafification #align_import category_theory.sites.subsheaf from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u open Opposite CategoryTheory namespace CategoryTheory.GrothendieckTopology variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) @[ext] structure Subpresheaf (F : Cα΅’α΅– β₯€ Type w) where obj : βˆ€ U, Set (F.obj U) map : βˆ€ {U V : Cα΅’α΅–} (i : U ⟢ V), obj U βŠ† F.map i ⁻¹' obj V #align category_theory.grothendieck_topology.subpresheaf CategoryTheory.GrothendieckTopology.Subpresheaf variable {F F' F'' : Cα΅’α΅– β₯€ Type w} (G G' : Subpresheaf F) instance : PartialOrder (Subpresheaf F) := PartialOrder.lift Subpresheaf.obj Subpresheaf.ext instance : Top (Subpresheaf F) := ⟨⟨fun U => ⊀, @fun U V _ x _ => by aesop_cat⟩⟩ instance : Nonempty (Subpresheaf F) := inferInstance @[simps!] def Subpresheaf.toPresheaf : Cα΅’α΅– β₯€ Type w where obj U := G.obj U map := @fun U V i x => ⟨F.map i x, G.map i x.prop⟩ map_id X := by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_id_apply] map_comp := @fun X Y Z i j => by ext ⟨x, _⟩ dsimp simp only [FunctorToTypes.map_comp_apply] #align category_theory.grothendieck_topology.subpresheaf.to_presheaf CategoryTheory.GrothendieckTopology.Subpresheaf.toPresheaf instance {U} : CoeHead (G.toPresheaf.obj U) (F.obj U) where coe := Subtype.val @[simps] def Subpresheaf.ΞΉ : G.toPresheaf ⟢ F where app U x := x #align category_theory.grothendieck_topology.subpresheaf.ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.ΞΉ instance : Mono G.ΞΉ := ⟨@fun _ f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| congr_fun (congr_app e U) x⟩ @[simps] def Subpresheaf.homOfLe {G G' : Subpresheaf F} (h : G ≀ G') : G.toPresheaf ⟢ G'.toPresheaf where app U x := ⟨x, h U x.prop⟩ #align category_theory.grothendieck_topology.subpresheaf.hom_of_le CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe instance {G G' : Subpresheaf F} (h : G ≀ G') : Mono (Subpresheaf.homOfLe h) := ⟨fun f₁ fβ‚‚ e => NatTrans.ext f₁ fβ‚‚ <| funext fun U => funext fun x => Subtype.ext <| (congr_arg Subtype.val <| (congr_fun (congr_app e U) x : _) : _)⟩ @[reassoc (attr := simp)] theorem Subpresheaf.homOfLe_ΞΉ {G G' : Subpresheaf F} (h : G ≀ G') : Subpresheaf.homOfLe h ≫ G'.ΞΉ = G.ΞΉ := by ext rfl #align category_theory.grothendieck_topology.subpresheaf.hom_of_le_ΞΉ CategoryTheory.GrothendieckTopology.Subpresheaf.homOfLe_ΞΉ instance : IsIso (Subpresheaf.ΞΉ (⊀ : Subpresheaf F)) := by refine @NatIso.isIso_of_isIso_app _ _ _ _ _ _ _ ?_ intro X rw [isIso_iff_bijective] exact ⟨Subtype.coe_injective, fun x => ⟨⟨x, _root_.trivial⟩, rfl⟩⟩
Mathlib/CategoryTheory/Sites/Subsheaf.lean
122
130
theorem Subpresheaf.eq_top_iff_isIso : G = ⊀ ↔ IsIso G.ΞΉ := by
constructor Β· rintro rfl infer_instance Β· intro H ext U x apply iff_true_iff.mpr rw [← IsIso.inv_hom_id_apply (G.ΞΉ.app U) x] exact ((inv (G.ΞΉ.app U)) x).2
[ " x ∈ F.map x✝¹ ⁻¹' (fun U => ⊀) V", " { obj := fun U => ↑(G.obj U), map := fun U V i x => ⟨F.map i ↑x, β‹―βŸ© }.map (πŸ™ X) =\n πŸ™ ({ obj := fun U => ↑(G.obj U), map := fun U V i x => ⟨F.map i ↑x, β‹―βŸ© }.obj X)", " ↑({ obj := fun U => ↑(G.obj U), map := fun U V i x => ⟨F.map i ↑x, β‹―βŸ© }.map (πŸ™ X) ⟨x, property✝⟩) =...
[ " x ∈ F.map x✝¹ ⁻¹' (fun U => ⊀) V", " { obj := fun U => ↑(G.obj U), map := fun U V i x => ⟨F.map i ↑x, β‹―βŸ© }.map (πŸ™ X) =\n πŸ™ ({ obj := fun U => ↑(G.obj U), map := fun U V i x => ⟨F.map i ↑x, β‹―βŸ© }.obj X)", " ↑({ obj := fun U => ↑(G.obj U), map := fun U V i x => ⟨F.map i ↑x, β‹―βŸ© }.map (πŸ™ X) ⟨x, property✝⟩) =...
import Mathlib.SetTheory.Cardinal.Finite #align_import data.set.ncard from "leanprover-community/mathlib"@"74c2af38a828107941029b03839882c5c6f87a04" namespace Set variable {Ξ± Ξ² : Type*} {s t : Set Ξ±} noncomputable def encard (s : Set Ξ±) : β„•βˆž := PartENat.withTopEquiv (PartENat.card s) @[simp] theorem encard_univ_coe (s : Set Ξ±) : encard (univ : Set s) = encard s := by rw [encard, encard, PartENat.card_congr (Equiv.Set.univ ↑s)] theorem encard_univ (Ξ± : Type*) : encard (univ : Set Ξ±) = PartENat.withTopEquiv (PartENat.card Ξ±) := by rw [encard, PartENat.card_congr (Equiv.Set.univ Ξ±)] theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by have := h.fintype rw [encard, PartENat.card_eq_coe_fintype_card, PartENat.withTopEquiv_natCast, toFinite_toFinset, toFinset_card]
Mathlib/Data/Set/Card.lean
78
80
theorem encard_eq_coe_toFinset_card (s : Set Ξ±) [Fintype s] : encard s = s.toFinset.card := by
have h := toFinite s rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset]
[ " univ.encard = s.encard", " univ.encard = PartENat.withTopEquiv (PartENat.card Ξ±)", " s.encard = ↑h.toFinset.card", " s.encard = ↑s.toFinset.card" ]
[ " univ.encard = s.encard", " univ.encard = PartENat.withTopEquiv (PartENat.card Ξ±)", " s.encard = ↑h.toFinset.card", " s.encard = ↑s.toFinset.card" ]
import Mathlib.Dynamics.PeriodicPts import Mathlib.GroupTheory.Exponent import Mathlib.GroupTheory.GroupAction.Basic namespace MulAction universe u v variable {Ξ± : Type v} variable {G : Type u} [Group G] [MulAction G Ξ±] variable {M : Type u} [Monoid M] [MulAction M Ξ±] @[to_additive "If the action is periodic, then a lower bound for its period can be computed."] theorem le_period {m : M} {a : Ξ±} {n : β„•} (period_pos : 0 < period m a) (moved : βˆ€ k, 0 < k β†’ k < n β†’ m ^ k β€’ a β‰  a) : n ≀ period m a := le_of_not_gt fun period_lt_n => moved _ period_pos period_lt_n <| pow_period_smul m a @[to_additive "If for some `n`, `(n β€’ m) +α΅₯ a = a`, then `period m a ≀ n`."] theorem period_le_of_fixed {m : M} {a : Ξ±} {n : β„•} (n_pos : 0 < n) (fixed : m ^ n β€’ a = a) : period m a ≀ n := (isPeriodicPt_smul_iff.mpr fixed).minimalPeriod_le n_pos @[to_additive "If for some `n`, `(n β€’ m) +α΅₯ a = a`, then `0 < period m a`."] theorem period_pos_of_fixed {m : M} {a : Ξ±} {n : β„•} (n_pos : 0 < n) (fixed : m ^ n β€’ a = a) : 0 < period m a := (isPeriodicPt_smul_iff.mpr fixed).minimalPeriod_pos n_pos @[to_additive] theorem period_eq_one_iff {m : M} {a : Ξ±} : period m a = 1 ↔ m β€’ a = a := ⟨fun eq_one => pow_one m β–Έ eq_one β–Έ pow_period_smul m a, fun fixed => le_antisymm (period_le_of_fixed one_pos (by simpa)) (period_pos_of_fixed one_pos (by simpa))⟩ @[to_additive "For any non-zero `n` less than the period of `m` on `a`, `a` is moved by `n β€’ m`."] theorem pow_smul_ne_of_lt_period {m : M} {a : Ξ±} {n : β„•} (n_pos : 0 < n) (n_lt_period : n < period m a) : m ^ n β€’ a β‰  a := fun a_fixed => not_le_of_gt n_lt_period <| period_le_of_fixed n_pos a_fixed section MonoidExponent @[to_additive] theorem period_dvd_orderOf (m : M) (a : Ξ±) : period m a ∣ orderOf m := by rw [← pow_smul_eq_iff_period_dvd, pow_orderOf_eq_one, one_smul] @[to_additive] theorem period_pos_of_orderOf_pos {m : M} (order_pos : 0 < orderOf m) (a : Ξ±) : 0 < period m a := Nat.pos_of_dvd_of_pos (period_dvd_orderOf m a) order_pos @[to_additive] theorem period_le_orderOf {m : M} (order_pos : 0 < orderOf m) (a : Ξ±) : period m a ≀ orderOf m := Nat.le_of_dvd order_pos (period_dvd_orderOf m a) @[to_additive] theorem period_dvd_exponent (m : M) (a : Ξ±) : period m a ∣ Monoid.exponent M := by rw [← pow_smul_eq_iff_period_dvd, Monoid.pow_exponent_eq_one, one_smul] @[to_additive] theorem period_pos_of_exponent_pos (exp_pos : 0 < Monoid.exponent M) (m : M) (a : Ξ±) : 0 < period m a := Nat.pos_of_dvd_of_pos (period_dvd_exponent m a) exp_pos @[to_additive] theorem period_le_exponent (exp_pos : 0 < Monoid.exponent M) (m : M) (a : Ξ±) : period m a ≀ Monoid.exponent M := Nat.le_of_dvd exp_pos (period_dvd_exponent m a) variable (Ξ±) @[to_additive]
Mathlib/GroupTheory/GroupAction/Period.lean
117
120
theorem period_bounded_of_exponent_pos (exp_pos : 0 < Monoid.exponent M) (m : M) : BddAbove (Set.range (fun a : Ξ± => period m a)) := by
use Monoid.exponent M simpa [upperBounds] using period_le_exponent exp_pos _
[ " m ^ 1 β€’ a = a", " period m a ∣ orderOf m", " period m a ∣ Monoid.exponent M", " BddAbove (Set.range fun a => period m a)", " Monoid.exponent M ∈ upperBounds (Set.range fun a => period m a)" ]
[ " m ^ 1 β€’ a = a", " period m a ∣ orderOf m", " period m a ∣ Monoid.exponent M", " BddAbove (Set.range fun a => period m a)" ]
import Mathlib.Algebra.Star.Basic import Mathlib.Data.Set.Finite import Mathlib.Data.Set.Pointwise.Basic #align_import algebra.star.pointwise from "leanprover-community/mathlib"@"30413fc89f202a090a54d78e540963ed3de0056e" namespace Set open Pointwise local postfix:max "⋆" => star variable {Ξ± : Type*} {s t : Set Ξ±} {a : Ξ±} protected def star [Star Ξ±] : Star (Set Ξ±) := ⟨preimage Star.star⟩ #align set.has_star Set.star scoped[Pointwise] attribute [instance] Set.star @[simp] theorem star_empty [Star Ξ±] : (βˆ… : Set Ξ±)⋆ = βˆ… := rfl #align set.star_empty Set.star_empty @[simp] theorem star_univ [Star Ξ±] : (univ : Set Ξ±)⋆ = univ := rfl #align set.star_univ Set.star_univ @[simp] theorem nonempty_star [InvolutiveStar Ξ±] {s : Set Ξ±} : s⋆.Nonempty ↔ s.Nonempty := star_involutive.surjective.nonempty_preimage #align set.nonempty_star Set.nonempty_star theorem Nonempty.star [InvolutiveStar Ξ±] {s : Set Ξ±} (h : s.Nonempty) : s⋆.Nonempty := nonempty_star.2 h #align set.nonempty.star Set.Nonempty.star @[simp] theorem mem_star [Star Ξ±] : a ∈ s⋆ ↔ a⋆ ∈ s := Iff.rfl #align set.mem_star Set.mem_star theorem star_mem_star [InvolutiveStar Ξ±] : a⋆ ∈ s⋆ ↔ a ∈ s := by simp only [mem_star, star_star] #align set.star_mem_star Set.star_mem_star @[simp] theorem star_preimage [Star Ξ±] : Star.star ⁻¹' s = s⋆ := rfl #align set.star_preimage Set.star_preimage @[simp] theorem image_star [InvolutiveStar Ξ±] : Star.star '' s = s⋆ := by simp only [← star_preimage] rw [image_eq_preimage_of_inverse] <;> intro <;> simp only [star_star] #align set.image_star Set.image_star @[simp] theorem inter_star [Star Ξ±] : (s ∩ t)⋆ = s⋆ ∩ t⋆ := preimage_inter #align set.inter_star Set.inter_star @[simp] theorem union_star [Star Ξ±] : (s βˆͺ t)⋆ = s⋆ βˆͺ t⋆ := preimage_union #align set.union_star Set.union_star @[simp] theorem iInter_star {ΞΉ : Sort*} [Star Ξ±] (s : ΞΉ β†’ Set Ξ±) : (β‹‚ i, s i)⋆ = β‹‚ i, (s i)⋆ := preimage_iInter #align set.Inter_star Set.iInter_star @[simp] theorem iUnion_star {ΞΉ : Sort*} [Star Ξ±] (s : ΞΉ β†’ Set Ξ±) : (⋃ i, s i)⋆ = ⋃ i, (s i)⋆ := preimage_iUnion #align set.Union_star Set.iUnion_star @[simp] theorem compl_star [Star Ξ±] : sαΆœβ‹† = sβ‹†αΆœ := preimage_compl #align set.compl_star Set.compl_star @[simp] instance [InvolutiveStar Ξ±] : InvolutiveStar (Set Ξ±) where star := Star.star star_involutive s := by simp only [← star_preimage, preimage_preimage, star_star, preimage_id'] @[simp] theorem star_subset_star [InvolutiveStar Ξ±] {s t : Set Ξ±} : s⋆ βŠ† t⋆ ↔ s βŠ† t := Equiv.star.surjective.preimage_subset_preimage_iff #align set.star_subset_star Set.star_subset_star theorem star_subset [InvolutiveStar Ξ±] {s t : Set Ξ±} : s⋆ βŠ† t ↔ s βŠ† t⋆ := by rw [← star_subset_star, star_star] #align set.star_subset Set.star_subset theorem Finite.star [InvolutiveStar Ξ±] {s : Set Ξ±} (hs : s.Finite) : s⋆.Finite := hs.preimage star_injective.injOn #align set.finite.star Set.Finite.star
Mathlib/Algebra/Star/Pointwise.lean
115
117
theorem star_singleton {Ξ² : Type*} [InvolutiveStar Ξ²] (x : Ξ²) : ({x} : Set Ξ²)⋆ = {x⋆} := by
ext1 y rw [mem_star, mem_singleton_iff, mem_singleton_iff, star_eq_iff_star_eq, eq_comm]
[ " a⋆ ∈ s⋆ ↔ a ∈ s", " star '' s = s⋆", " star '' s = star ⁻¹' s", " Function.LeftInverse star star", " Function.RightInverse star star", " xβœβ‹†β‹† = x✝", " s⋆⋆ = s", " s⋆ βŠ† t ↔ s βŠ† t⋆", " {x}⋆ = {x⋆}", " y ∈ {x}⋆ ↔ y ∈ {x⋆}" ]
[ " a⋆ ∈ s⋆ ↔ a ∈ s", " star '' s = s⋆", " star '' s = star ⁻¹' s", " Function.LeftInverse star star", " Function.RightInverse star star", " xβœβ‹†β‹† = x✝", " s⋆⋆ = s", " s⋆ βŠ† t ↔ s βŠ† t⋆", " {x}⋆ = {x⋆}" ]
import Mathlib.MeasureTheory.Constructions.Prod.Basic import Mathlib.MeasureTheory.Measure.MeasureSpace namespace MeasureTheory namespace Measure variable {M : Type*} [Monoid M] [MeasurableSpace M] @[to_additive conv "Additive convolution of measures."] noncomputable def mconv (ΞΌ : Measure M) (Ξ½ : Measure M) : Measure M := Measure.map (fun x : M Γ— M ↦ x.1 * x.2) (ΞΌ.prod Ξ½) scoped[MeasureTheory] infix:80 " βˆ— " => MeasureTheory.Measure.mconv scoped[MeasureTheory] infix:80 " βˆ— " => MeasureTheory.Measure.conv @[to_additive (attr := simp)] theorem dirac_one_mconv [MeasurableMulβ‚‚ M] (ΞΌ : Measure M) [SFinite ΞΌ] : (Measure.dirac 1) βˆ— ΞΌ = ΞΌ := by unfold mconv rw [MeasureTheory.Measure.dirac_prod, map_map] Β· simp only [Function.comp_def, one_mul, map_id'] all_goals { measurability } @[to_additive (attr := simp)] theorem mconv_dirac_one [MeasurableMulβ‚‚ M] (ΞΌ : Measure M) [SFinite ΞΌ] : ΞΌ βˆ— (Measure.dirac 1) = ΞΌ := by unfold mconv rw [MeasureTheory.Measure.prod_dirac, map_map] Β· simp only [Function.comp_def, mul_one, map_id'] all_goals { measurability } @[to_additive (attr := simp) conv_zero] theorem mconv_zero (ΞΌ : Measure M) : (0 : Measure M) βˆ— ΞΌ = (0 : Measure M) := by unfold mconv simp @[to_additive (attr := simp) zero_conv]
Mathlib/MeasureTheory/Group/Convolution.lean
65
67
theorem zero_mconv (ΞΌ : Measure M) : ΞΌ βˆ— (0 : Measure M) = (0 : Measure M) := by
unfold mconv simp
[ " dirac 1 βˆ— ΞΌ = ΞΌ", " map (fun x => x.1 * x.2) ((dirac 1).prod ΞΌ) = ΞΌ", " map ((fun x => x.1 * x.2) ∘ Prod.mk 1) ΞΌ = ΞΌ", " Measurable (Prod.mk 1)", " Measurable fun x => x.1 * x.2", " ΞΌ βˆ— dirac 1 = ΞΌ", " map (fun x => x.1 * x.2) (ΞΌ.prod (dirac 1)) = ΞΌ", " map ((fun x => x.1 * x.2) ∘ fun x => (x, 1)) ΞΌ...
[ " dirac 1 βˆ— ΞΌ = ΞΌ", " map (fun x => x.1 * x.2) ((dirac 1).prod ΞΌ) = ΞΌ", " map ((fun x => x.1 * x.2) ∘ Prod.mk 1) ΞΌ = ΞΌ", " Measurable (Prod.mk 1)", " Measurable fun x => x.1 * x.2", " ΞΌ βˆ— dirac 1 = ΞΌ", " map (fun x => x.1 * x.2) (ΞΌ.prod (dirac 1)) = ΞΌ", " map ((fun x => x.1 * x.2) ∘ fun x => (x, 1)) ΞΌ...
import Mathlib.Data.Set.Finite import Mathlib.Order.Partition.Finpartition #align_import data.setoid.partition from "leanprover-community/mathlib"@"b363547b3113d350d053abdf2884e9850a56b205" namespace Setoid variable {Ξ± : Type*} theorem eq_of_mem_eqv_class {c : Set (Set Ξ±)} (H : βˆ€ a, βˆƒ! b ∈ c, a ∈ b) {x b b'} (hc : b ∈ c) (hb : x ∈ b) (hc' : b' ∈ c) (hb' : x ∈ b') : b = b' := (H x).unique ⟨hc, hb⟩ ⟨hc', hb'⟩ #align setoid.eq_of_mem_eqv_class Setoid.eq_of_mem_eqv_class def mkClasses (c : Set (Set Ξ±)) (H : βˆ€ a, βˆƒ! b ∈ c, a ∈ b) : Setoid Ξ± where r x y := βˆ€ s ∈ c, x ∈ s β†’ y ∈ s iseqv.refl := fun _ _ _ hx => hx iseqv.symm := fun {x _y} h s hs hy => by obtain ⟨t, ⟨ht, hx⟩, _⟩ := H x rwa [eq_of_mem_eqv_class H hs hy ht (h t ht hx)] iseqv.trans := fun {_x y z} h1 h2 s hs hx => h2 s hs (h1 s hs hx) #align setoid.mk_classes Setoid.mkClasses def classes (r : Setoid Ξ±) : Set (Set Ξ±) := { s | βˆƒ y, s = { x | r.Rel x y } } #align setoid.classes Setoid.classes theorem mem_classes (r : Setoid Ξ±) (y) : { x | r.Rel x y } ∈ r.classes := ⟨y, rfl⟩ #align setoid.mem_classes Setoid.mem_classes
Mathlib/Data/Setoid/Partition.lean
67
71
theorem classes_ker_subset_fiber_set {Ξ² : Type*} (f : Ξ± β†’ Ξ²) : (Setoid.ker f).classes βŠ† Set.range fun y => { x | f x = y } := by
rintro s ⟨x, rfl⟩ rw [Set.mem_range] exact ⟨f x, rfl⟩
[ " x ∈ s", " (ker f).classes βŠ† Set.range fun y => {x | f x = y}", " {x_1 | (ker f).Rel x_1 x} ∈ Set.range fun y => {x | f x = y}", " βˆƒ y, {x | f x = y} = {x_1 | (ker f).Rel x_1 x}" ]
[ " x ∈ s", " (ker f).classes βŠ† Set.range fun y => {x | f x = y}" ]
import Mathlib.Analysis.Convolution import Mathlib.Analysis.Calculus.BumpFunction.Normed import Mathlib.MeasureTheory.Integral.Average import Mathlib.MeasureTheory.Covering.Differentiation import Mathlib.MeasureTheory.Covering.BesicovitchVectorSpace import Mathlib.MeasureTheory.Measure.Haar.Unique #align_import analysis.convolution from "leanprover-community/mathlib"@"8905e5ed90859939681a725b00f6063e65096d95" universe uG uE' open ContinuousLinearMap Metric MeasureTheory Filter Function Measure Set open scoped Convolution Topology namespace ContDiffBump variable {G : Type uG} {E' : Type uE'} [NormedAddCommGroup E'] {g : G β†’ E'} [MeasurableSpace G] {ΞΌ : MeasureTheory.Measure G} [NormedSpace ℝ E'] [NormedAddCommGroup G] [NormedSpace ℝ G] [HasContDiffBump G] [CompleteSpace E'] {Ο† : ContDiffBump (0 : G)} {xβ‚€ : G} theorem convolution_eq_right {xβ‚€ : G} (hg : βˆ€ x ∈ ball xβ‚€ Ο†.rOut, g x = g xβ‚€) : (Ο† ⋆[lsmul ℝ ℝ, ΞΌ] g : G β†’ E') xβ‚€ = integral ΞΌ Ο† β€’ g xβ‚€ := by simp_rw [convolution_eq_right' _ Ο†.support_eq.subset hg, lsmul_apply, integral_smul_const] #align cont_diff_bump.convolution_eq_right ContDiffBump.convolution_eq_right variable [BorelSpace G] variable [IsLocallyFiniteMeasure ΞΌ] [ΞΌ.IsOpenPosMeasure] variable [FiniteDimensional ℝ G] theorem normed_convolution_eq_right {xβ‚€ : G} (hg : βˆ€ x ∈ ball xβ‚€ Ο†.rOut, g x = g xβ‚€) : (Ο†.normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g : G β†’ E') xβ‚€ = g xβ‚€ := by rw [convolution_eq_right' _ Ο†.support_normed_eq.subset hg] exact integral_normed_smul Ο† ΞΌ (g xβ‚€) #align cont_diff_bump.normed_convolution_eq_right ContDiffBump.normed_convolution_eq_right variable [ΞΌ.IsAddLeftInvariant] theorem dist_normed_convolution_le {xβ‚€ : G} {Ξ΅ : ℝ} (hmg : AEStronglyMeasurable g ΞΌ) (hg : βˆ€ x ∈ ball xβ‚€ Ο†.rOut, dist (g x) (g xβ‚€) ≀ Ξ΅) : dist ((Ο†.normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g : G β†’ E') xβ‚€) (g xβ‚€) ≀ Ξ΅ := dist_convolution_le (by simp_rw [← dist_self (g xβ‚€), hg xβ‚€ (mem_ball_self Ο†.rOut_pos)]) Ο†.support_normed_eq.subset Ο†.nonneg_normed Ο†.integral_normed hmg hg #align cont_diff_bump.dist_normed_convolution_le ContDiffBump.dist_normed_convolution_le nonrec theorem convolution_tendsto_right {ΞΉ} {Ο† : ΞΉ β†’ ContDiffBump (0 : G)} {g : ΞΉ β†’ G β†’ E'} {k : ΞΉ β†’ G} {xβ‚€ : G} {zβ‚€ : E'} {l : Filter ΞΉ} (hΟ† : Tendsto (fun i => (Ο† i).rOut) l (𝓝 0)) (hig : βˆ€αΆ  i in l, AEStronglyMeasurable (g i) ΞΌ) (hcg : Tendsto (uncurry g) (l Γ—Λ’ 𝓝 xβ‚€) (𝓝 zβ‚€)) (hk : Tendsto k l (𝓝 xβ‚€)) : Tendsto (fun i => ((Ο† i).normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g i) (k i)) l (𝓝 zβ‚€) := convolution_tendsto_right (eventually_of_forall fun i => (Ο† i).nonneg_normed) (eventually_of_forall fun i => (Ο† i).integral_normed) (tendsto_support_normed_smallSets hΟ†) hig hcg hk #align cont_diff_bump.convolution_tendsto_right ContDiffBump.convolution_tendsto_right theorem convolution_tendsto_right_of_continuous {ΞΉ} {Ο† : ΞΉ β†’ ContDiffBump (0 : G)} {l : Filter ΞΉ} (hΟ† : Tendsto (fun i => (Ο† i).rOut) l (𝓝 0)) (hg : Continuous g) (xβ‚€ : G) : Tendsto (fun i => ((Ο† i).normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€) l (𝓝 (g xβ‚€)) := convolution_tendsto_right hΟ† (eventually_of_forall fun _ => hg.aestronglyMeasurable) ((hg.tendsto xβ‚€).comp tendsto_snd) tendsto_const_nhds #align cont_diff_bump.convolution_tendsto_right_of_continuous ContDiffBump.convolution_tendsto_right_of_continuous
Mathlib/Analysis/Calculus/BumpFunction/Convolution.lean
110
139
theorem ae_convolution_tendsto_right_of_locallyIntegrable {ΞΉ} {Ο† : ΞΉ β†’ ContDiffBump (0 : G)} {l : Filter ΞΉ} {K : ℝ} (hΟ† : Tendsto (fun i ↦ (Ο† i).rOut) l (𝓝 0)) (h'Ο† : βˆ€αΆ  i in l, (Ο† i).rOut ≀ K * (Ο† i).rIn) (hg : LocallyIntegrable g ΞΌ) : βˆ€α΅ xβ‚€ βˆ‚ΞΌ, Tendsto (fun i ↦ ((Ο† i).normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€) l (𝓝 (g xβ‚€)) := by
have : IsAddHaarMeasure ΞΌ := ⟨⟩ -- By Lebesgue differentiation theorem, the average of `g` on a small ball converges -- almost everywhere to the value of `g` as the radius shrinks to zero. -- We will see that this set of points satisfies the desired conclusion. filter_upwards [(Besicovitch.vitaliFamily ΞΌ).ae_tendsto_average_norm_sub hg] with xβ‚€ hβ‚€ simp only [convolution_eq_swap, lsmul_apply] have hΟ†' : Tendsto (fun i ↦ (Ο† i).rOut) l (𝓝[>] 0) := tendsto_nhdsWithin_iff.2 ⟨hΟ†, eventually_of_forall (fun i ↦ (Ο† i).rOut_pos)⟩ have := (hβ‚€.comp (Besicovitch.tendsto_filterAt ΞΌ xβ‚€)).comp hΟ†' simp only [Function.comp] at this apply tendsto_integral_smul_of_tendsto_average_norm_sub (K ^ (FiniteDimensional.finrank ℝ G)) this Β· filter_upwards with i using hg.integrableOn_isCompact (isCompact_closedBall _ _) Β· apply tendsto_const_nhds.congr (fun i ↦ ?_) rw [← integral_neg_eq_self] simp only [sub_neg_eq_add, integral_add_left_eq_self, integral_normed] Β· filter_upwards with i change support ((ContDiffBump.normed (Ο† i) ΞΌ) ∘ (fun y ↦ xβ‚€ - y)) βŠ† closedBall xβ‚€ (Ο† i).rOut simp only [support_comp_eq_preimage, support_normed_eq] intro x hx simp only [mem_preimage, mem_ball, dist_zero_right] at hx simpa [dist_eq_norm_sub'] using hx.le Β· filter_upwards [h'Ο†] with i hi x rw [abs_of_nonneg (nonneg_normed _ _), addHaar_closedBall_center] exact (Ο† i).normed_le_div_measure_closedBall_rOut _ _ hi _
[ " (↑φ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€ = integral ΞΌ ↑φ β€’ g xβ‚€", " (Ο†.normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€ = g xβ‚€", " ∫ (t : G), ((lsmul ℝ ℝ) (Ο†.normed ΞΌ t)) (g xβ‚€) βˆ‚ΞΌ = g xβ‚€", " 0 ≀ Ξ΅", " βˆ€α΅ (xβ‚€ : G) βˆ‚ΞΌ, Tendsto (fun i => ((Ο† i).normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€) l (𝓝 (g xβ‚€))", " Tendsto (fun i => ((Ο† i).normed ΞΌ ⋆[lsmul ℝ ...
[ " (↑φ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€ = integral ΞΌ ↑φ β€’ g xβ‚€", " (Ο†.normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€ = g xβ‚€", " ∫ (t : G), ((lsmul ℝ ℝ) (Ο†.normed ΞΌ t)) (g xβ‚€) βˆ‚ΞΌ = g xβ‚€", " 0 ≀ Ξ΅", " βˆ€α΅ (xβ‚€ : G) βˆ‚ΞΌ, Tendsto (fun i => ((Ο† i).normed ΞΌ ⋆[lsmul ℝ ℝ, ΞΌ] g) xβ‚€) l (𝓝 (g xβ‚€))" ]
import Mathlib.Algebra.ContinuedFractions.Basic import Mathlib.Algebra.GroupWithZero.Basic #align_import algebra.continued_fractions.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace GeneralizedContinuedFraction section WithDivisionRing variable {K : Type*} {g : GeneralizedContinuedFraction K} {n : β„•} [DivisionRing K] theorem nth_cont_eq_succ_nth_cont_aux : g.continuants n = g.continuantsAux (n + 1) := rfl #align generalized_continued_fraction.nth_cont_eq_succ_nth_cont_aux GeneralizedContinuedFraction.nth_cont_eq_succ_nth_cont_aux theorem num_eq_conts_a : g.numerators n = (g.continuants n).a := rfl #align generalized_continued_fraction.num_eq_conts_a GeneralizedContinuedFraction.num_eq_conts_a theorem denom_eq_conts_b : g.denominators n = (g.continuants n).b := rfl #align generalized_continued_fraction.denom_eq_conts_b GeneralizedContinuedFraction.denom_eq_conts_b theorem convergent_eq_num_div_denom : g.convergents n = g.numerators n / g.denominators n := rfl #align generalized_continued_fraction.convergent_eq_num_div_denom GeneralizedContinuedFraction.convergent_eq_num_div_denom theorem convergent_eq_conts_a_div_conts_b : g.convergents n = (g.continuants n).a / (g.continuants n).b := rfl #align generalized_continued_fraction.convergent_eq_conts_a_div_conts_b GeneralizedContinuedFraction.convergent_eq_conts_a_div_conts_b theorem exists_conts_a_of_num {A : K} (nth_num_eq : g.numerators n = A) : βˆƒ conts, g.continuants n = conts ∧ conts.a = A := by simpa #align generalized_continued_fraction.exists_conts_a_of_num GeneralizedContinuedFraction.exists_conts_a_of_num
Mathlib/Algebra/ContinuedFractions/Translations.lean
116
117
theorem exists_conts_b_of_denom {B : K} (nth_denom_eq : g.denominators n = B) : βˆƒ conts, g.continuants n = conts ∧ conts.b = B := by
simpa
[ " βˆƒ conts, g.continuants n = conts ∧ conts.a = A", " βˆƒ conts, g.continuants n = conts ∧ conts.b = B" ]
[ " βˆƒ conts, g.continuants n = conts ∧ conts.a = A", " βˆƒ conts, g.continuants n = conts ∧ conts.b = B" ]
import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Topology.Algebra.Polynomial #align_import analysis.calculus.local_extr from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" namespace Polynomial theorem card_roots_toFinset_le_card_roots_derivative_diff_roots_succ (p : ℝ[X]) : p.roots.toFinset.card ≀ (p.derivative.roots.toFinset \ p.roots.toFinset).card + 1 := by rcases eq_or_ne (derivative p) 0 with hp' | hp' Β· rw [eq_C_of_derivative_eq_zero hp', roots_C, Multiset.toFinset_zero, Finset.card_empty] exact zero_le _ have hp : p β‰  0 := ne_of_apply_ne derivative (by rwa [derivative_zero]) refine Finset.card_le_diff_of_interleaved fun x hx y hy hxy hxy' => ?_ rw [Multiset.mem_toFinset, mem_roots hp] at hx hy obtain ⟨z, hz1, hz2⟩ := exists_deriv_eq_zero hxy p.continuousOn (hx.trans hy.symm) refine ⟨z, ?_, hz1⟩ rwa [Multiset.mem_toFinset, mem_roots hp', IsRoot, ← p.deriv] #align polynomial.card_roots_to_finset_le_card_roots_derivative_diff_roots_succ Polynomial.card_roots_toFinset_le_card_roots_derivative_diff_roots_succ theorem card_roots_toFinset_le_derivative (p : ℝ[X]) : p.roots.toFinset.card ≀ p.derivative.roots.toFinset.card + 1 := p.card_roots_toFinset_le_card_roots_derivative_diff_roots_succ.trans <| add_le_add_right (Finset.card_mono Finset.sdiff_subset) _ #align polynomial.card_roots_to_finset_le_derivative Polynomial.card_roots_toFinset_le_derivative theorem card_roots_le_derivative (p : ℝ[X]) : Multiset.card p.roots ≀ Multiset.card (derivative p).roots + 1 := calc Multiset.card p.roots = βˆ‘ x ∈ p.roots.toFinset, p.roots.count x := (Multiset.toFinset_sum_count_eq _).symm _ = βˆ‘ x ∈ p.roots.toFinset, (p.roots.count x - 1 + 1) := (Eq.symm <| Finset.sum_congr rfl fun x hx => tsub_add_cancel_of_le <| Nat.succ_le_iff.2 <| Multiset.count_pos.2 <| Multiset.mem_toFinset.1 hx) _ = (βˆ‘ x ∈ p.roots.toFinset, (p.rootMultiplicity x - 1)) + p.roots.toFinset.card := by simp only [Finset.sum_add_distrib, Finset.card_eq_sum_ones, count_roots] _ ≀ (βˆ‘ x ∈ p.roots.toFinset, p.derivative.rootMultiplicity x) + ((p.derivative.roots.toFinset \ p.roots.toFinset).card + 1) := (add_le_add (Finset.sum_le_sum fun x _ => rootMultiplicity_sub_one_le_derivative_rootMultiplicity _ _) p.card_roots_toFinset_le_card_roots_derivative_diff_roots_succ) _ ≀ (βˆ‘ x ∈ p.roots.toFinset, p.derivative.roots.count x) + ((βˆ‘ x ∈ p.derivative.roots.toFinset \ p.roots.toFinset, p.derivative.roots.count x) + 1) := by simp only [← count_roots] refine add_le_add_left (add_le_add_right ((Finset.card_eq_sum_ones _).trans_le ?_) _) _ refine Finset.sum_le_sum fun x hx => Nat.succ_le_iff.2 <| ?_ rw [Multiset.count_pos, ← Multiset.mem_toFinset] exact (Finset.mem_sdiff.1 hx).1 _ = Multiset.card (derivative p).roots + 1 := by rw [← add_assoc, ← Finset.sum_union Finset.disjoint_sdiff, Finset.union_sdiff_self_eq_union, ← Multiset.toFinset_sum_count_eq, ← Finset.sum_subset Finset.subset_union_right] intro x _ hxβ‚‚ simpa only [Multiset.mem_toFinset, Multiset.count_eq_zero] using hxβ‚‚ #align polynomial.card_roots_le_derivative Polynomial.card_roots_le_derivative
Mathlib/Analysis/Calculus/LocalExtr/Polynomial.lean
91
94
theorem card_rootSet_le_derivative {F : Type*} [CommRing F] [Algebra F ℝ] (p : F[X]) : Fintype.card (p.rootSet ℝ) ≀ Fintype.card (p.derivative.rootSet ℝ) + 1 := by
simpa only [rootSet_def, Finset.coe_sort_coe, Fintype.card_coe, derivative_map] using card_roots_toFinset_le_derivative (p.map (algebraMap F ℝ))
[ " p.roots.toFinset.card ≀ ((derivative p).roots.toFinset \\ p.roots.toFinset).card + 1", " 0 ≀ ((derivative (C (p.coeff 0))).roots.toFinset \\ βˆ…).card + 1", " derivative p β‰  derivative 0", " βˆƒ z ∈ (derivative p).roots.toFinset, x < z ∧ z < y", " z ∈ (derivative p).roots.toFinset", " βˆ‘ x ∈ p.roots.toFinset...
[ " p.roots.toFinset.card ≀ ((derivative p).roots.toFinset \\ p.roots.toFinset).card + 1", " 0 ≀ ((derivative (C (p.coeff 0))).roots.toFinset \\ βˆ…).card + 1", " derivative p β‰  derivative 0", " βˆƒ z ∈ (derivative p).roots.toFinset, x < z ∧ z < y", " z ∈ (derivative p).roots.toFinset", " βˆ‘ x ∈ p.roots.toFinset...
import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.LocalRing #align_import data.polynomial.expand from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" universe u v w open Polynomial open Finset namespace Polynomial section CommSemiring variable (R : Type u) [CommSemiring R] {S : Type v} [CommSemiring S] (p q : β„•) noncomputable def expand : R[X] →ₐ[R] R[X] := { (evalβ‚‚RingHom C (X ^ p) : R[X] β†’+* R[X]) with commutes' := fun _ => evalβ‚‚_C _ _ } #align polynomial.expand Polynomial.expand theorem coe_expand : (expand R p : R[X] β†’ R[X]) = evalβ‚‚ C (X ^ p) := rfl #align polynomial.coe_expand Polynomial.coe_expand variable {R} theorem expand_eq_comp_X_pow {f : R[X]} : expand R p f = f.comp (X ^ p) := rfl
Mathlib/Algebra/Polynomial/Expand.lean
48
49
theorem expand_eq_sum {f : R[X]} : expand R p f = f.sum fun e a => C a * (X ^ p) ^ e := by
simp [expand, evalβ‚‚]
[ " (expand R p) f = f.sum fun e a => C a * (X ^ p) ^ e" ]
[ " (expand R p) f = f.sum fun e a => C a * (X ^ p) ^ e" ]
import Mathlib.Algebra.MonoidAlgebra.Basic #align_import algebra.monoid_algebra.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951" variable {k G : Type*} [Semiring k] namespace AddMonoidAlgebra section variable [AddCancelCommMonoid G] noncomputable def divOf (x : k[G]) (g : G) : k[G] := -- note: comapping by `+ g` has the effect of subtracting `g` from every element in -- the support, and discarding the elements of the support from which `g` can't be subtracted. -- If `G` is an additive group, such as `β„€` when used for `LaurentPolynomial`, -- then no discarding occurs. @Finsupp.comapDomain.addMonoidHom _ _ _ _ (g + Β·) (add_right_injective g) x #align add_monoid_algebra.div_of AddMonoidAlgebra.divOf local infixl:70 " /α΅’αΆ  " => divOf @[simp] theorem divOf_apply (g : G) (x : k[G]) (g' : G) : (x /α΅’αΆ  g) g' = x (g + g') := rfl #align add_monoid_algebra.div_of_apply AddMonoidAlgebra.divOf_apply @[simp] theorem support_divOf (g : G) (x : k[G]) : (x /α΅’αΆ  g).support = x.support.preimage (g + Β·) (Function.Injective.injOn (add_right_injective g)) := rfl #align add_monoid_algebra.support_div_of AddMonoidAlgebra.support_divOf @[simp] theorem zero_divOf (g : G) : (0 : k[G]) /α΅’αΆ  g = 0 := map_zero (Finsupp.comapDomain.addMonoidHom _) #align add_monoid_algebra.zero_div_of AddMonoidAlgebra.zero_divOf @[simp]
Mathlib/Algebra/MonoidAlgebra/Division.lean
77
79
theorem divOf_zero (x : k[G]) : x /α΅’αΆ  0 = x := by
refine Finsupp.ext fun _ => ?_ -- Porting note: `ext` doesn't work simp only [AddMonoidAlgebra.divOf_apply, zero_add]
[ " x /α΅’αΆ  0 = x", " (x /α΅’αΆ  0) x✝ = x x✝" ]
[ " x /α΅’αΆ  0 = x" ]
import Mathlib.LinearAlgebra.AffineSpace.AffineMap import Mathlib.Tactic.FieldSimp #align_import linear_algebra.affine_space.slope from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open AffineMap variable {k E PE : Type*} [Field k] [AddCommGroup E] [Module k E] [AddTorsor E PE] def slope (f : k β†’ PE) (a b : k) : E := (b - a)⁻¹ β€’ (f b -α΅₯ f a) #align slope slope theorem slope_fun_def (f : k β†’ PE) : slope f = fun a b => (b - a)⁻¹ β€’ (f b -α΅₯ f a) := rfl #align slope_fun_def slope_fun_def theorem slope_def_field (f : k β†’ k) (a b : k) : slope f a b = (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_def_field slope_def_field theorem slope_fun_def_field (f : k β†’ k) (a : k) : slope f a = fun b => (f b - f a) / (b - a) := (div_eq_inv_mul _ _).symm #align slope_fun_def_field slope_fun_def_field @[simp] theorem slope_same (f : k β†’ PE) (a : k) : (slope f a a : E) = 0 := by rw [slope, sub_self, inv_zero, zero_smul] #align slope_same slope_same theorem slope_def_module (f : k β†’ E) (a b : k) : slope f a b = (b - a)⁻¹ β€’ (f b - f a) := rfl #align slope_def_module slope_def_module @[simp] theorem sub_smul_slope (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b = f b -α΅₯ f a := by rcases eq_or_ne a b with (rfl | hne) Β· rw [sub_self, zero_smul, vsub_self] Β· rw [slope, smul_inv_smulβ‚€ (sub_ne_zero.2 hne.symm)] #align sub_smul_slope sub_smul_slope
Mathlib/LinearAlgebra/AffineSpace/Slope.lean
62
63
theorem sub_smul_slope_vadd (f : k β†’ PE) (a b : k) : (b - a) β€’ slope f a b +α΅₯ f a = f b := by
rw [sub_smul_slope, vsub_vadd]
[ " slope f a a = 0", " (b - a) β€’ slope f a b = f b -α΅₯ f a", " (a - a) β€’ slope f a a = f a -α΅₯ f a", " (b - a) β€’ slope f a b +α΅₯ f a = f b" ]
[ " slope f a a = 0", " (b - a) β€’ slope f a b = f b -α΅₯ f a", " (a - a) β€’ slope f a a = f a -α΅₯ f a", " (b - a) β€’ slope f a b +α΅₯ f a = f b" ]
import Mathlib.Order.Interval.Set.Basic import Mathlib.Order.Hom.Set #align_import data.set.intervals.order_iso from "leanprover-community/mathlib"@"d012cd09a9b256d870751284dd6a29882b0be105" open Set namespace OrderIso section Preorder variable {Ξ± Ξ² : Type*} [Preorder Ξ±] [Preorder Ξ²] @[simp] theorem preimage_Iic (e : Ξ± ≃o Ξ²) (b : Ξ²) : e ⁻¹' Iic b = Iic (e.symm b) := by ext x simp [← e.le_iff_le] #align order_iso.preimage_Iic OrderIso.preimage_Iic @[simp] theorem preimage_Ici (e : Ξ± ≃o Ξ²) (b : Ξ²) : e ⁻¹' Ici b = Ici (e.symm b) := by ext x simp [← e.le_iff_le] #align order_iso.preimage_Ici OrderIso.preimage_Ici @[simp] theorem preimage_Iio (e : Ξ± ≃o Ξ²) (b : Ξ²) : e ⁻¹' Iio b = Iio (e.symm b) := by ext x simp [← e.lt_iff_lt] #align order_iso.preimage_Iio OrderIso.preimage_Iio @[simp] theorem preimage_Ioi (e : Ξ± ≃o Ξ²) (b : Ξ²) : e ⁻¹' Ioi b = Ioi (e.symm b) := by ext x simp [← e.lt_iff_lt] #align order_iso.preimage_Ioi OrderIso.preimage_Ioi @[simp] theorem preimage_Icc (e : Ξ± ≃o Ξ²) (a b : Ξ²) : e ⁻¹' Icc a b = Icc (e.symm a) (e.symm b) := by simp [← Ici_inter_Iic] #align order_iso.preimage_Icc OrderIso.preimage_Icc @[simp] theorem preimage_Ico (e : Ξ± ≃o Ξ²) (a b : Ξ²) : e ⁻¹' Ico a b = Ico (e.symm a) (e.symm b) := by simp [← Ici_inter_Iio] #align order_iso.preimage_Ico OrderIso.preimage_Ico @[simp]
Mathlib/Order/Interval/Set/OrderIso.lean
58
59
theorem preimage_Ioc (e : Ξ± ≃o Ξ²) (a b : Ξ²) : e ⁻¹' Ioc a b = Ioc (e.symm a) (e.symm b) := by
simp [← Ioi_inter_Iic]
[ " ⇑e ⁻¹' Iic b = Iic (e.symm b)", " x ∈ ⇑e ⁻¹' Iic b ↔ x ∈ Iic (e.symm b)", " ⇑e ⁻¹' Ici b = Ici (e.symm b)", " x ∈ ⇑e ⁻¹' Ici b ↔ x ∈ Ici (e.symm b)", " ⇑e ⁻¹' Iio b = Iio (e.symm b)", " x ∈ ⇑e ⁻¹' Iio b ↔ x ∈ Iio (e.symm b)", " ⇑e ⁻¹' Ioi b = Ioi (e.symm b)", " x ∈ ⇑e ⁻¹' Ioi b ↔ x ∈ Ioi (e.symm b)"...
[ " ⇑e ⁻¹' Iic b = Iic (e.symm b)", " x ∈ ⇑e ⁻¹' Iic b ↔ x ∈ Iic (e.symm b)", " ⇑e ⁻¹' Ici b = Ici (e.symm b)", " x ∈ ⇑e ⁻¹' Ici b ↔ x ∈ Ici (e.symm b)", " ⇑e ⁻¹' Iio b = Iio (e.symm b)", " x ∈ ⇑e ⁻¹' Iio b ↔ x ∈ Iio (e.symm b)", " ⇑e ⁻¹' Ioi b = Ioi (e.symm b)", " x ∈ ⇑e ⁻¹' Ioi b ↔ x ∈ Ioi (e.symm b)"...
import Mathlib.Tactic.CategoryTheory.Coherence import Mathlib.CategoryTheory.Bicategory.Coherence namespace CategoryTheory namespace Bicategory open Category open scoped Bicategory open Mathlib.Tactic.BicategoryCoherence (bicategoricalComp bicategoricalIsoComp) universe w v u variable {B : Type u} [Bicategory.{w, v} B] {a b c : B} {f : a ⟢ b} {g : b ⟢ a} def leftZigzag (Ξ· : πŸ™ a ⟢ f ≫ g) (Ξ΅ : g ≫ f ⟢ πŸ™ b) := Ξ· β–· f βŠ—β‰« f ◁ Ξ΅ def rightZigzag (Ξ· : πŸ™ a ⟢ f ≫ g) (Ξ΅ : g ≫ f ⟢ πŸ™ b) := g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g theorem rightZigzag_idempotent_of_left_triangle (Ξ· : πŸ™ a ⟢ f ≫ g) (Ξ΅ : g ≫ f ⟢ πŸ™ b) (h : leftZigzag Ξ· Ξ΅ = (Ξ»_ _).hom ≫ (ρ_ _).inv) : rightZigzag Ξ· Ξ΅ βŠ—β‰« rightZigzag Ξ· Ξ΅ = rightZigzag Ξ· Ξ΅ := by dsimp only [rightZigzag] calc _ = g ◁ Ξ· βŠ—β‰« ((Ξ΅ β–· g β–· πŸ™ a) ≫ (πŸ™ b ≫ g) ◁ Ξ·) βŠ—β‰« Ξ΅ β–· g := by simp [bicategoricalComp]; coherence _ = πŸ™ _ βŠ—β‰« g ◁ (Ξ· β–· πŸ™ a ≫ (f ≫ g) ◁ Ξ·) βŠ—β‰« (Ξ΅ β–· (g ≫ f) ≫ πŸ™ b ◁ Ξ΅) β–· g βŠ—β‰« πŸ™ _ := by rw [← whisker_exchange]; simp [bicategoricalComp]; coherence _ = g ◁ Ξ· βŠ—β‰« g ◁ leftZigzag Ξ· Ξ΅ β–· g βŠ—β‰« Ξ΅ β–· g := by rw [← whisker_exchange, ← whisker_exchange]; simp [leftZigzag, bicategoricalComp]; coherence _ = g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g := by rw [h]; simp [bicategoricalComp]; coherence structure Adjunction (f : a ⟢ b) (g : b ⟢ a) where unit : πŸ™ a ⟢ f ≫ g counit : g ≫ f ⟢ πŸ™ b left_triangle : leftZigzag unit counit = (Ξ»_ _).hom ≫ (ρ_ _).inv := by aesop_cat right_triangle : rightZigzag unit counit = (ρ_ _).hom ≫ (Ξ»_ _).inv := by aesop_cat @[inherit_doc] scoped infixr:15 " ⊣ " => Bicategory.Adjunction namespace Adjunction attribute [simp] left_triangle right_triangle attribute [local simp] leftZigzag rightZigzag def id (a : B) : πŸ™ a ⊣ πŸ™ a where unit := (ρ_ _).inv counit := (ρ_ _).hom left_triangle := by dsimp; coherence right_triangle := by dsimp; coherence instance : Inhabited (Adjunction (πŸ™ a) (πŸ™ a)) := ⟨id a⟩ noncomputable section variable (Ξ· : πŸ™ a β‰… f ≫ g) (Ξ΅ : g ≫ f β‰… πŸ™ b) def leftZigzagIso (Ξ· : πŸ™ a β‰… f ≫ g) (Ξ΅ : g ≫ f β‰… πŸ™ b) := whiskerRightIso Ξ· f β‰ͺβŠ—β‰« whiskerLeftIso f Ξ΅ def rightZigzagIso (Ξ· : πŸ™ a β‰… f ≫ g) (Ξ΅ : g ≫ f β‰… πŸ™ b) := whiskerLeftIso g Ξ· β‰ͺβŠ—β‰« whiskerRightIso Ξ΅ g attribute [local simp] leftZigzagIso rightZigzagIso leftZigzag rightZigzag @[simp] theorem leftZigzagIso_hom : (leftZigzagIso Ξ· Ξ΅).hom = leftZigzag Ξ·.hom Ξ΅.hom := rfl @[simp] theorem rightZigzagIso_hom : (rightZigzagIso Ξ· Ξ΅).hom = rightZigzag Ξ·.hom Ξ΅.hom := rfl @[simp] theorem leftZigzagIso_inv : (leftZigzagIso Ξ· Ξ΅).inv = rightZigzag Ξ΅.inv Ξ·.inv := by simp [bicategoricalComp, bicategoricalIsoComp] @[simp]
Mathlib/CategoryTheory/Bicategory/Adjunction.lean
205
206
theorem rightZigzagIso_inv : (rightZigzagIso Ξ· Ξ΅).inv = leftZigzag Ξ΅.inv Ξ·.inv := by
simp [bicategoricalComp, bicategoricalIsoComp]
[ " rightZigzag Ξ· Ξ΅ βŠ—β‰« rightZigzag Ξ· Ξ΅ = rightZigzag Ξ· Ξ΅", " (g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g) βŠ—β‰« g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g = g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g", " (g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g) βŠ—β‰« g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g = g ◁ Ξ· βŠ—β‰« (Ξ΅ β–· g β–· πŸ™ a ≫ (πŸ™ b ≫ g) ◁ Ξ·) βŠ—β‰« Ξ΅ β–· g", " g ◁ Ξ· ≫ (Ξ±_ g f g).inv ≫ Ξ΅ β–· g ≫ (Ξ»_ g).hom ≫ (ρ_ g).inv ≫ g ◁ Ξ· ≫ (Ξ±_ g f g).inv ≫ Ξ΅ β–· g =\n g ◁ Ξ· ≫...
[ " rightZigzag Ξ· Ξ΅ βŠ—β‰« rightZigzag Ξ· Ξ΅ = rightZigzag Ξ· Ξ΅", " (g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g) βŠ—β‰« g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g = g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g", " (g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g) βŠ—β‰« g ◁ Ξ· βŠ—β‰« Ξ΅ β–· g = g ◁ Ξ· βŠ—β‰« (Ξ΅ β–· g β–· πŸ™ a ≫ (πŸ™ b ≫ g) ◁ Ξ·) βŠ—β‰« Ξ΅ β–· g", " g ◁ Ξ· ≫ (Ξ±_ g f g).inv ≫ Ξ΅ β–· g ≫ (Ξ»_ g).hom ≫ (ρ_ g).inv ≫ g ◁ Ξ· ≫ (Ξ±_ g f g).inv ≫ Ξ΅ β–· g =\n g ◁ Ξ· ≫...
import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.Units import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul #align_import analysis.normed_space.bounded_linear_maps from "leanprover-community/mathlib"@"ce11c3c2a285bbe6937e26d9792fda4e51f3fe1a" noncomputable section open Topology open Filter (Tendsto) open Metric ContinuousLinearMap variable {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] structure IsBoundedLinearMap (π•œ : Type*) [NormedField π•œ] {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] (f : E β†’ F) extends IsLinearMap π•œ f : Prop where bound : βˆƒ M, 0 < M ∧ βˆ€ x : E, β€–f xβ€– ≀ M * β€–xβ€– #align is_bounded_linear_map IsBoundedLinearMap theorem IsLinearMap.with_bound {f : E β†’ F} (hf : IsLinearMap π•œ f) (M : ℝ) (h : βˆ€ x : E, β€–f xβ€– ≀ M * β€–xβ€–) : IsBoundedLinearMap π•œ f := ⟨hf, by_cases (fun (this : M ≀ 0) => ⟨1, zero_lt_one, fun x => (h x).trans <| mul_le_mul_of_nonneg_right (this.trans zero_le_one) (norm_nonneg x)⟩) fun (this : Β¬M ≀ 0) => ⟨M, lt_of_not_ge this, h⟩⟩ #align is_linear_map.with_bound IsLinearMap.with_bound theorem ContinuousLinearMap.isBoundedLinearMap (f : E β†’L[π•œ] F) : IsBoundedLinearMap π•œ f := { f.toLinearMap.isLinear with bound := f.bound } #align continuous_linear_map.is_bounded_linear_map ContinuousLinearMap.isBoundedLinearMap section variable {ΞΉ : Type*} [Fintype ΞΉ]
Mathlib/Analysis/NormedSpace/BoundedLinearMaps.lean
217
231
theorem isBoundedLinearMap_prod_multilinear {E : ΞΉ β†’ Type*} [βˆ€ i, NormedAddCommGroup (E i)] [βˆ€ i, NormedSpace π•œ (E i)] : IsBoundedLinearMap π•œ fun p : ContinuousMultilinearMap π•œ E F Γ— ContinuousMultilinearMap π•œ E G => p.1.prod p.2 where map_add p₁ pβ‚‚ := by
ext : 1; rfl map_smul c p := by ext : 1; rfl bound := by refine ⟨1, zero_lt_one, fun p ↦ ?_⟩ rw [one_mul] apply ContinuousMultilinearMap.opNorm_le_bound _ (norm_nonneg _) _ intro m rw [ContinuousMultilinearMap.prod_apply, norm_prod_le_iff] constructor Β· exact (p.1.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_fst_le p) <| by positivity) Β· exact (p.2.le_opNorm m).trans (mul_le_mul_of_nonneg_right (norm_snd_le p) <| by positivity)
[ " (p₁ + pβ‚‚).1.prod (p₁ + pβ‚‚).2 = p₁.1.prod p₁.2 + pβ‚‚.1.prod pβ‚‚.2", " ((p₁ + pβ‚‚).1.prod (p₁ + pβ‚‚).2) x✝ = (p₁.1.prod p₁.2 + pβ‚‚.1.prod pβ‚‚.2) x✝", " (c β€’ p).1.prod (c β€’ p).2 = c β€’ p.1.prod p.2", " ((c β€’ p).1.prod (c β€’ p).2) x✝ = (c β€’ p.1.prod p.2) x✝", " βˆƒ M, 0 < M ∧ βˆ€ (x : ContinuousMultilinearMap π•œ E F Γ— Co...
[ " (p₁ + pβ‚‚).1.prod (p₁ + pβ‚‚).2 = p₁.1.prod p₁.2 + pβ‚‚.1.prod pβ‚‚.2" ]
import Mathlib.AlgebraicGeometry.OpenImmersion import Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact import Mathlib.CategoryTheory.MorphismProperty.Composition import Mathlib.RingTheory.LocalProperties universe v u open CategoryTheory namespace AlgebraicGeometry class IsClosedImmersion {X Y : Scheme} (f : X ⟢ Y) : Prop where base_closed : ClosedEmbedding f.1.base surj_on_stalks : βˆ€ x, Function.Surjective (PresheafedSpace.stalkMap f.1 x) namespace IsClosedImmersion lemma closedEmbedding {X Y : Scheme} (f : X ⟢ Y) [IsClosedImmersion f] : ClosedEmbedding f.1.base := IsClosedImmersion.base_closed lemma surjective_stalkMap {X Y : Scheme} (f : X ⟢ Y) [IsClosedImmersion f] (x : X) : Function.Surjective (PresheafedSpace.stalkMap f.1 x) := IsClosedImmersion.surj_on_stalks x instance {X Y : Scheme} (f : X ⟢ Y) [IsIso f] : IsClosedImmersion f where base_closed := Homeomorph.closedEmbedding <| TopCat.homeoOfIso (asIso f.1.base) surj_on_stalks := fun _ ↦ (ConcreteCategory.bijective_of_isIso _).2 instance : MorphismProperty.IsMultiplicative @IsClosedImmersion where id_mem _ := inferInstance comp_mem {X Y Z} f g hf hg := by refine ⟨hg.base_closed.comp hf.base_closed, fun x ↦ ?_⟩ erw [PresheafedSpace.stalkMap.comp] exact (hf.surj_on_stalks x).comp (hg.surj_on_stalks (f.1.1 x)) instance comp {X Y Z : Scheme} (f : X ⟢ Y) (g : Y ⟢ Z) [IsClosedImmersion f] [IsClosedImmersion g] : IsClosedImmersion (f ≫ g) := MorphismProperty.IsStableUnderComposition.comp_mem f g inferInstance inferInstance lemma respectsIso : MorphismProperty.RespectsIso @IsClosedImmersion := by constructor <;> intro X Y Z e f hf <;> infer_instance
Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean
79
89
theorem spec_of_surjective {R S : CommRingCat} (f : R ⟢ S) (h : Function.Surjective f) : IsClosedImmersion (Scheme.specMap f) where base_closed := PrimeSpectrum.closedEmbedding_comap_of_surjective _ _ h surj_on_stalks x := by
erw [← localRingHom_comp_stalkIso, CommRingCat.coe_comp, CommRingCat.coe_comp] apply Function.Surjective.comp (Function.Surjective.comp _ _) _ Β· exact (ConcreteCategory.bijective_of_isIso (StructureSheaf.stalkIso S x).inv).2 Β· exact surjective_localRingHom_of_surjective f h x.asIdeal Β· let g := (StructureSheaf.stalkIso ((CommRingCat.of R)) ((PrimeSpectrum.comap (CommRingCat.ofHom f)) x)).hom exact (ConcreteCategory.bijective_of_isIso g).2
[ " IsClosedImmersion (f ≫ g)", " Function.Surjective ⇑(PresheafedSpace.stalkMap (f ≫ g).val x)", " Function.Surjective ⇑(PresheafedSpace.stalkMap g.val (f.val.base x) ≫ PresheafedSpace.stalkMap f.val x)", " MorphismProperty.RespectsIso @IsClosedImmersion", " βˆ€ {X Y Z : Scheme} (e : X β‰… Y) (f : Y ⟢ Z), IsClos...
[ " IsClosedImmersion (f ≫ g)", " Function.Surjective ⇑(PresheafedSpace.stalkMap (f ≫ g).val x)", " Function.Surjective ⇑(PresheafedSpace.stalkMap g.val (f.val.base x) ≫ PresheafedSpace.stalkMap f.val x)", " MorphismProperty.RespectsIso @IsClosedImmersion", " βˆ€ {X Y Z : Scheme} (e : X β‰… Y) (f : Y ⟢ Z), IsClos...
import Mathlib.FieldTheory.PrimitiveElement import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.Galois #align_import ring_theory.norm from "leanprover-community/mathlib"@"fecd3520d2a236856f254f27714b80dcfe28ea57" universe u v w variable {R S T : Type*} [CommRing R] [Ring S] variable [Algebra R S] variable {K L F : Type*} [Field K] [Field L] [Field F] variable [Algebra K L] [Algebra K F] variable {ΞΉ : Type w} open FiniteDimensional open LinearMap open Matrix Polynomial open scoped Matrix namespace Algebra variable (R) noncomputable def norm : S β†’* R := LinearMap.det.comp (lmul R S).toRingHom.toMonoidHom #align algebra.norm Algebra.norm theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x) := rfl #align algebra.norm_apply Algebra.norm_apply theorem norm_eq_one_of_not_exists_basis (h : Β¬βˆƒ s : Finset S, Nonempty (Basis s R S)) (x : S) : norm R x = 1 := by rw [norm_apply, LinearMap.det]; split_ifs <;> trivial #align algebra.norm_eq_one_of_not_exists_basis Algebra.norm_eq_one_of_not_exists_basis variable {R} theorem norm_eq_one_of_not_module_finite (h : Β¬Module.Finite R S) (x : S) : norm R x = 1 := by refine norm_eq_one_of_not_exists_basis _ (mt ?_ h) _ rintro ⟨s, ⟨b⟩⟩ exact Module.Finite.of_basis b #align algebra.norm_eq_one_of_not_module_finite Algebra.norm_eq_one_of_not_module_finite -- Can't be a `simp` lemma because it depends on a choice of basis theorem norm_eq_matrix_det [Fintype ΞΉ] [DecidableEq ΞΉ] (b : Basis ΞΉ R S) (s : S) : norm R s = Matrix.det (Algebra.leftMulMatrix b s) := by rw [norm_apply, ← LinearMap.det_toMatrix b, ← toMatrix_lmul_eq]; rfl #align algebra.norm_eq_matrix_det Algebra.norm_eq_matrix_det theorem norm_algebraMap_of_basis [Fintype ΞΉ] (b : Basis ΞΉ R S) (x : R) : norm R (algebraMap R S x) = x ^ Fintype.card ΞΉ := by haveI := Classical.decEq ΞΉ rw [norm_apply, ← det_toMatrix b, lmul_algebraMap] convert @det_diagonal _ _ _ _ _ fun _ : ΞΉ => x Β· ext (i j); rw [toMatrix_lsmul] Β· rw [Finset.prod_const, Finset.card_univ] #align algebra.norm_algebra_map_of_basis Algebra.norm_algebraMap_of_basis @[simp] protected theorem norm_algebraMap {L : Type*} [Ring L] [Algebra K L] (x : K) : norm K (algebraMap K L x) = x ^ finrank K L := by by_cases H : βˆƒ s : Finset L, Nonempty (Basis s K L) Β· rw [norm_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] Β· rw [norm_eq_one_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis, pow_zero] rintro ⟨s, ⟨b⟩⟩ exact H ⟨s, ⟨b⟩⟩ #align algebra.norm_algebra_map Algebra.norm_algebraMap section EqProdRoots
Mathlib/RingTheory/Norm.lean
118
121
theorem PowerBasis.norm_gen_eq_coeff_zero_minpoly (pb : PowerBasis R S) : norm R pb.gen = (-1) ^ pb.dim * coeff (minpoly R pb.gen) 0 := by
rw [norm_eq_matrix_det pb.basis, det_eq_sign_charpoly_coeff, charpoly_leftMulMatrix, Fintype.card_fin]
[ " (norm R) x = 1", " (if H : βˆƒ s, Nonempty (Basis { x // x ∈ s } R S) then detAux (Trunc.mk β‹―.some) else 1) ((lmul R S) x) = 1", " (detAux (Trunc.mk β‹―.some)) ((lmul R S) x) = 1", " 1 ((lmul R S) x) = 1", " (βˆƒ s, Nonempty (Basis { x // x ∈ s } R S)) β†’ Module.Finite R S", " Module.Finite R S", " (norm R) ...
[ " (norm R) x = 1", " (if H : βˆƒ s, Nonempty (Basis { x // x ∈ s } R S) then detAux (Trunc.mk β‹―.some) else 1) ((lmul R S) x) = 1", " (detAux (Trunc.mk β‹―.some)) ((lmul R S) x) = 1", " 1 ((lmul R S) x) = 1", " (βˆƒ s, Nonempty (Basis { x // x ∈ s } R S)) β†’ Module.Finite R S", " Module.Finite R S", " (norm R) ...
import Batteries.Data.RBMap.Basic import Mathlib.Init.Data.Nat.Notation import Mathlib.Mathport.Rename import Mathlib.Tactic.TypeStar import Mathlib.Util.CompileInductive #align_import data.tree from "leanprover-community/mathlib"@"ed989ff568099019c6533a4d94b27d852a5710d8" inductive Tree.{u} (Ξ± : Type u) : Type u | nil : Tree Ξ± | node : Ξ± β†’ Tree Ξ± β†’ Tree Ξ± β†’ Tree Ξ± deriving DecidableEq, Repr -- Porting note: Removed `has_reflect`, added `Repr`. #align tree Tree namespace Tree universe u variable {Ξ± : Type u} -- Porting note: replaced with `deriving Repr` which builds a better instance anyway #noalign tree.repr instance : Inhabited (Tree Ξ±) := ⟨nil⟩ open Batteries (RBNode) def ofRBNode : RBNode Ξ± β†’ Tree Ξ± | RBNode.nil => nil | RBNode.node _color l key r => node key (ofRBNode l) (ofRBNode r) #align tree.of_rbnode Tree.ofRBNode def map {Ξ²} (f : Ξ± β†’ Ξ²) : Tree Ξ± β†’ Tree Ξ² | nil => nil | node a l r => node (f a) (map f l) (map f r) #align tree.map Tree.map @[simp] def numNodes : Tree Ξ± β†’ β„• | nil => 0 | node _ a b => a.numNodes + b.numNodes + 1 #align tree.num_nodes Tree.numNodes @[simp] def numLeaves : Tree Ξ± β†’ β„• | nil => 1 | node _ a b => a.numLeaves + b.numLeaves #align tree.num_leaves Tree.numLeaves @[simp] def height : Tree Ξ± β†’ β„• | nil => 0 | node _ a b => max a.height b.height + 1 #align tree.height Tree.height theorem numLeaves_eq_numNodes_succ (x : Tree Ξ±) : x.numLeaves = x.numNodes + 1 := by induction x <;> simp [*, Nat.add_comm, Nat.add_assoc, Nat.add_left_comm] #align tree.num_leaves_eq_num_nodes_succ Tree.numLeaves_eq_numNodes_succ
Mathlib/Data/Tree/Basic.lean
94
96
theorem numLeaves_pos (x : Tree Ξ±) : 0 < x.numLeaves := by
rw [numLeaves_eq_numNodes_succ] exact x.numNodes.zero_lt_succ
[ " x.numLeaves = x.numNodes + 1", " nil.numLeaves = nil.numNodes + 1", " (node a✝² a✝¹ a✝).numLeaves = (node a✝² a✝¹ a✝).numNodes + 1", " 0 < x.numLeaves", " 0 < x.numNodes + 1" ]
[ " x.numLeaves = x.numNodes + 1", " nil.numLeaves = nil.numNodes + 1", " (node a✝² a✝¹ a✝).numLeaves = (node a✝² a✝¹ a✝).numNodes + 1", " 0 < x.numLeaves" ]
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Mul import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w noncomputable section open scoped Classical Topology Filter ENNReal open Filter Asymptotics Set open ContinuousLinearMap (smulRight smulRight_one_eq_iff) variable {π•œ : Type u} [NontriviallyNormedField π•œ] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {f fβ‚€ f₁ g : π•œ β†’ F} variable {f' fβ‚€' f₁' g' : F} variable {x : π•œ} variable {s t : Set π•œ} variable {L L₁ Lβ‚‚ : Filter π•œ} section SMul variable {π•œ' : Type*} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] [NormedSpace π•œ' F] [IsScalarTower π•œ π•œ' F] {c : π•œ β†’ π•œ'} {c' : π•œ'}
Mathlib/Analysis/Calculus/Deriv/Mul.lean
87
89
theorem HasDerivWithinAt.smul (hc : HasDerivWithinAt c c' s x) (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (fun y => c y β€’ f y) (c x β€’ f' + c' β€’ f x) s x := by
simpa using (HasFDerivWithinAt.smul hc hf).hasDerivWithinAt
[ " HasDerivWithinAt (fun y => c y β€’ f y) (c x β€’ f' + c' β€’ f x) s x" ]
[ " HasDerivWithinAt (fun y => c y β€’ f y) (c x β€’ f' + c' β€’ f x) s x" ]
import Mathlib.Data.Set.Lattice #align_import data.set.accumulate from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" variable {Ξ± Ξ² Ξ³ : Type*} {s : Ξ± β†’ Set Ξ²} {t : Ξ± β†’ Set Ξ³} namespace Set def Accumulate [LE Ξ±] (s : Ξ± β†’ Set Ξ²) (x : Ξ±) : Set Ξ² := ⋃ y ≀ x, s y #align set.accumulate Set.Accumulate theorem accumulate_def [LE Ξ±] {x : Ξ±} : Accumulate s x = ⋃ y ≀ x, s y := rfl #align set.accumulate_def Set.accumulate_def @[simp] theorem mem_accumulate [LE Ξ±] {x : Ξ±} {z : Ξ²} : z ∈ Accumulate s x ↔ βˆƒ y ≀ x, z ∈ s y := by simp_rw [accumulate_def, mem_iUnionβ‚‚, exists_prop] #align set.mem_accumulate Set.mem_accumulate theorem subset_accumulate [Preorder Ξ±] {x : Ξ±} : s x βŠ† Accumulate s x := fun _ => mem_biUnion le_rfl #align set.subset_accumulate Set.subset_accumulate theorem accumulate_subset_iUnion [Preorder Ξ±] (x : Ξ±) : Accumulate s x βŠ† ⋃ i, s i := (biUnion_subset_biUnion_left (subset_univ _)).trans_eq (biUnion_univ _) theorem monotone_accumulate [Preorder Ξ±] : Monotone (Accumulate s) := fun _ _ hxy => biUnion_subset_biUnion_left fun _ hz => le_trans hz hxy #align set.monotone_accumulate Set.monotone_accumulate @[gcongr] theorem accumulate_subset_accumulate [Preorder Ξ±] {x y} (h : x ≀ y) : Accumulate s x βŠ† Accumulate s y := monotone_accumulate h theorem biUnion_accumulate [Preorder Ξ±] (x : Ξ±) : ⋃ y ≀ x, Accumulate s y = ⋃ y ≀ x, s y := by apply Subset.antisymm Β· exact iUnionβ‚‚_subset fun y hy => monotone_accumulate hy Β· exact iUnionβ‚‚_mono fun y _ => subset_accumulate #align set.bUnion_accumulate Set.biUnion_accumulate
Mathlib/Data/Set/Accumulate.lean
56
61
theorem iUnion_accumulate [Preorder Ξ±] : ⋃ x, Accumulate s x = ⋃ x, s x := by
apply Subset.antisymm · simp only [subset_def, mem_iUnion, exists_imp, mem_accumulate] intro z x x' ⟨_, hz⟩ exact ⟨x', hz⟩ · exact iUnion_mono fun i => subset_accumulate
[ " z ∈ Accumulate s x ↔ βˆƒ y ≀ x, z ∈ s y", " ⋃ y, ⋃ (_ : y ≀ x), Accumulate s y = ⋃ y, ⋃ (_ : y ≀ x), s y", " ⋃ y, ⋃ (_ : y ≀ x), Accumulate s y βŠ† ⋃ y, ⋃ (_ : y ≀ x), s y", " ⋃ y, ⋃ (_ : y ≀ x), s y βŠ† ⋃ y, ⋃ (_ : y ≀ x), Accumulate s y", " ⋃ x, Accumulate s x = ⋃ x, s x", " ⋃ x, Accumulate s x βŠ† ⋃ x, s x",...
[ " z ∈ Accumulate s x ↔ βˆƒ y ≀ x, z ∈ s y", " ⋃ y, ⋃ (_ : y ≀ x), Accumulate s y = ⋃ y, ⋃ (_ : y ≀ x), s y", " ⋃ y, ⋃ (_ : y ≀ x), Accumulate s y βŠ† ⋃ y, ⋃ (_ : y ≀ x), s y", " ⋃ y, ⋃ (_ : y ≀ x), s y βŠ† ⋃ y, ⋃ (_ : y ≀ x), Accumulate s y", " ⋃ x, Accumulate s x = ⋃ x, s x" ]
import Mathlib.CategoryTheory.EpiMono import Mathlib.CategoryTheory.Functor.FullyFaithful import Mathlib.Tactic.PPWithUniv import Mathlib.Data.Set.Defs #align_import category_theory.types from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace CategoryTheory -- morphism levels before object levels. See note [CategoryTheory universes]. universe v v' w u u' @[to_additive existing CategoryTheory.types] instance types : LargeCategory (Type u) where Hom a b := a β†’ b id a := id comp f g := g ∘ f #align category_theory.types CategoryTheory.types theorem types_hom {Ξ± Ξ² : Type u} : (Ξ± ⟢ Ξ²) = (Ξ± β†’ Ξ²) := rfl #align category_theory.types_hom CategoryTheory.types_hom -- porting note (#10688): this lemma was not here in Lean 3. Lean 3 `ext` would solve this goal -- because of its "if all else fails, apply all `ext` lemmas" policy, -- which apparently we want to move away from. @[ext] theorem types_ext {Ξ± Ξ² : Type u} (f g : Ξ± ⟢ Ξ²) (h : βˆ€ a : Ξ±, f a = g a) : f = g := by funext x exact h x theorem types_id (X : Type u) : πŸ™ X = id := rfl #align category_theory.types_id CategoryTheory.types_id theorem types_comp {X Y Z : Type u} (f : X ⟢ Y) (g : Y ⟢ Z) : f ≫ g = g ∘ f := rfl #align category_theory.types_comp CategoryTheory.types_comp @[simp] theorem types_id_apply (X : Type u) (x : X) : (πŸ™ X : X β†’ X) x = x := rfl #align category_theory.types_id_apply CategoryTheory.types_id_apply @[simp] theorem types_comp_apply {X Y Z : Type u} (f : X ⟢ Y) (g : Y ⟢ Z) (x : X) : (f ≫ g) x = g (f x) := rfl #align category_theory.types_comp_apply CategoryTheory.types_comp_apply @[simp] theorem hom_inv_id_apply {X Y : Type u} (f : X β‰… Y) (x : X) : f.inv (f.hom x) = x := congr_fun f.hom_inv_id x #align category_theory.hom_inv_id_apply CategoryTheory.hom_inv_id_apply @[simp] theorem inv_hom_id_apply {X Y : Type u} (f : X β‰… Y) (y : Y) : f.hom (f.inv y) = y := congr_fun f.inv_hom_id y #align category_theory.inv_hom_id_apply CategoryTheory.inv_hom_id_apply -- Unfortunately without this wrapper we can't use `CategoryTheory` idioms, such as `IsIso f`. abbrev asHom {Ξ± Ξ² : Type u} (f : Ξ± β†’ Ξ²) : Ξ± ⟢ Ξ² := f #align category_theory.as_hom CategoryTheory.asHom @[inherit_doc] scoped notation "β†Ύ" f:200 => CategoryTheory.asHom f section -- We verify the expected type checking behaviour of `asHom` variable (Ξ± Ξ² Ξ³ : Type u) (f : Ξ± β†’ Ξ²) (g : Ξ² β†’ Ξ³) example : Ξ± β†’ Ξ³ := β†Ύf ≫ β†Ύg example [IsIso (β†Ύf)] : Mono (β†Ύf) := by infer_instance example [IsIso (β†Ύf)] : β†Ύf ≫ inv (β†Ύf) = πŸ™ Ξ± := by simp end namespace FunctorToTypes variable {C : Type u} [Category.{v} C] (F G H : C β₯€ Type w) {X Y Z : C} variable (Οƒ : F ⟢ G) (Ο„ : G ⟢ H) @[simp] theorem map_comp_apply (f : X ⟢ Y) (g : Y ⟢ Z) (a : F.obj X) : (F.map (f ≫ g)) a = (F.map g) ((F.map f) a) := by simp [types_comp] #align category_theory.functor_to_types.map_comp_apply CategoryTheory.FunctorToTypes.map_comp_apply @[simp] theorem map_id_apply (a : F.obj X) : (F.map (πŸ™ X)) a = a := by simp [types_id] #align category_theory.functor_to_types.map_id_apply CategoryTheory.FunctorToTypes.map_id_apply theorem naturality (f : X ⟢ Y) (x : F.obj X) : Οƒ.app Y ((F.map f) x) = (G.map f) (Οƒ.app X x) := congr_fun (Οƒ.naturality f) x #align category_theory.functor_to_types.naturality CategoryTheory.FunctorToTypes.naturality @[simp] theorem comp (x : F.obj X) : (Οƒ ≫ Ο„).app X x = Ο„.app X (Οƒ.app X x) := rfl #align category_theory.functor_to_types.comp CategoryTheory.FunctorToTypes.comp @[simp]
Mathlib/CategoryTheory/Types.lean
170
172
theorem eqToHom_map_comp_apply (p : X = Y) (q : Y = Z) (x : F.obj X) : F.map (eqToHom q) (F.map (eqToHom p) x) = F.map (eqToHom <| p.trans q) x := by
aesop_cat
[ " f = g", " f x = g x", " Mono (β†Ύf)", " β†Ύf ≫ inv (β†Ύf) = πŸ™ Ξ±", " F.map (f ≫ g) a = F.map g (F.map f a)", " F.map (πŸ™ X) a = a", " F.map (eqToHom q) (F.map (eqToHom p) x) = F.map (eqToHom β‹―) x" ]
[ " f = g", " f x = g x", " Mono (β†Ύf)", " β†Ύf ≫ inv (β†Ύf) = πŸ™ Ξ±", " F.map (f ≫ g) a = F.map g (F.map f a)", " F.map (πŸ™ X) a = a", " F.map (eqToHom q) (F.map (eqToHom p) x) = F.map (eqToHom β‹―) x" ]
import Mathlib.Data.Matrix.Basis import Mathlib.RingTheory.TensorProduct.Basic #align_import ring_theory.matrix_algebra from "leanprover-community/mathlib"@"6c351a8fb9b06e5a542fdf427bfb9f46724f9453" suppress_compilation universe u v w open TensorProduct open TensorProduct open Algebra.TensorProduct open Matrix variable {R : Type u} [CommSemiring R] variable {A : Type v} [Semiring A] [Algebra R A] variable {n : Type w} variable (R A n) namespace MatrixEquivTensor def toFunBilinear : A β†’β‚—[R] Matrix n n R β†’β‚—[R] Matrix n n A := (Algebra.lsmul R R (Matrix n n A)).toLinearMap.complβ‚‚ (Algebra.linearMap R A).mapMatrix #align matrix_equiv_tensor.to_fun_bilinear MatrixEquivTensor.toFunBilinear @[simp] theorem toFunBilinear_apply (a : A) (m : Matrix n n R) : toFunBilinear R A n a m = a β€’ m.map (algebraMap R A) := rfl #align matrix_equiv_tensor.to_fun_bilinear_apply MatrixEquivTensor.toFunBilinear_apply def toFunLinear : A βŠ—[R] Matrix n n R β†’β‚—[R] Matrix n n A := TensorProduct.lift (toFunBilinear R A n) #align matrix_equiv_tensor.to_fun_linear MatrixEquivTensor.toFunLinear variable [DecidableEq n] [Fintype n] def toFunAlgHom : A βŠ—[R] Matrix n n R →ₐ[R] Matrix n n A := algHomOfLinearMapTensorProduct (toFunLinear R A n) (by intros simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_mul] ext dsimp simp_rw [Matrix.mul_apply, Matrix.smul_apply, Matrix.map_apply, smul_eq_mul, Finset.mul_sum, _root_.mul_assoc, Algebra.left_comm]) (by simp_rw [toFunLinear, lift.tmul, toFunBilinear_apply, Matrix.map_one (algebraMap R A) (map_zero _) (map_one _), one_smul]) #align matrix_equiv_tensor.to_fun_alg_hom MatrixEquivTensor.toFunAlgHom @[simp] theorem toFunAlgHom_apply (a : A) (m : Matrix n n R) : toFunAlgHom R A n (a βŠ—β‚œ m) = a β€’ m.map (algebraMap R A) := rfl #align matrix_equiv_tensor.to_fun_alg_hom_apply MatrixEquivTensor.toFunAlgHom_apply def invFun (M : Matrix n n A) : A βŠ—[R] Matrix n n R := βˆ‘ p : n Γ— n, M p.1 p.2 βŠ—β‚œ stdBasisMatrix p.1 p.2 1 #align matrix_equiv_tensor.inv_fun MatrixEquivTensor.invFun @[simp] theorem invFun_zero : invFun R A n 0 = 0 := by simp [invFun] #align matrix_equiv_tensor.inv_fun_zero MatrixEquivTensor.invFun_zero @[simp] theorem invFun_add (M N : Matrix n n A) : invFun R A n (M + N) = invFun R A n M + invFun R A n N := by simp [invFun, add_tmul, Finset.sum_add_distrib] #align matrix_equiv_tensor.inv_fun_add MatrixEquivTensor.invFun_add @[simp] theorem invFun_smul (a : A) (M : Matrix n n A) : invFun R A n (a β€’ M) = a βŠ—β‚œ 1 * invFun R A n M := by simp [invFun, Finset.mul_sum] #align matrix_equiv_tensor.inv_fun_smul MatrixEquivTensor.invFun_smul @[simp] theorem invFun_algebraMap (M : Matrix n n R) : invFun R A n (M.map (algebraMap R A)) = 1 βŠ—β‚œ M := by dsimp [invFun] simp only [Algebra.algebraMap_eq_smul_one, smul_tmul, ← tmul_sum, mul_boole] congr conv_rhs => rw [matrix_eq_sum_std_basis M] convert Finset.sum_product (Ξ² := Matrix n n R); simp #align matrix_equiv_tensor.inv_fun_algebra_map MatrixEquivTensor.invFun_algebraMap
Mathlib/RingTheory/MatrixAlgebra.lean
113
121
theorem right_inv (M : Matrix n n A) : (toFunAlgHom R A n) (invFun R A n M) = M := by
simp only [invFun, AlgHom.map_sum, stdBasisMatrix, apply_ite ↑(algebraMap R A), smul_eq_mul, mul_boole, toFunAlgHom_apply, RingHom.map_zero, RingHom.map_one, Matrix.map_apply, Pi.smul_def] convert Finset.sum_product (Ξ² := Matrix n n A) conv_lhs => rw [matrix_eq_sum_std_basis M] refine Finset.sum_congr rfl fun i _ => Finset.sum_congr rfl fun j _ => Matrix.ext fun a b => ?_ simp only [stdBasisMatrix, smul_apply, Matrix.map_apply] split_ifs <;> aesop
[ " βˆ€ (a₁ aβ‚‚ : A) (b₁ bβ‚‚ : Matrix n n R),\n (toFunLinear R A n) ((a₁ * aβ‚‚) βŠ—β‚œ[R] (b₁ * bβ‚‚)) =\n (toFunLinear R A n) (a₁ βŠ—β‚œ[R] b₁) * (toFunLinear R A n) (aβ‚‚ βŠ—β‚œ[R] bβ‚‚)", " (toFunLinear R A n) ((aβ‚βœ * aβ‚‚βœ) βŠ—β‚œ[R] (bβ‚βœ * bβ‚‚βœ)) =\n (toFunLinear R A n) (aβ‚βœ βŠ—β‚œ[R] bβ‚βœ) * (toFunLinear R A n) (aβ‚‚βœ βŠ—β‚œ[R] bβ‚‚βœ)", "...
[ " βˆ€ (a₁ aβ‚‚ : A) (b₁ bβ‚‚ : Matrix n n R),\n (toFunLinear R A n) ((a₁ * aβ‚‚) βŠ—β‚œ[R] (b₁ * bβ‚‚)) =\n (toFunLinear R A n) (a₁ βŠ—β‚œ[R] b₁) * (toFunLinear R A n) (aβ‚‚ βŠ—β‚œ[R] bβ‚‚)", " (toFunLinear R A n) ((aβ‚βœ * aβ‚‚βœ) βŠ—β‚œ[R] (bβ‚βœ * bβ‚‚βœ)) =\n (toFunLinear R A n) (aβ‚βœ βŠ—β‚œ[R] bβ‚βœ) * (toFunLinear R A n) (aβ‚‚βœ βŠ—β‚œ[R] bβ‚‚βœ)", "...
import Mathlib.Tactic.Linarith.Datatypes import Mathlib.Tactic.Zify import Mathlib.Tactic.CancelDenoms.Core import Batteries.Data.RBMap.Basic import Mathlib.Data.HashMap import Mathlib.Control.Basic set_option autoImplicit true namespace Linarith open Lean hiding Rat open Elab Tactic Meta open Qq partial def splitConjunctions : Preprocessor where name := "split conjunctions" transform := aux where aux (proof : Expr) : MetaM (List Expr) := do match (← instantiateMVars (← inferType proof)).getAppFnArgs with | (``And, #[_, _]) => pure ((← aux (← mkAppM ``And.left #[proof])) ++ (← aux (← mkAppM ``And.right #[proof]))) | _ => pure [proof] partial def filterComparisons : Preprocessor where name := "filter terms that are not proofs of comparisons" transform h := do let tp ← whnfR (← instantiateMVars (← inferType h)) if (← isProp tp) && (← aux tp) then pure [h] else pure [] where aux (e : Expr) : MetaM Bool := do match e.getAppFnArgs with | (``Eq, _) | (``LE.le, _) | (``LT.lt, _) => pure true | (``Not, #[e]) => match (← whnfR e).getAppFnArgs with | (``LE.le, _) | (``LT.lt, _) => pure true | _ => pure false | _ => pure false section cancelDenoms
Mathlib/Tactic/Linarith/Preprocessing.lean
273
273
theorem without_one_mul [MulOneClass M] {a b : M} (h : 1 * a = b) : a = b := by
rwa [one_mul] at h
[ " a = b" ]
[ " a = b" ]
import Mathlib.Order.Filter.Cofinite import Mathlib.Order.Filter.CountableInter import Mathlib.Order.Filter.CardinalInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.Order.Filter.Bases open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} variable {c : Cardinal.{u}} {hreg : c.IsRegular} variable {l : Filter Ξ±} namespace Filter variable (Ξ±) in def cocardinal (hreg : c.IsRegular) : Filter Ξ± := by apply ofCardinalUnion {s | Cardinal.mk s < c} (lt_of_lt_of_le (nat_lt_aleph0 2) hreg.aleph0_le) Β· refine fun s hS hSc ↦ lt_of_le_of_lt (mk_sUnion_le _) <| mul_lt_of_lt hreg.aleph0_le hS ?_ exact iSup_lt_of_isRegular hreg hS fun i ↦ hSc i i.property Β· exact fun _ hSc _ ht ↦ lt_of_le_of_lt (mk_le_mk_of_subset ht) hSc @[simp] theorem mem_cocardinal {s : Set Ξ±} : s ∈ cocardinal Ξ± hreg ↔ Cardinal.mk (sᢜ : Set Ξ±) < c := Iff.rfl @[simp] lemma cocardinal_aleph0_eq_cofinite : cocardinal (Ξ± := Ξ±) isRegular_aleph0 = cofinite := by aesop instance instCardinalInterFilter_cocardinal : CardinalInterFilter (cocardinal (Ξ± := Ξ±) hreg) c where cardinal_sInter_mem S hS hSs := by rw [mem_cocardinal, Set.compl_sInter] apply lt_of_le_of_lt (mk_sUnion_le _) apply mul_lt_of_lt hreg.aleph0_le (lt_of_le_of_lt mk_image_le hS) apply iSup_lt_of_isRegular hreg <| lt_of_le_of_lt mk_image_le hS intro i aesop @[simp] theorem eventually_cocardinal {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in cocardinal Ξ± hreg, p x) ↔ #{ x | Β¬p x } < c := Iff.rfl theorem hasBasis_cocardinal : HasBasis (cocardinal Ξ± hreg) {s : Set Ξ± | #s < c} compl := ⟨fun s => ⟨fun h => ⟨sᢜ, h, (compl_compl s).subset⟩, fun ⟨_t, htf, hts⟩ => by have : #↑sᢜ < c := by apply lt_of_le_of_lt _ htf rw [compl_subset_comm] at hts apply Cardinal.mk_le_mk_of_subset hts simp_all only [mem_cocardinal] ⟩⟩
Mathlib/Order/Filter/Cocardinal.lean
70
72
theorem frequently_cocardinal {p : Ξ± β†’ Prop} : (βˆƒαΆ  x in cocardinal Ξ± hreg, p x) ↔ c ≀ # { x | p x } := by
simp only [Filter.Frequently, eventually_cocardinal, not_not,coe_setOf, not_lt]
[ " Filter Ξ±", " βˆ€ (S : Set (Set Ξ±)), #↑S < c β†’ (βˆ€ s ∈ S, s ∈ {s | #↑s < c}) β†’ ⋃₀ S ∈ {s | #↑s < c}", " ⨆ s_1, #↑↑s_1 < c", " βˆ€ t ∈ {s | #↑s < c}, βˆ€ s βŠ† t, s ∈ {s | #↑s < c}", " cocardinal Ξ± isRegular_aleph0 = cofinite", " β‹‚β‚€ S ∈ cocardinal Ξ± hreg", " #↑(⋃₀ (compl '' S)) < c", " #↑(compl '' S) * ⨆ s, #↑...
[ " Filter Ξ±", " βˆ€ (S : Set (Set Ξ±)), #↑S < c β†’ (βˆ€ s ∈ S, s ∈ {s | #↑s < c}) β†’ ⋃₀ S ∈ {s | #↑s < c}", " ⨆ s_1, #↑↑s_1 < c", " βˆ€ t ∈ {s | #↑s < c}, βˆ€ s βŠ† t, s ∈ {s | #↑s < c}", " cocardinal Ξ± isRegular_aleph0 = cofinite", " β‹‚β‚€ S ∈ cocardinal Ξ± hreg", " #↑(⋃₀ (compl '' S)) < c", " #↑(compl '' S) * ⨆ s, #↑...
import Batteries.Data.Char import Batteries.Data.List.Lemmas import Batteries.Data.String.Basic import Batteries.Tactic.Lint.Misc import Batteries.Tactic.SeqFocus namespace String attribute [ext] ext theorem lt_trans {s₁ sβ‚‚ s₃ : String} : s₁ < sβ‚‚ β†’ sβ‚‚ < s₃ β†’ s₁ < s₃ := List.lt_trans' (Ξ± := Char) Nat.lt_trans (fun h1 h2 => Nat.not_lt.2 <| Nat.le_trans (Nat.not_lt.1 h2) (Nat.not_lt.1 h1)) theorem lt_antisymm {s₁ sβ‚‚ : String} (h₁ : Β¬s₁ < sβ‚‚) (hβ‚‚ : Β¬sβ‚‚ < s₁) : s₁ = sβ‚‚ := ext <| List.lt_antisymm' (Ξ± := Char) (fun h1 h2 => Char.le_antisymm (Nat.not_lt.1 h2) (Nat.not_lt.1 h1)) h₁ hβ‚‚ instance : Batteries.TransOrd String := .compareOfLessAndEq String.lt_irrefl String.lt_trans String.lt_antisymm instance : Batteries.LTOrd String := .compareOfLessAndEq String.lt_irrefl String.lt_trans String.lt_antisymm instance : Batteries.BEqOrd String := .compareOfLessAndEq String.lt_irrefl @[simp] theorem mk_length (s : List Char) : (String.mk s).length = s.length := rfl attribute [simp] toList -- prefer `String.data` over `String.toList` in lemmas private theorem add_csize_pos : 0 < i + csize c := Nat.add_pos_right _ (csize_pos c) private theorem ne_add_csize_add_self : i β‰  n + csize c + i := Nat.ne_of_lt (Nat.lt_add_of_pos_left add_csize_pos) private theorem ne_self_add_add_csize : i β‰  i + (n + csize c) := Nat.ne_of_lt (Nat.lt_add_of_pos_right add_csize_pos) @[inline] def utf8Len : List Char β†’ Nat := utf8ByteSize.go @[simp] theorem utf8ByteSize.go_eq : utf8ByteSize.go = utf8Len := rfl @[simp] theorem utf8ByteSize_mk (cs) : utf8ByteSize ⟨cs⟩ = utf8Len cs := rfl @[simp] theorem utf8Len_nil : utf8Len [] = 0 := rfl @[simp] theorem utf8Len_cons (c cs) : utf8Len (c :: cs) = utf8Len cs + csize c := rfl @[simp] theorem utf8Len_append (cs₁ csβ‚‚) : utf8Len (cs₁ ++ csβ‚‚) = utf8Len cs₁ + utf8Len csβ‚‚ := by induction cs₁ <;> simp [*, Nat.add_right_comm] @[simp] theorem utf8Len_reverseAux (cs₁ csβ‚‚) : utf8Len (cs₁.reverseAux csβ‚‚) = utf8Len cs₁ + utf8Len csβ‚‚ := by induction cs₁ generalizing csβ‚‚ <;> simp [*, ← Nat.add_assoc, Nat.add_right_comm] @[simp] theorem utf8Len_reverse (cs) : utf8Len cs.reverse = utf8Len cs := utf8Len_reverseAux .. @[simp] theorem utf8Len_eq_zero : utf8Len l = 0 ↔ l = [] := by cases l <;> simp [Nat.ne_of_gt add_csize_pos] section open List theorem utf8Len_le_of_sublist : βˆ€ {cs₁ csβ‚‚}, cs₁ <+ csβ‚‚ β†’ utf8Len cs₁ ≀ utf8Len csβ‚‚ | _, _, .slnil => Nat.le_refl _ | _, _, .cons _ h => Nat.le_trans (utf8Len_le_of_sublist h) (Nat.le_add_right ..) | _, _, .consβ‚‚ _ h => Nat.add_le_add_right (utf8Len_le_of_sublist h) _ theorem utf8Len_le_of_infix (h : cs₁ <:+: csβ‚‚) : utf8Len cs₁ ≀ utf8Len csβ‚‚ := utf8Len_le_of_sublist h.sublist theorem utf8Len_le_of_suffix (h : cs₁ <:+ csβ‚‚) : utf8Len cs₁ ≀ utf8Len csβ‚‚ := utf8Len_le_of_sublist h.sublist theorem utf8Len_le_of_prefix (h : cs₁ <+: csβ‚‚) : utf8Len cs₁ ≀ utf8Len csβ‚‚ := utf8Len_le_of_sublist h.sublist end @[simp] theorem endPos_eq (cs : List Char) : endPos ⟨cs⟩ = ⟨utf8Len cs⟩ := rfl theorem endPos_eq_zero : βˆ€ (s : String), endPos s = 0 ↔ s = "" | ⟨_⟩ => Pos.ext_iff.trans <| utf8Len_eq_zero.trans ext_iff.symm theorem isEmpty_iff (s : String) : isEmpty s ↔ s = "" := (beq_iff_eq ..).trans (endPos_eq_zero _) def utf8InductionOn {motive : List Char β†’ Pos β†’ Sort u} (s : List Char) (i p : Pos) (nil : βˆ€ i, motive [] i) (eq : βˆ€ c cs, motive (c :: cs) p) (ind : βˆ€ (c : Char) cs i, i β‰  p β†’ motive cs (i + c) β†’ motive (c :: cs) i) : motive s i := match s with | [] => nil i | c::cs => if h : i = p then h β–Έ eq c cs else ind c cs i h (utf8InductionOn cs (i + c) p nil eq ind)
.lake/packages/batteries/Batteries/Data/String/Lemmas.lean
134
143
theorem utf8GetAux_add_right_cancel (s : List Char) (i p n : Nat) : utf8GetAux s ⟨i + n⟩ ⟨p + n⟩ = utf8GetAux s ⟨i⟩ ⟨p⟩ := by
apply utf8InductionOn s ⟨i⟩ ⟨p⟩ (motive := fun s i => utf8GetAux s ⟨i.byteIdx + n⟩ ⟨p + n⟩ = utf8GetAux s i ⟨p⟩) <;> simp [utf8GetAux] intro c cs ⟨i⟩ h ih simp [Pos.ext_iff, Pos.addChar_eq] at h ⊒ simp [Nat.add_right_cancel_iff, h] rw [Nat.add_right_comm] exact ih
[ " utf8Len (cs₁ ++ csβ‚‚) = utf8Len cs₁ + utf8Len csβ‚‚", " utf8Len ([] ++ csβ‚‚) = utf8Len [] + utf8Len csβ‚‚", " utf8Len (head✝ :: tail✝ ++ csβ‚‚) = utf8Len (head✝ :: tail✝) + utf8Len csβ‚‚", " utf8Len (cs₁.reverseAux csβ‚‚) = utf8Len cs₁ + utf8Len csβ‚‚", " utf8Len ([].reverseAux csβ‚‚) = utf8Len [] + utf8Len csβ‚‚", " utf...
[ " utf8Len (cs₁ ++ csβ‚‚) = utf8Len cs₁ + utf8Len csβ‚‚", " utf8Len ([] ++ csβ‚‚) = utf8Len [] + utf8Len csβ‚‚", " utf8Len (head✝ :: tail✝ ++ csβ‚‚) = utf8Len (head✝ :: tail✝) + utf8Len csβ‚‚", " utf8Len (cs₁.reverseAux csβ‚‚) = utf8Len cs₁ + utf8Len csβ‚‚", " utf8Len ([].reverseAux csβ‚‚) = utf8Len [] + utf8Len csβ‚‚", " utf...
import Batteries.Data.Array.Lemmas namespace ByteArray @[ext] theorem ext : {a b : ByteArray} β†’ a.data = b.data β†’ a = b | ⟨_⟩, ⟨_⟩, rfl => rfl theorem getElem_eq_data_getElem (a : ByteArray) (h : i < a.size) : a[i] = a.data[i] := rfl @[simp] theorem uset_eq_set (a : ByteArray) {i : USize} (h : i.toNat < a.size) (v : UInt8) : a.uset i v h = a.set ⟨i.toNat, h⟩ v := rfl @[simp] theorem mkEmpty_data (cap) : (mkEmpty cap).data = #[] := rfl @[simp] theorem empty_data : empty.data = #[] := rfl @[simp] theorem size_empty : empty.size = 0 := rfl @[simp] theorem push_data (a : ByteArray) (b : UInt8) : (a.push b).data = a.data.push b := rfl @[simp] theorem size_push (a : ByteArray) (b : UInt8) : (a.push b).size = a.size + 1 := Array.size_push .. @[simp] theorem get_push_eq (a : ByteArray) (x : UInt8) : (a.push x)[a.size] = x := Array.get_push_eq .. theorem get_push_lt (a : ByteArray) (x : UInt8) (i : Nat) (h : i < a.size) : (a.push x)[i]'(size_push .. β–Έ Nat.lt_succ_of_lt h) = a[i] := Array.get_push_lt .. @[simp] theorem set_data (a : ByteArray) (i : Fin a.size) (v : UInt8) : (a.set i v).data = a.data.set i v := rfl @[simp] theorem size_set (a : ByteArray) (i : Fin a.size) (v : UInt8) : (a.set i v).size = a.size := Array.size_set .. @[simp] theorem get_set_eq (a : ByteArray) (i : Fin a.size) (v : UInt8) : (a.set i v)[i.val] = v := Array.get_set_eq .. theorem get_set_ne (a : ByteArray) (i : Fin a.size) (v : UInt8) (hj : j < a.size) (h : i.val β‰  j) : (a.set i v)[j]'(a.size_set .. β–Έ hj) = a[j] := Array.get_set_ne (h:=h) .. theorem set_set (a : ByteArray) (i : Fin a.size) (v v' : UInt8) : (a.set i v).set ⟨i, by simp [i.2]⟩ v' = a.set i v' := ByteArray.ext <| Array.set_set .. @[simp] theorem copySlice_data (a i b j len exact) : (copySlice a i b j len exact).data = b.data.extract 0 j ++ a.data.extract i (i + len) ++ b.data.extract (j + min len (a.data.size - i)) b.data.size := rfl @[simp] theorem append_eq (a b) : ByteArray.append a b = a ++ b := rfl @[simp] theorem append_data (a b : ByteArray) : (a ++ b).data = a.data ++ b.data := by rw [←append_eq]; simp [ByteArray.append, size] rw [Array.extract_empty_of_stop_le_start (h:=Nat.le_add_right ..), Array.append_nil] theorem size_append (a b : ByteArray) : (a ++ b).size = a.size + b.size := by simp only [size, append_eq, append_data]; exact Array.size_append .. theorem get_append_left {a b : ByteArray} (hlt : i < a.size) (h : i < (a ++ b).size := size_append .. β–Έ Nat.lt_of_lt_of_le hlt (Nat.le_add_right ..)) : (a ++ b)[i] = a[i] := by simp [getElem_eq_data_getElem]; exact Array.get_append_left hlt
.lake/packages/batteries/Batteries/Data/ByteArray.lean
84
87
theorem get_append_right {a b : ByteArray} (hle : a.size ≀ i) (h : i < (a ++ b).size) (h' : i - a.size < b.size := Nat.sub_lt_left_of_lt_add hle (size_append .. β–Έ h)) : (a ++ b)[i] = b[i - a.size] := by
simp [getElem_eq_data_getElem]; exact Array.get_append_right hle
[ " ↑i < (a.set i v).size", " (a ++ b).data = a.data ++ b.data", " (a.append b).data = a.data ++ b.data", " a.data ++ b.data ++ a.data.extract (a.data.size + b.data.size) a.data.size = a.data ++ b.data", " (a ++ b).size = a.size + b.size", " (a.data ++ b.data).size = a.data.size + b.data.size", " (a ++ b)...
[ " ↑i < (a.set i v).size", " (a ++ b).data = a.data ++ b.data", " (a.append b).data = a.data ++ b.data", " a.data ++ b.data ++ a.data.extract (a.data.size + b.data.size) a.data.size = a.data ++ b.data", " (a ++ b).size = a.size + b.size", " (a.data ++ b.data).size = a.data.size + b.data.size", " (a ++ b)...
import Mathlib.Topology.Category.TopCat.Limits.Pullbacks import Mathlib.Geometry.RingedSpace.LocallyRingedSpace #align_import algebraic_geometry.open_immersion.basic from "leanprover-community/mathlib"@"533f62f4dd62a5aad24a04326e6e787c8f7e98b1" -- Porting note: due to `PresheafedSpace`, `SheafedSpace` and `LocallyRingedSpace` set_option linter.uppercaseLean3 false open TopologicalSpace CategoryTheory Opposite open CategoryTheory.Limits namespace AlgebraicGeometry universe v v₁ vβ‚‚ u variable {C : Type u} [Category.{v} C] class PresheafedSpace.IsOpenImmersion {X Y : PresheafedSpace C} (f : X ⟢ Y) : Prop where base_open : OpenEmbedding f.base c_iso : βˆ€ U : Opens X, IsIso (f.c.app (op (base_open.isOpenMap.functor.obj U))) #align algebraic_geometry.PresheafedSpace.is_open_immersion AlgebraicGeometry.PresheafedSpace.IsOpenImmersion abbrev SheafedSpace.IsOpenImmersion {X Y : SheafedSpace C} (f : X ⟢ Y) : Prop := PresheafedSpace.IsOpenImmersion f #align algebraic_geometry.SheafedSpace.is_open_immersion AlgebraicGeometry.SheafedSpace.IsOpenImmersion abbrev LocallyRingedSpace.IsOpenImmersion {X Y : LocallyRingedSpace} (f : X ⟢ Y) : Prop := SheafedSpace.IsOpenImmersion f.1 #align algebraic_geometry.LocallyRingedSpace.is_open_immersion AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion namespace PresheafedSpace.IsOpenImmersion open PresheafedSpace local notation "IsOpenImmersion" => PresheafedSpace.IsOpenImmersion attribute [instance] IsOpenImmersion.c_iso section variable {X Y : PresheafedSpace C} {f : X ⟢ Y} (H : IsOpenImmersion f) abbrev openFunctor := H.base_open.isOpenMap.functor #align algebraic_geometry.PresheafedSpace.is_open_immersion.open_functor AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.openFunctor @[simps! hom_c_app] noncomputable def isoRestrict : X β‰… Y.restrict H.base_open := PresheafedSpace.isoOfComponents (Iso.refl _) <| by symm fapply NatIso.ofComponents Β· intro U refine asIso (f.c.app (op (H.openFunctor.obj (unop U)))) β‰ͺ≫ X.presheaf.mapIso (eqToIso ?_) induction U using Opposite.rec' with | h U => ?_ cases U dsimp only [IsOpenMap.functor, Functor.op, Opens.map] congr 2 erw [Set.preimage_image_eq _ H.base_open.inj] rfl Β· intro U V i simp only [CategoryTheory.eqToIso.hom, TopCat.Presheaf.pushforwardObj_map, Category.assoc, Functor.op_map, Iso.trans_hom, asIso_hom, Functor.mapIso_hom, ← X.presheaf.map_comp] erw [f.c.naturality_assoc, ← X.presheaf.map_comp] congr 1 #align algebraic_geometry.PresheafedSpace.is_open_immersion.iso_restrict AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.isoRestrict @[simp]
Mathlib/Geometry/RingedSpace/OpenImmersion.lean
133
141
theorem isoRestrict_hom_ofRestrict : H.isoRestrict.hom ≫ Y.ofRestrict _ = f := by
-- Porting note: `ext` did not pick up `NatTrans.ext` refine PresheafedSpace.Hom.ext _ _ rfl <| NatTrans.ext _ _ <| funext fun x => ?_ simp only [isoRestrict_hom_c_app, NatTrans.comp_app, eqToHom_refl, ofRestrict_c_app, Category.assoc, whiskerRight_id'] erw [Category.comp_id, comp_c_app, f.c.naturality_assoc, ← X.presheaf.map_comp] trans f.c.app x ≫ X.presheaf.map (πŸ™ _) Β· congr 1 Β· erw [X.presheaf.map_id, Category.comp_id]
[]
[]
import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic import Mathlib.CategoryTheory.Monoidal.Functorial import Mathlib.CategoryTheory.Monoidal.Types.Basic import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.CategoryTheory.Linear.LinearFunctor #align_import algebra.category.Module.adjunctions from "leanprover-community/mathlib"@"95a87616d63b3cb49d3fe678d416fbe9c4217bf4" set_option linter.uppercaseLean3 false -- `Module` noncomputable section open CategoryTheory namespace ModuleCat universe u open scoped Classical variable (R : Type u) section variable [Ring R] @[simps] def free : Type u β₯€ ModuleCat R where obj X := ModuleCat.of R (X β†’β‚€ R) map {X Y} f := Finsupp.lmapDomain _ _ f map_id := by intros; exact Finsupp.lmapDomain_id _ _ map_comp := by intros; exact Finsupp.lmapDomain_comp _ _ _ _ #align Module.free ModuleCat.free def adj : free R ⊣ forget (ModuleCat.{u} R) := Adjunction.mkOfHomEquiv { homEquiv := fun X M => (Finsupp.lift M R X).toEquiv.symm homEquiv_naturality_left_symm := fun {_ _} M f g => Finsupp.lhom_ext' fun x => LinearMap.ext_ring (Finsupp.sum_mapDomain_index_addMonoidHom fun y => (smulAddHom R M).flip (g y)).symm } #align Module.adj ModuleCat.adj instance : (forget (ModuleCat.{u} R)).IsRightAdjoint := (adj R).isRightAdjoint end namespace Free open MonoidalCategory variable [CommRing R] attribute [local ext] TensorProduct.ext def Ξ΅ : πŸ™_ (ModuleCat.{u} R) ⟢ (free R).obj (πŸ™_ (Type u)) := Finsupp.lsingle PUnit.unit #align Module.free.Ξ΅ ModuleCat.Free.Ξ΅ -- This lemma has always been bad, but lean4#2644 made `simp` start noticing @[simp, nolint simpNF] theorem Ξ΅_apply (r : R) : Ξ΅ R r = Finsupp.single PUnit.unit r := rfl #align Module.free.Ξ΅_apply ModuleCat.Free.Ξ΅_apply def ΞΌ (Ξ± Ξ² : Type u) : (free R).obj Ξ± βŠ— (free R).obj Ξ² β‰… (free R).obj (Ξ± βŠ— Ξ²) := (finsuppTensorFinsupp' R Ξ± Ξ²).toModuleIso #align Module.free.ΞΌ ModuleCat.Free.ΞΌ theorem ΞΌ_natural {X Y X' Y' : Type u} (f : X ⟢ Y) (g : X' ⟢ Y') : ((free R).map f βŠ— (free R).map g) ≫ (ΞΌ R Y Y').hom = (ΞΌ R X X').hom ≫ (free R).map (f βŠ— g) := by -- Porting note (#11041): broken ext apply TensorProduct.ext apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x' apply LinearMap.ext_ring apply Finsupp.ext intro ⟨y, y'⟩ -- Porting note (#10934): used to be dsimp [ΞΌ] change (finsuppTensorFinsupp' R Y Y') (Finsupp.mapDomain f (Finsupp.single x 1) βŠ—β‚œ[R] Finsupp.mapDomain g (Finsupp.single x' 1)) _ = (Finsupp.mapDomain (f βŠ— g) (finsuppTensorFinsupp' R X X' (Finsupp.single x 1 βŠ—β‚œ[R] Finsupp.single x' 1))) _ -- extra `rfl` after leanprover/lean4#2466 simp_rw [Finsupp.mapDomain_single, finsuppTensorFinsupp'_single_tmul_single, mul_one, Finsupp.mapDomain_single, CategoryTheory.tensor_apply]; rfl #align Module.free.ΞΌ_natural ModuleCat.Free.ΞΌ_natural
Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean
112
129
theorem left_unitality (X : Type u) : (Ξ»_ ((free R).obj X)).hom = (Ξ΅ R βŠ— πŸ™ ((free R).obj X)) ≫ (ΞΌ R (πŸ™_ (Type u)) X).hom ≫ map (free R).obj (Ξ»_ X).hom := by
-- Porting note (#11041): broken ext apply TensorProduct.ext apply LinearMap.ext_ring apply Finsupp.lhom_ext' intro x apply LinearMap.ext_ring apply Finsupp.ext intro x' -- Porting note (#10934): used to be dsimp [Ξ΅, ΞΌ] let q : X β†’β‚€ R := ((Ξ»_ (of R (X β†’β‚€ R))).hom) (1 βŠ—β‚œ[R] Finsupp.single x 1) change q x' = Finsupp.mapDomain (Ξ»_ X).hom (finsuppTensorFinsupp' R (πŸ™_ (Type u)) X (Finsupp.single PUnit.unit 1 βŠ—β‚œ[R] Finsupp.single x 1)) x' simp_rw [q, finsuppTensorFinsupp'_single_tmul_single, ModuleCat.MonoidalCategory.leftUnitor_hom_apply, mul_one, Finsupp.mapDomain_single, CategoryTheory.leftUnitor_hom_apply, one_smul]
[ " βˆ€ (X : Type u),\n { obj := fun X => of R (X β†’β‚€ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (πŸ™ X) =\n πŸ™ ({ obj := fun X => of R (X β†’β‚€ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.obj X)", " { obj := fun X => of R (X β†’β‚€ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (πŸ™ X✝...
[ " βˆ€ (X : Type u),\n { obj := fun X => of R (X β†’β‚€ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (πŸ™ X) =\n πŸ™ ({ obj := fun X => of R (X β†’β‚€ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.obj X)", " { obj := fun X => of R (X β†’β‚€ R), map := fun {X Y} f => Finsupp.lmapDomain R R f }.map (πŸ™ X✝...
import Mathlib.Data.List.Chain #align_import data.list.destutter from "leanprover-community/mathlib"@"7b78d1776212a91ecc94cf601f83bdcc46b04213" variable {Ξ± : Type*} (l : List Ξ±) (R : Ξ± β†’ Ξ± β†’ Prop) [DecidableRel R] {a b : Ξ±} namespace List @[simp] theorem destutter'_nil : destutter' R a [] = [a] := rfl #align list.destutter'_nil List.destutter'_nil theorem destutter'_cons : (b :: l).destutter' R a = if R a b then a :: destutter' R b l else destutter' R a l := rfl #align list.destutter'_cons List.destutter'_cons variable {R} @[simp] theorem destutter'_cons_pos (h : R b a) : (a :: l).destutter' R b = b :: l.destutter' R a := by rw [destutter', if_pos h] #align list.destutter'_cons_pos List.destutter'_cons_pos @[simp] theorem destutter'_cons_neg (h : Β¬R b a) : (a :: l).destutter' R b = l.destutter' R b := by rw [destutter', if_neg h] #align list.destutter'_cons_neg List.destutter'_cons_neg variable (R) @[simp] theorem destutter'_singleton : [b].destutter' R a = if R a b then [a, b] else [a] := by split_ifs with h <;> simp! [h] #align list.destutter'_singleton List.destutter'_singleton
Mathlib/Data/List/Destutter.lean
64
70
theorem destutter'_sublist (a) : l.destutter' R a <+ a :: l := by
induction' l with b l hl generalizing a Β· simp rw [destutter'] split_ifs Β· exact Sublist.consβ‚‚ a (hl b) Β· exact (hl a).trans ((l.sublist_cons b).cons_cons a)
[ " destutter' R b (a :: l) = b :: destutter' R a l", " destutter' R b (a :: l) = destutter' R b l", " destutter' R a [b] = if R a b then [a, b] else [a]", " destutter' R a [b] = [a, b]", " destutter' R a [b] = [a]", " destutter' R a l <+ a :: l", " destutter' R a [] <+ [a]", " destutter' R a (b :: l) <...
[ " destutter' R b (a :: l) = b :: destutter' R a l", " destutter' R b (a :: l) = destutter' R b l", " destutter' R a [b] = if R a b then [a, b] else [a]", " destutter' R a [b] = [a, b]", " destutter' R a [b] = [a]", " destutter' R a l <+ a :: l" ]
import Mathlib.Algebra.CharP.Two import Mathlib.Algebra.CharP.Reduced import Mathlib.Algebra.NeZero import Mathlib.Algebra.Polynomial.RingDivision import Mathlib.GroupTheory.SpecificGroups.Cyclic import Mathlib.NumberTheory.Divisors import Mathlib.RingTheory.IntegralDomain import Mathlib.Tactic.Zify #align_import ring_theory.roots_of_unity.basic from "leanprover-community/mathlib"@"7fdeecc0d03cd40f7a165e6cf00a4d2286db599f" open scoped Classical Polynomial noncomputable section open Polynomial open Finset variable {M N G R S F : Type*} variable [CommMonoid M] [CommMonoid N] [DivisionCommMonoid G] section rootsOfUnity variable {k l : β„•+} def rootsOfUnity (k : β„•+) (M : Type*) [CommMonoid M] : Subgroup MΛ£ where carrier := {ΞΆ | ΞΆ ^ (k : β„•) = 1} one_mem' := one_pow _ mul_mem' _ _ := by simp_all only [Set.mem_setOf_eq, mul_pow, one_mul] inv_mem' _ := by simp_all only [Set.mem_setOf_eq, inv_pow, inv_one] #align roots_of_unity rootsOfUnity @[simp] theorem mem_rootsOfUnity (k : β„•+) (ΞΆ : MΛ£) : ΞΆ ∈ rootsOfUnity k M ↔ ΞΆ ^ (k : β„•) = 1 := Iff.rfl #align mem_roots_of_unity mem_rootsOfUnity theorem mem_rootsOfUnity' (k : β„•+) (ΞΆ : MΛ£) : ΞΆ ∈ rootsOfUnity k M ↔ (ΞΆ : M) ^ (k : β„•) = 1 := by rw [mem_rootsOfUnity]; norm_cast #align mem_roots_of_unity' mem_rootsOfUnity' @[simp] theorem rootsOfUnity_one (M : Type*) [CommMonoid M] : rootsOfUnity 1 M = βŠ₯ := by ext; simp theorem rootsOfUnity.coe_injective {n : β„•+} : Function.Injective (fun x : rootsOfUnity n M ↦ x.val.val) := Units.ext.comp fun _ _ => Subtype.eq #align roots_of_unity.coe_injective rootsOfUnity.coe_injective @[simps! coe_val] def rootsOfUnity.mkOfPowEq (ΞΆ : M) {n : β„•+} (h : ΞΆ ^ (n : β„•) = 1) : rootsOfUnity n M := ⟨Units.ofPowEqOne ΞΆ n h n.ne_zero, Units.pow_ofPowEqOne _ _⟩ #align roots_of_unity.mk_of_pow_eq rootsOfUnity.mkOfPowEq #align roots_of_unity.mk_of_pow_eq_coe_coe rootsOfUnity.val_mkOfPowEq_coe @[simp] theorem rootsOfUnity.coe_mkOfPowEq {ΞΆ : M} {n : β„•+} (h : ΞΆ ^ (n : β„•) = 1) : ((rootsOfUnity.mkOfPowEq _ h : MΛ£) : M) = ΞΆ := rfl #align roots_of_unity.coe_mk_of_pow_eq rootsOfUnity.coe_mkOfPowEq theorem rootsOfUnity_le_of_dvd (h : k ∣ l) : rootsOfUnity k M ≀ rootsOfUnity l M := by obtain ⟨d, rfl⟩ := h intro ΞΆ h simp_all only [mem_rootsOfUnity, PNat.mul_coe, pow_mul, one_pow] #align roots_of_unity_le_of_dvd rootsOfUnity_le_of_dvd theorem map_rootsOfUnity (f : MΛ£ β†’* NΛ£) (k : β„•+) : (rootsOfUnity k M).map f ≀ rootsOfUnity k N := by rintro _ ⟨΢, h, rfl⟩ simp_all only [← map_pow, mem_rootsOfUnity, SetLike.mem_coe, MonoidHom.map_one] #align map_roots_of_unity map_rootsOfUnity @[norm_cast]
Mathlib/RingTheory/RootsOfUnity/Basic.lean
131
133
theorem rootsOfUnity.coe_pow [CommMonoid R] (ΞΆ : rootsOfUnity k R) (m : β„•) : (((ΞΆ ^ m :) : RΛ£) : R) = ((ΞΆ : RΛ£) : R) ^ m := by
rw [Subgroup.coe_pow, Units.val_pow_eq_pow_val]
[ " a✝ * b✝ ∈ {ΞΆ | ΞΆ ^ ↑k = 1}", " x✝¹⁻¹ ∈ { carrier := {ΞΆ | ΞΆ ^ ↑k = 1}, mul_mem' := β‹―, one_mem' := β‹― }.carrier", " ΞΆ ∈ rootsOfUnity k M ↔ ↑΢ ^ ↑k = 1", " ΞΆ ^ ↑k = 1 ↔ ↑΢ ^ ↑k = 1", " rootsOfUnity 1 M = βŠ₯", " x✝ ∈ rootsOfUnity 1 M ↔ x✝ ∈ βŠ₯", " rootsOfUnity k M ≀ rootsOfUnity l M", " rootsOfUnity k M ≀ ...
[ " a✝ * b✝ ∈ {ΞΆ | ΞΆ ^ ↑k = 1}", " x✝¹⁻¹ ∈ { carrier := {ΞΆ | ΞΆ ^ ↑k = 1}, mul_mem' := β‹―, one_mem' := β‹― }.carrier", " ΞΆ ∈ rootsOfUnity k M ↔ ↑΢ ^ ↑k = 1", " ΞΆ ^ ↑k = 1 ↔ ↑΢ ^ ↑k = 1", " rootsOfUnity 1 M = βŠ₯", " x✝ ∈ rootsOfUnity 1 M ↔ x✝ ∈ βŠ₯", " rootsOfUnity k M ≀ rootsOfUnity l M", " rootsOfUnity k M ≀ ...
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Calculus.FDeriv.Linear import Mathlib.Analysis.Calculus.FDeriv.Comp #align_import analysis.calculus.fderiv.equiv from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π•œ G'] variable {f fβ‚€ f₁ g : E β†’ F} variable {f' fβ‚€' f₁' g' : E β†’L[π•œ] F} variable (e : E β†’L[π•œ] F) variable {x : E} variable {s t : Set E} variable {L L₁ Lβ‚‚ : Filter E}
Mathlib/Analysis/Calculus/FDeriv/Equiv.lean
391
410
theorem HasStrictFDerivAt.of_local_left_inverse {f : E β†’ F} {f' : E ≃L[π•œ] F} {g : F β†’ E} {a : F} (hg : ContinuousAt g a) (hf : HasStrictFDerivAt f (f' : E β†’L[π•œ] F) (g a)) (hfg : βˆ€αΆ  y in 𝓝 a, f (g y) = y) : HasStrictFDerivAt g (f'.symm : F β†’L[π•œ] E) a := by
replace hg := hg.prod_map' hg replace hfg := hfg.prod_mk_nhds hfg have : (fun p : F Γ— F => g p.1 - g p.2 - f'.symm (p.1 - p.2)) =O[𝓝 (a, a)] fun p : F Γ— F => f' (g p.1 - g p.2) - (p.1 - p.2) := by refine ((f'.symm : F β†’L[π•œ] E).isBigO_comp _ _).congr (fun x => ?_) fun _ => rfl simp refine this.trans_isLittleO ?_ clear this refine ((hf.comp_tendsto hg).symm.congr' (hfg.mono ?_) (eventually_of_forall fun _ => rfl)).trans_isBigO ?_ Β· rintro p ⟨hp1, hp2⟩ simp [hp1, hp2] Β· refine (hf.isBigO_sub_rev.comp_tendsto hg).congr' (eventually_of_forall fun _ => rfl) (hfg.mono ?_) rintro p ⟨hp1, hp2⟩ simp only [(Β· ∘ Β·), hp1, hp2]
[ " HasStrictFDerivAt g (↑f'.symm) a", " (fun p => g p.1 - g p.2 - f'.symm (p.1 - p.2)) =O[𝓝 (a, a)] fun p => f' (g p.1 - g p.2) - (p.1 - p.2)", " ↑f'.symm (f' (g x.1 - g x.2) - (x.1 - x.2)) = g x.1 - g x.2 - f'.symm (x.1 - x.2)", " (fun p => f' (g p.1 - g p.2) - (p.1 - p.2)) =o[𝓝 (a, a)] fun p => p.1 - p.2",...
[ " HasStrictFDerivAt g (↑f'.symm) a" ]
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by induction l <;> simp [*] #align list.join_join List.join_join lemma length_join' (L : List (List Ξ±)) : length (join L) = Nat.sum (map length L) := by induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]] lemma countP_join' (p : Ξ± β†’ Bool) : βˆ€ L : List (List Ξ±), countP p L.join = Nat.sum (L.map (countP p)) | [] => rfl | a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l] lemma count_join' [BEq Ξ±] (L : List (List Ξ±)) (a : Ξ±) : L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _ lemma length_bind' (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map] lemma countP_bind' (p : Ξ² β†’ Bool) (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map] lemma count_bind' [BEq Ξ²] (l : List Ξ±) (f : Ξ± β†’ List Ξ²) (x : Ξ²) : count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _ @[simp] theorem bind_eq_nil {l : List Ξ±} {f : Ξ± β†’ List Ξ²} : List.bind l f = [] ↔ βˆ€ x ∈ l, f x = [] := join_eq_nil.trans <| by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] #align list.bind_eq_nil List.bind_eq_nil
Mathlib/Data/List/Join.lean
105
109
theorem take_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by
induction L generalizing i Β· simp Β· cases i <;> simp [take_append, *]
[ " [l].join = l", " (l :: L).join = [] ↔ βˆ€ (l_1 : List Ξ±), l_1 ∈ l :: L β†’ l_1 = []", " (L₁ ++ Lβ‚‚).join = L₁.join ++ Lβ‚‚.join", " ([] ++ Lβ‚‚).join = [].join ++ Lβ‚‚.join", " (head✝ :: tail✝ ++ Lβ‚‚).join = (head✝ :: tail✝).join ++ Lβ‚‚.join", " (L.concat l).join = L.join ++ l", " (filter (fun l => !l.isEmpty) ([]...
[ " [l].join = l", " (l :: L).join = [] ↔ βˆ€ (l_1 : List Ξ±), l_1 ∈ l :: L β†’ l_1 = []", " (L₁ ++ Lβ‚‚).join = L₁.join ++ Lβ‚‚.join", " ([] ++ Lβ‚‚).join = [].join ++ Lβ‚‚.join", " (head✝ :: tail✝ ++ Lβ‚‚).join = (head✝ :: tail✝).join ++ Lβ‚‚.join", " (L.concat l).join = L.join ++ l", " (filter (fun l => !l.isEmpty) ([]...
import Mathlib.Algebra.CharP.Basic import Mathlib.Algebra.CharP.Algebra import Mathlib.Data.Nat.Prime #align_import algebra.char_p.exp_char from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe u variable (R : Type u) section Semiring variable [Semiring R] class inductive ExpChar (R : Type u) [Semiring R] : β„• β†’ Prop | zero [CharZero R] : ExpChar R 1 | prime {q : β„•} (hprime : q.Prime) [hchar : CharP R q] : ExpChar R q #align exp_char ExpChar #align exp_char.prime ExpChar.prime instance expChar_prime (p) [CharP R p] [Fact p.Prime] : ExpChar R p := ExpChar.prime Fact.out instance expChar_zero [CharZero R] : ExpChar R 1 := ExpChar.zero instance (S : Type*) [Semiring S] (p) [ExpChar R p] [ExpChar S p] : ExpChar (R Γ— S) p := by obtain hp | ⟨hp⟩ := β€ΉExpChar R pβ€Ί Β· have := Prod.charZero_of_left R S; exact .zero obtain _ | _ := β€ΉExpChar S pβ€Ί Β· exact (Nat.not_prime_one hp).elim Β· have := Prod.charP R S p; exact .prime hp variable {R} in theorem ExpChar.eq {p q : β„•} (hp : ExpChar R p) (hq : ExpChar R q) : p = q := by cases' hp with hp _ hp' hp Β· cases' hq with hq _ hq' hq exacts [rfl, False.elim (Nat.not_prime_zero (CharP.eq R hq (CharP.ofCharZero R) β–Έ hq'))] Β· cases' hq with hq _ hq' hq exacts [False.elim (Nat.not_prime_zero (CharP.eq R hp (CharP.ofCharZero R) β–Έ hp')), CharP.eq R hp hq] theorem ExpChar.congr {p : β„•} (q : β„•) [hq : ExpChar R q] (h : q = p) : ExpChar R p := h β–Έ hq noncomputable def ringExpChar (R : Type*) [NonAssocSemiring R] : β„• := max (ringChar R) 1 theorem ringExpChar.eq (q : β„•) [h : ExpChar R q] : ringExpChar R = q := by cases' h with _ _ h _ Β· haveI := CharP.ofCharZero R rw [ringExpChar, ringChar.eq R 0]; rfl rw [ringExpChar, ringChar.eq R q] exact Nat.max_eq_left h.one_lt.le @[simp]
Mathlib/Algebra/CharP/ExpChar.lean
82
83
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1 := by
rw [ringExpChar, ringChar.eq_zero, max_eq_right zero_le_one]
[ " ExpChar (R Γ— S) p", " ExpChar (R Γ— S) 1", " p = q", " 1 = q", " ringExpChar R = q", " ringExpChar R = 1", " max 0 1 = 1", " max q 1 = q" ]
[ " ExpChar (R Γ— S) p", " ExpChar (R Γ— S) 1", " p = q", " 1 = q", " ringExpChar R = q", " ringExpChar R = 1", " max 0 1 = 1", " max q 1 = q" ]
import Mathlib.SetTheory.Game.Basic import Mathlib.SetTheory.Ordinal.NaturalOps #align_import set_theory.game.ordinal from "leanprover-community/mathlib"@"b90e72c7eebbe8de7c8293a80208ea2ba135c834" universe u open SetTheory PGame open scoped NaturalOps PGame namespace Ordinal noncomputable def toPGame : Ordinal.{u} β†’ PGame.{u} | o => have : IsWellOrder o.out.Ξ± (Β· < Β·) := isWellOrder_out_lt o ⟨o.out.Ξ±, PEmpty, fun x => have := Ordinal.typein_lt_self x (typein (Β· < Β·) x).toPGame, PEmpty.elim⟩ termination_by x => x #align ordinal.to_pgame Ordinal.toPGame @[nolint unusedHavesSuffices] theorem toPGame_def (o : Ordinal) : have : IsWellOrder o.out.Ξ± (Β· < Β·) := isWellOrder_out_lt o o.toPGame = ⟨o.out.Ξ±, PEmpty, fun x => (typein (Β· < Β·) x).toPGame, PEmpty.elim⟩ := by rw [toPGame] #align ordinal.to_pgame_def Ordinal.toPGame_def @[simp, nolint unusedHavesSuffices] theorem toPGame_leftMoves (o : Ordinal) : o.toPGame.LeftMoves = o.out.Ξ± := by rw [toPGame, LeftMoves] #align ordinal.to_pgame_left_moves Ordinal.toPGame_leftMoves @[simp, nolint unusedHavesSuffices]
Mathlib/SetTheory/Game/Ordinal.lean
58
59
theorem toPGame_rightMoves (o : Ordinal) : o.toPGame.RightMoves = PEmpty := by
rw [toPGame, RightMoves]
[ " let_fun this := β‹―;\n o.toPGame = mk (Quotient.out o).Ξ± PEmpty.{u_1 + 1} (fun x => (typein (fun x x_1 => x < x_1) x).toPGame) PEmpty.elim", " o.toPGame.LeftMoves = (Quotient.out o).Ξ±", " o.toPGame.RightMoves = PEmpty.{u_1 + 1}" ]
[ " let_fun this := β‹―;\n o.toPGame = mk (Quotient.out o).Ξ± PEmpty.{u_1 + 1} (fun x => (typein (fun x x_1 => x < x_1) x).toPGame) PEmpty.elim", " o.toPGame.LeftMoves = (Quotient.out o).Ξ±", " o.toPGame.RightMoves = PEmpty.{u_1 + 1}" ]
import Mathlib.Order.ConditionallyCompleteLattice.Finset import Mathlib.Order.Interval.Finset.Nat #align_import data.nat.lattice from "leanprover-community/mathlib"@"52fa514ec337dd970d71d8de8d0fd68b455a1e54" assert_not_exists MonoidWithZero open Set namespace Nat open scoped Classical noncomputable instance : InfSet β„• := ⟨fun s ↦ if h : βˆƒ n, n ∈ s then @Nat.find (fun n ↦ n ∈ s) _ h else 0⟩ noncomputable instance : SupSet β„• := ⟨fun s ↦ if h : βˆƒ n, βˆ€ a ∈ s, a ≀ n then @Nat.find (fun n ↦ βˆ€ a ∈ s, a ≀ n) _ h else 0⟩ theorem sInf_def {s : Set β„•} (h : s.Nonempty) : sInf s = @Nat.find (fun n ↦ n ∈ s) _ h := dif_pos _ #align nat.Inf_def Nat.sInf_def theorem sSup_def {s : Set β„•} (h : βˆƒ n, βˆ€ a ∈ s, a ≀ n) : sSup s = @Nat.find (fun n ↦ βˆ€ a ∈ s, a ≀ n) _ h := dif_pos _ #align nat.Sup_def Nat.sSup_def theorem _root_.Set.Infinite.Nat.sSup_eq_zero {s : Set β„•} (h : s.Infinite) : sSup s = 0 := dif_neg fun ⟨n, hn⟩ ↦ let ⟨k, hks, hk⟩ := h.exists_gt n (hn k hks).not_lt hk #align set.infinite.nat.Sup_eq_zero Set.Infinite.Nat.sSup_eq_zero @[simp] theorem sInf_eq_zero {s : Set β„•} : sInf s = 0 ↔ 0 ∈ s ∨ s = βˆ… := by cases eq_empty_or_nonempty s with | inl h => subst h simp only [or_true_iff, eq_self_iff_true, iff_true_iff, iInf, InfSet.sInf, mem_empty_iff_false, exists_false, dif_neg, not_false_iff] | inr h => simp only [h.ne_empty, or_false_iff, Nat.sInf_def, h, Nat.find_eq_zero] #align nat.Inf_eq_zero Nat.sInf_eq_zero @[simp]
Mathlib/Data/Nat/Lattice.lean
59
62
theorem sInf_empty : sInf βˆ… = 0 := by
rw [sInf_eq_zero] right rfl
[ " sInf s = 0 ↔ 0 ∈ s ∨ s = βˆ…", " sInf βˆ… = 0 ↔ 0 ∈ βˆ… ∨ βˆ… = βˆ…", " sInf βˆ… = 0", " 0 ∈ βˆ… ∨ βˆ… = βˆ…", " βˆ… = βˆ…" ]
[ " sInf s = 0 ↔ 0 ∈ s ∨ s = βˆ…", " sInf βˆ… = 0 ↔ 0 ∈ βˆ… ∨ βˆ… = βˆ…", " sInf βˆ… = 0" ]
import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.OrdConnected #align_import data.set.intervals.proj_Icc from "leanprover-community/mathlib"@"4e24c4bfcff371c71f7ba22050308aa17815626c" variable {Ξ± Ξ² : Type*} [LinearOrder Ξ±] open Function namespace Set def projIci (a x : Ξ±) : Ici a := ⟨max a x, le_max_left _ _⟩ #align set.proj_Ici Set.projIci def projIic (b x : Ξ±) : Iic b := ⟨min b x, min_le_left _ _⟩ #align set.proj_Iic Set.projIic def projIcc (a b : Ξ±) (h : a ≀ b) (x : Ξ±) : Icc a b := ⟨max a (min b x), le_max_left _ _, max_le h (min_le_left _ _)⟩ #align set.proj_Icc Set.projIcc variable {a b : Ξ±} (h : a ≀ b) {x : Ξ±} @[norm_cast] theorem coe_projIci (a x : Ξ±) : (projIci a x : Ξ±) = max a x := rfl #align set.coe_proj_Ici Set.coe_projIci @[norm_cast] theorem coe_projIic (b x : Ξ±) : (projIic b x : Ξ±) = min b x := rfl #align set.coe_proj_Iic Set.coe_projIic @[norm_cast] theorem coe_projIcc (a b : Ξ±) (h : a ≀ b) (x : Ξ±) : (projIcc a b h x : Ξ±) = max a (min b x) := rfl #align set.coe_proj_Icc Set.coe_projIcc theorem projIci_of_le (hx : x ≀ a) : projIci a x = ⟨a, le_rfl⟩ := Subtype.ext <| max_eq_left hx #align set.proj_Ici_of_le Set.projIci_of_le theorem projIic_of_le (hx : b ≀ x) : projIic b x = ⟨b, le_rfl⟩ := Subtype.ext <| min_eq_left hx #align set.proj_Iic_of_le Set.projIic_of_le theorem projIcc_of_le_left (hx : x ≀ a) : projIcc a b h x = ⟨a, left_mem_Icc.2 h⟩ := by simp [projIcc, hx, hx.trans h] #align set.proj_Icc_of_le_left Set.projIcc_of_le_left theorem projIcc_of_right_le (hx : b ≀ x) : projIcc a b h x = ⟨b, right_mem_Icc.2 h⟩ := by simp [projIcc, hx, h] #align set.proj_Icc_of_right_le Set.projIcc_of_right_le @[simp] theorem projIci_self (a : Ξ±) : projIci a a = ⟨a, le_rfl⟩ := projIci_of_le le_rfl #align set.proj_Ici_self Set.projIci_self @[simp] theorem projIic_self (b : Ξ±) : projIic b b = ⟨b, le_rfl⟩ := projIic_of_le le_rfl #align set.proj_Iic_self Set.projIic_self @[simp] theorem projIcc_left : projIcc a b h a = ⟨a, left_mem_Icc.2 h⟩ := projIcc_of_le_left h le_rfl #align set.proj_Icc_left Set.projIcc_left @[simp] theorem projIcc_right : projIcc a b h b = ⟨b, right_mem_Icc.2 h⟩ := projIcc_of_right_le h le_rfl #align set.proj_Icc_right Set.projIcc_right theorem projIci_eq_self : projIci a x = ⟨a, le_rfl⟩ ↔ x ≀ a := by simp [projIci, Subtype.ext_iff] #align set.proj_Ici_eq_self Set.projIci_eq_self theorem projIic_eq_self : projIic b x = ⟨b, le_rfl⟩ ↔ b ≀ x := by simp [projIic, Subtype.ext_iff] #align set.proj_Iic_eq_self Set.projIic_eq_self theorem projIcc_eq_left (h : a < b) : projIcc a b h.le x = ⟨a, left_mem_Icc.mpr h.le⟩ ↔ x ≀ a := by simp [projIcc, Subtype.ext_iff, h.not_le] #align set.proj_Icc_eq_left Set.projIcc_eq_left
Mathlib/Order/Interval/Set/ProjIcc.lean
109
110
theorem projIcc_eq_right (h : a < b) : projIcc a b h.le x = ⟨b, right_mem_Icc.2 h.le⟩ ↔ b ≀ x := by
simp [projIcc, Subtype.ext_iff, max_min_distrib_left, h.le, h.not_le]
[ " projIcc a b h x = ⟨a, β‹―βŸ©", " projIcc a b h x = ⟨b, β‹―βŸ©", " projIci a x = ⟨a, β‹―βŸ© ↔ x ≀ a", " projIic b x = ⟨b, β‹―βŸ© ↔ b ≀ x", " projIcc a b β‹― x = ⟨a, β‹―βŸ© ↔ x ≀ a", " projIcc a b β‹― x = ⟨b, β‹―βŸ© ↔ b ≀ x" ]
[ " projIcc a b h x = ⟨a, β‹―βŸ©", " projIcc a b h x = ⟨b, β‹―βŸ©", " projIci a x = ⟨a, β‹―βŸ© ↔ x ≀ a", " projIic b x = ⟨b, β‹―βŸ© ↔ b ≀ x", " projIcc a b β‹― x = ⟨a, β‹―βŸ© ↔ x ≀ a", " projIcc a b β‹― x = ⟨b, β‹―βŸ© ↔ b ≀ x" ]
import Mathlib.Data.Stream.Defs import Mathlib.Logic.Function.Basic import Mathlib.Init.Data.List.Basic import Mathlib.Data.List.Basic #align_import data.stream.init from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432" set_option autoImplicit true open Nat Function Option namespace Stream' variable {Ξ± : Type u} {Ξ² : Type v} {Ξ΄ : Type w} instance [Inhabited Ξ±] : Inhabited (Stream' Ξ±) := ⟨Stream'.const default⟩ protected theorem eta (s : Stream' Ξ±) : (head s::tail s) = s := funext fun i => by cases i <;> rfl #align stream.eta Stream'.eta @[ext] protected theorem ext {s₁ sβ‚‚ : Stream' Ξ±} : (βˆ€ n, get s₁ n = get sβ‚‚ n) β†’ s₁ = sβ‚‚ := fun h => funext h #align stream.ext Stream'.ext @[simp] theorem get_zero_cons (a : Ξ±) (s : Stream' Ξ±) : get (a::s) 0 = a := rfl #align stream.nth_zero_cons Stream'.get_zero_cons @[simp] theorem head_cons (a : Ξ±) (s : Stream' Ξ±) : head (a::s) = a := rfl #align stream.head_cons Stream'.head_cons @[simp] theorem tail_cons (a : Ξ±) (s : Stream' Ξ±) : tail (a::s) = s := rfl #align stream.tail_cons Stream'.tail_cons @[simp] theorem get_drop (n m : Nat) (s : Stream' Ξ±) : get (drop m s) n = get s (n + m) := rfl #align stream.nth_drop Stream'.get_drop theorem tail_eq_drop (s : Stream' Ξ±) : tail s = drop 1 s := rfl #align stream.tail_eq_drop Stream'.tail_eq_drop @[simp] theorem drop_drop (n m : Nat) (s : Stream' Ξ±) : drop n (drop m s) = drop (n + m) s := by ext; simp [Nat.add_assoc] #align stream.drop_drop Stream'.drop_drop @[simp] theorem get_tail {s : Stream' Ξ±} : s.tail.get n = s.get (n + 1) := rfl @[simp] theorem tail_drop' {s : Stream' Ξ±} : tail (drop i s) = s.drop (i+1) := by ext; simp [Nat.add_comm, Nat.add_assoc, Nat.add_left_comm] @[simp] theorem drop_tail' {s : Stream' Ξ±} : drop i (tail s) = s.drop (i+1) := rfl theorem tail_drop (n : Nat) (s : Stream' Ξ±) : tail (drop n s) = drop n (tail s) := by simp #align stream.tail_drop Stream'.tail_drop theorem get_succ (n : Nat) (s : Stream' Ξ±) : get s (succ n) = get (tail s) n := rfl #align stream.nth_succ Stream'.get_succ @[simp] theorem get_succ_cons (n : Nat) (s : Stream' Ξ±) (x : Ξ±) : get (x::s) n.succ = get s n := rfl #align stream.nth_succ_cons Stream'.get_succ_cons @[simp] theorem drop_zero {s : Stream' Ξ±} : s.drop 0 = s := rfl theorem drop_succ (n : Nat) (s : Stream' Ξ±) : drop (succ n) s = drop n (tail s) := rfl #align stream.drop_succ Stream'.drop_succ
Mathlib/Data/Stream/Init.lean
94
94
theorem head_drop (a : Stream' Ξ±) (n : β„•) : (a.drop n).head = a.get n := by
simp
[ " (s.head :: s.tail) i = s i", " (s.head :: s.tail) 0 = s 0", " (s.head :: s.tail) (n✝ + 1) = s (n✝ + 1)", " drop n (drop m s) = drop (n + m) s", " (drop n (drop m s)).get n✝ = (drop (n + m) s).get n✝", " (drop i s).tail = drop (i + 1) s", " (drop i s).tail.get n✝ = (drop (i + 1) s).get n✝", " (drop n...
[ " (s.head :: s.tail) i = s i", " (s.head :: s.tail) 0 = s 0", " (s.head :: s.tail) (n✝ + 1) = s (n✝ + 1)", " drop n (drop m s) = drop (n + m) s", " (drop n (drop m s)).get n✝ = (drop (n + m) s).get n✝", " (drop i s).tail = drop (i + 1) s", " (drop i s).tail.get n✝ = (drop (i + 1) s).get n✝", " (drop n...