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
eval_complexity
float64
0
1
import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation #align_import linear_algebra.clifford_algebra.star from "leanprover-community/mathlib"@"4d66277cfec381260ba05c68f9ae6ce2a118031d" variable {R : Type*} [CommRing R] variable {M : Type*} [AddCommGroup M] [Module R M] variable {Q : QuadraticForm R M} namespace CliffordAlgebra instance instStarRing : StarRing (CliffordAlgebra Q) where star x := reverse (involute x) star_involutive x := by simp only [reverse_involute_commute.eq, reverse_reverse, involute_involute] star_mul x y := by simp only [map_mul, reverse.map_mul] star_add x y := by simp only [map_add] theorem star_def (x : CliffordAlgebra Q) : star x = reverse (involute x) := rfl #align clifford_algebra.star_def CliffordAlgebra.star_def theorem star_def' (x : CliffordAlgebra Q) : star x = involute (reverse x) := reverse_involute _ #align clifford_algebra.star_def' CliffordAlgebra.star_def' @[simp] theorem star_ι (m : M) : star (ι Q m) = -ι Q m := by rw [star_def, involute_ι, map_neg, reverse_ι] #align clifford_algebra.star_ι CliffordAlgebra.star_ι @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Star.lean
57
58
theorem star_smul (r : R) (x : CliffordAlgebra Q) : star (r • x) = r • star x := by
rw [star_def, star_def, map_smul, map_smul]
0.90625
import Mathlib.Algebra.Group.Commute.Basic import Mathlib.Data.Fintype.Card import Mathlib.GroupTheory.Perm.Basic #align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Equiv Finset namespace Equiv.Perm variable {α : Type*} section support variable [DecidableEq α] [Fintype α] {f g : Perm α} def support (f : Perm α) : Finset α := univ.filter fun x => f x ≠ x #align equiv.perm.support Equiv.Perm.support @[simp] theorem mem_support {x : α} : x ∈ f.support ↔ f x ≠ x := by rw [support, mem_filter, and_iff_right (mem_univ x)] #align equiv.perm.mem_support Equiv.Perm.mem_support
Mathlib/GroupTheory/Perm/Support.lean
301
301
theorem not_mem_support {x : α} : x ∉ f.support ↔ f x = x := by
simp
0.90625
import Mathlib.Algebra.Polynomial.Eval #align_import data.polynomial.degree.lemmas from "leanprover-community/mathlib"@"728baa2f54e6062c5879a3e397ac6bac323e506f" noncomputable section open Polynomial open Finsupp Finset namespace Polynomial universe u v w variable {R : Type u} {S : Type v} {ι : Type w} {a b : R} {m n : ℕ} section Semiring variable [Semiring R] {p q r : R[X]} section NoZeroDivisors variable [Semiring R] [NoZeroDivisors R] {p q : R[X]} {a : R} theorem degree_mul_C (a0 : a ≠ 0) : (p * C a).degree = p.degree := by rw [degree_mul, degree_C a0, add_zero] set_option linter.uppercaseLean3 false in #align polynomial.degree_mul_C Polynomial.degree_mul_C theorem degree_C_mul (a0 : a ≠ 0) : (C a * p).degree = p.degree := by rw [degree_mul, degree_C a0, zero_add] set_option linter.uppercaseLean3 false in #align polynomial.degree_C_mul Polynomial.degree_C_mul theorem natDegree_mul_C (a0 : a ≠ 0) : (p * C a).natDegree = p.natDegree := by simp only [natDegree, degree_mul_C a0] set_option linter.uppercaseLean3 false in #align polynomial.natDegree_mul_C Polynomial.natDegree_mul_C
Mathlib/Algebra/Polynomial/Degree/Lemmas.lean
371
372
theorem natDegree_C_mul (a0 : a ≠ 0) : (C a * p).natDegree = p.natDegree := by
simp only [natDegree, degree_C_mul a0]
0.90625
import Mathlib.LinearAlgebra.Dimension.Free import Mathlib.Algebra.Module.Torsion #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v v' u₁' w w' variable {R S : Type u} {M : Type v} {M' : Type v'} {M₁ : Type v} variable {ι : Type w} {ι' : Type w'} {η : Type u₁'} {φ : η → Type*} open Cardinal Basis Submodule Function Set FiniteDimensional DirectSum variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] section Finsupp variable (R M M') variable [StrongRankCondition R] [Module.Free R M] [Module.Free R M'] open Module.Free @[simp] theorem rank_finsupp (ι : Type w) : Module.rank R (ι →₀ M) = Cardinal.lift.{v} #ι * Cardinal.lift.{w} (Module.rank R M) := by obtain ⟨⟨_, bs⟩⟩ := Module.Free.exists_basis (R := R) (M := M) rw [← bs.mk_eq_rank'', ← (Finsupp.basis fun _ : ι => bs).mk_eq_rank'', Cardinal.mk_sigma, Cardinal.sum_const] #align rank_finsupp rank_finsupp
Mathlib/LinearAlgebra/Dimension/Constructions.lean
171
172
theorem rank_finsupp' (ι : Type v) : Module.rank R (ι →₀ M) = #ι * Module.rank R M := by
simp [rank_finsupp]
0.90625
import Mathlib.Analysis.SpecialFunctions.Complex.Arg import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section namespace Complex open Set Filter Bornology open scoped Real Topology ComplexConjugate -- Porting note: @[pp_nodot] does not exist in mathlib4 noncomputable def log (x : ℂ) : ℂ := x.abs.log + arg x * I #align complex.log Complex.log theorem log_re (x : ℂ) : x.log.re = x.abs.log := by simp [log] #align complex.log_re Complex.log_re
Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
36
36
theorem log_im (x : ℂ) : x.log.im = x.arg := by
simp [log]
0.90625
import Mathlib.Analysis.SpecialFunctions.Complex.Arg import Mathlib.Analysis.SpecialFunctions.Log.Basic #align_import analysis.special_functions.complex.log from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section namespace Complex open Set Filter Bornology open scoped Real Topology ComplexConjugate -- Porting note: @[pp_nodot] does not exist in mathlib4 noncomputable def log (x : ℂ) : ℂ := x.abs.log + arg x * I #align complex.log Complex.log theorem log_re (x : ℂ) : x.log.re = x.abs.log := by simp [log] #align complex.log_re Complex.log_re theorem log_im (x : ℂ) : x.log.im = x.arg := by simp [log] #align complex.log_im Complex.log_im theorem neg_pi_lt_log_im (x : ℂ) : -π < (log x).im := by simp only [log_im, neg_pi_lt_arg] #align complex.neg_pi_lt_log_im Complex.neg_pi_lt_log_im theorem log_im_le_pi (x : ℂ) : (log x).im ≤ π := by simp only [log_im, arg_le_pi] #align complex.log_im_le_pi Complex.log_im_le_pi theorem exp_log {x : ℂ} (hx : x ≠ 0) : exp (log x) = x := by rw [log, exp_add_mul_I, ← ofReal_sin, sin_arg, ← ofReal_cos, cos_arg hx, ← ofReal_exp, Real.exp_log (abs.pos hx), mul_add, ofReal_div, ofReal_div, mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), ← mul_assoc, mul_div_cancel₀ _ (ofReal_ne_zero.2 <| abs.ne_zero hx), re_add_im] #align complex.exp_log Complex.exp_log @[simp] theorem range_exp : Set.range exp = {0}ᶜ := Set.ext fun x => ⟨by rintro ⟨x, rfl⟩ exact exp_ne_zero x, fun hx => ⟨log x, exp_log hx⟩⟩ #align complex.range_exp Complex.range_exp theorem log_exp {x : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π) : log (exp x) = x := by rw [log, abs_exp, Real.log_exp, exp_eq_exp_re_mul_sin_add_cos, ← ofReal_exp, arg_mul_cos_add_sin_mul_I (Real.exp_pos _) ⟨hx₁, hx₂⟩, re_add_im] #align complex.log_exp Complex.log_exp theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π) (hy₁ : -π < y.im) (hy₂ : y.im ≤ π) (hxy : exp x = exp y) : x = y := by rw [← log_exp hx₁ hx₂, ← log_exp hy₁ hy₂, hxy] #align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi theorem ofReal_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x := Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx]) (by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx]) #align complex.of_real_log Complex.ofReal_log @[simp, norm_cast] lemma natCast_log {n : ℕ} : Real.log n = log n := ofReal_natCast n ▸ ofReal_log n.cast_nonneg @[simp] lemma ofNat_log {n : ℕ} [n.AtLeastTwo] : Real.log (no_index (OfNat.ofNat n)) = log (OfNat.ofNat n) := natCast_log
Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
83
83
theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by
simp [log_re]
0.90625
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {α Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] {γ γ₁ γ₂ : Γ₀} {l : Filter α} {f : α → Γ₀} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Γ₀ := nhdsAdjoint 0 <| ⨅ γ ≠ 0, 𝓟 (Iio γ) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace theorem nhds_eq_update : (𝓝 : Γ₀ → Filter Γ₀) = update pure 0 (⨅ γ ≠ 0, 𝓟 (Iio γ)) := by rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInf₂ fun γ hγ ↦ le_principal_iff.2 <| zero_lt_iff.2 hγ #align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update
Mathlib/Topology/Algebra/WithZeroTopology.lean
56
57
theorem nhds_zero : 𝓝 (0 : Γ₀) = ⨅ γ ≠ 0, 𝓟 (Iio γ) := by
rw [nhds_eq_update, update_same]
0.90625
import Mathlib.Analysis.Complex.RealDeriv import Mathlib.Analysis.Calculus.ContDiff.RCLike import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas #align_import analysis.special_functions.exp_deriv from "leanprover-community/mathlib"@"6a5c85000ab93fe5dcfdf620676f614ba8e18c26" noncomputable section open Filter Asymptotics Set Function open scoped Classical Topology namespace Complex variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedAlgebra 𝕜 ℂ]
Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean
36
42
theorem hasDerivAt_exp (x : ℂ) : HasDerivAt exp (exp x) x := by
rw [hasDerivAt_iff_isLittleO_nhds_zero] have : (1 : ℕ) < 2 := by norm_num refine (IsBigO.of_bound ‖exp x‖ ?_).trans_isLittleO (isLittleO_pow_id this) filter_upwards [Metric.ball_mem_nhds (0 : ℂ) zero_lt_one] simp only [Metric.mem_ball, dist_zero_right, norm_pow] exact fun z hz => exp_bound_sq x z hz.le
0.90625
import Mathlib.Data.Fintype.Basic import Mathlib.GroupTheory.Perm.Sign import Mathlib.Logic.Equiv.Defs #align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f" namespace Equiv variable {α β : Type*} [Finite α] noncomputable def toCompl {p q : α → Prop} (e : { x // p x } ≃ { x // q x }) : { x // ¬p x } ≃ { x // ¬q x } := by apply Classical.choice cases nonempty_fintype α classical exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e #align equiv.to_compl Equiv.toCompl variable {p q : α → Prop} [DecidablePred p] [DecidablePred q] noncomputable abbrev extendSubtype (e : { x // p x } ≃ { x // q x }) : Perm α := subtypeCongr e e.toCompl #align equiv.extend_subtype Equiv.extendSubtype theorem extendSubtype_apply_of_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : e.extendSubtype x = e ⟨x, hx⟩ := by dsimp only [extendSubtype] simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply] rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl] #align equiv.extend_subtype_apply_of_mem Equiv.extendSubtype_apply_of_mem
Mathlib/Logic/Equiv/Fintype.lean
132
135
theorem extendSubtype_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : q (e.extendSubtype x) := by
convert (e ⟨x, hx⟩).2 rw [e.extendSubtype_apply_of_mem _ hx]
0.90625
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Fintype.Basic import Mathlib.Data.Int.GCD import Mathlib.RingTheory.Coprime.Basic #align_import ring_theory.coprime.lemmas from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226" universe u v section RelPrime variable {α I} [CommMonoid α] [DecompositionMonoid α] {x y z : α} {s : I → α} {t : Finset I} theorem IsRelPrime.prod_left : (∀ i ∈ t, IsRelPrime (s i) x) → IsRelPrime (∏ i ∈ t, s i) x := by classical refine Finset.induction_on t (fun _ ↦ isRelPrime_one_left) fun b t hbt ih H ↦ ?_ rw [Finset.prod_insert hbt] rw [Finset.forall_mem_insert] at H exact H.1.mul_left (ih H.2) theorem IsRelPrime.prod_right : (∀ i ∈ t, IsRelPrime x (s i)) → IsRelPrime x (∏ i ∈ t, s i) := by simpa only [isRelPrime_comm] using IsRelPrime.prod_left (α := α)
Mathlib/RingTheory/Coprime/Lemmas.lean
245
248
theorem IsRelPrime.prod_left_iff : IsRelPrime (∏ i ∈ t, s i) x ↔ ∀ i ∈ t, IsRelPrime (s i) x := by
classical refine Finset.induction_on t (iff_of_true isRelPrime_one_left fun _ ↦ by simp) fun b t hbt ih ↦ ?_ rw [Finset.prod_insert hbt, IsRelPrime.mul_left_iff, ih, Finset.forall_mem_insert]
0.90625
import Mathlib.Logic.Encodable.Lattice import Mathlib.MeasureTheory.MeasurableSpace.Defs #align_import measure_theory.pi_system from "leanprover-community/mathlib"@"98e83c3d541c77cdb7da20d79611a780ff8e7d90" open MeasurableSpace Set open scoped Classical open MeasureTheory def IsPiSystem {α} (C : Set (Set α)) : Prop := ∀ᵉ (s ∈ C) (t ∈ C), (s ∩ t : Set α).Nonempty → s ∩ t ∈ C #align is_pi_system IsPiSystem theorem IsPiSystem.singleton {α} (S : Set α) : IsPiSystem ({S} : Set (Set α)) := by intro s h_s t h_t _ rw [Set.mem_singleton_iff.1 h_s, Set.mem_singleton_iff.1 h_t, Set.inter_self, Set.mem_singleton_iff] #align is_pi_system.singleton IsPiSystem.singleton theorem IsPiSystem.insert_empty {α} {S : Set (Set α)} (h_pi : IsPiSystem S) : IsPiSystem (insert ∅ S) := by intro s hs t ht hst cases' hs with hs hs · simp [hs] · cases' ht with ht ht · simp [ht] · exact Set.mem_insert_of_mem _ (h_pi s hs t ht hst) #align is_pi_system.insert_empty IsPiSystem.insert_empty theorem IsPiSystem.insert_univ {α} {S : Set (Set α)} (h_pi : IsPiSystem S) : IsPiSystem (insert Set.univ S) := by intro s hs t ht hst cases' hs with hs hs · cases' ht with ht ht <;> simp [hs, ht] · cases' ht with ht ht · simp [hs, ht] · exact Set.mem_insert_of_mem _ (h_pi s hs t ht hst) #align is_pi_system.insert_univ IsPiSystem.insert_univ theorem IsPiSystem.comap {α β} {S : Set (Set β)} (h_pi : IsPiSystem S) (f : α → β) : IsPiSystem { s : Set α | ∃ t ∈ S, f ⁻¹' t = s } := by rintro _ ⟨s, hs_mem, rfl⟩ _ ⟨t, ht_mem, rfl⟩ hst rw [← Set.preimage_inter] at hst ⊢ exact ⟨s ∩ t, h_pi s hs_mem t ht_mem (nonempty_of_nonempty_preimage hst), rfl⟩ #align is_pi_system.comap IsPiSystem.comap theorem isPiSystem_iUnion_of_directed_le {α ι} (p : ι → Set (Set α)) (hp_pi : ∀ n, IsPiSystem (p n)) (hp_directed : Directed (· ≤ ·) p) : IsPiSystem (⋃ n, p n) := by intro t1 ht1 t2 ht2 h rw [Set.mem_iUnion] at ht1 ht2 ⊢ cases' ht1 with n ht1 cases' ht2 with m ht2 obtain ⟨k, hpnk, hpmk⟩ : ∃ k, p n ≤ p k ∧ p m ≤ p k := hp_directed n m exact ⟨k, hp_pi k t1 (hpnk ht1) t2 (hpmk ht2) h⟩ #align is_pi_system_Union_of_directed_le isPiSystem_iUnion_of_directed_le theorem isPiSystem_iUnion_of_monotone {α ι} [SemilatticeSup ι] (p : ι → Set (Set α)) (hp_pi : ∀ n, IsPiSystem (p n)) (hp_mono : Monotone p) : IsPiSystem (⋃ n, p n) := isPiSystem_iUnion_of_directed_le p hp_pi (Monotone.directed_le hp_mono) #align is_pi_system_Union_of_monotone isPiSystem_iUnion_of_monotone section Order variable {α : Type*} {ι ι' : Sort*} [LinearOrder α] theorem isPiSystem_image_Iio (s : Set α) : IsPiSystem (Iio '' s) := by rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩ - exact ⟨a ⊓ b, inf_ind a b ha hb, Iio_inter_Iio.symm⟩ #align is_pi_system_image_Iio isPiSystem_image_Iio theorem isPiSystem_Iio : IsPiSystem (range Iio : Set (Set α)) := @image_univ α _ Iio ▸ isPiSystem_image_Iio univ #align is_pi_system_Iio isPiSystem_Iio theorem isPiSystem_image_Ioi (s : Set α) : IsPiSystem (Ioi '' s) := @isPiSystem_image_Iio αᵒᵈ _ s #align is_pi_system_image_Ioi isPiSystem_image_Ioi theorem isPiSystem_Ioi : IsPiSystem (range Ioi : Set (Set α)) := @image_univ α _ Ioi ▸ isPiSystem_image_Ioi univ #align is_pi_system_Ioi isPiSystem_Ioi
Mathlib/MeasureTheory/PiSystem.lean
149
151
theorem isPiSystem_image_Iic (s : Set α) : IsPiSystem (Iic '' s) := by
rintro _ ⟨a, ha, rfl⟩ _ ⟨b, hb, rfl⟩ - exact ⟨a ⊓ b, inf_ind a b ha hb, Iic_inter_Iic.symm⟩
0.90625
import Mathlib.Data.PFunctor.Multivariate.W import Mathlib.Data.QPF.Multivariate.Basic #align_import data.qpf.multivariate.constructions.fix from "leanprover-community/mathlib"@"28aa996fc6fb4317f0083c4e6daf79878d81be33" universe u v namespace MvQPF open TypeVec open MvFunctor (LiftP LiftR) open MvFunctor variable {n : ℕ} {F : TypeVec.{u} (n + 1) → Type u} [MvFunctor F] [q : MvQPF F] def recF {α : TypeVec n} {β : Type u} (g : F (α.append1 β) → β) : q.P.W α → β := q.P.wRec fun a f' _f rec => g (abs ⟨a, splitFun f' rec⟩) set_option linter.uppercaseLean3 false in #align mvqpf.recF MvQPF.recF
Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean
64
67
theorem recF_eq {α : TypeVec n} {β : Type u} (g : F (α.append1 β) → β) (a : q.P.A) (f' : q.P.drop.B a ⟹ α) (f : q.P.last.B a → q.P.W α) : recF g (q.P.wMk a f' f) = g (abs ⟨a, splitFun f' (recF g ∘ f)⟩) := by
rw [recF, MvPFunctor.wRec_eq]; rfl
0.90625
import Mathlib.Analysis.SpecialFunctions.Exp import Mathlib.Data.Nat.Factorization.Basic import Mathlib.Analysis.NormedSpace.Real #align_import analysis.special_functions.log.basic from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690" open Set Filter Function open Topology noncomputable section namespace Real variable {x y : ℝ} -- @[pp_nodot] -- Porting note: removed noncomputable def log (x : ℝ) : ℝ := if hx : x = 0 then 0 else expOrderIso.symm ⟨|x|, abs_pos.2 hx⟩ #align real.log Real.log theorem log_of_ne_zero (hx : x ≠ 0) : log x = expOrderIso.symm ⟨|x|, abs_pos.2 hx⟩ := dif_neg hx #align real.log_of_ne_zero Real.log_of_ne_zero theorem log_of_pos (hx : 0 < x) : log x = expOrderIso.symm ⟨x, hx⟩ := by rw [log_of_ne_zero hx.ne'] congr exact abs_of_pos hx #align real.log_of_pos Real.log_of_pos theorem exp_log_eq_abs (hx : x ≠ 0) : exp (log x) = |x| := by rw [log_of_ne_zero hx, ← coe_expOrderIso_apply, OrderIso.apply_symm_apply, Subtype.coe_mk] #align real.exp_log_eq_abs Real.exp_log_eq_abs theorem exp_log (hx : 0 < x) : exp (log x) = x := by rw [exp_log_eq_abs hx.ne'] exact abs_of_pos hx #align real.exp_log Real.exp_log
Mathlib/Analysis/SpecialFunctions/Log/Basic.lean
64
66
theorem exp_log_of_neg (hx : x < 0) : exp (log x) = -x := by
rw [exp_log_eq_abs (ne_of_lt hx)] exact abs_of_neg hx
0.875
import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.FinsuppVectorSpace #align_import linear_algebra.tensor_product_basis from "leanprover-community/mathlib"@"f784cc6142443d9ee623a20788c282112c322081" noncomputable section open Set LinearMap Submodule section CommSemiring variable {R : Type*} {S : Type*} {M : Type*} {N : Type*} {ι : Type*} {κ : Type*} [CommSemiring R] [Semiring S] [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] [AddCommMonoid N] [Module R N] def Basis.tensorProduct (b : Basis ι S M) (c : Basis κ R N) : Basis (ι × κ) S (TensorProduct R M N) := Finsupp.basisSingleOne.map ((TensorProduct.AlgebraTensorModule.congr b.repr c.repr).trans <| (finsuppTensorFinsupp R S _ _ _ _).trans <| Finsupp.lcongr (Equiv.refl _) (TensorProduct.AlgebraTensorModule.rid R S S)).symm #align basis.tensor_product Basis.tensorProduct @[simp]
Mathlib/LinearAlgebra/TensorProduct/Basis.lean
39
41
theorem Basis.tensorProduct_apply (b : Basis ι R M) (c : Basis κ R N) (i : ι) (j : κ) : Basis.tensorProduct b c (i, j) = b i ⊗ₜ c j := by
simp [Basis.tensorProduct]
0.875
import Mathlib.Data.List.OfFn import Mathlib.Data.List.Range #align_import data.list.fin_range from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" universe u namespace List variable {α : Type u} @[simp] theorem map_coe_finRange (n : ℕ) : ((finRange n) : List (Fin n)).map (Fin.val) = List.range n := by simp_rw [finRange, map_pmap, pmap_eq_map] exact List.map_id _ #align list.map_coe_fin_range List.map_coe_finRange theorem finRange_succ_eq_map (n : ℕ) : finRange n.succ = 0 :: (finRange n).map Fin.succ := by apply map_injective_iff.mpr Fin.val_injective rw [map_cons, map_coe_finRange, range_succ_eq_map, Fin.val_zero, ← map_coe_finRange, map_map, map_map] simp only [Function.comp, Fin.val_succ] #align list.fin_range_succ_eq_map List.finRange_succ_eq_map theorem finRange_succ (n : ℕ) : finRange n.succ = (finRange n |>.map Fin.castSucc |>.concat (.last _)) := by apply map_injective_iff.mpr Fin.val_injective simp [range_succ, Function.comp_def] -- Porting note: `map_nth_le` moved to `List.finRange_map_get` in Data.List.Range
Mathlib/Data/List/FinRange.lean
44
47
theorem ofFn_eq_pmap {n} {f : Fin n → α} : ofFn f = pmap (fun i hi => f ⟨i, hi⟩) (range n) fun _ => mem_range.1 := by
rw [pmap_eq_map_attach] exact ext_get (by simp) fun i hi1 hi2 => by simp [get_ofFn f ⟨i, hi1⟩]
0.875
import Mathlib.Algebra.Order.Ring.Abs #align_import data.int.order.lemmas from "leanprover-community/mathlib"@"fc2ed6f838ce7c9b7c7171e58d78eaf7b438fb0e" open Function Nat namespace Int variable {a b : ℤ} {n : ℕ} theorem natAbs_eq_iff_mul_self_eq {a b : ℤ} : a.natAbs = b.natAbs ↔ a * a = b * b := by rw [← abs_eq_iff_mul_self_eq, abs_eq_natAbs, abs_eq_natAbs] exact Int.natCast_inj.symm #align int.nat_abs_eq_iff_mul_self_eq Int.natAbs_eq_iff_mul_self_eq #align int.eq_nat_abs_iff_mul_eq_zero Int.eq_natAbs_iff_mul_eq_zero
Mathlib/Data/Int/Order/Lemmas.lean
35
37
theorem natAbs_lt_iff_mul_self_lt {a b : ℤ} : a.natAbs < b.natAbs ↔ a * a < b * b := by
rw [← abs_lt_iff_mul_self_lt, abs_eq_natAbs, abs_eq_natAbs] exact Int.ofNat_lt.symm
0.875
import Mathlib.Algebra.MvPolynomial.Rename #align_import data.mv_polynomial.comap from "leanprover-community/mathlib"@"aba31c938d3243cc671be7091b28a1e0814647ee" namespace MvPolynomial variable {σ : Type*} {τ : Type*} {υ : Type*} {R : Type*} [CommSemiring R] noncomputable def comap (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) : (τ → R) → σ → R := fun x i => aeval x (f (X i)) #align mv_polynomial.comap MvPolynomial.comap @[simp] theorem comap_apply (f : MvPolynomial σ R →ₐ[R] MvPolynomial τ R) (x : τ → R) (i : σ) : comap f x i = aeval x (f (X i)) := rfl #align mv_polynomial.comap_apply MvPolynomial.comap_apply @[simp]
Mathlib/Algebra/MvPolynomial/Comap.lean
48
50
theorem comap_id_apply (x : σ → R) : comap (AlgHom.id R (MvPolynomial σ R)) x = x := by
funext i simp only [comap, AlgHom.id_apply, id, aeval_X]
0.875
import Mathlib.SetTheory.Cardinal.Finite #align_import data.finite.card from "leanprover-community/mathlib"@"3ff3f2d6a3118b8711063de7111a0d77a53219a8" noncomputable section open scoped Classical variable {α β γ : Type*} def Finite.equivFin (α : Type*) [Finite α] : α ≃ Fin (Nat.card α) := by have := (Finite.exists_equiv_fin α).choose_spec.some rwa [Nat.card_eq_of_equiv_fin this] #align finite.equiv_fin Finite.equivFin def Finite.equivFinOfCardEq [Finite α] {n : ℕ} (h : Nat.card α = n) : α ≃ Fin n := by subst h apply Finite.equivFin #align finite.equiv_fin_of_card_eq Finite.equivFinOfCardEq theorem Nat.card_eq (α : Type*) : Nat.card α = if h : Finite α then @Fintype.card α (Fintype.ofFinite α) else 0 := by cases finite_or_infinite α · letI := Fintype.ofFinite α simp only [*, Nat.card_eq_fintype_card, dif_pos] · simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false] #align nat.card_eq Nat.card_eq theorem Finite.card_pos_iff [Finite α] : 0 < Nat.card α ↔ Nonempty α := by haveI := Fintype.ofFinite α rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff] #align finite.card_pos_iff Finite.card_pos_iff theorem Finite.card_pos [Finite α] [h : Nonempty α] : 0 < Nat.card α := Finite.card_pos_iff.mpr h #align finite.card_pos Finite.card_pos namespace Finite theorem cast_card_eq_mk {α : Type*} [Finite α] : ↑(Nat.card α) = Cardinal.mk α := Cardinal.cast_toNat_of_lt_aleph0 (Cardinal.lt_aleph0_of_finite α) #align finite.cast_card_eq_mk Finite.cast_card_eq_mk theorem card_eq [Finite α] [Finite β] : Nat.card α = Nat.card β ↔ Nonempty (α ≃ β) := by haveI := Fintype.ofFinite α haveI := Fintype.ofFinite β simp only [Nat.card_eq_fintype_card, Fintype.card_eq] #align finite.card_eq Finite.card_eq theorem card_le_one_iff_subsingleton [Finite α] : Nat.card α ≤ 1 ↔ Subsingleton α := by haveI := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton] #align finite.card_le_one_iff_subsingleton Finite.card_le_one_iff_subsingleton
Mathlib/Data/Finite/Card.lean
83
85
theorem one_lt_card_iff_nontrivial [Finite α] : 1 < Nat.card α ↔ Nontrivial α := by
haveI := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial]
0.875
import Mathlib.MeasureTheory.Function.AEEqFun.DomAct import Mathlib.MeasureTheory.Function.LpSpace set_option autoImplicit true open MeasureTheory Filter open scoped ENNReal namespace DomMulAct variable {M N α E : Type*} [MeasurableSpace M] [MeasurableSpace N] [MeasurableSpace α] [NormedAddCommGroup E] {μ : MeasureTheory.Measure α} {p : ℝ≥0∞} section SMul variable [SMul M α] [SMulInvariantMeasure M α μ] [MeasurableSMul M α] @[to_additive] instance : SMul Mᵈᵐᵃ (Lp E p μ) where smul c f := Lp.compMeasurePreserving (mk.symm c • ·) (measurePreserving_smul _ _) f @[to_additive (attr := simp)] theorem smul_Lp_val (c : Mᵈᵐᵃ) (f : Lp E p μ) : (c • f).1 = c • f.1 := rfl @[to_additive] theorem smul_Lp_ae_eq (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • f =ᵐ[μ] (f <| mk.symm c • ·) := Lp.coeFn_compMeasurePreserving _ _ @[to_additive] theorem mk_smul_toLp (c : M) {f : α → E} (hf : Memℒp f p μ) : mk c • hf.toLp f = (hf.comp_measurePreserving <| measurePreserving_smul c μ).toLp (f <| c • ·) := rfl @[to_additive (attr := simp)] theorem smul_Lp_const [IsFiniteMeasure μ] (c : Mᵈᵐᵃ) (a : E) : c • Lp.const p μ a = Lp.const p μ a := rfl instance [SMul N α] [SMulCommClass M N α] [SMulInvariantMeasure N α μ] [MeasurableSMul N α] : SMulCommClass Mᵈᵐᵃ Nᵈᵐᵃ (Lp E p μ) := Subtype.val_injective.smulCommClass (fun _ _ ↦ rfl) fun _ _ ↦ rfl instance [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] : SMulCommClass Mᵈᵐᵃ 𝕜 (Lp E p μ) := Subtype.val_injective.smulCommClass (fun _ _ ↦ rfl) fun _ _ ↦ rfl instance [NormedRing 𝕜] [Module 𝕜 E] [BoundedSMul 𝕜 E] : SMulCommClass 𝕜 Mᵈᵐᵃ (Lp E p μ) := .symm _ _ _ -- We don't have a typeclass for additive versions of the next few lemmas -- Should we add `AddDistribAddAction` with `to_additive` both from `MulDistribMulAction` -- and `DistribMulAction`? @[to_additive] theorem smul_Lp_add (c : Mᵈᵐᵃ) : ∀ f g : Lp E p μ, c • (f + g) = c • f + c • g := by rintro ⟨⟨⟩, _⟩ ⟨⟨⟩, _⟩; rfl attribute [simp] DomAddAct.vadd_Lp_add @[to_additive (attr := simp 1001)] theorem smul_Lp_zero (c : Mᵈᵐᵃ) : c • (0 : Lp E p μ) = 0 := rfl @[to_additive] theorem smul_Lp_neg (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • (-f) = -(c • f) := by rcases f with ⟨⟨_⟩, _⟩; rfl @[to_additive]
Mathlib/MeasureTheory/Function/LpSpace/DomAct/Basic.lean
82
83
theorem smul_Lp_sub (c : Mᵈᵐᵃ) : ∀ f g : Lp E p μ, c • (f - g) = c • f - c • g := by
rintro ⟨⟨⟩, _⟩ ⟨⟨⟩, _⟩; rfl
0.875
import Mathlib.Algebra.Order.BigOperators.Ring.Finset import Mathlib.Data.NNRat.Defs variable {ι α : Type*} namespace NNRat @[norm_cast] theorem coe_list_sum (l : List ℚ≥0) : (l.sum : ℚ) = (l.map (↑)).sum := map_list_sum coeHom _ #align nnrat.coe_list_sum NNRat.coe_list_sum @[norm_cast] theorem coe_list_prod (l : List ℚ≥0) : (l.prod : ℚ) = (l.map (↑)).prod := map_list_prod coeHom _ #align nnrat.coe_list_prod NNRat.coe_list_prod @[norm_cast] theorem coe_multiset_sum (s : Multiset ℚ≥0) : (s.sum : ℚ) = (s.map (↑)).sum := map_multiset_sum coeHom _ #align nnrat.coe_multiset_sum NNRat.coe_multiset_sum @[norm_cast] theorem coe_multiset_prod (s : Multiset ℚ≥0) : (s.prod : ℚ) = (s.map (↑)).prod := map_multiset_prod coeHom _ #align nnrat.coe_multiset_prod NNRat.coe_multiset_prod @[norm_cast] theorem coe_sum {s : Finset α} {f : α → ℚ≥0} : ↑(∑ a ∈ s, f a) = ∑ a ∈ s, (f a : ℚ) := map_sum coeHom _ _ #align nnrat.coe_sum NNRat.coe_sum theorem toNNRat_sum_of_nonneg {s : Finset α} {f : α → ℚ} (hf : ∀ a, a ∈ s → 0 ≤ f a) : (∑ a ∈ s, f a).toNNRat = ∑ a ∈ s, (f a).toNNRat := by rw [← coe_inj, coe_sum, Rat.coe_toNNRat _ (Finset.sum_nonneg hf)] exact Finset.sum_congr rfl fun x hxs ↦ by rw [Rat.coe_toNNRat _ (hf x hxs)] #align nnrat.to_nnrat_sum_of_nonneg NNRat.toNNRat_sum_of_nonneg @[norm_cast] theorem coe_prod {s : Finset α} {f : α → ℚ≥0} : ↑(∏ a ∈ s, f a) = ∏ a ∈ s, (f a : ℚ) := map_prod coeHom _ _ #align nnrat.coe_prod NNRat.coe_prod
Mathlib/Data/NNRat/BigOperators.lean
52
55
theorem toNNRat_prod_of_nonneg {s : Finset α} {f : α → ℚ} (hf : ∀ a ∈ s, 0 ≤ f a) : (∏ a ∈ s, f a).toNNRat = ∏ a ∈ s, (f a).toNNRat := by
rw [← coe_inj, coe_prod, Rat.coe_toNNRat _ (Finset.prod_nonneg hf)] exact Finset.prod_congr rfl fun x hxs ↦ by rw [Rat.coe_toNNRat _ (hf x hxs)]
0.875
import Mathlib.Algebra.Group.Pi.Lemmas import Mathlib.Topology.Algebra.Monoid import Mathlib.Topology.Homeomorph #align_import topology.algebra.group_with_zero from "leanprover-community/mathlib"@"c10e724be91096453ee3db13862b9fb9a992fef2" open Topology Filter Function variable {α β G₀ : Type*} section DivConst variable [DivInvMonoid G₀] [TopologicalSpace G₀] [ContinuousMul G₀] {f : α → G₀} {s : Set α} {l : Filter α} theorem Filter.Tendsto.div_const {x : G₀} (hf : Tendsto f l (𝓝 x)) (y : G₀) : Tendsto (fun a => f a / y) l (𝓝 (x / y)) := by simpa only [div_eq_mul_inv] using hf.mul tendsto_const_nhds #align filter.tendsto.div_const Filter.Tendsto.div_const variable [TopologicalSpace α] nonrec theorem ContinuousAt.div_const {a : α} (hf : ContinuousAt f a) (y : G₀) : ContinuousAt (fun x => f x / y) a := hf.div_const y #align continuous_at.div_const ContinuousAt.div_const nonrec theorem ContinuousWithinAt.div_const {a} (hf : ContinuousWithinAt f s a) (y : G₀) : ContinuousWithinAt (fun x => f x / y) s a := hf.div_const _ #align continuous_within_at.div_const ContinuousWithinAt.div_const
Mathlib/Topology/Algebra/GroupWithZero.lean
69
71
theorem ContinuousOn.div_const (hf : ContinuousOn f s) (y : G₀) : ContinuousOn (fun x => f x / y) s := by
simpa only [div_eq_mul_inv] using hf.mul continuousOn_const
0.875
import Mathlib.Data.Fintype.Card import Mathlib.Computability.Language import Mathlib.Tactic.NormNum #align_import computability.DFA from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" open Computability universe u v -- Porting note: Required as `DFA` is used in mathlib3 set_option linter.uppercaseLean3 false structure DFA (α : Type u) (σ : Type v) where step : σ → α → σ start : σ accept : Set σ #align DFA DFA namespace DFA variable {α : Type u} {σ : Type v} (M : DFA α σ) instance [Inhabited σ] : Inhabited (DFA α σ) := ⟨DFA.mk (fun _ _ => default) default ∅⟩ def evalFrom (start : σ) : List α → σ := List.foldl M.step start #align DFA.eval_from DFA.evalFrom @[simp] theorem evalFrom_nil (s : σ) : M.evalFrom s [] = s := rfl #align DFA.eval_from_nil DFA.evalFrom_nil @[simp] theorem evalFrom_singleton (s : σ) (a : α) : M.evalFrom s [a] = M.step s a := rfl #align DFA.eval_from_singleton DFA.evalFrom_singleton @[simp]
Mathlib/Computability/DFA.lean
64
66
theorem evalFrom_append_singleton (s : σ) (x : List α) (a : α) : M.evalFrom s (x ++ [a]) = M.step (M.evalFrom s x) a := by
simp only [evalFrom, List.foldl_append, List.foldl_cons, List.foldl_nil]
0.875
import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.Data.Int.Log #align_import analysis.special_functions.log.base from "leanprover-community/mathlib"@"f23a09ce6d3f367220dc3cecad6b7eb69eb01690" open Set Filter Function open Topology noncomputable section namespace Real variable {b x y : ℝ} -- @[pp_nodot] -- Porting note: removed noncomputable def logb (b x : ℝ) : ℝ := log x / log b #align real.logb Real.logb theorem log_div_log : log x / log b = logb b x := rfl #align real.log_div_log Real.log_div_log @[simp]
Mathlib/Analysis/SpecialFunctions/Log/Base.lean
49
49
theorem logb_zero : logb b 0 = 0 := by
simp [logb]
0.875
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ι : Type*} {f : X → Y} {g : Y → Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X → Y) : @Inducing X Y (TopologicalSpace.induced f ‹_›) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f ‹_›) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ ∀ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : ∀ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ι → Prop} {s : ι → Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x ▸ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝ˢ s = comap f (𝓝ˢ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm ▸ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm ▸ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x ▸ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin theorem tendsto_nhds_iff {f : ι → Y} {l : Filter ι} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by rw [hg.nhds_eq_comap, tendsto_comap_iff] #align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff theorem continuousAt_iff (hg : Inducing g) {x : X} : ContinuousAt f x ↔ ContinuousAt (g ∘ f) x := hg.tendsto_nhds_iff #align inducing.continuous_at_iff Inducing.continuousAt_iff
Mathlib/Topology/Maps.lean
132
134
theorem continuous_iff (hg : Inducing g) : Continuous f ↔ Continuous (g ∘ f) := by
simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff]
0.875
import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic import Mathlib.LinearAlgebra.CliffordAlgebra.Fold import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.Dual #align_import linear_algebra.clifford_algebra.contraction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open LinearMap (BilinForm) universe u1 u2 u3 variable {R : Type u1} [CommRing R] variable {M : Type u2} [AddCommGroup M] [Module R M] variable (Q : QuadraticForm R M) namespace CliffordAlgebra section contractLeft variable (d d' : Module.Dual R M) @[simps!] def contractLeftAux (d : Module.Dual R M) : M →ₗ[R] CliffordAlgebra Q × CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q := haveI v_mul := (Algebra.lmul R (CliffordAlgebra Q)).toLinearMap ∘ₗ ι Q d.smulRight (LinearMap.fst _ (CliffordAlgebra Q) (CliffordAlgebra Q)) - v_mul.compl₂ (LinearMap.snd _ (CliffordAlgebra Q) _) #align clifford_algebra.contract_left_aux CliffordAlgebra.contractLeftAux theorem contractLeftAux_contractLeftAux (v : M) (x : CliffordAlgebra Q) (fx : CliffordAlgebra Q) : contractLeftAux Q d v (ι Q v * x, contractLeftAux Q d v (x, fx)) = Q v • fx := by simp only [contractLeftAux_apply_apply] rw [mul_sub, ← mul_assoc, ι_sq_scalar, ← Algebra.smul_def, ← sub_add, mul_smul_comm, sub_self, zero_add] #align clifford_algebra.contract_left_aux_contract_left_aux CliffordAlgebra.contractLeftAux_contractLeftAux variable {Q} def contractLeft : Module.Dual R M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q where toFun d := foldr' Q (contractLeftAux Q d) (contractLeftAux_contractLeftAux Q d) 0 map_add' d₁ d₂ := LinearMap.ext fun x => by dsimp only rw [LinearMap.add_apply] induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx · simp_rw [foldr'_algebraMap, smul_zero, zero_add] · rw [map_add, map_add, map_add, add_add_add_comm, hx, hy] · rw [foldr'_ι_mul, foldr'_ι_mul, foldr'_ι_mul, hx] dsimp only [contractLeftAux_apply_apply] rw [sub_add_sub_comm, mul_add, LinearMap.add_apply, add_smul] map_smul' c d := LinearMap.ext fun x => by dsimp only rw [LinearMap.smul_apply, RingHom.id_apply] induction' x using CliffordAlgebra.left_induction with r x y hx hy m x hx · simp_rw [foldr'_algebraMap, smul_zero] · rw [map_add, map_add, smul_add, hx, hy] · rw [foldr'_ι_mul, foldr'_ι_mul, hx] dsimp only [contractLeftAux_apply_apply] rw [LinearMap.smul_apply, smul_assoc, mul_smul_comm, smul_sub] #align clifford_algebra.contract_left CliffordAlgebra.contractLeft def contractRight : CliffordAlgebra Q →ₗ[R] Module.Dual R M →ₗ[R] CliffordAlgebra Q := LinearMap.flip (LinearMap.compl₂ (LinearMap.compr₂ contractLeft reverse) reverse) #align clifford_algebra.contract_right CliffordAlgebra.contractRight theorem contractRight_eq (x : CliffordAlgebra Q) : contractRight (Q := Q) x d = reverse (contractLeft (R := R) (M := M) d <| reverse x) := rfl #align clifford_algebra.contract_right_eq CliffordAlgebra.contractRight_eq local infixl:70 "⌋" => contractLeft (R := R) (M := M) local infixl:70 "⌊" => contractRight (R := R) (M := M) (Q := Q) -- Porting note: Lean needs to be reminded of this instance otherwise the statement of the -- next result times out instance : SMul R (CliffordAlgebra Q) := inferInstance theorem contractLeft_ι_mul (a : M) (b : CliffordAlgebra Q) : d⌋(ι Q a * b) = d a • b - ι Q a * (d⌋b) := by -- Porting note: Lean cannot figure out anymore the third argument refine foldr'_ι_mul _ _ ?_ _ _ _ exact fun m x fx ↦ contractLeftAux_contractLeftAux Q d m x fx #align clifford_algebra.contract_left_ι_mul CliffordAlgebra.contractLeft_ι_mul theorem contractRight_mul_ι (a : M) (b : CliffordAlgebra Q) : b * ι Q a⌊d = d a • b - b⌊d * ι Q a := by rw [contractRight_eq, reverse.map_mul, reverse_ι, contractLeft_ι_mul, map_sub, map_smul, reverse_reverse, reverse.map_mul, reverse_ι, contractRight_eq] #align clifford_algebra.contract_right_mul_ι CliffordAlgebra.contractRight_mul_ι theorem contractLeft_algebraMap_mul (r : R) (b : CliffordAlgebra Q) : d⌋(algebraMap _ _ r * b) = algebraMap _ _ r * (d⌋b) := by rw [← Algebra.smul_def, map_smul, Algebra.smul_def] #align clifford_algebra.contract_left_algebra_map_mul CliffordAlgebra.contractLeft_algebraMap_mul theorem contractLeft_mul_algebraMap (a : CliffordAlgebra Q) (r : R) : d⌋(a * algebraMap _ _ r) = d⌋a * algebraMap _ _ r := by rw [← Algebra.commutes, contractLeft_algebraMap_mul, Algebra.commutes] #align clifford_algebra.contract_left_mul_algebra_map CliffordAlgebra.contractLeft_mul_algebraMap theorem contractRight_algebraMap_mul (r : R) (b : CliffordAlgebra Q) : algebraMap _ _ r * b⌊d = algebraMap _ _ r * (b⌊d) := by rw [← Algebra.smul_def, LinearMap.map_smul₂, Algebra.smul_def] #align clifford_algebra.contract_right_algebra_map_mul CliffordAlgebra.contractRight_algebraMap_mul
Mathlib/LinearAlgebra/CliffordAlgebra/Contraction.lean
159
161
theorem contractRight_mul_algebraMap (a : CliffordAlgebra Q) (r : R) : a * algebraMap _ _ r⌊d = a⌊d * algebraMap _ _ r := by
rw [← Algebra.commutes, contractRight_algebraMap_mul, Algebra.commutes]
0.875
import Mathlib.LinearAlgebra.AffineSpace.AffineEquiv import Mathlib.Topology.Algebra.Module.Basic open Function structure ContinuousAffineEquiv (k P₁ P₂ : Type*) {V₁ V₂ : Type*} [Ring k] [AddCommGroup V₁] [Module k V₁] [AddTorsor V₁ P₁] [TopologicalSpace P₁] [AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] [TopologicalSpace P₂] extends P₁ ≃ᵃ[k] P₂ where continuous_toFun : Continuous toFun := by continuity continuous_invFun : Continuous invFun := by continuity @[inherit_doc] notation:25 P₁ " ≃ᵃL[" k:25 "] " P₂:0 => ContinuousAffineEquiv k P₁ P₂ variable {k P₁ P₂ P₃ P₄ V₁ V₂ V₃ V₄ : Type*} [Ring k] [AddCommGroup V₁] [Module k V₁] [AddTorsor V₁ P₁] [AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] [AddCommGroup V₃] [Module k V₃] [AddTorsor V₃ P₃] [AddCommGroup V₄] [Module k V₄] [AddTorsor V₄ P₄] [TopologicalSpace P₁] [AddCommMonoid P₁] [Module k P₁] [TopologicalSpace P₂] [AddCommMonoid P₂] [Module k P₂] [TopologicalSpace P₃] [TopologicalSpace P₄] namespace ContinuousAffineEquiv -- Basic set-up: standard fields, coercions and ext lemmas section Basic def toHomeomorph (e : P₁ ≃ᵃL[k] P₂) : P₁ ≃ₜ P₂ where __ := e
Mathlib/LinearAlgebra/AffineSpace/ContinuousAffineEquiv.lean
65
67
theorem toAffineEquiv_injective : Injective (toAffineEquiv : (P₁ ≃ᵃL[k] P₂) → P₁ ≃ᵃ[k] P₂) := by
rintro ⟨e, econt, einv_cont⟩ ⟨e', e'cont, e'inv_cont⟩ H congr
0.875
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] 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] #align interior_Ico interior_Ico @[simp] theorem Ico_mem_nhds_iff [NoMinOrder α] {a b x : α} : Ico a b ∈ 𝓝 x ↔ x ∈ Ioo a b := by rw [← interior_Ico, mem_interior_iff_mem_nhds] @[simp] theorem interior_Ioc [NoMaxOrder α] {a b : α} : interior (Ioc a b) = Ioo a b := by rw [← Ioi_inter_Iic, interior_inter, interior_Ioi, interior_Iic, Ioi_inter_Iio] #align interior_Ioc interior_Ioc @[simp]
Mathlib/Topology/Order/DenselyOrdered.lean
125
126
theorem Ioc_mem_nhds_iff [NoMaxOrder α] {a b x : α} : Ioc a b ∈ 𝓝 x ↔ x ∈ Ioo a b := by
rw [← interior_Ioc, mem_interior_iff_mem_nhds]
0.875
import Mathlib.Algebra.Group.Defs #align_import algebra.invertible from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422" assert_not_exists MonoidWithZero assert_not_exists DenselyOrdered universe u variable {α : Type u} class Invertible [Mul α] [One α] (a : α) : Type u where invOf : α invOf_mul_self : invOf * a = 1 mul_invOf_self : a * invOf = 1 #align invertible Invertible prefix:max "⅟" =>-- This notation has the same precedence as `Inv.inv`. Invertible.invOf @[simp] theorem invOf_mul_self' [Mul α] [One α] (a : α) {_ : Invertible a} : ⅟ a * a = 1 := Invertible.invOf_mul_self theorem invOf_mul_self [Mul α] [One α] (a : α) [Invertible a] : ⅟ a * a = 1 := Invertible.invOf_mul_self #align inv_of_mul_self invOf_mul_self @[simp] theorem mul_invOf_self' [Mul α] [One α] (a : α) {_ : Invertible a} : a * ⅟ a = 1 := Invertible.mul_invOf_self theorem mul_invOf_self [Mul α] [One α] (a : α) [Invertible a] : a * ⅟ a = 1 := Invertible.mul_invOf_self #align mul_inv_of_self mul_invOf_self @[simp] theorem invOf_mul_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : ⅟ a * (a * b) = b := by rw [← mul_assoc, invOf_mul_self, one_mul] theorem invOf_mul_self_assoc [Monoid α] (a b : α) [Invertible a] : ⅟ a * (a * b) = b := by rw [← mul_assoc, invOf_mul_self, one_mul] #align inv_of_mul_self_assoc invOf_mul_self_assoc @[simp] theorem mul_invOf_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : a * (⅟ a * b) = b := by rw [← mul_assoc, mul_invOf_self, one_mul] theorem mul_invOf_self_assoc [Monoid α] (a b : α) [Invertible a] : a * (⅟ a * b) = b := by rw [← mul_assoc, mul_invOf_self, one_mul] #align mul_inv_of_self_assoc mul_invOf_self_assoc @[simp] theorem mul_invOf_mul_self_cancel' [Monoid α] (a b : α) {_ : Invertible b} : a * ⅟ b * b = a := by simp [mul_assoc]
Mathlib/Algebra/Group/Invertible/Defs.lean
136
137
theorem mul_invOf_mul_self_cancel [Monoid α] (a b : α) [Invertible b] : a * ⅟ b * b = a := by
simp [mul_assoc]
0.875
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Algebra.GroupPower.IterateHom import Mathlib.Algebra.Regular.Basic #align_import algebra.regular.pow from "leanprover-community/mathlib"@"46a64b5b4268c594af770c44d9e502afc6a515cb" variable {R : Type*} {a b : R} section Monoid variable [Monoid R]
Mathlib/Algebra/Regular/Pow.lean
31
32
theorem IsLeftRegular.pow (n : ℕ) (rla : IsLeftRegular a) : IsLeftRegular (a ^ n) := by
simp only [IsLeftRegular, ← mul_left_iterate, rla.iterate n]
0.875
import Mathlib.Algebra.Group.Prod import Mathlib.Algebra.Group.Units.Equiv import Mathlib.Algebra.GroupPower.IterateHom import Mathlib.Logic.Equiv.Set import Mathlib.Tactic.Common #align_import group_theory.perm.basic from "leanprover-community/mathlib"@"b86832321b586c6ac23ef8cdef6a7a27e42b13bd" universe u v namespace Equiv variable {α : Type u} {β : Type v} namespace Perm instance instOne : One (Perm α) where one := Equiv.refl _ instance instMul : Mul (Perm α) where mul f g := Equiv.trans g f instance instInv : Inv (Perm α) where inv := Equiv.symm instance instPowNat : Pow (Perm α) ℕ where pow f n := ⟨f^[n], f.symm^[n], f.left_inv.iterate _, f.right_inv.iterate _⟩ instance permGroup : Group (Perm α) where mul_assoc f g h := (trans_assoc _ _ _).symm one_mul := trans_refl mul_one := refl_trans mul_left_inv := self_trans_symm npow n f := f ^ n npow_succ n f := coe_fn_injective $ Function.iterate_succ _ _ zpow := zpowRec fun n f ↦ f ^ n zpow_succ' n f := coe_fn_injective $ Function.iterate_succ _ _ #align equiv.perm.perm_group Equiv.Perm.permGroup @[simp] theorem default_eq : (default : Perm α) = 1 := rfl #align equiv.perm.default_eq Equiv.Perm.default_eq @[simps] def equivUnitsEnd : Perm α ≃* Units (Function.End α) where -- Porting note: needed to add `.toFun`. toFun e := ⟨e.toFun, e.symm.toFun, e.self_comp_symm, e.symm_comp_self⟩ invFun u := ⟨(u : Function.End α), (↑u⁻¹ : Function.End α), congr_fun u.inv_val, congr_fun u.val_inv⟩ left_inv _ := ext fun _ => rfl right_inv _ := Units.ext rfl map_mul' _ _ := rfl #align equiv.perm.equiv_units_End Equiv.Perm.equivUnitsEnd #align equiv.perm.equiv_units_End_symm_apply_apply Equiv.Perm.equivUnitsEnd_symm_apply_apply #align equiv.perm.equiv_units_End_symm_apply_symm_apply Equiv.Perm.equivUnitsEnd_symm_apply_symm_apply @[simps!] def _root_.MonoidHom.toHomPerm {G : Type*} [Group G] (f : G →* Function.End α) : G →* Perm α := equivUnitsEnd.symm.toMonoidHom.comp f.toHomUnits #align monoid_hom.to_hom_perm MonoidHom.toHomPerm #align monoid_hom.to_hom_perm_apply_symm_apply MonoidHom.toHomPerm_apply_symm_apply #align monoid_hom.to_hom_perm_apply_apply MonoidHom.toHomPerm_apply_apply theorem mul_apply (f g : Perm α) (x) : (f * g) x = f (g x) := Equiv.trans_apply _ _ _ #align equiv.perm.mul_apply Equiv.Perm.mul_apply theorem one_apply (x) : (1 : Perm α) x = x := rfl #align equiv.perm.one_apply Equiv.Perm.one_apply @[simp] theorem inv_apply_self (f : Perm α) (x) : f⁻¹ (f x) = x := f.symm_apply_apply x #align equiv.perm.inv_apply_self Equiv.Perm.inv_apply_self @[simp] theorem apply_inv_self (f : Perm α) (x) : f (f⁻¹ x) = x := f.apply_symm_apply x #align equiv.perm.apply_inv_self Equiv.Perm.apply_inv_self theorem one_def : (1 : Perm α) = Equiv.refl α := rfl #align equiv.perm.one_def Equiv.Perm.one_def theorem mul_def (f g : Perm α) : f * g = g.trans f := rfl #align equiv.perm.mul_def Equiv.Perm.mul_def theorem inv_def (f : Perm α) : f⁻¹ = f.symm := rfl #align equiv.perm.inv_def Equiv.Perm.inv_def @[simp, norm_cast] lemma coe_one : ⇑(1 : Perm α) = id := rfl #align equiv.perm.coe_one Equiv.Perm.coe_one @[simp, norm_cast] lemma coe_mul (f g : Perm α) : ⇑(f * g) = f ∘ g := rfl #align equiv.perm.coe_mul Equiv.Perm.coe_mul @[norm_cast] lemma coe_pow (f : Perm α) (n : ℕ) : ⇑(f ^ n) = f^[n] := rfl #align equiv.perm.coe_pow Equiv.Perm.coe_pow @[simp] lemma iterate_eq_pow (f : Perm α) (n : ℕ) : f^[n] = ⇑(f ^ n) := rfl #align equiv.perm.iterate_eq_pow Equiv.Perm.iterate_eq_pow theorem eq_inv_iff_eq {f : Perm α} {x y : α} : x = f⁻¹ y ↔ f x = y := f.eq_symm_apply #align equiv.perm.eq_inv_iff_eq Equiv.Perm.eq_inv_iff_eq theorem inv_eq_iff_eq {f : Perm α} {x y : α} : f⁻¹ x = y ↔ x = f y := f.symm_apply_eq #align equiv.perm.inv_eq_iff_eq Equiv.Perm.inv_eq_iff_eq
Mathlib/GroupTheory/Perm/Basic.lean
125
127
theorem zpow_apply_comm {α : Type*} (σ : Perm α) (m n : ℤ) {x : α} : (σ ^ m) ((σ ^ n) x) = (σ ^ n) ((σ ^ m) x) := by
rw [← Equiv.Perm.mul_apply, ← Equiv.Perm.mul_apply, zpow_mul_comm]
0.875
import Mathlib.Algebra.Algebra.Hom import Mathlib.RingTheory.Ideal.Quotient #align_import algebra.ring_quot from "leanprover-community/mathlib"@"e5820f6c8fcf1b75bcd7738ae4da1c5896191f72" universe uR uS uT uA u₄ variable {R : Type uR} [Semiring R] variable {S : Type uS} [CommSemiring S] variable {T : Type uT} variable {A : Type uA} [Semiring A] [Algebra S A] namespace RingQuot inductive Rel (r : R → R → Prop) : R → R → Prop | of ⦃x y : R⦄ (h : r x y) : Rel r x y | add_left ⦃a b c⦄ : Rel r a b → Rel r (a + c) (b + c) | mul_left ⦃a b c⦄ : Rel r a b → Rel r (a * c) (b * c) | mul_right ⦃a b c⦄ : Rel r b c → Rel r (a * b) (a * c) #align ring_quot.rel RingQuot.Rel
Mathlib/Algebra/RingQuot.lean
62
64
theorem Rel.add_right {r : R → R → Prop} ⦃a b c : R⦄ (h : Rel r b c) : Rel r (a + b) (a + c) := by
rw [add_comm a b, add_comm a c] exact Rel.add_left h
0.875
import Mathlib.Data.Set.Equitable import Mathlib.Logic.Equiv.Fin import Mathlib.Order.Partition.Finpartition #align_import order.partition.equipartition from "leanprover-community/mathlib"@"b363547b3113d350d053abdf2884e9850a56b205" open Finset Fintype namespace Finpartition variable {α : Type*} [DecidableEq α] {s t : Finset α} (P : Finpartition s) def IsEquipartition : Prop := (P.parts : Set (Finset α)).EquitableOn card #align finpartition.is_equipartition Finpartition.IsEquipartition theorem isEquipartition_iff_card_parts_eq_average : P.IsEquipartition ↔ ∀ a : Finset α, a ∈ P.parts → a.card = s.card / P.parts.card ∨ a.card = s.card / P.parts.card + 1 := by simp_rw [IsEquipartition, Finset.equitableOn_iff, P.sum_card_parts] #align finpartition.is_equipartition_iff_card_parts_eq_average Finpartition.isEquipartition_iff_card_parts_eq_average variable {P} lemma not_isEquipartition : ¬P.IsEquipartition ↔ ∃ a ∈ P.parts, ∃ b ∈ P.parts, b.card + 1 < a.card := Set.not_equitableOn theorem _root_.Set.Subsingleton.isEquipartition (h : (P.parts : Set (Finset α)).Subsingleton) : P.IsEquipartition := Set.Subsingleton.equitableOn h _ #align finpartition.set.subsingleton.is_equipartition Set.Subsingleton.isEquipartition theorem IsEquipartition.card_parts_eq_average (hP : P.IsEquipartition) (ht : t ∈ P.parts) : t.card = s.card / P.parts.card ∨ t.card = s.card / P.parts.card + 1 := P.isEquipartition_iff_card_parts_eq_average.1 hP _ ht #align finpartition.is_equipartition.card_parts_eq_average Finpartition.IsEquipartition.card_parts_eq_average theorem IsEquipartition.card_part_eq_average_iff (hP : P.IsEquipartition) (ht : t ∈ P.parts) : t.card = s.card / P.parts.card ↔ t.card ≠ s.card / P.parts.card + 1 := by have a := hP.card_parts_eq_average ht have b : ¬(t.card = s.card / P.parts.card ∧ t.card = s.card / P.parts.card + 1) := by by_contra h; exact absurd (h.1 ▸ h.2) (lt_add_one _).ne tauto theorem IsEquipartition.average_le_card_part (hP : P.IsEquipartition) (ht : t ∈ P.parts) : s.card / P.parts.card ≤ t.card := by rw [← P.sum_card_parts] exact Finset.EquitableOn.le hP ht #align finpartition.is_equipartition.average_le_card_part Finpartition.IsEquipartition.average_le_card_part
Mathlib/Order/Partition/Equipartition.lean
74
77
theorem IsEquipartition.card_part_le_average_add_one (hP : P.IsEquipartition) (ht : t ∈ P.parts) : t.card ≤ s.card / P.parts.card + 1 := by
rw [← P.sum_card_parts] exact Finset.EquitableOn.le_add_one hP ht
0.875
import Mathlib.Init.Algebra.Classes import Mathlib.Init.Data.Ordering.Basic #align_import init.data.ordering.lemmas from "leanprover-community/lean"@"4bd314f7bd5e0c9e813fc201f1279a23f13f9f1d" universe u namespace Ordering @[simp] theorem ite_eq_lt_distrib (c : Prop) [Decidable c] (a b : Ordering) : ((if c then a else b) = Ordering.lt) = if c then a = Ordering.lt else b = Ordering.lt := by by_cases c <;> simp [*] #align ordering.ite_eq_lt_distrib Ordering.ite_eq_lt_distrib @[simp] theorem ite_eq_eq_distrib (c : Prop) [Decidable c] (a b : Ordering) : ((if c then a else b) = Ordering.eq) = if c then a = Ordering.eq else b = Ordering.eq := by by_cases c <;> simp [*] #align ordering.ite_eq_eq_distrib Ordering.ite_eq_eq_distrib @[simp]
Mathlib/Init/Data/Ordering/Lemmas.lean
32
34
theorem ite_eq_gt_distrib (c : Prop) [Decidable c] (a b : Ordering) : ((if c then a else b) = Ordering.gt) = if c then a = Ordering.gt else b = Ordering.gt := by
by_cases c <;> simp [*]
0.875
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ ℵ₀ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
46
48
theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≤ lift.{v} c ↔ 𝔠 ≤ c := by
-- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le]
0.875
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]
Mathlib/Data/List/Destutter.lean
48
49
theorem destutter'_cons_pos (h : R b a) : (a :: l).destutter' R b = b :: l.destutter' R a := by
rw [destutter', if_pos h]
0.875
import Mathlib.Algebra.Bounds import Mathlib.Algebra.Order.Field.Basic -- Porting note: `LinearOrderedField`, etc import Mathlib.Data.Set.Pointwise.SMul #align_import algebra.order.pointwise from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Function Set open Pointwise variable {α : Type*} -- Porting note: Swapped the place of `CompleteLattice` and `ConditionallyCompleteLattice` -- due to simpNF problem between `sSup_xx` `csSup_xx`. section CompleteLattice variable [CompleteLattice α] section Group variable [Group α] [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {s t : Set α} @[to_additive] theorem csSup_inv (hs₀ : s.Nonempty) (hs₁ : BddBelow s) : sSup s⁻¹ = (sInf s)⁻¹ := by rw [← image_inv] exact ((OrderIso.inv α).map_csInf' hs₀ hs₁).symm #align cSup_inv csSup_inv #align cSup_neg csSup_neg @[to_additive] theorem csInf_inv (hs₀ : s.Nonempty) (hs₁ : BddAbove s) : sInf s⁻¹ = (sSup s)⁻¹ := by rw [← image_inv] exact ((OrderIso.inv α).map_csSup' hs₀ hs₁).symm #align cInf_inv csInf_inv #align cInf_neg csInf_neg @[to_additive] theorem csSup_mul (hs₀ : s.Nonempty) (hs₁ : BddAbove s) (ht₀ : t.Nonempty) (ht₁ : BddAbove t) : sSup (s * t) = sSup s * sSup t := csSup_image2_eq_csSup_csSup (fun _ => (OrderIso.mulRight _).to_galoisConnection) (fun _ => (OrderIso.mulLeft _).to_galoisConnection) hs₀ hs₁ ht₀ ht₁ #align cSup_mul csSup_mul #align cSup_add csSup_add @[to_additive] theorem csInf_mul (hs₀ : s.Nonempty) (hs₁ : BddBelow s) (ht₀ : t.Nonempty) (ht₁ : BddBelow t) : sInf (s * t) = sInf s * sInf t := csInf_image2_eq_csInf_csInf (fun _ => (OrderIso.mulRight _).symm.to_galoisConnection) (fun _ => (OrderIso.mulLeft _).symm.to_galoisConnection) hs₀ hs₁ ht₀ ht₁ #align cInf_mul csInf_mul #align cInf_add csInf_add @[to_additive] theorem csSup_div (hs₀ : s.Nonempty) (hs₁ : BddAbove s) (ht₀ : t.Nonempty) (ht₁ : BddBelow t) : sSup (s / t) = sSup s / sInf t := by rw [div_eq_mul_inv, csSup_mul hs₀ hs₁ ht₀.inv ht₁.inv, csSup_inv ht₀ ht₁, div_eq_mul_inv] #align cSup_div csSup_div #align cSup_sub csSup_sub @[to_additive]
Mathlib/Algebra/Order/Pointwise.lean
167
169
theorem csInf_div (hs₀ : s.Nonempty) (hs₁ : BddBelow s) (ht₀ : t.Nonempty) (ht₁ : BddAbove t) : sInf (s / t) = sInf s / sSup t := by
rw [div_eq_mul_inv, csInf_mul hs₀ hs₁ ht₀.inv ht₁.inv, csInf_inv ht₀ ht₁, div_eq_mul_inv]
0.875
import Mathlib.Data.Sigma.Lex import Mathlib.Order.BoundedOrder import Mathlib.Mathport.Notation import Mathlib.Data.Sigma.Basic #align_import data.sigma.order from "leanprover-community/mathlib"@"1fc36cc9c8264e6e81253f88be7fb2cb6c92d76a" namespace Sigma variable {ι : Type*} {α : ι → Type*} -- Porting note: I made this `le` instead of `LE` because the output type is `Prop` protected inductive le [∀ i, LE (α i)] : ∀ _a _b : Σ i, α i, Prop | fiber (i : ι) (a b : α i) : a ≤ b → Sigma.le ⟨i, a⟩ ⟨i, b⟩ #align sigma.le Sigma.le protected inductive lt [∀ i, LT (α i)] : ∀ _a _b : Σi, α i, Prop | fiber (i : ι) (a b : α i) : a < b → Sigma.lt ⟨i, a⟩ ⟨i, b⟩ #align sigma.lt Sigma.lt protected instance LE [∀ i, LE (α i)] : LE (Σi, α i) where le := Sigma.le protected instance LT [∀ i, LT (α i)] : LT (Σi, α i) where lt := Sigma.lt @[simp] theorem mk_le_mk_iff [∀ i, LE (α i)] {i : ι} {a b : α i} : (⟨i, a⟩ : Sigma α) ≤ ⟨i, b⟩ ↔ a ≤ b := ⟨fun ⟨_, _, _, h⟩ => h, Sigma.le.fiber _ _ _⟩ #align sigma.mk_le_mk_iff Sigma.mk_le_mk_iff @[simp] theorem mk_lt_mk_iff [∀ i, LT (α i)] {i : ι} {a b : α i} : (⟨i, a⟩ : Sigma α) < ⟨i, b⟩ ↔ a < b := ⟨fun ⟨_, _, _, h⟩ => h, Sigma.lt.fiber _ _ _⟩ #align sigma.mk_lt_mk_iff Sigma.mk_lt_mk_iff theorem le_def [∀ i, LE (α i)] {a b : Σi, α i} : a ≤ b ↔ ∃ h : a.1 = b.1, h.rec a.2 ≤ b.2 := by constructor · rintro ⟨i, a, b, h⟩ exact ⟨rfl, h⟩ · obtain ⟨i, a⟩ := a obtain ⟨j, b⟩ := b rintro ⟨rfl : i = j, h⟩ exact le.fiber _ _ _ h #align sigma.le_def Sigma.le_def
Mathlib/Data/Sigma/Order.lean
89
96
theorem lt_def [∀ i, LT (α i)] {a b : Σi, α i} : a < b ↔ ∃ h : a.1 = b.1, h.rec a.2 < b.2 := by
constructor · rintro ⟨i, a, b, h⟩ exact ⟨rfl, h⟩ · obtain ⟨i, a⟩ := a obtain ⟨j, b⟩ := b rintro ⟨rfl : i = j, h⟩ exact lt.fiber _ _ _ h
0.875
import Mathlib.SetTheory.Ordinal.Arithmetic import Mathlib.SetTheory.Ordinal.Exponential #align_import set_theory.ordinal.cantor_normal_form from "leanprover-community/mathlib"@"991ff3b5269848f6dd942ae8e9dd3c946035dc8b" noncomputable section universe u open List namespace Ordinal @[elab_as_elim] noncomputable def CNFRec (b : Ordinal) {C : Ordinal → Sort*} (H0 : C 0) (H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) : ∀ o, C o := fun o ↦ by by_cases h : o = 0 · rw [h]; exact H0 · exact H o h (CNFRec _ H0 H (o % b ^ log b o)) termination_by o => o decreasing_by exact mod_opow_log_lt_self b h set_option linter.uppercaseLean3 false in #align ordinal.CNF_rec Ordinal.CNFRec @[simp] theorem CNFRec_zero {C : Ordinal → Sort*} (b : Ordinal) (H0 : C 0) (H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) : @CNFRec b C H0 H 0 = H0 := by rw [CNFRec, dif_pos rfl] rfl set_option linter.uppercaseLean3 false in #align ordinal.CNF_rec_zero Ordinal.CNFRec_zero
Mathlib/SetTheory/Ordinal/CantorNormalForm.lean
62
64
theorem CNFRec_pos (b : Ordinal) {o : Ordinal} {C : Ordinal → Sort*} (ho : o ≠ 0) (H0 : C 0) (H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) : @CNFRec b C H0 H o = H o ho (@CNFRec b C H0 H _) := by
rw [CNFRec, dif_neg ho]
0.875
import Mathlib.Order.Interval.Set.OrdConnected import Mathlib.Data.Set.Lattice #align_import data.set.intervals.ord_connected_component from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Interval Function OrderDual namespace Set variable {α : Type*} [LinearOrder α] {s t : Set α} {x y z : α} def ordConnectedComponent (s : Set α) (x : α) : Set α := { y | [[x, y]] ⊆ s } #align set.ord_connected_component Set.ordConnectedComponent theorem mem_ordConnectedComponent : y ∈ ordConnectedComponent s x ↔ [[x, y]] ⊆ s := Iff.rfl #align set.mem_ord_connected_component Set.mem_ordConnectedComponent theorem dual_ordConnectedComponent : ordConnectedComponent (ofDual ⁻¹' s) (toDual x) = ofDual ⁻¹' ordConnectedComponent s x := ext <| (Surjective.forall toDual.surjective).2 fun x => by rw [mem_ordConnectedComponent, dual_uIcc] rfl #align set.dual_ord_connected_component Set.dual_ordConnectedComponent theorem ordConnectedComponent_subset : ordConnectedComponent s x ⊆ s := fun _ hy => hy right_mem_uIcc #align set.ord_connected_component_subset Set.ordConnectedComponent_subset theorem subset_ordConnectedComponent {t} [h : OrdConnected s] (hs : x ∈ s) (ht : s ⊆ t) : s ⊆ ordConnectedComponent t x := fun _ hy => (h.uIcc_subset hs hy).trans ht #align set.subset_ord_connected_component Set.subset_ordConnectedComponent @[simp]
Mathlib/Order/Interval/Set/OrdConnectedComponent.lean
53
54
theorem self_mem_ordConnectedComponent : x ∈ ordConnectedComponent s x ↔ x ∈ s := by
rw [mem_ordConnectedComponent, uIcc_self, singleton_subset_iff]
0.875
import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.TensorProduct.Tower import Mathlib.RingTheory.Adjoin.Basic import Mathlib.LinearAlgebra.DirectSum.Finsupp #align_import ring_theory.tensor_product from "leanprover-community/mathlib"@"88fcdc3da43943f5b01925deddaa5bf0c0e85e4e" suppress_compilation open scoped TensorProduct open TensorProduct namespace LinearMap open TensorProduct section Semiring variable {R A B M N P : Type*} [CommSemiring R] variable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] variable [Module R M] [Module R N] [Module R P] variable (r : R) (f g : M →ₗ[R] N) variable (A) def baseChange (f : M →ₗ[R] N) : A ⊗[R] M →ₗ[A] A ⊗[R] N := AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) f #align linear_map.base_change LinearMap.baseChange variable {A} @[simp] theorem baseChange_tmul (a : A) (x : M) : f.baseChange A (a ⊗ₜ x) = a ⊗ₜ f x := rfl #align linear_map.base_change_tmul LinearMap.baseChange_tmul theorem baseChange_eq_ltensor : (f.baseChange A : A ⊗ M → A ⊗ N) = f.lTensor A := rfl #align linear_map.base_change_eq_ltensor LinearMap.baseChange_eq_ltensor @[simp] theorem baseChange_add : (f + g).baseChange A = f.baseChange A + g.baseChange A := by ext -- Porting note: added `-baseChange_tmul` simp [baseChange_eq_ltensor, -baseChange_tmul] #align linear_map.base_change_add LinearMap.baseChange_add @[simp] theorem baseChange_zero : baseChange A (0 : M →ₗ[R] N) = 0 := by ext simp [baseChange_eq_ltensor] #align linear_map.base_change_zero LinearMap.baseChange_zero @[simp]
Mathlib/RingTheory/TensorProduct/Basic.lean
96
98
theorem baseChange_smul : (r • f).baseChange A = r • f.baseChange A := by
ext simp [baseChange_tmul]
0.875
import Mathlib.Algebra.GroupPower.IterateHom import Mathlib.Algebra.Module.Defs import Mathlib.Algebra.Order.Archimedean import Mathlib.Algebra.Order.Group.Instances import Mathlib.GroupTheory.GroupAction.Pi open Function Set structure AddConstMap (G H : Type*) [Add G] [Add H] (a : G) (b : H) where protected toFun : G → H map_add_const' (x : G) : toFun (x + a) = toFun x + b @[inherit_doc] scoped [AddConstMap] notation:25 G " →+c[" a ", " b "] " H => AddConstMap G H a b class AddConstMapClass (F : Type*) (G H : outParam Type*) [Add G] [Add H] (a : outParam G) (b : outParam H) extends DFunLike F G fun _ ↦ H where map_add_const (f : F) (x : G) : f (x + a) = f x + b namespace AddConstMapClass attribute [simp] map_add_const variable {F G H : Type*} {a : G} {b : H} protected theorem semiconj [Add G] [Add H] [AddConstMapClass F G H a b] (f : F) : Semiconj f (· + a) (· + b) := map_add_const f @[simp] theorem map_add_nsmul [AddMonoid G] [AddMonoid H] [AddConstMapClass F G H a b] (f : F) (x : G) (n : ℕ) : f (x + n • a) = f x + n • b := by simpa using (AddConstMapClass.semiconj f).iterate_right n x @[simp] theorem map_add_nat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b] (f : F) (x : G) (n : ℕ) : f (x + n) = f x + n • b := by simp [← map_add_nsmul] theorem map_add_one [AddMonoidWithOne G] [Add H] [AddConstMapClass F G H 1 b] (f : F) (x : G) : f (x + 1) = f x + b := map_add_const f x @[simp] theorem map_add_ofNat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b] (f : F) (x : G) (n : ℕ) [n.AtLeastTwo] : f (x + no_index (OfNat.ofNat n)) = f x + (OfNat.ofNat n : ℕ) • b := map_add_nat' f x n theorem map_add_nat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1] (f : F) (x : G) (n : ℕ) : f (x + n) = f x + n := by simp theorem map_add_ofNat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1] (f : F) (x : G) (n : ℕ) [n.AtLeastTwo] : f (x + OfNat.ofNat n) = f x + OfNat.ofNat n := map_add_nat f x n @[simp] theorem map_const [AddZeroClass G] [Add H] [AddConstMapClass F G H a b] (f : F) : f a = f 0 + b := by simpa using map_add_const f 0 theorem map_one [AddZeroClass G] [One G] [Add H] [AddConstMapClass F G H 1 b] (f : F) : f 1 = f 0 + b := map_const f @[simp] theorem map_nsmul_const [AddMonoid G] [AddMonoid H] [AddConstMapClass F G H a b] (f : F) (n : ℕ) : f (n • a) = f 0 + n • b := by simpa using map_add_nsmul f 0 n @[simp] theorem map_nat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b] (f : F) (n : ℕ) : f n = f 0 + n • b := by simpa using map_add_nat' f 0 n theorem map_ofNat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b] (f : F) (n : ℕ) [n.AtLeastTwo] : f (OfNat.ofNat n) = f 0 + (OfNat.ofNat n : ℕ) • b := map_nat' f n
Mathlib/Algebra/AddConstMap/Basic.lean
121
122
theorem map_nat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1] (f : F) (n : ℕ) : f n = f 0 + n := by
simp
0.875
import Mathlib.CategoryTheory.Filtered.Connected import Mathlib.CategoryTheory.Limits.TypesFiltered import Mathlib.CategoryTheory.Limits.Final universe v₁ v₂ u₁ u₂ namespace CategoryTheory open CategoryTheory.Limits CategoryTheory.Functor Opposite section ArbitraryUniverses variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (F : C ⥤ D) theorem Functor.final_of_isFiltered_structuredArrow [∀ d, IsFiltered (StructuredArrow d F)] : Final F where out _ := IsFiltered.isConnected _ theorem Functor.initial_of_isCofiltered_costructuredArrow [∀ d, IsCofiltered (CostructuredArrow F d)] : Initial F where out _ := IsCofiltered.isConnected _ theorem isFiltered_structuredArrow_of_isFiltered_of_exists [IsFilteredOrEmpty C] (h₁ : ∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) (h₂ : ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c), ∃ (c' : C) (t : c ⟶ c'), s ≫ F.map t = s' ≫ F.map t) (d : D) : IsFiltered (StructuredArrow d F) := by have : Nonempty (StructuredArrow d F) := by obtain ⟨c, ⟨f⟩⟩ := h₁ d exact ⟨.mk f⟩ suffices IsFilteredOrEmpty (StructuredArrow d F) from IsFiltered.mk refine ⟨fun f g => ?_, fun f g η μ => ?_⟩ · obtain ⟨c, ⟨t, ht⟩⟩ := h₂ (f.hom ≫ F.map (IsFiltered.leftToMax f.right g.right)) (g.hom ≫ F.map (IsFiltered.rightToMax f.right g.right)) refine ⟨.mk (f.hom ≫ F.map (IsFiltered.leftToMax f.right g.right ≫ t)), ?_, ?_, trivial⟩ · exact StructuredArrow.homMk (IsFiltered.leftToMax _ _ ≫ t) rfl · exact StructuredArrow.homMk (IsFiltered.rightToMax _ _ ≫ t) (by simpa using ht.symm) · refine ⟨.mk (f.hom ≫ F.map (η.right ≫ IsFiltered.coeqHom η.right μ.right)), StructuredArrow.homMk (IsFiltered.coeqHom η.right μ.right) (by simp), ?_⟩ simpa using IsFiltered.coeq_condition _ _ theorem isCofiltered_costructuredArrow_of_isCofiltered_of_exists [IsCofilteredOrEmpty C] (h₁ : ∀ d, ∃ c, Nonempty (F.obj c ⟶ d)) (h₂ : ∀ {d : D} {c : C} (s s' : F.obj c ⟶ d), ∃ (c' : C) (t : c' ⟶ c), F.map t ≫ s = F.map t ≫ s') (d : D) : IsCofiltered (CostructuredArrow F d) := by suffices IsFiltered (CostructuredArrow F d)ᵒᵖ from isCofiltered_of_isFiltered_op _ suffices IsFiltered (StructuredArrow (op d) F.op) from IsFiltered.of_equivalence (costructuredArrowOpEquivalence _ _).symm apply isFiltered_structuredArrow_of_isFiltered_of_exists · intro d obtain ⟨c, ⟨t⟩⟩ := h₁ d.unop exact ⟨op c, ⟨Quiver.Hom.op t⟩⟩ · intro d c s s' obtain ⟨c', t, ht⟩ := h₂ s.unop s'.unop exact ⟨op c', Quiver.Hom.op t, Quiver.Hom.unop_inj ht⟩ theorem Functor.final_of_exists_of_isFiltered [IsFilteredOrEmpty C] (h₁ : ∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) (h₂ : ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c), ∃ (c' : C) (t : c ⟶ c'), s ≫ F.map t = s' ≫ F.map t) : Functor.Final F := by suffices ∀ d, IsFiltered (StructuredArrow d F) from final_of_isFiltered_structuredArrow F exact isFiltered_structuredArrow_of_isFiltered_of_exists F h₁ h₂
Mathlib/CategoryTheory/Filtered/Final.lean
99
104
theorem Functor.initial_of_exists_of_isCofiltered [IsCofilteredOrEmpty C] (h₁ : ∀ d, ∃ c, Nonempty (F.obj c ⟶ d)) (h₂ : ∀ {d : D} {c : C} (s s' : F.obj c ⟶ d), ∃ (c' : C) (t : c' ⟶ c), F.map t ≫ s = F.map t ≫ s') : Functor.Initial F := by
suffices ∀ d, IsCofiltered (CostructuredArrow F d) from initial_of_isCofiltered_costructuredArrow F exact isCofiltered_costructuredArrow_of_isCofiltered_of_exists F h₁ h₂
0.875
import Mathlib.Data.Matrix.Invertible import Mathlib.LinearAlgebra.Matrix.Adjugate import Mathlib.LinearAlgebra.FiniteDimensional #align_import linear_algebra.matrix.nonsingular_inverse from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422" namespace Matrix universe u u' v variable {l : Type*} {m : Type u} {n : Type u'} {α : Type v} open Matrix Equiv Equiv.Perm Finset section Inv variable [Fintype n] [DecidableEq n] [CommRing α] variable (A : Matrix n n α) (B : Matrix n n α) theorem isUnit_det_transpose (h : IsUnit A.det) : IsUnit Aᵀ.det := by rw [det_transpose] exact h #align matrix.is_unit_det_transpose Matrix.isUnit_det_transpose noncomputable instance inv : Inv (Matrix n n α) := ⟨fun A => Ring.inverse A.det • A.adjugate⟩ theorem inv_def (A : Matrix n n α) : A⁻¹ = Ring.inverse A.det • A.adjugate := rfl #align matrix.inv_def Matrix.inv_def
Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean
221
222
theorem nonsing_inv_apply_not_isUnit (h : ¬IsUnit A.det) : A⁻¹ = 0 := by
rw [inv_def, Ring.inverse_non_unit _ h, zero_smul]
0.875
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ ∃ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : ¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f ≠ 0 := (not_separable_zero <| · ▸ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C
Mathlib/FieldTheory/Separable.lean
76
78
theorem separable_X : (X : R[X]).Separable := by
rw [separable_def, derivative_X] exact isCoprime_one_right
0.875
import Mathlib.Algebra.Order.Ring.Nat #align_import data.nat.dist from "leanprover-community/mathlib"@"d50b12ae8e2bd910d08a94823976adae9825718b" namespace Nat def dist (n m : ℕ) := n - m + (m - n) #align nat.dist Nat.dist -- Should be aligned to `Nat.dist.eq_def`, but that is generated on demand and isn't present yet. #noalign nat.dist.def theorem dist_comm (n m : ℕ) : dist n m = dist m n := by simp [dist, add_comm] #align nat.dist_comm Nat.dist_comm @[simp] theorem dist_self (n : ℕ) : dist n n = 0 := by simp [dist, tsub_self] #align nat.dist_self Nat.dist_self theorem eq_of_dist_eq_zero {n m : ℕ} (h : dist n m = 0) : n = m := have : n - m = 0 := Nat.eq_zero_of_add_eq_zero_right h have : n ≤ m := tsub_eq_zero_iff_le.mp this have : m - n = 0 := Nat.eq_zero_of_add_eq_zero_left h have : m ≤ n := tsub_eq_zero_iff_le.mp this le_antisymm ‹n ≤ m› ‹m ≤ n› #align nat.eq_of_dist_eq_zero Nat.eq_of_dist_eq_zero theorem dist_eq_zero {n m : ℕ} (h : n = m) : dist n m = 0 := by rw [h, dist_self] #align nat.dist_eq_zero Nat.dist_eq_zero
Mathlib/Data/Nat/Dist.lean
45
46
theorem dist_eq_sub_of_le {n m : ℕ} (h : n ≤ m) : dist n m = m - n := by
rw [dist, tsub_eq_zero_iff_le.mpr h, zero_add]
0.875
import Mathlib.Geometry.Euclidean.Angle.Oriented.Affine import Mathlib.Geometry.Euclidean.Angle.Unoriented.RightAngle #align_import geometry.euclidean.angle.oriented.right_angle from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped EuclideanGeometry open scoped Real open scoped RealInnerProductSpace namespace Orientation open FiniteDimensional variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] variable [hd2 : Fact (finrank ℝ V = 2)] (o : Orientation ℝ V (Fin 2)) theorem oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) : o.oangle x (x + y) = Real.arccos (‖x‖ / ‖x + y‖) := by have hs : (o.oangle x (x + y)).sign = 1 := by rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two] rw [o.oangle_eq_angle_of_sign_eq_one hs, InnerProductGeometry.angle_add_eq_arccos_of_inner_eq_zero (o.inner_eq_zero_of_oangle_eq_pi_div_two h)] #align orientation.oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two Orientation.oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two theorem oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) : o.oangle (x + y) y = Real.arccos (‖y‖ / ‖x + y‖) := by rw [← neg_inj, oangle_rev, ← oangle_neg_orientation_eq_neg, neg_inj] at h ⊢ rw [add_comm] exact (-o).oangle_add_right_eq_arccos_of_oangle_eq_pi_div_two h #align orientation.oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two Orientation.oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two theorem oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) : o.oangle x (x + y) = Real.arcsin (‖y‖ / ‖x + y‖) := by have hs : (o.oangle x (x + y)).sign = 1 := by rw [oangle_sign_add_right, h, Real.Angle.sign_coe_pi_div_two] rw [o.oangle_eq_angle_of_sign_eq_one hs, InnerProductGeometry.angle_add_eq_arcsin_of_inner_eq_zero (o.inner_eq_zero_of_oangle_eq_pi_div_two h) (Or.inl (o.left_ne_zero_of_oangle_eq_pi_div_two h))] #align orientation.oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two Orientation.oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two
Mathlib/Geometry/Euclidean/Angle/Oriented/RightAngle.lean
65
69
theorem oangle_add_left_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) : o.oangle (x + y) y = Real.arcsin (‖x‖ / ‖x + y‖) := by
rw [← neg_inj, oangle_rev, ← oangle_neg_orientation_eq_neg, neg_inj] at h ⊢ rw [add_comm] exact (-o).oangle_add_right_eq_arcsin_of_oangle_eq_pi_div_two h
0.875
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ι : Type u} {α β : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter α) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : ∀ S : Set (Set α), (#S < c) → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l variable {l : Filter α} theorem cardinal_sInter_mem {S : Set (Set α)} [CardinalInterFilter l c] (hSc : #S < c) : ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter α) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter α) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter α) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter α) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≤ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter α) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c] theorem cardinal_iInter_mem {s : ι → Set α} (hic : #ι < c) : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l := by rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range theorem cardinal_bInter_mem {S : Set ι} (hS : #S < c) {s : ∀ i ∈ S, Set α} : (⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by rw [biInter_eq_iInter] exact (cardinal_iInter_mem hS).trans Subtype.forall theorem eventually_cardinal_forall {p : α → ι → Prop} (hic : #ι < c) : (∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by simp only [Filter.Eventually, setOf_forall] exact cardinal_iInter_mem hic
Mathlib/Order/Filter/CardinalInter.lean
107
111
theorem eventually_cardinal_ball {S : Set ι} (hS : #S < c) {p : α → ∀ i ∈ S, Prop} : (∀ᶠ x in l, ∀ i hi, p x i hi) ↔ ∀ i hi, ∀ᶠ x in l, p x i hi := by
simp only [Filter.Eventually, setOf_forall] exact cardinal_bInter_mem hS
0.875
import Mathlib.Algebra.Order.Ring.Nat import Mathlib.Data.List.Chain #align_import data.bool.count from "leanprover-community/mathlib"@"8631e2d5ea77f6c13054d9151d82b83069680cb1" namespace List @[simp] theorem count_not_add_count (l : List Bool) (b : Bool) : count (!b) l + count b l = length l := by -- Porting note: Proof re-written -- Old proof: simp only [length_eq_countP_add_countP (Eq (!b)), Bool.not_not_eq, count] simp only [length_eq_countP_add_countP (· == !b), count, add_right_inj] suffices (fun x => x == b) = (fun a => decide ¬(a == !b) = true) by rw [this] ext x; cases x <;> cases b <;> rfl #align list.count_bnot_add_count List.count_not_add_count @[simp]
Mathlib/Data/Bool/Count.lean
33
34
theorem count_add_count_not (l : List Bool) (b : Bool) : count b l + count (!b) l = length l := by
rw [add_comm, count_not_add_count]
0.875
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.SpecialFunctions.Sqrt import Mathlib.Analysis.NormedSpace.HomeomorphBall #align_import analysis.inner_product_space.calculus from "leanprover-community/mathlib"@"f9dd3204df14a0749cd456fac1e6849dfe7d2b88" noncomputable section open RCLike Real Filter open scoped Classical Topology section PiLike open ContinuousLinearMap variable {𝕜 ι H : Type*} [RCLike 𝕜] [NormedAddCommGroup H] [NormedSpace 𝕜 H] [Fintype ι] {f : H → EuclideanSpace 𝕜 ι} {f' : H →L[𝕜] EuclideanSpace 𝕜 ι} {t : Set H} {y : H} theorem differentiableWithinAt_euclidean : DifferentiableWithinAt 𝕜 f t y ↔ ∀ i, DifferentiableWithinAt 𝕜 (fun x => f x i) t y := by rw [← (EuclideanSpace.equiv ι 𝕜).comp_differentiableWithinAt_iff, differentiableWithinAt_pi] rfl #align differentiable_within_at_euclidean differentiableWithinAt_euclidean theorem differentiableAt_euclidean : DifferentiableAt 𝕜 f y ↔ ∀ i, DifferentiableAt 𝕜 (fun x => f x i) y := by rw [← (EuclideanSpace.equiv ι 𝕜).comp_differentiableAt_iff, differentiableAt_pi] rfl #align differentiable_at_euclidean differentiableAt_euclidean theorem differentiableOn_euclidean : DifferentiableOn 𝕜 f t ↔ ∀ i, DifferentiableOn 𝕜 (fun x => f x i) t := by rw [← (EuclideanSpace.equiv ι 𝕜).comp_differentiableOn_iff, differentiableOn_pi] rfl #align differentiable_on_euclidean differentiableOn_euclidean theorem differentiable_euclidean : Differentiable 𝕜 f ↔ ∀ i, Differentiable 𝕜 fun x => f x i := by rw [← (EuclideanSpace.equiv ι 𝕜).comp_differentiable_iff, differentiable_pi] rfl #align differentiable_euclidean differentiable_euclidean theorem hasStrictFDerivAt_euclidean : HasStrictFDerivAt f f' y ↔ ∀ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y := by rw [← (EuclideanSpace.equiv ι 𝕜).comp_hasStrictFDerivAt_iff, hasStrictFDerivAt_pi'] rfl #align has_strict_fderiv_at_euclidean hasStrictFDerivAt_euclidean theorem hasFDerivWithinAt_euclidean : HasFDerivWithinAt f f' t y ↔ ∀ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y := by rw [← (EuclideanSpace.equiv ι 𝕜).comp_hasFDerivWithinAt_iff, hasFDerivWithinAt_pi'] rfl #align has_fderiv_within_at_euclidean hasFDerivWithinAt_euclidean
Mathlib/Analysis/InnerProductSpace/Calculus.lean
347
350
theorem contDiffWithinAt_euclidean {n : ℕ∞} : ContDiffWithinAt 𝕜 n f t y ↔ ∀ i, ContDiffWithinAt 𝕜 n (fun x => f x i) t y := by
rw [← (EuclideanSpace.equiv ι 𝕜).comp_contDiffWithinAt_iff, contDiffWithinAt_pi] rfl
0.875
import Mathlib.Algebra.CharZero.Lemmas import Mathlib.Algebra.GroupWithZero.Commute import Mathlib.Algebra.Order.Field.Basic import Mathlib.Algebra.Order.Ring.Pow import Mathlib.Algebra.Ring.Int #align_import algebra.order.field.power from "leanprover-community/mathlib"@"acb3d204d4ee883eb686f45d486a2a6811a01329" variable {α : Type*} open Function Int section LinearOrderedSemifield variable [LinearOrderedSemifield α] {a b c d e : α} {m n : ℤ} @[gcongr] theorem zpow_le_of_le (ha : 1 ≤ a) (h : m ≤ n) : a ^ m ≤ a ^ n := by have ha₀ : 0 < a := one_pos.trans_le ha lift n - m to ℕ using sub_nonneg.2 h with k hk calc a ^ m = a ^ m * 1 := (mul_one _).symm _ ≤ a ^ m * a ^ k := mul_le_mul_of_nonneg_left (one_le_pow_of_one_le ha _) (zpow_nonneg ha₀.le _) _ = a ^ n := by rw [← zpow_natCast, ← zpow_add₀ ha₀.ne', hk, add_sub_cancel] #align zpow_le_of_le zpow_le_of_le theorem zpow_le_one_of_nonpos (ha : 1 ≤ a) (hn : n ≤ 0) : a ^ n ≤ 1 := (zpow_le_of_le ha hn).trans_eq <| zpow_zero _ #align zpow_le_one_of_nonpos zpow_le_one_of_nonpos theorem one_le_zpow_of_nonneg (ha : 1 ≤ a) (hn : 0 ≤ n) : 1 ≤ a ^ n := (zpow_zero _).symm.trans_le <| zpow_le_of_le ha hn #align one_le_zpow_of_nonneg one_le_zpow_of_nonneg protected theorem Nat.zpow_pos_of_pos {a : ℕ} (h : 0 < a) (n : ℤ) : 0 < (a : α) ^ n := by apply zpow_pos_of_pos exact mod_cast h #align nat.zpow_pos_of_pos Nat.zpow_pos_of_pos theorem Nat.zpow_ne_zero_of_pos {a : ℕ} (h : 0 < a) (n : ℤ) : (a : α) ^ n ≠ 0 := (Nat.zpow_pos_of_pos h n).ne' #align nat.zpow_ne_zero_of_pos Nat.zpow_ne_zero_of_pos theorem one_lt_zpow (ha : 1 < a) : ∀ n : ℤ, 0 < n → 1 < a ^ n | (n : ℕ), h => (zpow_natCast _ _).symm.subst (one_lt_pow ha <| Int.natCast_ne_zero.mp h.ne') | -[_+1], h => ((Int.negSucc_not_pos _).mp h).elim #align one_lt_zpow one_lt_zpow theorem zpow_strictMono (hx : 1 < a) : StrictMono (a ^ · : ℤ → α) := strictMono_int_of_lt_succ fun n => have xpos : 0 < a := zero_lt_one.trans hx calc a ^ n < a ^ n * a := lt_mul_of_one_lt_right (zpow_pos_of_pos xpos _) hx _ = a ^ (n + 1) := (zpow_add_one₀ xpos.ne' _).symm #align zpow_strict_mono zpow_strictMono theorem zpow_strictAnti (h₀ : 0 < a) (h₁ : a < 1) : StrictAnti (a ^ · : ℤ → α) := strictAnti_int_of_succ_lt fun n => calc a ^ (n + 1) = a ^ n * a := zpow_add_one₀ h₀.ne' _ _ < a ^ n * 1 := (mul_lt_mul_left <| zpow_pos_of_pos h₀ _).2 h₁ _ = a ^ n := mul_one _ #align zpow_strict_anti zpow_strictAnti @[simp] theorem zpow_lt_iff_lt (hx : 1 < a) : a ^ m < a ^ n ↔ m < n := (zpow_strictMono hx).lt_iff_lt #align zpow_lt_iff_lt zpow_lt_iff_lt @[gcongr] alias ⟨_, GCongr.zpow_lt_of_lt⟩ := zpow_lt_iff_lt @[deprecated (since := "2024-02-10")] alias zpow_lt_of_lt := GCongr.zpow_lt_of_lt @[simp] theorem zpow_le_iff_le (hx : 1 < a) : a ^ m ≤ a ^ n ↔ m ≤ n := (zpow_strictMono hx).le_iff_le #align zpow_le_iff_le zpow_le_iff_le @[simp] theorem div_pow_le (ha : 0 ≤ a) (hb : 1 ≤ b) (k : ℕ) : a / b ^ k ≤ a := div_le_self ha <| one_le_pow_of_one_le hb _ #align div_pow_le div_pow_le
Mathlib/Algebra/Order/Field/Power.lean
97
100
theorem zpow_injective (h₀ : 0 < a) (h₁ : a ≠ 1) : Injective (a ^ · : ℤ → α) := by
rcases h₁.lt_or_lt with (H | H) · exact (zpow_strictAnti h₀ H).injective · exact (zpow_strictMono H).injective
0.875
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 LinearOrderedField variable [LinearOrderedField α] {a : α} @[simp] theorem preimage_mul_const_Iio (a : α) {c : α} (h : 0 < c) : (fun x => x * c) ⁻¹' Iio a = Iio (a / c) := ext fun _x => (lt_div_iff h).symm #align set.preimage_mul_const_Iio Set.preimage_mul_const_Iio @[simp] theorem preimage_mul_const_Ioi (a : α) {c : α} (h : 0 < c) : (fun x => x * c) ⁻¹' Ioi a = Ioi (a / c) := ext fun _x => (div_lt_iff h).symm #align set.preimage_mul_const_Ioi Set.preimage_mul_const_Ioi @[simp] theorem preimage_mul_const_Iic (a : α) {c : α} (h : 0 < c) : (fun x => x * c) ⁻¹' Iic a = Iic (a / c) := ext fun _x => (le_div_iff h).symm #align set.preimage_mul_const_Iic Set.preimage_mul_const_Iic @[simp] theorem preimage_mul_const_Ici (a : α) {c : α} (h : 0 < c) : (fun x => x * c) ⁻¹' Ici a = Ici (a / c) := ext fun _x => (div_le_iff h).symm #align set.preimage_mul_const_Ici Set.preimage_mul_const_Ici @[simp]
Mathlib/Data/Set/Pointwise/Interval.lean
619
620
theorem preimage_mul_const_Ioo (a b : α) {c : α} (h : 0 < c) : (fun x => x * c) ⁻¹' Ioo a b = Ioo (a / c) (b / c) := by
simp [← Ioi_inter_Iio, h]
0.875
import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Data.Set.UnionLift #align_import algebra.algebra.subalgebra.basic from "leanprover-community/mathlib"@"b915e9392ecb2a861e1e766f0e1df6ac481188ca" namespace Subalgebra open Algebra variable {R A B : Type*} [CommSemiring R] [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] variable (S : Subalgebra R A) variable {ι : Type*} [Nonempty ι] {K : ι → Subalgebra R A} (dir : Directed (· ≤ ·) K) theorem coe_iSup_of_directed : ↑(iSup K) = ⋃ i, (K i : Set A) := let s : Subalgebra R A := { __ := Subsemiring.copy _ _ (Subsemiring.coe_iSup_of_directed dir).symm algebraMap_mem' := fun _ ↦ Set.mem_iUnion.2 ⟨Classical.arbitrary ι, Subalgebra.algebraMap_mem _ _⟩ } have : iSup K = s := le_antisymm (iSup_le fun i ↦ le_iSup (fun i ↦ (K i : Set A)) i) (Set.iUnion_subset fun _ ↦ le_iSup K _) this.symm ▸ rfl #align subalgebra.coe_supr_of_directed Subalgebra.coe_iSup_of_directed variable (K) variable (f : ∀ i, K i →ₐ[R] B) (hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)) (T : Subalgebra R A) (hT : T = iSup K) -- Porting note (#11215): TODO: turn `hT` into an assumption `T ≤ iSup K`. -- That's what `Set.iUnionLift` needs -- Porting note: the proofs of `map_{zero,one,add,mul}` got a bit uglier, probably unification trbls noncomputable def iSupLift : ↥T →ₐ[R] B := { toFun := Set.iUnionLift (fun i => ↑(K i)) (fun i x => f i x) (fun i j x hxi hxj => by let ⟨k, hik, hjk⟩ := dir i j dsimp rw [hf i k hik, hf j k hjk] rfl) T (by rw [hT, coe_iSup_of_directed dir]) map_one' := by apply Set.iUnionLift_const _ (fun _ => 1) <;> simp map_zero' := by dsimp; apply Set.iUnionLift_const _ (fun _ => 0) <;> simp map_mul' := by subst hT; dsimp apply Set.iUnionLift_binary (coe_iSup_of_directed dir) dir _ (fun _ => (· * ·)) on_goal 3 => rw [coe_iSup_of_directed dir] all_goals simp map_add' := by subst hT; dsimp apply Set.iUnionLift_binary (coe_iSup_of_directed dir) dir _ (fun _ => (· + ·)) on_goal 3 => rw [coe_iSup_of_directed dir] all_goals simp commutes' := fun r => by dsimp apply Set.iUnionLift_const _ (fun _ => algebraMap R _ r) <;> simp } #align subalgebra.supr_lift Subalgebra.iSupLift variable {K dir f hf T hT} @[simp] theorem iSupLift_inclusion {i : ι} (x : K i) (h : K i ≤ T) : iSupLift K dir f hf T hT (inclusion h x) = f i x := by dsimp [iSupLift, inclusion] rw [Set.iUnionLift_inclusion] #align subalgebra.supr_lift_inclusion Subalgebra.iSupLift_inclusion @[simp]
Mathlib/Algebra/Algebra/Subalgebra/Directed.lean
85
86
theorem iSupLift_comp_inclusion {i : ι} (h : K i ≤ T) : (iSupLift K dir f hf T hT).comp (inclusion h) = f i := by
ext; simp
0.875
import Mathlib.Algebra.GroupWithZero.Defs import Mathlib.Algebra.NeZero #align_import algebra.group_with_zero.defs from "leanprover-community/mathlib"@"2f3994e1b117b1e1da49bcfb67334f33460c3ce4" assert_not_exists DenselyOrdered universe u variable {M₀ M₀' : Type*} [MulZeroOneClass M₀] [Nontrivial M₀] instance NeZero.one : NeZero (1 : M₀) := ⟨by intro h rcases exists_pair_ne M₀ with ⟨x, y, hx⟩ apply hx calc x = 1 * x := by rw [one_mul] _ = 0 := by rw [h, zero_mul] _ = 1 * y := by rw [h, zero_mul] _ = y := by rw [one_mul]⟩ #align ne_zero.one NeZero.one theorem pullback_nonzero [Zero M₀'] [One M₀'] (f : M₀' → M₀) (zero : f 0 = 0) (one : f 1 = 1) : Nontrivial M₀' := ⟨⟨0, 1, mt (congr_arg f) <| by rw [zero, one] exact zero_ne_one⟩⟩ #align pullback_nonzero pullback_nonzero section GroupWithZero variable {G₀ : Type*} [GroupWithZero G₀] {a : G₀} -- Porting note: used `simpa` to prove `False` in lean3 theorem inv_ne_zero (h : a ≠ 0) : a⁻¹ ≠ 0 := fun a_eq_0 => by have := mul_inv_cancel h simp only [a_eq_0, mul_zero, zero_ne_one] at this #align inv_ne_zero inv_ne_zero @[simp]
Mathlib/Algebra/GroupWithZero/NeZero.lean
55
59
theorem inv_mul_cancel (h : a ≠ 0) : a⁻¹ * a = 1 := calc a⁻¹ * a = a⁻¹ * a * a⁻¹ * a⁻¹⁻¹ := by
simp [inv_ne_zero h] _ = a⁻¹ * a⁻¹⁻¹ := by simp [h] _ = 1 := by simp [inv_ne_zero h]
0.875
import Mathlib.NumberTheory.Zsqrtd.Basic import Mathlib.RingTheory.PrincipalIdealDomain import Mathlib.Data.Complex.Basic import Mathlib.Data.Real.Archimedean #align_import number_theory.zsqrtd.gaussian_int from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" open Zsqrtd Complex open scoped ComplexConjugate abbrev GaussianInt : Type := Zsqrtd (-1) #align gaussian_int GaussianInt local notation "ℤ[i]" => GaussianInt namespace GaussianInt instance : Repr ℤ[i] := ⟨fun x _ => "⟨" ++ repr x.re ++ ", " ++ repr x.im ++ "⟩"⟩ instance instCommRing : CommRing ℤ[i] := Zsqrtd.commRing #align gaussian_int.comm_ring GaussianInt.instCommRing section attribute [-instance] Complex.instField -- Avoid making things noncomputable unnecessarily. def toComplex : ℤ[i] →+* ℂ := Zsqrtd.lift ⟨I, by simp⟩ #align gaussian_int.to_complex GaussianInt.toComplex end instance : Coe ℤ[i] ℂ := ⟨toComplex⟩ theorem toComplex_def (x : ℤ[i]) : (x : ℂ) = x.re + x.im * I := rfl #align gaussian_int.to_complex_def GaussianInt.toComplex_def theorem toComplex_def' (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ) = x + y * I := by simp [toComplex_def] #align gaussian_int.to_complex_def' GaussianInt.toComplex_def' theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ := by apply Complex.ext <;> simp [toComplex_def] #align gaussian_int.to_complex_def₂ GaussianInt.toComplex_def₂ @[simp]
Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean
89
89
theorem to_real_re (x : ℤ[i]) : ((x.re : ℤ) : ℝ) = (x : ℂ).re := by
simp [toComplex_def]
0.875
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory variable {α E : Type*} {m : MeasurableSpace α} [NormedAddCommGroup E] {p : ℝ≥0∞} {q : ℝ} {μ : Measure α} {f g : α → E} theorem snorm'_add_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) (hq1 : 1 ≤ q) : snorm' (f + g) q μ ≤ snorm' f q μ + snorm' g q μ := calc (∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤ (∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by gcongr with a simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le] _ ≤ snorm' f q μ + snorm' g q μ := ENNReal.lintegral_Lp_add_le hf.ennnorm hg.ennnorm hq1 #align measure_theory.snorm'_add_le MeasureTheory.snorm'_add_le theorem snorm'_add_le_of_le_one {f g : α → E} (hf : AEStronglyMeasurable f μ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : snorm' (f + g) q μ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (snorm' f q μ + snorm' g q μ) := calc (∫⁻ a, (‖(f + g) a‖₊ : ℝ≥0∞) ^ q ∂μ) ^ (1 / q) ≤ (∫⁻ a, ((fun a => (‖f a‖₊ : ℝ≥0∞)) + fun a => (‖g a‖₊ : ℝ≥0∞)) a ^ q ∂μ) ^ (1 / q) := by gcongr with a simp only [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe, nnnorm_add_le] _ ≤ (2 : ℝ≥0∞) ^ (1 / q - 1) * (snorm' f q μ + snorm' g q μ) := ENNReal.lintegral_Lp_add_le_of_le_one hf.ennnorm hq0 hq1 #align measure_theory.snorm'_add_le_of_le_one MeasureTheory.snorm'_add_le_of_le_one theorem snormEssSup_add_le {f g : α → E} : snormEssSup (f + g) μ ≤ snormEssSup f μ + snormEssSup g μ := by refine le_trans (essSup_mono_ae (eventually_of_forall fun x => ?_)) (ENNReal.essSup_add_le _ _) simp_rw [Pi.add_apply, ← ENNReal.coe_add, ENNReal.coe_le_coe] exact nnnorm_add_le _ _ #align measure_theory.snorm_ess_sup_add_le MeasureTheory.snormEssSup_add_le theorem snorm_add_le {f g : α → E} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) (hp1 : 1 ≤ p) : snorm (f + g) p μ ≤ snorm f p μ + snorm g p μ := by by_cases hp0 : p = 0 · simp [hp0] by_cases hp_top : p = ∞ · simp [hp_top, snormEssSup_add_le] have hp1_real : 1 ≤ p.toReal := by rwa [← ENNReal.one_toReal, ENNReal.toReal_le_toReal ENNReal.one_ne_top hp_top] repeat rw [snorm_eq_snorm' hp0 hp_top] exact snorm'_add_le hf hg hp1_real #align measure_theory.snorm_add_le MeasureTheory.snorm_add_le noncomputable def LpAddConst (p : ℝ≥0∞) : ℝ≥0∞ := if p ∈ Set.Ioo (0 : ℝ≥0∞) 1 then (2 : ℝ≥0∞) ^ (1 / p.toReal - 1) else 1 set_option linter.uppercaseLean3 false in #align measure_theory.Lp_add_const MeasureTheory.LpAddConst theorem LpAddConst_of_one_le {p : ℝ≥0∞} (hp : 1 ≤ p) : LpAddConst p = 1 := by rw [LpAddConst, if_neg] intro h exact lt_irrefl _ (h.2.trans_le hp) set_option linter.uppercaseLean3 false in #align measure_theory.Lp_add_const_of_one_le MeasureTheory.LpAddConst_of_one_le
Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean
80
83
theorem LpAddConst_zero : LpAddConst 0 = 1 := by
rw [LpAddConst, if_neg] intro h exact lt_irrefl _ h.1
0.875
import Mathlib.Algebra.Group.Support import Mathlib.Data.Set.Pointwise.SMul #align_import data.set.pointwise.support from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" open Pointwise open Function Set section GroupWithZero variable {α β γ : Type*} [GroupWithZero α] [MulAction α β] theorem mulSupport_comp_inv_smul₀ [One γ] {c : α} (hc : c ≠ 0) (f : β → γ) : (mulSupport fun x ↦ f (c⁻¹ • x)) = c • mulSupport f := by ext x simp only [mem_smul_set_iff_inv_smul_mem₀ hc, mem_mulSupport] #align mul_support_comp_inv_smul₀ mulSupport_comp_inv_smul₀
Mathlib/Data/Set/Pointwise/Support.lean
56
59
theorem support_comp_inv_smul₀ [Zero γ] {c : α} (hc : c ≠ 0) (f : β → γ) : (support fun x ↦ f (c⁻¹ • x)) = c • support f := by
ext x simp only [mem_smul_set_iff_inv_smul_mem₀ hc, mem_support]
0.875
import Mathlib.AlgebraicTopology.DoldKan.Projections import Mathlib.CategoryTheory.Idempotents.FunctorCategories import Mathlib.CategoryTheory.Idempotents.FunctorExtension #align_import algebraic_topology.dold_kan.p_infty from "leanprover-community/mathlib"@"32a7e535287f9c73f2e4d2aef306a39190f0b504" open CategoryTheory CategoryTheory.Category CategoryTheory.Preadditive CategoryTheory.SimplicialObject CategoryTheory.Idempotents Opposite Simplicial DoldKan namespace AlgebraicTopology namespace DoldKan variable {C : Type*} [Category C] [Preadditive C] {X : SimplicialObject C} theorem P_is_eventually_constant {q n : ℕ} (hqn : n ≤ q) : ((P (q + 1)).f n : X _[n] ⟶ _) = (P q).f n := by rcases n with (_|n) · simp only [Nat.zero_eq, P_f_0_eq] · simp only [P_succ, add_right_eq_self, comp_add, HomologicalComplex.comp_f, HomologicalComplex.add_f_apply, comp_id] exact (HigherFacesVanish.of_P q n).comp_Hσ_eq_zero (Nat.succ_le_iff.mp hqn) set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_is_eventually_constant AlgebraicTopology.DoldKan.P_is_eventually_constant theorem Q_is_eventually_constant {q n : ℕ} (hqn : n ≤ q) : ((Q (q + 1)).f n : X _[n] ⟶ _) = (Q q).f n := by simp only [Q, HomologicalComplex.sub_f_apply, P_is_eventually_constant hqn] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_is_eventually_constant AlgebraicTopology.DoldKan.Q_is_eventually_constant noncomputable def PInfty : K[X] ⟶ K[X] := ChainComplex.ofHom _ _ _ _ _ _ (fun n => ((P n).f n : X _[n] ⟶ _)) fun n => by simpa only [← P_is_eventually_constant (show n ≤ n by rfl), AlternatingFaceMapComplex.obj_d_eq] using (P (n + 1) : K[X] ⟶ _).comm (n + 1) n set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty AlgebraicTopology.DoldKan.PInfty noncomputable def QInfty : K[X] ⟶ K[X] := 𝟙 _ - PInfty set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_infty AlgebraicTopology.DoldKan.QInfty @[simp] theorem PInfty_f_0 : (PInfty.f 0 : X _[0] ⟶ X _[0]) = 𝟙 _ := rfl set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty_f_0 AlgebraicTopology.DoldKan.PInfty_f_0 theorem PInfty_f (n : ℕ) : (PInfty.f n : X _[n] ⟶ X _[n]) = (P n).f n := rfl set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty_f AlgebraicTopology.DoldKan.PInfty_f @[simp] theorem QInfty_f_0 : (QInfty.f 0 : X _[0] ⟶ X _[0]) = 0 := by dsimp [QInfty] simp only [sub_self] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_infty_f_0 AlgebraicTopology.DoldKan.QInfty_f_0 theorem QInfty_f (n : ℕ) : (QInfty.f n : X _[n] ⟶ X _[n]) = (Q n).f n := rfl set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_infty_f AlgebraicTopology.DoldKan.QInfty_f @[reassoc (attr := simp)] theorem PInfty_f_naturality (n : ℕ) {X Y : SimplicialObject C} (f : X ⟶ Y) : f.app (op [n]) ≫ PInfty.f n = PInfty.f n ≫ f.app (op [n]) := P_f_naturality n n f set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty_f_naturality AlgebraicTopology.DoldKan.PInfty_f_naturality @[reassoc (attr := simp)] theorem QInfty_f_naturality (n : ℕ) {X Y : SimplicialObject C} (f : X ⟶ Y) : f.app (op [n]) ≫ QInfty.f n = QInfty.f n ≫ f.app (op [n]) := Q_f_naturality n n f set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.Q_infty_f_naturality AlgebraicTopology.DoldKan.QInfty_f_naturality @[reassoc (attr := simp)] theorem PInfty_f_idem (n : ℕ) : (PInfty.f n : X _[n] ⟶ _) ≫ PInfty.f n = PInfty.f n := by simp only [PInfty_f, P_f_idem] set_option linter.uppercaseLean3 false in #align algebraic_topology.dold_kan.P_infty_f_idem AlgebraicTopology.DoldKan.PInfty_f_idem @[reassoc (attr := simp)]
Mathlib/AlgebraicTopology/DoldKan/PInfty.lean
110
112
theorem PInfty_idem : (PInfty : K[X] ⟶ _) ≫ PInfty = PInfty := by
ext n exact PInfty_f_idem n
0.875
import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Combinatorics.SimpleGraph.Connectivity import Mathlib.LinearAlgebra.Matrix.Trace import Mathlib.LinearAlgebra.Matrix.Symmetric #align_import combinatorics.simple_graph.adj_matrix from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" open Matrix open Finset Matrix SimpleGraph variable {V α β : Type*} namespace Matrix structure IsAdjMatrix [Zero α] [One α] (A : Matrix V V α) : Prop where zero_or_one : ∀ i j, A i j = 0 ∨ A i j = 1 := by aesop symm : A.IsSymm := by aesop apply_diag : ∀ i, A i i = 0 := by aesop #align matrix.is_adj_matrix Matrix.IsAdjMatrix namespace IsAdjMatrix variable {A : Matrix V V α} @[simp] theorem apply_diag_ne [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i : V) : ¬A i i = 1 := by simp [h.apply_diag i] #align matrix.is_adj_matrix.apply_diag_ne Matrix.IsAdjMatrix.apply_diag_ne @[simp] theorem apply_ne_one_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) : ¬A i j = 1 ↔ A i j = 0 := by obtain h | h := h.zero_or_one i j <;> simp [h] #align matrix.is_adj_matrix.apply_ne_one_iff Matrix.IsAdjMatrix.apply_ne_one_iff @[simp]
Mathlib/Combinatorics/SimpleGraph/AdjMatrix.lean
74
75
theorem apply_ne_zero_iff [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i j : V) : ¬A i j = 0 ↔ A i j = 1 := by
rw [← apply_ne_one_iff h, Classical.not_not]
0.875
import Mathlib.Data.Finsupp.Basic import Mathlib.Data.Finsupp.Order #align_import data.finsupp.multiset from "leanprover-community/mathlib"@"59694bd07f0a39c5beccba34bd9f413a160782bf" open Finset variable {α β ι : Type*} namespace Finsupp def toMultiset : (α →₀ ℕ) →+ Multiset α where toFun f := Finsupp.sum f fun a n => n • {a} -- Porting note: times out if h is not specified map_add' _f _g := sum_add_index' (h := fun a n => n • ({a} : Multiset α)) (fun _ ↦ zero_nsmul _) (fun _ ↦ add_nsmul _) map_zero' := sum_zero_index theorem toMultiset_zero : toMultiset (0 : α →₀ ℕ) = 0 := rfl #align finsupp.to_multiset_zero Finsupp.toMultiset_zero theorem toMultiset_add (m n : α →₀ ℕ) : toMultiset (m + n) = toMultiset m + toMultiset n := toMultiset.map_add m n #align finsupp.to_multiset_add Finsupp.toMultiset_add theorem toMultiset_apply (f : α →₀ ℕ) : toMultiset f = f.sum fun a n => n • {a} := rfl #align finsupp.to_multiset_apply Finsupp.toMultiset_apply @[simp] theorem toMultiset_single (a : α) (n : ℕ) : toMultiset (single a n) = n • {a} := by rw [toMultiset_apply, sum_single_index]; apply zero_nsmul #align finsupp.to_multiset_single Finsupp.toMultiset_single theorem toMultiset_sum {f : ι → α →₀ ℕ} (s : Finset ι) : Finsupp.toMultiset (∑ i ∈ s, f i) = ∑ i ∈ s, Finsupp.toMultiset (f i) := map_sum Finsupp.toMultiset _ _ #align finsupp.to_multiset_sum Finsupp.toMultiset_sum theorem toMultiset_sum_single (s : Finset ι) (n : ℕ) : Finsupp.toMultiset (∑ i ∈ s, single i n) = n • s.val := by simp_rw [toMultiset_sum, Finsupp.toMultiset_single, sum_nsmul, sum_multiset_singleton] #align finsupp.to_multiset_sum_single Finsupp.toMultiset_sum_single @[simp] theorem card_toMultiset (f : α →₀ ℕ) : Multiset.card (toMultiset f) = f.sum fun _ => id := by simp [toMultiset_apply, map_finsupp_sum, Function.id_def] #align finsupp.card_to_multiset Finsupp.card_toMultiset theorem toMultiset_map (f : α →₀ ℕ) (g : α → β) : f.toMultiset.map g = toMultiset (f.mapDomain g) := by refine f.induction ?_ ?_ · rw [toMultiset_zero, Multiset.map_zero, mapDomain_zero, toMultiset_zero] · intro a n f _ _ ih rw [toMultiset_add, Multiset.map_add, ih, mapDomain_add, mapDomain_single, toMultiset_single, toMultiset_add, toMultiset_single, ← Multiset.coe_mapAddMonoidHom, (Multiset.mapAddMonoidHom g).map_nsmul] rfl #align finsupp.to_multiset_map Finsupp.toMultiset_map @[to_additive (attr := simp)] theorem prod_toMultiset [CommMonoid α] (f : α →₀ ℕ) : f.toMultiset.prod = f.prod fun a n => a ^ n := by refine f.induction ?_ ?_ · rw [toMultiset_zero, Multiset.prod_zero, Finsupp.prod_zero_index] · intro a n f _ _ ih rw [toMultiset_add, Multiset.prod_add, ih, toMultiset_single, Multiset.prod_nsmul, Finsupp.prod_add_index' pow_zero pow_add, Finsupp.prod_single_index, Multiset.prod_singleton] exact pow_zero a #align finsupp.prod_to_multiset Finsupp.prod_toMultiset @[simp] theorem toFinset_toMultiset [DecidableEq α] (f : α →₀ ℕ) : f.toMultiset.toFinset = f.support := by refine f.induction ?_ ?_ · rw [toMultiset_zero, Multiset.toFinset_zero, support_zero] · intro a n f ha hn ih rw [toMultiset_add, Multiset.toFinset_add, ih, toMultiset_single, support_add_eq, support_single_ne_zero _ hn, Multiset.toFinset_nsmul _ _ hn, Multiset.toFinset_singleton] refine Disjoint.mono_left support_single_subset ?_ rwa [Finset.disjoint_singleton_left] #align finsupp.to_finset_to_multiset Finsupp.toFinset_toMultiset @[simp] theorem count_toMultiset [DecidableEq α] (f : α →₀ ℕ) (a : α) : (toMultiset f).count a = f a := calc (toMultiset f).count a = Finsupp.sum f (fun x n => (n • {x} : Multiset α).count a) := by rw [toMultiset_apply]; exact map_sum (Multiset.countAddMonoidHom a) _ f.support _ = f.sum fun x n => n * ({x} : Multiset α).count a := by simp only [Multiset.count_nsmul] _ = f a * ({a} : Multiset α).count a := sum_eq_single _ (fun a' _ H => by simp only [Multiset.count_singleton, if_false, H.symm, mul_zero]) (fun _ => zero_mul _) _ = f a := by rw [Multiset.count_singleton_self, mul_one] #align finsupp.count_to_multiset Finsupp.count_toMultiset theorem toMultiset_sup [DecidableEq α] (f g : α →₀ ℕ) : toMultiset (f ⊔ g) = toMultiset f ∪ toMultiset g := by ext simp_rw [Multiset.count_union, Finsupp.count_toMultiset, Finsupp.sup_apply, sup_eq_max]
Mathlib/Data/Finsupp/Multiset.lean
122
125
theorem toMultiset_inf [DecidableEq α] (f g : α →₀ ℕ) : toMultiset (f ⊓ g) = toMultiset f ∩ toMultiset g := by
ext simp_rw [Multiset.count_inter, Finsupp.count_toMultiset, Finsupp.inf_apply, inf_eq_min]
0.875
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ι : Type*} {f : X → Y} {g : Y → Z} section OpenMap variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] section IsClosedMap variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] namespace IsClosedMap open Function protected theorem id : IsClosedMap (@id X) := fun s hs => by rwa [image_id] #align is_closed_map.id IsClosedMap.id protected theorem comp (hg : IsClosedMap g) (hf : IsClosedMap f) : IsClosedMap (g ∘ f) := by intro s hs rw [image_comp] exact hg _ (hf _ hs) #align is_closed_map.comp IsClosedMap.comp theorem closure_image_subset (hf : IsClosedMap f) (s : Set X) : closure (f '' s) ⊆ f '' closure s := closure_minimal (image_subset _ subset_closure) (hf _ isClosed_closure) #align is_closed_map.closure_image_subset IsClosedMap.closure_image_subset theorem of_inverse {f' : Y → X} (h : Continuous f') (l_inv : LeftInverse f f') (r_inv : RightInverse f f') : IsClosedMap f := fun s hs => by rw [image_eq_preimage_of_inverse r_inv l_inv] exact hs.preimage h #align is_closed_map.of_inverse IsClosedMap.of_inverse
Mathlib/Topology/Maps.lean
478
482
theorem of_nonempty (h : ∀ s, IsClosed s → s.Nonempty → IsClosed (f '' s)) : IsClosedMap f := by
intro s hs; rcases eq_empty_or_nonempty s with h2s | h2s · simp_rw [h2s, image_empty, isClosed_empty] · exact h s hs h2s
0.875
import Mathlib.Topology.Algebra.Constructions import Mathlib.Topology.Bases import Mathlib.Topology.UniformSpace.Basic #align_import topology.uniform_space.cauchy from "leanprover-community/mathlib"@"22131150f88a2d125713ffa0f4693e3355b1eb49" universe u v open scoped Classical open Filter TopologicalSpace Set UniformSpace Function open scoped Classical open Uniformity Topology Filter variable {α : Type u} {β : Type v} [uniformSpace : UniformSpace α] def Cauchy (f : Filter α) := NeBot f ∧ f ×ˢ f ≤ 𝓤 α #align cauchy Cauchy def IsComplete (s : Set α) := ∀ f, Cauchy f → f ≤ 𝓟 s → ∃ x ∈ s, f ≤ 𝓝 x #align is_complete IsComplete theorem Filter.HasBasis.cauchy_iff {ι} {p : ι → Prop} {s : ι → Set (α × α)} (h : (𝓤 α).HasBasis p s) {f : Filter α} : Cauchy f ↔ NeBot f ∧ ∀ i, p i → ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, (x, y) ∈ s i := and_congr Iff.rfl <| (f.basis_sets.prod_self.le_basis_iff h).trans <| by simp only [subset_def, Prod.forall, mem_prod_eq, and_imp, id, forall_mem_comm] #align filter.has_basis.cauchy_iff Filter.HasBasis.cauchy_iff theorem cauchy_iff' {f : Filter α} : Cauchy f ↔ NeBot f ∧ ∀ s ∈ 𝓤 α, ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, (x, y) ∈ s := (𝓤 α).basis_sets.cauchy_iff #align cauchy_iff' cauchy_iff' theorem cauchy_iff {f : Filter α} : Cauchy f ↔ NeBot f ∧ ∀ s ∈ 𝓤 α, ∃ t ∈ f, t ×ˢ t ⊆ s := cauchy_iff'.trans <| by simp only [subset_def, Prod.forall, mem_prod_eq, and_imp, id, forall_mem_comm] #align cauchy_iff cauchy_iff lemma cauchy_iff_le {l : Filter α} [hl : l.NeBot] : Cauchy l ↔ l ×ˢ l ≤ 𝓤 α := by simp only [Cauchy, hl, true_and]
Mathlib/Topology/UniformSpace/Cauchy.lean
63
67
theorem Cauchy.ultrafilter_of {l : Filter α} (h : Cauchy l) : Cauchy (@Ultrafilter.of _ l h.1 : Filter α) := by
haveI := h.1 have := Ultrafilter.of_le l exact ⟨Ultrafilter.neBot _, (Filter.prod_mono this this).trans h.2⟩
0.875
import Mathlib.Data.Fin.Fin2 import Mathlib.Logic.Function.Basic import Mathlib.Tactic.Common #align_import data.typevec from "leanprover-community/mathlib"@"48fb5b5280e7c81672afc9524185ae994553ebf4" universe u v w @[pp_with_univ] def TypeVec (n : ℕ) := Fin2 n → Type* #align typevec TypeVec instance {n} : Inhabited (TypeVec.{u} n) := ⟨fun _ => PUnit⟩ namespace TypeVec variable {n : ℕ} def Arrow (α β : TypeVec n) := ∀ i : Fin2 n, α i → β i #align typevec.arrow TypeVec.Arrow @[inherit_doc] scoped[MvFunctor] infixl:40 " ⟹ " => TypeVec.Arrow open MvFunctor @[ext]
Mathlib/Data/TypeVec.lean
60
62
theorem Arrow.ext {α β : TypeVec n} (f g : α ⟹ β) : (∀ i, f i = g i) → f = g := by
intro h; funext i; apply h
0.875
import Mathlib.Data.Fintype.Basic import Mathlib.GroupTheory.Perm.Sign import Mathlib.Logic.Equiv.Defs #align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f" namespace Equiv variable {α β : Type*} [Finite α] noncomputable def toCompl {p q : α → Prop} (e : { x // p x } ≃ { x // q x }) : { x // ¬p x } ≃ { x // ¬q x } := by apply Classical.choice cases nonempty_fintype α classical exact Fintype.card_eq.mp <| Fintype.card_compl_eq_card_compl _ _ <| Fintype.card_congr e #align equiv.to_compl Equiv.toCompl variable {p q : α → Prop} [DecidablePred p] [DecidablePred q] noncomputable abbrev extendSubtype (e : { x // p x } ≃ { x // q x }) : Perm α := subtypeCongr e e.toCompl #align equiv.extend_subtype Equiv.extendSubtype theorem extendSubtype_apply_of_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : e.extendSubtype x = e ⟨x, hx⟩ := by dsimp only [extendSubtype] simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply] rw [sumCompl_apply_symm_of_pos _ _ hx, Sum.map_inl, sumCompl_apply_inl] #align equiv.extend_subtype_apply_of_mem Equiv.extendSubtype_apply_of_mem theorem extendSubtype_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : p x) : q (e.extendSubtype x) := by convert (e ⟨x, hx⟩).2 rw [e.extendSubtype_apply_of_mem _ hx] #align equiv.extend_subtype_mem Equiv.extendSubtype_mem theorem extendSubtype_apply_of_not_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : ¬p x) : e.extendSubtype x = e.toCompl ⟨x, hx⟩ := by dsimp only [extendSubtype] simp only [subtypeCongr, Equiv.trans_apply, Equiv.sumCongr_apply] rw [sumCompl_apply_symm_of_neg _ _ hx, Sum.map_inr, sumCompl_apply_inr] #align equiv.extend_subtype_apply_of_not_mem Equiv.extendSubtype_apply_of_not_mem
Mathlib/Logic/Equiv/Fintype.lean
145
148
theorem extendSubtype_not_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : ¬p x) : ¬q (e.extendSubtype x) := by
convert (e.toCompl ⟨x, hx⟩).2 rw [e.extendSubtype_apply_of_not_mem _ hx]
0.875
import Mathlib.CategoryTheory.Comma.Basic #align_import category_theory.arrow from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" namespace CategoryTheory universe v u -- morphism levels before object levels. See note [CategoryTheory universes]. variable {T : Type u} [Category.{v} T] section variable (T) def Arrow := Comma.{v, v, v} (𝟭 T) (𝟭 T) #align category_theory.arrow CategoryTheory.Arrow instance : Category (Arrow T) := commaCategory -- Satisfying the inhabited linter instance Arrow.inhabited [Inhabited T] : Inhabited (Arrow T) where default := show Comma (𝟭 T) (𝟭 T) from default #align category_theory.arrow.inhabited CategoryTheory.Arrow.inhabited end namespace Arrow @[ext] lemma hom_ext {X Y : Arrow T} (f g : X ⟶ Y) (h₁ : f.left = g.left) (h₂ : f.right = g.right) : f = g := CommaMorphism.ext _ _ h₁ h₂ @[simp] theorem id_left (f : Arrow T) : CommaMorphism.left (𝟙 f) = 𝟙 f.left := rfl #align category_theory.arrow.id_left CategoryTheory.Arrow.id_left @[simp] theorem id_right (f : Arrow T) : CommaMorphism.right (𝟙 f) = 𝟙 f.right := rfl #align category_theory.arrow.id_right CategoryTheory.Arrow.id_right -- Porting note (#10688): added to ease automation @[simp, reassoc] theorem comp_left {X Y Z : Arrow T} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).left = f.left ≫ g.left := rfl -- Porting note (#10688): added to ease automation @[simp, reassoc] theorem comp_right {X Y Z : Arrow T} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).right = f.right ≫ g.right := rfl @[simps] def mk {X Y : T} (f : X ⟶ Y) : Arrow T where left := X right := Y hom := f #align category_theory.arrow.mk CategoryTheory.Arrow.mk @[simp] theorem mk_eq (f : Arrow T) : Arrow.mk f.hom = f := by cases f rfl #align category_theory.arrow.mk_eq CategoryTheory.Arrow.mk_eq theorem mk_injective (A B : T) : Function.Injective (Arrow.mk : (A ⟶ B) → Arrow T) := fun f g h => by cases h rfl #align category_theory.arrow.mk_injective CategoryTheory.Arrow.mk_injective theorem mk_inj (A B : T) {f g : A ⟶ B} : Arrow.mk f = Arrow.mk g ↔ f = g := (mk_injective A B).eq_iff #align category_theory.arrow.mk_inj CategoryTheory.Arrow.mk_inj instance {X Y : T} : CoeOut (X ⟶ Y) (Arrow T) where coe := mk @[simps] def homMk {f g : Arrow T} {u : f.left ⟶ g.left} {v : f.right ⟶ g.right} (w : u ≫ g.hom = f.hom ≫ v) : f ⟶ g where left := u right := v w := w #align category_theory.arrow.hom_mk CategoryTheory.Arrow.homMk @[simps] def homMk' {X Y : T} {f : X ⟶ Y} {P Q : T} {g : P ⟶ Q} {u : X ⟶ P} {v : Y ⟶ Q} (w : u ≫ g = f ≫ v) : Arrow.mk f ⟶ Arrow.mk g where left := u right := v w := w #align category_theory.arrow.hom_mk' CategoryTheory.Arrow.homMk' @[reassoc (attr := simp, nolint simpNF)] theorem w {f g : Arrow T} (sq : f ⟶ g) : sq.left ≫ g.hom = f.hom ≫ sq.right := sq.w #align category_theory.arrow.w CategoryTheory.Arrow.w -- `w_mk_left` is not needed, as it is a consequence of `w` and `mk_hom`. @[reassoc (attr := simp)] theorem w_mk_right {f : Arrow T} {X Y : T} {g : X ⟶ Y} (sq : f ⟶ mk g) : sq.left ≫ g = f.hom ≫ sq.right := sq.w #align category_theory.arrow.w_mk_right CategoryTheory.Arrow.w_mk_right theorem isIso_of_isIso_left_of_isIso_right {f g : Arrow T} (ff : f ⟶ g) [IsIso ff.left] [IsIso ff.right] : IsIso ff where out := by let inverse : g ⟶ f := ⟨inv ff.left, inv ff.right, (by simp)⟩ apply Exists.intro inverse aesop_cat #align category_theory.arrow.is_iso_of_iso_left_of_is_iso_right CategoryTheory.Arrow.isIso_of_isIso_left_of_isIso_right @[simps!] def isoMk {f g : Arrow T} (l : f.left ≅ g.left) (r : f.right ≅ g.right) (h : l.hom ≫ g.hom = f.hom ≫ r.hom := by aesop_cat) : f ≅ g := Comma.isoMk l r h #align category_theory.arrow.iso_mk CategoryTheory.Arrow.isoMk abbrev isoMk' {W X Y Z : T} (f : W ⟶ X) (g : Y ⟶ Z) (e₁ : W ≅ Y) (e₂ : X ≅ Z) (h : e₁.hom ≫ g = f ≫ e₂.hom := by aesop_cat) : Arrow.mk f ≅ Arrow.mk g := Arrow.isoMk e₁ e₂ h #align category_theory.arrow.iso_mk' CategoryTheory.Arrow.isoMk'
Mathlib/CategoryTheory/Comma/Arrow.lean
162
163
theorem hom.congr_left {f g : Arrow T} {φ₁ φ₂ : f ⟶ g} (h : φ₁ = φ₂) : φ₁.left = φ₂.left := by
rw [h]
0.875
import Mathlib.Analysis.Convex.Side import Mathlib.Geometry.Euclidean.Angle.Oriented.Rotation import Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine #align_import geometry.euclidean.angle.oriented.affine from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open FiniteDimensional Complex open scoped Affine EuclideanGeometry Real RealInnerProductSpace ComplexConjugate namespace EuclideanGeometry variable {V : Type*} {P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P] [hd2 : Fact (finrank ℝ V = 2)] [Module.Oriented ℝ V (Fin 2)] abbrev o := @Module.Oriented.positiveOrientation def oangle (p₁ p₂ p₃ : P) : Real.Angle := o.oangle (p₁ -ᵥ p₂) (p₃ -ᵥ p₂) #align euclidean_geometry.oangle EuclideanGeometry.oangle @[inherit_doc] scoped notation "∡" => EuclideanGeometry.oangle theorem continuousAt_oangle {x : P × P × P} (hx12 : x.1 ≠ x.2.1) (hx32 : x.2.2 ≠ x.2.1) : ContinuousAt (fun y : P × P × P => ∡ y.1 y.2.1 y.2.2) x := by let f : P × P × P → V × V := fun y => (y.1 -ᵥ y.2.1, y.2.2 -ᵥ y.2.1) have hf1 : (f x).1 ≠ 0 := by simp [hx12] have hf2 : (f x).2 ≠ 0 := by simp [hx32] exact (o.continuousAt_oangle hf1 hf2).comp ((continuous_fst.vsub continuous_snd.fst).prod_mk (continuous_snd.snd.vsub continuous_snd.fst)).continuousAt #align euclidean_geometry.continuous_at_oangle EuclideanGeometry.continuousAt_oangle @[simp] theorem oangle_self_left (p₁ p₂ : P) : ∡ p₁ p₁ p₂ = 0 := by simp [oangle] #align euclidean_geometry.oangle_self_left EuclideanGeometry.oangle_self_left @[simp]
Mathlib/Geometry/Euclidean/Angle/Oriented/Affine.lean
65
65
theorem oangle_self_right (p₁ p₂ : P) : ∡ p₁ p₂ p₂ = 0 := by
simp [oangle]
0.875
import Mathlib.Algebra.Polynomial.Roots import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import analysis.special_functions.polynomials from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open Filter Finset Asymptotics open Asymptotics Polynomial Topology namespace Polynomial variable {𝕜 : Type*} [NormedLinearOrderedField 𝕜] (P Q : 𝕜[X]) theorem eventually_no_roots (hP : P ≠ 0) : ∀ᶠ x in atTop, ¬P.IsRoot x := atTop_le_cofinite <| (finite_setOf_isRoot hP).compl_mem_cofinite #align polynomial.eventually_no_roots Polynomial.eventually_no_roots variable [OrderTopology 𝕜] section PolynomialAtTop theorem isEquivalent_atTop_lead : (fun x => eval x P) ~[atTop] fun x => P.leadingCoeff * x ^ P.natDegree := by by_cases h : P = 0 · simp [h, IsEquivalent.refl] · simp only [Polynomial.eval_eq_sum_range, sum_range_succ] exact IsLittleO.add_isEquivalent (IsLittleO.sum fun i hi => IsLittleO.const_mul_left ((IsLittleO.const_mul_right fun hz => h <| leadingCoeff_eq_zero.mp hz) <| isLittleO_pow_pow_atTop_of_lt (mem_range.mp hi)) _) IsEquivalent.refl #align polynomial.is_equivalent_at_top_lead Polynomial.isEquivalent_atTop_lead theorem tendsto_atTop_of_leadingCoeff_nonneg (hdeg : 0 < P.degree) (hnng : 0 ≤ P.leadingCoeff) : Tendsto (fun x => eval x P) atTop atTop := P.isEquivalent_atTop_lead.symm.tendsto_atTop <| tendsto_const_mul_pow_atTop (natDegree_pos_iff_degree_pos.2 hdeg).ne' <| hnng.lt_of_ne' <| leadingCoeff_ne_zero.mpr <| ne_zero_of_degree_gt hdeg #align polynomial.tendsto_at_top_of_leading_coeff_nonneg Polynomial.tendsto_atTop_of_leadingCoeff_nonneg theorem tendsto_atTop_iff_leadingCoeff_nonneg : Tendsto (fun x => eval x P) atTop atTop ↔ 0 < P.degree ∧ 0 ≤ P.leadingCoeff := by refine ⟨fun h => ?_, fun h => tendsto_atTop_of_leadingCoeff_nonneg P h.1 h.2⟩ have : Tendsto (fun x => P.leadingCoeff * x ^ P.natDegree) atTop atTop := (isEquivalent_atTop_lead P).tendsto_atTop h rw [tendsto_const_mul_pow_atTop_iff, ← pos_iff_ne_zero, natDegree_pos_iff_degree_pos] at this exact ⟨this.1, this.2.le⟩ #align polynomial.tendsto_at_top_iff_leading_coeff_nonneg Polynomial.tendsto_atTop_iff_leadingCoeff_nonneg theorem tendsto_atBot_iff_leadingCoeff_nonpos : Tendsto (fun x => eval x P) atTop atBot ↔ 0 < P.degree ∧ P.leadingCoeff ≤ 0 := by simp only [← tendsto_neg_atTop_iff, ← eval_neg, tendsto_atTop_iff_leadingCoeff_nonneg, degree_neg, leadingCoeff_neg, neg_nonneg] #align polynomial.tendsto_at_bot_iff_leading_coeff_nonpos Polynomial.tendsto_atBot_iff_leadingCoeff_nonpos theorem tendsto_atBot_of_leadingCoeff_nonpos (hdeg : 0 < P.degree) (hnps : P.leadingCoeff ≤ 0) : Tendsto (fun x => eval x P) atTop atBot := P.tendsto_atBot_iff_leadingCoeff_nonpos.2 ⟨hdeg, hnps⟩ #align polynomial.tendsto_at_bot_of_leading_coeff_nonpos Polynomial.tendsto_atBot_of_leadingCoeff_nonpos
Mathlib/Analysis/SpecialFunctions/Polynomials.lean
84
88
theorem abs_tendsto_atTop (hdeg : 0 < P.degree) : Tendsto (fun x => abs <| eval x P) atTop atTop := by
rcases le_total 0 P.leadingCoeff with hP | hP · exact tendsto_abs_atTop_atTop.comp (P.tendsto_atTop_of_leadingCoeff_nonneg hdeg hP) · exact tendsto_abs_atBot_atTop.comp (P.tendsto_atBot_of_leadingCoeff_nonpos hdeg hP)
0.875
import Mathlib.Data.Fintype.Option import Mathlib.Data.Fintype.Perm import Mathlib.Data.Fintype.Prod import Mathlib.GroupTheory.Perm.Sign import Mathlib.Logic.Equiv.Option #align_import group_theory.perm.option from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395" open Equiv @[simp] theorem Equiv.optionCongr_one {α : Type*} : (1 : Perm α).optionCongr = 1 := Equiv.optionCongr_refl #align equiv.option_congr_one Equiv.optionCongr_one @[simp] theorem Equiv.optionCongr_swap {α : Type*} [DecidableEq α] (x y : α) : optionCongr (swap x y) = swap (some x) (some y) := by ext (_ | i) · simp [swap_apply_of_ne_of_ne] · by_cases hx : i = x · simp only [hx, optionCongr_apply, Option.map_some', swap_apply_left, Option.mem_def, Option.some.injEq] by_cases hy : i = y <;> simp [hx, hy, swap_apply_of_ne_of_ne] #align equiv.option_congr_swap Equiv.optionCongr_swap @[simp] theorem Equiv.optionCongr_sign {α : Type*} [DecidableEq α] [Fintype α] (e : Perm α) : Perm.sign e.optionCongr = Perm.sign e := by refine Perm.swap_induction_on e ?_ ?_ · simp [Perm.one_def] · intro f x y hne h simp [h, hne, Perm.mul_def, ← Equiv.optionCongr_trans] #align equiv.option_congr_sign Equiv.optionCongr_sign @[simp] theorem map_equiv_removeNone {α : Type*} [DecidableEq α] (σ : Perm (Option α)) : (removeNone σ).optionCongr = swap none (σ none) * σ := by ext1 x have : Option.map (⇑(removeNone σ)) x = (swap none (σ none)) (σ x) := by cases' x with x · simp · cases h : σ (some _) · simp [removeNone_none _ h] · have hn : σ (some x) ≠ none := by simp [h] have hσn : σ (some x) ≠ σ none := σ.injective.ne (by simp) simp [removeNone_some _ ⟨_, h⟩, ← h, swap_apply_of_ne_of_ne hn hσn] simpa using this #align map_equiv_remove_none map_equiv_removeNone @[simps] def Equiv.Perm.decomposeOption {α : Type*} [DecidableEq α] : Perm (Option α) ≃ Option α × Perm α where toFun σ := (σ none, removeNone σ) invFun i := swap none i.1 * i.2.optionCongr left_inv σ := by simp right_inv := fun ⟨x, σ⟩ => by have : removeNone (swap none x * σ.optionCongr) = σ := Equiv.optionCongr_injective (by simp [← mul_assoc]) simp [← Perm.eq_inv_iff_eq, this] #align equiv.perm.decompose_option Equiv.Perm.decomposeOption
Mathlib/GroupTheory/Perm/Option.lean
76
77
theorem Equiv.Perm.decomposeOption_symm_of_none_apply {α : Type*} [DecidableEq α] (e : Perm α) (i : Option α) : Equiv.Perm.decomposeOption.symm (none, e) i = i.map e := by
simp
0.875
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Normed.Field.InfiniteSum import Mathlib.Data.Nat.Choose.Cast import Mathlib.Data.Finset.NoncommProd import Mathlib.Topology.Algebra.Algebra #align_import analysis.normed_space.exponential from "leanprover-community/mathlib"@"62748956a1ece9b26b33243e2e3a2852176666f5" namespace NormedSpace open Filter RCLike ContinuousMultilinearMap NormedField Asymptotics open scoped Nat Topology ENNReal section TopologicalAlgebra variable (𝕂 𝔸 : Type*) [Field 𝕂] [Ring 𝔸] [Algebra 𝕂 𝔸] [TopologicalSpace 𝔸] [TopologicalRing 𝔸] def expSeries : FormalMultilinearSeries 𝕂 𝔸 𝔸 := fun n => (n !⁻¹ : 𝕂) • ContinuousMultilinearMap.mkPiAlgebraFin 𝕂 n 𝔸 #align exp_series NormedSpace.expSeries variable {𝔸} noncomputable def exp (x : 𝔸) : 𝔸 := (expSeries 𝕂 𝔸).sum x #align exp NormedSpace.exp variable {𝕂} theorem expSeries_apply_eq (x : 𝔸) (n : ℕ) : (expSeries 𝕂 𝔸 n fun _ => x) = (n !⁻¹ : 𝕂) • x ^ n := by simp [expSeries] #align exp_series_apply_eq NormedSpace.expSeries_apply_eq theorem expSeries_apply_eq' (x : 𝔸) : (fun n => expSeries 𝕂 𝔸 n fun _ => x) = fun n => (n !⁻¹ : 𝕂) • x ^ n := funext (expSeries_apply_eq x) #align exp_series_apply_eq' NormedSpace.expSeries_apply_eq' theorem expSeries_sum_eq (x : 𝔸) : (expSeries 𝕂 𝔸).sum x = ∑' n : ℕ, (n !⁻¹ : 𝕂) • x ^ n := tsum_congr fun n => expSeries_apply_eq x n #align exp_series_sum_eq NormedSpace.expSeries_sum_eq theorem exp_eq_tsum : exp 𝕂 = fun x : 𝔸 => ∑' n : ℕ, (n !⁻¹ : 𝕂) • x ^ n := funext expSeries_sum_eq #align exp_eq_tsum NormedSpace.exp_eq_tsum theorem expSeries_apply_zero (n : ℕ) : (expSeries 𝕂 𝔸 n fun _ => (0 : 𝔸)) = Pi.single (f := fun _ => 𝔸) 0 1 n := by rw [expSeries_apply_eq] cases' n with n · rw [pow_zero, Nat.factorial_zero, Nat.cast_one, inv_one, one_smul, Pi.single_eq_same] · rw [zero_pow (Nat.succ_ne_zero _), smul_zero, Pi.single_eq_of_ne n.succ_ne_zero] #align exp_series_apply_zero NormedSpace.expSeries_apply_zero @[simp] theorem exp_zero : exp 𝕂 (0 : 𝔸) = 1 := by simp_rw [exp_eq_tsum, ← expSeries_apply_eq, expSeries_apply_zero, tsum_pi_single] #align exp_zero NormedSpace.exp_zero @[simp] theorem exp_op [T2Space 𝔸] (x : 𝔸) : exp 𝕂 (MulOpposite.op x) = MulOpposite.op (exp 𝕂 x) := by simp_rw [exp, expSeries_sum_eq, ← MulOpposite.op_pow, ← MulOpposite.op_smul, tsum_op] #align exp_op NormedSpace.exp_op @[simp]
Mathlib/Analysis/NormedSpace/Exponential.lean
155
157
theorem exp_unop [T2Space 𝔸] (x : 𝔸ᵐᵒᵖ) : exp 𝕂 (MulOpposite.unop x) = MulOpposite.unop (exp 𝕂 x) := by
simp_rw [exp, expSeries_sum_eq, ← MulOpposite.unop_pow, ← MulOpposite.unop_smul, tsum_unop]
0.875
import Mathlib.Algebra.Polynomial.Degree.Lemmas open Polynomial namespace Mathlib.Tactic.ComputeDegree section recursion_lemmas variable {R : Type*} section semiring variable [Semiring R] theorem natDegree_C_le (a : R) : natDegree (C a) ≤ 0 := (natDegree_C a).le theorem natDegree_natCast_le (n : ℕ) : natDegree (n : R[X]) ≤ 0 := (natDegree_natCast _).le theorem natDegree_zero_le : natDegree (0 : R[X]) ≤ 0 := natDegree_zero.le theorem natDegree_one_le : natDegree (1 : R[X]) ≤ 0 := natDegree_one.le @[deprecated (since := "2024-04-17")] alias natDegree_nat_cast_le := natDegree_natCast_le
Mathlib/Tactic/ComputeDegree.lean
101
103
theorem coeff_add_of_eq {n : ℕ} {a b : R} {f g : R[X]} (h_add_left : f.coeff n = a) (h_add_right : g.coeff n = b) : (f + g).coeff n = a + b := by
subst ‹_› ‹_›; apply coeff_add
0.875
import Mathlib.Algebra.Algebra.Spectrum import Mathlib.LinearAlgebra.GeneralLinearGroup import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.RingTheory.Nilpotent.Basic #align_import linear_algebra.eigenspace.basic from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1" universe u v w namespace Module namespace End open FiniteDimensional Set variable {K R : Type v} {V M : Type w} [CommRing R] [AddCommGroup M] [Module R M] [Field K] [AddCommGroup V] [Module K V] def eigenspace (f : End R M) (μ : R) : Submodule R M := LinearMap.ker (f - algebraMap R (End R M) μ) #align module.End.eigenspace Module.End.eigenspace @[simp]
Mathlib/LinearAlgebra/Eigenspace/Basic.lean
69
69
theorem eigenspace_zero (f : End R M) : f.eigenspace 0 = LinearMap.ker f := by
simp [eigenspace]
0.875
import Mathlib.Algebra.Order.Group.Defs import Mathlib.Algebra.Order.Monoid.WithTop #align_import algebra.order.group.with_top from "leanprover-community/mathlib"@"f178c0e25af359f6cbc72a96a243efd3b12423a3" namespace WithTop variable {α : Type*} namespace LinearOrderedAddCommGroup variable [LinearOrderedAddCommGroup α] {a b c d : α} instance instNeg : Neg (WithTop α) where neg := Option.map fun a : α => -a protected def sub : ∀ _ _ : WithTop α, WithTop α | _, ⊤ => ⊤ | ⊤, (x : α) => ⊤ | (x : α), (y : α) => (x - y : α) instance instSub : Sub (WithTop α) where sub := WithTop.LinearOrderedAddCommGroup.sub @[simp, norm_cast] theorem coe_neg (a : α) : ((-a : α) : WithTop α) = -a := rfl #align with_top.coe_neg WithTop.LinearOrderedAddCommGroup.coe_neg @[simp] theorem neg_top : -(⊤ : WithTop α) = ⊤ := rfl @[simp, norm_cast] theorem coe_sub {a b : α} : (↑(a - b) : WithTop α) = ↑a - ↑b := rfl @[simp]
Mathlib/Algebra/Order/Group/WithTop.lean
61
62
theorem top_sub {a : WithTop α} : (⊤ : WithTop α) - a = ⊤ := by
cases a <;> rfl
0.875
import Mathlib.Geometry.Manifold.MFDeriv.FDeriv noncomputable section open scoped Manifold open Bundle Set Topology section SpecificFunctions variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [SmoothManifoldWithCorners I' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] [SmoothManifoldWithCorners I'' M''] variable {s : Set M} {x : M} section id theorem hasMFDerivAt_id (x : M) : HasMFDerivAt I I (@id M) x (ContinuousLinearMap.id 𝕜 (TangentSpace I x)) := by refine ⟨continuousAt_id, ?_⟩ have : ∀ᶠ y in 𝓝[range I] (extChartAt I x) x, (extChartAt I x ∘ (extChartAt I x).symm) y = y := by apply Filter.mem_of_superset (extChartAt_target_mem_nhdsWithin I x) mfld_set_tac apply HasFDerivWithinAt.congr_of_eventuallyEq (hasFDerivWithinAt_id _ _) this simp only [mfld_simps] #align has_mfderiv_at_id hasMFDerivAt_id theorem hasMFDerivWithinAt_id (s : Set M) (x : M) : HasMFDerivWithinAt I I (@id M) s x (ContinuousLinearMap.id 𝕜 (TangentSpace I x)) := (hasMFDerivAt_id I x).hasMFDerivWithinAt #align has_mfderiv_within_at_id hasMFDerivWithinAt_id theorem mdifferentiableAt_id : MDifferentiableAt I I (@id M) x := (hasMFDerivAt_id I x).mdifferentiableAt #align mdifferentiable_at_id mdifferentiableAt_id theorem mdifferentiableWithinAt_id : MDifferentiableWithinAt I I (@id M) s x := (mdifferentiableAt_id I).mdifferentiableWithinAt #align mdifferentiable_within_at_id mdifferentiableWithinAt_id theorem mdifferentiable_id : MDifferentiable I I (@id M) := fun _ => mdifferentiableAt_id I #align mdifferentiable_id mdifferentiable_id theorem mdifferentiableOn_id : MDifferentiableOn I I (@id M) s := (mdifferentiable_id I).mdifferentiableOn #align mdifferentiable_on_id mdifferentiableOn_id @[simp, mfld_simps] theorem mfderiv_id : mfderiv I I (@id M) x = ContinuousLinearMap.id 𝕜 (TangentSpace I x) := HasMFDerivAt.mfderiv (hasMFDerivAt_id I x) #align mfderiv_id mfderiv_id theorem mfderivWithin_id (hxs : UniqueMDiffWithinAt I s x) : mfderivWithin I I (@id M) s x = ContinuousLinearMap.id 𝕜 (TangentSpace I x) := by rw [MDifferentiable.mfderivWithin (mdifferentiableAt_id I) hxs] exact mfderiv_id I #align mfderiv_within_id mfderivWithin_id @[simp, mfld_simps]
Mathlib/Geometry/Manifold/MFDeriv/SpecificFunctions.lean
164
164
theorem tangentMap_id : tangentMap I I (id : M → M) = id := by
ext1 ⟨x, v⟩; simp [tangentMap]
0.875
import Mathlib.Data.Vector.Basic import Mathlib.Data.Vector.Snoc set_option autoImplicit true namespace Vector section Fold section Binary variable (xs : Vector α n) (ys : Vector β n) @[simp] theorem mapAccumr₂_mapAccumr_left (f₁ : γ → β → σ₁ → σ₁ × ζ) (f₂ : α → σ₂ → σ₂ × γ) : (mapAccumr₂ f₁ (mapAccumr f₂ xs s₂).snd ys s₁) = let m := (mapAccumr₂ (fun x y s => let r₂ := f₂ x s.snd let r₁ := f₁ r₂.snd y s.fst ((r₁.fst, r₂.fst), r₁.snd) ) xs ys (s₁, s₂)) (m.fst.fst, m.snd) := by induction xs, ys using Vector.revInductionOn₂ generalizing s₁ s₂ <;> simp_all @[simp]
Mathlib/Data/Vector/MapLemmas.lean
71
73
theorem map₂_map_left (f₁ : γ → β → ζ) (f₂ : α → γ) : map₂ f₁ (map f₂ xs) ys = map₂ (fun x y => f₁ (f₂ x) y) xs ys := by
induction xs, ys using Vector.revInductionOn₂ <;> simp_all
0.875
import Mathlib.Analysis.SpecialFunctions.Pow.Complex import Qq #align_import analysis.special_functions.pow.real from "leanprover-community/mathlib"@"4fa54b337f7d52805480306db1b1439c741848c8" noncomputable section open scoped Classical open Real ComplexConjugate open Finset Set namespace Real variable {x y z : ℝ} noncomputable def rpow (x y : ℝ) := ((x : ℂ) ^ (y : ℂ)).re #align real.rpow Real.rpow noncomputable instance : Pow ℝ ℝ := ⟨rpow⟩ @[simp] theorem rpow_eq_pow (x y : ℝ) : rpow x y = x ^ y := rfl #align real.rpow_eq_pow Real.rpow_eq_pow theorem rpow_def (x y : ℝ) : x ^ y = ((x : ℂ) ^ (y : ℂ)).re := rfl #align real.rpow_def Real.rpow_def theorem rpow_def_of_nonneg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : x ^ y = if x = 0 then if y = 0 then 1 else 0 else exp (log x * y) := by simp only [rpow_def, Complex.cpow_def]; split_ifs <;> simp_all [(Complex.ofReal_log hx).symm, -Complex.ofReal_mul, -RCLike.ofReal_mul, (Complex.ofReal_mul _ _).symm, Complex.exp_ofReal_re, Complex.ofReal_eq_zero] #align real.rpow_def_of_nonneg Real.rpow_def_of_nonneg
Mathlib/Analysis/SpecialFunctions/Pow/Real.lean
56
57
theorem rpow_def_of_pos {x : ℝ} (hx : 0 < x) (y : ℝ) : x ^ y = exp (log x * y) := by
rw [rpow_def_of_nonneg (le_of_lt hx), if_neg (ne_of_gt hx)]
0.875
import Mathlib.Algebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.DirectSum.TensorProduct #align_import linear_algebra.direct_sum.finsupp from "leanprover-community/mathlib"@"9b9d125b7be0930f564a68f1d73ace10cf46064d" noncomputable section open DirectSum TensorProduct open Set LinearMap Submodule section TensorProduct variable (R : Type*) [CommSemiring R] (M : Type*) [AddCommMonoid M] [Module R M] (N : Type*) [AddCommMonoid N] [Module R N] namespace TensorProduct variable (ι : Type*) [DecidableEq ι] noncomputable def finsuppLeft : (ι →₀ M) ⊗[R] N ≃ₗ[R] ι →₀ M ⊗[R] N := congr (finsuppLEquivDirectSum R M ι) (.refl R N) ≪≫ₗ directSumLeft R (fun _ ↦ M) N ≪≫ₗ (finsuppLEquivDirectSum R _ ι).symm variable {R M N ι} lemma finsuppLeft_apply_tmul (p : ι →₀ M) (n : N) : finsuppLeft R M N ι (p ⊗ₜ[R] n) = p.sum fun i m ↦ Finsupp.single i (m ⊗ₜ[R] n) := by apply p.induction_linear · simp · intros f g hf hg; simp [add_tmul, map_add, hf, hg, Finsupp.sum_add_index] · simp [finsuppLeft] @[simp] lemma finsuppLeft_apply_tmul_apply (p : ι →₀ M) (n : N) (i : ι) : finsuppLeft R M N ι (p ⊗ₜ[R] n) i = p i ⊗ₜ[R] n := by rw [finsuppLeft_apply_tmul, Finsupp.sum_apply, Finsupp.sum_eq_single i (fun _ _ ↦ Finsupp.single_eq_of_ne) (by simp), Finsupp.single_eq_same]
Mathlib/LinearAlgebra/DirectSum/Finsupp.lean
102
107
theorem finsuppLeft_apply (t : (ι →₀ M) ⊗[R] N) (i : ι) : finsuppLeft R M N ι t i = rTensor N (Finsupp.lapply i) t := by
induction t using TensorProduct.induction_on with | zero => simp | tmul f n => simp only [finsuppLeft_apply_tmul_apply, rTensor_tmul, Finsupp.lapply_apply] | add x y hx hy => simp [map_add, hx, hy]
0.875
import Mathlib.Topology.Instances.ENNReal import Mathlib.MeasureTheory.Measure.Dirac #align_import probability.probability_mass_function.basic from "leanprover-community/mathlib"@"4ac69b290818724c159de091daa3acd31da0ee6d" noncomputable section variable {α β γ : Type*} open scoped Classical open NNReal ENNReal MeasureTheory def PMF.{u} (α : Type u) : Type u := { f : α → ℝ≥0∞ // HasSum f 1 } #align pmf PMF namespace PMF instance instFunLike : FunLike (PMF α) α ℝ≥0∞ where coe p a := p.1 a coe_injective' _ _ h := Subtype.eq h #align pmf.fun_like PMF.instFunLike @[ext] protected theorem ext {p q : PMF α} (h : ∀ x, p x = q x) : p = q := DFunLike.ext p q h #align pmf.ext PMF.ext theorem ext_iff {p q : PMF α} : p = q ↔ ∀ x, p x = q x := DFunLike.ext_iff #align pmf.ext_iff PMF.ext_iff theorem hasSum_coe_one (p : PMF α) : HasSum p 1 := p.2 #align pmf.has_sum_coe_one PMF.hasSum_coe_one @[simp] theorem tsum_coe (p : PMF α) : ∑' a, p a = 1 := p.hasSum_coe_one.tsum_eq #align pmf.tsum_coe PMF.tsum_coe theorem tsum_coe_ne_top (p : PMF α) : ∑' a, p a ≠ ∞ := p.tsum_coe.symm ▸ ENNReal.one_ne_top #align pmf.tsum_coe_ne_top PMF.tsum_coe_ne_top theorem tsum_coe_indicator_ne_top (p : PMF α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞ := ne_of_lt (lt_of_le_of_lt (tsum_le_tsum (fun _ => Set.indicator_apply_le fun _ => le_rfl) ENNReal.summable ENNReal.summable) (lt_of_le_of_ne le_top p.tsum_coe_ne_top)) #align pmf.tsum_coe_indicator_ne_top PMF.tsum_coe_indicator_ne_top @[simp] theorem coe_ne_zero (p : PMF α) : ⇑p ≠ 0 := fun hp => zero_ne_one ((tsum_zero.symm.trans (tsum_congr fun x => symm (congr_fun hp x))).trans p.tsum_coe) #align pmf.coe_ne_zero PMF.coe_ne_zero def support (p : PMF α) : Set α := Function.support p #align pmf.support PMF.support @[simp] theorem mem_support_iff (p : PMF α) (a : α) : a ∈ p.support ↔ p a ≠ 0 := Iff.rfl #align pmf.mem_support_iff PMF.mem_support_iff @[simp] theorem support_nonempty (p : PMF α) : p.support.Nonempty := Function.support_nonempty_iff.2 p.coe_ne_zero #align pmf.support_nonempty PMF.support_nonempty @[simp] theorem support_countable (p : PMF α) : p.support.Countable := Summable.countable_support_ennreal (tsum_coe_ne_top p)
Mathlib/Probability/ProbabilityMassFunction/Basic.lean
107
108
theorem apply_eq_zero_iff (p : PMF α) (a : α) : p a = 0 ↔ a ∉ p.support := by
rw [mem_support_iff, Classical.not_not]
0.875
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {α Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀] {γ γ₁ γ₂ : Γ₀} {l : Filter α} {f : α → Γ₀} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Γ₀ := nhdsAdjoint 0 <| ⨅ γ ≠ 0, 𝓟 (Iio γ) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace theorem nhds_eq_update : (𝓝 : Γ₀ → Filter Γ₀) = update pure 0 (⨅ γ ≠ 0, 𝓟 (Iio γ)) := by rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInf₂ fun γ hγ ↦ le_principal_iff.2 <| zero_lt_iff.2 hγ #align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update theorem nhds_zero : 𝓝 (0 : Γ₀) = ⨅ γ ≠ 0, 𝓟 (Iio γ) := by rw [nhds_eq_update, update_same] #align with_zero_topology.nhds_zero WithZeroTopology.nhds_zero theorem hasBasis_nhds_zero : (𝓝 (0 : Γ₀)).HasBasis (fun γ : Γ₀ => γ ≠ 0) Iio := by rw [nhds_zero] refine hasBasis_biInf_principal ?_ ⟨1, one_ne_zero⟩ exact directedOn_iff_directed.2 (Monotone.directed_ge fun a b hab => Iio_subset_Iio hab) #align with_zero_topology.has_basis_nhds_zero WithZeroTopology.hasBasis_nhds_zero theorem Iio_mem_nhds_zero (hγ : γ ≠ 0) : Iio γ ∈ 𝓝 (0 : Γ₀) := hasBasis_nhds_zero.mem_of_mem hγ #align with_zero_topology.Iio_mem_nhds_zero WithZeroTopology.Iio_mem_nhds_zero theorem nhds_zero_of_units (γ : Γ₀ˣ) : Iio ↑γ ∈ 𝓝 (0 : Γ₀) := Iio_mem_nhds_zero γ.ne_zero #align with_zero_topology.nhds_zero_of_units WithZeroTopology.nhds_zero_of_units theorem tendsto_zero : Tendsto f l (𝓝 (0 : Γ₀)) ↔ ∀ (γ₀) (_ : γ₀ ≠ 0), ∀ᶠ x in l, f x < γ₀ := by simp [nhds_zero] #align with_zero_topology.tendsto_zero WithZeroTopology.tendsto_zero @[simp] theorem nhds_of_ne_zero {γ : Γ₀} (h₀ : γ ≠ 0) : 𝓝 γ = pure γ := nhds_nhdsAdjoint_of_ne _ h₀ #align with_zero_topology.nhds_of_ne_zero WithZeroTopology.nhds_of_ne_zero theorem nhds_coe_units (γ : Γ₀ˣ) : 𝓝 (γ : Γ₀) = pure (γ : Γ₀) := nhds_of_ne_zero γ.ne_zero #align with_zero_topology.nhds_coe_units WithZeroTopology.nhds_coe_units theorem singleton_mem_nhds_of_units (γ : Γ₀ˣ) : ({↑γ} : Set Γ₀) ∈ 𝓝 (γ : Γ₀) := by simp #align with_zero_topology.singleton_mem_nhds_of_units WithZeroTopology.singleton_mem_nhds_of_units theorem singleton_mem_nhds_of_ne_zero (h : γ ≠ 0) : ({γ} : Set Γ₀) ∈ 𝓝 (γ : Γ₀) := by simp [h] #align with_zero_topology.singleton_mem_nhds_of_ne_zero WithZeroTopology.singleton_mem_nhds_of_ne_zero theorem hasBasis_nhds_of_ne_zero {x : Γ₀} (h : x ≠ 0) : HasBasis (𝓝 x) (fun _ : Unit => True) fun _ => {x} := by rw [nhds_of_ne_zero h] exact hasBasis_pure _ #align with_zero_topology.has_basis_nhds_of_ne_zero WithZeroTopology.hasBasis_nhds_of_ne_zero theorem hasBasis_nhds_units (γ : Γ₀ˣ) : HasBasis (𝓝 (γ : Γ₀)) (fun _ : Unit => True) fun _ => {↑γ} := hasBasis_nhds_of_ne_zero γ.ne_zero #align with_zero_topology.has_basis_nhds_units WithZeroTopology.hasBasis_nhds_units
Mathlib/Topology/Algebra/WithZeroTopology.lean
120
121
theorem tendsto_of_ne_zero {γ : Γ₀} (h : γ ≠ 0) : Tendsto f l (𝓝 γ) ↔ ∀ᶠ x in l, f x = γ := by
rw [nhds_of_ne_zero h, tendsto_pure]
0.875
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.MeanInequalitiesPow import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Data.Set.Image import Mathlib.Topology.Algebra.Order.LiminfLimsup #align_import analysis.normed_space.lp_space from "leanprover-community/mathlib"@"de83b43717abe353f425855fcf0cedf9ea0fe8a4" noncomputable section open scoped NNReal ENNReal Function variable {α : Type*} {E : α → Type*} {p q : ℝ≥0∞} [∀ i, NormedAddCommGroup (E i)] def Memℓp (f : ∀ i, E i) (p : ℝ≥0∞) : Prop := if p = 0 then Set.Finite { i | f i ≠ 0 } else if p = ∞ then BddAbove (Set.range fun i => ‖f i‖) else Summable fun i => ‖f i‖ ^ p.toReal #align mem_ℓp Memℓp
Mathlib/Analysis/NormedSpace/lpSpace.lean
81
83
theorem memℓp_zero_iff {f : ∀ i, E i} : Memℓp f 0 ↔ Set.Finite { i | f i ≠ 0 } := by
dsimp [Memℓp] rw [if_pos rfl]
0.875
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Setoid.Basic import Mathlib.Dynamics.FixedPoints.Topology import Mathlib.Topology.MetricSpace.Lipschitz #align_import topology.metric_space.contracting from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open NNReal Topology ENNReal Filter Function variable {α : Type*} def ContractingWith [EMetricSpace α] (K : ℝ≥0) (f : α → α) := K < 1 ∧ LipschitzWith K f #align contracting_with ContractingWith namespace ContractingWith variable [EMetricSpace α] [cs : CompleteSpace α] {K : ℝ≥0} {f : α → α} open EMetric Set theorem toLipschitzWith (hf : ContractingWith K f) : LipschitzWith K f := hf.2 #align contracting_with.to_lipschitz_with ContractingWith.toLipschitzWith theorem one_sub_K_pos' (hf : ContractingWith K f) : (0 : ℝ≥0∞) < 1 - K := by simp [hf.1] set_option linter.uppercaseLean3 false in #align contracting_with.one_sub_K_pos' ContractingWith.one_sub_K_pos' theorem one_sub_K_ne_zero (hf : ContractingWith K f) : (1 : ℝ≥0∞) - K ≠ 0 := ne_of_gt hf.one_sub_K_pos' set_option linter.uppercaseLean3 false in #align contracting_with.one_sub_K_ne_zero ContractingWith.one_sub_K_ne_zero
Mathlib/Topology/MetricSpace/Contracting.lean
62
64
theorem one_sub_K_ne_top : (1 : ℝ≥0∞) - K ≠ ∞ := by
norm_cast exact ENNReal.coe_ne_top
0.875
import Mathlib.Algebra.Group.Center #align_import group_theory.subsemigroup.centralizer from "leanprover-community/mathlib"@"cc67cd75b4e54191e13c2e8d722289a89e67e4fa" variable {M : Type*} {S T : Set M} namespace Set variable (S) @[to_additive addCentralizer " The centralizer of a subset of an additive magma. "] def centralizer [Mul M] : Set M := { c | ∀ m ∈ S, m * c = c * m } #align set.centralizer Set.centralizer #align set.add_centralizer Set.addCentralizer variable {S} @[to_additive mem_addCentralizer] theorem mem_centralizer_iff [Mul M] {c : M} : c ∈ centralizer S ↔ ∀ m ∈ S, m * c = c * m := Iff.rfl #align set.mem_centralizer_iff Set.mem_centralizer_iff #align set.mem_add_centralizer Set.mem_addCentralizer @[to_additive decidableMemAddCentralizer] instance decidableMemCentralizer [Mul M] [∀ a : M, Decidable <| ∀ b ∈ S, b * a = a * b] : DecidablePred (· ∈ centralizer S) := fun _ => decidable_of_iff' _ mem_centralizer_iff #align set.decidable_mem_centralizer Set.decidableMemCentralizer #align set.decidable_mem_add_centralizer Set.decidableMemAddCentralizer variable (S) @[to_additive (attr := simp) zero_mem_addCentralizer] theorem one_mem_centralizer [MulOneClass M] : (1 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.one_mem_centralizer Set.one_mem_centralizer #align set.zero_mem_add_centralizer Set.zero_mem_addCentralizer @[simp] theorem zero_mem_centralizer [MulZeroClass M] : (0 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.zero_mem_centralizer Set.zero_mem_centralizer variable {S} {a b : M} @[to_additive (attr := simp) add_mem_addCentralizer] theorem mul_mem_centralizer [Semigroup M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a * b ∈ centralizer S := fun g hg => by rw [mul_assoc, ← hb g hg, ← mul_assoc, ha g hg, mul_assoc] #align set.mul_mem_centralizer Set.mul_mem_centralizer #align set.add_mem_add_centralizer Set.add_mem_addCentralizer @[to_additive (attr := simp) neg_mem_addCentralizer] theorem inv_mem_centralizer [Group M] (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S := fun g hg => by rw [mul_inv_eq_iff_eq_mul, mul_assoc, eq_inv_mul_iff_mul_eq, ha g hg] #align set.inv_mem_centralizer Set.inv_mem_centralizer #align set.neg_mem_add_centralizer Set.neg_mem_addCentralizer @[simp] theorem inv_mem_centralizer₀ [GroupWithZero M] (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S := (eq_or_ne a 0).elim (fun h => by rw [h, inv_zero] exact zero_mem_centralizer S) fun ha0 c hc => by rw [mul_inv_eq_iff_eq_mul₀ ha0, mul_assoc, eq_inv_mul_iff_mul_eq₀ ha0, ha c hc] #align set.inv_mem_centralizer₀ Set.inv_mem_centralizer₀ @[to_additive (attr := simp) sub_mem_addCentralizer] theorem div_mem_centralizer [Group M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a / b ∈ centralizer S := by rw [div_eq_mul_inv] exact mul_mem_centralizer ha (inv_mem_centralizer hb) #align set.div_mem_centralizer Set.div_mem_centralizer #align set.sub_mem_add_centralizer Set.sub_mem_addCentralizer @[simp]
Mathlib/Algebra/Group/Centralizer.lean
102
105
theorem div_mem_centralizer₀ [GroupWithZero M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a / b ∈ centralizer S := by
rw [div_eq_mul_inv] exact mul_mem_centralizer ha (inv_mem_centralizer₀ hb)
0.875
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.Order.Interval.Set.Group import Mathlib.Analysis.Convex.Segment import Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional import Mathlib.Tactic.FieldSimp #align_import analysis.convex.between from "leanprover-community/mathlib"@"571e13cacbed7bf042fd3058ce27157101433842" variable (R : Type*) {V V' P P' : Type*} open AffineEquiv AffineMap section OrderedRing variable [OrderedRing R] [AddCommGroup V] [Module R V] [AddTorsor V P] variable [AddCommGroup V'] [Module R V'] [AddTorsor V' P'] def affineSegment (x y : P) := lineMap x y '' Set.Icc (0 : R) 1 #align affine_segment affineSegment
Mathlib/Analysis/Convex/Between.lean
45
46
theorem affineSegment_eq_segment (x y : V) : affineSegment R x y = segment R x y := by
rw [segment_eq_image_lineMap, affineSegment]
0.875
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]
Mathlib/Data/List/Join.lean
28
28
theorem join_singleton (l : List α) : [l].join = l := by
rw [join, join, append_nil]
0.875
import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.FDeriv.Comp import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars #align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" universe u v w open scoped Classical open 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 {f f₀ f₁ g : 𝕜 → F} variable {f' f₀' f₁' g' : F} variable {x : 𝕜} variable {s t : Set 𝕜} variable {L L₁ L₂ : Filter 𝕜} section Composition variable {𝕜' : Type*} [NontriviallyNormedField 𝕜'] [NormedAlgebra 𝕜 𝕜'] [NormedSpace 𝕜' F] [IsScalarTower 𝕜 𝕜' F] {s' t' : Set 𝕜'} {h : 𝕜 → 𝕜'} {h₁ : 𝕜 → 𝕜} {h₂ : 𝕜' → 𝕜'} {h' h₂' : 𝕜'} {h₁' : 𝕜} {g₁ : 𝕜' → F} {g₁' : F} {L' : Filter 𝕜'} {y : 𝕜'} (x) theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter g₁ g₁' (h x) L') (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') : HasDerivAtFilter (g₁ ∘ h) (h' • g₁') x L := by simpa using ((hg.restrictScalars 𝕜).comp x hh hL).hasDerivAtFilter #align has_deriv_at_filter.scomp HasDerivAtFilter.scomp theorem HasDerivAtFilter.scomp_of_eq (hg : HasDerivAtFilter g₁ g₁' y L') (hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') : HasDerivAtFilter (g₁ ∘ h) (h' • g₁') x L := by rw [hy] at hg; exact hg.scomp x hh hL theorem HasDerivWithinAt.scomp_hasDerivAt (hg : HasDerivWithinAt g₁ g₁' s' (h x)) (hh : HasDerivAt h h' x) (hs : ∀ x, h x ∈ s') : HasDerivAt (g₁ ∘ h) (h' • g₁') x := hg.scomp x hh <| tendsto_inf.2 ⟨hh.continuousAt, tendsto_principal.2 <| eventually_of_forall hs⟩ #align has_deriv_within_at.scomp_has_deriv_at HasDerivWithinAt.scomp_hasDerivAt theorem HasDerivWithinAt.scomp_hasDerivAt_of_eq (hg : HasDerivWithinAt g₁ g₁' s' y) (hh : HasDerivAt h h' x) (hs : ∀ x, h x ∈ s') (hy : y = h x) : HasDerivAt (g₁ ∘ h) (h' • g₁') x := by rw [hy] at hg; exact hg.scomp_hasDerivAt x hh hs nonrec theorem HasDerivWithinAt.scomp (hg : HasDerivWithinAt g₁ g₁' t' (h x)) (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') : HasDerivWithinAt (g₁ ∘ h) (h' • g₁') s x := hg.scomp x hh <| hh.continuousWithinAt.tendsto_nhdsWithin hst #align has_deriv_within_at.scomp HasDerivWithinAt.scomp theorem HasDerivWithinAt.scomp_of_eq (hg : HasDerivWithinAt g₁ g₁' t' y) (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') (hy : y = h x) : HasDerivWithinAt (g₁ ∘ h) (h' • g₁') s x := by rw [hy] at hg; exact hg.scomp x hh hst nonrec theorem HasDerivAt.scomp (hg : HasDerivAt g₁ g₁' (h x)) (hh : HasDerivAt h h' x) : HasDerivAt (g₁ ∘ h) (h' • g₁') x := hg.scomp x hh hh.continuousAt #align has_deriv_at.scomp HasDerivAt.scomp
Mathlib/Analysis/Calculus/Deriv/Comp.lean
113
116
theorem HasDerivAt.scomp_of_eq (hg : HasDerivAt g₁ g₁' y) (hh : HasDerivAt h h' x) (hy : y = h x) : HasDerivAt (g₁ ∘ h) (h' • g₁') x := by
rw [hy] at hg; exact hg.scomp x hh
0.875
import Mathlib.LinearAlgebra.DirectSum.Finsupp import Mathlib.LinearAlgebra.FinsuppVectorSpace #align_import linear_algebra.tensor_product_basis from "leanprover-community/mathlib"@"f784cc6142443d9ee623a20788c282112c322081" noncomputable section open Set LinearMap Submodule section CommSemiring variable {R : Type*} {S : Type*} {M : Type*} {N : Type*} {ι : Type*} {κ : Type*} [CommSemiring R] [Semiring S] [Algebra R S] [AddCommMonoid M] [Module R M] [Module S M] [IsScalarTower R S M] [AddCommMonoid N] [Module R N] def Basis.tensorProduct (b : Basis ι S M) (c : Basis κ R N) : Basis (ι × κ) S (TensorProduct R M N) := Finsupp.basisSingleOne.map ((TensorProduct.AlgebraTensorModule.congr b.repr c.repr).trans <| (finsuppTensorFinsupp R S _ _ _ _).trans <| Finsupp.lcongr (Equiv.refl _) (TensorProduct.AlgebraTensorModule.rid R S S)).symm #align basis.tensor_product Basis.tensorProduct @[simp] theorem Basis.tensorProduct_apply (b : Basis ι R M) (c : Basis κ R N) (i : ι) (j : κ) : Basis.tensorProduct b c (i, j) = b i ⊗ₜ c j := by simp [Basis.tensorProduct] #align basis.tensor_product_apply Basis.tensorProduct_apply
Mathlib/LinearAlgebra/TensorProduct/Basis.lean
44
46
theorem Basis.tensorProduct_apply' (b : Basis ι R M) (c : Basis κ R N) (i : ι × κ) : Basis.tensorProduct b c i = b i.1 ⊗ₜ c i.2 := by
simp [Basis.tensorProduct]
0.875
import Mathlib.Algebra.ContinuedFractions.Basic import Mathlib.Algebra.GroupWithZero.Basic #align_import algebra.continued_fractions.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace GeneralizedContinuedFraction section General variable {α : Type*} {g : GeneralizedContinuedFraction α} {n : ℕ} theorem terminatedAt_iff_s_terminatedAt : g.TerminatedAt n ↔ g.s.TerminatedAt n := by rfl #align generalized_continued_fraction.terminated_at_iff_s_terminated_at GeneralizedContinuedFraction.terminatedAt_iff_s_terminatedAt
Mathlib/Algebra/ContinuedFractions/Translations.lean
38
38
theorem terminatedAt_iff_s_none : g.TerminatedAt n ↔ g.s.get? n = none := by
rfl
0.875
import Mathlib.LinearAlgebra.Matrix.BilinearForm import Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly import Mathlib.LinearAlgebra.Determinant import Mathlib.LinearAlgebra.FiniteDimensional import Mathlib.LinearAlgebra.Vandermonde import Mathlib.LinearAlgebra.Trace import Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure import Mathlib.FieldTheory.PrimitiveElement import Mathlib.FieldTheory.Galois import Mathlib.RingTheory.PowerBasis import Mathlib.FieldTheory.Minpoly.MinpolyDiv #align_import ring_theory.trace from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" universe u v w z variable {R S T : Type*} [CommRing R] [CommRing S] [CommRing T] variable [Algebra R S] [Algebra R T] variable {K L : Type*} [Field K] [Field L] [Algebra K L] variable {ι κ : Type w} [Fintype ι] open FiniteDimensional open LinearMap (BilinForm) open LinearMap open Matrix open scoped Matrix namespace Algebra variable (b : Basis ι R S) variable (R S) noncomputable def trace : S →ₗ[R] R := (LinearMap.trace R S).comp (lmul R S).toLinearMap #align algebra.trace Algebra.trace variable {S} -- Not a `simp` lemma since there are more interesting ways to rewrite `trace R S x`, -- for example `trace_trace` theorem trace_apply (x) : trace R S x = LinearMap.trace R S (lmul R S x) := rfl #align algebra.trace_apply Algebra.trace_apply theorem trace_eq_zero_of_not_exists_basis (h : ¬∃ s : Finset S, Nonempty (Basis s R S)) : trace R S = 0 := by ext s; simp [trace_apply, LinearMap.trace, h] #align algebra.trace_eq_zero_of_not_exists_basis Algebra.trace_eq_zero_of_not_exists_basis variable {R} -- Can't be a `simp` lemma because it depends on a choice of basis theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : trace R S s = Matrix.trace (Algebra.leftMulMatrix b s) := by rw [trace_apply, LinearMap.trace_eq_matrix_trace _ b, ← toMatrix_lmul_eq]; rfl #align algebra.trace_eq_matrix_trace Algebra.trace_eq_matrix_trace theorem trace_algebraMap_of_basis (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by haveI := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert Finset.sum_const x simp [-coe_lmul_eq_mul] #align algebra.trace_algebra_map_of_basis Algebra.trace_algebraMap_of_basis @[simp] theorem trace_algebraMap (x : K) : trace K L (algebraMap K L x) = finrank K L • x := by by_cases H : ∃ s : Finset L, Nonempty (Basis s K L) · rw [trace_algebraMap_of_basis H.choose_spec.some, finrank_eq_card_basis H.choose_spec.some] · simp [trace_eq_zero_of_not_exists_basis K H, finrank_eq_zero_of_not_exists_basis_finset H] #align algebra.trace_algebra_map Algebra.trace_algebraMap theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) : trace R S (trace S T x) = trace R T x := by haveI := Classical.decEq ι haveI := Classical.decEq κ cases nonempty_fintype ι cases nonempty_fintype κ rw [trace_eq_matrix_trace (b.smul c), trace_eq_matrix_trace b, trace_eq_matrix_trace c, Matrix.trace, Matrix.trace, Matrix.trace, ← Finset.univ_product_univ, Finset.sum_product] refine Finset.sum_congr rfl fun i _ ↦ ?_ simp only [AlgHom.map_sum, smul_leftMulMatrix, Finset.sum_apply, Matrix.diag, Finset.sum_apply i (Finset.univ : Finset κ) fun y => leftMulMatrix b (leftMulMatrix c x y y)] #align algebra.trace_trace_of_basis Algebra.trace_trace_of_basis theorem trace_comp_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) : (trace R S).comp ((trace S T).restrictScalars R) = trace R T := by ext rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace_of_basis b c] #align algebra.trace_comp_trace_of_basis Algebra.trace_comp_trace_of_basis @[simp] theorem trace_trace [Algebra K T] [Algebra L T] [IsScalarTower K L T] [FiniteDimensional K L] [FiniteDimensional L T] (x : T) : trace K L (trace L T x) = trace K T x := trace_trace_of_basis (Basis.ofVectorSpace K L) (Basis.ofVectorSpace L T) x #align algebra.trace_trace Algebra.trace_trace @[simp]
Mathlib/RingTheory/Trace.lean
163
165
theorem trace_comp_trace [Algebra K T] [Algebra L T] [IsScalarTower K L T] [FiniteDimensional K L] [FiniteDimensional L T] : (trace K L).comp ((trace L T).restrictScalars K) = trace K T := by
ext; rw [LinearMap.comp_apply, LinearMap.restrictScalars_apply, trace_trace]
0.875
import Mathlib.ModelTheory.Syntax import Mathlib.ModelTheory.Semantics import Mathlib.Algebra.Ring.Equiv variable {α : Type*} namespace FirstOrder open FirstOrder inductive ringFunc : ℕ → Type | add : ringFunc 2 | mul : ringFunc 2 | neg : ringFunc 1 | zero : ringFunc 0 | one : ringFunc 0 deriving DecidableEq def Language.ring : Language := { Functions := ringFunc Relations := fun _ => Empty } namespace Ring open ringFunc Language instance (n : ℕ) : DecidableEq (Language.ring.Functions n) := by dsimp [Language.ring]; infer_instance instance (n : ℕ) : DecidableEq (Language.ring.Relations n) := by dsimp [Language.ring]; infer_instance abbrev addFunc : Language.ring.Functions 2 := add abbrev mulFunc : Language.ring.Functions 2 := mul abbrev negFunc : Language.ring.Functions 1 := neg abbrev zeroFunc : Language.ring.Functions 0 := zero abbrev oneFunc : Language.ring.Functions 0 := one instance (α : Type*) : Zero (Language.ring.Term α) := { zero := Constants.term zeroFunc } theorem zero_def (α : Type*) : (0 : Language.ring.Term α) = Constants.term zeroFunc := rfl instance (α : Type*) : One (Language.ring.Term α) := { one := Constants.term oneFunc } theorem one_def (α : Type*) : (1 : Language.ring.Term α) = Constants.term oneFunc := rfl instance (α : Type*) : Add (Language.ring.Term α) := { add := addFunc.apply₂ } theorem add_def (α : Type*) (t₁ t₂ : Language.ring.Term α) : t₁ + t₂ = addFunc.apply₂ t₁ t₂ := rfl instance (α : Type*) : Mul (Language.ring.Term α) := { mul := mulFunc.apply₂ } theorem mul_def (α : Type*) (t₁ t₂ : Language.ring.Term α) : t₁ * t₂ = mulFunc.apply₂ t₁ t₂ := rfl instance (α : Type*) : Neg (Language.ring.Term α) := { neg := negFunc.apply₁ } theorem neg_def (α : Type*) (t : Language.ring.Term α) : -t = negFunc.apply₁ t := rfl instance : Fintype Language.ring.Symbols := ⟨⟨Multiset.ofList [Sum.inl ⟨2, .add⟩, Sum.inl ⟨2, .mul⟩, Sum.inl ⟨1, .neg⟩, Sum.inl ⟨0, .zero⟩, Sum.inl ⟨0, .one⟩], by dsimp [Language.Symbols]; decide⟩, by intro x dsimp [Language.Symbols] rcases x with ⟨_, f⟩ | ⟨_, f⟩ · cases f <;> decide · cases f ⟩ @[simp] theorem card_ring : card Language.ring = 5 := by have : Fintype.card Language.ring.Symbols = 5 := rfl simp [Language.card, this] open Language ring Structure class CompatibleRing (R : Type*) [Add R] [Mul R] [Neg R] [One R] [Zero R] extends Language.ring.Structure R where funMap_add : ∀ x, funMap addFunc x = x 0 + x 1 funMap_mul : ∀ x, funMap mulFunc x = x 0 * x 1 funMap_neg : ∀ x, funMap negFunc x = -x 0 funMap_zero : ∀ x, funMap (zeroFunc : Language.ring.Constants) x = 0 funMap_one : ∀ x, funMap (oneFunc : Language.ring.Constants) x = 1 open CompatibleRing attribute [simp] funMap_add funMap_mul funMap_neg funMap_zero funMap_one section variable {R : Type*} [Add R] [Mul R] [Neg R] [One R] [Zero R] [CompatibleRing R] @[simp] theorem realize_add (x y : ring.Term α) (v : α → R) : Term.realize v (x + y) = Term.realize v x + Term.realize v y := by simp [add_def, funMap_add] @[simp] theorem realize_mul (x y : ring.Term α) (v : α → R) : Term.realize v (x * y) = Term.realize v x * Term.realize v y := by simp [mul_def, funMap_mul] @[simp] theorem realize_neg (x : ring.Term α) (v : α → R) : Term.realize v (-x) = -Term.realize v x := by simp [neg_def, funMap_neg] @[simp] theorem realize_zero (v : α → R) : Term.realize v (0 : ring.Term α) = 0 := by simp [zero_def, funMap_zero, constantMap] @[simp]
Mathlib/ModelTheory/Algebra/Ring/Basic.lean
199
200
theorem realize_one (v : α → R) : Term.realize v (1 : ring.Term α) = 1 := by
simp [one_def, funMap_one, constantMap]
0.875
import Mathlib.RingTheory.AdicCompletion.Basic import Mathlib.Algebra.Module.Torsion open Submodule variable {R : Type*} [CommRing R] (I : Ideal R) variable {M : Type*} [AddCommGroup M] [Module R M] namespace AdicCompletion attribute [-simp] smul_eq_mul Algebra.id.smul_eq_mul @[local simp] theorem transitionMap_ideal_mk {m n : ℕ} (hmn : m ≤ n) (x : R) : transitionMap I R hmn (Ideal.Quotient.mk (I ^ n • ⊤ : Ideal R) x) = Ideal.Quotient.mk (I ^ m • ⊤ : Ideal R) x := rfl @[local simp] theorem transitionMap_map_one {m n : ℕ} (hmn : m ≤ n) : transitionMap I R hmn 1 = 1 := rfl @[local simp] theorem transitionMap_map_mul {m n : ℕ} (hmn : m ≤ n) (x y : R ⧸ (I ^ n • ⊤ : Ideal R)) : transitionMap I R hmn (x * y) = transitionMap I R hmn x * transitionMap I R hmn y := Quotient.inductionOn₂' x y (fun _ _ ↦ rfl) def transitionMapₐ {m n : ℕ} (hmn : m ≤ n) : R ⧸ (I ^ n • ⊤ : Ideal R) →ₐ[R] R ⧸ (I ^ m • ⊤ : Ideal R) := AlgHom.ofLinearMap (transitionMap I R hmn) rfl (transitionMap_map_mul I hmn) def subalgebra : Subalgebra R (∀ n, R ⧸ (I ^ n • ⊤ : Ideal R)) := Submodule.toSubalgebra (submodule I R) (fun _ ↦ by simp) (fun x y hx hy m n hmn ↦ by simp [hx hmn, hy hmn]) def subring : Subring (∀ n, R ⧸ (I ^ n • ⊤ : Ideal R)) := Subalgebra.toSubring (subalgebra I) instance : CommRing (AdicCompletion I R) := inferInstanceAs <| CommRing (subring I) instance : Algebra R (AdicCompletion I R) := inferInstanceAs <| Algebra R (subalgebra I) @[simp] theorem val_one (n : ℕ) : (1 : AdicCompletion I R).val n = 1 := rfl @[simp] theorem val_mul (n : ℕ) (x y : AdicCompletion I R) : (x * y).val n = x.val n * y.val n := rfl def evalₐ (n : ℕ) : AdicCompletion I R →ₐ[R] R ⧸ I ^ n := have h : (I ^ n • ⊤ : Ideal R) = I ^ n := by ext x; simp AlgHom.comp (Ideal.quotientEquivAlgOfEq R h) (AlgHom.ofLinearMap (eval I R n) rfl (fun _ _ ↦ rfl)) @[simp] theorem evalₐ_mk (n : ℕ) (x : AdicCauchySequence I R) : evalₐ I n (mk I R x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by simp [evalₐ] def AdicCauchySequence.subalgebra : Subalgebra R (ℕ → R) := Submodule.toSubalgebra (AdicCauchySequence.submodule I R) (fun {m n} _ ↦ by simp; rfl) (fun x y hx hy {m n} hmn ↦ by simp only [Pi.mul_apply] exact SModEq.mul (hx hmn) (hy hmn)) def AdicCauchySequence.subring : Subring (ℕ → R) := Subalgebra.toSubring (AdicCauchySequence.subalgebra I) instance : CommRing (AdicCauchySequence I R) := inferInstanceAs <| CommRing (AdicCauchySequence.subring I) instance : Algebra R (AdicCauchySequence I R) := inferInstanceAs <| Algebra R (AdicCauchySequence.subalgebra I) @[simp] theorem one_apply (n : ℕ) : (1 : AdicCauchySequence I R) n = 1 := rfl @[simp] theorem mul_apply (n : ℕ) (f g : AdicCauchySequence I R) : (f * g) n = f n * g n := rfl @[simps!] def mkₐ : AdicCauchySequence I R →ₐ[R] AdicCompletion I R := AlgHom.ofLinearMap (mk I R) rfl (fun _ _ ↦ rfl) @[simp]
Mathlib/RingTheory/AdicCompletion/Algebra.lean
123
125
theorem evalₐ_mkₐ (n : ℕ) (x : AdicCauchySequence I R) : evalₐ I n (mkₐ I x) = Ideal.Quotient.mk (I ^ n) (x.val n) := by
simp [mkₐ]
0.875
import Mathlib.Algebra.Group.Defs #align_import algebra.invertible from "leanprover-community/mathlib"@"722b3b152ddd5e0cf21c0a29787c76596cb6b422" assert_not_exists MonoidWithZero assert_not_exists DenselyOrdered universe u variable {α : Type u} class Invertible [Mul α] [One α] (a : α) : Type u where invOf : α invOf_mul_self : invOf * a = 1 mul_invOf_self : a * invOf = 1 #align invertible Invertible prefix:max "⅟" =>-- This notation has the same precedence as `Inv.inv`. Invertible.invOf @[simp] theorem invOf_mul_self' [Mul α] [One α] (a : α) {_ : Invertible a} : ⅟ a * a = 1 := Invertible.invOf_mul_self theorem invOf_mul_self [Mul α] [One α] (a : α) [Invertible a] : ⅟ a * a = 1 := Invertible.invOf_mul_self #align inv_of_mul_self invOf_mul_self @[simp] theorem mul_invOf_self' [Mul α] [One α] (a : α) {_ : Invertible a} : a * ⅟ a = 1 := Invertible.mul_invOf_self theorem mul_invOf_self [Mul α] [One α] (a : α) [Invertible a] : a * ⅟ a = 1 := Invertible.mul_invOf_self #align mul_inv_of_self mul_invOf_self @[simp] theorem invOf_mul_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : ⅟ a * (a * b) = b := by rw [← mul_assoc, invOf_mul_self, one_mul] theorem invOf_mul_self_assoc [Monoid α] (a b : α) [Invertible a] : ⅟ a * (a * b) = b := by rw [← mul_assoc, invOf_mul_self, one_mul] #align inv_of_mul_self_assoc invOf_mul_self_assoc @[simp] theorem mul_invOf_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : a * (⅟ a * b) = b := by rw [← mul_assoc, mul_invOf_self, one_mul] theorem mul_invOf_self_assoc [Monoid α] (a b : α) [Invertible a] : a * (⅟ a * b) = b := by rw [← mul_assoc, mul_invOf_self, one_mul] #align mul_inv_of_self_assoc mul_invOf_self_assoc @[simp] theorem mul_invOf_mul_self_cancel' [Monoid α] (a b : α) {_ : Invertible b} : a * ⅟ b * b = a := by simp [mul_assoc] theorem mul_invOf_mul_self_cancel [Monoid α] (a b : α) [Invertible b] : a * ⅟ b * b = a := by simp [mul_assoc] #align mul_inv_of_mul_self_cancel mul_invOf_mul_self_cancel @[simp]
Mathlib/Algebra/Group/Invertible/Defs.lean
141
142
theorem mul_mul_invOf_self_cancel' [Monoid α] (a b : α) {_ : Invertible b} : a * b * ⅟ b = a := by
simp [mul_assoc]
0.875
import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.LinearAlgebra.SesquilinearForm #align_import analysis.inner_product_space.orthogonal from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" variable {𝕜 E F : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y namespace Submodule variable (K : Submodule 𝕜 E) def orthogonal : Submodule 𝕜 E where carrier := { v | ∀ u ∈ K, ⟪u, v⟫ = 0 } zero_mem' _ _ := inner_zero_right _ add_mem' hx hy u hu := by rw [inner_add_right, hx u hu, hy u hu, add_zero] smul_mem' c x hx u hu := by rw [inner_smul_right, hx u hu, mul_zero] #align submodule.orthogonal Submodule.orthogonal @[inherit_doc] notation:1200 K "ᗮ" => orthogonal K theorem mem_orthogonal (v : E) : v ∈ Kᗮ ↔ ∀ u ∈ K, ⟪u, v⟫ = 0 := Iff.rfl #align submodule.mem_orthogonal Submodule.mem_orthogonal theorem mem_orthogonal' (v : E) : v ∈ Kᗮ ↔ ∀ u ∈ K, ⟪v, u⟫ = 0 := by simp_rw [mem_orthogonal, inner_eq_zero_symm] #align submodule.mem_orthogonal' Submodule.mem_orthogonal' variable {K} theorem inner_right_of_mem_orthogonal {u v : E} (hu : u ∈ K) (hv : v ∈ Kᗮ) : ⟪u, v⟫ = 0 := (K.mem_orthogonal v).1 hv u hu #align submodule.inner_right_of_mem_orthogonal Submodule.inner_right_of_mem_orthogonal theorem inner_left_of_mem_orthogonal {u v : E} (hu : u ∈ K) (hv : v ∈ Kᗮ) : ⟪v, u⟫ = 0 := by rw [inner_eq_zero_symm]; exact inner_right_of_mem_orthogonal hu hv #align submodule.inner_left_of_mem_orthogonal Submodule.inner_left_of_mem_orthogonal theorem mem_orthogonal_singleton_iff_inner_right {u v : E} : v ∈ (𝕜 ∙ u)ᗮ ↔ ⟪u, v⟫ = 0 := by refine ⟨inner_right_of_mem_orthogonal (mem_span_singleton_self u), ?_⟩ intro hv w hw rw [mem_span_singleton] at hw obtain ⟨c, rfl⟩ := hw simp [inner_smul_left, hv] #align submodule.mem_orthogonal_singleton_iff_inner_right Submodule.mem_orthogonal_singleton_iff_inner_right
Mathlib/Analysis/InnerProductSpace/Orthogonal.lean
82
83
theorem mem_orthogonal_singleton_iff_inner_left {u v : E} : v ∈ (𝕜 ∙ u)ᗮ ↔ ⟪v, u⟫ = 0 := by
rw [mem_orthogonal_singleton_iff_inner_right, inner_eq_zero_symm]
0.875
import Mathlib.LinearAlgebra.CliffordAlgebra.Contraction variable {R M : Type*} variable [CommRing R] [AddCommGroup M] [Module R M] {Q : QuadraticForm R M} namespace CliffordAlgebra variable (Q) def invertibleιOfInvertible (m : M) [Invertible (Q m)] : Invertible (ι Q m) where invOf := ι Q (⅟ (Q m) • m) invOf_mul_self := by rw [map_smul, smul_mul_assoc, ι_sq_scalar, Algebra.smul_def, ← map_mul, invOf_mul_self, map_one] mul_invOf_self := by rw [map_smul, mul_smul_comm, ι_sq_scalar, Algebra.smul_def, ← map_mul, invOf_mul_self, map_one] #align clifford_algebra.invertible_ι_of_invertible CliffordAlgebra.invertibleιOfInvertible theorem invOf_ι (m : M) [Invertible (Q m)] [Invertible (ι Q m)] : ⅟ (ι Q m) = ι Q (⅟ (Q m) • m) := by letI := invertibleιOfInvertible Q m convert (rfl : ⅟ (ι Q m) = _) #align clifford_algebra.inv_of_ι CliffordAlgebra.invOf_ι theorem isUnit_ι_of_isUnit {m : M} (h : IsUnit (Q m)) : IsUnit (ι Q m) := by cases h.nonempty_invertible letI := invertibleιOfInvertible Q m exact isUnit_of_invertible (ι Q m) #align clifford_algebra.is_unit_ι_of_is_unit CliffordAlgebra.isUnit_ι_of_isUnit theorem ι_mul_ι_mul_invOf_ι (a b : M) [Invertible (ι Q a)] [Invertible (Q a)] : ι Q a * ι Q b * ⅟ (ι Q a) = ι Q ((⅟ (Q a) * QuadraticForm.polar Q a b) • a - b) := by rw [invOf_ι, map_smul, mul_smul_comm, ι_mul_ι_mul_ι, ← map_smul, smul_sub, smul_smul, smul_smul, invOf_mul_self, one_smul] #align clifford_algebra.ι_mul_ι_mul_inv_of_ι CliffordAlgebra.ι_mul_ι_mul_invOf_ι theorem invOf_ι_mul_ι_mul_ι (a b : M) [Invertible (ι Q a)] [Invertible (Q a)] : ⅟ (ι Q a) * ι Q b * ι Q a = ι Q ((⅟ (Q a) * QuadraticForm.polar Q a b) • a - b) := by rw [invOf_ι, map_smul, smul_mul_assoc, smul_mul_assoc, ι_mul_ι_mul_ι, ← map_smul, smul_sub, smul_smul, smul_smul, invOf_mul_self, one_smul] #align clifford_algebra.inv_of_ι_mul_ι_mul_ι CliffordAlgebra.invOf_ι_mul_ι_mul_ι section variable [Invertible (2 : R)] def invertibleOfInvertibleι (m : M) [Invertible (ι Q m)] : Invertible (Q m) := ExteriorAlgebra.invertibleAlgebraMapEquiv M (Q m) <| .algebraMapOfInvertibleAlgebraMap (equivExterior Q).toLinearMap (by simp) <| .copy (.mul ‹Invertible (ι Q m)› ‹Invertible (ι Q m)›) _ (ι_sq_scalar _ _).symm
Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean
66
69
theorem isUnit_of_isUnit_ι {m : M} (h : IsUnit (ι Q m)) : IsUnit (Q m) := by
cases h.nonempty_invertible letI := invertibleOfInvertibleι Q m exact isUnit_of_invertible (Q m)
0.875
import Mathlib.Logic.Pairwise import Mathlib.Order.CompleteBooleanAlgebra import Mathlib.Order.Directed import Mathlib.Order.GaloisConnection #align_import data.set.lattice from "leanprover-community/mathlib"@"b86832321b586c6ac23ef8cdef6a7a27e42b13bd" open Function Set universe u variable {α β γ : Type*} {ι ι' ι₂ : Sort*} {κ κ₁ κ₂ : ι → Sort*} {κ' : ι' → Sort*} namespace Set
Mathlib/Data/Set/Lattice.lean
67
68
theorem mem_iUnion₂ {x : γ} {s : ∀ i, κ i → Set γ} : (x ∈ ⋃ (i) (j), s i j) ↔ ∃ i j, x ∈ s i j := by
simp_rw [mem_iUnion]
0.875
import Mathlib.Algebra.Field.Basic import Mathlib.Algebra.GroupWithZero.Units.Equiv import Mathlib.Algebra.Order.Field.Defs import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Order.Bounds.OrderIso import Mathlib.Tactic.Positivity.Core #align_import algebra.order.field.basic from "leanprover-community/mathlib"@"84771a9f5f0bd5e5d6218811556508ddf476dcbd" open Function OrderDual variable {ι α β : Type*} section LinearOrderedSemifield variable [LinearOrderedSemifield α] {a b c d e : α} {m n : ℤ} @[simps! (config := { simpRhs := true })] def OrderIso.mulLeft₀ (a : α) (ha : 0 < a) : α ≃o α := { Equiv.mulLeft₀ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_left ha } #align order_iso.mul_left₀ OrderIso.mulLeft₀ #align order_iso.mul_left₀_symm_apply OrderIso.mulLeft₀_symm_apply #align order_iso.mul_left₀_apply OrderIso.mulLeft₀_apply @[simps! (config := { simpRhs := true })] def OrderIso.mulRight₀ (a : α) (ha : 0 < a) : α ≃o α := { Equiv.mulRight₀ a ha.ne' with map_rel_iff' := @fun _ _ => mul_le_mul_right ha } #align order_iso.mul_right₀ OrderIso.mulRight₀ #align order_iso.mul_right₀_symm_apply OrderIso.mulRight₀_symm_apply #align order_iso.mul_right₀_apply OrderIso.mulRight₀_apply theorem le_div_iff (hc : 0 < c) : a ≤ b / c ↔ a * c ≤ b := ⟨fun h => div_mul_cancel₀ b (ne_of_lt hc).symm ▸ mul_le_mul_of_nonneg_right h hc.le, fun h => calc a = a * c * (1 / c) := mul_mul_div a (ne_of_lt hc).symm _ ≤ b * (1 / c) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hc).le _ = b / c := (div_eq_mul_one_div b c).symm ⟩ #align le_div_iff le_div_iff theorem le_div_iff' (hc : 0 < c) : a ≤ b / c ↔ c * a ≤ b := by rw [mul_comm, le_div_iff hc] #align le_div_iff' le_div_iff' theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b := ⟨fun h => calc a = a / b * b := by rw [div_mul_cancel₀ _ (ne_of_lt hb).symm] _ ≤ c * b := mul_le_mul_of_nonneg_right h hb.le , fun h => calc a / b = a * (1 / b) := div_eq_mul_one_div a b _ ≤ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le _ = c * b / b := (div_eq_mul_one_div (c * b) b).symm _ = c := by refine (div_eq_iff (ne_of_gt hb)).mpr rfl ⟩ #align div_le_iff div_le_iff theorem div_le_iff' (hb : 0 < b) : a / b ≤ c ↔ a ≤ b * c := by rw [mul_comm, div_le_iff hb] #align div_le_iff' div_le_iff' lemma div_le_comm₀ (hb : 0 < b) (hc : 0 < c) : a / b ≤ c ↔ a / c ≤ b := by rw [div_le_iff hb, div_le_iff' hc] theorem lt_div_iff (hc : 0 < c) : a < b / c ↔ a * c < b := lt_iff_lt_of_le_iff_le <| div_le_iff hc #align lt_div_iff lt_div_iff theorem lt_div_iff' (hc : 0 < c) : a < b / c ↔ c * a < b := by rw [mul_comm, lt_div_iff hc] #align lt_div_iff' lt_div_iff' theorem div_lt_iff (hc : 0 < c) : b / c < a ↔ b < a * c := lt_iff_lt_of_le_iff_le (le_div_iff hc) #align div_lt_iff div_lt_iff theorem div_lt_iff' (hc : 0 < c) : b / c < a ↔ b < c * a := by rw [mul_comm, div_lt_iff hc] #align div_lt_iff' div_lt_iff' lemma div_lt_comm₀ (hb : 0 < b) (hc : 0 < c) : a / b < c ↔ a / c < b := by rw [div_lt_iff hb, div_lt_iff' hc] theorem inv_mul_le_iff (h : 0 < b) : b⁻¹ * a ≤ c ↔ a ≤ b * c := by rw [inv_eq_one_div, mul_comm, ← div_eq_mul_one_div] exact div_le_iff' h #align inv_mul_le_iff inv_mul_le_iff theorem inv_mul_le_iff' (h : 0 < b) : b⁻¹ * a ≤ c ↔ a ≤ c * b := by rw [inv_mul_le_iff h, mul_comm] #align inv_mul_le_iff' inv_mul_le_iff' theorem mul_inv_le_iff (h : 0 < b) : a * b⁻¹ ≤ c ↔ a ≤ b * c := by rw [mul_comm, inv_mul_le_iff h] #align mul_inv_le_iff mul_inv_le_iff theorem mul_inv_le_iff' (h : 0 < b) : a * b⁻¹ ≤ c ↔ a ≤ c * b := by rw [mul_comm, inv_mul_le_iff' h] #align mul_inv_le_iff' mul_inv_le_iff' theorem div_self_le_one (a : α) : a / a ≤ 1 := if h : a = 0 then by simp [h] else by simp [h] #align div_self_le_one div_self_le_one
Mathlib/Algebra/Order/Field/Basic.lean
117
119
theorem inv_mul_lt_iff (h : 0 < b) : b⁻¹ * a < c ↔ a < b * c := by
rw [inv_eq_one_div, mul_comm, ← div_eq_mul_one_div] exact div_lt_iff' h
0.875
import Mathlib.CategoryTheory.EqToHom import Mathlib.CategoryTheory.Pi.Basic import Mathlib.Data.ULift #align_import category_theory.discrete_category from "leanprover-community/mathlib"@"369525b73f229ccd76a6ec0e0e0bf2be57599768" namespace CategoryTheory -- morphism levels before object levels. See note [CategoryTheory universes]. universe v₁ v₂ v₃ u₁ u₁' u₂ u₃ -- This is intentionally a structure rather than a type synonym -- to enforce using `DiscreteEquiv` (or `Discrete.mk` and `Discrete.as`) to move between -- `Discrete α` and `α`. Otherwise there is too much API leakage. @[ext, aesop safe cases (rule_sets := [CategoryTheory])] structure Discrete (α : Type u₁) where as : α #align category_theory.discrete CategoryTheory.Discrete @[simp]
Mathlib/CategoryTheory/DiscreteCategory.lean
56
57
theorem Discrete.mk_as {α : Type u₁} (X : Discrete α) : Discrete.mk X.as = X := by
rfl
0.875
import Mathlib.MeasureTheory.Measure.VectorMeasure import Mathlib.MeasureTheory.Function.AEEqOfIntegral #align_import measure_theory.measure.with_density_vector_measure from "leanprover-community/mathlib"@"d1bd9c5df2867c1cb463bc6364446d57bdd9f7f1" noncomputable section open scoped Classical MeasureTheory NNReal ENNReal variable {α β : Type*} {m : MeasurableSpace α} namespace MeasureTheory open TopologicalSpace variable {μ ν : Measure α} variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] def Measure.withDensityᵥ {m : MeasurableSpace α} (μ : Measure α) (f : α → E) : VectorMeasure α E := if hf : Integrable f μ then { measureOf' := fun s => if MeasurableSet s then ∫ x in s, f x ∂μ else 0 empty' := by simp not_measurable' := fun s hs => if_neg hs m_iUnion' := fun s hs₁ hs₂ => by dsimp only convert hasSum_integral_iUnion hs₁ hs₂ hf.integrableOn with n · rw [if_pos (hs₁ n)] · rw [if_pos (MeasurableSet.iUnion hs₁)] } else 0 #align measure_theory.measure.with_densityᵥ MeasureTheory.Measure.withDensityᵥ open Measure variable {f g : α → E}
Mathlib/MeasureTheory/Measure/WithDensityVectorMeasure.lean
59
60
theorem withDensityᵥ_apply (hf : Integrable f μ) {s : Set α} (hs : MeasurableSet s) : μ.withDensityᵥ f s = ∫ x in s, f x ∂μ := by
rw [withDensityᵥ, dif_pos hf]; exact dif_pos hs
0.875
import Mathlib.Geometry.Manifold.ContMDiff.Defs open Set Filter Function open scoped Topology Manifold variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] -- declare a smooth manifold `M` over the pair `(E, H)`. {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [SmoothManifoldWithCorners I M] -- declare a smooth manifold `M'` over the pair `(E', H')`. {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] [SmoothManifoldWithCorners I' M'] -- declare a manifold `M''` over the pair `(E'', H'')`. {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] {I'' : ModelWithCorners 𝕜 E'' H''} {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] -- declare functions, sets, points and smoothness indices {e : PartialHomeomorph M H} {e' : PartialHomeomorph M' H'} {f f₁ : M → M'} {s s₁ t : Set M} {x : M} {m n : ℕ∞} variable {I I'} section id variable {c : M'} theorem contMDiff_const : ContMDiff I I' n fun _ : M => c := by intro x refine ⟨continuousWithinAt_const, ?_⟩ simp only [ContDiffWithinAtProp, (· ∘ ·)] exact contDiffWithinAt_const #align cont_mdiff_const contMDiff_const @[to_additive]
Mathlib/Geometry/Manifold/ContMDiff/Basic.lean
252
253
theorem contMDiff_one [One M'] : ContMDiff I I' n (1 : M → M') := by
simp only [Pi.one_def, contMDiff_const]
0.875
import Mathlib.Data.ENNReal.Real import Mathlib.Order.Interval.Finset.Nat import Mathlib.Topology.UniformSpace.Pi import Mathlib.Topology.UniformSpace.UniformConvergence import Mathlib.Topology.UniformSpace.UniformEmbedding #align_import topology.metric_space.emetric_space from "leanprover-community/mathlib"@"c8f305514e0d47dfaa710f5a52f0d21b588e6328" open Set Filter Classical open scoped Uniformity Topology Filter NNReal ENNReal Pointwise universe u v w variable {α : Type u} {β : Type v} {X : Type*} theorem uniformity_dist_of_mem_uniformity [LinearOrder β] {U : Filter (α × α)} (z : β) (D : α → α → β) (H : ∀ s, s ∈ U ↔ ∃ ε > z, ∀ {a b : α}, D a b < ε → (a, b) ∈ s) : U = ⨅ ε > z, 𝓟 { p : α × α | D p.1 p.2 < ε } := HasBasis.eq_biInf ⟨fun s => by simp only [H, subset_def, Prod.forall, mem_setOf]⟩ #align uniformity_dist_of_mem_uniformity uniformity_dist_of_mem_uniformity @[ext] class EDist (α : Type*) where edist : α → α → ℝ≥0∞ #align has_edist EDist export EDist (edist) def uniformSpaceOfEDist (edist : α → α → ℝ≥0∞) (edist_self : ∀ x : α, edist x x = 0) (edist_comm : ∀ x y : α, edist x y = edist y x) (edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z) : UniformSpace α := .ofFun edist edist_self edist_comm edist_triangle fun ε ε0 => ⟨ε / 2, ENNReal.half_pos ε0.ne', fun _ h₁ _ h₂ => (ENNReal.add_lt_add h₁ h₂).trans_eq (ENNReal.add_halves _)⟩ #align uniform_space_of_edist uniformSpaceOfEDist -- the uniform structure is embedded in the emetric space structure -- to avoid instance diamond issues. See Note [forgetful inheritance]. class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where edist_self : ∀ x : α, edist x x = 0 edist_comm : ∀ x y : α, edist x y = edist y x edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl #align pseudo_emetric_space PseudoEMetricSpace attribute [instance] PseudoEMetricSpace.toUniformSpace @[ext] protected theorem PseudoEMetricSpace.ext {α : Type*} {m m' : PseudoEMetricSpace α} (h : m.toEDist = m'.toEDist) : m = m' := by cases' m with ed _ _ _ U hU cases' m' with ed' _ _ _ U' hU' congr 1 exact UniformSpace.ext (((show ed = ed' from h) ▸ hU).trans hU'.symm) variable [PseudoEMetricSpace α] export PseudoEMetricSpace (edist_self edist_comm edist_triangle) attribute [simp] edist_self
Mathlib/Topology/EMetricSpace/Basic.lean
110
111
theorem edist_triangle_left (x y z : α) : edist x y ≤ edist z x + edist z y := by
rw [edist_comm z]; apply edist_triangle
0.875
import Mathlib.Algebra.BigOperators.Ring import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Fintype.Fin import Mathlib.GroupTheory.GroupAction.Pi import Mathlib.Logic.Equiv.Fin #align_import algebra.big_operators.fin from "leanprover-community/mathlib"@"cc5dd6244981976cc9da7afc4eee5682b037a013" open Finset variable {α : Type*} {β : Type*} namespace Fin @[to_additive] theorem prod_ofFn [CommMonoid β] {n : ℕ} (f : Fin n → β) : (List.ofFn f).prod = ∏ i, f i := by simp [prod_eq_multiset_prod] #align fin.prod_of_fn Fin.prod_ofFn #align fin.sum_of_fn Fin.sum_ofFn @[to_additive] theorem prod_univ_def [CommMonoid β] {n : ℕ} (f : Fin n → β) : ∏ i, f i = ((List.finRange n).map f).prod := by rw [← List.ofFn_eq_map, prod_ofFn] #align fin.prod_univ_def Fin.prod_univ_def #align fin.sum_univ_def Fin.sum_univ_def @[to_additive "A sum of a function `f : Fin 0 → β` is `0` because `Fin 0` is empty"] theorem prod_univ_zero [CommMonoid β] (f : Fin 0 → β) : ∏ i, f i = 1 := rfl #align fin.prod_univ_zero Fin.prod_univ_zero #align fin.sum_univ_zero Fin.sum_univ_zero @[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of `f x`, for some `x : Fin (n + 1)` plus the remaining product"] theorem prod_univ_succAbove [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) (x : Fin (n + 1)) : ∏ i, f i = f x * ∏ i : Fin n, f (x.succAbove i) := by rw [univ_succAbove, prod_cons, Finset.prod_map _ x.succAboveEmb] rfl #align fin.prod_univ_succ_above Fin.prod_univ_succAbove #align fin.sum_univ_succ_above Fin.sum_univ_succAbove @[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of `f 0` plus the remaining product"] theorem prod_univ_succ [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) : ∏ i, f i = f 0 * ∏ i : Fin n, f i.succ := prod_univ_succAbove f 0 #align fin.prod_univ_succ Fin.prod_univ_succ #align fin.sum_univ_succ Fin.sum_univ_succ @[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of `f (Fin.last n)` plus the remaining sum"] theorem prod_univ_castSucc [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) : ∏ i, f i = (∏ i : Fin n, f (Fin.castSucc i)) * f (last n) := by simpa [mul_comm] using prod_univ_succAbove f (last n) #align fin.prod_univ_cast_succ Fin.prod_univ_castSucc #align fin.sum_univ_cast_succ Fin.sum_univ_castSucc @[to_additive (attr := simp)] theorem prod_univ_get [CommMonoid α] (l : List α) : ∏ i, l.get i = l.prod := by simp [Finset.prod_eq_multiset_prod] @[to_additive (attr := simp)] theorem prod_univ_get' [CommMonoid β] (l : List α) (f : α → β) : ∏ i, f (l.get i) = (l.map f).prod := by simp [Finset.prod_eq_multiset_prod] @[to_additive] theorem prod_cons [CommMonoid β] {n : ℕ} (x : β) (f : Fin n → β) : (∏ i : Fin n.succ, (cons x f : Fin n.succ → β) i) = x * ∏ i : Fin n, f i := by simp_rw [prod_univ_succ, cons_zero, cons_succ] #align fin.prod_cons Fin.prod_cons #align fin.sum_cons Fin.sum_cons @[to_additive sum_univ_one] theorem prod_univ_one [CommMonoid β] (f : Fin 1 → β) : ∏ i, f i = f 0 := by simp #align fin.prod_univ_one Fin.prod_univ_one #align fin.sum_univ_one Fin.sum_univ_one @[to_additive (attr := simp)]
Mathlib/Algebra/BigOperators/Fin.lean
118
119
theorem prod_univ_two [CommMonoid β] (f : Fin 2 → β) : ∏ i, f i = f 0 * f 1 := by
simp [prod_univ_succ]
0.875
import Mathlib.Data.Fintype.Basic import Mathlib.GroupTheory.Perm.Sign import Mathlib.Logic.Equiv.Defs #align_import logic.equiv.fintype from "leanprover-community/mathlib"@"9407b03373c8cd201df99d6bc5514fc2db44054f" section Fintype variable {α β : Type*} [Fintype α] [DecidableEq β] (e : Equiv.Perm α) (f : α ↪ β) def Function.Embedding.toEquivRange : α ≃ Set.range f := ⟨fun a => ⟨f a, Set.mem_range_self a⟩, f.invOfMemRange, fun _ => by simp, fun _ => by simp⟩ #align function.embedding.to_equiv_range Function.Embedding.toEquivRange @[simp] theorem Function.Embedding.toEquivRange_apply (a : α) : f.toEquivRange a = ⟨f a, Set.mem_range_self a⟩ := rfl #align function.embedding.to_equiv_range_apply Function.Embedding.toEquivRange_apply @[simp] theorem Function.Embedding.toEquivRange_symm_apply_self (a : α) : f.toEquivRange.symm ⟨f a, Set.mem_range_self a⟩ = a := by simp [Equiv.symm_apply_eq] #align function.embedding.to_equiv_range_symm_apply_self Function.Embedding.toEquivRange_symm_apply_self
Mathlib/Logic/Equiv/Fintype.lean
54
57
theorem Function.Embedding.toEquivRange_eq_ofInjective : f.toEquivRange = Equiv.ofInjective f f.injective := by
ext simp
0.875
import Mathlib.Algebra.Group.Commute.Basic import Mathlib.Data.Fintype.Card import Mathlib.GroupTheory.Perm.Basic #align_import group_theory.perm.support from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" open Equiv Finset namespace Equiv.Perm variable {α : Type*} section support variable [DecidableEq α] [Fintype α] {f g : Perm α} def support (f : Perm α) : Finset α := univ.filter fun x => f x ≠ x #align equiv.perm.support Equiv.Perm.support @[simp] theorem mem_support {x : α} : x ∈ f.support ↔ f x ≠ x := by rw [support, mem_filter, and_iff_right (mem_univ x)] #align equiv.perm.mem_support Equiv.Perm.mem_support theorem not_mem_support {x : α} : x ∉ f.support ↔ f x = x := by simp #align equiv.perm.not_mem_support Equiv.Perm.not_mem_support theorem coe_support_eq_set_support (f : Perm α) : (f.support : Set α) = { x | f x ≠ x } := by ext simp #align equiv.perm.coe_support_eq_set_support Equiv.Perm.coe_support_eq_set_support @[simp] theorem support_eq_empty_iff {σ : Perm α} : σ.support = ∅ ↔ σ = 1 := by simp_rw [Finset.ext_iff, mem_support, Finset.not_mem_empty, iff_false_iff, not_not, Equiv.Perm.ext_iff, one_apply] #align equiv.perm.support_eq_empty_iff Equiv.Perm.support_eq_empty_iff @[simp] theorem support_one : (1 : Perm α).support = ∅ := by rw [support_eq_empty_iff] #align equiv.perm.support_one Equiv.Perm.support_one @[simp] theorem support_refl : support (Equiv.refl α) = ∅ := support_one #align equiv.perm.support_refl Equiv.Perm.support_refl
Mathlib/GroupTheory/Perm/Support.lean
324
329
theorem support_congr (h : f.support ⊆ g.support) (h' : ∀ x ∈ g.support, f x = g x) : f = g := by
ext x by_cases hx : x ∈ g.support · exact h' x hx · rw [not_mem_support.mp hx, ← not_mem_support] exact fun H => hx (h H)
0.875