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.LinearIndependent #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe w w' u u' v v' variable {R : Type u} {R' : Type u'} {M M₁ : Type v} {M' : Type v'} open Cardinal Submodule Function Set section Module section variable [Semiring R] [AddCommMonoid M] [Module R M] variable (R M) protected irreducible_def Module.rank : Cardinal := ⨆ ΞΉ : { s : Set M // LinearIndependent R ((↑) : s β†’ M) }, (#ΞΉ.1) #align module.rank Module.rank theorem rank_le_card : Module.rank R M ≀ #M := (Module.rank_def _ _).trans_le (ciSup_le' fun _ ↦ mk_set_le _) lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((↑) : s β†’ M)} := βŸ¨βŸ¨βˆ…, linearIndependent_empty _ _⟩⟩ end variable [Ring R] [Ring R'] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] [Module R' M'] [Module R' M₁] namespace LinearIndependent variable [Nontrivial R]
Mathlib/LinearAlgebra/Dimension/Basic.lean
79
84
theorem cardinal_lift_le_rank {ΞΉ : Type w} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : Cardinal.lift.{v} #ΞΉ ≀ Cardinal.lift.{w} (Module.rank R M) := by
rw [Module.rank] refine le_trans ?_ (lift_le.mpr <| le_ciSup (bddAbove_range.{v, v} _) ⟨_, hv.coe_range⟩) exact lift_mk_le'.mpr ⟨(Equiv.ofInjective _ hv.injective).toEmbedding⟩
0.09375
import Mathlib.Analysis.NormedSpace.PiLp import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped NNReal Matrix namespace Matrix variable {R l m n Ξ± Ξ² : Type*} [Fintype l] [Fintype m] [Fintype n] section LinfLinf protected def normedAddCommGroup [NormedAddCommGroup Ξ±] : NormedAddCommGroup (Matrix m n Ξ±) := Pi.normedAddCommGroup #align matrix.normed_add_comm_group Matrix.normedAddCommGroup section LinftyOp @[local instance] protected def linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup Ξ±] : SeminormedAddCommGroup (Matrix m n Ξ±) := (by infer_instance : SeminormedAddCommGroup (m β†’ PiLp 1 fun j : n => Ξ±)) #align matrix.linfty_op_seminormed_add_comm_group Matrix.linftyOpSeminormedAddCommGroup @[local instance] protected def linftyOpNormedAddCommGroup [NormedAddCommGroup Ξ±] : NormedAddCommGroup (Matrix m n Ξ±) := (by infer_instance : NormedAddCommGroup (m β†’ PiLp 1 fun j : n => Ξ±)) #align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup @[local instance] protected theorem linftyOpBoundedSMul [SeminormedRing R] [SeminormedAddCommGroup Ξ±] [Module R Ξ±] [BoundedSMul R Ξ±] : BoundedSMul R (Matrix m n Ξ±) := (by infer_instance : BoundedSMul R (m β†’ PiLp 1 fun j : n => Ξ±)) @[local instance] protected def linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup Ξ±] [NormedSpace R Ξ±] : NormedSpace R (Matrix m n Ξ±) := (by infer_instance : NormedSpace R (m β†’ PiLp 1 fun j : n => Ξ±)) #align matrix.linfty_op_normed_space Matrix.linftyOpNormedSpace section SeminormedAddCommGroup variable [SeminormedAddCommGroup Ξ±]
Mathlib/Analysis/Matrix.lean
273
277
theorem linfty_opNorm_def (A : Matrix m n Ξ±) : β€–Aβ€– = ((Finset.univ : Finset m).sup fun i : m => βˆ‘ j : n, β€–A i jβ€–β‚Š : ℝβ‰₯0) := by
-- Porting note: added change β€–fun i => (WithLp.equiv 1 _).symm (A i)β€– = _ simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
0.09375
import Mathlib.LinearAlgebra.Matrix.Reindex import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.basis from "leanprover-community/mathlib"@"6c263e4bfc2e6714de30f22178b4d0ca4d149a76" noncomputable section open LinearMap Matrix Set Submodule open Matrix section BasisToMatrix variable {ΞΉ ΞΉ' ΞΊ ΞΊ' : Type*} variable {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] variable {Rβ‚‚ Mβ‚‚ : Type*} [CommRing Rβ‚‚] [AddCommGroup Mβ‚‚] [Module Rβ‚‚ Mβ‚‚] open Function Matrix def Basis.toMatrix (e : Basis ΞΉ R M) (v : ΞΉ' β†’ M) : Matrix ΞΉ ΞΉ' R := fun i j => e.repr (v j) i #align basis.to_matrix Basis.toMatrix variable (e : Basis ΞΉ R M) (v : ΞΉ' β†’ M) (i : ΞΉ) (j : ΞΉ') namespace Basis theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i := rfl #align basis.to_matrix_apply Basis.toMatrix_apply theorem toMatrix_transpose_apply : (e.toMatrix v)α΅€ j = e.repr (v j) := funext fun _ => rfl #align basis.to_matrix_transpose_apply Basis.toMatrix_transpose_apply theorem toMatrix_eq_toMatrix_constr [Fintype ΞΉ] [DecidableEq ΞΉ] (v : ΞΉ β†’ M) : e.toMatrix v = LinearMap.toMatrix e e (e.constr β„• v) := by ext rw [Basis.toMatrix_apply, LinearMap.toMatrix_apply, Basis.constr_basis] #align basis.to_matrix_eq_to_matrix_constr Basis.toMatrix_eq_toMatrix_constr -- TODO (maybe) Adjust the definition of `Basis.toMatrix` to eliminate the transpose. theorem coePiBasisFun.toMatrix_eq_transpose [Finite ΞΉ] : ((Pi.basisFun R ΞΉ).toMatrix : Matrix ΞΉ ΞΉ R β†’ Matrix ΞΉ ΞΉ R) = Matrix.transpose := by ext M i j rfl #align basis.coe_pi_basis_fun.to_matrix_eq_transpose Basis.coePiBasisFun.toMatrix_eq_transpose @[simp] theorem toMatrix_self [DecidableEq ΞΉ] : e.toMatrix e = 1 := by unfold Basis.toMatrix ext i j simp [Basis.equivFun, Matrix.one_apply, Finsupp.single_apply, eq_comm] #align basis.to_matrix_self Basis.toMatrix_self
Mathlib/LinearAlgebra/Matrix/Basis.lean
86
92
theorem toMatrix_update [DecidableEq ΞΉ'] (x : M) : e.toMatrix (Function.update v j x) = Matrix.updateColumn (e.toMatrix v) j (e.repr x) := by
ext i' k rw [Basis.toMatrix, Matrix.updateColumn_apply, e.toMatrix_apply] split_ifs with h Β· rw [h, update_same j x v] Β· rw [update_noteq h]
0.09375
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 theorem Function.Embedding.toEquivRange_eq_ofInjective : f.toEquivRange = Equiv.ofInjective f f.injective := by ext simp #align function.embedding.to_equiv_range_eq_of_injective Function.Embedding.toEquivRange_eq_ofInjective def Equiv.Perm.viaFintypeEmbedding : Equiv.Perm Ξ² := e.extendDomain f.toEquivRange #align equiv.perm.via_fintype_embedding Equiv.Perm.viaFintypeEmbedding @[simp]
Mathlib/Logic/Equiv/Fintype.lean
72
75
theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : Ξ±) : e.viaFintypeEmbedding f (f a) = f (e a) := by
rw [Equiv.Perm.viaFintypeEmbedding] convert Equiv.Perm.extendDomain_apply_image e (Function.Embedding.toEquivRange f) a
0.09375
import Mathlib.Computability.Halting import Mathlib.Computability.TuringMachine import Mathlib.Data.Num.Lemmas import Mathlib.Tactic.DeriveFintype #align_import computability.tm_to_partrec from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8" open Function (update) open Relation namespace Turing namespace ToPartrec inductive Code | zero' | succ | tail | cons : Code β†’ Code β†’ Code | comp : Code β†’ Code β†’ Code | case : Code β†’ Code β†’ Code | fix : Code β†’ Code deriving DecidableEq, Inhabited #align turing.to_partrec.code Turing.ToPartrec.Code #align turing.to_partrec.code.zero' Turing.ToPartrec.Code.zero' #align turing.to_partrec.code.succ Turing.ToPartrec.Code.succ #align turing.to_partrec.code.tail Turing.ToPartrec.Code.tail #align turing.to_partrec.code.cons Turing.ToPartrec.Code.cons #align turing.to_partrec.code.comp Turing.ToPartrec.Code.comp #align turing.to_partrec.code.case Turing.ToPartrec.Code.case #align turing.to_partrec.code.fix Turing.ToPartrec.Code.fix def Code.eval : Code β†’ List β„• β†’. List β„• | Code.zero' => fun v => pure (0 :: v) | Code.succ => fun v => pure [v.headI.succ] | Code.tail => fun v => pure v.tail | Code.cons f fs => fun v => do let n ← Code.eval f v let ns ← Code.eval fs v pure (n.headI :: ns) | Code.comp f g => fun v => g.eval v >>= f.eval | Code.case f g => fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) | Code.fix f => PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail #align turing.to_partrec.code.eval Turing.ToPartrec.Code.eval namespace Code @[simp] theorem zero'_eval : zero'.eval = fun v => pure (0 :: v) := by simp [eval] @[simp] theorem succ_eval : succ.eval = fun v => pure [v.headI.succ] := by simp [eval] @[simp] theorem tail_eval : tail.eval = fun v => pure v.tail := by simp [eval] @[simp] theorem cons_eval (f fs) : (cons f fs).eval = fun v => do { let n ← Code.eval f v let ns ← Code.eval fs v pure (n.headI :: ns) } := by simp [eval] @[simp] theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval := by simp [eval] @[simp] theorem case_eval (f g) : (case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) := by simp [eval] @[simp] theorem fix_eval (f) : (fix f).eval = PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail := by simp [eval] def nil : Code := tail.comp succ #align turing.to_partrec.code.nil Turing.ToPartrec.Code.nil @[simp] theorem nil_eval (v) : nil.eval v = pure [] := by simp [nil] #align turing.to_partrec.code.nil_eval Turing.ToPartrec.Code.nil_eval def id : Code := tail.comp zero' #align turing.to_partrec.code.id Turing.ToPartrec.Code.id @[simp]
Mathlib/Computability/TMToPartrec.lean
183
183
theorem id_eval (v) : id.eval v = pure v := by
simp [id]
0.09375
import Batteries.Data.Sum.Basic import Batteries.Logic open Function namespace Sum @[simp] protected theorem Β«forallΒ» {p : Ξ± βŠ• Ξ² β†’ Prop} : (βˆ€ x, p x) ↔ (βˆ€ a, p (inl a)) ∧ βˆ€ b, p (inr b) := ⟨fun h => ⟨fun _ => h _, fun _ => h _⟩, fun ⟨h₁, hβ‚‚βŸ© => Sum.rec h₁ hβ‚‚βŸ© @[simp] protected theorem Β«existsΒ» {p : Ξ± βŠ• Ξ² β†’ Prop} : (βˆƒ x, p x) ↔ (βˆƒ a, p (inl a)) ∨ βˆƒ b, p (inr b) := ⟨ fun | ⟨inl a, h⟩ => Or.inl ⟨a, h⟩ | ⟨inr b, h⟩ => Or.inr ⟨b, h⟩, fun | Or.inl ⟨a, h⟩ => ⟨inl a, h⟩ | Or.inr ⟨b, h⟩ => ⟨inr b, h⟩⟩ theorem forall_sum {Ξ³ : Ξ± βŠ• Ξ² β†’ Sort _} (p : (βˆ€ ab, Ξ³ ab) β†’ Prop) : (βˆ€ fab, p fab) ↔ (βˆ€ fa fb, p (Sum.rec fa fb)) := by refine ⟨fun h fa fb => h _, fun h fab => ?_⟩ have h1 : fab = Sum.rec (fun a => fab (Sum.inl a)) (fun b => fab (Sum.inr b)) := by ext ab; cases ab <;> rfl rw [h1]; exact h _ _ theorem inl.inj_iff : (inl a : Ξ± βŠ• Ξ²) = inl b ↔ a = b := ⟨inl.inj, congrArg _⟩ theorem inr.inj_iff : (inr a : Ξ± βŠ• Ξ²) = inr b ↔ a = b := ⟨inr.inj, congrArg _⟩ theorem inl_ne_inr : inl a β‰  inr b := nofun theorem inr_ne_inl : inr b β‰  inl a := nofun @[simp] theorem elim_comp_inl (f : Ξ± β†’ Ξ³) (g : Ξ² β†’ Ξ³) : Sum.elim f g ∘ inl = f := rfl @[simp] theorem elim_comp_inr (f : Ξ± β†’ Ξ³) (g : Ξ² β†’ Ξ³) : Sum.elim f g ∘ inr = g := rfl @[simp] theorem elim_inl_inr : @Sum.elim Ξ± Ξ² _ inl inr = id := funext fun x => Sum.casesOn x (fun _ => rfl) fun _ => rfl theorem comp_elim (f : Ξ³ β†’ Ξ΄) (g : Ξ± β†’ Ξ³) (h : Ξ² β†’ Ξ³) : f ∘ Sum.elim g h = Sum.elim (f ∘ g) (f ∘ h) := funext fun x => Sum.casesOn x (fun _ => rfl) fun _ => rfl @[simp] theorem elim_comp_inl_inr (f : Ξ± βŠ• Ξ² β†’ Ξ³) : Sum.elim (f ∘ inl) (f ∘ inr) = f := funext fun x => Sum.casesOn x (fun _ => rfl) fun _ => rfl
.lake/packages/batteries/Batteries/Data/Sum/Lemmas.lean
116
118
theorem elim_eq_iff {u u' : Ξ± β†’ Ξ³} {v v' : Ξ² β†’ Ξ³} : Sum.elim u v = Sum.elim u' v' ↔ u = u' ∧ v = v' := by
simp [funext_iff]
0.09375
import Mathlib.Data.Int.Bitwise import Mathlib.Data.Int.Order.Lemmas import Mathlib.Data.Set.Function import Mathlib.Order.Interval.Set.Basic #align_import data.int.lemmas from "leanprover-community/mathlib"@"09597669f02422ed388036273d8848119699c22f" open Nat namespace Int theorem le_natCast_sub (m n : β„•) : (m - n : β„€) ≀ ↑(m - n : β„•) := by by_cases h : m β‰₯ n Β· exact le_of_eq (Int.ofNat_sub h).symm Β· simp [le_of_not_ge h, ofNat_le] #align int.le_coe_nat_sub Int.le_natCast_sub -- Porting note (#10618): simp can prove this @[simp] theorem succ_natCast_pos (n : β„•) : 0 < (n : β„€) + 1 := lt_add_one_iff.mpr (by simp) #align int.succ_coe_nat_pos Int.succ_natCast_pos variable {a b : β„€} {n : β„•} theorem natAbs_eq_iff_sq_eq {a b : β„€} : a.natAbs = b.natAbs ↔ a ^ 2 = b ^ 2 := by rw [sq, sq] exact natAbs_eq_iff_mul_self_eq #align int.nat_abs_eq_iff_sq_eq Int.natAbs_eq_iff_sq_eq theorem natAbs_lt_iff_sq_lt {a b : β„€} : a.natAbs < b.natAbs ↔ a ^ 2 < b ^ 2 := by rw [sq, sq] exact natAbs_lt_iff_mul_self_lt #align int.nat_abs_lt_iff_sq_lt Int.natAbs_lt_iff_sq_lt theorem natAbs_le_iff_sq_le {a b : β„€} : a.natAbs ≀ b.natAbs ↔ a ^ 2 ≀ b ^ 2 := by rw [sq, sq] exact natAbs_le_iff_mul_self_le #align int.nat_abs_le_iff_sq_le Int.natAbs_le_iff_sq_le
Mathlib/Data/Int/Lemmas.lean
60
61
theorem natAbs_inj_of_nonneg_of_nonneg {a b : β„€} (ha : 0 ≀ a) (hb : 0 ≀ b) : natAbs a = natAbs b ↔ a = b := by
rw [← sq_eq_sq ha hb, ← natAbs_eq_iff_sq_eq]
0.09375
import Mathlib.LinearAlgebra.Basis import Mathlib.LinearAlgebra.BilinearMap #align_import linear_algebra.basis.bilinear from "leanprover-community/mathlib"@"87c54600fe3cdc7d32ff5b50873ac724d86aef8d" namespace LinearMap variable {ι₁ ΞΉβ‚‚ : Type*} variable {R Rβ‚‚ S Sβ‚‚ M N P Rβ‚— : Type*} variable {Mβ‚— Nβ‚— Pβ‚— : Type*} -- Could weaken [CommSemiring Rβ‚—] to [SMulCommClass Rβ‚— Rβ‚— Pβ‚—], but might impact performance variable [Semiring R] [Semiring S] [Semiring Rβ‚‚] [Semiring Sβ‚‚] [CommSemiring Rβ‚—] section AddCommMonoid variable [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid P] variable [AddCommMonoid Mβ‚—] [AddCommMonoid Nβ‚—] [AddCommMonoid Pβ‚—] variable [Module R M] [Module S N] [Module Rβ‚‚ P] [Module Sβ‚‚ P] variable [Module Rβ‚— Mβ‚—] [Module Rβ‚— Nβ‚—] [Module Rβ‚— Pβ‚—] variable [SMulCommClass Sβ‚‚ Rβ‚‚ P] variable {ρ₁₂ : R β†’+* Rβ‚‚} {σ₁₂ : S β†’+* Sβ‚‚} variable (b₁ : Basis ι₁ R M) (bβ‚‚ : Basis ΞΉβ‚‚ S N) (b₁' : Basis ι₁ Rβ‚— Mβ‚—) (bβ‚‚' : Basis ΞΉβ‚‚ Rβ‚— Nβ‚—) theorem ext_basis {B B' : M β†’β‚›β‚—[ρ₁₂] N β†’β‚›β‚—[σ₁₂] P} (h : βˆ€ i j, B (b₁ i) (bβ‚‚ j) = B' (b₁ i) (bβ‚‚ j)) : B = B' := b₁.ext fun i => bβ‚‚.ext fun j => h i j #align linear_map.ext_basis LinearMap.ext_basis theorem sum_repr_mul_repr_mulβ‚›β‚— {B : M β†’β‚›β‚—[ρ₁₂] N β†’β‚›β‚—[σ₁₂] P} (x y) : ((b₁.repr x).sum fun i xi => (bβ‚‚.repr y).sum fun j yj => ρ₁₂ xi β€’ σ₁₂ yj β€’ B (b₁ i) (bβ‚‚ j)) = B x y := by conv_rhs => rw [← b₁.total_repr x, ← bβ‚‚.total_repr y] simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ‚‚, map_sum, LinearMap.map_smulβ‚›β‚—β‚‚, LinearMap.map_smulβ‚›β‚—] #align linear_map.sum_repr_mul_repr_mulβ‚›β‚— LinearMap.sum_repr_mul_repr_mulβ‚›β‚—
Mathlib/LinearAlgebra/Basis/Bilinear.lean
55
60
theorem sum_repr_mul_repr_mul {B : Mβ‚— β†’β‚—[Rβ‚—] Nβ‚— β†’β‚—[Rβ‚—] Pβ‚—} (x y) : ((b₁'.repr x).sum fun i xi => (bβ‚‚'.repr y).sum fun j yj => xi β€’ yj β€’ B (b₁' i) (bβ‚‚' j)) = B x y := by
conv_rhs => rw [← b₁'.total_repr x, ← bβ‚‚'.total_repr y] simp_rw [Finsupp.total_apply, Finsupp.sum, map_sumβ‚‚, map_sum, LinearMap.map_smulβ‚‚, LinearMap.map_smul]
0.09375
import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FreeModule.StrongRankCondition #align_import linear_algebra.free_module.finite.matrix from "leanprover-community/mathlib"@"b1c23399f01266afe392a0d8f71f599a0dad4f7b" universe u u' v w variable (R : Type u) (S : Type u') (M : Type v) (N : Type w) open Module.Free (chooseBasis ChooseBasisIndex) open FiniteDimensional (finrank) section Ring variable [Ring R] [Ring S] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] variable [AddCommGroup N] [Module R N] [Module S N] [SMulCommClass R S N] private noncomputable def linearMapEquivFun : (M β†’β‚—[R] N) ≃ₗ[S] ChooseBasisIndex R M β†’ N := (chooseBasis R M).repr.congrLeft N S β‰ͺ≫ₗ (Finsupp.lsum S).symm β‰ͺ≫ₗ LinearEquiv.piCongrRight fun _ ↦ LinearMap.ringLmapEquivSelf R S N instance Module.Free.linearMap [Module.Free S N] : Module.Free S (M β†’β‚—[R] N) := Module.Free.of_equiv (linearMapEquivFun R S M N).symm #align module.free.linear_map Module.Free.linearMap instance Module.Finite.linearMap [Module.Finite S N] : Module.Finite S (M β†’β‚—[R] N) := Module.Finite.equiv (linearMapEquivFun R S M N).symm #align module.finite.linear_map Module.Finite.linearMap variable [StrongRankCondition R] [StrongRankCondition S] [Module.Free S N] open Cardinal theorem FiniteDimensional.rank_linearMap : Module.rank S (M β†’β‚—[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N) := by rw [(linearMapEquivFun R S M N).rank_eq, rank_fun_eq_lift_mul, ← finrank_eq_card_chooseBasisIndex, ← finrank_eq_rank R, lift_natCast]
Mathlib/LinearAlgebra/FreeModule/Finite/Matrix.lean
59
61
theorem FiniteDimensional.finrank_linearMap : finrank S (M β†’β‚—[R] N) = finrank R M * finrank S N := by
simp_rw [finrank, rank_linearMap, toNat_mul, toNat_lift]
0.09375
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h
Mathlib/Data/List/Sym.lean
63
66
theorem right_mem_of_mk_mem_sym2 {xs : List α} {a b : α} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by
rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h
0.09375
import Mathlib.Analysis.Normed.Group.Hom import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.NormedSpace.LinearIsometry import Mathlib.Algebra.Star.SelfAdjoint import Mathlib.Algebra.Star.Subalgebra import Mathlib.Algebra.Star.Unitary import Mathlib.Topology.Algebra.Module.Star #align_import analysis.normed_space.star.basic from "leanprover-community/mathlib"@"aa6669832974f87406a3d9d70fc5707a60546207" open Topology local postfix:max "⋆" => star class NormedStarGroup (E : Type*) [SeminormedAddCommGroup E] [StarAddMonoid E] : Prop where norm_star : βˆ€ x : E, β€–x⋆‖ = β€–xβ€– #align normed_star_group NormedStarGroup export NormedStarGroup (norm_star) attribute [simp] norm_star variable {π•œ E Ξ± : Type*} instance RingHomIsometric.starRingEnd [NormedCommRing E] [StarRing E] [NormedStarGroup E] : RingHomIsometric (starRingEnd E) := ⟨@norm_star _ _ _ _⟩ #align ring_hom_isometric.star_ring_end RingHomIsometric.starRingEnd class CstarRing (E : Type*) [NonUnitalNormedRing E] [StarRing E] : Prop where norm_star_mul_self : βˆ€ {x : E}, β€–x⋆ * xβ€– = β€–xβ€– * β€–xβ€– #align cstar_ring CstarRing instance : CstarRing ℝ where norm_star_mul_self {x} := by simp only [star, id, norm_mul] namespace CstarRing section NonUnital variable [NonUnitalNormedRing E] [StarRing E] [CstarRing E] -- see Note [lower instance priority] instance (priority := 100) to_normedStarGroup : NormedStarGroup E := ⟨by intro x by_cases htriv : x = 0 Β· simp only [htriv, star_zero] Β· have hnt : 0 < β€–xβ€– := norm_pos_iff.mpr htriv have hnt_star : 0 < β€–x⋆‖ := norm_pos_iff.mpr ((AddEquiv.map_ne_zero_iff starAddEquiv (M := E)).mpr htriv) have h₁ := calc β€–xβ€– * β€–xβ€– = β€–x⋆ * xβ€– := norm_star_mul_self.symm _ ≀ β€–x⋆‖ * β€–xβ€– := norm_mul_le _ _ have hβ‚‚ := calc β€–x⋆‖ * β€–x⋆‖ = β€–x * x⋆‖ := by rw [← norm_star_mul_self, star_star] _ ≀ β€–xβ€– * β€–x⋆‖ := norm_mul_le _ _ exact le_antisymm (le_of_mul_le_mul_right hβ‚‚ hnt_star) (le_of_mul_le_mul_right h₁ hnt)⟩ #align cstar_ring.to_normed_star_group CstarRing.to_normedStarGroup theorem norm_self_mul_star {x : E} : β€–x * x⋆‖ = β€–xβ€– * β€–xβ€– := by nth_rw 1 [← star_star x] simp only [norm_star_mul_self, norm_star] #align cstar_ring.norm_self_mul_star CstarRing.norm_self_mul_star theorem norm_star_mul_self' {x : E} : β€–x⋆ * xβ€– = β€–x⋆‖ * β€–xβ€– := by rw [norm_star_mul_self, norm_star] #align cstar_ring.norm_star_mul_self' CstarRing.norm_star_mul_self' theorem nnnorm_self_mul_star {x : E} : β€–x * xβ‹†β€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_self_mul_star #align cstar_ring.nnnorm_self_mul_star CstarRing.nnnorm_self_mul_star theorem nnnorm_star_mul_self {x : E} : β€–x⋆ * xβ€–β‚Š = β€–xβ€–β‚Š * β€–xβ€–β‚Š := Subtype.ext norm_star_mul_self #align cstar_ring.nnnorm_star_mul_self CstarRing.nnnorm_star_mul_self @[simp]
Mathlib/Analysis/NormedSpace/Star/Basic.lean
135
137
theorem star_mul_self_eq_zero_iff (x : E) : x⋆ * x = 0 ↔ x = 0 := by
rw [← norm_eq_zero, norm_star_mul_self] exact mul_self_eq_zero.trans norm_eq_zero
0.09375
import Mathlib.Algebra.CharP.Pi import Mathlib.Algebra.CharP.Quotient import Mathlib.Algebra.CharP.Subring import Mathlib.Algebra.Ring.Pi import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.FieldTheory.Perfect import Mathlib.RingTheory.Localization.FractionRing import Mathlib.Algebra.Ring.Subring.Basic import Mathlib.RingTheory.Valuation.Integers #align_import ring_theory.perfection from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" universe u₁ uβ‚‚ u₃ uβ‚„ open scoped NNReal def Monoid.perfection (M : Type u₁) [CommMonoid M] (p : β„•) : Submonoid (β„• β†’ M) where carrier := { f | βˆ€ n, f (n + 1) ^ p = f n } one_mem' _ := one_pow _ mul_mem' hf hg n := (mul_pow _ _ _).trans <| congr_argβ‚‚ _ (hf n) (hg n) #align monoid.perfection Monoid.perfection def Ring.perfectionSubsemiring (R : Type u₁) [CommSemiring R] (p : β„•) [hp : Fact p.Prime] [CharP R p] : Subsemiring (β„• β†’ R) := { Monoid.perfection R p with zero_mem' := fun _ ↦ zero_pow hp.1.ne_zero add_mem' := fun hf hg n => (frobenius_add R p _ _).trans <| congr_argβ‚‚ _ (hf n) (hg n) } #align ring.perfection_subsemiring Ring.perfectionSubsemiring def Ring.perfectionSubring (R : Type u₁) [CommRing R] (p : β„•) [hp : Fact p.Prime] [CharP R p] : Subring (β„• β†’ R) := (Ring.perfectionSubsemiring R p).toSubring fun n => by simp_rw [← frobenius_def, Pi.neg_apply, Pi.one_apply, RingHom.map_neg, RingHom.map_one] #align ring.perfection_subring Ring.perfectionSubring def Ring.Perfection (R : Type u₁) [CommSemiring R] (p : β„•) : Type u₁ := { f // βˆ€ n : β„•, (f : β„• β†’ R) (n + 1) ^ p = f n } #align ring.perfection Ring.Perfection namespace Perfection variable (R : Type u₁) [CommSemiring R] (p : β„•) [hp : Fact p.Prime] [CharP R p] instance commSemiring : CommSemiring (Ring.Perfection R p) := (Ring.perfectionSubsemiring R p).toCommSemiring #align perfection.ring.perfection.comm_semiring Perfection.commSemiring instance charP : CharP (Ring.Perfection R p) p := CharP.subsemiring (β„• β†’ R) p (Ring.perfectionSubsemiring R p) #align perfection.char_p Perfection.charP instance ring (R : Type u₁) [CommRing R] [CharP R p] : Ring (Ring.Perfection R p) := (Ring.perfectionSubring R p).toRing #align perfection.ring Perfection.ring instance commRing (R : Type u₁) [CommRing R] [CharP R p] : CommRing (Ring.Perfection R p) := (Ring.perfectionSubring R p).toCommRing #align perfection.comm_ring Perfection.commRing instance : Inhabited (Ring.Perfection R p) := ⟨0⟩ def coeff (n : β„•) : Ring.Perfection R p β†’+* R where toFun f := f.1 n map_one' := rfl map_mul' _ _ := rfl map_zero' := rfl map_add' _ _ := rfl #align perfection.coeff Perfection.coeff variable {R p} @[ext] theorem ext {f g : Ring.Perfection R p} (h : βˆ€ n, coeff R p n f = coeff R p n g) : f = g := Subtype.eq <| funext h #align perfection.ext Perfection.ext variable (R p) def pthRoot : Ring.Perfection R p β†’+* Ring.Perfection R p where toFun f := ⟨fun n => coeff R p (n + 1) f, fun _ => f.2 _⟩ map_one' := rfl map_mul' _ _ := rfl map_zero' := rfl map_add' _ _ := rfl #align perfection.pth_root Perfection.pthRoot variable {R p} @[simp] theorem coeff_mk (f : β„• β†’ R) (hf) (n : β„•) : coeff R p n ⟨f, hf⟩ = f n := rfl #align perfection.coeff_mk Perfection.coeff_mk theorem coeff_pthRoot (f : Ring.Perfection R p) (n : β„•) : coeff R p n (pthRoot R p f) = coeff R p (n + 1) f := rfl #align perfection.coeff_pth_root Perfection.coeff_pthRoot theorem coeff_pow_p (f : Ring.Perfection R p) (n : β„•) : coeff R p (n + 1) (f ^ p) = coeff R p n f := by rw [RingHom.map_pow]; exact f.2 n #align perfection.coeff_pow_p Perfection.coeff_pow_p theorem coeff_pow_p' (f : Ring.Perfection R p) (n : β„•) : coeff R p (n + 1) f ^ p = coeff R p n f := f.2 n #align perfection.coeff_pow_p' Perfection.coeff_pow_p'
Mathlib/RingTheory/Perfection.lean
137
138
theorem coeff_frobenius (f : Ring.Perfection R p) (n : β„•) : coeff R p (n + 1) (frobenius _ p f) = coeff R p n f := by
apply coeff_pow_p f n
0.09375
import Mathlib.Algebra.Order.Field.Power import Mathlib.NumberTheory.Padics.PadicVal #align_import number_theory.padics.padic_norm from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" def padicNorm (p : β„•) (q : β„š) : β„š := if q = 0 then 0 else (p : β„š) ^ (-padicValRat p q) #align padic_norm padicNorm namespace padicNorm open padicValRat variable {p : β„•} @[simp] protected theorem eq_zpow_of_nonzero {q : β„š} (hq : q β‰  0) : padicNorm p q = (p : β„š) ^ (-padicValRat p q) := by simp [hq, padicNorm] #align padic_norm.eq_zpow_of_nonzero padicNorm.eq_zpow_of_nonzero protected theorem nonneg (q : β„š) : 0 ≀ padicNorm p q := if hq : q = 0 then by simp [hq, padicNorm] else by unfold padicNorm split_ifs apply zpow_nonneg exact mod_cast Nat.zero_le _ #align padic_norm.nonneg padicNorm.nonneg @[simp] protected theorem zero : padicNorm p 0 = 0 := by simp [padicNorm] #align padic_norm.zero padicNorm.zero -- @[simp] -- Porting note (#10618): simp can prove this protected theorem one : padicNorm p 1 = 1 := by simp [padicNorm] #align padic_norm.one padicNorm.one
Mathlib/NumberTheory/Padics/PadicNorm.lean
81
82
theorem padicNorm_p (hp : 1 < p) : padicNorm p p = (p : β„š)⁻¹ := by
simp [padicNorm, (pos_of_gt hp).ne', padicValNat.self hp]
0.09375
import Mathlib.Algebra.Group.Pi.Basic import Mathlib.Order.Interval.Set.Basic import Mathlib.Order.Interval.Set.UnorderedInterval import Mathlib.Data.Set.Lattice #align_import data.set.intervals.pi from "leanprover-community/mathlib"@"e4bc74cbaf429d706cb9140902f7ca6c431e75a4" -- Porting note: Added, since dot notation no longer works on `Function.update` open Function variable {ΞΉ : Type*} {Ξ± : ΞΉ β†’ Type*} namespace Set section PiPreorder variable [βˆ€ i, Preorder (Ξ± i)] (x y : βˆ€ i, Ξ± i) @[simp] theorem pi_univ_Ici : (pi univ fun i ↦ Ici (x i)) = Ici x := ext fun y ↦ by simp [Pi.le_def] #align set.pi_univ_Ici Set.pi_univ_Ici @[simp] theorem pi_univ_Iic : (pi univ fun i ↦ Iic (x i)) = Iic x := ext fun y ↦ by simp [Pi.le_def] #align set.pi_univ_Iic Set.pi_univ_Iic @[simp] theorem pi_univ_Icc : (pi univ fun i ↦ Icc (x i) (y i)) = Icc x y := ext fun y ↦ by simp [Pi.le_def, forall_and] #align set.pi_univ_Icc Set.pi_univ_Icc theorem piecewise_mem_Icc {s : Set ΞΉ} [βˆ€ j, Decidable (j ∈ s)] {f₁ fβ‚‚ g₁ gβ‚‚ : βˆ€ i, Ξ± i} (h₁ : βˆ€ i ∈ s, f₁ i ∈ Icc (g₁ i) (gβ‚‚ i)) (hβ‚‚ : βˆ€ i βˆ‰ s, fβ‚‚ i ∈ Icc (g₁ i) (gβ‚‚ i)) : s.piecewise f₁ fβ‚‚ ∈ Icc g₁ gβ‚‚ := ⟨le_piecewise (fun i hi ↦ (h₁ i hi).1) fun i hi ↦ (hβ‚‚ i hi).1, piecewise_le (fun i hi ↦ (h₁ i hi).2) fun i hi ↦ (hβ‚‚ i hi).2⟩ #align set.piecewise_mem_Icc Set.piecewise_mem_Icc theorem piecewise_mem_Icc' {s : Set ΞΉ} [βˆ€ j, Decidable (j ∈ s)] {f₁ fβ‚‚ g₁ gβ‚‚ : βˆ€ i, Ξ± i} (h₁ : f₁ ∈ Icc g₁ gβ‚‚) (hβ‚‚ : fβ‚‚ ∈ Icc g₁ gβ‚‚) : s.piecewise f₁ fβ‚‚ ∈ Icc g₁ gβ‚‚ := piecewise_mem_Icc (fun _ _ ↦ ⟨h₁.1 _, h₁.2 _⟩) fun _ _ ↦ ⟨hβ‚‚.1 _, hβ‚‚.2 _⟩ #align set.piecewise_mem_Icc' Set.piecewise_mem_Icc' variable [DecidableEq ΞΉ] open Function (update)
Mathlib/Order/Interval/Set/Pi.lean
90
98
theorem pi_univ_Ioc_update_left {x y : βˆ€ i, Ξ± i} {iβ‚€ : ΞΉ} {m : Ξ± iβ‚€} (hm : x iβ‚€ ≀ m) : (pi univ fun i ↦ Ioc (update x iβ‚€ m i) (y i)) = { z | m < z iβ‚€ } ∩ pi univ fun i ↦ Ioc (x i) (y i) := by
have : Ioc m (y iβ‚€) = Ioi m ∩ Ioc (x iβ‚€) (y iβ‚€) := by rw [← Ioi_inter_Iic, ← Ioi_inter_Iic, ← inter_assoc, inter_eq_self_of_subset_left (Ioi_subset_Ioi hm)] simp_rw [univ_pi_update iβ‚€ _ _ fun i z ↦ Ioc z (y i), ← pi_inter_compl ({iβ‚€} : Set ΞΉ), singleton_pi', ← inter_assoc, this] rfl
0.09375
import Mathlib.Algebra.MonoidAlgebra.Division import Mathlib.Algebra.MvPolynomial.Basic #align_import data.mv_polynomial.division from "leanprover-community/mathlib"@"72c366d0475675f1309d3027d3d7d47ee4423951" variable {Οƒ R : Type*} [CommSemiring R] namespace MvPolynomial theorem monomial_dvd_monomial {r s : R} {i j : Οƒ β†’β‚€ β„•} : monomial i r ∣ monomial j s ↔ (s = 0 ∨ i ≀ j) ∧ r ∣ s := by constructor Β· rintro ⟨x, hx⟩ rw [MvPolynomial.ext_iff] at hx have hj := hx j have hi := hx i classical simp_rw [coeff_monomial, if_pos] at hj hi simp_rw [coeff_monomial_mul'] at hi hj split_ifs at hi hj with hi hi Β· exact ⟨Or.inr hi, _, hj⟩ Β· exact ⟨Or.inl hj, hj.symm β–Έ dvd_zero _⟩ -- Porting note: two goals remain at this point in Lean 4 Β· simp_all only [or_true, dvd_mul_right, and_self] Β· simp_all only [ite_self, le_refl, ite_true, dvd_mul_right, or_false, and_self] Β· rintro ⟨h | hij, d, rfl⟩ Β· simp_rw [h, monomial_zero, dvd_zero] Β· refine ⟨monomial (j - i) d, ?_⟩ rw [monomial_mul, add_tsub_cancel_of_le hij] #align mv_polynomial.monomial_dvd_monomial MvPolynomial.monomial_dvd_monomial @[simp]
Mathlib/Algebra/MvPolynomial/Division.lean
244
247
theorem monomial_one_dvd_monomial_one [Nontrivial R] {i j : Οƒ β†’β‚€ β„•} : monomial i (1 : R) ∣ monomial j 1 ↔ i ≀ j := by
rw [monomial_dvd_monomial] simp_rw [one_ne_zero, false_or_iff, dvd_rfl, and_true_iff]
0.09375
import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.Algebra.Star.Unitary import Mathlib.Data.Nat.ModEq import Mathlib.NumberTheory.Zsqrtd.Basic import Mathlib.Tactic.Monotonicity #align_import number_theory.pell_matiyasevic from "leanprover-community/mathlib"@"795b501869b9fa7aa716d5fdadd00c03f983a605" namespace Pell open Nat section variable {d : β„€} def IsPell : β„€βˆšd β†’ Prop | ⟨x, y⟩ => x * x - d * y * y = 1 #align pell.is_pell Pell.IsPell theorem isPell_norm : βˆ€ {b : β„€βˆšd}, IsPell b ↔ b * star b = 1 | ⟨x, y⟩ => by simp [Zsqrtd.ext_iff, IsPell, mul_comm]; ring_nf #align pell.is_pell_norm Pell.isPell_norm theorem isPell_iff_mem_unitary : βˆ€ {b : β„€βˆšd}, IsPell b ↔ b ∈ unitary (β„€βˆšd) | ⟨x, y⟩ => by rw [unitary.mem_iff, isPell_norm, mul_comm (star _), and_self_iff] #align pell.is_pell_iff_mem_unitary Pell.isPell_iff_mem_unitary theorem isPell_mul {b c : β„€βˆšd} (hb : IsPell b) (hc : IsPell c) : IsPell (b * c) := isPell_norm.2 (by simp [mul_comm, mul_left_comm c, mul_assoc, star_mul, isPell_norm.1 hb, isPell_norm.1 hc]) #align pell.is_pell_mul Pell.isPell_mul theorem isPell_star : βˆ€ {b : β„€βˆšd}, IsPell b ↔ IsPell (star b) | ⟨x, y⟩ => by simp [IsPell, Zsqrtd.star_mk] #align pell.is_pell_star Pell.isPell_star end section -- Porting note: was parameter in Lean3 variable {a : β„•} (a1 : 1 < a) private def d (_a1 : 1 < a) := a * a - 1 @[simp] theorem d_pos : 0 < d a1 := tsub_pos_of_lt (mul_lt_mul a1 (le_of_lt a1) (by decide) (Nat.zero_le _) : 1 * 1 < a * a) #align pell.d_pos Pell.d_pos -- TODO(lint): Fix double namespace issue --@[nolint dup_namespace] def pell : β„• β†’ β„• Γ— β„• -- Porting note: used pattern matching because `Nat.recOn` is noncomputable | 0 => (1, 0) | n+1 => ((pell n).1 * a + d a1 * (pell n).2, (pell n).1 + (pell n).2 * a) #align pell.pell Pell.pell def xn (n : β„•) : β„• := (pell a1 n).1 #align pell.xn Pell.xn def yn (n : β„•) : β„• := (pell a1 n).2 #align pell.yn Pell.yn @[simp] theorem pell_val (n : β„•) : pell a1 n = (xn a1 n, yn a1 n) := show pell a1 n = ((pell a1 n).1, (pell a1 n).2) from match pell a1 n with | (_, _) => rfl #align pell.pell_val Pell.pell_val @[simp] theorem xn_zero : xn a1 0 = 1 := rfl #align pell.xn_zero Pell.xn_zero @[simp] theorem yn_zero : yn a1 0 = 0 := rfl #align pell.yn_zero Pell.yn_zero @[simp] theorem xn_succ (n : β„•) : xn a1 (n + 1) = xn a1 n * a + d a1 * yn a1 n := rfl #align pell.xn_succ Pell.xn_succ @[simp] theorem yn_succ (n : β„•) : yn a1 (n + 1) = xn a1 n + yn a1 n * a := rfl #align pell.yn_succ Pell.yn_succ --@[simp] Porting note (#10618): `simp` can prove it
Mathlib/NumberTheory/PellMatiyasevic.lean
151
151
theorem xn_one : xn a1 1 = a := by
simp
0.09375
import Mathlib.LinearAlgebra.Span import Mathlib.RingTheory.Ideal.IsPrimary import Mathlib.RingTheory.Ideal.QuotientOperations import Mathlib.RingTheory.Noetherian #align_import ring_theory.ideal.associated_prime from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" variable {R : Type*} [CommRing R] (I J : Ideal R) (M : Type*) [AddCommGroup M] [Module R M] def IsAssociatedPrime : Prop := I.IsPrime ∧ βˆƒ x : M, I = (R βˆ™ x).annihilator #align is_associated_prime IsAssociatedPrime variable (R) def associatedPrimes : Set (Ideal R) := { I | IsAssociatedPrime I M } #align associated_primes associatedPrimes variable {I J M R} variable {M' : Type*} [AddCommGroup M'] [Module R M'] (f : M β†’β‚—[R] M') theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M := Iff.rfl #align associate_primes.mem_iff AssociatePrimes.mem_iff theorem IsAssociatedPrime.isPrime (h : IsAssociatedPrime I M) : I.IsPrime := h.1 #align is_associated_prime.is_prime IsAssociatedPrime.isPrime theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) : IsAssociatedPrime I M' := by obtain ⟨x, rfl⟩ := h.2 refine ⟨h.1, ⟨f x, ?_⟩⟩ ext r rw [Submodule.mem_annihilator_span_singleton, Submodule.mem_annihilator_span_singleton, ← map_smul, ← f.map_zero, hf.eq_iff] #align is_associated_prime.map_of_injective IsAssociatedPrime.map_of_injective theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') : IsAssociatedPrime I M ↔ IsAssociatedPrime I M' := ⟨fun h => h.map_of_injective l l.injective, fun h => h.map_of_injective l.symm l.symm.injective⟩ #align linear_equiv.is_associated_prime_iff LinearEquiv.isAssociatedPrime_iff theorem not_isAssociatedPrime_of_subsingleton [Subsingleton M] : Β¬IsAssociatedPrime I M := by rintro ⟨hI, x, hx⟩ apply hI.ne_top rwa [Subsingleton.elim x 0, Submodule.span_singleton_eq_bot.mpr rfl, Submodule.annihilator_bot] at hx #align not_is_associated_prime_of_subsingleton not_isAssociatedPrime_of_subsingleton variable (R) theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M) (hx : x β‰  0) : βˆƒ P : Ideal R, IsAssociatedPrime P M ∧ (R βˆ™ x).annihilator ≀ P := by have : (R βˆ™ x).annihilator β‰  ⊀ := by rwa [Ne, Ideal.eq_top_iff_one, Submodule.mem_annihilator_span_singleton, one_smul] obtain ⟨P, ⟨l, h₁, y, rfl⟩, hβ‚ƒβŸ© := set_has_maximal_iff_noetherian.mpr H { P | (R βˆ™ x).annihilator ≀ P ∧ P β‰  ⊀ ∧ βˆƒ y : M, P = (R βˆ™ y).annihilator } ⟨(R βˆ™ x).annihilator, rfl.le, this, x, rfl⟩ refine ⟨_, ⟨⟨h₁, ?_⟩, y, rfl⟩, l⟩ intro a b hab rw [or_iff_not_imp_left] intro ha rw [Submodule.mem_annihilator_span_singleton] at ha hab have H₁ : (R βˆ™ y).annihilator ≀ (R βˆ™ a β€’ y).annihilator := by intro c hc rw [Submodule.mem_annihilator_span_singleton] at hc ⊒ rw [smul_comm, hc, smul_zero] have Hβ‚‚ : (Submodule.span R {a β€’ y}).annihilator β‰  ⊀ := by rwa [Ne, Submodule.annihilator_eq_top_iff, Submodule.span_singleton_eq_bot] rwa [H₁.eq_of_not_lt (h₃ (R βˆ™ a β€’ y).annihilator ⟨l.trans H₁, Hβ‚‚, _, rfl⟩), Submodule.mem_annihilator_span_singleton, smul_comm, smul_smul] #align exists_le_is_associated_prime_of_is_noetherian_ring exists_le_isAssociatedPrime_of_isNoetherianRing variable {R} theorem associatedPrimes.subset_of_injective (hf : Function.Injective f) : associatedPrimes R M βŠ† associatedPrimes R M' := fun _I h => h.map_of_injective f hf #align associated_primes.subset_of_injective associatedPrimes.subset_of_injective theorem LinearEquiv.AssociatedPrimes.eq (l : M ≃ₗ[R] M') : associatedPrimes R M = associatedPrimes R M' := le_antisymm (associatedPrimes.subset_of_injective l l.injective) (associatedPrimes.subset_of_injective l.symm l.symm.injective) #align linear_equiv.associated_primes.eq LinearEquiv.AssociatedPrimes.eq
Mathlib/RingTheory/Ideal/AssociatedPrime.lean
118
120
theorem associatedPrimes.eq_empty_of_subsingleton [Subsingleton M] : associatedPrimes R M = βˆ… := by
ext; simp only [Set.mem_empty_iff_false, iff_false_iff]; apply not_isAssociatedPrime_of_subsingleton
0.09375
import Mathlib.Combinatorics.SimpleGraph.Basic namespace SimpleGraph variable {V : Type*} (G : SimpleGraph V) structure Dart extends V Γ— V where adj : G.Adj fst snd deriving DecidableEq #align simple_graph.dart SimpleGraph.Dart initialize_simps_projections Dart (+toProd, -fst, -snd) attribute [simp] Dart.adj variable {G} theorem Dart.ext_iff (d₁ dβ‚‚ : G.Dart) : d₁ = dβ‚‚ ↔ d₁.toProd = dβ‚‚.toProd := by cases d₁; cases dβ‚‚; simp #align simple_graph.dart.ext_iff SimpleGraph.Dart.ext_iff @[ext] theorem Dart.ext (d₁ dβ‚‚ : G.Dart) (h : d₁.toProd = dβ‚‚.toProd) : d₁ = dβ‚‚ := (Dart.ext_iff d₁ dβ‚‚).mpr h #align simple_graph.dart.ext SimpleGraph.Dart.ext -- Porting note: deleted `Dart.fst` and `Dart.snd` since they are now invalid declaration names, -- even though there is not actually a `SimpleGraph.Dart.fst` or `SimpleGraph.Dart.snd`. theorem Dart.toProd_injective : Function.Injective (Dart.toProd : G.Dart β†’ V Γ— V) := Dart.ext #align simple_graph.dart.to_prod_injective SimpleGraph.Dart.toProd_injective instance Dart.fintype [Fintype V] [DecidableRel G.Adj] : Fintype G.Dart := Fintype.ofEquiv (Ξ£ v, G.neighborSet v) { toFun := fun s => ⟨(s.fst, s.snd), s.snd.property⟩ invFun := fun d => ⟨d.fst, d.snd, d.adj⟩ left_inv := fun s => by ext <;> simp right_inv := fun d => by ext <;> simp } #align simple_graph.dart.fintype SimpleGraph.Dart.fintype def Dart.edge (d : G.Dart) : Sym2 V := Sym2.mk d.toProd #align simple_graph.dart.edge SimpleGraph.Dart.edge @[simp] theorem Dart.edge_mk {p : V Γ— V} (h : G.Adj p.1 p.2) : (Dart.mk p h).edge = Sym2.mk p := rfl #align simple_graph.dart.edge_mk SimpleGraph.Dart.edge_mk @[simp] theorem Dart.edge_mem (d : G.Dart) : d.edge ∈ G.edgeSet := d.adj #align simple_graph.dart.edge_mem SimpleGraph.Dart.edge_mem @[simps] def Dart.symm (d : G.Dart) : G.Dart := ⟨d.toProd.swap, G.symm d.adj⟩ #align simple_graph.dart.symm SimpleGraph.Dart.symm @[simp] theorem Dart.symm_mk {p : V Γ— V} (h : G.Adj p.1 p.2) : (Dart.mk p h).symm = Dart.mk p.swap h.symm := rfl #align simple_graph.dart.symm_mk SimpleGraph.Dart.symm_mk @[simp] theorem Dart.edge_symm (d : G.Dart) : d.symm.edge = d.edge := Sym2.mk_prod_swap_eq #align simple_graph.dart.edge_symm SimpleGraph.Dart.edge_symm @[simp] theorem Dart.edge_comp_symm : Dart.edge ∘ Dart.symm = (Dart.edge : G.Dart β†’ Sym2 V) := funext Dart.edge_symm #align simple_graph.dart.edge_comp_symm SimpleGraph.Dart.edge_comp_symm @[simp] theorem Dart.symm_symm (d : G.Dart) : d.symm.symm = d := Dart.ext _ _ <| Prod.swap_swap _ #align simple_graph.dart.symm_symm SimpleGraph.Dart.symm_symm @[simp] theorem Dart.symm_involutive : Function.Involutive (Dart.symm : G.Dart β†’ G.Dart) := Dart.symm_symm #align simple_graph.dart.symm_involutive SimpleGraph.Dart.symm_involutive theorem Dart.symm_ne (d : G.Dart) : d.symm β‰  d := ne_of_apply_ne (Prod.snd ∘ Dart.toProd) d.adj.ne #align simple_graph.dart.symm_ne SimpleGraph.Dart.symm_ne theorem dart_edge_eq_iff : βˆ€ d₁ dβ‚‚ : G.Dart, d₁.edge = dβ‚‚.edge ↔ d₁ = dβ‚‚ ∨ d₁ = dβ‚‚.symm := by rintro ⟨p, hp⟩ ⟨q, hq⟩ simp #align simple_graph.dart_edge_eq_iff SimpleGraph.dart_edge_eq_iff theorem dart_edge_eq_mk'_iff : βˆ€ {d : G.Dart} {p : V Γ— V}, d.edge = Sym2.mk p ↔ d.toProd = p ∨ d.toProd = p.swap := by rintro ⟨p, h⟩ apply Sym2.mk_eq_mk_iff #align simple_graph.dart_edge_eq_mk_iff SimpleGraph.dart_edge_eq_mk'_iff
Mathlib/Combinatorics/SimpleGraph/Dart.lean
118
123
theorem dart_edge_eq_mk'_iff' : βˆ€ {d : G.Dart} {u v : V}, d.edge = s(u, v) ↔ d.fst = u ∧ d.snd = v ∨ d.fst = v ∧ d.snd = u := by
rintro ⟨⟨a, b⟩, h⟩ u v rw [dart_edge_eq_mk'_iff] simp
0.09375
import Mathlib.MeasureTheory.Measure.VectorMeasure import Mathlib.MeasureTheory.Function.AEEqOfIntegral #align_import measure_theory.measure.with_density_vector_measure from "leanprover-community/mathlib"@"d1bd9c5df2867c1cb463bc6364446d57bdd9f7f1" noncomputable section open scoped Classical MeasureTheory NNReal ENNReal variable {Ξ± Ξ² : Type*} {m : MeasurableSpace Ξ±} namespace MeasureTheory open TopologicalSpace variable {ΞΌ Ξ½ : Measure Ξ±} variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] def Measure.withDensityα΅₯ {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β†’ E) : VectorMeasure Ξ± E := if hf : Integrable f ΞΌ then { measureOf' := fun s => if MeasurableSet s then ∫ x in s, f x βˆ‚ΞΌ else 0 empty' := by simp not_measurable' := fun s hs => if_neg hs m_iUnion' := fun s hs₁ hsβ‚‚ => by dsimp only convert hasSum_integral_iUnion hs₁ hsβ‚‚ hf.integrableOn with n Β· rw [if_pos (hs₁ n)] Β· rw [if_pos (MeasurableSet.iUnion hs₁)] } else 0 #align measure_theory.measure.with_densityα΅₯ MeasureTheory.Measure.withDensityα΅₯ open Measure variable {f g : Ξ± β†’ E} theorem withDensityα΅₯_apply (hf : Integrable f ΞΌ) {s : Set Ξ±} (hs : MeasurableSet s) : ΞΌ.withDensityα΅₯ f s = ∫ x in s, f x βˆ‚ΞΌ := by rw [withDensityα΅₯, dif_pos hf]; exact dif_pos hs #align measure_theory.with_densityα΅₯_apply MeasureTheory.withDensityα΅₯_apply @[simp] theorem withDensityα΅₯_zero : ΞΌ.withDensityα΅₯ (0 : Ξ± β†’ E) = 0 := by ext1 s hs; erw [withDensityα΅₯_apply (integrable_zero Ξ± E ΞΌ) hs]; simp #align measure_theory.with_densityα΅₯_zero MeasureTheory.withDensityα΅₯_zero @[simp]
Mathlib/MeasureTheory/Measure/WithDensityVectorMeasure.lean
69
76
theorem withDensityα΅₯_neg : ΞΌ.withDensityα΅₯ (-f) = -ΞΌ.withDensityα΅₯ f := by
by_cases hf : Integrable f ΞΌ Β· ext1 i hi rw [VectorMeasure.neg_apply, withDensityα΅₯_apply hf hi, ← integral_neg, withDensityα΅₯_apply hf.neg hi] rfl Β· rw [withDensityα΅₯, withDensityα΅₯, dif_neg hf, dif_neg, neg_zero] rwa [integrable_neg_iff]
0.09375
import Mathlib.Topology.Algebra.GroupWithZero import Mathlib.Topology.Order.OrderClosed #align_import topology.algebra.with_zero_topology from "leanprover-community/mathlib"@"3e0c4d76b6ebe9dfafb67d16f7286d2731ed6064" open Topology Filter TopologicalSpace Filter Set Function namespace WithZeroTopology variable {Ξ± Ξ“β‚€ : Type*} [LinearOrderedCommGroupWithZero Ξ“β‚€] {Ξ³ γ₁ Ξ³β‚‚ : Ξ“β‚€} {l : Filter Ξ±} {f : Ξ± β†’ Ξ“β‚€} scoped instance (priority := 100) topologicalSpace : TopologicalSpace Ξ“β‚€ := nhdsAdjoint 0 <| β¨… Ξ³ β‰  0, π“Ÿ (Iio Ξ³) #align with_zero_topology.topological_space WithZeroTopology.topologicalSpace theorem nhds_eq_update : (𝓝 : Ξ“β‚€ β†’ Filter Ξ“β‚€) = update pure 0 (β¨… Ξ³ β‰  0, π“Ÿ (Iio Ξ³)) := by rw [nhds_nhdsAdjoint, sup_of_le_right] exact le_iInfβ‚‚ fun Ξ³ hΞ³ ↦ le_principal_iff.2 <| zero_lt_iff.2 hΞ³ #align with_zero_topology.nhds_eq_update WithZeroTopology.nhds_eq_update theorem nhds_zero : 𝓝 (0 : Ξ“β‚€) = β¨… Ξ³ β‰  0, π“Ÿ (Iio Ξ³) := by rw [nhds_eq_update, update_same] #align with_zero_topology.nhds_zero WithZeroTopology.nhds_zero theorem hasBasis_nhds_zero : (𝓝 (0 : Ξ“β‚€)).HasBasis (fun Ξ³ : Ξ“β‚€ => Ξ³ β‰  0) Iio := by rw [nhds_zero] refine hasBasis_biInf_principal ?_ ⟨1, one_ne_zero⟩ exact directedOn_iff_directed.2 (Monotone.directed_ge fun a b hab => Iio_subset_Iio hab) #align with_zero_topology.has_basis_nhds_zero WithZeroTopology.hasBasis_nhds_zero theorem Iio_mem_nhds_zero (hΞ³ : Ξ³ β‰  0) : Iio Ξ³ ∈ 𝓝 (0 : Ξ“β‚€) := hasBasis_nhds_zero.mem_of_mem hΞ³ #align with_zero_topology.Iio_mem_nhds_zero WithZeroTopology.Iio_mem_nhds_zero theorem nhds_zero_of_units (Ξ³ : Ξ“β‚€Λ£) : Iio ↑γ ∈ 𝓝 (0 : Ξ“β‚€) := Iio_mem_nhds_zero Ξ³.ne_zero #align with_zero_topology.nhds_zero_of_units WithZeroTopology.nhds_zero_of_units theorem tendsto_zero : Tendsto f l (𝓝 (0 : Ξ“β‚€)) ↔ βˆ€ (Ξ³β‚€) (_ : Ξ³β‚€ β‰  0), βˆ€αΆ  x in l, f x < Ξ³β‚€ := by simp [nhds_zero] #align with_zero_topology.tendsto_zero WithZeroTopology.tendsto_zero @[simp] theorem nhds_of_ne_zero {Ξ³ : Ξ“β‚€} (hβ‚€ : Ξ³ β‰  0) : 𝓝 Ξ³ = pure Ξ³ := nhds_nhdsAdjoint_of_ne _ hβ‚€ #align with_zero_topology.nhds_of_ne_zero WithZeroTopology.nhds_of_ne_zero theorem nhds_coe_units (Ξ³ : Ξ“β‚€Λ£) : 𝓝 (Ξ³ : Ξ“β‚€) = pure (Ξ³ : Ξ“β‚€) := nhds_of_ne_zero Ξ³.ne_zero #align with_zero_topology.nhds_coe_units WithZeroTopology.nhds_coe_units theorem singleton_mem_nhds_of_units (Ξ³ : Ξ“β‚€Λ£) : ({↑γ} : Set Ξ“β‚€) ∈ 𝓝 (Ξ³ : Ξ“β‚€) := by simp #align with_zero_topology.singleton_mem_nhds_of_units WithZeroTopology.singleton_mem_nhds_of_units theorem singleton_mem_nhds_of_ne_zero (h : Ξ³ β‰  0) : ({Ξ³} : Set Ξ“β‚€) ∈ 𝓝 (Ξ³ : Ξ“β‚€) := by simp [h] #align with_zero_topology.singleton_mem_nhds_of_ne_zero WithZeroTopology.singleton_mem_nhds_of_ne_zero theorem hasBasis_nhds_of_ne_zero {x : Ξ“β‚€} (h : x β‰  0) : HasBasis (𝓝 x) (fun _ : Unit => True) fun _ => {x} := by rw [nhds_of_ne_zero h] exact hasBasis_pure _ #align with_zero_topology.has_basis_nhds_of_ne_zero WithZeroTopology.hasBasis_nhds_of_ne_zero theorem hasBasis_nhds_units (Ξ³ : Ξ“β‚€Λ£) : HasBasis (𝓝 (Ξ³ : Ξ“β‚€)) (fun _ : Unit => True) fun _ => {↑γ} := hasBasis_nhds_of_ne_zero Ξ³.ne_zero #align with_zero_topology.has_basis_nhds_units WithZeroTopology.hasBasis_nhds_units theorem tendsto_of_ne_zero {Ξ³ : Ξ“β‚€} (h : Ξ³ β‰  0) : Tendsto f l (𝓝 Ξ³) ↔ βˆ€αΆ  x in l, f x = Ξ³ := by rw [nhds_of_ne_zero h, tendsto_pure] #align with_zero_topology.tendsto_of_ne_zero WithZeroTopology.tendsto_of_ne_zero theorem tendsto_units {Ξ³β‚€ : Ξ“β‚€Λ£} : Tendsto f l (𝓝 (Ξ³β‚€ : Ξ“β‚€)) ↔ βˆ€αΆ  x in l, f x = Ξ³β‚€ := tendsto_of_ne_zero Ξ³β‚€.ne_zero #align with_zero_topology.tendsto_units WithZeroTopology.tendsto_units theorem Iio_mem_nhds (h : γ₁ < Ξ³β‚‚) : Iio Ξ³β‚‚ ∈ 𝓝 γ₁ := by rcases eq_or_ne γ₁ 0 with (rfl | hβ‚€) <;> simp [*, h.ne', Iio_mem_nhds_zero] #align with_zero_topology.Iio_mem_nhds WithZeroTopology.Iio_mem_nhds theorem isOpen_iff {s : Set Ξ“β‚€} : IsOpen s ↔ (0 : Ξ“β‚€) βˆ‰ s ∨ βˆƒ Ξ³, Ξ³ β‰  0 ∧ Iio Ξ³ βŠ† s := by rw [isOpen_iff_mem_nhds, ← and_forall_ne (0 : Ξ“β‚€)] simp (config := { contextual := true }) [nhds_of_ne_zero, imp_iff_not_or, hasBasis_nhds_zero.mem_iff] #align with_zero_topology.is_open_iff WithZeroTopology.isOpen_iff
Mathlib/Topology/Algebra/WithZeroTopology.lean
142
144
theorem isClosed_iff {s : Set Ξ“β‚€} : IsClosed s ↔ (0 : Ξ“β‚€) ∈ s ∨ βˆƒ Ξ³, Ξ³ β‰  0 ∧ s βŠ† Ici Ξ³ := by
simp only [← isOpen_compl_iff, isOpen_iff, mem_compl_iff, not_not, ← compl_Ici, compl_subset_compl]
0.09375
import Mathlib.MeasureTheory.Function.SimpleFuncDenseLp #align_import measure_theory.integral.set_to_l1 from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Classical Topology NNReal ENNReal MeasureTheory Pointwise open Set Filter TopologicalSpace ENNReal EMetric namespace MeasureTheory variable {Ξ± E F F' G π•œ : Type*} {p : ℝβ‰₯0∞} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup F'] [NormedSpace ℝ F'] [NormedAddCommGroup G] {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} local infixr:25 " β†’β‚› " => SimpleFunc open Finset section FinMeasAdditive def FinMeasAdditive {Ξ²} [AddMonoid Ξ²] {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (T : Set Ξ± β†’ Ξ²) : Prop := βˆ€ s t, MeasurableSet s β†’ MeasurableSet t β†’ ΞΌ s β‰  ∞ β†’ ΞΌ t β‰  ∞ β†’ s ∩ t = βˆ… β†’ T (s βˆͺ t) = T s + T t #align measure_theory.fin_meas_additive MeasureTheory.FinMeasAdditive namespace FinMeasAdditive variable {Ξ² : Type*} [AddCommMonoid Ξ²] {T T' : Set Ξ± β†’ Ξ²} theorem zero : FinMeasAdditive ΞΌ (0 : Set Ξ± β†’ Ξ²) := fun s t _ _ _ _ _ => by simp #align measure_theory.fin_meas_additive.zero MeasureTheory.FinMeasAdditive.zero theorem add (hT : FinMeasAdditive ΞΌ T) (hT' : FinMeasAdditive ΞΌ T') : FinMeasAdditive ΞΌ (T + T') := by intro s t hs ht hΞΌs hΞΌt hst simp only [hT s t hs ht hΞΌs hΞΌt hst, hT' s t hs ht hΞΌs hΞΌt hst, Pi.add_apply] abel #align measure_theory.fin_meas_additive.add MeasureTheory.FinMeasAdditive.add theorem smul [Monoid π•œ] [DistribMulAction π•œ Ξ²] (hT : FinMeasAdditive ΞΌ T) (c : π•œ) : FinMeasAdditive ΞΌ fun s => c β€’ T s := fun s t hs ht hΞΌs hΞΌt hst => by simp [hT s t hs ht hΞΌs hΞΌt hst] #align measure_theory.fin_meas_additive.smul MeasureTheory.FinMeasAdditive.smul theorem of_eq_top_imp_eq_top {ΞΌ' : Measure Ξ±} (h : βˆ€ s, MeasurableSet s β†’ ΞΌ s = ∞ β†’ ΞΌ' s = ∞) (hT : FinMeasAdditive ΞΌ T) : FinMeasAdditive ΞΌ' T := fun s t hs ht hΞΌ's hΞΌ't hst => hT s t hs ht (mt (h s hs) hΞΌ's) (mt (h t ht) hΞΌ't) hst #align measure_theory.fin_meas_additive.of_eq_top_imp_eq_top MeasureTheory.FinMeasAdditive.of_eq_top_imp_eq_top theorem of_smul_measure (c : ℝβ‰₯0∞) (hc_ne_top : c β‰  ∞) (hT : FinMeasAdditive (c β€’ ΞΌ) T) : FinMeasAdditive ΞΌ T := by refine of_eq_top_imp_eq_top (fun s _ hΞΌs => ?_) hT rw [Measure.smul_apply, smul_eq_mul, ENNReal.mul_eq_top] at hΞΌs simp only [hc_ne_top, or_false_iff, Ne, false_and_iff] at hΞΌs exact hΞΌs.2 #align measure_theory.fin_meas_additive.of_smul_measure MeasureTheory.FinMeasAdditive.of_smul_measure
Mathlib/MeasureTheory/Integral/SetToL1.lean
130
135
theorem smul_measure (c : ℝβ‰₯0∞) (hc_ne_zero : c β‰  0) (hT : FinMeasAdditive ΞΌ T) : FinMeasAdditive (c β€’ ΞΌ) T := by
refine of_eq_top_imp_eq_top (fun s _ hΞΌs => ?_) hT rw [Measure.smul_apply, smul_eq_mul, ENNReal.mul_eq_top] simp only [hc_ne_zero, true_and_iff, Ne, not_false_iff] exact Or.inl hΞΌs
0.09375
import Mathlib.Data.Fintype.Basic import Mathlib.Data.Finset.Powerset #align_import data.fintype.list from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" variable {Ξ± : Type*} [DecidableEq Ξ±] open List namespace Multiset def lists : Multiset Ξ± β†’ Finset (List Ξ±) := fun s => Quotient.liftOn s (fun l => l.permutations.toFinset) fun l l' (h : l ~ l') => by ext sl simp only [mem_permutations, List.mem_toFinset] exact ⟨fun hs => hs.trans h, fun hs => hs.trans h.symm⟩ #align multiset.lists Multiset.lists @[simp] theorem lists_coe (l : List Ξ±) : lists (l : Multiset Ξ±) = l.permutations.toFinset := rfl #align multiset.lists_coe Multiset.lists_coe @[simp]
Mathlib/Data/Fintype/List.lean
51
53
theorem mem_lists_iff (s : Multiset Ξ±) (l : List Ξ±) : l ∈ lists s ↔ s = ⟦l⟧ := by
induction s using Quotient.inductionOn simpa using perm_comm
0.09375
import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.Pointwise #align_import analysis.normed_space.is_R_or_C from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open Metric variable {π•œ : Type*} [RCLike π•œ] {E : Type*} [NormedAddCommGroup E] theorem RCLike.norm_coe_norm {z : E} : β€–(β€–zβ€– : π•œ)β€– = β€–zβ€– := by simp #align is_R_or_C.norm_coe_norm RCLike.norm_coe_norm variable [NormedSpace π•œ E] @[simp] theorem norm_smul_inv_norm {x : E} (hx : x β‰  0) : β€–(β€–x‖⁻¹ : π•œ) β€’ xβ€– = 1 := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul] #align norm_smul_inv_norm norm_smul_inv_norm theorem norm_smul_inv_norm' {r : ℝ} (r_nonneg : 0 ≀ r) {x : E} (hx : x β‰  0) : β€–((r : π•œ) * (β€–xβ€– : π•œ)⁻¹) β€’ xβ€– = r := by have : β€–xβ€– β‰  0 := by simp [hx] field_simp [norm_smul, r_nonneg, rclike_simps] #align norm_smul_inv_norm' norm_smul_inv_norm' theorem LinearMap.bound_of_sphere_bound {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’β‚—[π•œ] π•œ) (h : βˆ€ z ∈ sphere (0 : E) r, β€–f zβ€– ≀ c) (z : E) : β€–f zβ€– ≀ c / r * β€–zβ€– := by by_cases z_zero : z = 0 Β· rw [z_zero] simp only [LinearMap.map_zero, norm_zero, mul_zero] exact le_rfl set z₁ := ((r : π•œ) * (β€–zβ€– : π•œ)⁻¹) β€’ z with hz₁ have norm_f_z₁ : β€–f z₁‖ ≀ c := by apply h rw [mem_sphere_zero_iff_norm] exact norm_smul_inv_norm' r_pos.le z_zero have r_ne_zero : (r : π•œ) β‰  0 := RCLike.ofReal_ne_zero.mpr r_pos.ne' have eq : f z = β€–zβ€– / r * f z₁ := by rw [hz₁, LinearMap.map_smul, smul_eq_mul] rw [← mul_assoc, ← mul_assoc, div_mul_cancelβ‚€ _ r_ne_zero, mul_inv_cancel, one_mul] simp only [z_zero, RCLike.ofReal_eq_zero, norm_eq_zero, Ne, not_false_iff] rw [eq, norm_mul, norm_div, RCLike.norm_coe_norm, RCLike.norm_of_nonneg r_pos.le, div_mul_eq_mul_div, div_mul_eq_mul_div, mul_comm] apply div_le_div _ _ r_pos rfl.ge Β· exact mul_nonneg ((norm_nonneg _).trans norm_f_z₁) (norm_nonneg z) apply mul_le_mul norm_f_z₁ rfl.le (norm_nonneg z) ((norm_nonneg _).trans norm_f_z₁) #align linear_map.bound_of_sphere_bound LinearMap.bound_of_sphere_bound theorem LinearMap.bound_of_ball_bound' {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’β‚—[π•œ] π•œ) (h : βˆ€ z ∈ closedBall (0 : E) r, β€–f zβ€– ≀ c) (z : E) : β€–f zβ€– ≀ c / r * β€–zβ€– := f.bound_of_sphere_bound r_pos c (fun z hz => h z hz.le) z #align linear_map.bound_of_ball_bound' LinearMap.bound_of_ball_bound'
Mathlib/Analysis/NormedSpace/RCLike.lean
85
93
theorem ContinuousLinearMap.opNorm_bound_of_ball_bound {r : ℝ} (r_pos : 0 < r) (c : ℝ) (f : E β†’L[π•œ] π•œ) (h : βˆ€ z ∈ closedBall (0 : E) r, β€–f zβ€– ≀ c) : β€–fβ€– ≀ c / r := by
apply ContinuousLinearMap.opNorm_le_bound Β· apply div_nonneg _ r_pos.le exact (norm_nonneg _).trans (h 0 (by simp only [norm_zero, mem_closedBall, dist_zero_left, r_pos.le])) apply LinearMap.bound_of_ball_bound' r_pos exact fun z hz => h z hz
0.09375
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Topology.Order.ProjIcc #align_import analysis.special_functions.trigonometric.inverse from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Classical open Topology Filter open Set Filter open Real namespace Real variable {x y : ℝ} -- @[pp_nodot] Porting note: not implemented noncomputable def arcsin : ℝ β†’ ℝ := Subtype.val ∘ IccExtend (neg_le_self zero_le_one) sinOrderIso.symm #align real.arcsin Real.arcsin theorem arcsin_mem_Icc (x : ℝ) : arcsin x ∈ Icc (-(Ο€ / 2)) (Ο€ / 2) := Subtype.coe_prop _ #align real.arcsin_mem_Icc Real.arcsin_mem_Icc @[simp] theorem range_arcsin : range arcsin = Icc (-(Ο€ / 2)) (Ο€ / 2) := by rw [arcsin, range_comp Subtype.val] simp [Icc] #align real.range_arcsin Real.range_arcsin theorem arcsin_le_pi_div_two (x : ℝ) : arcsin x ≀ Ο€ / 2 := (arcsin_mem_Icc x).2 #align real.arcsin_le_pi_div_two Real.arcsin_le_pi_div_two theorem neg_pi_div_two_le_arcsin (x : ℝ) : -(Ο€ / 2) ≀ arcsin x := (arcsin_mem_Icc x).1 #align real.neg_pi_div_two_le_arcsin Real.neg_pi_div_two_le_arcsin theorem arcsin_projIcc (x : ℝ) : arcsin (projIcc (-1) 1 (neg_le_self zero_le_one) x) = arcsin x := by rw [arcsin, Function.comp_apply, IccExtend_val, Function.comp_apply, IccExtend, Function.comp_apply] #align real.arcsin_proj_Icc Real.arcsin_projIcc theorem sin_arcsin' {x : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) : sin (arcsin x) = x := by simpa [arcsin, IccExtend_of_mem _ _ hx, -OrderIso.apply_symm_apply] using Subtype.ext_iff.1 (sinOrderIso.apply_symm_apply ⟨x, hx⟩) #align real.sin_arcsin' Real.sin_arcsin' theorem sin_arcsin {x : ℝ} (hx₁ : -1 ≀ x) (hxβ‚‚ : x ≀ 1) : sin (arcsin x) = x := sin_arcsin' ⟨hx₁, hxβ‚‚βŸ© #align real.sin_arcsin Real.sin_arcsin theorem arcsin_sin' {x : ℝ} (hx : x ∈ Icc (-(Ο€ / 2)) (Ο€ / 2)) : arcsin (sin x) = x := injOn_sin (arcsin_mem_Icc _) hx <| by rw [sin_arcsin (neg_one_le_sin _) (sin_le_one _)] #align real.arcsin_sin' Real.arcsin_sin' theorem arcsin_sin {x : ℝ} (hx₁ : -(Ο€ / 2) ≀ x) (hxβ‚‚ : x ≀ Ο€ / 2) : arcsin (sin x) = x := arcsin_sin' ⟨hx₁, hxβ‚‚βŸ© #align real.arcsin_sin Real.arcsin_sin theorem strictMonoOn_arcsin : StrictMonoOn arcsin (Icc (-1) 1) := (Subtype.strictMono_coe _).comp_strictMonoOn <| sinOrderIso.symm.strictMono.strictMonoOn_IccExtend _ #align real.strict_mono_on_arcsin Real.strictMonoOn_arcsin theorem monotone_arcsin : Monotone arcsin := (Subtype.mono_coe _).comp <| sinOrderIso.symm.monotone.IccExtend _ #align real.monotone_arcsin Real.monotone_arcsin theorem injOn_arcsin : InjOn arcsin (Icc (-1) 1) := strictMonoOn_arcsin.injOn #align real.inj_on_arcsin Real.injOn_arcsin theorem arcsin_inj {x y : ℝ} (hx₁ : -1 ≀ x) (hxβ‚‚ : x ≀ 1) (hy₁ : -1 ≀ y) (hyβ‚‚ : y ≀ 1) : arcsin x = arcsin y ↔ x = y := injOn_arcsin.eq_iff ⟨hx₁, hxβ‚‚βŸ© ⟨hy₁, hyβ‚‚βŸ© #align real.arcsin_inj Real.arcsin_inj @[continuity] theorem continuous_arcsin : Continuous arcsin := continuous_subtype_val.comp sinOrderIso.symm.continuous.Icc_extend' #align real.continuous_arcsin Real.continuous_arcsin theorem continuousAt_arcsin {x : ℝ} : ContinuousAt arcsin x := continuous_arcsin.continuousAt #align real.continuous_at_arcsin Real.continuousAt_arcsin
Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean
108
111
theorem arcsin_eq_of_sin_eq {x y : ℝ} (h₁ : sin x = y) (hβ‚‚ : x ∈ Icc (-(Ο€ / 2)) (Ο€ / 2)) : arcsin y = x := by
subst y exact injOn_sin (arcsin_mem_Icc _) hβ‚‚ (sin_arcsin' (sin_mem_Icc x))
0.09375
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⟩
Mathlib/CategoryTheory/Filtered/Final.lean
91
95
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β‚‚
0.09375
import Mathlib.Algebra.DirectSum.Module import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Convex.Uniform import Mathlib.Analysis.NormedSpace.Completion import Mathlib.Analysis.NormedSpace.BoundedLinearMaps #align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" noncomputable section open RCLike Real Filter open Topology ComplexConjugate open LinearMap (BilinForm) variable {π•œ E F : Type*} [RCLike π•œ] class Inner (π•œ E : Type*) where inner : E β†’ E β†’ π•œ #align has_inner Inner export Inner (inner) notation3:max "βŸͺ" x ", " y "⟫_" π•œ:max => @inner π•œ _ _ x y class InnerProductSpace (π•œ : Type*) (E : Type*) [RCLike π•œ] [NormedAddCommGroup E] extends NormedSpace π•œ E, Inner π•œ E where norm_sq_eq_inner : βˆ€ x : E, β€–xβ€– ^ 2 = re (inner x x) conj_symm : βˆ€ x y, conj (inner y x) = inner x y add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space InnerProductSpace -- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore structure InnerProductSpace.Core (π•œ : Type*) (F : Type*) [RCLike π•œ] [AddCommGroup F] [Module π•œ F] extends Inner π•œ F where conj_symm : βˆ€ x y, conj (inner y x) = inner x y nonneg_re : βˆ€ x, 0 ≀ re (inner x x) definite : βˆ€ x, inner x x = 0 β†’ x = 0 add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space.core InnerProductSpace.Core attribute [class] InnerProductSpace.Core def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π•œ E] : InnerProductSpace.Core π•œ E := { c with nonneg_re := fun x => by rw [← InnerProductSpace.norm_sq_eq_inner] apply sq_nonneg definite := fun x hx => norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by rw [InnerProductSpace.norm_sq_eq_inner (π•œ := π•œ) x, hx, map_zero] } #align inner_product_space.to_core InnerProductSpace.toCore namespace InnerProductSpace.Core variable [AddCommGroup F] [Module π•œ F] [c : InnerProductSpace.Core π•œ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ F _ x y local notation "normSqK" => @RCLike.normSq π•œ _ local notation "reK" => @RCLike.re π•œ _ local notation "ext_iff" => @RCLike.ext_iff π•œ _ local postfix:90 "†" => starRingEnd _ def toInner' : Inner π•œ F := c.toInner #align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner' attribute [local instance] toInner' def normSq (x : F) := reK βŸͺx, x⟫ #align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq local notation "normSqF" => @normSq π•œ F _ _ _ _ theorem inner_conj_symm (x y : F) : βŸͺy, xβŸ«β€  = βŸͺx, y⟫ := c.conj_symm x y #align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm theorem inner_self_nonneg {x : F} : 0 ≀ re βŸͺx, x⟫ := c.nonneg_re _ #align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg theorem inner_self_im (x : F) : im βŸͺx, x⟫ = 0 := by rw [← @ofReal_inj π•œ, im_eq_conj_sub] simp [inner_conj_symm] #align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im theorem inner_add_left (x y z : F) : βŸͺx + y, z⟫ = βŸͺx, z⟫ + βŸͺy, z⟫ := c.add_left _ _ _ #align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left theorem inner_add_right (x y z : F) : βŸͺx, y + z⟫ = βŸͺx, y⟫ + βŸͺx, z⟫ := by rw [← inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm] #align inner_product_space.core.inner_add_right InnerProductSpace.Core.inner_add_right
Mathlib/Analysis/InnerProductSpace/Basic.lean
224
226
theorem ofReal_normSq_eq_inner_self (x : F) : (normSqF x : π•œ) = βŸͺx, x⟫ := by
rw [ext_iff] exact ⟨by simp only [ofReal_re]; rfl, by simp only [inner_self_im, ofReal_im]⟩
0.09375
import Mathlib.Algebra.Order.Field.Basic import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Rat.Cast.Order import Mathlib.Order.Partition.Finpartition import Mathlib.Tactic.GCongr import Mathlib.Tactic.NormNum import Mathlib.Tactic.Positivity import Mathlib.Tactic.Ring #align_import combinatorics.simple_graph.density from "leanprover-community/mathlib"@"a4ec43f53b0bd44c697bcc3f5a62edd56f269ef1" open Finset variable {π•œ ΞΉ ΞΊ Ξ± Ξ² : Type*} namespace Rel section Asymmetric variable [LinearOrderedField π•œ] (r : Ξ± β†’ Ξ² β†’ Prop) [βˆ€ a, DecidablePred (r a)] {s s₁ sβ‚‚ : Finset Ξ±} {t t₁ tβ‚‚ : Finset Ξ²} {a : Ξ±} {b : Ξ²} {Ξ΄ : π•œ} def interedges (s : Finset Ξ±) (t : Finset Ξ²) : Finset (Ξ± Γ— Ξ²) := (s Γ—Λ’ t).filter fun e ↦ r e.1 e.2 #align rel.interedges Rel.interedges def edgeDensity (s : Finset Ξ±) (t : Finset Ξ²) : β„š := (interedges r s t).card / (s.card * t.card) #align rel.edge_density Rel.edgeDensity variable {r} theorem mem_interedges_iff {x : Ξ± Γ— Ξ²} : x ∈ interedges r s t ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ r x.1 x.2 := by rw [interedges, mem_filter, Finset.mem_product, and_assoc] #align rel.mem_interedges_iff Rel.mem_interedges_iff theorem mk_mem_interedges_iff : (a, b) ∈ interedges r s t ↔ a ∈ s ∧ b ∈ t ∧ r a b := mem_interedges_iff #align rel.mk_mem_interedges_iff Rel.mk_mem_interedges_iff @[simp] theorem interedges_empty_left (t : Finset Ξ²) : interedges r βˆ… t = βˆ… := by rw [interedges, Finset.empty_product, filter_empty] #align rel.interedges_empty_left Rel.interedges_empty_left theorem interedges_mono (hs : sβ‚‚ βŠ† s₁) (ht : tβ‚‚ βŠ† t₁) : interedges r sβ‚‚ tβ‚‚ βŠ† interedges r s₁ t₁ := fun x ↦ by simp_rw [mem_interedges_iff] exact fun h ↦ ⟨hs h.1, ht h.2.1, h.2.2⟩ #align rel.interedges_mono Rel.interedges_mono variable (r) theorem card_interedges_add_card_interedges_compl (s : Finset Ξ±) (t : Finset Ξ²) : (interedges r s t).card + (interedges (fun x y ↦ Β¬r x y) s t).card = s.card * t.card := by classical rw [← card_product, interedges, interedges, ← card_union_of_disjoint, filter_union_filter_neg_eq] exact disjoint_filter.2 fun _ _ ↦ Classical.not_not.2 #align rel.card_interedges_add_card_interedges_compl Rel.card_interedges_add_card_interedges_compl theorem interedges_disjoint_left {s s' : Finset Ξ±} (hs : Disjoint s s') (t : Finset Ξ²) : Disjoint (interedges r s t) (interedges r s' t) := by rw [Finset.disjoint_left] at hs ⊒ intro _ hx hy rw [mem_interedges_iff] at hx hy exact hs hx.1 hy.1 #align rel.interedges_disjoint_left Rel.interedges_disjoint_left theorem interedges_disjoint_right (s : Finset Ξ±) {t t' : Finset Ξ²} (ht : Disjoint t t') : Disjoint (interedges r s t) (interedges r s t') := by rw [Finset.disjoint_left] at ht ⊒ intro _ hx hy rw [mem_interedges_iff] at hx hy exact ht hx.2.1 hy.2.1 #align rel.interedges_disjoint_right Rel.interedges_disjoint_right section DecidableEq variable [DecidableEq Ξ±] [DecidableEq Ξ²] lemma interedges_eq_biUnion : interedges r s t = s.biUnion (fun x ↦ (t.filter (r x)).map ⟨(x, Β·), Prod.mk.inj_left x⟩) := by ext ⟨x, y⟩; simp [mem_interedges_iff]
Mathlib/Combinatorics/SimpleGraph/Density.lean
109
112
theorem interedges_biUnion_left (s : Finset ΞΉ) (t : Finset Ξ²) (f : ΞΉ β†’ Finset Ξ±) : interedges r (s.biUnion f) t = s.biUnion fun a ↦ interedges r (f a) t := by
ext simp only [mem_biUnion, mem_interedges_iff, exists_and_right, ← and_assoc]
0.09375
import Mathlib.Data.List.OfFn import Mathlib.Data.List.Nodup import Mathlib.Data.List.Infix #align_import data.list.sort from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" open List.Perm universe u namespace List section Sorted variable {Ξ± : Type u} {r : Ξ± β†’ Ξ± β†’ Prop} {a : Ξ±} {l : List Ξ±} def Sorted := @Pairwise #align list.sorted List.Sorted instance decidableSorted [DecidableRel r] (l : List Ξ±) : Decidable (Sorted r l) := List.instDecidablePairwise _ #align list.decidable_sorted List.decidableSorted protected theorem Sorted.le_of_lt [Preorder Ξ±] {l : List Ξ±} (h : l.Sorted (Β· < Β·)) : l.Sorted (Β· ≀ Β·) := h.imp le_of_lt protected theorem Sorted.lt_of_le [PartialOrder Ξ±] {l : List Ξ±} (h₁ : l.Sorted (Β· ≀ Β·)) (hβ‚‚ : l.Nodup) : l.Sorted (Β· < Β·) := h₁.impβ‚‚ (fun _ _ => lt_of_le_of_ne) hβ‚‚ protected theorem Sorted.ge_of_gt [Preorder Ξ±] {l : List Ξ±} (h : l.Sorted (Β· > Β·)) : l.Sorted (Β· β‰₯ Β·) := h.imp le_of_lt protected theorem Sorted.gt_of_ge [PartialOrder Ξ±] {l : List Ξ±} (h₁ : l.Sorted (Β· β‰₯ Β·)) (hβ‚‚ : l.Nodup) : l.Sorted (Β· > Β·) := h₁.impβ‚‚ (fun _ _ => lt_of_le_of_ne) <| by simp_rw [ne_comm]; exact hβ‚‚ @[simp] theorem sorted_nil : Sorted r [] := Pairwise.nil #align list.sorted_nil List.sorted_nil theorem Sorted.of_cons : Sorted r (a :: l) β†’ Sorted r l := Pairwise.of_cons #align list.sorted.of_cons List.Sorted.of_cons theorem Sorted.tail {r : Ξ± β†’ Ξ± β†’ Prop} {l : List Ξ±} (h : Sorted r l) : Sorted r l.tail := Pairwise.tail h #align list.sorted.tail List.Sorted.tail theorem rel_of_sorted_cons {a : Ξ±} {l : List Ξ±} : Sorted r (a :: l) β†’ βˆ€ b ∈ l, r a b := rel_of_pairwise_cons #align list.rel_of_sorted_cons List.rel_of_sorted_cons
Mathlib/Data/List/Sort.lean
80
85
theorem Sorted.head!_le [Inhabited Ξ±] [Preorder Ξ±] {a : Ξ±} {l : List Ξ±} (h : Sorted (Β· < Β·) l) (ha : a ∈ l) : l.head! ≀ a := by
rw [← List.cons_head!_tail (List.ne_nil_of_mem ha)] at h ha cases ha Β· exact le_rfl Β· exact le_of_lt (rel_of_sorted_cons h a (by assumption))
0.09375
import Mathlib.MeasureTheory.Integral.Lebesgue open Set hiding restrict restrict_apply open Filter ENNReal NNReal MeasureTheory.Measure namespace MeasureTheory variable {Ξ± : Type*} {m0 : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} noncomputable def Measure.withDensity {m : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (f : Ξ± β†’ ℝβ‰₯0∞) : Measure Ξ± := Measure.ofMeasurable (fun s _ => ∫⁻ a in s, f a βˆ‚ΞΌ) (by simp) fun s hs hd => lintegral_iUnion hs hd _ #align measure_theory.measure.with_density MeasureTheory.Measure.withDensity @[simp] theorem withDensity_apply (f : Ξ± β†’ ℝβ‰₯0∞) {s : Set Ξ±} (hs : MeasurableSet s) : ΞΌ.withDensity f s = ∫⁻ a in s, f a βˆ‚ΞΌ := Measure.ofMeasurable_apply s hs #align measure_theory.with_density_apply MeasureTheory.withDensity_apply theorem withDensity_apply_le (f : Ξ± β†’ ℝβ‰₯0∞) (s : Set Ξ±) : ∫⁻ a in s, f a βˆ‚ΞΌ ≀ ΞΌ.withDensity f s := by let t := toMeasurable (ΞΌ.withDensity f) s calc ∫⁻ a in s, f a βˆ‚ΞΌ ≀ ∫⁻ a in t, f a βˆ‚ΞΌ := lintegral_mono_set (subset_toMeasurable (withDensity ΞΌ f) s) _ = ΞΌ.withDensity f t := (withDensity_apply f (measurableSet_toMeasurable (withDensity ΞΌ f) s)).symm _ = ΞΌ.withDensity f s := measure_toMeasurable s theorem withDensity_apply' [SFinite ΞΌ] (f : Ξ± β†’ ℝβ‰₯0∞) (s : Set Ξ±) : ΞΌ.withDensity f s = ∫⁻ a in s, f a βˆ‚ΞΌ := by apply le_antisymm ?_ (withDensity_apply_le f s) let t := toMeasurable ΞΌ s calc ΞΌ.withDensity f s ≀ ΞΌ.withDensity f t := measure_mono (subset_toMeasurable ΞΌ s) _ = ∫⁻ a in t, f a βˆ‚ΞΌ := withDensity_apply f (measurableSet_toMeasurable ΞΌ s) _ = ∫⁻ a in s, f a βˆ‚ΞΌ := by congr 1; exact restrict_toMeasurable_of_sFinite s @[simp] lemma withDensity_zero_left (f : Ξ± β†’ ℝβ‰₯0∞) : (0 : Measure Ξ±).withDensity f = 0 := by ext s hs rw [withDensity_apply _ hs] simp
Mathlib/MeasureTheory/Measure/WithDensity.lean
83
87
theorem withDensity_congr_ae {f g : Ξ± β†’ ℝβ‰₯0∞} (h : f =ᡐ[ΞΌ] g) : ΞΌ.withDensity f = ΞΌ.withDensity g := by
refine Measure.ext fun s hs => ?_ rw [withDensity_apply _ hs, withDensity_apply _ hs] exact lintegral_congr_ae (ae_restrict_of_ae h)
0.09375
import Mathlib.Analysis.NormedSpace.PiLp import Mathlib.Analysis.InnerProductSpace.PiL2 #align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" noncomputable section open scoped NNReal Matrix namespace Matrix variable {R l m n Ξ± Ξ² : Type*} [Fintype l] [Fintype m] [Fintype n] section LinfLinf protected def normedAddCommGroup [NormedAddCommGroup Ξ±] : NormedAddCommGroup (Matrix m n Ξ±) := Pi.normedAddCommGroup #align matrix.normed_add_comm_group Matrix.normedAddCommGroup section LinftyOp @[local instance] protected def linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup Ξ±] : SeminormedAddCommGroup (Matrix m n Ξ±) := (by infer_instance : SeminormedAddCommGroup (m β†’ PiLp 1 fun j : n => Ξ±)) #align matrix.linfty_op_seminormed_add_comm_group Matrix.linftyOpSeminormedAddCommGroup @[local instance] protected def linftyOpNormedAddCommGroup [NormedAddCommGroup Ξ±] : NormedAddCommGroup (Matrix m n Ξ±) := (by infer_instance : NormedAddCommGroup (m β†’ PiLp 1 fun j : n => Ξ±)) #align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup @[local instance] protected theorem linftyOpBoundedSMul [SeminormedRing R] [SeminormedAddCommGroup Ξ±] [Module R Ξ±] [BoundedSMul R Ξ±] : BoundedSMul R (Matrix m n Ξ±) := (by infer_instance : BoundedSMul R (m β†’ PiLp 1 fun j : n => Ξ±)) @[local instance] protected def linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup Ξ±] [NormedSpace R Ξ±] : NormedSpace R (Matrix m n Ξ±) := (by infer_instance : NormedSpace R (m β†’ PiLp 1 fun j : n => Ξ±)) #align matrix.linfty_op_normed_space Matrix.linftyOpNormedSpace section SeminormedAddCommGroup variable [SeminormedAddCommGroup Ξ±] theorem linfty_opNorm_def (A : Matrix m n Ξ±) : β€–Aβ€– = ((Finset.univ : Finset m).sup fun i : m => βˆ‘ j : n, β€–A i jβ€–β‚Š : ℝβ‰₯0) := by -- Porting note: added change β€–fun i => (WithLp.equiv 1 _).symm (A i)β€– = _ simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top] #align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def @[deprecated (since := "2024-02-02")] alias linfty_op_norm_def := linfty_opNorm_def theorem linfty_opNNNorm_def (A : Matrix m n Ξ±) : β€–Aβ€–β‚Š = (Finset.univ : Finset m).sup fun i : m => βˆ‘ j : n, β€–A i jβ€–β‚Š := Subtype.ext <| linfty_opNorm_def A #align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def @[deprecated (since := "2024-02-02")] alias linfty_op_nnnorm_def := linfty_opNNNorm_def @[simp, nolint simpNF] -- Porting note: linter times out
Mathlib/Analysis/Matrix.lean
290
292
theorem linfty_opNNNorm_col (v : m β†’ Ξ±) : β€–col vβ€–β‚Š = β€–vβ€–β‚Š := by
rw [linfty_opNNNorm_def, Pi.nnnorm_def] simp
0.09375
import Mathlib.Algebra.Order.ToIntervalMod import Mathlib.Algebra.Ring.AddAut import Mathlib.Data.Nat.Totient import Mathlib.GroupTheory.Divisible import Mathlib.Topology.Connected.PathConnected import Mathlib.Topology.IsLocalHomeomorph #align_import topology.instances.add_circle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" noncomputable section open AddCommGroup Set Function AddSubgroup TopologicalSpace open Topology variable {π•œ B : Type*} @[nolint unusedArguments] abbrev AddCircle [LinearOrderedAddCommGroup π•œ] [TopologicalSpace π•œ] [OrderTopology π•œ] (p : π•œ) := π•œ β§Έ zmultiples p #align add_circle AddCircle namespace AddCircle section LinearOrderedAddCommGroup variable [LinearOrderedAddCommGroup π•œ] [TopologicalSpace π•œ] [OrderTopology π•œ] (p : π•œ) theorem coe_nsmul {n : β„•} {x : π•œ} : (↑(n β€’ x) : AddCircle p) = n β€’ (x : AddCircle p) := rfl #align add_circle.coe_nsmul AddCircle.coe_nsmul theorem coe_zsmul {n : β„€} {x : π•œ} : (↑(n β€’ x) : AddCircle p) = n β€’ (x : AddCircle p) := rfl #align add_circle.coe_zsmul AddCircle.coe_zsmul theorem coe_add (x y : π•œ) : (↑(x + y) : AddCircle p) = (x : AddCircle p) + (y : AddCircle p) := rfl #align add_circle.coe_add AddCircle.coe_add theorem coe_sub (x y : π•œ) : (↑(x - y) : AddCircle p) = (x : AddCircle p) - (y : AddCircle p) := rfl #align add_circle.coe_sub AddCircle.coe_sub theorem coe_neg {x : π•œ} : (↑(-x) : AddCircle p) = -(x : AddCircle p) := rfl #align add_circle.coe_neg AddCircle.coe_neg theorem coe_eq_zero_iff {x : π•œ} : (x : AddCircle p) = 0 ↔ βˆƒ n : β„€, n β€’ p = x := by simp [AddSubgroup.mem_zmultiples_iff] #align add_circle.coe_eq_zero_iff AddCircle.coe_eq_zero_iff theorem coe_eq_zero_of_pos_iff (hp : 0 < p) {x : π•œ} (hx : 0 < x) : (x : AddCircle p) = 0 ↔ βˆƒ n : β„•, n β€’ p = x := by rw [coe_eq_zero_iff] constructor <;> rintro ⟨n, rfl⟩ Β· replace hx : 0 < n := by contrapose! hx simpa only [← neg_nonneg, ← zsmul_neg, zsmul_neg'] using zsmul_nonneg hp.le (neg_nonneg.2 hx) exact ⟨n.toNat, by rw [← natCast_zsmul, Int.toNat_of_nonneg hx.le]⟩ Β· exact ⟨(n : β„€), by simp⟩ #align add_circle.coe_eq_zero_of_pos_iff AddCircle.coe_eq_zero_of_pos_iff theorem coe_period : (p : AddCircle p) = 0 := (QuotientAddGroup.eq_zero_iff p).2 <| mem_zmultiples p #align add_circle.coe_period AddCircle.coe_period theorem coe_add_period (x : π•œ) : ((x + p : π•œ) : AddCircle p) = x := by rw [coe_add, ← eq_sub_iff_add_eq', sub_self, coe_period] #align add_circle.coe_add_period AddCircle.coe_add_period @[continuity, nolint unusedArguments] protected theorem continuous_mk' : Continuous (QuotientAddGroup.mk' (zmultiples p) : π•œ β†’ AddCircle p) := continuous_coinduced_rng #align add_circle.continuous_mk' AddCircle.continuous_mk' variable [hp : Fact (0 < p)] (a : π•œ) [Archimedean π•œ] def equivIco : AddCircle p ≃ Ico a (a + p) := QuotientAddGroup.equivIcoMod hp.out a #align add_circle.equiv_Ico AddCircle.equivIco def equivIoc : AddCircle p ≃ Ioc a (a + p) := QuotientAddGroup.equivIocMod hp.out a #align add_circle.equiv_Ioc AddCircle.equivIoc def liftIco (f : π•œ β†’ B) : AddCircle p β†’ B := restrict _ f ∘ AddCircle.equivIco p a #align add_circle.lift_Ico AddCircle.liftIco def liftIoc (f : π•œ β†’ B) : AddCircle p β†’ B := restrict _ f ∘ AddCircle.equivIoc p a #align add_circle.lift_Ioc AddCircle.liftIoc variable {p a} theorem coe_eq_coe_iff_of_mem_Ico {x y : π•œ} (hx : x ∈ Ico a (a + p)) (hy : y ∈ Ico a (a + p)) : (x : AddCircle p) = y ↔ x = y := by refine ⟨fun h => ?_, by tauto⟩ suffices (⟨x, hx⟩ : Ico a (a + p)) = ⟨y, hy⟩ by exact Subtype.mk.inj this apply_fun equivIco p a at h rw [← (equivIco p a).right_inv ⟨x, hx⟩, ← (equivIco p a).right_inv ⟨y, hy⟩] exact h #align add_circle.coe_eq_coe_iff_of_mem_Ico AddCircle.coe_eq_coe_iff_of_mem_Ico theorem liftIco_coe_apply {f : π•œ β†’ B} {x : π•œ} (hx : x ∈ Ico a (a + p)) : liftIco p a f ↑x = f x := by have : (equivIco p a) x = ⟨x, hx⟩ := by rw [Equiv.apply_eq_iff_eq_symm_apply] rfl rw [liftIco, comp_apply, this] rfl #align add_circle.lift_Ico_coe_apply AddCircle.liftIco_coe_apply
Mathlib/Topology/Instances/AddCircle.lean
231
237
theorem liftIoc_coe_apply {f : π•œ β†’ B} {x : π•œ} (hx : x ∈ Ioc a (a + p)) : liftIoc p a f ↑x = f x := by
have : (equivIoc p a) x = ⟨x, hx⟩ := by rw [Equiv.apply_eq_iff_eq_symm_apply] rfl rw [liftIoc, comp_apply, this] rfl
0.09375
import Mathlib.Analysis.SpecialFunctions.ExpDeriv import Mathlib.Analysis.SpecialFunctions.Complex.Circle import Mathlib.Analysis.InnerProductSpace.l2Space import Mathlib.MeasureTheory.Function.ContinuousMapDense import Mathlib.MeasureTheory.Function.L2Space import Mathlib.MeasureTheory.Group.Integral import Mathlib.MeasureTheory.Integral.Periodic import Mathlib.Topology.ContinuousFunction.StoneWeierstrass import Mathlib.MeasureTheory.Integral.FundThmCalculus #align_import analysis.fourier.add_circle from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92" noncomputable section open scoped ENNReal ComplexConjugate Real open TopologicalSpace ContinuousMap MeasureTheory MeasureTheory.Measure Algebra Submodule Set variable {T : ℝ} open AddCircle section Monomials def fourier (n : β„€) : C(AddCircle T, β„‚) where toFun x := toCircle (n β€’ x :) continuous_toFun := continuous_induced_dom.comp <| continuous_toCircle.comp <| continuous_zsmul _ #align fourier fourier @[simp] theorem fourier_apply {n : β„€} {x : AddCircle T} : fourier n x = toCircle (n β€’ x :) := rfl #align fourier_apply fourier_apply -- @[simp] -- Porting note: simp normal form is `fourier_coe_apply'` theorem fourier_coe_apply {n : β„€} {x : ℝ} : fourier n (x : AddCircle T) = Complex.exp (2 * Ο€ * Complex.I * n * x / T) := by rw [fourier_apply, ← QuotientAddGroup.mk_zsmul, toCircle, Function.Periodic.lift_coe, expMapCircle_apply, Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_mul, zsmul_eq_mul, Complex.ofReal_mul, Complex.ofReal_intCast] norm_num congr 1; ring #align fourier_coe_apply fourier_coe_apply @[simp] theorem fourier_coe_apply' {n : β„€} {x : ℝ} : toCircle (n β€’ (x : AddCircle T) :) = Complex.exp (2 * Ο€ * Complex.I * n * x / T) := by rw [← fourier_apply]; exact fourier_coe_apply -- @[simp] -- Porting note: simp normal form is `fourier_zero'` theorem fourier_zero {x : AddCircle T} : fourier 0 x = 1 := by induction x using QuotientAddGroup.induction_on' simp only [fourier_coe_apply] norm_num #align fourier_zero fourier_zero @[simp] theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : β„‚) := by have : fourier 0 x = @toCircle T 0 := by rw [fourier_apply, zero_smul] rw [← this]; exact fourier_zero -- @[simp] -- Porting note: simp normal form is *also* `fourier_zero'` theorem fourier_eval_zero (n : β„€) : fourier n (0 : AddCircle T) = 1 := by rw [← QuotientAddGroup.mk_zero, fourier_coe_apply, Complex.ofReal_zero, mul_zero, zero_div, Complex.exp_zero] #align fourier_eval_zero fourier_eval_zero -- @[simp] -- Porting note (#10618): simp can prove this theorem fourier_one {x : AddCircle T} : fourier 1 x = toCircle x := by rw [fourier_apply, one_zsmul] #align fourier_one fourier_one -- @[simp] -- Porting note: simp normal form is `fourier_neg'` theorem fourier_neg {n : β„€} {x : AddCircle T} : fourier (-n) x = conj (fourier n x) := by induction x using QuotientAddGroup.induction_on' simp_rw [fourier_apply, toCircle] rw [← QuotientAddGroup.mk_zsmul, ← QuotientAddGroup.mk_zsmul] simp_rw [Function.Periodic.lift_coe, ← coe_inv_circle_eq_conj, ← expMapCircle_neg, neg_smul, mul_neg] #align fourier_neg fourier_neg @[simp] theorem fourier_neg' {n : β„€} {x : AddCircle T} : @toCircle T (-(n β€’ x)) = conj (fourier n x) := by rw [← neg_smul, ← fourier_apply]; exact fourier_neg -- @[simp] -- Porting note: simp normal form is `fourier_add'` theorem fourier_add {m n : β„€} {x : AddCircle T} : fourier (m+n) x = fourier m x * fourier n x := by simp_rw [fourier_apply, add_zsmul, toCircle_add, coe_mul_unitSphere] #align fourier_add fourier_add @[simp] theorem fourier_add' {m n : β„€} {x : AddCircle T} : toCircle ((m + n) β€’ x :) = fourier m x * fourier n x := by rw [← fourier_apply]; exact fourier_add
Mathlib/Analysis/Fourier/AddCircle.lean
176
180
theorem fourier_norm [Fact (0 < T)] (n : β„€) : β€–@fourier T nβ€– = 1 := by
rw [ContinuousMap.norm_eq_iSup_norm] have : βˆ€ x : AddCircle T, β€–fourier n xβ€– = 1 := fun x => abs_coe_circle _ simp_rw [this] exact @ciSup_const _ _ _ Zero.instNonempty _
0.09375
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_two_iff FiniteField.isSquare_two_iff theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F (-2) = Ο‡β‚ˆ' (Fintype.card F) := by rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Ο‡β‚ˆ'_eq_Ο‡β‚„_mul_Ο‡β‚ˆ, quadraticChar_neg_one hF, quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 ∣ 8)] #align quadratic_char_neg_two quadraticChar_neg_two
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
72
91
theorem FiniteField.isSquare_neg_two_iff : IsSquare (-2 : F) ↔ Fintype.card F % 8 β‰  5 ∧ Fintype.card F % 8 β‰  7 := by
classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)), quadraticChar_neg_two hF, Ο‡β‚ˆ'_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
0.0625
import Mathlib.Data.Rat.Cast.Defs import Mathlib.Algebra.Field.Basic #align_import data.rat.cast from "leanprover-community/mathlib"@"acebd8d49928f6ed8920e502a6c90674e75bd441" namespace NNRat @[simp, norm_cast]
Mathlib/Data/Rat/Cast/Lemmas.lean
64
67
theorem cast_pow {K} [DivisionSemiring K] (q : β„šβ‰₯0) (n : β„•) : NNRat.cast (q ^ n) = (NNRat.cast q : K) ^ n := by
rw [cast_def, cast_def, den_pow, num_pow, Nat.cast_pow, Nat.cast_pow, div_eq_mul_inv, ← inv_pow, ← (Nat.cast_commute _ _).mul_pow, ← div_eq_mul_inv]
0.0625
import Mathlib.RingTheory.HahnSeries.Multiplication import Mathlib.RingTheory.PowerSeries.Basic import Mathlib.Data.Finsupp.PWO #align_import ring_theory.hahn_series from "leanprover-community/mathlib"@"a484a7d0eade4e1268f4fb402859b6686037f965" set_option linter.uppercaseLean3 false open Finset Function open scoped Classical open Pointwise Polynomial noncomputable section variable {Ξ“ : Type*} {R : Type*} namespace HahnSeries section Semiring variable [Semiring R] @[simps] def toPowerSeries : HahnSeries β„• R ≃+* PowerSeries R where toFun f := PowerSeries.mk f.coeff invFun f := ⟨fun n => PowerSeries.coeff R n f, (Nat.lt_wfRel.wf.isWF _).isPWO⟩ left_inv f := by ext simp right_inv f := by ext simp map_add' f g := by ext simp map_mul' f g := by ext n simp only [PowerSeries.coeff_mul, PowerSeries.coeff_mk, mul_coeff, isPWO_support] classical refine (sum_filter_ne_zero _).symm.trans <| (sum_congr ?_ fun _ _ ↦ rfl).trans <| sum_filter_ne_zero _ ext m simp only [mem_antidiagonal, mem_addAntidiagonal, and_congr_left_iff, mem_filter, mem_support] rintro h rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)] #align hahn_series.to_power_series HahnSeries.toPowerSeries theorem coeff_toPowerSeries {f : HahnSeries β„• R} {n : β„•} : PowerSeries.coeff R n (toPowerSeries f) = f.coeff n := PowerSeries.coeff_mk _ _ #align hahn_series.coeff_to_power_series HahnSeries.coeff_toPowerSeries theorem coeff_toPowerSeries_symm {f : PowerSeries R} {n : β„•} : (HahnSeries.toPowerSeries.symm f).coeff n = PowerSeries.coeff R n f := rfl #align hahn_series.coeff_to_power_series_symm HahnSeries.coeff_toPowerSeries_symm variable (Ξ“ R) [StrictOrderedSemiring Ξ“] def ofPowerSeries : PowerSeries R β†’+* HahnSeries Ξ“ R := (HahnSeries.embDomainRingHom (Nat.castAddMonoidHom Ξ“) Nat.strictMono_cast.injective fun _ _ => Nat.cast_le).comp (RingEquiv.toRingHom toPowerSeries.symm) #align hahn_series.of_power_series HahnSeries.ofPowerSeries variable {Ξ“} {R} theorem ofPowerSeries_injective : Function.Injective (ofPowerSeries Ξ“ R) := embDomain_injective.comp toPowerSeries.symm.injective #align hahn_series.of_power_series_injective HahnSeries.ofPowerSeries_injective theorem ofPowerSeries_apply (x : PowerSeries R) : ofPowerSeries Ξ“ R x = HahnSeries.embDomain ⟨⟨((↑) : β„• β†’ Ξ“), Nat.strictMono_cast.injective⟩, by simp only [Function.Embedding.coeFn_mk] exact Nat.cast_le⟩ (toPowerSeries.symm x) := rfl #align hahn_series.of_power_series_apply HahnSeries.ofPowerSeries_apply theorem ofPowerSeries_apply_coeff (x : PowerSeries R) (n : β„•) : (ofPowerSeries Ξ“ R x).coeff n = PowerSeries.coeff R n x := by simp [ofPowerSeries_apply] #align hahn_series.of_power_series_apply_coeff HahnSeries.ofPowerSeries_apply_coeff @[simp] theorem ofPowerSeries_C (r : R) : ofPowerSeries Ξ“ R (PowerSeries.C R r) = HahnSeries.C r := by ext n simp only [ofPowerSeries_apply, C, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, ne_eq, single_coeff] split_ifs with hn Β· subst hn convert @embDomain_coeff β„• R _ _ Ξ“ _ _ _ 0 <;> simp Β· rw [embDomain_notin_image_support] simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support, PowerSeries.coeff_C] intro simp (config := { contextual := true }) [Ne.symm hn] #align hahn_series.of_power_series_C HahnSeries.ofPowerSeries_C @[simp] theorem ofPowerSeries_X : ofPowerSeries Ξ“ R PowerSeries.X = single 1 1 := by ext n simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk] split_ifs with hn Β· rw [hn] convert @embDomain_coeff β„• R _ _ Ξ“ _ _ _ 1 <;> simp Β· rw [embDomain_notin_image_support] simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support, PowerSeries.coeff_X] intro simp (config := { contextual := true }) [Ne.symm hn] #align hahn_series.of_power_series_X HahnSeries.ofPowerSeries_X
Mathlib/RingTheory/HahnSeries/PowerSeries.lean
145
147
theorem ofPowerSeries_X_pow {R} [Semiring R] (n : β„•) : ofPowerSeries Ξ“ R (PowerSeries.X ^ n) = single (n : Ξ“) 1 := by
simp
0.0625
import Mathlib.MeasureTheory.Measure.MeasureSpace open scoped ENNReal NNReal Topology open Set MeasureTheory Measure Filter MeasurableSpace ENNReal Function variable {R Ξ± Ξ² Ξ΄ Ξ³ ΞΉ : Type*} namespace MeasureTheory variable {m0 : MeasurableSpace Ξ±} [MeasurableSpace Ξ²] [MeasurableSpace Ξ³] variable {ΞΌ μ₁ ΞΌβ‚‚ μ₃ Ξ½ Ξ½' ν₁ Ξ½β‚‚ : Measure Ξ±} {s s' t : Set Ξ±} namespace Measure noncomputable def restrictβ‚— {m0 : MeasurableSpace Ξ±} (s : Set Ξ±) : Measure Ξ± β†’β‚—[ℝβ‰₯0∞] Measure Ξ± := liftLinear (OuterMeasure.restrict s) fun ΞΌ s' hs' t => by suffices ΞΌ (s ∩ t) = ΞΌ (s ∩ t ∩ s') + ΞΌ ((s ∩ t) \ s') by simpa [← Set.inter_assoc, Set.inter_comm _ s, ← inter_diff_assoc] exact le_toOuterMeasure_caratheodory _ _ hs' _ #align measure_theory.measure.restrictβ‚— MeasureTheory.Measure.restrictβ‚— noncomputable def restrict {_m0 : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (s : Set Ξ±) : Measure Ξ± := restrictβ‚— s ΞΌ #align measure_theory.measure.restrict MeasureTheory.Measure.restrict @[simp] theorem restrictβ‚—_apply {_m0 : MeasurableSpace Ξ±} (s : Set Ξ±) (ΞΌ : Measure Ξ±) : restrictβ‚— s ΞΌ = ΞΌ.restrict s := rfl #align measure_theory.measure.restrictβ‚—_apply MeasureTheory.Measure.restrictβ‚—_apply theorem restrict_toOuterMeasure_eq_toOuterMeasure_restrict (h : MeasurableSet s) : (ΞΌ.restrict s).toOuterMeasure = OuterMeasure.restrict s ΞΌ.toOuterMeasure := by simp_rw [restrict, restrictβ‚—, liftLinear, LinearMap.coe_mk, AddHom.coe_mk, toMeasure_toOuterMeasure, OuterMeasure.restrict_trim h, ΞΌ.trimmed] #align measure_theory.measure.restrict_to_outer_measure_eq_to_outer_measure_restrict MeasureTheory.Measure.restrict_toOuterMeasure_eq_toOuterMeasure_restrict
Mathlib/MeasureTheory/Measure/Restrict.lean
62
64
theorem restrict_applyβ‚€ (ht : NullMeasurableSet t (ΞΌ.restrict s)) : ΞΌ.restrict s t = ΞΌ (t ∩ s) := by
rw [← restrictβ‚—_apply, restrictβ‚—, liftLinear_applyβ‚€ _ ht, OuterMeasure.restrict_apply, coe_toOuterMeasure]
0.0625
import Mathlib.Topology.Order.MonotoneContinuity import Mathlib.Topology.Algebra.Order.LiminfLimsup import Mathlib.Topology.Instances.NNReal import Mathlib.Topology.EMetricSpace.Lipschitz import Mathlib.Topology.Metrizable.Basic import Mathlib.Topology.Order.T5 #align_import topology.instances.ennreal from "leanprover-community/mathlib"@"ec4b2eeb50364487f80421c0b4c41328a611f30d" noncomputable section open Set Filter Metric Function open scoped Classical Topology ENNReal NNReal Filter variable {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} namespace ENNReal variable {a b c d : ℝβ‰₯0∞} {r p q : ℝβ‰₯0} {x y z : ℝβ‰₯0∞} {Ξ΅ Ρ₁ Ξ΅β‚‚ : ℝβ‰₯0∞} {s : Set ℝβ‰₯0∞} section Liminf
Mathlib/Topology/Instances/ENNReal.lean
730
736
theorem exists_frequently_lt_of_liminf_ne_top {ΞΉ : Type*} {l : Filter ΞΉ} {x : ΞΉ β†’ ℝ} (hx : liminf (fun n => (Real.nnabs (x n) : ℝβ‰₯0∞)) l β‰  ∞) : βˆƒ R, βˆƒαΆ  n in l, x n < R := by
by_contra h simp_rw [not_exists, not_frequently, not_lt] at h refine hx (ENNReal.eq_top_of_forall_nnreal_le fun r => le_limsInf_of_le (by isBoundedDefault) ?_) simp only [eventually_map, ENNReal.coe_le_coe] filter_upwards [h r] with i hi using hi.trans (le_abs_self (x i))
0.0625
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Data.Fintype.Option import Mathlib.Data.Fintype.Pi import Mathlib.Data.Fintype.Sum #align_import combinatorics.hales_jewett from "leanprover-community/mathlib"@"1126441d6bccf98c81214a0780c73d499f6721fe" open scoped Classical universe u v namespace Combinatorics structure Line (Ξ± ΞΉ : Type*) where idxFun : ΞΉ β†’ Option Ξ± proper : βˆƒ i, idxFun i = none #align combinatorics.line Combinatorics.Line namespace Line -- This lets us treat a line `l : Line Ξ± ΞΉ` as a function `Ξ± β†’ ΞΉ β†’ Ξ±`. instance (Ξ± ΞΉ) : CoeFun (Line Ξ± ΞΉ) fun _ => Ξ± β†’ ΞΉ β†’ Ξ± := ⟨fun l x i => (l.idxFun i).getD x⟩ def IsMono {Ξ± ΞΉ ΞΊ} (C : (ΞΉ β†’ Ξ±) β†’ ΞΊ) (l : Line Ξ± ΞΉ) : Prop := βˆƒ c, βˆ€ x, C (l x) = c #align combinatorics.line.is_mono Combinatorics.Line.IsMono def diagonal (Ξ± ΞΉ) [Nonempty ΞΉ] : Line Ξ± ΞΉ where idxFun _ := none proper := ⟨Classical.arbitrary ΞΉ, rfl⟩ #align combinatorics.line.diagonal Combinatorics.Line.diagonal instance (Ξ± ΞΉ) [Nonempty ΞΉ] : Inhabited (Line Ξ± ΞΉ) := ⟨diagonal Ξ± ι⟩ structure AlmostMono {Ξ± ΞΉ ΞΊ : Type*} (C : (ΞΉ β†’ Option Ξ±) β†’ ΞΊ) where line : Line (Option Ξ±) ΞΉ color : ΞΊ has_color : βˆ€ x : Ξ±, C (line (some x)) = color #align combinatorics.line.almost_mono Combinatorics.Line.AlmostMono instance {Ξ± ΞΉ ΞΊ : Type*} [Nonempty ΞΉ] [Inhabited ΞΊ] : Inhabited (AlmostMono fun _ : ΞΉ β†’ Option Ξ± => (default : ΞΊ)) := ⟨{ line := default color := default has_color := fun _ ↦ rfl}⟩ structure ColorFocused {Ξ± ΞΉ ΞΊ : Type*} (C : (ΞΉ β†’ Option Ξ±) β†’ ΞΊ) where lines : Multiset (AlmostMono C) focus : ΞΉ β†’ Option Ξ± is_focused : βˆ€ p ∈ lines, p.line none = focus distinct_colors : (lines.map AlmostMono.color).Nodup #align combinatorics.line.color_focused Combinatorics.Line.ColorFocused instance {Ξ± ΞΉ ΞΊ} (C : (ΞΉ β†’ Option Ξ±) β†’ ΞΊ) : Inhabited (ColorFocused C) := by refine ⟨⟨0, fun _ => none, fun h => ?_, Multiset.nodup_zero⟩⟩ simp only [Multiset.not_mem_zero, IsEmpty.forall_iff] def map {Ξ± Ξ±' ΞΉ} (f : Ξ± β†’ Ξ±') (l : Line Ξ± ΞΉ) : Line Ξ±' ΞΉ where idxFun i := (l.idxFun i).map f proper := ⟨l.proper.choose, by simp only [l.proper.choose_spec, Option.map_none']⟩ #align combinatorics.line.map Combinatorics.Line.map def vertical {Ξ± ΞΉ ΞΉ'} (v : ΞΉ β†’ Ξ±) (l : Line Ξ± ΞΉ') : Line Ξ± (Sum ΞΉ ΞΉ') where idxFun := Sum.elim (some ∘ v) l.idxFun proper := ⟨Sum.inr l.proper.choose, l.proper.choose_spec⟩ #align combinatorics.line.vertical Combinatorics.Line.vertical def horizontal {Ξ± ΞΉ ΞΉ'} (l : Line Ξ± ΞΉ) (v : ΞΉ' β†’ Ξ±) : Line Ξ± (Sum ΞΉ ΞΉ') where idxFun := Sum.elim l.idxFun (some ∘ v) proper := ⟨Sum.inl l.proper.choose, l.proper.choose_spec⟩ #align combinatorics.line.horizontal Combinatorics.Line.horizontal def prod {Ξ± ΞΉ ΞΉ'} (l : Line Ξ± ΞΉ) (l' : Line Ξ± ΞΉ') : Line Ξ± (Sum ΞΉ ΞΉ') where idxFun := Sum.elim l.idxFun l'.idxFun proper := ⟨Sum.inl l.proper.choose, l.proper.choose_spec⟩ #align combinatorics.line.prod Combinatorics.Line.prod theorem apply {Ξ± ΞΉ} (l : Line Ξ± ΞΉ) (x : Ξ±) : l x = fun i => (l.idxFun i).getD x := rfl #align combinatorics.line.apply Combinatorics.Line.apply theorem apply_none {Ξ± ΞΉ} (l : Line Ξ± ΞΉ) (x : Ξ±) (i : ΞΉ) (h : l.idxFun i = none) : l x i = x := by simp only [Option.getD_none, h, l.apply] #align combinatorics.line.apply_none Combinatorics.Line.apply_none theorem apply_of_ne_none {Ξ± ΞΉ} (l : Line Ξ± ΞΉ) (x : Ξ±) (i : ΞΉ) (h : l.idxFun i β‰  none) : some (l x i) = l.idxFun i := by rw [l.apply, Option.getD_of_ne_none h] #align combinatorics.line.apply_of_ne_none Combinatorics.Line.apply_of_ne_none @[simp] theorem map_apply {Ξ± Ξ±' ΞΉ} (f : Ξ± β†’ Ξ±') (l : Line Ξ± ΞΉ) (x : Ξ±) : l.map f (f x) = f ∘ l x := by simp only [Line.apply, Line.map, Option.getD_map] rfl #align combinatorics.line.map_apply Combinatorics.Line.map_apply @[simp]
Mathlib/Combinatorics/HalesJewett.lean
190
193
theorem vertical_apply {Ξ± ΞΉ ΞΉ'} (v : ΞΉ β†’ Ξ±) (l : Line Ξ± ΞΉ') (x : Ξ±) : l.vertical v x = Sum.elim v (l x) := by
funext i cases i <;> rfl
0.0625
import Mathlib.Topology.Order.ProjIcc import Mathlib.Topology.CompactOpen import Mathlib.Topology.UnitInterval #align_import topology.path_connected from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Classical open Topology Filter unitInterval Set Function variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {x y z : X} {ΞΉ : Type*} -- porting note (#5171): removed @[nolint has_nonempty_instance] structure Path (x y : X) extends C(I, X) where source' : toFun 0 = x target' : toFun 1 = y #align path Path instance Path.funLike : FunLike (Path x y) I X where coe := fun Ξ³ ↦ ⇑γ.toContinuousMap coe_injective' := fun γ₁ Ξ³β‚‚ h => by simp only [DFunLike.coe_fn_eq] at h cases γ₁; cases Ξ³β‚‚; congr -- Porting note (#10754): added this instance so that we can use `FunLike.coe` for `CoeFun` -- this also fixed very strange `simp` timeout issues instance Path.continuousMapClass : ContinuousMapClass (Path x y) I X where map_continuous := fun Ξ³ => show Continuous Ξ³.toContinuousMap by continuity -- Porting note: not necessary in light of the instance above @[ext] protected theorem Path.ext : βˆ€ {γ₁ Ξ³β‚‚ : Path x y}, (γ₁ : I β†’ X) = Ξ³β‚‚ β†’ γ₁ = Ξ³β‚‚ := by rintro ⟨⟨x, h11⟩, h12, h13⟩ ⟨⟨x, h21⟩, h22, h23⟩ rfl rfl #align path.ext Path.ext namespace Path @[simp] theorem coe_mk_mk (f : I β†’ X) (h₁) (hβ‚‚ : f 0 = x) (h₃ : f 1 = y) : ⇑(mk ⟨f, hβ‚βŸ© hβ‚‚ h₃ : Path x y) = f := rfl #align path.coe_mk Path.coe_mk_mk -- Porting note: the name `Path.coe_mk` better refers to a new lemma below variable (Ξ³ : Path x y) @[continuity] protected theorem continuous : Continuous Ξ³ := Ξ³.continuous_toFun #align path.continuous Path.continuous @[simp] protected theorem source : Ξ³ 0 = x := Ξ³.source' #align path.source Path.source @[simp] protected theorem target : Ξ³ 1 = y := Ξ³.target' #align path.target Path.target def simps.apply : I β†’ X := Ξ³ #align path.simps.apply Path.simps.apply initialize_simps_projections Path (toFun β†’ simps.apply, -toContinuousMap) @[simp] theorem coe_toContinuousMap : ⇑γ.toContinuousMap = Ξ³ := rfl #align path.coe_to_continuous_map Path.coe_toContinuousMap -- Porting note: this is needed because of the `Path.continuousMapClass` instance @[simp] theorem coe_mk : ⇑(Ξ³ : C(I, X)) = Ξ³ := rfl instance hasUncurryPath {X Ξ± : Type*} [TopologicalSpace X] {x y : Ξ± β†’ X} : HasUncurry (βˆ€ a : Ξ±, Path (x a) (y a)) (Ξ± Γ— I) X := ⟨fun Ο† p => Ο† p.1 p.2⟩ #align path.has_uncurry_path Path.hasUncurryPath @[refl, simps] def refl (x : X) : Path x x where toFun _t := x continuous_toFun := continuous_const source' := rfl target' := rfl #align path.refl Path.refl @[simp] theorem refl_range {a : X} : range (Path.refl a) = {a} := by simp [Path.refl, CoeFun.coe] #align path.refl_range Path.refl_range @[symm, simps] def symm (Ξ³ : Path x y) : Path y x where toFun := Ξ³ ∘ Οƒ continuous_toFun := by continuity source' := by simpa [-Path.target] using Ξ³.target target' := by simpa [-Path.source] using Ξ³.source #align path.symm Path.symm @[simp] theorem symm_symm (Ξ³ : Path x y) : Ξ³.symm.symm = Ξ³ := by ext t show Ξ³ (Οƒ (Οƒ t)) = Ξ³ t rw [unitInterval.symm_symm] #align path.symm_symm Path.symm_symm theorem symm_bijective : Function.Bijective (Path.symm : Path x y β†’ Path y x) := Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩ @[simp] theorem refl_symm {a : X} : (Path.refl a).symm = Path.refl a := by ext rfl #align path.refl_symm Path.refl_symm @[simp]
Mathlib/Topology/Connected/PathConnected.lean
194
200
theorem symm_range {a b : X} (Ξ³ : Path a b) : range Ξ³.symm = range Ξ³ := by
ext x simp only [mem_range, Path.symm, DFunLike.coe, unitInterval.symm, SetCoe.exists, comp_apply, Subtype.coe_mk] constructor <;> rintro ⟨y, hy, hxy⟩ <;> refine ⟨1 - y, mem_iff_one_sub_mem.mp hy, ?_⟩ <;> convert hxy simp
0.0625
import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence import Mathlib.Algebra.ContinuedFractions.TerminatedStable import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.Ring #align_import algebra.continued_fractions.convergents_equiv from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" variable {K : Type*} {n : β„•} namespace GeneralizedContinuedFraction variable {g : GeneralizedContinuedFraction K} {s : Stream'.Seq <| Pair K} section Squash section WithDivisionRing variable [DivisionRing K] def squashSeq (s : Stream'.Seq <| Pair K) (n : β„•) : Stream'.Seq (Pair K) := match Prod.mk (s.get? n) (s.get? (n + 1)) with | ⟨some gp_n, some gp_succ_n⟩ => Stream'.Seq.nats.zipWith -- return the squashed value at position `n`; otherwise, do nothing. (fun n' gp => if n' = n then ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ else gp) s | _ => s #align generalized_continued_fraction.squash_seq GeneralizedContinuedFraction.squashSeq theorem squashSeq_eq_self_of_terminated (terminated_at_succ_n : s.TerminatedAt (n + 1)) : squashSeq s n = s := by change s.get? (n + 1) = none at terminated_at_succ_n cases s_nth_eq : s.get? n <;> simp only [*, squashSeq] #align generalized_continued_fraction.squash_seq_eq_self_of_terminated GeneralizedContinuedFraction.squashSeq_eq_self_of_terminated
Mathlib/Algebra/ContinuedFractions/ConvergentsEquiv.lean
114
117
theorem squashSeq_nth_of_not_terminated {gp_n gp_succ_n : Pair K} (s_nth_eq : s.get? n = some gp_n) (s_succ_nth_eq : s.get? (n + 1) = some gp_succ_n) : (squashSeq s n).get? n = some ⟨gp_n.a, gp_n.b + gp_succ_n.a / gp_succ_n.b⟩ := by
simp [*, squashSeq]
0.0625
import Mathlib.Data.Nat.Defs import Mathlib.Data.Option.Basic import Mathlib.Data.List.Defs import Mathlib.Init.Data.List.Basic import Mathlib.Init.Data.List.Instances import Mathlib.Init.Data.List.Lemmas import Mathlib.Logic.Unique import Mathlib.Order.Basic import Mathlib.Tactic.Common #align_import data.list.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83" assert_not_exists Set.range assert_not_exists GroupWithZero assert_not_exists Ring open Function open Nat hiding one_pos namespace List universe u v w variable {ΞΉ : Type*} {Ξ± : Type u} {Ξ² : Type v} {Ξ³ : Type w} {l₁ lβ‚‚ : List Ξ±} -- Porting note: Delete this attribute -- attribute [inline] List.head! instance uniqueOfIsEmpty [IsEmpty Ξ±] : Unique (List Ξ±) := { instInhabitedList with uniq := fun l => match l with | [] => rfl | a :: _ => isEmptyElim a } #align list.unique_of_is_empty List.uniqueOfIsEmpty instance : Std.LawfulIdentity (Ξ± := List Ξ±) Append.append [] where left_id := nil_append right_id := append_nil instance : Std.Associative (Ξ± := List Ξ±) Append.append where assoc := append_assoc #align list.cons_ne_nil List.cons_ne_nil #align list.cons_ne_self List.cons_ne_self #align list.head_eq_of_cons_eq List.head_eq_of_cons_eqβ‚“ -- implicits order #align list.tail_eq_of_cons_eq List.tail_eq_of_cons_eqβ‚“ -- implicits order @[simp] theorem cons_injective {a : Ξ±} : Injective (cons a) := fun _ _ => tail_eq_of_cons_eq #align list.cons_injective List.cons_injective #align list.cons_inj List.cons_inj #align list.cons_eq_cons List.cons_eq_cons theorem singleton_injective : Injective fun a : Ξ± => [a] := fun _ _ h => (cons_eq_cons.1 h).1 #align list.singleton_injective List.singleton_injective theorem singleton_inj {a b : Ξ±} : [a] = [b] ↔ a = b := singleton_injective.eq_iff #align list.singleton_inj List.singleton_inj #align list.exists_cons_of_ne_nil List.exists_cons_of_ne_nil theorem set_of_mem_cons (l : List Ξ±) (a : Ξ±) : { x | x ∈ a :: l } = insert a { x | x ∈ l } := Set.ext fun _ => mem_cons #align list.set_of_mem_cons List.set_of_mem_cons #align list.mem_singleton_self List.mem_singleton_self #align list.eq_of_mem_singleton List.eq_of_mem_singleton #align list.mem_singleton List.mem_singleton #align list.mem_of_mem_cons_of_mem List.mem_of_mem_cons_of_mem
Mathlib/Data/List/Basic.lean
87
91
theorem _root_.Decidable.List.eq_or_ne_mem_of_mem [DecidableEq Ξ±] {a b : Ξ±} {l : List Ξ±} (h : a ∈ b :: l) : a = b ∨ a β‰  b ∧ a ∈ l := by
by_cases hab : a = b · exact Or.inl hab · exact ((List.mem_cons.1 h).elim Or.inl (fun h => Or.inr ⟨hab, h⟩))
0.0625
import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Order.Group.Basic import Mathlib.Algebra.Order.Ring.Basic import Mathlib.RingTheory.Localization.Basic import Mathlib.SetTheory.Game.Birthday import Mathlib.SetTheory.Surreal.Basic #align_import set_theory.surreal.dyadic from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u namespace SetTheory namespace PGame def powHalf : β„• β†’ PGame | 0 => 1 | n + 1 => ⟨PUnit, PUnit, 0, fun _ => powHalf n⟩ #align pgame.pow_half SetTheory.PGame.powHalf @[simp] theorem powHalf_zero : powHalf 0 = 1 := rfl #align pgame.pow_half_zero SetTheory.PGame.powHalf_zero theorem powHalf_leftMoves (n) : (powHalf n).LeftMoves = PUnit := by cases n <;> rfl #align pgame.pow_half_left_moves SetTheory.PGame.powHalf_leftMoves theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty := rfl #align pgame.pow_half_zero_right_moves SetTheory.PGame.powHalf_zero_rightMoves theorem powHalf_succ_rightMoves (n) : (powHalf (n + 1)).RightMoves = PUnit := rfl #align pgame.pow_half_succ_right_moves SetTheory.PGame.powHalf_succ_rightMoves @[simp] theorem powHalf_moveLeft (n i) : (powHalf n).moveLeft i = 0 := by cases n <;> cases i <;> rfl #align pgame.pow_half_move_left SetTheory.PGame.powHalf_moveLeft @[simp] theorem powHalf_succ_moveRight (n i) : (powHalf (n + 1)).moveRight i = powHalf n := rfl #align pgame.pow_half_succ_move_right SetTheory.PGame.powHalf_succ_moveRight instance uniquePowHalfLeftMoves (n) : Unique (powHalf n).LeftMoves := by cases n <;> exact PUnit.unique #align pgame.unique_pow_half_left_moves SetTheory.PGame.uniquePowHalfLeftMoves instance isEmpty_powHalf_zero_rightMoves : IsEmpty (powHalf 0).RightMoves := inferInstanceAs (IsEmpty PEmpty) #align pgame.is_empty_pow_half_zero_right_moves SetTheory.PGame.isEmpty_powHalf_zero_rightMoves instance uniquePowHalfSuccRightMoves (n) : Unique (powHalf (n + 1)).RightMoves := PUnit.unique #align pgame.unique_pow_half_succ_right_moves SetTheory.PGame.uniquePowHalfSuccRightMoves @[simp]
Mathlib/SetTheory/Surreal/Dyadic.lean
85
86
theorem birthday_half : birthday (powHalf 1) = 2 := by
rw [birthday_def]; simp
0.0625
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp]
Mathlib/Data/Real/GoldenRatio.lean
70
72
theorem gold_add_goldConj : Ο† + ψ = 1 := by
rw [goldenRatio, goldenConj] ring
0.0625
import Mathlib.Data.Matrix.Basic import Mathlib.Data.PEquiv #align_import data.matrix.pequiv from "leanprover-community/mathlib"@"3e068ece210655b7b9a9477c3aff38a492400aa1" namespace PEquiv open Matrix universe u v variable {k l m n : Type*} variable {Ξ± : Type v} open Matrix def toMatrix [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) : Matrix m n Ξ± := of fun i j => if j ∈ f i then (1 : Ξ±) else 0 #align pequiv.to_matrix PEquiv.toMatrix -- TODO: set as an equation lemma for `toMatrix`, see mathlib4#3024 @[simp] theorem toMatrix_apply [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) (i j) : toMatrix f i j = if j ∈ f i then (1 : Ξ±) else 0 := rfl #align pequiv.to_matrix_apply PEquiv.toMatrix_apply theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : l ≃. m) (M : Matrix m n Ξ±) (i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j := by dsimp [toMatrix, Matrix.mul_apply] cases' h : f i with fi Β· simp [h] Β· rw [Finset.sum_eq_single fi] <;> simp (config := { contextual := true }) [h, eq_comm] #align pequiv.mul_matrix_apply PEquiv.mul_matrix_apply theorem toMatrix_symm [DecidableEq m] [DecidableEq n] [Zero Ξ±] [One Ξ±] (f : m ≃. n) : (f.symm.toMatrix : Matrix n m Ξ±) = f.toMatrixα΅€ := by ext simp only [transpose, mem_iff_mem f, toMatrix_apply] congr #align pequiv.to_matrix_symm PEquiv.toMatrix_symm @[simp] theorem toMatrix_refl [DecidableEq n] [Zero Ξ±] [One Ξ±] : ((PEquiv.refl n).toMatrix : Matrix n n Ξ±) = 1 := by ext simp [toMatrix_apply, one_apply] #align pequiv.to_matrix_refl PEquiv.toMatrix_refl theorem matrix_mul_apply [Fintype m] [Semiring Ξ±] [DecidableEq n] (M : Matrix l m Ξ±) (f : m ≃. n) (i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj := by dsimp [toMatrix, Matrix.mul_apply] cases' h : f.symm j with fj Β· simp [h, ← f.eq_some_iff] Β· rw [Finset.sum_eq_single fj] Β· simp [h, ← f.eq_some_iff] Β· rintro b - n simp [h, ← f.eq_some_iff, n.symm] Β· simp #align pequiv.matrix_mul_apply PEquiv.matrix_mul_apply
Mathlib/Data/Matrix/PEquiv.lean
96
99
theorem toPEquiv_mul_matrix [Fintype m] [DecidableEq m] [Semiring Ξ±] (f : m ≃ m) (M : Matrix m n Ξ±) : f.toPEquiv.toMatrix * M = M.submatrix f id := by
ext i j rw [mul_matrix_apply, Equiv.toPEquiv_apply, submatrix_apply, id]
0.0625
import Mathlib.Algebra.Order.Monoid.Unbundled.MinMax import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Finset.Image import Mathlib.Data.Multiset.Fold #align_import data.finset.fold from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" -- TODO: -- assert_not_exists OrderedCommMonoid assert_not_exists MonoidWithZero namespace Finset open Multiset variable {Ξ± Ξ² Ξ³ : Type*} section Fold variable (op : Ξ² β†’ Ξ² β†’ Ξ²) [hc : Std.Commutative op] [ha : Std.Associative op] local notation a " * " b => op a b def fold (b : Ξ²) (f : Ξ± β†’ Ξ²) (s : Finset Ξ±) : Ξ² := (s.1.map f).fold op b #align finset.fold Finset.fold variable {op} {f : Ξ± β†’ Ξ²} {b : Ξ²} {s : Finset Ξ±} {a : Ξ±} @[simp] theorem fold_empty : (βˆ… : Finset Ξ±).fold op b f = b := rfl #align finset.fold_empty Finset.fold_empty @[simp]
Mathlib/Data/Finset/Fold.lean
50
52
theorem fold_cons (h : a βˆ‰ s) : (cons a s h).fold op b f = f a * s.fold op b f := by
dsimp only [fold] rw [cons_val, Multiset.map_cons, fold_cons_left]
0.0625
import Mathlib.LinearAlgebra.Dimension.Free import Mathlib.Algebra.Module.Torsion #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe u v v' u₁' w w' variable {R S : Type u} {M : Type v} {M' : Type v'} {M₁ : Type v} variable {ΞΉ : Type w} {ΞΉ' : Type w'} {Ξ· : Type u₁'} {Ο† : Ξ· β†’ Type*} open Cardinal Basis Submodule Function Set FiniteDimensional DirectSum variable [Ring R] [CommRing S] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] section Finsupp variable (R M M') variable [StrongRankCondition R] [Module.Free R M] [Module.Free R M'] open Module.Free @[simp] theorem rank_finsupp (ΞΉ : Type w) : Module.rank R (ΞΉ β†’β‚€ M) = Cardinal.lift.{v} #ΞΉ * Cardinal.lift.{w} (Module.rank R M) := by obtain ⟨⟨_, bs⟩⟩ := Module.Free.exists_basis (R := R) (M := M) rw [← bs.mk_eq_rank'', ← (Finsupp.basis fun _ : ΞΉ => bs).mk_eq_rank'', Cardinal.mk_sigma, Cardinal.sum_const] #align rank_finsupp rank_finsupp theorem rank_finsupp' (ΞΉ : Type v) : Module.rank R (ΞΉ β†’β‚€ M) = #ΞΉ * Module.rank R M := by simp [rank_finsupp] #align rank_finsupp' rank_finsupp' -- Porting note, this should not be `@[simp]`, as simp can prove it. -- @[simp] theorem rank_finsupp_self (ΞΉ : Type w) : Module.rank R (ΞΉ β†’β‚€ R) = Cardinal.lift.{u} #ΞΉ := by simp [rank_finsupp] #align rank_finsupp_self rank_finsupp_self theorem rank_finsupp_self' {ΞΉ : Type u} : Module.rank R (ΞΉ β†’β‚€ R) = #ΞΉ := by simp #align rank_finsupp_self' rank_finsupp_self' @[simp] theorem rank_directSum {ΞΉ : Type v} (M : ΞΉ β†’ Type w) [βˆ€ i : ΞΉ, AddCommGroup (M i)] [βˆ€ i : ΞΉ, Module R (M i)] [βˆ€ i : ΞΉ, Module.Free R (M i)] : Module.rank R (⨁ i, M i) = Cardinal.sum fun i => Module.rank R (M i) := by let B i := chooseBasis R (M i) let b : Basis _ R (⨁ i, M i) := DFinsupp.basis fun i => B i simp [← b.mk_eq_rank'', fun i => (B i).mk_eq_rank''] #align rank_direct_sum rank_directSum @[simp] theorem rank_matrix (m : Type v) (n : Type w) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = Cardinal.lift.{max v w u, v} #m * Cardinal.lift.{max v w u, w} #n := by cases nonempty_fintype m cases nonempty_fintype n have h := (Matrix.stdBasis R m n).mk_eq_rank rw [← lift_lift.{max v w u, max v w}, lift_inj] at h simpa using h.symm #align rank_matrix rank_matrix @[simp high] theorem rank_matrix' (m n : Type v) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = Cardinal.lift.{u} (#m * #n) := by rw [rank_matrix, lift_mul, lift_umax.{v, u}] #align rank_matrix' rank_matrix' -- @[simp] -- Porting note (#10618): simp can prove this theorem rank_matrix'' (m n : Type u) [Finite m] [Finite n] : Module.rank R (Matrix m n R) = #m * #n := by simp #align rank_matrix'' rank_matrix'' variable [Module.Finite R M] [Module.Finite R M'] open Fintype section SubalgebraRank open Module variable {F E : Type*} [CommRing F] [Ring E] [Algebra F E] @[simp] theorem Subalgebra.rank_toSubmodule (S : Subalgebra F E) : Module.rank F (Subalgebra.toSubmodule S) = Module.rank F S := rfl #align subalgebra.rank_to_submodule Subalgebra.rank_toSubmodule @[simp] theorem Subalgebra.finrank_toSubmodule (S : Subalgebra F E) : finrank F (Subalgebra.toSubmodule S) = finrank F S := rfl #align subalgebra.finrank_to_submodule Subalgebra.finrank_toSubmodule
Mathlib/LinearAlgebra/Dimension/Constructions.lean
538
541
theorem subalgebra_top_rank_eq_submodule_top_rank : Module.rank F (⊀ : Subalgebra F E) = Module.rank F (⊀ : Submodule F E) := by
rw [← Algebra.top_toSubmodule] rfl
0.0625
import Mathlib.Order.Filter.Bases #align_import order.filter.pi from "leanprover-community/mathlib"@"ce64cd319bb6b3e82f31c2d38e79080d377be451" open Set Function open scoped Classical open Filter namespace Filter variable {ΞΉ : Type*} {Ξ± : ΞΉ β†’ Type*} {f f₁ fβ‚‚ : (i : ΞΉ) β†’ Filter (Ξ± i)} {s : (i : ΞΉ) β†’ Set (Ξ± i)} {p : βˆ€ i, Ξ± i β†’ Prop} section CoprodCat -- for "Coprod" set_option linter.uppercaseLean3 false protected def coprodα΅’ (f : βˆ€ i, Filter (Ξ± i)) : Filter (βˆ€ i, Ξ± i) := ⨆ i : ΞΉ, comap (eval i) (f i) #align filter.Coprod Filter.coprodα΅’ theorem mem_coprodα΅’_iff {s : Set (βˆ€ i, Ξ± i)} : s ∈ Filter.coprodα΅’ f ↔ βˆ€ i : ΞΉ, βˆƒ t₁ ∈ f i, eval i ⁻¹' t₁ βŠ† s := by simp [Filter.coprodα΅’] #align filter.mem_Coprod_iff Filter.mem_coprodα΅’_iff
Mathlib/Order/Filter/Pi.lean
233
235
theorem compl_mem_coprodα΅’ {s : Set (βˆ€ i, Ξ± i)} : sᢜ ∈ Filter.coprodα΅’ f ↔ βˆ€ i, (eval i '' s)ᢜ ∈ f i := by
simp only [Filter.coprodα΅’, mem_iSup, compl_mem_comap]
0.0625
import Mathlib.Analysis.NormedSpace.ContinuousAffineMap import Mathlib.Analysis.Calculus.ContDiff.Basic #align_import analysis.calculus.affine_map from "leanprover-community/mathlib"@"839b92fedff9981cf3fe1c1f623e04b0d127f57c" namespace ContinuousAffineMap variable {π•œ V W : Type*} [NontriviallyNormedField π•œ] variable [NormedAddCommGroup V] [NormedSpace π•œ V] variable [NormedAddCommGroup W] [NormedSpace π•œ W]
Mathlib/Analysis/Calculus/AffineMap.lean
30
33
theorem contDiff {n : β„•βˆž} (f : V →ᴬ[π•œ] W) : ContDiff π•œ n f := by
rw [f.decomp] apply f.contLinear.contDiff.add exact contDiff_const
0.0625
import Mathlib.Data.Finset.Pointwise #align_import combinatorics.additive.e_transform from "leanprover-community/mathlib"@"207c92594599a06e7c134f8d00a030a83e6c7259" open MulOpposite open Pointwise variable {Ξ± : Type*} [DecidableEq Ξ±] namespace Finset section CommGroup variable [CommGroup Ξ±] (e : Ξ±) (x : Finset Ξ± Γ— Finset Ξ±) @[to_additive (attr := simps) "The **Dyson e-transform**. Turns `(s, t)` into `(s βˆͺ e +α΅₯ t, t ∩ -e +α΅₯ s)`. This reduces the sum of the two sets."] def mulDysonETransform : Finset Ξ± Γ— Finset Ξ± := (x.1 βˆͺ e β€’ x.2, x.2 ∩ e⁻¹ β€’ x.1) #align finset.mul_dyson_e_transform Finset.mulDysonETransform #align finset.add_dyson_e_transform Finset.addDysonETransform @[to_additive] theorem mulDysonETransform.subset : (mulDysonETransform e x).1 * (mulDysonETransform e x).2 βŠ† x.1 * x.2 := by refine union_mul_inter_subset_union.trans (union_subset Subset.rfl ?_) rw [mul_smul_comm, smul_mul_assoc, inv_smul_smul, mul_comm] #align finset.mul_dyson_e_transform.subset Finset.mulDysonETransform.subset #align finset.add_dyson_e_transform.subset Finset.addDysonETransform.subset @[to_additive] theorem mulDysonETransform.card : (mulDysonETransform e x).1.card + (mulDysonETransform e x).2.card = x.1.card + x.2.card := by dsimp rw [← card_smul_finset e (_ ∩ _), smul_finset_inter, smul_inv_smul, inter_comm, card_union_add_card_inter, card_smul_finset] #align finset.mul_dyson_e_transform.card Finset.mulDysonETransform.card #align finset.add_dyson_e_transform.card Finset.addDysonETransform.card @[to_additive (attr := simp)] theorem mulDysonETransform_idem : mulDysonETransform e (mulDysonETransform e x) = mulDysonETransform e x := by ext : 1 <;> dsimp Β· rw [smul_finset_inter, smul_inv_smul, inter_comm, union_eq_left] exact inter_subset_union Β· rw [smul_finset_union, inv_smul_smul, union_comm, inter_eq_left] exact inter_subset_union #align finset.mul_dyson_e_transform_idem Finset.mulDysonETransform_idem #align finset.add_dyson_e_transform_idem Finset.addDysonETransform_idem variable {e x} @[to_additive]
Mathlib/Combinatorics/Additive/ETransform.lean
88
92
theorem mulDysonETransform.smul_finset_snd_subset_fst : e β€’ (mulDysonETransform e x).2 βŠ† (mulDysonETransform e x).1 := by
dsimp rw [smul_finset_inter, smul_inv_smul, inter_comm] exact inter_subset_union
0.0625
import Mathlib.ModelTheory.Substructures #align_import model_theory.finitely_generated from "leanprover-community/mathlib"@"0602c59878ff3d5f71dea69c2d32ccf2e93e5398" open FirstOrder Set namespace FirstOrder namespace Language open Structure variable {L : Language} {M : Type*} [L.Structure M] namespace Substructure def FG (N : L.Substructure M) : Prop := βˆƒ S : Finset M, closure L S = N #align first_order.language.substructure.fg FirstOrder.Language.Substructure.FG theorem fg_def {N : L.Substructure M} : N.FG ↔ βˆƒ S : Set M, S.Finite ∧ closure L S = N := ⟨fun ⟨t, h⟩ => ⟨_, Finset.finite_toSet t, h⟩, by rintro ⟨t', h, rfl⟩ rcases Finite.exists_finset_coe h with ⟨t, rfl⟩ exact ⟨t, rfl⟩⟩ #align first_order.language.substructure.fg_def FirstOrder.Language.Substructure.fg_def theorem fg_iff_exists_fin_generating_family {N : L.Substructure M} : N.FG ↔ βˆƒ (n : β„•) (s : Fin n β†’ M), closure L (range s) = N := by rw [fg_def] constructor Β· rintro ⟨S, Sfin, hS⟩ obtain ⟨n, f, rfl⟩ := Sfin.fin_embedding exact ⟨n, f, hS⟩ Β· rintro ⟨n, s, hs⟩ exact ⟨range s, finite_range s, hs⟩ #align first_order.language.substructure.fg_iff_exists_fin_generating_family FirstOrder.Language.Substructure.fg_iff_exists_fin_generating_family theorem fg_bot : (βŠ₯ : L.Substructure M).FG := βŸ¨βˆ…, by rw [Finset.coe_empty, closure_empty]⟩ #align first_order.language.substructure.fg_bot FirstOrder.Language.Substructure.fg_bot theorem fg_closure {s : Set M} (hs : s.Finite) : FG (closure L s) := ⟨hs.toFinset, by rw [hs.coe_toFinset]⟩ #align first_order.language.substructure.fg_closure FirstOrder.Language.Substructure.fg_closure theorem fg_closure_singleton (x : M) : FG (closure L ({x} : Set M)) := fg_closure (finite_singleton x) #align first_order.language.substructure.fg_closure_singleton FirstOrder.Language.Substructure.fg_closure_singleton theorem FG.sup {N₁ Nβ‚‚ : L.Substructure M} (hN₁ : N₁.FG) (hNβ‚‚ : Nβ‚‚.FG) : (N₁ βŠ” Nβ‚‚).FG := let ⟨t₁, htβ‚βŸ© := fg_def.1 hN₁ let ⟨tβ‚‚, htβ‚‚βŸ© := fg_def.1 hNβ‚‚ fg_def.2 ⟨t₁ βˆͺ tβ‚‚, ht₁.1.union htβ‚‚.1, by rw [closure_union, ht₁.2, htβ‚‚.2]⟩ #align first_order.language.substructure.fg.sup FirstOrder.Language.Substructure.FG.sup theorem FG.map {N : Type*} [L.Structure N] (f : M β†’[L] N) {s : L.Substructure M} (hs : s.FG) : (s.map f).FG := let ⟨t, ht⟩ := fg_def.1 hs fg_def.2 ⟨f '' t, ht.1.image _, by rw [closure_image, ht.2]⟩ #align first_order.language.substructure.fg.map FirstOrder.Language.Substructure.FG.map theorem FG.of_map_embedding {N : Type*} [L.Structure N] (f : M β†ͺ[L] N) {s : L.Substructure M} (hs : (s.map f.toHom).FG) : s.FG := by rcases hs with ⟨t, h⟩ rw [fg_def] refine ⟨f ⁻¹' t, t.finite_toSet.preimage f.injective.injOn, ?_⟩ have hf : Function.Injective f.toHom := f.injective refine map_injective_of_injective hf ?_ rw [← h, map_closure, Embedding.coe_toHom, image_preimage_eq_of_subset] intro x hx have h' := subset_closure (L := L) hx rw [h] at h' exact Hom.map_le_range h' #align first_order.language.substructure.fg.of_map_embedding FirstOrder.Language.Substructure.FG.of_map_embedding def CG (N : L.Substructure M) : Prop := βˆƒ S : Set M, S.Countable ∧ closure L S = N #align first_order.language.substructure.cg FirstOrder.Language.Substructure.CG theorem cg_def {N : L.Substructure M} : N.CG ↔ βˆƒ S : Set M, S.Countable ∧ closure L S = N := Iff.refl _ #align first_order.language.substructure.cg_def FirstOrder.Language.Substructure.cg_def
Mathlib/ModelTheory/FinitelyGenerated.lean
111
113
theorem FG.cg {N : L.Substructure M} (h : N.FG) : N.CG := by
obtain ⟨s, hf, rfl⟩ := fg_def.1 h exact ⟨s, hf.countable, rfl⟩
0.0625
import Mathlib.Analysis.Asymptotics.AsymptoticEquivalent import Mathlib.Analysis.Calculus.FDeriv.Linear import Mathlib.Analysis.Calculus.FDeriv.Comp #align_import analysis.calculus.fderiv.equiv from "leanprover-community/mathlib"@"e3fb84046afd187b710170887195d50bada934ee" open Filter Asymptotics ContinuousLinearMap Set Metric open scoped Classical open Topology NNReal Filter Asymptotics ENNReal noncomputable section section variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type*} [NormedAddCommGroup F] [NormedSpace π•œ F] variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] variable {G' : Type*} [NormedAddCommGroup G'] [NormedSpace π•œ G'] variable {f fβ‚€ f₁ g : E β†’ F} variable {f' fβ‚€' f₁' g' : E β†’L[π•œ] F} variable (e : E β†’L[π•œ] F) variable {x : E} variable {s t : Set E} variable {L L₁ Lβ‚‚ : Filter E} namespace ContinuousLinearEquiv variable (iso : E ≃L[π•œ] F) @[fun_prop] protected theorem hasStrictFDerivAt : HasStrictFDerivAt iso (iso : E β†’L[π•œ] F) x := iso.toContinuousLinearMap.hasStrictFDerivAt #align continuous_linear_equiv.has_strict_fderiv_at ContinuousLinearEquiv.hasStrictFDerivAt @[fun_prop] protected theorem hasFDerivWithinAt : HasFDerivWithinAt iso (iso : E β†’L[π•œ] F) s x := iso.toContinuousLinearMap.hasFDerivWithinAt #align continuous_linear_equiv.has_fderiv_within_at ContinuousLinearEquiv.hasFDerivWithinAt @[fun_prop] protected theorem hasFDerivAt : HasFDerivAt iso (iso : E β†’L[π•œ] F) x := iso.toContinuousLinearMap.hasFDerivAtFilter #align continuous_linear_equiv.has_fderiv_at ContinuousLinearEquiv.hasFDerivAt @[fun_prop] protected theorem differentiableAt : DifferentiableAt π•œ iso x := iso.hasFDerivAt.differentiableAt #align continuous_linear_equiv.differentiable_at ContinuousLinearEquiv.differentiableAt @[fun_prop] protected theorem differentiableWithinAt : DifferentiableWithinAt π•œ iso s x := iso.differentiableAt.differentiableWithinAt #align continuous_linear_equiv.differentiable_within_at ContinuousLinearEquiv.differentiableWithinAt protected theorem fderiv : fderiv π•œ iso x = iso := iso.hasFDerivAt.fderiv #align continuous_linear_equiv.fderiv ContinuousLinearEquiv.fderiv protected theorem fderivWithin (hxs : UniqueDiffWithinAt π•œ s x) : fderivWithin π•œ iso s x = iso := iso.toContinuousLinearMap.fderivWithin hxs #align continuous_linear_equiv.fderiv_within ContinuousLinearEquiv.fderivWithin @[fun_prop] protected theorem differentiable : Differentiable π•œ iso := fun _ => iso.differentiableAt #align continuous_linear_equiv.differentiable ContinuousLinearEquiv.differentiable @[fun_prop] protected theorem differentiableOn : DifferentiableOn π•œ iso s := iso.differentiable.differentiableOn #align continuous_linear_equiv.differentiable_on ContinuousLinearEquiv.differentiableOn theorem comp_differentiableWithinAt_iff {f : G β†’ E} {s : Set G} {x : G} : DifferentiableWithinAt π•œ (iso ∘ f) s x ↔ DifferentiableWithinAt π•œ f s x := by refine ⟨fun H => ?_, fun H => iso.differentiable.differentiableAt.comp_differentiableWithinAt x H⟩ have : DifferentiableWithinAt π•œ (iso.symm ∘ iso ∘ f) s x := iso.symm.differentiable.differentiableAt.comp_differentiableWithinAt x H rwa [← Function.comp.assoc iso.symm iso f, iso.symm_comp_self] at this #align continuous_linear_equiv.comp_differentiable_within_at_iff ContinuousLinearEquiv.comp_differentiableWithinAt_iff theorem comp_differentiableAt_iff {f : G β†’ E} {x : G} : DifferentiableAt π•œ (iso ∘ f) x ↔ DifferentiableAt π•œ f x := by rw [← differentiableWithinAt_univ, ← differentiableWithinAt_univ, iso.comp_differentiableWithinAt_iff] #align continuous_linear_equiv.comp_differentiable_at_iff ContinuousLinearEquiv.comp_differentiableAt_iff theorem comp_differentiableOn_iff {f : G β†’ E} {s : Set G} : DifferentiableOn π•œ (iso ∘ f) s ↔ DifferentiableOn π•œ f s := by rw [DifferentiableOn, DifferentiableOn] simp only [iso.comp_differentiableWithinAt_iff] #align continuous_linear_equiv.comp_differentiable_on_iff ContinuousLinearEquiv.comp_differentiableOn_iff theorem comp_differentiable_iff {f : G β†’ E} : Differentiable π•œ (iso ∘ f) ↔ Differentiable π•œ f := by rw [← differentiableOn_univ, ← differentiableOn_univ] exact iso.comp_differentiableOn_iff #align continuous_linear_equiv.comp_differentiable_iff ContinuousLinearEquiv.comp_differentiable_iff
Mathlib/Analysis/Calculus/FDeriv/Equiv.lean
121
130
theorem comp_hasFDerivWithinAt_iff {f : G β†’ E} {s : Set G} {x : G} {f' : G β†’L[π•œ] E} : HasFDerivWithinAt (iso ∘ f) ((iso : E β†’L[π•œ] F).comp f') s x ↔ HasFDerivWithinAt f f' s x := by
refine ⟨fun H => ?_, fun H => iso.hasFDerivAt.comp_hasFDerivWithinAt x H⟩ have A : f = iso.symm ∘ iso ∘ f := by rw [← Function.comp.assoc, iso.symm_comp_self] rfl have B : f' = (iso.symm : F β†’L[π•œ] E).comp ((iso : E β†’L[π•œ] F).comp f') := by rw [← ContinuousLinearMap.comp_assoc, iso.coe_symm_comp_coe, ContinuousLinearMap.id_comp] rw [A, B] exact iso.symm.hasFDerivAt.comp_hasFDerivWithinAt x H
0.0625
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.FieldTheory.Finite.Basic import Mathlib.Data.Matrix.CharP #align_import linear_algebra.matrix.charpoly.finite_field from "leanprover-community/mathlib"@"b95b8c7a484a298228805c72c142f6b062eb0d70" noncomputable section open Polynomial Matrix open scoped Polynomial variable {n : Type*} [DecidableEq n] [Fintype n] @[simp] theorem FiniteField.Matrix.charpoly_pow_card {K : Type*} [Field K] [Fintype K] (M : Matrix n n K) : (M ^ Fintype.card K).charpoly = M.charpoly := by cases (isEmpty_or_nonempty n).symm Β· cases' CharP.exists K with p hp; letI := hp rcases FiniteField.card K p with ⟨⟨k, kpos⟩, ⟨hp, hk⟩⟩ haveI : Fact p.Prime := ⟨hp⟩ dsimp at hk; rw [hk] apply (frobenius_inj K[X] p).iterate k repeat' rw [iterate_frobenius (R := K[X])]; rw [← hk] rw [← FiniteField.expand_card] unfold charpoly rw [AlgHom.map_det, ← coe_detMonoidHom, ← (detMonoidHom : Matrix n n K[X] β†’* K[X]).map_pow] apply congr_arg det refine matPolyEquiv.injective ?_ rw [AlgEquiv.map_pow, matPolyEquiv_charmatrix, hk, sub_pow_char_pow_of_commute, ← C_pow] Β· exact (id (matPolyEquiv_eq_X_pow_sub_C (p ^ k) M) : _) Β· exact (C M).commute_X Β· exact congr_arg _ (Subsingleton.elim _ _) #align finite_field.matrix.charpoly_pow_card FiniteField.Matrix.charpoly_pow_card @[simp] theorem ZMod.charpoly_pow_card {p : β„•} [Fact p.Prime] (M : Matrix n n (ZMod p)) : (M ^ p).charpoly = M.charpoly := by have h := FiniteField.Matrix.charpoly_pow_card M rwa [ZMod.card] at h #align zmod.charpoly_pow_card ZMod.charpoly_pow_card
Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean
53
58
theorem FiniteField.trace_pow_card {K : Type*} [Field K] [Fintype K] (M : Matrix n n K) : trace (M ^ Fintype.card K) = trace M ^ Fintype.card K := by
cases isEmpty_or_nonempty n Β· simp [Matrix.trace] rw [Matrix.trace_eq_neg_charpoly_coeff, Matrix.trace_eq_neg_charpoly_coeff, FiniteField.Matrix.charpoly_pow_card, FiniteField.pow_card]
0.0625
import Mathlib.CategoryTheory.Adjunction.Whiskering import Mathlib.CategoryTheory.Sites.PreservesSheafification #align_import category_theory.sites.adjunction from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace CategoryTheory open GrothendieckTopology CategoryTheory Limits Opposite universe v u variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) variable {D : Type*} [Category D] variable {E : Type*} [Category E] variable {F : D β₯€ E} {G : E β₯€ D} variable [HasWeakSheafify J D] abbrev sheafForget [ConcreteCategory D] [HasSheafCompose J (forget D)] : Sheaf J D β₯€ SheafOfTypes J := sheafCompose J (forget D) β‹™ (sheafEquivSheafOfTypes J).functor set_option linter.uppercaseLean3 false in #align category_theory.Sheaf_forget CategoryTheory.sheafForget namespace Sheaf noncomputable section @[simps] def composeEquiv [HasSheafCompose J F] (adj : G ⊣ F) (X : Sheaf J E) (Y : Sheaf J D) : ((composeAndSheafify J G).obj X ⟢ Y) ≃ (X ⟢ (sheafCompose J F).obj Y) := let A := adj.whiskerRight Cα΅’α΅– { toFun := fun Ξ· => ⟨A.homEquiv _ _ (toSheafify J _ ≫ Ξ·.val)⟩ invFun := fun Ξ³ => ⟨sheafifyLift J ((A.homEquiv _ _).symm ((sheafToPresheaf _ _).map Ξ³)) Y.2⟩ left_inv := by intro Ξ· ext1 dsimp symm apply sheafifyLift_unique rw [Equiv.symm_apply_apply] right_inv := by intro Ξ³ ext1 dsimp -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644 erw [toSheafify_sheafifyLift, Equiv.apply_symm_apply] } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_equiv CategoryTheory.Sheaf.composeEquiv -- These lemmas have always been bad (#7657), but leanprover/lean4#2644 made `simp` start noticing attribute [nolint simpNF] CategoryTheory.Sheaf.composeEquiv_apply_val CategoryTheory.Sheaf.composeEquiv_symm_apply_val @[simps! unit_app_val counit_app_val] def adjunction [HasSheafCompose J F] (adj : G ⊣ F) : composeAndSheafify J G ⊣ sheafCompose J F := Adjunction.mkOfHomEquiv { homEquiv := composeEquiv J adj homEquiv_naturality_left_symm := fun f g => by ext1 dsimp [composeEquiv] rw [sheafifyMap_sheafifyLift] erw [Adjunction.homEquiv_naturality_left_symm] rw [whiskeringRight_obj_map] rfl homEquiv_naturality_right := fun f g => by ext dsimp [composeEquiv] erw [Adjunction.homEquiv_unit, Adjunction.homEquiv_unit] dsimp simp } set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction CategoryTheory.Sheaf.adjunction instance [F.IsRightAdjoint] : (sheafCompose J F).IsRightAdjoint := (adjunction J (Adjunction.ofIsRightAdjoint F)).isRightAdjoint instance [G.IsLeftAdjoint] : (composeAndSheafify J G).IsLeftAdjoint := (adjunction J (Adjunction.ofIsLeftAdjoint G)).isLeftAdjoint lemma preservesSheafification_of_adjunction (adj : G ⊣ F) : J.PreservesSheafification G where le P Q f hf := by have := adj.isRightAdjoint rw [MorphismProperty.inverseImage_iff] dsimp intro R hR rw [← ((adj.whiskerRight Cα΅’α΅–).homEquiv P R).comp_bijective] convert (((adj.whiskerRight Cα΅’α΅–).homEquiv Q R).trans (hf.homEquiv (R β‹™ F) ((sheafCompose J F).obj ⟨R, hR⟩).cond)).bijective ext g X dsimp [Adjunction.whiskerRight, Adjunction.mkOfUnitCounit] simp instance [G.IsLeftAdjoint] : J.PreservesSheafification G := preservesSheafification_of_adjunction J (Adjunction.ofIsLeftAdjoint G) section ForgetToType variable [ConcreteCategory D] [HasSheafCompose J (forget D)] abbrev composeAndSheafifyFromTypes (G : Type max v u β₯€ D) : SheafOfTypes J β₯€ Sheaf J D := (sheafEquivSheafOfTypes J).inverse β‹™ composeAndSheafify _ G set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.compose_and_sheafify_from_types CategoryTheory.Sheaf.composeAndSheafifyFromTypes def adjunctionToTypes {G : Type max v u β₯€ D} (adj : G ⊣ forget D) : composeAndSheafifyFromTypes J G ⊣ sheafForget J := (sheafEquivSheafOfTypes J).symm.toAdjunction.comp (adjunction J adj) set_option linter.uppercaseLean3 false in #align category_theory.Sheaf.adjunction_to_types CategoryTheory.Sheaf.adjunctionToTypes @[simp]
Mathlib/CategoryTheory/Sites/Adjunction.lean
136
143
theorem adjunctionToTypes_unit_app_val {G : Type max v u β₯€ D} (adj : G ⊣ forget D) (Y : SheafOfTypes J) : ((adjunctionToTypes J adj).unit.app Y).val = (adj.whiskerRight _).unit.app ((sheafOfTypesToPresheaf J).obj Y) ≫ whiskerRight (toSheafify J _) (forget D) := by
dsimp [adjunctionToTypes, Adjunction.comp] simp rfl
0.0625
import Mathlib.Data.List.Nodup #align_import data.list.duplicate from "leanprover-community/mathlib"@"f694c7dead66f5d4c80f446c796a5aad14707f0e" variable {Ξ± : Type*} namespace List inductive Duplicate (x : Ξ±) : List Ξ± β†’ Prop | cons_mem {l : List Ξ±} : x ∈ l β†’ Duplicate x (x :: l) | cons_duplicate {y : Ξ±} {l : List Ξ±} : Duplicate x l β†’ Duplicate x (y :: l) #align list.duplicate List.Duplicate local infixl:50 " ∈+ " => List.Duplicate variable {l : List Ξ±} {x : Ξ±} theorem Mem.duplicate_cons_self (h : x ∈ l) : x ∈+ x :: l := Duplicate.cons_mem h #align list.mem.duplicate_cons_self List.Mem.duplicate_cons_self theorem Duplicate.duplicate_cons (h : x ∈+ l) (y : Ξ±) : x ∈+ y :: l := Duplicate.cons_duplicate h #align list.duplicate.duplicate_cons List.Duplicate.duplicate_cons theorem Duplicate.mem (h : x ∈+ l) : x ∈ l := by induction' h with l' _ y l' _ hm Β· exact mem_cons_self _ _ Β· exact mem_cons_of_mem _ hm #align list.duplicate.mem List.Duplicate.mem theorem Duplicate.mem_cons_self (h : x ∈+ x :: l) : x ∈ l := by cases' h with _ h _ _ h Β· exact h Β· exact h.mem #align list.duplicate.mem_cons_self List.Duplicate.mem_cons_self @[simp] theorem duplicate_cons_self_iff : x ∈+ x :: l ↔ x ∈ l := ⟨Duplicate.mem_cons_self, Mem.duplicate_cons_self⟩ #align list.duplicate_cons_self_iff List.duplicate_cons_self_iff theorem Duplicate.ne_nil (h : x ∈+ l) : l β‰  [] := fun H => (mem_nil_iff x).mp (H β–Έ h.mem) #align list.duplicate.ne_nil List.Duplicate.ne_nil @[simp] theorem not_duplicate_nil (x : Ξ±) : Β¬x ∈+ [] := fun H => H.ne_nil rfl #align list.not_duplicate_nil List.not_duplicate_nil theorem Duplicate.ne_singleton (h : x ∈+ l) (y : Ξ±) : l β‰  [y] := by induction' h with l' h z l' h _ Β· simp [ne_nil_of_mem h] Β· simp [ne_nil_of_mem h.mem] #align list.duplicate.ne_singleton List.Duplicate.ne_singleton @[simp] theorem not_duplicate_singleton (x y : Ξ±) : Β¬x ∈+ [y] := fun H => H.ne_singleton _ rfl #align list.not_duplicate_singleton List.not_duplicate_singleton theorem Duplicate.elim_nil (h : x ∈+ []) : False := not_duplicate_nil x h #align list.duplicate.elim_nil List.Duplicate.elim_nil theorem Duplicate.elim_singleton {y : Ξ±} (h : x ∈+ [y]) : False := not_duplicate_singleton x y h #align list.duplicate.elim_singleton List.Duplicate.elim_singleton theorem duplicate_cons_iff {y : Ξ±} : x ∈+ y :: l ↔ y = x ∧ x ∈ l ∨ x ∈+ l := by refine ⟨fun h => ?_, fun h => ?_⟩ Β· cases' h with _ hm _ _ hm Β· exact Or.inl ⟨rfl, hm⟩ Β· exact Or.inr hm Β· rcases h with (⟨rfl | h⟩ | h) Β· simpa Β· exact h.cons_duplicate #align list.duplicate_cons_iff List.duplicate_cons_iff theorem Duplicate.of_duplicate_cons {y : Ξ±} (h : x ∈+ y :: l) (hx : x β‰  y) : x ∈+ l := by simpa [duplicate_cons_iff, hx.symm] using h #align list.duplicate.of_duplicate_cons List.Duplicate.of_duplicate_cons theorem duplicate_cons_iff_of_ne {y : Ξ±} (hne : x β‰  y) : x ∈+ y :: l ↔ x ∈+ l := by simp [duplicate_cons_iff, hne.symm] #align list.duplicate_cons_iff_of_ne List.duplicate_cons_iff_of_ne
Mathlib/Data/List/Duplicate.lean
106
113
theorem Duplicate.mono_sublist {l' : List α} (hx : x ∈+ l) (h : l <+ l') : x ∈+ l' := by
induction' h with l₁ lβ‚‚ y _ IH l₁ lβ‚‚ y h IH Β· exact hx Β· exact (IH hx).duplicate_cons _ Β· rw [duplicate_cons_iff] at hx ⊒ rcases hx with (⟨rfl, hx⟩ | hx) Β· simp [h.subset hx] Β· simp [IH hx]
0.0625
import Mathlib.Topology.Algebra.Algebra import Mathlib.Topology.ContinuousFunction.Compact import Mathlib.Topology.UrysohnsLemma import Mathlib.Analysis.RCLike.Basic import Mathlib.Analysis.NormedSpace.Units import Mathlib.Topology.Algebra.Module.CharacterSpace #align_import topology.continuous_function.ideals from "leanprover-community/mathlib"@"c2258f7bf086b17eac0929d635403780c39e239f" open scoped NNReal namespace ContinuousMap open TopologicalSpace section TopologicalRing variable {X R : Type*} [TopologicalSpace X] [Semiring R] variable [TopologicalSpace R] [TopologicalSemiring R] variable (R) def idealOfSet (s : Set X) : Ideal C(X, R) where carrier := {f : C(X, R) | βˆ€ x ∈ sᢜ, f x = 0} add_mem' {f g} hf hg x hx := by simp [hf x hx, hg x hx, coe_add, Pi.add_apply, add_zero] zero_mem' _ _ := rfl smul_mem' c f hf x hx := mul_zero (c x) β–Έ congr_arg (fun y => c x * y) (hf x hx) #align continuous_map.ideal_of_set ContinuousMap.idealOfSet theorem idealOfSet_closed [T2Space R] (s : Set X) : IsClosed (idealOfSet R s : Set C(X, R)) := by simp only [idealOfSet, Submodule.coe_set_mk, Set.setOf_forall] exact isClosed_iInter fun x => isClosed_iInter fun _ => isClosed_eq (continuous_eval_const x) continuous_const #align continuous_map.ideal_of_set_closed ContinuousMap.idealOfSet_closed variable {R} theorem mem_idealOfSet {s : Set X} {f : C(X, R)} : f ∈ idealOfSet R s ↔ βˆ€ ⦃x : X⦄, x ∈ sᢜ β†’ f x = 0 := by convert Iff.rfl #align continuous_map.mem_ideal_of_set ContinuousMap.mem_idealOfSet theorem not_mem_idealOfSet {s : Set X} {f : C(X, R)} : f βˆ‰ idealOfSet R s ↔ βˆƒ x ∈ sᢜ, f x β‰  0 := by simp_rw [mem_idealOfSet]; push_neg; rfl #align continuous_map.not_mem_ideal_of_set ContinuousMap.not_mem_idealOfSet def setOfIdeal (I : Ideal C(X, R)) : Set X := {x : X | βˆ€ f ∈ I, (f : C(X, R)) x = 0}ᢜ #align continuous_map.set_of_ideal ContinuousMap.setOfIdeal theorem not_mem_setOfIdeal {I : Ideal C(X, R)} {x : X} : x βˆ‰ setOfIdeal I ↔ βˆ€ ⦃f : C(X, R)⦄, f ∈ I β†’ f x = 0 := by rw [← Set.mem_compl_iff, setOfIdeal, compl_compl, Set.mem_setOf] #align continuous_map.not_mem_set_of_ideal ContinuousMap.not_mem_setOfIdeal theorem mem_setOfIdeal {I : Ideal C(X, R)} {x : X} : x ∈ setOfIdeal I ↔ βˆƒ f ∈ I, (f : C(X, R)) x β‰  0 := by simp_rw [setOfIdeal, Set.mem_compl_iff, Set.mem_setOf]; push_neg; rfl #align continuous_map.mem_set_of_ideal ContinuousMap.mem_setOfIdeal theorem setOfIdeal_open [T2Space R] (I : Ideal C(X, R)) : IsOpen (setOfIdeal I) := by simp only [setOfIdeal, Set.setOf_forall, isOpen_compl_iff] exact isClosed_iInter fun f => isClosed_iInter fun _ => isClosed_eq (map_continuous f) continuous_const #align continuous_map.set_of_ideal_open ContinuousMap.setOfIdeal_open @[simps] def opensOfIdeal [T2Space R] (I : Ideal C(X, R)) : Opens X := ⟨setOfIdeal I, setOfIdeal_open I⟩ #align continuous_map.opens_of_ideal ContinuousMap.opensOfIdeal @[simp] theorem setOfTop_eq_univ [Nontrivial R] : setOfIdeal (⊀ : Ideal C(X, R)) = Set.univ := Set.univ_subset_iff.mp fun _ _ => mem_setOfIdeal.mpr ⟨1, Submodule.mem_top, one_ne_zero⟩ #align continuous_map.set_of_top_eq_univ ContinuousMap.setOfTop_eq_univ @[simp] theorem idealOfEmpty_eq_bot : idealOfSet R (βˆ… : Set X) = βŠ₯ := Ideal.ext fun f => by simp only [mem_idealOfSet, Set.compl_empty, Set.mem_univ, forall_true_left, Ideal.mem_bot, DFunLike.ext_iff, zero_apply] #align continuous_map.ideal_of_empty_eq_bot ContinuousMap.idealOfEmpty_eq_bot @[simp]
Mathlib/Topology/ContinuousFunction/Ideals.lean
154
156
theorem mem_idealOfSet_compl_singleton (x : X) (f : C(X, R)) : f ∈ idealOfSet R ({x}ᢜ : Set X) ↔ f x = 0 := by
simp only [mem_idealOfSet, compl_compl, Set.mem_singleton_iff, forall_eq]
0.0625
import Mathlib.Algebra.BigOperators.NatAntidiagonal import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.Nat.Choose.Sum import Mathlib.RingTheory.PowerSeries.Basic #align_import ring_theory.power_series.well_known from "leanprover-community/mathlib"@"8199f6717c150a7fe91c4534175f4cf99725978f" namespace PowerSeries section Ring variable {R S : Type*} [Ring R] [Ring S] def invUnitsSub (u : RΛ£) : PowerSeries R := mk fun n => 1 /β‚š u ^ (n + 1) #align power_series.inv_units_sub PowerSeries.invUnitsSub @[simp] theorem coeff_invUnitsSub (u : RΛ£) (n : β„•) : coeff R n (invUnitsSub u) = 1 /β‚š u ^ (n + 1) := coeff_mk _ _ #align power_series.coeff_inv_units_sub PowerSeries.coeff_invUnitsSub @[simp] theorem constantCoeff_invUnitsSub (u : RΛ£) : constantCoeff R (invUnitsSub u) = 1 /β‚š u := by rw [← coeff_zero_eq_constantCoeff_apply, coeff_invUnitsSub, zero_add, pow_one] #align power_series.constant_coeff_inv_units_sub PowerSeries.constantCoeff_invUnitsSub @[simp]
Mathlib/RingTheory/PowerSeries/WellKnown.lean
52
55
theorem invUnitsSub_mul_X (u : RΛ£) : invUnitsSub u * X = invUnitsSub u * C R u - 1 := by
ext (_ | n) Β· simp Β· simp [n.succ_ne_zero, pow_succ']
0.0625
import Mathlib.Probability.Notation import Mathlib.Probability.Process.Stopping #align_import probability.martingale.basic from "leanprover-community/mathlib"@"ba074af83b6cf54c3104e59402b39410ddbd6dca" open TopologicalSpace Filter open scoped NNReal ENNReal MeasureTheory ProbabilityTheory namespace MeasureTheory variable {Ξ© E ΞΉ : Type*} [Preorder ΞΉ] {m0 : MeasurableSpace Ξ©} {ΞΌ : Measure Ξ©} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f g : ΞΉ β†’ Ξ© β†’ E} {β„± : Filtration ΞΉ m0} def Martingale (f : ΞΉ β†’ Ξ© β†’ E) (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop := Adapted β„± f ∧ βˆ€ i j, i ≀ j β†’ ΞΌ[f j|β„± i] =ᡐ[ΞΌ] f i #align measure_theory.martingale MeasureTheory.Martingale def Supermartingale [LE E] (f : ΞΉ β†’ Ξ© β†’ E) (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop := Adapted β„± f ∧ (βˆ€ i j, i ≀ j β†’ ΞΌ[f j|β„± i] ≀ᡐ[ΞΌ] f i) ∧ βˆ€ i, Integrable (f i) ΞΌ #align measure_theory.supermartingale MeasureTheory.Supermartingale def Submartingale [LE E] (f : ΞΉ β†’ Ξ© β†’ E) (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Prop := Adapted β„± f ∧ (βˆ€ i j, i ≀ j β†’ f i ≀ᡐ[ΞΌ] ΞΌ[f j|β„± i]) ∧ βˆ€ i, Integrable (f i) ΞΌ #align measure_theory.submartingale MeasureTheory.Submartingale theorem martingale_const (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] (x : E) : Martingale (fun _ _ => x) β„± ΞΌ := ⟨adapted_const β„± _, fun i j _ => by rw [condexp_const (β„±.le _)]⟩ #align measure_theory.martingale_const MeasureTheory.martingale_const theorem martingale_const_fun [OrderBot ΞΉ] (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) [IsFiniteMeasure ΞΌ] {f : Ξ© β†’ E} (hf : StronglyMeasurable[β„± βŠ₯] f) (hfint : Integrable f ΞΌ) : Martingale (fun _ => f) β„± ΞΌ := by refine ⟨fun i => hf.mono <| β„±.mono bot_le, fun i j _ => ?_⟩ rw [condexp_of_stronglyMeasurable (β„±.le _) (hf.mono <| β„±.mono bot_le) hfint] #align measure_theory.martingale_const_fun MeasureTheory.martingale_const_fun variable (E) theorem martingale_zero (β„± : Filtration ΞΉ m0) (ΞΌ : Measure Ξ©) : Martingale (0 : ΞΉ β†’ Ξ© β†’ E) β„± ΞΌ := ⟨adapted_zero E β„±, fun i j _ => by rw [Pi.zero_apply, condexp_zero]; simp⟩ #align measure_theory.martingale_zero MeasureTheory.martingale_zero variable {E} namespace Martingale protected theorem adapted (hf : Martingale f β„± ΞΌ) : Adapted β„± f := hf.1 #align measure_theory.martingale.adapted MeasureTheory.Martingale.adapted protected theorem stronglyMeasurable (hf : Martingale f β„± ΞΌ) (i : ΞΉ) : StronglyMeasurable[β„± i] (f i) := hf.adapted i #align measure_theory.martingale.strongly_measurable MeasureTheory.Martingale.stronglyMeasurable theorem condexp_ae_eq (hf : Martingale f β„± ΞΌ) {i j : ΞΉ} (hij : i ≀ j) : ΞΌ[f j|β„± i] =ᡐ[ΞΌ] f i := hf.2 i j hij #align measure_theory.martingale.condexp_ae_eq MeasureTheory.Martingale.condexp_ae_eq protected theorem integrable (hf : Martingale f β„± ΞΌ) (i : ΞΉ) : Integrable (f i) ΞΌ := integrable_condexp.congr (hf.condexp_ae_eq (le_refl i)) #align measure_theory.martingale.integrable MeasureTheory.Martingale.integrable theorem setIntegral_eq [SigmaFiniteFiltration ΞΌ β„±] (hf : Martingale f β„± ΞΌ) {i j : ΞΉ} (hij : i ≀ j) {s : Set Ξ©} (hs : MeasurableSet[β„± i] s) : ∫ Ο‰ in s, f i Ο‰ βˆ‚ΞΌ = ∫ Ο‰ in s, f j Ο‰ βˆ‚ΞΌ := by rw [← @setIntegral_condexp _ _ _ _ _ (β„± i) m0 _ _ _ (β„±.le i) _ (hf.integrable j) hs] refine setIntegral_congr_ae (β„±.le i s hs) ?_ filter_upwards [hf.2 i j hij] with _ heq _ using heq.symm #align measure_theory.martingale.set_integral_eq MeasureTheory.Martingale.setIntegral_eq @[deprecated (since := "2024-04-17")] alias set_integral_eq := setIntegral_eq
Mathlib/Probability/Martingale/Basic.lean
119
121
theorem add (hf : Martingale f β„± ΞΌ) (hg : Martingale g β„± ΞΌ) : Martingale (f + g) β„± ΞΌ := by
refine ⟨hf.adapted.add hg.adapted, fun i j hij => ?_⟩ exact (condexp_add (hf.integrable j) (hg.integrable j)).trans ((hf.2 i j hij).add (hg.2 i j hij))
0.0625
import Mathlib.Algebra.GroupWithZero.NonZeroDivisors import Mathlib.LinearAlgebra.BilinearForm.Properties open LinearMap (BilinForm) universe u v w variable {R : Type*} {M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] variable {R₁ : Type*} {M₁ : Type*} [CommRing R₁] [AddCommGroup M₁] [Module R₁ M₁] variable {V : Type*} {K : Type*} [Field K] [AddCommGroup V] [Module K V] variable {B : BilinForm R M} {B₁ : BilinForm R₁ M₁} namespace LinearMap namespace BilinForm def IsOrtho (B : BilinForm R M) (x y : M) : Prop := B x y = 0 #align bilin_form.is_ortho LinearMap.BilinForm.IsOrtho theorem isOrtho_def {B : BilinForm R M} {x y : M} : B.IsOrtho x y ↔ B x y = 0 := Iff.rfl #align bilin_form.is_ortho_def LinearMap.BilinForm.isOrtho_def theorem isOrtho_zero_left (x : M) : IsOrtho B (0 : M) x := LinearMap.isOrtho_zero_left B x #align bilin_form.is_ortho_zero_left LinearMap.BilinForm.isOrtho_zero_left theorem isOrtho_zero_right (x : M) : IsOrtho B x (0 : M) := zero_right x #align bilin_form.is_ortho_zero_right LinearMap.BilinForm.isOrtho_zero_right theorem ne_zero_of_not_isOrtho_self {B : BilinForm K V} (x : V) (hx₁ : Β¬B.IsOrtho x x) : x β‰  0 := fun hxβ‚‚ => hx₁ (hxβ‚‚.symm β–Έ isOrtho_zero_left _) #align bilin_form.ne_zero_of_not_is_ortho_self LinearMap.BilinForm.ne_zero_of_not_isOrtho_self theorem IsRefl.ortho_comm (H : B.IsRefl) {x y : M} : IsOrtho B x y ↔ IsOrtho B y x := ⟨eq_zero H, eq_zero H⟩ #align bilin_form.is_refl.ortho_comm LinearMap.BilinForm.IsRefl.ortho_comm theorem IsAlt.ortho_comm (H : B₁.IsAlt) {x y : M₁} : IsOrtho B₁ x y ↔ IsOrtho B₁ y x := LinearMap.IsAlt.ortho_comm H #align bilin_form.is_alt.ortho_comm LinearMap.BilinForm.IsAlt.ortho_comm theorem IsSymm.ortho_comm (H : B.IsSymm) {x y : M} : IsOrtho B x y ↔ IsOrtho B y x := LinearMap.IsSymm.ortho_comm H #align bilin_form.is_symm.ortho_comm LinearMap.BilinForm.IsSymm.ortho_comm def iIsOrtho {n : Type w} (B : BilinForm R M) (v : n β†’ M) : Prop := B.IsOrthoα΅’ v set_option linter.uppercaseLean3 false in #align bilin_form.is_Ortho LinearMap.BilinForm.iIsOrtho theorem iIsOrtho_def {n : Type w} {B : BilinForm R M} {v : n β†’ M} : B.iIsOrtho v ↔ βˆ€ i j : n, i β‰  j β†’ B (v i) (v j) = 0 := Iff.rfl set_option linter.uppercaseLean3 false in #align bilin_form.is_Ortho_def LinearMap.BilinForm.iIsOrtho_def section variable {Rβ‚„ Mβ‚„ : Type*} [CommRing Rβ‚„] [IsDomain Rβ‚„] variable [AddCommGroup Mβ‚„] [Module Rβ‚„ Mβ‚„] {G : BilinForm Rβ‚„ Mβ‚„} @[simp]
Mathlib/LinearAlgebra/BilinearForm/Orthogonal.lean
100
105
theorem isOrtho_smul_left {x y : Mβ‚„} {a : Rβ‚„} (ha : a β‰  0) : IsOrtho G (a β€’ x) y ↔ IsOrtho G x y := by
dsimp only [IsOrtho] rw [map_smul] simp only [LinearMap.smul_apply, smul_eq_mul, mul_eq_zero, or_iff_right_iff_imp] exact fun a ↦ (ha a).elim
0.0625
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]
Mathlib/GroupTheory/Perm/Option.lean
27
34
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]
0.0625
import Mathlib.Algebra.DirectSum.Module import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Convex.Uniform import Mathlib.Analysis.NormedSpace.Completion import Mathlib.Analysis.NormedSpace.BoundedLinearMaps #align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" noncomputable section open RCLike Real Filter open Topology ComplexConjugate open LinearMap (BilinForm) variable {π•œ E F : Type*} [RCLike π•œ] class Inner (π•œ E : Type*) where inner : E β†’ E β†’ π•œ #align has_inner Inner export Inner (inner) notation3:max "βŸͺ" x ", " y "⟫_" π•œ:max => @inner π•œ _ _ x y class InnerProductSpace (π•œ : Type*) (E : Type*) [RCLike π•œ] [NormedAddCommGroup E] extends NormedSpace π•œ E, Inner π•œ E where norm_sq_eq_inner : βˆ€ x : E, β€–xβ€– ^ 2 = re (inner x x) conj_symm : βˆ€ x y, conj (inner y x) = inner x y add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space InnerProductSpace -- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore structure InnerProductSpace.Core (π•œ : Type*) (F : Type*) [RCLike π•œ] [AddCommGroup F] [Module π•œ F] extends Inner π•œ F where conj_symm : βˆ€ x y, conj (inner y x) = inner x y nonneg_re : βˆ€ x, 0 ≀ re (inner x x) definite : βˆ€ x, inner x x = 0 β†’ x = 0 add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space.core InnerProductSpace.Core attribute [class] InnerProductSpace.Core def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π•œ E] : InnerProductSpace.Core π•œ E := { c with nonneg_re := fun x => by rw [← InnerProductSpace.norm_sq_eq_inner] apply sq_nonneg definite := fun x hx => norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by rw [InnerProductSpace.norm_sq_eq_inner (π•œ := π•œ) x, hx, map_zero] } #align inner_product_space.to_core InnerProductSpace.toCore namespace InnerProductSpace.Core variable [AddCommGroup F] [Module π•œ F] [c : InnerProductSpace.Core π•œ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ F _ x y local notation "normSqK" => @RCLike.normSq π•œ _ local notation "reK" => @RCLike.re π•œ _ local notation "ext_iff" => @RCLike.ext_iff π•œ _ local postfix:90 "†" => starRingEnd _ def toInner' : Inner π•œ F := c.toInner #align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner' attribute [local instance] toInner' def normSq (x : F) := reK βŸͺx, x⟫ #align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq local notation "normSqF" => @normSq π•œ F _ _ _ _ theorem inner_conj_symm (x y : F) : βŸͺy, xβŸ«β€  = βŸͺx, y⟫ := c.conj_symm x y #align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm theorem inner_self_nonneg {x : F} : 0 ≀ re βŸͺx, x⟫ := c.nonneg_re _ #align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg theorem inner_self_im (x : F) : im βŸͺx, x⟫ = 0 := by rw [← @ofReal_inj π•œ, im_eq_conj_sub] simp [inner_conj_symm] #align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im theorem inner_add_left (x y z : F) : βŸͺx + y, z⟫ = βŸͺx, z⟫ + βŸͺy, z⟫ := c.add_left _ _ _ #align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left theorem inner_add_right (x y z : F) : βŸͺx, y + z⟫ = βŸͺx, y⟫ + βŸͺx, z⟫ := by rw [← inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm] #align inner_product_space.core.inner_add_right InnerProductSpace.Core.inner_add_right theorem ofReal_normSq_eq_inner_self (x : F) : (normSqF x : π•œ) = βŸͺx, x⟫ := by rw [ext_iff] exact ⟨by simp only [ofReal_re]; rfl, by simp only [inner_self_im, ofReal_im]⟩ #align inner_product_space.core.coe_norm_sq_eq_inner_self InnerProductSpace.Core.ofReal_normSq_eq_inner_self theorem inner_re_symm (x y : F) : re βŸͺx, y⟫ = re βŸͺy, x⟫ := by rw [← inner_conj_symm, conj_re] #align inner_product_space.core.inner_re_symm InnerProductSpace.Core.inner_re_symm
Mathlib/Analysis/InnerProductSpace/Basic.lean
232
232
theorem inner_im_symm (x y : F) : im βŸͺx, y⟫ = -im βŸͺy, x⟫ := by
rw [← inner_conj_symm, conj_im]
0.0625
import Mathlib.Data.List.Basic namespace List variable {Ξ± Ξ² : Type*} @[simp] theorem reduceOption_cons_of_some (x : Ξ±) (l : List (Option Ξ±)) : reduceOption (some x :: l) = x :: l.reduceOption := by simp only [reduceOption, filterMap, id, eq_self_iff_true, and_self_iff] #align list.reduce_option_cons_of_some List.reduceOption_cons_of_some @[simp] theorem reduceOption_cons_of_none (l : List (Option Ξ±)) : reduceOption (none :: l) = l.reduceOption := by simp only [reduceOption, filterMap, id] #align list.reduce_option_cons_of_none List.reduceOption_cons_of_none @[simp] theorem reduceOption_nil : @reduceOption Ξ± [] = [] := rfl #align list.reduce_option_nil List.reduceOption_nil @[simp] theorem reduceOption_map {l : List (Option Ξ±)} {f : Ξ± β†’ Ξ²} : reduceOption (map (Option.map f) l) = map f (reduceOption l) := by induction' l with hd tl hl Β· simp only [reduceOption_nil, map_nil] Β· cases hd <;> simpa [true_and_iff, Option.map_some', map, eq_self_iff_true, reduceOption_cons_of_some] using hl #align list.reduce_option_map List.reduceOption_map theorem reduceOption_append (l l' : List (Option Ξ±)) : (l ++ l').reduceOption = l.reduceOption ++ l'.reduceOption := filterMap_append l l' id #align list.reduce_option_append List.reduceOption_append theorem reduceOption_length_eq {l : List (Option Ξ±)} : l.reduceOption.length = (l.filter Option.isSome).length := by induction' l with hd tl hl Β· simp_rw [reduceOption_nil, filter_nil, length] Β· cases hd <;> simp [hl] theorem length_eq_reduceOption_length_add_filter_none {l : List (Option Ξ±)} : l.length = l.reduceOption.length + (l.filter Option.isNone).length := by simp_rw [reduceOption_length_eq, l.length_eq_length_filter_add Option.isSome, Option.bnot_isSome] theorem reduceOption_length_le (l : List (Option Ξ±)) : l.reduceOption.length ≀ l.length := by rw [length_eq_reduceOption_length_add_filter_none] apply Nat.le_add_right #align list.reduce_option_length_le List.reduceOption_length_le theorem reduceOption_length_eq_iff {l : List (Option Ξ±)} : l.reduceOption.length = l.length ↔ βˆ€ x ∈ l, Option.isSome x := by rw [reduceOption_length_eq, List.filter_length_eq_length] #align list.reduce_option_length_eq_iff List.reduceOption_length_eq_iff theorem reduceOption_length_lt_iff {l : List (Option Ξ±)} : l.reduceOption.length < l.length ↔ none ∈ l := by rw [Nat.lt_iff_le_and_ne, and_iff_right (reduceOption_length_le l), Ne, reduceOption_length_eq_iff] induction l <;> simp [*] rw [@eq_comm _ none, ← Option.not_isSome_iff_eq_none, Decidable.imp_iff_not_or] #align list.reduce_option_length_lt_iff List.reduceOption_length_lt_iff theorem reduceOption_singleton (x : Option Ξ±) : [x].reduceOption = x.toList := by cases x <;> rfl #align list.reduce_option_singleton List.reduceOption_singleton theorem reduceOption_concat (l : List (Option Ξ±)) (x : Option Ξ±) : (l.concat x).reduceOption = l.reduceOption ++ x.toList := by induction' l with hd tl hl generalizing x Β· cases x <;> simp [Option.toList] Β· simp only [concat_eq_append, reduceOption_append] at hl cases hd <;> simp [hl, reduceOption_append] #align list.reduce_option_concat List.reduceOption_concat
Mathlib/Data/List/ReduceOption.lean
88
90
theorem reduceOption_concat_of_some (l : List (Option Ξ±)) (x : Ξ±) : (l.concat (some x)).reduceOption = l.reduceOption.concat x := by
simp only [reduceOption_nil, concat_eq_append, reduceOption_append, reduceOption_cons_of_some]
0.0625
import Mathlib.Order.Filter.Ultrafilter import Mathlib.Order.Filter.Germ #align_import order.filter.filter_product from "leanprover-community/mathlib"@"2738d2ca56cbc63be80c3bd48e9ed90ad94e947d" universe u v variable {Ξ± : Type u} {Ξ² : Type v} {Ο† : Ultrafilter Ξ±} open scoped Classical namespace Filter local notation3 "βˆ€* "(...)", "r:(scoped p => Filter.Eventually p (Ultrafilter.toFilter Ο†)) => r namespace Germ open Ultrafilter local notation "Ξ²*" => Germ (Ο† : Filter Ξ±) Ξ² instance instGroupWithZero [GroupWithZero Ξ²] : GroupWithZero Ξ²* where __ := instDivInvMonoid __ := instMonoidWithZero mul_inv_cancel f := inductionOn f fun f hf ↦ coe_eq.2 <| (Ο†.em fun y ↦ f y = 0).elim (fun H ↦ (hf <| coe_eq.2 H).elim) fun H ↦ H.mono fun x ↦ mul_inv_cancel inv_zero := coe_eq.2 <| by simp only [Function.comp, inv_zero, EventuallyEq.rfl] instance instDivisionSemiring [DivisionSemiring Ξ²] : DivisionSemiring Ξ²* where toSemiring := instSemiring __ := instGroupWithZero nnqsmul := _ instance instDivisionRing [DivisionRing Ξ²] : DivisionRing Ξ²* where __ := instRing __ := instDivisionSemiring qsmul := _ instance instSemifield [Semifield Ξ²] : Semifield Ξ²* where __ := instCommSemiring __ := instDivisionSemiring instance instField [Field Ξ²] : Field Ξ²* where __ := instCommRing __ := instDivisionRing
Mathlib/Order/Filter/FilterProduct.lean
65
66
theorem coe_lt [Preorder Ξ²] {f g : Ξ± β†’ Ξ²} : (f : Ξ²*) < g ↔ βˆ€* x, f x < g x := by
simp only [lt_iff_le_not_le, eventually_and, coe_le, eventually_not, EventuallyLE]
0.0625
import Mathlib.Analysis.InnerProductSpace.Dual import Mathlib.Analysis.Calculus.FDeriv.Basic import Mathlib.Analysis.Calculus.Deriv.Basic open Topology InnerProductSpace Set noncomputable section variable {π•œ F : Type*} [RCLike π•œ] variable [NormedAddCommGroup F] [InnerProductSpace π•œ F] [CompleteSpace F] variable {f : F β†’ π•œ} {f' x : F} def HasGradientAtFilter (f : F β†’ π•œ) (f' x : F) (L : Filter F) := HasFDerivAtFilter f (toDual π•œ F f') x L def HasGradientWithinAt (f : F β†’ π•œ) (f' : F) (s : Set F) (x : F) := HasGradientAtFilter f f' x (𝓝[s] x) def HasGradientAt (f : F β†’ π•œ) (f' x : F) := HasGradientAtFilter f f' x (𝓝 x) def gradientWithin (f : F β†’ π•œ) (s : Set F) (x : F) : F := (toDual π•œ F).symm (fderivWithin π•œ f s x) def gradient (f : F β†’ π•œ) (x : F) : F := (toDual π•œ F).symm (fderiv π•œ f x) @[inherit_doc] scoped[Gradient] notation "βˆ‡" => gradient local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y open scoped Gradient variable {s : Set F} {L : Filter F} theorem hasGradientWithinAt_iff_hasFDerivWithinAt {s : Set F} : HasGradientWithinAt f f' s x ↔ HasFDerivWithinAt f (toDual π•œ F f') s x := Iff.rfl theorem hasFDerivWithinAt_iff_hasGradientWithinAt {frechet : F β†’L[π•œ] π•œ} {s : Set F} : HasFDerivWithinAt f frechet s x ↔ HasGradientWithinAt f ((toDual π•œ F).symm frechet) s x := by rw [hasGradientWithinAt_iff_hasFDerivWithinAt, (toDual π•œ F).apply_symm_apply frechet] theorem hasGradientAt_iff_hasFDerivAt : HasGradientAt f f' x ↔ HasFDerivAt f (toDual π•œ F f') x := Iff.rfl theorem hasFDerivAt_iff_hasGradientAt {frechet : F β†’L[π•œ] π•œ} : HasFDerivAt f frechet x ↔ HasGradientAt f ((toDual π•œ F).symm frechet) x := by rw [hasGradientAt_iff_hasFDerivAt, (toDual π•œ F).apply_symm_apply frechet] alias ⟨HasGradientWithinAt.hasFDerivWithinAt, _⟩ := hasGradientWithinAt_iff_hasFDerivWithinAt alias ⟨HasFDerivWithinAt.hasGradientWithinAt, _⟩ := hasFDerivWithinAt_iff_hasGradientWithinAt alias ⟨HasGradientAt.hasFDerivAt, _⟩ := hasGradientAt_iff_hasFDerivAt alias ⟨HasFDerivAt.hasGradientAt, _⟩ := hasFDerivAt_iff_hasGradientAt theorem gradient_eq_zero_of_not_differentiableAt (h : Β¬DifferentiableAt π•œ f x) : βˆ‡ f x = 0 := by rw [gradient, fderiv_zero_of_not_differentiableAt h, map_zero] theorem HasGradientAt.unique {gradf gradg : F} (hf : HasGradientAt f gradf x) (hg : HasGradientAt f gradg x) : gradf = gradg := (toDual π•œ F).injective (hf.hasFDerivAt.unique hg.hasFDerivAt) theorem DifferentiableAt.hasGradientAt (h : DifferentiableAt π•œ f x) : HasGradientAt f (βˆ‡ f x) x := by rw [hasGradientAt_iff_hasFDerivAt, gradient, (toDual π•œ F).apply_symm_apply (fderiv π•œ f x)] exact h.hasFDerivAt theorem HasGradientAt.differentiableAt (h : HasGradientAt f f' x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt theorem DifferentiableWithinAt.hasGradientWithinAt (h : DifferentiableWithinAt π•œ f s x) : HasGradientWithinAt f (gradientWithin f s x) s x := by rw [hasGradientWithinAt_iff_hasFDerivWithinAt, gradientWithin, (toDual π•œ F).apply_symm_apply (fderivWithin π•œ f s x)] exact h.hasFDerivWithinAt theorem HasGradientWithinAt.differentiableWithinAt (h : HasGradientWithinAt f f' s x) : DifferentiableWithinAt π•œ f s x := h.hasFDerivWithinAt.differentiableWithinAt @[simp] theorem hasGradientWithinAt_univ : HasGradientWithinAt f f' univ x ↔ HasGradientAt f f' x := by rw [hasGradientWithinAt_iff_hasFDerivWithinAt, hasGradientAt_iff_hasFDerivAt] exact hasFDerivWithinAt_univ theorem DifferentiableOn.hasGradientAt (h : DifferentiableOn π•œ f s) (hs : s ∈ 𝓝 x) : HasGradientAt f (βˆ‡ f x) x := (h.hasFDerivAt hs).hasGradientAt theorem HasGradientAt.gradient (h : HasGradientAt f f' x) : βˆ‡ f x = f' := h.differentiableAt.hasGradientAt.unique h theorem gradient_eq {f' : F β†’ F} (h : βˆ€ x, HasGradientAt f (f' x) x) : βˆ‡ f = f' := funext fun x => (h x).gradient section OneDimension variable {g : π•œ β†’ π•œ} {g' u : π•œ} {L' : Filter π•œ} theorem HasGradientAtFilter.hasDerivAtFilter (h : HasGradientAtFilter g g' u L') : HasDerivAtFilter g (starRingEnd π•œ g') u L' := by have : ContinuousLinearMap.smulRight (1 : π•œ β†’L[π•œ] π•œ) (starRingEnd π•œ g') = (toDual π•œ π•œ) g' := by ext; simp rwa [HasDerivAtFilter, this]
Mathlib/Analysis/Calculus/Gradient/Basic.lean
162
166
theorem HasDerivAtFilter.hasGradientAtFilter (h : HasDerivAtFilter g g' u L') : HasGradientAtFilter g (starRingEnd π•œ g') u L' := by
have : ContinuousLinearMap.smulRight (1 : π•œ β†’L[π•œ] π•œ) g' = (toDual π•œ π•œ) (starRingEnd π•œ g') := by ext; simp rwa [HasGradientAtFilter, ← this]
0.0625
import Mathlib.FieldTheory.SeparableClosure import Mathlib.Algebra.CharP.IntermediateField open FiniteDimensional Polynomial IntermediateField Field noncomputable section universe u v w variable (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] variable (K : Type w) [Field K] [Algebra F K] section perfectClosure def perfectClosure : IntermediateField F E where carrier := {x : E | βˆƒ n : β„•, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range} add_mem' := by rintro x y ⟨n, hx⟩ ⟨m, hy⟩ use n + m have := expChar_of_injective_algebraMap (algebraMap F E).injective (ringExpChar F) rw [add_pow_expChar_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul] exact add_mem (pow_mem hx _) (pow_mem hy _) mul_mem' := by rintro x y ⟨n, hx⟩ ⟨m, hy⟩ use n + m rw [mul_pow, pow_add, pow_mul, mul_comm (_ ^ n), pow_mul] exact mul_mem (pow_mem hx _) (pow_mem hy _) inv_mem' := by rintro x ⟨n, hx⟩ use n; rw [inv_pow] apply inv_mem (id hx : _ ∈ (βŠ₯ : IntermediateField F E)) algebraMap_mem' := fun x ↦ ⟨0, by rw [pow_zero, pow_one]; exact ⟨x, rfl⟩⟩ variable {F E} theorem mem_perfectClosure_iff {x : E} : x ∈ perfectClosure F E ↔ βˆƒ n : β„•, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range := Iff.rfl theorem mem_perfectClosure_iff_pow_mem (q : β„•) [ExpChar F q] {x : E} : x ∈ perfectClosure F E ↔ βˆƒ n : β„•, x ^ q ^ n ∈ (algebraMap F E).range := by rw [mem_perfectClosure_iff, ringExpChar.eq F q]
Mathlib/FieldTheory/PurelyInseparable.lean
287
289
theorem mem_perfectClosure_iff_natSepDegree_eq_one {x : E} : x ∈ perfectClosure F E ↔ (minpoly F x).natSepDegree = 1 := by
rw [mem_perfectClosure_iff, minpoly.natSepDegree_eq_one_iff_pow_mem (ringExpChar F)]
0.0625
import Mathlib.Data.Set.Pointwise.SMul #align_import algebra.add_torsor from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" class AddTorsor (G : outParam Type*) (P : Type*) [AddGroup G] extends AddAction G P, VSub G P where [nonempty : Nonempty P] vsub_vadd' : βˆ€ p₁ pβ‚‚ : P, (p₁ -α΅₯ pβ‚‚ : G) +α΅₯ pβ‚‚ = p₁ vadd_vsub' : βˆ€ (g : G) (p : P), g +α΅₯ p -α΅₯ p = g #align add_torsor AddTorsor -- Porting note(#12096): removed `nolint instance_priority`; lint not ported yet attribute [instance 100] AddTorsor.nonempty -- Porting note(#12094): removed nolint; dangerous_instance linter not ported yet --attribute [nolint dangerous_instance] AddTorsor.toVSub -- Porting note(#12096): linter not ported yet --@[nolint instance_priority] instance addGroupIsAddTorsor (G : Type*) [AddGroup G] : AddTorsor G G where vsub := Sub.sub vsub_vadd' := sub_add_cancel vadd_vsub' := add_sub_cancel_right #align add_group_is_add_torsor addGroupIsAddTorsor @[simp] theorem vsub_eq_sub {G : Type*} [AddGroup G] (g₁ gβ‚‚ : G) : g₁ -α΅₯ gβ‚‚ = g₁ - gβ‚‚ := rfl #align vsub_eq_sub vsub_eq_sub section General variable {G : Type*} {P : Type*} [AddGroup G] [T : AddTorsor G P] @[simp] theorem vsub_vadd (p₁ pβ‚‚ : P) : p₁ -α΅₯ pβ‚‚ +α΅₯ pβ‚‚ = p₁ := AddTorsor.vsub_vadd' p₁ pβ‚‚ #align vsub_vadd vsub_vadd @[simp] theorem vadd_vsub (g : G) (p : P) : g +α΅₯ p -α΅₯ p = g := AddTorsor.vadd_vsub' g p #align vadd_vsub vadd_vsub theorem vadd_right_cancel {g₁ gβ‚‚ : G} (p : P) (h : g₁ +α΅₯ p = gβ‚‚ +α΅₯ p) : g₁ = gβ‚‚ := by -- Porting note: vadd_vsub g₁ β†’ vadd_vsub g₁ p rw [← vadd_vsub g₁ p, h, vadd_vsub] #align vadd_right_cancel vadd_right_cancel @[simp] theorem vadd_right_cancel_iff {g₁ gβ‚‚ : G} (p : P) : g₁ +α΅₯ p = gβ‚‚ +α΅₯ p ↔ g₁ = gβ‚‚ := ⟨vadd_right_cancel p, fun h => h β–Έ rfl⟩ #align vadd_right_cancel_iff vadd_right_cancel_iff theorem vadd_right_injective (p : P) : Function.Injective ((Β· +α΅₯ p) : G β†’ P) := fun _ _ => vadd_right_cancel p #align vadd_right_injective vadd_right_injective theorem vadd_vsub_assoc (g : G) (p₁ pβ‚‚ : P) : g +α΅₯ p₁ -α΅₯ pβ‚‚ = g + (p₁ -α΅₯ pβ‚‚) := by apply vadd_right_cancel pβ‚‚ rw [vsub_vadd, add_vadd, vsub_vadd] #align vadd_vsub_assoc vadd_vsub_assoc @[simp]
Mathlib/Algebra/AddTorsor.lean
124
125
theorem vsub_self (p : P) : p -α΅₯ p = (0 : G) := by
rw [← zero_add (p -α΅₯ p), ← vadd_vsub_assoc, vadd_vsub]
0.0625
import Mathlib.Data.List.Defs import Mathlib.Data.Option.Basic import Mathlib.Data.Nat.Defs import Mathlib.Init.Data.List.Basic import Mathlib.Util.AssertExists -- Make sure we haven't imported `Data.Nat.Order.Basic` assert_not_exists OrderedSub namespace List universe u v variable {Ξ± : Type u} {Ξ² : Type v} (l : List Ξ±) (x : Ξ±) (xs : List Ξ±) (n : β„•) section getD variable (d : Ξ±) #align list.nthd_nil List.getD_nilβ‚“ -- argument order #align list.nthd_cons_zero List.getD_cons_zeroβ‚“ -- argument order #align list.nthd_cons_succ List.getD_cons_succβ‚“ -- argument order theorem getD_eq_get {n : β„•} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by induction l generalizing n with | nil => simp at hn | cons head tail ih => cases n Β· exact getD_cons_zero Β· exact ih _ @[simp] theorem getD_map {n : β„•} (f : Ξ± β†’ Ξ²) : (map f l).getD n (f d) = f (l.getD n d) := by induction l generalizing n with | nil => rfl | cons head tail ih => cases n Β· rfl Β· simp [ih] #align list.nthd_eq_nth_le List.getD_eq_get theorem getD_eq_default {n : β„•} (hn : l.length ≀ n) : l.getD n d = d := by induction l generalizing n with | nil => exact getD_nil | cons head tail ih => cases n Β· simp at hn Β· exact ih (Nat.le_of_succ_le_succ hn) #align list.nthd_eq_default List.getD_eq_defaultβ‚“ -- argument order def decidableGetDNilNe (a : Ξ±) : DecidablePred fun i : β„• => getD ([] : List Ξ±) i a β‰  a := fun _ => isFalse fun H => H getD_nil #align list.decidable_nthd_nil_ne List.decidableGetDNilNeβ‚“ -- argument order @[simp] theorem getD_singleton_default_eq (n : β„•) : [d].getD n d = d := by cases n <;> simp #align list.nthd_singleton_default_eq List.getD_singleton_default_eqβ‚“ -- argument order @[simp] theorem getD_replicate_default_eq (r n : β„•) : (replicate r d).getD n d = d := by induction r generalizing n with | zero => simp | succ n ih => cases n <;> simp [ih] #align list.nthd_replicate_default_eq List.getD_replicate_default_eqβ‚“ -- argument order
Mathlib/Data/List/GetD.lean
83
86
theorem getD_append (l l' : List Ξ±) (d : Ξ±) (n : β„•) (h : n < l.length) : (l ++ l').getD n d = l.getD n d := by
rw [getD_eq_get _ _ (Nat.lt_of_lt_of_le h (length_append _ _ β–Έ Nat.le_add_right _ _)), get_append _ h, getD_eq_get]
0.0625
import Mathlib.Algebra.Associated import Mathlib.Algebra.BigOperators.Finsupp #align_import algebra.big_operators.associated from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} -- the same local notation used in `Algebra.Associated` local infixl:50 " ~α΅€ " => Associated theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M Γ— N} : x ~α΅€ z ↔ x.1 ~α΅€ z.1 ∧ x.2 ~α΅€ z.2 := ⟨fun ⟨u, hu⟩ => ⟨⟨(MulEquiv.prodUnits.toFun u).1, (Prod.eq_iff_fst_eq_snd_eq.1 hu).1⟩, ⟨(MulEquiv.prodUnits.toFun u).2, (Prod.eq_iff_fst_eq_snd_eq.1 hu).2⟩⟩, fun ⟨⟨u₁, hβ‚βŸ©, ⟨uβ‚‚, hβ‚‚βŸ©βŸ© => ⟨MulEquiv.prodUnits.invFun (u₁, uβ‚‚), Prod.eq_iff_fst_eq_snd_eq.2 ⟨h₁, hβ‚‚βŸ©βŸ©βŸ© theorem Associated.prod {M : Type*} [CommMonoid M] {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β†’ M) (g : ΞΉ β†’ M) (h : βˆ€ i, i ∈ s β†’ (f i) ~α΅€ (g i)) : (∏ i ∈ s, f i) ~α΅€ (∏ i ∈ s, g i) := by induction s using Finset.induction with | empty => simp only [Finset.prod_empty] rfl | @insert j s hjs IH => classical convert_to (∏ i ∈ insert j s, f i) ~α΅€ (∏ i ∈ insert j s, g i) rw [Finset.prod_insert hjs, Finset.prod_insert hjs] exact Associated.mul_mul (h j (Finset.mem_insert_self j s)) (IH (fun i hi ↦ h i (Finset.mem_insert_of_mem hi))) theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero Ξ±] {p : Ξ±} (hp : Prime p) {s : Multiset Ξ±} : (βˆ€ r ∈ s, Prime r) β†’ p ∣ s.prod β†’ βˆƒ q ∈ s, p ~α΅€ q := Multiset.induction_on s (by simp [mt isUnit_iff_dvd_one.2 hp.not_unit]) fun a s ih hs hps => by rw [Multiset.prod_cons] at hps cases' hp.dvd_or_dvd hps with h h Β· have hap := hs a (Multiset.mem_cons.2 (Or.inl rfl)) exact ⟨a, Multiset.mem_cons_self a _, hp.associated_of_dvd hap h⟩ Β· rcases ih (fun r hr => hs _ (Multiset.mem_cons.2 (Or.inr hr))) h with ⟨q, hq₁, hqβ‚‚βŸ© exact ⟨q, Multiset.mem_cons.2 (Or.inr hq₁), hqβ‚‚βŸ© #align exists_associated_mem_of_dvd_prod exists_associated_mem_of_dvd_prod theorem Multiset.prod_primes_dvd [CancelCommMonoidWithZero Ξ±] [βˆ€ a : Ξ±, DecidablePred (Associated a)] {s : Multiset Ξ±} (n : Ξ±) (h : βˆ€ a ∈ s, Prime a) (div : βˆ€ a ∈ s, a ∣ n) (uniq : βˆ€ a, s.countP (Associated a) ≀ 1) : s.prod ∣ n := by induction' s using Multiset.induction_on with a s induct n primes divs generalizing n Β· simp only [Multiset.prod_zero, one_dvd] Β· rw [Multiset.prod_cons] obtain ⟨k, rfl⟩ : a ∣ n := div a (Multiset.mem_cons_self a s) apply mul_dvd_mul_left a refine induct _ (fun a ha => h a (Multiset.mem_cons_of_mem ha)) (fun b b_in_s => ?_) fun a => (Multiset.countP_le_of_le _ (Multiset.le_cons_self _ _)).trans (uniq a) have b_div_n := div b (Multiset.mem_cons_of_mem b_in_s) have a_prime := h a (Multiset.mem_cons_self a s) have b_prime := h b (Multiset.mem_cons_of_mem b_in_s) refine (b_prime.dvd_or_dvd b_div_n).resolve_left fun b_div_a => ?_ have assoc := b_prime.associated_of_dvd a_prime b_div_a have := uniq a rw [Multiset.countP_cons_of_pos _ (Associated.refl _), Nat.succ_le_succ_iff, ← not_lt, Multiset.countP_pos] at this exact this ⟨b, b_in_s, assoc.symm⟩ #align multiset.prod_primes_dvd Multiset.prod_primes_dvd theorem Finset.prod_primes_dvd [CancelCommMonoidWithZero Ξ±] [Unique Ξ±Λ£] {s : Finset Ξ±} (n : Ξ±) (h : βˆ€ a ∈ s, Prime a) (div : βˆ€ a ∈ s, a ∣ n) : (∏ p ∈ s, p) ∣ n := by classical exact Multiset.prod_primes_dvd n (by simpa only [Multiset.map_id', Finset.mem_def] using h) (by simpa only [Multiset.map_id', Finset.mem_def] using div) (by simp only [Multiset.map_id', associated_eq_eq, Multiset.countP_eq_card_filter, ← s.val.count_eq_card_filter_eq, ← Multiset.nodup_iff_count_le_one, s.nodup]) #align finset.prod_primes_dvd Finset.prod_primes_dvd namespace Associates section CommMonoid variable [CommMonoid Ξ±] theorem prod_mk {p : Multiset Ξ±} : (p.map Associates.mk).prod = Associates.mk p.prod := Multiset.induction_on p (by simp) fun a s ih => by simp [ih, Associates.mk_mul_mk] #align associates.prod_mk Associates.prod_mk
Mathlib/Algebra/BigOperators/Associated.lean
124
130
theorem finset_prod_mk {p : Finset Ξ²} {f : Ξ² β†’ Ξ±} : (∏ i ∈ p, Associates.mk (f i)) = Associates.mk (∏ i ∈ p, f i) := by
-- Porting note: added have : (fun i => Associates.mk (f i)) = Associates.mk ∘ f := funext fun x => Function.comp_apply rw [Finset.prod_eq_multiset_prod, this, ← Multiset.map_map, prod_mk, ← Finset.prod_eq_multiset_prod]
0.0625
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)]
Mathlib/Data/Finsupp/Multiset.lean
83
90
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
0.0625
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Combinatorics.SimpleGraph.Maps open Finset namespace SimpleGraph variable {V : Type*} [DecidableEq V] (G : SimpleGraph V) (s t : V) section ReplaceVertex def replaceVertex : SimpleGraph V where Adj v w := if v = t then if w = t then False else G.Adj s w else if w = t then G.Adj v s else G.Adj v w symm v w := by dsimp only; split_ifs <;> simp [adj_comm] lemma not_adj_replaceVertex_same : Β¬(G.replaceVertex s t).Adj s t := by simp [replaceVertex] @[simp] lemma replaceVertex_self : G.replaceVertex s s = G := by ext; unfold replaceVertex; aesop (add simp or_iff_not_imp_left) variable {t} lemma adj_replaceVertex_iff_of_ne_left {w : V} (hw : w β‰  t) : (G.replaceVertex s t).Adj s w ↔ G.Adj s w := by simp [replaceVertex, hw] lemma adj_replaceVertex_iff_of_ne_right {w : V} (hw : w β‰  t) : (G.replaceVertex s t).Adj t w ↔ G.Adj s w := by simp [replaceVertex, hw] lemma adj_replaceVertex_iff_of_ne {v w : V} (hv : v β‰  t) (hw : w β‰  t) : (G.replaceVertex s t).Adj v w ↔ G.Adj v w := by simp [replaceVertex, hv, hw] variable {s} theorem edgeSet_replaceVertex_of_not_adj (hn : Β¬G.Adj s t) : (G.replaceVertex s t).edgeSet = G.edgeSet \ G.incidenceSet t βˆͺ (s(Β·, t)) '' (G.neighborSet s) := by ext e; refine e.inductionOn ?_ simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff] intros; split_ifs; exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop] theorem edgeSet_replaceVertex_of_adj (ha : G.Adj s t) : (G.replaceVertex s t).edgeSet = (G.edgeSet \ G.incidenceSet t βˆͺ (s(Β·, t)) '' (G.neighborSet s)) \ {s(t, t)} := by ext e; refine e.inductionOn ?_ simp only [replaceVertex, mem_edgeSet, Set.mem_union, Set.mem_diff, mk'_mem_incidenceSet_iff] intros; split_ifs; exacts [by simp_all, by aesop, by rw [adj_comm]; aesop, by aesop] variable [Fintype V] [DecidableRel G.Adj] instance : DecidableRel (G.replaceVertex s t).Adj := by unfold replaceVertex; infer_instance
Mathlib/Combinatorics/SimpleGraph/Operations.lean
92
96
theorem edgeFinset_replaceVertex_of_not_adj (hn : Β¬G.Adj s t) : (G.replaceVertex s t).edgeFinset = G.edgeFinset \ G.incidenceFinset t βˆͺ (G.neighborFinset s).image (s(Β·, t)) := by
simp only [incidenceFinset, neighborFinset, ← Set.toFinset_diff, ← Set.toFinset_image, ← Set.toFinset_union] exact Set.toFinset_congr (G.edgeSet_replaceVertex_of_not_adj hn)
0.0625
import Mathlib.Data.Set.Pointwise.Basic import Mathlib.Data.Set.MulAntidiagonal #align_import data.finset.mul_antidiagonal from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" namespace Finset open Pointwise variable {Ξ± : Type*} variable [OrderedCancelCommMonoid Ξ±] {s t : Set Ξ±} (hs : s.IsPWO) (ht : t.IsPWO) (a : Ξ±) @[to_additive "`Finset.addAntidiagonal hs ht a` is the set of all pairs of an element in `s` and an element in `t` that add to `a`, but its construction requires proofs that `s` and `t` are well-ordered."] noncomputable def mulAntidiagonal : Finset (Ξ± Γ— Ξ±) := (Set.MulAntidiagonal.finite_of_isPWO hs ht a).toFinset #align finset.mul_antidiagonal Finset.mulAntidiagonal #align finset.add_antidiagonal Finset.addAntidiagonal variable {hs ht a} {u : Set Ξ±} {hu : u.IsPWO} {x : Ξ± Γ— Ξ±} @[to_additive (attr := simp)] theorem mem_mulAntidiagonal : x ∈ mulAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a := by simp only [mulAntidiagonal, Set.Finite.mem_toFinset, Set.mem_mulAntidiagonal] #align finset.mem_mul_antidiagonal Finset.mem_mulAntidiagonal #align finset.mem_add_antidiagonal Finset.mem_addAntidiagonal @[to_additive] theorem mulAntidiagonal_mono_left (h : u βŠ† s) : mulAntidiagonal hu ht a βŠ† mulAntidiagonal hs ht a := Set.Finite.toFinset_mono <| Set.mulAntidiagonal_mono_left h #align finset.mul_antidiagonal_mono_left Finset.mulAntidiagonal_mono_left #align finset.add_antidiagonal_mono_left Finset.addAntidiagonal_mono_left @[to_additive] theorem mulAntidiagonal_mono_right (h : u βŠ† t) : mulAntidiagonal hs hu a βŠ† mulAntidiagonal hs ht a := Set.Finite.toFinset_mono <| Set.mulAntidiagonal_mono_right h #align finset.mul_antidiagonal_mono_right Finset.mulAntidiagonal_mono_right #align finset.add_antidiagonal_mono_right Finset.addAntidiagonal_mono_right -- Porting note: removed `(attr := simp)`. simp can prove this. @[to_additive]
Mathlib/Data/Finset/MulAntidiagonal.lean
92
95
theorem swap_mem_mulAntidiagonal : x.swap ∈ Finset.mulAntidiagonal hs ht a ↔ x ∈ Finset.mulAntidiagonal ht hs a := by
simp only [mem_mulAntidiagonal, Prod.fst_swap, Prod.snd_swap, Set.swap_mem_mulAntidiagonal_aux, Set.mem_mulAntidiagonal]
0.0625
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed import Mathlib.RingTheory.PowerBasis #align_import ring_theory.is_adjoin_root from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" open scoped Polynomial open Polynomial noncomputable section universe u v -- Porting note: this looks like something that should not be here -- -- This class doesn't really make sense on a predicate -- Porting note(#5171): this linter isn't ported yet. -- @[nolint has_nonempty_instance] structure IsAdjoinRoot {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S] (f : R[X]) : Type max u v where map : R[X] β†’+* S map_surjective : Function.Surjective map ker_map : RingHom.ker map = Ideal.span {f} algebraMap_eq : algebraMap R S = map.comp Polynomial.C #align is_adjoin_root IsAdjoinRoot -- This class doesn't really make sense on a predicate -- @[nolint has_nonempty_instance] -- Porting note: This linter does not exist yet. structure IsAdjoinRootMonic {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S] (f : R[X]) extends IsAdjoinRoot S f where Monic : Monic f #align is_adjoin_root_monic IsAdjoinRootMonic section Ring variable {R : Type u} {S : Type v} [CommRing R] [Ring S] {f : R[X]} [Algebra R S] namespace IsAdjoinRoot def root (h : IsAdjoinRoot S f) : S := h.map X #align is_adjoin_root.root IsAdjoinRoot.root theorem subsingleton (h : IsAdjoinRoot S f) [Subsingleton R] : Subsingleton S := h.map_surjective.subsingleton #align is_adjoin_root.subsingleton IsAdjoinRoot.subsingleton theorem algebraMap_apply (h : IsAdjoinRoot S f) (x : R) : algebraMap R S x = h.map (Polynomial.C x) := by rw [h.algebraMap_eq, RingHom.comp_apply] #align is_adjoin_root.algebra_map_apply IsAdjoinRoot.algebraMap_apply @[simp] theorem mem_ker_map (h : IsAdjoinRoot S f) {p} : p ∈ RingHom.ker h.map ↔ f ∣ p := by rw [h.ker_map, Ideal.mem_span_singleton] #align is_adjoin_root.mem_ker_map IsAdjoinRoot.mem_ker_map theorem map_eq_zero_iff (h : IsAdjoinRoot S f) {p} : h.map p = 0 ↔ f ∣ p := by rw [← h.mem_ker_map, RingHom.mem_ker] #align is_adjoin_root.map_eq_zero_iff IsAdjoinRoot.map_eq_zero_iff @[simp] theorem map_X (h : IsAdjoinRoot S f) : h.map X = h.root := rfl set_option linter.uppercaseLean3 false in #align is_adjoin_root.map_X IsAdjoinRoot.map_X @[simp] theorem map_self (h : IsAdjoinRoot S f) : h.map f = 0 := h.map_eq_zero_iff.mpr dvd_rfl #align is_adjoin_root.map_self IsAdjoinRoot.map_self @[simp] theorem aeval_eq (h : IsAdjoinRoot S f) (p : R[X]) : aeval h.root p = h.map p := Polynomial.induction_on p (fun x => by rw [aeval_C, h.algebraMap_apply]) (fun p q ihp ihq => by rw [AlgHom.map_add, RingHom.map_add, ihp, ihq]) fun n x _ => by rw [AlgHom.map_mul, aeval_C, AlgHom.map_pow, aeval_X, RingHom.map_mul, ← h.algebraMap_apply, RingHom.map_pow, map_X] #align is_adjoin_root.aeval_eq IsAdjoinRoot.aeval_eq -- @[simp] -- Porting note (#10618): simp can prove this theorem aeval_root (h : IsAdjoinRoot S f) : aeval h.root f = 0 := by rw [aeval_eq, map_self] #align is_adjoin_root.aeval_root IsAdjoinRoot.aeval_root def repr (h : IsAdjoinRoot S f) (x : S) : R[X] := (h.map_surjective x).choose #align is_adjoin_root.repr IsAdjoinRoot.repr theorem map_repr (h : IsAdjoinRoot S f) (x : S) : h.map (h.repr x) = x := (h.map_surjective x).choose_spec #align is_adjoin_root.map_repr IsAdjoinRoot.map_repr theorem repr_zero_mem_span (h : IsAdjoinRoot S f) : h.repr 0 ∈ Ideal.span ({f} : Set R[X]) := by rw [← h.ker_map, RingHom.mem_ker, h.map_repr] #align is_adjoin_root.repr_zero_mem_span IsAdjoinRoot.repr_zero_mem_span
Mathlib/RingTheory/IsAdjoinRoot.lean
179
181
theorem repr_add_sub_repr_add_repr_mem_span (h : IsAdjoinRoot S f) (x y : S) : h.repr (x + y) - (h.repr x + h.repr y) ∈ Ideal.span ({f} : Set R[X]) := by
rw [← h.ker_map, RingHom.mem_ker, map_sub, h.map_repr, map_add, h.map_repr, h.map_repr, sub_self]
0.0625
import Mathlib.LinearAlgebra.DFinsupp import Mathlib.LinearAlgebra.StdBasis #align_import linear_algebra.finsupp_vector_space from "leanprover-community/mathlib"@"59628387770d82eb6f6dd7b7107308aa2509ec95" noncomputable section open Set LinearMap Submodule open scoped Cardinal universe u v w namespace Finsupp namespace Basis variable {R M n : Type*} variable [DecidableEq n] variable [Semiring R] [AddCommMonoid M] [Module R M]
Mathlib/LinearAlgebra/FinsuppVectorSpace.lean
161
164
theorem _root_.Finset.sum_single_ite [Fintype n] (a : R) (i : n) : (βˆ‘ x : n, Finsupp.single x (if i = x then a else 0)) = Finsupp.single i a := by
simp only [apply_ite (Finsupp.single _), Finsupp.single_zero, Finset.sum_ite_eq, if_pos (Finset.mem_univ _)]
0.0625
import Mathlib.MeasureTheory.Integral.Lebesgue import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.MeanInequalitiesPow import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic #align_import measure_theory.integral.mean_inequalities from "leanprover-community/mathlib"@"13bf7613c96a9fd66a81b9020a82cad9a6ea1fcf" section LIntegral noncomputable section open scoped Classical open NNReal ENNReal MeasureTheory Finset set_option linter.uppercaseLean3 false variable {Ξ± : Type*} [MeasurableSpace Ξ±] {ΞΌ : Measure Ξ±} namespace ENNReal theorem lintegral_mul_le_one_of_lintegral_rpow_eq_one {p q : ℝ} (hpq : p.IsConjExponent q) {f g : Ξ± β†’ ℝβ‰₯0∞} (hf : AEMeasurable f ΞΌ) (hf_norm : ∫⁻ a, f a ^ p βˆ‚ΞΌ = 1) (hg_norm : ∫⁻ a, g a ^ q βˆ‚ΞΌ = 1) : (∫⁻ a, (f * g) a βˆ‚ΞΌ) ≀ 1 := by calc (∫⁻ a : Ξ±, (f * g) a βˆ‚ΞΌ) ≀ ∫⁻ a : Ξ±, f a ^ p / ENNReal.ofReal p + g a ^ q / ENNReal.ofReal q βˆ‚ΞΌ := lintegral_mono fun a => young_inequality (f a) (g a) hpq _ = 1 := by simp only [div_eq_mul_inv] rw [lintegral_add_left'] Β· rw [lintegral_mul_const'' _ (hf.pow_const p), lintegral_mul_const', hf_norm, hg_norm, one_mul, one_mul, hpq.inv_add_inv_conj_ennreal] simp [hpq.symm.pos] Β· exact (hf.pow_const _).mul_const _ #align ennreal.lintegral_mul_le_one_of_lintegral_rpow_eq_one ENNReal.lintegral_mul_le_one_of_lintegral_rpow_eq_one def funMulInvSnorm (f : Ξ± β†’ ℝβ‰₯0∞) (p : ℝ) (ΞΌ : Measure Ξ±) : Ξ± β†’ ℝβ‰₯0∞ := fun a => f a * ((∫⁻ c, f c ^ p βˆ‚ΞΌ) ^ (1 / p))⁻¹ #align ennreal.fun_mul_inv_snorm ENNReal.funMulInvSnorm theorem fun_eq_funMulInvSnorm_mul_snorm {p : ℝ} (f : Ξ± β†’ ℝβ‰₯0∞) (hf_nonzero : (∫⁻ a, f a ^ p βˆ‚ΞΌ) β‰  0) (hf_top : (∫⁻ a, f a ^ p βˆ‚ΞΌ) β‰  ⊀) {a : Ξ±} : f a = funMulInvSnorm f p ΞΌ a * (∫⁻ c, f c ^ p βˆ‚ΞΌ) ^ (1 / p) := by simp [funMulInvSnorm, mul_assoc, ENNReal.inv_mul_cancel, hf_nonzero, hf_top] #align ennreal.fun_eq_fun_mul_inv_snorm_mul_snorm ENNReal.fun_eq_funMulInvSnorm_mul_snorm
Mathlib/MeasureTheory/Integral/MeanInequalities.lean
93
98
theorem funMulInvSnorm_rpow {p : ℝ} (hp0 : 0 < p) {f : Ξ± β†’ ℝβ‰₯0∞} {a : Ξ±} : funMulInvSnorm f p ΞΌ a ^ p = f a ^ p * (∫⁻ c, f c ^ p βˆ‚ΞΌ)⁻¹ := by
rw [funMulInvSnorm, mul_rpow_of_nonneg _ _ (le_of_lt hp0)] suffices h_inv_rpow : ((∫⁻ c : Ξ±, f c ^ p βˆ‚ΞΌ) ^ (1 / p))⁻¹ ^ p = (∫⁻ c : Ξ±, f c ^ p βˆ‚ΞΌ)⁻¹ by rw [h_inv_rpow] rw [inv_rpow, ← rpow_mul, one_div_mul_cancel hp0.ne', rpow_one]
0.0625
import Mathlib.CategoryTheory.Limits.Shapes.Pullbacks import Mathlib.CategoryTheory.Limits.Preserves.Basic #align_import category_theory.limits.preserves.shapes.pullbacks from "leanprover-community/mathlib"@"f11e306adb9f2a393539d2bb4293bf1b42caa7ac" noncomputable section universe v₁ vβ‚‚ u₁ uβ‚‚ -- Porting note: need Functor namespace for mapCone open CategoryTheory CategoryTheory.Category CategoryTheory.Limits CategoryTheory.Functor namespace CategoryTheory.Limits section Pushout variable {C : Type u₁} [Category.{v₁} C] variable {D : Type uβ‚‚} [Category.{vβ‚‚} D] variable (G : C β₯€ D) variable {W X Y Z : C} {h : X ⟢ Z} {k : Y ⟢ Z} {f : W ⟢ X} {g : W ⟢ Y} (comm : f ≫ h = g ≫ k) def isColimitMapCoconePushoutCoconeEquiv : IsColimit (mapCocone G (PushoutCocone.mk h k comm)) ≃ IsColimit (PushoutCocone.mk (G.map h) (G.map k) (by simp only [← G.map_comp, comm]) : PushoutCocone (G.map f) (G.map g)) := (IsColimit.precomposeHomEquiv (diagramIsoSpan.{vβ‚‚} _).symm _).symm.trans <| IsColimit.equivIsoColimit <| Cocones.ext (Iso.refl _) <| by rintro (_ | _ | _) <;> dsimp <;> simp only [Category.comp_id, Category.id_comp, ← G.map_comp] #align category_theory.limits.is_colimit_map_cocone_pushout_cocone_equiv CategoryTheory.Limits.isColimitMapCoconePushoutCoconeEquiv def isColimitPushoutCoconeMapOfIsColimit [PreservesColimit (span f g) G] (l : IsColimit (PushoutCocone.mk h k comm)) : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm] )) := isColimitMapCoconePushoutCoconeEquiv G comm (PreservesColimit.preserves l) #align category_theory.limits.is_colimit_pushout_cocone_map_of_is_colimit CategoryTheory.Limits.isColimitPushoutCoconeMapOfIsColimit def isColimitOfIsColimitPushoutCoconeMap [ReflectsColimit (span f g) G] (l : IsColimit (PushoutCocone.mk (G.map h) (G.map k) (show G.map f ≫ G.map h = G.map g ≫ G.map k from by simp only [← G.map_comp,comm]))) : IsColimit (PushoutCocone.mk h k comm) := ReflectsColimit.reflects ((isColimitMapCoconePushoutCoconeEquiv G comm).symm l) #align category_theory.limits.is_colimit_of_is_colimit_pushout_cocone_map CategoryTheory.Limits.isColimitOfIsColimitPushoutCoconeMap variable (f g) [PreservesColimit (span f g) G] def isColimitOfHasPushoutOfPreservesColimit [i : HasPushout f g] : IsColimit (PushoutCocone.mk (G.map pushout.inl) (G.map (@pushout.inr _ _ _ _ _ f g i)) (show G.map f ≫ G.map pushout.inl = G.map g ≫ G.map pushout.inr from by simp only [← G.map_comp, pushout.condition])) := isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout f g) #align category_theory.limits.is_colimit_of_has_pushout_of_preserves_colimit CategoryTheory.Limits.isColimitOfHasPushoutOfPreservesColimit def preservesPushoutSymmetry : PreservesColimit (span g f) G where preserves {c} hc := by apply (IsColimit.precomposeHomEquiv (diagramIsoSpan.{vβ‚‚} _).symm _).toFun apply IsColimit.ofIsoColimit _ (PushoutCocone.isoMk _).symm apply PushoutCocone.isColimitOfFlip apply (isColimitMapCoconePushoutCoconeEquiv _ _).toFun Β· refine @PreservesColimit.preserves _ _ _ _ _ _ _ _ ?_ _ ?_ -- Porting note: more TC coddling Β· dsimp infer_instance Β· exact PushoutCocone.flipIsColimit hc #align category_theory.limits.preserves_pushout_symmetry CategoryTheory.Limits.preservesPushoutSymmetry theorem hasPushout_of_preservesPushout [HasPushout f g] : HasPushout (G.map f) (G.map g) := ⟨⟨⟨_, isColimitPushoutCoconeMapOfIsColimit G _ (pushoutIsPushout _ _)⟩⟩⟩ #align category_theory.limits.has_pushout_of_preserves_pushout CategoryTheory.Limits.hasPushout_of_preservesPushout variable [HasPushout f g] [HasPushout (G.map f) (G.map g)] def PreservesPushout.iso : pushout (G.map f) (G.map g) β‰… G.obj (pushout f g) := IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) (isColimitOfHasPushoutOfPreservesColimit G f g) #align category_theory.limits.preserves_pushout.iso CategoryTheory.Limits.PreservesPushout.iso @[simp] theorem PreservesPushout.iso_hom : (PreservesPushout.iso G f g).hom = pushoutComparison G f g := rfl #align category_theory.limits.preserves_pushout.iso_hom CategoryTheory.Limits.PreservesPushout.iso_hom @[reassoc] theorem PreservesPushout.inl_iso_hom : pushout.inl ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inl := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inl_iso_hom CategoryTheory.Limits.PreservesPushout.inl_iso_hom @[reassoc] theorem PreservesPushout.inr_iso_hom : pushout.inr ≫ (PreservesPushout.iso G f g).hom = G.map pushout.inr := by delta PreservesPushout.iso simp #align category_theory.limits.preserves_pushout.inr_iso_hom CategoryTheory.Limits.PreservesPushout.inr_iso_hom @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Limits/Preserves/Shapes/Pullbacks.lean
239
241
theorem PreservesPushout.inl_iso_inv : G.map pushout.inl ≫ (PreservesPushout.iso G f g).inv = pushout.inl := by
simp [PreservesPushout.iso, Iso.comp_inv_eq]
0.0625
import Mathlib.NumberTheory.BernoulliPolynomials import Mathlib.MeasureTheory.Integral.IntervalIntegral import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.PSeries #align_import number_theory.zeta_values from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" noncomputable section open scoped Nat Real Interval open Complex MeasureTheory Set intervalIntegral local notation "π•Œ" => UnitAddCircle section BernoulliFunProps def bernoulliFun (k : β„•) (x : ℝ) : ℝ := (Polynomial.map (algebraMap β„š ℝ) (Polynomial.bernoulli k)).eval x #align bernoulli_fun bernoulliFun theorem bernoulliFun_eval_zero (k : β„•) : bernoulliFun k 0 = bernoulli k := by rw [bernoulliFun, Polynomial.eval_zero_map, Polynomial.bernoulli_eval_zero, eq_ratCast] #align bernoulli_fun_eval_zero bernoulliFun_eval_zero
Mathlib/NumberTheory/ZetaValues.lean
53
56
theorem bernoulliFun_endpoints_eq_of_ne_one {k : β„•} (hk : k β‰  1) : bernoulliFun k 1 = bernoulliFun k 0 := by
rw [bernoulliFun_eval_zero, bernoulliFun, Polynomial.eval_one_map, Polynomial.bernoulli_eval_one, bernoulli_eq_bernoulli'_of_ne_one hk, eq_ratCast]
0.0625
import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace #align_import geometry.manifold.vector_bundle.fiberwise_linear from "leanprover-community/mathlib"@"be2c24f56783935652cefffb4bfca7e4b25d167e" noncomputable section open Set TopologicalSpace open scoped Manifold Topology variable {π•œ B F : Type*} [TopologicalSpace B] variable [NontriviallyNormedField π•œ] [NormedAddCommGroup F] [NormedSpace π•œ F] namespace FiberwiseLinear variable {Ο† Ο†' : B β†’ F ≃L[π•œ] F} {U U' : Set B} def partialHomeomorph (Ο† : B β†’ F ≃L[π•œ] F) (hU : IsOpen U) (hΟ† : ContinuousOn (fun x => Ο† x : B β†’ F β†’L[π•œ] F) U) (h2Ο† : ContinuousOn (fun x => (Ο† x).symm : B β†’ F β†’L[π•œ] F) U) : PartialHomeomorph (B Γ— F) (B Γ— F) where toFun x := (x.1, Ο† x.1 x.2) invFun x := (x.1, (Ο† x.1).symm x.2) source := U Γ—Λ’ univ target := U Γ—Λ’ univ map_source' _x hx := mk_mem_prod hx.1 (mem_univ _) map_target' _x hx := mk_mem_prod hx.1 (mem_univ _) left_inv' _ _ := Prod.ext rfl (ContinuousLinearEquiv.symm_apply_apply _ _) right_inv' _ _ := Prod.ext rfl (ContinuousLinearEquiv.apply_symm_apply _ _) open_source := hU.prod isOpen_univ open_target := hU.prod isOpen_univ continuousOn_toFun := have : ContinuousOn (fun p : B Γ— F => ((Ο† p.1 : F β†’L[π•œ] F), p.2)) (U Γ—Λ’ univ) := hΟ†.prod_map continuousOn_id continuousOn_fst.prod (isBoundedBilinearMap_apply.continuous.comp_continuousOn this) continuousOn_invFun := haveI : ContinuousOn (fun p : B Γ— F => (((Ο† p.1).symm : F β†’L[π•œ] F), p.2)) (U Γ—Λ’ univ) := h2Ο†.prod_map continuousOn_id continuousOn_fst.prod (isBoundedBilinearMap_apply.continuous.comp_continuousOn this) #align fiberwise_linear.local_homeomorph FiberwiseLinear.partialHomeomorph theorem trans_partialHomeomorph_apply (hU : IsOpen U) (hΟ† : ContinuousOn (fun x => Ο† x : B β†’ F β†’L[π•œ] F) U) (h2Ο† : ContinuousOn (fun x => (Ο† x).symm : B β†’ F β†’L[π•œ] F) U) (hU' : IsOpen U') (hΟ†' : ContinuousOn (fun x => Ο†' x : B β†’ F β†’L[π•œ] F) U') (h2Ο†' : ContinuousOn (fun x => (Ο†' x).symm : B β†’ F β†’L[π•œ] F) U') (b : B) (v : F) : (FiberwiseLinear.partialHomeomorph Ο† hU hΟ† h2Ο† ≫ₕ FiberwiseLinear.partialHomeomorph Ο†' hU' hΟ†' h2Ο†') ⟨b, v⟩ = ⟨b, Ο†' b (Ο† b v)⟩ := rfl #align fiberwise_linear.trans_local_homeomorph_apply FiberwiseLinear.trans_partialHomeomorph_apply
Mathlib/Geometry/Manifold/VectorBundle/FiberwiseLinear.lean
74
82
theorem source_trans_partialHomeomorph (hU : IsOpen U) (hΟ† : ContinuousOn (fun x => Ο† x : B β†’ F β†’L[π•œ] F) U) (h2Ο† : ContinuousOn (fun x => (Ο† x).symm : B β†’ F β†’L[π•œ] F) U) (hU' : IsOpen U') (hΟ†' : ContinuousOn (fun x => Ο†' x : B β†’ F β†’L[π•œ] F) U') (h2Ο†' : ContinuousOn (fun x => (Ο†' x).symm : B β†’ F β†’L[π•œ] F) U') : (FiberwiseLinear.partialHomeomorph Ο† hU hΟ† h2Ο† ≫ₕ FiberwiseLinear.partialHomeomorph Ο†' hU' hΟ†' h2Ο†').source = (U ∩ U') Γ—Λ’ univ := by
dsimp only [FiberwiseLinear.partialHomeomorph]; mfld_set_tac
0.0625
import Mathlib.Algebra.ContinuedFractions.Computation.Basic import Mathlib.Algebra.ContinuedFractions.Translations #align_import algebra.continued_fractions.computation.translations from "leanprover-community/mathlib"@"a7e36e48519ab281320c4d192da6a7b348ce40ad" namespace GeneralizedContinuedFraction open GeneralizedContinuedFraction (of) -- Fix a discrete linear ordered floor field and a value `v`. variable {K : Type*} [LinearOrderedField K] [FloorRing K] {v : K} namespace IntFractPair theorem stream_zero (v : K) : IntFractPair.stream v 0 = some (IntFractPair.of v) := rfl #align generalized_continued_fraction.int_fract_pair.stream_zero GeneralizedContinuedFraction.IntFractPair.stream_zero variable {n : β„•} theorem stream_eq_none_of_fr_eq_zero {ifp_n : IntFractPair K} (stream_nth_eq : IntFractPair.stream v n = some ifp_n) (nth_fr_eq_zero : ifp_n.fr = 0) : IntFractPair.stream v (n + 1) = none := by cases' ifp_n with _ fr change fr = 0 at nth_fr_eq_zero simp [IntFractPair.stream, stream_nth_eq, nth_fr_eq_zero] #align generalized_continued_fraction.int_fract_pair.stream_eq_none_of_fr_eq_zero GeneralizedContinuedFraction.IntFractPair.stream_eq_none_of_fr_eq_zero theorem succ_nth_stream_eq_none_iff : IntFractPair.stream v (n + 1) = none ↔ IntFractPair.stream v n = none ∨ βˆƒ ifp, IntFractPair.stream v n = some ifp ∧ ifp.fr = 0 := by rw [IntFractPair.stream] cases IntFractPair.stream v n <;> simp [imp_false] #align generalized_continued_fraction.int_fract_pair.succ_nth_stream_eq_none_iff GeneralizedContinuedFraction.IntFractPair.succ_nth_stream_eq_none_iff
Mathlib/Algebra/ContinuedFractions/Computation/Translations.lean
87
92
theorem succ_nth_stream_eq_some_iff {ifp_succ_n : IntFractPair K} : IntFractPair.stream v (n + 1) = some ifp_succ_n ↔ βˆƒ ifp_n : IntFractPair K, IntFractPair.stream v n = some ifp_n ∧ ifp_n.fr β‰  0 ∧ IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n := by
simp [IntFractPair.stream, ite_eq_iff, Option.bind_eq_some]
0.0625
import Mathlib.Topology.Sets.Opens #align_import topology.local_at_target from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Set Filter open Topology Filter variable {Ξ± Ξ² : Type*} [TopologicalSpace Ξ±] [TopologicalSpace Ξ²] {f : Ξ± β†’ Ξ²} variable {s : Set Ξ²} {ΞΉ : Type*} {U : ΞΉ β†’ Opens Ξ²} (hU : iSup U = ⊀) theorem Set.restrictPreimage_inducing (s : Set Ξ²) (h : Inducing f) : Inducing (s.restrictPreimage f) := by simp_rw [← inducing_subtype_val.of_comp_iff, inducing_iff_nhds, restrictPreimage, MapsTo.coe_restrict, restrict_eq, ← @Filter.comap_comap _ _ _ _ _ f, Function.comp_apply] at h ⊒ intro a rw [← h, ← inducing_subtype_val.nhds_eq_comap] #align set.restrict_preimage_inducing Set.restrictPreimage_inducing alias Inducing.restrictPreimage := Set.restrictPreimage_inducing #align inducing.restrict_preimage Inducing.restrictPreimage theorem Set.restrictPreimage_embedding (s : Set Ξ²) (h : Embedding f) : Embedding (s.restrictPreimage f) := ⟨h.1.restrictPreimage s, h.2.restrictPreimage s⟩ #align set.restrict_preimage_embedding Set.restrictPreimage_embedding alias Embedding.restrictPreimage := Set.restrictPreimage_embedding #align embedding.restrict_preimage Embedding.restrictPreimage theorem Set.restrictPreimage_openEmbedding (s : Set Ξ²) (h : OpenEmbedding f) : OpenEmbedding (s.restrictPreimage f) := ⟨h.1.restrictPreimage s, (s.range_restrictPreimage f).symm β–Έ continuous_subtype_val.isOpen_preimage _ h.isOpen_range⟩ #align set.restrict_preimage_open_embedding Set.restrictPreimage_openEmbedding alias OpenEmbedding.restrictPreimage := Set.restrictPreimage_openEmbedding #align open_embedding.restrict_preimage OpenEmbedding.restrictPreimage theorem Set.restrictPreimage_closedEmbedding (s : Set Ξ²) (h : ClosedEmbedding f) : ClosedEmbedding (s.restrictPreimage f) := ⟨h.1.restrictPreimage s, (s.range_restrictPreimage f).symm β–Έ inducing_subtype_val.isClosed_preimage _ h.isClosed_range⟩ #align set.restrict_preimage_closed_embedding Set.restrictPreimage_closedEmbedding alias ClosedEmbedding.restrictPreimage := Set.restrictPreimage_closedEmbedding #align closed_embedding.restrict_preimage ClosedEmbedding.restrictPreimage theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set Ξ²) : IsClosedMap (s.restrictPreimage f) := by intro t suffices βˆ€ u, IsClosed u β†’ Subtype.val ⁻¹' u = t β†’ βˆƒ v, IsClosed v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by simpa [isClosed_induced_iff] exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩ @[deprecated (since := "2024-04-02")] theorem Set.restrictPreimage_isClosedMap (s : Set Ξ²) (H : IsClosedMap f) : IsClosedMap (s.restrictPreimage f) := H.restrictPreimage s theorem IsOpenMap.restrictPreimage (H : IsOpenMap f) (s : Set Ξ²) : IsOpenMap (s.restrictPreimage f) := by intro t suffices βˆ€ u, IsOpen u β†’ Subtype.val ⁻¹' u = t β†’ βˆƒ v, IsOpen v ∧ Subtype.val ⁻¹' v = s.restrictPreimage f '' t by simpa [isOpen_induced_iff] exact fun u hu e => ⟨f '' u, H u hu, by simp [← e, image_restrictPreimage]⟩ @[deprecated (since := "2024-04-02")] theorem Set.restrictPreimage_isOpenMap (s : Set Ξ²) (H : IsOpenMap f) : IsOpenMap (s.restrictPreimage f) := H.restrictPreimage s theorem isOpen_iff_inter_of_iSup_eq_top (s : Set Ξ²) : IsOpen s ↔ βˆ€ i, IsOpen (s ∩ U i) := by constructor Β· exact fun H i => H.inter (U i).2 Β· intro H have : ⋃ i, (U i : Set Ξ²) = Set.univ := by convert congr_arg (SetLike.coe) hU simp rw [← s.inter_univ, ← this, Set.inter_iUnion] exact isOpen_iUnion H #align is_open_iff_inter_of_supr_eq_top isOpen_iff_inter_of_iSup_eq_top theorem isOpen_iff_coe_preimage_of_iSup_eq_top (s : Set Ξ²) : IsOpen s ↔ βˆ€ i, IsOpen ((↑) ⁻¹' s : Set (U i)) := by -- Porting note: rewrote to avoid Β΄simpΒ΄ issues rw [isOpen_iff_inter_of_iSup_eq_top hU s] refine forall_congr' fun i => ?_ rw [(U _).2.openEmbedding_subtype_val.open_iff_image_open] erw [Set.image_preimage_eq_inter_range] rw [Subtype.range_coe, Opens.carrier_eq_coe] #align is_open_iff_coe_preimage_of_supr_eq_top isOpen_iff_coe_preimage_of_iSup_eq_top
Mathlib/Topology/LocalAtTarget.lean
111
113
theorem isClosed_iff_coe_preimage_of_iSup_eq_top (s : Set Ξ²) : IsClosed s ↔ βˆ€ i, IsClosed ((↑) ⁻¹' s : Set (U i)) := by
simpa using isOpen_iff_coe_preimage_of_iSup_eq_top hU sᢜ
0.0625
import Mathlib.Topology.EMetricSpace.Basic #align_import topology.metric_space.metric_separated from "leanprover-community/mathlib"@"57ac39bd365c2f80589a700f9fbb664d3a1a30c2" open EMetric Set noncomputable section def IsMetricSeparated {X : Type*} [EMetricSpace X] (s t : Set X) := βˆƒ r, r β‰  0 ∧ βˆ€ x ∈ s, βˆ€ y ∈ t, r ≀ edist x y #align is_metric_separated IsMetricSeparated namespace IsMetricSeparated variable {X : Type*} [EMetricSpace X] {s t : Set X} {x y : X} @[symm] theorem symm (h : IsMetricSeparated s t) : IsMetricSeparated t s := let ⟨r, r0, hr⟩ := h ⟨r, r0, fun y hy x hx => edist_comm x y β–Έ hr x hx y hy⟩ #align is_metric_separated.symm IsMetricSeparated.symm theorem comm : IsMetricSeparated s t ↔ IsMetricSeparated t s := ⟨symm, symm⟩ #align is_metric_separated.comm IsMetricSeparated.comm @[simp] theorem empty_left (s : Set X) : IsMetricSeparated βˆ… s := ⟨1, one_ne_zero, fun _x => False.elim⟩ #align is_metric_separated.empty_left IsMetricSeparated.empty_left @[simp] theorem empty_right (s : Set X) : IsMetricSeparated s βˆ… := (empty_left s).symm #align is_metric_separated.empty_right IsMetricSeparated.empty_right protected theorem disjoint (h : IsMetricSeparated s t) : Disjoint s t := let ⟨r, r0, hr⟩ := h Set.disjoint_left.mpr fun x hx1 hx2 => r0 <| by simpa using hr x hx1 x hx2 #align is_metric_separated.disjoint IsMetricSeparated.disjoint theorem subset_compl_right (h : IsMetricSeparated s t) : s βŠ† tᢜ := fun _ hs ht => h.disjoint.le_bot ⟨hs, ht⟩ #align is_metric_separated.subset_compl_right IsMetricSeparated.subset_compl_right @[mono] theorem mono {s' t'} (hs : s βŠ† s') (ht : t βŠ† t') : IsMetricSeparated s' t' β†’ IsMetricSeparated s t := fun ⟨r, r0, hr⟩ => ⟨r, r0, fun x hx y hy => hr x (hs hx) y (ht hy)⟩ #align is_metric_separated.mono IsMetricSeparated.mono theorem mono_left {s'} (h' : IsMetricSeparated s' t) (hs : s βŠ† s') : IsMetricSeparated s t := h'.mono hs Subset.rfl #align is_metric_separated.mono_left IsMetricSeparated.mono_left theorem mono_right {t'} (h' : IsMetricSeparated s t') (ht : t βŠ† t') : IsMetricSeparated s t := h'.mono Subset.rfl ht #align is_metric_separated.mono_right IsMetricSeparated.mono_right theorem union_left {s'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s' t) : IsMetricSeparated (s βˆͺ s') t := by rcases h, h' with ⟨⟨r, r0, hr⟩, ⟨r', r0', hr'⟩⟩ refine ⟨min r r', ?_, fun x hx y hy => hx.elim ?_ ?_⟩ Β· rw [← pos_iff_ne_zero] at r0 r0' ⊒ exact lt_min r0 r0' Β· exact fun hx => (min_le_left _ _).trans (hr _ hx _ hy) Β· exact fun hx => (min_le_right _ _).trans (hr' _ hx _ hy) #align is_metric_separated.union_left IsMetricSeparated.union_left @[simp] theorem union_left_iff {s'} : IsMetricSeparated (s βˆͺ s') t ↔ IsMetricSeparated s t ∧ IsMetricSeparated s' t := ⟨fun h => ⟨h.mono_left subset_union_left, h.mono_left subset_union_right⟩, fun h => h.1.union_left h.2⟩ #align is_metric_separated.union_left_iff IsMetricSeparated.union_left_iff theorem union_right {t'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s t') : IsMetricSeparated s (t βˆͺ t') := (h.symm.union_left h'.symm).symm #align is_metric_separated.union_right IsMetricSeparated.union_right @[simp] theorem union_right_iff {t'} : IsMetricSeparated s (t βˆͺ t') ↔ IsMetricSeparated s t ∧ IsMetricSeparated s t' := comm.trans <| union_left_iff.trans <| and_congr comm comm #align is_metric_separated.union_right_iff IsMetricSeparated.union_right_iff
Mathlib/Topology/MetricSpace/MetricSeparated.lean
106
109
theorem finite_iUnion_left_iff {ΞΉ : Type*} {I : Set ΞΉ} (hI : I.Finite) {s : ΞΉ β†’ Set X} {t : Set X} : IsMetricSeparated (⋃ i ∈ I, s i) t ↔ βˆ€ i ∈ I, IsMetricSeparated (s i) t := by
refine Finite.induction_on hI (by simp) @fun i I _ _ hI => ?_ rw [biUnion_insert, forall_mem_insert, union_left_iff, hI]
0.0625
import Mathlib.Probability.ProbabilityMassFunction.Basic import Mathlib.Probability.ProbabilityMassFunction.Constructions import Mathlib.MeasureTheory.Integral.Bochner namespace PMF open MeasureTheory ENNReal TopologicalSpace section General variable {Ξ± : Type*} [MeasurableSpace Ξ±] [MeasurableSingletonClass Ξ±] variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] theorem integral_eq_tsum (p : PMF Ξ±) (f : Ξ± β†’ E) (hf : Integrable f p.toMeasure) : ∫ a, f a βˆ‚(p.toMeasure) = βˆ‘' a, (p a).toReal β€’ f a := calc _ = ∫ a in p.support, f a βˆ‚(p.toMeasure) := by rw [restrict_toMeasure_support p] _ = βˆ‘' (a : support p), (p.toMeasure {a.val}).toReal β€’ f a := by apply integral_countable f p.support_countable rwa [restrict_toMeasure_support p] _ = βˆ‘' (a : support p), (p a).toReal β€’ f a := by congr with x; congr 2 apply PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _) _ = βˆ‘' a, (p a).toReal β€’ f a := tsum_subtype_eq_of_support_subset <| by calc (fun a ↦ (p a).toReal β€’ f a).support βŠ† (fun a ↦ (p a).toReal).support := Function.support_smul_subset_left _ _ _ βŠ† support p := fun x h1 h2 => h1 (by simp [h2])
Mathlib/Probability/ProbabilityMassFunction/Integrals.lean
43
47
theorem integral_eq_sum [Fintype Ξ±] (p : PMF Ξ±) (f : Ξ± β†’ E) : ∫ a, f a βˆ‚(p.toMeasure) = βˆ‘ a, (p a).toReal β€’ f a := by
rw [integral_fintype _ (.of_finite _ f)] congr with x; congr 2 exact PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)
0.0625
import Mathlib.Topology.Instances.Irrational import Mathlib.Topology.Instances.Rat import Mathlib.Topology.Compactification.OnePoint #align_import topology.instances.rat_lemmas from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" open Set Metric Filter TopologicalSpace open Topology OnePoint local notation "β„šβˆž" => OnePoint β„š namespace Rat variable {p q : β„š} {s t : Set β„š} theorem interior_compact_eq_empty (hs : IsCompact s) : interior s = βˆ… := denseEmbedding_coe_real.toDenseInducing.interior_compact_eq_empty dense_irrational hs #align rat.interior_compact_eq_empty Rat.interior_compact_eq_empty theorem dense_compl_compact (hs : IsCompact s) : Dense sᢜ := interior_eq_empty_iff_dense_compl.1 (interior_compact_eq_empty hs) #align rat.dense_compl_compact Rat.dense_compl_compact instance cocompact_inf_nhds_neBot : NeBot (cocompact β„š βŠ“ 𝓝 p) := by refine (hasBasis_cocompact.inf (nhds_basis_opens _)).neBot_iff.2 ?_ rintro ⟨s, o⟩ ⟨hs, hpo, ho⟩; rw [inter_comm] exact (dense_compl_compact hs).inter_open_nonempty _ ho ⟨p, hpo⟩ #align rat.cocompact_inf_nhds_ne_bot Rat.cocompact_inf_nhds_neBot
Mathlib/Topology/Instances/RatLemmas.lean
56
62
theorem not_countably_generated_cocompact : Β¬IsCountablyGenerated (cocompact β„š) := by
intro H rcases exists_seq_tendsto (cocompact β„š βŠ“ 𝓝 0) with ⟨x, hx⟩ rw [tendsto_inf] at hx; rcases hx with ⟨hxc, hx0⟩ obtain ⟨n, hn⟩ : βˆƒ n : β„•, x n βˆ‰ insert (0 : β„š) (range x) := (hxc.eventually hx0.isCompact_insert_range.compl_mem_cocompact).exists exact hn (Or.inr ⟨n, rfl⟩)
0.0625
import Mathlib.Data.Fin.Tuple.Basic import Mathlib.Data.List.Join #align_import data.list.of_fn from "leanprover-community/mathlib"@"bf27744463e9620ca4e4ebe951fe83530ae6949b" universe u variable {Ξ± : Type u} open Nat namespace List #noalign list.length_of_fn_aux @[simp] theorem length_ofFn_go {n} (f : Fin n β†’ Ξ±) (i j h) : length (ofFn.go f i j h) = i := by induction i generalizing j <;> simp_all [ofFn.go] @[simp] theorem length_ofFn {n} (f : Fin n β†’ Ξ±) : length (ofFn f) = n := by simp [ofFn, length_ofFn_go] #align list.length_of_fn List.length_ofFn #noalign list.nth_of_fn_aux theorem get_ofFn_go {n} (f : Fin n β†’ Ξ±) (i j h) (k) (hk) : get (ofFn.go f i j h) ⟨k, hk⟩ = f ⟨j + k, by simp at hk; omega⟩ := by let i+1 := i cases k <;> simp [ofFn.go, get_ofFn_go (i := i)] congr 2; omega -- Porting note (#10756): new theorem @[simp] theorem get_ofFn {n} (f : Fin n β†’ Ξ±) (i) : get (ofFn f) i = f (Fin.cast (by simp) i) := by cases i; simp [ofFn, get_ofFn_go] @[simp] theorem get?_ofFn {n} (f : Fin n β†’ Ξ±) (i) : get? (ofFn f) i = ofFnNthVal f i := if h : i < (ofFn f).length then by rw [get?_eq_get h, get_ofFn] Β· simp only [length_ofFn] at h; simp [ofFnNthVal, h] else by rw [ofFnNthVal, dif_neg] <;> simpa using h #align list.nth_of_fn List.get?_ofFn set_option linter.deprecated false in @[deprecated get_ofFn (since := "2023-01-17")] theorem nthLe_ofFn {n} (f : Fin n β†’ Ξ±) (i : Fin n) : nthLe (ofFn f) i ((length_ofFn f).symm β–Έ i.2) = f i := by simp [nthLe] #align list.nth_le_of_fn List.nthLe_ofFn set_option linter.deprecated false in @[simp, deprecated get_ofFn (since := "2023-01-17")] theorem nthLe_ofFn' {n} (f : Fin n β†’ Ξ±) {i : β„•} (h : i < (ofFn f).length) : nthLe (ofFn f) i h = f ⟨i, length_ofFn f β–Έ h⟩ := nthLe_ofFn f ⟨i, length_ofFn f β–Έ h⟩ #align list.nth_le_of_fn' List.nthLe_ofFn' @[simp] theorem map_ofFn {Ξ² : Type*} {n : β„•} (f : Fin n β†’ Ξ±) (g : Ξ± β†’ Ξ²) : map g (ofFn f) = ofFn (g ∘ f) := ext_get (by simp) fun i h h' => by simp #align list.map_of_fn List.map_ofFn -- Porting note: we don't have Array' in mathlib4 -- -- theorem array_eq_of_fn {n} (a : Array' n Ξ±) : a.toList = ofFn a.read := -- by -- suffices βˆ€ {m h l}, DArray.revIterateAux a (fun i => cons) m h l = -- ofFnAux (DArray.read a) m h l -- from this -- intros; induction' m with m IH generalizing l; Β· rfl -- simp only [DArray.revIterateAux, of_fn_aux, IH] -- #align list.array_eq_of_fn List.array_eq_of_fn @[congr] theorem ofFn_congr {m n : β„•} (h : m = n) (f : Fin m β†’ Ξ±) : ofFn f = ofFn fun i : Fin n => f (Fin.cast h.symm i) := by subst h simp_rw [Fin.cast_refl, id] #align list.of_fn_congr List.ofFn_congr @[simp] theorem ofFn_zero (f : Fin 0 β†’ Ξ±) : ofFn f = [] := ext_get (by simp) (fun i hi₁ hiβ‚‚ => by contradiction) #align list.of_fn_zero List.ofFn_zero @[simp] theorem ofFn_succ {n} (f : Fin (succ n) β†’ Ξ±) : ofFn f = f 0 :: ofFn fun i => f i.succ := ext_get (by simp) (fun i hi₁ hiβ‚‚ => by cases i Β· simp; rfl Β· simp) #align list.of_fn_succ List.ofFn_succ
Mathlib/Data/List/OfFn.lean
125
131
theorem ofFn_succ' {n} (f : Fin (succ n) β†’ Ξ±) : ofFn f = (ofFn fun i => f (Fin.castSucc i)).concat (f (Fin.last _)) := by
induction' n with n IH Β· rw [ofFn_zero, concat_nil, ofFn_succ, ofFn_zero] rfl Β· rw [ofFn_succ, IH, ofFn_succ, concat_cons, Fin.castSucc_zero] congr
0.0625
import Mathlib.Data.Finset.Fold import Mathlib.Algebra.GCDMonoid.Multiset #align_import algebra.gcd_monoid.finset from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853" #align_import algebra.gcd_monoid.div from "leanprover-community/mathlib"@"b537794f8409bc9598febb79cd510b1df5f4539d" variable {ΞΉ Ξ± Ξ² Ξ³ : Type*} namespace Finset open Multiset variable [CancelCommMonoidWithZero Ξ±] [NormalizedGCDMonoid Ξ±] section gcd def gcd (s : Finset Ξ²) (f : Ξ² β†’ Ξ±) : Ξ± := s.fold GCDMonoid.gcd 0 f #align finset.gcd Finset.gcd variable {s s₁ sβ‚‚ : Finset Ξ²} {f : Ξ² β†’ Ξ±} theorem gcd_def : s.gcd f = (s.1.map f).gcd := rfl #align finset.gcd_def Finset.gcd_def @[simp] theorem gcd_empty : (βˆ… : Finset Ξ²).gcd f = 0 := fold_empty #align finset.gcd_empty Finset.gcd_empty theorem dvd_gcd_iff {a : Ξ±} : a ∣ s.gcd f ↔ βˆ€ b ∈ s, a ∣ f b := by apply Iff.trans Multiset.dvd_gcd simp only [Multiset.mem_map, and_imp, exists_imp] exact ⟨fun k b hb ↦ k _ _ hb rfl, fun k a' b hb h ↦ h β–Έ k _ hb⟩ #align finset.dvd_gcd_iff Finset.dvd_gcd_iff theorem gcd_dvd {b : Ξ²} (hb : b ∈ s) : s.gcd f ∣ f b := dvd_gcd_iff.1 dvd_rfl _ hb #align finset.gcd_dvd Finset.gcd_dvd theorem dvd_gcd {a : Ξ±} : (βˆ€ b ∈ s, a ∣ f b) β†’ a ∣ s.gcd f := dvd_gcd_iff.2 #align finset.dvd_gcd Finset.dvd_gcd @[simp] theorem gcd_insert [DecidableEq Ξ²] {b : Ξ²} : (insert b s : Finset Ξ²).gcd f = GCDMonoid.gcd (f b) (s.gcd f) := by by_cases h : b ∈ s Β· rw [insert_eq_of_mem h, (gcd_eq_right_iff (f b) (s.gcd f) (Multiset.normalize_gcd (s.1.map f))).2 (gcd_dvd h)] apply fold_insert h #align finset.gcd_insert Finset.gcd_insert @[simp] theorem gcd_singleton {b : Ξ²} : ({b} : Finset Ξ²).gcd f = normalize (f b) := Multiset.gcd_singleton #align finset.gcd_singleton Finset.gcd_singleton -- Porting note: Priority changed for `simpNF` @[simp 1100] theorem normalize_gcd : normalize (s.gcd f) = s.gcd f := by simp [gcd_def] #align finset.normalize_gcd Finset.normalize_gcd theorem gcd_union [DecidableEq Ξ²] : (s₁ βˆͺ sβ‚‚).gcd f = GCDMonoid.gcd (s₁.gcd f) (sβ‚‚.gcd f) := Finset.induction_on s₁ (by rw [empty_union, gcd_empty, gcd_zero_left, normalize_gcd]) fun a s _ ih ↦ by rw [insert_union, gcd_insert, gcd_insert, ih, gcd_assoc] #align finset.gcd_union Finset.gcd_union theorem gcd_congr {f g : Ξ² β†’ Ξ±} (hs : s₁ = sβ‚‚) (hfg : βˆ€ a ∈ sβ‚‚, f a = g a) : s₁.gcd f = sβ‚‚.gcd g := by subst hs exact Finset.fold_congr hfg #align finset.gcd_congr Finset.gcd_congr theorem gcd_mono_fun {g : Ξ² β†’ Ξ±} (h : βˆ€ b ∈ s, f b ∣ g b) : s.gcd f ∣ s.gcd g := dvd_gcd fun b hb ↦ (gcd_dvd hb).trans (h b hb) #align finset.gcd_mono_fun Finset.gcd_mono_fun theorem gcd_mono (h : s₁ βŠ† sβ‚‚) : sβ‚‚.gcd f ∣ s₁.gcd f := dvd_gcd fun _ hb ↦ gcd_dvd (h hb) #align finset.gcd_mono Finset.gcd_mono theorem gcd_image [DecidableEq Ξ²] {g : Ξ³ β†’ Ξ²} (s : Finset Ξ³) : (s.image g).gcd f = s.gcd (f ∘ g) := by classical induction' s using Finset.induction with c s _ ih <;> simp [*] #align finset.gcd_image Finset.gcd_image theorem gcd_eq_gcd_image [DecidableEq Ξ±] : s.gcd f = (s.image f).gcd id := Eq.symm <| gcd_image _ #align finset.gcd_eq_gcd_image Finset.gcd_eq_gcd_image
Mathlib/Algebra/GCDMonoid/Finset.lean
212
223
theorem gcd_eq_zero_iff : s.gcd f = 0 ↔ βˆ€ x : Ξ², x ∈ s β†’ f x = 0 := by
rw [gcd_def, Multiset.gcd_eq_zero_iff] constructor <;> intro h · intro b bs apply h (f b) simp only [Multiset.mem_map, mem_def.1 bs] use b simp only [mem_def.1 bs, eq_self_iff_true, and_self] · intro a as rw [Multiset.mem_map] at as rcases as with ⟨b, ⟨bs, rfl⟩⟩ apply h b (mem_def.1 bs)
0.0625
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
Mathlib/Data/List/FinRange.lean
37
40
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]
0.0625
import Mathlib.CategoryTheory.Comma.Basic import Mathlib.CategoryTheory.PUnit import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.CategoryTheory.EssentiallySmall import Mathlib.Logic.Small.Set #align_import category_theory.structured_arrow from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b" namespace CategoryTheory -- morphism levels before object levels. See note [CategoryTheory universes]. universe v₁ vβ‚‚ v₃ vβ‚„ u₁ uβ‚‚ u₃ uβ‚„ variable {C : Type u₁} [Category.{v₁} C] {D : Type uβ‚‚} [Category.{vβ‚‚} D] -- We explicitly come from `PUnit.{1}` here to obtain the correct universe for morphisms of -- structured arrows. -- Porting note(#5171): linter not ported yet -- @[nolint has_nonempty_instance] def StructuredArrow (S : D) (T : C β₯€ D) := Comma (Functor.fromPUnit.{0} S) T #align category_theory.structured_arrow CategoryTheory.StructuredArrow -- Porting note: not found by inferInstance instance (S : D) (T : C β₯€ D) : Category (StructuredArrow S T) := commaCategory namespace StructuredArrow @[simps!] def proj (S : D) (T : C β₯€ D) : StructuredArrow S T β₯€ C := Comma.snd _ _ #align category_theory.structured_arrow.proj CategoryTheory.StructuredArrow.proj variable {S S' S'' : D} {Y Y' Y'' : C} {T T' : C β₯€ D} -- Porting note: this lemma was added because `Comma.hom_ext` -- was not triggered automatically -- See https://github.com/leanprover-community/mathlib4/issues/5229 @[ext] lemma hom_ext {X Y : StructuredArrow S T} (f g : X ⟢ Y) (h : f.right = g.right) : f = g := CommaMorphism.ext _ _ (Subsingleton.elim _ _) h @[simp] theorem hom_eq_iff {X Y : StructuredArrow S T} (f g : X ⟢ Y) : f = g ↔ f.right = g.right := ⟨fun h ↦ by rw [h], hom_ext _ _⟩ def mk (f : S ⟢ T.obj Y) : StructuredArrow S T := ⟨⟨⟨⟩⟩, Y, f⟩ #align category_theory.structured_arrow.mk CategoryTheory.StructuredArrow.mk @[simp] theorem mk_left (f : S ⟢ T.obj Y) : (mk f).left = ⟨⟨⟩⟩ := rfl #align category_theory.structured_arrow.mk_left CategoryTheory.StructuredArrow.mk_left @[simp] theorem mk_right (f : S ⟢ T.obj Y) : (mk f).right = Y := rfl #align category_theory.structured_arrow.mk_right CategoryTheory.StructuredArrow.mk_right @[simp] theorem mk_hom_eq_self (f : S ⟢ T.obj Y) : (mk f).hom = f := rfl #align category_theory.structured_arrow.mk_hom_eq_self CategoryTheory.StructuredArrow.mk_hom_eq_self @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Comma/StructuredArrow.lean
90
91
theorem w {A B : StructuredArrow S T} (f : A ⟢ B) : A.hom ≫ T.map f.right = B.hom := by
have := f.w; aesop_cat
0.0625
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]
Mathlib/Data/Vector/MapLemmas.lean
60
68
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
0.0625
import Mathlib.MeasureTheory.Constructions.Pi import Mathlib.MeasureTheory.Integral.Lebesgue open scoped Classical ENNReal open Set Function Equiv Finset noncomputable section namespace MeasureTheory section LMarginal variable {Ξ΄ Ξ΄' : Type*} {Ο€ : Ξ΄ β†’ Type*} [βˆ€ x, MeasurableSpace (Ο€ x)] variable {ΞΌ : βˆ€ i, Measure (Ο€ i)} [βˆ€ i, SigmaFinite (ΞΌ i)] [DecidableEq Ξ΄] variable {s t : Finset Ξ΄} {f g : (βˆ€ i, Ο€ i) β†’ ℝβ‰₯0∞} {x y : βˆ€ i, Ο€ i} {i : Ξ΄} def lmarginal (ΞΌ : βˆ€ i, Measure (Ο€ i)) (s : Finset Ξ΄) (f : (βˆ€ i, Ο€ i) β†’ ℝβ‰₯0∞) (x : βˆ€ i, Ο€ i) : ℝβ‰₯0∞ := ∫⁻ y : βˆ€ i : s, Ο€ i, f (updateFinset x s y) βˆ‚Measure.pi fun i : s => ΞΌ i -- Note: this notation is not a binder. This is more convenient since it returns a function. @[inherit_doc] notation "βˆ«β‹―βˆ«β»_" s ", " f " βˆ‚" ΞΌ:70 => lmarginal ΞΌ s f @[inherit_doc] notation "βˆ«β‹―βˆ«β»_" s ", " f => lmarginal (fun _ ↦ volume) s f variable (ΞΌ) theorem _root_.Measurable.lmarginal (hf : Measurable f) : Measurable (βˆ«β‹―βˆ«β»_s, f βˆ‚ΞΌ) := by refine Measurable.lintegral_prod_right ?_ refine hf.comp ?_ rw [measurable_pi_iff]; intro i by_cases hi : i ∈ s Β· simp [hi, updateFinset] exact measurable_pi_iff.1 measurable_snd _ Β· simp [hi, updateFinset] exact measurable_pi_iff.1 measurable_fst _ @[simp] theorem lmarginal_empty (f : (βˆ€ i, Ο€ i) β†’ ℝβ‰₯0∞) : βˆ«β‹―βˆ«β»_βˆ…, f βˆ‚ΞΌ = f := by ext1 x simp_rw [lmarginal, Measure.pi_of_empty fun i : (βˆ… : Finset Ξ΄) => ΞΌ i] apply lintegral_dirac' exact Subsingleton.measurable theorem lmarginal_congr {x y : βˆ€ i, Ο€ i} (f : (βˆ€ i, Ο€ i) β†’ ℝβ‰₯0∞) (h : βˆ€ i βˆ‰ s, x i = y i) : (βˆ«β‹―βˆ«β»_s, f βˆ‚ΞΌ) x = (βˆ«β‹―βˆ«β»_s, f βˆ‚ΞΌ) y := by dsimp [lmarginal, updateFinset_def]; rcongr; exact h _ β€Ή_β€Ί
Mathlib/MeasureTheory/Integral/Marginal.lean
110
116
theorem lmarginal_update_of_mem {i : Ξ΄} (hi : i ∈ s) (f : (βˆ€ i, Ο€ i) β†’ ℝβ‰₯0∞) (x : βˆ€ i, Ο€ i) (y : Ο€ i) : (βˆ«β‹―βˆ«β»_s, f βˆ‚ΞΌ) (Function.update x i y) = (βˆ«β‹―βˆ«β»_s, f βˆ‚ΞΌ) x := by
apply lmarginal_congr intro j hj have : j β‰  i := by rintro rfl; exact hj hi apply update_noteq this
0.0625
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Sieve def SecondObj : Type max v u := ∏ᢜ fun f : Ξ£(Y Z : _) (_ : Z ⟢ Y), { f' : Y ⟢ X // S f' } => P.obj (op f.2.1) #align category_theory.equalizer.sieve.second_obj CategoryTheory.Equalizer.Sieve.SecondObj variable {P S} -- Porting note (#10688): added to ease automation @[ext] lemma SecondObj.ext (z₁ zβ‚‚ : SecondObj P S) (h : βˆ€ (Y Z : C) (g : Z ⟢ Y) (f : Y ⟢ X) (hf : S.arrows f), (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, Z, g, f, hf⟩⟩ apply h variable (P S) def firstMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ (⟨_, _, S.downward_closed fg.2.2.2.2 fg.2.2.1⟩ : Ξ£Y, { f : Y ⟢ X // S f }) #align category_theory.equalizer.sieve.first_map CategoryTheory.Equalizer.Sieve.firstMap instance : Inhabited (SecondObj P (βŠ₯ : Sieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ ⟨_, fg.2.2.2⟩ ≫ P.map fg.2.2.1.op #align category_theory.equalizer.sieve.second_map CategoryTheory.Equalizer.Sieve.secondMap
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
133
135
theorem w : forkMap P (S : Presieve X) ≫ firstMap P S = forkMap P S ≫ secondMap P S := by
ext simp [firstMap, secondMap, forkMap]
0.0625
import Mathlib.Algebra.Group.Pi.Lemmas import Mathlib.Algebra.Module.Defs import Mathlib.GroupTheory.Abelianization import Mathlib.GroupTheory.FreeGroup.Basic #align_import group_theory.free_abelian_group from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe u v variable (Ξ± : Type u) def FreeAbelianGroup : Type u := Additive <| Abelianization <| FreeGroup Ξ± #align free_abelian_group FreeAbelianGroup -- FIXME: this is super broken, because the functions have type `Additive .. β†’ ..` -- instead of `FreeAbelianGroup Ξ± β†’ ..` and those are not defeq! instance FreeAbelianGroup.addCommGroup : AddCommGroup (FreeAbelianGroup Ξ±) := @Additive.addCommGroup _ <| Abelianization.commGroup _ instance : Inhabited (FreeAbelianGroup Ξ±) := ⟨0⟩ instance [IsEmpty Ξ±] : Unique (FreeAbelianGroup Ξ±) := by unfold FreeAbelianGroup; infer_instance variable {Ξ±} namespace FreeAbelianGroup def of (x : Ξ±) : FreeAbelianGroup Ξ± := Abelianization.of <| FreeGroup.of x #align free_abelian_group.of FreeAbelianGroup.of def lift {Ξ² : Type v} [AddCommGroup Ξ²] : (Ξ± β†’ Ξ²) ≃ (FreeAbelianGroup Ξ± β†’+ Ξ²) := (@FreeGroup.lift _ (Multiplicative Ξ²) _).trans <| (@Abelianization.lift _ _ (Multiplicative Ξ²) _).trans MonoidHom.toAdditive #align free_abelian_group.lift FreeAbelianGroup.lift namespace lift variable {Ξ² : Type v} [AddCommGroup Ξ²] (f : Ξ± β†’ Ξ²) open FreeAbelianGroup -- Porting note: needed to add `(Ξ² := Multiplicative Ξ²)` and `using 1`. @[simp] protected theorem of (x : Ξ±) : lift f (of x) = f x := by convert Abelianization.lift.of (FreeGroup.lift f (Ξ² := Multiplicative Ξ²)) (FreeGroup.of x) using 1 exact (FreeGroup.lift.of (Ξ² := Multiplicative Ξ²)).symm #align free_abelian_group.lift.of FreeAbelianGroup.lift.of protected theorem unique (g : FreeAbelianGroup Ξ± β†’+ Ξ²) (hg : βˆ€ x, g (of x) = f x) {x} : g x = lift f x := DFunLike.congr_fun (lift.symm_apply_eq.mp (funext hg : g ∘ of = f)) _ #align free_abelian_group.lift.unique FreeAbelianGroup.lift.unique @[ext high] protected theorem ext (g h : FreeAbelianGroup Ξ± β†’+ Ξ²) (H : βˆ€ x, g (of x) = h (of x)) : g = h := lift.symm.injective <| funext H #align free_abelian_group.lift.ext FreeAbelianGroup.lift.ext
Mathlib/GroupTheory/FreeAbelianGroup.lean
129
135
theorem map_hom {Ξ± Ξ² Ξ³} [AddCommGroup Ξ²] [AddCommGroup Ξ³] (a : FreeAbelianGroup Ξ±) (f : Ξ± β†’ Ξ²) (g : Ξ² β†’+ Ξ³) : g (lift f a) = lift (g ∘ f) a := by
show (g.comp (lift f)) a = lift (g ∘ f) a apply lift.unique intro a show g ((lift f) (of a)) = g (f a) simp only [(· ∘ ·), lift.of]
0.0625
import Mathlib.Analysis.SpecialFunctions.Integrals #align_import data.real.pi.wallis from "leanprover-community/mathlib"@"980755c33b9168bc82f774f665eaa27878140fac" open scoped Real Topology Nat open Filter Finset intervalIntegral namespace Real namespace Wallis set_option linter.uppercaseLean3 false noncomputable def W (k : β„•) : ℝ := ∏ i ∈ range k, (2 * i + 2) / (2 * i + 1) * ((2 * i + 2) / (2 * i + 3)) #align real.wallis.W Real.Wallis.W theorem W_succ (k : β„•) : W (k + 1) = W k * ((2 * k + 2) / (2 * k + 1) * ((2 * k + 2) / (2 * k + 3))) := prod_range_succ _ _ #align real.wallis.W_succ Real.Wallis.W_succ theorem W_pos (k : β„•) : 0 < W k := by induction' k with k hk Β· unfold W; simp Β· rw [W_succ] refine mul_pos hk (mul_pos (div_pos ?_ ?_) (div_pos ?_ ?_)) <;> positivity #align real.wallis.W_pos Real.Wallis.W_pos theorem W_eq_factorial_ratio (n : β„•) : W n = 2 ^ (4 * n) * n ! ^ 4 / ((2 * n)! ^ 2 * (2 * n + 1)) := by induction' n with n IH Β· simp only [W, prod_range_zero, Nat.factorial_zero, mul_zero, pow_zero, algebraMap.coe_one, one_pow, mul_one, algebraMap.coe_zero, zero_add, div_self, Ne, one_ne_zero, not_false_iff] norm_num Β· unfold W at IH ⊒ rw [prod_range_succ, IH, _root_.div_mul_div_comm, _root_.div_mul_div_comm] refine (div_eq_div_iff ?_ ?_).mpr ?_ any_goals exact ne_of_gt (by positivity) simp_rw [Nat.mul_succ, Nat.factorial_succ, pow_succ] push_cast ring_nf #align real.wallis.W_eq_factorial_ratio Real.Wallis.W_eq_factorial_ratio theorem W_eq_integral_sin_pow_div_integral_sin_pow (k : β„•) : (Ο€ / 2)⁻¹ * W k = (∫ x : ℝ in (0)..Ο€, sin x ^ (2 * k + 1)) / ∫ x : ℝ in (0)..Ο€, sin x ^ (2 * k) := by rw [integral_sin_pow_even, integral_sin_pow_odd, mul_div_mul_comm, ← prod_div_distrib, inv_div] simp_rw [div_div_div_comm, div_div_eq_mul_div, mul_div_assoc] rfl #align real.wallis.W_eq_integral_sin_pow_div_integral_sin_pow Real.Wallis.W_eq_integral_sin_pow_div_integral_sin_pow
Mathlib/Data/Real/Pi/Wallis.lean
85
88
theorem W_le (k : β„•) : W k ≀ Ο€ / 2 := by
rw [← div_le_one pi_div_two_pos, div_eq_inv_mul] rw [W_eq_integral_sin_pow_div_integral_sin_pow, div_le_one (integral_sin_pow_pos _)] apply integral_sin_pow_succ_le
0.0625
import Mathlib.Algebra.Lie.Matrix import Mathlib.LinearAlgebra.Matrix.SesquilinearForm import Mathlib.Tactic.NoncommRing #align_import algebra.lie.skew_adjoint from "leanprover-community/mathlib"@"075b3f7d19b9da85a0b54b3e33055a74fc388dec" universe u v w w₁ section SkewAdjointMatrices open scoped Matrix variable {R : Type u} {n : Type w} [CommRing R] [DecidableEq n] [Fintype n] variable (J : Matrix n n R) theorem Matrix.lie_transpose (A B : Matrix n n R) : ⁅A, B⁆ᡀ = ⁅Bα΅€, Aᡀ⁆ := show (A * B - B * A)α΅€ = Bα΅€ * Aα΅€ - Aα΅€ * Bα΅€ by simp #align matrix.lie_transpose Matrix.lie_transpose -- Porting note: Changed `(A B)` to `{A B}` for convenience in `skewAdjointMatricesLieSubalgebra`
Mathlib/Algebra/Lie/SkewAdjoint.lean
103
112
theorem Matrix.isSkewAdjoint_bracket {A B : Matrix n n R} (hA : A ∈ skewAdjointMatricesSubmodule J) (hB : B ∈ skewAdjointMatricesSubmodule J) : ⁅A, B⁆ ∈ skewAdjointMatricesSubmodule J := by
simp only [mem_skewAdjointMatricesSubmodule] at * change ⁅A, B⁆ᡀ * J = J * (-⁅A, B⁆) change Aα΅€ * J = J * (-A) at hA change Bα΅€ * J = J * (-B) at hB rw [Matrix.lie_transpose, LieRing.of_associative_ring_bracket, LieRing.of_associative_ring_bracket, sub_mul, mul_assoc, mul_assoc, hA, hB, ← mul_assoc, ← mul_assoc, hA, hB] noncomm_ring
0.0625
import Mathlib.Combinatorics.SetFamily.Shadow #align_import combinatorics.set_family.compression.uv from "leanprover-community/mathlib"@"6f8ab7de1c4b78a68ab8cf7dd83d549eb78a68a1" open Finset variable {Ξ± : Type*} theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra Ξ±] (u v : Ξ±) : { x | Disjoint u x ∧ v ≀ x }.InjOn fun x => (x βŠ” u) \ v := by rintro a ha b hb hab have h : ((a βŠ” u) \ v) \ u βŠ” v = ((b βŠ” u) \ v) \ u βŠ” v := by dsimp at hab rw [hab] rwa [sdiff_sdiff_comm, ha.1.symm.sup_sdiff_cancel_right, sdiff_sdiff_comm, hb.1.symm.sup_sdiff_cancel_right, sdiff_sup_cancel ha.2, sdiff_sup_cancel hb.2] at h #align sup_sdiff_inj_on sup_sdiff_injOn -- The namespace is here to distinguish from other compressions. namespace UV section GeneralizedBooleanAlgebra variable [GeneralizedBooleanAlgebra Ξ±] [DecidableRel (@Disjoint Ξ± _ _)] [DecidableRel ((Β· ≀ Β·) : Ξ± β†’ Ξ± β†’ Prop)] {s : Finset Ξ±} {u v a b : Ξ±} def compress (u v a : Ξ±) : Ξ± := if Disjoint u a ∧ v ≀ a then (a βŠ” u) \ v else a #align uv.compress UV.compress theorem compress_of_disjoint_of_le (hua : Disjoint u a) (hva : v ≀ a) : compress u v a = (a βŠ” u) \ v := if_pos ⟨hua, hva⟩ #align uv.compress_of_disjoint_of_le UV.compress_of_disjoint_of_le theorem compress_of_disjoint_of_le' (hva : Disjoint v a) (hua : u ≀ a) : compress u v ((a βŠ” v) \ u) = a := by rw [compress_of_disjoint_of_le disjoint_sdiff_self_right (le_sdiff.2 ⟨(le_sup_right : v ≀ a βŠ” v), hva.mono_right hua⟩), sdiff_sup_cancel (le_sup_of_le_left hua), hva.symm.sup_sdiff_cancel_right] #align uv.compress_of_disjoint_of_le' UV.compress_of_disjoint_of_le' @[simp] theorem compress_self (u a : Ξ±) : compress u u a = a := by unfold compress split_ifs with h Β· exact h.1.symm.sup_sdiff_cancel_right Β· rfl #align uv.compress_self UV.compress_self @[simp] theorem compress_sdiff_sdiff (a b : Ξ±) : compress (a \ b) (b \ a) b = a := by refine (compress_of_disjoint_of_le disjoint_sdiff_self_left sdiff_le).trans ?_ rw [sup_sdiff_self_right, sup_sdiff, disjoint_sdiff_self_right.sdiff_eq_left, sup_eq_right] exact sdiff_sdiff_le #align uv.compress_sdiff_sdiff UV.compress_sdiff_sdiff @[simp] theorem compress_idem (u v a : Ξ±) : compress u v (compress u v a) = compress u v a := by unfold compress split_ifs with h h' Β· rw [le_sdiff_iff.1 h'.2, sdiff_bot, sdiff_bot, sup_assoc, sup_idem] Β· rfl Β· rfl #align uv.compress_idem UV.compress_idem variable [DecidableEq Ξ±] def compression (u v : Ξ±) (s : Finset Ξ±) := (s.filter (compress u v Β· ∈ s)) βˆͺ (s.image <| compress u v).filter (Β· βˆ‰ s) #align uv.compression UV.compression @[inherit_doc] scoped[FinsetFamily] notation "𝓒 " => UV.compression open scoped FinsetFamily def IsCompressed (u v : Ξ±) (s : Finset Ξ±) := 𝓒 u v s = s #align uv.is_compressed UV.IsCompressed theorem compress_injOn : Set.InjOn (compress u v) ↑(s.filter (compress u v Β· βˆ‰ s)) := by intro a ha b hb hab rw [mem_coe, mem_filter] at ha hb rw [compress] at ha hab split_ifs at ha hab with has Β· rw [compress] at hb hab split_ifs at hb hab with hbs Β· exact sup_sdiff_injOn u v has hbs hab Β· exact (hb.2 hb.1).elim Β· exact (ha.2 ha.1).elim #align uv.compress_inj_on UV.compress_injOn
Mathlib/Combinatorics/SetFamily/Compression/UV.lean
156
158
theorem mem_compression : a ∈ 𝓒 u v s ↔ a ∈ s ∧ compress u v a ∈ s ∨ a βˆ‰ s ∧ βˆƒ b ∈ s, compress u v b = a := by
simp_rw [compression, mem_union, mem_filter, mem_image, and_comm]
0.0625
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics import Mathlib.NumberTheory.Liouville.Basic import Mathlib.Topology.Instances.Irrational #align_import number_theory.liouville.liouville_with from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" open Filter Metric Real Set open scoped Filter Topology def LiouvilleWith (p x : ℝ) : Prop := βˆƒ C, βˆƒαΆ  n : β„• in atTop, βˆƒ m : β„€, x β‰  m / n ∧ |x - m / n| < C / n ^ p #align liouville_with LiouvilleWith theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x := by use 2 refine ((eventually_gt_atTop 0).mono fun n hn => ?_).frequently have hn' : (0 : ℝ) < n := by simpa have : x < ↑(⌊x * ↑nβŒ‹ + 1) / ↑n := by rw [lt_div_iff hn', Int.cast_add, Int.cast_one]; exact Int.lt_floor_add_one _ refine ⟨⌊x * nβŒ‹ + 1, this.ne, ?_⟩ rw [abs_sub_comm, abs_of_pos (sub_pos.2 this), rpow_one, sub_lt_iff_lt_add', add_div_eq_mul_add_div _ _ hn'.ne'] gcongr calc _ ≀ x * n + 1 := by push_cast; gcongr; apply Int.floor_le _ < x * n + 2 := by linarith #align liouville_with_one liouvilleWith_one namespace LiouvilleWith variable {p q x y : ℝ} {r : β„š} {m : β„€} {n : β„•} theorem exists_pos (h : LiouvilleWith p x) : βˆƒ (C : ℝ) (_hβ‚€ : 0 < C), βˆƒαΆ  n : β„• in atTop, 1 ≀ n ∧ βˆƒ m : β„€, x β‰  m / n ∧ |x - m / n| < C / n ^ p := by rcases h with ⟨C, hC⟩ refine ⟨max C 1, zero_lt_one.trans_le <| le_max_right _ _, ?_⟩ refine ((eventually_ge_atTop 1).and_frequently hC).mono ?_ rintro n ⟨hle, m, hne, hlt⟩ refine ⟨hle, m, hne, hlt.trans_le ?_⟩ gcongr apply le_max_left #align liouville_with.exists_pos LiouvilleWith.exists_pos
Mathlib/NumberTheory/Liouville/LiouvilleWith.lean
89
94
theorem mono (h : LiouvilleWith p x) (hle : q ≀ p) : LiouvilleWith q x := by
rcases h.exists_pos with ⟨C, hCβ‚€, hC⟩ refine ⟨C, hC.mono ?_⟩; rintro n ⟨hn, m, hne, hlt⟩ refine ⟨m, hne, hlt.trans_le <| ?_⟩ gcongr exact_mod_cast hn
0.0625
import Mathlib.Order.Lattice import Mathlib.Data.List.Sort import Mathlib.Logic.Equiv.Fin import Mathlib.Logic.Equiv.Functor import Mathlib.Data.Fintype.Card import Mathlib.Order.RelSeries #align_import order.jordan_holder from "leanprover-community/mathlib"@"91288e351d51b3f0748f0a38faa7613fb0ae2ada" universe u open Set RelSeries class JordanHolderLattice (X : Type u) [Lattice X] where IsMaximal : X β†’ X β†’ Prop lt_of_isMaximal : βˆ€ {x y}, IsMaximal x y β†’ x < y sup_eq_of_isMaximal : βˆ€ {x y z}, IsMaximal x z β†’ IsMaximal y z β†’ x β‰  y β†’ x βŠ” y = z isMaximal_inf_left_of_isMaximal_sup : βˆ€ {x y}, IsMaximal x (x βŠ” y) β†’ IsMaximal y (x βŠ” y) β†’ IsMaximal (x βŠ“ y) x Iso : X Γ— X β†’ X Γ— X β†’ Prop iso_symm : βˆ€ {x y}, Iso x y β†’ Iso y x iso_trans : βˆ€ {x y z}, Iso x y β†’ Iso y z β†’ Iso x z second_iso : βˆ€ {x y}, IsMaximal x (x βŠ” y) β†’ Iso (x, x βŠ” y) (x βŠ“ y, y) #align jordan_holder_lattice JordanHolderLattice namespace JordanHolderLattice variable {X : Type u} [Lattice X] [JordanHolderLattice X] theorem isMaximal_inf_right_of_isMaximal_sup {x y : X} (hxz : IsMaximal x (x βŠ” y)) (hyz : IsMaximal y (x βŠ” y)) : IsMaximal (x βŠ“ y) y := by rw [inf_comm] rw [sup_comm] at hxz hyz exact isMaximal_inf_left_of_isMaximal_sup hyz hxz #align jordan_holder_lattice.is_maximal_inf_right_of_is_maximal_sup JordanHolderLattice.isMaximal_inf_right_of_isMaximal_sup
Mathlib/Order/JordanHolder.lean
109
113
theorem isMaximal_of_eq_inf (x b : X) {a y : X} (ha : x βŠ“ y = a) (hxy : x β‰  y) (hxb : IsMaximal x b) (hyb : IsMaximal y b) : IsMaximal a y := by
have hb : x βŠ” y = b := sup_eq_of_isMaximal hxb hyb hxy substs a b exact isMaximal_inf_right_of_isMaximal_sup hxb hyb
0.0625
import Mathlib.Algebra.Quaternion import Mathlib.Tactic.Ring #align_import algebra.quaternion_basis from "leanprover-community/mathlib"@"3aa5b8a9ed7a7cabd36e6e1d022c9858ab8a8c2d" open Quaternion namespace QuaternionAlgebra structure Basis {R : Type*} (A : Type*) [CommRing R] [Ring A] [Algebra R A] (c₁ cβ‚‚ : R) where (i j k : A) i_mul_i : i * i = c₁ β€’ (1 : A) j_mul_j : j * j = cβ‚‚ β€’ (1 : A) i_mul_j : i * j = k j_mul_i : j * i = -k #align quaternion_algebra.basis QuaternionAlgebra.Basis variable {R : Type*} {A B : Type*} [CommRing R] [Ring A] [Ring B] [Algebra R A] [Algebra R B] variable {c₁ cβ‚‚ : R} namespace Basis @[ext] protected theorem ext ⦃q₁ qβ‚‚ : Basis A c₁ c₂⦄ (hi : q₁.i = qβ‚‚.i) (hj : q₁.j = qβ‚‚.j) : q₁ = qβ‚‚ := by cases q₁; rename_i q₁_i_mul_j _ cases qβ‚‚; rename_i qβ‚‚_i_mul_j _ congr rw [← q₁_i_mul_j, ← qβ‚‚_i_mul_j] congr #align quaternion_algebra.basis.ext QuaternionAlgebra.Basis.ext variable (R) @[simps i j k] protected def self : Basis ℍ[R,c₁,cβ‚‚] c₁ cβ‚‚ where i := ⟨0, 1, 0, 0⟩ i_mul_i := by ext <;> simp j := ⟨0, 0, 1, 0⟩ j_mul_j := by ext <;> simp k := ⟨0, 0, 0, 1⟩ i_mul_j := by ext <;> simp j_mul_i := by ext <;> simp #align quaternion_algebra.basis.self QuaternionAlgebra.Basis.self variable {R} instance : Inhabited (Basis ℍ[R,c₁,cβ‚‚] c₁ cβ‚‚) := ⟨Basis.self R⟩ variable (q : Basis A c₁ cβ‚‚) attribute [simp] i_mul_i j_mul_j i_mul_j j_mul_i @[simp] theorem i_mul_k : q.i * q.k = c₁ β€’ q.j := by rw [← i_mul_j, ← mul_assoc, i_mul_i, smul_mul_assoc, one_mul] #align quaternion_algebra.basis.i_mul_k QuaternionAlgebra.Basis.i_mul_k @[simp] theorem k_mul_i : q.k * q.i = -c₁ β€’ q.j := by rw [← i_mul_j, mul_assoc, j_mul_i, mul_neg, i_mul_k, neg_smul] #align quaternion_algebra.basis.k_mul_i QuaternionAlgebra.Basis.k_mul_i @[simp] theorem k_mul_j : q.k * q.j = cβ‚‚ β€’ q.i := by rw [← i_mul_j, mul_assoc, j_mul_j, mul_smul_comm, mul_one] #align quaternion_algebra.basis.k_mul_j QuaternionAlgebra.Basis.k_mul_j @[simp]
Mathlib/Algebra/QuaternionBasis.lean
99
100
theorem j_mul_k : q.j * q.k = -cβ‚‚ β€’ q.i := by
rw [← i_mul_j, ← mul_assoc, j_mul_i, neg_mul, k_mul_j, neg_smul]
0.0625
import Mathlib.Analysis.Calculus.ContDiff.RCLike import Mathlib.MeasureTheory.Measure.Hausdorff #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92" open scoped MeasureTheory ENNReal NNReal Topology open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y] @[irreducible] noncomputable def dimH (s : Set X) : ℝβ‰₯0∞ := by borelize X; exact ⨆ (d : ℝβ‰₯0) (_ : @hausdorffMeasure X _ _ ⟨rfl⟩ d s = ∞), d set_option linter.uppercaseLean3 false in #align dimH dimH section Measurable variable [MeasurableSpace X] [BorelSpace X]
Mathlib/Topology/MetricSpace/HausdorffDimension.lean
110
111
theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝβ‰₯0) (_ : ΞΌH[d] s = ∞), (d : ℝβ‰₯0∞) := by
borelize X; rw [dimH]
0.0625
import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals import Mathlib.Analysis.Calculus.ParametricIntegral import Mathlib.MeasureTheory.Measure.Haar.NormedSpace #align_import analysis.mellin_transform from "leanprover-community/mathlib"@"917c3c072e487b3cccdbfeff17e75b40e45f66cb" open MeasureTheory Set Filter Asymptotics TopologicalSpace open Real open Complex hiding exp log abs_of_nonneg open scoped Topology noncomputable section section Defs variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E] def MellinConvergent (f : ℝ β†’ E) (s : β„‚) : Prop := IntegrableOn (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) (Ioi 0) #align mellin_convergent MellinConvergent theorem MellinConvergent.const_smul {f : ℝ β†’ E} {s : β„‚} (hf : MellinConvergent f s) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : MellinConvergent (fun t => c β€’ f t) s := by simpa only [MellinConvergent, smul_comm] using hf.smul c #align mellin_convergent.const_smul MellinConvergent.const_smul theorem MellinConvergent.cpow_smul {f : ℝ β†’ E} {s a : β„‚} : MellinConvergent (fun t => (t : β„‚) ^ a β€’ f t) s ↔ MellinConvergent f (s + a) := by refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_convergent.cpow_smul MellinConvergent.cpow_smul nonrec theorem MellinConvergent.div_const {f : ℝ β†’ β„‚} {s : β„‚} (hf : MellinConvergent f s) (a : β„‚) : MellinConvergent (fun t => f t / a) s := by simpa only [MellinConvergent, smul_eq_mul, ← mul_div_assoc] using hf.div_const a #align mellin_convergent.div_const MellinConvergent.div_const theorem MellinConvergent.comp_mul_left {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : 0 < a) : MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s := by have := integrableOn_Ioi_comp_mul_left_iff (fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f t) 0 ha rw [mul_zero] at this have h1 : EqOn (fun t : ℝ => (↑(a * t) : β„‚) ^ (s - 1) β€’ f (a * t)) ((a : β„‚) ^ (s - 1) β€’ fun t : ℝ => (t : β„‚) ^ (s - 1) β€’ f (a * t)) (Ioi 0) := fun t ht ↦ by simp only [ofReal_mul, mul_cpow_ofReal_nonneg ha.le (le_of_lt ht), mul_smul, Pi.smul_apply] have h2 : (a : β„‚) ^ (s - 1) β‰  0 := by rw [Ne, cpow_eq_zero_iff, not_and_or, ofReal_eq_zero] exact Or.inl ha.ne' rw [MellinConvergent, MellinConvergent, ← this, integrableOn_congr_fun h1 measurableSet_Ioi, IntegrableOn, IntegrableOn, integrable_smul_iff h2] #align mellin_convergent.comp_mul_left MellinConvergent.comp_mul_left theorem MellinConvergent.comp_rpow {f : ℝ β†’ E} {s : β„‚} {a : ℝ} (ha : a β‰  0) : MellinConvergent (fun t => f (t ^ a)) s ↔ MellinConvergent f (s / a) := by refine Iff.trans ?_ (integrableOn_Ioi_comp_rpow_iff' _ ha) rw [MellinConvergent] refine integrableOn_congr_fun (fun t ht => ?_) measurableSet_Ioi dsimp only [Pi.smul_apply] rw [← Complex.coe_smul (t ^ (a - 1)), ← mul_smul, ← cpow_mul_ofReal_nonneg (le_of_lt ht), ofReal_cpow (le_of_lt ht), ← cpow_add _ _ (ofReal_ne_zero.mpr (ne_of_gt ht)), ofReal_sub, ofReal_one, mul_sub, mul_div_cancelβ‚€ _ (ofReal_ne_zero.mpr ha), mul_one, add_comm, ← add_sub_assoc, sub_add_cancel] #align mellin_convergent.comp_rpow MellinConvergent.comp_rpow def Complex.VerticalIntegrable (f : β„‚ β†’ E) (Οƒ : ℝ) (ΞΌ : Measure ℝ := by volume_tac) : Prop := Integrable (fun (y : ℝ) ↦ f (Οƒ + y * I)) ΞΌ def mellin (f : ℝ β†’ E) (s : β„‚) : E := ∫ t : ℝ in Ioi 0, (t : β„‚) ^ (s - 1) β€’ f t #align mellin mellin def mellinInv (Οƒ : ℝ) (f : β„‚ β†’ E) (x : ℝ) : E := (1 / (2 * Ο€)) β€’ ∫ y : ℝ, (x : β„‚) ^ (-(Οƒ + y * I)) β€’ f (Οƒ + y * I) -- next few lemmas don't require convergence of the Mellin transform (they are just 0 = 0 otherwise) theorem mellin_cpow_smul (f : ℝ β†’ E) (s a : β„‚) : mellin (fun t => (t : β„‚) ^ a β€’ f t) s = mellin f (s + a) := by refine setIntegral_congr measurableSet_Ioi fun t ht => ?_ simp_rw [← sub_add_eq_add_sub, cpow_add _ _ (ofReal_ne_zero.2 <| ne_of_gt ht), mul_smul] #align mellin_cpow_smul mellin_cpow_smul theorem mellin_const_smul (f : ℝ β†’ E) (s : β„‚) {π•œ : Type*} [NontriviallyNormedField π•œ] [NormedSpace π•œ E] [SMulCommClass β„‚ π•œ E] (c : π•œ) : mellin (fun t => c β€’ f t) s = c β€’ mellin f s := by simp only [mellin, smul_comm, integral_smul] #align mellin_const_smul mellin_const_smul
Mathlib/Analysis/MellinTransform.lean
117
118
theorem mellin_div_const (f : ℝ β†’ β„‚) (s a : β„‚) : mellin (fun t => f t / a) s = mellin f s / a := by
simp_rw [mellin, smul_eq_mul, ← mul_div_assoc, integral_div]
0.0625
import Mathlib.Computability.Halting import Mathlib.Computability.TuringMachine import Mathlib.Data.Num.Lemmas import Mathlib.Tactic.DeriveFintype #align_import computability.tm_to_partrec from "leanprover-community/mathlib"@"6155d4351090a6fad236e3d2e4e0e4e7342668e8" open Function (update) open Relation namespace Turing namespace ToPartrec inductive Code | zero' | succ | tail | cons : Code β†’ Code β†’ Code | comp : Code β†’ Code β†’ Code | case : Code β†’ Code β†’ Code | fix : Code β†’ Code deriving DecidableEq, Inhabited #align turing.to_partrec.code Turing.ToPartrec.Code #align turing.to_partrec.code.zero' Turing.ToPartrec.Code.zero' #align turing.to_partrec.code.succ Turing.ToPartrec.Code.succ #align turing.to_partrec.code.tail Turing.ToPartrec.Code.tail #align turing.to_partrec.code.cons Turing.ToPartrec.Code.cons #align turing.to_partrec.code.comp Turing.ToPartrec.Code.comp #align turing.to_partrec.code.case Turing.ToPartrec.Code.case #align turing.to_partrec.code.fix Turing.ToPartrec.Code.fix def Code.eval : Code β†’ List β„• β†’. List β„• | Code.zero' => fun v => pure (0 :: v) | Code.succ => fun v => pure [v.headI.succ] | Code.tail => fun v => pure v.tail | Code.cons f fs => fun v => do let n ← Code.eval f v let ns ← Code.eval fs v pure (n.headI :: ns) | Code.comp f g => fun v => g.eval v >>= f.eval | Code.case f g => fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) | Code.fix f => PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail #align turing.to_partrec.code.eval Turing.ToPartrec.Code.eval namespace Code @[simp] theorem zero'_eval : zero'.eval = fun v => pure (0 :: v) := by simp [eval] @[simp] theorem succ_eval : succ.eval = fun v => pure [v.headI.succ] := by simp [eval] @[simp] theorem tail_eval : tail.eval = fun v => pure v.tail := by simp [eval] @[simp] theorem cons_eval (f fs) : (cons f fs).eval = fun v => do { let n ← Code.eval f v let ns ← Code.eval fs v pure (n.headI :: ns) } := by simp [eval] @[simp] theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval := by simp [eval] @[simp] theorem case_eval (f g) : (case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail) := by simp [eval] @[simp] theorem fix_eval (f) : (fix f).eval = PFun.fix fun v => (f.eval v).map fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail := by simp [eval] def nil : Code := tail.comp succ #align turing.to_partrec.code.nil Turing.ToPartrec.Code.nil @[simp] theorem nil_eval (v) : nil.eval v = pure [] := by simp [nil] #align turing.to_partrec.code.nil_eval Turing.ToPartrec.Code.nil_eval def id : Code := tail.comp zero' #align turing.to_partrec.code.id Turing.ToPartrec.Code.id @[simp] theorem id_eval (v) : id.eval v = pure v := by simp [id] #align turing.to_partrec.code.id_eval Turing.ToPartrec.Code.id_eval def head : Code := cons id nil #align turing.to_partrec.code.head Turing.ToPartrec.Code.head @[simp]
Mathlib/Computability/TMToPartrec.lean
192
192
theorem head_eval (v) : head.eval v = pure [v.headI] := by
simp [head]
0.0625
import Mathlib.Algebra.CharP.Invertible import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Analysis.Normed.Group.AddTorsor import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.normed_space.add_torsor from "leanprover-community/mathlib"@"837f72de63ad6cd96519cde5f1ffd5ed8d280ad0" noncomputable section open NNReal Topology open Filter variable {Ξ± V P W Q : Type*} [SeminormedAddCommGroup V] [PseudoMetricSpace P] [NormedAddTorsor V P] [NormedAddCommGroup W] [MetricSpace Q] [NormedAddTorsor W Q] section NormedSpace variable {π•œ : Type*} [NormedField π•œ] [NormedSpace π•œ V] [NormedSpace π•œ W] open AffineMap theorem AffineSubspace.isClosed_direction_iff (s : AffineSubspace π•œ Q) : IsClosed (s.direction : Set W) ↔ IsClosed (s : Set Q) := by rcases s.eq_bot_or_nonempty with (rfl | ⟨x, hx⟩); Β· simp [isClosed_singleton] rw [← (IsometryEquiv.vaddConst x).toHomeomorph.symm.isClosed_image, AffineSubspace.coe_direction_eq_vsub_set_right hx] rfl #align affine_subspace.is_closed_direction_iff AffineSubspace.isClosed_direction_iff @[simp] theorem dist_center_homothety (p₁ pβ‚‚ : P) (c : π•œ) : dist p₁ (homothety p₁ c pβ‚‚) = β€–cβ€– * dist p₁ pβ‚‚ := by simp [homothety_def, norm_smul, ← dist_eq_norm_vsub, dist_comm] #align dist_center_homothety dist_center_homothety @[simp] theorem nndist_center_homothety (p₁ pβ‚‚ : P) (c : π•œ) : nndist p₁ (homothety p₁ c pβ‚‚) = β€–cβ€–β‚Š * nndist p₁ pβ‚‚ := NNReal.eq <| dist_center_homothety _ _ _ #align nndist_center_homothety nndist_center_homothety @[simp] theorem dist_homothety_center (p₁ pβ‚‚ : P) (c : π•œ) : dist (homothety p₁ c pβ‚‚) p₁ = β€–cβ€– * dist p₁ pβ‚‚ := by rw [dist_comm, dist_center_homothety] #align dist_homothety_center dist_homothety_center @[simp] theorem nndist_homothety_center (p₁ pβ‚‚ : P) (c : π•œ) : nndist (homothety p₁ c pβ‚‚) p₁ = β€–cβ€–β‚Š * nndist p₁ pβ‚‚ := NNReal.eq <| dist_homothety_center _ _ _ #align nndist_homothety_center nndist_homothety_center @[simp] theorem dist_lineMap_lineMap (p₁ pβ‚‚ : P) (c₁ cβ‚‚ : π•œ) : dist (lineMap p₁ pβ‚‚ c₁) (lineMap p₁ pβ‚‚ cβ‚‚) = dist c₁ cβ‚‚ * dist p₁ pβ‚‚ := by rw [dist_comm p₁ pβ‚‚] simp only [lineMap_apply, dist_eq_norm_vsub, vadd_vsub_vadd_cancel_right, ← sub_smul, norm_smul, vsub_eq_sub] #align dist_line_map_line_map dist_lineMap_lineMap @[simp] theorem nndist_lineMap_lineMap (p₁ pβ‚‚ : P) (c₁ cβ‚‚ : π•œ) : nndist (lineMap p₁ pβ‚‚ c₁) (lineMap p₁ pβ‚‚ cβ‚‚) = nndist c₁ cβ‚‚ * nndist p₁ pβ‚‚ := NNReal.eq <| dist_lineMap_lineMap _ _ _ _ #align nndist_line_map_line_map nndist_lineMap_lineMap theorem lipschitzWith_lineMap (p₁ pβ‚‚ : P) : LipschitzWith (nndist p₁ pβ‚‚) (lineMap p₁ pβ‚‚ : π•œ β†’ P) := LipschitzWith.of_dist_le_mul fun c₁ cβ‚‚ => ((dist_lineMap_lineMap p₁ pβ‚‚ c₁ cβ‚‚).trans (mul_comm _ _)).le #align lipschitz_with_line_map lipschitzWith_lineMap @[simp]
Mathlib/Analysis/NormedSpace/AddTorsor.lean
87
88
theorem dist_lineMap_left (p₁ pβ‚‚ : P) (c : π•œ) : dist (lineMap p₁ pβ‚‚ c) p₁ = β€–cβ€– * dist p₁ pβ‚‚ := by
simpa only [lineMap_apply_zero, dist_zero_right] using dist_lineMap_lineMap p₁ pβ‚‚ c 0
0.0625
import Mathlib.Combinatorics.SetFamily.Shadow #align_import combinatorics.set_family.compression.uv from "leanprover-community/mathlib"@"6f8ab7de1c4b78a68ab8cf7dd83d549eb78a68a1" open Finset variable {Ξ± : Type*} theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra Ξ±] (u v : Ξ±) : { x | Disjoint u x ∧ v ≀ x }.InjOn fun x => (x βŠ” u) \ v := by rintro a ha b hb hab have h : ((a βŠ” u) \ v) \ u βŠ” v = ((b βŠ” u) \ v) \ u βŠ” v := by dsimp at hab rw [hab] rwa [sdiff_sdiff_comm, ha.1.symm.sup_sdiff_cancel_right, sdiff_sdiff_comm, hb.1.symm.sup_sdiff_cancel_right, sdiff_sup_cancel ha.2, sdiff_sup_cancel hb.2] at h #align sup_sdiff_inj_on sup_sdiff_injOn -- The namespace is here to distinguish from other compressions. namespace UV section GeneralizedBooleanAlgebra variable [GeneralizedBooleanAlgebra Ξ±] [DecidableRel (@Disjoint Ξ± _ _)] [DecidableRel ((Β· ≀ Β·) : Ξ± β†’ Ξ± β†’ Prop)] {s : Finset Ξ±} {u v a b : Ξ±} def compress (u v a : Ξ±) : Ξ± := if Disjoint u a ∧ v ≀ a then (a βŠ” u) \ v else a #align uv.compress UV.compress theorem compress_of_disjoint_of_le (hua : Disjoint u a) (hva : v ≀ a) : compress u v a = (a βŠ” u) \ v := if_pos ⟨hua, hva⟩ #align uv.compress_of_disjoint_of_le UV.compress_of_disjoint_of_le theorem compress_of_disjoint_of_le' (hva : Disjoint v a) (hua : u ≀ a) : compress u v ((a βŠ” v) \ u) = a := by rw [compress_of_disjoint_of_le disjoint_sdiff_self_right (le_sdiff.2 ⟨(le_sup_right : v ≀ a βŠ” v), hva.mono_right hua⟩), sdiff_sup_cancel (le_sup_of_le_left hua), hva.symm.sup_sdiff_cancel_right] #align uv.compress_of_disjoint_of_le' UV.compress_of_disjoint_of_le' @[simp]
Mathlib/Combinatorics/SetFamily/Compression/UV.lean
98
102
theorem compress_self (u a : Ξ±) : compress u u a = a := by
unfold compress split_ifs with h Β· exact h.1.symm.sup_sdiff_cancel_right Β· rfl
0.0625